@contractspec/lib.jobs 1.57.0 → 1.59.0

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 (92) hide show
  1. package/dist/contracts/index.d.ts +494 -500
  2. package/dist/contracts/index.d.ts.map +1 -1
  3. package/dist/contracts/index.js +298 -461
  4. package/dist/entities/index.d.ts +117 -122
  5. package/dist/entities/index.d.ts.map +1 -1
  6. package/dist/entities/index.js +170 -193
  7. package/dist/events.d.ts +297 -303
  8. package/dist/events.d.ts.map +1 -1
  9. package/dist/events.js +199 -351
  10. package/dist/handlers/gmail-sync-handler.d.ts +5 -9
  11. package/dist/handlers/gmail-sync-handler.d.ts.map +1 -1
  12. package/dist/handlers/gmail-sync-handler.js +8 -8
  13. package/dist/handlers/index.d.ts +5 -9
  14. package/dist/handlers/index.d.ts.map +1 -1
  15. package/dist/handlers/index.js +53 -10
  16. package/dist/handlers/ping-job.d.ts +6 -10
  17. package/dist/handlers/ping-job.d.ts.map +1 -1
  18. package/dist/handlers/ping-job.js +13 -12
  19. package/dist/handlers/storage-document-handler.d.ts +7 -11
  20. package/dist/handlers/storage-document-handler.d.ts.map +1 -1
  21. package/dist/handlers/storage-document-handler.js +15 -13
  22. package/dist/index.d.ts +7 -24
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +1366 -64
  25. package/dist/jobs.capability.d.ts +2 -7
  26. package/dist/jobs.capability.d.ts.map +1 -1
  27. package/dist/jobs.capability.js +29 -33
  28. package/dist/jobs.feature.d.ts +1 -6
  29. package/dist/jobs.feature.d.ts.map +1 -1
  30. package/dist/jobs.feature.js +45 -108
  31. package/dist/node/contracts/index.js +318 -0
  32. package/dist/node/entities/index.js +174 -0
  33. package/dist/node/events.js +200 -0
  34. package/dist/node/handlers/gmail-sync-handler.js +9 -0
  35. package/dist/node/handlers/index.js +55 -0
  36. package/dist/node/handlers/ping-job.js +14 -0
  37. package/dist/node/handlers/storage-document-handler.js +16 -0
  38. package/dist/node/index.js +1368 -0
  39. package/dist/node/jobs.capability.js +28 -0
  40. package/dist/node/jobs.feature.js +46 -0
  41. package/dist/node/queue/gcp-cloud-tasks.js +66 -0
  42. package/dist/node/queue/gcp-pubsub.js +54 -0
  43. package/dist/node/queue/index.js +478 -0
  44. package/dist/node/queue/memory-queue.js +160 -0
  45. package/dist/node/queue/register-defined-job.js +15 -0
  46. package/dist/node/queue/scaleway-sqs-queue.js +206 -0
  47. package/dist/node/queue/types.js +10 -0
  48. package/dist/node/scheduler/index.js +117 -0
  49. package/dist/queue/gcp-cloud-tasks.d.ts +33 -36
  50. package/dist/queue/gcp-cloud-tasks.d.ts.map +1 -1
  51. package/dist/queue/gcp-cloud-tasks.js +65 -59
  52. package/dist/queue/gcp-pubsub.d.ts +18 -21
  53. package/dist/queue/gcp-pubsub.d.ts.map +1 -1
  54. package/dist/queue/gcp-pubsub.js +53 -45
  55. package/dist/queue/index.d.ts +6 -15
  56. package/dist/queue/index.d.ts.map +1 -1
  57. package/dist/queue/index.js +476 -20
  58. package/dist/queue/memory-queue.d.ts +25 -29
  59. package/dist/queue/memory-queue.d.ts.map +1 -1
  60. package/dist/queue/memory-queue.js +159 -138
  61. package/dist/queue/register-defined-job.d.ts +3 -7
  62. package/dist/queue/register-defined-job.d.ts.map +1 -1
  63. package/dist/queue/register-defined-job.js +14 -14
  64. package/dist/queue/scaleway-sqs-queue.d.ts +31 -35
  65. package/dist/queue/scaleway-sqs-queue.d.ts.map +1 -1
  66. package/dist/queue/scaleway-sqs-queue.js +205 -173
  67. package/dist/queue/types.d.ts +2 -8
  68. package/dist/queue/types.d.ts.map +1 -1
  69. package/dist/queue/types.js +11 -12
  70. package/dist/scheduler/index.d.ts +68 -72
  71. package/dist/scheduler/index.d.ts.map +1 -1
  72. package/dist/scheduler/index.js +113 -141
  73. package/package.json +176 -50
  74. package/dist/_virtual/_rolldown/runtime.js +0 -36
  75. package/dist/contracts/index.js.map +0 -1
  76. package/dist/entities/index.js.map +0 -1
  77. package/dist/events.js.map +0 -1
  78. package/dist/handlers/gmail-sync-handler.js.map +0 -1
  79. package/dist/handlers/index.js.map +0 -1
  80. package/dist/handlers/ping-job.js.map +0 -1
  81. package/dist/handlers/storage-document-handler.js.map +0 -1
  82. package/dist/index.js.map +0 -1
  83. package/dist/jobs.capability.js.map +0 -1
  84. package/dist/jobs.feature.js.map +0 -1
  85. package/dist/queue/gcp-cloud-tasks.js.map +0 -1
  86. package/dist/queue/gcp-pubsub.js.map +0 -1
  87. package/dist/queue/index.js.map +0 -1
  88. package/dist/queue/memory-queue.js.map +0 -1
  89. package/dist/queue/register-defined-job.js.map +0 -1
  90. package/dist/queue/scaleway-sqs-queue.js.map +0 -1
  91. package/dist/queue/types.js.map +0 -1
  92. package/dist/scheduler/index.js.map +0 -1
