@matter/node 0.18.0 → 0.18.1-alpha.0-20261111-b89790712
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/Behavior.d.ts.map +1 -1
- package/dist/cjs/behavior/Behavior.js +2 -0
- package/dist/cjs/behavior/Behavior.js.map +1 -1
- package/dist/cjs/behavior/Events.d.ts.map +1 -1
- package/dist/cjs/behavior/Events.js +4 -2
- package/dist/cjs/behavior/Events.js.map +1 -1
- package/dist/cjs/behavior/cluster/ClusterBehavior.d.ts +17 -3
- package/dist/cjs/behavior/cluster/ClusterBehavior.d.ts.map +1 -1
- package/dist/cjs/behavior/cluster/ClusterBehavior.js +2 -20
- package/dist/cjs/behavior/cluster/ClusterBehavior.js.map +1 -1
- package/dist/cjs/behavior/cluster/ClusterBehaviorType.d.ts.map +1 -1
- package/dist/cjs/behavior/cluster/ClusterBehaviorType.js +8 -150
- package/dist/cjs/behavior/cluster/ClusterBehaviorType.js.map +1 -1
- package/dist/cjs/behavior/internal/BehaviorBacking.d.ts.map +1 -1
- package/dist/cjs/behavior/internal/BehaviorBacking.js +2 -0
- package/dist/cjs/behavior/internal/BehaviorBacking.js.map +1 -1
- package/dist/cjs/behavior/internal/ClusterDerivation.d.ts +45 -0
- package/dist/cjs/behavior/internal/ClusterDerivation.d.ts.map +1 -0
- package/dist/cjs/behavior/internal/ClusterDerivation.js +192 -0
- package/dist/cjs/behavior/internal/ClusterDerivation.js.map +6 -0
- package/dist/cjs/behavior/internal/ClusterStatics.d.ts +16 -0
- package/dist/cjs/behavior/internal/ClusterStatics.d.ts.map +1 -0
- package/dist/cjs/behavior/internal/ClusterStatics.js +138 -0
- package/dist/cjs/behavior/internal/ClusterStatics.js.map +6 -0
- package/dist/cjs/behavior/internal/ModeledState.d.ts +18 -0
- package/dist/cjs/behavior/internal/ModeledState.d.ts.map +1 -0
- package/dist/cjs/behavior/internal/ModeledState.js +54 -0
- package/dist/cjs/behavior/internal/ModeledState.js.map +6 -0
- package/dist/cjs/behavior/internal/ServerBehaviorBacking.d.ts.map +1 -1
- package/dist/cjs/behavior/internal/ServerBehaviorBacking.js +3 -12
- package/dist/cjs/behavior/internal/ServerBehaviorBacking.js.map +1 -1
- package/dist/cjs/behavior/state/managed/Datasource.js +28 -17
- package/dist/cjs/behavior/state/managed/Datasource.js.map +1 -1
- package/dist/cjs/behavior/state/managed/Internal.d.ts +16 -5
- package/dist/cjs/behavior/state/managed/Internal.d.ts.map +1 -1
- package/dist/cjs/behavior/state/managed/Internal.js +23 -25
- package/dist/cjs/behavior/state/managed/Internal.js.map +1 -1
- package/dist/cjs/behavior/state/managed/ManagedReference.d.ts +45 -12
- package/dist/cjs/behavior/state/managed/ManagedReference.d.ts.map +1 -1
- package/dist/cjs/behavior/state/managed/ManagedReference.js +74 -44
- package/dist/cjs/behavior/state/managed/ManagedReference.js.map +1 -1
- package/dist/cjs/behavior/state/managed/ReadOnlyReference.d.ts +31 -0
- package/dist/cjs/behavior/state/managed/ReadOnlyReference.d.ts.map +1 -0
- package/dist/cjs/behavior/state/managed/ReadOnlyReference.js +60 -0
- package/dist/cjs/behavior/state/managed/ReadOnlyReference.js.map +6 -0
- package/dist/cjs/behavior/state/managed/ValReference.d.ts +47 -10
- package/dist/cjs/behavior/state/managed/ValReference.d.ts.map +1 -1
- package/dist/cjs/behavior/state/managed/ValReference.js +29 -0
- package/dist/cjs/behavior/state/managed/ValReference.js.map +2 -2
- package/dist/cjs/behavior/state/managed/values/BitmapManager.js +5 -20
- package/dist/cjs/behavior/state/managed/values/BitmapManager.js.map +1 -1
- package/dist/cjs/behavior/state/managed/values/ListManager.d.ts.map +1 -1
- package/dist/cjs/behavior/state/managed/values/ListManager.js +262 -119
- package/dist/cjs/behavior/state/managed/values/ListManager.js.map +2 -2
- package/dist/cjs/behavior/state/managed/values/StructManager.js +14 -23
- package/dist/cjs/behavior/state/managed/values/StructManager.js.map +2 -2
- package/dist/cjs/behavior/system/commissioning/CommissioningClient.d.ts +13 -3
- package/dist/cjs/behavior/system/commissioning/CommissioningClient.d.ts.map +1 -1
- package/dist/cjs/behavior/system/commissioning/CommissioningClient.js +12 -0
- package/dist/cjs/behavior/system/commissioning/CommissioningClient.js.map +1 -1
- package/dist/cjs/behavior/system/commissioning/RemoteDescriptor.d.ts +9 -1
- package/dist/cjs/behavior/system/commissioning/RemoteDescriptor.d.ts.map +1 -1
- package/dist/cjs/behavior/system/commissioning/RemoteDescriptor.js +9 -0
- package/dist/cjs/behavior/system/commissioning/RemoteDescriptor.js.map +1 -1
- package/dist/cjs/behavior/system/controller/ControllerBehavior.d.ts +2 -1
- package/dist/cjs/behavior/system/controller/ControllerBehavior.d.ts.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/dcl/DclBehavior.d.ts +3 -3
- package/dist/cjs/behavior/system/network/ServerGroupNetworking.d.ts +2 -1
- package/dist/cjs/behavior/system/network/ServerGroupNetworking.d.ts.map +1 -1
- package/dist/cjs/behavior/system/network/ServerGroupNetworking.js.map +1 -1
- package/dist/cjs/behavior/system/sessions/SessionsBehavior.d.ts +4 -0
- package/dist/cjs/behavior/system/sessions/SessionsBehavior.d.ts.map +1 -1
- package/dist/cjs/behavior/system/sessions/SessionsBehavior.js +6 -1
- package/dist/cjs/behavior/system/sessions/SessionsBehavior.js.map +1 -1
- package/dist/cjs/behavior/system/subscriptions/SubscriptionStore.d.ts +28 -0
- package/dist/cjs/behavior/system/subscriptions/SubscriptionStore.d.ts.map +1 -0
- package/dist/cjs/behavior/system/subscriptions/SubscriptionStore.js +74 -0
- package/dist/cjs/behavior/system/subscriptions/SubscriptionStore.js.map +6 -0
- package/dist/cjs/behavior/system/subscriptions/SubscriptionsServer.d.ts +8 -3
- package/dist/cjs/behavior/system/subscriptions/SubscriptionsServer.d.ts.map +1 -1
- package/dist/cjs/behavior/system/subscriptions/SubscriptionsServer.js +61 -30
- package/dist/cjs/behavior/system/subscriptions/SubscriptionsServer.js.map +1 -1
- package/dist/cjs/behaviors/access-control/AccessControlServer.d.ts +2 -2
- package/dist/cjs/behaviors/access-control/AccessControlServer.d.ts.map +1 -1
- package/dist/cjs/behaviors/administrator-commissioning/AdministratorCommissioningServer.d.ts.map +1 -1
- package/dist/cjs/behaviors/administrator-commissioning/AdministratorCommissioningServer.js +43 -21
- package/dist/cjs/behaviors/administrator-commissioning/AdministratorCommissioningServer.js.map +1 -1
- package/dist/cjs/behaviors/general-diagnostics/GeneralDiagnosticsServer.d.ts +29 -23
- package/dist/cjs/behaviors/general-diagnostics/GeneralDiagnosticsServer.d.ts.map +1 -1
- package/dist/cjs/behaviors/general-diagnostics/GeneralDiagnosticsServer.js +104 -60
- package/dist/cjs/behaviors/general-diagnostics/GeneralDiagnosticsServer.js.map +1 -1
- package/dist/cjs/behaviors/group-key-management/GroupKeyManagementServer.d.ts +9 -1
- package/dist/cjs/behaviors/group-key-management/GroupKeyManagementServer.d.ts.map +1 -1
- package/dist/cjs/behaviors/group-key-management/GroupKeyManagementServer.js +11 -7
- package/dist/cjs/behaviors/group-key-management/GroupKeyManagementServer.js.map +1 -1
- package/dist/cjs/behaviors/groupcast/GroupcastServer.d.ts.map +1 -1
- package/dist/cjs/behaviors/groupcast/GroupcastServer.js +41 -25
- package/dist/cjs/behaviors/groupcast/GroupcastServer.js.map +2 -2
- package/dist/cjs/behaviors/localization-configuration/LocalizationConfigurationServer.d.ts +1 -1
- package/dist/cjs/behaviors/localization-configuration/LocalizationConfigurationServer.d.ts.map +1 -1
- package/dist/cjs/behaviors/operational-credentials/VendorIdVerification.d.ts +2 -0
- package/dist/cjs/behaviors/operational-credentials/VendorIdVerification.d.ts.map +1 -1
- package/dist/cjs/behaviors/operational-credentials/VendorIdVerification.js +27 -23
- package/dist/cjs/behaviors/operational-credentials/VendorIdVerification.js.map +1 -1
- package/dist/cjs/behaviors/thermostat/ThermostatServer.d.ts +15 -4
- package/dist/cjs/behaviors/thermostat/ThermostatServer.d.ts.map +1 -1
- package/dist/cjs/behaviors/thermostat/ThermostatServer.js +66 -49
- package/dist/cjs/behaviors/thermostat/ThermostatServer.js.map +1 -1
- package/dist/cjs/behaviors/time-format-localization/TimeFormatLocalizationServer.d.ts +4 -4
- package/dist/cjs/behaviors/time-format-localization/TimeFormatLocalizationServer.d.ts.map +1 -1
- package/dist/cjs/behaviors/time-format-localization/TimeFormatLocalizationServer.js.map +1 -1
- package/dist/cjs/endpoint/properties/Behaviors.d.ts.map +1 -1
- package/dist/cjs/endpoint/properties/Behaviors.js +5 -1
- package/dist/cjs/endpoint/properties/Behaviors.js.map +1 -1
- package/dist/cjs/node/ClientNode.d.ts +6 -0
- package/dist/cjs/node/ClientNode.d.ts.map +1 -1
- package/dist/cjs/node/ClientNode.js +6 -0
- package/dist/cjs/node/ClientNode.js.map +1 -1
- package/dist/cjs/node/ServerNode.d.ts.map +1 -1
- package/dist/cjs/node/ServerNode.js +2 -0
- package/dist/cjs/node/ServerNode.js.map +1 -1
- package/dist/cjs/node/client/ClientEventEmitter.d.ts.map +1 -1
- package/dist/cjs/node/client/ClientEventEmitter.js +6 -2
- package/dist/cjs/node/client/ClientEventEmitter.js.map +1 -1
- package/dist/cjs/node/client/ClientStructure.d.ts.map +1 -1
- package/dist/cjs/node/client/ClientStructure.js +181 -108
- package/dist/cjs/node/client/ClientStructure.js.map +2 -2
- package/dist/cjs/node/client/Peers.d.ts +3 -2
- package/dist/cjs/node/client/Peers.d.ts.map +1 -1
- package/dist/cjs/node/client/Peers.js +8 -9
- package/dist/cjs/node/client/Peers.js.map +1 -1
- package/dist/cjs/node/integration/ChangeNotificationService.d.ts +14 -3
- package/dist/cjs/node/integration/ChangeNotificationService.d.ts.map +1 -1
- package/dist/cjs/node/integration/ProtocolService.d.ts.map +1 -1
- package/dist/cjs/node/integration/ProtocolService.js +38 -56
- package/dist/cjs/node/integration/ProtocolService.js.map +1 -1
- package/dist/cjs/node/server/InteractionServer.d.ts.map +1 -1
- package/dist/cjs/node/server/InteractionServer.js +28 -24
- package/dist/cjs/node/server/InteractionServer.js.map +2 -2
- package/dist/cjs/node/server/ServerSubscription.d.ts +7 -2
- package/dist/cjs/node/server/ServerSubscription.d.ts.map +1 -1
- package/dist/cjs/node/server/ServerSubscription.js +83 -47
- package/dist/cjs/node/server/ServerSubscription.js.map +1 -1
- package/dist/cjs/testing/mock-server-node.d.ts +2 -1
- package/dist/cjs/testing/mock-server-node.d.ts.map +1 -1
- package/dist/cjs/testing/mock-server-node.js +8 -5
- package/dist/cjs/testing/mock-server-node.js.map +2 -2
- package/dist/cjs/testing/node-helpers.d.ts +5 -0
- package/dist/cjs/testing/node-helpers.d.ts.map +1 -1
- package/dist/cjs/testing/node-helpers.js +4 -4
- package/dist/cjs/testing/node-helpers.js.map +1 -1
- package/dist/esm/behavior/Behavior.d.ts.map +1 -1
- package/dist/esm/behavior/Behavior.js +2 -0
- package/dist/esm/behavior/Behavior.js.map +1 -1
- package/dist/esm/behavior/Events.d.ts.map +1 -1
- package/dist/esm/behavior/Events.js +4 -2
- package/dist/esm/behavior/Events.js.map +1 -1
- package/dist/esm/behavior/cluster/ClusterBehavior.d.ts +17 -3
- package/dist/esm/behavior/cluster/ClusterBehavior.d.ts.map +1 -1
- package/dist/esm/behavior/cluster/ClusterBehavior.js +2 -20
- package/dist/esm/behavior/cluster/ClusterBehavior.js.map +1 -1
- package/dist/esm/behavior/cluster/ClusterBehaviorType.d.ts.map +1 -1
- package/dist/esm/behavior/cluster/ClusterBehaviorType.js +10 -159
- package/dist/esm/behavior/cluster/ClusterBehaviorType.js.map +1 -1
- package/dist/esm/behavior/internal/BehaviorBacking.d.ts.map +1 -1
- package/dist/esm/behavior/internal/BehaviorBacking.js +2 -0
- package/dist/esm/behavior/internal/BehaviorBacking.js.map +1 -1
- package/dist/esm/behavior/internal/ClusterDerivation.d.ts +45 -0
- package/dist/esm/behavior/internal/ClusterDerivation.d.ts.map +1 -0
- package/dist/esm/behavior/internal/ClusterDerivation.js +172 -0
- package/dist/esm/behavior/internal/ClusterDerivation.js.map +6 -0
- package/dist/esm/behavior/internal/ClusterStatics.d.ts +16 -0
- package/dist/esm/behavior/internal/ClusterStatics.d.ts.map +1 -0
- package/dist/esm/behavior/internal/ClusterStatics.js +118 -0
- package/dist/esm/behavior/internal/ClusterStatics.js.map +6 -0
- package/dist/esm/behavior/internal/ModeledState.d.ts +18 -0
- package/dist/esm/behavior/internal/ModeledState.d.ts.map +1 -0
- package/dist/esm/behavior/internal/ModeledState.js +34 -0
- package/dist/esm/behavior/internal/ModeledState.js.map +6 -0
- package/dist/esm/behavior/internal/ServerBehaviorBacking.d.ts.map +1 -1
- package/dist/esm/behavior/internal/ServerBehaviorBacking.js +3 -12
- package/dist/esm/behavior/internal/ServerBehaviorBacking.js.map +1 -1
- package/dist/esm/behavior/state/managed/Datasource.js +28 -17
- package/dist/esm/behavior/state/managed/Datasource.js.map +1 -1
- package/dist/esm/behavior/state/managed/Internal.d.ts +16 -5
- package/dist/esm/behavior/state/managed/Internal.d.ts.map +1 -1
- package/dist/esm/behavior/state/managed/Internal.js +23 -25
- package/dist/esm/behavior/state/managed/Internal.js.map +1 -1
- package/dist/esm/behavior/state/managed/ManagedReference.d.ts +45 -12
- package/dist/esm/behavior/state/managed/ManagedReference.d.ts.map +1 -1
- package/dist/esm/behavior/state/managed/ManagedReference.js +75 -45
- package/dist/esm/behavior/state/managed/ManagedReference.js.map +1 -1
- package/dist/esm/behavior/state/managed/ReadOnlyReference.d.ts +31 -0
- package/dist/esm/behavior/state/managed/ReadOnlyReference.d.ts.map +1 -0
- package/dist/esm/behavior/state/managed/ReadOnlyReference.js +40 -0
- package/dist/esm/behavior/state/managed/ReadOnlyReference.js.map +6 -0
- package/dist/esm/behavior/state/managed/ValReference.d.ts +47 -10
- package/dist/esm/behavior/state/managed/ValReference.d.ts.map +1 -1
- package/dist/esm/behavior/state/managed/ValReference.js +25 -0
- package/dist/esm/behavior/state/managed/ValReference.js.map +2 -2
- package/dist/esm/behavior/state/managed/values/BitmapManager.js +6 -21
- package/dist/esm/behavior/state/managed/values/BitmapManager.js.map +1 -1
- package/dist/esm/behavior/state/managed/values/ListManager.d.ts.map +1 -1
- package/dist/esm/behavior/state/managed/values/ListManager.js +264 -129
- package/dist/esm/behavior/state/managed/values/ListManager.js.map +2 -2
- package/dist/esm/behavior/state/managed/values/StructManager.js +15 -24
- package/dist/esm/behavior/state/managed/values/StructManager.js.map +2 -2
- package/dist/esm/behavior/system/commissioning/CommissioningClient.d.ts +13 -3
- package/dist/esm/behavior/system/commissioning/CommissioningClient.d.ts.map +1 -1
- package/dist/esm/behavior/system/commissioning/CommissioningClient.js +12 -0
- package/dist/esm/behavior/system/commissioning/CommissioningClient.js.map +1 -1
- package/dist/esm/behavior/system/commissioning/RemoteDescriptor.d.ts +9 -1
- package/dist/esm/behavior/system/commissioning/RemoteDescriptor.d.ts.map +1 -1
- package/dist/esm/behavior/system/commissioning/RemoteDescriptor.js +10 -1
- package/dist/esm/behavior/system/commissioning/RemoteDescriptor.js.map +1 -1
- package/dist/esm/behavior/system/controller/ControllerBehavior.d.ts +2 -1
- package/dist/esm/behavior/system/controller/ControllerBehavior.d.ts.map +1 -1
- package/dist/esm/behavior/system/controller/ControllerBehavior.js +2 -1
- package/dist/esm/behavior/system/controller/ControllerBehavior.js.map +1 -1
- package/dist/esm/behavior/system/dcl/DclBehavior.d.ts +3 -3
- package/dist/esm/behavior/system/network/ServerGroupNetworking.d.ts +2 -1
- package/dist/esm/behavior/system/network/ServerGroupNetworking.d.ts.map +1 -1
- package/dist/esm/behavior/system/network/ServerGroupNetworking.js.map +1 -1
- package/dist/esm/behavior/system/sessions/SessionsBehavior.d.ts +4 -0
- package/dist/esm/behavior/system/sessions/SessionsBehavior.d.ts.map +1 -1
- package/dist/esm/behavior/system/sessions/SessionsBehavior.js +6 -1
- package/dist/esm/behavior/system/sessions/SessionsBehavior.js.map +1 -1
- package/dist/esm/behavior/system/subscriptions/SubscriptionStore.d.ts +28 -0
- package/dist/esm/behavior/system/subscriptions/SubscriptionStore.d.ts.map +1 -0
- package/dist/esm/behavior/system/subscriptions/SubscriptionStore.js +54 -0
- package/dist/esm/behavior/system/subscriptions/SubscriptionStore.js.map +6 -0
- package/dist/esm/behavior/system/subscriptions/SubscriptionsServer.d.ts +8 -3
- package/dist/esm/behavior/system/subscriptions/SubscriptionsServer.d.ts.map +1 -1
- package/dist/esm/behavior/system/subscriptions/SubscriptionsServer.js +61 -30
- package/dist/esm/behavior/system/subscriptions/SubscriptionsServer.js.map +1 -1
- package/dist/esm/behaviors/access-control/AccessControlServer.d.ts +2 -2
- package/dist/esm/behaviors/access-control/AccessControlServer.d.ts.map +1 -1
- package/dist/esm/behaviors/administrator-commissioning/AdministratorCommissioningServer.d.ts.map +1 -1
- package/dist/esm/behaviors/administrator-commissioning/AdministratorCommissioningServer.js +43 -21
- package/dist/esm/behaviors/administrator-commissioning/AdministratorCommissioningServer.js.map +1 -1
- package/dist/esm/behaviors/general-diagnostics/GeneralDiagnosticsServer.d.ts +29 -23
- package/dist/esm/behaviors/general-diagnostics/GeneralDiagnosticsServer.d.ts.map +1 -1
- package/dist/esm/behaviors/general-diagnostics/GeneralDiagnosticsServer.js +105 -60
- package/dist/esm/behaviors/general-diagnostics/GeneralDiagnosticsServer.js.map +1 -1
- package/dist/esm/behaviors/group-key-management/GroupKeyManagementServer.d.ts +9 -1
- package/dist/esm/behaviors/group-key-management/GroupKeyManagementServer.d.ts.map +1 -1
- package/dist/esm/behaviors/group-key-management/GroupKeyManagementServer.js +11 -7
- package/dist/esm/behaviors/group-key-management/GroupKeyManagementServer.js.map +1 -1
- package/dist/esm/behaviors/groupcast/GroupcastServer.d.ts.map +1 -1
- package/dist/esm/behaviors/groupcast/GroupcastServer.js +42 -25
- package/dist/esm/behaviors/groupcast/GroupcastServer.js.map +2 -2
- package/dist/esm/behaviors/localization-configuration/LocalizationConfigurationServer.d.ts +1 -1
- package/dist/esm/behaviors/localization-configuration/LocalizationConfigurationServer.d.ts.map +1 -1
- package/dist/esm/behaviors/operational-credentials/VendorIdVerification.d.ts +2 -0
- package/dist/esm/behaviors/operational-credentials/VendorIdVerification.d.ts.map +1 -1
- package/dist/esm/behaviors/operational-credentials/VendorIdVerification.js +32 -24
- package/dist/esm/behaviors/operational-credentials/VendorIdVerification.js.map +1 -1
- package/dist/esm/behaviors/thermostat/ThermostatServer.d.ts +15 -4
- package/dist/esm/behaviors/thermostat/ThermostatServer.d.ts.map +1 -1
- package/dist/esm/behaviors/thermostat/ThermostatServer.js +66 -49
- package/dist/esm/behaviors/thermostat/ThermostatServer.js.map +1 -1
- package/dist/esm/behaviors/time-format-localization/TimeFormatLocalizationServer.d.ts +4 -4
- package/dist/esm/behaviors/time-format-localization/TimeFormatLocalizationServer.d.ts.map +1 -1
- package/dist/esm/behaviors/time-format-localization/TimeFormatLocalizationServer.js.map +1 -1
- package/dist/esm/endpoint/properties/Behaviors.d.ts.map +1 -1
- package/dist/esm/endpoint/properties/Behaviors.js +6 -2
- package/dist/esm/endpoint/properties/Behaviors.js.map +1 -1
- package/dist/esm/node/ClientNode.d.ts +6 -0
- package/dist/esm/node/ClientNode.d.ts.map +1 -1
- package/dist/esm/node/ClientNode.js +6 -0
- package/dist/esm/node/ClientNode.js.map +1 -1
- package/dist/esm/node/ServerNode.d.ts.map +1 -1
- package/dist/esm/node/ServerNode.js +2 -0
- package/dist/esm/node/ServerNode.js.map +1 -1
- package/dist/esm/node/client/ClientEventEmitter.d.ts.map +1 -1
- package/dist/esm/node/client/ClientEventEmitter.js +6 -2
- package/dist/esm/node/client/ClientEventEmitter.js.map +1 -1
- package/dist/esm/node/client/ClientStructure.d.ts.map +1 -1
- package/dist/esm/node/client/ClientStructure.js +181 -108
- package/dist/esm/node/client/ClientStructure.js.map +2 -2
- package/dist/esm/node/client/Peers.d.ts +3 -2
- package/dist/esm/node/client/Peers.d.ts.map +1 -1
- package/dist/esm/node/client/Peers.js +8 -10
- package/dist/esm/node/client/Peers.js.map +1 -1
- package/dist/esm/node/integration/ChangeNotificationService.d.ts +14 -3
- package/dist/esm/node/integration/ChangeNotificationService.d.ts.map +1 -1
- package/dist/esm/node/integration/ProtocolService.d.ts.map +1 -1
- package/dist/esm/node/integration/ProtocolService.js +40 -57
- package/dist/esm/node/integration/ProtocolService.js.map +1 -1
- package/dist/esm/node/server/InteractionServer.d.ts.map +1 -1
- package/dist/esm/node/server/InteractionServer.js +28 -25
- package/dist/esm/node/server/InteractionServer.js.map +2 -2
- package/dist/esm/node/server/ServerSubscription.d.ts +7 -2
- package/dist/esm/node/server/ServerSubscription.d.ts.map +1 -1
- package/dist/esm/node/server/ServerSubscription.js +83 -47
- package/dist/esm/node/server/ServerSubscription.js.map +1 -1
- package/dist/esm/testing/mock-server-node.d.ts +2 -1
- package/dist/esm/testing/mock-server-node.d.ts.map +1 -1
- package/dist/esm/testing/mock-server-node.js +16 -7
- package/dist/esm/testing/mock-server-node.js.map +2 -2
- package/dist/esm/testing/node-helpers.d.ts +5 -0
- package/dist/esm/testing/node-helpers.d.ts.map +1 -1
- package/dist/esm/testing/node-helpers.js +4 -4
- package/dist/esm/testing/node-helpers.js.map +1 -1
- package/package.json +6 -6
- package/src/behavior/Behavior.ts +2 -0
- package/src/behavior/Events.ts +6 -3
- package/src/behavior/cluster/ClusterBehavior.ts +22 -13
- package/src/behavior/cluster/ClusterBehaviorType.ts +9 -270
- package/src/behavior/internal/BehaviorBacking.ts +3 -0
- package/src/behavior/internal/ClusterDerivation.ts +295 -0
- package/src/behavior/internal/ClusterStatics.ts +180 -0
- package/src/behavior/internal/ModeledState.ts +58 -0
- package/src/behavior/internal/ServerBehaviorBacking.ts +3 -15
- package/src/behavior/state/managed/Datasource.ts +36 -21
- package/src/behavior/state/managed/Internal.ts +36 -33
- package/src/behavior/state/managed/ManagedReference.ts +120 -68
- package/src/behavior/state/managed/ReadOnlyReference.ts +54 -0
- package/src/behavior/state/managed/ValReference.ts +67 -11
- package/src/behavior/state/managed/values/BitmapManager.ts +6 -22
- package/src/behavior/state/managed/values/ListManager.ts +301 -146
- package/src/behavior/state/managed/values/StructManager.ts +20 -29
- package/src/behavior/system/commissioning/CommissioningClient.ts +22 -3
- package/src/behavior/system/commissioning/RemoteDescriptor.ts +17 -1
- package/src/behavior/system/controller/ControllerBehavior.ts +2 -1
- package/src/behavior/system/dcl/DclBehavior.ts +3 -3
- package/src/behavior/system/network/ServerGroupNetworking.ts +3 -2
- package/src/behavior/system/sessions/SessionsBehavior.ts +8 -2
- package/src/behavior/system/subscriptions/SubscriptionStore.ts +66 -0
- package/src/behavior/system/subscriptions/SubscriptionsServer.ts +73 -33
- package/src/behaviors/access-control/AccessControlServer.ts +3 -3
- package/src/behaviors/administrator-commissioning/AdministratorCommissioningServer.ts +47 -24
- package/src/behaviors/general-diagnostics/GeneralDiagnosticsServer.ts +138 -84
- package/src/behaviors/group-key-management/GroupKeyManagementServer.ts +12 -8
- package/src/behaviors/groupcast/GroupcastServer.ts +50 -34
- package/src/behaviors/localization-configuration/LocalizationConfigurationServer.ts +1 -1
- package/src/behaviors/operational-credentials/VendorIdVerification.ts +50 -35
- package/src/behaviors/thermostat/ThermostatServer.ts +93 -70
- package/src/behaviors/time-format-localization/TimeFormatLocalizationServer.ts +4 -4
- package/src/endpoint/properties/Behaviors.ts +6 -2
- package/src/node/ClientNode.ts +6 -0
- package/src/node/ServerNode.ts +2 -0
- package/src/node/client/ClientEventEmitter.ts +7 -3
- package/src/node/client/ClientStructure.ts +208 -135
- package/src/node/client/Peers.ts +10 -14
- package/src/node/integration/ChangeNotificationService.ts +18 -3
- package/src/node/integration/ProtocolService.ts +45 -57
- package/src/node/server/InteractionServer.ts +33 -35
- package/src/node/server/ServerSubscription.ts +88 -50
- package/src/testing/mock-server-node.ts +22 -9
- package/src/testing/node-helpers.ts +5 -1
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
Fabric,
|
|
28
28
|
FabricManager,
|
|
29
29
|
GroupMessageEventInfo,
|
|
30
|
+
GroupMessageRejection,
|
|
30
31
|
IANA_GROUPCAST_MULTICAST_ADDRESS,
|
|
31
32
|
SessionManager,
|
|
32
33
|
} from "@matter/protocol";
|
|
@@ -262,7 +263,7 @@ export class GroupcastServer extends GroupcastBase {
|
|
|
262
263
|
const existing = gkm.state.groupTable.find(g => g.fabricIndex === fabricIndex && g.groupId === groupId);
|
|
263
264
|
// Snapshot: removeEndpoint mutates the live groupTable endpoints array, which would corrupt this loop.
|
|
264
265
|
const existingEndpoints = [...(existing?.endpoints ?? [])];
|
|
265
|
-
const groupName = existing?.groupName
|
|
266
|
+
const groupName = existing?.groupName;
|
|
266
267
|
const target = replaceEndpoints ? endpoints : [...new Set([...existingEndpoints, ...endpoints])];
|
|
267
268
|
keepsSenderOnly = target.length === 0 && existingEndpoints.length > 0;
|
|
268
269
|
for (const ep of existingEndpoints) {
|
|
@@ -459,50 +460,65 @@ export class GroupcastServer extends GroupcastBase {
|
|
|
459
460
|
return;
|
|
460
461
|
}
|
|
461
462
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
463
|
+
if (info.kind === "authenticated") {
|
|
464
|
+
if (info.fabric.fabricIndex !== fabricUnderTest) {
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
const { result, groupId, endpointId, clusterId, elementId, accessAllowed, sourceIp } = info;
|
|
468
|
+
this.#emitGroupcastTesting(fabricUnderTest, sourceIp, this.#arrivalAddress(fabricUnderTest, groupId), {
|
|
469
|
+
groupcastTestResult: result,
|
|
470
|
+
groupId,
|
|
471
|
+
endpointId,
|
|
472
|
+
clusterId,
|
|
473
|
+
elementId,
|
|
474
|
+
accessAllowed,
|
|
475
|
+
});
|
|
466
476
|
return;
|
|
467
477
|
}
|
|
468
478
|
|
|
469
|
-
//
|
|
470
|
-
//
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
const fabrics = this.env.get(FabricManager);
|
|
480
|
-
if (known && fabrics.has(fabricUnderTest)) {
|
|
481
|
-
destIp = fabrics.for(fabricUnderTest).groups.multicastAddressFor(groupIdForAddress);
|
|
482
|
-
} else {
|
|
483
|
-
destIp = IANA_GROUPCAST_MULTICAST_ADDRESS;
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
// Without any group knowledge (privacy-obfuscated header and no authenticating key set) the IANA address
|
|
487
|
-
// remains the only plausible arrival address
|
|
488
|
-
destIp ??= IANA_GROUPCAST_MULTICAST_ADDRESS;
|
|
479
|
+
// As in the CHIP SDK, a message for which no candidate key passed is reported on the fabric under test, without
|
|
480
|
+
// its group id
|
|
481
|
+
const { group, sourceIp } = info;
|
|
482
|
+
this.#emitGroupcastTesting(
|
|
483
|
+
fabricUnderTest,
|
|
484
|
+
sourceIp,
|
|
485
|
+
this.#arrivalAddress(group?.fabricIndex ?? fabricUnderTest, group?.groupId),
|
|
486
|
+
{ groupcastTestResult: GroupMessageRejection.resultFor(info, fabricUnderTest) },
|
|
487
|
+
);
|
|
488
|
+
}
|
|
489
489
|
|
|
490
|
+
#emitGroupcastTesting(
|
|
491
|
+
fabricIndex: FabricIndex,
|
|
492
|
+
sourceIp: string | undefined,
|
|
493
|
+
destinationIp: string,
|
|
494
|
+
details: Omit<Groupcast.GroupcastTestingEvent, "sourceIpAddress" | "destinationIpAddress" | "fabricIndex">,
|
|
495
|
+
) {
|
|
490
496
|
this.events.groupcastTesting?.emit(
|
|
491
497
|
{
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
clusterId: info.clusterId,
|
|
497
|
-
elementId: info.elementId,
|
|
498
|
-
accessAllowed: info.accessAllowed,
|
|
499
|
-
groupcastTestResult: info.result,
|
|
500
|
-
fabricIndex: fabricUnderTest,
|
|
498
|
+
...details,
|
|
499
|
+
sourceIpAddress: toIpv6EventAddress(sourceIp),
|
|
500
|
+
destinationIpAddress: toIpv6EventAddress(destinationIp),
|
|
501
|
+
fabricIndex,
|
|
501
502
|
},
|
|
502
503
|
this.context,
|
|
503
504
|
);
|
|
504
505
|
}
|
|
505
506
|
|
|
507
|
+
/**
|
|
508
|
+
* The multicast address a message for the group of the owning fabric most likely arrived on. The datagram
|
|
509
|
+
* destination is not available from the socket, so it is derived. {@link ServerGroupNetworking} joins
|
|
510
|
+
* {@link FabricGroups.multicastAddressFor} of each group with an entry in {@link FabricGroups.endpoints}, so a
|
|
511
|
+
* message for any other group, for an unknown group or for a fabric that is gone, most likely arrived on the
|
|
512
|
+
* shared IANA address.
|
|
513
|
+
*/
|
|
514
|
+
#arrivalAddress(owner: FabricIndex, groupId: GroupId | undefined) {
|
|
515
|
+
const groups = this.env.get(FabricManager).maybeFor(owner)?.groups;
|
|
516
|
+
if (groupId === undefined || groups === undefined || !groups.endpoints.has(groupId)) {
|
|
517
|
+
return IANA_GROUPCAST_MULTICAST_ADDRESS;
|
|
518
|
+
}
|
|
519
|
+
return groups.multicastAddressFor(groupId);
|
|
520
|
+
}
|
|
521
|
+
|
|
506
522
|
#handleFabricDeleted(fabric: Fabric) {
|
|
507
523
|
this.internal.pendingFabricCleanups.add(fabric.fabricIndex);
|
|
508
524
|
this.#deriveNow();
|
|
@@ -20,7 +20,14 @@ import {
|
|
|
20
20
|
UnexpectedDataError,
|
|
21
21
|
} from "@matter/general";
|
|
22
22
|
import { Icac, Noc, PeerSet, Rcac, Vvsc } from "@matter/protocol";
|
|
23
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
FabricId,
|
|
25
|
+
FabricIndex,
|
|
26
|
+
ReceivedStatusResponseError,
|
|
27
|
+
StatusResponse,
|
|
28
|
+
ValidationError,
|
|
29
|
+
VendorId,
|
|
30
|
+
} from "@matter/types";
|
|
24
31
|
import type { OperationalCredentials } from "@matter/types/clusters/operational-credentials";
|
|
25
32
|
import { OperationalCredentialsClient } from "../operational-credentials/OperationalCredentialsClient.js";
|
|
26
33
|
|
|
@@ -163,6 +170,8 @@ export namespace VendorIdVerification {
|
|
|
163
170
|
/**
|
|
164
171
|
* Verify VendorId ownership using VID Verification protocol on pure data level
|
|
165
172
|
*
|
|
173
|
+
* Returns `false` when a certificate the peer sent does not decode or its chain does not verify.
|
|
174
|
+
*
|
|
166
175
|
* @see {@link MatterSpecification.v161.Core} § 6.4.10.1.
|
|
167
176
|
*/
|
|
168
177
|
export async function verifyData(
|
|
@@ -184,38 +193,58 @@ export namespace VendorIdVerification {
|
|
|
184
193
|
rcac,
|
|
185
194
|
fabric: { vendorId: rootVendorId, vidVerificationStatement, fabricIndex },
|
|
186
195
|
} = options;
|
|
187
|
-
const {
|
|
188
|
-
subject: { fabricId },
|
|
189
|
-
ellipticCurvePublicKey: rootPublicKey,
|
|
190
|
-
} = Noc.fromTlv(noc).cert;
|
|
191
|
-
|
|
192
|
-
const tbs = dataToSign({
|
|
193
|
-
fabricBindingVersion,
|
|
194
|
-
clientChallenge,
|
|
195
|
-
attChallenge,
|
|
196
|
-
fabricIndex,
|
|
197
|
-
fabric: {
|
|
198
|
-
rootPublicKey,
|
|
199
|
-
fabricId,
|
|
200
|
-
rootVendorId,
|
|
201
|
-
vidVerificationStatement,
|
|
202
|
-
},
|
|
203
|
-
}).signatureData;
|
|
204
196
|
|
|
197
|
+
let tbs: Bytes;
|
|
198
|
+
let vvscCert: Vvsc | undefined;
|
|
205
199
|
try {
|
|
200
|
+
const nocCert = Noc.fromTlv(noc);
|
|
201
|
+
const {
|
|
202
|
+
subject: { fabricId },
|
|
203
|
+
ellipticCurvePublicKey: rootPublicKey,
|
|
204
|
+
} = nocCert.cert;
|
|
205
|
+
|
|
206
|
+
tbs = dataToSign({
|
|
207
|
+
fabricBindingVersion,
|
|
208
|
+
clientChallenge,
|
|
209
|
+
attChallenge,
|
|
210
|
+
fabricIndex,
|
|
211
|
+
fabric: {
|
|
212
|
+
rootPublicKey,
|
|
213
|
+
fabricId,
|
|
214
|
+
rootVendorId,
|
|
215
|
+
vidVerificationStatement,
|
|
216
|
+
},
|
|
217
|
+
}).signatureData;
|
|
218
|
+
|
|
206
219
|
// Validate signature over TBS data
|
|
207
220
|
await crypto.verifyEcdsa(PublicKey(rootPublicKey), tbs, new EcdsaSignature(signature));
|
|
208
221
|
|
|
209
222
|
// Verify Noc cert chain using trusted root
|
|
210
223
|
const rootCert = Rcac.fromTlv(rcac);
|
|
211
|
-
const nocCert = Noc.fromTlv(noc);
|
|
212
224
|
const icaCert = icac ? Icac.fromTlv(icac) : undefined;
|
|
213
225
|
if (icaCert !== undefined) {
|
|
214
226
|
await icaCert.verify(crypto, rootCert);
|
|
215
227
|
}
|
|
216
228
|
await nocCert.verify(crypto, rootCert, icaCert);
|
|
229
|
+
|
|
230
|
+
if (vidVerificationStatement && vvsc !== undefined) {
|
|
231
|
+
vvscCert = Vvsc.fromTlv(vvsc);
|
|
232
|
+
// TODO Gather and Verify the VVSC cert chain using trusted root
|
|
233
|
+
// Validate the path of VIDVerificationSignerCertificate using the certificates in the Operational
|
|
234
|
+
// Trust Anchors Schema under the expected VendorID (VID field) being verified. If
|
|
235
|
+
// the path is invalid (e.g. any element of the chain missing, any certificate malformed, any
|
|
236
|
+
// signature verification fails, etc), then the procedure terminates as failed. Only the self-
|
|
237
|
+
// signed certificates among the set SHALL be considered as trust anchors during certificate
|
|
238
|
+
// path validation. The path length SHALL NOT be longer than 3. The verifier MAY
|
|
239
|
+
// apply knowledge of revoked entities obtained from outside the Distributed Compliance
|
|
240
|
+
// Ledger.
|
|
241
|
+
await vvscCert.verify(crypto);
|
|
242
|
+
}
|
|
217
243
|
} catch (error) {
|
|
218
|
-
|
|
244
|
+
// TLV the peer sent that does not decode, such as a repeated or missing field, fails the verification
|
|
245
|
+
if (!(error instanceof UnexpectedDataError || error instanceof ValidationError)) {
|
|
246
|
+
CryptoError.accept(error);
|
|
247
|
+
}
|
|
219
248
|
logger.warn("Could not verify VendorId: certificate chain verification failed", error);
|
|
220
249
|
return false;
|
|
221
250
|
}
|
|
@@ -231,10 +260,7 @@ export namespace VendorIdVerification {
|
|
|
231
260
|
throw new UnexpectedDataError("VID Verification Statement is missing signature");
|
|
232
261
|
}
|
|
233
262
|
|
|
234
|
-
|
|
235
|
-
if (vvsc !== undefined) {
|
|
236
|
-
vvscCert = Vvsc.fromTlv(vvsc);
|
|
237
|
-
} else {
|
|
263
|
+
if (vvscCert === undefined) {
|
|
238
264
|
// TODO Fetch VVSC from DCL if needed
|
|
239
265
|
// Otherwise, look up the entry in the Operational Trust Anchors Schema
|
|
240
266
|
// under the expected VendorID (VID field) being verified whose IsVIDVerificationSigner
|
|
@@ -253,17 +279,6 @@ export namespace VendorIdVerification {
|
|
|
253
279
|
);
|
|
254
280
|
}
|
|
255
281
|
|
|
256
|
-
// TODO Gather and Verify the VVSC cert chain using trusted root
|
|
257
|
-
// Validate the path of VIDVerificationSignerCertificate using the certificates in the Operational
|
|
258
|
-
// Trust Anchors Schema under the expected VendorID (VID field) being verified. If
|
|
259
|
-
// the path is invalid (e.g. any element of the chain missing, any certificate malformed, any
|
|
260
|
-
// signature verification fails, etc), then the procedure terminates as failed. Only the self-
|
|
261
|
-
// signed certificates among the set SHALL be considered as trust anchors during certificate
|
|
262
|
-
// path validation. The path length SHALL NOT be longer than 3. The verifier MAY
|
|
263
|
-
// apply knowledge of revoked entities obtained from outside the Distributed Compliance
|
|
264
|
-
// Ledger.
|
|
265
|
-
await vvscCert.verify(crypto);
|
|
266
|
-
|
|
267
282
|
const ourStatement = createStatementBytes({
|
|
268
283
|
version: vidStatementVersion,
|
|
269
284
|
fabricBindingMessage: tbs,
|
|
@@ -1292,16 +1292,32 @@ export class ThermostatBaseServer extends ThermostatBehaviorLogicBase {
|
|
|
1292
1292
|
|
|
1293
1293
|
/**
|
|
1294
1294
|
* A stored write is already applied when validation runs, so the presets it replaces are the baseline.
|
|
1295
|
+
*
|
|
1296
|
+
* Pre-commit announces the presets again after any change in flight, with the previous announcement as
|
|
1297
|
+
* `oldPresets`. Every announcement is therefore validated against the presets the first announcement of the
|
|
1298
|
+
* transaction replaces.
|
|
1299
|
+
*
|
|
1300
|
+
* Once initialized, the presets stay stored: a transaction that leaves `persistedPresets` undefined fails with an
|
|
1301
|
+
* {@link ImplementationError}.
|
|
1295
1302
|
*/
|
|
1296
1303
|
#handlePersistedPresetsChanging(
|
|
1297
|
-
newPresets: Thermostat.Preset[],
|
|
1304
|
+
newPresets: Thermostat.Preset[] | undefined,
|
|
1298
1305
|
oldPresets: Thermostat.Preset[] | undefined,
|
|
1299
1306
|
context: ActionContext,
|
|
1300
1307
|
) {
|
|
1308
|
+
if (newPresets === undefined) {
|
|
1309
|
+
throw new ImplementationError(
|
|
1310
|
+
`Cannot clear persistedPresets of ${this.endpoint}; store an empty list to remove all presets`,
|
|
1311
|
+
);
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1301
1314
|
const presets = this.#presetsIn(context);
|
|
1315
|
+
presets.stored ??= { presets: oldPresets };
|
|
1316
|
+
const storedPresets = presets.stored.presets;
|
|
1302
1317
|
|
|
1303
|
-
this.#validatePresetWriteRequest(newPresets,
|
|
1304
|
-
this.#
|
|
1318
|
+
this.#validatePresetWriteRequest(newPresets, storedPresets, presets.handles);
|
|
1319
|
+
this.#normalizePresets(newPresets, storedPresets, presets.handles);
|
|
1320
|
+
this.#validatePresetCommit(newPresets, storedPresets);
|
|
1305
1321
|
|
|
1306
1322
|
if (!presets.validatesOnceSettled) {
|
|
1307
1323
|
context.transaction.addParticipants({
|
|
@@ -1329,8 +1345,12 @@ export class ThermostatBaseServer extends ThermostatBehaviorLogicBase {
|
|
|
1329
1345
|
* What this behavior did to the presets of the transaction in context.
|
|
1330
1346
|
*
|
|
1331
1347
|
* `handles` are the ones this device issued. Normalization mutates the value in flight, so pre-commit announces
|
|
1332
|
-
* the presets again, and an atomic write stores what it staged; both carry handles the
|
|
1333
|
-
* announcement is still validated - the handles are what the client did not supply.
|
|
1348
|
+
* the presets again, and an atomic write stores what it staged; both carry handles the stored presets do not carry.
|
|
1349
|
+
* Every announcement is still validated - the handles are what the client did not supply.
|
|
1350
|
+
*
|
|
1351
|
+
* `stored` holds the presets the transaction replaces, as the first announcement reports them. Later announcements
|
|
1352
|
+
* report the value in flight as the old value instead. `stored` wraps the presets because they are undefined
|
|
1353
|
+
* while the behavior seeds them, and that first announcement still counts as recorded.
|
|
1334
1354
|
*
|
|
1335
1355
|
* `validatesOnceSettled` records that the transaction will check the settled presets. An observer that puts back
|
|
1336
1356
|
* exactly the value it was handed leaves pre-commit nothing to announce, so a revert of the handle this device
|
|
@@ -1367,8 +1387,6 @@ export class ThermostatBaseServer extends ThermostatBehaviorLogicBase {
|
|
|
1367
1387
|
const oldPresetsMap = new Map<string, Thermostat.Preset>();
|
|
1368
1388
|
if (oldPresets !== undefined) {
|
|
1369
1389
|
for (const preset of oldPresets) {
|
|
1370
|
-
// Pre-commit announces the presets again after normalization, so the value this one replaces is the
|
|
1371
|
-
// one a client wrote, where a preset it is adding carries no handle yet
|
|
1372
1390
|
if (preset.presetHandle !== null) {
|
|
1373
1391
|
oldPresetsMap.set(Bytes.toHex(preset.presetHandle), preset);
|
|
1374
1392
|
}
|
|
@@ -1484,14 +1502,12 @@ export class ThermostatBaseServer extends ThermostatBehaviorLogicBase {
|
|
|
1484
1502
|
}
|
|
1485
1503
|
|
|
1486
1504
|
/**
|
|
1487
|
-
*
|
|
1505
|
+
* Refuses a commit that removes a built-in preset or the active preset, once every attribute of the atomic write is
|
|
1506
|
+
* staged, so the failure names the presets attribute. The staged value is a copy the store does not keep, so it is
|
|
1507
|
+
* checked, not normalized; pre-commit normalizes the stored value.
|
|
1488
1508
|
*/
|
|
1489
|
-
#handlePresetsAtomicChanged(
|
|
1490
|
-
newPresets
|
|
1491
|
-
oldPresets: Thermostat.Preset[] | undefined,
|
|
1492
|
-
context: ActionContext,
|
|
1493
|
-
) {
|
|
1494
|
-
this.#normalizeAndValidatePresetCommit(newPresets, oldPresets, this.#presetsIn(context).handles);
|
|
1509
|
+
#handlePresetsAtomicChanged(newPresets: Thermostat.Preset[], oldPresets: Thermostat.Preset[] | undefined) {
|
|
1510
|
+
this.#validatePresetCommit(newPresets, oldPresets);
|
|
1495
1511
|
}
|
|
1496
1512
|
|
|
1497
1513
|
/**
|
|
@@ -1503,71 +1519,49 @@ export class ThermostatBaseServer extends ThermostatBehaviorLogicBase {
|
|
|
1503
1519
|
}
|
|
1504
1520
|
|
|
1505
1521
|
/**
|
|
1506
|
-
* Assigns a handle to any preset lacking one and
|
|
1522
|
+
* Assigns a handle to any preset lacking one and resolves a null `builtIn` from the stored preset with that handle.
|
|
1523
|
+
* Normalizes in place: the report that follows reads the presets back through the attribute's accessor.
|
|
1507
1524
|
*/
|
|
1508
|
-
#
|
|
1525
|
+
#normalizePresets(
|
|
1509
1526
|
newPresets: Thermostat.Preset[],
|
|
1510
1527
|
oldPresets: Thermostat.Preset[] | undefined,
|
|
1511
1528
|
issuedHandles: Set<string>,
|
|
1512
1529
|
) {
|
|
1513
|
-
if (oldPresets === undefined) {
|
|
1514
|
-
logger.debug(
|
|
1515
|
-
"Old presets is undefined, skipping some checks. This should only happen on setup of the behavior.",
|
|
1516
|
-
);
|
|
1517
|
-
}
|
|
1518
|
-
|
|
1519
1530
|
const entropy = this.endpoint.env.get(Entropy);
|
|
1520
|
-
const newPresetHandles = new Set<string>();
|
|
1521
1531
|
|
|
1522
|
-
// Normalized in place: the report that follows reads these back through the attribute's accessor
|
|
1523
1532
|
for (const preset of newPresets) {
|
|
1524
1533
|
if (preset.presetHandle == null) {
|
|
1525
1534
|
logger.debug("Preset is missing presetHandle, generating a new one");
|
|
1526
1535
|
preset.presetHandle = entropy.randomBytes(16);
|
|
1527
1536
|
issuedHandles.add(Bytes.toHex(preset.presetHandle));
|
|
1528
1537
|
}
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
if (preset.builtIn === null) {
|
|
1536
|
-
const oldPreset = oldPresets.find(
|
|
1537
|
-
p =>
|
|
1538
|
-
p.presetHandle &&
|
|
1539
|
-
preset.presetHandle &&
|
|
1540
|
-
Bytes.areEqual(p.presetHandle, preset.presetHandle),
|
|
1541
|
-
);
|
|
1542
|
-
if (oldPreset !== undefined) {
|
|
1543
|
-
preset.builtIn = oldPreset.builtIn;
|
|
1544
|
-
} else {
|
|
1545
|
-
preset.builtIn = false;
|
|
1546
|
-
}
|
|
1547
|
-
}
|
|
1538
|
+
if (preset.builtIn === null) {
|
|
1539
|
+
const { presetHandle } = preset;
|
|
1540
|
+
const oldPreset = oldPresets?.find(
|
|
1541
|
+
p => p.presetHandle !== null && Bytes.areEqual(p.presetHandle, presetHandle),
|
|
1542
|
+
);
|
|
1543
|
+
preset.builtIn = oldPreset?.builtIn ?? false;
|
|
1548
1544
|
}
|
|
1549
1545
|
}
|
|
1546
|
+
}
|
|
1550
1547
|
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
const
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
oldBuildInPresets.add(Bytes.toHex(preset.presetHandle));
|
|
1562
|
-
}
|
|
1548
|
+
/**
|
|
1549
|
+
* Refuses presets that drop a built-in preset or the active preset. Checks handles only, so it needs no
|
|
1550
|
+
* normalization: {@link #validatePresetWriteRequest} already refused a preset whose `builtIn` differs from the
|
|
1551
|
+
* stored one, and a preset without a handle is new.
|
|
1552
|
+
*/
|
|
1553
|
+
#validatePresetCommit(newPresets: Thermostat.Preset[], oldPresets: Thermostat.Preset[] | undefined) {
|
|
1554
|
+
const newPresetHandles = new Set<string>();
|
|
1555
|
+
for (const { presetHandle } of newPresets) {
|
|
1556
|
+
if (presetHandle != null) {
|
|
1557
|
+
newPresetHandles.add(Bytes.toHex(presetHandle));
|
|
1563
1558
|
}
|
|
1564
1559
|
}
|
|
1565
1560
|
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
if (!newBuildInPresets.has(oldBuiltInPreset)) {
|
|
1561
|
+
for (const { presetHandle, builtIn } of oldPresets ?? []) {
|
|
1562
|
+
if (builtIn && presetHandle !== null && !newPresetHandles.has(Bytes.toHex(presetHandle))) {
|
|
1569
1563
|
throw new StatusResponse.ConstraintErrorError(
|
|
1570
|
-
`Cannot remove built-in preset with presetHandle ${
|
|
1564
|
+
`Cannot remove built-in preset with presetHandle ${Bytes.toHex(presetHandle)}`,
|
|
1571
1565
|
);
|
|
1572
1566
|
}
|
|
1573
1567
|
}
|
|
@@ -1691,12 +1685,13 @@ export namespace ThermostatBaseServer {
|
|
|
1691
1685
|
return pendingValue as Thermostat.Preset[];
|
|
1692
1686
|
}
|
|
1693
1687
|
|
|
1694
|
-
|
|
1695
|
-
state.persistedPresets
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1688
|
+
if (state.persistedPresets !== undefined) {
|
|
1689
|
+
return state.persistedPresets;
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
const internal = endpoint.behaviors.internalsOf(ThermostatBaseServer);
|
|
1693
|
+
return (internal.defaultPresets ??=
|
|
1694
|
+
configuredPresets(endpoint) ?? presetsIn(thermostat.defaults) ?? []);
|
|
1700
1695
|
},
|
|
1701
1696
|
|
|
1702
1697
|
set(value: Thermostat.Preset[]) {
|
|
@@ -1727,9 +1722,21 @@ export namespace ThermostatBaseServer {
|
|
|
1727
1722
|
Observable<[value: number, oldValue: number, context: ActionContext]>();
|
|
1728
1723
|
externallyMeasuredOccupancy$Changed = Observable<[value: boolean, oldValue: boolean, context: ActionContext]>();
|
|
1729
1724
|
persistedPresets$Changed =
|
|
1730
|
-
Observable<
|
|
1725
|
+
Observable<
|
|
1726
|
+
[
|
|
1727
|
+
value: Thermostat.Preset[] | undefined,
|
|
1728
|
+
oldValue: Thermostat.Preset[] | undefined,
|
|
1729
|
+
context: ActionContext,
|
|
1730
|
+
]
|
|
1731
|
+
>();
|
|
1731
1732
|
persistedPresets$Changing =
|
|
1732
|
-
Observable<
|
|
1733
|
+
Observable<
|
|
1734
|
+
[
|
|
1735
|
+
value: Thermostat.Preset[] | undefined,
|
|
1736
|
+
oldValue: Thermostat.Preset[] | undefined,
|
|
1737
|
+
context: ActionContext,
|
|
1738
|
+
]
|
|
1739
|
+
>();
|
|
1733
1740
|
|
|
1734
1741
|
/**
|
|
1735
1742
|
* Custom event emitted when the calibrated temperature changes.
|
|
@@ -1776,13 +1783,29 @@ export namespace ThermostatBaseServer {
|
|
|
1776
1783
|
controlSequenceOfOperation!: Thermostat.ControlSequenceOfOperation;
|
|
1777
1784
|
|
|
1778
1785
|
/**
|
|
1779
|
-
*
|
|
1780
|
-
*
|
|
1786
|
+
* The presets the `presets` getter serves until `persistedPresets` is set. One copy, because a getter returns
|
|
1787
|
+
* the same list on every read (see {@link Val.Dynamic}).
|
|
1788
|
+
*
|
|
1789
|
+
* After initialization the getter serves it only inside a transaction that sets `persistedPresets` to
|
|
1790
|
+
* undefined, which cannot commit unless it stores presets again.
|
|
1791
|
+
*/
|
|
1792
|
+
defaultPresets?: Thermostat.Preset[];
|
|
1793
|
+
|
|
1794
|
+
/**
|
|
1795
|
+
* What this behavior did to the presets of each transaction in flight: the handles it issued, the presets the
|
|
1796
|
+
* transaction replaces, and whether it enlisted the check of the settled presets.
|
|
1781
1797
|
*
|
|
1782
1798
|
* Several transactions reach one endpoint at a time: an atomic write announces its staged presets before it
|
|
1783
1799
|
* takes any lock.
|
|
1784
1800
|
*/
|
|
1785
|
-
presetTransactions = new WeakMap<
|
|
1801
|
+
presetTransactions = new WeakMap<
|
|
1802
|
+
Transaction,
|
|
1803
|
+
{
|
|
1804
|
+
handles: Set<string>;
|
|
1805
|
+
stored?: { presets: Thermostat.Preset[] | undefined };
|
|
1806
|
+
validatesOnceSettled?: boolean;
|
|
1807
|
+
}
|
|
1808
|
+
>();
|
|
1786
1809
|
}
|
|
1787
1810
|
}
|
|
1788
1811
|
|
|
@@ -27,7 +27,7 @@ export class TimeFormatLocalizationServer extends TimeFormatLocalizationBehavior
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/** Override this getter with own implementation to detect the hour format of the system. */
|
|
30
|
-
get detectedHourFormat() {
|
|
30
|
+
get detectedHourFormat(): TimeFormatLocalization.HourFormat {
|
|
31
31
|
if (Intl.DateTimeFormat(undefined, { hour: "numeric" }).resolvedOptions().hour12) {
|
|
32
32
|
return TimeFormatLocalization.HourFormat["12Hr"];
|
|
33
33
|
}
|
|
@@ -35,7 +35,7 @@ export class TimeFormatLocalizationServer extends TimeFormatLocalizationBehavior
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/** Override this getter with own implementation to detect the calendar type of the system. */
|
|
38
|
-
get detectedCalendarType() {
|
|
38
|
+
get detectedCalendarType(): TimeFormatLocalization.CalendarType {
|
|
39
39
|
const type = Intl.DateTimeFormat().resolvedOptions().calendar;
|
|
40
40
|
switch (type) {
|
|
41
41
|
case "buddhist":
|
|
@@ -83,7 +83,7 @@ export class TimeFormatLocalizationServer extends TimeFormatLocalizationBehavior
|
|
|
83
83
|
|
|
84
84
|
export namespace TimeFormatLocalizationServer {
|
|
85
85
|
export declare const ExtensionInterface: {
|
|
86
|
-
detectedHourFormat:
|
|
87
|
-
detectedCalendarType:
|
|
86
|
+
get detectedHourFormat(): TimeFormatLocalization.HourFormat;
|
|
87
|
+
get detectedCalendarType(): TimeFormatLocalization.CalendarType;
|
|
88
88
|
};
|
|
89
89
|
}
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
Transaction,
|
|
29
29
|
UnexpectedDataError,
|
|
30
30
|
} from "@matter/general";
|
|
31
|
-
import { ClusterModel } from "@matter/model";
|
|
31
|
+
import { ClusterModel, SecretRedaction } from "@matter/model";
|
|
32
32
|
import { ClusterTypeProtocol, Val } from "@matter/protocol";
|
|
33
33
|
import type { ClusterId, ClusterType } from "@matter/types";
|
|
34
34
|
import type { Agent } from "../Agent.js";
|
|
@@ -148,6 +148,7 @@ export class Behaviors {
|
|
|
148
148
|
|
|
149
149
|
if (elements.attributes.size) {
|
|
150
150
|
const behaviorData = new Array<unknown>();
|
|
151
|
+
const attributeModels = schema instanceof ClusterModel ? schema.attributes : undefined;
|
|
151
152
|
for (const attributeName of elements.attributes) {
|
|
152
153
|
const attr = cluster.attributes?.[attributeName];
|
|
153
154
|
if (attr) {
|
|
@@ -155,7 +156,10 @@ export class Behaviors {
|
|
|
155
156
|
attributeName,
|
|
156
157
|
Diagnostic.dict({
|
|
157
158
|
id: Diagnostic.hex(attr.id),
|
|
158
|
-
val: (
|
|
159
|
+
val: SecretRedaction.redact(
|
|
160
|
+
attributeModels?.(attr.id) ?? attr.schema,
|
|
161
|
+
(backing?.stateView as Val.Struct | undefined)?.[attributeName],
|
|
162
|
+
),
|
|
159
163
|
flags: Diagnostic.asFlags({
|
|
160
164
|
fabricScoped: attr.schema.fabricScoped,
|
|
161
165
|
}),
|
package/src/node/ClientNode.ts
CHANGED
|
@@ -350,6 +350,12 @@ export class ClientNode extends Node<ClientNode.RootEndpoint> {
|
|
|
350
350
|
return this.#interaction;
|
|
351
351
|
}
|
|
352
352
|
|
|
353
|
+
/**
|
|
354
|
+
* The peer's operational address, or `undefined` if the peer is not commissioned or its storage is not available.
|
|
355
|
+
*
|
|
356
|
+
* Reads the commissioning state when it is loaded, otherwise a cached value or storage. So it also answers for a
|
|
357
|
+
* node whose commissioning state failed to load.
|
|
358
|
+
*/
|
|
353
359
|
get peerAddress(): PeerAddress | undefined {
|
|
354
360
|
// Whenever the commissioning backing is loaded its state is authoritative - mirror it (set or cleared)
|
|
355
361
|
// so the cache cannot survive a decommission as a stale value
|
package/src/node/ServerNode.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { ServerNetworkRuntime } from "#behavior/system/network/ServerNetworkRunt
|
|
|
12
12
|
import { ProductDescriptionServer } from "#behavior/system/product-description/ProductDescriptionServer.js";
|
|
13
13
|
import { SessionsBehavior } from "#behavior/system/sessions/SessionsBehavior.js";
|
|
14
14
|
import { SubscriptionsServer } from "#behavior/system/subscriptions/SubscriptionsServer.js";
|
|
15
|
+
import { SubscriptionStore } from "#behavior/system/subscriptions/SubscriptionStore.js";
|
|
15
16
|
import { Endpoint } from "#endpoint/Endpoint.js";
|
|
16
17
|
import { EndpointInitializer } from "#endpoint/properties/EndpointInitializer.js";
|
|
17
18
|
import { ServerNodeStore } from "#storage/server/ServerNodeStore.js";
|
|
@@ -248,6 +249,7 @@ export class ServerNode<T extends ServerNode.RootEndpoint = ServerNode.RootEndpo
|
|
|
248
249
|
() => this.env.get(SessionManager).clear(),
|
|
249
250
|
() => this.env.get(FabricManager).clear(),
|
|
250
251
|
() => this.env.get(OccurrenceManager).clear(),
|
|
252
|
+
() => this.env.get(SubscriptionStore).clear(),
|
|
251
253
|
() => ServerEnvironment.eraseCredentials(this),
|
|
252
254
|
() => this.env.get(ServerNodeStore).erase(),
|
|
253
255
|
],
|
|
@@ -61,12 +61,13 @@ export function ClientEventEmitter(node: ClientNode, structure: ClientStructure)
|
|
|
61
61
|
|
|
62
62
|
const behavior = target.endpoint.behaviors.supported[names.cluster];
|
|
63
63
|
if (behavior) {
|
|
64
|
-
const { number, timestamp, priority, value } = occurrence;
|
|
64
|
+
const { number, timestamp, resolvedTimestamp, priority, value } = occurrence;
|
|
65
65
|
const timestampKind = timestampKindOf(occurrence);
|
|
66
66
|
changes.broadcastEvent(target.endpoint, behavior, target.event.schema as EventModel, {
|
|
67
67
|
number,
|
|
68
68
|
timestamp: timestamp as Timestamp,
|
|
69
69
|
timestampKind,
|
|
70
|
+
resolvedTimestamp,
|
|
70
71
|
priority,
|
|
71
72
|
payload: value as Val.Struct | undefined,
|
|
72
73
|
});
|
|
@@ -107,11 +108,14 @@ export function ClientEventEmitter(node: ClientNode, structure: ClientStructure)
|
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
/**
|
|
110
|
-
* Identify which of the four timestamp variants Matter Core §10.
|
|
111
|
+
* Identify which of the four timestamp variants Matter Core §10.6.9 defines the peer sent. Absent all of them the
|
|
111
112
|
* occurrence carries {@link ReadResult.EventValue.timestamp} 0, which is a Posix epoch of no useful precision.
|
|
112
113
|
*/
|
|
113
114
|
function timestampKindOf(occurrence: ReadResult.EventValue): ChangeNotificationService.TimestampKind {
|
|
114
|
-
const { systemTimestamp, deltaEpochTimestamp, deltaSystemTimestamp } = occurrence;
|
|
115
|
+
const { epochTimestamp, systemTimestamp, deltaEpochTimestamp, deltaSystemTimestamp } = occurrence;
|
|
116
|
+
if (epochTimestamp !== undefined) {
|
|
117
|
+
return "epoch";
|
|
118
|
+
}
|
|
115
119
|
if (systemTimestamp !== undefined) {
|
|
116
120
|
return "system";
|
|
117
121
|
}
|