mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-26 10:55:27 +00:00
fix(asset): resolve DTO schema and test typecheck errors for proxyType
This commit is contained in:
@@ -409,7 +409,8 @@ describe('DatabaseSessionStorage', () => {
|
||||
name: 'test.png',
|
||||
type: 'file',
|
||||
mediaType: 'image/png',
|
||||
media: { proxyType: 'image' },
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- partial MediaInfo mock for testing
|
||||
media: { proxyType: 'image' } as any,
|
||||
projectId: project.id,
|
||||
status: 'uploaded',
|
||||
},
|
||||
@@ -462,7 +463,8 @@ describe('DatabaseSessionStorage', () => {
|
||||
name: 'test.mp4',
|
||||
type: 'file',
|
||||
mediaType: 'video/mp4',
|
||||
media: { proxyType: 'video' },
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- partial MediaInfo mock for testing
|
||||
media: { proxyType: 'video' } as any,
|
||||
projectId: project.id,
|
||||
status: 'uploaded',
|
||||
},
|
||||
|
||||
@@ -181,7 +181,8 @@ describe('ChatService', () => {
|
||||
name: 'doc.jpg',
|
||||
type: 'file',
|
||||
mediaType: 'image/jpeg',
|
||||
media: { proxyType: 'image' },
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- partial MediaInfo mock for testing
|
||||
media: { proxyType: 'image' } as any,
|
||||
status: 'processed',
|
||||
projectId: project.id,
|
||||
parentId: childFolder.id,
|
||||
|
||||
@@ -109,6 +109,7 @@ export const assetInfoSchema = z.object({
|
||||
videoPreview: z.object({ url: z.string(), key: z.string().optional() }).optional(),
|
||||
pdfTranscode: z.object({ url: z.string(), key: z.string().optional() }).optional(),
|
||||
mimeType: z.string().optional(),
|
||||
proxyType: z.enum(['image', 'video', 'audio', 'pdf']).nullable().optional(),
|
||||
metadata: mediaMetadataSchema.optional(),
|
||||
})
|
||||
.optional(),
|
||||
|
||||
@@ -230,7 +230,8 @@ describe.each(['local', 'temporal'] as const)(
|
||||
type: 'file',
|
||||
status: 'uploaded',
|
||||
mediaType: 'image/png',
|
||||
media: { proxyType: 'image' },
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- partial MediaInfo mock for testing
|
||||
media: { proxyType: 'image' } as any,
|
||||
projectId: project.id,
|
||||
storageKeyId: storageKey.id,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user