@dudousxd/nestjs-durable 0.31.0 → 0.33.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
@@ -68,6 +68,7 @@ __export(index_exports, {
68
68
  isDrivingOperator: () => isDrivingOperator,
69
69
  isOperatorRole: () => isOperatorRole,
70
70
  isStepInterceptor: () => isStepInterceptor,
71
+ readSearchAttributes: () => import_nestjs_durable_core13.readSearchAttributes,
71
72
  thinWorkerProviders: () => thinWorkerProviders,
72
73
  unavailableRunGateway: () => unavailableRunGateway
73
74
  });
@@ -1847,8 +1848,9 @@ function assertValidTopology(options) {
1847
1848
  if (options.partition !== void 0) {
1848
1849
  throw new Error("topology: { role: 'control-plane' } forbids `partition`.\npartition is the WORKER queue-routing suffix \u2014 on a control-plane node, runs are dispatched to tenant partitions via each run's namespace, not via this option. Set `partition` (or `topology: { role: 'tenant', tenant }`) on the WORKER node instead.");
1849
1850
  }
1850
- if ("tenant" in topology) {
1851
- throw new Error("topology: { role: 'control-plane' } forbids a `tenant` field.\ntenant names a WORKER's isolation partition \u2014 a control-plane node serves every tenant's runs (via their namespace), it isn't scoped to one itself.");
1851
+ if (topology.tenant !== void 0 && options.namespace !== void 0 && options.namespace !== topology.tenant) {
1852
+ throw new Error(`topology: { role: 'control-plane', tenant: '${topology.tenant}' } conflicts with \`namespace: '${options.namespace}'\`.
1853
+ tenant maps 1:1 onto namespace (the operator's poll-scoping axis) \u2014 set only \`tenant\`, or set \`namespace\` to the same value.`);
1852
1854
  }
1853
1855
  return;
1854
1856
  }
@@ -1870,7 +1872,14 @@ tenant maps 1:1 onto partition (the worker queue-routing suffix) \u2014 set only
1870
1872
  __name(assertValidTopology, "assertValidTopology");
1871
1873
  function resolveTopology(options) {
1872
1874
  const topology = options.topology;
1873
- if (topology === void 0 || topology.role !== "tenant") return options;
1875
+ if (topology === void 0) return options;
1876
+ if (topology.role === "control-plane") {
1877
+ if (topology.tenant === void 0 || options.namespace !== void 0) return options;
1878
+ return {
1879
+ ...options,
1880
+ namespace: topology.tenant
1881
+ };
1882
+ }
1874
1883
  if (options.partition !== void 0) return options;
1875
1884
  return {
1876
1885
  ...options,
@@ -2162,6 +2171,7 @@ var import_nestjs_durable_core13 = require("@dudousxd/nestjs-durable-core");
2162
2171
  isDrivingOperator,
2163
2172
  isOperatorRole,
2164
2173
  isStepInterceptor,
2174
+ readSearchAttributes,
2165
2175
  thinWorkerProviders,
2166
2176
  unavailableRunGateway
2167
2177
  });