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