@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
package/dist/v3/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var __privateMethod = (obj, member, method) => {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
// package.json
|
|
36
|
-
var version = "0.0.0-v3-prerelease-
|
|
36
|
+
var version = "0.0.0-v3-prerelease-20240730135037";
|
|
37
37
|
var dependencies = {
|
|
38
38
|
"@google-cloud/precise-date": "^4.0.0",
|
|
39
39
|
"@opentelemetry/api": "^1.8.0",
|
|
@@ -395,13 +395,18 @@ var QueueOptions = zod.z.object({
|
|
|
395
395
|
/** @deprecated This feature is coming soon */
|
|
396
396
|
rateLimit: RateLimitOptions.optional()
|
|
397
397
|
});
|
|
398
|
+
var ScheduleMetadata = zod.z.object({
|
|
399
|
+
cron: zod.z.string(),
|
|
400
|
+
timezone: zod.z.string()
|
|
401
|
+
});
|
|
398
402
|
var TaskMetadata = zod.z.object({
|
|
399
403
|
id: zod.z.string(),
|
|
400
404
|
packageVersion: zod.z.string(),
|
|
401
405
|
queue: QueueOptions.optional(),
|
|
402
406
|
retry: RetryOptions.optional(),
|
|
403
407
|
machine: MachineConfig.optional(),
|
|
404
|
-
triggerSource: zod.z.string().optional()
|
|
408
|
+
triggerSource: zod.z.string().optional(),
|
|
409
|
+
schedule: ScheduleMetadata.optional()
|
|
405
410
|
});
|
|
406
411
|
var TaskFileMetadata = zod.z.object({
|
|
407
412
|
filePath: zod.z.string(),
|
|
@@ -414,6 +419,7 @@ var TaskMetadataWithFilePath = zod.z.object({
|
|
|
414
419
|
retry: RetryOptions.optional(),
|
|
415
420
|
machine: MachineConfig.optional(),
|
|
416
421
|
triggerSource: zod.z.string().optional(),
|
|
422
|
+
schedule: ScheduleMetadata.optional(),
|
|
417
423
|
filePath: zod.z.string(),
|
|
418
424
|
exportName: zod.z.string()
|
|
419
425
|
});
|
|
@@ -475,7 +481,8 @@ var TaskResource = zod.z.object({
|
|
|
475
481
|
queue: QueueOptions.optional(),
|
|
476
482
|
retry: RetryOptions.optional(),
|
|
477
483
|
machine: MachineConfig.optional(),
|
|
478
|
-
triggerSource: zod.z.string().optional()
|
|
484
|
+
triggerSource: zod.z.string().optional(),
|
|
485
|
+
schedule: ScheduleMetadata.optional()
|
|
479
486
|
});
|
|
480
487
|
var BackgroundWorkerMetadata = zod.z.object({
|
|
481
488
|
packageVersion: zod.z.string(),
|
|
@@ -710,6 +717,11 @@ var CreateBackgroundWorkerResponse = zod.z.object({
|
|
|
710
717
|
version: zod.z.string(),
|
|
711
718
|
contentHash: zod.z.string()
|
|
712
719
|
});
|
|
720
|
+
var RunTag = zod.z.string().max(64, "Tags must be less than 64 characters");
|
|
721
|
+
var RunTags = zod.z.union([
|
|
722
|
+
RunTag,
|
|
723
|
+
RunTag.array().max(3, "You can only set a maximum of 3 tags on a run.")
|
|
724
|
+
]);
|
|
713
725
|
var TriggerTaskRequestBody = zod.z.object({
|
|
714
726
|
payload: zod.z.any(),
|
|
715
727
|
context: zod.z.any(),
|
|
@@ -724,6 +736,7 @@ var TriggerTaskRequestBody = zod.z.object({
|
|
|
724
736
|
payloadType: zod.z.string().optional(),
|
|
725
737
|
delay: zod.z.string().or(zod.z.coerce.date()).optional(),
|
|
726
738
|
ttl: zod.z.string().or(zod.z.number().nonnegative().int()).optional(),
|
|
739
|
+
tags: RunTags.optional(),
|
|
727
740
|
maxAttempts: zod.z.number().int().optional()
|
|
728
741
|
}).optional()
|
|
729
742
|
});
|
|
@@ -751,6 +764,9 @@ var GetBatchResponseBody = zod.z.object({
|
|
|
751
764
|
])
|
|
752
765
|
}))
|
|
753
766
|
});
|
|
767
|
+
var AddTagsRequestBody = zod.z.object({
|
|
768
|
+
tags: RunTags
|
|
769
|
+
});
|
|
754
770
|
var RescheduleRunRequestBody = zod.z.object({
|
|
755
771
|
delay: zod.z.string().or(zod.z.coerce.date())
|
|
756
772
|
});
|
|
@@ -825,10 +841,21 @@ var ReplayRunResponse = zod.z.object({
|
|
|
825
841
|
var CanceledRunResponse = zod.z.object({
|
|
826
842
|
id: zod.z.string()
|
|
827
843
|
});
|
|
844
|
+
var ScheduleType = zod.z.union([
|
|
845
|
+
zod.z.literal("DECLARATIVE"),
|
|
846
|
+
zod.z.literal("IMPERATIVE")
|
|
847
|
+
]);
|
|
828
848
|
var ScheduledTaskPayload = zod.z.object({
|
|
829
849
|
/** The schedule id associated with this run (you can have many schedules for the same task).
|
|
830
850
|
You can use this to remove the schedule, update it, etc */
|
|
831
851
|
scheduleId: zod.z.string(),
|
|
852
|
+
/** The type of schedule – `"DECLARATIVE"` or `"IMPERATIVE"`.
|
|
853
|
+
*
|
|
854
|
+
* **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.
|
|
855
|
+
*
|
|
856
|
+
* **IMPERATIVE** – created using the `schedules.create` functions or in the dashboard.
|
|
857
|
+
*/
|
|
858
|
+
type: ScheduleType,
|
|
832
859
|
/** When the task was scheduled to run.
|
|
833
860
|
* Note this will be slightly different from `new Date()` because it takes a few ms to run the task.
|
|
834
861
|
*
|
|
@@ -904,6 +931,7 @@ var ScheduleGenerator = zod.z.object({
|
|
|
904
931
|
});
|
|
905
932
|
var ScheduleObject = zod.z.object({
|
|
906
933
|
id: zod.z.string(),
|
|
934
|
+
type: ScheduleType,
|
|
907
935
|
task: zod.z.string(),
|
|
908
936
|
active: zod.z.boolean(),
|
|
909
937
|
deduplicationKey: zod.z.string().nullish(),
|
|
@@ -1001,7 +1029,11 @@ var CommonRunFields = {
|
|
|
1001
1029
|
finishedAt: zod.z.coerce.date().optional(),
|
|
1002
1030
|
delayedUntil: zod.z.coerce.date().optional(),
|
|
1003
1031
|
ttl: zod.z.string().optional(),
|
|
1004
|
-
expiredAt: zod.z.coerce.date().optional()
|
|
1032
|
+
expiredAt: zod.z.coerce.date().optional(),
|
|
1033
|
+
tags: zod.z.string().array(),
|
|
1034
|
+
costInCents: zod.z.number(),
|
|
1035
|
+
baseCostInCents: zod.z.number(),
|
|
1036
|
+
durationMs: zod.z.number()
|
|
1005
1037
|
};
|
|
1006
1038
|
var RetrieveRunResponse = zod.z.object({
|
|
1007
1039
|
...CommonRunFields,
|
|
@@ -1391,6 +1423,19 @@ var PlatformToProviderMessages = {
|
|
|
1391
1423
|
projectId: zod.z.string(),
|
|
1392
1424
|
runId: zod.z.string()
|
|
1393
1425
|
})
|
|
1426
|
+
},
|
|
1427
|
+
PRE_PULL_DEPLOYMENT: {
|
|
1428
|
+
message: zod.z.object({
|
|
1429
|
+
version: zod.z.literal("v1").default("v1"),
|
|
1430
|
+
imageRef: zod.z.string(),
|
|
1431
|
+
shortCode: zod.z.string(),
|
|
1432
|
+
// identifiers
|
|
1433
|
+
envId: zod.z.string(),
|
|
1434
|
+
envType: EnvironmentType,
|
|
1435
|
+
orgId: zod.z.string(),
|
|
1436
|
+
projectId: zod.z.string(),
|
|
1437
|
+
deploymentId: zod.z.string()
|
|
1438
|
+
})
|
|
1394
1439
|
}
|
|
1395
1440
|
};
|
|
1396
1441
|
var CreateWorkerMessage = zod.z.object({
|
|
@@ -1639,11 +1684,6 @@ var ClientToSharedQueueMessages = {
|
|
|
1639
1684
|
backgroundWorkerId: zod.z.string(),
|
|
1640
1685
|
data: BackgroundWorkerClientMessages
|
|
1641
1686
|
})
|
|
1642
|
-
},
|
|
1643
|
-
PING: {
|
|
1644
|
-
message: zod.z.object({
|
|
1645
|
-
version: zod.z.literal("v1").default("v1")
|
|
1646
|
-
})
|
|
1647
1687
|
}
|
|
1648
1688
|
};
|
|
1649
1689
|
var SharedQueueToClientMessages = {
|
|
@@ -3282,6 +3322,15 @@ var _ApiClient = class _ApiClient {
|
|
|
3282
3322
|
body: JSON.stringify(body)
|
|
3283
3323
|
}, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
|
|
3284
3324
|
}
|
|
3325
|
+
addTags(runId, body, requestOptions) {
|
|
3326
|
+
return zodfetch(zod.z.object({
|
|
3327
|
+
message: zod.z.string()
|
|
3328
|
+
}), `${this.baseUrl}/api/v1/runs/${runId}/tags`, {
|
|
3329
|
+
method: "POST",
|
|
3330
|
+
headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false),
|
|
3331
|
+
body: JSON.stringify(body)
|
|
3332
|
+
}, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
|
|
3333
|
+
}
|
|
3285
3334
|
createSchedule(options, requestOptions) {
|
|
3286
3335
|
return zodfetch(ScheduleObject, `${this.baseUrl}/api/v1/schedules`, {
|
|
3287
3336
|
method: "POST",
|
|
@@ -3409,6 +3458,9 @@ function createSearchQueryForListRuns(query) {
|
|
|
3409
3458
|
if (query.bulkAction) {
|
|
3410
3459
|
searchParams.append("filter[bulkAction]", query.bulkAction);
|
|
3411
3460
|
}
|
|
3461
|
+
if (query.tag) {
|
|
3462
|
+
searchParams.append("filter[tag]", Array.isArray(query.tag) ? query.tag.join(",") : query.tag);
|
|
3463
|
+
}
|
|
3412
3464
|
if (query.schedule) {
|
|
3413
3465
|
searchParams.append("filter[schedule]", query.schedule);
|
|
3414
3466
|
}
|
|
@@ -4475,6 +4527,7 @@ function safeJsonParse2(value) {
|
|
|
4475
4527
|
__name(safeJsonParse2, "safeJsonParse");
|
|
4476
4528
|
|
|
4477
4529
|
exports.AbortTaskRunError = AbortTaskRunError;
|
|
4530
|
+
exports.AddTagsRequestBody = AddTagsRequestBody;
|
|
4478
4531
|
exports.ApiClient = ApiClient;
|
|
4479
4532
|
exports.ApiConnectionError = ApiConnectionError;
|
|
4480
4533
|
exports.ApiError = ApiError;
|
|
@@ -4579,8 +4632,11 @@ exports.RetryOptions = RetryOptions;
|
|
|
4579
4632
|
exports.RunEnvironmentDetails = RunEnvironmentDetails;
|
|
4580
4633
|
exports.RunScheduleDetails = RunScheduleDetails;
|
|
4581
4634
|
exports.RunStatus = RunStatus;
|
|
4635
|
+
exports.RunTags = RunTags;
|
|
4582
4636
|
exports.ScheduleGenerator = ScheduleGenerator;
|
|
4637
|
+
exports.ScheduleMetadata = ScheduleMetadata;
|
|
4583
4638
|
exports.ScheduleObject = ScheduleObject;
|
|
4639
|
+
exports.ScheduleType = ScheduleType;
|
|
4584
4640
|
exports.ScheduledTaskPayload = ScheduledTaskPayload;
|
|
4585
4641
|
exports.SemanticInternalAttributes = SemanticInternalAttributes;
|
|
4586
4642
|
exports.SerializedError = SerializedError;
|