@trigger.dev/core 0.0.0-isomorphic-sdk-20230918151405 → 0.0.0-prerelease-20230922203841
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +583 -154
- package/dist/index.js +474 -547
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -73,6 +73,7 @@ __export(src_exports, {
|
|
|
73
73
|
FetchRetryStrategySchema: () => FetchRetryStrategySchema,
|
|
74
74
|
GetEventSchema: () => GetEventSchema,
|
|
75
75
|
GetRunSchema: () => GetRunSchema,
|
|
76
|
+
GetRunStatusesSchema: () => GetRunStatusesSchema,
|
|
76
77
|
GetRunsSchema: () => GetRunsSchema,
|
|
77
78
|
HandleTriggerSourceSchema: () => HandleTriggerSourceSchema,
|
|
78
79
|
HttpSourceRequestHeadersSchema: () => HttpSourceRequestHeadersSchema,
|
|
@@ -86,6 +87,7 @@ __export(src_exports, {
|
|
|
86
87
|
IntervalMetadataSchema: () => IntervalMetadataSchema,
|
|
87
88
|
IntervalOptionsSchema: () => IntervalOptionsSchema,
|
|
88
89
|
JobMetadataSchema: () => JobMetadataSchema,
|
|
90
|
+
JobRunStatusRecordSchema: () => JobRunStatusRecordSchema,
|
|
89
91
|
LogMessageSchema: () => LogMessageSchema,
|
|
90
92
|
Logger: () => Logger,
|
|
91
93
|
MISSING_CONNECTION_NOTIFICATION: () => MISSING_CONNECTION_NOTIFICATION,
|
|
@@ -130,6 +132,7 @@ __export(src_exports, {
|
|
|
130
132
|
RunJobResumeWithTaskSchema: () => RunJobResumeWithTaskSchema,
|
|
131
133
|
RunJobRetryWithTaskSchema: () => RunJobRetryWithTaskSchema,
|
|
132
134
|
RunJobSuccessSchema: () => RunJobSuccessSchema,
|
|
135
|
+
RunJobUnresolvedAuthErrorSchema: () => RunJobUnresolvedAuthErrorSchema,
|
|
133
136
|
RunSourceContextSchema: () => RunSourceContextSchema,
|
|
134
137
|
RunStatusSchema: () => RunStatusSchema,
|
|
135
138
|
RunTaskBodyInputSchema: () => RunTaskBodyInputSchema,
|
|
@@ -147,6 +150,9 @@ __export(src_exports, {
|
|
|
147
150
|
ServerTaskSchema: () => ServerTaskSchema,
|
|
148
151
|
SourceMetadataV2Schema: () => SourceMetadataV2Schema,
|
|
149
152
|
StaticTriggerMetadataSchema: () => StaticTriggerMetadataSchema,
|
|
153
|
+
StatusHistorySchema: () => StatusHistorySchema,
|
|
154
|
+
StatusUpdateSchema: () => StatusUpdateSchema,
|
|
155
|
+
StatusUpdateStateSchema: () => StatusUpdateStateSchema,
|
|
150
156
|
StyleSchema: () => StyleSchema,
|
|
151
157
|
TaskSchema: () => TaskSchema,
|
|
152
158
|
TaskStatusSchema: () => TaskStatusSchema,
|
|
@@ -170,7 +176,6 @@ __export(src_exports, {
|
|
|
170
176
|
module.exports = __toCommonJS(src_exports);
|
|
171
177
|
|
|
172
178
|
// src/logger.ts
|
|
173
|
-
var import_node_buffer = require("buffer");
|
|
174
179
|
var logLevels = [
|
|
175
180
|
"log",
|
|
176
181
|
"error",
|
|
@@ -304,7 +309,7 @@ function prettyPrintBytes(value) {
|
|
|
304
309
|
if (process.env.NODE_ENV === "production") {
|
|
305
310
|
return "skipped size";
|
|
306
311
|
}
|
|
307
|
-
const sizeInBytes =
|
|
312
|
+
const sizeInBytes = Buffer.byteLength(JSON.stringify(value), "utf8");
|
|
308
313
|
if (sizeInBytes < 1024) {
|
|
309
314
|
return `${sizeInBytes} bytes`;
|
|
310
315
|
}
|
|
@@ -319,8 +324,8 @@ function prettyPrintBytes(value) {
|
|
|
319
324
|
__name(prettyPrintBytes, "prettyPrintBytes");
|
|
320
325
|
|
|
321
326
|
// src/schemas/api.ts
|
|
322
|
-
var
|
|
323
|
-
var
|
|
327
|
+
var import_ulid = require("ulid");
|
|
328
|
+
var import_zod11 = require("zod");
|
|
324
329
|
|
|
325
330
|
// src/schemas/addMissingVersionField.ts
|
|
326
331
|
function addMissingVersionField(val) {
|
|
@@ -423,7 +428,8 @@ var EventRuleSchema = import_zod2.z.object({
|
|
|
423
428
|
var import_zod3 = require("zod");
|
|
424
429
|
var ConnectionAuthSchema = import_zod3.z.object({
|
|
425
430
|
type: import_zod3.z.enum([
|
|
426
|
-
"oauth2"
|
|
431
|
+
"oauth2",
|
|
432
|
+
"apiKey"
|
|
427
433
|
]),
|
|
428
434
|
accessToken: import_zod3.z.string(),
|
|
429
435
|
scopes: import_zod3.z.array(import_zod3.z.string()).optional(),
|
|
@@ -439,7 +445,8 @@ var IntegrationConfigSchema = import_zod3.z.object({
|
|
|
439
445
|
metadata: IntegrationMetadataSchema,
|
|
440
446
|
authSource: import_zod3.z.enum([
|
|
441
447
|
"HOSTED",
|
|
442
|
-
"LOCAL"
|
|
448
|
+
"LOCAL",
|
|
449
|
+
"RESOLVER"
|
|
443
450
|
])
|
|
444
451
|
});
|
|
445
452
|
|
|
@@ -512,6 +519,8 @@ var CronOptionsSchema = import_zod6.z.object({
|
|
|
512
519
|
var CronMetadataSchema = import_zod6.z.object({
|
|
513
520
|
type: import_zod6.z.literal("cron"),
|
|
514
521
|
options: CronOptionsSchema,
|
|
522
|
+
/** An optional Account ID to associate with runs triggered by this interval */
|
|
523
|
+
accountId: import_zod6.z.string().optional(),
|
|
515
524
|
metadata: import_zod6.z.any()
|
|
516
525
|
});
|
|
517
526
|
var IntervalMetadataSchema = import_zod6.z.object({
|
|
@@ -519,6 +528,8 @@ var IntervalMetadataSchema = import_zod6.z.object({
|
|
|
519
528
|
type: import_zod6.z.literal("interval"),
|
|
520
529
|
/** An object containing options about the interval. */
|
|
521
530
|
options: IntervalOptionsSchema,
|
|
531
|
+
/** An optional Account ID to associate with runs triggered by this interval */
|
|
532
|
+
accountId: import_zod6.z.string().optional(),
|
|
522
533
|
/** Any additional metadata about the schedule. */
|
|
523
534
|
metadata: import_zod6.z.any()
|
|
524
535
|
});
|
|
@@ -617,456 +628,571 @@ var TriggerMetadataSchema = import_zod8.z.discriminatedUnion("type", [
|
|
|
617
628
|
ScheduledTriggerMetadataSchema
|
|
618
629
|
]);
|
|
619
630
|
|
|
631
|
+
// src/schemas/runs.ts
|
|
632
|
+
var import_zod10 = require("zod");
|
|
633
|
+
|
|
634
|
+
// src/schemas/statuses.ts
|
|
635
|
+
var import_zod9 = require("zod");
|
|
636
|
+
var StatusUpdateStateSchema = import_zod9.z.union([
|
|
637
|
+
import_zod9.z.literal("loading"),
|
|
638
|
+
import_zod9.z.literal("success"),
|
|
639
|
+
import_zod9.z.literal("failure")
|
|
640
|
+
]);
|
|
641
|
+
var StatusUpdateDataSchema = import_zod9.z.record(SerializableJsonSchema);
|
|
642
|
+
var StatusUpdateSchema = import_zod9.z.object({
|
|
643
|
+
label: import_zod9.z.string().optional(),
|
|
644
|
+
state: StatusUpdateStateSchema.optional(),
|
|
645
|
+
data: StatusUpdateDataSchema.optional()
|
|
646
|
+
});
|
|
647
|
+
var InitalStatusUpdateSchema = StatusUpdateSchema.required({
|
|
648
|
+
label: true
|
|
649
|
+
});
|
|
650
|
+
var StatusHistorySchema = import_zod9.z.array(StatusUpdateSchema);
|
|
651
|
+
var JobRunStatusRecordSchema = InitalStatusUpdateSchema.extend({
|
|
652
|
+
key: import_zod9.z.string(),
|
|
653
|
+
history: StatusHistorySchema
|
|
654
|
+
});
|
|
655
|
+
|
|
656
|
+
// src/schemas/runs.ts
|
|
657
|
+
var RunStatusSchema = import_zod10.z.union([
|
|
658
|
+
import_zod10.z.literal("PENDING"),
|
|
659
|
+
import_zod10.z.literal("QUEUED"),
|
|
660
|
+
import_zod10.z.literal("WAITING_ON_CONNECTIONS"),
|
|
661
|
+
import_zod10.z.literal("PREPROCESSING"),
|
|
662
|
+
import_zod10.z.literal("STARTED"),
|
|
663
|
+
import_zod10.z.literal("SUCCESS"),
|
|
664
|
+
import_zod10.z.literal("FAILURE"),
|
|
665
|
+
import_zod10.z.literal("TIMED_OUT"),
|
|
666
|
+
import_zod10.z.literal("ABORTED"),
|
|
667
|
+
import_zod10.z.literal("CANCELED"),
|
|
668
|
+
import_zod10.z.literal("UNRESOLVED_AUTH")
|
|
669
|
+
]);
|
|
670
|
+
var RunTaskSchema = import_zod10.z.object({
|
|
671
|
+
/** The Task id */
|
|
672
|
+
id: import_zod10.z.string(),
|
|
673
|
+
/** The key that you defined when creating the Task, the first param in any task. */
|
|
674
|
+
displayKey: import_zod10.z.string().nullable(),
|
|
675
|
+
/** The Task status */
|
|
676
|
+
status: TaskStatusSchema,
|
|
677
|
+
/** The name of the Task */
|
|
678
|
+
name: import_zod10.z.string(),
|
|
679
|
+
/** The icon of the Task, a string.
|
|
680
|
+
* For integrations, this will be a lowercase name of the company.
|
|
681
|
+
* Can be used with the [@trigger.dev/companyicons](https://www.npmjs.com/package/@trigger.dev/companyicons) package to display an svg. */
|
|
682
|
+
icon: import_zod10.z.string().nullable(),
|
|
683
|
+
/** When the task started */
|
|
684
|
+
startedAt: import_zod10.z.coerce.date().nullable(),
|
|
685
|
+
/** When the task completed */
|
|
686
|
+
completedAt: import_zod10.z.coerce.date().nullable()
|
|
687
|
+
});
|
|
688
|
+
var RunTaskWithSubtasksSchema = RunTaskSchema.extend({
|
|
689
|
+
subtasks: import_zod10.z.lazy(() => RunTaskWithSubtasksSchema.array()).optional()
|
|
690
|
+
});
|
|
691
|
+
var GetRunOptionsSchema = import_zod10.z.object({
|
|
692
|
+
/** Return subtasks, which appear in a `subtasks` array on a task. @default false */
|
|
693
|
+
subtasks: import_zod10.z.boolean().optional(),
|
|
694
|
+
/** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */
|
|
695
|
+
cursor: import_zod10.z.string().optional(),
|
|
696
|
+
/** How many tasks you want to return in one go, max 50. @default 20 */
|
|
697
|
+
take: import_zod10.z.number().optional()
|
|
698
|
+
});
|
|
699
|
+
var GetRunOptionsWithTaskDetailsSchema = GetRunOptionsSchema.extend({
|
|
700
|
+
/** If `true`, it returns the `params` and `output` of all tasks. @default false */
|
|
701
|
+
taskdetails: import_zod10.z.boolean().optional()
|
|
702
|
+
});
|
|
703
|
+
var RunSchema = import_zod10.z.object({
|
|
704
|
+
/** The Run id */
|
|
705
|
+
id: import_zod10.z.string(),
|
|
706
|
+
/** The Run status */
|
|
707
|
+
status: RunStatusSchema,
|
|
708
|
+
/** When the run started */
|
|
709
|
+
startedAt: import_zod10.z.coerce.date().nullable(),
|
|
710
|
+
/** When the run was last updated */
|
|
711
|
+
updatedAt: import_zod10.z.coerce.date().nullable(),
|
|
712
|
+
/** When the run was completed */
|
|
713
|
+
completedAt: import_zod10.z.coerce.date().nullable()
|
|
714
|
+
});
|
|
715
|
+
var GetRunSchema = RunSchema.extend({
|
|
716
|
+
/** The output of the run */
|
|
717
|
+
output: import_zod10.z.any().optional(),
|
|
718
|
+
/** The tasks from the run */
|
|
719
|
+
tasks: import_zod10.z.array(RunTaskWithSubtasksSchema),
|
|
720
|
+
/** Any status updates that were published from the run */
|
|
721
|
+
statuses: import_zod10.z.array(JobRunStatusRecordSchema).default([]),
|
|
722
|
+
/** If there are more tasks, you can use this to get them */
|
|
723
|
+
nextCursor: import_zod10.z.string().optional()
|
|
724
|
+
});
|
|
725
|
+
var GetRunsOptionsSchema = import_zod10.z.object({
|
|
726
|
+
/** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */
|
|
727
|
+
cursor: import_zod10.z.string().optional(),
|
|
728
|
+
/** How many runs you want to return in one go, max 50. @default 20 */
|
|
729
|
+
take: import_zod10.z.number().optional()
|
|
730
|
+
});
|
|
731
|
+
var GetRunsSchema = import_zod10.z.object({
|
|
732
|
+
/** The runs from the query */
|
|
733
|
+
runs: RunSchema.array(),
|
|
734
|
+
/** If there are more runs, you can use this to get them */
|
|
735
|
+
nextCursor: import_zod10.z.string().optional()
|
|
736
|
+
});
|
|
737
|
+
|
|
620
738
|
// src/schemas/api.ts
|
|
621
|
-
var UpdateTriggerSourceBodyV1Schema =
|
|
622
|
-
registeredEvents:
|
|
623
|
-
secret:
|
|
739
|
+
var UpdateTriggerSourceBodyV1Schema = import_zod11.z.object({
|
|
740
|
+
registeredEvents: import_zod11.z.array(import_zod11.z.string()),
|
|
741
|
+
secret: import_zod11.z.string().optional(),
|
|
624
742
|
data: SerializableJsonSchema.optional()
|
|
625
743
|
});
|
|
626
|
-
var UpdateTriggerSourceBodyV2Schema =
|
|
627
|
-
secret:
|
|
744
|
+
var UpdateTriggerSourceBodyV2Schema = import_zod11.z.object({
|
|
745
|
+
secret: import_zod11.z.string().optional(),
|
|
628
746
|
data: SerializableJsonSchema.optional(),
|
|
629
|
-
options:
|
|
630
|
-
event:
|
|
631
|
-
}).and(
|
|
747
|
+
options: import_zod11.z.object({
|
|
748
|
+
event: import_zod11.z.array(import_zod11.z.string())
|
|
749
|
+
}).and(import_zod11.z.record(import_zod11.z.string(), import_zod11.z.array(import_zod11.z.string())).optional())
|
|
632
750
|
});
|
|
633
|
-
var RegisterHTTPTriggerSourceBodySchema =
|
|
634
|
-
type:
|
|
635
|
-
url:
|
|
751
|
+
var RegisterHTTPTriggerSourceBodySchema = import_zod11.z.object({
|
|
752
|
+
type: import_zod11.z.literal("HTTP"),
|
|
753
|
+
url: import_zod11.z.string().url()
|
|
636
754
|
});
|
|
637
|
-
var RegisterSMTPTriggerSourceBodySchema =
|
|
638
|
-
type:
|
|
755
|
+
var RegisterSMTPTriggerSourceBodySchema = import_zod11.z.object({
|
|
756
|
+
type: import_zod11.z.literal("SMTP")
|
|
639
757
|
});
|
|
640
|
-
var RegisterSQSTriggerSourceBodySchema =
|
|
641
|
-
type:
|
|
758
|
+
var RegisterSQSTriggerSourceBodySchema = import_zod11.z.object({
|
|
759
|
+
type: import_zod11.z.literal("SQS")
|
|
642
760
|
});
|
|
643
|
-
var RegisterSourceChannelBodySchema =
|
|
761
|
+
var RegisterSourceChannelBodySchema = import_zod11.z.discriminatedUnion("type", [
|
|
644
762
|
RegisterHTTPTriggerSourceBodySchema,
|
|
645
763
|
RegisterSMTPTriggerSourceBodySchema,
|
|
646
764
|
RegisterSQSTriggerSourceBodySchema
|
|
647
765
|
]);
|
|
648
766
|
var REGISTER_SOURCE_EVENT_V1 = "dev.trigger.source.register";
|
|
649
767
|
var REGISTER_SOURCE_EVENT_V2 = "dev.trigger.source.register.v2";
|
|
650
|
-
var RegisterTriggerSourceSchema =
|
|
651
|
-
key:
|
|
652
|
-
params:
|
|
653
|
-
active:
|
|
654
|
-
secret:
|
|
768
|
+
var RegisterTriggerSourceSchema = import_zod11.z.object({
|
|
769
|
+
key: import_zod11.z.string(),
|
|
770
|
+
params: import_zod11.z.any(),
|
|
771
|
+
active: import_zod11.z.boolean(),
|
|
772
|
+
secret: import_zod11.z.string(),
|
|
655
773
|
data: DeserializedJsonSchema.optional(),
|
|
656
774
|
channel: RegisterSourceChannelBodySchema,
|
|
657
|
-
clientId:
|
|
775
|
+
clientId: import_zod11.z.string().optional()
|
|
658
776
|
});
|
|
659
|
-
var SourceEventOptionSchema =
|
|
660
|
-
name:
|
|
661
|
-
value:
|
|
777
|
+
var SourceEventOptionSchema = import_zod11.z.object({
|
|
778
|
+
name: import_zod11.z.string(),
|
|
779
|
+
value: import_zod11.z.string()
|
|
662
780
|
});
|
|
663
|
-
var RegisterSourceEventSchemaV1 =
|
|
781
|
+
var RegisterSourceEventSchemaV1 = import_zod11.z.object({
|
|
664
782
|
/** The id of the source */
|
|
665
|
-
id:
|
|
783
|
+
id: import_zod11.z.string(),
|
|
666
784
|
source: RegisterTriggerSourceSchema,
|
|
667
|
-
events:
|
|
668
|
-
missingEvents:
|
|
669
|
-
orphanedEvents:
|
|
670
|
-
dynamicTriggerId:
|
|
785
|
+
events: import_zod11.z.array(import_zod11.z.string()),
|
|
786
|
+
missingEvents: import_zod11.z.array(import_zod11.z.string()),
|
|
787
|
+
orphanedEvents: import_zod11.z.array(import_zod11.z.string()),
|
|
788
|
+
dynamicTriggerId: import_zod11.z.string().optional()
|
|
671
789
|
});
|
|
672
|
-
var RegisteredOptionsDiffSchema =
|
|
673
|
-
desired:
|
|
674
|
-
missing:
|
|
675
|
-
orphaned:
|
|
790
|
+
var RegisteredOptionsDiffSchema = import_zod11.z.object({
|
|
791
|
+
desired: import_zod11.z.array(import_zod11.z.string()),
|
|
792
|
+
missing: import_zod11.z.array(import_zod11.z.string()),
|
|
793
|
+
orphaned: import_zod11.z.array(import_zod11.z.string())
|
|
676
794
|
});
|
|
677
|
-
var RegisterSourceEventOptionsSchema =
|
|
795
|
+
var RegisterSourceEventOptionsSchema = import_zod11.z.object({
|
|
678
796
|
event: RegisteredOptionsDiffSchema
|
|
679
|
-
}).and(
|
|
680
|
-
var RegisterSourceEventSchemaV2 =
|
|
797
|
+
}).and(import_zod11.z.record(import_zod11.z.string(), RegisteredOptionsDiffSchema));
|
|
798
|
+
var RegisterSourceEventSchemaV2 = import_zod11.z.object({
|
|
681
799
|
/** The id of the source */
|
|
682
|
-
id:
|
|
800
|
+
id: import_zod11.z.string(),
|
|
683
801
|
source: RegisterTriggerSourceSchema,
|
|
684
802
|
options: RegisterSourceEventOptionsSchema,
|
|
685
|
-
dynamicTriggerId:
|
|
803
|
+
dynamicTriggerId: import_zod11.z.string().optional()
|
|
686
804
|
});
|
|
687
|
-
var TriggerSourceSchema =
|
|
688
|
-
id:
|
|
689
|
-
key:
|
|
805
|
+
var TriggerSourceSchema = import_zod11.z.object({
|
|
806
|
+
id: import_zod11.z.string(),
|
|
807
|
+
key: import_zod11.z.string()
|
|
690
808
|
});
|
|
691
809
|
var HttpSourceResponseMetadataSchema = DeserializedJsonSchema;
|
|
692
|
-
var HandleTriggerSourceSchema =
|
|
693
|
-
key:
|
|
694
|
-
secret:
|
|
695
|
-
data:
|
|
696
|
-
params:
|
|
810
|
+
var HandleTriggerSourceSchema = import_zod11.z.object({
|
|
811
|
+
key: import_zod11.z.string(),
|
|
812
|
+
secret: import_zod11.z.string(),
|
|
813
|
+
data: import_zod11.z.any(),
|
|
814
|
+
params: import_zod11.z.any(),
|
|
697
815
|
auth: ConnectionAuthSchema.optional(),
|
|
698
816
|
metadata: HttpSourceResponseMetadataSchema.optional()
|
|
699
817
|
});
|
|
700
|
-
var HttpSourceRequestSchema =
|
|
701
|
-
url:
|
|
702
|
-
method:
|
|
703
|
-
headers:
|
|
704
|
-
rawBody:
|
|
705
|
-
});
|
|
706
|
-
var HttpSourceRequestHeadersSchema =
|
|
707
|
-
"x-ts-key":
|
|
708
|
-
"x-ts-dynamic-id":
|
|
709
|
-
"x-ts-secret":
|
|
710
|
-
"x-ts-data":
|
|
711
|
-
"x-ts-params":
|
|
712
|
-
"x-ts-http-url":
|
|
713
|
-
"x-ts-http-method":
|
|
714
|
-
"x-ts-http-headers":
|
|
715
|
-
"x-ts-auth":
|
|
818
|
+
var HttpSourceRequestSchema = import_zod11.z.object({
|
|
819
|
+
url: import_zod11.z.string().url(),
|
|
820
|
+
method: import_zod11.z.string(),
|
|
821
|
+
headers: import_zod11.z.record(import_zod11.z.string()),
|
|
822
|
+
rawBody: import_zod11.z.instanceof(Buffer).optional().nullable()
|
|
823
|
+
});
|
|
824
|
+
var HttpSourceRequestHeadersSchema = import_zod11.z.object({
|
|
825
|
+
"x-ts-key": import_zod11.z.string(),
|
|
826
|
+
"x-ts-dynamic-id": import_zod11.z.string().optional(),
|
|
827
|
+
"x-ts-secret": import_zod11.z.string(),
|
|
828
|
+
"x-ts-data": import_zod11.z.string().transform((s) => JSON.parse(s)),
|
|
829
|
+
"x-ts-params": import_zod11.z.string().transform((s) => JSON.parse(s)),
|
|
830
|
+
"x-ts-http-url": import_zod11.z.string(),
|
|
831
|
+
"x-ts-http-method": import_zod11.z.string(),
|
|
832
|
+
"x-ts-http-headers": import_zod11.z.string().transform((s) => import_zod11.z.record(import_zod11.z.string()).parse(JSON.parse(s))),
|
|
833
|
+
"x-ts-auth": import_zod11.z.string().optional().transform((s) => {
|
|
716
834
|
if (s === void 0)
|
|
717
835
|
return;
|
|
718
836
|
const json = JSON.parse(s);
|
|
719
837
|
return ConnectionAuthSchema.parse(json);
|
|
720
838
|
}),
|
|
721
|
-
"x-ts-metadata":
|
|
839
|
+
"x-ts-metadata": import_zod11.z.string().optional().transform((s) => {
|
|
722
840
|
if (s === void 0)
|
|
723
841
|
return;
|
|
724
842
|
const json = JSON.parse(s);
|
|
725
843
|
return DeserializedJsonSchema.parse(json);
|
|
726
844
|
})
|
|
727
845
|
});
|
|
728
|
-
var PongSuccessResponseSchema =
|
|
729
|
-
ok:
|
|
846
|
+
var PongSuccessResponseSchema = import_zod11.z.object({
|
|
847
|
+
ok: import_zod11.z.literal(true)
|
|
730
848
|
});
|
|
731
|
-
var PongErrorResponseSchema =
|
|
732
|
-
ok:
|
|
733
|
-
error:
|
|
849
|
+
var PongErrorResponseSchema = import_zod11.z.object({
|
|
850
|
+
ok: import_zod11.z.literal(false),
|
|
851
|
+
error: import_zod11.z.string()
|
|
734
852
|
});
|
|
735
|
-
var PongResponseSchema =
|
|
853
|
+
var PongResponseSchema = import_zod11.z.discriminatedUnion("ok", [
|
|
736
854
|
PongSuccessResponseSchema,
|
|
737
855
|
PongErrorResponseSchema
|
|
738
856
|
]);
|
|
739
|
-
var ValidateSuccessResponseSchema =
|
|
740
|
-
ok:
|
|
741
|
-
endpointId:
|
|
857
|
+
var ValidateSuccessResponseSchema = import_zod11.z.object({
|
|
858
|
+
ok: import_zod11.z.literal(true),
|
|
859
|
+
endpointId: import_zod11.z.string()
|
|
742
860
|
});
|
|
743
|
-
var ValidateErrorResponseSchema =
|
|
744
|
-
ok:
|
|
745
|
-
error:
|
|
861
|
+
var ValidateErrorResponseSchema = import_zod11.z.object({
|
|
862
|
+
ok: import_zod11.z.literal(false),
|
|
863
|
+
error: import_zod11.z.string()
|
|
746
864
|
});
|
|
747
|
-
var ValidateResponseSchema =
|
|
865
|
+
var ValidateResponseSchema = import_zod11.z.discriminatedUnion("ok", [
|
|
748
866
|
ValidateSuccessResponseSchema,
|
|
749
867
|
ValidateErrorResponseSchema
|
|
750
868
|
]);
|
|
751
|
-
var QueueOptionsSchema =
|
|
752
|
-
name:
|
|
753
|
-
maxConcurrent:
|
|
754
|
-
});
|
|
755
|
-
var JobMetadataSchema =
|
|
756
|
-
id:
|
|
757
|
-
name:
|
|
758
|
-
version:
|
|
869
|
+
var QueueOptionsSchema = import_zod11.z.object({
|
|
870
|
+
name: import_zod11.z.string(),
|
|
871
|
+
maxConcurrent: import_zod11.z.number().optional()
|
|
872
|
+
});
|
|
873
|
+
var JobMetadataSchema = import_zod11.z.object({
|
|
874
|
+
id: import_zod11.z.string(),
|
|
875
|
+
name: import_zod11.z.string(),
|
|
876
|
+
version: import_zod11.z.string(),
|
|
759
877
|
event: EventSpecificationSchema,
|
|
760
878
|
trigger: TriggerMetadataSchema,
|
|
761
|
-
integrations:
|
|
762
|
-
internal:
|
|
763
|
-
enabled:
|
|
764
|
-
startPosition:
|
|
879
|
+
integrations: import_zod11.z.record(IntegrationConfigSchema),
|
|
880
|
+
internal: import_zod11.z.boolean().default(false),
|
|
881
|
+
enabled: import_zod11.z.boolean(),
|
|
882
|
+
startPosition: import_zod11.z.enum([
|
|
765
883
|
"initial",
|
|
766
884
|
"latest"
|
|
767
885
|
]),
|
|
768
|
-
preprocessRuns:
|
|
886
|
+
preprocessRuns: import_zod11.z.boolean()
|
|
769
887
|
});
|
|
770
|
-
var SourceMetadataV1Schema =
|
|
771
|
-
version:
|
|
772
|
-
channel:
|
|
888
|
+
var SourceMetadataV1Schema = import_zod11.z.object({
|
|
889
|
+
version: import_zod11.z.literal("1"),
|
|
890
|
+
channel: import_zod11.z.enum([
|
|
773
891
|
"HTTP",
|
|
774
892
|
"SQS",
|
|
775
893
|
"SMTP"
|
|
776
894
|
]),
|
|
777
895
|
integration: IntegrationConfigSchema,
|
|
778
|
-
key:
|
|
779
|
-
params:
|
|
780
|
-
events:
|
|
781
|
-
registerSourceJob:
|
|
782
|
-
id:
|
|
783
|
-
version:
|
|
896
|
+
key: import_zod11.z.string(),
|
|
897
|
+
params: import_zod11.z.any(),
|
|
898
|
+
events: import_zod11.z.array(import_zod11.z.string()),
|
|
899
|
+
registerSourceJob: import_zod11.z.object({
|
|
900
|
+
id: import_zod11.z.string(),
|
|
901
|
+
version: import_zod11.z.string()
|
|
784
902
|
}).optional()
|
|
785
903
|
});
|
|
786
|
-
var SourceMetadataV2Schema =
|
|
787
|
-
version:
|
|
788
|
-
channel:
|
|
904
|
+
var SourceMetadataV2Schema = import_zod11.z.object({
|
|
905
|
+
version: import_zod11.z.literal("2"),
|
|
906
|
+
channel: import_zod11.z.enum([
|
|
789
907
|
"HTTP",
|
|
790
908
|
"SQS",
|
|
791
909
|
"SMTP"
|
|
792
910
|
]),
|
|
793
911
|
integration: IntegrationConfigSchema,
|
|
794
|
-
key:
|
|
795
|
-
params:
|
|
796
|
-
options:
|
|
797
|
-
registerSourceJob:
|
|
798
|
-
id:
|
|
799
|
-
version:
|
|
912
|
+
key: import_zod11.z.string(),
|
|
913
|
+
params: import_zod11.z.any(),
|
|
914
|
+
options: import_zod11.z.record(import_zod11.z.array(import_zod11.z.string())),
|
|
915
|
+
registerSourceJob: import_zod11.z.object({
|
|
916
|
+
id: import_zod11.z.string(),
|
|
917
|
+
version: import_zod11.z.string()
|
|
800
918
|
}).optional()
|
|
801
919
|
});
|
|
802
|
-
var SourceMetadataSchema =
|
|
920
|
+
var SourceMetadataSchema = import_zod11.z.preprocess(addMissingVersionField, import_zod11.z.discriminatedUnion("version", [
|
|
803
921
|
SourceMetadataV1Schema,
|
|
804
922
|
SourceMetadataV2Schema
|
|
805
923
|
]));
|
|
806
|
-
var DynamicTriggerEndpointMetadataSchema =
|
|
807
|
-
id:
|
|
808
|
-
jobs:
|
|
924
|
+
var DynamicTriggerEndpointMetadataSchema = import_zod11.z.object({
|
|
925
|
+
id: import_zod11.z.string(),
|
|
926
|
+
jobs: import_zod11.z.array(JobMetadataSchema.pick({
|
|
809
927
|
id: true,
|
|
810
928
|
version: true
|
|
811
929
|
})),
|
|
812
|
-
registerSourceJob:
|
|
813
|
-
id:
|
|
814
|
-
version:
|
|
930
|
+
registerSourceJob: import_zod11.z.object({
|
|
931
|
+
id: import_zod11.z.string(),
|
|
932
|
+
version: import_zod11.z.string()
|
|
815
933
|
}).optional()
|
|
816
934
|
});
|
|
817
|
-
var IndexEndpointResponseSchema =
|
|
818
|
-
jobs:
|
|
819
|
-
sources:
|
|
820
|
-
dynamicTriggers:
|
|
821
|
-
dynamicSchedules:
|
|
935
|
+
var IndexEndpointResponseSchema = import_zod11.z.object({
|
|
936
|
+
jobs: import_zod11.z.array(JobMetadataSchema),
|
|
937
|
+
sources: import_zod11.z.array(SourceMetadataSchema),
|
|
938
|
+
dynamicTriggers: import_zod11.z.array(DynamicTriggerEndpointMetadataSchema),
|
|
939
|
+
dynamicSchedules: import_zod11.z.array(RegisterDynamicSchedulePayloadSchema)
|
|
822
940
|
});
|
|
823
|
-
var RawEventSchema =
|
|
941
|
+
var RawEventSchema = import_zod11.z.object({
|
|
824
942
|
/** The `name` property must exactly match any subscriptions you want to
|
|
825
943
|
trigger. */
|
|
826
|
-
name:
|
|
944
|
+
name: import_zod11.z.string(),
|
|
827
945
|
/** The `payload` property will be sent to any matching Jobs and will appear
|
|
828
946
|
as the `payload` param of the `run()` function. You can leave this
|
|
829
947
|
parameter out if you just want to trigger a Job without any input data. */
|
|
830
|
-
payload:
|
|
948
|
+
payload: import_zod11.z.any(),
|
|
831
949
|
/** The optional `context` property will be sent to any matching Jobs and will
|
|
832
950
|
be passed through as the `context.event.context` param of the `run()`
|
|
833
951
|
function. This is optional but can be useful if you want to pass through
|
|
834
952
|
some additional context to the Job. */
|
|
835
|
-
context:
|
|
953
|
+
context: import_zod11.z.any().optional(),
|
|
836
954
|
/** The `id` property uniquely identify this particular event. If unset it
|
|
837
955
|
will be set automatically using `ulid`. */
|
|
838
|
-
id:
|
|
956
|
+
id: import_zod11.z.string().default(() => (0, import_ulid.ulid)()),
|
|
839
957
|
/** This is optional, it defaults to the current timestamp. Usually you would
|
|
840
958
|
only set this if you have a timestamp that you wish to pass through, e.g.
|
|
841
959
|
you receive a timestamp from a service and you want the same timestamp to
|
|
842
960
|
be used in your Job. */
|
|
843
|
-
timestamp:
|
|
961
|
+
timestamp: import_zod11.z.coerce.date().optional(),
|
|
844
962
|
/** This is optional, it defaults to "trigger.dev". It can be useful to set
|
|
845
963
|
this as you can filter events using this in the `eventTrigger()`. */
|
|
846
|
-
source:
|
|
964
|
+
source: import_zod11.z.string().optional()
|
|
847
965
|
});
|
|
848
|
-
var ApiEventLogSchema =
|
|
966
|
+
var ApiEventLogSchema = import_zod11.z.object({
|
|
849
967
|
/** The `id` of the event that was sent.
|
|
850
968
|
*/
|
|
851
|
-
id:
|
|
969
|
+
id: import_zod11.z.string(),
|
|
852
970
|
/** The `name` of the event that was sent. */
|
|
853
|
-
name:
|
|
971
|
+
name: import_zod11.z.string(),
|
|
854
972
|
/** The `payload` of the event that was sent */
|
|
855
973
|
payload: DeserializedJsonSchema,
|
|
856
974
|
/** The `context` of the event that was sent. Is `undefined` if no context was
|
|
857
975
|
set when sending the event. */
|
|
858
976
|
context: DeserializedJsonSchema.optional().nullable(),
|
|
859
977
|
/** The `timestamp` of the event that was sent */
|
|
860
|
-
timestamp:
|
|
978
|
+
timestamp: import_zod11.z.coerce.date(),
|
|
861
979
|
/** The timestamp when the event will be delivered to any matching Jobs. Is
|
|
862
980
|
`undefined` if `deliverAt` or `deliverAfter` wasn't set when sending the
|
|
863
981
|
event. */
|
|
864
|
-
deliverAt:
|
|
982
|
+
deliverAt: import_zod11.z.coerce.date().optional().nullable(),
|
|
865
983
|
/** The timestamp when the event was delivered. Is `undefined` if `deliverAt`
|
|
866
984
|
or `deliverAfter` were set when sending the event. */
|
|
867
|
-
deliveredAt:
|
|
985
|
+
deliveredAt: import_zod11.z.coerce.date().optional().nullable(),
|
|
868
986
|
/** The timestamp when the event was cancelled. Is `undefined` if the event
|
|
869
987
|
* wasn't cancelled. */
|
|
870
|
-
cancelledAt:
|
|
988
|
+
cancelledAt: import_zod11.z.coerce.date().optional().nullable()
|
|
871
989
|
});
|
|
872
|
-
var SendEventOptionsSchema =
|
|
990
|
+
var SendEventOptionsSchema = import_zod11.z.object({
|
|
873
991
|
/** An optional Date when you want the event to trigger Jobs. The event will
|
|
874
992
|
be sent to the platform immediately but won't be acted upon until the
|
|
875
993
|
specified time. */
|
|
876
|
-
deliverAt:
|
|
994
|
+
deliverAt: import_zod11.z.coerce.date().optional(),
|
|
877
995
|
/** An optional number of seconds you want to wait for the event to trigger
|
|
878
996
|
any relevant Jobs. The event will be sent to the platform immediately but
|
|
879
997
|
won't be delivered until after the elapsed number of seconds. */
|
|
880
|
-
deliverAfter:
|
|
998
|
+
deliverAfter: import_zod11.z.number().int().optional(),
|
|
881
999
|
/** This optional param will be used by Trigger.dev Connect, which
|
|
882
1000
|
is coming soon. */
|
|
883
|
-
accountId:
|
|
1001
|
+
accountId: import_zod11.z.string().optional()
|
|
884
1002
|
});
|
|
885
|
-
var SendEventBodySchema =
|
|
1003
|
+
var SendEventBodySchema = import_zod11.z.object({
|
|
886
1004
|
event: RawEventSchema,
|
|
887
1005
|
options: SendEventOptionsSchema.optional()
|
|
888
1006
|
});
|
|
889
|
-
var DeliverEventResponseSchema =
|
|
890
|
-
deliveredAt:
|
|
1007
|
+
var DeliverEventResponseSchema = import_zod11.z.object({
|
|
1008
|
+
deliveredAt: import_zod11.z.string().datetime()
|
|
891
1009
|
});
|
|
892
|
-
var RuntimeEnvironmentTypeSchema =
|
|
1010
|
+
var RuntimeEnvironmentTypeSchema = import_zod11.z.enum([
|
|
893
1011
|
"PRODUCTION",
|
|
894
1012
|
"STAGING",
|
|
895
1013
|
"DEVELOPMENT",
|
|
896
1014
|
"PREVIEW"
|
|
897
1015
|
]);
|
|
898
|
-
var RunSourceContextSchema =
|
|
899
|
-
id:
|
|
900
|
-
metadata:
|
|
1016
|
+
var RunSourceContextSchema = import_zod11.z.object({
|
|
1017
|
+
id: import_zod11.z.string(),
|
|
1018
|
+
metadata: import_zod11.z.any()
|
|
901
1019
|
});
|
|
902
|
-
var RunJobBodySchema =
|
|
1020
|
+
var RunJobBodySchema = import_zod11.z.object({
|
|
903
1021
|
event: ApiEventLogSchema,
|
|
904
|
-
job:
|
|
905
|
-
id:
|
|
906
|
-
version:
|
|
1022
|
+
job: import_zod11.z.object({
|
|
1023
|
+
id: import_zod11.z.string(),
|
|
1024
|
+
version: import_zod11.z.string()
|
|
907
1025
|
}),
|
|
908
|
-
run:
|
|
909
|
-
id:
|
|
910
|
-
isTest:
|
|
911
|
-
isRetry:
|
|
912
|
-
startedAt:
|
|
1026
|
+
run: import_zod11.z.object({
|
|
1027
|
+
id: import_zod11.z.string(),
|
|
1028
|
+
isTest: import_zod11.z.boolean(),
|
|
1029
|
+
isRetry: import_zod11.z.boolean().default(false),
|
|
1030
|
+
startedAt: import_zod11.z.coerce.date()
|
|
913
1031
|
}),
|
|
914
|
-
environment:
|
|
915
|
-
id:
|
|
916
|
-
slug:
|
|
1032
|
+
environment: import_zod11.z.object({
|
|
1033
|
+
id: import_zod11.z.string(),
|
|
1034
|
+
slug: import_zod11.z.string(),
|
|
917
1035
|
type: RuntimeEnvironmentTypeSchema
|
|
918
1036
|
}),
|
|
919
|
-
organization:
|
|
920
|
-
id:
|
|
921
|
-
title:
|
|
922
|
-
slug:
|
|
1037
|
+
organization: import_zod11.z.object({
|
|
1038
|
+
id: import_zod11.z.string(),
|
|
1039
|
+
title: import_zod11.z.string(),
|
|
1040
|
+
slug: import_zod11.z.string()
|
|
923
1041
|
}),
|
|
924
|
-
account:
|
|
925
|
-
id:
|
|
926
|
-
metadata:
|
|
1042
|
+
account: import_zod11.z.object({
|
|
1043
|
+
id: import_zod11.z.string(),
|
|
1044
|
+
metadata: import_zod11.z.any()
|
|
927
1045
|
}).optional(),
|
|
928
1046
|
source: RunSourceContextSchema.optional(),
|
|
929
|
-
tasks:
|
|
930
|
-
connections:
|
|
1047
|
+
tasks: import_zod11.z.array(CachedTaskSchema).optional(),
|
|
1048
|
+
connections: import_zod11.z.record(ConnectionAuthSchema).optional()
|
|
931
1049
|
});
|
|
932
|
-
var RunJobErrorSchema =
|
|
933
|
-
status:
|
|
1050
|
+
var RunJobErrorSchema = import_zod11.z.object({
|
|
1051
|
+
status: import_zod11.z.literal("ERROR"),
|
|
934
1052
|
error: ErrorWithStackSchema,
|
|
935
1053
|
task: TaskSchema.optional()
|
|
936
1054
|
});
|
|
937
|
-
var
|
|
938
|
-
status:
|
|
1055
|
+
var RunJobUnresolvedAuthErrorSchema = import_zod11.z.object({
|
|
1056
|
+
status: import_zod11.z.literal("UNRESOLVED_AUTH_ERROR"),
|
|
1057
|
+
issues: import_zod11.z.record(import_zod11.z.object({
|
|
1058
|
+
id: import_zod11.z.string(),
|
|
1059
|
+
error: import_zod11.z.string()
|
|
1060
|
+
}))
|
|
1061
|
+
});
|
|
1062
|
+
var RunJobResumeWithTaskSchema = import_zod11.z.object({
|
|
1063
|
+
status: import_zod11.z.literal("RESUME_WITH_TASK"),
|
|
939
1064
|
task: TaskSchema
|
|
940
1065
|
});
|
|
941
|
-
var RunJobRetryWithTaskSchema =
|
|
942
|
-
status:
|
|
1066
|
+
var RunJobRetryWithTaskSchema = import_zod11.z.object({
|
|
1067
|
+
status: import_zod11.z.literal("RETRY_WITH_TASK"),
|
|
943
1068
|
task: TaskSchema,
|
|
944
1069
|
error: ErrorWithStackSchema,
|
|
945
|
-
retryAt:
|
|
1070
|
+
retryAt: import_zod11.z.coerce.date()
|
|
946
1071
|
});
|
|
947
|
-
var RunJobCanceledWithTaskSchema =
|
|
948
|
-
status:
|
|
1072
|
+
var RunJobCanceledWithTaskSchema = import_zod11.z.object({
|
|
1073
|
+
status: import_zod11.z.literal("CANCELED"),
|
|
949
1074
|
task: TaskSchema
|
|
950
1075
|
});
|
|
951
|
-
var RunJobSuccessSchema =
|
|
952
|
-
status:
|
|
1076
|
+
var RunJobSuccessSchema = import_zod11.z.object({
|
|
1077
|
+
status: import_zod11.z.literal("SUCCESS"),
|
|
953
1078
|
output: DeserializedJsonSchema.optional()
|
|
954
1079
|
});
|
|
955
|
-
var RunJobResponseSchema =
|
|
1080
|
+
var RunJobResponseSchema = import_zod11.z.discriminatedUnion("status", [
|
|
956
1081
|
RunJobErrorSchema,
|
|
1082
|
+
RunJobUnresolvedAuthErrorSchema,
|
|
957
1083
|
RunJobResumeWithTaskSchema,
|
|
958
1084
|
RunJobRetryWithTaskSchema,
|
|
959
1085
|
RunJobCanceledWithTaskSchema,
|
|
960
1086
|
RunJobSuccessSchema
|
|
961
1087
|
]);
|
|
962
|
-
var PreprocessRunBodySchema =
|
|
1088
|
+
var PreprocessRunBodySchema = import_zod11.z.object({
|
|
963
1089
|
event: ApiEventLogSchema,
|
|
964
|
-
job:
|
|
965
|
-
id:
|
|
966
|
-
version:
|
|
1090
|
+
job: import_zod11.z.object({
|
|
1091
|
+
id: import_zod11.z.string(),
|
|
1092
|
+
version: import_zod11.z.string()
|
|
967
1093
|
}),
|
|
968
|
-
run:
|
|
969
|
-
id:
|
|
970
|
-
isTest:
|
|
1094
|
+
run: import_zod11.z.object({
|
|
1095
|
+
id: import_zod11.z.string(),
|
|
1096
|
+
isTest: import_zod11.z.boolean()
|
|
971
1097
|
}),
|
|
972
|
-
environment:
|
|
973
|
-
id:
|
|
974
|
-
slug:
|
|
1098
|
+
environment: import_zod11.z.object({
|
|
1099
|
+
id: import_zod11.z.string(),
|
|
1100
|
+
slug: import_zod11.z.string(),
|
|
975
1101
|
type: RuntimeEnvironmentTypeSchema
|
|
976
1102
|
}),
|
|
977
|
-
organization:
|
|
978
|
-
id:
|
|
979
|
-
title:
|
|
980
|
-
slug:
|
|
1103
|
+
organization: import_zod11.z.object({
|
|
1104
|
+
id: import_zod11.z.string(),
|
|
1105
|
+
title: import_zod11.z.string(),
|
|
1106
|
+
slug: import_zod11.z.string()
|
|
981
1107
|
}),
|
|
982
|
-
account:
|
|
983
|
-
id:
|
|
984
|
-
metadata:
|
|
1108
|
+
account: import_zod11.z.object({
|
|
1109
|
+
id: import_zod11.z.string(),
|
|
1110
|
+
metadata: import_zod11.z.any()
|
|
985
1111
|
}).optional()
|
|
986
1112
|
});
|
|
987
|
-
var PreprocessRunResponseSchema =
|
|
988
|
-
abort:
|
|
989
|
-
properties:
|
|
1113
|
+
var PreprocessRunResponseSchema = import_zod11.z.object({
|
|
1114
|
+
abort: import_zod11.z.boolean(),
|
|
1115
|
+
properties: import_zod11.z.array(DisplayPropertySchema).optional()
|
|
990
1116
|
});
|
|
991
|
-
var CreateRunResponseOkSchema =
|
|
992
|
-
ok:
|
|
993
|
-
data:
|
|
994
|
-
id:
|
|
1117
|
+
var CreateRunResponseOkSchema = import_zod11.z.object({
|
|
1118
|
+
ok: import_zod11.z.literal(true),
|
|
1119
|
+
data: import_zod11.z.object({
|
|
1120
|
+
id: import_zod11.z.string()
|
|
995
1121
|
})
|
|
996
1122
|
});
|
|
997
|
-
var CreateRunResponseErrorSchema =
|
|
998
|
-
ok:
|
|
999
|
-
error:
|
|
1123
|
+
var CreateRunResponseErrorSchema = import_zod11.z.object({
|
|
1124
|
+
ok: import_zod11.z.literal(false),
|
|
1125
|
+
error: import_zod11.z.string()
|
|
1000
1126
|
});
|
|
1001
|
-
var CreateRunResponseBodySchema =
|
|
1127
|
+
var CreateRunResponseBodySchema = import_zod11.z.discriminatedUnion("ok", [
|
|
1002
1128
|
CreateRunResponseOkSchema,
|
|
1003
1129
|
CreateRunResponseErrorSchema
|
|
1004
1130
|
]);
|
|
1005
|
-
var RedactStringSchema =
|
|
1006
|
-
__redactedString:
|
|
1007
|
-
strings:
|
|
1008
|
-
interpolations:
|
|
1131
|
+
var RedactStringSchema = import_zod11.z.object({
|
|
1132
|
+
__redactedString: import_zod11.z.literal(true),
|
|
1133
|
+
strings: import_zod11.z.array(import_zod11.z.string()),
|
|
1134
|
+
interpolations: import_zod11.z.array(import_zod11.z.string())
|
|
1009
1135
|
});
|
|
1010
|
-
var LogMessageSchema =
|
|
1011
|
-
level:
|
|
1136
|
+
var LogMessageSchema = import_zod11.z.object({
|
|
1137
|
+
level: import_zod11.z.enum([
|
|
1012
1138
|
"DEBUG",
|
|
1013
1139
|
"INFO",
|
|
1014
1140
|
"WARN",
|
|
1015
1141
|
"ERROR"
|
|
1016
1142
|
]),
|
|
1017
|
-
message:
|
|
1143
|
+
message: import_zod11.z.string(),
|
|
1018
1144
|
data: SerializableJsonSchema.optional()
|
|
1019
1145
|
});
|
|
1020
|
-
var RedactSchema =
|
|
1021
|
-
paths:
|
|
1146
|
+
var RedactSchema = import_zod11.z.object({
|
|
1147
|
+
paths: import_zod11.z.array(import_zod11.z.string())
|
|
1022
1148
|
});
|
|
1023
|
-
var RetryOptionsSchema =
|
|
1149
|
+
var RetryOptionsSchema = import_zod11.z.object({
|
|
1024
1150
|
/** The maximum number of times to retry the request. */
|
|
1025
|
-
limit:
|
|
1151
|
+
limit: import_zod11.z.number().optional(),
|
|
1026
1152
|
/** The exponential factor to use when calculating the next retry time. */
|
|
1027
|
-
factor:
|
|
1153
|
+
factor: import_zod11.z.number().optional(),
|
|
1028
1154
|
/** The minimum amount of time to wait before retrying the request. */
|
|
1029
|
-
minTimeoutInMs:
|
|
1155
|
+
minTimeoutInMs: import_zod11.z.number().optional(),
|
|
1030
1156
|
/** The maximum amount of time to wait before retrying the request. */
|
|
1031
|
-
maxTimeoutInMs:
|
|
1157
|
+
maxTimeoutInMs: import_zod11.z.number().optional(),
|
|
1032
1158
|
/** Whether to randomize the retry time. */
|
|
1033
|
-
randomize:
|
|
1159
|
+
randomize: import_zod11.z.boolean().optional()
|
|
1034
1160
|
});
|
|
1035
|
-
var RunTaskOptionsSchema =
|
|
1161
|
+
var RunTaskOptionsSchema = import_zod11.z.object({
|
|
1036
1162
|
/** The name of the Task is required. This is displayed on the Task in the logs. */
|
|
1037
|
-
name:
|
|
1163
|
+
name: import_zod11.z.string().optional(),
|
|
1038
1164
|
/** The Task will wait and only start at the specified Date */
|
|
1039
|
-
delayUntil:
|
|
1165
|
+
delayUntil: import_zod11.z.coerce.date().optional(),
|
|
1040
1166
|
/** Retry options */
|
|
1041
1167
|
retry: RetryOptionsSchema.optional(),
|
|
1042
1168
|
/** The icon for the Task, it will appear in the logs.
|
|
1043
1169
|
* You can use the name of a company in lowercase, e.g. "github".
|
|
1044
1170
|
* Or any icon name that [Font Awesome](https://fontawesome.com/icons) supports. */
|
|
1045
|
-
icon:
|
|
1171
|
+
icon: import_zod11.z.string().optional(),
|
|
1046
1172
|
/** The key for the Task that you want to appear in the logs */
|
|
1047
|
-
displayKey:
|
|
1173
|
+
displayKey: import_zod11.z.string().optional(),
|
|
1048
1174
|
/** A description of the Task */
|
|
1049
|
-
description:
|
|
1175
|
+
description: import_zod11.z.string().optional(),
|
|
1050
1176
|
/** Properties that are displayed in the logs */
|
|
1051
|
-
properties:
|
|
1177
|
+
properties: import_zod11.z.array(DisplayPropertySchema).optional(),
|
|
1052
1178
|
/** The input params to the Task, will be displayed in the logs */
|
|
1053
|
-
params:
|
|
1179
|
+
params: import_zod11.z.any(),
|
|
1054
1180
|
/** The style of the log entry. */
|
|
1055
1181
|
style: StyleSchema.optional(),
|
|
1056
1182
|
/** Allows you to link the Integration connection in the logs. This is handled automatically in integrations. */
|
|
1057
|
-
connectionKey:
|
|
1183
|
+
connectionKey: import_zod11.z.string().optional(),
|
|
1058
1184
|
/** An operation you want to perform on the Trigger.dev platform, current only "fetch" is supported. If you wish to `fetch` use [`io.backgroundFetch()`](https://trigger.dev/docs/sdk/io/backgroundfetch) instead. */
|
|
1059
|
-
operation:
|
|
1185
|
+
operation: import_zod11.z.enum([
|
|
1060
1186
|
"fetch"
|
|
1061
1187
|
]).optional(),
|
|
1062
1188
|
/** 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). */
|
|
1063
|
-
noop:
|
|
1189
|
+
noop: import_zod11.z.boolean().default(false),
|
|
1064
1190
|
redact: RedactSchema.optional(),
|
|
1065
1191
|
trigger: TriggerMetadataSchema.optional()
|
|
1066
1192
|
});
|
|
1067
1193
|
var RunTaskBodyInputSchema = RunTaskOptionsSchema.extend({
|
|
1068
|
-
idempotencyKey:
|
|
1069
|
-
parentId:
|
|
1194
|
+
idempotencyKey: import_zod11.z.string(),
|
|
1195
|
+
parentId: import_zod11.z.string().optional()
|
|
1070
1196
|
});
|
|
1071
1197
|
var RunTaskBodyOutputSchema = RunTaskBodyInputSchema.extend({
|
|
1072
1198
|
params: DeserializedJsonSchema.optional().nullable()
|
|
@@ -1078,270 +1204,197 @@ var CompleteTaskBodyInputSchema = RunTaskBodyInputSchema.pick({
|
|
|
1078
1204
|
}).extend({
|
|
1079
1205
|
output: SerializableJsonSchema.optional().transform((v) => v ? DeserializedJsonSchema.parse(JSON.parse(JSON.stringify(v))) : {})
|
|
1080
1206
|
});
|
|
1081
|
-
var FailTaskBodyInputSchema =
|
|
1207
|
+
var FailTaskBodyInputSchema = import_zod11.z.object({
|
|
1082
1208
|
error: ErrorWithStackSchema
|
|
1083
1209
|
});
|
|
1084
|
-
var NormalizedRequestSchema =
|
|
1085
|
-
headers:
|
|
1086
|
-
method:
|
|
1087
|
-
query:
|
|
1088
|
-
url:
|
|
1089
|
-
body:
|
|
1210
|
+
var NormalizedRequestSchema = import_zod11.z.object({
|
|
1211
|
+
headers: import_zod11.z.record(import_zod11.z.string()),
|
|
1212
|
+
method: import_zod11.z.string(),
|
|
1213
|
+
query: import_zod11.z.record(import_zod11.z.string()),
|
|
1214
|
+
url: import_zod11.z.string(),
|
|
1215
|
+
body: import_zod11.z.any()
|
|
1090
1216
|
});
|
|
1091
|
-
var NormalizedResponseSchema =
|
|
1092
|
-
status:
|
|
1093
|
-
body:
|
|
1094
|
-
headers:
|
|
1217
|
+
var NormalizedResponseSchema = import_zod11.z.object({
|
|
1218
|
+
status: import_zod11.z.number(),
|
|
1219
|
+
body: import_zod11.z.any(),
|
|
1220
|
+
headers: import_zod11.z.record(import_zod11.z.string()).optional()
|
|
1095
1221
|
});
|
|
1096
|
-
var HttpSourceResponseSchema =
|
|
1222
|
+
var HttpSourceResponseSchema = import_zod11.z.object({
|
|
1097
1223
|
response: NormalizedResponseSchema,
|
|
1098
|
-
events:
|
|
1224
|
+
events: import_zod11.z.array(RawEventSchema),
|
|
1099
1225
|
metadata: HttpSourceResponseMetadataSchema.optional()
|
|
1100
1226
|
});
|
|
1101
|
-
var RegisterTriggerBodySchemaV1 =
|
|
1227
|
+
var RegisterTriggerBodySchemaV1 = import_zod11.z.object({
|
|
1102
1228
|
rule: EventRuleSchema,
|
|
1103
1229
|
source: SourceMetadataV1Schema
|
|
1104
1230
|
});
|
|
1105
|
-
var RegisterTriggerBodySchemaV2 =
|
|
1231
|
+
var RegisterTriggerBodySchemaV2 = import_zod11.z.object({
|
|
1106
1232
|
rule: EventRuleSchema,
|
|
1107
|
-
source: SourceMetadataV2Schema
|
|
1233
|
+
source: SourceMetadataV2Schema,
|
|
1234
|
+
accountId: import_zod11.z.string().optional()
|
|
1108
1235
|
});
|
|
1109
|
-
var InitializeTriggerBodySchema =
|
|
1110
|
-
id:
|
|
1111
|
-
params:
|
|
1112
|
-
accountId:
|
|
1113
|
-
metadata:
|
|
1236
|
+
var InitializeTriggerBodySchema = import_zod11.z.object({
|
|
1237
|
+
id: import_zod11.z.string(),
|
|
1238
|
+
params: import_zod11.z.any(),
|
|
1239
|
+
accountId: import_zod11.z.string().optional(),
|
|
1240
|
+
metadata: import_zod11.z.any().optional()
|
|
1114
1241
|
});
|
|
1115
|
-
var RegisterCommonScheduleBodySchema =
|
|
1242
|
+
var RegisterCommonScheduleBodySchema = import_zod11.z.object({
|
|
1116
1243
|
/** A unique id for the schedule. This is used to identify and unregister the schedule later. */
|
|
1117
|
-
id:
|
|
1244
|
+
id: import_zod11.z.string(),
|
|
1118
1245
|
/** Any additional metadata about the schedule. */
|
|
1119
|
-
metadata:
|
|
1120
|
-
/**
|
|
1121
|
-
accountId:
|
|
1246
|
+
metadata: import_zod11.z.any(),
|
|
1247
|
+
/** An optional Account ID to associate with runs triggered by this schedule */
|
|
1248
|
+
accountId: import_zod11.z.string().optional()
|
|
1122
1249
|
});
|
|
1123
1250
|
var RegisterIntervalScheduleBodySchema = RegisterCommonScheduleBodySchema.merge(IntervalMetadataSchema);
|
|
1124
1251
|
var InitializeCronScheduleBodySchema = RegisterCommonScheduleBodySchema.merge(CronMetadataSchema);
|
|
1125
|
-
var RegisterScheduleBodySchema =
|
|
1252
|
+
var RegisterScheduleBodySchema = import_zod11.z.discriminatedUnion("type", [
|
|
1126
1253
|
RegisterIntervalScheduleBodySchema,
|
|
1127
1254
|
InitializeCronScheduleBodySchema
|
|
1128
1255
|
]);
|
|
1129
|
-
var RegisterScheduleResponseBodySchema =
|
|
1130
|
-
id:
|
|
1256
|
+
var RegisterScheduleResponseBodySchema = import_zod11.z.object({
|
|
1257
|
+
id: import_zod11.z.string(),
|
|
1131
1258
|
schedule: ScheduleMetadataSchema,
|
|
1132
|
-
metadata:
|
|
1133
|
-
active:
|
|
1259
|
+
metadata: import_zod11.z.any(),
|
|
1260
|
+
active: import_zod11.z.boolean()
|
|
1134
1261
|
});
|
|
1135
|
-
var CreateExternalConnectionBodySchema =
|
|
1136
|
-
accessToken:
|
|
1137
|
-
type:
|
|
1262
|
+
var CreateExternalConnectionBodySchema = import_zod11.z.object({
|
|
1263
|
+
accessToken: import_zod11.z.string(),
|
|
1264
|
+
type: import_zod11.z.enum([
|
|
1138
1265
|
"oauth2"
|
|
1139
1266
|
]),
|
|
1140
|
-
scopes:
|
|
1141
|
-
metadata:
|
|
1267
|
+
scopes: import_zod11.z.array(import_zod11.z.string()).optional(),
|
|
1268
|
+
metadata: import_zod11.z.any()
|
|
1269
|
+
});
|
|
1270
|
+
var GetRunStatusesSchema = import_zod11.z.object({
|
|
1271
|
+
run: import_zod11.z.object({
|
|
1272
|
+
id: import_zod11.z.string(),
|
|
1273
|
+
status: RunStatusSchema,
|
|
1274
|
+
output: import_zod11.z.any().optional()
|
|
1275
|
+
}),
|
|
1276
|
+
statuses: import_zod11.z.array(JobRunStatusRecordSchema)
|
|
1142
1277
|
});
|
|
1143
1278
|
|
|
1144
1279
|
// src/schemas/notifications.ts
|
|
1145
|
-
var
|
|
1280
|
+
var import_zod12 = require("zod");
|
|
1146
1281
|
var MISSING_CONNECTION_NOTIFICATION = "dev.trigger.notifications.missingConnection";
|
|
1147
1282
|
var MISSING_CONNECTION_RESOLVED_NOTIFICATION = "dev.trigger.notifications.missingConnectionResolved";
|
|
1148
|
-
var CommonMissingConnectionNotificationPayloadSchema =
|
|
1149
|
-
id:
|
|
1150
|
-
client:
|
|
1151
|
-
id:
|
|
1152
|
-
title:
|
|
1153
|
-
scopes:
|
|
1154
|
-
createdAt:
|
|
1155
|
-
updatedAt:
|
|
1283
|
+
var CommonMissingConnectionNotificationPayloadSchema = import_zod12.z.object({
|
|
1284
|
+
id: import_zod12.z.string(),
|
|
1285
|
+
client: import_zod12.z.object({
|
|
1286
|
+
id: import_zod12.z.string(),
|
|
1287
|
+
title: import_zod12.z.string(),
|
|
1288
|
+
scopes: import_zod12.z.array(import_zod12.z.string()),
|
|
1289
|
+
createdAt: import_zod12.z.coerce.date(),
|
|
1290
|
+
updatedAt: import_zod12.z.coerce.date()
|
|
1156
1291
|
}),
|
|
1157
|
-
authorizationUrl:
|
|
1292
|
+
authorizationUrl: import_zod12.z.string()
|
|
1158
1293
|
});
|
|
1159
1294
|
var MissingDeveloperConnectionNotificationPayloadSchema = CommonMissingConnectionNotificationPayloadSchema.extend({
|
|
1160
|
-
type:
|
|
1295
|
+
type: import_zod12.z.literal("DEVELOPER")
|
|
1161
1296
|
});
|
|
1162
1297
|
var MissingExternalConnectionNotificationPayloadSchema = CommonMissingConnectionNotificationPayloadSchema.extend({
|
|
1163
|
-
type:
|
|
1164
|
-
account:
|
|
1165
|
-
id:
|
|
1166
|
-
metadata:
|
|
1298
|
+
type: import_zod12.z.literal("EXTERNAL"),
|
|
1299
|
+
account: import_zod12.z.object({
|
|
1300
|
+
id: import_zod12.z.string(),
|
|
1301
|
+
metadata: import_zod12.z.any()
|
|
1167
1302
|
})
|
|
1168
1303
|
});
|
|
1169
|
-
var MissingConnectionNotificationPayloadSchema =
|
|
1304
|
+
var MissingConnectionNotificationPayloadSchema = import_zod12.z.discriminatedUnion("type", [
|
|
1170
1305
|
MissingDeveloperConnectionNotificationPayloadSchema,
|
|
1171
1306
|
MissingExternalConnectionNotificationPayloadSchema
|
|
1172
1307
|
]);
|
|
1173
|
-
var CommonMissingConnectionNotificationResolvedPayloadSchema =
|
|
1174
|
-
id:
|
|
1175
|
-
client:
|
|
1176
|
-
id:
|
|
1177
|
-
title:
|
|
1178
|
-
scopes:
|
|
1179
|
-
createdAt:
|
|
1180
|
-
updatedAt:
|
|
1181
|
-
integrationIdentifier:
|
|
1182
|
-
integrationAuthMethod:
|
|
1308
|
+
var CommonMissingConnectionNotificationResolvedPayloadSchema = import_zod12.z.object({
|
|
1309
|
+
id: import_zod12.z.string(),
|
|
1310
|
+
client: import_zod12.z.object({
|
|
1311
|
+
id: import_zod12.z.string(),
|
|
1312
|
+
title: import_zod12.z.string(),
|
|
1313
|
+
scopes: import_zod12.z.array(import_zod12.z.string()),
|
|
1314
|
+
createdAt: import_zod12.z.coerce.date(),
|
|
1315
|
+
updatedAt: import_zod12.z.coerce.date(),
|
|
1316
|
+
integrationIdentifier: import_zod12.z.string(),
|
|
1317
|
+
integrationAuthMethod: import_zod12.z.string()
|
|
1183
1318
|
}),
|
|
1184
|
-
expiresAt:
|
|
1319
|
+
expiresAt: import_zod12.z.coerce.date()
|
|
1185
1320
|
});
|
|
1186
1321
|
var MissingDeveloperConnectionResolvedNotificationPayloadSchema = CommonMissingConnectionNotificationResolvedPayloadSchema.extend({
|
|
1187
|
-
type:
|
|
1322
|
+
type: import_zod12.z.literal("DEVELOPER")
|
|
1188
1323
|
});
|
|
1189
1324
|
var MissingExternalConnectionResolvedNotificationPayloadSchema = CommonMissingConnectionNotificationResolvedPayloadSchema.extend({
|
|
1190
|
-
type:
|
|
1191
|
-
account:
|
|
1192
|
-
id:
|
|
1193
|
-
metadata:
|
|
1325
|
+
type: import_zod12.z.literal("EXTERNAL"),
|
|
1326
|
+
account: import_zod12.z.object({
|
|
1327
|
+
id: import_zod12.z.string(),
|
|
1328
|
+
metadata: import_zod12.z.any()
|
|
1194
1329
|
})
|
|
1195
1330
|
});
|
|
1196
|
-
var MissingConnectionResolvedNotificationPayloadSchema =
|
|
1331
|
+
var MissingConnectionResolvedNotificationPayloadSchema = import_zod12.z.discriminatedUnion("type", [
|
|
1197
1332
|
MissingDeveloperConnectionResolvedNotificationPayloadSchema,
|
|
1198
1333
|
MissingExternalConnectionResolvedNotificationPayloadSchema
|
|
1199
1334
|
]);
|
|
1200
1335
|
|
|
1201
1336
|
// src/schemas/fetch.ts
|
|
1202
|
-
var
|
|
1203
|
-
var FetchRetryHeadersStrategySchema =
|
|
1337
|
+
var import_zod13 = require("zod");
|
|
1338
|
+
var FetchRetryHeadersStrategySchema = import_zod13.z.object({
|
|
1204
1339
|
/** The `headers` strategy retries the request using info from the response headers. */
|
|
1205
|
-
strategy:
|
|
1340
|
+
strategy: import_zod13.z.literal("headers"),
|
|
1206
1341
|
/** The header to use to determine the maximum number of times to retry the request. */
|
|
1207
|
-
limitHeader:
|
|
1342
|
+
limitHeader: import_zod13.z.string(),
|
|
1208
1343
|
/** The header to use to determine the number of remaining retries. */
|
|
1209
|
-
remainingHeader:
|
|
1344
|
+
remainingHeader: import_zod13.z.string(),
|
|
1210
1345
|
/** The header to use to determine the time when the number of remaining retries will be reset. */
|
|
1211
|
-
resetHeader:
|
|
1346
|
+
resetHeader: import_zod13.z.string()
|
|
1212
1347
|
});
|
|
1213
1348
|
var FetchRetryBackoffStrategySchema = RetryOptionsSchema.extend({
|
|
1214
1349
|
/** The `backoff` strategy retries the request with an exponential backoff. */
|
|
1215
|
-
strategy:
|
|
1350
|
+
strategy: import_zod13.z.literal("backoff")
|
|
1216
1351
|
});
|
|
1217
|
-
var FetchRetryStrategySchema =
|
|
1352
|
+
var FetchRetryStrategySchema = import_zod13.z.discriminatedUnion("strategy", [
|
|
1218
1353
|
FetchRetryHeadersStrategySchema,
|
|
1219
1354
|
FetchRetryBackoffStrategySchema
|
|
1220
1355
|
]);
|
|
1221
|
-
var FetchRequestInitSchema =
|
|
1356
|
+
var FetchRequestInitSchema = import_zod13.z.object({
|
|
1222
1357
|
/** The HTTP method to use for the request. */
|
|
1223
|
-
method:
|
|
1358
|
+
method: import_zod13.z.string().optional(),
|
|
1224
1359
|
/** 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. */
|
|
1225
|
-
headers:
|
|
1226
|
-
|
|
1360
|
+
headers: import_zod13.z.record(import_zod13.z.union([
|
|
1361
|
+
import_zod13.z.string(),
|
|
1227
1362
|
RedactStringSchema
|
|
1228
1363
|
])).optional(),
|
|
1229
1364
|
/** The body of the request. */
|
|
1230
|
-
body:
|
|
1231
|
-
|
|
1232
|
-
|
|
1365
|
+
body: import_zod13.z.union([
|
|
1366
|
+
import_zod13.z.string(),
|
|
1367
|
+
import_zod13.z.instanceof(ArrayBuffer)
|
|
1233
1368
|
]).optional()
|
|
1234
1369
|
});
|
|
1235
|
-
var FetchRetryOptionsSchema =
|
|
1236
|
-
var FetchOperationSchema =
|
|
1237
|
-
url:
|
|
1370
|
+
var FetchRetryOptionsSchema = import_zod13.z.record(FetchRetryStrategySchema);
|
|
1371
|
+
var FetchOperationSchema = import_zod13.z.object({
|
|
1372
|
+
url: import_zod13.z.string(),
|
|
1238
1373
|
requestInit: FetchRequestInitSchema.optional(),
|
|
1239
|
-
retry:
|
|
1374
|
+
retry: import_zod13.z.record(FetchRetryStrategySchema).optional()
|
|
1240
1375
|
});
|
|
1241
1376
|
|
|
1242
1377
|
// src/schemas/events.ts
|
|
1243
|
-
var
|
|
1244
|
-
|
|
1245
|
-
// src/schemas/runs.ts
|
|
1246
|
-
var import_zod12 = require("zod");
|
|
1247
|
-
var RunStatusSchema = import_zod12.z.union([
|
|
1248
|
-
import_zod12.z.literal("PENDING"),
|
|
1249
|
-
import_zod12.z.literal("QUEUED"),
|
|
1250
|
-
import_zod12.z.literal("WAITING_ON_CONNECTIONS"),
|
|
1251
|
-
import_zod12.z.literal("PREPROCESSING"),
|
|
1252
|
-
import_zod12.z.literal("STARTED"),
|
|
1253
|
-
import_zod12.z.literal("SUCCESS"),
|
|
1254
|
-
import_zod12.z.literal("FAILURE"),
|
|
1255
|
-
import_zod12.z.literal("TIMED_OUT"),
|
|
1256
|
-
import_zod12.z.literal("ABORTED"),
|
|
1257
|
-
import_zod12.z.literal("CANCELED")
|
|
1258
|
-
]);
|
|
1259
|
-
var RunTaskSchema = import_zod12.z.object({
|
|
1260
|
-
/** The Task id */
|
|
1261
|
-
id: import_zod12.z.string(),
|
|
1262
|
-
/** The key that you defined when creating the Task, the first param in any task. */
|
|
1263
|
-
displayKey: import_zod12.z.string().nullable(),
|
|
1264
|
-
/** The Task status */
|
|
1265
|
-
status: TaskStatusSchema,
|
|
1266
|
-
/** The name of the Task */
|
|
1267
|
-
name: import_zod12.z.string(),
|
|
1268
|
-
/** The icon of the Task, a string.
|
|
1269
|
-
* For integrations, this will be a lowercase name of the company.
|
|
1270
|
-
* Can be used with the [@trigger.dev/companyicons](https://www.npmjs.com/package/@trigger.dev/companyicons) package to display an svg. */
|
|
1271
|
-
icon: import_zod12.z.string().nullable(),
|
|
1272
|
-
/** When the task started */
|
|
1273
|
-
startedAt: import_zod12.z.coerce.date().nullable(),
|
|
1274
|
-
/** When the task completed */
|
|
1275
|
-
completedAt: import_zod12.z.coerce.date().nullable()
|
|
1276
|
-
});
|
|
1277
|
-
var RunTaskWithSubtasksSchema = RunTaskSchema.extend({
|
|
1278
|
-
subtasks: import_zod12.z.lazy(() => RunTaskWithSubtasksSchema.array()).optional()
|
|
1279
|
-
});
|
|
1280
|
-
var GetRunOptionsSchema = import_zod12.z.object({
|
|
1281
|
-
/** Return subtasks, which appear in a `subtasks` array on a task. @default false */
|
|
1282
|
-
subtasks: import_zod12.z.boolean().optional(),
|
|
1283
|
-
/** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */
|
|
1284
|
-
cursor: import_zod12.z.string().optional(),
|
|
1285
|
-
/** How many tasks you want to return in one go, max 50. @default 20 */
|
|
1286
|
-
take: import_zod12.z.number().optional()
|
|
1287
|
-
});
|
|
1288
|
-
var GetRunOptionsWithTaskDetailsSchema = GetRunOptionsSchema.extend({
|
|
1289
|
-
/** If `true`, it returns the `params` and `output` of all tasks. @default false */
|
|
1290
|
-
taskdetails: import_zod12.z.boolean().optional()
|
|
1291
|
-
});
|
|
1292
|
-
var RunSchema = import_zod12.z.object({
|
|
1293
|
-
/** The Run id */
|
|
1294
|
-
id: import_zod12.z.string(),
|
|
1295
|
-
/** The Run status */
|
|
1296
|
-
status: RunStatusSchema,
|
|
1297
|
-
/** When the run started */
|
|
1298
|
-
startedAt: import_zod12.z.coerce.date().nullable(),
|
|
1299
|
-
/** When the run was last updated */
|
|
1300
|
-
updatedAt: import_zod12.z.coerce.date().nullable(),
|
|
1301
|
-
/** When the run was completed */
|
|
1302
|
-
completedAt: import_zod12.z.coerce.date().nullable()
|
|
1303
|
-
});
|
|
1304
|
-
var GetRunSchema = RunSchema.extend({
|
|
1305
|
-
/** The output of the run */
|
|
1306
|
-
output: import_zod12.z.any().optional(),
|
|
1307
|
-
/** The tasks from the run */
|
|
1308
|
-
tasks: import_zod12.z.array(RunTaskWithSubtasksSchema),
|
|
1309
|
-
/** If there are more tasks, you can use this to get them */
|
|
1310
|
-
nextCursor: import_zod12.z.string().optional()
|
|
1311
|
-
});
|
|
1312
|
-
var GetRunsOptionsSchema = import_zod12.z.object({
|
|
1313
|
-
/** You can use this to get more tasks, if there are more than are returned in a single batch @default undefined */
|
|
1314
|
-
cursor: import_zod12.z.string().optional(),
|
|
1315
|
-
/** How many runs you want to return in one go, max 50. @default 20 */
|
|
1316
|
-
take: import_zod12.z.number().optional()
|
|
1317
|
-
});
|
|
1318
|
-
var GetRunsSchema = import_zod12.z.object({
|
|
1319
|
-
/** The runs from the query */
|
|
1320
|
-
runs: RunSchema.array(),
|
|
1321
|
-
/** If there are more runs, you can use this to get them */
|
|
1322
|
-
nextCursor: import_zod12.z.string().optional()
|
|
1323
|
-
});
|
|
1324
|
-
|
|
1325
|
-
// src/schemas/events.ts
|
|
1326
|
-
var GetEventSchema = import_zod13.z.object({
|
|
1378
|
+
var import_zod14 = require("zod");
|
|
1379
|
+
var GetEventSchema = import_zod14.z.object({
|
|
1327
1380
|
/** The event id */
|
|
1328
|
-
id:
|
|
1381
|
+
id: import_zod14.z.string(),
|
|
1329
1382
|
/** The event name */
|
|
1330
|
-
name:
|
|
1383
|
+
name: import_zod14.z.string(),
|
|
1331
1384
|
/** When the event was created */
|
|
1332
|
-
createdAt:
|
|
1385
|
+
createdAt: import_zod14.z.coerce.date(),
|
|
1333
1386
|
/** When the event was last updated */
|
|
1334
|
-
updatedAt:
|
|
1387
|
+
updatedAt: import_zod14.z.coerce.date(),
|
|
1335
1388
|
/** The runs that were triggered by the event */
|
|
1336
|
-
runs:
|
|
1389
|
+
runs: import_zod14.z.array(import_zod14.z.object({
|
|
1337
1390
|
/** The Run id */
|
|
1338
|
-
id:
|
|
1391
|
+
id: import_zod14.z.string(),
|
|
1339
1392
|
/** The Run status */
|
|
1340
1393
|
status: RunStatusSchema,
|
|
1341
1394
|
/** When the run started */
|
|
1342
|
-
startedAt:
|
|
1395
|
+
startedAt: import_zod14.z.coerce.date().optional().nullable(),
|
|
1343
1396
|
/** When the run completed */
|
|
1344
|
-
completedAt:
|
|
1397
|
+
completedAt: import_zod14.z.coerce.date().optional().nullable()
|
|
1345
1398
|
}))
|
|
1346
1399
|
});
|
|
1347
1400
|
|
|
@@ -1568,130 +1621,4 @@ function contentFilterMatches(actualValue, contentFilter) {
|
|
|
1568
1621
|
return true;
|
|
1569
1622
|
}
|
|
1570
1623
|
__name(contentFilterMatches, "contentFilterMatches");
|
|
1571
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
1572
|
-
0 && (module.exports = {
|
|
1573
|
-
ApiEventLogSchema,
|
|
1574
|
-
CachedTaskSchema,
|
|
1575
|
-
CommonMissingConnectionNotificationPayloadSchema,
|
|
1576
|
-
CommonMissingConnectionNotificationResolvedPayloadSchema,
|
|
1577
|
-
CompleteTaskBodyInputSchema,
|
|
1578
|
-
ConnectionAuthSchema,
|
|
1579
|
-
CreateExternalConnectionBodySchema,
|
|
1580
|
-
CreateRunResponseBodySchema,
|
|
1581
|
-
CronMetadataSchema,
|
|
1582
|
-
CronOptionsSchema,
|
|
1583
|
-
DeliverEventResponseSchema,
|
|
1584
|
-
DeserializedJsonSchema,
|
|
1585
|
-
DisplayPropertiesSchema,
|
|
1586
|
-
DisplayPropertySchema,
|
|
1587
|
-
DynamicTriggerEndpointMetadataSchema,
|
|
1588
|
-
DynamicTriggerMetadataSchema,
|
|
1589
|
-
ErrorWithStackSchema,
|
|
1590
|
-
EventExampleSchema,
|
|
1591
|
-
EventFilterSchema,
|
|
1592
|
-
EventRuleSchema,
|
|
1593
|
-
EventSpecificationSchema,
|
|
1594
|
-
FailTaskBodyInputSchema,
|
|
1595
|
-
FetchOperationSchema,
|
|
1596
|
-
FetchRequestInitSchema,
|
|
1597
|
-
FetchRetryBackoffStrategySchema,
|
|
1598
|
-
FetchRetryHeadersStrategySchema,
|
|
1599
|
-
FetchRetryOptionsSchema,
|
|
1600
|
-
FetchRetryStrategySchema,
|
|
1601
|
-
GetEventSchema,
|
|
1602
|
-
GetRunSchema,
|
|
1603
|
-
GetRunsSchema,
|
|
1604
|
-
HandleTriggerSourceSchema,
|
|
1605
|
-
HttpSourceRequestHeadersSchema,
|
|
1606
|
-
HttpSourceRequestSchema,
|
|
1607
|
-
HttpSourceResponseSchema,
|
|
1608
|
-
IndexEndpointResponseSchema,
|
|
1609
|
-
InitializeCronScheduleBodySchema,
|
|
1610
|
-
InitializeTriggerBodySchema,
|
|
1611
|
-
IntegrationConfigSchema,
|
|
1612
|
-
IntegrationMetadataSchema,
|
|
1613
|
-
IntervalMetadataSchema,
|
|
1614
|
-
IntervalOptionsSchema,
|
|
1615
|
-
JobMetadataSchema,
|
|
1616
|
-
LogMessageSchema,
|
|
1617
|
-
Logger,
|
|
1618
|
-
MISSING_CONNECTION_NOTIFICATION,
|
|
1619
|
-
MISSING_CONNECTION_RESOLVED_NOTIFICATION,
|
|
1620
|
-
MissingConnectionNotificationPayloadSchema,
|
|
1621
|
-
MissingConnectionResolvedNotificationPayloadSchema,
|
|
1622
|
-
MissingDeveloperConnectionNotificationPayloadSchema,
|
|
1623
|
-
MissingDeveloperConnectionResolvedNotificationPayloadSchema,
|
|
1624
|
-
MissingExternalConnectionNotificationPayloadSchema,
|
|
1625
|
-
MissingExternalConnectionResolvedNotificationPayloadSchema,
|
|
1626
|
-
NormalizedRequestSchema,
|
|
1627
|
-
NormalizedResponseSchema,
|
|
1628
|
-
PongErrorResponseSchema,
|
|
1629
|
-
PongResponseSchema,
|
|
1630
|
-
PongSuccessResponseSchema,
|
|
1631
|
-
PreprocessRunBodySchema,
|
|
1632
|
-
PreprocessRunResponseSchema,
|
|
1633
|
-
QueueOptionsSchema,
|
|
1634
|
-
REGISTER_SOURCE_EVENT_V1,
|
|
1635
|
-
REGISTER_SOURCE_EVENT_V2,
|
|
1636
|
-
RawEventSchema,
|
|
1637
|
-
RedactSchema,
|
|
1638
|
-
RedactStringSchema,
|
|
1639
|
-
RegisterDynamicSchedulePayloadSchema,
|
|
1640
|
-
RegisterHTTPTriggerSourceBodySchema,
|
|
1641
|
-
RegisterIntervalScheduleBodySchema,
|
|
1642
|
-
RegisterSMTPTriggerSourceBodySchema,
|
|
1643
|
-
RegisterSQSTriggerSourceBodySchema,
|
|
1644
|
-
RegisterScheduleBodySchema,
|
|
1645
|
-
RegisterScheduleResponseBodySchema,
|
|
1646
|
-
RegisterSourceChannelBodySchema,
|
|
1647
|
-
RegisterSourceEventSchemaV1,
|
|
1648
|
-
RegisterSourceEventSchemaV2,
|
|
1649
|
-
RegisterTriggerBodySchemaV1,
|
|
1650
|
-
RegisterTriggerBodySchemaV2,
|
|
1651
|
-
RegisterTriggerSourceSchema,
|
|
1652
|
-
RetryOptionsSchema,
|
|
1653
|
-
RunJobBodySchema,
|
|
1654
|
-
RunJobCanceledWithTaskSchema,
|
|
1655
|
-
RunJobErrorSchema,
|
|
1656
|
-
RunJobResponseSchema,
|
|
1657
|
-
RunJobResumeWithTaskSchema,
|
|
1658
|
-
RunJobRetryWithTaskSchema,
|
|
1659
|
-
RunJobSuccessSchema,
|
|
1660
|
-
RunSourceContextSchema,
|
|
1661
|
-
RunStatusSchema,
|
|
1662
|
-
RunTaskBodyInputSchema,
|
|
1663
|
-
RunTaskBodyOutputSchema,
|
|
1664
|
-
RunTaskOptionsSchema,
|
|
1665
|
-
RunTaskSchema,
|
|
1666
|
-
RuntimeEnvironmentTypeSchema,
|
|
1667
|
-
SCHEDULED_EVENT,
|
|
1668
|
-
ScheduleMetadataSchema,
|
|
1669
|
-
ScheduledPayloadSchema,
|
|
1670
|
-
ScheduledTriggerMetadataSchema,
|
|
1671
|
-
SendEventBodySchema,
|
|
1672
|
-
SendEventOptionsSchema,
|
|
1673
|
-
SerializableJsonSchema,
|
|
1674
|
-
ServerTaskSchema,
|
|
1675
|
-
SourceMetadataV2Schema,
|
|
1676
|
-
StaticTriggerMetadataSchema,
|
|
1677
|
-
StyleSchema,
|
|
1678
|
-
TaskSchema,
|
|
1679
|
-
TaskStatusSchema,
|
|
1680
|
-
TriggerMetadataSchema,
|
|
1681
|
-
TriggerSourceSchema,
|
|
1682
|
-
UpdateTriggerSourceBodyV1Schema,
|
|
1683
|
-
UpdateTriggerSourceBodyV2Schema,
|
|
1684
|
-
ValidateErrorResponseSchema,
|
|
1685
|
-
ValidateResponseSchema,
|
|
1686
|
-
ValidateSuccessResponseSchema,
|
|
1687
|
-
addMissingVersionField,
|
|
1688
|
-
calculateRetryAt,
|
|
1689
|
-
currentDate,
|
|
1690
|
-
currentTimestampMilliseconds,
|
|
1691
|
-
currentTimestampSeconds,
|
|
1692
|
-
deepMergeFilters,
|
|
1693
|
-
eventFilterMatches,
|
|
1694
|
-
replacements,
|
|
1695
|
-
urlWithSearchParams
|
|
1696
|
-
});
|
|
1697
1624
|
//# sourceMappingURL=index.js.map
|