@nmshd/transport 1.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 +1 -0
- package/README.md +18 -0
- package/dist/TransportBuildInformation.d.ts +13 -0
- package/dist/TransportBuildInformation.js +25 -0
- package/dist/TransportBuildInformation.js.map +1 -0
- package/dist/core/CoreCrypto.d.ts +108 -0
- package/dist/core/CoreCrypto.js +205 -0
- package/dist/core/CoreCrypto.js.map +1 -0
- package/dist/core/CoreError.d.ts +18 -0
- package/dist/core/CoreError.js +63 -0
- package/dist/core/CoreError.js.map +1 -0
- package/dist/core/CoreIdHelper.d.ts +9 -0
- package/dist/core/CoreIdHelper.js +23 -0
- package/dist/core/CoreIdHelper.js.map +1 -0
- package/dist/core/CoreIds.d.ts +9 -0
- package/dist/core/CoreIds.js +14 -0
- package/dist/core/CoreIds.js.map +1 -0
- package/dist/core/CoreSerializable.d.ts +18 -0
- package/dist/core/CoreSerializable.js +44 -0
- package/dist/core/CoreSerializable.js.map +1 -0
- package/dist/core/CoreSerializableAsync.d.ts +18 -0
- package/dist/core/CoreSerializableAsync.js +44 -0
- package/dist/core/CoreSerializableAsync.js.map +1 -0
- package/dist/core/CoreSynchronizable.d.ts +11 -0
- package/dist/core/CoreSynchronizable.js +30 -0
- package/dist/core/CoreSynchronizable.js.map +1 -0
- package/dist/core/CoreUtil.d.ts +6 -0
- package/dist/core/CoreUtil.js +38 -0
- package/dist/core/CoreUtil.js.map +1 -0
- package/dist/core/DbCollectionNames.d.ts +11 -0
- package/dist/core/DbCollectionNames.js +16 -0
- package/dist/core/DbCollectionNames.js.map +1 -0
- package/dist/core/ICacheable.d.ts +4 -0
- package/dist/core/ICacheable.js +14 -0
- package/dist/core/ICacheable.js.map +1 -0
- package/dist/core/Transport.d.ts +47 -0
- package/dist/core/Transport.js +71 -0
- package/dist/core/Transport.js.map +1 -0
- package/dist/core/TransportContext.d.ts +8 -0
- package/dist/core/TransportContext.js +29 -0
- package/dist/core/TransportContext.js.map +1 -0
- package/dist/core/TransportController.d.ts +51 -0
- package/dist/core/TransportController.js +99 -0
- package/dist/core/TransportController.js.map +1 -0
- package/dist/core/TransportErrors.d.ts +125 -0
- package/dist/core/TransportErrors.js +255 -0
- package/dist/core/TransportErrors.js.map +1 -0
- package/dist/core/TransportLoggerFactory.d.ts +7 -0
- package/dist/core/TransportLoggerFactory.js +23 -0
- package/dist/core/TransportLoggerFactory.js.map +1 -0
- package/dist/core/backbone/AuthClient.d.ts +17 -0
- package/dist/core/backbone/AuthClient.js +47 -0
- package/dist/core/backbone/AuthClient.js.map +1 -0
- package/dist/core/backbone/Authenticator.d.ts +16 -0
- package/dist/core/backbone/Authenticator.js +62 -0
- package/dist/core/backbone/Authenticator.js.map +1 -0
- package/dist/core/backbone/BackboneIds.d.ts +11 -0
- package/dist/core/backbone/BackboneIds.js +16 -0
- package/dist/core/backbone/BackboneIds.js.map +1 -0
- package/dist/core/backbone/ClientResult.d.ts +19 -0
- package/dist/core/backbone/ClientResult.js +58 -0
- package/dist/core/backbone/ClientResult.js.map +1 -0
- package/dist/core/backbone/Paginator.d.ts +17 -0
- package/dist/core/backbone/Paginator.js +44 -0
- package/dist/core/backbone/Paginator.js.map +1 -0
- package/dist/core/backbone/PlatformError.d.ts +9 -0
- package/dist/core/backbone/PlatformError.js +3 -0
- package/dist/core/backbone/PlatformError.js.map +1 -0
- package/dist/core/backbone/PlatformParameters.d.ts +6 -0
- package/dist/core/backbone/PlatformParameters.js +3 -0
- package/dist/core/backbone/PlatformParameters.js.map +1 -0
- package/dist/core/backbone/PlatformResponse.d.ts +16 -0
- package/dist/core/backbone/PlatformResponse.js +3 -0
- package/dist/core/backbone/PlatformResponse.js.map +1 -0
- package/dist/core/backbone/RESTClient.d.ts +46 -0
- package/dist/core/backbone/RESTClient.js +425 -0
- package/dist/core/backbone/RESTClient.js.map +1 -0
- package/dist/core/backbone/RESTClientAuthenticate.d.ts +23 -0
- package/dist/core/backbone/RESTClientAuthenticate.js +72 -0
- package/dist/core/backbone/RESTClientAuthenticate.js.map +1 -0
- package/dist/core/backbone/RequestError.d.ts +24 -0
- package/dist/core/backbone/RequestError.js +101 -0
- package/dist/core/backbone/RequestError.js.map +1 -0
- package/dist/core/backbone/index.d.ts +6 -0
- package/dist/core/backbone/index.js +19 -0
- package/dist/core/backbone/index.js.map +1 -0
- package/dist/core/index.d.ts +16 -0
- package/dist/core/index.js +29 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/logging/logExecutionTime.d.ts +26 -0
- package/dist/core/logging/logExecutionTime.js +58 -0
- package/dist/core/logging/logExecutionTime.js.map +1 -0
- package/dist/core/types/CoreAddress.d.ts +15 -0
- package/dist/core/types/CoreAddress.js +56 -0
- package/dist/core/types/CoreAddress.js.map +1 -0
- package/dist/core/types/CoreDate.d.ts +37 -0
- package/dist/core/types/CoreDate.js +156 -0
- package/dist/core/types/CoreDate.js.map +1 -0
- package/dist/core/types/CoreHash.d.ts +37 -0
- package/dist/core/types/CoreHash.js +75 -0
- package/dist/core/types/CoreHash.js.map +1 -0
- package/dist/core/types/CoreId.d.ts +16 -0
- package/dist/core/types/CoreId.js +57 -0
- package/dist/core/types/CoreId.js.map +1 -0
- package/dist/core/types/TransportVersion.d.ts +4 -0
- package/dist/core/types/TransportVersion.js +9 -0
- package/dist/core/types/TransportVersion.js.map +1 -0
- package/dist/core/types/index.d.ts +5 -0
- package/dist/core/types/index.js +18 -0
- package/dist/core/types/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/accounts/AccountController.d.ts +77 -0
- package/dist/modules/accounts/AccountController.js +337 -0
- package/dist/modules/accounts/AccountController.js.map +1 -0
- package/dist/modules/accounts/IdentityController.d.ts +21 -0
- package/dist/modules/accounts/IdentityController.js +67 -0
- package/dist/modules/accounts/IdentityController.js.map +1 -0
- package/dist/modules/accounts/IdentityUtil.d.ts +6 -0
- package/dist/modules/accounts/IdentityUtil.js +56 -0
- package/dist/modules/accounts/IdentityUtil.js.map +1 -0
- package/dist/modules/accounts/backbone/IdentityClient.d.ts +23 -0
- package/dist/modules/accounts/backbone/IdentityClient.js +15 -0
- package/dist/modules/accounts/backbone/IdentityClient.js.map +1 -0
- package/dist/modules/accounts/data/Identity.d.ts +34 -0
- package/dist/modules/accounts/data/Identity.js +69 -0
- package/dist/modules/accounts/data/Identity.js.map +1 -0
- package/dist/modules/accounts/data/IdentitySecretCredentials.d.ts +16 -0
- package/dist/modules/accounts/data/IdentitySecretCredentials.js +47 -0
- package/dist/modules/accounts/data/IdentitySecretCredentials.js.map +1 -0
- package/dist/modules/certificates/CertificateController.d.ts +14 -0
- package/dist/modules/certificates/CertificateController.js +20 -0
- package/dist/modules/certificates/CertificateController.js.map +1 -0
- package/dist/modules/certificates/CertificateIssuer.d.ts +27 -0
- package/dist/modules/certificates/CertificateIssuer.js +42 -0
- package/dist/modules/certificates/CertificateIssuer.js.map +1 -0
- package/dist/modules/certificates/CertificateValidator.d.ts +14 -0
- package/dist/modules/certificates/CertificateValidator.js +20 -0
- package/dist/modules/certificates/CertificateValidator.js.map +1 -0
- package/dist/modules/certificates/data/Certificate.d.ts +34 -0
- package/dist/modules/certificates/data/Certificate.js +65 -0
- package/dist/modules/certificates/data/Certificate.js.map +1 -0
- package/dist/modules/certificates/data/CertificateConstraint.d.ts +10 -0
- package/dist/modules/certificates/data/CertificateConstraint.js +28 -0
- package/dist/modules/certificates/data/CertificateConstraint.js.map +1 -0
- package/dist/modules/certificates/data/CertificateContent.d.ts +28 -0
- package/dist/modules/certificates/data/CertificateContent.js +70 -0
- package/dist/modules/certificates/data/CertificateContent.js.map +1 -0
- package/dist/modules/certificates/data/CertificateItem.d.ts +11 -0
- package/dist/modules/certificates/data/CertificateItem.js +29 -0
- package/dist/modules/certificates/data/CertificateItem.js.map +1 -0
- package/dist/modules/certificates/data/constraints/CertificateBorderConstraint.d.ts +29 -0
- package/dist/modules/certificates/data/constraints/CertificateBorderConstraint.js +57 -0
- package/dist/modules/certificates/data/constraints/CertificateBorderConstraint.js.map +1 -0
- package/dist/modules/certificates/data/constraints/CertificateCityConstraint.d.ts +31 -0
- package/dist/modules/certificates/data/constraints/CertificateCityConstraint.js +60 -0
- package/dist/modules/certificates/data/constraints/CertificateCityConstraint.js.map +1 -0
- package/dist/modules/certificates/data/constraints/CertificateIdentityConstraint.d.ts +9 -0
- package/dist/modules/certificates/data/constraints/CertificateIdentityConstraint.js +31 -0
- package/dist/modules/certificates/data/constraints/CertificateIdentityConstraint.js.map +1 -0
- package/dist/modules/certificates/data/constraints/CertificateTimeConstraint.d.ts +16 -0
- package/dist/modules/certificates/data/constraints/CertificateTimeConstraint.js +41 -0
- package/dist/modules/certificates/data/constraints/CertificateTimeConstraint.js.map +1 -0
- package/dist/modules/certificates/data/items/CertificateAuthorizationItem.d.ts +17 -0
- package/dist/modules/certificates/data/items/CertificateAuthorizationItem.js +39 -0
- package/dist/modules/certificates/data/items/CertificateAuthorizationItem.js.map +1 -0
- package/dist/modules/certificates/data/items/CertificateDelegateItem.d.ts +18 -0
- package/dist/modules/certificates/data/items/CertificateDelegateItem.js +46 -0
- package/dist/modules/certificates/data/items/CertificateDelegateItem.js.map +1 -0
- package/dist/modules/certificates/data/items/CertificatePrivateAttributeItem.d.ts +19 -0
- package/dist/modules/certificates/data/items/CertificatePrivateAttributeItem.js +42 -0
- package/dist/modules/certificates/data/items/CertificatePrivateAttributeItem.js.map +1 -0
- package/dist/modules/certificates/data/items/CertificatePrivateAttributeItemSource.d.ts +25 -0
- package/dist/modules/certificates/data/items/CertificatePrivateAttributeItemSource.js +55 -0
- package/dist/modules/certificates/data/items/CertificatePrivateAttributeItemSource.js.map +1 -0
- package/dist/modules/certificates/data/items/CertificatePublicAttributeItem.d.ts +14 -0
- package/dist/modules/certificates/data/items/CertificatePublicAttributeItem.js +39 -0
- package/dist/modules/certificates/data/items/CertificatePublicAttributeItem.js.map +1 -0
- package/dist/modules/certificates/data/items/CertificateRoleItem.d.ts +16 -0
- package/dist/modules/certificates/data/items/CertificateRoleItem.js +38 -0
- package/dist/modules/certificates/data/items/CertificateRoleItem.js.map +1 -0
- package/dist/modules/challenges/ChallengeController.d.ts +16 -0
- package/dist/modules/challenges/ChallengeController.js +123 -0
- package/dist/modules/challenges/ChallengeController.js.map +1 -0
- package/dist/modules/challenges/backbone/ChallengeAuthClient.d.ts +18 -0
- package/dist/modules/challenges/backbone/ChallengeAuthClient.js +14 -0
- package/dist/modules/challenges/backbone/ChallengeAuthClient.js.map +1 -0
- package/dist/modules/challenges/backbone/ChallengeClient.d.ts +6 -0
- package/dist/modules/challenges/backbone/ChallengeClient.js +11 -0
- package/dist/modules/challenges/backbone/ChallengeClient.js.map +1 -0
- package/dist/modules/challenges/data/Challenge.d.ts +22 -0
- package/dist/modules/challenges/data/Challenge.js +59 -0
- package/dist/modules/challenges/data/Challenge.js.map +1 -0
- package/dist/modules/challenges/data/ChallengeSigned.d.ts +18 -0
- package/dist/modules/challenges/data/ChallengeSigned.js +50 -0
- package/dist/modules/challenges/data/ChallengeSigned.js.map +1 -0
- package/dist/modules/devices/DeviceController.d.ts +27 -0
- package/dist/modules/devices/DeviceController.js +120 -0
- package/dist/modules/devices/DeviceController.js.map +1 -0
- package/dist/modules/devices/DeviceSecretController.d.ts +36 -0
- package/dist/modules/devices/DeviceSecretController.js +163 -0
- package/dist/modules/devices/DeviceSecretController.js.map +1 -0
- package/dist/modules/devices/DevicesController.d.ts +20 -0
- package/dist/modules/devices/DevicesController.js +96 -0
- package/dist/modules/devices/DevicesController.js.map +1 -0
- package/dist/modules/devices/backbone/BackbonePostDevices.d.ts +11 -0
- package/dist/modules/devices/backbone/BackbonePostDevices.js +3 -0
- package/dist/modules/devices/backbone/BackbonePostDevices.js.map +1 -0
- package/dist/modules/devices/backbone/DeviceAuthClient.d.ts +18 -0
- package/dist/modules/devices/backbone/DeviceAuthClient.js +21 -0
- package/dist/modules/devices/backbone/DeviceAuthClient.js.map +1 -0
- package/dist/modules/devices/backbone/DeviceClient.d.ts +7 -0
- package/dist/modules/devices/backbone/DeviceClient.js +15 -0
- package/dist/modules/devices/backbone/DeviceClient.js.map +1 -0
- package/dist/modules/devices/local/Device.d.ts +46 -0
- package/dist/modules/devices/local/Device.js +115 -0
- package/dist/modules/devices/local/Device.js.map +1 -0
- package/dist/modules/devices/local/DeviceSecretCredentials.d.ts +12 -0
- package/dist/modules/devices/local/DeviceSecretCredentials.js +40 -0
- package/dist/modules/devices/local/DeviceSecretCredentials.js.map +1 -0
- package/dist/modules/devices/local/SendDeviceParameters.d.ts +13 -0
- package/dist/modules/devices/local/SendDeviceParameters.js +43 -0
- package/dist/modules/devices/local/SendDeviceParameters.js.map +1 -0
- package/dist/modules/devices/transmission/DeviceSharedSecret.d.ts +33 -0
- package/dist/modules/devices/transmission/DeviceSharedSecret.js +90 -0
- package/dist/modules/devices/transmission/DeviceSharedSecret.js.map +1 -0
- package/dist/modules/files/FileController.d.ts +25 -0
- package/dist/modules/files/FileController.js +196 -0
- package/dist/modules/files/FileController.js.map +1 -0
- package/dist/modules/files/backbone/BackboneGetFiles.d.ts +21 -0
- package/dist/modules/files/backbone/BackboneGetFiles.js +3 -0
- package/dist/modules/files/backbone/BackboneGetFiles.js.map +1 -0
- package/dist/modules/files/backbone/BackbonePostFiles.d.ts +25 -0
- package/dist/modules/files/backbone/BackbonePostFiles.js +3 -0
- package/dist/modules/files/backbone/BackbonePostFiles.js.map +1 -0
- package/dist/modules/files/backbone/FileClient.d.ts +12 -0
- package/dist/modules/files/backbone/FileClient.js +23 -0
- package/dist/modules/files/backbone/FileClient.js.map +1 -0
- package/dist/modules/files/local/CachedFile.d.ts +47 -0
- package/dist/modules/files/local/CachedFile.js +140 -0
- package/dist/modules/files/local/CachedFile.js.map +1 -0
- package/dist/modules/files/local/File.d.ts +27 -0
- package/dist/modules/files/local/File.js +88 -0
- package/dist/modules/files/local/File.js.map +1 -0
- package/dist/modules/files/local/SendFileParameters.d.ts +23 -0
- package/dist/modules/files/local/SendFileParameters.js +65 -0
- package/dist/modules/files/local/SendFileParameters.js.map +1 -0
- package/dist/modules/files/transmission/FileMetadata.d.ts +24 -0
- package/dist/modules/files/transmission/FileMetadata.js +69 -0
- package/dist/modules/files/transmission/FileMetadata.js.map +1 -0
- package/dist/modules/files/transmission/FileReference.d.ts +15 -0
- package/dist/modules/files/transmission/FileReference.js +66 -0
- package/dist/modules/files/transmission/FileReference.js.map +1 -0
- package/dist/modules/index.d.ts +110 -0
- package/dist/modules/index.js +123 -0
- package/dist/modules/index.js.map +1 -0
- package/dist/modules/messages/MessageController.d.ts +29 -0
- package/dist/modules/messages/MessageController.js +316 -0
- package/dist/modules/messages/MessageController.js.map +1 -0
- package/dist/modules/messages/backbone/BackboneGetMessages.d.ts +25 -0
- package/dist/modules/messages/backbone/BackboneGetMessages.js +3 -0
- package/dist/modules/messages/backbone/BackboneGetMessages.js.map +1 -0
- package/dist/modules/messages/backbone/BackbonePostMessages.d.ts +16 -0
- package/dist/modules/messages/backbone/BackbonePostMessages.js +3 -0
- package/dist/modules/messages/backbone/BackbonePostMessages.js.map +1 -0
- package/dist/modules/messages/backbone/MessageClient.d.ts +12 -0
- package/dist/modules/messages/backbone/MessageClient.js +23 -0
- package/dist/modules/messages/backbone/MessageClient.js.map +1 -0
- package/dist/modules/messages/local/CachedMessage.d.ts +23 -0
- package/dist/modules/messages/local/CachedMessage.js +67 -0
- package/dist/modules/messages/local/CachedMessage.js.map +1 -0
- package/dist/modules/messages/local/Message.d.ts +26 -0
- package/dist/modules/messages/local/Message.js +87 -0
- package/dist/modules/messages/local/Message.js.map +1 -0
- package/dist/modules/messages/local/SendMessageParameters.d.ts +15 -0
- package/dist/modules/messages/local/SendMessageParameters.js +44 -0
- package/dist/modules/messages/local/SendMessageParameters.js.map +1 -0
- package/dist/modules/messages/transmission/MessageEnvelope.d.ts +24 -0
- package/dist/modules/messages/transmission/MessageEnvelope.js +81 -0
- package/dist/modules/messages/transmission/MessageEnvelope.js.map +1 -0
- package/dist/modules/messages/transmission/MessageEnvelopeRecipient.d.ts +16 -0
- package/dist/modules/messages/transmission/MessageEnvelopeRecipient.js +47 -0
- package/dist/modules/messages/transmission/MessageEnvelopeRecipient.js.map +1 -0
- package/dist/modules/messages/transmission/MessagePlain.d.ts +29 -0
- package/dist/modules/messages/transmission/MessagePlain.js +68 -0
- package/dist/modules/messages/transmission/MessagePlain.js.map +1 -0
- package/dist/modules/messages/transmission/MessageSignature.d.ts +11 -0
- package/dist/modules/messages/transmission/MessageSignature.js +36 -0
- package/dist/modules/messages/transmission/MessageSignature.js.map +1 -0
- package/dist/modules/messages/transmission/MessageSigned.d.ts +15 -0
- package/dist/modules/messages/transmission/MessageSigned.js +43 -0
- package/dist/modules/messages/transmission/MessageSigned.js.map +1 -0
- package/dist/modules/relationshipTemplates/RelationshipTemplateController.d.ts +26 -0
- package/dist/modules/relationshipTemplates/RelationshipTemplateController.js +156 -0
- package/dist/modules/relationshipTemplates/RelationshipTemplateController.js.map +1 -0
- package/dist/modules/relationshipTemplates/backbone/BackboneGetRelationshipTemplates.d.ts +17 -0
- package/dist/modules/relationshipTemplates/backbone/BackboneGetRelationshipTemplates.js +3 -0
- package/dist/modules/relationshipTemplates/backbone/BackboneGetRelationshipTemplates.js.map +1 -0
- package/dist/modules/relationshipTemplates/backbone/BackbonePostRelationshipTemplates.d.ts +9 -0
- package/dist/modules/relationshipTemplates/backbone/BackbonePostRelationshipTemplates.js +3 -0
- package/dist/modules/relationshipTemplates/backbone/BackbonePostRelationshipTemplates.js.map +1 -0
- package/dist/modules/relationshipTemplates/backbone/RelationshipTemplateClient.d.ts +11 -0
- package/dist/modules/relationshipTemplates/backbone/RelationshipTemplateClient.js +20 -0
- package/dist/modules/relationshipTemplates/backbone/RelationshipTemplateClient.js.map +1 -0
- package/dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.d.ts +29 -0
- package/dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.js +80 -0
- package/dist/modules/relationshipTemplates/local/CachedRelationshipTemplate.js.map +1 -0
- package/dist/modules/relationshipTemplates/local/RelationshipTemplate.d.ts +26 -0
- package/dist/modules/relationshipTemplates/local/RelationshipTemplate.js +85 -0
- package/dist/modules/relationshipTemplates/local/RelationshipTemplate.js.map +1 -0
- package/dist/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.d.ts +14 -0
- package/dist/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.js +44 -0
- package/dist/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.js.map +1 -0
- package/dist/modules/relationshipTemplates/transmission/RelationshipTemplateContent.d.ts +16 -0
- package/dist/modules/relationshipTemplates/transmission/RelationshipTemplateContent.js +45 -0
- package/dist/modules/relationshipTemplates/transmission/RelationshipTemplateContent.js.map +1 -0
- package/dist/modules/relationshipTemplates/transmission/RelationshipTemplatePublicKey.d.ts +19 -0
- package/dist/modules/relationshipTemplates/transmission/RelationshipTemplatePublicKey.js +61 -0
- package/dist/modules/relationshipTemplates/transmission/RelationshipTemplatePublicKey.js.map +1 -0
- package/dist/modules/relationshipTemplates/transmission/RelationshipTemplateSigned.d.ts +12 -0
- package/dist/modules/relationshipTemplates/transmission/RelationshipTemplateSigned.js +39 -0
- package/dist/modules/relationshipTemplates/transmission/RelationshipTemplateSigned.js.map +1 -0
- package/dist/modules/relationships/RelationshipSecretController.d.ts +31 -0
- package/dist/modules/relationships/RelationshipSecretController.js +161 -0
- package/dist/modules/relationships/RelationshipSecretController.js.map +1 -0
- package/dist/modules/relationships/RelationshipsController.d.ts +47 -0
- package/dist/modules/relationships/RelationshipsController.js +472 -0
- package/dist/modules/relationships/RelationshipsController.js.map +1 -0
- package/dist/modules/relationships/backbone/BackboneGetRelationships.d.ts +18 -0
- package/dist/modules/relationships/backbone/BackboneGetRelationships.js +3 -0
- package/dist/modules/relationships/backbone/BackboneGetRelationships.js.map +1 -0
- package/dist/modules/relationships/backbone/BackboneGetRelationshipsChanges.d.ts +23 -0
- package/dist/modules/relationships/backbone/BackboneGetRelationshipsChanges.js +3 -0
- package/dist/modules/relationships/backbone/BackboneGetRelationshipsChanges.js.map +1 -0
- package/dist/modules/relationships/backbone/BackbonePostRelationshipsChanges.d.ts +8 -0
- package/dist/modules/relationships/backbone/BackbonePostRelationshipsChanges.js +3 -0
- package/dist/modules/relationships/backbone/BackbonePostRelationshipsChanges.js.map +1 -0
- package/dist/modules/relationships/backbone/RelationshipClient.d.ts +17 -0
- package/dist/modules/relationships/backbone/RelationshipClient.js +42 -0
- package/dist/modules/relationships/backbone/RelationshipClient.js.map +1 -0
- package/dist/modules/relationships/local/CachedRelationship.d.ts +18 -0
- package/dist/modules/relationships/local/CachedRelationship.js +53 -0
- package/dist/modules/relationships/local/CachedRelationship.js.map +1 -0
- package/dist/modules/relationships/local/Relationship.d.ts +37 -0
- package/dist/modules/relationships/local/Relationship.js +140 -0
- package/dist/modules/relationships/local/Relationship.js.map +1 -0
- package/dist/modules/relationships/local/SendRelationshipParameters.d.ts +13 -0
- package/dist/modules/relationships/local/SendRelationshipParameters.js +39 -0
- package/dist/modules/relationships/local/SendRelationshipParameters.js.map +1 -0
- package/dist/modules/relationships/transmission/RelationshipStatus.d.ts +8 -0
- package/dist/modules/relationships/transmission/RelationshipStatus.js +13 -0
- package/dist/modules/relationships/transmission/RelationshipStatus.js.map +1 -0
- package/dist/modules/relationships/transmission/changes/RelationshipChange.d.ts +27 -0
- package/dist/modules/relationships/transmission/changes/RelationshipChange.js +72 -0
- package/dist/modules/relationships/transmission/changes/RelationshipChange.js.map +1 -0
- package/dist/modules/relationships/transmission/changes/RelationshipChangeRequest.d.ts +20 -0
- package/dist/modules/relationships/transmission/changes/RelationshipChangeRequest.js +53 -0
- package/dist/modules/relationships/transmission/changes/RelationshipChangeRequest.js.map +1 -0
- package/dist/modules/relationships/transmission/changes/RelationshipChangeResponse.d.ts +20 -0
- package/dist/modules/relationships/transmission/changes/RelationshipChangeResponse.js +53 -0
- package/dist/modules/relationships/transmission/changes/RelationshipChangeResponse.js.map +1 -0
- package/dist/modules/relationships/transmission/changes/RelationshipChangeStatus.d.ts +6 -0
- package/dist/modules/relationships/transmission/changes/RelationshipChangeStatus.js +11 -0
- package/dist/modules/relationships/transmission/changes/RelationshipChangeStatus.js.map +1 -0
- package/dist/modules/relationships/transmission/changes/RelationshipChangeType.d.ts +5 -0
- package/dist/modules/relationships/transmission/changes/RelationshipChangeType.js +10 -0
- package/dist/modules/relationships/transmission/changes/RelationshipChangeType.js.map +1 -0
- package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestCipher.d.ts +13 -0
- package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestCipher.js +42 -0
- package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestCipher.js.map +1 -0
- package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestContent.d.ts +15 -0
- package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestContent.js +44 -0
- package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestContent.js.map +1 -0
- package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestSigned.d.ts +14 -0
- package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestSigned.js +44 -0
- package/dist/modules/relationships/transmission/requests/RelationshipCreationChangeRequestSigned.js.map +1 -0
- package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseCipher.d.ts +13 -0
- package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseCipher.js +42 -0
- package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseCipher.js.map +1 -0
- package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseContent.d.ts +12 -0
- package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseContent.js +38 -0
- package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseContent.js.map +1 -0
- package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseSigned.d.ts +14 -0
- package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseSigned.js +44 -0
- package/dist/modules/relationships/transmission/responses/RelationshipCreationChangeResponseSigned.js.map +1 -0
- package/dist/modules/secrets/SecretController.d.ts +39 -0
- package/dist/modules/secrets/SecretController.js +168 -0
- package/dist/modules/secrets/SecretController.js.map +1 -0
- package/dist/modules/secrets/data/SecretContainerCipher.d.ts +25 -0
- package/dist/modules/secrets/data/SecretContainerCipher.js +87 -0
- package/dist/modules/secrets/data/SecretContainerCipher.js.map +1 -0
- package/dist/modules/secrets/data/SecretContainerPlain.d.ts +25 -0
- package/dist/modules/secrets/data/SecretContainerPlain.js +76 -0
- package/dist/modules/secrets/data/SecretContainerPlain.js.map +1 -0
- package/dist/modules/sync/ChangedItems.d.ts +9 -0
- package/dist/modules/sync/ChangedItems.js +17 -0
- package/dist/modules/sync/ChangedItems.js.map +1 -0
- package/dist/modules/sync/DatawalletModificationMapper.d.ts +7 -0
- package/dist/modules/sync/DatawalletModificationMapper.js +62 -0
- package/dist/modules/sync/DatawalletModificationMapper.js.map +1 -0
- package/dist/modules/sync/DatawalletModificationsProcessor.d.ts +21 -0
- package/dist/modules/sync/DatawalletModificationsProcessor.js +111 -0
- package/dist/modules/sync/DatawalletModificationsProcessor.js.map +1 -0
- package/dist/modules/sync/ExternalEventsProcessor.d.ts +19 -0
- package/dist/modules/sync/ExternalEventsProcessor.js +83 -0
- package/dist/modules/sync/ExternalEventsProcessor.js.map +1 -0
- package/dist/modules/sync/SyncController.d.ts +37 -0
- package/dist/modules/sync/SyncController.js +214 -0
- package/dist/modules/sync/SyncController.js.map +1 -0
- package/dist/modules/sync/SynchronizedCollection.d.ts +18 -0
- package/dist/modules/sync/SynchronizedCollection.js +163 -0
- package/dist/modules/sync/SynchronizedCollection.js.map +1 -0
- package/dist/modules/sync/WhatToSync.d.ts +1 -0
- package/dist/modules/sync/WhatToSync.js +3 -0
- package/dist/modules/sync/WhatToSync.js.map +1 -0
- package/dist/modules/sync/backbone/BackboneDatawalletModification.d.ts +11 -0
- package/dist/modules/sync/backbone/BackboneDatawalletModification.js +3 -0
- package/dist/modules/sync/backbone/BackboneDatawalletModification.js.map +1 -0
- package/dist/modules/sync/backbone/BackboneExternalEvent.d.ts +8 -0
- package/dist/modules/sync/backbone/BackboneExternalEvent.js +3 -0
- package/dist/modules/sync/backbone/BackboneExternalEvent.js.map +1 -0
- package/dist/modules/sync/backbone/BackboneSyncRun.d.ts +9 -0
- package/dist/modules/sync/backbone/BackboneSyncRun.js +3 -0
- package/dist/modules/sync/backbone/BackboneSyncRun.js.map +1 -0
- package/dist/modules/sync/backbone/CreateDatawalletModifications.d.ts +19 -0
- package/dist/modules/sync/backbone/CreateDatawalletModifications.js +3 -0
- package/dist/modules/sync/backbone/CreateDatawalletModifications.js.map +1 -0
- package/dist/modules/sync/backbone/FinalizeSyncRun.d.ts +23 -0
- package/dist/modules/sync/backbone/FinalizeSyncRun.js +3 -0
- package/dist/modules/sync/backbone/FinalizeSyncRun.js.map +1 -0
- package/dist/modules/sync/backbone/GetDatawalletModifications.d.ts +3 -0
- package/dist/modules/sync/backbone/GetDatawalletModifications.js +3 -0
- package/dist/modules/sync/backbone/GetDatawalletModifications.js.map +1 -0
- package/dist/modules/sync/backbone/StartSyncRun.d.ts +9 -0
- package/dist/modules/sync/backbone/StartSyncRun.js +9 -0
- package/dist/modules/sync/backbone/StartSyncRun.js.map +1 -0
- package/dist/modules/sync/backbone/SyncClient.d.ts +15 -0
- package/dist/modules/sync/backbone/SyncClient.js +23 -0
- package/dist/modules/sync/backbone/SyncClient.js.map +1 -0
- package/dist/modules/sync/local/DatawalletModification.d.ts +30 -0
- package/dist/modules/sync/local/DatawalletModification.js +71 -0
- package/dist/modules/sync/local/DatawalletModification.js.map +1 -0
- package/dist/modules/tokens/AnonymousTokenController.d.ts +11 -0
- package/dist/modules/tokens/AnonymousTokenController.js +47 -0
- package/dist/modules/tokens/AnonymousTokenController.js.map +1 -0
- package/dist/modules/tokens/TokenController.d.ts +24 -0
- package/dist/modules/tokens/TokenController.js +137 -0
- package/dist/modules/tokens/TokenController.js.map +1 -0
- package/dist/modules/tokens/backbone/AnonymousTokenClient.d.ts +6 -0
- package/dist/modules/tokens/backbone/AnonymousTokenClient.js +11 -0
- package/dist/modules/tokens/backbone/AnonymousTokenClient.js.map +1 -0
- package/dist/modules/tokens/backbone/BackboneGetTokens.d.ts +11 -0
- package/dist/modules/tokens/backbone/BackboneGetTokens.js +3 -0
- package/dist/modules/tokens/backbone/BackboneGetTokens.js.map +1 -0
- package/dist/modules/tokens/backbone/BackbonePostTokens.d.ts +9 -0
- package/dist/modules/tokens/backbone/BackbonePostTokens.js +3 -0
- package/dist/modules/tokens/backbone/BackbonePostTokens.js.map +1 -0
- package/dist/modules/tokens/backbone/TokenClient.d.ts +11 -0
- package/dist/modules/tokens/backbone/TokenClient.js +20 -0
- package/dist/modules/tokens/backbone/TokenClient.js.map +1 -0
- package/dist/modules/tokens/local/CachedToken.d.ts +18 -0
- package/dist/modules/tokens/local/CachedToken.js +53 -0
- package/dist/modules/tokens/local/CachedToken.js.map +1 -0
- package/dist/modules/tokens/local/SendTokenParameters.d.ts +14 -0
- package/dist/modules/tokens/local/SendTokenParameters.js +43 -0
- package/dist/modules/tokens/local/SendTokenParameters.js.map +1 -0
- package/dist/modules/tokens/local/Token.d.ts +28 -0
- package/dist/modules/tokens/local/Token.js +91 -0
- package/dist/modules/tokens/local/Token.js.map +1 -0
- package/dist/modules/tokens/transmission/TokenContentDeviceSharedSecret.d.ts +10 -0
- package/dist/modules/tokens/transmission/TokenContentDeviceSharedSecret.js +34 -0
- package/dist/modules/tokens/transmission/TokenContentDeviceSharedSecret.js.map +1 -0
- package/dist/modules/tokens/transmission/TokenContentFile.d.ts +12 -0
- package/dist/modules/tokens/transmission/TokenContentFile.js +39 -0
- package/dist/modules/tokens/transmission/TokenContentFile.js.map +1 -0
- package/dist/modules/tokens/transmission/TokenContentRelationshipTemplate.d.ts +12 -0
- package/dist/modules/tokens/transmission/TokenContentRelationshipTemplate.js +39 -0
- package/dist/modules/tokens/transmission/TokenContentRelationshipTemplate.js.map +1 -0
- package/dist/modules/tokens/transmission/TokenReference.d.ts +14 -0
- package/dist/modules/tokens/transmission/TokenReference.js +71 -0
- package/dist/modules/tokens/transmission/TokenReference.js.map +1 -0
- package/dist/util/PasswordGenerator.d.ts +28 -0
- package/dist/util/PasswordGenerator.js +179 -0
- package/dist/util/PasswordGenerator.js.map +1 -0
- package/dist/util/Random.d.ts +50 -0
- package/dist/util/Random.js +129 -0
- package/dist/util/Random.js.map +1 -0
- package/dist/util/index.d.ts +2 -0
- package/dist/util/index.js +15 -0
- package/dist/util/index.js.map +1 -0
- package/lib-web/nmshd.transport.js +54733 -0
- package/lib-web/nmshd.transport.js.map +1 -0
- package/lib-web/nmshd.transport.min.js +3 -0
- package/lib-web/nmshd.transport.min.js.map +1 -0
- package/package.json +109 -0
- package/ui5.yaml +9 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RelationshipTemplate.js","sourceRoot":"","sources":["../../../../src/modules/relationshipTemplates/local/RelationshipTemplate.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAA8D;AAC9D,0CAAiE;AACjE,uDAAyC;AACzC,wCAAuE;AACvE,2DAAkE;AAClE,6EAAsG;AAYtG,IAAa,oBAAoB,4BAAjC,MAAa,oBAAqB,SAAQ,yBAAkB;IAA5D;;QACoB,wBAAmB,GAAG;YAClC,OAAO;YACP,UAAU;YACV,IAAA,yBAAM,EAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;YAChD,IAAA,yBAAM,EAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;SAC/C,CAAA;QAEe,uBAAkB,GAAG;YACjC,IAAA,yBAAM,EAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;YAC/C,IAAA,yBAAM,EAAuB,CAAC,CAAC,E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IAAI,EAAE,CAAC;IAC5B,IAAA,qBAAS,GAAE;8BACgB,mBAAQ;gEAAA;AAnC3B,oBAAoB;IADhC,IAAA,gBAAI,EAAC,sBAAsB,CAAC;GAChB,oBAAoB,CAwDhC;AAxDY,oDAAoB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ISerializableAsync, SerializableAsync } from "@js-soft/ts-serval";
|
|
2
|
+
import { CoreDate, CoreSerializableAsync, ICoreSerializableAsync } from "../../../core";
|
|
3
|
+
export interface ISendRelationshipTemplateParameters extends ICoreSerializableAsync {
|
|
4
|
+
content: ISerializableAsync;
|
|
5
|
+
expiresAt: CoreDate;
|
|
6
|
+
maxNumberOfRelationships?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class SendRelationshipTemplateParameters extends CoreSerializableAsync implements ISendRelationshipTemplateParameters {
|
|
9
|
+
content: SerializableAsync;
|
|
10
|
+
expiresAt: CoreDate;
|
|
11
|
+
maxNumberOfRelationships?: number;
|
|
12
|
+
static from(value: ISendRelationshipTemplateParameters): Promise<SendRelationshipTemplateParameters>;
|
|
13
|
+
static deserialize(value: string): Promise<SendRelationshipTemplateParameters>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var SendRelationshipTemplateParameters_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.SendRelationshipTemplateParameters = void 0;
|
|
14
|
+
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
15
|
+
const core_1 = require("../../../core");
|
|
16
|
+
const CachedRelationshipTemplate_1 = require("./CachedRelationshipTemplate");
|
|
17
|
+
let SendRelationshipTemplateParameters = SendRelationshipTemplateParameters_1 = class SendRelationshipTemplateParameters extends core_1.CoreSerializableAsync {
|
|
18
|
+
static async from(value) {
|
|
19
|
+
return await super.fromT(value, SendRelationshipTemplateParameters_1);
|
|
20
|
+
}
|
|
21
|
+
static async deserialize(value) {
|
|
22
|
+
return await super.deserializeT(value, SendRelationshipTemplateParameters_1);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, ts_serval_1.validate)(),
|
|
27
|
+
(0, ts_serval_1.serialize)(),
|
|
28
|
+
__metadata("design:type", ts_serval_1.SerializableAsync)
|
|
29
|
+
], SendRelationshipTemplateParameters.prototype, "content", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, ts_serval_1.validate)(),
|
|
32
|
+
(0, ts_serval_1.serialize)(),
|
|
33
|
+
__metadata("design:type", core_1.CoreDate)
|
|
34
|
+
], SendRelationshipTemplateParameters.prototype, "expiresAt", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, ts_serval_1.validate)({ nullable: true, customValidator: CachedRelationshipTemplate_1.CachedRelationshipTemplate.validateMaxNumberOfRelationships }),
|
|
37
|
+
(0, ts_serval_1.serialize)(),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], SendRelationshipTemplateParameters.prototype, "maxNumberOfRelationships", void 0);
|
|
40
|
+
SendRelationshipTemplateParameters = SendRelationshipTemplateParameters_1 = __decorate([
|
|
41
|
+
(0, ts_serval_1.type)("SendRelationshipTemplateParameters")
|
|
42
|
+
], SendRelationshipTemplateParameters);
|
|
43
|
+
exports.SendRelationshipTemplateParameters = SendRelationshipTemplateParameters;
|
|
44
|
+
//# sourceMappingURL=SendRelationshipTemplateParameters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SendRelationshipTemplateParameters.js","sourceRoot":"","sources":["../../../../src/modules/relationshipTemplates/local/SendRelationshipTemplateParameters.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAAqG;AACrG,wCAAuF;AACvF,6EAAyE;AASzE,IAAa,kCAAkC,0CAA/C,MAAa,kCACT,SAAQ,4BAAqB;IAetB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAA0C;QAC/D,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,oCAAkC,CAAC,CAAA;IACvE,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAa;QACzC,OAAO,MAAM,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,oCAAkC,CAAC,CAAA;IAC9E,CAAC;CACJ,CAAA;AAjBG;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACI,6BAAiB;mEAAA;AAIjC;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACM,eAAQ;qEAAA;AAI1B;IAFC,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE,uDAA0B,CAAC,gCAAgC,EAAE,CAAC;IAC1G,IAAA,qBAAS,GAAE;;oFAC4B;AAd/B,kCAAkC;IAD9C,IAAA,gBAAI,EAAC,oCAAoC,CAAC;GAC9B,kCAAkC,CAuB9C;AAvBY,gFAAkC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ISerializableAsync, SerializableAsync } from "@js-soft/ts-serval";
|
|
2
|
+
import { CoreSerializableAsync, ICoreSerializableAsync } from "../../../core";
|
|
3
|
+
import { Identity, IIdentity } from "../../accounts/data/Identity";
|
|
4
|
+
import { IRelationshipTemplatePublicKey, RelationshipTemplatePublicKey } from "./RelationshipTemplatePublicKey";
|
|
5
|
+
export interface IRelationshipTemplateContent extends ICoreSerializableAsync {
|
|
6
|
+
identity: IIdentity;
|
|
7
|
+
templateKey: IRelationshipTemplatePublicKey;
|
|
8
|
+
content: ISerializableAsync;
|
|
9
|
+
}
|
|
10
|
+
export declare class RelationshipTemplateContent extends CoreSerializableAsync implements IRelationshipTemplateContent {
|
|
11
|
+
identity: Identity;
|
|
12
|
+
templateKey: RelationshipTemplatePublicKey;
|
|
13
|
+
content: SerializableAsync;
|
|
14
|
+
static from(value: IRelationshipTemplateContent): Promise<RelationshipTemplateContent>;
|
|
15
|
+
static deserialize(value: string): Promise<RelationshipTemplateContent>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var RelationshipTemplateContent_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.RelationshipTemplateContent = void 0;
|
|
14
|
+
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
15
|
+
const core_1 = require("../../../core");
|
|
16
|
+
const Identity_1 = require("../../accounts/data/Identity");
|
|
17
|
+
const RelationshipTemplatePublicKey_1 = require("./RelationshipTemplatePublicKey");
|
|
18
|
+
let RelationshipTemplateContent = RelationshipTemplateContent_1 = class RelationshipTemplateContent extends core_1.CoreSerializableAsync {
|
|
19
|
+
static async from(value) {
|
|
20
|
+
return await super.fromT(value, RelationshipTemplateContent_1);
|
|
21
|
+
}
|
|
22
|
+
static async deserialize(value) {
|
|
23
|
+
return await super.deserializeT(value, RelationshipTemplateContent_1);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, ts_serval_1.validate)(),
|
|
28
|
+
(0, ts_serval_1.serialize)(),
|
|
29
|
+
__metadata("design:type", Identity_1.Identity)
|
|
30
|
+
], RelationshipTemplateContent.prototype, "identity", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, ts_serval_1.validate)(),
|
|
33
|
+
(0, ts_serval_1.serialize)(),
|
|
34
|
+
__metadata("design:type", RelationshipTemplatePublicKey_1.RelationshipTemplatePublicKey)
|
|
35
|
+
], RelationshipTemplateContent.prototype, "templateKey", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, ts_serval_1.validate)(),
|
|
38
|
+
(0, ts_serval_1.serialize)(),
|
|
39
|
+
__metadata("design:type", ts_serval_1.SerializableAsync)
|
|
40
|
+
], RelationshipTemplateContent.prototype, "content", void 0);
|
|
41
|
+
RelationshipTemplateContent = RelationshipTemplateContent_1 = __decorate([
|
|
42
|
+
(0, ts_serval_1.type)("RelationshipTemplateContent")
|
|
43
|
+
], RelationshipTemplateContent);
|
|
44
|
+
exports.RelationshipTemplateContent = RelationshipTemplateContent;
|
|
45
|
+
//# sourceMappingURL=RelationshipTemplateContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RelationshipTemplateContent.js","sourceRoot":"","sources":["../../../../src/modules/relationshipTemplates/transmission/RelationshipTemplateContent.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAAqG;AACrG,wCAA6E;AAC7E,2DAAkE;AAClE,mFAA+G;AAS/G,IAAa,2BAA2B,mCAAxC,MAAa,2BAA4B,SAAQ,4BAAqB;IAa3D,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAmC;QACxD,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,6BAA2B,CAAC,CAAA;IAChE,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAa;QACzC,OAAO,MAAM,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,6BAA2B,CAAC,CAAA;IACvE,CAAC;CACJ,CAAA;AAjBG;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACK,mBAAQ;6DAAA;AAIzB;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACQ,6DAA6B;gEAAA;AAIjD;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACI,6BAAiB;4DAAA;AAXxB,2BAA2B;IADvC,IAAA,gBAAI,EAAC,6BAA6B,CAAC;GACvB,2BAA2B,CAoBvC;AApBY,kEAA2B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ISerialized } from "@js-soft/ts-serval";
|
|
2
|
+
import { CoreBuffer, CryptoExchangeAlgorithm, CryptoExchangePublicKey, ICryptoExchangePublicKey, ICryptoExchangePublicKeySerialized } from "@nmshd/crypto";
|
|
3
|
+
import { CoreId, ICoreId } from "../../../core";
|
|
4
|
+
export interface IRelationshipTemplatePublicKey extends ICryptoExchangePublicKey {
|
|
5
|
+
id: ICoreId;
|
|
6
|
+
}
|
|
7
|
+
export interface IRelationshipTemplatePublicKeySerialized extends ICryptoExchangePublicKeySerialized, ISerialized {
|
|
8
|
+
id: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class RelationshipTemplatePublicKey extends CryptoExchangePublicKey implements IRelationshipTemplatePublicKey {
|
|
11
|
+
id: CoreId;
|
|
12
|
+
constructor(id: CoreId, algorithm: CryptoExchangeAlgorithm, publicKey: CoreBuffer);
|
|
13
|
+
toJSON(verbose?: boolean): IRelationshipTemplatePublicKeySerialized;
|
|
14
|
+
toBase64(): string;
|
|
15
|
+
serialize(verbose?: boolean): string;
|
|
16
|
+
static fromJSON(value: IRelationshipTemplatePublicKeySerialized): Promise<RelationshipTemplatePublicKey>;
|
|
17
|
+
static from(value: IRelationshipTemplatePublicKey): Promise<RelationshipTemplatePublicKey>;
|
|
18
|
+
static deserialize(value: string): Promise<RelationshipTemplatePublicKey>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var RelationshipTemplatePublicKey_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.RelationshipTemplatePublicKey = void 0;
|
|
14
|
+
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
15
|
+
const crypto_1 = require("@nmshd/crypto");
|
|
16
|
+
const core_1 = require("../../../core");
|
|
17
|
+
let RelationshipTemplatePublicKey = RelationshipTemplatePublicKey_1 = class RelationshipTemplatePublicKey extends crypto_1.CryptoExchangePublicKey {
|
|
18
|
+
constructor(id, algorithm, publicKey) {
|
|
19
|
+
super(algorithm, publicKey);
|
|
20
|
+
this.id = id;
|
|
21
|
+
}
|
|
22
|
+
toJSON(verbose = true) {
|
|
23
|
+
const obj = {
|
|
24
|
+
id: this.id.toString(),
|
|
25
|
+
pub: this.publicKey.toBase64URL(),
|
|
26
|
+
alg: this.algorithm
|
|
27
|
+
};
|
|
28
|
+
if (verbose) {
|
|
29
|
+
obj["@type"] = "RelationshipTemplatePublicKey";
|
|
30
|
+
}
|
|
31
|
+
return obj;
|
|
32
|
+
}
|
|
33
|
+
toBase64() {
|
|
34
|
+
return crypto_1.CoreBuffer.utf8_base64(this.serialize());
|
|
35
|
+
}
|
|
36
|
+
serialize(verbose = true) {
|
|
37
|
+
return JSON.stringify(this.toJSON(verbose));
|
|
38
|
+
}
|
|
39
|
+
static async fromJSON(value) {
|
|
40
|
+
const key = await crypto_1.CryptoExchangePublicKey.fromJSON(value);
|
|
41
|
+
return new RelationshipTemplatePublicKey_1(core_1.CoreId.from(value.id), key.algorithm, key.publicKey);
|
|
42
|
+
}
|
|
43
|
+
static from(value) {
|
|
44
|
+
return Promise.resolve(new RelationshipTemplatePublicKey_1(core_1.CoreId.from(value.id), value.algorithm, value.publicKey));
|
|
45
|
+
}
|
|
46
|
+
static async deserialize(value) {
|
|
47
|
+
const obj = JSON.parse(value);
|
|
48
|
+
return await this.fromJSON(obj);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, ts_serval_1.serialize)({ enforceString: true }),
|
|
53
|
+
(0, ts_serval_1.validate)(),
|
|
54
|
+
__metadata("design:type", core_1.CoreId)
|
|
55
|
+
], RelationshipTemplatePublicKey.prototype, "id", void 0);
|
|
56
|
+
RelationshipTemplatePublicKey = RelationshipTemplatePublicKey_1 = __decorate([
|
|
57
|
+
(0, ts_serval_1.type)("RelationshipTemplatePublicKey"),
|
|
58
|
+
__metadata("design:paramtypes", [core_1.CoreId, Number, crypto_1.CoreBuffer])
|
|
59
|
+
], RelationshipTemplatePublicKey);
|
|
60
|
+
exports.RelationshipTemplatePublicKey = RelationshipTemplatePublicKey;
|
|
61
|
+
//# sourceMappingURL=RelationshipTemplatePublicKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RelationshipTemplatePublicKey.js","sourceRoot":"","sources":["../../../../src/modules/relationshipTemplates/transmission/RelationshipTemplatePublicKey.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAA2E;AAC3E,0CAMsB;AACtB,wCAA+C;AAU/C,IAAa,6BAA6B,qCAA1C,MAAa,6BAA8B,SAAQ,gCAAuB;IAKtE,YAAmB,EAAU,EAAE,SAAkC,EAAE,SAAqB;QACpF,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;QAC3B,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IAChB,CAAC;IAEM,MAAM,CAAC,OAAO,GAAG,IAAI;QACxB,MAAM,GAAG,GAA6C;YAClD,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE;YACtB,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;YACjC,GAAG,EAAE,IAAI,CAAC,SAAS;SACtB,CAAA;QACD,IAAI,OAAO,EAAE;YACT,GAAG,CAAC,OAAO,CAAC,GAAG,+BAA+B,CAAA;SACjD;QACD,OAAO,GAAG,CAAA;IACd,CAAC;IAEM,QAAQ;QACX,OAAO,mBAAU,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAA;IACnD,CAAC;IAEM,SAAS,CAAC,OAAO,GAAG,IAAI;QAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;IAC/C,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,QAAQ,CACxB,KAA+C;QAE/C,MAAM,GAAG,GAAG,MAAM,gCAAuB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QAEzD,OAAO,IAAI,+BAA6B,CAAC,aAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,CAAA;IACjG,CAAC;IAEM,MAAM,CAAC,IAAI,CAAC,KAAqC;QACpD,OAAO,OAAO,CAAC,OAAO,CAClB,IAAI,+BAA6B,CAAC,aAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,CAC7F,CAAA;IACL,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAa;QACzC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QAC7B,OAAO,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;IACnC,CAAC;CACJ,CAAA;AA7CG;IAFC,IAAA,qBAAS,EAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;IAClC,IAAA,oBAAQ,GAAE;8BACA,aAAM;yDAAA;AAHR,6BAA6B;IADzC,IAAA,gBAAI,EAAC,+BAA+B,CAAC;qCAMX,aAAM,UAAiD,mBAAU;GAL/E,6BAA6B,CAgDzC;AAhDY,sEAA6B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CryptoSignature, ICryptoSignature } from "@nmshd/crypto";
|
|
2
|
+
import { CoreSerializableAsync, ICoreSerializableAsync } from "../../../core";
|
|
3
|
+
export interface IRelationshipTemplateSigned extends ICoreSerializableAsync {
|
|
4
|
+
serializedTemplate: string;
|
|
5
|
+
deviceSignature: ICryptoSignature;
|
|
6
|
+
}
|
|
7
|
+
export declare class RelationshipTemplateSigned extends CoreSerializableAsync implements IRelationshipTemplateSigned {
|
|
8
|
+
serializedTemplate: string;
|
|
9
|
+
deviceSignature: CryptoSignature;
|
|
10
|
+
static from(value: IRelationshipTemplateSigned): Promise<RelationshipTemplateSigned>;
|
|
11
|
+
static deserialize(value: string): Promise<RelationshipTemplateSigned>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var RelationshipTemplateSigned_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.RelationshipTemplateSigned = void 0;
|
|
14
|
+
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
15
|
+
const crypto_1 = require("@nmshd/crypto");
|
|
16
|
+
const core_1 = require("../../../core");
|
|
17
|
+
let RelationshipTemplateSigned = RelationshipTemplateSigned_1 = class RelationshipTemplateSigned extends core_1.CoreSerializableAsync {
|
|
18
|
+
static async from(value) {
|
|
19
|
+
return await super.fromT(value, RelationshipTemplateSigned_1);
|
|
20
|
+
}
|
|
21
|
+
static async deserialize(value) {
|
|
22
|
+
return await super.deserializeT(value, RelationshipTemplateSigned_1);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, ts_serval_1.validate)(),
|
|
27
|
+
(0, ts_serval_1.serialize)(),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], RelationshipTemplateSigned.prototype, "serializedTemplate", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, ts_serval_1.validate)(),
|
|
32
|
+
(0, ts_serval_1.serialize)(),
|
|
33
|
+
__metadata("design:type", crypto_1.CryptoSignature)
|
|
34
|
+
], RelationshipTemplateSigned.prototype, "deviceSignature", void 0);
|
|
35
|
+
RelationshipTemplateSigned = RelationshipTemplateSigned_1 = __decorate([
|
|
36
|
+
(0, ts_serval_1.type)("RelationshipTemplateSigned")
|
|
37
|
+
], RelationshipTemplateSigned);
|
|
38
|
+
exports.RelationshipTemplateSigned = RelationshipTemplateSigned;
|
|
39
|
+
//# sourceMappingURL=RelationshipTemplateSigned.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RelationshipTemplateSigned.js","sourceRoot":"","sources":["../../../../src/modules/relationshipTemplates/transmission/RelationshipTemplateSigned.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAA8D;AAC9D,0CAAiE;AACjE,wCAA6E;AAQ7E,IAAa,0BAA0B,kCAAvC,MAAa,0BAA2B,SAAQ,4BAAqB;IAS1D,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAkC;QACvD,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,4BAA0B,CAAC,CAAA;IAC/D,CAAC;IAEM,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,KAAa;QACzC,OAAO,MAAM,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,4BAA0B,CAAC,CAAA;IACtE,CAAC;CACJ,CAAA;AAbG;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;;sEACqB;AAIjC;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACY,wBAAe;mEAAA;AAP9B,0BAA0B;IADtC,IAAA,gBAAI,EAAC,4BAA4B,CAAC;GACtB,0BAA0B,CAgBtC;AAhBY,gEAA0B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Serializable, SerializableAsync } from "@js-soft/ts-serval";
|
|
2
|
+
import { CoreBuffer, CryptoCipher, CryptoRelationshipPublicRequest, CryptoRelationshipPublicResponse, CryptoSecretKey, CryptoSignature, CryptoSignaturePublicKey } from "@nmshd/crypto";
|
|
3
|
+
import { CoreId } from "../../core";
|
|
4
|
+
import { AccountController } from "../accounts/AccountController";
|
|
5
|
+
import { Identity } from "../accounts/data/Identity";
|
|
6
|
+
import { CachedRelationshipTemplate } from "../relationshipTemplates/local/CachedRelationshipTemplate";
|
|
7
|
+
import { RelationshipTemplatePublicKey } from "../relationshipTemplates/transmission/RelationshipTemplatePublicKey";
|
|
8
|
+
import { SecretContainerCipher } from "../secrets/data/SecretContainerCipher";
|
|
9
|
+
import { SecretController } from "../secrets/SecretController";
|
|
10
|
+
export declare class RelationshipSecretController extends SecretController {
|
|
11
|
+
private readonly cache;
|
|
12
|
+
constructor(parent: AccountController);
|
|
13
|
+
private getSecret;
|
|
14
|
+
createRequestorSecrets(template: CachedRelationshipTemplate, relationshipSecretId: CoreId): Promise<CryptoRelationshipPublicRequest>;
|
|
15
|
+
createTemplatorSecrets(relationshipSecretId: CoreId, template: CachedRelationshipTemplate, publicRequestCrypto: CryptoRelationshipPublicRequest): Promise<SecretContainerCipher>;
|
|
16
|
+
getPublicResponse(relationshipSecretId: CoreId): Promise<CryptoRelationshipPublicResponse>;
|
|
17
|
+
convertSecrets(relationshipSecretId: CoreId, response: CryptoRelationshipPublicResponse): Promise<SecretContainerCipher>;
|
|
18
|
+
deleteSecretForRequest(peerIdentity: Identity): Promise<boolean>;
|
|
19
|
+
decryptTemplate(cipher: CryptoCipher, secretKey: CryptoSecretKey): Promise<CoreBuffer>;
|
|
20
|
+
verifyTemplate(buffer: CoreBuffer, signature: CryptoSignature, templatorDeviceKey: CryptoSignaturePublicKey): Promise<boolean>;
|
|
21
|
+
encryptRequest(relationshipSecretId: CoreId, content: SerializableAsync | Serializable | string | CoreBuffer): Promise<CryptoCipher>;
|
|
22
|
+
encrypt(relationshipSecretId: CoreId, content: SerializableAsync | Serializable | string): Promise<CryptoCipher>;
|
|
23
|
+
decryptRequest(relationshipSecretId: CoreId, cipher: CryptoCipher): Promise<CoreBuffer>;
|
|
24
|
+
createTemplateKey(): Promise<RelationshipTemplatePublicKey>;
|
|
25
|
+
decryptPeer(relationshipSecretId: CoreId, cipher: CryptoCipher, omitCounterCheck?: boolean): Promise<CoreBuffer>;
|
|
26
|
+
hasCryptoRelationshipSecrets(relationshipSecretId: CoreId): Promise<boolean>;
|
|
27
|
+
decryptOwn(relationshipSecretId: CoreId, cipher: CryptoCipher): Promise<CoreBuffer>;
|
|
28
|
+
sign(relationshipSecretId: CoreId, content: SerializableAsync | Serializable | string | CoreBuffer): Promise<CryptoSignature>;
|
|
29
|
+
verifyOwn(relationshipSecretId: CoreId, content: SerializableAsync | Serializable | string | CoreBuffer, signature: CryptoSignature): Promise<boolean>;
|
|
30
|
+
verifyPeer(relationshipSecretId: CoreId, content: SerializableAsync | Serializable | string | CoreBuffer, signature: CryptoSignature): Promise<boolean>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RelationshipSecretController = void 0;
|
|
4
|
+
const crypto_1 = require("@nmshd/crypto");
|
|
5
|
+
const core_1 = require("../../core");
|
|
6
|
+
const CoreIds_1 = require("../../core/CoreIds");
|
|
7
|
+
const CoreUtil_1 = require("../../core/CoreUtil");
|
|
8
|
+
const TransportErrors_1 = require("../../core/TransportErrors");
|
|
9
|
+
const RelationshipTemplatePublicKey_1 = require("../relationshipTemplates/transmission/RelationshipTemplatePublicKey");
|
|
10
|
+
const SecretController_1 = require("../secrets/SecretController");
|
|
11
|
+
class RelationshipSecretController extends SecretController_1.SecretController {
|
|
12
|
+
constructor(parent) {
|
|
13
|
+
super(parent, core_1.ControllerName.RelationshipSecret);
|
|
14
|
+
this.cache = new Map();
|
|
15
|
+
}
|
|
16
|
+
async getSecret(relationshipSecretId) {
|
|
17
|
+
const secretIdAsString = relationshipSecretId.toString();
|
|
18
|
+
const cachedSecrets = this.cache.get(relationshipSecretId);
|
|
19
|
+
if (cachedSecrets) {
|
|
20
|
+
return cachedSecrets;
|
|
21
|
+
}
|
|
22
|
+
const secretContainer = await this.loadActiveSecretByName(secretIdAsString);
|
|
23
|
+
if (!secretContainer) {
|
|
24
|
+
throw TransportErrors_1.TransportErrors.general
|
|
25
|
+
.recordNotFound("CryptoRelationshipRequestSecrets | CryptoRelationshipSecrets", secretIdAsString)
|
|
26
|
+
.logWith(this._log);
|
|
27
|
+
}
|
|
28
|
+
if (!(secretContainer.secret instanceof crypto_1.CryptoRelationshipRequestSecrets) &&
|
|
29
|
+
!(secretContainer.secret instanceof crypto_1.CryptoRelationshipSecrets)) {
|
|
30
|
+
throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(secretIdAsString).logWith(this._log);
|
|
31
|
+
}
|
|
32
|
+
const secret = secretContainer.secret;
|
|
33
|
+
this.cache.set(relationshipSecretId, secret);
|
|
34
|
+
return secret;
|
|
35
|
+
}
|
|
36
|
+
async createRequestorSecrets(template, relationshipSecretId) {
|
|
37
|
+
const secrets = await crypto_1.CryptoRelationshipRequestSecrets.fromPeer(template.templateKey, template.identity.publicKey);
|
|
38
|
+
await this.storeSecret(secrets, relationshipSecretId.toString(), "");
|
|
39
|
+
const publicRequest = await secrets.toPublicRequest();
|
|
40
|
+
return publicRequest;
|
|
41
|
+
}
|
|
42
|
+
async createTemplatorSecrets(relationshipSecretId, template, publicRequestCrypto) {
|
|
43
|
+
const templateKeyId = template.templateKey.id.toString();
|
|
44
|
+
const exchangeKeypairContainer = await this.loadActiveSecretByName(templateKeyId);
|
|
45
|
+
if (!exchangeKeypairContainer) {
|
|
46
|
+
throw TransportErrors_1.TransportErrors.general.recordNotFound(crypto_1.CryptoExchangeKeypair, templateKeyId).logWith(this._log);
|
|
47
|
+
}
|
|
48
|
+
if (!(exchangeKeypairContainer.secret instanceof crypto_1.CryptoExchangeKeypair)) {
|
|
49
|
+
throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(templateKeyId).logWith(this._log);
|
|
50
|
+
}
|
|
51
|
+
const exchangeKeypair = exchangeKeypairContainer.secret;
|
|
52
|
+
const secrets = await crypto_1.CryptoRelationshipSecrets.fromRelationshipRequest(publicRequestCrypto, exchangeKeypair);
|
|
53
|
+
const secretContainer = await this.storeSecret(secrets, relationshipSecretId.toString());
|
|
54
|
+
return secretContainer;
|
|
55
|
+
}
|
|
56
|
+
async getPublicResponse(relationshipSecretId) {
|
|
57
|
+
const secret = await this.loadActiveSecretByName(relationshipSecretId.toString());
|
|
58
|
+
if (!secret) {
|
|
59
|
+
throw TransportErrors_1.TransportErrors.general
|
|
60
|
+
.recordNotFound(crypto_1.CryptoRelationshipSecrets, relationshipSecretId.toString())
|
|
61
|
+
.logWith(this._log);
|
|
62
|
+
}
|
|
63
|
+
if (!(secret.secret instanceof crypto_1.CryptoRelationshipSecrets)) {
|
|
64
|
+
throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(secret.id.toString()).logWith(this._log);
|
|
65
|
+
}
|
|
66
|
+
const publicResponse = await secret.secret.toPublicResponse();
|
|
67
|
+
return publicResponse;
|
|
68
|
+
}
|
|
69
|
+
async convertSecrets(relationshipSecretId, response) {
|
|
70
|
+
const request = await this.getSecret(relationshipSecretId);
|
|
71
|
+
if (request instanceof crypto_1.CryptoRelationshipSecrets) {
|
|
72
|
+
throw TransportErrors_1.TransportErrors.secrets.wrongSecretType().logWith(this._log);
|
|
73
|
+
}
|
|
74
|
+
const secrets = await crypto_1.CryptoRelationshipSecrets.fromRelationshipResponse(response, request);
|
|
75
|
+
const container = await this.succeedSecretWithName(secrets, relationshipSecretId.toString());
|
|
76
|
+
this.cache.set(relationshipSecretId, secrets);
|
|
77
|
+
return container;
|
|
78
|
+
}
|
|
79
|
+
async deleteSecretForRequest(peerIdentity) {
|
|
80
|
+
const secret = await this.loadActiveSecretByName(`request_to_${peerIdentity.address}`);
|
|
81
|
+
if (!secret) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return await this.deleteSecretById(secret.id);
|
|
85
|
+
}
|
|
86
|
+
async decryptTemplate(cipher, secretKey) {
|
|
87
|
+
const decrypted = await core_1.CoreCrypto.decrypt(cipher, secretKey);
|
|
88
|
+
return decrypted;
|
|
89
|
+
}
|
|
90
|
+
async verifyTemplate(buffer, signature, templatorDeviceKey) {
|
|
91
|
+
return await core_1.CoreCrypto.verify(buffer, signature, templatorDeviceKey);
|
|
92
|
+
}
|
|
93
|
+
async encryptRequest(relationshipSecretId, content) {
|
|
94
|
+
const buffer = CoreUtil_1.CoreUtil.toBuffer(content);
|
|
95
|
+
const secrets = await this.getSecret(relationshipSecretId);
|
|
96
|
+
if (!(secrets instanceof crypto_1.CryptoRelationshipRequestSecrets)) {
|
|
97
|
+
throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(secrets.id).logWith(this._log);
|
|
98
|
+
}
|
|
99
|
+
return await secrets.encryptRequest(buffer);
|
|
100
|
+
}
|
|
101
|
+
async encrypt(relationshipSecretId, content) {
|
|
102
|
+
const buffer = CoreUtil_1.CoreUtil.toBuffer(content);
|
|
103
|
+
const secrets = await this.getSecret(relationshipSecretId);
|
|
104
|
+
if (!(secrets instanceof crypto_1.CryptoRelationshipSecrets)) {
|
|
105
|
+
throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(secrets.id).logWith(this._log);
|
|
106
|
+
}
|
|
107
|
+
return await secrets.encrypt(buffer);
|
|
108
|
+
}
|
|
109
|
+
async decryptRequest(relationshipSecretId, cipher) {
|
|
110
|
+
const secrets = await this.getSecret(relationshipSecretId);
|
|
111
|
+
if (!(secrets instanceof crypto_1.CryptoRelationshipRequestSecrets) && !(secrets instanceof crypto_1.CryptoRelationshipSecrets)) {
|
|
112
|
+
throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(relationshipSecretId.toString()).logWith(this._log);
|
|
113
|
+
}
|
|
114
|
+
return await secrets.decryptRequest(cipher);
|
|
115
|
+
}
|
|
116
|
+
async createTemplateKey() {
|
|
117
|
+
const templateKeyId = await CoreIds_1.TransportIds.relationshipTemplateKey.generate();
|
|
118
|
+
const key = await this.createExchangeKey(`${templateKeyId.toString()}`);
|
|
119
|
+
const publicKey = key[0];
|
|
120
|
+
return new RelationshipTemplatePublicKey_1.RelationshipTemplatePublicKey(templateKeyId, publicKey.algorithm, publicKey.publicKey);
|
|
121
|
+
}
|
|
122
|
+
async decryptPeer(relationshipSecretId, cipher, omitCounterCheck = false) {
|
|
123
|
+
const secrets = await this.getSecret(relationshipSecretId);
|
|
124
|
+
if (!(secrets instanceof crypto_1.CryptoRelationshipSecrets)) {
|
|
125
|
+
throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(secrets.id).logWith(this._log);
|
|
126
|
+
}
|
|
127
|
+
return await secrets.decryptPeer(cipher, omitCounterCheck);
|
|
128
|
+
}
|
|
129
|
+
async hasCryptoRelationshipSecrets(relationshipSecretId) {
|
|
130
|
+
const secrets = await this.getSecret(relationshipSecretId);
|
|
131
|
+
return secrets instanceof crypto_1.CryptoRelationshipSecrets;
|
|
132
|
+
}
|
|
133
|
+
async decryptOwn(relationshipSecretId, cipher) {
|
|
134
|
+
const secrets = await this.getSecret(relationshipSecretId);
|
|
135
|
+
if (!(secrets instanceof crypto_1.CryptoRelationshipSecrets)) {
|
|
136
|
+
throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(secrets.id).logWith(this._log);
|
|
137
|
+
}
|
|
138
|
+
return await secrets.decryptOwn(cipher);
|
|
139
|
+
}
|
|
140
|
+
async sign(relationshipSecretId, content) {
|
|
141
|
+
const bufferToSign = CoreUtil_1.CoreUtil.toBuffer(content);
|
|
142
|
+
const secrets = await this.getSecret(relationshipSecretId);
|
|
143
|
+
return await secrets.sign(bufferToSign);
|
|
144
|
+
}
|
|
145
|
+
async verifyOwn(relationshipSecretId, content, signature) {
|
|
146
|
+
const bufferToVerify = CoreUtil_1.CoreUtil.toBuffer(content);
|
|
147
|
+
const secrets = await this.getSecret(relationshipSecretId);
|
|
148
|
+
return await secrets.verifyOwn(bufferToVerify, signature);
|
|
149
|
+
}
|
|
150
|
+
async verifyPeer(relationshipSecretId, content, signature) {
|
|
151
|
+
const bufferToVerify = CoreUtil_1.CoreUtil.toBuffer(content);
|
|
152
|
+
const secrets = await this.getSecret(relationshipSecretId);
|
|
153
|
+
if (secrets instanceof crypto_1.CryptoRelationshipRequestSecrets) {
|
|
154
|
+
throw TransportErrors_1.TransportErrors.secrets.wrongSecretType(secrets.id).logWith(this._log);
|
|
155
|
+
}
|
|
156
|
+
const valid = await secrets.verifyPeer(bufferToVerify, signature);
|
|
157
|
+
return valid;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
exports.RelationshipSecretController = RelationshipSecretController;
|
|
161
|
+
//# sourceMappingURL=RelationshipSecretController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RelationshipSecretController.js","sourceRoot":"","sources":["../../../src/modules/relationships/RelationshipSecretController.ts"],"names":[],"mappings":";;;AACA,0CAWsB;AACtB,qCAA+D;AAC/D,gDAAiD;AACjD,kDAA8C;AAC9C,gEAA4D;AAI5D,uHAAmH;AAEnH,kEAA8D;AAE9D,MAAa,4BAA6B,SAAQ,mCAAgB;IAM9D,YAAmB,MAAyB;QACxC,KAAK,CAAC,MAAM,EAAE,qBAAc,CAAC,kBAAkB,CAAC,CAAA;QANnC,UAAK,GAA8E,IAAI,GAAG,EAGxG,CAAA;IAIH,CAAC;IAEO,KAAK,CAAC,SAAS,CACnB,oBAA4B;QAE5B,MAAM,gBAAgB,GAAW,oBAAoB,CAAC,QAAQ,EAAE,CAAA;QAChE,MAAM,aAAa,GAAG,IAAI,CAAC,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Ae,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;SAC/E;QAED,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,SAAS,CAAC,CAAA;QACjE,OAAO,KAAK,CAAA;IAChB,CAAC;CACJ;AA5OD,oEA4OC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ISerializableAsync } from "@js-soft/ts-serval";
|
|
2
|
+
import { CoreBuffer, CryptoSignature } from "@nmshd/crypto";
|
|
3
|
+
import { CoreAddress, CoreId, ICoreSerializable, TransportController } from "../../core";
|
|
4
|
+
import { AccountController } from "../accounts/AccountController";
|
|
5
|
+
import { BackboneGetRelationshipsChangesResponse } from "./backbone/BackboneGetRelationshipsChanges";
|
|
6
|
+
import { Relationship } from "./local/Relationship";
|
|
7
|
+
import { ISendRelationshipParameters } from "./local/SendRelationshipParameters";
|
|
8
|
+
import { RelationshipSecretController } from "./RelationshipSecretController";
|
|
9
|
+
import { RelationshipChange } from "./transmission/changes/RelationshipChange";
|
|
10
|
+
import { RelationshipStatus } from "./transmission/RelationshipStatus";
|
|
11
|
+
export declare class RelationshipsController extends TransportController {
|
|
12
|
+
private client;
|
|
13
|
+
private relationships;
|
|
14
|
+
private readonly secrets;
|
|
15
|
+
constructor(parent: AccountController, secrets: RelationshipSecretController);
|
|
16
|
+
init(): Promise<this>;
|
|
17
|
+
getRelationships(query?: any): Promise<Relationship[]>;
|
|
18
|
+
updateCache(ids: string[]): Promise<Relationship[]>;
|
|
19
|
+
private updateCacheOfExistingRelationshipInDb;
|
|
20
|
+
getRelationshipToIdentity(address: CoreAddress, status?: RelationshipStatus): Promise<Relationship | undefined>;
|
|
21
|
+
getActiveRelationshipToIdentity(address: CoreAddress): Promise<Relationship | undefined>;
|
|
22
|
+
getRelationship(id: CoreId): Promise<Relationship | undefined>;
|
|
23
|
+
sign(relationship: Relationship, content: CoreBuffer): Promise<CryptoSignature>;
|
|
24
|
+
verify(relationship: Relationship, content: CoreBuffer, signature: CryptoSignature): Promise<boolean>;
|
|
25
|
+
verifyIdentity(relationship: Relationship, content: CoreBuffer, signature: CryptoSignature): Promise<boolean>;
|
|
26
|
+
sendRelationship(parameters: ISendRelationshipParameters): Promise<Relationship>;
|
|
27
|
+
setRelationshipMetadata(idOrRelationship: CoreId | Relationship, metadata: ISerializableAsync): Promise<Relationship>;
|
|
28
|
+
requestTermination(): void;
|
|
29
|
+
acceptChange(change: RelationshipChange, content?: ICoreSerializable): Promise<Relationship>;
|
|
30
|
+
rejectChange(change: RelationshipChange, content?: ICoreSerializable): Promise<Relationship>;
|
|
31
|
+
revokeChange(change: RelationshipChange, content?: ICoreSerializable): Promise<Relationship>;
|
|
32
|
+
private updateCacheOfRelationship;
|
|
33
|
+
private prepareRequest;
|
|
34
|
+
applyChangeById(changeId: string): Promise<Relationship | undefined>;
|
|
35
|
+
applyChange(change: BackboneGetRelationshipsChangesResponse): Promise<Relationship | undefined>;
|
|
36
|
+
private applyCreationChange;
|
|
37
|
+
private parseCreationChange;
|
|
38
|
+
private decryptCreationChangeRequest;
|
|
39
|
+
private decryptCreationChangeResponse;
|
|
40
|
+
private updatePendingRelationshipWithPeerResponse;
|
|
41
|
+
private createNewRelationshipByIncomingCreationChange;
|
|
42
|
+
private applyTerminationChange;
|
|
43
|
+
private applyTerminationCancellationChange;
|
|
44
|
+
private completeChange;
|
|
45
|
+
private encryptRevokeContent;
|
|
46
|
+
private encryptAcceptRejectContent;
|
|
47
|
+
}
|