@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.
Files changed (47) hide show
  1. package/dist/{catalog-U7_q4XsM.d.mts → catalog-H7yFiZ60.d.mts} +1 -1
  2. package/dist/{catalog-bSnBE19I.d.ts → catalog-h79CG5Wy.d.ts} +1 -1
  3. package/dist/index.d.mts +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/{messages-CHPNqMXf.d.mts → messages-mhHZiNGN.d.mts} +202 -9
  6. package/dist/{messages-CHPNqMXf.d.ts → messages-mhHZiNGN.d.ts} +202 -9
  7. package/dist/retry.d.mts +1 -1
  8. package/dist/retry.d.ts +1 -1
  9. package/dist/schemas/index.d.mts +6 -6
  10. package/dist/schemas/index.d.ts +6 -6
  11. package/dist/{schemas-WHkFakb3.d.mts → schemas-C9ssfehv.d.mts} +47 -1
  12. package/dist/{schemas-WHkFakb3.d.ts → schemas-C9ssfehv.d.ts} +47 -1
  13. package/dist/v3/index.d.mts +49 -29
  14. package/dist/v3/index.d.ts +49 -29
  15. package/dist/v3/index.js +65 -9
  16. package/dist/v3/index.js.map +1 -1
  17. package/dist/v3/index.mjs +62 -10
  18. package/dist/v3/index.mjs.map +1 -1
  19. package/dist/v3/otel/index.js +1 -1
  20. package/dist/v3/otel/index.js.map +1 -1
  21. package/dist/v3/otel/index.mjs +1 -1
  22. package/dist/v3/otel/index.mjs.map +1 -1
  23. package/dist/v3/prod/index.d.mts +1 -1
  24. package/dist/v3/prod/index.d.ts +1 -1
  25. package/dist/v3/schemas/index.d.mts +166 -4
  26. package/dist/v3/schemas/index.d.ts +166 -4
  27. package/dist/v3/schemas/index.js +52 -8
  28. package/dist/v3/schemas/index.js.map +1 -1
  29. package/dist/v3/schemas/index.mjs +49 -9
  30. package/dist/v3/schemas/index.mjs.map +1 -1
  31. package/dist/v3/utils/ioSerialization.js +48 -4
  32. package/dist/v3/utils/ioSerialization.js.map +1 -1
  33. package/dist/v3/utils/ioSerialization.mjs +48 -4
  34. package/dist/v3/utils/ioSerialization.mjs.map +1 -1
  35. package/dist/v3/utils/retries.d.mts +1 -1
  36. package/dist/v3/utils/retries.d.ts +1 -1
  37. package/dist/v3/workers/index.d.mts +4 -4
  38. package/dist/v3/workers/index.d.ts +4 -4
  39. package/dist/v3/workers/index.js +48 -4
  40. package/dist/v3/workers/index.js.map +1 -1
  41. package/dist/v3/workers/index.mjs +48 -4
  42. package/dist/v3/workers/index.mjs.map +1 -1
  43. package/dist/v3/zodfetch.d.mts +1 -1
  44. package/dist/v3/zodfetch.d.ts +1 -1
  45. package/package.json +1 -1
  46. package/dist/{api-a39zAY3E.d.mts → api-Pl9fxB8v.d.mts} +153 -153
  47. package/dist/{api--StDLb4h.d.ts → api-sNoooMbT.d.ts} +153 -153
@@ -400,7 +400,7 @@ function getEnvVar(name) {
400
400
  __name(getEnvVar, "getEnvVar");
401
401
 
402
402
  // package.json
403
- var version = "0.0.0-v3-prerelease-20240717092755";
403
+ var version = "0.0.0-v3-prerelease-20240730135037";
404
404
 
405
405
  // src/v3/otel/tracingSDK.ts
406
406
  var _a;
@@ -886,13 +886,18 @@ var QueueOptions = z.object({
886
886
  /** @deprecated This feature is coming soon */
887
887
  rateLimit: RateLimitOptions.optional()
888
888
  });
889
+ var ScheduleMetadata = z.object({
890
+ cron: z.string(),
891
+ timezone: z.string()
892
+ });
889
893
  z.object({
890
894
  id: z.string(),
891
895
  packageVersion: z.string(),
892
896
  queue: QueueOptions.optional(),
893
897
  retry: RetryOptions.optional(),
894
898
  machine: MachineConfig.optional(),
895
- triggerSource: z.string().optional()
899
+ triggerSource: z.string().optional(),
900
+ schedule: ScheduleMetadata.optional()
896
901
  });
897
902
  z.object({
898
903
  filePath: z.string(),
@@ -905,6 +910,7 @@ z.object({
905
910
  retry: RetryOptions.optional(),
906
911
  machine: MachineConfig.optional(),
907
912
  triggerSource: z.string().optional(),
913
+ schedule: ScheduleMetadata.optional(),
908
914
  filePath: z.string(),
909
915
  exportName: z.string()
910
916
  });
@@ -966,7 +972,8 @@ var TaskResource = z.object({
966
972
  queue: QueueOptions.optional(),
967
973
  retry: RetryOptions.optional(),
968
974
  machine: MachineConfig.optional(),
969
- triggerSource: z.string().optional()
975
+ triggerSource: z.string().optional(),
976
+ schedule: ScheduleMetadata.optional()
970
977
  });
971
978
  var BackgroundWorkerMetadata = z.object({
972
979
  packageVersion: z.string(),
@@ -1014,6 +1021,11 @@ z.object({
1014
1021
  version: z.string(),
1015
1022
  contentHash: z.string()
1016
1023
  });
1024
+ var RunTag = z.string().max(64, "Tags must be less than 64 characters");
1025
+ var RunTags = z.union([
1026
+ RunTag,
1027
+ RunTag.array().max(3, "You can only set a maximum of 3 tags on a run.")
1028
+ ]);
1017
1029
  var TriggerTaskRequestBody = z.object({
1018
1030
  payload: z.any(),
1019
1031
  context: z.any(),
@@ -1028,6 +1040,7 @@ var TriggerTaskRequestBody = z.object({
1028
1040
  payloadType: z.string().optional(),
1029
1041
  delay: z.string().or(z.coerce.date()).optional(),
1030
1042
  ttl: z.string().or(z.number().nonnegative().int()).optional(),
1043
+ tags: RunTags.optional(),
1031
1044
  maxAttempts: z.number().int().optional()
1032
1045
  }).optional()
1033
1046
  });
@@ -1055,6 +1068,9 @@ z.object({
1055
1068
  ])
1056
1069
  }))
1057
1070
  });
