@trigger.dev/core 2.2.4 → 2.2.5
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/index.d.ts +5979 -360
- package/dist/index.js +665 -447
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -46,11 +46,13 @@ __export(src_exports, {
|
|
|
46
46
|
API_VERSIONS: () => API_VERSIONS,
|
|
47
47
|
ApiEventLogSchema: () => ApiEventLogSchema,
|
|
48
48
|
AutoYieldConfigSchema: () => AutoYieldConfigSchema,
|
|
49
|
+
AutoYieldMetadataSchema: () => AutoYieldMetadataSchema,
|
|
49
50
|
CachedTaskSchema: () => CachedTaskSchema,
|
|
50
51
|
CancelRunsForEventSchema: () => CancelRunsForEventSchema,
|
|
51
52
|
CommonMissingConnectionNotificationPayloadSchema: () => CommonMissingConnectionNotificationPayloadSchema,
|
|
52
53
|
CommonMissingConnectionNotificationResolvedPayloadSchema: () => CommonMissingConnectionNotificationResolvedPayloadSchema,
|
|
53
54
|
CompleteTaskBodyInputSchema: () => CompleteTaskBodyInputSchema,
|
|
55
|
+
CompleteTaskBodyV2InputSchema: () => CompleteTaskBodyV2InputSchema,
|
|
54
56
|
ConnectionAuthSchema: () => ConnectionAuthSchema,
|
|
55
57
|
CreateExternalConnectionBodySchema: () => CreateExternalConnectionBodySchema,
|
|
56
58
|
CreateRunResponseBodySchema: () => CreateRunResponseBodySchema,
|
|
@@ -76,14 +78,16 @@ __export(src_exports, {
|
|
|
76
78
|
FetchRetryHeadersStrategySchema: () => FetchRetryHeadersStrategySchema,
|
|
77
79
|
FetchRetryOptionsSchema: () => FetchRetryOptionsSchema,
|
|
78
80
|
FetchRetryStrategySchema: () => FetchRetryStrategySchema,
|
|
81
|
+
FetchTimeoutOptionsSchema: () => FetchTimeoutOptionsSchema,
|
|
79
82
|
GetEndpointIndexResponseSchema: () => GetEndpointIndexResponseSchema,
|
|
80
83
|
GetEventSchema: () => GetEventSchema,
|
|
81
84
|
GetRunSchema: () => GetRunSchema,
|
|
82
85
|
GetRunStatusesSchema: () => GetRunStatusesSchema,
|
|
83
86
|
GetRunsSchema: () => GetRunsSchema,
|
|
87
|
+
HTTPMethodUnionSchema: () => HTTPMethodUnionSchema,
|
|
84
88
|
HandleTriggerSourceSchema: () => HandleTriggerSourceSchema,
|
|
89
|
+
HttpEndpointRequestHeadersSchema: () => HttpEndpointRequestHeadersSchema,
|
|
85
90
|
HttpSourceRequestHeadersSchema: () => HttpSourceRequestHeadersSchema,
|
|
86
|
-
HttpSourceRequestSchema: () => HttpSourceRequestSchema,
|
|
87
91
|
HttpSourceResponseSchema: () => HttpSourceResponseSchema,
|
|
88
92
|
IndexEndpointResponseSchema: () => IndexEndpointResponseSchema,
|
|
89
93
|
InitializeCronScheduleBodySchema: () => InitializeCronScheduleBodySchema,
|
|
@@ -92,6 +96,10 @@ __export(src_exports, {
|
|
|
92
96
|
IntegrationMetadataSchema: () => IntegrationMetadataSchema,
|
|
93
97
|
IntervalMetadataSchema: () => IntervalMetadataSchema,
|
|
94
98
|
IntervalOptionsSchema: () => IntervalOptionsSchema,
|
|
99
|
+
InvokeJobRequestBodySchema: () => InvokeJobRequestBodySchema,
|
|
100
|
+
InvokeJobResponseSchema: () => InvokeJobResponseSchema,
|
|
101
|
+
InvokeOptionsSchema: () => InvokeOptionsSchema,
|
|
102
|
+
InvokeTriggerMetadataSchema: () => InvokeTriggerMetadataSchema,
|
|
95
103
|
JobMetadataSchema: () => JobMetadataSchema,
|
|
96
104
|
JobRunStatusRecordSchema: () => JobRunStatusRecordSchema,
|
|
97
105
|
LogMessageSchema: () => LogMessageSchema,
|
|
@@ -131,14 +139,18 @@ __export(src_exports, {
|
|
|
131
139
|
RegisterTriggerBodySchemaV1: () => RegisterTriggerBodySchemaV1,
|
|
132
140
|
RegisterTriggerBodySchemaV2: () => RegisterTriggerBodySchemaV2,
|
|
133
141
|
RegisterTriggerSourceSchema: () => RegisterTriggerSourceSchema,
|
|
142
|
+
RequestFilterSchema: () => RequestFilterSchema,
|
|
143
|
+
RequestWithRawBodySchema: () => RequestWithRawBodySchema,
|
|
134
144
|
RetryOptionsSchema: () => RetryOptionsSchema,
|
|
135
145
|
RunJobAutoYieldExecutionErrorSchema: () => RunJobAutoYieldExecutionErrorSchema,
|
|
136
146
|
RunJobAutoYieldWithCompletedTaskExecutionErrorSchema: () => RunJobAutoYieldWithCompletedTaskExecutionErrorSchema,
|
|
137
147
|
RunJobBodySchema: () => RunJobBodySchema,
|
|
138
148
|
RunJobCanceledWithTaskSchema: () => RunJobCanceledWithTaskSchema,
|
|
149
|
+
RunJobErrorResponseSchema: () => RunJobErrorResponseSchema,
|
|
139
150
|
RunJobErrorSchema: () => RunJobErrorSchema,
|
|
140
151
|
RunJobInvalidPayloadErrorSchema: () => RunJobInvalidPayloadErrorSchema,
|
|
141
152
|
RunJobResponseSchema: () => RunJobResponseSchema,
|
|
153
|
+
RunJobResumeWithParallelTaskSchema: () => RunJobResumeWithParallelTaskSchema,
|
|
142
154
|
RunJobResumeWithTaskSchema: () => RunJobResumeWithTaskSchema,
|
|
143
155
|
RunJobRetryWithTaskSchema: () => RunJobRetryWithTaskSchema,
|
|
144
156
|
RunJobSuccessSchema: () => RunJobSuccessSchema,
|
|
@@ -169,6 +181,7 @@ __export(src_exports, {
|
|
|
169
181
|
StyleSchema: () => StyleSchema,
|
|
170
182
|
TaskSchema: () => TaskSchema,
|
|
171
183
|
TaskStatusSchema: () => TaskStatusSchema,
|
|
184
|
+
TriggerHelpSchema: () => TriggerHelpSchema,
|
|
172
185
|
TriggerMetadataSchema: () => TriggerMetadataSchema,
|
|
173
186
|
TriggerSourceSchema: () => TriggerSourceSchema,
|
|
174
187
|
UpdateTriggerSourceBodyV1Schema: () => UpdateTriggerSourceBodyV1Schema,
|
|
@@ -185,6 +198,8 @@ __export(src_exports, {
|
|
|
185
198
|
eventFilterMatches: () => eventFilterMatches,
|
|
186
199
|
parseEndpointIndexStats: () => parseEndpointIndexStats,
|
|
187
200
|
replacements: () => replacements,
|
|
201
|
+
requestFilterMatches: () => requestFilterMatches,
|
|
202
|
+
stringPatternMatchers: () => stringPatternMatchers,
|
|
188
203
|
supportsFeature: () => supportsFeature,
|
|
189
204
|
urlWithSearchParams: () => urlWithSearchParams
|
|
190
205
|
});
|
|
@@ -222,27 +237,27 @@ var _Logger = class _Logger {
|
|
|
222
237
|
log(message, ...args) {
|
|
223
238
|
if (__privateGet(this, _level) < 0)
|
|
224
239
|
return;
|
|
225
|
-
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.log, message, ...args);
|
|
240
|
+
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.log, message, "log", ...args);
|
|
226
241
|
}
|
|
227
242
|
error(message, ...args) {
|
|
228
243
|
if (__privateGet(this, _level) < 1)
|
|
229
244
|
return;
|
|
230
|
-
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.error, message, ...args);
|
|
245
|
+
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.error, message, "error", ...args);
|
|
231
246
|
}
|
|
232
247
|
warn(message, ...args) {
|
|
233
248
|
if (__privateGet(this, _level) < 2)
|
|
234
249
|
return;
|
|
235
|
-
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.warn, message, ...args);
|
|
250
|
+
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.warn, message, "warn", ...args);
|
|
236
251
|
}
|
|
237
252
|
info(message, ...args) {
|
|
238
253
|
if (__privateGet(this, _level) < 3)
|
|
239
254
|
return;
|
|
240
|
-
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.info, message, ...args);
|
|
255
|
+
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.info, message, "info", ...args);
|
|
241
256
|
}
|
|
242
257
|
debug(message, ...args) {
|
|
243
258
|
if (__privateGet(this, _level) < 4)
|
|
244
259
|
return;
|
|
245
|
-
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.debug, message, ...args);
|
|
260
|
+
__privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.debug, message, "debug", ...args);
|
|
246
261
|
}
|
|
247
262
|
};
|
|
248
263
|
_name = new WeakMap();
|
|
@@ -250,12 +265,13 @@ _level = new WeakMap();
|
|
|
250
265
|
_filteredKeys = new WeakMap();
|
|
251
266
|
_jsonReplacer = new WeakMap();
|
|
252
267
|
_structuredLog = new WeakSet();
|
|
253
|
-
structuredLog_fn = /* @__PURE__ */ __name(function(loggerFunction, message, ...args) {
|
|
268
|
+
structuredLog_fn = /* @__PURE__ */ __name(function(loggerFunction, message, level, ...args) {
|
|
254
269
|
const structuredLog = {
|
|
255
270
|
...structureArgs(safeJsonClone(args), __privateGet(this, _filteredKeys)),
|
|
256
271
|
timestamp: /* @__PURE__ */ new Date(),
|
|
257
272
|
name: __privateGet(this, _name),
|
|
258
|
-
message
|
|
273
|
+
message,
|
|
274
|
+
level
|
|
259
275
|
};
|
|
260
276
|
loggerFunction(JSON.stringify(structuredLog, createReplacer(__privateGet(this, _jsonReplacer))));
|
|
261
277
|
}, "#structuredLog");
|
|
@@ -324,7 +340,7 @@ function prettyPrintBytes(value) {
|
|
|
324
340
|
if (process.env.NODE_ENV === "production") {
|
|
325
341
|
return "skipped size";
|
|
326
342
|
}
|
|
327
|
-
const sizeInBytes =
|
|
343
|
+
const sizeInBytes = getSizeInBytes(value);
|
|
328
344
|
if (sizeInBytes < 1024) {
|
|
329
345
|
return `${sizeInBytes} bytes`;
|
|
330
346
|
}
|
|
@@ -337,10 +353,19 @@ function prettyPrintBytes(value) {
|
|
|
337
353
|
return `${(sizeInBytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
338
354
|
}
|
|
339
355
|
__name(prettyPrintBytes, "prettyPrintBytes");
|
|
356
|
+
function getSizeInBytes(value) {
|
|
357
|
+
const jsonString = JSON.stringify(value);
|
|
358
|
+
if (typeof window === "undefined") {
|
|
359
|
+
return Buffer.byteLength(jsonString, "utf8");
|
|
360
|
+
} else {
|
|
361
|
+
return new TextEncoder().encode(jsonString).length;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
__name(getSizeInBytes, "getSizeInBytes");
|
|
340
365
|
|
|
341
366
|
// src/schemas/api.ts
|
|
342
367
|
var import_ulid = require("ulid");
|
|
343
|
-
var
|
|
368
|
+
var import_zod12 = require("zod");
|
|
344
369
|
|
|
345
370
|
// src/schemas/addMissingVersionField.ts
|
|
346
371
|
function addMissingVersionField(val) {
|
|
@@ -368,6 +393,17 @@ var SchemaErrorSchema = import_zod.z.object({
|
|
|
368
393
|
|
|
369
394
|
// src/schemas/eventFilter.ts
|
|
370
395
|
var import_zod2 = require("zod");
|
|
396
|
+
var stringPatternMatchers = [
|
|
397
|
+
import_zod2.z.object({
|
|
398
|
+
$endsWith: import_zod2.z.string()
|
|
399
|
+
}),
|
|
400
|
+
import_zod2.z.object({
|
|
401
|
+
$startsWith: import_zod2.z.string()
|
|
402
|
+
}),
|
|
403
|
+
import_zod2.z.object({
|
|
404
|
+
$ignoreCaseEquals: import_zod2.z.string()
|
|
405
|
+
})
|
|
406
|
+
];
|
|
371
407
|
var EventMatcherSchema = import_zod2.z.union([
|
|
372
408
|
/** Match against a string */
|
|
373
409
|
import_zod2.z.array(import_zod2.z.string()),
|
|
@@ -376,12 +412,7 @@ var EventMatcherSchema = import_zod2.z.union([
|
|
|
376
412
|
/** Match against a boolean */
|
|
377
413
|
import_zod2.z.array(import_zod2.z.boolean()),
|
|
378
414
|
import_zod2.z.array(import_zod2.z.union([
|
|
379
|
-
|
|
380
|
-
$endsWith: import_zod2.z.string()
|
|
381
|
-
}),
|
|
382
|
-
import_zod2.z.object({
|
|
383
|
-
$startsWith: import_zod2.z.string()
|
|
384
|
-
}),
|
|
415
|
+
...stringPatternMatchers,
|
|
385
416
|
import_zod2.z.object({
|
|
386
417
|
$exists: import_zod2.z.boolean()
|
|
387
418
|
}),
|
|
@@ -426,9 +457,6 @@ var EventMatcherSchema = import_zod2.z.union([
|
|
|
426
457
|
import_zod2.z.number(),
|
|
427
458
|
import_zod2.z.boolean()
|
|
428
459
|
])
|
|
429
|
-
}),
|
|
430
|
-
import_zod2.z.object({
|
|
431
|
-
$ignoreCaseEquals: import_zod2.z.string()
|
|
432
460
|
})
|
|
433
461
|
]))
|
|
434
462
|
]);
|
|
@@ -592,7 +620,11 @@ var TaskSchema = import_zod7.z.object({
|
|
|
592
620
|
parentId: import_zod7.z.string().optional().nullable(),
|
|
593
621
|
style: StyleSchema.optional().nullable(),
|
|
594
622
|
operation: import_zod7.z.string().optional().nullable(),
|
|
595
|
-
callbackUrl: import_zod7.z.string().optional().nullable()
|
|
623
|
+
callbackUrl: import_zod7.z.string().optional().nullable(),
|
|
624
|
+
childExecutionMode: import_zod7.z.enum([
|
|
625
|
+
"SEQUENTIAL",
|
|
626
|
+
"PARALLEL"
|
|
627
|
+
]).optional().nullable()
|
|
596
628
|
});
|
|
597
629
|
var ServerTaskSchema = TaskSchema.extend({
|
|
598
630
|
idempotencyKey: import_zod7.z.string(),
|
|
@@ -630,6 +662,12 @@ var DynamicTriggerMetadataSchema = import_zod8.z.object({
|
|
|
630
662
|
type: import_zod8.z.literal("dynamic"),
|
|
631
663
|
id: import_zod8.z.string()
|
|
632
664
|
});
|
|
665
|
+
var TriggerHelpSchema = import_zod8.z.object({
|
|
666
|
+
noRuns: import_zod8.z.object({
|
|
667
|
+
text: import_zod8.z.string(),
|
|
668
|
+
link: import_zod8.z.string().optional()
|
|
669
|
+
}).optional()
|
|
670
|
+
});
|
|
633
671
|
var StaticTriggerMetadataSchema = import_zod8.z.object({
|
|
634
672
|
type: import_zod8.z.literal("static"),
|
|
635
673
|
title: import_zod8.z.union([
|
|
@@ -637,7 +675,12 @@ var StaticTriggerMetadataSchema = import_zod8.z.object({
|
|
|
637
675
|
import_zod8.z.array(import_zod8.z.string())
|
|
638
676
|
]),
|
|
639
677
|
properties: import_zod8.z.array(DisplayPropertySchema).optional(),
|
|
640
|
-
rule: EventRuleSchema
|
|
678
|
+
rule: EventRuleSchema,
|
|
679
|
+
link: import_zod8.z.string().optional(),
|
|
680
|
+
help: TriggerHelpSchema.optional()
|
|
681
|
+
});
|
|
682
|
+
var InvokeTriggerMetadataSchema = import_zod8.z.object({
|
|
683
|
+
type: import_zod8.z.literal("invoke")
|
|
641
684
|
});
|
|
642
685
|
var ScheduledTriggerMetadataSchema = import_zod8.z.object({
|
|
643
686
|
type: import_zod8.z.literal("scheduled"),
|
|
@@ -646,7 +689,8 @@ var ScheduledTriggerMetadataSchema = import_zod8.z.object({
|
|
|
646
689
|
var TriggerMetadataSchema = import_zod8.z.discriminatedUnion("type", [
|
|
647
690
|
DynamicTriggerMetadataSchema,
|
|
648
691
|
StaticTriggerMetadataSchema,
|
|
649
|
-
ScheduledTriggerMetadataSchema
|
|
692
|
+
ScheduledTriggerMetadataSchema,
|
|
693
|
+
InvokeTriggerMetadataSchema
|
|
650
694
|
]);
|
|
651
695
|
|
|
652
696
|
// src/schemas/runs.ts
|
|
@@ -757,225 +801,289 @@ var GetRunsSchema = import_zod10.z.object({
|
|
|
757
801
|
nextCursor: import_zod10.z.string().optional()
|
|
758
802
|
});
|
|
759
803
|
|
|
804
|
+
// src/schemas/requestFilter.ts
|
|
805
|
+
var import_zod11 = require("zod");
|
|
806
|
+
var StringMatchSchema = import_zod11.z.union([
|
|
807
|
+
/** Match against a string */
|
|
808
|
+
import_zod11.z.array(import_zod11.z.string()),
|
|
809
|
+
import_zod11.z.array(import_zod11.z.union(stringPatternMatchers))
|
|
810
|
+
]);
|
|
811
|
+
var HTTPMethodUnionSchema = import_zod11.z.union([
|
|
812
|
+
import_zod11.z.literal("GET"),
|
|
813
|
+
import_zod11.z.literal("POST"),
|
|
814
|
+
import_zod11.z.literal("PUT"),
|
|
815
|
+
import_zod11.z.literal("PATCH"),
|
|
816
|
+
import_zod11.z.literal("DELETE"),
|
|
817
|
+
import_zod11.z.literal("HEAD"),
|
|
818
|
+
import_zod11.z.literal("OPTIONS")
|
|
819
|
+
]);
|
|
820
|
+
var RequestFilterSchema = import_zod11.z.object({
|
|
821
|
+
/** An array of HTTP methods to match.
|
|
822
|
+
* For example, `["GET", "POST"]` will match both `GET` and `POST` Requests. */
|
|
823
|
+
method: import_zod11.z.array(HTTPMethodUnionSchema).optional(),
|
|
824
|
+
/** An object of header key/values to match.
|
|
825
|
+
* This uses the [EventFilter matching syntax](https://trigger.dev/docs/documentation/guides/event-filter).
|
|
826
|
+
|
|
827
|
+
@example
|
|
828
|
+
```ts
|
|
829
|
+
filter: {
|
|
830
|
+
header: {
|
|
831
|
+
"content-type": ["application/json"],
|
|
832
|
+
},
|
|
833
|
+
},
|
|
834
|
+
``` */
|
|
835
|
+
headers: import_zod11.z.record(StringMatchSchema).optional(),
|
|
836
|
+
/** An object of query parameters to match.
|
|
837
|
+
* This uses the [EventFilter matching syntax](https://trigger.dev/docs/documentation/guides/event-filter).
|
|
838
|
+
|
|
839
|
+
@example
|
|
840
|
+
```ts
|
|
841
|
+
filter: {
|
|
842
|
+
query: {
|
|
843
|
+
"hub.mode": [{ $startsWith: "sub" }],
|
|
844
|
+
},
|
|
845
|
+
},
|
|
846
|
+
``` */
|
|
847
|
+
query: import_zod11.z.record(StringMatchSchema).optional(),
|
|
848
|
+
/** An object of key/values to match.
|
|
849
|
+
* This uses the [EventFilter matching syntax](https://trigger.dev/docs/documentation/guides/event-filter).
|
|
850
|
+
*/
|
|
851
|
+
body: EventFilterSchema.optional()
|
|
852
|
+
});
|
|
853
|
+
|
|
760
854
|
// src/schemas/api.ts
|
|
761
|
-
var UpdateTriggerSourceBodyV1Schema =
|
|
762
|
-
registeredEvents:
|
|
763
|
-
secret:
|
|
855
|
+
var UpdateTriggerSourceBodyV1Schema = import_zod12.z.object({
|
|
856
|
+
registeredEvents: import_zod12.z.array(import_zod12.z.string()),
|
|
857
|
+
secret: import_zod12.z.string().optional(),
|
|
764
858
|
data: SerializableJsonSchema.optional()
|
|
765
859
|
});
|
|
766
|
-
var UpdateTriggerSourceBodyV2Schema =
|
|
767
|
-
secret:
|
|
860
|
+
var UpdateTriggerSourceBodyV2Schema = import_zod12.z.object({
|
|
861
|
+
secret: import_zod12.z.string().optional(),
|
|
768
862
|
data: SerializableJsonSchema.optional(),
|
|
769
|
-
options:
|
|
770
|
-
event:
|
|
771
|
-
}).and(
|
|
863
|
+
options: import_zod12.z.object({
|
|
864
|
+
event: import_zod12.z.array(import_zod12.z.string())
|
|
865
|
+
}).and(import_zod12.z.record(import_zod12.z.string(), import_zod12.z.array(import_zod12.z.string())).optional())
|
|
772
866
|
});
|
|
773
|
-
var RegisterHTTPTriggerSourceBodySchema =
|
|
774
|
-
type:
|
|
775
|
-
url:
|
|
867
|
+
var RegisterHTTPTriggerSourceBodySchema = import_zod12.z.object({
|
|
868
|
+
type: import_zod12.z.literal("HTTP"),
|
|
869
|
+
url: import_zod12.z.string().url()
|
|
776
870
|
});
|
|
777
|
-
var RegisterSMTPTriggerSourceBodySchema =
|
|
778
|
-
type:
|
|
871
|
+
var RegisterSMTPTriggerSourceBodySchema = import_zod12.z.object({
|
|
872
|
+
type: import_zod12.z.literal("SMTP")
|
|
779
873
|
});
|
|
780
|
-
var RegisterSQSTriggerSourceBodySchema =
|
|
781
|
-
type:
|
|
874
|
+
var RegisterSQSTriggerSourceBodySchema = import_zod12.z.object({
|
|
875
|
+
type: import_zod12.z.literal("SQS")
|
|
782
876
|
});
|
|
783
|
-
var RegisterSourceChannelBodySchema =
|
|
877
|
+
var RegisterSourceChannelBodySchema = import_zod12.z.discriminatedUnion("type", [
|
|
784
878
|
RegisterHTTPTriggerSourceBodySchema,
|
|
785
879
|
RegisterSMTPTriggerSourceBodySchema,
|
|
786
880
|
RegisterSQSTriggerSourceBodySchema
|
|
787
881
|
]);
|
|
788
882
|
var REGISTER_SOURCE_EVENT_V1 = "dev.trigger.source.register";
|
|
789
883
|
var REGISTER_SOURCE_EVENT_V2 = "dev.trigger.source.register.v2";
|
|
790
|
-
var RegisterTriggerSourceSchema =
|
|
791
|
-
key:
|
|
792
|
-
params:
|
|
793
|
-
active:
|
|
794
|
-
secret:
|
|
884
|
+
var RegisterTriggerSourceSchema = import_zod12.z.object({
|
|
885
|
+
key: import_zod12.z.string(),
|
|
886
|
+
params: import_zod12.z.any(),
|
|
887
|
+
active: import_zod12.z.boolean(),
|
|
888
|
+
secret: import_zod12.z.string(),
|
|
795
889
|
data: DeserializedJsonSchema.optional(),
|
|
796
890
|
channel: RegisterSourceChannelBodySchema,
|
|
797
|
-
clientId:
|
|
891
|
+
clientId: import_zod12.z.string().optional()
|
|
798
892
|
});
|
|
799
|
-
var SourceEventOptionSchema =
|
|
800
|
-
name:
|
|
801
|
-
value:
|
|
893
|
+
var SourceEventOptionSchema = import_zod12.z.object({
|
|
894
|
+
name: import_zod12.z.string(),
|
|
895
|
+
value: import_zod12.z.string()
|
|
802
896
|
});
|
|
803
|
-
var RegisterSourceEventSchemaV1 =
|
|
897
|
+
var RegisterSourceEventSchemaV1 = import_zod12.z.object({
|
|
804
898
|
/** The id of the source */
|
|
805
|
-
id:
|
|
899
|
+
id: import_zod12.z.string(),
|
|
806
900
|
source: RegisterTriggerSourceSchema,
|
|
807
|
-
events:
|
|
808
|
-
missingEvents:
|
|
809
|
-
orphanedEvents:
|
|
810
|
-
dynamicTriggerId:
|
|
901
|
+
events: import_zod12.z.array(import_zod12.z.string()),
|
|
902
|
+
missingEvents: import_zod12.z.array(import_zod12.z.string()),
|
|
903
|
+
orphanedEvents: import_zod12.z.array(import_zod12.z.string()),
|
|
904
|
+
dynamicTriggerId: import_zod12.z.string().optional()
|
|
811
905
|
});
|
|
812
|
-
var RegisteredOptionsDiffSchema =
|
|
813
|
-
desired:
|
|
814
|
-
missing:
|
|
815
|
-
orphaned:
|
|
906
|
+
var RegisteredOptionsDiffSchema = import_zod12.z.object({
|
|
907
|
+
desired: import_zod12.z.array(import_zod12.z.string()),
|
|
908
|
+
missing: import_zod12.z.array(import_zod12.z.string()),
|
|
909
|
+
orphaned: import_zod12.z.array(import_zod12.z.string())
|
|
816
910
|
});
|
|
817
|
-
var RegisterSourceEventOptionsSchema =
|
|
911
|
+
var RegisterSourceEventOptionsSchema = import_zod12.z.object({
|
|
818
912
|
event: RegisteredOptionsDiffSchema
|
|
819
|
-
}).and(
|
|
820
|
-
var RegisterSourceEventSchemaV2 =
|
|
913
|
+
}).and(import_zod12.z.record(import_zod12.z.string(), RegisteredOptionsDiffSchema));
|
|
914
|
+
var RegisterSourceEventSchemaV2 = import_zod12.z.object({
|
|
821
915
|
/** The id of the source */
|
|
822
|
-
id:
|
|
916
|
+
id: import_zod12.z.string(),
|
|
823
917
|
source: RegisterTriggerSourceSchema,
|
|
824
918
|
options: RegisterSourceEventOptionsSchema,
|
|
825
|
-
dynamicTriggerId:
|
|
919
|
+
dynamicTriggerId: import_zod12.z.string().optional()
|
|
826
920
|
});
|
|
827
|
-
var TriggerSourceSchema =
|
|
828
|
-
id:
|
|
829
|
-
key:
|
|
921
|
+
var TriggerSourceSchema = import_zod12.z.object({
|
|
922
|
+
id: import_zod12.z.string(),
|
|
923
|
+
key: import_zod12.z.string()
|
|
830
924
|
});
|
|
831
925
|
var HttpSourceResponseMetadataSchema = DeserializedJsonSchema;
|
|
832
|
-
var HandleTriggerSourceSchema =
|
|
833
|
-
key:
|
|
834
|
-
secret:
|
|
835
|
-
data:
|
|
836
|
-
params:
|
|
926
|
+
var HandleTriggerSourceSchema = import_zod12.z.object({
|
|
927
|
+
key: import_zod12.z.string(),
|
|
928
|
+
secret: import_zod12.z.string(),
|
|
929
|
+
data: import_zod12.z.any(),
|
|
930
|
+
params: import_zod12.z.any(),
|
|
837
931
|
auth: ConnectionAuthSchema.optional(),
|
|
838
932
|
metadata: HttpSourceResponseMetadataSchema.optional()
|
|
839
933
|
});
|
|
840
|
-
var
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
"x-ts-
|
|
848
|
-
"x-ts-
|
|
849
|
-
"x-ts-
|
|
850
|
-
"x-ts-data": import_zod11.z.string().transform((s) => JSON.parse(s)),
|
|
851
|
-
"x-ts-params": import_zod11.z.string().transform((s) => JSON.parse(s)),
|
|
852
|
-
"x-ts-http-url": import_zod11.z.string(),
|
|
853
|
-
"x-ts-http-method": import_zod11.z.string(),
|
|
854
|
-
"x-ts-http-headers": import_zod11.z.string().transform((s) => import_zod11.z.record(import_zod11.z.string()).parse(JSON.parse(s))),
|
|
855
|
-
"x-ts-auth": import_zod11.z.string().optional().transform((s) => {
|
|
934
|
+
var HttpSourceRequestHeadersSchema = import_zod12.z.object({
|
|
935
|
+
"x-ts-key": import_zod12.z.string(),
|
|
936
|
+
"x-ts-dynamic-id": import_zod12.z.string().optional(),
|
|
937
|
+
"x-ts-secret": import_zod12.z.string(),
|
|
938
|
+
"x-ts-data": import_zod12.z.string().transform((s) => JSON.parse(s)),
|
|
939
|
+
"x-ts-params": import_zod12.z.string().transform((s) => JSON.parse(s)),
|
|
940
|
+
"x-ts-http-url": import_zod12.z.string(),
|
|
941
|
+
"x-ts-http-method": import_zod12.z.string(),
|
|
942
|
+
"x-ts-http-headers": import_zod12.z.string().transform((s) => import_zod12.z.record(import_zod12.z.string()).parse(JSON.parse(s))),
|
|
943
|
+
"x-ts-auth": import_zod12.z.string().optional().transform((s) => {
|
|
856
944
|
if (s === void 0)
|
|
857
945
|
return;
|
|
858
946
|
const json = JSON.parse(s);
|
|
859
947
|
return ConnectionAuthSchema.parse(json);
|
|
860
948
|
}),
|
|
861
|
-
"x-ts-metadata":
|
|
949
|
+
"x-ts-metadata": import_zod12.z.string().optional().transform((s) => {
|
|
862
950
|
if (s === void 0)
|
|
863
951
|
return;
|
|
864
952
|
const json = JSON.parse(s);
|
|
865
953
|
return DeserializedJsonSchema.parse(json);
|
|
866
954
|
})
|
|
867
955
|
});
|
|
868
|
-
var
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
956
|
+
var HttpEndpointRequestHeadersSchema = import_zod12.z.object({
|
|
957
|
+
"x-ts-key": import_zod12.z.string(),
|
|
958
|
+
"x-ts-http-url": import_zod12.z.string(),
|
|
959
|
+
"x-ts-http-method": import_zod12.z.string(),
|
|
960
|
+
"x-ts-http-headers": import_zod12.z.string().transform((s) => import_zod12.z.record(import_zod12.z.string()).parse(JSON.parse(s)))
|
|
961
|
+
});
|
|
962
|
+
var PongSuccessResponseSchema = import_zod12.z.object({
|
|
963
|
+
ok: import_zod12.z.literal(true),
|
|
964
|
+
triggerVersion: import_zod12.z.string().optional(),
|
|
965
|
+
triggerSdkVersion: import_zod12.z.string().optional()
|
|
872
966
|
});
|
|
873
|
-
var PongErrorResponseSchema =
|
|
874
|
-
ok:
|
|
875
|
-
error:
|
|
876
|
-
triggerVersion:
|
|
877
|
-
triggerSdkVersion:
|
|
967
|
+
var PongErrorResponseSchema = import_zod12.z.object({
|
|
968
|
+
ok: import_zod12.z.literal(false),
|
|
969
|
+
error: import_zod12.z.string(),
|
|
970
|
+
triggerVersion: import_zod12.z.string().optional(),
|
|
971
|
+
triggerSdkVersion: import_zod12.z.string().optional()
|
|
878
972
|
});
|
|
879
|
-
var PongResponseSchema =
|
|
973
|
+
var PongResponseSchema = import_zod12.z.discriminatedUnion("ok", [
|
|
880
974
|
PongSuccessResponseSchema,
|
|
881
975
|
PongErrorResponseSchema
|
|
882
976
|
]);
|
|
883
|
-
var ValidateSuccessResponseSchema =
|
|
884
|
-
ok:
|
|
885
|
-
endpointId:
|
|
886
|
-
triggerVersion:
|
|
977
|
+
var ValidateSuccessResponseSchema = import_zod12.z.object({
|
|
978
|
+
ok: import_zod12.z.literal(true),
|
|
979
|
+
endpointId: import_zod12.z.string(),
|
|
980
|
+
triggerVersion: import_zod12.z.string().optional()
|
|
887
981
|
});
|
|
888
|
-
var ValidateErrorResponseSchema =
|
|
889
|
-
ok:
|
|
890
|
-
error:
|
|
891
|
-
triggerVersion:
|
|
982
|
+
var ValidateErrorResponseSchema = import_zod12.z.object({
|
|
983
|
+
ok: import_zod12.z.literal(false),
|
|
984
|
+
error: import_zod12.z.string(),
|
|
985
|
+
triggerVersion: import_zod12.z.string().optional()
|
|
892
986
|
});
|
|
893
|
-
var ValidateResponseSchema =
|
|
987
|
+
var ValidateResponseSchema = import_zod12.z.discriminatedUnion("ok", [
|
|
894
988
|
ValidateSuccessResponseSchema,
|
|
895
989
|
ValidateErrorResponseSchema
|
|
896
990
|
]);
|
|
897
|
-
var QueueOptionsSchema =
|
|
898
|
-
name:
|
|
899
|
-
maxConcurrent:
|
|
900
|
-
});
|
|
901
|
-
var JobMetadataSchema =
|
|
902
|
-
id:
|
|
903
|
-
name:
|
|
904
|
-
version:
|
|
991
|
+
var QueueOptionsSchema = import_zod12.z.object({
|
|
992
|
+
name: import_zod12.z.string(),
|
|
993
|
+
maxConcurrent: import_zod12.z.number().optional()
|
|
994
|
+
});
|
|
995
|
+
var JobMetadataSchema = import_zod12.z.object({
|
|
996
|
+
id: import_zod12.z.string(),
|
|
997
|
+
name: import_zod12.z.string(),
|
|
998
|
+
version: import_zod12.z.string(),
|
|
905
999
|
event: EventSpecificationSchema,
|
|
906
1000
|
trigger: TriggerMetadataSchema,
|
|
907
|
-
integrations:
|
|
908
|
-
internal:
|
|
909
|
-
enabled:
|
|
910
|
-
startPosition:
|
|
1001
|
+
integrations: import_zod12.z.record(IntegrationConfigSchema),
|
|
1002
|
+
internal: import_zod12.z.boolean().default(false),
|
|
1003
|
+
enabled: import_zod12.z.boolean(),
|
|
1004
|
+
startPosition: import_zod12.z.enum([
|
|
911
1005
|
"initial",
|
|
912
1006
|
"latest"
|
|
913
1007
|
]),
|
|
914
|
-
preprocessRuns:
|
|
1008
|
+
preprocessRuns: import_zod12.z.boolean()
|
|
915
1009
|
});
|
|
916
|
-
var SourceMetadataV1Schema =
|
|
917
|
-
version:
|
|
918
|
-
channel:
|
|
1010
|
+
var SourceMetadataV1Schema = import_zod12.z.object({
|
|
1011
|
+
version: import_zod12.z.literal("1"),
|
|
1012
|
+
channel: import_zod12.z.enum([
|
|
919
1013
|
"HTTP",
|
|
920
1014
|
"SQS",
|
|
921
1015
|
"SMTP"
|
|
922
1016
|
]),
|
|
923
1017
|
integration: IntegrationConfigSchema,
|
|
924
|
-
key:
|
|
925
|
-
params:
|
|
926
|
-
events:
|
|
927
|
-
registerSourceJob:
|
|
928
|
-
id:
|
|
929
|
-
version:
|
|
1018
|
+
key: import_zod12.z.string(),
|
|
1019
|
+
params: import_zod12.z.any(),
|
|
1020
|
+
events: import_zod12.z.array(import_zod12.z.string()),
|
|
1021
|
+
registerSourceJob: import_zod12.z.object({
|
|
1022
|
+
id: import_zod12.z.string(),
|
|
1023
|
+
version: import_zod12.z.string()
|
|
930
1024
|
}).optional()
|
|
931
1025
|
});
|
|
932
|
-
var SourceMetadataV2Schema =
|
|
933
|
-
version:
|
|
934
|
-
channel:
|
|
1026
|
+
var SourceMetadataV2Schema = import_zod12.z.object({
|
|
1027
|
+
version: import_zod12.z.literal("2"),
|
|
1028
|
+
channel: import_zod12.z.enum([
|
|
935
1029
|
"HTTP",
|
|
936
1030
|
"SQS",
|
|
937
1031
|
"SMTP"
|
|
938
1032
|
]),
|
|
939
1033
|
integration: IntegrationConfigSchema,
|
|
940
|
-
key:
|
|
941
|
-
params:
|
|
942
|
-
options:
|
|
943
|
-
registerSourceJob:
|
|
944
|
-
id:
|
|
945
|
-
version:
|
|
1034
|
+
key: import_zod12.z.string(),
|
|
1035
|
+
params: import_zod12.z.any(),
|
|
1036
|
+
options: import_zod12.z.record(import_zod12.z.array(import_zod12.z.string())),
|
|
1037
|
+
registerSourceJob: import_zod12.z.object({
|
|
1038
|
+
id: import_zod12.z.string(),
|
|
1039
|
+
version: import_zod12.z.string()
|
|
946
1040
|
}).optional()
|
|
947
1041
|
});
|
|
948
|
-
var SourceMetadataSchema =
|
|
1042
|
+
var SourceMetadataSchema = import_zod12.z.preprocess(addMissingVersionField, import_zod12.z.discriminatedUnion("version", [
|
|
949
1043
|
SourceMetadataV1Schema,
|
|
950
1044
|
SourceMetadataV2Schema
|
|
951
1045
|
]));
|
|
952
|
-
var DynamicTriggerEndpointMetadataSchema =
|
|
953
|
-
id:
|
|
954
|
-
jobs:
|
|
1046
|
+
var DynamicTriggerEndpointMetadataSchema = import_zod12.z.object({
|
|
1047
|
+
id: import_zod12.z.string(),
|
|
1048
|
+
jobs: import_zod12.z.array(JobMetadataSchema.pick({
|
|
955
1049
|
id: true,
|
|
956
1050
|
version: true
|
|
957
1051
|
})),
|
|
958
|
-
registerSourceJob:
|
|
959
|
-
id:
|
|
960
|
-
version:
|
|
1052
|
+
registerSourceJob: import_zod12.z.object({
|
|
1053
|
+
id: import_zod12.z.string(),
|
|
1054
|
+
version: import_zod12.z.string()
|
|
961
1055
|
}).optional()
|
|
962
1056
|
});
|
|
963
|
-
var
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
1057
|
+
var HttpEndpointMetadataSchema = import_zod12.z.object({
|
|
1058
|
+
id: import_zod12.z.string(),
|
|
1059
|
+
version: import_zod12.z.string(),
|
|
1060
|
+
enabled: import_zod12.z.boolean(),
|
|
1061
|
+
title: import_zod12.z.string().optional(),
|
|
1062
|
+
icon: import_zod12.z.string().optional(),
|
|
1063
|
+
properties: import_zod12.z.array(DisplayPropertySchema).optional(),
|
|
1064
|
+
event: EventSpecificationSchema,
|
|
1065
|
+
immediateResponseFilter: RequestFilterSchema.optional(),
|
|
1066
|
+
skipTriggeringRuns: import_zod12.z.boolean().optional(),
|
|
1067
|
+
source: import_zod12.z.string()
|
|
1068
|
+
});
|
|
1069
|
+
var IndexEndpointResponseSchema = import_zod12.z.object({
|
|
1070
|
+
jobs: import_zod12.z.array(JobMetadataSchema),
|
|
1071
|
+
sources: import_zod12.z.array(SourceMetadataSchema),
|
|
1072
|
+
dynamicTriggers: import_zod12.z.array(DynamicTriggerEndpointMetadataSchema),
|
|
1073
|
+
dynamicSchedules: import_zod12.z.array(RegisterDynamicSchedulePayloadSchema),
|
|
1074
|
+
httpEndpoints: import_zod12.z.array(HttpEndpointMetadataSchema).optional()
|
|
1075
|
+
});
|
|
1076
|
+
var EndpointIndexErrorSchema = import_zod12.z.object({
|
|
1077
|
+
message: import_zod12.z.string(),
|
|
1078
|
+
raw: import_zod12.z.any().optional()
|
|
1079
|
+
});
|
|
1080
|
+
var IndexEndpointStatsSchema = import_zod12.z.object({
|
|
1081
|
+
jobs: import_zod12.z.number(),
|
|
1082
|
+
sources: import_zod12.z.number(),
|
|
1083
|
+
dynamicTriggers: import_zod12.z.number(),
|
|
1084
|
+
dynamicSchedules: import_zod12.z.number(),
|
|
1085
|
+
disabledJobs: import_zod12.z.number().default(0),
|
|
1086
|
+
httpEndpoints: import_zod12.z.number().default(0)
|
|
979
1087
|
});
|
|
980
1088
|
function parseEndpointIndexStats(stats) {
|
|
981
1089
|
if (stats === null || stats === void 0) {
|
|
@@ -984,208 +1092,232 @@ function parseEndpointIndexStats(stats) {
|
|
|
984
1092
|
return IndexEndpointStatsSchema.parse(stats);
|
|
985
1093
|
}
|
|
986
1094
|
__name(parseEndpointIndexStats, "parseEndpointIndexStats");
|
|
987
|
-
var GetEndpointIndexResponseSchema =
|
|
988
|
-
|
|
989
|
-
status:
|
|
990
|
-
updatedAt:
|
|
1095
|
+
var GetEndpointIndexResponseSchema = import_zod12.z.discriminatedUnion("status", [
|
|
1096
|
+
import_zod12.z.object({
|
|
1097
|
+
status: import_zod12.z.literal("PENDING"),
|
|
1098
|
+
updatedAt: import_zod12.z.coerce.date()
|
|
991
1099
|
}),
|
|
992
|
-
|
|
993
|
-
status:
|
|
994
|
-
updatedAt:
|
|
1100
|
+
import_zod12.z.object({
|
|
1101
|
+
status: import_zod12.z.literal("STARTED"),
|
|
1102
|
+
updatedAt: import_zod12.z.coerce.date()
|
|
995
1103
|
}),
|
|
996
|
-
|
|
997
|
-
status:
|
|
1104
|
+
import_zod12.z.object({
|
|
1105
|
+
status: import_zod12.z.literal("SUCCESS"),
|
|
998
1106
|
stats: IndexEndpointStatsSchema,
|
|
999
|
-
updatedAt:
|
|
1107
|
+
updatedAt: import_zod12.z.coerce.date()
|
|
1000
1108
|
}),
|
|
1001
|
-
|
|
1002
|
-
status:
|
|
1109
|
+
import_zod12.z.object({
|
|
1110
|
+
status: import_zod12.z.literal("FAILURE"),
|
|
1003
1111
|
error: EndpointIndexErrorSchema,
|
|
1004
|
-
updatedAt:
|
|
1112
|
+
updatedAt: import_zod12.z.coerce.date()
|
|
1005
1113
|
})
|
|
1006
1114
|
]);
|
|
1007
|
-
var EndpointHeadersSchema =
|
|
1008
|
-
"trigger-version":
|
|
1009
|
-
"trigger-sdk-version":
|
|
1115
|
+
var EndpointHeadersSchema = import_zod12.z.object({
|
|
1116
|
+
"trigger-version": import_zod12.z.string().optional(),
|
|
1117
|
+
"trigger-sdk-version": import_zod12.z.string().optional()
|
|
1010
1118
|
});
|
|
1011
|
-
var RawEventSchema =
|
|
1119
|
+
var RawEventSchema = import_zod12.z.object({
|
|
1012
1120
|
/** The `name` property must exactly match any subscriptions you want to
|
|
1013
1121
|
trigger. */
|
|
1014
|
-
name:
|
|
1122
|
+
name: import_zod12.z.string(),
|
|
1015
1123
|
/** The `payload` property will be sent to any matching Jobs and will appear
|
|
1016
1124
|
as the `payload` param of the `run()` function. You can leave this
|
|
1017
1125
|
parameter out if you just want to trigger a Job without any input data. */
|
|
1018
|
-
payload:
|
|
1126
|
+
payload: import_zod12.z.any(),
|
|
1019
1127
|
/** The optional `context` property will be sent to any matching Jobs and will
|
|
1020
1128
|
be passed through as the `context.event.context` param of the `run()`
|
|
1021
1129
|
function. This is optional but can be useful if you want to pass through
|
|
1022
1130
|
some additional context to the Job. */
|
|
1023
|
-
context:
|
|
1131
|
+
context: import_zod12.z.any().optional(),
|
|
1024
1132
|
/** The `id` property uniquely identify this particular event. If unset it
|
|
1025
1133
|
will be set automatically using `ulid`. */
|
|
1026
|
-
id:
|
|
1134
|
+
id: import_zod12.z.string().default(() => (0, import_ulid.ulid)()),
|
|
1027
1135
|
/** This is optional, it defaults to the current timestamp. Usually you would
|
|
1028
1136
|
only set this if you have a timestamp that you wish to pass through, e.g.
|
|
1029
1137
|
you receive a timestamp from a service and you want the same timestamp to
|
|
1030
1138
|
be used in your Job. */
|
|
1031
|
-
timestamp:
|
|
1139
|
+
timestamp: import_zod12.z.coerce.date().optional(),
|
|
1032
1140
|
/** This is optional, it defaults to "trigger.dev". It can be useful to set
|
|
1033
1141
|
this as you can filter events using this in the `eventTrigger()`. */
|
|
1034
|
-
source:
|
|
1142
|
+
source: import_zod12.z.string().optional(),
|
|
1143
|
+
/** This is optional, it defaults to "JSON". If your event is actually a request,
|
|
1144
|
+
with a url, headers, method and rawBody you can use "REQUEST" */
|
|
1145
|
+
payloadType: import_zod12.z.union([
|
|
1146
|
+
import_zod12.z.literal("JSON"),
|
|
1147
|
+
import_zod12.z.literal("REQUEST")
|
|
1148
|
+
]).optional()
|
|
1035
1149
|
});
|
|
1036
|
-
var ApiEventLogSchema =
|
|
1150
|
+
var ApiEventLogSchema = import_zod12.z.object({
|
|
1037
1151
|
/** The `id` of the event that was sent.
|
|
1038
1152
|
*/
|
|
1039
|
-
id:
|
|
1153
|
+
id: import_zod12.z.string(),
|
|
1040
1154
|
/** The `name` of the event that was sent. */
|
|
1041
|
-
name:
|
|
1155
|
+
name: import_zod12.z.string(),
|
|
1042
1156
|
/** The `payload` of the event that was sent */
|
|
1043
1157
|
payload: DeserializedJsonSchema,
|
|
1044
1158
|
/** The `context` of the event that was sent. Is `undefined` if no context was
|
|
1045
1159
|
set when sending the event. */
|
|
1046
1160
|
context: DeserializedJsonSchema.optional().nullable(),
|
|
1047
1161
|
/** The `timestamp` of the event that was sent */
|
|
1048
|
-
timestamp:
|
|
1162
|
+
timestamp: import_zod12.z.coerce.date(),
|
|
1049
1163
|
/** The timestamp when the event will be delivered to any matching Jobs. Is
|
|
1050
1164
|
`undefined` if `deliverAt` or `deliverAfter` wasn't set when sending the
|
|
1051
1165
|
event. */
|
|
1052
|
-
deliverAt:
|
|
1166
|
+
deliverAt: import_zod12.z.coerce.date().optional().nullable(),
|
|
1053
1167
|
/** The timestamp when the event was delivered. Is `undefined` if `deliverAt`
|
|
1054
1168
|
or `deliverAfter` were set when sending the event. */
|
|
1055
|
-
deliveredAt:
|
|
1169
|
+
deliveredAt: import_zod12.z.coerce.date().optional().nullable(),
|
|
1056
1170
|
/** The timestamp when the event was cancelled. Is `undefined` if the event
|
|
1057
1171
|
* wasn't cancelled. */
|
|
1058
|
-
cancelledAt:
|
|
1172
|
+
cancelledAt: import_zod12.z.coerce.date().optional().nullable()
|
|
1059
1173
|
});
|
|
1060
|
-
var SendEventOptionsSchema =
|
|
1174
|
+
var SendEventOptionsSchema = import_zod12.z.object({
|
|
1061
1175
|
/** An optional Date when you want the event to trigger Jobs. The event will
|
|
1062
1176
|
be sent to the platform immediately but won't be acted upon until the
|
|
1063
1177
|
specified time. */
|
|
1064
|
-
deliverAt:
|
|
1178
|
+
deliverAt: import_zod12.z.coerce.date().optional(),
|
|
1065
1179
|
/** An optional number of seconds you want to wait for the event to trigger
|
|
1066
1180
|
any relevant Jobs. The event will be sent to the platform immediately but
|
|
1067
1181
|
won't be delivered until after the elapsed number of seconds. */
|
|
1068
|
-
deliverAfter:
|
|
1182
|
+
deliverAfter: import_zod12.z.number().int().optional(),
|
|
1069
1183
|
/** This optional param will be used by Trigger.dev Connect, which
|
|
1070
1184
|
is coming soon. */
|
|
1071
|
-
accountId:
|
|
1185
|
+
accountId: import_zod12.z.string().optional()
|
|
1072
1186
|
});
|
|
1073
|
-
var SendEventBodySchema =
|
|
1187
|
+
var SendEventBodySchema = import_zod12.z.object({
|
|
1074
1188
|
event: RawEventSchema,
|
|
1075
1189
|
options: SendEventOptionsSchema.optional()
|
|
1076
1190
|
});
|
|
1077
|
-
var DeliverEventResponseSchema =
|
|
1078
|
-
deliveredAt:
|
|
1191
|
+
var DeliverEventResponseSchema = import_zod12.z.object({
|
|
1192
|
+
deliveredAt: import_zod12.z.string().datetime()
|
|
1079
1193
|
});
|
|
1080
|
-
var RuntimeEnvironmentTypeSchema =
|
|
1194
|
+
var RuntimeEnvironmentTypeSchema = import_zod12.z.enum([
|
|
1081
1195
|
"PRODUCTION",
|
|
1082
1196
|
"STAGING",
|
|
1083
1197
|
"DEVELOPMENT",
|
|
1084
1198
|
"PREVIEW"
|
|
1085
1199
|
]);
|
|
1086
|
-
var RunSourceContextSchema =
|
|
1087
|
-
id:
|
|
1088
|
-
metadata:
|
|
1200
|
+
var RunSourceContextSchema = import_zod12.z.object({
|
|
1201
|
+
id: import_zod12.z.string(),
|
|
1202
|
+
metadata: import_zod12.z.any()
|
|
1089
1203
|
});
|
|
1090
|
-
var AutoYieldConfigSchema =
|
|
1091
|
-
startTaskThreshold:
|
|
1092
|
-
beforeExecuteTaskThreshold:
|
|
1093
|
-
beforeCompleteTaskThreshold:
|
|
1094
|
-
afterCompleteTaskThreshold:
|
|
1204
|
+
var AutoYieldConfigSchema = import_zod12.z.object({
|
|
1205
|
+
startTaskThreshold: import_zod12.z.number(),
|
|
1206
|
+
beforeExecuteTaskThreshold: import_zod12.z.number(),
|
|
1207
|
+
beforeCompleteTaskThreshold: import_zod12.z.number(),
|
|
1208
|
+
afterCompleteTaskThreshold: import_zod12.z.number()
|
|
1095
1209
|
});
|
|
1096
|
-
var RunJobBodySchema =
|
|
1210
|
+
var RunJobBodySchema = import_zod12.z.object({
|
|
1097
1211
|
event: ApiEventLogSchema,
|
|
1098
|
-
job:
|
|
1099
|
-
id:
|
|
1100
|
-
version:
|
|
1212
|
+
job: import_zod12.z.object({
|
|
1213
|
+
id: import_zod12.z.string(),
|
|
1214
|
+
version: import_zod12.z.string()
|
|
1101
1215
|
}),
|
|
1102
|
-
run:
|
|
1103
|
-
id:
|
|
1104
|
-
isTest:
|
|
1105
|
-
isRetry:
|
|
1106
|
-
startedAt:
|
|
1216
|
+
run: import_zod12.z.object({
|
|
1217
|
+
id: import_zod12.z.string(),
|
|
1218
|
+
isTest: import_zod12.z.boolean(),
|
|
1219
|
+
isRetry: import_zod12.z.boolean().default(false),
|
|
1220
|
+
startedAt: import_zod12.z.coerce.date()
|
|
1107
1221
|
}),
|
|
1108
|
-
environment:
|
|
1109
|
-
id:
|
|
1110
|
-
slug:
|
|
1222
|
+
environment: import_zod12.z.object({
|
|
1223
|
+
id: import_zod12.z.string(),
|
|
1224
|
+
slug: import_zod12.z.string(),
|
|
1111
1225
|
type: RuntimeEnvironmentTypeSchema
|
|
1112
1226
|
}),
|
|
1113
|
-
organization:
|
|
1114
|
-
id:
|
|
1115
|
-
title:
|
|
1116
|
-
slug:
|
|
1227
|
+
organization: import_zod12.z.object({
|
|
1228
|
+
id: import_zod12.z.string(),
|
|
1229
|
+
title: import_zod12.z.string(),
|
|
1230
|
+
slug: import_zod12.z.string()
|
|
1117
1231
|
}),
|
|
1118
|
-
|
|
1119
|
-
id:
|
|
1120
|
-
|
|
1232
|
+
project: import_zod12.z.object({
|
|
1233
|
+
id: import_zod12.z.string(),
|
|
1234
|
+
name: import_zod12.z.string(),
|
|
1235
|
+
slug: import_zod12.z.string()
|
|
1236
|
+
}).optional(),
|
|
1237
|
+
account: import_zod12.z.object({
|
|
1238
|
+
id: import_zod12.z.string(),
|
|
1239
|
+
metadata: import_zod12.z.any()
|
|
1121
1240
|
}).optional(),
|
|
1122
1241
|
source: RunSourceContextSchema.optional(),
|
|
1123
|
-
tasks:
|
|
1124
|
-
cachedTaskCursor:
|
|
1125
|
-
noopTasksSet:
|
|
1126
|
-
connections:
|
|
1127
|
-
yieldedExecutions:
|
|
1128
|
-
runChunkExecutionLimit:
|
|
1242
|
+
tasks: import_zod12.z.array(CachedTaskSchema).optional(),
|
|
1243
|
+
cachedTaskCursor: import_zod12.z.string().optional(),
|
|
1244
|
+
noopTasksSet: import_zod12.z.string().optional(),
|
|
1245
|
+
connections: import_zod12.z.record(ConnectionAuthSchema).optional(),
|
|
1246
|
+
yieldedExecutions: import_zod12.z.string().array().optional(),
|
|
1247
|
+
runChunkExecutionLimit: import_zod12.z.number().optional(),
|
|
1129
1248
|
autoYieldConfig: AutoYieldConfigSchema.optional()
|
|
1130
1249
|
});
|
|
1131
|
-
var RunJobErrorSchema =
|
|
1132
|
-
status:
|
|
1250
|
+
var RunJobErrorSchema = import_zod12.z.object({
|
|
1251
|
+
status: import_zod12.z.literal("ERROR"),
|
|
1133
1252
|
error: ErrorWithStackSchema,
|
|
1134
1253
|
task: TaskSchema.optional()
|
|
1135
1254
|
});
|
|
1136
|
-
var RunJobYieldExecutionErrorSchema =
|
|
1137
|
-
status:
|
|
1138
|
-
key:
|
|
1139
|
-
});
|
|
1140
|
-
var
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
timeElapsed: import_zod11.z.number(),
|
|
1156
|
-
limit: import_zod11.z.number().optional()
|
|
1157
|
-
})
|
|
1255
|
+
var RunJobYieldExecutionErrorSchema = import_zod12.z.object({
|
|
1256
|
+
status: import_zod12.z.literal("YIELD_EXECUTION"),
|
|
1257
|
+
key: import_zod12.z.string()
|
|
1258
|
+
});
|
|
1259
|
+
var AutoYieldMetadataSchema = import_zod12.z.object({
|
|
1260
|
+
location: import_zod12.z.string(),
|
|
1261
|
+
timeRemaining: import_zod12.z.number(),
|
|
1262
|
+
timeElapsed: import_zod12.z.number(),
|
|
1263
|
+
limit: import_zod12.z.number().optional()
|
|
1264
|
+
});
|
|
1265
|
+
var RunJobAutoYieldExecutionErrorSchema = AutoYieldMetadataSchema.extend({
|
|
1266
|
+
status: import_zod12.z.literal("AUTO_YIELD_EXECUTION")
|
|
1267
|
+
});
|
|
1268
|
+
var RunJobAutoYieldWithCompletedTaskExecutionErrorSchema = import_zod12.z.object({
|
|
1269
|
+
status: import_zod12.z.literal("AUTO_YIELD_EXECUTION_WITH_COMPLETED_TASK"),
|
|
1270
|
+
id: import_zod12.z.string(),
|
|
1271
|
+
properties: import_zod12.z.array(DisplayPropertySchema).optional(),
|
|
1272
|
+
output: import_zod12.z.string().optional(),
|
|
1273
|
+
data: AutoYieldMetadataSchema
|
|
1158
1274
|
});
|
|
1159
|
-
var RunJobInvalidPayloadErrorSchema =
|
|
1160
|
-
status:
|
|
1161
|
-
errors:
|
|
1275
|
+
var RunJobInvalidPayloadErrorSchema = import_zod12.z.object({
|
|
1276
|
+
status: import_zod12.z.literal("INVALID_PAYLOAD"),
|
|
1277
|
+
errors: import_zod12.z.array(SchemaErrorSchema)
|
|
1162
1278
|
});
|
|
1163
|
-
var RunJobUnresolvedAuthErrorSchema =
|
|
1164
|
-
status:
|
|
1165
|
-
issues:
|
|
1166
|
-
id:
|
|
1167
|
-
error:
|
|
1279
|
+
var RunJobUnresolvedAuthErrorSchema = import_zod12.z.object({
|
|
1280
|
+
status: import_zod12.z.literal("UNRESOLVED_AUTH_ERROR"),
|
|
1281
|
+
issues: import_zod12.z.record(import_zod12.z.object({
|
|
1282
|
+
id: import_zod12.z.string(),
|
|
1283
|
+
error: import_zod12.z.string()
|
|
1168
1284
|
}))
|
|
1169
1285
|
});
|
|
1170
|
-
var RunJobResumeWithTaskSchema =
|
|
1171
|
-
status:
|
|
1286
|
+
var RunJobResumeWithTaskSchema = import_zod12.z.object({
|
|
1287
|
+
status: import_zod12.z.literal("RESUME_WITH_TASK"),
|
|
1172
1288
|
task: TaskSchema
|
|
1173
1289
|
});
|
|
1174
|
-
var RunJobRetryWithTaskSchema =
|
|
1175
|
-
status:
|
|
1290
|
+
var RunJobRetryWithTaskSchema = import_zod12.z.object({
|
|
1291
|
+
status: import_zod12.z.literal("RETRY_WITH_TASK"),
|
|
1176
1292
|
task: TaskSchema,
|
|
1177
1293
|
error: ErrorWithStackSchema,
|
|
1178
|
-
retryAt:
|
|
1294
|
+
retryAt: import_zod12.z.coerce.date()
|
|
1179
1295
|
});
|
|
1180
|
-
var RunJobCanceledWithTaskSchema =
|
|
1181
|
-
status:
|
|
1296
|
+
var RunJobCanceledWithTaskSchema = import_zod12.z.object({
|
|
1297
|
+
status: import_zod12.z.literal("CANCELED"),
|
|
1182
1298
|
task: TaskSchema
|
|
1183
1299
|
});
|
|
1184
|
-
var RunJobSuccessSchema =
|
|
1185
|
-
status:
|
|
1300
|
+
var RunJobSuccessSchema = import_zod12.z.object({
|
|
1301
|
+
status: import_zod12.z.literal("SUCCESS"),
|
|
1186
1302
|
output: DeserializedJsonSchema.optional()
|
|
1187
1303
|
});
|
|
1188
|
-
var
|
|
1304
|
+
var RunJobErrorResponseSchema = import_zod12.z.union([
|
|
1305
|
+
RunJobAutoYieldExecutionErrorSchema,
|
|
1306
|
+
RunJobAutoYieldWithCompletedTaskExecutionErrorSchema,
|
|
1307
|
+
RunJobYieldExecutionErrorSchema,
|
|
1308
|
+
RunJobErrorSchema,
|
|
1309
|
+
RunJobUnresolvedAuthErrorSchema,
|
|
1310
|
+
RunJobInvalidPayloadErrorSchema,
|
|
1311
|
+
RunJobResumeWithTaskSchema,
|
|
1312
|
+
RunJobRetryWithTaskSchema,
|
|
1313
|
+
RunJobCanceledWithTaskSchema
|
|
1314
|
+
]);
|
|
1315
|
+
var RunJobResumeWithParallelTaskSchema = import_zod12.z.object({
|
|
1316
|
+
status: import_zod12.z.literal("RESUME_WITH_PARALLEL_TASK"),
|
|
1317
|
+
task: TaskSchema,
|
|
1318
|
+
childErrors: import_zod12.z.array(RunJobErrorResponseSchema)
|
|
1319
|
+
});
|
|
1320
|
+
var RunJobResponseSchema = import_zod12.z.discriminatedUnion("status", [
|
|
1189
1321
|
RunJobAutoYieldExecutionErrorSchema,
|
|
1190
1322
|
RunJobAutoYieldWithCompletedTaskExecutionErrorSchema,
|
|
1191
1323
|
RunJobYieldExecutionErrorSchema,
|
|
@@ -1193,139 +1325,141 @@ var RunJobResponseSchema = import_zod11.z.discriminatedUnion("status", [
|
|
|
1193
1325
|
RunJobUnresolvedAuthErrorSchema,
|
|
1194
1326
|
RunJobInvalidPayloadErrorSchema,
|
|
1195
1327
|
RunJobResumeWithTaskSchema,
|
|
1328
|
+
RunJobResumeWithParallelTaskSchema,
|
|
1196
1329
|
RunJobRetryWithTaskSchema,
|
|
1197
1330
|
RunJobCanceledWithTaskSchema,
|
|
1198
1331
|
RunJobSuccessSchema
|
|
1199
1332
|
]);
|
|
1200
|
-
var PreprocessRunBodySchema =
|
|
1333
|
+
var PreprocessRunBodySchema = import_zod12.z.object({
|
|
1201
1334
|
event: ApiEventLogSchema,
|
|
1202
|
-
job:
|
|
1203
|
-
id:
|
|
1204
|
-
version:
|
|
1335
|
+
job: import_zod12.z.object({
|
|
1336
|
+
id: import_zod12.z.string(),
|
|
1337
|
+
version: import_zod12.z.string()
|
|
1205
1338
|
}),
|
|
1206
|
-
run:
|
|
1207
|
-
id:
|
|
1208
|
-
isTest:
|
|
1339
|
+
run: import_zod12.z.object({
|
|
1340
|
+
id: import_zod12.z.string(),
|
|
1341
|
+
isTest: import_zod12.z.boolean()
|
|
1209
1342
|
}),
|
|
1210
|
-
environment:
|
|
1211
|
-
id:
|
|
1212
|
-
slug:
|
|
1343
|
+
environment: import_zod12.z.object({
|
|
1344
|
+
id: import_zod12.z.string(),
|
|
1345
|
+
slug: import_zod12.z.string(),
|
|
1213
1346
|
type: RuntimeEnvironmentTypeSchema
|
|
1214
1347
|
}),
|
|
1215
|
-
organization:
|
|
1216
|
-
id:
|
|
1217
|
-
title:
|
|
1218
|
-
slug:
|
|
1348
|
+
organization: import_zod12.z.object({
|
|
1349
|
+
id: import_zod12.z.string(),
|
|
1350
|
+
title: import_zod12.z.string(),
|
|
1351
|
+
slug: import_zod12.z.string()
|
|
1219
1352
|
}),
|
|
1220
|
-
account:
|
|
1221
|
-
id:
|
|
1222
|
-
metadata:
|
|
1353
|
+
account: import_zod12.z.object({
|
|
1354
|
+
id: import_zod12.z.string(),
|
|
1355
|
+
metadata: import_zod12.z.any()
|
|
1223
1356
|
}).optional()
|
|
1224
1357
|
});
|
|
1225
|
-
var PreprocessRunResponseSchema =
|
|
1226
|
-
abort:
|
|
1227
|
-
properties:
|
|
1358
|
+
var PreprocessRunResponseSchema = import_zod12.z.object({
|
|
1359
|
+
abort: import_zod12.z.boolean(),
|
|
1360
|
+
properties: import_zod12.z.array(DisplayPropertySchema).optional()
|
|
1228
1361
|
});
|
|
1229
|
-
var CreateRunResponseOkSchema =
|
|
1230
|
-
ok:
|
|
1231
|
-
data:
|
|
1232
|
-
id:
|
|
1362
|
+
var CreateRunResponseOkSchema = import_zod12.z.object({
|
|
1363
|
+
ok: import_zod12.z.literal(true),
|
|
1364
|
+
data: import_zod12.z.object({
|
|
1365
|
+
id: import_zod12.z.string()
|
|
1233
1366
|
})
|
|
1234
1367
|
});
|
|
1235
|
-
var CreateRunResponseErrorSchema =
|
|
1236
|
-
ok:
|
|
1237
|
-
error:
|
|
1368
|
+
var CreateRunResponseErrorSchema = import_zod12.z.object({
|
|
1369
|
+
ok: import_zod12.z.literal(false),
|
|
1370
|
+
error: import_zod12.z.string()
|
|
1238
1371
|
});
|
|
1239
|
-
var CreateRunResponseBodySchema =
|
|
1372
|
+
var CreateRunResponseBodySchema = import_zod12.z.discriminatedUnion("ok", [
|
|
1240
1373
|
CreateRunResponseOkSchema,
|
|
1241
1374
|
CreateRunResponseErrorSchema
|
|
1242
1375
|
]);
|
|
1243
|
-
var RedactStringSchema =
|
|
1244
|
-
__redactedString:
|
|
1245
|
-
strings:
|
|
1246
|
-
interpolations:
|
|
1376
|
+
var RedactStringSchema = import_zod12.z.object({
|
|
1377
|
+
__redactedString: import_zod12.z.literal(true),
|
|
1378
|
+
strings: import_zod12.z.array(import_zod12.z.string()),
|
|
1379
|
+
interpolations: import_zod12.z.array(import_zod12.z.string())
|
|
1247
1380
|
});
|
|
1248
|
-
var LogMessageSchema =
|
|
1249
|
-
level:
|
|
1381
|
+
var LogMessageSchema = import_zod12.z.object({
|
|
1382
|
+
level: import_zod12.z.enum([
|
|
1250
1383
|
"DEBUG",
|
|
1251
1384
|
"INFO",
|
|
1252
1385
|
"WARN",
|
|
1253
1386
|
"ERROR"
|
|
1254
1387
|
]),
|
|
1255
|
-
message:
|
|
1388
|
+
message: import_zod12.z.string(),
|
|
1256
1389
|
data: SerializableJsonSchema.optional()
|
|
1257
1390
|
});
|
|
1258
|
-
var RedactSchema =
|
|
1259
|
-
paths:
|
|
1391
|
+
var RedactSchema = import_zod12.z.object({
|
|
1392
|
+
paths: import_zod12.z.array(import_zod12.z.string())
|
|
1260
1393
|
});
|
|
1261
|
-
var RetryOptionsSchema =
|
|
1394
|
+
var RetryOptionsSchema = import_zod12.z.object({
|
|
1262
1395
|
/** The maximum number of times to retry the request. */
|
|
1263
|
-
limit:
|
|
1396
|
+
limit: import_zod12.z.number().optional(),
|
|
1264
1397
|
/** The exponential factor to use when calculating the next retry time. */
|
|
1265
|
-
factor:
|
|
1398
|
+
factor: import_zod12.z.number().optional(),
|
|
1266
1399
|
/** The minimum amount of time to wait before retrying the request. */
|
|
1267
|
-
minTimeoutInMs:
|
|
1400
|
+
minTimeoutInMs: import_zod12.z.number().optional(),
|
|
1268
1401
|
/** The maximum amount of time to wait before retrying the request. */
|
|
1269
|
-
maxTimeoutInMs:
|
|
1402
|
+
maxTimeoutInMs: import_zod12.z.number().optional(),
|
|
1270
1403
|
/** Whether to randomize the retry time. */
|
|
1271
|
-
randomize:
|
|
1404
|
+
randomize: import_zod12.z.boolean().optional()
|
|
1272
1405
|
});
|
|
1273
|
-
var RunTaskOptionsSchema =
|
|
1406
|
+
var RunTaskOptionsSchema = import_zod12.z.object({
|
|
1274
1407
|
/** The name of the Task is required. This is displayed on the Task in the logs. */
|
|
1275
|
-
name:
|
|
1408
|
+
name: import_zod12.z.string().optional(),
|
|
1276
1409
|
/** The Task will wait and only start at the specified Date */
|
|
1277
|
-
delayUntil:
|
|
1410
|
+
delayUntil: import_zod12.z.coerce.date().optional(),
|
|
1278
1411
|
/** Retry options */
|
|
1279
1412
|
retry: RetryOptionsSchema.optional(),
|
|
1280
1413
|
/** The icon for the Task, it will appear in the logs.
|
|
1281
1414
|
* You can use the name of a company in lowercase, e.g. "github".
|
|
1282
1415
|
* Or any icon name that [Tabler Icons](https://tabler-icons.io/) supports. */
|
|
1283
|
-
icon:
|
|
1416
|
+
icon: import_zod12.z.string().optional(),
|
|
1284
1417
|
/** The key for the Task that you want to appear in the logs */
|
|
1285
|
-
displayKey:
|
|
1418
|
+
displayKey: import_zod12.z.string().optional(),
|
|
1286
1419
|
/** A description of the Task */
|
|
1287
|
-
description:
|
|
1420
|
+
description: import_zod12.z.string().optional(),
|
|
1288
1421
|
/** Properties that are displayed in the logs */
|
|
1289
|
-
properties:
|
|
1422
|
+
properties: import_zod12.z.array(DisplayPropertySchema).optional(),
|
|
1290
1423
|
/** The input params to the Task, will be displayed in the logs */
|
|
1291
|
-
params:
|
|
1424
|
+
params: import_zod12.z.any(),
|
|
1292
1425
|
/** The style of the log entry. */
|
|
1293
1426
|
style: StyleSchema.optional(),
|
|
1294
1427
|
/** Allows you to expose a `task.callbackUrl` to use in your tasks. Enabling this feature will cause the task to return the data sent to the callbackUrl instead of the usual async callback result. */
|
|
1295
|
-
callback:
|
|
1428
|
+
callback: import_zod12.z.object({
|
|
1296
1429
|
/** Causes the task to wait for and return the data of the first request sent to `task.callbackUrl`. */
|
|
1297
|
-
enabled:
|
|
1430
|
+
enabled: import_zod12.z.boolean(),
|
|
1298
1431
|
/** Time to wait for the first request to `task.callbackUrl`. Default: One hour. */
|
|
1299
|
-
timeoutInSeconds:
|
|
1432
|
+
timeoutInSeconds: import_zod12.z.number()
|
|
1300
1433
|
}).partial().optional(),
|
|
1301
1434
|
/** Allows you to link the Integration connection in the logs. This is handled automatically in integrations. */
|
|
1302
|
-
connectionKey:
|
|
1435
|
+
connectionKey: import_zod12.z.string().optional(),
|
|
1303
1436
|
/** An operation you want to perform on the Trigger.dev platform, current only "fetch" is supported. If you wish to `fetch` use [`io.backgroundFetch()`](https://trigger.dev/docs/sdk/io/backgroundfetch) instead. */
|
|
1304
|
-
operation:
|
|
1437
|
+
operation: import_zod12.z.enum([
|
|
1305
1438
|
"fetch"
|
|
1306
1439
|
]).optional(),
|
|
1307
1440
|
/** A No Operation means that the code won't be executed. This is used internally to implement features like [io.wait()](https://trigger.dev/docs/sdk/io/wait). */
|
|
1308
|
-
noop:
|
|
1441
|
+
noop: import_zod12.z.boolean().default(false),
|
|
1309
1442
|
redact: RedactSchema.optional(),
|
|
1310
|
-
trigger: TriggerMetadataSchema.optional()
|
|
1443
|
+
trigger: TriggerMetadataSchema.optional(),
|
|
1444
|
+
parallel: import_zod12.z.boolean().optional()
|
|
1311
1445
|
});
|
|
1312
1446
|
var RunTaskBodyInputSchema = RunTaskOptionsSchema.extend({
|
|
1313
|
-
idempotencyKey:
|
|
1314
|
-
parentId:
|
|
1447
|
+
idempotencyKey: import_zod12.z.string(),
|
|
1448
|
+
parentId: import_zod12.z.string().optional()
|
|
1315
1449
|
});
|
|
1316
1450
|
var RunTaskBodyOutputSchema = RunTaskBodyInputSchema.extend({
|
|
1317
|
-
properties:
|
|
1451
|
+
properties: import_zod12.z.array(DisplayPropertySchema.partial()).optional(),
|
|
1318
1452
|
params: DeserializedJsonSchema.optional().nullable(),
|
|
1319
|
-
callback:
|
|
1320
|
-
enabled:
|
|
1321
|
-
timeoutInSeconds:
|
|
1453
|
+
callback: import_zod12.z.object({
|
|
1454
|
+
enabled: import_zod12.z.boolean(),
|
|
1455
|
+
timeoutInSeconds: import_zod12.z.number().default(3600)
|
|
1322
1456
|
}).optional()
|
|
1323
1457
|
});
|
|
1324
|
-
var RunTaskResponseWithCachedTasksBodySchema =
|
|
1458
|
+
var RunTaskResponseWithCachedTasksBodySchema = import_zod12.z.object({
|
|
1325
1459
|
task: ServerTaskSchema,
|
|
1326
|
-
cachedTasks:
|
|
1327
|
-
tasks:
|
|
1328
|
-
cursor:
|
|
1460
|
+
cachedTasks: import_zod12.z.object({
|
|
1461
|
+
tasks: import_zod12.z.array(CachedTaskSchema),
|
|
1462
|
+
cursor: import_zod12.z.string().optional()
|
|
1329
1463
|
}).optional()
|
|
1330
1464
|
});
|
|
1331
1465
|
var CompleteTaskBodyInputSchema = RunTaskBodyInputSchema.pick({
|
|
@@ -1335,202 +1469,240 @@ var CompleteTaskBodyInputSchema = RunTaskBodyInputSchema.pick({
|
|
|
1335
1469
|
}).extend({
|
|
1336
1470
|
output: SerializableJsonSchema.optional().transform((v) => v ? DeserializedJsonSchema.parse(JSON.parse(JSON.stringify(v))) : {})
|
|
1337
1471
|
});
|
|
1338
|
-
var
|
|
1472
|
+
var CompleteTaskBodyV2InputSchema = RunTaskBodyInputSchema.pick({
|
|
1473
|
+
properties: true,
|
|
1474
|
+
description: true,
|
|
1475
|
+
params: true
|
|
1476
|
+
}).extend({
|
|
1477
|
+
output: import_zod12.z.string().optional()
|
|
1478
|
+
});
|
|
1479
|
+
var FailTaskBodyInputSchema = import_zod12.z.object({
|
|
1339
1480
|
error: ErrorWithStackSchema
|
|
1340
1481
|
});
|
|
1341
|
-
var NormalizedRequestSchema =
|
|
1342
|
-
headers:
|
|
1343
|
-
method:
|
|
1344
|
-
query:
|
|
1345
|
-
url:
|
|
1346
|
-
body:
|
|
1482
|
+
var NormalizedRequestSchema = import_zod12.z.object({
|
|
1483
|
+
headers: import_zod12.z.record(import_zod12.z.string()),
|
|
1484
|
+
method: import_zod12.z.string(),
|
|
1485
|
+
query: import_zod12.z.record(import_zod12.z.string()),
|
|
1486
|
+
url: import_zod12.z.string(),
|
|
1487
|
+
body: import_zod12.z.any()
|
|
1347
1488
|
});
|
|
1348
|
-
var NormalizedResponseSchema =
|
|
1349
|
-
status:
|
|
1350
|
-
body:
|
|
1351
|
-
headers:
|
|
1489
|
+
var NormalizedResponseSchema = import_zod12.z.object({
|
|
1490
|
+
status: import_zod12.z.number(),
|
|
1491
|
+
body: import_zod12.z.any(),
|
|
1492
|
+
headers: import_zod12.z.record(import_zod12.z.string()).optional()
|
|
1352
1493
|
});
|
|
1353
|
-
var HttpSourceResponseSchema =
|
|
1494
|
+
var HttpSourceResponseSchema = import_zod12.z.object({
|
|
1354
1495
|
response: NormalizedResponseSchema,
|
|
1355
|
-
events:
|
|
1496
|
+
events: import_zod12.z.array(RawEventSchema),
|
|
1356
1497
|
metadata: HttpSourceResponseMetadataSchema.optional()
|
|
1357
1498
|
});
|
|
1358
|
-
var RegisterTriggerBodySchemaV1 =
|
|
1499
|
+
var RegisterTriggerBodySchemaV1 = import_zod12.z.object({
|
|
1359
1500
|
rule: EventRuleSchema,
|
|
1360
1501
|
source: SourceMetadataV1Schema
|
|
1361
1502
|
});
|
|
1362
|
-
var RegisterTriggerBodySchemaV2 =
|
|
1503
|
+
var RegisterTriggerBodySchemaV2 = import_zod12.z.object({
|
|
1363
1504
|
rule: EventRuleSchema,
|
|
1364
1505
|
source: SourceMetadataV2Schema,
|
|
1365
|
-
accountId:
|
|
1506
|
+
accountId: import_zod12.z.string().optional()
|
|
1366
1507
|
});
|
|
1367
|
-
var InitializeTriggerBodySchema =
|
|
1368
|
-
id:
|
|
1369
|
-
params:
|
|
1370
|
-
accountId:
|
|
1371
|
-
metadata:
|
|
1508
|
+
var InitializeTriggerBodySchema = import_zod12.z.object({
|
|
1509
|
+
id: import_zod12.z.string(),
|
|
1510
|
+
params: import_zod12.z.any(),
|
|
1511
|
+
accountId: import_zod12.z.string().optional(),
|
|
1512
|
+
metadata: import_zod12.z.any().optional()
|
|
1372
1513
|
});
|
|
1373
|
-
var RegisterCommonScheduleBodySchema =
|
|
1514
|
+
var RegisterCommonScheduleBodySchema = import_zod12.z.object({
|
|
1374
1515
|
/** A unique id for the schedule. This is used to identify and unregister the schedule later. */
|
|
1375
|
-
id:
|
|
1516
|
+
id: import_zod12.z.string(),
|
|
1376
1517
|
/** Any additional metadata about the schedule. */
|
|
1377
|
-
metadata:
|
|
1518
|
+
metadata: import_zod12.z.any(),
|
|
1378
1519
|
/** An optional Account ID to associate with runs triggered by this schedule */
|
|
1379
|
-
accountId:
|
|
1520
|
+
accountId: import_zod12.z.string().optional()
|
|
1380
1521
|
});
|
|
1381
1522
|
var RegisterIntervalScheduleBodySchema = RegisterCommonScheduleBodySchema.merge(IntervalMetadataSchema);
|
|
1382
1523
|
var InitializeCronScheduleBodySchema = RegisterCommonScheduleBodySchema.merge(CronMetadataSchema);
|
|
1383
|
-
var RegisterScheduleBodySchema =
|
|
1524
|
+
var RegisterScheduleBodySchema = import_zod12.z.discriminatedUnion("type", [
|
|
1384
1525
|
RegisterIntervalScheduleBodySchema,
|
|
1385
1526
|
InitializeCronScheduleBodySchema
|
|
1386
1527
|
]);
|
|
1387
|
-
var RegisterScheduleResponseBodySchema =
|
|
1388
|
-
id:
|
|
1528
|
+
var RegisterScheduleResponseBodySchema = import_zod12.z.object({
|
|
1529
|
+
id: import_zod12.z.string(),
|
|
1389
1530
|
schedule: ScheduleMetadataSchema,
|
|
1390
|
-
metadata:
|
|
1391
|
-
active:
|
|
1531
|
+
metadata: import_zod12.z.any(),
|
|
1532
|
+
active: import_zod12.z.boolean()
|
|
1392
1533
|
});
|
|
1393
|
-
var CreateExternalConnectionBodySchema =
|
|
1394
|
-
accessToken:
|
|
1395
|
-
type:
|
|
1534
|
+
var CreateExternalConnectionBodySchema = import_zod12.z.object({
|
|
1535
|
+
accessToken: import_zod12.z.string(),
|
|
1536
|
+
type: import_zod12.z.enum([
|
|
1396
1537
|
"oauth2"
|
|
1397
1538
|
]),
|
|
1398
|
-
scopes:
|
|
1399
|
-
metadata:
|
|
1539
|
+
scopes: import_zod12.z.array(import_zod12.z.string()).optional(),
|
|
1540
|
+
metadata: import_zod12.z.any()
|
|
1400
1541
|
});
|
|
1401
|
-
var GetRunStatusesSchema =
|
|
1402
|
-
run:
|
|
1403
|
-
id:
|
|
1542
|
+
var GetRunStatusesSchema = import_zod12.z.object({
|
|
1543
|
+
run: import_zod12.z.object({
|
|
1544
|
+
id: import_zod12.z.string(),
|
|
1404
1545
|
status: RunStatusSchema,
|
|
1405
|
-
output:
|
|
1546
|
+
output: import_zod12.z.any().optional()
|
|
1406
1547
|
}),
|
|
1407
|
-
statuses:
|
|
1548
|
+
statuses: import_zod12.z.array(JobRunStatusRecordSchema)
|
|
1549
|
+
});
|
|
1550
|
+
var InvokeJobResponseSchema = import_zod12.z.object({
|
|
1551
|
+
id: import_zod12.z.string()
|
|
1552
|
+
});
|
|
1553
|
+
var InvokeJobRequestBodySchema = import_zod12.z.object({
|
|
1554
|
+
payload: import_zod12.z.any(),
|
|
1555
|
+
context: import_zod12.z.any().optional(),
|
|
1556
|
+
options: import_zod12.z.object({
|
|
1557
|
+
accountId: import_zod12.z.string().optional(),
|
|
1558
|
+
callbackUrl: import_zod12.z.string().optional()
|
|
1559
|
+
}).optional()
|
|
1560
|
+
});
|
|
1561
|
+
var InvokeOptionsSchema = import_zod12.z.object({
|
|
1562
|
+
accountId: import_zod12.z.string().optional(),
|
|
1563
|
+
idempotencyKey: import_zod12.z.string().optional(),
|
|
1564
|
+
context: import_zod12.z.any().optional(),
|
|
1565
|
+
callbackUrl: import_zod12.z.string().optional()
|
|
1408
1566
|
});
|
|
1409
1567
|
|
|
1410
1568
|
// src/schemas/notifications.ts
|
|
1411
|
-
var
|
|
1569
|
+
var import_zod13 = require("zod");
|
|
1412
1570
|
var MISSING_CONNECTION_NOTIFICATION = "dev.trigger.notifications.missingConnection";
|
|
1413
1571
|
var MISSING_CONNECTION_RESOLVED_NOTIFICATION = "dev.trigger.notifications.missingConnectionResolved";
|
|
1414
|
-
var CommonMissingConnectionNotificationPayloadSchema =
|
|
1415
|
-
id:
|
|
1416
|
-
client:
|
|
1417
|
-
id:
|
|
1418
|
-
title:
|
|
1419
|
-
scopes:
|
|
1420
|
-
createdAt:
|
|
1421
|
-
updatedAt:
|
|
1572
|
+
var CommonMissingConnectionNotificationPayloadSchema = import_zod13.z.object({
|
|
1573
|
+
id: import_zod13.z.string(),
|
|
1574
|
+
client: import_zod13.z.object({
|
|
1575
|
+
id: import_zod13.z.string(),
|
|
1576
|
+
title: import_zod13.z.string(),
|
|
1577
|
+
scopes: import_zod13.z.array(import_zod13.z.string()),
|
|
1578
|
+
createdAt: import_zod13.z.coerce.date(),
|
|
1579
|
+
updatedAt: import_zod13.z.coerce.date()
|
|
1422
1580
|
}),
|
|
1423
|
-
authorizationUrl:
|
|
1581
|
+
authorizationUrl: import_zod13.z.string()
|
|
1424
1582
|
});
|
|
1425
1583
|
var MissingDeveloperConnectionNotificationPayloadSchema = CommonMissingConnectionNotificationPayloadSchema.extend({
|
|
1426
|
-
type:
|
|
1584
|
+
type: import_zod13.z.literal("DEVELOPER")
|
|
1427
1585
|
});
|
|
1428
1586
|
var MissingExternalConnectionNotificationPayloadSchema = CommonMissingConnectionNotificationPayloadSchema.extend({
|
|
1429
|
-
type:
|
|
1430
|
-
account:
|
|
1431
|
-
id:
|
|
1432
|
-
metadata:
|
|
1587
|
+
type: import_zod13.z.literal("EXTERNAL"),
|
|
1588
|
+
account: import_zod13.z.object({
|
|
1589
|
+
id: import_zod13.z.string(),
|
|
1590
|
+
metadata: import_zod13.z.any()
|
|
1433
1591
|
})
|
|
1434
1592
|
});
|
|
1435
|
-
var MissingConnectionNotificationPayloadSchema =
|
|
1593
|
+
var MissingConnectionNotificationPayloadSchema = import_zod13.z.discriminatedUnion("type", [
|
|
1436
1594
|
MissingDeveloperConnectionNotificationPayloadSchema,
|
|
1437
1595
|
MissingExternalConnectionNotificationPayloadSchema
|
|
1438
1596
|
]);
|
|
1439
|
-
var CommonMissingConnectionNotificationResolvedPayloadSchema =
|
|
1440
|
-
id:
|
|
1441
|
-
client:
|
|
1442
|
-
id:
|
|
1443
|
-
title:
|
|
1444
|
-
scopes:
|
|
1445
|
-
createdAt:
|
|
1446
|
-
updatedAt:
|
|
1447
|
-
integrationIdentifier:
|
|
1448
|
-
integrationAuthMethod:
|
|
1597
|
+
var CommonMissingConnectionNotificationResolvedPayloadSchema = import_zod13.z.object({
|
|
1598
|
+
id: import_zod13.z.string(),
|
|
1599
|
+
client: import_zod13.z.object({
|
|
1600
|
+
id: import_zod13.z.string(),
|
|
1601
|
+
title: import_zod13.z.string(),
|
|
1602
|
+
scopes: import_zod13.z.array(import_zod13.z.string()),
|
|
1603
|
+
createdAt: import_zod13.z.coerce.date(),
|
|
1604
|
+
updatedAt: import_zod13.z.coerce.date(),
|
|
1605
|
+
integrationIdentifier: import_zod13.z.string(),
|
|
1606
|
+
integrationAuthMethod: import_zod13.z.string()
|
|
1449
1607
|
}),
|
|
1450
|
-
expiresAt:
|
|
1608
|
+
expiresAt: import_zod13.z.coerce.date()
|
|
1451
1609
|
});
|
|
1452
1610
|
var MissingDeveloperConnectionResolvedNotificationPayloadSchema = CommonMissingConnectionNotificationResolvedPayloadSchema.extend({
|
|
1453
|
-
type:
|
|
1611
|
+
type: import_zod13.z.literal("DEVELOPER")
|
|
1454
1612
|
});
|
|
1455
1613
|
var MissingExternalConnectionResolvedNotificationPayloadSchema = CommonMissingConnectionNotificationResolvedPayloadSchema.extend({
|
|
1456
|
-
type:
|
|
1457
|
-
account:
|
|
1458
|
-
id:
|
|
1459
|
-
metadata:
|
|
1614
|
+
type: import_zod13.z.literal("EXTERNAL"),
|
|
1615
|
+
account: import_zod13.z.object({
|
|
1616
|
+
id: import_zod13.z.string(),
|
|
1617
|
+
metadata: import_zod13.z.any()
|
|
1460
1618
|
})
|
|
1461
1619
|
});
|
|
1462
|
-
var MissingConnectionResolvedNotificationPayloadSchema =
|
|
1620
|
+
var MissingConnectionResolvedNotificationPayloadSchema = import_zod13.z.discriminatedUnion("type", [
|
|
1463
1621
|
MissingDeveloperConnectionResolvedNotificationPayloadSchema,
|
|
1464
1622
|
MissingExternalConnectionResolvedNotificationPayloadSchema
|
|
1465
1623
|
]);
|
|
1466
1624
|
|
|
1467
1625
|
// src/schemas/fetch.ts
|
|
1468
|
-
var
|
|
1469
|
-
var FetchRetryHeadersStrategySchema =
|
|
1626
|
+
var import_zod14 = require("zod");
|
|
1627
|
+
var FetchRetryHeadersStrategySchema = import_zod14.z.object({
|
|
1470
1628
|
/** The `headers` strategy retries the request using info from the response headers. */
|
|
1471
|
-
strategy:
|
|
1629
|
+
strategy: import_zod14.z.literal("headers"),
|
|
1472
1630
|
/** The header to use to determine the maximum number of times to retry the request. */
|
|
1473
|
-
limitHeader:
|
|
1631
|
+
limitHeader: import_zod14.z.string(),
|
|
1474
1632
|
/** The header to use to determine the number of remaining retries. */
|
|
1475
|
-
remainingHeader:
|
|
1633
|
+
remainingHeader: import_zod14.z.string(),
|
|
1476
1634
|
/** The header to use to determine the time when the number of remaining retries will be reset. */
|
|
1477
|
-
resetHeader:
|
|
1635
|
+
resetHeader: import_zod14.z.string()
|
|
1478
1636
|
});
|
|
1479
1637
|
var FetchRetryBackoffStrategySchema = RetryOptionsSchema.extend({
|
|
1480
1638
|
/** The `backoff` strategy retries the request with an exponential backoff. */
|
|
1481
|
-
strategy:
|
|
1639
|
+
strategy: import_zod14.z.literal("backoff")
|
|
1482
1640
|
});
|
|
1483
|
-
var FetchRetryStrategySchema =
|
|
1641
|
+
var FetchRetryStrategySchema = import_zod14.z.discriminatedUnion("strategy", [
|
|
1484
1642
|
FetchRetryHeadersStrategySchema,
|
|
1485
1643
|
FetchRetryBackoffStrategySchema
|
|
1486
1644
|
]);
|
|
1487
|
-
var FetchRequestInitSchema =
|
|
1645
|
+
var FetchRequestInitSchema = import_zod14.z.object({
|
|
1488
1646
|
/** The HTTP method to use for the request. */
|
|
1489
|
-
method:
|
|
1647
|
+
method: import_zod14.z.string().optional(),
|
|
1490
1648
|
/** Any headers to send with the request. Note that you can use [redactString](https://trigger.dev/docs/sdk/redactString) to prevent sensitive information from being stored (e.g. in the logs), like API keys and tokens. */
|
|
1491
|
-
headers:
|
|
1492
|
-
|
|
1649
|
+
headers: import_zod14.z.record(import_zod14.z.union([
|
|
1650
|
+
import_zod14.z.string(),
|
|
1493
1651
|
RedactStringSchema
|
|
1494
1652
|
])).optional(),
|
|
1495
1653
|
/** The body of the request. */
|
|
1496
|
-
body:
|
|
1497
|
-
|
|
1498
|
-
|
|
1654
|
+
body: import_zod14.z.union([
|
|
1655
|
+
import_zod14.z.string(),
|
|
1656
|
+
import_zod14.z.instanceof(ArrayBuffer)
|
|
1499
1657
|
]).optional()
|
|
1500
1658
|
});
|
|
1501
|
-
var FetchRetryOptionsSchema =
|
|
1502
|
-
var
|
|
1503
|
-
|
|
1659
|
+
var FetchRetryOptionsSchema = import_zod14.z.record(FetchRetryStrategySchema);
|
|
1660
|
+
var FetchTimeoutOptionsSchema = import_zod14.z.object({
|
|
1661
|
+
durationInMs: import_zod14.z.number(),
|
|
1662
|
+
retry: RetryOptionsSchema.optional()
|
|
1663
|
+
});
|
|
1664
|
+
var FetchOperationSchema = import_zod14.z.object({
|
|
1665
|
+
url: import_zod14.z.string(),
|
|
1504
1666
|
requestInit: FetchRequestInitSchema.optional(),
|
|
1505
|
-
retry:
|
|
1667
|
+
retry: import_zod14.z.record(FetchRetryStrategySchema).optional(),
|
|
1668
|
+
timeout: FetchTimeoutOptionsSchema.optional()
|
|
1506
1669
|
});
|
|
1507
1670
|
|
|
1508
1671
|
// src/schemas/events.ts
|
|
1509
|
-
var
|
|
1510
|
-
var GetEventSchema =
|
|
1672
|
+
var import_zod15 = require("zod");
|
|
1673
|
+
var GetEventSchema = import_zod15.z.object({
|
|
1511
1674
|
/** The event id */
|
|
1512
|
-
id:
|
|
1675
|
+
id: import_zod15.z.string(),
|
|
1513
1676
|
/** The event name */
|
|
1514
|
-
name:
|
|
1677
|
+
name: import_zod15.z.string(),
|
|
1515
1678
|
/** When the event was created */
|
|
1516
|
-
createdAt:
|
|
1679
|
+
createdAt: import_zod15.z.coerce.date(),
|
|
1517
1680
|
/** When the event was last updated */
|
|
1518
|
-
updatedAt:
|
|
1681
|
+
updatedAt: import_zod15.z.coerce.date(),
|
|
1519
1682
|
/** The runs that were triggered by the event */
|
|
1520
|
-
runs:
|
|
1683
|
+
runs: import_zod15.z.array(import_zod15.z.object({
|
|
1521
1684
|
/** The Run id */
|
|
1522
|
-
id:
|
|
1685
|
+
id: import_zod15.z.string(),
|
|
1523
1686
|
/** The Run status */
|
|
1524
1687
|
status: RunStatusSchema,
|
|
1525
1688
|
/** When the run started */
|
|
1526
|
-
startedAt:
|
|
1689
|
+
startedAt: import_zod15.z.coerce.date().optional().nullable(),
|
|
1527
1690
|
/** When the run completed */
|
|
1528
|
-
completedAt:
|
|
1691
|
+
completedAt: import_zod15.z.coerce.date().optional().nullable()
|
|
1529
1692
|
}))
|
|
1530
1693
|
});
|
|
1531
|
-
var CancelRunsForEventSchema =
|
|
1532
|
-
cancelledRunIds:
|
|
1533
|
-
failedToCancelRunIds:
|
|
1694
|
+
var CancelRunsForEventSchema = import_zod15.z.object({
|
|
1695
|
+
cancelledRunIds: import_zod15.z.array(import_zod15.z.string()),
|
|
1696
|
+
failedToCancelRunIds: import_zod15.z.array(import_zod15.z.string())
|
|
1697
|
+
});
|
|
1698
|
+
|
|
1699
|
+
// src/schemas/request.ts
|
|
1700
|
+
var import_zod16 = require("zod");
|
|
1701
|
+
var RequestWithRawBodySchema = import_zod16.z.object({
|
|
1702
|
+
url: import_zod16.z.string(),
|
|
1703
|
+
method: import_zod16.z.string(),
|
|
1704
|
+
headers: import_zod16.z.record(import_zod16.z.string()),
|
|
1705
|
+
rawBody: import_zod16.z.string()
|
|
1534
1706
|
});
|
|
1535
1707
|
|
|
1536
1708
|
// src/utils.ts
|
|
@@ -1617,6 +1789,13 @@ __name(urlWithSearchParams, "urlWithSearchParams");
|
|
|
1617
1789
|
|
|
1618
1790
|
// src/eventFilterMatches.ts
|
|
1619
1791
|
function eventFilterMatches(payload, filter) {
|
|
1792
|
+
if (payload === void 0 || payload === null) {
|
|
1793
|
+
if (Object.entries(filter).length === 0) {
|
|
1794
|
+
return true;
|
|
1795
|
+
} else {
|
|
1796
|
+
return false;
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1620
1799
|
for (const [patternKey, patternValue] of Object.entries(filter)) {
|
|
1621
1800
|
const payloadValue = payload[patternKey];
|
|
1622
1801
|
if (Array.isArray(patternValue)) {
|
|
@@ -1757,9 +1936,48 @@ function contentFilterMatches(actualValue, contentFilter) {
|
|
|
1757
1936
|
}
|
|
1758
1937
|
__name(contentFilterMatches, "contentFilterMatches");
|
|
1759
1938
|
|
|
1939
|
+
// src/requestFilterMatches.ts
|
|
1940
|
+
async function requestFilterMatches(request, filter) {
|
|
1941
|
+
const clonedRequest = request.clone();
|
|
1942
|
+
if (!requestMethodMatches(clonedRequest.method, filter.method)) {
|
|
1943
|
+
return false;
|
|
1944
|
+
}
|
|
1945
|
+
if (filter.headers && !eventFilterMatches(clonedRequest.headers, filter.headers)) {
|
|
1946
|
+
return false;
|
|
1947
|
+
}
|
|
1948
|
+
const searchParams = new URL(clonedRequest.url).searchParams;
|
|
1949
|
+
const searchParamsObject = {};
|
|
1950
|
+
for (const [key, value] of searchParams.entries()) {
|
|
1951
|
+
searchParamsObject[key] = value;
|
|
1952
|
+
}
|
|
1953
|
+
if (filter.query && !eventFilterMatches(searchParamsObject, filter.query)) {
|
|
1954
|
+
return false;
|
|
1955
|
+
}
|
|
1956
|
+
try {
|
|
1957
|
+
const json = await clonedRequest.json();
|
|
1958
|
+
if (filter.body && !eventFilterMatches(json, filter.body)) {
|
|
1959
|
+
return false;
|
|
1960
|
+
}
|
|
1961
|
+
} catch (e) {
|
|
1962
|
+
if (filter.body) {
|
|
1963
|
+
return false;
|
|
1964
|
+
}
|
|
1965
|
+
}
|
|
1966
|
+
return true;
|
|
1967
|
+
}
|
|
1968
|
+
__name(requestFilterMatches, "requestFilterMatches");
|
|
1969
|
+
function requestMethodMatches(method, filter) {
|
|
1970
|
+
if (!filter) {
|
|
1971
|
+
return true;
|
|
1972
|
+
}
|
|
1973
|
+
return filter.includes(method);
|
|
1974
|
+
}
|
|
1975
|
+
__name(requestMethodMatches, "requestMethodMatches");
|
|
1976
|
+
|
|
1760
1977
|
// src/index.ts
|
|
1761
1978
|
var API_VERSIONS = {
|
|
1762
|
-
LAZY_LOADED_CACHED_TASKS: "2023-09-29"
|
|
1979
|
+
LAZY_LOADED_CACHED_TASKS: "2023-09-29",
|
|
1980
|
+
SERIALIZED_TASK_OUTPUT: "2023-11-01"
|
|
1763
1981
|
};
|
|
1764
1982
|
var PLATFORM_FEATURES = {
|
|
1765
1983
|
yieldExecution: API_VERSIONS.LAZY_LOADED_CACHED_TASKS,
|