@matter/node 0.13.0 → 0.13.1-alpha.0-20250501-80c86b03e
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/cjs/behavior/context/server/OnlineContext.d.ts.map +1 -1
- package/dist/cjs/behavior/context/server/OnlineContext.js +6 -3
- package/dist/cjs/behavior/context/server/OnlineContext.js.map +1 -1
- package/dist/cjs/behavior/system/controller/ControllerBehavior.js +2 -1
- package/dist/cjs/behavior/system/controller/ControllerBehavior.js.map +1 -1
- package/dist/cjs/behavior/system/network/ServerNetworkRuntime.d.ts.map +1 -1
- package/dist/cjs/behavior/system/network/ServerNetworkRuntime.js +7 -7
- package/dist/cjs/behavior/system/network/ServerNetworkRuntime.js.map +1 -1
- package/dist/cjs/behavior/system/subscription/SubscriptionBehavior.d.ts +2 -3
- package/dist/cjs/behavior/system/subscription/SubscriptionBehavior.d.ts.map +1 -1
- package/dist/cjs/behavior/system/subscription/SubscriptionBehavior.js.map +1 -1
- package/dist/cjs/node/server/InteractionServer.d.ts +84 -0
- package/dist/cjs/node/server/InteractionServer.d.ts.map +1 -0
- package/dist/cjs/node/server/InteractionServer.js +1326 -0
- package/dist/cjs/node/server/InteractionServer.js.map +6 -0
- package/dist/cjs/node/server/ProtocolService.d.ts.map +1 -1
- package/dist/cjs/node/server/ProtocolService.js +9 -8
- package/dist/cjs/node/server/ProtocolService.js.map +2 -2
- package/dist/cjs/node/server/index.d.ts +1 -1
- package/dist/cjs/node/server/index.d.ts.map +1 -1
- package/dist/cjs/node/server/index.js +1 -1
- package/dist/cjs/node/server/index.js.map +1 -1
- package/dist/esm/behavior/context/server/OnlineContext.d.ts.map +1 -1
- package/dist/esm/behavior/context/server/OnlineContext.js +6 -3
- package/dist/esm/behavior/context/server/OnlineContext.js.map +1 -1
- package/dist/esm/behavior/system/controller/ControllerBehavior.js +1 -1
- package/dist/esm/behavior/system/controller/ControllerBehavior.js.map +1 -1
- package/dist/esm/behavior/system/network/ServerNetworkRuntime.d.ts.map +1 -1
- package/dist/esm/behavior/system/network/ServerNetworkRuntime.js +2 -3
- package/dist/esm/behavior/system/network/ServerNetworkRuntime.js.map +1 -1
- package/dist/esm/behavior/system/subscription/SubscriptionBehavior.d.ts +2 -3
- package/dist/esm/behavior/system/subscription/SubscriptionBehavior.d.ts.map +1 -1
- package/dist/esm/behavior/system/subscription/SubscriptionBehavior.js.map +1 -1
- package/dist/esm/node/server/InteractionServer.d.ts +84 -0
- package/dist/esm/node/server/InteractionServer.d.ts.map +1 -0
- package/dist/esm/node/server/InteractionServer.js +1348 -0
- package/dist/esm/node/server/InteractionServer.js.map +6 -0
- package/dist/esm/node/server/ProtocolService.d.ts.map +1 -1
- package/dist/esm/node/server/ProtocolService.js +9 -8
- package/dist/esm/node/server/ProtocolService.js.map +1 -1
- package/dist/esm/node/server/index.d.ts +1 -1
- package/dist/esm/node/server/index.d.ts.map +1 -1
- package/dist/esm/node/server/index.js +1 -1
- package/package.json +7 -7
- package/src/behavior/context/server/OnlineContext.ts +9 -4
- package/src/behavior/system/controller/ControllerBehavior.ts +1 -1
- package/src/behavior/system/network/ServerNetworkRuntime.ts +4 -7
- package/src/behavior/system/subscription/SubscriptionBehavior.ts +2 -3
- package/src/node/server/InteractionServer.ts +1757 -0
- package/src/node/server/ProtocolService.ts +10 -8
- package/src/node/server/index.ts +1 -1
- package/dist/cjs/node/server/TransactionalInteractionServer.d.ts +0 -57
- package/dist/cjs/node/server/TransactionalInteractionServer.d.ts.map +0 -1
- package/dist/cjs/node/server/TransactionalInteractionServer.js +0 -334
- package/dist/cjs/node/server/TransactionalInteractionServer.js.map +0 -6
- package/dist/esm/node/server/TransactionalInteractionServer.d.ts +0 -57
- package/dist/esm/node/server/TransactionalInteractionServer.d.ts.map +0 -1
- package/dist/esm/node/server/TransactionalInteractionServer.js +0 -322
- package/dist/esm/node/server/TransactionalInteractionServer.js.map +0 -6
- package/src/node/server/TransactionalInteractionServer.ts +0 -413
|
@@ -23,6 +23,8 @@ import type {
|
|
|
23
23
|
} from "#protocol";
|
|
24
24
|
import { AccessControl, FabricManager } from "#protocol";
|
|
25
25
|
import type { AttributeId, ClusterId, DeviceTypeId, EndpointNumber, FabricIndex, TlvSchema } from "#types";
|
|
26
|
+
import { WildcardPathFlags as WildcardPathFlagsType } from "#types";
|
|
27
|
+
|
|
26
28
|
import { DescriptorBehavior } from "../../behaviors/descriptor/DescriptorBehavior.js";
|
|
27
29
|
|
|
28
30
|
/**
|
|
@@ -61,14 +63,14 @@ export class ProtocolService {
|
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
const WildcardPathFlags = {
|
|
64
|
-
skipRootNode: 1,
|
|
65
|
-
skipGlobalAttributes: 1 <<
|
|
66
|
-
skipAttributeList: 1 <<
|
|
67
|
-
skipCommandLists: 1 <<
|
|
68
|
-
skipCustomElements: 1 <<
|
|
69
|
-
skipFixedAttributes: 1 <<
|
|
70
|
-
skipChangesOmittedAttributes: 1 <<
|
|
71
|
-
skipDiagnosticsClusters: 1 <<
|
|
66
|
+
skipRootNode: 1 << WildcardPathFlagsType.wildcardSkipRootNode.offset,
|
|
67
|
+
skipGlobalAttributes: 1 << WildcardPathFlagsType.wildcardSkipGlobalAttributes.offset,
|
|
68
|
+
skipAttributeList: 1 << WildcardPathFlagsType.wildcardSkipAttributeList.offset,
|
|
69
|
+
skipCommandLists: 1 << WildcardPathFlagsType.wildcardSkipCommandLists.offset,
|
|
70
|
+
skipCustomElements: 1 << WildcardPathFlagsType.wildcardSkipCustomElements.offset,
|
|
71
|
+
skipFixedAttributes: 1 << WildcardPathFlagsType.wildcardSkipFixedAttributes.offset,
|
|
72
|
+
skipChangesOmittedAttributes: 1 << WildcardPathFlagsType.wildcardSkipChangesOmittedAttributes.offset,
|
|
73
|
+
skipDiagnosticsClusters: 1 << WildcardPathFlagsType.wildcardSkipDiagnosticsClusters.offset,
|
|
72
74
|
};
|
|
73
75
|
|
|
74
76
|
class NodeState {
|
package/src/node/server/index.ts
CHANGED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2022-2025 Matter.js Authors
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { AnyAttributeServer, AnyEventServer, AttributePath, AttributeServer, CommandPath, CommandServer, EndpointInterface, EventPath, InteractionContext, InteractionServer, Message, MessageExchange, SessionManager, WriteRequest, WriteResponse } from "#protocol";
|
|
7
|
-
import { StatusCode, TlvEventFilter, TypeFromSchema } from "#types";
|
|
8
|
-
import { AccessControlServer } from "../../behaviors/access-control/AccessControlServer.js";
|
|
9
|
-
import { ServerNode } from "../ServerNode.js";
|
|
10
|
-
/**
|
|
11
|
-
* Wire up an InteractionServer that initializes an InvocationContext earlier than the cluster API supports.
|
|
12
|
-
*
|
|
13
|
-
* This is necessary for attributes because the ClusterServer attribute APIs are synchronous while transaction
|
|
14
|
-
* management is asynchronous.
|
|
15
|
-
*
|
|
16
|
-
* It's not necessary for command handling because that API is entirely async. We do it here, however, just for the
|
|
17
|
-
* sake of consistency.
|
|
18
|
-
*
|
|
19
|
-
* This could be integrated directly into InteractionServer but this further refactoring is probably warranted there
|
|
20
|
-
* regardless. This keeps the touch light for now.
|
|
21
|
-
*/
|
|
22
|
-
export declare class TransactionalInteractionServer extends InteractionServer {
|
|
23
|
-
#private;
|
|
24
|
-
static create(node: ServerNode, sessions: SessionManager): Promise<TransactionalInteractionServer>;
|
|
25
|
-
constructor(node: ServerNode, context: InteractionContext);
|
|
26
|
-
[Symbol.asyncDispose](): Promise<void>;
|
|
27
|
-
blockNewActivity(): void;
|
|
28
|
-
onNewExchange(exchange: MessageExchange, message: Message): Promise<void>;
|
|
29
|
-
get aclServer(): AccessControlServer;
|
|
30
|
-
protected readAttribute(path: AttributePath, attribute: AnyAttributeServer<any>, exchange: MessageExchange, fabricFiltered: boolean, message: Message, offline?: boolean): {
|
|
31
|
-
version: number;
|
|
32
|
-
value: any;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Reads the attributes for the given endpoint.
|
|
36
|
-
* This can currently only be used for subscriptions because errors are ignored!
|
|
37
|
-
*/
|
|
38
|
-
protected readEndpointAttributesForSubscription(attributes: {
|
|
39
|
-
path: AttributePath;
|
|
40
|
-
attribute: AnyAttributeServer<any>;
|
|
41
|
-
}[], exchange: MessageExchange, fabricFiltered: boolean, message: Message, offline?: boolean): {
|
|
42
|
-
path: AttributePath;
|
|
43
|
-
attribute: AnyAttributeServer<unknown>;
|
|
44
|
-
value: any;
|
|
45
|
-
version: number;
|
|
46
|
-
}[];
|
|
47
|
-
protected readEvent(path: EventPath, eventFilters: TypeFromSchema<typeof TlvEventFilter>[] | undefined, event: AnyEventServer<any, any>, exchange: MessageExchange, fabricFiltered: boolean, message: Message): Promise<import("#protocol").NumberedOccurrence[]>;
|
|
48
|
-
handleWriteRequest(exchange: MessageExchange, writeRequest: WriteRequest, message: Message): Promise<WriteResponse>;
|
|
49
|
-
protected writeAttribute(path: AttributePath, attribute: AttributeServer<any>, value: any, exchange: MessageExchange, message: Message, endpoint: EndpointInterface, timed?: boolean, isListWrite?: boolean): Promise<void>;
|
|
50
|
-
protected invokeCommand(path: CommandPath, command: CommandServer<any, any>, exchange: MessageExchange, commandFields: any, message: Message, endpoint: EndpointInterface, timed?: boolean): Promise<{
|
|
51
|
-
code: StatusCode;
|
|
52
|
-
clusterCode?: number;
|
|
53
|
-
responseId: import("#types").CommandId;
|
|
54
|
-
response: import("#types").TlvStream;
|
|
55
|
-
}>;
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=TransactionalInteractionServer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionalInteractionServer.d.ts","sourceRoot":"","sources":["../../../../src/node/server/TransactionalInteractionServer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAGH,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,e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E,GAAG,SAAS,EACjE,KAAK,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,EAC/B,QAAQ,EAAE,eAAe,EACzB,cAAc,EAAE,OAAO,EACvB,OAAO,EAAE,OAAO;IA2BL,kBAAkB,CAC7B,QAAQ,EAAE,eAAe,EACzB,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,GACjB,OAAO,CAAC,aAAa,CAAC;cAkCA,cAAc,CACnC,IAAI,EAAE,aAAa,EACnB,SAAS,EAAE,eAAe,CAAC,GAAG,CAAC,EAC/B,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,UAAQ,EACb,WAAW,CAAC,EAAE,OAAO;cAmCA,aAAa,CAClC,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,EAChC,QAAQ,EAAE,eAAe,EACzB,aAAa,EAAE,GAAG,EAClB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,UAAQ;;;;;;CAwCpB"}
|
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
7
|
-
var __typeError = (msg) => {
|
|
8
|
-
throw TypeError(msg);
|
|
9
|
-
};
|
|
10
|
-
var __export = (target, all) => {
|
|
11
|
-
for (var name in all)
|
|
12
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
-
};
|
|
14
|
-
var __copyProps = (to, from, except, desc) => {
|
|
15
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
-
for (let key of __getOwnPropNames(from))
|
|
17
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
-
var __using = (stack, value, async) => {
|
|
24
|
-
if (value != null) {
|
|
25
|
-
if (typeof value !== "object" && typeof value !== "function") __typeError("Object expected");
|
|
26
|
-
var dispose, inner;
|
|
27
|
-
if (async) dispose = value[__knownSymbol("asyncDispose")];
|
|
28
|
-
if (dispose === void 0) {
|
|
29
|
-
dispose = value[__knownSymbol("dispose")];
|
|
30
|
-
if (async) inner = dispose;
|
|
31
|
-
}
|
|
32
|
-
if (typeof dispose !== "function") __typeError("Object not disposable");
|
|
33
|
-
if (inner) dispose = function() {
|
|
34
|
-
try {
|
|
35
|
-
inner.call(this);
|
|
36
|
-
} catch (e) {
|
|
37
|
-
return Promise.reject(e);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
stack.push([async, dispose, value]);
|
|
41
|
-
} else if (async) {
|
|
42
|
-
stack.push([async]);
|
|
43
|
-
}
|
|
44
|
-
return value;
|
|
45
|
-
};
|
|
46
|
-
var __callDispose = (stack, error, hasError) => {
|
|
47
|
-
var E = typeof SuppressedError === "function" ? SuppressedError : function(e, s, m, _) {
|
|
48
|
-
return _ = Error(m), _.name = "SuppressedError", _.error = e, _.suppressed = s, _;
|
|
49
|
-
};
|
|
50
|
-
var fail = (e) => error = hasError ? new E(e, error, "An error was suppressed during disposal") : (hasError = true, e);
|
|
51
|
-
var next = (it) => {
|
|
52
|
-
while (it = stack.pop()) {
|
|
53
|
-
try {
|
|
54
|
-
var result = it[1] && it[1].call(it[2]);
|
|
55
|
-
if (it[0]) return Promise.resolve(result).then(next, (e) => (fail(e), next()));
|
|
56
|
-
} catch (e) {
|
|
57
|
-
fail(e);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
if (hasError) throw error;
|
|
61
|
-
};
|
|
62
|
-
return next();
|
|
63
|
-
};
|
|
64
|
-
var TransactionalInteractionServer_exports = {};
|
|
65
|
-
__export(TransactionalInteractionServer_exports, {
|
|
66
|
-
TransactionalInteractionServer: () => TransactionalInteractionServer
|
|
67
|
-
});
|
|
68
|
-
module.exports = __toCommonJS(TransactionalInteractionServer_exports);
|
|
69
|
-
var import_ActionTracer = require("#behavior/context/ActionTracer.js");
|
|
70
|
-
var import_NodeActivity = require("#behavior/context/NodeActivity.js");
|
|
71
|
-
var import_OfflineContext = require("#behavior/context/server/OfflineContext.js");
|
|
72
|
-
var import_OnlineContext = require("#behavior/context/server/OnlineContext.js");
|
|
73
|
-
var import_access_control = require("#clusters/access-control");
|
|
74
|
-
var import_EndpointLifecycle = require("#endpoint/properties/EndpointLifecycle.js");
|
|
75
|
-
var import_EndpointServer = require("#endpoint/server/EndpointServer.js");
|
|
76
|
-
var import_general = require("#general");
|
|
77
|
-
var import_protocol = require("#protocol");
|
|
78
|
-
var import_types = require("#types");
|
|
79
|
-
var import_AccessControlServer = require("../../behaviors/access-control/AccessControlServer.js");
|
|
80
|
-
/**
|
|
81
|
-
* @license
|
|
82
|
-
* Copyright 2022-2025 Matter.js Authors
|
|
83
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
84
|
-
*/
|
|
85
|
-
const logger = import_general.Logger.get("TransactionalInteractionServer");
|
|
86
|
-
const activityKey = Symbol("activity");
|
|
87
|
-
const AclClusterId = import_access_control.AccessControlCluster.id;
|
|
88
|
-
const AclAttributeId = import_access_control.AccessControlCluster.attributes.acl.id;
|
|
89
|
-
class TransactionalInteractionServer extends import_protocol.InteractionServer {
|
|
90
|
-
#endpointStructure;
|
|
91
|
-
#changeListener;
|
|
92
|
-
#node;
|
|
93
|
-
#activity;
|
|
94
|
-
#newActivityBlocked = false;
|
|
95
|
-
#aclServer;
|
|
96
|
-
#aclUpdateIsDelayedInExchange = /* @__PURE__ */ new Set();
|
|
97
|
-
static async create(node, sessions) {
|
|
98
|
-
const structure = new import_protocol.InteractionEndpointStructure();
|
|
99
|
-
return new TransactionalInteractionServer(node, {
|
|
100
|
-
sessions,
|
|
101
|
-
structure,
|
|
102
|
-
subscriptionOptions: node.state.network.subscriptionOptions,
|
|
103
|
-
maxPathsPerInvoke: node.state.basicInformation.maxPathsPerInvoke,
|
|
104
|
-
initiateExchange: (address, protocolId) => node.env.get(import_protocol.ExchangeManager).initiateExchange(address, protocolId)
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
constructor(node, context) {
|
|
108
|
-
super(context);
|
|
109
|
-
const { structure } = context;
|
|
110
|
-
this.#activity = node.env.get(import_NodeActivity.NodeActivity);
|
|
111
|
-
this.#node = node;
|
|
112
|
-
this.#endpointStructure = structure;
|
|
113
|
-
this.#updateStructure();
|
|
114
|
-
this.#changeListener = (type, endpoint) => {
|
|
115
|
-
switch (type) {
|
|
116
|
-
case import_EndpointLifecycle.EndpointLifecycle.Change.ServersChanged:
|
|
117
|
-
import_EndpointServer.EndpointServer.forEndpoint(endpoint).updateServers();
|
|
118
|
-
this.#updateStructure();
|
|
119
|
-
break;
|
|
120
|
-
case import_EndpointLifecycle.EndpointLifecycle.Change.PartsReady:
|
|
121
|
-
case import_EndpointLifecycle.EndpointLifecycle.Change.ClientsChanged:
|
|
122
|
-
case import_EndpointLifecycle.EndpointLifecycle.Change.Destroyed:
|
|
123
|
-
this.#updateStructure();
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
node.lifecycle.changed.on(this.#changeListener);
|
|
128
|
-
}
|
|
129
|
-
async [Symbol.asyncDispose]() {
|
|
130
|
-
this.#node.lifecycle.changed.off(this.#changeListener);
|
|
131
|
-
await this.close();
|
|
132
|
-
this.#endpointStructure.close();
|
|
133
|
-
await import_EndpointServer.EndpointServer.forEndpoint(this.#node)[Symbol.asyncDispose]();
|
|
134
|
-
}
|
|
135
|
-
blockNewActivity() {
|
|
136
|
-
this.#newActivityBlocked = true;
|
|
137
|
-
}
|
|
138
|
-
async onNewExchange(exchange, message) {
|
|
139
|
-
var _stack = [];
|
|
140
|
-
try {
|
|
141
|
-
if (this.#newActivityBlocked || this.isClosing) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
if (message.payloadHeader.messageType === import_protocol.MessageType.ReportData && this.clientHandler) {
|
|
145
|
-
return this.clientHandler.onNewExchange(exchange, message);
|
|
146
|
-
}
|
|
147
|
-
const activity = __using(_stack, this.#activity.begin(`session#${exchange.session.id.toString(16)}`));
|
|
148
|
-
exchange[activityKey] = activity;
|
|
149
|
-
return new import_protocol.InteractionServerMessenger(exchange).handleRequest(this).finally(() => delete exchange[activityKey]);
|
|
150
|
-
} catch (_) {
|
|
151
|
-
var _error = _, _hasError = true;
|
|
152
|
-
} finally {
|
|
153
|
-
__callDispose(_stack, _error, _hasError);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
get aclServer() {
|
|
157
|
-
if (this.#aclServer !== void 0) {
|
|
158
|
-
return this.#aclServer;
|
|
159
|
-
}
|
|
160
|
-
const aclServer = this.#node.act((agent) => agent.get(import_AccessControlServer.AccessControlServer));
|
|
161
|
-
if (import_general.MaybePromise.is(aclServer)) {
|
|
162
|
-
throw new import_general.InternalError("AccessControlServer should already be initialized.");
|
|
163
|
-
}
|
|
164
|
-
return this.#aclServer = aclServer;
|
|
165
|
-
}
|
|
166
|
-
readAttribute(path, attribute, exchange, fabricFiltered, message, offline = false) {
|
|
167
|
-
const readAttribute = () => super.readAttribute(path, attribute, exchange, fabricFiltered, message, offline);
|
|
168
|
-
const endpoint = this.#endpointStructure.getEndpoint(path.endpointId);
|
|
169
|
-
if (!endpoint) {
|
|
170
|
-
throw new import_general.InternalError("Endpoint not found for ACL check. This should never happen.");
|
|
171
|
-
}
|
|
172
|
-
const result = offline ? import_OfflineContext.OfflineContext.act("offline-read", this.#activity, readAttribute) : (0, import_OnlineContext.OnlineContext)({
|
|
173
|
-
activity: exchange[activityKey],
|
|
174
|
-
fabricFiltered,
|
|
175
|
-
message,
|
|
176
|
-
exchange,
|
|
177
|
-
tracer: this.#tracer,
|
|
178
|
-
actionType: import_ActionTracer.ActionTracer.ActionType.Read,
|
|
179
|
-
node: this.#node
|
|
180
|
-
}).act(readAttribute);
|
|
181
|
-
if (import_general.MaybePromise.is(result)) {
|
|
182
|
-
throw new import_general.InternalError("Reads should not return a promise.");
|
|
183
|
-
}
|
|
184
|
-
return result;
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Reads the attributes for the given endpoint.
|
|
188
|
-
* This can currently only be used for subscriptions because errors are ignored!
|
|
189
|
-
*/
|
|
190
|
-
readEndpointAttributesForSubscription(attributes, exchange, fabricFiltered, message, offline = false) {
|
|
191
|
-
const readAttributes = () => {
|
|
192
|
-
const result2 = new Array();
|
|
193
|
-
for (const { path, attribute } of attributes) {
|
|
194
|
-
try {
|
|
195
|
-
const value = super.readAttribute(path, attribute, exchange, fabricFiltered, message, offline);
|
|
196
|
-
result2.push({ path, attribute, value: value.value, version: value.version });
|
|
197
|
-
} catch (error) {
|
|
198
|
-
if (import_types.StatusResponseError.is(error, import_types.StatusCode.UnsupportedAccess)) {
|
|
199
|
-
logger.warn(
|
|
200
|
-
`Permission denied reading attribute ${this.#endpointStructure.resolveAttributeName(path)}`
|
|
201
|
-
);
|
|
202
|
-
} else {
|
|
203
|
-
logger.warn(
|
|
204
|
-
`Error reading attribute ${this.#endpointStructure.resolveAttributeName(path)}:`,
|
|
205
|
-
error
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
return result2;
|
|
211
|
-
};
|
|
212
|
-
const result = offline ? import_OfflineContext.OfflineContext.act("offline-read", this.#activity, readAttributes) : (0, import_OnlineContext.OnlineContext)({
|
|
213
|
-
activity: exchange[activityKey],
|
|
214
|
-
fabricFiltered,
|
|
215
|
-
message,
|
|
216
|
-
exchange,
|
|
217
|
-
tracer: this.#tracer,
|
|
218
|
-
actionType: import_ActionTracer.ActionTracer.ActionType.Read,
|
|
219
|
-
node: this.#node
|
|
220
|
-
}).act(readAttributes);
|
|
221
|
-
if (import_general.MaybePromise.is(result)) {
|
|
222
|
-
throw new import_general.InternalError("Online read should not return a promise.");
|
|
223
|
-
}
|
|
224
|
-
return result;
|
|
225
|
-
}
|
|
226
|
-
async readEvent(path, eventFilters, event, exchange, fabricFiltered, message) {
|
|
227
|
-
const readEvent = (context) => {
|
|
228
|
-
if (context.authorityAt(event.readAcl, {
|
|
229
|
-
endpoint: path.endpointId,
|
|
230
|
-
cluster: path.clusterId
|
|
231
|
-
}) !== import_protocol.AccessControl.Authority.Granted) {
|
|
232
|
-
throw new import_protocol.AccessDeniedError(
|
|
233
|
-
`Access to ${path.endpointId}/${import_general.Diagnostic.hex(path.clusterId)} denied on ${exchange.session.name}.`
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
return super.readEvent(path, eventFilters, event, exchange, fabricFiltered, message);
|
|
237
|
-
};
|
|
238
|
-
return (0, import_OnlineContext.OnlineContext)({
|
|
239
|
-
activity: exchange[activityKey],
|
|
240
|
-
fabricFiltered,
|
|
241
|
-
message,
|
|
242
|
-
exchange,
|
|
243
|
-
tracer: this.#tracer,
|
|
244
|
-
actionType: import_ActionTracer.ActionTracer.ActionType.Read,
|
|
245
|
-
node: this.#node
|
|
246
|
-
}).act(readEvent);
|
|
247
|
-
}
|
|
248
|
-
async handleWriteRequest(exchange, writeRequest, message) {
|
|
249
|
-
let result;
|
|
250
|
-
try {
|
|
251
|
-
result = await super.handleWriteRequest(exchange, writeRequest, message);
|
|
252
|
-
} catch (error) {
|
|
253
|
-
if (this.#aclUpdateIsDelayedInExchange.has(exchange)) {
|
|
254
|
-
this.#aclUpdateIsDelayedInExchange.delete(exchange);
|
|
255
|
-
if (this.#aclUpdateIsDelayedInExchange.size === 0) {
|
|
256
|
-
this.aclServer.resetDelayedAccessControlList();
|
|
257
|
-
} else {
|
|
258
|
-
logger.error("One of multiple concurrent ACL writes failed, unhandled case for now.");
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
throw error;
|
|
262
|
-
}
|
|
263
|
-
if (this.#aclUpdateIsDelayedInExchange.has(exchange)) {
|
|
264
|
-
this.#aclUpdateIsDelayedInExchange.delete(exchange);
|
|
265
|
-
if (this.#aclUpdateIsDelayedInExchange.size === 0) {
|
|
266
|
-
this.aclServer.aclUpdateDelayed = false;
|
|
267
|
-
} else {
|
|
268
|
-
logger.info("Multiple concurrent ACL writes, waiting for all to finish.");
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
return result;
|
|
272
|
-
}
|
|
273
|
-
async writeAttribute(path, attribute, value, exchange, message, endpoint, timed = false, isListWrite) {
|
|
274
|
-
const writeAttribute = () => super.writeAttribute(path, attribute, value, exchange, message, endpoint, timed, isListWrite);
|
|
275
|
-
if (path.endpointId === 0 && path.clusterId === AclClusterId && path.attributeId === AclAttributeId) {
|
|
276
|
-
this.aclServer.aclUpdateDelayed = true;
|
|
277
|
-
this.#aclUpdateIsDelayedInExchange.add(exchange);
|
|
278
|
-
} else {
|
|
279
|
-
if (this.#aclUpdateIsDelayedInExchange.has(exchange)) {
|
|
280
|
-
this.#aclUpdateIsDelayedInExchange.delete(exchange);
|
|
281
|
-
if (this.#aclUpdateIsDelayedInExchange.size === 0) {
|
|
282
|
-
this.aclServer.aclUpdateDelayed = false;
|
|
283
|
-
} else {
|
|
284
|
-
logger.info("Multiple concurrent ACL writes, waiting for all to finish.");
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
return (0, import_OnlineContext.OnlineContext)({
|
|
289
|
-
activity: exchange[activityKey],
|
|
290
|
-
timed,
|
|
291
|
-
message,
|
|
292
|
-
exchange,
|
|
293
|
-
fabricFiltered: true,
|
|
294
|
-
tracer: this.#tracer,
|
|
295
|
-
actionType: import_ActionTracer.ActionTracer.ActionType.Write,
|
|
296
|
-
node: this.#node
|
|
297
|
-
}).act(writeAttribute);
|
|
298
|
-
}
|
|
299
|
-
async invokeCommand(path, command, exchange, commandFields, message, endpoint, timed = false) {
|
|
300
|
-
const invokeCommand = (context) => {
|
|
301
|
-
if (context.authorityAt(command.invokeAcl, {
|
|
302
|
-
endpoint: endpoint.number,
|
|
303
|
-
cluster: path.clusterId
|
|
304
|
-
}) !== import_protocol.AccessControl.Authority.Granted) {
|
|
305
|
-
throw new import_protocol.AccessDeniedError(
|
|
306
|
-
`Access to ${endpoint.number}/${import_general.Diagnostic.hex(path.clusterId)} denied on ${exchange.session.name}.`
|
|
307
|
-
);
|
|
308
|
-
}
|
|
309
|
-
return super.invokeCommand(path, command, exchange, commandFields, message, endpoint, timed);
|
|
310
|
-
};
|
|
311
|
-
return (0, import_OnlineContext.OnlineContext)({
|
|
312
|
-
activity: exchange[activityKey],
|
|
313
|
-
command: true,
|
|
314
|
-
timed,
|
|
315
|
-
message,
|
|
316
|
-
exchange,
|
|
317
|
-
tracer: this.#tracer,
|
|
318
|
-
actionType: import_ActionTracer.ActionTracer.ActionType.Invoke,
|
|
319
|
-
node: this.#node
|
|
320
|
-
}).act(invokeCommand);
|
|
321
|
-
}
|
|
322
|
-
get #tracer() {
|
|
323
|
-
if (this.#node.env.has(import_ActionTracer.ActionTracer)) {
|
|
324
|
-
return this.#node.env.get(import_ActionTracer.ActionTracer);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
#updateStructure() {
|
|
328
|
-
if (this.#node.lifecycle.isPartsReady) {
|
|
329
|
-
const server = import_EndpointServer.EndpointServer.forEndpoint(this.#node);
|
|
330
|
-
this.#endpointStructure.initializeFromEndpoint(server);
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
//# sourceMappingURL=TransactionalInteractionServer.js.map
|
|
@@ -1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DX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { AnyAttributeServer, AnyEventServer, AttributePath, AttributeServer, CommandPath, CommandServer, EndpointInterface, EventPath, InteractionContext, InteractionServer, Message, MessageExchange, SessionManager, WriteRequest, WriteResponse } from "#protocol";
|
|
7
|
-
import { StatusCode, TlvEventFilter, TypeFromSchema } from "#types";
|
|
8
|
-
import { AccessControlServer } from "../../behaviors/access-control/AccessControlServer.js";
|
|
9
|
-
import { ServerNode } from "../ServerNode.js";
|
|
10
|
-
/**
|
|
11
|
-
* Wire up an InteractionServer that initializes an InvocationContext earlier than the cluster API supports.
|
|
12
|
-
*
|
|
13
|
-
* This is necessary for attributes because the ClusterServer attribute APIs are synchronous while transaction
|
|
14
|
-
* management is asynchronous.
|
|
15
|
-
*
|
|
16
|
-
* It's not necessary for command handling because that API is entirely async. We do it here, however, just for the
|
|
17
|
-
* sake of consistency.
|
|
18
|
-
*
|
|
19
|
-
* This could be integrated directly into InteractionServer but this further refactoring is probably warranted there
|
|
20
|
-
* regardless. This keeps the touch light for now.
|
|
21
|
-
*/
|
|
22
|
-
export declare class TransactionalInteractionServer extends InteractionServer {
|
|
23
|
-
#private;
|
|
24
|
-
static create(node: ServerNode, sessions: SessionManager): Promise<TransactionalInteractionServer>;
|
|
25
|
-
constructor(node: ServerNode, context: InteractionContext);
|
|
26
|
-
[Symbol.asyncDispose](): Promise<void>;
|
|
27
|
-
blockNewActivity(): void;
|
|
28
|
-
onNewExchange(exchange: MessageExchange, message: Message): Promise<void>;
|
|
29
|
-
get aclServer(): AccessControlServer;
|
|
30
|
-
protected readAttribute(path: AttributePath, attribute: AnyAttributeServer<any>, exchange: MessageExchange, fabricFiltered: boolean, message: Message, offline?: boolean): {
|
|
31
|
-
version: number;
|
|
32
|
-
value: any;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Reads the attributes for the given endpoint.
|
|
36
|
-
* This can currently only be used for subscriptions because errors are ignored!
|
|
37
|
-
*/
|
|
38
|
-
protected readEndpointAttributesForSubscription(attributes: {
|
|
39
|
-
path: AttributePath;
|
|
40
|
-
attribute: AnyAttributeServer<any>;
|
|
41
|
-
}[], exchange: MessageExchange, fabricFiltered: boolean, message: Message, offline?: boolean): {
|
|
42
|
-
path: AttributePath;
|
|
43
|
-
attribute: AnyAttributeServer<unknown>;
|
|
44
|
-
value: any;
|
|
45
|
-
version: number;
|
|
46
|
-
}[];
|
|
47
|
-
protected readEvent(path: EventPath, eventFilters: TypeFromSchema<typeof TlvEventFilter>[] | undefined, event: AnyEventServer<any, any>, exchange: MessageExchange, fabricFiltered: boolean, message: Message): Promise<import("#protocol").NumberedOccurrence[]>;
|
|
48
|
-
handleWriteRequest(exchange: MessageExchange, writeRequest: WriteRequest, message: Message): Promise<WriteResponse>;
|
|
49
|
-
protected writeAttribute(path: AttributePath, attribute: AttributeServer<any>, value: any, exchange: MessageExchange, message: Message, endpoint: EndpointInterface, timed?: boolean, isListWrite?: boolean): Promise<void>;
|
|
50
|
-
protected invokeCommand(path: CommandPath, command: CommandServer<any, any>, exchange: MessageExchange, commandFields: any, message: Message, endpoint: EndpointInterface, timed?: boolean): Promise<{
|
|
51
|
-
code: StatusCode;
|
|
52
|
-
clusterCode?: number;
|
|
53
|
-
responseId: import("#types").CommandId;
|
|
54
|
-
response: import("#types").TlvStream;
|
|
55
|
-
}>;
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=TransactionalInteractionServer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionalInteractionServer.d.ts","sourceRoot":"","sources":["../../../../src/node/server/TransactionalInteractionServer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAGH,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,eAAe,EACf,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,SAAS,EAET,kBAAkB,EAElB,iBAAiB,EAEjB,OAAO,EACP,eAAe,EAEf,cAAc,EACd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