import type { AfterRenderCost, SeparateAudioOutput } from './constants'; import type { ImageSequenceOutput } from './image-sequence'; import type { EnhancedErrorInfo } from './write-error-to-storage'; type StaticWebhookPayload = { renderId: string; expectedBucketOwner: BucketOwner; bucketName: string; customData: Record | null; }; export type WebhookErrorPayload = StaticWebhookPayload & { type: 'error'; errors: { message: string; name: string; stack: string; }[]; }; export type WebhookSuccessPayload = StaticWebhookPayload & { type: 'success'; lambdaErrors: EnhancedErrorInfo[]; outputUrl: string | undefined; outputFile: string | undefined; separateAudio: SeparateAudioOutput | null; outputSequence: ImageSequenceOutput | null; timeToFinish: number | undefined; costs: AfterRenderCost; }; export type WebhookTimeoutPayload = StaticWebhookPayload & { type: 'timeout'; }; export type WebhookPayload = WebhookErrorPayload | WebhookSuccessPayload | WebhookTimeoutPayload; export {};