@trigger.dev/sdk 2.0.0-next.8 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as zod from 'zod';
2
- import { z } from 'zod';
2
+ import { z, ZodObject } from 'zod';
3
3
 
4
4
  /**
5
5
  * Represents different log levels.
@@ -15,15 +15,16 @@ declare class Logger {
15
15
  constructor(name: string, level?: LogLevel, filteredKeys?: string[], jsonReplacer?: (key: string, value: unknown) => unknown);
16
16
  filter(...keys: string[]): Logger;
17
17
  static satisfiesLogLevel(logLevel: LogLevel, setLevel: LogLevel): boolean;
18
- log(...args: any[]): void;
19
- error(...args: any[]): void;
20
- warn(...args: any[]): void;
21
- info(...args: any[]): void;
18
+ log(message: string, ...args: Array<Record<string, unknown> | undefined>): void;
19
+ error(message: string, ...args: Array<Record<string, unknown> | undefined>): void;
20
+ warn(message: string, ...args: Array<Record<string, unknown> | undefined>): void;
21
+ info(message: string, ...args: Array<Record<string, unknown> | undefined>): void;
22
22
  debug(message: string, ...args: Array<Record<string, unknown> | undefined>): void;
23
23
  }
24
24
 
25
25
  declare const EventMatcherSchema: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">, z.ZodArray<z.ZodBoolean, "many">]>;
26
26
  type EventMatcher = z.infer<typeof EventMatcherSchema>;
27
+ /** A filter for matching against data */
27
28
  type EventFilter = {
28
29
  [key: string]: EventMatcher | EventFilter;
29
30
  };
@@ -39,7 +40,7 @@ type SerializableJson = Serializable | {
39
40
  [key: string]: SerializableJson;
40
41
  } | SerializableJson[];
41
42
 
42
- declare const ServerTaskSchema: z.ZodObject<z.extendShape<{
43
+ declare const ServerTaskSchema: z.ZodObject<{
43
44
  id: z.ZodString;
44
45
  name: z.ZodString;
45
46
  icon: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -47,22 +48,35 @@ declare const ServerTaskSchema: z.ZodObject<z.extendShape<{
47
48
  startedAt: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
48
49
  completedAt: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
49
50
  delayUntil: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
50
- status: z.ZodEnum<["PENDING", "WAITING", "RUNNING", "COMPLETED", "ERRORED"]>;
51
+ status: z.ZodEnum<["PENDING", "WAITING", "RUNNING", "COMPLETED", "ERRORED", "CANCELED"]>;
51
52
  description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
53
+ params: z.ZodNullable<z.ZodOptional<z.ZodType<DeserializedJson, z.ZodTypeDef, DeserializedJson>>>;
52
54
  properties: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
53
55
  label: z.ZodString;
54
56
  text: z.ZodString;
55
57
  url: z.ZodOptional<z.ZodString>;
56
58
  }, "strip", z.ZodTypeAny, {
57
- url?: string | undefined;
58
59
  label: string;
59
60
  text: string;
61
+ url?: string | undefined;
60
62
  }, {
63
+ label: string;
64
+ text: string;
65
+ url?: string | undefined;
66
+ }>, "many">>>;
67
+ outputProperties: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
68
+ label: z.ZodString;
69
+ text: z.ZodString;
70
+ url: z.ZodOptional<z.ZodString>;
71
+ }, "strip", z.ZodTypeAny, {
72
+ label: string;
73
+ text: string;
61
74
  url?: string | undefined;
75
+ }, {
62
76
  label: string;
63
77
  text: string;
78
+ url?: string | undefined;
64
79
  }>, "many">>>;
65
- params: z.ZodNullable<z.ZodOptional<z.ZodType<DeserializedJson, z.ZodTypeDef, DeserializedJson>>>;
66
80
  output: z.ZodNullable<z.ZodOptional<z.ZodType<DeserializedJson, z.ZodTypeDef, DeserializedJson>>>;
67
81
  error: z.ZodNullable<z.ZodOptional<z.ZodString>>;
68
82
  parentId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
@@ -70,17 +84,22 @@ declare const ServerTaskSchema: z.ZodObject<z.extendShape<{
70
84
  style: z.ZodEnum<["normal", "minimal"]>;
71
85
  variant: z.ZodOptional<z.ZodString>;
72
86
  }, "strip", z.ZodTypeAny, {
73
- variant?: string | undefined;
74
87
  style: "normal" | "minimal";
75
- }, {
76
88
  variant?: string | undefined;
89
+ }, {
77
90
  style: "normal" | "minimal";
91
+ variant?: string | undefined;
78
92
  }>>>;
79
93
  operation: z.ZodNullable<z.ZodOptional<z.ZodString>>;
80
- }, {
81
94
  idempotencyKey: z.ZodString;
82
95
  attempts: z.ZodNumber;
83
- }>, "strip", z.ZodTypeAny, {
96
+ }, "strip", z.ZodTypeAny, {
97
+ id: string;
98
+ name: string;
99
+ noop: boolean;
100
+ status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
101
+ idempotencyKey: string;
102
+ attempts: number;
84
103
  icon?: string | null | undefined;
85
104
  startedAt?: Date | null | undefined;
86
105
  completedAt?: Date | null | undefined;
@@ -88,25 +107,30 @@ declare const ServerTaskSchema: z.ZodObject<z.extendShape<{
88
107
  description?: string | null | undefined;
89
108
  params?: DeserializedJson | undefined;
90
109
  properties?: {
110
+ label: string;
111
+ text: string;
91
112
  url?: string | undefined;
113
+ }[] | null | undefined;
114
+ outputProperties?: {
92
115
  label: string;
93
116
  text: string;
117
+ url?: string | undefined;
94
118
  }[] | null | undefined;
95
119
  output?: DeserializedJson | undefined;
96
120
  error?: string | null | undefined;
97
121
  parentId?: string | null | undefined;
98
122
  style?: {
99
- variant?: string | undefined;
100
123
  style: "normal" | "minimal";
124
+ variant?: string | undefined;
101
125
  } | null | undefined;
102
126
  operation?: string | null | undefined;
127
+ }, {
103
128
  id: string;
104
129
  name: string;
105
130
  noop: boolean;
106
- status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED";
131
+ status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
107
132
  idempotencyKey: string;
108
133
  attempts: number;
109
- }, {
110
134
  icon?: string | null | undefined;
111
135
  startedAt?: Date | null | undefined;
112
136
  completedAt?: Date | null | undefined;
@@ -114,64 +138,68 @@ declare const ServerTaskSchema: z.ZodObject<z.extendShape<{
114
138
  description?: string | null | undefined;
115
139
  params?: DeserializedJson | undefined;
116
140
  properties?: {
141
+ label: string;
142
+ text: string;
117
143
  url?: string | undefined;
144
+ }[] | null | undefined;
145
+ outputProperties?: {
118
146
  label: string;
119
147
  text: string;
148
+ url?: string | undefined;
120
149
  }[] | null | undefined;
121
150
  output?: DeserializedJson | undefined;
122
151
  error?: string | null | undefined;
123
152
  parentId?: string | null | undefined;
124
153
  style?: {
125
- variant?: string | undefined;
126
154
  style: "normal" | "minimal";
155
+ variant?: string | undefined;
127
156
  } | null | undefined;
128
157
  operation?: string | null | undefined;
129
- id: string;
130
- name: string;
131
- noop: boolean;
132
- status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED";
133
- idempotencyKey: string;
134
- attempts: number;
135
158
  }>;
136
159
  type ServerTask = z.infer<typeof ServerTaskSchema>;
137
160
  declare const CachedTaskSchema: z.ZodObject<{
138
161
  id: z.ZodString;
139
162
  idempotencyKey: z.ZodString;
140
- status: z.ZodEnum<["PENDING", "WAITING", "RUNNING", "COMPLETED", "ERRORED"]>;
163
+ status: z.ZodEnum<["PENDING", "WAITING", "RUNNING", "COMPLETED", "ERRORED", "CANCELED"]>;
141
164
  noop: z.ZodDefault<z.ZodBoolean>;
142
165
  output: z.ZodNullable<z.ZodOptional<z.ZodType<DeserializedJson, z.ZodTypeDef, DeserializedJson>>>;
143
166
  parentId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
144
167
  }, "strip", z.ZodTypeAny, {
145
- output?: DeserializedJson | undefined;
146
- parentId?: string | null | undefined;
147
168
  id: string;
148
169
  noop: boolean;
149
- status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED";
170
+ status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
150
171
  idempotencyKey: string;
151
- }, {
152
- noop?: boolean | undefined;
153
172
  output?: DeserializedJson | undefined;
154
173
  parentId?: string | null | undefined;
174
+ }, {
155
175
  id: string;
156
- status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED";
176
+ status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
157
177
  idempotencyKey: string;
178
+ noop?: boolean | undefined;
179
+ output?: DeserializedJson | undefined;
180
+ parentId?: string | null | undefined;
158
181
  }>;
159
182
 
183
+ type Prettify<T> = {
184
+ [K in keyof T]: T[K];
185
+ } & {};
186
+
160
187
  declare const UpdateTriggerSourceBodySchema: z.ZodObject<{
161
188
  registeredEvents: z.ZodArray<z.ZodString, "many">;
162
189
  secret: z.ZodOptional<z.ZodString>;
163
190
  data: z.ZodOptional<z.ZodType<SerializableJson, z.ZodTypeDef, SerializableJson>>;
164
191
  }, "strip", z.ZodTypeAny, {
165
- data?: SerializableJson;
166
- secret?: string | undefined;
167
192
  registeredEvents: string[];
168
- }, {
169
- data?: SerializableJson;
170
193
  secret?: string | undefined;
194
+ data?: SerializableJson;
195
+ }, {
171
196
  registeredEvents: string[];
197
+ secret?: string | undefined;
198
+ data?: SerializableJson;
172
199
  }>;
173
200
  type UpdateTriggerSourceBody = z.infer<typeof UpdateTriggerSourceBodySchema>;
174
201
  declare const RegisterSourceEventSchema: z.ZodObject<{
202
+ /** The id of the source */
175
203
  id: z.ZodString;
176
204
  source: z.ZodObject<{
177
205
  key: z.ZodString;
@@ -203,9 +231,6 @@ declare const RegisterSourceEventSchema: z.ZodObject<{
203
231
  }>]>;
204
232
  clientId: z.ZodOptional<z.ZodString>;
205
233
  }, "strip", z.ZodTypeAny, {
206
- params?: any;
207
- data?: DeserializedJson | undefined;
208
- clientId?: string | undefined;
209
234
  key: string;
210
235
  secret: string;
211
236
  active: boolean;
@@ -217,10 +242,10 @@ declare const RegisterSourceEventSchema: z.ZodObject<{
217
242
  } | {
218
243
  type: "SQS";
219
244
  };
220
- }, {
221
245
  params?: any;
222
246
  data?: DeserializedJson | undefined;
223
247
  clientId?: string | undefined;
248
+ }, {
224
249
  key: string;
225
250
  secret: string;
226
251
  active: boolean;
@@ -232,18 +257,17 @@ declare const RegisterSourceEventSchema: z.ZodObject<{
232
257
  } | {
233
258
  type: "SQS";
234
259
  };
260
+ params?: any;
261
+ data?: DeserializedJson | undefined;
262
+ clientId?: string | undefined;
235
263
  }>;
236
264
  events: z.ZodArray<z.ZodString, "many">;
237
265
  missingEvents: z.ZodArray<z.ZodString, "many">;
238
266
  orphanedEvents: z.ZodArray<z.ZodString, "many">;
239
267
  dynamicTriggerId: z.ZodOptional<z.ZodString>;
240
268
  }, "strip", z.ZodTypeAny, {
241
- dynamicTriggerId?: string | undefined;
242
269
  id: string;
243
270
  source: {
244
- params?: any;
245
- data?: DeserializedJson | undefined;
246
- clientId?: string | undefined;
247
271
  key: string;
248
272
  secret: string;
249
273
  active: boolean;
@@ -255,17 +279,17 @@ declare const RegisterSourceEventSchema: z.ZodObject<{
255
279
  } | {
256
280
  type: "SQS";
257
281
  };
282
+ params?: any;
283
+ data?: DeserializedJson | undefined;
284
+ clientId?: string | undefined;
258
285
  };
259
286
  events: string[];
260
287
  missingEvents: string[];
261
288
  orphanedEvents: string[];
262
- }, {
263
289
  dynamicTriggerId?: string | undefined;
290
+ }, {
264
291
  id: string;
265
292
  source: {
266
- params?: any;
267
- data?: DeserializedJson | undefined;
268
- clientId?: string | undefined;
269
293
  key: string;
270
294
  secret: string;
271
295
  active: boolean;
@@ -277,10 +301,14 @@ declare const RegisterSourceEventSchema: z.ZodObject<{
277
301
  } | {
278
302
  type: "SQS";
279
303
  };
304
+ params?: any;
305
+ data?: DeserializedJson | undefined;
306
+ clientId?: string | undefined;
280
307
  };
281
308
  events: string[];
282
309
  missingEvents: string[];
283
310
  orphanedEvents: string[];
311
+ dynamicTriggerId?: string | undefined;
284
312
  }>;
285
313
  type RegisterSourceEvent = z.infer<typeof RegisterSourceEventSchema>;
286
314
  declare const TriggerSourceSchema: z.ZodObject<{
@@ -299,15 +327,15 @@ declare const HandleTriggerSourceSchema: z.ZodObject<{
299
327
  data: z.ZodAny;
300
328
  params: z.ZodAny;
301
329
  }, "strip", z.ZodTypeAny, {
302
- params?: any;
303
- data?: any;
304
330
  key: string;
305
331
  secret: string;
306
- }, {
307
- params?: any;
308
332
  data?: any;
333
+ params?: any;
334
+ }, {
309
335
  key: string;
310
336
  secret: string;
337
+ data?: any;
338
+ params?: any;
311
339
  }>;
312
340
  type HandleTriggerSource = z.infer<typeof HandleTriggerSourceSchema>;
313
341
  type TriggerSource = z.infer<typeof TriggerSourceSchema>;
@@ -315,11 +343,11 @@ declare const QueueOptionsSchema: z.ZodObject<{
315
343
  name: z.ZodString;
316
344
  maxConcurrent: z.ZodOptional<z.ZodNumber>;
317
345
  }, "strip", z.ZodTypeAny, {
318
- maxConcurrent?: number | undefined;
319
346
  name: string;
320
- }, {
321
347
  maxConcurrent?: number | undefined;
348
+ }, {
322
349
  name: string;
350
+ maxConcurrent?: number | undefined;
323
351
  }>;
324
352
  type QueueOptions = z.infer<typeof QueueOptionsSchema>;
325
353
  declare const JobMetadataSchema: z.ZodObject<{
@@ -327,7 +355,7 @@ declare const JobMetadataSchema: z.ZodObject<{
327
355
  name: z.ZodString;
328
356
  version: z.ZodString;
329
357
  event: z.ZodObject<{
330
- name: z.ZodString;
358
+ name: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
331
359
  title: z.ZodString;
332
360
  source: z.ZodString;
333
361
  icon: z.ZodString;
@@ -337,13 +365,13 @@ declare const JobMetadataSchema: z.ZodObject<{
337
365
  text: z.ZodString;
338
366
  url: z.ZodOptional<z.ZodString>;
339
367
  }, "strip", z.ZodTypeAny, {
340
- url?: string | undefined;
341
368
  label: string;
342
369
  text: string;
343
- }, {
344
370
  url?: string | undefined;
371
+ }, {
345
372
  label: string;
346
373
  text: string;
374
+ url?: string | undefined;
347
375
  }>, "many">>;
348
376
  schema: z.ZodOptional<z.ZodAny>;
349
377
  examples: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -352,52 +380,52 @@ declare const JobMetadataSchema: z.ZodObject<{
352
380
  name: z.ZodString;
353
381
  payload: z.ZodAny;
354
382
  }, "strip", z.ZodTypeAny, {
355
- icon?: string | undefined;
356
- payload?: any;
357
383
  id: string;
358
384
  name: string;
359
- }, {
360
385
  icon?: string | undefined;
361
386
  payload?: any;
387
+ }, {
362
388
  id: string;
363
389
  name: string;
390
+ icon?: string | undefined;
391
+ payload?: any;
364
392
  }>, "many">>;
365
393
  }, "strip", z.ZodTypeAny, {
394
+ name: (string | string[]) & (string | string[] | undefined);
395
+ icon: string;
396
+ source: string;
397
+ title: string;
366
398
  filter?: EventFilter | undefined;
367
399
  properties?: {
368
- url?: string | undefined;
369
400
  label: string;
370
401
  text: string;
402
+ url?: string | undefined;
371
403
  }[] | undefined;
372
404
  schema?: any;
373
405
  examples?: {
374
- icon?: string | undefined;
375
- payload?: any;
376
406
  id: string;
377
407
  name: string;
408
+ icon?: string | undefined;
409
+ payload?: any;
378
410
  }[] | undefined;
379
- name: string;
411
+ }, {
412
+ name: (string | string[]) & (string | string[] | undefined);
380
413
  icon: string;
381
414
  source: string;
382
415
  title: string;
383
- }, {
384
416
  filter?: EventFilter | undefined;
385
417
  properties?: {
386
- url?: string | undefined;
387
418
  label: string;
388
419
  text: string;
420
+ url?: string | undefined;
389
421
  }[] | undefined;
390
422
  schema?: any;
391
423
  examples?: {
392
- icon?: string | undefined;
393
- payload?: any;
394
424
  id: string;
395
425
  name: string;
426
+ icon?: string | undefined;
427
+ payload?: any;
396
428
  }[] | undefined;
397
- name: string;
398
- icon: string;
399
- source: string;
400
- title: string;
401
429
  }>;
402
430
  trigger: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
403
431
  type: z.ZodLiteral<"dynamic">;
@@ -410,64 +438,64 @@ declare const JobMetadataSchema: z.ZodObject<{
410
438
  type: "dynamic";
411
439
  }>, z.ZodObject<{
412
440
  type: z.ZodLiteral<"static">;
413
- title: z.ZodString;
441
+ title: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
414
442
  properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
415
443
  label: z.ZodString;
416
444
  text: z.ZodString;
417
445
  url: z.ZodOptional<z.ZodString>;
418
446
  }, "strip", z.ZodTypeAny, {
419
- url?: string | undefined;
420
447
  label: string;
421
448
  text: string;
422
- }, {
423
449
  url?: string | undefined;
450
+ }, {
424
451
  label: string;
425
452
  text: string;
453
+ url?: string | undefined;
426
454
  }>, "many">>;
427
455
  rule: z.ZodObject<{
428
- event: z.ZodString;
456
+ event: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
429
457
  source: z.ZodString;
430
458
  payload: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
431
459
  context: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
432
460
  }, "strip", z.ZodTypeAny, {
461
+ event: (string | string[]) & (string | string[] | undefined);
462
+ source: string;
433
463
  payload?: EventFilter | undefined;
434
464
  context?: EventFilter | undefined;
435
- event: string;
436
- source: string;
437
465
  }, {
466
+ event: (string | string[]) & (string | string[] | undefined);
467
+ source: string;
438
468
  payload?: EventFilter | undefined;
439
469
  context?: EventFilter | undefined;
440
- event: string;
441
- source: string;
442
470
  }>;
443
471
  }, "strip", z.ZodTypeAny, {
444
- properties?: {
445
- url?: string | undefined;
446
- label: string;
447
- text: string;
448
- }[] | undefined;
449
472
  type: "static";
450
- title: string;
473
+ title: (string | string[]) & (string | string[] | undefined);
451
474
  rule: {
475
+ event: (string | string[]) & (string | string[] | undefined);
476
+ source: string;
452
477
  payload?: EventFilter | undefined;
453
478
  context?: EventFilter | undefined;
454
- event: string;
455
- source: string;
456
479
  };
457
- }, {
458
480
  properties?: {
459
- url?: string | undefined;
460
481
  label: string;
461
482
  text: string;
483
+ url?: string | undefined;
462
484
  }[] | undefined;
485
+ }, {
463
486
  type: "static";
464
- title: string;
487
+ title: (string | string[]) & (string | string[] | undefined);
465
488
  rule: {
489
+ event: (string | string[]) & (string | string[] | undefined);
490
+ source: string;
466
491
  payload?: EventFilter | undefined;
467
492
  context?: EventFilter | undefined;
468
- event: string;
469
- source: string;
470
493
  };
494
+ properties?: {
495
+ label: string;
496
+ text: string;
497
+ url?: string | undefined;
498
+ }[] | undefined;
471
499
  }>, z.ZodObject<{
472
500
  type: z.ZodLiteral<"scheduled">;
473
501
  schedule: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -481,17 +509,17 @@ declare const JobMetadataSchema: z.ZodObject<{
481
509
  }>;
482
510
  metadata: z.ZodAny;
483
511
  }, "strip", z.ZodTypeAny, {
484
- metadata?: any;
485
512
  options: {
486
513
  seconds: number;
487
514
  };
488
515
  type: "interval";
489
- }, {
490
516
  metadata?: any;
517
+ }, {
491
518
  options: {
492
519
  seconds: number;
493
520
  };
494
521
  type: "interval";
522
+ metadata?: any;
495
523
  }>, z.ZodObject<{
496
524
  type: z.ZodLiteral<"cron">;
497
525
  options: z.ZodObject<{
@@ -503,47 +531,47 @@ declare const JobMetadataSchema: z.ZodObject<{
503
531
  }>;
504
532
  metadata: z.ZodAny;
505
533
  }, "strip", z.ZodTypeAny, {
506
- metadata?: any;
507
534
  options: {
508
535
  cron: string;
509
536
  };
510
537
  type: "cron";
511
- }, {
512
538
  metadata?: any;
539
+ }, {
513
540
  options: {
514
541
  cron: string;
515
542
  };
516
543
  type: "cron";
544
+ metadata?: any;
517
545
  }>]>;
518
546
  }, "strip", z.ZodTypeAny, {
519
547
  type: "scheduled";
520
548
  schedule: {
521
- metadata?: any;
522
549
  options: {
523
550
  cron: string;
524
551
  };
525
552
  type: "cron";
526
- } | {
527
553
  metadata?: any;
554
+ } | {
528
555
  options: {
529
556
  seconds: number;
530
557
  };
531
558
  type: "interval";
559
+ metadata?: any;
532
560
  };
533
561
  }, {
534
562
  type: "scheduled";
535
563
  schedule: {
536
- metadata?: any;
537
564
  options: {
538
565
  cron: string;
539
566
  };
540
567
  type: "cron";
541
- } | {
542
568
  metadata?: any;
569
+ } | {
543
570
  options: {
544
571
  seconds: number;
545
572
  };
546
573
  type: "interval";
574
+ metadata?: any;
547
575
  };
548
576
  }>]>;
549
577
  integrations: z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -553,29 +581,29 @@ declare const JobMetadataSchema: z.ZodObject<{
553
581
  name: z.ZodString;
554
582
  instructions: z.ZodOptional<z.ZodString>;
555
583
  }, "strip", z.ZodTypeAny, {
556
- instructions?: string | undefined;
557
584
  id: string;
558
585
  name: string;
559
- }, {
560
586
  instructions?: string | undefined;
587
+ }, {
561
588
  id: string;
562
589
  name: string;
590
+ instructions?: string | undefined;
563
591
  }>;
564
592
  authSource: z.ZodEnum<["HOSTED", "LOCAL"]>;
565
593
  }, "strip", z.ZodTypeAny, {
566
594
  id: string;
567
595
  metadata: {
568
- instructions?: string | undefined;
569
596
  id: string;
570
597
  name: string;
598
+ instructions?: string | undefined;
571
599
  };
572
600
  authSource: "HOSTED" | "LOCAL";
573
601
  }, {
574
602
  id: string;
575
603
  metadata: {
576
- instructions?: string | undefined;
577
604
  id: string;
578
605
  name: string;
606
+ instructions?: string | undefined;
579
607
  };
580
608
  authSource: "HOSTED" | "LOCAL";
581
609
  }>>;
