@matter/protocol 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/action/Val.d.ts +8 -0
- package/dist/cjs/action/Val.d.ts.map +1 -1
- package/dist/cjs/action/client/ClientInteraction.d.ts.map +1 -1
- package/dist/cjs/action/client/ClientInteraction.js +45 -32
- package/dist/cjs/action/client/ClientInteraction.js.map +1 -1
- package/dist/cjs/action/client/ClientRequest.d.ts +14 -0
- package/dist/cjs/action/client/ClientRequest.d.ts.map +1 -1
- package/dist/cjs/action/client/InputChunk.js +39 -2
- package/dist/cjs/action/client/InputChunk.js.map +1 -1
- package/dist/cjs/action/client/subscription/ClientSubscription.d.ts +2 -0
- package/dist/cjs/action/client/subscription/ClientSubscription.d.ts.map +1 -1
- package/dist/cjs/action/client/subscription/ClientSubscription.js +4 -0
- package/dist/cjs/action/client/subscription/ClientSubscription.js.map +1 -1
- package/dist/cjs/action/client/subscription/ClientSubscriptionHandler.d.ts.map +1 -1
- package/dist/cjs/action/client/subscription/ClientSubscriptionHandler.js +14 -0
- package/dist/cjs/action/client/subscription/ClientSubscriptionHandler.js.map +1 -1
- package/dist/cjs/action/client/subscription/PeerSubscription.d.ts +32 -0
- package/dist/cjs/action/client/subscription/PeerSubscription.d.ts.map +1 -1
- package/dist/cjs/action/client/subscription/PeerSubscription.js +61 -0
- package/dist/cjs/action/client/subscription/PeerSubscription.js.map +1 -1
- package/dist/cjs/action/errors.d.ts +3 -1
- package/dist/cjs/action/errors.d.ts.map +1 -1
- package/dist/cjs/action/errors.js +7 -2
- package/dist/cjs/action/errors.js.map +1 -1
- package/dist/cjs/action/protocols.d.ts +6 -1
- package/dist/cjs/action/protocols.d.ts.map +1 -1
- package/dist/cjs/action/request/Invoke.d.ts +24 -1
- package/dist/cjs/action/request/Invoke.d.ts.map +1 -1
- package/dist/cjs/action/request/Invoke.js +40 -12
- package/dist/cjs/action/request/Invoke.js.map +1 -1
- package/dist/cjs/action/request/Write.d.ts.map +1 -1
- package/dist/cjs/action/request/Write.js +6 -5
- package/dist/cjs/action/request/Write.js.map +1 -1
- package/dist/cjs/action/response/InvokeResult.d.ts +8 -2
- package/dist/cjs/action/response/InvokeResult.d.ts.map +1 -1
- package/dist/cjs/action/response/InvokeResult.js +28 -0
- package/dist/cjs/action/response/InvokeResult.js.map +2 -2
- package/dist/cjs/action/response/ReadResult.d.ts +14 -5
- package/dist/cjs/action/response/ReadResult.d.ts.map +1 -1
- package/dist/cjs/action/server/AttributeReadResponse.d.ts.map +1 -1
- package/dist/cjs/action/server/AttributeReadResponse.js +1 -1
- package/dist/cjs/action/server/AttributeReadResponse.js.map +1 -1
- package/dist/cjs/action/server/AttributeWriteResponse.d.ts.map +1 -1
- package/dist/cjs/action/server/AttributeWriteResponse.js +4 -2
- package/dist/cjs/action/server/AttributeWriteResponse.js.map +1 -1
- package/dist/cjs/action/server/EventReadResponse.d.ts.map +1 -1
- package/dist/cjs/action/server/EventReadResponse.js +1 -0
- package/dist/cjs/action/server/EventReadResponse.js.map +1 -1
- package/dist/cjs/advertisement/mdns/MdnsAdvertisement.d.ts +1 -1
- package/dist/cjs/advertisement/mdns/MdnsAdvertisement.d.ts.map +1 -1
- package/dist/cjs/advertisement/mdns/MdnsAdvertisement.js +7 -7
- package/dist/cjs/advertisement/mdns/MdnsAdvertisement.js.map +1 -1
- package/dist/cjs/ble/Ble.d.ts +2 -0
- package/dist/cjs/ble/Ble.d.ts.map +1 -1
- package/dist/cjs/ble/Ble.js +4 -0
- package/dist/cjs/ble/Ble.js.map +1 -1
- package/dist/cjs/certificate/CdSigners.d.ts +52 -0
- package/dist/cjs/certificate/CdSigners.d.ts.map +1 -0
- package/dist/cjs/certificate/CdSigners.js +111 -0
- package/dist/cjs/certificate/CdSigners.js.map +6 -0
- package/dist/cjs/certificate/CertificateAuthority.d.ts +1 -1
- package/dist/cjs/certificate/CertificateAuthority.d.ts.map +1 -1
- package/dist/cjs/certificate/DeviceAttestationValidator.d.ts +59 -7
- package/dist/cjs/certificate/DeviceAttestationValidator.d.ts.map +1 -1
- package/dist/cjs/certificate/DeviceAttestationValidator.js +122 -42
- package/dist/cjs/certificate/DeviceAttestationValidator.js.map +1 -1
- package/dist/cjs/certificate/DeviceCertification.d.ts.map +1 -1
- package/dist/cjs/certificate/DeviceCertification.js +5 -2
- package/dist/cjs/certificate/DeviceCertification.js.map +1 -1
- package/dist/cjs/certificate/NocsrValidator.d.ts +57 -0
- package/dist/cjs/certificate/NocsrValidator.d.ts.map +1 -0
- package/dist/cjs/certificate/NocsrValidator.js +109 -0
- package/dist/cjs/certificate/NocsrValidator.js.map +6 -0
- package/dist/cjs/certificate/PeerData.d.ts +12 -0
- package/dist/cjs/certificate/PeerData.d.ts.map +1 -0
- package/dist/cjs/certificate/PeerData.js +33 -0
- package/dist/cjs/certificate/PeerData.js.map +6 -0
- package/dist/cjs/certificate/index.d.ts +2 -0
- package/dist/cjs/certificate/index.d.ts.map +1 -1
- package/dist/cjs/certificate/index.js +2 -0
- package/dist/cjs/certificate/index.js.map +1 -1
- package/dist/cjs/certificate/kinds/AttestationCertificates.d.ts +42 -6
- package/dist/cjs/certificate/kinds/AttestationCertificates.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/AttestationCertificates.js +110 -13
- package/dist/cjs/certificate/kinds/AttestationCertificates.js.map +1 -1
- package/dist/cjs/certificate/kinds/Certificate.d.ts +13 -7
- package/dist/cjs/certificate/kinds/Certificate.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/Certificate.js +146 -240
- package/dist/cjs/certificate/kinds/Certificate.js.map +2 -2
- package/dist/cjs/certificate/kinds/CertificationDeclaration.d.ts +21 -3
- package/dist/cjs/certificate/kinds/CertificationDeclaration.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/CertificationDeclaration.js +76 -20
- package/dist/cjs/certificate/kinds/CertificationDeclaration.js.map +1 -1
- package/dist/cjs/certificate/kinds/DistinguishedName.d.ts +190 -0
- package/dist/cjs/certificate/kinds/DistinguishedName.d.ts.map +1 -0
- package/dist/cjs/certificate/kinds/DistinguishedName.js +417 -0
- package/dist/cjs/certificate/kinds/DistinguishedName.js.map +6 -0
- package/dist/cjs/certificate/kinds/Icac.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/Icac.js +5 -10
- package/dist/cjs/certificate/kinds/Icac.js.map +1 -1
- package/dist/cjs/certificate/kinds/Noc.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/Noc.js +5 -4
- package/dist/cjs/certificate/kinds/Noc.js.map +1 -1
- package/dist/cjs/certificate/kinds/OperationalBase.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/OperationalBase.js +4 -2
- package/dist/cjs/certificate/kinds/OperationalBase.js.map +1 -1
- package/dist/cjs/certificate/kinds/Rcac.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/Rcac.js +5 -10
- package/dist/cjs/certificate/kinds/Rcac.js.map +1 -1
- package/dist/cjs/certificate/kinds/Vvsc.d.ts +3 -3
- package/dist/cjs/certificate/kinds/Vvsc.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/Vvsc.js +19 -14
- package/dist/cjs/certificate/kinds/Vvsc.js.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/asn.d.ts +1 -1
- package/dist/cjs/certificate/kinds/definitions/asn.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/asn.js.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/attestation.d.ts +15 -15
- package/dist/cjs/certificate/kinds/definitions/attestation.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/base.d.ts +33 -0
- package/dist/cjs/certificate/kinds/definitions/base.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/base.js +8 -1
- package/dist/cjs/certificate/kinds/definitions/base.js.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/operational.d.ts +24 -20
- package/dist/cjs/certificate/kinds/definitions/operational.d.ts.map +1 -1
- package/dist/cjs/certificate/kinds/definitions/operational.js +5 -3
- package/dist/cjs/certificate/kinds/definitions/operational.js.map +1 -1
- package/dist/cjs/codec/MessageCodec.d.ts +27 -2
- package/dist/cjs/codec/MessageCodec.d.ts.map +1 -1
- package/dist/cjs/codec/MessageCodec.js +81 -74
- package/dist/cjs/codec/MessageCodec.js.map +1 -1
- package/dist/cjs/common/OperationalCredentialsTypes.d.ts +6 -0
- package/dist/cjs/common/OperationalCredentialsTypes.d.ts.map +1 -1
- package/dist/cjs/common/OperationalCredentialsTypes.js +2 -0
- package/dist/cjs/common/OperationalCredentialsTypes.js.map +1 -1
- package/dist/cjs/dcl/DclCertificateService.d.ts +28 -7
- package/dist/cjs/dcl/DclCertificateService.d.ts.map +1 -1
- package/dist/cjs/dcl/DclCertificateService.js +103 -30
- package/dist/cjs/dcl/DclCertificateService.js.map +1 -1
- package/dist/cjs/fabric/Fabric.d.ts +10 -5
- package/dist/cjs/fabric/Fabric.d.ts.map +1 -1
- package/dist/cjs/fabric/Fabric.js +12 -5
- package/dist/cjs/fabric/Fabric.js.map +1 -1
- package/dist/cjs/fabric/FabricManager.d.ts +2 -2
- package/dist/cjs/fabric/FabricManager.js +2 -2
- package/dist/cjs/groups/FabricGroups.d.ts +2 -0
- package/dist/cjs/groups/FabricGroups.d.ts.map +1 -1
- package/dist/cjs/groups/FabricGroups.js +4 -0
- package/dist/cjs/groups/FabricGroups.js.map +1 -1
- package/dist/cjs/groups/Groups.d.ts +7 -0
- package/dist/cjs/groups/Groups.d.ts.map +1 -1
- package/dist/cjs/groups/Groups.js +11 -2
- package/dist/cjs/groups/Groups.js.map +1 -1
- package/dist/cjs/groups/KeySets.d.ts +3 -3
- package/dist/cjs/groups/KeySets.js +3 -3
- package/dist/cjs/interaction/InteractionMessenger.d.ts +18 -1
- package/dist/cjs/interaction/InteractionMessenger.d.ts.map +1 -1
- package/dist/cjs/interaction/InteractionMessenger.js +49 -19
- package/dist/cjs/interaction/InteractionMessenger.js.map +1 -1
- package/dist/cjs/mdns/InterfaceResponder.d.ts +137 -0
- package/dist/cjs/mdns/InterfaceResponder.d.ts.map +1 -0
- package/dist/cjs/mdns/InterfaceResponder.js +799 -0
- package/dist/cjs/mdns/InterfaceResponder.js.map +6 -0
- package/dist/cjs/mdns/MdnsServer.d.ts +82 -9
- package/dist/cjs/mdns/MdnsServer.d.ts.map +1 -1
- package/dist/cjs/mdns/MdnsServer.js +337 -267
- package/dist/cjs/mdns/MdnsServer.js.map +2 -2
- package/dist/cjs/mdns/MdnsService.d.ts.map +1 -1
- package/dist/cjs/mdns/MdnsService.js +3 -1
- package/dist/cjs/mdns/MdnsService.js.map +1 -1
- package/dist/cjs/peer/AdministratorCommands.d.ts +26 -0
- package/dist/cjs/peer/AdministratorCommands.d.ts.map +1 -0
- package/dist/cjs/peer/AdministratorCommands.js +40 -0
- package/dist/cjs/peer/AdministratorCommands.js.map +6 -0
- package/dist/cjs/peer/CommissioningConnection.d.ts.map +1 -1
- package/dist/cjs/peer/CommissioningConnection.js +4 -2
- package/dist/cjs/peer/CommissioningConnection.js.map +1 -1
- package/dist/cjs/peer/ControllerCommissioner.d.ts +9 -0
- package/dist/cjs/peer/ControllerCommissioner.d.ts.map +1 -1
- package/dist/cjs/peer/ControllerCommissioner.js +59 -13
- package/dist/cjs/peer/ControllerCommissioner.js.map +1 -1
- package/dist/cjs/peer/ControllerCommissioningFlow.d.ts +7 -7
- package/dist/cjs/peer/ControllerCommissioningFlow.d.ts.map +1 -1
- package/dist/cjs/peer/ControllerCommissioningFlow.js +124 -67
- package/dist/cjs/peer/ControllerCommissioningFlow.js.map +1 -1
- package/dist/cjs/peer/OperationalCertificateUpdate.d.ts +181 -0
- package/dist/cjs/peer/OperationalCertificateUpdate.d.ts.map +1 -0
- package/dist/cjs/peer/OperationalCertificateUpdate.js +553 -0
- package/dist/cjs/peer/OperationalCertificateUpdate.js.map +6 -0
- package/dist/cjs/peer/Peer.d.ts +5 -0
- package/dist/cjs/peer/Peer.d.ts.map +1 -1
- package/dist/cjs/peer/Peer.js +29 -1
- package/dist/cjs/peer/Peer.js.map +1 -1
- package/dist/cjs/peer/PeerAddressStore.d.ts +37 -0
- package/dist/cjs/peer/PeerAddressStore.d.ts.map +1 -0
- package/dist/cjs/peer/PeerAddressStore.js +114 -0
- package/dist/cjs/peer/PeerAddressStore.js.map +6 -0
- package/dist/cjs/peer/PeerConnection.d.ts.map +1 -1
- package/dist/cjs/peer/PeerConnection.js +0 -1
- package/dist/cjs/peer/PeerConnection.js.map +1 -1
- package/dist/cjs/peer/PeerDescriptor.d.ts +3 -4
- package/dist/cjs/peer/PeerDescriptor.d.ts.map +1 -1
- package/dist/cjs/peer/PeerDescriptor.js.map +1 -1
- package/dist/cjs/peer/PeerExchangeProvider.d.ts.map +1 -1
- package/dist/cjs/peer/PeerExchangeProvider.js +2 -1
- package/dist/cjs/peer/PeerExchangeProvider.js.map +1 -1
- package/dist/cjs/peer/PeerLossContext.d.ts +10 -2
- package/dist/cjs/peer/PeerLossContext.d.ts.map +1 -1
- package/dist/cjs/peer/PhysicalDeviceProperties.d.ts +13 -0
- package/dist/cjs/peer/PhysicalDeviceProperties.d.ts.map +1 -1
- package/dist/cjs/peer/PhysicalDeviceProperties.js +3 -2
- package/dist/cjs/peer/PhysicalDeviceProperties.js.map +1 -1
- package/dist/cjs/peer/RebootResubscribeArmer.d.ts +3 -3
- package/dist/cjs/peer/RebootResubscribeArmer.d.ts.map +1 -1
- package/dist/cjs/peer/RebootResubscribeArmer.js +21 -9
- package/dist/cjs/peer/RebootResubscribeArmer.js.map +1 -1
- package/dist/cjs/peer/index.d.ts +2 -0
- package/dist/cjs/peer/index.d.ts.map +1 -1
- package/dist/cjs/peer/index.js +2 -0
- package/dist/cjs/peer/index.js.map +1 -1
- package/dist/cjs/protocol/DeviceAdvertiser.d.ts.map +1 -1
- package/dist/cjs/protocol/DeviceAdvertiser.js +1 -1
- package/dist/cjs/protocol/DeviceAdvertiser.js.map +1 -1
- package/dist/cjs/protocol/ExchangeManager.d.ts +0 -1
- package/dist/cjs/protocol/ExchangeManager.d.ts.map +1 -1
- package/dist/cjs/protocol/ExchangeManager.js +136 -64
- package/dist/cjs/protocol/ExchangeManager.js.map +1 -1
- package/dist/cjs/protocol/ExchangeProvider.d.ts +3 -2
- package/dist/cjs/protocol/ExchangeProvider.d.ts.map +1 -1
- package/dist/cjs/protocol/ExchangeProvider.js.map +1 -1
- package/dist/cjs/protocol/MessageExchange.d.ts +13 -0
- package/dist/cjs/protocol/MessageExchange.d.ts.map +1 -1
- package/dist/cjs/protocol/MessageExchange.js +23 -7
- package/dist/cjs/protocol/MessageExchange.js.map +1 -1
- package/dist/cjs/protocol/MessageReceptionState.d.ts +1 -1
- package/dist/cjs/protocol/errors.d.ts +7 -1
- package/dist/cjs/protocol/errors.d.ts.map +1 -1
- package/dist/cjs/protocol/errors.js +3 -0
- package/dist/cjs/protocol/errors.js.map +1 -1
- package/dist/cjs/securechannel/SecureChannelMessenger.d.ts +6 -1
- package/dist/cjs/securechannel/SecureChannelMessenger.d.ts.map +1 -1
- package/dist/cjs/securechannel/SecureChannelMessenger.js +27 -12
- package/dist/cjs/securechannel/SecureChannelMessenger.js.map +1 -1
- package/dist/cjs/session/GroupSession.d.ts +58 -15
- package/dist/cjs/session/GroupSession.d.ts.map +1 -1
- package/dist/cjs/session/GroupSession.js +97 -102
- package/dist/cjs/session/GroupSession.js.map +2 -2
- package/dist/cjs/session/NodeSession.d.ts +50 -1
- package/dist/cjs/session/NodeSession.d.ts.map +1 -1
- package/dist/cjs/session/NodeSession.js +80 -4
- package/dist/cjs/session/NodeSession.js.map +1 -1
- package/dist/cjs/session/SecureSession.d.ts +9 -0
- package/dist/cjs/session/SecureSession.d.ts.map +1 -1
- package/dist/cjs/session/SecureSession.js +12 -0
- package/dist/cjs/session/SecureSession.js.map +1 -1
- package/dist/cjs/session/Session.d.ts +2 -2
- package/dist/cjs/session/Session.d.ts.map +1 -1
- package/dist/cjs/session/Session.js +1 -1
- package/dist/cjs/session/SessionManager.d.ts +76 -28
- package/dist/cjs/session/SessionManager.d.ts.map +1 -1
- package/dist/cjs/session/SessionManager.js +316 -153
- package/dist/cjs/session/SessionManager.js.map +2 -2
- package/dist/cjs/session/UnsecuredSession.d.ts +0 -1
- package/dist/cjs/session/UnsecuredSession.d.ts.map +1 -1
- package/dist/cjs/session/UnsecuredSession.js +2 -4
- package/dist/cjs/session/UnsecuredSession.js.map +1 -1
- package/dist/cjs/session/case/CaseClient.d.ts +5 -0
- package/dist/cjs/session/case/CaseClient.d.ts.map +1 -1
- package/dist/cjs/session/case/CaseClient.js +12 -11
- package/dist/cjs/session/case/CaseClient.js.map +2 -2
- package/dist/cjs/session/case/CaseServer.d.ts.map +1 -1
- package/dist/cjs/session/case/CaseServer.js +31 -11
- package/dist/cjs/session/case/CaseServer.js.map +1 -1
- package/dist/esm/action/Val.d.ts +8 -0
- package/dist/esm/action/Val.d.ts.map +1 -1
- package/dist/esm/action/client/ClientInteraction.d.ts.map +1 -1
- package/dist/esm/action/client/ClientInteraction.js +45 -32
- package/dist/esm/action/client/ClientInteraction.js.map +1 -1
- package/dist/esm/action/client/ClientRequest.d.ts +14 -0
- package/dist/esm/action/client/ClientRequest.d.ts.map +1 -1
- package/dist/esm/action/client/InputChunk.js +39 -2
- package/dist/esm/action/client/InputChunk.js.map +1 -1
- package/dist/esm/action/client/subscription/ClientSubscription.d.ts +2 -0
- package/dist/esm/action/client/subscription/ClientSubscription.d.ts.map +1 -1
- package/dist/esm/action/client/subscription/ClientSubscription.js +4 -0
- package/dist/esm/action/client/subscription/ClientSubscription.js.map +1 -1
- package/dist/esm/action/client/subscription/ClientSubscriptionHandler.d.ts.map +1 -1
- package/dist/esm/action/client/subscription/ClientSubscriptionHandler.js +14 -0
- package/dist/esm/action/client/subscription/ClientSubscriptionHandler.js.map +1 -1
- package/dist/esm/action/client/subscription/PeerSubscription.d.ts +32 -0
- package/dist/esm/action/client/subscription/PeerSubscription.d.ts.map +1 -1
- package/dist/esm/action/client/subscription/PeerSubscription.js +61 -0
- package/dist/esm/action/client/subscription/PeerSubscription.js.map +1 -1
- package/dist/esm/action/errors.d.ts +3 -1
- package/dist/esm/action/errors.d.ts.map +1 -1
- package/dist/esm/action/errors.js +7 -2
- package/dist/esm/action/errors.js.map +1 -1
- package/dist/esm/action/protocols.d.ts +6 -1
- package/dist/esm/action/protocols.d.ts.map +1 -1
- package/dist/esm/action/request/Invoke.d.ts +24 -1
- package/dist/esm/action/request/Invoke.d.ts.map +1 -1
- package/dist/esm/action/request/Invoke.js +41 -13
- package/dist/esm/action/request/Invoke.js.map +1 -1
- package/dist/esm/action/request/Write.d.ts.map +1 -1
- package/dist/esm/action/request/Write.js +7 -6
- package/dist/esm/action/request/Write.js.map +1 -1
- package/dist/esm/action/response/InvokeResult.d.ts +8 -2
- package/dist/esm/action/response/InvokeResult.d.ts.map +1 -1
- package/dist/esm/action/response/InvokeResult.js +26 -0
- package/dist/esm/action/response/InvokeResult.js.map +2 -2
- package/dist/esm/action/response/ReadResult.d.ts +14 -5
- package/dist/esm/action/response/ReadResult.d.ts.map +1 -1
- package/dist/esm/action/server/AttributeReadResponse.d.ts.map +1 -1
- package/dist/esm/action/server/AttributeReadResponse.js +2 -2
- package/dist/esm/action/server/AttributeReadResponse.js.map +1 -1
- package/dist/esm/action/server/AttributeWriteResponse.d.ts.map +1 -1
- package/dist/esm/action/server/AttributeWriteResponse.js +11 -3
- package/dist/esm/action/server/AttributeWriteResponse.js.map +1 -1
- package/dist/esm/action/server/EventReadResponse.d.ts.map +1 -1
- package/dist/esm/action/server/EventReadResponse.js +1 -0
- package/dist/esm/action/server/EventReadResponse.js.map +1 -1
- package/dist/esm/advertisement/mdns/MdnsAdvertisement.d.ts +1 -1
- package/dist/esm/advertisement/mdns/MdnsAdvertisement.d.ts.map +1 -1
- package/dist/esm/advertisement/mdns/MdnsAdvertisement.js +7 -7
- package/dist/esm/advertisement/mdns/MdnsAdvertisement.js.map +1 -1
- package/dist/esm/ble/Ble.d.ts +2 -0
- package/dist/esm/ble/Ble.d.ts.map +1 -1
- package/dist/esm/ble/Ble.js +4 -0
- package/dist/esm/ble/Ble.js.map +1 -1
- package/dist/esm/certificate/CdSigners.d.ts +52 -0
- package/dist/esm/certificate/CdSigners.d.ts.map +1 -0
- package/dist/esm/certificate/CdSigners.js +91 -0
- package/dist/esm/certificate/CdSigners.js.map +6 -0
- package/dist/esm/certificate/CertificateAuthority.d.ts +1 -1
- package/dist/esm/certificate/CertificateAuthority.d.ts.map +1 -1
- package/dist/esm/certificate/DeviceAttestationValidator.d.ts +59 -7
- package/dist/esm/certificate/DeviceAttestationValidator.d.ts.map +1 -1
- package/dist/esm/certificate/DeviceAttestationValidator.js +124 -45
- package/dist/esm/certificate/DeviceAttestationValidator.js.map +1 -1
- package/dist/esm/certificate/DeviceCertification.d.ts.map +1 -1
- package/dist/esm/certificate/DeviceCertification.js +5 -2
- package/dist/esm/certificate/DeviceCertification.js.map +1 -1
- package/dist/esm/certificate/NocsrValidator.d.ts +57 -0
- package/dist/esm/certificate/NocsrValidator.d.ts.map +1 -0
- package/dist/esm/certificate/NocsrValidator.js +89 -0
- package/dist/esm/certificate/NocsrValidator.js.map +6 -0
- package/dist/esm/certificate/PeerData.d.ts +12 -0
- package/dist/esm/certificate/PeerData.d.ts.map +1 -0
- package/dist/esm/certificate/PeerData.js +13 -0
- package/dist/esm/certificate/PeerData.js.map +6 -0
- package/dist/esm/certificate/index.d.ts +2 -0
- package/dist/esm/certificate/index.d.ts.map +1 -1
- package/dist/esm/certificate/index.js +2 -0
- package/dist/esm/certificate/index.js.map +1 -1
- package/dist/esm/certificate/kinds/AttestationCertificates.d.ts +42 -6
- package/dist/esm/certificate/kinds/AttestationCertificates.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/AttestationCertificates.js +112 -15
- package/dist/esm/certificate/kinds/AttestationCertificates.js.map +1 -1
- package/dist/esm/certificate/kinds/Certificate.d.ts +13 -7
- package/dist/esm/certificate/kinds/Certificate.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/Certificate.js +153 -256
- package/dist/esm/certificate/kinds/Certificate.js.map +2 -2
- package/dist/esm/certificate/kinds/CertificationDeclaration.d.ts +21 -3
- package/dist/esm/certificate/kinds/CertificationDeclaration.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/CertificationDeclaration.js +79 -20
- package/dist/esm/certificate/kinds/CertificationDeclaration.js.map +1 -1
- package/dist/esm/certificate/kinds/DistinguishedName.d.ts +190 -0
- package/dist/esm/certificate/kinds/DistinguishedName.d.ts.map +1 -0
- package/dist/esm/certificate/kinds/DistinguishedName.js +422 -0
- package/dist/esm/certificate/kinds/DistinguishedName.js.map +6 -0
- package/dist/esm/certificate/kinds/Icac.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/Icac.js +6 -11
- package/dist/esm/certificate/kinds/Icac.js.map +1 -1
- package/dist/esm/certificate/kinds/Noc.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/Noc.js +5 -4
- package/dist/esm/certificate/kinds/Noc.js.map +1 -1
- package/dist/esm/certificate/kinds/OperationalBase.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/OperationalBase.js +4 -2
- package/dist/esm/certificate/kinds/OperationalBase.js.map +1 -1
- package/dist/esm/certificate/kinds/Rcac.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/Rcac.js +6 -11
- package/dist/esm/certificate/kinds/Rcac.js.map +1 -1
- package/dist/esm/certificate/kinds/Vvsc.d.ts +3 -3
- package/dist/esm/certificate/kinds/Vvsc.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/Vvsc.js +20 -15
- package/dist/esm/certificate/kinds/Vvsc.js.map +1 -1
- package/dist/esm/certificate/kinds/definitions/asn.d.ts +1 -1
- package/dist/esm/certificate/kinds/definitions/asn.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/definitions/asn.js.map +1 -1
- package/dist/esm/certificate/kinds/definitions/attestation.d.ts +15 -15
- package/dist/esm/certificate/kinds/definitions/attestation.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/definitions/base.d.ts +33 -0
- package/dist/esm/certificate/kinds/definitions/base.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/definitions/base.js +9 -2
- package/dist/esm/certificate/kinds/definitions/base.js.map +1 -1
- package/dist/esm/certificate/kinds/definitions/operational.d.ts +24 -20
- package/dist/esm/certificate/kinds/definitions/operational.d.ts.map +1 -1
- package/dist/esm/certificate/kinds/definitions/operational.js +5 -3
- package/dist/esm/certificate/kinds/definitions/operational.js.map +1 -1
- package/dist/esm/codec/MessageCodec.d.ts +27 -2
- package/dist/esm/codec/MessageCodec.d.ts.map +1 -1
- package/dist/esm/codec/MessageCodec.js +82 -75
- package/dist/esm/codec/MessageCodec.js.map +1 -1
- package/dist/esm/common/OperationalCredentialsTypes.d.ts +6 -0
- package/dist/esm/common/OperationalCredentialsTypes.d.ts.map +1 -1
- package/dist/esm/common/OperationalCredentialsTypes.js +2 -0
- package/dist/esm/common/OperationalCredentialsTypes.js.map +1 -1
- package/dist/esm/dcl/DclCertificateService.d.ts +28 -7
- package/dist/esm/dcl/DclCertificateService.d.ts.map +1 -1
- package/dist/esm/dcl/DclCertificateService.js +108 -31
- package/dist/esm/dcl/DclCertificateService.js.map +1 -1
- package/dist/esm/fabric/Fabric.d.ts +10 -5
- package/dist/esm/fabric/Fabric.d.ts.map +1 -1
- package/dist/esm/fabric/Fabric.js +12 -5
- package/dist/esm/fabric/Fabric.js.map +1 -1
- package/dist/esm/fabric/FabricManager.d.ts +2 -2
- package/dist/esm/fabric/FabricManager.js +2 -2
- package/dist/esm/groups/FabricGroups.d.ts +2 -0
- package/dist/esm/groups/FabricGroups.d.ts.map +1 -1
- package/dist/esm/groups/FabricGroups.js +4 -0
- package/dist/esm/groups/FabricGroups.js.map +1 -1
- package/dist/esm/groups/Groups.d.ts +7 -0
- package/dist/esm/groups/Groups.d.ts.map +1 -1
- package/dist/esm/groups/Groups.js +11 -2
- package/dist/esm/groups/Groups.js.map +1 -1
- package/dist/esm/groups/KeySets.d.ts +3 -3
- package/dist/esm/groups/KeySets.js +3 -3
- package/dist/esm/interaction/InteractionMessenger.d.ts +18 -1
- package/dist/esm/interaction/InteractionMessenger.d.ts.map +1 -1
- package/dist/esm/interaction/InteractionMessenger.js +50 -20
- package/dist/esm/interaction/InteractionMessenger.js.map +1 -1
- package/dist/esm/mdns/InterfaceResponder.d.ts +137 -0
- package/dist/esm/mdns/InterfaceResponder.d.ts.map +1 -0
- package/dist/esm/mdns/InterfaceResponder.js +794 -0
- package/dist/esm/mdns/InterfaceResponder.js.map +6 -0
- package/dist/esm/mdns/MdnsServer.d.ts +82 -9
- package/dist/esm/mdns/MdnsServer.d.ts.map +1 -1
- package/dist/esm/mdns/MdnsServer.js +341 -273
- package/dist/esm/mdns/MdnsServer.js.map +2 -2
- package/dist/esm/mdns/MdnsService.d.ts.map +1 -1
- package/dist/esm/mdns/MdnsService.js +3 -1
- package/dist/esm/mdns/MdnsService.js.map +1 -1
- package/dist/esm/peer/AdministratorCommands.d.ts +26 -0
- package/dist/esm/peer/AdministratorCommands.d.ts.map +1 -0
- package/dist/esm/peer/AdministratorCommands.js +20 -0
- package/dist/esm/peer/AdministratorCommands.js.map +6 -0
- package/dist/esm/peer/CommissioningConnection.d.ts.map +1 -1
- package/dist/esm/peer/CommissioningConnection.js +4 -2
- package/dist/esm/peer/CommissioningConnection.js.map +1 -1
- package/dist/esm/peer/ControllerCommissioner.d.ts +9 -0
- package/dist/esm/peer/ControllerCommissioner.d.ts.map +1 -1
- package/dist/esm/peer/ControllerCommissioner.js +59 -13
- package/dist/esm/peer/ControllerCommissioner.js.map +1 -1
- package/dist/esm/peer/ControllerCommissioningFlow.d.ts +7 -7
- package/dist/esm/peer/ControllerCommissioningFlow.d.ts.map +1 -1
- package/dist/esm/peer/ControllerCommissioningFlow.js +125 -70
- package/dist/esm/peer/ControllerCommissioningFlow.js.map +1 -1
- package/dist/esm/peer/OperationalCertificateUpdate.d.ts +181 -0
- package/dist/esm/peer/OperationalCertificateUpdate.d.ts.map +1 -0
- package/dist/esm/peer/OperationalCertificateUpdate.js +553 -0
- package/dist/esm/peer/OperationalCertificateUpdate.js.map +6 -0
- package/dist/esm/peer/Peer.d.ts +5 -0
- package/dist/esm/peer/Peer.d.ts.map +1 -1
- package/dist/esm/peer/Peer.js +29 -1
- package/dist/esm/peer/Peer.js.map +1 -1
- package/dist/esm/peer/PeerAddressStore.d.ts +37 -0
- package/dist/esm/peer/PeerAddressStore.d.ts.map +1 -0
- package/dist/esm/peer/PeerAddressStore.js +94 -0
- package/dist/esm/peer/PeerAddressStore.js.map +6 -0
- package/dist/esm/peer/PeerConnection.d.ts.map +1 -1
- package/dist/esm/peer/PeerConnection.js +0 -1
- package/dist/esm/peer/PeerConnection.js.map +1 -1
- package/dist/esm/peer/PeerDescriptor.d.ts +3 -4
- package/dist/esm/peer/PeerDescriptor.d.ts.map +1 -1
- package/dist/esm/peer/PeerDescriptor.js.map +1 -1
- package/dist/esm/peer/PeerExchangeProvider.d.ts.map +1 -1
- package/dist/esm/peer/PeerExchangeProvider.js +3 -2
- package/dist/esm/peer/PeerExchangeProvider.js.map +1 -1
- package/dist/esm/peer/PeerLossContext.d.ts +10 -2
- package/dist/esm/peer/PeerLossContext.d.ts.map +1 -1
- package/dist/esm/peer/PhysicalDeviceProperties.d.ts +13 -0
- package/dist/esm/peer/PhysicalDeviceProperties.d.ts.map +1 -1
- package/dist/esm/peer/PhysicalDeviceProperties.js +3 -2
- package/dist/esm/peer/PhysicalDeviceProperties.js.map +1 -1
- package/dist/esm/peer/RebootResubscribeArmer.d.ts +3 -3
- package/dist/esm/peer/RebootResubscribeArmer.d.ts.map +1 -1
- package/dist/esm/peer/RebootResubscribeArmer.js +21 -9
- package/dist/esm/peer/RebootResubscribeArmer.js.map +1 -1
- package/dist/esm/peer/index.d.ts +2 -0
- package/dist/esm/peer/index.d.ts.map +1 -1
- package/dist/esm/peer/index.js +2 -0
- package/dist/esm/peer/index.js.map +1 -1
- package/dist/esm/protocol/DeviceAdvertiser.d.ts.map +1 -1
- package/dist/esm/protocol/DeviceAdvertiser.js +1 -1
- package/dist/esm/protocol/DeviceAdvertiser.js.map +1 -1
- package/dist/esm/protocol/ExchangeManager.d.ts +0 -1
- package/dist/esm/protocol/ExchangeManager.d.ts.map +1 -1
- package/dist/esm/protocol/ExchangeManager.js +145 -67
- package/dist/esm/protocol/ExchangeManager.js.map +1 -1
- package/dist/esm/protocol/ExchangeProvider.d.ts +3 -2
- package/dist/esm/protocol/ExchangeProvider.d.ts.map +1 -1
- package/dist/esm/protocol/ExchangeProvider.js.map +1 -1
- package/dist/esm/protocol/MessageExchange.d.ts +13 -0
- package/dist/esm/protocol/MessageExchange.d.ts.map +1 -1
- package/dist/esm/protocol/MessageExchange.js +23 -7
- package/dist/esm/protocol/MessageExchange.js.map +1 -1
- package/dist/esm/protocol/MessageReceptionState.d.ts +1 -1
- package/dist/esm/protocol/errors.d.ts +7 -1
- package/dist/esm/protocol/errors.d.ts.map +1 -1
- package/dist/esm/protocol/errors.js +4 -1
- package/dist/esm/protocol/errors.js.map +1 -1
- package/dist/esm/securechannel/SecureChannelMessenger.d.ts +6 -1
- package/dist/esm/securechannel/SecureChannelMessenger.d.ts.map +1 -1
- package/dist/esm/securechannel/SecureChannelMessenger.js +27 -12
- package/dist/esm/securechannel/SecureChannelMessenger.js.map +1 -1
- package/dist/esm/session/GroupSession.d.ts +58 -15
- package/dist/esm/session/GroupSession.d.ts.map +1 -1
- package/dist/esm/session/GroupSession.js +97 -102
- package/dist/esm/session/GroupSession.js.map +2 -2
- package/dist/esm/session/NodeSession.d.ts +50 -1
- package/dist/esm/session/NodeSession.d.ts.map +1 -1
- package/dist/esm/session/NodeSession.js +83 -5
- package/dist/esm/session/NodeSession.js.map +1 -1
- package/dist/esm/session/SecureSession.d.ts +9 -0
- package/dist/esm/session/SecureSession.d.ts.map +1 -1
- package/dist/esm/session/SecureSession.js +18 -1
- package/dist/esm/session/SecureSession.js.map +1 -1
- package/dist/esm/session/Session.d.ts +2 -2
- package/dist/esm/session/Session.d.ts.map +1 -1
- package/dist/esm/session/Session.js +1 -1
- package/dist/esm/session/SessionManager.d.ts +76 -28
- package/dist/esm/session/SessionManager.d.ts.map +1 -1
- package/dist/esm/session/SessionManager.js +319 -156
- package/dist/esm/session/SessionManager.js.map +2 -2
- package/dist/esm/session/UnsecuredSession.d.ts +0 -1
- package/dist/esm/session/UnsecuredSession.d.ts.map +1 -1
- package/dist/esm/session/UnsecuredSession.js +5 -3
- package/dist/esm/session/UnsecuredSession.js.map +1 -1
- package/dist/esm/session/case/CaseClient.d.ts +5 -0
- package/dist/esm/session/case/CaseClient.d.ts.map +1 -1
- package/dist/esm/session/case/CaseClient.js +12 -11
- package/dist/esm/session/case/CaseClient.js.map +2 -2
- package/dist/esm/session/case/CaseServer.d.ts.map +1 -1
- package/dist/esm/session/case/CaseServer.js +31 -11
- package/dist/esm/session/case/CaseServer.js.map +1 -1
- package/package.json +5 -5
- package/src/action/Val.ts +8 -0
- package/src/action/client/ClientInteraction.ts +57 -33
- package/src/action/client/ClientRequest.ts +15 -0
- package/src/action/client/InputChunk.ts +57 -2
- package/src/action/client/subscription/ClientSubscription.ts +5 -0
- package/src/action/client/subscription/ClientSubscriptionHandler.ts +15 -0
- package/src/action/client/subscription/PeerSubscription.ts +73 -0
- package/src/action/errors.ts +10 -3
- package/src/action/protocols.ts +7 -1
- package/src/action/request/Invoke.ts +60 -15
- package/src/action/request/Write.ts +7 -6
- package/src/action/response/InvokeResult.ts +32 -2
- package/src/action/response/ReadResult.ts +15 -5
- package/src/action/server/AttributeReadResponse.ts +3 -2
- package/src/action/server/AttributeWriteResponse.ts +14 -3
- package/src/action/server/EventReadResponse.ts +1 -0
- package/src/advertisement/mdns/MdnsAdvertisement.ts +9 -9
- package/src/ble/Ble.ts +5 -0
- package/src/certificate/CdSigners.ts +137 -0
- package/src/certificate/CertificateAuthority.ts +1 -1
- package/src/certificate/DeviceAttestationValidator.ts +213 -56
- package/src/certificate/DeviceCertification.ts +6 -2
- package/src/certificate/NocsrValidator.ts +140 -0
- package/src/certificate/PeerData.ts +15 -0
- package/src/certificate/index.ts +2 -0
- package/src/certificate/kinds/AttestationCertificates.ts +183 -15
- package/src/certificate/kinds/Certificate.ts +203 -308
- package/src/certificate/kinds/CertificationDeclaration.ts +100 -46
- package/src/certificate/kinds/DistinguishedName.ts +677 -0
- package/src/certificate/kinds/Icac.ts +7 -12
- package/src/certificate/kinds/Noc.ts +12 -8
- package/src/certificate/kinds/OperationalBase.ts +5 -2
- package/src/certificate/kinds/Rcac.ts +7 -12
- package/src/certificate/kinds/Vvsc.ts +24 -15
- package/src/certificate/kinds/definitions/asn.ts +1 -1
- package/src/certificate/kinds/definitions/attestation.ts +15 -15
- package/src/certificate/kinds/definitions/base.ts +43 -1
- package/src/certificate/kinds/definitions/operational.ts +4 -3
- package/src/codec/MessageCodec.ts +92 -81
- package/src/common/OperationalCredentialsTypes.ts +7 -0
- package/src/dcl/DclCertificateService.ts +135 -36
- package/src/fabric/Fabric.ts +13 -6
- package/src/fabric/FabricManager.ts +2 -2
- package/src/groups/FabricGroups.ts +5 -0
- package/src/groups/Groups.ts +12 -3
- package/src/groups/KeySets.ts +3 -3
- package/src/interaction/InteractionMessenger.ts +58 -20
- package/src/mdns/InterfaceResponder.ts +1031 -0
- package/src/mdns/MdnsServer.ts +400 -360
- package/src/mdns/MdnsService.ts +2 -0
- package/src/peer/AdministratorCommands.ts +37 -0
- package/src/peer/CommissioningConnection.ts +5 -1
- package/src/peer/ControllerCommissioner.ts +69 -19
- package/src/peer/ControllerCommissioningFlow.ts +149 -99
- package/src/peer/OperationalCertificateUpdate.ts +922 -0
- package/src/peer/Peer.ts +31 -16
- package/src/peer/PeerAddressStore.ts +119 -0
- package/src/peer/PeerConnection.ts +0 -1
- package/src/peer/PeerDescriptor.ts +3 -4
- package/src/peer/PeerExchangeProvider.ts +4 -6
- package/src/peer/PeerLossContext.ts +11 -2
- package/src/peer/PhysicalDeviceProperties.ts +25 -12
- package/src/peer/RebootResubscribeArmer.ts +37 -16
- package/src/peer/index.ts +2 -0
- package/src/protocol/DeviceAdvertiser.ts +5 -1
- package/src/protocol/ExchangeManager.ts +162 -88
- package/src/protocol/ExchangeProvider.ts +3 -2
- package/src/protocol/MessageExchange.ts +29 -7
- package/src/protocol/MessageReceptionState.ts +2 -2
- package/src/protocol/errors.ts +7 -1
- package/src/securechannel/SecureChannelMessenger.ts +26 -13
- package/src/session/GroupSession.ts +147 -111
- package/src/session/NodeSession.ts +89 -4
- package/src/session/SecureSession.ts +27 -1
- package/src/session/Session.ts +2 -2
- package/src/session/SessionManager.ts +429 -189
- package/src/session/UnsecuredSession.ts +9 -3
- package/src/session/case/CaseClient.ts +15 -10
- package/src/session/case/CaseServer.ts +41 -17
|
@@ -79,6 +79,25 @@ import { SustainedSubscription } from "./subscription/SustainedSubscription.js";
|
|
|
79
79
|
|
|
80
80
|
const logger = Logger.get("ClientInteraction");
|
|
81
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Estimates whether a subscribe request like `request` primes with little data. It does when every attribute path
|
|
84
|
+
* names one attribute or the request carried at least one DataVersionFilter and all of them fit, and when it has no
|
|
85
|
+
* event requests or carries an event filter. The estimate ignores attribute sizes and which clusters the filters
|
|
86
|
+
* cover.
|
|
87
|
+
*/
|
|
88
|
+
function primesCompactly(request: Read, allDataVersionFiltersSent: boolean) {
|
|
89
|
+
const { attributeRequests, dataVersionFilters, eventRequests, eventFilters } = request;
|
|
90
|
+
const attributesCompact =
|
|
91
|
+
attributeRequests === undefined ||
|
|
92
|
+
attributeRequests.every(
|
|
93
|
+
({ endpointId, clusterId, attributeId }) =>
|
|
94
|
+
endpointId !== undefined && clusterId !== undefined && attributeId !== undefined,
|
|
95
|
+
) ||
|
|
96
|
+
(allDataVersionFiltersSent && !!dataVersionFilters?.length);
|
|
97
|
+
const eventsCompact = !eventRequests?.length || !!eventFilters?.length;
|
|
98
|
+
return attributesCompact && eventsCompact;
|
|
99
|
+
}
|
|
100
|
+
|
|
82
101
|
/**
|
|
83
102
|
* Returns a log-friendly peer address diagnostic for sessions that expose one
|
|
84
103
|
* (currently: group multicast).
|
|
@@ -207,6 +226,7 @@ function isBatchable(request: ClientInvoke) {
|
|
|
207
226
|
useExtendedFailSafeMessageResponseTimeout: !!request.useExtendedFailSafeMessageResponseTimeout,
|
|
208
227
|
additionalMrpDelay: request.additionalMrpDelay !== undefined,
|
|
209
228
|
addressOverride: request.addressOverride !== undefined,
|
|
229
|
+
requireExistingSession: !!request.requireExistingSession,
|
|
210
230
|
// Server only
|
|
211
231
|
beforeDispatch: request.beforeDispatch !== undefined,
|
|
212
232
|
};
|
|
@@ -225,6 +245,7 @@ export class ClientInteraction<
|
|
|
225
245
|
/** One entry per running interaction; retries may reuse request objects. */
|
|
226
246
|
readonly #interactions = new BasicSet<symbol>();
|
|
227
247
|
#subscriptions?: ClientSubscriptions;
|
|
248
|
+
readonly #established = new Set<ClientSubscription>();
|
|
228
249
|
readonly #abort: Abort;
|
|
229
250
|
readonly #sustainRetries: RetrySchedule;
|
|
230
251
|
readonly #address?: PeerAddress;
|
|
@@ -270,14 +291,10 @@ export class ClientInteraction<
|
|
|
270
291
|
using _closing = this.#lifetime.closing();
|
|
271
292
|
|
|
272
293
|
// Close subscriptions established through this interaction so they do not outlive the interactable; a
|
|
273
|
-
// sustained subscription would otherwise retry forever against a closed interactable.
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
if (PeerAddress.is(peer, subscription.peer)) {
|
|
278
|
-
subscription.close();
|
|
279
|
-
}
|
|
280
|
-
}
|
|
294
|
+
// sustained subscription would otherwise retry forever against a closed interactable. Subscriptions other
|
|
295
|
+
// interactions established to the same peer stay open.
|
|
296
|
+
for (const subscription of [...this.#established]) {
|
|
297
|
+
subscription.close();
|
|
281
298
|
}
|
|
282
299
|
|
|
283
300
|
// Close batching
|
|
@@ -560,14 +577,17 @@ export class ClientInteraction<
|
|
|
560
577
|
|
|
561
578
|
const data = commandFields === undefined ? undefined : responseSchema?.decodeTlv(commandFields);
|
|
562
579
|
|
|
563
|
-
logger.info(
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
580
|
+
logger.info(() => {
|
|
581
|
+
const loggedData = Invoke.redactResponseFields(cmd, data);
|
|
582
|
+
return [
|
|
583
|
+
"Invoke",
|
|
584
|
+
Mark.INBOUND,
|
|
585
|
+
messenger.exchange.via,
|
|
586
|
+
messenger.exchange.diagnostics,
|
|
587
|
+
Diagnostic.strong(Invoke.isLegacy(cmd) ? "(legacy)" : resolvePathForSpecifier(cmd)),
|
|
588
|
+
isObject(loggedData) ? Diagnostic.dict(loggedData) : Diagnostic.weak("(no payload)"),
|
|
589
|
+
];
|
|
590
|
+
});
|
|
571
591
|
|
|
572
592
|
chunk.push({
|
|
573
593
|
kind: "cmd-response",
|
|
@@ -679,19 +699,7 @@ export class ClientInteraction<
|
|
|
679
699
|
...request,
|
|
680
700
|
commands: batchCommands,
|
|
681
701
|
invokeRequests: batchInvokeRequests,
|
|
682
|
-
[Diagnostic.value]: () =>
|
|
683
|
-
Diagnostic.list(
|
|
684
|
-
[...batchCommands.values()].map(cmd => {
|
|
685
|
-
const { commandRef } = cmd;
|
|
686
|
-
const fields = "fields" in cmd ? cmd.fields : undefined;
|
|
687
|
-
return [
|
|
688
|
-
Diagnostic.strong(Invoke.isLegacy(cmd) ? "(legacy)" : resolvePathForSpecifier(cmd)),
|
|
689
|
-
"with",
|
|
690
|
-
isObject(fields) ? Diagnostic.dict(fields) : "(no payload)",
|
|
691
|
-
commandRef !== undefined && batchCommands.size > 1 ? `(ref ${commandRef})` : "",
|
|
692
|
-
];
|
|
693
|
-
}),
|
|
694
|
-
),
|
|
702
|
+
[Diagnostic.value]: () => Invoke.diagnosticOf(batchCommands.values()),
|
|
695
703
|
};
|
|
696
704
|
return this.#invokeSingle(batchRequest, session);
|
|
697
705
|
});
|
|
@@ -1015,6 +1023,11 @@ export class ClientInteraction<
|
|
|
1015
1023
|
if (subscriptionPathsCount === 0) {
|
|
1016
1024
|
throw new ImplementationError("When subscribing to attributes and events, at least one must be specified.");
|
|
1017
1025
|
}
|
|
1026
|
+
if (request.sustain && request.requireExistingSession) {
|
|
1027
|
+
throw new ImplementationError(
|
|
1028
|
+
"A sustained subscription re-establishes its session, so it cannot require an existing session",
|
|
1029
|
+
);
|
|
1030
|
+
}
|
|
1018
1031
|
if (subscriptionPathsCount > this.#exchangeProvider.subscribePathsSupported) {
|
|
1019
1032
|
logger.info(
|
|
1020
1033
|
`Subscribe interactions with more than ${this.#exchangeProvider.subscribePathsSupported} paths might be not allowed by the device.`,
|
|
@@ -1070,15 +1083,16 @@ export class ClientInteraction<
|
|
|
1070
1083
|
);
|
|
1071
1084
|
|
|
1072
1085
|
let responseMessage: Message;
|
|
1086
|
+
let allDataVersionFiltersSent: boolean;
|
|
1073
1087
|
try {
|
|
1074
|
-
await messenger.sendSubscribeRequest(
|
|
1088
|
+
({ allDataVersionFiltersSent } = await messenger.sendSubscribeRequest(
|
|
1075
1089
|
{
|
|
1076
1090
|
...request,
|
|
1077
1091
|
minIntervalFloorSeconds: Seconds.of(minIntervalFloor),
|
|
1078
1092
|
maxIntervalCeilingSeconds: Seconds.of(maxIntervalCeiling),
|
|
1079
1093
|
},
|
|
1080
1094
|
{ abort },
|
|
1081
|
-
);
|
|
1095
|
+
));
|
|
1082
1096
|
|
|
1083
1097
|
await this.#handleSubscriptionResponse(request, readChunks(messenger, abort));
|
|
1084
1098
|
abort.throwIfAborted();
|
|
@@ -1102,12 +1116,17 @@ export class ClientInteraction<
|
|
|
1102
1116
|
lifetime: this.subscriptions,
|
|
1103
1117
|
request,
|
|
1104
1118
|
peer,
|
|
1105
|
-
closed: () =>
|
|
1119
|
+
closed: () => {
|
|
1120
|
+
this.subscriptions.delete(subscription);
|
|
1121
|
+
this.#established.delete(subscription);
|
|
1122
|
+
},
|
|
1106
1123
|
response,
|
|
1107
1124
|
abort,
|
|
1108
1125
|
maxPeerResponseTime: this.maximumPeerResponseTime(SUBSCRIPTION_PROCESSING_TIME),
|
|
1126
|
+
compactPriming: primesCompactly(request, allDataVersionFiltersSent),
|
|
1109
1127
|
});
|
|
1110
1128
|
this.subscriptions.addPeer(subscription);
|
|
1129
|
+
this.#established.add(subscription);
|
|
1111
1130
|
|
|
1112
1131
|
logger.info(
|
|
1113
1132
|
"Subscription successful",
|
|
@@ -1145,7 +1164,10 @@ export class ClientInteraction<
|
|
|
1145
1164
|
lifetime: this.subscriptions,
|
|
1146
1165
|
subscribe,
|
|
1147
1166
|
peer,
|
|
1148
|
-
closed: () =>
|
|
1167
|
+
closed: () => {
|
|
1168
|
+
this.subscriptions.delete(subscription);
|
|
1169
|
+
this.#established.delete(subscription);
|
|
1170
|
+
},
|
|
1149
1171
|
request,
|
|
1150
1172
|
// Both, or an abort by the caller would end only the attempt in flight while the
|
|
1151
1173
|
// sustainer treats that as a failure to retry
|
|
@@ -1165,6 +1187,7 @@ export class ClientInteraction<
|
|
|
1165
1187
|
}
|
|
1166
1188
|
|
|
1167
1189
|
this.subscriptions.addActive(subscription);
|
|
1190
|
+
this.#established.add(subscription);
|
|
1168
1191
|
|
|
1169
1192
|
return subscription as unknown as SubscriptionResult<T>;
|
|
1170
1193
|
}
|
|
@@ -1252,6 +1275,7 @@ export class ClientInteraction<
|
|
|
1252
1275
|
abort,
|
|
1253
1276
|
connectionTimeout: session?.connectionTimeout,
|
|
1254
1277
|
addressOverride: request.addressOverride,
|
|
1278
|
+
requireExistingSession: request.requireExistingSession,
|
|
1255
1279
|
requiredTransport,
|
|
1256
1280
|
});
|
|
1257
1281
|
} catch (e) {
|
|
@@ -39,6 +39,21 @@ export interface ClientRequest {
|
|
|
39
39
|
*/
|
|
40
40
|
addressOverride?: ServerAddressUdp;
|
|
41
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Use only a session that exists when the interaction starts.
|
|
44
|
+
*
|
|
45
|
+
* By default an interaction with a peer without an active session establishes one first, which may take up to the
|
|
46
|
+
* peer's connection timeout. With this flag set the interaction fails with `SessionClosedError` instead. Use it
|
|
47
|
+
* for a best-effort message that is worthless when the peer must first be reconnected.
|
|
48
|
+
*
|
|
49
|
+
* The flag does not apply to group addresses, which have no session to establish. It does not shorten other
|
|
50
|
+
* waits: an interaction bound to a fixed session sends on that session, a
|
|
51
|
+
* `ClientNode` first waits for a sleeping LIT ICD peer to wake (see {@link icdAwaitTimeout}), and a send on a session
|
|
52
|
+
* whose peer stopped answering ends only when the peer is considered unresponsive. A sustained subscription
|
|
53
|
+
* re-establishes its session by design and rejects the flag with `ImplementationError`.
|
|
54
|
+
*/
|
|
55
|
+
requireExistingSession?: boolean;
|
|
56
|
+
|
|
42
57
|
/**
|
|
43
58
|
* Override the wait applied to a one-shot interaction with an idle LIT (Long Idle Time) ICD peer.
|
|
44
59
|
*
|
|
@@ -338,10 +338,12 @@ function* emitEvents(input: DataReport): Generator<ReadResult.EventValue | ReadR
|
|
|
338
338
|
const events = input.eventReports;
|
|
339
339
|
if (events === undefined || events.length === 0) return;
|
|
340
340
|
|
|
341
|
+
const timestamps = new EventTimestampChain();
|
|
341
342
|
for (const entry of events) {
|
|
342
343
|
try {
|
|
343
344
|
if (entry.eventData !== undefined) {
|
|
344
|
-
const
|
|
345
|
+
const resolvedTimestamp = timestamps.resolve(entry.eventData);
|
|
346
|
+
const value = decodeEventValue(entry.eventData, resolvedTimestamp);
|
|
345
347
|
if (value !== undefined) yield value;
|
|
346
348
|
} else if (entry.eventStatus !== undefined) {
|
|
347
349
|
const status = buildEventStatus(entry.eventStatus);
|
|
@@ -354,7 +356,59 @@ function* emitEvents(input: DataReport): Generator<ReadResult.EventValue | ReadR
|
|
|
354
356
|
}
|
|
355
357
|
}
|
|
356
358
|
|
|
357
|
-
|
|
359
|
+
/**
|
|
360
|
+
* Reconstructs absolute event timestamps within one ReportData message.
|
|
361
|
+
*
|
|
362
|
+
* Per Matter Core §10.7.3.1 a delta timestamp is relative to the prior event. The CHIP SDK encodes each delta against
|
|
363
|
+
* the event directly before it in the same message and starts each message with an absolute timestamp, so a chain
|
|
364
|
+
* never spans messages. It sends deltas only on the system clock, and a system event after an epoch event gets a
|
|
365
|
+
* meaningless delta, so a delta resolves only when the event before it used the same clock. See
|
|
366
|
+
* {@link ReadResult.EventValue.resolvedTimestamp} for the result.
|
|
367
|
+
*
|
|
368
|
+
* @see {@link MatterSpecification.v161.Core} § 10.7.3.1
|
|
369
|
+
*/
|
|
370
|
+
class EventTimestampChain {
|
|
371
|
+
#prior?: { clock: "epoch" | "system"; value: number };
|
|
372
|
+
|
|
373
|
+
resolve({
|
|
374
|
+
epochTimestamp,
|
|
375
|
+
systemTimestamp,
|
|
376
|
+
deltaEpochTimestamp,
|
|
377
|
+
deltaSystemTimestamp,
|
|
378
|
+
}: TypeFromSchema<typeof TlvEventData>): number | undefined {
|
|
379
|
+
if (epochTimestamp !== undefined) {
|
|
380
|
+
return this.#advance("epoch", Number(epochTimestamp));
|
|
381
|
+
}
|
|
382
|
+
if (systemTimestamp !== undefined) {
|
|
383
|
+
return this.#advance("system", Number(systemTimestamp));
|
|
384
|
+
}
|
|
385
|
+
if (deltaEpochTimestamp !== undefined) {
|
|
386
|
+
return this.#advanceBy("epoch", Number(deltaEpochTimestamp));
|
|
387
|
+
}
|
|
388
|
+
if (deltaSystemTimestamp !== undefined) {
|
|
389
|
+
return this.#advanceBy("system", Number(deltaSystemTimestamp));
|
|
390
|
+
}
|
|
391
|
+
this.#prior = undefined;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
#advance(clock: "epoch" | "system", value: number) {
|
|
395
|
+
this.#prior = { clock, value };
|
|
396
|
+
return value;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
#advanceBy(clock: "epoch" | "system", delta: number) {
|
|
400
|
+
if (this.#prior?.clock !== clock) {
|
|
401
|
+
this.#prior = undefined;
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
return this.#advance(clock, this.#prior.value + delta);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
function decodeEventValue(
|
|
409
|
+
eventData: TypeFromSchema<typeof TlvEventData>,
|
|
410
|
+
resolvedTimestamp: number | undefined,
|
|
411
|
+
): ReadResult.EventValue | undefined {
|
|
358
412
|
const {
|
|
359
413
|
path: { nodeId, endpointId, clusterId, eventId },
|
|
360
414
|
eventNumber,
|
|
@@ -396,6 +450,7 @@ function decodeEventValue(eventData: TypeFromSchema<typeof TlvEventData>): ReadR
|
|
|
396
450
|
number: eventNumber,
|
|
397
451
|
priority,
|
|
398
452
|
timestamp,
|
|
453
|
+
resolvedTimestamp,
|
|
399
454
|
epochTimestamp,
|
|
400
455
|
systemTimestamp,
|
|
401
456
|
deltaEpochTimestamp,
|
|
@@ -57,6 +57,11 @@ export abstract class ClientSubscription implements ActiveSubscription {
|
|
|
57
57
|
this.#lifetime.name = [this.kind, Diagnostic.strong(id)];
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
/** Whether {@link close} ran; no new reports are routed to a closed subscription. */
|
|
61
|
+
get isClosed() {
|
|
62
|
+
return this.#isClosed;
|
|
63
|
+
}
|
|
64
|
+
|
|
60
65
|
close() {
|
|
61
66
|
if (this.#isClosed) {
|
|
62
67
|
return;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { ReadResult } from "#action/response/ReadResult.js";
|
|
8
8
|
import { IncomingInteractionClientMessenger } from "#interaction/InteractionMessenger.js";
|
|
9
9
|
import { Subscription } from "#interaction/Subscription.js";
|
|
10
|
+
import { PeerAckMissingError } from "#peer/PeerCommunicationError.js";
|
|
10
11
|
import { MessageExchange } from "#protocol/MessageExchange.js";
|
|
11
12
|
import { ProtocolHandler } from "#protocol/ProtocolHandler.js";
|
|
12
13
|
import { SecureSession } from "#session/SecureSession.js";
|
|
@@ -103,6 +104,8 @@ export class ClientSubscriptionHandler implements ProtocolHandler {
|
|
|
103
104
|
return;
|
|
104
105
|
}
|
|
105
106
|
|
|
107
|
+
const reportNumber = subscription.nextReportNumber();
|
|
108
|
+
|
|
106
109
|
// Pass the data to the recipient
|
|
107
110
|
try {
|
|
108
111
|
subscription.isReading = true;
|
|
@@ -136,11 +139,23 @@ export class ClientSubscriptionHandler implements ProtocolHandler {
|
|
|
136
139
|
for await (const _chunk of reports);
|
|
137
140
|
}
|
|
138
141
|
}
|
|
142
|
+
} catch (error) {
|
|
143
|
+
if (messenger.unacknowledgedReportStatus !== "chunk" || !causedBy(error, PeerAckMissingError)) {
|
|
144
|
+
throw error;
|
|
145
|
+
}
|
|
139
146
|
} finally {
|
|
140
147
|
subscription.isReading = false;
|
|
141
148
|
subscription.timeoutAt = undefined;
|
|
142
149
|
this.#subscriptions.resetTimer();
|
|
143
150
|
await messenger.close();
|
|
151
|
+
const unacknowledged = messenger.unacknowledgedReportStatus;
|
|
152
|
+
if (unacknowledged !== undefined) {
|
|
153
|
+
if (this.#subscriptions.isBlocked) {
|
|
154
|
+
logger.debug(exchange.via, "Report status not acknowledged during shutdown");
|
|
155
|
+
} else {
|
|
156
|
+
subscription.reportStatusUnacknowledged(reportNumber, unacknowledged);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
144
159
|
}
|
|
145
160
|
}
|
|
146
161
|
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import type { UnacknowledgedReportStatus } from "#interaction/InteractionMessenger.js";
|
|
7
8
|
import { Subscription } from "#interaction/Subscription.js";
|
|
8
9
|
import { Diagnostic, Duration, Millis, Seconds, Timestamp } from "@matter/general";
|
|
9
10
|
import type { SubscribeResponse } from "@matter/types";
|
|
@@ -16,6 +17,8 @@ export class PeerSubscription extends ClientSubscription {
|
|
|
16
17
|
readonly interactionModelRevision: number | undefined;
|
|
17
18
|
readonly maxInterval: number;
|
|
18
19
|
readonly #maxPeerResponseTime: Duration;
|
|
20
|
+
readonly #compactPriming: boolean;
|
|
21
|
+
#reportsStarted = 0;
|
|
19
22
|
isReading = false;
|
|
20
23
|
|
|
21
24
|
/** Liveness deadline on the clock of `Time.nowUs`. */
|
|
@@ -24,6 +27,7 @@ export class PeerSubscription extends ClientSubscription {
|
|
|
24
27
|
constructor(config: PeerSubscription.Configuration) {
|
|
25
28
|
const {
|
|
26
29
|
maxPeerResponseTime,
|
|
30
|
+
compactPriming = false,
|
|
27
31
|
response: { subscriptionId, interactionModelRevision, maxInterval },
|
|
28
32
|
} = config;
|
|
29
33
|
|
|
@@ -33,6 +37,7 @@ export class PeerSubscription extends ClientSubscription {
|
|
|
33
37
|
this.interactionModelRevision = interactionModelRevision;
|
|
34
38
|
this.maxInterval = maxInterval;
|
|
35
39
|
this.#maxPeerResponseTime = maxPeerResponseTime;
|
|
40
|
+
this.#compactPriming = compactPriming;
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
get timeout() {
|
|
@@ -51,11 +56,79 @@ export class PeerSubscription extends ClientSubscription {
|
|
|
51
56
|
|
|
52
57
|
this.close();
|
|
53
58
|
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Counts a report the peer started sending on this subscription. Returns the number to pass to
|
|
62
|
+
* {@link reportStatusUnacknowledged} for that report.
|
|
63
|
+
*/
|
|
64
|
+
nextReportNumber() {
|
|
65
|
+
return ++this.#reportsStarted;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Decides whether the subscription is lost because the peer did not acknowledge our status response to report
|
|
70
|
+
* number `reportNumber` (see {@link nextReportNumber}), and closes it if so.
|
|
71
|
+
*
|
|
72
|
+
* A publisher that receives no status response may end the subscription. CHIP does
|
|
73
|
+
* (`ReadHandler::OnResponseTimeout`); with persisted subscriptions it may resume it later. matter.js keeps it
|
|
74
|
+
* until three reports in a row failed. A close lets the owner replace the subscription before {@link timeout},
|
|
75
|
+
* which costs the priming report of the replacement even when the publisher kept the subscription:
|
|
76
|
+
*
|
|
77
|
+
* | Unacknowledged status | Priming of a replacement | Action |
|
|
78
|
+
* |-----------------------|--------------------------|-------------------------------|
|
|
79
|
+
* | `"chunk"` | any | close, as a CHIP client does |
|
|
80
|
+
* | `"final"` | compact | close |
|
|
81
|
+
* | `"final"` | full | keep; {@link timeout} decides |
|
|
82
|
+
*
|
|
83
|
+
* {@link Configuration.compactPriming} tells whether that priming is compact. A subscription that is closed, or on
|
|
84
|
+
* which a newer report started, is kept as it is.
|
|
85
|
+
*
|
|
86
|
+
* @see {@link MatterSpecification.v161.Core} § 8.5
|
|
87
|
+
*/
|
|
88
|
+
reportStatusUnacknowledged(reportNumber: number, status: UnacknowledgedReportStatus) {
|
|
89
|
+
if (this.isClosed || reportNumber !== this.#reportsStarted) {
|
|
90
|
+
this.logger.debug(
|
|
91
|
+
"Subscription",
|
|
92
|
+
Diagnostic.strong(Subscription.idStrOf(this.subscriptionId)),
|
|
93
|
+
"to peer",
|
|
94
|
+
this.peer.toString(),
|
|
95
|
+
"ignores an unacknowledged report status because it is closed or received a newer report",
|
|
96
|
+
);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (status === "final" && !this.#compactPriming) {
|
|
101
|
+
this.logger.debug(
|
|
102
|
+
"Subscription",
|
|
103
|
+
Diagnostic.strong(Subscription.idStrOf(this.subscriptionId)),
|
|
104
|
+
"to peer",
|
|
105
|
+
this.peer.toString(),
|
|
106
|
+
"kept after an unacknowledged report status because its priming report is not compact",
|
|
107
|
+
);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
this.logger.info(
|
|
112
|
+
"Subscription",
|
|
113
|
+
Diagnostic.strong(Subscription.idStrOf(this.subscriptionId)),
|
|
114
|
+
"to peer",
|
|
115
|
+
this.peer.toString(),
|
|
116
|
+
"lost: peer did not acknowledge our status response to its report",
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
this.close();
|
|
120
|
+
}
|
|
54
121
|
}
|
|
55
122
|
|
|
56
123
|
export namespace PeerSubscription {
|
|
57
124
|
export interface Configuration extends ClientSubscription.Configuration {
|
|
58
125
|
response: SubscribeResponse;
|
|
59
126
|
maxPeerResponseTime: Duration;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Whether the subscribe request that created this subscription is estimated to prime with little data. Stands
|
|
130
|
+
* in for the request that would replace the subscription. Defaults to false.
|
|
131
|
+
*/
|
|
132
|
+
compactPriming?: boolean;
|
|
60
133
|
}
|
|
61
134
|
}
|
package/src/action/errors.ts
CHANGED
|
@@ -65,7 +65,7 @@ export class DatatypeError extends ValidateError {
|
|
|
65
65
|
constructor(path: SchemaErrorPath, type: string, value: unknown, code?: Status) {
|
|
66
66
|
let str = `${value}`;
|
|
67
67
|
if (str.length > 60) {
|
|
68
|
-
str = `${str.substring(60)}…`;
|
|
68
|
+
str = `${str.substring(0, 60)}…`;
|
|
69
69
|
}
|
|
70
70
|
super(path, `Value "${str}" is not ${type}`, code);
|
|
71
71
|
}
|
|
@@ -123,11 +123,18 @@ export class ConformanceError extends ValidateError {
|
|
|
123
123
|
export class EnumValueConformanceError extends ConformanceError {}
|
|
124
124
|
|
|
125
125
|
/**
|
|
126
|
-
* Thrown for access
|
|
126
|
+
* Thrown for access to a managed value that no longer tracks live state: its context exited, a change in its
|
|
127
|
+
* transaction moved, removed or replaced it in its list, or it is a read-only view. A write always throws. A read of
|
|
128
|
+
* a nested value returns its last value; a read of a root value, or of a value whose container is absent, throws.
|
|
127
129
|
*/
|
|
128
130
|
export class ExpiredReferenceError extends SchemaViolationError {
|
|
129
131
|
constructor(path: SchemaErrorPath) {
|
|
130
|
-
super(
|
|
132
|
+
super(
|
|
133
|
+
"Referencing",
|
|
134
|
+
path,
|
|
135
|
+
"This value is no longer live: its context exited, a change moved, removed or replaced it in its list, or it is a read-only view",
|
|
136
|
+
Status.Failure,
|
|
137
|
+
);
|
|
131
138
|
}
|
|
132
139
|
}
|
|
133
140
|
|
package/src/action/protocols.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { InteractionSession } from "#action/Interactable.js";
|
|
8
8
|
import { OccurrenceManager } from "#events/OccurrenceManager.js";
|
|
9
9
|
import { MaybePromise, Observable } from "@matter/general";
|
|
10
|
-
import { DataModelPath, MatterModel } from "@matter/model";
|
|
10
|
+
import { AttributeModel, DataModelPath, MatterModel } from "@matter/model";
|
|
11
11
|
import type {
|
|
12
12
|
AttributeId,
|
|
13
13
|
ClusterId,
|
|
@@ -192,6 +192,12 @@ export interface AttributeTypeProtocol extends AddressableElementProtocol<Attrib
|
|
|
192
192
|
*/
|
|
193
193
|
tlv: TlvSchema<unknown>;
|
|
194
194
|
|
|
195
|
+
/**
|
|
196
|
+
* The model of this attribute. Read and write logs use it to hide values the model marks secret; without it they
|
|
197
|
+
* log values as they are.
|
|
198
|
+
*/
|
|
199
|
+
schema?: AttributeModel;
|
|
200
|
+
|
|
195
201
|
/**
|
|
196
202
|
* Access control information for the attribute.
|
|
197
203
|
*/
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { ClientRequest } from "#action/client/ClientRequest.js";
|
|
8
8
|
import { SessionParameters } from "#session/SessionParameters.js";
|
|
9
9
|
import { Diagnostic, Duration, isObject } from "@matter/general";
|
|
10
|
-
import { Specification } from "@matter/model";
|
|
10
|
+
import { CommandModel, Matter, SecretRedaction, Specification } from "@matter/model";
|
|
11
11
|
import {
|
|
12
12
|
ClusterType,
|
|
13
13
|
CommandData,
|
|
@@ -154,20 +154,7 @@ export function Invoke(
|
|
|
154
154
|
// Additional meta-data for client side processing
|
|
155
155
|
skipValidation,
|
|
156
156
|
commands: commandMap,
|
|
157
|
-
[Diagnostic.value]: () =>
|
|
158
|
-
Diagnostic.list(
|
|
159
|
-
commands.map(cmd => {
|
|
160
|
-
const { commandRef } = cmd;
|
|
161
|
-
const fields = "fields" in cmd ? cmd.fields : undefined;
|
|
162
|
-
|
|
163
|
-
return [
|
|
164
|
-
Diagnostic.strong(Invoke.isLegacy(cmd) ? "(legacy)" : resolvePathForSpecifier(cmd)),
|
|
165
|
-
"with",
|
|
166
|
-
isObject(fields) ? Diagnostic.dict(fields) : "(no payload)",
|
|
167
|
-
commandRef !== undefined && commands.length > 1 ? `(ref ${commandRef})` : "",
|
|
168
|
-
];
|
|
169
|
-
}),
|
|
170
|
-
),
|
|
157
|
+
[Diagnostic.value]: () => Invoke.diagnosticOf(commands),
|
|
171
158
|
} as ClientInvoke;
|
|
172
159
|
}
|
|
173
160
|
|
|
@@ -298,6 +285,64 @@ export namespace Invoke {
|
|
|
298
285
|
return typeof request.command !== "string" && "requestId" in request.command;
|
|
299
286
|
}
|
|
300
287
|
|
|
288
|
+
/**
|
|
289
|
+
* The model of the request of {@link request}. A legacy request resolves through the standard model; the result
|
|
290
|
+
* is `undefined` if the standard model does not define its cluster or command.
|
|
291
|
+
*/
|
|
292
|
+
export function requestModelOf(request: AnyCommandRequest): CommandModel | undefined {
|
|
293
|
+
if (!isLegacy(request)) {
|
|
294
|
+
return commandOf(request).schema;
|
|
295
|
+
}
|
|
296
|
+
const clusterModel = Matter.clusters(Specifier.clusterFor(request.cluster).id);
|
|
297
|
+
if (clusterModel === undefined) {
|
|
298
|
+
return undefined;
|
|
299
|
+
}
|
|
300
|
+
for (const command of clusterModel.commands) {
|
|
301
|
+
if (command.id === request.command.requestId && command.isRequest) {
|
|
302
|
+
return command;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Log presentation of {@link commands}: the path and the request fields of each command, with the values the model
|
|
309
|
+
* marks secret replaced.
|
|
310
|
+
*/
|
|
311
|
+
export function diagnosticOf(commands: Iterable<AnyCommandRequest>) {
|
|
312
|
+
const list = [...commands];
|
|
313
|
+
return Diagnostic.list(
|
|
314
|
+
list.map(cmd => {
|
|
315
|
+
const { commandRef } = cmd;
|
|
316
|
+
const fields = "fields" in cmd ? redactRequestFields(cmd, cmd.fields) : undefined;
|
|
317
|
+
|
|
318
|
+
return [
|
|
319
|
+
Diagnostic.strong(isLegacy(cmd) ? "(legacy)" : resolvePathForSpecifier(cmd)),
|
|
320
|
+
"with",
|
|
321
|
+
isObject(fields) ? Diagnostic.dict(fields) : "(no payload)",
|
|
322
|
+
commandRef !== undefined && list.length > 1 ? `(ref ${commandRef})` : "",
|
|
323
|
+
];
|
|
324
|
+
}),
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Request fields of {@link request} for logging, with the values the model marks secret replaced.
|
|
330
|
+
*
|
|
331
|
+
* @see {@link SecretRedaction.redact}
|
|
332
|
+
*/
|
|
333
|
+
export function redactRequestFields(request: AnyCommandRequest, fields: unknown) {
|
|
334
|
+
return SecretRedaction.redact(requestModelOf(request), fields);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Response fields of {@link request} for logging, with the values the model marks secret replaced.
|
|
339
|
+
*
|
|
340
|
+
* @see {@link SecretRedaction.redact}
|
|
341
|
+
*/
|
|
342
|
+
export function redactResponseFields(request: AnyCommandRequest, fields: unknown) {
|
|
343
|
+
return SecretRedaction.redact(requestModelOf(request)?.responseModel, fields);
|
|
344
|
+
}
|
|
345
|
+
|
|
301
346
|
export type CommandRequest<
|
|
302
347
|
C extends Specifier.Cluster = Specifier.Cluster,
|
|
303
348
|
CMD extends Specifier.Command<Specifier.ClusterFor<C>> = Specifier.Command<Specifier.ClusterFor<C>>,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { Diagnostic, Duration } from "@matter/general";
|
|
8
|
-
import { Specification } from "@matter/model";
|
|
8
|
+
import { SecretRedaction, Specification } from "@matter/model";
|
|
9
9
|
import { ArraySchema, AttributeData, AttributeId, ClusterId, TlvOfModel, WriteRequest } from "@matter/types";
|
|
10
10
|
import { AccessControl } from "@matter/types/clusters/access-control";
|
|
11
11
|
import { MalformedRequestError } from "./MalformedRequestError.js";
|
|
@@ -87,15 +87,16 @@ export function Write(optionsOrData: Write.Options | Write.Attribute, ...data: W
|
|
|
87
87
|
[Diagnostic.value]: () => {
|
|
88
88
|
const items = data.flatMap(entry => {
|
|
89
89
|
const { version, value, endpoint, cluster, attributes } = entry;
|
|
90
|
-
const valueString = Diagnostic.json(value);
|
|
91
90
|
const list = Array.isArray(attributes) ? attributes : [attributes];
|
|
92
91
|
const versionString = version !== undefined ? `(version=${version})` : "";
|
|
93
|
-
return list.map(attribute =>
|
|
94
|
-
|
|
92
|
+
return list.map(attribute => {
|
|
93
|
+
const { schema } = Specifier.attributeFor(Specifier.clusterOf(entry), attribute);
|
|
94
|
+
const valueString = Diagnostic.json(SecretRedaction.redact(schema, value));
|
|
95
|
+
return Diagnostic.squash(
|
|
95
96
|
Diagnostic.strong(resolvePathForSpecifier({ endpoint, cluster, attribute })),
|
|
96
97
|
` = ${valueString}${versionString}`,
|
|
97
|
-
)
|
|
98
|
-
);
|
|
98
|
+
);
|
|
99
|
+
});
|
|
99
100
|
});
|
|
100
101
|
if (chunked) {
|
|
101
102
|
return [Diagnostic.asFlags({ chunked: true }), Diagnostic.list(items)];
|