@trigger.dev/sdk 2.3.11 → 2.3.13

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.
package/dist/index.js CHANGED
@@ -266,7 +266,7 @@ __name(_Job, "Job");
266
266
  var Job = _Job;
267
267
 
268
268
  // package.json
269
- var version = "2.3.11";
269
+ var version = "2.3.13";
270
270
 
271
271
  // src/errors.ts
272
272
  var _ResumeWithTaskError = class _ResumeWithTaskError {
@@ -643,6 +643,13 @@ var _IO = class _IO {
643
643
  get logger() {
644
644
  return new IOLogger(async (level, message, data) => {
645
645
  let logLevel = "info";
646
+ if (data instanceof Error) {
647
+ data = {
648
+ name: data.name,
649
+ message: data.message,
650
+ stack: data.stack
651
+ };
652
+ }
646
653
  if (coreBackend.Logger.satisfiesLogLevel(logLevel, this._jobLogLevel)) {
647
654
  await this.runTask([
648
655
  message,
@@ -1387,7 +1394,6 @@ var _IO = class _IO {
1387
1394
  * @returns A Promise that resolves with the returned value of the callback.
1388
1395
  */
1389
1396
  async runTask(cacheKey, callback, options, onError) {
1390
- __privateMethod(this, _detectAutoYield, detectAutoYield_fn).call(this, "start_task", 500);
1391
1397
  const parentId = this._taskStorage.getStore()?.taskId;
1392
1398
  if (parentId) {
1393
1399
  this._logger.debug("Using parent task", {
@@ -1396,6 +1402,10 @@ var _IO = class _IO {
1396
1402
  options
1397
1403
  });
1398
1404
  }
1405
+ const isSubtaskNoop = options?.noop === true && parentId !== void 0;
1406
+ if (!isSubtaskNoop) {
1407
+ __privateMethod(this, _detectAutoYield, detectAutoYield_fn).call(this, "start_task", 500);
1408
+ }
1399
1409
  const idempotencyKey = await generateIdempotencyKey([
1400
1410
  this._id,
1401
1411
  parentId ?? "",
@@ -2729,6 +2739,7 @@ function eventTrigger(options) {
2729
2739
  return new EventTrigger({
2730
2740
  name: options.name,
2731
2741
  filter: options.filter,
2742
+ source: options.source,
2732
2743
  event: {
2733
2744
  name: options.name,
2734
2745
  title: "Event",
@@ -2815,7 +2826,7 @@ var _CronTrigger = class _CronTrigger {
2815
2826
  get event() {
2816
2827
  const humanReadable = cronstrue__default.default.toString(this.options.cron, {
2817
2828
  throwExceptionOnParseError: false
2818
- });
2829
+ }).concat(" (UTC)");
2819
2830
  return {
2820
2831
  name: "trigger.scheduled",
2821
2832
  title: "Cron Schedule",
@@ -3403,7 +3414,7 @@ var _TriggerClient = class _TriggerClient {
3403
3414
  }
3404
3415
  defineJob(options) {
3405
3416
  const existingRegisteredJob = __privateGet(this, _registeredJobs)[options.id];
3406
- if (existingRegisteredJob) {
3417
+ if (existingRegisteredJob && options.__internal !== true) {
3407
3418
  console.warn(`[@trigger.dev/sdk] Warning: The Job "${existingRegisteredJob.id}" you're attempting to define has already been defined. Please assign a different ID to the job.`);
3408
3419
  }
3409
3420
  const job = new Job(options);