@trigger.dev/core 0.0.0-cross-runtime-20231204083620 → 0.0.0-cross-runtime-20231204112900

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.mjs CHANGED
@@ -1,3 +1,8 @@
1
+ import { env } from 'node:process';
2
+ import { Buffer } from 'node:buffer';
3
+ import { ulid } from 'ulidx';
4
+ import { z } from 'zod';
5
+
1
6
  var __defProp = Object.defineProperty;
2
7
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
8
  var __accessCheck = (obj, member, msg) => {
@@ -22,10 +27,6 @@ var __privateMethod = (obj, member, method) => {
22
27
  __accessCheck(obj, member, "access private method");
23
28
  return method;
24
29
  };
25
-
26
- // src/logger.ts
27
- import { env } from "node:process";
28
- import { Buffer as Buffer2 } from "node:buffer";
29
30
  var logLevels = [
30
31
  "log",
31
32
  "error",
@@ -183,17 +184,13 @@ __name(prettyPrintBytes, "prettyPrintBytes");
183
184
  function getSizeInBytes(value) {
184
185
  const jsonString = JSON.stringify(value);
185
186
  if (typeof window === "undefined") {
186
- return Buffer2.byteLength(jsonString, "utf8");
187
+ return Buffer.byteLength(jsonString, "utf8");
187
188
  } else {
188
189
  return new TextEncoder().encode(jsonString).length;
189
190
  }
190
191
  }
191
192
  __name(getSizeInBytes, "getSizeInBytes");
192
193
 
193
- // src/schemas/api.ts
194
- import { ulid } from "ulidx";
195
- import { z as z12 } from "zod";
196
-
197
194
  // src/schemas/addMissingVersionField.ts
198
195
  function addMissingVersionField(val) {
199
196
  if (val !== null && typeof val === "object" && !("version" in val)) {
@@ -205,9 +202,6 @@ function addMissingVersionField(val) {
205
202
  return val;
206
203
  }
207
204
  __name(addMissingVersionField, "addMissingVersionField");
208
-
209
- // src/schemas/errors.ts
210
- import { z } from "zod";
211
205
  var ErrorWithStackSchema = z.object({
212
206
  message: z.string(),
213
207
  name: z.string().optional(),
@@ -217,213 +211,195 @@ var SchemaErrorSchema = z.object({
217
211
  path: z.array(z.string()),
218
212
  message: z.string()
219
213
  });
220
-
221
- // src/schemas/eventFilter.ts
222
- import { z as z2 } from "zod";
223
214
  var stringPatternMatchers = [
224
- z2.object({
225
- $endsWith: z2.string()
215
+ z.object({
216
+ $endsWith: z.string()
226
217
  }),
227
- z2.object({
228
- $startsWith: z2.string()
218
+ z.object({
219
+ $startsWith: z.string()
229
220
  }),
230
- z2.object({
231
- $ignoreCaseEquals: z2.string()
221
+ z.object({
222
+ $ignoreCaseEquals: z.string()
232
223
  })
233
224
  ];
234
- var EventMatcherSchema = z2.union([
225
+ var EventMatcherSchema = z.union([
235
226
  /** Match against a string */
236
- z2.array(z2.string()),
227
+ z.array(z.string()),
237
228
  /** Match against a number */
238
- z2.array(z2.number()),
229
+ z.array(z.number()),
239
230
  /** Match against a boolean */
240
- z2.array(z2.boolean()),
241
- z2.array(z2.union([
231
+ z.array(z.boolean()),
232
+ z.array(z.union([
242
233
  ...stringPatternMatchers,
243
- z2.object({
244
- $exists: z2.boolean()
234
+ z.object({
235
+ $exists: z.boolean()
245
236
  }),
246
- z2.object({
247
- $isNull: z2.boolean()
237
+ z.object({
238
+ $isNull: z.boolean()
248
239
  }),
249
- z2.object({
250
- $anythingBut: z2.union([
251
- z2.string(),
252
- z2.number(),
253
- z2.boolean()
240
+ z.object({
241
+ $anythingBut: z.union([
242
+ z.string(),
243
+ z.number(),
244
+ z.boolean()
254
245
  ])
255
246
  }),
256
- z2.object({
257
- $anythingBut: z2.union([
258
- z2.array(z2.string()),
259
- z2.array(z2.number()),
260
- z2.array(z2.boolean())
247
+ z.object({
248
+ $anythingBut: z.union([
249
+ z.array(z.string()),
250
+ z.array(z.number()),
251
+ z.array(z.boolean())
261
252
  ])
262
253
  }),
263
- z2.object({
264
- $gt: z2.number()
254
+ z.object({
255
+ $gt: z.number()
265
256
  }),
266
- z2.object({
267
- $lt: z2.number()
257
+ z.object({
258
+ $lt: z.number()
268
259
  }),
269
- z2.object({
270
- $gte: z2.number()
260
+ z.object({
261
+ $gte: z.number()
271
262
  }),
272
- z2.object({
273
- $lte: z2.number()
263
+ z.object({
264
+ $lte: z.number()
274
265
  }),
275
- z2.object({
276
- $between: z2.tuple([
277
- z2.number(),
278
- z2.number()
266
+ z.object({
267
+ $between: z.tuple([
268
+ z.number(),
269
+ z.number()
279
270
  ])
280
271
  }),
281
- z2.object({
282
- $includes: z2.union([
283
- z2.string(),
284
- z2.number(),
285
- z2.boolean()
272
+ z.object({
273
+ $includes: z.union([
274
+ z.string(),
275
+ z.number(),
276
+ z.boolean()
286
277
  ])
287
278
  })
288
279
  ]))
289
280
  ]);
290
- var EventFilterSchema = z2.lazy(() => z2.record(z2.union([
281
+ var EventFilterSchema = z.lazy(() => z.record(z.union([
291
282
  EventMatcherSchema,
292
283
  EventFilterSchema
293
284
  ])));
294
- var EventRuleSchema = z2.object({
295
- event: z2.string().or(z2.array(z2.string())),
296
- source: z2.string(),
285
+ var EventRuleSchema = z.object({
286
+ event: z.string().or(z.array(z.string())),
287
+ source: z.string(),
297
288
  payload: EventFilterSchema.optional(),
298
289
  context: EventFilterSchema.optional()
299
290
  });
300
-
301
- // src/schemas/integrations.ts
302
- import { z as z3 } from "zod";
303
- var ConnectionAuthSchema = z3.object({
304
- type: z3.enum([
291
+ var ConnectionAuthSchema = z.object({
292
+ type: z.enum([
305
293
  "oauth2",
306
294
  "apiKey"
307
295
  ]),
308
- accessToken: z3.string(),
309
- scopes: z3.array(z3.string()).optional(),
310
- additionalFields: z3.record(z3.string()).optional()
296
+ accessToken: z.string(),
297
+ scopes: z.array(z.string()).optional(),
298
+ additionalFields: z.record(z.string()).optional()
311
299
  });
312
- var IntegrationMetadataSchema = z3.object({
313
- id: z3.string(),
314
- name: z3.string(),
315
- instructions: z3.string().optional()
300
+ var IntegrationMetadataSchema = z.object({
301
+ id: z.string(),
302
+ name: z.string(),
303
+ instructions: z.string().optional()
316
304
  });
317
- var IntegrationConfigSchema = z3.object({
318
- id: z3.string(),
305
+ var IntegrationConfigSchema = z.object({
306
+ id: z.string(),
319
307
  metadata: IntegrationMetadataSchema,
320
- authSource: z3.enum([
308
+ authSource: z.enum([
321
309
  "HOSTED",
322
310
  "LOCAL",
323
311
  "RESOLVER"
324
312
  ])
325
313
  });
326
-
327
- // src/schemas/json.ts
328
- import { z as z4 } from "zod";
329
- var LiteralSchema = z4.union([
330
- z4.string(),
331
- z4.number(),
332
- z4.boolean(),
333
- z4.null()
314
+ var LiteralSchema = z.union([
315
+ z.string(),
316
+ z.number(),
317
+ z.boolean(),
318
+ z.null()
334
319
  ]);
335
- var DeserializedJsonSchema = z4.lazy(() => z4.union([
320
+ var DeserializedJsonSchema = z.lazy(() => z.union([
336
321
  LiteralSchema,
337
- z4.array(DeserializedJsonSchema),
338
- z4.record(DeserializedJsonSchema)
322
+ z.array(DeserializedJsonSchema),
323
+ z.record(DeserializedJsonSchema)
339
324
  ]));
340
- var SerializableSchema = z4.union([
341
- z4.string(),
342
- z4.number(),
343
- z4.boolean(),
344
- z4.null(),
345
- z4.date(),
346
- z4.undefined(),
347
- z4.symbol()
325
+ var SerializableSchema = z.union([
326
+ z.string(),
327
+ z.number(),
328
+ z.boolean(),
329
+ z.null(),
330
+ z.date(),
331
+ z.undefined(),
332
+ z.symbol()
348
333
  ]);
349
- var SerializableJsonSchema = z4.lazy(() => z4.union([
334
+ var SerializableJsonSchema = z.lazy(() => z.union([
350
335
  SerializableSchema,
351
- z4.array(SerializableJsonSchema),
352
- z4.record(SerializableJsonSchema)
336
+ z.array(SerializableJsonSchema),
337
+ z.record(SerializableJsonSchema)
353
338
  ]));
354
-
355
- // src/schemas/properties.ts
356
- import { z as z5 } from "zod";
357
- var DisplayPropertySchema = z5.object({
339
+ var DisplayPropertySchema = z.object({
358
340
  /** The label for the property */
359
- label: z5.string(),
341
+ label: z.string(),
360
342
  /** The value of the property */
361
- text: z5.string(),
343
+ text: z.string(),
362
344
  /** The URL to link to when the property is clicked */
363
- url: z5.string().optional(),
345
+ url: z.string().optional(),
364
346
  /** The URL to a list of images to display next to the property */
365
- imageUrl: z5.array(z5.string()).optional()
347
+ imageUrl: z.array(z.string()).optional()
366
348
  });
367
- var DisplayPropertiesSchema = z5.array(DisplayPropertySchema);
368
- var StyleSchema = z5.object({
349
+ var DisplayPropertiesSchema = z.array(DisplayPropertySchema);
350
+ var StyleSchema = z.object({
369
351
  /** The style, `normal` or `minimal` */
370
- style: z5.enum([
352
+ style: z.enum([
371
353
  "normal",
372
354
  "minimal"
373
355
  ]),
374
356
  /** A variant of the style. */
375
- variant: z5.string().optional()
357
+ variant: z.string().optional()
376
358
  });
377
-
378
- // src/schemas/schedules.ts
379
- import { z as z6 } from "zod";
380
359
  var SCHEDULED_EVENT = "dev.trigger.scheduled";
381
- var ScheduledPayloadSchema = z6.object({
382
- ts: z6.coerce.date(),
383
- lastTimestamp: z6.coerce.date().optional()
360
+ var ScheduledPayloadSchema = z.object({
361
+ ts: z.coerce.date(),
362
+ lastTimestamp: z.coerce.date().optional()
384
363
  });
385
- var IntervalOptionsSchema = z6.object({
364
+ var IntervalOptionsSchema = z.object({
386
365
  /** The number of seconds for the interval. Min = 60, Max = 2_592_000 (30 days) */
387
- seconds: z6.number().int().positive().min(60).max(2592e3)
366
+ seconds: z.number().int().positive().min(60).max(2592e3)
388
367
  });
389
- var CronOptionsSchema = z6.object({
368
+ var CronOptionsSchema = z.object({
390
369
  /** A CRON expression that defines the schedule. A useful tool when writing CRON
391
370
  expressions is [crontab guru](https://crontab.guru). Note that the timezone
392
371
  used is UTC. */
393
- cron: z6.string()
372
+ cron: z.string()
394
373
  });
395
- var CronMetadataSchema = z6.object({
396
- type: z6.literal("cron"),
374
+ var CronMetadataSchema = z.object({
375
+ type: z.literal("cron"),
397
376
  options: CronOptionsSchema,
398
377
  /** An optional Account ID to associate with runs triggered by this interval */
399
- accountId: z6.string().optional(),
400
- metadata: z6.any()
378
+ accountId: z.string().optional(),
379
+ metadata: z.any()
401
380
  });
402
- var IntervalMetadataSchema = z6.object({
381
+ var IntervalMetadataSchema = z.object({
403
382
  /** An interval reoccurs at the specified number of seconds */
404
- type: z6.literal("interval"),
383
+ type: z.literal("interval"),
405
384
  /** An object containing options about the interval. */
406
385
  options: IntervalOptionsSchema,
407
386
  /** An optional Account ID to associate with runs triggered by this interval */
408
- accountId: z6.string().optional(),
387
+ accountId: z.string().optional(),
409
388
  /** Any additional metadata about the schedule. */
410
- metadata: z6.any()
389
+ metadata: z.any()
411
390
  });
412
- var ScheduleMetadataSchema = z6.discriminatedUnion("type", [
391
+ var ScheduleMetadataSchema = z.discriminatedUnion("type", [
413
392
  IntervalMetadataSchema,
414
393
  CronMetadataSchema
415
394
  ]);
416
- var RegisterDynamicSchedulePayloadSchema = z6.object({
417
- id: z6.string(),
418
- jobs: z6.array(z6.object({
419
- id: z6.string(),
420
- version: z6.string()
395
+ var RegisterDynamicSchedulePayloadSchema = z.object({
396
+ id: z.string(),
397
+ jobs: z.array(z.object({
398
+ id: z.string(),
399
+ version: z.string()
421
400
  }))
422
401
  });
423
-
424
- // src/schemas/tasks.ts
425
- import { z as z7 } from "zod";
426
- var TaskStatusSchema = z7.enum([
402
+ var TaskStatusSchema = z.enum([
427
403
  "PENDING",
428
404
  "WAITING",
429
405
  "RUNNING",
@@ -431,229 +407,217 @@ var TaskStatusSchema = z7.enum([
431
407
  "ERRORED",
432
408
  "CANCELED"
433
409
  ]);
434
- var TaskSchema = z7.object({
435
- id: z7.string(),
436
- name: z7.string(),
437
- icon: z7.string().optional().nullable(),
438
- noop: z7.boolean(),
439
- startedAt: z7.coerce.date().optional().nullable(),
440
- completedAt: z7.coerce.date().optional().nullable(),
441
- delayUntil: z7.coerce.date().optional().nullable(),
410
+ var TaskSchema = z.object({
411
+ id: z.string(),
412
+ name: z.string(),
413
+ icon: z.string().optional().nullable(),
414
+ noop: z.boolean(),
415
+ startedAt: z.coerce.date().optional().nullable(),
416
+ completedAt: z.coerce.date().optional().nullable(),
417
+ delayUntil: z.coerce.date().optional().nullable(),
442
418
  status: TaskStatusSchema,
443
- description: z7.string().optional().nullable(),
444
- properties: z7.array(DisplayPropertySchema).optional().nullable(),
445
- outputProperties: z7.array(DisplayPropertySchema).optional().nullable(),
419
+ description: z.string().optional().nullable(),
420
+ properties: z.array(DisplayPropertySchema).optional().nullable(),
421
+ outputProperties: z.array(DisplayPropertySchema).optional().nullable(),
446
422
  params: DeserializedJsonSchema.optional().nullable(),
447
423
  output: DeserializedJsonSchema.optional().nullable(),
448
424
  context: DeserializedJsonSchema.optional().nullable(),
449
- error: z7.string().optional().nullable(),
450
- parentId: z7.string().optional().nullable(),
425
+ error: z.string().optional().nullable(),
426
+ parentId: z.string().optional().nullable(),
451
427
  style: StyleSchema.optional().nullable(),
452
- operation: z7.string().optional().nullable(),
453
- callbackUrl: z7.string().optional().nullable(),
454
- childExecutionMode: z7.enum([
428
+ operation: z.string().optional().nullable(),
429
+ callbackUrl: z.string().optional().nullable(),
430
+ childExecutionMode: z.enum([
455
431
  "SEQUENTIAL",
456
432
  "PARALLEL"
457
433
  ]).optional().nullable()
458
434
  });
459
435
  var ServerTaskSchema = TaskSchema.extend({
460
- idempotencyKey: z7.string(),
461
- attempts: z7.number(),
462
- forceYield: z7.boolean().optional().nullable()
436
+ idempotencyKey: z.string(),
437
+ attempts: z.number(),
438
+ forceYield: z.boolean().optional().nullable()
463
439
  });
464
- var CachedTaskSchema = z7.object({
465
- id: z7.string(),
466
- idempotencyKey: z7.string(),
440
+ var CachedTaskSchema = z.object({
441
+ id: z.string(),
442
+ idempotencyKey: z.string(),
467
443
  status: TaskStatusSchema,
468
- noop: z7.boolean().default(false),
444
+ noop: z.boolean().default(false),
469
445
  output: DeserializedJsonSchema.optional().nullable(),
470
- parentId: z7.string().optional().nullable()
471
- });
472
-
473
- // src/schemas/triggers.ts
474
- import { z as z8 } from "zod";
475
- var EventExampleSchema = z8.object({
476
- id: z8.string(),
477
- icon: z8.string().optional(),
478
- name: z8.string(),
479
- payload: z8.any()
480
- });
481
- var EventSpecificationSchema = z8.object({
482
- name: z8.string().or(z8.array(z8.string())),
483
- title: z8.string(),
484
- source: z8.string(),
485
- icon: z8.string(),
446
+ parentId: z.string().optional().nullable()
447
+ });
448
+ var EventExampleSchema = z.object({
449
+ id: z.string(),
450
+ icon: z.string().optional(),
451
+ name: z.string(),
452
+ payload: z.any()
453
+ });
454
+ var EventSpecificationSchema = z.object({
455
+ name: z.string().or(z.array(z.string())),
456
+ title: z.string(),
457
+ source: z.string(),
458
+ icon: z.string(),
486
459
  filter: EventFilterSchema.optional(),
487
- properties: z8.array(DisplayPropertySchema).optional(),
488
- schema: z8.any().optional(),
489
- examples: z8.array(EventExampleSchema).optional()
490
- });
491
- var DynamicTriggerMetadataSchema = z8.object({
492
- type: z8.literal("dynamic"),
493
- id: z8.string()
494
- });
495
- var TriggerHelpSchema = z8.object({
496
- noRuns: z8.object({
497
- text: z8.string(),
498
- link: z8.string().optional()
460
+ properties: z.array(DisplayPropertySchema).optional(),
461
+ schema: z.any().optional(),
462
+ examples: z.array(EventExampleSchema).optional()
463
+ });
464
+ var DynamicTriggerMetadataSchema = z.object({
465
+ type: z.literal("dynamic"),
466
+ id: z.string()
467
+ });
468
+ var TriggerHelpSchema = z.object({
469
+ noRuns: z.object({
470
+ text: z.string(),
471
+ link: z.string().optional()
499
472
  }).optional()
500
473
  });
501
- var StaticTriggerMetadataSchema = z8.object({
502
- type: z8.literal("static"),
503
- title: z8.union([
504
- z8.string(),
505
- z8.array(z8.string())
474
+ var StaticTriggerMetadataSchema = z.object({
475
+ type: z.literal("static"),
476
+ title: z.union([
477
+ z.string(),
478
+ z.array(z.string())
506
479
  ]),
507
- properties: z8.array(DisplayPropertySchema).optional(),
480
+ properties: z.array(DisplayPropertySchema).optional(),
508
481
  rule: EventRuleSchema,
509
- link: z8.string().optional(),
482
+ link: z.string().optional(),
510
483
  help: TriggerHelpSchema.optional()
511
484
  });
512
- var InvokeTriggerMetadataSchema = z8.object({
513
- type: z8.literal("invoke")
485
+ var InvokeTriggerMetadataSchema = z.object({
486
+ type: z.literal("invoke")
514
487
  });
515
- var ScheduledTriggerMetadataSchema = z8.object({
516
- type: z8.literal("scheduled"),
488
+ var ScheduledTriggerMetadataSchema = z.object({
489
+ type: z.literal("scheduled"),
517
490
  schedule: ScheduleMetadataSchema
518
491
  });
519
- var TriggerMetadataSchema = z8.discriminatedUnion("type", [
492
+ var TriggerMetadataSchema = z.discriminatedUnion("type", [
520
493
  DynamicTriggerMetadataSchema,
521
494
  StaticTriggerMetadataSchema,
522
495
  ScheduledTriggerMetadataSchema,
523
496
  InvokeTriggerMetadataSchema
524
497
  ]);
525
-
526
- // src/schemas/runs.ts
527
- import { z as z10 } from "zod";
528
-
529
- // src/schemas/statuses.ts
530
- import { z as z9 } from "zod";
531
- var StatusUpdateStateSchema = z9.union([
532
- z9.literal("loading"),
533
- z9.literal("success"),
534
- z9.literal("failure")
498
+ var StatusUpdateStateSchema = z.union([
499
+ z.literal("loading"),
500
+ z.literal("success"),
501
+ z.literal("failure")
535
502
  ]);
536
- var StatusUpdateDataSchema = z9.record(SerializableJsonSchema);
537
- var StatusUpdateSchema = z9.object({
538
- label: z9.string().optional(),
503
+ var StatusUpdateDataSchema = z.record(SerializableJsonSchema);
504
+ var StatusUpdateSchema = z.object({
505
+ label: z.string().optional(),
539
506
  state: StatusUpdateStateSchema.optional(),
540
507
  data: StatusUpdateDataSchema.optional()
541
508
  });
542
509
  var InitalStatusUpdateSchema = StatusUpdateSchema.required({
543
510
  label: true
544
511
  });
545
- var StatusHistorySchema = z9.array(StatusUpdateSchema);
512
+ var StatusHistorySchema = z.array(StatusUpdateSchema);
546
513
  var JobRunStatusRecordSchema = InitalStatusUpdateSchema.extend({
547
- key: z9.string(),
514
+ key: z.string(),
548
515
  history: StatusHistorySchema
549
516
  });
550
517
 
551
518
  // src/schemas/runs.ts
552
- var RunStatusSchema = z10.union([
553
- z10.literal("PENDING"),
554
- z10.literal("QUEUED"),
555
- z10.literal("WAITING_ON_CONNECTIONS"),
556
- z10.literal("PREPROCESSING"),
557
- z10.literal("STARTED"),
558
- z10.literal("SUCCESS"),
559
- z10.literal("FAILURE"),
560
- z10.literal("TIMED_OUT"),
561
- z10.literal("ABORTED"),
562
- z10.literal("CANCELED"),
563
- z10.literal("UNRESOLVED_AUTH"),
564
- z10.literal("INVALID_PAYLOAD"),
565
- z10.literal("EXECUTING"),
566
- z10.literal("WAITING_TO_CONTINUE"),
567
- z10.literal("WAITING_TO_EXECUTE")
519
+ var RunStatusSchema = z.union([
520
+ z.literal("PENDING"),
521
+ z.literal("QUEUED"),
522
+ z.literal("WAITING_ON_CONNECTIONS"),
523
+ z.literal("PREPROCESSING"),
524
+ z.literal("STARTED"),
525
+ z.literal("SUCCESS"),
526
+ z.literal("FAILURE"),
527
+ z.literal("TIMED_OUT"),
528
+ z.literal("ABORTED"),
529
+ z.literal("CANCELED"),
530
+ z.literal("UNRESOLVED_AUTH"),
531
+ z.literal("INVALID_PAYLOAD"),
532
+ z.literal("EXECUTING"),
533
+ z.literal("WAITING_TO_CONTINUE"),
534
+ z.literal("WAITING_TO_EXECUTE")
568
535
  ]);
569
- var RunTaskSchema = z10.object({
536
+ var RunTaskSchema = z.object({
570
537
  /** The Task id */
571
- id: z10.string(),
538
+ id: z.string(),
572
539
  /** The key that you defined when creating the Task, the first param in any task. */
573
- displayKey: z10.string().nullable(),
540
+ displayKey: z.string().nullable(),
574
541
  /** The Task status */
575
542
  status: TaskStatusSchema,
576
543
  /** The name of the Task */
577
- name: z10.string(),
544
+ name: z.string(),
578
545
  /** The icon of the Task, a string.
579
546
  * For integrations, this will be a lowercase name of the company.
580
547
  * Can be used with the [@trigger.dev/companyicons](https://www.npmjs.com/package/@trigger.dev/companyicons) package to display an svg. */
581
- icon: z10.string().nullable(),
548
+ icon: z.string().nullable(),
582
549
  /** When the task started */
583
- startedAt: z10.coerce.date().nullable(),
550
+ startedAt: z.coerce.date().nullable(),
584
551
  /** When the task completed */
585
- completedAt: z10.coerce.date().nullable()
552
+ completedAt: z.coerce.date().nullable()
586
553
  });
587
554
  var RunTaskWithSubtasksSchema = RunTaskSchema.extend({
588
- subtasks: z10.lazy(() => RunTaskWithSubtasksSchema.array()).optional()
555
+ subtasks: z.lazy(() => RunTaskWithSubtasksSchema.array()).optional()
589
556
  });
590
- var GetRunOptionsSchema = z10.object({
557
+ var GetRunOptionsSchema = z.object({
591
558
  /** Return subtasks, which appear in a `subtasks` array on a task. @default false */
592
- subtasks: z10.boolean().optional(),
559
+ subtasks: z.boolean().optional(),
593
560
  /** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */
594
- cursor: z10.string().optional(),
561
+ cursor: z.string().optional(),
595
562
  /** How many tasks you want to return in one go, max 50. @default 20 */
596
- take: z10.number().optional()
563
+ take: z.number().optional()
597
564
  });
598
- var GetRunOptionsWithTaskDetailsSchema = GetRunOptionsSchema.extend({
565
+ GetRunOptionsSchema.extend({
599
566
  /** If `true`, it returns the `params` and `output` of all tasks. @default false */
600
- taskdetails: z10.boolean().optional()
567
+ taskdetails: z.boolean().optional()
601
568
  });
602
- var RunSchema = z10.object({
569
+ var RunSchema = z.object({
603
570
  /** The Run id */
604
- id: z10.string(),
571
+ id: z.string(),
605
572
  /** The Run status */
606
573
  status: RunStatusSchema,
607
574
  /** When the run started */
608
- startedAt: z10.coerce.date().nullable(),
575
+ startedAt: z.coerce.date().nullable(),
609
576
  /** When the run was last updated */
610
- updatedAt: z10.coerce.date().nullable(),
577
+ updatedAt: z.coerce.date().nullable(),
611
578
  /** When the run was completed */
612
- completedAt: z10.coerce.date().nullable()
579
+ completedAt: z.coerce.date().nullable()
613
580
  });
614
581
  var GetRunSchema = RunSchema.extend({
615
582
  /** The output of the run */
616
- output: z10.any().optional(),
583
+ output: z.any().optional(),
617
584
  /** The tasks from the run */
618
- tasks: z10.array(RunTaskWithSubtasksSchema),
585
+ tasks: z.array(RunTaskWithSubtasksSchema),
619
586
  /** Any status updates that were published from the run */
620
- statuses: z10.array(JobRunStatusRecordSchema).default([]),
587
+ statuses: z.array(JobRunStatusRecordSchema).default([]),
621
588
  /** If there are more tasks, you can use this to get them */
622
- nextCursor: z10.string().optional()
589
+ nextCursor: z.string().optional()
623
590
  });
624
- var GetRunsOptionsSchema = z10.object({
591
+ z.object({
625
592
  /** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */
626
- cursor: z10.string().optional(),
593
+ cursor: z.string().optional(),
627
594
  /** How many runs you want to return in one go, max 50. @default 20 */
628
- take: z10.number().optional()
595
+ take: z.number().optional()
629
596
  });
630
- var GetRunsSchema = z10.object({
597
+ var GetRunsSchema = z.object({
631
598
  /** The runs from the query */
632
599
  runs: RunSchema.array(),
633
600
  /** If there are more runs, you can use this to get them */
634
- nextCursor: z10.string().optional()
601
+ nextCursor: z.string().optional()
635
602
  });
636
-
637
- // src/schemas/requestFilter.ts
638
- import { z as z11 } from "zod";
639
- var StringMatchSchema = z11.union([
603
+ var StringMatchSchema = z.union([
640
604
  /** Match against a string */
641
- z11.array(z11.string()),
642
- z11.array(z11.union(stringPatternMatchers))
605
+ z.array(z.string()),
606
+ z.array(z.union(stringPatternMatchers))
643
607
  ]);
644
- var HTTPMethodUnionSchema = z11.union([
645
- z11.literal("GET"),
646
- z11.literal("POST"),
647
- z11.literal("PUT"),
648
- z11.literal("PATCH"),
649
- z11.literal("DELETE"),
650
- z11.literal("HEAD"),
651
- z11.literal("OPTIONS")
608
+ var HTTPMethodUnionSchema = z.union([
609
+ z.literal("GET"),
610
+ z.literal("POST"),
611
+ z.literal("PUT"),
612
+ z.literal("PATCH"),
613
+ z.literal("DELETE"),
614
+ z.literal("HEAD"),
615
+ z.literal("OPTIONS")
652
616
  ]);
653
- var RequestFilterSchema = z11.object({
617
+ var RequestFilterSchema = z.object({
654
618
  /** An array of HTTP methods to match.
655
619
  * For example, `["GET", "POST"]` will match both `GET` and `POST` Requests. */
656
- method: z11.array(HTTPMethodUnionSchema).optional(),
620
+ method: z.array(HTTPMethodUnionSchema).optional(),
657
621
  /** An object of header key/values to match.
658
622
  * This uses the [EventFilter matching syntax](https://trigger.dev/docs/documentation/guides/event-filter).
659
623
 
@@ -665,7 +629,7 @@ var RequestFilterSchema = z11.object({
665
629
  },
666
630
  },
667
631
  ``` */
668
- headers: z11.record(StringMatchSchema).optional(),
632
+ headers: z.record(StringMatchSchema).optional(),
669
633
  /** An object of query parameters to match.
670
634
  * This uses the [EventFilter matching syntax](https://trigger.dev/docs/documentation/guides/event-filter).
671
635
 
@@ -677,7 +641,7 @@ var RequestFilterSchema = z11.object({
677
641
  },
678
642
  },
679
643
  ``` */
680
- query: z11.record(StringMatchSchema).optional(),
644
+ query: z.record(StringMatchSchema).optional(),
681
645
  /** An object of key/values to match.
682
646
  * This uses the [EventFilter matching syntax](https://trigger.dev/docs/documentation/guides/event-filter).
683
647
  */
@@ -687,304 +651,304 @@ var ResponseFilterSchema = RequestFilterSchema.omit({
687
651
  method: true,
688
652
  query: true
689
653
  }).extend({
690
- status: z11.array(z11.number()).optional()
654
+ status: z.array(z.number()).optional()
691
655
  });
692
656
 
693
657
  // src/schemas/api.ts
694
- var UpdateTriggerSourceBodyV1Schema = z12.object({
695
- registeredEvents: z12.array(z12.string()),
696
- secret: z12.string().optional(),
658
+ var UpdateTriggerSourceBodyV1Schema = z.object({
659
+ registeredEvents: z.array(z.string()),
660
+ secret: z.string().optional(),
697
661
  data: SerializableJsonSchema.optional()
698
662
  });
699
- var UpdateTriggerSourceBodyV2Schema = z12.object({
700
- secret: z12.string().optional(),
663
+ var UpdateTriggerSourceBodyV2Schema = z.object({
664
+ secret: z.string().optional(),
701
665
  data: SerializableJsonSchema.optional(),
702
- options: z12.object({
703
- event: z12.array(z12.string())
704
- }).and(z12.record(z12.string(), z12.array(z12.string())).optional())
666
+ options: z.object({
667
+ event: z.array(z.string())
668
+ }).and(z.record(z.string(), z.array(z.string())).optional())
705
669
  });
706
- var UpdateWebhookBodySchema = z12.discriminatedUnion("active", [
707
- z12.object({
708
- active: z12.literal(false)
670
+ var UpdateWebhookBodySchema = z.discriminatedUnion("active", [
671
+ z.object({
672
+ active: z.literal(false)
709
673
  }),
710
- z12.object({
711
- active: z12.literal(true),
712
- config: z12.record(z12.string().array())
674
+ z.object({
675
+ active: z.literal(true),
676
+ config: z.record(z.string().array())
713
677
  })
714
678
  ]);
715
- var RegisterHTTPTriggerSourceBodySchema = z12.object({
716
- type: z12.literal("HTTP"),
717
- url: z12.string().url()
679
+ var RegisterHTTPTriggerSourceBodySchema = z.object({
680
+ type: z.literal("HTTP"),
681
+ url: z.string().url()
718
682
  });
719
- var RegisterSMTPTriggerSourceBodySchema = z12.object({
720
- type: z12.literal("SMTP")
683
+ var RegisterSMTPTriggerSourceBodySchema = z.object({
684
+ type: z.literal("SMTP")
721
685
  });
722
- var RegisterSQSTriggerSourceBodySchema = z12.object({
723
- type: z12.literal("SQS")
686
+ var RegisterSQSTriggerSourceBodySchema = z.object({
687
+ type: z.literal("SQS")
724
688
  });
725
- var RegisterSourceChannelBodySchema = z12.discriminatedUnion("type", [
689
+ var RegisterSourceChannelBodySchema = z.discriminatedUnion("type", [
726
690
  RegisterHTTPTriggerSourceBodySchema,
727
691
  RegisterSMTPTriggerSourceBodySchema,
728
692
  RegisterSQSTriggerSourceBodySchema
729
693
  ]);
730
694
  var REGISTER_WEBHOOK = "dev.trigger.webhook.register";
731
695
  var DELIVER_WEBHOOK_REQUEST = "dev.trigger.webhook.deliver";
732
- var RegisterWebhookSourceSchema = z12.object({
733
- key: z12.string(),
734
- params: z12.any(),
735
- config: z12.any(),
736
- active: z12.boolean(),
737
- secret: z12.string(),
738
- url: z12.string(),
696
+ var RegisterWebhookSourceSchema = z.object({
697
+ key: z.string(),
698
+ params: z.any(),
699
+ config: z.any(),
700
+ active: z.boolean(),
701
+ secret: z.string(),
702
+ url: z.string(),
739
703
  data: DeserializedJsonSchema.optional(),
740
- clientId: z12.string().optional()
741
- });
742
- var RegisterWebhookPayloadSchema = z12.object({
743
- active: z12.boolean(),
744
- params: z12.any().optional(),
745
- config: z12.object({
746
- current: z12.record(z12.string().array()),
747
- desired: z12.record(z12.string().array())
704
+ clientId: z.string().optional()
705
+ });
706
+ var RegisterWebhookPayloadSchema = z.object({
707
+ active: z.boolean(),
708
+ params: z.any().optional(),
709
+ config: z.object({
710
+ current: z.record(z.string().array()),
711
+ desired: z.record(z.string().array())
748
712
  }),
749
713
  // from HTTP Endpoint
750
- url: z12.string(),
751
- secret: z12.string()
714
+ url: z.string(),
715
+ secret: z.string()
752
716
  });
753
717
  var REGISTER_SOURCE_EVENT_V1 = "dev.trigger.source.register";
754
718
  var REGISTER_SOURCE_EVENT_V2 = "dev.trigger.source.register.v2";
755
- var RegisterTriggerSourceSchema = z12.object({
756
- key: z12.string(),
757
- params: z12.any(),
758
- active: z12.boolean(),
759
- secret: z12.string(),
719
+ var RegisterTriggerSourceSchema = z.object({
720
+ key: z.string(),
721
+ params: z.any(),
722
+ active: z.boolean(),
723
+ secret: z.string(),
760
724
  data: DeserializedJsonSchema.optional(),
761
725
  channel: RegisterSourceChannelBodySchema,
762
- clientId: z12.string().optional()
726
+ clientId: z.string().optional()
763
727
  });
764
- var SourceEventOptionSchema = z12.object({
765
- name: z12.string(),
766
- value: z12.string()
728
+ z.object({
729
+ name: z.string(),
730
+ value: z.string()
767
731
  });
768
- var RegisterSourceEventSchemaV1 = z12.object({
732
+ var RegisterSourceEventSchemaV1 = z.object({
769
733
  /** The id of the source */
770
- id: z12.string(),
734
+ id: z.string(),
771
735
  source: RegisterTriggerSourceSchema,
772
- events: z12.array(z12.string()),
773
- missingEvents: z12.array(z12.string()),
774
- orphanedEvents: z12.array(z12.string()),
775
- dynamicTriggerId: z12.string().optional()
736
+ events: z.array(z.string()),
737
+ missingEvents: z.array(z.string()),
738
+ orphanedEvents: z.array(z.string()),
739
+ dynamicTriggerId: z.string().optional()
776
740
  });
777
- var RegisteredOptionsDiffSchema = z12.object({
778
- desired: z12.array(z12.string()),
779
- missing: z12.array(z12.string()),
780
- orphaned: z12.array(z12.string())
741
+ var RegisteredOptionsDiffSchema = z.object({
742
+ desired: z.array(z.string()),
743
+ missing: z.array(z.string()),
744
+ orphaned: z.array(z.string())
781
745
  });
782
- var RegisterSourceEventOptionsSchema = z12.object({
746
+ var RegisterSourceEventOptionsSchema = z.object({
783
747
  event: RegisteredOptionsDiffSchema
784
- }).and(z12.record(z12.string(), RegisteredOptionsDiffSchema));
785
- var RegisterSourceEventSchemaV2 = z12.object({
748
+ }).and(z.record(z.string(), RegisteredOptionsDiffSchema));
749
+ var RegisterSourceEventSchemaV2 = z.object({
786
750
  /** The id of the source */
787
- id: z12.string(),
751
+ id: z.string(),
788
752
  source: RegisterTriggerSourceSchema,
789
753
  options: RegisterSourceEventOptionsSchema,
790
- dynamicTriggerId: z12.string().optional()
754
+ dynamicTriggerId: z.string().optional()
791
755
  });
792
- var TriggerSourceSchema = z12.object({
793
- id: z12.string(),
794
- key: z12.string()
756
+ var TriggerSourceSchema = z.object({
757
+ id: z.string(),
758
+ key: z.string()
795
759
  });
796
760
  var HttpSourceResponseMetadataSchema = DeserializedJsonSchema;
797
- var HandleTriggerSourceSchema = z12.object({
798
- key: z12.string(),
799
- secret: z12.string(),
800
- data: z12.any(),
801
- params: z12.any(),
761
+ var HandleTriggerSourceSchema = z.object({
762
+ key: z.string(),
763
+ secret: z.string(),
764
+ data: z.any(),
765
+ params: z.any(),
802
766
  auth: ConnectionAuthSchema.optional(),
803
767
  metadata: HttpSourceResponseMetadataSchema.optional()
804
768
  });
805
- var HttpSourceRequestHeadersSchema = z12.object({
806
- "x-ts-key": z12.string(),
807
- "x-ts-dynamic-id": z12.string().optional(),
808
- "x-ts-secret": z12.string(),
809
- "x-ts-data": z12.string().transform((s) => JSON.parse(s)),
810
- "x-ts-params": z12.string().transform((s) => JSON.parse(s)),
811
- "x-ts-http-url": z12.string(),
812
- "x-ts-http-method": z12.string(),
813
- "x-ts-http-headers": z12.string().transform((s) => z12.record(z12.string()).parse(JSON.parse(s))),
814
- "x-ts-auth": z12.string().optional().transform((s) => {
769
+ var HttpSourceRequestHeadersSchema = z.object({
770
+ "x-ts-key": z.string(),
771
+ "x-ts-dynamic-id": z.string().optional(),
772
+ "x-ts-secret": z.string(),
773
+ "x-ts-data": z.string().transform((s) => JSON.parse(s)),
774
+ "x-ts-params": z.string().transform((s) => JSON.parse(s)),
775
+ "x-ts-http-url": z.string(),
776
+ "x-ts-http-method": z.string(),
777
+ "x-ts-http-headers": z.string().transform((s) => z.record(z.string()).parse(JSON.parse(s))),
778
+ "x-ts-auth": z.string().optional().transform((s) => {
815
779
  if (s === void 0)
816
780
  return;
817
781
  const json = JSON.parse(s);
818
782
  return ConnectionAuthSchema.parse(json);
819
783
  }),
820
- "x-ts-metadata": z12.string().optional().transform((s) => {
784
+ "x-ts-metadata": z.string().optional().transform((s) => {
821
785
  if (s === void 0)
822
786
  return;
823
787
  const json = JSON.parse(s);
824
788
  return DeserializedJsonSchema.parse(json);
825
789
  })
826
790
  });
827
- var HttpEndpointRequestHeadersSchema = z12.object({
828
- "x-ts-key": z12.string(),
829
- "x-ts-http-url": z12.string(),
830
- "x-ts-http-method": z12.string(),
831
- "x-ts-http-headers": z12.string().transform((s) => z12.record(z12.string()).parse(JSON.parse(s)))
832
- });
833
- var WebhookSourceRequestHeadersSchema = z12.object({
834
- "x-ts-key": z12.string(),
835
- "x-ts-dynamic-id": z12.string().optional(),
836
- "x-ts-secret": z12.string(),
837
- "x-ts-params": z12.string().transform((s) => JSON.parse(s)),
838
- "x-ts-http-url": z12.string(),
839
- "x-ts-http-method": z12.string(),
840
- "x-ts-http-headers": z12.string().transform((s) => z12.record(z12.string()).parse(JSON.parse(s)))
841
- });
842
- var PongSuccessResponseSchema = z12.object({
843
- ok: z12.literal(true),
844
- triggerVersion: z12.string().optional(),
845
- triggerSdkVersion: z12.string().optional()
846
- });
847
- var PongErrorResponseSchema = z12.object({
848
- ok: z12.literal(false),
849
- error: z12.string(),
850
- triggerVersion: z12.string().optional(),
851
- triggerSdkVersion: z12.string().optional()
852
- });
853
- var PongResponseSchema = z12.discriminatedUnion("ok", [
791
+ var HttpEndpointRequestHeadersSchema = z.object({
792
+ "x-ts-key": z.string(),
793
+ "x-ts-http-url": z.string(),
794
+ "x-ts-http-method": z.string(),
795
+ "x-ts-http-headers": z.string().transform((s) => z.record(z.string()).parse(JSON.parse(s)))
796
+ });
797
+ var WebhookSourceRequestHeadersSchema = z.object({
798
+ "x-ts-key": z.string(),
799
+ "x-ts-dynamic-id": z.string().optional(),
800
+ "x-ts-secret": z.string(),
801
+ "x-ts-params": z.string().transform((s) => JSON.parse(s)),
802
+ "x-ts-http-url": z.string(),
803
+ "x-ts-http-method": z.string(),
804
+ "x-ts-http-headers": z.string().transform((s) => z.record(z.string()).parse(JSON.parse(s)))
805
+ });
806
+ var PongSuccessResponseSchema = z.object({
807
+ ok: z.literal(true),
808
+ triggerVersion: z.string().optional(),
809
+ triggerSdkVersion: z.string().optional()
810
+ });
811
+ var PongErrorResponseSchema = z.object({
812
+ ok: z.literal(false),
813
+ error: z.string(),
814
+ triggerVersion: z.string().optional(),
815
+ triggerSdkVersion: z.string().optional()
816
+ });
817
+ var PongResponseSchema = z.discriminatedUnion("ok", [
854
818
  PongSuccessResponseSchema,
855
819
  PongErrorResponseSchema
856
820
  ]);
857
- var ValidateSuccessResponseSchema = z12.object({
858
- ok: z12.literal(true),
859
- endpointId: z12.string(),
860
- triggerVersion: z12.string().optional()
821
+ var ValidateSuccessResponseSchema = z.object({
822
+ ok: z.literal(true),
823
+ endpointId: z.string(),
824
+ triggerVersion: z.string().optional()
861
825
  });
862
- var ValidateErrorResponseSchema = z12.object({
863
- ok: z12.literal(false),
864
- error: z12.string(),
865
- triggerVersion: z12.string().optional()
826
+ var ValidateErrorResponseSchema = z.object({
827
+ ok: z.literal(false),
828
+ error: z.string(),
829
+ triggerVersion: z.string().optional()
866
830
  });
867
- var ValidateResponseSchema = z12.discriminatedUnion("ok", [
831
+ var ValidateResponseSchema = z.discriminatedUnion("ok", [
868
832
  ValidateSuccessResponseSchema,
869
833
  ValidateErrorResponseSchema
870
834
  ]);
871
- var QueueOptionsSchema = z12.object({
872
- name: z12.string(),
873
- maxConcurrent: z12.number().optional()
874
- });
875
- var ConcurrencyLimitOptionsSchema = z12.object({
876
- id: z12.string(),
877
- limit: z12.number()
878
- });
879
- var JobMetadataSchema = z12.object({
880
- id: z12.string(),
881
- name: z12.string(),
882
- version: z12.string(),
835
+ var QueueOptionsSchema = z.object({
836
+ name: z.string(),
837
+ maxConcurrent: z.number().optional()
838
+ });
839
+ var ConcurrencyLimitOptionsSchema = z.object({
840
+ id: z.string(),
841
+ limit: z.number()
842
+ });
843
+ var JobMetadataSchema = z.object({
844
+ id: z.string(),
845
+ name: z.string(),
846
+ version: z.string(),
883
847
  event: EventSpecificationSchema,
884
848
  trigger: TriggerMetadataSchema,
885
- integrations: z12.record(IntegrationConfigSchema),
886
- internal: z12.boolean().default(false),
887
- enabled: z12.boolean(),
888
- startPosition: z12.enum([
849
+ integrations: z.record(IntegrationConfigSchema),
850
+ internal: z.boolean().default(false),
851
+ enabled: z.boolean(),
852
+ startPosition: z.enum([
889
853
  "initial",
890
854
  "latest"
891
855
  ]),
892
- preprocessRuns: z12.boolean(),
893
- concurrencyLimit: ConcurrencyLimitOptionsSchema.or(z12.number().int().positive()).optional()
856
+ preprocessRuns: z.boolean(),
857
+ concurrencyLimit: ConcurrencyLimitOptionsSchema.or(z.number().int().positive()).optional()
894
858
  });
895
- var SourceMetadataV1Schema = z12.object({
896
- version: z12.literal("1"),
897
- channel: z12.enum([
859
+ var SourceMetadataV1Schema = z.object({
860
+ version: z.literal("1"),
861
+ channel: z.enum([
898
862
  "HTTP",
899
863
  "SQS",
900
864
  "SMTP"
901
865
  ]),
902
866
  integration: IntegrationConfigSchema,
903
- key: z12.string(),
904
- params: z12.any(),
905
- events: z12.array(z12.string()),
906
- registerSourceJob: z12.object({
907
- id: z12.string(),
908
- version: z12.string()
867
+ key: z.string(),
868
+ params: z.any(),
869
+ events: z.array(z.string()),
870
+ registerSourceJob: z.object({
871
+ id: z.string(),
872
+ version: z.string()
909
873
  }).optional()
910
874
  });
911
- var SourceMetadataV2Schema = z12.object({
912
- version: z12.literal("2"),
913
- channel: z12.enum([
875
+ var SourceMetadataV2Schema = z.object({
876
+ version: z.literal("2"),
877
+ channel: z.enum([
914
878
  "HTTP",
915
879
  "SQS",
916
880
  "SMTP"
917
881
  ]),
918
882
  integration: IntegrationConfigSchema,
919
- key: z12.string(),
920
- params: z12.any(),
921
- options: z12.record(z12.array(z12.string())),
922
- registerSourceJob: z12.object({
923
- id: z12.string(),
924
- version: z12.string()
883
+ key: z.string(),
884
+ params: z.any(),
885
+ options: z.record(z.array(z.string())),
886
+ registerSourceJob: z.object({
887
+ id: z.string(),
888
+ version: z.string()
925
889
  }).optional()
926
890
  });
927
- var SourceMetadataSchema = z12.preprocess(addMissingVersionField, z12.discriminatedUnion("version", [
891
+ var SourceMetadataSchema = z.preprocess(addMissingVersionField, z.discriminatedUnion("version", [
928
892
  SourceMetadataV1Schema,
929
893
  SourceMetadataV2Schema
930
894
  ]));
931
- var WebhookMetadataSchema = z12.object({
932
- key: z12.string(),
933
- params: z12.any(),
934
- config: z12.record(z12.array(z12.string())),
895
+ var WebhookMetadataSchema = z.object({
896
+ key: z.string(),
897
+ params: z.any(),
898
+ config: z.record(z.array(z.string())),
935
899
  integration: IntegrationConfigSchema,
936
- httpEndpoint: z12.object({
937
- id: z12.string()
900
+ httpEndpoint: z.object({
901
+ id: z.string()
938
902
  })
939
903
  });
940
- var WebhookContextMetadataSchema = z12.object({
941
- params: z12.any(),
942
- config: z12.record(z12.string().array()),
943
- secret: z12.string()
904
+ var WebhookContextMetadataSchema = z.object({
905
+ params: z.any(),
906
+ config: z.record(z.string().array()),
907
+ secret: z.string()
944
908
  });
945
- var DynamicTriggerEndpointMetadataSchema = z12.object({
946
- id: z12.string(),
947
- jobs: z12.array(JobMetadataSchema.pick({
909
+ var DynamicTriggerEndpointMetadataSchema = z.object({
910
+ id: z.string(),
911
+ jobs: z.array(JobMetadataSchema.pick({
948
912
  id: true,
949
913
  version: true
950
914
  })),
951
- registerSourceJob: z12.object({
952
- id: z12.string(),
953
- version: z12.string()
915
+ registerSourceJob: z.object({
916
+ id: z.string(),
917
+ version: z.string()
954
918
  }).optional()
955
919
  });
956
- var HttpEndpointMetadataSchema = z12.object({
957
- id: z12.string(),
958
- version: z12.string(),
959
- enabled: z12.boolean(),
960
- title: z12.string().optional(),
961
- icon: z12.string().optional(),
962
- properties: z12.array(DisplayPropertySchema).optional(),
920
+ var HttpEndpointMetadataSchema = z.object({
921
+ id: z.string(),
922
+ version: z.string(),
923
+ enabled: z.boolean(),
924
+ title: z.string().optional(),
925
+ icon: z.string().optional(),
926
+ properties: z.array(DisplayPropertySchema).optional(),
963
927
  event: EventSpecificationSchema,
964
928
  immediateResponseFilter: RequestFilterSchema.optional(),
965
- skipTriggeringRuns: z12.boolean().optional(),
966
- source: z12.string()
967
- });
968
- var IndexEndpointResponseSchema = z12.object({
969
- jobs: z12.array(JobMetadataSchema),
970
- sources: z12.array(SourceMetadataSchema),
971
- webhooks: z12.array(WebhookMetadataSchema).optional(),
972
- dynamicTriggers: z12.array(DynamicTriggerEndpointMetadataSchema),
973
- dynamicSchedules: z12.array(RegisterDynamicSchedulePayloadSchema),
974
- httpEndpoints: z12.array(HttpEndpointMetadataSchema).optional()
975
- });
976
- var EndpointIndexErrorSchema = z12.object({
977
- message: z12.string(),
978
- raw: z12.any().optional()
979
- });
980
- var IndexEndpointStatsSchema = z12.object({
981
- jobs: z12.number(),
982
- sources: z12.number(),
983
- webhooks: z12.number().optional(),
984
- dynamicTriggers: z12.number(),
985
- dynamicSchedules: z12.number(),
986
- disabledJobs: z12.number().default(0),
987
- httpEndpoints: z12.number().default(0)
929
+ skipTriggeringRuns: z.boolean().optional(),
930
+ source: z.string()
931
+ });
932
+ var IndexEndpointResponseSchema = z.object({
933
+ jobs: z.array(JobMetadataSchema),
934
+ sources: z.array(SourceMetadataSchema),
935
+ webhooks: z.array(WebhookMetadataSchema).optional(),
936
+ dynamicTriggers: z.array(DynamicTriggerEndpointMetadataSchema),
937
+ dynamicSchedules: z.array(RegisterDynamicSchedulePayloadSchema),
938
+ httpEndpoints: z.array(HttpEndpointMetadataSchema).optional()
939
+ });
940
+ var EndpointIndexErrorSchema = z.object({
941
+ message: z.string(),
942
+ raw: z.any().optional()
943
+ });
944
+ var IndexEndpointStatsSchema = z.object({
945
+ jobs: z.number(),
946
+ sources: z.number(),
947
+ webhooks: z.number().optional(),
948
+ dynamicTriggers: z.number(),
949
+ dynamicSchedules: z.number(),
950
+ disabledJobs: z.number().default(0),
951
+ httpEndpoints: z.number().default(0)
988
952
  });
989
953
  function parseEndpointIndexStats(stats) {
990
954
  if (stats === null || stats === void 0) {
@@ -993,227 +957,227 @@ function parseEndpointIndexStats(stats) {
993
957
  return IndexEndpointStatsSchema.parse(stats);
994
958
  }
995
959
  __name(parseEndpointIndexStats, "parseEndpointIndexStats");
996
- var GetEndpointIndexResponseSchema = z12.discriminatedUnion("status", [
997
- z12.object({
998
- status: z12.literal("PENDING"),
999
- updatedAt: z12.coerce.date()
960
+ var GetEndpointIndexResponseSchema = z.discriminatedUnion("status", [
961
+ z.object({
962
+ status: z.literal("PENDING"),
963
+ updatedAt: z.coerce.date()
1000
964
  }),
1001
- z12.object({
1002
- status: z12.literal("STARTED"),
1003
- updatedAt: z12.coerce.date()
965
+ z.object({
966
+ status: z.literal("STARTED"),
967
+ updatedAt: z.coerce.date()
1004
968
  }),
1005
- z12.object({
1006
- status: z12.literal("SUCCESS"),
969
+ z.object({
970
+ status: z.literal("SUCCESS"),
1007
971
  stats: IndexEndpointStatsSchema,
1008
- updatedAt: z12.coerce.date()
972
+ updatedAt: z.coerce.date()
1009
973
  }),
1010
- z12.object({
1011
- status: z12.literal("FAILURE"),
974
+ z.object({
975
+ status: z.literal("FAILURE"),
1012
976
  error: EndpointIndexErrorSchema,
1013
- updatedAt: z12.coerce.date()
977
+ updatedAt: z.coerce.date()
1014
978
  })
1015
979
  ]);
1016
- var EndpointHeadersSchema = z12.object({
1017
- "trigger-version": z12.string().optional(),
1018
- "trigger-sdk-version": z12.string().optional()
980
+ var EndpointHeadersSchema = z.object({
981
+ "trigger-version": z.string().optional(),
982
+ "trigger-sdk-version": z.string().optional()
1019
983
  });
1020
- var ExecuteJobRunMetadataSchema = z12.object({
1021
- successSubscription: z12.boolean().optional(),
1022
- failedSubscription: z12.boolean().optional()
984
+ var ExecuteJobRunMetadataSchema = z.object({
985
+ successSubscription: z.boolean().optional(),
986
+ failedSubscription: z.boolean().optional()
1023
987
  });
1024
988
  var ExecuteJobHeadersSchema = EndpointHeadersSchema.extend({
1025
- "x-trigger-run-metadata": z12.preprocess((val) => typeof val === "string" && JSON.parse(val), ExecuteJobRunMetadataSchema).optional()
989
+ "x-trigger-run-metadata": z.preprocess((val) => typeof val === "string" && JSON.parse(val), ExecuteJobRunMetadataSchema).optional()
1026
990
  });
1027
- var RawEventSchema = z12.object({
991
+ var RawEventSchema = z.object({
1028
992
  /** The `name` property must exactly match any subscriptions you want to
1029
993
  trigger. */
1030
- name: z12.string(),
994
+ name: z.string(),
1031
995
  /** The `payload` property will be sent to any matching Jobs and will appear
1032
996
  as the `payload` param of the `run()` function. You can leave this
1033
997
  parameter out if you just want to trigger a Job without any input data. */
1034
- payload: z12.any(),
998
+ payload: z.any(),
1035
999
  /** The optional `context` property will be sent to any matching Jobs and will
1036
1000
  be passed through as the `context.event.context` param of the `run()`
1037
1001
  function. This is optional but can be useful if you want to pass through
1038
1002
  some additional context to the Job. */
1039
- context: z12.any().optional(),
1003
+ context: z.any().optional(),
1040
1004
  /** The `id` property uniquely identify this particular event. If unset it
1041
1005
  will be set automatically using `ulid`. */
1042
- id: z12.string().default(() => ulid()),
1006
+ id: z.string().default(() => ulid()),
1043
1007
  /** This is optional, it defaults to the current timestamp. Usually you would
1044
1008
  only set this if you have a timestamp that you wish to pass through, e.g.
1045
1009
  you receive a timestamp from a service and you want the same timestamp to
1046
1010
  be used in your Job. */
1047
- timestamp: z12.coerce.date().optional(),
1011
+ timestamp: z.coerce.date().optional(),
1048
1012
  /** This is optional, it defaults to "trigger.dev". It can be useful to set
1049
1013
  this as you can filter events using this in the `eventTrigger()`. */
1050
- source: z12.string().optional(),
1014
+ source: z.string().optional(),
1051
1015
  /** This is optional, it defaults to "JSON". If your event is actually a request,
1052
1016
  with a url, headers, method and rawBody you can use "REQUEST" */
1053
- payloadType: z12.union([
1054
- z12.literal("JSON"),
1055
- z12.literal("REQUEST")
1017
+ payloadType: z.union([
1018
+ z.literal("JSON"),
1019
+ z.literal("REQUEST")
1056
1020
  ]).optional()
1057
1021
  });
1058
- var ApiEventLogSchema = z12.object({
1022
+ var ApiEventLogSchema = z.object({
1059
1023
  /** The `id` of the event that was sent.
1060
1024
  */
1061
- id: z12.string(),
1025
+ id: z.string(),
1062
1026
  /** The `name` of the event that was sent. */
1063
- name: z12.string(),
1027
+ name: z.string(),
1064
1028
  /** The `payload` of the event that was sent */
1065
1029
  payload: DeserializedJsonSchema,
1066
1030
  /** The `context` of the event that was sent. Is `undefined` if no context was
1067
1031
  set when sending the event. */
1068
1032
  context: DeserializedJsonSchema.optional().nullable(),
1069
1033
  /** The `timestamp` of the event that was sent */
1070
- timestamp: z12.coerce.date(),
1034
+ timestamp: z.coerce.date(),
1071
1035
  /** The timestamp when the event will be delivered to any matching Jobs. Is
1072
1036
  `undefined` if `deliverAt` or `deliverAfter` wasn't set when sending the
1073
1037
  event. */
1074
- deliverAt: z12.coerce.date().optional().nullable(),
1038
+ deliverAt: z.coerce.date().optional().nullable(),
1075
1039
  /** The timestamp when the event was delivered. Is `undefined` if `deliverAt`
1076
1040
  or `deliverAfter` were set when sending the event. */
1077
- deliveredAt: z12.coerce.date().optional().nullable(),
1041
+ deliveredAt: z.coerce.date().optional().nullable(),
1078
1042
  /** The timestamp when the event was cancelled. Is `undefined` if the event
1079
1043
  * wasn't cancelled. */
1080
- cancelledAt: z12.coerce.date().optional().nullable()
1044
+ cancelledAt: z.coerce.date().optional().nullable()
1081
1045
  });
1082
- var SendEventOptionsSchema = z12.object({
1046
+ var SendEventOptionsSchema = z.object({
1083
1047
  /** An optional Date when you want the event to trigger Jobs. The event will
1084
1048
  be sent to the platform immediately but won't be acted upon until the
1085
1049
  specified time. */
1086
- deliverAt: z12.coerce.date().optional(),
1050
+ deliverAt: z.coerce.date().optional(),
1087
1051
  /** An optional number of seconds you want to wait for the event to trigger
1088
1052
  any relevant Jobs. The event will be sent to the platform immediately but
1089
1053
  won't be delivered until after the elapsed number of seconds. */
1090
- deliverAfter: z12.number().int().optional(),
1054
+ deliverAfter: z.number().int().optional(),
1091
1055
  /** This optional param will be used by Trigger.dev Connect, which
1092
1056
  is coming soon. */
1093
- accountId: z12.string().optional()
1057
+ accountId: z.string().optional()
1094
1058
  });
1095
- var SendEventBodySchema = z12.object({
1059
+ var SendEventBodySchema = z.object({
1096
1060
  event: RawEventSchema,
1097
1061
  options: SendEventOptionsSchema.optional()
1098
1062
  });
1099
- var SendBulkEventsBodySchema = z12.object({
1063
+ var SendBulkEventsBodySchema = z.object({
1100
1064
  events: RawEventSchema.array(),
1101
1065
  options: SendEventOptionsSchema.optional()
1102
1066
  });
1103
- var DeliverEventResponseSchema = z12.object({
1104
- deliveredAt: z12.string().datetime()
1067
+ var DeliverEventResponseSchema = z.object({
1068
+ deliveredAt: z.string().datetime()
1105
1069
  });
1106
- var RuntimeEnvironmentTypeSchema = z12.enum([
1070
+ var RuntimeEnvironmentTypeSchema = z.enum([
1107
1071
  "PRODUCTION",
1108
1072
  "STAGING",
1109
1073
  "DEVELOPMENT",
1110
1074
  "PREVIEW"
1111
1075
  ]);
1112
- var RunSourceContextSchema = z12.object({
1113
- id: z12.string(),
1114
- metadata: z12.any()
1076
+ var RunSourceContextSchema = z.object({
1077
+ id: z.string(),
1078
+ metadata: z.any()
1115
1079
  });
1116
- var AutoYieldConfigSchema = z12.object({
1117
- startTaskThreshold: z12.number(),
1118
- beforeExecuteTaskThreshold: z12.number(),
1119
- beforeCompleteTaskThreshold: z12.number(),
1120
- afterCompleteTaskThreshold: z12.number()
1080
+ var AutoYieldConfigSchema = z.object({
1081
+ startTaskThreshold: z.number(),
1082
+ beforeExecuteTaskThreshold: z.number(),
1083
+ beforeCompleteTaskThreshold: z.number(),
1084
+ afterCompleteTaskThreshold: z.number()
1121
1085
  });
1122
- var RunJobBodySchema = z12.object({
1086
+ var RunJobBodySchema = z.object({
1123
1087
  event: ApiEventLogSchema,
1124
- job: z12.object({
1125
- id: z12.string(),
1126
- version: z12.string()
1088
+ job: z.object({
1089
+ id: z.string(),
1090
+ version: z.string()
1127
1091
  }),
1128
- run: z12.object({
1129
- id: z12.string(),
1130
- isTest: z12.boolean(),
1131
- isRetry: z12.boolean().default(false),
1132
- startedAt: z12.coerce.date()
1092
+ run: z.object({
1093
+ id: z.string(),
1094
+ isTest: z.boolean(),
1095
+ isRetry: z.boolean().default(false),
1096
+ startedAt: z.coerce.date()
1133
1097
  }),
1134
- environment: z12.object({
1135
- id: z12.string(),
1136
- slug: z12.string(),
1098
+ environment: z.object({
1099
+ id: z.string(),
1100
+ slug: z.string(),
1137
1101
  type: RuntimeEnvironmentTypeSchema
1138
1102
  }),
1139
- organization: z12.object({
1140
- id: z12.string(),
1141
- title: z12.string(),
1142
- slug: z12.string()
1103
+ organization: z.object({
1104
+ id: z.string(),
1105
+ title: z.string(),
1106
+ slug: z.string()
1143
1107
  }),
1144
- project: z12.object({
1145
- id: z12.string(),
1146
- name: z12.string(),
1147
- slug: z12.string()
1108
+ project: z.object({
1109
+ id: z.string(),
1110
+ name: z.string(),
1111
+ slug: z.string()
1148
1112
  }).optional(),
1149
- account: z12.object({
1150
- id: z12.string(),
1151
- metadata: z12.any()
1113
+ account: z.object({
1114
+ id: z.string(),
1115
+ metadata: z.any()
1152
1116
  }).optional(),
1153
1117
  source: RunSourceContextSchema.optional(),
1154
- tasks: z12.array(CachedTaskSchema).optional(),
1155
- cachedTaskCursor: z12.string().optional(),
1156
- noopTasksSet: z12.string().optional(),
1157
- connections: z12.record(ConnectionAuthSchema).optional(),
1158
- yieldedExecutions: z12.string().array().optional(),
1159
- runChunkExecutionLimit: z12.number().optional(),
1118
+ tasks: z.array(CachedTaskSchema).optional(),
1119
+ cachedTaskCursor: z.string().optional(),
1120
+ noopTasksSet: z.string().optional(),
1121
+ connections: z.record(ConnectionAuthSchema).optional(),
1122
+ yieldedExecutions: z.string().array().optional(),
1123
+ runChunkExecutionLimit: z.number().optional(),
1160
1124
  autoYieldConfig: AutoYieldConfigSchema.optional()
1161
1125
  });
1162
- var RunJobErrorSchema = z12.object({
1163
- status: z12.literal("ERROR"),
1126
+ var RunJobErrorSchema = z.object({
1127
+ status: z.literal("ERROR"),
1164
1128
  error: ErrorWithStackSchema,
1165
1129
  task: TaskSchema.optional()
1166
1130
  });
1167
- var RunJobYieldExecutionErrorSchema = z12.object({
1168
- status: z12.literal("YIELD_EXECUTION"),
1169
- key: z12.string()
1131
+ var RunJobYieldExecutionErrorSchema = z.object({
1132
+ status: z.literal("YIELD_EXECUTION"),
1133
+ key: z.string()
1170
1134
  });
1171
- var AutoYieldMetadataSchema = z12.object({
1172
- location: z12.string(),
1173
- timeRemaining: z12.number(),
1174
- timeElapsed: z12.number(),
1175
- limit: z12.number().optional()
1135
+ var AutoYieldMetadataSchema = z.object({
1136
+ location: z.string(),
1137
+ timeRemaining: z.number(),
1138
+ timeElapsed: z.number(),
1139
+ limit: z.number().optional()
1176
1140
  });
1177
1141
  var RunJobAutoYieldExecutionErrorSchema = AutoYieldMetadataSchema.extend({
1178
- status: z12.literal("AUTO_YIELD_EXECUTION")
1142
+ status: z.literal("AUTO_YIELD_EXECUTION")
1179
1143
  });
1180
- var RunJobAutoYieldWithCompletedTaskExecutionErrorSchema = z12.object({
1181
- status: z12.literal("AUTO_YIELD_EXECUTION_WITH_COMPLETED_TASK"),
1182
- id: z12.string(),
1183
- properties: z12.array(DisplayPropertySchema).optional(),
1184
- output: z12.string().optional(),
1144
+ var RunJobAutoYieldWithCompletedTaskExecutionErrorSchema = z.object({
1145
+ status: z.literal("AUTO_YIELD_EXECUTION_WITH_COMPLETED_TASK"),
1146
+ id: z.string(),
1147
+ properties: z.array(DisplayPropertySchema).optional(),
1148
+ output: z.string().optional(),
1185
1149
  data: AutoYieldMetadataSchema
1186
1150
  });
1187
- var RunJobInvalidPayloadErrorSchema = z12.object({
1188
- status: z12.literal("INVALID_PAYLOAD"),
1189
- errors: z12.array(SchemaErrorSchema)
1151
+ var RunJobInvalidPayloadErrorSchema = z.object({
1152
+ status: z.literal("INVALID_PAYLOAD"),
1153
+ errors: z.array(SchemaErrorSchema)
1190
1154
  });
1191
- var RunJobUnresolvedAuthErrorSchema = z12.object({
1192
- status: z12.literal("UNRESOLVED_AUTH_ERROR"),
1193
- issues: z12.record(z12.object({
1194
- id: z12.string(),
1195
- error: z12.string()
1155
+ var RunJobUnresolvedAuthErrorSchema = z.object({
1156
+ status: z.literal("UNRESOLVED_AUTH_ERROR"),
1157
+ issues: z.record(z.object({
1158
+ id: z.string(),
1159
+ error: z.string()
1196
1160
  }))
1197
1161
  });
1198
- var RunJobResumeWithTaskSchema = z12.object({
1199
- status: z12.literal("RESUME_WITH_TASK"),
1162
+ var RunJobResumeWithTaskSchema = z.object({
1163
+ status: z.literal("RESUME_WITH_TASK"),
1200
1164
  task: TaskSchema
1201
1165
  });
1202
- var RunJobRetryWithTaskSchema = z12.object({
1203
- status: z12.literal("RETRY_WITH_TASK"),
1166
+ var RunJobRetryWithTaskSchema = z.object({
1167
+ status: z.literal("RETRY_WITH_TASK"),
1204
1168
  task: TaskSchema,
1205
1169
  error: ErrorWithStackSchema,
1206
- retryAt: z12.coerce.date()
1170
+ retryAt: z.coerce.date()
1207
1171
  });
1208
- var RunJobCanceledWithTaskSchema = z12.object({
1209
- status: z12.literal("CANCELED"),
1172
+ var RunJobCanceledWithTaskSchema = z.object({
1173
+ status: z.literal("CANCELED"),
1210
1174
  task: TaskSchema
1211
1175
  });
1212
- var RunJobSuccessSchema = z12.object({
1213
- status: z12.literal("SUCCESS"),
1176
+ var RunJobSuccessSchema = z.object({
1177
+ status: z.literal("SUCCESS"),
1214
1178
  output: DeserializedJsonSchema.optional()
1215
1179
  });
1216
- var RunJobErrorResponseSchema = z12.union([
1180
+ var RunJobErrorResponseSchema = z.union([
1217
1181
  RunJobAutoYieldExecutionErrorSchema,
1218
1182
  RunJobAutoYieldWithCompletedTaskExecutionErrorSchema,
1219
1183
  RunJobYieldExecutionErrorSchema,
@@ -1224,12 +1188,12 @@ var RunJobErrorResponseSchema = z12.union([
1224
1188
  RunJobRetryWithTaskSchema,
1225
1189
  RunJobCanceledWithTaskSchema
1226
1190
  ]);
1227
- var RunJobResumeWithParallelTaskSchema = z12.object({
1228
- status: z12.literal("RESUME_WITH_PARALLEL_TASK"),
1191
+ var RunJobResumeWithParallelTaskSchema = z.object({
1192
+ status: z.literal("RESUME_WITH_PARALLEL_TASK"),
1229
1193
  task: TaskSchema,
1230
- childErrors: z12.array(RunJobErrorResponseSchema)
1194
+ childErrors: z.array(RunJobErrorResponseSchema)
1231
1195
  });
1232
- var RunJobResponseSchema = z12.discriminatedUnion("status", [
1196
+ var RunJobResponseSchema = z.discriminatedUnion("status", [
1233
1197
  RunJobAutoYieldExecutionErrorSchema,
1234
1198
  RunJobAutoYieldWithCompletedTaskExecutionErrorSchema,
1235
1199
  RunJobYieldExecutionErrorSchema,
@@ -1242,137 +1206,137 @@ var RunJobResponseSchema = z12.discriminatedUnion("status", [
1242
1206
  RunJobCanceledWithTaskSchema,
1243
1207
  RunJobSuccessSchema
1244
1208
  ]);
1245
- var PreprocessRunBodySchema = z12.object({
1209
+ var PreprocessRunBodySchema = z.object({
1246
1210
  event: ApiEventLogSchema,
1247
- job: z12.object({
1248
- id: z12.string(),
1249
- version: z12.string()
1211
+ job: z.object({
1212
+ id: z.string(),
1213
+ version: z.string()
1250
1214
  }),
1251
- run: z12.object({
1252
- id: z12.string(),
1253
- isTest: z12.boolean()
1215
+ run: z.object({
1216
+ id: z.string(),
1217
+ isTest: z.boolean()
1254
1218
  }),
1255
- environment: z12.object({
1256
- id: z12.string(),
1257
- slug: z12.string(),
1219
+ environment: z.object({
1220
+ id: z.string(),
1221
+ slug: z.string(),
1258
1222
  type: RuntimeEnvironmentTypeSchema
1259
1223
  }),
1260
- organization: z12.object({
1261
- id: z12.string(),
1262
- title: z12.string(),
1263
- slug: z12.string()
1224
+ organization: z.object({
1225
+ id: z.string(),
1226
+ title: z.string(),
1227
+ slug: z.string()
1264
1228
  }),
1265
- account: z12.object({
1266
- id: z12.string(),
1267
- metadata: z12.any()
1229
+ account: z.object({
1230
+ id: z.string(),
1231
+ metadata: z.any()
1268
1232
  }).optional()
1269
1233
  });
1270
- var PreprocessRunResponseSchema = z12.object({
1271
- abort: z12.boolean(),
1272
- properties: z12.array(DisplayPropertySchema).optional()
1234
+ var PreprocessRunResponseSchema = z.object({
1235
+ abort: z.boolean(),
1236
+ properties: z.array(DisplayPropertySchema).optional()
1273
1237
  });
1274
- var CreateRunResponseOkSchema = z12.object({
1275
- ok: z12.literal(true),
1276
- data: z12.object({
1277
- id: z12.string()
1238
+ var CreateRunResponseOkSchema = z.object({
1239
+ ok: z.literal(true),
1240
+ data: z.object({
1241
+ id: z.string()
1278
1242
  })
1279
1243
  });
1280
- var CreateRunResponseErrorSchema = z12.object({
1281
- ok: z12.literal(false),
1282
- error: z12.string()
1244
+ var CreateRunResponseErrorSchema = z.object({
1245
+ ok: z.literal(false),
1246
+ error: z.string()
1283
1247
  });
1284
- var CreateRunResponseBodySchema = z12.discriminatedUnion("ok", [
1248
+ var CreateRunResponseBodySchema = z.discriminatedUnion("ok", [
1285
1249
  CreateRunResponseOkSchema,
1286
1250
  CreateRunResponseErrorSchema
1287
1251
  ]);
1288
- var RedactStringSchema = z12.object({
1289
- __redactedString: z12.literal(true),
1290
- strings: z12.array(z12.string()),
1291
- interpolations: z12.array(z12.string())
1252
+ var RedactStringSchema = z.object({
1253
+ __redactedString: z.literal(true),
1254
+ strings: z.array(z.string()),
1255
+ interpolations: z.array(z.string())
1292
1256
  });
1293
- var LogMessageSchema = z12.object({
1294
- level: z12.enum([
1257
+ var LogMessageSchema = z.object({
1258
+ level: z.enum([
1295
1259
  "DEBUG",
1296
1260
  "INFO",
1297
1261
  "WARN",
1298
1262
  "ERROR"
1299
1263
  ]),
1300
- message: z12.string(),
1264
+ message: z.string(),
1301
1265
  data: SerializableJsonSchema.optional()
1302
1266
  });
1303
- var RedactSchema = z12.object({
1304
- paths: z12.array(z12.string())
1267
+ var RedactSchema = z.object({
1268
+ paths: z.array(z.string())
1305
1269
  });
1306
- var RetryOptionsSchema = z12.object({
1270
+ var RetryOptionsSchema = z.object({
1307
1271
  /** The maximum number of times to retry the request. */
1308
- limit: z12.number().optional(),
1272
+ limit: z.number().optional(),
1309
1273
  /** The exponential factor to use when calculating the next retry time. */
1310
- factor: z12.number().optional(),
1274
+ factor: z.number().optional(),
1311
1275
  /** The minimum amount of time to wait before retrying the request. */
1312
- minTimeoutInMs: z12.number().optional(),
1276
+ minTimeoutInMs: z.number().optional(),
1313
1277
  /** The maximum amount of time to wait before retrying the request. */
1314
- maxTimeoutInMs: z12.number().optional(),
1278
+ maxTimeoutInMs: z.number().optional(),
1315
1279
  /** Whether to randomize the retry time. */
1316
- randomize: z12.boolean().optional()
1280
+ randomize: z.boolean().optional()
1317
1281
  });
1318
- var RunTaskOptionsSchema = z12.object({
1282
+ var RunTaskOptionsSchema = z.object({
1319
1283
  /** The name of the Task is required. This is displayed on the Task in the logs. */
1320
- name: z12.string().optional(),
1284
+ name: z.string().optional(),
1321
1285
  /** The Task will wait and only start at the specified Date */
1322
- delayUntil: z12.coerce.date().optional(),
1286
+ delayUntil: z.coerce.date().optional(),
1323
1287
  /** Retry options */
1324
1288
  retry: RetryOptionsSchema.optional(),
1325
1289
  /** The icon for the Task, it will appear in the logs.
1326
1290
  * You can use the name of a company in lowercase, e.g. "github".
1327
1291
  * Or any icon name that [Tabler Icons](https://tabler-icons.io/) supports. */
1328
- icon: z12.string().optional(),
1292
+ icon: z.string().optional(),
1329
1293
  /** The key for the Task that you want to appear in the logs */
1330
- displayKey: z12.string().optional(),
1294
+ displayKey: z.string().optional(),
1331
1295
  /** A description of the Task */
1332
- description: z12.string().optional(),
1296
+ description: z.string().optional(),
1333
1297
  /** Properties that are displayed in the logs */
1334
- properties: z12.array(DisplayPropertySchema).optional(),
1298
+ properties: z.array(DisplayPropertySchema).optional(),
1335
1299
  /** The input params to the Task, will be displayed in the logs */
1336
- params: z12.any(),
1300
+ params: z.any(),
1337
1301
  /** The style of the log entry. */
1338
1302
  style: StyleSchema.optional(),
1339
1303
  /** 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. */
1340
- callback: z12.object({
1304
+ callback: z.object({
1341
1305
  /** Causes the task to wait for and return the data of the first request sent to `task.callbackUrl`. */
1342
- enabled: z12.boolean(),
1306
+ enabled: z.boolean(),
1343
1307
  /** Time to wait for the first request to `task.callbackUrl`. Default: One hour. */
1344
- timeoutInSeconds: z12.number()
1308
+ timeoutInSeconds: z.number()
1345
1309
  }).partial().optional(),
1346
1310
  /** Allows you to link the Integration connection in the logs. This is handled automatically in integrations. */
1347
- connectionKey: z12.string().optional(),
1311
+ connectionKey: z.string().optional(),
1348
1312
  /** 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. */
1349
- operation: z12.enum([
1313
+ operation: z.enum([
1350
1314
  "fetch",
1351
1315
  "fetch-response",
1352
1316
  "fetch-poll"
1353
1317
  ]).optional(),
1354
1318
  /** 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). */
1355
- noop: z12.boolean().default(false),
1319
+ noop: z.boolean().default(false),
1356
1320
  redact: RedactSchema.optional(),
1357
- parallel: z12.boolean().optional()
1321
+ parallel: z.boolean().optional()
1358
1322
  });
1359
1323
  var RunTaskBodyInputSchema = RunTaskOptionsSchema.extend({
1360
- idempotencyKey: z12.string(),
1361
- parentId: z12.string().optional()
1324
+ idempotencyKey: z.string(),
1325
+ parentId: z.string().optional()
1362
1326
  });
1363
1327
  var RunTaskBodyOutputSchema = RunTaskBodyInputSchema.extend({
1364
- properties: z12.array(DisplayPropertySchema.partial()).optional(),
1328
+ properties: z.array(DisplayPropertySchema.partial()).optional(),
1365
1329
  params: DeserializedJsonSchema.optional().nullable(),
1366
- callback: z12.object({
1367
- enabled: z12.boolean(),
1368
- timeoutInSeconds: z12.number().default(3600)
1330
+ callback: z.object({
1331
+ enabled: z.boolean(),
1332
+ timeoutInSeconds: z.number().default(3600)
1369
1333
  }).optional()
1370
1334
  });
1371
- var RunTaskResponseWithCachedTasksBodySchema = z12.object({
1335
+ var RunTaskResponseWithCachedTasksBodySchema = z.object({
1372
1336
  task: ServerTaskSchema,
1373
- cachedTasks: z12.object({
1374
- tasks: z12.array(CachedTaskSchema),
1375
- cursor: z12.string().optional()
1337
+ cachedTasks: z.object({
1338
+ tasks: z.array(CachedTaskSchema),
1339
+ cursor: z.string().optional()
1376
1340
  }).optional()
1377
1341
  });
1378
1342
  var CompleteTaskBodyInputSchema = RunTaskBodyInputSchema.pick({
@@ -1387,208 +1351,202 @@ var CompleteTaskBodyV2InputSchema = RunTaskBodyInputSchema.pick({
1387
1351
  description: true,
1388
1352
  params: true
1389
1353
  }).extend({
1390
- output: z12.string().optional()
1354
+ output: z.string().optional()
1391
1355
  });
1392
- var FailTaskBodyInputSchema = z12.object({
1356
+ var FailTaskBodyInputSchema = z.object({
1393
1357
  error: ErrorWithStackSchema
1394
1358
  });
1395
- var NormalizedRequestSchema = z12.object({
1396
- headers: z12.record(z12.string()),
1397
- method: z12.string(),
1398
- query: z12.record(z12.string()),
1399
- url: z12.string(),
1400
- body: z12.any()
1359
+ var NormalizedRequestSchema = z.object({
1360
+ headers: z.record(z.string()),
1361
+ method: z.string(),
1362
+ query: z.record(z.string()),
1363
+ url: z.string(),
1364
+ body: z.any()
1401
1365
  });
1402
- var NormalizedResponseSchema = z12.object({
1403
- status: z12.number(),
1404
- body: z12.any(),
1405
- headers: z12.record(z12.string()).optional()
1366
+ var NormalizedResponseSchema = z.object({
1367
+ status: z.number(),
1368
+ body: z.any(),
1369
+ headers: z.record(z.string()).optional()
1406
1370
  });
1407
- var HttpSourceResponseSchema = z12.object({
1371
+ var HttpSourceResponseSchema = z.object({
1408
1372
  response: NormalizedResponseSchema,
1409
- events: z12.array(RawEventSchema),
1373
+ events: z.array(RawEventSchema),
1410
1374
  metadata: HttpSourceResponseMetadataSchema.optional()
1411
1375
  });
1412
- var WebhookDeliveryResponseSchema = z12.object({
1376
+ var WebhookDeliveryResponseSchema = z.object({
1413
1377
  response: NormalizedResponseSchema,
1414
- verified: z12.boolean(),
1415
- error: z12.string().optional()
1378
+ verified: z.boolean(),
1379
+ error: z.string().optional()
1416
1380
  });
1417
- var RegisterTriggerBodySchemaV1 = z12.object({
1381
+ var RegisterTriggerBodySchemaV1 = z.object({
1418
1382
  rule: EventRuleSchema,
1419
1383
  source: SourceMetadataV1Schema
1420
1384
  });
1421
- var RegisterTriggerBodySchemaV2 = z12.object({
1385
+ var RegisterTriggerBodySchemaV2 = z.object({
1422
1386
  rule: EventRuleSchema,
1423
1387
  source: SourceMetadataV2Schema,
1424
- accountId: z12.string().optional()
1388
+ accountId: z.string().optional()
1425
1389
  });
1426
- var InitializeTriggerBodySchema = z12.object({
1427
- id: z12.string(),
1428
- params: z12.any(),
1429
- accountId: z12.string().optional(),
1430
- metadata: z12.any().optional()
1390
+ var InitializeTriggerBodySchema = z.object({
1391
+ id: z.string(),
1392
+ params: z.any(),
1393
+ accountId: z.string().optional(),
1394
+ metadata: z.any().optional()
1431
1395
  });
1432
- var RegisterCommonScheduleBodySchema = z12.object({
1396
+ var RegisterCommonScheduleBodySchema = z.object({
1433
1397
  /** A unique id for the schedule. This is used to identify and unregister the schedule later. */
1434
- id: z12.string(),
1398
+ id: z.string(),
1435
1399
  /** Any additional metadata about the schedule. */
1436
- metadata: z12.any(),
1400
+ metadata: z.any(),
1437
1401
  /** An optional Account ID to associate with runs triggered by this schedule */
1438
- accountId: z12.string().optional()
1402
+ accountId: z.string().optional()
1439
1403
  });
1440
1404
  var RegisterIntervalScheduleBodySchema = RegisterCommonScheduleBodySchema.merge(IntervalMetadataSchema);
1441
1405
  var InitializeCronScheduleBodySchema = RegisterCommonScheduleBodySchema.merge(CronMetadataSchema);
1442
- var RegisterScheduleBodySchema = z12.discriminatedUnion("type", [
1406
+ var RegisterScheduleBodySchema = z.discriminatedUnion("type", [
1443
1407
  RegisterIntervalScheduleBodySchema,
1444
1408
  InitializeCronScheduleBodySchema
1445
1409
  ]);
1446
- var RegisterScheduleResponseBodySchema = z12.object({
1447
- id: z12.string(),
1410
+ var RegisterScheduleResponseBodySchema = z.object({
1411
+ id: z.string(),
1448
1412
  schedule: ScheduleMetadataSchema,
1449
- metadata: z12.any(),
1450
- active: z12.boolean()
1413
+ metadata: z.any(),
1414
+ active: z.boolean()
1451
1415
  });
1452
- var CreateExternalConnectionBodySchema = z12.object({
1453
- accessToken: z12.string(),
1454
- type: z12.enum([
1416
+ var CreateExternalConnectionBodySchema = z.object({
1417
+ accessToken: z.string(),
1418
+ type: z.enum([
1455
1419
  "oauth2"
1456
1420
  ]),
1457
- scopes: z12.array(z12.string()).optional(),
1458
- metadata: z12.any()
1421
+ scopes: z.array(z.string()).optional(),
1422
+ metadata: z.any()
1459
1423
  });
1460
- var GetRunStatusesSchema = z12.object({
1461
- run: z12.object({
1462
- id: z12.string(),
1424
+ var GetRunStatusesSchema = z.object({
1425
+ run: z.object({
1426
+ id: z.string(),
1463
1427
  status: RunStatusSchema,
1464
- output: z12.any().optional()
1428
+ output: z.any().optional()
1465
1429
  }),
1466
- statuses: z12.array(JobRunStatusRecordSchema)
1430
+ statuses: z.array(JobRunStatusRecordSchema)
1467
1431
  });
1468
- var InvokeJobResponseSchema = z12.object({
1469
- id: z12.string()
1432
+ var InvokeJobResponseSchema = z.object({
1433
+ id: z.string()
1470
1434
  });
1471
- var InvokeJobRequestBodySchema = z12.object({
1472
- payload: z12.any(),
1473
- context: z12.any().optional(),
1474
- options: z12.object({
1475
- accountId: z12.string().optional(),
1476
- callbackUrl: z12.string().optional()
1435
+ var InvokeJobRequestBodySchema = z.object({
1436
+ payload: z.any(),
1437
+ context: z.any().optional(),
1438
+ options: z.object({
1439
+ accountId: z.string().optional(),
1440
+ callbackUrl: z.string().optional()
1477
1441
  }).optional()
1478
1442
  });
1479
- var InvokeOptionsSchema = z12.object({
1480
- accountId: z12.string().optional(),
1481
- idempotencyKey: z12.string().optional(),
1482
- context: z12.any().optional(),
1483
- callbackUrl: z12.string().optional()
1443
+ var InvokeOptionsSchema = z.object({
1444
+ accountId: z.string().optional(),
1445
+ idempotencyKey: z.string().optional(),
1446
+ context: z.any().optional(),
1447
+ callbackUrl: z.string().optional()
1484
1448
  });
1485
- var EphemeralEventDispatcherRequestBodySchema = z12.object({
1486
- url: z12.string(),
1487
- name: z12.string().or(z12.array(z12.string())),
1488
- source: z12.string().optional(),
1449
+ var EphemeralEventDispatcherRequestBodySchema = z.object({
1450
+ url: z.string(),
1451
+ name: z.string().or(z.array(z.string())),
1452
+ source: z.string().optional(),
1489
1453
  filter: EventFilterSchema.optional(),
1490
1454
  contextFilter: EventFilterSchema.optional(),
1491
- accountId: z12.string().optional(),
1492
- timeoutInSeconds: z12.number().int().positive().min(10).max(60 * 60 * 24 * 365).default(3600)
1455
+ accountId: z.string().optional(),
1456
+ timeoutInSeconds: z.number().int().positive().min(10).max(60 * 60 * 24 * 365).default(3600)
1493
1457
  });
1494
- var EphemeralEventDispatcherResponseBodySchema = z12.object({
1495
- id: z12.string()
1458
+ var EphemeralEventDispatcherResponseBodySchema = z.object({
1459
+ id: z.string()
1496
1460
  });
1497
- var KeyValueStoreResponseBodySchema = z12.discriminatedUnion("action", [
1498
- z12.object({
1499
- action: z12.literal("DELETE"),
1500
- key: z12.string(),
1501
- deleted: z12.boolean()
1461
+ var KeyValueStoreResponseBodySchema = z.discriminatedUnion("action", [
1462
+ z.object({
1463
+ action: z.literal("DELETE"),
1464
+ key: z.string(),
1465
+ deleted: z.boolean()
1502
1466
  }),
1503
- z12.object({
1504
- action: z12.literal("GET"),
1505
- key: z12.string(),
1506
- value: z12.string().optional()
1467
+ z.object({
1468
+ action: z.literal("GET"),
1469
+ key: z.string(),
1470
+ value: z.string().optional()
1507
1471
  }),
1508
- z12.object({
1509
- action: z12.literal("HAS"),
1510
- key: z12.string(),
1511
- has: z12.boolean()
1472
+ z.object({
1473
+ action: z.literal("HAS"),
1474
+ key: z.string(),
1475
+ has: z.boolean()
1512
1476
  }),
1513
- z12.object({
1514
- action: z12.literal("SET"),
1515
- key: z12.string(),
1516
- value: z12.string().optional()
1477
+ z.object({
1478
+ action: z.literal("SET"),
1479
+ key: z.string(),
1480
+ value: z.string().optional()
1517
1481
  })
1518
1482
  ]);
1519
-
1520
- // src/schemas/notifications.ts
1521
- import { z as z13 } from "zod";
1522
1483
  var MISSING_CONNECTION_NOTIFICATION = "dev.trigger.notifications.missingConnection";
1523
1484
  var MISSING_CONNECTION_RESOLVED_NOTIFICATION = "dev.trigger.notifications.missingConnectionResolved";
1524
- var CommonMissingConnectionNotificationPayloadSchema = z13.object({
1525
- id: z13.string(),
1526
- client: z13.object({
1527
- id: z13.string(),
1528
- title: z13.string(),
1529
- scopes: z13.array(z13.string()),
1530
- createdAt: z13.coerce.date(),
1531
- updatedAt: z13.coerce.date()
1485
+ var CommonMissingConnectionNotificationPayloadSchema = z.object({
1486
+ id: z.string(),
1487
+ client: z.object({
1488
+ id: z.string(),
1489
+ title: z.string(),
1490
+ scopes: z.array(z.string()),
1491
+ createdAt: z.coerce.date(),
1492
+ updatedAt: z.coerce.date()
1532
1493
  }),
1533
- authorizationUrl: z13.string()
1494
+ authorizationUrl: z.string()
1534
1495
  });
1535
1496
  var MissingDeveloperConnectionNotificationPayloadSchema = CommonMissingConnectionNotificationPayloadSchema.extend({
1536
- type: z13.literal("DEVELOPER")
1497
+ type: z.literal("DEVELOPER")
1537
1498
  });
1538
1499
  var MissingExternalConnectionNotificationPayloadSchema = CommonMissingConnectionNotificationPayloadSchema.extend({
1539
- type: z13.literal("EXTERNAL"),
1540
- account: z13.object({
1541
- id: z13.string(),
1542
- metadata: z13.any()
1500
+ type: z.literal("EXTERNAL"),
1501
+ account: z.object({
1502
+ id: z.string(),
1503
+ metadata: z.any()
1543
1504
  })
1544
1505
  });
1545
- var MissingConnectionNotificationPayloadSchema = z13.discriminatedUnion("type", [
1506
+ var MissingConnectionNotificationPayloadSchema = z.discriminatedUnion("type", [
1546
1507
  MissingDeveloperConnectionNotificationPayloadSchema,
1547
1508
  MissingExternalConnectionNotificationPayloadSchema
1548
1509
  ]);
1549
- var CommonMissingConnectionNotificationResolvedPayloadSchema = z13.object({
1550
- id: z13.string(),
1551
- client: z13.object({
1552
- id: z13.string(),
1553
- title: z13.string(),
1554
- scopes: z13.array(z13.string()),
1555
- createdAt: z13.coerce.date(),
1556
- updatedAt: z13.coerce.date(),
1557
- integrationIdentifier: z13.string(),
1558
- integrationAuthMethod: z13.string()
1510
+ var CommonMissingConnectionNotificationResolvedPayloadSchema = z.object({
1511
+ id: z.string(),
1512
+ client: z.object({
1513
+ id: z.string(),
1514
+ title: z.string(),
1515
+ scopes: z.array(z.string()),
1516
+ createdAt: z.coerce.date(),
1517
+ updatedAt: z.coerce.date(),
1518
+ integrationIdentifier: z.string(),
1519
+ integrationAuthMethod: z.string()
1559
1520
  }),
1560
- expiresAt: z13.coerce.date()
1521
+ expiresAt: z.coerce.date()
1561
1522
  });
1562
1523
  var MissingDeveloperConnectionResolvedNotificationPayloadSchema = CommonMissingConnectionNotificationResolvedPayloadSchema.extend({
1563
- type: z13.literal("DEVELOPER")
1524
+ type: z.literal("DEVELOPER")
1564
1525
  });
1565
1526
  var MissingExternalConnectionResolvedNotificationPayloadSchema = CommonMissingConnectionNotificationResolvedPayloadSchema.extend({
1566
- type: z13.literal("EXTERNAL"),
1567
- account: z13.object({
1568
- id: z13.string(),
1569
- metadata: z13.any()
1527
+ type: z.literal("EXTERNAL"),
1528
+ account: z.object({
1529
+ id: z.string(),
1530
+ metadata: z.any()
1570
1531
  })
1571
1532
  });
1572
- var MissingConnectionResolvedNotificationPayloadSchema = z13.discriminatedUnion("type", [
1533
+ var MissingConnectionResolvedNotificationPayloadSchema = z.discriminatedUnion("type", [
1573
1534
  MissingDeveloperConnectionResolvedNotificationPayloadSchema,
1574
1535
  MissingExternalConnectionResolvedNotificationPayloadSchema
1575
1536
  ]);
1576
-
1577
- // src/schemas/fetch.ts
1578
- import { z as z14 } from "zod";
1579
- var FetchRetryHeadersStrategySchema = z14.object({
1537
+ var FetchRetryHeadersStrategySchema = z.object({
1580
1538
  /** The `headers` strategy retries the request using info from the response headers. */
1581
- strategy: z14.literal("headers"),
1539
+ strategy: z.literal("headers"),
1582
1540
  /** The header to use to determine the maximum number of times to retry the request. */
1583
- limitHeader: z14.string(),
1541
+ limitHeader: z.string(),
1584
1542
  /** The header to use to determine the number of remaining retries. */
1585
- remainingHeader: z14.string(),
1543
+ remainingHeader: z.string(),
1586
1544
  /** The header to use to determine the time when the number of remaining retries will be reset. */
1587
- resetHeader: z14.string(),
1545
+ resetHeader: z.string(),
1588
1546
  /** The event filter to use to determine if the request should be retried. */
1589
1547
  bodyFilter: EventFilterSchema.optional(),
1590
1548
  /** The format of the `resetHeader` value. */
1591
- resetFormat: z14.enum([
1549
+ resetFormat: z.enum([
1592
1550
  "unix_timestamp",
1593
1551
  "unix_timestamp_in_ms",
1594
1552
  "iso_8601",
@@ -1597,83 +1555,77 @@ var FetchRetryHeadersStrategySchema = z14.object({
1597
1555
  });
1598
1556
  var FetchRetryBackoffStrategySchema = RetryOptionsSchema.extend({
1599
1557
  /** The `backoff` strategy retries the request with an exponential backoff. */
1600
- strategy: z14.literal("backoff"),
1558
+ strategy: z.literal("backoff"),
1601
1559
  /** The event filter to use to determine if the request should be retried. */
1602
1560
  bodyFilter: EventFilterSchema.optional()
1603
1561
  });
1604
- var FetchRetryStrategySchema = z14.discriminatedUnion("strategy", [
1562
+ var FetchRetryStrategySchema = z.discriminatedUnion("strategy", [
1605
1563
  FetchRetryHeadersStrategySchema,
1606
1564
  FetchRetryBackoffStrategySchema
1607
1565
  ]);
1608
- var FetchRequestInitSchema = z14.object({
1566
+ var FetchRequestInitSchema = z.object({
1609
1567
  /** The HTTP method to use for the request. */
1610
- method: z14.string().optional(),
1568
+ method: z.string().optional(),
1611
1569
  /** 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. */
1612
- headers: z14.record(z14.union([
1613
- z14.string(),
1570
+ headers: z.record(z.union([
1571
+ z.string(),
1614
1572
  RedactStringSchema
1615
1573
  ])).optional(),
1616
1574
  /** The body of the request. */
1617
- body: z14.union([
1618
- z14.string(),
1619
- z14.instanceof(ArrayBuffer)
1575
+ body: z.union([
1576
+ z.string(),
1577
+ z.instanceof(ArrayBuffer)
1620
1578
  ]).optional()
1621
1579
  });
1622
- var FetchRetryOptionsSchema = z14.record(FetchRetryStrategySchema);
1623
- var FetchTimeoutOptionsSchema = z14.object({
1624
- durationInMs: z14.number(),
1580
+ var FetchRetryOptionsSchema = z.record(FetchRetryStrategySchema);
1581
+ var FetchTimeoutOptionsSchema = z.object({
1582
+ durationInMs: z.number(),
1625
1583
  retry: RetryOptionsSchema.optional()
1626
1584
  });
1627
- var FetchOperationSchema = z14.object({
1628
- url: z14.string(),
1585
+ var FetchOperationSchema = z.object({
1586
+ url: z.string(),
1629
1587
  requestInit: FetchRequestInitSchema.optional(),
1630
- retry: z14.record(FetchRetryStrategySchema).optional(),
1588
+ retry: z.record(FetchRetryStrategySchema).optional(),
1631
1589
  timeout: FetchTimeoutOptionsSchema.optional()
1632
1590
  });
1633
- var FetchPollOperationSchema = z14.object({
1634
- url: z14.string(),
1635
- interval: z14.number().int().positive().min(10).max(600).default(10),
1636
- timeout: z14.number().int().positive().min(30).max(3600).default(600),
1591
+ var FetchPollOperationSchema = z.object({
1592
+ url: z.string(),
1593
+ interval: z.number().int().positive().min(10).max(600).default(10),
1594
+ timeout: z.number().int().positive().min(30).max(3600).default(600),
1637
1595
  responseFilter: ResponseFilterSchema,
1638
1596
  requestInit: FetchRequestInitSchema.optional(),
1639
1597
  requestTimeout: FetchTimeoutOptionsSchema.optional()
1640
1598
  });
1641
-
1642
- // src/schemas/events.ts
1643
- import { z as z15 } from "zod";
1644
- var GetEventSchema = z15.object({
1599
+ var GetEventSchema = z.object({
1645
1600
  /** The event id */
1646
- id: z15.string(),
1601
+ id: z.string(),
1647
1602
  /** The event name */
1648
- name: z15.string(),
1603
+ name: z.string(),
1649
1604
  /** When the event was created */
1650
- createdAt: z15.coerce.date(),
1605
+ createdAt: z.coerce.date(),
1651
1606
  /** When the event was last updated */
1652
- updatedAt: z15.coerce.date(),
1607
+ updatedAt: z.coerce.date(),
1653
1608
  /** The runs that were triggered by the event */
1654
- runs: z15.array(z15.object({
1609
+ runs: z.array(z.object({
1655
1610
  /** The Run id */
1656
- id: z15.string(),
1611
+ id: z.string(),
1657
1612
  /** The Run status */
1658
1613
  status: RunStatusSchema,
1659
1614
  /** When the run started */
1660
- startedAt: z15.coerce.date().optional().nullable(),
1615
+ startedAt: z.coerce.date().optional().nullable(),
1661
1616
  /** When the run completed */
1662
- completedAt: z15.coerce.date().optional().nullable()
1617
+ completedAt: z.coerce.date().optional().nullable()
1663
1618
  }))
1664
1619
  });
1665
- var CancelRunsForEventSchema = z15.object({
1666
- cancelledRunIds: z15.array(z15.string()),
1667
- failedToCancelRunIds: z15.array(z15.string())
1620
+ var CancelRunsForEventSchema = z.object({
1621
+ cancelledRunIds: z.array(z.string()),
1622
+ failedToCancelRunIds: z.array(z.string())
1668
1623
  });
1669
-
1670
- // src/schemas/request.ts
1671
- import { z as z16 } from "zod";
1672
- var RequestWithRawBodySchema = z16.object({
1673
- url: z16.string(),
1674
- method: z16.string(),
1675
- headers: z16.record(z16.string()),
1676
- rawBody: z16.string()
1624
+ var RequestWithRawBodySchema = z.object({
1625
+ url: z.string(),
1626
+ method: z.string(),
1627
+ headers: z.record(z.string()),
1628
+ rawBody: z.string()
1677
1629
  });
1678
1630
 
1679
1631
  // src/utils.ts
@@ -1885,7 +1837,7 @@ __name(eventFilterMatches, "eventFilterMatches");
1885
1837
  function contentFiltersMatches(actualValue, contentFilters) {
1886
1838
  for (const contentFilter of contentFilters) {
1887
1839
  if (typeof contentFilter === "object") {
1888
- const [key, value] = Object.entries(contentFilter)[0];
1840
+ Object.entries(contentFilter)[0];
1889
1841
  if (!contentFilterMatches(actualValue, contentFilter)) {
1890
1842
  return false;
1891
1843
  }
@@ -2070,186 +2022,7 @@ function supportsFeature(featureName, version) {
2070
2022
  return version >= supportedVersion;
2071
2023
  }
2072
2024
  __name(supportsFeature, "supportsFeature");
2073
- export {
2074
- API_VERSIONS,
2075
- ApiEventLogSchema,
2076
- AutoYieldConfigSchema,
2077
- AutoYieldMetadataSchema,
2078
- CachedTaskSchema,
2079
- CancelRunsForEventSchema,
2080
- CommonMissingConnectionNotificationPayloadSchema,
2081
- CommonMissingConnectionNotificationResolvedPayloadSchema,
2082
- CompleteTaskBodyInputSchema,
2083
- CompleteTaskBodyV2InputSchema,
2084
- ConcurrencyLimitOptionsSchema,
2085
- ConnectionAuthSchema,
2086
- CreateExternalConnectionBodySchema,
2087
- CreateRunResponseBodySchema,
2088
- CronMetadataSchema,
2089
- CronOptionsSchema,
2090
- DELIVER_WEBHOOK_REQUEST,
2091
- DeliverEventResponseSchema,
2092
- DeserializedJsonSchema,
2093
- DisplayPropertiesSchema,
2094
- DisplayPropertySchema,
2095
- DynamicTriggerEndpointMetadataSchema,
2096
- DynamicTriggerMetadataSchema,
2097
- EndpointHeadersSchema,
2098
- EndpointIndexErrorSchema,
2099
- EphemeralEventDispatcherRequestBodySchema,
2100
- EphemeralEventDispatcherResponseBodySchema,
2101
- ErrorWithStackSchema,
2102
- EventExampleSchema,
2103
- EventFilterSchema,
2104
- EventRuleSchema,
2105
- EventSpecificationSchema,
2106
- ExecuteJobHeadersSchema,
2107
- ExecuteJobRunMetadataSchema,
2108
- FailTaskBodyInputSchema,
2109
- FetchOperationSchema,
2110
- FetchPollOperationSchema,
2111
- FetchRequestInitSchema,
2112
- FetchRetryBackoffStrategySchema,
2113
- FetchRetryHeadersStrategySchema,
2114
- FetchRetryOptionsSchema,
2115
- FetchRetryStrategySchema,
2116
- FetchTimeoutOptionsSchema,
2117
- GetEndpointIndexResponseSchema,
2118
- GetEventSchema,
2119
- GetRunSchema,
2120
- GetRunStatusesSchema,
2121
- GetRunsSchema,
2122
- HTTPMethodUnionSchema,
2123
- HandleTriggerSourceSchema,
2124
- HttpEndpointRequestHeadersSchema,
2125
- HttpSourceRequestHeadersSchema,
2126
- HttpSourceResponseSchema,
2127
- IndexEndpointResponseSchema,
2128
- InitializeCronScheduleBodySchema,
2129
- InitializeTriggerBodySchema,
2130
- IntegrationConfigSchema,
2131
- IntegrationMetadataSchema,
2132
- IntervalMetadataSchema,
2133
- IntervalOptionsSchema,
2134
- InvokeJobRequestBodySchema,
2135
- InvokeJobResponseSchema,
2136
- InvokeOptionsSchema,
2137
- InvokeTriggerMetadataSchema,
2138
- JobMetadataSchema,
2139
- JobRunStatusRecordSchema,
2140
- KeyValueStoreResponseBodySchema,
2141
- LogMessageSchema,
2142
- Logger,
2143
- MISSING_CONNECTION_NOTIFICATION,
2144
- MISSING_CONNECTION_RESOLVED_NOTIFICATION,
2145
- MissingConnectionNotificationPayloadSchema,
2146
- MissingConnectionResolvedNotificationPayloadSchema,
2147
- MissingDeveloperConnectionNotificationPayloadSchema,
2148
- MissingDeveloperConnectionResolvedNotificationPayloadSchema,
2149
- MissingExternalConnectionNotificationPayloadSchema,
2150
- MissingExternalConnectionResolvedNotificationPayloadSchema,
2151
- NormalizedRequestSchema,
2152
- NormalizedResponseSchema,
2153
- PLATFORM_FEATURES,
2154
- PongErrorResponseSchema,
2155
- PongResponseSchema,
2156
- PongSuccessResponseSchema,
2157
- PreprocessRunBodySchema,
2158
- PreprocessRunResponseSchema,
2159
- QueueOptionsSchema,
2160
- REGISTER_SOURCE_EVENT_V1,
2161
- REGISTER_SOURCE_EVENT_V2,
2162
- REGISTER_WEBHOOK,
2163
- RawEventSchema,
2164
- RedactSchema,
2165
- RedactStringSchema,
2166
- RegisterDynamicSchedulePayloadSchema,
2167
- RegisterHTTPTriggerSourceBodySchema,
2168
- RegisterIntervalScheduleBodySchema,
2169
- RegisterSMTPTriggerSourceBodySchema,
2170
- RegisterSQSTriggerSourceBodySchema,
2171
- RegisterScheduleBodySchema,
2172
- RegisterScheduleResponseBodySchema,
2173
- RegisterSourceChannelBodySchema,
2174
- RegisterSourceEventSchemaV1,
2175
- RegisterSourceEventSchemaV2,
2176
- RegisterTriggerBodySchemaV1,
2177
- RegisterTriggerBodySchemaV2,
2178
- RegisterTriggerSourceSchema,
2179
- RegisterWebhookPayloadSchema,
2180
- RegisterWebhookSourceSchema,
2181
- RequestFilterSchema,
2182
- RequestWithRawBodySchema,
2183
- ResponseFilterSchema,
2184
- RetryOptionsSchema,
2185
- RunJobAutoYieldExecutionErrorSchema,
2186
- RunJobAutoYieldWithCompletedTaskExecutionErrorSchema,
2187
- RunJobBodySchema,
2188
- RunJobCanceledWithTaskSchema,
2189
- RunJobErrorResponseSchema,
2190
- RunJobErrorSchema,
2191
- RunJobInvalidPayloadErrorSchema,
2192
- RunJobResponseSchema,
2193
- RunJobResumeWithParallelTaskSchema,
2194
- RunJobResumeWithTaskSchema,
2195
- RunJobRetryWithTaskSchema,
2196
- RunJobSuccessSchema,
2197
- RunJobUnresolvedAuthErrorSchema,
2198
- RunJobYieldExecutionErrorSchema,
2199
- RunSourceContextSchema,
2200
- RunStatusSchema,
2201
- RunTaskBodyInputSchema,
2202
- RunTaskBodyOutputSchema,
2203
- RunTaskOptionsSchema,
2204
- RunTaskResponseWithCachedTasksBodySchema,
2205
- RunTaskSchema,
2206
- RuntimeEnvironmentTypeSchema,
2207
- SCHEDULED_EVENT,
2208
- ScheduleMetadataSchema,
2209
- ScheduledPayloadSchema,
2210
- ScheduledTriggerMetadataSchema,
2211
- SchemaErrorSchema,
2212
- SendBulkEventsBodySchema,
2213
- SendEventBodySchema,
2214
- SendEventOptionsSchema,
2215
- SerializableJsonSchema,
2216
- ServerTaskSchema,
2217
- SourceMetadataV2Schema,
2218
- StaticTriggerMetadataSchema,
2219
- StatusHistorySchema,
2220
- StatusUpdateSchema,
2221
- StatusUpdateStateSchema,
2222
- StyleSchema,
2223
- TaskSchema,
2224
- TaskStatusSchema,
2225
- TriggerHelpSchema,
2226
- TriggerMetadataSchema,
2227
- TriggerSourceSchema,
2228
- UpdateTriggerSourceBodyV1Schema,
2229
- UpdateTriggerSourceBodyV2Schema,
2230
- UpdateWebhookBodySchema,
2231
- ValidateErrorResponseSchema,
2232
- ValidateResponseSchema,
2233
- ValidateSuccessResponseSchema,
2234
- WebhookContextMetadataSchema,
2235
- WebhookDeliveryResponseSchema,
2236
- WebhookMetadataSchema,
2237
- WebhookSourceRequestHeadersSchema,
2238
- addMissingVersionField,
2239
- assertExhaustive,
2240
- calculateResetAt,
2241
- calculateRetryAt,
2242
- currentDate,
2243
- currentTimestampMilliseconds,
2244
- currentTimestampSeconds,
2245
- deepMergeFilters,
2246
- eventFilterMatches,
2247
- parseEndpointIndexStats,
2248
- replacements,
2249
- requestFilterMatches,
2250
- responseFilterMatches,
2251
- stringPatternMatchers,
2252
- supportsFeature,
2253
- urlWithSearchParams
2254
- };
2025
+
2026
+ export { API_VERSIONS, ApiEventLogSchema, AutoYieldConfigSchema, AutoYieldMetadataSchema, CachedTaskSchema, CancelRunsForEventSchema, CommonMissingConnectionNotificationPayloadSchema, CommonMissingConnectionNotificationResolvedPayloadSchema, CompleteTaskBodyInputSchema, CompleteTaskBodyV2InputSchema, ConcurrencyLimitOptionsSchema, ConnectionAuthSchema, CreateExternalConnectionBodySchema, CreateRunResponseBodySchema, CronMetadataSchema, CronOptionsSchema, DELIVER_WEBHOOK_REQUEST, DeliverEventResponseSchema, DeserializedJsonSchema, DisplayPropertiesSchema, DisplayPropertySchema, DynamicTriggerEndpointMetadataSchema, DynamicTriggerMetadataSchema, EndpointHeadersSchema, EndpointIndexErrorSchema, EphemeralEventDispatcherRequestBodySchema, EphemeralEventDispatcherResponseBodySchema, ErrorWithStackSchema, EventExampleSchema, EventFilterSchema, EventRuleSchema, EventSpecificationSchema, ExecuteJobHeadersSchema, ExecuteJobRunMetadataSchema, FailTaskBodyInputSchema, FetchOperationSchema, FetchPollOperationSchema, FetchRequestInitSchema, FetchRetryBackoffStrategySchema, FetchRetryHeadersStrategySchema, FetchRetryOptionsSchema, FetchRetryStrategySchema, FetchTimeoutOptionsSchema, GetEndpointIndexResponseSchema, GetEventSchema, GetRunSchema, GetRunStatusesSchema, GetRunsSchema, HTTPMethodUnionSchema, HandleTriggerSourceSchema, HttpEndpointRequestHeadersSchema, HttpSourceRequestHeadersSchema, HttpSourceResponseSchema, IndexEndpointResponseSchema, InitializeCronScheduleBodySchema, InitializeTriggerBodySchema, IntegrationConfigSchema, IntegrationMetadataSchema, IntervalMetadataSchema, IntervalOptionsSchema, InvokeJobRequestBodySchema, InvokeJobResponseSchema, InvokeOptionsSchema, InvokeTriggerMetadataSchema, JobMetadataSchema, JobRunStatusRecordSchema, KeyValueStoreResponseBodySchema, LogMessageSchema, Logger, MISSING_CONNECTION_NOTIFICATION, MISSING_CONNECTION_RESOLVED_NOTIFICATION, MissingConnectionNotificationPayloadSchema, MissingConnectionResolvedNotificationPayloadSchema, MissingDeveloperConnectionNotificationPayloadSchema, MissingDeveloperConnectionResolvedNotificationPayloadSchema, MissingExternalConnectionNotificationPayloadSchema, MissingExternalConnectionResolvedNotificationPayloadSchema, NormalizedRequestSchema, NormalizedResponseSchema, PLATFORM_FEATURES, PongErrorResponseSchema, PongResponseSchema, PongSuccessResponseSchema, PreprocessRunBodySchema, PreprocessRunResponseSchema, QueueOptionsSchema, REGISTER_SOURCE_EVENT_V1, REGISTER_SOURCE_EVENT_V2, REGISTER_WEBHOOK, RawEventSchema, RedactSchema, RedactStringSchema, RegisterDynamicSchedulePayloadSchema, RegisterHTTPTriggerSourceBodySchema, RegisterIntervalScheduleBodySchema, RegisterSMTPTriggerSourceBodySchema, RegisterSQSTriggerSourceBodySchema, RegisterScheduleBodySchema, RegisterScheduleResponseBodySchema, RegisterSourceChannelBodySchema, RegisterSourceEventSchemaV1, RegisterSourceEventSchemaV2, RegisterTriggerBodySchemaV1, RegisterTriggerBodySchemaV2, RegisterTriggerSourceSchema, RegisterWebhookPayloadSchema, RegisterWebhookSourceSchema, RequestFilterSchema, RequestWithRawBodySchema, ResponseFilterSchema, RetryOptionsSchema, RunJobAutoYieldExecutionErrorSchema, RunJobAutoYieldWithCompletedTaskExecutionErrorSchema, RunJobBodySchema, RunJobCanceledWithTaskSchema, RunJobErrorResponseSchema, RunJobErrorSchema, RunJobInvalidPayloadErrorSchema, RunJobResponseSchema, RunJobResumeWithParallelTaskSchema, RunJobResumeWithTaskSchema, RunJobRetryWithTaskSchema, RunJobSuccessSchema, RunJobUnresolvedAuthErrorSchema, RunJobYieldExecutionErrorSchema, RunSourceContextSchema, RunStatusSchema, RunTaskBodyInputSchema, RunTaskBodyOutputSchema, RunTaskOptionsSchema, RunTaskResponseWithCachedTasksBodySchema, RunTaskSchema, RuntimeEnvironmentTypeSchema, SCHEDULED_EVENT, ScheduleMetadataSchema, ScheduledPayloadSchema, ScheduledTriggerMetadataSchema, SchemaErrorSchema, SendBulkEventsBodySchema, SendEventBodySchema, SendEventOptionsSchema, SerializableJsonSchema, ServerTaskSchema, SourceMetadataV2Schema, StaticTriggerMetadataSchema, StatusHistorySchema, StatusUpdateSchema, StatusUpdateStateSchema, StyleSchema, TaskSchema, TaskStatusSchema, TriggerHelpSchema, TriggerMetadataSchema, TriggerSourceSchema, UpdateTriggerSourceBodyV1Schema, UpdateTriggerSourceBodyV2Schema, UpdateWebhookBodySchema, ValidateErrorResponseSchema, ValidateResponseSchema, ValidateSuccessResponseSchema, WebhookContextMetadataSchema, WebhookDeliveryResponseSchema, WebhookMetadataSchema, WebhookSourceRequestHeadersSchema, addMissingVersionField, assertExhaustive, calculateResetAt, calculateRetryAt, currentDate, currentTimestampMilliseconds, currentTimestampSeconds, deepMergeFilters, eventFilterMatches, parseEndpointIndexStats, replacements, requestFilterMatches, responseFilterMatches, stringPatternMatchers, supportsFeature, urlWithSearchParams };
2027
+ //# sourceMappingURL=out.js.map
2255
2028
  //# sourceMappingURL=index.mjs.map