@dudousxd/nestjs-durable 0.48.1 → 0.48.2

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
@@ -829,6 +829,7 @@ declare class DurableStartClient {
829
829
  resume(_runId: string): Promise<void>;
830
830
  waitForRun(_runId: string, _opts?: {
831
831
  timeoutMs?: number;
832
+ until?: 'settled' | 'terminal';
832
833
  }): Promise<void>;
833
834
  signal(_token: string, _payload: unknown): Promise<void>;
834
835
  signalWithStart(_workflow: string, _input: unknown, _runId: string, _signal: {
@@ -1278,9 +1279,12 @@ declare class WorkflowService {
1278
1279
  * Resolve once a run settles — terminal (completed/failed/cancelled/dead) or suspended. `start`
1279
1280
  * only enqueues (a worker runs the body), so pair them when a request needs the outcome:
1280
1281
  * `const { runId } = await svc.start(...); const result = await svc.waitForRun(runId)`.
1282
+ * `until: 'terminal'` waits past suspensions until the run completes/fails/is cancelled — what a
1283
+ * delayed start (`opts.startAt`) needs, since it is `suspended` until its timer fires.
1281
1284
  */
1282
1285
  waitForRun(runId: string, opts?: {
1283
1286
  timeoutMs?: number;
1287
+ until?: 'settled' | 'terminal';
1284
1288
  }): Promise<RunResult>;
1285
1289
  /** Deliver an external signal (e.g. from a webhook) to the run waiting on `token`. */
1286
1290
  signal(token: string, payload: unknown): Promise<RunResult | null>;
package/dist/index.d.ts CHANGED
@@ -829,6 +829,7 @@ declare class DurableStartClient {
829
829
  resume(_runId: string): Promise<void>;
830
830
  waitForRun(_runId: string, _opts?: {
831
831
  timeoutMs?: number;
832
+ until?: 'settled' | 'terminal';
832
833
  }): Promise<void>;
833
834
  signal(_token: string, _payload: unknown): Promise<void>;
834
835
  signalWithStart(_workflow: string, _input: unknown, _runId: string, _signal: {
@@ -1278,9 +1279,12 @@ declare class WorkflowService {
1278
1279
  * Resolve once a run settles — terminal (completed/failed/cancelled/dead) or suspended. `start`
1279
1280
  * only enqueues (a worker runs the body), so pair them when a request needs the outcome:
1280
1281
  * `const { runId } = await svc.start(...); const result = await svc.waitForRun(runId)`.
1282
+ * `until: 'terminal'` waits past suspensions until the run completes/fails/is cancelled — what a
1283
+ * delayed start (`opts.startAt`) needs, since it is `suspended` until its timer fires.
1281
1284
  */
1282
1285
  waitForRun(runId: string, opts?: {
1283
1286
  timeoutMs?: number;
1287
+ until?: 'settled' | 'terminal';
1284
1288
  }): Promise<RunResult>;
1285
1289
  /** Deliver an external signal (e.g. from a webhook) to the run waiting on `token`. */
1286
1290
  signal(token: string, payload: unknown): Promise<RunResult | null>;
package/dist/index.js CHANGED
@@ -2427,6 +2427,8 @@ var WorkflowService = class {
2427
2427
  * Resolve once a run settles — terminal (completed/failed/cancelled/dead) or suspended. `start`
2428
2428
  * only enqueues (a worker runs the body), so pair them when a request needs the outcome:
2429
2429
  * `const { runId } = await svc.start(...); const result = await svc.waitForRun(runId)`.
2430
+ * `until: 'terminal'` waits past suspensions until the run completes/fails/is cancelled — what a
2431
+ * delayed start (`opts.startAt`) needs, since it is `suspended` until its timer fires.
2430
2432
  */
2431
2433
  waitForRun(runId, opts) {
2432
2434
  return this.engine.waitForRun(runId, opts);