@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
|
@@ -241,9 +241,10 @@ export namespace Datasource {
|
|
|
241
241
|
defaults?: Val.Struct;
|
|
242
242
|
|
|
243
243
|
/**
|
|
244
|
-
* Optional storage for non-volatile values
|
|
244
|
+
* Optional storage for non-volatile values: a {@link PersistentStore}, or an {@link ExternallyMutableStore}
|
|
245
|
+
* for the values of a remote node.
|
|
245
246
|
*/
|
|
246
|
-
store?:
|
|
247
|
+
store?: PersistentStore | ExternallyMutableStore;
|
|
247
248
|
|
|
248
249
|
/**
|
|
249
250
|
* Adjusts persisted values in an outdated format, see {@link Behavior.migrate}. Does not apply to values that
|
|
@@ -271,14 +272,19 @@ export namespace Datasource {
|
|
|
271
272
|
}
|
|
272
273
|
|
|
273
274
|
/**
|
|
274
|
-
*
|
|
275
|
+
* What every store of a {@link Datasource} holds.
|
|
275
276
|
*/
|
|
276
277
|
export interface Store {
|
|
277
278
|
/**
|
|
278
279
|
* Initial values must be loaded beforehand. That allows the behavior to initialize synchronously.
|
|
279
280
|
*/
|
|
280
281
|
initialValues?: Val.Struct;
|
|
282
|
+
}
|
|
281
283
|
|
|
284
|
+
/**
|
|
285
|
+
* A {@link Store} the datasource writes changed values to.
|
|
286
|
+
*/
|
|
287
|
+
export interface PersistentStore extends Store {
|
|
282
288
|
/**
|
|
283
289
|
* Updates the values.
|
|
284
290
|
*
|
|
@@ -289,17 +295,49 @@ export namespace Datasource {
|
|
|
289
295
|
}
|
|
290
296
|
|
|
291
297
|
/**
|
|
292
|
-
*
|
|
298
|
+
* A {@link Store} that holds cached values of a remote node, which may mutate independently from the datasource.
|
|
299
|
+
*
|
|
300
|
+
* The datasource proposes a write to the remote node in two steps: {@link prepare} decides whether the values may
|
|
301
|
+
* go to the remote node, and the step it returns sends them.
|
|
293
302
|
*/
|
|
294
303
|
export interface ExternallyMutableStore extends Store {
|
|
304
|
+
/**
|
|
305
|
+
* Decide whether a transaction may propose {@link values} to the remote node, and return the step that sends
|
|
306
|
+
* them in commit phase one.
|
|
307
|
+
*
|
|
308
|
+
* Invoked once per commit cycle, after pre-commit settled and before any participant's commit phase one, so a
|
|
309
|
+
* refusal rejects the commit before any remote node receives a write. Must complete synchronously and must
|
|
310
|
+
* not write.
|
|
311
|
+
*
|
|
312
|
+
* The values are TLV-encoded only when the returned step sends them, so a value the encoder cannot write fails in
|
|
313
|
+
* commit phase one, when another remote node may already have received its write.
|
|
314
|
+
*
|
|
315
|
+
* @param path the path of the values, for a refusal
|
|
316
|
+
* @throws WriteError to refuse the values. Any other error, such as an `InternalError`, passes through the same
|
|
317
|
+
* way. Either rejects the commit and rolls the transaction back.
|
|
318
|
+
* @see {@link Transaction.Participant.settled}
|
|
319
|
+
*/
|
|
320
|
+
prepare(values: Val.Struct, path: DataModelPath): ExternallyMutableStore.Send;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Refuse every change of the values when the remote node takes no writes through this store. The datasource
|
|
324
|
+
* asks before it applies a change and before it joins the transaction, so the refusal comes where the change
|
|
325
|
+
* is made; {@link ValReference.assertWritable} states which checks run before and after. Must not write.
|
|
326
|
+
*
|
|
327
|
+
* @param path the path of the values, for the refusal
|
|
328
|
+
* @throws an error that says why the remote node takes no writes
|
|
329
|
+
*/
|
|
330
|
+
assertWritable(path: DataModelPath): void;
|
|
331
|
+
|
|
295
332
|
/**
|
|
296
333
|
* Apply values the peer reported.
|
|
297
334
|
*
|
|
298
|
-
* Uses the same patch semantics as {@link set}, but the values are the peer's own and take
|
|
299
|
-
*
|
|
300
|
-
* accepts them
|
|
301
|
-
*
|
|
302
|
-
*
|
|
335
|
+
* Uses the same patch semantics as {@link PersistentStore.set}, but the values are the peer's own and take
|
|
336
|
+
* effect at once. A write instead goes through {@link prepare} and leaves the local values unchanged until the
|
|
337
|
+
* peer accepts them. The values apply in memory before this first awaits, so a write the peer answers while
|
|
338
|
+
* they are still being stored sees them. Resolves once they are stored locally or queued for storage, also when storing them failed;
|
|
339
|
+
* the result then carries that failure for the caller to report. Their change notifications may follow later,
|
|
340
|
+
* when notifications of an earlier change are still held; do not await them.
|
|
303
341
|
*/
|
|
304
342
|
externalSet(values: Val.StructMap): Promise<ExternallyMutableStore.Applied>;
|
|
305
343
|
|
|
@@ -341,6 +379,14 @@ export namespace Datasource {
|
|
|
341
379
|
}
|
|
342
380
|
|
|
343
381
|
export namespace ExternallyMutableStore {
|
|
382
|
+
/**
|
|
383
|
+
* Sends prepared values to the remote node in commit phase one of {@link transaction}. The local values stay
|
|
384
|
+
* unchanged until the remote node accepts them.
|
|
385
|
+
*/
|
|
386
|
+
export interface Send {
|
|
387
|
+
(transaction: Transaction): MaybePromise<void>;
|
|
388
|
+
}
|
|
389
|
+
|
|
344
390
|
/**
|
|
345
391
|
* The result of {@link ExternallyMutableStore.externalSet}.
|
|
346
392
|
*/
|
|
@@ -352,7 +398,7 @@ export namespace Datasource {
|
|
|
352
398
|
persistFailure?: unknown;
|
|
353
399
|
}
|
|
354
400
|
|
|
355
|
-
export function is(store?:
|
|
401
|
+
export function is(store?: PersistentStore | ExternallyMutableStore): store is ExternallyMutableStore {
|
|
356
402
|
return store !== undefined && "externalSet" in store;
|
|
357
403
|
}
|
|
358
404
|
|
|
@@ -426,7 +472,7 @@ class DatasourceImpl implements Datasource, Datasource.ExternallyMutableStore.Co
|
|
|
426
472
|
supervisor;
|
|
427
473
|
location;
|
|
428
474
|
entropy;
|
|
429
|
-
store?: Datasource.
|
|
475
|
+
store?: Datasource.PersistentStore | Datasource.ExternallyMutableStore;
|
|
430
476
|
owner?: any;
|
|
431
477
|
onChange?: (attrs: string[]) => MaybePromise<void>;
|
|
432
478
|
|
|
@@ -457,10 +503,20 @@ class DatasourceImpl implements Datasource, Datasource.ExternallyMutableStore.Co
|
|
|
457
503
|
supervisionConfig?: GlobalConfig;
|
|
458
504
|
|
|
459
505
|
/**
|
|
460
|
-
*
|
|
461
|
-
*
|
|
506
|
+
* {@link store} when it is a {@link Datasource.ExternallyMutableStore}, i.e. the values are a copy of a remote
|
|
507
|
+
* node's values and a write goes to that node rather than to local persistence.
|
|
462
508
|
*/
|
|
463
|
-
readonly
|
|
509
|
+
readonly remoteStore?: Datasource.ExternallyMutableStore;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* True when the datasource has a {@link remoteStore}.
|
|
513
|
+
*
|
|
514
|
+
* A validation error of a value sent to the remote node is left to the device, and a session of our own server
|
|
515
|
+
* node sees a fabric-scoped list unfiltered, as its fabric is not one of the remote node.
|
|
516
|
+
*/
|
|
517
|
+
get mirrorsRemote() {
|
|
518
|
+
return this.remoteStore !== undefined;
|
|
519
|
+
}
|
|
464
520
|
|
|
465
521
|
observedInteractions?: Set<
|
|
466
522
|
| NonNullable<ValueSupervisor.RemoteActorSession["interactionComplete"]>
|
|
@@ -477,7 +533,9 @@ class DatasourceImpl implements Datasource, Datasource.ExternallyMutableStore.Co
|
|
|
477
533
|
this.location = options.location;
|
|
478
534
|
this.entropy = options.entropy;
|
|
479
535
|
this.store = options.store;
|
|
480
|
-
|
|
536
|
+
if (Datasource.ExternallyMutableStore.is(options.store)) {
|
|
537
|
+
this.remoteStore = options.store;
|
|
538
|
+
}
|
|
481
539
|
this.owner = options.owner;
|
|
482
540
|
this.onChange = options.onChange;
|
|
483
541
|
this.primaryKey = options.primaryKey === "id" ? "id" : "name";
|
|
@@ -935,6 +993,11 @@ class RootReference implements ValReference<Val.Struct>, Transaction.Participant
|
|
|
935
993
|
#precommitValues: Val.Struct | undefined;
|
|
936
994
|
#changes: CommitChanges | undefined;
|
|
937
995
|
|
|
996
|
+
/**
|
|
997
|
+
* Containers this session cloned since its last commit or rollback; see {@link owns}.
|
|
998
|
+
*/
|
|
999
|
+
#owned = new WeakSet<object>();
|
|
1000
|
+
|
|
938
1001
|
/**
|
|
939
1002
|
* Keys of the members this session assigned since its last commit or rollback, whether or not the value differs.
|
|
940
1003
|
*/
|
|
@@ -958,6 +1021,19 @@ class RootReference implements ValReference<Val.Struct>, Transaction.Participant
|
|
|
958
1021
|
#fields: Set<string>;
|
|
959
1022
|
#context!: SessionContext;
|
|
960
1023
|
|
|
1024
|
+
/**
|
|
1025
|
+
* The step the remote store prepared in {@link settled}, for this commit cycle's phase one.
|
|
1026
|
+
*/
|
|
1027
|
+
#send: Datasource.ExternallyMutableStore.Send | undefined;
|
|
1028
|
+
|
|
1029
|
+
/**
|
|
1030
|
+
* Present only on a reference to the values of a remote node. The remote store decides on the proposal before any
|
|
1031
|
+
* participant's commit phase one, so a refusal by one remote node leaves every remote node of the transaction
|
|
1032
|
+
* unwritten. Absent on other references, because a transaction enters its settled status only when a participant
|
|
1033
|
+
* has this hook.
|
|
1034
|
+
*/
|
|
1035
|
+
readonly settled?: () => void;
|
|
1036
|
+
|
|
961
1037
|
constructor(resource: Transaction.Resource, internals: DatasourceImpl, session: ValueSupervisor.Session) {
|
|
962
1038
|
this.#resource = resource;
|
|
963
1039
|
this.#internals = internals;
|
|
@@ -991,6 +1067,14 @@ class RootReference implements ValReference<Val.Struct>, Transaction.Participant
|
|
|
991
1067
|
} else {
|
|
992
1068
|
this.supervisionConfig = new LocalConfig(internals.supervisionConfig);
|
|
993
1069
|
}
|
|
1070
|
+
|
|
1071
|
+
const store = internals.remoteStore;
|
|
1072
|
+
if (store !== undefined) {
|
|
1073
|
+
this.settled = () => {
|
|
1074
|
+
const proposed = this.#proposedValues();
|
|
1075
|
+
this.#send = proposed === undefined ? undefined : store.prepare(proposed, internals.location.path);
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
994
1078
|
}
|
|
995
1079
|
|
|
996
1080
|
/**
|
|
@@ -1007,7 +1091,7 @@ class RootReference implements ValReference<Val.Struct>, Transaction.Participant
|
|
|
1007
1091
|
onChange: (oldValues: Val.Struct) => {
|
|
1008
1092
|
if (this.#values === oldValues) {
|
|
1009
1093
|
this.#values = this.#internals.values;
|
|
1010
|
-
this.#refreshSubrefs();
|
|
1094
|
+
this.#refreshSubrefs("external");
|
|
1011
1095
|
}
|
|
1012
1096
|
},
|
|
1013
1097
|
};
|
|
@@ -1024,7 +1108,6 @@ class RootReference implements ValReference<Val.Struct>, Transaction.Participant
|
|
|
1024
1108
|
try {
|
|
1025
1109
|
this.#internals.sessions?.delete(this.#session);
|
|
1026
1110
|
this.#expired = true;
|
|
1027
|
-
this.#refreshSubrefs();
|
|
1028
1111
|
} catch (e) {
|
|
1029
1112
|
logger.warn(
|
|
1030
1113
|
`Error detaching reference to ${this.#internals.location.path} from closed transaction ${transaction.via}:`,
|
|
@@ -1042,10 +1125,6 @@ class RootReference implements ValReference<Val.Struct>, Transaction.Participant
|
|
|
1042
1125
|
|
|
1043
1126
|
// -- ValReference implementation --
|
|
1044
1127
|
|
|
1045
|
-
get original() {
|
|
1046
|
-
return this.#internals.values;
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
1128
|
get value() {
|
|
1050
1129
|
if (this.#expired) {
|
|
1051
1130
|
throw new ExpiredReferenceError(this.location);
|
|
@@ -1053,10 +1132,6 @@ class RootReference implements ValReference<Val.Struct>, Transaction.Participant
|
|
|
1053
1132
|
return this.#values;
|
|
1054
1133
|
}
|
|
1055
1134
|
|
|
1056
|
-
set value(_value) {
|
|
1057
|
-
throw new InternalError(`Cannot set root reference for ${this.#internals.supervisor.schema.name}`);
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
1135
|
get expired() {
|
|
1061
1136
|
return this.#expired;
|
|
1062
1137
|
}
|
|
@@ -1073,10 +1148,29 @@ class RootReference implements ValReference<Val.Struct>, Transaction.Participant
|
|
|
1073
1148
|
return this.#internals.owner;
|
|
1074
1149
|
}
|
|
1075
1150
|
|
|
1076
|
-
|
|
1151
|
+
get mirrorsRemote() {
|
|
1152
|
+
return this.#internals.mirrorsRemote;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
owns(container: Val) {
|
|
1156
|
+
return typeof container === "object" && container !== null && this.#owned.has(container);
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
adopt(container: Val) {
|
|
1160
|
+
if (typeof container === "object" && container !== null) {
|
|
1161
|
+
this.#owned.add(container);
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
assertWritable() {
|
|
1077
1166
|
if (this.#expired) {
|
|
1078
1167
|
throw new ExpiredReferenceError(this.location);
|
|
1079
1168
|
}
|
|
1169
|
+
this.#internals.remoteStore?.assertWritable(this.location.path);
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
change(mutator: () => void, member: string | number) {
|
|
1173
|
+
this.assertWritable();
|
|
1080
1174
|
|
|
1081
1175
|
// Join the transaction
|
|
1082
1176
|
this.#startWrite();
|
|
@@ -1116,17 +1210,19 @@ class RootReference implements ValReference<Val.Struct>, Transaction.Participant
|
|
|
1116
1210
|
}
|
|
1117
1211
|
|
|
1118
1212
|
// Point subreferences to the clone
|
|
1119
|
-
this.#refreshSubrefs();
|
|
1213
|
+
this.#refreshSubrefs("session");
|
|
1120
1214
|
}
|
|
1121
1215
|
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1216
|
+
// A mutator that throws may already have changed or restored values
|
|
1217
|
+
try {
|
|
1218
|
+
if (this.#internals.mirrorsRemote) {
|
|
1219
|
+
this.#mutateRecording(mutator, member);
|
|
1220
|
+
} else {
|
|
1221
|
+
mutator();
|
|
1222
|
+
}
|
|
1223
|
+
} finally {
|
|
1224
|
+
this.#refreshSubrefs("session");
|
|
1126
1225
|
}
|
|
1127
|
-
|
|
1128
|
-
// Refresh subrefs referencing any mutated values
|
|
1129
|
-
this.#refreshSubrefs();
|
|
1130
1226
|
}
|
|
1131
1227
|
|
|
1132
1228
|
/**
|
|
@@ -1214,23 +1310,35 @@ class RootReference implements ValReference<Val.Struct>, Transaction.Participant
|
|
|
1214
1310
|
}
|
|
1215
1311
|
|
|
1216
1312
|
/**
|
|
1217
|
-
* For commit phase one we pass values to the store if present. For a
|
|
1313
|
+
* For commit phase one we pass values to the store if present. For the values of a remote node the store is the
|
|
1314
|
+
* remote store, and phase one runs the step the store prepared in {@link settled}.
|
|
1218
1315
|
*/
|
|
1219
1316
|
commit1() {
|
|
1220
1317
|
// Staging is per commit: a claim from a cycle the store refused must not be honoured by a later one
|
|
1221
1318
|
this.#stagedFeaturesKey = false;
|
|
1222
1319
|
this.#stagedMigration = false;
|
|
1223
1320
|
|
|
1224
|
-
const
|
|
1321
|
+
const { store } = this.#internals;
|
|
1322
|
+
if (Datasource.ExternallyMutableStore.is(store)) {
|
|
1323
|
+
const send = this.#send;
|
|
1324
|
+
this.#send = undefined;
|
|
1325
|
+
if (send !== undefined) {
|
|
1326
|
+
return send(this.#session.transaction);
|
|
1327
|
+
}
|
|
1328
|
+
if (this.#proposedValues() !== undefined) {
|
|
1329
|
+
throw new InternalError(
|
|
1330
|
+
`${this} reached commit phase one with values the remote store did not prepare`,
|
|
1331
|
+
);
|
|
1332
|
+
}
|
|
1333
|
+
return;
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
const stored = this.#computeStoredChanges();
|
|
1225
1337
|
if (!stored) {
|
|
1226
1338
|
return;
|
|
1227
1339
|
}
|
|
1228
1340
|
|
|
1229
|
-
if (
|
|
1230
|
-
!this.#internals.mirrorsRemote &&
|
|
1231
|
-
this.#internals.featuresKey !== undefined &&
|
|
1232
|
-
!this.#internals.featuresKeyPersisted
|
|
1233
|
-
) {
|
|
1341
|
+
if (this.#internals.featuresKey !== undefined && !this.#internals.featuresKeyPersisted) {
|
|
1234
1342
|
stored[FEATURES_KEY] = this.#internals.featuresKey;
|
|
1235
1343
|
for (const key of this.#internals.discardedStoreKeys ?? []) {
|
|
1236
1344
|
if (!(key in stored)) {
|
|
@@ -1250,7 +1358,7 @@ class RootReference implements ValReference<Val.Struct>, Transaction.Participant
|
|
|
1250
1358
|
this.#stagedMigration = true;
|
|
1251
1359
|
}
|
|
1252
1360
|
|
|
1253
|
-
return
|
|
1361
|
+
return store?.set(this.#session.transaction, stored);
|
|
1254
1362
|
}
|
|
1255
1363
|
|
|
1256
1364
|
/**
|
|
@@ -1259,6 +1367,12 @@ class RootReference implements ValReference<Val.Struct>, Transaction.Participant
|
|
|
1259
1367
|
commit2() {
|
|
1260
1368
|
this.#assigned = undefined;
|
|
1261
1369
|
|
|
1370
|
+
// The clones become canonical, so the next write must clone them again
|
|
1371
|
+
this.#owned = new WeakSet();
|
|
1372
|
+
|
|
1373
|
+
// The next announcement diffs against the canonical value, which another transaction may change meanwhile
|
|
1374
|
+
this.#precommitValues = undefined;
|
|
1375
|
+
|
|
1262
1376
|
if (!this.#changes) {
|
|
1263
1377
|
return;
|
|
1264
1378
|
}
|
|
@@ -1317,12 +1431,14 @@ class RootReference implements ValReference<Val.Struct>, Transaction.Participant
|
|
|
1317
1431
|
rollback() {
|
|
1318
1432
|
this.#values = this.#internals.values;
|
|
1319
1433
|
this.#assigned = undefined;
|
|
1434
|
+
this.#owned = new WeakSet();
|
|
1435
|
+
this.#send = undefined;
|
|
1320
1436
|
|
|
1321
1437
|
// A rolled back value was never adopted, so it must not stand as the baseline the next announcement diffs
|
|
1322
1438
|
// against
|
|
1323
1439
|
this.#precommitValues = undefined;
|
|
1324
1440
|
|
|
1325
|
-
this.#refreshSubrefs();
|
|
1441
|
+
this.#refreshSubrefs("session");
|
|
1326
1442
|
}
|
|
1327
1443
|
|
|
1328
1444
|
// -- Private helpers --
|
|
@@ -1370,11 +1486,11 @@ class RootReference implements ValReference<Val.Struct>, Transaction.Participant
|
|
|
1370
1486
|
}
|
|
1371
1487
|
}
|
|
1372
1488
|
|
|
1373
|
-
#refreshSubrefs() {
|
|
1489
|
+
#refreshSubrefs(cause: ValReference.RefreshCause) {
|
|
1374
1490
|
const subrefs = this.subrefs;
|
|
1375
1491
|
if (subrefs) {
|
|
1376
1492
|
for (const key in subrefs) {
|
|
1377
|
-
subrefs[key].refresh();
|
|
1493
|
+
subrefs[key].refresh(cause);
|
|
1378
1494
|
}
|
|
1379
1495
|
}
|
|
1380
1496
|
}
|
|
@@ -1403,25 +1519,32 @@ class RootReference implements ValReference<Val.Struct>, Transaction.Participant
|
|
|
1403
1519
|
}
|
|
1404
1520
|
|
|
1405
1521
|
/**
|
|
1406
|
-
*
|
|
1522
|
+
* The values a session proposes to the remote node whose values the datasource holds, or undefined if none.
|
|
1407
1523
|
*
|
|
1408
|
-
*
|
|
1409
|
-
*
|
|
1410
|
-
*
|
|
1524
|
+
* The remote node is the only writer of its values, so nothing changes locally. Every member this session assigned
|
|
1525
|
+
* goes to the remote node, also an unchanged one: the device decides, not our copy of its state. The store settles
|
|
1526
|
+
* what the device accepts.
|
|
1411
1527
|
*/
|
|
1412
|
-
#
|
|
1413
|
-
this.#changes = undefined;
|
|
1414
|
-
|
|
1528
|
+
#proposedValues() {
|
|
1415
1529
|
if (this.#internals.values === this.#values) {
|
|
1416
1530
|
return;
|
|
1417
1531
|
}
|
|
1418
1532
|
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1533
|
+
let proposed: Val.Struct | undefined;
|
|
1534
|
+
for (const name of this.#assigned ?? []) {
|
|
1535
|
+
(proposed ??= {})[name] = this.#values[name];
|
|
1536
|
+
}
|
|
1537
|
+
return proposed;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
/**
|
|
1541
|
+
* Compute the local changes of this commit and return the values that go to the store.
|
|
1542
|
+
*/
|
|
1543
|
+
#computeStoredChanges() {
|
|
1544
|
+
this.#changes = undefined;
|
|
1545
|
+
|
|
1546
|
+
if (this.#internals.values === this.#values) {
|
|
1547
|
+
return;
|
|
1425
1548
|
}
|
|
1426
1549
|
|
|
1427
1550
|
const { storeFields } = this.#internals;
|
|
@@ -8,7 +8,8 @@ import type { Val } from "@matter/protocol";
|
|
|
8
8
|
import type { ValReference } from "./ValReference.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* API for bypassing managed collections
|
|
11
|
+
* API for bypassing managed collections: access to the internal object containing raw data, and raw copies of
|
|
12
|
+
* incoming values.
|
|
12
13
|
*/
|
|
13
14
|
export namespace Internal {
|
|
14
15
|
export const reference = Symbol("reference");
|
|
@@ -19,53 +20,62 @@ export namespace Internal {
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
+
* The reference behind a managed value, or `undefined` for any other value.
|
|
24
|
+
*/
|
|
25
|
+
export function referenceOf(value: Val): ValReference<Val.Collection> | undefined {
|
|
26
|
+
if (value === null || typeof value !== "object") {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
return (value as Partial<Collection>)[reference];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The raw value behind a managed proxy, or `value` itself. Unlike {@link copy}, the result is the stored object,
|
|
34
|
+
* so a list entry reference bound to one of its entries stays live when the value is stored back.
|
|
35
|
+
*/
|
|
36
|
+
export function rawOf(value: Val): Val {
|
|
37
|
+
const ref = referenceOf(value);
|
|
38
|
+
return ref ? ref.value : value;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Copy an incoming value tree into raw data for a manager to store.
|
|
23
43
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
44
|
+
* A managed proxy is replaced by a copy of its raw value, including the entries of other fabrics. Every array and
|
|
45
|
+
* every plain object is copied, so the stored value shares no array or plain object with the committed state, with
|
|
46
|
+
* another reference or with the caller. A nested write changes a container in place once the transaction owns it,
|
|
47
|
+
* so a shared container would change in both places. A copied object keeps its symbol-keyed properties, such as
|
|
48
|
+
* `BitmapEncodedValue`, with the same values.
|
|
49
|
+
*
|
|
50
|
+
* Primitives, Uint8Array, Date and other class instances pass through unchanged.
|
|
26
51
|
*/
|
|
27
|
-
export function
|
|
52
|
+
export function copy(value: Val): Val {
|
|
28
53
|
if (value === null || value === undefined || typeof value !== "object") {
|
|
29
54
|
return value;
|
|
30
55
|
}
|
|
31
56
|
|
|
32
|
-
|
|
33
|
-
const ref = (value as Collection)[reference];
|
|
57
|
+
const ref = referenceOf(value);
|
|
34
58
|
if (ref) {
|
|
35
|
-
return
|
|
59
|
+
return copy(ref.value);
|
|
36
60
|
}
|
|
37
61
|
|
|
38
62
|
if (Array.isArray(value)) {
|
|
39
|
-
|
|
40
|
-
const result = new Array(value.length);
|
|
41
|
-
|
|
42
|
-
for (let i = 0; i < value.length; i++) {
|
|
43
|
-
const child = unmanage(value[i]);
|
|
44
|
-
if (child !== value[i]) {
|
|
45
|
-
changed = true;
|
|
46
|
-
}
|
|
47
|
-
result[i] = child;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return changed ? result : value;
|
|
63
|
+
return value.map(copy);
|
|
51
64
|
}
|
|
52
65
|
|
|
53
66
|
const proto = Object.getPrototypeOf(value);
|
|
54
|
-
if (proto
|
|
55
|
-
|
|
56
|
-
const result = {} as Record<string, Val>;
|
|
57
|
-
|
|
58
|
-
for (const key in value as Record<string, Val>) {
|
|
59
|
-
const child = unmanage((value as Record<string, Val>)[key]);
|
|
60
|
-
if (child !== (value as Record<string, Val>)[key]) {
|
|
61
|
-
changed = true;
|
|
62
|
-
}
|
|
63
|
-
result[key] = child;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return changed ? result : value;
|
|
67
|
+
if (proto !== Object.prototype && proto !== null) {
|
|
68
|
+
return value;
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
|
|
71
|
+
const source = value as Val.Struct;
|
|
72
|
+
const result: Val.Struct = {};
|
|
73
|
+
for (const key in source) {
|
|
74
|
+
result[key] = copy(source[key]);
|
|
75
|
+
}
|
|
76
|
+
for (const symbol of Object.getOwnPropertySymbols(source)) {
|
|
77
|
+
Object.defineProperty(result, symbol, Object.getOwnPropertyDescriptor(source, symbol)!);
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
70
80
|
}
|
|
71
81
|
}
|