package/dist/events.d.ts CHANGED
@@ -1,388 +1,382 @@
1
- import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
2
- import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
3
-
4
- //#region src/events.d.ts
5
1
  /**
6
2
  * Emitted when a job is enqueued.
7
3
  */
8
- declare const JobEnqueuedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
9
- jobId: {
10
- type: _contractspec_lib_schema0.FieldType<string, string>;
11
- isOptional: false;
12
- };
13
- type: {
14
- type: _contractspec_lib_schema0.FieldType<string, string>;
15
- isOptional: false;
16
- };
17
- priority: {
18
- type: _contractspec_lib_schema0.FieldType<number, number>;
19
- isOptional: false;
20
- };
21
- scheduledAt: {
22
- type: _contractspec_lib_schema0.FieldType<Date, string>;
23
- isOptional: true;
24
- };
25
- tenantId: {
26
- type: _contractspec_lib_schema0.FieldType<string, string>;
27
- isOptional: true;
28
- };
29
- enqueuedAt: {
30
- type: _contractspec_lib_schema0.FieldType<Date, string>;
31
- isOptional: false;
32
- };
33
- }>>;
34
- /**
35
- * Emitted when a job starts processing.
36
- */
37
- declare const JobStartedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
38
- jobId: {
39
- type: _contractspec_lib_schema0.FieldType<string, string>;
40
- isOptional: false;
41
- };
42
- type: {
43
- type: _contractspec_lib_schema0.FieldType<string, string>;
44
- isOptional: false;
45
- };
46
- attempt: {
47
- type: _contractspec_lib_schema0.FieldType<number, number>;
48
- isOptional: false;
49
- };
50
- startedAt: {
51
- type: _contractspec_lib_schema0.FieldType<Date, string>;
52
- isOptional: false;
53
- };
54
- }>>;
55
- /**
56
- * Emitted when a job completes successfully.
57
- */
58
- declare const JobCompletedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
59
- jobId: {
60
- type: _contractspec_lib_schema0.FieldType<string, string>;
61
- isOptional: false;
62
- };
63
- type: {
64
- type: _contractspec_lib_schema0.FieldType<string, string>;
65
- isOptional: false;
66
- };
67
- attempt: {
68
- type: _contractspec_lib_schema0.FieldType<number, number>;
69
- isOptional: false;
70
- };
71
- durationMs: {
72
- type: _contractspec_lib_schema0.FieldType<number, number>;
73
- isOptional: false;
74
- };
75
- completedAt: {
76
- type: _contractspec_lib_schema0.FieldType<Date, string>;
77
- isOptional: false;
78
- };
79
- }>>;
80
- /**
81
- * Emitted when a job fails (single attempt).
82
- */
83
- declare const JobFailedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
84
- jobId: {
85
- type: _contractspec_lib_schema0.FieldType<string, string>;
86
- isOptional: false;
87
- };
88
- type: {
89
- type: _contractspec_lib_schema0.FieldType<string, string>;
90
- isOptional: false;
91
- };
92
- attempt: {
93
- type: _contractspec_lib_schema0.FieldType<number, number>;
94
- isOptional: false;
95
- };
96
- error: {
97
- type: _contractspec_lib_schema0.FieldType<string, string>;
98
- isOptional: false;
99
- };
100
- willRetry: {
101
- type: _contractspec_lib_schema0.FieldType<boolean, boolean>;
102
- isOptional: false;
103
- };
104
- failedAt: {
105
- type: _contractspec_lib_schema0.FieldType<Date, string>;
106
- isOptional: false;
107
- };
108
- }>>;
109
- /**
110
- * Emitted when a job is being retried.
111
- */
112
- declare const JobRetryingEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
113
- jobId: {
114
- type: _contractspec_lib_schema0.FieldType<string, string>;
115
- isOptional: false;
116
- };
117
- type: {
118
- type: _contractspec_lib_schema0.FieldType<string, string>;
119
- isOptional: false;
120
- };
121
- attempt: {
122
- type: _contractspec_lib_schema0.FieldType<number, number>;
123
- isOptional: false;
124
- };
125
- nextAttemptAt: {
126
- type: _contractspec_lib_schema0.FieldType<Date, string>;
127
- isOptional: false;
128
- };
129
- backoffMs: {
130
- type: _contractspec_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: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
138
- jobId: {
139
- type: _contractspec_lib_schema0.FieldType<string, string>;
140
- isOptional: false;
141
- };
142
- type: {
143
- type: _contractspec_lib_schema0.FieldType<string, string>;
144
- isOptional: false;
145
- };
146
- attempts: {
147
- type: _contractspec_lib_schema0.FieldType<number, number>;
148
- isOptional: false;
149
- };
150
- lastError: {
151
- type: _contractspec_lib_schema0.FieldType<string, string>;
152
- isOptional: false;
153
- };
154
- deadLetteredAt: {
155
- type: _contractspec_lib_schema0.FieldType<Date, string>;
156
- isOptional: false;
157
- };
158
- }>>;
159
- /**
160
- * Emitted when a job is cancelled.
161
- */
162
- declare const JobCancelledEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
163
- jobId: {
164
- type: _contractspec_lib_schema0.FieldType<string, string>;
165
- isOptional: false;
166
- };
167
- type: {
168
- type: _contractspec_lib_schema0.FieldType<string, string>;
169
- isOptional: false;
170
- };
171
- cancelledBy: {
172
- type: _contractspec_lib_schema0.FieldType<string, string>;
173
- isOptional: true;
174
- };
175
- cancelledAt: {
176
- type: _contractspec_lib_schema0.FieldType<Date, string>;
177
- isOptional: false;
178
- };
179
- }>>;
180
- /**
181
- * Emitted when a scheduled job is triggered.
182
- */
183
- declare const ScheduledJobTriggeredEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
184
- scheduleName: {
185
- type: _contractspec_lib_schema0.FieldType<string, string>;
186
- isOptional: false;
187
- };
188
- jobId: {
189
- type: _contractspec_lib_schema0.FieldType<string, string>;
190
- isOptional: false;
191
- };
192
- jobType: {
193
- type: _contractspec_lib_schema0.FieldType<string, string>;
194
- isOptional: false;
195
- };
196
- triggeredAt: {
197
- type: _contractspec_lib_schema0.FieldType<Date, string>;
198
- isOptional: false;
199
- };
200
- nextRunAt: {
201
- type: _contractspec_lib_schema0.FieldType<Date, string>;
202
- isOptional: true;
203
- };
204
- }>>;
205
- /**
206
- * All job events.
207
- */
208
- declare const JobEvents: {
209
- JobEnqueuedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
4
+ export declare const JobEnqueuedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
210
5
  jobId: {
211
- type: _contractspec_lib_schema0.FieldType<string, string>;
212
- isOptional: false;
6
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
7
+ isOptional: false;
213
8
  };
214
9
  type: {
215
- type: _contractspec_lib_schema0.FieldType<string, string>;
216
- isOptional: false;
10
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
11
+ isOptional: false;
217
12
  };
218
13
  priority: {
219
- type: _contractspec_lib_schema0.FieldType<number, number>;
220
- isOptional: false;
14
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
15
+ isOptional: false;
221
16
  };
222
17
  scheduledAt: {
223
- type: _contractspec_lib_schema0.FieldType<Date, string>;
224
- isOptional: true;
18
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
19
+ isOptional: true;
225
20
  };
226
21
  tenantId: {
227
- type: _contractspec_lib_schema0.FieldType<string, string>;
228
- isOptional: true;
22
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
23
+ isOptional: true;
229
24
  };
230
25
  enqueuedAt: {
231
- type: _contractspec_lib_schema0.FieldType<Date, string>;
232
- isOptional: false;
26
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
27
+ isOptional: false;
233
28
  };
234
- }>>;
235
- JobStartedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
29
+ }>>;
30
+ /**
31
+ * Emitted when a job starts processing.
32
+ */
33
+ export declare const JobStartedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
236
34
  jobId: {
237
- type: _contractspec_lib_schema0.FieldType<string, string>;
238
- isOptional: false;
35
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
36
+ isOptional: false;
239
37
  };
