@lssm/lib.jobs 0.0.0-canary-20251207013726 → 0.0.0-canary-20251207123819

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.
Files changed (115) hide show
  1. package/dist/contracts/index.js +1 -1
  2. package/dist/entities/index.js +1 -1
  3. package/dist/events.js +1 -1
  4. package/dist/queue/types.js +1 -1
  5. package/package.json +21 -10
  6. package/dist/contracts/dist/capabilities/openbanking.js +0 -1
  7. package/dist/contracts/dist/client/index.js +0 -1
  8. package/dist/contracts/dist/client/react/feature-render.js +0 -1
  9. package/dist/contracts/dist/client/react/form-render.js +0 -1
  10. package/dist/contracts/dist/client/react/index.js +0 -1
  11. package/dist/contracts/dist/events.js +0 -1
  12. package/dist/contracts/dist/experiments/evaluator.js +0 -1
  13. package/dist/contracts/dist/graphql-federation/dist/index.js +0 -1
  14. package/dist/contracts/dist/index.js +0 -1
  15. package/dist/contracts/dist/install.js +0 -1
  16. package/dist/contracts/dist/integrations/contracts.js +0 -1
  17. package/dist/contracts/dist/integrations/index.js +0 -1
  18. package/dist/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -1
  19. package/dist/contracts/dist/integrations/openbanking/contracts/balances.js +0 -1
  20. package/dist/contracts/dist/integrations/openbanking/contracts/index.js +0 -1
  21. package/dist/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -1
  22. package/dist/contracts/dist/integrations/openbanking/models.js +0 -1
  23. package/dist/contracts/dist/integrations/openbanking/telemetry.js +0 -1
  24. package/dist/contracts/dist/integrations/providers/elevenlabs.js +0 -1
  25. package/dist/contracts/dist/integrations/providers/gcs-storage.js +0 -1
  26. package/dist/contracts/dist/integrations/providers/gmail.js +0 -1
  27. package/dist/contracts/dist/integrations/providers/google-calendar.js +0 -1
  28. package/dist/contracts/dist/integrations/providers/impls/elevenlabs-voice.js +0 -1
  29. package/dist/contracts/dist/integrations/providers/impls/gcs-storage.js +0 -1
  30. package/dist/contracts/dist/integrations/providers/impls/gmail-inbound.js +0 -1
  31. package/dist/contracts/dist/integrations/providers/impls/gmail-outbound.js +0 -1
  32. package/dist/contracts/dist/integrations/providers/impls/google-calendar.js +0 -1
  33. package/dist/contracts/dist/integrations/providers/impls/index.js +0 -1
  34. package/dist/contracts/dist/integrations/providers/impls/mistral-embedding.js +0 -1
  35. package/dist/contracts/dist/integrations/providers/impls/mistral-llm.js +0 -1
  36. package/dist/contracts/dist/integrations/providers/impls/postmark-email.js +0 -1
  37. package/dist/contracts/dist/integrations/providers/impls/powens-client.js +0 -1
  38. package/dist/contracts/dist/integrations/providers/impls/powens-openbanking.js +0 -1
  39. package/dist/contracts/dist/integrations/providers/impls/provider-factory.js +0 -1
  40. package/dist/contracts/dist/integrations/providers/impls/qdrant-vector.js +0 -1
  41. package/dist/contracts/dist/integrations/providers/impls/stripe-payments.js +0 -1
  42. package/dist/contracts/dist/integrations/providers/impls/twilio-sms.js +0 -1
  43. package/dist/contracts/dist/integrations/providers/index.js +0 -1
  44. package/dist/contracts/dist/integrations/providers/mistral.js +0 -1
  45. package/dist/contracts/dist/integrations/providers/postmark.js +0 -1
  46. package/dist/contracts/dist/integrations/providers/powens.js +0 -1
  47. package/dist/contracts/dist/integrations/providers/qdrant.js +0 -1
  48. package/dist/contracts/dist/integrations/providers/stripe.js +0 -1
  49. package/dist/contracts/dist/integrations/providers/twilio-sms.js +0 -1
  50. package/dist/contracts/dist/integrations/runtime.js +0 -1
  51. package/dist/contracts/dist/integrations/secrets/env-secret-provider.js +0 -1
  52. package/dist/contracts/dist/integrations/secrets/gcp-secret-manager.js +0 -1
  53. package/dist/contracts/dist/integrations/secrets/index.js +0 -1
  54. package/dist/contracts/dist/integrations/secrets/manager.js +0 -1
  55. package/dist/contracts/dist/integrations/secrets/provider.js +0 -1
  56. package/dist/contracts/dist/jsonschema.js +0 -1
  57. package/dist/contracts/dist/knowledge/contracts.js +0 -1
  58. package/dist/contracts/dist/knowledge/index.js +0 -1
  59. package/dist/contracts/dist/knowledge/spaces/email-threads.js +0 -1
  60. package/dist/contracts/dist/knowledge/spaces/financial-docs.js +0 -1
  61. package/dist/contracts/dist/knowledge/spaces/financial-overview.js +0 -1
  62. package/dist/contracts/dist/knowledge/spaces/index.js +0 -1
  63. package/dist/contracts/dist/knowledge/spaces/product-canon.js +0 -1
  64. package/dist/contracts/dist/knowledge/spaces/support-faq.js +0 -1
  65. package/dist/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -1
  66. package/dist/contracts/dist/onboarding-base.js +0 -1
  67. package/dist/contracts/dist/ownership.js +0 -1
  68. package/dist/contracts/dist/presentations.js +0 -1
  69. package/dist/contracts/dist/presentations.v2.js +0 -1
  70. package/dist/contracts/dist/prompt.js +0 -1
  71. package/dist/contracts/dist/promptRegistry.js +0 -1
  72. package/dist/contracts/dist/regenerator/index.js +0 -1
  73. package/dist/contracts/dist/regenerator/service.js +0 -1
  74. package/dist/contracts/dist/registry.js +0 -1
  75. package/dist/contracts/dist/resources.js +0 -1
  76. package/dist/contracts/dist/schema/dist/EnumType.js +0 -1
  77. package/dist/contracts/dist/schema/dist/FieldType.js +0 -1
  78. package/dist/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -1
  79. package/dist/contracts/dist/schema/dist/SchemaModel.js +0 -1
  80. package/dist/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
  81. package/dist/contracts/dist/schema/dist/entity/index.js +0 -1
  82. package/dist/contracts/dist/schema/dist/entity/types.js +0 -1
  83. package/dist/contracts/dist/schema/dist/index.js +0 -1
  84. package/dist/contracts/dist/server/graphql-pothos.js +0 -1
  85. package/dist/contracts/dist/server/graphql-schema-export.js +0 -1
  86. package/dist/contracts/dist/server/index.js +0 -1
  87. package/dist/contracts/dist/server/provider-mcp.js +0 -1
  88. package/dist/contracts/dist/server/rest-elysia.js +0 -1
  89. package/dist/contracts/dist/server/rest-express.js +0 -1
  90. package/dist/contracts/dist/server/rest-generic.js +0 -1
  91. package/dist/contracts/dist/server/rest-next-app.js +0 -1
  92. package/dist/contracts/dist/server/rest-next-pages.js +0 -1
  93. package/dist/contracts/dist/spec.js +0 -1
  94. package/dist/contracts/dist/telemetry/index.js +0 -1
  95. package/dist/contracts/dist/telemetry/tracker.js +0 -1
  96. package/dist/contracts/dist/tests/index.js +0 -1
  97. package/dist/contracts/dist/tests/runner.js +0 -1
  98. package/dist/contracts/dist/workflow/index.js +0 -1
  99. package/dist/contracts/dist/workflow/runner.js +0 -1
  100. package/dist/contracts/index.d.ts +0 -546
  101. package/dist/entities/index.d.ts +0 -144
  102. package/dist/events.d.ts +0 -387
  103. package/dist/index.d.ts +0 -8
  104. package/dist/queue/index.d.ts +0 -3
  105. package/dist/queue/memory-queue.d.ts +0 -34
  106. package/dist/queue/types.d.ts +0 -131
  107. package/dist/scheduler/index.d.ts +0 -92
  108. package/dist/schema/dist/EnumType.js +0 -1
  109. package/dist/schema/dist/FieldType.js +0 -1
  110. package/dist/schema/dist/ScalarTypeEnum.js +0 -1
  111. package/dist/schema/dist/SchemaModel.js +0 -1
  112. package/dist/schema/dist/entity/defineEntity.js +0 -1
  113. package/dist/schema/dist/entity/index.js +0 -1
  114. package/dist/schema/dist/entity/types.js +0 -1
  115. package/dist/schema/dist/index.js +0 -1
