@dudousxd/nestjs-durable-core 0.50.1 → 0.52.0

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.cjs CHANGED
@@ -22,6 +22,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
22
22
  // src/index.ts
23
23
  var index_exports = {};
24
24
  __export(index_exports, {
25
+ CONTROL_FLOW_SIGNAL: () => CONTROL_FLOW_SIGNAL,
25
26
  CodecStateStore: () => CodecStateStore,
26
27
  ContinueAsNew: () => ContinueAsNew,
27
28
  DURABLE_OPTIONS: () => DURABLE_OPTIONS,
@@ -67,6 +68,7 @@ __export(index_exports, {
67
68
  eventPrefix: () => eventPrefix,
68
69
  eventToken: () => eventToken,
69
70
  indexWaitersByRun: () => indexWaitersByRun,
71
+ isWorkflowControlFlowSignal: () => isWorkflowControlFlowSignal,
70
72
  matchesAttributes: () => matchesAttributes,
71
73
  normalizeAttributeRows: () => normalizeAttributeRows,
72
74
  parseDuration: () => parseDuration,
@@ -259,6 +261,13 @@ function currentWorkflowCtx() {
259
261
  }
260
262
  __name(currentWorkflowCtx, "currentWorkflowCtx");
261
263
 
264
+ // src/control-flow-signal.ts
265
+ var CONTROL_FLOW_SIGNAL = Symbol.for("aviary:durable:control-flow");
266
+ function isWorkflowControlFlowSignal(error) {
267
+ return typeof error === "object" && error !== null && error[CONTROL_FLOW_SIGNAL] === true;
268
+ }
269
+ __name(isWorkflowControlFlowSignal, "isWorkflowControlFlowSignal");
270
+
262
271
  // src/errors.ts
263
272
  var FatalError = class extends Error {
264
273
  static {
@@ -357,6 +366,8 @@ var WorkflowSuspended = class extends Error {
357
366
  }
358
367
  /** Epoch ms to auto-resume (durable sleep), or undefined when waiting on an external signal. */
359
368
  wakeAt;
369
+ /** Marks this as a control-flow signal — see {@link isWorkflowControlFlowSignal}. */
370
+ [CONTROL_FLOW_SIGNAL] = true;
360
371
  constructor(wakeAt) {
361
372
  super("workflow suspended");
362
373
  this.name = "WorkflowSuspended";
@@ -368,6 +379,8 @@ var ContinueAsNew = class extends Error {
368
379
  __name(this, "ContinueAsNew");
369
380
  }
370
381
  input;
382
+ /** Marks this as a control-flow signal — see {@link isWorkflowControlFlowSignal}. */
383
+ [CONTROL_FLOW_SIGNAL] = true;
371
384
  constructor(input) {
372
385
  super("workflow continued as new"), this.input = input;
373
386
  this.name = "ContinueAsNew";
@@ -5290,6 +5303,7 @@ var InMemoryTransport = class {
5290
5303
  };
5291
5304
  // Annotate the CommonJS export names for ESM import in node:
5292
5305
  0 && (module.exports = {
5306
+ CONTROL_FLOW_SIGNAL,
5293
5307
  CodecStateStore,
5294
5308
  ContinueAsNew,
5295
5309
  DURABLE_OPTIONS,
@@ -5335,6 +5349,7 @@ var InMemoryTransport = class {
5335
5349
  eventPrefix,
5336
5350
  eventToken,
5337
5351
  indexWaitersByRun,
5352
+ isWorkflowControlFlowSignal,
5338
5353
  matchesAttributes,
5339
5354
  normalizeAttributeRows,
5340
5355
  parseDuration,