240
38
  type: {
241
- type: _contractspec_lib_schema0.FieldType<string, string>;
242
- isOptional: false;
39
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
40
+ isOptional: false;
243
41
  };
244
42
  attempt: {
245
- type: _contractspec_lib_schema0.FieldType<number, number>;
246
- isOptional: false;
43
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
44
+ isOptional: false;
247
45
  };
248
46
  startedAt: {
249
- type: _contractspec_lib_schema0.FieldType<Date, string>;
250
- isOptional: false;
47
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
48
+ isOptional: false;
251
49
  };
252
- }>>;
253
- JobCompletedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
50
+ }>>;
51
+ /**
52
+ * Emitted when a job completes successfully.
53
+ */
54
+ export declare const JobCompletedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
254
55
  jobId: {
255
- type: _contractspec_lib_schema0.FieldType<string, string>;
256
- isOptional: false;
56
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
57
+ isOptional: false;
257
58
  };
258
59
  type: {
259
- type: _contractspec_lib_schema0.FieldType<string, string>;
260
- isOptional: false;
60
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
61
+ isOptional: false;
261
62
  };
262
63
  attempt: {
263
- type: _contractspec_lib_schema0.FieldType<number, number>;
264
- isOptional: false;
64
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
65
+ isOptional: false;
265
66
  };
