@trigger.dev/sdk 2.3.11 → 2.3.12

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.12";
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",