@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
package/src/peer/Peer.ts
CHANGED
|
@@ -256,13 +256,18 @@ export class Peer {
|
|
|
256
256
|
return this.#descriptor;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
+
/**
|
|
260
|
+
* The open sessions with the peer. The set holds established sessions only, as it is filled from
|
|
261
|
+
* `SessionManager.sessions`. So {@link hasSession}, {@link newestSession} and observers of `peer.sessions.added`
|
|
262
|
+
* never see a session whose handshake still runs.
|
|
263
|
+
*/
|
|
259
264
|
get sessions() {
|
|
260
265
|
return this.#sessions;
|
|
261
266
|
}
|
|
262
267
|
|
|
263
268
|
get subscriptions() {
|
|
264
269
|
// TODO - this should just be #subscriptions
|
|
265
|
-
return
|
|
270
|
+
return this.#context.sessions.sessionsFor(this.address).flatMap(session => [...session.subscriptions]);
|
|
266
271
|
}
|
|
267
272
|
|
|
268
273
|
get exchangeProvider() {
|
|
@@ -422,21 +427,6 @@ export class Peer {
|
|
|
422
427
|
|
|
423
428
|
while (true) {
|
|
424
429
|
const { transports } = this.#transportDecision(options?.requiredTransport, options?.preferredTransport);
|
|
425
|
-
/* Debug aid (one line per connect — noisy); uncomment to trace transport selection:
|
|
426
|
-
{
|
|
427
|
-
const { reason, diag } = this.#transportDecision(options?.requiredTransport, options?.preferredTransport);
|
|
428
|
-
logger.debug(
|
|
429
|
-
"Transport resolution",
|
|
430
|
-
Diagnostic.dict({
|
|
431
|
-
peer: this.address.toString(),
|
|
432
|
-
result: transports === undefined ? "UDP (no constraint)" : transports.join("+"),
|
|
433
|
-
reason,
|
|
434
|
-
peerPreference: this.transportPreference ?? "none",
|
|
435
|
-
...diag,
|
|
436
|
-
}),
|
|
437
|
-
);
|
|
438
|
-
}
|
|
439
|
-
*/
|
|
440
430
|
let session: NodeSession | undefined;
|
|
441
431
|
if (transports === undefined) {
|
|
442
432
|
session = this.newestSession();
|
|
@@ -634,6 +624,8 @@ export class Peer {
|
|
|
634
624
|
return;
|
|
635
625
|
}
|
|
636
626
|
|
|
627
|
+
this.#logTransportDecision(options);
|
|
628
|
+
|
|
637
629
|
const abort = new Abort({ abort: this.#abort });
|
|
638
630
|
|
|
639
631
|
// Abort connection if a session is established from any source
|
|
@@ -672,6 +664,29 @@ export class Peer {
|
|
|
672
664
|
};
|
|
673
665
|
this.#workers.add(this.#connecting);
|
|
674
666
|
}
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
* Log the transport decision once per connection process, so a log shows why TCP or UDP was tried.
|
|
670
|
+
*
|
|
671
|
+
* {@link PeerConnection} resolves the transports again for each address, so a later mDNS update can still change
|
|
672
|
+
* them. The address URL in each "Connecting" line shows the transport actually used.
|
|
673
|
+
*/
|
|
674
|
+
#logTransportDecision(options?: Peer.ConnectOptions) {
|
|
675
|
+
const { transports, reason, diag } = this.#transportDecision(
|
|
676
|
+
options?.requiredTransport,
|
|
677
|
+
options?.preferredTransport,
|
|
678
|
+
);
|
|
679
|
+
logger.debug(
|
|
680
|
+
Diagnostic.via(this.address.toString()),
|
|
681
|
+
"Transport decision",
|
|
682
|
+
Diagnostic.dict({
|
|
683
|
+
transports: transports === undefined ? "no constraint" : transports.join("+"),
|
|
684
|
+
reason,
|
|
685
|
+
peerPreference: this.transportPreference ?? "none",
|
|
686
|
+
...diag,
|
|
687
|
+
}),
|
|
688
|
+
);
|
|
689
|
+
}
|
|
675
690
|
}
|
|
676
691
|
|
|
677
692
|
export namespace Peer {
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022-2026 Matter.js Authors
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { Logger, Mutex, StorageContext, SupportedStorageTypes } from "@matter/general";
|
|
8
|
+
import { FabricIndex, NodeId } from "@matter/types";
|
|
9
|
+
import { PeerAddress, PeerAddressMap } from "./PeerAddress.js";
|
|
10
|
+
|
|
11
|
+
const logger = Logger.get("PeerAddressStore");
|
|
12
|
+
|
|
13
|
+
const FABRIC_CONTEXT_PATTERN = /^[1-9]\d*$/;
|
|
14
|
+
const NODE_KEY_PATTERN = /^[0-9a-f]+$/;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Persistent storage keyed by {@link PeerAddress}: one value per peer, so a change for one peer writes only that peer's
|
|
18
|
+
* key instead of the whole collection.
|
|
19
|
+
*
|
|
20
|
+
* Layout: one sub-context per fabric index (decimal), one key per node ID (lowercase hex). This class owns the format
|
|
21
|
+
* in both directions. It holds no values in memory; callers keep their own view and use {@link load} once at startup.
|
|
22
|
+
*
|
|
23
|
+
* Operations run one after another in call order, so after concurrent calls for one address the stored value is the
|
|
24
|
+
* one passed last.
|
|
25
|
+
*/
|
|
26
|
+
export class PeerAddressStore<T extends SupportedStorageTypes> {
|
|
27
|
+
readonly #storage: StorageContext;
|
|
28
|
+
readonly #operations = new Mutex(this);
|
|
29
|
+
|
|
30
|
+
constructor(storage: StorageContext) {
|
|
31
|
+
this.#storage = storage;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
set(address: PeerAddress, value: T) {
|
|
35
|
+
return this.#operations.produce(async () => this.#set(address, value));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
delete(address: PeerAddress) {
|
|
39
|
+
return this.#operations.produce(async () => this.#fabricContext(address.fabricIndex).delete(keyOf(address)));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
deleteFabric(fabricIndex: FabricIndex) {
|
|
43
|
+
return this.#operations.produce(async () => this.#fabricContext(fabricIndex).clearAll());
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
clear() {
|
|
47
|
+
return this.#operations.produce(async () => this.#storage.clearAll());
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Replace all stored values with {@link entries}.
|
|
52
|
+
*/
|
|
53
|
+
replaceAll(entries: Iterable<[PeerAddress, T]>) {
|
|
54
|
+
return this.#operations.produce(async () => {
|
|
55
|
+
await this.#storage.clearAll();
|
|
56
|
+
for (const [address, value] of entries) {
|
|
57
|
+
await this.#set(address, value);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Read all stored values. Entries {@link keep} rejects and entries the driver cannot read are deleted from storage
|
|
64
|
+
* and left out of the result.
|
|
65
|
+
*/
|
|
66
|
+
load(keep?: (address: PeerAddress, value: T) => boolean) {
|
|
67
|
+
return this.#operations.produce(async () => {
|
|
68
|
+
const result = new PeerAddressMap<T>();
|
|
69
|
+
|
|
70
|
+
for (const fabricName of await this.#storage.contexts()) {
|
|
71
|
+
if (!FABRIC_CONTEXT_PATTERN.test(fabricName)) {
|
|
72
|
+
logger.info(`Ignoring stored context ${fabricName} in ${this}: not a fabric index`);
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
const fabricIndex = FabricIndex(Number.parseInt(fabricName, 10));
|
|
76
|
+
const fabricContext = this.#storage.createContext(fabricName);
|
|
77
|
+
|
|
78
|
+
// keys() and has() list a value the driver cannot decode, but values() has no value for it
|
|
79
|
+
const stored = await fabricContext.values();
|
|
80
|
+
for (const key of await fabricContext.keys()) {
|
|
81
|
+
if (!NODE_KEY_PATTERN.test(key)) {
|
|
82
|
+
logger.info(`Ignoring stored key ${key} in ${this}: not a node ID`);
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
const address = PeerAddress({ fabricIndex, nodeId: NodeId(BigInt(`0x${key}`)) });
|
|
86
|
+
const value = stored[key] as T | undefined;
|
|
87
|
+
if (value === undefined) {
|
|
88
|
+
logger.warn(`Deleting stored value of ${address} in ${this}: not readable`);
|
|
89
|
+
await fabricContext.delete(key);
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
if (keep !== undefined && !keep(address, value)) {
|
|
93
|
+
await fabricContext.delete(key);
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
result.set(address, value);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return result;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
toString() {
|
|
105
|
+
return `storage:${this.#storage.thisContexts.join(".")}`;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
#set(address: PeerAddress, value: T) {
|
|
109
|
+
return this.#fabricContext(address.fabricIndex).set(keyOf(address), value);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
#fabricContext(fabricIndex: FabricIndex) {
|
|
113
|
+
return this.#storage.createContext(fabricIndex.toString());
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function keyOf({ nodeId }: PeerAddress) {
|
|
118
|
+
return nodeId.toString(16);
|
|
119
|
+
}
|
|
@@ -608,7 +608,6 @@ export async function PeerConnection(
|
|
|
608
608
|
const { session } = await caseClient.pair(exchange, fabric, peer.address.nodeId, {
|
|
609
609
|
...options,
|
|
610
610
|
abort: localAbort,
|
|
611
|
-
caseAuthenticatedTags: peer.descriptor.caseAuthenticatedTags,
|
|
612
611
|
...attempt.sendOptions,
|
|
613
612
|
validateSessionParameters: isTcp
|
|
614
613
|
? params => {
|
|
@@ -66,11 +66,10 @@ export interface PeerDescriptor {
|
|
|
66
66
|
tcpUnsupported?: boolean;
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
|
-
* Case Authenticated Tags (CATs)
|
|
69
|
+
* Case Authenticated Tags (CATs) intended for operational CASE sessions with this node.
|
|
70
70
|
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* process.
|
|
71
|
+
* Stored, but not applied yet. Sessions present the CATs of this node's own NOC in the fabric
|
|
72
|
+
* (`ControllerBehavior.caseAuthenticatedTags`). The CATs of the peer come from its NOC.
|
|
74
73
|
*/
|
|
75
74
|
caseAuthenticatedTags?: readonly CaseAuthenticatedTag[];
|
|
76
75
|
}
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { PeerAddress } from "#peer/PeerAddress.js";
|
|
8
|
+
import { SessionClosedError } from "#protocol/errors.js";
|
|
8
9
|
import { ExchangeProvider, NewExchangeOptions, type ReachabilityReason } from "#protocol/ExchangeProvider.js";
|
|
9
10
|
import type { MessageExchange } from "#protocol/MessageExchange.js";
|
|
10
11
|
import { MRP } from "#protocol/MRP.js";
|
|
11
|
-
import { ChannelType, Duration
|
|
12
|
+
import { ChannelType, Duration } from "@matter/general";
|
|
12
13
|
import { INTERACTION_PROTOCOL_ID } from "@matter/types";
|
|
13
14
|
import { Peer } from "./Peer.js";
|
|
14
15
|
import { PeerConnection } from "./PeerConnection.js";
|
|
@@ -76,10 +77,7 @@ export class PeerExchangeProvider extends ExchangeProvider {
|
|
|
76
77
|
|
|
77
78
|
while (true) {
|
|
78
79
|
if (!isGroup && !options?.requireExistingSession) {
|
|
79
|
-
// Connections grab their own network slot so connect before getting our own
|
|
80
|
-
// Probes skip connect because they verify liveness of the current session — calling
|
|
81
|
-
// connect would establish a new session if the current one is broken, defeating the
|
|
82
|
-
// purpose of a lightweight reachability check.
|
|
80
|
+
// Connections grab their own network slot so connect before getting our own
|
|
83
81
|
await this.connect(options);
|
|
84
82
|
abort?.throwIfAborted();
|
|
85
83
|
}
|
|
@@ -117,7 +115,7 @@ export class PeerExchangeProvider extends ExchangeProvider {
|
|
|
117
115
|
if (session === undefined) {
|
|
118
116
|
if (options?.requireExistingSession) {
|
|
119
117
|
// Slot will be closed when error is caught
|
|
120
|
-
throw new
|
|
118
|
+
throw new SessionClosedError(`No existing session to ${this.#peer.address}`);
|
|
121
119
|
}
|
|
122
120
|
// We had a session before getting the slot, but it was closed. Restart
|
|
123
121
|
slot.close();
|
|
@@ -32,9 +32,18 @@ export interface PeerLossContext {
|
|
|
32
32
|
keepSubscriptions?: boolean;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* A value of `SessionManager.registrationCount`. Only sessions registered before that value was read are
|
|
36
|
+
* affected; sessions registered later carry the peer's data after the loss.
|
|
36
37
|
*
|
|
37
|
-
* If absent,
|
|
38
|
+
* If absent, affects every session registered when the peer loss is reported.
|
|
39
|
+
*/
|
|
40
|
+
registeredBefore?: number;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Only sessions created before this instant are affected; on the clock of `Time.nowUs` like `Session.createdAt`.
|
|
44
|
+
*
|
|
45
|
+
* @deprecated Use {@link registeredBefore}. Two sessions may have the same creation time, so the time does not say
|
|
46
|
+
* which session is newer.
|
|
38
47
|
*/
|
|
39
48
|
asOf?: Timestamp;
|
|
40
49
|
}
|
|
@@ -61,6 +61,19 @@ export interface PhysicalDeviceProperties {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export namespace PhysicalDeviceProperties {
|
|
64
|
+
/**
|
|
65
|
+
* The MinIntervalFloor and MaxIntervalCeiling to request when subscribing to a peer with `properties`. A bound in
|
|
66
|
+
* `request` overrides the default, except that an ICD always gets a floor of 0.
|
|
67
|
+
*
|
|
68
|
+
* The default ceiling depends on how the peer is connected and powered, plus up to max(10%, 10 s) of jitter. For
|
|
69
|
+
* an ICD whose IdleModeDuration is at least that long, the ceiling is the IdleModeDuration instead, without
|
|
70
|
+
* jitter, so the peer can report once per idle cycle. An ICD with a shorter IdleModeDuration gets the default
|
|
71
|
+
* ceiling: the ICD may still choose any MaxInterval up to the greatest of its IdleModeDuration, 60 minutes and the
|
|
72
|
+
* ceiling, so a lower ceiling would only allow it to report more often. A ceiling in `request` is sent without
|
|
73
|
+
* jitter. Every ceiling is limited to 65535 s.
|
|
74
|
+
*
|
|
75
|
+
* @see {@link MatterSpecification.v161.Core} § 2.11.2.2, § 8.5.3.2
|
|
76
|
+
*/
|
|
64
77
|
export function subscriptionIntervalBoundsFor(options?: {
|
|
65
78
|
properties?: PhysicalDeviceProperties;
|
|
66
79
|
description?: string;
|
|
@@ -114,16 +127,17 @@ export namespace PhysicalDeviceProperties {
|
|
|
114
127
|
: DEFAULT_SUBSCRIPTION_FLOOR_DEFAULT;
|
|
115
128
|
}
|
|
116
129
|
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
const deviceCeiling =
|
|
131
|
+
isBatteryPowered && !isMainsPowered
|
|
132
|
+
? DEFAULT_SUBSCRIPTION_CEILING_BATTERY_POWERED
|
|
133
|
+
: isThreadSleepyEndDevice
|
|
134
|
+
? DEFAULT_SUBSCRIPTION_CEILING_THREAD_SLEEPY
|
|
135
|
+
: supportsThread
|
|
136
|
+
? DEFAULT_SUBSCRIPTION_CEILING_THREAD
|
|
137
|
+
: DEFAULT_SUBSCRIPTION_CEILING_WIFI;
|
|
138
|
+
const isIcdCeiling =
|
|
139
|
+
isIntermittentlyConnected && idleModeDuration !== undefined && idleModeDuration >= deviceCeiling;
|
|
140
|
+
const defaultCeiling = isIcdCeiling ? Duration.min(idleModeDuration, MAX_SUBSCRIPTION_CEILING) : deviceCeiling;
|
|
127
141
|
const isExplicitCeiling = maxIntervalCeiling !== undefined;
|
|
128
142
|
if (maxIntervalCeiling === undefined) {
|
|
129
143
|
maxIntervalCeiling = defaultCeiling;
|
|
@@ -135,8 +149,7 @@ export namespace PhysicalDeviceProperties {
|
|
|
135
149
|
}
|
|
136
150
|
|
|
137
151
|
if (isIcdCeiling) {
|
|
138
|
-
//
|
|
139
|
-
// would only push our request above idle for no benefit.
|
|
152
|
+
// Jitter would move the ceiling away from the idle cycle the ICD reports on
|
|
140
153
|
maxIntervalCeiling = Duration.max(minIntervalFloor, maxIntervalCeiling);
|
|
141
154
|
} else if (isExplicitCeiling) {
|
|
142
155
|
// A caller-supplied ceiling is transmitted as requested, with no jitter; only the floor clamp still
|
|
@@ -30,13 +30,21 @@ const EXPECTED_RETURN_TIMEOUT = Minutes(3);
|
|
|
30
30
|
const MAX_APPLY_DELAY = Hours(24);
|
|
31
31
|
|
|
32
32
|
interface ArmState {
|
|
33
|
+
/**
|
|
34
|
+
* Sessions that carried a report before the peer returned. A returning device may send its priming report before
|
|
35
|
+
* the session that announces its return is established.
|
|
36
|
+
*/
|
|
37
|
+
reportedBeforeReturn: Set<SecureSession>;
|
|
38
|
+
|
|
33
39
|
/**
|
|
34
40
|
* Present once the peer has returned. Evidence must name the sessions it came from: a device flushes its
|
|
35
41
|
* subscription as it reboots, so only a report over a session from after the return says the subscription
|
|
36
42
|
* survived.
|
|
37
43
|
*/
|
|
38
44
|
returned?: {
|
|
39
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Sessions with the peer from after its return: the announcing session and every session registered after it.
|
|
47
|
+
*/
|
|
40
48
|
sessions: Set<SecureSession>;
|
|
41
49
|
|
|
42
50
|
/** Whether a report has arrived over one of them. */
|
|
@@ -51,9 +59,9 @@ interface ArmState {
|
|
|
51
59
|
* Speeds up controller re-subscription after a peer reboot for devices that do NOT persist subscriptions.
|
|
52
60
|
*
|
|
53
61
|
* Callers arm a peer when they know it is about to reboot and return (e.g. OTA reaching its apply phase). When the
|
|
54
|
-
* peer's new session appears we (A) close
|
|
55
|
-
* report within it over a session
|
|
56
|
-
* alone; otherwise we force re-subscription.
|
|
62
|
+
* peer's new session appears we (A) close the sessions registered before it and (B) start a grace window: if a subscription receives a
|
|
63
|
+
* report within it over a session of the returned device (see `ArmState.returned`), a persistent device fed it, we
|
|
64
|
+
* leave the subscription alone; otherwise we force re-subscription.
|
|
57
65
|
*/
|
|
58
66
|
export class RebootResubscribeArmer {
|
|
59
67
|
readonly #sessions: SessionManager;
|
|
@@ -64,6 +72,7 @@ export class RebootResubscribeArmer {
|
|
|
64
72
|
constructor(sessions: SessionManager, subscriptions: ClientSubscriptions) {
|
|
65
73
|
this.#sessions = sessions;
|
|
66
74
|
this.#subscriptions = subscriptions;
|
|
75
|
+
this.#observers.on(sessions.registeredSessions.added, session => this.#onSessionRegistered(session));
|
|
67
76
|
this.#observers.on(sessions.sessions.added, session => this.#onSessionAdded(session));
|
|
68
77
|
this.#observers.on(subscriptions.reportStarted, session => this.#onReportStarted(session));
|
|
69
78
|
}
|
|
@@ -81,6 +90,7 @@ export class RebootResubscribeArmer {
|
|
|
81
90
|
previous?.returnTimer?.stop();
|
|
82
91
|
|
|
83
92
|
const state: ArmState = {
|
|
93
|
+
reportedBeforeReturn: new Set(),
|
|
84
94
|
returned: undefined,
|
|
85
95
|
graceTimer: undefined,
|
|
86
96
|
returnTimer: undefined,
|
|
@@ -114,17 +124,16 @@ export class RebootResubscribeArmer {
|
|
|
114
124
|
this.#armed.delete(peerAddress);
|
|
115
125
|
}
|
|
116
126
|
|
|
127
|
+
#onSessionRegistered(session: NodeSession) {
|
|
128
|
+
// A device opens further sessions for its own reasons, so one after the return is not a second reboot: the
|
|
129
|
+
// session carries the peer's data and the grace window it is running in stands.
|
|
130
|
+
this.#armed.get(session.peerAddress)?.returned?.sessions.add(session);
|
|
131
|
+
}
|
|
132
|
+
|
|
117
133
|
#onSessionAdded(session: NodeSession) {
|
|
118
134
|
const peerAddress = PeerAddress(session.peerAddress);
|
|
119
135
|
const state = this.#armed.get(peerAddress);
|
|
120
|
-
if (state === undefined) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (state.returned !== undefined) {
|
|
125
|
-
// The peer is already back. A device opens further sessions for its own reasons, so one is not a
|
|
126
|
-
// second reboot: the session carries the peer's data and the grace window it is running in stands.
|
|
127
|
-
state.returned.sessions.add(session);
|
|
136
|
+
if (state === undefined || state.returned !== undefined) {
|
|
128
137
|
return;
|
|
129
138
|
}
|
|
130
139
|
|
|
@@ -137,11 +146,16 @@ export class RebootResubscribeArmer {
|
|
|
137
146
|
state.returnTimer?.stop();
|
|
138
147
|
state.returnTimer = undefined;
|
|
139
148
|
|
|
140
|
-
|
|
149
|
+
const sessions = new Set<SecureSession>([session, ...this.#sessions.sessionsRegisteredSince(session)]);
|
|
150
|
+
state.returned = {
|
|
151
|
+
sessions,
|
|
152
|
+
reported: [...sessions].some(returning => state.reportedBeforeReturn.has(returning)),
|
|
153
|
+
};
|
|
154
|
+
state.reportedBeforeReturn.clear();
|
|
141
155
|
|
|
142
156
|
// Mechanism A — drop the dead pre-reboot sessions so probe/re-subscribe cannot pick them.
|
|
143
157
|
this.#sessions
|
|
144
|
-
.handlePeerShutdown(peerAddress, session
|
|
158
|
+
.handlePeerShutdown(peerAddress, session)
|
|
145
159
|
.catch(error => logger.warn(peerAddress, "Failed to close older sessions", error));
|
|
146
160
|
state.graceTimer = Time.getTimer("Reboot resubscribe grace", DEFAULT_REBOOT_RESUBSCRIBE_GRACE, () =>
|
|
147
161
|
this.#onGraceExpired(peerAddress),
|
|
@@ -164,11 +178,18 @@ export class RebootResubscribeArmer {
|
|
|
164
178
|
|
|
165
179
|
#onReportStarted(session: SecureSession) {
|
|
166
180
|
const state = this.#armed.get(session.peerAddress);
|
|
167
|
-
if (state
|
|
181
|
+
if (state === undefined) {
|
|
168
182
|
return;
|
|
169
183
|
}
|
|
170
184
|
|
|
171
|
-
state.returned
|
|
185
|
+
if (state.returned === undefined) {
|
|
186
|
+
state.reportedBeforeReturn.add(session);
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (state.returned.sessions.has(session)) {
|
|
191
|
+
state.returned.reported = true;
|
|
192
|
+
}
|
|
172
193
|
}
|
|
173
194
|
|
|
174
195
|
#onReturnTimeout(peerAddress: PeerAddress) {
|
package/src/peer/index.ts
CHANGED
|
@@ -8,8 +8,10 @@ export * from "./CommissioningError.js";
|
|
|
8
8
|
export * from "./ControllerCommissioner.js";
|
|
9
9
|
export * from "./ControllerCommissioningFlow.js";
|
|
10
10
|
export * from "./NetworkProfile.js";
|
|
11
|
+
export * from "./OperationalCertificateUpdate.js";
|
|
11
12
|
export * from "./Peer.js";
|
|
12
13
|
export * from "./PeerAddress.js";
|
|
14
|
+
export * from "./PeerAddressStore.js";
|
|
13
15
|
export * from "./PeerCommunicationError.js";
|
|
14
16
|
export * from "./PeerDescriptor.js";
|
|
15
17
|
export * from "./PeerExchangeProvider.js";
|
|
@@ -367,7 +367,11 @@ export class DeviceAdvertiser {
|
|
|
367
367
|
if (event === "startup") {
|
|
368
368
|
// For startup events where we have active subscriptions somewhere on the fabric, we just convert
|
|
369
369
|
// into "retransmit" to send out one ping for client convenience
|
|
370
|
-
if (
|
|
370
|
+
if (
|
|
371
|
+
this.#context.sessions
|
|
372
|
+
.sessionsForFabricIndex(fabric.fabricIndex)
|
|
373
|
+
.some(session => session.subscriptions.size > 0)
|
|
374
|
+
) {
|
|
371
375
|
event = "retransmit";
|
|
372
376
|
}
|
|
373
377
|
}
|