@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,810 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Email Validator Service
|
|
4
|
+
*
|
|
5
|
+
* Validates email messages against RFC 5322/MIME requirements.
|
|
6
|
+
* Uses the `email-addresses` library for RFC 5322 address parsing/validation
|
|
7
|
+
* and `validator.isEmail()` for basic email format validation.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This class implements header validation methods for Task 2.1:
|
|
11
|
+
* - validateHeaderName(): RFC 5322 character validation
|
|
12
|
+
* - validateMailbox(): Address format validation
|
|
13
|
+
* - validateMessageId(): Message-ID format validation
|
|
14
|
+
* - validateDate(): RFC 5322 date format validation
|
|
15
|
+
*
|
|
16
|
+
* Address length validation (Task 2.3):
|
|
17
|
+
* - validateAddressLength(): Validates total address and local-part length limits
|
|
18
|
+
* - Length checks are also integrated into validateMailbox()
|
|
19
|
+
*
|
|
20
|
+
* Content validation (validateContentType, validateMultipartBoundary,
|
|
21
|
+
* validateContentTransferEncoding) and size validation (validateAttachmentSize,
|
|
22
|
+
* validateMessageSize) are implemented in separate tasks (2.5, 2.6).
|
|
23
|
+
*
|
|
24
|
+
* @see RFC 5322 Section 2.2 - Header Fields
|
|
25
|
+
* @see RFC 5322 Section 3.3 - Date and Time Specification
|
|
26
|
+
* @see RFC 5322 Section 3.4 - Address Specification
|
|
27
|
+
* @see RFC 5322 Section 3.6.4 - Identification Fields
|
|
28
|
+
*
|
|
29
|
+
* Requirements: 1.7, 2.5, 2.6, 15.2, 15.3, 15.4, 15.10
|
|
30
|
+
*/
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.EmailValidator = void 0;
|
|
33
|
+
const emailAddresses = require("email-addresses");
|
|
34
|
+
const validator_1 = require("validator");
|
|
35
|
+
const emailErrorType_1 = require("../../enumerations/messaging/emailErrorType");
|
|
36
|
+
const mimePart_1 = require("../../interfaces/messaging/mimePart");
|
|
37
|
+
/**
|
|
38
|
+
* Validates email messages against RFC 5322/MIME requirements.
|
|
39
|
+
*
|
|
40
|
+
* @see Design Document: EmailValidator Class
|
|
41
|
+
*/
|
|
42
|
+
class EmailValidator {
|
|
43
|
+
/**
|
|
44
|
+
* Validates an RFC 5322 header field name.
|
|
45
|
+
*
|
|
46
|
+
* Per RFC 5322 Section 2.2, a header field name must consist of
|
|
47
|
+
* printable US-ASCII characters (codes 33-126) excluding the colon (':').
|
|
48
|
+
* The field name must also be non-empty.
|
|
49
|
+
*
|
|
50
|
+
* @param name - The header field name to validate
|
|
51
|
+
* @returns true if the name is a valid RFC 5322 header field name
|
|
52
|
+
*
|
|
53
|
+
* @see RFC 5322 Section 2.2
|
|
54
|
+
* @see Requirement 1.7 - Validate header field names
|
|
55
|
+
* @see Requirement 15.3 - Validate header field names contain only valid characters
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const validator = new EmailValidator();
|
|
60
|
+
* validator.validateHeaderName('Content-Type'); // true
|
|
61
|
+
* validator.validateHeaderName('X-Custom'); // true
|
|
62
|
+
* validator.validateHeaderName('Bad:Name'); // false (contains colon)
|
|
63
|
+
* validator.validateHeaderName('Bad Name'); // false (contains space, code 32)
|
|
64
|
+
* validator.validateHeaderName(''); // false (empty)
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
validateHeaderName(name) {
|
|
68
|
+
// Must be non-empty
|
|
69
|
+
if (name.length === 0) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
// Each character must be printable US-ASCII (33-126) excluding colon (58)
|
|
73
|
+
for (let i = 0; i < name.length; i++) {
|
|
74
|
+
const code = name.charCodeAt(i);
|
|
75
|
+
if (code < 33 || code > 126 || code === 58) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Validates an IMailbox address using the `email-addresses` library
|
|
83
|
+
* for RFC 5322 address grammar parsing and `validator.isEmail()` for
|
|
84
|
+
* basic format validation.
|
|
85
|
+
*
|
|
86
|
+
* Validation checks:
|
|
87
|
+
* 1. localPart and domain must be non-empty strings
|
|
88
|
+
* 2. The composed address must pass `validator.isEmail()` basic format check
|
|
89
|
+
* 3. The address must parse successfully with the `email-addresses` library
|
|
90
|
+
* using RFC 5322 grammar
|
|
91
|
+
*
|
|
92
|
+
* @param mailbox - The IMailbox to validate
|
|
93
|
+
* @returns IValidationResult with valid flag and any errors
|
|
94
|
+
*
|
|
95
|
+
* @see RFC 5322 Section 3.4
|
|
96
|
+
* @see Requirement 15.2 - Validate From header contains exactly one mailbox
|
|
97
|
+
* @see Requirement 15.10 - Validate date-time format per RFC 5322
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* const validator = new EmailValidator();
|
|
102
|
+
* const result = validator.validateMailbox({
|
|
103
|
+
* localPart: 'john',
|
|
104
|
+
* domain: 'example.com',
|
|
105
|
+
* get address() { return `${this.localPart}@${this.domain}`; }
|
|
106
|
+
* });
|
|
107
|
+
* // result.valid === true
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
validateMailbox(mailbox) {
|
|
111
|
+
const errors = [];
|
|
112
|
+
// Check that localPart is non-empty
|
|
113
|
+
if (!mailbox.localPart || mailbox.localPart.trim().length === 0) {
|
|
114
|
+
errors.push({
|
|
115
|
+
code: emailErrorType_1.EmailErrorType.INVALID_MAILBOX,
|
|
116
|
+
field: 'localPart',
|
|
117
|
+
message: 'Local part must not be empty',
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
// Check that domain is non-empty
|
|
121
|
+
if (!mailbox.domain || mailbox.domain.trim().length === 0) {
|
|
122
|
+
errors.push({
|
|
123
|
+
code: emailErrorType_1.EmailErrorType.INVALID_MAILBOX,
|
|
124
|
+
field: 'domain',
|
|
125
|
+
message: 'Domain must not be empty',
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
// If basic fields are missing, return early
|
|
129
|
+
if (errors.length > 0) {
|
|
130
|
+
return { valid: false, errors };
|
|
131
|
+
}
|
|
132
|
+
// Validate address length constraints per RFC 5321
|
|
133
|
+
const lengthResult = this.validateAddressLength(mailbox);
|
|
134
|
+
if (!lengthResult.valid) {
|
|
135
|
+
return lengthResult;
|
|
136
|
+
}
|
|
137
|
+
const address = mailbox.address;
|
|
138
|
+
// Use validator.isEmail() for basic email format validation
|
|
139
|
+
if (!validator_1.default.isEmail(address)) {
|
|
140
|
+
errors.push({
|
|
141
|
+
code: emailErrorType_1.EmailErrorType.INVALID_MAILBOX,
|
|
142
|
+
field: 'address',
|
|
143
|
+
message: `Invalid email address format: ${address}`,
|
|
144
|
+
});
|
|
145
|
+
return { valid: false, errors };
|
|
146
|
+
}
|
|
147
|
+
// Use email-addresses library for RFC 5322 address grammar parsing
|
|
148
|
+
// Build the full mailbox string for parsing (with display name if present)
|
|
149
|
+
const mailboxString = mailbox.displayName
|
|
150
|
+
? `"${mailbox.displayName}" <${address}>`
|
|
151
|
+
: address;
|
|
152
|
+
const parsed = emailAddresses.parseOneAddress({
|
|
153
|
+
input: mailboxString,
|
|
154
|
+
rfc6532: true,
|
|
155
|
+
});
|
|
156
|
+
if (!parsed) {
|
|
157
|
+
errors.push({
|
|
158
|
+
code: emailErrorType_1.EmailErrorType.INVALID_MAILBOX,
|
|
159
|
+
field: 'address',
|
|
160
|
+
message: `Address does not conform to RFC 5322 grammar: ${mailboxString}`,
|
|
161
|
+
});
|
|
162
|
+
return { valid: false, errors };
|
|
163
|
+
}
|
|
164
|
+
return { valid: true, errors: [] };
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Validates the length constraints of an email address per RFC 5321.
|
|
168
|
+
*
|
|
169
|
+
* Per RFC 5321:
|
|
170
|
+
* - The total address (local-part@domain) must not exceed 254 characters
|
|
171
|
+
* (Section 4.5.3.1.3: path is max 256 octets including angle brackets)
|
|
172
|
+
* - The local-part must not exceed 64 characters (Section 4.5.3.1.1)
|
|
173
|
+
*
|
|
174
|
+
* @param mailbox - The IMailbox to validate for length constraints
|
|
175
|
+
* @returns IValidationResult with valid flag and any length-related errors
|
|
176
|
+
*
|
|
177
|
+
* @see RFC 5321 Section 4.5.3.1
|
|
178
|
+
* @see Requirement 2.5 - Reject addresses exceeding 254 characters total length
|
|
179
|
+
* @see Requirement 2.6 - Reject local-parts exceeding 64 characters
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```typescript
|
|
183
|
+
* const validator = new EmailValidator();
|
|
184
|
+
*
|
|
185
|
+
* // Valid address
|
|
186
|
+
* const result1 = validator.validateAddressLength(
|
|
187
|
+
* createMailbox('user', 'example.com')
|
|
188
|
+
* );
|
|
189
|
+
* // result1.valid === true
|
|
190
|
+
*
|
|
191
|
+
* // Local-part too long (> 64 characters)
|
|
192
|
+
* const result2 = validator.validateAddressLength(
|
|
193
|
+
* createMailbox('a'.repeat(65), 'example.com')
|
|
194
|
+
* );
|
|
195
|
+
* // result2.valid === false, error code INVALID_MAILBOX
|
|
196
|
+
*
|
|
197
|
+
* // Total address too long (> 254 characters)
|
|
198
|
+
* const result3 = validator.validateAddressLength(
|
|
199
|
+
* createMailbox('user', 'a'.repeat(250) + '.com')
|
|
200
|
+
* );
|
|
201
|
+
* // result3.valid === false, error code INVALID_MAILBOX
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
204
|
+
validateAddressLength(mailbox) {
|
|
205
|
+
const errors = [];
|
|
206
|
+
// Validate local-part length <= 64 characters per RFC 5321 Section 4.5.3.1.1
|
|
207
|
+
if (mailbox.localPart.length > EmailValidator.MAX_LOCAL_PART_LENGTH) {
|
|
208
|
+
errors.push({
|
|
209
|
+
code: emailErrorType_1.EmailErrorType.INVALID_MAILBOX,
|
|
210
|
+
field: 'localPart',
|
|
211
|
+
message: `Local part exceeds maximum length of ${EmailValidator.MAX_LOCAL_PART_LENGTH} characters: ${mailbox.localPart.length} characters`,
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
// Validate total address length <= 254 characters per RFC 5321 Section 4.5.3.1.3
|
|
215
|
+
const address = mailbox.address;
|
|
216
|
+
if (address.length > EmailValidator.MAX_ADDRESS_LENGTH) {
|
|
217
|
+
errors.push({
|
|
218
|
+
code: emailErrorType_1.EmailErrorType.INVALID_MAILBOX,
|
|
219
|
+
field: 'address',
|
|
220
|
+
message: `Email address exceeds maximum length of ${EmailValidator.MAX_ADDRESS_LENGTH} characters: ${address.length} characters`,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
return {
|
|
224
|
+
valid: errors.length === 0,
|
|
225
|
+
errors,
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Validates a Message-ID string per RFC 5322 Section 3.6.4.
|
|
230
|
+
*
|
|
231
|
+
* A valid Message-ID must:
|
|
232
|
+
* 1. Be enclosed in angle brackets: `<id-left@id-right>`
|
|
233
|
+
* 2. Contain exactly one '@' character within the angle brackets
|
|
234
|
+
* 3. Have non-empty id-left and id-right portions
|
|
235
|
+
*
|
|
236
|
+
* @param messageId - The Message-ID string to validate
|
|
237
|
+
* @returns true if the Message-ID is valid per RFC 5322
|
|
238
|
+
*
|
|
239
|
+
* @see RFC 5322 Section 3.6.4
|
|
240
|
+
* @see Requirement 15.4 - Validate required headers (Message-ID)
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```typescript
|
|
244
|
+
* const validator = new EmailValidator();
|
|
245
|
+
* validator.validateMessageId('<unique-id@example.com>'); // true
|
|
246
|
+
* validator.validateMessageId('no-brackets@example.com'); // false
|
|
247
|
+
* validator.validateMessageId('<no-at-sign>'); // false
|
|
248
|
+
* validator.validateMessageId('<two@@signs>'); // false
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
validateMessageId(messageId) {
|
|
252
|
+
// Must be non-empty
|
|
253
|
+
if (!messageId || messageId.length === 0) {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
// Must be enclosed in angle brackets
|
|
257
|
+
if (!messageId.startsWith('<') || !messageId.endsWith('>')) {
|
|
258
|
+
return false;
|
|
259
|
+
}
|
|
260
|
+
// Extract the content between angle brackets
|
|
261
|
+
const content = messageId.slice(1, -1);
|
|
262
|
+
// Content must be non-empty
|
|
263
|
+
if (content.length === 0) {
|
|
264
|
+
return false;
|
|
265
|
+
}
|
|
266
|
+
// Must contain exactly one '@' character
|
|
267
|
+
const atParts = content.split('@');
|
|
268
|
+
if (atParts.length !== 2) {
|
|
269
|
+
return false;
|
|
270
|
+
}
|
|
271
|
+
const [idLeft, idRight] = atParts;
|
|
272
|
+
// Both id-left and id-right must be non-empty
|
|
273
|
+
if (idLeft.length === 0 || idRight.length === 0) {
|
|
274
|
+
return false;
|
|
275
|
+
}
|
|
276
|
+
return true;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Validates a Date object for RFC 5322 date-time format compliance.
|
|
280
|
+
*
|
|
281
|
+
* Per RFC 5322 Section 3.3, a date-time must represent a valid date.
|
|
282
|
+
* This method checks that:
|
|
283
|
+
* 1. The date is a valid Date object (not NaN/Invalid Date)
|
|
284
|
+
* 2. The date is not unreasonably far in the future (more than 1 day ahead,
|
|
285
|
+
* to allow for timezone differences)
|
|
286
|
+
* 3. The date is not before the epoch of email (RFC 822 was published in 1982,
|
|
287
|
+
* but we use year 1970 as a reasonable lower bound)
|
|
288
|
+
*
|
|
289
|
+
* @param date - The Date object to validate
|
|
290
|
+
* @returns true if the date is valid for RFC 5322
|
|
291
|
+
*
|
|
292
|
+
* @see RFC 5322 Section 3.3
|
|
293
|
+
* @see Requirement 15.10 - Validate date-time format per RFC 5322
|
|
294
|
+
*
|
|
295
|
+
* @example
|
|
296
|
+
* ```typescript
|
|
297
|
+
* const validator = new EmailValidator();
|
|
298
|
+
* validator.validateDate(new Date()); // true
|
|
299
|
+
* validator.validateDate(new Date('2024-01-15')); // true
|
|
300
|
+
* validator.validateDate(new Date('invalid')); // false
|
|
301
|
+
* validator.validateDate(new Date('1960-01-01')); // false (before 1970)
|
|
302
|
+
* ```
|
|
303
|
+
*/
|
|
304
|
+
validateDate(date) {
|
|
305
|
+
// Must be a Date object
|
|
306
|
+
if (!(date instanceof Date)) {
|
|
307
|
+
return false;
|
|
308
|
+
}
|
|
309
|
+
// Must not be an invalid date (NaN)
|
|
310
|
+
if (isNaN(date.getTime())) {
|
|
311
|
+
return false;
|
|
312
|
+
}
|
|
313
|
+
// Must not be before the epoch (1970-01-01)
|
|
314
|
+
// RFC 822 was published in 1982, but 1970 is a reasonable lower bound
|
|
315
|
+
const epochStart = new Date('1970-01-01T00:00:00Z');
|
|
316
|
+
if (date.getTime() < epochStart.getTime()) {
|
|
317
|
+
return false;
|
|
318
|
+
}
|
|
319
|
+
// Must not be unreasonably far in the future (more than 1 day ahead)
|
|
320
|
+
// This allows for timezone differences while catching obviously wrong dates
|
|
321
|
+
const oneDayFromNow = new Date(Date.now() + 24 * 60 * 60 * 1000);
|
|
322
|
+
if (date.getTime() > oneDayFromNow.getTime()) {
|
|
323
|
+
return false;
|
|
324
|
+
}
|
|
325
|
+
return true;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Checks whether a string is a valid RFC 2045 token.
|
|
329
|
+
* A token consists of any US-ASCII character (1-127) except CTLs (0-31, 127),
|
|
330
|
+
* spaces (32), and tspecials.
|
|
331
|
+
*
|
|
332
|
+
* @param value - The string to check
|
|
333
|
+
* @returns true if the string is a valid token
|
|
334
|
+
*/
|
|
335
|
+
isValidToken(value) {
|
|
336
|
+
if (value.length === 0) {
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
for (let i = 0; i < value.length; i++) {
|
|
340
|
+
const code = value.charCodeAt(i);
|
|
341
|
+
// Must be US-ASCII (1-126), not CTL (0-31, 127), not space (32)
|
|
342
|
+
if (code <= 32 || code >= 127) {
|
|
343
|
+
return false;
|
|
344
|
+
}
|
|
345
|
+
if (EmailValidator.TSPECIALS.has(value[i])) {
|
|
346
|
+
return false;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return true;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Validates a Content-Type header per RFC 2045.
|
|
353
|
+
*
|
|
354
|
+
* Validation rules:
|
|
355
|
+
* 1. type must be non-empty and contain only valid token characters
|
|
356
|
+
* 2. subtype must be non-empty and contain only valid token characters
|
|
357
|
+
* 3. type must be a recognized discrete or composite type
|
|
358
|
+
* 4. If type is "multipart", parameters must include a "boundary" parameter
|
|
359
|
+
*
|
|
360
|
+
* @param contentType - The IContentType to validate
|
|
361
|
+
* @returns IValidationResult with valid flag and any errors
|
|
362
|
+
*
|
|
363
|
+
* @see RFC 2045 Section 5.1 - Syntax of the Content-Type Header Field
|
|
364
|
+
* @see Requirement 15.6 - Validate Content-Type headers are well-formed with valid type/subtype
|
|
365
|
+
*
|
|
366
|
+
* @example
|
|
367
|
+
* ```typescript
|
|
368
|
+
* const validator = new EmailValidator();
|
|
369
|
+
* const result = validator.validateContentType(
|
|
370
|
+
* createContentType('text', 'plain', new Map([['charset', 'utf-8']]))
|
|
371
|
+
* );
|
|
372
|
+
* // result.valid === true
|
|
373
|
+
* ```
|
|
374
|
+
*/
|
|
375
|
+
validateContentType(contentType) {
|
|
376
|
+
const errors = [];
|
|
377
|
+
// Validate type is a valid token
|
|
378
|
+
if (!this.isValidToken(contentType.type)) {
|
|
379
|
+
errors.push({
|
|
380
|
+
code: emailErrorType_1.EmailErrorType.INVALID_CONTENT_TYPE,
|
|
381
|
+
field: 'contentType.type',
|
|
382
|
+
message: `Invalid Content-Type type: "${contentType.type}". Must be a non-empty RFC 2045 token.`,
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
// Validate subtype is a valid token
|
|
386
|
+
if (!this.isValidToken(contentType.subtype)) {
|
|
387
|
+
errors.push({
|
|
388
|
+
code: emailErrorType_1.EmailErrorType.INVALID_CONTENT_TYPE,
|
|
389
|
+
field: 'contentType.subtype',
|
|
390
|
+
message: `Invalid Content-Type subtype: "${contentType.subtype}". Must be a non-empty RFC 2045 token.`,
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
// If type/subtype are invalid tokens, return early
|
|
394
|
+
if (errors.length > 0) {
|
|
395
|
+
return { valid: false, errors };
|
|
396
|
+
}
|
|
397
|
+
// Validate type is a recognized discrete or composite type (case-insensitive)
|
|
398
|
+
const typeLower = contentType.type.toLowerCase();
|
|
399
|
+
if (!EmailValidator.VALID_DISCRETE_TYPES.has(typeLower) &&
|
|
400
|
+
!EmailValidator.VALID_COMPOSITE_TYPES.has(typeLower)) {
|
|
401
|
+
errors.push({
|
|
402
|
+
code: emailErrorType_1.EmailErrorType.INVALID_CONTENT_TYPE,
|
|
403
|
+
field: 'contentType.type',
|
|
404
|
+
message: `Unrecognized Content-Type type: "${contentType.type}". Must be one of: text, image, audio, video, application, multipart, message.`,
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
// If type is "multipart", parameters must include a "boundary" parameter
|
|
408
|
+
if (typeLower === 'multipart') {
|
|
409
|
+
const hasBoundary = Array.from(contentType.parameters.keys()).some((key) => key.toLowerCase() === 'boundary');
|
|
410
|
+
if (!hasBoundary) {
|
|
411
|
+
errors.push({
|
|
412
|
+
code: emailErrorType_1.EmailErrorType.INVALID_BOUNDARY,
|
|
413
|
+
field: 'contentType.parameters.boundary',
|
|
414
|
+
message: 'Multipart Content-Type must include a "boundary" parameter.',
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
return {
|
|
419
|
+
valid: errors.length === 0,
|
|
420
|
+
errors,
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Validates a multipart boundary string per RFC 2046 Section 5.1.1.
|
|
425
|
+
*
|
|
426
|
+
* Validation rules:
|
|
427
|
+
* 1. Boundary must be 1-70 characters long
|
|
428
|
+
* 2. Boundary must consist of valid boundary characters (RFC 2046 bchars)
|
|
429
|
+
* 3. The last character must not be a space
|
|
430
|
+
* 4. The boundary string must not appear in the content (ensures uniqueness)
|
|
431
|
+
*
|
|
432
|
+
* @param boundary - The boundary string to validate
|
|
433
|
+
* @param content - The message content as Uint8Array to check for boundary collisions
|
|
434
|
+
* @returns true if the boundary is valid
|
|
435
|
+
*
|
|
436
|
+
* @see RFC 2046 Section 5.1.1 - Common Syntax
|
|
437
|
+
* @see Requirement 15.7 - Validate that multipart messages have valid boundary parameters
|
|
438
|
+
*
|
|
439
|
+
* @example
|
|
440
|
+
* ```typescript
|
|
441
|
+
* const validator = new EmailValidator();
|
|
442
|
+
* const content = new TextEncoder().encode('Hello, world!');
|
|
443
|
+
* validator.validateMultipartBoundary('----=_Part_123', content); // true
|
|
444
|
+
* validator.validateMultipartBoundary('', content); // false (empty)
|
|
445
|
+
* ```
|
|
446
|
+
*/
|
|
447
|
+
validateMultipartBoundary(boundary, content) {
|
|
448
|
+
// Must be 1-70 characters
|
|
449
|
+
if (boundary.length < 1 || boundary.length > 70) {
|
|
450
|
+
return false;
|
|
451
|
+
}
|
|
452
|
+
// All characters must be valid boundary characters
|
|
453
|
+
for (let i = 0; i < boundary.length; i++) {
|
|
454
|
+
if (!EmailValidator.BOUNDARY_CHARS.has(boundary[i])) {
|
|
455
|
+
return false;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
// Last character must not be a space
|
|
459
|
+
if (boundary[boundary.length - 1] === ' ') {
|
|
460
|
+
return false;
|
|
461
|
+
}
|
|
462
|
+
// The boundary string must not appear in the content
|
|
463
|
+
const boundaryBytes = new TextEncoder().encode(boundary);
|
|
464
|
+
const contentLength = content.length;
|
|
465
|
+
const boundaryLength = boundaryBytes.length;
|
|
466
|
+
if (contentLength >= boundaryLength) {
|
|
467
|
+
for (let i = 0; i <= contentLength - boundaryLength; i++) {
|
|
468
|
+
let match = true;
|
|
469
|
+
for (let j = 0; j < boundaryLength; j++) {
|
|
470
|
+
if (content[i + j] !== boundaryBytes[j]) {
|
|
471
|
+
match = false;
|
|
472
|
+
break;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
if (match) {
|
|
476
|
+
return false;
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
return true;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Validates a Content-Transfer-Encoding value per RFC 2045 Section 6.
|
|
484
|
+
*
|
|
485
|
+
* Valid values are: "7bit", "8bit", "binary", "quoted-printable", "base64".
|
|
486
|
+
* Comparison is case-insensitive per RFC 2045.
|
|
487
|
+
*
|
|
488
|
+
* @param encoding - The encoding string to validate
|
|
489
|
+
* @returns true if the encoding is a valid Content-Transfer-Encoding value
|
|
490
|
+
*
|
|
491
|
+
* @see RFC 2045 Section 6 - Content-Transfer-Encoding Header Field
|
|
492
|
+
* @see Requirement 15.8 - Validate Content-Transfer-Encoding values
|
|
493
|
+
*
|
|
494
|
+
* @example
|
|
495
|
+
* ```typescript
|
|
496
|
+
* const validator = new EmailValidator();
|
|
497
|
+
* validator.validateContentTransferEncoding('base64'); // true
|
|
498
|
+
* validator.validateContentTransferEncoding('Base64'); // true (case-insensitive)
|
|
499
|
+
* validator.validateContentTransferEncoding('quoted-printable'); // true
|
|
500
|
+
* validator.validateContentTransferEncoding('invalid'); // false
|
|
501
|
+
* ```
|
|
502
|
+
*/
|
|
503
|
+
validateContentTransferEncoding(encoding) {
|
|
504
|
+
if (!encoding || encoding.length === 0) {
|
|
505
|
+
return false;
|
|
506
|
+
}
|
|
507
|
+
const normalizedEncoding = encoding.toLowerCase();
|
|
508
|
+
// Check against all valid ContentTransferEncoding values
|
|
509
|
+
return (normalizedEncoding === mimePart_1.ContentTransferEncoding.SevenBit ||
|
|
510
|
+
normalizedEncoding === mimePart_1.ContentTransferEncoding.EightBit ||
|
|
511
|
+
normalizedEncoding === mimePart_1.ContentTransferEncoding.Binary ||
|
|
512
|
+
normalizedEncoding === mimePart_1.ContentTransferEncoding.QuotedPrintable ||
|
|
513
|
+
normalizedEncoding === mimePart_1.ContentTransferEncoding.Base64);
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Validates that an attachment does not exceed the configured maximum size.
|
|
517
|
+
*
|
|
518
|
+
* @param attachment - The attachment input to validate
|
|
519
|
+
* @param maxSize - Maximum allowed attachment size in bytes (default: 25MB)
|
|
520
|
+
* @returns IValidationResult with valid flag and any errors
|
|
521
|
+
*
|
|
522
|
+
* @see Requirement 8.5 - Configurable maximum attachment size limit (default: 25MB per attachment)
|
|
523
|
+
*
|
|
524
|
+
* @example
|
|
525
|
+
* ```typescript
|
|
526
|
+
* const validator = new EmailValidator();
|
|
527
|
+
* const result = validator.validateAttachmentSize({ filename: 'doc.pdf', size: 1024 });
|
|
528
|
+
* // result.valid === true
|
|
529
|
+
*
|
|
530
|
+
* const result2 = validator.validateAttachmentSize(
|
|
531
|
+
* { filename: 'huge.zip', size: 30 * 1024 * 1024 }
|
|
532
|
+
* );
|
|
533
|
+
* // result2.valid === false, error code ATTACHMENT_TOO_LARGE
|
|
534
|
+
* ```
|
|
535
|
+
*/
|
|
536
|
+
validateAttachmentSize(attachment, maxSize = EmailValidator.DEFAULT_MAX_ATTACHMENT_SIZE) {
|
|
537
|
+
const errors = [];
|
|
538
|
+
if (attachment.size > maxSize) {
|
|
539
|
+
errors.push({
|
|
540
|
+
code: emailErrorType_1.EmailErrorType.ATTACHMENT_TOO_LARGE,
|
|
541
|
+
field: 'attachment.size',
|
|
542
|
+
message: `Attachment "${attachment.filename}" exceeds maximum size of ${maxSize} bytes: ${attachment.size} bytes`,
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
return {
|
|
546
|
+
valid: errors.length === 0,
|
|
547
|
+
errors,
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Validates that the total message size does not exceed the configured maximum.
|
|
552
|
+
*
|
|
553
|
+
* Total message size is calculated as the sum of bodySize and all attachment sizes.
|
|
554
|
+
*
|
|
555
|
+
* @param email - The email input to validate
|
|
556
|
+
* @param maxSize - Maximum allowed total message size in bytes (default: 50MB)
|
|
557
|
+
* @returns IValidationResult with valid flag and any errors
|
|
558
|
+
*
|
|
559
|
+
* @see Requirement 8.6 - Configurable maximum total message size limit (default: 50MB)
|
|
560
|
+
* @see Requirement 15.9 - Validate total message size does not exceed configured maximum
|
|
561
|
+
*
|
|
562
|
+
* @example
|
|
563
|
+
* ```typescript
|
|
564
|
+
* const validator = new EmailValidator();
|
|
565
|
+
* const result = validator.validateMessageSize({
|
|
566
|
+
* bodySize: 1024,
|
|
567
|
+
* attachments: [{ filename: 'doc.pdf', size: 2048 }],
|
|
568
|
+
* });
|
|
569
|
+
* // result.valid === true
|
|
570
|
+
* ```
|
|
571
|
+
*/
|
|
572
|
+
validateMessageSize(email, maxSize = EmailValidator.DEFAULT_MAX_MESSAGE_SIZE) {
|
|
573
|
+
const errors = [];
|
|
574
|
+
let totalSize = email.bodySize ?? 0;
|
|
575
|
+
if (email.attachments) {
|
|
576
|
+
for (const attachment of email.attachments) {
|
|
577
|
+
totalSize += attachment.size;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
if (totalSize > maxSize) {
|
|
581
|
+
errors.push({
|
|
582
|
+
code: emailErrorType_1.EmailErrorType.MESSAGE_TOO_LARGE,
|
|
583
|
+
field: 'message.size',
|
|
584
|
+
message: `Total message size exceeds maximum of ${maxSize} bytes: ${totalSize} bytes`,
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
return {
|
|
588
|
+
valid: errors.length === 0,
|
|
589
|
+
errors,
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Performs full validation of an email input, combining all individual validations.
|
|
594
|
+
*
|
|
595
|
+
* Validation steps:
|
|
596
|
+
* 1. Validate that `from` is present and valid (using validateMailbox)
|
|
597
|
+
* 2. Validate that at least one recipient exists (to, cc, or bcc has at least one entry)
|
|
598
|
+
* 3. Validate all recipient mailboxes (to, cc, bcc) using validateMailbox
|
|
599
|
+
* 4. Validate date if present (using validateDate)
|
|
600
|
+
* 5. Validate messageId if present (using validateMessageId)
|
|
601
|
+
* 6. Validate contentType if present (using validateContentType)
|
|
602
|
+
* 7. Validate each attachment size (using validateAttachmentSize)
|
|
603
|
+
* 8. Validate total message size (using validateMessageSize)
|
|
604
|
+
* 9. Collect ALL errors from all validations and return them in a single IValidationResult
|
|
605
|
+
*
|
|
606
|
+
* @param email - The email input to validate
|
|
607
|
+
* @returns IValidationResult with valid flag and all collected error details
|
|
608
|
+
*
|
|
609
|
+
* @see Requirement 15.1 - Validate at least one recipient (To, Cc, or Bcc) is specified
|
|
610
|
+
* @see Requirement 15.5 - Return structured error with error code, field name, and description
|
|
611
|
+
*
|
|
612
|
+
* @example
|
|
613
|
+
* ```typescript
|
|
614
|
+
* const validator = new EmailValidator();
|
|
615
|
+
* const result = validator.validate({
|
|
616
|
+
* from: createMailbox('sender', 'example.com'),
|
|
617
|
+
* to: [createMailbox('recipient', 'example.com')],
|
|
618
|
+
* });
|
|
619
|
+
* // result.valid === true
|
|
620
|
+
* ```
|
|
621
|
+
*/
|
|
622
|
+
validate(email, config) {
|
|
623
|
+
const errors = [];
|
|
624
|
+
// 1. Validate that `from` is present and valid
|
|
625
|
+
if (!email.from) {
|
|
626
|
+
errors.push({
|
|
627
|
+
code: emailErrorType_1.EmailErrorType.MISSING_REQUIRED_HEADER,
|
|
628
|
+
field: 'from',
|
|
629
|
+
message: 'From header is required',
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
else {
|
|
633
|
+
const fromResult = this.validateMailbox(email.from);
|
|
634
|
+
if (!fromResult.valid) {
|
|
635
|
+
errors.push(...fromResult.errors);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
// 2. Validate that at least one recipient exists (to, cc, or bcc)
|
|
639
|
+
const hasTo = email.to && email.to.length > 0;
|
|
640
|
+
const hasCc = email.cc && email.cc.length > 0;
|
|
641
|
+
const hasBcc = email.bcc && email.bcc.length > 0;
|
|
642
|
+
if (!hasTo && !hasCc && !hasBcc) {
|
|
643
|
+
errors.push({
|
|
644
|
+
code: emailErrorType_1.EmailErrorType.NO_RECIPIENTS,
|
|
645
|
+
field: 'recipients',
|
|
646
|
+
message: 'At least one recipient (To, Cc, or Bcc) must be specified',
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
// 3. Validate all recipient mailboxes
|
|
650
|
+
if (email.to) {
|
|
651
|
+
for (let i = 0; i < email.to.length; i++) {
|
|
652
|
+
const result = this.validateMailbox(email.to[i]);
|
|
653
|
+
if (!result.valid) {
|
|
654
|
+
for (const err of result.errors) {
|
|
655
|
+
errors.push({
|
|
656
|
+
code: err.code,
|
|
657
|
+
field: `to[${i}].${err.field}`,
|
|
658
|
+
message: err.message,
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
if (email.cc) {
|
|
665
|
+
for (let i = 0; i < email.cc.length; i++) {
|
|
666
|
+
const result = this.validateMailbox(email.cc[i]);
|
|
667
|
+
if (!result.valid) {
|
|
668
|
+
for (const err of result.errors) {
|
|
669
|
+
errors.push({
|
|
670
|
+
code: err.code,
|
|
671
|
+
field: `cc[${i}].${err.field}`,
|
|
672
|
+
message: err.message,
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
if (email.bcc) {
|
|
679
|
+
for (let i = 0; i < email.bcc.length; i++) {
|
|
680
|
+
const result = this.validateMailbox(email.bcc[i]);
|
|
681
|
+
if (!result.valid) {
|
|
682
|
+
for (const err of result.errors) {
|
|
683
|
+
errors.push({
|
|
684
|
+
code: err.code,
|
|
685
|
+
field: `bcc[${i}].${err.field}`,
|
|
686
|
+
message: err.message,
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
// 4. Validate date if present
|
|
693
|
+
if (email.date !== undefined) {
|
|
694
|
+
if (!this.validateDate(email.date)) {
|
|
695
|
+
errors.push({
|
|
696
|
+
code: emailErrorType_1.EmailErrorType.INVALID_DATE,
|
|
697
|
+
field: 'date',
|
|
698
|
+
message: 'Invalid date value',
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
// 5. Validate messageId if present
|
|
703
|
+
if (email.messageId !== undefined) {
|
|
704
|
+
if (!this.validateMessageId(email.messageId)) {
|
|
705
|
+
errors.push({
|
|
706
|
+
code: emailErrorType_1.EmailErrorType.INVALID_MESSAGE_ID,
|
|
707
|
+
field: 'messageId',
|
|
708
|
+
message: `Invalid Message-ID format: ${email.messageId}`,
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
// 6. Validate contentType if present
|
|
713
|
+
if (email.contentType !== undefined) {
|
|
714
|
+
const ctResult = this.validateContentType(email.contentType);
|
|
715
|
+
if (!ctResult.valid) {
|
|
716
|
+
errors.push(...ctResult.errors);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
// 7. Validate each attachment size
|
|
720
|
+
if (email.attachments) {
|
|
721
|
+
for (let i = 0; i < email.attachments.length; i++) {
|
|
722
|
+
const attResult = this.validateAttachmentSize(email.attachments[i], config?.maxAttachmentSize);
|
|
723
|
+
if (!attResult.valid) {
|
|
724
|
+
errors.push(...attResult.errors);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
// 8. Validate total message size
|
|
729
|
+
const sizeResult = this.validateMessageSize(email, config?.maxMessageSize);
|
|
730
|
+
if (!sizeResult.valid) {
|
|
731
|
+
errors.push(...sizeResult.errors);
|
|
732
|
+
}
|
|
733
|
+
return {
|
|
734
|
+
valid: errors.length === 0,
|
|
735
|
+
errors,
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
exports.EmailValidator = EmailValidator;
|
|
740
|
+
/**
|
|
741
|
+
* Maximum total length of an email address per RFC 5321 Section 4.5.3.1.3.
|
|
742
|
+
* The path (including angle brackets) is limited to 256 octets, which means
|
|
743
|
+
* the addr-spec itself is limited to 254 characters.
|
|
744
|
+
*/
|
|
745
|
+
EmailValidator.MAX_ADDRESS_LENGTH = 254;
|
|
746
|
+
/**
|
|
747
|
+
* Maximum length of the local-part of an email address per RFC 5321 Section 4.5.3.1.1.
|
|
748
|
+
*/
|
|
749
|
+
EmailValidator.MAX_LOCAL_PART_LENGTH = 64;
|
|
750
|
+
/**
|
|
751
|
+
* Valid discrete MIME types per RFC 2046.
|
|
752
|
+
*/
|
|
753
|
+
EmailValidator.VALID_DISCRETE_TYPES = new Set([
|
|
754
|
+
'text',
|
|
755
|
+
'image',
|
|
756
|
+
'audio',
|
|
757
|
+
'video',
|
|
758
|
+
'application',
|
|
759
|
+
]);
|
|
760
|
+
/**
|
|
761
|
+
* Valid composite MIME types per RFC 2046.
|
|
762
|
+
*/
|
|
763
|
+
EmailValidator.VALID_COMPOSITE_TYPES = new Set([
|
|
764
|
+
'multipart',
|
|
765
|
+
'message',
|
|
766
|
+
]);
|
|
767
|
+
/**
|
|
768
|
+
* RFC 2045 token characters.
|
|
769
|
+
* A token is composed of any US-ASCII character except CTLs (0-31, 127),
|
|
770
|
+
* spaces (32), and tspecials.
|
|
771
|
+
*
|
|
772
|
+
* tspecials: ( ) < > @ , ; : \ " / [ ] ? =
|
|
773
|
+
*/
|
|
774
|
+
EmailValidator.TSPECIALS = new Set([
|
|
775
|
+
'(',
|
|
776
|
+
')',
|
|
777
|
+
'<',
|
|
778
|
+
'>',
|
|
779
|
+
'@',
|
|
780
|
+
',',
|
|
781
|
+
';',
|
|
782
|
+
':',
|
|
783
|
+
'\\',
|
|
784
|
+
'"',
|
|
785
|
+
'/',
|
|
786
|
+
'[',
|
|
787
|
+
']',
|
|
788
|
+
'?',
|
|
789
|
+
'=',
|
|
790
|
+
]);
|
|
791
|
+
/**
|
|
792
|
+
* Valid boundary characters per RFC 2046 Section 5.1.1.
|
|
793
|
+
*
|
|
794
|
+
* bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / "+" / "_" / "," / "-" / "." / "/" / ":" / "=" / "?"
|
|
795
|
+
* bchars := bcharsnospace / " "
|
|
796
|
+
*
|
|
797
|
+
* Note: The last character of a boundary must NOT be a space.
|
|
798
|
+
*/
|
|
799
|
+
EmailValidator.BOUNDARY_CHARS = new Set("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'()+_,-./:=? ".split(''));
|
|
800
|
+
/**
|
|
801
|
+
* Default maximum attachment size: 25MB per attachment.
|
|
802
|
+
* @see Requirement 8.5
|
|
803
|
+
*/
|
|
804
|
+
EmailValidator.DEFAULT_MAX_ATTACHMENT_SIZE = 25 * 1024 * 1024;
|
|
805
|
+
/**
|
|
806
|
+
* Default maximum total message size: 50MB.
|
|
807
|
+
* @see Requirement 8.6
|
|
808
|
+
*/
|
|
809
|
+
EmailValidator.DEFAULT_MAX_MESSAGE_SIZE = 50 * 1024 * 1024;
|
|
810
|
+
//# sourceMappingURL=emailValidator.js.map
|