@nmshd/consumption 7.0.0-openid4vc.5 → 7.0.0
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/LICENSE +659 -3
- package/README.md +1 -1
- package/dist/buildInformation.js +5 -5
- package/dist/consumption/ConsumptionConfig.d.ts +1 -1
- package/dist/consumption/ConsumptionConfig.d.ts.map +1 -1
- package/dist/consumption/ConsumptionController.d.ts +1 -3
- package/dist/consumption/ConsumptionController.d.ts.map +1 -1
- package/dist/consumption/ConsumptionController.js +5 -9
- package/dist/consumption/ConsumptionController.js.map +1 -1
- package/dist/consumption/ConsumptionControllerName.d.ts +1 -2
- package/dist/consumption/ConsumptionControllerName.d.ts.map +1 -1
- package/dist/consumption/ConsumptionControllerName.js +0 -1
- package/dist/consumption/ConsumptionControllerName.js.map +1 -1
- package/dist/consumption/ConsumptionCoreErrors.d.ts +7 -37
- package/dist/consumption/ConsumptionCoreErrors.d.ts.map +1 -1
- package/dist/consumption/ConsumptionCoreErrors.js +18 -114
- package/dist/consumption/ConsumptionCoreErrors.js.map +1 -1
- package/dist/consumption/ConsumptionIds.d.ts +1 -0
- package/dist/consumption/ConsumptionIds.d.ts.map +1 -1
- package/dist/consumption/ConsumptionIds.js +1 -0
- package/dist/consumption/ConsumptionIds.js.map +1 -1
- package/dist/modules/attributes/AttributesController.d.ts +108 -69
- package/dist/modules/attributes/AttributesController.d.ts.map +1 -1
- package/dist/modules/attributes/AttributesController.js +664 -734
- package/dist/modules/attributes/AttributesController.js.map +1 -1
- package/dist/modules/attributes/events/AttributeCreatedEvent.d.ts +1 -1
- package/dist/modules/attributes/events/AttributeCreatedEvent.d.ts.map +1 -1
- package/dist/modules/attributes/events/AttributeDeletedEvent.d.ts +1 -1
- package/dist/modules/attributes/events/AttributeDeletedEvent.d.ts.map +1 -1
- package/dist/modules/attributes/events/AttributeForwardingDetailsChangedEvent.d.ts +9 -0
- package/dist/modules/attributes/events/AttributeForwardingDetailsChangedEvent.d.ts.map +1 -0
- package/dist/modules/attributes/events/AttributeForwardingDetailsChangedEvent.js +12 -0
- package/dist/modules/attributes/events/AttributeForwardingDetailsChangedEvent.js.map +1 -0
- package/dist/modules/attributes/events/AttributeSucceededEvent.d.ts +11 -0
- package/dist/modules/attributes/events/AttributeSucceededEvent.d.ts.map +1 -0
- package/dist/modules/attributes/events/AttributeSucceededEvent.js +12 -0
- package/dist/modules/attributes/events/AttributeSucceededEvent.js.map +1 -0
- package/dist/modules/attributes/events/AttributeWasViewedAtChangedEvent.d.ts +1 -1
- package/dist/modules/attributes/events/AttributeWasViewedAtChangedEvent.d.ts.map +1 -1
- package/dist/modules/attributes/events/ForwardedAttributeDeletedByPeerEvent.d.ts +7 -0
- package/dist/modules/attributes/events/ForwardedAttributeDeletedByPeerEvent.d.ts.map +1 -0
- package/dist/modules/attributes/events/ForwardedAttributeDeletedByPeerEvent.js +12 -0
- package/dist/modules/attributes/events/ForwardedAttributeDeletedByPeerEvent.js.map +1 -0
- package/dist/modules/attributes/events/OwnAttributeDeletedByOwnerEvent.d.ts +7 -0
- package/dist/modules/attributes/events/OwnAttributeDeletedByOwnerEvent.d.ts.map +1 -0
- package/dist/modules/attributes/events/OwnAttributeDeletedByOwnerEvent.js +12 -0
- package/dist/modules/attributes/events/OwnAttributeDeletedByOwnerEvent.js.map +1 -0
- package/dist/modules/attributes/events/PeerRelationshipAttributeDeletedByPeerEvent.d.ts +7 -0
- package/dist/modules/attributes/events/PeerRelationshipAttributeDeletedByPeerEvent.d.ts.map +1 -0
- package/dist/modules/attributes/events/PeerRelationshipAttributeDeletedByPeerEvent.js +12 -0
- package/dist/modules/attributes/events/PeerRelationshipAttributeDeletedByPeerEvent.js.map +1 -0
- package/dist/modules/attributes/events/index.d.ts +5 -9
- package/dist/modules/attributes/events/index.d.ts.map +1 -1
- package/dist/modules/attributes/events/index.js +5 -9
- package/dist/modules/attributes/events/index.js.map +1 -1
- package/dist/modules/attributes/index.d.ts +9 -7
- package/dist/modules/attributes/index.d.ts.map +1 -1
- package/dist/modules/attributes/index.js +9 -7
- package/dist/modules/attributes/index.js.map +1 -1
- package/dist/modules/attributes/local/AttributeForwardingDetails.d.ts +28 -0
- package/dist/modules/attributes/local/AttributeForwardingDetails.d.ts.map +1 -0
- package/dist/modules/attributes/local/AttributeForwardingDetails.js +62 -0
- package/dist/modules/attributes/local/AttributeForwardingDetails.js.map +1 -0
- package/dist/modules/attributes/local/QueryTranslator.d.ts.map +1 -1
- package/dist/modules/attributes/local/QueryTranslator.js +1 -1
- package/dist/modules/attributes/local/QueryTranslator.js.map +1 -1
- package/dist/modules/attributes/local/attributeTypes/LocalAttribute.d.ts +29 -0
- package/dist/modules/attributes/local/attributeTypes/LocalAttribute.d.ts.map +1 -0
- package/dist/modules/attributes/local/{AttributeSuccessorParams.js → attributeTypes/LocalAttribute.js} +34 -26
- package/dist/modules/attributes/local/attributeTypes/LocalAttribute.js.map +1 -0
- package/dist/modules/attributes/local/attributeTypes/OwnIdentityAttribute.d.ts +19 -0
- package/dist/modules/attributes/local/attributeTypes/OwnIdentityAttribute.d.ts.map +1 -0
- package/dist/modules/attributes/local/attributeTypes/OwnIdentityAttribute.js +40 -0
- package/dist/modules/attributes/local/attributeTypes/OwnIdentityAttribute.js.map +1 -0
- package/dist/modules/attributes/local/attributeTypes/OwnRelationshipAttribute.d.ts +29 -0
- package/dist/modules/attributes/local/attributeTypes/OwnRelationshipAttribute.d.ts.map +1 -0
- package/dist/modules/attributes/local/attributeTypes/OwnRelationshipAttribute.js +73 -0
- package/dist/modules/attributes/local/attributeTypes/OwnRelationshipAttribute.js.map +1 -0
- package/dist/modules/attributes/local/attributeTypes/PeerIdentityAttribute.d.ts +29 -0
- package/dist/modules/attributes/local/attributeTypes/PeerIdentityAttribute.d.ts.map +1 -0
- package/dist/modules/attributes/local/attributeTypes/PeerIdentityAttribute.js +76 -0
- package/dist/modules/attributes/local/attributeTypes/PeerIdentityAttribute.js.map +1 -0
- package/dist/modules/attributes/local/attributeTypes/PeerRelationshipAttribute.d.ts +30 -0
- package/dist/modules/attributes/local/attributeTypes/PeerRelationshipAttribute.d.ts.map +1 -0
- package/dist/modules/attributes/local/attributeTypes/PeerRelationshipAttribute.js +76 -0
- package/dist/modules/attributes/local/attributeTypes/PeerRelationshipAttribute.js.map +1 -0
- package/dist/modules/attributes/local/attributeTypes/ThirdPartyRelationshipAttribute.d.ts +33 -0
- package/dist/modules/attributes/local/attributeTypes/ThirdPartyRelationshipAttribute.d.ts.map +1 -0
- package/dist/modules/attributes/local/attributeTypes/ThirdPartyRelationshipAttribute.js +85 -0
- package/dist/modules/attributes/local/attributeTypes/ThirdPartyRelationshipAttribute.js.map +1 -0
- package/dist/modules/attributes/local/deletionInfos/AbstractAttributeDeletionInfo.d.ts +15 -0
- package/dist/modules/attributes/local/deletionInfos/AbstractAttributeDeletionInfo.d.ts.map +1 -0
- package/dist/modules/attributes/local/deletionInfos/AbstractAttributeDeletionInfo.js +28 -0
- package/dist/modules/attributes/local/deletionInfos/AbstractAttributeDeletionInfo.js.map +1 -0
- package/dist/modules/attributes/local/deletionInfos/EmittedAttributeDeletionInfo.d.ts +18 -0
- package/dist/modules/attributes/local/deletionInfos/EmittedAttributeDeletionInfo.d.ts.map +1 -0
- package/dist/modules/attributes/local/deletionInfos/EmittedAttributeDeletionInfo.js +38 -0
- package/dist/modules/attributes/local/deletionInfos/EmittedAttributeDeletionInfo.js.map +1 -0
- package/dist/modules/attributes/local/deletionInfos/ReceivedAttributeDeletionInfo.d.ts +16 -0
- package/dist/modules/attributes/local/deletionInfos/ReceivedAttributeDeletionInfo.d.ts.map +1 -0
- package/dist/modules/attributes/local/deletionInfos/ReceivedAttributeDeletionInfo.js +36 -0
- package/dist/modules/attributes/local/deletionInfos/ReceivedAttributeDeletionInfo.js.map +1 -0
- package/dist/modules/attributes/local/deletionInfos/index.d.ts +4 -0
- package/dist/modules/attributes/local/deletionInfos/index.d.ts.map +1 -0
- package/dist/modules/attributes/local/deletionInfos/index.js +20 -0
- package/dist/modules/attributes/local/deletionInfos/index.js.map +1 -0
- package/dist/modules/attributes/local/successorParams/OwnIdentityAttributeSuccessorParams.d.ts +13 -0
- package/dist/modules/attributes/local/successorParams/OwnIdentityAttributeSuccessorParams.d.ts.map +1 -0
- package/dist/modules/attributes/local/successorParams/OwnIdentityAttributeSuccessorParams.js +29 -0
- package/dist/modules/attributes/local/successorParams/OwnIdentityAttributeSuccessorParams.js.map +1 -0
- package/dist/modules/attributes/local/successorParams/OwnRelationshipAttributeSuccessorParams.d.ts +17 -0
- package/dist/modules/attributes/local/successorParams/OwnRelationshipAttributeSuccessorParams.d.ts.map +1 -0
- package/dist/modules/attributes/local/{CreateAttributeParams.js → successorParams/OwnRelationshipAttributeSuccessorParams.js} +10 -15
- package/dist/modules/attributes/local/successorParams/OwnRelationshipAttributeSuccessorParams.js.map +1 -0
- package/dist/modules/attributes/local/successorParams/PeerIdentityAttributeSuccessorParams.d.ts +20 -0
- package/dist/modules/attributes/local/successorParams/PeerIdentityAttributeSuccessorParams.d.ts.map +1 -0
- package/dist/modules/attributes/local/{CreateRepositoryAttributeParams.js → successorParams/PeerIdentityAttributeSuccessorParams.js} +16 -13
- package/dist/modules/attributes/local/successorParams/PeerIdentityAttributeSuccessorParams.js.map +1 -0
- package/dist/modules/attributes/local/successorParams/PeerRelationshipAttributeSuccessorParams.d.ts +20 -0
- package/dist/modules/attributes/local/successorParams/PeerRelationshipAttributeSuccessorParams.d.ts.map +1 -0
- package/dist/modules/attributes/local/{CreateSharedLocalAttributeCopyParams.js → successorParams/PeerRelationshipAttributeSuccessorParams.js} +15 -16
- package/dist/modules/attributes/local/successorParams/PeerRelationshipAttributeSuccessorParams.js.map +1 -0
- package/dist/modules/attributes/local/successorParams/ThirdPartyRelationshipAttributeSuccessorParams.d.ts +20 -0
- package/dist/modules/attributes/local/successorParams/ThirdPartyRelationshipAttributeSuccessorParams.d.ts.map +1 -0
- package/dist/modules/attributes/local/{CreateSharedLocalAttributeParams.js → successorParams/ThirdPartyRelationshipAttributeSuccessorParams.js} +15 -22
- package/dist/modules/attributes/local/successorParams/ThirdPartyRelationshipAttributeSuccessorParams.js.map +1 -0
- package/dist/modules/attributes/local/successorParams/index.d.ts +6 -0
- package/dist/modules/attributes/local/successorParams/index.d.ts.map +1 -0
- package/dist/modules/{openid4vc → attributes/local/successorParams}/index.js +5 -7
- package/dist/modules/attributes/local/successorParams/index.js.map +1 -0
- package/dist/modules/index.d.ts +0 -1
- package/dist/modules/index.d.ts.map +1 -1
- package/dist/modules/index.js +0 -1
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/notifications/index.d.ts +4 -4
- package/dist/modules/notifications/index.d.ts.map +1 -1
- package/dist/modules/notifications/index.js +4 -4
- package/dist/modules/notifications/index.js.map +1 -1
- package/dist/modules/notifications/itemProcessors/attributeDeleted/ForwardedAttributeDeletedByPeerNotificationItemProcessor.d.ts +14 -0
- package/dist/modules/notifications/itemProcessors/attributeDeleted/ForwardedAttributeDeletedByPeerNotificationItemProcessor.d.ts.map +1 -0
- package/dist/modules/notifications/itemProcessors/attributeDeleted/ForwardedAttributeDeletedByPeerNotificationItemProcessor.js +53 -0
- package/dist/modules/notifications/itemProcessors/attributeDeleted/ForwardedAttributeDeletedByPeerNotificationItemProcessor.js.map +1 -0
- package/dist/modules/notifications/itemProcessors/attributeDeleted/OwnAttributeDeletedByOwnerNotificationItemProcessor.d.ts +14 -0
- package/dist/modules/notifications/itemProcessors/attributeDeleted/OwnAttributeDeletedByOwnerNotificationItemProcessor.d.ts.map +1 -0
- package/dist/modules/notifications/itemProcessors/attributeDeleted/OwnAttributeDeletedByOwnerNotificationItemProcessor.js +59 -0
- package/dist/modules/notifications/itemProcessors/attributeDeleted/OwnAttributeDeletedByOwnerNotificationItemProcessor.js.map +1 -0
- package/dist/modules/notifications/itemProcessors/attributeDeleted/PeerRelationshipAttributeDeletedByPeerNotificationItemProcessor.d.ts +14 -0
- package/dist/modules/notifications/itemProcessors/attributeDeleted/PeerRelationshipAttributeDeletedByPeerNotificationItemProcessor.d.ts.map +1 -0
- package/dist/modules/notifications/itemProcessors/attributeDeleted/PeerRelationshipAttributeDeletedByPeerNotificationItemProcessor.js +63 -0
- package/dist/modules/notifications/itemProcessors/attributeDeleted/PeerRelationshipAttributeDeletedByPeerNotificationItemProcessor.js.map +1 -0
- package/dist/modules/notifications/itemProcessors/attributeSucceeded/PeerAttributeSucceededNotificationItemProcessor.d.ts +15 -0
- package/dist/modules/notifications/itemProcessors/attributeSucceeded/PeerAttributeSucceededNotificationItemProcessor.d.ts.map +1 -0
- package/dist/modules/notifications/itemProcessors/attributeSucceeded/PeerAttributeSucceededNotificationItemProcessor.js +102 -0
- package/dist/modules/notifications/itemProcessors/attributeSucceeded/PeerAttributeSucceededNotificationItemProcessor.js.map +1 -0
- package/dist/modules/requests/itemProcessors/createAttribute/CreateAttributeRequestItemProcessor.d.ts +2 -2
- package/dist/modules/requests/itemProcessors/createAttribute/CreateAttributeRequestItemProcessor.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/createAttribute/CreateAttributeRequestItemProcessor.js +54 -20
- package/dist/modules/requests/itemProcessors/createAttribute/CreateAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/deleteAttribute/DeleteAttributeRequestItemProcessor.d.ts +4 -2
- package/dist/modules/requests/itemProcessors/deleteAttribute/DeleteAttributeRequestItemProcessor.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/deleteAttribute/DeleteAttributeRequestItemProcessor.js +50 -43
- package/dist/modules/requests/itemProcessors/deleteAttribute/DeleteAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/proposeAttribute/ProposeAttributeRequestItemProcessor.d.ts +2 -2
- package/dist/modules/requests/itemProcessors/proposeAttribute/ProposeAttributeRequestItemProcessor.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/proposeAttribute/ProposeAttributeRequestItemProcessor.js +83 -97
- package/dist/modules/requests/itemProcessors/proposeAttribute/ProposeAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/readAttribute/ReadAttributeRequestItemProcessor.d.ts +2 -2
- package/dist/modules/requests/itemProcessors/readAttribute/ReadAttributeRequestItemProcessor.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/readAttribute/ReadAttributeRequestItemProcessor.js +136 -133
- package/dist/modules/requests/itemProcessors/readAttribute/ReadAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/shareAttribute/ShareAttributeRequestItemProcessor.d.ts +3 -5
- package/dist/modules/requests/itemProcessors/shareAttribute/ShareAttributeRequestItemProcessor.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/shareAttribute/ShareAttributeRequestItemProcessor.js +94 -90
- package/dist/modules/requests/itemProcessors/shareAttribute/ShareAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/transferFileOwnership/TransferFileOwnershipRequestItemProcessor.d.ts +2 -2
- package/dist/modules/requests/itemProcessors/transferFileOwnership/TransferFileOwnershipRequestItemProcessor.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/transferFileOwnership/TransferFileOwnershipRequestItemProcessor.js +7 -11
- package/dist/modules/requests/itemProcessors/transferFileOwnership/TransferFileOwnershipRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/utility/createAppropriateResponseItem.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/utility/createAppropriateResponseItem.js +31 -53
- package/dist/modules/requests/itemProcessors/utility/createAppropriateResponseItem.js.map +1 -1
- package/dist/modules/requests/itemProcessors/utility/validateAttributeMatchesWithQuery.js +2 -2
- package/dist/modules/requests/itemProcessors/utility/validateAttributeMatchesWithQuery.js.map +1 -1
- package/dist/modules/requests/local/LocalRequest.js +1 -1
- package/dist/modules/requests/local/LocalRequest.js.map +1 -1
- package/dist/modules/requests/local/LocalResponse.js +1 -1
- package/dist/modules/requests/local/LocalResponse.js.map +1 -1
- package/dist/modules/requests/outgoing/OutgoingRequestsController.d.ts +1 -1
- package/dist/modules/requests/outgoing/OutgoingRequestsController.d.ts.map +1 -1
- package/dist/modules/requests/outgoing/OutgoingRequestsController.js +17 -16
- package/dist/modules/requests/outgoing/OutgoingRequestsController.js.map +1 -1
- package/package.json +6 -14
- package/dist/modules/attributes/events/AttributeSucceededEventData.d.ts +0 -6
- package/dist/modules/attributes/events/AttributeSucceededEventData.d.ts.map +0 -1
- package/dist/modules/attributes/events/AttributeSucceededEventData.js +0 -3
- package/dist/modules/attributes/events/AttributeSucceededEventData.js.map +0 -1
- package/dist/modules/attributes/events/OwnSharedAttributeDeletedByOwnerEvent.d.ts +0 -7
- package/dist/modules/attributes/events/OwnSharedAttributeDeletedByOwnerEvent.d.ts.map +0 -1
- package/dist/modules/attributes/events/OwnSharedAttributeDeletedByOwnerEvent.js +0 -12
- package/dist/modules/attributes/events/OwnSharedAttributeDeletedByOwnerEvent.js.map +0 -1
- package/dist/modules/attributes/events/OwnSharedAttributeSucceededEvent.d.ts +0 -8
- package/dist/modules/attributes/events/OwnSharedAttributeSucceededEvent.d.ts.map +0 -1
- package/dist/modules/attributes/events/OwnSharedAttributeSucceededEvent.js +0 -12
- package/dist/modules/attributes/events/OwnSharedAttributeSucceededEvent.js.map +0 -1
- package/dist/modules/attributes/events/PeerSharedAttributeDeletedByPeerEvent.d.ts +0 -7
- package/dist/modules/attributes/events/PeerSharedAttributeDeletedByPeerEvent.d.ts.map +0 -1
- package/dist/modules/attributes/events/PeerSharedAttributeDeletedByPeerEvent.js +0 -12
- package/dist/modules/attributes/events/PeerSharedAttributeDeletedByPeerEvent.js.map +0 -1
- package/dist/modules/attributes/events/PeerSharedAttributeSucceededEvent.d.ts +0 -8
- package/dist/modules/attributes/events/PeerSharedAttributeSucceededEvent.d.ts.map +0 -1
- package/dist/modules/attributes/events/PeerSharedAttributeSucceededEvent.js +0 -12
- package/dist/modules/attributes/events/PeerSharedAttributeSucceededEvent.js.map +0 -1
- package/dist/modules/attributes/events/RepositoryAttributeSucceededEvent.d.ts +0 -8
- package/dist/modules/attributes/events/RepositoryAttributeSucceededEvent.d.ts.map +0 -1
- package/dist/modules/attributes/events/RepositoryAttributeSucceededEvent.js +0 -12
- package/dist/modules/attributes/events/RepositoryAttributeSucceededEvent.js.map +0 -1
- package/dist/modules/attributes/events/SharedAttributeCopyCreatedEvent.d.ts +0 -7
- package/dist/modules/attributes/events/SharedAttributeCopyCreatedEvent.d.ts.map +0 -1
- package/dist/modules/attributes/events/SharedAttributeCopyCreatedEvent.js +0 -12
- package/dist/modules/attributes/events/SharedAttributeCopyCreatedEvent.js.map +0 -1
- package/dist/modules/attributes/events/ThirdPartyRelationshipAttributeDeletedByPeerEvent.d.ts +0 -7
- package/dist/modules/attributes/events/ThirdPartyRelationshipAttributeDeletedByPeerEvent.d.ts.map +0 -1
- package/dist/modules/attributes/events/ThirdPartyRelationshipAttributeDeletedByPeerEvent.js +0 -12
- package/dist/modules/attributes/events/ThirdPartyRelationshipAttributeDeletedByPeerEvent.js.map +0 -1
- package/dist/modules/attributes/events/ThirdPartyRelationshipAttributeSucceededEvent.d.ts +0 -8
- package/dist/modules/attributes/events/ThirdPartyRelationshipAttributeSucceededEvent.d.ts.map +0 -1
- package/dist/modules/attributes/events/ThirdPartyRelationshipAttributeSucceededEvent.js +0 -12
- package/dist/modules/attributes/events/ThirdPartyRelationshipAttributeSucceededEvent.js.map +0 -1
- package/dist/modules/attributes/local/AttributeSuccessorParams.d.ts +0 -24
- package/dist/modules/attributes/local/AttributeSuccessorParams.d.ts.map +0 -1
- package/dist/modules/attributes/local/AttributeSuccessorParams.js.map +0 -1
- package/dist/modules/attributes/local/CreateAttributeParams.d.ts +0 -15
- package/dist/modules/attributes/local/CreateAttributeParams.d.ts.map +0 -1
- package/dist/modules/attributes/local/CreateAttributeParams.js.map +0 -1
- package/dist/modules/attributes/local/CreateRepositoryAttributeParams.d.ts +0 -20
- package/dist/modules/attributes/local/CreateRepositoryAttributeParams.d.ts.map +0 -1
- package/dist/modules/attributes/local/CreateRepositoryAttributeParams.js.map +0 -1
- package/dist/modules/attributes/local/CreateSharedLocalAttributeCopyParams.d.ts +0 -22
- package/dist/modules/attributes/local/CreateSharedLocalAttributeCopyParams.d.ts.map +0 -1
- package/dist/modules/attributes/local/CreateSharedLocalAttributeCopyParams.js.map +0 -1
- package/dist/modules/attributes/local/CreateSharedLocalAttributeParams.d.ts +0 -26
- package/dist/modules/attributes/local/CreateSharedLocalAttributeParams.d.ts.map +0 -1
- package/dist/modules/attributes/local/CreateSharedLocalAttributeParams.js.map +0 -1
- package/dist/modules/attributes/local/LocalAttribute.d.ts +0 -112
- package/dist/modules/attributes/local/LocalAttribute.d.ts.map +0 -1
- package/dist/modules/attributes/local/LocalAttribute.js +0 -186
- package/dist/modules/attributes/local/LocalAttribute.js.map +0 -1
- package/dist/modules/attributes/local/LocalAttributeDeletionInfo.d.ts +0 -24
- package/dist/modules/attributes/local/LocalAttributeDeletionInfo.d.ts.map +0 -1
- package/dist/modules/attributes/local/LocalAttributeDeletionInfo.js +0 -42
- package/dist/modules/attributes/local/LocalAttributeDeletionInfo.js.map +0 -1
- package/dist/modules/attributes/local/LocalAttributeShareInfo.d.ts +0 -26
- package/dist/modules/attributes/local/LocalAttributeShareInfo.d.ts.map +0 -1
- package/dist/modules/attributes/local/LocalAttributeShareInfo.js +0 -59
- package/dist/modules/attributes/local/LocalAttributeShareInfo.js.map +0 -1
- package/dist/modules/notifications/itemProcessors/attributeDeleted/OwnSharedAttributeDeletedByOwnerNotificationItemProcessor.d.ts +0 -14
- package/dist/modules/notifications/itemProcessors/attributeDeleted/OwnSharedAttributeDeletedByOwnerNotificationItemProcessor.d.ts.map +0 -1
- package/dist/modules/notifications/itemProcessors/attributeDeleted/OwnSharedAttributeDeletedByOwnerNotificationItemProcessor.js +0 -56
- package/dist/modules/notifications/itemProcessors/attributeDeleted/OwnSharedAttributeDeletedByOwnerNotificationItemProcessor.js.map +0 -1
- package/dist/modules/notifications/itemProcessors/attributeDeleted/PeerSharedAttributeDeletedByPeerNotificationItemProcessor.d.ts +0 -14
- package/dist/modules/notifications/itemProcessors/attributeDeleted/PeerSharedAttributeDeletedByPeerNotificationItemProcessor.d.ts.map +0 -1
- package/dist/modules/notifications/itemProcessors/attributeDeleted/PeerSharedAttributeDeletedByPeerNotificationItemProcessor.js +0 -57
- package/dist/modules/notifications/itemProcessors/attributeDeleted/PeerSharedAttributeDeletedByPeerNotificationItemProcessor.js.map +0 -1
- package/dist/modules/notifications/itemProcessors/attributeDeleted/ThirdPartyRelationshipAttributeDeletedByPeerNotificationItemProcessor.d.ts +0 -14
- package/dist/modules/notifications/itemProcessors/attributeDeleted/ThirdPartyRelationshipAttributeDeletedByPeerNotificationItemProcessor.d.ts.map +0 -1
- package/dist/modules/notifications/itemProcessors/attributeDeleted/ThirdPartyRelationshipAttributeDeletedByPeerNotificationItemProcessor.js +0 -57
- package/dist/modules/notifications/itemProcessors/attributeDeleted/ThirdPartyRelationshipAttributeDeletedByPeerNotificationItemProcessor.js.map +0 -1
- package/dist/modules/notifications/itemProcessors/attributeSucceeded/PeerSharedAttributeSucceededNotificationItemProcessor.d.ts +0 -15
- package/dist/modules/notifications/itemProcessors/attributeSucceeded/PeerSharedAttributeSucceededNotificationItemProcessor.d.ts.map +0 -1
- package/dist/modules/notifications/itemProcessors/attributeSucceeded/PeerSharedAttributeSucceededNotificationItemProcessor.js +0 -74
- package/dist/modules/notifications/itemProcessors/attributeSucceeded/PeerSharedAttributeSucceededNotificationItemProcessor.js.map +0 -1
- package/dist/modules/openid4vc/OpenId4VcController.d.ts +0 -12
- package/dist/modules/openid4vc/OpenId4VcController.d.ts.map +0 -1
- package/dist/modules/openid4vc/OpenId4VcController.js +0 -82
- package/dist/modules/openid4vc/OpenId4VcController.js.map +0 -1
- package/dist/modules/openid4vc/index.d.ts +0 -8
- package/dist/modules/openid4vc/index.d.ts.map +0 -1
- package/dist/modules/openid4vc/index.js.map +0 -1
- package/dist/modules/openid4vc/local/BaseAgent.d.ts +0 -20
- package/dist/modules/openid4vc/local/BaseAgent.d.ts.map +0 -1
- package/dist/modules/openid4vc/local/BaseAgent.js +0 -69
- package/dist/modules/openid4vc/local/BaseAgent.js.map +0 -1
- package/dist/modules/openid4vc/local/EnmeshedHolderFileSystem.d.ts +0 -18
- package/dist/modules/openid4vc/local/EnmeshedHolderFileSystem.d.ts.map +0 -1
- package/dist/modules/openid4vc/local/EnmeshedHolderFileSystem.js +0 -94
- package/dist/modules/openid4vc/local/EnmeshedHolderFileSystem.js.map +0 -1
- package/dist/modules/openid4vc/local/EnmeshedHolderKeyManagmentService.d.ts +0 -34
- package/dist/modules/openid4vc/local/EnmeshedHolderKeyManagmentService.d.ts.map +0 -1
- package/dist/modules/openid4vc/local/EnmeshedHolderKeyManagmentService.js +0 -364
- package/dist/modules/openid4vc/local/EnmeshedHolderKeyManagmentService.js.map +0 -1
- package/dist/modules/openid4vc/local/EnmeshedStorageService.d.ts +0 -19
- package/dist/modules/openid4vc/local/EnmeshedStorageService.d.ts.map +0 -1
- package/dist/modules/openid4vc/local/EnmeshedStorageService.js +0 -218
- package/dist/modules/openid4vc/local/EnmeshedStorageService.js.map +0 -1
- package/dist/modules/openid4vc/local/Holder.d.ts +0 -34
- package/dist/modules/openid4vc/local/Holder.d.ts.map +0 -1
- package/dist/modules/openid4vc/local/Holder.js +0 -225
- package/dist/modules/openid4vc/local/Holder.js.map +0 -1
- package/dist/modules/openid4vc/local/LocalAgentDependencies.d.ts +0 -3
- package/dist/modules/openid4vc/local/LocalAgentDependencies.d.ts.map +0 -1
- package/dist/modules/openid4vc/local/LocalAgentDependencies.js +0 -18
- package/dist/modules/openid4vc/local/LocalAgentDependencies.js.map +0 -1
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EnmeshedHolderFileSystem = void 0;
|
|
4
|
-
class EnmeshedHolderFileSystem {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.fileSystem = new Map();
|
|
7
|
-
this.directories = new Map();
|
|
8
|
-
// check if the globalThis object already knows a fake file system
|
|
9
|
-
if (globalThis.enmeshedFileSystem) {
|
|
10
|
-
// if a fake file system already exists use its value to initialize this instance
|
|
11
|
-
const existingFs = globalThis.enmeshedFileSystem;
|
|
12
|
-
this.fileSystem = existingFs.fileSystem;
|
|
13
|
-
this.directories = existingFs.directories;
|
|
14
|
-
this.dataPath = existingFs.dataPath;
|
|
15
|
-
this.cachePath = existingFs.cachePath;
|
|
16
|
-
this.tempPath = existingFs.tempPath;
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
this.dataPath = "/data";
|
|
20
|
-
this.cachePath = "/cache";
|
|
21
|
-
this.tempPath = "/temp";
|
|
22
|
-
// initialize the directories map with the known paths
|
|
23
|
-
this.directories.set(this.dataPath, true);
|
|
24
|
-
this.directories.set(this.cachePath, true);
|
|
25
|
-
this.directories.set(this.tempPath, true);
|
|
26
|
-
// store this instance in the globalThis object
|
|
27
|
-
EnmeshedHolderFileSystem.updateGlobalInstance(this);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
static updateGlobalInstance(toStore) {
|
|
31
|
-
globalThis.enmeshedFileSystem = toStore;
|
|
32
|
-
}
|
|
33
|
-
exists(path) {
|
|
34
|
-
if (this.directories.has(path) || this.fileSystem.has(path)) {
|
|
35
|
-
return Promise.resolve(true);
|
|
36
|
-
}
|
|
37
|
-
return Promise.resolve(false);
|
|
38
|
-
}
|
|
39
|
-
createDirectory(path) {
|
|
40
|
-
this.directories.set(path, true);
|
|
41
|
-
EnmeshedHolderFileSystem.updateGlobalInstance(this);
|
|
42
|
-
return Promise.resolve();
|
|
43
|
-
}
|
|
44
|
-
async copyFile(sourcePath, destinationPath) {
|
|
45
|
-
const exists = await this.exists(sourcePath);
|
|
46
|
-
if (!exists) {
|
|
47
|
-
throw new Error(`Source file ${sourcePath} does not exist`);
|
|
48
|
-
}
|
|
49
|
-
if (this.directories.get(sourcePath)) {
|
|
50
|
-
throw new Error(`Source path ${sourcePath} is a directory, not a file`);
|
|
51
|
-
}
|
|
52
|
-
await this.write(destinationPath, this.fileSystem.get(sourcePath));
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
write(path, data) {
|
|
56
|
-
// if the path doe not yet exist set it as a file
|
|
57
|
-
if (!this.directories.has(path)) {
|
|
58
|
-
this.directories.set(path, false); // mark as file
|
|
59
|
-
}
|
|
60
|
-
this.fileSystem.set(path, data);
|
|
61
|
-
EnmeshedHolderFileSystem.updateGlobalInstance(this);
|
|
62
|
-
return Promise.resolve();
|
|
63
|
-
}
|
|
64
|
-
async read(path) {
|
|
65
|
-
const exists = await this.exists(path);
|
|
66
|
-
if (!exists) {
|
|
67
|
-
throw new Error(`Path ${path} does not exist`);
|
|
68
|
-
}
|
|
69
|
-
if (this.directories.get(path)) {
|
|
70
|
-
throw new Error(`Path ${path} is a directory, not a file`);
|
|
71
|
-
}
|
|
72
|
-
return this.fileSystem.get(path) ?? "";
|
|
73
|
-
}
|
|
74
|
-
async delete(path) {
|
|
75
|
-
if (!(await this.exists(path))) {
|
|
76
|
-
throw new Error(`Path ${path} does not exist`);
|
|
77
|
-
}
|
|
78
|
-
if (this.directories.get(path)) {
|
|
79
|
-
throw new Error(`Path ${path} is a directory, not a file`);
|
|
80
|
-
}
|
|
81
|
-
if (this.fileSystem.has(path)) {
|
|
82
|
-
this.fileSystem.delete(path);
|
|
83
|
-
this.directories.delete(path);
|
|
84
|
-
}
|
|
85
|
-
EnmeshedHolderFileSystem.updateGlobalInstance(this);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
89
|
-
downloadToFile(url, path, options) {
|
|
90
|
-
throw new Error("Method not implemented.");
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
exports.EnmeshedHolderFileSystem = EnmeshedHolderFileSystem;
|
|
94
|
-
//# sourceMappingURL=EnmeshedHolderFileSystem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EnmeshedHolderFileSystem.js","sourceRoot":"","sources":["../../../../src/modules/openid4vc/local/EnmeshedHolderFileSystem.ts"],"names":[],"mappings":";;;AAEA,MAAa,wBAAwB;IAQjC;QAHiB,eAAU,GAAwB,IAAI,GAAG,EAAE,CAAC;QAC5C,gBAAW,GAAyB,IAAI,GAAG,EAAE,CAAC;QAG3D,kEAAkE;QAClE,IAAK,UAAkB,CAAC,kBAAkB,EAAE,CAAC;YACzC,iFAAiF;YACjF,MAAM,UAAU,GAAI,UAAkB,CAAC,kBAA8C,CAAC;YACtF,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;YACxC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;YAE1C,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;YACpC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;YACtC,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;QACxC,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YACxB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;YAC1B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;YAExB,sDAAsD;YACtD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC1C,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;YAC3C,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC1C,+CAA+C;YAC/C,wBAAwB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACxD,CAAC;IACL,CAAC;IAE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W,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;QACD,wBAAwB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACpD,OAAO;IACX,CAAC;IAED,6DAA6D;IACtD,cAAc,CAAC,GAAW,EAAE,IAAY,EAAE,OAA+B;QAC5E,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;CACJ;AA5GD,4DA4GC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { AgentContext } from "@credo-ts/core";
|
|
2
|
-
import { KeyManagementService, KmsCreateKeyOptions, KmsCreateKeyReturn, KmsCreateKeyType, KmsDecryptOptions, KmsDecryptReturn, KmsDeleteKeyOptions, KmsEncryptOptions, KmsEncryptReturn, KmsImportKeyOptions, KmsImportKeyReturn, KmsJwkPrivate, KmsJwkPublic, KmsOperation, KmsRandomBytesOptions, KmsRandomBytesReturn, KmsSignOptions, KmsSignReturn, KmsVerifyOptions, KmsVerifyReturn } from "@credo-ts/core/build/modules/kms";
|
|
3
|
-
export interface JwkKeyPair {
|
|
4
|
-
publicKey: JsonWebKey;
|
|
5
|
-
privateKey: JsonWebKey;
|
|
6
|
-
keyType?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare class EnmshedHolderKeyManagmentService implements KeyManagementService {
|
|
9
|
-
static readonly backend = "fakeKeyManagementService";
|
|
10
|
-
readonly backend = "fakeKeyManagementService";
|
|
11
|
-
keystore: Map<string, string>;
|
|
12
|
-
private readonly b64url;
|
|
13
|
-
private readonly b64urlDecode;
|
|
14
|
-
private readonly buf2hex;
|
|
15
|
-
private readonly hex2buf;
|
|
16
|
-
constructor();
|
|
17
|
-
updateGlobalInstance(storrage: Map<string, string>): void;
|
|
18
|
-
isOperationSupported(agentContext: AgentContext, operation: KmsOperation): boolean;
|
|
19
|
-
getPublicKey(agentContext: AgentContext, keyId: string): Promise<KmsJwkPublic>;
|
|
20
|
-
createKey<Type extends KmsCreateKeyType>(agentContext: AgentContext, options: KmsCreateKeyOptions<Type>): Promise<KmsCreateKeyReturn<Type>>;
|
|
21
|
-
importKey<Jwk extends KmsJwkPrivate>(agentContext: AgentContext, options: KmsImportKeyOptions<Jwk>): Promise<KmsImportKeyReturn<Jwk>>;
|
|
22
|
-
deleteKey(agentContext: AgentContext, options: KmsDeleteKeyOptions): Promise<boolean>;
|
|
23
|
-
sign(agentContext: AgentContext, options: KmsSignOptions): Promise<KmsSignReturn>;
|
|
24
|
-
verify(agentContext: AgentContext, options: KmsVerifyOptions): Promise<KmsVerifyReturn>;
|
|
25
|
-
private ecdhEs;
|
|
26
|
-
private utf8;
|
|
27
|
-
private concat;
|
|
28
|
-
private lenPrefix;
|
|
29
|
-
private concatKdf;
|
|
30
|
-
encrypt(agentContext: AgentContext, options: KmsEncryptOptions): Promise<KmsEncryptReturn>;
|
|
31
|
-
decrypt(agentContext: AgentContext, options: KmsDecryptOptions): Promise<KmsDecryptReturn>;
|
|
32
|
-
randomBytes(agentContext: AgentContext, options: KmsRandomBytesOptions): KmsRandomBytesReturn;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=EnmeshedHolderKeyManagmentService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EnmeshedHolderKeyManagmentService.d.ts","sourceRoot":"","sources":["../../../../src/modules/openid4vc/local/EnmeshedHolderKeyManagmentService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACH,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,EAClB,MAAM,kCAAkC,C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CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAiC9F,OAAO,CAAC,MAAM;IAgCd,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,MAAM;IAYd,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,SAAS;IA8BV,OAAO,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAkD1F,OAAO,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAI1F,WAAW,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,qBAAqB,GAAG,oBAAoB;CAIvG"}
|
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.EnmshedHolderKeyManagmentService = void 0;
|
|
7
|
-
const elliptic_1 = require("elliptic");
|
|
8
|
-
const libsodium_wrappers_1 = __importDefault(require("libsodium-wrappers"));
|
|
9
|
-
const sjcl_1 = __importDefault(require("sjcl"));
|
|
10
|
-
class EnmshedHolderKeyManagmentService {
|
|
11
|
-
static { this.backend = "fakeKeyManagementService"; }
|
|
12
|
-
constructor() {
|
|
13
|
-
this.backend = EnmshedHolderKeyManagmentService.backend;
|
|
14
|
-
this.b64url = (bytes) => libsodium_wrappers_1.default.to_base64(bytes, libsodium_wrappers_1.default.base64_variants.URLSAFE_NO_PADDING);
|
|
15
|
-
this.b64urlDecode = (b64url) => libsodium_wrappers_1.default.from_base64(b64url, libsodium_wrappers_1.default.base64_variants.URLSAFE_NO_PADDING);
|
|
16
|
-
// please note: we cannot use buffer here - because it is not available in the browser
|
|
17
|
-
// and yes it could be pollyfilled but that extends the bundle size for no good reason
|
|
18
|
-
this.buf2hex = (bytes) => {
|
|
19
|
-
return Array.from(bytes)
|
|
20
|
-
.map((b) => b.toString(16).padStart(2, "0"))
|
|
21
|
-
.join("");
|
|
22
|
-
};
|
|
23
|
-
this.hex2buf = (hex) => {
|
|
24
|
-
const bytes = new Uint8Array(hex.length / 2);
|
|
25
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
26
|
-
bytes[i] = parseInt(hex.substring(i * 2, i * 2 + 2), 16);
|
|
27
|
-
}
|
|
28
|
-
return bytes;
|
|
29
|
-
};
|
|
30
|
-
if (globalThis.fakeKeyStorage) {
|
|
31
|
-
this.keystore = globalThis.fakeKeyStorage;
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
this.keystore = new Map();
|
|
35
|
-
}
|
|
36
|
-
this.updateGlobalInstance(this.keystore);
|
|
37
|
-
}
|
|
38
|
-
updateGlobalInstance(storrage) {
|
|
39
|
-
// console.log(`FKM: updating global instance ${JSON.stringify(Array.from(storrage.entries()))}`);
|
|
40
|
-
globalThis.fakeKeyStorage = storrage;
|
|
41
|
-
// console.log(`FKM: global instance state ${JSON.stringify(Array.from((globalThis as any).fakeKeyStorage.entries()))}`);
|
|
42
|
-
}
|
|
43
|
-
isOperationSupported(agentContext, operation) {
|
|
44
|
-
agentContext.config.logger.debug(`EKM: Checking if operation is supported: ${JSON.stringify(operation)}`);
|
|
45
|
-
if (operation.operation === "createKey") {
|
|
46
|
-
if (operation.type.kty === "OKP") {
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
if (operation.type.kty === "EC" && operation.type.crv === "P-256") {
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
if (operation.operation === "verify" && operation.algorithm === "ES256") {
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
if (operation.operation === "sign" && (operation.algorithm === "EdDSA" || operation.algorithm === "ES256")) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
if (operation.operation === "randomBytes") {
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
if (operation.operation === "deleteKey") {
|
|
64
|
-
return true;
|
|
65
|
-
}
|
|
66
|
-
if (operation.operation === "encrypt") {
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
getPublicKey(agentContext, keyId) {
|
|
72
|
-
const keyPair = this.keystore.get(keyId);
|
|
73
|
-
if (!keyPair) {
|
|
74
|
-
agentContext.config.logger.error(`EKM: Key with id ${keyId} not found`);
|
|
75
|
-
throw new Error(`Key with id ${keyId} not found`);
|
|
76
|
-
}
|
|
77
|
-
return Promise.resolve(JSON.parse(keyPair).publicKey);
|
|
78
|
-
}
|
|
79
|
-
async createKey(agentContext, options) {
|
|
80
|
-
options.keyId ??= "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
|
|
81
|
-
// Use libsodium's randombytes_uniform for secure random number generation
|
|
82
|
-
const r = libsodium_wrappers_1.default.randombytes_uniform(16);
|
|
83
|
-
const v = c === "x" ? r : (r & 0x3) | 0x8;
|
|
84
|
-
return v.toString(16);
|
|
85
|
-
});
|
|
86
|
-
agentContext.config.logger.debug(`EKM: Creating key with id ${options.keyId} and type ${JSON.stringify(options.type)}`);
|
|
87
|
-
if (options.type.kty === "EC" && options.type.crv === "P-256") {
|
|
88
|
-
// Use P-256 (aka secp256r1)
|
|
89
|
-
const ec = new elliptic_1.ec("p256");
|
|
90
|
-
const key = ec.genKeyPair();
|
|
91
|
-
// Public JWK
|
|
92
|
-
const publicJwk = {
|
|
93
|
-
kty: "EC", // Elliptic Curve
|
|
94
|
-
crv: "P-256",
|
|
95
|
-
x: this.b64url(new Uint8Array(key.getPublic().getX().toArray())),
|
|
96
|
-
y: this.b64url(new Uint8Array(key.getPublic().getY().toArray()))
|
|
97
|
-
};
|
|
98
|
-
// Private JWK
|
|
99
|
-
const privateJwk = {
|
|
100
|
-
...publicJwk,
|
|
101
|
-
d: this.b64url(new Uint8Array(key.getPrivate().toArray()))
|
|
102
|
-
};
|
|
103
|
-
const jwkKeyPair = {
|
|
104
|
-
publicKey: publicJwk,
|
|
105
|
-
privateKey: privateJwk,
|
|
106
|
-
keyType: "EC"
|
|
107
|
-
};
|
|
108
|
-
agentContext.config.logger.debug(`EKM: Created EC key pair with id ${options.keyId}`);
|
|
109
|
-
// store the key pair in the keystore
|
|
110
|
-
this.keystore.set(options.keyId, JSON.stringify(jwkKeyPair));
|
|
111
|
-
this.updateGlobalInstance(this.keystore);
|
|
112
|
-
return await Promise.resolve({
|
|
113
|
-
keyId: options.keyId,
|
|
114
|
-
publicJwk: publicJwk
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
await libsodium_wrappers_1.default.ready;
|
|
118
|
-
const sodium = libsodium_wrappers_1.default;
|
|
119
|
-
const { keyType, publicKey, privateKey } = sodium.crypto_sign_keypair();
|
|
120
|
-
agentContext.config.logger.debug(`EKM: Created OKP key pair with id ${options.keyId} and keyType ${keyType}`);
|
|
121
|
-
const seed = privateKey.slice(0, sodium.crypto_sign_SEEDBYTES);
|
|
122
|
-
// Public JWK
|
|
123
|
-
const publicJwk = {
|
|
124
|
-
kty: "OKP", // Octet Key Pair
|
|
125
|
-
crv: "Ed25519",
|
|
126
|
-
x: this.b64url(publicKey)
|
|
127
|
-
};
|
|
128
|
-
// Private JWK
|
|
129
|
-
const privateJwk = {
|
|
130
|
-
...publicJwk,
|
|
131
|
-
d: this.b64url(seed)
|
|
132
|
-
};
|
|
133
|
-
const jwkKeyPair = {
|
|
134
|
-
publicKey: publicJwk,
|
|
135
|
-
privateKey: privateJwk,
|
|
136
|
-
keyType: "OKP"
|
|
137
|
-
};
|
|
138
|
-
// store the key pair in the keystore
|
|
139
|
-
this.keystore.set(options.keyId, JSON.stringify(jwkKeyPair));
|
|
140
|
-
this.updateGlobalInstance(this.keystore);
|
|
141
|
-
return await Promise.resolve({
|
|
142
|
-
keyId: options.keyId,
|
|
143
|
-
publicJwk: publicJwk
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
importKey(agentContext, options) {
|
|
147
|
-
agentContext.config.logger.debug(`EKM: Importing key with ${JSON.stringify(options)}`);
|
|
148
|
-
throw new Error("Method not implemented.");
|
|
149
|
-
}
|
|
150
|
-
deleteKey(agentContext, options) {
|
|
151
|
-
if (this.keystore.has(options.keyId)) {
|
|
152
|
-
agentContext.config.logger.debug(`EKM: Deleting key with id ${options.keyId}`);
|
|
153
|
-
this.keystore.delete(options.keyId);
|
|
154
|
-
this.updateGlobalInstance(this.keystore);
|
|
155
|
-
return Promise.resolve(true);
|
|
156
|
-
}
|
|
157
|
-
throw new Error(`key with id ${options.keyId} not found. and cannot be deleted`);
|
|
158
|
-
}
|
|
159
|
-
async sign(agentContext, options) {
|
|
160
|
-
agentContext.config.logger.debug(`EKM: Signing data with key id ${options.keyId} using algorithm ${options.algorithm}`);
|
|
161
|
-
const stringifiedKeyPair = this.keystore.get(options.keyId);
|
|
162
|
-
if (!stringifiedKeyPair) {
|
|
163
|
-
throw new Error(`Key with id ${options.keyId} not found`);
|
|
164
|
-
}
|
|
165
|
-
const { privateKey, publicKey } = JSON.parse(stringifiedKeyPair);
|
|
166
|
-
if (options.algorithm === "ES256") {
|
|
167
|
-
// Use P-256 (aka secp256r1)
|
|
168
|
-
const ec = new elliptic_1.ec("p256");
|
|
169
|
-
if (!privateKey.d) {
|
|
170
|
-
throw new Error("Private JWK does not contain 'd' parameter");
|
|
171
|
-
}
|
|
172
|
-
const priv = this.buf2hex(this.b64urlDecode(privateKey.d));
|
|
173
|
-
const key = ec.keyFromPrivate(priv, "hex");
|
|
174
|
-
// we need to hash the data using SHA-256
|
|
175
|
-
const dataHash = ec.hash().update(options.data).digest();
|
|
176
|
-
const signature = key.sign(dataHash);
|
|
177
|
-
const r = new Uint8Array(signature.r.toArray());
|
|
178
|
-
const s = new Uint8Array(signature.s.toArray());
|
|
179
|
-
const signatureBytes = new Uint8Array(r.length + s.length);
|
|
180
|
-
signatureBytes.set(r);
|
|
181
|
-
signatureBytes.set(s, r.length);
|
|
182
|
-
return await Promise.resolve({
|
|
183
|
-
signature: signatureBytes
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
await libsodium_wrappers_1.default.ready;
|
|
187
|
-
const sodium = libsodium_wrappers_1.default;
|
|
188
|
-
const decode = (bytes) => sodium.from_base64(bytes, sodium.base64_variants.URLSAFE_NO_PADDING);
|
|
189
|
-
// get the priavte key bytes
|
|
190
|
-
if (privateKey.d === undefined) {
|
|
191
|
-
throw new Error("Private key does not contain 'd' parameter");
|
|
192
|
-
}
|
|
193
|
-
const privateKeyBytes = decode(privateKey.d);
|
|
194
|
-
// get the public key bytes
|
|
195
|
-
if (publicKey.x === undefined) {
|
|
196
|
-
throw new Error("Public key does not contain 'x' parameter");
|
|
197
|
-
}
|
|
198
|
-
const publicKeyBytes = decode(publicKey.x);
|
|
199
|
-
// combine the key bytes to a full private key
|
|
200
|
-
const fullPrivateKeyBytes = new Uint8Array(privateKeyBytes.length + publicKeyBytes.length);
|
|
201
|
-
fullPrivateKeyBytes.set(privateKeyBytes);
|
|
202
|
-
fullPrivateKeyBytes.set(publicKeyBytes, privateKeyBytes.length);
|
|
203
|
-
// and use it to sign the data
|
|
204
|
-
const signature = sodium.crypto_sign_detached(options.data, fullPrivateKeyBytes);
|
|
205
|
-
return {
|
|
206
|
-
signature: signature
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
verify(agentContext, options) {
|
|
210
|
-
agentContext.config.logger.debug(`EKM: Verifying signature with key id ${options.key.keyId} using algorithm ${options.algorithm}`);
|
|
211
|
-
// Use P-256 (aka secp256r1)
|
|
212
|
-
const ec = new elliptic_1.ec("p256");
|
|
213
|
-
if (!options.key.publicJwk) {
|
|
214
|
-
throw new Error("Public JWK is undefined");
|
|
215
|
-
}
|
|
216
|
-
if (options.key.publicJwk.kty !== "EC") {
|
|
217
|
-
throw new Error("Public JWK does not contain 'x' or 'y' parameter");
|
|
218
|
-
}
|
|
219
|
-
const x = options.key.publicJwk.x;
|
|
220
|
-
const y = options.key.publicJwk.y;
|
|
221
|
-
const pub = { x: this.buf2hex(this.b64urlDecode(x)), y: this.buf2hex(this.b64urlDecode(y)) };
|
|
222
|
-
const key = ec.keyFromPublic(pub, "hex");
|
|
223
|
-
const signatureBytes = options.signature;
|
|
224
|
-
const r = signatureBytes.subarray(0, 32);
|
|
225
|
-
const s = signatureBytes.subarray(32, 64);
|
|
226
|
-
const signature = { r: this.buf2hex(r), s: this.buf2hex(s) };
|
|
227
|
-
// we need to hash the data using SHA-256
|
|
228
|
-
const dataHash = ec.hash().update(options.data).digest();
|
|
229
|
-
try {
|
|
230
|
-
const verified = key.verify(dataHash, signature);
|
|
231
|
-
return Promise.resolve({ verified: verified });
|
|
232
|
-
}
|
|
233
|
-
catch (e) {
|
|
234
|
-
agentContext.config.logger.error(`EKM: Error during signature verification: ${e}`);
|
|
235
|
-
throw e;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
ecdhEs(localKeyId, remotePublicJWK) {
|
|
239
|
-
const keyPairString = this.keystore.get(localKeyId);
|
|
240
|
-
if (!keyPairString) {
|
|
241
|
-
throw new Error(`Key with id ${localKeyId} not found`);
|
|
242
|
-
}
|
|
243
|
-
const localKeyPair = JSON.parse(keyPairString);
|
|
244
|
-
if (localKeyPair.keyType !== "EC") {
|
|
245
|
-
throw new Error("Key type is not EC");
|
|
246
|
-
}
|
|
247
|
-
const ec = new elliptic_1.ec("p256");
|
|
248
|
-
if (localKeyPair.privateKey.d === undefined) {
|
|
249
|
-
throw new Error("Local private key does not contain 'd' parameter");
|
|
250
|
-
}
|
|
251
|
-
const localPriv = ec.keyFromPrivate(this.buf2hex(this.b64urlDecode(localKeyPair.privateKey.d)), "hex");
|
|
252
|
-
// the remote jwk is base64url encoded - we again decode and transform to hex to receive a fitting public key
|
|
253
|
-
const remoteBasePoint = ec.keyFromPublic({
|
|
254
|
-
x: this.buf2hex(this.b64urlDecode(remotePublicJWK.x)),
|
|
255
|
-
y: this.buf2hex(this.b64urlDecode(remotePublicJWK.y))
|
|
256
|
-
}, "hex");
|
|
257
|
-
const sharedSecret = localPriv.derive(remoteBasePoint.getPublic());
|
|
258
|
-
const sharedBytes = new Uint8Array(sharedSecret.toArray("be"));
|
|
259
|
-
return sharedBytes;
|
|
260
|
-
}
|
|
261
|
-
// UTF-8 encode helper
|
|
262
|
-
utf8(str) {
|
|
263
|
-
return new TextEncoder().encode(str);
|
|
264
|
-
}
|
|
265
|
-
// Concat Uint8Arrays
|
|
266
|
-
concat(...arrays) {
|
|
267
|
-
const total = arrays.reduce((sum, a) => sum + a.length, 0);
|
|
268
|
-
const out = new Uint8Array(total);
|
|
269
|
-
let offset = 0;
|
|
270
|
-
for (const a of arrays) {
|
|
271
|
-
out.set(a, offset);
|
|
272
|
-
offset += a.length;
|
|
273
|
-
}
|
|
274
|
-
return out;
|
|
275
|
-
}
|
|
276
|
-
// Encode a 32-bit big-endian length prefix
|
|
277
|
-
lenPrefix(data) {
|
|
278
|
-
const buf = new Uint8Array(4 + data.length);
|
|
279
|
-
const view = new DataView(buf.buffer);
|
|
280
|
-
view.setUint32(0, data.length, false); // big-endian
|
|
281
|
-
buf.set(data, 4);
|
|
282
|
-
return buf;
|
|
283
|
-
}
|
|
284
|
-
concatKdf(sharedSecret, keyLength, algorithmDescriptor, keyAgreement) {
|
|
285
|
-
if (keyAgreement.apu === undefined) {
|
|
286
|
-
throw new Error("Key agreement apu is undefined");
|
|
287
|
-
}
|
|
288
|
-
if (keyAgreement.apv === undefined) {
|
|
289
|
-
throw new Error("Key agreement apv is undefined");
|
|
290
|
-
}
|
|
291
|
-
const algId = this.lenPrefix(this.utf8(algorithmDescriptor));
|
|
292
|
-
const partyU = this.lenPrefix(keyAgreement.apu);
|
|
293
|
-
const partyV = this.lenPrefix(keyAgreement.apv);
|
|
294
|
-
const suppPubInfo = new Uint8Array(4);
|
|
295
|
-
new DataView(suppPubInfo.buffer).setUint32(0, keyLength, false);
|
|
296
|
-
const suppPrivInfo = new Uint8Array(0);
|
|
297
|
-
const otherInfo = this.concat(algId, partyU, partyV, suppPubInfo, suppPrivInfo);
|
|
298
|
-
const counter = new Uint8Array([0, 0, 0, 1]);
|
|
299
|
-
const input = this.concat(counter, sharedSecret, otherInfo);
|
|
300
|
-
// Hash with SHA-256 (SJCL)
|
|
301
|
-
const inputHex = this.buf2hex(input);
|
|
302
|
-
const inputBits = sjcl_1.default.codec.hex.toBits(inputHex);
|
|
303
|
-
const hashBits = sjcl_1.default.hash.sha256.hash(inputBits);
|
|
304
|
-
const hashHex = sjcl_1.default.codec.hex.fromBits(hashBits);
|
|
305
|
-
const hashBuf = this.hex2buf(hashHex);
|
|
306
|
-
// Truncate to desired key length
|
|
307
|
-
return hashBuf.subarray(0, keyLength / 8);
|
|
308
|
-
}
|
|
309
|
-
encrypt(agentContext, options) {
|
|
310
|
-
try {
|
|
311
|
-
// encryption via A-256-GCM
|
|
312
|
-
// we will call the services side bob and the incoming side alice
|
|
313
|
-
if (options.key.keyAgreement === undefined) {
|
|
314
|
-
throw new Error("Key agreement is undefined");
|
|
315
|
-
}
|
|
316
|
-
if (options.key.keyAgreement.keyId === undefined) {
|
|
317
|
-
throw new Error("Key agreement keyId is undefined");
|
|
318
|
-
}
|
|
319
|
-
// 1. derive the shared secret via ECDH-ES
|
|
320
|
-
const sharedSecret = this.ecdhEs(options.key.keyAgreement.keyId, options.key.keyAgreement.externalPublicJwk);
|
|
321
|
-
agentContext.config.logger.debug(`EKM: Derived shared secret for encryption using ECDH-ES`);
|
|
322
|
-
// 2. Concat KDF to form the final key
|
|
323
|
-
const derivedKey = this.concatKdf(sharedSecret, 256, "A256GCM", options.key.keyAgreement);
|
|
324
|
-
// 3. Encrypt the data via AES-256-GCM using libsodium
|
|
325
|
-
// create nonce
|
|
326
|
-
const iv = crypto.getRandomValues(new Uint8Array(12));
|
|
327
|
-
// transform to bit arrays for sjcl
|
|
328
|
-
const keyBits = sjcl_1.default.codec.hex.toBits(this.buf2hex(derivedKey));
|
|
329
|
-
const dataBits = sjcl_1.default.codec.hex.toBits(this.buf2hex(options.data));
|
|
330
|
-
const ivBits = sjcl_1.default.codec.hex.toBits(this.buf2hex(iv));
|
|
331
|
-
// do not forget to add the additional authenticated data
|
|
332
|
-
const aadBits = "aad" in options.encryption && options.encryption.aad ? sjcl_1.default.codec.hex.toBits(this.buf2hex(options.encryption.aad)) : [];
|
|
333
|
-
// setup aes
|
|
334
|
-
const aes = new sjcl_1.default.cipher.aes(keyBits);
|
|
335
|
-
// encrypt
|
|
336
|
-
const cyphertextBits = sjcl_1.default.mode.gcm.encrypt(aes, dataBits, ivBits, aadBits, 128);
|
|
337
|
-
// transform back to byte array
|
|
338
|
-
const cyphertextBuf = this.hex2buf(sjcl_1.default.codec.hex.fromBits(cyphertextBits));
|
|
339
|
-
// In SJCL, GCM output = ciphertext || tag
|
|
340
|
-
const cyphertext = cyphertextBuf.subarray(0, cyphertextBuf.length - 16);
|
|
341
|
-
const tag = cyphertextBuf.subarray(cyphertextBuf.length - 16);
|
|
342
|
-
const returnValue = {
|
|
343
|
-
encrypted: cyphertext,
|
|
344
|
-
iv: iv,
|
|
345
|
-
tag: tag
|
|
346
|
-
};
|
|
347
|
-
return Promise.resolve(returnValue);
|
|
348
|
-
}
|
|
349
|
-
catch (e) {
|
|
350
|
-
agentContext.config.logger.error(`EKM: Error during encryption: ${e}`);
|
|
351
|
-
throw e;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
decrypt(agentContext, options) {
|
|
355
|
-
agentContext.config.logger.debug(`EKM: Decrypting data with key id ${options.key.keyId} using options ${options}`);
|
|
356
|
-
throw new Error("Method not implemented.");
|
|
357
|
-
}
|
|
358
|
-
randomBytes(agentContext, options) {
|
|
359
|
-
agentContext.config.logger.debug(`EKM: Generating ${options.length} random bytes`);
|
|
360
|
-
return libsodium_wrappers_1.default.randombytes_buf(options.length); // Uint8Array
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
exports.EnmshedHolderKeyManagmentService = EnmshedHolderKeyManagmentService;
|
|
364
|
-
//# sourceMappingURL=EnmeshedHolderKeyManagmentService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EnmeshedHolderKeyManagmentService.js","sourceRoot":"","sources":["../../../../src/modules/openid4vc/local/EnmeshedHolderKeyManagmentService.ts"],"names":[],"mappings":";;;;;;AAuBA,uCAAoC;AACpC,4EAAyC;AACzC,gDAAwB;AAQxB,MAAa,gCAAgC;aAClB,YAAO,GAAG,0BAA0B,AAA7B,CAA8B;IAuB5D;QArBgB,YAAO,GAAG,gCAAgC,CAAC,OAAO,CAAC;QAGlD,WAAM,GAAG,CAAC,KAAiB,EAAE,EAAE,CAAC,4BAAO,CAAC,SAAS,CAAC,KAAK,EAAE,4BAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;QACrG,iBAAY,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,4BAAO,CAAC,WAAW,CAAC,MAAM,EAAE,4BAAO,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;QAE5H,sFAAsF;QACtF,sFAAsF;QACrE,YAAO,GAAG,CAAC,KAAiB,EAAE,EAAE;YAC7C,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;iBACnB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;iBAC3C,IAAI,CAAC,EAAE,CAAC,CAAC;QAClB,CAAC,CAAC;QACe,YAAO,GAAG,CAAC,GAAW,EAAE,EAAE;YACvC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YAC7C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ordConstructor, Query, QueryOptions, StorageService } from "@credo-ts/core";
|
|
2
|
-
import { AccountController } from "@nmshd/transport";
|
|
3
|
-
import { AttributesController } from "../../attributes/AttributesController";
|
|
4
|
-
export declare class EnmeshedStorageService<T extends BaseRecord> implements StorageService<T> {
|
|
5
|
-
accountController: AccountController;
|
|
6
|
-
attributeController: AttributesController;
|
|
7
|
-
storrage: Map<string, T>;
|
|
8
|
-
constructor(accountController: AccountController, attributeController: AttributesController);
|
|
9
|
-
save(agentContext: AgentContext, record: T): Promise<void>;
|
|
10
|
-
saveWithDisplay(agentContext: AgentContext, value: string, type: string, displayInformation: string, title: string): Promise<any>;
|
|
11
|
-
update(agentContext: AgentContext, record: T): Promise<void>;
|
|
12
|
-
delete(agentContext: AgentContext, record: T): Promise<void>;
|
|
13
|
-
deleteById(agentContext: AgentContext, recordClass: BaseRecordConstructor<T>, id: string): Promise<void>;
|
|
14
|
-
getById(agentContext: AgentContext, recordClass: BaseRecordConstructor<T>, id: string): Promise<T>;
|
|
15
|
-
getAll(agentContext: AgentContext, recordClass: BaseRecordConstructor<T>): Promise<T[]>;
|
|
16
|
-
getAllAsAttributes(agentContext: AgentContext, recordClass: BaseRecordConstructor<T>): Promise<any[]>;
|
|
17
|
-
findByQuery(agentContext: AgentContext, recordClass: BaseRecordConstructor<T>, query: Query<T>, queryOptions?: QueryOptions): Promise<T[]>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=EnmeshedStorageService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EnmeshedStorageService.d.ts","sourceRoot":"","sources":["../../../../src/modules/openid4vc/local/EnmeshedStorageService.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,UAAU,EACV,qBAAqB,EAMrB,KAAK,EACL,YAAY,EAEZ,cAAc,EAIjB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAA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