266
67
  durationMs: {
267
- type: _contractspec_lib_schema0.FieldType<number, number>;
268
- isOptional: false;
68
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
69
+ isOptional: false;
269
70
  };
270
71
  completedAt: {
271
- type: _contractspec_lib_schema0.FieldType<Date, string>;
272
- isOptional: false;
72
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
73
+ isOptional: false;
273
74
  };
274
- }>>;
275
- JobFailedEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
75
+ }>>;
76
+ /**
77
+ * Emitted when a job fails (single attempt).
78
+ */
79
+ export declare const JobFailedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
276
80
  jobId: {
277
- type: _contractspec_lib_schema0.FieldType<string, string>;
278
- isOptional: false;
81
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
82
+ isOptional: false;
279
83
  };
280
84
  type: {
281
- type: _contractspec_lib_schema0.FieldType<string, string>;
282
- isOptional: false;
85
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
86
+ isOptional: false;
283
87
  };
284
88
  attempt: {
285
- type: _contractspec_lib_schema0.FieldType<number, number>;
286
- isOptional: false;
89
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
90
+ isOptional: false;
287
91
  };
288
92
  error: {
289
- type: _contractspec_lib_schema0.FieldType<string, string>;
290
- isOptional: false;
93
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
94
+ isOptional: false;
291
95
  };
292
96
  willRetry: {
293
- type: _contractspec_lib_schema0.FieldType<boolean, boolean>;
294
- isOptional: false;
97
+ type: import("@contractspec/lib.schema").FieldType<boolean, boolean>;
98
+ isOptional: false;
295
99
  };
296
100
  failedAt: {
297
- type: _contractspec_lib_schema0.FieldType<Date, string>;
298
- isOptional: false;
101
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
102
+ isOptional: false;
299
103
  };
300
- }>>;
301
- JobRetryingEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
104
+ }>>;
105
+ /**
106
+ * Emitted when a job is being retried.
107
+ */
108
+ export declare const JobRetryingEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
302
109
  jobId: {
303
- type: _contractspec_lib_schema0.FieldType<string, string>;
304
- isOptional: false;
110
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
111
+ isOptional: false;
305
112
  };
