@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.
Files changed (136) hide show
  1. package/dist/cjs/behavior/state/managed/values/ListManager.js +2 -2
  2. package/dist/cjs/behavior/state/managed/values/ListManager.js.map +1 -1
  3. package/dist/cjs/behavior/system/subscriptions/SubscriptionsServer.js +1 -1
  4. package/dist/cjs/behavior/system/subscriptions/SubscriptionsServer.js.map +1 -1
  5. package/dist/cjs/behaviors/access-control/AccessControlServer.d.ts.map +1 -1
  6. package/dist/cjs/behaviors/access-control/AccessControlServer.js +17 -20
  7. package/dist/cjs/behaviors/access-control/AccessControlServer.js.map +1 -1
  8. package/dist/cjs/behaviors/color-control/ColorControlServer.js +3 -3
  9. package/dist/cjs/behaviors/color-control/ColorControlServer.js.map +1 -1
  10. package/dist/cjs/behaviors/descriptor/DescriptorServer.d.ts.map +1 -1
  11. package/dist/cjs/behaviors/descriptor/DescriptorServer.js +10 -0
  12. package/dist/cjs/behaviors/descriptor/DescriptorServer.js.map +1 -1
  13. package/dist/cjs/behaviors/door-lock/DoorLockServer.d.ts.map +1 -1
  14. package/dist/cjs/behaviors/door-lock/DoorLockServer.js +55 -58
  15. package/dist/cjs/behaviors/door-lock/DoorLockServer.js.map +1 -1
  16. package/dist/cjs/behaviors/general-diagnostics/GeneralDiagnosticsServer.js +5 -5
  17. package/dist/cjs/behaviors/general-diagnostics/GeneralDiagnosticsServer.js.map +1 -1
  18. package/dist/cjs/behaviors/group-key-management/GroupKeyManagementServer.d.ts.map +1 -1
  19. package/dist/cjs/behaviors/group-key-management/GroupKeyManagementServer.js +20 -20
  20. package/dist/cjs/behaviors/group-key-management/GroupKeyManagementServer.js.map +1 -1
  21. package/dist/cjs/behaviors/groups/GroupsServer.js +11 -11
  22. package/dist/cjs/behaviors/groups/GroupsServer.js.map +1 -1
  23. package/dist/cjs/behaviors/level-control/LevelControlServer.js +2 -2
  24. package/dist/cjs/behaviors/level-control/LevelControlServer.js.map +1 -1
  25. package/dist/cjs/behaviors/mode-select/ModeSelectServer.js +1 -1
  26. package/dist/cjs/behaviors/mode-select/ModeSelectServer.js.map +1 -1
  27. package/dist/cjs/behaviors/operational-credentials/OperationalCredentialsServer.d.ts.map +1 -1
  28. package/dist/cjs/behaviors/operational-credentials/OperationalCredentialsServer.js +13 -16
  29. package/dist/cjs/behaviors/operational-credentials/OperationalCredentialsServer.js.map +1 -1
  30. package/dist/cjs/behaviors/switch/SwitchServer.js +1 -1
  31. package/dist/cjs/behaviors/switch/SwitchServer.js.map +1 -1
  32. package/dist/cjs/behaviors/window-covering/WindowCoveringServer.js +5 -5
  33. package/dist/cjs/behaviors/window-covering/WindowCoveringServer.js.map +1 -1
  34. package/dist/cjs/devices/closure-panel.d.ts +0 -18
  35. package/dist/cjs/devices/closure-panel.d.ts.map +1 -1
  36. package/dist/cjs/devices/closure-panel.js +1 -8
  37. package/dist/cjs/devices/closure-panel.js.map +2 -2
  38. package/dist/cjs/devices/closure.d.ts +0 -18
  39. package/dist/cjs/devices/closure.d.ts.map +1 -1
  40. package/dist/cjs/devices/closure.js +1 -8
  41. package/dist/cjs/devices/closure.js.map +2 -2
  42. package/dist/cjs/devices/door-lock.d.ts +0 -18
  43. package/dist/cjs/devices/door-lock.d.ts.map +1 -1
  44. package/dist/cjs/devices/door-lock.js +1 -8
  45. package/dist/cjs/devices/door-lock.js.map +2 -2
  46. package/dist/cjs/devices/window-covering.d.ts +0 -16
  47. package/dist/cjs/devices/window-covering.d.ts.map +1 -1
  48. package/dist/cjs/devices/window-covering.js +1 -9
  49. package/dist/cjs/devices/window-covering.js.map +2 -2
  50. package/dist/cjs/endpoint/type/MutableEndpoint.d.ts.map +1 -1
  51. package/dist/cjs/endpoint/type/MutableEndpoint.js +1 -7
  52. package/dist/cjs/endpoint/type/MutableEndpoint.js.map +1 -1
  53. package/dist/cjs/node/server/InteractionServer.d.ts.map +1 -1
  54. package/dist/cjs/node/server/InteractionServer.js +21 -24
  55. package/dist/cjs/node/server/InteractionServer.js.map +1 -1
  56. package/dist/cjs/node/server/ServerSubscription.js +2 -2
  57. package/dist/cjs/node/server/ServerSubscription.js.map +1 -1
  58. package/dist/esm/behavior/state/managed/values/ListManager.js +3 -3
  59. package/dist/esm/behavior/state/managed/values/ListManager.js.map +1 -1
  60. package/dist/esm/behavior/system/subscriptions/SubscriptionsServer.js +2 -2
  61. package/dist/esm/behavior/system/subscriptions/SubscriptionsServer.js.map +1 -1
  62. package/dist/esm/behaviors/access-control/AccessControlServer.d.ts.map +1 -1
  63. package/dist/esm/behaviors/access-control/AccessControlServer.js +18 -21
  64. package/dist/esm/behaviors/access-control/AccessControlServer.js.map +1 -1
  65. package/dist/esm/behaviors/color-control/ColorControlServer.js +4 -4
  66. package/dist/esm/behaviors/color-control/ColorControlServer.js.map +1 -1
  67. package/dist/esm/behaviors/descriptor/DescriptorServer.d.ts.map +1 -1
  68. package/dist/esm/behaviors/descriptor/DescriptorServer.js +11 -1
  69. package/dist/esm/behaviors/descriptor/DescriptorServer.js.map +1 -1
  70. package/dist/esm/behaviors/door-lock/DoorLockServer.d.ts.map +1 -1
  71. package/dist/esm/behaviors/door-lock/DoorLockServer.js +56 -59
  72. package/dist/esm/behaviors/door-lock/DoorLockServer.js.map +1 -1
  73. package/dist/esm/behaviors/general-diagnostics/GeneralDiagnosticsServer.js +6 -6
  74. package/dist/esm/behaviors/general-diagnostics/GeneralDiagnosticsServer.js.map +1 -1
  75. package/dist/esm/behaviors/group-key-management/GroupKeyManagementServer.d.ts.map +1 -1
  76. package/dist/esm/behaviors/group-key-management/GroupKeyManagementServer.js +21 -21
  77. package/dist/esm/behaviors/group-key-management/GroupKeyManagementServer.js.map +1 -1
  78. package/dist/esm/behaviors/groups/GroupsServer.js +12 -12
  79. package/dist/esm/behaviors/groups/GroupsServer.js.map +1 -1
  80. package/dist/esm/behaviors/level-control/LevelControlServer.js +3 -3
  81. package/dist/esm/behaviors/level-control/LevelControlServer.js.map +1 -1
  82. package/dist/esm/behaviors/mode-select/ModeSelectServer.js +2 -2
  83. package/dist/esm/behaviors/mode-select/ModeSelectServer.js.map +1 -1
  84. package/dist/esm/behaviors/operational-credentials/OperationalCredentialsServer.d.ts.map +1 -1
  85. package/dist/esm/behaviors/operational-credentials/OperationalCredentialsServer.js +14 -17
  86. package/dist/esm/behaviors/operational-credentials/OperationalCredentialsServer.js.map +1 -1
  87. package/dist/esm/behaviors/switch/SwitchServer.js +2 -2
  88. package/dist/esm/behaviors/switch/SwitchServer.js.map +1 -1
  89. package/dist/esm/behaviors/window-covering/WindowCoveringServer.js +6 -6
  90. package/dist/esm/behaviors/window-covering/WindowCoveringServer.js.map +1 -1
  91. package/dist/esm/devices/closure-panel.d.ts +0 -18
  92. package/dist/esm/devices/closure-panel.d.ts.map +1 -1
  93. package/dist/esm/devices/closure-panel.js +1 -8
  94. package/dist/esm/devices/closure-panel.js.map +1 -1
  95. package/dist/esm/devices/closure.d.ts +0 -18
  96. package/dist/esm/devices/closure.d.ts.map +1 -1
  97. package/dist/esm/devices/closure.js +1 -10
  98. package/dist/esm/devices/closure.js.map +1 -1
  99. package/dist/esm/devices/door-lock.d.ts +0 -18
  100. package/dist/esm/devices/door-lock.d.ts.map +1 -1
  101. package/dist/esm/devices/door-lock.js +1 -10
  102. package/dist/esm/devices/door-lock.js.map +1 -1
  103. package/dist/esm/devices/window-covering.d.ts +0 -16
  104. package/dist/esm/devices/window-covering.d.ts.map +1 -1
  105. package/dist/esm/devices/window-covering.js +1 -11
  106. package/dist/esm/devices/window-covering.js.map +1 -1
  107. package/dist/esm/endpoint/type/MutableEndpoint.d.ts.map +1 -1
  108. package/dist/esm/endpoint/type/MutableEndpoint.js +1 -7
  109. package/dist/esm/endpoint/type/MutableEndpoint.js.map +1 -1
  110. package/dist/esm/node/server/InteractionServer.d.ts.map +1 -1
  111. package/dist/esm/node/server/InteractionServer.js +21 -25
  112. package/dist/esm/node/server/InteractionServer.js.map +1 -1
  113. package/dist/esm/node/server/ServerSubscription.js +3 -3
  114. package/dist/esm/node/server/ServerSubscription.js.map +1 -1
  115. package/package.json +6 -6
  116. package/src/behavior/state/managed/values/ListManager.ts +3 -3
  117. package/src/behavior/system/subscriptions/SubscriptionsServer.ts +2 -2
  118. package/src/behaviors/access-control/AccessControlServer.ts +18 -21
  119. package/src/behaviors/color-control/ColorControlServer.ts +4 -4
  120. package/src/behaviors/descriptor/DescriptorServer.ts +13 -1
  121. package/src/behaviors/door-lock/DoorLockServer.ts +56 -59
  122. package/src/behaviors/general-diagnostics/GeneralDiagnosticsServer.ts +6 -6
  123. package/src/behaviors/group-key-management/GroupKeyManagementServer.ts +22 -22
  124. package/src/behaviors/groups/GroupsServer.ts +12 -12
  125. package/src/behaviors/level-control/LevelControlServer.ts +3 -3
  126. package/src/behaviors/mode-select/ModeSelectServer.ts +2 -2
  127. package/src/behaviors/operational-credentials/OperationalCredentialsServer.ts +14 -17
  128. package/src/behaviors/switch/SwitchServer.ts +2 -2
  129. package/src/behaviors/window-covering/WindowCoveringServer.ts +6 -6
  130. package/src/devices/closure-panel.ts +1 -20
  131. package/src/devices/closure.ts +1 -22
  132. package/src/devices/door-lock.ts +1 -22
  133. package/src/devices/window-covering.ts +1 -23
  134. package/src/endpoint/type/MutableEndpoint.ts +1 -8
  135. package/src/node/server/InteractionServer.ts +21 -25
  136. 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", StatusCode.InvalidAction);
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
- StatusCode.InvalidAction,
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", StatusCode.InvalidAction);
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", StatusCode.InvalidAction);
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
- StatusCode.InvalidAction,
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
- StatusCode.InvalidAction,
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
- StatusCode.InvalidAction,
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.`, StatusCode.Timeout);
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
- StatusCode.TimedRequestMismatch,
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
- StatusCode.InvalidAction,
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
- StatusCode.InvalidAction,
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
- StatusCode.InvalidAction,
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", StatusCode.InvalidAction);
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
- StatusCode.InvalidAction,
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
- StatusCode.InvalidAction,
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
- StatusCode.InvalidAction,
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.`, StatusCode.Timeout);
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
- StatusCode.TimedRequestMismatch,
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
- StatusCode.InvalidAction,
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
- StatusCode.InvalidAction,
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
- StatusCode,
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
- StatusCode.InvalidAction,
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, StatusCode.InvalidSubscription, StatusCode.Failure)) {
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 {