@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
|
@@ -4,26 +4,18 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { isObject, serialize } from "@matter/general";
|
|
7
|
+
import { InternalError, isObject, serialize } from "@matter/general";
|
|
8
8
|
import type { Schema } from "@matter/model";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
AccessControl,
|
|
12
|
-
ExpiredReferenceError,
|
|
13
|
-
hasLocalActor,
|
|
14
|
-
hasRemoteActor,
|
|
15
|
-
ReadError,
|
|
16
|
-
SchemaImplementationError,
|
|
17
|
-
Val,
|
|
18
|
-
WriteError,
|
|
19
|
-
} from "@matter/protocol";
|
|
9
|
+
import { AttributeModel, DataModelPath, ValueModel } from "@matter/model";
|
|
10
|
+
import { AccessControl, hasRemoteActor, ReadError, SchemaImplementationError, Val, WriteError } from "@matter/protocol";
|
|
20
11
|
import { Status } from "@matter/types";
|
|
21
12
|
import type { RootSupervisor } from "../../../supervision/RootSupervisor.js";
|
|
22
13
|
import type { ValueSupervisor } from "../../../supervision/ValueSupervisor.js";
|
|
23
14
|
import type { ValidationLocation } from "../../validation/location.js";
|
|
24
15
|
import { Internal } from "../Internal.js";
|
|
25
16
|
import { ManagedReference } from "../ManagedReference.js";
|
|
26
|
-
import
|
|
17
|
+
import { ReadOnlyReference } from "../ReadOnlyReference.js";
|
|
18
|
+
import { ValReference } from "../ValReference.js";
|
|
27
19
|
import { PrimitiveManager } from "./PrimitiveManager.js";
|
|
28
20
|
|
|
29
21
|
/**
|
|
@@ -54,18 +46,6 @@ export function ListManager(owner: RootSupervisor, schema: Schema): ValueSupervi
|
|
|
54
46
|
};
|
|
55
47
|
}
|
|
56
48
|
|
|
57
|
-
/**
|
|
58
|
-
* Whether a list holds fabric-scoped entries that a remote actor may see filtered by fabric: `F` access, or an attribute
|
|
59
|
-
* with `S` access. `S` on a struct field only hides that field from other fabrics.
|
|
60
|
-
*/
|
|
61
|
-
export function isFabricScopedList(schema: Schema) {
|
|
62
|
-
return schema.effectiveAccess.fabric === Access.Fabric.Scoped || isFabricSensitiveList(schema);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function isFabricSensitiveList(schema: Schema) {
|
|
66
|
-
return schema instanceof AttributeModel && schema.fabricSensitive;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
49
|
function createConfig(owner: RootSupervisor, schema: Schema): ListConfig {
|
|
70
50
|
const entry = schema instanceof ValueModel ? schema.listEntry : undefined;
|
|
71
51
|
if (entry === undefined) {
|
|
@@ -75,12 +55,10 @@ function createConfig(owner: RootSupervisor, schema: Schema): ListConfig {
|
|
|
75
55
|
const entryManager = owner.get(entry);
|
|
76
56
|
|
|
77
57
|
const access = AccessControl(schema);
|
|
78
|
-
const fabricSensitive = isFabricSensitiveList(schema);
|
|
79
|
-
|
|
80
58
|
return {
|
|
81
59
|
schema,
|
|
82
|
-
fabricScoped:
|
|
83
|
-
fabricSensitive,
|
|
60
|
+
fabricScoped: schema instanceof ValueModel && schema.fabricScopedList,
|
|
61
|
+
fabricSensitive: schema instanceof AttributeModel && schema.fabricSensitive,
|
|
84
62
|
manageEntries: entryManager.manage !== PrimitiveManager,
|
|
85
63
|
manageEntry: entryManager.manage,
|
|
86
64
|
validateEntry: entryManager.validate,
|
|
@@ -100,7 +78,6 @@ interface ListConfig {
|
|
|
100
78
|
authorizeWrite: AccessControl["authorizeWrite"];
|
|
101
79
|
}
|
|
102
80
|
|
|
103
|
-
const assertWriteOkAlways = () => true;
|
|
104
81
|
const cloneEntry = (val: Val) => (Array.isArray(val) ? [...(val as Val.List)] : isObject(val) ? { ...val } : val);
|
|
105
82
|
const inspectCustom = Symbol.for("nodejs.util.inspect.custom");
|
|
106
83
|
|
|
@@ -112,6 +89,35 @@ function inspectList(this: Val.List) {
|
|
|
112
89
|
return [...this];
|
|
113
90
|
}
|
|
114
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Maximum number of entries in a list: list indices are 16 bits wide.
|
|
94
|
+
*/
|
|
95
|
+
const MAX_LIST_LENGTH = 65536;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Array methods that add, remove, overwrite, move or insert entries. The proxy runs them on a plain array of the
|
|
99
|
+
* visible entries; see {@link ListProxyHandler.editEntries}.
|
|
100
|
+
*/
|
|
101
|
+
const entryEdits = new Map<PropertyKey, (...args: never[]) => unknown>([
|
|
102
|
+
["copyWithin", Array.prototype.copyWithin],
|
|
103
|
+
["fill", Array.prototype.fill],
|
|
104
|
+
["pop", Array.prototype.pop],
|
|
105
|
+
["push", Array.prototype.push],
|
|
106
|
+
["reverse", Array.prototype.reverse],
|
|
107
|
+
["shift", Array.prototype.shift],
|
|
108
|
+
["sort", Array.prototype.sort],
|
|
109
|
+
["splice", Array.prototype.splice],
|
|
110
|
+
["unshift", Array.prototype.unshift],
|
|
111
|
+
]);
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The list index a property key names, or `undefined` for any other key. Like an array, the list treats only the
|
|
115
|
+
* canonical decimal form as an index, so `"1.5"` and `"01"` are not indices.
|
|
116
|
+
*/
|
|
117
|
+
function entryIndexFor(property: PropertyKey) {
|
|
118
|
+
return typeof property === "string" && /^(0|[1-9]\d*)$/.test(property) ? Number.parseInt(property) : undefined;
|
|
119
|
+
}
|
|
120
|
+
|
|
115
121
|
class ListProxyHandler implements ProxyHandler<Val.List> {
|
|
116
122
|
protected reference: ValReference<Val.List>;
|
|
117
123
|
protected session: ValueSupervisor.Session;
|
|
@@ -126,18 +132,16 @@ class ListProxyHandler implements ProxyHandler<Val.List> {
|
|
|
126
132
|
...reference.location,
|
|
127
133
|
path: reference.location.path.at(-1),
|
|
128
134
|
owner: reference.rootOwner,
|
|
135
|
+
remote: reference.mirrorsRemote ? "outbound" : undefined,
|
|
129
136
|
};
|
|
130
137
|
}
|
|
131
138
|
|
|
132
139
|
protected readVal() {
|
|
133
|
-
return this.reference
|
|
140
|
+
return ValReference.containerOf(this.reference);
|
|
134
141
|
}
|
|
135
142
|
|
|
136
143
|
protected writeVal() {
|
|
137
|
-
|
|
138
|
-
throw new ExpiredReferenceError(this.reference.location);
|
|
139
|
-
}
|
|
140
|
-
return this.reference.value;
|
|
144
|
+
return ValReference.writableContainerOf(this.reference);
|
|
141
145
|
}
|
|
142
146
|
|
|
143
147
|
protected getListLength() {
|
|
@@ -145,10 +149,14 @@ class ListProxyHandler implements ProxyHandler<Val.List> {
|
|
|
145
149
|
}
|
|
146
150
|
|
|
147
151
|
protected setListLength(length: number) {
|
|
148
|
-
|
|
149
|
-
|
|
152
|
+
this.config.authorizeWrite(this.session, this.reference.location);
|
|
153
|
+
if (!Number.isInteger(length) || length < 0) {
|
|
154
|
+
throw new WriteError(this.reference.location, `Length ${length} is not a valid list length`);
|
|
155
|
+
}
|
|
156
|
+
if (length > this.getListLength()) {
|
|
157
|
+
throw new WriteError(this.reference.location, `Length ${length} would leave a gap after the last entry`);
|
|
150
158
|
}
|
|
151
|
-
this.
|
|
159
|
+
this.storeEntries(this.visibleEntries().slice(0, length));
|
|
152
160
|
}
|
|
153
161
|
|
|
154
162
|
protected hasEntry(index: number) {
|
|
@@ -163,8 +171,11 @@ class ListProxyHandler implements ProxyHandler<Val.List> {
|
|
|
163
171
|
throw new ReadError(this.reference.location, `Index ${index} is out of bounds`);
|
|
164
172
|
}
|
|
165
173
|
|
|
166
|
-
if (index
|
|
167
|
-
throw new ReadError(
|
|
174
|
+
if (index >= MAX_LIST_LENGTH) {
|
|
175
|
+
throw new ReadError(
|
|
176
|
+
this.reference.location,
|
|
177
|
+
`Index ${index} is greater than allowed maximum of ${MAX_LIST_LENGTH - 1}`,
|
|
178
|
+
);
|
|
168
179
|
}
|
|
169
180
|
|
|
170
181
|
const value = this.readVal()[index];
|
|
@@ -175,14 +186,7 @@ class ListProxyHandler implements ProxyHandler<Val.List> {
|
|
|
175
186
|
let subref = this.reference.subrefs?.[index];
|
|
176
187
|
|
|
177
188
|
if (subref === undefined) {
|
|
178
|
-
subref = new ManagedReference(
|
|
179
|
-
this.reference,
|
|
180
|
-
index,
|
|
181
|
-
undefined,
|
|
182
|
-
assertWriteOkAlways,
|
|
183
|
-
cloneEntry,
|
|
184
|
-
this.session,
|
|
185
|
-
);
|
|
189
|
+
subref = new ManagedReference(this.reference, index, undefined, cloneEntry, this.session, "entry");
|
|
186
190
|
|
|
187
191
|
this.config.manageEntry(subref, this.session);
|
|
188
192
|
}
|
|
@@ -202,35 +206,183 @@ class ListProxyHandler implements ProxyHandler<Val.List> {
|
|
|
202
206
|
*
|
|
203
207
|
* Invoked before the entry is validated, because validation judges the entry as a whole.
|
|
204
208
|
*/
|
|
205
|
-
protected prepareEntry(value: Val): Val {
|
|
209
|
+
protected prepareEntry(value: Val, _location: AccessControl.Location): Val {
|
|
206
210
|
return value;
|
|
207
211
|
}
|
|
208
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Store a prepared, validated entry after the caller authorized the write. The caller passes a value the list may
|
|
215
|
+
* own; see {@link Internal.copy}.
|
|
216
|
+
*/
|
|
209
217
|
protected writeEntry(index: number, value: Val, location: AccessControl.Location) {
|
|
210
|
-
this.
|
|
211
|
-
|
|
212
|
-
if (index < 0 || index > this.readVal().length + 1) {
|
|
218
|
+
if (index < 0 || index > this.readVal().length) {
|
|
213
219
|
throw new WriteError(location, `Index ${index} is out of bounds`);
|
|
214
220
|
}
|
|
215
221
|
|
|
216
|
-
if (index
|
|
217
|
-
throw new
|
|
222
|
+
if (index >= MAX_LIST_LENGTH) {
|
|
223
|
+
throw new WriteError(location, `Index ${index} is greater than allowed maximum of ${MAX_LIST_LENGTH - 1}`);
|
|
218
224
|
}
|
|
219
225
|
|
|
220
|
-
// Unwrap incoming managed values (including nested)
|
|
221
|
-
value = Internal.unmanage(value);
|
|
222
|
-
|
|
223
226
|
this.reference.change(() => (this.writeVal()[index] = value), index);
|
|
224
227
|
}
|
|
225
228
|
|
|
229
|
+
/**
|
|
230
|
+
* Remove the entry at `index`, which is below {@link getListLength}. Only the last entry may go, so the list never
|
|
231
|
+
* has a gap.
|
|
232
|
+
*/
|
|
233
|
+
protected deleteEntry(index: number, location: AccessControl.Location) {
|
|
234
|
+
if (index !== this.getListLength() - 1) {
|
|
235
|
+
throw new WriteError(location, `Deleting entry ${index} would leave a gap; use splice to remove it`);
|
|
236
|
+
}
|
|
237
|
+
this.setListLength(index);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* The stored entries this session sees, in the order of the indices {@link readEntry} and {@link writeEntry} use.
|
|
242
|
+
*/
|
|
243
|
+
protected visibleEntries(): Val[] {
|
|
244
|
+
return [...this.readVal()];
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Replace the entries {@link visibleEntries} returns with `entries` in a single change. Throws {@link WriteError}
|
|
249
|
+
* when the list would exceed {@link MAX_LIST_LENGTH}.
|
|
250
|
+
*
|
|
251
|
+
* An entry that `entries` holds more than once is stored once and copied into its other slots, because the
|
|
252
|
+
* transaction may own the entry and a nested write changes an owned entry in place (see {@link ValReference.owns}).
|
|
253
|
+
* The original stays at the slot that already holds it, so the reference held for that slot stays live.
|
|
254
|
+
*/
|
|
255
|
+
protected storeEntries(entries: Val[]) {
|
|
256
|
+
if (entries.length > MAX_LIST_LENGTH) {
|
|
257
|
+
throw new WriteError(
|
|
258
|
+
this.reference.location,
|
|
259
|
+
`Length ${entries.length} exceeds the maximum of ${MAX_LIST_LENGTH}`,
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const current = this.readVal();
|
|
264
|
+
const originalSlot = new Map<Val, number>();
|
|
265
|
+
entries.forEach((entry, index) => {
|
|
266
|
+
if (typeof entry !== "object" || entry === null) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
const slot = originalSlot.get(entry);
|
|
270
|
+
if (slot === undefined || current[index] === entry) {
|
|
271
|
+
originalSlot.set(entry, index);
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
const placed = entries.map((entry, index) =>
|
|
275
|
+
typeof entry === "object" && entry !== null && originalSlot.get(entry) !== index
|
|
276
|
+
? Internal.copy(entry)
|
|
277
|
+
: entry,
|
|
278
|
+
);
|
|
279
|
+
|
|
280
|
+
this.reference.change(() => {
|
|
281
|
+
const list = this.writeVal();
|
|
282
|
+
placed.forEach((entry, index) => (list[index] = entry));
|
|
283
|
+
list.length = placed.length;
|
|
284
|
+
}, "length");
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Apply an array method that changes entries, and return its result.
|
|
289
|
+
*
|
|
290
|
+
* The method runs on a plain array of the visible entries, so it moves entry objects rather than entry proxies. A
|
|
291
|
+
* stored entry keeps its value. Every other value is new: it is copied, prepared and validated before anything is
|
|
292
|
+
* stored. The result is stored in a single change, so a rejected entry leaves the list unchanged.
|
|
293
|
+
*
|
|
294
|
+
* A stored entry leaves this method only as a read-only view (see {@link ReadOnlyReference}): the entries `pop`,
|
|
295
|
+
* `shift` and `splice` remove, and the entries a `sort` comparator receives. A method that returns its array
|
|
296
|
+
* returns the list itself.
|
|
297
|
+
*/
|
|
298
|
+
protected editEntries(method: (...args: never[]) => unknown, args: unknown[], receiver: Val.List): unknown {
|
|
299
|
+
this.config.authorizeWrite(this.session, this.reference.location);
|
|
300
|
+
|
|
301
|
+
const stored = this.visibleEntries();
|
|
302
|
+
const viewOf = this.#viewsOf(stored);
|
|
303
|
+
const [compare] = args;
|
|
304
|
+
const edited = [...stored];
|
|
305
|
+
const result = Reflect.apply(
|
|
306
|
+
method,
|
|
307
|
+
edited,
|
|
308
|
+
method === Array.prototype.sort && typeof compare === "function"
|
|
309
|
+
? [(a: Val, b: Val): unknown => Reflect.apply(compare, undefined, [viewOf(a), viewOf(b)])]
|
|
310
|
+
: args,
|
|
311
|
+
);
|
|
312
|
+
|
|
313
|
+
const isStored = new Set(stored);
|
|
314
|
+
const entries = edited.map((entry, index) => (isStored.has(entry) ? entry : this.#acceptEntry(entry, index)));
|
|
315
|
+
|
|
316
|
+
this.storeEntries(entries);
|
|
317
|
+
|
|
318
|
+
if (result === edited) {
|
|
319
|
+
return receiver;
|
|
320
|
+
}
|
|
321
|
+
if (method === Array.prototype.splice && Array.isArray(result)) {
|
|
322
|
+
return result.map(viewOf);
|
|
323
|
+
}
|
|
324
|
+
return viewOf(result);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Create a function that returns a read-only managed view of an entry of `stored`, one view per entry. Any other
|
|
329
|
+
* value, and every entry of a list of primitives, is returned unchanged.
|
|
330
|
+
*/
|
|
331
|
+
#viewsOf(stored: Val[]) {
|
|
332
|
+
const views = new Map<Val, Val>();
|
|
333
|
+
let indices: Map<Val, number> | undefined;
|
|
334
|
+
|
|
335
|
+
return (entry: Val) => {
|
|
336
|
+
if (!this.config.manageEntries || typeof entry !== "object" || entry === null) {
|
|
337
|
+
return entry;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
let view = views.get(entry);
|
|
341
|
+
if (view === undefined) {
|
|
342
|
+
indices ??= new Map(stored.map((entry, index) => [entry, index]));
|
|
343
|
+
const index = indices.get(entry);
|
|
344
|
+
if (index === undefined) {
|
|
345
|
+
throw new InternalError(`Entry to view at ${this.reference.location.path} is not a stored entry`);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
const location = { ...this.reference.location, path: this.reference.location.path.at(index) };
|
|
349
|
+
const reference = new ReadOnlyReference(
|
|
350
|
+
entry,
|
|
351
|
+
location,
|
|
352
|
+
this.reference.rootOwner,
|
|
353
|
+
this.reference.mirrorsRemote,
|
|
354
|
+
);
|
|
355
|
+
this.config.manageEntry(reference, this.session);
|
|
356
|
+
view = reference.owner;
|
|
357
|
+
views.set(entry, view);
|
|
358
|
+
}
|
|
359
|
+
return view;
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Turn a caller's value into an entry the list may store: a copy of the value, prepared and validated. The
|
|
365
|
+
* caller's value stays unchanged.
|
|
366
|
+
*/
|
|
367
|
+
#acceptEntry(value: Val, index: number) {
|
|
368
|
+
this.#sublocation.path.id = index;
|
|
369
|
+
if (value === undefined) {
|
|
370
|
+
throw new WriteError(this.#sublocation, `Entry ${index} has no value`);
|
|
371
|
+
}
|
|
372
|
+
const entry = this.prepareEntry(Internal.copy(value), this.#sublocation);
|
|
373
|
+
this.config.validateEntry?.(entry, this.session, this.#sublocation);
|
|
374
|
+
return entry;
|
|
375
|
+
}
|
|
376
|
+
|
|
226
377
|
protected getIteratorFn(): Val.List[typeof Symbol.iterator] {
|
|
227
378
|
return this.readVal()[Symbol.iterator];
|
|
228
379
|
}
|
|
229
380
|
|
|
230
381
|
get(_target: Val.List, property: PropertyKey, receiver: Val.List) {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
382
|
+
const index = entryIndexFor(property);
|
|
383
|
+
if (index !== undefined) {
|
|
384
|
+
this.#sublocation.path.id = index;
|
|
385
|
+
return this.readEntry(index, this.#sublocation);
|
|
234
386
|
}
|
|
235
387
|
|
|
236
388
|
switch (property) {
|
|
@@ -253,15 +405,19 @@ class ListProxyHandler implements ProxyHandler<Val.List> {
|
|
|
253
405
|
return undefined;
|
|
254
406
|
}
|
|
255
407
|
|
|
408
|
+
const method = entryEdits.get(property);
|
|
409
|
+
if (method) {
|
|
410
|
+
return (...args: unknown[]) => this.editEntries(method, args, receiver);
|
|
411
|
+
}
|
|
412
|
+
|
|
256
413
|
return Reflect.get(this.readVal(), property, receiver);
|
|
257
414
|
}
|
|
258
415
|
|
|
259
416
|
set(_target: Val.List, property: PropertyKey, newValue: Val, receiver: Val.List) {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
this.
|
|
264
|
-
this.writeEntry(Number.parseInt(property), newValue, this.#sublocation);
|
|
417
|
+
const index = entryIndexFor(property);
|
|
418
|
+
if (index !== undefined) {
|
|
419
|
+
this.config.authorizeWrite(this.session, this.reference.location);
|
|
420
|
+
this.writeEntry(index, this.#acceptEntry(newValue, index), this.#sublocation);
|
|
265
421
|
return true;
|
|
266
422
|
} else if (property === "length") {
|
|
267
423
|
this.setListLength(newValue as number);
|
|
@@ -272,17 +428,24 @@ class ListProxyHandler implements ProxyHandler<Val.List> {
|
|
|
272
428
|
}
|
|
273
429
|
|
|
274
430
|
has(_target: Val.List, property: PropertyKey) {
|
|
275
|
-
|
|
276
|
-
|
|
431
|
+
const index = entryIndexFor(property);
|
|
432
|
+
if (index !== undefined) {
|
|
433
|
+
return this.hasEntry(index);
|
|
277
434
|
}
|
|
278
435
|
|
|
279
436
|
return Reflect.has(this.readVal(), property);
|
|
280
437
|
}
|
|
281
438
|
|
|
282
439
|
deleteProperty(_target: Val.List, property: PropertyKey) {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
this.
|
|
440
|
+
const index = entryIndexFor(property);
|
|
441
|
+
if (index !== undefined) {
|
|
442
|
+
if (index >= this.getListLength()) {
|
|
443
|
+
// Ignored as on an array, but the list must still be writable, so an uncached or group list refuses
|
|
444
|
+
this.reference.assertWritable();
|
|
445
|
+
return true;
|
|
446
|
+
}
|
|
447
|
+
this.#sublocation.path.id = index;
|
|
448
|
+
this.deleteEntry(index, this.#sublocation);
|
|
286
449
|
return true;
|
|
287
450
|
}
|
|
288
451
|
|
|
@@ -293,8 +456,30 @@ class ListProxyHandler implements ProxyHandler<Val.List> {
|
|
|
293
456
|
return Reflect.ownKeys(this.readVal());
|
|
294
457
|
}
|
|
295
458
|
|
|
459
|
+
/**
|
|
460
|
+
* The descriptors of the entries and of `length` carry what {@link get} returns: the managed entry and the length
|
|
461
|
+
* this session sees.
|
|
462
|
+
*/
|
|
296
463
|
getOwnPropertyDescriptor(_target: Val.List, key: PropertyKey) {
|
|
297
|
-
|
|
464
|
+
const index = entryIndexFor(key);
|
|
465
|
+
if (index === undefined) {
|
|
466
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(this.readVal(), key);
|
|
467
|
+
if (key === "length" && descriptor !== undefined) {
|
|
468
|
+
descriptor.value = this.getListLength();
|
|
469
|
+
}
|
|
470
|
+
return descriptor;
|
|
471
|
+
}
|
|
472
|
+
if (index >= this.getListLength()) {
|
|
473
|
+
return undefined;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
this.#sublocation.path.id = index;
|
|
477
|
+
return {
|
|
478
|
+
value: this.readEntry(index, this.#sublocation),
|
|
479
|
+
writable: true,
|
|
480
|
+
enumerable: true,
|
|
481
|
+
configurable: true,
|
|
482
|
+
};
|
|
298
483
|
}
|
|
299
484
|
}
|
|
300
485
|
|
|
@@ -303,6 +488,14 @@ class ListProxyHandler implements ProxyHandler<Val.List> {
|
|
|
303
488
|
* list with fabric filtering enabled, logical indices are mapped to physical indices that match the actor's fabric.
|
|
304
489
|
*/
|
|
305
490
|
class FabricFilteredListProxyHandler extends ListProxyHandler {
|
|
491
|
+
#isVisible(entry: Val) {
|
|
492
|
+
if (!isObject(entry)) {
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
const { fabricIndex } = entry as { fabricIndex?: number };
|
|
496
|
+
return !fabricIndex || fabricIndex === this.session.fabric;
|
|
497
|
+
}
|
|
498
|
+
|
|
306
499
|
#mapScopedToActual(index: number, reading: boolean) {
|
|
307
500
|
if (index < 0) {
|
|
308
501
|
throw new (reading ? ReadError : WriteError)(
|
|
@@ -311,14 +504,10 @@ class FabricFilteredListProxyHandler extends ListProxyHandler {
|
|
|
311
504
|
);
|
|
312
505
|
}
|
|
313
506
|
|
|
507
|
+
const list = reading ? this.readVal() : this.writeVal();
|
|
314
508
|
let nextPos = 0;
|
|
315
|
-
for (let i = 0; i <
|
|
316
|
-
|
|
317
|
-
if (!isObject(entry)) {
|
|
318
|
-
continue;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
if (hasLocalActor(this.session) || !entry.fabricIndex || entry.fabricIndex === this.session.fabric) {
|
|
509
|
+
for (let i = 0; i < list.length; i++) {
|
|
510
|
+
if (this.#isVisible(list[i])) {
|
|
322
511
|
if (nextPos === index) {
|
|
323
512
|
return i;
|
|
324
513
|
}
|
|
@@ -331,7 +520,7 @@ class FabricFilteredListProxyHandler extends ListProxyHandler {
|
|
|
331
520
|
}
|
|
332
521
|
|
|
333
522
|
if (nextPos === index) {
|
|
334
|
-
return
|
|
523
|
+
return list.length;
|
|
335
524
|
}
|
|
336
525
|
|
|
337
526
|
throw new WriteError(this.reference.location, `Index ${index} would leave gaps in fabric-filtered list`);
|
|
@@ -341,7 +530,10 @@ class FabricFilteredListProxyHandler extends ListProxyHandler {
|
|
|
341
530
|
try {
|
|
342
531
|
return super.readEntry(this.#mapScopedToActual(index, true), this.reference.location) !== undefined;
|
|
343
532
|
} catch (e) {
|
|
344
|
-
|
|
533
|
+
if (e instanceof ReadError) {
|
|
534
|
+
return false;
|
|
535
|
+
}
|
|
536
|
+
throw e;
|
|
345
537
|
}
|
|
346
538
|
}
|
|
347
539
|
|
|
@@ -349,85 +541,55 @@ class FabricFilteredListProxyHandler extends ListProxyHandler {
|
|
|
349
541
|
return super.readEntry(this.#mapScopedToActual(index, true), location);
|
|
350
542
|
}
|
|
351
543
|
|
|
352
|
-
protected override prepareEntry(value: Val) {
|
|
353
|
-
if (isObject(value)) {
|
|
354
|
-
(
|
|
544
|
+
protected override prepareEntry(value: Val, location: AccessControl.Location) {
|
|
545
|
+
if (!isObject(value)) {
|
|
546
|
+
throw new WriteError(location, `Fabric scoped list value is not an object`, Status.Failure);
|
|
355
547
|
}
|
|
548
|
+
(value as { fabricIndex?: number }).fabricIndex ??= this.session.fabric;
|
|
356
549
|
return value;
|
|
357
550
|
}
|
|
358
551
|
|
|
359
552
|
protected override writeEntry(index: number, value: Val, location: AccessControl.Location) {
|
|
360
|
-
|
|
361
|
-
const valueIndex = this.#mapScopedToActual(index, false);
|
|
362
|
-
this.writeVal().splice(valueIndex, 1);
|
|
363
|
-
} else {
|
|
364
|
-
if (!isObject(value)) {
|
|
365
|
-
throw new WriteError(location, `Fabric scoped list value is not an object`, Status.Failure);
|
|
366
|
-
}
|
|
367
|
-
super.writeEntry(this.#mapScopedToActual(index, false), value, location);
|
|
368
|
-
}
|
|
553
|
+
super.writeEntry(this.#mapScopedToActual(index, false), value, location);
|
|
369
554
|
}
|
|
370
555
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
556
|
+
/**
|
|
557
|
+
* Remove the entry at `index`, which is below {@link getListLength}. Any entry may go, because the later entries
|
|
558
|
+
* of this fabric move up to fill the gap.
|
|
559
|
+
*/
|
|
560
|
+
protected override deleteEntry(index: number, location: AccessControl.Location) {
|
|
561
|
+
this.config.authorizeWrite(this.session, location);
|
|
562
|
+
const entries = this.visibleEntries();
|
|
563
|
+
entries.splice(index, 1);
|
|
564
|
+
this.storeEntries(entries);
|
|
380
565
|
}
|
|
381
566
|
|
|
382
|
-
protected override
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
this.reference.change(() => {
|
|
386
|
-
for (let i = formerLength - 1; i >= length; i--) {
|
|
387
|
-
const entry = this.writeVal()[this.#mapScopedToActual(i, true)] as undefined | { fabricIndex?: number };
|
|
388
|
-
if (isObject(entry) && (!entry.fabricIndex || entry.fabricIndex === this.session.fabric)) {
|
|
389
|
-
this.writeVal().splice(this.#mapScopedToActual(i, false), 1);
|
|
390
|
-
} else if (entry !== undefined) {
|
|
391
|
-
throw new WriteError(
|
|
392
|
-
this.reference.location,
|
|
393
|
-
`Fabric scoped list value is not an object`,
|
|
394
|
-
Status.Failure,
|
|
395
|
-
);
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
}, "length");
|
|
567
|
+
protected override visibleEntries() {
|
|
568
|
+
return this.readVal().filter(entry => this.#isVisible(entry));
|
|
399
569
|
}
|
|
400
570
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
(next.value as { fabricIndex?: number }).fabricIndex !== fabric
|
|
418
|
-
) {
|
|
419
|
-
continue;
|
|
420
|
-
}
|
|
571
|
+
/**
|
|
572
|
+
* Put `entries` into the positions of this fabric's entries, in order, and keep other fabrics' entries in their
|
|
573
|
+
* order. Entries beyond those positions go to the end; positions beyond the entries are removed.
|
|
574
|
+
*/
|
|
575
|
+
protected override storeEntries(entries: Val[]) {
|
|
576
|
+
const stored = this.readVal();
|
|
577
|
+
const result = new Array<Val>();
|
|
578
|
+
let next = 0;
|
|
579
|
+
for (const entry of stored) {
|
|
580
|
+
if (!this.#isVisible(entry)) {
|
|
581
|
+
result.push(entry);
|
|
582
|
+
} else if (next < entries.length) {
|
|
583
|
+
result.push(entries[next++]);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
result.push(...entries.slice(next));
|
|
421
587
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
},
|
|
588
|
+
super.storeEntries(result);
|
|
589
|
+
}
|
|
425
590
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
},
|
|
429
|
-
};
|
|
430
|
-
}) as Val.List[typeof Symbol.iterator];
|
|
591
|
+
protected override getListLength() {
|
|
592
|
+
return this.visibleEntries().length;
|
|
431
593
|
}
|
|
432
594
|
|
|
433
595
|
override ownKeys() {
|
|
@@ -437,26 +599,10 @@ class FabricFilteredListProxyHandler extends ListProxyHandler {
|
|
|
437
599
|
if (typeof k !== "string") {
|
|
438
600
|
return true;
|
|
439
601
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
}
|
|
443
|
-
if (Number.parseInt(k) < length) {
|
|
444
|
-
return true;
|
|
445
|
-
}
|
|
446
|
-
return false;
|
|
602
|
+
const index = entryIndexFor(k);
|
|
603
|
+
return index === undefined || index < length;
|
|
447
604
|
});
|
|
448
605
|
}
|
|
449
|
-
|
|
450
|
-
override getOwnPropertyDescriptor(_target: Val.List, key: PropertyKey) {
|
|
451
|
-
if (typeof key === "string" && key.match(/^\d+$/)) {
|
|
452
|
-
key = Number.parseInt(key);
|
|
453
|
-
}
|
|
454
|
-
if (typeof key !== "number") {
|
|
455
|
-
return Reflect.getOwnPropertyDescriptor(this.readVal(), key);
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
return Reflect.getOwnPropertyDescriptor(this.readVal(), this.#mapScopedToActual(key, true));
|
|
459
|
-
}
|
|
460
606
|
}
|
|
461
607
|
|
|
462
608
|
function createProxy(config: ListConfig, reference: ValReference<Val.List>, session: ValueSupervisor.Session) {
|
|
@@ -464,6 +610,9 @@ function createProxy(config: ListConfig, reference: ValReference<Val.List>, sess
|
|
|
464
610
|
config.manageEntries &&
|
|
465
611
|
config.fabricScoped &&
|
|
466
612
|
hasRemoteActor(session) &&
|
|
613
|
+
// The session's fabric belongs to our server node, not to the remote node, so it does not filter a copy of
|
|
614
|
+
// that node's list
|
|
615
|
+
!reference.mirrorsRemote &&
|
|
467
616
|
// Fabric-sensitive lists are filtered for reads and writes; command handlers see all entries, as data access
|
|
468
617
|
// rules do not apply to them
|
|
469
618
|
(session.fabricFiltered || (config.fabricSensitive && !session.command));
|