@@ -584,81 +612,77 @@ declare const JobMetadataSchema: z.ZodObject<{
584
612
  name: z.ZodString;
585
613
  maxConcurrent: z.ZodOptional<z.ZodNumber>;
586
614
  }, "strip", z.ZodTypeAny, {
587
- maxConcurrent?: number | undefined;
588
615
  name: string;
589
- }, {
590
616
  maxConcurrent?: number | undefined;
617
+ }, {
591
618
  name: string;
619
+ maxConcurrent?: number | undefined;
592
620
  }>, z.ZodString]>>;
593
621
  startPosition: z.ZodEnum<["initial", "latest"]>;
594
622
  enabled: z.ZodBoolean;
595
623
  preprocessRuns: z.ZodBoolean;
596
624
  }, "strip", z.ZodTypeAny, {
597
- queue?: string | {
598
- maxConcurrent?: number | undefined;
599
- name: string;
600
- } | undefined;
601
625
  id: string;
602
626
  name: string;
603
627
  event: {
628
+ name: (string | string[]) & (string | string[] | undefined);
629
+ icon: string;
630
+ source: string;
631
+ title: string;
604
632
  filter?: EventFilter | undefined;
605
633
  properties?: {
606
- url?: string | undefined;
607
634
  label: string;
608
635
  text: string;
636
+ url?: string | undefined;
609
637
  }[] | undefined;
610
638
  schema?: any;
611
639
  examples?: {
612
- icon?: string | undefined;
613
- payload?: any;
614
640
  id: string;
615
641
  name: string;
642
+ icon?: string | undefined;
643
+ payload?: any;
616
644
  }[] | undefined;
617
- name: string;
618
- icon: string;
619
- source: string;
620
- title: string;
621
645
  };
622
646
  version: string;
623
647
  trigger: {
624
648
  id: string;
625
649
  type: "dynamic";
626
650
  } | {
627
- properties?: {
628
- url?: string | undefined;
629
- label: string;
630
- text: string;
631
- }[] | undefined;
632
651
  type: "static";
633
- title: string;
652
+ title: (string | string[]) & (string | string[] | undefined);
634
653
  rule: {
654
+ event: (string | string[]) & (string | string[] | undefined);
655
+ source: string;
635
656
  payload?: EventFilter | undefined;
636
657
  context?: EventFilter | undefined;
637
- event: string;
638
- source: string;
639
658
  };
659
+ properties?: {
660
+ label: string;
661
+ text: string;
662
+ url?: string | undefined;
663
+ }[] | undefined;
640
664
  } | {
641
665
  type: "scheduled";
642
666
  schedule: {
643
- metadata?: any;
644
667
  options: {
645
668
  cron: string;
646
669
  };
647
670
  type: "cron";
648
- } | {
649
671
  metadata?: any;
672
+ } | {
650
673
  options: {
651
674
  seconds: number;
652
675
  };
653
676
  type: "interval";
677
+ metadata?: any;
654
678
  };
655
679
  };
656
680
  integrations: Record<string, {
657
681
  id: string;
658
682
  metadata: {
659
- instructions?: string | undefined;
660
683
  id: string;
661
684
  name: string;
685
+ instructions?: string | undefined;
662
686
  };
663
687
  authSource: "HOSTED" | "LOCAL";
664
688
  }>;
@@ -666,79 +690,83 @@ declare const JobMetadataSchema: z.ZodObject<{
666
690
  startPosition: "initial" | "latest";
667
691
  enabled: boolean;
668
692
  preprocessRuns: boolean;
669
- }, {
670
- internal?: boolean | undefined;
671
693
  queue?: string | {
672
- maxConcurrent?: number | undefined;
673
694
  name: string;
695
+ maxConcurrent?: number | undefined;
674
696
  } | undefined;
697
+ }, {
675
698
  id: string;
676
699
  name: string;
677
700
  event: {
701
+ name: (string | string[]) & (string | string[] | undefined);
702
+ icon: string;
703
+ source: string;
704
+ title: string;
678
705
  filter?: EventFilter | undefined;
679
706
  properties?: {
680
- url?: string | undefined;
681
707
  label: string;
682
708
  text: string;
709
+ url?: string | undefined;
683
710
  }[] | undefined;
684
711
  schema?: any;
685
712
  examples?: {
686
- icon?: string | undefined;
687
- payload?: any;
688
713
  id: string;
689
714
  name: string;
715
+ icon?: string | undefined;
716
+ payload?: any;
690
717
  }[] | undefined;
691
- name: string;
692
- icon: string;
693
- source: string;
694
- title: string;
695
718
  };
696
719
  version: string;
697
720
  trigger: {
698
721
  id: string;
699
722
  type: "dynamic";
700
723
  } | {
701
- properties?: {
702
- url?: string | undefined;
703
- label: string;
704
- text: string;
705
- }[] | undefined;
706
724
  type: "static";
707
- title: string;
725
+ title: (string | string[]) & (string | string[] | undefined);
708
726
  rule: {
727
+ event: (string | string[]) & (string | string[] | undefined);
728
+ source: string;
709
729
  payload?: EventFilter | undefined;
710
730
  context?: EventFilter | undefined;
711
- event: string;
712
- source: string;
713
731
  };
714
- } | {
715
- type: "scheduled";
732
+ properties?: {
733
+ label: string;
734
+ text: string;
735
+ url?: string | undefined;
736
+ }[] | undefined;
737
+ } | {
738
+ type: "scheduled";
716
739
  schedule: {
717
- metadata?: any;
718
740
  options: {
719
741
  cron: string;
720
742
  };
721
743
  type: "cron";
722
- } | {
723
744
  metadata?: any;
745
+ } | {
724
746
  options: {
725
747
  seconds: number;
726
748
  };
727
749
  type: "interval";
750
+ metadata?: any;
728
751
  };
729
752
  };
730
753
  integrations: Record<string, {
731
754
  id: string;
732
755
  metadata: {
733
- instructions?: string | undefined;
734
756
  id: string;
735
757
  name: string;
758
+ instructions?: string | undefined;
736
759
  };
737
760
  authSource: "HOSTED" | "LOCAL";
738
761
  }>;
739
762
  startPosition: "initial" | "latest";
740
763
  enabled: boolean;
741
764
  preprocessRuns: boolean;
765
+ internal?: boolean | undefined;
766
+ queue?: string | {
767
+ name: string;
768
+ maxConcurrent?: number | undefined;
769
+ } | undefined;
742
770
  }>;
743
771
  type JobMetadata = z.infer<typeof JobMetadataSchema>;
744
772
  declare const RawEventSchema: z.ZodObject<{
@@ -766,22 +794,69 @@ declare const RawEventSchema: z.ZodObject<{
766
794
  this as you can filter events using this in the `eventTrigger()`. */
767
795
  source: z.ZodOptional<z.ZodString>;
768
796
  }, "strip", z.ZodTypeAny, {
769
- source?: string | undefined;
797
+ id: string;
798
+ name: string;
770
799
  payload?: any;
771
800
  context?: any;
772
801
  timestamp?: Date | undefined;
773
- id: string;
774
- name: string;
775
- }, {
776
- id?: string | undefined;
777
802
  source?: string | undefined;
803
+ }, {
804
+ name: string;
778
805
  payload?: any;
779
806
  context?: any;
807
+ id?: string | undefined;
780
808
  timestamp?: Date | undefined;
781
- name: string;
809
+ source?: string | undefined;
782
810
  }>;
783
811
  /** The event you wish to send to Trigger a Job */
784
812
  type SendEvent = z.input<typeof RawEventSchema>;
813
+ /** The event that was sent */
814
+ declare const ApiEventLogSchema: z.ZodObject<{
815
+ /** The `id` of the event that was sent.
816
+ */
817
+ id: z.ZodString;
818
+ /** The `name` of the event that was sent. */
819
+ name: z.ZodString;
820
+ /** The `payload` of the event that was sent */
821
+ payload: z.ZodType<DeserializedJson, z.ZodTypeDef, DeserializedJson>;
822
+ /** The `context` of the event that was sent. Is `undefined` if no context was
823
+ set when sending the event. */
824
+ context: z.ZodNullable<z.ZodOptional<z.ZodType<DeserializedJson, z.ZodTypeDef, DeserializedJson>>>;
825
+ /** The `timestamp` of the event that was sent */
826
+ timestamp: z.ZodDate;
827
+ /** The timestamp when the event will be delivered to any matching Jobs. Is
828
+ `undefined` if `deliverAt` or `deliverAfter` wasn't set when sending the
829
+ event. */
830
+ deliverAt: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
831
+ /** The timestamp when the event was delivered. Is `undefined` if `deliverAt`
832
+ or `deliverAfter` were set when sending the event. */
833
+ deliveredAt: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
834
+ }, "strip", z.ZodTypeAny, {
835
+ id: string;
836
+ name: string;
837
+ payload: ((string | number | boolean | {
838
+ [key: string]: DeserializedJson;
839
+ } | DeserializedJson[]) & (string | number | boolean | {
840
+ [key: string]: DeserializedJson;
841
+ } | DeserializedJson[] | undefined)) | null;
842
+ timestamp: Date;
843
+ context?: DeserializedJson | undefined;
844
+ deliverAt?: Date | null | undefined;
845
+ deliveredAt?: Date | null | undefined;
846
+ }, {
847
+ id: string;
848
+ name: string;
849
+ payload: ((string | number | boolean | {
850
+ [key: string]: DeserializedJson;
851
+ } | DeserializedJson[]) & (string | number | boolean | {
852
+ [key: string]: DeserializedJson;
853
+ } | DeserializedJson[] | undefined)) | null;
854
+ timestamp: Date;
855
+ context?: DeserializedJson | undefined;
856
+ deliverAt?: Date | null | undefined;
857
+ deliveredAt?: Date | null | undefined;
858
+ }>;
859
+ type ApiEventLog = z.infer<typeof ApiEventLogSchema>;
785
860
  /** Options to control the delivery of the event */
786
861
  declare const SendEventOptionsSchema: z.ZodObject<{
787
862
  /** An optional Date when you want the event to trigger Jobs. The event will
@@ -814,7 +889,7 @@ declare const CreateRunBodySchema: z.ZodObject<{
814
889
  name: z.ZodString;
815
890
  version: z.ZodString;
816
891
  event: z.ZodObject<{
817
- name: z.ZodString;
892
+ name: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
818
893
  title: z.ZodString;
819
894
  source: z.ZodString;
820
895
  icon: z.ZodString;
@@ -824,13 +899,13 @@ declare const CreateRunBodySchema: z.ZodObject<{
824
899
  text: z.ZodString;
825
900
  url: z.ZodOptional<z.ZodString>;
826
901
  }, "strip", z.ZodTypeAny, {
827
- url?: string | undefined;
828
902
  label: string;
829
903
  text: string;
830
- }, {
831
904
  url?: string | undefined;
905
+ }, {
832
906
  label: string;
833
907
  text: string;
908
+ url?: string | undefined;
834
909
  }>, "many">>;
835
910
  schema: z.ZodOptional<z.ZodAny>;
836
911
  examples: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -839,52 +914,52 @@ declare const CreateRunBodySchema: z.ZodObject<{
839
914
  name: z.ZodString;
840
915
  payload: z.ZodAny;
841
916
  }, "strip", z.ZodTypeAny, {
842
- icon?: string | undefined;
843
- payload?: any;
844
917
  id: string;
845
918
  name: string;
846
- }, {
847
919
  icon?: string | undefined;
848
920
  payload?: any;
921
+ }, {
849
922
  id: string;
850
923
  name: string;
924
+ icon?: string | undefined;
925
+ payload?: any;
851
926
  }>, "many">>;
852
927
  }, "strip", z.ZodTypeAny, {
928
+ name: (string | string[]) & (string | string[] | undefined);
929
+ icon: string;
930
+ source: string;
931
+ title: string;
853
932
  filter?: EventFilter | undefined;
854
933
  properties?: {
855
- url?: string | undefined;
856
934
  label: string;
857
935
  text: string;
936
+ url?: string | undefined;
858
937
  }[] | undefined;
859
938
  schema?: any;
860
939
  examples?: {
861
- icon?: string | undefined;
862
- payload?: any;
863
940
  id: string;
864
941
  name: string;
942
+ icon?: string | undefined;
943
+ payload?: any;
865
944
  }[] | undefined;
866
- name: string;
945
+ }, {
946
+ name: (string | string[]) & (string | string[] | undefined);
867
947
  icon: string;
868
948
  source: string;
869
949
  title: string;
870
- }, {
871
950
  filter?: EventFilter | undefined;
872
951
  properties?: {
873
- url?: string | undefined;
874
952
  label: string;
875
953
  text: string;
954
+ url?: string | undefined;
876
955
  }[] | undefined;
877
956
  schema?: any;
878
957
  examples?: {
879
- icon?: string | undefined;
880
- payload?: any;
881
958
  id: string;
882
959
  name: string;
960
+ icon?: string | undefined;
961
+ payload?: any;
883
962
  }[] | undefined;
884
- name: string;
885
- icon: string;
886
- source: string;
887
- title: string;
888
963
  }>;
889
964
  trigger: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
890
965
  type: z.ZodLiteral<"dynamic">;
@@ -897,64 +972,64 @@ declare const CreateRunBodySchema: z.ZodObject<{
897
972
  type: "dynamic";
898
973
  }>, z.ZodObject<{
899
974
  type: z.ZodLiteral<"static">;
900
- title: z.ZodString;
975
+ title: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
901
976
  properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
902
977
  label: z.ZodString;
903
978
  text: z.ZodString;
904
979
  url: z.ZodOptional<z.ZodString>;
905
980
  }, "strip", z.ZodTypeAny, {
906
- url?: string | undefined;
907
981
  label: string;
908
982
  text: string;
909
- }, {
910
983
  url?: string | undefined;
984
+ }, {
911
985
  label: string;
912
986
  text: string;
987
+ url?: string | undefined;
913
988
  }>, "many">>;
914
989
  rule: z.ZodObject<{
915
- event: z.ZodString;
990
+ event: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
916
991
  source: z.ZodString;
917
992
  payload: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
918
993
  context: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
919
994
  }, "strip", z.ZodTypeAny, {
995
+ event: (string | string[]) & (string | string[] | undefined);
996
+ source: string;
920
997
  payload?: EventFilter | undefined;
921
998
  context?: EventFilter | undefined;
922
- event: string;
923
- source: string;
924
999
  }, {
1000
+ event: (string | string[]) & (string | string[] | undefined);
1001
+ source: string;
925
1002
  payload?: EventFilter | undefined;
926
1003
  context?: EventFilter | undefined;
927
- event: string;
928
- source: string;
929
1004
  }>;
930
1005
  }, "strip", z.ZodTypeAny, {
931
- properties?: {
932
- url?: string | undefined;
933
- label: string;
934
- text: string;
935
- }[] | undefined;
936
1006
  type: "static";
937
- title: string;
1007
+ title: (string | string[]) & (string | string[] | undefined);
938
1008
  rule: {
1009
+ event: (string | string[]) & (string | string[] | undefined);
1010
+ source: string;
939
1011
  payload?: EventFilter | undefined;
940
1012
  context?: EventFilter | undefined;
941
- event: string;
942
- source: string;
943
1013
  };
944
- }, {
945
1014
  properties?: {
946
- url?: string | undefined;
947
1015
  label: string;
948
1016
  text: string;
1017
+ url?: string | undefined;
949
1018
  }[] | undefined;
1019
+ }, {
950
1020
  type: "static";
951
- title: string;
1021
+ title: (string | string[]) & (string | string[] | undefined);
952
1022
  rule: {
1023
+ event: (string | string[]) & (string | string[] | undefined);
1024
+ source: string;
953
1025
  payload?: EventFilter | undefined;
954
1026
  context?: EventFilter | undefined;
955
- event: string;
956
- source: string;
957
1027
  };
1028
+ properties?: {
1029
+ label: string;
1030
+ text: string;
1031
+ url?: string | undefined;
1032
+ }[] | undefined;
958
1033
  }>, z.ZodObject<{
959
1034
  type: z.ZodLiteral<"scheduled">;
960
1035
  schedule: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -968,17 +1043,17 @@ declare const CreateRunBodySchema: z.ZodObject<{
968
1043
  }>;
969
1044
  metadata: z.ZodAny;
970
1045
  }, "strip", z.ZodTypeAny, {
971
- metadata?: any;
972
1046
  options: {
973
1047
  seconds: number;
974
1048
  };
975
1049
  type: "interval";
976
- }, {
977
1050
  metadata?: any;
1051
+ }, {
978
1052
  options: {
979
1053
  seconds: number;
980
1054
  };
981
1055
  type: "interval";
1056
+ metadata?: any;
982
1057
  }>, z.ZodObject<{
983
1058
  type: z.ZodLiteral<"cron">;
984
1059
  options: z.ZodObject<{
@@ -990,47 +1065,47 @@ declare const CreateRunBodySchema: z.ZodObject<{
990
1065
  }>;
991
1066
  metadata: z.ZodAny;
992
1067
  }, "strip", z.ZodTypeAny, {
993
- metadata?: any;
994
1068
  options: {
995
1069
  cron: string;
996
1070
  };
997
1071
  type: "cron";
998
- }, {
999
1072
  metadata?: any;
1073
+ }, {
1000
1074
  options: {
1001
1075
  cron: string;
1002
1076
  };
1003
1077
  type: "cron";
1078
+ metadata?: any;
1004
1079
  }>]>;
1005
1080
  }, "strip", z.ZodTypeAny, {
1006
1081
  type: "scheduled";
1007
1082
  schedule: {
1008
- metadata?: any;
1009
1083
  options: {
1010
1084
  cron: string;
1011
1085
  };
1012
1086
  type: "cron";
1013
- } | {
1014
1087
  metadata?: any;
1088
+ } | {
1015
1089
  options: {
1016
1090
  seconds: number;
1017
1091
  };
1018
1092
  type: "interval";
1093
+ metadata?: any;
1019
1094
  };
1020
1095
  }, {
1021
1096
  type: "scheduled";
1022
1097
  schedule: {
1023
- metadata?: any;
1024
1098
  options: {
1025
1099
  cron: string;
1026
1100
  };
1027
1101
  type: "cron";
1028
- } | {
1029
1102
  metadata?: any;
1103
+ } | {
1030
1104
  options: {
1031
1105
  seconds: number;
1032
1106
  };
1033
1107
  type: "interval";
1108
+ metadata?: any;
1034
1109
  };
1035
1110
  }>]>;
1036
1111
  integrations: z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -1040,29 +1115,29 @@ declare const CreateRunBodySchema: z.ZodObject<{
1040
1115
  name: z.ZodString;
1041
1116
  instructions: z.ZodOptional<z.ZodString>;
1042
1117
  }, "strip", z.ZodTypeAny, {
1043
- instructions?: string | undefined;
1044
1118
  id: string;
1045
1119
  name: string;
1046
- }, {
1047
1120
  instructions?: string | undefined;
1121
+ }, {
1048
1122
  id: string;
1049
1123
  name: string;
1124
+ instructions?: string | undefined;
1050
1125
  }>;
1051
1126
  authSource: z.ZodEnum<["HOSTED", "LOCAL"]>;
1052
1127
  }, "strip", z.ZodTypeAny, {
1053
1128
  id: string;
1054
1129
  metadata: {
1055
- instructions?: string | undefined;
1056
1130
  id: string;
1057
1131
  name: string;
1132
+ instructions?: string | undefined;
1058
1133
  };
1059
1134
  authSource: "HOSTED" | "LOCAL";
1060
1135
  }, {
1061
1136
  id: string;
1062
1137
  metadata: {
1063
- instructions?: string | undefined;
1064
1138
  id: string;
1065
1139
  name: string;
1140
+ instructions?: string | undefined;
1066
1141
  };
1067
1142
  authSource: "HOSTED" | "LOCAL";
1068
1143
  }>>;
@@ -1071,81 +1146,77 @@ declare const CreateRunBodySchema: z.ZodObject<{
1071
1146
  name: z.ZodString;
1072
1147
  maxConcurrent: z.ZodOptional<z.ZodNumber>;
1073
1148
  }, "strip", z.ZodTypeAny, {
1074
- maxConcurrent?: number | undefined;
1075
1149
  name: string;
1076
- }, {
1077
1150
  maxConcurrent?: number | undefined;
1151
+ }, {
1078
1152
  name: string;
1153
+ maxConcurrent?: number | undefined;
1079
1154
  }>, z.ZodString]>>;
1080
1155
  startPosition: z.ZodEnum<["initial", "latest"]>;
1081
1156
  enabled: z.ZodBoolean;
1082
1157
  preprocessRuns: z.ZodBoolean;
1083
1158
  }, "strip", z.ZodTypeAny, {
1084
- queue?: string | {
1085
- maxConcurrent?: number | undefined;
1086
- name: string;
1087
- } | undefined;
1088
1159
  id: string;
1089
1160
  name: string;
1090
1161
  event: {
1162
+ name: (string | string[]) & (string | string[] | undefined);
1163
+ icon: string;
1164
+ source: string;
1165
+ title: string;
1091
1166
  filter?: EventFilter | undefined;
1092
1167
  properties?: {
1093
- url?: string | undefined;
1094
1168
  label: string;
1095
1169
  text: string;
1170
+ url?: string | undefined;
1096
1171
  }[] | undefined;
1097
1172
  schema?: any;
1098
1173
  examples?: {
1099
- icon?: string | undefined;
1100
- payload?: any;
1101
1174
  id: string;
1102
1175
  name: string;
1176
+ icon?: string | undefined;
1177
+ payload?: any;
1103
1178
  }[] | undefined;
1104
- name: string;
1105
- icon: string;
1106
- source: string;
1107
- title: string;
1108
1179
  };
1109
1180
  version: string;
1110
1181
  trigger: {
1111
1182
  id: string;
1112
1183
  type: "dynamic";
1113
1184
  } | {
1114
- properties?: {
1115
- url?: string | undefined;
1116
- label: string;
1117
- text: string;
1118
- }[] | undefined;
1119
1185
  type: "static";
1120
- title: string;
1186
+ title: (string | string[]) & (string | string[] | undefined);
1121
1187
  rule: {
1188
+ event: (string | string[]) & (string | string[] | undefined);
1189
+ source: string;
1122
1190
  payload?: EventFilter | undefined;
1123
1191
  context?: EventFilter | undefined;
1124
- event: string;
1125
- source: string;
1126
1192
  };
1193
+ properties?: {
1194
+ label: string;
1195
+ text: string;
1196
+ url?: string | undefined;
1197
+ }[] | undefined;
1127
1198
  } | {
1128
1199
  type: "scheduled";
1129
1200
  schedule: {
1130
- metadata?: any;
1131
1201
  options: {
1132
1202
  cron: string;
1133
1203
  };
1134
1204
  type: "cron";
1135
- } | {
1136
1205
  metadata?: any;
1206
+ } | {
1137
1207
  options: {
1138
1208
  seconds: number;
1139
1209
  };
1140
1210
  type: "interval";
1211
+ metadata?: any;
1141
1212
  };
1142
1213
  };
1143
1214
  integrations: Record<string, {
1144
1215
  id: string;
1145
1216
  metadata: {
1146
- instructions?: string | undefined;
1147
1217
  id: string;
1148
1218
  name: string;
1219
+ instructions?: string | undefined;
1149
1220
  };
1150
1221
  authSource: "HOSTED" | "LOCAL";
1151
1222
  }>;
@@ -1153,79 +1224,83 @@ declare const CreateRunBodySchema: z.ZodObject<{
1153
1224
  startPosition: "initial" | "latest";
1154
1225
  enabled: boolean;
1155
1226
  preprocessRuns: boolean;
1156
- }, {
1157
- internal?: boolean | undefined;
1158
1227
  queue?: string | {
1159
- maxConcurrent?: number | undefined;
1160
1228
  name: string;
1229
+ maxConcurrent?: number | undefined;
1161
1230
  } | undefined;
1231
+ }, {
1162
1232
  id: string;
1163
1233
  name: string;
1164
1234
  event: {
1235
+ name: (string | string[]) & (string | string[] | undefined);
1236
+ icon: string;
1237
+ source: string;
1238
+ title: string;
1165
1239
  filter?: EventFilter | undefined;
1166
1240
  properties?: {
1167
- url?: string | undefined;
1168
1241
  label: string;
1169
1242
  text: string;
1243
+ url?: string | undefined;
1170
1244
  }[] | undefined;
1171
1245
  schema?: any;
1172
1246
  examples?: {
1173
- icon?: string | undefined;
1174
- payload?: any;
1175
1247
  id: string;
1176
1248
  name: string;
1249
+ icon?: string | undefined;
1250
+ payload?: any;
1177
1251
  }[] | undefined;
1178
- name: string;
1179
- icon: string;
1180
- source: string;
1181
- title: string;
1182
1252
  };
1183
1253
  version: string;
1184
1254
  trigger: {
1185
1255
  id: string;
1186
1256
  type: "dynamic";
1187
1257
  } | {
1188
- properties?: {
1189
- url?: string | undefined;
1190
- label: string;
1191
- text: string;
1192
- }[] | undefined;
1193
1258
  type: "static";
1194
- title: string;
1259
+ title: (string | string[]) & (string | string[] | undefined);
1195
1260
  rule: {
1261
+ event: (string | string[]) & (string | string[] | undefined);
1262
+ source: string;
1196
1263
  payload?: EventFilter | undefined;
1197
1264
  context?: EventFilter | undefined;
1198
- event: string;
1199
- source: string;
1200
1265
  };
1266
+ properties?: {
1267
+ label: string;
1268
+ text: string;
1269
+ url?: string | undefined;
1270
+ }[] | undefined;
1201
1271
  } | {
1202
1272
  type: "scheduled";
1203
1273
  schedule: {
1204
- metadata?: any;
1205
1274
  options: {
1206
1275
  cron: string;
1207
1276
  };
1208
1277
  type: "cron";
1209
- } | {
1210
1278
  metadata?: any;
1279
+ } | {
1211
1280
  options: {
1212
1281
  seconds: number;
1213
1282
  };
1214
1283
  type: "interval";
1284
+ metadata?: any;
1215
1285
  };
1216
1286
  };
1217
1287
  integrations: Record<string, {
1218
1288
  id: string;
1219
1289
  metadata: {
1220
- instructions?: string | undefined;
1221
1290
  id: string;
1222
1291
  name: string;
1292
+ instructions?: string | undefined;
1223
1293
  };
1224
1294
  authSource: "HOSTED" | "LOCAL";
1225
1295
  }>;
1226
1296
  startPosition: "initial" | "latest";
1227
1297
  enabled: boolean;
1228
1298
  preprocessRuns: boolean;
1299
+ internal?: boolean | undefined;
1300
+ queue?: string | {
1301
+ name: string;
1302
+ maxConcurrent?: number | undefined;
1303
+ } | undefined;
1229
1304
  }>;
1230
1305
  event: z.ZodObject<{
1231
1306
  /** The `id` of the event that was sent.
@@ -1248,116 +1323,119 @@ declare const CreateRunBodySchema: z.ZodObject<{
1248
1323
  or `deliverAfter` were set when sending the event. */
1249
1324
  deliveredAt: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
1250
1325
  }, "strip", z.ZodTypeAny, {
1251
- context?: DeserializedJson | undefined;
1252
- deliverAt?: Date | null | undefined;
1253
- deliveredAt?: Date | null | undefined;
1254
1326
  id: string;
1255
1327
  name: string;
1256
- payload: DeserializedJson;
1328
+ payload: ((string | number | boolean | {
1329
+ [key: string]: DeserializedJson;
1330
+ } | DeserializedJson[]) & (string | number | boolean | {
1331
+ [key: string]: DeserializedJson;
1332
+ } | DeserializedJson[] | undefined)) | null;
1257
1333
  timestamp: Date;
1258
- }, {
1259
1334
  context?: DeserializedJson | undefined;
1260
1335
  deliverAt?: Date | null | undefined;
1261
1336
  deliveredAt?: Date | null | undefined;
1337
+ }, {
1262
1338
  id: string;
1263
1339
  name: string;
1264
- payload: DeserializedJson;
1340
+ payload: ((string | number | boolean | {
1341
+ [key: string]: DeserializedJson;
1342
+ } | DeserializedJson[]) & (string | number | boolean | {
1343
+ [key: string]: DeserializedJson;
1344
+ } | DeserializedJson[] | undefined)) | null;
1265
1345
  timestamp: Date;
1346
+ context?: DeserializedJson | undefined;
1347
+ deliverAt?: Date | null | undefined;
1348
+ deliveredAt?: Date | null | undefined;
1266
1349
  }>;
1267
1350
  properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
1268
1351
  label: z.ZodString;
1269
1352
  text: z.ZodString;
1270
1353
  url: z.ZodOptional<z.ZodString>;
1271
1354
  }, "strip", z.ZodTypeAny, {
1272
- url?: string | undefined;
1273
1355
  label: string;
1274
1356
  text: string;
1275
- }, {
1276
1357
  url?: string | undefined;
1358
+ }, {
1277
1359
  label: string;
1278
1360
  text: string;
1361
+ url?: string | undefined;
1279
1362
  }>, "many">>;
1280
1363
  }, "strip", z.ZodTypeAny, {
1281
- properties?: {
1282
- url?: string | undefined;
1283
- label: string;
1284
- text: string;
1285
- }[] | undefined;
1286
1364
  event: {
1287
- context?: DeserializedJson | undefined;
1288
- deliverAt?: Date | null | undefined;
1289
- deliveredAt?: Date | null | undefined;
1290
1365
  id: string;
1291
1366
  name: string;
1292
- payload: DeserializedJson;
1367
+ payload: ((string | number | boolean | {
1368
+ [key: string]: DeserializedJson;
1369
+ } | DeserializedJson[]) & (string | number | boolean | {
1370
+ [key: string]: DeserializedJson;
1371
+ } | DeserializedJson[] | undefined)) | null;
1293
1372
  timestamp: Date;
1373
+ context?: DeserializedJson | undefined;
1374
+ deliverAt?: Date | null | undefined;
1375
+ deliveredAt?: Date | null | undefined;
1294
1376
  };
1295
1377
  job: {
1296
- queue?: string | {
1297
- maxConcurrent?: number | undefined;
1298
- name: string;
1299
- } | undefined;
1300
1378
  id: string;
1301
1379
  name: string;
1302
1380
  event: {
1381
+ name: (string | string[]) & (string | string[] | undefined);
1382
+ icon: string;
1383
+ source: string;
1384
+ title: string;
1303
1385
  filter?: EventFilter | undefined;
1304
1386
  properties?: {
1305
- url?: string | undefined;
1306
1387
  label: string;
1307
1388
  text: string;
1389
+ url?: string | undefined;
1308
1390
  }[] | undefined;
1309
1391
  schema?: any;
1310
1392
  examples?: {
1311
- icon?: string | undefined;
1312
- payload?: any;
1313
1393
  id: string;
1314
1394
  name: string;
1395
+ icon?: string | undefined;
1396
+ payload?: any;
1315
1397
  }[] | undefined;
1316
- name: string;
1317
- icon: string;
1318
- source: string;
1319
- title: string;
1320
1398
  };
1321
1399
  version: string;
1322
1400
  trigger: {
1323
1401
  id: string;
1324
1402
  type: "dynamic";
1325
1403
  } | {
1326
- properties?: {
1327
- url?: string | undefined;
1328
- label: string;
1329
- text: string;
1330
- }[] | undefined;
1331
1404
  type: "static";
1332
- title: string;
1405
+ title: (string | string[]) & (string | string[] | undefined);
1333
1406
  rule: {
1407
+ event: (string | string[]) & (string | string[] | undefined);
1408
+ source: string;
1334
1409
  payload?: EventFilter | undefined;
1335
1410
  context?: EventFilter | undefined;
1336
- event: string;
1337
- source: string;
1338
1411
  };
1412
+ properties?: {
1413
+ label: string;
1414
+ text: string;
1415
+ url?: string | undefined;
1416
+ }[] | undefined;
1339
1417
  } | {
1340
1418
  type: "scheduled";
1341
1419
  schedule: {
1342
- metadata?: any;
1343
1420
  options: {
1344
1421
  cron: string;
1345
1422
  };
1346
1423
  type: "cron";
1347
- } | {
1348
1424
  metadata?: any;
1425
+ } | {
1349
1426
  options: {
1350
1427
  seconds: number;
1351
1428
  };
1352
1429
  type: "interval";
1430
+ metadata?: any;
1353
1431
  };
1354
1432
  };
1355
1433
  integrations: Record<string, {
1356
1434
  id: string;
1357
1435
  metadata: {
1358
- instructions?: string | undefined;
1359
1436
  id: string;
1360
1437
  name: string;
1438
+ instructions?: string | undefined;
1361
1439
  };
1362
1440
  authSource: "HOSTED" | "LOCAL";
1363
1441
  }>;
@@ -1365,98 +1443,111 @@ declare const CreateRunBodySchema: z.ZodObject<{
1365
1443
  startPosition: "initial" | "latest";
1366
1444
  enabled: boolean;
1367
1445
  preprocessRuns: boolean;
1446
+ queue?: string | {
1447
+ name: string;
1448
+ maxConcurrent?: number | undefined;
1449
+ } | undefined;
1368
1450
  };
1369
1451
  client: string;
1370
- }, {
1371
1452
  properties?: {
1372
- url?: string | undefined;
1373
1453
  label: string;
1374
1454
  text: string;
1455
+ url?: string | undefined;
1375
1456
  }[] | undefined;
1457
+ }, {
1376
1458
  event: {
1377
- context?: DeserializedJson | undefined;
1378
- deliverAt?: Date | null | undefined;
1379
- deliveredAt?: Date | null | undefined;
1380
1459
  id: string;
1381
1460
  name: string;
1382
- payload: DeserializedJson;
1461
+ payload: ((string | number | boolean | {
1462
+ [key: string]: DeserializedJson;
1463
+ } | DeserializedJson[]) & (string | number | boolean | {
1464
+ [key: string]: DeserializedJson;
1465
+ } | DeserializedJson[] | undefined)) | null;
1383
1466
  timestamp: Date;
1467
+ context?: DeserializedJson | undefined;
1468
+ deliverAt?: Date | null | undefined;
1469
+ deliveredAt?: Date | null | undefined;
1384
1470
  };
1385
1471
  job: {
1386
- internal?: boolean | undefined;
1387
- queue?: string | {
1388
- maxConcurrent?: number | undefined;
1389
- name: string;
1390
- } | undefined;
1391
1472
  id: string;
1392
1473
  name: string;
1393
1474
  event: {
1475
+ name: (string | string[]) & (string | string[] | undefined);
1476
+ icon: string;
1477
+ source: string;
1478
+ title: string;
1394
1479
  filter?: EventFilter | undefined;
1395
1480
  properties?: {
1396
- url?: string | undefined;
1397
1481
  label: string;
1398
1482
  text: string;
1483
+ url?: string | undefined;
1399
1484
  }[] | undefined;
1400
1485
  schema?: any;
1401
1486
  examples?: {
1402
- icon?: string | undefined;
1403
- payload?: any;
1404
1487
  id: string;
1405
1488
  name: string;
1489
+ icon?: string | undefined;
1490
+ payload?: any;
1406
1491
  }[] | undefined;
1407
- name: string;
1408
- icon: string;
1409
- source: string;
1410
- title: string;
1411
1492
  };
1412
1493
  version: string;
1413
1494
  trigger: {
1414
1495
  id: string;
1415
1496
  type: "dynamic";
1416
1497
  } | {
1417
- properties?: {
1418
- url?: string | undefined;
1419
- label: string;
1420
- text: string;
1421
- }[] | undefined;
1422
1498
  type: "static";
1423
- title: string;
1499
+ title: (string | string[]) & (string | string[] | undefined);
1424
1500
  rule: {
1501
+ event: (string | string[]) & (string | string[] | undefined);
1502
+ source: string;
1425
1503
  payload?: EventFilter | undefined;
1426
1504
  context?: EventFilter | undefined;
1427
- event: string;
1428
- source: string;
1429
1505
  };
1506
+ properties?: {
1507
+ label: string;
1508
+ text: string;
1509
+ url?: string | undefined;
1510
+ }[] | undefined;
1430
1511
  } | {
1431
1512
  type: "scheduled";
1432
1513
  schedule: {
1433
- metadata?: any;
1434
1514
  options: {
1435
1515
  cron: string;
1436
1516
  };
1437
1517
  type: "cron";
1438
- } | {
1439
1518
  metadata?: any;
1519
+ } | {
1440
1520
  options: {
1441
1521
  seconds: number;
1442
1522
  };
1443
1523
  type: "interval";
1524
+ metadata?: any;
1444
1525
  };
1445
1526
  };
1446
1527
  integrations: Record<string, {
1447
1528
  id: string;
1448
1529
  metadata: {
1449
- instructions?: string | undefined;
1450
1530
  id: string;
1451
1531
  name: string;
1532
+ instructions?: string | undefined;
1452
1533
  };
1453
1534
  authSource: "HOSTED" | "LOCAL";
1454
1535
  }>;
1455
1536
  startPosition: "initial" | "latest";
1456
1537
  enabled: boolean;
1457
1538
  preprocessRuns: boolean;
1539
+ internal?: boolean | undefined;
1540
+ queue?: string | {
1541
+ name: string;
1542
+ maxConcurrent?: number | undefined;
1543
+ } | undefined;
1458
1544
  };
1459
1545
  client: string;
1546
+ properties?: {
1547
+ label: string;
1548
+ text: string;
1549
+ url?: string | undefined;
1550
+ }[] | undefined;
1460
1551
  }>;
1461
1552
  type CreateRunBody = z.infer<typeof CreateRunBodySchema>;
1462
1553
  declare const RedactStringSchema: z.ZodObject<{
@@ -1518,13 +1609,13 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
1518
1609
  text: z.ZodString;
1519
1610
  url: z.ZodOptional<z.ZodString>;
1520
1611
  }, "strip", z.ZodTypeAny, {
1521
- url?: string | undefined;
1522
1612
  label: string;
1523
1613
  text: string;
1524
- }, {
1525
1614
  url?: string | undefined;
1615
+ }, {
1526
1616
  label: string;
1527
1617
  text: string;
1618
+ url?: string | undefined;
1528
1619
  }>, "many">>;
1529
1620
  /** The input params to the Task, will be displayed in the logs */
1530
1621
  params: z.ZodAny;
@@ -1533,11 +1624,11 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
1533
1624
  style: z.ZodEnum<["normal", "minimal"]>;
1534
1625
  variant: z.ZodOptional<z.ZodString>;
1535
1626
  }, "strip", z.ZodTypeAny, {
1536
- variant?: string | undefined;
1537
1627
  style: "normal" | "minimal";
1538
- }, {
1539
1628
  variant?: string | undefined;
1629
+ }, {
1540
1630
  style: "normal" | "minimal";
1631
+ variant?: string | undefined;
1541
1632
  }>>;
