@dudousxd/nestjs-durable 0.28.0 → 0.29.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 +25 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -495,6 +495,9 @@ function unavailableRunGateway() {
|
|
|
495
495
|
listRuns(_query) {
|
|
496
496
|
return tenantGatewayUnavailable("listRuns");
|
|
497
497
|
},
|
|
498
|
+
workerHealth() {
|
|
499
|
+
return tenantGatewayUnavailable("workerHealth");
|
|
500
|
+
},
|
|
498
501
|
cancel(_runId) {
|
|
499
502
|
return tenantGatewayUnavailable("cancel");
|
|
500
503
|
},
|
|
@@ -892,6 +895,12 @@ var ProxyRunGateway = class {
|
|
|
892
895
|
query
|
|
893
896
|
});
|
|
894
897
|
}
|
|
898
|
+
/** Round-trips to the operator, which scopes the result to this tenant's own `@<tenant>` groups. */
|
|
899
|
+
workerHealth() {
|
|
900
|
+
return this.request({
|
|
901
|
+
kind: "workerHealth"
|
|
902
|
+
});
|
|
903
|
+
}
|
|
895
904
|
cancel(runId, opts) {
|
|
896
905
|
return this.request(opts === void 0 ? {
|
|
897
906
|
kind: "cancel",
|
|
@@ -1088,6 +1097,17 @@ var RunRequestResponder = class {
|
|
|
1088
1097
|
}
|
|
1089
1098
|
};
|
|
1090
1099
|
}
|
|
1100
|
+
if (body.kind === "workerHealth") {
|
|
1101
|
+
const all = await this.gateway.workerHealth();
|
|
1102
|
+
const data = all.filter((h) => h.group.endsWith(`@${msg.tenant}`));
|
|
1103
|
+
return {
|
|
1104
|
+
requestId: msg.requestId,
|
|
1105
|
+
result: {
|
|
1106
|
+
ok: true,
|
|
1107
|
+
data
|
|
1108
|
+
}
|
|
1109
|
+
};
|
|
1110
|
+
}
|
|
1091
1111
|
const detail = await this.gateway.getRunDetail(body.runId);
|
|
1092
1112
|
if (detail && detail.run.namespace !== msg.tenant) {
|
|
1093
1113
|
return {
|
|
@@ -1191,6 +1211,11 @@ var StoreRunGateway = class {
|
|
|
1191
1211
|
listRuns(query) {
|
|
1192
1212
|
return this.store.listRuns(query);
|
|
1193
1213
|
}
|
|
1214
|
+
/** Every group the engine knows about — unscoped. A tenant proxy's request is scoped by the
|
|
1215
|
+
* `RunRequestResponder` (to the requester's `@<tenant>` groups); the operator's own UI sees all. */
|
|
1216
|
+
workerHealth() {
|
|
1217
|
+
return this.engine.workerHealth();
|
|
1218
|
+
}
|
|
1194
1219
|
cancel(runId, opts) {
|
|
1195
1220
|
return this.engine.cancel(runId, opts);
|
|
1196
1221
|
}
|