package/dist/events.d.ts DELETED
@@ -1,387 +0,0 @@
1
- import * as _lssm_lib_schema0 from "@lssm/lib.schema";
2
- import * as _lssm_lib_contracts0 from "@lssm/lib.contracts";
3
-
4
- //#region src/events.d.ts
5
- /**
6
- * Emitted when a job is enqueued.
7
- */
8
- declare const JobEnqueuedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
9
- jobId: {
10
- type: _lssm_lib_schema0.FieldType<string, string>;
11
- isOptional: false;
12
- };
13
- type: {
14
- type: _lssm_lib_schema0.FieldType<string, string>;
15
- isOptional: false;
16
- };
17
- priority: {
18
- type: _lssm_lib_schema0.FieldType<number, number>;
19
- isOptional: false;
20
- };
21
- scheduledAt: {
22
- type: _lssm_lib_schema0.FieldType<Date, string>;
23
- isOptional: true;
24
- };
25
- tenantId: {
26
- type: _lssm_lib_schema0.FieldType<string, string>;
27
- isOptional: true;
28
- };
29
- enqueuedAt: {
30
- type: _lssm_lib_schema0.FieldType<Date, string>;
31
- isOptional: false;
32
- };
33
- }>>;
34
- /**
35
- * Emitted when a job starts processing.
36
- */
37
- declare const JobStartedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
38
- jobId: {
39
- type: _lssm_lib_schema0.FieldType<string, string>;
40
- isOptional: false;
41
- };
42
- type: {
43
- type: _lssm_lib_schema0.FieldType<string, string>;
44
- isOptional: false;
45
- };
46
- attempt: {
47
- type: _lssm_lib_schema0.FieldType<number, number>;
48
- isOptional: false;
49
- };
50
- startedAt: {
51
- type: _lssm_lib_schema0.FieldType<Date, string>;
52
- isOptional: false;
53
- };
54
- }>>;
55
- /**
56
- * Emitted when a job completes successfully.
57
- */
58
- declare const JobCompletedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
59
- jobId: {
60
- type: _lssm_lib_schema0.FieldType<string, string>;
61
- isOptional: false;
62
- };
63
- type: {
64
- type: _lssm_lib_schema0.FieldType<string, string>;
65
- isOptional: false;
66
- };
67
- attempt: {
68
- type: _lssm_lib_schema0.FieldType<number, number>;
69
- isOptional: false;
70
- };
71
- durationMs: {
72
- type: _lssm_lib_schema0.FieldType<number, number>;
73
- isOptional: false;
74
- };
75
- completedAt: {
76
- type: _lssm_lib_schema0.FieldType<Date, string>;
77
- isOptional: false;
78
- };
79
- }>>;
80
- /**
81
- * Emitted when a job fails (single attempt).
82
- */
83
- declare const JobFailedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
84
- jobId: {
85
- type: _lssm_lib_schema0.FieldType<string, string>;
86
- isOptional: false;
87
- };
88
- type: {
89
- type: _lssm_lib_schema0.FieldType<string, string>;
90
- isOptional: false;
91
- };
92
- attempt: {
93
- type: _lssm_lib_schema0.FieldType<number, number>;
94
- isOptional: false;
95
- };
96
- error: {
97
- type: _lssm_lib_schema0.FieldType<string, string>;
98
- isOptional: false;
99
- };
100
- willRetry: {
101
- type: _lssm_lib_schema0.FieldType<boolean, boolean>;
102
- isOptional: false;
103
- };
104
- failedAt: {
105
- type: _lssm_lib_schema0.FieldType<Date, string>;
106
- isOptional: false;
107
- };
108
- }>>;
109
- /**
110
- * Emitted when a job is being retried.
111
- */
112
- declare const JobRetryingEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
113
- jobId: {
114
- type: _lssm_lib_schema0.FieldType<string, string>;
115
- isOptional: false;
116
- };
117
- type: {
118
- type: _lssm_lib_schema0.FieldType<string, string>;
119
- isOptional: false;
120
- };
121
- attempt: {
122
- type: _lssm_lib_schema0.FieldType<number, number>;
123
- isOptional: false;
124
- };
125
- nextAttemptAt: {
126
- type: _lssm_lib_schema0.FieldType<Date, string>;
127
- isOptional: false;
128
- };
129
- backoffMs: {
130
- type: _lssm_lib_schema0.FieldType<number, number>;
131
- isOptional: false;
132
- };
133
- }>>;
134
- /**
135
- * Emitted when a job is moved to dead letter queue.
136
- */
137
- declare const JobDeadLetteredEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
138
- jobId: {
139
- type: _lssm_lib_schema0.FieldType<string, string>;
140
- isOptional: false;
141
- };
142
- type: {
143
- type: _lssm_lib_schema0.FieldType<string, string>;
144
- isOptional: false;
145
- };
146
- attempts: {
147
- type: _lssm_lib_schema0.FieldType<number, number>;
148
- isOptional: false;
149
- };
150
- lastError: {
151
- type: _lssm_lib_schema0.FieldType<string, string>;
152
- isOptional: false;
153
- };
154
- deadLetteredAt: {
155
- type: _lssm_lib_schema0.FieldType<Date, string>;
156
- isOptional: false;
157
- };
158
- }>>;
159
- /**
160
- * Emitted when a job is cancelled.
161
- */
162
- declare const JobCancelledEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
163
- jobId: {
164
- type: _lssm_lib_schema0.FieldType<string, string>;
165
- isOptional: false;
166
- };
167
- type: {
168
- type: _lssm_lib_schema0.FieldType<string, string>;
169
- isOptional: false;
170
- };
171
- cancelledBy: {
172
- type: _lssm_lib_schema0.FieldType<string, string>;
173
- isOptional: true;
174
- };
175
- cancelledAt: {
176
- type: _lssm_lib_schema0.FieldType<Date, string>;
177
- isOptional: false;
178
- };
179
- }>>;
180
- /**
181
- * Emitted when a scheduled job is triggered.
182
- */
183
- declare const ScheduledJobTriggeredEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
184
- scheduleName: {
185
- type: _lssm_lib_schema0.FieldType<string, string>;
186
- isOptional: false;
187
- };
188
- jobId: {
189
- type: _lssm_lib_schema0.FieldType<string, string>;
190
- isOptional: false;
191
- };
192
- jobType: {
193
- type: _lssm_lib_schema0.FieldType<string, string>;
194
- isOptional: false;
195
- };
196
- triggeredAt: {
197
- type: _lssm_lib_schema0.FieldType<Date, string>;
198
- isOptional: false;
199
- };
200
- nextRunAt: {
201
- type: _lssm_lib_schema0.FieldType<Date, string>;
202
- isOptional: true;
203
- };
204
- }>>;
205
- /**
206
- * All job events.
207
- */
208
- declare const JobEvents: {
209
- JobEnqueuedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
210
- jobId: {
211
- type: _lssm_lib_schema0.FieldType<string, string>;
212
- isOptional: false;
213
- };
214
- type: {
215
- type: _lssm_lib_schema0.FieldType<string, string>;
216
- isOptional: false;
217
- };
218
- priority: {
219
- type: _lssm_lib_schema0.FieldType<number, number>;
220
- isOptional: false;
221
- };
222
- scheduledAt: {
223
- type: _lssm_lib_schema0.FieldType<Date, string>;
224
- isOptional: true;
225
- };
226
- tenantId: {
227
- type: _lssm_lib_schema0.FieldType<string, string>;
228
- isOptional: true;
229
- };
230
- enqueuedAt: {
231
- type: _lssm_lib_schema0.FieldType<Date, string>;
232
- isOptional: false;
233
- };
234
- }>>;
235
- JobStartedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
236
- jobId: {
237
- type: _lssm_lib_schema0.FieldType<string, string>;
238
- isOptional: false;
239
- };
240
- type: {
241
- type: _lssm_lib_schema0.FieldType<string, string>;
242
- isOptional: false;
243
- };
244
- attempt: {
245
- type: _lssm_lib_schema0.FieldType<number, number>;
246
- isOptional: false;
247
- };
248
- startedAt: {
249
- type: _lssm_lib_schema0.FieldType<Date, string>;
250
- isOptional: false;
251
- };
252
- }>>;
253
- JobCompletedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
254
- jobId: {
255
- type: _lssm_lib_schema0.FieldType<string, string>;
256
- isOptional: false;
257
- };
258
- type: {
259
- type: _lssm_lib_schema0.FieldType<string, string>;
260
- isOptional: false;
261
- };
262
- attempt: {
263
- type: _lssm_lib_schema0.FieldType<number, number>;
264
- isOptional: false;
265
- };
266
- durationMs: {
267
- type: _lssm_lib_schema0.FieldType<number, number>;
268
- isOptional: false;
269
- };
270
- completedAt: {
271
- type: _lssm_lib_schema0.FieldType<Date, string>;
272
- isOptional: false;
273
- };
274
- }>>;
275
- JobFailedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
276
- jobId: {
277
- type: _lssm_lib_schema0.FieldType<string, string>;
278
- isOptional: false;
279
- };
280
- type: {
281
- type: _lssm_lib_schema0.FieldType<string, string>;
282
- isOptional: false;
283
- };
284
- attempt: {
285
- type: _lssm_lib_schema0.FieldType<number, number>;
286
- isOptional: false;
287
- };
288
- error: {
289
- type: _lssm_lib_schema0.FieldType<string, string>;
290
- isOptional: false;
291
- };
292
- willRetry: {
293
- type: _lssm_lib_schema0.FieldType<boolean, boolean>;
294
- isOptional: false;
295
- };
296
- failedAt: {
297
- type: _lssm_lib_schema0.FieldType<Date, string>;
298
- isOptional: false;
299
- };
300
- }>>;
301
- JobRetryingEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
302
- jobId: {
303
- type: _lssm_lib_schema0.FieldType<string, string>;
304
- isOptional: false;
305
- };
306
- type: {
307
- type: _lssm_lib_schema0.FieldType<string, string>;
308
- isOptional: false;
309
- };
310
- attempt: {
311
- type: _lssm_lib_schema0.FieldType<number, number>;
312
- isOptional: false;
313
- };
314
- nextAttemptAt: {
315
- type: _lssm_lib_schema0.FieldType<Date, string>;
316
- isOptional: false;
317
- };
318
- backoffMs: {
319
- type: _lssm_lib_schema0.FieldType<number, number>;
320
- isOptional: false;
321
- };
322
- }>>;
323
- JobDeadLetteredEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
324
- jobId: {
325
- type: _lssm_lib_schema0.FieldType<string, string>;
326
- isOptional: false;
327
- };
328
- type: {
329
- type: _lssm_lib_schema0.FieldType<string, string>;
330
- isOptional: false;
331
- };
332
- attempts: {
333
- type: _lssm_lib_schema0.FieldType<number, number>;
334
- isOptional: false;
335
- };
336
- lastError: {
337
- type: _lssm_lib_schema0.FieldType<string, string>;
338
- isOptional: false;
339
- };
340
- deadLetteredAt: {
341
- type: _lssm_lib_schema0.FieldType<Date, string>;
342
- isOptional: false;
343
- };
344
- }>>;
345
- JobCancelledEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
346
- jobId: {
347
- type: _lssm_lib_schema0.FieldType<string, string>;
348
- isOptional: false;
349
- };
350
- type: {
351
- type: _lssm_lib_schema0.FieldType<string, string>;
352
- isOptional: false;
353
- };
354
- cancelledBy: {
355
- type: _lssm_lib_schema0.FieldType<string, string>;
356
- isOptional: true;
357
- };
358
- cancelledAt: {
359
- type: _lssm_lib_schema0.FieldType<Date, string>;
360
- isOptional: false;
361
- };
362
- }>>;
363
- ScheduledJobTriggeredEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
364
- scheduleName: {
365
- type: _lssm_lib_schema0.FieldType<string, string>;
366
- isOptional: false;
367
- };
368
- jobId: {
369
- type: _lssm_lib_schema0.FieldType<string, string>;
370
- isOptional: false;
371
- };
372
- jobType: {
373
- type: _lssm_lib_schema0.FieldType<string, string>;
374
- isOptional: false;
375
- };
376
- triggeredAt: {
377
- type: _lssm_lib_schema0.FieldType<Date, string>;
378
- isOptional: false;
379
- };
380
- nextRunAt: {
381
- type: _lssm_lib_schema0.FieldType<Date, string>;
382
- isOptional: true;
383
- };
384
- }>>;
385
- };
386
- //#endregion
387
- export { JobCancelledEvent, JobCompletedEvent, JobDeadLetteredEvent, JobEnqueuedEvent, JobEvents, JobFailedEvent, JobRetryingEvent, JobStartedEvent, ScheduledJobTriggeredEvent };
package/dist/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { CancelJobContract, CreateScheduledJobContract, EnqueueJobContract, GetJobContract, GetQueueStatsContract, JobModel, ListScheduledJobsContract, QueueStatsModel, ScheduledJobModel, ToggleScheduledJobContract } from "./contracts/index.js";
2
- import { JobEntity, JobExecutionEntity, JobStatusEnum, ScheduledJobEntity, jobEntities, jobsSchemaContribution } from "./entities/index.js";
3
- import { JobCancelledEvent, JobCompletedEvent, JobDeadLetteredEvent, JobEnqueuedEvent, JobEvents, JobFailedEvent, JobRetryingEvent, JobStartedEvent, ScheduledJobTriggeredEvent } from "./events.js";
4
- import { DEFAULT_RETRY_POLICY, EnqueueOptions, Job, JobHandler, JobQueue, JobStatus, JobTypeDef, QueueStats, RetryPolicy, calculateBackoff, defineJobType } from "./queue/types.js";
5
- import { MemoryJobQueue, MemoryQueueOptions } from "./queue/memory-queue.js";
6
- import "./queue/index.js";
7
- import { ActiveSchedule, JobScheduler, ScheduledJobConfig, createScheduler, defineSchedule } from "./scheduler/index.js";
8
- export { ActiveSchedule, CancelJobContract, CreateScheduledJobContract, DEFAULT_RETRY_POLICY, EnqueueJobContract, EnqueueOptions, GetJobContract, GetQueueStatsContract, Job, JobCancelledEvent, JobCompletedEvent, JobDeadLetteredEvent, JobEnqueuedEvent, JobEntity, JobEvents, JobExecutionEntity, JobFailedEvent, JobHandler, JobModel, JobQueue, JobRetryingEvent, JobScheduler, JobStartedEvent, JobStatus, JobStatusEnum, JobTypeDef, ListScheduledJobsContract, MemoryJobQueue, MemoryQueueOptions, QueueStats, QueueStatsModel, RetryPolicy, ScheduledJobConfig, ScheduledJobEntity, ScheduledJobModel, ScheduledJobTriggeredEvent, ToggleScheduledJobContract, calculateBackoff, createScheduler, defineJobType, defineSchedule, jobEntities, jobsSchemaContribution };
@@ -1,3 +0,0 @@
1
- import { DEFAULT_RETRY_POLICY, EnqueueOptions, Job, JobHandler, JobQueue, JobStatus, JobTypeDef, QueueStats, RetryPolicy, calculateBackoff, defineJobType } from "./types.js";
2
- import { MemoryJobQueue, MemoryQueueOptions } from "./memory-queue.js";
3
- export { DEFAULT_RETRY_POLICY, EnqueueOptions, Job, JobHandler, JobQueue, JobStatus, JobTypeDef, MemoryJobQueue, MemoryQueueOptions, QueueStats, RetryPolicy, calculateBackoff, defineJobType };
@@ -1,34 +0,0 @@
1
- import { EnqueueOptions, Job, JobHandler, JobQueue, QueueStats, RetryPolicy } from "./types.js";
2
-
3
- //#region src/queue/memory-queue.d.ts
4
- interface MemoryQueueOptions {
5
- /** Poll interval in milliseconds */
6
- pollIntervalMs?: number;
7
- /** Maximum concurrent jobs */
8
- concurrency?: number;
9
- /** Default retry policy */
10
- retryPolicy?: RetryPolicy;
11
- }
12
- /**
13
- * In-memory job queue for development and testing.
14
- */
15
- declare class MemoryJobQueue implements JobQueue {
16
- private readonly jobs;
17
- private readonly handlers;
18
- private timer?;
19
- private activeCount;
20
- private readonly pollIntervalMs;
21
- private readonly concurrency;
22
- private readonly retryPolicy;
23
- constructor(options?: MemoryQueueOptions);
24
- enqueue<TPayload>(jobType: string, payload: TPayload, options?: EnqueueOptions): Promise<Job<TPayload>>;
25
- register<TPayload, TResult = void>(jobType: string, handler: JobHandler<TPayload, TResult>): void;
26
- start(): void;
27
- stop(): Promise<void>;
28
- getJob(jobId: string): Promise<Job | null>;
29
- cancelJob(jobId: string): Promise<boolean>;
30
- getStats(): Promise<QueueStats>;
31
- private processNext;
32
- }
33
- //#endregion
34
- export { MemoryJobQueue, MemoryQueueOptions };
@@ -1,131 +0,0 @@
1
- import { z } from "zod";
2
-
3
- //#region src/queue/types.d.ts
4
-
5
- /**
6
- * Job status values.
7
- */
8
- type JobStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled' | 'dead_letter';
9
- /**
10
- * A job in the queue.
11
- */
12
- interface Job<TPayload = unknown> {
13
- id: string;
14
- type: string;
15
- version: number;
16
- payload: TPayload;
17
- status: JobStatus;
18
- priority: number;
19
- attempts: number;
20
- maxRetries: number;
21
- createdAt: Date;
22
- updatedAt: Date;
23
- scheduledAt?: Date;
24
- startedAt?: Date;
25
- completedAt?: Date;
26
- timeoutAt?: Date;
27
- lastError?: string;
28
- dedupeKey?: string;
29
- tenantId?: string;
30
- userId?: string;
31
- traceId?: string;
32
- metadata?: Record<string, unknown>;
33
- result?: unknown;
34
- }
35
- /**
36
- * Options for enqueueing a job.
37
- */
38
- interface EnqueueOptions {
39
- /** Delay execution by this many seconds */
40
- delaySeconds?: number;
41
- /** Key for deduplication (only one job with this key can be pending) */
42
- dedupeKey?: string;
43
- /** Maximum retry attempts (overrides job type default) */
44
- maxRetries?: number;
45
- /** Job priority (higher = more urgent) */
46
- priority?: number;
47
- /** Timeout in milliseconds */
48
- timeoutMs?: number;
49
- /** Tenant context */
50
- tenantId?: string;
51
- /** User who enqueued */
52
- userId?: string;
53
- /** Trace ID for distributed tracing */
54
- traceId?: string;
55
- /** Additional metadata */
56
- metadata?: Record<string, unknown>;
57
- }
58
- /**
59
- * Job handler function.
60
- */
61
- type JobHandler<TPayload = unknown, TResult = void> = (job: Job<TPayload>) => Promise<TResult>;
62
- /**
63
- * Job queue interface.
64
- */
65
- interface JobQueue {
66
- /** Enqueue a new job */
67
- enqueue<TPayload>(jobType: string, payload: TPayload, options?: EnqueueOptions): Promise<Job<TPayload>>;
68
- /** Register a handler for a job type */
69
- register<TPayload, TResult = void>(jobType: string, handler: JobHandler<TPayload, TResult>): void;
70
- /** Start processing jobs */
71
- start(): void;
72
- /** Stop processing jobs gracefully */
73
- stop(): Promise<void>;
74
- /** Get job by ID */
75
- getJob?(jobId: string): Promise<Job | null>;
76
- /** Cancel a pending job */
77
- cancelJob?(jobId: string): Promise<boolean>;
78
- /** Get queue stats */
79
- getStats?(): Promise<QueueStats>;
80
- }
81
- /**
82
- * Queue statistics.
83
- */
84
- interface QueueStats {
85
- pending: number;
86
- running: number;
87
- completed: number;
88
- failed: number;
89
- deadLetter: number;
90
- }
91
- /**
92
- * Retry policy configuration.
93
- */
94
- interface RetryPolicy {
95
- /** Maximum number of retry attempts */
96
- maxRetries: number;
97
- /** Initial backoff in milliseconds */
98
- initialBackoffMs: number;
99
- /** Maximum backoff in milliseconds */
100
- maxBackoffMs: number;
101
- /** Backoff multiplier (exponential) */
102
- multiplier: number;
103
- /** Add jitter to backoff */
104
- jitter: boolean;
105
- }
106
- /**
107
- * Default retry policy.
108
- */
109
- declare const DEFAULT_RETRY_POLICY: RetryPolicy;
110
- /**
111
- * Calculate backoff delay for a retry attempt.
112
- */
113
- declare function calculateBackoff(attempt: number, policy?: RetryPolicy): number;
114
- /**
115
- * Job type definition.
116
- */
117
- interface JobTypeDef<TPayload = unknown> {
118
- type: string;
119
- version: number;
120
- payload: z.ZodType<TPayload>;
121
- options?: Partial<RetryPolicy & {
122
- timeoutMs: number;
123
- }>;
124
- description?: string;
125
- }
126
- /**
127
- * Define a typed job type.
128
- */
129
- declare function defineJobType<TPayload>(def: JobTypeDef<TPayload>): JobTypeDef<TPayload>;
130
- //#endregion
131
- export { DEFAULT_RETRY_POLICY, EnqueueOptions, Job, JobHandler, JobQueue, JobStatus, JobTypeDef, QueueStats, RetryPolicy, calculateBackoff, defineJobType };
@@ -1,92 +0,0 @@
1
- import { EnqueueOptions, JobQueue } from "../queue/types.js";
2
-
3
- //#region src/scheduler/index.d.ts
4
-
5
- /**
6
- * Scheduled job configuration.
7
- */
8
- interface ScheduledJobConfig {
9
- /** Unique name for the schedule */
10
- name: string;
11
- /** Cron expression (e.g., '0 0 * * *' for daily at midnight) */
12
- cronExpression: string;
13
- /** Job type to enqueue */
14
- jobType: string;
15
- /** Job payload (can be a function for dynamic payloads) */
16
- payload?: unknown | (() => unknown | Promise<unknown>);
17
- /** Enqueue options */
18
- options?: EnqueueOptions;
19
- /** Timezone for cron evaluation (default: UTC) */
20
- timezone?: string;
21
- /** Whether the schedule is enabled */
22
- enabled?: boolean;
23
- /** Description */
24
- description?: string;
25
- }
26
- /**
27
- * Active scheduled job with next run time.
28
- */
29
- interface ActiveSchedule extends ScheduledJobConfig {
30
- nextRun: Date | null;
31
- lastRun: Date | null;
32
- }
33
- /**
34
- * Job scheduler for recurring jobs.
35
- */
36
- declare class JobScheduler {
37
- private readonly queue;
38
- private readonly schedules;
39
- private timer?;
40
- private readonly checkIntervalMs;
41
- constructor(queue: JobQueue, options?: {
42
- checkIntervalMs?: number;
43
- });
44
- /**
45
- * Add a scheduled job.
46
- */
47
- schedule(config: ScheduledJobConfig): void;
48
- /**
49
- * Remove a scheduled job.
50
- */
51
- unschedule(name: string): boolean;
52
- /**
53
- * Enable a scheduled job.
54
- */
55
- enable(name: string): boolean;
56
- /**
57
- * Disable a scheduled job.
58
- */
59
- disable(name: string): boolean;
60
- /**
61
- * Get all schedules.
62
- */
63
- getSchedules(): ActiveSchedule[];
64
- /**
65
- * Get a specific schedule.
66
- */
67
- getSchedule(name: string): ActiveSchedule | undefined;
68
- /**
69
- * Start the scheduler.
70
- */
71
- start(): void;
72
- /**
73
- * Stop the scheduler.
74
- */
75
- stop(): void;
76
- /**
77
- * Check and enqueue due schedules.
78
- */
79
- private checkSchedules;
80
- }
81
- /**
82
- * Create a job scheduler instance.
83
- */
84
- declare function createScheduler(queue: JobQueue, options?: {
85
- checkIntervalMs?: number;
86
- }): JobScheduler;
87
- /**
88
- * Helper to define a scheduled job configuration.
89
- */
90
- declare function defineSchedule(config: ScheduledJobConfig): ScheduledJobConfig;
91
- //#endregion
92
- export { ActiveSchedule, JobScheduler, ScheduledJobConfig, createScheduler, defineSchedule };
@@ -1 +0,0 @@
1
- import{z as e}from"zod";import"graphql";
@@ -1 +0,0 @@
1
- import{z as e}from"zod";import{GraphQLScalarType as t}from"graphql";var n=class extends t{zodSchema;jsonSchemaDef;constructor(e){super(e),this.zodSchema=e.zod,this.jsonSchemaDef=e.jsonSchema}getZod(){return this.zodSchema}getPothos(){return this}getJson(){return typeof this.jsonSchemaDef==`function`?this.jsonSchemaDef():this.jsonSchemaDef}getJsonSchemaDef(){return this.jsonSchemaDef}getJsonSchema(){let e=t=>{let n=typeof t==`function`?t():t;if(Array.isArray(n))return n.map(t=>e(t));if(n&&typeof n==`object`){let t={};for(let[r,i]of Object.entries(n))t[r]=e(i);return t}return n};return e(this.getJson())}};export{n};
@@ -1 +0,0 @@
1
- import{n as e}from"./FieldType.js";import{z as t}from"zod";import{Kind as n}from"graphql";const r=/^[A-Za-z]{2}(?:-[A-Za-z0-9]{2,8})*$/,i=/^(?:UTC|[A-Za-z_]+\/[A-Za-z_]+)$/,a=/^[+]?\d[\d\s().-]{3,}$/,o=/^[A-Z]{3}$/,s=/^[A-Z]{2}$/,c=-180,l={String_unsecure:()=>new e({name:`String_unsecure`,description:`Unvalidated string scalar`,zod:t.string(),parseValue:e=>t.string().parse(e),serialize:e=>String(e),parseLiteral:e=>{if(e.kind!==n.STRING)throw TypeError(`Invalid literal`);return e.value},jsonSchema:{type:`string`}}),Int_unsecure:()=>new e({name:`Int_unsecure`,description:`Unvalidated integer scalar`,zod:t.number().int(),parseValue:e=>{let n=typeof e==`number`?e:Number(e);return t.number().int().parse(n)},serialize:e=>Math.trunc(typeof e==`number`?e:Number(e)),parseLiteral:e=>{if(e.kind!==n.INT)throw TypeError(`Invalid literal`);return Number(e.value)},jsonSchema:{type:`integer`}}),Float_unsecure:()=>new e({name:`Float_unsecure`,description:`Unvalidated float scalar`,zod:t.number(),parseValue:e=>{let n=typeof e==`number`?e:Number(e);return t.number().parse(n)},serialize:e=>Number(e),parseLiteral:e=>{if(e.kind!==n.FLOAT&&e.kind!==n.INT)throw TypeError(`Invalid literal`);return Number(e.value)},jsonSchema:{type:`number`}}),Boolean:()=>new e({name:`Boolean`,description:`Unvalidated boolean scalar`,zod:t.boolean(),parseValue:e=>t.coerce.boolean().parse(e),serialize:e=>!!e,parseLiteral:e=>{if(e.kind!==n.BOOLEAN)throw TypeError(`Invalid literal`);return e.value},jsonSchema:{type:`boolean`}}),ID:()=>new e({name:`ID`,description:`Unvalidated id scalar`,zod:t.string(),parseValue:e=>t.string().parse(e),serialize:e=>String(e),parseLiteral:e=>{if(e.kind!==n.STRING)throw TypeError(`Invalid literal`);return e.value},jsonSchema:{type:`string`}}),JSON:()=>new e({name:`JSON`,zod:t.any(),parseValue:e=>e,serialize:e=>e,jsonSchema:{}}),JSONObject:()=>new e({name:`JSONObject`,zod:t.record(t.string(),t.any()),parseValue:e=>t.record(t.string(),t.any()).parse(e),serialize:e=>e??{},jsonSchema:{type:`object`}}),Date:()=>new e({name:`Date`,zod:t.date(),parseValue:e=>e instanceof Date?e:new Date(String(e)),serialize:e=>e instanceof Date?e.toISOString().split(`T`)[0]:String(e),jsonSchema:{type:`string`,format:`date`}}),DateTime:()=>new e({name:`DateTime`,zod:t.date(),parseValue:e=>e instanceof Date?e:new Date(String(e)),serialize:e=>e instanceof Date?e.toISOString():String(e),jsonSchema:{type:`string`,format:`date-time`}}),Time:()=>new e({name:`Time`,zod:t.string().regex(/^\d{2}:\d{2}(:\d{2})?$/),parseValue:e=>t.string().regex(/^\d{2}:\d{2}(:\d{2})?$/).parse(e),serialize:e=>String(e),jsonSchema:{type:`string`,pattern:`^\\d{2}:\\d{2}(:\\d{2})?$`}}),EmailAddress:()=>new e({name:`EmailAddress`,zod:t.string().email(),parseValue:e=>t.string().email().parse(e),serialize:e=>String(e),jsonSchema:{type:`string`,format:`email`}}),URL:()=>new e({name:`URL`,zod:t.string().url(),parseValue:e=>t.string().url().parse(e),serialize:e=>String(e),jsonSchema:{type:`string`,format:`uri`}}),PhoneNumber:()=>new e({name:`PhoneNumber`,zod:t.string().regex(a),parseValue:e=>t.string().regex(a).parse(e),serialize:e=>String(e),jsonSchema:{type:`string`,pattern:a.source}}),NonEmptyString:()=>new e({name:`NonEmptyString`,zod:t.string().min(1),parseValue:e=>t.string().min(1).parse(e),serialize:e=>String(e),jsonSchema:{type:`string`,minLength:1}}),Locale:()=>new e({name:`Locale`,zod:t.string().regex(r),parseValue:e=>t.string().regex(r).parse(e),serialize:e=>String(e),jsonSchema:{type:`string`,pattern:r.source}}),TimeZone:()=>new e({name:`TimeZone`,zod:t.string().regex(i),parseValue:e=>t.string().regex(i).parse(e),serialize:e=>String(e),jsonSchema:{type:`string`,pattern:i.source}}),Latitude:()=>new e({name:`Latitude`,zod:t.number().min(-90).max(90),parseValue:e=>t.coerce.number().min(-90).max(90).parse(e),serialize:e=>Number(e),jsonSchema:{type:`number`,minimum:-90,maximum:90}}),Longitude:()=>new e({name:`Longitude`,zod:t.number().min(c).max(180),parseValue:e=>t.coerce.number().min(c).max(180).parse(e),serialize:e=>Number(e),jsonSchema:{type:`number`,minimum:c,maximum:180}}),Currency:()=>new e({name:`Currency`,zod:t.string().regex(o),parseValue:e=>t.string().regex(o).parse(e),serialize:e=>String(e),jsonSchema:{type:`string`,pattern:o.source}}),CountryCode:()=>new e({name:`CountryCode`,zod:t.string().regex(s),parseValue:e=>t.string().regex(s).parse(e),serialize:e=>String(e),jsonSchema:{type:`string`,pattern:s.source}})};export{l};
@@ -1 +0,0 @@
1
- import"./EnumType.js";import"./FieldType.js";import{z as e}from"zod";var t=class{constructor(e){this.config=e}getZod(){let t=Object.entries(this.config.fields).reduce((t,[n,r])=>{let i=r.type.getZod(),a=r.isArray?e.array(i):i;return t[n]=r.isOptional?a.optional():a,t},{});return e.object(t)}getPothosInput(){return this.config.name}};const n=e=>new t(e);export{n,t};
@@ -1 +0,0 @@
1
- import{z as e}from"zod";function t(e){return e}function n(e){return e}const r={string(e){return{kind:`scalar`,type:`String`,...e}},int(e){return{kind:`scalar`,type:`Int`,...e}},float(e){return{kind:`scalar`,type:`Float`,...e}},boolean(e){return{kind:`scalar`,type:`Boolean`,...e}},dateTime(e){return{kind:`scalar`,type:`DateTime`,...e}},json(e){return{kind:`scalar`,type:`Json`,...e}},bigInt(e){return{kind:`scalar`,type:`BigInt`,...e}},decimal(e){return{kind:`scalar`,type:`Decimal`,...e}},bytes(e){return{kind:`scalar`,type:`Bytes`,...e}},id(e){return{kind:`scalar`,type:`String`,isId:!0,default:`cuid()`,...e}},uuid(e){return{kind:`scalar`,type:`String`,isId:!0,default:`uuid()`,...e}},autoIncrement(e){return{kind:`scalar`,type:`Int`,isId:!0,default:`autoincrement()`,...e}},createdAt(e){return{kind:`scalar`,type:`DateTime`,default:`now()`,...e}},updatedAt(e){return{kind:`scalar`,type:`DateTime`,updatedAt:!0,...e}},email(t){return{kind:`scalar`,type:`String`,zod:e.email(),...t}},url(t){return{kind:`scalar`,type:`String`,zod:e.url(),...t}},enum(e,t){return{kind:`enum`,enumName:e,...t}},inlineEnum(e,t,n){return{kind:`enum`,enumName:e,values:t,...n}},hasOne(e,t){return{kind:`relation`,type:`hasOne`,target:e,...t}},hasMany(e,t){return{kind:`relation`,type:`hasMany`,target:e,...t}},belongsTo(e,t,n,r){return{kind:`relation`,type:`belongsTo`,target:e,fields:t,references:n,...r}},foreignKey(e){return{kind:`scalar`,type:`String`,...e}}},i={on(e,t){return{fields:e,...t}},unique(e,t){return{fields:e,unique:!0,...t}},compound(e,t,n){return{fields:e,sort:t,...n}}};export{i,n,r,t};
@@ -1 +0,0 @@
1
- import{i as e,n as t,r as n,t as r}from"./defineEntity.js";import"./types.js";
@@ -1 +0,0 @@
1
- import{z as e}from"zod";
@@ -1 +0,0 @@
1
- import"./EnumType.js";import{n as e}from"./FieldType.js";import{l as t}from"./ScalarTypeEnum.js";import{n,t as r}from"./SchemaModel.js";import{i,n as a,r as o,t as s}from"./entity/defineEntity.js";import"./entity/index.js";