mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 21:23:45 +01:00
[editor-core] gracefully handle verbose project_output_file details (#36552)
GitOrigin-RevId: 2c549db61dc05c02729bf80c8fbd3f31d52f1e9c
This commit is contained in:
@@ -113,7 +113,8 @@ const rawLinkedFileData = z.discriminatedUnion('provider', [
|
||||
v1_source_doc_id: z.number().optional(),
|
||||
source_output_file_path: z.string(),
|
||||
build_id: zz.buildId().optional(),
|
||||
clsiServerId: z.string().optional(),
|
||||
compileGroup: zz.compileGroup().optional(),
|
||||
clsiServerId: zz.clsiServerId().optional(),
|
||||
importedAt: z.iso.datetime().optional(),
|
||||
}),
|
||||
z.strictObject({
|
||||
|
||||
@@ -156,6 +156,19 @@ describe('schemas', function () {
|
||||
expect(result.success).to.equal(true)
|
||||
})
|
||||
|
||||
it('accepts a project_output_file provider with verbose details', function () {
|
||||
const result = rawLinkedFileData.safeParse({
|
||||
provider: 'project_output_file',
|
||||
source_project_id: '507f1f77bcf86cd799439011',
|
||||
source_output_file_path: 'output.pdf',
|
||||
compileGroup: 'standard',
|
||||
clsiServerId: 'clsi-pre-emp-e2-f-tqnd',
|
||||
build_id: '1234-abcd',
|
||||
importedAt: '2026-08-14T00:00:00.000Z',
|
||||
})
|
||||
expect(result.success).to.equal(true)
|
||||
})
|
||||
|
||||
it('rejects a project_output_file provider with a malformed build_id', function () {
|
||||
const result = rawLinkedFileData.safeParse({
|
||||
provider: 'project_output_file',
|
||||
|
||||
Reference in New Issue
Block a user