@dudousxd/nestjs-durable 0.34.0 → 0.34.1

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.d.cts CHANGED
@@ -678,6 +678,7 @@ declare class DurableStartClient {
678
678
  }, _opts?: StartOptions): Promise<void>;
679
679
  publishEvent(_name: string, _payload: unknown, _opts?: {
680
680
  id?: string;
681
+ buffer?: boolean;
681
682
  }): Promise<void>;
682
683
  }
683
684
 
@@ -1095,9 +1096,14 @@ declare class WorkflowService {
1095
1096
  * starts a fresh run of every workflow subscribed via `@Workflow({ onEvent })` / `@OnDurableEvent` (the
1096
1097
  * payload becomes its input). Pass `opts.id` to dedupe redeliveries. Returns how many runs it
1097
1098
  * touched (resumed + started).
1099
+ *
1100
+ * Reliable by default: a publish that touches NOBODY (no live waiter, no subscriber) buffers ONE
1101
+ * copy so a LATER `waitForEvent(name, { match })` still consumes it instead of it being dropped —
1102
+ * see {@link WorkflowEngine.publishEvent}'s full semantics doc. Pass `opts.buffer: false` to opt out.
1098
1103
  */
1099
1104
  publishEvent(name: string, payload: unknown, opts?: {
1100
1105
  id?: string;
1106
+ buffer?: boolean;
1101
1107
  }): Promise<number>;
1102
1108
  }
1103
1109
 
package/dist/index.d.ts CHANGED
@@ -678,6 +678,7 @@ declare class DurableStartClient {
678
678
  }, _opts?: StartOptions): Promise<void>;
679
679
  publishEvent(_name: string, _payload: unknown, _opts?: {
680
680
  id?: string;
681
+ buffer?: boolean;
681
682
  }): Promise<void>;
682
683
  }
683
684
 
@@ -1095,9 +1096,14 @@ declare class WorkflowService {
1095
1096
  * starts a fresh run of every workflow subscribed via `@Workflow({ onEvent })` / `@OnDurableEvent` (the
1096
1097
  * payload becomes its input). Pass `opts.id` to dedupe redeliveries. Returns how many runs it
1097
1098
  * touched (resumed + started).
1099
+ *
1100
+ * Reliable by default: a publish that touches NOBODY (no live waiter, no subscriber) buffers ONE
1101
+ * copy so a LATER `waitForEvent(name, { match })` still consumes it instead of it being dropped —
1102
+ * see {@link WorkflowEngine.publishEvent}'s full semantics doc. Pass `opts.buffer: false` to opt out.
1098
1103
  */
1099
1104
  publishEvent(name: string, payload: unknown, opts?: {
1100
1105
  id?: string;
1106
+ buffer?: boolean;
1101
1107
  }): Promise<number>;
1102
1108
  }
1103
1109
 
package/dist/index.js CHANGED
@@ -1694,6 +1694,10 @@ var WorkflowService = class {
1694
1694
  * starts a fresh run of every workflow subscribed via `@Workflow({ onEvent })` / `@OnDurableEvent` (the
1695
1695
  * payload becomes its input). Pass `opts.id` to dedupe redeliveries. Returns how many runs it
1696
1696
  * touched (resumed + started).
1697
+ *
1698
+ * Reliable by default: a publish that touches NOBODY (no live waiter, no subscriber) buffers ONE
1699
+ * copy so a LATER `waitForEvent(name, { match })` still consumes it instead of it being dropped —
1700
+ * see {@link WorkflowEngine.publishEvent}'s full semantics doc. Pass `opts.buffer: false` to opt out.
1697
1701
  */
1698
1702
  publishEvent(name, payload, opts) {
1699
1703
  return this.engine.publishEvent(name, payload, opts);