@dudousxd/nestjs-durable 0.57.0 → 0.59.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.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { WorkflowCtx, SearchAttributes, WorkflowClass, StandardSchemaV1, StepError, OnEventEntry, OnErrorInput, LifecycleEventOf, WorkflowLifecycleEvent, WorkflowRef, SingletonConfig, ConcurrencyConfig, SearchAttributesSchema, EventBatchConfig, TenantVerifier, VerifiedTenant, TenantTokenSource, StateStore, Transport, NamedTransport, ControlPlane, StalledRunInfo, ScheduledWorkflow, RetentionPolicy, QueueConfig, AdmissionBackend, WorkflowInputOf, StartOptions, RunResult, RunGateway, WorkflowEngine, EntityHandler, RunRequest, RunReply, DurableTopology, RunDetailOptions, RunDetail, FanPageQuery, FanPage, WorkflowRun, RunQuery, RunListItem, RunFacetQuery, RunFacetRow, RunValueAxis, RunValueFacetOptions, RunValueFacetRow, GroupHealth, RunWaiting, RepublishLifecycleTarget, RepublishLifecycleResult, WorkflowLifecycleLinks, EngineEvent, StepInvocation, LifecycleKind, TenantEvent, SignalOptions } from '@dudousxd/nestjs-durable-core';
1
+ import { WorkflowCtx, SearchAttributes, WorkflowClass, StandardSchemaV1, StepError, OnEventEntry, OnErrorInput, LifecycleEventOf, WorkflowLifecycleEvent, WorkflowRef, SingletonConfig, ConcurrencyConfig, SearchAttributesSchema, EventBatchConfig, TenantVerifier, VerifiedTenant, TenantTokenSource, StateStore, Transport, NamedTransport, ControlPlane, StalledRunInfo, ScheduledWorkflow, RetentionPolicy, QueueConfig, AdmissionBackend, WorkflowInputOf, StartOptions, RunResult, RunGateway, WorkflowEngine, EntityHandler, RunRequest, RunReply, TenantFilter as TenantFilter$1, DurableTopology, RunDetailOptions, RunDetail, FanPageQuery, FanPage, WorkflowRun, RunQuery, RunListItem, RunFacetQuery, RunFacetRow, RunValueAxis, RunValueFacetOptions, RunValueFacetRow, GroupHealth, RunWaiting, RepublishLifecycleTarget, RepublishLifecycleResult, WorkflowLifecycleLinks, EngineEvent, StepInvocation, LifecycleKind, TenantEvent, SignalOptions } from '@dudousxd/nestjs-durable-core';
2
2
  export { AttributeFilter, DynamicWorkflowCtx, EngineEvent, EventSubscription, InferSearchAttributes, LIFECYCLE_PENDING_TAG, LifecycleEventOf, LifecycleKind, OnErrorInput, OnEventEntry, RunDetail, RunGateway, RunListItem, RunQuery, RunSchedulesOptions, RunStatus, RunWaiting, ScheduledWorkflow, SearchAttributes, SearchAttributesSchema, StepCheckpoint, StepEvent, StepLogger, TenantTokenSource, TenantVerifier, VerifiedTenant, WorkflowCtx, WorkflowEngine, WorkflowHandler, WorkflowLifecycleEvent, WorkflowRun, hmacTenantVerifier, lifecycleRunId, lifecycleSourceOf, prevCronFireMs, readSearchAttributes, runCompletedEvent, runFailedEvent, runSchedules, scheduleRunIdAt, scheduledRunId, signTenantToken, triggeredRunsOf } from '@dudousxd/nestjs-durable-core';
3
3
  import { z } from 'zod';
4
4
  import { ConcurrencyOption, StartRunDeps, RunRedisWorkerOptions, RunningWorker, DurableWorkerRuntime } from '@dudousxd/durable-worker';
@@ -106,15 +106,30 @@ interface ContextAccessor {
106
106
  * an app's own accessor, may not have it; durable then treats tenancy as off.
107
107
  */
108
108
  tenant?(): TenantRef | undefined;
109
- /** The context's `tenancy` switch: `{ enabled, kinds? }`. Optional, as above. */
109
+ /** The context's `tenancy` switch: `{ enabled, kinds?, required? }`. Optional, as above. */
110
110
  tenancy?(): {
111
111
  enabled: boolean;
112
112
  kinds?: string[];
113
+ required?: boolean;
113
114
  };
114
- /** How a lib must scope data right now. Optional, as above. */
115
+ /**
116
+ * How a lib must scope data right now. `kinds` picks the level of a nested tenant, `family` a
117
+ * secondary tenant, `required` overrides the context's (context ≥ 2.1). Optional, as above.
118
+ */
115
119
  tenantFilter?(options?: {
116
120
  kinds?: string[];
121
+ family?: string;
122
+ required?: boolean;
117
123
  }): TenantFilter;
124
+ /** Display labels keyed by tenant id (context ≥ 2.1). Optional, as above. */
125
+ tenantLabels?(tenants: TenantLevel[]): Promise<Record<string, string>>;
126
+ }
127
+ /** One level of a tenant chain (context ≥ 2.1). */
128
+ interface TenantLevel {
129
+ id: string;
130
+ kind: string;
131
+ slug?: string;
132
+ role?: string;
118
133
  }
119
134
  /** A tenant as the context reports it. Structural mirror of nestjs-context's `TenantRef`. */
