@brightchain/brightchain-lib 0.13.0 → 0.15.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/brightchain-lib/BROWSER_COMPAT.md +54 -0
- package/package.json +15 -4
- package/src/browser.d.ts +1 -1
- package/src/browser.d.ts.map +1 -1
- package/src/browser.js +3 -3
- package/src/browser.js.map +1 -1
- package/src/lib/blocks/cblBase.d.ts +16 -1
- package/src/lib/blocks/cblBase.d.ts.map +1 -1
- package/src/lib/blocks/cblBase.js +33 -4
- package/src/lib/blocks/cblBase.js.map +1 -1
- package/src/lib/blocks/encryptedBlockFactory.d.ts +6 -1
- package/src/lib/blocks/encryptedBlockFactory.d.ts.map +1 -1
- package/src/lib/blocks/encryptedBlockFactory.js +14 -5
- package/src/lib/blocks/encryptedBlockFactory.js.map +1 -1
- package/src/lib/blocks/extendedCbl.d.ts.map +1 -1
- package/src/lib/blocks/extendedCbl.js +2 -1
- package/src/lib/blocks/extendedCbl.js.map +1 -1
- package/src/lib/blocks/handle.d.ts +5 -0
- package/src/lib/blocks/handle.d.ts.map +1 -1
- package/src/lib/blocks/handle.js.map +1 -1
- package/src/lib/blocks/handleTuple.d.ts +9 -1
- package/src/lib/blocks/handleTuple.d.ts.map +1 -1
- package/src/lib/blocks/handleTuple.js +23 -1
- package/src/lib/blocks/handleTuple.js.map +1 -1
- package/src/lib/blocks/index.d.ts +1 -0
- package/src/lib/blocks/index.d.ts.map +1 -1
- package/src/lib/blocks/index.js +1 -0
- package/src/lib/blocks/index.js.map +1 -1
- package/src/lib/blocks/memoryTuple.d.ts +9 -2
- package/src/lib/blocks/memoryTuple.d.ts.map +1 -1
- package/src/lib/blocks/memoryTuple.js +12 -3
- package/src/lib/blocks/memoryTuple.js.map +1 -1
- package/src/lib/blocks/vcbl.d.ts +27 -0
- package/src/lib/blocks/vcbl.d.ts.map +1 -0
- package/src/lib/blocks/vcbl.js +107 -0
- package/src/lib/blocks/vcbl.js.map +1 -0
- package/src/lib/constants.d.ts +5 -1
- package/src/lib/constants.d.ts.map +1 -1
- package/src/lib/constants.js +4 -0
- package/src/lib/constants.js.map +1 -1
- package/src/lib/crypto/index.d.ts +12 -0
- package/src/lib/crypto/index.d.ts.map +1 -0
- package/src/lib/crypto/index.js +23 -0
- package/src/lib/crypto/index.js.map +1 -0
- package/src/lib/crypto/platformCrypto.d.ts +132 -0
- package/src/lib/crypto/platformCrypto.d.ts.map +1 -0
- package/src/lib/crypto/platformCrypto.js +181 -0
- package/src/lib/crypto/platformCrypto.js.map +1 -0
- package/src/lib/enumeration-translations/blockType.d.ts.map +1 -1
- package/src/lib/enumeration-translations/blockType.js +16 -0
- package/src/lib/enumeration-translations/blockType.js.map +1 -1
- package/src/lib/enumerations/blockType.d.ts +12 -0
- package/src/lib/enumerations/blockType.d.ts.map +1 -1
- package/src/lib/enumerations/blockType.js +14 -0
- package/src/lib/enumerations/blockType.js.map +1 -1
- package/src/lib/enumerations/brightChainStrings.d.ts +5 -1
- package/src/lib/enumerations/brightChainStrings.d.ts.map +1 -1
- package/src/lib/enumerations/brightChainStrings.js +5 -1
- package/src/lib/enumerations/brightChainStrings.js.map +1 -1
- package/src/lib/enumerations/cblErrorType.d.ts +2 -1
- package/src/lib/enumerations/cblErrorType.d.ts.map +1 -1
- package/src/lib/enumerations/cblErrorType.js +1 -0
- package/src/lib/enumerations/cblErrorType.js.map +1 -1
- package/src/lib/enumerations/communication.d.ts +57 -0
- package/src/lib/enumerations/communication.d.ts.map +1 -0
- package/src/lib/enumerations/communication.js +89 -0
- package/src/lib/enumerations/communication.js.map +1 -0
- package/src/lib/enumerations/deviceType.d.ts +15 -0
- package/src/lib/enumerations/deviceType.d.ts.map +1 -0
- package/src/lib/enumerations/deviceType.js +19 -0
- package/src/lib/enumerations/deviceType.js.map +1 -0
- package/src/lib/enumerations/handleTupleErrorType.d.ts +2 -1
- package/src/lib/enumerations/handleTupleErrorType.d.ts.map +1 -1
- package/src/lib/enumerations/handleTupleErrorType.js +1 -0
- package/src/lib/enumerations/handleTupleErrorType.js.map +1 -1
- package/src/lib/enumerations/index.d.ts +6 -0
- package/src/lib/enumerations/index.d.ts.map +1 -1
- package/src/lib/enumerations/index.js +11 -0
- package/src/lib/enumerations/index.js.map +1 -1
- package/src/lib/enumerations/messaging/deliveryStatus.d.ts +50 -0
- package/src/lib/enumerations/messaging/deliveryStatus.d.ts.map +1 -0
- package/src/lib/enumerations/messaging/deliveryStatus.js +68 -0
- package/src/lib/enumerations/messaging/deliveryStatus.js.map +1 -0
- package/src/lib/enumerations/messaging/emailErrorType.d.ts +36 -0
- package/src/lib/enumerations/messaging/emailErrorType.d.ts.map +1 -0
- package/src/lib/enumerations/messaging/emailErrorType.js +46 -0
- package/src/lib/enumerations/messaging/emailErrorType.js.map +1 -0
- package/src/lib/enumerations/messaging/index.d.ts +2 -1
- package/src/lib/enumerations/messaging/index.d.ts.map +1 -1
- package/src/lib/enumerations/messaging/index.js +2 -1
- package/src/lib/enumerations/messaging/index.js.map +1 -1
- package/src/lib/enumerations/messaging/messageEncryptionScheme.d.ts +4 -2
- package/src/lib/enumerations/messaging/messageEncryptionScheme.d.ts.map +1 -1
- package/src/lib/enumerations/messaging/messageEncryptionScheme.js +3 -1
- package/src/lib/enumerations/messaging/messageEncryptionScheme.js.map +1 -1
- package/src/lib/enumerations/paperKeyPurpose.d.ts +15 -0
- package/src/lib/enumerations/paperKeyPurpose.d.ts.map +1 -0
- package/src/lib/enumerations/paperKeyPurpose.js +19 -0
- package/src/lib/enumerations/paperKeyPurpose.js.map +1 -0
- package/src/lib/enumerations/proofPlatform.d.ts +24 -0
- package/src/lib/enumerations/proofPlatform.d.ts.map +1 -0
- package/src/lib/enumerations/proofPlatform.js +28 -0
- package/src/lib/enumerations/proofPlatform.js.map +1 -0
- package/src/lib/enumerations/readConcern.d.ts +22 -0
- package/src/lib/enumerations/readConcern.d.ts.map +1 -0
- package/src/lib/enumerations/readConcern.js +26 -0
- package/src/lib/enumerations/readConcern.js.map +1 -0
- package/src/lib/enumerations/tupleErrorType.d.ts +2 -1
- package/src/lib/enumerations/tupleErrorType.d.ts.map +1 -1
- package/src/lib/enumerations/tupleErrorType.js +1 -0
- package/src/lib/enumerations/tupleErrorType.js.map +1 -1
- package/src/lib/enumerations/verificationStatus.d.ts +17 -0
- package/src/lib/enumerations/verificationStatus.d.ts.map +1 -0
- package/src/lib/enumerations/verificationStatus.js +21 -0
- package/src/lib/enumerations/verificationStatus.js.map +1 -0
- package/src/lib/errors/blockFetchError.d.ts +51 -0
- package/src/lib/errors/blockFetchError.d.ts.map +1 -0
- package/src/lib/errors/blockFetchError.js +63 -0
- package/src/lib/errors/blockFetchError.js.map +1 -0
- package/src/lib/errors/cblError.d.ts.map +1 -1
- package/src/lib/errors/cblError.js +1 -0
- package/src/lib/errors/cblError.js.map +1 -1
- package/src/lib/errors/handleTupleError.d.ts +10 -1
- package/src/lib/errors/handleTupleError.d.ts.map +1 -1
- package/src/lib/errors/handleTupleError.js +10 -1
- package/src/lib/errors/handleTupleError.js.map +1 -1
- package/src/lib/errors/index.d.ts +16 -0
- package/src/lib/errors/index.d.ts.map +1 -1
- package/src/lib/errors/index.js +22 -0
- package/src/lib/errors/index.js.map +1 -1
- package/src/lib/errors/messaging/emailError.d.ts +55 -0
- package/src/lib/errors/messaging/emailError.d.ts.map +1 -0
- package/src/lib/errors/messaging/emailError.js +64 -0
- package/src/lib/errors/messaging/emailError.js.map +1 -0
- package/src/lib/errors/messaging/index.d.ts +1 -0
- package/src/lib/errors/messaging/index.d.ts.map +1 -1
- package/src/lib/errors/messaging/index.js +1 -0
- package/src/lib/errors/messaging/index.js.map +1 -1
- package/src/lib/errors/poolDeletionError.d.ts +10 -0
- package/src/lib/errors/poolDeletionError.d.ts.map +1 -0
- package/src/lib/errors/poolDeletionError.js +16 -0
- package/src/lib/errors/poolDeletionError.js.map +1 -0
- package/src/lib/errors/poolDeletionTombstoneError.d.ts +12 -0
- package/src/lib/errors/poolDeletionTombstoneError.d.ts.map +1 -0
- package/src/lib/errors/poolDeletionTombstoneError.js +18 -0
- package/src/lib/errors/poolDeletionTombstoneError.js.map +1 -0
- package/src/lib/errors/tupleError.d.ts.map +1 -1
- package/src/lib/errors/tupleError.js +1 -0
- package/src/lib/errors/tupleError.js.map +1 -1
- package/src/lib/i18n/i18n-setup.d.ts +7 -2
- package/src/lib/i18n/i18n-setup.d.ts.map +1 -1
- package/src/lib/i18n/i18n-setup.js +84 -24
- package/src/lib/i18n/i18n-setup.js.map +1 -1
- package/src/lib/i18n/strings/englishUs.d.ts.map +1 -1
- package/src/lib/i18n/strings/englishUs.js +4 -0
- package/src/lib/i18n/strings/englishUs.js.map +1 -1
- package/src/lib/i18n/strings/french.d.ts.map +1 -1
- package/src/lib/i18n/strings/french.js +4 -0
- package/src/lib/i18n/strings/french.js.map +1 -1
- package/src/lib/i18n/strings/german.d.ts.map +1 -1
- package/src/lib/i18n/strings/german.js +4 -0
- package/src/lib/i18n/strings/german.js.map +1 -1
- package/src/lib/i18n/strings/japanese.d.ts.map +1 -1
- package/src/lib/i18n/strings/japanese.js +4 -0
- package/src/lib/i18n/strings/japanese.js.map +1 -1
- package/src/lib/i18n/strings/mandarin.d.ts.map +1 -1
- package/src/lib/i18n/strings/mandarin.js +4 -0
- package/src/lib/i18n/strings/mandarin.js.map +1 -1
- package/src/lib/i18n/strings/spanish.d.ts.map +1 -1
- package/src/lib/i18n/strings/spanish.js +4 -0
- package/src/lib/i18n/strings/spanish.js.map +1 -1
- package/src/lib/i18n/strings/ukrainian.d.ts.map +1 -1
- package/src/lib/i18n/strings/ukrainian.js +4 -0
- package/src/lib/i18n/strings/ukrainian.js.map +1 -1
- package/src/lib/index.d.ts +4 -0
- package/src/lib/index.d.ts.map +1 -1
- package/src/lib/index.js +4 -0
- package/src/lib/index.js.map +1 -1
- package/src/lib/interfaces/auth/index.d.ts +4 -0
- package/src/lib/interfaces/auth/index.d.ts.map +1 -0
- package/src/lib/interfaces/auth/index.js +8 -0
- package/src/lib/interfaces/auth/index.js.map +1 -0
- package/src/lib/interfaces/auth/nodeAuthenticator.d.ts +19 -0
- package/src/lib/interfaces/auth/nodeAuthenticator.d.ts.map +1 -0
- package/src/lib/interfaces/auth/nodeAuthenticator.js +3 -0
- package/src/lib/interfaces/auth/nodeAuthenticator.js.map +1 -0
- package/src/lib/interfaces/auth/poolAcl.d.ts +65 -0
- package/src/lib/interfaces/auth/poolAcl.d.ts.map +1 -0
- package/src/lib/interfaces/auth/poolAcl.js +52 -0
- package/src/lib/interfaces/auth/poolAcl.js.map +1 -0
- package/src/lib/interfaces/availability/availabilityService.d.ts +5 -3
- package/src/lib/interfaces/availability/availabilityService.d.ts.map +1 -1
- package/src/lib/interfaces/availability/availabilityService.js.map +1 -1
- package/src/lib/interfaces/availability/blockRegistry.d.ts +52 -3
- package/src/lib/interfaces/availability/blockRegistry.d.ts.map +1 -1
- package/src/lib/interfaces/availability/blockRegistry.js +1 -1
- package/src/lib/interfaces/availability/discoveryProtocol.d.ts +81 -3
- package/src/lib/interfaces/availability/discoveryProtocol.d.ts.map +1 -1
- package/src/lib/interfaces/availability/discoveryProtocol.js.map +1 -1
- package/src/lib/interfaces/availability/gossipService.d.ts +279 -8
- package/src/lib/interfaces/availability/gossipService.d.ts.map +1 -1
- package/src/lib/interfaces/availability/gossipService.js +232 -0
- package/src/lib/interfaces/availability/gossipService.js.map +1 -1
- package/src/lib/interfaces/availability/index.d.ts +1 -0
- package/src/lib/interfaces/availability/index.d.ts.map +1 -1
- package/src/lib/interfaces/availability/index.js +1 -0
- package/src/lib/interfaces/availability/index.js.map +1 -1
- package/src/lib/interfaces/availability/locationRecord.d.ts +6 -0
- package/src/lib/interfaces/availability/locationRecord.d.ts.map +1 -1
- package/src/lib/interfaces/availability/locationRecord.js +12 -0
- package/src/lib/interfaces/availability/locationRecord.js.map +1 -1
- package/src/lib/interfaces/availability/poolDeletionTombstone.d.ts +40 -0
- package/src/lib/interfaces/availability/poolDeletionTombstone.d.ts.map +1 -0
- package/src/lib/interfaces/availability/poolDeletionTombstone.js +19 -0
- package/src/lib/interfaces/availability/poolDeletionTombstone.js.map +1 -0
- package/src/lib/interfaces/availability/reconciliationService.d.ts +52 -0
- package/src/lib/interfaces/availability/reconciliationService.d.ts.map +1 -1
- package/src/lib/interfaces/availability/reconciliationService.js.map +1 -1
- package/src/lib/interfaces/blockCapacity.d.ts +9 -0
- package/src/lib/interfaces/blockCapacity.d.ts.map +1 -1
- package/src/lib/interfaces/blockEncryption.d.ts +4 -2
- package/src/lib/interfaces/blockEncryption.d.ts.map +1 -1
- package/src/lib/interfaces/blockFetch/blockFetchTransport.d.ts +26 -0
- package/src/lib/interfaces/blockFetch/blockFetchTransport.d.ts.map +1 -0
- package/src/lib/interfaces/blockFetch/blockFetchTransport.js +12 -0
- package/src/lib/interfaces/blockFetch/blockFetchTransport.js.map +1 -0
- package/src/lib/interfaces/blockFetch/blockFetcher.d.ts +71 -0
- package/src/lib/interfaces/blockFetch/blockFetcher.d.ts.map +1 -0
- package/src/lib/interfaces/blockFetch/blockFetcher.js +22 -0
- package/src/lib/interfaces/blockFetch/blockFetcher.js.map +1 -0
- package/src/lib/interfaces/blockFetch/enrichedQueryResult.d.ts +43 -0
- package/src/lib/interfaces/blockFetch/enrichedQueryResult.d.ts.map +1 -0
- package/src/lib/interfaces/blockFetch/enrichedQueryResult.js +13 -0
- package/src/lib/interfaces/blockFetch/enrichedQueryResult.js.map +1 -0
- package/src/lib/interfaces/blockFetch/fetchQueue.d.ts +70 -0
- package/src/lib/interfaces/blockFetch/fetchQueue.d.ts.map +1 -0
- package/src/lib/interfaces/blockFetch/fetchQueue.js +18 -0
- package/src/lib/interfaces/blockFetch/fetchQueue.js.map +1 -0
- package/src/lib/interfaces/blockFetch/index.d.ts +10 -0
- package/src/lib/interfaces/blockFetch/index.d.ts.map +1 -0
- package/src/lib/interfaces/blockFetch/index.js +13 -0
- package/src/lib/interfaces/blockFetch/index.js.map +1 -0
- package/src/lib/interfaces/blocks/index.d.ts +1 -0
- package/src/lib/interfaces/blocks/index.d.ts.map +1 -1
- package/src/lib/interfaces/blocks/vcbl.d.ts +16 -0
- package/src/lib/interfaces/blocks/vcbl.d.ts.map +1 -0
- package/src/lib/interfaces/{messaging/messageRouter.js → blocks/vcbl.js} +1 -1
- package/src/lib/interfaces/blocks/vcbl.js.map +1 -0
- package/src/lib/interfaces/brightpass/auditLog.d.ts +25 -0
- package/src/lib/interfaces/brightpass/auditLog.d.ts.map +1 -0
- package/src/lib/interfaces/brightpass/auditLog.js +21 -0
- package/src/lib/interfaces/brightpass/auditLog.js.map +1 -0
- package/src/lib/interfaces/brightpass/emergencyAccess.d.ts +11 -0
- package/src/lib/interfaces/brightpass/emergencyAccess.d.ts.map +1 -0
- package/src/lib/interfaces/{network/networkTransport.js → brightpass/emergencyAccess.js} +1 -1
- package/src/lib/interfaces/brightpass/emergencyAccess.js.map +1 -0
- package/src/lib/interfaces/brightpass/entryPropertyRecord.d.ts +11 -0
- package/src/lib/interfaces/brightpass/entryPropertyRecord.d.ts.map +1 -0
- package/src/lib/interfaces/brightpass/entryPropertyRecord.js +3 -0
- package/src/lib/interfaces/brightpass/entryPropertyRecord.js.map +1 -0
- package/src/lib/interfaces/brightpass/importTypes.d.ts +10 -0
- package/src/lib/interfaces/brightpass/importTypes.d.ts.map +1 -0
- package/src/lib/interfaces/brightpass/importTypes.js +3 -0
- package/src/lib/interfaces/brightpass/importTypes.js.map +1 -0
- package/src/lib/interfaces/brightpass/index.d.ts +7 -0
- package/src/lib/interfaces/brightpass/index.d.ts.map +1 -0
- package/src/lib/interfaces/brightpass/index.js +10 -0
- package/src/lib/interfaces/brightpass/index.js.map +1 -0
- package/src/lib/interfaces/brightpass/vaultEntry.d.ts +48 -0
- package/src/lib/interfaces/brightpass/vaultEntry.d.ts.map +1 -0
- package/src/lib/interfaces/brightpass/vaultEntry.js +3 -0
- package/src/lib/interfaces/brightpass/vaultEntry.js.map +1 -0
- package/src/lib/interfaces/brightpass/vaultMetadata.d.ts +34 -0
- package/src/lib/interfaces/brightpass/vaultMetadata.d.ts.map +1 -0
- package/src/lib/interfaces/brightpass/vaultMetadata.js +3 -0
- package/src/lib/interfaces/brightpass/vaultMetadata.js.map +1 -0
- package/src/lib/interfaces/clusterKeys.d.ts +4 -2
- package/src/lib/interfaces/clusterKeys.d.ts.map +1 -1
- package/src/lib/interfaces/communication.d.ts +173 -0
- package/src/lib/interfaces/communication.d.ts.map +1 -0
- package/src/lib/interfaces/communication.js +17 -0
- package/src/lib/interfaces/communication.js.map +1 -0
- package/src/lib/interfaces/communicationEvents.d.ts +168 -0
- package/src/lib/interfaces/communicationEvents.d.ts.map +1 -0
- package/src/lib/interfaces/communicationEvents.js +12 -0
- package/src/lib/interfaces/communicationEvents.js.map +1 -0
- package/src/lib/interfaces/crypto/ethereumWallet.d.ts +72 -0
- package/src/lib/interfaces/crypto/ethereumWallet.d.ts.map +1 -0
- package/src/lib/interfaces/crypto/ethereumWallet.js +12 -0
- package/src/lib/interfaces/crypto/ethereumWallet.js.map +1 -0
- package/src/lib/interfaces/crypto/gitSignature.d.ts +95 -0
- package/src/lib/interfaces/crypto/gitSignature.d.ts.map +1 -0
- package/src/lib/interfaces/crypto/gitSignature.js +12 -0
- package/src/lib/interfaces/crypto/gitSignature.js.map +1 -0
- package/src/lib/interfaces/crypto/index.d.ts +3 -0
- package/src/lib/interfaces/crypto/index.d.ts.map +1 -0
- package/src/lib/interfaces/crypto/index.js +3 -0
- package/src/lib/interfaces/crypto/index.js.map +1 -0
- package/src/lib/interfaces/dataKeyComponents.d.ts +7 -2
- package/src/lib/interfaces/dataKeyComponents.d.ts.map +1 -1
- package/src/lib/interfaces/encryptedBlockCreator.d.ts +4 -2
- package/src/lib/interfaces/encryptedBlockCreator.d.ts.map +1 -1
- package/src/lib/interfaces/events/communicationEventEmitter.d.ts +65 -0
- package/src/lib/interfaces/events/communicationEventEmitter.d.ts.map +1 -0
- package/src/lib/interfaces/events/communicationEventEmitter.js +60 -0
- package/src/lib/interfaces/events/communicationEventEmitter.js.map +1 -0
- package/src/lib/interfaces/events/index.d.ts +2 -0
- package/src/lib/interfaces/events/index.d.ts.map +1 -0
- package/src/lib/interfaces/events/index.js +5 -0
- package/src/lib/interfaces/events/index.js.map +1 -0
- package/src/lib/interfaces/failableResult.d.ts +15 -0
- package/src/lib/interfaces/failableResult.d.ts.map +1 -0
- package/src/lib/interfaces/failableResult.js +3 -0
- package/src/lib/interfaces/failableResult.js.map +1 -0
- package/src/lib/interfaces/identity/device.d.ts +59 -0
- package/src/lib/interfaces/identity/device.d.ts.map +1 -0
- package/src/lib/interfaces/identity/device.js +17 -0
- package/src/lib/interfaces/identity/device.js.map +1 -0
- package/src/lib/interfaces/identity/deviceKeyStorage.d.ts +71 -0
- package/src/lib/interfaces/identity/deviceKeyStorage.d.ts.map +1 -0
- package/src/lib/interfaces/identity/deviceKeyStorage.js +16 -0
- package/src/lib/interfaces/identity/deviceKeyStorage.js.map +1 -0
- package/src/lib/interfaces/identity/identityProof.d.ts +90 -0
- package/src/lib/interfaces/identity/identityProof.d.ts.map +1 -0
- package/src/lib/interfaces/identity/identityProof.js +18 -0
- package/src/lib/interfaces/identity/identityProof.js.map +1 -0
- package/src/lib/interfaces/identity/index.d.ts +7 -0
- package/src/lib/interfaces/identity/index.d.ts.map +1 -0
- package/src/lib/interfaces/identity/index.js +3 -0
- package/src/lib/interfaces/identity/index.js.map +1 -0
- package/src/lib/interfaces/identity/paperKey.d.ts +97 -0
- package/src/lib/interfaces/identity/paperKey.d.ts.map +1 -0
- package/src/lib/interfaces/identity/paperKey.js +17 -0
- package/src/lib/interfaces/identity/paperKey.js.map +1 -0
- package/src/lib/interfaces/identity/publicProfile.d.ts +74 -0
- package/src/lib/interfaces/identity/publicProfile.d.ts.map +1 -0
- package/src/lib/interfaces/identity/publicProfile.js +18 -0
- package/src/lib/interfaces/identity/publicProfile.js.map +1 -0
- package/src/lib/interfaces/identity/splitPaperKey.d.ts +73 -0
- package/src/lib/interfaces/identity/splitPaperKey.d.ts.map +1 -0
- package/src/lib/interfaces/identity/splitPaperKey.js +20 -0
- package/src/lib/interfaces/identity/splitPaperKey.js.map +1 -0
- package/src/lib/interfaces/index.d.ts +11 -2
- package/src/lib/interfaces/index.d.ts.map +1 -1
- package/src/lib/interfaces/index.js +12 -0
- package/src/lib/interfaces/index.js.map +1 -1
- package/src/lib/interfaces/messaging/attachmentMetadata.d.ts +47 -0
- package/src/lib/interfaces/messaging/attachmentMetadata.d.ts.map +1 -0
- package/src/lib/interfaces/messaging/attachmentMetadata.js +3 -0
- package/src/lib/interfaces/messaging/attachmentMetadata.js.map +1 -0
- package/src/lib/interfaces/messaging/emailAddress.d.ts +210 -0
- package/src/lib/interfaces/messaging/emailAddress.d.ts.map +1 -0
- package/src/lib/interfaces/messaging/emailAddress.js +213 -0
- package/src/lib/interfaces/messaging/emailAddress.js.map +1 -0
- package/src/lib/interfaces/messaging/emailDelivery.d.ts +80 -0
- package/src/lib/interfaces/messaging/emailDelivery.d.ts.map +1 -0
- package/src/lib/interfaces/messaging/emailDelivery.js +50 -0
- package/src/lib/interfaces/messaging/emailDelivery.js.map +1 -0
- package/src/lib/interfaces/messaging/emailMetadata.d.ts +269 -0
- package/src/lib/interfaces/messaging/emailMetadata.d.ts.map +1 -0
- package/src/lib/interfaces/messaging/emailMetadata.js +16 -0
- package/src/lib/interfaces/messaging/emailMetadata.js.map +1 -0
- package/src/lib/interfaces/messaging/index.d.ts +5 -1
- package/src/lib/interfaces/messaging/index.d.ts.map +1 -1
- package/src/lib/interfaces/messaging/index.js +5 -1
- package/src/lib/interfaces/messaging/index.js.map +1 -1
- package/src/lib/interfaces/messaging/messageMetadata.d.ts +2 -2
- package/src/lib/interfaces/messaging/messageMetadata.d.ts.map +1 -1
- package/src/lib/interfaces/messaging/messageMetadataStore.d.ts +2 -2
- package/src/lib/interfaces/messaging/messageMetadataStore.d.ts.map +1 -1
- package/src/lib/interfaces/messaging/mimePart.d.ts +214 -0
- package/src/lib/interfaces/messaging/mimePart.d.ts.map +1 -0
- package/src/lib/interfaces/messaging/mimePart.js +71 -0
- package/src/lib/interfaces/messaging/mimePart.js.map +1 -0
- package/src/lib/interfaces/network/index.d.ts +0 -1
- package/src/lib/interfaces/network/index.d.ts.map +1 -1
- package/src/lib/interfaces/network/node.d.ts +4 -2
- package/src/lib/interfaces/network/node.d.ts.map +1 -1
- package/src/lib/interfaces/network/nodeAdvertisement.d.ts +4 -2
- package/src/lib/interfaces/network/nodeAdvertisement.d.ts.map +1 -1
- package/src/lib/interfaces/privateVotingDerivation.d.ts +7 -2
- package/src/lib/interfaces/privateVotingDerivation.d.ts.map +1 -1
- package/src/lib/interfaces/requests/communicationRequests.d.ts +154 -0
- package/src/lib/interfaces/requests/communicationRequests.d.ts.map +1 -0
- package/src/lib/interfaces/requests/communicationRequests.js +10 -0
- package/src/lib/interfaces/requests/communicationRequests.js.map +1 -0
- package/src/lib/interfaces/requests/index.d.ts +2 -0
- package/src/lib/interfaces/requests/index.d.ts.map +1 -0
- package/src/lib/interfaces/requests/index.js +3 -0
- package/src/lib/interfaces/requests/index.js.map +1 -0
- package/src/lib/interfaces/responses/blockDataResponse.d.ts +11 -0
- package/src/lib/interfaces/responses/blockDataResponse.d.ts.map +1 -0
- package/src/lib/interfaces/responses/blockDataResponse.js +3 -0
- package/src/lib/interfaces/responses/blockDataResponse.js.map +1 -0
- package/src/lib/interfaces/responses/communicationResponses.d.ts +82 -0
- package/src/lib/interfaces/responses/communicationResponses.d.ts.map +1 -0
- package/src/lib/interfaces/responses/communicationResponses.js +17 -0
- package/src/lib/interfaces/responses/communicationResponses.js.map +1 -0
- package/src/lib/interfaces/responses/cryptoResponses.d.ts +30 -0
- package/src/lib/interfaces/responses/cryptoResponses.d.ts.map +1 -0
- package/src/lib/interfaces/responses/cryptoResponses.js +12 -0
- package/src/lib/interfaces/responses/cryptoResponses.js.map +1 -0
- package/src/lib/interfaces/responses/deviceResponses.d.ts +26 -0
- package/src/lib/interfaces/responses/deviceResponses.d.ts.map +1 -0
- package/src/lib/interfaces/responses/deviceResponses.js +15 -0
- package/src/lib/interfaces/responses/deviceResponses.js.map +1 -0
- package/src/lib/interfaces/responses/directoryResponses.d.ts +26 -0
- package/src/lib/interfaces/responses/directoryResponses.d.ts.map +1 -0
- package/src/lib/interfaces/responses/directoryResponses.js +12 -0
- package/src/lib/interfaces/responses/directoryResponses.js.map +1 -0
- package/src/lib/interfaces/responses/emailResponses.d.ts +40 -0
- package/src/lib/interfaces/responses/emailResponses.d.ts.map +1 -0
- package/src/lib/interfaces/responses/emailResponses.js +18 -0
- package/src/lib/interfaces/responses/emailResponses.js.map +1 -0
- package/src/lib/interfaces/responses/explodingMessageResponses.d.ts +42 -0
- package/src/lib/interfaces/responses/explodingMessageResponses.d.ts.map +1 -0
- package/src/lib/interfaces/responses/explodingMessageResponses.js +11 -0
- package/src/lib/interfaces/responses/explodingMessageResponses.js.map +1 -0
- package/src/lib/interfaces/responses/identityProofResponses.d.ts +33 -0
- package/src/lib/interfaces/responses/identityProofResponses.d.ts.map +1 -0
- package/src/lib/interfaces/responses/identityProofResponses.js +12 -0
- package/src/lib/interfaces/responses/identityProofResponses.js.map +1 -0
- package/src/lib/interfaces/responses/index.d.ts +3 -1
- package/src/lib/interfaces/responses/index.d.ts.map +1 -1
- package/src/lib/interfaces/sealResults.d.ts +7 -2
- package/src/lib/interfaces/sealResults.d.ts.map +1 -1
- package/src/lib/interfaces/services/fecService.d.ts +7 -5
- package/src/lib/interfaces/services/fecService.d.ts.map +1 -1
- package/src/lib/interfaces/services/fecService.js +2 -0
- package/src/lib/interfaces/services/fecService.js.map +1 -1
- package/src/lib/interfaces/singleEncryptedBlockDetails.d.ts +7 -2
- package/src/lib/interfaces/singleEncryptedBlockDetails.d.ts.map +1 -1
- package/src/lib/interfaces/storage/blockMetadata.d.ts +8 -1
- package/src/lib/interfaces/storage/blockMetadata.d.ts.map +1 -1
- package/src/lib/interfaces/storage/blockMetadata.js +3 -1
- package/src/lib/interfaces/storage/blockMetadata.js.map +1 -1
- package/src/lib/interfaces/storage/cblIndex.d.ts +141 -0
- package/src/lib/interfaces/storage/cblIndex.d.ts.map +1 -0
- package/src/lib/interfaces/storage/cblIndex.js +28 -0
- package/src/lib/interfaces/storage/cblIndex.js.map +1 -0
- package/src/lib/interfaces/storage/clientSession.d.ts +22 -0
- package/src/lib/interfaces/storage/clientSession.d.ts.map +1 -0
- package/src/lib/interfaces/storage/clientSession.js +3 -0
- package/src/lib/interfaces/storage/clientSession.js.map +1 -0
- package/src/lib/interfaces/storage/collection.d.ts +80 -0
- package/src/lib/interfaces/storage/collection.d.ts.map +1 -0
- package/src/lib/interfaces/storage/collection.js +3 -0
- package/src/lib/interfaces/storage/collection.js.map +1 -0
- package/src/lib/interfaces/storage/database.d.ts +30 -0
- package/src/lib/interfaces/storage/database.d.ts.map +1 -0
- package/src/lib/interfaces/storage/database.js +3 -0
- package/src/lib/interfaces/storage/database.js.map +1 -0
- package/src/lib/interfaces/storage/databaseLifecycleHooks.d.ts +43 -0
- package/src/lib/interfaces/storage/databaseLifecycleHooks.d.ts.map +1 -0
- package/src/lib/interfaces/storage/databaseLifecycleHooks.js +3 -0
- package/src/lib/interfaces/storage/databaseLifecycleHooks.js.map +1 -0
- package/src/lib/interfaces/storage/documentTypes.d.ts +413 -0
- package/src/lib/interfaces/storage/documentTypes.d.ts.map +1 -0
- package/src/lib/interfaces/storage/documentTypes.js +8 -0
- package/src/lib/interfaces/storage/documentTypes.js.map +1 -0
- package/src/lib/interfaces/storage/encryptedPool.d.ts +64 -0
- package/src/lib/interfaces/storage/encryptedPool.d.ts.map +1 -0
- package/src/lib/interfaces/storage/encryptedPool.js +26 -0
- package/src/lib/interfaces/storage/encryptedPool.js.map +1 -0
- package/src/lib/interfaces/storage/headRegistry.d.ts +128 -0
- package/src/lib/interfaces/storage/headRegistry.d.ts.map +1 -0
- package/src/lib/interfaces/storage/headRegistry.js +3 -0
- package/src/lib/interfaces/storage/headRegistry.js.map +1 -0
- package/src/lib/interfaces/storage/index.d.ts +14 -0
- package/src/lib/interfaces/storage/index.d.ts.map +1 -1
- package/src/lib/interfaces/storage/index.js +14 -1
- package/src/lib/interfaces/storage/index.js.map +1 -1
- package/src/lib/interfaces/storage/pooledBlockStore.d.ts +163 -0
- package/src/lib/interfaces/storage/pooledBlockStore.d.ts.map +1 -0
- package/src/lib/interfaces/storage/pooledBlockStore.js +77 -0
- package/src/lib/interfaces/storage/pooledBlockStore.js.map +1 -0
- package/src/lib/interfaces/storage/readConcernBlockStore.d.ts +47 -0
- package/src/lib/interfaces/storage/readConcernBlockStore.d.ts.map +1 -0
- package/src/lib/interfaces/storage/readConcernBlockStore.js +29 -0
- package/src/lib/interfaces/storage/readConcernBlockStore.js.map +1 -0
- package/src/lib/interfaces/symmetricEncryptionResults.d.ts +7 -5
- package/src/lib/interfaces/symmetricEncryptionResults.d.ts.map +1 -1
- package/src/lib/schemas/messaging/messageMetadataSchema.d.ts.map +1 -1
- package/src/lib/schemas/messaging/messageMetadataSchema.js.map +1 -1
- package/src/lib/services/blockCapacity.service.d.ts.map +1 -1
- package/src/lib/services/blockCapacity.service.js +15 -0
- package/src/lib/services/blockCapacity.service.js.map +1 -1
- package/src/lib/services/brightpass/auditLogger.d.ts +41 -0
- package/src/lib/services/brightpass/auditLogger.d.ts.map +1 -0
- package/src/lib/services/brightpass/auditLogger.js +47 -0
- package/src/lib/services/brightpass/auditLogger.js.map +1 -0
- package/src/lib/services/brightpass/breachDetector.d.ts +68 -0
- package/src/lib/services/brightpass/breachDetector.d.ts.map +1 -0
- package/src/lib/services/brightpass/breachDetector.js +102 -0
- package/src/lib/services/brightpass/breachDetector.js.map +1 -0
- package/src/lib/services/brightpass/importParser.d.ts +105 -0
- package/src/lib/services/brightpass/importParser.d.ts.map +1 -0
- package/src/lib/services/brightpass/importParser.js +380 -0
- package/src/lib/services/brightpass/importParser.js.map +1 -0
- package/src/lib/services/brightpass/index.d.ts +16 -0
- package/src/lib/services/brightpass/index.d.ts.map +1 -0
- package/src/lib/services/brightpass/index.js +19 -0
- package/src/lib/services/brightpass/index.js.map +1 -0
- package/src/lib/services/brightpass/passwordGenerator.d.ts +111 -0
- package/src/lib/services/brightpass/passwordGenerator.d.ts.map +1 -0
- package/src/lib/services/brightpass/passwordGenerator.js +162 -0
- package/src/lib/services/brightpass/passwordGenerator.js.map +1 -0
- package/src/lib/services/brightpass/totpEngine.d.ts +191 -0
- package/src/lib/services/brightpass/totpEngine.d.ts.map +1 -0
- package/src/lib/services/brightpass/totpEngine.js +198 -0
- package/src/lib/services/brightpass/totpEngine.js.map +1 -0
- package/src/lib/services/brightpass/vaultKeyDerivation.d.ts +26 -0
- package/src/lib/services/brightpass/vaultKeyDerivation.d.ts.map +1 -0
- package/src/lib/services/brightpass/vaultKeyDerivation.js +42 -0
- package/src/lib/services/brightpass/vaultKeyDerivation.js.map +1 -0
- package/src/lib/services/brightpass/vaultSerializer.d.ts +14 -0
- package/src/lib/services/brightpass/vaultSerializer.d.ts.map +1 -0
- package/src/lib/services/brightpass/vaultSerializer.js +77 -0
- package/src/lib/services/brightpass/vaultSerializer.js.map +1 -0
- package/src/lib/services/cblService.d.ts +4 -2
- package/src/lib/services/cblService.d.ts.map +1 -1
- package/src/lib/services/cblService.js +8 -4
- package/src/lib/services/cblService.js.map +1 -1
- package/src/lib/services/communication/channelService.d.ts +208 -0
- package/src/lib/services/communication/channelService.d.ts.map +1 -0
- package/src/lib/services/communication/channelService.js +575 -0
- package/src/lib/services/communication/channelService.js.map +1 -0
- package/src/lib/services/communication/conversationService.d.ts +130 -0
- package/src/lib/services/communication/conversationService.d.ts.map +1 -0
- package/src/lib/services/communication/conversationService.js +279 -0
- package/src/lib/services/communication/conversationService.js.map +1 -0
- package/src/lib/services/communication/explodingMessageService.d.ts +168 -0
- package/src/lib/services/communication/explodingMessageService.d.ts.map +1 -0
- package/src/lib/services/communication/explodingMessageService.js +287 -0
- package/src/lib/services/communication/explodingMessageService.js.map +1 -0
- package/src/lib/services/communication/groupService.d.ts +165 -0
- package/src/lib/services/communication/groupService.d.ts.map +1 -0
- package/src/lib/services/communication/groupService.js +437 -0
- package/src/lib/services/communication/groupService.js.map +1 -0
- package/src/lib/services/communication/index.d.ts +16 -0
- package/src/lib/services/communication/index.d.ts.map +1 -0
- package/src/lib/services/communication/index.js +63 -0
- package/src/lib/services/communication/index.js.map +1 -0
- package/src/lib/services/communication/messageOperationsService.d.ts +81 -0
- package/src/lib/services/communication/messageOperationsService.d.ts.map +1 -0
- package/src/lib/services/communication/messageOperationsService.js +162 -0
- package/src/lib/services/communication/messageOperationsService.js.map +1 -0
- package/src/lib/services/communication/permissionService.d.ts +47 -0
- package/src/lib/services/communication/permissionService.d.ts.map +1 -0
- package/src/lib/services/communication/permissionService.js +82 -0
- package/src/lib/services/communication/permissionService.js.map +1 -0
- package/src/lib/services/communication/searchService.d.ts +30 -0
- package/src/lib/services/communication/searchService.d.ts.map +1 -0
- package/src/lib/services/communication/searchService.js +83 -0
- package/src/lib/services/communication/searchService.js.map +1 -0
- package/src/lib/services/crypto/ethereumWalletService.d.ts +159 -0
- package/src/lib/services/crypto/ethereumWalletService.d.ts.map +1 -0
- package/src/lib/services/crypto/ethereumWalletService.js +345 -0
- package/src/lib/services/crypto/ethereumWalletService.js.map +1 -0
- package/src/lib/services/crypto/gitSigningService.d.ts +145 -0
- package/src/lib/services/crypto/gitSigningService.d.ts.map +1 -0
- package/src/lib/services/crypto/gitSigningService.js +291 -0
- package/src/lib/services/crypto/gitSigningService.js.map +1 -0
- package/src/lib/services/crypto/index.d.ts +3 -0
- package/src/lib/services/crypto/index.d.ts.map +1 -0
- package/src/lib/services/crypto/index.js +6 -0
- package/src/lib/services/crypto/index.js.map +1 -0
- package/src/lib/services/identity/deviceProvisioningService.d.ts +146 -0
- package/src/lib/services/identity/deviceProvisioningService.d.ts.map +1 -0
- package/src/lib/services/identity/deviceProvisioningService.js +219 -0
- package/src/lib/services/identity/deviceProvisioningService.js.map +1 -0
- package/src/lib/services/identity/identityProofService.d.ts +139 -0
- package/src/lib/services/identity/identityProofService.d.ts.map +1 -0
- package/src/lib/services/identity/identityProofService.js +245 -0
- package/src/lib/services/identity/identityProofService.js.map +1 -0
- package/src/lib/services/identity/index.d.ts +14 -0
- package/src/lib/services/identity/index.d.ts.map +1 -0
- package/src/lib/services/identity/index.js +17 -0
- package/src/lib/services/identity/index.js.map +1 -0
- package/src/lib/services/identity/memberIdentityProofService.d.ts +179 -0
- package/src/lib/services/identity/memberIdentityProofService.d.ts.map +1 -0
- package/src/lib/services/identity/memberIdentityProofService.js +232 -0
- package/src/lib/services/identity/memberIdentityProofService.js.map +1 -0
- package/src/lib/services/identity/memberPaperKeyService.d.ts +223 -0
- package/src/lib/services/identity/memberPaperKeyService.d.ts.map +1 -0
- package/src/lib/services/identity/memberPaperKeyService.js +279 -0
- package/src/lib/services/identity/memberPaperKeyService.js.map +1 -0
- package/src/lib/services/identity/paperKeyService.d.ts +106 -0
- package/src/lib/services/identity/paperKeyService.d.ts.map +1 -0
- package/src/lib/services/identity/paperKeyService.js +161 -0
- package/src/lib/services/identity/paperKeyService.js.map +1 -0
- package/src/lib/services/identity/publicKeyDirectoryService.d.ts +210 -0
- package/src/lib/services/identity/publicKeyDirectoryService.d.ts.map +1 -0
- package/src/lib/services/identity/publicKeyDirectoryService.js +328 -0
- package/src/lib/services/identity/publicKeyDirectoryService.js.map +1 -0
- package/src/lib/services/identity/splitPaperKeyService.d.ts +92 -0
- package/src/lib/services/identity/splitPaperKeyService.d.ts.map +1 -0
- package/src/lib/services/identity/splitPaperKeyService.js +305 -0
- package/src/lib/services/identity/splitPaperKeyService.js.map +1 -0
- package/src/lib/services/index.d.ts +4 -0
- package/src/lib/services/index.d.ts.map +1 -1
- package/src/lib/services/index.js +7 -0
- package/src/lib/services/index.js.map +1 -1
- package/src/lib/services/messaging/deliveryTimeoutService.js +2 -2
- package/src/lib/services/messaging/deliveryTimeoutService.js.map +1 -1
- package/src/lib/services/messaging/emailEncryptionService.d.ts +250 -0
- package/src/lib/services/messaging/emailEncryptionService.d.ts.map +1 -0
- package/src/lib/services/messaging/emailEncryptionService.js +420 -0
- package/src/lib/services/messaging/emailEncryptionService.js.map +1 -0
- package/src/lib/services/messaging/emailMessageService.d.ts +669 -0
- package/src/lib/services/messaging/emailMessageService.d.ts.map +1 -0
- package/src/lib/services/messaging/emailMessageService.js +1030 -0
- package/src/lib/services/messaging/emailMessageService.js.map +1 -0
- package/src/lib/services/messaging/emailParser.d.ts +476 -0
- package/src/lib/services/messaging/emailParser.d.ts.map +1 -0
- package/src/lib/services/messaging/emailParser.js +1316 -0
- package/src/lib/services/messaging/emailParser.js.map +1 -0
- package/src/lib/services/messaging/emailSerializer.d.ts +403 -0
- package/src/lib/services/messaging/emailSerializer.d.ts.map +1 -0
- package/src/lib/services/messaging/emailSerializer.js +852 -0
- package/src/lib/services/messaging/emailSerializer.js.map +1 -0
- package/src/lib/services/messaging/emailValidator.d.ts +448 -0
- package/src/lib/services/messaging/emailValidator.d.ts.map +1 -0
- package/src/lib/services/messaging/emailValidator.js +810 -0
- package/src/lib/services/messaging/emailValidator.js.map +1 -0
- package/src/lib/services/messaging/gossipRetryService.d.ts +204 -0
- package/src/lib/services/messaging/gossipRetryService.d.ts.map +1 -0
- package/src/lib/services/messaging/gossipRetryService.js +319 -0
- package/src/lib/services/messaging/gossipRetryService.js.map +1 -0
- package/src/lib/services/messaging/inMemoryEmailMetadataStore.d.ts +60 -0
- package/src/lib/services/messaging/inMemoryEmailMetadataStore.d.ts.map +1 -0
- package/src/lib/services/messaging/inMemoryEmailMetadataStore.js +281 -0
- package/src/lib/services/messaging/inMemoryEmailMetadataStore.js.map +1 -0
- package/src/lib/services/messaging/index.d.ts +11 -5
- package/src/lib/services/messaging/index.d.ts.map +1 -1
- package/src/lib/services/messaging/index.js +19 -5
- package/src/lib/services/messaging/index.js.map +1 -1
- package/src/lib/services/messaging/messageCBLService.js +2 -2
- package/src/lib/services/messaging/messageCBLService.js.map +1 -1
- package/src/lib/services/tuple.service.d.ts +27 -2
- package/src/lib/services/tuple.service.d.ts.map +1 -1
- package/src/lib/services/tuple.service.js +62 -20
- package/src/lib/services/tuple.service.js.map +1 -1
- package/src/lib/services/vcblService.d.ts +36 -0
- package/src/lib/services/vcblService.d.ts.map +1 -0
- package/src/lib/services/vcblService.js +326 -0
- package/src/lib/services/vcblService.js.map +1 -0
- package/src/lib/stores/index.d.ts +1 -0
- package/src/lib/stores/index.d.ts.map +1 -1
- package/src/lib/stores/index.js +1 -0
- package/src/lib/stores/index.js.map +1 -1
- package/src/lib/stores/messaging/memoryMessageMetadataStore.d.ts +2 -2
- package/src/lib/stores/messaging/memoryMessageMetadataStore.d.ts.map +1 -1
- package/src/lib/stores/messaging/memoryMessageMetadataStore.js +2 -2
- package/src/lib/stores/messaging/memoryMessageMetadataStore.js.map +1 -1
- package/src/lib/stores/pooledMemoryBlockStore.d.ts +134 -0
- package/src/lib/stores/pooledMemoryBlockStore.d.ts.map +1 -0
- package/src/lib/stores/pooledMemoryBlockStore.js +583 -0
- package/src/lib/stores/pooledMemoryBlockStore.js.map +1 -0
- package/src/lib/types/checksum.d.ts +11 -0
- package/src/lib/types/checksum.d.ts.map +1 -1
- package/src/lib/types/checksum.js +11 -0
- package/src/lib/types/checksum.js.map +1 -1
- package/src/lib/utils/index.d.ts +9 -0
- package/src/lib/utils/index.d.ts.map +1 -1
- package/src/lib/utils/index.js +12 -0
- package/src/lib/utils/index.js.map +1 -1
- package/src/lib/utils/pagination.d.ts +27 -0
- package/src/lib/utils/pagination.d.ts.map +1 -0
- package/src/lib/utils/pagination.js +38 -0
- package/src/lib/utils/pagination.js.map +1 -0
- package/src/lib/enumerations/messaging/messageDeliveryStatus.d.ts +0 -18
- package/src/lib/enumerations/messaging/messageDeliveryStatus.d.ts.map +0 -1
- package/src/lib/enumerations/messaging/messageDeliveryStatus.js +0 -22
- package/src/lib/enumerations/messaging/messageDeliveryStatus.js.map +0 -1
- package/src/lib/enumerations/messaging/routingStrategy.d.ts +0 -12
- package/src/lib/enumerations/messaging/routingStrategy.d.ts.map +0 -1
- package/src/lib/enumerations/messaging/routingStrategy.js +0 -16
- package/src/lib/enumerations/messaging/routingStrategy.js.map +0 -1
- package/src/lib/interfaces/messaging/messageRouter.d.ts +0 -48
- package/src/lib/interfaces/messaging/messageRouter.d.ts.map +0 -1
- package/src/lib/interfaces/messaging/messageRouter.js.map +0 -1
- package/src/lib/interfaces/network/networkTransport.d.ts +0 -19
- package/src/lib/interfaces/network/networkTransport.d.ts.map +0 -1
- package/src/lib/interfaces/network/networkTransport.js.map +0 -1
- package/src/lib/services/messaging/broadcastMessageRouter.d.ts +0 -18
- package/src/lib/services/messaging/broadcastMessageRouter.d.ts.map +0 -1
- package/src/lib/services/messaging/broadcastMessageRouter.js +0 -32
- package/src/lib/services/messaging/broadcastMessageRouter.js.map +0 -1
- package/src/lib/services/messaging/directMessageRouter.d.ts +0 -25
- package/src/lib/services/messaging/directMessageRouter.d.ts.map +0 -1
- package/src/lib/services/messaging/directMessageRouter.js +0 -58
- package/src/lib/services/messaging/directMessageRouter.js.map +0 -1
- package/src/lib/services/messaging/messageForwardingService.d.ts +0 -40
- package/src/lib/services/messaging/messageForwardingService.d.ts.map +0 -1
- package/src/lib/services/messaging/messageForwardingService.js +0 -74
- package/src/lib/services/messaging/messageForwardingService.js.map +0 -1
- package/src/lib/services/messaging/messageRouter.d.ts +0 -24
- package/src/lib/services/messaging/messageRouter.d.ts.map +0 -1
- package/src/lib/services/messaging/messageRouter.js +0 -111
- package/src/lib/services/messaging/messageRouter.js.map +0 -1
- package/src/lib/services/messaging/webSocketTransport.d.ts +0 -34
- package/src/lib/services/messaging/webSocketTransport.d.ts.map +0 -1
- package/src/lib/services/messaging/webSocketTransport.js +0 -115
- package/src/lib/services/messaging/webSocketTransport.js.map +0 -1
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public Key Directory Service for the BrightChain identity system.
|
|
3
|
+
*
|
|
4
|
+
* Provides an in-memory searchable directory of member public profiles.
|
|
5
|
+
* Supports search by display name, social username, or member ID with
|
|
6
|
+
* relevance ranking, pagination, and platform filtering. Members may
|
|
7
|
+
* opt out of directory listing via privacy mode.
|
|
8
|
+
*
|
|
9
|
+
* Follows the same stateful-service pattern used by
|
|
10
|
+
* {@link MemberPaperKeyService}, {@link ConversationService}, and other
|
|
11
|
+
* BrightChain services that manage in-memory state with `Map`s.
|
|
12
|
+
*
|
|
13
|
+
* Requirements: 5.1, 5.2, 5.3, 5.6, 5.9
|
|
14
|
+
*/
|
|
15
|
+
import { ProofPlatform } from '../../enumerations/proofPlatform';
|
|
16
|
+
import { IPublicProfile } from '../../interfaces/identity/publicProfile';
|
|
17
|
+
/**
|
|
18
|
+
* Error thrown when a profile operation references a member that does not exist.
|
|
19
|
+
*/
|
|
20
|
+
export declare class ProfileNotFoundError extends Error {
|
|
21
|
+
constructor(memberId: string);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Error thrown when a profile update is missing required fields.
|
|
25
|
+
*/
|
|
26
|
+
export declare class InvalidProfileError extends Error {
|
|
27
|
+
constructor(message: string);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Options for controlling directory search behaviour.
|
|
31
|
+
*
|
|
32
|
+
* Supports pagination (Requirement 5.5) and platform filtering
|
|
33
|
+
* (Requirement 5.10).
|
|
34
|
+
*/
|
|
35
|
+
export interface ISearchOptions {
|
|
36
|
+
/** Maximum number of results to return. Defaults to 20. */
|
|
37
|
+
limit?: number;
|
|
38
|
+
/** Zero-based offset for pagination. Defaults to 0. */
|
|
39
|
+
offset?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Filter results to only include profiles with a verified proof
|
|
42
|
+
* on the specified platform (Requirement 5.10).
|
|
43
|
+
*/
|
|
44
|
+
platformFilter?: ProofPlatform;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A single search result with its relevance score.
|
|
48
|
+
*
|
|
49
|
+
* Requirement 5.3: Search results include relevance ranking.
|
|
50
|
+
*/
|
|
51
|
+
export interface ISearchResult {
|
|
52
|
+
/** The matched public profile */
|
|
53
|
+
profile: IPublicProfile;
|
|
54
|
+
/** Relevance score (higher is more relevant). Used for ranking. */
|
|
55
|
+
relevanceScore: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Paginated search response.
|
|
59
|
+
*/
|
|
60
|
+
export interface ISearchResponse {
|
|
61
|
+
/** The matched profiles, ordered by descending relevance score */
|
|
62
|
+
results: ISearchResult[];
|
|
63
|
+
/** Total number of matching profiles (before pagination) */
|
|
64
|
+
totalCount: number;
|
|
65
|
+
/** Whether there are more results beyond the current page */
|
|
66
|
+
hasMore: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* In-memory public key directory for searching and managing member profiles.
|
|
70
|
+
*
|
|
71
|
+
* The directory stores {@link IPublicProfile} records keyed by member ID
|
|
72
|
+
* and provides full-text search across display names, social usernames,
|
|
73
|
+
* and member IDs with relevance-based ranking.
|
|
74
|
+
*
|
|
75
|
+
* Privacy mode (Requirement 5.6, 5.9): Profiles with `privacyMode: true`
|
|
76
|
+
* are excluded from search results but can still be accessed directly
|
|
77
|
+
* via {@link getProfile}.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const directory = new PublicKeyDirectoryService();
|
|
82
|
+
*
|
|
83
|
+
* // Add a profile
|
|
84
|
+
* directory.updateProfile({
|
|
85
|
+
* memberId: 'member-xyz',
|
|
86
|
+
* displayName: 'Alice',
|
|
87
|
+
* publicKey: '04abcdef...',
|
|
88
|
+
* identityProofs: [],
|
|
89
|
+
* createdAt: new Date(),
|
|
90
|
+
* updatedAt: new Date(),
|
|
91
|
+
* privacyMode: false,
|
|
92
|
+
* });
|
|
93
|
+
*
|
|
94
|
+
* // Search for profiles
|
|
95
|
+
* const results = directory.search('Alice');
|
|
96
|
+
*
|
|
97
|
+
* // Toggle privacy mode
|
|
98
|
+
* directory.togglePrivacyMode('member-xyz');
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
export declare class PublicKeyDirectoryService {
|
|
102
|
+
/**
|
|
103
|
+
* Profile storage keyed by member ID.
|
|
104
|
+
*/
|
|
105
|
+
private readonly profiles;
|
|
106
|
+
/**
|
|
107
|
+
* Search the directory for profiles matching the given query.
|
|
108
|
+
*
|
|
109
|
+
* Searches across display names, social usernames from identity proofs,
|
|
110
|
+
* and member IDs. Results are ranked by relevance score (Requirement 5.3).
|
|
111
|
+
*
|
|
112
|
+
* Profiles in privacy mode are excluded from results (Requirement 5.9).
|
|
113
|
+
* Only verified identity proofs are considered for username matching
|
|
114
|
+
* (Requirement 5.4).
|
|
115
|
+
*
|
|
116
|
+
* **Validates: Requirements 5.2, 5.3, 5.5, 5.9, 5.10**
|
|
117
|
+
*
|
|
118
|
+
* @param query - The search query string (case-insensitive)
|
|
119
|
+
* @param options - Optional search parameters (pagination, filtering)
|
|
120
|
+
* @returns Paginated search results ordered by descending relevance
|
|
121
|
+
*/
|
|
122
|
+
search(query: string, options?: ISearchOptions): ISearchResponse;
|
|
123
|
+
/**
|
|
124
|
+
* Get a profile by member ID.
|
|
125
|
+
*
|
|
126
|
+
* Unlike {@link search}, this method returns profiles regardless of
|
|
127
|
+
* privacy mode. This allows existing contacts to look up a member
|
|
128
|
+
* directly even when the member has opted out of directory listing.
|
|
129
|
+
*
|
|
130
|
+
* **Validates: Requirements 5.1, 5.9**
|
|
131
|
+
*
|
|
132
|
+
* @param memberId - The member ID to look up
|
|
133
|
+
* @returns The public profile
|
|
134
|
+
* @throws {ProfileNotFoundError} If no profile exists for the member ID
|
|
135
|
+
*/
|
|
136
|
+
getProfile(memberId: string): IPublicProfile;
|
|
137
|
+
/**
|
|
138
|
+
* Add or update a profile in the directory.
|
|
139
|
+
*
|
|
140
|
+
* If a profile already exists for the member ID, it is replaced.
|
|
141
|
+
* The `updatedAt` timestamp is set to the current time on update.
|
|
142
|
+
*
|
|
143
|
+
* **Validates: Requirements 5.1, 5.8**
|
|
144
|
+
*
|
|
145
|
+
* @param profile - The public profile to store
|
|
146
|
+
* @throws {InvalidProfileError} If required fields are missing
|
|
147
|
+
*/
|
|
148
|
+
updateProfile(profile: IPublicProfile): void;
|
|
149
|
+
/**
|
|
150
|
+
* Toggle privacy mode for a member's profile.
|
|
151
|
+
*
|
|
152
|
+
* When privacy mode is enabled, the profile is excluded from search
|
|
153
|
+
* results (Requirement 5.9) but can still be accessed directly via
|
|
154
|
+
* {@link getProfile}.
|
|
155
|
+
*
|
|
156
|
+
* **Validates: Requirements 5.6, 5.9**
|
|
157
|
+
*
|
|
158
|
+
* @param memberId - The member whose privacy mode to toggle
|
|
159
|
+
* @returns The new privacy mode state (`true` = private, `false` = public)
|
|
160
|
+
* @throws {ProfileNotFoundError} If no profile exists for the member ID
|
|
161
|
+
*/
|
|
162
|
+
togglePrivacyMode(memberId: string): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Get the total number of profiles in the directory.
|
|
165
|
+
*/
|
|
166
|
+
get size(): number;
|
|
167
|
+
/**
|
|
168
|
+
* Check whether a profile exists for the given member ID.
|
|
169
|
+
*/
|
|
170
|
+
hasProfile(memberId: string): boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Remove a profile from the directory.
|
|
173
|
+
*
|
|
174
|
+
* @param memberId - The member whose profile to remove
|
|
175
|
+
* @returns `true` if a profile was removed, `false` if none existed
|
|
176
|
+
*/
|
|
177
|
+
removeProfile(memberId: string): boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Remove all profiles from the directory.
|
|
180
|
+
* Useful for testing.
|
|
181
|
+
*/
|
|
182
|
+
clear(): void;
|
|
183
|
+
/**
|
|
184
|
+
* Calculate the relevance score for a profile against a search query.
|
|
185
|
+
*
|
|
186
|
+
* Scoring strategy (Requirement 5.3):
|
|
187
|
+
* - Exact member ID match: highest score
|
|
188
|
+
* - Exact display name match: high score
|
|
189
|
+
* - Display name prefix match: medium-high score
|
|
190
|
+
* - Exact social username match: high score
|
|
191
|
+
* - Social username prefix match: medium score
|
|
192
|
+
* - Substring matches: lower scores
|
|
193
|
+
* - Bonus for each verified identity proof
|
|
194
|
+
*
|
|
195
|
+
* Only verified proofs are considered for username matching
|
|
196
|
+
* (Requirement 5.4).
|
|
197
|
+
*
|
|
198
|
+
* @param profile - The profile to score
|
|
199
|
+
* @param normalizedQuery - The lowercase, trimmed search query
|
|
200
|
+
* @returns The relevance score (0 means no match)
|
|
201
|
+
*/
|
|
202
|
+
private calculateRelevanceScore;
|
|
203
|
+
/**
|
|
204
|
+
* Validate that a profile has all required fields.
|
|
205
|
+
*
|
|
206
|
+
* @throws {InvalidProfileError} If validation fails
|
|
207
|
+
*/
|
|
208
|
+
private validateProfile;
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=publicKeyDirectoryService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicKeyDirectoryService.d.ts","sourceRoot":"","sources":["../../../../../../brightchain-lib/src/lib/services/identity/publicKeyDirectoryService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAIzE;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,QAAQ,EAAE,MAAM;CAI7B;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM;CAI5B;AAID;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,cAAc,CAAC,EAAE,aAAa,CAAC;CAChC;AAED;;;;GAIG;AACH,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of member public profiles.
|
|
6
|
+
* Supports search by display name, social username, or member ID with
|
|
7
|
+
* relevance ranking, pagination, and platform filtering. Members may
|
|
8
|
+
* opt out of directory listing via privacy mode.
|
|
9
|
+
*
|
|
10
|
+
* Follows the same stateful-service pattern used by
|
|
11
|
+
* {@link MemberPaperKeyService}, {@link ConversationService}, and other
|
|
12
|
+
* BrightChain services that manage in-memory state with `Map`s.
|
|
13
|
+
*
|
|
14
|
+
* Requirements: 5.1, 5.2, 5.3, 5.6, 5.9
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.PublicKeyDirectoryService = exports.InvalidProfileError = exports.ProfileNotFoundError = void 0;
|
|
18
|
+
const verificationStatus_1 = require("../../enumerations/verificationStatus");
|
|
19
|
+
// ─── Error classes ──────────────────────────────────────────────────────────
|
|
20
|
+
/**
|
|
21
|
+
* Error thrown when a profile operation references a member that does not exist.
|
|
22
|
+
*/
|
|
23
|
+
class ProfileNotFoundError extends Error {
|
|
24
|
+
constructor(memberId) {
|
|
25
|
+
super(`Profile not found for member: ${memberId}`);
|
|
26
|
+
this.name = 'ProfileNotFoundError';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.ProfileNotFoundError = ProfileNotFoundError;
|
|
30
|
+
/**
|
|
31
|
+
* Error thrown when a profile update is missing required fields.
|
|
32
|
+
*/
|
|
33
|
+
class InvalidProfileError extends Error {
|
|
34
|
+
constructor(message) {
|
|
35
|
+
super(message);
|
|
36
|
+
this.name = 'InvalidProfileError';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.InvalidProfileError = InvalidProfileError;
|
|
40
|
+
// ─── Relevance scoring constants ────────────────────────────────────────────
|
|
41
|
+
/** Score awarded for an exact member ID match */
|
|
42
|
+
const SCORE_EXACT_MEMBER_ID = 100;
|
|
43
|
+
/** Score awarded for an exact display name match (case-insensitive) */
|
|
44
|
+
const SCORE_EXACT_DISPLAY_NAME = 80;
|
|
45
|
+
/** Score awarded when the display name starts with the query */
|
|
46
|
+
const SCORE_DISPLAY_NAME_PREFIX = 60;
|
|
47
|
+
/** Score awarded when the display name contains the query */
|
|
48
|
+
const SCORE_DISPLAY_NAME_CONTAINS = 40;
|
|
49
|
+
/** Score awarded for an exact social username match */
|
|
50
|
+
const SCORE_EXACT_USERNAME = 70;
|
|
51
|
+
/** Score awarded when a social username starts with the query */
|
|
52
|
+
const SCORE_USERNAME_PREFIX = 50;
|
|
53
|
+
/** Score awarded when a social username contains the query */
|
|
54
|
+
const SCORE_USERNAME_CONTAINS = 30;
|
|
55
|
+
/** Bonus score per verified identity proof on the profile */
|
|
56
|
+
const SCORE_VERIFIED_PROOF_BONUS = 5;
|
|
57
|
+
// ─── Service ────────────────────────────────────────────────────────────────
|
|
58
|
+
/**
|
|
59
|
+
* In-memory public key directory for searching and managing member profiles.
|
|
60
|
+
*
|
|
61
|
+
* The directory stores {@link IPublicProfile} records keyed by member ID
|
|
62
|
+
* and provides full-text search across display names, social usernames,
|
|
63
|
+
* and member IDs with relevance-based ranking.
|
|
64
|
+
*
|
|
65
|
+
* Privacy mode (Requirement 5.6, 5.9): Profiles with `privacyMode: true`
|
|
66
|
+
* are excluded from search results but can still be accessed directly
|
|
67
|
+
* via {@link getProfile}.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* const directory = new PublicKeyDirectoryService();
|
|
72
|
+
*
|
|
73
|
+
* // Add a profile
|
|
74
|
+
* directory.updateProfile({
|
|
75
|
+
* memberId: 'member-xyz',
|
|
76
|
+
* displayName: 'Alice',
|
|
77
|
+
* publicKey: '04abcdef...',
|
|
78
|
+
* identityProofs: [],
|
|
79
|
+
* createdAt: new Date(),
|
|
80
|
+
* updatedAt: new Date(),
|
|
81
|
+
* privacyMode: false,
|
|
82
|
+
* });
|
|
83
|
+
*
|
|
84
|
+
* // Search for profiles
|
|
85
|
+
* const results = directory.search('Alice');
|
|
86
|
+
*
|
|
87
|
+
* // Toggle privacy mode
|
|
88
|
+
* directory.togglePrivacyMode('member-xyz');
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
class PublicKeyDirectoryService {
|
|
92
|
+
constructor() {
|
|
93
|
+
/**
|
|
94
|
+
* Profile storage keyed by member ID.
|
|
95
|
+
*/
|
|
96
|
+
this.profiles = new Map();
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Search the directory for profiles matching the given query.
|
|
100
|
+
*
|
|
101
|
+
* Searches across display names, social usernames from identity proofs,
|
|
102
|
+
* and member IDs. Results are ranked by relevance score (Requirement 5.3).
|
|
103
|
+
*
|
|
104
|
+
* Profiles in privacy mode are excluded from results (Requirement 5.9).
|
|
105
|
+
* Only verified identity proofs are considered for username matching
|
|
106
|
+
* (Requirement 5.4).
|
|
107
|
+
*
|
|
108
|
+
* **Validates: Requirements 5.2, 5.3, 5.5, 5.9, 5.10**
|
|
109
|
+
*
|
|
110
|
+
* @param query - The search query string (case-insensitive)
|
|
111
|
+
* @param options - Optional search parameters (pagination, filtering)
|
|
112
|
+
* @returns Paginated search results ordered by descending relevance
|
|
113
|
+
*/
|
|
114
|
+
search(query, options) {
|
|
115
|
+
const limit = options?.limit ?? 20;
|
|
116
|
+
const offset = options?.offset ?? 0;
|
|
117
|
+
const platformFilter = options?.platformFilter;
|
|
118
|
+
if (!query || query.trim().length === 0) {
|
|
119
|
+
return { results: [], totalCount: 0, hasMore: false };
|
|
120
|
+
}
|
|
121
|
+
const normalizedQuery = query.trim().toLowerCase();
|
|
122
|
+
const scoredResults = [];
|
|
123
|
+
for (const profile of this.profiles.values()) {
|
|
124
|
+
// Requirement 5.9: Skip profiles in privacy mode
|
|
125
|
+
if (profile.privacyMode) {
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
// Requirement 5.10: Apply platform filter
|
|
129
|
+
if (platformFilter) {
|
|
130
|
+
const hasVerifiedProofOnPlatform = profile.identityProofs.some((proof) => proof.platform === platformFilter &&
|
|
131
|
+
proof.verificationStatus === verificationStatus_1.VerificationStatus.VERIFIED);
|
|
132
|
+
if (!hasVerifiedProofOnPlatform) {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const score = this.calculateRelevanceScore(profile, normalizedQuery);
|
|
137
|
+
if (score > 0) {
|
|
138
|
+
scoredResults.push({ profile, relevanceScore: score });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// Requirement 5.3: Sort by relevance score descending
|
|
142
|
+
scoredResults.sort((a, b) => b.relevanceScore - a.relevanceScore);
|
|
143
|
+
const totalCount = scoredResults.length;
|
|
144
|
+
const paginatedResults = scoredResults.slice(offset, offset + limit);
|
|
145
|
+
const hasMore = offset + limit < totalCount;
|
|
146
|
+
return {
|
|
147
|
+
results: paginatedResults,
|
|
148
|
+
totalCount,
|
|
149
|
+
hasMore,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Get a profile by member ID.
|
|
154
|
+
*
|
|
155
|
+
* Unlike {@link search}, this method returns profiles regardless of
|
|
156
|
+
* privacy mode. This allows existing contacts to look up a member
|
|
157
|
+
* directly even when the member has opted out of directory listing.
|
|
158
|
+
*
|
|
159
|
+
* **Validates: Requirements 5.1, 5.9**
|
|
160
|
+
*
|
|
161
|
+
* @param memberId - The member ID to look up
|
|
162
|
+
* @returns The public profile
|
|
163
|
+
* @throws {ProfileNotFoundError} If no profile exists for the member ID
|
|
164
|
+
*/
|
|
165
|
+
getProfile(memberId) {
|
|
166
|
+
const profile = this.profiles.get(memberId);
|
|
167
|
+
if (!profile) {
|
|
168
|
+
throw new ProfileNotFoundError(memberId);
|
|
169
|
+
}
|
|
170
|
+
return profile;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Add or update a profile in the directory.
|
|
174
|
+
*
|
|
175
|
+
* If a profile already exists for the member ID, it is replaced.
|
|
176
|
+
* The `updatedAt` timestamp is set to the current time on update.
|
|
177
|
+
*
|
|
178
|
+
* **Validates: Requirements 5.1, 5.8**
|
|
179
|
+
*
|
|
180
|
+
* @param profile - The public profile to store
|
|
181
|
+
* @throws {InvalidProfileError} If required fields are missing
|
|
182
|
+
*/
|
|
183
|
+
updateProfile(profile) {
|
|
184
|
+
this.validateProfile(profile);
|
|
185
|
+
const existing = this.profiles.get(profile.memberId);
|
|
186
|
+
if (existing) {
|
|
187
|
+
// Preserve createdAt from the original profile
|
|
188
|
+
const updated = {
|
|
189
|
+
...profile,
|
|
190
|
+
createdAt: existing.createdAt,
|
|
191
|
+
updatedAt: new Date(),
|
|
192
|
+
};
|
|
193
|
+
this.profiles.set(profile.memberId, updated);
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
this.profiles.set(profile.memberId, { ...profile });
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Toggle privacy mode for a member's profile.
|
|
201
|
+
*
|
|
202
|
+
* When privacy mode is enabled, the profile is excluded from search
|
|
203
|
+
* results (Requirement 5.9) but can still be accessed directly via
|
|
204
|
+
* {@link getProfile}.
|
|
205
|
+
*
|
|
206
|
+
* **Validates: Requirements 5.6, 5.9**
|
|
207
|
+
*
|
|
208
|
+
* @param memberId - The member whose privacy mode to toggle
|
|
209
|
+
* @returns The new privacy mode state (`true` = private, `false` = public)
|
|
210
|
+
* @throws {ProfileNotFoundError} If no profile exists for the member ID
|
|
211
|
+
*/
|
|
212
|
+
togglePrivacyMode(memberId) {
|
|
213
|
+
const profile = this.profiles.get(memberId);
|
|
214
|
+
if (!profile) {
|
|
215
|
+
throw new ProfileNotFoundError(memberId);
|
|
216
|
+
}
|
|
217
|
+
profile.privacyMode = !profile.privacyMode;
|
|
218
|
+
profile.updatedAt = new Date();
|
|
219
|
+
return profile.privacyMode;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Get the total number of profiles in the directory.
|
|
223
|
+
*/
|
|
224
|
+
get size() {
|
|
225
|
+
return this.profiles.size;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Check whether a profile exists for the given member ID.
|
|
229
|
+
*/
|
|
230
|
+
hasProfile(memberId) {
|
|
231
|
+
return this.profiles.has(memberId);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Remove a profile from the directory.
|
|
235
|
+
*
|
|
236
|
+
* @param memberId - The member whose profile to remove
|
|
237
|
+
* @returns `true` if a profile was removed, `false` if none existed
|
|
238
|
+
*/
|
|
239
|
+
removeProfile(memberId) {
|
|
240
|
+
return this.profiles.delete(memberId);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Remove all profiles from the directory.
|
|
244
|
+
* Useful for testing.
|
|
245
|
+
*/
|
|
246
|
+
clear() {
|
|
247
|
+
this.profiles.clear();
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Calculate the relevance score for a profile against a search query.
|
|
251
|
+
*
|
|
252
|
+
* Scoring strategy (Requirement 5.3):
|
|
253
|
+
* - Exact member ID match: highest score
|
|
254
|
+
* - Exact display name match: high score
|
|
255
|
+
* - Display name prefix match: medium-high score
|
|
256
|
+
* - Exact social username match: high score
|
|
257
|
+
* - Social username prefix match: medium score
|
|
258
|
+
* - Substring matches: lower scores
|
|
259
|
+
* - Bonus for each verified identity proof
|
|
260
|
+
*
|
|
261
|
+
* Only verified proofs are considered for username matching
|
|
262
|
+
* (Requirement 5.4).
|
|
263
|
+
*
|
|
264
|
+
* @param profile - The profile to score
|
|
265
|
+
* @param normalizedQuery - The lowercase, trimmed search query
|
|
266
|
+
* @returns The relevance score (0 means no match)
|
|
267
|
+
*/
|
|
268
|
+
calculateRelevanceScore(profile, normalizedQuery) {
|
|
269
|
+
let score = 0;
|
|
270
|
+
// Check member ID match
|
|
271
|
+
const normalizedMemberId = profile.memberId.toLowerCase();
|
|
272
|
+
if (normalizedMemberId === normalizedQuery) {
|
|
273
|
+
score = Math.max(score, SCORE_EXACT_MEMBER_ID);
|
|
274
|
+
}
|
|
275
|
+
else if (normalizedMemberId.includes(normalizedQuery)) {
|
|
276
|
+
// Partial member ID match gets a moderate score
|
|
277
|
+
score = Math.max(score, SCORE_DISPLAY_NAME_CONTAINS);
|
|
278
|
+
}
|
|
279
|
+
// Check display name match
|
|
280
|
+
const normalizedDisplayName = profile.displayName.toLowerCase();
|
|
281
|
+
if (normalizedDisplayName === normalizedQuery) {
|
|
282
|
+
score = Math.max(score, SCORE_EXACT_DISPLAY_NAME);
|
|
283
|
+
}
|
|
284
|
+
else if (normalizedDisplayName.startsWith(normalizedQuery)) {
|
|
285
|
+
score = Math.max(score, SCORE_DISPLAY_NAME_PREFIX);
|
|
286
|
+
}
|
|
287
|
+
else if (normalizedDisplayName.includes(normalizedQuery)) {
|
|
288
|
+
score = Math.max(score, SCORE_DISPLAY_NAME_CONTAINS);
|
|
289
|
+
}
|
|
290
|
+
// Check social usernames from verified proofs (Requirement 5.4)
|
|
291
|
+
const verifiedProofs = profile.identityProofs.filter((proof) => proof.verificationStatus === verificationStatus_1.VerificationStatus.VERIFIED);
|
|
292
|
+
for (const proof of verifiedProofs) {
|
|
293
|
+
const normalizedUsername = proof.username.toLowerCase();
|
|
294
|
+
if (normalizedUsername === normalizedQuery) {
|
|
295
|
+
score = Math.max(score, SCORE_EXACT_USERNAME);
|
|
296
|
+
}
|
|
297
|
+
else if (normalizedUsername.startsWith(normalizedQuery)) {
|
|
298
|
+
score = Math.max(score, SCORE_USERNAME_PREFIX);
|
|
299
|
+
}
|
|
300
|
+
else if (normalizedUsername.includes(normalizedQuery)) {
|
|
301
|
+
score = Math.max(score, SCORE_USERNAME_CONTAINS);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
// Bonus for verified proofs (more verified = more trustworthy)
|
|
305
|
+
if (score > 0) {
|
|
306
|
+
score += verifiedProofs.length * SCORE_VERIFIED_PROOF_BONUS;
|
|
307
|
+
}
|
|
308
|
+
return score;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Validate that a profile has all required fields.
|
|
312
|
+
*
|
|
313
|
+
* @throws {InvalidProfileError} If validation fails
|
|
314
|
+
*/
|
|
315
|
+
validateProfile(profile) {
|
|
316
|
+
if (!profile.memberId || profile.memberId.trim().length === 0) {
|
|
317
|
+
throw new InvalidProfileError('Profile must have a non-empty memberId');
|
|
318
|
+
}
|
|
319
|
+
if (!profile.displayName || profile.displayName.trim().length === 0) {
|
|
320
|
+
throw new InvalidProfileError('Profile must have a non-empty displayName');
|
|
321
|
+
}
|
|
322
|
+
if (!profile.publicKey || profile.publicKey.trim().length === 0) {
|
|
323
|
+
throw new InvalidProfileError('Profile must have a non-empty publicKey');
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
exports.PublicKeyDirectoryService = PublicKeyDirectoryService;
|
|
328
|
+
//# sourceMappingURL=publicKeyDirectoryService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publicKeyDirectoryService.js","sourceRoot":"","sources":["../../../../../../brightchain-lib/src/lib/services/identity/publicKeyDirectoryService.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAGH,8EAA2E;AAG3E,+EAA+E;AAE/E;;GAEG;AACH,MAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,QAAgB;QAC1B,KAAK,CAAC,iCAAiC,QAAQ,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AALD,oDAKC;AAED;;GAEG;AACH,MAAa,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AALD,kDAKC;AAmDD,+EAA+E;AAE/E,iDAAiD;AACjD,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC,uEAAuE;AACvE,MAAM,wBAAwB,GAAG,E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D,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChE,MAAM,IAAI,mBAAmB,CAAC,yCAAyC,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;CACF;AAxQD,8DAwQC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split Paper Key Service for the BrightChain identity system.
|
|
3
|
+
*
|
|
4
|
+
* Splits a 24-word BIP39 paper key into N Shamir's Secret Sharing
|
|
5
|
+
* shares with a configurable threshold T. Any T shares can reconstruct
|
|
6
|
+
* the original paper key; fewer than T shares reveal nothing.
|
|
7
|
+
*
|
|
8
|
+
* Each share is encoded as a human-readable word sequence using the
|
|
9
|
+
* BIP39 English wordlist as a dictionary (11 bits per word). Because
|
|
10
|
+
* Shamir shares include metadata (bit-width, share index) and internal
|
|
11
|
+
* padding, they are larger than the original 32-byte entropy, so they
|
|
12
|
+
* cannot be represented as standard BIP39 mnemonics. Instead, the
|
|
13
|
+
* service uses a raw 11-bit-per-word encoding that preserves the full
|
|
14
|
+
* share hex string for lossless round-trip reconstruction.
|
|
15
|
+
*
|
|
16
|
+
* Requirements: 2.1, 2.2, 2.3, 2.4, 2.7
|
|
17
|
+
*/
|
|
18
|
+
import { ISplitPaperKeyShare } from '../../interfaces/identity/splitPaperKey';
|
|
19
|
+
/**
|
|
20
|
+
* Service for splitting and reconstructing BIP39 paper keys using
|
|
21
|
+
* Shamir's Secret Sharing.
|
|
22
|
+
*
|
|
23
|
+
* All methods are static — the service is stateless and safe to call
|
|
24
|
+
* from any context (browser or Node.js).
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* // Split a 24-word paper key into 5 shares, requiring 3 to reconstruct
|
|
29
|
+
* const shares = SplitPaperKeyService.split(paperKey, 5, 3);
|
|
30
|
+
*
|
|
31
|
+
* // Reconstruct from any 3 shares
|
|
32
|
+
* const recovered = SplitPaperKeyService.reconstruct(shares, 5);
|
|
33
|
+
*
|
|
34
|
+
* // Generate a printable template for share #1
|
|
35
|
+
* const template = await SplitPaperKeyService.generateShareTemplate(
|
|
36
|
+
* shares[0], 1, 5, 3,
|
|
37
|
+
* );
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare class SplitPaperKeyService {
|
|
41
|
+
/**
|
|
42
|
+
* Split a 24-word BIP39 paper key into N Shamir shares.
|
|
43
|
+
*
|
|
44
|
+
* The paper key mnemonic is converted to its 32-byte entropy, then
|
|
45
|
+
* the entropy hex is split using Shamir's Secret Sharing. Each
|
|
46
|
+
* resulting share hex is encoded as human-readable words using the
|
|
47
|
+
* BIP39 wordlist (11 bits per word).
|
|
48
|
+
*
|
|
49
|
+
* **Validates: Requirements 2.1, 2.2, 2.3**
|
|
50
|
+
*
|
|
51
|
+
* @param paperKey - A valid 24-word BIP39 mnemonic
|
|
52
|
+
* @param shares - Total number of shares to generate (2–1,048,575)
|
|
53
|
+
* @param threshold - Minimum shares needed to reconstruct (2–shares)
|
|
54
|
+
* @returns Array of word-encoded share strings (space-separated words)
|
|
55
|
+
* @throws {Error} If the paper key is invalid or parameters are out of range
|
|
56
|
+
*/
|
|
57
|
+
static split(paperKey: string, shares: number, threshold: number): string[];
|
|
58
|
+
/**
|
|
59
|
+
* Reconstruct a paper key from T or more Shamir shares.
|
|
60
|
+
*
|
|
61
|
+
* The word-encoded shares are decoded back to hex, combined using
|
|
62
|
+
* Shamir's Secret Sharing, and the resulting entropy is converted
|
|
63
|
+
* back to a 24-word BIP39 mnemonic.
|
|
64
|
+
*
|
|
65
|
+
* **Validates: Requirement 2.4**
|
|
66
|
+
*
|
|
67
|
+
* @param shares - Array of word-encoded share strings (at least threshold count)
|
|
68
|
+
* @param totalShares - The total number of shares originally created
|
|
69
|
+
* (needed to re-initialise the secrets library with
|
|
70
|
+
* the correct Galois Field bit-width)
|
|
71
|
+
* @returns The original 24-word BIP39 paper key
|
|
72
|
+
* @throws {Error} If shares are invalid or reconstruction fails
|
|
73
|
+
*/
|
|
74
|
+
static reconstruct(shares: string[], totalShares: number): string;
|
|
75
|
+
/**
|
|
76
|
+
* Generate a printable template for a single share.
|
|
77
|
+
*
|
|
78
|
+
* Produces an {@link ISplitPaperKeyShare} containing the share words,
|
|
79
|
+
* a QR code data URL for mobile scanning, and human-readable
|
|
80
|
+
* instructions with share number, total count, and threshold.
|
|
81
|
+
*
|
|
82
|
+
* **Validates: Requirement 2.7**
|
|
83
|
+
*
|
|
84
|
+
* @param share - Space-separated word-encoded share string
|
|
85
|
+
* @param shareNumber - 1-based index of this share
|
|
86
|
+
* @param totalShares - Total number of shares created
|
|
87
|
+
* @param threshold - Minimum shares needed to reconstruct
|
|
88
|
+
* @returns A promise resolving to the complete {@link ISplitPaperKeyShare}
|
|
89
|
+
*/
|
|
90
|
+
static generateShareTemplate(share: string, shareNumber: number, totalShares: number, threshold: number): Promise<ISplitPaperKeyShare>;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=splitPaperKeyService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splitPaperKeyService.d.ts","sourceRoot":"","sources":["../../../../../../brightchain-lib/src/lib/services/identity/splitPaperKeyService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAaH,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAuL9E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,oBAAoB;IAC/B;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE;IA4B3E;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM;IAqDjE;;;;;;;;;;;;;;OAcG;WACU,qBAAqB,CAChC,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,mBAAmB,CAAC;CAgBhC"}
|