@dudousxd/nestjs-durable 0.38.0 → 0.39.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.js CHANGED
@@ -543,7 +543,7 @@ var DurableStepRegistrar = class {
543
543
  if (!isDrivingOperator(this.options)) return;
544
544
  if (!supportsHandle(this.transport)) return;
545
545
  const transport = this.transport;
546
- scanSteps(this.discovery, this.metadataScanner, (meta, handler) => transport.handle(meta.name, handler));
546
+ scanSteps(this.discovery, this.metadataScanner, (meta, handler) => transport.handle(meta.name, handler, this.options.partition));
547
547
  }
548
548
  };
549
549
  DurableStepRegistrar = _ts_decorate3([
@@ -1828,13 +1828,32 @@ tenant maps 1:1 onto partition (the worker queue-routing suffix) \u2014 set only
1828
1828
  }
1829
1829
  __name(assertValidTopology, "assertValidTopology");
1830
1830
  function resolveTopology(options) {
1831
+ return servingPartition(resolveTopologyPreset(options));
1832
+ }
1833
+ __name(resolveTopology, "resolveTopology");
1834
+ function servingPartition(options) {
1835
+ if (options.partition !== void 0 || options.namespace === void 0) return options;
1836
+ return {
1837
+ ...options,
1838
+ partition: options.namespace
1839
+ };
1840
+ }
1841
+ __name(servingPartition, "servingPartition");
1842
+ function resolveTopologyPreset(options) {
1831
1843
  const topology = options.topology;
1832
1844
  if (topology === void 0) return options;
1833
1845
  if (topology.role === "control-plane") {
1834
- if (topology.tenant === void 0 || options.namespace !== void 0) return options;
1846
+ if (topology.tenant === void 0) return options;
1835
1847
  return {
1836
1848
  ...options,
1837
- namespace: topology.tenant
1849
+ // An explicit `namespace` is already validated equal to `tenant` (assertValidTopology), so
1850
+ // keeping it is a no-op rather than a conflict.
1851
+ namespace: options.namespace ?? topology.tenant,
1852
+ // The tenant is ALSO this node's worker-routing suffix: its engine now dispatches a run's steps
1853
+ // to `<name>@<tenant>` (core's `stepGroup`), so its own co-located worker must SUBSCRIBE those
1854
+ // same tokens. Without this the node would dispatch into queues it is not itself listening on.
1855
+ // `partition` is user-forbidden on this role (assertValidTopology), so we own it here.
1856
+ partition: topology.tenant
1838
1857
  };
1839
1858
  }
1840
1859
  if (options.partition !== void 0) return options;
@@ -1843,7 +1862,7 @@ function resolveTopology(options) {
1843
1862
  partition: topology.tenant
1844
1863
  };
1845
1864
  }
1846
- __name(resolveTopology, "resolveTopology");
1865
+ __name(resolveTopologyPreset, "resolveTopologyPreset");
1847
1866
  var RunGatewayBootstrap = class RunGatewayBootstrap2 {
1848
1867
  static {
1849
1868
  __name(this, "RunGatewayBootstrap");
@@ -2081,7 +2100,7 @@ DurableModule = _ts_decorate12([
2081
2100
  ], DurableModule);
2082
2101
 
2083
2102
  // src/index.ts
2084
- import { readSearchAttributes as readSearchAttributes2, WorkflowEngine as WorkflowEngine7 } from "@dudousxd/nestjs-durable-core";
2103
+ import { readSearchAttributes as readSearchAttributes2, RunGateway as RunGateway3, WorkflowEngine as WorkflowEngine7 } from "@dudousxd/nestjs-durable-core";
2085
2104
  export {
2086
2105
  CONTEXT_ACCESSOR,
2087
2106
  DEAD_LETTER_METADATA,
@@ -2107,6 +2126,7 @@ export {
2107
2126
  ProxyRunGateway,
2108
2127
  RUN_GATEWAY,
2109
2128
  RUN_REDIS_WORKER,
2129
+ RunGateway3 as RunGateway,
2110
2130
  RunRequestResponder,
2111
2131
  STEP_INTERCEPTOR_METADATA,
2112
2132
  Step,