@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
|
@@ -175,7 +175,7 @@ function isRecord(value) {
|
|
|
175
175
|
__name(isRecord, "isRecord");
|
|
176
176
|
|
|
177
177
|
// package.json
|
|
178
|
-
var version = "0.0.0-v3-prerelease-
|
|
178
|
+
var version = "0.0.0-v3-prerelease-20240730135037";
|
|
179
179
|
var MachineCpu = zod.z.union([
|
|
180
180
|
zod.z.literal(0.25),
|
|
181
181
|
zod.z.literal(0.5),
|
|
@@ -489,13 +489,18 @@ var QueueOptions = zod.z.object({
|
|
|
489
489
|
/** @deprecated This feature is coming soon */
|
|
490
490
|
rateLimit: RateLimitOptions.optional()
|
|
491
491
|
});
|
|
492
|
+
var ScheduleMetadata = zod.z.object({
|
|
493
|
+
cron: zod.z.string(),
|
|
494
|
+
timezone: zod.z.string()
|
|
495
|
+
});
|
|
492
496
|
zod.z.object({
|
|
493
497
|
id: zod.z.string(),
|
|
494
498
|
packageVersion: zod.z.string(),
|
|
495
499
|
queue: QueueOptions.optional(),
|
|
496
500
|
retry: RetryOptions.optional(),
|
|
497
501
|
machine: MachineConfig.optional(),
|
|
498
|
-
triggerSource: zod.z.string().optional()
|
|
502
|
+
triggerSource: zod.z.string().optional(),
|
|
503
|
+
schedule: ScheduleMetadata.optional()
|
|
499
504
|
});
|
|
500
505
|
zod.z.object({
|
|
501
506
|
filePath: zod.z.string(),
|
|
@@ -508,6 +513,7 @@ zod.z.object({
|
|
|
508
513
|
retry: RetryOptions.optional(),
|
|
509
514
|
machine: MachineConfig.optional(),
|
|
510
515
|
triggerSource: zod.z.string().optional(),
|
|
516
|
+
schedule: ScheduleMetadata.optional(),
|
|
511
517
|
filePath: zod.z.string(),
|
|
512
518
|
exportName: zod.z.string()
|
|
513
519
|
});
|
|
@@ -569,7 +575,8 @@ var TaskResource = zod.z.object({
|
|
|
569
575
|
queue: QueueOptions.optional(),
|
|
570
576
|
retry: RetryOptions.optional(),
|
|
571
577
|
machine: MachineConfig.optional(),
|
|
572
|
-
triggerSource: zod.z.string().optional()
|
|
578
|
+
triggerSource: zod.z.string().optional(),
|
|
579
|
+
schedule: ScheduleMetadata.optional()
|
|
573
580
|
});
|
|
574
581
|
var BackgroundWorkerMetadata = zod.z.object({
|
|
575
582
|
packageVersion: zod.z.string(),
|
|
@@ -622,6 +629,11 @@ zod.z.object({
|
|
|
622
629
|
version: zod.z.string(),
|
|
623
630
|
contentHash: zod.z.string()
|
|
624
631
|
});
|
|
632
|
+
var RunTag = zod.z.string().max(64, "Tags must be less than 64 characters");
|
|
633
|
+
var RunTags = zod.z.union([
|
|
634
|
+
RunTag,
|
|
635
|
+
RunTag.array().max(3, "You can only set a maximum of 3 tags on a run.")
|
|
636
|
+
]);
|
|
625
637
|
var TriggerTaskRequestBody = zod.z.object({
|
|
626
638
|
payload: zod.z.any(),
|
|
627
639
|
context: zod.z.any(),
|
|
@@ -636,6 +648,7 @@ var TriggerTaskRequestBody = zod.z.object({
|
|
|
636
648
|
payloadType: zod.z.string().optional(),
|
|
637
649
|
delay: zod.z.string().or(zod.z.coerce.date()).optional(),
|
|
638
650
|
ttl: zod.z.string().or(zod.z.number().nonnegative().int()).optional(),
|
|
651
|
+
tags: RunTags.optional(),
|
|
639
652
|
maxAttempts: zod.z.number().int().optional()
|
|
640
653
|
}).optional()
|
|
641
654
|
});
|
|
@@ -663,6 +676,9 @@ zod.z.object({
|
|
|
663
676
|
])
|
|
664
677
|
}))
|
|
665
678
|
});
|
|
679
|
+
zod.z.object({
|
|
680
|
+
tags: RunTags
|
|
681
|
+
});
|
|
666
682
|
zod.z.object({
|
|
667
683
|
delay: zod.z.string().or(zod.z.coerce.date())
|
|
668
684
|
});
|
|
@@ -737,10 +753,21 @@ var ReplayRunResponse = zod.z.object({
|
|
|
737
753
|
var CanceledRunResponse = zod.z.object({
|
|
738
754
|
id: zod.z.string()
|
|
739
755
|
});
|
|
756
|
+
var ScheduleType = zod.z.union([
|
|
757
|
+
zod.z.literal("DECLARATIVE"),
|
|
758
|
+
zod.z.literal("IMPERATIVE")
|
|
759
|
+
]);
|
|
740
760
|
zod.z.object({
|
|
741
761
|
/** The schedule id associated with this run (you can have many schedules for the same task).
|
|
742
762
|
You can use this to remove the schedule, update it, etc */
|
|
743
763
|
scheduleId: zod.z.string(),
|
|
764
|
+
/** The type of schedule – `"DECLARATIVE"` or `"IMPERATIVE"`.
|
|
765
|
+
*
|
|
766
|
+
* **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.
|
|
767
|
+
*
|
|
768
|
+
* **IMPERATIVE** – created using the `schedules.create` functions or in the dashboard.
|
|
769
|
+
*/
|
|
770
|
+
type: ScheduleType,
|
|
744
771
|
/** When the task was scheduled to run.
|
|
745
772
|
* Note this will be slightly different from `new Date()` because it takes a few ms to run the task.
|
|
746
773
|
*
|
|
@@ -816,6 +843,7 @@ var ScheduleGenerator = zod.z.object({
|
|
|
816
843
|
});
|
|
817
844
|
var ScheduleObject = zod.z.object({
|
|
818
845
|
id: zod.z.string(),
|
|
846
|
+
type: ScheduleType,
|
|
819
847
|
task: zod.z.string(),
|
|
820
848
|
active: zod.z.boolean(),
|
|
821
849
|
deduplicationKey: zod.z.string().nullish(),
|
|
@@ -913,7 +941,11 @@ var CommonRunFields = {
|
|
|
913
941
|
finishedAt: zod.z.coerce.date().optional(),
|
|
914
942
|
delayedUntil: zod.z.coerce.date().optional(),
|
|
915
943
|
ttl: zod.z.string().optional(),
|
|
916
|
-
expiredAt: zod.z.coerce.date().optional()
|
|
944
|
+
expiredAt: zod.z.coerce.date().optional(),
|
|
945
|
+
tags: zod.z.string().array(),
|
|
946
|
+
costInCents: zod.z.number(),
|
|
947
|
+
baseCostInCents: zod.z.number(),
|
|
948
|
+
durationMs: zod.z.number()
|
|
917
949
|
};
|
|
918
950
|
var RetrieveRunResponse = zod.z.object({
|
|
919
951
|
...CommonRunFields,
|
|
@@ -1854,6 +1886,15 @@ var _ApiClient = class _ApiClient {
|
|
|
1854
1886
|
body: JSON.stringify(body)
|
|
1855
1887
|
}, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
|
|
1856
1888
|
}
|
|
1889
|
+
addTags(runId, body, requestOptions) {
|
|
1890
|
+
return zodfetch(zod.z.object({
|
|
1891
|
+
message: zod.z.string()
|
|
1892
|
+
}), `${this.baseUrl}/api/v1/runs/${runId}/tags`, {
|
|
1893
|
+
method: "POST",
|
|
1894
|
+
headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false),
|
|
1895
|
+
body: JSON.stringify(body)
|
|
1896
|
+
}, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
|
|
1897
|
+
}
|
|
1857
1898
|
createSchedule(options, requestOptions) {
|
|
1858
1899
|
return zodfetch(ScheduleObject, `${this.baseUrl}/api/v1/schedules`, {
|
|
1859
1900
|
method: "POST",
|
|
@@ -1981,6 +2022,9 @@ function createSearchQueryForListRuns(query) {
|
|
|
1981
2022
|
if (query.bulkAction) {
|
|
1982
2023
|
searchParams.append("filter[bulkAction]", query.bulkAction);
|
|
1983
2024
|
}
|
|
2025
|
+
if (query.tag) {
|
|
2026
|
+
searchParams.append("filter[tag]", Array.isArray(query.tag) ? query.tag.join(",") : query.tag);
|
|
2027
|
+
}
|
|
1984
2028
|
if (query.schedule) {
|
|
1985
2029
|
searchParams.append("filter[schedule]", query.schedule);
|
|
1986
2030
|
}
|