Documentation / @super-line/plugin-queue / queueContract
Function: queueContract()
queueContract():
ContractPlugin<{collections: {queueJobs: {indexes: readonly [readonly ["queue","status","availableAt","priority","createdAt"], readonly ["status","leaseExpiresAt"], readonly ["deleteAt"], readonly ["scheduleId","status"]];key:"id";schema:ZodObject<{attempt:ZodNumber;availableAt:ZodNumber;backoff:ZodObject<{delayMs:ZodNumber;jitter:ZodOptional<ZodNumber>;maxDelayMs:ZodOptional<ZodNumber>;type:ZodEnum<{exponential:"exponential";fixed:"fixed"; }>; },$strip>;cancelReason:ZodOptional<ZodString>;cancelRequestedAt:ZodOptional<ZodNumber>;createdAt:ZodNumber;deleteAt:ZodOptional<ZodNumber>;finishedAt:ZodOptional<ZodNumber>;id:ZodString;input:ZodUnknown;lastError:ZodOptional<ZodObject<{at:ZodNumber;attempt:ZodNumber;code:ZodOptional<ZodString>;message:ZodString;name:ZodString; },$strip>>;leaseExpiresAt:ZodOptional<ZodNumber>;maxAttempts:ZodNumber;nodeId:ZodOptional<ZodString>;nodeKey:ZodOptional<ZodString>;priority:ZodNumber;queue:ZodString;result:ZodOptional<ZodUnknown>;retention:ZodObject<{cancelledMs:ZodNullable<ZodNumber>;completedMs:ZodNullable<ZodNumber>;failedMs:ZodNullable<ZodNumber>; },$strip>;retryOf:ZodOptional<ZodString>;revision:ZodNumber;rootJobId:ZodOptional<ZodString>;runId:ZodOptional<ZodString>;scheduledFor:ZodOptional<ZodNumber>;scheduleId:ZodOptional<ZodString>;slotId:ZodOptional<ZodString>;startedAt:ZodOptional<ZodNumber>;status:ZodEnum<{cancelled:"cancelled";completed:"completed";failed:"failed";queued:"queued";running:"running"; }>;timeoutMs:ZodOptional<ZodNumber>;updatedAt:ZodNumber; },$strip>; };queueSchedules: {indexes: readonly [readonly ["enabled","nextRunAt"]];key:"id";schema:ZodObject<{createdAt:ZodNumber;cron:ZodString;enabled:ZodBoolean;id:ZodString;input:ZodUnknown;lastJobId:ZodOptional<ZodString>;lastScheduledAt:ZodOptional<ZodNumber>;maxCatchUp:ZodOptional<ZodNumber>;misfirePolicy:ZodEnum<{all:"all";latest:"latest";skip:"skip"; }>;nextRunAt:ZodNumber;overlapPolicy:ZodEnum<{allow:"allow";skip:"skip"; }>;queue:ZodString;revision:ZodNumber;timezone:ZodString;updatedAt:ZodNumber; },$strip>; };queueSlots: {indexes: readonly [readonly ["queue","index"]];key:"id";schema:ZodObject<{createdAt:ZodNumber;id:ZodString;index:ZodNumber;jobId:ZodOptional<ZodString>;leaseExpiresAt:ZodOptional<ZodNumber>;nodeId:ZodOptional<ZodString>;nodeKey:ZodOptional<ZodString>;queue:ZodString;revision:ZodNumber;runId:ZodOptional<ZodString>;updatedAt:ZodNumber; },$strip>; }; }; }>
Defined in: packages/plugin-queue/src/index.ts:253
Returns
ContractPlugin<{ collections: { queueJobs: { indexes: readonly [readonly ["queue", "status", "availableAt", "priority", "createdAt"], readonly ["status", "leaseExpiresAt"], readonly ["deleteAt"], readonly ["scheduleId", "status"]]; key: "id"; schema: ZodObject<{ attempt: ZodNumber; availableAt: ZodNumber; backoff: ZodObject<{ delayMs: ZodNumber; jitter: ZodOptional<ZodNumber>; maxDelayMs: ZodOptional<ZodNumber>; type: ZodEnum<{ exponential: "exponential"; fixed: "fixed"; }>; }, $strip>; cancelReason: ZodOptional<ZodString>; cancelRequestedAt: ZodOptional<ZodNumber>; createdAt: ZodNumber; deleteAt: ZodOptional<ZodNumber>; finishedAt: ZodOptional<ZodNumber>; id: ZodString; input: ZodUnknown; lastError: ZodOptional<ZodObject<{ at: ZodNumber; attempt: ZodNumber; code: ZodOptional<ZodString>; message: ZodString; name: ZodString; }, $strip>>; leaseExpiresAt: ZodOptional<ZodNumber>; maxAttempts: ZodNumber; nodeId: ZodOptional<ZodString>; nodeKey: ZodOptional<ZodString>; priority: ZodNumber; queue: ZodString; result: ZodOptional<ZodUnknown>; retention: ZodObject<{ cancelledMs: ZodNullable<ZodNumber>; completedMs: ZodNullable<ZodNumber>; failedMs: ZodNullable<ZodNumber>; }, $strip>; retryOf: ZodOptional<ZodString>; revision: ZodNumber; rootJobId: ZodOptional<ZodString>; runId: ZodOptional<ZodString>; scheduledFor: ZodOptional<ZodNumber>; scheduleId: ZodOptional<ZodString>; slotId: ZodOptional<ZodString>; startedAt: ZodOptional<ZodNumber>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; queued: "queued"; running: "running"; }>; timeoutMs: ZodOptional<ZodNumber>; updatedAt: ZodNumber; }, $strip>; }; queueSchedules: { indexes: readonly [readonly ["enabled", "nextRunAt"]]; key: "id"; schema: ZodObject<{ createdAt: ZodNumber; cron: ZodString; enabled: ZodBoolean; id: ZodString; input: ZodUnknown; lastJobId: ZodOptional<ZodString>; lastScheduledAt: ZodOptional<ZodNumber>; maxCatchUp: ZodOptional<ZodNumber>; misfirePolicy: ZodEnum<{ all: "all"; latest: "latest"; skip: "skip"; }>; nextRunAt: ZodNumber; overlapPolicy: ZodEnum<{ allow: "allow"; skip: "skip"; }>; queue: ZodString; revision: ZodNumber; timezone: ZodString; updatedAt: ZodNumber; }, $strip>; }; queueSlots: { indexes: readonly [readonly ["queue", "index"]]; key: "id"; schema: ZodObject<{ createdAt: ZodNumber; id: ZodString; index: ZodNumber; jobId: ZodOptional<ZodString>; leaseExpiresAt: ZodOptional<ZodNumber>; nodeId: ZodOptional<ZodString>; nodeKey: ZodOptional<ZodString>; queue: ZodString; revision: ZodNumber; runId: ZodOptional<ZodString>; updatedAt: ZodNumber; }, $strip>; }; }; }>