1071
+ z.object({
1072
+ tags: RunTags
1073
+ });
1058
1074
  z.object({
1059
1075
  delay: z.string().or(z.coerce.date())
1060
1076
  });
@@ -1129,10 +1145,21 @@ var ReplayRunResponse = z.object({
1129
1145
  var CanceledRunResponse = z.object({
1130
1146
  id: z.string()
1131
1147
  });
1148
+ var ScheduleType = z.union([
1149
+ z.literal("DECLARATIVE"),
1150
+ z.literal("IMPERATIVE")
1151
+ ]);
1132
1152
  z.object({
1133
1153
  /** The schedule id associated with this run (you can have many schedules for the same task).
1134
1154
  You can use this to remove the schedule, update it, etc */
1135
1155
  scheduleId: z.string(),
1156
+ /** The type of schedule – `"DECLARATIVE"` or `"IMPERATIVE"`.
1157
+ *
1158
+ * **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.
1159
+ *
1160
+ * **IMPERATIVE** – created using the `schedules.create` functions or in the dashboard.
1161
+ */
1162
+ type: ScheduleType,
1136
1163
  /** When the task was scheduled to run.
1137
1164
  * Note this will be slightly different from `new Date()` because it takes a few ms to run the task.
1138
1165
  *
@@ -1208,6 +1235,7 @@ var ScheduleGenerator = z.object({
1208
1235
  });
1209
1236
  var ScheduleObject = z.object({
1210
1237
  id: z.string(),
1238
+ type: ScheduleType,
1211
1239
  task: z.string(),
1212
1240
  active: z.boolean(),
1213
1241
  deduplicationKey: z.string().nullish(),
@@ -1305,7 +1333,11 @@ var CommonRunFields = {
1305
1333
  finishedAt: z.coerce.date().optional(),
1306
1334
  delayedUntil: z.coerce.date().optional(),
1307
1335
  ttl: z.string().optional(),
1308
- expiredAt: z.coerce.date().optional()
1336
+ expiredAt: z.coerce.date().optional(),
1337
+ tags: z.string().array(),
1338
+ costInCents: z.number(),
1339
+ baseCostInCents: z.number(),
1340
+ durationMs: z.number()
1309
1341
  };
1310
1342
  var RetrieveRunResponse = z.object({
1311
1343
  ...CommonRunFields,
@@ -2132,6 +2164,15 @@ var _ApiClient = class _ApiClient {
2132
2164
  body: JSON.stringify(body)
2133
2165
  }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2134
2166
  }
2167
+ addTags(runId, body, requestOptions) {
2168
+ return zodfetch(z.object({
2169
+ message: z.string()
2170
+ }), `${this.baseUrl}/api/v1/runs/${runId}/tags`, {
2171
+ method: "POST",
2172
+ headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false),
2173
+ body: JSON.stringify(body)
2174
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2175
+ }
2135
2176
  createSchedule(options, requestOptions) {
2136
2177
  return zodfetch(ScheduleObject, `${this.baseUrl}/api/v1/schedules`, {
2137
2178
  method: "POST",
@@ -2259,6 +2300,9 @@ function createSearchQueryForListRuns(query) {
2259
2300
  if (query.bulkAction) {
2260
2301
  searchParams.append("filter[bulkAction]", query.bulkAction);
2261
2302
  }
2303
+ if (query.tag) {
2304
+ searchParams.append("filter[tag]", Array.isArray(query.tag) ? query.tag.join(",") : query.tag);
2305
+ }
2262
2306
  if (query.schedule) {
2263
2307
  searchParams.append("filter[schedule]", query.schedule);
2264
2308
  }