valley-baileys 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1750) hide show
  1. package/index.js +4 -0
  2. package/node_modules/@borewit/text-codec/LICENSE.txt +9 -0
  3. package/node_modules/@borewit/text-codec/README.md +87 -0
  4. package/node_modules/@borewit/text-codec/lib/index.d.ts +6 -0
  5. package/node_modules/@borewit/text-codec/lib/index.js +380 -0
  6. package/node_modules/@borewit/text-codec/package.json +70 -0
  7. package/node_modules/@cacheable/memory/LICENSE +19 -0
  8. package/node_modules/@cacheable/memory/README.md +340 -0
  9. package/node_modules/@cacheable/memory/dist/index.cjs +830 -0
  10. package/node_modules/@cacheable/memory/dist/index.d.cts +310 -0
  11. package/node_modules/@cacheable/memory/dist/index.d.ts +310 -0
  12. package/node_modules/@cacheable/memory/dist/index.js +807 -0
  13. package/node_modules/@cacheable/memory/package.json +65 -0
  14. package/node_modules/@cacheable/node-cache/LICENSE +19 -0
  15. package/node_modules/@cacheable/node-cache/README.md +352 -0
  16. package/node_modules/@cacheable/node-cache/dist/index.cjs +567 -0
  17. package/node_modules/@cacheable/node-cache/dist/index.d.cts +335 -0
  18. package/node_modules/@cacheable/node-cache/dist/index.d.ts +335 -0
  19. package/node_modules/@cacheable/node-cache/dist/index.js +540 -0
  20. package/node_modules/@cacheable/node-cache/package.json +69 -0
  21. package/node_modules/@cacheable/utils/LICENSE +19 -0
  22. package/node_modules/@cacheable/utils/README.md +520 -0
  23. package/node_modules/@cacheable/utils/dist/index.cjs +677 -0
  24. package/node_modules/@cacheable/utils/dist/index.d.cts +307 -0
  25. package/node_modules/@cacheable/utils/dist/index.d.ts +307 -0
  26. package/node_modules/@cacheable/utils/dist/index.js +630 -0
  27. package/node_modules/@cacheable/utils/package.json +56 -0
  28. package/node_modules/@hapi/boom/LICENSE.md +10 -0
  29. package/node_modules/@hapi/boom/README.md +17 -0
  30. package/node_modules/@hapi/boom/lib/index.d.ts +549 -0
  31. package/node_modules/@hapi/boom/lib/index.js +469 -0
  32. package/node_modules/@hapi/boom/package.json +28 -0
  33. package/node_modules/@hapi/hoek/LICENSE.md +12 -0
  34. package/node_modules/@hapi/hoek/README.md +19 -0
  35. package/node_modules/@hapi/hoek/lib/applyToDefaults.js +102 -0
  36. package/node_modules/@hapi/hoek/lib/assert.js +22 -0
  37. package/node_modules/@hapi/hoek/lib/bench.js +29 -0
  38. package/node_modules/@hapi/hoek/lib/block.js +12 -0
  39. package/node_modules/@hapi/hoek/lib/clone.js +176 -0
  40. package/node_modules/@hapi/hoek/lib/contain.js +307 -0
  41. package/node_modules/@hapi/hoek/lib/deepEqual.js +317 -0
  42. package/node_modules/@hapi/hoek/lib/error.js +26 -0
  43. package/node_modules/@hapi/hoek/lib/escapeHeaderAttribute.js +16 -0
  44. package/node_modules/@hapi/hoek/lib/escapeHtml.js +87 -0
  45. package/node_modules/@hapi/hoek/lib/escapeJson.js +28 -0
  46. package/node_modules/@hapi/hoek/lib/escapeRegex.js +11 -0
  47. package/node_modules/@hapi/hoek/lib/flatten.js +20 -0
  48. package/node_modules/@hapi/hoek/lib/ignore.js +6 -0
  49. package/node_modules/@hapi/hoek/lib/index.d.ts +471 -0
  50. package/node_modules/@hapi/hoek/lib/index.js +45 -0
  51. package/node_modules/@hapi/hoek/lib/intersect.js +41 -0
  52. package/node_modules/@hapi/hoek/lib/isPromise.js +9 -0
  53. package/node_modules/@hapi/hoek/lib/merge.js +78 -0
  54. package/node_modules/@hapi/hoek/lib/once.js +25 -0
  55. package/node_modules/@hapi/hoek/lib/reach.js +76 -0
  56. package/node_modules/@hapi/hoek/lib/reachTemplate.js +16 -0
  57. package/node_modules/@hapi/hoek/lib/stringify.js +14 -0
  58. package/node_modules/@hapi/hoek/lib/types.js +55 -0
  59. package/node_modules/@hapi/hoek/lib/utils.js +9 -0
  60. package/node_modules/@hapi/hoek/lib/wait.js +37 -0
  61. package/node_modules/@hapi/hoek/package.json +31 -0
  62. package/node_modules/@keyv/bigmap/LICENSE +21 -0
  63. package/node_modules/@keyv/bigmap/README.md +624 -0
  64. package/node_modules/@keyv/bigmap/dist/index.cjs +268 -0
  65. package/node_modules/@keyv/bigmap/dist/index.d.cts +157 -0
  66. package/node_modules/@keyv/bigmap/dist/index.d.ts +157 -0
  67. package/node_modules/@keyv/bigmap/dist/index.js +239 -0
  68. package/node_modules/@keyv/bigmap/package.json +73 -0
  69. package/node_modules/@keyv/serialize/LICENSE +22 -0
  70. package/node_modules/@keyv/serialize/README.md +15 -0
  71. package/node_modules/@keyv/serialize/dist/index.cjs +84 -0
  72. package/node_modules/@keyv/serialize/dist/index.d.cts +4 -0
  73. package/node_modules/@keyv/serialize/dist/index.d.ts +4 -0
  74. package/node_modules/@keyv/serialize/dist/index.js +58 -0
  75. package/node_modules/@keyv/serialize/package.json +55 -0
  76. package/node_modules/@pinojs/redact/.github/dependabot.yml +13 -0
  77. package/node_modules/@pinojs/redact/.github/workflows/ci.yml +48 -0
  78. package/node_modules/@pinojs/redact/.github/workflows/publish-release.yml +43 -0
  79. package/node_modules/@pinojs/redact/LICENSE +21 -0
  80. package/node_modules/@pinojs/redact/README.md +350 -0
  81. package/node_modules/@pinojs/redact/benchmarks/basic.js +184 -0
  82. package/node_modules/@pinojs/redact/eslint.config.js +1 -0
  83. package/node_modules/@pinojs/redact/index.d.ts +52 -0
  84. package/node_modules/@pinojs/redact/index.js +529 -0
  85. package/node_modules/@pinojs/redact/index.test-d.ts +22 -0
  86. package/node_modules/@pinojs/redact/package.json +37 -0
  87. package/node_modules/@pinojs/redact/scripts/sync-version.mjs +20 -0
  88. package/node_modules/@pinojs/redact/test/actual-redact-comparison.test.js +211 -0
  89. package/node_modules/@pinojs/redact/test/index.test.js +824 -0
  90. package/node_modules/@pinojs/redact/test/integration.test.js +390 -0
  91. package/node_modules/@pinojs/redact/test/multiple-wildcards.test.js +227 -0
  92. package/node_modules/@pinojs/redact/test/prototype-pollution.test.js +223 -0
  93. package/node_modules/@pinojs/redact/test/selective-clone.test.js +115 -0
  94. package/node_modules/@pinojs/redact/tsconfig.json +19 -0
  95. package/node_modules/@protobufjs/aspromise/LICENSE +26 -0
  96. package/node_modules/@protobufjs/aspromise/README.md +13 -0
  97. package/node_modules/@protobufjs/aspromise/index.d.ts +13 -0
  98. package/node_modules/@protobufjs/aspromise/index.js +52 -0
  99. package/node_modules/@protobufjs/aspromise/package.json +21 -0
  100. package/node_modules/@protobufjs/aspromise/tests/index.js +130 -0
  101. package/node_modules/@protobufjs/base64/LICENSE +26 -0
  102. package/node_modules/@protobufjs/base64/README.md +19 -0
  103. package/node_modules/@protobufjs/base64/index.d.ts +32 -0
  104. package/node_modules/@protobufjs/base64/index.js +139 -0
  105. package/node_modules/@protobufjs/base64/package.json +21 -0
  106. package/node_modules/@protobufjs/base64/tests/index.js +46 -0
  107. package/node_modules/@protobufjs/codegen/LICENSE +26 -0
  108. package/node_modules/@protobufjs/codegen/README.md +49 -0
  109. package/node_modules/@protobufjs/codegen/index.d.ts +31 -0
  110. package/node_modules/@protobufjs/codegen/index.js +112 -0
  111. package/node_modules/@protobufjs/codegen/package.json +13 -0
  112. package/node_modules/@protobufjs/codegen/tests/index.js +13 -0
  113. package/node_modules/@protobufjs/eventemitter/CHANGELOG.md +8 -0
  114. package/node_modules/@protobufjs/eventemitter/LICENSE +26 -0
  115. package/node_modules/@protobufjs/eventemitter/README.md +22 -0
  116. package/node_modules/@protobufjs/eventemitter/index.d.ts +45 -0
  117. package/node_modules/@protobufjs/eventemitter/index.js +86 -0
  118. package/node_modules/@protobufjs/eventemitter/package.json +21 -0
  119. package/node_modules/@protobufjs/eventemitter/tests/index.js +83 -0
  120. package/node_modules/@protobufjs/fetch/CHANGELOG.md +8 -0
  121. package/node_modules/@protobufjs/fetch/LICENSE +26 -0
  122. package/node_modules/@protobufjs/fetch/README.md +13 -0
  123. package/node_modules/@protobufjs/fetch/index.d.ts +56 -0
  124. package/node_modules/@protobufjs/fetch/index.js +112 -0
  125. package/node_modules/@protobufjs/fetch/package.json +27 -0
  126. package/node_modules/@protobufjs/fetch/tests/data/file.txt +1 -0
  127. package/node_modules/@protobufjs/fetch/tests/index.js +158 -0
  128. package/node_modules/@protobufjs/fetch/util/fs.js +11 -0
  129. package/node_modules/@protobufjs/float/LICENSE +26 -0
  130. package/node_modules/@protobufjs/float/README.md +102 -0
  131. package/node_modules/@protobufjs/float/bench/index.js +87 -0
  132. package/node_modules/@protobufjs/float/bench/suite.js +46 -0
  133. package/node_modules/@protobufjs/float/index.d.ts +83 -0
  134. package/node_modules/@protobufjs/float/index.js +335 -0
  135. package/node_modules/@protobufjs/float/package.json +26 -0
  136. package/node_modules/@protobufjs/float/tests/index.js +100 -0
  137. package/node_modules/@protobufjs/path/LICENSE +26 -0
  138. package/node_modules/@protobufjs/path/README.md +19 -0
  139. package/node_modules/@protobufjs/path/index.d.ts +22 -0
  140. package/node_modules/@protobufjs/path/index.js +65 -0
  141. package/node_modules/@protobufjs/path/package.json +21 -0
  142. package/node_modules/@protobufjs/path/tests/index.js +60 -0
  143. package/node_modules/@protobufjs/pool/.npmignore +3 -0
  144. package/node_modules/@protobufjs/pool/LICENSE +26 -0
  145. package/node_modules/@protobufjs/pool/README.md +13 -0
  146. package/node_modules/@protobufjs/pool/index.d.ts +32 -0
  147. package/node_modules/@protobufjs/pool/index.js +48 -0
  148. package/node_modules/@protobufjs/pool/package.json +21 -0
  149. package/node_modules/@protobufjs/pool/tests/index.js +33 -0
  150. package/node_modules/@protobufjs/utf8/LICENSE +26 -0
  151. package/node_modules/@protobufjs/utf8/README.md +20 -0
  152. package/node_modules/@protobufjs/utf8/index.d.ts +24 -0
  153. package/node_modules/@protobufjs/utf8/index.js +104 -0
  154. package/node_modules/@protobufjs/utf8/package.json +21 -0
  155. package/node_modules/@protobufjs/utf8/tests/data/surrogate_pair_bug.txt +207 -0
  156. package/node_modules/@protobufjs/utf8/tests/data/utf8.txt +216 -0
  157. package/node_modules/@protobufjs/utf8/tests/index.js +74 -0
  158. package/node_modules/@tokenizer/inflate/LICENSE +15 -0
  159. package/node_modules/@tokenizer/inflate/README.md +114 -0
  160. package/node_modules/@tokenizer/inflate/lib/GzipHandler.d.ts +6 -0
  161. package/node_modules/@tokenizer/inflate/lib/GzipHandler.js +19 -0
  162. package/node_modules/@tokenizer/inflate/lib/ZipHandler.d.ts +26 -0
  163. package/node_modules/@tokenizer/inflate/lib/ZipHandler.js +233 -0
  164. package/node_modules/@tokenizer/inflate/lib/ZipToken.d.ts +94 -0
  165. package/node_modules/@tokenizer/inflate/lib/ZipToken.js +117 -0
  166. package/node_modules/@tokenizer/inflate/lib/index.d.ts +3 -0
  167. package/node_modules/@tokenizer/inflate/lib/index.js +2 -0
  168. package/node_modules/@tokenizer/inflate/package.json +76 -0
  169. package/node_modules/@tokenizer/token/README.md +19 -0
  170. package/node_modules/@tokenizer/token/index.d.ts +30 -0
  171. package/node_modules/@tokenizer/token/package.json +33 -0
  172. package/node_modules/@types/node/LICENSE +21 -0
  173. package/node_modules/@types/node/README.md +15 -0
  174. package/node_modules/@types/node/assert/strict.d.ts +68 -0
  175. package/node_modules/@types/node/assert.d.ts +1077 -0
  176. package/node_modules/@types/node/async_hooks.d.ts +711 -0
  177. package/node_modules/@types/node/buffer.buffer.d.ts +466 -0
  178. package/node_modules/@types/node/buffer.d.ts +1760 -0
  179. package/node_modules/@types/node/child_process.d.ts +1362 -0
  180. package/node_modules/@types/node/cluster.d.ts +432 -0
  181. package/node_modules/@types/node/console.d.ts +93 -0
  182. package/node_modules/@types/node/constants.d.ts +14 -0
  183. package/node_modules/@types/node/crypto.d.ts +3941 -0
  184. package/node_modules/@types/node/dgram.d.ts +537 -0
  185. package/node_modules/@types/node/diagnostics_channel.d.ts +563 -0
  186. package/node_modules/@types/node/dns/promises.d.ts +497 -0
  187. package/node_modules/@types/node/dns.d.ts +876 -0
  188. package/node_modules/@types/node/domain.d.ts +150 -0
  189. package/node_modules/@types/node/events.d.ts +1008 -0
  190. package/node_modules/@types/node/fs/promises.d.ts +1468 -0
  191. package/node_modules/@types/node/fs.d.ts +4771 -0
  192. package/node_modules/@types/node/globals.d.ts +150 -0
  193. package/node_modules/@types/node/globals.typedarray.d.ts +101 -0
  194. package/node_modules/@types/node/http.d.ts +2147 -0
  195. package/node_modules/@types/node/http2.d.ts +2489 -0
  196. package/node_modules/@types/node/https.d.ts +400 -0
  197. package/node_modules/@types/node/index.d.ts +114 -0
  198. package/node_modules/@types/node/inspector/promises.d.ts +35 -0
  199. package/node_modules/@types/node/inspector.d.ts +264 -0
  200. package/node_modules/@types/node/inspector.generated.d.ts +4406 -0
  201. package/node_modules/@types/node/module.d.ts +726 -0
  202. package/node_modules/@types/node/net.d.ts +970 -0
  203. package/node_modules/@types/node/os.d.ts +498 -0
  204. package/node_modules/@types/node/package.json +155 -0
  205. package/node_modules/@types/node/path/posix.d.ts +8 -0
  206. package/node_modules/@types/node/path/win32.d.ts +8 -0
  207. package/node_modules/@types/node/path.d.ts +178 -0
  208. package/node_modules/@types/node/perf_hooks.d.ts +604 -0
  209. package/node_modules/@types/node/process.d.ts +2204 -0
  210. package/node_modules/@types/node/punycode.d.ts +89 -0
  211. package/node_modules/@types/node/querystring.d.ts +139 -0
  212. package/node_modules/@types/node/quic.d.ts +897 -0
  213. package/node_modules/@types/node/readline/promises.d.ts +158 -0
  214. package/node_modules/@types/node/readline.d.ts +508 -0
  215. package/node_modules/@types/node/repl.d.ts +420 -0
  216. package/node_modules/@types/node/sea.d.ts +47 -0
  217. package/node_modules/@types/node/sqlite.d.ts +1068 -0
  218. package/node_modules/@types/node/stream/consumers.d.ts +114 -0
  219. package/node_modules/@types/node/stream/iter.d.ts +301 -0
  220. package/node_modules/@types/node/stream/promises.d.ts +211 -0
  221. package/node_modules/@types/node/stream/web.d.ts +300 -0
  222. package/node_modules/@types/node/stream.d.ts +1774 -0
  223. package/node_modules/@types/node/string_decoder.d.ts +27 -0
  224. package/node_modules/@types/node/test/reporters.d.ts +59 -0
  225. package/node_modules/@types/node/test.d.ts +2279 -0
  226. package/node_modules/@types/node/timers/promises.d.ts +93 -0
  227. package/node_modules/@types/node/timers.d.ts +149 -0
  228. package/node_modules/@types/node/tls.d.ts +1193 -0
  229. package/node_modules/@types/node/trace_events.d.ts +103 -0
  230. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
  231. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  232. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
  233. package/node_modules/@types/node/ts5.6/index.d.ts +116 -0
  234. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  235. package/node_modules/@types/node/ts5.7/index.d.ts +116 -0
  236. package/node_modules/@types/node/tty.d.ts +225 -0
  237. package/node_modules/@types/node/url.d.ts +556 -0
  238. package/node_modules/@types/node/util/types.d.ts +558 -0
  239. package/node_modules/@types/node/util.d.ts +1660 -0
  240. package/node_modules/@types/node/v8.d.ts +980 -0
  241. package/node_modules/@types/node/vm.d.ts +1136 -0
  242. package/node_modules/@types/node/wasi.d.ts +131 -0
  243. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
  244. package/node_modules/@types/node/web-globals/blob.d.ts +23 -0
  245. package/node_modules/@types/node/web-globals/console.d.ts +9 -0
  246. package/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
  247. package/node_modules/@types/node/web-globals/domexception.d.ts +83 -0
  248. package/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
  249. package/node_modules/@types/node/web-globals/events.d.ts +106 -0
  250. package/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
  251. package/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
  252. package/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
  253. package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  254. package/node_modules/@types/node/web-globals/performance.d.ts +45 -0
  255. package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  256. package/node_modules/@types/node/web-globals/streams.d.ts +115 -0
  257. package/node_modules/@types/node/web-globals/timers.d.ts +44 -0
  258. package/node_modules/@types/node/web-globals/url.d.ts +24 -0
  259. package/node_modules/@types/node/worker_threads.d.ts +668 -0
  260. package/node_modules/@types/node/zlib/iter.d.ts +131 -0
  261. package/node_modules/@types/node/zlib.d.ts +589 -0
  262. package/node_modules/@whiskeysockets/baileys/LICENSE +21 -0
  263. package/node_modules/@whiskeysockets/baileys/README.md +1312 -0
  264. package/node_modules/@whiskeysockets/baileys/WAProto/GenerateStatics.sh +3 -0
  265. package/node_modules/@whiskeysockets/baileys/WAProto/WAProto.proto +5479 -0
  266. package/node_modules/@whiskeysockets/baileys/WAProto/fix-imports.js +85 -0
  267. package/node_modules/@whiskeysockets/baileys/WAProto/index.d.ts +14017 -0
  268. package/node_modules/@whiskeysockets/baileys/WAProto/index.js +97691 -0
  269. package/node_modules/@whiskeysockets/baileys/engine-requirements.js +10 -0
  270. package/node_modules/@whiskeysockets/baileys/lib/Defaults/index.d.ts +75 -0
  271. package/node_modules/@whiskeysockets/baileys/lib/Defaults/index.d.ts.map +1 -0
  272. package/node_modules/@whiskeysockets/baileys/lib/Defaults/index.js +129 -0
  273. package/node_modules/@whiskeysockets/baileys/lib/Defaults/index.js.map +1 -0
  274. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/ciphertext-message.d.ts +10 -0
  275. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/ciphertext-message.d.ts.map +1 -0
  276. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/ciphertext-message.js +12 -0
  277. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/ciphertext-message.js.map +1 -0
  278. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/group-session-builder.d.ts +15 -0
  279. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/group-session-builder.d.ts.map +1 -0
  280. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/group-session-builder.js +30 -0
  281. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/group-session-builder.js.map +1 -0
  282. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/group_cipher.d.ts +17 -0
  283. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/group_cipher.d.ts.map +1 -0
  284. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/group_cipher.js +82 -0
  285. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/group_cipher.js.map +1 -0
  286. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/index.d.ts +12 -0
  287. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/index.d.ts.map +1 -0
  288. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/index.js +12 -0
  289. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/index.js.map +1 -0
  290. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/keyhelper.d.ts +11 -0
  291. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/keyhelper.d.ts.map +1 -0
  292. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/keyhelper.js +18 -0
  293. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/keyhelper.js.map +1 -0
  294. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-chain-key.d.ts +14 -0
  295. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-chain-key.d.ts.map +1 -0
  296. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-chain-key.js +26 -0
  297. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-chain-key.js.map +1 -0
  298. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
  299. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-distribution-message.d.ts.map +1 -0
  300. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-distribution-message.js +63 -0
  301. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-distribution-message.js.map +1 -0
  302. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-message.d.ts +19 -0
  303. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-message.d.ts.map +1 -0
  304. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-message.js +66 -0
  305. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-message.js.map +1 -0
  306. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-name.d.ts +18 -0
  307. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-name.d.ts.map +1 -0
  308. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-name.js +48 -0
  309. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-name.js.map +1 -0
  310. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-record.d.ts +31 -0
  311. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-record.d.ts.map +1 -0
  312. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-record.js +41 -0
  313. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-record.js.map +1 -0
  314. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-state.d.ts +39 -0
  315. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-state.d.ts.map +1 -0
  316. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-state.js +84 -0
  317. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-key-state.js.map +1 -0
  318. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-message-key.d.ts +12 -0
  319. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-message-key.d.ts.map +1 -0
  320. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-message-key.js +26 -0
  321. package/node_modules/@whiskeysockets/baileys/lib/Signal/Group/sender-message-key.js.map +1 -0
  322. package/node_modules/@whiskeysockets/baileys/lib/Signal/libsignal.d.ts +5 -0
  323. package/node_modules/@whiskeysockets/baileys/lib/Signal/libsignal.d.ts.map +1 -0
  324. package/node_modules/@whiskeysockets/baileys/lib/Signal/libsignal.js +431 -0
  325. package/node_modules/@whiskeysockets/baileys/lib/Signal/libsignal.js.map +1 -0
  326. package/node_modules/@whiskeysockets/baileys/lib/Signal/lid-mapping.d.ts +23 -0
  327. package/node_modules/@whiskeysockets/baileys/lib/Signal/lid-mapping.d.ts.map +1 -0
  328. package/node_modules/@whiskeysockets/baileys/lib/Signal/lid-mapping.js +277 -0
  329. package/node_modules/@whiskeysockets/baileys/lib/Signal/lid-mapping.js.map +1 -0
  330. package/node_modules/@whiskeysockets/baileys/lib/Socket/Client/index.d.ts +3 -0
  331. package/node_modules/@whiskeysockets/baileys/lib/Socket/Client/index.d.ts.map +1 -0
  332. package/node_modules/@whiskeysockets/baileys/lib/Socket/Client/index.js +3 -0
  333. package/node_modules/@whiskeysockets/baileys/lib/Socket/Client/index.js.map +1 -0
  334. package/node_modules/@whiskeysockets/baileys/lib/Socket/Client/types.d.ts +16 -0
  335. package/node_modules/@whiskeysockets/baileys/lib/Socket/Client/types.d.ts.map +1 -0
  336. package/node_modules/@whiskeysockets/baileys/lib/Socket/Client/types.js +11 -0
  337. package/node_modules/@whiskeysockets/baileys/lib/Socket/Client/types.js.map +1 -0
  338. package/node_modules/@whiskeysockets/baileys/lib/Socket/Client/websocket.d.ts +13 -0
  339. package/node_modules/@whiskeysockets/baileys/lib/Socket/Client/websocket.d.ts.map +1 -0
  340. package/node_modules/@whiskeysockets/baileys/lib/Socket/Client/websocket.js +54 -0
  341. package/node_modules/@whiskeysockets/baileys/lib/Socket/Client/websocket.js.map +1 -0
  342. package/node_modules/@whiskeysockets/baileys/lib/Socket/business.d.ts +217 -0
  343. package/node_modules/@whiskeysockets/baileys/lib/Socket/business.d.ts.map +1 -0
  344. package/node_modules/@whiskeysockets/baileys/lib/Socket/business.js +379 -0
  345. package/node_modules/@whiskeysockets/baileys/lib/Socket/business.js.map +1 -0
  346. package/node_modules/@whiskeysockets/baileys/lib/Socket/chats.d.ts +124 -0
  347. package/node_modules/@whiskeysockets/baileys/lib/Socket/chats.d.ts.map +1 -0
  348. package/node_modules/@whiskeysockets/baileys/lib/Socket/chats.js +1193 -0
  349. package/node_modules/@whiskeysockets/baileys/lib/Socket/chats.js.map +1 -0
  350. package/node_modules/@whiskeysockets/baileys/lib/Socket/communities.d.ts +273 -0
  351. package/node_modules/@whiskeysockets/baileys/lib/Socket/communities.d.ts.map +1 -0
  352. package/node_modules/@whiskeysockets/baileys/lib/Socket/communities.js +431 -0
  353. package/node_modules/@whiskeysockets/baileys/lib/Socket/communities.js.map +1 -0
  354. package/node_modules/@whiskeysockets/baileys/lib/Socket/groups.d.ts +161 -0
  355. package/node_modules/@whiskeysockets/baileys/lib/Socket/groups.d.ts.map +1 -0
  356. package/node_modules/@whiskeysockets/baileys/lib/Socket/groups.js +347 -0
  357. package/node_modules/@whiskeysockets/baileys/lib/Socket/groups.js.map +1 -0
  358. package/node_modules/@whiskeysockets/baileys/lib/Socket/index.d.ts +260 -0
  359. package/node_modules/@whiskeysockets/baileys/lib/Socket/index.d.ts.map +1 -0
  360. package/node_modules/@whiskeysockets/baileys/lib/Socket/index.js +13 -0
  361. package/node_modules/@whiskeysockets/baileys/lib/Socket/index.js.map +1 -0
  362. package/node_modules/@whiskeysockets/baileys/lib/Socket/messages-recv.d.ts +203 -0
  363. package/node_modules/@whiskeysockets/baileys/lib/Socket/messages-recv.d.ts.map +1 -0
  364. package/node_modules/@whiskeysockets/baileys/lib/Socket/messages-recv.js +1772 -0
  365. package/node_modules/@whiskeysockets/baileys/lib/Socket/messages-recv.js.map +1 -0
  366. package/node_modules/@whiskeysockets/baileys/lib/Socket/messages-send.d.ts +199 -0
  367. package/node_modules/@whiskeysockets/baileys/lib/Socket/messages-send.d.ts.map +1 -0
  368. package/node_modules/@whiskeysockets/baileys/lib/Socket/messages-send.js +1145 -0
  369. package/node_modules/@whiskeysockets/baileys/lib/Socket/messages-send.js.map +1 -0
  370. package/node_modules/@whiskeysockets/baileys/lib/Socket/mex.d.ts +3 -0
  371. package/node_modules/@whiskeysockets/baileys/lib/Socket/mex.d.ts.map +1 -0
  372. package/node_modules/@whiskeysockets/baileys/lib/Socket/mex.js +42 -0
  373. package/node_modules/@whiskeysockets/baileys/lib/Socket/mex.js.map +1 -0
  374. package/node_modules/@whiskeysockets/baileys/lib/Socket/newsletter.d.ts +170 -0
  375. package/node_modules/@whiskeysockets/baileys/lib/Socket/newsletter.d.ts.map +1 -0
  376. package/node_modules/@whiskeysockets/baileys/lib/Socket/newsletter.js +181 -0
  377. package/node_modules/@whiskeysockets/baileys/lib/Socket/newsletter.js.map +1 -0
  378. package/node_modules/@whiskeysockets/baileys/lib/Socket/socket.d.ts +59 -0
  379. package/node_modules/@whiskeysockets/baileys/lib/Socket/socket.d.ts.map +1 -0
  380. package/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js +967 -0
  381. package/node_modules/@whiskeysockets/baileys/lib/Socket/socket.js.map +1 -0
  382. package/node_modules/@whiskeysockets/baileys/lib/Types/Auth.d.ts +117 -0
  383. package/node_modules/@whiskeysockets/baileys/lib/Types/Auth.d.ts.map +1 -0
  384. package/node_modules/@whiskeysockets/baileys/lib/Types/Auth.js +2 -0
  385. package/node_modules/@whiskeysockets/baileys/lib/Types/Auth.js.map +1 -0
  386. package/node_modules/@whiskeysockets/baileys/lib/Types/Bussines.d.ts +25 -0
  387. package/node_modules/@whiskeysockets/baileys/lib/Types/Bussines.d.ts.map +1 -0
  388. package/node_modules/@whiskeysockets/baileys/lib/Types/Bussines.js +2 -0
  389. package/node_modules/@whiskeysockets/baileys/lib/Types/Bussines.js.map +1 -0
  390. package/node_modules/@whiskeysockets/baileys/lib/Types/Call.d.ts +15 -0
  391. package/node_modules/@whiskeysockets/baileys/lib/Types/Call.d.ts.map +1 -0
  392. package/node_modules/@whiskeysockets/baileys/lib/Types/Call.js +2 -0
  393. package/node_modules/@whiskeysockets/baileys/lib/Types/Call.js.map +1 -0
  394. package/node_modules/@whiskeysockets/baileys/lib/Types/Chat.d.ts +124 -0
  395. package/node_modules/@whiskeysockets/baileys/lib/Types/Chat.d.ts.map +1 -0
  396. package/node_modules/@whiskeysockets/baileys/lib/Types/Chat.js +8 -0
  397. package/node_modules/@whiskeysockets/baileys/lib/Types/Chat.js.map +1 -0
  398. package/node_modules/@whiskeysockets/baileys/lib/Types/Contact.d.ts +26 -0
  399. package/node_modules/@whiskeysockets/baileys/lib/Types/Contact.d.ts.map +1 -0
  400. package/node_modules/@whiskeysockets/baileys/lib/Types/Contact.js +2 -0
  401. package/node_modules/@whiskeysockets/baileys/lib/Types/Contact.js.map +1 -0
  402. package/node_modules/@whiskeysockets/baileys/lib/Types/Events.d.ts +256 -0
  403. package/node_modules/@whiskeysockets/baileys/lib/Types/Events.d.ts.map +1 -0
  404. package/node_modules/@whiskeysockets/baileys/lib/Types/Events.js +2 -0
  405. package/node_modules/@whiskeysockets/baileys/lib/Types/Events.js.map +1 -0
  406. package/node_modules/@whiskeysockets/baileys/lib/Types/GroupMetadata.d.ts +71 -0
  407. package/node_modules/@whiskeysockets/baileys/lib/Types/GroupMetadata.d.ts.map +1 -0
  408. package/node_modules/@whiskeysockets/baileys/lib/Types/GroupMetadata.js +2 -0
  409. package/node_modules/@whiskeysockets/baileys/lib/Types/GroupMetadata.js.map +1 -0
  410. package/node_modules/@whiskeysockets/baileys/lib/Types/Label.d.ts +47 -0
  411. package/node_modules/@whiskeysockets/baileys/lib/Types/Label.d.ts.map +1 -0
  412. package/node_modules/@whiskeysockets/baileys/lib/Types/Label.js +25 -0
  413. package/node_modules/@whiskeysockets/baileys/lib/Types/Label.js.map +1 -0
  414. package/node_modules/@whiskeysockets/baileys/lib/Types/LabelAssociation.d.ts +30 -0
  415. package/node_modules/@whiskeysockets/baileys/lib/Types/LabelAssociation.d.ts.map +1 -0
  416. package/node_modules/@whiskeysockets/baileys/lib/Types/LabelAssociation.js +7 -0
  417. package/node_modules/@whiskeysockets/baileys/lib/Types/LabelAssociation.js.map +1 -0
  418. package/node_modules/@whiskeysockets/baileys/lib/Types/Message.d.ts +320 -0
  419. package/node_modules/@whiskeysockets/baileys/lib/Types/Message.d.ts.map +1 -0
  420. package/node_modules/@whiskeysockets/baileys/lib/Types/Message.js +11 -0
  421. package/node_modules/@whiskeysockets/baileys/lib/Types/Message.js.map +1 -0
  422. package/node_modules/@whiskeysockets/baileys/lib/Types/Mex.d.ts +141 -0
  423. package/node_modules/@whiskeysockets/baileys/lib/Types/Mex.d.ts.map +1 -0
  424. package/node_modules/@whiskeysockets/baileys/lib/Types/Mex.js +37 -0
  425. package/node_modules/@whiskeysockets/baileys/lib/Types/Mex.js.map +1 -0
  426. package/node_modules/@whiskeysockets/baileys/lib/Types/Product.d.ts +79 -0
  427. package/node_modules/@whiskeysockets/baileys/lib/Types/Product.d.ts.map +1 -0
  428. package/node_modules/@whiskeysockets/baileys/lib/Types/Product.js +2 -0
  429. package/node_modules/@whiskeysockets/baileys/lib/Types/Product.js.map +1 -0
  430. package/node_modules/@whiskeysockets/baileys/lib/Types/Signal.d.ts +87 -0
  431. package/node_modules/@whiskeysockets/baileys/lib/Types/Signal.d.ts.map +1 -0
  432. package/node_modules/@whiskeysockets/baileys/lib/Types/Signal.js +2 -0
  433. package/node_modules/@whiskeysockets/baileys/lib/Types/Signal.js.map +1 -0
  434. package/node_modules/@whiskeysockets/baileys/lib/Types/Socket.d.ts +136 -0
  435. package/node_modules/@whiskeysockets/baileys/lib/Types/Socket.d.ts.map +1 -0
  436. package/node_modules/@whiskeysockets/baileys/lib/Types/Socket.js +3 -0
  437. package/node_modules/@whiskeysockets/baileys/lib/Types/Socket.js.map +1 -0
  438. package/node_modules/@whiskeysockets/baileys/lib/Types/State.d.ts +97 -0
  439. package/node_modules/@whiskeysockets/baileys/lib/Types/State.d.ts.map +1 -0
  440. package/node_modules/@whiskeysockets/baileys/lib/Types/State.js +56 -0
  441. package/node_modules/@whiskeysockets/baileys/lib/Types/State.js.map +1 -0
  442. package/node_modules/@whiskeysockets/baileys/lib/Types/USync.d.ts +26 -0
  443. package/node_modules/@whiskeysockets/baileys/lib/Types/USync.d.ts.map +1 -0
  444. package/node_modules/@whiskeysockets/baileys/lib/Types/USync.js +2 -0
  445. package/node_modules/@whiskeysockets/baileys/lib/Types/USync.js.map +1 -0
  446. package/node_modules/@whiskeysockets/baileys/lib/Types/index.d.ts +65 -0
  447. package/node_modules/@whiskeysockets/baileys/lib/Types/index.d.ts.map +1 -0
  448. package/node_modules/@whiskeysockets/baileys/lib/Types/index.js +26 -0
  449. package/node_modules/@whiskeysockets/baileys/lib/Types/index.js.map +1 -0
  450. package/node_modules/@whiskeysockets/baileys/lib/Utils/auth-utils.d.ts +24 -0
  451. package/node_modules/@whiskeysockets/baileys/lib/Utils/auth-utils.d.ts.map +1 -0
  452. package/node_modules/@whiskeysockets/baileys/lib/Utils/auth-utils.js +302 -0
  453. package/node_modules/@whiskeysockets/baileys/lib/Utils/auth-utils.js.map +1 -0
  454. package/node_modules/@whiskeysockets/baileys/lib/Utils/browser-utils.d.ts +4 -0
  455. package/node_modules/@whiskeysockets/baileys/lib/Utils/browser-utils.d.ts.map +1 -0
  456. package/node_modules/@whiskeysockets/baileys/lib/Utils/browser-utils.js +28 -0
  457. package/node_modules/@whiskeysockets/baileys/lib/Utils/browser-utils.js.map +1 -0
  458. package/node_modules/@whiskeysockets/baileys/lib/Utils/business.d.ts +23 -0
  459. package/node_modules/@whiskeysockets/baileys/lib/Utils/business.d.ts.map +1 -0
  460. package/node_modules/@whiskeysockets/baileys/lib/Utils/business.js +231 -0
  461. package/node_modules/@whiskeysockets/baileys/lib/Utils/business.js.map +1 -0
  462. package/node_modules/@whiskeysockets/baileys/lib/Utils/chat-utils.d.ts +100 -0
  463. package/node_modules/@whiskeysockets/baileys/lib/Utils/chat-utils.d.ts.map +1 -0
  464. package/node_modules/@whiskeysockets/baileys/lib/Utils/chat-utils.js +872 -0
  465. package/node_modules/@whiskeysockets/baileys/lib/Utils/chat-utils.js.map +1 -0
  466. package/node_modules/@whiskeysockets/baileys/lib/Utils/companion-reg-client-utils.d.ts +17 -0
  467. package/node_modules/@whiskeysockets/baileys/lib/Utils/companion-reg-client-utils.d.ts.map +1 -0
  468. package/node_modules/@whiskeysockets/baileys/lib/Utils/companion-reg-client-utils.js +35 -0
  469. package/node_modules/@whiskeysockets/baileys/lib/Utils/companion-reg-client-utils.js.map +1 -0
  470. package/node_modules/@whiskeysockets/baileys/lib/Utils/crypto.d.ts +37 -0
  471. package/node_modules/@whiskeysockets/baileys/lib/Utils/crypto.d.ts.map +1 -0
  472. package/node_modules/@whiskeysockets/baileys/lib/Utils/crypto.js +118 -0
  473. package/node_modules/@whiskeysockets/baileys/lib/Utils/crypto.js.map +1 -0
  474. package/node_modules/@whiskeysockets/baileys/lib/Utils/decode-wa-message.d.ts +66 -0
  475. package/node_modules/@whiskeysockets/baileys/lib/Utils/decode-wa-message.d.ts.map +1 -0
  476. package/node_modules/@whiskeysockets/baileys/lib/Utils/decode-wa-message.js +317 -0
  477. package/node_modules/@whiskeysockets/baileys/lib/Utils/decode-wa-message.js.map +1 -0
  478. package/node_modules/@whiskeysockets/baileys/lib/Utils/event-buffer.d.ts +36 -0
  479. package/node_modules/@whiskeysockets/baileys/lib/Utils/event-buffer.d.ts.map +1 -0
  480. package/node_modules/@whiskeysockets/baileys/lib/Utils/event-buffer.js +622 -0
  481. package/node_modules/@whiskeysockets/baileys/lib/Utils/event-buffer.js.map +1 -0
  482. package/node_modules/@whiskeysockets/baileys/lib/Utils/generics.d.ts +91 -0
  483. package/node_modules/@whiskeysockets/baileys/lib/Utils/generics.d.ts.map +1 -0
  484. package/node_modules/@whiskeysockets/baileys/lib/Utils/generics.js +393 -0
  485. package/node_modules/@whiskeysockets/baileys/lib/Utils/generics.js.map +1 -0
  486. package/node_modules/@whiskeysockets/baileys/lib/Utils/history.d.ts +24 -0
  487. package/node_modules/@whiskeysockets/baileys/lib/Utils/history.d.ts.map +1 -0
  488. package/node_modules/@whiskeysockets/baileys/lib/Utils/history.js +134 -0
  489. package/node_modules/@whiskeysockets/baileys/lib/Utils/history.js.map +1 -0
  490. package/node_modules/@whiskeysockets/baileys/lib/Utils/identity-change-handler.d.ts +44 -0
  491. package/node_modules/@whiskeysockets/baileys/lib/Utils/identity-change-handler.d.ts.map +1 -0
  492. package/node_modules/@whiskeysockets/baileys/lib/Utils/identity-change-handler.js +50 -0
  493. package/node_modules/@whiskeysockets/baileys/lib/Utils/identity-change-handler.js.map +1 -0
  494. package/node_modules/@whiskeysockets/baileys/lib/Utils/index.d.ts +22 -0
  495. package/node_modules/@whiskeysockets/baileys/lib/Utils/index.d.ts.map +1 -0
  496. package/node_modules/@whiskeysockets/baileys/lib/Utils/index.js +22 -0
  497. package/node_modules/@whiskeysockets/baileys/lib/Utils/index.js.map +1 -0
  498. package/node_modules/@whiskeysockets/baileys/lib/Utils/link-preview.d.ts +21 -0
  499. package/node_modules/@whiskeysockets/baileys/lib/Utils/link-preview.d.ts.map +1 -0
  500. package/node_modules/@whiskeysockets/baileys/lib/Utils/link-preview.js +85 -0
  501. package/node_modules/@whiskeysockets/baileys/lib/Utils/link-preview.js.map +1 -0
  502. package/node_modules/@whiskeysockets/baileys/lib/Utils/logger.d.ts +12 -0
  503. package/node_modules/@whiskeysockets/baileys/lib/Utils/logger.d.ts.map +1 -0
  504. package/node_modules/@whiskeysockets/baileys/lib/Utils/logger.js +3 -0
  505. package/node_modules/@whiskeysockets/baileys/lib/Utils/logger.js.map +1 -0
  506. package/node_modules/@whiskeysockets/baileys/lib/Utils/lt-hash.d.ts +8 -0
  507. package/node_modules/@whiskeysockets/baileys/lib/Utils/lt-hash.d.ts.map +1 -0
  508. package/node_modules/@whiskeysockets/baileys/lib/Utils/lt-hash.js +8 -0
  509. package/node_modules/@whiskeysockets/baileys/lib/Utils/lt-hash.js.map +1 -0
  510. package/node_modules/@whiskeysockets/baileys/lib/Utils/make-mutex.d.ts +9 -0
  511. package/node_modules/@whiskeysockets/baileys/lib/Utils/make-mutex.d.ts.map +1 -0
  512. package/node_modules/@whiskeysockets/baileys/lib/Utils/make-mutex.js +33 -0
  513. package/node_modules/@whiskeysockets/baileys/lib/Utils/make-mutex.js.map +1 -0
  514. package/node_modules/@whiskeysockets/baileys/lib/Utils/message-retry-manager.d.ts +115 -0
  515. package/node_modules/@whiskeysockets/baileys/lib/Utils/message-retry-manager.d.ts.map +1 -0
  516. package/node_modules/@whiskeysockets/baileys/lib/Utils/message-retry-manager.js +265 -0
  517. package/node_modules/@whiskeysockets/baileys/lib/Utils/message-retry-manager.js.map +1 -0
  518. package/node_modules/@whiskeysockets/baileys/lib/Utils/messages-media.d.ts +133 -0
  519. package/node_modules/@whiskeysockets/baileys/lib/Utils/messages-media.d.ts.map +1 -0
  520. package/node_modules/@whiskeysockets/baileys/lib/Utils/messages-media.js +788 -0
  521. package/node_modules/@whiskeysockets/baileys/lib/Utils/messages-media.js.map +1 -0
  522. package/node_modules/@whiskeysockets/baileys/lib/Utils/messages.d.ts +91 -0
  523. package/node_modules/@whiskeysockets/baileys/lib/Utils/messages.d.ts.map +1 -0
  524. package/node_modules/@whiskeysockets/baileys/lib/Utils/messages.js +893 -0
  525. package/node_modules/@whiskeysockets/baileys/lib/Utils/messages.js.map +1 -0
  526. package/node_modules/@whiskeysockets/baileys/lib/Utils/noise-handler.d.ts +20 -0
  527. package/node_modules/@whiskeysockets/baileys/lib/Utils/noise-handler.d.ts.map +1 -0
  528. package/node_modules/@whiskeysockets/baileys/lib/Utils/noise-handler.js +201 -0
  529. package/node_modules/@whiskeysockets/baileys/lib/Utils/noise-handler.js.map +1 -0
  530. package/node_modules/@whiskeysockets/baileys/lib/Utils/offline-node-processor.d.ts +17 -0
  531. package/node_modules/@whiskeysockets/baileys/lib/Utils/offline-node-processor.d.ts.map +1 -0
  532. package/node_modules/@whiskeysockets/baileys/lib/Utils/offline-node-processor.js +40 -0
  533. package/node_modules/@whiskeysockets/baileys/lib/Utils/offline-node-processor.js.map +1 -0
  534. package/node_modules/@whiskeysockets/baileys/lib/Utils/pre-key-manager.d.ts +28 -0
  535. package/node_modules/@whiskeysockets/baileys/lib/Utils/pre-key-manager.d.ts.map +1 -0
  536. package/node_modules/@whiskeysockets/baileys/lib/Utils/pre-key-manager.js +106 -0
  537. package/node_modules/@whiskeysockets/baileys/lib/Utils/pre-key-manager.js.map +1 -0
  538. package/node_modules/@whiskeysockets/baileys/lib/Utils/process-message.d.ts +60 -0
  539. package/node_modules/@whiskeysockets/baileys/lib/Utils/process-message.d.ts.map +1 -0
  540. package/node_modules/@whiskeysockets/baileys/lib/Utils/process-message.js +630 -0
  541. package/node_modules/@whiskeysockets/baileys/lib/Utils/process-message.js.map +1 -0
  542. package/node_modules/@whiskeysockets/baileys/lib/Utils/reporting-utils.d.ts +11 -0
  543. package/node_modules/@whiskeysockets/baileys/lib/Utils/reporting-utils.d.ts.map +1 -0
  544. package/node_modules/@whiskeysockets/baileys/lib/Utils/reporting-utils.js +258 -0
  545. package/node_modules/@whiskeysockets/baileys/lib/Utils/reporting-utils.js.map +1 -0
  546. package/node_modules/@whiskeysockets/baileys/lib/Utils/signal.d.ts +47 -0
  547. package/node_modules/@whiskeysockets/baileys/lib/Utils/signal.d.ts.map +1 -0
  548. package/node_modules/@whiskeysockets/baileys/lib/Utils/signal.js +201 -0
  549. package/node_modules/@whiskeysockets/baileys/lib/Utils/signal.js.map +1 -0
  550. package/node_modules/@whiskeysockets/baileys/lib/Utils/stanza-ack.d.ts +11 -0
  551. package/node_modules/@whiskeysockets/baileys/lib/Utils/stanza-ack.d.ts.map +1 -0
  552. package/node_modules/@whiskeysockets/baileys/lib/Utils/stanza-ack.js +38 -0
  553. package/node_modules/@whiskeysockets/baileys/lib/Utils/stanza-ack.js.map +1 -0
  554. package/node_modules/@whiskeysockets/baileys/lib/Utils/sync-action-utils.d.ts +19 -0
  555. package/node_modules/@whiskeysockets/baileys/lib/Utils/sync-action-utils.d.ts.map +1 -0
  556. package/node_modules/@whiskeysockets/baileys/lib/Utils/sync-action-utils.js +49 -0
  557. package/node_modules/@whiskeysockets/baileys/lib/Utils/sync-action-utils.js.map +1 -0
  558. package/node_modules/@whiskeysockets/baileys/lib/Utils/tc-token-utils.d.ts +37 -0
  559. package/node_modules/@whiskeysockets/baileys/lib/Utils/tc-token-utils.d.ts.map +1 -0
  560. package/node_modules/@whiskeysockets/baileys/lib/Utils/tc-token-utils.js +163 -0
  561. package/node_modules/@whiskeysockets/baileys/lib/Utils/tc-token-utils.js.map +1 -0
  562. package/node_modules/@whiskeysockets/baileys/lib/Utils/use-multi-file-auth-state.d.ts +13 -0
  563. package/node_modules/@whiskeysockets/baileys/lib/Utils/use-multi-file-auth-state.d.ts.map +1 -0
  564. package/node_modules/@whiskeysockets/baileys/lib/Utils/use-multi-file-auth-state.js +121 -0
  565. package/node_modules/@whiskeysockets/baileys/lib/Utils/use-multi-file-auth-state.js.map +1 -0
  566. package/node_modules/@whiskeysockets/baileys/lib/Utils/validate-connection.d.ts +11 -0
  567. package/node_modules/@whiskeysockets/baileys/lib/Utils/validate-connection.d.ts.map +1 -0
  568. package/node_modules/@whiskeysockets/baileys/lib/Utils/validate-connection.js +203 -0
  569. package/node_modules/@whiskeysockets/baileys/lib/Utils/validate-connection.js.map +1 -0
  570. package/node_modules/@whiskeysockets/baileys/lib/WABinary/constants.d.ts +28 -0
  571. package/node_modules/@whiskeysockets/baileys/lib/WABinary/constants.d.ts.map +1 -0
  572. package/node_modules/@whiskeysockets/baileys/lib/WABinary/constants.js +1301 -0
  573. package/node_modules/@whiskeysockets/baileys/lib/WABinary/constants.js.map +1 -0
  574. package/node_modules/@whiskeysockets/baileys/lib/WABinary/decode.d.ts +7 -0
  575. package/node_modules/@whiskeysockets/baileys/lib/WABinary/decode.d.ts.map +1 -0
  576. package/node_modules/@whiskeysockets/baileys/lib/WABinary/decode.js +262 -0
  577. package/node_modules/@whiskeysockets/baileys/lib/WABinary/decode.js.map +1 -0
  578. package/node_modules/@whiskeysockets/baileys/lib/WABinary/encode.d.ts +3 -0
  579. package/node_modules/@whiskeysockets/baileys/lib/WABinary/encode.d.ts.map +1 -0
  580. package/node_modules/@whiskeysockets/baileys/lib/WABinary/encode.js +220 -0
  581. package/node_modules/@whiskeysockets/baileys/lib/WABinary/encode.js.map +1 -0
  582. package/node_modules/@whiskeysockets/baileys/lib/WABinary/generic-utils.d.ts +15 -0
  583. package/node_modules/@whiskeysockets/baileys/lib/WABinary/generic-utils.d.ts.map +1 -0
  584. package/node_modules/@whiskeysockets/baileys/lib/WABinary/generic-utils.js +113 -0
  585. package/node_modules/@whiskeysockets/baileys/lib/WABinary/generic-utils.js.map +1 -0
  586. package/node_modules/@whiskeysockets/baileys/lib/WABinary/index.d.ts +6 -0
  587. package/node_modules/@whiskeysockets/baileys/lib/WABinary/index.d.ts.map +1 -0
  588. package/node_modules/@whiskeysockets/baileys/lib/WABinary/index.js +6 -0
  589. package/node_modules/@whiskeysockets/baileys/lib/WABinary/index.js.map +1 -0
  590. package/node_modules/@whiskeysockets/baileys/lib/WABinary/jid-utils.d.ts +48 -0
  591. package/node_modules/@whiskeysockets/baileys/lib/WABinary/jid-utils.d.ts.map +1 -0
  592. package/node_modules/@whiskeysockets/baileys/lib/WABinary/jid-utils.js +96 -0
  593. package/node_modules/@whiskeysockets/baileys/lib/WABinary/jid-utils.js.map +1 -0
  594. package/node_modules/@whiskeysockets/baileys/lib/WABinary/types.d.ts +19 -0
  595. package/node_modules/@whiskeysockets/baileys/lib/WABinary/types.d.ts.map +1 -0
  596. package/node_modules/@whiskeysockets/baileys/lib/WABinary/types.js +2 -0
  597. package/node_modules/@whiskeysockets/baileys/lib/WABinary/types.js.map +1 -0
  598. package/node_modules/@whiskeysockets/baileys/lib/WAM/BinaryInfo.d.ts +9 -0
  599. package/node_modules/@whiskeysockets/baileys/lib/WAM/BinaryInfo.d.ts.map +1 -0
  600. package/node_modules/@whiskeysockets/baileys/lib/WAM/BinaryInfo.js +10 -0
  601. package/node_modules/@whiskeysockets/baileys/lib/WAM/BinaryInfo.js.map +1 -0
  602. package/node_modules/@whiskeysockets/baileys/lib/WAM/constants.d.ts +40 -0
  603. package/node_modules/@whiskeysockets/baileys/lib/WAM/constants.d.ts.map +1 -0
  604. package/node_modules/@whiskeysockets/baileys/lib/WAM/constants.js +22853 -0
  605. package/node_modules/@whiskeysockets/baileys/lib/WAM/constants.js.map +1 -0
  606. package/node_modules/@whiskeysockets/baileys/lib/WAM/encode.d.ts +3 -0
  607. package/node_modules/@whiskeysockets/baileys/lib/WAM/encode.d.ts.map +1 -0
  608. package/node_modules/@whiskeysockets/baileys/lib/WAM/encode.js +150 -0
  609. package/node_modules/@whiskeysockets/baileys/lib/WAM/encode.js.map +1 -0
  610. package/node_modules/@whiskeysockets/baileys/lib/WAM/index.d.ts +4 -0
  611. package/node_modules/@whiskeysockets/baileys/lib/WAM/index.d.ts.map +1 -0
  612. package/node_modules/@whiskeysockets/baileys/lib/WAM/index.js +4 -0
  613. package/node_modules/@whiskeysockets/baileys/lib/WAM/index.js.map +1 -0
  614. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +10 -0
  615. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
  616. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncContactProtocol.js +52 -0
  617. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
  618. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
  619. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
  620. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncDeviceProtocol.js +54 -0
  621. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
  622. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
  623. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
  624. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
  625. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
  626. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
  627. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
  628. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
  629. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +1 -0
  630. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +10 -0
  631. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts.map +1 -0
  632. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
  633. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/USyncUsernameProtocol.js.map +1 -0
  634. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +26 -0
  635. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +1 -0
  636. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
  637. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +1 -0
  638. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +10 -0
  639. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +1 -0
  640. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
  641. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +1 -0
  642. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/index.d.ts +6 -0
  643. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/index.d.ts.map +1 -0
  644. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/index.js +6 -0
  645. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/Protocols/index.js.map +1 -0
  646. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/USyncQuery.d.ts +30 -0
  647. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/USyncQuery.d.ts.map +1 -0
  648. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/USyncQuery.js +98 -0
  649. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/USyncQuery.js.map +1 -0
  650. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/USyncUser.d.ts +17 -0
  651. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/USyncUser.d.ts.map +1 -0
  652. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/USyncUser.js +31 -0
  653. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/USyncUser.js.map +1 -0
  654. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/index.d.ts +4 -0
  655. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/index.d.ts.map +1 -0
  656. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/index.js +4 -0
  657. package/node_modules/@whiskeysockets/baileys/lib/WAUSync/index.js.map +1 -0
  658. package/node_modules/@whiskeysockets/baileys/lib/index.d.ts +12 -0
  659. package/node_modules/@whiskeysockets/baileys/lib/index.d.ts.map +1 -0
  660. package/node_modules/@whiskeysockets/baileys/lib/index.js +11 -0
  661. package/node_modules/@whiskeysockets/baileys/lib/index.js.map +1 -0
  662. package/node_modules/@whiskeysockets/baileys/package.json +139 -0
  663. package/node_modules/async-mutex/LICENSE +21 -0
  664. package/node_modules/async-mutex/README.md +540 -0
  665. package/node_modules/async-mutex/es6/Mutex.js +41 -0
  666. package/node_modules/async-mutex/es6/MutexInterface.js +1 -0
  667. package/node_modules/async-mutex/es6/Semaphore.js +153 -0
  668. package/node_modules/async-mutex/es6/SemaphoreInterface.js +1 -0
  669. package/node_modules/async-mutex/es6/errors.js +3 -0
  670. package/node_modules/async-mutex/es6/index.js +5 -0
  671. package/node_modules/async-mutex/es6/tryAcquire.js +8 -0
  672. package/node_modules/async-mutex/es6/withTimeout.js +124 -0
  673. package/node_modules/async-mutex/index.mjs +291 -0
  674. package/node_modules/async-mutex/lib/Mutex.d.ts +12 -0
  675. package/node_modules/async-mutex/lib/Mutex.js +43 -0
  676. package/node_modules/async-mutex/lib/MutexInterface.d.ts +17 -0
  677. package/node_modules/async-mutex/lib/MutexInterface.js +2 -0
  678. package/node_modules/async-mutex/lib/Semaphore.d.ts +22 -0
  679. package/node_modules/async-mutex/lib/Semaphore.js +155 -0
  680. package/node_modules/async-mutex/lib/SemaphoreInterface.d.ts +19 -0
  681. package/node_modules/async-mutex/lib/SemaphoreInterface.js +2 -0
  682. package/node_modules/async-mutex/lib/errors.d.ts +3 -0
  683. package/node_modules/async-mutex/lib/errors.js +6 -0
  684. package/node_modules/async-mutex/lib/index.d.ts +7 -0
  685. package/node_modules/async-mutex/lib/index.js +13 -0
  686. package/node_modules/async-mutex/lib/tryAcquire.d.ts +4 -0
  687. package/node_modules/async-mutex/lib/tryAcquire.js +12 -0
  688. package/node_modules/async-mutex/lib/withTimeout.d.ts +4 -0
  689. package/node_modules/async-mutex/lib/withTimeout.js +128 -0
  690. package/node_modules/async-mutex/package.json +88 -0
  691. package/node_modules/atomic-sleep/.travis.yml +11 -0
  692. package/node_modules/atomic-sleep/LICENSE +22 -0
  693. package/node_modules/atomic-sleep/index.js +38 -0
  694. package/node_modules/atomic-sleep/package.json +37 -0
  695. package/node_modules/atomic-sleep/readme.md +58 -0
  696. package/node_modules/atomic-sleep/test.js +47 -0
  697. package/node_modules/cacheable/LICENSE +19 -0
  698. package/node_modules/cacheable/README.md +846 -0
  699. package/node_modules/cacheable/dist/index.cjs +1157 -0
  700. package/node_modules/cacheable/dist/index.d.cts +494 -0
  701. package/node_modules/cacheable/dist/index.d.ts +494 -0
  702. package/node_modules/cacheable/dist/index.js +1141 -0
  703. package/node_modules/cacheable/package.json +81 -0
  704. package/node_modules/content-type/LICENSE +22 -0
  705. package/node_modules/content-type/README.md +69 -0
  706. package/node_modules/content-type/dist/index.d.ts +26 -0
  707. package/node_modules/content-type/dist/index.js +170 -0
  708. package/node_modules/content-type/dist/index.js.map +1 -0
  709. package/node_modules/content-type/package.json +52 -0
  710. package/node_modules/curve25519-js/.prettierrc +6 -0
  711. package/node_modules/curve25519-js/LICENSE +19 -0
  712. package/node_modules/curve25519-js/README.md +111 -0
  713. package/node_modules/curve25519-js/lib/index.d.ts +69 -0
  714. package/node_modules/curve25519-js/lib/index.js +1669 -0
  715. package/node_modules/curve25519-js/package.json +34 -0
  716. package/node_modules/curve25519-js/tsconfig.json +20 -0
  717. package/node_modules/curve25519-js/tslint.json +10 -0
  718. package/node_modules/debug/LICENSE +20 -0
  719. package/node_modules/debug/README.md +481 -0
  720. package/node_modules/debug/package.json +64 -0
  721. package/node_modules/debug/src/browser.js +272 -0
  722. package/node_modules/debug/src/common.js +292 -0
  723. package/node_modules/debug/src/index.js +10 -0
  724. package/node_modules/debug/src/node.js +263 -0
  725. package/node_modules/eventemitter3/LICENSE +21 -0
  726. package/node_modules/eventemitter3/README.md +85 -0
  727. package/node_modules/eventemitter3/dist/eventemitter3.esm.js +355 -0
  728. package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js +1 -0
  729. package/node_modules/eventemitter3/dist/eventemitter3.esm.min.js.map +1 -0
  730. package/node_modules/eventemitter3/dist/eventemitter3.umd.js +363 -0
  731. package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js +1 -0
  732. package/node_modules/eventemitter3/dist/eventemitter3.umd.min.js.map +1 -0
  733. package/node_modules/eventemitter3/index.d.ts +135 -0
  734. package/node_modules/eventemitter3/index.js +336 -0
  735. package/node_modules/eventemitter3/index.mjs +4 -0
  736. package/node_modules/eventemitter3/package.json +62 -0
  737. package/node_modules/file-type/core.d.ts +253 -0
  738. package/node_modules/file-type/core.js +2899 -0
  739. package/node_modules/file-type/index.d.ts +98 -0
  740. package/node_modules/file-type/index.js +163 -0
  741. package/node_modules/file-type/license +9 -0
  742. package/node_modules/file-type/package.json +290 -0
  743. package/node_modules/file-type/readme.md +667 -0
  744. package/node_modules/file-type/supported.js +360 -0
  745. package/node_modules/file-type/util.js +60 -0
  746. package/node_modules/hashery/LICENSE +21 -0
  747. package/node_modules/hashery/README.md +1373 -0
  748. package/node_modules/hashery/dist/browser/index.global.js +8 -0
  749. package/node_modules/hashery/dist/browser/index.global.js.map +1 -0
  750. package/node_modules/hashery/dist/browser/index.js +3 -0
  751. package/node_modules/hashery/dist/browser/index.js.map +1 -0
  752. package/node_modules/hashery/dist/node/index.cjs +989 -0
  753. package/node_modules/hashery/dist/node/index.d.cts +935 -0
  754. package/node_modules/hashery/dist/node/index.d.ts +935 -0
  755. package/node_modules/hashery/dist/node/index.js +957 -0
  756. package/node_modules/hashery/package.json +92 -0
  757. package/node_modules/hookified/LICENSE +19 -0
  758. package/node_modules/hookified/README.md +1424 -0
  759. package/node_modules/hookified/dist/browser/index.global.js +693 -0
  760. package/node_modules/hookified/dist/browser/index.global.js.map +1 -0
  761. package/node_modules/hookified/dist/browser/index.js +694 -0
  762. package/node_modules/hookified/dist/browser/index.js.map +1 -0
  763. package/node_modules/hookified/dist/node/index.cjs +717 -0
  764. package/node_modules/hookified/dist/node/index.d.cts +543 -0
  765. package/node_modules/hookified/dist/node/index.d.ts +543 -0
  766. package/node_modules/hookified/dist/node/index.js +689 -0
  767. package/node_modules/hookified/package.json +92 -0
  768. package/node_modules/ieee754/LICENSE +11 -0
  769. package/node_modules/ieee754/README.md +51 -0
  770. package/node_modules/ieee754/index.d.ts +10 -0
  771. package/node_modules/ieee754/index.js +85 -0
  772. package/node_modules/ieee754/package.json +52 -0
  773. package/node_modules/keyv/LICENSE +22 -0
  774. package/node_modules/keyv/README.md +828 -0
  775. package/node_modules/keyv/dist/index.cjs +990 -0
  776. package/node_modules/keyv/dist/index.d.cts +378 -0
  777. package/node_modules/keyv/dist/index.d.ts +378 -0
  778. package/node_modules/keyv/dist/index.js +964 -0
  779. package/node_modules/keyv/package.json +88 -0
  780. package/node_modules/libsignal/LICENSE +621 -0
  781. package/node_modules/libsignal/README.md +64 -0
  782. package/node_modules/libsignal/index.d.ts +55 -0
  783. package/node_modules/libsignal/index.js +10 -0
  784. package/node_modules/libsignal/package.json +34 -0
  785. package/node_modules/libsignal/src/.eslintrc.json +31 -0
  786. package/node_modules/libsignal/src/WhisperTextProtocol.js +933 -0
  787. package/node_modules/libsignal/src/base_key_type.js +7 -0
  788. package/node_modules/libsignal/src/chain_type.js +6 -0
  789. package/node_modules/libsignal/src/crypto.d.ts +19 -0
  790. package/node_modules/libsignal/src/crypto.js +98 -0
  791. package/node_modules/libsignal/src/curve.d.ts +22 -0
  792. package/node_modules/libsignal/src/curve.js +142 -0
  793. package/node_modules/libsignal/src/errors.js +33 -0
  794. package/node_modules/libsignal/src/keyhelper.js +45 -0
  795. package/node_modules/libsignal/src/numeric_fingerprint.js +72 -0
  796. package/node_modules/libsignal/src/protobufs.js +10 -0
  797. package/node_modules/libsignal/src/protocol_address.js +40 -0
  798. package/node_modules/libsignal/src/queue_job.js +69 -0
  799. package/node_modules/libsignal/src/session_builder.js +164 -0
  800. package/node_modules/libsignal/src/session_cipher.js +336 -0
  801. package/node_modules/libsignal/src/session_record.js +316 -0
  802. package/node_modules/long/LICENSE +202 -0
  803. package/node_modules/long/README.md +286 -0
  804. package/node_modules/long/index.d.ts +2 -0
  805. package/node_modules/long/index.js +1581 -0
  806. package/node_modules/long/package.json +58 -0
  807. package/node_modules/long/types.d.ts +474 -0
  808. package/node_modules/long/umd/index.d.ts +3 -0
  809. package/node_modules/long/umd/index.js +1622 -0
  810. package/node_modules/long/umd/package.json +3 -0
  811. package/node_modules/long/umd/types.d.ts +474 -0
  812. package/node_modules/lru-cache/LICENSE.md +55 -0
  813. package/node_modules/lru-cache/README.md +469 -0
  814. package/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.d.ts.map +1 -0
  815. package/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel-browser.js.map +1 -0
  816. package/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.d.ts +5 -0
  817. package/node_modules/lru-cache/dist/commonjs/browser/diagnostics-channel.js +7 -0
  818. package/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +1400 -0
  819. package/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -0
  820. package/node_modules/lru-cache/dist/commonjs/browser/index.js +1726 -0
  821. package/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -0
  822. package/node_modules/lru-cache/dist/commonjs/browser/index.min.js +2 -0
  823. package/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +7 -0
  824. package/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts +12 -0
  825. package/node_modules/lru-cache/dist/commonjs/browser/perf.d.ts.map +1 -0
  826. package/node_modules/lru-cache/dist/commonjs/browser/perf.js +10 -0
  827. package/node_modules/lru-cache/dist/commonjs/browser/perf.js.map +1 -0
  828. package/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.cjs.map +1 -0
  829. package/node_modules/lru-cache/dist/commonjs/diagnostics-channel-cjs.d.cts.map +1 -0
  830. package/node_modules/lru-cache/dist/commonjs/diagnostics-channel.d.ts +5 -0
  831. package/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js +7 -0
  832. package/node_modules/lru-cache/dist/commonjs/index.d.ts +1400 -0
  833. package/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -0
  834. package/node_modules/lru-cache/dist/commonjs/index.js +1726 -0
  835. package/node_modules/lru-cache/dist/commonjs/index.js.map +1 -0
  836. package/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
  837. package/node_modules/lru-cache/dist/commonjs/index.min.js.map +7 -0
  838. package/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.d.ts.map +1 -0
  839. package/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel-node.js.map +1 -0
  840. package/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.d.ts +5 -0
  841. package/node_modules/lru-cache/dist/commonjs/node/diagnostics-channel.js +9 -0
  842. package/node_modules/lru-cache/dist/commonjs/node/index.d.ts +1400 -0
  843. package/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -0
  844. package/node_modules/lru-cache/dist/commonjs/node/index.js +1726 -0
  845. package/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -0
  846. package/node_modules/lru-cache/dist/commonjs/node/index.min.js +2 -0
  847. package/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +7 -0
  848. package/node_modules/lru-cache/dist/commonjs/node/perf.d.ts +12 -0
  849. package/node_modules/lru-cache/dist/commonjs/node/perf.d.ts.map +1 -0
  850. package/node_modules/lru-cache/dist/commonjs/node/perf.js +10 -0
  851. package/node_modules/lru-cache/dist/commonjs/node/perf.js.map +1 -0
  852. package/node_modules/lru-cache/dist/commonjs/package.json +3 -0
  853. package/node_modules/lru-cache/dist/commonjs/perf.d.ts +12 -0
  854. package/node_modules/lru-cache/dist/commonjs/perf.d.ts.map +1 -0
  855. package/node_modules/lru-cache/dist/commonjs/perf.js +10 -0
  856. package/node_modules/lru-cache/dist/commonjs/perf.js.map +1 -0
  857. package/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.d.ts.map +1 -0
  858. package/node_modules/lru-cache/dist/esm/browser/diagnostics-channel-browser.js.map +1 -0
  859. package/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.d.ts +5 -0
  860. package/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js +4 -0
  861. package/node_modules/lru-cache/dist/esm/browser/index.d.ts +1400 -0
  862. package/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -0
  863. package/node_modules/lru-cache/dist/esm/browser/index.js +1722 -0
  864. package/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -0
  865. package/node_modules/lru-cache/dist/esm/browser/index.min.js +2 -0
  866. package/node_modules/lru-cache/dist/esm/browser/index.min.js.map +7 -0
  867. package/node_modules/lru-cache/dist/esm/browser/perf.d.ts +12 -0
  868. package/node_modules/lru-cache/dist/esm/browser/perf.d.ts.map +1 -0
  869. package/node_modules/lru-cache/dist/esm/browser/perf.js +7 -0
  870. package/node_modules/lru-cache/dist/esm/browser/perf.js.map +1 -0
  871. package/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.d.mts.map +1 -0
  872. package/node_modules/lru-cache/dist/esm/diagnostics-channel-esm.mjs.map +1 -0
  873. package/node_modules/lru-cache/dist/esm/diagnostics-channel.d.ts +5 -0
  874. package/node_modules/lru-cache/dist/esm/diagnostics-channel.js +19 -0
  875. package/node_modules/lru-cache/dist/esm/index.d.ts +1400 -0
  876. package/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -0
  877. package/node_modules/lru-cache/dist/esm/index.js +1722 -0
  878. package/node_modules/lru-cache/dist/esm/index.js.map +1 -0
  879. package/node_modules/lru-cache/dist/esm/index.min.js +2 -0
  880. package/node_modules/lru-cache/dist/esm/index.min.js.map +7 -0
  881. package/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.d.ts.map +1 -0
  882. package/node_modules/lru-cache/dist/esm/node/diagnostics-channel-node.js.map +1 -0
  883. package/node_modules/lru-cache/dist/esm/node/diagnostics-channel.d.ts +5 -0
  884. package/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js +6 -0
  885. package/node_modules/lru-cache/dist/esm/node/index.d.ts +1400 -0
  886. package/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -0
  887. package/node_modules/lru-cache/dist/esm/node/index.js +1722 -0
  888. package/node_modules/lru-cache/dist/esm/node/index.js.map +1 -0
  889. package/node_modules/lru-cache/dist/esm/node/index.min.js +2 -0
  890. package/node_modules/lru-cache/dist/esm/node/index.min.js.map +7 -0
  891. package/node_modules/lru-cache/dist/esm/node/perf.d.ts +12 -0
  892. package/node_modules/lru-cache/dist/esm/node/perf.d.ts.map +1 -0
  893. package/node_modules/lru-cache/dist/esm/node/perf.js +7 -0
  894. package/node_modules/lru-cache/dist/esm/node/perf.js.map +1 -0
  895. package/node_modules/lru-cache/dist/esm/package.json +3 -0
  896. package/node_modules/lru-cache/dist/esm/perf.d.ts +12 -0
  897. package/node_modules/lru-cache/dist/esm/perf.d.ts.map +1 -0
  898. package/node_modules/lru-cache/dist/esm/perf.js +7 -0
  899. package/node_modules/lru-cache/dist/esm/perf.js.map +1 -0
  900. package/node_modules/lru-cache/package.json +154 -0
  901. package/node_modules/media-typer/LICENSE +22 -0
  902. package/node_modules/media-typer/README.md +79 -0
  903. package/node_modules/media-typer/dist/index.d.ts +29 -0
  904. package/node_modules/media-typer/dist/index.js +64 -0
  905. package/node_modules/media-typer/dist/index.js.map +1 -0
  906. package/node_modules/media-typer/package.json +48 -0
  907. package/node_modules/ms/index.js +162 -0
  908. package/node_modules/ms/license.md +21 -0
  909. package/node_modules/ms/package.json +38 -0
  910. package/node_modules/ms/readme.md +59 -0
  911. package/node_modules/music-metadata/LICENSE.txt +9 -0
  912. package/node_modules/music-metadata/README.md +878 -0
  913. package/node_modules/music-metadata/lib/ParseError.d.ts +87 -0
  914. package/node_modules/music-metadata/lib/ParseError.js +38 -0
  915. package/node_modules/music-metadata/lib/ParserFactory.d.ts +44 -0
  916. package/node_modules/music-metadata/lib/ParserFactory.js +141 -0
  917. package/node_modules/music-metadata/lib/aiff/AiffLoader.d.ts +2 -0
  918. package/node_modules/music-metadata/lib/aiff/AiffLoader.js +8 -0
  919. package/node_modules/music-metadata/lib/aiff/AiffParser.d.ts +15 -0
  920. package/node_modules/music-metadata/lib/aiff/AiffParser.js +104 -0
  921. package/node_modules/music-metadata/lib/aiff/AiffTagMap.d.ts +4 -0
  922. package/node_modules/music-metadata/lib/aiff/AiffTagMap.js +15 -0
  923. package/node_modules/music-metadata/lib/aiff/AiffToken.d.ts +48 -0
  924. package/node_modules/music-metadata/lib/aiff/AiffToken.js +58 -0
  925. package/node_modules/music-metadata/lib/apev2/APEv2Parser.d.ts +46 -0
  926. package/node_modules/music-metadata/lib/apev2/APEv2Parser.js +176 -0
  927. package/node_modules/music-metadata/lib/apev2/APEv2TagMapper.d.ts +4 -0
  928. package/node_modules/music-metadata/lib/apev2/APEv2TagMapper.js +83 -0
  929. package/node_modules/music-metadata/lib/apev2/APEv2Token.d.ts +99 -0
  930. package/node_modules/music-metadata/lib/apev2/APEv2Token.js +116 -0
  931. package/node_modules/music-metadata/lib/apev2/Apev2Loader.d.ts +2 -0
  932. package/node_modules/music-metadata/lib/apev2/Apev2Loader.js +8 -0
  933. package/node_modules/music-metadata/lib/asf/AsfGuid.d.ts +83 -0
  934. package/node_modules/music-metadata/lib/asf/AsfGuid.js +109 -0
  935. package/node_modules/music-metadata/lib/asf/AsfLoader.d.ts +2 -0
  936. package/node_modules/music-metadata/lib/asf/AsfLoader.js +8 -0
  937. package/node_modules/music-metadata/lib/asf/AsfObject.d.ts +325 -0
  938. package/node_modules/music-metadata/lib/asf/AsfObject.js +347 -0
  939. package/node_modules/music-metadata/lib/asf/AsfParser.d.ts +17 -0
  940. package/node_modules/music-metadata/lib/asf/AsfParser.js +134 -0
  941. package/node_modules/music-metadata/lib/asf/AsfTagMapper.d.ts +7 -0
  942. package/node_modules/music-metadata/lib/asf/AsfTagMapper.js +92 -0
  943. package/node_modules/music-metadata/lib/asf/AsfUtil.d.ts +4 -0
  944. package/node_modules/music-metadata/lib/asf/AsfUtil.js +32 -0
  945. package/node_modules/music-metadata/lib/common/BasicParser.d.ts +17 -0
  946. package/node_modules/music-metadata/lib/common/BasicParser.js +13 -0
  947. package/node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.d.ts +10 -0
  948. package/node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.js +17 -0
  949. package/node_modules/music-metadata/lib/common/CombinedTagMapper.d.ts +19 -0
  950. package/node_modules/music-metadata/lib/common/CombinedTagMapper.js +50 -0
  951. package/node_modules/music-metadata/lib/common/FourCC.d.ts +6 -0
  952. package/node_modules/music-metadata/lib/common/FourCC.js +25 -0
  953. package/node_modules/music-metadata/lib/common/GenericTagMapper.d.ts +51 -0
  954. package/node_modules/music-metadata/lib/common/GenericTagMapper.js +51 -0
  955. package/node_modules/music-metadata/lib/common/GenericTagTypes.d.ts +34 -0
  956. package/node_modules/music-metadata/lib/common/GenericTagTypes.js +133 -0
  957. package/node_modules/music-metadata/lib/common/MetadataCollector.d.ts +86 -0
  958. package/node_modules/music-metadata/lib/common/MetadataCollector.js +307 -0
  959. package/node_modules/music-metadata/lib/common/Util.d.ts +56 -0
  960. package/node_modules/music-metadata/lib/common/Util.js +152 -0
  961. package/node_modules/music-metadata/lib/core.d.ts +75 -0
  962. package/node_modules/music-metadata/lib/core.js +126 -0
  963. package/node_modules/music-metadata/lib/dsdiff/DsdiffLoader.d.ts +2 -0
  964. package/node_modules/music-metadata/lib/dsdiff/DsdiffLoader.js +8 -0
  965. package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.d.ts +29 -0
  966. package/node_modules/music-metadata/lib/dsdiff/DsdiffParser.js +154 -0
  967. package/node_modules/music-metadata/lib/dsdiff/DsdiffToken.d.ts +9 -0
  968. package/node_modules/music-metadata/lib/dsdiff/DsdiffToken.js +18 -0
  969. package/node_modules/music-metadata/lib/dsf/DsfChunk.d.ts +87 -0
  970. package/node_modules/music-metadata/lib/dsf/DsfChunk.js +50 -0
  971. package/node_modules/music-metadata/lib/dsf/DsfLoader.d.ts +2 -0
  972. package/node_modules/music-metadata/lib/dsf/DsfLoader.js +8 -0
  973. package/node_modules/music-metadata/lib/dsf/DsfParser.d.ts +24 -0
  974. package/node_modules/music-metadata/lib/dsf/DsfParser.js +57 -0
  975. package/node_modules/music-metadata/lib/ebml/EbmlIterator.d.ts +67 -0
  976. package/node_modules/music-metadata/lib/ebml/EbmlIterator.js +218 -0
  977. package/node_modules/music-metadata/lib/ebml/types.d.ts +37 -0
  978. package/node_modules/music-metadata/lib/ebml/types.js +8 -0
  979. package/node_modules/music-metadata/lib/flac/FlacLoader.d.ts +2 -0
  980. package/node_modules/music-metadata/lib/flac/FlacLoader.js +8 -0
  981. package/node_modules/music-metadata/lib/flac/FlacParser.d.ts +29 -0
  982. package/node_modules/music-metadata/lib/flac/FlacParser.js +125 -0
  983. package/node_modules/music-metadata/lib/flac/FlacToken.d.ts +45 -0
  984. package/node_modules/music-metadata/lib/flac/FlacToken.js +63 -0
  985. package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.d.ts +17 -0
  986. package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.js +137 -0
  987. package/node_modules/music-metadata/lib/id3v1/ID3v1TagMap.d.ts +4 -0
  988. package/node_modules/music-metadata/lib/id3v1/ID3v1TagMap.js +18 -0
  989. package/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.d.ts +17 -0
  990. package/node_modules/music-metadata/lib/id3v2/AbstractID3Parser.js +56 -0
  991. package/node_modules/music-metadata/lib/id3v2/FrameHeader.d.ts +31 -0
  992. package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +73 -0
  993. package/node_modules/music-metadata/lib/id3v2/FrameParser.d.ts +92 -0
  994. package/node_modules/music-metadata/lib/id3v2/FrameParser.js +470 -0
  995. package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.d.ts +9 -0
  996. package/node_modules/music-metadata/lib/id3v2/ID3v22TagMapper.js +46 -0
  997. package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.d.ts +14 -0
  998. package/node_modules/music-metadata/lib/id3v2/ID3v24TagMapper.js +195 -0
  999. package/node_modules/music-metadata/lib/id3v2/ID3v2ChapterToken.d.ts +11 -0
  1000. package/node_modules/music-metadata/lib/id3v2/ID3v2ChapterToken.js +17 -0
  1001. package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.d.ts +33 -0
  1002. package/node_modules/music-metadata/lib/id3v2/ID3v2Parser.js +169 -0
  1003. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.d.ts +111 -0
  1004. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +146 -0
  1005. package/node_modules/music-metadata/lib/iff/index.d.ts +33 -0
  1006. package/node_modules/music-metadata/lib/iff/index.js +16 -0
  1007. package/node_modules/music-metadata/lib/index.d.ts +22 -0
  1008. package/node_modules/music-metadata/lib/index.js +53 -0
  1009. package/node_modules/music-metadata/lib/lrc/LyricsParser.d.ts +9 -0
  1010. package/node_modules/music-metadata/lib/lrc/LyricsParser.js +45 -0
  1011. package/node_modules/music-metadata/lib/lyrics3/Lyrics3.d.ts +3 -0
  1012. package/node_modules/music-metadata/lib/lyrics3/Lyrics3.js +17 -0
  1013. package/node_modules/music-metadata/lib/matroska/MatroskaDtd.d.ts +8 -0
  1014. package/node_modules/music-metadata/lib/matroska/MatroskaDtd.js +283 -0
  1015. package/node_modules/music-metadata/lib/matroska/MatroskaLoader.d.ts +2 -0
  1016. package/node_modules/music-metadata/lib/matroska/MatroskaLoader.js +8 -0
  1017. package/node_modules/music-metadata/lib/matroska/MatroskaParser.d.ts +19 -0
  1018. package/node_modules/music-metadata/lib/matroska/MatroskaParser.js +143 -0
  1019. package/node_modules/music-metadata/lib/matroska/MatroskaTagMapper.d.ts +4 -0
  1020. package/node_modules/music-metadata/lib/matroska/MatroskaTagMapper.js +32 -0
  1021. package/node_modules/music-metadata/lib/matroska/types.d.ts +142 -0
  1022. package/node_modules/music-metadata/lib/matroska/types.js +27 -0
  1023. package/node_modules/music-metadata/lib/mp4/Atom.d.ts +16 -0
  1024. package/node_modules/music-metadata/lib/mp4/Atom.js +65 -0
  1025. package/node_modules/music-metadata/lib/mp4/AtomToken.d.ts +487 -0
  1026. package/node_modules/music-metadata/lib/mp4/AtomToken.js +576 -0
  1027. package/node_modules/music-metadata/lib/mp4/MP4Parser.d.ts +32 -0
  1028. package/node_modules/music-metadata/lib/mp4/MP4Parser.js +647 -0
  1029. package/node_modules/music-metadata/lib/mp4/MP4TagMapper.d.ts +8 -0
  1030. package/node_modules/music-metadata/lib/mp4/MP4TagMapper.js +123 -0
  1031. package/node_modules/music-metadata/lib/mp4/Mp4Loader.d.ts +2 -0
  1032. package/node_modules/music-metadata/lib/mp4/Mp4Loader.js +8 -0
  1033. package/node_modules/music-metadata/lib/mpeg/ExtendedLameHeader.d.ts +27 -0
  1034. package/node_modules/music-metadata/lib/mpeg/ExtendedLameHeader.js +28 -0
  1035. package/node_modules/music-metadata/lib/mpeg/MpegLoader.d.ts +2 -0
  1036. package/node_modules/music-metadata/lib/mpeg/MpegLoader.js +8 -0
  1037. package/node_modules/music-metadata/lib/mpeg/MpegParser.d.ts +62 -0
  1038. package/node_modules/music-metadata/lib/mpeg/MpegParser.js +569 -0
  1039. package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.d.ts +57 -0
  1040. package/node_modules/music-metadata/lib/mpeg/ReplayGainDataFormat.js +64 -0
  1041. package/node_modules/music-metadata/lib/mpeg/XingTag.d.ts +44 -0
  1042. package/node_modules/music-metadata/lib/mpeg/XingTag.js +65 -0
  1043. package/node_modules/music-metadata/lib/musepack/MusepackConentError.d.ts +15 -0
  1044. package/node_modules/music-metadata/lib/musepack/MusepackConentError.js +3 -0
  1045. package/node_modules/music-metadata/lib/musepack/MusepackLoader.d.ts +2 -0
  1046. package/node_modules/music-metadata/lib/musepack/MusepackLoader.js +8 -0
  1047. package/node_modules/music-metadata/lib/musepack/MusepackParser.d.ts +4 -0
  1048. package/node_modules/music-metadata/lib/musepack/MusepackParser.js +30 -0
  1049. package/node_modules/music-metadata/lib/musepack/sv7/BitReader.d.ts +13 -0
  1050. package/node_modules/music-metadata/lib/musepack/sv7/BitReader.js +46 -0
  1051. package/node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.d.ts +8 -0
  1052. package/node_modules/music-metadata/lib/musepack/sv7/MpcSv7Parser.js +47 -0
  1053. package/node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.d.ts +28 -0
  1054. package/node_modules/music-metadata/lib/musepack/sv7/StreamVersion7.js +39 -0
  1055. package/node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.d.ts +6 -0
  1056. package/node_modules/music-metadata/lib/musepack/sv8/MpcSv8Parser.js +56 -0
  1057. package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.d.ts +42 -0
  1058. package/node_modules/music-metadata/lib/musepack/sv8/StreamVersion8.js +82 -0
  1059. package/node_modules/music-metadata/lib/ogg/OggLoader.d.ts +2 -0
  1060. package/node_modules/music-metadata/lib/ogg/OggLoader.js +8 -0
  1061. package/node_modules/music-metadata/lib/ogg/OggParser.d.ts +27 -0
  1062. package/node_modules/music-metadata/lib/ogg/OggParser.js +125 -0
  1063. package/node_modules/music-metadata/lib/ogg/OggToken.d.ts +83 -0
  1064. package/node_modules/music-metadata/lib/ogg/OggToken.js +41 -0
  1065. package/node_modules/music-metadata/lib/ogg/flac/FlacStream.d.ts +29 -0
  1066. package/node_modules/music-metadata/lib/ogg/flac/FlacStream.js +74 -0
  1067. package/node_modules/music-metadata/lib/ogg/opus/Opus.d.ts +63 -0
  1068. package/node_modules/music-metadata/lib/ogg/opus/Opus.js +27 -0
  1069. package/node_modules/music-metadata/lib/ogg/opus/OpusStream.d.ts +24 -0
  1070. package/node_modules/music-metadata/lib/ogg/opus/OpusStream.js +56 -0
  1071. package/node_modules/music-metadata/lib/ogg/speex/Speex.d.ts +36 -0
  1072. package/node_modules/music-metadata/lib/ogg/speex/Speex.js +28 -0
  1073. package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.d.ts +20 -0
  1074. package/node_modules/music-metadata/lib/ogg/speex/SpeexStream.js +31 -0
  1075. package/node_modules/music-metadata/lib/ogg/theora/Theora.d.ts +20 -0
  1076. package/node_modules/music-metadata/lib/ogg/theora/Theora.js +20 -0
  1077. package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.d.ts +25 -0
  1078. package/node_modules/music-metadata/lib/ogg/theora/TheoraStream.js +39 -0
  1079. package/node_modules/music-metadata/lib/ogg/vorbis/Vorbis.d.ts +68 -0
  1080. package/node_modules/music-metadata/lib/ogg/vorbis/Vorbis.js +83 -0
  1081. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.d.ts +12 -0
  1082. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisDecoder.js +29 -0
  1083. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.d.ts +53 -0
  1084. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisStream.js +136 -0
  1085. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.d.ts +7 -0
  1086. package/node_modules/music-metadata/lib/ogg/vorbis/VorbisTagMapper.js +133 -0
  1087. package/node_modules/music-metadata/lib/riff/RiffChunk.d.ts +16 -0
  1088. package/node_modules/music-metadata/lib/riff/RiffChunk.js +28 -0
  1089. package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.d.ts +10 -0
  1090. package/node_modules/music-metadata/lib/riff/RiffInfoTagMap.js +34 -0
  1091. package/node_modules/music-metadata/lib/type.d.ts +661 -0
  1092. package/node_modules/music-metadata/lib/type.js +2 -0
  1093. package/node_modules/music-metadata/lib/wav/BwfChunk.d.ts +17 -0
  1094. package/node_modules/music-metadata/lib/wav/BwfChunk.js +26 -0
  1095. package/node_modules/music-metadata/lib/wav/WaveChunk.d.ts +104 -0
  1096. package/node_modules/music-metadata/lib/wav/WaveChunk.js +88 -0
  1097. package/node_modules/music-metadata/lib/wav/WaveLoader.d.ts +2 -0
  1098. package/node_modules/music-metadata/lib/wav/WaveLoader.js +8 -0
  1099. package/node_modules/music-metadata/lib/wav/WaveParser.d.ts +25 -0
  1100. package/node_modules/music-metadata/lib/wav/WaveParser.js +171 -0
  1101. package/node_modules/music-metadata/lib/wavpack/WavPackLoader.d.ts +2 -0
  1102. package/node_modules/music-metadata/lib/wavpack/WavPackLoader.js +8 -0
  1103. package/node_modules/music-metadata/lib/wavpack/WavPackParser.d.ts +30 -0
  1104. package/node_modules/music-metadata/lib/wavpack/WavPackParser.js +109 -0
  1105. package/node_modules/music-metadata/lib/wavpack/WavPackToken.d.ts +60 -0
  1106. package/node_modules/music-metadata/lib/wavpack/WavPackToken.js +70 -0
  1107. package/node_modules/music-metadata/package.json +156 -0
  1108. package/node_modules/on-exit-leak-free/.github/dependabot.yml +12 -0
  1109. package/node_modules/on-exit-leak-free/.github/workflows/ci.yml +46 -0
  1110. package/node_modules/on-exit-leak-free/LICENSE +21 -0
  1111. package/node_modules/on-exit-leak-free/README.md +54 -0
  1112. package/node_modules/on-exit-leak-free/index.js +108 -0
  1113. package/node_modules/on-exit-leak-free/package.json +37 -0
  1114. package/node_modules/on-exit-leak-free/test/base.test.js +30 -0
  1115. package/node_modules/on-exit-leak-free/test/event-emitter-leak.test.js +23 -0
  1116. package/node_modules/on-exit-leak-free/test/fixtures/beforeExit.js +33 -0
  1117. package/node_modules/on-exit-leak-free/test/fixtures/close.js +21 -0
  1118. package/node_modules/on-exit-leak-free/test/fixtures/gc-not-close.js +24 -0
  1119. package/node_modules/on-exit-leak-free/test/fixtures/unregister.js +24 -0
  1120. package/node_modules/p-queue/dist/index.d.ts +263 -0
  1121. package/node_modules/p-queue/dist/index.js +796 -0
  1122. package/node_modules/p-queue/dist/lower-bound.d.ts +1 -0
  1123. package/node_modules/p-queue/dist/lower-bound.js +18 -0
  1124. package/node_modules/p-queue/dist/options.d.ts +137 -0
  1125. package/node_modules/p-queue/dist/options.js +1 -0
  1126. package/node_modules/p-queue/dist/priority-queue.d.ts +15 -0
  1127. package/node_modules/p-queue/dist/priority-queue.js +94 -0
  1128. package/node_modules/p-queue/dist/queue.d.ts +9 -0
  1129. package/node_modules/p-queue/dist/queue.js +1 -0
  1130. package/node_modules/p-queue/license +9 -0
  1131. package/node_modules/p-queue/package.json +81 -0
  1132. package/node_modules/p-queue/readme.md +1079 -0
  1133. package/node_modules/p-timeout/index.d.ts +149 -0
  1134. package/node_modules/p-timeout/index.js +95 -0
  1135. package/node_modules/p-timeout/license +9 -0
  1136. package/node_modules/p-timeout/package.json +52 -0
  1137. package/node_modules/p-timeout/readme.md +192 -0
  1138. package/node_modules/pino/.eslintignore +2 -0
  1139. package/node_modules/pino/.eslintrc +8 -0
  1140. package/node_modules/pino/.github/dependabot.yml +13 -0
  1141. package/node_modules/pino/.github/workflows/bench.yml +61 -0
  1142. package/node_modules/pino/.github/workflows/ci.yml +90 -0
  1143. package/node_modules/pino/.github/workflows/lock-threads.yml +30 -0
  1144. package/node_modules/pino/.github/workflows/publish-release.yml +43 -0
  1145. package/node_modules/pino/.github/workflows/target-main.yml +23 -0
  1146. package/node_modules/pino/.nojekyll +0 -0
  1147. package/node_modules/pino/.prettierignore +1 -0
  1148. package/node_modules/pino/.taprc.yaml +8 -0
  1149. package/node_modules/pino/CNAME +1 -0
  1150. package/node_modules/pino/CONTRIBUTING.md +30 -0
  1151. package/node_modules/pino/LICENSE +21 -0
  1152. package/node_modules/pino/README.md +177 -0
  1153. package/node_modules/pino/SECURITY.md +68 -0
  1154. package/node_modules/pino/benchmarks/basic.bench.js +95 -0
  1155. package/node_modules/pino/benchmarks/child-child.bench.js +52 -0
  1156. package/node_modules/pino/benchmarks/child-creation.bench.js +73 -0
  1157. package/node_modules/pino/benchmarks/child.bench.js +62 -0
  1158. package/node_modules/pino/benchmarks/deep-object.bench.js +88 -0
  1159. package/node_modules/pino/benchmarks/formatters.bench.js +50 -0
  1160. package/node_modules/pino/benchmarks/internal/custom-levels.js +67 -0
  1161. package/node_modules/pino/benchmarks/internal/just-pino-heavy.bench.js +76 -0
  1162. package/node_modules/pino/benchmarks/internal/just-pino.bench.js +182 -0
  1163. package/node_modules/pino/benchmarks/internal/parent-vs-child.bench.js +75 -0
  1164. package/node_modules/pino/benchmarks/internal/redact.bench.js +86 -0
  1165. package/node_modules/pino/benchmarks/long-string.bench.js +81 -0
  1166. package/node_modules/pino/benchmarks/multi-arg.bench.js +193 -0
  1167. package/node_modules/pino/benchmarks/multistream.js +98 -0
  1168. package/node_modules/pino/benchmarks/object.bench.js +82 -0
  1169. package/node_modules/pino/benchmarks/utils/generate-benchmark-doc.js +36 -0
  1170. package/node_modules/pino/benchmarks/utils/runbench.js +138 -0
  1171. package/node_modules/pino/benchmarks/utils/wrap-log-level.js +55 -0
  1172. package/node_modules/pino/bin.js +6 -0
  1173. package/node_modules/pino/browser.js +505 -0
  1174. package/node_modules/pino/build/sync-version.js +25 -0
  1175. package/node_modules/pino/docs/api.md +1588 -0
  1176. package/node_modules/pino/docs/asynchronous.md +40 -0
  1177. package/node_modules/pino/docs/benchmarks.md +55 -0
  1178. package/node_modules/pino/docs/browser.md +242 -0
  1179. package/node_modules/pino/docs/bundling.md +40 -0
  1180. package/node_modules/pino/docs/child-loggers.md +95 -0
  1181. package/node_modules/pino/docs/diagnostics.md +16 -0
  1182. package/node_modules/pino/docs/ecosystem.md +86 -0
  1183. package/node_modules/pino/docs/help.md +345 -0
  1184. package/node_modules/pino/docs/lts.md +64 -0
  1185. package/node_modules/pino/docs/pretty.md +35 -0
  1186. package/node_modules/pino/docs/redaction.md +135 -0
  1187. package/node_modules/pino/docs/transports.md +1263 -0
  1188. package/node_modules/pino/docs/web.md +309 -0
  1189. package/node_modules/pino/docsify/sidebar.md +26 -0
  1190. package/node_modules/pino/examples/basic.js +43 -0
  1191. package/node_modules/pino/examples/transport.js +68 -0
  1192. package/node_modules/pino/favicon-16x16.png +0 -0
  1193. package/node_modules/pino/favicon-32x32.png +0 -0
  1194. package/node_modules/pino/favicon.ico +0 -0
  1195. package/node_modules/pino/file.js +12 -0
  1196. package/node_modules/pino/inc-version.sh +42 -0
  1197. package/node_modules/pino/index.html +55 -0
  1198. package/node_modules/pino/lib/caller.js +30 -0
  1199. package/node_modules/pino/lib/constants.js +28 -0
  1200. package/node_modules/pino/lib/deprecations.js +8 -0
  1201. package/node_modules/pino/lib/levels.js +241 -0
  1202. package/node_modules/pino/lib/meta.js +3 -0
  1203. package/node_modules/pino/lib/multistream.js +203 -0
  1204. package/node_modules/pino/lib/proto.js +260 -0
  1205. package/node_modules/pino/lib/redaction.js +114 -0
  1206. package/node_modules/pino/lib/symbols.js +74 -0
  1207. package/node_modules/pino/lib/time.js +39 -0
  1208. package/node_modules/pino/lib/tools.js +436 -0
  1209. package/node_modules/pino/lib/transport-stream.js +56 -0
  1210. package/node_modules/pino/lib/transport.js +167 -0
  1211. package/node_modules/pino/lib/worker.js +194 -0
  1212. package/node_modules/pino/package.json +122 -0
  1213. package/node_modules/pino/pino-banner.png +0 -0
  1214. package/node_modules/pino/pino-logo-hire.png +0 -0
  1215. package/node_modules/pino/pino-tree.png +0 -0
  1216. package/node_modules/pino/pino.d.ts +904 -0
  1217. package/node_modules/pino/pino.js +234 -0
  1218. package/node_modules/pino/pretty-demo.png +0 -0
  1219. package/node_modules/pino/test/basic.test.js +876 -0
  1220. package/node_modules/pino/test/broken-pipe.test.js +57 -0
  1221. package/node_modules/pino/test/browser-child.test.js +132 -0
  1222. package/node_modules/pino/test/browser-disabled.test.js +87 -0
  1223. package/node_modules/pino/test/browser-early-console-freeze.test.js +12 -0
  1224. package/node_modules/pino/test/browser-is-level-enabled.test.js +104 -0
  1225. package/node_modules/pino/test/browser-levels.test.js +241 -0
  1226. package/node_modules/pino/test/browser-serializers.test.js +352 -0
  1227. package/node_modules/pino/test/browser-timestamp.test.js +88 -0
  1228. package/node_modules/pino/test/browser-transmit.test.js +417 -0
  1229. package/node_modules/pino/test/browser.test.js +679 -0
  1230. package/node_modules/pino/test/complex-objects.test.js +34 -0
  1231. package/node_modules/pino/test/crlf.test.js +32 -0
  1232. package/node_modules/pino/test/custom-levels.test.js +253 -0
  1233. package/node_modules/pino/test/diagnostics.test.js +107 -0
  1234. package/node_modules/pino/test/error.test.js +398 -0
  1235. package/node_modules/pino/test/errorKey.test.js +34 -0
  1236. package/node_modules/pino/test/escaping.test.js +91 -0
  1237. package/node_modules/pino/test/esm/esm.mjs +12 -0
  1238. package/node_modules/pino/test/esm/index.test.js +34 -0
  1239. package/node_modules/pino/test/esm/named-exports.mjs +27 -0
  1240. package/node_modules/pino/test/exit.test.js +77 -0
  1241. package/node_modules/pino/test/fixtures/broken-pipe/basic.js +9 -0
  1242. package/node_modules/pino/test/fixtures/broken-pipe/destination.js +10 -0
  1243. package/node_modules/pino/test/fixtures/broken-pipe/syncfalse.js +12 -0
  1244. package/node_modules/pino/test/fixtures/console-transport.js +13 -0
  1245. package/node_modules/pino/test/fixtures/crashing-transport.js +13 -0
  1246. package/node_modules/pino/test/fixtures/default-exit.js +8 -0
  1247. package/node_modules/pino/test/fixtures/destination-exit.js +8 -0
  1248. package/node_modules/pino/test/fixtures/eval/index.js +13 -0
  1249. package/node_modules/pino/test/fixtures/eval/node_modules/14-files.js +3 -0
  1250. package/node_modules/pino/test/fixtures/eval/node_modules/2-files.js +3 -0
  1251. package/node_modules/pino/test/fixtures/eval/node_modules/file1.js +5 -0
  1252. package/node_modules/pino/test/fixtures/eval/node_modules/file10.js +5 -0
  1253. package/node_modules/pino/test/fixtures/eval/node_modules/file11.js +5 -0
  1254. package/node_modules/pino/test/fixtures/eval/node_modules/file12.js +5 -0
  1255. package/node_modules/pino/test/fixtures/eval/node_modules/file13.js +5 -0
  1256. package/node_modules/pino/test/fixtures/eval/node_modules/file14.js +11 -0
  1257. package/node_modules/pino/test/fixtures/eval/node_modules/file2.js +5 -0
  1258. package/node_modules/pino/test/fixtures/eval/node_modules/file3.js +5 -0
  1259. package/node_modules/pino/test/fixtures/eval/node_modules/file4.js +5 -0
  1260. package/node_modules/pino/test/fixtures/eval/node_modules/file5.js +5 -0
  1261. package/node_modules/pino/test/fixtures/eval/node_modules/file6.js +5 -0
  1262. package/node_modules/pino/test/fixtures/eval/node_modules/file7.js +5 -0
  1263. package/node_modules/pino/test/fixtures/eval/node_modules/file8.js +5 -0
  1264. package/node_modules/pino/test/fixtures/eval/node_modules/file9.js +5 -0
  1265. package/node_modules/pino/test/fixtures/noop-transport.js +10 -0
  1266. package/node_modules/pino/test/fixtures/pretty/null-prototype.js +8 -0
  1267. package/node_modules/pino/test/fixtures/stdout-hack-protection.js +11 -0
  1268. package/node_modules/pino/test/fixtures/syncfalse-child.js +6 -0
  1269. package/node_modules/pino/test/fixtures/syncfalse-exit.js +9 -0
  1270. package/node_modules/pino/test/fixtures/syncfalse-flush-exit.js +10 -0
  1271. package/node_modules/pino/test/fixtures/syncfalse.js +6 -0
  1272. package/node_modules/pino/test/fixtures/syntax-error-esm.mjs +2 -0
  1273. package/node_modules/pino/test/fixtures/to-file-transport-with-transform.js +20 -0
  1274. package/node_modules/pino/test/fixtures/to-file-transport.js +13 -0
  1275. package/node_modules/pino/test/fixtures/to-file-transport.mjs +8 -0
  1276. package/node_modules/pino/test/fixtures/transport/index.js +12 -0
  1277. package/node_modules/pino/test/fixtures/transport/package.json +5 -0
  1278. package/node_modules/pino/test/fixtures/transport-exit-immediately-with-async-dest.js +16 -0
  1279. package/node_modules/pino/test/fixtures/transport-exit-immediately.js +11 -0
  1280. package/node_modules/pino/test/fixtures/transport-exit-on-ready.js +12 -0
  1281. package/node_modules/pino/test/fixtures/transport-main.js +9 -0
  1282. package/node_modules/pino/test/fixtures/transport-many-lines.js +29 -0
  1283. package/node_modules/pino/test/fixtures/transport-string-stdout.js +9 -0
  1284. package/node_modules/pino/test/fixtures/transport-transform.js +21 -0
  1285. package/node_modules/pino/test/fixtures/transport-uses-pino-config.js +33 -0
  1286. package/node_modules/pino/test/fixtures/transport-with-on-exit.js +12 -0
  1287. package/node_modules/pino/test/fixtures/transport-worker-data.js +19 -0
  1288. package/node_modules/pino/test/fixtures/transport-worker.js +15 -0
  1289. package/node_modules/pino/test/fixtures/transport-wrong-export-type.js +3 -0
  1290. package/node_modules/pino/test/fixtures/ts/to-file-transport-with-transform.ts +18 -0
  1291. package/node_modules/pino/test/fixtures/ts/to-file-transport.ts +11 -0
  1292. package/node_modules/pino/test/fixtures/ts/transpile.cjs +36 -0
  1293. package/node_modules/pino/test/fixtures/ts/transport-exit-immediately-with-async-dest.ts +15 -0
  1294. package/node_modules/pino/test/fixtures/ts/transport-exit-immediately.ts +10 -0
  1295. package/node_modules/pino/test/fixtures/ts/transport-exit-on-ready.ts +11 -0
  1296. package/node_modules/pino/test/fixtures/ts/transport-main.ts +8 -0
  1297. package/node_modules/pino/test/fixtures/ts/transport-string-stdout.ts +8 -0
  1298. package/node_modules/pino/test/fixtures/ts/transport-worker.ts +14 -0
  1299. package/node_modules/pino/test/formatters.test.js +355 -0
  1300. package/node_modules/pino/test/helper.d.ts +4 -0
  1301. package/node_modules/pino/test/helper.js +128 -0
  1302. package/node_modules/pino/test/hooks.test.js +118 -0
  1303. package/node_modules/pino/test/http.test.js +242 -0
  1304. package/node_modules/pino/test/internals/version.test.js +15 -0
  1305. package/node_modules/pino/test/is-level-enabled.test.js +185 -0
  1306. package/node_modules/pino/test/jest/basic.spec.js +10 -0
  1307. package/node_modules/pino/test/levels.test.js +772 -0
  1308. package/node_modules/pino/test/metadata.test.js +106 -0
  1309. package/node_modules/pino/test/mixin-merge-strategy.test.js +55 -0
  1310. package/node_modules/pino/test/mixin.test.js +218 -0
  1311. package/node_modules/pino/test/multistream.test.js +723 -0
  1312. package/node_modules/pino/test/pkg/index.js +46 -0
  1313. package/node_modules/pino/test/pkg/pkg.config.json +16 -0
  1314. package/node_modules/pino/test/pkg/pkg.test.js +58 -0
  1315. package/node_modules/pino/test/redact.test.js +847 -0
  1316. package/node_modules/pino/test/serializers.test.js +253 -0
  1317. package/node_modules/pino/test/sinon-child-logger.test.js +75 -0
  1318. package/node_modules/pino/test/stdout-protection.test.js +39 -0
  1319. package/node_modules/pino/test/syncfalse.test.js +188 -0
  1320. package/node_modules/pino/test/timestamp-nano.test.js +35 -0
  1321. package/node_modules/pino/test/timestamp.test.js +122 -0
  1322. package/node_modules/pino/test/transport/big.test.js +43 -0
  1323. package/node_modules/pino/test/transport/bundlers-support.test.js +97 -0
  1324. package/node_modules/pino/test/transport/caller.test.js +23 -0
  1325. package/node_modules/pino/test/transport/core.test.js +643 -0
  1326. package/node_modules/pino/test/transport/core.test.ts +236 -0
  1327. package/node_modules/pino/test/transport/core.transpiled.test.ts +112 -0
  1328. package/node_modules/pino/test/transport/crash.test.js +34 -0
  1329. package/node_modules/pino/test/transport/module-link.test.js +239 -0
  1330. package/node_modules/pino/test/transport/pipeline.test.js +135 -0
  1331. package/node_modules/pino/test/transport/repl.test.js +14 -0
  1332. package/node_modules/pino/test/transport/syncTrue.test.js +55 -0
  1333. package/node_modules/pino/test/transport/syncfalse.test.js +68 -0
  1334. package/node_modules/pino/test/transport/targets.test.js +44 -0
  1335. package/node_modules/pino/test/transport/uses-pino-config.test.js +167 -0
  1336. package/node_modules/pino/test/transport-stream.test.js +26 -0
  1337. package/node_modules/pino/test/types/pino-import.test-d.cts +29 -0
  1338. package/node_modules/pino/test/types/pino-multistream.test-d.ts +28 -0
  1339. package/node_modules/pino/test/types/pino-top-export.test-d.ts +36 -0
  1340. package/node_modules/pino/test/types/pino-transport.test-d.ts +145 -0
  1341. package/node_modules/pino/test/types/pino-type-only.test-d.ts +66 -0
  1342. package/node_modules/pino/test/types/pino.test-d.ts +585 -0
  1343. package/node_modules/pino/test/types/pino.ts +90 -0
  1344. package/node_modules/pino/tsconfig.json +14 -0
  1345. package/node_modules/pino-abstract-transport/.github/dependabot.yml +13 -0
  1346. package/node_modules/pino-abstract-transport/.github/workflows/ci.yml +97 -0
  1347. package/node_modules/pino-abstract-transport/.husky/pre-commit +4 -0
  1348. package/node_modules/pino-abstract-transport/LICENSE +21 -0
  1349. package/node_modules/pino-abstract-transport/README.md +172 -0
  1350. package/node_modules/pino-abstract-transport/index.d.ts +122 -0
  1351. package/node_modules/pino-abstract-transport/index.js +128 -0
  1352. package/node_modules/pino-abstract-transport/package.json +40 -0
  1353. package/node_modules/pino-abstract-transport/test/base.test.js +445 -0
  1354. package/node_modules/pino-abstract-transport/test/fixtures/transport-async-iteration.js +22 -0
  1355. package/node_modules/pino-abstract-transport/test/fixtures/transport-on-data.js +22 -0
  1356. package/node_modules/pino-abstract-transport/test/fixtures/transport-transform.js +24 -0
  1357. package/node_modules/pino-abstract-transport/test/fixtures/worker-pipeline.js +15 -0
  1358. package/node_modules/pino-abstract-transport/test/types/index.test-d.ts +31 -0
  1359. package/node_modules/pino-abstract-transport/test/worker.test.js +357 -0
  1360. package/node_modules/pino-std-serializers/.editorconfig +13 -0
  1361. package/node_modules/pino-std-serializers/.github/dependabot.yml +13 -0
  1362. package/node_modules/pino-std-serializers/.github/workflows/ci.yml +81 -0
  1363. package/node_modules/pino-std-serializers/LICENSE +7 -0
  1364. package/node_modules/pino-std-serializers/Readme.md +182 -0
  1365. package/node_modules/pino-std-serializers/eslint.config.js +7 -0
  1366. package/node_modules/pino-std-serializers/index.d.ts +145 -0
  1367. package/node_modules/pino-std-serializers/index.js +36 -0
  1368. package/node_modules/pino-std-serializers/lib/err-helpers.js +118 -0
  1369. package/node_modules/pino-std-serializers/lib/err-proto.js +48 -0
  1370. package/node_modules/pino-std-serializers/lib/err-with-cause.js +48 -0
  1371. package/node_modules/pino-std-serializers/lib/err.js +45 -0
  1372. package/node_modules/pino-std-serializers/lib/req.js +100 -0
  1373. package/node_modules/pino-std-serializers/lib/res.js +47 -0
  1374. package/node_modules/pino-std-serializers/package.json +42 -0
  1375. package/node_modules/pino-std-serializers/test/err-with-cause.test.js +187 -0
  1376. package/node_modules/pino-std-serializers/test/err.test.js +200 -0
  1377. package/node_modules/pino-std-serializers/test/req.test.js +477 -0
  1378. package/node_modules/pino-std-serializers/test/res.test.js +120 -0
  1379. package/node_modules/pino-std-serializers/test/types/index.test-d.ts +71 -0
  1380. package/node_modules/pino-std-serializers/tsconfig.json +13 -0
  1381. package/node_modules/process-warning/.gitattributes +2 -0
  1382. package/node_modules/process-warning/.github/dependabot.yml +13 -0
  1383. package/node_modules/process-warning/.github/workflows/ci.yml +22 -0
  1384. package/node_modules/process-warning/LICENSE +21 -0
  1385. package/node_modules/process-warning/README.md +118 -0
  1386. package/node_modules/process-warning/benchmarks/warn.js +25 -0
  1387. package/node_modules/process-warning/eslint.config.js +6 -0
  1388. package/node_modules/process-warning/examples/example.js +11 -0
  1389. package/node_modules/process-warning/index.js +124 -0
  1390. package/node_modules/process-warning/package.json +73 -0
  1391. package/node_modules/process-warning/test/emit-interpolated-string.test.js +34 -0
  1392. package/node_modules/process-warning/test/emit-once-only.test.js +33 -0
  1393. package/node_modules/process-warning/test/emit-reset.test.js +40 -0
  1394. package/node_modules/process-warning/test/emit-set.test.js +35 -0
  1395. package/node_modules/process-warning/test/emit-unlimited.test.js +42 -0
  1396. package/node_modules/process-warning/test/index.test.js +99 -0
  1397. package/node_modules/process-warning/test/issue-88.test.js +38 -0
  1398. package/node_modules/process-warning/test/jest.test.js +24 -0
  1399. package/node_modules/process-warning/test/no-warnings.test.js +80 -0
  1400. package/node_modules/process-warning/test/promise.js +10 -0
  1401. package/node_modules/process-warning/types/index.d.ts +37 -0
  1402. package/node_modules/process-warning/types/index.test-d.ts +36 -0
  1403. package/node_modules/protobufjs/LICENSE +39 -0
  1404. package/node_modules/protobufjs/README.md +727 -0
  1405. package/node_modules/protobufjs/dist/light/protobuf.js +8041 -0
  1406. package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -0
  1407. package/node_modules/protobufjs/dist/light/protobuf.min.js +8 -0
  1408. package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -0
  1409. package/node_modules/protobufjs/dist/minimal/protobuf.js +2791 -0
  1410. package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -0
  1411. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +8 -0
  1412. package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -0
  1413. package/node_modules/protobufjs/dist/protobuf.js +9865 -0
  1414. package/node_modules/protobufjs/dist/protobuf.js.map +1 -0
  1415. package/node_modules/protobufjs/dist/protobuf.min.js +8 -0
  1416. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -0
  1417. package/node_modules/protobufjs/ext/debug/README.md +4 -0
  1418. package/node_modules/protobufjs/ext/debug/index.js +71 -0
  1419. package/node_modules/protobufjs/ext/descriptor/README.md +72 -0
  1420. package/node_modules/protobufjs/ext/descriptor/index.d.ts +195 -0
  1421. package/node_modules/protobufjs/ext/descriptor/index.js +1186 -0
  1422. package/node_modules/protobufjs/ext/descriptor/test.js +54 -0
  1423. package/node_modules/protobufjs/google/LICENSE +27 -0
  1424. package/node_modules/protobufjs/google/README.md +1 -0
  1425. package/node_modules/protobufjs/google/api/annotations.json +83 -0
  1426. package/node_modules/protobufjs/google/api/annotations.proto +11 -0
  1427. package/node_modules/protobufjs/google/api/http.json +86 -0
  1428. package/node_modules/protobufjs/google/api/http.proto +31 -0
  1429. package/node_modules/protobufjs/google/protobuf/api.json +118 -0
  1430. package/node_modules/protobufjs/google/protobuf/api.proto +34 -0
  1431. package/node_modules/protobufjs/google/protobuf/descriptor.json +1382 -0
  1432. package/node_modules/protobufjs/google/protobuf/descriptor.proto +535 -0
  1433. package/node_modules/protobufjs/google/protobuf/source_context.json +20 -0
  1434. package/node_modules/protobufjs/google/protobuf/source_context.proto +7 -0
  1435. package/node_modules/protobufjs/google/protobuf/type.json +202 -0
  1436. package/node_modules/protobufjs/google/protobuf/type.proto +89 -0
  1437. package/node_modules/protobufjs/index.d.ts +2832 -0
  1438. package/node_modules/protobufjs/index.js +4 -0
  1439. package/node_modules/protobufjs/light.d.ts +2 -0
  1440. package/node_modules/protobufjs/light.js +4 -0
  1441. package/node_modules/protobufjs/minimal.d.ts +2 -0
  1442. package/node_modules/protobufjs/minimal.js +4 -0
  1443. package/node_modules/protobufjs/package.json +119 -0
  1444. package/node_modules/protobufjs/scripts/postinstall.js +32 -0
  1445. package/node_modules/protobufjs/src/common.js +399 -0
  1446. package/node_modules/protobufjs/src/converter.js +318 -0
  1447. package/node_modules/protobufjs/src/decoder.js +135 -0
  1448. package/node_modules/protobufjs/src/encoder.js +103 -0
  1449. package/node_modules/protobufjs/src/enum.js +226 -0
  1450. package/node_modules/protobufjs/src/field.js +453 -0
  1451. package/node_modules/protobufjs/src/index-light.js +104 -0
  1452. package/node_modules/protobufjs/src/index-minimal.js +36 -0
  1453. package/node_modules/protobufjs/src/index.js +12 -0
  1454. package/node_modules/protobufjs/src/mapfield.js +126 -0
  1455. package/node_modules/protobufjs/src/message.js +143 -0
  1456. package/node_modules/protobufjs/src/method.js +160 -0
  1457. package/node_modules/protobufjs/src/namespace.js +558 -0
  1458. package/node_modules/protobufjs/src/object.js +382 -0
  1459. package/node_modules/protobufjs/src/oneof.js +222 -0
  1460. package/node_modules/protobufjs/src/parse.js +989 -0
  1461. package/node_modules/protobufjs/src/reader.js +426 -0
  1462. package/node_modules/protobufjs/src/reader_buffer.js +51 -0
  1463. package/node_modules/protobufjs/src/root.js +412 -0
  1464. package/node_modules/protobufjs/src/roots.js +18 -0
  1465. package/node_modules/protobufjs/src/rpc/service.js +142 -0
  1466. package/node_modules/protobufjs/src/rpc.js +36 -0
  1467. package/node_modules/protobufjs/src/service.js +193 -0
  1468. package/node_modules/protobufjs/src/tokenize.js +416 -0
  1469. package/node_modules/protobufjs/src/type.js +632 -0
  1470. package/node_modules/protobufjs/src/types.js +196 -0
  1471. package/node_modules/protobufjs/src/typescript.jsdoc +15 -0
  1472. package/node_modules/protobufjs/src/util/fs.js +11 -0
  1473. package/node_modules/protobufjs/src/util/longbits.js +200 -0
  1474. package/node_modules/protobufjs/src/util/minimal.js +491 -0
  1475. package/node_modules/protobufjs/src/util/patterns.js +7 -0
  1476. package/node_modules/protobufjs/src/util.js +230 -0
  1477. package/node_modules/protobufjs/src/verifier.js +180 -0
  1478. package/node_modules/protobufjs/src/wrappers.js +107 -0
  1479. package/node_modules/protobufjs/src/writer.js +467 -0
  1480. package/node_modules/protobufjs/src/writer_buffer.js +85 -0
  1481. package/node_modules/protobufjs/tsconfig.json +8 -0
  1482. package/node_modules/qified/LICENSE +19 -0
  1483. package/node_modules/qified/README.md +677 -0
  1484. package/node_modules/qified/dist/index.cjs +662 -0
  1485. package/node_modules/qified/dist/index.d.cts +626 -0
  1486. package/node_modules/qified/dist/index.d.mts +626 -0
  1487. package/node_modules/qified/dist/index.mjs +657 -0
  1488. package/node_modules/qified/node_modules/hookified/LICENSE +19 -0
  1489. package/node_modules/qified/node_modules/hookified/README.md +1792 -0
  1490. package/node_modules/qified/node_modules/hookified/dist/browser/index.global.js +951 -0
  1491. package/node_modules/qified/node_modules/hookified/dist/browser/index.global.js.map +1 -0
  1492. package/node_modules/qified/node_modules/hookified/dist/browser/index.js +943 -0
  1493. package/node_modules/qified/node_modules/hookified/dist/browser/index.js.map +1 -0
  1494. package/node_modules/qified/node_modules/hookified/dist/node/index.cjs +908 -0
  1495. package/node_modules/qified/node_modules/hookified/dist/node/index.d.cts +771 -0
  1496. package/node_modules/qified/node_modules/hookified/dist/node/index.d.ts +771 -0
  1497. package/node_modules/qified/node_modules/hookified/dist/node/index.js +903 -0
  1498. package/node_modules/qified/node_modules/hookified/package.json +94 -0
  1499. package/node_modules/qified/package.json +50 -0
  1500. package/node_modules/quick-format-unescaped/.github/workflows/ci.yml +21 -0
  1501. package/node_modules/quick-format-unescaped/LICENSE +21 -0
  1502. package/node_modules/quick-format-unescaped/benchmark.js +24 -0
  1503. package/node_modules/quick-format-unescaped/index.js +109 -0
  1504. package/node_modules/quick-format-unescaped/package.json +29 -0
  1505. package/node_modules/quick-format-unescaped/readme.md +66 -0
  1506. package/node_modules/quick-format-unescaped/test/index.js +136 -0
  1507. package/node_modules/real-require/LICENSE.md +21 -0
  1508. package/node_modules/real-require/README.md +51 -0
  1509. package/node_modules/real-require/package.json +49 -0
  1510. package/node_modules/real-require/src/index.js +14 -0
  1511. package/node_modules/safe-stable-stringify/LICENSE +21 -0
  1512. package/node_modules/safe-stable-stringify/esm/package.json +4 -0
  1513. package/node_modules/safe-stable-stringify/esm/wrapper.d.ts +4 -0
  1514. package/node_modules/safe-stable-stringify/esm/wrapper.js +6 -0
  1515. package/node_modules/safe-stable-stringify/index.d.ts +22 -0
  1516. package/node_modules/safe-stable-stringify/index.js +625 -0
  1517. package/node_modules/safe-stable-stringify/package.json +65 -0
  1518. package/node_modules/safe-stable-stringify/readme.md +179 -0
  1519. package/node_modules/sonic-boom/.eslintignore +2 -0
  1520. package/node_modules/sonic-boom/.taprc +3 -0
  1521. package/node_modules/sonic-boom/LICENSE +21 -0
  1522. package/node_modules/sonic-boom/README.md +153 -0
  1523. package/node_modules/sonic-boom/bench.js +98 -0
  1524. package/node_modules/sonic-boom/check.js +18 -0
  1525. package/node_modules/sonic-boom/example.js +8 -0
  1526. package/node_modules/sonic-boom/fixtures/firehose.js +22 -0
  1527. package/node_modules/sonic-boom/index.js +733 -0
  1528. package/node_modules/sonic-boom/package.json +52 -0
  1529. package/node_modules/sonic-boom/test/destroy.test.js +49 -0
  1530. package/node_modules/sonic-boom/test/end.test.js +98 -0
  1531. package/node_modules/sonic-boom/test/flush-sync.test.js +140 -0
  1532. package/node_modules/sonic-boom/test/flush.test.js +419 -0
  1533. package/node_modules/sonic-boom/test/fsync.test.js +63 -0
  1534. package/node_modules/sonic-boom/test/helper.js +42 -0
  1535. package/node_modules/sonic-boom/test/minlength.test.js +35 -0
  1536. package/node_modules/sonic-boom/test/mode.test.js +116 -0
  1537. package/node_modules/sonic-boom/test/periodicflush.test.js +61 -0
  1538. package/node_modules/sonic-boom/test/reopen.test.js +239 -0
  1539. package/node_modules/sonic-boom/test/retry.test.js +414 -0
  1540. package/node_modules/sonic-boom/test/sync.test.js +261 -0
  1541. package/node_modules/sonic-boom/test/write.test.js +515 -0
  1542. package/node_modules/sonic-boom/types/index.d.ts +63 -0
  1543. package/node_modules/sonic-boom/types/tests/test.ts +4 -0
  1544. package/node_modules/split2/LICENSE +13 -0
  1545. package/node_modules/split2/README.md +85 -0
  1546. package/node_modules/split2/bench.js +27 -0
  1547. package/node_modules/split2/index.js +141 -0
  1548. package/node_modules/split2/package.json +39 -0
  1549. package/node_modules/split2/test.js +409 -0
  1550. package/node_modules/strtok3/LICENSE.txt +21 -0
  1551. package/node_modules/strtok3/README.md +399 -0
  1552. package/node_modules/strtok3/lib/AbstractTokenizer.d.ts +76 -0
  1553. package/node_modules/strtok3/lib/AbstractTokenizer.js +111 -0
  1554. package/node_modules/strtok3/lib/BlobTokenizer.d.ts +29 -0
  1555. package/node_modules/strtok3/lib/BlobTokenizer.js +53 -0
  1556. package/node_modules/strtok3/lib/BufferTokenizer.d.ts +29 -0
  1557. package/node_modules/strtok3/lib/BufferTokenizer.js +52 -0
  1558. package/node_modules/strtok3/lib/FileTokenizer.d.ts +37 -0
  1559. package/node_modules/strtok3/lib/FileTokenizer.js +61 -0
  1560. package/node_modules/strtok3/lib/ReadStreamTokenizer.d.ts +34 -0
  1561. package/node_modules/strtok3/lib/ReadStreamTokenizer.js +107 -0
  1562. package/node_modules/strtok3/lib/core.d.ts +40 -0
  1563. package/node_modules/strtok3/lib/core.js +62 -0
  1564. package/node_modules/strtok3/lib/index.d.ts +16 -0
  1565. package/node_modules/strtok3/lib/index.js +22 -0
  1566. package/node_modules/strtok3/lib/stream/AbstractStreamReader.d.ts +54 -0
  1567. package/node_modules/strtok3/lib/stream/AbstractStreamReader.js +71 -0
  1568. package/node_modules/strtok3/lib/stream/Deferred.d.ts +6 -0
  1569. package/node_modules/strtok3/lib/stream/Deferred.js +10 -0
  1570. package/node_modules/strtok3/lib/stream/Errors.d.ts +10 -0
  1571. package/node_modules/strtok3/lib/stream/Errors.js +16 -0
  1572. package/node_modules/strtok3/lib/stream/StreamReader.d.ts +29 -0
  1573. package/node_modules/strtok3/lib/stream/StreamReader.js +83 -0
  1574. package/node_modules/strtok3/lib/stream/WebStreamByobReader.d.ts +14 -0
  1575. package/node_modules/strtok3/lib/stream/WebStreamByobReader.js +27 -0
  1576. package/node_modules/strtok3/lib/stream/WebStreamDefaultReader.d.ts +19 -0
  1577. package/node_modules/strtok3/lib/stream/WebStreamDefaultReader.js +62 -0
  1578. package/node_modules/strtok3/lib/stream/WebStreamReader.d.ts +14 -0
  1579. package/node_modules/strtok3/lib/stream/WebStreamReader.js +13 -0
  1580. package/node_modules/strtok3/lib/stream/WebStreamReaderFactory.d.ts +5 -0
  1581. package/node_modules/strtok3/lib/stream/WebStreamReaderFactory.js +19 -0
  1582. package/node_modules/strtok3/lib/stream/index.d.ts +6 -0
  1583. package/node_modules/strtok3/lib/stream/index.js +5 -0
  1584. package/node_modules/strtok3/lib/types.d.ts +139 -0
  1585. package/node_modules/strtok3/lib/types.js +1 -0
  1586. package/node_modules/strtok3/package.json +94 -0
  1587. package/node_modules/thread-stream/.claude/settings.local.json +15 -0
  1588. package/node_modules/thread-stream/.github/dependabot.yml +13 -0
  1589. package/node_modules/thread-stream/.github/workflows/ci.yml +94 -0
  1590. package/node_modules/thread-stream/.husky/pre-commit +4 -0
  1591. package/node_modules/thread-stream/.taprc +4 -0
  1592. package/node_modules/thread-stream/CLAUDE.md +64 -0
  1593. package/node_modules/thread-stream/LICENSE +21 -0
  1594. package/node_modules/thread-stream/README.md +136 -0
  1595. package/node_modules/thread-stream/bench.js +85 -0
  1596. package/node_modules/thread-stream/index.d.ts +92 -0
  1597. package/node_modules/thread-stream/index.js +565 -0
  1598. package/node_modules/thread-stream/lib/indexes.js +11 -0
  1599. package/node_modules/thread-stream/lib/wait.js +61 -0
  1600. package/node_modules/thread-stream/lib/worker.js +186 -0
  1601. package/node_modules/thread-stream/package.json +57 -0
  1602. package/node_modules/thread-stream/test/base.test.js +258 -0
  1603. package/node_modules/thread-stream/test/bench.test.js +38 -0
  1604. package/node_modules/thread-stream/test/bundlers.test.js +60 -0
  1605. package/node_modules/thread-stream/test/close-on-gc.js +37 -0
  1606. package/node_modules/thread-stream/test/commonjs-fallback.test.js +80 -0
  1607. package/node_modules/thread-stream/test/context.test.js +21 -0
  1608. package/node_modules/thread-stream/test/create-and-exit.js +16 -0
  1609. package/node_modules/thread-stream/test/custom-worker.js +9 -0
  1610. package/node_modules/thread-stream/test/dir with spaces/test-package.zip +0 -0
  1611. package/node_modules/thread-stream/test/emit-event.js +22 -0
  1612. package/node_modules/thread-stream/test/end.test.js +61 -0
  1613. package/node_modules/thread-stream/test/error.js +14 -0
  1614. package/node_modules/thread-stream/test/esm.test.mjs +47 -0
  1615. package/node_modules/thread-stream/test/event.test.js +23 -0
  1616. package/node_modules/thread-stream/test/exit.js +14 -0
  1617. package/node_modules/thread-stream/test/get-context.js +22 -0
  1618. package/node_modules/thread-stream/test/helper.d.ts +1 -0
  1619. package/node_modules/thread-stream/test/helper.js +35 -0
  1620. package/node_modules/thread-stream/test/indexes.test.js +11 -0
  1621. package/node_modules/thread-stream/test/message-without-code.js +19 -0
  1622. package/node_modules/thread-stream/test/multibyte-chars.test.mjs +74 -0
  1623. package/node_modules/thread-stream/test/never-drain.test.js +57 -0
  1624. package/node_modules/thread-stream/test/on-message.js +18 -0
  1625. package/node_modules/thread-stream/test/pkg/index.js +37 -0
  1626. package/node_modules/thread-stream/test/pkg/pkg.config.json +15 -0
  1627. package/node_modules/thread-stream/test/pkg/pkg.test.js +46 -0
  1628. package/node_modules/thread-stream/test/port.js +16 -0
  1629. package/node_modules/thread-stream/test/post-message.test.js +24 -0
  1630. package/node_modules/thread-stream/test/string-limit-2.test.js +41 -0
  1631. package/node_modules/thread-stream/test/string-limit.test.js +42 -0
  1632. package/node_modules/thread-stream/test/syntax-error.mjs +2 -0
  1633. package/node_modules/thread-stream/test/thread-management.test.js +121 -0
  1634. package/node_modules/thread-stream/test/to-file-on-destroy.js +23 -0
  1635. package/node_modules/thread-stream/test/to-file-on-final.js +24 -0
  1636. package/node_modules/thread-stream/test/to-file.js +12 -0
  1637. package/node_modules/thread-stream/test/to-file.mjs +8 -0
  1638. package/node_modules/thread-stream/test/to-next.js +9 -0
  1639. package/node_modules/thread-stream/test/transpiled.test.js +30 -0
  1640. package/node_modules/thread-stream/test/ts/to-file.ts +10 -0
  1641. package/node_modules/thread-stream/test/ts/transpile.sh +19 -0
  1642. package/node_modules/thread-stream/test/ts-commonjs-default-export.zip +0 -0
  1643. package/node_modules/thread-stream/test/ts.test.ts +33 -0
  1644. package/node_modules/thread-stream/test/uncaughtException.js +21 -0
  1645. package/node_modules/thread-stream/test/unhandledRejection.js +21 -0
  1646. package/node_modules/thread-stream/test/watch-mode.test.js +28 -0
  1647. package/node_modules/thread-stream/test/yarnrc.yml +7 -0
  1648. package/node_modules/thread-stream/tsconfig.json +8 -0
  1649. package/node_modules/token-types/LICENSE.txt +9 -0
  1650. package/node_modules/token-types/README.md +120 -0
  1651. package/node_modules/token-types/lib/index.d.ts +135 -0
  1652. package/node_modules/token-types/lib/index.js +401 -0
  1653. package/node_modules/token-types/package.json +81 -0
  1654. package/node_modules/tslib/CopyrightNotice.txt +15 -0
  1655. package/node_modules/tslib/LICENSE.txt +12 -0
  1656. package/node_modules/tslib/README.md +164 -0
  1657. package/node_modules/tslib/SECURITY.md +41 -0
  1658. package/node_modules/tslib/modules/index.d.ts +38 -0
  1659. package/node_modules/tslib/modules/index.js +70 -0
  1660. package/node_modules/tslib/modules/package.json +3 -0
  1661. package/node_modules/tslib/package.json +47 -0
  1662. package/node_modules/tslib/tslib.d.ts +460 -0
  1663. package/node_modules/tslib/tslib.es6.html +1 -0
  1664. package/node_modules/tslib/tslib.es6.js +402 -0
  1665. package/node_modules/tslib/tslib.es6.mjs +401 -0
  1666. package/node_modules/tslib/tslib.html +1 -0
  1667. package/node_modules/tslib/tslib.js +484 -0
  1668. package/node_modules/uint8array-extras/index.d.ts +331 -0
  1669. package/node_modules/uint8array-extras/index.js +318 -0
  1670. package/node_modules/uint8array-extras/license +9 -0
  1671. package/node_modules/uint8array-extras/package.json +54 -0
  1672. package/node_modules/uint8array-extras/readme.md +318 -0
  1673. package/node_modules/undici-types/LICENSE +21 -0
  1674. package/node_modules/undici-types/README.md +6 -0
  1675. package/node_modules/undici-types/agent.d.ts +30 -0
  1676. package/node_modules/undici-types/api.d.ts +43 -0
  1677. package/node_modules/undici-types/balanced-pool.d.ts +30 -0
  1678. package/node_modules/undici-types/cache-interceptor.d.ts +179 -0
  1679. package/node_modules/undici-types/cache.d.ts +36 -0
  1680. package/node_modules/undici-types/client-stats.d.ts +15 -0
  1681. package/node_modules/undici-types/client.d.ts +129 -0
  1682. package/node_modules/undici-types/connector.d.ts +36 -0
  1683. package/node_modules/undici-types/content-type.d.ts +21 -0
  1684. package/node_modules/undici-types/cookies.d.ts +30 -0
  1685. package/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
  1686. package/node_modules/undici-types/dispatcher.d.ts +253 -0
  1687. package/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
  1688. package/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
  1689. package/node_modules/undici-types/errors.d.ts +177 -0
  1690. package/node_modules/undici-types/eventsource.d.ts +66 -0
  1691. package/node_modules/undici-types/fetch.d.ts +231 -0
  1692. package/node_modules/undici-types/formdata.d.ts +108 -0
  1693. package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  1694. package/node_modules/undici-types/global-origin.d.ts +7 -0
  1695. package/node_modules/undici-types/h2c-client.d.ts +73 -0
  1696. package/node_modules/undici-types/handlers.d.ts +14 -0
  1697. package/node_modules/undici-types/header.d.ts +165 -0
  1698. package/node_modules/undici-types/index.d.ts +93 -0
  1699. package/node_modules/undici-types/interceptors.d.ts +80 -0
  1700. package/node_modules/undici-types/mock-agent.d.ts +68 -0
  1701. package/node_modules/undici-types/mock-call-history.d.ts +111 -0
  1702. package/node_modules/undici-types/mock-client.d.ts +27 -0
  1703. package/node_modules/undici-types/mock-errors.d.ts +12 -0
  1704. package/node_modules/undici-types/mock-interceptor.d.ts +94 -0
  1705. package/node_modules/undici-types/mock-pool.d.ts +27 -0
  1706. package/node_modules/undici-types/package.json +55 -0
  1707. package/node_modules/undici-types/patch.d.ts +29 -0
  1708. package/node_modules/undici-types/pool-stats.d.ts +19 -0
  1709. package/node_modules/undici-types/pool.d.ts +39 -0
  1710. package/node_modules/undici-types/proxy-agent.d.ts +29 -0
  1711. package/node_modules/undici-types/readable.d.ts +68 -0
  1712. package/node_modules/undici-types/retry-agent.d.ts +8 -0
  1713. package/node_modules/undici-types/retry-handler.d.ts +125 -0
  1714. package/node_modules/undici-types/round-robin-pool.d.ts +39 -0
  1715. package/node_modules/undici-types/snapshot-agent.d.ts +113 -0
  1716. package/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
  1717. package/node_modules/undici-types/util.d.ts +18 -0
  1718. package/node_modules/undici-types/utility.d.ts +7 -0
  1719. package/node_modules/undici-types/webidl.d.ts +346 -0
  1720. package/node_modules/undici-types/websocket.d.ts +188 -0
  1721. package/node_modules/whatsapp-rust-bridge/README.md +19 -0
  1722. package/node_modules/whatsapp-rust-bridge/dist/index.d.ts +2 -0
  1723. package/node_modules/whatsapp-rust-bridge/dist/index.js +2015 -0
  1724. package/node_modules/whatsapp-rust-bridge/package.json +45 -0
  1725. package/node_modules/whatsapp-rust-bridge/pkg/whatsapp_rust_bridge.d.ts +446 -0
  1726. package/node_modules/win-guid/LICENSE.txt +9 -0
  1727. package/node_modules/win-guid/README.md +113 -0
  1728. package/node_modules/win-guid/lib/guid.d.ts +20 -0
  1729. package/node_modules/win-guid/lib/guid.js +107 -0
  1730. package/node_modules/win-guid/package.json +55 -0
  1731. package/node_modules/ws/LICENSE +20 -0
  1732. package/node_modules/ws/README.md +548 -0
  1733. package/node_modules/ws/browser.js +8 -0
  1734. package/node_modules/ws/index.js +22 -0
  1735. package/node_modules/ws/lib/buffer-util.js +131 -0
  1736. package/node_modules/ws/lib/constants.js +19 -0
  1737. package/node_modules/ws/lib/event-target.js +292 -0
  1738. package/node_modules/ws/lib/extension.js +203 -0
  1739. package/node_modules/ws/lib/limiter.js +55 -0
  1740. package/node_modules/ws/lib/permessage-deflate.js +528 -0
  1741. package/node_modules/ws/lib/receiver.js +760 -0
  1742. package/node_modules/ws/lib/sender.js +607 -0
  1743. package/node_modules/ws/lib/stream.js +161 -0
  1744. package/node_modules/ws/lib/subprotocol.js +62 -0
  1745. package/node_modules/ws/lib/validation.js +152 -0
  1746. package/node_modules/ws/lib/websocket-server.js +562 -0
  1747. package/node_modules/ws/lib/websocket.js +1571 -0
  1748. package/node_modules/ws/package.json +70 -0
  1749. package/node_modules/ws/wrapper.mjs +21 -0
  1750. package/package.json +28 -0
