@trigger.dev/core 0.0.0-v3-prerelease-20240717092755 → 0.0.0-v3-prerelease-20240730135037

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.
Files changed (47) hide show
  1. package/dist/{catalog-U7_q4XsM.d.mts → catalog-H7yFiZ60.d.mts} +1 -1
  2. package/dist/{catalog-bSnBE19I.d.ts → catalog-h79CG5Wy.d.ts} +1 -1
  3. package/dist/index.d.mts +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/{messages-CHPNqMXf.d.mts → messages-mhHZiNGN.d.mts} +202 -9
  6. package/dist/{messages-CHPNqMXf.d.ts → messages-mhHZiNGN.d.ts} +202 -9
  7. package/dist/retry.d.mts +1 -1
  8. package/dist/retry.d.ts +1 -1
  9. package/dist/schemas/index.d.mts +6 -6
  10. package/dist/schemas/index.d.ts +6 -6
  11. package/dist/{schemas-WHkFakb3.d.mts → schemas-C9ssfehv.d.mts} +47 -1
  12. package/dist/{schemas-WHkFakb3.d.ts → schemas-C9ssfehv.d.ts} +47 -1
  13. package/dist/v3/index.d.mts +49 -29
  14. package/dist/v3/index.d.ts +49 -29
  15. package/dist/v3/index.js +65 -9
  16. package/dist/v3/index.js.map +1 -1
  17. package/dist/v3/index.mjs +62 -10
  18. package/dist/v3/index.mjs.map +1 -1
  19. package/dist/v3/otel/index.js +1 -1
  20. package/dist/v3/otel/index.js.map +1 -1
  21. package/dist/v3/otel/index.mjs +1 -1
  22. package/dist/v3/otel/index.mjs.map +1 -1
  23. package/dist/v3/prod/index.d.mts +1 -1
  24. package/dist/v3/prod/index.d.ts +1 -1
  25. package/dist/v3/schemas/index.d.mts +166 -4
  26. package/dist/v3/schemas/index.d.ts +166 -4
  27. package/dist/v3/schemas/index.js +52 -8
  28. package/dist/v3/schemas/index.js.map +1 -1
  29. package/dist/v3/schemas/index.mjs +49 -9
  30. package/dist/v3/schemas/index.mjs.map +1 -1
  31. package/dist/v3/utils/ioSerialization.js +48 -4
  32. package/dist/v3/utils/ioSerialization.js.map +1 -1
  33. package/dist/v3/utils/ioSerialization.mjs +48 -4
  34. package/dist/v3/utils/ioSerialization.mjs.map +1 -1
  35. package/dist/v3/utils/retries.d.mts +1 -1
  36. package/dist/v3/utils/retries.d.ts +1 -1
  37. package/dist/v3/workers/index.d.mts +4 -4
  38. package/dist/v3/workers/index.d.ts +4 -4
  39. package/dist/v3/workers/index.js +48 -4
  40. package/dist/v3/workers/index.js.map +1 -1
  41. package/dist/v3/workers/index.mjs +48 -4
  42. package/dist/v3/workers/index.mjs.map +1 -1
  43. package/dist/v3/zodfetch.d.mts +1 -1
  44. package/dist/v3/zodfetch.d.ts +1 -1
  45. package/package.json +1 -1
  46. package/dist/{api-a39zAY3E.d.mts → api-Pl9fxB8v.d.mts} +153 -153
  47. package/dist/{api--StDLb4h.d.ts → api-sNoooMbT.d.ts} +153 -153
@@ -344,13 +344,18 @@ var QueueOptions = zod.z.object({
344
344
  /** @deprecated This feature is coming soon */
345
345
  rateLimit: RateLimitOptions.optional()
346
346
  });