1542
1633
  /** Allows you to link the Integration connection in the logs. This is handled automatically in integrations. */
1543
1634
  connectionKey: z.ZodOptional<z.ZodString>;
@@ -1563,64 +1654,64 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
1563
1654
  type: "dynamic";
1564
1655
  }>, z.ZodObject<{
1565
1656
  type: z.ZodLiteral<"static">;
1566
- title: z.ZodString;
1657
+ title: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
1567
1658
  properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
1568
1659
  label: z.ZodString;
1569
1660
  text: z.ZodString;
1570
1661
  url: z.ZodOptional<z.ZodString>;
1571
1662
  }, "strip", z.ZodTypeAny, {
1572
- url?: string | undefined;
1573
1663
  label: string;
1574
1664
  text: string;
1575
- }, {
1576
1665
  url?: string | undefined;
1666
+ }, {
1577
1667
  label: string;
1578
1668
  text: string;
1669
+ url?: string | undefined;
1579
1670
  }>, "many">>;
1580
1671
  rule: z.ZodObject<{
1581
- event: z.ZodString;
1672
+ event: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
1582
1673
  source: z.ZodString;
1583
1674
  payload: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
1584
1675
  context: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
1585
1676
  }, "strip", z.ZodTypeAny, {
1677
+ event: (string | string[]) & (string | string[] | undefined);
1678
+ source: string;
1586
1679
  payload?: EventFilter | undefined;
1587
1680
  context?: EventFilter | undefined;
1588
- event: string;
1589
- source: string;
1590
1681
  }, {
1682
+ event: (string | string[]) & (string | string[] | undefined);
1683
+ source: string;
1591
1684
  payload?: EventFilter | undefined;
1592
1685
  context?: EventFilter | undefined;
1593
- event: string;
1594
- source: string;
1595
1686
  }>;
1596
1687
  }, "strip", z.ZodTypeAny, {
1597
- properties?: {
1598
- url?: string | undefined;
1599
- label: string;
1600
- text: string;
1601
- }[] | undefined;
1602
1688
  type: "static";
1603
- title: string;
1689
+ title: (string | string[]) & (string | string[] | undefined);
1604
1690
  rule: {
1691
+ event: (string | string[]) & (string | string[] | undefined);
1692
+ source: string;
1605
1693
  payload?: EventFilter | undefined;
1606
1694
  context?: EventFilter | undefined;
1607
- event: string;
1608
- source: string;
1609
1695
  };
1610
- }, {
1611
1696
  properties?: {
1612
- url?: string | undefined;
1613
1697
  label: string;
1614
1698
  text: string;
1699
+ url?: string | undefined;
1615
1700
  }[] | undefined;
1701
+ }, {
1616
1702
  type: "static";
1617
- title: string;
1703
+ title: (string | string[]) & (string | string[] | undefined);
1618
1704
  rule: {
1705
+ event: (string | string[]) & (string | string[] | undefined);
1706
+ source: string;
1619
1707
  payload?: EventFilter | undefined;
1620
1708
  context?: EventFilter | undefined;
1621
- event: string;
1622
- source: string;
1623
1709
  };
1710
+ properties?: {
1711
+ label: string;
1712
+ text: string;
1713
+ url?: string | undefined;
1714
+ }[] | undefined;
1624
1715
  }>, z.ZodObject<{
1625
1716
  type: z.ZodLiteral<"scheduled">;
1626
1717
  schedule: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -1634,17 +1725,17 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
1634
1725
  }>;
