@matter/node 0.17.0-alpha.0-20260518-7f13c7285 → 0.17.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/cjs/behavior/state/managed/values/ListManager.js +2 -2
- package/dist/cjs/behavior/state/managed/values/ListManager.js.map +1 -1
- package/dist/cjs/behavior/system/subscriptions/SubscriptionsServer.js +1 -1
- package/dist/cjs/behavior/system/subscriptions/SubscriptionsServer.js.map +1 -1
- package/dist/cjs/behaviors/access-control/AccessControlServer.d.ts.map +1 -1
- package/dist/cjs/behaviors/access-control/AccessControlServer.js +17 -20
- package/dist/cjs/behaviors/access-control/AccessControlServer.js.map +1 -1
- package/dist/cjs/behaviors/color-control/ColorControlServer.js +3 -3
- package/dist/cjs/behaviors/color-control/ColorControlServer.js.map +1 -1
- package/dist/cjs/behaviors/descriptor/DescriptorServer.d.ts.map +1 -1
- package/dist/cjs/behaviors/descriptor/DescriptorServer.js +10 -0
- package/dist/cjs/behaviors/descriptor/DescriptorServer.js.map +1 -1
- package/dist/cjs/behaviors/door-lock/DoorLockServer.d.ts.map +1 -1
- package/dist/cjs/behaviors/door-lock/DoorLockServer.js +55 -58
- package/dist/cjs/behaviors/door-lock/DoorLockServer.js.map +1 -1
- package/dist/cjs/behaviors/general-diagnostics/GeneralDiagnosticsServer.js +5 -5
- package/dist/cjs/behaviors/general-diagnostics/GeneralDiagnosticsServer.js.map +1 -1
- package/dist/cjs/behaviors/group-key-management/GroupKeyManagementServer.d.ts.map +1 -1
- package/dist/cjs/behaviors/group-key-management/GroupKeyManagementServer.js +20 -20
- package/dist/cjs/behaviors/group-key-management/GroupKeyManagementServer.js.map +1 -1
- package/dist/cjs/behaviors/groups/GroupsServer.js +11 -11
- package/dist/cjs/behaviors/groups/GroupsServer.js.map +1 -1
- package/dist/cjs/behaviors/level-control/LevelControlServer.js +2 -2
- package/dist/cjs/behaviors/level-control/LevelControlServer.js.map +1 -1
- package/dist/cjs/behaviors/mode-select/ModeSelectServer.js +1 -1
- package/dist/cjs/behaviors/mode-select/ModeSelectServer.js.map +1 -1
- package/dist/cjs/behaviors/operational-credentials/OperationalCredentialsServer.d.ts.map +1 -1
- package/dist/cjs/behaviors/operational-credentials/OperationalCredentialsServer.js +13 -16
- package/dist/cjs/behaviors/operational-credentials/OperationalCredentialsServer.js.map +1 -1
- package/dist/cjs/behaviors/switch/SwitchServer.js +1 -1
- package/dist/cjs/behaviors/switch/SwitchServer.js.map +1 -1
- package/dist/cjs/behaviors/window-covering/WindowCoveringServer.js +5 -5
- package/dist/cjs/behaviors/window-covering/WindowCoveringServer.js.map +1 -1
- package/dist/cjs/devices/closure-panel.d.ts +0 -18
- package/dist/cjs/devices/closure-panel.d.ts.map +1 -1
- package/dist/cjs/devices/closure-panel.js +1 -8
- package/dist/cjs/devices/closure-panel.js.map +2 -2
- package/dist/cjs/devices/closure.d.ts +0 -18
- package/dist/cjs/devices/closure.d.ts.map +1 -1
- package/dist/cjs/devices/closure.js +1 -8
- package/dist/cjs/devices/closure.js.map +2 -2
- package/dist/cjs/devices/door-lock.d.ts +0 -18
- package/dist/cjs/devices/door-lock.d.ts.map +1 -1
- package/dist/cjs/devices/door-lock.js +1 -8
- package/dist/cjs/devices/door-lock.js.map +2 -2
- package/dist/cjs/devices/window-covering.d.ts +0 -16
- package/dist/cjs/devices/window-covering.d.ts.map +1 -1
- package/dist/cjs/devices/window-covering.js +1 -9
- package/dist/cjs/devices/window-covering.js.map +2 -2
- package/dist/cjs/endpoint/type/MutableEndpoint.d.ts.map +1 -1
- package/dist/cjs/endpoint/type/MutableEndpoint.js +1 -7
- package/dist/cjs/endpoint/type/MutableEndpoint.js.map +1 -1
- package/dist/cjs/node/server/InteractionServer.d.ts.map +1 -1
- package/dist/cjs/node/server/InteractionServer.js +21 -24
- package/dist/cjs/node/server/InteractionServer.js.map +1 -1
- package/dist/cjs/node/server/ServerSubscription.js +2 -2
- package/dist/cjs/node/server/ServerSubscription.js.map +1 -1
- package/dist/esm/behavior/state/managed/values/ListManager.js +3 -3
- package/dist/esm/behavior/state/managed/values/ListManager.js.map +1 -1
- package/dist/esm/behavior/system/subscriptions/SubscriptionsServer.js +2 -2
- package/dist/esm/behavior/system/subscriptions/SubscriptionsServer.js.map +1 -1
- package/dist/esm/behaviors/access-control/AccessControlServer.d.ts.map +1 -1
- package/dist/esm/behaviors/access-control/AccessControlServer.js +18 -21
- package/dist/esm/behaviors/access-control/AccessControlServer.js.map +1 -1
- package/dist/esm/behaviors/color-control/ColorControlServer.js +4 -4
- package/dist/esm/behaviors/color-control/ColorControlServer.js.map +1 -1
- package/dist/esm/behaviors/descriptor/DescriptorServer.d.ts.map +1 -1
- package/dist/esm/behaviors/descriptor/DescriptorServer.js +11 -1
- package/dist/esm/behaviors/descriptor/DescriptorServer.js.map +1 -1
- package/dist/esm/behaviors/door-lock/DoorLockServer.d.ts.map +1 -1
- package/dist/esm/behaviors/door-lock/DoorLockServer.js +56 -59
- package/dist/esm/behaviors/door-lock/DoorLockServer.js.map +1 -1
- package/dist/esm/behaviors/general-diagnostics/GeneralDiagnosticsServer.js +6 -6
- package/dist/esm/behaviors/general-diagnostics/GeneralDiagnosticsServer.js.map +1 -1
- package/dist/esm/behaviors/group-key-management/GroupKeyManagementServer.d.ts.map +1 -1
- package/dist/esm/behaviors/group-key-management/GroupKeyManagementServer.js +21 -21
- package/dist/esm/behaviors/group-key-management/GroupKeyManagementServer.js.map +1 -1
- package/dist/esm/behaviors/groups/GroupsServer.js +12 -12
- package/dist/esm/behaviors/groups/GroupsServer.js.map +1 -1
- package/dist/esm/behaviors/level-control/LevelControlServer.js +3 -3
- package/dist/esm/behaviors/level-control/LevelControlServer.js.map +1 -1
- package/dist/esm/behaviors/mode-select/ModeSelectServer.js +2 -2
- package/dist/esm/behaviors/mode-select/ModeSelectServer.js.map +1 -1
- package/dist/esm/behaviors/operational-credentials/OperationalCredentialsServer.d.ts.map +1 -1
- package/dist/esm/behaviors/operational-credentials/OperationalCredentialsServer.js +14 -17
- package/dist/esm/behaviors/operational-credentials/OperationalCredentialsServer.js.map +1 -1
- package/dist/esm/behaviors/switch/SwitchServer.js +2 -2
- package/dist/esm/behaviors/switch/SwitchServer.js.map +1 -1
- package/dist/esm/behaviors/window-covering/WindowCoveringServer.js +6 -6
- package/dist/esm/behaviors/window-covering/WindowCoveringServer.js.map +1 -1
- package/dist/esm/devices/closure-panel.d.ts +0 -18
- package/dist/esm/devices/closure-panel.d.ts.map +1 -1
- package/dist/esm/devices/closure-panel.js +1 -8
- package/dist/esm/devices/closure-panel.js.map +1 -1
- package/dist/esm/devices/closure.d.ts +0 -18
- package/dist/esm/devices/closure.d.ts.map +1 -1
- package/dist/esm/devices/closure.js +1 -10
- package/dist/esm/devices/closure.js.map +1 -1
- package/dist/esm/devices/door-lock.d.ts +0 -18
- package/dist/esm/devices/door-lock.d.ts.map +1 -1
- package/dist/esm/devices/door-lock.js +1 -10
- package/dist/esm/devices/door-lock.js.map +1 -1
- package/dist/esm/devices/window-covering.d.ts +0 -16
- package/dist/esm/devices/window-covering.d.ts.map +1 -1
- package/dist/esm/devices/window-covering.js +1 -11
- package/dist/esm/devices/window-covering.js.map +1 -1
- package/dist/esm/endpoint/type/MutableEndpoint.d.ts.map +1 -1
- package/dist/esm/endpoint/type/MutableEndpoint.js +1 -7
- package/dist/esm/endpoint/type/MutableEndpoint.js.map +1 -1
- package/dist/esm/node/server/InteractionServer.d.ts.map +1 -1
- package/dist/esm/node/server/InteractionServer.js +21 -25
- package/dist/esm/node/server/InteractionServer.js.map +1 -1
- package/dist/esm/node/server/ServerSubscription.js +3 -3
- package/dist/esm/node/server/ServerSubscription.js.map +1 -1
- package/package.json +6 -6
- package/src/behavior/state/managed/values/ListManager.ts +3 -3
- package/src/behavior/system/subscriptions/SubscriptionsServer.ts +2 -2
- package/src/behaviors/access-control/AccessControlServer.ts +18 -21
- package/src/behaviors/color-control/ColorControlServer.ts +4 -4
- package/src/behaviors/descriptor/DescriptorServer.ts +13 -1
- package/src/behaviors/door-lock/DoorLockServer.ts +56 -59
- package/src/behaviors/general-diagnostics/GeneralDiagnosticsServer.ts +6 -6
- package/src/behaviors/group-key-management/GroupKeyManagementServer.ts +22 -22
- package/src/behaviors/groups/GroupsServer.ts +12 -12
- package/src/behaviors/level-control/LevelControlServer.ts +3 -3
- package/src/behaviors/mode-select/ModeSelectServer.ts +2 -2
- package/src/behaviors/operational-credentials/OperationalCredentialsServer.ts +14 -17
- package/src/behaviors/switch/SwitchServer.ts +2 -2
- package/src/behaviors/window-covering/WindowCoveringServer.ts +6 -6
- package/src/devices/closure-panel.ts +1 -20
- package/src/devices/closure.ts +1 -22
- package/src/devices/door-lock.ts +1 -22
- package/src/devices/window-covering.ts +1 -23
- package/src/endpoint/type/MutableEndpoint.ts +1 -8
- package/src/node/server/InteractionServer.ts +21 -25
- package/src/node/server/ServerSubscription.ts +3 -3
|
@@ -54,7 +54,6 @@ import {
|
|
|
54
54
|
InvokeResponseData,
|
|
55
55
|
ReceivedStatusResponseError,
|
|
56
56
|
Status,
|
|
57
|
-
StatusCode,
|
|
58
57
|
StatusResponseError,
|
|
59
58
|
TlvAny,
|
|
60
59
|
TlvAttributePath,
|
|
@@ -85,14 +84,14 @@ export interface PeerSubscription {
|
|
|
85
84
|
|
|
86
85
|
function validateReadAttributesPath(path: TypeFromSchema<typeof TlvAttributePath>, isGroupSession = false) {
|
|
87
86
|
if (isGroupSession) {
|
|
88
|
-
throw new StatusResponseError("Illegal read request with group session",
|
|
87
|
+
throw new StatusResponseError("Illegal read request with group session", Status.InvalidAction);
|
|
89
88
|
}
|
|
90
89
|
const { clusterId, attributeId } = path;
|
|
91
90
|
if (clusterId === undefined && attributeId !== undefined) {
|
|
92
91
|
if (!GLOBAL_IDS.has(attributeId)) {
|
|
93
92
|
throw new StatusResponseError(
|
|
94
93
|
`Illegal read request for wildcard cluster and non global attribute ${attributeId}`,
|
|
95
|
-
|
|
94
|
+
Status.InvalidAction,
|
|
96
95
|
);
|
|
97
96
|
}
|
|
98
97
|
}
|
|
@@ -101,10 +100,10 @@ function validateReadAttributesPath(path: TypeFromSchema<typeof TlvAttributePath
|
|
|
101
100
|
function validateReadEventPath(path: TypeFromSchema<typeof TlvEventPath>, isGroupSession = false) {
|
|
102
101
|
const { clusterId, eventId } = path;
|
|
103
102
|
if (clusterId === undefined && eventId !== undefined) {
|
|
104
|
-
throw new StatusResponseError("Illegal read request with wildcard cluster ID",
|
|
103
|
+
throw new StatusResponseError("Illegal read request with wildcard cluster ID", Status.InvalidAction);
|
|
105
104
|
}
|
|
106
105
|
if (isGroupSession) {
|
|
107
|
-
throw new StatusResponseError("Illegal read request with group session",
|
|
106
|
+
throw new StatusResponseError("Illegal read request with group session", Status.InvalidAction);
|
|
108
107
|
}
|
|
109
108
|
}
|
|
110
109
|
|
|
@@ -307,7 +306,7 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
307
306
|
if (message.packetHeader.sessionType !== SessionType.Unicast) {
|
|
308
307
|
throw new StatusResponseError(
|
|
309
308
|
"Reads are only allowed on unicast sessions", // Means "No groups"
|
|
310
|
-
|
|
309
|
+
Status.InvalidAction,
|
|
311
310
|
);
|
|
312
311
|
}
|
|
313
312
|
|
|
@@ -341,7 +340,7 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
341
340
|
if (moreChunkedMessages && suppressResponse) {
|
|
342
341
|
throw new StatusResponseError(
|
|
343
342
|
"MoreChunkedMessages and SuppressResponse cannot be used together in write messages",
|
|
344
|
-
|
|
343
|
+
Status.InvalidAction,
|
|
345
344
|
);
|
|
346
345
|
}
|
|
347
346
|
|
|
@@ -352,19 +351,19 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
352
351
|
if (receivedWithinTimedInteraction && moreChunkedMessages) {
|
|
353
352
|
throw new StatusResponseError(
|
|
354
353
|
"Write Request action that is part of a Timed Write Interaction SHALL NOT be chunked.",
|
|
355
|
-
|
|
354
|
+
Status.InvalidAction,
|
|
356
355
|
);
|
|
357
356
|
}
|
|
358
357
|
|
|
359
358
|
if (exchange.hasExpiredTimedInteraction()) {
|
|
360
359
|
exchange.clearTimedInteraction();
|
|
361
|
-
throw new StatusResponseError(`Timed request window expired. Decline write request.`,
|
|
360
|
+
throw new StatusResponseError(`Timed request window expired. Decline write request.`, Status.Timeout);
|
|
362
361
|
}
|
|
363
362
|
|
|
364
363
|
if (timedRequest !== exchange.hasTimedInteraction()) {
|
|
365
364
|
throw new StatusResponseError(
|
|
366
365
|
`timedRequest flag of write interaction (${timedRequest}) mismatch with expected timed interaction (${receivedWithinTimedInteraction}).`,
|
|
367
|
-
|
|
366
|
+
Status.TimedRequestMismatch,
|
|
368
367
|
);
|
|
369
368
|
}
|
|
370
369
|
|
|
@@ -374,7 +373,7 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
374
373
|
if (sessionType !== SessionType.Unicast) {
|
|
375
374
|
throw new StatusResponseError(
|
|
376
375
|
"Write requests are only allowed on unicast sessions when a timed interaction is running.",
|
|
377
|
-
|
|
376
|
+
Status.InvalidAction,
|
|
378
377
|
);
|
|
379
378
|
}
|
|
380
379
|
}
|
|
@@ -382,7 +381,7 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
382
381
|
if (sessionType === SessionType.Group && !suppressResponse) {
|
|
383
382
|
throw new StatusResponseError(
|
|
384
383
|
"Write requests are only allowed as group casts when suppressResponse=true.",
|
|
385
|
-
|
|
384
|
+
Status.InvalidAction,
|
|
386
385
|
);
|
|
387
386
|
}
|
|
388
387
|
|
|
@@ -496,7 +495,7 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
496
495
|
if (suppressResponse) {
|
|
497
496
|
throw new StatusResponseError(
|
|
498
497
|
"Multiple chunked messages and SuppressResponse cannot be used together in write messages",
|
|
499
|
-
|
|
498
|
+
Status.InvalidAction,
|
|
500
499
|
);
|
|
501
500
|
}
|
|
502
501
|
}
|
|
@@ -534,10 +533,7 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
534
533
|
this.#checkSenderRevision(interactionModelRevision);
|
|
535
534
|
|
|
536
535
|
if (message.packetHeader.sessionType !== SessionType.Unicast) {
|
|
537
|
-
throw new StatusResponseError(
|
|
538
|
-
"Subscriptions are only allowed on unicast sessions",
|
|
539
|
-
StatusCode.InvalidAction,
|
|
540
|
-
);
|
|
536
|
+
throw new StatusResponseError("Subscriptions are only allowed on unicast sessions", Status.InvalidAction);
|
|
541
537
|
}
|
|
542
538
|
|
|
543
539
|
NodeSession.assert(exchange.session, "Subscriptions are only implemented on secure sessions");
|
|
@@ -568,7 +564,7 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
568
564
|
(!Array.isArray(attributeRequests) || attributeRequests.length === 0) &&
|
|
569
565
|
(!Array.isArray(eventRequests) || eventRequests.length === 0)
|
|
570
566
|
) {
|
|
571
|
-
throw new StatusResponseError("No attributes or events requested",
|
|
567
|
+
throw new StatusResponseError("No attributes or events requested", Status.InvalidAction);
|
|
572
568
|
}
|
|
573
569
|
|
|
574
570
|
logger.debug(() => [
|
|
@@ -603,19 +599,19 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
603
599
|
if (minIntervalFloorSeconds < 0) {
|
|
604
600
|
throw new StatusResponseError(
|
|
605
601
|
"minIntervalFloorSeconds should be greater or equal to 0",
|
|
606
|
-
|
|
602
|
+
Status.InvalidAction,
|
|
607
603
|
);
|
|
608
604
|
}
|
|
609
605
|
if (maxIntervalCeilingSeconds < 0) {
|
|
610
606
|
throw new StatusResponseError(
|
|
611
607
|
"maxIntervalCeilingSeconds should be greater or equal to 0",
|
|
612
|
-
|
|
608
|
+
Status.InvalidAction,
|
|
613
609
|
);
|
|
614
610
|
}
|
|
615
611
|
if (maxIntervalCeilingSeconds < minIntervalFloorSeconds) {
|
|
616
612
|
throw new StatusResponseError(
|
|
617
613
|
"maxIntervalCeilingSeconds should be greater or equal to minIntervalFloorSeconds",
|
|
618
|
-
|
|
614
|
+
Status.InvalidAction,
|
|
619
615
|
);
|
|
620
616
|
}
|
|
621
617
|
|
|
@@ -837,13 +833,13 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
837
833
|
const receivedWithinTimedInteraction = exchange.hasActiveTimedInteraction();
|
|
838
834
|
if (exchange.hasExpiredTimedInteraction()) {
|
|
839
835
|
exchange.clearTimedInteraction();
|
|
840
|
-
throw new StatusResponseError(`Timed request window expired. Decline invoke request.`,
|
|
836
|
+
throw new StatusResponseError(`Timed request window expired. Decline invoke request.`, Status.Timeout);
|
|
841
837
|
}
|
|
842
838
|
|
|
843
839
|
if (timedRequest !== exchange.hasTimedInteraction()) {
|
|
844
840
|
throw new StatusResponseError(
|
|
845
841
|
`timedRequest flag of invoke interaction (${timedRequest}) mismatch with expected timed interaction (${receivedWithinTimedInteraction}).`,
|
|
846
|
-
|
|
842
|
+
Status.TimedRequestMismatch,
|
|
847
843
|
);
|
|
848
844
|
}
|
|
849
845
|
|
|
@@ -853,7 +849,7 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
853
849
|
if (message.packetHeader.sessionType !== SessionType.Unicast) {
|
|
854
850
|
throw new StatusResponseError(
|
|
855
851
|
"Invoke requests are only allowed on unicast sessions when a timed interaction is running.",
|
|
856
|
-
|
|
852
|
+
Status.InvalidAction,
|
|
857
853
|
);
|
|
858
854
|
}
|
|
859
855
|
}
|
|
@@ -861,7 +857,7 @@ export class InteractionServer implements ProtocolHandler, InteractionRecipient
|
|
|
861
857
|
if (invokeRequests.length > this.#maxPathsPerInvoke) {
|
|
862
858
|
throw new StatusResponseError(
|
|
863
859
|
`Only ${this.#maxPathsPerInvoke} invoke requests are supported in one message. This message contains ${invokeRequests.length}`,
|
|
864
|
-
|
|
860
|
+
Status.InvalidAction,
|
|
865
861
|
);
|
|
866
862
|
}
|
|
867
863
|
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
EndpointNumber,
|
|
49
49
|
EventNumber,
|
|
50
50
|
INTERACTION_PROTOCOL_ID,
|
|
51
|
-
|
|
51
|
+
Status,
|
|
52
52
|
StatusResponseError,
|
|
53
53
|
SubscribeRequest,
|
|
54
54
|
} from "@matter/types";
|
|
@@ -605,7 +605,7 @@ export class ServerSubscription implements Subscription {
|
|
|
605
605
|
if (validAttributes === 0 && validEvents === 0) {
|
|
606
606
|
throw new StatusResponseError(
|
|
607
607
|
"Subscription failed because no attributes or events are matching the query",
|
|
608
|
-
|
|
608
|
+
Status.InvalidAction,
|
|
609
609
|
);
|
|
610
610
|
} else if (!hasValuesInResponse && delayedStatusReports.length) {
|
|
611
611
|
// We have no values in the response but collected status reports, so we need to send them
|
|
@@ -799,7 +799,7 @@ export class ServerSubscription implements Subscription {
|
|
|
799
799
|
});
|
|
800
800
|
}
|
|
801
801
|
} catch (error) {
|
|
802
|
-
if (StatusResponseError.is(error,
|
|
802
|
+
if (StatusResponseError.is(error, Status.InvalidSubscription, Status.Failure)) {
|
|
803
803
|
logger.info(`Subscription ${this.idStr} cancelled by peer`);
|
|
804
804
|
this.#isCanceledByPeer = true;
|
|
805
805
|
} else {
|