@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.
Files changed (705) hide show
  1. package/brightchain-lib/BROWSER_COMPAT.md +54 -0
  2. package/package.json +15 -4
  3. package/src/browser.d.ts +1 -1
  4. package/src/browser.d.ts.map +1 -1
  5. package/src/browser.js +3 -3
  6. package/src/browser.js.map +1 -1
  7. package/src/lib/blocks/cblBase.d.ts +16 -1
  8. package/src/lib/blocks/cblBase.d.ts.map +1 -1
  9. package/src/lib/blocks/cblBase.js +33 -4
  10. package/src/lib/blocks/cblBase.js.map +1 -1
  11. package/src/lib/blocks/encryptedBlockFactory.d.ts +6 -1
  12. package/src/lib/blocks/encryptedBlockFactory.d.ts.map +1 -1
  13. package/src/lib/blocks/encryptedBlockFactory.js +14 -5
  14. package/src/lib/blocks/encryptedBlockFactory.js.map +1 -1
  15. package/src/lib/blocks/extendedCbl.d.ts.map +1 -1
  16. package/src/lib/blocks/extendedCbl.js +2 -1
  17. package/src/lib/blocks/extendedCbl.js.map +1 -1
  18. package/src/lib/blocks/handle.d.ts +5 -0
  19. package/src/lib/blocks/handle.d.ts.map +1 -1
  20. package/src/lib/blocks/handle.js.map +1 -1
  21. package/src/lib/blocks/handleTuple.d.ts +9 -1
  22. package/src/lib/blocks/handleTuple.d.ts.map +1 -1
  23. package/src/lib/blocks/handleTuple.js +23 -1
  24. package/src/lib/blocks/handleTuple.js.map +1 -1
  25. package/src/lib/blocks/index.d.ts +1 -0
  26. package/src/lib/blocks/index.d.ts.map +1 -1
  27. package/src/lib/blocks/index.js +1 -0
  28. package/src/lib/blocks/index.js.map +1 -1
  29. package/src/lib/blocks/memoryTuple.d.ts +9 -2
  30. package/src/lib/blocks/memoryTuple.d.ts.map +1 -1
  31. package/src/lib/blocks/memoryTuple.js +12 -3
  32. package/src/lib/blocks/memoryTuple.js.map +1 -1
  33. package/src/lib/blocks/vcbl.d.ts +27 -0
  34. package/src/lib/blocks/vcbl.d.ts.map +1 -0
  35. package/src/lib/blocks/vcbl.js +107 -0
  36. package/src/lib/blocks/vcbl.js.map +1 -0
  37. package/src/lib/constants.d.ts +5 -1
  38. package/src/lib/constants.d.ts.map +1 -1
  39. package/src/lib/constants.js +4 -0
  40. package/src/lib/constants.js.map +1 -1
  41. package/src/lib/crypto/index.d.ts +12 -0
  42. package/src/lib/crypto/index.d.ts.map +1 -0
  43. package/src/lib/crypto/index.js +23 -0
  44. package/src/lib/crypto/index.js.map +1 -0
  45. package/src/lib/crypto/platformCrypto.d.ts +132 -0
  46. package/src/lib/crypto/platformCrypto.d.ts.map +1 -0
  47. package/src/lib/crypto/platformCrypto.js +181 -0
  48. package/src/lib/crypto/platformCrypto.js.map +1 -0
  49. package/src/lib/enumeration-translations/blockType.d.ts.map +1 -1
  50. package/src/lib/enumeration-translations/blockType.js +16 -0
  51. package/src/lib/enumeration-translations/blockType.js.map +1 -1
  52. package/src/lib/enumerations/blockType.d.ts +12 -0
  53. package/src/lib/enumerations/blockType.d.ts.map +1 -1
  54. package/src/lib/enumerations/blockType.js +14 -0
  55. package/src/lib/enumerations/blockType.js.map +1 -1
  56. package/src/lib/enumerations/brightChainStrings.d.ts +5 -1
  57. package/src/lib/enumerations/brightChainStrings.d.ts.map +1 -1
  58. package/src/lib/enumerations/brightChainStrings.js +5 -1
  59. package/src/lib/enumerations/brightChainStrings.js.map +1 -1
  60. package/src/lib/enumerations/cblErrorType.d.ts +2 -1
  61. package/src/lib/enumerations/cblErrorType.d.ts.map +1 -1
  62. package/src/lib/enumerations/cblErrorType.js +1 -0
  63. package/src/lib/enumerations/cblErrorType.js.map +1 -1
  64. package/src/lib/enumerations/communication.d.ts +57 -0
  65. package/src/lib/enumerations/communication.d.ts.map +1 -0
  66. package/src/lib/enumerations/communication.js +89 -0
  67. package/src/lib/enumerations/communication.js.map +1 -0
  68. package/src/lib/enumerations/deviceType.d.ts +15 -0
  69. package/src/lib/enumerations/deviceType.d.ts.map +1 -0
  70. package/src/lib/enumerations/deviceType.js +19 -0
  71. package/src/lib/enumerations/deviceType.js.map +1 -0
  72. package/src/lib/enumerations/handleTupleErrorType.d.ts +2 -1
  73. package/src/lib/enumerations/handleTupleErrorType.d.ts.map +1 -1
  74. package/src/lib/enumerations/handleTupleErrorType.js +1 -0
  75. package/src/lib/enumerations/handleTupleErrorType.js.map +1 -1
  76. package/src/lib/enumerations/index.d.ts +6 -0
  77. package/src/lib/enumerations/index.d.ts.map +1 -1
  78. package/src/lib/enumerations/index.js +11 -0
  79. package/src/lib/enumerations/index.js.map +1 -1
  80. package/src/lib/enumerations/messaging/deliveryStatus.d.ts +50 -0
  81. package/src/lib/enumerations/messaging/deliveryStatus.d.ts.map +1 -0
  82. package/src/lib/enumerations/messaging/deliveryStatus.js +68 -0
  83. package/src/lib/enumerations/messaging/deliveryStatus.js.map +1 -0
  84. package/src/lib/enumerations/messaging/emailErrorType.d.ts +36 -0
  85. package/src/lib/enumerations/messaging/emailErrorType.d.ts.map +1 -0
  86. package/src/lib/enumerations/messaging/emailErrorType.js +46 -0
  87. package/src/lib/enumerations/messaging/emailErrorType.js.map +1 -0
  88. package/src/lib/enumerations/messaging/index.d.ts +2 -1
  89. package/src/lib/enumerations/messaging/index.d.ts.map +1 -1
  90. package/src/lib/enumerations/messaging/index.js +2 -1
  91. package/src/lib/enumerations/messaging/index.js.map +1 -1
  92. package/src/lib/enumerations/messaging/messageEncryptionScheme.d.ts +4 -2
  93. package/src/lib/enumerations/messaging/messageEncryptionScheme.d.ts.map +1 -1
  94. package/src/lib/enumerations/messaging/messageEncryptionScheme.js +3 -1
  95. package/src/lib/enumerations/messaging/messageEncryptionScheme.js.map +1 -1
  96. package/src/lib/enumerations/paperKeyPurpose.d.ts +15 -0
  97. package/src/lib/enumerations/paperKeyPurpose.d.ts.map +1 -0
  98. package/src/lib/enumerations/paperKeyPurpose.js +19 -0
  99. package/src/lib/enumerations/paperKeyPurpose.js.map +1 -0
  100. package/src/lib/enumerations/proofPlatform.d.ts +24 -0
  101. package/src/lib/enumerations/proofPlatform.d.ts.map +1 -0
  102. package/src/lib/enumerations/proofPlatform.js +28 -0
  103. package/src/lib/enumerations/proofPlatform.js.map +1 -0
  104. package/src/lib/enumerations/readConcern.d.ts +22 -0
  105. package/src/lib/enumerations/readConcern.d.ts.map +1 -0
  106. package/src/lib/enumerations/readConcern.js +26 -0
  107. package/src/lib/enumerations/readConcern.js.map +1 -0
  108. package/src/lib/enumerations/tupleErrorType.d.ts +2 -1
  109. package/src/lib/enumerations/tupleErrorType.d.ts.map +1 -1
  110. package/src/lib/enumerations/tupleErrorType.js +1 -0
  111. package/src/lib/enumerations/tupleErrorType.js.map +1 -1
  112. package/src/lib/enumerations/verificationStatus.d.ts +17 -0
  113. package/src/lib/enumerations/verificationStatus.d.ts.map +1 -0
  114. package/src/lib/enumerations/verificationStatus.js +21 -0
  115. package/src/lib/enumerations/verificationStatus.js.map +1 -0
  116. package/src/lib/errors/blockFetchError.d.ts +51 -0
  117. package/src/lib/errors/blockFetchError.d.ts.map +1 -0
  118. package/src/lib/errors/blockFetchError.js +63 -0
  119. package/src/lib/errors/blockFetchError.js.map +1 -0
  120. package/src/lib/errors/cblError.d.ts.map +1 -1
  121. package/src/lib/errors/cblError.js +1 -0
  122. package/src/lib/errors/cblError.js.map +1 -1
  123. package/src/lib/errors/handleTupleError.d.ts +10 -1
  124. package/src/lib/errors/handleTupleError.d.ts.map +1 -1
  125. package/src/lib/errors/handleTupleError.js +10 -1
  126. package/src/lib/errors/handleTupleError.js.map +1 -1
  127. package/src/lib/errors/index.d.ts +16 -0
  128. package/src/lib/errors/index.d.ts.map +1 -1
  129. package/src/lib/errors/index.js +22 -0
  130. package/src/lib/errors/index.js.map +1 -1
  131. package/src/lib/errors/messaging/emailError.d.ts +55 -0
  132. package/src/lib/errors/messaging/emailError.d.ts.map +1 -0
  133. package/src/lib/errors/messaging/emailError.js +64 -0
  134. package/src/lib/errors/messaging/emailError.js.map +1 -0
  135. package/src/lib/errors/messaging/index.d.ts +1 -0
  136. package/src/lib/errors/messaging/index.d.ts.map +1 -1
  137. package/src/lib/errors/messaging/index.js +1 -0
  138. package/src/lib/errors/messaging/index.js.map +1 -1
  139. package/src/lib/errors/poolDeletionError.d.ts +10 -0
  140. package/src/lib/errors/poolDeletionError.d.ts.map +1 -0
  141. package/src/lib/errors/poolDeletionError.js +16 -0
  142. package/src/lib/errors/poolDeletionError.js.map +1 -0
  143. package/src/lib/errors/poolDeletionTombstoneError.d.ts +12 -0
  144. package/src/lib/errors/poolDeletionTombstoneError.d.ts.map +1 -0
  145. package/src/lib/errors/poolDeletionTombstoneError.js +18 -0
  146. package/src/lib/errors/poolDeletionTombstoneError.js.map +1 -0
  147. package/src/lib/errors/tupleError.d.ts.map +1 -1
  148. package/src/lib/errors/tupleError.js +1 -0
  149. package/src/lib/errors/tupleError.js.map +1 -1
  150. package/src/lib/i18n/i18n-setup.d.ts +7 -2
  151. package/src/lib/i18n/i18n-setup.d.ts.map +1 -1
  152. package/src/lib/i18n/i18n-setup.js +84 -24
  153. package/src/lib/i18n/i18n-setup.js.map +1 -1
  154. package/src/lib/i18n/strings/englishUs.d.ts.map +1 -1
  155. package/src/lib/i18n/strings/englishUs.js +4 -0
  156. package/src/lib/i18n/strings/englishUs.js.map +1 -1
  157. package/src/lib/i18n/strings/french.d.ts.map +1 -1
  158. package/src/lib/i18n/strings/french.js +4 -0
  159. package/src/lib/i18n/strings/french.js.map +1 -1
  160. package/src/lib/i18n/strings/german.d.ts.map +1 -1
  161. package/src/lib/i18n/strings/german.js +4 -0
  162. package/src/lib/i18n/strings/german.js.map +1 -1
  163. package/src/lib/i18n/strings/japanese.d.ts.map +1 -1
  164. package/src/lib/i18n/strings/japanese.js +4 -0
  165. package/src/lib/i18n/strings/japanese.js.map +1 -1
  166. package/src/lib/i18n/strings/mandarin.d.ts.map +1 -1
  167. package/src/lib/i18n/strings/mandarin.js +4 -0
  168. package/src/lib/i18n/strings/mandarin.js.map +1 -1
  169. package/src/lib/i18n/strings/spanish.d.ts.map +1 -1
  170. package/src/lib/i18n/strings/spanish.js +4 -0
  171. package/src/lib/i18n/strings/spanish.js.map +1 -1
  172. package/src/lib/i18n/strings/ukrainian.d.ts.map +1 -1
  173. package/src/lib/i18n/strings/ukrainian.js +4 -0
  174. package/src/lib/i18n/strings/ukrainian.js.map +1 -1
  175. package/src/lib/index.d.ts +4 -0
  176. package/src/lib/index.d.ts.map +1 -1
  177. package/src/lib/index.js +4 -0
  178. package/src/lib/index.js.map +1 -1
  179. package/src/lib/interfaces/auth/index.d.ts +4 -0
  180. package/src/lib/interfaces/auth/index.d.ts.map +1 -0
  181. package/src/lib/interfaces/auth/index.js +8 -0
  182. package/src/lib/interfaces/auth/index.js.map +1 -0
  183. package/src/lib/interfaces/auth/nodeAuthenticator.d.ts +19 -0
  184. package/src/lib/interfaces/auth/nodeAuthenticator.d.ts.map +1 -0
  185. package/src/lib/interfaces/auth/nodeAuthenticator.js +3 -0
  186. package/src/lib/interfaces/auth/nodeAuthenticator.js.map +1 -0
  187. package/src/lib/interfaces/auth/poolAcl.d.ts +65 -0
  188. package/src/lib/interfaces/auth/poolAcl.d.ts.map +1 -0
  189. package/src/lib/interfaces/auth/poolAcl.js +52 -0
  190. package/src/lib/interfaces/auth/poolAcl.js.map +1 -0
  191. package/src/lib/interfaces/availability/availabilityService.d.ts +5 -3
  192. package/src/lib/interfaces/availability/availabilityService.d.ts.map +1 -1
  193. package/src/lib/interfaces/availability/availabilityService.js.map +1 -1
  194. package/src/lib/interfaces/availability/blockRegistry.d.ts +52 -3
  195. package/src/lib/interfaces/availability/blockRegistry.d.ts.map +1 -1
  196. package/src/lib/interfaces/availability/blockRegistry.js +1 -1
  197. package/src/lib/interfaces/availability/discoveryProtocol.d.ts +81 -3
  198. package/src/lib/interfaces/availability/discoveryProtocol.d.ts.map +1 -1
  199. package/src/lib/interfaces/availability/discoveryProtocol.js.map +1 -1
  200. package/src/lib/interfaces/availability/gossipService.d.ts +279 -8
  201. package/src/lib/interfaces/availability/gossipService.d.ts.map +1 -1
  202. package/src/lib/interfaces/availability/gossipService.js +232 -0
  203. package/src/lib/interfaces/availability/gossipService.js.map +1 -1
  204. package/src/lib/interfaces/availability/index.d.ts +1 -0
  205. package/src/lib/interfaces/availability/index.d.ts.map +1 -1
  206. package/src/lib/interfaces/availability/index.js +1 -0
  207. package/src/lib/interfaces/availability/index.js.map +1 -1
  208. package/src/lib/interfaces/availability/locationRecord.d.ts +6 -0
  209. package/src/lib/interfaces/availability/locationRecord.d.ts.map +1 -1
  210. package/src/lib/interfaces/availability/locationRecord.js +12 -0
  211. package/src/lib/interfaces/availability/locationRecord.js.map +1 -1
  212. package/src/lib/interfaces/availability/poolDeletionTombstone.d.ts +40 -0
  213. package/src/lib/interfaces/availability/poolDeletionTombstone.d.ts.map +1 -0
  214. package/src/lib/interfaces/availability/poolDeletionTombstone.js +19 -0
  215. package/src/lib/interfaces/availability/poolDeletionTombstone.js.map +1 -0
  216. package/src/lib/interfaces/availability/reconciliationService.d.ts +52 -0
  217. package/src/lib/interfaces/availability/reconciliationService.d.ts.map +1 -1
  218. package/src/lib/interfaces/availability/reconciliationService.js.map +1 -1
  219. package/src/lib/interfaces/blockCapacity.d.ts +9 -0
  220. package/src/lib/interfaces/blockCapacity.d.ts.map +1 -1
  221. package/src/lib/interfaces/blockEncryption.d.ts +4 -2
  222. package/src/lib/interfaces/blockEncryption.d.ts.map +1 -1
  223. package/src/lib/interfaces/blockFetch/blockFetchTransport.d.ts +26 -0
  224. package/src/lib/interfaces/blockFetch/blockFetchTransport.d.ts.map +1 -0
  225. package/src/lib/interfaces/blockFetch/blockFetchTransport.js +12 -0
  226. package/src/lib/interfaces/blockFetch/blockFetchTransport.js.map +1 -0
  227. package/src/lib/interfaces/blockFetch/blockFetcher.d.ts +71 -0
  228. package/src/lib/interfaces/blockFetch/blockFetcher.d.ts.map +1 -0
  229. package/src/lib/interfaces/blockFetch/blockFetcher.js +22 -0
  230. package/src/lib/interfaces/blockFetch/blockFetcher.js.map +1 -0
  231. package/src/lib/interfaces/blockFetch/enrichedQueryResult.d.ts +43 -0
  232. package/src/lib/interfaces/blockFetch/enrichedQueryResult.d.ts.map +1 -0
  233. package/src/lib/interfaces/blockFetch/enrichedQueryResult.js +13 -0
  234. package/src/lib/interfaces/blockFetch/enrichedQueryResult.js.map +1 -0
  235. package/src/lib/interfaces/blockFetch/fetchQueue.d.ts +70 -0
  236. package/src/lib/interfaces/blockFetch/fetchQueue.d.ts.map +1 -0
  237. package/src/lib/interfaces/blockFetch/fetchQueue.js +18 -0
  238. package/src/lib/interfaces/blockFetch/fetchQueue.js.map +1 -0
  239. package/src/lib/interfaces/blockFetch/index.d.ts +10 -0
  240. package/src/lib/interfaces/blockFetch/index.d.ts.map +1 -0
  241. package/src/lib/interfaces/blockFetch/index.js +13 -0
  242. package/src/lib/interfaces/blockFetch/index.js.map +1 -0
  243. package/src/lib/interfaces/blocks/index.d.ts +1 -0
  244. package/src/lib/interfaces/blocks/index.d.ts.map +1 -1
  245. package/src/lib/interfaces/blocks/vcbl.d.ts +16 -0
  246. package/src/lib/interfaces/blocks/vcbl.d.ts.map +1 -0
  247. package/src/lib/interfaces/{messaging/messageRouter.js → blocks/vcbl.js} +1 -1
  248. package/src/lib/interfaces/blocks/vcbl.js.map +1 -0
  249. package/src/lib/interfaces/brightpass/auditLog.d.ts +25 -0
  250. package/src/lib/interfaces/brightpass/auditLog.d.ts.map +1 -0
  251. package/src/lib/interfaces/brightpass/auditLog.js +21 -0
  252. package/src/lib/interfaces/brightpass/auditLog.js.map +1 -0
  253. package/src/lib/interfaces/brightpass/emergencyAccess.d.ts +11 -0
  254. package/src/lib/interfaces/brightpass/emergencyAccess.d.ts.map +1 -0
  255. package/src/lib/interfaces/{network/networkTransport.js → brightpass/emergencyAccess.js} +1 -1
  256. package/src/lib/interfaces/brightpass/emergencyAccess.js.map +1 -0
  257. package/src/lib/interfaces/brightpass/entryPropertyRecord.d.ts +11 -0
  258. package/src/lib/interfaces/brightpass/entryPropertyRecord.d.ts.map +1 -0
  259. package/src/lib/interfaces/brightpass/entryPropertyRecord.js +3 -0
  260. package/src/lib/interfaces/brightpass/entryPropertyRecord.js.map +1 -0
  261. package/src/lib/interfaces/brightpass/importTypes.d.ts +10 -0
  262. package/src/lib/interfaces/brightpass/importTypes.d.ts.map +1 -0
  263. package/src/lib/interfaces/brightpass/importTypes.js +3 -0
  264. package/src/lib/interfaces/brightpass/importTypes.js.map +1 -0
  265. package/src/lib/interfaces/brightpass/index.d.ts +7 -0
  266. package/src/lib/interfaces/brightpass/index.d.ts.map +1 -0
  267. package/src/lib/interfaces/brightpass/index.js +10 -0
  268. package/src/lib/interfaces/brightpass/index.js.map +1 -0
  269. package/src/lib/interfaces/brightpass/vaultEntry.d.ts +48 -0
  270. package/src/lib/interfaces/brightpass/vaultEntry.d.ts.map +1 -0
  271. package/src/lib/interfaces/brightpass/vaultEntry.js +3 -0
  272. package/src/lib/interfaces/brightpass/vaultEntry.js.map +1 -0
  273. package/src/lib/interfaces/brightpass/vaultMetadata.d.ts +34 -0
  274. package/src/lib/interfaces/brightpass/vaultMetadata.d.ts.map +1 -0
  275. package/src/lib/interfaces/brightpass/vaultMetadata.js +3 -0
  276. package/src/lib/interfaces/brightpass/vaultMetadata.js.map +1 -0
  277. package/src/lib/interfaces/clusterKeys.d.ts +4 -2
  278. package/src/lib/interfaces/clusterKeys.d.ts.map +1 -1
  279. package/src/lib/interfaces/communication.d.ts +173 -0
  280. package/src/lib/interfaces/communication.d.ts.map +1 -0
  281. package/src/lib/interfaces/communication.js +17 -0
  282. package/src/lib/interfaces/communication.js.map +1 -0
  283. package/src/lib/interfaces/communicationEvents.d.ts +168 -0
  284. package/src/lib/interfaces/communicationEvents.d.ts.map +1 -0
  285. package/src/lib/interfaces/communicationEvents.js +12 -0
  286. package/src/lib/interfaces/communicationEvents.js.map +1 -0
  287. package/src/lib/interfaces/crypto/ethereumWallet.d.ts +72 -0
  288. package/src/lib/interfaces/crypto/ethereumWallet.d.ts.map +1 -0
  289. package/src/lib/interfaces/crypto/ethereumWallet.js +12 -0
  290. package/src/lib/interfaces/crypto/ethereumWallet.js.map +1 -0
  291. package/src/lib/interfaces/crypto/gitSignature.d.ts +95 -0
  292. package/src/lib/interfaces/crypto/gitSignature.d.ts.map +1 -0
  293. package/src/lib/interfaces/crypto/gitSignature.js +12 -0
  294. package/src/lib/interfaces/crypto/gitSignature.js.map +1 -0
  295. package/src/lib/interfaces/crypto/index.d.ts +3 -0
  296. package/src/lib/interfaces/crypto/index.d.ts.map +1 -0
  297. package/src/lib/interfaces/crypto/index.js +3 -0
  298. package/src/lib/interfaces/crypto/index.js.map +1 -0
  299. package/src/lib/interfaces/dataKeyComponents.d.ts +7 -2
  300. package/src/lib/interfaces/dataKeyComponents.d.ts.map +1 -1
  301. package/src/lib/interfaces/encryptedBlockCreator.d.ts +4 -2
  302. package/src/lib/interfaces/encryptedBlockCreator.d.ts.map +1 -1
  303. package/src/lib/interfaces/events/communicationEventEmitter.d.ts +65 -0
  304. package/src/lib/interfaces/events/communicationEventEmitter.d.ts.map +1 -0
  305. package/src/lib/interfaces/events/communicationEventEmitter.js +60 -0
  306. package/src/lib/interfaces/events/communicationEventEmitter.js.map +1 -0
  307. package/src/lib/interfaces/events/index.d.ts +2 -0
  308. package/src/lib/interfaces/events/index.d.ts.map +1 -0
  309. package/src/lib/interfaces/events/index.js +5 -0
  310. package/src/lib/interfaces/events/index.js.map +1 -0
  311. package/src/lib/interfaces/failableResult.d.ts +15 -0
  312. package/src/lib/interfaces/failableResult.d.ts.map +1 -0
  313. package/src/lib/interfaces/failableResult.js +3 -0
  314. package/src/lib/interfaces/failableResult.js.map +1 -0
  315. package/src/lib/interfaces/identity/device.d.ts +59 -0
  316. package/src/lib/interfaces/identity/device.d.ts.map +1 -0
  317. package/src/lib/interfaces/identity/device.js +17 -0
  318. package/src/lib/interfaces/identity/device.js.map +1 -0
  319. package/src/lib/interfaces/identity/deviceKeyStorage.d.ts +71 -0
  320. package/src/lib/interfaces/identity/deviceKeyStorage.d.ts.map +1 -0
  321. package/src/lib/interfaces/identity/deviceKeyStorage.js +16 -0
  322. package/src/lib/interfaces/identity/deviceKeyStorage.js.map +1 -0
  323. package/src/lib/interfaces/identity/identityProof.d.ts +90 -0
  324. package/src/lib/interfaces/identity/identityProof.d.ts.map +1 -0
  325. package/src/lib/interfaces/identity/identityProof.js +18 -0
  326. package/src/lib/interfaces/identity/identityProof.js.map +1 -0
  327. package/src/lib/interfaces/identity/index.d.ts +7 -0
  328. package/src/lib/interfaces/identity/index.d.ts.map +1 -0
  329. package/src/lib/interfaces/identity/index.js +3 -0
  330. package/src/lib/interfaces/identity/index.js.map +1 -0
  331. package/src/lib/interfaces/identity/paperKey.d.ts +97 -0
  332. package/src/lib/interfaces/identity/paperKey.d.ts.map +1 -0
  333. package/src/lib/interfaces/identity/paperKey.js +17 -0
  334. package/src/lib/interfaces/identity/paperKey.js.map +1 -0
  335. package/src/lib/interfaces/identity/publicProfile.d.ts +74 -0
  336. package/src/lib/interfaces/identity/publicProfile.d.ts.map +1 -0
  337. package/src/lib/interfaces/identity/publicProfile.js +18 -0
  338. package/src/lib/interfaces/identity/publicProfile.js.map +1 -0
  339. package/src/lib/interfaces/identity/splitPaperKey.d.ts +73 -0
  340. package/src/lib/interfaces/identity/splitPaperKey.d.ts.map +1 -0
  341. package/src/lib/interfaces/identity/splitPaperKey.js +20 -0
  342. package/src/lib/interfaces/identity/splitPaperKey.js.map +1 -0
  343. package/src/lib/interfaces/index.d.ts +11 -2
  344. package/src/lib/interfaces/index.d.ts.map +1 -1
  345. package/src/lib/interfaces/index.js +12 -0
  346. package/src/lib/interfaces/index.js.map +1 -1
  347. package/src/lib/interfaces/messaging/attachmentMetadata.d.ts +47 -0
  348. package/src/lib/interfaces/messaging/attachmentMetadata.d.ts.map +1 -0
  349. package/src/lib/interfaces/messaging/attachmentMetadata.js +3 -0
  350. package/src/lib/interfaces/messaging/attachmentMetadata.js.map +1 -0
  351. package/src/lib/interfaces/messaging/emailAddress.d.ts +210 -0
  352. package/src/lib/interfaces/messaging/emailAddress.d.ts.map +1 -0
  353. package/src/lib/interfaces/messaging/emailAddress.js +213 -0
  354. package/src/lib/interfaces/messaging/emailAddress.js.map +1 -0
  355. package/src/lib/interfaces/messaging/emailDelivery.d.ts +80 -0
  356. package/src/lib/interfaces/messaging/emailDelivery.d.ts.map +1 -0
  357. package/src/lib/interfaces/messaging/emailDelivery.js +50 -0
  358. package/src/lib/interfaces/messaging/emailDelivery.js.map +1 -0
  359. package/src/lib/interfaces/messaging/emailMetadata.d.ts +269 -0
  360. package/src/lib/interfaces/messaging/emailMetadata.d.ts.map +1 -0
  361. package/src/lib/interfaces/messaging/emailMetadata.js +16 -0
  362. package/src/lib/interfaces/messaging/emailMetadata.js.map +1 -0
  363. package/src/lib/interfaces/messaging/index.d.ts +5 -1
  364. package/src/lib/interfaces/messaging/index.d.ts.map +1 -1
  365. package/src/lib/interfaces/messaging/index.js +5 -1
  366. package/src/lib/interfaces/messaging/index.js.map +1 -1
  367. package/src/lib/interfaces/messaging/messageMetadata.d.ts +2 -2
  368. package/src/lib/interfaces/messaging/messageMetadata.d.ts.map +1 -1
  369. package/src/lib/interfaces/messaging/messageMetadataStore.d.ts +2 -2
  370. package/src/lib/interfaces/messaging/messageMetadataStore.d.ts.map +1 -1
  371. package/src/lib/interfaces/messaging/mimePart.d.ts +214 -0
  372. package/src/lib/interfaces/messaging/mimePart.d.ts.map +1 -0
  373. package/src/lib/interfaces/messaging/mimePart.js +71 -0
  374. package/src/lib/interfaces/messaging/mimePart.js.map +1 -0
  375. package/src/lib/interfaces/network/index.d.ts +0 -1
  376. package/src/lib/interfaces/network/index.d.ts.map +1 -1
  377. package/src/lib/interfaces/network/node.d.ts +4 -2
  378. package/src/lib/interfaces/network/node.d.ts.map +1 -1
  379. package/src/lib/interfaces/network/nodeAdvertisement.d.ts +4 -2
  380. package/src/lib/interfaces/network/nodeAdvertisement.d.ts.map +1 -1
  381. package/src/lib/interfaces/privateVotingDerivation.d.ts +7 -2
  382. package/src/lib/interfaces/privateVotingDerivation.d.ts.map +1 -1
  383. package/src/lib/interfaces/requests/communicationRequests.d.ts +154 -0
  384. package/src/lib/interfaces/requests/communicationRequests.d.ts.map +1 -0
  385. package/src/lib/interfaces/requests/communicationRequests.js +10 -0
  386. package/src/lib/interfaces/requests/communicationRequests.js.map +1 -0
  387. package/src/lib/interfaces/requests/index.d.ts +2 -0
  388. package/src/lib/interfaces/requests/index.d.ts.map +1 -0
  389. package/src/lib/interfaces/requests/index.js +3 -0
  390. package/src/lib/interfaces/requests/index.js.map +1 -0
  391. package/src/lib/interfaces/responses/blockDataResponse.d.ts +11 -0
  392. package/src/lib/interfaces/responses/blockDataResponse.d.ts.map +1 -0
  393. package/src/lib/interfaces/responses/blockDataResponse.js +3 -0
  394. package/src/lib/interfaces/responses/blockDataResponse.js.map +1 -0
  395. package/src/lib/interfaces/responses/communicationResponses.d.ts +82 -0
  396. package/src/lib/interfaces/responses/communicationResponses.d.ts.map +1 -0
  397. package/src/lib/interfaces/responses/communicationResponses.js +17 -0
  398. package/src/lib/interfaces/responses/communicationResponses.js.map +1 -0
  399. package/src/lib/interfaces/responses/cryptoResponses.d.ts +30 -0
  400. package/src/lib/interfaces/responses/cryptoResponses.d.ts.map +1 -0
  401. package/src/lib/interfaces/responses/cryptoResponses.js +12 -0
  402. package/src/lib/interfaces/responses/cryptoResponses.js.map +1 -0
  403. package/src/lib/interfaces/responses/deviceResponses.d.ts +26 -0
  404. package/src/lib/interfaces/responses/deviceResponses.d.ts.map +1 -0
  405. package/src/lib/interfaces/responses/deviceResponses.js +15 -0
  406. package/src/lib/interfaces/responses/deviceResponses.js.map +1 -0
  407. package/src/lib/interfaces/responses/directoryResponses.d.ts +26 -0
  408. package/src/lib/interfaces/responses/directoryResponses.d.ts.map +1 -0
  409. package/src/lib/interfaces/responses/directoryResponses.js +12 -0
  410. package/src/lib/interfaces/responses/directoryResponses.js.map +1 -0
  411. package/src/lib/interfaces/responses/emailResponses.d.ts +40 -0
  412. package/src/lib/interfaces/responses/emailResponses.d.ts.map +1 -0
  413. package/src/lib/interfaces/responses/emailResponses.js +18 -0
  414. package/src/lib/interfaces/responses/emailResponses.js.map +1 -0
  415. package/src/lib/interfaces/responses/explodingMessageResponses.d.ts +42 -0
  416. package/src/lib/interfaces/responses/explodingMessageResponses.d.ts.map +1 -0
  417. package/src/lib/interfaces/responses/explodingMessageResponses.js +11 -0
  418. package/src/lib/interfaces/responses/explodingMessageResponses.js.map +1 -0
  419. package/src/lib/interfaces/responses/identityProofResponses.d.ts +33 -0
  420. package/src/lib/interfaces/responses/identityProofResponses.d.ts.map +1 -0
  421. package/src/lib/interfaces/responses/identityProofResponses.js +12 -0
  422. package/src/lib/interfaces/responses/identityProofResponses.js.map +1 -0
  423. package/src/lib/interfaces/responses/index.d.ts +3 -1
  424. package/src/lib/interfaces/responses/index.d.ts.map +1 -1
  425. package/src/lib/interfaces/sealResults.d.ts +7 -2
  426. package/src/lib/interfaces/sealResults.d.ts.map +1 -1
  427. package/src/lib/interfaces/services/fecService.d.ts +7 -5
  428. package/src/lib/interfaces/services/fecService.d.ts.map +1 -1
  429. package/src/lib/interfaces/services/fecService.js +2 -0
  430. package/src/lib/interfaces/services/fecService.js.map +1 -1
  431. package/src/lib/interfaces/singleEncryptedBlockDetails.d.ts +7 -2
  432. package/src/lib/interfaces/singleEncryptedBlockDetails.d.ts.map +1 -1
  433. package/src/lib/interfaces/storage/blockMetadata.d.ts +8 -1
  434. package/src/lib/interfaces/storage/blockMetadata.d.ts.map +1 -1
  435. package/src/lib/interfaces/storage/blockMetadata.js +3 -1
  436. package/src/lib/interfaces/storage/blockMetadata.js.map +1 -1
  437. package/src/lib/interfaces/storage/cblIndex.d.ts +141 -0
  438. package/src/lib/interfaces/storage/cblIndex.d.ts.map +1 -0
  439. package/src/lib/interfaces/storage/cblIndex.js +28 -0
  440. package/src/lib/interfaces/storage/cblIndex.js.map +1 -0
  441. package/src/lib/interfaces/storage/clientSession.d.ts +22 -0
  442. package/src/lib/interfaces/storage/clientSession.d.ts.map +1 -0
  443. package/src/lib/interfaces/storage/clientSession.js +3 -0
  444. package/src/lib/interfaces/storage/clientSession.js.map +1 -0
  445. package/src/lib/interfaces/storage/collection.d.ts +80 -0
  446. package/src/lib/interfaces/storage/collection.d.ts.map +1 -0
  447. package/src/lib/interfaces/storage/collection.js +3 -0
  448. package/src/lib/interfaces/storage/collection.js.map +1 -0
  449. package/src/lib/interfaces/storage/database.d.ts +30 -0
  450. package/src/lib/interfaces/storage/database.d.ts.map +1 -0
  451. package/src/lib/interfaces/storage/database.js +3 -0
  452. package/src/lib/interfaces/storage/database.js.map +1 -0
  453. package/src/lib/interfaces/storage/databaseLifecycleHooks.d.ts +43 -0
  454. package/src/lib/interfaces/storage/databaseLifecycleHooks.d.ts.map +1 -0
  455. package/src/lib/interfaces/storage/databaseLifecycleHooks.js +3 -0
  456. package/src/lib/interfaces/storage/databaseLifecycleHooks.js.map +1 -0
  457. package/src/lib/interfaces/storage/documentTypes.d.ts +413 -0
  458. package/src/lib/interfaces/storage/documentTypes.d.ts.map +1 -0
  459. package/src/lib/interfaces/storage/documentTypes.js +8 -0
  460. package/src/lib/interfaces/storage/documentTypes.js.map +1 -0
  461. package/src/lib/interfaces/storage/encryptedPool.d.ts +64 -0
  462. package/src/lib/interfaces/storage/encryptedPool.d.ts.map +1 -0
  463. package/src/lib/interfaces/storage/encryptedPool.js +26 -0
  464. package/src/lib/interfaces/storage/encryptedPool.js.map +1 -0
  465. package/src/lib/interfaces/storage/headRegistry.d.ts +128 -0
  466. package/src/lib/interfaces/storage/headRegistry.d.ts.map +1 -0
  467. package/src/lib/interfaces/storage/headRegistry.js +3 -0
  468. package/src/lib/interfaces/storage/headRegistry.js.map +1 -0
  469. package/src/lib/interfaces/storage/index.d.ts +14 -0
  470. package/src/lib/interfaces/storage/index.d.ts.map +1 -1
  471. package/src/lib/interfaces/storage/index.js +14 -1
  472. package/src/lib/interfaces/storage/index.js.map +1 -1
  473. package/src/lib/interfaces/storage/pooledBlockStore.d.ts +163 -0
  474. package/src/lib/interfaces/storage/pooledBlockStore.d.ts.map +1 -0
  475. package/src/lib/interfaces/storage/pooledBlockStore.js +77 -0
  476. package/src/lib/interfaces/storage/pooledBlockStore.js.map +1 -0
  477. package/src/lib/interfaces/storage/readConcernBlockStore.d.ts +47 -0
  478. package/src/lib/interfaces/storage/readConcernBlockStore.d.ts.map +1 -0
  479. package/src/lib/interfaces/storage/readConcernBlockStore.js +29 -0
  480. package/src/lib/interfaces/storage/readConcernBlockStore.js.map +1 -0
  481. package/src/lib/interfaces/symmetricEncryptionResults.d.ts +7 -5
  482. package/src/lib/interfaces/symmetricEncryptionResults.d.ts.map +1 -1
  483. package/src/lib/schemas/messaging/messageMetadataSchema.d.ts.map +1 -1
  484. package/src/lib/schemas/messaging/messageMetadataSchema.js.map +1 -1
  485. package/src/lib/services/blockCapacity.service.d.ts.map +1 -1
  486. package/src/lib/services/blockCapacity.service.js +15 -0
  487. package/src/lib/services/blockCapacity.service.js.map +1 -1
  488. package/src/lib/services/brightpass/auditLogger.d.ts +41 -0
  489. package/src/lib/services/brightpass/auditLogger.d.ts.map +1 -0
  490. package/src/lib/services/brightpass/auditLogger.js +47 -0
  491. package/src/lib/services/brightpass/auditLogger.js.map +1 -0
  492. package/src/lib/services/brightpass/breachDetector.d.ts +68 -0
  493. package/src/lib/services/brightpass/breachDetector.d.ts.map +1 -0
  494. package/src/lib/services/brightpass/breachDetector.js +102 -0
  495. package/src/lib/services/brightpass/breachDetector.js.map +1 -0
  496. package/src/lib/services/brightpass/importParser.d.ts +105 -0
  497. package/src/lib/services/brightpass/importParser.d.ts.map +1 -0
  498. package/src/lib/services/brightpass/importParser.js +380 -0
  499. package/src/lib/services/brightpass/importParser.js.map +1 -0
  500. package/src/lib/services/brightpass/index.d.ts +16 -0
  501. package/src/lib/services/brightpass/index.d.ts.map +1 -0
  502. package/src/lib/services/brightpass/index.js +19 -0
  503. package/src/lib/services/brightpass/index.js.map +1 -0
  504. package/src/lib/services/brightpass/passwordGenerator.d.ts +111 -0
  505. package/src/lib/services/brightpass/passwordGenerator.d.ts.map +1 -0
  506. package/src/lib/services/brightpass/passwordGenerator.js +162 -0
  507. package/src/lib/services/brightpass/passwordGenerator.js.map +1 -0
  508. package/src/lib/services/brightpass/totpEngine.d.ts +191 -0
  509. package/src/lib/services/brightpass/totpEngine.d.ts.map +1 -0
  510. package/src/lib/services/brightpass/totpEngine.js +198 -0
  511. package/src/lib/services/brightpass/totpEngine.js.map +1 -0
  512. package/src/lib/services/brightpass/vaultKeyDerivation.d.ts +26 -0
  513. package/src/lib/services/brightpass/vaultKeyDerivation.d.ts.map +1 -0
  514. package/src/lib/services/brightpass/vaultKeyDerivation.js +42 -0
  515. package/src/lib/services/brightpass/vaultKeyDerivation.js.map +1 -0
  516. package/src/lib/services/brightpass/vaultSerializer.d.ts +14 -0
  517. package/src/lib/services/brightpass/vaultSerializer.d.ts.map +1 -0
  518. package/src/lib/services/brightpass/vaultSerializer.js +77 -0
  519. package/src/lib/services/brightpass/vaultSerializer.js.map +1 -0
  520. package/src/lib/services/cblService.d.ts +4 -2
  521. package/src/lib/services/cblService.d.ts.map +1 -1
  522. package/src/lib/services/cblService.js +8 -4
  523. package/src/lib/services/cblService.js.map +1 -1
  524. package/src/lib/services/communication/channelService.d.ts +208 -0
  525. package/src/lib/services/communication/channelService.d.ts.map +1 -0
  526. package/src/lib/services/communication/channelService.js +575 -0
  527. package/src/lib/services/communication/channelService.js.map +1 -0
  528. package/src/lib/services/communication/conversationService.d.ts +130 -0
  529. package/src/lib/services/communication/conversationService.d.ts.map +1 -0
  530. package/src/lib/services/communication/conversationService.js +279 -0
  531. package/src/lib/services/communication/conversationService.js.map +1 -0
  532. package/src/lib/services/communication/explodingMessageService.d.ts +168 -0
  533. package/src/lib/services/communication/explodingMessageService.d.ts.map +1 -0
  534. package/src/lib/services/communication/explodingMessageService.js +287 -0
  535. package/src/lib/services/communication/explodingMessageService.js.map +1 -0
  536. package/src/lib/services/communication/groupService.d.ts +165 -0
  537. package/src/lib/services/communication/groupService.d.ts.map +1 -0
  538. package/src/lib/services/communication/groupService.js +437 -0
  539. package/src/lib/services/communication/groupService.js.map +1 -0
  540. package/src/lib/services/communication/index.d.ts +16 -0
  541. package/src/lib/services/communication/index.d.ts.map +1 -0
  542. package/src/lib/services/communication/index.js +63 -0
  543. package/src/lib/services/communication/index.js.map +1 -0
  544. package/src/lib/services/communication/messageOperationsService.d.ts +81 -0
  545. package/src/lib/services/communication/messageOperationsService.d.ts.map +1 -0
  546. package/src/lib/services/communication/messageOperationsService.js +162 -0
  547. package/src/lib/services/communication/messageOperationsService.js.map +1 -0
  548. package/src/lib/services/communication/permissionService.d.ts +47 -0
  549. package/src/lib/services/communication/permissionService.d.ts.map +1 -0
  550. package/src/lib/services/communication/permissionService.js +82 -0
  551. package/src/lib/services/communication/permissionService.js.map +1 -0
  552. package/src/lib/services/communication/searchService.d.ts +30 -0
  553. package/src/lib/services/communication/searchService.d.ts.map +1 -0
  554. package/src/lib/services/communication/searchService.js +83 -0
  555. package/src/lib/services/communication/searchService.js.map +1 -0
  556. package/src/lib/services/crypto/ethereumWalletService.d.ts +159 -0
  557. package/src/lib/services/crypto/ethereumWalletService.d.ts.map +1 -0
  558. package/src/lib/services/crypto/ethereumWalletService.js +345 -0
  559. package/src/lib/services/crypto/ethereumWalletService.js.map +1 -0
  560. package/src/lib/services/crypto/gitSigningService.d.ts +145 -0
  561. package/src/lib/services/crypto/gitSigningService.d.ts.map +1 -0
  562. package/src/lib/services/crypto/gitSigningService.js +291 -0
  563. package/src/lib/services/crypto/gitSigningService.js.map +1 -0
  564. package/src/lib/services/crypto/index.d.ts +3 -0
  565. package/src/lib/services/crypto/index.d.ts.map +1 -0
  566. package/src/lib/services/crypto/index.js +6 -0
  567. package/src/lib/services/crypto/index.js.map +1 -0
  568. package/src/lib/services/identity/deviceProvisioningService.d.ts +146 -0
  569. package/src/lib/services/identity/deviceProvisioningService.d.ts.map +1 -0
  570. package/src/lib/services/identity/deviceProvisioningService.js +219 -0
  571. package/src/lib/services/identity/deviceProvisioningService.js.map +1 -0
  572. package/src/lib/services/identity/identityProofService.d.ts +139 -0
  573. package/src/lib/services/identity/identityProofService.d.ts.map +1 -0
  574. package/src/lib/services/identity/identityProofService.js +245 -0
  575. package/src/lib/services/identity/identityProofService.js.map +1 -0
  576. package/src/lib/services/identity/index.d.ts +14 -0
  577. package/src/lib/services/identity/index.d.ts.map +1 -0
  578. package/src/lib/services/identity/index.js +17 -0
  579. package/src/lib/services/identity/index.js.map +1 -0
  580. package/src/lib/services/identity/memberIdentityProofService.d.ts +179 -0
  581. package/src/lib/services/identity/memberIdentityProofService.d.ts.map +1 -0
  582. package/src/lib/services/identity/memberIdentityProofService.js +232 -0
  583. package/src/lib/services/identity/memberIdentityProofService.js.map +1 -0
  584. package/src/lib/services/identity/memberPaperKeyService.d.ts +223 -0
  585. package/src/lib/services/identity/memberPaperKeyService.d.ts.map +1 -0
  586. package/src/lib/services/identity/memberPaperKeyService.js +279 -0
  587. package/src/lib/services/identity/memberPaperKeyService.js.map +1 -0
  588. package/src/lib/services/identity/paperKeyService.d.ts +106 -0
  589. package/src/lib/services/identity/paperKeyService.d.ts.map +1 -0
  590. package/src/lib/services/identity/paperKeyService.js +161 -0
  591. package/src/lib/services/identity/paperKeyService.js.map +1 -0
  592. package/src/lib/services/identity/publicKeyDirectoryService.d.ts +210 -0
  593. package/src/lib/services/identity/publicKeyDirectoryService.d.ts.map +1 -0
  594. package/src/lib/services/identity/publicKeyDirectoryService.js +328 -0
  595. package/src/lib/services/identity/publicKeyDirectoryService.js.map +1 -0
  596. package/src/lib/services/identity/splitPaperKeyService.d.ts +92 -0
  597. package/src/lib/services/identity/splitPaperKeyService.d.ts.map +1 -0
  598. package/src/lib/services/identity/splitPaperKeyService.js +305 -0
  599. package/src/lib/services/identity/splitPaperKeyService.js.map +1 -0
  600. package/src/lib/services/index.d.ts +4 -0
  601. package/src/lib/services/index.d.ts.map +1 -1
  602. package/src/lib/services/index.js +7 -0
  603. package/src/lib/services/index.js.map +1 -1
  604. package/src/lib/services/messaging/deliveryTimeoutService.js +2 -2
  605. package/src/lib/services/messaging/deliveryTimeoutService.js.map +1 -1
  606. package/src/lib/services/messaging/emailEncryptionService.d.ts +250 -0
  607. package/src/lib/services/messaging/emailEncryptionService.d.ts.map +1 -0
  608. package/src/lib/services/messaging/emailEncryptionService.js +420 -0
  609. package/src/lib/services/messaging/emailEncryptionService.js.map +1 -0
  610. package/src/lib/services/messaging/emailMessageService.d.ts +669 -0
  611. package/src/lib/services/messaging/emailMessageService.d.ts.map +1 -0
  612. package/src/lib/services/messaging/emailMessageService.js +1030 -0
  613. package/src/lib/services/messaging/emailMessageService.js.map +1 -0
  614. package/src/lib/services/messaging/emailParser.d.ts +476 -0
  615. package/src/lib/services/messaging/emailParser.d.ts.map +1 -0
  616. package/src/lib/services/messaging/emailParser.js +1316 -0
  617. package/src/lib/services/messaging/emailParser.js.map +1 -0
  618. package/src/lib/services/messaging/emailSerializer.d.ts +403 -0
  619. package/src/lib/services/messaging/emailSerializer.d.ts.map +1 -0
  620. package/src/lib/services/messaging/emailSerializer.js +852 -0
  621. package/src/lib/services/messaging/emailSerializer.js.map +1 -0
  622. package/src/lib/services/messaging/emailValidator.d.ts +448 -0
  623. package/src/lib/services/messaging/emailValidator.d.ts.map +1 -0
  624. package/src/lib/services/messaging/emailValidator.js +810 -0
  625. package/src/lib/services/messaging/emailValidator.js.map +1 -0
  626. package/src/lib/services/messaging/gossipRetryService.d.ts +204 -0
  627. package/src/lib/services/messaging/gossipRetryService.d.ts.map +1 -0
  628. package/src/lib/services/messaging/gossipRetryService.js +319 -0
  629. package/src/lib/services/messaging/gossipRetryService.js.map +1 -0
  630. package/src/lib/services/messaging/inMemoryEmailMetadataStore.d.ts +60 -0
  631. package/src/lib/services/messaging/inMemoryEmailMetadataStore.d.ts.map +1 -0
  632. package/src/lib/services/messaging/inMemoryEmailMetadataStore.js +281 -0
  633. package/src/lib/services/messaging/inMemoryEmailMetadataStore.js.map +1 -0
  634. package/src/lib/services/messaging/index.d.ts +11 -5
  635. package/src/lib/services/messaging/index.d.ts.map +1 -1
  636. package/src/lib/services/messaging/index.js +19 -5
  637. package/src/lib/services/messaging/index.js.map +1 -1
  638. package/src/lib/services/messaging/messageCBLService.js +2 -2
  639. package/src/lib/services/messaging/messageCBLService.js.map +1 -1
  640. package/src/lib/services/tuple.service.d.ts +27 -2
  641. package/src/lib/services/tuple.service.d.ts.map +1 -1
  642. package/src/lib/services/tuple.service.js +62 -20
  643. package/src/lib/services/tuple.service.js.map +1 -1
  644. package/src/lib/services/vcblService.d.ts +36 -0
  645. package/src/lib/services/vcblService.d.ts.map +1 -0
  646. package/src/lib/services/vcblService.js +326 -0
  647. package/src/lib/services/vcblService.js.map +1 -0
  648. package/src/lib/stores/index.d.ts +1 -0
  649. package/src/lib/stores/index.d.ts.map +1 -1
  650. package/src/lib/stores/index.js +1 -0
  651. package/src/lib/stores/index.js.map +1 -1
  652. package/src/lib/stores/messaging/memoryMessageMetadataStore.d.ts +2 -2
  653. package/src/lib/stores/messaging/memoryMessageMetadataStore.d.ts.map +1 -1
  654. package/src/lib/stores/messaging/memoryMessageMetadataStore.js +2 -2
  655. package/src/lib/stores/messaging/memoryMessageMetadataStore.js.map +1 -1
  656. package/src/lib/stores/pooledMemoryBlockStore.d.ts +134 -0
  657. package/src/lib/stores/pooledMemoryBlockStore.d.ts.map +1 -0
  658. package/src/lib/stores/pooledMemoryBlockStore.js +583 -0
  659. package/src/lib/stores/pooledMemoryBlockStore.js.map +1 -0
  660. package/src/lib/types/checksum.d.ts +11 -0
  661. package/src/lib/types/checksum.d.ts.map +1 -1
  662. package/src/lib/types/checksum.js +11 -0
  663. package/src/lib/types/checksum.js.map +1 -1
  664. package/src/lib/utils/index.d.ts +9 -0
  665. package/src/lib/utils/index.d.ts.map +1 -1
  666. package/src/lib/utils/index.js +12 -0
  667. package/src/lib/utils/index.js.map +1 -1
  668. package/src/lib/utils/pagination.d.ts +27 -0
  669. package/src/lib/utils/pagination.d.ts.map +1 -0
  670. package/src/lib/utils/pagination.js +38 -0
  671. package/src/lib/utils/pagination.js.map +1 -0
  672. package/src/lib/enumerations/messaging/messageDeliveryStatus.d.ts +0 -18
  673. package/src/lib/enumerations/messaging/messageDeliveryStatus.d.ts.map +0 -1
  674. package/src/lib/enumerations/messaging/messageDeliveryStatus.js +0 -22
  675. package/src/lib/enumerations/messaging/messageDeliveryStatus.js.map +0 -1
  676. package/src/lib/enumerations/messaging/routingStrategy.d.ts +0 -12
  677. package/src/lib/enumerations/messaging/routingStrategy.d.ts.map +0 -1
  678. package/src/lib/enumerations/messaging/routingStrategy.js +0 -16
  679. package/src/lib/enumerations/messaging/routingStrategy.js.map +0 -1
  680. package/src/lib/interfaces/messaging/messageRouter.d.ts +0 -48
  681. package/src/lib/interfaces/messaging/messageRouter.d.ts.map +0 -1
  682. package/src/lib/interfaces/messaging/messageRouter.js.map +0 -1
  683. package/src/lib/interfaces/network/networkTransport.d.ts +0 -19
  684. package/src/lib/interfaces/network/networkTransport.d.ts.map +0 -1
  685. package/src/lib/interfaces/network/networkTransport.js.map +0 -1
  686. package/src/lib/services/messaging/broadcastMessageRouter.d.ts +0 -18
  687. package/src/lib/services/messaging/broadcastMessageRouter.d.ts.map +0 -1
  688. package/src/lib/services/messaging/broadcastMessageRouter.js +0 -32
  689. package/src/lib/services/messaging/broadcastMessageRouter.js.map +0 -1
  690. package/src/lib/services/messaging/directMessageRouter.d.ts +0 -25
  691. package/src/lib/services/messaging/directMessageRouter.d.ts.map +0 -1
  692. package/src/lib/services/messaging/directMessageRouter.js +0 -58
  693. package/src/lib/services/messaging/directMessageRouter.js.map +0 -1
  694. package/src/lib/services/messaging/messageForwardingService.d.ts +0 -40
  695. package/src/lib/services/messaging/messageForwardingService.d.ts.map +0 -1
  696. package/src/lib/services/messaging/messageForwardingService.js +0 -74
  697. package/src/lib/services/messaging/messageForwardingService.js.map +0 -1
  698. package/src/lib/services/messaging/messageRouter.d.ts +0 -24
  699. package/src/lib/services/messaging/messageRouter.d.ts.map +0 -1
  700. package/src/lib/services/messaging/messageRouter.js +0 -111
  701. package/src/lib/services/messaging/messageRouter.js.map +0 -1
  702. package/src/lib/services/messaging/webSocketTransport.d.ts +0 -34
  703. package/src/lib/services/messaging/webSocketTransport.d.ts.map +0 -1
  704. package/src/lib/services/messaging/webSocketTransport.js +0 -115
  705. 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