refactor(workflow): enforce strict nested type safety for WorkflowTaskPayload

This commit is contained in:
yiling
2026-05-28 09:48:05 +08:00
parent 911e369782
commit 11d2e89a48
18 changed files with 185 additions and 98 deletions
+3 -3
View File
@@ -216,7 +216,7 @@ describe('TranscodeService', () => {
})
it('should create transcode tasks correctly', async () => {
const task = (await transcodeService.createVideoTranscodeTask('asset-123', {
const task = (await transcodeService.createVideoTranscodeTask('asset-123', 'proj-123', {
videoStrategy: 'single',
thumbnail: true,
})) as WorkflowTask
@@ -224,7 +224,7 @@ describe('TranscodeService', () => {
expect(task.assetId).toBe('asset-123')
expect(task.type).toBe('transcode')
expect(task.status).toBe('pending')
// eslint-disable-next-line @typescript-eslint/no-explicit-any
expect((task.payload as any).videoStrategy).toBe('single')
expect(task.payload?.projectId).toBe('proj-123')
expect(task.payload?.transcode?.videoStrategy).toBe('single')
})
})