@matter/node 0.18.0 → 0.18.1-alpha.0-20261111-b84c5d1bc
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/context/server/LocalActorContext.d.ts +1 -1
- package/dist/cjs/behavior/context/server/LocalActorContext.d.ts.map +1 -1
- package/dist/cjs/behavior/internal/BehaviorBacking.d.ts +2 -2
- 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 +1 -1
- 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.d.ts +54 -10
- package/dist/cjs/behavior/state/managed/Datasource.d.ts.map +1 -1
- package/dist/cjs/behavior/state/managed/Datasource.js +107 -38
- package/dist/cjs/behavior/state/managed/Datasource.js.map +1 -1
- package/dist/cjs/behavior/state/managed/Internal.d.ts +20 -5
- package/dist/cjs/behavior/state/managed/Internal.d.ts.map +1 -1
- package/dist/cjs/behavior/state/managed/Internal.js +28 -26
- package/dist/cjs/behavior/state/managed/Internal.js.map +1 -1
- package/dist/cjs/behavior/state/managed/ManagedReference.d.ts +56 -12
- package/dist/cjs/behavior/state/managed/ManagedReference.d.ts.map +1 -1
- package/dist/cjs/behavior/state/managed/ManagedReference.js +103 -43
- package/dist/cjs/behavior/state/managed/ManagedReference.js.map +1 -1
- package/dist/cjs/behavior/state/managed/NameResolver.js +1 -1
- package/dist/cjs/behavior/state/managed/NameResolver.js.map +1 -1
- package/dist/cjs/behavior/state/managed/ReadOnlyReference.d.ts +33 -0
- package/dist/cjs/behavior/state/managed/ReadOnlyReference.d.ts.map +1 -0
- package/dist/cjs/behavior/state/{validation/peer-forwarding.js → managed/ReadOnlyReference.js} +36 -17
- package/dist/cjs/behavior/state/managed/ReadOnlyReference.js.map +6 -0
- package/dist/cjs/behavior/state/managed/ValReference.d.ts +80 -13
- package/dist/cjs/behavior/state/managed/ValReference.d.ts.map +1 -1
- package/dist/cjs/behavior/state/managed/ValReference.js +32 -0
- package/dist/cjs/behavior/state/managed/ValReference.js.map +2 -2
- package/dist/cjs/behavior/state/managed/errors.d.ts +25 -0
- package/dist/cjs/behavior/state/managed/errors.d.ts.map +1 -0
- package/dist/cjs/behavior/state/{validation/FabricIndexSentinel.js → managed/errors.js} +15 -10
- package/dist/cjs/behavior/state/managed/errors.js.map +6 -0
- package/dist/cjs/behavior/state/managed/index.d.ts +1 -0
- package/dist/cjs/behavior/state/managed/index.d.ts.map +1 -1
- package/dist/cjs/behavior/state/managed/index.js +1 -0
- package/dist/cjs/behavior/state/managed/index.js.map +1 -1
- 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 +0 -5
- package/dist/cjs/behavior/state/managed/values/ListManager.d.ts.map +1 -1
- package/dist/cjs/behavior/state/managed/values/ListManager.js +274 -133
- package/dist/cjs/behavior/state/managed/values/ListManager.js.map +2 -2
- package/dist/cjs/behavior/state/managed/values/StructManager.d.ts.map +1 -1
- package/dist/cjs/behavior/state/managed/values/StructManager.js +30 -35
- package/dist/cjs/behavior/state/managed/values/StructManager.js.map +2 -2
- package/dist/cjs/behavior/state/managed/values/ValuePatcher.d.ts +8 -0
- package/dist/cjs/behavior/state/managed/values/ValuePatcher.d.ts.map +1 -1
- package/dist/cjs/behavior/state/managed/values/ValuePatcher.js +13 -2
- package/dist/cjs/behavior/state/managed/values/ValuePatcher.js.map +1 -1
- package/dist/cjs/behavior/state/validation/FabricIndexField.d.ts +30 -0
- package/dist/cjs/behavior/state/validation/FabricIndexField.d.ts.map +1 -0
- package/dist/cjs/behavior/state/validation/FabricIndexField.js +53 -0
- package/dist/cjs/behavior/state/validation/FabricIndexField.js.map +6 -0
- package/dist/cjs/behavior/state/validation/ValueValidator.d.ts.map +1 -1
- package/dist/cjs/behavior/state/validation/ValueValidator.js +16 -36
- package/dist/cjs/behavior/state/validation/ValueValidator.js.map +1 -1
- package/dist/cjs/behavior/state/validation/conformance.d.ts.map +1 -1
- package/dist/cjs/behavior/state/validation/conformance.js +6 -5
- package/dist/cjs/behavior/state/validation/conformance.js.map +1 -1
- package/dist/cjs/behavior/state/validation/constraint.d.ts.map +1 -1
- package/dist/cjs/behavior/state/validation/constraint.js +3 -1
- package/dist/cjs/behavior/state/validation/constraint.js.map +1 -1
- package/dist/cjs/behavior/state/validation/location.d.ts +6 -0
- package/dist/cjs/behavior/state/validation/location.d.ts.map +1 -1
- package/dist/cjs/behavior/state/validation/remote-validation.d.ts +57 -0
- package/dist/cjs/behavior/state/validation/remote-validation.d.ts.map +1 -0
- package/dist/cjs/behavior/state/validation/remote-validation.js +63 -0
- package/dist/cjs/behavior/state/validation/remote-validation.js.map +6 -0
- package/dist/cjs/behavior/supervision/Supervision.d.ts.map +1 -1
- package/dist/cjs/behavior/supervision/Supervision.js +1 -1
- package/dist/cjs/behavior/supervision/Supervision.js.map +1 -1
- package/dist/cjs/behavior/supervision/SupervisionConfig.d.ts.map +1 -1
- package/dist/cjs/behavior/supervision/SupervisionConfig.js +1 -1
- package/dist/cjs/behavior/supervision/SupervisionConfig.js.map +1 -1
- package/dist/cjs/behavior/supervision/ValueSupervisor.d.ts +3 -12
- package/dist/cjs/behavior/supervision/ValueSupervisor.d.ts.map +1 -1
- package/dist/cjs/behavior/system/commissioning/CommissioningClient.d.ts +57 -6
- package/dist/cjs/behavior/system/commissioning/CommissioningClient.d.ts.map +1 -1
- package/dist/cjs/behavior/system/commissioning/CommissioningClient.js +86 -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/remote/api/ApiResource.d.ts +14 -0
- package/dist/cjs/behavior/system/remote/api/ApiResource.d.ts.map +1 -1
- package/dist/cjs/behavior/system/remote/api/ApiResource.js +19 -0
- package/dist/cjs/behavior/system/remote/api/ApiResource.js.map +1 -1
- package/dist/cjs/behavior/system/remote/api/Envelope.d.ts +4 -2
- package/dist/cjs/behavior/system/remote/api/Envelope.d.ts.map +1 -1
- package/dist/cjs/behavior/system/remote/api/Envelope.js +7 -5
- package/dist/cjs/behavior/system/remote/api/Envelope.js.map +1 -1
- package/dist/cjs/behavior/system/remote/api/resources/CommandResource.js +2 -2
- package/dist/cjs/behavior/system/remote/api/resources/CommandResource.js.map +1 -1
- package/dist/cjs/behavior/system/remote/api/resources/NodeResource.d.ts +1 -0
- package/dist/cjs/behavior/system/remote/api/resources/NodeResource.d.ts.map +1 -1
- package/dist/cjs/behavior/system/remote/api/resources/NodeResource.js +3 -0
- package/dist/cjs/behavior/system/remote/api/resources/NodeResource.js.map +1 -1
- package/dist/cjs/behavior/system/remote/api/resources/PropertyResource.d.ts.map +1 -1
- package/dist/cjs/behavior/system/remote/api/resources/PropertyResource.js +5 -3
- package/dist/cjs/behavior/system/remote/api/resources/PropertyResource.js.map +1 -1
- package/dist/cjs/behavior/system/remote/api/resources/ServerNodeResource.d.ts.map +1 -1
- package/dist/cjs/behavior/system/remote/api/resources/ServerNodeResource.js +2 -11
- package/dist/cjs/behavior/system/remote/api/resources/ServerNodeResource.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/localization-configuration/LocalizationConfigurationServer.js +15 -4
- package/dist/cjs/behaviors/localization-configuration/LocalizationConfigurationServer.js.map +2 -2
- 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 +19 -5
- package/dist/cjs/behaviors/time-format-localization/TimeFormatLocalizationServer.js.map +2 -2
- package/dist/cjs/behaviors/unit-localization/UnitLocalizationServer.d.ts.map +1 -1
- package/dist/cjs/behaviors/unit-localization/UnitLocalizationServer.js +13 -3
- package/dist/cjs/behaviors/unit-localization/UnitLocalizationServer.js.map +1 -1
- package/dist/cjs/endpoint/Endpoint.d.ts +5 -9
- package/dist/cjs/endpoint/Endpoint.d.ts.map +1 -1
- package/dist/cjs/endpoint/Endpoint.js +4 -23
- package/dist/cjs/endpoint/Endpoint.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 +25 -0
- package/dist/cjs/node/ClientNode.d.ts.map +1 -1
- package/dist/cjs/node/ClientNode.js +41 -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/ClientCommandMethod.d.ts.map +1 -1
- package/dist/cjs/node/client/ClientCommandMethod.js +3 -15
- package/dist/cjs/node/client/ClientCommandMethod.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 +18 -6
- package/dist/cjs/node/client/Peers.d.ts.map +1 -1
- package/dist/cjs/node/client/Peers.js +29 -13
- 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/storage/EndpointStore.d.ts +1 -1
- package/dist/cjs/storage/EndpointStore.js +1 -1
- package/dist/cjs/storage/client/ClientEndpointStore.d.ts +2 -2
- package/dist/cjs/storage/client/ClientEndpointStore.d.ts.map +1 -1
- package/dist/cjs/storage/client/ClientEndpointStore.js +1 -1
- package/dist/cjs/storage/client/DatasourceCache.d.ts +5 -3
- package/dist/cjs/storage/client/DatasourceCache.d.ts.map +1 -1
- package/dist/cjs/storage/client/DatasourceCache.js +68 -71
- package/dist/cjs/storage/client/DatasourceCache.js.map +1 -1
- package/dist/cjs/storage/client/FabricScopedListWrite.d.ts +73 -0
- package/dist/cjs/storage/client/FabricScopedListWrite.d.ts.map +1 -0
- package/dist/cjs/storage/client/FabricScopedListWrite.js +168 -0
- package/dist/cjs/storage/client/FabricScopedListWrite.js.map +6 -0
- package/dist/cjs/storage/client/RemoteWriteParticipant.d.ts +9 -6
- package/dist/cjs/storage/client/RemoteWriteParticipant.d.ts.map +1 -1
- package/dist/cjs/storage/client/RemoteWriteParticipant.js +11 -15
- package/dist/cjs/storage/client/RemoteWriteParticipant.js.map +1 -1
- package/dist/cjs/storage/client/RemoteWriter.d.ts +67 -7
- package/dist/cjs/storage/client/RemoteWriter.d.ts.map +1 -1
- package/dist/cjs/storage/client/RemoteWriter.js +61 -13
- package/dist/cjs/storage/client/RemoteWriter.js.map +1 -1
- package/dist/cjs/storage/server/DatasourceStore.d.ts +2 -2
- package/dist/cjs/storage/server/DatasourceStore.d.ts.map +1 -1
- package/dist/cjs/storage/server/DatasourceStore.js.map +1 -1
- package/dist/cjs/storage/server/ServerEndpointStore.d.ts +2 -2
- package/dist/cjs/storage/server/ServerEndpointStore.d.ts.map +1 -1
- package/dist/cjs/storage/server/ServerEndpointStore.js +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/context/server/LocalActorContext.d.ts +1 -1
- package/dist/esm/behavior/context/server/LocalActorContext.d.ts.map +1 -1
- package/dist/esm/behavior/internal/BehaviorBacking.d.ts +2 -2
- 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 +1 -1
- 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.d.ts +54 -10
- package/dist/esm/behavior/state/managed/Datasource.d.ts.map +1 -1
- package/dist/esm/behavior/state/managed/Datasource.js +107 -38
- package/dist/esm/behavior/state/managed/Datasource.js.map +1 -1
- package/dist/esm/behavior/state/managed/Internal.d.ts +20 -5
- package/dist/esm/behavior/state/managed/Internal.d.ts.map +1 -1
- package/dist/esm/behavior/state/managed/Internal.js +28 -26
- package/dist/esm/behavior/state/managed/Internal.js.map +1 -1
- package/dist/esm/behavior/state/managed/ManagedReference.d.ts +56 -12
- package/dist/esm/behavior/state/managed/ManagedReference.d.ts.map +1 -1
- package/dist/esm/behavior/state/managed/ManagedReference.js +103 -43
- package/dist/esm/behavior/state/managed/ManagedReference.js.map +1 -1
- package/dist/esm/behavior/state/managed/NameResolver.js +1 -1
- package/dist/esm/behavior/state/managed/NameResolver.js.map +1 -1
- package/dist/esm/behavior/state/managed/ReadOnlyReference.d.ts +33 -0
- package/dist/esm/behavior/state/managed/ReadOnlyReference.d.ts.map +1 -0
- package/dist/esm/behavior/state/managed/ReadOnlyReference.js +45 -0
- package/dist/esm/behavior/state/managed/ReadOnlyReference.js.map +6 -0
- package/dist/esm/behavior/state/managed/ValReference.d.ts +80 -13
- package/dist/esm/behavior/state/managed/ValReference.d.ts.map +1 -1
- package/dist/esm/behavior/state/managed/ValReference.js +28 -0
- package/dist/esm/behavior/state/managed/ValReference.js.map +2 -2
- package/dist/esm/behavior/state/managed/errors.d.ts +25 -0
- package/dist/esm/behavior/state/managed/errors.d.ts.map +1 -0
- package/dist/esm/behavior/state/managed/errors.js +20 -0
- package/dist/esm/behavior/state/managed/errors.js.map +6 -0
- package/dist/esm/behavior/state/managed/index.d.ts +1 -0
- package/dist/esm/behavior/state/managed/index.d.ts.map +1 -1
- package/dist/esm/behavior/state/managed/index.js +1 -0
- package/dist/esm/behavior/state/managed/index.js.map +1 -1
- 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 +0 -5
- package/dist/esm/behavior/state/managed/values/ListManager.d.ts.map +1 -1
- package/dist/esm/behavior/state/managed/values/ListManager.js +277 -144
- package/dist/esm/behavior/state/managed/values/ListManager.js.map +2 -2
- package/dist/esm/behavior/state/managed/values/StructManager.d.ts.map +1 -1
- package/dist/esm/behavior/state/managed/values/StructManager.js +31 -36
- package/dist/esm/behavior/state/managed/values/StructManager.js.map +2 -2
- package/dist/esm/behavior/state/managed/values/ValuePatcher.d.ts +8 -0
- package/dist/esm/behavior/state/managed/values/ValuePatcher.d.ts.map +1 -1
- package/dist/esm/behavior/state/managed/values/ValuePatcher.js +13 -2
- package/dist/esm/behavior/state/managed/values/ValuePatcher.js.map +1 -1
- package/dist/esm/behavior/state/validation/FabricIndexField.d.ts +30 -0
- package/dist/esm/behavior/state/validation/FabricIndexField.d.ts.map +1 -0
- package/dist/esm/behavior/state/validation/FabricIndexField.js +33 -0
- package/dist/esm/behavior/state/validation/FabricIndexField.js.map +6 -0
- package/dist/esm/behavior/state/validation/ValueValidator.d.ts.map +1 -1
- package/dist/esm/behavior/state/validation/ValueValidator.js +17 -37
- package/dist/esm/behavior/state/validation/ValueValidator.js.map +1 -1
- package/dist/esm/behavior/state/validation/conformance.d.ts.map +1 -1
- package/dist/esm/behavior/state/validation/conformance.js +6 -5
- package/dist/esm/behavior/state/validation/conformance.js.map +1 -1
- package/dist/esm/behavior/state/validation/constraint.d.ts.map +1 -1
- package/dist/esm/behavior/state/validation/constraint.js +3 -1
- package/dist/esm/behavior/state/validation/constraint.js.map +1 -1
- package/dist/esm/behavior/state/validation/location.d.ts +6 -0
- package/dist/esm/behavior/state/validation/location.d.ts.map +1 -1
- package/dist/esm/behavior/state/validation/remote-validation.d.ts +57 -0
- package/dist/esm/behavior/state/validation/remote-validation.d.ts.map +1 -0
- package/dist/esm/behavior/state/validation/remote-validation.js +48 -0
- package/dist/esm/behavior/state/validation/remote-validation.js.map +6 -0
- package/dist/esm/behavior/supervision/Supervision.d.ts.map +1 -1
- package/dist/esm/behavior/supervision/Supervision.js +1 -1
- package/dist/esm/behavior/supervision/Supervision.js.map +1 -1
- package/dist/esm/behavior/supervision/SupervisionConfig.d.ts.map +1 -1
- package/dist/esm/behavior/supervision/SupervisionConfig.js +1 -1
- package/dist/esm/behavior/supervision/SupervisionConfig.js.map +1 -1
- package/dist/esm/behavior/supervision/ValueSupervisor.d.ts +3 -12
- package/dist/esm/behavior/supervision/ValueSupervisor.d.ts.map +1 -1
- package/dist/esm/behavior/system/commissioning/CommissioningClient.d.ts +57 -6
- package/dist/esm/behavior/system/commissioning/CommissioningClient.d.ts.map +1 -1
- package/dist/esm/behavior/system/commissioning/CommissioningClient.js +87 -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/remote/api/ApiResource.d.ts +14 -0
- package/dist/esm/behavior/system/remote/api/ApiResource.d.ts.map +1 -1
- package/dist/esm/behavior/system/remote/api/ApiResource.js +19 -0
- package/dist/esm/behavior/system/remote/api/ApiResource.js.map +1 -1
- package/dist/esm/behavior/system/remote/api/Envelope.d.ts +4 -2
- package/dist/esm/behavior/system/remote/api/Envelope.d.ts.map +1 -1
- package/dist/esm/behavior/system/remote/api/Envelope.js +7 -5
- package/dist/esm/behavior/system/remote/api/Envelope.js.map +1 -1
- package/dist/esm/behavior/system/remote/api/resources/CommandResource.js +2 -2
- package/dist/esm/behavior/system/remote/api/resources/CommandResource.js.map +1 -1
- package/dist/esm/behavior/system/remote/api/resources/NodeResource.d.ts +1 -0
- package/dist/esm/behavior/system/remote/api/resources/NodeResource.d.ts.map +1 -1
- package/dist/esm/behavior/system/remote/api/resources/NodeResource.js +3 -0
- package/dist/esm/behavior/system/remote/api/resources/NodeResource.js.map +1 -1
- package/dist/esm/behavior/system/remote/api/resources/PropertyResource.d.ts.map +1 -1
- package/dist/esm/behavior/system/remote/api/resources/PropertyResource.js +5 -3
- package/dist/esm/behavior/system/remote/api/resources/PropertyResource.js.map +1 -1
- package/dist/esm/behavior/system/remote/api/resources/ServerNodeResource.d.ts.map +1 -1
- package/dist/esm/behavior/system/remote/api/resources/ServerNodeResource.js +2 -11
- package/dist/esm/behavior/system/remote/api/resources/ServerNodeResource.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/localization-configuration/LocalizationConfigurationServer.js +15 -4
- package/dist/esm/behaviors/localization-configuration/LocalizationConfigurationServer.js.map +2 -2
- 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 +19 -5
- package/dist/esm/behaviors/time-format-localization/TimeFormatLocalizationServer.js.map +2 -2
- package/dist/esm/behaviors/unit-localization/UnitLocalizationServer.d.ts.map +1 -1
- package/dist/esm/behaviors/unit-localization/UnitLocalizationServer.js +13 -3
- package/dist/esm/behaviors/unit-localization/UnitLocalizationServer.js.map +1 -1
- package/dist/esm/endpoint/Endpoint.d.ts +5 -9
- package/dist/esm/endpoint/Endpoint.d.ts.map +1 -1
- package/dist/esm/endpoint/Endpoint.js +5 -24
- package/dist/esm/endpoint/Endpoint.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 +25 -0
- package/dist/esm/node/ClientNode.d.ts.map +1 -1
- package/dist/esm/node/ClientNode.js +41 -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/ClientCommandMethod.d.ts.map +1 -1
- package/dist/esm/node/client/ClientCommandMethod.js +4 -16
- package/dist/esm/node/client/ClientCommandMethod.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 +18 -6
- package/dist/esm/node/client/Peers.d.ts.map +1 -1
- package/dist/esm/node/client/Peers.js +29 -14
- 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/storage/EndpointStore.d.ts +1 -1
- package/dist/esm/storage/EndpointStore.js +1 -1
- package/dist/esm/storage/client/ClientEndpointStore.d.ts +2 -2
- package/dist/esm/storage/client/ClientEndpointStore.d.ts.map +1 -1
- package/dist/esm/storage/client/ClientEndpointStore.js +1 -1
- package/dist/esm/storage/client/DatasourceCache.d.ts +5 -3
- package/dist/esm/storage/client/DatasourceCache.d.ts.map +1 -1
- package/dist/esm/storage/client/DatasourceCache.js +68 -71
- package/dist/esm/storage/client/DatasourceCache.js.map +1 -1
- package/dist/esm/storage/client/FabricScopedListWrite.d.ts +73 -0
- package/dist/esm/storage/client/FabricScopedListWrite.d.ts.map +1 -0
- package/dist/esm/storage/client/FabricScopedListWrite.js +148 -0
- package/dist/esm/storage/client/FabricScopedListWrite.js.map +6 -0
- package/dist/esm/storage/client/RemoteWriteParticipant.d.ts +9 -6
- package/dist/esm/storage/client/RemoteWriteParticipant.d.ts.map +1 -1
- package/dist/esm/storage/client/RemoteWriteParticipant.js +11 -15
- package/dist/esm/storage/client/RemoteWriteParticipant.js.map +1 -1
- package/dist/esm/storage/client/RemoteWriter.d.ts +67 -7
- package/dist/esm/storage/client/RemoteWriter.d.ts.map +1 -1
- package/dist/esm/storage/client/RemoteWriter.js +65 -14
- package/dist/esm/storage/client/RemoteWriter.js.map +1 -1
- package/dist/esm/storage/server/DatasourceStore.d.ts +2 -2
- package/dist/esm/storage/server/DatasourceStore.d.ts.map +1 -1
- package/dist/esm/storage/server/DatasourceStore.js.map +1 -1
- package/dist/esm/storage/server/ServerEndpointStore.d.ts +2 -2
- package/dist/esm/storage/server/ServerEndpointStore.d.ts.map +1 -1
- package/dist/esm/storage/server/ServerEndpointStore.js +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/context/server/LocalActorContext.ts +1 -4
- package/src/behavior/internal/BehaviorBacking.ts +10 -2
- 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 +9 -16
- package/src/behavior/state/managed/Datasource.ts +181 -58
- package/src/behavior/state/managed/Internal.ts +44 -34
- package/src/behavior/state/managed/ManagedReference.ts +159 -70
- package/src/behavior/state/managed/NameResolver.ts +1 -1
- package/src/behavior/state/managed/ReadOnlyReference.ts +61 -0
- package/src/behavior/state/managed/ValReference.ts +104 -14
- package/src/behavior/state/managed/errors.ts +33 -0
- package/src/behavior/state/managed/index.ts +1 -0
- package/src/behavior/state/managed/values/BitmapManager.ts +6 -22
- package/src/behavior/state/managed/values/ListManager.ts +313 -164
- package/src/behavior/state/managed/values/StructManager.ts +48 -52
- package/src/behavior/state/managed/values/ValuePatcher.ts +25 -3
- package/src/behavior/state/validation/FabricIndexField.ts +51 -0
- package/src/behavior/state/validation/ValueValidator.ts +24 -54
- package/src/behavior/state/validation/conformance.ts +9 -7
- package/src/behavior/state/validation/constraint.ts +5 -1
- package/src/behavior/state/validation/location.ts +8 -0
- package/src/behavior/state/validation/remote-validation.ts +107 -0
- package/src/behavior/supervision/Supervision.ts +1 -2
- package/src/behavior/supervision/SupervisionConfig.ts +1 -2
- package/src/behavior/supervision/ValueSupervisor.ts +3 -13
- package/src/behavior/system/commissioning/CommissioningClient.ts +122 -6
- 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/remote/api/ApiResource.ts +23 -0
- package/src/behavior/system/remote/api/Envelope.ts +8 -6
- package/src/behavior/system/remote/api/resources/CommandResource.ts +2 -2
- package/src/behavior/system/remote/api/resources/NodeResource.ts +4 -0
- package/src/behavior/system/remote/api/resources/PropertyResource.ts +5 -3
- package/src/behavior/system/remote/api/resources/ServerNodeResource.ts +2 -13
- 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 +18 -6
- 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 +24 -9
- package/src/behaviors/unit-localization/UnitLocalizationServer.ts +17 -4
- package/src/endpoint/Endpoint.ts +5 -31
- package/src/endpoint/properties/Behaviors.ts +6 -2
- package/src/node/ClientNode.ts +41 -0
- package/src/node/ServerNode.ts +2 -0
- package/src/node/client/ClientCommandMethod.ts +4 -19
- package/src/node/client/ClientEventEmitter.ts +7 -3
- package/src/node/client/ClientStructure.ts +208 -135
- package/src/node/client/Peers.ts +36 -20
- 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/storage/EndpointStore.ts +1 -1
- package/src/storage/client/ClientEndpointStore.ts +1 -1
- package/src/storage/client/DatasourceCache.ts +86 -79
- package/src/storage/client/FabricScopedListWrite.ts +245 -0
- package/src/storage/client/RemoteWriteParticipant.ts +20 -23
- package/src/storage/client/RemoteWriter.ts +156 -26
- package/src/storage/server/DatasourceStore.ts +2 -2
- package/src/storage/server/ServerEndpointStore.ts +1 -1
- package/src/testing/mock-server-node.ts +22 -9
- package/src/testing/node-helpers.ts +5 -1
- package/dist/cjs/behavior/state/validation/FabricIndexSentinel.d.ts +0 -14
- package/dist/cjs/behavior/state/validation/FabricIndexSentinel.d.ts.map +0 -1
- package/dist/cjs/behavior/state/validation/FabricIndexSentinel.js.map +0 -6
- package/dist/cjs/behavior/state/validation/peer-forwarding.d.ts +0 -20
- package/dist/cjs/behavior/state/validation/peer-forwarding.d.ts.map +0 -1
- package/dist/cjs/behavior/state/validation/peer-forwarding.js.map +0 -6
- package/dist/esm/behavior/state/validation/FabricIndexSentinel.d.ts +0 -14
- package/dist/esm/behavior/state/validation/FabricIndexSentinel.d.ts.map +0 -1
- package/dist/esm/behavior/state/validation/FabricIndexSentinel.js +0 -15
- package/dist/esm/behavior/state/validation/FabricIndexSentinel.js.map +0 -6
- package/dist/esm/behavior/state/validation/peer-forwarding.d.ts +0 -20
- package/dist/esm/behavior/state/validation/peer-forwarding.d.ts.map +0 -1
- package/dist/esm/behavior/state/validation/peer-forwarding.js +0 -26
- package/dist/esm/behavior/state/validation/peer-forwarding.js.map +0 -6
- package/src/behavior/state/validation/FabricIndexSentinel.ts +0 -20
- package/src/behavior/state/validation/peer-forwarding.ts +0 -47
|
@@ -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
|
|
|
@@ -18,16 +18,31 @@ export class TimeFormatLocalizationServer extends TimeFormatLocalizationBehavior
|
|
|
18
18
|
if (this.state.hourFormat === undefined) {
|
|
19
19
|
this.state.hourFormat = this.detectedHourFormat;
|
|
20
20
|
}
|
|
21
|
-
if (this.
|
|
22
|
-
|
|
21
|
+
if (!this.features.calendarFormat) {
|
|
22
|
+
return;
|
|
23
23
|
}
|
|
24
|
-
if (this.state.supportedCalendarTypes
|
|
25
|
-
this.state.
|
|
24
|
+
if (!this.state.supportedCalendarTypes?.length) {
|
|
25
|
+
const calendarType = this.state.activeCalendarType ?? this.detectedCalendarType;
|
|
26
|
+
this.state.supportedCalendarTypes = [calendarType];
|
|
27
|
+
this.state.activeCalendarType = calendarType;
|
|
26
28
|
}
|
|
29
|
+
const { activeCalendarType, supportedCalendarTypes } = this.state;
|
|
30
|
+
if (activeCalendarType !== undefined && supportedCalendarTypes.includes(activeCalendarType)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const detected = this.detectedCalendarType;
|
|
35
|
+
const calendarType = supportedCalendarTypes.includes(detected) ? detected : supportedCalendarTypes[0];
|
|
36
|
+
if (activeCalendarType !== undefined) {
|
|
37
|
+
logger.warn(
|
|
38
|
+
`Active calendar type ${TimeFormatLocalization.CalendarType[activeCalendarType]} is not in supportedCalendarTypes, using ${TimeFormatLocalization.CalendarType[calendarType]}`,
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
this.state.activeCalendarType = calendarType;
|
|
27
42
|
}
|
|
28
43
|
|
|
29
44
|
/** Override this getter with own implementation to detect the hour format of the system. */
|
|
30
|
-
get detectedHourFormat() {
|
|
45
|
+
get detectedHourFormat(): TimeFormatLocalization.HourFormat {
|
|
31
46
|
if (Intl.DateTimeFormat(undefined, { hour: "numeric" }).resolvedOptions().hour12) {
|
|
32
47
|
return TimeFormatLocalization.HourFormat["12Hr"];
|
|
33
48
|
}
|
|
@@ -35,7 +50,7 @@ export class TimeFormatLocalizationServer extends TimeFormatLocalizationBehavior
|
|
|
35
50
|
}
|
|
36
51
|
|
|
37
52
|
/** Override this getter with own implementation to detect the calendar type of the system. */
|
|
38
|
-
get detectedCalendarType() {
|
|
53
|
+
get detectedCalendarType(): TimeFormatLocalization.CalendarType {
|
|
39
54
|
const type = Intl.DateTimeFormat().resolvedOptions().calendar;
|
|
40
55
|
switch (type) {
|
|
41
56
|
case "buddhist":
|
|
@@ -75,7 +90,7 @@ export class TimeFormatLocalizationServer extends TimeFormatLocalizationBehavior
|
|
|
75
90
|
return TimeFormatLocalization.CalendarType.Persian;
|
|
76
91
|
|
|
77
92
|
default:
|
|
78
|
-
logger.
|
|
93
|
+
logger.info(`Unmapped calendar type "${type}"; falling back to Gregorian`);
|
|
79
94
|
return TimeFormatLocalization.CalendarType.Gregorian;
|
|
80
95
|
}
|
|
81
96
|
}
|
|
@@ -83,7 +98,7 @@ export class TimeFormatLocalizationServer extends TimeFormatLocalizationBehavior
|
|
|
83
98
|
|
|
84
99
|
export namespace TimeFormatLocalizationServer {
|
|
85
100
|
export declare const ExtensionInterface: {
|
|
86
|
-
detectedHourFormat:
|
|
87
|
-
detectedCalendarType:
|
|
101
|
+
get detectedHourFormat(): TimeFormatLocalization.HourFormat;
|
|
102
|
+
get detectedCalendarType(): TimeFormatLocalization.CalendarType;
|
|
88
103
|
};
|
|
89
104
|
}
|
|
@@ -4,23 +4,36 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { MaybePromise } from "@matter/general";
|
|
7
|
+
import { Logger, MaybePromise } from "@matter/general";
|
|
8
8
|
import { UnitLocalization } from "@matter/types/clusters/unit-localization";
|
|
9
9
|
import { UnitLocalizationBehavior } from "./UnitLocalizationBehavior.js";
|
|
10
10
|
|
|
11
|
+
const logger = Logger.get("UnitLocalizationServer");
|
|
12
|
+
|
|
11
13
|
/**
|
|
12
14
|
* This is the default server implementation of {@link UnitLocalizationBehavior}.
|
|
13
15
|
*/
|
|
14
16
|
export class UnitLocalizationServer extends UnitLocalizationBehavior.with("TemperatureUnit") {
|
|
15
17
|
override initialize(): MaybePromise {
|
|
16
|
-
if (this.state.temperatureUnit === undefined) {
|
|
17
|
-
this.state.temperatureUnit = UnitLocalization.TempUnit.Celsius;
|
|
18
|
-
}
|
|
19
18
|
if (!this.state.supportedTemperatureUnits?.length) {
|
|
20
19
|
this.state.supportedTemperatureUnits = [
|
|
21
20
|
UnitLocalization.TempUnit.Celsius,
|
|
22
21
|
UnitLocalization.TempUnit.Fahrenheit,
|
|
23
22
|
];
|
|
24
23
|
}
|
|
24
|
+
const { temperatureUnit, supportedTemperatureUnits } = this.state;
|
|
25
|
+
if (temperatureUnit !== undefined && supportedTemperatureUnits.includes(temperatureUnit)) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const unit = supportedTemperatureUnits.includes(UnitLocalization.TempUnit.Celsius)
|
|
30
|
+
? UnitLocalization.TempUnit.Celsius
|
|
31
|
+
: supportedTemperatureUnits[0];
|
|
32
|
+
if (temperatureUnit !== undefined) {
|
|
33
|
+
logger.warn(
|
|
34
|
+
`Temperature unit ${UnitLocalization.TempUnit[temperatureUnit]} is not in supportedTemperatureUnits, using ${UnitLocalization.TempUnit[unit]}`,
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
this.state.temperatureUnit = unit;
|
|
25
38
|
}
|
|
26
39
|
}
|
package/src/endpoint/Endpoint.ts
CHANGED
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
} from "@matter/general";
|
|
32
32
|
import { ClusterModel, DataModelPath } from "@matter/model";
|
|
33
33
|
import { InteractionSettings, Read, ReadResult, Val } from "@matter/protocol";
|
|
34
|
-
import { AttributeId, ClusterId, EndpointNumber,
|
|
34
|
+
import { AttributeId, ClusterId, EndpointNumber, Status } from "@matter/types";
|
|
35
35
|
import { RootEndpoint } from "../endpoints/root.js";
|
|
36
36
|
import { Agent } from "./Agent.js";
|
|
37
37
|
import {
|
|
@@ -251,6 +251,10 @@ export class Endpoint<T extends EndpointType = EndpointType.Empty> {
|
|
|
251
251
|
* This is a transactional operation. An error results in no change. The endpoint will wait for exclusive access
|
|
252
252
|
* before applying changes.
|
|
253
253
|
*
|
|
254
|
+
* On the cluster state of a client node each given attribute value is assigned whole, like `state.x = value` in an
|
|
255
|
+
* act, and is not merged into the cached value. On any other state, such as a local node or a local behavior of a
|
|
256
|
+
* client node, a struct or list is patched into the current value.
|
|
257
|
+
*
|
|
254
258
|
* @param values the values to change
|
|
255
259
|
*/
|
|
256
260
|
async set(values: SupportedBehaviors.StatePatchOf<T["behaviors"]>) {
|
|
@@ -895,7 +899,6 @@ export class Endpoint<T extends EndpointType = EndpointType.Empty> {
|
|
|
895
899
|
this.#activity = this.env.get(NodeActivity);
|
|
896
900
|
}
|
|
897
901
|
|
|
898
|
-
const { clientPeerContext } = this;
|
|
899
902
|
return LocalActorContext.act(
|
|
900
903
|
purpose,
|
|
901
904
|
context => {
|
|
@@ -904,40 +907,11 @@ export class Endpoint<T extends EndpointType = EndpointType.Empty> {
|
|
|
904
907
|
{
|
|
905
908
|
activity: this.#activity,
|
|
906
909
|
lifetime: this.construction,
|
|
907
|
-
clientPeerContext,
|
|
908
910
|
abort: options?.abort,
|
|
909
911
|
},
|
|
910
912
|
);
|
|
911
913
|
}
|
|
912
914
|
|
|
913
|
-
/**
|
|
914
|
-
* The peer context for actions on this endpoint if it belongs to a client node, otherwise undefined.
|
|
915
|
-
*
|
|
916
|
-
* @internal
|
|
917
|
-
*/
|
|
918
|
-
get clientPeerContext(): { fabricIndexOnPeer?: FabricIndex } | undefined {
|
|
919
|
-
const root = this.ownerOfType(RootEndpoint);
|
|
920
|
-
if (root === undefined || (root as unknown as Node<any>).nodeType !== "client") {
|
|
921
|
-
return undefined;
|
|
922
|
-
}
|
|
923
|
-
// String-keyed lookup avoids importing CommissioningClient/OperationalCredentialsClient: that would
|
|
924
|
-
// form a cycle (Endpoint → CommissioningClient → ClientNode → Node → Endpoint).
|
|
925
|
-
const commissioning = root.behaviors.maybeStateOf("commissioning") as
|
|
926
|
-
| { fabricIndexOnPeer?: FabricIndex }
|
|
927
|
-
| undefined;
|
|
928
|
-
if (commissioning?.fabricIndexOnPeer !== undefined) {
|
|
929
|
-
return { fabricIndexOnPeer: commissioning.fabricIndexOnPeer };
|
|
930
|
-
}
|
|
931
|
-
const opcreds = root.behaviors.maybeStateOf("operationalCredentials") as
|
|
932
|
-
| { currentFabricIndex?: FabricIndex }
|
|
933
|
-
| undefined;
|
|
934
|
-
const fallback = opcreds?.currentFabricIndex;
|
|
935
|
-
if (fallback !== undefined && fallback !== FabricIndex.NO_FABRIC) {
|
|
936
|
-
return { fabricIndexOnPeer: fallback };
|
|
937
|
-
}
|
|
938
|
-
return {};
|
|
939
|
-
}
|
|
940
|
-
|
|
941
915
|
/**
|
|
942
916
|
* Perform "soft" reset of the endpoint, reverting all in-memory structures to uninitialized.
|
|
943
917
|
*/
|
|
@@ -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
|
@@ -9,6 +9,7 @@ import { CommissioningClient } from "#behavior/system/commissioning/Commissionin
|
|
|
9
9
|
import { ClientNetworkRuntime } from "#behavior/system/network/ClientNetworkRuntime.js";
|
|
10
10
|
import { NetworkClient } from "#behavior/system/network/NetworkClient.js";
|
|
11
11
|
import { NetworkRuntime } from "#behavior/system/network/NetworkRuntime.js";
|
|
12
|
+
import { OperationalCredentialsClient } from "#behaviors/operational-credentials";
|
|
12
13
|
import { Agent } from "#endpoint/Agent.js";
|
|
13
14
|
import type { Endpoint } from "#endpoint/Endpoint.js";
|
|
14
15
|
import { ClientNodeEndpoints } from "#endpoint/properties/ClientNodeEndpoints.js";
|
|
@@ -33,6 +34,7 @@ import {
|
|
|
33
34
|
} from "@matter/general";
|
|
34
35
|
import { Matter, MatterModel } from "@matter/model";
|
|
35
36
|
import { Interactable, OccurrenceManager, PeerAddress, PeerSet } from "@matter/protocol";
|
|
37
|
+
import { FabricIndex } from "@matter/types";
|
|
36
38
|
import { ClientEndpointInitializer } from "./client/ClientEndpointInitializer.js";
|
|
37
39
|
import { ClientNodeInteraction } from "./client/ClientNodeInteraction.js";
|
|
38
40
|
import { ClientStructure } from "./client/ClientStructure.js";
|
|
@@ -83,6 +85,25 @@ export class ClientNode extends Node<ClientNode.RootEndpoint> {
|
|
|
83
85
|
|
|
84
86
|
override readonly nodeType: "client" | "group" = "client";
|
|
85
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Our fabric index on the peer, if known: `commissioning.fabricIndexOnPeer`, else
|
|
90
|
+
* `operationalCredentials.currentFabricIndex` unless the peer reported `FabricIndex.NO_FABRIC`.
|
|
91
|
+
*
|
|
92
|
+
* Any write of a fabric-scoped list such as `acl` needs it. The write sends only our entries and leaves out an
|
|
93
|
+
* entry of another fabric that equals a cached entry; it refuses any other entry of another fabric, and any write
|
|
94
|
+
* of a fabric-scoped list while this index is unknown.
|
|
95
|
+
*
|
|
96
|
+
* @see {@link MatterSpecification.v161.Core} § 7.19.1.8.2
|
|
97
|
+
*/
|
|
98
|
+
get fabricIndexOnPeer() {
|
|
99
|
+
const recorded = this.maybeStateOf(CommissioningClient)?.fabricIndexOnPeer;
|
|
100
|
+
if (recorded !== undefined) {
|
|
101
|
+
return recorded;
|
|
102
|
+
}
|
|
103
|
+
const current = this.maybeStateOf(OperationalCredentialsClient)?.currentFabricIndex;
|
|
104
|
+
return current === FabricIndex.NO_FABRIC ? undefined : current;
|
|
105
|
+
}
|
|
106
|
+
|
|
86
107
|
/**
|
|
87
108
|
* Model of Matter semantics understood by this node.
|
|
88
109
|
*
|
|
@@ -188,6 +209,20 @@ export class ClientNode extends Node<ClientNode.RootEndpoint> {
|
|
|
188
209
|
});
|
|
189
210
|
}
|
|
190
211
|
|
|
212
|
+
/**
|
|
213
|
+
* Replace this peer's operational certificate (NOC) with one for a new key pair, keeping node ID, fabric and ACLs.
|
|
214
|
+
*
|
|
215
|
+
* See {@link CommissioningClient.updateOperationalCertificate}. Rejects with `FabricOperationInProgressError` if a
|
|
216
|
+
* commission, decommission or certificate update of this node is already in progress.
|
|
217
|
+
*/
|
|
218
|
+
async updateOperationalCertificate(options?: CommissioningClient.OperationalCertificateUpdateOptions) {
|
|
219
|
+
await this.#peers.runOperationalCertificateUpdate(this, () =>
|
|
220
|
+
this.act("updateOperationalCertificate", agent =>
|
|
221
|
+
agent.commissioning.updateOperationalCertificate(options),
|
|
222
|
+
),
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
|
|
191
226
|
/**
|
|
192
227
|
* Open a Basic Commissioning Window on this peer (uses the passcode originally printed on the device).
|
|
193
228
|
*
|
|
@@ -350,6 +385,12 @@ export class ClientNode extends Node<ClientNode.RootEndpoint> {
|
|
|
350
385
|
return this.#interaction;
|
|
351
386
|
}
|
|
352
387
|
|
|
388
|
+
/**
|
|
389
|
+
* The peer's operational address, or `undefined` if the peer is not commissioned or its storage is not available.
|
|
390
|
+
*
|
|
391
|
+
* Reads the commissioning state when it is loaded, otherwise a cached value or storage. So it also answers for a
|
|
392
|
+
* node whose commissioning state failed to load.
|
|
393
|
+
*/
|
|
353
394
|
get peerAddress(): PeerAddress | undefined {
|
|
354
395
|
// Whenever the commissioning backing is loaded its state is authoritative - mirror it (set or cleared)
|
|
355
396
|
// so the cache cannot survive a decommission as a stale value
|