1635
1726
  metadata: z.ZodAny;
1636
1727
  }, "strip", z.ZodTypeAny, {
1637
- metadata?: any;
1638
1728
  options: {
1639
1729
  seconds: number;
1640
1730
  };
1641
1731
  type: "interval";
1642
- }, {
1643
1732
  metadata?: any;
1733
+ }, {
1644
1734
  options: {
1645
1735
  seconds: number;
1646
1736
  };
1647
1737
  type: "interval";
1738
+ metadata?: any;
1648
1739
  }>, z.ZodObject<{
1649
1740
  type: z.ZodLiteral<"cron">;
1650
1741
  options: z.ZodObject<{
@@ -1656,97 +1747,114 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
1656
1747
  }>;
1657
1748
  metadata: z.ZodAny;
1658
1749
  }, "strip", z.ZodTypeAny, {
1659
- metadata?: any;
1660
1750
  options: {
1661
1751
  cron: string;
1662
1752
  };
1663
1753
  type: "cron";
1664
- }, {
1665
1754
  metadata?: any;
1755
+ }, {
1666
1756
  options: {
1667
1757
  cron: string;
1668
1758
  };
1669
1759
  type: "cron";
1760
+ metadata?: any;
1670
1761
  }>]>;
1671
1762
  }, "strip", z.ZodTypeAny, {
1672
1763
  type: "scheduled";
1673
1764
  schedule: {
1674
- metadata?: any;
1675
1765
  options: {
1676
1766
  cron: string;
1677
1767
  };
1678
1768
  type: "cron";
1679
- } | {
1680
1769
  metadata?: any;
1770
+ } | {
1681
1771
  options: {
1682
1772
  seconds: number;
1683
1773
  };
1684
1774
  type: "interval";
1775
+ metadata?: any;
1685
1776
  };
1686
1777
  }, {
1687
1778
  type: "scheduled";
1688
1779
  schedule: {
1689
- metadata?: any;
1690
1780
  options: {
1691
1781
  cron: string;
1692
1782
  };
1693
1783
  type: "cron";
1694
- } | {
1695
1784
  metadata?: any;
1785
+ } | {
1696
1786
  options: {
1697
1787
  seconds: number;
1698
1788
  };
1699
1789
  type: "interval";
1790
+ metadata?: any;
1700
1791
  };
1701
1792
  }>]>>;
1702
1793
  }, "strip", z.ZodTypeAny, {
1703
- icon?: string | undefined;
1794
+ name: string;
1795
+ noop: boolean;
1704
1796
  delayUntil?: Date | undefined;
1797
+ retry?: {
1798
+ limit?: number | undefined;
1799
+ factor?: number | undefined;
1800
+ minTimeoutInMs?: number | undefined;
1801
+ maxTimeoutInMs?: number | undefined;
1802
+ randomize?: boolean | undefined;
1803
+ } | undefined;
1804
+ icon?: string | undefined;
1805
+ displayKey?: string | undefined;
1705
1806
  description?: string | undefined;
1706
- params?: any;
1707
1807
  properties?: {
1708
- url?: string | undefined;
1709
1808
  label: string;
1710
1809
  text: string;
1810
+ url?: string | undefined;
1711
1811
  }[] | undefined;
1812
+ params?: any;
1712
1813
  style?: {
1713
- variant?: string | undefined;
1714
1814
  style: "normal" | "minimal";
1815
+ variant?: string | undefined;
1715
1816
  } | undefined;
1817
+ connectionKey?: string | undefined;
1716
1818
  operation?: "fetch" | undefined;
1819
+ redact?: {
1820
+ paths: string[];
1821
+ } | undefined;
1717
1822
  trigger?: {
1718
1823
  id: string;
1719
1824
  type: "dynamic";
1720
1825
  } | {
1721
- properties?: {
1722
- url?: string | undefined;
1723
- label: string;
1724
- text: string;
1725
- }[] | undefined;
1726
1826
  type: "static";
1727
- title: string;
1827
+ title: (string | string[]) & (string | string[] | undefined);
1728
1828
  rule: {
1829
+ event: (string | string[]) & (string | string[] | undefined);
1830
+ source: string;
1729
1831
  payload?: EventFilter | undefined;
1730
1832
  context?: EventFilter | undefined;
1731
- event: string;
1732
- source: string;
1733
1833
  };
1834
+ properties?: {
1835
+ label: string;
1836
+ text: string;
1837
+ url?: string | undefined;
1838
+ }[] | undefined;
1734
1839
  } | {
1735
1840
  type: "scheduled";
1736
1841
  schedule: {
1737
- metadata?: any;
1738
1842
  options: {
1739
1843
  cron: string;
1740
1844
  };
1741
1845
  type: "cron";
1742
- } | {
1743
1846
  metadata?: any;
1847
+ } | {
1744
1848
  options: {
1745
1849
  seconds: number;
1746
1850
  };
1747
1851
  type: "interval";
1852
+ metadata?: any;
1748
1853
  };
1749
1854
  } | undefined;
1855
+ }, {
1856
+ name: string;
1857
+ delayUntil?: Date | undefined;
1750
1858
  retry?: {
1751
1859
  limit?: number | undefined;
1752
1860
  factor?: number | undefined;
@@ -1754,155 +1862,91 @@ declare const RunTaskOptionsSchema: z.ZodObject<{
1754
1862
  maxTimeoutInMs?: number | undefined;
1755
1863
  randomize?: boolean | undefined;
1756
1864
  } | undefined;
1757
- displayKey?: string | undefined;
1758
- connectionKey?: string | undefined;
1759
- redact?: {
1760
- paths: string[];
1761
- } | undefined;
1762
- name: string;
1763
- noop: boolean;
1764
- }, {
1765
1865
  icon?: string | undefined;
1766
- noop?: boolean | undefined;
1767
- delayUntil?: Date | undefined;
1866
+ displayKey?: string | undefined;
1768
1867
  description?: string | undefined;
1769
- params?: any;
1770
1868
  properties?: {
1771
- url?: string | undefined;
1772
1869
  label: string;
1773
1870
  text: string;
1871
+ url?: string | undefined;
1774
1872
  }[] | undefined;
1873
+ params?: any;
1775
1874
  style?: {
1776
- variant?: string | undefined;
1777
1875
  style: "normal" | "minimal";
1876
+ variant?: string | undefined;
1778
1877
  } | undefined;
1878
+ connectionKey?: string | undefined;
1779
1879
  operation?: "fetch" | undefined;
1880
+ noop?: boolean | undefined;
1881
+ redact?: {
1882
+ paths: string[];
1883
+ } | undefined;
1780
1884
  trigger?: {
1781
1885
  id: string;
1782
1886
  type: "dynamic";
1783
1887
  } | {
1784
- properties?: {
1785
- url?: string | undefined;
1786
- label: string;
1787
- text: string;
1788
- }[] | undefined;
1789
1888
  type: "static";
1790
- title: string;
1889
+ title: (string | string[]) & (string | string[] | undefined);
1791
1890
  rule: {
1891
+ event: (string | string[]) & (string | string[] | undefined);
1892
+ source: string;
1792
1893
  payload?: EventFilter | undefined;
1793
1894
  context?: EventFilter | undefined;
1794
- event: string;
1795
- source: string;
1796
1895
  };
1896
+ properties?: {
1897
+ label: string;
1898
+ text: string;
1899
+ url?: string | undefined;
1900
+ }[] | undefined;
1797
1901
  } | {
1798
1902
  type: "scheduled";
1799
1903
  schedule: {
1800
- metadata?: any;
1801
1904
  options: {
1802
1905
  cron: string;
1803
1906
  };
1804
1907
  type: "cron";
1805
- } | {
1806
1908
  metadata?: any;
1909
+ } | {
1807
1910
  options: {
1808
1911
  seconds: number;
1809
1912
  };
1810
1913
  type: "interval";
1914
+ metadata?: any;
1811
1915
  };
1812
1916
  } | undefined;
1813
- retry?: {
1814
- limit?: number | undefined;
1815
- factor?: number | undefined;
1816
- minTimeoutInMs?: number | undefined;
1817
- maxTimeoutInMs?: number | undefined;
1818
- randomize?: boolean | undefined;
1819
- } | undefined;
1820
- displayKey?: string | undefined;
1821
- connectionKey?: string | undefined;
1822
- redact?: {
1823
- paths: string[];
1824
- } | undefined;
1825
- name: string;
1826
1917
  }>;
1827
1918
  type RunTaskOptions = z.input<typeof RunTaskOptionsSchema>;
1828
- declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
1829
- /** The name of the Task is required. This is displayed on the Task in the logs. */
1919
+ declare const RunTaskBodyInputSchema: z.ZodObject<{
1830
1920
  name: z.ZodString;
1831
- /** The Task will wait and only start at the specified Date */
1921
+ icon: z.ZodOptional<z.ZodString>;
1922
+ noop: z.ZodDefault<z.ZodBoolean>;
1832
1923
  delayUntil: z.ZodOptional<z.ZodDate>;
1833
- /** Retry options */
1834
- retry: z.ZodOptional<z.ZodObject<{
1835
- /** The maximum number of times to retry the request. */
1836
- limit: z.ZodOptional<z.ZodNumber>;
1837
- /** The exponential factor to use when calculating the next retry time. */
1838
- factor: z.ZodOptional<z.ZodNumber>;
1839
- /** The minimum amount of time to wait before retrying the request. */
1840
- minTimeoutInMs: z.ZodOptional<z.ZodNumber>;
1841
- /** The maximum amount of time to wait before retrying the request. */
1842
- maxTimeoutInMs: z.ZodOptional<z.ZodNumber>;
1843
- /** Whether to randomize the retry time. */
1844
- randomize: z.ZodOptional<z.ZodBoolean>;
1924
+ description: z.ZodOptional<z.ZodString>;
1925
+ params: z.ZodAny;
1926
+ properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
1927
+ label: z.ZodString;
1928
+ text: z.ZodString;
1929
+ url: z.ZodOptional<z.ZodString>;
1845
1930
  }, "strip", z.ZodTypeAny, {
1846
- limit?: number | undefined;
1847
- factor?: number | undefined;
1848
- minTimeoutInMs?: number | undefined;
1849
- maxTimeoutInMs?: number | undefined;
1850
- randomize?: boolean | undefined;
1931
+ label: string;
1932
+ text: string;
1933
+ url?: string | undefined;
1851
1934
  }, {
1852
- limit?: number | undefined;
1853
- factor?: number | undefined;
1854
- minTimeoutInMs?: number | undefined;
1855
- maxTimeoutInMs?: number | undefined;
1856
- randomize?: boolean | undefined;
1857
- }>>;
1858
- /** The icon for the Task, it will appear in the logs.
1859
- * You can use the name of a company in lowercase, e.g. "github".
1860
- * Or any icon name that [Font Awesome](https://fontawesome.com/icons) supports. */
1861
- icon: z.ZodOptional<z.ZodString>;
1862
- /** The key for the Task that you want to appear in the logs */
1863
- displayKey: z.ZodOptional<z.ZodString>;
1864
- /** A description of the Task */
1865
- description: z.ZodOptional<z.ZodString>;
1866
- /** Properties that are displayed in the logs */
1867
- properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
1868
- label: z.ZodString;
1869
- text: z.ZodString;
1870
- url: z.ZodOptional<z.ZodString>;
1871
- }, "strip", z.ZodTypeAny, {
1872
- url?: string | undefined;
1873
1935
  label: string;
1874
1936
  text: string;
1875
- }, {
1876
1937
  url?: string | undefined;
1877
- label: string;
1878
- text: string;
1879
1938
  }>, "many">>;
1880
- /** The input params to the Task, will be displayed in the logs */
1881
- params: z.ZodAny;
1882
- /** The style of the log entry. */
1883
1939
  style: z.ZodOptional<z.ZodObject<{
1884
1940
  style: z.ZodEnum<["normal", "minimal"]>;
1885
1941
  variant: z.ZodOptional<z.ZodString>;
1886
1942
  }, "strip", z.ZodTypeAny, {
1887
- variant?: string | undefined;
1888
1943
  style: "normal" | "minimal";
1889
- }, {
1890
1944
  variant?: string | undefined;
1945
+ }, {
1891
1946
  style: "normal" | "minimal";
1947
+ variant?: string | undefined;
1892
1948
  }>>;
1893
- /** Allows you to link the Integration connection in the logs. This is handled automatically in integrations. */
1894
- connectionKey: z.ZodOptional<z.ZodString>;
1895
- /** An operation you want to perform on the Trigger.dev platform, current only "fetch" is supported. If you wish to `fetch` use [`io.backgroundFetch()`](https://trigger.dev/docs/sdk/io/backgroundfetch) instead. */
1896
1949
  operation: z.ZodOptional<z.ZodEnum<["fetch"]>>;
1897
- /** 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). */
1898
- noop: z.ZodDefault<z.ZodBoolean>;
1899
- redact: z.ZodOptional<z.ZodObject<{
1900
- paths: z.ZodArray<z.ZodString, "many">;
1901
- }, "strip", z.ZodTypeAny, {
1902
- paths: string[];
1903
- }, {
1904
- paths: string[];
1905
- }>>;
1906
1950
  trigger: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1907
1951
  type: z.ZodLiteral<"dynamic">;
1908
1952
  id: z.ZodString;
@@ -1914,64 +1958,64 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
1914
1958
  type: "dynamic";
1915
1959
  }>, z.ZodObject<{
1916
1960
  type: z.ZodLiteral<"static">;
1917
- title: z.ZodString;
1961
+ title: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
1918
1962
  properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
1919
1963
  label: z.ZodString;
1920
1964
  text: z.ZodString;
1921
1965
  url: z.ZodOptional<z.ZodString>;
1922
1966
  }, "strip", z.ZodTypeAny, {
1923
- url?: string | undefined;
1924
1967
  label: string;
1925
1968
  text: string;
1926
- }, {
1927
1969
  url?: string | undefined;
1970
+ }, {
1928
1971
  label: string;
1929
1972
  text: string;
1973
+ url?: string | undefined;
1930
1974
  }>, "many">>;
1931
1975
  rule: z.ZodObject<{
1932
- event: z.ZodString;
1976
+ event: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
1933
1977
  source: z.ZodString;
1934
1978
  payload: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
1935
1979
  context: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
1936
1980
  }, "strip", z.ZodTypeAny, {
1981
+ event: (string | string[]) & (string | string[] | undefined);
1982
+ source: string;
1937
1983
  payload?: EventFilter | undefined;
1938
1984
  context?: EventFilter | undefined;
1939
- event: string;
1940
- source: string;
1941
1985
  }, {
1986
+ event: (string | string[]) & (string | string[] | undefined);
1987
+ source: string;
1942
1988
  payload?: EventFilter | undefined;
1943
1989
  context?: EventFilter | undefined;
1944
- event: string;
1945
- source: string;
1946
1990
  }>;
1947
1991
  }, "strip", z.ZodTypeAny, {
1948
- properties?: {
1949
- url?: string | undefined;
1950
- label: string;
1951
- text: string;
1952
- }[] | undefined;
1953
1992
  type: "static";
1954
- title: string;
1993
+ title: (string | string[]) & (string | string[] | undefined);
1955
1994
  rule: {
1995
+ event: (string | string[]) & (string | string[] | undefined);
1996
+ source: string;
1956
1997
  payload?: EventFilter | undefined;
1957
1998
  context?: EventFilter | undefined;
1958
- event: string;
1959
- source: string;
1960
1999
  };
1961
- }, {
1962
2000
  properties?: {
1963
- url?: string | undefined;
1964
2001
  label: string;
1965
2002
  text: string;
2003
+ url?: string | undefined;
1966
2004
  }[] | undefined;
2005
+ }, {
1967
2006
  type: "static";
1968
- title: string;
2007
+ title: (string | string[]) & (string | string[] | undefined);
1969
2008
  rule: {
2009
+ event: (string | string[]) & (string | string[] | undefined);
2010
+ source: string;
1970
2011
  payload?: EventFilter | undefined;
1971
2012
  context?: EventFilter | undefined;
1972
- event: string;
1973
- source: string;
1974
2013
  };
2014
+ properties?: {
2015
+ label: string;
2016
+ text: string;
2017
+ url?: string | undefined;
2018
+ }[] | undefined;
1975
2019
  }>, z.ZodObject<{
1976
2020
  type: z.ZodLiteral<"scheduled">;
1977
2021
  schedule: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -1985,17 +2029,17 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
1985
2029
  }>;
1986
2030
  metadata: z.ZodAny;
1987
2031
  }, "strip", z.ZodTypeAny, {
1988
- metadata?: any;
1989
2032
  options: {
1990
2033
  seconds: number;
1991
2034
  };
1992
2035
  type: "interval";
1993
- }, {
1994
2036
  metadata?: any;
2037
+ }, {
1995
2038
  options: {
1996
2039
  seconds: number;
1997
2040
  };
1998
2041
  type: "interval";
2042
+ metadata?: any;
1999
2043
  }>, z.ZodObject<{
2000
2044
  type: z.ZodLiteral<"cron">;
2001
2045
  options: z.ZodObject<{
@@ -2007,99 +2051,133 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
2007
2051
  }>;
2008
2052
  metadata: z.ZodAny;
2009
2053
  }, "strip", z.ZodTypeAny, {
2010
- metadata?: any;
2011
2054
  options: {
2012
2055
  cron: string;
2013
2056
  };
2014
2057
  type: "cron";
2015
- }, {
2016
2058
  metadata?: any;
2059
+ }, {
2017
2060
  options: {
2018
2061
  cron: string;
2019
2062
  };
2020
2063
  type: "cron";
2064
+ metadata?: any;
2021
2065
  }>]>;
2022
2066
  }, "strip", z.ZodTypeAny, {
2023
2067
  type: "scheduled";
2024
2068
  schedule: {
2025
- metadata?: any;
2026
2069
  options: {
2027
2070
  cron: string;
2028
2071
  };
2029
2072
  type: "cron";
2030
- } | {
2031
2073
  metadata?: any;
2074
+ } | {
2032
2075
  options: {
2033
2076
  seconds: number;
2034
2077
  };
2035
2078
  type: "interval";
2079
+ metadata?: any;
2036
2080
  };
2037
2081
  }, {
2038
2082
  type: "scheduled";
2039
2083
  schedule: {
2040
- metadata?: any;
2041
2084
  options: {
2042
2085
  cron: string;
2043
2086
  };
2044
2087
  type: "cron";
2045
- } | {
2046
2088
  metadata?: any;
2089
+ } | {
2047
2090
  options: {
2048
2091
  seconds: number;
2049
2092
  };
2050
2093
  type: "interval";
2094
+ metadata?: any;
2051
2095
  };
2052
2096
  }>]>>;
