@trigger.dev/core 0.0.0-buffer-import-20231031121649 → 0.0.0-buffer-fix-20231206151546

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