39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
/** Queue/job names and their typed payloads. Shared by the web (producer) and worker (consumer). */
|
|
|
|
export const QUEUES = {
|
|
generateEpisode: "episode.generate",
|
|
generateSeries: "series.generate",
|
|
repurpose: "episode.repurpose",
|
|
reconcileBilling: "billing.reconcile",
|
|
echo: "system.echo",
|
|
} as const;
|
|
|
|
export type QueueName = (typeof QUEUES)[keyof typeof QUEUES];
|
|
|
|
export type GenerationType = "full" | "script" | "audio" | "art" | "section" | "repurpose";
|
|
|
|
export interface GenerateEpisodePayload {
|
|
episodeId: string;
|
|
/** "full" runs the whole pipeline; the others re-run a single stage. */
|
|
type?: GenerationType;
|
|
/** For type="section", the script section to regenerate. */
|
|
sectionId?: string;
|
|
}
|
|
|
|
export interface RepurposePayload {
|
|
episodeId: string;
|
|
format: "blog" | "social_thread" | "newsletter";
|
|
}
|
|
|
|
export interface GenerateSeriesPayload {
|
|
seriesId: string;
|
|
}
|
|
|
|
export interface EchoPayload {
|
|
message: string;
|
|
episodeId?: string;
|
|
}
|
|
|
|
/** All queues that must exist before send/work. */
|
|
export const ALL_QUEUES: QueueName[] = Object.values(QUEUES);
|