2053
- }, {
2097
+ retry: z.ZodOptional<z.ZodObject<{
2098
+ /** The maximum number of times to retry the request. */
2099
+ limit: z.ZodOptional<z.ZodNumber>;
2100
+ /** The exponential factor to use when calculating the next retry time. */
2101
+ factor: z.ZodOptional<z.ZodNumber>;
2102
+ /** The minimum amount of time to wait before retrying the request. */
2103
+ minTimeoutInMs: z.ZodOptional<z.ZodNumber>;
2104
+ /** The maximum amount of time to wait before retrying the request. */
2105
+ maxTimeoutInMs: z.ZodOptional<z.ZodNumber>;
2106
+ /** Whether to randomize the retry time. */
2107
+ randomize: z.ZodOptional<z.ZodBoolean>;
2108
+ }, "strip", z.ZodTypeAny, {
2109
+ limit?: number | undefined;
2110
+ factor?: number | undefined;
2111
+ minTimeoutInMs?: number | undefined;
2112
+ maxTimeoutInMs?: number | undefined;
2113
+ randomize?: boolean | undefined;
2114
+ }, {
2115
+ limit?: number | undefined;
2116
+ factor?: number | undefined;
2117
+ minTimeoutInMs?: number | undefined;
2118
+ maxTimeoutInMs?: number | undefined;
2119
+ randomize?: boolean | undefined;
2120
+ }>>;
2121
+ displayKey: z.ZodOptional<z.ZodString>;
2122
+ connectionKey: z.ZodOptional<z.ZodString>;
2123
+ redact: z.ZodOptional<z.ZodObject<{
2124
+ paths: z.ZodArray<z.ZodString, "many">;
2125
+ }, "strip", z.ZodTypeAny, {
2126
+ paths: string[];
2127
+ }, {
2128
+ paths: string[];
2129
+ }>>;
2054
2130
  idempotencyKey: z.ZodString;
2055
2131
  parentId: z.ZodOptional<z.ZodString>;
2056
- }>, "strip", z.ZodTypeAny, {
2132
+ }, "strip", z.ZodTypeAny, {
2133
+ name: string;
2134
+ noop: boolean;
2135
+ idempotencyKey: string;
2057
2136
  icon?: string | undefined;
2058
2137
  delayUntil?: Date | undefined;
2059
2138
  description?: string | undefined;
2060
2139
  params?: any;
2061
2140
  properties?: {
2062
- url?: string | undefined;
2063
2141
  label: string;
2064
2142
  text: string;
2143
+ url?: string | undefined;
2065
2144
  }[] | undefined;
2066
- parentId?: string | undefined;
2067
2145
  style?: {
2068
- variant?: string | undefined;
2069
2146
  style: "normal" | "minimal";
2147
+ variant?: string | undefined;
2070
2148
  } | undefined;
2071
2149
  operation?: "fetch" | undefined;
2072
2150
  trigger?: {
2073
2151
  id: string;
2074
2152
  type: "dynamic";
2075
2153
  } | {
2076
- properties?: {
2077
- url?: string | undefined;
2078
- label: string;
2079
- text: string;
2080
- }[] | undefined;
2081
2154
  type: "static";
2082
- title: string;
2155
+ title: (string | string[]) & (string | string[] | undefined);
2083
2156
  rule: {
2157
+ event: (string | string[]) & (string | string[] | undefined);
2158
+ source: string;
2084
2159
  payload?: EventFilter | undefined;
2085
2160
  context?: EventFilter | undefined;
2086
- event: string;
2087
- source: string;
2088
2161
  };
2162
+ properties?: {
2163
+ label: string;
2164
+ text: string;
2165
+ url?: string | undefined;
2166
+ }[] | undefined;
2089
2167
  } | {
2090
2168
  type: "scheduled";
2091
2169
  schedule: {
2092
- metadata?: any;
2093
2170
  options: {
2094
2171
  cron: string;
2095
2172
  };
2096
2173
  type: "cron";
2097
- } | {
2098
2174
  metadata?: any;
2175
+ } | {
2099
2176
  options: {
2100
2177
  seconds: number;
2101
2178
  };
2102
2179
  type: "interval";
2180
+ metadata?: any;
2103
2181
  };
2104
2182
  } | undefined;
2105
2183
  retry?: {
@@ -2114,57 +2192,56 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
2114
2192
  redact?: {
2115
2193
  paths: string[];
2116
2194
  } | undefined;
2195
+ parentId?: string | undefined;
2196
+ }, {
2117
2197
  name: string;
2118
- noop: boolean;
2119
2198
  idempotencyKey: string;
2120
- }, {
2121
2199
  icon?: string | undefined;
2122
2200
  noop?: boolean | undefined;
2123
2201
  delayUntil?: Date | undefined;
2124
2202
  description?: string | undefined;
2125
2203
  params?: any;
2126
2204
  properties?: {
2127
- url?: string | undefined;
2128
2205
  label: string;
2129
2206
  text: string;
2207
+ url?: string | undefined;
2130
2208
  }[] | undefined;
2131
- parentId?: string | undefined;
2132
2209
  style?: {
2133
- variant?: string | undefined;
2134
2210
  style: "normal" | "minimal";
2211
+ variant?: string | undefined;
2135
2212
  } | undefined;
2136
2213
  operation?: "fetch" | undefined;
2137
2214
  trigger?: {
2138
2215
  id: string;
2139
2216
  type: "dynamic";
2140
2217
  } | {
2141
- properties?: {
2142
- url?: string | undefined;
2143
- label: string;
2144
- text: string;
2145
- }[] | undefined;
2146
2218
  type: "static";
2147
- title: string;
2219
+ title: (string | string[]) & (string | string[] | undefined);
2148
2220
  rule: {
2221
+ event: (string | string[]) & (string | string[] | undefined);
2222
+ source: string;
2149
2223
  payload?: EventFilter | undefined;
2150
2224
  context?: EventFilter | undefined;
2151
- event: string;
2152
- source: string;
2153
2225
  };
2226
+ properties?: {
2227
+ label: string;
2228
+ text: string;
2229
+ url?: string | undefined;
2230
+ }[] | undefined;
2154
2231
  } | {
2155
2232
  type: "scheduled";
2156
2233
  schedule: {
2157
- metadata?: any;
2158
2234
  options: {
2159
2235
  cron: string;
2160
2236
  };
2161
2237
  type: "cron";
2162
- } | {
2163
2238
  metadata?: any;
2239
+ } | {
2164
2240
  options: {
2165
2241
  seconds: number;
2166
2242
  };
2167
2243
  type: "interval";
2244
+ metadata?: any;
2168
2245
  };
2169
2246
  } | undefined;
2170
2247
  retry?: {
@@ -2179,289 +2256,77 @@ declare const RunTaskBodyInputSchema: z.ZodObject<z.extendShape<{
2179
2256
  redact?: {
2180
2257
  paths: string[];
2181
2258
  } | undefined;
2182
- name: string;
2183
- idempotencyKey: string;
2259
+ parentId?: string | undefined;
2184
2260
  }>;
2185
2261
  type RunTaskBodyInput = z.infer<typeof RunTaskBodyInputSchema>;
2186
- declare const CompleteTaskBodyInputSchema: z.ZodObject<z.extendShape<Pick<z.extendShape<{
2187
- /** The name of the Task is required. This is displayed on the Task in the logs. */
2188
- name: z.ZodString;
2189
- /** The Task will wait and only start at the specified Date */
2190
- delayUntil: z.ZodOptional<z.ZodDate>;
2191
- /** Retry options */
2192
- retry: z.ZodOptional<z.ZodObject<{
2193
- /** The maximum number of times to retry the request. */
2194
- limit: z.ZodOptional<z.ZodNumber>;
2195
- /** The exponential factor to use when calculating the next retry time. */
2196
- factor: z.ZodOptional<z.ZodNumber>;
2197
- /** The minimum amount of time to wait before retrying the request. */
2198
- minTimeoutInMs: z.ZodOptional<z.ZodNumber>;
2199
- /** The maximum amount of time to wait before retrying the request. */
2200
- maxTimeoutInMs: z.ZodOptional<z.ZodNumber>;
2201
- /** Whether to randomize the retry time. */
2202
- randomize: z.ZodOptional<z.ZodBoolean>;
2203
- }, "strip", z.ZodTypeAny, {
2204
- limit?: number | undefined;
2205
- factor?: number | undefined;
2206
- minTimeoutInMs?: number | undefined;
2207
- maxTimeoutInMs?: number | undefined;
2208
- randomize?: boolean | undefined;
2209
- }, {
2210
- limit?: number | undefined;
2211
- factor?: number | undefined;
2212
- minTimeoutInMs?: number | undefined;
2213
- maxTimeoutInMs?: number | undefined;
2214
- randomize?: boolean | undefined;
2215
- }>>;
2216
- /** The icon for the Task, it will appear in the logs.
2217
- * You can use the name of a company in lowercase, e.g. "github".
2218
- * Or any icon name that [Font Awesome](https://fontawesome.com/icons) supports. */
2219
- icon: z.ZodOptional<z.ZodString>;
2220
- /** The key for the Task that you want to appear in the logs */
2221
- displayKey: z.ZodOptional<z.ZodString>;
2222
- /** A description of the Task */
2262
+ declare const CompleteTaskBodyInputSchema: z.ZodObject<{
2223
2263
  description: z.ZodOptional<z.ZodString>;
2224
- /** Properties that are displayed in the logs */
2264
+ params: z.ZodAny;
2225
2265
  properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
2226
2266
  label: z.ZodString;
2227
2267
  text: z.ZodString;
2228
2268
  url: z.ZodOptional<z.ZodString>;
2229
2269
  }, "strip", z.ZodTypeAny, {
2230
- url?: string | undefined;
2231
2270
  label: string;
2232
2271
  text: string;
2233
- }, {
2234
2272
  url?: string | undefined;
2273
+ }, {
2235
2274
  label: string;
2236
2275
  text: string;
2276
+ url?: string | undefined;
2237
2277
  }>, "many">>;
2238
- /** The input params to the Task, will be displayed in the logs */
2239
- params: z.ZodAny;
2240
- /** The style of the log entry. */
2241
- style: z.ZodOptional<z.ZodObject<{
2242
- style: z.ZodEnum<["normal", "minimal"]>;
2243
- variant: z.ZodOptional<z.ZodString>;
2244
- }, "strip", z.ZodTypeAny, {
2245
- variant?: string | undefined;
2246
- style: "normal" | "minimal";
2247
- }, {
2248
- variant?: string | undefined;
2249
- style: "normal" | "minimal";
2250
- }>>;
2251
- /** Allows you to link the Integration connection in the logs. This is handled automatically in integrations. */
2252
- connectionKey: z.ZodOptional<z.ZodString>;
2253
- /** An operation you want to perform on the Trigger.dev platform, current only "fetch" is supported. If you wish to `fetch` use [`io.backgroundFetch()`](https://trigger.dev/docs/sdk/io/backgroundfetch) instead. */
2254
- operation: z.ZodOptional<z.ZodEnum<["fetch"]>>;
2255
- /** 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). */
2256
- noop: z.ZodDefault<z.ZodBoolean>;
2257
- redact: z.ZodOptional<z.ZodObject<{
2258
- paths: z.ZodArray<z.ZodString, "many">;
2259
- }, "strip", z.ZodTypeAny, {
2260
- paths: string[];
2261
- }, {
2262
- paths: string[];
2263
- }>>;
2264
- trigger: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2265
- type: z.ZodLiteral<"dynamic">;
2266
- id: z.ZodString;
2267
- }, "strip", z.ZodTypeAny, {
2268
- id: string;
2269
- type: "dynamic";
2270
- }, {
2271
- id: string;
2272
- type: "dynamic";
2273
- }>, z.ZodObject<{
2274
- type: z.ZodLiteral<"static">;
2275
- title: z.ZodString;
2276
- properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
2277
- label: z.ZodString;
2278
- text: z.ZodString;
2279
- url: z.ZodOptional<z.ZodString>;
2280
- }, "strip", z.ZodTypeAny, {
2281
- url?: string | undefined;
2282
- label: string;
2283
- text: string;
2284
- }, {
2285
- url?: string | undefined;
2286
- label: string;
2287
- text: string;
2288
- }>, "many">>;
2289
- rule: z.ZodObject<{
2290
- event: z.ZodString;
2291
- source: z.ZodString;
2292
- payload: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
2293
- context: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
2294
- }, "strip", z.ZodTypeAny, {
2295
- payload?: EventFilter | undefined;
2296
- context?: EventFilter | undefined;
2297
- event: string;
2298
- source: string;
2299
- }, {
2300
- payload?: EventFilter | undefined;
2301
- context?: EventFilter | undefined;
2302
- event: string;
2303
- source: string;
2304
- }>;
2305
- }, "strip", z.ZodTypeAny, {
2306
- properties?: {
2307
- url?: string | undefined;
2308
- label: string;
2309
- text: string;
2310
- }[] | undefined;
2311
- type: "static";
2312
- title: string;
2313
- rule: {
2314
- payload?: EventFilter | undefined;
2315
- context?: EventFilter | undefined;
2316
- event: string;
2317
- source: string;
2318
- };
2319
- }, {
2320
- properties?: {
2321
- url?: string | undefined;
2322
- label: string;
2323
- text: string;
2324
- }[] | undefined;
2325
- type: "static";
2326
- title: string;
2327
- rule: {
2328
- payload?: EventFilter | undefined;
2329
- context?: EventFilter | undefined;
2330
- event: string;
2331
- source: string;
2332
- };
2333
- }>, z.ZodObject<{
2334
- type: z.ZodLiteral<"scheduled">;
2335
- schedule: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2336
- type: z.ZodLiteral<"interval">;
2337
- options: z.ZodObject<{
2338
- seconds: z.ZodNumber;
2339
- }, "strip", z.ZodTypeAny, {
2340
- seconds: number;
2341
- }, {
2342
- seconds: number;
2343
- }>;
2344
- metadata: z.ZodAny;
2345
- }, "strip", z.ZodTypeAny, {
2346
- metadata?: any;
2347
- options: {
2348
- seconds: number;
2349
- };
2350
- type: "interval";
2351
- }, {
2352
- metadata?: any;
2353
- options: {
2354
- seconds: number;
2355
- };
2356
- type: "interval";
2357
- }>, z.ZodObject<{
2358
- type: z.ZodLiteral<"cron">;
2359
- options: z.ZodObject<{
2360
- cron: z.ZodString;
2361
- }, "strip", z.ZodTypeAny, {
2362
- cron: string;
2363
- }, {
2364
- cron: string;
2365
- }>;
2366
- metadata: z.ZodAny;
2367
- }, "strip", z.ZodTypeAny, {
2368
- metadata?: any;
2369
- options: {
2370
- cron: string;
2371
- };
2372
- type: "cron";
2373
- }, {
2374
- metadata?: any;
2375
- options: {
2376
- cron: string;
2377
- };
2378
- type: "cron";
2379
- }>]>;
2380
- }, "strip", z.ZodTypeAny, {
2381
- type: "scheduled";
2382
- schedule: {
2383
- metadata?: any;
2384
- options: {
2385
- cron: string;
2386
- };
2387
- type: "cron";
2388
- } | {
2389
- metadata?: any;
2390
- options: {
2391
- seconds: number;
2392
- };
2393
- type: "interval";
2394
- };
2395
- }, {
2396
- type: "scheduled";
2397
- schedule: {
2398
- metadata?: any;
2399
- options: {
2400
- cron: string;
2401
- };
2402
- type: "cron";
2403
- } | {
2404
- metadata?: any;
2405
- options: {
2406
- seconds: number;
2407
- };
2408
- type: "interval";
2409
- };
2410
- }>]>>;
2411
- }, {
2412
- idempotencyKey: z.ZodString;
2413
- parentId: z.ZodOptional<z.ZodString>;
2414
- }>, "description" | "params" | "properties">, {
2415
2278
  output: z.ZodEffects<z.ZodOptional<z.ZodType<SerializableJson, z.ZodTypeDef, SerializableJson>>, string | number | boolean | {
2416
2279
  [key: string]: DeserializedJson;
2417
2280
  } | DeserializedJson[] | null, SerializableJson>;
2418
- }>, "strip", z.ZodTypeAny, {
2281
+ }, "strip", z.ZodTypeAny, {
2282
+ output: ((string | number | boolean | {
2283
+ [key: string]: DeserializedJson;
2284
+ } | DeserializedJson[]) & (string | number | boolean | {
2285
+ [key: string]: DeserializedJson;
2286
+ } | DeserializedJson[] | undefined)) | null;
2419
2287
  description?: string | undefined;
2420
2288
  params?: any;
2421
2289
  properties?: {
2422
- url?: string | undefined;
2423
2290
  label: string;
2424
2291
  text: string;
2292
+ url?: string | undefined;
2425
2293
  }[] | undefined;
2426
- output: string | number | boolean | {
2427
- [key: string]: DeserializedJson;
2428
- } | DeserializedJson[] | null;
2429
2294
  }, {
2430
2295
  description?: string | undefined;
2431
2296
  params?: any;
2432
2297
  properties?: {
2433
- url?: string | undefined;
2434
2298
  label: string;
2435
2299
  text: string;
2300
+ url?: string | undefined;
2436
2301
  }[] | undefined;
2437
2302
  output?: SerializableJson;
2438
2303
  }>;
2439
- type CompleteTaskBodyInput = z.input<typeof CompleteTaskBodyInputSchema>;
2304
+ type CompleteTaskBodyInput = Prettify<z.input<typeof CompleteTaskBodyInputSchema>>;
2440
2305
  declare const FailTaskBodyInputSchema: z.ZodObject<{
2441
2306
  error: z.ZodObject<{
2442
2307
  message: z.ZodString;
2443
2308
  name: z.ZodOptional<z.ZodString>;
2444
2309
  stack: z.ZodOptional<z.ZodString>;
2445
2310
  }, "strip", z.ZodTypeAny, {
2311
+ message: string;
2446
2312
  name?: string | undefined;
2447
2313
  stack?: string | undefined;
2448
- message: string;
2449
2314
  }, {
2315
+ message: string;
2450
2316
  name?: string | undefined;
2451
2317
  stack?: string | undefined;
2452
- message: string;
2453
2318
  }>;
2454
2319
  }, "strip", z.ZodTypeAny, {
2455
2320
  error: {
2321
+ message: string;
2456
2322
  name?: string | undefined;
2457
2323
  stack?: string | undefined;
2458
- message: string;
2459
2324
  };
2460
2325
  }, {
2461
2326
  error: {
2327
+ message: string;
2462
2328
  name?: string | undefined;
2463
2329
  stack?: string | undefined;
2464
- message: string;
2465
2330
  };
2466
2331
  }>;
2467
2332
  type FailTaskBodyInput = z.infer<typeof FailTaskBodyInputSchema>;
@@ -2472,17 +2337,17 @@ declare const NormalizedRequestSchema: z.ZodObject<{
2472
2337
  url: z.ZodString;
2473
2338
  body: z.ZodAny;
2474
2339
  }, "strip", z.ZodTypeAny, {
2475
- body?: any;
2476
2340
  url: string;
2477
2341
  method: string;
2478
2342
  headers: Record<string, string>;
2479
2343
  query: Record<string, string>;
2480
- }, {
2481
2344
  body?: any;
2345
+ }, {
2482
2346
  url: string;
2483
2347
  method: string;
2484
2348
  headers: Record<string, string>;
2485
2349
  query: Record<string, string>;
2350
+ body?: any;
2486
2351
  }>;
2487
2352
  type NormalizedRequest = z.infer<typeof NormalizedRequestSchema>;
2488
2353
  declare const NormalizedResponseSchema: z.ZodObject<{
@@ -2490,31 +2355,31 @@ declare const NormalizedResponseSchema: z.ZodObject<{
2490
2355
  body: z.ZodAny;
2491
2356
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2492
2357
  }, "strip", z.ZodTypeAny, {
2493
- headers?: Record<string, string> | undefined;
2494
- body?: any;
2495
2358
  status: number;
2496
- }, {
2497
- headers?: Record<string, string> | undefined;
2498
2359
  body?: any;
2360
+ headers?: Record<string, string> | undefined;
2361
+ }, {
2499
2362
  status: number;
2363
+ body?: any;
2364
+ headers?: Record<string, string> | undefined;
2500
2365
  }>;
2501
2366
  type NormalizedResponse = z.infer<typeof NormalizedResponseSchema>;
2502
2367
  declare const RegisterTriggerBodySchema: z.ZodObject<{
2503
2368
  rule: z.ZodObject<{
2504
- event: z.ZodString;
2369
+ event: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
2505
2370
  source: z.ZodString;
2506
2371
  payload: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
2507
2372
  context: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
2508
2373
  }, "strip", z.ZodTypeAny, {
2374
+ event: (string | string[]) & (string | string[] | undefined);
2375
+ source: string;
2509
2376
  payload?: EventFilter | undefined;
2510
2377
  context?: EventFilter | undefined;
2511
- event: string;
2512
- source: string;
2513
2378
  }, {
2379
+ event: (string | string[]) & (string | string[] | undefined);
2380
+ source: string;
2514
2381
  payload?: EventFilter | undefined;
2515
2382
  context?: EventFilter | undefined;
2516
- event: string;
2517
- source: string;
2518
2383
  }>;
2519
2384
  source: z.ZodObject<{
2520
2385
  channel: z.ZodEnum<["HTTP", "SQS", "SMTP"]>;
@@ -2525,107 +2390,133 @@ declare const RegisterTriggerBodySchema: z.ZodObject<{
2525
2390
  name: z.ZodString;
2526
2391
  instructions: z.ZodOptional<z.ZodString>;
2527
2392
  }, "strip", z.ZodTypeAny, {
2528
- instructions?: string | undefined;
2529
2393
  id: string;
2530
2394
  name: string;
2531
- }, {
2532
2395
  instructions?: string | undefined;
2396
+ }, {
2533
2397
  id: string;
2534
2398
  name: string;
2399
+ instructions?: string | undefined;
2535
2400
  }>;
2536
2401
  authSource: z.ZodEnum<["HOSTED", "LOCAL"]>;
2537
2402
  }, "strip", z.ZodTypeAny, {
2538
2403
  id: string;
2539
2404
  metadata: {
2540
- instructions?: string | undefined;
2541
2405
  id: string;
2542
2406
  name: string;
2407
+ instructions?: string | undefined;
2543
2408
  };
2544
2409
  authSource: "HOSTED" | "LOCAL";
2545
2410
  }, {
2546
2411
  id: string;
2547
2412
  metadata: {
2548
- instructions?: string | undefined;
2549
2413
  id: string;
2550
2414
  name: string;
2415
+ instructions?: string | undefined;
2551
2416
  };
2552
2417
  authSource: "HOSTED" | "LOCAL";
2553
2418
  }>;
2554
2419
  key: z.ZodString;
2555
2420
  params: z.ZodAny;
2556
2421
  events: z.ZodArray<z.ZodString, "many">;
2422
+ registerSourceJob: z.ZodOptional<z.ZodObject<{
2423
+ id: z.ZodString;
2424
+ version: z.ZodString;
2425
+ }, "strip", z.ZodTypeAny, {
2426
+ id: string;
2427
+ version: string;
2428
+ }, {
2429
+ id: string;
2430
+ version: string;
2431
+ }>>;
2557
2432
  }, "strip", z.ZodTypeAny, {
2558
- params?: any;
2559
2433
  key: string;
2560
2434
  channel: "HTTP" | "SMTP" | "SQS";
2561
2435
  events: string[];
2562
2436
  integration: {
2563
2437
  id: string;
2564
2438
  metadata: {
2565
- instructions?: string | undefined;
2566
2439
  id: string;
2567
2440
  name: string;
2441
+ instructions?: string | undefined;
2568
2442
  };
2569
2443
  authSource: "HOSTED" | "LOCAL";
2570
2444
  };
2571
- }, {
2572
2445
  params?: any;
2446
+ registerSourceJob?: {
2447
+ id: string;
2448
+ version: string;
2449
+ } | undefined;
2450
+ }, {
2573
2451
  key: string;
2574
2452
  channel: "HTTP" | "SMTP" | "SQS";
2575
2453
  events: string[];
2576
2454
  integration: {
2577
2455
  id: string;
2578
2456
  metadata: {
2579
- instructions?: string | undefined;
2580
2457
  id: string;
2581
2458
  name: string;
2459
+ instructions?: string | undefined;
2582
2460
  };
2583
2461
  authSource: "HOSTED" | "LOCAL";
2584
2462
  };
2463
+ params?: any;
2464
+ registerSourceJob?: {
2465
+ id: string;
2466
+ version: string;
2467
+ } | undefined;
2585
2468
  }>;
2586
2469
  }, "strip", z.ZodTypeAny, {
2587
2470
  source: {
2588
- params?: any;
2589
2471
  key: string;
2590
2472
  channel: "HTTP" | "SMTP" | "SQS";
2591
2473
  events: string[];
2592
2474
  integration: {
2593
2475
  id: string;
2594
2476
  metadata: {
2595
- instructions?: string | undefined;
2596
2477
  id: string;
2597
2478
  name: string;
2479
+ instructions?: string | undefined;
2598
2480
  };
2599
2481
  authSource: "HOSTED" | "LOCAL";
2600
2482
  };
2483
+ params?: any;
2484
+ registerSourceJob?: {
2485
+ id: string;
2486
+ version: string;
2487
+ } | undefined;
2601
2488
  };
2602
2489
  rule: {
2490
+ event: (string | string[]) & (string | string[] | undefined);
2491
+ source: string;
2603
2492
  payload?: EventFilter | undefined;
2604
2493
  context?: EventFilter | undefined;
2605
- event: string;
2606
- source: string;
2607
2494
  };
2608
2495
  }, {
2609
2496
  source: {
2610
- params?: any;
2611
2497
  key: string;
2612
2498
  channel: "HTTP" | "SMTP" | "SQS";
2613
2499
  events: string[];
2614
2500
  integration: {
2615
2501
  id: string;
2616
2502
  metadata: {
2617
- instructions?: string | undefined;
2618
2503
  id: string;
2619
2504
  name: string;
2505
+ instructions?: string | undefined;
2620
2506
  };
2621
2507
  authSource: "HOSTED" | "LOCAL";
2622
2508
  };
2509
+ params?: any;
2510
+ registerSourceJob?: {
2511
+ id: string;
2512
+ version: string;
2513
+ } | undefined;
2623
2514
  };
2624
2515
  rule: {
2516
+ event: (string | string[]) & (string | string[] | undefined);
2517
+ source: string;
2625
2518
  payload?: EventFilter | undefined;
2626
2519
  context?: EventFilter | undefined;
2627
- event: string;
2628
- source: string;
2629
2520
  };
2630
2521
  }>;
