(jobId: string, url: string)
| 33 | |
| 34 | // Helper to create video generation stream chunks |
| 35 | function createVideoChunks(jobId: string, url: string): Array<StreamChunk> { |
| 36 | return [ |
| 37 | { type: 'RUN_STARTED', runId: 'run-1', timestamp: Date.now() }, |
| 38 | { |
| 39 | type: 'CUSTOM', |
| 40 | name: 'video:job:created', |
| 41 | value: { jobId }, |
| 42 | timestamp: Date.now(), |
| 43 | }, |
| 44 | { |
| 45 | type: 'CUSTOM', |
| 46 | name: 'video:status', |
| 47 | value: { jobId, status: 'processing', progress: 50 }, |
| 48 | timestamp: Date.now(), |
| 49 | }, |
| 50 | { |
| 51 | type: 'CUSTOM', |
| 52 | name: 'generation:result', |
| 53 | value: { jobId, status: 'completed', url }, |
| 54 | timestamp: Date.now(), |
| 55 | }, |
| 56 | { |
| 57 | type: 'RUN_FINISHED', |
| 58 | runId: 'run-1', |
| 59 | finishReason: 'stop', |
| 60 | timestamp: Date.now(), |
| 61 | }, |
| 62 | ] as unknown as Array<StreamChunk> |
| 63 | } |
| 64 | |
| 65 | // Helper to create error stream chunks |
| 66 | function createErrorChunks(message: string): Array<StreamChunk> { |
no test coverage detected