@trigger.dev/core 3.0.0-beta.50 → 3.0.0-beta.51

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.
@@ -400,7 +400,7 @@ function getEnvVar(name) {
400
400
  __name(getEnvVar, "getEnvVar");
401
401
 
402
402
  // package.json
403
- var version = "3.0.0-beta.50";
403
+ var version = "3.0.0-beta.51";
404
404
 
405
405
  // src/v3/otel/tracingSDK.ts
406
406
  var _a;
@@ -1021,6 +1021,11 @@ z.object({
1021
1021
  version: z.string(),
1022
1022
  contentHash: z.string()
1023
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
+ ]);
1024
1029
  var TriggerTaskRequestBody = z.object({
1025
1030
  payload: z.any(),
1026
1031
  context: z.any(),
@@ -1035,6 +1040,7 @@ var TriggerTaskRequestBody = z.object({
1035
1040
  payloadType: z.string().optional(),
1036
1041
  delay: z.string().or(z.coerce.date()).optional(),
1037
1042
  ttl: z.string().or(z.number().nonnegative().int()).optional(),
1043
+ tags: RunTags.optional(),
1038
1044
  maxAttempts: z.number().int().optional()
1039
1045
  }).optional()
1040
1046
  });
@@ -1062,6 +1068,9 @@ z.object({
1062
1068
  ])
1063
1069
  }))
1064
1070
  });
1071
+ z.object({
1072
+ tags: RunTags
1073
+ });
1065
1074
  z.object({
1066
1075
  delay: z.string().or(z.coerce.date())
1067
1076
  });
@@ -1324,7 +1333,11 @@ var CommonRunFields = {
1324
1333
  finishedAt: z.coerce.date().optional(),
1325
1334
  delayedUntil: z.coerce.date().optional(),
1326
1335
  ttl: z.string().optional(),
1327
- 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()
1328
1341
  };
1329
1342
  var RetrieveRunResponse = z.object({
1330
1343
  ...CommonRunFields,
@@ -2151,6 +2164,15 @@ var _ApiClient = class _ApiClient {
2151
2164
  body: JSON.stringify(body)
2152
2165
  }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2153
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
+ }
2154
2176
  createSchedule(options, requestOptions) {
2155
2177
  return zodfetch(ScheduleObject, `${this.baseUrl}/api/v1/schedules`, {
2156
2178
  method: "POST",
@@ -2278,6 +2300,9 @@ function createSearchQueryForListRuns(query) {
2278
2300
  if (query.bulkAction) {
2279
2301
  searchParams.append("filter[bulkAction]", query.bulkAction);
2280
2302
  }
2303
+ if (query.tag) {
2304
+ searchParams.append("filter[tag]", Array.isArray(query.tag) ? query.tag.join(",") : query.tag);
2305
+ }
2281
2306
  if (query.schedule) {
2282
2307
  searchParams.append("filter[schedule]", query.schedule);
2283
2308
  }