@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.
@@ -406,7 +406,7 @@ function getEnvVar(name) {
406
406
  __name(getEnvVar, "getEnvVar");
407
407
 
408
408
  // package.json
409
- var version = "3.0.0-beta.50";
409
+ var version = "3.0.0-beta.51";
410
410
 
411
411
  // src/v3/otel/tracingSDK.ts
412
412
  var _a;
@@ -1027,6 +1027,11 @@ zod.z.object({
1027
1027
  version: zod.z.string(),
1028
1028
  contentHash: zod.z.string()
1029
1029
  });
1030
+ var RunTag = zod.z.string().max(64, "Tags must be less than 64 characters");
1031
+ var RunTags = zod.z.union([
1032
+ RunTag,
1033
+ RunTag.array().max(3, "You can only set a maximum of 3 tags on a run.")
1034
+ ]);
1030
1035
  var TriggerTaskRequestBody = zod.z.object({
1031
1036
  payload: zod.z.any(),
1032
1037
  context: zod.z.any(),
@@ -1041,6 +1046,7 @@ var TriggerTaskRequestBody = zod.z.object({
1041
1046
  payloadType: zod.z.string().optional(),
1042
1047
  delay: zod.z.string().or(zod.z.coerce.date()).optional(),
1043
1048
  ttl: zod.z.string().or(zod.z.number().nonnegative().int()).optional(),
1049
+ tags: RunTags.optional(),
1044
1050
  maxAttempts: zod.z.number().int().optional()
1045
1051
  }).optional()
1046
1052
  });
@@ -1068,6 +1074,9 @@ zod.z.object({
1068
1074
  ])
1069
1075
  }))
1070
1076
  });
1077
+ zod.z.object({
1078
+ tags: RunTags
1079
+ });
1071
1080
  zod.z.object({
1072
1081
  delay: zod.z.string().or(zod.z.coerce.date())
1073
1082
  });
@@ -1330,7 +1339,11 @@ var CommonRunFields = {
1330
1339
  finishedAt: zod.z.coerce.date().optional(),
1331
1340
  delayedUntil: zod.z.coerce.date().optional(),
1332
1341
  ttl: zod.z.string().optional(),
1333
- expiredAt: zod.z.coerce.date().optional()
1342
+ expiredAt: zod.z.coerce.date().optional(),
1343
+ tags: zod.z.string().array(),
1344
+ costInCents: zod.z.number(),
1345
+ baseCostInCents: zod.z.number(),
1346
+ durationMs: zod.z.number()
1334
1347
  };
1335
1348
  var RetrieveRunResponse = zod.z.object({
1336
1349
  ...CommonRunFields,
@@ -2157,6 +2170,15 @@ var _ApiClient = class _ApiClient {
2157
2170
  body: JSON.stringify(body)
2158
2171
  }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2159
2172
  }
2173
+ addTags(runId, body, requestOptions) {
2174
+ return zodfetch(zod.z.object({
2175
+ message: zod.z.string()
2176
+ }), `${this.baseUrl}/api/v1/runs/${runId}/tags`, {
2177
+ method: "POST",
2178
+ headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false),
2179
+ body: JSON.stringify(body)
2180
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2181
+ }
2160
2182
  createSchedule(options, requestOptions) {
2161
2183
  return zodfetch(ScheduleObject, `${this.baseUrl}/api/v1/schedules`, {
2162
2184
  method: "POST",
@@ -2284,6 +2306,9 @@ function createSearchQueryForListRuns(query) {
2284
2306
  if (query.bulkAction) {
2285
2307
  searchParams.append("filter[bulkAction]", query.bulkAction);
2286
2308
  }
2309
+ if (query.tag) {
2310
+ searchParams.append("filter[tag]", Array.isArray(query.tag) ? query.tag.join(",") : query.tag);
2311
+ }
2287
2312
  if (query.schedule) {
2288
2313
  searchParams.append("filter[schedule]", query.schedule);
2289
2314
  }