@dudousxd/nestjs-durable 0.31.0 → 0.32.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 +11 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1847,8 +1847,9 @@ function assertValidTopology(options) {
|
|
|
1847
1847
|
if (options.partition !== void 0) {
|
|
1848
1848
|
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
1849
|
}
|
|
1850
|
-
if (
|
|
1851
|
-
throw new Error(
|
|
1850
|
+
if (topology.tenant !== void 0 && options.namespace !== void 0 && options.namespace !== topology.tenant) {
|
|
1851
|
+
throw new Error(`topology: { role: 'control-plane', tenant: '${topology.tenant}' } conflicts with \`namespace: '${options.namespace}'\`.
|
|
1852
|
+
tenant maps 1:1 onto namespace (the operator's poll-scoping axis) \u2014 set only \`tenant\`, or set \`namespace\` to the same value.`);
|
|
1852
1853
|
}
|
|
1853
1854
|
return;
|
|
1854
1855
|
}
|
|
@@ -1870,7 +1871,14 @@ tenant maps 1:1 onto partition (the worker queue-routing suffix) \u2014 set only
|
|
|
1870
1871
|
__name(assertValidTopology, "assertValidTopology");
|
|
1871
1872
|
function resolveTopology(options) {
|
|
1872
1873
|
const topology = options.topology;
|
|
1873
|
-
if (topology === void 0
|
|
1874
|
+
if (topology === void 0) return options;
|
|
1875
|
+
if (topology.role === "control-plane") {
|
|
1876
|
+
if (topology.tenant === void 0 || options.namespace !== void 0) return options;
|
|
1877
|
+
return {
|
|
1878
|
+
...options,
|
|
1879
|
+
namespace: topology.tenant
|
|
1880
|
+
};
|
|
1881
|
+
}
|
|
1874
1882
|
if (options.partition !== void 0) return options;
|
|
1875
1883
|
return {
|
|
1876
1884
|
...options,
|