@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.
@@ -175,7 +175,7 @@ function isRecord(value) {
175
175
  __name(isRecord, "isRecord");
176
176
 
177
177
  // package.json
178
- var version = "3.0.0-beta.50";
178
+ var version = "3.0.0-beta.51";
179
179
  var MachineCpu = zod.z.union([
180
180
  zod.z.literal(0.25),
181
181
  zod.z.literal(0.5),
@@ -629,6 +629,11 @@ zod.z.object({
629
629
  version: zod.z.string(),
630
630
  contentHash: zod.z.string()
631
631
  });
632
+ var RunTag = zod.z.string().max(64, "Tags must be less than 64 characters");
633
+ var RunTags = zod.z.union([
634
+ RunTag,
635
+ RunTag.array().max(3, "You can only set a maximum of 3 tags on a run.")
636
+ ]);
632
637
  var TriggerTaskRequestBody = zod.z.object({
633
638
  payload: zod.z.any(),
634
639
  context: zod.z.any(),
@@ -643,6 +648,7 @@ var TriggerTaskRequestBody = zod.z.object({
643
648
  payloadType: zod.z.string().optional(),
644
649
  delay: zod.z.string().or(zod.z.coerce.date()).optional(),
645
650
  ttl: zod.z.string().or(zod.z.number().nonnegative().int()).optional(),
651
+ tags: RunTags.optional(),
646
652
  maxAttempts: zod.z.number().int().optional()
647
653
  }).optional()
648
654
  });
@@ -670,6 +676,9 @@ zod.z.object({
670
676
  ])
671
677
  }))
672
678
  });
679
+ zod.z.object({
680
+ tags: RunTags
681
+ });
673
682
  zod.z.object({
674
683
  delay: zod.z.string().or(zod.z.coerce.date())
675
684
  });
@@ -932,7 +941,11 @@ var CommonRunFields = {
932
941
  finishedAt: zod.z.coerce.date().optional(),
933
942
  delayedUntil: zod.z.coerce.date().optional(),
934
943
  ttl: zod.z.string().optional(),
935
- expiredAt: zod.z.coerce.date().optional()
944
+ expiredAt: zod.z.coerce.date().optional(),
945
+ tags: zod.z.string().array(),
946
+ costInCents: zod.z.number(),
947
+ baseCostInCents: zod.z.number(),
948
+ durationMs: zod.z.number()
936
949
  };
937
950
  var RetrieveRunResponse = zod.z.object({
938
951
  ...CommonRunFields,
@@ -1873,6 +1886,15 @@ var _ApiClient = class _ApiClient {
1873
1886
  body: JSON.stringify(body)
1874
1887
  }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
1875
1888
  }
1889
+ addTags(runId, body, requestOptions) {
1890
+ return zodfetch(zod.z.object({
1891
+ message: zod.z.string()
1892
+ }), `${this.baseUrl}/api/v1/runs/${runId}/tags`, {
1893
+ method: "POST",
1894
+ headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false),
1895
+ body: JSON.stringify(body)
1896
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
1897
+ }
1876
1898
  createSchedule(options, requestOptions) {
1877
1899
  return zodfetch(ScheduleObject, `${this.baseUrl}/api/v1/schedules`, {
1878
1900
  method: "POST",
@@ -2000,6 +2022,9 @@ function createSearchQueryForListRuns(query) {
2000
2022
  if (query.bulkAction) {
2001
2023
  searchParams.append("filter[bulkAction]", query.bulkAction);
2002
2024
  }
2025
+ if (query.tag) {
2026
+ searchParams.append("filter[tag]", Array.isArray(query.tag) ? query.tag.join(",") : query.tag);
2027
+ }
2003
2028
  if (query.schedule) {
2004
2029
  searchParams.append("filter[schedule]", query.schedule);
2005
2030
  }