@digitaldefiance/node-ecies-lib 4.4.23 → 4.5.17

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 (321) hide show
  1. package/package.json +14 -2
  2. package/src/builders/ecies-builder.d.ts +0 -11
  3. package/src/builders/ecies-builder.d.ts.map +0 -1
  4. package/src/builders/ecies-builder.js +0 -26
  5. package/src/builders/ecies-builder.js.map +0 -1
  6. package/src/builders/index.d.ts +0 -3
  7. package/src/builders/index.d.ts.map +0 -1
  8. package/src/builders/index.js +0 -6
  9. package/src/builders/index.js.map +0 -1
  10. package/src/builders/member-builder.d.ts +0 -47
  11. package/src/builders/member-builder.d.ts.map +0 -1
  12. package/src/builders/member-builder.js +0 -99
  13. package/src/builders/member-builder.js.map +0 -1
  14. package/src/constants.d.ts +0 -38
  15. package/src/constants.d.ts.map +0 -1
  16. package/src/constants.js +0 -191
  17. package/src/constants.js.map +0 -1
  18. package/src/core/errors/crypto-error.d.ts +0 -6
  19. package/src/core/errors/crypto-error.d.ts.map +0 -1
  20. package/src/core/errors/crypto-error.js +0 -15
  21. package/src/core/errors/crypto-error.js.map +0 -1
  22. package/src/core/index.d.ts +0 -3
  23. package/src/core/index.d.ts.map +0 -1
  24. package/src/core/index.js +0 -6
  25. package/src/core/index.js.map +0 -1
  26. package/src/core/types/result.d.ts +0 -8
  27. package/src/core/types/result.d.ts.map +0 -1
  28. package/src/core/types/result.js +0 -3
  29. package/src/core/types/result.js.map +0 -1
  30. package/src/enumerations/index.d.ts +0 -2
  31. package/src/enumerations/index.d.ts.map +0 -1
  32. package/src/enumerations/index.js +0 -5
  33. package/src/enumerations/index.js.map +0 -1
  34. package/src/enumerations/pbkdf2-profile.d.ts +0 -9
  35. package/src/enumerations/pbkdf2-profile.d.ts.map +0 -1
  36. package/src/enumerations/pbkdf2-profile.js +0 -13
  37. package/src/enumerations/pbkdf2-profile.js.map +0 -1
  38. package/src/i18n/ecies-i18n-factory.d.ts +0 -28
  39. package/src/i18n/ecies-i18n-factory.d.ts.map +0 -1
  40. package/src/i18n/ecies-i18n-factory.js +0 -90
  41. package/src/i18n/ecies-i18n-factory.js.map +0 -1
  42. package/src/i18n/index.d.ts +0 -3
  43. package/src/i18n/index.d.ts.map +0 -1
  44. package/src/i18n/index.js +0 -8
  45. package/src/i18n/index.js.map +0 -1
  46. package/src/i18n/node-ecies-i18n-setup.d.ts +0 -5
  47. package/src/i18n/node-ecies-i18n-setup.d.ts.map +0 -1
  48. package/src/i18n/node-ecies-i18n-setup.js +0 -48
  49. package/src/i18n/node-ecies-i18n-setup.js.map +0 -1
  50. package/src/i18n/node-keys.d.ts +0 -57
  51. package/src/i18n/node-keys.d.ts.map +0 -1
  52. package/src/i18n/node-keys.js +0 -67
  53. package/src/i18n/node-keys.js.map +0 -1
  54. package/src/i18n/translations/de.d.ts +0 -3
  55. package/src/i18n/translations/de.d.ts.map +0 -1
  56. package/src/i18n/translations/de.js +0 -57
  57. package/src/i18n/translations/de.js.map +0 -1
  58. package/src/i18n/translations/en-GB.d.ts +0 -3
  59. package/src/i18n/translations/en-GB.d.ts.map +0 -1
  60. package/src/i18n/translations/en-GB.js +0 -61
  61. package/src/i18n/translations/en-GB.js.map +0 -1
  62. package/src/i18n/translations/en-US.d.ts +0 -6
  63. package/src/i18n/translations/en-US.d.ts.map +0 -1
  64. package/src/i18n/translations/en-US.js +0 -65
  65. package/src/i18n/translations/en-US.js.map +0 -1
  66. package/src/i18n/translations/es.d.ts +0 -3
  67. package/src/i18n/translations/es.d.ts.map +0 -1
  68. package/src/i18n/translations/es.js +0 -57
  69. package/src/i18n/translations/es.js.map +0 -1
  70. package/src/i18n/translations/fr.d.ts +0 -3
  71. package/src/i18n/translations/fr.d.ts.map +0 -1
  72. package/src/i18n/translations/fr.js +0 -57
  73. package/src/i18n/translations/fr.js.map +0 -1
  74. package/src/i18n/translations/index.d.ts +0 -9
  75. package/src/i18n/translations/index.d.ts.map +0 -1
  76. package/src/i18n/translations/index.js +0 -20
  77. package/src/i18n/translations/index.js.map +0 -1
  78. package/src/i18n/translations/ja.d.ts +0 -3
  79. package/src/i18n/translations/ja.d.ts.map +0 -1
  80. package/src/i18n/translations/ja.js +0 -57
  81. package/src/i18n/translations/ja.js.map +0 -1
  82. package/src/i18n/translations/uk.d.ts +0 -3
  83. package/src/i18n/translations/uk.d.ts.map +0 -1
  84. package/src/i18n/translations/uk.js +0 -57
  85. package/src/i18n/translations/uk.js.map +0 -1
  86. package/src/i18n/translations/zh-cn.d.ts +0 -3
  87. package/src/i18n/translations/zh-cn.d.ts.map +0 -1
  88. package/src/i18n/translations/zh-cn.js +0 -57
  89. package/src/i18n/translations/zh-cn.js.map +0 -1
  90. package/src/index.d.ts +0 -17
  91. package/src/index.d.ts.map +0 -1
  92. package/src/index.js +0 -30
  93. package/src/index.js.map +0 -1
  94. package/src/interfaces/authenticated-cipher.d.ts +0 -12
  95. package/src/interfaces/authenticated-cipher.d.ts.map +0 -1
  96. package/src/interfaces/authenticated-cipher.js +0 -3
  97. package/src/interfaces/authenticated-cipher.js.map +0 -1
  98. package/src/interfaces/authenticated-decipher.d.ts +0 -11
  99. package/src/interfaces/authenticated-decipher.d.ts.map +0 -1
  100. package/src/interfaces/authenticated-decipher.js +0 -3
  101. package/src/interfaces/authenticated-decipher.js.map +0 -1
  102. package/src/interfaces/backend-member-operational.d.ts +0 -48
  103. package/src/interfaces/backend-member-operational.d.ts.map +0 -1
  104. package/src/interfaces/backend-member-operational.js +0 -3
  105. package/src/interfaces/backend-member-operational.js.map +0 -1
  106. package/src/interfaces/checksum-config.d.ts +0 -5
  107. package/src/interfaces/checksum-config.d.ts.map +0 -1
  108. package/src/interfaces/checksum-config.js +0 -3
  109. package/src/interfaces/checksum-config.js.map +0 -1
  110. package/src/interfaces/checksum-consts.d.ts +0 -11
  111. package/src/interfaces/checksum-consts.d.ts.map +0 -1
  112. package/src/interfaces/checksum-consts.js +0 -3
  113. package/src/interfaces/checksum-consts.js.map +0 -1
  114. package/src/interfaces/constants.d.ts +0 -52
  115. package/src/interfaces/constants.d.ts.map +0 -1
  116. package/src/interfaces/constants.js +0 -3
  117. package/src/interfaces/constants.js.map +0 -1
  118. package/src/interfaces/ecies-consts.d.ts +0 -88
  119. package/src/interfaces/ecies-consts.d.ts.map +0 -1
  120. package/src/interfaces/ecies-consts.js +0 -3
  121. package/src/interfaces/ecies-consts.js.map +0 -1
  122. package/src/interfaces/encrypted-chunk.d.ts +0 -12
  123. package/src/interfaces/encrypted-chunk.d.ts.map +0 -1
  124. package/src/interfaces/encrypted-chunk.js +0 -3
  125. package/src/interfaces/encrypted-chunk.js.map +0 -1
  126. package/src/interfaces/encryption-consts.d.ts +0 -11
  127. package/src/interfaces/encryption-consts.d.ts.map +0 -1
  128. package/src/interfaces/encryption-consts.js +0 -3
  129. package/src/interfaces/encryption-consts.js.map +0 -1
  130. package/src/interfaces/index.d.ts +0 -29
  131. package/src/interfaces/index.d.ts.map +0 -1
  132. package/src/interfaces/index.js +0 -30
  133. package/src/interfaces/index.js.map +0 -1
  134. package/src/interfaces/keypair-buffer-with-un-encrypted-private-key.d.ts +0 -6
  135. package/src/interfaces/keypair-buffer-with-un-encrypted-private-key.d.ts.map +0 -1
  136. package/src/interfaces/keypair-buffer-with-un-encrypted-private-key.js +0 -3
  137. package/src/interfaces/keypair-buffer-with-un-encrypted-private-key.js.map +0 -1
  138. package/src/interfaces/keyring-consts.d.ts +0 -6
  139. package/src/interfaces/keyring-consts.d.ts.map +0 -1
  140. package/src/interfaces/keyring-consts.js +0 -3
  141. package/src/interfaces/keyring-consts.js.map +0 -1
  142. package/src/interfaces/member-with-mnemonic.d.ts +0 -7
  143. package/src/interfaces/member-with-mnemonic.d.ts.map +0 -1
  144. package/src/interfaces/member-with-mnemonic.js +0 -3
  145. package/src/interfaces/member-with-mnemonic.js.map +0 -1
  146. package/src/interfaces/member.d.ts +0 -47
  147. package/src/interfaces/member.d.ts.map +0 -1
  148. package/src/interfaces/member.js +0 -3
  149. package/src/interfaces/member.js.map +0 -1
  150. package/src/interfaces/multi-encrypted-message.d.ts +0 -8
  151. package/src/interfaces/multi-encrypted-message.d.ts.map +0 -1
  152. package/src/interfaces/multi-encrypted-message.js +0 -3
  153. package/src/interfaces/multi-encrypted-message.js.map +0 -1
  154. package/src/interfaces/multi-encrypted-parsed-header.d.ts +0 -27
  155. package/src/interfaces/multi-encrypted-parsed-header.d.ts.map +0 -1
  156. package/src/interfaces/multi-encrypted-parsed-header.js +0 -3
  157. package/src/interfaces/multi-encrypted-parsed-header.js.map +0 -1
  158. package/src/interfaces/multi-recipient-chunk.d.ts +0 -26
  159. package/src/interfaces/multi-recipient-chunk.d.ts.map +0 -1
  160. package/src/interfaces/multi-recipient-chunk.js +0 -15
  161. package/src/interfaces/multi-recipient-chunk.js.map +0 -1
  162. package/src/interfaces/pbkdf-profiles.d.ts +0 -6
  163. package/src/interfaces/pbkdf-profiles.d.ts.map +0 -1
  164. package/src/interfaces/pbkdf-profiles.js +0 -3
  165. package/src/interfaces/pbkdf-profiles.js.map +0 -1
  166. package/src/interfaces/pbkdf2-result.d.ts +0 -6
  167. package/src/interfaces/pbkdf2-result.d.ts.map +0 -1
  168. package/src/interfaces/pbkdf2-result.js +0 -3
  169. package/src/interfaces/pbkdf2-result.js.map +0 -1
  170. package/src/interfaces/signing-key-private-key-info.d.ts +0 -11
  171. package/src/interfaces/signing-key-private-key-info.d.ts.map +0 -1
  172. package/src/interfaces/signing-key-private-key-info.js +0 -3
  173. package/src/interfaces/signing-key-private-key-info.js.map +0 -1
  174. package/src/interfaces/simple-keypair-buffer.d.ts +0 -6
  175. package/src/interfaces/simple-keypair-buffer.d.ts.map +0 -1
  176. package/src/interfaces/simple-keypair-buffer.js +0 -3
  177. package/src/interfaces/simple-keypair-buffer.js.map +0 -1
  178. package/src/interfaces/simple-keypair.d.ts +0 -6
  179. package/src/interfaces/simple-keypair.d.ts.map +0 -1
  180. package/src/interfaces/simple-keypair.js +0 -3
  181. package/src/interfaces/simple-keypair.js.map +0 -1
  182. package/src/interfaces/simple-public-key-only-buffer.d.ts +0 -4
  183. package/src/interfaces/simple-public-key-only-buffer.d.ts.map +0 -1
  184. package/src/interfaces/simple-public-key-only-buffer.js +0 -3
  185. package/src/interfaces/simple-public-key-only-buffer.js.map +0 -1
  186. package/src/interfaces/simple-public-key-only.d.ts +0 -4
  187. package/src/interfaces/simple-public-key-only.d.ts.map +0 -1
  188. package/src/interfaces/simple-public-key-only.js +0 -3
  189. package/src/interfaces/simple-public-key-only.js.map +0 -1
  190. package/src/interfaces/single-encrypted-parsed-header.d.ts +0 -35
  191. package/src/interfaces/single-encrypted-parsed-header.d.ts.map +0 -1
  192. package/src/interfaces/single-encrypted-parsed-header.js +0 -3
  193. package/src/interfaces/single-encrypted-parsed-header.js.map +0 -1
  194. package/src/interfaces/stream-config.d.ts +0 -6
  195. package/src/interfaces/stream-config.d.ts.map +0 -1
  196. package/src/interfaces/stream-config.js +0 -8
  197. package/src/interfaces/stream-config.js.map +0 -1
  198. package/src/interfaces/stream-progress.d.ts +0 -8
  199. package/src/interfaces/stream-progress.d.ts.map +0 -1
  200. package/src/interfaces/stream-progress.js +0 -3
  201. package/src/interfaces/stream-progress.js.map +0 -1
  202. package/src/interfaces/wallet-seed.d.ts +0 -7
  203. package/src/interfaces/wallet-seed.d.ts.map +0 -1
  204. package/src/interfaces/wallet-seed.js +0 -3
  205. package/src/interfaces/wallet-seed.js.map +0 -1
  206. package/src/interfaces/wrapped-key-consts.d.ts +0 -7
  207. package/src/interfaces/wrapped-key-consts.d.ts.map +0 -1
  208. package/src/interfaces/wrapped-key-consts.js +0 -3
  209. package/src/interfaces/wrapped-key-consts.js.map +0 -1
  210. package/src/lib/crypto-container.d.ts +0 -13
  211. package/src/lib/crypto-container.d.ts.map +0 -1
  212. package/src/lib/crypto-container.js +0 -32
  213. package/src/lib/crypto-container.js.map +0 -1
  214. package/src/lib/index.d.ts +0 -4
  215. package/src/lib/index.d.ts.map +0 -1
  216. package/src/lib/index.js +0 -7
  217. package/src/lib/index.js.map +0 -1
  218. package/src/lib/invariant-validator.d.ts +0 -69
  219. package/src/lib/invariant-validator.d.ts.map +0 -1
  220. package/src/lib/invariant-validator.js +0 -98
  221. package/src/lib/invariant-validator.js.map +0 -1
  222. package/src/lib/invariants/index.d.ts +0 -8
  223. package/src/lib/invariants/index.d.ts.map +0 -1
  224. package/src/lib/invariants/index.js +0 -12
  225. package/src/lib/invariants/index.js.map +0 -1
  226. package/src/lib/invariants/recipient-id-consistency.d.ts +0 -41
  227. package/src/lib/invariants/recipient-id-consistency.d.ts.map +0 -1
  228. package/src/lib/invariants/recipient-id-consistency.js +0 -75
  229. package/src/lib/invariants/recipient-id-consistency.js.map +0 -1
  230. package/src/member.d.ts +0 -81
  231. package/src/member.d.ts.map +0 -1
  232. package/src/member.js +0 -282
  233. package/src/member.js.map +0 -1
  234. package/src/services/aes-gcm.d.ts +0 -66
  235. package/src/services/aes-gcm.d.ts.map +0 -1
  236. package/src/services/aes-gcm.js +0 -161
  237. package/src/services/aes-gcm.js.map +0 -1
  238. package/src/services/chunk-processor.d.ts +0 -15
  239. package/src/services/chunk-processor.d.ts.map +0 -1
  240. package/src/services/chunk-processor.js +0 -36
  241. package/src/services/chunk-processor.js.map +0 -1
  242. package/src/services/ecies/crypto-core.d.ts +0 -104
  243. package/src/services/ecies/crypto-core.d.ts.map +0 -1
  244. package/src/services/ecies/crypto-core.js +0 -234
  245. package/src/services/ecies/crypto-core.js.map +0 -1
  246. package/src/services/ecies/file.d.ts +0 -30
  247. package/src/services/ecies/file.d.ts.map +0 -1
  248. package/src/services/ecies/file.js +0 -112
  249. package/src/services/ecies/file.js.map +0 -1
  250. package/src/services/ecies/index.d.ts +0 -8
  251. package/src/services/ecies/index.d.ts.map +0 -1
  252. package/src/services/ecies/index.js +0 -11
  253. package/src/services/ecies/index.js.map +0 -1
  254. package/src/services/ecies/multi-recipient.d.ts +0 -84
  255. package/src/services/ecies/multi-recipient.d.ts.map +0 -1
  256. package/src/services/ecies/multi-recipient.js +0 -494
  257. package/src/services/ecies/multi-recipient.js.map +0 -1
  258. package/src/services/ecies/service.d.ts +0 -75
  259. package/src/services/ecies/service.d.ts.map +0 -1
  260. package/src/services/ecies/service.js +0 -152
  261. package/src/services/ecies/service.js.map +0 -1
  262. package/src/services/ecies/signature.d.ts +0 -38
  263. package/src/services/ecies/signature.d.ts.map +0 -1
  264. package/src/services/ecies/signature.js +0 -69
  265. package/src/services/ecies/signature.js.map +0 -1
  266. package/src/services/ecies/single-recipient.d.ts +0 -83
  267. package/src/services/ecies/single-recipient.d.ts.map +0 -1
  268. package/src/services/ecies/single-recipient.js +0 -448
  269. package/src/services/ecies/single-recipient.js.map +0 -1
  270. package/src/services/ecies/utilities.d.ts +0 -33
  271. package/src/services/ecies/utilities.d.ts.map +0 -1
  272. package/src/services/ecies/utilities.js +0 -91
  273. package/src/services/ecies/utilities.js.map +0 -1
  274. package/src/services/encryption-stream.d.ts +0 -33
  275. package/src/services/encryption-stream.d.ts.map +0 -1
  276. package/src/services/encryption-stream.js +0 -211
  277. package/src/services/encryption-stream.js.map +0 -1
  278. package/src/services/index.d.ts +0 -8
  279. package/src/services/index.d.ts.map +0 -1
  280. package/src/services/index.js +0 -11
  281. package/src/services/index.js.map +0 -1
  282. package/src/services/multi-recipient-processor.d.ts +0 -72
  283. package/src/services/multi-recipient-processor.d.ts.map +0 -1
  284. package/src/services/multi-recipient-processor.js +0 -321
  285. package/src/services/multi-recipient-processor.js.map +0 -1
  286. package/src/services/pbkdf2.d.ts +0 -105
  287. package/src/services/pbkdf2.d.ts.map +0 -1
  288. package/src/services/pbkdf2.js +0 -191
  289. package/src/services/pbkdf2.js.map +0 -1
  290. package/src/services/progress-tracker.d.ts +0 -9
  291. package/src/services/progress-tracker.d.ts.map +0 -1
  292. package/src/services/progress-tracker.js +0 -41
  293. package/src/services/progress-tracker.js.map +0 -1
  294. package/src/test-mocks/index.d.ts +0 -2
  295. package/src/test-mocks/index.d.ts.map +0 -1
  296. package/src/test-mocks/index.js +0 -5
  297. package/src/test-mocks/index.js.map +0 -1
  298. package/src/test-mocks/mock-backend-member.d.ts +0 -76
  299. package/src/test-mocks/mock-backend-member.d.ts.map +0 -1
  300. package/src/test-mocks/mock-backend-member.js +0 -139
  301. package/src/test-mocks/mock-backend-member.js.map +0 -1
  302. package/src/testing.d.ts +0 -2
  303. package/src/testing.d.ts.map +0 -1
  304. package/src/testing.js +0 -6
  305. package/src/testing.js.map +0 -1
  306. package/src/types/id-guards.d.ts +0 -39
  307. package/src/types/id-guards.d.ts.map +0 -1
  308. package/src/types/id-guards.js +0 -91
  309. package/src/types/id-guards.js.map +0 -1
  310. package/src/types/index.d.ts +0 -2
  311. package/src/types/index.d.ts.map +0 -1
  312. package/src/types/index.js +0 -5
  313. package/src/types/index.js.map +0 -1
  314. package/src/types.d.ts +0 -26
  315. package/src/types.d.ts.map +0 -1
  316. package/src/types.js +0 -6
  317. package/src/types.js.map +0 -1
  318. package/src/utils.d.ts +0 -11
  319. package/src/utils.d.ts.map +0 -1
  320. package/src/utils.js +0 -82
  321. package/src/utils.js.map +0 -1
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMultiRecipientConstants = void 0;
4
- const getMultiRecipientConstants = (
5
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
6
- _recipientIdSize) => ({
7
- MAGIC: 0x45434945, // 'ECIE'
8
- VERSION: 1,
9
- HEADER_SIZE: 64, // Fixed header size before recipient list
10
- KEY_SIZE_BYTES: 2, // Size of the key size field
11
- FLAG_IS_LAST: 1,
12
- MAX_RECIPIENTS: 65535,
13
- });
14
- exports.getMultiRecipientConstants = getMultiRecipientConstants;
15
- //# sourceMappingURL=multi-recipient-chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"multi-recipient-chunk.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/multi-recipient-chunk.ts"],"names":[],"mappings":";;;AA2BO,MAAM,0BAA0B,GAAG;AACxC,6DAA6D;AAC7D,gBAAwB,EACE,EAAE,CAAC,CAAC;IAC9B,KAAK,EAAE,UAAU,EAAE,SAAS;IAC5B,OAAO,EAAE,CAAC;IACV,WAAW,EAAE,EAAE,EAAE,0CAA0C;IAC3D,cAAc,EAAE,CAAC,EAAE,6BAA6B;IAChD,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,KAAK;CACtB,CAAC,CAAC;AAVU,QAAA,0BAA0B,8BAUpC"}
@@ -1,6 +0,0 @@
1
- import type { IPbkdf2Config } from '@digitaldefiance/ecies-lib';
2
- import type { Pbkdf2ProfileEnum } from '../enumerations/pbkdf2-profile';
3
- export type PbkdfProfiles = {
4
- [key in Pbkdf2ProfileEnum]: IPbkdf2Config;
5
- };
6
- //# sourceMappingURL=pbkdf-profiles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pbkdf-profiles.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/pbkdf-profiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAExE,MAAM,MAAM,aAAa,GAAG;KACzB,GAAG,IAAI,iBAAiB,GAAG,aAAa;CAC1C,CAAC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=pbkdf-profiles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pbkdf-profiles.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/pbkdf-profiles.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- export interface IPbkdf2Result {
2
- salt: Buffer;
3
- hash: Buffer;
4
- iterations: number;
5
- }
6
- //# sourceMappingURL=pbkdf2-result.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pbkdf2-result.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/pbkdf2-result.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=pbkdf2-result.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pbkdf2-result.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/pbkdf2-result.ts"],"names":[],"mappings":""}
@@ -1,11 +0,0 @@
1
- import type { ec } from 'elliptic';
2
- import type { IKeyPairBufferWithUnEncryptedPrivateKey } from './keypair-buffer-with-un-encrypted-private-key';
3
- export interface ISigningKeyPrivateKeyInfo extends IKeyPairBufferWithUnEncryptedPrivateKey {
4
- keyPair: ec.KeyPair;
5
- publicKey: Buffer;
6
- privateKey: Buffer;
7
- seedHex: string;
8
- entropy: string;
9
- mnemonic: string;
10
- }
11
- //# sourceMappingURL=signing-key-private-key-info.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"signing-key-private-key-info.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/signing-key-private-key-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,gDAAgD,CAAC;AAE9G,MAAM,WAAW,yBAA0B,SAAQ,uCAAuC;IACxF,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=signing-key-private-key-info.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"signing-key-private-key-info.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/signing-key-private-key-info.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- import type { ISimplePublicKeyOnlyBuffer } from './simple-public-key-only-buffer';
2
- export interface ISimpleKeyPairBuffer extends ISimplePublicKeyOnlyBuffer {
3
- publicKey: Buffer;
4
- privateKey: Buffer;
5
- }
6
- //# sourceMappingURL=simple-keypair-buffer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simple-keypair-buffer.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/simple-keypair-buffer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAElF,MAAM,WAAW,oBAAqB,SAAQ,0BAA0B;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=simple-keypair-buffer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simple-keypair-buffer.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/simple-keypair-buffer.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- import type { ISimplePublicKeyOnly } from './simple-public-key-only';
2
- export interface ISimpleKeyPair extends ISimplePublicKeyOnly {
3
- publicKey: string;
4
- privateKey: Buffer;
5
- }
6
- //# sourceMappingURL=simple-keypair.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simple-keypair.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/simple-keypair.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,MAAM,WAAW,cAAe,SAAQ,oBAAoB;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=simple-keypair.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simple-keypair.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/simple-keypair.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export interface ISimplePublicKeyOnlyBuffer {
2
- publicKey: Buffer;
3
- }
4
- //# sourceMappingURL=simple-public-key-only-buffer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simple-public-key-only-buffer.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/simple-public-key-only-buffer.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=simple-public-key-only-buffer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simple-public-key-only-buffer.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/simple-public-key-only-buffer.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export interface ISimplePublicKeyOnly {
2
- publicKey: string;
3
- }
4
- //# sourceMappingURL=simple-public-key-only.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simple-public-key-only.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/simple-public-key-only.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=simple-public-key-only.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simple-public-key-only.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/simple-public-key-only.ts"],"names":[],"mappings":""}
@@ -1,35 +0,0 @@
1
- import { EciesEncryptionTypeEnum } from '@digitaldefiance/ecies-lib';
2
- /**
3
- * Interface for encrypted messages
4
- */
5
- export interface ISingleEncryptedParsedHeader {
6
- /**
7
- * The optional preamble, if specified/relevant
8
- */
9
- readonly preamble?: Buffer;
10
- /**
11
- * The encryption type used to encrypt the data
12
- */
13
- readonly encryptionType: EciesEncryptionTypeEnum;
14
- /**
15
- * The ephemeral public key used to encrypt the data
16
- */
17
- readonly ephemeralPublicKey: Buffer;
18
- /**
19
- * The initialization vector used to encrypt the data
20
- */
21
- readonly iv: Buffer;
22
- /**
23
- * The authentication tag used to encrypt the data
24
- */
25
- readonly authTag: Buffer;
26
- /**
27
- * The length of the encrypted data
28
- */
29
- readonly dataLength: number;
30
- /**
31
- * The size of the encrypted data header
32
- */
33
- readonly headerSize: number;
34
- }
35
- //# sourceMappingURL=single-encrypted-parsed-header.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"single-encrypted-parsed-header.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/single-encrypted-parsed-header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,uBAAuB,CAAC;IACjD;;OAEG;IACH,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=single-encrypted-parsed-header.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"single-encrypted-parsed-header.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/single-encrypted-parsed-header.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- export interface IStreamConfig {
2
- chunkSize: number;
3
- includeChecksums: boolean;
4
- }
5
- export declare const DEFAULT_STREAM_CONFIG: IStreamConfig;
6
- //# sourceMappingURL=stream-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream-config.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/stream-config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,qBAAqB,EAAE,aAGnC,CAAC"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_STREAM_CONFIG = void 0;
4
- exports.DEFAULT_STREAM_CONFIG = {
5
- chunkSize: 65536, // 64KB
6
- includeChecksums: false,
7
- };
8
- //# sourceMappingURL=stream-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream-config.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/stream-config.ts"],"names":[],"mappings":";;;AAKa,QAAA,qBAAqB,GAAkB;IAClD,SAAS,EAAE,KAAK,EAAE,OAAO;IACzB,gBAAgB,EAAE,KAAK;CACxB,CAAC"}
@@ -1,8 +0,0 @@
1
- export interface IStreamProgress {
2
- processedBytes: number;
3
- totalBytes: number;
4
- percentComplete: number;
5
- throughputBytesPerSec: number;
6
- estimatedTimeRemainingMs: number;
7
- }
8
- //# sourceMappingURL=stream-progress.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream-progress.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/stream-progress.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,wBAAwB,EAAE,MAAM,CAAC;CAClC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=stream-progress.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stream-progress.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/stream-progress.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- import { SecureBuffer } from '@digitaldefiance/ecies-lib';
2
- import { Wallet } from '@ethereumjs/wallet';
3
- export interface IWalletSeed {
4
- wallet: Wallet;
5
- seed: SecureBuffer;
6
- }
7
- //# sourceMappingURL=wallet-seed.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wallet-seed.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/wallet-seed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,YAAY,CAAC;CACpB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=wallet-seed.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wallet-seed.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/wallet-seed.ts"],"names":[],"mappings":""}
@@ -1,7 +0,0 @@
1
- export interface IWrappedKeyConsts {
2
- SALT_SIZE: number;
3
- IV_SIZE: number;
4
- MASTER_KEY_SIZE: number;
5
- MIN_ITERATIONS: number;
6
- }
7
- //# sourceMappingURL=wrapped-key-consts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wrapped-key-consts.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/wrapped-key-consts.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;CACxB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=wrapped-key-consts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wrapped-key-consts.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/wrapped-key-consts.ts"],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- import { IConstants } from '../interfaces/constants';
2
- export declare enum CryptoServiceKey {
3
- ECIES = "ecies",
4
- PBKDF2 = "pbkdf2",
5
- AES_GCM = "aes-gcm"
6
- }
7
- export declare class CryptoContainer {
8
- private services;
9
- private constructor();
10
- static create(config?: IConstants): CryptoContainer;
11
- get<T>(key: CryptoServiceKey): T;
12
- }
13
- //# sourceMappingURL=crypto-container.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crypto-container.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/lib/crypto-container.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAKrD,oBAAY,gBAAgB;IAC1B,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAwC;IAExD,OAAO;IAYP,MAAM,CAAC,MAAM,CAAC,MAAM,GAAE,UAAsB,GAAG,eAAe;IAI9D,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,gBAAgB,GAAG,CAAC;CAGjC"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CryptoContainer = exports.CryptoServiceKey = void 0;
4
- /* eslint-disable @typescript-eslint/no-unsafe-argument */
5
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
6
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
7
- const constants_1 = require("../constants");
8
- const aes_gcm_1 = require("../services/aes-gcm");
9
- const ecies_1 = require("../services/ecies");
10
- const pbkdf2_1 = require("../services/pbkdf2");
11
- var CryptoServiceKey;
12
- (function (CryptoServiceKey) {
13
- CryptoServiceKey["ECIES"] = "ecies";
14
- CryptoServiceKey["PBKDF2"] = "pbkdf2";
15
- CryptoServiceKey["AES_GCM"] = "aes-gcm";
16
- })(CryptoServiceKey || (exports.CryptoServiceKey = CryptoServiceKey = {}));
17
- class CryptoContainer {
18
- services = new Map();
19
- constructor(config) {
20
- this.services.set(CryptoServiceKey.ECIES, new ecies_1.ECIESService(undefined, config.ECIES));
21
- this.services.set(CryptoServiceKey.PBKDF2, new pbkdf2_1.Pbkdf2Service(config.PBKDF2_PROFILES, config.ECIES, config.PBKDF2));
22
- this.services.set(CryptoServiceKey.AES_GCM, new aes_gcm_1.AESGCMService(config));
23
- }
24
- static create(config = constants_1.Constants) {
25
- return new CryptoContainer(config);
26
- }
27
- get(key) {
28
- return this.services.get(key);
29
- }
30
- }
31
- exports.CryptoContainer = CryptoContainer;
32
- //# sourceMappingURL=crypto-container.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crypto-container.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/lib/crypto-container.ts"],"names":[],"mappings":";;;AAAA,0DAA0D;AAC1D,+DAA+D;AAC/D,4DAA4D;AAC5D,4CAAyC;AAEzC,iDAAoD;AACpD,6CAAiD;AACjD,+CAAmD;AAEnD,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,qCAAiB,CAAA;IACjB,uCAAmB,CAAA;AACrB,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B;AAED,MAAa,eAAe;IAClB,QAAQ,GAAG,IAAI,GAAG,EAA6B,CAAC;IAExD,YAAoB,MAAkB;QACpC,IAAI,CAAC,QAAQ,CAAC,GAAG,CACf,gBAAgB,CAAC,KAAK,EACtB,IAAI,oBAAY,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,CAC1C,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,GAAG,CACf,gBAAgB,CAAC,MAAM,EACvB,IAAI,sBAAa,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CACvE,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,uBAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,SAAqB,qBAAS;QAC1C,OAAO,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;IAED,GAAG,CAAI,GAAqB;QAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAM,CAAC;IACrC,CAAC;CACF;AAtBD,0CAsBC"}
@@ -1,4 +0,0 @@
1
- export * from './crypto-container';
2
- export * from './invariant-validator';
3
- export * from './invariants';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC"}
package/src/lib/index.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./crypto-container"), exports);
5
- tslib_1.__exportStar(require("./invariant-validator"), exports);
6
- tslib_1.__exportStar(require("./invariants"), exports);
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/lib/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,gEAAsC;AACtC,uDAA6B"}
@@ -1,69 +0,0 @@
1
- import { IConstants } from '../interfaces/constants';
2
- /**
3
- * Base interface for invariants
4
- */
5
- interface IInvariant {
6
- name: string;
7
- description: string;
8
- check(config: IConstants): boolean;
9
- errorMessage(config: IConstants): string;
10
- }
11
- /**
12
- * Node.js-specific invariant validator.
13
- *
14
- * Extends the base ecies-lib validator with Node.js-specific invariants.
15
- * Validates configuration consistency to prevent bugs like the 12 vs 32-byte
16
- * recipient ID discrepancy.
17
- *
18
- * @example
19
- * ```typescript
20
- * import { InvariantValidator } from '@digitaldefiance/node-ecies-lib';
21
- * import { MyCustomInvariant } from './my-invariants';
22
- *
23
- * // Register a custom invariant
24
- * InvariantValidator.registerInvariant(new MyCustomInvariant());
25
- *
26
- * // Validate configuration
27
- * InvariantValidator.validateAll(config); // throws if any invariant fails
28
- * ```
29
- */
30
- export declare class InvariantValidator {
31
- /**
32
- * Node-specific invariants registered by default.
33
- */
34
- private static readonly NODE_DEFAULT_INVARIANTS;
35
- private static customInvariants;
36
- /**
37
- * Register a custom invariant to be checked during validation.
38
- *
39
- * @param invariant - The invariant to register
40
- */
41
- static registerInvariant(invariant: IInvariant): void;
42
- /**
43
- * Unregister a custom invariant by name.
44
- *
45
- * @param name - The name of the invariant to unregister
46
- * @returns true if the invariant was found and removed, false otherwise
47
- */
48
- static unregisterInvariant(name: string): boolean;
49
- /**
50
- * Get all registered invariants (default + custom).
51
- */
52
- static getAllInvariants(): readonly IInvariant[];
53
- /**
54
- * Validate all registered invariants against a configuration.
55
- *
56
- * This checks Node-specific invariants.
57
- *
58
- * @param config - The configuration to validate
59
- * @throws Error if any invariant check fails
60
- */
61
- static validateAll(config: IConstants): void;
62
- /**
63
- * Clear all custom invariants.
64
- * Default invariants are not affected.
65
- */
66
- static clearCustomInvariants(): void;
67
- }
68
- export {};
69
- //# sourceMappingURL=invariant-validator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invariant-validator.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/lib/invariant-validator.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrD;;GAEG;AACH,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;IACnC,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,kBAAkB;IAC7B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAE7C;IAEF,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAoB;IAEnD;;;;OAIG;IACH,MAAM,CAAC,iBAAiB,CAAC,SAAS,EAAE,UAAU,GAAG,IAAI;IAIrD;;;;;OAKG;IACH,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IASjD;;OAEG;IACH,MAAM,CAAC,gBAAgB,IAAI,SAAS,UAAU,EAAE;IAIhD;;;;;;;OAOG;IACH,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAuB5C;;;OAGG;IACH,MAAM,CAAC,qBAAqB,IAAI,IAAI;CAGrC"}
@@ -1,98 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.InvariantValidator = void 0;
4
- /* eslint-disable @typescript-eslint/no-unsafe-call */
5
- /* eslint-disable @typescript-eslint/no-unsafe-member-access */
6
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
7
- /* eslint-disable @typescript-eslint/no-unsafe-argument */
8
- /* eslint-disable @typescript-eslint/no-unsafe-return */
9
- const i18n_lib_1 = require("@digitaldefiance/i18n-lib");
10
- const node_ecies_i18n_setup_1 = require("../i18n/node-ecies-i18n-setup");
11
- const node_keys_1 = require("../i18n/node-keys");
12
- const recipient_id_consistency_1 = require("./invariants/recipient-id-consistency");
13
- /**
14
- * Node.js-specific invariant validator.
15
- *
16
- * Extends the base ecies-lib validator with Node.js-specific invariants.
17
- * Validates configuration consistency to prevent bugs like the 12 vs 32-byte
18
- * recipient ID discrepancy.
19
- *
20
- * @example
21
- * ```typescript
22
- * import { InvariantValidator } from '@digitaldefiance/node-ecies-lib';
23
- * import { MyCustomInvariant } from './my-invariants';
24
- *
25
- * // Register a custom invariant
26
- * InvariantValidator.registerInvariant(new MyCustomInvariant());
27
- *
28
- * // Validate configuration
29
- * InvariantValidator.validateAll(config); // throws if any invariant fails
30
- * ```
31
- */
32
- class InvariantValidator {
33
- /**
34
- * Node-specific invariants registered by default.
35
- */
36
- static NODE_DEFAULT_INVARIANTS = [
37
- new recipient_id_consistency_1.RecipientIdConsistencyInvariant(),
38
- ];
39
- static customInvariants = [];
40
- /**
41
- * Register a custom invariant to be checked during validation.
42
- *
43
- * @param invariant - The invariant to register
44
- */
45
- static registerInvariant(invariant) {
46
- this.customInvariants.push(invariant);
47
- }
48
- /**
49
- * Unregister a custom invariant by name.
50
- *
51
- * @param name - The name of the invariant to unregister
52
- * @returns true if the invariant was found and removed, false otherwise
53
- */
54
- static unregisterInvariant(name) {
55
- const index = this.customInvariants.findIndex((inv) => inv.name === name);
56
- if (index === -1) {
57
- return false;
58
- }
59
- this.customInvariants.splice(index, 1);
60
- return true;
61
- }
62
- /**
63
- * Get all registered invariants (default + custom).
64
- */
65
- static getAllInvariants() {
66
- return [...this.NODE_DEFAULT_INVARIANTS, ...this.customInvariants];
67
- }
68
- /**
69
- * Validate all registered invariants against a configuration.
70
- *
71
- * This checks Node-specific invariants.
72
- *
73
- * @param config - The configuration to validate
74
- * @throws Error if any invariant check fails
75
- */
76
- static validateAll(config) {
77
- const failures = [];
78
- // Validate Node-specific invariants
79
- for (const invariant of this.getAllInvariants()) {
80
- if (!invariant.check(config)) {
81
- failures.push(invariant.errorMessage(config));
82
- }
83
- }
84
- if (failures.length > 0) {
85
- const engine = (0, node_ecies_i18n_setup_1.getNodeEciesI18nEngine)();
86
- throw i18n_lib_1.TranslatableGenericError.withEngine(engine, node_keys_1.NodeEciesComponentId, node_keys_1.NodeEciesStringKey.Error_Invariant_ConfigurationValidationFailedTemplate, { failures: failures.join('\n\n') }, undefined, { invariantCount: failures.length });
87
- }
88
- }
89
- /**
90
- * Clear all custom invariants.
91
- * Default invariants are not affected.
92
- */
93
- static clearCustomInvariants() {
94
- this.customInvariants = [];
95
- }
96
- }
97
- exports.InvariantValidator = InvariantValidator;
98
- //# sourceMappingURL=invariant-validator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invariant-validator.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/lib/invariant-validator.ts"],"names":[],"mappings":";;;AAAA,sDAAsD;AACtD,+DAA+D;AAC/D,4DAA4D;AAC5D,0DAA0D;AAC1D,wDAAwD;AACxD,wDAAqE;AAErE,yEAAuE;AACvE,iDAA6E;AAG7E,oFAAwF;AAYxF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,kBAAkB;IAC7B;;OAEG;IACK,MAAM,CAAU,uBAAuB,GAAiB;QAC9D,IAAI,0DAA+B,EAAE;KACtC,CAAC;IAEM,MAAM,CAAC,gBAAgB,GAAiB,EAAE,CAAC;IAEnD;;;;OAIG;IACH,MAAM,CAAC,iBAAiB,CAAC,SAAqB;QAC5C,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,mBAAmB,CAAC,IAAY;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QAC1E,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACjB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,gBAAgB;QACrB,OAAO,CAAC,GAAG,IAAI,CAAC,uBAAuB,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,WAAW,CAAC,MAAkB;QACnC,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,oCAAoC;QACpC,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE,CAAC;YAChD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC7B,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;YAChD,CAAC;QACH,CAAC;QAED,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,MAAM,MAAM,GAAG,IAAA,8CAAsB,GAAE,CAAC;YACxC,MAAM,mCAAwB,CAAC,UAAU,CACvC,MAAM,EACN,gCAAoB,EACpB,8BAAkB,CAAC,qDAAqD,EACxE,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EACnC,SAAS,EACT,EAAE,cAAc,EAAE,QAAQ,CAAC,MAAM,EAAE,CACpC,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,qBAAqB;QAC1B,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC;IAC7B,CAAC;;AA9EH,gDA+EC"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Node.js-specific invariants for configuration validation.
3
- *
4
- * These invariants extend and complement the base ecies-lib invariants
5
- * with Node.js-specific validation rules.
6
- */
7
- export { RecipientIdConsistencyInvariant } from './recipient-id-consistency';
8
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/digitaldefiance-node-ecies-lib/src/lib/invariants/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC"}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- /**
3
- * Node.js-specific invariants for configuration validation.
4
- *
5
- * These invariants extend and complement the base ecies-lib invariants
6
- * with Node.js-specific validation rules.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.RecipientIdConsistencyInvariant = void 0;
10
- var recipient_id_consistency_1 = require("./recipient-id-consistency");
11
- Object.defineProperty(exports, "RecipientIdConsistencyInvariant", { enumerable: true, get: function () { return recipient_id_consistency_1.RecipientIdConsistencyInvariant; } });
12
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/digitaldefiance-node-ecies-lib/src/lib/invariants/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,uEAA6E;AAApE,2IAAA,+BAA+B,OAAA"}