347
+ var ScheduleMetadata = zod.z.object({
348
+ cron: zod.z.string(),
349
+ timezone: zod.z.string()
350
+ });
347
351
  var TaskMetadata = zod.z.object({
348
352
  id: zod.z.string(),
349
353
  packageVersion: zod.z.string(),
350
354
  queue: QueueOptions.optional(),
351
355
  retry: RetryOptions.optional(),
352
356
  machine: MachineConfig.optional(),
353
- triggerSource: zod.z.string().optional()
357
+ triggerSource: zod.z.string().optional(),
358
+ schedule: ScheduleMetadata.optional()
354
359
  });
355
360
  var TaskFileMetadata = zod.z.object({
356
361
  filePath: zod.z.string(),
@@ -363,6 +368,7 @@ var TaskMetadataWithFilePath = zod.z.object({
363
368
  retry: RetryOptions.optional(),
364
369
  machine: MachineConfig.optional(),
365
370
  triggerSource: zod.z.string().optional(),
371
+ schedule: ScheduleMetadata.optional(),
366
372
  filePath: zod.z.string(),
367
373
  exportName: zod.z.string()
368
374
  });
@@ -424,7 +430,8 @@ var TaskResource = zod.z.object({
424
430
  queue: QueueOptions.optional(),
425
431
  retry: RetryOptions.optional(),
426
432
  machine: MachineConfig.optional(),
427
- triggerSource: zod.z.string().optional()
433
+ triggerSource: zod.z.string().optional(),
434
+ schedule: ScheduleMetadata.optional()
428
435
  });
429
436
  var BackgroundWorkerMetadata = zod.z.object({
430
437
  packageVersion: zod.z.string(),
@@ -477,6 +484,11 @@ var CreateBackgroundWorkerResponse = zod.z.object({
477
484
  version: zod.z.string(),
478
485
  contentHash: zod.z.string()
479
486
  });
487
+ var RunTag = zod.z.string().max(64, "Tags must be less than 64 characters");
488
+ var RunTags = zod.z.union([
489
+ RunTag,
490
+ RunTag.array().max(3, "You can only set a maximum of 3 tags on a run.")
491
+ ]);
480
492
  var TriggerTaskRequestBody = zod.z.object({
481
493
  payload: zod.z.any(),
482
494
  context: zod.z.any(),
@@ -491,6 +503,7 @@ var TriggerTaskRequestBody = zod.z.object({
491
503
  payloadType: zod.z.string().optional(),
492
504
  delay: zod.z.string().or(zod.z.coerce.date()).optional(),
493
505
  ttl: zod.z.string().or(zod.z.number().nonnegative().int()).optional(),
506
+ tags: RunTags.optional(),
494
507
  maxAttempts: zod.z.number().int().optional()
495
508
  }).optional()
496
509
  });
@@ -518,6 +531,9 @@ var GetBatchResponseBody = zod.z.object({
518
531
  ])
519
532
  }))
520
533
  });
534
+ var AddTagsRequestBody = zod.z.object({
535
+ tags: RunTags
536
+ });
521
537
  var RescheduleRunRequestBody = zod.z.object({
522
538
  delay: zod.z.string().or(zod.z.coerce.date())
523
539
  });