@@ -0,0 +1,3941 @@
1
+ declare module "node:crypto" {
2
+ import { NonSharedBuffer } from "node:buffer";
3
+ import { Transform, TransformOptions, Writable, WritableOptions } from "node:stream";
4
+ import { PeerCertificate } from "node:tls";
5
+ /**
6
+ * SPKAC is a Certificate Signing Request mechanism originally implemented by
7
+ * Netscape and was specified formally as part of HTML5's `keygen` element.
8
+ *
9
+ * `<keygen>` is deprecated since [HTML 5.2](https://www.w3.org/TR/html52/changes.html#features-removed) and new projects
10
+ * should not use this element anymore.
11
+ *
12
+ * The `node:crypto` module provides the `Certificate` class for working with SPKAC
13
+ * data. The most common usage is handling output generated by the HTML5 `<keygen>` element. Node.js uses [OpenSSL's SPKAC
14
+ * implementation](https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html) internally.
15
+ * @since v0.11.8
16
+ */
17
+ class Certificate {
18
+ /**
19
+ * ```js
20
+ * const { Certificate } = await import('node:crypto');
21
+ * const spkac = getSpkacSomehow();
22
+ * const challenge = Certificate.exportChallenge(spkac);
23
+ * console.log(challenge.toString('utf8'));
24
+ * // Prints: the challenge as a UTF8 string
25
+ * ```
26
+ * @since v9.0.0
27
+ * @param encoding The `encoding` of the `spkac` string.
28
+ * @return The challenge component of the `spkac` data structure, which includes a public key and a challenge.
29
+ */
30
+ static exportChallenge(spkac: BinaryLike, encoding?: BufferEncoding): NonSharedBuffer;
31
+ /**
32
+ * ```js
33
+ * const { Certificate } = await import('node:crypto');
34
+ * const spkac = getSpkacSomehow();
35
+ * const publicKey = Certificate.exportPublicKey(spkac);
36
+ * console.log(publicKey);
37
+ * // Prints: the public key as <Buffer ...>
38
+ * ```
39
+ * @since v9.0.0
40
+ * @param encoding The `encoding` of the `spkac` string.
41
+ * @return The public key component of the `spkac` data structure, which includes a public key and a challenge.
42
+ */
43
+ static exportPublicKey(spkac: BinaryLike, encoding?: BufferEncoding): NonSharedBuffer;
44
+ /**
45
+ * ```js
46
+ * import { Buffer } from 'node:buffer';
47
+ * const { Certificate } = await import('node:crypto');
48
+ *
49
+ * const spkac = getSpkacSomehow();
50
+ * console.log(Certificate.verifySpkac(Buffer.from(spkac)));
51
+ * // Prints: true or false
52
+ * ```
53
+ * @since v9.0.0
54
+ * @param encoding The `encoding` of the `spkac` string.
55
+ * @return `true` if the given `spkac` data structure is valid, `false` otherwise.
56
+ */
57
+ static verifySpkac(spkac: BinaryLike, encoding?: BufferEncoding): boolean;
58
+ /**
59
+ * @deprecated
60
+ * @param encoding The `encoding` of the `spkac` string.
61
+ * @returns The challenge component of the `spkac` data structure,
62
+ * which includes a public key and a challenge.
63
+ */
64
+ exportChallenge(spkac: BinaryLike, encoding?: BufferEncoding): NonSharedBuffer;
65
+ /**
66
+ * @deprecated
67
+ * @param encoding The encoding of the spkac string.
68
+ * @returns The public key component of the `spkac` data structure,
69
+ * which includes a public key and a challenge.
70
+ */
71
+ exportPublicKey(spkac: BinaryLike, encoding?: BufferEncoding): NonSharedBuffer;
72
+ /**
73
+ * @deprecated
74
+ * @param encoding The `encoding` of the `spkac` string.
75
+ * @returns `true` if the given `spkac` data structure is valid,
76
+ * `false` otherwise.
77
+ */
78
+ verifySpkac(spkac: BinaryLike, encoding?: BufferEncoding): boolean;
79
+ }
80
+ /** @deprecated This property is deprecated. Please use `crypto.setFips()` and `crypto.getFips()` instead. */
81
+ var fips: boolean;
82
+ interface HashOptions extends TransformOptions {
83
+ outputLength?: number | undefined;
84
+ }
85
+ /**
86
+ * Creates and returns a `Hash` object that can be used to generate hash digests
87
+ * using the given `algorithm`. Optional `options` argument controls stream
88
+ * behavior. For XOF hash functions such as `'shake256'`, the `outputLength` option
89
+ * can be used to specify the desired output length in bytes.
90
+ *
91
+ * The `algorithm` is dependent on the available algorithms supported by the
92
+ * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
93
+ * On recent releases of OpenSSL, `openssl list -digest-algorithms` will
94
+ * display the available digest algorithms.
95
+ *
96
+ * Example: generating the sha256 sum of a file
97
+ *
98
+ * ```js
99
+ * import {
100
+ * createReadStream,
101
+ * } from 'node:fs';
102
+ * import { argv } from 'node:process';
103
+ * const {
104
+ * createHash,
105
+ * } = await import('node:crypto');
106
+ *
107
+ * const filename = argv[2];
108
+ *
109
+ * const hash = createHash('sha256');
110
+ *
111
+ * const input = createReadStream(filename);
112
+ * input.on('readable', () => {
113
+ * // Only one element is going to be produced by the
114
+ * // hash stream.
115
+ * const data = input.read();
116
+ * if (data)
117
+ * hash.update(data);
118
+ * else {
119
+ * console.log(`${hash.digest('hex')} ${filename}`);
120
+ * }
121
+ * });
122
+ * ```
123
+ * @since v0.1.92
124
+ * @param options `stream.transform` options
125
+ */
126
+ function createHash(algorithm: string, options?: HashOptions): Hash;
127
+ interface HmacOptions extends TransformOptions {
128
+ encoding?: BufferEncoding | undefined;
129
+ }
130
+ /**
131
+ * Creates and returns an `Hmac` object that uses the given `algorithm` and `key`.
132
+ * Optional `options` argument controls stream behavior.
133
+ *
134
+ * The `algorithm` is dependent on the available algorithms supported by the
135
+ * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
136
+ * On recent releases of OpenSSL, `openssl list -digest-algorithms` will
137
+ * display the available digest algorithms.
138
+ *
139
+ * The `key` is the HMAC key used to generate the cryptographic HMAC hash. If it is
140
+ * a `KeyObject`, its type must be `secret`. If it is a string, please consider `caveats when using strings as inputs to cryptographic APIs`. If it was
141
+ * obtained from a cryptographically secure source of entropy, such as {@link randomBytes} or {@link generateKey}, its length should not
142
+ * exceed the block size of `algorithm` (e.g., 512 bits for SHA-256).
143
+ *
144
+ * Example: generating the sha256 HMAC of a file
145
+ *
146
+ * ```js
147
+ * import {
148
+ * createReadStream,
149
+ * } from 'node:fs';
150
+ * import { argv } from 'node:process';
151
+ * const {
152
+ * createHmac,
153
+ * } = await import('node:crypto');
154
+ *
155
+ * const filename = argv[2];
156
+ *
157
+ * const hmac = createHmac('sha256', 'a secret');
158
+ *
159
+ * const input = createReadStream(filename);
160
+ * input.on('readable', () => {
161
+ * // Only one element is going to be produced by the
162
+ * // hash stream.
163
+ * const data = input.read();
164
+ * if (data)
165
+ * hmac.update(data);
166
+ * else {
167
+ * console.log(`${hmac.digest('hex')} ${filename}`);
168
+ * }
169
+ * });
170
+ * ```
171
+ * @since v0.1.94
172
+ * @param options `stream.transform` options
173
+ */
174
+ function createHmac(algorithm: string, key: KeyLike, options?: HmacOptions): Hmac;
175
+ /**
176
+ * The `Hash` class is a utility for creating hash digests of data. It can be
177
+ * used in one of two ways:
178
+ *
179
+ * * As a `stream` that is both readable and writable, where data is written
180
+ * to produce a computed hash digest on the readable side, or
181
+ * * Using the `hash.update()` and `hash.digest()` methods to produce the
182
+ * computed hash.
183
+ *
184
+ * The {@link createHash} method is used to create `Hash` instances. `Hash`objects are not to be created directly using the `new` keyword.
185
+ *
186
+ * Example: Using `Hash` objects as streams:
187
+ *
188
+ * ```js
189
+ * const {
190
+ * createHash,
191
+ * } = await import('node:crypto');
192
+ *
193
+ * const hash = createHash('sha256');
194
+ *
195
+ * hash.on('readable', () => {
196
+ * // Only one element is going to be produced by the
197
+ * // hash stream.
198
+ * const data = hash.read();
199
+ * if (data) {
200
+ * console.log(data.toString('hex'));
201
+ * // Prints:
202
+ * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50
203
+ * }
204
+ * });
205
+ *
206
+ * hash.write('some data to hash');
207
+ * hash.end();
208
+ * ```
209
+ *
210
+ * Example: Using `Hash` and piped streams:
211
+ *
212
+ * ```js
213
+ * import { createReadStream } from 'node:fs';
214
+ * import { stdout } from 'node:process';
215
+ * const { createHash } = await import('node:crypto');
216
+ *
217
+ * const hash = createHash('sha256');
218
+ *
219
+ * const input = createReadStream('test.js');
220
+ * input.pipe(hash).setEncoding('hex').pipe(stdout);
221
+ * ```
222
+ *
223
+ * Example: Using the `hash.update()` and `hash.digest()` methods:
224
+ *
225
+ * ```js
226
+ * const {
227
+ * createHash,
228
+ * } = await import('node:crypto');
229
+ *
230
+ * const hash = createHash('sha256');
231
+ *
232
+ * hash.update('some data to hash');
233
+ * console.log(hash.digest('hex'));
234
+ * // Prints:
235
+ * // 6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50
236
+ * ```
237
+ * @since v0.1.92
238
+ */
239
+ class Hash extends Transform {
240
+ private constructor();
241
+ /**
242
+ * Creates a new `Hash` object that contains a deep copy of the internal state
243
+ * of the current `Hash` object.
244
+ *
245
+ * The optional `options` argument controls stream behavior. For XOF hash
246
+ * functions such as `'shake256'`, the `outputLength` option can be used to
247
+ * specify the desired output length in bytes.
248
+ *
249
+ * An error is thrown when an attempt is made to copy the `Hash` object after
250
+ * its `hash.digest()` method has been called.
251
+ *
252
+ * ```js
253
+ * // Calculate a rolling hash.
254
+ * const {
255
+ * createHash,
256
+ * } = await import('node:crypto');
257
+ *
258
+ * const hash = createHash('sha256');
259
+ *
260
+ * hash.update('one');
261
+ * console.log(hash.copy().digest('hex'));
262
+ *
263
+ * hash.update('two');
264
+ * console.log(hash.copy().digest('hex'));
265
+ *
266
+ * hash.update('three');
267
+ * console.log(hash.copy().digest('hex'));
268
+ *
269
+ * // Etc.
270
+ * ```
271
+ * @since v13.1.0
272
+ * @param options `stream.transform` options
273
+ */
274
+ copy(options?: HashOptions): Hash;
275
+ /**
276
+ * Updates the hash content with the given `data`, the encoding of which
277
+ * is given in `inputEncoding`.
278
+ * If `encoding` is not provided, and the `data` is a string, an
279
+ * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored.
280
+ *
281
+ * This can be called many times with new data as it is streamed.
282
+ * @since v0.1.92
283
+ * @param inputEncoding The `encoding` of the `data` string.
284
+ */
285
+ update(data: string | NodeJS.ArrayBufferView, inputEncoding?: BufferEncoding): Hash;
286
+ /**
287
+ * Calculates the digest of all of the data passed to be hashed (using the `hash.update()` method).
288
+ * If `encoding` is provided a string will be returned; otherwise
289
+ * a `Buffer` is returned.
290
+ *
291
+ * The `Hash` object can not be used again after `hash.digest()` method has been
292
+ * called. Multiple calls will cause an error to be thrown.
293
+ * @since v0.1.92
294
+ * @param encoding The `encoding` of the return value.
295
+ */
296
+ digest(): NonSharedBuffer;
297
+ digest(encoding: BufferEncoding): string;
298
+ }
299
+ /**
300
+ * The `Hmac` class is a utility for creating cryptographic HMAC digests. It can
301
+ * be used in one of two ways:
302
+ *
303
+ * * As a `stream` that is both readable and writable, where data is written
304
+ * to produce a computed HMAC digest on the readable side, or
305
+ * * Using the `hmac.update()` and `hmac.digest()` methods to produce the
306
+ * computed HMAC digest.
307
+ *
308
+ * The {@link createHmac} method is used to create `Hmac` instances. `Hmac`objects are not to be created directly using the `new` keyword.
309
+ *
310
+ * Example: Using `Hmac` objects as streams:
311
+ *
312
+ * ```js
313
+ * const {
314
+ * createHmac,
315
+ * } = await import('node:crypto');
316
+ *
317
+ * const hmac = createHmac('sha256', 'a secret');
318
+ *
319
+ * hmac.on('readable', () => {
320
+ * // Only one element is going to be produced by the
321
+ * // hash stream.
322
+ * const data = hmac.read();
323
+ * if (data) {
324
+ * console.log(data.toString('hex'));
325
+ * // Prints:
326
+ * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e
327
+ * }
328
+ * });
329
+ *
330
+ * hmac.write('some data to hash');
331
+ * hmac.end();
332
+ * ```
333
+ *
334
+ * Example: Using `Hmac` and piped streams:
335
+ *
336
+ * ```js
337
+ * import { createReadStream } from 'node:fs';
338
+ * import { stdout } from 'node:process';
339
+ * const {
340
+ * createHmac,
341
+ * } = await import('node:crypto');
342
+ *
343
+ * const hmac = createHmac('sha256', 'a secret');
344
+ *
345
+ * const input = createReadStream('test.js');
346
+ * input.pipe(hmac).pipe(stdout);
347
+ * ```
348
+ *
349
+ * Example: Using the `hmac.update()` and `hmac.digest()` methods:
350
+ *
351
+ * ```js
352
+ * const {
353
+ * createHmac,
354
+ * } = await import('node:crypto');
355
+ *
356
+ * const hmac = createHmac('sha256', 'a secret');
357
+ *
358
+ * hmac.update('some data to hash');
359
+ * console.log(hmac.digest('hex'));
360
+ * // Prints:
361
+ * // 7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e
362
+ * ```
363
+ * @since v0.1.94
364
+ */
365
+ class Hmac extends Transform {
366
+ private constructor();
367
+ /**
368
+ * Updates the `Hmac` content with the given `data`, the encoding of which
369
+ * is given in `inputEncoding`.
370
+ * If `encoding` is not provided, and the `data` is a string, an
371
+ * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored.
372
+ *
373
+ * This can be called many times with new data as it is streamed.
374
+ * @since v0.1.94
375
+ * @param inputEncoding The `encoding` of the `data` string.
376
+ */
377
+ update(data: string | NodeJS.ArrayBufferView, inputEncoding?: BufferEncoding): Hmac;
378
+ /**
379
+ * Calculates the HMAC digest of all of the data passed using `hmac.update()`.
380
+ * If `encoding` is
381
+ * provided a string is returned; otherwise a `Buffer` is returned;
382
+ *
383
+ * The `Hmac` object can not be used again after `hmac.digest()` has been
384
+ * called. Multiple calls to `hmac.digest()` will result in an error being thrown.
385
+ * @since v0.1.94
386
+ * @param encoding The `encoding` of the return value.
387
+ */
388
+ digest(): NonSharedBuffer;
389
+ digest(encoding: BufferEncoding): string;
390
+ }
391
+ type KeyFormat = "pem" | "der" | "jwk" | "raw-public" | "raw-private" | "raw-seed";
392
+ type KeyObjectType = "secret" | "public" | "private";
393
+ type PublicKeyExportType = "pkcs1" | "spki";
394
+ type PrivateKeyExportType = "pkcs1" | "pkcs8" | "sec1";
395
+ type KeyExportOptions =
396
+ | SymmetricKeyExportOptions
397
+ | PublicKeyExportOptions
398
+ | PrivateKeyExportOptions
399
+ | JwkKeyExportOptions
400
+ | RawPublicKeyExportOptions
401
+ | RawPrivateKeyExportOptions;
402
+ interface SymmetricKeyExportOptions {
403
+ format?: "buffer" | undefined;
404
+ }
405
+ interface PublicKeyExportOptions<T extends PublicKeyExportType = PublicKeyExportType> {
406
+ type: T;
407
+ format: "pem" | "der";
408
+ }
409
+ interface PrivateKeyExportOptions<T extends PrivateKeyExportType = PrivateKeyExportType> {
410
+ type: T;
411
+ format: "pem" | "der";
412
+ cipher?: string | undefined;
413
+ passphrase?: BinaryLike | undefined;
414
+ }
415
+ interface JwkKeyExportOptions {
416
+ format: "jwk";
417
+ }
418
+ interface RawPublicKeyExportOptions {
419
+ format: "raw-public";
420
+ }
421
+ interface RawPrivateKeyExportOptions {
422
+ format: "raw-private" | "raw-seed";
423
+ }
424
+ interface KeyPairExportOptions<
425
+ TPublic extends PublicKeyExportType = PublicKeyExportType,
426
+ TPrivate extends PrivateKeyExportType = PrivateKeyExportType,
427
+ > {
428
+ publicKeyEncoding?:
429
+ | PublicKeyExportOptions<TPublic>
430
+ | RawPublicKeyExportOptions
431
+ | JwkKeyExportOptions
432
+ | undefined;
433
+ privateKeyEncoding?:
434
+ | PrivateKeyExportOptions<TPrivate>
435
+ | RawPrivateKeyExportOptions
436
+ | JwkKeyExportOptions
437
+ | undefined;
438
+ }
439
+ type KeyExportResult<T, Default> = T extends { format: infer F extends KeyFormat } ? {
440
+ "der": NonSharedBuffer;
441
+ "jwk": webcrypto.JsonWebKey;
442
+ "pem": string;
443
+ "raw-public": NonSharedBuffer;
444
+ "raw-private": NonSharedBuffer;
445
+ "raw-seed": NonSharedBuffer;
446
+ }[F]
447
+ : Default;
448
+ interface KeyPairExportResult<T extends KeyPairExportOptions> {
449
+ publicKey: KeyExportResult<T["publicKeyEncoding"], KeyObject>;
450
+ privateKey: KeyExportResult<T["privateKeyEncoding"], KeyObject>;
451
+ }
452
+ type KeyPairExportCallback<T extends KeyPairExportOptions = {}> = (
453
+ err: Error | null,
454
+ publicKey: KeyExportResult<T["publicKeyEncoding"], KeyObject>,
455
+ privateKey: KeyExportResult<T["privateKeyEncoding"], KeyObject>,
456
+ ) => void;
457
+ type MLDSAKeyType = `ml-dsa-${44 | 65 | 87}`;
458
+ type MLKEMKeyType = `ml-kem-${1024 | 512 | 768}`;
459
+ type SLHDSAKeyType = `slh-dsa-${"sha2" | "shake"}-${128 | 192 | 256}${"f" | "s"}`;
460
+ type AsymmetricKeyType =
461
+ | "dh"
462
+ | "dsa"
463
+ | "ec"
464
+ | "ed25519"
465
+ | "ed448"
466
+ | MLDSAKeyType
467
+ | MLKEMKeyType
468
+ | "rsa-pss"
469
+ | "rsa"
470
+ | SLHDSAKeyType
471
+ | "x25519"
472
+ | "x448";
473
+ interface AsymmetricKeyDetails {
474
+ modulusLength?: number;
475
+ publicExponent?: bigint;
476
+ hashAlgorithm?: string;
477
+ mgf1HashAlgorithm?: string;
478
+ saltLength?: number;
479
+ divisorLength?: number;
480
+ namedCurve?: string;
481
+ }
482
+ /**
483
+ * Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key,
484
+ * and each kind of key exposes different functions. The {@link createSecretKey}, {@link createPublicKey} and {@link createPrivateKey} methods are used to create `KeyObject`instances. `KeyObject`
485
+ * objects are not to be created directly using the `new`keyword.
486
+ *
487
+ * Most applications should consider using the new `KeyObject` API instead of
488
+ * passing keys as strings or `Buffer`s due to improved security features.
489
+ *
490
+ * `KeyObject` instances can be passed to other threads via `postMessage()`.
491
+ * The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to
492
+ * be listed in the `transferList` argument.
493
+ * @since v11.6.0
494
+ */
495
+ class KeyObject {
496
+ private constructor();
497
+ /**
498
+ * Returns the underlying `KeyObject` of a `CryptoKey`. The returned `KeyObject`
499
+ * does not retain any of the restrictions imposed by the Web Crypto API on the
500
+ * original `CryptoKey`, such as the allowed key usages, the algorithm or hash
501
+ * algorithm bindings, and the extractability flag. In particular, the underlying
502
+ * key material of the returned `KeyObject` can always be exported.
503
+ *
504
+ * ```js
505
+ * const { KeyObject } = await import('node:crypto');
506
+ * const { subtle } = globalThis.crypto;
507
+ *
508
+ * const key = await subtle.generateKey({
509
+ * name: 'HMAC',
510
+ * hash: 'SHA-256',
511
+ * length: 256,
512
+ * }, true, ['sign', 'verify']);
513
+ *
514
+ * const keyObject = KeyObject.from(key);
515
+ * console.log(keyObject.symmetricKeySize);
516
+ * // Prints: 32 (symmetric key size in bytes)
517
+ * ```
518
+ * @since v15.0.0
519
+ */
520
+ static from(key: webcrypto.CryptoKey): KeyObject;
521
+ /**
522
+ * For asymmetric keys, this property represents the type of the key. See the
523
+ * supported [asymmetric key types](https://nodejs.org/docs/latest-v26.x/api/crypto.html#asymmetric-key-types).
524
+ *
525
+ * This property is `undefined` for unrecognized `KeyObject` types and symmetric
526
+ * keys.
527
+ * @since v11.6.0
528
+ */
529
+ asymmetricKeyType?: AsymmetricKeyType;
530
+ /**
531
+ * This property exists only on asymmetric keys. Depending on the type of the key,
532
+ * this object contains information about the key. None of the information obtained
533
+ * through this property can be used to uniquely identify a key or to compromise
534
+ * the security of the key.
535
+ *
536
+ * For RSA-PSS keys, if the key material contains a `RSASSA-PSS-params` sequence,
537
+ * the `hashAlgorithm`, `mgf1HashAlgorithm`, and `saltLength` properties will be
538
+ * set.
539
+ *
540
+ * Other key details might be exposed via this API using additional attributes.
541
+ * @since v15.7.0
542
+ */
543
+ asymmetricKeyDetails?: AsymmetricKeyDetails;
544
+ /**
545
+ * The result type depends on the selected encoding format, when PEM the
546
+ * result is a string, when DER it will be a buffer containing the data
547
+ * encoded as DER, when [JWK](https://tools.ietf.org/html/rfc7517) it will be an object. Raw formats return a
548
+ * `Buffer` containing the raw key material.
549
+ *
550
+ * Private keys can be encrypted by specifying a `cipher` and `passphrase`.
551
+ * The PKCS#8 `type` supports encryption with both PEM and DER `format` for any
552
+ * key algorithm. PKCS#1 and SEC1 can only be encrypted when the PEM `format` is
553
+ * used. For maximum compatibility, use PKCS#8 for encrypted private keys. Since
554
+ * PKCS#8 defines its own encryption mechanism, PEM-level encryption is not
555
+ * supported when encrypting a PKCS#8 key. See [RFC 5208](https://www.rfc-editor.org/rfc/rfc5208.txt) for PKCS#8 encryption
556
+ * and [RFC 1421](https://www.rfc-editor.org/rfc/rfc1421.txt) for PKCS#1 and SEC1 encryption.
557
+ * @since v11.6.0
558
+ */
559
+ export<T extends KeyExportOptions = {}>(options?: T): KeyExportResult<T, NonSharedBuffer>;
560
+ /**
561
+ * Returns `true` or `false` depending on whether the keys have exactly the same
562
+ * type, value, and parameters. This method is not [constant time](https://en.wikipedia.org/wiki/Timing_attack).
563
+ * @since v17.7.0, v16.15.0
564
+ * @param otherKeyObject A `KeyObject` with which to compare `keyObject`.
565
+ */
566
+ equals(otherKeyObject: KeyObject): boolean;
567
+ /**
568
+ * For secret keys, this property represents the size of the key in bytes. This
569
+ * property is `undefined` for asymmetric keys.
570
+ * @since v11.6.0
571
+ */
572
+ symmetricKeySize?: number;
573
+ /**
574
+ * Converts a `KeyObject` instance to a `CryptoKey`.
575
+ * @since 22.10.0
576
+ */
577
+ toCryptoKey(
578
+ algorithm:
579
+ | webcrypto.AlgorithmIdentifier
580
+ | webcrypto.RsaHashedImportParams
581
+ | webcrypto.EcKeyImportParams
582
+ | webcrypto.HmacImportParams,
583
+ extractable: boolean,
584
+ keyUsages: readonly webcrypto.KeyUsage[],
585
+ ): webcrypto.CryptoKey;
586
+ /**
587
+ * Depending on the type of this `KeyObject`, this property is either`'secret'` for secret (symmetric) keys, `'public'` for public (asymmetric) keys
588
+ * or `'private'` for private (asymmetric) keys.
589
+ * @since v11.6.0
590
+ */
591
+ type: KeyObjectType;
592
+ }
593
+ type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm";
594
+ type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm";
595
+ type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb";
596
+ type CipherChaCha20Poly1305Types = "chacha20-poly1305";
597
+ type BinaryLike = string | ArrayBufferLike | NodeJS.ArrayBufferView;
598
+ type KeyLike = BinaryLike | KeyObject;
599
+ interface CipherCCMOptions extends TransformOptions {
600
+ authTagLength: number;
601
+ }
602
+ interface CipherGCMOptions extends TransformOptions {
603
+ authTagLength?: number | undefined;
604
+ }
605
+ interface CipherOCBOptions extends TransformOptions {
606
+ authTagLength: number;
607
+ }
608
+ interface CipherChaCha20Poly1305Options extends TransformOptions {
609
+ authTagLength?: number | undefined;
610
+ }
611
+ /**
612
+ * Creates and returns a `Cipher` object, with the given `algorithm`, `key` and
613
+ * initialization vector (`iv`).
614
+ *
615
+ * The `options` argument controls stream behavior and is optional except when a
616
+ * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the`authTagLength` option is required and specifies the length of the
617
+ * authentication tag in bytes, see `CCM mode`. In GCM mode, the `authTagLength`option is not required but can be used to set the length of the authentication
618
+ * tag that will be returned by `getAuthTag()` and defaults to 16 bytes.
619
+ * For `chacha20-poly1305`, the `authTagLength` option defaults to 16 bytes.
620
+ *
621
+ * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
622
+ * recent OpenSSL releases, `openssl list -cipher-algorithms` will
623
+ * display the available cipher algorithms.
624
+ *
625
+ * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded
626
+ * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be
627
+ * a `KeyObject` of type `secret`. If the cipher does not need
628
+ * an initialization vector, `iv` may be `null`.
629
+ *
630
+ * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`.
631
+ *
632
+ * Initialization vectors should be unpredictable and unique; ideally, they will be
633
+ * cryptographically random. They do not have to be secret: IVs are typically just
634
+ * added to ciphertext messages unencrypted. It may sound contradictory that
635
+ * something has to be unpredictable and unique, but does not have to be secret;
636
+ * remember that an attacker must not be able to predict ahead of time what a
637
+ * given IV will be.
638
+ * @since v0.1.94
639
+ * @param options `stream.transform` options
640
+ */
641
+ function createCipheriv(
642
+ algorithm: CipherCCMTypes,
643
+ key: KeyLike,
644
+ iv: BinaryLike,
645
+ options: CipherCCMOptions,
646
+ ): CipherCCM;
647
+ function createCipheriv(
648
+ algorithm: CipherOCBTypes,
649
+ key: KeyLike,
650
+ iv: BinaryLike,
651
+ options: CipherOCBOptions,
652
+ ): CipherOCB;
653
+ function createCipheriv(
654
+ algorithm: CipherGCMTypes,
655
+ key: KeyLike,
656
+ iv: BinaryLike,
657
+ options?: CipherGCMOptions,
658
+ ): CipherGCM;
659
+ function createCipheriv(
660
+ algorithm: CipherChaCha20Poly1305Types,
661
+ key: KeyLike,
662
+ iv: BinaryLike,
663
+ options?: CipherChaCha20Poly1305Options,
664
+ ): CipherChaCha20Poly1305;
665
+ function createCipheriv(
666
+ algorithm: string,
667
+ key: KeyLike,
668
+ iv: BinaryLike | null,
669
+ options?: TransformOptions,
670
+ ): Cipheriv;
671
+ /**
672
+ * Instances of the `Cipheriv` class are used to encrypt data. The class can be
673
+ * used in one of two ways:
674
+ *
675
+ * * As a `stream` that is both readable and writable, where plain unencrypted
676
+ * data is written to produce encrypted data on the readable side, or
677
+ * * Using the `cipher.update()` and `cipher.final()` methods to produce
678
+ * the encrypted data.
679
+ *
680
+ * The {@link createCipheriv} method is
681
+ * used to create `Cipheriv` instances. `Cipheriv` objects are not to be created
682
+ * directly using the `new` keyword.
683
+ *
684
+ * Example: Using `Cipheriv` objects as streams:
685
+ *
686
+ * ```js
687
+ * const {
688
+ * scrypt,
689
+ * randomFill,
690
+ * createCipheriv,
691
+ * } = await import('node:crypto');
692
+ *
693
+ * const algorithm = 'aes-192-cbc';
694
+ * const password = 'Password used to generate key';
695
+ *
696
+ * // First, we'll generate the key. The key length is dependent on the algorithm.
697
+ * // In this case for aes192, it is 24 bytes (192 bits).
698
+ * scrypt(password, 'salt', 24, (err, key) => {
699
+ * if (err) throw err;
700
+ * // Then, we'll generate a random initialization vector
701
+ * randomFill(new Uint8Array(16), (err, iv) => {
702
+ * if (err) throw err;
703
+ *
704
+ * // Once we have the key and iv, we can create and use the cipher...
705
+ * const cipher = createCipheriv(algorithm, key, iv);
706
+ *
707
+ * let encrypted = '';
708
+ * cipher.setEncoding('hex');
709
+ *
710
+ * cipher.on('data', (chunk) => encrypted += chunk);
711
+ * cipher.on('end', () => console.log(encrypted));
712
+ *
713
+ * cipher.write('some clear text data');
714
+ * cipher.end();
715
+ * });
716
+ * });
717
+ * ```
718
+ *
719
+ * Example: Using `Cipheriv` and piped streams:
720
+ *
721
+ * ```js
722
+ * import {
723
+ * createReadStream,
724
+ * createWriteStream,
725
+ * } from 'node:fs';
726
+ *
727
+ * import {
728
+ * pipeline,
729
+ * } from 'node:stream';
730
+ *
731
+ * const {
732
+ * scrypt,
733
+ * randomFill,
734
+ * createCipheriv,
735
+ * } = await import('node:crypto');
736
+ *
737
+ * const algorithm = 'aes-192-cbc';
738
+ * const password = 'Password used to generate key';
739
+ *
740
+ * // First, we'll generate the key. The key length is dependent on the algorithm.
741
+ * // In this case for aes192, it is 24 bytes (192 bits).
742
+ * scrypt(password, 'salt', 24, (err, key) => {
743
+ * if (err) throw err;
744
+ * // Then, we'll generate a random initialization vector
745
+ * randomFill(new Uint8Array(16), (err, iv) => {
746
+ * if (err) throw err;
747
+ *
748
+ * const cipher = createCipheriv(algorithm, key, iv);
749
+ *
750
+ * const input = createReadStream('test.js');
751
+ * const output = createWriteStream('test.enc');
752
+ *
753
+ * pipeline(input, cipher, output, (err) => {
754
+ * if (err) throw err;
755
+ * });
756
+ * });
757
+ * });
758
+ * ```
759
+ *
760
+ * Example: Using the `cipher.update()` and `cipher.final()` methods:
761
+ *
762
+ * ```js
763
+ * const {
764
+ * scrypt,
765
+ * randomFill,
766
+ * createCipheriv,
767
+ * } = await import('node:crypto');
768
+ *
769
+ * const algorithm = 'aes-192-cbc';
770
+ * const password = 'Password used to generate key';
771
+ *
772
+ * // First, we'll generate the key. The key length is dependent on the algorithm.
773
+ * // In this case for aes192, it is 24 bytes (192 bits).
774
+ * scrypt(password, 'salt', 24, (err, key) => {
775
+ * if (err) throw err;
776
+ * // Then, we'll generate a random initialization vector
777
+ * randomFill(new Uint8Array(16), (err, iv) => {
778
+ * if (err) throw err;
779
+ *
780
+ * const cipher = createCipheriv(algorithm, key, iv);
781
+ *
782
+ * let encrypted = cipher.update('some clear text data', 'utf8', 'hex');
783
+ * encrypted += cipher.final('hex');
784
+ * console.log(encrypted);
785
+ * });
786
+ * });
787
+ * ```
788
+ * @since v0.1.94
789
+ */
790
+ class Cipheriv extends Transform {
791
+ private constructor();
792
+ /**
793
+ * Updates the cipher with `data`. If the `inputEncoding` argument is given,
794
+ * the `data`argument is a string using the specified encoding. If the `inputEncoding`argument is not given, `data` must be a `Buffer`, `TypedArray`, or `DataView`. If `data` is a `Buffer`,
795
+ * `TypedArray`, or `DataView`, then `inputEncoding` is ignored.
796
+ *
797
+ * The `outputEncoding` specifies the output format of the enciphered
798
+ * data. If the `outputEncoding`is specified, a string using the specified encoding is returned. If no`outputEncoding` is provided, a `Buffer` is returned.
799
+ *
800
+ * The `cipher.update()` method can be called multiple times with new data until `cipher.final()` is called. Calling `cipher.update()` after `cipher.final()` will result in an error being
801
+ * thrown.
802
+ * @since v0.1.94
803
+ * @param inputEncoding The `encoding` of the data.
804
+ * @param outputEncoding The `encoding` of the return value.
805
+ */
806
+ update(data: string | NodeJS.ArrayBufferView, inputEncoding?: BufferEncoding): NonSharedBuffer;
807
+ update(
808
+ data: string | NodeJS.ArrayBufferView,
809
+ inputEncoding: BufferEncoding | null | undefined,
810
+ outputEncoding: BufferEncoding,
811
+ ): string;
812
+ /**
813
+ * Once the `cipher.final()` method has been called, the `Cipheriv` object can no
814
+ * longer be used to encrypt data. Attempts to call `cipher.final()` more than
815
+ * once will result in an error being thrown.
816
+ * @since v0.1.94
817
+ * @param outputEncoding The `encoding` of the return value.
818
+ * @return Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
819
+ */
820
+ final(): NonSharedBuffer;
821
+ final(outputEncoding: BufferEncoding): string;
822
+ /**
823
+ * When using block encryption algorithms, the `Cipheriv` class will automatically
824
+ * add padding to the input data to the appropriate block size. To disable the
825
+ * default padding call `cipher.setAutoPadding(false)`.
826
+ *
827
+ * When `autoPadding` is `false`, the length of the entire input data must be a
828
+ * multiple of the cipher's block size or `cipher.final()` will throw an error.
829
+ * Disabling automatic padding is useful for non-standard padding, for instance
830
+ * using `0x0` instead of PKCS padding.
831
+ *
832
+ * The `cipher.setAutoPadding()` method must be called before `cipher.final()`.
833
+ * @since v0.7.1
834
+ * @param [autoPadding=true]
835
+ * @return for method chaining.
836
+ */
837
+ setAutoPadding(autoPadding?: boolean): this;
838
+ }
839
+ interface CipherAEADMethods {
840
+ getAuthTag(): NonSharedBuffer;
841
+ setAAD(buffer: BinaryLike, options?: {
842
+ plaintextLength?: number | undefined;
843
+ encoding?: BufferEncoding | undefined;
844
+ }): this;
845
+ }
846
+ interface CipherCCM extends Cipheriv, CipherAEADMethods {
847
+ setAAD(buffer: BinaryLike, options: {
848
+ plaintextLength: number;
849
+ encoding?: BufferEncoding | undefined;
850
+ }): this;
851
+ }
852
+ interface CipherGCM extends Cipheriv, CipherAEADMethods {}
853
+ interface CipherOCB extends Cipheriv, CipherAEADMethods {}
854
+ interface CipherChaCha20Poly1305 extends Cipheriv, CipherAEADMethods {}
855
+ /**
856
+ * Creates and returns a `Decipheriv` object that uses the given `algorithm`, `key` and initialization vector (`iv`).
857
+ *
858
+ * The `options` argument controls stream behavior and is optional except when a
859
+ * cipher in CCM or OCB mode (e.g. `'aes-128-ccm'`) is used. In that case, the
860
+ * `authTagLength` option is required and specifies the length of the
861
+ * authentication tag in bytes, see [CCM mode](https://nodejs.org/docs/latest-v26.x/api/crypto.html#ccm-mode).
862
+ * For AES-GCM and `chacha20-poly1305`, the `authTagLength` option defaults to 16
863
+ * bytes and must be set to a different value if a different length is used.
864
+ *
865
+ * The `algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
866
+ * recent OpenSSL releases, `openssl list -cipher-algorithms` will
867
+ * display the available cipher algorithms.
868
+ *
869
+ * The `key` is the raw key used by the `algorithm` and `iv` is an [initialization vector](https://en.wikipedia.org/wiki/Initialization_vector). Both arguments must be `'utf8'` encoded
870
+ * strings,`Buffers`, `TypedArray`, or `DataView`s. The `key` may optionally be
871
+ * a `KeyObject` of type `secret`. If the cipher does not need
872
+ * an initialization vector, `iv` may be `null`.
873
+ *
874
+ * When passing strings for `key` or `iv`, please consider `caveats when using strings as inputs to cryptographic APIs`.
875
+ *
876
+ * Initialization vectors should be unpredictable and unique; ideally, they will be
877
+ * cryptographically random. They do not have to be secret: IVs are typically just
878
+ * added to ciphertext messages unencrypted. It may sound contradictory that
879
+ * something has to be unpredictable and unique, but does not have to be secret;
880
+ * remember that an attacker must not be able to predict ahead of time what a given
881
+ * IV will be.
882
+ * @since v0.1.94
883
+ * @param options `stream.transform` options
884
+ */
885
+ function createDecipheriv(
886
+ algorithm: CipherCCMTypes,
887
+ key: KeyLike,
888
+ iv: BinaryLike,
889
+ options: CipherCCMOptions,
890
+ ): DecipherCCM;
891
+ function createDecipheriv(
892
+ algorithm: CipherOCBTypes,
893
+ key: KeyLike,
894
+ iv: BinaryLike,
895
+ options: CipherOCBOptions,
896
+ ): DecipherOCB;
897
+ function createDecipheriv(
898
+ algorithm: CipherGCMTypes,
899
+ key: KeyLike,
900
+ iv: BinaryLike,
901
+ options?: CipherGCMOptions,
902
+ ): DecipherGCM;
903
+ function createDecipheriv(
904
+ algorithm: CipherChaCha20Poly1305Types,
905
+ key: KeyLike,
906
+ iv: BinaryLike,
907
+ options?: CipherChaCha20Poly1305Options,
908
+ ): DecipherChaCha20Poly1305;
909
+ function createDecipheriv(
910
+ algorithm: string,
911
+ key: KeyLike,
912
+ iv: BinaryLike | null,
913
+ options?: TransformOptions,
914
+ ): Decipheriv;
915
+ /**
916
+ * Instances of the `Decipheriv` class are used to decrypt data. The class can be
917
+ * used in one of two ways:
918
+ *
919
+ * * As a `stream` that is both readable and writable, where plain encrypted
920
+ * data is written to produce unencrypted data on the readable side, or
921
+ * * Using the `decipher.update()` and `decipher.final()` methods to
922
+ * produce the unencrypted data.
923
+ *
924
+ * The {@link createDecipheriv} method is
925
+ * used to create `Decipheriv` instances. `Decipheriv` objects are not to be created
926
+ * directly using the `new` keyword.
927
+ *
928
+ * Example: Using `Decipheriv` objects as streams:
929
+ *
930
+ * ```js
931
+ * import { Buffer } from 'node:buffer';
932
+ * const {
933
+ * scryptSync,
934
+ * createDecipheriv,
935
+ * } = await import('node:crypto');
936
+ *
937
+ * const algorithm = 'aes-192-cbc';
938
+ * const password = 'Password used to generate key';
939
+ * // Key length is dependent on the algorithm. In this case for aes192, it is
940
+ * // 24 bytes (192 bits).
941
+ * // Use the async `crypto.scrypt()` instead.
942
+ * const key = scryptSync(password, 'salt', 24);
943
+ * // The IV is usually passed along with the ciphertext.
944
+ * const iv = Buffer.alloc(16, 0); // Initialization vector.
945
+ *
946
+ * const decipher = createDecipheriv(algorithm, key, iv);
947
+ *
948
+ * let decrypted = '';
949
+ * decipher.on('readable', () => {
950
+ * let chunk;
951
+ * while (null !== (chunk = decipher.read())) {
952
+ * decrypted += chunk.toString('utf8');
953
+ * }
954
+ * });
955
+ * decipher.on('end', () => {
956
+ * console.log(decrypted);
957
+ * // Prints: some clear text data
958
+ * });
959
+ *
960
+ * // Encrypted with same algorithm, key and iv.
961
+ * const encrypted =
962
+ * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa';
963
+ * decipher.write(encrypted, 'hex');
964
+ * decipher.end();
965
+ * ```
966
+ *
967
+ * Example: Using `Decipheriv` and piped streams:
968
+ *
969
+ * ```js
970
+ * import {
971
+ * createReadStream,
972
+ * createWriteStream,
973
+ * } from 'node:fs';
974
+ * import { Buffer } from 'node:buffer';
975
+ * const {
976
+ * scryptSync,
977
+ * createDecipheriv,
978
+ * } = await import('node:crypto');
979
+ *
980
+ * const algorithm = 'aes-192-cbc';
981
+ * const password = 'Password used to generate key';
982
+ * // Use the async `crypto.scrypt()` instead.
983
+ * const key = scryptSync(password, 'salt', 24);
984
+ * // The IV is usually passed along with the ciphertext.
985
+ * const iv = Buffer.alloc(16, 0); // Initialization vector.
986
+ *
987
+ * const decipher = createDecipheriv(algorithm, key, iv);
988
+ *
989
+ * const input = createReadStream('test.enc');
990
+ * const output = createWriteStream('test.js');
991
+ *
992
+ * input.pipe(decipher).pipe(output);
993
+ * ```
994
+ *
995
+ * Example: Using the `decipher.update()` and `decipher.final()` methods:
996
+ *
997
+ * ```js
998
+ * import { Buffer } from 'node:buffer';
999
+ * const {
1000
+ * scryptSync,
1001
+ * createDecipheriv,
1002
+ * } = await import('node:crypto');
1003
+ *
1004
+ * const algorithm = 'aes-192-cbc';
1005
+ * const password = 'Password used to generate key';
1006
+ * // Use the async `crypto.scrypt()` instead.
1007
+ * const key = scryptSync(password, 'salt', 24);
1008
+ * // The IV is usually passed along with the ciphertext.
1009
+ * const iv = Buffer.alloc(16, 0); // Initialization vector.
1010
+ *
1011
+ * const decipher = createDecipheriv(algorithm, key, iv);
1012
+ *
1013
+ * // Encrypted using same algorithm, key and iv.
1014
+ * const encrypted =
1015
+ * 'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa';
1016
+ * let decrypted = decipher.update(encrypted, 'hex', 'utf8');
1017
+ * decrypted += decipher.final('utf8');
1018
+ * console.log(decrypted);
1019
+ * // Prints: some clear text data
1020
+ * ```
1021
+ * @since v0.1.94
1022
+ */
1023
+ class Decipheriv extends Transform {
1024
+ private constructor();
1025
+ /**
1026
+ * Updates the decipher with `data`. If the `inputEncoding` argument is given,
1027
+ * the `data` argument is a string using the specified encoding. If the `inputEncoding` argument is not given, `data` must be a `Buffer`. If `data` is a `Buffer` then `inputEncoding` is
1028
+ * ignored.
1029
+ *
1030
+ * The `outputEncoding` specifies the output format of the enciphered
1031
+ * data. If the `outputEncoding` is specified, a string using the specified encoding is returned. If no `outputEncoding` is provided, a `Buffer` is returned.
1032
+ *
1033
+ * The `decipher.update()` method can be called multiple times with new data until `decipher.final()` is called. Calling `decipher.update()` after `decipher.final()` will result in an error
1034
+ * being thrown.
1035
+ * @since v0.1.94
1036
+ * @param inputEncoding The `encoding` of the `data` string.
1037
+ * @param outputEncoding The `encoding` of the return value.
1038
+ */
1039
+ update(data: string | NodeJS.ArrayBufferView, inputEncoding?: BufferEncoding): NonSharedBuffer;
1040
+ update(
1041
+ data: string | NodeJS.ArrayBufferView,
1042
+ inputEncoding: BufferEncoding | null | undefined,
1043
+ outputEncoding: BufferEncoding,
1044
+ ): string;
1045
+ /**
1046
+ * Once the `decipher.final()` method has been called, the `Decipheriv` object can
1047
+ * no longer be used to decrypt data. Attempts to call `decipher.final()` more
1048
+ * than once will result in an error being thrown.
1049
+ * @since v0.1.94
1050
+ * @param outputEncoding The `encoding` of the return value.
1051
+ * @return Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a {@link Buffer} is returned.
1052
+ */
1053
+ final(): NonSharedBuffer;
1054
+ final(outputEncoding: BufferEncoding): string;
1055
+ /**
1056
+ * When data has been encrypted without standard block padding, calling `decipher.setAutoPadding(false)` will disable automatic padding to prevent `decipher.final()` from checking for and
1057
+ * removing padding.
1058
+ *
1059
+ * Turning auto padding off will only work if the input data's length is a
1060
+ * multiple of the ciphers block size.
1061
+ *
1062
+ * The `decipher.setAutoPadding()` method must be called before `decipher.final()`.
1063
+ * @since v0.7.1
1064
+ * @param [autoPadding=true]
1065
+ * @return for method chaining.
1066
+ */
1067
+ setAutoPadding(auto_padding?: boolean): this;
1068
+ }
1069
+ interface DecipherAEADMethods {
1070
+ setAAD(
1071
+ buffer: BinaryLike,
1072
+ options?: {
1073
+ plaintextLength?: number | undefined;
1074
+ encoding?: BufferEncoding | undefined;
1075
+ },
1076
+ ): this;
1077
+ setAuthTag(buffer: BinaryLike, encoding?: BufferEncoding): this;
1078
+ }
1079
+ interface DecipherCCM extends Decipheriv, DecipherAEADMethods {
1080
+ setAAD(
1081
+ buffer: BinaryLike,
1082
+ options: {
1083
+ plaintextLength: number;
1084
+ encoding?: BufferEncoding | undefined;
1085
+ },
1086
+ ): this;
1087
+ }
1088
+ interface DecipherGCM extends Decipheriv, DecipherAEADMethods {}
1089
+ interface DecipherOCB extends Decipheriv, DecipherAEADMethods {}
1090
+ interface DecipherChaCha20Poly1305 extends Decipheriv, DecipherAEADMethods {}
1091
+ interface PrivateKeyInput {
1092
+ key: BinaryLike;
1093
+ format?: "pem" | "der" | undefined;
1094
+ type?: PrivateKeyExportType | undefined;
1095
+ passphrase?: BinaryLike | undefined;
1096
+ encoding?: BufferEncoding | undefined;
1097
+ }
1098
+ interface PublicKeyInput {
1099
+ key: BinaryLike;
1100
+ format?: "pem" | "der" | undefined;
1101
+ type?: PublicKeyExportType | undefined;
1102
+ encoding?: BufferEncoding | undefined;
1103
+ }
1104
+ interface RawPrivateKeyInput {
1105
+ key: ArrayBufferLike | NodeJS.ArrayBufferView;
1106
+ format: "raw-private" | "raw-seed";
1107
+ asymmetricKeyType: AsymmetricKeyType;
1108
+ namedCurve?: string | undefined;
1109
+ }
1110
+ interface RawPublicKeyInput {
1111
+ key: ArrayBufferLike | NodeJS.ArrayBufferView;
1112
+ format: "raw-public";
1113
+ asymmetricKeyType: AsymmetricKeyType;
1114
+ namedCurve?: string | undefined;
1115
+ }
1116
+ interface JsonWebKeyInput {
1117
+ key: webcrypto.JsonWebKey;
1118
+ format: "jwk";
1119
+ }
1120
+ interface SecretKeyOptions {
1121
+ length: number;
1122
+ }
1123
+ /**
1124
+ * Asynchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`.
1125
+ *
1126
+ * ```js
1127
+ * const {
1128
+ * generateKey,
1129
+ * } = await import('node:crypto');
1130
+ *
1131
+ * generateKey('hmac', { length: 512 }, (err, key) => {
1132
+ * if (err) throw err;
1133
+ * console.log(key.export().toString('hex')); // 46e..........620
1134
+ * });
1135
+ * ```
1136
+ *
1137
+ * The size of a generated HMAC key should not exceed the block size of the
1138
+ * underlying hash function. See {@link createHmac} for more information.
1139
+ * @since v15.0.0
1140
+ * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
1141
+ */
1142
+ function generateKey(
1143
+ type: "hmac" | "aes",
1144
+ options: SecretKeyOptions,
1145
+ callback: (err: Error | null, key: KeyObject) => void,
1146
+ ): void;
1147
+ /**
1148
+ * Synchronously generates a new random secret key of the given `length`. The `type` will determine which validations will be performed on the `length`.
1149
+ *
1150
+ * ```js
1151
+ * const {
1152
+ * generateKeySync,
1153
+ * } = await import('node:crypto');
1154
+ *
1155
+ * const key = generateKeySync('hmac', { length: 512 });
1156
+ * console.log(key.export().toString('hex')); // e89..........41e
1157
+ * ```
1158
+ *
1159
+ * The size of a generated HMAC key should not exceed the block size of the
1160
+ * underlying hash function. See {@link createHmac} for more information.
1161
+ * @since v15.0.0
1162
+ * @param type The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.
1163
+ */
1164
+ function generateKeySync(type: "hmac" | "aes", options: SecretKeyOptions): KeyObject;
1165
+ /**
1166
+ * Creates and returns a new key object containing a private key. If `key` is a
1167
+ * string or `Buffer`, `format` is assumed to be `'pem'`; otherwise, `key` must be an object with the properties described above.
1168
+ *
1169
+ * If the private key is encrypted, a `passphrase` must be specified. The length
1170
+ * of the passphrase is limited to 1024 bytes.
1171
+ * @since v11.6.0
1172
+ */
1173
+ function createPrivateKey(key: PrivateKeyInput | RawPrivateKeyInput | JsonWebKeyInput | BinaryLike): KeyObject;
1174
+ /**
1175
+ * Creates and returns a new key object containing a public key. If `key` is a
1176
+ * string or `Buffer`, `format` is assumed to be `'pem'`; if `key` is a `KeyObject` with type `'private'`, the public key is derived from the given private key;
1177
+ * otherwise, `key` must be an object with the properties described above.
1178
+ *
1179
+ * If the format is `'pem'`, the `'key'` may also be an X.509 certificate.
1180
+ *
1181
+ * Because public keys can be derived from private keys, a private key may be
1182
+ * passed instead of a public key. In that case, this function behaves as if {@link createPrivateKey} had been called, except that the type of the
1183
+ * returned `KeyObject` will be `'public'` and that the private key cannot be
1184
+ * extracted from the returned `KeyObject`. Similarly, if a `KeyObject` with type `'private'` is given, a new `KeyObject` with type `'public'` will be returned
1185
+ * and it will be impossible to extract the private key from the returned object.
1186
+ * @since v11.6.0
1187
+ */
1188
+ function createPublicKey(key: PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput | BinaryLike): KeyObject;
1189
+ /**
1190
+ * Creates and returns a new key object containing a secret key for symmetric
1191
+ * encryption or `Hmac`.
1192
+ * @since v11.6.0
1193
+ * @param encoding The string encoding when `key` is a string.
1194
+ */
1195
+ function createSecretKey(key: BinaryLike, encoding?: BufferEncoding): KeyObject;
1196
+ /**
1197
+ * Creates and returns a `Sign` object that uses the given `algorithm`. Use {@link getHashes} to obtain the names of the available digest algorithms.
1198
+ * Optional `options` argument controls the `stream.Writable` behavior.
1199
+ *
1200
+ * In some cases, a `Sign` instance can be created using the name of a signature
1201
+ * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use
1202
+ * the corresponding digest algorithm. This does not work for all signature
1203
+ * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest
1204
+ * algorithm names.
1205
+ * @since v0.1.92
1206
+ * @param options `stream.Writable` options
1207
+ */
1208
+ function createSign(algorithm: string, options?: WritableOptions): Sign;
1209
+ type DSAEncoding = "der" | "ieee-p1363";
1210
+ interface SigningOptions {
1211
+ padding?: number | undefined;
1212
+ saltLength?: number | undefined;
1213
+ dsaEncoding?: DSAEncoding | undefined;
1214
+ context?: NodeJS.ArrayBufferView | undefined;
1215
+ }
1216
+ interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
1217
+ interface SignRawPrivateKeyInput extends RawPrivateKeyInput, SigningOptions {}
1218
+ interface SignJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
1219
+ interface SignKeyObjectInput extends SigningOptions {
1220
+ key: KeyObject;
1221
+ }
1222
+ interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {}
1223
+ interface VerifyRawPublicKeyInput extends RawPublicKeyInput, SigningOptions {}
1224
+ interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {}
1225
+ interface VerifyKeyObjectInput extends SigningOptions {
1226
+ key: KeyObject;
1227
+ }
1228
+ /**
1229
+ * The `Sign` class is a utility for generating signatures. It can be used in one
1230
+ * of two ways:
1231
+ *
1232
+ * * As a writable `stream`, where data to be signed is written and the `sign.sign()` method is used to generate and return the signature, or
1233
+ * * Using the `sign.update()` and `sign.sign()` methods to produce the
1234
+ * signature.
1235
+ *
1236
+ * The {@link createSign} method is used to create `Sign` instances. The
1237
+ * argument is the string name of the hash function to use. `Sign` objects are not
1238
+ * to be created directly using the `new` keyword.
1239
+ *
1240
+ * Example: Using `Sign` and `Verify` objects as streams:
1241
+ *
1242
+ * ```js
1243
+ * const {
1244
+ * generateKeyPairSync,
1245
+ * createSign,
1246
+ * createVerify,
1247
+ * } = await import('node:crypto');
1248
+ *
1249
+ * const { privateKey, publicKey } = generateKeyPairSync('ec', {
1250
+ * namedCurve: 'sect239k1',
1251
+ * });
1252
+ *
1253
+ * const sign = createSign('SHA256');
1254
+ * sign.write('some data to sign');
1255
+ * sign.end();
1256
+ * const signature = sign.sign(privateKey, 'hex');
1257
+ *
1258
+ * const verify = createVerify('SHA256');
1259
+ * verify.write('some data to sign');
1260
+ * verify.end();
1261
+ * console.log(verify.verify(publicKey, signature, 'hex'));
1262
+ * // Prints: true
1263
+ * ```
1264
+ *
1265
+ * Example: Using the `sign.update()` and `verify.update()` methods:
1266
+ *
1267
+ * ```js
1268
+ * const {
1269
+ * generateKeyPairSync,
1270
+ * createSign,
1271
+ * createVerify,
1272
+ * } = await import('node:crypto');
1273
+ *
1274
+ * const { privateKey, publicKey } = generateKeyPairSync('rsa', {
1275
+ * modulusLength: 2048,
1276
+ * });
1277
+ *
1278
+ * const sign = createSign('SHA256');
1279
+ * sign.update('some data to sign');
1280
+ * sign.end();
1281
+ * const signature = sign.sign(privateKey);
1282
+ *
1283
+ * const verify = createVerify('SHA256');
1284
+ * verify.update('some data to sign');
1285
+ * verify.end();
1286
+ * console.log(verify.verify(publicKey, signature));
1287
+ * // Prints: true
1288
+ * ```
1289
+ * @since v0.1.92
1290
+ */
1291
+ class Sign extends Writable {
1292
+ private constructor();
1293
+ /**
1294
+ * Updates the `Sign` content with the given `data`, the encoding of which
1295
+ * is given in `inputEncoding`.
1296
+ * If `encoding` is not provided, and the `data` is a string, an
1297
+ * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or`DataView`, then `inputEncoding` is ignored.
1298
+ *
1299
+ * This can be called many times with new data as it is streamed.
1300
+ * @since v0.1.92
1301
+ * @param inputEncoding The `encoding` of the `data` string.
1302
+ */
1303
+ update(data: string | NodeJS.ArrayBufferView, inputEncoding?: BufferEncoding): this;
1304
+ /**
1305
+ * Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`.
1306
+ *
1307
+ * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an
1308
+ * object, the following additional properties can be passed:
1309
+ *
1310
+ * If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned.
1311
+ *
1312
+ * The `Sign` object can not be again used after `sign.sign()` method has been
1313
+ * called. Multiple calls to `sign.sign()` will result in an error being thrown.
1314
+ * @since v0.1.92
1315
+ */
1316
+ sign(
1317
+ privateKey:
1318
+ | KeyLike
1319
+ | SignKeyObjectInput
1320
+ | SignPrivateKeyInput
1321
+ | SignRawPrivateKeyInput
1322
+ | SignJsonWebKeyInput,
1323
+ ): NonSharedBuffer;
1324
+ sign(
1325
+ privateKey:
1326
+ | KeyLike
1327
+ | SignKeyObjectInput
1328
+ | SignPrivateKeyInput
1329
+ | SignRawPrivateKeyInput
1330
+ | SignJsonWebKeyInput,
1331
+ outputFormat: BufferEncoding,
1332
+ ): string;
1333
+ }
1334
+ /**
1335
+ * Creates and returns a `Verify` object that uses the given algorithm.
1336
+ * Use {@link getHashes} to obtain an array of names of the available
1337
+ * signing algorithms. Optional `options` argument controls the `stream.Writable` behavior.
1338
+ *
1339
+ * In some cases, a `Verify` instance can be created using the name of a signature
1340
+ * algorithm, such as `'RSA-SHA256'`, instead of a digest algorithm. This will use
1341
+ * the corresponding digest algorithm. This does not work for all signature
1342
+ * algorithms, such as `'ecdsa-with-SHA256'`, so it is best to always use digest
1343
+ * algorithm names.
1344
+ * @since v0.1.92
1345
+ * @param options `stream.Writable` options
1346
+ */
1347
+ function createVerify(algorithm: string, options?: WritableOptions): Verify;
1348
+ /**
1349
+ * The `Verify` class is a utility for verifying signatures. It can be used in one
1350
+ * of two ways:
1351
+ *
1352
+ * * As a writable `stream` where written data is used to validate against the
1353
+ * supplied signature, or
1354
+ * * Using the `verify.update()` and `verify.verify()` methods to verify
1355
+ * the signature.
1356
+ *
1357
+ * The {@link createVerify} method is used to create `Verify` instances. `Verify` objects are not to be created directly using the `new` keyword.
1358
+ *
1359
+ * See `Sign` for examples.
1360
+ * @since v0.1.92
1361
+ */
1362
+ class Verify extends Writable {
1363
+ private constructor();
1364
+ /**
1365
+ * Updates the `Verify` content with the given `data`, the encoding of which
1366
+ * is given in `inputEncoding`.
1367
+ * If `inputEncoding` is not provided, and the `data` is a string, an
1368
+ * encoding of `'utf8'` is enforced. If `data` is a `Buffer`, `TypedArray`, or `DataView`, then `inputEncoding` is ignored.
1369
+ *
1370
+ * This can be called many times with new data as it is streamed.
1371
+ * @since v0.1.92
1372
+ * @param inputEncoding The `encoding` of the `data` string.
1373
+ */
1374
+ update(data: string | NodeJS.ArrayBufferView, inputEncoding?: BufferEncoding): Verify;
1375
+ /**
1376
+ * Verifies the provided data using the given `object` and `signature`.
1377
+ *
1378
+ * If `object` is not a `KeyObject`, this function behaves as if `object` had been passed to {@link createPublicKey}. If it is an
1379
+ * object, the following additional properties can be passed:
1380
+ *
1381
+ * The `signature` argument is the previously calculated signature for the data, in
1382
+ * the `signatureEncoding`.
1383
+ * If a `signatureEncoding` is specified, the `signature` is expected to be a
1384
+ * string; otherwise `signature` is expected to be a `Buffer`, `TypedArray`, or `DataView`.
1385
+ *
1386
+ * The `verify` object can not be used again after `verify.verify()` has been
1387
+ * called. Multiple calls to `verify.verify()` will result in an error being
1388
+ * thrown.
1389
+ *
1390
+ * Because public keys can be derived from private keys, a private key may
1391
+ * be passed instead of a public key.
1392
+ * @since v0.1.92
1393
+ */
1394
+ verify(
1395
+ object:
1396
+ | KeyLike
1397
+ | VerifyKeyObjectInput
1398
+ | VerifyPublicKeyInput
1399
+ | VerifyRawPublicKeyInput
1400
+ | VerifyJsonWebKeyInput,
1401
+ signature: BinaryLike,
1402
+ signatureEncoding?: BufferEncoding,
1403
+ ): boolean;
1404
+ }
1405
+ /**
1406
+ * Creates a `DiffieHellman` key exchange object using the supplied `prime` and an
1407
+ * optional specific `generator`.
1408
+ *
1409
+ * The `generator` argument can be a number, string, or `Buffer`. If `generator` is not specified, the value `2` is used.
1410
+ *
1411
+ * If `primeEncoding` is specified, `prime` is expected to be a string; otherwise
1412
+ * a `Buffer`, `TypedArray`, or `DataView` is expected.
1413
+ *
1414
+ * If `generatorEncoding` is specified, `generator` is expected to be a string;
1415
+ * otherwise a number, `Buffer`, `TypedArray`, or `DataView` is expected.
1416
+ * @since v0.11.12
1417
+ * @param primeEncoding The `encoding` of the `prime` string.
1418
+ * @param [generator=2]
1419
+ * @param generatorEncoding The `encoding` of the `generator` string.
1420
+ */
1421
+ function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman;
1422
+ function createDiffieHellman(
1423
+ prime: BinaryLike,
1424
+ primeEncoding?: BufferEncoding,
1425
+ generator?: number | BinaryLike,
1426
+ generatorEncoding?: BufferEncoding,
1427
+ ): DiffieHellman;
1428
+ function createDiffieHellman(
1429
+ prime: BinaryLike,
1430
+ generator: number | BinaryLike,
1431
+ generatorEncoding?: BufferEncoding,
1432
+ ): DiffieHellman;
1433
+ /**
1434
+ * The `DiffieHellman` class is a utility for creating Diffie-Hellman key
1435
+ * exchanges.
1436
+ *
1437
+ * Instances of the `DiffieHellman` class can be created using the {@link createDiffieHellman} function.
1438
+ *
1439
+ * ```js
1440
+ * import assert from 'node:assert';
1441
+ *
1442
+ * const {
1443
+ * createDiffieHellman,
1444
+ * } = await import('node:crypto');
1445
+ *
1446
+ * // Generate Alice's keys...
1447
+ * const alice = createDiffieHellman(2048);
1448
+ * const aliceKey = alice.generateKeys();
1449
+ *
1450
+ * // Generate Bob's keys...
1451
+ * const bob = createDiffieHellman(alice.getPrime(), alice.getGenerator());
1452
+ * const bobKey = bob.generateKeys();
1453
+ *
1454
+ * // Exchange and generate the secret...
1455
+ * const aliceSecret = alice.computeSecret(bobKey);
1456
+ * const bobSecret = bob.computeSecret(aliceKey);
1457
+ *
1458
+ * // OK
1459
+ * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));
1460
+ * ```
1461
+ * @since v0.5.0
1462
+ */
1463
+ class DiffieHellman {
1464
+ private constructor();
1465
+ /**
1466
+ * Generates private and public Diffie-Hellman key values unless they have been
1467
+ * generated or computed already, and returns
1468
+ * the public key in the specified `encoding`. This key should be
1469
+ * transferred to the other party.
1470
+ * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned.
1471
+ *
1472
+ * This function is a thin wrapper around [`DH_generate_key()`](https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html). In particular,
1473
+ * once a private key has been generated or set, calling this function only updates
1474
+ * the public key but does not generate a new private key.
1475
+ * @since v0.5.0
1476
+ * @param encoding The `encoding` of the return value.
1477
+ */
1478
+ generateKeys(): NonSharedBuffer;
1479
+ generateKeys(encoding: BufferEncoding): string;
1480
+ /**
1481
+ * Computes the shared secret using `otherPublicKey` as the other
1482
+ * party's public key and returns the computed shared secret. The supplied
1483
+ * key is interpreted using the specified `inputEncoding`, and secret is
1484
+ * encoded using specified `outputEncoding`.
1485
+ * If the `inputEncoding` is not
1486
+ * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`.
1487
+ *
1488
+ * If `outputEncoding` is given a string is returned; otherwise, a `Buffer` is returned.
1489
+ * @since v0.5.0
1490
+ * @param inputEncoding The `encoding` of an `otherPublicKey` string.
1491
+ * @param outputEncoding The `encoding` of the return value.
1492
+ */
1493
+ computeSecret(
1494
+ otherPublicKey: BinaryLike,
1495
+ inputEncoding?: BufferEncoding,
1496
+ ): NonSharedBuffer;
1497
+ computeSecret(
1498
+ otherPublicKey: BinaryLike,
1499
+ inputEncoding: BufferEncoding | null | undefined,
1500
+ outputEncoding: BufferEncoding,
1501
+ ): string;
1502
+ /**
1503
+ * Returns the Diffie-Hellman prime in the specified `encoding`.
1504
+ * If `encoding` is provided a string is
1505
+ * returned; otherwise a `Buffer` is returned.
1506
+ * @since v0.5.0
1507
+ * @param encoding The `encoding` of the return value.
1508
+ */
1509
+ getPrime(): NonSharedBuffer;
1510
+ getPrime(encoding: BufferEncoding): string;
1511
+ /**
1512
+ * Returns the Diffie-Hellman generator in the specified `encoding`.
1513
+ * If `encoding` is provided a string is
1514
+ * returned; otherwise a `Buffer` is returned.
1515
+ * @since v0.5.0
1516
+ * @param encoding The `encoding` of the return value.
1517
+ */
1518
+ getGenerator(): NonSharedBuffer;
1519
+ getGenerator(encoding: BufferEncoding): string;
1520
+ /**
1521
+ * Returns the Diffie-Hellman public key in the specified `encoding`.
1522
+ * If `encoding` is provided a
1523
+ * string is returned; otherwise a `Buffer` is returned.
1524
+ * @since v0.5.0
1525
+ * @param encoding The `encoding` of the return value.
1526
+ */
1527
+ getPublicKey(): NonSharedBuffer;
1528
+ getPublicKey(encoding: BufferEncoding): string;
1529
+ /**
1530
+ * Returns the Diffie-Hellman private key in the specified `encoding`.
1531
+ * If `encoding` is provided a
1532
+ * string is returned; otherwise a `Buffer` is returned.
1533
+ * @since v0.5.0
1534
+ * @param encoding The `encoding` of the return value.
1535
+ */
1536
+ getPrivateKey(): NonSharedBuffer;
1537
+ getPrivateKey(encoding: BufferEncoding): string;
1538
+ /**
1539
+ * Sets the Diffie-Hellman public key. If the `encoding` argument is provided, `publicKey` is expected
1540
+ * to be a string. If no `encoding` is provided, `publicKey` is expected
1541
+ * to be a `Buffer`, `TypedArray`, or `DataView`.
1542
+ * @since v0.5.0
1543
+ * @param encoding The `encoding` of the `publicKey` string.
1544
+ */
1545
+ setPublicKey(publicKey: BinaryLike, encoding?: BufferEncoding): void;
1546
+ /**
1547
+ * Sets the Diffie-Hellman private key. If the `encoding` argument is provided,`privateKey` is expected
1548
+ * to be a string. If no `encoding` is provided, `privateKey` is expected
1549
+ * to be a `Buffer`, `TypedArray`, or `DataView`.
1550
+ *
1551
+ * This function does not automatically compute the associated public key. Either `diffieHellman.setPublicKey()` or `diffieHellman.generateKeys()` can be
1552
+ * used to manually provide the public key or to automatically derive it.
1553
+ * @since v0.5.0
1554
+ * @param encoding The `encoding` of the `privateKey` string.
1555
+ */
1556
+ setPrivateKey(privateKey: BinaryLike, encoding?: BufferEncoding): void;
1557
+ /**
1558
+ * A bit field containing any warnings and/or errors resulting from a check
1559
+ * performed during initialization of the `DiffieHellman` object.
1560
+ *
1561
+ * The following values are valid for this property (as defined in `node:constants` module):
1562
+ *
1563
+ * * `DH_CHECK_P_NOT_SAFE_PRIME`
1564
+ * * `DH_CHECK_P_NOT_PRIME`
1565
+ * * `DH_UNABLE_TO_CHECK_GENERATOR`
1566
+ * * `DH_NOT_SUITABLE_GENERATOR`
1567
+ * @since v0.11.12
1568
+ */
1569
+ verifyError: number;
1570
+ }
1571
+ /**
1572
+ * The `DiffieHellmanGroup` class takes a well-known modp group as its argument.
1573
+ * It works the same as `DiffieHellman`, except that it does not allow changing its keys after creation.
1574
+ * In other words, it does not implement `setPublicKey()` or `setPrivateKey()` methods.
1575
+ *
1576
+ * ```js
1577
+ * const { createDiffieHellmanGroup } = await import('node:crypto');
1578
+ * const dh = createDiffieHellmanGroup('modp1');
1579
+ * ```
1580
+ * The name (e.g. `'modp1'`) is taken from [RFC 2412](https://www.rfc-editor.org/rfc/rfc2412.txt) (modp1 and 2) and [RFC 3526](https://www.rfc-editor.org/rfc/rfc3526.txt):
1581
+ * ```bash
1582
+ * $ perl -ne 'print "$1\n" if /"(modp\d+)"/' src/node_crypto_groups.h
1583
+ * modp1 # 768 bits
1584
+ * modp2 # 1024 bits
1585
+ * modp5 # 1536 bits
1586
+ * modp14 # 2048 bits
1587
+ * modp15 # etc.
1588
+ * modp16
1589
+ * modp17
1590
+ * modp18
1591
+ * ```
1592
+ * @since v0.7.5
1593
+ */
1594
+ class DiffieHellmanGroup {
1595
+ private constructor();
1596
+ }
1597
+ interface DiffieHellmanGroup extends Omit<DiffieHellman, "setPublicKey" | "setPrivateKey"> {}
1598
+ /**
1599
+ * Creates a predefined `DiffieHellmanGroup` key exchange object. The
1600
+ * supported groups are listed in the documentation for `DiffieHellmanGroup`.
1601
+ *
1602
+ * The returned object mimics the interface of objects created by {@link createDiffieHellman}, but will not allow changing
1603
+ * the keys (with `diffieHellman.setPublicKey()`, for example). The
1604
+ * advantage of using this method is that the parties do not have to
1605
+ * generate nor exchange a group modulus beforehand, saving both processor
1606
+ * and communication time.
1607
+ *
1608
+ * Example (obtaining a shared secret):
1609
+ *
1610
+ * ```js
1611
+ * const {
1612
+ * getDiffieHellman,
1613
+ * } = await import('node:crypto');
1614
+ * const alice = getDiffieHellman('modp14');
1615
+ * const bob = getDiffieHellman('modp14');
1616
+ *
1617
+ * alice.generateKeys();
1618
+ * bob.generateKeys();
1619
+ *
1620
+ * const aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex');
1621
+ * const bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex');
1622
+ *
1623
+ * // aliceSecret and bobSecret should be the same
1624
+ * console.log(aliceSecret === bobSecret);
1625
+ * ```
1626
+ * @since v0.7.5
1627
+ */
1628
+ function getDiffieHellman(groupName: string): DiffieHellmanGroup;
1629
+ /**
1630
+ * An alias for {@link getDiffieHellman}
1631
+ * @since v0.9.3
1632
+ */
1633
+ function createDiffieHellmanGroup(name: string): DiffieHellmanGroup;
1634
+ /**
1635
+ * Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2)
1636
+ * implementation. A selected HMAC digest algorithm specified by `digest` is
1637
+ * applied to derive a key of the requested byte length (`keylen`) from the `password`, `salt` and `iterations`.
1638
+ *
1639
+ * The supplied `callback` function is called with two arguments: `err` and `derivedKey`. If an error occurs while deriving the key, `err` will be set;
1640
+ * otherwise `err` will be `null`. By default, the successfully generated `derivedKey` will be passed to the callback as a `Buffer`. An error will be
1641
+ * thrown if any of the input arguments specify invalid values or types.
1642
+ *
1643
+ * The `iterations` argument must be a number set as high as possible. The
1644
+ * higher the number of iterations, the more secure the derived key will be,
1645
+ * but will take a longer amount of time to complete.
1646
+ *
1647
+ * The `salt` should be as unique as possible. It is recommended that a salt is
1648
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
1649
+ *
1650
+ * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
1651
+ *
1652
+ * ```js
1653
+ * const {
1654
+ * pbkdf2,
1655
+ * } = await import('node:crypto');
1656
+ *
1657
+ * pbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => {
1658
+ * if (err) throw err;
1659
+ * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae'
1660
+ * });
1661
+ * ```
1662
+ *
1663
+ * An array of supported digest functions can be retrieved using {@link getHashes}.
1664
+ *
1665
+ * This API uses libuv's threadpool, which can have surprising and
1666
+ * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information.
1667
+ * @since v0.5.5
1668
+ */
1669
+ function pbkdf2(
1670
+ password: BinaryLike,
1671
+ salt: BinaryLike,
1672
+ iterations: number,
1673
+ keylen: number,
1674
+ digest: string,
1675
+ callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
1676
+ ): void;
1677
+ /**
1678
+ * Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2)
1679
+ * implementation. A selected HMAC digest algorithm specified by `digest` is
1680
+ * applied to derive a key of the requested byte length (`keylen`) from the `password`, `salt` and `iterations`.
1681
+ *
1682
+ * If an error occurs an `Error` will be thrown, otherwise the derived key will be
1683
+ * returned as a `Buffer`.
1684
+ *
1685
+ * The `iterations` argument must be a number set as high as possible. The
1686
+ * higher the number of iterations, the more secure the derived key will be,
1687
+ * but will take a longer amount of time to complete.
1688
+ *
1689
+ * The `salt` should be as unique as possible. It is recommended that a salt is
1690
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
1691
+ *
1692
+ * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
1693
+ *
1694
+ * ```js
1695
+ * const {
1696
+ * pbkdf2Sync,
1697
+ * } = await import('node:crypto');
1698
+ *
1699
+ * const key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');
1700
+ * console.log(key.toString('hex')); // '3745e48...08d59ae'
1701
+ * ```
1702
+ *
1703
+ * An array of supported digest functions can be retrieved using {@link getHashes}.
1704
+ * @since v0.9.3
1705
+ */
1706
+ function pbkdf2Sync(
1707
+ password: BinaryLike,
1708
+ salt: BinaryLike,
1709
+ iterations: number,
1710
+ keylen: number,
1711
+ digest: string,
1712
+ ): NonSharedBuffer;
1713
+ /**
1714
+ * Generates cryptographically strong pseudorandom data. The `size` argument
1715
+ * is a number indicating the number of bytes to generate.
1716
+ *
1717
+ * If a `callback` function is provided, the bytes are generated asynchronously
1718
+ * and the `callback` function is invoked with two arguments: `err` and `buf`.
1719
+ * If an error occurs, `err` will be an `Error` object; otherwise it is `null`. The `buf` argument is a `Buffer` containing the generated bytes.
1720
+ *
1721
+ * ```js
1722
+ * // Asynchronous
1723
+ * const {
1724
+ * randomBytes,
1725
+ * } = await import('node:crypto');
1726
+ *
1727
+ * randomBytes(256, (err, buf) => {
1728
+ * if (err) throw err;
1729
+ * console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`);
1730
+ * });
1731
+ * ```
1732
+ *
1733
+ * If the `callback` function is not provided, the random bytes are generated
1734
+ * synchronously and returned as a `Buffer`. An error will be thrown if
1735
+ * there is a problem generating the bytes.
1736
+ *
1737
+ * ```js
1738
+ * // Synchronous
1739
+ * const {
1740
+ * randomBytes,
1741
+ * } = await import('node:crypto');
1742
+ *
1743
+ * const buf = randomBytes(256);
1744
+ * console.log(
1745
+ * `${buf.length} bytes of random data: ${buf.toString('hex')}`);
1746
+ * ```
1747
+ *
1748
+ * The `crypto.randomBytes()` method will not complete until there is
1749
+ * sufficient entropy available.
1750
+ * This should normally never take longer than a few milliseconds. The only time
1751
+ * when generating the random bytes may conceivably block for a longer period of
1752
+ * time is right after boot, when the whole system is still low on entropy.
1753
+ *
1754
+ * This API uses libuv's threadpool, which can have surprising and
1755
+ * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information.
1756
+ *
1757
+ * The asynchronous version of `crypto.randomBytes()` is carried out in a single
1758
+ * threadpool request. To minimize threadpool task length variation, partition
1759
+ * large `randomBytes` requests when doing so as part of fulfilling a client
1760
+ * request.
1761
+ * @since v0.5.8
1762
+ * @param size The number of bytes to generate. The `size` must not be larger than `2**31 - 1`.
1763
+ * @return if the `callback` function is not provided.
1764
+ */
1765
+ function randomBytes(size: number): NonSharedBuffer;
1766
+ function randomBytes(size: number, callback: (err: Error | null, buf: NonSharedBuffer) => void): void;
1767
+ function pseudoRandomBytes(size: number): NonSharedBuffer;
1768
+ function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: NonSharedBuffer) => void): void;
1769
+ /**
1770
+ * Return a random integer `n` such that `min <= n < max`. This
1771
+ * implementation avoids [modulo bias](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias).
1772
+ *
1773
+ * The range (`max - min`) must be less than 2**48. `min` and `max` must
1774
+ * be [safe integers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger).
1775
+ *
1776
+ * If the `callback` function is not provided, the random integer is
1777
+ * generated synchronously.
1778
+ *
1779
+ * ```js
1780
+ * // Asynchronous
1781
+ * const {
1782
+ * randomInt,
1783
+ * } = await import('node:crypto');
1784
+ *
1785
+ * randomInt(3, (err, n) => {
1786
+ * if (err) throw err;
1787
+ * console.log(`Random number chosen from (0, 1, 2): ${n}`);
1788
+ * });
1789
+ * ```
1790
+ *
1791
+ * ```js
1792
+ * // Synchronous
1793
+ * const {
1794
+ * randomInt,
1795
+ * } = await import('node:crypto');
1796
+ *
1797
+ * const n = randomInt(3);
1798
+ * console.log(`Random number chosen from (0, 1, 2): ${n}`);
1799
+ * ```
1800
+ *
1801
+ * ```js
1802
+ * // With `min` argument
1803
+ * const {
1804
+ * randomInt,
1805
+ * } = await import('node:crypto');
1806
+ *
1807
+ * const n = randomInt(1, 7);
1808
+ * console.log(`The dice rolled: ${n}`);
1809
+ * ```
1810
+ * @since v14.10.0, v12.19.0
1811
+ * @param min Start of random range (inclusive).
1812
+ * @param max End of random range (exclusive).
1813
+ */
1814
+ function randomInt(max: number): number;
1815
+ function randomInt(min: number, max: number): number;
1816
+ function randomInt(max: number, callback: (err: Error | null, value: number) => void): void;
1817
+ function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void;
1818
+ /**
1819
+ * Synchronous version of {@link randomFill}.
1820
+ *
1821
+ * ```js
1822
+ * import { Buffer } from 'node:buffer';
1823
+ * const { randomFillSync } = await import('node:crypto');
1824
+ *
1825
+ * const buf = Buffer.alloc(10);
1826
+ * console.log(randomFillSync(buf).toString('hex'));
1827
+ *
1828
+ * randomFillSync(buf, 5);
1829
+ * console.log(buf.toString('hex'));
1830
+ *
1831
+ * // The above is equivalent to the following:
1832
+ * randomFillSync(buf, 5, 5);
1833
+ * console.log(buf.toString('hex'));
1834
+ * ```
1835
+ *
1836
+ * Any `ArrayBuffer`, `TypedArray` or `DataView` instance may be passed as`buffer`.
1837
+ *
1838
+ * ```js
1839
+ * import { Buffer } from 'node:buffer';
1840
+ * const { randomFillSync } = await import('node:crypto');
1841
+ *
1842
+ * const a = new Uint32Array(10);
1843
+ * console.log(Buffer.from(randomFillSync(a).buffer,
1844
+ * a.byteOffset, a.byteLength).toString('hex'));
1845
+ *
1846
+ * const b = new DataView(new ArrayBuffer(10));
1847
+ * console.log(Buffer.from(randomFillSync(b).buffer,
1848
+ * b.byteOffset, b.byteLength).toString('hex'));
1849
+ *
1850
+ * const c = new ArrayBuffer(10);
1851
+ * console.log(Buffer.from(randomFillSync(c)).toString('hex'));
1852
+ * ```
1853
+ * @since v7.10.0, v6.13.0
1854
+ * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`.
1855
+ * @param [offset=0]
1856
+ * @param [size=buffer.length - offset]
1857
+ * @return The object passed as `buffer` argument.
1858
+ */
1859
+ function randomFillSync<T extends ArrayBufferLike | NodeJS.ArrayBufferView>(
1860
+ buffer: T,
1861
+ offset?: number,
1862
+ size?: number,
1863
+ ): T;
1864
+ /**
1865
+ * This function is similar to {@link randomBytes} but requires the first
1866
+ * argument to be a `Buffer` that will be filled. It also
1867
+ * requires that a callback is passed in.
1868
+ *
1869
+ * If the `callback` function is not provided, an error will be thrown.
1870
+ *
1871
+ * ```js
1872
+ * import { Buffer } from 'node:buffer';
1873
+ * const { randomFill } = await import('node:crypto');
1874
+ *
1875
+ * const buf = Buffer.alloc(10);
1876
+ * randomFill(buf, (err, buf) => {
1877
+ * if (err) throw err;
1878
+ * console.log(buf.toString('hex'));
1879
+ * });
1880
+ *
1881
+ * randomFill(buf, 5, (err, buf) => {
1882
+ * if (err) throw err;
1883
+ * console.log(buf.toString('hex'));
1884
+ * });
1885
+ *
1886
+ * // The above is equivalent to the following:
1887
+ * randomFill(buf, 5, 5, (err, buf) => {
1888
+ * if (err) throw err;
1889
+ * console.log(buf.toString('hex'));
1890
+ * });
1891
+ * ```
1892
+ *
1893
+ * Any `ArrayBuffer`, `TypedArray`, or `DataView` instance may be passed as `buffer`.
1894
+ *
1895
+ * While this includes instances of `Float32Array` and `Float64Array`, this
1896
+ * function should not be used to generate random floating-point numbers. The
1897
+ * result may contain `+Infinity`, `-Infinity`, and `NaN`, and even if the array
1898
+ * contains finite numbers only, they are not drawn from a uniform random
1899
+ * distribution and have no meaningful lower or upper bounds.
1900
+ *
1901
+ * ```js
1902
+ * import { Buffer } from 'node:buffer';
1903
+ * const { randomFill } = await import('node:crypto');
1904
+ *
1905
+ * const a = new Uint32Array(10);
1906
+ * randomFill(a, (err, buf) => {
1907
+ * if (err) throw err;
1908
+ * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)
1909
+ * .toString('hex'));
1910
+ * });
1911
+ *
1912
+ * const b = new DataView(new ArrayBuffer(10));
1913
+ * randomFill(b, (err, buf) => {
1914
+ * if (err) throw err;
1915
+ * console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)
1916
+ * .toString('hex'));
1917
+ * });
1918
+ *
1919
+ * const c = new ArrayBuffer(10);
1920
+ * randomFill(c, (err, buf) => {
1921
+ * if (err) throw err;
1922
+ * console.log(Buffer.from(buf).toString('hex'));
1923
+ * });
1924
+ * ```
1925
+ *
1926
+ * This API uses libuv's threadpool, which can have surprising and
1927
+ * negative performance implications for some applications; see the `UV_THREADPOOL_SIZE` documentation for more information.
1928
+ *
1929
+ * The asynchronous version of `crypto.randomFill()` is carried out in a single
1930
+ * threadpool request. To minimize threadpool task length variation, partition
1931
+ * large `randomFill` requests when doing so as part of fulfilling a client
1932
+ * request.
1933
+ * @since v7.10.0, v6.13.0
1934
+ * @param buffer Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`.
1935
+ * @param [offset=0]
1936
+ * @param [size=buffer.length - offset]
1937
+ * @param callback `function(err, buf) {}`.
1938
+ */
1939
+ function randomFill<T extends ArrayBufferLike | NodeJS.ArrayBufferView>(
1940
+ buffer: T,
1941
+ callback: (err: Error | null, buf: T) => void,
1942
+ ): void;
1943
+ function randomFill<T extends ArrayBufferLike | NodeJS.ArrayBufferView>(
1944
+ buffer: T,
1945
+ offset: number,
1946
+ callback: (err: Error | null, buf: T) => void,
1947
+ ): void;
1948
+ function randomFill<T extends ArrayBufferLike | NodeJS.ArrayBufferView>(
1949
+ buffer: T,
1950
+ offset: number,
1951
+ size: number,
1952
+ callback: (err: Error | null, buf: T) => void,
1953
+ ): void;
1954
+ interface ScryptOptions {
1955
+ cost?: number | undefined;
1956
+ blockSize?: number | undefined;
1957
+ parallelization?: number | undefined;
1958
+ N?: number | undefined;
1959
+ r?: number | undefined;
1960
+ p?: number | undefined;
1961
+ maxmem?: number | undefined;
1962
+ }
1963
+ /**
1964
+ * Provides an asynchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based
1965
+ * key derivation function that is designed to be expensive computationally and
1966
+ * memory-wise in order to make brute-force attacks unrewarding.
1967
+ *
1968
+ * The `salt` should be as unique as possible. It is recommended that a salt is
1969
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
1970
+ *
1971
+ * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
1972
+ *
1973
+ * The `callback` function is called with two arguments: `err` and `derivedKey`. `err` is an exception object when key derivation fails, otherwise `err` is `null`. `derivedKey` is passed to the
1974
+ * callback as a `Buffer`.
1975
+ *
1976
+ * An exception is thrown when any of the input arguments specify invalid values
1977
+ * or types.
1978
+ *
1979
+ * ```js
1980
+ * const {
1981
+ * scrypt,
1982
+ * } = await import('node:crypto');
1983
+ *
1984
+ * // Using the factory defaults.
1985
+ * scrypt('password', 'salt', 64, (err, derivedKey) => {
1986
+ * if (err) throw err;
1987
+ * console.log(derivedKey.toString('hex')); // '3745e48...08d59ae'
1988
+ * });
1989
+ * // Using a custom N parameter. Must be a power of two.
1990
+ * scrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => {
1991
+ * if (err) throw err;
1992
+ * console.log(derivedKey.toString('hex')); // '3745e48...aa39b34'
1993
+ * });
1994
+ * ```
1995
+ * @since v10.5.0
1996
+ */
1997
+ function scrypt(
1998
+ password: BinaryLike,
1999
+ salt: BinaryLike,
2000
+ keylen: number,
2001
+ callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
2002
+ ): void;
2003
+ function scrypt(
2004
+ password: BinaryLike,
2005
+ salt: BinaryLike,
2006
+ keylen: number,
2007
+ options: ScryptOptions,
2008
+ callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
2009
+ ): void;
2010
+ /**
2011
+ * Provides a synchronous [scrypt](https://en.wikipedia.org/wiki/Scrypt) implementation. Scrypt is a password-based
2012
+ * key derivation function that is designed to be expensive computationally and
2013
+ * memory-wise in order to make brute-force attacks unrewarding.
2014
+ *
2015
+ * The `salt` should be as unique as possible. It is recommended that a salt is
2016
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
2017
+ *
2018
+ * When passing strings for `password` or `salt`, please consider `caveats when using strings as inputs to cryptographic APIs`.
2019
+ *
2020
+ * An exception is thrown when key derivation fails, otherwise the derived key is
2021
+ * returned as a `Buffer`.
2022
+ *
2023
+ * An exception is thrown when any of the input arguments specify invalid values
2024
+ * or types.
2025
+ *
2026
+ * ```js
2027
+ * const {
2028
+ * scryptSync,
2029
+ * } = await import('node:crypto');
2030
+ * // Using the factory defaults.
2031
+ *
2032
+ * const key1 = scryptSync('password', 'salt', 64);
2033
+ * console.log(key1.toString('hex')); // '3745e48...08d59ae'
2034
+ * // Using a custom N parameter. Must be a power of two.
2035
+ * const key2 = scryptSync('password', 'salt', 64, { N: 1024 });
2036
+ * console.log(key2.toString('hex')); // '3745e48...aa39b34'
2037
+ * ```
2038
+ * @since v10.5.0
2039
+ */
2040
+ function scryptSync(
2041
+ password: BinaryLike,
2042
+ salt: BinaryLike,
2043
+ keylen: number,
2044
+ options?: ScryptOptions,
2045
+ ): NonSharedBuffer;
2046
+ interface PublicDecryptOptions {
2047
+ padding?: number | undefined;
2048
+ encoding?: BufferEncoding | undefined;
2049
+ }
2050
+ interface PublicDecryptPrivateKeyInput extends PrivateKeyInput, PublicDecryptOptions {}
2051
+ interface PublicDecryptPublicKeyInput extends PublicKeyInput, PublicDecryptOptions {}
2052
+ interface PublicDecryptJsonWebKeyInput extends JsonWebKeyInput, PublicDecryptOptions {}
2053
+ interface PublicDecryptKeyObjectInput extends PublicDecryptOptions {
2054
+ key: KeyObject;
2055
+ }
2056
+ interface PublicEncryptOptions extends PublicDecryptOptions {
2057
+ oaepHash?: string | undefined;
2058
+ oaepLabel?: BinaryLike | undefined;
2059
+ }
2060
+ interface PublicEncryptPrivateKeyInput extends PrivateKeyInput, PublicEncryptOptions {}
2061
+ interface PublicEncryptPublicKeyInput extends PublicKeyInput, PublicEncryptOptions {}
2062
+ interface PublicEncryptJsonWebKeyInput extends JsonWebKeyInput, PublicEncryptOptions {}
2063
+ interface PublicEncryptKeyObjectInput extends PublicEncryptOptions {
2064
+ key: KeyObject;
2065
+ }
2066
+ /**
2067
+ * Encrypts the content of `buffer` with `key` and returns a new `Buffer` with encrypted content. The returned data can be decrypted using
2068
+ * the corresponding private key, for example using {@link privateDecrypt}.
2069
+ *
2070
+ * If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an
2071
+ * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`.
2072
+ *
2073
+ * Because RSA public keys can be derived from private keys, a private key may
2074
+ * be passed instead of a public key.
2075
+ * @since v0.11.14
2076
+ */
2077
+ function publicEncrypt(
2078
+ key:
2079
+ | KeyLike
2080
+ | PublicEncryptKeyObjectInput
2081
+ | PublicEncryptPrivateKeyInput
2082
+ | PublicEncryptPublicKeyInput
2083
+ | PublicEncryptJsonWebKeyInput,
2084
+ buffer: BinaryLike,
2085
+ ): NonSharedBuffer;
2086
+ /**
2087
+ * Decrypts `buffer` with `key`.`buffer` was previously encrypted using
2088
+ * the corresponding private key, for example using {@link privateEncrypt}.
2089
+ *
2090
+ * If `key` is not a `KeyObject`, this function behaves as if `key` had been passed to {@link createPublicKey}. If it is an
2091
+ * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`.
2092
+ *
2093
+ * Because RSA public keys can be derived from private keys, a private key may
2094
+ * be passed instead of a public key.
2095
+ * @since v1.1.0
2096
+ */
2097
+ function publicDecrypt(
2098
+ key:
2099
+ | KeyLike
2100
+ | PublicDecryptKeyObjectInput
2101
+ | PublicDecryptPrivateKeyInput
2102
+ | PublicDecryptPublicKeyInput
2103
+ | PublicDecryptJsonWebKeyInput,
2104
+ buffer: BinaryLike,
2105
+ ): NonSharedBuffer;
2106
+ /**
2107
+ * Decrypts `buffer` with `privateKey`. `buffer` was previously encrypted using
2108
+ * the corresponding public key, for example using {@link publicEncrypt}.
2109
+ *
2110
+ * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an
2111
+ * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_OAEP_PADDING`.
2112
+ * @since v0.11.14
2113
+ */
2114
+ function privateDecrypt(
2115
+ privateKey:
2116
+ | KeyLike
2117
+ | PublicEncryptKeyObjectInput
2118
+ | PublicEncryptPrivateKeyInput
2119
+ | PublicEncryptJsonWebKeyInput,
2120
+ buffer: BinaryLike,
2121
+ ): NonSharedBuffer;
2122
+ /**
2123
+ * Encrypts `buffer` with `privateKey`. The returned data can be decrypted using
2124
+ * the corresponding public key, for example using {@link publicDecrypt}.
2125
+ *
2126
+ * If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to {@link createPrivateKey}. If it is an
2127
+ * object, the `padding` property can be passed. Otherwise, this function uses `RSA_PKCS1_PADDING`.
2128
+ * @since v1.1.0
2129
+ */
2130
+ function privateEncrypt(
2131
+ privateKey:
2132
+ | KeyLike
2133
+ | PublicDecryptKeyObjectInput
2134
+ | PublicDecryptPrivateKeyInput
2135
+ | PublicDecryptJsonWebKeyInput,
2136
+ buffer: BinaryLike,
2137
+ ): NonSharedBuffer;
2138
+ /**
2139
+ * ```js
2140
+ * const {
2141
+ * getCiphers,
2142
+ * } = await import('node:crypto');
2143
+ *
2144
+ * console.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...]
2145
+ * ```
2146
+ * @since v0.9.3
2147
+ * @return An array with the names of the supported cipher algorithms.
2148
+ */
2149
+ function getCiphers(): string[];
2150
+ /**
2151
+ * ```js
2152
+ * const {
2153
+ * getCurves,
2154
+ * } = await import('node:crypto');
2155
+ *
2156
+ * console.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...]
2157
+ * ```
2158
+ * @since v2.3.0
2159
+ * @return An array with the names of the supported elliptic curves.
2160
+ */
2161
+ function getCurves(): string[];
2162
+ /**
2163
+ * @since v10.0.0
2164
+ * @return `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}.
2165
+ */
2166
+ function getFips(): 1 | 0;
2167
+ /**
2168
+ * Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build.
2169
+ * Throws an error if FIPS mode is not available.
2170
+ * @since v10.0.0
2171
+ * @param bool `true` to enable FIPS mode.
2172
+ */
2173
+ function setFips(bool: boolean): void;
2174
+ /**
2175
+ * ```js
2176
+ * const {
2177
+ * getHashes,
2178
+ * } = await import('node:crypto');
2179
+ *
2180
+ * console.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...]
2181
+ * ```
2182
+ * @since v0.9.3
2183
+ * @return An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called "digest" algorithms.
2184
+ */
2185
+ function getHashes(): string[];
2186
+ type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
2187
+ /**
2188
+ * The `ECDH` class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH)
2189
+ * key exchanges.
2190
+ *
2191
+ * Instances of the `ECDH` class can be created using the {@link createECDH} function.
2192
+ *
2193
+ * ```js
2194
+ * import assert from 'node:assert';
2195
+ *
2196
+ * const {
2197
+ * createECDH,
2198
+ * } = await import('node:crypto');
2199
+ *
2200
+ * // Generate Alice's keys...
2201
+ * const alice = createECDH('secp521r1');
2202
+ * const aliceKey = alice.generateKeys();
2203
+ *
2204
+ * // Generate Bob's keys...
2205
+ * const bob = createECDH('secp521r1');
2206
+ * const bobKey = bob.generateKeys();
2207
+ *
2208
+ * // Exchange and generate the secret...
2209
+ * const aliceSecret = alice.computeSecret(bobKey);
2210
+ * const bobSecret = bob.computeSecret(aliceKey);
2211
+ *
2212
+ * assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));
2213
+ * // OK
2214
+ * ```
2215
+ * @since v0.11.14
2216
+ */
2217
+ class ECDH {
2218
+ private constructor();
2219
+ /**
2220
+ * Converts the EC Diffie-Hellman public key specified by `key` and `curve` to the
2221
+ * format specified by `format`. The `format` argument specifies point encoding
2222
+ * and can be `'compressed'`, `'uncompressed'` or `'hybrid'`. The supplied key is
2223
+ * interpreted using the specified `inputEncoding`, and the returned key is encoded
2224
+ * using the specified `outputEncoding`.
2225
+ *
2226
+ * Use {@link getCurves} to obtain a list of available curve names.
2227
+ * On recent OpenSSL releases, `openssl ecparam -list_curves` will also display
2228
+ * the name and description of each available elliptic curve.
2229
+ *
2230
+ * If `format` is not specified the point will be returned in `'uncompressed'` format.
2231
+ *
2232
+ * If the `inputEncoding` is not provided, `key` is expected to be a `Buffer`, `TypedArray`, or `DataView`.
2233
+ *
2234
+ * Example (uncompressing a key):
2235
+ *
2236
+ * ```js
2237
+ * const {
2238
+ * createECDH,
2239
+ * ECDH,
2240
+ * } = await import('node:crypto');
2241
+ *
2242
+ * const ecdh = createECDH('secp256k1');
2243
+ * ecdh.generateKeys();
2244
+ *
2245
+ * const compressedKey = ecdh.getPublicKey('hex', 'compressed');
2246
+ *
2247
+ * const uncompressedKey = ECDH.convertKey(compressedKey,
2248
+ * 'secp256k1',
2249
+ * 'hex',
2250
+ * 'hex',
2251
+ * 'uncompressed');
2252
+ *
2253
+ * // The converted key and the uncompressed public key should be the same
2254
+ * console.log(uncompressedKey === ecdh.getPublicKey('hex'));
2255
+ * ```
2256
+ * @since v10.0.0
2257
+ * @param inputEncoding The `encoding` of the `key` string.
2258
+ * @param outputEncoding The `encoding` of the return value.
2259
+ */
2260
+ static convertKey(
2261
+ key: BinaryLike,
2262
+ curve: string,
2263
+ inputEncoding?: BufferEncoding,
2264
+ outputEncoding?: null,
2265
+ format?: "uncompressed" | "compressed" | "hybrid",
2266
+ ): NonSharedBuffer;
2267
+ static convertKey(
2268
+ key: BinaryLike,
2269
+ curve: string,
2270
+ inputEncoding: BufferEncoding | null | undefined,
2271
+ outputEncoding: BufferEncoding,
2272
+ format?: "uncompressed" | "compressed" | "hybrid",
2273
+ ): string;
2274
+ /**
2275
+ * Generates private and public EC Diffie-Hellman key values, and returns
2276
+ * the public key in the specified `format` and `encoding`. This key should be
2277
+ * transferred to the other party.
2278
+ *
2279
+ * The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified, the point will be returned in`'uncompressed'` format.
2280
+ *
2281
+ * If `encoding` is provided a string is returned; otherwise a `Buffer` is returned.
2282
+ * @since v0.11.14
2283
+ * @param encoding The `encoding` of the return value.
2284
+ * @param [format='uncompressed']
2285
+ */
2286
+ generateKeys(encoding?: null, format?: ECDHKeyFormat): NonSharedBuffer;
2287
+ generateKeys(encoding: BufferEncoding, format?: ECDHKeyFormat): string;
2288
+ /**
2289
+ * Computes the shared secret using `otherPublicKey` as the other
2290
+ * party's public key and returns the computed shared secret. The supplied
2291
+ * key is interpreted using specified `inputEncoding`, and the returned secret
2292
+ * is encoded using the specified `outputEncoding`.
2293
+ * If the `inputEncoding` is not
2294
+ * provided, `otherPublicKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`.
2295
+ *
2296
+ * If `outputEncoding` is given a string will be returned; otherwise a `Buffer` is returned.
2297
+ *
2298
+ * `ecdh.computeSecret` will throw an`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY` error when `otherPublicKey` lies outside of the elliptic curve. Since `otherPublicKey` is
2299
+ * usually supplied from a remote user over an insecure network,
2300
+ * be sure to handle this exception accordingly.
2301
+ * @since v0.11.14
2302
+ * @param inputEncoding The `encoding` of the `otherPublicKey` string.
2303
+ * @param outputEncoding The `encoding` of the return value.
2304
+ */
2305
+ computeSecret(otherPublicKey: BinaryLike, inputEncoding?: BufferEncoding): NonSharedBuffer;
2306
+ computeSecret(
2307
+ otherPublicKey: BinaryLike,
2308
+ inputEncoding: BufferEncoding | null | undefined,
2309
+ outputEncoding: BufferEncoding,
2310
+ ): string;
2311
+ /**
2312
+ * If `encoding` is specified, a string is returned; otherwise a `Buffer` is
2313
+ * returned.
2314
+ * @since v0.11.14
2315
+ * @param encoding The `encoding` of the return value.
2316
+ * @return The EC Diffie-Hellman in the specified `encoding`.
2317
+ */
2318
+ getPrivateKey(): NonSharedBuffer;
2319
+ getPrivateKey(encoding: BufferEncoding): string;
2320
+ /**
2321
+ * The `format` argument specifies point encoding and can be `'compressed'` or `'uncompressed'`. If `format` is not specified the point will be returned in`'uncompressed'` format.
2322
+ *
2323
+ * If `encoding` is specified, a string is returned; otherwise a `Buffer` is
2324
+ * returned.
2325
+ * @since v0.11.14
2326
+ * @param encoding The `encoding` of the return value.
2327
+ * @param [format='uncompressed']
2328
+ * @return The EC Diffie-Hellman public key in the specified `encoding` and `format`.
2329
+ */
2330
+ getPublicKey(encoding?: null, format?: ECDHKeyFormat): NonSharedBuffer;
2331
+ getPublicKey(encoding: BufferEncoding, format?: ECDHKeyFormat): string;
2332
+ /**
2333
+ * Sets the EC Diffie-Hellman private key.
2334
+ * If `encoding` is provided, `privateKey` is expected
2335
+ * to be a string; otherwise `privateKey` is expected to be a `Buffer`, `TypedArray`, or `DataView`.
2336
+ *
2337
+ * If `privateKey` is not valid for the curve specified when the `ECDH` object was
2338
+ * created, an error is thrown. Upon setting the private key, the associated
2339
+ * public point (key) is also generated and set in the `ECDH` object.
2340
+ * @since v0.11.14
2341
+ * @param encoding The `encoding` of the `privateKey` string.
2342
+ */
2343
+ setPrivateKey(privateKey: BinaryLike, encoding?: BufferEncoding): void;
2344
+ }
2345
+ /**
2346
+ * Creates an Elliptic Curve Diffie-Hellman (`ECDH`) key exchange object using a
2347
+ * predefined curve specified by the `curveName` string. Use {@link getCurves} to obtain a list of available curve names. On recent
2348
+ * OpenSSL releases, `openssl ecparam -list_curves` will also display the name
2349
+ * and description of each available elliptic curve.
2350
+ * @since v0.11.14
2351
+ */
2352
+ function createECDH(curveName: string): ECDH;
2353
+ /**
2354
+ * This function compares the underlying bytes that represent the given `ArrayBuffer`, `TypedArray`, or `DataView` instances using a constant-time
2355
+ * algorithm.
2356
+ *
2357
+ * This function does not leak timing information that
2358
+ * would allow an attacker to guess one of the values. This is suitable for
2359
+ * comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/).
2360
+ *
2361
+ * `a` and `b` must both be `Buffer`s, `TypedArray`s, or `DataView`s, and they
2362
+ * must have the same byte length. An error is thrown if `a` and `b` have
2363
+ * different byte lengths.
2364
+ *
2365
+ * If at least one of `a` and `b` is a `TypedArray` with more than one byte per
2366
+ * entry, such as `Uint16Array`, the result will be computed using the platform
2367
+ * byte order.
2368
+ *
2369
+ * **When both of the inputs are `Float32Array`s or `Float64Array`s, this function might return unexpected results due to IEEE 754**
2370
+ * **encoding of floating-point numbers. In particular, neither `x === y` nor `Object.is(x, y)` implies that the byte representations of two floating-point**
2371
+ * **numbers `x` and `y` are equal.**
2372
+ *
2373
+ * Use of `crypto.timingSafeEqual` does not guarantee that the _surrounding_ code
2374
+ * is timing-safe. Care should be taken to ensure that the surrounding code does
2375
+ * not introduce timing vulnerabilities.
2376
+ * @since v6.6.0
2377
+ */
2378
+ function timingSafeEqual(
2379
+ a: ArrayBufferLike | NodeJS.ArrayBufferView,
2380
+ b: ArrayBufferLike | NodeJS.ArrayBufferView,
2381
+ ): boolean;
2382
+ interface DHKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {
2383
+ prime?: NodeJS.ArrayBufferView | undefined;
2384
+ primeLength?: number | undefined;
2385
+ generator?: number | undefined;
2386
+ groupName?: string | undefined;
2387
+ }
2388
+ interface DSAKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {
2389
+ modulusLength: number;
2390
+ divisorLength?: number | undefined;
2391
+ }
2392
+ interface ECKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8" | "sec1"> {
2393
+ namedCurve: string;
2394
+ paramEncoding?: "explicit" | "named" | undefined;
2395
+ }
2396
+ interface ED25519KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
2397
+ interface ED448KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
2398
+ interface MLDSAKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
2399
+ interface MLKEMKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
2400
+ interface RSAPSSKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {
2401
+ modulusLength: number;
2402
+ publicExponent?: number | undefined;
2403
+ hashAlgorithm?: string | undefined;
2404
+ mgf1HashAlgorithm?: string | undefined;
2405
+ saltLength?: string | undefined;
2406
+ }
2407
+ interface RSAKeyPairOptions extends KeyPairExportOptions<"pkcs1" | "spki", "pkcs1" | "pkcs8"> {
2408
+ modulusLength: number;
2409
+ publicExponent?: number | undefined;
2410
+ }
2411
+ interface SLHDSAKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
2412
+ interface X25519KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
2413
+ interface X448KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {}
2414
+ /**
2415
+ * Generates a new asymmetric key pair of the given `type`. See the
2416
+ * supported [asymmetric key types](https://nodejs.org/docs/latest-v26.x/api/crypto.html#asymmetric-key-types).
2417
+ *
2418
+ * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function
2419
+ * behaves as if `keyObject.export()` had been called on its result. Otherwise,
2420
+ * the respective part of the key is returned as a `KeyObject`.
2421
+ *
2422
+ * When encoding public keys, it is recommended to use `'spki'`. When encoding
2423
+ * private keys, it is recommended to use `'pkcs8'` with a strong passphrase,
2424
+ * and to keep the passphrase confidential.
2425
+ *
2426
+ * ```js
2427
+ * const {
2428
+ * generateKeyPairSync,
2429
+ * } = await import('node:crypto');
2430
+ *
2431
+ * const {
2432
+ * publicKey,
2433
+ * privateKey,
2434
+ * } = generateKeyPairSync('rsa', {
2435
+ * modulusLength: 4096,
2436
+ * publicKeyEncoding: {
2437
+ * type: 'spki',
2438
+ * format: 'pem',
2439
+ * },
2440
+ * privateKeyEncoding: {
2441
+ * type: 'pkcs8',
2442
+ * format: 'pem',
2443
+ * cipher: 'aes-256-cbc',
2444
+ * passphrase: 'top secret',
2445
+ * },
2446
+ * });
2447
+ * ```
2448
+ *
2449
+ * The return value `{ publicKey, privateKey }` represents the generated key pair.
2450
+ * When PEM encoding was selected, the respective key will be a string, otherwise
2451
+ * it will be a buffer containing the data encoded as DER.
2452
+ * @since v10.12.0
2453
+ * @param type The asymmetric key type to generate. See the
2454
+ * supported [asymmetric key types](https://nodejs.org/docs/latest-v26.x/api/crypto.html#asymmetric-key-types).
2455
+ */
2456
+ function generateKeyPairSync<T extends DHKeyPairOptions>(
2457
+ type: "dh",
2458
+ options: T,
2459
+ ): KeyPairExportResult<T>;
2460
+ function generateKeyPairSync<T extends DSAKeyPairOptions>(
2461
+ type: "dsa",
2462
+ options: T,
2463
+ ): KeyPairExportResult<T>;
2464
+ function generateKeyPairSync<T extends ECKeyPairOptions>(
2465
+ type: "ec",
2466
+ options: T,
2467
+ ): KeyPairExportResult<T>;
2468
+ function generateKeyPairSync<T extends ED25519KeyPairOptions = {}>(
2469
+ type: "ed25519",
2470
+ options?: T,
2471
+ ): KeyPairExportResult<T>;
2472
+ function generateKeyPairSync<T extends ED448KeyPairOptions = {}>(
2473
+ type: "ed448",
2474
+ options?: T,
2475
+ ): KeyPairExportResult<T>;
2476
+ function generateKeyPairSync<T extends MLDSAKeyPairOptions = {}>(
2477
+ type: MLDSAKeyType,
2478
+ options?: T,
2479
+ ): KeyPairExportResult<T>;
2480
+ function generateKeyPairSync<T extends MLKEMKeyPairOptions = {}>(
2481
+ type: MLKEMKeyType,
2482
+ options?: T,
2483
+ ): KeyPairExportResult<T>;
2484
+ function generateKeyPairSync<T extends RSAPSSKeyPairOptions>(
2485
+ type: "rsa-pss",
2486
+ options: T,
2487
+ ): KeyPairExportResult<T>;
2488
+ function generateKeyPairSync<T extends RSAKeyPairOptions>(
2489
+ type: "rsa",
2490
+ options: T,
2491
+ ): KeyPairExportResult<T>;
2492
+ function generateKeyPairSync<T extends SLHDSAKeyPairOptions = {}>(
2493
+ type: SLHDSAKeyType,
2494
+ options?: T,
2495
+ ): KeyPairExportResult<T>;
2496
+ function generateKeyPairSync<T extends X25519KeyPairOptions = {}>(
2497
+ type: "x25519",
2498
+ options?: T,
2499
+ ): KeyPairExportResult<T>;
2500
+ function generateKeyPairSync<T extends X448KeyPairOptions = {}>(
2501
+ type: "x448",
2502
+ options?: T,
2503
+ ): KeyPairExportResult<T>;
2504
+ /**
2505
+ * Generates a new asymmetric key pair of the given `type`. See the
2506
+ * supported [asymmetric key types](https://nodejs.org/docs/latest-v26.x/api/crypto.html#asymmetric-key-types).
2507
+ *
2508
+ * If a `publicKeyEncoding` or `privateKeyEncoding` was specified, this function
2509
+ * behaves as if `keyObject.export()` had been called on its result. Otherwise,
2510
+ * the respective part of the key is returned as a `KeyObject`.
2511
+ *
2512
+ * It is recommended to encode public keys as `'spki'` and private keys as `'pkcs8'` with encryption for long-term storage:
2513
+ *
2514
+ * ```js
2515
+ * const {
2516
+ * generateKeyPair,
2517
+ * } = await import('node:crypto');
2518
+ *
2519
+ * generateKeyPair('rsa', {
2520
+ * modulusLength: 4096,
2521
+ * publicKeyEncoding: {
2522
+ * type: 'spki',
2523
+ * format: 'pem',
2524
+ * },
2525
+ * privateKeyEncoding: {
2526
+ * type: 'pkcs8',
2527
+ * format: 'pem',
2528
+ * cipher: 'aes-256-cbc',
2529
+ * passphrase: 'top secret',
2530
+ * },
2531
+ * }, (err, publicKey, privateKey) => {
2532
+ * // Handle errors and use the generated key pair.
2533
+ * });
2534
+ * ```
2535
+ *
2536
+ * On completion, `callback` will be called with `err` set to `undefined` and `publicKey` / `privateKey` representing the generated key pair.
2537
+ *
2538
+ * If this method is invoked as its `util.promisify()` ed version, it returns
2539
+ * a `Promise` for an `Object` with `publicKey` and `privateKey` properties.
2540
+ * @since v10.12.0
2541
+ * @param type The asymmetric key type to generate. See the
2542
+ * supported [asymmetric key types](https://nodejs.org/docs/latest-v26.x/api/crypto.html#asymmetric-key-types).
2543
+ */
2544
+ function generateKeyPair<T extends DHKeyPairOptions>(
2545
+ type: "dh",
2546
+ options: T,
2547
+ callback: KeyPairExportCallback<T>,
2548
+ ): void;
2549
+ function generateKeyPair<T extends DSAKeyPairOptions>(
2550
+ type: "dsa",
2551
+ options: T,
2552
+ callback: KeyPairExportCallback<T>,
2553
+ ): void;
2554
+ function generateKeyPair<T extends ECKeyPairOptions>(
2555
+ type: "ec",
2556
+ options: T,
2557
+ callback: KeyPairExportCallback<T>,
2558
+ ): void;
2559
+ function generateKeyPair(
2560
+ type: "ed25519",
2561
+ callback: KeyPairExportCallback,
2562
+ ): void;
2563
+ function generateKeyPair<T extends ED25519KeyPairOptions = {}>(
2564
+ type: "ed25519",
2565
+ options: T | undefined,
2566
+ callback: KeyPairExportCallback<T>,
2567
+ ): void;
2568
+ function generateKeyPair(
2569
+ type: "ed448",
2570
+ callback: KeyPairExportCallback,
2571
+ ): void;
2572
+ function generateKeyPair<T extends ED448KeyPairOptions = {}>(
2573
+ type: "ed448",
2574
+ options: T | undefined,
2575
+ callback: KeyPairExportCallback<T>,
2576
+ ): void;
2577
+ function generateKeyPair(
2578
+ type: MLDSAKeyType,
2579
+ callback: KeyPairExportCallback,
2580
+ ): void;
2581
+ function generateKeyPair<T extends MLDSAKeyPairOptions = {}>(
2582
+ type: MLDSAKeyType,
2583
+ options: T | undefined,
2584
+ callback: KeyPairExportCallback<T>,
2585
+ ): void;
2586
+ function generateKeyPair(
2587
+ type: MLKEMKeyType,
2588
+ callback: KeyPairExportCallback,
2589
+ ): void;
2590
+ function generateKeyPair<T extends MLKEMKeyPairOptions = {}>(
2591
+ type: MLKEMKeyType,
2592
+ options: T | undefined,
2593
+ callback: KeyPairExportCallback<T>,
2594
+ ): void;
2595
+ function generateKeyPair<T extends RSAPSSKeyPairOptions>(
2596
+ type: "rsa-pss",
2597
+ options: T,
2598
+ callback: KeyPairExportCallback<T>,
2599
+ ): void;
2600
+ function generateKeyPair<T extends RSAKeyPairOptions>(
2601
+ type: "rsa",
2602
+ options: T,
2603
+ callback: KeyPairExportCallback<T>,
2604
+ ): void;
2605
+ function generateKeyPair(
2606
+ type: SLHDSAKeyType,
2607
+ callback: KeyPairExportCallback,
2608
+ ): void;
2609
+ function generateKeyPair<T extends SLHDSAKeyPairOptions = {}>(
2610
+ type: SLHDSAKeyType,
2611
+ options: T | undefined,
2612
+ callback: KeyPairExportCallback<T>,
2613
+ ): void;
2614
+ function generateKeyPair(
2615
+ type: "x25519",
2616
+ callback: KeyPairExportCallback,
2617
+ ): void;
2618
+ function generateKeyPair<T extends X25519KeyPairOptions = {}>(
2619
+ type: "x25519",
2620
+ options: T | undefined,
2621
+ callback: KeyPairExportCallback<T>,
2622
+ ): void;
2623
+ function generateKeyPair(
2624
+ type: "x448",
2625
+ callback: KeyPairExportCallback,
2626
+ ): void;
2627
+ function generateKeyPair<T extends X448KeyPairOptions = {}>(
2628
+ type: "x448",
2629
+ options: T | undefined,
2630
+ callback: KeyPairExportCallback<T>,
2631
+ ): void;
2632
+ namespace generateKeyPair {
2633
+ function __promisify__<T extends DHKeyPairOptions>(
2634
+ type: "dh",
2635
+ options: T,
2636
+ ): Promise<KeyPairExportResult<T>>;
2637
+ function __promisify__<T extends DSAKeyPairOptions>(
2638
+ type: "dsa",
2639
+ options: T,
2640
+ ): Promise<KeyPairExportResult<T>>;
2641
+ function __promisify__<T extends ECKeyPairOptions>(
2642
+ type: "ec",
2643
+ options: T,
2644
+ ): Promise<KeyPairExportResult<T>>;
2645
+ function __promisify__<T extends ED25519KeyPairOptions = {}>(
2646
+ type: "ed25519",
2647
+ options?: T,
2648
+ ): Promise<KeyPairExportResult<T>>;
2649
+ function __promisify__<T extends ED448KeyPairOptions = {}>(
2650
+ type: "ed448",
2651
+ options?: T,
2652
+ ): Promise<KeyPairExportResult<T>>;
2653
+ function __promisify__<T extends MLDSAKeyPairOptions = {}>(
2654
+ type: MLDSAKeyType,
2655
+ options?: T,
2656
+ ): Promise<KeyPairExportResult<T>>;
2657
+ function __promisify__<T extends MLKEMKeyPairOptions = {}>(
2658
+ type: MLKEMKeyType,
2659
+ options?: T,
2660
+ ): Promise<KeyPairExportResult<T>>;
2661
+ function __promisify__<T extends RSAPSSKeyPairOptions>(
2662
+ type: "rsa-pss",
2663
+ options: T,
2664
+ ): Promise<KeyPairExportResult<T>>;
2665
+ function __promisify__<T extends RSAKeyPairOptions>(
2666
+ type: "rsa",
2667
+ options: T,
2668
+ ): Promise<KeyPairExportResult<T>>;
2669
+ function __promisify__<T extends SLHDSAKeyPairOptions = {}>(
2670
+ type: SLHDSAKeyType,
2671
+ options?: T,
2672
+ ): Promise<KeyPairExportResult<T>>;
2673
+ function __promisify__<T extends X25519KeyPairOptions = {}>(
2674
+ type: "x25519",
2675
+ options?: T,
2676
+ ): Promise<KeyPairExportResult<T>>;
2677
+ function __promisify__<T extends X448KeyPairOptions = {}>(
2678
+ type: "x448",
2679
+ options?: T,
2680
+ ): Promise<KeyPairExportResult<T>>;
2681
+ }
2682
+ /**
2683
+ * Calculates and returns the signature for `data` using the given private key and
2684
+ * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is
2685
+ * dependent upon the key type.
2686
+ *
2687
+ * `algorithm` is required to be `null` or `undefined` for Ed25519, Ed448, and
2688
+ * ML-DSA.
2689
+ *
2690
+ * If `key` is not a `KeyObject`, this function behaves as if `key` had been
2691
+ * passed to {@link createPrivateKey}. If it is an object, the following
2692
+ * additional properties can be passed:
2693
+ *
2694
+ * If the `callback` function is provided this function uses libuv's threadpool.
2695
+ * @since v12.0.0
2696
+ */
2697
+ function sign(
2698
+ algorithm: string | null | undefined,
2699
+ data: ArrayBufferLike | NodeJS.ArrayBufferView,
2700
+ key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
2701
+ ): NonSharedBuffer;
2702
+ function sign(
2703
+ algorithm: string | null | undefined,
2704
+ data: ArrayBufferLike | NodeJS.ArrayBufferView,
2705
+ key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,
2706
+ callback: (error: Error | null, data: NonSharedBuffer) => void,
2707
+ ): void;
2708
+ /**
2709
+ * Verifies the given signature for `data` using the given key and algorithm. If
2710
+ * `algorithm` is `null` or `undefined`, then the algorithm is dependent upon the
2711
+ * key type.
2712
+ *
2713
+ * `algorithm` is required to be `null` or `undefined` for Ed25519, Ed448, and
2714
+ * ML-DSA.
2715
+ *
2716
+ * If `key` is not a `KeyObject`, this function behaves as if `key` had been
2717
+ * passed to {@link createPublicKey}. If it is an object, the following
2718
+ * additional properties can be passed:
2719
+ *
2720
+ * The `signature` argument is the previously calculated signature for the `data`.
2721
+ *
2722
+ * Because public keys can be derived from private keys, a private key or a public
2723
+ * key may be passed for `key`.
2724
+ *
2725
+ * If the `callback` function is provided this function uses libuv's threadpool.
2726
+ * @since v12.0.0
2727
+ */
2728
+ function verify(
2729
+ algorithm: string | null | undefined,
2730
+ data: ArrayBufferLike | NodeJS.ArrayBufferView,
2731
+ key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
2732
+ signature: ArrayBufferLike | NodeJS.ArrayBufferView,
2733
+ ): boolean;
2734
+ function verify(
2735
+ algorithm: string | null | undefined,
2736
+ data: ArrayBufferLike | NodeJS.ArrayBufferView,
2737
+ key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput,
2738
+ signature: ArrayBufferLike | NodeJS.ArrayBufferView,
2739
+ callback: (error: Error | null, result: boolean) => void,
2740
+ ): void;
2741
+ /**
2742
+ * Key decapsulation using a KEM algorithm with a private key.
2743
+ *
2744
+ * Supported key types and their KEM algorithms are:
2745
+ *
2746
+ * * `'rsa'` RSA Secret Value Encapsulation
2747
+ * * `'ec'` DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256)
2748
+ * * `'x25519'` DHKEM(X25519, HKDF-SHA256)
2749
+ * * `'x448'` DHKEM(X448, HKDF-SHA512)
2750
+ * * `'ml-kem-512'` ML-KEM
2751
+ * * `'ml-kem-768'` ML-KEM
2752
+ * * `'ml-kem-1024'` ML-KEM
2753
+ *
2754
+ * If `key` is not a {@link KeyObject}, this function behaves as if `key` had been
2755
+ * passed to `crypto.createPrivateKey()`.
2756
+ *
2757
+ * If the `callback` function is provided this function uses libuv's threadpool.
2758
+ * @since v24.7.0
2759
+ */
2760
+ function decapsulate(
2761
+ key: KeyLike | PrivateKeyInput | RawPrivateKeyInput | JsonWebKeyInput,
2762
+ ciphertext: ArrayBufferLike | NodeJS.ArrayBufferView,
2763
+ ): NonSharedBuffer;
2764
+ function decapsulate(
2765
+ key: KeyLike | PrivateKeyInput | RawPrivateKeyInput | JsonWebKeyInput,
2766
+ ciphertext: ArrayBufferLike | NodeJS.ArrayBufferView,
2767
+ callback: (err: Error, sharedKey: NonSharedBuffer) => void,
2768
+ ): void;
2769
+ interface DiffieHellmanOptions {
2770
+ privateKey: KeyLike | PrivateKeyInput;
2771
+ publicKey: KeyLike | PublicKeyInput;
2772
+ }
2773
+ /**
2774
+ * Computes the Diffie-Hellman shared secret based on a `privateKey` and a `publicKey`.
2775
+ * Both keys must have the same `asymmetricKeyType` and must support either the DH or
2776
+ * ECDH operation.
2777
+ *
2778
+ * If the `callback` function is provided this function uses libuv's threadpool.
2779
+ * @since v13.9.0, v12.17.0
2780
+ */
2781
+ function diffieHellman(options: DiffieHellmanOptions): NonSharedBuffer;
2782
+ function diffieHellman(
2783
+ options: DiffieHellmanOptions,
2784
+ callback: (err: Error | null, secret: NonSharedBuffer) => void,
2785
+ ): void;
2786
+ /**
2787
+ * Key encapsulation using a KEM algorithm with a public key.
2788
+ *
2789
+ * Supported key types and their KEM algorithms are:
2790
+ *
2791
+ * * `'rsa'` RSA Secret Value Encapsulation
2792
+ * * `'ec'` DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256)
2793
+ * * `'x25519'` DHKEM(X25519, HKDF-SHA256)
2794
+ * * `'x448'` DHKEM(X448, HKDF-SHA512)
2795
+ * * `'ml-kem-512'` ML-KEM
2796
+ * * `'ml-kem-768'` ML-KEM
2797
+ * * `'ml-kem-1024'` ML-KEM
2798
+ *
2799
+ * If `key` is not a {@link KeyObject}, this function behaves as if `key` had been
2800
+ * passed to `crypto.createPublicKey()`.
2801
+ *
2802
+ * If the `callback` function is provided this function uses libuv's threadpool.
2803
+ * @since v24.7.0
2804
+ */
2805
+ function encapsulate(
2806
+ key: KeyLike | PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput,
2807
+ ): { sharedKey: NonSharedBuffer; ciphertext: NonSharedBuffer };
2808
+ function encapsulate(
2809
+ key: KeyLike | PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput,
2810
+ callback: (err: Error, result: { sharedKey: NonSharedBuffer; ciphertext: NonSharedBuffer }) => void,
2811
+ ): void;
2812
+ interface OneShotDigestOptions {
2813
+ /**
2814
+ * Encoding used to encode the returned digest.
2815
+ * @default 'hex'
2816
+ */
2817
+ outputEncoding?: BufferEncoding | "buffer" | undefined;
2818
+ /**
2819
+ * For XOF hash functions such as 'shake256', the outputLength option
2820
+ * can be used to specify the desired output length in bytes.
2821
+ */
2822
+ outputLength?: number | undefined;
2823
+ }
2824
+ interface OneShotDigestOptionsWithStringEncoding extends OneShotDigestOptions {
2825
+ outputEncoding?: BufferEncoding | undefined;
2826
+ }
2827
+ interface OneShotDigestOptionsWithBufferEncoding extends OneShotDigestOptions {
2828
+ outputEncoding: "buffer";
2829
+ }
2830
+ /**
2831
+ * A utility for creating one-shot hash digests of data. It can be faster than
2832
+ * the object-based `crypto.createHash()` when hashing a smaller amount of data
2833
+ * (<= 5MB) that's readily available. If the data can be big or if it is streamed,
2834
+ * it's still recommended to use `crypto.createHash()` instead.
2835
+ *
2836
+ * The `algorithm` is dependent on the available algorithms supported by the
2837
+ * version of OpenSSL on the platform. Examples are `'sha256'`, `'sha512'`, etc.
2838
+ * On recent releases of OpenSSL, `openssl list -digest-algorithms` will
2839
+ * display the available digest algorithms.
2840
+ *
2841
+ * If `options` is a string, then it specifies the `outputEncoding`.
2842
+ *
2843
+ * Example:
2844
+ *
2845
+ * ```js
2846
+ * import crypto from 'node:crypto';
2847
+ * import { Buffer } from 'node:buffer';
2848
+ *
2849
+ * // Hashing a string and return the result as a hex-encoded string.
2850
+ * const string = 'Node.js';
2851
+ * // 10b3493287f831e81a438811a1ffba01f8cec4b7
2852
+ * console.log(crypto.hash('sha1', string));
2853
+ *
2854
+ * // Encode a base64-encoded string into a Buffer, hash it and return
2855
+ * // the result as a buffer.
2856
+ * const base64 = 'Tm9kZS5qcw==';
2857
+ * // <Buffer 10 b3 49 32 87 f8 31 e8 1a 43 88 11 a1 ff ba 01 f8 ce c4 b7>
2858
+ * console.log(crypto.hash('sha1', Buffer.from(base64, 'base64'), 'buffer'));
2859
+ * ```
2860
+ * @since v21.7.0, v20.12.0
2861
+ * @param data When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different
2862
+ * input encoding is desired for a string input, user could encode the string
2863
+ * into a `TypedArray` using either `TextEncoder` or `Buffer.from()` and passing
2864
+ * the encoded `TypedArray` into this API instead.
2865
+ */
2866
+ function hash(
2867
+ algorithm: string,
2868
+ data: BinaryLike,
2869
+ options?: OneShotDigestOptionsWithStringEncoding | BufferEncoding,
2870
+ ): string;
2871
+ function hash(
2872
+ algorithm: string,
2873
+ data: BinaryLike,
2874
+ options: OneShotDigestOptionsWithBufferEncoding | "buffer",
2875
+ ): NonSharedBuffer;
2876
+ function hash(
2877
+ algorithm: string,
2878
+ data: BinaryLike,
2879
+ options: OneShotDigestOptions | BufferEncoding | "buffer",
2880
+ ): string | NonSharedBuffer;
2881
+ type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts";
2882
+ interface CipherInfoOptions {
2883
+ /**
2884
+ * A test key length.
2885
+ */
2886
+ keyLength?: number | undefined;
2887
+ /**
2888
+ * A test IV length.
2889
+ */
2890
+ ivLength?: number | undefined;
2891
+ }
2892
+ interface CipherInfo {
2893
+ name: string;
2894
+ nid: number;
2895
+ blockSize?: number;
2896
+ ivLength?: number;
2897
+ keyLength: number;
2898
+ mode: CipherMode;
2899
+ }
2900
+ /**
2901
+ * Returns information about a given cipher.
2902
+ *
2903
+ * Some ciphers accept variable length keys and initialization vectors. By default,
2904
+ * the `crypto.getCipherInfo()` method will return the default values for these
2905
+ * ciphers. To test if a given key length or iv length is acceptable for given
2906
+ * cipher, use the `keyLength` and `ivLength` options. If the given values are
2907
+ * unacceptable, `undefined` will be returned.
2908
+ * @since v15.0.0
2909
+ * @param nameOrNid The name or nid of the cipher to query.
2910
+ */
2911
+ function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined;
2912
+ /**
2913
+ * HKDF is a simple key derivation function defined in RFC 5869\. The given `ikm`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes.
2914
+ *
2915
+ * The supplied `callback` function is called with two arguments: `err` and `derivedKey`. If an errors occurs while deriving the key, `err` will be set;
2916
+ * otherwise `err` will be `null`. The successfully generated `derivedKey` will
2917
+ * be passed to the callback as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). An error will be thrown if any
2918
+ * of the input arguments specify invalid values or types.
2919
+ *
2920
+ * ```js
2921
+ * import { Buffer } from 'node:buffer';
2922
+ * const {
2923
+ * hkdf,
2924
+ * } = await import('node:crypto');
2925
+ *
2926
+ * hkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => {
2927
+ * if (err) throw err;
2928
+ * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653'
2929
+ * });
2930
+ * ```
2931
+ * @since v15.0.0
2932
+ * @param digest The digest algorithm to use.
2933
+ * @param ikm The input keying material. Must be provided but can be zero-length.
2934
+ * @param salt The salt value. Must be provided but can be zero-length.
2935
+ * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes.
2936
+ * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512`
2937
+ * generates 64-byte hashes, making the maximum HKDF output 16320 bytes).
2938
+ */
2939
+ function hkdf(
2940
+ digest: string,
2941
+ ikm: KeyLike,
2942
+ salt: BinaryLike,
2943
+ info: BinaryLike,
2944
+ keylen: number,
2945
+ callback: (err: Error | null, derivedKey: ArrayBuffer) => void,
2946
+ ): void;
2947
+ /**
2948
+ * Provides a synchronous HKDF key derivation function as defined in RFC 5869\. The
2949
+ * given `ikm`, `salt` and `info` are used with the `digest` to derive a key of `keylen` bytes.
2950
+ *
2951
+ * The successfully generated `derivedKey` will be returned as an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer).
2952
+ *
2953
+ * An error will be thrown if any of the input arguments specify invalid values or
2954
+ * types, or if the derived key cannot be generated.
2955
+ *
2956
+ * ```js
2957
+ * import { Buffer } from 'node:buffer';
2958
+ * const {
2959
+ * hkdfSync,
2960
+ * } = await import('node:crypto');
2961
+ *
2962
+ * const derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64);
2963
+ * console.log(Buffer.from(derivedKey).toString('hex')); // '24156e2...5391653'
2964
+ * ```
2965
+ * @since v15.0.0
2966
+ * @param digest The digest algorithm to use.
2967
+ * @param ikm The input keying material. Must be provided but can be zero-length.
2968
+ * @param salt The salt value. Must be provided but can be zero-length.
2969
+ * @param info Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes.
2970
+ * @param keylen The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512`
2971
+ * generates 64-byte hashes, making the maximum HKDF output 16320 bytes).
2972
+ */
2973
+ function hkdfSync(
2974
+ digest: string,
2975
+ ikm: KeyLike,
2976
+ salt: BinaryLike,
2977
+ info: BinaryLike,
2978
+ keylen: number,
2979
+ ): ArrayBuffer;
2980
+ interface SecureHeapUsage {
2981
+ total: number;
2982
+ min: number;
2983
+ used: number;
2984
+ utilization: number;
2985
+ }
2986
+ /**
2987
+ * @since v15.6.0
2988
+ */
2989
+ function secureHeapUsed(): SecureHeapUsage;
2990
+ interface RandomUUIDOptions {
2991
+ /**
2992
+ * By default, to improve performance,
2993
+ * Node.js will pre-emptively generate and persistently cache enough
2994
+ * random data to generate up to 128 random UUIDs. To generate a UUID
2995
+ * without using the cache, set `disableEntropyCache` to `true`.
2996
+ * @default `false`
2997
+ */
2998
+ disableEntropyCache?: boolean | undefined;
2999
+ }
3000
+ type UUID = `${string}-${string}-${string}-${string}-${string}`;
3001
+ /**
3002
+ * Generates a random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) version 4 UUID. The UUID is generated using a
3003
+ * cryptographic pseudorandom number generator.
3004
+ * @since v15.6.0, v14.17.0
3005
+ */
3006
+ function randomUUID(options?: RandomUUIDOptions): UUID;
3007
+ interface X509CheckOptions {
3008
+ subject?: "always" | "default" | "never" | undefined;
3009
+ wildcards?: boolean | undefined;
3010
+ partialWildcards?: boolean | undefined;
3011
+ multiLabelWildcards?: boolean | undefined;
3012
+ singleLabelSubdomains?: boolean | undefined;
3013
+ }
3014
+ /**
3015
+ * Encapsulates an X509 certificate and provides read-only access to
3016
+ * its information.
3017
+ *
3018
+ * ```js
3019
+ * const { X509Certificate } = await import('node:crypto');
3020
+ *
3021
+ * const x509 = new X509Certificate('{... pem encoded cert ...}');
3022
+ *
3023
+ * console.log(x509.subject);
3024
+ * ```
3025
+ * @since v15.6.0
3026
+ */
3027
+ class X509Certificate {
3028
+ /**
3029
+ * Will be \`true\` if this is a Certificate Authority (CA) certificate.
3030
+ * @since v15.6.0
3031
+ */
3032
+ readonly ca: boolean;
3033
+ /**
3034
+ * The SHA-1 fingerprint of this certificate.
3035
+ *
3036
+ * Because SHA-1 is cryptographically broken and because the security of SHA-1 is
3037
+ * significantly worse than that of algorithms that are commonly used to sign
3038
+ * certificates, consider using `x509.fingerprint256` instead.
3039
+ * @since v15.6.0
3040
+ */
3041
+ readonly fingerprint: string;
3042
+ /**
3043
+ * The SHA-256 fingerprint of this certificate.
3044
+ * @since v15.6.0
3045
+ */
3046
+ readonly fingerprint256: string;
3047
+ /**
3048
+ * The SHA-512 fingerprint of this certificate.
3049
+ *
3050
+ * Because computing the SHA-256 fingerprint is usually faster and because it is
3051
+ * only half the size of the SHA-512 fingerprint, `x509.fingerprint256` may be
3052
+ * a better choice. While SHA-512 presumably provides a higher level of security in
3053
+ * general, the security of SHA-256 matches that of most algorithms that are
3054
+ * commonly used to sign certificates.
3055
+ * @since v17.2.0, v16.14.0
3056
+ */
3057
+ readonly fingerprint512: string;
3058
+ /**
3059
+ * The complete subject of this certificate.
3060
+ * @since v15.6.0
3061
+ */
3062
+ readonly subject: string;
3063
+ /**
3064
+ * The subject alternative name specified for this certificate.
3065
+ *
3066
+ * This is a comma-separated list of subject alternative names. Each entry begins
3067
+ * with a string identifying the kind of the subject alternative name followed by
3068
+ * a colon and the value associated with the entry.
3069
+ *
3070
+ * Earlier versions of Node.js incorrectly assumed that it is safe to split this
3071
+ * property at the two-character sequence `', '` (see [CVE-2021-44532](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44532)). However,
3072
+ * both malicious and legitimate certificates can contain subject alternative names
3073
+ * that include this sequence when represented as a string.
3074
+ *
3075
+ * After the prefix denoting the type of the entry, the remainder of each entry
3076
+ * might be enclosed in quotes to indicate that the value is a JSON string literal.
3077
+ * For backward compatibility, Node.js only uses JSON string literals within this
3078
+ * property when necessary to avoid ambiguity. Third-party code should be prepared
3079
+ * to handle both possible entry formats.
3080
+ * @since v15.6.0
3081
+ */
3082
+ readonly subjectAltName: string | undefined;
3083
+ /**
3084
+ * A textual representation of the certificate's authority information access
3085
+ * extension.
3086
+ *
3087
+ * This is a line feed separated list of access descriptions. Each line begins with
3088
+ * the access method and the kind of the access location, followed by a colon and
3089
+ * the value associated with the access location.
3090
+ *
3091
+ * After the prefix denoting the access method and the kind of the access location,
3092
+ * the remainder of each line might be enclosed in quotes to indicate that the
3093
+ * value is a JSON string literal. For backward compatibility, Node.js only uses
3094
+ * JSON string literals within this property when necessary to avoid ambiguity.
3095
+ * Third-party code should be prepared to handle both possible entry formats.
3096
+ * @since v15.6.0
3097
+ */
3098
+ readonly infoAccess: string | undefined;
3099
+ /**
3100
+ * An array detailing the key usages for this certificate.
3101
+ * @since v15.6.0
3102
+ */
3103
+ readonly keyUsage: string[];
3104
+ /**
3105
+ * The issuer identification included in this certificate.
3106
+ * @since v15.6.0
3107
+ */
3108
+ readonly issuer: string;
3109
+ /**
3110
+ * The issuer certificate or `undefined` if the issuer certificate is not
3111
+ * available.
3112
+ * @since v15.9.0
3113
+ */
3114
+ readonly issuerCertificate: X509Certificate | undefined;
3115
+ /**
3116
+ * The public key `KeyObject` for this certificate.
3117
+ * @since v15.6.0
3118
+ */
3119
+ readonly publicKey: KeyObject;
3120
+ /**
3121
+ * A `Buffer` containing the DER encoding of this certificate.
3122
+ * @since v15.6.0
3123
+ */
3124
+ readonly raw: NonSharedBuffer;
3125
+ /**
3126
+ * The serial number of this certificate.
3127
+ *
3128
+ * Serial numbers are assigned by certificate authorities and do not uniquely
3129
+ * identify certificates. Consider using `x509.fingerprint256` as a unique
3130
+ * identifier instead.
3131
+ * @since v15.6.0
3132
+ */
3133
+ readonly serialNumber: string;
3134
+ /**
3135
+ * The algorithm used to sign the certificate or `undefined` if the signature algorithm is unknown by OpenSSL.
3136
+ * @since v24.9.0
3137
+ */
3138
+ readonly signatureAlgorithm: string | undefined;
3139
+ /**
3140
+ * The OID of the algorithm used to sign the certificate.
3141
+ * @since v24.9.0
3142
+ */
3143
+ readonly signatureAlgorithmOid: string;
3144
+ /**
3145
+ * The date/time from which this certificate is considered valid.
3146
+ * @since v15.6.0
3147
+ */
3148
+ readonly validFrom: string;
3149
+ /**
3150
+ * The date/time from which this certificate is valid, encapsulated in a `Date` object.
3151
+ * @since v22.10.0
3152
+ */
3153
+ readonly validFromDate: Date;
3154
+ /**
3155
+ * The date/time until which this certificate is considered valid.
3156
+ * @since v15.6.0
3157
+ */
3158
+ readonly validTo: string;
3159
+ /**
3160
+ * The date/time until which this certificate is valid, encapsulated in a `Date` object.
3161
+ * @since v22.10.0
3162
+ */
3163
+ readonly validToDate: Date;
3164
+ constructor(buffer: string | NodeJS.ArrayBufferView);
3165
+ /**
3166
+ * Checks whether the certificate matches the given email address.
3167
+ *
3168
+ * If the `'subject'` option is undefined or set to `'default'`, the certificate
3169
+ * subject is only considered if the subject alternative name extension either does
3170
+ * not exist or does not contain any email addresses.
3171
+ *
3172
+ * If the `'subject'` option is set to `'always'` and if the subject alternative
3173
+ * name extension either does not exist or does not contain a matching email
3174
+ * address, the certificate subject is considered.
3175
+ *
3176
+ * If the `'subject'` option is set to `'never'`, the certificate subject is never
3177
+ * considered, even if the certificate contains no subject alternative names.
3178
+ * @since v15.6.0
3179
+ * @return Returns `email` if the certificate matches, `undefined` if it does not.
3180
+ */
3181
+ checkEmail(email: string, options?: Pick<X509CheckOptions, "subject">): string | undefined;
3182
+ /**
3183
+ * Checks whether the certificate matches the given host name.
3184
+ *
3185
+ * If the certificate matches the given host name, the matching subject name is
3186
+ * returned. The returned name might be an exact match (e.g., `foo.example.com`)
3187
+ * or it might contain wildcards (e.g., `*.example.com`). Because host name
3188
+ * comparisons are case-insensitive, the returned subject name might also differ
3189
+ * from the given `name` in capitalization.
3190
+ *
3191
+ * If the `'subject'` option is undefined or set to `'default'`, the certificate
3192
+ * subject is only considered if the subject alternative name extension either does
3193
+ * not exist or does not contain any DNS names. This behavior is consistent with [RFC 2818](https://www.rfc-editor.org/rfc/rfc2818.txt) ("HTTP Over TLS").
3194
+ *
3195
+ * If the `'subject'` option is set to `'always'` and if the subject alternative
3196
+ * name extension either does not exist or does not contain a matching DNS name,
3197
+ * the certificate subject is considered.
3198
+ *
3199
+ * If the `'subject'` option is set to `'never'`, the certificate subject is never
3200
+ * considered, even if the certificate contains no subject alternative names.
3201
+ * @since v15.6.0
3202
+ * @return Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`.
3203
+ */
3204
+ checkHost(name: string, options?: X509CheckOptions): string | undefined;
3205
+ /**
3206
+ * Checks whether the certificate matches the given IP address (IPv4 or IPv6).
3207
+ *
3208
+ * Only [RFC 5280](https://www.rfc-editor.org/rfc/rfc5280.txt) `iPAddress` subject alternative names are considered, and they
3209
+ * must match the given `ip` address exactly. Other subject alternative names as
3210
+ * well as the subject field of the certificate are ignored.
3211
+ * @since v15.6.0
3212
+ * @return Returns `ip` if the certificate matches, `undefined` if it does not.
3213
+ */
3214
+ checkIP(ip: string): string | undefined;
3215
+ /**
3216
+ * Checks whether this certificate was potentially issued by the given `otherCert`
3217
+ * by comparing the certificate metadata.
3218
+ *
3219
+ * This is useful for pruning a list of possible issuer certificates which have been
3220
+ * selected using a more rudimentary filtering routine, i.e. just based on subject
3221
+ * and issuer names.
3222
+ *
3223
+ * Finally, to verify that this certificate's signature was produced by a private key
3224
+ * corresponding to `otherCert`'s public key use `x509.verify(publicKey)`
3225
+ * with `otherCert`'s public key represented as a `KeyObject`
3226
+ * like so
3227
+ *
3228
+ * ```js
3229
+ * if (!x509.verify(otherCert.publicKey)) {
3230
+ * throw new Error('otherCert did not issue x509');
3231
+ * }
3232
+ * ```
3233
+ * @since v15.6.0
3234
+ */
3235
+ checkIssued(otherCert: X509Certificate): boolean;
3236
+ /**
3237
+ * Checks whether the public key for this certificate is consistent with
3238
+ * the given private key.
3239
+ * @since v15.6.0
3240
+ * @param privateKey A private key.
3241
+ */
3242
+ checkPrivateKey(privateKey: KeyObject): boolean;
3243
+ /**
3244
+ * There is no standard JSON encoding for X509 certificates. The`toJSON()` method returns a string containing the PEM encoded
3245
+ * certificate.
3246
+ * @since v15.6.0
3247
+ */
3248
+ toJSON(): string;
3249
+ /**
3250
+ * Returns information about this certificate using the legacy `certificate object` encoding.
3251
+ * @since v15.6.0
3252
+ */
3253
+ toLegacyObject(): PeerCertificate;
3254
+ /**
3255
+ * Returns the PEM-encoded certificate.
3256
+ * @since v15.6.0
3257
+ */
3258
+ toString(): string;
3259
+ /**
3260
+ * Verifies that this certificate was signed by the given public key.
3261
+ * Does not perform any other validation checks on the certificate.
3262
+ * @since v15.6.0
3263
+ * @param publicKey A public key.
3264
+ */
3265
+ verify(publicKey: KeyObject): boolean;
3266
+ }
3267
+ type LargeNumberLike = ArrayBufferLike | NodeJS.ArrayBufferView | bigint;
3268
+ interface GeneratePrimeOptions {
3269
+ add?: LargeNumberLike | undefined;
3270
+ rem?: LargeNumberLike | undefined;
3271
+ safe?: boolean | undefined;
3272
+ bigint?: boolean | undefined;
3273
+ }
3274
+ interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions {
3275
+ bigint: true;
3276
+ }
3277
+ interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions {
3278
+ bigint?: false | undefined;
3279
+ }
3280
+ /**
3281
+ * Generates a pseudorandom prime of `size` bits.
3282
+ *
3283
+ * If `options.safe` is `true`, the prime will be a safe prime -- that is, `(prime - 1) / 2` will also be a prime.
3284
+ *
3285
+ * The `options.add` and `options.rem` parameters can be used to enforce additional
3286
+ * requirements, e.g., for Diffie-Hellman:
3287
+ *
3288
+ * * If `options.add` and `options.rem` are both set, the prime will satisfy the
3289
+ * condition that `prime % add = rem`.
3290
+ * * If only `options.add` is set and `options.safe` is not `true`, the prime will
3291
+ * satisfy the condition that `prime % add = 1`.
3292
+ * * If only `options.add` is set and `options.safe` is set to `true`, the prime
3293
+ * will instead satisfy the condition that `prime % add = 3`. This is necessary
3294
+ * because `prime % add = 1` for `options.add > 2` would contradict the condition
3295
+ * enforced by `options.safe`.
3296
+ * * `options.rem` is ignored if `options.add` is not given.
3297
+ *
3298
+ * Both `options.add` and `options.rem` must be encoded as big-endian sequences
3299
+ * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or `DataView`.
3300
+ *
3301
+ * By default, the prime is encoded as a big-endian sequence of octets
3302
+ * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a
3303
+ * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided.
3304
+ * @since v15.8.0
3305
+ * @param size The size (in bits) of the prime to generate.
3306
+ */
3307
+ function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void;
3308
+ function generatePrime(
3309
+ size: number,
3310
+ options: GeneratePrimeOptionsArrayBuffer,
3311
+ callback: (err: Error | null, prime: ArrayBuffer) => void,
3312
+ ): void;
3313
+ function generatePrime(
3314
+ size: number,
3315
+ options: GeneratePrimeOptionsBigInt,
3316
+ callback: (err: Error | null, prime: bigint) => void,
3317
+ ): void;
3318
+ function generatePrime(
3319
+ size: number,
3320
+ options: GeneratePrimeOptions,
3321
+ callback: (err: Error | null, prime: ArrayBuffer | bigint) => void,
3322
+ ): void;
3323
+ /**
3324
+ * Generates a pseudorandom prime of `size` bits.
3325
+ *
3326
+ * If `options.safe` is `true`, the prime will be a safe prime -- that is, `(prime - 1) / 2` will also be a prime.
3327
+ *
3328
+ * The `options.add` and `options.rem` parameters can be used to enforce additional
3329
+ * requirements, e.g., for Diffie-Hellman:
3330
+ *
3331
+ * * If `options.add` and `options.rem` are both set, the prime will satisfy the
3332
+ * condition that `prime % add = rem`.
3333
+ * * If only `options.add` is set and `options.safe` is not `true`, the prime will
3334
+ * satisfy the condition that `prime % add = 1`.
3335
+ * * If only `options.add` is set and `options.safe` is set to `true`, the prime
3336
+ * will instead satisfy the condition that `prime % add = 3`. This is necessary
3337
+ * because `prime % add = 1` for `options.add > 2` would contradict the condition
3338
+ * enforced by `options.safe`.
3339
+ * * `options.rem` is ignored if `options.add` is not given.
3340
+ *
3341
+ * Both `options.add` and `options.rem` must be encoded as big-endian sequences
3342
+ * if given as an `ArrayBuffer`, `SharedArrayBuffer`, `TypedArray`, `Buffer`, or `DataView`.
3343
+ *
3344
+ * By default, the prime is encoded as a big-endian sequence of octets
3345
+ * in an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer). If the `bigint` option is `true`, then a
3346
+ * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) is provided.
3347
+ * @since v15.8.0
3348
+ * @param size The size (in bits) of the prime to generate.
3349
+ */
3350
+ function generatePrimeSync(size: number): ArrayBuffer;
3351
+ function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer;
3352
+ function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint;
3353
+ function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint;
3354
+ interface CheckPrimeOptions {
3355
+ /**
3356
+ * The number of Miller-Rabin probabilistic primality iterations to perform.
3357
+ * When the value is 0 (zero), a number of checks is used that yields a false positive rate of at most `2**-64` for random input.
3358
+ * Care must be used when selecting a number of checks.
3359
+ * Refer to the OpenSSL documentation for the BN_is_prime_ex function nchecks options for more details.
3360
+ * @default 0
3361
+ */
3362
+ checks?: number | undefined;
3363
+ }
3364
+ /**
3365
+ * Checks the primality of the `candidate`.
3366
+ * @since v15.8.0
3367
+ * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length.
3368
+ */
3369
+ function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void;
3370
+ function checkPrime(
3371
+ value: LargeNumberLike,
3372
+ options: CheckPrimeOptions,
3373
+ callback: (err: Error | null, result: boolean) => void,
3374
+ ): void;
3375
+ /**
3376
+ * Checks the primality of the `candidate`.
3377
+ * @since v15.8.0
3378
+ * @param candidate A possible prime encoded as a sequence of big endian octets of arbitrary length.
3379
+ * @return `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`.
3380
+ */
3381
+ function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean;
3382
+ /**
3383
+ * Load and set the `engine` for some or all OpenSSL functions (selected by flags).
3384
+ *
3385
+ * `engine` could be either an id or a path to the engine's shared library.
3386
+ *
3387
+ * The optional `flags` argument uses `ENGINE_METHOD_ALL` by default. The `flags` is a bit field taking one of or a mix of the following flags (defined in `crypto.constants`):
3388
+ *
3389
+ * * `crypto.constants.ENGINE_METHOD_RSA`
3390
+ * * `crypto.constants.ENGINE_METHOD_DSA`
3391
+ * * `crypto.constants.ENGINE_METHOD_DH`
3392
+ * * `crypto.constants.ENGINE_METHOD_RAND`
3393
+ * * `crypto.constants.ENGINE_METHOD_EC`
3394
+ * * `crypto.constants.ENGINE_METHOD_CIPHERS`
3395
+ * * `crypto.constants.ENGINE_METHOD_DIGESTS`
3396
+ * * `crypto.constants.ENGINE_METHOD_PKEY_METHS`
3397
+ * * `crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS`
3398
+ * * `crypto.constants.ENGINE_METHOD_ALL`
3399
+ * * `crypto.constants.ENGINE_METHOD_NONE`
3400
+ * @since v0.11.11
3401
+ * @param flags
3402
+ */
3403
+ function setEngine(engine: string, flags?: number): void;
3404
+ /**
3405
+ * A convenient alias for {@link webcrypto.getRandomValues}. This
3406
+ * implementation is not compliant with the Web Crypto spec, to write
3407
+ * web-compatible code use {@link webcrypto.getRandomValues} instead.
3408
+ * @since v17.4.0
3409
+ * @return Returns `typedArray`.
3410
+ */
3411
+ function getRandomValues<
3412
+ T extends Exclude<
3413
+ NodeJS.NonSharedTypedArray,
3414
+ NodeJS.NonSharedFloat16Array | NodeJS.NonSharedFloat32Array | NodeJS.NonSharedFloat64Array
3415
+ >,
3416
+ >(typedArray: T): T;
3417
+ type Argon2Algorithm = "argon2d" | "argon2i" | "argon2id";
3418
+ interface Argon2Parameters {
3419
+ message: BinaryLike;
3420
+ nonce: BinaryLike;
3421
+ parallelism: number;
3422
+ tagLength: number;
3423
+ memory: number;
3424
+ passes: number;
3425
+ secret?: BinaryLike | undefined;
3426
+ associatedData?: BinaryLike | undefined;
3427
+ }
3428
+ /**
3429
+ * Provides an asynchronous [Argon2](https://www.rfc-editor.org/rfc/rfc9106.html) implementation. Argon2 is a password-based
3430
+ * key derivation function that is designed to be expensive computationally and
3431
+ * memory-wise in order to make brute-force attacks unrewarding.
3432
+ *
3433
+ * The `nonce` should be as unique as possible. It is recommended that a nonce is
3434
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
3435
+ *
3436
+ * When passing strings for `message`, `nonce`, `secret` or `associatedData`, please
3437
+ * consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v26.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis).
3438
+ *
3439
+ * The `callback` function is called with two arguments: `err` and `derivedKey`.
3440
+ * `err` is an exception object when key derivation fails, otherwise `err` is
3441
+ * `null`. `derivedKey` is passed to the callback as a `Buffer`.
3442
+ *
3443
+ * An exception is thrown when any of the input arguments specify invalid values
3444
+ * or types.
3445
+ *
3446
+ * ```js
3447
+ * const { argon2, randomBytes } = await import('node:crypto');
3448
+ *
3449
+ * const parameters = {
3450
+ * message: 'password',
3451
+ * nonce: randomBytes(16),
3452
+ * parallelism: 4,
3453
+ * tagLength: 64,
3454
+ * memory: 65536,
3455
+ * passes: 3,
3456
+ * };
3457
+ *
3458
+ * argon2('argon2id', parameters, (err, derivedKey) => {
3459
+ * if (err) throw err;
3460
+ * console.log(derivedKey.toString('hex')); // 'af91dad...9520f15'
3461
+ * });
3462
+ * ```
3463
+ * @since v24.7.0
3464
+ * @param algorithm Variant of Argon2, one of `"argon2d"`, `"argon2i"` or `"argon2id"`.
3465
+ * @experimental
3466
+ */
3467
+ function argon2(
3468
+ algorithm: Argon2Algorithm,
3469
+ parameters: Argon2Parameters,
3470
+ callback: (err: Error | null, derivedKey: NonSharedBuffer) => void,
3471
+ ): void;
3472
+ /**
3473
+ * Provides a synchronous [Argon2][] implementation. Argon2 is a password-based
3474
+ * key derivation function that is designed to be expensive computationally and
3475
+ * memory-wise in order to make brute-force attacks unrewarding.
3476
+ *
3477
+ * The `nonce` should be as unique as possible. It is recommended that a nonce is
3478
+ * random and at least 16 bytes long. See [NIST SP 800-132](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf) for details.
3479
+ *
3480
+ * When passing strings for `message`, `nonce`, `secret` or `associatedData`, please
3481
+ * consider [caveats when using strings as inputs to cryptographic APIs](https://nodejs.org/docs/latest-v26.x/api/crypto.html#using-strings-as-inputs-to-cryptographic-apis).
3482
+ *
3483
+ * An exception is thrown when key derivation fails, otherwise the derived key is
3484
+ * returned as a `Buffer`.
3485
+ *
3486
+ * An exception is thrown when any of the input arguments specify invalid values
3487
+ * or types.
3488
+ *
3489
+ * ```js
3490
+ * const { argon2Sync, randomBytes } = await import('node:crypto');
3491
+ *
3492
+ * const parameters = {
3493
+ * message: 'password',
3494
+ * nonce: randomBytes(16),
3495
+ * parallelism: 4,
3496
+ * tagLength: 64,
3497
+ * memory: 65536,
3498
+ * passes: 3,
3499
+ * };
3500
+ *
3501
+ * const derivedKey = argon2Sync('argon2id', parameters);
3502
+ * console.log(derivedKey.toString('hex')); // 'af91dad...9520f15'
3503
+ * ```
3504
+ * @since v24.7.0
3505
+ * @experimental
3506
+ */
3507
+ function argon2Sync(algorithm: Argon2Algorithm, parameters: Argon2Parameters): NonSharedBuffer;
3508
+ /**
3509
+ * A convenient alias for `crypto.webcrypto.subtle`.
3510
+ * @since v17.4.0
3511
+ */
3512
+ const subtle: webcrypto.SubtleCrypto;
3513
+ /**
3514
+ * An implementation of the Web Crypto API standard.
3515
+ *
3516
+ * See the {@link https://nodejs.org/docs/latest/api/webcrypto.html Web Crypto API documentation} for details.
3517
+ * @since v15.0.0
3518
+ */
3519
+ const webcrypto: webcrypto.Crypto;
3520
+ namespace webcrypto {
3521
+ type AlgorithmIdentifier = Algorithm | string;
3522
+ type BigInteger = NodeJS.NonSharedUint8Array;
3523
+ type KeyFormat = "jwk" | "pkcs8" | "raw" | "raw-public" | "raw-secret" | "raw-seed" | "spki";
3524
+ type KeyType = "private" | "public" | "secret";
3525
+ type KeyUsage =
3526
+ | "decapsulateBits"
3527
+ | "decapsulateKey"
3528
+ | "decrypt"
3529
+ | "deriveBits"
3530
+ | "deriveKey"
3531
+ | "encapsulateBits"
3532
+ | "encapsulateKey"
3533
+ | "encrypt"
3534
+ | "sign"
3535
+ | "unwrapKey"
3536
+ | "verify"
3537
+ | "wrapKey";
3538
+ type HashAlgorithmIdentifier = AlgorithmIdentifier;
3539
+ type NamedCurve = string;
3540
+ interface AeadParams extends Algorithm {
3541
+ additionalData?: NodeJS.BufferSource;
3542
+ iv: NodeJS.BufferSource;
3543
+ tagLength: number;
3544
+ }
3545
+ interface AesCbcParams extends Algorithm {
3546
+ iv: NodeJS.BufferSource;
3547
+ }
3548
+ interface AesCtrParams extends Algorithm {
3549
+ counter: NodeJS.BufferSource;
3550
+ length: number;
3551
+ }
3552
+ interface AesDerivedKeyParams extends Algorithm {
3553
+ length: number;
3554
+ }
3555
+ interface AesKeyAlgorithm extends KeyAlgorithm {
3556
+ length: number;
3557
+ }
3558
+ interface AesKeyGenParams extends Algorithm {
3559
+ length: number;
3560
+ }
3561
+ interface Algorithm {
3562
+ name: string;
3563
+ }
3564
+ interface Argon2Params extends Algorithm {
3565
+ associatedData?: NodeJS.BufferSource;
3566
+ memory: number;
3567
+ nonce: NodeJS.BufferSource;
3568
+ parallelism: number;
3569
+ passes: number;
3570
+ secretValue?: NodeJS.BufferSource;
3571
+ version?: number;
3572
+ }
3573
+ interface CShakeParams extends Algorithm {
3574
+ customization?: NodeJS.BufferSource;
3575
+ functionName?: NodeJS.BufferSource;
3576
+ outputLength: number;
3577
+ }
3578
+ interface ContextParams extends Algorithm {
3579
+ context?: NodeJS.BufferSource;
3580
+ }
3581
+ interface EcKeyAlgorithm extends KeyAlgorithm {
3582
+ namedCurve: NamedCurve;
3583
+ }
3584
+ interface EcKeyGenParams extends Algorithm {
3585
+ namedCurve: NamedCurve;
3586
+ }
3587
+ interface EcKeyImportParams extends Algorithm {
3588
+ namedCurve: NamedCurve;
3589
+ }
3590
+ interface EcdhKeyDeriveParams extends Algorithm {
3591
+ public: CryptoKey;
3592
+ }
3593
+ interface EcdsaParams extends Algorithm {
3594
+ hash: HashAlgorithmIdentifier;
3595
+ }
3596
+ interface HkdfParams extends Algorithm {
3597
+ hash: HashAlgorithmIdentifier;
3598
+ info: NodeJS.BufferSource;
3599
+ salt: NodeJS.BufferSource;
3600
+ }
3601
+ interface HmacImportParams extends Algorithm {
3602
+ hash: HashAlgorithmIdentifier;
3603
+ length?: number;
3604
+ }
3605
+ interface HmacKeyAlgorithm extends KeyAlgorithm {
3606
+ hash: KeyAlgorithm;
3607
+ length: number;
3608
+ }
3609
+ interface HmacKeyGenParams extends Algorithm {
3610
+ hash: HashAlgorithmIdentifier;
3611
+ length?: number;
3612
+ }
3613
+ interface KangarooTwelveParams {
3614
+ customization?: NodeJS.BufferSource;
3615
+ outputLength: number;
3616
+ }
3617
+ interface JsonWebKey {
3618
+ alg?: string;
3619
+ crv?: string;
3620
+ d?: string;
3621
+ dp?: string;
3622
+ dq?: string;
3623
+ e?: string;
3624
+ ext?: boolean;
3625
+ k?: string;
3626
+ key_ops?: string[];
3627
+ kty?: string;
3628
+ n?: string;
3629
+ oth?: RsaOtherPrimesInfo[];
3630
+ p?: string;
3631
+ q?: string;
3632
+ qi?: string;
3633
+ use?: string;
3634
+ x?: string;
3635
+ y?: string;
3636
+ }
3637
+ interface KeyAlgorithm {
3638
+ name: string;
3639
+ }
3640
+ interface KmacImportParams extends Algorithm {
3641
+ length?: number;
3642
+ }
3643
+ interface KmacKeyAlgorithm extends KeyAlgorithm {
3644
+ length: number;
3645
+ }
3646
+ interface KmacKeyGenParams extends Algorithm {
3647
+ length?: number;
3648
+ }
3649
+ interface KmacParams extends Algorithm {
3650
+ customization?: NodeJS.BufferSource;
3651
+ outputLength: number;
3652
+ }
3653
+ interface Pbkdf2Params extends Algorithm {
3654
+ hash: HashAlgorithmIdentifier;
3655
+ iterations: number;
3656
+ salt: NodeJS.BufferSource;
3657
+ }
3658
+ interface RsaHashedImportParams extends Algorithm {
3659
+ hash: HashAlgorithmIdentifier;
3660
+ }
3661
+ interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm {
3662
+ hash: KeyAlgorithm;
3663
+ }
3664
+ interface RsaHashedKeyGenParams extends RsaKeyGenParams {
3665
+ hash: HashAlgorithmIdentifier;
3666
+ }
3667
+ interface RsaKeyAlgorithm extends KeyAlgorithm {
3668
+ modulusLength: number;
3669
+ publicExponent: BigInteger;
3670
+ }
3671
+ interface RsaKeyGenParams extends Algorithm {
3672
+ modulusLength: number;
3673
+ publicExponent: BigInteger;
3674
+ }
3675
+ interface RsaOaepParams extends Algorithm {
3676
+ label?: NodeJS.BufferSource;
3677
+ }
3678
+ interface RsaOtherPrimesInfo {
3679
+ d?: string;
3680
+ r?: string;
3681
+ t?: string;
3682
+ }
3683
+ interface RsaPssParams extends Algorithm {
3684
+ saltLength: number;
3685
+ }
3686
+ interface TurboShakeParams {
3687
+ domainSeparation?: number;
3688
+ outputLength: number;
3689
+ }
3690
+ interface Crypto {
3691
+ readonly subtle: SubtleCrypto;
3692
+ getRandomValues<
3693
+ T extends Exclude<
3694
+ NodeJS.NonSharedTypedArray,
3695
+ NodeJS.NonSharedFloat16Array | NodeJS.NonSharedFloat32Array | NodeJS.NonSharedFloat64Array
3696
+ >,
3697
+ >(
3698
+ typedArray: T,
3699
+ ): T;
3700
+ randomUUID(): UUID;
3701
+ }
3702
+ interface CryptoKey {
3703
+ readonly algorithm: KeyAlgorithm;
3704
+ readonly extractable: boolean;
3705
+ readonly type: KeyType;
3706
+ readonly usages: KeyUsage[];
3707
+ }
3708
+ interface CryptoKeyPair {
3709
+ privateKey: CryptoKey;
3710
+ publicKey: CryptoKey;
3711
+ }
3712
+ interface EncapsulatedBits {
3713
+ sharedKey: ArrayBuffer;
3714
+ ciphertext: ArrayBuffer;
3715
+ }
3716
+ interface EncapsulatedKey {
3717
+ sharedKey: CryptoKey;
3718
+ ciphertext: ArrayBuffer;
3719
+ }
3720
+ interface SubtleCrypto {
3721
+ decapsulateBits(
3722
+ decapsulationAlgorithm: AlgorithmIdentifier,
3723
+ decapsulationKey: CryptoKey,
3724
+ ciphertext: NodeJS.BufferSource,
3725
+ ): Promise<ArrayBuffer>;
3726
+ decapsulateKey(
3727
+ decapsulationAlgorithm: AlgorithmIdentifier,
3728
+ decapsulationKey: CryptoKey,
3729
+ ciphertext: NodeJS.BufferSource,
3730
+ sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
3731
+ extractable: boolean,
3732
+ usages: KeyUsage[],
3733
+ ): Promise<CryptoKey>;
3734
+ decrypt(
3735
+ algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
3736
+ key: CryptoKey,
3737
+ data: NodeJS.BufferSource,
3738
+ ): Promise<ArrayBuffer>;
3739
+ deriveBits(
3740
+ algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params,
3741
+ baseKey: CryptoKey,
3742
+ length?: number | null,
3743
+ ): Promise<ArrayBuffer>;
3744
+ deriveKey(
3745
+ algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params,
3746
+ baseKey: CryptoKey,
3747
+ derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | KmacImportParams,
3748
+ extractable: boolean,
3749
+ keyUsages: readonly KeyUsage[],
3750
+ ): Promise<CryptoKey>;
3751
+ digest(
3752
+ algorithm: AlgorithmIdentifier | CShakeParams | TurboShakeParams | KangarooTwelveParams,
3753
+ data: NodeJS.BufferSource,
3754
+ ): Promise<ArrayBuffer>;
3755
+ encapsulateBits(
3756
+ encapsulationAlgorithm: AlgorithmIdentifier,
3757
+ encapsulationKey: CryptoKey,
3758
+ ): Promise<EncapsulatedBits>;
3759
+ encapsulateKey(
3760
+ encapsulationAlgorithm: AlgorithmIdentifier,
3761
+ encapsulationKey: CryptoKey,
3762
+ sharedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | KmacImportParams,
3763
+ extractable: boolean,
3764
+ usages: KeyUsage[],
3765
+ ): Promise<EncapsulatedKey>;
3766
+ encrypt(
3767
+ algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
3768
+ key: CryptoKey,
3769
+ data: NodeJS.BufferSource,
3770
+ ): Promise<ArrayBuffer>;
3771
+ exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
3772
+ exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
3773
+ exportKey(format: KeyFormat, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
3774
+ generateKey(
3775
+ algorithm: RsaHashedKeyGenParams | EcKeyGenParams,
3776
+ extractable: boolean,
3777
+ keyUsages: KeyUsage[],
3778
+ ): Promise<CryptoKeyPair>;
3779
+ generateKey(
3780
+ algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params | KmacKeyGenParams,
3781
+ extractable: boolean,
3782
+ keyUsages: KeyUsage[],
3783
+ ): Promise<CryptoKey>;
3784
+ generateKey(
3785
+ algorithm: AlgorithmIdentifier,
3786
+ extractable: boolean,
3787
+ keyUsages: KeyUsage[],
3788
+ ): Promise<CryptoKeyPair | CryptoKey>;
3789
+ getPublicKey(key: CryptoKey, keyUsages: KeyUsage[]): Promise<CryptoKey>;
3790
+ importKey(
3791
+ format: "jwk",
3792
+ keyData: JsonWebKey,
3793
+ algorithm:
3794
+ | AlgorithmIdentifier
3795
+ | RsaHashedImportParams
3796
+ | EcKeyImportParams
3797
+ | HmacImportParams
3798
+ | AesKeyAlgorithm
3799
+ | KmacImportParams,
3800
+ extractable: boolean,
3801
+ keyUsages: KeyUsage[],
3802
+ ): Promise<CryptoKey>;
3803
+ importKey(
3804
+ format: Exclude<KeyFormat, "jwk">,
3805
+ keyData: NodeJS.BufferSource,
3806
+ algorithm:
3807
+ | AlgorithmIdentifier
3808
+ | RsaHashedImportParams
3809
+ | EcKeyImportParams
3810
+ | HmacImportParams
3811
+ | AesKeyAlgorithm
3812
+ | KmacImportParams,
3813
+ extractable: boolean,
3814
+ keyUsages: KeyUsage[],
3815
+ ): Promise<CryptoKey>;
3816
+ sign(
3817
+ algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams,
3818
+ key: CryptoKey,
3819
+ data: NodeJS.BufferSource,
3820
+ ): Promise<ArrayBuffer>;
3821
+ unwrapKey(
3822
+ format: KeyFormat,
3823
+ wrappedKey: NodeJS.BufferSource,
3824
+ unwrappingKey: CryptoKey,
3825
+ unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
3826
+ unwrappedKeyAlgorithm:
3827
+ | AlgorithmIdentifier
3828
+ | RsaHashedImportParams
3829
+ | EcKeyImportParams
3830
+ | HmacImportParams
3831
+ | AesKeyAlgorithm
3832
+ | KmacImportParams,
3833
+ extractable: boolean,
3834
+ keyUsages: KeyUsage[],
3835
+ ): Promise<CryptoKey>;
3836
+ verify(
3837
+ algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams,
3838
+ key: CryptoKey,
3839
+ signature: NodeJS.BufferSource,
3840
+ data: NodeJS.BufferSource,
3841
+ ): Promise<boolean>;
3842
+ wrapKey(
3843
+ format: KeyFormat,
3844
+ key: CryptoKey,
3845
+ wrappingKey: CryptoKey,
3846
+ wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
3847
+ ): Promise<ArrayBuffer>;
3848
+ }
3849
+ }
3850
+ /**
3851
+ * An object containing commonly used constants for crypto and security related
3852
+ * operations. The specific constants currently defined are described in
3853
+ * [Crypto constants](https://nodejs.org/docs/latest-v26.x/api/crypto.html#crypto-constants).
3854
+ * @since v6.3.0
3855
+ */
3856
+ namespace constants {
3857
+ const OPENSSL_VERSION_NUMBER: number;
3858
+ const SSL_OP_ALL: number;
3859
+ const SSL_OP_ALLOW_NO_DHE_KEX: number;
3860
+ const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
3861
+ const SSL_OP_CIPHER_SERVER_PREFERENCE: number;
3862
+ const SSL_OP_CISCO_ANYCONNECT: number;
3863
+ const SSL_OP_COOKIE_EXCHANGE: number;
3864
+ const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
3865
+ const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
3866
+ const SSL_OP_LEGACY_SERVER_CONNECT: number;
3867
+ const SSL_OP_NO_COMPRESSION: number;
3868
+ const SSL_OP_NO_ENCRYPT_THEN_MAC: number;
3869
+ const SSL_OP_NO_QUERY_MTU: number;
3870
+ const SSL_OP_NO_RENEGOTIATION: number;
3871
+ const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
3872
+ const SSL_OP_NO_SSLv2: number;
3873
+ const SSL_OP_NO_SSLv3: number;
3874
+ const SSL_OP_NO_TICKET: number;
3875
+ const SSL_OP_NO_TLSv1: number;
3876
+ const SSL_OP_NO_TLSv1_1: number;
3877
+ const SSL_OP_NO_TLSv1_2: number;
3878
+ const SSL_OP_NO_TLSv1_3: number;
3879
+ const SSL_OP_PRIORITIZE_CHACHA: number;
3880
+ const SSL_OP_TLS_ROLLBACK_BUG: number;
3881
+ const ENGINE_METHOD_RSA: number;
3882
+ const ENGINE_METHOD_DSA: number;
3883
+ const ENGINE_METHOD_DH: number;
3884
+ const ENGINE_METHOD_RAND: number;
3885
+ const ENGINE_METHOD_EC: number;
3886
+ const ENGINE_METHOD_CIPHERS: number;
3887
+ const ENGINE_METHOD_DIGESTS: number;
3888
+ const ENGINE_METHOD_PKEY_METHS: number;
3889
+ const ENGINE_METHOD_PKEY_ASN1_METHS: number;
3890
+ const ENGINE_METHOD_ALL: number;
3891
+ const ENGINE_METHOD_NONE: number;
3892
+ const DH_CHECK_P_NOT_SAFE_PRIME: number;
3893
+ const DH_CHECK_P_NOT_PRIME: number;
3894
+ const DH_UNABLE_TO_CHECK_GENERATOR: number;
3895
+ const DH_NOT_SUITABLE_GENERATOR: number;
3896
+ const RSA_PKCS1_PADDING: number;
3897
+ const RSA_NO_PADDING: number;
3898
+ const RSA_PKCS1_OAEP_PADDING: number;
3899
+ const RSA_X931_PADDING: number;
3900
+ const RSA_PKCS1_PSS_PADDING: number;
3901
+ const RSA_PSS_SALTLEN_DIGEST: number;
3902
+ const RSA_PSS_SALTLEN_MAX_SIGN: number;
3903
+ const RSA_PSS_SALTLEN_AUTO: number;
3904
+ const TLS1_VERSION: number;
3905
+ const TLS1_1_VERSION: number;
3906
+ const TLS1_2_VERSION: number;
3907
+ const TLS1_3_VERSION: number;
3908
+ const POINT_CONVERSION_COMPRESSED: number;
3909
+ const POINT_CONVERSION_UNCOMPRESSED: number;
3910
+ const POINT_CONVERSION_HYBRID: number;
3911
+ const defaultCipherList: string;
3912
+ const defaultCoreCipherList: string;
3913
+ }
3914
+ // TODO: remove in future major version
3915
+ /** @deprecated This type will be removed in a future version. Use `BufferEncoding` instead. */
3916
+ type BinaryToTextEncoding = "base64" | "base64url" | "hex" | "binary";
3917
+ /** @deprecated This type will be removed in a future version. Use `BufferEncoding` instead. */
3918
+ type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "utf-16le" | "latin1";
3919
+ /** @deprecated This type will be removed in a future version. Use `BufferEncoding` instead. */
3920
+ type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2";
3921
+ /** @deprecated This type will be removed in a future version. Use `BufferEncoding` instead. */
3922
+ type Encoding = BufferEncoding;
3923
+ /** @deprecated This type will be removed in a future version. Use `KeyLike` instead. */
3924
+ type CipherKey = KeyLike;
3925
+ /** @deprecated This type will be removed in a future version. */
3926
+ interface RsaPrivateKey {
3927
+ key: KeyLike;
3928
+ passphrase?: string | undefined;
3929
+ oaepHash?: string | undefined;
3930
+ oaepLabel?: NodeJS.TypedArray | undefined;
3931
+ padding?: number | undefined;
3932
+ }
3933
+ /** @deprecated This type will be removed in a future version. */
3934
+ interface RsaPublicKey {
3935
+ key: KeyLike;
3936
+ padding?: number | undefined;
3937
+ }
3938
+ }
3939
+ declare module "crypto" {
3940
+ export * from "node:crypto";
3941
+ }