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
+11 -5
View File
@@ -125,9 +125,12 @@ describe('UploadService', () => {
})
expect(workflowTask).toBeDefined()
expect(workflowTask?.payload).toEqual({
videoStrategy: 'single',
sprite: true,
poster: true,
projectId: projectId,
transcode: {
videoStrategy: 'single',
sprite: true,
poster: true,
},
})
})
@@ -159,8 +162,11 @@ describe('UploadService', () => {
})
expect(workflowTask).toBeDefined()
expect(workflowTask?.payload).toEqual({
imageStrategy: 'single',
thumbnail: true,
projectId: projectId,
transcode: {
imageStrategy: 'single',
thumbnail: true,
},
})
})
+12 -3
View File
@@ -254,7 +254,10 @@ export class UploadService {
status: WorkflowTaskStatus.pending,
teamId: team.id,
projectId: asset.projectId,
payload: { projectId: asset.projectId, agentId: autofillAgent.id },
payload: {
projectId: asset.projectId!,
agent: { agentId: autofillAgent.id },
},
},
})
}
@@ -275,7 +278,10 @@ export class UploadService {
status: WorkflowTaskStatus.pending,
teamId: team.id,
projectId: asset.projectId,
payload: { projectId: asset.projectId, agentId: transcriptionAgent.id },
payload: {
projectId: asset.projectId!,
agent: { agentId: transcriptionAgent.id },
},
},
})
}
@@ -298,7 +304,10 @@ export class UploadService {
status: WorkflowTaskStatus.pending,
teamId: team.id,
projectId: asset.projectId,
payload: { projectId: asset.projectId, agentId: embeddingAgent.id },
payload: {
projectId: asset.projectId!,
agent: { agentId: embeddingAgent.id },
},
},
})
}