@trigger.dev/core 0.0.0-v3-prerelease-20240717092755 → 0.0.0-v3-prerelease-20240730135037
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/{catalog-U7_q4XsM.d.mts → catalog-H7yFiZ60.d.mts} +1 -1
- package/dist/{catalog-bSnBE19I.d.ts → catalog-h79CG5Wy.d.ts} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{messages-CHPNqMXf.d.mts → messages-mhHZiNGN.d.mts} +202 -9
- package/dist/{messages-CHPNqMXf.d.ts → messages-mhHZiNGN.d.ts} +202 -9
- package/dist/retry.d.mts +1 -1
- package/dist/retry.d.ts +1 -1
- package/dist/schemas/index.d.mts +6 -6
- package/dist/schemas/index.d.ts +6 -6
- package/dist/{schemas-WHkFakb3.d.mts → schemas-C9ssfehv.d.mts} +47 -1
- package/dist/{schemas-WHkFakb3.d.ts → schemas-C9ssfehv.d.ts} +47 -1
- package/dist/v3/index.d.mts +49 -29
- package/dist/v3/index.d.ts +49 -29
- package/dist/v3/index.js +65 -9
- package/dist/v3/index.js.map +1 -1
- package/dist/v3/index.mjs +62 -10
- package/dist/v3/index.mjs.map +1 -1
- package/dist/v3/otel/index.js +1 -1
- package/dist/v3/otel/index.js.map +1 -1
- package/dist/v3/otel/index.mjs +1 -1
- package/dist/v3/otel/index.mjs.map +1 -1
- package/dist/v3/prod/index.d.mts +1 -1
- package/dist/v3/prod/index.d.ts +1 -1
- package/dist/v3/schemas/index.d.mts +166 -4
- package/dist/v3/schemas/index.d.ts +166 -4
- package/dist/v3/schemas/index.js +52 -8
- package/dist/v3/schemas/index.js.map +1 -1
- package/dist/v3/schemas/index.mjs +49 -9
- package/dist/v3/schemas/index.mjs.map +1 -1
- package/dist/v3/utils/ioSerialization.js +48 -4
- package/dist/v3/utils/ioSerialization.js.map +1 -1
- package/dist/v3/utils/ioSerialization.mjs +48 -4
- package/dist/v3/utils/ioSerialization.mjs.map +1 -1
- package/dist/v3/utils/retries.d.mts +1 -1
- package/dist/v3/utils/retries.d.ts +1 -1
- package/dist/v3/workers/index.d.mts +4 -4
- package/dist/v3/workers/index.d.ts +4 -4
- package/dist/v3/workers/index.js +48 -4
- package/dist/v3/workers/index.js.map +1 -1
- package/dist/v3/workers/index.mjs +48 -4
- package/dist/v3/workers/index.mjs.map +1 -1
- package/dist/v3/zodfetch.d.mts +1 -1
- package/dist/v3/zodfetch.d.ts +1 -1
- package/package.json +1 -1
- package/dist/{api-a39zAY3E.d.mts → api-Pl9fxB8v.d.mts} +153 -153
- package/dist/{api--StDLb4h.d.ts → api-sNoooMbT.d.ts} +153 -153
|
@@ -173,7 +173,7 @@ function isRecord(value) {
|
|
|
173
173
|
__name(isRecord, "isRecord");
|
|
174
174
|
|
|
175
175
|
// package.json
|
|
176
|
-
var version = "0.0.0-v3-prerelease-
|
|
176
|
+
var version = "0.0.0-v3-prerelease-20240730135037";
|
|
177
177
|
var MachineCpu = z.union([
|
|
178
178
|
z.literal(0.25),
|
|
179
179
|
z.literal(0.5),
|
|
@@ -487,13 +487,18 @@ var QueueOptions = z.object({
|
|
|
487
487
|
/** @deprecated This feature is coming soon */
|
|
488
488
|
rateLimit: RateLimitOptions.optional()
|
|
489
489
|
});
|
|
490
|
+
var ScheduleMetadata = z.object({
|
|
491
|
+
cron: z.string(),
|
|
492
|
+
timezone: z.string()
|
|
493
|
+
});
|
|
490
494
|
z.object({
|
|
491
495
|
id: z.string(),
|
|
492
496
|
packageVersion: z.string(),
|
|
493
497
|
queue: QueueOptions.optional(),
|
|
494
498
|
retry: RetryOptions.optional(),
|
|
495
499
|
machine: MachineConfig.optional(),
|
|
496
|
-
triggerSource: z.string().optional()
|
|
500
|
+
triggerSource: z.string().optional(),
|
|
501
|
+
schedule: ScheduleMetadata.optional()
|
|
497
502
|
});
|
|
498
503
|
z.object({
|
|
499
504
|
filePath: z.string(),
|
|
@@ -506,6 +511,7 @@ z.object({
|
|
|
506
511
|
retry: RetryOptions.optional(),
|
|
507
512
|
machine: MachineConfig.optional(),
|
|
508
513
|
triggerSource: z.string().optional(),
|
|
514
|
+
schedule: ScheduleMetadata.optional(),
|
|
509
515
|
filePath: z.string(),
|
|
510
516
|
exportName: z.string()
|
|
511
517
|
});
|
|
@@ -567,7 +573,8 @@ var TaskResource = z.object({
|
|
|
567
573
|
queue: QueueOptions.optional(),
|
|
568
574
|
retry: RetryOptions.optional(),
|
|
569
575
|
machine: MachineConfig.optional(),
|
|
570
|
-
triggerSource: z.string().optional()
|
|
576
|
+
triggerSource: z.string().optional(),
|
|
577
|
+
schedule: ScheduleMetadata.optional()
|
|
571
578
|
});
|
|
572
579
|
var BackgroundWorkerMetadata = z.object({
|
|
573
580
|
packageVersion: z.string(),
|
|
@@ -620,6 +627,11 @@ z.object({
|
|
|
620
627
|
version: z.string(),
|
|
621
628
|
contentHash: z.string()
|
|
622
629
|
});
|
|
630
|
+
var RunTag = z.string().max(64, "Tags must be less than 64 characters");
|
|
631
|
+
var RunTags = z.union([
|
|
632
|
+
RunTag,
|
|
633
|
+
RunTag.array().max(3, "You can only set a maximum of 3 tags on a run.")
|
|
634
|
+
]);
|
|
623
635
|
var TriggerTaskRequestBody = z.object({
|
|
624
636
|
payload: z.any(),
|
|
625
637
|
context: z.any(),
|
|
@@ -634,6 +646,7 @@ var TriggerTaskRequestBody = z.object({
|
|
|
634
646
|
payloadType: z.string().optional(),
|
|
635
647
|
delay: z.string().or(z.coerce.date()).optional(),
|
|
636
648
|
ttl: z.string().or(z.number().nonnegative().int()).optional(),
|
|
649
|
+
tags: RunTags.optional(),
|
|
637
650
|
maxAttempts: z.number().int().optional()
|
|
638
651
|
}).optional()
|
|
639
652
|
});
|
|
@@ -661,6 +674,9 @@ z.object({
|
|
|
661
674
|
])
|
|
662
675
|
}))
|
|
663
676
|
});
|
|
677
|
+
z.object({
|
|
678
|
+
tags: RunTags
|
|
679
|
+
});
|
|
664
680
|
z.object({
|
|
665
681
|
delay: z.string().or(z.coerce.date())
|
|
666
682
|
});
|
|
@@ -735,10 +751,21 @@ var ReplayRunResponse = z.object({
|
|
|
735
751
|
var CanceledRunResponse = z.object({
|
|
736
752
|
id: z.string()
|
|
737
753
|
});
|
|
754
|
+
var ScheduleType = z.union([
|
|
755
|
+
z.literal("DECLARATIVE"),
|
|
756
|
+
z.literal("IMPERATIVE")
|
|
757
|
+
]);
|
|
738
758
|
z.object({
|
|
739
759
|
/** The schedule id associated with this run (you can have many schedules for the same task).
|
|
740
760
|
You can use this to remove the schedule, update it, etc */
|
|
741
761
|
scheduleId: z.string(),
|
|
762
|
+
/** The type of schedule – `"DECLARATIVE"` or `"IMPERATIVE"`.
|
|
763
|
+
*
|
|
764
|
+
* **DECLARATIVE** – defined inline on your `schedules.task` using the `cron` property. They can only be created, updated or deleted by modifying the `cron` property on your task.
|
|
765
|
+
*
|
|
766
|
+
* **IMPERATIVE** – created using the `schedules.create` functions or in the dashboard.
|
|
767
|
+
*/
|
|
768
|
+
type: ScheduleType,
|
|
742
769
|
/** When the task was scheduled to run.
|
|
743
770
|
* Note this will be slightly different from `new Date()` because it takes a few ms to run the task.
|
|
744
771
|
*
|
|
@@ -814,6 +841,7 @@ var ScheduleGenerator = z.object({
|
|
|
814
841
|
});
|
|
815
842
|
var ScheduleObject = z.object({
|
|
816
843
|
id: z.string(),
|
|
844
|
+
type: ScheduleType,
|
|
817
845
|
task: z.string(),
|
|
818
846
|
active: z.boolean(),
|
|
819
847
|
deduplicationKey: z.string().nullish(),
|
|
@@ -911,7 +939,11 @@ var CommonRunFields = {
|
|
|
911
939
|
finishedAt: z.coerce.date().optional(),
|
|
912
940
|
delayedUntil: z.coerce.date().optional(),
|
|
913
941
|
ttl: z.string().optional(),
|
|
914
|
-
expiredAt: z.coerce.date().optional()
|
|
942
|
+
expiredAt: z.coerce.date().optional(),
|
|
943
|
+
tags: z.string().array(),
|
|
944
|
+
costInCents: z.number(),
|
|
945
|
+
baseCostInCents: z.number(),
|
|
946
|
+
durationMs: z.number()
|
|
915
947
|
};
|
|
916
948
|
var RetrieveRunResponse = z.object({
|
|
917
949
|
...CommonRunFields,
|
|
@@ -1852,6 +1884,15 @@ var _ApiClient = class _ApiClient {
|
|
|
1852
1884
|
body: JSON.stringify(body)
|
|
1853
1885
|
}, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
|
|
1854
1886
|
}
|
|
1887
|
+
addTags(runId, body, requestOptions) {
|
|
1888
|
+
return zodfetch(z.object({
|
|
1889
|
+
message: z.string()
|
|
1890
|
+
}), `${this.baseUrl}/api/v1/runs/${runId}/tags`, {
|
|
1891
|
+
method: "POST",
|
|
1892
|
+
headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false),
|
|
1893
|
+
body: JSON.stringify(body)
|
|
1894
|
+
}, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
|
|
1895
|
+
}
|
|
1855
1896
|
createSchedule(options, requestOptions) {
|
|
1856
1897
|
return zodfetch(ScheduleObject, `${this.baseUrl}/api/v1/schedules`, {
|
|
1857
1898
|
method: "POST",
|
|
@@ -1979,6 +2020,9 @@ function createSearchQueryForListRuns(query) {
|
|
|
1979
2020
|
if (query.bulkAction) {
|
|
1980
2021
|
searchParams.append("filter[bulkAction]", query.bulkAction);
|
|
1981
2022
|
}
|
|
2023
|
+
if (query.tag) {
|
|
2024
|
+
searchParams.append("filter[tag]", Array.isArray(query.tag) ? query.tag.join(",") : query.tag);
|
|
2025
|
+
}
|
|
1982
2026
|
if (query.schedule) {
|
|
1983
2027
|
searchParams.append("filter[schedule]", query.schedule);
|
|
1984
2028
|
}
|