@lssm/lib.jobs 0.0.0-canary-20251217083314 → 1.41.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/rolldown_runtime.js +1 -42
- package/dist/contracts/index.js +1 -484
- package/dist/entities/index.js +1 -198
- package/dist/events.js +1 -303
- package/dist/handlers/gmail-sync-handler.js +1 -9
- package/dist/handlers/index.js +1 -12
- package/dist/handlers/ping-job.js +1 -13
- package/dist/handlers/storage-document-handler.js +1 -14
- package/dist/index.js +1 -18
- package/dist/jobs.feature.js +1 -101
- package/dist/queue/gcp-cloud-tasks.js +1 -61
- package/dist/queue/gcp-pubsub.js +1 -47
- package/dist/queue/index.js +1 -9
- package/dist/queue/memory-queue.js +1 -140
- package/dist/queue/register-defined-job.js +1 -15
- package/dist/queue/scaleway-sqs-queue.js +1 -175
- package/dist/queue/types.js +1 -3
- package/dist/scheduler/index.js +1 -145
- package/package.json +23 -24
- package/dist/contracts/dist/capabilities/openbanking.js +0 -88
- package/dist/contracts/dist/client/index.js +0 -5
- package/dist/contracts/dist/client/react/feature-render.js +0 -2
- package/dist/contracts/dist/client/react/form-render.js +0 -4
- package/dist/contracts/dist/client/react/index.js +0 -4
- package/dist/contracts/dist/contract-registry/index.js +0 -1
- package/dist/contracts/dist/contract-registry/schemas.js +0 -60
- package/dist/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
- package/dist/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
- package/dist/contracts/dist/docs/index.js +0 -29
- package/dist/contracts/dist/docs/presentations.js +0 -71
- package/dist/contracts/dist/docs/registry.js +0 -44
- package/dist/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
- package/dist/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
- package/dist/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
- package/dist/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
- package/dist/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
- package/dist/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
- package/dist/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
- package/dist/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
- package/dist/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
- package/dist/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
- package/dist/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
- package/dist/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
- package/dist/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
- package/dist/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
- package/dist/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
- package/dist/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
- package/dist/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
- package/dist/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
- package/dist/contracts/dist/events.js +0 -10
- package/dist/contracts/dist/experiments/evaluator.js +0 -1
- package/dist/contracts/dist/index.js +0 -71
- package/dist/contracts/dist/install.js +0 -2
- package/dist/contracts/dist/integrations/contracts.js +0 -377
- package/dist/contracts/dist/integrations/index.js +0 -18
- package/dist/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
- package/dist/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
- package/dist/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
- package/dist/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
- package/dist/contracts/dist/integrations/openbanking/models.js +0 -242
- package/dist/contracts/dist/integrations/openbanking/telemetry.js +0 -13
- package/dist/contracts/dist/integrations/providers/elevenlabs.js +0 -52
- package/dist/contracts/dist/integrations/providers/gcs-storage.js +0 -75
- package/dist/contracts/dist/integrations/providers/gmail.js +0 -87
- package/dist/contracts/dist/integrations/providers/google-calendar.js +0 -66
- package/dist/contracts/dist/integrations/providers/index.js +0 -11
- package/dist/contracts/dist/integrations/providers/mistral.js +0 -68
- package/dist/contracts/dist/integrations/providers/postmark.js +0 -68
- package/dist/contracts/dist/integrations/providers/powens.js +0 -116
- package/dist/contracts/dist/integrations/providers/qdrant.js +0 -73
- package/dist/contracts/dist/integrations/providers/registry.js +0 -10
- package/dist/contracts/dist/integrations/providers/stripe.js +0 -83
- package/dist/contracts/dist/integrations/providers/twilio-sms.js +0 -61
- package/dist/contracts/dist/jobs/queue.js +0 -33
- package/dist/contracts/dist/jsonschema.js +0 -1
- package/dist/contracts/dist/knowledge/contracts.js +0 -306
- package/dist/contracts/dist/knowledge/index.js +0 -7
- package/dist/contracts/dist/knowledge/spaces/email-threads.js +0 -34
- package/dist/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
- package/dist/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
- package/dist/contracts/dist/knowledge/spaces/index.js +0 -6
- package/dist/contracts/dist/knowledge/spaces/product-canon.js +0 -34
- package/dist/contracts/dist/knowledge/spaces/support-faq.js +0 -37
- package/dist/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
- package/dist/contracts/dist/llm/exporters.js +0 -19
- package/dist/contracts/dist/llm/index.js +0 -2
- package/dist/contracts/dist/llm/prompts.js +0 -1
- package/dist/contracts/dist/onboarding-base.js +0 -196
- package/dist/contracts/dist/openapi.js +0 -1
- package/dist/contracts/dist/ownership.js +0 -21
- package/dist/contracts/dist/presentations.js +0 -1
- package/dist/contracts/dist/presentations.v2.js +0 -11
- package/dist/contracts/dist/prompt.js +0 -1
- package/dist/contracts/dist/promptRegistry.js +0 -1
- package/dist/contracts/dist/regenerator/index.js +0 -1
- package/dist/contracts/dist/regenerator/service.js +0 -6
- package/dist/contracts/dist/registry.js +0 -2
- package/dist/contracts/dist/resources.js +0 -1
- package/dist/contracts/dist/schema/dist/EnumType.js +0 -2
- package/dist/contracts/dist/schema/dist/FieldType.js +0 -49
- package/dist/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/contracts/dist/schema/dist/SchemaModel.js +0 -34
- package/dist/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
- package/dist/contracts/dist/schema/dist/entity/index.js +0 -2
- package/dist/contracts/dist/schema/dist/entity/types.js +0 -1
- package/dist/contracts/dist/schema/dist/index.js +0 -6
- package/dist/contracts/dist/server/graphql-pothos.js +0 -6
- package/dist/contracts/dist/server/index.js +0 -8
- package/dist/contracts/dist/server/mcp/createMcpServer.js +0 -4
- package/dist/contracts/dist/server/mcp/registerPresentations.js +0 -2
- package/dist/contracts/dist/server/mcp/registerPrompts.js +0 -1
- package/dist/contracts/dist/server/mcp/registerResources.js +0 -2
- package/dist/contracts/dist/server/mcp/registerTools.js +0 -1
- package/dist/contracts/dist/server/provider-mcp.js +0 -1
- package/dist/contracts/dist/server/rest-elysia.js +0 -1
- package/dist/contracts/dist/server/rest-express.js +0 -1
- package/dist/contracts/dist/server/rest-generic.js +0 -1
- package/dist/contracts/dist/server/rest-next-app.js +0 -1
- package/dist/contracts/dist/server/rest-next-pages.js +0 -1
- package/dist/contracts/dist/spec.js +0 -34
- package/dist/contracts/dist/telemetry/index.js +0 -1
- package/dist/contracts/dist/telemetry/tracker.js +0 -1
- package/dist/contracts/dist/tests/index.js +0 -1
- package/dist/contracts/dist/tests/runner.js +0 -2
- package/dist/contracts/dist/workflow/index.js +0 -1
- package/dist/contracts/dist/workflow/runner.js +0 -1
- package/dist/contracts/index.d.ts +0 -546
- package/dist/entities/index.d.ts +0 -144
- package/dist/events.d.ts +0 -387
- package/dist/handlers/gmail-sync-handler.d.ts +0 -9
- package/dist/handlers/index.d.ts +0 -9
- package/dist/handlers/ping-job.d.ts +0 -10
- package/dist/handlers/storage-document-handler.d.ts +0 -12
- package/dist/index.d.ts +0 -24
- package/dist/jobs.feature.d.ts +0 -11
- package/dist/queue/gcp-cloud-tasks.d.ts +0 -41
- package/dist/queue/gcp-pubsub.d.ts +0 -25
- package/dist/queue/index.d.ts +0 -15
- package/dist/queue/memory-queue.d.ts +0 -34
- package/dist/queue/register-defined-job.d.ts +0 -7
- package/dist/queue/scaleway-sqs-queue.d.ts +0 -38
- package/dist/queue/types.d.ts +0 -7
- package/dist/scheduler/index.d.ts +0 -92
- package/dist/schema/dist/EnumType.js +0 -2
- package/dist/schema/dist/FieldType.js +0 -49
- package/dist/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/schema/dist/SchemaModel.js +0 -39
- package/dist/schema/dist/entity/defineEntity.js +0 -236
- package/dist/schema/dist/entity/index.js +0 -2
- package/dist/schema/dist/entity/types.js +0 -1
- package/dist/schema/dist/index.js +0 -6
package/dist/entities/index.js
CHANGED
|
@@ -1,198 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../schema/dist/index.js";
|
|
3
|
-
|
|
4
|
-
//#region src/entities/index.ts
|
|
5
|
-
/**
|
|
6
|
-
* Job status enum.
|
|
7
|
-
*/
|
|
8
|
-
const JobStatusEnum = defineEntityEnum({
|
|
9
|
-
name: "JobStatus",
|
|
10
|
-
values: [
|
|
11
|
-
"PENDING",
|
|
12
|
-
"RUNNING",
|
|
13
|
-
"COMPLETED",
|
|
14
|
-
"FAILED",
|
|
15
|
-
"CANCELLED",
|
|
16
|
-
"DEAD_LETTER"
|
|
17
|
-
],
|
|
18
|
-
schema: "lssm_jobs",
|
|
19
|
-
description: "Status of a background job."
|
|
20
|
-
});
|
|
21
|
-
/**
|
|
22
|
-
* Job entity - represents a single job execution.
|
|
23
|
-
*/
|
|
24
|
-
const JobEntity = defineEntity({
|
|
25
|
-
name: "Job",
|
|
26
|
-
description: "A background job for async processing.",
|
|
27
|
-
schema: "lssm_jobs",
|
|
28
|
-
map: "job",
|
|
29
|
-
fields: {
|
|
30
|
-
id: field.id({ description: "Unique job identifier" }),
|
|
31
|
-
type: field.string({ description: "Job type identifier" }),
|
|
32
|
-
version: field.int({
|
|
33
|
-
default: 1,
|
|
34
|
-
description: "Job type version"
|
|
35
|
-
}),
|
|
36
|
-
payload: field.json({ description: "Job payload data" }),
|
|
37
|
-
status: field.enum("JobStatus", { default: "PENDING" }),
|
|
38
|
-
priority: field.int({
|
|
39
|
-
default: 0,
|
|
40
|
-
description: "Higher = more urgent"
|
|
41
|
-
}),
|
|
42
|
-
attempts: field.int({
|
|
43
|
-
default: 0,
|
|
44
|
-
description: "Number of execution attempts"
|
|
45
|
-
}),
|
|
46
|
-
maxRetries: field.int({
|
|
47
|
-
default: 3,
|
|
48
|
-
description: "Maximum retry attempts"
|
|
49
|
-
}),
|
|
50
|
-
lastError: field.string({
|
|
51
|
-
isOptional: true,
|
|
52
|
-
description: "Last error message"
|
|
53
|
-
}),
|
|
54
|
-
lastErrorStack: field.string({
|
|
55
|
-
isOptional: true,
|
|
56
|
-
description: "Last error stack trace"
|
|
57
|
-
}),
|
|
58
|
-
scheduledAt: field.dateTime({
|
|
59
|
-
isOptional: true,
|
|
60
|
-
description: "When job should be processed"
|
|
61
|
-
}),
|
|
62
|
-
startedAt: field.dateTime({
|
|
63
|
-
isOptional: true,
|
|
64
|
-
description: "When processing started"
|
|
65
|
-
}),
|
|
66
|
-
completedAt: field.dateTime({
|
|
67
|
-
isOptional: true,
|
|
68
|
-
description: "When processing completed"
|
|
69
|
-
}),
|
|
70
|
-
timeoutAt: field.dateTime({
|
|
71
|
-
isOptional: true,
|
|
72
|
-
description: "Job timeout deadline"
|
|
73
|
-
}),
|
|
74
|
-
dedupeKey: field.string({
|
|
75
|
-
isOptional: true,
|
|
76
|
-
description: "Key for deduplication"
|
|
77
|
-
}),
|
|
78
|
-
tenantId: field.string({
|
|
79
|
-
isOptional: true,
|
|
80
|
-
description: "Tenant/org context"
|
|
81
|
-
}),
|
|
82
|
-
userId: field.string({
|
|
83
|
-
isOptional: true,
|
|
84
|
-
description: "User who enqueued"
|
|
85
|
-
}),
|
|
86
|
-
traceId: field.string({
|
|
87
|
-
isOptional: true,
|
|
88
|
-
description: "Distributed trace ID"
|
|
89
|
-
}),
|
|
90
|
-
metadata: field.json({
|
|
91
|
-
isOptional: true,
|
|
92
|
-
description: "Additional metadata"
|
|
93
|
-
}),
|
|
94
|
-
result: field.json({
|
|
95
|
-
isOptional: true,
|
|
96
|
-
description: "Job result data"
|
|
97
|
-
}),
|
|
98
|
-
createdAt: field.createdAt(),
|
|
99
|
-
updatedAt: field.updatedAt(),
|
|
100
|
-
scheduledJob: field.belongsTo("ScheduledJob", ["scheduledJobId"], ["id"]),
|
|
101
|
-
scheduledJobId: field.string({ isOptional: true }),
|
|
102
|
-
executions: field.hasMany("JobExecution")
|
|
103
|
-
},
|
|
104
|
-
indexes: [
|
|
105
|
-
index.on(["status", "scheduledAt"]),
|
|
106
|
-
index.on(["type", "status"]),
|
|
107
|
-
index.on(["tenantId", "status"]),
|
|
108
|
-
index.unique(["dedupeKey"], { name: "job_dedupe_key_unique" })
|
|
109
|
-
],
|
|
110
|
-
enums: [JobStatusEnum]
|
|
111
|
-
});
|
|
112
|
-
/**
|
|
113
|
-
* ScheduledJob entity - recurring job definitions.
|
|
114
|
-
*/
|
|
115
|
-
const ScheduledJobEntity = defineEntity({
|
|
116
|
-
name: "ScheduledJob",
|
|
117
|
-
description: "A scheduled/recurring job definition.",
|
|
118
|
-
schema: "lssm_jobs",
|
|
119
|
-
map: "scheduled_job",
|
|
120
|
-
fields: {
|
|
121
|
-
id: field.id(),
|
|
122
|
-
name: field.string({
|
|
123
|
-
isUnique: true,
|
|
124
|
-
description: "Unique schedule name"
|
|
125
|
-
}),
|
|
126
|
-
description: field.string({ isOptional: true }),
|
|
127
|
-
cronExpression: field.string({ description: "Cron expression for scheduling" }),
|
|
128
|
-
timezone: field.string({
|
|
129
|
-
default: "\"UTC\"",
|
|
130
|
-
description: "Timezone for cron evaluation"
|
|
131
|
-
}),
|
|
132
|
-
jobType: field.string({ description: "Job type to create" }),
|
|
133
|
-
jobVersion: field.int({ default: 1 }),
|
|
134
|
-
payload: field.json({
|
|
135
|
-
isOptional: true,
|
|
136
|
-
description: "Default payload for created jobs"
|
|
137
|
-
}),
|
|
138
|
-
maxRetries: field.int({ default: 3 }),
|
|
139
|
-
timeoutMs: field.int({
|
|
140
|
-
isOptional: true,
|
|
141
|
-
description: "Job timeout in milliseconds"
|
|
142
|
-
}),
|
|
143
|
-
enabled: field.boolean({ default: true }),
|
|
144
|
-
lastRunAt: field.dateTime({ isOptional: true }),
|
|
145
|
-
nextRunAt: field.dateTime({ isOptional: true }),
|
|
146
|
-
tenantId: field.string({ isOptional: true }),
|
|
147
|
-
createdAt: field.createdAt(),
|
|
148
|
-
updatedAt: field.updatedAt(),
|
|
149
|
-
jobs: field.hasMany("Job")
|
|
150
|
-
},
|
|
151
|
-
indexes: [index.on(["enabled", "nextRunAt"])]
|
|
152
|
-
});
|
|
153
|
-
/**
|
|
154
|
-
* JobExecution entity - individual execution attempts.
|
|
155
|
-
*/
|
|
156
|
-
const JobExecutionEntity = defineEntity({
|
|
157
|
-
name: "JobExecution",
|
|
158
|
-
description: "A single execution attempt of a job.",
|
|
159
|
-
schema: "lssm_jobs",
|
|
160
|
-
map: "job_execution",
|
|
161
|
-
fields: {
|
|
162
|
-
id: field.id(),
|
|
163
|
-
jobId: field.foreignKey(),
|
|
164
|
-
attemptNumber: field.int({ description: "Which attempt this is" }),
|
|
165
|
-
startedAt: field.dateTime(),
|
|
166
|
-
completedAt: field.dateTime({ isOptional: true }),
|
|
167
|
-
durationMs: field.int({ isOptional: true }),
|
|
168
|
-
success: field.boolean({ isOptional: true }),
|
|
169
|
-
error: field.string({ isOptional: true }),
|
|
170
|
-
errorStack: field.string({ isOptional: true }),
|
|
171
|
-
result: field.json({ isOptional: true }),
|
|
172
|
-
workerId: field.string({
|
|
173
|
-
isOptional: true,
|
|
174
|
-
description: "ID of worker that processed"
|
|
175
|
-
}),
|
|
176
|
-
job: field.belongsTo("Job", ["jobId"], ["id"], { onDelete: "Cascade" })
|
|
177
|
-
},
|
|
178
|
-
indexes: [index.on(["jobId", "attemptNumber"])]
|
|
179
|
-
});
|
|
180
|
-
/**
|
|
181
|
-
* All job entities for schema composition.
|
|
182
|
-
*/
|
|
183
|
-
const jobEntities = [
|
|
184
|
-
JobEntity,
|
|
185
|
-
ScheduledJobEntity,
|
|
186
|
-
JobExecutionEntity
|
|
187
|
-
];
|
|
188
|
-
/**
|
|
189
|
-
* Module schema contribution for jobs.
|
|
190
|
-
*/
|
|
191
|
-
const jobsSchemaContribution = {
|
|
192
|
-
moduleId: "@lssm/lib.jobs",
|
|
193
|
-
entities: jobEntities,
|
|
194
|
-
enums: [JobStatusEnum]
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
//#endregion
|
|
198
|
-
export { JobEntity, JobExecutionEntity, JobStatusEnum, ScheduledJobEntity, jobEntities, jobsSchemaContribution };
|
|
1
|
+
import{defineEntity as e,defineEntityEnum as t,field as n,index as r}from"@lssm/lib.schema";const i=t({name:`JobStatus`,values:[`PENDING`,`RUNNING`,`COMPLETED`,`FAILED`,`CANCELLED`,`DEAD_LETTER`],schema:`lssm_jobs`,description:`Status of a background job.`}),a=e({name:`Job`,description:`A background job for async processing.`,schema:`lssm_jobs`,map:`job`,fields:{id:n.id({description:`Unique job identifier`}),type:n.string({description:`Job type identifier`}),version:n.int({default:1,description:`Job type version`}),payload:n.json({description:`Job payload data`}),status:n.enum(`JobStatus`,{default:`PENDING`}),priority:n.int({default:0,description:`Higher = more urgent`}),attempts:n.int({default:0,description:`Number of execution attempts`}),maxRetries:n.int({default:3,description:`Maximum retry attempts`}),lastError:n.string({isOptional:!0,description:`Last error message`}),lastErrorStack:n.string({isOptional:!0,description:`Last error stack trace`}),scheduledAt:n.dateTime({isOptional:!0,description:`When job should be processed`}),startedAt:n.dateTime({isOptional:!0,description:`When processing started`}),completedAt:n.dateTime({isOptional:!0,description:`When processing completed`}),timeoutAt:n.dateTime({isOptional:!0,description:`Job timeout deadline`}),dedupeKey:n.string({isOptional:!0,description:`Key for deduplication`}),tenantId:n.string({isOptional:!0,description:`Tenant/org context`}),userId:n.string({isOptional:!0,description:`User who enqueued`}),traceId:n.string({isOptional:!0,description:`Distributed trace ID`}),metadata:n.json({isOptional:!0,description:`Additional metadata`}),result:n.json({isOptional:!0,description:`Job result data`}),createdAt:n.createdAt(),updatedAt:n.updatedAt(),scheduledJob:n.belongsTo(`ScheduledJob`,[`scheduledJobId`],[`id`]),scheduledJobId:n.string({isOptional:!0}),executions:n.hasMany(`JobExecution`)},indexes:[r.on([`status`,`scheduledAt`]),r.on([`type`,`status`]),r.on([`tenantId`,`status`]),r.unique([`dedupeKey`],{name:`job_dedupe_key_unique`})],enums:[i]}),o=e({name:`ScheduledJob`,description:`A scheduled/recurring job definition.`,schema:`lssm_jobs`,map:`scheduled_job`,fields:{id:n.id(),name:n.string({isUnique:!0,description:`Unique schedule name`}),description:n.string({isOptional:!0}),cronExpression:n.string({description:`Cron expression for scheduling`}),timezone:n.string({default:`"UTC"`,description:`Timezone for cron evaluation`}),jobType:n.string({description:`Job type to create`}),jobVersion:n.int({default:1}),payload:n.json({isOptional:!0,description:`Default payload for created jobs`}),maxRetries:n.int({default:3}),timeoutMs:n.int({isOptional:!0,description:`Job timeout in milliseconds`}),enabled:n.boolean({default:!0}),lastRunAt:n.dateTime({isOptional:!0}),nextRunAt:n.dateTime({isOptional:!0}),tenantId:n.string({isOptional:!0}),createdAt:n.createdAt(),updatedAt:n.updatedAt(),jobs:n.hasMany(`Job`)},indexes:[r.on([`enabled`,`nextRunAt`])]}),s=e({name:`JobExecution`,description:`A single execution attempt of a job.`,schema:`lssm_jobs`,map:`job_execution`,fields:{id:n.id(),jobId:n.foreignKey(),attemptNumber:n.int({description:`Which attempt this is`}),startedAt:n.dateTime(),completedAt:n.dateTime({isOptional:!0}),durationMs:n.int({isOptional:!0}),success:n.boolean({isOptional:!0}),error:n.string({isOptional:!0}),errorStack:n.string({isOptional:!0}),result:n.json({isOptional:!0}),workerId:n.string({isOptional:!0,description:`ID of worker that processed`}),job:n.belongsTo(`Job`,[`jobId`],[`id`],{onDelete:`Cascade`})},indexes:[r.on([`jobId`,`attemptNumber`])]}),c=[a,o,s],l={moduleId:`@lssm/lib.jobs`,entities:c,enums:[i]};export{a as JobEntity,s as JobExecutionEntity,i as JobStatusEnum,o as ScheduledJobEntity,c as jobEntities,l as jobsSchemaContribution};
|
package/dist/events.js
CHANGED
|
@@ -1,303 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineSchemaModel } from "./schema/dist/SchemaModel.js";
|
|
3
|
-
import "./schema/dist/index.js";
|
|
4
|
-
import { defineEvent } from "./contracts/dist/events.js";
|
|
5
|
-
import "./contracts/dist/index.js";
|
|
6
|
-
|
|
7
|
-
//#region src/events.ts
|
|
8
|
-
const JobEnqueuedPayload = defineSchemaModel({
|
|
9
|
-
name: "JobEnqueuedEventPayload",
|
|
10
|
-
description: "Payload when a job is added to the queue",
|
|
11
|
-
fields: {
|
|
12
|
-
jobId: {
|
|
13
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
14
|
-
isOptional: false
|
|
15
|
-
},
|
|
16
|
-
type: {
|
|
17
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
18
|
-
isOptional: false
|
|
19
|
-
},
|
|
20
|
-
priority: {
|
|
21
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
22
|
-
isOptional: false
|
|
23
|
-
},
|
|
24
|
-
scheduledAt: {
|
|
25
|
-
type: ScalarTypeEnum.DateTime(),
|
|
26
|
-
isOptional: true
|
|
27
|
-
},
|
|
28
|
-
tenantId: {
|
|
29
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
30
|
-
isOptional: true
|
|
31
|
-
},
|
|
32
|
-
enqueuedAt: {
|
|
33
|
-
type: ScalarTypeEnum.DateTime(),
|
|
34
|
-
isOptional: false
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
const JobStartedPayload = defineSchemaModel({
|
|
39
|
-
name: "JobStartedEventPayload",
|
|
40
|
-
description: "Payload when a job starts processing",
|
|
41
|
-
fields: {
|
|
42
|
-
jobId: {
|
|
43
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
44
|
-
isOptional: false
|
|
45
|
-
},
|
|
46
|
-
type: {
|
|
47
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
48
|
-
isOptional: false
|
|
49
|
-
},
|
|
50
|
-
attempt: {
|
|
51
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
52
|
-
isOptional: false
|
|
53
|
-
},
|
|
54
|
-
startedAt: {
|
|
55
|
-
type: ScalarTypeEnum.DateTime(),
|
|
56
|
-
isOptional: false
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
const JobCompletedPayload = defineSchemaModel({
|
|
61
|
-
name: "JobCompletedEventPayload",
|
|
62
|
-
description: "Payload when a job completes successfully",
|
|
63
|
-
fields: {
|
|
64
|
-
jobId: {
|
|
65
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
66
|
-
isOptional: false
|
|
67
|
-
},
|
|
68
|
-
type: {
|
|
69
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
70
|
-
isOptional: false
|
|
71
|
-
},
|
|
72
|
-
attempt: {
|
|
73
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
74
|
-
isOptional: false
|
|
75
|
-
},
|
|
76
|
-
durationMs: {
|
|
77
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
78
|
-
isOptional: false
|
|
79
|
-
},
|
|
80
|
-
completedAt: {
|
|
81
|
-
type: ScalarTypeEnum.DateTime(),
|
|
82
|
-
isOptional: false
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
const JobFailedPayload = defineSchemaModel({
|
|
87
|
-
name: "JobFailedEventPayload",
|
|
88
|
-
description: "Payload when a job attempt fails",
|
|
89
|
-
fields: {
|
|
90
|
-
jobId: {
|
|
91
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
92
|
-
isOptional: false
|
|
93
|
-
},
|
|
94
|
-
type: {
|
|
95
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
96
|
-
isOptional: false
|
|
97
|
-
},
|
|
98
|
-
attempt: {
|
|
99
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
100
|
-
isOptional: false
|
|
101
|
-
},
|
|
102
|
-
error: {
|
|
103
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
104
|
-
isOptional: false
|
|
105
|
-
},
|
|
106
|
-
willRetry: {
|
|
107
|
-
type: ScalarTypeEnum.Boolean(),
|
|
108
|
-
isOptional: false
|
|
109
|
-
},
|
|
110
|
-
failedAt: {
|
|
111
|
-
type: ScalarTypeEnum.DateTime(),
|
|
112
|
-
isOptional: false
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
const JobRetryingPayload = defineSchemaModel({
|
|
117
|
-
name: "JobRetryingEventPayload",
|
|
118
|
-
description: "Payload when a job is scheduled for retry",
|
|
119
|
-
fields: {
|
|
120
|
-
jobId: {
|
|
121
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
122
|
-
isOptional: false
|
|
123
|
-
},
|
|
124
|
-
type: {
|
|
125
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
126
|
-
isOptional: false
|
|
127
|
-
},
|
|
128
|
-
attempt: {
|
|
129
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
130
|
-
isOptional: false
|
|
131
|
-
},
|
|
132
|
-
nextAttemptAt: {
|
|
133
|
-
type: ScalarTypeEnum.DateTime(),
|
|
134
|
-
isOptional: false
|
|
135
|
-
},
|
|
136
|
-
backoffMs: {
|
|
137
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
138
|
-
isOptional: false
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
const JobDeadLetteredPayload = defineSchemaModel({
|
|
143
|
-
name: "JobDeadLetteredEventPayload",
|
|
144
|
-
description: "Payload when a job is moved to dead letter queue",
|
|
145
|
-
fields: {
|
|
146
|
-
jobId: {
|
|
147
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
148
|
-
isOptional: false
|
|
149
|
-
},
|
|
150
|
-
type: {
|
|
151
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
152
|
-
isOptional: false
|
|
153
|
-
},
|
|
154
|
-
attempts: {
|
|
155
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
156
|
-
isOptional: false
|
|
157
|
-
},
|
|
158
|
-
lastError: {
|
|
159
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
160
|
-
isOptional: false
|
|
161
|
-
},
|
|
162
|
-
deadLetteredAt: {
|
|
163
|
-
type: ScalarTypeEnum.DateTime(),
|
|
164
|
-
isOptional: false
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
const JobCancelledPayload = defineSchemaModel({
|
|
169
|
-
name: "JobCancelledEventPayload",
|
|
170
|
-
description: "Payload when a job is cancelled",
|
|
171
|
-
fields: {
|
|
172
|
-
jobId: {
|
|
173
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
174
|
-
isOptional: false
|
|
175
|
-
},
|
|
176
|
-
type: {
|
|
177
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
178
|
-
isOptional: false
|
|
179
|
-
},
|
|
180
|
-
cancelledBy: {
|
|
181
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
182
|
-
isOptional: true
|
|
183
|
-
},
|
|
184
|
-
cancelledAt: {
|
|
185
|
-
type: ScalarTypeEnum.DateTime(),
|
|
186
|
-
isOptional: false
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
const ScheduledJobTriggeredPayload = defineSchemaModel({
|
|
191
|
-
name: "ScheduledJobTriggeredEventPayload",
|
|
192
|
-
description: "Payload when a scheduled job is triggered",
|
|
193
|
-
fields: {
|
|
194
|
-
scheduleName: {
|
|
195
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
196
|
-
isOptional: false
|
|
197
|
-
},
|
|
198
|
-
jobId: {
|
|
199
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
200
|
-
isOptional: false
|
|
201
|
-
},
|
|
202
|
-
jobType: {
|
|
203
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
204
|
-
isOptional: false
|
|
205
|
-
},
|
|
206
|
-
triggeredAt: {
|
|
207
|
-
type: ScalarTypeEnum.DateTime(),
|
|
208
|
-
isOptional: false
|
|
209
|
-
},
|
|
210
|
-
nextRunAt: {
|
|
211
|
-
type: ScalarTypeEnum.DateTime(),
|
|
212
|
-
isOptional: true
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
/**
|
|
217
|
-
* Emitted when a job is enqueued.
|
|
218
|
-
*/
|
|
219
|
-
const JobEnqueuedEvent = defineEvent({
|
|
220
|
-
name: "job.enqueued",
|
|
221
|
-
version: 1,
|
|
222
|
-
description: "A job has been added to the queue.",
|
|
223
|
-
payload: JobEnqueuedPayload
|
|
224
|
-
});
|
|
225
|
-
/**
|
|
226
|
-
* Emitted when a job starts processing.
|
|
227
|
-
*/
|
|
228
|
-
const JobStartedEvent = defineEvent({
|
|
229
|
-
name: "job.started",
|
|
230
|
-
version: 1,
|
|
231
|
-
description: "A job has started processing.",
|
|
232
|
-
payload: JobStartedPayload
|
|
233
|
-
});
|
|
234
|
-
/**
|
|
235
|
-
* Emitted when a job completes successfully.
|
|
236
|
-
*/
|
|
237
|
-
const JobCompletedEvent = defineEvent({
|
|
238
|
-
name: "job.completed",
|
|
239
|
-
version: 1,
|
|
240
|
-
description: "A job has completed successfully.",
|
|
241
|
-
payload: JobCompletedPayload
|
|
242
|
-
});
|
|
243
|
-
/**
|
|
244
|
-
* Emitted when a job fails (single attempt).
|
|
245
|
-
*/
|
|
246
|
-
const JobFailedEvent = defineEvent({
|
|
247
|
-
name: "job.failed",
|
|
248
|
-
version: 1,
|
|
249
|
-
description: "A job attempt has failed.",
|
|
250
|
-
payload: JobFailedPayload
|
|
251
|
-
});
|
|
252
|
-
/**
|
|
253
|
-
* Emitted when a job is being retried.
|
|
254
|
-
*/
|
|
255
|
-
const JobRetryingEvent = defineEvent({
|
|
256
|
-
name: "job.retrying",
|
|
257
|
-
version: 1,
|
|
258
|
-
description: "A job is being scheduled for retry.",
|
|
259
|
-
payload: JobRetryingPayload
|
|
260
|
-
});
|
|
261
|
-
/**
|
|
262
|
-
* Emitted when a job is moved to dead letter queue.
|
|
263
|
-
*/
|
|
264
|
-
const JobDeadLetteredEvent = defineEvent({
|
|
265
|
-
name: "job.dead_lettered",
|
|
266
|
-
version: 1,
|
|
267
|
-
description: "A job has exhausted all retries and moved to dead letter queue.",
|
|
268
|
-
payload: JobDeadLetteredPayload
|
|
269
|
-
});
|
|
270
|
-
/**
|
|
271
|
-
* Emitted when a job is cancelled.
|
|
272
|
-
*/
|
|
273
|
-
const JobCancelledEvent = defineEvent({
|
|
274
|
-
name: "job.cancelled",
|
|
275
|
-
version: 1,
|
|
276
|
-
description: "A job has been cancelled.",
|
|
277
|
-
payload: JobCancelledPayload
|
|
278
|
-
});
|
|
279
|
-
/**
|
|
280
|
-
* Emitted when a scheduled job is triggered.
|
|
281
|
-
*/
|
|
282
|
-
const ScheduledJobTriggeredEvent = defineEvent({
|
|
283
|
-
name: "scheduler.job_triggered",
|
|
284
|
-
version: 1,
|
|
285
|
-
description: "A scheduled job has been triggered.",
|
|
286
|
-
payload: ScheduledJobTriggeredPayload
|
|
287
|
-
});
|
|
288
|
-
/**
|
|
289
|
-
* All job events.
|
|
290
|
-
*/
|
|
291
|
-
const JobEvents = {
|
|
292
|
-
JobEnqueuedEvent,
|
|
293
|
-
JobStartedEvent,
|
|
294
|
-
JobCompletedEvent,
|
|
295
|
-
JobFailedEvent,
|
|
296
|
-
JobRetryingEvent,
|
|
297
|
-
JobDeadLetteredEvent,
|
|
298
|
-
JobCancelledEvent,
|
|
299
|
-
ScheduledJobTriggeredEvent
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
//#endregion
|
|
303
|
-
export { JobCancelledEvent, JobCompletedEvent, JobDeadLetteredEvent, JobEnqueuedEvent, JobEvents, JobFailedEvent, JobRetryingEvent, JobStartedEvent, ScheduledJobTriggeredEvent };
|
|
1
|
+
import{ScalarTypeEnum as e,defineSchemaModel as t}from"@lssm/lib.schema";import{defineEvent as n}from"@lssm/lib.contracts";const r=t({name:`JobEnqueuedEventPayload`,description:`Payload when a job is added to the queue`,fields:{jobId:{type:e.String_unsecure(),isOptional:!1},type:{type:e.String_unsecure(),isOptional:!1},priority:{type:e.Int_unsecure(),isOptional:!1},scheduledAt:{type:e.DateTime(),isOptional:!0},tenantId:{type:e.String_unsecure(),isOptional:!0},enqueuedAt:{type:e.DateTime(),isOptional:!1}}}),i=t({name:`JobStartedEventPayload`,description:`Payload when a job starts processing`,fields:{jobId:{type:e.String_unsecure(),isOptional:!1},type:{type:e.String_unsecure(),isOptional:!1},attempt:{type:e.Int_unsecure(),isOptional:!1},startedAt:{type:e.DateTime(),isOptional:!1}}}),a=t({name:`JobCompletedEventPayload`,description:`Payload when a job completes successfully`,fields:{jobId:{type:e.String_unsecure(),isOptional:!1},type:{type:e.String_unsecure(),isOptional:!1},attempt:{type:e.Int_unsecure(),isOptional:!1},durationMs:{type:e.Int_unsecure(),isOptional:!1},completedAt:{type:e.DateTime(),isOptional:!1}}}),o=t({name:`JobFailedEventPayload`,description:`Payload when a job attempt fails`,fields:{jobId:{type:e.String_unsecure(),isOptional:!1},type:{type:e.String_unsecure(),isOptional:!1},attempt:{type:e.Int_unsecure(),isOptional:!1},error:{type:e.String_unsecure(),isOptional:!1},willRetry:{type:e.Boolean(),isOptional:!1},failedAt:{type:e.DateTime(),isOptional:!1}}}),s=t({name:`JobRetryingEventPayload`,description:`Payload when a job is scheduled for retry`,fields:{jobId:{type:e.String_unsecure(),isOptional:!1},type:{type:e.String_unsecure(),isOptional:!1},attempt:{type:e.Int_unsecure(),isOptional:!1},nextAttemptAt:{type:e.DateTime(),isOptional:!1},backoffMs:{type:e.Int_unsecure(),isOptional:!1}}}),c=t({name:`JobDeadLetteredEventPayload`,description:`Payload when a job is moved to dead letter queue`,fields:{jobId:{type:e.String_unsecure(),isOptional:!1},type:{type:e.String_unsecure(),isOptional:!1},attempts:{type:e.Int_unsecure(),isOptional:!1},lastError:{type:e.String_unsecure(),isOptional:!1},deadLetteredAt:{type:e.DateTime(),isOptional:!1}}}),l=t({name:`JobCancelledEventPayload`,description:`Payload when a job is cancelled`,fields:{jobId:{type:e.String_unsecure(),isOptional:!1},type:{type:e.String_unsecure(),isOptional:!1},cancelledBy:{type:e.String_unsecure(),isOptional:!0},cancelledAt:{type:e.DateTime(),isOptional:!1}}}),u=t({name:`ScheduledJobTriggeredEventPayload`,description:`Payload when a scheduled job is triggered`,fields:{scheduleName:{type:e.String_unsecure(),isOptional:!1},jobId:{type:e.String_unsecure(),isOptional:!1},jobType:{type:e.String_unsecure(),isOptional:!1},triggeredAt:{type:e.DateTime(),isOptional:!1},nextRunAt:{type:e.DateTime(),isOptional:!0}}}),d=n({name:`job.enqueued`,version:1,description:`A job has been added to the queue.`,payload:r}),f=n({name:`job.started`,version:1,description:`A job has started processing.`,payload:i}),p=n({name:`job.completed`,version:1,description:`A job has completed successfully.`,payload:a}),m=n({name:`job.failed`,version:1,description:`A job attempt has failed.`,payload:o}),h=n({name:`job.retrying`,version:1,description:`A job is being scheduled for retry.`,payload:s}),g=n({name:`job.dead_lettered`,version:1,description:`A job has exhausted all retries and moved to dead letter queue.`,payload:c}),_=n({name:`job.cancelled`,version:1,description:`A job has been cancelled.`,payload:l}),v=n({name:`scheduler.job_triggered`,version:1,description:`A scheduled job has been triggered.`,payload:u}),y={JobEnqueuedEvent:d,JobStartedEvent:f,JobCompletedEvent:p,JobFailedEvent:m,JobRetryingEvent:h,JobDeadLetteredEvent:g,JobCancelledEvent:_,ScheduledJobTriggeredEvent:v};export{_ as JobCancelledEvent,p as JobCompletedEvent,g as JobDeadLetteredEvent,d as JobEnqueuedEvent,y as JobEvents,m as JobFailedEvent,h as JobRetryingEvent,f as JobStartedEvent,v as ScheduledJobTriggeredEvent};
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
function createGmailSyncHandler(adapter) {
|
|
3
|
-
return async (job) => {
|
|
4
|
-
await adapter.syncThreads(job.payload);
|
|
5
|
-
};
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
export { createGmailSyncHandler };
|
|
1
|
+
function e(e){return async t=>{await e.syncThreads(t.payload)}}export{e as createGmailSyncHandler};
|
package/dist/handlers/index.js
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PING_JOB_TYPE, PingPayloadSchema, pingJob } from "./ping-job.js";
|
|
3
|
-
import { createGmailSyncHandler } from "./gmail-sync-handler.js";
|
|
4
|
-
import { createStorageDocumentHandler } from "./storage-document-handler.js";
|
|
5
|
-
|
|
6
|
-
//#region src/handlers/index.ts
|
|
7
|
-
function registerAllJobs(queue) {
|
|
8
|
-
registerDefinedJob(queue, pingJob);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
export { PING_JOB_TYPE, PingPayloadSchema, createGmailSyncHandler, createStorageDocumentHandler, pingJob, registerAllJobs };
|
|
1
|
+
import{registerDefinedJob as e}from"../queue/register-defined-job.js";import{PING_JOB_TYPE as t,PingPayloadSchema as n,pingJob as r}from"./ping-job.js";import{createGmailSyncHandler as i}from"./gmail-sync-handler.js";import{createStorageDocumentHandler as a}from"./storage-document-handler.js";function o(t){e(t,r)}export{t as PING_JOB_TYPE,n as PingPayloadSchema,i as createGmailSyncHandler,a as createStorageDocumentHandler,r as pingJob,o as registerAllJobs};
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#region src/handlers/ping-job.ts
|
|
4
|
-
const PING_JOB_TYPE = "core.ping";
|
|
5
|
-
const PingPayloadSchema = z$1.object({});
|
|
6
|
-
const pingJob = {
|
|
7
|
-
type: PING_JOB_TYPE,
|
|
8
|
-
schema: PingPayloadSchema,
|
|
9
|
-
handler: async (_payload, _job) => {}
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
//#endregion
|
|
13
|
-
export { PING_JOB_TYPE, PingPayloadSchema, pingJob };
|
|
1
|
+
import*as e from"zod";const t=`core.ping`,n=e.object({}),r={type:t,schema:n,handler:async(e,t)=>{}};export{t as PING_JOB_TYPE,n as PingPayloadSchema,r as pingJob};
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
|
|
2
|
-
function createStorageDocumentHandler(storage, adapter) {
|
|
3
|
-
return async (job) => {
|
|
4
|
-
const object = await storage.getObject({
|
|
5
|
-
bucket: job.payload.bucket,
|
|
6
|
-
key: job.payload.key
|
|
7
|
-
});
|
|
8
|
-
if (!object) throw new Error(`Object ${job.payload.bucket}/${job.payload.key} not found`);
|
|
9
|
-
await adapter.ingestObject(object);
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
export { createStorageDocumentHandler };
|
|
1
|
+
function e(e,t){return async n=>{let r=await e.getObject({bucket:n.payload.bucket,key:n.payload.key});if(!r)throw Error(`Object ${n.payload.bucket}/${n.payload.key} not found`);await t.ingestObject(r)}}export{e as createStorageDocumentHandler};
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1 @@
|
|
|
1
|
-
import { JobCancelledEvent, JobCompletedEvent, JobDeadLetteredEvent, JobEnqueuedEvent, JobEvents, JobFailedEvent, JobRetryingEvent, JobStartedEvent, ScheduledJobTriggeredEvent
|
|
2
|
-
import { JobEntity, JobExecutionEntity, JobStatusEnum, ScheduledJobEntity, jobEntities, jobsSchemaContribution } from "./entities/index.js";
|
|
3
|
-
import { DEFAULT_RETRY_POLICY, calculateBackoff, defineJobType } from "./contracts/dist/jobs/queue.js";
|
|
4
|
-
import { MemoryJobQueue } from "./queue/memory-queue.js";
|
|
5
|
-
import { ScalewaySqsJobQueue } from "./queue/scaleway-sqs-queue.js";
|
|
6
|
-
import { GcpCloudTasksQueue } from "./queue/gcp-cloud-tasks.js";
|
|
7
|
-
import { GcpPubSubQueue } from "./queue/gcp-pubsub.js";
|
|
8
|
-
import { registerDefinedJob } from "./queue/register-defined-job.js";
|
|
9
|
-
import "./queue/index.js";
|
|
10
|
-
import { PING_JOB_TYPE, PingPayloadSchema, pingJob } from "./handlers/ping-job.js";
|
|
11
|
-
import { createGmailSyncHandler } from "./handlers/gmail-sync-handler.js";
|
|
12
|
-
import { createStorageDocumentHandler } from "./handlers/storage-document-handler.js";
|
|
13
|
-
import { registerAllJobs } from "./handlers/index.js";
|
|
14
|
-
import { JobScheduler, createScheduler, defineSchedule } from "./scheduler/index.js";
|
|
15
|
-
import { CancelJobContract, CreateScheduledJobContract, EnqueueJobContract, GetJobContract, GetQueueStatsContract, JobModel, ListScheduledJobsContract, QueueStatsModel, ScheduledJobModel, ToggleScheduledJobContract } from "./contracts/index.js";
|
|
16
|
-
import { JobsFeature } from "./jobs.feature.js";
|
|
17
|
-
|
|
18
|
-
export { CancelJobContract, CreateScheduledJobContract, DEFAULT_RETRY_POLICY, EnqueueJobContract, GcpCloudTasksQueue, GcpPubSubQueue, GetJobContract, GetQueueStatsContract, JobCancelledEvent, JobCompletedEvent, JobDeadLetteredEvent, JobEnqueuedEvent, JobEntity, JobEvents, JobExecutionEntity, JobFailedEvent, JobModel, JobRetryingEvent, JobScheduler, JobStartedEvent, JobStatusEnum, JobsFeature, ListScheduledJobsContract, MemoryJobQueue, PING_JOB_TYPE, PingPayloadSchema, QueueStatsModel, ScalewaySqsJobQueue, ScheduledJobEntity, ScheduledJobModel, ScheduledJobTriggeredEvent, ToggleScheduledJobContract, calculateBackoff, createGmailSyncHandler, createScheduler, createStorageDocumentHandler, defineJobType, defineSchedule, jobEntities, jobsSchemaContribution, pingJob, registerAllJobs, registerDefinedJob };
|
|
1
|
+
import{__export as e,__reExport as t}from"./_virtual/rolldown_runtime.js";import{JobCancelledEvent as n,JobCompletedEvent as r,JobDeadLetteredEvent as i,JobEnqueuedEvent as a,JobEvents as o,JobFailedEvent as s,JobRetryingEvent as c,JobStartedEvent as l,ScheduledJobTriggeredEvent as u}from"./events.js";import{JobEntity as d,JobExecutionEntity as f,JobStatusEnum as p,ScheduledJobEntity as m,jobEntities as h,jobsSchemaContribution as g}from"./entities/index.js";import{MemoryJobQueue as _}from"./queue/memory-queue.js";import{ScalewaySqsJobQueue as v}from"./queue/scaleway-sqs-queue.js";import{GcpCloudTasksQueue as y}from"./queue/gcp-cloud-tasks.js";import{GcpPubSubQueue as b}from"./queue/gcp-pubsub.js";import{registerDefinedJob as x}from"./queue/register-defined-job.js";import{queue_exports as S}from"./queue/index.js";import{PING_JOB_TYPE as C,PingPayloadSchema as w,pingJob as T}from"./handlers/ping-job.js";import{createGmailSyncHandler as E}from"./handlers/gmail-sync-handler.js";import{createStorageDocumentHandler as D}from"./handlers/storage-document-handler.js";import{registerAllJobs as O}from"./handlers/index.js";import{JobScheduler as k,createScheduler as A,defineSchedule as j}from"./scheduler/index.js";import{CancelJobContract as M,CreateScheduledJobContract as N,EnqueueJobContract as P,GetJobContract as F,GetQueueStatsContract as I,JobModel as L,ListScheduledJobsContract as R,QueueStatsModel as z,ScheduledJobModel as B,ToggleScheduledJobContract as V}from"./contracts/index.js";import{JobsFeature as H}from"./jobs.feature.js";export*from"@lssm/lib.contracts/jobs/queue";t(e({CancelJobContract:()=>M,CreateScheduledJobContract:()=>N,EnqueueJobContract:()=>P,GcpCloudTasksQueue:()=>y,GcpPubSubQueue:()=>b,GetJobContract:()=>F,GetQueueStatsContract:()=>I,JobCancelledEvent:()=>n,JobCompletedEvent:()=>r,JobDeadLetteredEvent:()=>i,JobEnqueuedEvent:()=>a,JobEntity:()=>d,JobEvents:()=>o,JobExecutionEntity:()=>f,JobFailedEvent:()=>s,JobModel:()=>L,JobRetryingEvent:()=>c,JobScheduler:()=>k,JobStartedEvent:()=>l,JobStatusEnum:()=>p,JobsFeature:()=>H,ListScheduledJobsContract:()=>R,MemoryJobQueue:()=>_,PING_JOB_TYPE:()=>C,PingPayloadSchema:()=>w,QueueStatsModel:()=>z,ScalewaySqsJobQueue:()=>v,ScheduledJobEntity:()=>m,ScheduledJobModel:()=>B,ScheduledJobTriggeredEvent:()=>u,ToggleScheduledJobContract:()=>V,createGmailSyncHandler:()=>E,createScheduler:()=>A,createStorageDocumentHandler:()=>D,defineSchedule:()=>j,jobEntities:()=>h,jobsSchemaContribution:()=>g,pingJob:()=>T,registerAllJobs:()=>O,registerDefinedJob:()=>x}),S);export{M as CancelJobContract,N as CreateScheduledJobContract,P as EnqueueJobContract,y as GcpCloudTasksQueue,b as GcpPubSubQueue,F as GetJobContract,I as GetQueueStatsContract,n as JobCancelledEvent,r as JobCompletedEvent,i as JobDeadLetteredEvent,a as JobEnqueuedEvent,d as JobEntity,o as JobEvents,f as JobExecutionEntity,s as JobFailedEvent,L as JobModel,c as JobRetryingEvent,k as JobScheduler,l as JobStartedEvent,p as JobStatusEnum,H as JobsFeature,R as ListScheduledJobsContract,_ as MemoryJobQueue,C as PING_JOB_TYPE,w as PingPayloadSchema,z as QueueStatsModel,v as ScalewaySqsJobQueue,m as ScheduledJobEntity,B as ScheduledJobModel,u as ScheduledJobTriggeredEvent,V as ToggleScheduledJobContract,E as createGmailSyncHandler,A as createScheduler,D as createStorageDocumentHandler,j as defineSchedule,h as jobEntities,g as jobsSchemaContribution,T as pingJob,O as registerAllJobs,x as registerDefinedJob};
|