@camstack/server 1.2.684 → 1.2.685
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.
|
@@ -341,6 +341,9 @@ class MoleculerService {
|
|
|
341
341
|
// owning runner, whose `getStatus` is the native slice. The SAME
|
|
342
342
|
// question the registry's resolvers ask, through the same method.
|
|
343
343
|
claimedStatus: (capName, deviceId) => this.resolveClaimedStatus(capName, deviceId),
|
|
344
|
+
// A covered device call the device's remote takes over (D963) — the
|
|
345
|
+
// same question the registry's wrappers and the other entries ask.
|
|
346
|
+
deviceCallRedirect: this.deviceCallRedirectHook(),
|
|
344
347
|
// `nodeIdMode: 'data'` signal: for these caps (`addon-settings`,
|
|
345
348
|
// `addons`, `nodes`, `pipeline-orchestrator`) an inline `args.nodeId`
|
|
346
349
|
// is provider DATA — the hub singleton dispatches internally — never a
|
|
@@ -446,6 +449,8 @@ class MoleculerService {
|
|
|
446
449
|
// sibling short-circuit can dispatch it to the owning child (D663, S3)
|
|
447
450
|
// — the same resolver the handler above and `callCapabilityOnNode` use.
|
|
448
451
|
claimedStatus: (capName, deviceId) => this.resolveClaimedStatus(capName, deviceId),
|
|
452
|
+
// The same device-call redirect, before the sibling short-circuit (D963).
|
|
453
|
+
deviceCallRedirect: this.deviceCallRedirectHook(),
|
|
449
454
|
// A collection ARRAY method must reach `onUnownedCall` (which fans it
|
|
450
455
|
// across every provider) instead of being short-circuited to ONE local
|
|
451
456
|
// sibling. Same predicate the aggregate itself uses, so the two agree
|
|
@@ -807,6 +812,21 @@ class MoleculerService {
|
|
|
807
812
|
? registry.resolveClaimedStatus(capName, deviceId)
|
|
808
813
|
: Promise.resolve(system_1.UNCLAIMED);
|
|
809
814
|
}
|
|
815
|
+
/**
|
|
816
|
+
* The device-call redirect (D963): `CapabilityRegistry.coversDeviceCall` /
|
|
817
|
+
* `redirectDeviceCall`, resolved at CALL time so a redirect installed after
|
|
818
|
+
* this entry was wired (core-blocks boots later) is honoured. Every entry
|
|
819
|
+
* that routes a device-scoped call by name asks it through
|
|
820
|
+
* `answerDeviceCallRedirect`.
|
|
821
|
+
*/
|
|
822
|
+
deviceCallRedirectHook() {
|
|
823
|
+
return {
|
|
824
|
+
covers: (capName, method) => this.capabilityService.getRegistry()?.coversDeviceCall(capName, method) === true,
|
|
825
|
+
attempt: async (call) => (await this.capabilityService.getRegistry()?.redirectDeviceCall(call)) ?? {
|
|
826
|
+
kind: 'not-redirected',
|
|
827
|
+
},
|
|
828
|
+
};
|
|
829
|
+
}
|
|
810
830
|
/**
|
|
811
831
|
* Call a capability method on a specific node.
|
|
812
832
|
*
|
|
@@ -833,6 +853,15 @@ class MoleculerService {
|
|
|
833
853
|
const claimed = await (0, system_1.answerClaimedGetStatus)((capName, deviceId) => this.resolveClaimedStatus(capName, deviceId), { capName: capabilityName, method: methodName, args: params });
|
|
834
854
|
if (claimed !== null)
|
|
835
855
|
return claimed.slice;
|
|
856
|
+
// A covered device call the device's remote takes over (D963): the hub's
|
|
857
|
+
// own tRPC and every in-process `ctx.api` call arrive here with a pin.
|
|
858
|
+
const redirected = await (0, system_1.answerDeviceCallRedirect)(this.deviceCallRedirectHook(), {
|
|
859
|
+
capName: capabilityName,
|
|
860
|
+
method: methodName,
|
|
861
|
+
args: params,
|
|
862
|
+
});
|
|
863
|
+
if (redirected !== null)
|
|
864
|
+
return redirected.result;
|
|
836
865
|
const resolver = this.resolver;
|
|
837
866
|
if (resolver !== null) {
|
|
838
867
|
// Extract deviceId from params so device-scoped native caps (ptz, motion-zones, …)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/server",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.685",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
]
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@camstack/addon-admin-ui": "1.2.
|
|
53
|
-
"@camstack/addon-agent-ui": "1.2.
|
|
52
|
+
"@camstack/addon-admin-ui": "1.2.513",
|
|
53
|
+
"@camstack/addon-agent-ui": "1.2.290",
|
|
54
54
|
"@camstack/addon-auth": "1.2.170",
|
|
55
|
-
"@camstack/addon-benchmark": "1.2.
|
|
55
|
+
"@camstack/addon-benchmark": "1.2.289",
|
|
56
56
|
"@camstack/addon-decoder-nodeav": "1.2.144",
|
|
57
57
|
"@camstack/addon-notifiers": "1.2.623",
|
|
58
58
|
"@camstack/addon-pipeline": "1.2.633",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"@camstack/addon-post-analysis": "1.2.650",
|
|
61
61
|
"@camstack/develop": "0.1.39",
|
|
62
62
|
"@camstack/sdk": "1.2.154",
|
|
63
|
-
"@camstack/system": "1.2.
|
|
64
|
-
"@camstack/types": "1.2.
|
|
65
|
-
"@camstack/ui-library": "1.2.
|
|
63
|
+
"@camstack/system": "1.2.515",
|
|
64
|
+
"@camstack/types": "1.2.441",
|
|
65
|
+
"@camstack/ui-library": "1.2.348",
|
|
66
66
|
"@fastify/compress": "^9.0.0",
|
|
67
67
|
"@fastify/cookie": "^11.0.2",
|
|
68
68
|
"@fastify/cors": "^11.2.0",
|