@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
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { camelize, deepCopy, GeneratedClass, isObject } from "@matter/general";
|
|
8
8
|
import type { Schema } from "@matter/model";
|
|
9
9
|
import { ElementTag, FieldValue, MandatoryDefaultValue, Metatype, ValueModel } from "@matter/model";
|
|
10
|
-
import { AccessControl,
|
|
10
|
+
import { AccessControl, SchemaImplementationError, Val } from "@matter/protocol";
|
|
11
11
|
import { FabricIndex } from "@matter/types";
|
|
12
12
|
import { RootSupervisor } from "../../../supervision/RootSupervisor.js";
|
|
13
13
|
import type { ValueSupervisor } from "../../../supervision/ValueSupervisor.js";
|
|
@@ -22,8 +22,7 @@ import {
|
|
|
22
22
|
memberValueOf,
|
|
23
23
|
} from "../MemberKeys.js";
|
|
24
24
|
import { NameResolver } from "../NameResolver.js";
|
|
25
|
-
import
|
|
26
|
-
import { isFabricScopedList } from "./ListManager.js";
|
|
25
|
+
import { ValReference } from "../ValReference.js";
|
|
27
26
|
import { PrimitiveManager } from "./PrimitiveManager.js";
|
|
28
27
|
|
|
29
28
|
/**
|
|
@@ -140,11 +139,11 @@ function configureProperty(supervisor: RootSupervisor, schema: ValueModel) {
|
|
|
140
139
|
|
|
141
140
|
const { access, manage, validate } = supervisor.get(schema);
|
|
142
141
|
|
|
143
|
-
const fabricScopedList =
|
|
142
|
+
const fabricScopedList = schema.fabricScopedList;
|
|
144
143
|
|
|
145
144
|
// We generally do not deal with default values. If the schema defines a default it is assigned before the manager
|
|
146
|
-
// is created.
|
|
147
|
-
// value
|
|
145
|
+
// is created. Field references are the exception: a name-keyed container reads the referenced value at runtime so
|
|
146
|
+
// it tracks that value, and a mirror's default is a copy of it, made in readDefault
|
|
148
147
|
let defaultReader: ((val: Val) => Val) | undefined;
|
|
149
148
|
if (typeof FieldValue.referenced(schema.default) === "string") {
|
|
150
149
|
defaultReader = NameResolver(supervisor, schema.parent, camelize(FieldValue.referenced(schema.default)!));
|
|
@@ -153,8 +152,8 @@ function configureProperty(supervisor: RootSupervisor, schema: ValueModel) {
|
|
|
153
152
|
// A member mandatory under the mirror's active features always reads a value even when the peer's
|
|
154
153
|
// AttributeList omits it, and an optional member stays undefined even when the peer's AttributeList reports
|
|
155
154
|
// it -- this mirrors the conformance-aware TypeScript typings, which know nothing about runtime AttributeList
|
|
156
|
-
// data. The container
|
|
157
|
-
//
|
|
155
|
+
// data. The container never holds this value, so it can't masquerade as peer data in persistence, change
|
|
156
|
+
// detection or external-change integration; a change in place of a default container throws UncachedValueError.
|
|
158
157
|
const scope = supervisor.scope;
|
|
159
158
|
const isMandatory = scope.isMandatory(schema);
|
|
160
159
|
|
|
@@ -176,7 +175,7 @@ function configureProperty(supervisor: RootSupervisor, schema: ValueModel) {
|
|
|
176
175
|
const referencedDefault = defaultReader;
|
|
177
176
|
const readDefault: ((self: Struct) => Val | undefined) | undefined = synthesizeDefault
|
|
178
177
|
? referencedDefault
|
|
179
|
-
? (self: Struct) => referencedDefault(self) ?? synthesizeDefault()
|
|
178
|
+
? (self: Struct) => Internal.copy(referencedDefault(self)) ?? synthesizeDefault()
|
|
180
179
|
: () => synthesizeDefault()
|
|
181
180
|
: undefined;
|
|
182
181
|
|
|
@@ -185,20 +184,21 @@ function configureProperty(supervisor: RootSupervisor, schema: ValueModel) {
|
|
|
185
184
|
|
|
186
185
|
set(this: Struct, value: Val) {
|
|
187
186
|
access.authorizeWrite(this[Internal.session], this[Internal.reference].location);
|
|
187
|
+
const container = ValReference.writableContainerOf(this[Internal.reference]);
|
|
188
188
|
|
|
189
189
|
// We allow attribute/field name or id as key. If name is present id is ignored
|
|
190
190
|
const pk = this[Internal.reference].primaryKey;
|
|
191
191
|
let key = memberKeyFor(pk, name, id);
|
|
192
|
-
let storedKey = memberSlotOf(
|
|
192
|
+
let storedKey = memberSlotOf(container, key, memberFallbackKeyFor(pk, name, id));
|
|
193
193
|
|
|
194
194
|
// Rollback and the fabric-scoped-list merge check must see stored truth — never the write-migration
|
|
195
195
|
// slot above and never a synthesized default
|
|
196
|
-
const oldValue = memberValueOf(
|
|
196
|
+
const oldValue = memberValueOf(container, key, memberReadFallbackKeyFor(pk, name, id));
|
|
197
197
|
|
|
198
198
|
const self = this;
|
|
199
199
|
|
|
200
200
|
this[Internal.reference].change(() => {
|
|
201
|
-
const struct = this[Internal.reference]
|
|
201
|
+
const struct = ValReference.containerOf(this[Internal.reference]);
|
|
202
202
|
|
|
203
203
|
// Identify the target. Usually just "struct" except when struct supports Val.Dynamic
|
|
204
204
|
let target;
|
|
@@ -214,9 +214,9 @@ function configureProperty(supervisor: RootSupervisor, schema: ValueModel) {
|
|
|
214
214
|
if (fabricScopedList || validate) {
|
|
215
215
|
// A dynamic member's previous value lives in the provider, not the container slot;
|
|
216
216
|
// read it only when rollback or the fabric-scoped merge check may consume it, as the
|
|
217
|
-
// provider's getter may be costly.
|
|
218
|
-
//
|
|
219
|
-
previousValue = Internal.
|
|
217
|
+
// provider's getter may be costly. Unwrap in case the provider serves a managed value —
|
|
218
|
+
// rollback must not plant a proxy that expires with this session
|
|
219
|
+
previousValue = Internal.rawOf(properties[name]);
|
|
220
220
|
}
|
|
221
221
|
} else {
|
|
222
222
|
target = struct;
|
|
@@ -225,8 +225,7 @@ function configureProperty(supervisor: RootSupervisor, schema: ValueModel) {
|
|
|
225
225
|
target = struct;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
|
|
229
|
-
value = Internal.unmanage(value);
|
|
228
|
+
value = Internal.copy(value);
|
|
230
229
|
|
|
231
230
|
// Undo our change on error. Rollback will take care of this when transactional but this handles the
|
|
232
231
|
// cases of 1.) no transaction, and 2.) error is caught within transaction. A previously absent member
|
|
@@ -243,11 +242,14 @@ function configureProperty(supervisor: RootSupervisor, schema: ValueModel) {
|
|
|
243
242
|
if (fabricScopedList && Array.isArray(value)) {
|
|
244
243
|
// The merge must run through the proxy even for an absent member; it is what filters by fabric
|
|
245
244
|
// and supplies the accessing fabric
|
|
246
|
-
if (previousValue === undefined) {
|
|
245
|
+
if (previousValue === undefined || previousValue === null) {
|
|
247
246
|
target[key] = [];
|
|
248
247
|
if (storedKey !== undefined && storedKey !== key) {
|
|
249
248
|
delete target[storedKey];
|
|
250
249
|
}
|
|
250
|
+
|
|
251
|
+
// The direct write above bypasses the cached reference; the merge below reads through it
|
|
252
|
+
this[Internal.reference].subrefs?.[memberKeyFor(pk, name, id)]?.refresh("session");
|
|
251
253
|
}
|
|
252
254
|
|
|
253
255
|
// In the case of fabric-scoped write to established list we use the managed proxy to perform update
|
|
@@ -258,6 +260,9 @@ function configureProperty(supervisor: RootSupervisor, schema: ValueModel) {
|
|
|
258
260
|
proxy[i] = value[i];
|
|
259
261
|
}
|
|
260
262
|
proxy.length = value.length;
|
|
263
|
+
|
|
264
|
+
// The list prepared copies of the entries, so validate those
|
|
265
|
+
value = Array.from(proxy, Internal.copy);
|
|
261
266
|
} catch (e) {
|
|
262
267
|
undo();
|
|
263
268
|
throw e;
|
|
@@ -284,6 +289,7 @@ function configureProperty(supervisor: RootSupervisor, schema: ValueModel) {
|
|
|
284
289
|
path: this[Internal.reference].location.path,
|
|
285
290
|
siblings: struct,
|
|
286
291
|
owner: this[Internal.reference].rootOwner,
|
|
292
|
+
remote: this[Internal.reference].mirrorsRemote ? "outbound" : undefined,
|
|
287
293
|
});
|
|
288
294
|
} catch (e) {
|
|
289
295
|
undo();
|
|
@@ -298,10 +304,7 @@ function configureProperty(supervisor: RootSupervisor, schema: ValueModel) {
|
|
|
298
304
|
// For primitives, we don't need a manager so just proxy reads directly
|
|
299
305
|
descriptor.get = function (this: Struct) {
|
|
300
306
|
if (access.mayRead(this[Internal.session], this[Internal.reference].location)) {
|
|
301
|
-
const struct = this[Internal.reference]
|
|
302
|
-
if (struct === undefined) {
|
|
303
|
-
throw new PhantomReferenceError(this[Internal.reference].location);
|
|
304
|
-
}
|
|
307
|
+
const struct = ValReference.containerOf(this[Internal.reference]) as Val.Dynamic;
|
|
305
308
|
if (struct[Val.properties]) {
|
|
306
309
|
const properties = struct[Val.properties](
|
|
307
310
|
this[Internal.reference].rootOwner,
|
|
@@ -350,7 +353,7 @@ function configureProperty(supervisor: RootSupervisor, schema: ValueModel) {
|
|
|
350
353
|
let value;
|
|
351
354
|
|
|
352
355
|
// Obtain the value. Normally just struct[key] except in the case of Val.Dynamic
|
|
353
|
-
const struct = this[Internal.reference]
|
|
356
|
+
const struct = ValReference.containerOf(this[Internal.reference]);
|
|
354
357
|
const primaryKey = this[Internal.reference].primaryKey;
|
|
355
358
|
const key = memberKeyFor(primaryKey, name, id);
|
|
356
359
|
if ((struct as Val.Dynamic)[Val.properties]) {
|
|
@@ -375,7 +378,12 @@ function configureProperty(supervisor: RootSupervisor, schema: ValueModel) {
|
|
|
375
378
|
}
|
|
376
379
|
|
|
377
380
|
if (value === undefined) {
|
|
378
|
-
|
|
381
|
+
if (primaryKey === "name") {
|
|
382
|
+
return defaultReader?.(this);
|
|
383
|
+
}
|
|
384
|
+
if (readDefault === undefined) {
|
|
385
|
+
return undefined;
|
|
386
|
+
}
|
|
379
387
|
}
|
|
380
388
|
|
|
381
389
|
// Value is null or a dynamic property, so just return it
|
|
@@ -384,36 +392,24 @@ function configureProperty(supervisor: RootSupervisor, schema: ValueModel) {
|
|
|
384
392
|
return value;
|
|
385
393
|
}
|
|
386
394
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
owner: this[Internal.reference].rootOwner,
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
// Clone the container before write
|
|
405
|
-
const ref = new ManagedReference(
|
|
406
|
-
this[Internal.reference],
|
|
407
|
-
name,
|
|
408
|
-
id,
|
|
409
|
-
assertWriteOk,
|
|
410
|
-
cloneContainer,
|
|
411
|
-
this[Internal.session],
|
|
412
|
-
);
|
|
395
|
+
// The reference makes the default of an absent member, once for as long as the member stays absent
|
|
396
|
+
const ref =
|
|
397
|
+
this[Internal.reference].subrefs?.[key] ??
|
|
398
|
+
new ManagedReference(
|
|
399
|
+
this[Internal.reference],
|
|
400
|
+
name,
|
|
401
|
+
id,
|
|
402
|
+
cloneContainer,
|
|
403
|
+
this[Internal.session],
|
|
404
|
+
"member",
|
|
405
|
+
primaryKey === "id" && readDefault ? () => readDefault(this) : undefined,
|
|
406
|
+
);
|
|
413
407
|
|
|
414
|
-
ref.
|
|
408
|
+
if (ref.value === undefined || ref.value === null) {
|
|
409
|
+
return ref.value;
|
|
410
|
+
}
|
|
415
411
|
|
|
416
|
-
return ref.owner;
|
|
412
|
+
return (ref.owner ??= manage(ref, this[Internal.session]));
|
|
417
413
|
};
|
|
418
414
|
}
|
|
419
415
|
|
|
@@ -10,9 +10,18 @@ import { DataModelPath, Metatype, StoredDefaultValue, ValueModel } from "@matter
|
|
|
10
10
|
import { SchemaImplementationError, Val, WriteError } from "@matter/protocol";
|
|
11
11
|
import { RootSupervisor } from "../../../supervision/RootSupervisor.js";
|
|
12
12
|
import { ValueSupervisor } from "../../../supervision/ValueSupervisor.js";
|
|
13
|
+
import { Internal } from "../Internal.js";
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Obtain a {@link ValueSupervisor.Patch} function for the given schema.
|
|
17
|
+
*
|
|
18
|
+
* The patch decides per target. A target that mirrors a remote node, such as the cluster state of a client node or a
|
|
19
|
+
* value inside it, takes each given member or entry as a whole value: the patch assigns it like `state.x = value` in an
|
|
20
|
+
* act, without merging it into the cached value and without local defaults. A list member must then be given as an
|
|
21
|
+
* array. Assigning to a member of a value inside an attribute changes that attribute in place, so it fails with
|
|
22
|
+
* `UncachedValueError` while the attribute reads its uncached default. Any other target is patched: a struct given for
|
|
23
|
+
* a struct member is merged into it, a list is merged entry by entry, and a missing struct or list entry starts from
|
|
24
|
+
* the schema defaults.
|
|
16
25
|
*/
|
|
17
26
|
export function ValuePatcher(schema: Schema, supervisor: RootSupervisor) {
|
|
18
27
|
switch (schema.effectiveMetatype) {
|
|
@@ -118,6 +127,8 @@ function StructPatcher(schema: ValueModel, supervisor: RootSupervisor): ValueSup
|
|
|
118
127
|
throw new WriteError(path, `cannot patch ${target} because it is not an object`);
|
|
119
128
|
}
|
|
120
129
|
|
|
130
|
+
const assignsWhole = mirrorsRemote(target);
|
|
131
|
+
|
|
121
132
|
for (let key in changes as Val.Struct) {
|
|
122
133
|
let newValue = (changes as Val.Struct)[key];
|
|
123
134
|
|
|
@@ -129,9 +140,14 @@ function StructPatcher(schema: ValueModel, supervisor: RootSupervisor): ValueSup
|
|
|
129
140
|
key = memberAltKeys[key];
|
|
130
141
|
}
|
|
131
142
|
|
|
132
|
-
|
|
143
|
+
if (assignsWhole && memberArrays[key] && isObject(newValue)) {
|
|
144
|
+
throw new ImplementationError(
|
|
145
|
+
`Cannot patch ${path.at(key)} with an object: on the cluster state of a client node a list is written whole, so give the complete list as an array`,
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
133
149
|
const subpatch = memberPatchers[key];
|
|
134
|
-
if (!subpatch || newValue === null || typeof newValue !== "object") {
|
|
150
|
+
if (assignsWhole || !subpatch || newValue === null || typeof newValue !== "object") {
|
|
135
151
|
target[key] = newValue;
|
|
136
152
|
continue;
|
|
137
153
|
}
|
|
@@ -194,6 +210,8 @@ function ListPatcher(schema: ValueModel, supervisor: RootSupervisor): ValueSuper
|
|
|
194
210
|
throw new WriteError(path, `patch definition ${changes} is not an object`);
|
|
195
211
|
}
|
|
196
212
|
|
|
213
|
+
const assignsWhole = mirrorsRemote(target);
|
|
214
|
+
|
|
197
215
|
// eslint reports error here when linting entire project but not individual file. Unsure if this is a bug but
|
|
198
216
|
// disabling as code is correct as written
|
|
199
217
|
// oxlint-disable-next-line @typescript-eslint/no-for-in-array
|
|
@@ -207,7 +225,7 @@ function ListPatcher(schema: ValueModel, supervisor: RootSupervisor): ValueSuper
|
|
|
207
225
|
// Changes may be an array or object but JS allows string indices either way even though TS doesn't
|
|
208
226
|
let newValue = (changes as Val.Struct)[indexStr];
|
|
209
227
|
|
|
210
|
-
if (patchEntry) {
|
|
228
|
+
if (patchEntry && !assignsWhole) {
|
|
211
229
|
const oldValue = index < target.length ? target[index] : undefined;
|
|
212
230
|
if (newValue === undefined || newValue === null || oldValue === undefined || oldValue === null) {
|
|
213
231
|
// If creating a new object, apply as a patch to the object's defaults before insertion
|
|
@@ -232,6 +250,10 @@ function ListPatcher(schema: ValueModel, supervisor: RootSupervisor): ValueSuper
|
|
|
232
250
|
};
|
|
233
251
|
}
|
|
234
252
|
|
|
253
|
+
function mirrorsRemote(target: Val.Collection) {
|
|
254
|
+
return Internal.referenceOf(target)?.mirrorsRemote === true;
|
|
255
|
+
}
|
|
256
|
+
|
|
235
257
|
function PrimitivePatcher(): ValueSupervisor.Patch {
|
|
236
258
|
return (_changes, _target, path) => {
|
|
237
259
|
throw new ImplementationError(`Cannot generate patch ${path} because it does not define not a collection`);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2026 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { camelize } from "@matter/general";
|
|
8
|
+
import { FabricIndex as FabricIndexElement, FieldModel, ValueModel } from "@matter/model";
|
|
9
|
+
import type { Val } from "@matter/protocol";
|
|
10
|
+
import type { FabricIndex } from "@matter/types";
|
|
11
|
+
import { memberSlotOf, memberValueOf } from "../managed/MemberKeys.js";
|
|
12
|
+
|
|
13
|
+
const FIELD_ID = FabricIndexElement.id;
|
|
14
|
+
const FIELD_NAME = FabricIndexElement.name;
|
|
15
|
+
const FIELD_PROPERTY = camelize(FIELD_NAME);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* True when `schema` is the spec-defined FabricIndex field of a fabric-scoped struct — same id/name match
|
|
19
|
+
* `ObjectSchema.encodeEntryToTlv` uses to gate the wire-level strip. Per spec the id+name combination is reserved
|
|
20
|
+
* for this purpose; no other struct field can re-use it.
|
|
21
|
+
* @see {@link MatterSpecification.v161.Core} § 7.13.6
|
|
22
|
+
*/
|
|
23
|
+
export function isFabricIndexField(schema: ValueModel): boolean {
|
|
24
|
+
return schema instanceof FieldModel && schema.id === FIELD_ID && schema.name === FIELD_NAME;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The slot under which a name-keyed fabric-scoped struct holds its FabricIndex: the property name, else the TLV tag
|
|
29
|
+
* number, as struct validation reads a field. Undefined if the struct holds none.
|
|
30
|
+
*/
|
|
31
|
+
export function fabricIndexSlotOf(struct: Val.Struct) {
|
|
32
|
+
return memberSlotOf(struct, FIELD_PROPERTY, FIELD_ID);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The FabricIndex a name-keyed fabric-scoped struct holds; see {@link fabricIndexSlotOf}.
|
|
37
|
+
*/
|
|
38
|
+
export function fabricIndexOf(struct: Val.Struct): Val {
|
|
39
|
+
return memberValueOf(struct, FIELD_PROPERTY, FIELD_ID);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* {@link struct} with {@link fabricIndex} as its FabricIndex, under the slot it already uses for it, else under the
|
|
44
|
+
* property name. Returns {@link struct} itself if it already holds that index.
|
|
45
|
+
*/
|
|
46
|
+
export function withFabricIndex(struct: Val.Struct, fabricIndex: FabricIndex): Val.Struct {
|
|
47
|
+
if (fabricIndexOf(struct) === fabricIndex) {
|
|
48
|
+
return struct;
|
|
49
|
+
}
|
|
50
|
+
return { ...struct, [fabricIndexSlotOf(struct) ?? FIELD_PROPERTY]: fabricIndex };
|
|
51
|
+
}
|
|
@@ -20,7 +20,7 @@ import { BitmapEncodedValue, FabricIndex, Status } from "@matter/types";
|
|
|
20
20
|
import { RootSupervisor } from "../../supervision/RootSupervisor.js";
|
|
21
21
|
import { maybeConfigOf } from "../../supervision/SupervisionConfig.js";
|
|
22
22
|
import type { ValueSupervisor } from "../../supervision/ValueSupervisor.js";
|
|
23
|
-
import {
|
|
23
|
+
import { memberValueOf } from "../managed/MemberKeys.js";
|
|
24
24
|
import {
|
|
25
25
|
assertArray,
|
|
26
26
|
assertBoolean,
|
|
@@ -34,29 +34,12 @@ import {
|
|
|
34
34
|
import { astToFunction } from "./conformance-compiler.js";
|
|
35
35
|
import { createConformanceValidator } from "./conformance.js";
|
|
36
36
|
import { createConstraintValidator } from "./constraint.js";
|
|
37
|
-
import {
|
|
37
|
+
import { isFabricIndexField } from "./FabricIndexField.js";
|
|
38
38
|
import { ValidationLocation } from "./location.js";
|
|
39
|
-
import {
|
|
39
|
+
import { leaveErrorsToRemote } from "./remote-validation.js";
|
|
40
40
|
|
|
41
41
|
const logger = Logger.get("ValueValidator");
|
|
42
42
|
|
|
43
|
-
/**
|
|
44
|
-
* Wrap a datatype validator so peer (client) writes forward datatype violations the device may still accept (see
|
|
45
|
-
* {@link forwardValidationToPeer}). Conformance violations are forwarded separately in {@link createConformanceValidator}
|
|
46
|
-
* so that datatype validation still runs after a forwarded conformance failure.
|
|
47
|
-
*/
|
|
48
|
-
function forwardableForClientPeer(inner: ValueSupervisor.Validate): ValueSupervisor.Validate {
|
|
49
|
-
return (value, session, location) => {
|
|
50
|
-
try {
|
|
51
|
-
inner(value, session, location);
|
|
52
|
-
} catch (e) {
|
|
53
|
-
if (!forwardValidationToPeer(session, e)) {
|
|
54
|
-
throw e;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
43
|
/**
|
|
61
44
|
* Generate a function that performs data validation.
|
|
62
45
|
*
|
|
@@ -65,7 +48,7 @@ function forwardableForClientPeer(inner: ValueSupervisor.Validate): ValueSupervi
|
|
|
65
48
|
*/
|
|
66
49
|
export function ValueValidator(schema: Schema, supervisor: RootSupervisor): ValueSupervisor.Validate | undefined {
|
|
67
50
|
if (schema instanceof ClusterModel) {
|
|
68
|
-
return
|
|
51
|
+
return leaveErrorsToRemote(supervisor, createStructValidator(schema, supervisor));
|
|
69
52
|
}
|
|
70
53
|
|
|
71
54
|
let validator: ValueSupervisor.Validate | undefined;
|
|
@@ -141,7 +124,8 @@ export function ValueValidator(schema: Schema, supervisor: RootSupervisor): Valu
|
|
|
141
124
|
|
|
142
125
|
validator = createNullValidator(schema, validator);
|
|
143
126
|
|
|
144
|
-
|
|
127
|
+
// Catches undefined enum values, reserved bitmap bits and struct-choice conformance errors
|
|
128
|
+
validator = validator && leaveErrorsToRemote(supervisor, validator);
|
|
145
129
|
|
|
146
130
|
validator = createConformanceValidator(schema, supervisor, validator);
|
|
147
131
|
|
|
@@ -283,8 +267,6 @@ function createBitmapValidator(schema: ValueModel, supervisor: RootSupervisor):
|
|
|
283
267
|
}
|
|
284
268
|
}
|
|
285
269
|
|
|
286
|
-
// The bound stays local, so it runs with the structural checks: a conformance or reserved-bit failure is
|
|
287
|
-
// forwarded for a peer write, which unwinds the validator before anything after it
|
|
288
270
|
validateMagnitude?.(value, session, location);
|
|
289
271
|
|
|
290
272
|
// A bit's conformance says whether the bit may be set, never that it must be, because every declared bit is
|
|
@@ -358,32 +340,16 @@ function createIntegerValidator(schema: ValueModel, supervisor: RootSupervisor,
|
|
|
358
340
|
|
|
359
341
|
const inner = createSimpleValidator(schema, supervisor, assertion);
|
|
360
342
|
|
|
361
|
-
//
|
|
362
|
-
//
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
const fieldName = schema.propertyName;
|
|
367
|
-
const fieldId = schema.id;
|
|
368
|
-
const fabricSentinelOrSubstitute: ValueSupervisor.Validate = (value, session, location) => {
|
|
369
|
-
const peerContext = session.clientPeerContext;
|
|
370
|
-
if (value !== FabricIndex.OMIT_FABRIC || peerContext === undefined) {
|
|
371
|
-
inner(value, session, location);
|
|
372
|
-
return;
|
|
373
|
-
}
|
|
374
|
-
const siblings = location.siblings as Val.Struct | undefined;
|
|
375
|
-
if (siblings !== undefined && peerContext.fabricIndexOnPeer !== undefined) {
|
|
376
|
-
// Substitute into the slot holding the sentinel — a name-keyed container may hold it under the
|
|
377
|
-
// field's TLV tag number, and writing another slot would leave two disagreeing fabricIndex values
|
|
378
|
-
siblings[memberSlotOf(siblings, fieldName, fieldId) ?? fieldName] = peerContext.fabricIndexOnPeer;
|
|
343
|
+
// The FabricIndex of a written fabric-scoped struct is ignored (Matter § 7.19.1.9.1) and the encoder leaves
|
|
344
|
+
// OMIT_FABRIC out of a write, so a value sent to a remote node may hold OMIT_FABRIC
|
|
345
|
+
if (isFabricIndexField(schema)) {
|
|
346
|
+
const acceptOmittedOutbound: ValueSupervisor.Validate = (value, session, location) => {
|
|
347
|
+
if (value === FabricIndex.OMIT_FABRIC && location.remote === "outbound") {
|
|
379
348
|
return;
|
|
380
349
|
}
|
|
381
|
-
|
|
382
|
-
"fabricIndex was not replaced with the peer's fabric index because it is not yet known; local cache will hold the OMIT_FABRIC sentinel (-1) until the peer's subscription delivers the real value at",
|
|
383
|
-
location.path,
|
|
384
|
-
);
|
|
350
|
+
inner(value, session, location);
|
|
385
351
|
};
|
|
386
|
-
return
|
|
352
|
+
return acceptOmittedOutbound;
|
|
387
353
|
}
|
|
388
354
|
|
|
389
355
|
return inner;
|
|
@@ -408,14 +374,13 @@ function createStructValidator(schema: Schema, supervisor: RootSupervisor): Valu
|
|
|
408
374
|
|
|
409
375
|
const config = location.config ?? maybeConfigOf(struct);
|
|
410
376
|
|
|
411
|
-
const sublocation = {
|
|
377
|
+
const sublocation: ValidationLocation = {
|
|
378
|
+
...location,
|
|
412
379
|
path: location.path.at(""),
|
|
413
380
|
siblings: struct,
|
|
414
381
|
choices: {},
|
|
415
|
-
outerResolve: location.outerResolve,
|
|
416
382
|
config,
|
|
417
|
-
|
|
418
|
-
} as ValidationLocation;
|
|
383
|
+
};
|
|
419
384
|
|
|
420
385
|
for (const name in validators) {
|
|
421
386
|
const { id, validate } = validators[name];
|
|
@@ -482,10 +447,15 @@ function createListValidator(schema: ValueModel, supervisor: RootSupervisor): Va
|
|
|
482
447
|
const entryConfig = location.config?.readonlyChild?.("entry");
|
|
483
448
|
|
|
484
449
|
let index = 0;
|
|
485
|
-
|
|
450
|
+
// An entry is not a member of the struct that holds the list, so it gets none of its context
|
|
451
|
+
const sublocation: ValidationLocation = {
|
|
452
|
+
...location,
|
|
486
453
|
path: location.path.at(""),
|
|
487
|
-
|
|
488
|
-
|
|
454
|
+
siblings: undefined,
|
|
455
|
+
choices: undefined,
|
|
456
|
+
outerResolve: undefined,
|
|
457
|
+
config: undefined,
|
|
458
|
+
};
|
|
489
459
|
// An index names the position in the list, which an entry holding no value occupies too
|
|
490
460
|
for (const e of list as Iterable<unknown>) {
|
|
491
461
|
if (e !== undefined && e !== null) {
|
|
@@ -8,7 +8,7 @@ import { RootSupervisor } from "#behavior/supervision/RootSupervisor.js";
|
|
|
8
8
|
import { ValueModel } from "@matter/model";
|
|
9
9
|
import { ValueSupervisor } from "../../supervision/ValueSupervisor.js";
|
|
10
10
|
import { astToFunction } from "./conformance-compiler.js";
|
|
11
|
-
import {
|
|
11
|
+
import { leaveToRemote, mayLeaveToRemote } from "./remote-validation.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Creates a function that validates a field based on its conformance definition.
|
|
@@ -21,12 +21,14 @@ export function createConformanceValidator(
|
|
|
21
21
|
supervisor: RootSupervisor,
|
|
22
22
|
nextValidator?: ValueSupervisor.Validate,
|
|
23
23
|
): ValueSupervisor.Validate | undefined {
|
|
24
|
-
const
|
|
24
|
+
const conformance = astToFunction(schema, supervisor);
|
|
25
25
|
|
|
26
|
-
if (!
|
|
26
|
+
if (!conformance && !nextValidator) {
|
|
27
27
|
return undefined;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
const remoteDecides = mayLeaveToRemote(supervisor);
|
|
31
|
+
|
|
30
32
|
return (value, session, location) => {
|
|
31
33
|
const cfg = location.config?.supervision;
|
|
32
34
|
|
|
@@ -36,13 +38,13 @@ export function createConformanceValidator(
|
|
|
36
38
|
return;
|
|
37
39
|
}
|
|
38
40
|
|
|
41
|
+
// A conformance failure left to the device must still fall through to datatype validation below, so a
|
|
42
|
+
// wrong-typed value cannot slip onto the wire
|
|
39
43
|
if (cfg?.conformance !== false) {
|
|
40
44
|
try {
|
|
41
|
-
|
|
45
|
+
conformance?.(value, session, location);
|
|
42
46
|
} catch (e) {
|
|
43
|
-
|
|
44
|
-
// so a wrong-typed value cannot slip onto the wire.
|
|
45
|
-
if (!forwardValidationToPeer(session, e)) {
|
|
47
|
+
if (!remoteDecides || !leaveToRemote(location, e)) {
|
|
46
48
|
throw e;
|
|
47
49
|
}
|
|
48
50
|
}
|
|
@@ -12,6 +12,7 @@ import { ValueSupervisor } from "../../supervision/ValueSupervisor.js";
|
|
|
12
12
|
import { NameResolver } from "../managed/NameResolver.js";
|
|
13
13
|
import { assertArray, assertBoolean, assertNumeric, assertSequence, assertString } from "./assertions.js";
|
|
14
14
|
import { ValidationLocation } from "./location.js";
|
|
15
|
+
import { leaveErrorsToRemote } from "./remote-validation.js";
|
|
15
16
|
|
|
16
17
|
interface NameResolverFactory {
|
|
17
18
|
(location: ValidationLocation): (name: string) => Val;
|
|
@@ -84,12 +85,15 @@ export function createConstraintValidator(
|
|
|
84
85
|
return undefined;
|
|
85
86
|
}
|
|
86
87
|
|
|
88
|
+
// Wrap here, not in the caller: an error left to the device must not skip later checks such as list entries
|
|
89
|
+
const validate = leaveErrorsToRemote(supervisor, inner);
|
|
90
|
+
|
|
87
91
|
return (value, session, location) => {
|
|
88
92
|
const cfg = location.config?.supervision;
|
|
89
93
|
if (cfg?.validate === false || cfg?.constraint === false) {
|
|
90
94
|
return;
|
|
91
95
|
}
|
|
92
|
-
|
|
96
|
+
validate(value, session, location);
|
|
93
97
|
};
|
|
94
98
|
}
|
|
95
99
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { DataModelPath } from "@matter/model";
|
|
8
8
|
import { Val } from "@matter/protocol";
|
|
9
9
|
import type { Supervision } from "../../supervision/Supervision.js";
|
|
10
|
+
import type { leaveErrorsToRemote } from "./remote-validation.js";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Contextual information tracked during validation.
|
|
@@ -40,6 +41,13 @@ export interface ValidationLocation {
|
|
|
40
41
|
*/
|
|
41
42
|
owner?: unknown;
|
|
42
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Set if the values under validation are sent to a remote node (`"outbound"`) or received from one (`"inbound"`).
|
|
46
|
+
* A validation error of such a value may be left to the device to decide on rather than thrown; see
|
|
47
|
+
* {@link leaveErrorsToRemote}.
|
|
48
|
+
*/
|
|
49
|
+
remote?: "outbound" | "inbound";
|
|
50
|
+
|
|
43
51
|
/**
|
|
44
52
|
* Fallback resolver for cross-struct references. When a name cannot be resolved in siblings or the ownership
|
|
45
53
|
* hierarchy, the validator calls this function.
|