2631
2522
  type RegisterTriggerBody = z.infer<typeof RegisterTriggerBodySchema>;
@@ -2641,64 +2532,64 @@ declare const TriggerMetadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2641
2532
  type: "dynamic";
2642
2533
  }>, z.ZodObject<{
2643
2534
  type: z.ZodLiteral<"static">;
2644
- title: z.ZodString;
2535
+ title: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
2645
2536
  properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
2646
2537
  label: z.ZodString;
2647
2538
  text: z.ZodString;
2648
2539
  url: z.ZodOptional<z.ZodString>;
2649
2540
  }, "strip", z.ZodTypeAny, {
2650
- url?: string | undefined;
2651
2541
  label: string;
2652
2542
  text: string;
2653
- }, {
2654
2543
  url?: string | undefined;
2544
+ }, {
2655
2545
  label: string;
2656
2546
  text: string;
2547
+ url?: string | undefined;
2657
2548
  }>, "many">>;
2658
2549
  rule: z.ZodObject<{
2659
- event: z.ZodString;
2550
+ event: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
2660
2551
  source: z.ZodString;
2661
2552
  payload: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
2662
2553
  context: z.ZodOptional<z.ZodType<EventFilter, z.ZodTypeDef, EventFilter>>;
2663
2554
  }, "strip", z.ZodTypeAny, {
2555
+ event: (string | string[]) & (string | string[] | undefined);
2556
+ source: string;
2664
2557
  payload?: EventFilter | undefined;
2665
2558
  context?: EventFilter | undefined;
2666
- event: string;
2667
- source: string;
2668
2559
  }, {
2560
+ event: (string | string[]) & (string | string[] | undefined);
2561
+ source: string;
2669
2562
  payload?: EventFilter | undefined;
2670
2563
  context?: EventFilter | undefined;
2671
- event: string;
2672
- source: string;
2673
2564
  }>;
2674
2565
  }, "strip", z.ZodTypeAny, {
2675
- properties?: {
2676
- url?: string | undefined;
2677
- label: string;
2678
- text: string;
2679
- }[] | undefined;
2680
2566
  type: "static";
2681
- title: string;
2567
+ title: (string | string[]) & (string | string[] | undefined);
2682
2568
  rule: {
2569
+ event: (string | string[]) & (string | string[] | undefined);
2570
+ source: string;
2683
2571
  payload?: EventFilter | undefined;
2684
2572
  context?: EventFilter | undefined;
2685
- event: string;
2686
- source: string;
2687
2573
  };
2688
- }, {
2689
2574
  properties?: {
2690
- url?: string | undefined;
2691
2575
  label: string;
2692
2576
  text: string;
2577
+ url?: string | undefined;
2693
2578
  }[] | undefined;
2579
+ }, {
2694
2580
  type: "static";
2695
- title: string;
2581
+ title: (string | string[]) & (string | string[] | undefined);
2696
2582
  rule: {
2583
+ event: (string | string[]) & (string | string[] | undefined);
2584
+ source: string;
2697
2585
  payload?: EventFilter | undefined;
2698
2586
  context?: EventFilter | undefined;
2699
- event: string;
2700
- source: string;
2701
2587
  };
2588
+ properties?: {
2589
+ label: string;
2590
+ text: string;
2591
+ url?: string | undefined;
2592
+ }[] | undefined;
2702
2593
  }>, z.ZodObject<{
2703
2594
  type: z.ZodLiteral<"scheduled">;
2704
2595
  schedule: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
@@ -2712,17 +2603,17 @@ declare const TriggerMetadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2712
2603
  }>;
2713
2604
  metadata: z.ZodAny;
2714
2605
  }, "strip", z.ZodTypeAny, {
2715
- metadata?: any;
2716
2606
  options: {
2717
2607
  seconds: number;
2718
2608
  };
2719
2609
  type: "interval";
2720
- }, {
2721
2610
  metadata?: any;
2611
+ }, {
2722
2612
  options: {
2723
2613
  seconds: number;
2724
2614
  };
2725
2615
  type: "interval";
2616
+ metadata?: any;
2726
2617
  }>, z.ZodObject<{
2727
2618
  type: z.ZodLiteral<"cron">;
2728
2619
  options: z.ZodObject<{
@@ -2734,47 +2625,47 @@ declare const TriggerMetadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
2734
2625
  }>;
2735
2626
  metadata: z.ZodAny;
2736
2627
  }, "strip", z.ZodTypeAny, {
2737
- metadata?: any;
2738
2628
  options: {
2739
2629
  cron: string;
2740
2630
  };
2741
2631
  type: "cron";
2742
- }, {
2743
2632
  metadata?: any;
2633
+ }, {
2744
2634
  options: {
2745
2635
  cron: string;
2746
2636
  };
2747
2637
  type: "cron";
2638
+ metadata?: any;
2748
2639
  }>]>;
2749
2640
  }, "strip", z.ZodTypeAny, {
2750
2641
  type: "scheduled";
2751
2642
  schedule: {
2752
- metadata?: any;
2753
2643
  options: {
2754
2644
  cron: string;
2755
2645
  };
2756
2646
  type: "cron";
2757
- } | {
2758
2647
  metadata?: any;
2648
+ } | {
2759
2649
  options: {
2760
2650
  seconds: number;
2761
2651
  };
2762
2652
  type: "interval";
2653
+ metadata?: any;
2763
2654
  };
2764
2655
  }, {
2765
2656
  type: "scheduled";
2766
2657
  schedule: {
2767
- metadata?: any;
2768
2658
  options: {
2769
2659
  cron: string;
2770
2660
  };
2771
2661
  type: "cron";
2772
- } | {
2773
2662
  metadata?: any;
2663
+ } | {
2774
2664
  options: {
2775
2665
  seconds: number;
2776
2666
  };
2777
2667
  type: "interval";
2668
+ metadata?: any;
2778
2669
  };
2779
2670
  }>]>;
2780
2671
  type TriggerMetadata = z.infer<typeof TriggerMetadataSchema>;
@@ -2784,13 +2675,13 @@ declare const ErrorWithStackSchema: z.ZodObject<{
2784
2675
  name: z.ZodOptional<z.ZodString>;
2785
2676
  stack: z.ZodOptional<z.ZodString>;
2786
2677
  }, "strip", z.ZodTypeAny, {
2678
+ message: string;
2787
2679
  name?: string | undefined;
2788
2680
  stack?: string | undefined;
2789
- message: string;
2790
2681
  }, {
2682
+ message: string;
2791
2683
  name?: string | undefined;
2792
2684
  stack?: string | undefined;
2793
- message: string;
2794
2685
  }>;
2795
2686
  type ErrorWithStack = z.infer<typeof ErrorWithStackSchema>;
2796
2687
 
@@ -2803,13 +2694,13 @@ declare const DisplayPropertySchema: z.ZodObject<{
2803
2694
  /** The URL to link to when the property is clicked */
2804
2695
  url: z.ZodOptional<z.ZodString>;
2805
2696
  }, "strip", z.ZodTypeAny, {
2806
- url?: string | undefined;
2807
2697
  label: string;
2808
2698
  text: string;
2809
- }, {
2810
2699
  url?: string | undefined;
2700
+ }, {
2811
2701
  label: string;
2812
2702
  text: string;
2703
+ url?: string | undefined;
2813
2704
  }>;
2814
2705
  type DisplayProperty = z.infer<typeof DisplayPropertySchema>;
2815
2706
 
@@ -2819,15 +2710,15 @@ declare const ConnectionAuthSchema: z.ZodObject<{
2819
2710
  scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2820
2711
  additionalFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2821
2712
  }, "strip", z.ZodTypeAny, {
2822
- scopes?: string[] | undefined;
2823
- additionalFields?: Record<string, string> | undefined;
2824
2713
  type: "oauth2";
2825
2714
  accessToken: string;
2826
- }, {
2827
2715
  scopes?: string[] | undefined;
2828
2716
  additionalFields?: Record<string, string> | undefined;
2717
+ }, {
2829
2718
  type: "oauth2";
2830
2719
  accessToken: string;
2720
+ scopes?: string[] | undefined;
2721
+ additionalFields?: Record<string, string> | undefined;
2831
2722
  }>;
2832
2723
  type ConnectionAuth = z.infer<typeof ConnectionAuthSchema>;
2833
2724
  declare const IntegrationMetadataSchema: z.ZodObject<{
@@ -2835,13 +2726,13 @@ declare const IntegrationMetadataSchema: z.ZodObject<{
2835
2726
  name: z.ZodString;
2836
2727
  instructions: z.ZodOptional<z.ZodString>;
2837
2728
  }, "strip", z.ZodTypeAny, {
2838
- instructions?: string | undefined;
2839
2729
  id: string;
2840
2730
  name: string;
2841
- }, {
2842
2731
  instructions?: string | undefined;
2732
+ }, {
2843
2733
  id: string;
2844
2734
  name: string;
2735
+ instructions?: string | undefined;
2845
2736
  }>;
2846
2737
  type IntegrationMetadata = z.infer<typeof IntegrationMetadataSchema>;
2847
2738
  declare const IntegrationConfigSchema: z.ZodObject<{
@@ -2851,29 +2742,29 @@ declare const IntegrationConfigSchema: z.ZodObject<{
2851
2742
  name: z.ZodString;
2852
2743
  instructions: z.ZodOptional<z.ZodString>;
2853
2744
  }, "strip", z.ZodTypeAny, {
2854
- instructions?: string | undefined;
2855
2745
  id: string;
2856
2746
  name: string;
2857
- }, {
2858
2747
  instructions?: string | undefined;
2748
+ }, {
2859
2749
  id: string;
2860
2750
  name: string;
2751
+ instructions?: string | undefined;
2861
2752
  }>;
2862
2753
  authSource: z.ZodEnum<["HOSTED", "LOCAL"]>;
2863
2754
  }, "strip", z.ZodTypeAny, {
2864
2755
  id: string;
2865
2756
  metadata: {
2866
- instructions?: string | undefined;
2867
2757
  id: string;
2868
2758
  name: string;
2759
+ instructions?: string | undefined;
2869
2760
  };
2870
2761
  authSource: "HOSTED" | "LOCAL";
2871
2762
  }, {
2872
2763
  id: string;
2873
2764
  metadata: {
2874
- instructions?: string | undefined;
2875
2765
  id: string;
2876
2766
  name: string;
2767
+ instructions?: string | undefined;
2877
2768
  };
2878
2769
  authSource: "HOSTED" | "LOCAL";
2879
2770
  }>;
@@ -2883,11 +2774,11 @@ declare const ScheduledPayloadSchema: z.ZodObject<{
2883
2774
  ts: z.ZodDate;
2884
2775
  lastTimestamp: z.ZodOptional<z.ZodDate>;
2885
2776
  }, "strip", z.ZodTypeAny, {
2886
- lastTimestamp?: Date | undefined;
2887
2777
  ts: Date;
2888
- }, {
2889
2778
  lastTimestamp?: Date | undefined;
2779
+ }, {
2890
2780
  ts: Date;
2781
+ lastTimestamp?: Date | undefined;
2891
2782
  }>;
2892
2783
  type ScheduledPayload = z.infer<typeof ScheduledPayloadSchema>;
2893
2784
  declare const IntervalOptionsSchema: z.ZodObject<{
@@ -2910,6 +2801,7 @@ declare const CronOptionsSchema: z.ZodObject<{
2910
2801
  }, {
2911
2802
  cron: string;
2912
2803
  }>;
2804
+ /** The options for a `cronTrigger()` */
2913
2805
  type CronOptions = z.infer<typeof CronOptionsSchema>;
2914
2806
  declare const ScheduleMetadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2915
2807
  /** An interval reoccurs at the specified number of seconds */
@@ -2926,17 +2818,17 @@ declare const ScheduleMetadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
2926
2818
  /** Any additional metadata about the schedule. */
2927
2819
  metadata: z.ZodAny;
2928
2820
  }, "strip", z.ZodTypeAny, {
2929
- metadata?: any;
2930
2821
  options: {
2931
2822
  seconds: number;
2932
2823
  };
2933
2824
  type: "interval";
2934
- }, {
2935
2825
  metadata?: any;
2826
+ }, {
2936
2827
  options: {
2937
2828
  seconds: number;
2938
2829
  };
2939
2830
  type: "interval";
2831
+ metadata?: any;
2940
2832
  }>, z.ZodObject<{
2941
2833
  type: z.ZodLiteral<"cron">;
2942
2834
  options: z.ZodObject<{
@@ -2951,21 +2843,21 @@ declare const ScheduleMetadataSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObje
2951
2843
  }>;
2952
2844
  metadata: z.ZodAny;
2953
2845
  }, "strip", z.ZodTypeAny, {
2954
- metadata?: any;
2955
2846
  options: {
2956
2847
  cron: string;
2957
2848
  };
2958
2849
  type: "cron";
2959
- }, {
2960
2850
  metadata?: any;
2851
+ }, {
2961
2852
  options: {
2962
2853
  cron: string;
2963
2854
  };
2964
2855
  type: "cron";
2856
+ metadata?: any;
2965
2857
  }>]>;
2966
2858
  type ScheduleMetadata = z.infer<typeof ScheduleMetadataSchema>;
2967
2859
 
