@trigger.dev/core 0.0.0-background-tasks-20230906212613 → 0.0.0-beta-20240327133444

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.js CHANGED
@@ -1,327 +1,10 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
- var __accessCheck = (obj, member, msg) => {
21
- if (!member.has(obj))
22
- throw TypeError("Cannot " + msg);
23
- };
24
- var __privateGet = (obj, member, getter) => {
25
- __accessCheck(obj, member, "read from private field");
26
- return getter ? getter.call(obj) : member.get(obj);
27
- };
28
- var __privateAdd = (obj, member, value) => {
29
- if (member.has(obj))
30
- throw TypeError("Cannot add the same private member more than once");
31
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
32
- };
33
- var __privateSet = (obj, member, value, setter) => {
34
- __accessCheck(obj, member, "write to private field");
35
- setter ? setter.call(obj, value) : member.set(obj, value);
36
- return value;
37
- };
38
- var __privateMethod = (obj, member, method) => {
39
- __accessCheck(obj, member, "access private method");
40
- return method;
41
- };
1
+ 'use strict';
42
2
 
43
- // src/index.ts
44
- var src_exports = {};
45
- __export(src_exports, {
46
- ApiEventLogSchema: () => ApiEventLogSchema,
47
- BackgroundTaskMetadataSchema: () => BackgroundTaskMetadataSchema,
48
- CachedTaskSchema: () => CachedTaskSchema,
49
- CommonMissingConnectionNotificationPayloadSchema: () => CommonMissingConnectionNotificationPayloadSchema,
50
- CommonMissingConnectionNotificationResolvedPayloadSchema: () => CommonMissingConnectionNotificationResolvedPayloadSchema,
51
- CompleteTaskBodyInputSchema: () => CompleteTaskBodyInputSchema,
52
- ConnectionAuthSchema: () => ConnectionAuthSchema,
53
- CreateExternalConnectionBodySchema: () => CreateExternalConnectionBodySchema,
54
- CreateRunResponseBodySchema: () => CreateRunResponseBodySchema,
55
- CronMetadataSchema: () => CronMetadataSchema,
56
- CronOptionsSchema: () => CronOptionsSchema,
57
- DeliverEventResponseSchema: () => DeliverEventResponseSchema,
58
- DeployBackgroundTaskRequestBodySchema: () => DeployBackgroundTaskRequestBodySchema,
59
- DeserializedJsonSchema: () => DeserializedJsonSchema,
60
- DisplayPropertiesSchema: () => DisplayPropertiesSchema,
61
- DisplayPropertySchema: () => DisplayPropertySchema,
62
- DynamicTriggerEndpointMetadataSchema: () => DynamicTriggerEndpointMetadataSchema,
63
- DynamicTriggerMetadataSchema: () => DynamicTriggerMetadataSchema,
64
- ErrorWithStackSchema: () => ErrorWithStackSchema,
65
- EventExampleSchema: () => EventExampleSchema,
66
- EventFilterSchema: () => EventFilterSchema,
67
- EventRuleSchema: () => EventRuleSchema,
68
- EventSpecificationSchema: () => EventSpecificationSchema,
69
- FailTaskBodyInputSchema: () => FailTaskBodyInputSchema,
70
- FetchOperationSchema: () => FetchOperationSchema,
71
- FetchRequestInitSchema: () => FetchRequestInitSchema,
72
- FetchRetryBackoffStrategySchema: () => FetchRetryBackoffStrategySchema,
73
- FetchRetryHeadersStrategySchema: () => FetchRetryHeadersStrategySchema,
74
- FetchRetryOptionsSchema: () => FetchRetryOptionsSchema,
75
- FetchRetryStrategySchema: () => FetchRetryStrategySchema,
76
- GetEventSchema: () => GetEventSchema,
77
- GetRunSchema: () => GetRunSchema,
78
- GetRunsSchema: () => GetRunsSchema,
79
- HandleTriggerSourceSchema: () => HandleTriggerSourceSchema,
80
- HttpSourceRequestHeadersSchema: () => HttpSourceRequestHeadersSchema,
81
- HttpSourceRequestSchema: () => HttpSourceRequestSchema,
82
- HttpSourceResponseSchema: () => HttpSourceResponseSchema,
83
- IndexEndpointResponseSchema: () => IndexEndpointResponseSchema,
84
- InitializeCronScheduleBodySchema: () => InitializeCronScheduleBodySchema,
85
- InitializeTriggerBodySchema: () => InitializeTriggerBodySchema,
86
- IntegrationConfigSchema: () => IntegrationConfigSchema,
87
- IntegrationMetadataSchema: () => IntegrationMetadataSchema,
88
- IntervalMetadataSchema: () => IntervalMetadataSchema,
89
- IntervalOptionsSchema: () => IntervalOptionsSchema,
90
- JobMetadataSchema: () => JobMetadataSchema,
91
- LogMessageSchema: () => LogMessageSchema,
92
- Logger: () => Logger,
93
- MISSING_CONNECTION_NOTIFICATION: () => MISSING_CONNECTION_NOTIFICATION,
94
- MISSING_CONNECTION_RESOLVED_NOTIFICATION: () => MISSING_CONNECTION_RESOLVED_NOTIFICATION,
95
- MissingConnectionNotificationPayloadSchema: () => MissingConnectionNotificationPayloadSchema,
96
- MissingConnectionResolvedNotificationPayloadSchema: () => MissingConnectionResolvedNotificationPayloadSchema,
97
- MissingDeveloperConnectionNotificationPayloadSchema: () => MissingDeveloperConnectionNotificationPayloadSchema,
98
- MissingDeveloperConnectionResolvedNotificationPayloadSchema: () => MissingDeveloperConnectionResolvedNotificationPayloadSchema,
99
- MissingExternalConnectionNotificationPayloadSchema: () => MissingExternalConnectionNotificationPayloadSchema,
100
- MissingExternalConnectionResolvedNotificationPayloadSchema: () => MissingExternalConnectionResolvedNotificationPayloadSchema,
101
- NormalizedRequestSchema: () => NormalizedRequestSchema,
102
- NormalizedResponseSchema: () => NormalizedResponseSchema,
103
- PongErrorResponseSchema: () => PongErrorResponseSchema,
104
- PongResponseSchema: () => PongResponseSchema,
105
- PongSuccessResponseSchema: () => PongSuccessResponseSchema,
106
- PreprocessRunBodySchema: () => PreprocessRunBodySchema,
107
- PreprocessRunResponseSchema: () => PreprocessRunResponseSchema,
108
- QueueOptionsSchema: () => QueueOptionsSchema,
109
- REGISTER_SOURCE_EVENT_V1: () => REGISTER_SOURCE_EVENT_V1,
110
- REGISTER_SOURCE_EVENT_V2: () => REGISTER_SOURCE_EVENT_V2,
111
- RawEventSchema: () => RawEventSchema,
112
- RedactSchema: () => RedactSchema,
113
- RedactStringSchema: () => RedactStringSchema,
114
- RegisterDynamicSchedulePayloadSchema: () => RegisterDynamicSchedulePayloadSchema,
115
- RegisterHTTPTriggerSourceBodySchema: () => RegisterHTTPTriggerSourceBodySchema,
116
- RegisterIntervalScheduleBodySchema: () => RegisterIntervalScheduleBodySchema,
117
- RegisterSMTPTriggerSourceBodySchema: () => RegisterSMTPTriggerSourceBodySchema,
118
- RegisterSQSTriggerSourceBodySchema: () => RegisterSQSTriggerSourceBodySchema,
119
- RegisterScheduleBodySchema: () => RegisterScheduleBodySchema,
120
- RegisterScheduleResponseBodySchema: () => RegisterScheduleResponseBodySchema,
121
- RegisterSourceChannelBodySchema: () => RegisterSourceChannelBodySchema,
122
- RegisterSourceEventSchemaV1: () => RegisterSourceEventSchemaV1,
123
- RegisterSourceEventSchemaV2: () => RegisterSourceEventSchemaV2,
124
- RegisterTriggerBodySchemaV1: () => RegisterTriggerBodySchemaV1,
125
- RegisterTriggerBodySchemaV2: () => RegisterTriggerBodySchemaV2,
126
- RegisterTriggerSourceSchema: () => RegisterTriggerSourceSchema,
127
- RetryOptionsSchema: () => RetryOptionsSchema,
128
- RunJobBodySchema: () => RunJobBodySchema,
129
- RunJobCanceledWithTaskSchema: () => RunJobCanceledWithTaskSchema,
130
- RunJobErrorSchema: () => RunJobErrorSchema,
131
- RunJobResponseSchema: () => RunJobResponseSchema,
132
- RunJobResumeWithTaskSchema: () => RunJobResumeWithTaskSchema,
133
- RunJobRetryWithTaskSchema: () => RunJobRetryWithTaskSchema,
134
- RunJobSuccessSchema: () => RunJobSuccessSchema,
135
- RunSourceContextSchema: () => RunSourceContextSchema,
136
- RunStatusSchema: () => RunStatusSchema,
137
- RunTaskBodyInputSchema: () => RunTaskBodyInputSchema,
138
- RunTaskBodyOutputSchema: () => RunTaskBodyOutputSchema,
139
- RunTaskOptionsSchema: () => RunTaskOptionsSchema,
140
- RunTaskSchema: () => RunTaskSchema,
141
- RuntimeEnvironmentTypeSchema: () => RuntimeEnvironmentTypeSchema,
142
- SCHEDULED_EVENT: () => SCHEDULED_EVENT,
143
- ScheduleMetadataSchema: () => ScheduleMetadataSchema,
144
- ScheduledPayloadSchema: () => ScheduledPayloadSchema,
145
- ScheduledTriggerMetadataSchema: () => ScheduledTriggerMetadataSchema,
146
- SendEventBodySchema: () => SendEventBodySchema,
147
- SendEventOptionsSchema: () => SendEventOptionsSchema,
148
- SerializableJsonSchema: () => SerializableJsonSchema,
149
- ServerTaskSchema: () => ServerTaskSchema,
150
- SourceMetadataV2Schema: () => SourceMetadataV2Schema,
151
- StaticTriggerMetadataSchema: () => StaticTriggerMetadataSchema,
152
- StyleSchema: () => StyleSchema,
153
- TaskSchema: () => TaskSchema,
154
- TaskStatusSchema: () => TaskStatusSchema,
155
- TriggerMetadataSchema: () => TriggerMetadataSchema,
156
- TriggerSourceSchema: () => TriggerSourceSchema,
157
- UpdateTriggerSourceBodyV1Schema: () => UpdateTriggerSourceBodyV1Schema,
158
- UpdateTriggerSourceBodyV2Schema: () => UpdateTriggerSourceBodyV2Schema,
159
- ValidateErrorResponseSchema: () => ValidateErrorResponseSchema,
160
- ValidateResponseSchema: () => ValidateResponseSchema,
161
- ValidateSuccessResponseSchema: () => ValidateSuccessResponseSchema,
162
- addMissingVersionField: () => addMissingVersionField,
163
- calculateRetryAt: () => calculateRetryAt,
164
- currentDate: () => currentDate,
165
- currentTimestampMilliseconds: () => currentTimestampMilliseconds,
166
- currentTimestampSeconds: () => currentTimestampSeconds,
167
- deepMergeFilters: () => deepMergeFilters,
168
- eventFilterMatches: () => eventFilterMatches,
169
- replacements: () => replacements,
170
- urlWithSearchParams: () => urlWithSearchParams
171
- });
172
- module.exports = __toCommonJS(src_exports);
173
-
174
- // src/logger.ts
175
- var logLevels = [
176
- "log",
177
- "error",
178
- "warn",
179
- "info",
180
- "debug"
181
- ];
182
- var _name, _level, _filteredKeys, _jsonReplacer, _structuredLog, structuredLog_fn;
183
- var _Logger = class _Logger {
184
- constructor(name, level = "info", filteredKeys = [], jsonReplacer) {
185
- __privateAdd(this, _structuredLog);
186
- __privateAdd(this, _name, void 0);
187
- __privateAdd(this, _level, void 0);
188
- __privateAdd(this, _filteredKeys, []);
189
- __privateAdd(this, _jsonReplacer, void 0);
190
- __privateSet(this, _name, name);
191
- __privateSet(this, _level, logLevels.indexOf(process.env.TRIGGER_LOG_LEVEL ?? level));
192
- __privateSet(this, _filteredKeys, filteredKeys);
193
- __privateSet(this, _jsonReplacer, jsonReplacer);
194
- }
195
- // Return a new Logger instance with the same name and a new log level
196
- // but filter out the keys from the log messages (at any level)
197
- filter(...keys) {
198
- return new _Logger(__privateGet(this, _name), logLevels[__privateGet(this, _level)], keys, __privateGet(this, _jsonReplacer));
199
- }
200
- static satisfiesLogLevel(logLevel, setLevel) {
201
- return logLevels.indexOf(logLevel) <= logLevels.indexOf(setLevel);
202
- }
203
- log(message, ...args) {
204
- if (__privateGet(this, _level) < 0)
205
- return;
206
- __privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.log, message, ...args);
207
- }
208
- error(message, ...args) {
209
- if (__privateGet(this, _level) < 1)
210
- return;
211
- __privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.error, message, ...args);
212
- }
213
- warn(message, ...args) {
214
- if (__privateGet(this, _level) < 2)
215
- return;
216
- __privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.warn, message, ...args);
217
- }
218
- info(message, ...args) {
219
- if (__privateGet(this, _level) < 3)
220
- return;
221
- __privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.info, message, ...args);
222
- }
223
- debug(message, ...args) {
224
- if (__privateGet(this, _level) < 4)
225
- return;
226
- __privateMethod(this, _structuredLog, structuredLog_fn).call(this, console.debug, message, ...args);
227
- }
228
- };
229
- _name = new WeakMap();
230
- _level = new WeakMap();
231
- _filteredKeys = new WeakMap();
232
- _jsonReplacer = new WeakMap();
233
- _structuredLog = new WeakSet();
234
- structuredLog_fn = /* @__PURE__ */ __name(function(loggerFunction, message, ...args) {
235
- const structuredLog = {
236
- ...structureArgs(safeJsonClone(args), __privateGet(this, _filteredKeys)),
237
- timestamp: /* @__PURE__ */ new Date(),
238
- name: __privateGet(this, _name),
239
- message
240
- };
241
- loggerFunction(JSON.stringify(structuredLog, createReplacer(__privateGet(this, _jsonReplacer))));
242
- }, "#structuredLog");
243
- __name(_Logger, "Logger");
244
- var Logger = _Logger;
245
- function createReplacer(replacer) {
246
- return (key, value) => {
247
- if (typeof value === "bigint") {
248
- return value.toString();
249
- }
250
- if (replacer) {
251
- return replacer(key, value);
252
- }
253
- return value;
254
- };
255
- }
256
- __name(createReplacer, "createReplacer");
257
- function bigIntReplacer(_key, value) {
258
- if (typeof value === "bigint") {
259
- return value.toString();
260
- }
261
- return value;
262
- }
263
- __name(bigIntReplacer, "bigIntReplacer");
264
- function safeJsonClone(obj) {
265
- try {
266
- return JSON.parse(JSON.stringify(obj, bigIntReplacer));
267
- } catch (e) {
268
- return obj;
269
- }
270
- }
271
- __name(safeJsonClone, "safeJsonClone");
272
- function structureArgs(args, filteredKeys = []) {
273
- if (args.length === 0) {
274
- return;
275
- }
276
- if (args.length === 1 && typeof args[0] === "object") {
277
- return filterKeys(JSON.parse(JSON.stringify(args[0], bigIntReplacer)), filteredKeys);
278
- }
279
- return args;
280
- }
281
- __name(structureArgs, "structureArgs");
282
- function filterKeys(obj, keys) {
283
- if (typeof obj !== "object" || obj === null) {
284
- return obj;
285
- }
286
- if (Array.isArray(obj)) {
287
- return obj.map((item) => filterKeys(item, keys));
288
- }
289
- const filteredObj = {};
290
- for (const [key, value] of Object.entries(obj)) {
291
- if (keys.includes(key)) {
292
- if (value) {
293
- filteredObj[key] = `[filtered ${prettyPrintBytes(value)}]`;
294
- } else {
295
- filteredObj[key] = value;
296
- }
297
- continue;
298
- }
299
- filteredObj[key] = filterKeys(value, keys);
300
- }
301
- return filteredObj;
302
- }
303
- __name(filterKeys, "filterKeys");
304
- function prettyPrintBytes(value) {
305
- if (process.env.NODE_ENV === "production") {
306
- return "skipped size";
307
- }
308
- const sizeInBytes = Buffer.byteLength(JSON.stringify(value), "utf8");
309
- if (sizeInBytes < 1024) {
310
- return `${sizeInBytes} bytes`;
311
- }
312
- if (sizeInBytes < 1024 * 1024) {
313
- return `${(sizeInBytes / 1024).toFixed(2)} KB`;
314
- }
315
- if (sizeInBytes < 1024 * 1024 * 1024) {
316
- return `${(sizeInBytes / (1024 * 1024)).toFixed(2)} MB`;
317
- }
318
- return `${(sizeInBytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;
319
- }
320
- __name(prettyPrintBytes, "prettyPrintBytes");
3
+ var ulidx = require('ulidx');
4
+ var zod = require('zod');
321
5
 
322
- // src/schemas/api.ts
323
- var import_ulid = require("ulid");
324
- var import_zod9 = require("zod");
6
+ var __defProp = Object.defineProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
325
8
 
326
9
  // src/schemas/addMissingVersionField.ts
327
10
  function addMissingVersionField(val) {
@@ -334,210 +17,211 @@ function addMissingVersionField(val) {
334
17
  return val;
335
18
  }
336
19
  __name(addMissingVersionField, "addMissingVersionField");
337
-
338
- // src/schemas/errors.ts
339
- var import_zod = require("zod");
340
- var ErrorWithStackSchema = import_zod.z.object({
341
- message: import_zod.z.string(),
342
- name: import_zod.z.string().optional(),
343
- stack: import_zod.z.string().optional()
344
- });
345
-
346
- // src/schemas/eventFilter.ts
347
- var import_zod2 = require("zod");
348
- var EventMatcherSchema = import_zod2.z.union([
20
+ var ErrorWithStackSchema = zod.z.object({
21
+ message: zod.z.string(),
22
+ name: zod.z.string().optional(),
23
+ stack: zod.z.string().optional()
24
+ });
25
+ var SchemaErrorSchema = zod.z.object({
26
+ path: zod.z.array(zod.z.string()),
27
+ message: zod.z.string()
28
+ });
29
+ var stringPatternMatchers = [
30
+ zod.z.object({
31
+ $endsWith: zod.z.string()
32
+ }),
33
+ zod.z.object({
34
+ $startsWith: zod.z.string()
35
+ }),
36
+ zod.z.object({
37
+ $ignoreCaseEquals: zod.z.string()
38
+ })
39
+ ];
40
+ var EventMatcherSchema = zod.z.union([
349
41
  /** Match against a string */
350
- import_zod2.z.array(import_zod2.z.string()),
42
+ zod.z.array(zod.z.string()),
351
43
  /** Match against a number */
352
- import_zod2.z.array(import_zod2.z.number()),
44
+ zod.z.array(zod.z.number()),
353
45
  /** Match against a boolean */
354
- import_zod2.z.array(import_zod2.z.boolean()),
355
- import_zod2.z.array(import_zod2.z.union([
356
- import_zod2.z.object({
357
- $endsWith: import_zod2.z.string()
358
- }),
359
- import_zod2.z.object({
360
- $startsWith: import_zod2.z.string()
361
- }),
362
- import_zod2.z.object({
363
- $exists: import_zod2.z.boolean()
46
+ zod.z.array(zod.z.boolean()),
47
+ zod.z.array(zod.z.union([
48
+ ...stringPatternMatchers,
49
+ zod.z.object({
50
+ $exists: zod.z.boolean()
364
51
  }),
365
- import_zod2.z.object({
366
- $isNull: import_zod2.z.boolean()
52
+ zod.z.object({
53
+ $isNull: zod.z.boolean()
367
54
  }),
368
- import_zod2.z.object({
369
- $anythingBut: import_zod2.z.union([
370
- import_zod2.z.string(),
371
- import_zod2.z.number(),
372
- import_zod2.z.boolean()
55
+ zod.z.object({
56
+ $anythingBut: zod.z.union([
57
+ zod.z.string(),
58
+ zod.z.number(),
59
+ zod.z.boolean()
373
60
  ])
374
61
  }),
375
- import_zod2.z.object({
376
- $anythingBut: import_zod2.z.union([
377
- import_zod2.z.array(import_zod2.z.string()),
378
- import_zod2.z.array(import_zod2.z.number()),
379
- import_zod2.z.array(import_zod2.z.boolean())
62
+ zod.z.object({
63
+ $anythingBut: zod.z.union([
64
+ zod.z.array(zod.z.string()),
65
+ zod.z.array(zod.z.number()),
66
+ zod.z.array(zod.z.boolean())
380
67
  ])
381
68
  }),
382
- import_zod2.z.object({
383
- $gt: import_zod2.z.number()
69
+ zod.z.object({
70
+ $gt: zod.z.number()
384
71
  }),
385
- import_zod2.z.object({
386
- $lt: import_zod2.z.number()
72
+ zod.z.object({
73
+ $lt: zod.z.number()
387
74
  }),
388
- import_zod2.z.object({
389
- $gte: import_zod2.z.number()
75
+ zod.z.object({
76
+ $gte: zod.z.number()
390
77
  }),
391
- import_zod2.z.object({
392
- $lte: import_zod2.z.number()
78
+ zod.z.object({
79
+ $lte: zod.z.number()
393
80
  }),
394
- import_zod2.z.object({
395
- $between: import_zod2.z.tuple([
396
- import_zod2.z.number(),
397
- import_zod2.z.number()
81
+ zod.z.object({
82
+ $between: zod.z.tuple([
83
+ zod.z.number(),
84
+ zod.z.number()
398
85
  ])
399
86
  }),
400
- import_zod2.z.object({
401
- $includes: import_zod2.z.union([
402
- import_zod2.z.string(),
403
- import_zod2.z.number(),
404
- import_zod2.z.boolean()
87
+ zod.z.object({
88
+ $includes: zod.z.union([
89
+ zod.z.string(),
90
+ zod.z.number(),
91
+ zod.z.boolean()
405
92
  ])
406
93
  }),
407
- import_zod2.z.object({
408
- $ignoreCaseEquals: import_zod2.z.string()
94
+ zod.z.object({
95
+ $not: zod.z.union([
96
+ zod.z.string(),
97
+ zod.z.number(),
98
+ zod.z.boolean()
99
+ ])
409
100
  })
410
101
  ]))
411
102
  ]);
412
- var EventFilterSchema = import_zod2.z.lazy(() => import_zod2.z.record(import_zod2.z.union([
103
+ var EventFilterSchema = zod.z.lazy(() => zod.z.record(zod.z.union([
413
104
  EventMatcherSchema,
414
105
  EventFilterSchema
415
106
  ])));
416
- var EventRuleSchema = import_zod2.z.object({
417
- event: import_zod2.z.string().or(import_zod2.z.array(import_zod2.z.string())),
418
- source: import_zod2.z.string(),
107
+ var EventRuleSchema = zod.z.object({
108
+ event: zod.z.string().or(zod.z.array(zod.z.string())),
109
+ source: zod.z.string(),
419
110
  payload: EventFilterSchema.optional(),
420
111
  context: EventFilterSchema.optional()
421
112
  });
422
-
423
- // src/schemas/integrations.ts
424
- var import_zod3 = require("zod");
425
- var ConnectionAuthSchema = import_zod3.z.object({
426
- type: import_zod3.z.enum([
427
- "oauth2"
113
+ var ConnectionAuthSchema = zod.z.object({
114
+ type: zod.z.enum([
115
+ "oauth2",
116
+ "apiKey"
428
117
  ]),
429
- accessToken: import_zod3.z.string(),
430
- scopes: import_zod3.z.array(import_zod3.z.string()).optional(),
431
- additionalFields: import_zod3.z.record(import_zod3.z.string()).optional()
118
+ accessToken: zod.z.string(),
119
+ scopes: zod.z.array(zod.z.string()).optional(),
120
+ additionalFields: zod.z.record(zod.z.string()).optional()
432
121
  });
433
- var IntegrationMetadataSchema = import_zod3.z.object({
434
- id: import_zod3.z.string(),
435
- name: import_zod3.z.string(),
436
- instructions: import_zod3.z.string().optional()
122
+ var IntegrationMetadataSchema = zod.z.object({
123
+ id: zod.z.string(),
124
+ name: zod.z.string(),
125
+ instructions: zod.z.string().optional()
437
126
  });
438
- var IntegrationConfigSchema = import_zod3.z.object({
439
- id: import_zod3.z.string(),
127
+ var IntegrationConfigSchema = zod.z.object({
128
+ id: zod.z.string(),
440
129
  metadata: IntegrationMetadataSchema,
441
- authSource: import_zod3.z.enum([
130
+ authSource: zod.z.enum([
442
131
  "HOSTED",
443
- "LOCAL"
132
+ "LOCAL",
133
+ "RESOLVER"
444
134
  ])
445
135
  });
446
-
447
- // src/schemas/json.ts
448
- var import_zod4 = require("zod");
449
- var LiteralSchema = import_zod4.z.union([
450
- import_zod4.z.string(),
451
- import_zod4.z.number(),
452
- import_zod4.z.boolean(),
453
- import_zod4.z.null()
136
+ var LiteralSchema = zod.z.union([
137
+ zod.z.string(),
138
+ zod.z.number(),
139
+ zod.z.boolean(),
140
+ zod.z.null()
454
141
  ]);
455
- var DeserializedJsonSchema = import_zod4.z.lazy(() => import_zod4.z.union([
142
+ var DeserializedJsonSchema = zod.z.lazy(() => zod.z.union([
456
143
  LiteralSchema,
457
- import_zod4.z.array(DeserializedJsonSchema),
458
- import_zod4.z.record(DeserializedJsonSchema)
144
+ zod.z.array(DeserializedJsonSchema),
145
+ zod.z.record(DeserializedJsonSchema)
459
146
  ]));
460
- var SerializableSchema = import_zod4.z.union([
461
- import_zod4.z.string(),
462
- import_zod4.z.number(),
463
- import_zod4.z.boolean(),
464
- import_zod4.z.null(),
465
- import_zod4.z.date(),
466
- import_zod4.z.undefined(),
467
- import_zod4.z.symbol()
147
+ var SerializableSchema = zod.z.union([
148
+ zod.z.string(),
149
+ zod.z.number(),
150
+ zod.z.boolean(),
151
+ zod.z.null(),
152
+ zod.z.date(),
153
+ zod.z.undefined(),
154
+ zod.z.symbol()
468
155
  ]);
469
- var SerializableJsonSchema = import_zod4.z.lazy(() => import_zod4.z.union([
156
+ var SerializableJsonSchema = zod.z.lazy(() => zod.z.union([
470
157
  SerializableSchema,
471
- import_zod4.z.array(SerializableJsonSchema),
472
- import_zod4.z.record(SerializableJsonSchema)
158
+ zod.z.array(SerializableJsonSchema),
159
+ zod.z.record(SerializableJsonSchema)
473
160
  ]));
474
-
475
- // src/schemas/properties.ts
476
- var import_zod5 = require("zod");
477
- var DisplayPropertySchema = import_zod5.z.object({
161
+ var DisplayPropertySchema = zod.z.object({
478
162
  /** The label for the property */
479
- label: import_zod5.z.string(),
163
+ label: zod.z.string(),
480
164
  /** The value of the property */
481
- text: import_zod5.z.string(),
165
+ text: zod.z.string(),
482
166
  /** The URL to link to when the property is clicked */
483
- url: import_zod5.z.string().optional()
167
+ url: zod.z.string().optional(),
168
+ /** The URL to a list of images to display next to the property */
169
+ imageUrl: zod.z.array(zod.z.string()).optional()
484
170
  });
485
- var DisplayPropertiesSchema = import_zod5.z.array(DisplayPropertySchema);
486
- var StyleSchema = import_zod5.z.object({
171
+ var DisplayPropertiesSchema = zod.z.array(DisplayPropertySchema);
172
+ var StyleSchema = zod.z.object({
487
173
  /** The style, `normal` or `minimal` */
488
- style: import_zod5.z.enum([
174
+ style: zod.z.enum([
489
175
  "normal",
490
176
  "minimal"
491
177
  ]),
492
178
  /** A variant of the style. */
493
- variant: import_zod5.z.string().optional()
179
+ variant: zod.z.string().optional()
494
180
  });
495
-
496
- // src/schemas/schedules.ts
497
- var import_zod6 = require("zod");
498
181
  var SCHEDULED_EVENT = "dev.trigger.scheduled";
499
- var ScheduledPayloadSchema = import_zod6.z.object({
500
- ts: import_zod6.z.coerce.date(),
501
- lastTimestamp: import_zod6.z.coerce.date().optional()
182
+ var ScheduledPayloadSchema = zod.z.object({
183
+ ts: zod.z.coerce.date(),
184
+ lastTimestamp: zod.z.coerce.date().optional()
502
185
  });
503
- var IntervalOptionsSchema = import_zod6.z.object({
504
- /** The number of seconds for the interval. Min = 60, Max = 86400 (1 day) */
505
- seconds: import_zod6.z.number().int().positive().min(60).max(86400)
186
+ var IntervalOptionsSchema = zod.z.object({
187
+ /** The number of seconds for the interval. Min = 20, Max = 2_592_000 (30 days) */
188
+ seconds: zod.z.number().int().positive().min(20).max(2592e3)
506
189
  });
507
- var CronOptionsSchema = import_zod6.z.object({
190
+ var CronOptionsSchema = zod.z.object({
508
191
  /** A CRON expression that defines the schedule. A useful tool when writing CRON
509
192
  expressions is [crontab guru](https://crontab.guru). Note that the timezone
510
193
  used is UTC. */
511
- cron: import_zod6.z.string()
194
+ cron: zod.z.string()
512
195
  });
513
- var CronMetadataSchema = import_zod6.z.object({
514
- type: import_zod6.z.literal("cron"),
196
+ var CronMetadataSchema = zod.z.object({
197
+ type: zod.z.literal("cron"),
515
198
  options: CronOptionsSchema,
516
- metadata: import_zod6.z.any()
199
+ /** An optional Account ID to associate with runs triggered by this interval */
200
+ accountId: zod.z.string().optional(),
201
+ metadata: zod.z.any()
517
202
  });
518
- var IntervalMetadataSchema = import_zod6.z.object({
203
+ var IntervalMetadataSchema = zod.z.object({
519
204
  /** An interval reoccurs at the specified number of seconds */
520
- type: import_zod6.z.literal("interval"),
205
+ type: zod.z.literal("interval"),
521
206
  /** An object containing options about the interval. */
522
207
  options: IntervalOptionsSchema,
208
+ /** An optional Account ID to associate with runs triggered by this interval */
209
+ accountId: zod.z.string().optional(),
523
210
  /** Any additional metadata about the schedule. */
524
- metadata: import_zod6.z.any()
211
+ metadata: zod.z.any()
525
212
  });
526
- var ScheduleMetadataSchema = import_zod6.z.discriminatedUnion("type", [
213
+ var ScheduleMetadataSchema = zod.z.discriminatedUnion("type", [
527
214
  IntervalMetadataSchema,
528
215
  CronMetadataSchema
529
216
  ]);
530
- var RegisterDynamicSchedulePayloadSchema = import_zod6.z.object({
531
- id: import_zod6.z.string(),
532
- jobs: import_zod6.z.array(import_zod6.z.object({
533
- id: import_zod6.z.string(),
534
- version: import_zod6.z.string()
217
+ var RegisterDynamicSchedulePayloadSchema = zod.z.object({
218
+ id: zod.z.string(),
219
+ jobs: zod.z.array(zod.z.object({
220
+ id: zod.z.string(),
221
+ version: zod.z.string()
535
222
  }))
536
223
  });
537
-
538
- // src/schemas/tasks.ts
539
- var import_zod7 = require("zod");
540
- var TaskStatusSchema = import_zod7.z.enum([
224
+ var TaskStatusSchema = zod.z.enum([
541
225
  "PENDING",
542
226
  "WAITING",
543
227
  "RUNNING",
@@ -545,543 +229,937 @@ var TaskStatusSchema = import_zod7.z.enum([
545
229
  "ERRORED",
546
230
  "CANCELED"
547
231
  ]);
548
- var TaskSchema = import_zod7.z.object({
549
- id: import_zod7.z.string(),
550
- name: import_zod7.z.string(),
551
- icon: import_zod7.z.string().optional().nullable(),
552
- noop: import_zod7.z.boolean(),
553
- startedAt: import_zod7.z.coerce.date().optional().nullable(),
554
- completedAt: import_zod7.z.coerce.date().optional().nullable(),
555
- delayUntil: import_zod7.z.coerce.date().optional().nullable(),
232
+ var TaskSchema = zod.z.object({
233
+ id: zod.z.string(),
234
+ name: zod.z.string(),
235
+ icon: zod.z.string().optional().nullable(),
236
+ noop: zod.z.boolean(),
237
+ startedAt: zod.z.coerce.date().optional().nullable(),
238
+ completedAt: zod.z.coerce.date().optional().nullable(),
239
+ delayUntil: zod.z.coerce.date().optional().nullable(),
556
240
  status: TaskStatusSchema,
557
- description: import_zod7.z.string().optional().nullable(),
558
- properties: import_zod7.z.array(DisplayPropertySchema).optional().nullable(),
559
- outputProperties: import_zod7.z.array(DisplayPropertySchema).optional().nullable(),
241
+ description: zod.z.string().optional().nullable(),
242
+ properties: zod.z.array(DisplayPropertySchema).optional().nullable(),
243
+ outputProperties: zod.z.array(DisplayPropertySchema).optional().nullable(),
560
244
  params: DeserializedJsonSchema.optional().nullable(),
561
245
  output: DeserializedJsonSchema.optional().nullable(),
562
- error: import_zod7.z.string().optional().nullable(),
563
- parentId: import_zod7.z.string().optional().nullable(),
246
+ context: DeserializedJsonSchema.optional().nullable(),
247
+ error: zod.z.string().optional().nullable(),
248
+ parentId: zod.z.string().optional().nullable(),
564
249
  style: StyleSchema.optional().nullable(),
565
- operation: import_zod7.z.string().optional().nullable()
250
+ operation: zod.z.string().optional().nullable(),
251
+ callbackUrl: zod.z.string().optional().nullable(),
252
+ childExecutionMode: zod.z.enum([
253
+ "SEQUENTIAL",
254
+ "PARALLEL"
255
+ ]).optional().nullable()
566
256
  });
567
257
  var ServerTaskSchema = TaskSchema.extend({
568
- idempotencyKey: import_zod7.z.string(),
569
- attempts: import_zod7.z.number()
258
+ idempotencyKey: zod.z.string(),
259
+ attempts: zod.z.number(),
260
+ forceYield: zod.z.boolean().optional().nullable()
570
261
  });
571
- var CachedTaskSchema = import_zod7.z.object({
572
- id: import_zod7.z.string(),
573
- idempotencyKey: import_zod7.z.string(),
262
+ var CachedTaskSchema = zod.z.object({
263
+ id: zod.z.string(),
264
+ idempotencyKey: zod.z.string(),
574
265
  status: TaskStatusSchema,
575
- noop: import_zod7.z.boolean().default(false),
266
+ noop: zod.z.boolean().default(false),
576
267
  output: DeserializedJsonSchema.optional().nullable(),
577
- parentId: import_zod7.z.string().optional().nullable()
578
- });
579
-
580
- // src/schemas/triggers.ts
581
- var import_zod8 = require("zod");
582
- var EventExampleSchema = import_zod8.z.object({
583
- id: import_zod8.z.string(),
584
- icon: import_zod8.z.string().optional(),
585
- name: import_zod8.z.string(),
586
- payload: import_zod8.z.any()
587
- });
588
- var EventSpecificationSchema = import_zod8.z.object({
589
- name: import_zod8.z.string().or(import_zod8.z.array(import_zod8.z.string())),
590
- title: import_zod8.z.string(),
591
- source: import_zod8.z.string(),
592
- icon: import_zod8.z.string(),
268
+ parentId: zod.z.string().optional().nullable()
269
+ });
270
+ var EventExampleSchema = zod.z.object({
271
+ id: zod.z.string(),
272
+ icon: zod.z.string().optional(),
273
+ name: zod.z.string(),
274
+ payload: zod.z.any()
275
+ });
276
+ var EventSpecificationSchema = zod.z.object({
277
+ name: zod.z.string().or(zod.z.array(zod.z.string())),
278
+ title: zod.z.string(),
279
+ source: zod.z.string(),
280
+ icon: zod.z.string(),
593
281
  filter: EventFilterSchema.optional(),
594
- properties: import_zod8.z.array(DisplayPropertySchema).optional(),
595
- schema: import_zod8.z.any().optional(),
596
- examples: import_zod8.z.array(EventExampleSchema).optional()
597
- });
598
- var DynamicTriggerMetadataSchema = import_zod8.z.object({
599
- type: import_zod8.z.literal("dynamic"),
600
- id: import_zod8.z.string()
601
- });
602
- var StaticTriggerMetadataSchema = import_zod8.z.object({
603
- type: import_zod8.z.literal("static"),
604
- title: import_zod8.z.union([
605
- import_zod8.z.string(),
606
- import_zod8.z.array(import_zod8.z.string())
282
+ properties: zod.z.array(DisplayPropertySchema).optional(),
283
+ schema: zod.z.any().optional(),
284
+ examples: zod.z.array(EventExampleSchema).optional()
285
+ });
286
+ var DynamicTriggerMetadataSchema = zod.z.object({
287
+ type: zod.z.literal("dynamic"),
288
+ id: zod.z.string()
289
+ });
290
+ var TriggerHelpSchema = zod.z.object({
291
+ noRuns: zod.z.object({
292
+ text: zod.z.string(),
293
+ link: zod.z.string().optional()
294
+ }).optional()
295
+ });
296
+ var StaticTriggerMetadataSchema = zod.z.object({
297
+ type: zod.z.literal("static"),
298
+ title: zod.z.union([
299
+ zod.z.string(),
300
+ zod.z.array(zod.z.string())
607
301
  ]),
608
- properties: import_zod8.z.array(DisplayPropertySchema).optional(),
609
- rule: EventRuleSchema
302
+ properties: zod.z.array(DisplayPropertySchema).optional(),
303
+ rule: EventRuleSchema,
304
+ link: zod.z.string().optional(),
305
+ help: TriggerHelpSchema.optional()
306
+ });
307
+ var InvokeTriggerMetadataSchema = zod.z.object({
308
+ type: zod.z.literal("invoke")
610
309
  });
611
- var ScheduledTriggerMetadataSchema = import_zod8.z.object({
612
- type: import_zod8.z.literal("scheduled"),
310
+ var ScheduledTriggerMetadataSchema = zod.z.object({
311
+ type: zod.z.literal("scheduled"),
613
312
  schedule: ScheduleMetadataSchema
614
313
  });
615
- var TriggerMetadataSchema = import_zod8.z.discriminatedUnion("type", [
314
+ var TriggerMetadataSchema = zod.z.discriminatedUnion("type", [
616
315
  DynamicTriggerMetadataSchema,
617
316
  StaticTriggerMetadataSchema,
618
- ScheduledTriggerMetadataSchema
317
+ ScheduledTriggerMetadataSchema,
318
+ InvokeTriggerMetadataSchema
319
+ ]);
320
+ var StatusUpdateStateSchema = zod.z.union([
321
+ zod.z.literal("loading"),
322
+ zod.z.literal("success"),
323
+ zod.z.literal("failure")
324
+ ]);
325
+ var StatusUpdateDataSchema = zod.z.record(SerializableJsonSchema);
326
+ var StatusUpdateSchema = zod.z.object({
327
+ label: zod.z.string().optional(),
328
+ state: StatusUpdateStateSchema.optional(),
329
+ data: StatusUpdateDataSchema.optional()
330
+ });
331
+ var InitalStatusUpdateSchema = StatusUpdateSchema.required({
332
+ label: true
333
+ });
334
+ var StatusHistorySchema = zod.z.array(StatusUpdateSchema);
335
+ var JobRunStatusRecordSchema = InitalStatusUpdateSchema.extend({
336
+ key: zod.z.string(),
337
+ history: StatusHistorySchema
338
+ });
339
+
340
+ // src/schemas/runs.ts
341
+ var RunStatusSchema = zod.z.union([
342
+ zod.z.literal("PENDING"),
343
+ zod.z.literal("QUEUED"),
344
+ zod.z.literal("WAITING_ON_CONNECTIONS"),
345
+ zod.z.literal("PREPROCESSING"),
346
+ zod.z.literal("STARTED"),
347
+ zod.z.literal("SUCCESS"),
348
+ zod.z.literal("FAILURE"),
349
+ zod.z.literal("TIMED_OUT"),
350
+ zod.z.literal("ABORTED"),
351
+ zod.z.literal("CANCELED"),
352
+ zod.z.literal("UNRESOLVED_AUTH"),
353
+ zod.z.literal("INVALID_PAYLOAD"),
354
+ zod.z.literal("EXECUTING"),
355
+ zod.z.literal("WAITING_TO_CONTINUE"),
356
+ zod.z.literal("WAITING_TO_EXECUTE")
357
+ ]);
358
+ var RunTaskSchema = zod.z.object({
359
+ /** The Task id */
360
+ id: zod.z.string(),
361
+ /** The key that you defined when creating the Task, the first param in any task. */
362
+ displayKey: zod.z.string().nullable(),
363
+ /** The Task status */
364
+ status: TaskStatusSchema,
365
+ /** The name of the Task */
366
+ name: zod.z.string(),
367
+ /** The icon of the Task, a string.
368
+ * For integrations, this will be a lowercase name of the company.
369
+ * Can be used with the [@trigger.dev/companyicons](https://www.npmjs.com/package/@trigger.dev/companyicons) package to display an svg. */
370
+ icon: zod.z.string().nullable(),
371
+ /** When the task started */
372
+ startedAt: zod.z.coerce.date().nullable(),
373
+ /** When the task completed */
374
+ completedAt: zod.z.coerce.date().nullable()
375
+ });
376
+ var RunTaskWithSubtasksSchema = RunTaskSchema.extend({
377
+ subtasks: zod.z.lazy(() => RunTaskWithSubtasksSchema.array()).optional()
378
+ });
379
+ var GetRunOptionsSchema = zod.z.object({
380
+ /** Return subtasks, which appear in a `subtasks` array on a task. @default false */
381
+ subtasks: zod.z.boolean().optional(),
382
+ /** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */
383
+ cursor: zod.z.string().optional(),
384
+ /** How many tasks you want to return in one go, max 50. @default 20 */
385
+ take: zod.z.number().optional()
386
+ });
387
+ GetRunOptionsSchema.extend({
388
+ /** If `true`, it returns the `params` and `output` of all tasks. @default false */
389
+ taskdetails: zod.z.boolean().optional()
390
+ });
391
+ var RunSchema = zod.z.object({
392
+ /** The Run id */
393
+ id: zod.z.string(),
394
+ /** The Run status */
395
+ status: RunStatusSchema,
396
+ /** When the run started */
397
+ startedAt: zod.z.coerce.date().nullable(),
398
+ /** When the run was last updated */
399
+ updatedAt: zod.z.coerce.date().nullable(),
400
+ /** When the run was completed */
401
+ completedAt: zod.z.coerce.date().nullable()
402
+ });
403
+ var GetRunSchema = RunSchema.extend({
404
+ /** The output of the run */
405
+ output: zod.z.any().optional(),
406
+ /** The tasks from the run */
407
+ tasks: zod.z.array(RunTaskWithSubtasksSchema),
408
+ /** Any status updates that were published from the run */
409
+ statuses: zod.z.array(JobRunStatusRecordSchema).default([]),
410
+ /** If there are more tasks, you can use this to get them */
411
+ nextCursor: zod.z.string().optional()
412
+ });
413
+ zod.z.object({
414
+ /** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */
415
+ cursor: zod.z.string().optional(),
416
+ /** How many runs you want to return in one go, max 50. @default 20 */
417
+ take: zod.z.number().optional()
418
+ });
419
+ var GetRunsSchema = zod.z.object({
420
+ /** The runs from the query */
421
+ runs: RunSchema.array(),
422
+ /** If there are more runs, you can use this to get them */
423
+ nextCursor: zod.z.string().optional()
424
+ });
425
+ var StringMatchSchema = zod.z.union([
426
+ /** Match against a string */
427
+ zod.z.array(zod.z.string()),
428
+ zod.z.array(zod.z.union(stringPatternMatchers))
429
+ ]);
430
+ var HTTPMethodUnionSchema = zod.z.union([
431
+ zod.z.literal("GET"),
432
+ zod.z.literal("POST"),
433
+ zod.z.literal("PUT"),
434
+ zod.z.literal("PATCH"),
435
+ zod.z.literal("DELETE"),
436
+ zod.z.literal("HEAD"),
437
+ zod.z.literal("OPTIONS")
619
438
  ]);
439
+ var RequestFilterSchema = zod.z.object({
440
+ /** An array of HTTP methods to match.
441
+ * For example, `["GET", "POST"]` will match both `GET` and `POST` Requests. */
442
+ method: zod.z.array(HTTPMethodUnionSchema).optional(),
443
+ /** An object of header key/values to match.
444
+ * This uses the [EventFilter matching syntax](https://trigger.dev/docs/documentation/guides/event-filter).
445
+
446
+ @example
447
+ ```ts
448
+ filter: {
449
+ header: {
450
+ "content-type": ["application/json"],
451
+ },
452
+ },
453
+ ``` */
454
+ headers: zod.z.record(StringMatchSchema).optional(),
455
+ /** An object of query parameters to match.
456
+ * This uses the [EventFilter matching syntax](https://trigger.dev/docs/documentation/guides/event-filter).
457
+
458
+ @example
459
+ ```ts
460
+ filter: {
461
+ query: {
462
+ "hub.mode": [{ $startsWith: "sub" }],
463
+ },
464
+ },
465
+ ``` */
466
+ query: zod.z.record(StringMatchSchema).optional(),
467
+ /** An object of key/values to match.
468
+ * This uses the [EventFilter matching syntax](https://trigger.dev/docs/documentation/guides/event-filter).
469
+ */
470
+ body: EventFilterSchema.optional()
471
+ });
472
+ var ResponseFilterSchema = RequestFilterSchema.omit({
473
+ method: true,
474
+ query: true
475
+ }).extend({
476
+ status: zod.z.array(zod.z.number()).optional()
477
+ });
620
478
 
621
479
  // src/schemas/api.ts
622
- var UpdateTriggerSourceBodyV1Schema = import_zod9.z.object({
623
- registeredEvents: import_zod9.z.array(import_zod9.z.string()),
624
- secret: import_zod9.z.string().optional(),
480
+ var UpdateTriggerSourceBodyV1Schema = zod.z.object({
481
+ registeredEvents: zod.z.array(zod.z.string()),
482
+ secret: zod.z.string().optional(),
625
483
  data: SerializableJsonSchema.optional()
626
484
  });
627
- var UpdateTriggerSourceBodyV2Schema = import_zod9.z.object({
628
- secret: import_zod9.z.string().optional(),
485
+ var UpdateTriggerSourceBodyV2Schema = zod.z.object({
486
+ secret: zod.z.string().optional(),
629
487
  data: SerializableJsonSchema.optional(),
630
- options: import_zod9.z.object({
631
- event: import_zod9.z.array(import_zod9.z.string())
632
- }).and(import_zod9.z.record(import_zod9.z.string(), import_zod9.z.array(import_zod9.z.string())).optional())
488
+ options: zod.z.object({
489
+ event: zod.z.array(zod.z.string())
490
+ }).and(zod.z.record(zod.z.string(), zod.z.array(zod.z.string())).optional())
633
491
  });
634
- var RegisterHTTPTriggerSourceBodySchema = import_zod9.z.object({
635
- type: import_zod9.z.literal("HTTP"),
636
- url: import_zod9.z.string().url()
492
+ var UpdateWebhookBodySchema = zod.z.discriminatedUnion("active", [
493
+ zod.z.object({
494
+ active: zod.z.literal(false)
495
+ }),
496
+ zod.z.object({
497
+ active: zod.z.literal(true),
498
+ config: zod.z.record(zod.z.string().array())
499
+ })
500
+ ]);
501
+ var RegisterHTTPTriggerSourceBodySchema = zod.z.object({
502
+ type: zod.z.literal("HTTP"),
503
+ url: zod.z.string().url()
637
504
  });
638
- var RegisterSMTPTriggerSourceBodySchema = import_zod9.z.object({
639
- type: import_zod9.z.literal("SMTP")
505
+ var RegisterSMTPTriggerSourceBodySchema = zod.z.object({
506
+ type: zod.z.literal("SMTP")
640
507
  });
641
- var RegisterSQSTriggerSourceBodySchema = import_zod9.z.object({
642
- type: import_zod9.z.literal("SQS")
508
+ var RegisterSQSTriggerSourceBodySchema = zod.z.object({
509
+ type: zod.z.literal("SQS")
643
510
  });
644
- var RegisterSourceChannelBodySchema = import_zod9.z.discriminatedUnion("type", [
511
+ var RegisterSourceChannelBodySchema = zod.z.discriminatedUnion("type", [
645
512
  RegisterHTTPTriggerSourceBodySchema,
646
513
  RegisterSMTPTriggerSourceBodySchema,
647
514
  RegisterSQSTriggerSourceBodySchema
648
515
  ]);
516
+ var REGISTER_WEBHOOK = "dev.trigger.webhook.register";
517
+ var DELIVER_WEBHOOK_REQUEST = "dev.trigger.webhook.deliver";
518
+ var RegisterWebhookSourceSchema = zod.z.object({
519
+ key: zod.z.string(),
520
+ params: zod.z.any(),
521
+ config: zod.z.any(),
522
+ active: zod.z.boolean(),
523
+ secret: zod.z.string(),
524
+ url: zod.z.string(),
525
+ data: DeserializedJsonSchema.optional(),
526
+ clientId: zod.z.string().optional()
527
+ });
528
+ var RegisterWebhookPayloadSchema = zod.z.object({
529
+ active: zod.z.boolean(),
530
+ params: zod.z.any().optional(),
531
+ config: zod.z.object({
532
+ current: zod.z.record(zod.z.string().array()),
533
+ desired: zod.z.record(zod.z.string().array())
534
+ }),
535
+ // from HTTP Endpoint
536
+ url: zod.z.string(),
537
+ secret: zod.z.string()
538
+ });
649
539
  var REGISTER_SOURCE_EVENT_V1 = "dev.trigger.source.register";
650
540
  var REGISTER_SOURCE_EVENT_V2 = "dev.trigger.source.register.v2";
651
- var RegisterTriggerSourceSchema = import_zod9.z.object({
652
- key: import_zod9.z.string(),
653
- params: import_zod9.z.any(),
654
- active: import_zod9.z.boolean(),
655
- secret: import_zod9.z.string(),
541
+ var RegisterTriggerSourceSchema = zod.z.object({
542
+ key: zod.z.string(),
543
+ params: zod.z.any(),
544
+ active: zod.z.boolean(),
545
+ secret: zod.z.string(),
656
546
  data: DeserializedJsonSchema.optional(),
657
547
  channel: RegisterSourceChannelBodySchema,
658
- clientId: import_zod9.z.string().optional()
548
+ clientId: zod.z.string().optional()
659
549
  });
660
- var SourceEventOptionSchema = import_zod9.z.object({
661
- name: import_zod9.z.string(),
662
- value: import_zod9.z.string()
550
+ zod.z.object({
551
+ name: zod.z.string(),
552
+ value: zod.z.string()
663
553
  });
664
- var RegisterSourceEventSchemaV1 = import_zod9.z.object({
554
+ var RegisterSourceEventSchemaV1 = zod.z.object({
665
555
  /** The id of the source */
666
- id: import_zod9.z.string(),
556
+ id: zod.z.string(),
667
557
  source: RegisterTriggerSourceSchema,
668
- events: import_zod9.z.array(import_zod9.z.string()),
669
- missingEvents: import_zod9.z.array(import_zod9.z.string()),
670
- orphanedEvents: import_zod9.z.array(import_zod9.z.string()),
671
- dynamicTriggerId: import_zod9.z.string().optional()
558
+ events: zod.z.array(zod.z.string()),
559
+ missingEvents: zod.z.array(zod.z.string()),
560
+ orphanedEvents: zod.z.array(zod.z.string()),
561
+ dynamicTriggerId: zod.z.string().optional()
672
562
  });
673
- var RegisteredOptionsDiffSchema = import_zod9.z.object({
674
- desired: import_zod9.z.array(import_zod9.z.string()),
675
- missing: import_zod9.z.array(import_zod9.z.string()),
676
- orphaned: import_zod9.z.array(import_zod9.z.string())
563
+ var RegisteredOptionsDiffSchema = zod.z.object({
564
+ desired: zod.z.array(zod.z.string()),
565
+ missing: zod.z.array(zod.z.string()),
566
+ orphaned: zod.z.array(zod.z.string())
677
567
  });
678
- var RegisterSourceEventOptionsSchema = import_zod9.z.object({
568
+ var RegisterSourceEventOptionsSchema = zod.z.object({
679
569
  event: RegisteredOptionsDiffSchema
680
- }).and(import_zod9.z.record(import_zod9.z.string(), RegisteredOptionsDiffSchema));
681
- var RegisterSourceEventSchemaV2 = import_zod9.z.object({
570
+ }).and(zod.z.record(zod.z.string(), RegisteredOptionsDiffSchema));
571
+ var RegisterSourceEventSchemaV2 = zod.z.object({
682
572
  /** The id of the source */
683
- id: import_zod9.z.string(),
573
+ id: zod.z.string(),
684
574
  source: RegisterTriggerSourceSchema,
685
575
  options: RegisterSourceEventOptionsSchema,
686
- dynamicTriggerId: import_zod9.z.string().optional()
576
+ dynamicTriggerId: zod.z.string().optional()
687
577
  });
688
- var TriggerSourceSchema = import_zod9.z.object({
689
- id: import_zod9.z.string(),
690
- key: import_zod9.z.string()
578
+ var TriggerSourceSchema = zod.z.object({
579
+ id: zod.z.string(),
580
+ key: zod.z.string()
691
581
  });
692
582
  var HttpSourceResponseMetadataSchema = DeserializedJsonSchema;
693
- var HandleTriggerSourceSchema = import_zod9.z.object({
694
- key: import_zod9.z.string(),
695
- secret: import_zod9.z.string(),
696
- data: import_zod9.z.any(),
697
- params: import_zod9.z.any(),
583
+ var HandleTriggerSourceSchema = zod.z.object({
584
+ key: zod.z.string(),
585
+ secret: zod.z.string(),
586
+ data: zod.z.any(),
587
+ params: zod.z.any(),
698
588
  auth: ConnectionAuthSchema.optional(),
699
589
  metadata: HttpSourceResponseMetadataSchema.optional()
700
590
  });
701
- var HttpSourceRequestSchema = import_zod9.z.object({
702
- url: import_zod9.z.string().url(),
703
- method: import_zod9.z.string(),
704
- headers: import_zod9.z.record(import_zod9.z.string()),
705
- rawBody: import_zod9.z.instanceof(Buffer).optional().nullable()
706
- });
707
- var HttpSourceRequestHeadersSchema = import_zod9.z.object({
708
- "x-ts-key": import_zod9.z.string(),
709
- "x-ts-dynamic-id": import_zod9.z.string().optional(),
710
- "x-ts-secret": import_zod9.z.string(),
711
- "x-ts-data": import_zod9.z.string().transform((s) => JSON.parse(s)),
712
- "x-ts-params": import_zod9.z.string().transform((s) => JSON.parse(s)),
713
- "x-ts-http-url": import_zod9.z.string(),
714
- "x-ts-http-method": import_zod9.z.string(),
715
- "x-ts-http-headers": import_zod9.z.string().transform((s) => import_zod9.z.record(import_zod9.z.string()).parse(JSON.parse(s))),
716
- "x-ts-auth": import_zod9.z.string().optional().transform((s) => {
591
+ var HttpSourceRequestHeadersSchema = zod.z.object({
592
+ "x-ts-key": zod.z.string(),
593
+ "x-ts-dynamic-id": zod.z.string().optional(),
594
+ "x-ts-secret": zod.z.string(),
595
+ "x-ts-data": zod.z.string().transform((s) => JSON.parse(s)),
596
+ "x-ts-params": zod.z.string().transform((s) => JSON.parse(s)),
597
+ "x-ts-http-url": zod.z.string(),
598
+ "x-ts-http-method": zod.z.string(),
599
+ "x-ts-http-headers": zod.z.string().transform((s) => zod.z.record(zod.z.string()).parse(JSON.parse(s))),
600
+ "x-ts-auth": zod.z.string().optional().transform((s) => {
717
601
  if (s === void 0)
718
602
  return;
719
603
  const json = JSON.parse(s);
720
604
  return ConnectionAuthSchema.parse(json);
721
605
  }),
722
- "x-ts-metadata": import_zod9.z.string().optional().transform((s) => {
606
+ "x-ts-metadata": zod.z.string().optional().transform((s) => {
723
607
  if (s === void 0)
724
608
  return;
725
609
  const json = JSON.parse(s);
726
610
  return DeserializedJsonSchema.parse(json);
727
611
  })
728
612
  });
729
- var PongSuccessResponseSchema = import_zod9.z.object({
730
- ok: import_zod9.z.literal(true)
731
- });
732
- var PongErrorResponseSchema = import_zod9.z.object({
733
- ok: import_zod9.z.literal(false),
734
- error: import_zod9.z.string()
735
- });
736
- var PongResponseSchema = import_zod9.z.discriminatedUnion("ok", [
613
+ var HttpEndpointRequestHeadersSchema = zod.z.object({
614
+ "x-ts-key": zod.z.string(),
615
+ "x-ts-http-url": zod.z.string(),
616
+ "x-ts-http-method": zod.z.string(),
617
+ "x-ts-http-headers": zod.z.string().transform((s) => zod.z.record(zod.z.string()).parse(JSON.parse(s)))
618
+ });
619
+ var WebhookSourceRequestHeadersSchema = zod.z.object({
620
+ "x-ts-key": zod.z.string(),
621
+ "x-ts-dynamic-id": zod.z.string().optional(),
622
+ "x-ts-secret": zod.z.string(),
623
+ "x-ts-params": zod.z.string().transform((s) => JSON.parse(s)),
624
+ "x-ts-http-url": zod.z.string(),
625
+ "x-ts-http-method": zod.z.string(),
626
+ "x-ts-http-headers": zod.z.string().transform((s) => zod.z.record(zod.z.string()).parse(JSON.parse(s)))
627
+ });
628
+ var PongSuccessResponseSchema = zod.z.object({
629
+ ok: zod.z.literal(true),
630
+ triggerVersion: zod.z.string().optional(),
631
+ triggerSdkVersion: zod.z.string().optional()
632
+ });
633
+ var PongErrorResponseSchema = zod.z.object({
634
+ ok: zod.z.literal(false),
635
+ error: zod.z.string(),
636
+ triggerVersion: zod.z.string().optional(),
637
+ triggerSdkVersion: zod.z.string().optional()
638
+ });
639
+ var PongResponseSchema = zod.z.discriminatedUnion("ok", [
737
640
  PongSuccessResponseSchema,
738
641
  PongErrorResponseSchema
739
642
  ]);
740
- var ValidateSuccessResponseSchema = import_zod9.z.object({
741
- ok: import_zod9.z.literal(true),
742
- endpointId: import_zod9.z.string()
643
+ var ValidateSuccessResponseSchema = zod.z.object({
644
+ ok: zod.z.literal(true),
645
+ endpointId: zod.z.string(),
646
+ triggerVersion: zod.z.string().optional()
743
647
  });
744
- var ValidateErrorResponseSchema = import_zod9.z.object({
745
- ok: import_zod9.z.literal(false),
746
- error: import_zod9.z.string()
648
+ var ValidateErrorResponseSchema = zod.z.object({
649
+ ok: zod.z.literal(false),
650
+ error: zod.z.string(),
651
+ triggerVersion: zod.z.string().optional()
747
652
  });
748
- var ValidateResponseSchema = import_zod9.z.discriminatedUnion("ok", [
653
+ var ValidateResponseSchema = zod.z.discriminatedUnion("ok", [
749
654
  ValidateSuccessResponseSchema,
750
655
  ValidateErrorResponseSchema
751
656
  ]);
752
- var QueueOptionsSchema = import_zod9.z.object({
753
- name: import_zod9.z.string(),
754
- maxConcurrent: import_zod9.z.number().optional()
755
- });
756
- var JobMetadataSchema = import_zod9.z.object({
757
- id: import_zod9.z.string(),
758
- name: import_zod9.z.string(),
759
- version: import_zod9.z.string(),
657
+ var QueueOptionsSchema = zod.z.object({
658
+ name: zod.z.string(),
659
+ maxConcurrent: zod.z.number().optional()
660
+ });
661
+ var ConcurrencyLimitOptionsSchema = zod.z.object({
662
+ id: zod.z.string(),
663
+ limit: zod.z.number()
664
+ });
665
+ var JobMetadataSchema = zod.z.object({
666
+ id: zod.z.string(),
667
+ name: zod.z.string(),
668
+ version: zod.z.string(),
760
669
  event: EventSpecificationSchema,
761
670
  trigger: TriggerMetadataSchema,
762
- integrations: import_zod9.z.record(IntegrationConfigSchema),
763
- internal: import_zod9.z.boolean().default(false),
764
- enabled: import_zod9.z.boolean(),
765
- startPosition: import_zod9.z.enum([
671
+ integrations: zod.z.record(IntegrationConfigSchema),
672
+ internal: zod.z.boolean().default(false),
673
+ enabled: zod.z.boolean(),
674
+ startPosition: zod.z.enum([
766
675
  "initial",
767
676
  "latest"
768
677
  ]),
769
- preprocessRuns: import_zod9.z.boolean()
678
+ preprocessRuns: zod.z.boolean(),
679
+ concurrencyLimit: ConcurrencyLimitOptionsSchema.or(zod.z.number().int().positive()).optional()
770
680
  });
771
- var SourceMetadataV1Schema = import_zod9.z.object({
772
- version: import_zod9.z.literal("1"),
773
- channel: import_zod9.z.enum([
681
+ var SourceMetadataV1Schema = zod.z.object({
682
+ version: zod.z.literal("1"),
683
+ channel: zod.z.enum([
774
684
  "HTTP",
775
685
  "SQS",
776
686
  "SMTP"
777
687
  ]),
778
688
  integration: IntegrationConfigSchema,
779
- key: import_zod9.z.string(),
780
- params: import_zod9.z.any(),
781
- events: import_zod9.z.array(import_zod9.z.string()),
782
- registerSourceJob: import_zod9.z.object({
783
- id: import_zod9.z.string(),
784
- version: import_zod9.z.string()
689
+ key: zod.z.string(),
690
+ params: zod.z.any(),
691
+ events: zod.z.array(zod.z.string()),
692
+ registerSourceJob: zod.z.object({
693
+ id: zod.z.string(),
694
+ version: zod.z.string()
785
695
  }).optional()
786
696
  });
787
- var SourceMetadataV2Schema = import_zod9.z.object({
788
- version: import_zod9.z.literal("2"),
789
- channel: import_zod9.z.enum([
697
+ var SourceMetadataV2Schema = zod.z.object({
698
+ version: zod.z.literal("2"),
699
+ channel: zod.z.enum([
790
700
  "HTTP",
791
701
  "SQS",
792
702
  "SMTP"
793
703
  ]),
794
704
  integration: IntegrationConfigSchema,
795
- key: import_zod9.z.string(),
796
- params: import_zod9.z.any(),
797
- options: import_zod9.z.record(import_zod9.z.array(import_zod9.z.string())),
798
- registerSourceJob: import_zod9.z.object({
799
- id: import_zod9.z.string(),
800
- version: import_zod9.z.string()
705
+ key: zod.z.string(),
706
+ params: zod.z.any(),
707
+ options: zod.z.record(zod.z.array(zod.z.string())),
708
+ registerSourceJob: zod.z.object({
709
+ id: zod.z.string(),
710
+ version: zod.z.string()
801
711
  }).optional()
802
712
  });
803
- var SourceMetadataSchema = import_zod9.z.preprocess(addMissingVersionField, import_zod9.z.discriminatedUnion("version", [
713
+ var SourceMetadataSchema = zod.z.preprocess(addMissingVersionField, zod.z.discriminatedUnion("version", [
804
714
  SourceMetadataV1Schema,
805
715
  SourceMetadataV2Schema
806
716
  ]));
807
- var DynamicTriggerEndpointMetadataSchema = import_zod9.z.object({
808
- id: import_zod9.z.string(),
809
- jobs: import_zod9.z.array(JobMetadataSchema.pick({
717
+ var WebhookMetadataSchema = zod.z.object({
718
+ key: zod.z.string(),
719
+ params: zod.z.any(),
720
+ config: zod.z.record(zod.z.array(zod.z.string())),
721
+ integration: IntegrationConfigSchema,
722
+ httpEndpoint: zod.z.object({
723
+ id: zod.z.string()
724
+ })
725
+ });
726
+ var WebhookContextMetadataSchema = zod.z.object({
727
+ params: zod.z.any(),
728
+ config: zod.z.record(zod.z.string().array()),
729
+ secret: zod.z.string()
730
+ });
731
+ var DynamicTriggerEndpointMetadataSchema = zod.z.object({
732
+ id: zod.z.string(),
733
+ jobs: zod.z.array(JobMetadataSchema.pick({
810
734
  id: true,
811
735
  version: true
812
736
  })),
813
- registerSourceJob: import_zod9.z.object({
814
- id: import_zod9.z.string(),
815
- version: import_zod9.z.string()
737
+ registerSourceJob: zod.z.object({
738
+ id: zod.z.string(),
739
+ version: zod.z.string()
816
740
  }).optional()
817
741
  });
818
- var BackgroundTaskMetadataSchema = import_zod9.z.object({
819
- id: import_zod9.z.string(),
820
- name: import_zod9.z.string(),
821
- version: import_zod9.z.string(),
822
- enabled: import_zod9.z.boolean(),
823
- cpu: import_zod9.z.number(),
824
- memory: import_zod9.z.number(),
825
- concurrency: import_zod9.z.number(),
826
- secrets: import_zod9.z.record(import_zod9.z.string()).optional()
827
- });
828
- var IndexEndpointResponseSchema = import_zod9.z.object({
829
- jobs: import_zod9.z.array(JobMetadataSchema),
830
- sources: import_zod9.z.array(SourceMetadataSchema),
831
- dynamicTriggers: import_zod9.z.array(DynamicTriggerEndpointMetadataSchema),
832
- dynamicSchedules: import_zod9.z.array(RegisterDynamicSchedulePayloadSchema),
833
- backgroundTasks: import_zod9.z.array(BackgroundTaskMetadataSchema).optional()
834
- });
835
- var RawEventSchema = import_zod9.z.object({
742
+ var HttpEndpointMetadataSchema = zod.z.object({
743
+ id: zod.z.string(),
744
+ version: zod.z.string(),
745
+ enabled: zod.z.boolean(),
746
+ title: zod.z.string().optional(),
747
+ icon: zod.z.string().optional(),
748
+ properties: zod.z.array(DisplayPropertySchema).optional(),
749
+ event: EventSpecificationSchema,
750
+ immediateResponseFilter: RequestFilterSchema.optional(),
751
+ skipTriggeringRuns: zod.z.boolean().optional(),
752
+ source: zod.z.string()
753
+ });
754
+ var IndexEndpointResponseSchema = zod.z.object({
755
+ jobs: zod.z.array(JobMetadataSchema),
756
+ sources: zod.z.array(SourceMetadataSchema),
757
+ webhooks: zod.z.array(WebhookMetadataSchema).optional(),
758
+ dynamicTriggers: zod.z.array(DynamicTriggerEndpointMetadataSchema),
759
+ dynamicSchedules: zod.z.array(RegisterDynamicSchedulePayloadSchema),
760
+ httpEndpoints: zod.z.array(HttpEndpointMetadataSchema).optional()
761
+ });
762
+ var EndpointIndexErrorSchema = zod.z.object({
763
+ message: zod.z.string(),
764
+ raw: zod.z.any().optional()
765
+ });
766
+ var IndexEndpointStatsSchema = zod.z.object({
767
+ jobs: zod.z.number(),
768
+ sources: zod.z.number(),
769
+ webhooks: zod.z.number().optional(),
770
+ dynamicTriggers: zod.z.number(),
771
+ dynamicSchedules: zod.z.number(),
772
+ disabledJobs: zod.z.number().default(0),
773
+ httpEndpoints: zod.z.number().default(0)
774
+ });
775
+ function parseEndpointIndexStats(stats) {
776
+ if (stats === null || stats === void 0) {
777
+ return;
778
+ }
779
+ return IndexEndpointStatsSchema.parse(stats);
780
+ }
781
+ __name(parseEndpointIndexStats, "parseEndpointIndexStats");
782
+ var GetEndpointIndexResponseSchema = zod.z.discriminatedUnion("status", [
783
+ zod.z.object({
784
+ status: zod.z.literal("PENDING"),
785
+ updatedAt: zod.z.coerce.date()
786
+ }),
787
+ zod.z.object({
788
+ status: zod.z.literal("STARTED"),
789
+ updatedAt: zod.z.coerce.date()
790
+ }),
791
+ zod.z.object({
792
+ status: zod.z.literal("SUCCESS"),
793
+ stats: IndexEndpointStatsSchema,
794
+ updatedAt: zod.z.coerce.date()
795
+ }),
796
+ zod.z.object({
797
+ status: zod.z.literal("FAILURE"),
798
+ error: EndpointIndexErrorSchema,
799
+ updatedAt: zod.z.coerce.date()
800
+ })
801
+ ]);
802
+ var EndpointHeadersSchema = zod.z.object({
803
+ "trigger-version": zod.z.string().optional(),
804
+ "trigger-sdk-version": zod.z.string().optional()
805
+ });
806
+ var ExecuteJobRunMetadataSchema = zod.z.object({
807
+ successSubscription: zod.z.boolean().optional(),
808
+ failedSubscription: zod.z.boolean().optional()
809
+ });
810
+ var ExecuteJobHeadersSchema = EndpointHeadersSchema.extend({
811
+ "x-trigger-run-metadata": zod.z.preprocess((val) => typeof val === "string" && JSON.parse(val), ExecuteJobRunMetadataSchema).optional()
812
+ });
813
+ var RawEventSchema = zod.z.object({
836
814
  /** The `name` property must exactly match any subscriptions you want to
837
815
  trigger. */
838
- name: import_zod9.z.string(),
816
+ name: zod.z.string(),
839
817
  /** The `payload` property will be sent to any matching Jobs and will appear
840
818
  as the `payload` param of the `run()` function. You can leave this
841
819
  parameter out if you just want to trigger a Job without any input data. */
842
- payload: import_zod9.z.any(),
820
+ payload: zod.z.any(),
843
821
  /** The optional `context` property will be sent to any matching Jobs and will
844
822
  be passed through as the `context.event.context` param of the `run()`
845
823
  function. This is optional but can be useful if you want to pass through
846
824
  some additional context to the Job. */
847
- context: import_zod9.z.any().optional(),
825
+ context: zod.z.any().optional(),
848
826
  /** The `id` property uniquely identify this particular event. If unset it
849
827
  will be set automatically using `ulid`. */
850
- id: import_zod9.z.string().default(() => (0, import_ulid.ulid)()),
828
+ id: zod.z.string().default(() => ulidx.ulid()),
851
829
  /** This is optional, it defaults to the current timestamp. Usually you would
852
830
  only set this if you have a timestamp that you wish to pass through, e.g.
853
831
  you receive a timestamp from a service and you want the same timestamp to
854
832
  be used in your Job. */
855
- timestamp: import_zod9.z.coerce.date().optional(),
833
+ timestamp: zod.z.coerce.date().optional(),
856
834
  /** This is optional, it defaults to "trigger.dev". It can be useful to set
857
835
  this as you can filter events using this in the `eventTrigger()`. */
858
- source: import_zod9.z.string().optional()
836
+ source: zod.z.string().optional(),
837
+ /** This is optional, it defaults to "JSON". If your event is actually a request,
838
+ with a url, headers, method and rawBody you can use "REQUEST" */
839
+ payloadType: zod.z.union([
840
+ zod.z.literal("JSON"),
841
+ zod.z.literal("REQUEST")
842
+ ]).optional()
859
843
  });
860
- var ApiEventLogSchema = import_zod9.z.object({
844
+ var ApiEventLogSchema = zod.z.object({
861
845
  /** The `id` of the event that was sent.
862
846
  */
863
- id: import_zod9.z.string(),
847
+ id: zod.z.string(),
864
848
  /** The `name` of the event that was sent. */
865
- name: import_zod9.z.string(),
849
+ name: zod.z.string(),
866
850
  /** The `payload` of the event that was sent */
867
851
  payload: DeserializedJsonSchema,
868
852
  /** The `context` of the event that was sent. Is `undefined` if no context was
869
853
  set when sending the event. */
870
854
  context: DeserializedJsonSchema.optional().nullable(),
871
855
  /** The `timestamp` of the event that was sent */
872
- timestamp: import_zod9.z.coerce.date(),
856
+ timestamp: zod.z.coerce.date(),
873
857
  /** The timestamp when the event will be delivered to any matching Jobs. Is
874
858
  `undefined` if `deliverAt` or `deliverAfter` wasn't set when sending the
875
859
  event. */
876
- deliverAt: import_zod9.z.coerce.date().optional().nullable(),
860
+ deliverAt: zod.z.coerce.date().optional().nullable(),
877
861
  /** The timestamp when the event was delivered. Is `undefined` if `deliverAt`
878
862
  or `deliverAfter` were set when sending the event. */
879
- deliveredAt: import_zod9.z.coerce.date().optional().nullable(),
863
+ deliveredAt: zod.z.coerce.date().optional().nullable(),
880
864
  /** The timestamp when the event was cancelled. Is `undefined` if the event
881
865
  * wasn't cancelled. */
882
- cancelledAt: import_zod9.z.coerce.date().optional().nullable()
866
+ cancelledAt: zod.z.coerce.date().optional().nullable()
883
867
  });
884
- var SendEventOptionsSchema = import_zod9.z.object({
868
+ var SendEventOptionsSchema = zod.z.object({
885
869
  /** An optional Date when you want the event to trigger Jobs. The event will
886
870
  be sent to the platform immediately but won't be acted upon until the
887
871
  specified time. */
888
- deliverAt: import_zod9.z.coerce.date().optional(),
872
+ deliverAt: zod.z.coerce.date().optional(),
889
873
  /** An optional number of seconds you want to wait for the event to trigger
890
874
  any relevant Jobs. The event will be sent to the platform immediately but
891
875
  won't be delivered until after the elapsed number of seconds. */
892
- deliverAfter: import_zod9.z.number().int().optional(),
876
+ deliverAfter: zod.z.number().int().optional(),
893
877
  /** This optional param will be used by Trigger.dev Connect, which
894
878
  is coming soon. */
895
- accountId: import_zod9.z.string().optional()
879
+ accountId: zod.z.string().optional()
896
880
  });
897
- var SendEventBodySchema = import_zod9.z.object({
881
+ var SendEventBodySchema = zod.z.object({
898
882
  event: RawEventSchema,
899
883
  options: SendEventOptionsSchema.optional()
900
884
  });
901
- var DeliverEventResponseSchema = import_zod9.z.object({
902
- deliveredAt: import_zod9.z.string().datetime()
885
+ var SendBulkEventsBodySchema = zod.z.object({
886
+ events: RawEventSchema.array(),
887
+ options: SendEventOptionsSchema.optional()
888
+ });
889
+ var DeliverEventResponseSchema = zod.z.object({
890
+ deliveredAt: zod.z.string().datetime()
903
891
  });
904
- var RuntimeEnvironmentTypeSchema = import_zod9.z.enum([
892
+ var RuntimeEnvironmentTypeSchema = zod.z.enum([
905
893
  "PRODUCTION",
906
894
  "STAGING",
907
895
  "DEVELOPMENT",
908
896
  "PREVIEW"
909
897
  ]);
910
- var RunSourceContextSchema = import_zod9.z.object({
911
- id: import_zod9.z.string(),
912
- metadata: import_zod9.z.any()
898
+ var RunSourceContextSchema = zod.z.object({
899
+ id: zod.z.string(),
900
+ metadata: zod.z.any()
913
901
  });
914
- var RunJobBodySchema = import_zod9.z.object({
902
+ var AutoYieldConfigSchema = zod.z.object({
903
+ startTaskThreshold: zod.z.number(),
904
+ beforeExecuteTaskThreshold: zod.z.number(),
905
+ beforeCompleteTaskThreshold: zod.z.number(),
906
+ afterCompleteTaskThreshold: zod.z.number()
907
+ });
908
+ var RunJobBodySchema = zod.z.object({
915
909
  event: ApiEventLogSchema,
916
- job: import_zod9.z.object({
917
- id: import_zod9.z.string(),
918
- version: import_zod9.z.string()
910
+ job: zod.z.object({
911
+ id: zod.z.string(),
912
+ version: zod.z.string()
919
913
  }),
920
- run: import_zod9.z.object({
921
- id: import_zod9.z.string(),
922
- isTest: import_zod9.z.boolean(),
923
- isRetry: import_zod9.z.boolean().default(false),
924
- startedAt: import_zod9.z.coerce.date()
914
+ run: zod.z.object({
915
+ id: zod.z.string(),
916
+ isTest: zod.z.boolean(),
917
+ isRetry: zod.z.boolean().default(false),
918
+ startedAt: zod.z.coerce.date()
925
919
  }),
926
- environment: import_zod9.z.object({
927
- id: import_zod9.z.string(),
928
- slug: import_zod9.z.string(),
920
+ environment: zod.z.object({
921
+ id: zod.z.string(),
922
+ slug: zod.z.string(),
929
923
  type: RuntimeEnvironmentTypeSchema
930
924
  }),
931
- organization: import_zod9.z.object({
932
- id: import_zod9.z.string(),
933
- title: import_zod9.z.string(),
934
- slug: import_zod9.z.string()
925
+ organization: zod.z.object({
926
+ id: zod.z.string(),
927
+ title: zod.z.string(),
928
+ slug: zod.z.string()
935
929
  }),
936
- account: import_zod9.z.object({
937
- id: import_zod9.z.string(),
938
- metadata: import_zod9.z.any()
930
+ project: zod.z.object({
931
+ id: zod.z.string(),
932
+ name: zod.z.string(),
933
+ slug: zod.z.string()
934
+ }).optional(),
935
+ account: zod.z.object({
936
+ id: zod.z.string(),
937
+ metadata: zod.z.any()
939
938
  }).optional(),
940
939
  source: RunSourceContextSchema.optional(),
941
- tasks: import_zod9.z.array(CachedTaskSchema).optional(),
942
- connections: import_zod9.z.record(ConnectionAuthSchema).optional()
943
- });
944
- var RunJobErrorSchema = import_zod9.z.object({
945
- status: import_zod9.z.literal("ERROR"),
940
+ tasks: zod.z.array(CachedTaskSchema).optional(),
941
+ cachedTaskCursor: zod.z.string().optional(),
942
+ noopTasksSet: zod.z.string().optional(),
943
+ connections: zod.z.record(ConnectionAuthSchema).optional(),
944
+ yieldedExecutions: zod.z.string().array().optional(),
945
+ runChunkExecutionLimit: zod.z.number().optional(),
946
+ autoYieldConfig: AutoYieldConfigSchema.optional()
947
+ });
948
+ var RunJobErrorSchema = zod.z.object({
949
+ status: zod.z.literal("ERROR"),
946
950
  error: ErrorWithStackSchema,
947
951
  task: TaskSchema.optional()
948
952
  });
949
- var RunJobResumeWithTaskSchema = import_zod9.z.object({
950
- status: import_zod9.z.literal("RESUME_WITH_TASK"),
953
+ var RunJobYieldExecutionErrorSchema = zod.z.object({
954
+ status: zod.z.literal("YIELD_EXECUTION"),
955
+ key: zod.z.string()
956
+ });
957
+ var AutoYieldMetadataSchema = zod.z.object({
958
+ location: zod.z.string(),
959
+ timeRemaining: zod.z.number(),
960
+ timeElapsed: zod.z.number(),
961
+ limit: zod.z.number().optional()
962
+ });
963
+ var RunJobAutoYieldExecutionErrorSchema = AutoYieldMetadataSchema.extend({
964
+ status: zod.z.literal("AUTO_YIELD_EXECUTION")
965
+ });
966
+ var RunJobAutoYieldWithCompletedTaskExecutionErrorSchema = zod.z.object({
967
+ status: zod.z.literal("AUTO_YIELD_EXECUTION_WITH_COMPLETED_TASK"),
968
+ id: zod.z.string(),
969
+ properties: zod.z.array(DisplayPropertySchema).optional(),
970
+ output: zod.z.string().optional(),
971
+ data: AutoYieldMetadataSchema
972
+ });
973
+ var RunJobInvalidPayloadErrorSchema = zod.z.object({
974
+ status: zod.z.literal("INVALID_PAYLOAD"),
975
+ errors: zod.z.array(SchemaErrorSchema)
976
+ });
977
+ var RunJobUnresolvedAuthErrorSchema = zod.z.object({
978
+ status: zod.z.literal("UNRESOLVED_AUTH_ERROR"),
979
+ issues: zod.z.record(zod.z.object({
980
+ id: zod.z.string(),
981
+ error: zod.z.string()
982
+ }))
983
+ });
984
+ var RunJobResumeWithTaskSchema = zod.z.object({
985
+ status: zod.z.literal("RESUME_WITH_TASK"),
951
986
  task: TaskSchema
952
987
  });
953
- var RunJobRetryWithTaskSchema = import_zod9.z.object({
954
- status: import_zod9.z.literal("RETRY_WITH_TASK"),
988
+ var RunJobRetryWithTaskSchema = zod.z.object({
989
+ status: zod.z.literal("RETRY_WITH_TASK"),
955
990
  task: TaskSchema,
956
991
  error: ErrorWithStackSchema,
957
- retryAt: import_zod9.z.coerce.date()
992
+ retryAt: zod.z.coerce.date()
958
993
  });
959
- var RunJobCanceledWithTaskSchema = import_zod9.z.object({
960
- status: import_zod9.z.literal("CANCELED"),
994
+ var RunJobCanceledWithTaskSchema = zod.z.object({
995
+ status: zod.z.literal("CANCELED"),
961
996
  task: TaskSchema
962
997
  });
963
- var RunJobSuccessSchema = import_zod9.z.object({
964
- status: import_zod9.z.literal("SUCCESS"),
998
+ var RunJobSuccessSchema = zod.z.object({
999
+ status: zod.z.literal("SUCCESS"),
965
1000
  output: DeserializedJsonSchema.optional()
966
1001
  });
967
- var RunJobResponseSchema = import_zod9.z.discriminatedUnion("status", [
1002
+ var RunJobErrorResponseSchema = zod.z.union([
1003
+ RunJobAutoYieldExecutionErrorSchema,
1004
+ RunJobAutoYieldWithCompletedTaskExecutionErrorSchema,
1005
+ RunJobYieldExecutionErrorSchema,
1006
+ RunJobErrorSchema,
1007
+ RunJobUnresolvedAuthErrorSchema,
1008
+ RunJobInvalidPayloadErrorSchema,
1009
+ RunJobResumeWithTaskSchema,
1010
+ RunJobRetryWithTaskSchema,
1011
+ RunJobCanceledWithTaskSchema
1012
+ ]);
1013
+ var RunJobResumeWithParallelTaskSchema = zod.z.object({
1014
+ status: zod.z.literal("RESUME_WITH_PARALLEL_TASK"),
1015
+ task: TaskSchema,
1016
+ childErrors: zod.z.array(RunJobErrorResponseSchema)
1017
+ });
1018
+ var RunJobResponseSchema = zod.z.discriminatedUnion("status", [
1019
+ RunJobAutoYieldExecutionErrorSchema,
1020
+ RunJobAutoYieldWithCompletedTaskExecutionErrorSchema,
1021
+ RunJobYieldExecutionErrorSchema,
968
1022
  RunJobErrorSchema,
1023
+ RunJobUnresolvedAuthErrorSchema,
1024
+ RunJobInvalidPayloadErrorSchema,
969
1025
  RunJobResumeWithTaskSchema,
1026
+ RunJobResumeWithParallelTaskSchema,
970
1027
  RunJobRetryWithTaskSchema,
971
1028
  RunJobCanceledWithTaskSchema,
972
1029
  RunJobSuccessSchema
973
1030
  ]);
974
- var PreprocessRunBodySchema = import_zod9.z.object({
1031
+ var PreprocessRunBodySchema = zod.z.object({
975
1032
  event: ApiEventLogSchema,
976
- job: import_zod9.z.object({
977
- id: import_zod9.z.string(),
978
- version: import_zod9.z.string()
1033
+ job: zod.z.object({
1034
+ id: zod.z.string(),
1035
+ version: zod.z.string()
979
1036
  }),
980
- run: import_zod9.z.object({
981
- id: import_zod9.z.string(),
982
- isTest: import_zod9.z.boolean()
1037
+ run: zod.z.object({
1038
+ id: zod.z.string(),
1039
+ isTest: zod.z.boolean()
983
1040
  }),
984
- environment: import_zod9.z.object({
985
- id: import_zod9.z.string(),
986
- slug: import_zod9.z.string(),
1041
+ environment: zod.z.object({
1042
+ id: zod.z.string(),
1043
+ slug: zod.z.string(),
987
1044
  type: RuntimeEnvironmentTypeSchema
988
1045
  }),
989
- organization: import_zod9.z.object({
990
- id: import_zod9.z.string(),
991
- title: import_zod9.z.string(),
992
- slug: import_zod9.z.string()
1046
+ organization: zod.z.object({
1047
+ id: zod.z.string(),
1048
+ title: zod.z.string(),
1049
+ slug: zod.z.string()
993
1050
  }),
994
- account: import_zod9.z.object({
995
- id: import_zod9.z.string(),
996
- metadata: import_zod9.z.any()
1051
+ account: zod.z.object({
1052
+ id: zod.z.string(),
1053
+ metadata: zod.z.any()
997
1054
  }).optional()
998
1055
  });
999
- var PreprocessRunResponseSchema = import_zod9.z.object({
1000
- abort: import_zod9.z.boolean(),
1001
- properties: import_zod9.z.array(DisplayPropertySchema).optional()
1056
+ var PreprocessRunResponseSchema = zod.z.object({
1057
+ abort: zod.z.boolean(),
1058
+ properties: zod.z.array(DisplayPropertySchema).optional()
1002
1059
  });
1003
- var CreateRunResponseOkSchema = import_zod9.z.object({
1004
- ok: import_zod9.z.literal(true),
1005
- data: import_zod9.z.object({
1006
- id: import_zod9.z.string()
1060
+ var CreateRunResponseOkSchema = zod.z.object({
1061
+ ok: zod.z.literal(true),
1062
+ data: zod.z.object({
1063
+ id: zod.z.string()
1007
1064
  })
1008
1065
  });
1009
- var CreateRunResponseErrorSchema = import_zod9.z.object({
1010
- ok: import_zod9.z.literal(false),
1011
- error: import_zod9.z.string()
1066
+ var CreateRunResponseErrorSchema = zod.z.object({
1067
+ ok: zod.z.literal(false),
1068
+ error: zod.z.string()
1012
1069
  });
1013
- var CreateRunResponseBodySchema = import_zod9.z.discriminatedUnion("ok", [
1070
+ var CreateRunResponseBodySchema = zod.z.discriminatedUnion("ok", [
1014
1071
  CreateRunResponseOkSchema,
1015
1072
  CreateRunResponseErrorSchema
1016
1073
  ]);
1017
- var RedactStringSchema = import_zod9.z.object({
1018
- __redactedString: import_zod9.z.literal(true),
1019
- strings: import_zod9.z.array(import_zod9.z.string()),
1020
- interpolations: import_zod9.z.array(import_zod9.z.string())
1074
+ var RedactStringSchema = zod.z.object({
1075
+ __redactedString: zod.z.literal(true),
1076
+ strings: zod.z.array(zod.z.string()),
1077
+ interpolations: zod.z.array(zod.z.string())
1021
1078
  });
1022
- var LogMessageSchema = import_zod9.z.object({
1023
- level: import_zod9.z.enum([
1079
+ var LogMessageSchema = zod.z.object({
1080
+ level: zod.z.enum([
1024
1081
  "DEBUG",
1025
1082
  "INFO",
1026
1083
  "WARN",
1027
1084
  "ERROR"
1028
1085
  ]),
1029
- message: import_zod9.z.string(),
1086
+ message: zod.z.string(),
1030
1087
  data: SerializableJsonSchema.optional()
1031
1088
  });
1032
- var RedactSchema = import_zod9.z.object({
1033
- paths: import_zod9.z.array(import_zod9.z.string())
1089
+ var RedactSchema = zod.z.object({
1090
+ paths: zod.z.array(zod.z.string())
1034
1091
  });
1035
- var RetryOptionsSchema = import_zod9.z.object({
1092
+ var RetryOptionsSchema = zod.z.object({
1036
1093
  /** The maximum number of times to retry the request. */
1037
- limit: import_zod9.z.number().optional(),
1094
+ limit: zod.z.number().optional(),
1038
1095
  /** The exponential factor to use when calculating the next retry time. */
1039
- factor: import_zod9.z.number().optional(),
1096
+ factor: zod.z.number().optional(),
1040
1097
  /** The minimum amount of time to wait before retrying the request. */
1041
- minTimeoutInMs: import_zod9.z.number().optional(),
1098
+ minTimeoutInMs: zod.z.number().optional(),
1042
1099
  /** The maximum amount of time to wait before retrying the request. */
1043
- maxTimeoutInMs: import_zod9.z.number().optional(),
1100
+ maxTimeoutInMs: zod.z.number().optional(),
1044
1101
  /** Whether to randomize the retry time. */
1045
- randomize: import_zod9.z.boolean().optional()
1102
+ randomize: zod.z.boolean().optional()
1046
1103
  });
1047
- var RunTaskOptionsSchema = import_zod9.z.object({
1104
+ var RunTaskOptionsSchema = zod.z.object({
1048
1105
  /** The name of the Task is required. This is displayed on the Task in the logs. */
1049
- name: import_zod9.z.string().optional(),
1106
+ name: zod.z.string().optional(),
1050
1107
  /** The Task will wait and only start at the specified Date */
1051
- delayUntil: import_zod9.z.coerce.date().optional(),
1108
+ delayUntil: zod.z.coerce.date().optional(),
1052
1109
  /** Retry options */
1053
1110
  retry: RetryOptionsSchema.optional(),
1054
1111
  /** The icon for the Task, it will appear in the logs.
1055
1112
  * You can use the name of a company in lowercase, e.g. "github".
1056
- * Or any icon name that [Font Awesome](https://fontawesome.com/icons) supports. */
1057
- icon: import_zod9.z.string().optional(),
1113
+ * Or any icon name that [Tabler Icons](https://tabler-icons.io/) supports. */
1114
+ icon: zod.z.string().optional(),
1058
1115
  /** The key for the Task that you want to appear in the logs */
1059
- displayKey: import_zod9.z.string().optional(),
1116
+ displayKey: zod.z.string().optional(),
1060
1117
  /** A description of the Task */
1061
- description: import_zod9.z.string().optional(),
1118
+ description: zod.z.string().optional(),
1062
1119
  /** Properties that are displayed in the logs */
1063
- properties: import_zod9.z.array(DisplayPropertySchema).optional(),
1120
+ properties: zod.z.array(DisplayPropertySchema).optional(),
1064
1121
  /** The input params to the Task, will be displayed in the logs */
1065
- params: import_zod9.z.any(),
1122
+ params: zod.z.any(),
1066
1123
  /** The style of the log entry. */
1067
1124
  style: StyleSchema.optional(),
1125
+ /** 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. */
1126
+ callback: zod.z.object({
1127
+ /** Causes the task to wait for and return the data of the first request sent to `task.callbackUrl`. */
1128
+ enabled: zod.z.boolean(),
1129
+ /** Time to wait for the first request to `task.callbackUrl`. Default: One hour. */
1130
+ timeoutInSeconds: zod.z.number()
1131
+ }).partial().optional(),
1068
1132
  /** Allows you to link the Integration connection in the logs. This is handled automatically in integrations. */
1069
- connectionKey: import_zod9.z.string().optional(),
1070
- /** 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. */
1071
- operation: import_zod9.z.enum([
1072
- "fetch"
1133
+ connectionKey: zod.z.string().optional(),
1134
+ /** An operation you want to perform on the Trigger.dev platform, current only "fetch", "fetch-response", and "fetch-poll" is supported. If you wish to `fetch` use [`io.backgroundFetch()`](https://trigger.dev/docs/sdk/io/backgroundfetch) instead. */
1135
+ operation: zod.z.enum([
1136
+ "fetch",
1137
+ "fetch-response",
1138
+ "fetch-poll"
1073
1139
  ]).optional(),
1074
1140
  /** 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). */
1075
- noop: import_zod9.z.boolean().default(false),
1141
+ noop: zod.z.boolean().default(false),
1076
1142
  redact: RedactSchema.optional(),
1077
- trigger: TriggerMetadataSchema.optional()
1143
+ parallel: zod.z.boolean().optional()
1078
1144
  });
1079
1145
  var RunTaskBodyInputSchema = RunTaskOptionsSchema.extend({
1080
- idempotencyKey: import_zod9.z.string(),
1081
- parentId: import_zod9.z.string().optional()
1146
+ idempotencyKey: zod.z.string(),
1147
+ parentId: zod.z.string().optional()
1082
1148
  });
1083
1149
  var RunTaskBodyOutputSchema = RunTaskBodyInputSchema.extend({
1084
- params: DeserializedJsonSchema.optional().nullable()
1150
+ properties: zod.z.array(DisplayPropertySchema.partial()).optional(),
1151
+ params: DeserializedJsonSchema.optional().nullable(),
1152
+ callback: zod.z.object({
1153
+ enabled: zod.z.boolean(),
1154
+ timeoutInSeconds: zod.z.number().default(3600)
1155
+ }).optional()
1156
+ });
1157
+ var RunTaskResponseWithCachedTasksBodySchema = zod.z.object({
1158
+ task: ServerTaskSchema,
1159
+ cachedTasks: zod.z.object({
1160
+ tasks: zod.z.array(CachedTaskSchema),
1161
+ cursor: zod.z.string().optional()
1162
+ }).optional()
1085
1163
  });
1086
1164
  var CompleteTaskBodyInputSchema = RunTaskBodyInputSchema.pick({
1087
1165
  properties: true,
@@ -1090,287 +1168,291 @@ var CompleteTaskBodyInputSchema = RunTaskBodyInputSchema.pick({
1090
1168
  }).extend({
1091
1169
  output: SerializableJsonSchema.optional().transform((v) => v ? DeserializedJsonSchema.parse(JSON.parse(JSON.stringify(v))) : {})
1092
1170
  });
1093
- var FailTaskBodyInputSchema = import_zod9.z.object({
1171
+ var CompleteTaskBodyV2InputSchema = RunTaskBodyInputSchema.pick({
1172
+ properties: true,
1173
+ description: true,
1174
+ params: true
1175
+ }).extend({
1176
+ output: zod.z.string().optional()
1177
+ });
1178
+ var FailTaskBodyInputSchema = zod.z.object({
1094
1179
  error: ErrorWithStackSchema
1095
1180
  });
1096
- var NormalizedRequestSchema = import_zod9.z.object({
1097
- headers: import_zod9.z.record(import_zod9.z.string()),
1098
- method: import_zod9.z.string(),
1099
- query: import_zod9.z.record(import_zod9.z.string()),
1100
- url: import_zod9.z.string(),
1101
- body: import_zod9.z.any()
1181
+ var NormalizedRequestSchema = zod.z.object({
1182
+ headers: zod.z.record(zod.z.string()),
1183
+ method: zod.z.string(),
1184
+ query: zod.z.record(zod.z.string()),
1185
+ url: zod.z.string(),
1186
+ body: zod.z.any()
1102
1187
  });
1103
- var NormalizedResponseSchema = import_zod9.z.object({
1104
- status: import_zod9.z.number(),
1105
- body: import_zod9.z.any(),
1106
- headers: import_zod9.z.record(import_zod9.z.string()).optional()
1188
+ var NormalizedResponseSchema = zod.z.object({
1189
+ status: zod.z.number(),
1190
+ body: zod.z.any(),
1191
+ headers: zod.z.record(zod.z.string()).optional()
1107
1192
  });
1108
- var HttpSourceResponseSchema = import_zod9.z.object({
1193
+ var HttpSourceResponseSchema = zod.z.object({
1109
1194
  response: NormalizedResponseSchema,
1110
- events: import_zod9.z.array(RawEventSchema),
1195
+ events: zod.z.array(RawEventSchema),
1111
1196
  metadata: HttpSourceResponseMetadataSchema.optional()
1112
1197
  });
1113
- var RegisterTriggerBodySchemaV1 = import_zod9.z.object({
1198
+ var WebhookDeliveryResponseSchema = zod.z.object({
1199
+ response: NormalizedResponseSchema,
1200
+ verified: zod.z.boolean(),
1201
+ error: zod.z.string().optional()
1202
+ });
1203
+ var RegisterTriggerBodySchemaV1 = zod.z.object({
1114
1204
  rule: EventRuleSchema,
1115
1205
  source: SourceMetadataV1Schema
1116
1206
  });
1117
- var RegisterTriggerBodySchemaV2 = import_zod9.z.object({
1207
+ var RegisterTriggerBodySchemaV2 = zod.z.object({
1118
1208
  rule: EventRuleSchema,
1119
- source: SourceMetadataV2Schema
1209
+ source: SourceMetadataV2Schema,
1210
+ accountId: zod.z.string().optional()
1120
1211
  });
1121
- var InitializeTriggerBodySchema = import_zod9.z.object({
1122
- id: import_zod9.z.string(),
1123
- params: import_zod9.z.any(),
1124
- accountId: import_zod9.z.string().optional(),
1125
- metadata: import_zod9.z.any().optional()
1212
+ var InitializeTriggerBodySchema = zod.z.object({
1213
+ id: zod.z.string(),
1214
+ params: zod.z.any(),
1215
+ accountId: zod.z.string().optional(),
1216
+ metadata: zod.z.any().optional()
1126
1217
  });
1127
- var RegisterCommonScheduleBodySchema = import_zod9.z.object({
1218
+ var RegisterCommonScheduleBodySchema = zod.z.object({
1128
1219
  /** A unique id for the schedule. This is used to identify and unregister the schedule later. */
1129
- id: import_zod9.z.string(),
1220
+ id: zod.z.string(),
1130
1221
  /** Any additional metadata about the schedule. */
1131
- metadata: import_zod9.z.any(),
1132
- /** This will be used by the Trigger.dev Connect feature, which is coming soon. */
1133
- accountId: import_zod9.z.string().optional()
1222
+ metadata: zod.z.any(),
1223
+ /** An optional Account ID to associate with runs triggered by this schedule */
1224
+ accountId: zod.z.string().optional()
1134
1225
  });
1135
1226
  var RegisterIntervalScheduleBodySchema = RegisterCommonScheduleBodySchema.merge(IntervalMetadataSchema);
1136
1227
  var InitializeCronScheduleBodySchema = RegisterCommonScheduleBodySchema.merge(CronMetadataSchema);
1137
- var RegisterScheduleBodySchema = import_zod9.z.discriminatedUnion("type", [
1228
+ var RegisterScheduleBodySchema = zod.z.discriminatedUnion("type", [
1138
1229
  RegisterIntervalScheduleBodySchema,
1139
1230
  InitializeCronScheduleBodySchema
1140
1231
  ]);
1141
- var RegisterScheduleResponseBodySchema = import_zod9.z.object({
1142
- id: import_zod9.z.string(),
1232
+ var RegisterScheduleResponseBodySchema = zod.z.object({
1233
+ id: zod.z.string(),
1143
1234
  schedule: ScheduleMetadataSchema,
1144
- metadata: import_zod9.z.any(),
1145
- active: import_zod9.z.boolean()
1235
+ metadata: zod.z.any(),
1236
+ active: zod.z.boolean()
1146
1237
  });
1147
- var CreateExternalConnectionBodySchema = import_zod9.z.object({
1148
- accessToken: import_zod9.z.string(),
1149
- type: import_zod9.z.enum([
1238
+ var CreateExternalConnectionBodySchema = zod.z.object({
1239
+ accessToken: zod.z.string(),
1240
+ type: zod.z.enum([
1150
1241
  "oauth2"
1151
1242
  ]),
1152
- scopes: import_zod9.z.array(import_zod9.z.string()).optional(),
1153
- metadata: import_zod9.z.any()
1154
- });
1155
- var DeployBackgroundTaskRequestBodySchema = import_zod9.z.object({
1156
- id: import_zod9.z.string(),
1157
- version: import_zod9.z.string(),
1158
- fileName: import_zod9.z.string(),
1159
- bundle: import_zod9.z.string(),
1160
- sourcemap: import_zod9.z.object({
1161
- version: import_zod9.z.number(),
1162
- sources: import_zod9.z.array(import_zod9.z.string()),
1163
- mappings: import_zod9.z.string(),
1164
- sourcesContent: import_zod9.z.array(import_zod9.z.string()),
1165
- names: import_zod9.z.array(import_zod9.z.string())
1243
+ scopes: zod.z.array(zod.z.string()).optional(),
1244
+ metadata: zod.z.any()
1245
+ });
1246
+ var GetRunStatusesSchema = zod.z.object({
1247
+ run: zod.z.object({
1248
+ id: zod.z.string(),
1249
+ status: RunStatusSchema,
1250
+ output: zod.z.any().optional()
1166
1251
  }),
1167
- dependencies: import_zod9.z.record(import_zod9.z.string()),
1168
- nodeVersion: import_zod9.z.string()
1252
+ statuses: zod.z.array(JobRunStatusRecordSchema)
1169
1253
  });
1170
-
1171
- // src/schemas/notifications.ts
1172
- var import_zod10 = require("zod");
1254
+ var InvokeJobResponseSchema = zod.z.object({
1255
+ id: zod.z.string()
1256
+ });
1257
+ var InvokeJobRequestBodySchema = zod.z.object({
1258
+ payload: zod.z.any(),
1259
+ context: zod.z.any().optional(),
1260
+ options: zod.z.object({
1261
+ accountId: zod.z.string().optional(),
1262
+ callbackUrl: zod.z.string().optional()
1263
+ }).optional()
1264
+ });
1265
+ var InvokeOptionsSchema = zod.z.object({
1266
+ accountId: zod.z.string().optional(),
1267
+ idempotencyKey: zod.z.string().optional(),
1268
+ context: zod.z.any().optional(),
1269
+ callbackUrl: zod.z.string().optional()
1270
+ });
1271
+ var EphemeralEventDispatcherRequestBodySchema = zod.z.object({
1272
+ url: zod.z.string(),
1273
+ name: zod.z.string().or(zod.z.array(zod.z.string())),
1274
+ source: zod.z.string().optional(),
1275
+ filter: EventFilterSchema.optional(),
1276
+ contextFilter: EventFilterSchema.optional(),
1277
+ accountId: zod.z.string().optional(),
1278
+ timeoutInSeconds: zod.z.number().int().positive().min(10).max(60 * 60 * 24 * 365).default(3600)
1279
+ });
1280
+ var EphemeralEventDispatcherResponseBodySchema = zod.z.object({
1281
+ id: zod.z.string()
1282
+ });
1283
+ var KeyValueStoreResponseBodySchema = zod.z.discriminatedUnion("action", [
1284
+ zod.z.object({
1285
+ action: zod.z.literal("DELETE"),
1286
+ key: zod.z.string(),
1287
+ deleted: zod.z.boolean()
1288
+ }),
1289
+ zod.z.object({
1290
+ action: zod.z.literal("GET"),
1291
+ key: zod.z.string(),
1292
+ value: zod.z.string().optional()
1293
+ }),
1294
+ zod.z.object({
1295
+ action: zod.z.literal("HAS"),
1296
+ key: zod.z.string(),
1297
+ has: zod.z.boolean()
1298
+ }),
1299
+ zod.z.object({
1300
+ action: zod.z.literal("SET"),
1301
+ key: zod.z.string(),
1302
+ value: zod.z.string().optional()
1303
+ })
1304
+ ]);
1173
1305
  var MISSING_CONNECTION_NOTIFICATION = "dev.trigger.notifications.missingConnection";
1174
1306
  var MISSING_CONNECTION_RESOLVED_NOTIFICATION = "dev.trigger.notifications.missingConnectionResolved";
1175
- var CommonMissingConnectionNotificationPayloadSchema = import_zod10.z.object({
1176
- id: import_zod10.z.string(),
1177
- client: import_zod10.z.object({
1178
- id: import_zod10.z.string(),
1179
- title: import_zod10.z.string(),
1180
- scopes: import_zod10.z.array(import_zod10.z.string()),
1181
- createdAt: import_zod10.z.coerce.date(),
1182
- updatedAt: import_zod10.z.coerce.date()
1307
+ var CommonMissingConnectionNotificationPayloadSchema = zod.z.object({
1308
+ id: zod.z.string(),
1309
+ client: zod.z.object({
1310
+ id: zod.z.string(),
1311
+ title: zod.z.string(),
1312
+ scopes: zod.z.array(zod.z.string()),
1313
+ createdAt: zod.z.coerce.date(),
1314
+ updatedAt: zod.z.coerce.date()
1183
1315
  }),
1184
- authorizationUrl: import_zod10.z.string()
1316
+ authorizationUrl: zod.z.string()
1185
1317
  });
1186
1318
  var MissingDeveloperConnectionNotificationPayloadSchema = CommonMissingConnectionNotificationPayloadSchema.extend({
1187
- type: import_zod10.z.literal("DEVELOPER")
1319
+ type: zod.z.literal("DEVELOPER")
1188
1320
  });
1189
1321
  var MissingExternalConnectionNotificationPayloadSchema = CommonMissingConnectionNotificationPayloadSchema.extend({
1190
- type: import_zod10.z.literal("EXTERNAL"),
1191
- account: import_zod10.z.object({
1192
- id: import_zod10.z.string(),
1193
- metadata: import_zod10.z.any()
1322
+ type: zod.z.literal("EXTERNAL"),
1323
+ account: zod.z.object({
1324
+ id: zod.z.string(),
1325
+ metadata: zod.z.any()
1194
1326
  })
1195
1327
  });
1196
- var MissingConnectionNotificationPayloadSchema = import_zod10.z.discriminatedUnion("type", [
1328
+ var MissingConnectionNotificationPayloadSchema = zod.z.discriminatedUnion("type", [
1197
1329
  MissingDeveloperConnectionNotificationPayloadSchema,
1198
1330
  MissingExternalConnectionNotificationPayloadSchema
1199
1331
  ]);
1200
- var CommonMissingConnectionNotificationResolvedPayloadSchema = import_zod10.z.object({
1201
- id: import_zod10.z.string(),
1202
- client: import_zod10.z.object({
1203
- id: import_zod10.z.string(),
1204
- title: import_zod10.z.string(),
1205
- scopes: import_zod10.z.array(import_zod10.z.string()),
1206
- createdAt: import_zod10.z.coerce.date(),
1207
- updatedAt: import_zod10.z.coerce.date(),
1208
- integrationIdentifier: import_zod10.z.string(),
1209
- integrationAuthMethod: import_zod10.z.string()
1332
+ var CommonMissingConnectionNotificationResolvedPayloadSchema = zod.z.object({
1333
+ id: zod.z.string(),
1334
+ client: zod.z.object({
1335
+ id: zod.z.string(),
1336
+ title: zod.z.string(),
1337
+ scopes: zod.z.array(zod.z.string()),
1338
+ createdAt: zod.z.coerce.date(),
1339
+ updatedAt: zod.z.coerce.date(),
1340
+ integrationIdentifier: zod.z.string(),
1341
+ integrationAuthMethod: zod.z.string()
1210
1342
  }),
1211
- expiresAt: import_zod10.z.coerce.date()
1343
+ expiresAt: zod.z.coerce.date()
1212
1344
  });
1213
1345
  var MissingDeveloperConnectionResolvedNotificationPayloadSchema = CommonMissingConnectionNotificationResolvedPayloadSchema.extend({
1214
- type: import_zod10.z.literal("DEVELOPER")
1346
+ type: zod.z.literal("DEVELOPER")
1215
1347
  });
1216
1348
  var MissingExternalConnectionResolvedNotificationPayloadSchema = CommonMissingConnectionNotificationResolvedPayloadSchema.extend({
1217
- type: import_zod10.z.literal("EXTERNAL"),
1218
- account: import_zod10.z.object({
1219
- id: import_zod10.z.string(),
1220
- metadata: import_zod10.z.any()
1349
+ type: zod.z.literal("EXTERNAL"),
1350
+ account: zod.z.object({
1351
+ id: zod.z.string(),
1352
+ metadata: zod.z.any()
1221
1353
  })
1222
1354
  });
1223
- var MissingConnectionResolvedNotificationPayloadSchema = import_zod10.z.discriminatedUnion("type", [
1355
+ var MissingConnectionResolvedNotificationPayloadSchema = zod.z.discriminatedUnion("type", [
1224
1356
  MissingDeveloperConnectionResolvedNotificationPayloadSchema,
1225
1357
  MissingExternalConnectionResolvedNotificationPayloadSchema
1226
1358
  ]);
1227
-
1228
- // src/schemas/fetch.ts
1229
- var import_zod11 = require("zod");
1230
- var FetchRetryHeadersStrategySchema = import_zod11.z.object({
1359
+ var FetchRetryHeadersStrategySchema = zod.z.object({
1231
1360
  /** The `headers` strategy retries the request using info from the response headers. */
1232
- strategy: import_zod11.z.literal("headers"),
1361
+ strategy: zod.z.literal("headers"),
1233
1362
  /** The header to use to determine the maximum number of times to retry the request. */
1234
- limitHeader: import_zod11.z.string(),
1363
+ limitHeader: zod.z.string(),
1235
1364
  /** The header to use to determine the number of remaining retries. */
1236
- remainingHeader: import_zod11.z.string(),
1365
+ remainingHeader: zod.z.string(),
1237
1366
  /** The header to use to determine the time when the number of remaining retries will be reset. */
1238
- resetHeader: import_zod11.z.string()
1367
+ resetHeader: zod.z.string(),
1368
+ /** The event filter to use to determine if the request should be retried. */
1369
+ bodyFilter: EventFilterSchema.optional(),
1370
+ /** The format of the `resetHeader` value. */
1371
+ resetFormat: zod.z.enum([
1372
+ "unix_timestamp",
1373
+ "unix_timestamp_in_ms",
1374
+ "iso_8601",
1375
+ "iso_8601_duration_openai_variant"
1376
+ ]).default("unix_timestamp")
1239
1377
  });
1240
1378
  var FetchRetryBackoffStrategySchema = RetryOptionsSchema.extend({
1241
1379
  /** The `backoff` strategy retries the request with an exponential backoff. */
1242
- strategy: import_zod11.z.literal("backoff")
1380
+ strategy: zod.z.literal("backoff"),
1381
+ /** The event filter to use to determine if the request should be retried. */
1382
+ bodyFilter: EventFilterSchema.optional()
1243
1383
  });
1244
- var FetchRetryStrategySchema = import_zod11.z.discriminatedUnion("strategy", [
1384
+ var FetchRetryStrategySchema = zod.z.discriminatedUnion("strategy", [
1245
1385
  FetchRetryHeadersStrategySchema,
1246
1386
  FetchRetryBackoffStrategySchema
1247
1387
  ]);
1248
- var FetchRequestInitSchema = import_zod11.z.object({
1388
+ var FetchRequestInitSchema = zod.z.object({
1249
1389
  /** The HTTP method to use for the request. */
1250
- method: import_zod11.z.string().optional(),
1390
+ method: zod.z.string().optional(),
1251
1391
  /** 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. */
1252
- headers: import_zod11.z.record(import_zod11.z.union([
1253
- import_zod11.z.string(),
1392
+ headers: zod.z.record(zod.z.union([
1393
+ zod.z.string(),
1254
1394
  RedactStringSchema
1255
1395
  ])).optional(),
1256
1396
  /** The body of the request. */
1257
- body: import_zod11.z.union([
1258
- import_zod11.z.string(),
1259
- import_zod11.z.instanceof(ArrayBuffer)
1397
+ body: zod.z.union([
1398
+ zod.z.string(),
1399
+ zod.z.instanceof(ArrayBuffer)
1260
1400
  ]).optional()
1261
1401
  });
1262
- var FetchRetryOptionsSchema = import_zod11.z.record(FetchRetryStrategySchema);
1263
- var FetchOperationSchema = import_zod11.z.object({
1264
- url: import_zod11.z.string(),
1265
- requestInit: FetchRequestInitSchema.optional(),
1266
- retry: import_zod11.z.record(FetchRetryStrategySchema).optional()
1267
- });
1268
-
1269
- // src/schemas/events.ts
1270
- var import_zod13 = require("zod");
1271
-
1272
- // src/schemas/runs.ts
1273
- var import_zod12 = require("zod");
1274
- var RunStatusSchema = import_zod12.z.union([
1275
- import_zod12.z.literal("PENDING"),
1276
- import_zod12.z.literal("QUEUED"),
1277
- import_zod12.z.literal("WAITING_ON_CONNECTIONS"),
1278
- import_zod12.z.literal("PREPROCESSING"),
1279
- import_zod12.z.literal("STARTED"),
1280
- import_zod12.z.literal("SUCCESS"),
1281
- import_zod12.z.literal("FAILURE"),
1282
- import_zod12.z.literal("TIMED_OUT"),
1283
- import_zod12.z.literal("ABORTED"),
1284
- import_zod12.z.literal("CANCELED")
1285
- ]);
1286
- var RunTaskSchema = import_zod12.z.object({
1287
- /** The Task id */
1288
- id: import_zod12.z.string(),
1289
- /** The key that you defined when creating the Task, the first param in any task. */
1290
- displayKey: import_zod12.z.string().nullable(),
1291
- /** The Task status */
1292
- status: TaskStatusSchema,
1293
- /** The name of the Task */
1294
- name: import_zod12.z.string(),
1295
- /** The icon of the Task, a string.
1296
- * For integrations, this will be a lowercase name of the company.
1297
- * Can be used with the [@trigger.dev/companyicons](https://www.npmjs.com/package/@trigger.dev/companyicons) package to display an svg. */
1298
- icon: import_zod12.z.string().nullable(),
1299
- /** When the task started */
1300
- startedAt: import_zod12.z.coerce.date().nullable(),
1301
- /** When the task completed */
1302
- completedAt: import_zod12.z.coerce.date().nullable()
1303
- });
1304
- var RunTaskWithSubtasksSchema = RunTaskSchema.extend({
1305
- subtasks: import_zod12.z.lazy(() => RunTaskWithSubtasksSchema.array()).optional()
1306
- });
1307
- var GetRunOptionsSchema = import_zod12.z.object({
1308
- /** Return subtasks, which appear in a `subtasks` array on a task. @default false */
1309
- subtasks: import_zod12.z.boolean().optional(),
1310
- /** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */
1311
- cursor: import_zod12.z.string().optional(),
1312
- /** How many tasks you want to return in one go, max 50. @default 20 */
1313
- take: import_zod12.z.number().optional()
1314
- });
1315
- var GetRunOptionsWithTaskDetailsSchema = GetRunOptionsSchema.extend({
1316
- /** If `true`, it returns the `params` and `output` of all tasks. @default false */
1317
- taskdetails: import_zod12.z.boolean().optional()
1318
- });
1319
- var RunSchema = import_zod12.z.object({
1320
- /** The Run id */
1321
- id: import_zod12.z.string(),
1322
- /** The Run status */
1323
- status: RunStatusSchema,
1324
- /** When the run started */
1325
- startedAt: import_zod12.z.coerce.date().nullable(),
1326
- /** When the run was last updated */
1327
- updatedAt: import_zod12.z.coerce.date().nullable(),
1328
- /** When the run was completed */
1329
- completedAt: import_zod12.z.coerce.date().nullable()
1330
- });
1331
- var GetRunSchema = RunSchema.extend({
1332
- /** The output of the run */
1333
- output: import_zod12.z.any().optional(),
1334
- /** The tasks from the run */
1335
- tasks: import_zod12.z.array(RunTaskWithSubtasksSchema),
1336
- /** If there are more tasks, you can use this to get them */
1337
- nextCursor: import_zod12.z.string().optional()
1338
- });
1339
- var GetRunsOptionsSchema = import_zod12.z.object({
1340
- /** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */
1341
- cursor: import_zod12.z.string().optional(),
1342
- /** How many runs you want to return in one go, max 50. @default 20 */
1343
- take: import_zod12.z.number().optional()
1402
+ var FetchRetryOptionsSchema = zod.z.record(FetchRetryStrategySchema);
1403
+ var FetchTimeoutOptionsSchema = zod.z.object({
1404
+ durationInMs: zod.z.number(),
1405
+ retry: RetryOptionsSchema.optional()
1344
1406
  });
1345
- var GetRunsSchema = import_zod12.z.object({
1346
- /** The runs from the query */
1347
- runs: RunSchema.array(),
1348
- /** If there are more runs, you can use this to get them */
1349
- nextCursor: import_zod12.z.string().optional()
1407
+ var FetchOperationSchema = zod.z.object({
1408
+ url: zod.z.string(),
1409
+ requestInit: FetchRequestInitSchema.optional(),
1410
+ retry: zod.z.record(FetchRetryStrategySchema).optional(),
1411
+ timeout: FetchTimeoutOptionsSchema.optional()
1412
+ });
1413
+ var FetchPollOperationSchema = zod.z.object({
1414
+ url: zod.z.string(),
1415
+ interval: zod.z.number().int().positive().min(10).max(600).default(10),
1416
+ timeout: zod.z.number().int().positive().min(30).max(3600).default(600),
1417
+ responseFilter: ResponseFilterSchema,
1418
+ requestInit: FetchRequestInitSchema.optional(),
1419
+ requestTimeout: FetchTimeoutOptionsSchema.optional()
1350
1420
  });
1351
-
1352
- // src/schemas/events.ts
1353
- var GetEventSchema = import_zod13.z.object({
1421
+ var GetEventSchema = zod.z.object({
1354
1422
  /** The event id */
1355
- id: import_zod13.z.string(),
1423
+ id: zod.z.string(),
1356
1424
  /** The event name */
1357
- name: import_zod13.z.string(),
1425
+ name: zod.z.string(),
1358
1426
  /** When the event was created */
1359
- createdAt: import_zod13.z.coerce.date(),
1427
+ createdAt: zod.z.coerce.date(),
1360
1428
  /** When the event was last updated */
1361
- updatedAt: import_zod13.z.coerce.date(),
1429
+ updatedAt: zod.z.coerce.date(),
1362
1430
  /** The runs that were triggered by the event */
1363
- runs: import_zod13.z.array(import_zod13.z.object({
1431
+ runs: zod.z.array(zod.z.object({
1364
1432
  /** The Run id */
1365
- id: import_zod13.z.string(),
1433
+ id: zod.z.string(),
1366
1434
  /** The Run status */
1367
1435
  status: RunStatusSchema,
1368
1436
  /** When the run started */
1369
- startedAt: import_zod13.z.coerce.date().optional().nullable(),
1437
+ startedAt: zod.z.coerce.date().optional().nullable(),
1370
1438
  /** When the run completed */
1371
- completedAt: import_zod13.z.coerce.date().optional().nullable()
1439
+ completedAt: zod.z.coerce.date().optional().nullable()
1372
1440
  }))
1373
1441
  });
1442
+ var CancelRunsForEventSchema = zod.z.object({
1443
+ cancelledRunIds: zod.z.array(zod.z.string()),
1444
+ failedToCancelRunIds: zod.z.array(zod.z.string())
1445
+ });
1446
+ var RequestWithRawBodySchema = zod.z.object({
1447
+ url: zod.z.string(),
1448
+ method: zod.z.string(),
1449
+ headers: zod.z.record(zod.z.string()),
1450
+ rawBody: zod.z.string()
1451
+ });
1452
+ var CancelRunsForJobSchema = zod.z.object({
1453
+ cancelledRunIds: zod.z.array(zod.z.string()),
1454
+ failedToCancelRunIds: zod.z.array(zod.z.string())
1455
+ });
1374
1456
 
1375
1457
  // src/utils.ts
1376
1458
  function deepMergeFilters(...filters) {
@@ -1391,6 +1473,10 @@ function deepMergeFilters(...filters) {
1391
1473
  return result;
1392
1474
  }
1393
1475
  __name(deepMergeFilters, "deepMergeFilters");
1476
+ function assertExhaustive(x) {
1477
+ throw new Error("Unexpected object: " + x);
1478
+ }
1479
+ __name(assertExhaustive, "assertExhaustive");
1394
1480
 
1395
1481
  // src/retry.ts
1396
1482
  var DEFAULT_RETRY_OPTIONS = {
@@ -1415,6 +1501,73 @@ function calculateRetryAt(retryOptions, attempts) {
1415
1501
  return new Date(Date.now() + timeoutInMs);
1416
1502
  }
1417
1503
  __name(calculateRetryAt, "calculateRetryAt");
1504
+ function calculateResetAt(resets, format, now = /* @__PURE__ */ new Date()) {
1505
+ if (!resets)
1506
+ return;
1507
+ switch (format) {
1508
+ case "iso_8601_duration_openai_variant": {
1509
+ return calculateISO8601DurationOpenAIVariantResetAt(resets, now);
1510
+ }
1511
+ case "iso_8601": {
1512
+ return calculateISO8601ResetAt(resets, now);
1513
+ }
1514
+ case "unix_timestamp": {
1515
+ return calculateUnixTimestampResetAt(resets, now);
1516
+ }
1517
+ case "unix_timestamp_in_ms": {
1518
+ return calculateUnixTimestampInMsResetAt(resets, now);
1519
+ }
1520
+ }
1521
+ }
1522
+ __name(calculateResetAt, "calculateResetAt");
1523
+ function calculateUnixTimestampResetAt(resets, now = /* @__PURE__ */ new Date()) {
1524
+ if (!resets)
1525
+ return void 0;
1526
+ const resetAt = parseInt(resets, 10);
1527
+ if (isNaN(resetAt))
1528
+ return void 0;
1529
+ return new Date(resetAt * 1e3);
1530
+ }
1531
+ __name(calculateUnixTimestampResetAt, "calculateUnixTimestampResetAt");
1532
+ function calculateUnixTimestampInMsResetAt(resets, now = /* @__PURE__ */ new Date()) {
1533
+ if (!resets)
1534
+ return void 0;
1535
+ const resetAt = parseInt(resets, 10);
1536
+ if (isNaN(resetAt))
1537
+ return void 0;
1538
+ return new Date(resetAt);
1539
+ }
1540
+ __name(calculateUnixTimestampInMsResetAt, "calculateUnixTimestampInMsResetAt");
1541
+ function calculateISO8601ResetAt(resets, now = /* @__PURE__ */ new Date()) {
1542
+ if (!resets)
1543
+ return void 0;
1544
+ const resetAt = new Date(resets);
1545
+ if (isNaN(resetAt.getTime()))
1546
+ return void 0;
1547
+ return resetAt;
1548
+ }
1549
+ __name(calculateISO8601ResetAt, "calculateISO8601ResetAt");
1550
+ function calculateISO8601DurationOpenAIVariantResetAt(resets, now = /* @__PURE__ */ new Date()) {
1551
+ if (!resets)
1552
+ return void 0;
1553
+ const pattern = /^(?:(\d+)d)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+(?:\.\d+)?)s)?(?:(\d+)ms)?$/;
1554
+ const match = resets.match(pattern);
1555
+ if (!match)
1556
+ return void 0;
1557
+ const days = parseInt(match[1], 10) || 0;
1558
+ const hours = parseInt(match[2], 10) || 0;
1559
+ const minutes = parseInt(match[3], 10) || 0;
1560
+ const seconds = parseFloat(match[4]) || 0;
1561
+ const milliseconds = parseInt(match[5], 10) || 0;
1562
+ const resetAt = new Date(now);
1563
+ resetAt.setDate(resetAt.getDate() + days);
1564
+ resetAt.setHours(resetAt.getHours() + hours);
1565
+ resetAt.setMinutes(resetAt.getMinutes() + minutes);
1566
+ resetAt.setSeconds(resetAt.getSeconds() + Math.floor(seconds));
1567
+ resetAt.setMilliseconds(resetAt.getMilliseconds() + (seconds - Math.floor(seconds)) * 1e3 + milliseconds);
1568
+ return resetAt;
1569
+ }
1570
+ __name(calculateISO8601DurationOpenAIVariantResetAt, "calculateISO8601DurationOpenAIVariantResetAt");
1418
1571
 
1419
1572
  // src/replacements.ts
1420
1573
  var currentDate = {
@@ -1448,7 +1601,9 @@ function urlWithSearchParams(url, params) {
1448
1601
  }
1449
1602
  const urlObj = new URL(url);
1450
1603
  for (const [key, value] of Object.entries(params)) {
1451
- urlObj.searchParams.append(key, String(value));
1604
+ if (value !== void 0) {
1605
+ urlObj.searchParams.append(key, String(value));
1606
+ }
1452
1607
  }
1453
1608
  return urlObj.toString();
1454
1609
  }
@@ -1456,6 +1611,13 @@ __name(urlWithSearchParams, "urlWithSearchParams");
1456
1611
 
1457
1612
  // src/eventFilterMatches.ts
1458
1613
  function eventFilterMatches(payload, filter) {
1614
+ if (payload === void 0 || payload === null) {
1615
+ if (Object.entries(filter).length === 0) {
1616
+ return true;
1617
+ } else {
1618
+ return false;
1619
+ }
1620
+ }
1459
1621
  for (const [patternKey, patternValue] of Object.entries(filter)) {
1460
1622
  const payloadValue = payload[patternKey];
1461
1623
  if (Array.isArray(patternValue)) {
@@ -1503,7 +1665,7 @@ __name(eventFilterMatches, "eventFilterMatches");
1503
1665
  function contentFiltersMatches(actualValue, contentFilters) {
1504
1666
  for (const contentFilter of contentFilters) {
1505
1667
  if (typeof contentFilter === "object") {
1506
- const [key, value] = Object.entries(contentFilter)[0];
1668
+ Object.entries(contentFilter)[0];
1507
1669
  if (!contentFilterMatches(actualValue, contentFilter)) {
1508
1670
  return false;
1509
1671
  }
@@ -1592,7 +1754,290 @@ function contentFilterMatches(actualValue, contentFilter) {
1592
1754
  }
1593
1755
  return actualValue !== null;
1594
1756
  }
1757
+ if ("$not" in contentFilter) {
1758
+ if (Array.isArray(actualValue)) {
1759
+ return !actualValue.includes(contentFilter.$not);
1760
+ } else if (typeof actualValue === "number" || typeof actualValue === "boolean" || typeof actualValue === "string") {
1761
+ return actualValue !== contentFilter.$not;
1762
+ }
1763
+ return false;
1764
+ }
1595
1765
  return true;
1596
1766
  }
1597
1767
  __name(contentFilterMatches, "contentFilterMatches");
1768
+
1769
+ // src/requestFilterMatches.ts
1770
+ async function requestFilterMatches(request, filter) {
1771
+ const clonedRequest = request.clone();
1772
+ if (!requestMethodMatches(clonedRequest.method, filter.method)) {
1773
+ return false;
1774
+ }
1775
+ const headersObj = Object.fromEntries(clonedRequest.headers.entries());
1776
+ if (filter.headers && !eventFilterMatches(headersObj, filter.headers)) {
1777
+ return false;
1778
+ }
1779
+ const searchParams = new URL(clonedRequest.url).searchParams;
1780
+ const searchParamsObject = {};
1781
+ for (const [key, value] of searchParams.entries()) {
1782
+ searchParamsObject[key] = value;
1783
+ }
1784
+ if (filter.query && !eventFilterMatches(searchParamsObject, filter.query)) {
1785
+ return false;
1786
+ }
1787
+ try {
1788
+ const json = await clonedRequest.json();
1789
+ if (filter.body && !eventFilterMatches(json, filter.body)) {
1790
+ return false;
1791
+ }
1792
+ } catch (e) {
1793
+ if (filter.body) {
1794
+ return false;
1795
+ }
1796
+ }
1797
+ return true;
1798
+ }
1799
+ __name(requestFilterMatches, "requestFilterMatches");
1800
+ async function responseFilterMatches(response, filter) {
1801
+ if (filter.headers && !eventFilterMatches(response.headers, filter.headers)) {
1802
+ return {
1803
+ match: false
1804
+ };
1805
+ }
1806
+ try {
1807
+ const json = await response.json();
1808
+ if (filter.body && !eventFilterMatches(json, filter.body)) {
1809
+ return {
1810
+ match: false,
1811
+ body: json
1812
+ };
1813
+ } else {
1814
+ return {
1815
+ match: true,
1816
+ body: json
1817
+ };
1818
+ }
1819
+ } catch (e) {
1820
+ if (filter.body) {
1821
+ return {
1822
+ match: false,
1823
+ body: void 0
1824
+ };
1825
+ }
1826
+ }
1827
+ return {
1828
+ match: true,
1829
+ body: void 0
1830
+ };
1831
+ }
1832
+ __name(responseFilterMatches, "responseFilterMatches");
1833
+ function requestMethodMatches(method, filter) {
1834
+ if (!filter) {
1835
+ return true;
1836
+ }
1837
+ return filter.includes(method);
1838
+ }
1839
+ __name(requestMethodMatches, "requestMethodMatches");
1840
+
1841
+ // src/index.ts
1842
+ var API_VERSIONS = {
1843
+ LAZY_LOADED_CACHED_TASKS: "2023-09-29",
1844
+ SERIALIZED_TASK_OUTPUT: "2023-11-01"
1845
+ };
1846
+ var PLATFORM_FEATURES = {
1847
+ yieldExecution: API_VERSIONS.LAZY_LOADED_CACHED_TASKS,
1848
+ lazyLoadedCachedTasks: API_VERSIONS.LAZY_LOADED_CACHED_TASKS
1849
+ };
1850
+ function supportsFeature(featureName, version) {
1851
+ if (version === "unversioned" || version === "unknown") {
1852
+ return false;
1853
+ }
1854
+ const supportedVersion = PLATFORM_FEATURES[featureName];
1855
+ if (!supportedVersion) {
1856
+ return false;
1857
+ }
1858
+ return version >= supportedVersion;
1859
+ }
1860
+ __name(supportsFeature, "supportsFeature");
1861
+
1862
+ exports.API_VERSIONS = API_VERSIONS;
1863
+ exports.ApiEventLogSchema = ApiEventLogSchema;
1864
+ exports.AutoYieldConfigSchema = AutoYieldConfigSchema;
1865
+ exports.AutoYieldMetadataSchema = AutoYieldMetadataSchema;
1866
+ exports.CachedTaskSchema = CachedTaskSchema;
1867
+ exports.CancelRunsForEventSchema = CancelRunsForEventSchema;
1868
+ exports.CancelRunsForJobSchema = CancelRunsForJobSchema;
1869
+ exports.CommonMissingConnectionNotificationPayloadSchema = CommonMissingConnectionNotificationPayloadSchema;
1870
+ exports.CommonMissingConnectionNotificationResolvedPayloadSchema = CommonMissingConnectionNotificationResolvedPayloadSchema;
1871
+ exports.CompleteTaskBodyInputSchema = CompleteTaskBodyInputSchema;
1872
+ exports.CompleteTaskBodyV2InputSchema = CompleteTaskBodyV2InputSchema;
1873
+ exports.ConcurrencyLimitOptionsSchema = ConcurrencyLimitOptionsSchema;
1874
+ exports.ConnectionAuthSchema = ConnectionAuthSchema;
1875
+ exports.CreateExternalConnectionBodySchema = CreateExternalConnectionBodySchema;
1876
+ exports.CreateRunResponseBodySchema = CreateRunResponseBodySchema;
1877
+ exports.CronMetadataSchema = CronMetadataSchema;
1878
+ exports.CronOptionsSchema = CronOptionsSchema;
1879
+ exports.DELIVER_WEBHOOK_REQUEST = DELIVER_WEBHOOK_REQUEST;
1880
+ exports.DeliverEventResponseSchema = DeliverEventResponseSchema;
1881
+ exports.DeserializedJsonSchema = DeserializedJsonSchema;
1882
+ exports.DisplayPropertiesSchema = DisplayPropertiesSchema;
1883
+ exports.DisplayPropertySchema = DisplayPropertySchema;
1884
+ exports.DynamicTriggerEndpointMetadataSchema = DynamicTriggerEndpointMetadataSchema;
1885
+ exports.DynamicTriggerMetadataSchema = DynamicTriggerMetadataSchema;
1886
+ exports.EndpointHeadersSchema = EndpointHeadersSchema;
1887
+ exports.EndpointIndexErrorSchema = EndpointIndexErrorSchema;
1888
+ exports.EphemeralEventDispatcherRequestBodySchema = EphemeralEventDispatcherRequestBodySchema;
1889
+ exports.EphemeralEventDispatcherResponseBodySchema = EphemeralEventDispatcherResponseBodySchema;
1890
+ exports.ErrorWithStackSchema = ErrorWithStackSchema;
1891
+ exports.EventExampleSchema = EventExampleSchema;
1892
+ exports.EventFilterSchema = EventFilterSchema;
1893
+ exports.EventRuleSchema = EventRuleSchema;
1894
+ exports.EventSpecificationSchema = EventSpecificationSchema;
1895
+ exports.ExecuteJobHeadersSchema = ExecuteJobHeadersSchema;
1896
+ exports.ExecuteJobRunMetadataSchema = ExecuteJobRunMetadataSchema;
1897
+ exports.FailTaskBodyInputSchema = FailTaskBodyInputSchema;
1898
+ exports.FetchOperationSchema = FetchOperationSchema;
1899
+ exports.FetchPollOperationSchema = FetchPollOperationSchema;
1900
+ exports.FetchRequestInitSchema = FetchRequestInitSchema;
1901
+ exports.FetchRetryBackoffStrategySchema = FetchRetryBackoffStrategySchema;
1902
+ exports.FetchRetryHeadersStrategySchema = FetchRetryHeadersStrategySchema;
1903
+ exports.FetchRetryOptionsSchema = FetchRetryOptionsSchema;
1904
+ exports.FetchRetryStrategySchema = FetchRetryStrategySchema;
1905
+ exports.FetchTimeoutOptionsSchema = FetchTimeoutOptionsSchema;
1906
+ exports.GetEndpointIndexResponseSchema = GetEndpointIndexResponseSchema;
1907
+ exports.GetEventSchema = GetEventSchema;
1908
+ exports.GetRunSchema = GetRunSchema;
1909
+ exports.GetRunStatusesSchema = GetRunStatusesSchema;
1910
+ exports.GetRunsSchema = GetRunsSchema;
1911
+ exports.HTTPMethodUnionSchema = HTTPMethodUnionSchema;
1912
+ exports.HandleTriggerSourceSchema = HandleTriggerSourceSchema;
1913
+ exports.HttpEndpointRequestHeadersSchema = HttpEndpointRequestHeadersSchema;
1914
+ exports.HttpSourceRequestHeadersSchema = HttpSourceRequestHeadersSchema;
1915
+ exports.HttpSourceResponseSchema = HttpSourceResponseSchema;
1916
+ exports.IndexEndpointResponseSchema = IndexEndpointResponseSchema;
1917
+ exports.InitializeCronScheduleBodySchema = InitializeCronScheduleBodySchema;
1918
+ exports.InitializeTriggerBodySchema = InitializeTriggerBodySchema;
1919
+ exports.IntegrationConfigSchema = IntegrationConfigSchema;
1920
+ exports.IntegrationMetadataSchema = IntegrationMetadataSchema;
1921
+ exports.IntervalMetadataSchema = IntervalMetadataSchema;
1922
+ exports.IntervalOptionsSchema = IntervalOptionsSchema;
1923
+ exports.InvokeJobRequestBodySchema = InvokeJobRequestBodySchema;
1924
+ exports.InvokeJobResponseSchema = InvokeJobResponseSchema;
1925
+ exports.InvokeOptionsSchema = InvokeOptionsSchema;
1926
+ exports.InvokeTriggerMetadataSchema = InvokeTriggerMetadataSchema;
1927
+ exports.JobMetadataSchema = JobMetadataSchema;
1928
+ exports.JobRunStatusRecordSchema = JobRunStatusRecordSchema;
1929
+ exports.KeyValueStoreResponseBodySchema = KeyValueStoreResponseBodySchema;
1930
+ exports.LogMessageSchema = LogMessageSchema;
1931
+ exports.MISSING_CONNECTION_NOTIFICATION = MISSING_CONNECTION_NOTIFICATION;
1932
+ exports.MISSING_CONNECTION_RESOLVED_NOTIFICATION = MISSING_CONNECTION_RESOLVED_NOTIFICATION;
1933
+ exports.MissingConnectionNotificationPayloadSchema = MissingConnectionNotificationPayloadSchema;
1934
+ exports.MissingConnectionResolvedNotificationPayloadSchema = MissingConnectionResolvedNotificationPayloadSchema;
1935
+ exports.MissingDeveloperConnectionNotificationPayloadSchema = MissingDeveloperConnectionNotificationPayloadSchema;
1936
+ exports.MissingDeveloperConnectionResolvedNotificationPayloadSchema = MissingDeveloperConnectionResolvedNotificationPayloadSchema;
1937
+ exports.MissingExternalConnectionNotificationPayloadSchema = MissingExternalConnectionNotificationPayloadSchema;
1938
+ exports.MissingExternalConnectionResolvedNotificationPayloadSchema = MissingExternalConnectionResolvedNotificationPayloadSchema;
1939
+ exports.NormalizedRequestSchema = NormalizedRequestSchema;
1940
+ exports.NormalizedResponseSchema = NormalizedResponseSchema;
1941
+ exports.PLATFORM_FEATURES = PLATFORM_FEATURES;
1942
+ exports.PongErrorResponseSchema = PongErrorResponseSchema;
1943
+ exports.PongResponseSchema = PongResponseSchema;
1944
+ exports.PongSuccessResponseSchema = PongSuccessResponseSchema;
1945
+ exports.PreprocessRunBodySchema = PreprocessRunBodySchema;
1946
+ exports.PreprocessRunResponseSchema = PreprocessRunResponseSchema;
1947
+ exports.QueueOptionsSchema = QueueOptionsSchema;
1948
+ exports.REGISTER_SOURCE_EVENT_V1 = REGISTER_SOURCE_EVENT_V1;
1949
+ exports.REGISTER_SOURCE_EVENT_V2 = REGISTER_SOURCE_EVENT_V2;
1950
+ exports.REGISTER_WEBHOOK = REGISTER_WEBHOOK;
1951
+ exports.RawEventSchema = RawEventSchema;
1952
+ exports.RedactSchema = RedactSchema;
1953
+ exports.RedactStringSchema = RedactStringSchema;
1954
+ exports.RegisterDynamicSchedulePayloadSchema = RegisterDynamicSchedulePayloadSchema;
1955
+ exports.RegisterHTTPTriggerSourceBodySchema = RegisterHTTPTriggerSourceBodySchema;
1956
+ exports.RegisterIntervalScheduleBodySchema = RegisterIntervalScheduleBodySchema;
1957
+ exports.RegisterSMTPTriggerSourceBodySchema = RegisterSMTPTriggerSourceBodySchema;
1958
+ exports.RegisterSQSTriggerSourceBodySchema = RegisterSQSTriggerSourceBodySchema;
1959
+ exports.RegisterScheduleBodySchema = RegisterScheduleBodySchema;
1960
+ exports.RegisterScheduleResponseBodySchema = RegisterScheduleResponseBodySchema;
1961
+ exports.RegisterSourceChannelBodySchema = RegisterSourceChannelBodySchema;
1962
+ exports.RegisterSourceEventSchemaV1 = RegisterSourceEventSchemaV1;
1963
+ exports.RegisterSourceEventSchemaV2 = RegisterSourceEventSchemaV2;
1964
+ exports.RegisterTriggerBodySchemaV1 = RegisterTriggerBodySchemaV1;
1965
+ exports.RegisterTriggerBodySchemaV2 = RegisterTriggerBodySchemaV2;
1966
+ exports.RegisterTriggerSourceSchema = RegisterTriggerSourceSchema;
1967
+ exports.RegisterWebhookPayloadSchema = RegisterWebhookPayloadSchema;
1968
+ exports.RegisterWebhookSourceSchema = RegisterWebhookSourceSchema;
1969
+ exports.RequestFilterSchema = RequestFilterSchema;
1970
+ exports.RequestWithRawBodySchema = RequestWithRawBodySchema;
1971
+ exports.ResponseFilterSchema = ResponseFilterSchema;
1972
+ exports.RetryOptionsSchema = RetryOptionsSchema;
1973
+ exports.RunJobAutoYieldExecutionErrorSchema = RunJobAutoYieldExecutionErrorSchema;
1974
+ exports.RunJobAutoYieldWithCompletedTaskExecutionErrorSchema = RunJobAutoYieldWithCompletedTaskExecutionErrorSchema;
1975
+ exports.RunJobBodySchema = RunJobBodySchema;
1976
+ exports.RunJobCanceledWithTaskSchema = RunJobCanceledWithTaskSchema;
1977
+ exports.RunJobErrorResponseSchema = RunJobErrorResponseSchema;
1978
+ exports.RunJobErrorSchema = RunJobErrorSchema;
1979
+ exports.RunJobInvalidPayloadErrorSchema = RunJobInvalidPayloadErrorSchema;
1980
+ exports.RunJobResponseSchema = RunJobResponseSchema;
1981
+ exports.RunJobResumeWithParallelTaskSchema = RunJobResumeWithParallelTaskSchema;
1982
+ exports.RunJobResumeWithTaskSchema = RunJobResumeWithTaskSchema;
1983
+ exports.RunJobRetryWithTaskSchema = RunJobRetryWithTaskSchema;
1984
+ exports.RunJobSuccessSchema = RunJobSuccessSchema;
1985
+ exports.RunJobUnresolvedAuthErrorSchema = RunJobUnresolvedAuthErrorSchema;
1986
+ exports.RunJobYieldExecutionErrorSchema = RunJobYieldExecutionErrorSchema;
1987
+ exports.RunSourceContextSchema = RunSourceContextSchema;
1988
+ exports.RunStatusSchema = RunStatusSchema;
1989
+ exports.RunTaskBodyInputSchema = RunTaskBodyInputSchema;
1990
+ exports.RunTaskBodyOutputSchema = RunTaskBodyOutputSchema;
1991
+ exports.RunTaskOptionsSchema = RunTaskOptionsSchema;
1992
+ exports.RunTaskResponseWithCachedTasksBodySchema = RunTaskResponseWithCachedTasksBodySchema;
1993
+ exports.RunTaskSchema = RunTaskSchema;
1994
+ exports.RuntimeEnvironmentTypeSchema = RuntimeEnvironmentTypeSchema;
1995
+ exports.SCHEDULED_EVENT = SCHEDULED_EVENT;
1996
+ exports.ScheduleMetadataSchema = ScheduleMetadataSchema;
1997
+ exports.ScheduledPayloadSchema = ScheduledPayloadSchema;
1998
+ exports.ScheduledTriggerMetadataSchema = ScheduledTriggerMetadataSchema;
1999
+ exports.SchemaErrorSchema = SchemaErrorSchema;
2000
+ exports.SendBulkEventsBodySchema = SendBulkEventsBodySchema;
2001
+ exports.SendEventBodySchema = SendEventBodySchema;
2002
+ exports.SendEventOptionsSchema = SendEventOptionsSchema;
2003
+ exports.SerializableJsonSchema = SerializableJsonSchema;
2004
+ exports.ServerTaskSchema = ServerTaskSchema;
2005
+ exports.SourceMetadataV2Schema = SourceMetadataV2Schema;
2006
+ exports.StaticTriggerMetadataSchema = StaticTriggerMetadataSchema;
2007
+ exports.StatusHistorySchema = StatusHistorySchema;
2008
+ exports.StatusUpdateSchema = StatusUpdateSchema;
2009
+ exports.StatusUpdateStateSchema = StatusUpdateStateSchema;
2010
+ exports.StyleSchema = StyleSchema;
2011
+ exports.TaskSchema = TaskSchema;
2012
+ exports.TaskStatusSchema = TaskStatusSchema;
2013
+ exports.TriggerHelpSchema = TriggerHelpSchema;
2014
+ exports.TriggerMetadataSchema = TriggerMetadataSchema;
2015
+ exports.TriggerSourceSchema = TriggerSourceSchema;
2016
+ exports.UpdateTriggerSourceBodyV1Schema = UpdateTriggerSourceBodyV1Schema;
2017
+ exports.UpdateTriggerSourceBodyV2Schema = UpdateTriggerSourceBodyV2Schema;
2018
+ exports.UpdateWebhookBodySchema = UpdateWebhookBodySchema;
2019
+ exports.ValidateErrorResponseSchema = ValidateErrorResponseSchema;
2020
+ exports.ValidateResponseSchema = ValidateResponseSchema;
2021
+ exports.ValidateSuccessResponseSchema = ValidateSuccessResponseSchema;
2022
+ exports.WebhookContextMetadataSchema = WebhookContextMetadataSchema;
2023
+ exports.WebhookDeliveryResponseSchema = WebhookDeliveryResponseSchema;
2024
+ exports.WebhookMetadataSchema = WebhookMetadataSchema;
2025
+ exports.WebhookSourceRequestHeadersSchema = WebhookSourceRequestHeadersSchema;
2026
+ exports.addMissingVersionField = addMissingVersionField;
2027
+ exports.assertExhaustive = assertExhaustive;
2028
+ exports.calculateResetAt = calculateResetAt;
2029
+ exports.calculateRetryAt = calculateRetryAt;
2030
+ exports.currentDate = currentDate;
2031
+ exports.currentTimestampMilliseconds = currentTimestampMilliseconds;
2032
+ exports.currentTimestampSeconds = currentTimestampSeconds;
2033
+ exports.deepMergeFilters = deepMergeFilters;
2034
+ exports.eventFilterMatches = eventFilterMatches;
2035
+ exports.parseEndpointIndexStats = parseEndpointIndexStats;
2036
+ exports.replacements = replacements;
2037
+ exports.requestFilterMatches = requestFilterMatches;
2038
+ exports.responseFilterMatches = responseFilterMatches;
2039
+ exports.stringPatternMatchers = stringPatternMatchers;
2040
+ exports.supportsFeature = supportsFeature;
2041
+ exports.urlWithSearchParams = urlWithSearchParams;
2042
+ //# sourceMappingURL=out.js.map
1598
2043
  //# sourceMappingURL=index.js.map