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