@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.
@@ -175,7 +175,7 @@ function isRecord(value) {
175
175
  __name(isRecord, "isRecord");
176
176
 
177
177
  // package.json
178
- var version = "0.0.0-prerelease-20240718194312";
178
+ var version = "0.0.0-prerelease-20240723165848";
179
179
  var MachineCpu = zod.z.union([
180
180
  zod.z.literal(0.25),
181
181
  zod.z.literal(0.5),
@@ -629,6 +629,22 @@ 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
+ zod.z.tuple([
636
+ RunTag
637
+ ]),
638
+ zod.z.tuple([
639
+ RunTag,
640
+ RunTag
641
+ ]),
642
+ zod.z.tuple([
643
+ RunTag,
644
+ RunTag,
645
+ RunTag
646
+ ])
647
+ ]);
632
648
  var TriggerTaskRequestBody = zod.z.object({
633
649
  payload: zod.z.any(),
634
650
  context: zod.z.any(),
@@ -643,6 +659,7 @@ var TriggerTaskRequestBody = zod.z.object({
643
659
  payloadType: zod.z.string().optional(),
644
660
  delay: zod.z.string().or(zod.z.coerce.date()).optional(),
645
661
  ttl: zod.z.string().or(zod.z.number().nonnegative().int()).optional(),
662
+ tags: RunTags.optional(),
646
663
  maxAttempts: zod.z.number().int().optional()
647
664
  }).optional()
648
665
  });
@@ -670,6 +687,9 @@ zod.z.object({
670
687
  ])
671
688
  }))
672
689
  });
690
+ zod.z.object({
691
+ tags: RunTags
692
+ });
673
693
  zod.z.object({
674
694
  delay: zod.z.string().or(zod.z.coerce.date())
675
695
  });
@@ -932,7 +952,11 @@ var CommonRunFields = {
932
952
  finishedAt: zod.z.coerce.date().optional(),
933
953
  delayedUntil: zod.z.coerce.date().optional(),
934
954
  ttl: zod.z.string().optional(),
935
- expiredAt: zod.z.coerce.date().optional()
955
+ expiredAt: zod.z.coerce.date().optional(),
956
+ tags: zod.z.string().array(),
957
+ costInCents: zod.z.number(),
958
+ baseCostInCents: zod.z.number(),
959
+ durationMs: zod.z.number()
936
960
  };
937
961
  var RetrieveRunResponse = zod.z.object({
938
962
  ...CommonRunFields,
@@ -1873,6 +1897,15 @@ var _ApiClient = class _ApiClient {
1873
1897
  body: JSON.stringify(body)
1874
1898
  }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
1875
1899
  }
1900
+ addTags(runId, body, requestOptions) {
1901
+ return zodfetch(zod.z.object({
1902
+ message: zod.z.string()
1903
+ }), `${this.baseUrl}/api/v1/runs/${runId}/tags`, {
1904
+ method: "POST",
1905
+ headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false),
1906
+ body: JSON.stringify(body)
1907
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
1908
+ }
1876
1909
  createSchedule(options, requestOptions) {
1877
1910
  return zodfetch(ScheduleObject, `${this.baseUrl}/api/v1/schedules`, {
1878
1911
  method: "POST",
@@ -2000,6 +2033,9 @@ function createSearchQueryForListRuns(query) {
2000
2033
  if (query.bulkAction) {
2001
2034
  searchParams.append("filter[bulkAction]", query.bulkAction);
2002
2035
  }
2036
+ if (query.tag) {
2037
+ searchParams.append("filter[tag]", Array.isArray(query.tag) ? query.tag.join(",") : query.tag);
2038
+ }
2003
2039
  if (query.schedule) {
2004
2040
  searchParams.append("filter[schedule]", query.schedule);
2005
2041
  }