/** * Queue protocol types * * Wire DTOs use snake_case to match backend JSON. Public types use camelCase. */ export interface EnqueueJobRequestWire { payload?: unknown; idempotency_key?: string; delay?: string; schedule_at?: string | null; metadata?: Record; } export interface EnqueueJobResponseWire { job_id: string; status: string; } export interface QueueJobWire { id: string; queue_name: string; status: string; payload?: unknown; result?: unknown; idempotency_key?: string; attempt?: number; max_attempts?: number; schedule_at?: string; started_at?: string; completed_at?: string; worker_id?: string; error_message?: string; metadata?: Record; created_at?: string; updated_at?: string; } export interface JobsResponseWire { jobs: QueueJobWire[]; } export interface PullJobsRequestWire { worker_id: string; batch_size: number; wait: string; } export interface AckJobRequestWire { worker_id: string; result?: unknown; } export interface NackJobRequestWire { worker_id: string; reason: string; retry_delay?: string; } export interface QueueConfigWire { name?: string; execution_profile?: string; visibility_timeout?: string; max_attempts?: number; retention?: string; max_payload_bytes?: number; webhook_url?: string; webhook_secret?: string; created_at?: string; updated_at?: string; } export interface UpdateQueueConfigRequestWire { execution_profile?: string; visibility_timeout?: string; max_attempts?: number; webhook_url?: string; webhook_secret?: string; } export interface RegisterWorkerRequestWire { name: string; queues: string[]; } export interface WorkerResponseWire { id: string; name: string; queues: string[]; last_seen_at?: string; created_at?: string; updated_at?: string; } export interface HeartbeatRequestWire { worker_id: string; } export interface QueueJob { id: string; queueName: string; status: string; payload?: unknown; result?: unknown; idempotencyKey?: string; attempt?: number; maxAttempts?: number; scheduleAt?: string; startedAt?: string; completedAt?: string; workerId?: string; errorMessage?: string; metadata?: Record; createdAt?: string; updatedAt?: string; } export interface EnqueueOptions { delay?: string; idempotencyKey?: string; scheduleAt?: string | null; metadata?: Record; } export interface EnqueueResult { jobId: string; status: string; } export interface ListJobsOptions { status?: string; } export interface RunWorkerOptions { workerId?: string; batchSize?: number; pollIntervalMs?: number; wait?: string; /** How often to call /workers/heartbeat while running. Default 20000. */ heartbeatIntervalMs?: number; } export interface PullJobsOptions { workerId?: string; batchSize?: number; wait?: string; } export interface AckJobOptions { workerId: string; result?: unknown; } export interface NackJobOptions { workerId: string; reason?: string; retryDelay?: string; } export interface QueueConfig { name?: string; executionProfile?: string; visibilityTimeout?: string; maxAttempts?: number; retention?: string; maxPayloadBytes?: number; webhookUrl?: string; createdAt?: string; updatedAt?: string; } export interface UpdateQueueConfigOptions { executionProfile?: string; visibilityTimeout?: string; maxAttempts?: number; webhookUrl?: string; webhookSecret?: string; } export interface RegisterWorkerOptions { name: string; queues: string[]; } export interface WorkerRegistration { id: string; name: string; queues: string[]; lastSeenAt?: string; createdAt?: string; updatedAt?: string; } export type QueueJobHandler = (job: QueueJob) => Promise; export declare function toQueueJob(wire: QueueJobWire): QueueJob; export declare function toEnqueueResult(wire: EnqueueJobResponseWire): EnqueueResult; export declare function toQueueConfig(wire: QueueConfigWire): QueueConfig; export declare function toWorkerRegistration(wire: WorkerResponseWire): WorkerRegistration; //# sourceMappingURL=queue.d.ts.map