120
135
  interface TenantRef {
@@ -123,6 +138,10 @@ interface TenantRef {
123
138
  source: string;
124
139
  slug?: string;
125
140
  role?: string;
141
+ /** The active chain, root first, this tenant last (context ≥ 2.1). */
142
+ chain?: TenantLevel[];
143
+ /** The secondary tenant family this ref belongs to (context ≥ 2.1). */
144
+ family?: string;
126
145
  }
127
146
  /** How a lib must scope data right now. Structural mirror of nestjs-context's `TenantFilter`. */
128
147
  type TenantFilter = {
@@ -134,6 +153,7 @@ type TenantFilter = {
134
153
  } | {
135
154
  mode: 'tenant';
136
155
  tenant: TenantRef;
156
+ chain?: TenantLevel[];
137
157
  };
138
158
 
139
159
  /** A class-validator DTO class — validated with the same `plainToInstance` + `validate` NestJS's
@@ -166,8 +186,8 @@ interface WorkflowMeta {
166
186
  concurrency?: ConcurrencyConfig | undefined;
167
187
  /** Max wall-clock lifetime before a run is cancelled (e.g. `'2h'`). See `WorkflowOptions`. */
168
188
  executionTimeout?: string | number | undefined;
169
- /** Input schema (Standard Schema or DTO class), parsed at start and before every turn. Holds
170
- * `input` or its `inputSchema` alias. See `WorkflowOptions`. */
189
+ /** Input schema (Standard Schema or DTO class), parsed at start and before every turn. See
190
+ * `WorkflowOptions`. */
171
191
  input?: IoSchema | undefined;
172
192
  /** Output schema, parsed before the run completes. See `WorkflowOptions`. */
173
193
  output?: IoSchema | undefined;
@@ -269,11 +289,6 @@ interface WorkflowOptions {
269
289
  * run with `code: 'invalid_output'`. The same option `@Step({ output })` takes.
270
290
  */
271
291
  output?: IoSchema;
272
- /**
273
- * Alias of {@link input}, kept for workflows declared before `input` existed. Setting both is an
274
- * error.
275
- */
276
- inputSchema?: IoSchema;
277
292
  /**
278
293
  * A custom check at `start` (throw to reject) for a rule a schema can't express — a cross-field
279
294
  * invariant, an async lookup. It runs after `input` parses and receives the parsed value (the input
@@ -414,11 +429,6 @@ interface StepOptions {
414
429
  * from the method signature are the only check, and the step dispatches with no retry/timeout.
415
430
  */
416
431
  declare function Step(nameOrOptions?: string | StepOptions): MethodDecorator;
417
- /**
418
- * @deprecated Use `@Step` instead. `@DurableStep` is a back-compat alias of {@link Step} and
419
- * writes the same `DURABLE_STEP_METADATA`, so discovery/registrars treat them identically.
420
- */
421
- declare const DurableStep: typeof Step;
422
432
  declare function getDurableStepMeta(method: Function): DurableStepMeta | undefined;
423
433
  declare const DEAD_LETTER_METADATA: unique symbol;
424
434
  /**
@@ -601,30 +611,40 @@ declare const ON_EVENT_BATCH_METADATA: unique symbol;
601
611
  * workflow never silently coalesces one way while its decorator says another.
602
612
  */
603
613
  declare function eventBatchOf(meta: WorkflowMeta, target: object): EventBatchConfig | undefined;
604
- /** @deprecated Renamed to `OnDurableEvent` — this alias clashes with `@nestjs/event-emitter`'s `@OnEvent` and will be removed in the next minor. */
605
- declare const OnEvent: typeof OnDurableEvent;
606
614
  /**
607
615
  * All events a workflow class subscribes to: `@Workflow({ onEvent })`, `@OnDurableEvent`,
608
616
  * `@OnWorkflowCompleted` and `@OnWorkflowFailed`. Repeated bare names collapse to one.
609
617
  */
610
618
  declare function getOnEvents(meta: WorkflowMeta, target: object): OnEventEntry[];
611
619
 
612
- /**
613
- * Tenancy for durable: the CUSTOMER a run belongs to (`@dudousxd/nestjs-context`'s tenant), not the
614
- * worker-pool `namespace`. A local, structural reader of the context contract — durable never imports
615
- * nestjs-context, so it works with any context version or none at all: with the accessor (or its
616
- * tenancy methods) missing, tenancy reads as off and durable behaves exactly as without it.
617
- */
618
- /** The `tenancy` option of `DurableModule`. Same shape in every Aviary lib. */
619
- type DurableTenancyOption = 'inherit' | false | {
620
- /** `'inherit'` (default) follows `ContextModule`'s `tenancy.enabled`. */
620
+ type TenancyOption = 'inherit' | false | {
621
621
  enabled?: 'inherit' | boolean;
622
- /** Tenant kinds durable honours, instead of the context's own `kinds`. */
623
622
  kinds?: string[];
624
- /** Whether a tenant request also sees runs with no tenant. Default `'tenantless'` (it does not). */
623
+ family?: string;
624
+ required?: boolean;
625
625
  nullRows?: 'tenantless' | 'shared';
626
626
  };
627
627
 
628
+ /**
629
+ * Tenancy for durable: the CUSTOMER a run belongs to (`@dudousxd/nestjs-context`'s tenant), not the
630
+ * worker-pool `namespace`. Read through the local copy of the context's tenancy reader
631
+ * (`./tenancy-reader`): durable never imports nestjs-context, so it works with any context version
632
+ * or none at all. With the accessor (or its tenancy methods) missing, tenancy reads as off and
633
+ * durable behaves exactly as without it.
634
+ */
635
+ /**
636
+ * The `tenancy` option of `DurableModule`. Same shape in every Aviary lib:
637
+ * - `enabled`: `'inherit'` (default) follows `ContextModule`'s `tenancy.enabled`;
638
+ * - `kinds`: the tenant kinds durable stamps and filters by. On a nested tenant (clinic → unit) the
639
+ * most specific level of the active chain whose kind is listed is the one used;
640
+ * - `family`: read a secondary tenant family (e.g. `'account'`) instead of the primary one;
641
+ * - `required`: with no tenant, an app-facing read or start throws the context's
642
+ * `TenantRequiredError` (403) instead of running tenantless. Defaults to the context's own
643
+ * `tenancy.required`. Durable's own work (turns, recovery, schedules, worker steps) never throws;
644
+ * - `nullRows: 'shared'`: a tenant also sees runs with no tenant (default `'tenantless'`: it does not).
645
+ */
646
+ type DurableTenancyOption = TenancyOption;
647
+
628
648
  /** What a tenant verifier receives for each request a tenant process sends. */
629
649
  interface TenantVerifierInput {
630
650
  /** The token presented on the request (the wire `tenant` field). */
@@ -716,7 +736,7 @@ interface DurableRetentionOptions {
716
736
  * timer/retention/registrars, executing registered bodies INLINE. Driven by {@link drive} (default
717
737
  * `true`).
718
738
  * - `{ connection }` (no `store`): **thin worker**, `WorkflowEngine` resolves to a store-less
719
- * `DurableStartClient`; `RUN_GATEWAY` is a `ProxyRunGateway` when `transport` is also given, else
739
+ * `DurableStartClient`; `RunGateway` is a `ProxyRunGateway` when `transport` is also given, else
720
740
  * every method rejects with a clear error. No store/timer/retention/entity, just discovered
721
741
  * `@Workflow`/`@Step` handlers served over ONE `runRedisWorker` consumer.
722
742
  * - `{ store, transport, connection }`: an **operator that also runs a co-located worker**: every
@@ -1163,9 +1183,13 @@ declare class DurableModule {
1163
1183
  declare class DurableStartClient {
1164
1184
  private readonly options;
1165
1185
  private readonly deps?;
1186
+ /** The context accessor, for the customer tenant a start claims (else the global slot). */
1187
+ private readonly accessor?;
1166
1188
  private readonly tenant;
1167
1189
  private readonly tenantToken;
1168
- constructor(options: DurableModuleOptions, deps?: StartRunDeps | undefined);
1190
+ constructor(options: DurableModuleOptions, deps?: StartRunDeps | undefined,
1191
+ /** The context accessor, for the customer tenant a start claims (else the global slot). */
1192
+ accessor?: ContextAccessor | undefined);
1169
1193
  start<C extends WorkflowClass>(workflow: C, input: WorkflowInputOf<C>, runId?: string, opts?: StartOptions): Promise<RunResult>;
1170
1194
  start(workflow: string, input: unknown, runId?: string, opts?: StartOptions): Promise<RunResult>;
1171
1195
  cancel(_runId: string): Promise<void>;
@@ -1262,7 +1286,7 @@ declare class ThinWorkerBootstrap implements OnApplicationBootstrap, OnApplicati
1262
1286
  */
1263
1287
  declare function thinWorkerProviders(): Provider[];
1264
1288
  /**
1265
- * The no-transport fallback bound to `RUN_GATEWAY` for a thin worker (`connection` set, `store`
1289
+ * The no-transport fallback bound to `RunGateway` for a thin worker (`connection` set, `store`
1266
1290
  * unset) that didn't also pass a `transport` — mirrors `DurableStartClient`'s tenant-error idiom
1267
1291
  * (`tenantUnsupported`): every method rejects with a clear, named error instead of a cryptic
1268
1292
  * `this.gateway.X is not a function`. `subscribe` is synchronous on the `RunGateway` port, so it
@@ -1446,7 +1470,7 @@ declare class RunGatewayError extends Error {
1446
1470
  /**
1447
1471
  * Tenant-side `RunGateway` — round-trips every verb as a `RunRequest`/`RunReply` pair over the
1448
1472
  * transport, correlated by a minted `requestId`, and bridges `subscribe` onto the transport's
1449
- * per-tenant event stream. Bound under `RUN_GATEWAY` by `DurableModule`'s thin-worker role
1473
+ * per-tenant event stream. Bound under `RunGateway` by `DurableModule`'s thin-worker role
1450
1474
  * (`connection` set, no `store`) when the app supplies a `transport` (see `unavailableRunGateway`
1451
1475
  * for the no-transport fallback). The counterpart to the operator-side `StoreRunGateway`: a tenant
1452
1476
  * worker never touches a store/driver directly, only this proxy.
@@ -1464,6 +1488,13 @@ declare class ProxyRunGateway implements RunGateway {
1464
1488
  * stays keyed by `tenant`, never the token: the operator republishes by the run's namespace.
1465
1489
  */
1466
1490
  private readonly tenantToken?;
1491
+ /**
1492
+ * The customer-tenancy filter of the request being served (durable's `tenancy` on this process).
1493
+ * The control plane answers for this process's namespace; this narrows it to the request's
1494
+ * customer tenant: lists and counts get the tenant predicate, and a run of another tenant reads
1495
+ * (and is controlled) as missing. Absent: no narrowing.
1496
+ */
1497
+ private readonly tenantFilter?;
1467
1498
  private readonly pending;
1468
1499
  /** Verb → when to ask the control plane for it again, after it answered that it does not know it.
1469
1500
  * During a rolling upgrade the control plane is several pods of mixed versions behind one queue,
@@ -1478,7 +1509,28 @@ declare class ProxyRunGateway implements RunGateway {
1478
1509
  * Omit to send the raw `tenant` (prefix/network isolation only). The live-tail channel always
1479
1510
  * stays keyed by `tenant`, never the token: the operator republishes by the run's namespace.
1480
1511
  */
1481
- tenantToken?: TenantTokenSource | undefined);
1512
+ tenantToken?: TenantTokenSource | undefined,
1513
+ /**
1514
+ * The customer-tenancy filter of the request being served (durable's `tenancy` on this process).
1515
+ * The control plane answers for this process's namespace; this narrows it to the request's
1516
+ * customer tenant: lists and counts get the tenant predicate, and a run of another tenant reads
1517
+ * (and is controlled) as missing. Absent: no narrowing.
1518
+ */
1519
+ tenantFilter?: (() => TenantFilter$1) | undefined);
1520
+ /** The request's tenant filter when it can hide runs (`tenant` / `tenantless`), else undefined. */
1521
+ private restrictive;
1522
+ /**
1523
+ * Send `query`, narrowed to the runs the request may see. A tenant-required request with no
1524
+ * tenant rejects (never throws synchronously).
1525
+ */
1526
+ private scoped;
1527
+ /** `run` when the request may see it, else null (an invisible run reads like a missing one). */
1528
+ private visible;
1529
+ /** Run a control call unless the request may not act on `runId` (then `null`, like a missing run).
1530
+ * Sent at once when nothing narrows the request. */
1531
+ private guarded;
1532
+ /** Before a control call: true when the request may NOT act on `runId`. */
1533
+ private hidden;
1482
1534
  private handleReply;
1483
1535
  private request;
1484
1536
  private send;
@@ -1495,6 +1547,7 @@ declare class ProxyRunGateway implements RunGateway {
1495
1547
  * to know the verb: it then answers with no data, or with an unsupported-request error.
1496
1548
  */
1497
1549
  getRun(runId: string): Promise<WorkflowRun | null>;
1550
+ private getRunUnscoped;
1498
1551
  private knownUnsupported;
1499
1552
  /** The control plane's `StoreRunGateway` resolves each run's `waiting` descriptor; the reply carries
1500
1553
  * it through as plain JSON, so a tenant's list rows name the wait too. */
@@ -1571,7 +1624,7 @@ declare function StepInterceptor(): ClassDecorator;
1571
1624
  declare function isStepInterceptor(target: Function): boolean;
1572
1625
 
1573
1626
  /**
1574
- * Store-backed `RunGateway` — the operator-side implementation, bound to {@link RUN_GATEWAY} on
1627
+ * Store-backed `RunGateway` — the operator-side implementation, bound to {@link RunGateway} on
1575
1628
  * worker/drive instances. Reuses `DashboardService`'s six read/control method bodies verbatim
1576
1629
  * (`dashboard.service.ts:76-172`), so a consumer that only needs the bounded `RunGateway` surface
1577
1630
  * (the `RunRequestResponder`, a thin controller) doesn't have to depend on the dashboard package.
@@ -1693,14 +1746,10 @@ declare class TenantEventRepublisher {
1693
1746
  */
1694
1747
  declare const CONTEXT_ACCESSOR: unique symbol;
1695
1748
  /**
1696
- * @deprecated Inject the `RunGateway` abstract class directly (it is its own DI token now):
1697
- * `constructor(private readonly gateway: RunGateway)`, provider `{ provide: RunGateway, useClass }`.
1698
- * This symbol is kept as a back-compat alias — it points at the `RunGateway` class, so existing
1699
- * `@Inject(RUN_GATEWAY)` sites resolve the very same token — and will be removed in a future major.
1700
- *
1701
- * `RunGateway` is owned by `@dudousxd/nestjs-durable-core` (a required peer dep of both this package
1702
- * and the dashboard), so the abstract class is a single shared token across packages without the
1703
- * previous `Symbol.for` value-sharing hack.
1749
+ * @deprecated Inject the `RunGateway` class, which is its own DI token:
1750
+ * `constructor(private readonly gateway: RunGateway)`. Kept because published
1751
+ * `@dudousxd/nestjs-agent` and `@dudousxd/nestjs-agent-opencode` releases import it; it is the
1752
+ * `RunGateway` class itself, so `@Inject(RUN_GATEWAY)` resolves the same provider.
1704
1753
  */
1705
1754
  declare const RUN_GATEWAY: typeof RunGateway;
1706
1755
 
@@ -1782,4 +1831,4 @@ declare class WorkflowService {
1782
1831
  republishLifecycle(target: RepublishLifecycleTarget): Promise<RepublishLifecycleResult>;
1783
1832
  }
1784
1833
 
1785
- export { BAD_RUN_REQUEST, CONTEXT_ACCESSOR, type ContextAccessor, type ContextStore, type ContractClass, type ControlPlaneDurableOptions, DEAD_LETTER_METADATA, DURABLE_STEP_METADATA, DURABLE_WORKER_RUNNERS, DURABLE_WORKER_RUNTIME, DeadLetter, type DtoClass, DurableModule, type DurableModuleAsyncOptions, type DurableModuleOptions, type DurableModuleSharedOptions, type DurableRetentionOptions, DurableStartClient, DurableStep, type DurableStepInterceptor, type DurableStepMeta, type DurableTopologyName, ENTITY_METADATA, ENTITY_ON_METADATA, Entity, EntityService, type ErrorClassWithCode, IN_APP_RUN_REDIS_WORKER, IN_APP_WORKER_BINDING, IN_APP_WORKER_RUNNERS, IN_APP_WORKER_RUNTIME, type InAppWorkerBinding, InAppWorkerBootstrap, type IoSchema, type LazyContract, ON_ERROR_METADATA, ON_EVENT_BATCH_METADATA, ON_EVENT_METADATA, On, OnDurableEvent, OnError, type OnErrorMethod, OnEvent, OnWorkflowCompleted, OnWorkflowFailed, type OnWorkflowFailedOptions, type OnWorkflowSettledOptions, ProxyRunGateway, RUN_GATEWAY, RUN_REDIS_WORKER, RunGatewayError, type RunGatewayErrorCode, type RunLookupStore, type RunRedisWorkerFn, RunRequestResponder, type RunRequestResponderOptions, type RunRequestTransport, STEP_INTERCEPTOR_METADATA, type StandaloneDurableOptions, Step, StepInterceptor, type StepOptions, StoreRunGateway, type SubscriberBatch, type SubscriberDebounce, type SubscriberDecorator, TENANT_REPUBLISH_MAX_LIMIT, type TenantCredentialsContract, type TenantDurableOptions, TenantEventRepublisher, type TenantFilter, type TenantRef, type TenantTokenOption, type TenantVerifierContract, type TenantVerifierInput, type TenantVerifierOption, ThinStepRegistrar, ThinWorkerBootstrap, ThinWorkflowRegistrar, UNSUPPORTED_RUN_REQUEST, type UserRef, WORKFLOW_METADATA, Workflow, type WorkflowAttributesOf, type WorkflowMeta, type WorkflowOptions, WorkflowService, attributesOf, entityConfigFor, eventBatchOf, getDurableStepMeta, getEntityMeta, getOnEvents, getWorkflowMeta, inAppWorkerProviders, isDeadLetterHandler, isDrivingOperator, isOperatorRole, isStepInterceptor, onErrorCodesOf, thinWorkerProviders, unavailableRunGateway };
1834
+ export { BAD_RUN_REQUEST, CONTEXT_ACCESSOR, type ContextAccessor, type ContextStore, type ContractClass, type ControlPlaneDurableOptions, DEAD_LETTER_METADATA, DURABLE_STEP_METADATA, DURABLE_WORKER_RUNNERS, DURABLE_WORKER_RUNTIME, DeadLetter, type DtoClass, DurableModule, type DurableModuleAsyncOptions, type DurableModuleOptions, type DurableModuleSharedOptions, type DurableRetentionOptions, DurableStartClient, type DurableStepInterceptor, type DurableStepMeta, type DurableTopologyName, ENTITY_METADATA, ENTITY_ON_METADATA, Entity, EntityService, type ErrorClassWithCode, IN_APP_RUN_REDIS_WORKER, IN_APP_WORKER_BINDING, IN_APP_WORKER_RUNNERS, IN_APP_WORKER_RUNTIME, type InAppWorkerBinding, InAppWorkerBootstrap, type IoSchema, type LazyContract, ON_ERROR_METADATA, ON_EVENT_BATCH_METADATA, ON_EVENT_METADATA, On, OnDurableEvent, OnError, type OnErrorMethod, OnWorkflowCompleted, OnWorkflowFailed, type OnWorkflowFailedOptions, type OnWorkflowSettledOptions, ProxyRunGateway, RUN_GATEWAY, RUN_REDIS_WORKER, RunGatewayError, type RunGatewayErrorCode, type RunLookupStore, type RunRedisWorkerFn, RunRequestResponder, type RunRequestResponderOptions, type RunRequestTransport, STEP_INTERCEPTOR_METADATA, type StandaloneDurableOptions, Step, StepInterceptor, type StepOptions, StoreRunGateway, type SubscriberBatch, type SubscriberDebounce, type SubscriberDecorator, TENANT_REPUBLISH_MAX_LIMIT, type TenantCredentialsContract, type TenantDurableOptions, TenantEventRepublisher, type TenantFilter, type TenantLevel, type TenantRef, type TenantTokenOption, type TenantVerifierContract, type TenantVerifierInput, type TenantVerifierOption, ThinStepRegistrar, ThinWorkerBootstrap, ThinWorkflowRegistrar, UNSUPPORTED_RUN_REQUEST, type UserRef, WORKFLOW_METADATA, Workflow, type WorkflowAttributesOf, type WorkflowMeta, type WorkflowOptions, WorkflowService, attributesOf, entityConfigFor, eventBatchOf, getDurableStepMeta, getEntityMeta, getOnEvents, getWorkflowMeta, inAppWorkerProviders, isDeadLetterHandler, isDrivingOperator, isOperatorRole, isStepInterceptor, onErrorCodesOf, thinWorkerProviders, unavailableRunGateway };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { WorkflowCtx, SearchAttributes, WorkflowClass, StandardSchemaV1, StepError, OnEventEntry, OnErrorInput, LifecycleEventOf, WorkflowLifecycleEvent, WorkflowRef, SingletonConfig, ConcurrencyConfig, SearchAttributesSchema, EventBatchConfig, TenantVerifier, VerifiedTenant, TenantTokenSource, StateStore, Transport, NamedTransport, ControlPlane, StalledRunInfo, ScheduledWorkflow, RetentionPolicy, QueueConfig, AdmissionBackend, WorkflowInputOf, StartOptions, RunResult, RunGateway, WorkflowEngine, EntityHandler, RunRequest, RunReply, DurableTopology, RunDetailOptions, RunDetail, FanPageQuery, FanPage, WorkflowRun, RunQuery, RunListItem, RunFacetQuery, RunFacetRow, RunValueAxis, RunValueFacetOptions, RunValueFacetRow, GroupHealth, RunWaiting, RepublishLifecycleTarget, RepublishLifecycleResult, WorkflowLifecycleLinks, EngineEvent, StepInvocation, LifecycleKind, TenantEvent, SignalOptions } from '@dudousxd/nestjs-durable-core';
1
+ import { WorkflowCtx, SearchAttributes, WorkflowClass, StandardSchemaV1, StepError, OnEventEntry, OnErrorInput, LifecycleEventOf, WorkflowLifecycleEvent, WorkflowRef, SingletonConfig, ConcurrencyConfig, SearchAttributesSchema, EventBatchConfig, TenantVerifier, VerifiedTenant, TenantTokenSource, StateStore, Transport, NamedTransport, ControlPlane, StalledRunInfo, ScheduledWorkflow, RetentionPolicy, QueueConfig, AdmissionBackend, WorkflowInputOf, StartOptions, RunResult, RunGateway, WorkflowEngine, EntityHandler, RunRequest, RunReply, TenantFilter as TenantFilter$1, DurableTopology, RunDetailOptions, RunDetail, FanPageQuery, FanPage, WorkflowRun, RunQuery, RunListItem, RunFacetQuery, RunFacetRow, RunValueAxis, RunValueFacetOptions, RunValueFacetRow, GroupHealth, RunWaiting, RepublishLifecycleTarget, RepublishLifecycleResult, WorkflowLifecycleLinks, EngineEvent, StepInvocation, LifecycleKind, TenantEvent, SignalOptions } from '@dudousxd/nestjs-durable-core';
2
2
  export { AttributeFilter, DynamicWorkflowCtx, EngineEvent, EventSubscription, InferSearchAttributes, LIFECYCLE_PENDING_TAG, LifecycleEventOf, LifecycleKind, OnErrorInput, OnEventEntry, RunDetail, RunGateway, RunListItem, RunQuery, RunSchedulesOptions, RunStatus, RunWaiting, ScheduledWorkflow, SearchAttributes, SearchAttributesSchema, StepCheckpoint, StepEvent, StepLogger, TenantTokenSource, TenantVerifier, VerifiedTenant, WorkflowCtx, WorkflowEngine, WorkflowHandler, WorkflowLifecycleEvent, WorkflowRun, hmacTenantVerifier, lifecycleRunId, lifecycleSourceOf, prevCronFireMs, readSearchAttributes, runCompletedEvent, runFailedEvent, runSchedules, scheduleRunIdAt, scheduledRunId, signTenantToken, triggeredRunsOf } from '@dudousxd/nestjs-durable-core';
3
3
  import { z } from 'zod';
4
4
  import { ConcurrencyOption, StartRunDeps, RunRedisWorkerOptions, RunningWorker, DurableWorkerRuntime } from '@dudousxd/durable-worker';
@@ -106,15 +106,30 @@ interface ContextAccessor {
106
106
  * an app's own accessor, may not have it; durable then treats tenancy as off.
107
107
  */
108
108
  tenant?(): TenantRef | undefined;
109
- /** The context's `tenancy` switch: `{ enabled, kinds? }`. Optional, as above. */
109
+ /** The context's `tenancy` switch: `{ enabled, kinds?, required? }`. Optional, as above. */
110
110
  tenancy?(): {
111
111
  enabled: boolean;
112
112
  kinds?: string[];
113
+ required?: boolean;
113
114
  };
114
- /** How a lib must scope data right now. Optional, as above. */
115
+ /**
116
+ * How a lib must scope data right now. `kinds` picks the level of a nested tenant, `family` a
117
+ * secondary tenant, `required` overrides the context's (context ≥ 2.1). Optional, as above.
118
+ */
115
119
  tenantFilter?(options?: {
116
120
  kinds?: string[];
121
+ family?: string;
122
+ required?: boolean;
117
123
  }): TenantFilter;
124
+ /** Display labels keyed by tenant id (context ≥ 2.1). Optional, as above. */
125
+ tenantLabels?(tenants: TenantLevel[]): Promise<Record<string, string>>;
126
+ }
127
+ /** One level of a tenant chain (context ≥ 2.1). */
128
+ interface TenantLevel {
129
+ id: string;
130
+ kind: string;
131
+ slug?: string;
132
+ role?: string;
118
133
  }
119
134
  /** A tenant as the context reports it. Structural mirror of nestjs-context's `TenantRef`. */
120
135
  interface TenantRef {
@@ -123,6 +138,10 @@ interface TenantRef {
123
138
  source: string;
124
139
  slug?: string;
125
140
  role?: string;
141
+ /** The active chain, root first, this tenant last (context ≥ 2.1). */
142
+ chain?: TenantLevel[];
143
+ /** The secondary tenant family this ref belongs to (context ≥ 2.1). */
144
+ family?: string;
126
145
  }
127
146
  /** How a lib must scope data right now. Structural mirror of nestjs-context's `TenantFilter`. */
128
147
  type TenantFilter = {
@@ -134,6 +153,7 @@ type TenantFilter = {
134
153
  } | {
135
154
  mode: 'tenant';
136
155
  tenant: TenantRef;
156
+ chain?: TenantLevel[];
137
157
  };
138
158
 
139
159
  /** A class-validator DTO class — validated with the same `plainToInstance` + `validate` NestJS's
@@ -166,8 +186,8 @@ interface WorkflowMeta {
166
186
  concurrency?: ConcurrencyConfig | undefined;
167
187
  /** Max wall-clock lifetime before a run is cancelled (e.g. `'2h'`). See `WorkflowOptions`. */
168
188
  executionTimeout?: string | number | undefined;
169
- /** Input schema (Standard Schema or DTO class), parsed at start and before every turn. Holds
170
- * `input` or its `inputSchema` alias. See `WorkflowOptions`. */
189
+ /** Input schema (Standard Schema or DTO class), parsed at start and before every turn. See
190
+ * `WorkflowOptions`. */
171
191
  input?: IoSchema | undefined;
172
192
  /** Output schema, parsed before the run completes. See `WorkflowOptions`. */
173
193
  output?: IoSchema | undefined;
@@ -269,11 +289,6 @@ interface WorkflowOptions {
269
289
  * run with `code: 'invalid_output'`. The same option `@Step({ output })` takes.
270
290
  */
271
291
  output?: IoSchema;
272
- /**
273
- * Alias of {@link input}, kept for workflows declared before `input` existed. Setting both is an
274
- * error.
275
- */
276
- inputSchema?: IoSchema;
277
292
  /**
278
293
  * A custom check at `start` (throw to reject) for a rule a schema can't express — a cross-field
279
294
  * invariant, an async lookup. It runs after `input` parses and receives the parsed value (the input
@@ -414,11 +429,6 @@ interface StepOptions {
414
429
  * from the method signature are the only check, and the step dispatches with no retry/timeout.
415
430
  */
416
431
  declare function Step(nameOrOptions?: string | StepOptions): MethodDecorator;
417
- /**
418
- * @deprecated Use `@Step` instead. `@DurableStep` is a back-compat alias of {@link Step} and
419
- * writes the same `DURABLE_STEP_METADATA`, so discovery/registrars treat them identically.
420
- */
421
- declare const DurableStep: typeof Step;
422
432
  declare function getDurableStepMeta(method: Function): DurableStepMeta | undefined;
423
433
  declare const DEAD_LETTER_METADATA: unique symbol;
424
434
  /**
@@ -601,30 +611,40 @@ declare const ON_EVENT_BATCH_METADATA: unique symbol;
601
611
  * workflow never silently coalesces one way while its decorator says another.
602
612
  */
603
613
  declare function eventBatchOf(meta: WorkflowMeta, target: object): EventBatchConfig | undefined;
604
- /** @deprecated Renamed to `OnDurableEvent` — this alias clashes with `@nestjs/event-emitter`'s `@OnEvent` and will be removed in the next minor. */
605
- declare const OnEvent: typeof OnDurableEvent;
606
614
  /**
607
615
  * All events a workflow class subscribes to: `@Workflow({ onEvent })`, `@OnDurableEvent`,
608
616
  * `@OnWorkflowCompleted` and `@OnWorkflowFailed`. Repeated bare names collapse to one.
609
617
  */
610
618
  declare function getOnEvents(meta: WorkflowMeta, target: object): OnEventEntry[];
611
619
 
612
- /**
613
- * Tenancy for durable: the CUSTOMER a run belongs to (`@dudousxd/nestjs-context`'s tenant), not the
614
- * worker-pool `namespace`. A local, structural reader of the context contract — durable never imports
615
- * nestjs-context, so it works with any context version or none at all: with the accessor (or its
616
- * tenancy methods) missing, tenancy reads as off and durable behaves exactly as without it.
617
- */
618
- /** The `tenancy` option of `DurableModule`. Same shape in every Aviary lib. */
619
- type DurableTenancyOption = 'inherit' | false | {
620
- /** `'inherit'` (default) follows `ContextModule`'s `tenancy.enabled`. */
620
+ type TenancyOption = 'inherit' | false | {
621
621
  enabled?: 'inherit' | boolean;
622
- /** Tenant kinds durable honours, instead of the context's own `kinds`. */
623
622
  kinds?: string[];
624
- /** Whether a tenant request also sees runs with no tenant. Default `'tenantless'` (it does not). */
623
+ family?: string;
624
+ required?: boolean;
625
625
  nullRows?: 'tenantless' | 'shared';
626
626
  };
627
627
 
628
+ /**
629
+ * Tenancy for durable: the CUSTOMER a run belongs to (`@dudousxd/nestjs-context`'s tenant), not the
630
+ * worker-pool `namespace`. Read through the local copy of the context's tenancy reader
631
+ * (`./tenancy-reader`): durable never imports nestjs-context, so it works with any context version
632
+ * or none at all. With the accessor (or its tenancy methods) missing, tenancy reads as off and
633
+ * durable behaves exactly as without it.
634
+ */
635
+ /**
636
+ * The `tenancy` option of `DurableModule`. Same shape in every Aviary lib:
637
+ * - `enabled`: `'inherit'` (default) follows `ContextModule`'s `tenancy.enabled`;
638
+ * - `kinds`: the tenant kinds durable stamps and filters by. On a nested tenant (clinic → unit) the
639
+ * most specific level of the active chain whose kind is listed is the one used;
640
+ * - `family`: read a secondary tenant family (e.g. `'account'`) instead of the primary one;
641
+ * - `required`: with no tenant, an app-facing read or start throws the context's
642
+ * `TenantRequiredError` (403) instead of running tenantless. Defaults to the context's own
643
+ * `tenancy.required`. Durable's own work (turns, recovery, schedules, worker steps) never throws;
644
+ * - `nullRows: 'shared'`: a tenant also sees runs with no tenant (default `'tenantless'`: it does not).
645
+ */
646
+ type DurableTenancyOption = TenancyOption;
647
+
628
648
  /** What a tenant verifier receives for each request a tenant process sends. */
629
649
  interface TenantVerifierInput {
630
650
  /** The token presented on the request (the wire `tenant` field). */
@@ -716,7 +736,7 @@ interface DurableRetentionOptions {
716
736
  * timer/retention/registrars, executing registered bodies INLINE. Driven by {@link drive} (default
717
737
  * `true`).
718
738
  * - `{ connection }` (no `store`): **thin worker**, `WorkflowEngine` resolves to a store-less
719
- * `DurableStartClient`; `RUN_GATEWAY` is a `ProxyRunGateway` when `transport` is also given, else
739
+ * `DurableStartClient`; `RunGateway` is a `ProxyRunGateway` when `transport` is also given, else
720
740
  * every method rejects with a clear error. No store/timer/retention/entity, just discovered
721
741
  * `@Workflow`/`@Step` handlers served over ONE `runRedisWorker` consumer.
722
742
  * - `{ store, transport, connection }`: an **operator that also runs a co-located worker**: every
@@ -1163,9 +1183,13 @@ declare class DurableModule {
1163
1183
  declare class DurableStartClient {
1164
1184
  private readonly options;
1165
1185
  private readonly deps?;
1186
+ /** The context accessor, for the customer tenant a start claims (else the global slot). */
1187
+ private readonly accessor?;
1166
1188
  private readonly tenant;
1167
1189
  private readonly tenantToken;
1168
- constructor(options: DurableModuleOptions, deps?: StartRunDeps | undefined);
1190
+ constructor(options: DurableModuleOptions, deps?: StartRunDeps | undefined,
1191
+ /** The context accessor, for the customer tenant a start claims (else the global slot). */
1192
+ accessor?: ContextAccessor | undefined);
1169
1193
  start<C extends WorkflowClass>(workflow: C, input: WorkflowInputOf<C>, runId?: string, opts?: StartOptions): Promise<RunResult>;
1170
1194
  start(workflow: string, input: unknown, runId?: string, opts?: StartOptions): Promise<RunResult>;
1171
1195
  cancel(_runId: string): Promise<void>;
@@ -1262,7 +1286,7 @@ declare class ThinWorkerBootstrap implements OnApplicationBootstrap, OnApplicati
1262
1286
  */
1263
1287
  declare function thinWorkerProviders(): Provider[];
1264
1288
  /**
1265
- * The no-transport fallback bound to `RUN_GATEWAY` for a thin worker (`connection` set, `store`
1289
+ * The no-transport fallback bound to `RunGateway` for a thin worker (`connection` set, `store`
1266
1290
  * unset) that didn't also pass a `transport` — mirrors `DurableStartClient`'s tenant-error idiom
1267
1291
  * (`tenantUnsupported`): every method rejects with a clear, named error instead of a cryptic
1268
1292
  * `this.gateway.X is not a function`. `subscribe` is synchronous on the `RunGateway` port, so it
@@ -1446,7 +1470,7 @@ declare class RunGatewayError extends Error {
1446
1470
  /**
1447
1471
  * Tenant-side `RunGateway` — round-trips every verb as a `RunRequest`/`RunReply` pair over the
1448
1472
  * transport, correlated by a minted `requestId`, and bridges `subscribe` onto the transport's
1449
- * per-tenant event stream. Bound under `RUN_GATEWAY` by `DurableModule`'s thin-worker role
1473
+ * per-tenant event stream. Bound under `RunGateway` by `DurableModule`'s thin-worker role
1450
1474
  * (`connection` set, no `store`) when the app supplies a `transport` (see `unavailableRunGateway`
1451
1475
  * for the no-transport fallback). The counterpart to the operator-side `StoreRunGateway`: a tenant
1452
1476
  * worker never touches a store/driver directly, only this proxy.
@@ -1464,6 +1488,13 @@ declare class ProxyRunGateway implements RunGateway {
1464
1488
  * stays keyed by `tenant`, never the token: the operator republishes by the run's namespace.
1465
1489
  */
1466
1490
  private readonly tenantToken?;
1491
+ /**
1492
+ * The customer-tenancy filter of the request being served (durable's `tenancy` on this process).
1493
+ * The control plane answers for this process's namespace; this narrows it to the request's
1494
+ * customer tenant: lists and counts get the tenant predicate, and a run of another tenant reads
1495
+ * (and is controlled) as missing. Absent: no narrowing.
1496
+ */
1497
+ private readonly tenantFilter?;
1467
1498
  private readonly pending;
1468
1499
  /** Verb → when to ask the control plane for it again, after it answered that it does not know it.
1469
1500
  * During a rolling upgrade the control plane is several pods of mixed versions behind one queue,
@@ -1478,7 +1509,28 @@ declare class ProxyRunGateway implements RunGateway {
1478
1509
  * Omit to send the raw `tenant` (prefix/network isolation only). The live-tail channel always
1479
1510
  * stays keyed by `tenant`, never the token: the operator republishes by the run's namespace.
1480
1511
  */
1481
- tenantToken?: TenantTokenSource | undefined);
1512
+ tenantToken?: TenantTokenSource | undefined,
1513
+ /**
1514
+ * The customer-tenancy filter of the request being served (durable's `tenancy` on this process).
1515
+ * The control plane answers for this process's namespace; this narrows it to the request's
1516
+ * customer tenant: lists and counts get the tenant predicate, and a run of another tenant reads
1517
+ * (and is controlled) as missing. Absent: no narrowing.
1518
+ */
1519
+ tenantFilter?: (() => TenantFilter$1) | undefined);
1520
+ /** The request's tenant filter when it can hide runs (`tenant` / `tenantless`), else undefined. */
1521
+ private restrictive;
1522
+ /**
1523
+ * Send `query`, narrowed to the runs the request may see. A tenant-required request with no
1524
+ * tenant rejects (never throws synchronously).
1525
+ */
1526
+ private scoped;
1527
+ /** `run` when the request may see it, else null (an invisible run reads like a missing one). */
1528
+ private visible;
1529
+ /** Run a control call unless the request may not act on `runId` (then `null`, like a missing run).
1530
+ * Sent at once when nothing narrows the request. */
1531
+ private guarded;
1532
+ /** Before a control call: true when the request may NOT act on `runId`. */
1533
+ private hidden;
1482
1534
  private handleReply;
1483
1535
  private request;
1484
1536
  private send;
@@ -1495,6 +1547,7 @@ declare class ProxyRunGateway implements RunGateway {
1495
1547
  * to know the verb: it then answers with no data, or with an unsupported-request error.
1496
1548
  */
1497
1549
  getRun(runId: string): Promise<WorkflowRun | null>;
1550
+ private getRunUnscoped;
1498
1551
  private knownUnsupported;
1499
1552
  /** The control plane's `StoreRunGateway` resolves each run's `waiting` descriptor; the reply carries
1500
1553
  * it through as plain JSON, so a tenant's list rows name the wait too. */
@@ -1571,7 +1624,7 @@ declare function StepInterceptor(): ClassDecorator;
1571
1624
  declare function isStepInterceptor(target: Function): boolean;
1572
1625
 
1573
1626
  /**
1574
- * Store-backed `RunGateway` — the operator-side implementation, bound to {@link RUN_GATEWAY} on
1627
+ * Store-backed `RunGateway` — the operator-side implementation, bound to {@link RunGateway} on
1575
1628
  * worker/drive instances. Reuses `DashboardService`'s six read/control method bodies verbatim
1576
1629
  * (`dashboard.service.ts:76-172`), so a consumer that only needs the bounded `RunGateway` surface
1577
1630
  * (the `RunRequestResponder`, a thin controller) doesn't have to depend on the dashboard package.
@@ -1693,14 +1746,10 @@ declare class TenantEventRepublisher {
1693
1746
  */
1694
1747
  declare const CONTEXT_ACCESSOR: unique symbol;
1695
1748
  /**
1696
- * @deprecated Inject the `RunGateway` abstract class directly (it is its own DI token now):
1697
- * `constructor(private readonly gateway: RunGateway)`, provider `{ provide: RunGateway, useClass }`.
1698
- * This symbol is kept as a back-compat alias — it points at the `RunGateway` class, so existing
1699
- * `@Inject(RUN_GATEWAY)` sites resolve the very same token — and will be removed in a future major.
1700
- *
1701
- * `RunGateway` is owned by `@dudousxd/nestjs-durable-core` (a required peer dep of both this package
1702
- * and the dashboard), so the abstract class is a single shared token across packages without the
1703
- * previous `Symbol.for` value-sharing hack.
1749
+ * @deprecated Inject the `RunGateway` class, which is its own DI token:
1750
+ * `constructor(private readonly gateway: RunGateway)`. Kept because published
1751
+ * `@dudousxd/nestjs-agent` and `@dudousxd/nestjs-agent-opencode` releases import it; it is the
1752
+ * `RunGateway` class itself, so `@Inject(RUN_GATEWAY)` resolves the same provider.
1704
1753
  */
1705
1754
  declare const RUN_GATEWAY: typeof RunGateway;
1706
1755
 
@@ -1782,4 +1831,4 @@ declare class WorkflowService {
1782
1831
  republishLifecycle(target: RepublishLifecycleTarget): Promise<RepublishLifecycleResult>;
1783
1832
  }
1784
1833
 
1785
- export { BAD_RUN_REQUEST, CONTEXT_ACCESSOR, type ContextAccessor, type ContextStore, type ContractClass, type ControlPlaneDurableOptions, DEAD_LETTER_METADATA, DURABLE_STEP_METADATA, DURABLE_WORKER_RUNNERS, DURABLE_WORKER_RUNTIME, DeadLetter, type DtoClass, DurableModule, type DurableModuleAsyncOptions, type DurableModuleOptions, type DurableModuleSharedOptions, type DurableRetentionOptions, DurableStartClient, DurableStep, type DurableStepInterceptor, type DurableStepMeta, type DurableTopologyName, ENTITY_METADATA, ENTITY_ON_METADATA, Entity, EntityService, type ErrorClassWithCode, IN_APP_RUN_REDIS_WORKER, IN_APP_WORKER_BINDING, IN_APP_WORKER_RUNNERS, IN_APP_WORKER_RUNTIME, type InAppWorkerBinding, InAppWorkerBootstrap, type IoSchema, type LazyContract, ON_ERROR_METADATA, ON_EVENT_BATCH_METADATA, ON_EVENT_METADATA, On, OnDurableEvent, OnError, type OnErrorMethod, OnEvent, OnWorkflowCompleted, OnWorkflowFailed, type OnWorkflowFailedOptions, type OnWorkflowSettledOptions, ProxyRunGateway, RUN_GATEWAY, RUN_REDIS_WORKER, RunGatewayError, type RunGatewayErrorCode, type RunLookupStore, type RunRedisWorkerFn, RunRequestResponder, type RunRequestResponderOptions, type RunRequestTransport, STEP_INTERCEPTOR_METADATA, type StandaloneDurableOptions, Step, StepInterceptor, type StepOptions, StoreRunGateway, type SubscriberBatch, type SubscriberDebounce, type SubscriberDecorator, TENANT_REPUBLISH_MAX_LIMIT, type TenantCredentialsContract, type TenantDurableOptions, TenantEventRepublisher, type TenantFilter, type TenantRef, type TenantTokenOption, type TenantVerifierContract, type TenantVerifierInput, type TenantVerifierOption, ThinStepRegistrar, ThinWorkerBootstrap, ThinWorkflowRegistrar, UNSUPPORTED_RUN_REQUEST, type UserRef, WORKFLOW_METADATA, Workflow, type WorkflowAttributesOf, type WorkflowMeta, type WorkflowOptions, WorkflowService, attributesOf, entityConfigFor, eventBatchOf, getDurableStepMeta, getEntityMeta, getOnEvents, getWorkflowMeta, inAppWorkerProviders, isDeadLetterHandler, isDrivingOperator, isOperatorRole, isStepInterceptor, onErrorCodesOf, thinWorkerProviders, unavailableRunGateway };
1834
+ export { BAD_RUN_REQUEST, CONTEXT_ACCESSOR, type ContextAccessor, type ContextStore, type ContractClass, type ControlPlaneDurableOptions, DEAD_LETTER_METADATA, DURABLE_STEP_METADATA, DURABLE_WORKER_RUNNERS, DURABLE_WORKER_RUNTIME, DeadLetter, type DtoClass, DurableModule, type DurableModuleAsyncOptions, type DurableModuleOptions, type DurableModuleSharedOptions, type DurableRetentionOptions, DurableStartClient, type DurableStepInterceptor, type DurableStepMeta, type DurableTopologyName, ENTITY_METADATA, ENTITY_ON_METADATA, Entity, EntityService, type ErrorClassWithCode, IN_APP_RUN_REDIS_WORKER, IN_APP_WORKER_BINDING, IN_APP_WORKER_RUNNERS, IN_APP_WORKER_RUNTIME, type InAppWorkerBinding, InAppWorkerBootstrap, type IoSchema, type LazyContract, ON_ERROR_METADATA, ON_EVENT_BATCH_METADATA, ON_EVENT_METADATA, On, OnDurableEvent, OnError, type OnErrorMethod, OnWorkflowCompleted, OnWorkflowFailed, type OnWorkflowFailedOptions, type OnWorkflowSettledOptions, ProxyRunGateway, RUN_GATEWAY, RUN_REDIS_WORKER, RunGatewayError, type RunGatewayErrorCode, type RunLookupStore, type RunRedisWorkerFn, RunRequestResponder, type RunRequestResponderOptions, type RunRequestTransport, STEP_INTERCEPTOR_METADATA, type StandaloneDurableOptions, Step, StepInterceptor, type StepOptions, StoreRunGateway, type SubscriberBatch, type SubscriberDebounce, type SubscriberDecorator, TENANT_REPUBLISH_MAX_LIMIT, type TenantCredentialsContract, type TenantDurableOptions, TenantEventRepublisher, type TenantFilter, type TenantLevel, type TenantRef, type TenantTokenOption, type TenantVerifierContract, type TenantVerifierInput, type TenantVerifierOption, ThinStepRegistrar, ThinWorkerBootstrap, ThinWorkflowRegistrar, UNSUPPORTED_RUN_REQUEST, type UserRef, WORKFLOW_METADATA, Workflow, type WorkflowAttributesOf, type WorkflowMeta, type WorkflowOptions, WorkflowService, attributesOf, entityConfigFor, eventBatchOf, getDurableStepMeta, getEntityMeta, getOnEvents, getWorkflowMeta, inAppWorkerProviders, isDeadLetterHandler, isDrivingOperator, isOperatorRole, isStepInterceptor, onErrorCodesOf, thinWorkerProviders, unavailableRunGateway };