@trigger.dev/core 0.0.0-prerelease-20240718194312 → 0.0.0-prerelease-20240723165848

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 = "0.0.0-prerelease-20240718194312";
403
+ var version = "0.0.0-prerelease-20240723165848";
404
404
 
405
405
  // src/v3/otel/tracingSDK.ts
406
406
  var _a;
@@ -1021,6 +1021,22 @@ 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
+ z.tuple([
1028
+ RunTag
1029
+ ]),
1030
+ z.tuple([
1031
+ RunTag,
1032
+ RunTag
1033
+ ]),
1034
+ z.tuple([
1035
+ RunTag,
1036
+ RunTag,
1037
+ RunTag
1038
+ ])
1039
+ ]);
1024
1040
  var TriggerTaskRequestBody = z.object({
1025
1041
  payload: z.any(),
1026
1042
  context: z.any(),
@@ -1035,6 +1051,7 @@ var TriggerTaskRequestBody = z.object({
1035
1051
  payloadType: z.string().optional(),
1036
1052
  delay: z.string().or(z.coerce.date()).optional(),
1037
1053
  ttl: z.string().or(z.number().nonnegative().int()).optional(),
1054
+ tags: RunTags.optional(),
1038
1055
  maxAttempts: z.number().int().optional()
1039
1056
  }).optional()
1040
1057
  });
@@ -1062,6 +1079,9 @@ z.object({
1062
1079
  ])
1063
1080
  }))
1064
1081
  });
1082
+ z.object({
1083
+ tags: RunTags
1084
+ });
1065
1085
  z.object({
1066
1086
  delay: z.string().or(z.coerce.date())
1067
1087
  });
@@ -1324,7 +1344,11 @@ var CommonRunFields = {
1324
1344
  finishedAt: z.coerce.date().optional(),
1325
1345
  delayedUntil: z.coerce.date().optional(),
1326
1346
  ttl: z.string().optional(),
1327
- expiredAt: z.coerce.date().optional()
1347
+ expiredAt: z.coerce.date().optional(),
1348
+ tags: z.string().array(),
1349
+ costInCents: z.number(),
1350
+ baseCostInCents: z.number(),
1351
+ durationMs: z.number()
1328
1352
  };
1329
1353
  var RetrieveRunResponse = z.object({
1330
1354
  ...CommonRunFields,
@@ -2151,6 +2175,15 @@ var _ApiClient = class _ApiClient {
2151
2175
  body: JSON.stringify(body)
2152
2176
  }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2153
2177
  }
2178
+ addTags(runId, body, requestOptions) {
2179
+ return zodfetch(z.object({
2180
+ message: z.string()
2181
+ }), `${this.baseUrl}/api/v1/runs/${runId}/tags`, {
2182
+ method: "POST",
2183
+ headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false),
2184
+ body: JSON.stringify(body)
2185
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2186
+ }
2154
2187
  createSchedule(options, requestOptions) {
2155
2188
  return zodfetch(ScheduleObject, `${this.baseUrl}/api/v1/schedules`, {
2156
2189
  method: "POST",
@@ -2278,6 +2311,9 @@ function createSearchQueryForListRuns(query) {
2278
2311
  if (query.bulkAction) {
2279
2312
  searchParams.append("filter[bulkAction]", query.bulkAction);
2280
2313
  }
2314
+ if (query.tag) {
2315
+ searchParams.append("filter[tag]", Array.isArray(query.tag) ? query.tag.join(",") : query.tag);
2316
+ }
2281
2317
  if (query.schedule) {
2282
2318
  searchParams.append("filter[schedule]", query.schedule);
2283
2319
  }