@wbce/projen-d9 0.0.28 → 0.1.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 (421) hide show
  1. package/.jsii +184 -45
  2. package/API.md +153 -37
  3. package/CHANGELOG.md +13 -0
  4. package/README.md +10 -3
  5. package/docs/D9-plumbing.md +189 -0
  6. package/lib/cli/atlas.d.ts +10 -0
  7. package/lib/cli/atlas.js +65 -0
  8. package/lib/cli/commands/cedar/cedar-format.d.ts +7 -0
  9. package/lib/cli/commands/cedar/cedar-format.js +75 -0
  10. package/lib/cli/commands/cedar/cedar-to-d9-translations.d.ts +12 -0
  11. package/lib/cli/commands/cedar/cedar-to-d9-translations.js +130 -0
  12. package/lib/cli/commands/cedar/cedar-to-d9.d.ts +57 -0
  13. package/lib/cli/commands/cedar/cedar-to-d9.js +221 -0
  14. package/lib/cli/commands/cedar/cedar-translations.d.ts +9 -0
  15. package/lib/cli/commands/cedar/cedar-translations.js +213 -0
  16. package/lib/cli/commands/cedar/d9-permission.d.ts +27 -0
  17. package/lib/cli/commands/cedar/d9-permission.js +45 -0
  18. package/lib/cli/commands/cedar/d9-to-cedar.d.ts +33 -0
  19. package/lib/cli/commands/cedar/d9-to-cedar.js +157 -0
  20. package/lib/cli/commands/cedar/roles-table.d.ts +14 -0
  21. package/lib/cli/commands/cedar/roles-table.js +29 -0
  22. package/lib/cli/commands/save/apply-snapshot.js +39 -30
  23. package/lib/cli/commands/save/check-unsaved.d.ts +9 -0
  24. package/lib/cli/commands/save/check-unsaved.js +81 -0
  25. package/lib/cli/commands/save/env.d.ts +33 -0
  26. package/lib/cli/commands/save/env.js +109 -0
  27. package/lib/cli/commands/save/save-snapshot.d.ts +9 -0
  28. package/lib/cli/commands/save/save-snapshot.js +232 -0
  29. package/lib/cli/commands/save/sync-files.d.ts +5 -0
  30. package/lib/cli/commands/save/sync-files.js +46 -0
  31. package/lib/cli/commands/save/transfer.d.ts +18 -0
  32. package/lib/cli/commands/save/transfer.js +96 -0
  33. package/lib/cli/commands/save/utils.d.ts +5 -0
  34. package/lib/cli/commands/save/utils.js +33 -3
  35. package/lib/cli/commands/sync.js +4 -3
  36. package/lib/cli/index.js +65 -25
  37. package/lib/cli/logger.d.ts +2 -0
  38. package/lib/cli/logger.js +10 -0
  39. package/lib/cli/plumbing-config.d.ts +11 -0
  40. package/lib/cli/plumbing-config.js +13 -0
  41. package/lib/index.d.ts +44 -5
  42. package/lib/index.js +54 -41
  43. package/node_modules/@cedar-policy/cedar-wasm/README.md +181 -0
  44. package/node_modules/@cedar-policy/cedar-wasm/esm/README.md +181 -0
  45. package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm.d.ts +427 -0
  46. package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm.js +9 -0
  47. package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm_bg.js +434 -0
  48. package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm_bg.wasm +0 -0
  49. package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm_bg.wasm.d.ts +34 -0
  50. package/node_modules/@cedar-policy/cedar-wasm/esm/package.json +23 -0
  51. package/node_modules/@cedar-policy/cedar-wasm/nodejs/README.md +181 -0
  52. package/node_modules/@cedar-policy/cedar-wasm/nodejs/cedar_wasm.d.ts +427 -0
  53. package/node_modules/@cedar-policy/cedar-wasm/nodejs/cedar_wasm.js +463 -0
  54. package/node_modules/@cedar-policy/cedar-wasm/nodejs/cedar_wasm_bg.wasm +0 -0
  55. package/node_modules/@cedar-policy/cedar-wasm/nodejs/cedar_wasm_bg.wasm.d.ts +34 -0
  56. package/node_modules/@cedar-policy/cedar-wasm/nodejs/package.json +18 -0
  57. package/node_modules/@cedar-policy/cedar-wasm/package.json +53 -0
  58. package/node_modules/@cedar-policy/cedar-wasm/web/README.md +181 -0
  59. package/node_modules/@cedar-policy/cedar-wasm/web/cedar_wasm.d.ts +486 -0
  60. package/node_modules/@cedar-policy/cedar-wasm/web/cedar_wasm.js +534 -0
  61. package/node_modules/@cedar-policy/cedar-wasm/web/cedar_wasm_bg.wasm +0 -0
  62. package/node_modules/@cedar-policy/cedar-wasm/web/cedar_wasm_bg.wasm.d.ts +34 -0
  63. package/node_modules/@cedar-policy/cedar-wasm/web/package.json +21 -0
  64. package/node_modules/@types/node/README.md +5 -6
  65. package/node_modules/@types/node/assert/strict.d.ts +111 -0
  66. package/node_modules/@types/node/assert.d.ts +1040 -79
  67. package/node_modules/@types/node/async_hooks.d.ts +476 -119
  68. package/node_modules/@types/node/buffer.buffer.d.ts +472 -0
  69. package/node_modules/@types/node/buffer.d.ts +1925 -13
  70. package/node_modules/@types/node/child_process.d.ts +1204 -235
  71. package/node_modules/@types/node/cluster.d.ts +455 -137
  72. package/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
  73. package/node_modules/@types/node/compatibility/index.d.ts +9 -0
  74. package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  75. package/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
  76. package/node_modules/@types/node/console.d.ts +450 -1
  77. package/node_modules/@types/node/constants.d.ts +20 -447
  78. package/node_modules/@types/node/crypto.d.ts +3962 -600
  79. package/node_modules/@types/node/dgram.d.ts +515 -33
  80. package/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
  81. package/node_modules/@types/node/dns/promises.d.ts +503 -0
  82. package/node_modules/@types/node/dns.d.ts +798 -247
  83. package/node_modules/@types/node/domain.d.ts +164 -10
  84. package/node_modules/@types/node/events.d.ts +954 -25
  85. package/node_modules/@types/node/fs/promises.d.ts +1295 -0
  86. package/node_modules/@types/node/fs.d.ts +3463 -1569
  87. package/node_modules/@types/node/globals.d.ts +98 -1277
  88. package/node_modules/@types/node/globals.typedarray.d.ts +38 -0
  89. package/node_modules/@types/node/http.d.ts +1933 -300
  90. package/node_modules/@types/node/http2.d.ts +1946 -254
  91. package/node_modules/@types/node/https.d.ts +557 -134
  92. package/node_modules/@types/node/index.d.ts +54 -48
  93. package/node_modules/@types/node/inspector.d.ts +227 -3014
  94. package/node_modules/@types/node/inspector.generated.d.ts +4052 -0
  95. package/node_modules/@types/node/module.d.ts +890 -2
  96. package/node_modules/@types/node/net.d.ts +872 -105
  97. package/node_modules/@types/node/os.d.ts +452 -209
  98. package/node_modules/@types/node/package.json +78 -128
  99. package/node_modules/@types/node/path.d.ts +196 -155
  100. package/node_modules/@types/node/perf_hooks.d.ts +829 -120
  101. package/node_modules/@types/node/process.d.ts +2072 -3
  102. package/node_modules/@types/node/punycode.d.ts +69 -27
  103. package/node_modules/@types/node/querystring.d.ts +132 -9
  104. package/node_modules/@types/node/readline/promises.d.ts +161 -0
  105. package/node_modules/@types/node/readline.d.ts +485 -49
  106. package/node_modules/@types/node/repl.d.ts +121 -83
  107. package/node_modules/@types/node/sea.d.ts +153 -0
  108. package/node_modules/@types/node/sqlite.d.ts +721 -0
  109. package/node_modules/@types/node/stream/consumers.d.ts +38 -0
  110. package/node_modules/@types/node/stream/promises.d.ts +90 -0
  111. package/node_modules/@types/node/stream/web.d.ts +622 -0
  112. package/node_modules/@types/node/stream.d.ts +1470 -140
  113. package/node_modules/@types/node/string_decoder.d.ts +64 -4
  114. package/node_modules/@types/node/test.d.ts +2163 -0
  115. package/node_modules/@types/node/timers/promises.d.ts +108 -0
  116. package/node_modules/@types/node/timers.d.ts +284 -13
  117. package/node_modules/@types/node/tls.d.ts +850 -244
  118. package/node_modules/@types/node/trace_events.d.ts +147 -11
  119. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
  120. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
  121. package/node_modules/@types/node/ts5.6/index.d.ts +97 -0
  122. package/node_modules/@types/node/tty.d.ts +160 -18
  123. package/node_modules/@types/node/url.d.ts +890 -53
  124. package/node_modules/@types/node/util.d.ts +2566 -160
  125. package/node_modules/@types/node/v8.d.ts +806 -83
  126. package/node_modules/@types/node/vm.d.ts +932 -44
  127. package/node_modules/@types/node/wasi.d.ts +148 -22
  128. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  129. package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  130. package/node_modules/@types/node/web-globals/events.d.ts +97 -0
  131. package/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
  132. package/node_modules/@types/node/web-globals/navigator.d.ts +22 -0
  133. package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  134. package/node_modules/@types/node/worker_threads.d.ts +657 -80
  135. package/node_modules/@types/node/zlib.d.ts +510 -119
  136. package/node_modules/pino/.nojekyll +0 -0
  137. package/node_modules/pino/.prettierignore +1 -0
  138. package/node_modules/pino/CNAME +1 -0
  139. package/node_modules/pino/CONTRIBUTING.md +34 -0
  140. package/node_modules/pino/LICENSE +21 -0
  141. package/node_modules/pino/README.md +177 -0
  142. package/node_modules/pino/SECURITY.md +103 -0
  143. package/node_modules/pino/benchmarks/basic.bench.js +95 -0
  144. package/node_modules/pino/benchmarks/child-child.bench.js +52 -0
  145. package/node_modules/pino/benchmarks/child-creation.bench.js +73 -0
  146. package/node_modules/pino/benchmarks/child.bench.js +62 -0
  147. package/node_modules/pino/benchmarks/deep-object.bench.js +88 -0
  148. package/node_modules/pino/benchmarks/formatters.bench.js +50 -0
  149. package/node_modules/pino/benchmarks/internal/custom-levels.js +67 -0
  150. package/node_modules/pino/benchmarks/internal/just-pino-heavy.bench.js +76 -0
  151. package/node_modules/pino/benchmarks/internal/just-pino.bench.js +182 -0
  152. package/node_modules/pino/benchmarks/internal/parent-vs-child.bench.js +75 -0
  153. package/node_modules/pino/benchmarks/internal/redact.bench.js +86 -0
  154. package/node_modules/pino/benchmarks/long-string.bench.js +81 -0
  155. package/node_modules/pino/benchmarks/multi-arg.bench.js +193 -0
  156. package/node_modules/pino/benchmarks/multistream.js +98 -0
  157. package/node_modules/pino/benchmarks/object.bench.js +82 -0
  158. package/node_modules/pino/benchmarks/utils/generate-benchmark-doc.js +36 -0
  159. package/node_modules/pino/benchmarks/utils/runbench.js +138 -0
  160. package/node_modules/pino/benchmarks/utils/wrap-log-level.js +55 -0
  161. package/node_modules/pino/bin.js +6 -0
  162. package/node_modules/pino/browser.js +607 -0
  163. package/node_modules/pino/build/sync-version.js +25 -0
  164. package/node_modules/pino/docs/api.md +1664 -0
  165. package/node_modules/pino/docs/asynchronous.md +55 -0
  166. package/node_modules/pino/docs/benchmarks.md +55 -0
  167. package/node_modules/pino/docs/browser.md +341 -0
  168. package/node_modules/pino/docs/bundling.md +40 -0
  169. package/node_modules/pino/docs/child-loggers.md +116 -0
  170. package/node_modules/pino/docs/diagnostics.md +16 -0
  171. package/node_modules/pino/docs/ecosystem.md +87 -0
  172. package/node_modules/pino/docs/help.md +353 -0
  173. package/node_modules/pino/docs/lts.md +93 -0
  174. package/node_modules/pino/docs/pretty.md +38 -0
  175. package/node_modules/pino/docs/redaction.md +130 -0
  176. package/node_modules/pino/docs/transports.md +1447 -0
  177. package/node_modules/pino/docs/web.md +306 -0
  178. package/node_modules/pino/eslint.config.js +36 -0
  179. package/node_modules/pino/examples/basic.js +43 -0
  180. package/node_modules/pino/examples/transport.js +68 -0
  181. package/node_modules/pino/favicon.ico +0 -0
  182. package/node_modules/pino/file.js +12 -0
  183. package/node_modules/pino/inc-version.sh +42 -0
  184. package/node_modules/pino/index.html +55 -0
  185. package/node_modules/pino/lib/caller.js +40 -0
  186. package/node_modules/pino/lib/constants.js +28 -0
  187. package/node_modules/pino/lib/deprecations.js +8 -0
  188. package/node_modules/pino/lib/levels.js +241 -0
  189. package/node_modules/pino/lib/meta.js +3 -0
  190. package/node_modules/pino/lib/multistream.js +211 -0
  191. package/node_modules/pino/lib/proto.js +256 -0
  192. package/node_modules/pino/lib/redaction.js +119 -0
  193. package/node_modules/pino/lib/symbols.js +76 -0
  194. package/node_modules/pino/lib/time.js +39 -0
  195. package/node_modules/pino/lib/tools.js +427 -0
  196. package/node_modules/pino/lib/transport-stream.js +56 -0
  197. package/node_modules/pino/lib/transport.js +302 -0
  198. package/node_modules/pino/lib/worker.js +197 -0
  199. package/node_modules/pino/package.json +112 -0
  200. package/node_modules/pino/pino.d.ts +881 -0
  201. package/node_modules/pino/pino.js +259 -0
  202. package/node_modules/pino/test/basic.test.js +952 -0
  203. package/node_modules/pino/test/broken-pipe.test.js +59 -0
  204. package/node_modules/pino/test/browser-bindings.test.js +114 -0
  205. package/node_modules/pino/test/browser-child.test.js +132 -0
  206. package/node_modules/pino/test/browser-disabled.test.js +87 -0
  207. package/node_modules/pino/test/browser-early-console-freeze.test.js +12 -0
  208. package/node_modules/pino/test/browser-is-level-enabled.test.js +101 -0
  209. package/node_modules/pino/test/browser-levels.test.js +241 -0
  210. package/node_modules/pino/test/browser-redaction.test.js +264 -0
  211. package/node_modules/pino/test/browser-serializers.test.js +352 -0
  212. package/node_modules/pino/test/browser-set-bindings.test.js +99 -0
  213. package/node_modules/pino/test/browser-timestamp.test.js +88 -0
  214. package/node_modules/pino/test/browser-transmit.test.js +417 -0
  215. package/node_modules/pino/test/browser.test.js +698 -0
  216. package/node_modules/pino/test/caller.test.js +20 -0
  217. package/node_modules/pino/test/complex-objects.test.js +36 -0
  218. package/node_modules/pino/test/crlf.test.js +34 -0
  219. package/node_modules/pino/test/custom-levels.test.js +267 -0
  220. package/node_modules/pino/test/diagnostics.test.js +107 -0
  221. package/node_modules/pino/test/error-key.test.js +37 -0
  222. package/node_modules/pino/test/error.test.js +403 -0
  223. package/node_modules/pino/test/escaping.test.js +110 -0
  224. package/node_modules/pino/test/esm/esm.mjs +14 -0
  225. package/node_modules/pino/test/esm/index.test.js +21 -0
  226. package/node_modules/pino/test/esm/named-exports.mjs +29 -0
  227. package/node_modules/pino/test/exit.test.js +79 -0
  228. package/node_modules/pino/test/fixtures/broken-pipe/basic.js +9 -0
  229. package/node_modules/pino/test/fixtures/broken-pipe/destination.js +10 -0
  230. package/node_modules/pino/test/fixtures/broken-pipe/syncfalse.js +12 -0
  231. package/node_modules/pino/test/fixtures/caller-loop.js +6 -0
  232. package/node_modules/pino/test/fixtures/console-transport.js +13 -0
  233. package/node_modules/pino/test/fixtures/crashing-transport.js +13 -0
  234. package/node_modules/pino/test/fixtures/default-exit.js +8 -0
  235. package/node_modules/pino/test/fixtures/destination-exit.js +8 -0
  236. package/node_modules/pino/test/fixtures/eval/index.js +13 -0
  237. package/node_modules/pino/test/fixtures/eval/node_modules/14-files.js +3 -0
  238. package/node_modules/pino/test/fixtures/eval/node_modules/2-files.js +3 -0
  239. package/node_modules/pino/test/fixtures/eval/node_modules/file1.js +5 -0
  240. package/node_modules/pino/test/fixtures/eval/node_modules/file10.js +5 -0
  241. package/node_modules/pino/test/fixtures/eval/node_modules/file11.js +5 -0
  242. package/node_modules/pino/test/fixtures/eval/node_modules/file12.js +5 -0
  243. package/node_modules/pino/test/fixtures/eval/node_modules/file13.js +5 -0
  244. package/node_modules/pino/test/fixtures/eval/node_modules/file14.js +11 -0
  245. package/node_modules/pino/test/fixtures/eval/node_modules/file2.js +5 -0
  246. package/node_modules/pino/test/fixtures/eval/node_modules/file3.js +5 -0
  247. package/node_modules/pino/test/fixtures/eval/node_modules/file4.js +5 -0
  248. package/node_modules/pino/test/fixtures/eval/node_modules/file5.js +5 -0
  249. package/node_modules/pino/test/fixtures/eval/node_modules/file6.js +5 -0
  250. package/node_modules/pino/test/fixtures/eval/node_modules/file7.js +5 -0
  251. package/node_modules/pino/test/fixtures/eval/node_modules/file8.js +5 -0
  252. package/node_modules/pino/test/fixtures/eval/node_modules/file9.js +5 -0
  253. package/node_modules/pino/test/fixtures/noop-transport.js +10 -0
  254. package/node_modules/pino/test/fixtures/pretty/null-prototype.js +8 -0
  255. package/node_modules/pino/test/fixtures/stdout-hack-protection.js +11 -0
  256. package/node_modules/pino/test/fixtures/syncfalse-child.js +6 -0
  257. package/node_modules/pino/test/fixtures/syncfalse-exit.js +9 -0
  258. package/node_modules/pino/test/fixtures/syncfalse-flush-exit.js +10 -0
  259. package/node_modules/pino/test/fixtures/syncfalse.js +6 -0
  260. package/node_modules/pino/test/fixtures/syntax-error-esm.mjs +2 -0
  261. package/node_modules/pino/test/fixtures/to-file-transport-with-transform.js +20 -0
  262. package/node_modules/pino/test/fixtures/to-file-transport.js +13 -0
  263. package/node_modules/pino/test/fixtures/to-file-transport.mjs +8 -0
  264. package/node_modules/pino/test/fixtures/transport/index.js +12 -0
  265. package/node_modules/pino/test/fixtures/transport/package.json +5 -0
  266. package/node_modules/pino/test/fixtures/transport-exit-immediately-with-async-dest.js +16 -0
  267. package/node_modules/pino/test/fixtures/transport-exit-immediately.js +11 -0
  268. package/node_modules/pino/test/fixtures/transport-exit-on-ready.js +12 -0
  269. package/node_modules/pino/test/fixtures/transport-invalid-node-options.js +26 -0
  270. package/node_modules/pino/test/fixtures/transport-main.js +9 -0
  271. package/node_modules/pino/test/fixtures/transport-many-lines.js +29 -0
  272. package/node_modules/pino/test/fixtures/transport-preload-main.mjs +13 -0
  273. package/node_modules/pino/test/fixtures/transport-preload.mjs +13 -0
  274. package/node_modules/pino/test/fixtures/transport-string-stdout.js +9 -0
  275. package/node_modules/pino/test/fixtures/transport-transform.js +21 -0
  276. package/node_modules/pino/test/fixtures/transport-uses-pino-config.js +33 -0
  277. package/node_modules/pino/test/fixtures/transport-with-on-exit.js +12 -0
  278. package/node_modules/pino/test/fixtures/transport-worker-data.js +19 -0
  279. package/node_modules/pino/test/fixtures/transport-worker-name.js +24 -0
  280. package/node_modules/pino/test/fixtures/transport-worker.js +15 -0
  281. package/node_modules/pino/test/fixtures/transport-wrong-export-type.js +3 -0
  282. package/node_modules/pino/test/fixtures/ts/to-file-transport-native.mts +15 -0
  283. package/node_modules/pino/test/fixtures/ts/to-file-transport-with-transform.ts +18 -0
  284. package/node_modules/pino/test/fixtures/ts/to-file-transport.ts +11 -0
  285. package/node_modules/pino/test/fixtures/ts/transpile.cjs +36 -0
  286. package/node_modules/pino/test/fixtures/ts/transport-exit-immediately-with-async-dest.ts +15 -0
  287. package/node_modules/pino/test/fixtures/ts/transport-exit-immediately.ts +10 -0
  288. package/node_modules/pino/test/fixtures/ts/transport-exit-on-ready.ts +11 -0
  289. package/node_modules/pino/test/fixtures/ts/transport-main.ts +8 -0
  290. package/node_modules/pino/test/fixtures/ts/transport-string-stdout.ts +8 -0
  291. package/node_modules/pino/test/fixtures/ts/transport-worker.ts +14 -0
  292. package/node_modules/pino/test/formatters.test.js +364 -0
  293. package/node_modules/pino/test/helper.d.ts +4 -0
  294. package/node_modules/pino/test/helper.js +159 -0
  295. package/node_modules/pino/test/hooks.test.js +114 -0
  296. package/node_modules/pino/test/http.test.js +214 -0
  297. package/node_modules/pino/test/internals/version.test.js +17 -0
  298. package/node_modules/pino/test/is-level-enabled.test.js +179 -0
  299. package/node_modules/pino/test/jest/basic.spec.js +10 -0
  300. package/node_modules/pino/test/levels.test.js +810 -0
  301. package/node_modules/pino/test/metadata.test.js +120 -0
  302. package/node_modules/pino/test/mixin-merge-strategy.test.js +57 -0
  303. package/node_modules/pino/test/mixin.test.js +241 -0
  304. package/node_modules/pino/test/multistream.test.js +793 -0
  305. package/node_modules/pino/test/redact.test.js +923 -0
  306. package/node_modules/pino/test/serializers.test.js +257 -0
  307. package/node_modules/pino/test/smoke.js +59 -0
  308. package/node_modules/pino/test/stdout-protection.test.js +41 -0
  309. package/node_modules/pino/test/syncfalse.test.js +186 -0
  310. package/node_modules/pino/test/timestamp-nano.test.js +37 -0
  311. package/node_modules/pino/test/timestamp.test.js +124 -0
  312. package/node_modules/pino/test/transport/big.test.js +42 -0
  313. package/node_modules/pino/test/transport/bundlers-support.test.js +99 -0
  314. package/node_modules/pino/test/transport/caller.test.js +24 -0
  315. package/node_modules/pino/test/transport/core.test.js +818 -0
  316. package/node_modules/pino/test/transport/core.transpiled.test.ts +114 -0
  317. package/node_modules/pino/test/transport/crash.test.js +36 -0
  318. package/node_modules/pino/test/transport/module-link.test.js +241 -0
  319. package/node_modules/pino/test/transport/native-type-stripping.test.mjs +151 -0
  320. package/node_modules/pino/test/transport/node-options.test.js +116 -0
  321. package/node_modules/pino/test/transport/pipeline.test.js +137 -0
  322. package/node_modules/pino/test/transport/preload.test.js +54 -0
  323. package/node_modules/pino/test/transport/repl.test.js +15 -0
  324. package/node_modules/pino/test/transport/sync-false.test.js +79 -0
  325. package/node_modules/pino/test/transport/sync-true.test.js +57 -0
  326. package/node_modules/pino/test/transport/targets.test.js +48 -0
  327. package/node_modules/pino/test/transport/uses-pino-config.test.js +166 -0
  328. package/node_modules/pino/test/transport-stream.test.js +40 -0
  329. package/node_modules/pino/test/types/pino-import.tst.cts +30 -0
  330. package/node_modules/pino/test/types/pino-import.tst.js +73 -0
  331. package/node_modules/pino/test/types/pino-multistream.tst.ts +49 -0
  332. package/node_modules/pino/test/types/pino-top-export.tst.ts +32 -0
  333. package/node_modules/pino/test/types/pino-transport.tst.ts +171 -0
  334. package/node_modules/pino/test/types/pino-type-only.tst.ts +77 -0
  335. package/node_modules/pino/test/types/pino.ts +98 -0
  336. package/node_modules/pino/test/types/pino.tst.ts +681 -0
  337. package/node_modules/pino/test/types/tsconfig.json +10 -0
  338. package/node_modules/pino/tsconfig.json +14 -0
  339. package/node_modules/pino-pretty/.borp.yaml +6 -0
  340. package/node_modules/pino-pretty/.editorconfig +13 -0
  341. package/node_modules/pino-pretty/.github/dependabot.yml +13 -0
  342. package/node_modules/pino-pretty/.github/workflows/ci.yml +83 -0
  343. package/node_modules/pino-pretty/LICENSE +21 -0
  344. package/node_modules/pino-pretty/Readme.md +425 -0
  345. package/node_modules/pino-pretty/SECURITY.md +146 -0
  346. package/node_modules/pino-pretty/benchmark.js +105 -0
  347. package/node_modules/pino-pretty/bin.js +113 -0
  348. package/node_modules/pino-pretty/demo.png +0 -0
  349. package/node_modules/pino-pretty/docs/help.md +24 -0
  350. package/node_modules/pino-pretty/eslint.config.js +5 -0
  351. package/node_modules/pino-pretty/help/help.txt +68 -0
  352. package/node_modules/pino-pretty/index.d.ts +227 -0
  353. package/node_modules/pino-pretty/index.js +234 -0
  354. package/node_modules/pino-pretty/lib/colors.js +134 -0
  355. package/node_modules/pino-pretty/lib/colors.test.js +132 -0
  356. package/node_modules/pino-pretty/lib/constants.js +55 -0
  357. package/node_modules/pino-pretty/lib/pretty.js +171 -0
  358. package/node_modules/pino-pretty/lib/utils/build-safe-sonic-boom.js +69 -0
  359. package/node_modules/pino-pretty/lib/utils/build-safe-sonic-boom.test.js +84 -0
  360. package/node_modules/pino-pretty/lib/utils/create-date.js +26 -0
  361. package/node_modules/pino-pretty/lib/utils/create-date.test.js +20 -0
  362. package/node_modules/pino-pretty/lib/utils/delete-log-property.js +28 -0
  363. package/node_modules/pino-pretty/lib/utils/delete-log-property.test.js +31 -0
  364. package/node_modules/pino-pretty/lib/utils/filter-log.js +99 -0
  365. package/node_modules/pino-pretty/lib/utils/filter-log.test.js +265 -0
  366. package/node_modules/pino-pretty/lib/utils/format-time.js +66 -0
  367. package/node_modules/pino-pretty/lib/utils/format-time.test.js +71 -0
  368. package/node_modules/pino-pretty/lib/utils/get-level-label-data.js +29 -0
  369. package/node_modules/pino-pretty/lib/utils/get-property-value.js +30 -0
  370. package/node_modules/pino-pretty/lib/utils/get-property-value.test.js +31 -0
  371. package/node_modules/pino-pretty/lib/utils/handle-custom-levels-names-opts.js +38 -0
  372. package/node_modules/pino-pretty/lib/utils/handle-custom-levels-names-opts.test.js +45 -0
  373. package/node_modules/pino-pretty/lib/utils/handle-custom-levels-opts.js +39 -0
  374. package/node_modules/pino-pretty/lib/utils/handle-custom-levels-opts.test.js +47 -0
  375. package/node_modules/pino-pretty/lib/utils/index.js +108 -0
  376. package/node_modules/pino-pretty/lib/utils/index.test.js +37 -0
  377. package/node_modules/pino-pretty/lib/utils/interpret-conditionals.js +41 -0
  378. package/node_modules/pino-pretty/lib/utils/interpret-conditionals.test.js +84 -0
  379. package/node_modules/pino-pretty/lib/utils/is-object.js +7 -0
  380. package/node_modules/pino-pretty/lib/utils/is-object.test.js +10 -0
  381. package/node_modules/pino-pretty/lib/utils/is-valid-date.js +14 -0
  382. package/node_modules/pino-pretty/lib/utils/is-valid-date.test.js +16 -0
  383. package/node_modules/pino-pretty/lib/utils/join-lines-with-indentation.js +29 -0
  384. package/node_modules/pino-pretty/lib/utils/join-lines-with-indentation.test.js +16 -0
  385. package/node_modules/pino-pretty/lib/utils/noop.js +3 -0
  386. package/node_modules/pino-pretty/lib/utils/noop.test.js +12 -0
  387. package/node_modules/pino-pretty/lib/utils/parse-factory-options.js +171 -0
  388. package/node_modules/pino-pretty/lib/utils/prettify-error-log.js +76 -0
  389. package/node_modules/pino-pretty/lib/utils/prettify-error-log.test.js +143 -0
  390. package/node_modules/pino-pretty/lib/utils/prettify-error.js +54 -0
  391. package/node_modules/pino-pretty/lib/utils/prettify-error.test.js +25 -0
  392. package/node_modules/pino-pretty/lib/utils/prettify-level.js +41 -0
  393. package/node_modules/pino-pretty/lib/utils/prettify-level.test.js +70 -0
  394. package/node_modules/pino-pretty/lib/utils/prettify-message.js +65 -0
  395. package/node_modules/pino-pretty/lib/utils/prettify-message.test.js +287 -0
  396. package/node_modules/pino-pretty/lib/utils/prettify-metadata.js +75 -0
  397. package/node_modules/pino-pretty/lib/utils/prettify-metadata.test.js +170 -0
  398. package/node_modules/pino-pretty/lib/utils/prettify-object.js +115 -0
  399. package/node_modules/pino-pretty/lib/utils/prettify-object.test.js +217 -0
  400. package/node_modules/pino-pretty/lib/utils/prettify-time.js +43 -0
  401. package/node_modules/pino-pretty/lib/utils/prettify-time.test.js +264 -0
  402. package/node_modules/pino-pretty/lib/utils/split-property-key.js +49 -0
  403. package/node_modules/pino-pretty/lib/utils/split-property-key.test.js +29 -0
  404. package/node_modules/pino-pretty/lib/utils/strip-unsafe-control-chars.js +18 -0
  405. package/node_modules/pino-pretty/lib/utils/strip-unsafe-control-chars.test.js +9 -0
  406. package/node_modules/pino-pretty/package.json +64 -0
  407. package/node_modules/pino-pretty/test/basic.test.js +1305 -0
  408. package/node_modules/pino-pretty/test/boolean-options.test.js +228 -0
  409. package/node_modules/pino-pretty/test/cli-rc.test.js +275 -0
  410. package/node_modules/pino-pretty/test/cli.test.js +360 -0
  411. package/node_modules/pino-pretty/test/crlf.test.js +33 -0
  412. package/node_modules/pino-pretty/test/error-objects.test.js +494 -0
  413. package/node_modules/pino-pretty/test/example/example.js +33 -0
  414. package/node_modules/pino-pretty/test/helper.js +19 -0
  415. package/node_modules/pino-pretty/test/types/exports.tst.ts +15 -0
  416. package/node_modules/pino-pretty/test/types/pino-pretty.tst.ts +140 -0
  417. package/node_modules/pino-pretty/test/types/tsconfig.json +9 -0
  418. package/package.json +12 -5
  419. package/lib/cli/commands/init.d.ts +0 -1
  420. package/lib/cli/commands/init.js +0 -8
  421. package/node_modules/@types/node/globals.global.d.ts +0 -1
