generated from fahricansecer/boilerplate-be
main
This commit is contained in:
96
src/modules/skriptai/queue/queue.constants.ts
Normal file
96
src/modules/skriptai/queue/queue.constants.ts
Normal file
@@ -0,0 +1,96 @@
|
||||
/**
|
||||
* Queue Constants
|
||||
*
|
||||
* Central definition of all BullMQ queue names and job types.
|
||||
*
|
||||
* TR: Tüm BullMQ kuyruk adları ve iş tipleri merkezi tanımı.
|
||||
*/
|
||||
|
||||
// Queue names
|
||||
export const QUEUES = {
|
||||
SCRIPT_GENERATION: 'script-generation',
|
||||
DEEP_RESEARCH: 'deep-research',
|
||||
ANALYSIS: 'analysis',
|
||||
IMAGE_GENERATION: 'image-generation',
|
||||
} as const;
|
||||
|
||||
// Job type discriminators
|
||||
export enum JobType {
|
||||
// Script
|
||||
GENERATE_SCRIPT = 'generate-script',
|
||||
REGENERATE_SEGMENT = 'regenerate-segment',
|
||||
REGENERATE_PARTIAL = 'regenerate-partial',
|
||||
REWRITE_SEGMENT = 'rewrite-segment',
|
||||
|
||||
// Research
|
||||
DEEP_RESEARCH = 'deep-research',
|
||||
DISCOVER_QUESTIONS = 'discover-questions',
|
||||
|
||||
// Analysis
|
||||
NEURO_ANALYSIS = 'neuro-analysis',
|
||||
YOUTUBE_AUDIT = 'youtube-audit',
|
||||
COMMERCIAL_BRIEF = 'commercial-brief',
|
||||
GENERATE_VISUAL_ASSETS = 'generate-visual-assets',
|
||||
|
||||
// Image
|
||||
GENERATE_SEGMENT_IMAGE = 'generate-segment-image',
|
||||
GENERATE_THUMBNAIL = 'generate-thumbnail',
|
||||
}
|
||||
|
||||
// Job status for tracking
|
||||
export enum JobStatus {
|
||||
QUEUED = 'QUEUED',
|
||||
PROCESSING = 'PROCESSING',
|
||||
COMPLETED = 'COMPLETED',
|
||||
FAILED = 'FAILED',
|
||||
}
|
||||
|
||||
// Job payload interfaces
|
||||
export interface ScriptGenerationPayload {
|
||||
projectId: string;
|
||||
userId?: string;
|
||||
}
|
||||
|
||||
export interface SegmentRegeneratePayload {
|
||||
segmentId: string;
|
||||
projectId: string;
|
||||
}
|
||||
|
||||
export interface PartialRegeneratePayload {
|
||||
projectId: string;
|
||||
segmentIds: string[];
|
||||
}
|
||||
|
||||
export interface RewriteSegmentPayload {
|
||||
segmentId: string;
|
||||
newStyle: string;
|
||||
projectId: string;
|
||||
}
|
||||
|
||||
export interface DeepResearchPayload {
|
||||
projectId: string;
|
||||
}
|
||||
|
||||
export interface AnalysisPayload {
|
||||
projectId: string;
|
||||
}
|
||||
|
||||
export interface ImageGenerationPayload {
|
||||
segmentId: string;
|
||||
projectId: string;
|
||||
}
|
||||
|
||||
// Job result
|
||||
export interface JobResult {
|
||||
success: boolean;
|
||||
data?: any;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
// Job progress detail
|
||||
export interface JobProgress {
|
||||
step: number;
|
||||
totalSteps: number;
|
||||
message: string;
|
||||
percentage: number;
|
||||
}
|
||||
Reference in New Issue
Block a user