306
113
  type: {
307
- type: _contractspec_lib_schema0.FieldType<string, string>;
308
- isOptional: false;
114
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
115
+ isOptional: false;
309
116
  };
310
117
  attempt: {
311
- type: _contractspec_lib_schema0.FieldType<number, number>;
312
- isOptional: false;
118
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
119
+ isOptional: false;
313
120
  };
314
121
  nextAttemptAt: {
315
- type: _contractspec_lib_schema0.FieldType<Date, string>;
316
- isOptional: false;
122
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
123
+ isOptional: false;
317
124
  };
318
125
  backoffMs: {
319
- type: _contractspec_lib_schema0.FieldType<number, number>;
320
- isOptional: false;
126
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
127
+ isOptional: false;
321
128
  };
322
- }>>;
323
- JobDeadLetteredEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
129
+ }>>;
130
+ /**
131
+ * Emitted when a job is moved to dead letter queue.
132
+ */
133
+ export declare const JobDeadLetteredEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
324
134
  jobId: {
325
- type: _contractspec_lib_schema0.FieldType<string, string>;
326
- isOptional: false;
135
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
136
+ isOptional: false;
327
137
  };
328
138
  type: {
329
- type: _contractspec_lib_schema0.FieldType<string, string>;
330
- isOptional: false;
139
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
140
+ isOptional: false;
331
141
  };
332
142
  attempts: {
333
- type: _contractspec_lib_schema0.FieldType<number, number>;
334
- isOptional: false;
143
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
144
+ isOptional: false;
335
145
  };
336
146
  lastError: {
337
- type: _contractspec_lib_schema0.FieldType<string, string>;
338
- isOptional: false;
147
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
148
+ isOptional: false;
339
149
  };
340
150
  deadLetteredAt: {
341
- type: _contractspec_lib_schema0.FieldType<Date, string>;
342
- isOptional: false;
151
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
152
+ isOptional: false;
343
153
  };
344
- }>>;
345
- JobCancelledEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
154
+ }>>;
155
+ /**
156
+ * Emitted when a job is cancelled.
157
+ */
158
+ export declare const JobCancelledEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
346
159
  jobId: {
347
- type: _contractspec_lib_schema0.FieldType<string, string>;
348
- isOptional: false;
160
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
161
+ isOptional: false;
349
162
  };
350
163
  type: {
351
- type: _contractspec_lib_schema0.FieldType<string, string>;
352
- isOptional: false;
164
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
165
+ isOptional: false;
353
166
  };
354
167
  cancelledBy: {
355
- type: _contractspec_lib_schema0.FieldType<string, string>;
356
- isOptional: true;
168
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
169
+ isOptional: true;
357
170
  };
358
171
  cancelledAt: {
359
- type: _contractspec_lib_schema0.FieldType<Date, string>;
360
- isOptional: false;
172
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
173
+ isOptional: false;
361
174
  };
362
- }>>;
363
- ScheduledJobTriggeredEvent: _contractspec_lib_contracts0.EventSpec<_contractspec_lib_schema0.SchemaModel<{
175
+ }>>;
176
+ /**
177
+ * Emitted when a scheduled job is triggered.
178
+ */
179
+ export declare const ScheduledJobTriggeredEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
364
180
  scheduleName: {
365
- type: _contractspec_lib_schema0.FieldType<string, string>;
366
- isOptional: false;
181
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
182
+ isOptional: false;
367
183
  };
368
184
  jobId: {
369
- type: _contractspec_lib_schema0.FieldType<string, string>;
370
- isOptional: false;
185
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
186
+ isOptional: false;
371
187
  };
372
188
  jobType: {
373
- type: _contractspec_lib_schema0.FieldType<string, string>;
374
- isOptional: false;
189
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
190
+ isOptional: false;
375
191
  };
376
192
  triggeredAt: {
377
- type: _contractspec_lib_schema0.FieldType<Date, string>;
378
- isOptional: false;
193
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
194
+ isOptional: false;
379
195
  };
380
196
  nextRunAt: {
381
- type: _contractspec_lib_schema0.FieldType<Date, string>;
382
- isOptional: true;
197
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
198
+ isOptional: true;
383
199
  };