@@ -1,81 +1,266 @@
1
- declare module 'dns' {
1
+ /**
2
+ * The `node:dns` module enables name resolution. For example, use it to look up IP
3
+ * addresses of host names.
4
+ *
5
+ * Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the
6
+ * DNS protocol for lookups. {@link lookup} uses the operating system
7
+ * facilities to perform name resolution. It may not need to perform any network
8
+ * communication. To perform name resolution the way other applications on the same
9
+ * system do, use {@link lookup}.
10
+ *
11
+ * ```js
12
+ * import dns from 'node:dns';
13
+ *
14
+ * dns.lookup('example.org', (err, address, family) => {
15
+ * console.log('address: %j family: IPv%s', address, family);
16
+ * });
17
+ * // address: "93.184.216.34" family: IPv4
18
+ * ```
19
+ *
20
+ * All other functions in the `node:dns` module connect to an actual DNS server to
21
+ * perform name resolution. They will always use the network to perform DNS
22
+ * queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform
23
+ * DNS queries, bypassing other name-resolution facilities.
24
+ *
25
+ * ```js
26
+ * import dns from 'node:dns';
27
+ *
28
+ * dns.resolve4('archive.org', (err, addresses) => {
29
+ * if (err) throw err;
30
+ *
31
+ * console.log(`addresses: ${JSON.stringify(addresses)}`);
32
+ *
33
+ * addresses.forEach((a) => {
34
+ * dns.reverse(a, (err, hostnames) => {
35
+ * if (err) {
36
+ * throw err;
37
+ * }
38
+ * console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`);
39
+ * });
40
+ * });
41
+ * });
42
+ * ```
43
+ *
44
+ * See the [Implementation considerations section](https://nodejs.org/docs/latest-v22.x/api/dns.html#implementation-considerations) for more information.
45
+ * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/dns.js)
46
+ */
47
+ declare module "dns" {
48
+ import * as dnsPromises from "node:dns/promises";
2
49
  // Supported getaddrinfo flags.
3
- const ADDRCONFIG: number;
4
- const V4MAPPED: number;
5
-
6
- interface LookupOptions {
7
- family?: number | undefined;
50
+ /**
51
+ * Limits returned address types to the types of non-loopback addresses configured on the system. For example, IPv4 addresses are
52
+ * only returned if the current system has at least one IPv4 address configured.
53
+ */
54
+ export const ADDRCONFIG: number;
55
+ /**
56
+ * If the IPv6 family was specified, but no IPv6 addresses were found, then return IPv4 mapped IPv6 addresses. It is not supported
57
+ * on some operating systems (e.g. FreeBSD 10.1).
58
+ */
59
+ export const V4MAPPED: number;
60
+ /**
61
+ * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as
62
+ * well as IPv4 mapped IPv6 addresses.
63
+ */
64
+ export const ALL: number;
65
+ export interface LookupOptions {
66
+ /**
67
+ * The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons, `'IPv4'` and `'IPv6'` are interpreted
68
+ * as `4` and `6` respectively. The value 0 indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used
69
+ * with `{ all: true } (see below)`, both IPv4 and IPv6 addresses are returned.
70
+ * @default 0
71
+ */
72
+ family?: number | "IPv4" | "IPv6" | undefined;
73
+ /**
74
+ * One or more [supported `getaddrinfo`](https://nodejs.org/docs/latest-v22.x/api/dns.html#supported-getaddrinfo-flags) flags. Multiple flags may be
75
+ * passed by bitwise `OR`ing their values.
76
+ */
8
77
  hints?: number | undefined;
78
+ /**
79
+ * When `true`, the callback returns all resolved addresses in an array. Otherwise, returns a single address.
80
+ * @default false
81
+ */
9
82
  all?: boolean | undefined;
83
+ /**
84
+ * When `verbatim`, the resolved addresses are return unsorted. When `ipv4first`, the resolved addresses are sorted
85
+ * by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6
86
+ * addresses before IPv4 addresses. Default value is configurable using
87
+ * {@link setDefaultResultOrder} or [`--dns-result-order`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--dns-result-orderorder).
88
+ * @default `verbatim` (addresses are not reordered)
89
+ * @since v22.1.0
90
+ */
91
+ order?: "ipv4first" | "ipv6first" | "verbatim" | undefined;
92
+ /**
93
+ * When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4
94
+ * addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified,
95
+ * `order` has higher precedence. New code should only use `order`. Default value is configurable using {@link setDefaultResultOrder}
96
+ * @default true (addresses are not reordered)
97
+ * @deprecated Please use `order` option
98
+ */
10
99
  verbatim?: boolean | undefined;
11
100
  }
12
-
13
- interface LookupOneOptions extends LookupOptions {
101
+ export interface LookupOneOptions extends LookupOptions {
14
102
  all?: false | undefined;
15
103
  }
16
-
17
- interface LookupAllOptions extends LookupOptions {
104
+ export interface LookupAllOptions extends LookupOptions {
18
105
  all: true;
19
106
  }
20
-
21
- interface LookupAddress {
107
+ export interface LookupAddress {
108
+ /**
109
+ * A string representation of an IPv4 or IPv6 address.
110
+ */
22
111
  address: string;
112
+ /**
113
+ * `4` or `6`, denoting the family of `address`, or `0` if the address is not an IPv4 or IPv6 address. `0` is a likely indicator of a
114
+ * bug in the name resolution service used by the operating system.
115
+ */
23
116
  family: number;
24
117
  }
25
-
26
- function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
27
- function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
28
- function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void;
29
- function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void;
30
- function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
31
-
32
- // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
33
- namespace lookup {
118
+ /**
119
+ * Resolves a host name (e.g. `'nodejs.org'`) into the first found A (IPv4) or
120
+ * AAAA (IPv6) record. All `option` properties are optional. If `options` is an
121
+ * integer, then it must be `4` or `6` – if `options` is `0` or not provided, then
122
+ * IPv4 and IPv6 addresses are both returned if found.
123
+ *
124
+ * With the `all` option set to `true`, the arguments for `callback` change to `(err, addresses)`, with `addresses` being an array of objects with the
125
+ * properties `address` and `family`.
126
+ *
127
+ * On error, `err` is an `Error` object, where `err.code` is the error code.
128
+ * Keep in mind that `err.code` will be set to `'ENOTFOUND'` not only when
129
+ * the host name does not exist but also when the lookup fails in other ways
130
+ * such as no available file descriptors.
131
+ *
132
+ * `dns.lookup()` does not necessarily have anything to do with the DNS protocol.
133
+ * The implementation uses an operating system facility that can associate names
134
+ * with addresses and vice versa. This implementation can have subtle but
135
+ * important consequences on the behavior of any Node.js program. Please take some
136
+ * time to consult the [Implementation considerations section](https://nodejs.org/docs/latest-v22.x/api/dns.html#implementation-considerations)
137
+ * before using `dns.lookup()`.
138
+ *
139
+ * Example usage:
140
+ *
141
+ * ```js
142
+ * import dns from 'node:dns';
143
+ * const options = {
144
+ * family: 6,
145
+ * hints: dns.ADDRCONFIG | dns.V4MAPPED,
146
+ * };
147
+ * dns.lookup('example.com', options, (err, address, family) =>
148
+ * console.log('address: %j family: IPv%s', address, family));
149
+ * // address: "2606:2800:220:1:248:1893:25c8:1946" family: IPv6
150
+ *
151
+ * // When options.all is true, the result will be an Array.
152
+ * options.all = true;
153
+ * dns.lookup('example.com', options, (err, addresses) =>
154
+ * console.log('addresses: %j', addresses));
155
+ * // addresses: [{"address":"2606:2800:220:1:248:1893:25c8:1946","family":6}]
156
+ * ```
157
+ *
158
+ * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v22.x/api/util.html#utilpromisifyoriginal) ed
159
+ * version, and `all` is not set to `true`, it returns a `Promise` for an `Object` with `address` and `family` properties.
160
+ * @since v0.1.90
161
+ */
162
+ export function lookup(
163
+ hostname: string,
164
+ family: number,
165
+ callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
166
+ ): void;
167
+ export function lookup(
168
+ hostname: string,
169
+ options: LookupOneOptions,
170
+ callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
171
+ ): void;
172
+ export function lookup(
173
+ hostname: string,
174
+ options: LookupAllOptions,
175
+ callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void,
176
+ ): void;
177
+ export function lookup(
178
+ hostname: string,
179
+ options: LookupOptions,
180
+ callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void,
181
+ ): void;
182
+ export function lookup(
183
+ hostname: string,
184
+ callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
185
+ ): void;
186
+ export namespace lookup {
34
187
  function __promisify__(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
35
188
  function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<LookupAddress>;
36
189
  function __promisify__(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
37
190
  }
38
-
39
- function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void;
40
-
41
- namespace lookupService {
42
- function __promisify__(address: string, port: number): Promise<{ hostname: string, service: string }>;
43
- }
44
-
45
- interface ResolveOptions {
191
+ /**
192
+ * Resolves the given `address` and `port` into a host name and service using
193
+ * the operating system's underlying `getnameinfo` implementation.
194
+ *
195
+ * If `address` is not a valid IP address, a `TypeError` will be thrown.
196
+ * The `port` will be coerced to a number. If it is not a legal port, a `TypeError` will be thrown.
197
+ *
198
+ * On an error, `err` is an [`Error`](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-error) object,
199
+ * where `err.code` is the error code.
200
+ *
201
+ * ```js
202
+ * import dns from 'node:dns';
203
+ * dns.lookupService('127.0.0.1', 22, (err, hostname, service) => {
204
+ * console.log(hostname, service);
205
+ * // Prints: localhost ssh
206
+ * });
207
+ * ```
208
+ *
209
+ * If this method is invoked as its [util.promisify()](https://nodejs.org/docs/latest-v22.x/api/util.html#utilpromisifyoriginal) ed
210
+ * version, it returns a `Promise` for an `Object` with `hostname` and `service` properties.
211
+ * @since v0.11.14
212
+ */
213
+ export function lookupService(
214
+ address: string,
215
+ port: number,
216
+ callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void,
217
+ ): void;
218
+ export namespace lookupService {
219
+ function __promisify__(
220
+ address: string,
221
+ port: number,
222
+ ): Promise<{
223
+ hostname: string;
224
+ service: string;
225
+ }>;
226
+ }
227
+ export interface ResolveOptions {
46
228
  ttl: boolean;
47
229
  }
48
-
49
- interface ResolveWithTtlOptions extends ResolveOptions {
230
+ export interface ResolveWithTtlOptions extends ResolveOptions {
50
231
  ttl: true;
51
232
  }
52
-
53
- interface RecordWithTtl {
233
+ export interface RecordWithTtl {
54
234
  address: string;
55
235
  ttl: number;
56
236
  }
57
-
58
- /** @deprecated Use AnyARecord or AnyAaaaRecord instead. */
59
- type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord;
60
-
61
- interface AnyARecord extends RecordWithTtl {
237
+ /** @deprecated Use `AnyARecord` or `AnyAaaaRecord` instead. */
238
+ export type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord;
239
+ export interface AnyARecord extends RecordWithTtl {
62
240
  type: "A";
63
241
  }
64
-
65
- interface AnyAaaaRecord extends RecordWithTtl {
242
+ export interface AnyAaaaRecord extends RecordWithTtl {
66
243
  type: "AAAA";
67
244
  }
68
-
69
- interface MxRecord {
245
+ export interface CaaRecord {
246
+ critical: number;
247
+ issue?: string | undefined;
248
+ issuewild?: string | undefined;
249
+ iodef?: string | undefined;
250
+ contactemail?: string | undefined;
251
+ contactphone?: string | undefined;
252
+ }
253
+ export interface AnyCaaRecord extends CaaRecord {
254
+ type: "CAA";
255
+ }
256
+ export interface MxRecord {
70
257
  priority: number;
71
258
  exchange: string;
72
259
  }
73
-
74
- interface AnyMxRecord extends MxRecord {
260
+ export interface AnyMxRecord extends MxRecord {
75
261
  type: "MX";
76
262
  }
77
-
78
- interface NaptrRecord {
263
+ export interface NaptrRecord {
79
264
  flags: string;
80
265
  service: string;
81
266
  regexp: string;
@@ -83,12 +268,10 @@ declare module 'dns' {
83
268
  order: number;
84
269
  preference: number;
85
270
  }
86
-
87
- interface AnyNaptrRecord extends NaptrRecord {
271
+ export interface AnyNaptrRecord extends NaptrRecord {
88
272
  type: "NAPTR";
89
273
  }
90
-
91
- interface SoaRecord {
274
+ export interface SoaRecord {
92
275
  nsname: string;
93
276
  hostmaster: string;
94
277
  serial: number;
@@ -97,192 +280,614 @@ declare module 'dns' {
97
280
  expire: number;
98
281
  minttl: number;
99
282
  }
100
-
101
- interface AnySoaRecord extends SoaRecord {
283
+ export interface AnySoaRecord extends SoaRecord {
102
284
  type: "SOA";
103
285
  }
104
-
105
- interface SrvRecord {
286
+ export interface SrvRecord {
106
287
  priority: number;
107
288
  weight: number;
108
289
  port: number;
109
290
  name: string;
110
291
  }
111
-
112
- interface AnySrvRecord extends SrvRecord {
292
+ export interface AnySrvRecord extends SrvRecord {
113
293
  type: "SRV";
114
294
  }
115
-
116
- interface AnyTxtRecord {
295
+ export interface TlsaRecord {
296
+ certUsage: number;
297
+ selector: number;
298
+ match: number;
299
+ data: ArrayBuffer;
300
+ }
301
+ export interface AnyTlsaRecord extends TlsaRecord {
302
+ type: "TLSA";
303
+ }
304
+ export interface AnyTxtRecord {
117
305
  type: "TXT";
118
306
  entries: string[];
119
307
  }
120
-
121
- interface AnyNsRecord {
308
+ export interface AnyNsRecord {
122
309
  type: "NS";
123
310
  value: string;
124
311
  }
125
-
126
- interface AnyPtrRecord {
312
+ export interface AnyPtrRecord {
127
313
  type: "PTR";
128
314
  value: string;
129
315
  }
130
-
131
- interface AnyCnameRecord {
316
+ export interface AnyCnameRecord {
132
317
  type: "CNAME";
133
318
  value: string;
134
319
  }
135
-
136
- type AnyRecord = AnyARecord |
137
- AnyAaaaRecord |
138
- AnyCnameRecord |
139
- AnyMxRecord |
140
- AnyNaptrRecord |
141
- AnyNsRecord |
142
- AnyPtrRecord |
143
- AnySoaRecord |
144
- AnySrvRecord |
145
- AnyTxtRecord;
146
-
147
- function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
148
- function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
149
- function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
150
- function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
151
- function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
152
- function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
153
- function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
154
- function resolve(hostname: string, rrtype: "NS", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
155
- function resolve(hostname: string, rrtype: "PTR", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
156
- function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void;
157
- function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
158
- function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
159
- function resolve(
320
+ export type AnyRecord =
321
+ | AnyARecord
322
+ | AnyAaaaRecord
323
+ | AnyCaaRecord
324
+ | AnyCnameRecord
325
+ | AnyMxRecord
326
+ | AnyNaptrRecord
327
+ | AnyNsRecord
328
+ | AnyPtrRecord
329
+ | AnySoaRecord
330
+ | AnySrvRecord
331
+ | AnyTlsaRecord
332
+ | AnyTxtRecord;
333
+ /**
334
+ * Uses the DNS protocol to resolve a host name (e.g. `'nodejs.org'`) into an array
335
+ * of the resource records. The `callback` function has arguments `(err, records)`. When successful, `records` will be an array of resource
336
+ * records. The type and structure of individual results varies based on `rrtype`:
337
+ *
338
+ * <omitted>
339
+ *
340
+ * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-error) object,
341
+ * where `err.code` is one of the `DNS error codes`.
342
+ * @since v0.1.27
343
+ * @param hostname Host name to resolve.
344
+ * @param [rrtype='A'] Resource record type.
345
+ */
346
+ export function resolve(
347
+ hostname: string,
348
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
349
+ ): void;
350
+ export function resolve(
351
+ hostname: string,
352
+ rrtype: "A" | "AAAA" | "CNAME" | "NS" | "PTR",
353
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
354
+ ): void;
355
+ export function resolve(
356
+ hostname: string,
357
+ rrtype: "ANY",
358
+ callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void,
359
+ ): void;
360
+ export function resolve(
361
+ hostname: string,
362
+ rrtype: "CAA",
363
+ callback: (err: NodeJS.ErrnoException | null, address: CaaRecord[]) => void,
364
+ ): void;
365
+ export function resolve(
366
+ hostname: string,
367
+ rrtype: "MX",
368
+ callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void,
369
+ ): void;
370
+ export function resolve(
371
+ hostname: string,
372
+ rrtype: "NAPTR",
373
+ callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
374
+ ): void;
375
+ export function resolve(
376
+ hostname: string,
377
+ rrtype: "SOA",
378
+ callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void,
379
+ ): void;
380
+ export function resolve(
381
+ hostname: string,
382
+ rrtype: "SRV",
383
+ callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
384
+ ): void;
385
+ export function resolve(
386
+ hostname: string,
387
+ rrtype: "TLSA",
388
+ callback: (err: NodeJS.ErrnoException | null, addresses: TlsaRecord[]) => void,
389
+ ): void;
390
+ export function resolve(
391
+ hostname: string,
392
+ rrtype: "TXT",
393
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void,
394
+ ): void;
395
+ export function resolve(
160
396
  hostname: string,
161
397
  rrtype: string,
162
- callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void,
398
+ callback: (
399
+ err: NodeJS.ErrnoException | null,
400
+ addresses:
401
+ | string[]
402
+ | CaaRecord[]
403
+ | MxRecord[]
404
+ | NaptrRecord[]
405
+ | SoaRecord
406
+ | SrvRecord[]
407
+ | TlsaRecord[]
408
+ | string[][]
409
+ | AnyRecord[],
410
+ ) => void,
163
411
  ): void;
164
-
165
- // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
166
- namespace resolve {
412
+ export namespace resolve {
167
413
  function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
168
414
  function __promisify__(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
415
+ function __promisify__(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
169
416
  function __promisify__(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
170
417
  function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
171
418
  function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
172
419
  function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
420
+ function __promisify__(hostname: string, rrtype: "TLSA"): Promise<TlsaRecord[]>;
173
421
  function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
174
- function __promisify__(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
175
- }
176
-
177
- function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
178
- function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
179
- function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void;
180
-
181
- // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
182
- namespace resolve4 {
422
+ function __promisify__(
423
+ hostname: string,
424
+ rrtype: string,
425
+ ): Promise<
426
+ | string[]
427
+ | CaaRecord[]
428
+ | MxRecord[]
429
+ | NaptrRecord[]
430
+ | SoaRecord
431
+ | SrvRecord[]
432
+ | TlsaRecord[]
433
+ | string[][]
434
+ | AnyRecord[]
435
+ >;
436
+ }
437
+ /**
438
+ * Uses the DNS protocol to resolve a IPv4 addresses (`A` records) for the `hostname`. The `addresses` argument passed to the `callback` function
439
+ * will contain an array of IPv4 addresses (e.g.`['74.125.79.104', '74.125.79.105', '74.125.79.106']`).
440
+ * @since v0.1.16
441
+ * @param hostname Host name to resolve.
442
+ */
443
+ export function resolve4(
444
+ hostname: string,
445
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
446
+ ): void;
447
+ export function resolve4(
448
+ hostname: string,
449
+ options: ResolveWithTtlOptions,
450
+ callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void,
451
+ ): void;
452
+ export function resolve4(
453
+ hostname: string,
454
+ options: ResolveOptions,
455
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void,
456
+ ): void;
457
+ export namespace resolve4 {
183
458
  function __promisify__(hostname: string): Promise<string[]>;
184
459
  function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
185
460
  function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
186
461
  }
187
-
188
- function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
189
- function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
190
- function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void;
191
-
192
- // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
193
- namespace resolve6 {
462
+ /**
463
+ * Uses the DNS protocol to resolve IPv6 addresses (`AAAA` records) for the `hostname`. The `addresses` argument passed to the `callback` function
464
+ * will contain an array of IPv6 addresses.
465
+ * @since v0.1.16
466
+ * @param hostname Host name to resolve.
467
+ */
468
+ export function resolve6(
469
+ hostname: string,
470
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
471
+ ): void;
472
+ export function resolve6(
473
+ hostname: string,
474
+ options: ResolveWithTtlOptions,
475
+ callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void,
476
+ ): void;
477
+ export function resolve6(
478
+ hostname: string,
479
+ options: ResolveOptions,
480
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void,
481
+ ): void;
482
+ export namespace resolve6 {
194
483
  function __promisify__(hostname: string): Promise<string[]>;
195
484
  function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
196
485
  function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
197
486
  }
198
-
199
- function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
200
- namespace resolveCname {
487
+ /**
488
+ * Uses the DNS protocol to resolve `CNAME` records for the `hostname`. The `addresses` argument passed to the `callback` function
489
+ * will contain an array of canonical name records available for the `hostname` (e.g. `['bar.example.com']`).
490
+ * @since v0.3.2
491
+ */
492
+ export function resolveCname(
493
+ hostname: string,
494
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
495
+ ): void;
496
+ export namespace resolveCname {
201
497
  function __promisify__(hostname: string): Promise<string[]>;
202
498
  }
203
-
204
- function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
205
- namespace resolveMx {
499
+ /**
500
+ * Uses the DNS protocol to resolve `CAA` records for the `hostname`. The `addresses` argument passed to the `callback` function
501
+ * will contain an array of certification authority authorization records
502
+ * available for the `hostname` (e.g. `[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]`).
503
+ * @since v15.0.0, v14.17.0
504
+ */
505
+ export function resolveCaa(
506
+ hostname: string,
507
+ callback: (err: NodeJS.ErrnoException | null, records: CaaRecord[]) => void,
508
+ ): void;
509
+ export namespace resolveCaa {
510
+ function __promisify__(hostname: string): Promise<CaaRecord[]>;
511
+ }
512
+ /**
513
+ * Uses the DNS protocol to resolve mail exchange records (`MX` records) for the `hostname`. The `addresses` argument passed to the `callback` function will
514
+ * contain an array of objects containing both a `priority` and `exchange` property (e.g. `[{priority: 10, exchange: 'mx.example.com'}, ...]`).
515
+ * @since v0.1.27
516
+ */
517
+ export function resolveMx(
518
+ hostname: string,
519
+ callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void,
520
+ ): void;
521
+ export namespace resolveMx {
206
522
  function __promisify__(hostname: string): Promise<MxRecord[]>;
207
523
  }
208
-
209
- function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
210
- namespace resolveNaptr {
524
+ /**
525
+ * Uses the DNS protocol to resolve regular expression-based records (`NAPTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will contain an array of
526
+ * objects with the following properties:
527
+ *
528
+ * * `flags`
529
+ * * `service`
530
+ * * `regexp`
531
+ * * `replacement`
532
+ * * `order`
533
+ * * `preference`
534
+ *
535
+ * ```js
536
+ * {
537
+ * flags: 's',
538
+ * service: 'SIP+D2U',
539
+ * regexp: '',
540
+ * replacement: '_sip._udp.example.com',
541
+ * order: 30,
542
+ * preference: 100
543
+ * }
544
+ * ```
545
+ * @since v0.9.12
546
+ */
547
+ export function resolveNaptr(
548
+ hostname: string,
549
+ callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void,
550
+ ): void;
551
+ export namespace resolveNaptr {
211
552
  function __promisify__(hostname: string): Promise<NaptrRecord[]>;
212
553
  }
213
-
214
- function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
215
- namespace resolveNs {
554
+ /**
555
+ * Uses the DNS protocol to resolve name server records (`NS` records) for the `hostname`. The `addresses` argument passed to the `callback` function will
556
+ * contain an array of name server records available for `hostname` (e.g. `['ns1.example.com', 'ns2.example.com']`).
557
+ * @since v0.1.90
558
+ */
559
+ export function resolveNs(
560
+ hostname: string,
561
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
562
+ ): void;
563
+ export namespace resolveNs {
216
564
  function __promisify__(hostname: string): Promise<string[]>;
217
565
  }
218
-
219
- function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
220
- namespace resolvePtr {
566
+ /**
567
+ * Uses the DNS protocol to resolve pointer records (`PTR` records) for the `hostname`. The `addresses` argument passed to the `callback` function will
568
+ * be an array of strings containing the reply records.
569
+ * @since v6.0.0
570
+ */
571
+ export function resolvePtr(
572
+ hostname: string,
573
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void,
574
+ ): void;
575
+ export namespace resolvePtr {
221
576
  function __promisify__(hostname: string): Promise<string[]>;
222
577
  }
223
-
224
- function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void;
225
- namespace resolveSoa {
578
+ /**
579
+ * Uses the DNS protocol to resolve a start of authority record (`SOA` record) for
580
+ * the `hostname`. The `address` argument passed to the `callback` function will
581
+ * be an object with the following properties:
582
+ *
583
+ * * `nsname`
584
+ * * `hostmaster`
585
+ * * `serial`
586
+ * * `refresh`
587
+ * * `retry`
588
+ * * `expire`
589
+ * * `minttl`
590
+ *
591
+ * ```js
592
+ * {
593
+ * nsname: 'ns.example.com',
594
+ * hostmaster: 'root.example.com',
595
+ * serial: 2013101809,
596
+ * refresh: 10000,
597
+ * retry: 2400,
598
+ * expire: 604800,
599
+ * minttl: 3600
600
+ * }
601
+ * ```
602
+ * @since v0.11.10
603
+ */
604
+ export function resolveSoa(
605
+ hostname: string,
606
+ callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void,
607
+ ): void;
608
+ export namespace resolveSoa {
226
609
  function __promisify__(hostname: string): Promise<SoaRecord>;
227
610
  }
228
-
229
- function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
230
- namespace resolveSrv {
611
+ /**
612
+ * Uses the DNS protocol to resolve service records (`SRV` records) for the `hostname`. The `addresses` argument passed to the `callback` function will
613
+ * be an array of objects with the following properties:
614
+ *
615
+ * * `priority`
616
+ * * `weight`
617
+ * * `port`
618
+ * * `name`
619
+ *
620
+ * ```js
621
+ * {
622
+ * priority: 10,
623
+ * weight: 5,
624
+ * port: 21223,
625
+ * name: 'service.example.com'
626
+ * }
627
+ * ```
628
+ * @since v0.1.27
629
+ */
630
+ export function resolveSrv(
631
+ hostname: string,
632
+ callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void,
633
+ ): void;
634
+ export namespace resolveSrv {
231
635
  function __promisify__(hostname: string): Promise<SrvRecord[]>;
232
636
  }
233
-
234
- function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
235
- namespace resolveTxt {
637
+ /**
638
+ * Uses the DNS protocol to resolve certificate associations (`TLSA` records) for
639
+ * the `hostname`. The `records` argument passed to the `callback` function is an
640
+ * array of objects with these properties:
641
+ *
642
+ * * `certUsage`
643
+ * * `selector`
644
+ * * `match`
645
+ * * `data`
646
+ *
647
+ * ```js
648
+ * {
649
+ * certUsage: 3,
650
+ * selector: 1,
651
+ * match: 1,
652
+ * data: [ArrayBuffer]
653
+ * }
654
+ * ```
655
+ * @since v22.15.0
656
+ */
657
+ export function resolveTlsa(
658
+ hostname: string,
659
+ callback: (err: NodeJS.ErrnoException | null, addresses: TlsaRecord[]) => void,
660
+ ): void;
661
+ export namespace resolveTlsa {
662
+ function __promisify__(hostname: string): Promise<TlsaRecord[]>;
663
+ }
664
+ /**
665
+ * Uses the DNS protocol to resolve text queries (`TXT` records) for the `hostname`. The `records` argument passed to the `callback` function is a
666
+ * two-dimensional array of the text records available for `hostname` (e.g.`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
667
+ * one record. Depending on the use case, these could be either joined together or
668
+ * treated separately.
669
+ * @since v0.1.27
670
+ */
671
+ export function resolveTxt(
672
+ hostname: string,
673
+ callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void,
674
+ ): void;
675
+ export namespace resolveTxt {
236
676
  function __promisify__(hostname: string): Promise<string[][]>;
237
677
  }
238
-
239
- function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
240
- namespace resolveAny {
678
+ /**
679
+ * Uses the DNS protocol to resolve all records (also known as `ANY` or `*` query).
680
+ * The `ret` argument passed to the `callback` function will be an array containing
681
+ * various types of records. Each object has a property `type` that indicates the
682
+ * type of the current record. And depending on the `type`, additional properties
683
+ * will be present on the object:
684
+ *
685
+ * <omitted>
686
+ *
687
+ * Here is an example of the `ret` object passed to the callback:
688
+ *
689
+ * ```js
690
+ * [ { type: 'A', address: '127.0.0.1', ttl: 299 },
691
+ * { type: 'CNAME', value: 'example.com' },
692
+ * { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 },
693
+ * { type: 'NS', value: 'ns1.example.com' },
694
+ * { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] },
695
+ * { type: 'SOA',
696
+ * nsname: 'ns1.example.com',
697
+ * hostmaster: 'admin.example.com',
698
+ * serial: 156696742,
699
+ * refresh: 900,
700
+ * retry: 900,
701
+ * expire: 1800,
702
+ * minttl: 60 } ]
703
+ * ```
704
+ *
705
+ * DNS server operators may choose not to respond to `ANY` queries. It may be better to call individual methods like {@link resolve4}, {@link resolveMx}, and so on. For more details, see
706
+ * [RFC 8482](https://tools.ietf.org/html/rfc8482).
707
+ */
708
+ export function resolveAny(
709
+ hostname: string,
710
+ callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void,
711
+ ): void;
712
+ export namespace resolveAny {
241
713
  function __promisify__(hostname: string): Promise<AnyRecord[]>;
242
714
  }
243
-
244
- function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void;
245
- function setServers(servers: ReadonlyArray<string>): void;
246
- function getServers(): string[];
247
-
715
+ /**
716
+ * Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an
717
+ * array of host names.
718
+ *
719
+ * On error, `err` is an [`Error`](https://nodejs.org/docs/latest-v22.x/api/errors.html#class-error) object, where `err.code` is
720
+ * one of the [DNS error codes](https://nodejs.org/docs/latest-v22.x/api/dns.html#error-codes).
721
+ * @since v0.1.16
722
+ */
723
+ export function reverse(
724
+ ip: string,
725
+ callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void,
726
+ ): void;
727
+ /**
728
+ * Get the default value for `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options).
729
+ * The value could be:
730
+ *
731
+ * * `ipv4first`: for `order` defaulting to `ipv4first`.
732
+ * * `ipv6first`: for `order` defaulting to `ipv6first`.
733
+ * * `verbatim`: for `order` defaulting to `verbatim`.
734
+ * @since v18.17.0
735
+ */
736
+ export function getDefaultResultOrder(): "ipv4first" | "ipv6first" | "verbatim";
737
+ /**
738
+ * Sets the IP address and port of servers to be used when performing DNS
739
+ * resolution. The `servers` argument is an array of [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6) formatted
740
+ * addresses. If the port is the IANA default DNS port (53) it can be omitted.
741
+ *
742
+ * ```js
743
+ * dns.setServers([
744
+ * '4.4.4.4',
745
+ * '[2001:4860:4860::8888]',
746
+ * '4.4.4.4:1053',
747
+ * '[2001:4860:4860::8888]:1053',
748
+ * ]);
749
+ * ```
750
+ *
751
+ * An error will be thrown if an invalid address is provided.
752
+ *
753
+ * The `dns.setServers()` method must not be called while a DNS query is in
754
+ * progress.
755
+ *
756
+ * The {@link setServers} method affects only {@link resolve}, `dns.resolve*()` and {@link reverse} (and specifically _not_ {@link lookup}).
757
+ *
758
+ * This method works much like [resolve.conf](https://man7.org/linux/man-pages/man5/resolv.conf.5.html).
759
+ * That is, if attempting to resolve with the first server provided results in a `NOTFOUND` error, the `resolve()` method will _not_ attempt to resolve with
760
+ * subsequent servers provided. Fallback DNS servers will only be used if the
761
+ * earlier ones time out or result in some other error.
762
+ * @since v0.11.3
763
+ * @param servers array of [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952#section-6) formatted addresses
764
+ */
765
+ export function setServers(servers: readonly string[]): void;
766
+ /**
767
+ * Returns an array of IP address strings, formatted according to [RFC 5952](https://tools.ietf.org/html/rfc5952#section-6),
768
+ * that are currently configured for DNS resolution. A string will include a port
769
+ * section if a custom port is used.
770
+ *
771
+ * ```js
772
+ * [
773
+ * '4.4.4.4',
774
+ * '2001:4860:4860::8888',
775
+ * '4.4.4.4:1053',
776
+ * '[2001:4860:4860::8888]:1053',
777
+ * ]
778
+ * ```
779
+ * @since v0.11.3
780
+ */
781
+ export function getServers(): string[];
782
+ /**
783
+ * Set the default value of `order` in {@link lookup} and [`dnsPromises.lookup()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnspromiseslookuphostname-options).
784
+ * The value could be:
785
+ *
786
+ * * `ipv4first`: sets default `order` to `ipv4first`.
787
+ * * `ipv6first`: sets default `order` to `ipv6first`.
788
+ * * `verbatim`: sets default `order` to `verbatim`.
789
+ *
790
+ * The default is `verbatim` and {@link setDefaultResultOrder} have higher
791
+ * priority than [`--dns-result-order`](https://nodejs.org/docs/latest-v22.x/api/cli.html#--dns-result-orderorder). When using
792
+ * [worker threads](https://nodejs.org/docs/latest-v22.x/api/worker_threads.html), {@link setDefaultResultOrder} from the main
793
+ * thread won't affect the default dns orders in workers.
794
+ * @since v16.4.0, v14.18.0
795
+ * @param order must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.
796
+ */
797
+ export function setDefaultResultOrder(order: "ipv4first" | "ipv6first" | "verbatim"): void;
248
798
  // Error codes
249
- const NODATA: string;
250
- const FORMERR: string;
251
- const SERVFAIL: string;
252
- const NOTFOUND: string;
253
- const NOTIMP: string;
254
- const REFUSED: string;
255
- const BADQUERY: string;
256
- const BADNAME: string;
257
- const BADFAMILY: string;
258
- const BADRESP: string;
259
- const CONNREFUSED: string;
260
- const TIMEOUT: string;
261
- const EOF: string;
262
- const FILE: string;
263
- const NOMEM: string;
264
- const DESTRUCTION: string;
265
- const BADSTR: string;
266
- const BADFLAGS: string;
267
- const NONAME: string;
268
- const BADHINTS: string;
269
- const NOTINITIALIZED: string;
270
- const LOADIPHLPAPI: string;
271
- const ADDRGETNETWORKPARAMS: string;
272
- const CANCELLED: string;
273
-
274
- interface ResolverOptions {
799
+ export const NODATA: "ENODATA";
800
+ export const FORMERR: "EFORMERR";
801
+ export const SERVFAIL: "ESERVFAIL";
802
+ export const NOTFOUND: "ENOTFOUND";
803
+ export const NOTIMP: "ENOTIMP";
804
+ export const REFUSED: "EREFUSED";
805
+ export const BADQUERY: "EBADQUERY";
806
+ export const BADNAME: "EBADNAME";
807
+ export const BADFAMILY: "EBADFAMILY";
808
+ export const BADRESP: "EBADRESP";
809
+ export const CONNREFUSED: "ECONNREFUSED";
810
+ export const TIMEOUT: "ETIMEOUT";
811
+ export const EOF: "EOF";
812
+ export const FILE: "EFILE";
813
+ export const NOMEM: "ENOMEM";
814
+ export const DESTRUCTION: "EDESTRUCTION";
815
+ export const BADSTR: "EBADSTR";
816
+ export const BADFLAGS: "EBADFLAGS";
817
+ export const NONAME: "ENONAME";
818
+ export const BADHINTS: "EBADHINTS";
819
+ export const NOTINITIALIZED: "ENOTINITIALIZED";
820
+ export const LOADIPHLPAPI: "ELOADIPHLPAPI";
821
+ export const ADDRGETNETWORKPARAMS: "EADDRGETNETWORKPARAMS";
822
+ export const CANCELLED: "ECANCELLED";
823
+ export interface ResolverOptions {
824
+ /**
825
+ * Query timeout in milliseconds, or `-1` to use the default timeout.
826
+ */
275
827
  timeout?: number | undefined;
276
- }
277
-
278
- class Resolver {
828
+ /**
829
+ * The number of tries the resolver will try contacting each name server before giving up.
830
+ * @default 4
831
+ */
832
+ tries?: number | undefined;
833
+ /**
834
+ * The max retry timeout, in milliseconds.
835
+ * @default 0
836
+ */
837
+ maxTimeout?: number | undefined;
838
+ }
839
+ /**
840
+ * An independent resolver for DNS requests.
841
+ *
842
+ * Creating a new resolver uses the default server settings. Setting
843
+ * the servers used for a resolver using [`resolver.setServers()`](https://nodejs.org/docs/latest-v22.x/api/dns.html#dnssetserversservers) does not affect
844
+ * other resolvers:
845
+ *
846
+ * ```js
847
+ * import { Resolver } from 'node:dns';
848
+ * const resolver = new Resolver();
849
+ * resolver.setServers(['4.4.4.4']);
850
+ *
851
+ * // This request will use the server at 4.4.4.4, independent of global settings.
852
+ * resolver.resolve4('example.org', (err, addresses) => {
853
+ * // ...
854
+ * });
855
+ * ```
856
+ *
857
+ * The following methods from the `node:dns` module are available:
858
+ *
859
+ * * `resolver.getServers()`
860
+ * * `resolver.resolve()`
861
+ * * `resolver.resolve4()`
862
+ * * `resolver.resolve6()`
863
+ * * `resolver.resolveAny()`
864
+ * * `resolver.resolveCaa()`
865
+ * * `resolver.resolveCname()`
866
+ * * `resolver.resolveMx()`
867
+ * * `resolver.resolveNaptr()`
868
+ * * `resolver.resolveNs()`
869
+ * * `resolver.resolvePtr()`
870
+ * * `resolver.resolveSoa()`
871
+ * * `resolver.resolveSrv()`
872
+ * * `resolver.resolveTxt()`
873
+ * * `resolver.reverse()`
874
+ * * `resolver.setServers()`
875
+ * @since v8.3.0
876
+ */
877
+ export class Resolver {
279
878
  constructor(options?: ResolverOptions);
879
+ /**
880
+ * Cancel all outstanding DNS queries made by this resolver. The corresponding
881
+ * callbacks will be called with an error with code `ECANCELLED`.
882
+ * @since v8.3.0
883
+ */
884
+ cancel(): void;
280
885
  getServers: typeof getServers;
281
- setServers: typeof setServers;
282
886
  resolve: typeof resolve;
283
887
  resolve4: typeof resolve4;
284
888
  resolve6: typeof resolve6;
285
889
  resolveAny: typeof resolveAny;
890
+ resolveCaa: typeof resolveCaa;
286
891
  resolveCname: typeof resolveCname;
287
892
  resolveMx: typeof resolveMx;
288
893
  resolveNaptr: typeof resolveNaptr;
@@ -290,83 +895,29 @@ declare module 'dns' {
290
895
  resolvePtr: typeof resolvePtr;
291
896
  resolveSoa: typeof resolveSoa;
292
897
  resolveSrv: typeof resolveSrv;
898
+ resolveTlsa: typeof resolveTlsa;
293
899
  resolveTxt: typeof resolveTxt;
294
900
  reverse: typeof reverse;
295
- cancel(): void;
296
- }
297
-
298
- namespace promises {
299
- function getServers(): string[];
300
-
301
- function lookup(hostname: string, family: number): Promise<LookupAddress>;
302
- function lookup(hostname: string, options: LookupOneOptions): Promise<LookupAddress>;
303
- function lookup(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
304
- function lookup(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
305
- function lookup(hostname: string): Promise<LookupAddress>;
306
-
307
- function lookupService(address: string, port: number): Promise<{ hostname: string, service: string }>;
308
-
309
- function resolve(hostname: string): Promise<string[]>;
310
- function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
311
- function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
312
- function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
313
- function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
314
- function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
315
- function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
316
- function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
317
- function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
318
- function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
319
- function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
320
- function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
321
- function resolve(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
322
-
323
- function resolve4(hostname: string): Promise<string[]>;
324
- function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
325
- function resolve4(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
326
-
327
- function resolve6(hostname: string): Promise<string[]>;
328
- function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
329
- function resolve6(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
330
-
331
- function resolveAny(hostname: string): Promise<AnyRecord[]>;
332
-
333
- function resolveCname(hostname: string): Promise<string[]>;
334
-
335
- function resolveMx(hostname: string): Promise<MxRecord[]>;
336
-
337
- function resolveNaptr(hostname: string): Promise<NaptrRecord[]>;
338
-
339
- function resolveNs(hostname: string): Promise<string[]>;
340
-
341
- function resolvePtr(hostname: string): Promise<string[]>;
342
-
343
- function resolveSoa(hostname: string): Promise<SoaRecord>;
344
-
345
- function resolveSrv(hostname: string): Promise<SrvRecord[]>;
346
-
347
- function resolveTxt(hostname: string): Promise<string[][]>;
348
-
349
- function reverse(ip: string): Promise<string[]>;
350
-
351
- function setServers(servers: ReadonlyArray<string>): void;
352
-
353
- class Resolver {
354
- constructor(options?: ResolverOptions);
355
- getServers: typeof getServers;
356
- resolve: typeof resolve;
357
- resolve4: typeof resolve4;
358
- resolve6: typeof resolve6;
359
- resolveAny: typeof resolveAny;
360
- resolveCname: typeof resolveCname;
361
- resolveMx: typeof resolveMx;
362
- resolveNaptr: typeof resolveNaptr;
363
- resolveNs: typeof resolveNs;
364
- resolvePtr: typeof resolvePtr;
365
- resolveSoa: typeof resolveSoa;
366
- resolveSrv: typeof resolveSrv;
367
- resolveTxt: typeof resolveTxt;
368
- reverse: typeof reverse;
369
- setServers: typeof setServers;
370
- }
901
+ /**
902
+ * The resolver instance will send its requests from the specified IP address.
903
+ * This allows programs to specify outbound interfaces when used on multi-homed
904
+ * systems.
905
+ *
906
+ * If a v4 or v6 address is not specified, it is set to the default and the
907
+ * operating system will choose a local address automatically.
908
+ *
909
+ * The resolver will use the v4 local address when making requests to IPv4 DNS
910
+ * servers, and the v6 local address when making requests to IPv6 DNS servers.
911
+ * The `rrtype` of resolution requests has no impact on the local address used.
912
+ * @since v15.1.0, v14.17.0
913
+ * @param [ipv4='0.0.0.0'] A string representation of an IPv4 address.
914
+ * @param [ipv6='::0'] A string representation of an IPv6 address.
915
+ */
916
+ setLocalAddress(ipv4?: string, ipv6?: string): void;
917
+ setServers: typeof setServers;
371
918
  }
919
+ export { dnsPromises as promises };
920
+ }
921
+ declare module "node:dns" {
922
+ export * from "dns";
372
923
  }