@@ -592,10 +608,21 @@ var ReplayRunResponse = zod.z.object({
592
608
  var CanceledRunResponse = zod.z.object({
593
609
  id: zod.z.string()
594
610
  });
611
+ var ScheduleType = zod.z.union([
612
+ zod.z.literal("DECLARATIVE"),
613
+ zod.z.literal("IMPERATIVE")
614
+ ]);
595
615
  var ScheduledTaskPayload = zod.z.object({
596
616
  /** The schedule id associated with this run (you can have many schedules for the same task).
597
617
  You can use this to remove the schedule, update it, etc */
598
618
  scheduleId: zod.z.string(),
619
+ /** The type of schedule – `"DECLARATIVE"` or `"IMPERATIVE"`.
620
+ *
621
+ * **DECLARATIVE** – defined inline on your `schedules.task` using the `cron` property. They can only be created, updated or deleted by modifying the `cron` property on your task.
622
+ *
623
+ * **IMPERATIVE** – created using the `schedules.create` functions or in the dashboard.
624
+ */
625
+ type: ScheduleType,
599
626
  /** When the task was scheduled to run.
600
627
  * Note this will be slightly different from `new Date()` because it takes a few ms to run the task.
601
628
  *
@@ -671,6 +698,7 @@ var ScheduleGenerator = zod.z.object({
671
698
  });
672
699
  var ScheduleObject = zod.z.object({
673
700
  id: zod.z.string(),
701
+ type: ScheduleType,
674
702
  task: zod.z.string(),
675
703
  active: zod.z.boolean(),
676
704
  deduplicationKey: zod.z.string().nullish(),
@@ -768,7 +796,11 @@ var CommonRunFields = {
768
796
  finishedAt: zod.z.coerce.date().optional(),
769
797
  delayedUntil: zod.z.coerce.date().optional(),
770
798
  ttl: zod.z.string().optional(),
771
- expiredAt: zod.z.coerce.date().optional()
799
+ expiredAt: zod.z.coerce.date().optional(),
800
+ tags: zod.z.string().array(),
801
+ costInCents: zod.z.number(),
802
+ baseCostInCents: zod.z.number(),
803
+ durationMs: zod.z.number()
772
804
  };
773
805
  var RetrieveRunResponse = zod.z.object({
774
806
  ...CommonRunFields,
@@ -1158,6 +1190,19 @@ var PlatformToProviderMessages = {
1158
1190
  projectId: zod.z.string(),
1159
1191
  runId: zod.z.string()
1160
1192
  })
1193
+ },
1194
+ PRE_PULL_DEPLOYMENT: {
1195
+ message: zod.z.object({
1196
+ version: zod.z.literal("v1").default("v1"),
1197
+ imageRef: zod.z.string(),
1198
+ shortCode: zod.z.string(),
1199
+ // identifiers
1200
+ envId: zod.z.string(),
1201
+ envType: EnvironmentType,
1202
+ orgId: zod.z.string(),
1203
+ projectId: zod.z.string(),
1204
+ deploymentId: zod.z.string()
1205
+ })
1161
1206
  }
1162
1207
  };
1163
1208
  var CreateWorkerMessage = zod.z.object({
@@ -1406,11 +1451,6 @@ var ClientToSharedQueueMessages = {
1406
1451
  backgroundWorkerId: zod.z.string(),
1407
1452
  data: BackgroundWorkerClientMessages
1408
1453
  })
1409
- },
1410
- PING: {
1411
- message: zod.z.object({
1412
- version: zod.z.literal("v1").default("v1")
1413
- })
1414
1454
  }
1415
1455
  };
1416
1456
  var SharedQueueToClientMessages = {
@@ -1883,6 +1923,7 @@ var SpanMessagingEvent = zod.z.object({
1883
1923
  destination: zod.z.string().optional()
1884
1924
  });
1885
1925
 
1926
+ exports.AddTagsRequestBody = AddTagsRequestBody;
1886
1927
  exports.AttemptStatus = AttemptStatus;
1887
1928
  exports.BackgroundWorkerClientMessages = BackgroundWorkerClientMessages;
1888
1929
  exports.BackgroundWorkerMetadata = BackgroundWorkerMetadata;
@@ -1965,8 +2006,11 @@ exports.RetryOptions = RetryOptions;
1965
2006
  exports.RunEnvironmentDetails = RunEnvironmentDetails;
1966
2007
  exports.RunScheduleDetails = RunScheduleDetails;
1967
2008
  exports.RunStatus = RunStatus;
2009
+ exports.RunTags = RunTags;
1968
2010
  exports.ScheduleGenerator = ScheduleGenerator;
2011
+ exports.ScheduleMetadata = ScheduleMetadata;
1969
2012
  exports.ScheduleObject = ScheduleObject;
2013
+ exports.ScheduleType = ScheduleType;
1970
2014
  exports.ScheduledTaskPayload = ScheduledTaskPayload;
1971
2015
  exports.SharedQueueToClientMessages = SharedQueueToClientMessages;
1972
2016
  exports.SlidingWindowRateLimit = SlidingWindowRateLimit;