384
- }>>;
200
+ }>>;
201
+ /**
202
+ * All job events.
203
+ */
204
+ export declare const JobEvents: {
205
+ JobEnqueuedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
206
+ jobId: {
207
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
208
+ isOptional: false;
209
+ };
210
+ type: {
211
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
212
+ isOptional: false;
213
+ };
214
+ priority: {
215
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
216
+ isOptional: false;
217
+ };
218
+ scheduledAt: {
219
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
220
+ isOptional: true;
221
+ };
222
+ tenantId: {
223
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
224
+ isOptional: true;
225
+ };
226
+ enqueuedAt: {
227
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
228
+ isOptional: false;
229
+ };
230
+ }>>;
231
+ JobStartedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
232
+ jobId: {
233
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
234
+ isOptional: false;
235
+ };
236
+ type: {
237
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
238
+ isOptional: false;
239
+ };
240
+ attempt: {
241
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
242
+ isOptional: false;
243
+ };
244
+ startedAt: {
245
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
246
+ isOptional: false;
247
+ };
248
+ }>>;
249
+ JobCompletedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
250
+ jobId: {
251
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
252
+ isOptional: false;
253
+ };
254
+ type: {
255
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
256
+ isOptional: false;
257
+ };
258
+ attempt: {
259
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
260
+ isOptional: false;
261
+ };
262
+ durationMs: {
263
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
264
+ isOptional: false;
265
+ };
266
+ completedAt: {
267
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
268
+ isOptional: false;
269
+ };
270
+ }>>;
271
+ JobFailedEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
272
+ jobId: {
273
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
274
+ isOptional: false;
275
+ };
276
+ type: {
277
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
278
+ isOptional: false;
279
+ };
280
+ attempt: {
281
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
282
+ isOptional: false;
283
+ };
284
+ error: {
285
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
286
+ isOptional: false;
287
+ };
288
+ willRetry: {
289
+ type: import("@contractspec/lib.schema").FieldType<boolean, boolean>;
290
+ isOptional: false;
291
+ };
292
+ failedAt: {
293
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
294
+ isOptional: false;
295
+ };
296
+ }>>;
297
+ JobRetryingEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
298
+ jobId: {
299
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
300
+ isOptional: false;
301
+ };
302
+ type: {
303
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
304
+ isOptional: false;
305
+ };
306
+ attempt: {
307
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
308
+ isOptional: false;
309
+ };
310
+ nextAttemptAt: {
311
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
312
+ isOptional: false;
313
+ };
314
+ backoffMs: {
315
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
316
+ isOptional: false;
317
+ };
318
+ }>>;
319
+ JobDeadLetteredEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
320
+ jobId: {
321
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
322
+ isOptional: false;
323
+ };
324
+ type: {
325
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
326
+ isOptional: false;
327
+ };
328
+ attempts: {
329
+ type: import("@contractspec/lib.schema").FieldType<number, number>;
330
+ isOptional: false;
331
+ };
332
+ lastError: {
333
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
334
+ isOptional: false;
335
+ };
336
+ deadLetteredAt: {
337
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
338
+ isOptional: false;
339
+ };
340
+ }>>;
341
+ JobCancelledEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
342
+ jobId: {
343
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
344
+ isOptional: false;
345
+ };
346
+ type: {
347
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
348
+ isOptional: false;
349
+ };
350
+ cancelledBy: {
351
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
352
+ isOptional: true;
353
+ };
354
+ cancelledAt: {
355
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
356
+ isOptional: false;
357
+ };
358
+ }>>;
359
+ ScheduledJobTriggeredEvent: import("@contractspec/lib.contracts").EventSpec<import("@contractspec/lib.schema").SchemaModel<{
360
+ scheduleName: {
361
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
362
+ isOptional: false;
363
+ };
364
+ jobId: {
365
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
366
+ isOptional: false;
367
+ };
368
+ jobType: {
369
+ type: import("@contractspec/lib.schema").FieldType<string, string>;
370
+ isOptional: false;
371
+ };
372
+ triggeredAt: {
373
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
374
+ isOptional: false;
375
+ };
376
+ nextRunAt: {
377
+ type: import("@contractspec/lib.schema").FieldType<Date, string>;
378
+ isOptional: true;
379
+ };
380
+ }>>;
385
381
  };
386
- //#endregion
387
- export { JobCancelledEvent, JobCompletedEvent, JobDeadLetteredEvent, JobEnqueuedEvent, JobEvents, JobFailedEvent, JobRetryingEvent, JobStartedEvent, ScheduledJobTriggeredEvent };
388
382
  //# sourceMappingURL=events.d.ts.map