Files
SkriptAI-be/src/modules/skriptai/queue/queue.constants.ts
Harun CAN fd2580b311 main
2026-03-23 03:15:08 +03:00

97 lines
1.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 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;
}