2968
- declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.extendShape<{
2860
+ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
2969
2861
  id: z.ZodString;
2970
2862
  client: z.ZodObject<{
2971
2863
  id: z.ZodString;
@@ -2987,9 +2879,8 @@ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnio
2987
2879
  updatedAt: Date;
2988
2880
  }>;
2989
2881
  authorizationUrl: z.ZodString;
2990
- }, {
2991
2882
  type: z.ZodLiteral<"DEVELOPER">;
2992
- }>, "strip", z.ZodTypeAny, {
2883
+ }, "strip", z.ZodTypeAny, {
2993
2884
  id: string;
2994
2885
  type: "DEVELOPER";
2995
2886
  client: {
@@ -3011,7 +2902,7 @@ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnio
3011
2902
  updatedAt: Date;
3012
2903
  };
3013
2904
  authorizationUrl: string;
3014
- }>, z.ZodObject<z.extendShape<{
2905
+ }>, z.ZodObject<{
3015
2906
  id: z.ZodString;
3016
2907
  client: z.ZodObject<{
3017
2908
  id: z.ZodString;
@@ -3033,24 +2924,23 @@ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnio
3033
2924
  updatedAt: Date;
3034
2925
  }>;
3035
2926
  authorizationUrl: z.ZodString;
3036
- }, {
3037
2927
  type: z.ZodLiteral<"EXTERNAL">;
3038
2928
  account: z.ZodObject<{
3039
2929
  id: z.ZodString;
3040
2930
  metadata: z.ZodAny;
3041
2931
  }, "strip", z.ZodTypeAny, {
3042
- metadata?: any;
3043
2932
  id: string;
3044
- }, {
3045
2933
  metadata?: any;
2934
+ }, {
3046
2935
  id: string;
2936
+ metadata?: any;
3047
2937
  }>;
3048
- }>, "strip", z.ZodTypeAny, {
2938
+ }, "strip", z.ZodTypeAny, {
3049
2939
  id: string;
3050
2940
  type: "EXTERNAL";
3051
2941
  account: {
3052
- metadata?: any;
3053
2942
  id: string;
2943
+ metadata?: any;
3054
2944
  };
3055
2945
  client: {
3056
2946
  id: string;
@@ -3064,8 +2954,8 @@ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnio
3064
2954
  id: string;
3065
2955
  type: "EXTERNAL";
3066
2956
  account: {
3067
- metadata?: any;
3068
2957
  id: string;
2958
+ metadata?: any;
3069
2959
  };
3070
2960
  client: {
3071
2961
  id: string;
@@ -3077,7 +2967,7 @@ declare const MissingConnectionNotificationPayloadSchema: z.ZodDiscriminatedUnio
3077
2967
  authorizationUrl: string;
3078
2968
  }>]>;
3079
2969
  type MissingConnectionNotificationPayload = z.infer<typeof MissingConnectionNotificationPayloadSchema>;
3080
- declare const MissingConnectionResolvedNotificationPayloadSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<z.extendShape<{
2970
+ declare const MissingConnectionResolvedNotificationPayloadSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3081
2971
  id: z.ZodString;
3082
2972
  client: z.ZodObject<{
3083
2973
  id: z.ZodString;
@@ -3105,9 +2995,8 @@ declare const MissingConnectionResolvedNotificationPayloadSchema: z.ZodDiscrimin
3105
2995
  integrationAuthMethod: string;
3106
2996
  }>;
3107
2997
  expiresAt: z.ZodDate;
3108
- }, {
3109
2998
  type: z.ZodLiteral<"DEVELOPER">;
3110
- }>, "strip", z.ZodTypeAny, {
2999
+ }, "strip", z.ZodTypeAny, {
3111
3000
  id: string;
3112
3001
  type: "DEVELOPER";
3113
3002
  client: {
@@ -3133,7 +3022,7 @@ declare const MissingConnectionResolvedNotificationPayloadSchema: z.ZodDiscrimin
3133
3022
  integrationAuthMethod: string;
3134
3023
  };
3135
3024
  expiresAt: Date;
3136
- }>, z.ZodObject<z.extendShape<{
3025
+ }>, z.ZodObject<{
3137
3026
  id: z.ZodString;
3138
3027
  client: z.ZodObject<{
3139
3028
  id: z.ZodString;
@@ -3161,24 +3050,23 @@ declare const MissingConnectionResolvedNotificationPayloadSchema: z.ZodDiscrimin
3161
3050
  integrationAuthMethod: string;
3162
3051
  }>;
3163
3052
  expiresAt: z.ZodDate;
3164
- }, {
3165
3053
  type: z.ZodLiteral<"EXTERNAL">;
3166
3054
  account: z.ZodObject<{
3167
3055
  id: z.ZodString;
3168
3056
  metadata: z.ZodAny;
3169
3057
  }, "strip", z.ZodTypeAny, {
3170
- metadata?: any;
3171
3058
  id: string;
3172
- }, {
3173
3059
  metadata?: any;
3060
+ }, {
3174
3061
  id: string;
3062
+ metadata?: any;
3175
3063
  }>;
3176
- }>, "strip", z.ZodTypeAny, {
3064
+ }, "strip", z.ZodTypeAny, {
3177
3065
  id: string;
3178
3066
  type: "EXTERNAL";
3179
3067
  account: {
3180
- metadata?: any;
3181
3068
  id: string;
3069
+ metadata?: any;
3182
3070
  };
3183
3071
  client: {
3184
3072
  id: string;
@@ -3194,8 +3082,8 @@ declare const MissingConnectionResolvedNotificationPayloadSchema: z.ZodDiscrimin
3194
3082
  id: string;
3195
3083
  type: "EXTERNAL";
3196
3084
  account: {
3197
- metadata?: any;
3198
3085
  id: string;
3086
+ metadata?: any;
3199
3087
  };
3200
3088
  client: {
3201
3089
  id: string;
@@ -3268,29 +3156,27 @@ declare const FetchRetryOptionsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminat
3268
3156
  limitHeader: string;
3269
3157
  remainingHeader: string;
3270
3158
  resetHeader: string;
3271
- }>, z.ZodObject<z.extendShape<{
3159
+ }>, z.ZodObject<{
3272
3160
  limit: z.ZodOptional<z.ZodNumber>;
3273
3161
  factor: z.ZodOptional<z.ZodNumber>;
3274
3162
  minTimeoutInMs: z.ZodOptional<z.ZodNumber>;
3275
3163
  maxTimeoutInMs: z.ZodOptional<z.ZodNumber>;
3276
3164
  randomize: z.ZodOptional<z.ZodBoolean>;
3277
- }, {
3278
- /** The `backoff` strategy retries the request with an exponential backoff. */
3279
3165
  strategy: z.ZodLiteral<"backoff">;
3280
- }>, "strip", z.ZodTypeAny, {
3166
+ }, "strip", z.ZodTypeAny, {
3167
+ strategy: "backoff";
3281
3168
  limit?: number | undefined;
3282
3169
  factor?: number | undefined;
3283
3170
  minTimeoutInMs?: number | undefined;
3284
3171
  maxTimeoutInMs?: number | undefined;
3285
3172
  randomize?: boolean | undefined;
3286
- strategy: "backoff";
3287
3173
  }, {
3174
+ strategy: "backoff";
3288
3175
  limit?: number | undefined;
3289
3176
  factor?: number | undefined;
3290
3177
  minTimeoutInMs?: number | undefined;
3291
3178
  maxTimeoutInMs?: number | undefined;
3292
3179
  randomize?: boolean | undefined;
3293
- strategy: "backoff";
3294
3180
  }>]>>;
3295
3181
  /** An object where the key is a status code pattern and the value is a retrying strategy. Supported patterns are:
3296
3182
  - Specific status codes: 429
@@ -3299,9 +3185,36 @@ declare const FetchRetryOptionsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminat
3299
3185
  */
3300
3186
  type FetchRetryOptions = z.infer<typeof FetchRetryOptionsSchema>;
3301
3187
 
3302
- type Prettify<T> = {
3303
- [K in keyof T]: T[K];
3304
- } & {};
3188
+ declare const GetRunOptionsWithTaskDetailsSchema: ZodObject<{
3189
+ subtasks: z.ZodOptional<z.ZodBoolean>;
3190
+ cursor: z.ZodOptional<z.ZodString>;
3191
+ take: z.ZodOptional<z.ZodNumber>;
3192
+ taskdetails: z.ZodOptional<z.ZodBoolean>;
3193
+ }, "strip", z.ZodTypeAny, {
3194
+ subtasks?: boolean | undefined;
3195
+ cursor?: string | undefined;
3196
+ take?: number | undefined;
3197
+ taskdetails?: boolean | undefined;
3198
+ }, {
3199
+ subtasks?: boolean | undefined;
3200
+ cursor?: string | undefined;
3201
+ take?: number | undefined;
3202
+ taskdetails?: boolean | undefined;
3203
+ }>;
3204
+ type GetRunOptionsWithTaskDetails = z.infer<typeof GetRunOptionsWithTaskDetailsSchema>;
3205
+ declare const GetRunsOptionsSchema: ZodObject<{
3206
+ /** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */
3207
+ cursor: z.ZodOptional<z.ZodString>;
3208
+ /** How many runs you want to return in one go, max 50. @default 20 */
3209
+ take: z.ZodOptional<z.ZodNumber>;
3210
+ }, "strip", z.ZodTypeAny, {
3211
+ cursor?: string | undefined;
3212
+ take?: number | undefined;
3213
+ }, {
3214
+ cursor?: string | undefined;
3215
+ take?: number | undefined;
3216
+ }>;
3217
+ type GetRunsOptions = z.infer<typeof GetRunsOptionsSchema>;
3305
3218
 
3306
3219
  type ApiClientOptions = {
3307
3220
  apiKey?: string;
@@ -3330,6 +3243,12 @@ declare class ApiClient {
3330
3243
  ok: false;
3331
3244
  }>;
3332
3245
  runTask(runId: string, task: RunTaskBodyInput): Promise<{
3246
+ id: string;
3247
+ name: string;
3248
+ noop: boolean;
3249
+ status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
3250
+ idempotencyKey: string;
3251
+ attempts: number;
3333
3252
  icon?: string | null | undefined;
3334
3253
  startedAt?: Date | null | undefined;
3335
3254
  completedAt?: Date | null | undefined;
@@ -3337,26 +3256,31 @@ declare class ApiClient {
3337
3256
  description?: string | null | undefined;
3338
3257
  params?: DeserializedJson | undefined;
3339
3258
  properties?: {
3259
+ label: string;
3260
+ text: string;
3340
3261
  url?: string | undefined;
3262
+ }[] | null | undefined;
3263
+ outputProperties?: {
3341
3264
  label: string;
3342
3265
  text: string;
3266
+ url?: string | undefined;
3343
3267
  }[] | null | undefined;
3344
3268
  output?: DeserializedJson | undefined;
3345
3269
  error?: string | null | undefined;
3346
3270
  parentId?: string | null | undefined;
3347
3271
  style?: {
3348
- variant?: string | undefined;
3349
3272
  style: "normal" | "minimal";
3273
+ variant?: string | undefined;
3350
3274
  } | null | undefined;
3351
3275
  operation?: string | null | undefined;
3276
+ }>;
3277
+ completeTask(runId: string, id: string, task: CompleteTaskBodyInput): Promise<{
3352
3278
  id: string;
3353
3279
  name: string;
3354
3280
  noop: boolean;
3355
- status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED";
3281
+ status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
3356
3282
  idempotencyKey: string;
3357
3283
  attempts: number;
3358
- }>;
3359
- completeTask(runId: string, id: string, task: CompleteTaskBodyInput): Promise<{
3360
3284
  icon?: string | null | undefined;
3361
3285
  startedAt?: Date | null | undefined;
3362
3286
  completedAt?: Date | null | undefined;
@@ -3364,26 +3288,31 @@ declare class ApiClient {
3364
3288
  description?: string | null | undefined;
3365
3289
  params?: DeserializedJson | undefined;
3366
3290
  properties?: {
3291
+ label: string;
3292
+ text: string;
3367
3293
  url?: string | undefined;
3294
+ }[] | null | undefined;
3295
+ outputProperties?: {
3368
3296
  label: string;
3369
3297
  text: string;
3298
+ url?: string | undefined;
3370
3299
  }[] | null | undefined;
3371
3300
  output?: DeserializedJson | undefined;
3372
3301
  error?: string | null | undefined;
3373
3302
  parentId?: string | null | undefined;
3374
3303
  style?: {
3375
- variant?: string | undefined;
3376
3304
  style: "normal" | "minimal";
3305
+ variant?: string | undefined;
3377
3306
  } | null | undefined;
3378
3307
  operation?: string | null | undefined;
3308
+ }>;
3309
+ failTask(runId: string, id: string, body: FailTaskBodyInput): Promise<{
3379
3310
  id: string;
3380
3311
  name: string;
3381
3312
  noop: boolean;
3382
- status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED";
3313
+ status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
3383
3314
  idempotencyKey: string;
3384
3315
  attempts: number;
3385
- }>;
3386
- failTask(runId: string, id: string, body: FailTaskBodyInput): Promise<{
3387
3316
  icon?: string | null | undefined;
3388
3317
  startedAt?: Date | null | undefined;
3389
3318
  completedAt?: Date | null | undefined;
@@ -3391,96 +3320,147 @@ declare class ApiClient {
3391
3320
  description?: string | null | undefined;
3392
3321
  params?: DeserializedJson | undefined;
3393
3322
  properties?: {
3323
+ label: string;
3324
+ text: string;
3394
3325
  url?: string | undefined;
3326
+ }[] | null | undefined;
3327
+ outputProperties?: {
3395
3328
  label: string;
3396
3329
  text: string;
3330
+ url?: string | undefined;
3397
3331
  }[] | null | undefined;
3398
3332
  output?: DeserializedJson | undefined;
3399
3333
  error?: string | null | undefined;
3400
3334
  parentId?: string | null | undefined;
3401
3335
  style?: {
3402
- variant?: string | undefined;
3403
3336
  style: "normal" | "minimal";
3337
+ variant?: string | undefined;
3404
3338
  } | null | undefined;
3405
3339
  operation?: string | null | undefined;
3406
- id: string;
3407
- name: string;
3408
- noop: boolean;
3409
- status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED";
3410
- idempotencyKey: string;
3411
- attempts: number;
3412
3340
  }>;
3413
3341
  sendEvent(event: SendEvent, options?: SendEventOptions): Promise<{
3414
- context?: DeserializedJson | undefined;
3415
- deliverAt?: Date | null | undefined;
3416
- deliveredAt?: Date | null | undefined;
3417
3342
  id: string;
3418
3343
  name: string;
3419
- payload: DeserializedJson;
3344
+ payload: ((string | number | boolean | {
3345
+ [key: string]: DeserializedJson;
3346
+ } | DeserializedJson[]) & (string | number | boolean | {
3347
+ [key: string]: DeserializedJson;
3348
+ } | DeserializedJson[] | undefined)) | null;
3420
3349
  timestamp: Date;
3350
+ context?: DeserializedJson | undefined;
3351
+ deliverAt?: Date | null | undefined;
3352
+ deliveredAt?: Date | null | undefined;
3421
3353
  }>;
3422
3354
  updateSource(client: string, key: string, source: UpdateTriggerSourceBody): Promise<TriggerSource>;
3423
3355
  registerTrigger(client: string, id: string, key: string, payload: RegisterTriggerBody): Promise<RegisterSourceEvent>;
3424
3356
  registerSchedule(client: string, id: string, key: string, payload: ScheduleMetadata): Promise<{
3425
- metadata?: any;
3426
3357
  id: string;
3427
3358
  schedule: {
3428
- metadata?: any;
3429
3359
  options: {
3430
3360
  cron: string;
3431
3361
  };
3432
3362
  type: "cron";
3433
- } | {
3434
3363
  metadata?: any;
3364
+ } | {
3435
3365
  options: {
3436
3366
  seconds: number;
3437
3367
  };
3438
3368
  type: "interval";
3369
+ metadata?: any;
3439
3370
  };
3440
3371
  active: boolean;
3372
+ metadata?: any;
3441
3373
  }>;
3442
3374
  unregisterSchedule(client: string, id: string, key: string): Promise<{
3443
3375
  ok: boolean;
3444
3376
  }>;
3445
3377
  getAuth(client: string, id: string): Promise<{
3446
- scopes?: string[] | undefined;
3447
- additionalFields?: Record<string, string> | undefined;
3448
3378
  type: "oauth2";
3449
3379
  accessToken: string;
3380
+ scopes?: string[] | undefined;
3381
+ additionalFields?: Record<string, string> | undefined;
3450
3382
  } | undefined>;
3383
+ getEvent(eventId: string): Promise<{
3384
+ id: string;
3385
+ name: string;
3386
+ createdAt: Date;
3387
+ updatedAt: Date;
3388
+ runs: {
3389
+ id: string;
3390
+ status: "PENDING" | "CANCELED" | "SUCCESS" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "FAILURE" | "TIMED_OUT" | "ABORTED";
3391
+ startedAt?: Date | null | undefined;
3392
+ completedAt?: Date | null | undefined;
3393
+ }[];
3394
+ }>;
3395
+ getRun(runId: string, options?: GetRunOptionsWithTaskDetails): Promise<{
3396
+ id: string;
3397
+ startedAt: Date | null;
3398
+ completedAt: Date | null;
3399
+ status: "PENDING" | "CANCELED" | "SUCCESS" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "FAILURE" | "TIMED_OUT" | "ABORTED";
3400
+ tasks: {
3401
+ id: string;
3402
+ name: string;
3403
+ icon: string | null;
3404
+ startedAt: Date | null;
3405
+ completedAt: Date | null;
3406
+ status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
3407
+ displayKey: string | null;
3408
+ }[];
3409
+ updatedAt: Date | null;
3410
+ output?: any;
3411
+ nextCursor?: string | undefined;
3412
+ }>;
3413
+ getRuns(jobSlug: string, options?: GetRunsOptions): Promise<{
3414
+ runs: {
3415
+ id: string;
3416
+ startedAt: Date | null;
3417
+ completedAt: Date | null;
3418
+ status: "PENDING" | "CANCELED" | "SUCCESS" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "FAILURE" | "TIMED_OUT" | "ABORTED";
3419
+ updatedAt: Date | null;
3420
+ }[];
3421
+ nextCursor?: string | undefined;
3422
+ }>;
3451
3423
  }
3452
3424
 
3453
3425
  interface TriggerContext {
3426
+ /** Job metadata */
3454
3427
  job: {
3455
3428
  id: string;
3456
3429
  version: string;
3457
3430
  };
3431
+ /** Environment metadata */
3458
3432
  environment: {
3459
3433
  slug: string;
3460
3434
  id: string;
3461
3435
  type: RuntimeEnvironmentType;
3462
3436
  };
3437
+ /** Organization metadata */
3463
3438
  organization: {
3464
3439
  slug: string;
3465
3440
  id: string;
3466
3441
  title: string;
3467
3442
  };
3443
+ /** Run metadata */
3468
3444
  run: {
3469
3445
  id: string;
3470
3446
  isTest: boolean;
3471
3447
  startedAt: Date;
3448
+ isRetry: boolean;
3472
3449
  };
3450
+ /** Event metadata */
3473
3451
  event: {
3474
3452
  id: string;
3475
3453
  name: string;
3476
3454
  context: any;
3477
3455
  timestamp: Date;
3478
3456
  };
3479
- account?: {
3457
+ /** Source metadata */
3458
+ source?: {
3480
3459
  id: string;
3481
3460
  metadata?: any;
3482
3461
  };
3483
- source?: {
3462
+ /** Account metadata */
3463
+ account?: {
3484
3464
  id: string;
3485
3465
  metadata?: any;
3486
3466
  };
@@ -3532,6 +3512,7 @@ interface Trigger<TEventSpec extends EventSpecification<any>> {
3532
3512
  attachToJob(triggerClient: TriggerClient, job: Job<Trigger<TEventSpec>, any>): void;
3533
3513
  preprocessRuns: boolean;
3534
3514
  }
3515
+ type TriggerPayload<TTrigger> = TTrigger extends Trigger<EventSpecification<infer TEvent>> ? TEvent : never;
3535
3516
  type EventSpecificationExample = {
3536
3517
  id: string;
3537
3518
  name: string;
@@ -3539,7 +3520,7 @@ type EventSpecificationExample = {
3539
3520
  payload: any;
3540
3521
  };
3541
3522
  interface EventSpecification<TEvent extends any> {
3542
- name: string;
3523
+ name: string | string[];
3543
3524
  title: string;
3544
3525
  source: string;
3545
3526
  icon: string;
@@ -3616,7 +3597,7 @@ type ExternalSourceOptions<TChannel extends ChannelNames, TIntegration extends T
3616
3597
  schema: z.Schema<TParams>;
3617
3598
  integration: TIntegration;
3618
3599
  register: RegisterFunction<TIntegration, TParams, TChannel>;
3619
- filter: FilterFunction<TParams>;
3600
+ filter?: FilterFunction<TParams>;
3620
3601
  handler: HandlerFunction<TChannel, TParams>;
3621
3602
  key: KeyFunction<TParams>;
3622
3603
  properties?: (params: TParams) => DisplayProperty[];
@@ -3627,40 +3608,42 @@ declare class ExternalSource<TIntegration extends TriggerIntegration<Integration
3627
3608
  constructor(channel: TChannel, options: ExternalSourceOptions<TChannel, TIntegration, TParams>);
3628
3609
  handle(source: HandleTriggerSource, rawEvent: ExternalSourceChannelMap[TChannel]["event"], logger: Logger): Promise<void | {
3629
3610
  events: {
3630
- id?: string | undefined;
3631
- source?: string | undefined;
3611
+ name: string;
3632
3612
  payload?: any;
3633
3613
  context?: any;
3614
+ id?: string | undefined;
3634
3615
  timestamp?: Date | undefined;
3635
- name: string;
3616
+ source?: string | undefined;
3636
3617
  }[];
3637
3618
  response?: {
3638
- headers?: Record<string, string> | undefined;
3639
- body?: any;
3640
3619
  status: number;
3620
+ body?: any;
3621
+ headers?: Record<string, string> | undefined;
3641
3622
  } | undefined;
3642
3623
  }>;
3643
3624
  filter(params: TParams): EventFilter;
3644
3625
  properties(params: TParams): DisplayProperty[];
3645
3626
  register(params: TParams, registerEvent: RegisterSourceEvent, io: IO, ctx: TriggerContext): Promise<{
3646
- data?: SerializableJson;
3647
- secret?: string | undefined;
3648
3627
  registeredEvents: string[];
3628
+ secret?: string | undefined;
3629
+ data?: SerializableJson;
3649
3630
  } | undefined>;
3650
3631
  key(params: TParams): string;
3651
3632
  get integration(): TIntegration;
3652
3633
  get integrationConfig(): {
3653
3634
  id: string;
3654
3635
  metadata: {
3655
- instructions?: string | undefined;
3656
3636
  id: string;
3657
3637
  name: string;
3638
+ instructions?: string | undefined;
3658
3639
  };
3659
3640
  };
3660
3641
  get id(): string;
3661
3642
  get version(): string;
3662
3643
  }
3663
- type ExternalSourceParams<TExternalSource extends ExternalSource<any, any, any>> = TExternalSource extends ExternalSource<any, infer TParams, any> ? TParams : never;
3644
+ type ExternalSourceParams<TExternalSource extends ExternalSource<any, any, any>> = TExternalSource extends ExternalSource<any, infer TParams, any> ? TParams & {
3645
+ filter?: EventFilter;
3646
+ } : never;
3664
3647
  type ExternalSourceTriggerOptions<TEventSpecification extends EventSpecification<any>, TEventSource extends ExternalSource<any, any, any>> = {
3665
3648
  event: TEventSpecification;
3666
3649
  source: TEventSource;
@@ -3679,19 +3662,43 @@ declare function omit<T extends Record<string, unknown>, K extends keyof T>(obj:
3679
3662
  ommited: T[K];
3680
3663
  };
3681
3664
 
3665
+ /** Options for a DynamicTrigger */
3682
3666
  type DynamicTriggerOptions<TEventSpec extends EventSpecification<any>, TExternalSource extends ExternalSource<any, any, any>> = {
3667
+ /** Used to uniquely identify a DynamicTrigger */
3683
3668
  id: string;
3669
+ /** An event from an [Integration](https://trigger.dev/docs/integrations) package that you want to attach to the DynamicTrigger. The event types will come through to the payload in your Job's run. */
3684
3670
  event: TEventSpec;
3671
+ /** An external source fron an [Integration](https://trigger.dev/docs/integrations) package
3672
+ * @example
3673
+ * ```ts
3674
+ * import { events } from "@trigger.dev/github";
3675
+ *
3676
+ * const dynamicOnIssueOpened = new DynamicTrigger(client, {
3677
+ id: "github-issue-opened",
3678
+ event: events.onIssueOpened,
3679
+ source: github.sources.repo,
3680
+ });
3681
+ * ```
3682
+ */
3685
3683
  source: TExternalSource;
3686
3684
  };
3685
+ /** `DynamicTrigger` allows you to define a trigger that can be configured dynamically at runtime. */
3687
3686
  declare class DynamicTrigger<TEventSpec extends EventSpecification<any>, TExternalSource extends ExternalSource<any, any, any>> implements Trigger<TEventSpec> {
3688
3687
  #private;
3689
3688
  source: TExternalSource;
3689
+ /** `DynamicTrigger` allows you to define a trigger that can be configured dynamically at runtime.
3690
+ * @param client The `TriggerClient` instance to use for registering the trigger.
3691
+ * @param options The options for the dynamic trigger.
3692
+ * */
3690
3693
  constructor(client: TriggerClient, options: DynamicTriggerOptions<TEventSpec, TExternalSource>);
3691
3694
  toJSON(): TriggerMetadata;
3692
3695
  get id(): string;
3693
3696
  get event(): TEventSpec;
3694
3697
  registeredTriggerForParams(params: ExternalSourceParams<TExternalSource>): RegisterTriggerBody;
3698
+ /** Use this method to register a new configuration with the DynamicTrigger.
3699
+ * @param key The key for the configuration. This will be used to identify the configuration when it is triggered.
3700
+ * @param params The params for the configuration.
3701
+ */
3695
3702
  register(key: string, params: ExternalSourceParams<TExternalSource>): Promise<RegisterSourceEvent>;
3696
3703
  attachToJob(triggerClient: TriggerClient, job: Job<Trigger<TEventSpec>, any>): void;
3697
3704
  get preprocessRuns(): boolean;
@@ -3733,12 +3740,8 @@ declare class TriggerClient {
3733
3740
  }): void;
3734
3741
  attachDynamicSchedule(key: string, job: Job<Trigger<any>, any>): void;
3735
3742
  registerTrigger(id: string, key: string, options: RegisterTriggerBody): Promise<{
3736
- dynamicTriggerId?: string | undefined;
3737
3743
  id: string;
3738
3744
  source: {
3739
- params?: any;
3740
- data?: DeserializedJson | undefined;
3741
- clientId?: string | undefined;
3742
3745
  key: string;
3743
3746
  secret: string;
3744
3747
  active: boolean;
@@ -3750,16 +3753,20 @@ declare class TriggerClient {
3750
3753
  } | {
3751
3754
  type: "SQS";
3752
3755
  };
3756
+ params?: any;
3757
+ data?: DeserializedJson | undefined;
3758
+ clientId?: string | undefined;
3753
3759
  };
3754
3760
  events: string[];
3755
3761
  missingEvents: string[];
3756
3762
  orphanedEvents: string[];
3763
+ dynamicTriggerId?: string | undefined;
3757
3764
  }>;
3758
3765
  getAuth(id: string): Promise<{
3759
- scopes?: string[] | undefined;
3760
- additionalFields?: Record<string, string> | undefined;
3761
3766
  type: "oauth2";
3762
3767
  accessToken: string;
3768
+ scopes?: string[] | undefined;
3769
+ additionalFields?: Record<string, string> | undefined;
3763
3770
  } | undefined>;
3764
3771
  /** You can call this function from anywhere in your code to send an event. The other way to send an event is by using [`io.sendEvent()`](https://trigger.dev/docs/sdk/io/sendevent) from inside a `run()` function.
3765
3772
  * @param event The event to send.
@@ -3767,37 +3774,82 @@ declare class TriggerClient {
3767
3774
  * @returns A promise that resolves to the event details
3768
3775
  */
3769
3776
  sendEvent(event: SendEvent, options?: SendEventOptions): Promise<{
3770
- context?: DeserializedJson | undefined;
3771
- deliverAt?: Date | null | undefined;
3772
- deliveredAt?: Date | null | undefined;
3773
3777
  id: string;
3774
3778
  name: string;
3775
- payload: DeserializedJson;
3779
+ payload: ((string | number | boolean | {
3780
+ [key: string]: DeserializedJson;
3781
+ } | DeserializedJson[]) & (string | number | boolean | {
3782
+ [key: string]: DeserializedJson;
3783
+ } | DeserializedJson[] | undefined)) | null;
3776
3784
  timestamp: Date;
3785
+ context?: DeserializedJson | undefined;
3786
+ deliverAt?: Date | null | undefined;
3787
+ deliveredAt?: Date | null | undefined;
3777
3788
  }>;
3778
3789
  registerSchedule(id: string, key: string, schedule: ScheduleMetadata): Promise<{
3779
- metadata?: any;
3780
3790
  id: string;
3781
3791
  schedule: {
3782
- metadata?: any;
3783
3792
  options: {
3784
3793
  cron: string;
3785
3794
  };
3786
3795
  type: "cron";
3787
- } | {
3788
3796
  metadata?: any;
3797
+ } | {
3789
3798
  options: {
3790
3799
  seconds: number;
3791
3800
  };
3792
3801
  type: "interval";
3802
+ metadata?: any;
3793
3803
  };
3794
3804
  active: boolean;
3805
+ metadata?: any;
3795
3806
  }>;
3796
3807
  unregisterSchedule(id: string, key: string): Promise<{
3797
3808
  ok: boolean;
3798
3809
  }>;
3810
+ getEvent(eventId: string): Promise<{
3811
+ id: string;
3812
+ name: string;
3813
+ createdAt: Date;
3814
+ updatedAt: Date;
3815
+ runs: {
3816
+ id: string;
3817
+ status: "PENDING" | "CANCELED" | "SUCCESS" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "FAILURE" | "TIMED_OUT" | "ABORTED";
3818
+ startedAt?: Date | null | undefined;
3819
+ completedAt?: Date | null | undefined;
3820
+ }[];
3821
+ }>;
3822
+ getRun(runId: string, options?: GetRunOptionsWithTaskDetails): Promise<{
3823
+ id: string;
3824
+ startedAt: Date | null;
3825
+ completedAt: Date | null;
3826
+ status: "PENDING" | "CANCELED" | "SUCCESS" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "FAILURE" | "TIMED_OUT" | "ABORTED";
3827
+ tasks: {
3828
+ id: string;
3829
+ name: string;
3830
+ icon: string | null;
3831
+ startedAt: Date | null;
3832
+ completedAt: Date | null;
3833
+ status: "PENDING" | "WAITING" | "RUNNING" | "COMPLETED" | "ERRORED" | "CANCELED";
3834
+ displayKey: string | null;
3835
+ }[];
3836
+ updatedAt: Date | null;
3837
+ output?: any;
3838
+ nextCursor?: string | undefined;
3839
+ }>;
3840
+ getRuns(jobSlug: string, options?: GetRunsOptions): Promise<{
3841
+ runs: {
3842
+ id: string;
3843
+ startedAt: Date | null;
3844
+ completedAt: Date | null;
3845
+ status: "PENDING" | "CANCELED" | "SUCCESS" | "QUEUED" | "WAITING_ON_CONNECTIONS" | "PREPROCESSING" | "STARTED" | "FAILURE" | "TIMED_OUT" | "ABORTED";
3846
+ updatedAt: Date | null;
3847
+ }[];
3848
+ nextCursor?: string | undefined;
3849
+ }>;
3799
3850
  authorized(apiKey?: string | null): "authorized" | "unauthorized" | "missing-client" | "missing-header";
3800
3851
  apiKey(): string | undefined;
3852
+ defineJob<TTrigger extends Trigger<EventSpecification<any>>, TIntegrations extends Record<string, TriggerIntegration<IntegrationClient<any, any>>> = {}>(options: JobOptions<TTrigger, TIntegrations>): Job<TTrigger, TIntegrations>;
3801
3853
  }
3802
3854
 
3803
3855
  type ScheduledEventSpecification = EventSpecification<ScheduledPayload>;
@@ -3819,8 +3871,8 @@ declare class IntervalTrigger implements Trigger<ScheduledEventSpecification> {
3819
3871
  };
3820
3872
  }[];
3821
3873
  parsePayload: (data: unknown, params?: Partial<zod.ParseParams> | undefined) => {
3822
- lastTimestamp?: Date | undefined;
3823
3874
  ts: Date;
3875
+ lastTimestamp?: Date | undefined;
3824
3876
  };
3825
3877
  properties: {
3826
3878
  label: string;
@@ -3831,6 +3883,9 @@ declare class IntervalTrigger implements Trigger<ScheduledEventSpecification> {
3831
3883
  get preprocessRuns(): boolean;
3832
3884
  toJSON(): TriggerMetadata;
3833
3885
  }
3886
+ /** `intervalTrigger()` is set as a [Job's trigger](/sdk/job) to trigger a Job at a recurring interval.
3887
+ * @param options An object containing options about the interval.
3888
+ */
3834
3889
  declare function intervalTrigger(options: IntervalOptions): IntervalTrigger;
3835
3890
  declare class CronTrigger implements Trigger<ScheduledEventSpecification> {
3836
3891
  private options;
@@ -3850,8 +3905,8 @@ declare class CronTrigger implements Trigger<ScheduledEventSpecification> {
3850
3905
  };
3851
3906
  }[];
3852
3907
  parsePayload: (data: unknown, params?: Partial<zod.ParseParams> | undefined) => {
3853
- lastTimestamp?: Date | undefined;
3854
3908
  ts: Date;
3909
+ lastTimestamp?: Date | undefined;
3855
3910
  };
3856
3911
  properties: {
3857
3912
  label: string;
@@ -3862,13 +3917,24 @@ declare class CronTrigger implements Trigger<ScheduledEventSpecification> {
3862
3917
  get preprocessRuns(): boolean;
3863
3918
  toJSON(): TriggerMetadata;
3864
3919
  }
3920
+ /** `cronTrigger()` is set as a [Job's trigger](https://trigger.dev/docs/sdk/job) to trigger a Job on a recurring schedule using a CRON expression.
3921
+ * @param options An object containing options about the CRON schedule.
3922
+ */
3865
3923
  declare function cronTrigger(options: CronOptions): CronTrigger;
3924
+ /** DynamicSchedule options
3925
+ * @param id Used to uniquely identify a DynamicSchedule
3926
+ */
3866
3927
  type DynamicIntervalOptions = {
3867
3928
  id: string;
3868
3929
  };
3930
+ /** DynamicSchedule` allows you to define a scheduled trigger that can be configured dynamically at runtime. */
3869
3931
  declare class DynamicSchedule implements Trigger<ScheduledEventSpecification> {
3870
3932
  private client;
3871
3933
  private options;
3934
+ /**
3935
+ * @param client The `TriggerClient` instance to use for registering the trigger.
3936
+ * @param options The options for the schedule.
3937
+ */
3872
3938
  constructor(client: TriggerClient, options: DynamicIntervalOptions);
3873
3939
  get id(): string;
3874
3940
  get event(): {
@@ -3886,27 +3952,27 @@ declare class DynamicSchedule implements Trigger<ScheduledEventSpecification> {
3886
3952
  };
3887
3953
  }[];
3888
3954
  parsePayload: (data: unknown, params?: Partial<zod.ParseParams> | undefined) => {
3889
- lastTimestamp?: Date | undefined;
3890
3955
  ts: Date;
3956
+ lastTimestamp?: Date | undefined;
3891
3957
  };
3892
3958
  };
3893
3959
  register(key: string, metadata: ScheduleMetadata): Promise<{
3894
- metadata?: any;
3895
3960
  id: string;
3896
3961
  schedule: {
3897
- metadata?: any;
3898
3962
  options: {
3899
3963
  cron: string;
3900
3964
  };
3901
3965
  type: "cron";
3902
- } | {
3903
3966
  metadata?: any;
3967
+ } | {
3904
3968
  options: {
3905
3969
  seconds: number;
3906
3970
  };
3907
3971
  type: "interval";
3972
+ metadata?: any;
3908
3973
  };
3909
3974
  active: boolean;
3975
+ metadata?: any;
3910
3976
  }>;
3911
3977
  unregister(key: string): Promise<{
3912
3978
  ok: boolean;
@@ -3965,13 +4031,17 @@ declare class IO {
3965
4031
  * @param options Options for sending the event.
3966
4032
  */
3967
4033
  sendEvent(key: string | any[], event: SendEvent, options?: SendEventOptions): Promise<{
3968
- context?: DeserializedJson | undefined;
3969
- deliverAt?: Date | null | undefined;
3970
- deliveredAt?: Date | null | undefined;
3971
4034
  id: string;
3972
4035
  name: string;
3973
- payload: DeserializedJson;
4036
+ payload: ((string | number | boolean | {
4037
+ [key: string]: DeserializedJson;
4038
+ } | DeserializedJson[]) & (string | number | boolean | {
4039
+ [key: string]: DeserializedJson;
4040
+ } | DeserializedJson[] | undefined)) | null;
3974
4041
  timestamp: Date;
4042
+ context?: DeserializedJson | undefined;
4043
+ deliverAt?: Date | null | undefined;
4044
+ deliveredAt?: Date | null | undefined;
3975
4045
  }>;
3976
4046
  updateSource(key: string | any[], options: {
3977
4047
  key: string;
@@ -3987,22 +4057,22 @@ declare class IO {
3987
4057
  * @returns A promise that has information about the interval.
3988
4058
  */
3989
4059
  registerInterval(key: string | any[], dynamicSchedule: DynamicSchedule, id: string, options: IntervalOptions): Promise<{
3990
- metadata?: any;
3991
4060
  id: string;
3992
4061
  schedule: {
3993
- metadata?: any;
3994
4062
  options: {
3995
4063
  cron: string;
3996
4064
  };
3997
4065
  type: "cron";
3998
- } | {
3999
4066
  metadata?: any;
4067
+ } | {
4000
4068
  options: {
4001
4069
  seconds: number;
4002
4070
  };
4003
4071
  type: "interval";
4072
+ metadata?: any;
4004
4073
  };
4005
4074
  active: boolean;
4075
+ metadata?: any;
4006
4076
  }>;
4007
4077
  /** `io.unregisterInterval()` allows you to unregister a [DynamicSchedule](https://trigger.dev/docs/sdk/dynamicschedule) that was previously registered with `io.registerInterval()`.
4008
4078
  * @param key Should be a stable and unique key inside the `run()`. See [resumability](https://trigger.dev/docs/documentation/concepts/resumability) for more information.
@@ -4019,22 +4089,22 @@ declare class IO {
4019
4089
  * @param options The options for the CRON schedule.
4020
4090
  */
4021
4091
  registerCron(key: string | any[], dynamicSchedule: DynamicSchedule, id: string, options: CronOptions): Promise<{
4022
- metadata?: any;
4023
4092
  id: string;
4024
4093
  schedule: {
4025
- metadata?: any;
4026
4094
  options: {
4027
4095
  cron: string;
4028
4096
  };
4029
4097
  type: "cron";
4030
- } | {
4031
4098
  metadata?: any;
4099
+ } | {
4032
4100
  options: {
4033
4101
  seconds: number;
4034
4102
  };
4035
4103
  type: "interval";
4104
+ metadata?: any;
4036
4105
  };
4037
4106
  active: boolean;
4107
+ metadata?: any;
4038
4108
  }>;
4039
4109
  /** `io.unregisterCron()` allows you to unregister a [DynamicSchedule](https://trigger.dev/docs/sdk/dynamicschedule) that was previously registered with `io.registerCron()`.
4040
4110
  * @param key Should be a stable and unique key inside the `run()`. See [resumability](https://trigger.dev/docs/documentation/concepts/resumability) for more information.
@@ -4067,7 +4137,7 @@ declare class IO {
4067
4137
  retryAt: Date;
4068
4138
  error?: Error;
4069
4139
  jitter?: number;
4070
- } | undefined | void): Promise<TResult>;
4140
+ } | Error | undefined | void): Promise<TResult>;
4071
4141
  /** `io.try()` allows you to run Tasks and catch any errors that are thrown, it's similar to a normal `try/catch` block but works with [io.runTask()](/sdk/io/runtask).
4072
4142
  * A regular `try/catch` block on its own won't work as expected with Tasks. Internally `runTask()` throws some special errors to control flow execution. This is necessary to deal with resumability, serverless timeouts, and retrying Tasks.
4073
4143
  * @param tryCallback The code you wish to run
@@ -4092,6 +4162,7 @@ declare class IOLogger implements TaskLogger {
4092
4162
  error(message: string, properties?: Record<string, any>): Promise<void>;
4093
4163
  }
4094
4164
 
4165
+ type IntegrationRunTaskFunction<TClient> = <TResult>(key: string | any[], callback: (client: TClient, task: IOTask, io: IO) => Promise<TResult>, options?: RunTaskOptions) => Promise<TResult>;
4095
4166
  type ClientFactory<TClient> = (auth: ConnectionAuth) => TClient;
4096
4167
  interface TriggerIntegration<TIntegrationClient extends IntegrationClient<any, any> = IntegrationClient<any, any>> {
4097
4168
  client: TIntegrationClient;
@@ -4114,7 +4185,7 @@ type AuthenticatedTask<TClient, TParams, TResult, TAuth = ConnectionAuth> = {
4114
4185
  onError?: (error: unknown, task: ServerTask) => {
4115
4186
  retryAt: Date;
4116
4187
  error?: Error;
4117
- } | undefined | void;
4188
+ } | Error | undefined | void;
4118
4189
  };
4119
4190
  declare function authenticatedTask<TClient, TParams, TResult>(options: {
4120
4191
  run: (params: TParams, client: TClient, task: ServerTask, io: IO) => Promise<TResult>;
@@ -4129,13 +4200,16 @@ type ExtractIntegrationClientClient<TIntegrationClient extends IntegrationClient
4129
4200
  client: infer TClient;
4130
4201
  } ? {
4131
4202
  client: TClient;
4203
+ runTask: IntegrationRunTaskFunction<TClient>;
4132
4204
  } : TIntegrationClient extends {
4133
4205
  usesLocalAuth: false;
4134
4206
  clientFactory: ClientFactory<infer TClient>;
4135
4207
  } ? {
4136
4208
  client: TClient;
4209
+ runTask: IntegrationRunTaskFunction<TClient>;
4137
4210
  } : never;
4138
4211
  type ExtractIntegrationClient<TIntegrationClient extends IntegrationClient<any, any>> = ExtractIntegrationClientClient<TIntegrationClient> & ExtractTasks<TIntegrationClient["tasks"]>;
4212
+ type IntegrationIO<TIntegration extends TriggerIntegration<IntegrationClient<any, any>>> = ExtractIntegrationClient<TIntegration["client"]>;
4139
4213
  type ExtractIntegrations<TIntegrations extends Record<string, TriggerIntegration<IntegrationClient<any, any>>>> = {
4140
4214
  [key in keyof TIntegrations]: ExtractIntegrationClient<TIntegrations[key]["client"]>;
4141
4215
  };
@@ -4161,7 +4235,7 @@ type JobOptions<TTrigger extends Trigger<EventSpecification<any>>, TIntegrations
4161
4235
  logLevel?: LogLevel;
4162
4236
  /** Imports the specified integrations into the Job. The integrations will be available on the `io` object in the `run()` function with the same name as the key. For example:
4163
4237
  ```ts
4164
- new Job(client, {
4238
+ client.defineJob({
4165
4239
  //... other options
4166
4240
  integrations: {
4167
4241
  slack,
@@ -4189,6 +4263,8 @@ type JobOptions<TTrigger extends Trigger<EventSpecification<any>>, TIntegrations
4189
4263
  */
4190
4264
  run: (payload: TriggerEventType<TTrigger>, io: IOWithIntegrations<TIntegrations>, context: TriggerContext) => Promise<any>;
4191
4265
  };
4266
+ type JobPayload<TJob> = TJob extends Job<Trigger<EventSpecification<infer TEvent>>, any> ? TEvent : never;
4267
+ type JobIO<TJob> = TJob extends Job<any, infer TIntegrations> ? IOWithIntegrations<TIntegrations> : never;
4192
4268
  /** A [Job](https://trigger.dev/docs/documentation/concepts/jobs) is used to define the [Trigger](https://trigger.dev/docs/documentation/concepts/triggers), metadata, and what happens when it runs. */
4193
4269
  declare class Job<TTrigger extends Trigger<EventSpecification<any>>, TIntegrations extends Record<string, TriggerIntegration<IntegrationClient<any, any>>> = {}> {
4194
4270
  #private;
@@ -4210,7 +4286,7 @@ declare class Job<TTrigger extends Trigger<EventSpecification<any>>, TIntegratio
4210
4286
 
4211
4287
  type EventTriggerOptions<TEventSpecification extends EventSpecification<any>> = {
4212
4288
  event: TEventSpecification;
4213
- name?: string;
4289
+ name?: string | string[];
4214
4290
  source?: string;
4215
4291
  filter?: EventFilter;
4216
4292
  };
@@ -4222,12 +4298,41 @@ declare class EventTrigger<TEventSpecification extends EventSpecification<any>>
4222
4298
  attachToJob(triggerClient: TriggerClient, job: Job<Trigger<TEventSpecification>, any>): void;
4223
4299
  get preprocessRuns(): boolean;
4224
4300
  }
4301
+ /** Configuration options for an EventTrigger */
4225
4302
  type TriggerOptions<TEvent> = {
4226
- name: string;
4303
+ /** The name of the event you are subscribing to. Must be an exact match (case sensitive). To trigger on multiple possible events, pass in an array of event names */
4304
+ name: string | string[];
4305
+ /** A [Zod](https://trigger.dev/docs/documentation/guides/zod) schema that defines the shape of the event payload.
4306
+ * The default is `z.any()` which is `any`.
4307
+ * */
4227
4308
  schema?: z.Schema<TEvent>;
4309
+ /** You can use this to filter events based on the source. */
4228
4310
  source?: string;
4311
+ /** Used to filter which events trigger the Job
4312
+ * @example
4313
+ * filter:
4314
+ * ```ts
4315
+ * {
4316
+ * name: ["John", "Jane"],
4317
+ * age: [18, 21]
4318
+ * }
4319
+ * ```
4320
+ *
4321
+ * This filter would match against an event with the following data:
4322
+ * ```json
4323
+ * {
4324
+ * "name": "Jane",
4325
+ * "age": 18,
4326
+ * "location": "San Francisco"
4327
+ * }
4328
+ * ```
4329
+ */
4229
4330
  filter?: EventFilter;
4331
+ examples?: EventSpecificationExample[];
4230
4332
  };
4333
+ /** `eventTrigger()` is set as a [Job's trigger](https://trigger.dev/docs/sdk/job) to subscribe to an event a Job from [a sent event](https://trigger.dev/docs/sdk/triggerclient/instancemethods/sendevent)
4334
+ * @param options options for the EventTrigger
4335
+ */
4231
4336
  declare function eventTrigger<TEvent extends any = any>(options: TriggerOptions<TEvent>): Trigger<EventSpecification<TEvent>>;
4232
4337
 
4233
4338
  declare function missingConnectionNotification(integrations: Array<TriggerIntegration>): MissingConnectionNotification;
@@ -4259,8 +4364,8 @@ declare class MissingConnectionNotification implements Trigger<MissingConnection
4259
4364
  id: string;
4260
4365
  type: "EXTERNAL";
4261
4366
  account: {
4262
- metadata?: any;
4263
4367
  id: string;
4368
+ metadata?: any;
4264
4369
  };
4265
4370
  client: {
4266
4371
  id: string;
@@ -4306,8 +4411,8 @@ declare class MissingConnectionResolvedNotification implements Trigger<MissingCo
4306
4411
  id: string;
4307
4412
  type: "EXTERNAL";
4308
4413
  account: {
4309
- metadata?: any;
4310
4414
  id: string;
4415
+ metadata?: any;
4311
4416
  };
4312
4417
  client: {
4313
4418
  id: string;
@@ -4340,15 +4445,21 @@ declare class RetryWithTaskError {
4340
4445
  retryAt: Date;
4341
4446
  constructor(cause: ErrorWithStack, task: ServerTask, retryAt: Date);
4342
4447
  }
4448
+ declare class CanceledWithTaskError {
4449
+ task: ServerTask;
4450
+ constructor(task: ServerTask);
4451
+ }
4343
4452
  /** Use this function if you're using a `try/catch` block to catch errors.
4344
4453
  * It checks if a thrown error is a special internal error that you should ignore.
4345
4454
  * If this returns `true` then you must rethrow the error: `throw err;`
4346
4455
  * @param err The error to check
4347
4456
  * @returns `true` if the error is a Trigger Error, `false` otherwise.
4348
4457
  */
4349
- declare function isTriggerError(err: unknown): err is ResumeWithTaskError | RetryWithTaskError;
4458
+ declare function isTriggerError(err: unknown): err is ResumeWithTaskError | RetryWithTaskError | CanceledWithTaskError;
4350
4459
 
4351
4460
  type Task = ServerTask;
4461
+
4462
+ type SentEvent = ApiEventLog;
4352
4463
  declare function redactString(strings: TemplateStringsArray, ...interpolations: string[]): RedactString;
4353
4464
 
4354
- export { AuthenticatedTask, ClientFactory, CronTrigger, DynamicIntervalOptions, DynamicSchedule, DynamicTrigger, DynamicTriggerOptions, EventFilter, EventSpecification, EventSpecificationExample, EventTrigger, EventTypeFromSpecification, ExternalSource, ExternalSourceParams, ExternalSourceTrigger, ExternalSourceTriggerOptions, HandlerEvent, HttpSourceEvent, IO, IOLogger, IOOptions, IOTask, IOWithIntegrations, IntegrationClient, IntervalTrigger, Job, JobOptions, Logger, MissingConnectionNotification, MissingConnectionResolvedNotification, NormalizedRequest, PreprocessResults, RedactString, Task, TaskLogger, Trigger, TriggerClient, TriggerClientOptions, TriggerContext, TriggerEventType, TriggerIntegration, TriggerPreprocessContext, authenticatedTask, cronTrigger, eventTrigger, intervalTrigger, isTriggerError, missingConnectionNotification, missingConnectionResolvedNotification, omit, redactString };
4465
+ export { AuthenticatedTask, ClientFactory, CronTrigger, DynamicIntervalOptions, DynamicSchedule, DynamicTrigger, DynamicTriggerOptions, EventFilter, EventSpecification, EventSpecificationExample, EventTrigger, EventTypeFromSpecification, ExternalSource, ExternalSourceParams, ExternalSourceTrigger, ExternalSourceTriggerOptions, HandlerEvent, HttpSourceEvent, IO, IOLogger, IOOptions, IOTask, IOWithIntegrations, IntegrationClient, IntegrationIO, IntervalTrigger, Job, JobIO, JobOptions, JobPayload, Logger, MissingConnectionNotification, MissingConnectionResolvedNotification, NormalizedRequest, PreprocessResults, RedactString, SentEvent, Task, TaskLogger, Trigger, TriggerClient, TriggerClientOptions, TriggerContext, TriggerEventType, TriggerIntegration, TriggerPayload, TriggerPreprocessContext, authenticatedTask, cronTrigger, eventTrigger, intervalTrigger, isTriggerError, missingConnectionNotification, missingConnectionResolvedNotification, omit, redactString };