@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.
- package/.jsii +184 -45
- package/API.md +153 -37
- package/CHANGELOG.md +13 -0
- package/README.md +10 -3
- package/docs/D9-plumbing.md +189 -0
- package/lib/cli/atlas.d.ts +10 -0
- package/lib/cli/atlas.js +65 -0
- package/lib/cli/commands/cedar/cedar-format.d.ts +7 -0
- package/lib/cli/commands/cedar/cedar-format.js +75 -0
- package/lib/cli/commands/cedar/cedar-to-d9-translations.d.ts +12 -0
- package/lib/cli/commands/cedar/cedar-to-d9-translations.js +130 -0
- package/lib/cli/commands/cedar/cedar-to-d9.d.ts +57 -0
- package/lib/cli/commands/cedar/cedar-to-d9.js +221 -0
- package/lib/cli/commands/cedar/cedar-translations.d.ts +9 -0
- package/lib/cli/commands/cedar/cedar-translations.js +213 -0
- package/lib/cli/commands/cedar/d9-permission.d.ts +27 -0
- package/lib/cli/commands/cedar/d9-permission.js +45 -0
- package/lib/cli/commands/cedar/d9-to-cedar.d.ts +33 -0
- package/lib/cli/commands/cedar/d9-to-cedar.js +157 -0
- package/lib/cli/commands/cedar/roles-table.d.ts +14 -0
- package/lib/cli/commands/cedar/roles-table.js +29 -0
- package/lib/cli/commands/save/apply-snapshot.js +39 -30
- package/lib/cli/commands/save/check-unsaved.d.ts +9 -0
- package/lib/cli/commands/save/check-unsaved.js +81 -0
- package/lib/cli/commands/save/env.d.ts +33 -0
- package/lib/cli/commands/save/env.js +109 -0
- package/lib/cli/commands/save/save-snapshot.d.ts +9 -0
- package/lib/cli/commands/save/save-snapshot.js +232 -0
- package/lib/cli/commands/save/sync-files.d.ts +5 -0
- package/lib/cli/commands/save/sync-files.js +46 -0
- package/lib/cli/commands/save/transfer.d.ts +18 -0
- package/lib/cli/commands/save/transfer.js +96 -0
- package/lib/cli/commands/save/utils.d.ts +5 -0
- package/lib/cli/commands/save/utils.js +33 -3
- package/lib/cli/commands/sync.js +4 -3
- package/lib/cli/index.js +65 -25
- package/lib/cli/logger.d.ts +2 -0
- package/lib/cli/logger.js +10 -0
- package/lib/cli/plumbing-config.d.ts +11 -0
- package/lib/cli/plumbing-config.js +13 -0
- package/lib/index.d.ts +44 -5
- package/lib/index.js +54 -41
- package/node_modules/@cedar-policy/cedar-wasm/README.md +181 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/README.md +181 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm.d.ts +427 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm.js +9 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm_bg.js +434 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm_bg.wasm +0 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm_bg.wasm.d.ts +34 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/package.json +23 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/README.md +181 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/cedar_wasm.d.ts +427 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/cedar_wasm.js +463 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/cedar_wasm_bg.wasm +0 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/cedar_wasm_bg.wasm.d.ts +34 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/package.json +18 -0
- package/node_modules/@cedar-policy/cedar-wasm/package.json +53 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/README.md +181 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/cedar_wasm.d.ts +486 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/cedar_wasm.js +534 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/cedar_wasm_bg.wasm +0 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/cedar_wasm_bg.wasm.d.ts +34 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/package.json +21 -0
- package/node_modules/@types/node/README.md +5 -6
- package/node_modules/@types/node/assert/strict.d.ts +111 -0
- package/node_modules/@types/node/assert.d.ts +1040 -79
- package/node_modules/@types/node/async_hooks.d.ts +476 -119
- package/node_modules/@types/node/buffer.buffer.d.ts +472 -0
- package/node_modules/@types/node/buffer.d.ts +1925 -13
- package/node_modules/@types/node/child_process.d.ts +1204 -235
- package/node_modules/@types/node/cluster.d.ts +455 -137
- package/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
- package/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
- package/node_modules/@types/node/console.d.ts +450 -1
- package/node_modules/@types/node/constants.d.ts +20 -447
- package/node_modules/@types/node/crypto.d.ts +3962 -600
- package/node_modules/@types/node/dgram.d.ts +515 -33
- package/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
- package/node_modules/@types/node/dns/promises.d.ts +503 -0
- package/node_modules/@types/node/dns.d.ts +798 -247
- package/node_modules/@types/node/domain.d.ts +164 -10
- package/node_modules/@types/node/events.d.ts +954 -25
- package/node_modules/@types/node/fs/promises.d.ts +1295 -0
- package/node_modules/@types/node/fs.d.ts +3463 -1569
- package/node_modules/@types/node/globals.d.ts +98 -1277
- package/node_modules/@types/node/globals.typedarray.d.ts +38 -0
- package/node_modules/@types/node/http.d.ts +1933 -300
- package/node_modules/@types/node/http2.d.ts +1946 -254
- package/node_modules/@types/node/https.d.ts +557 -134
- package/node_modules/@types/node/index.d.ts +54 -48
- package/node_modules/@types/node/inspector.d.ts +227 -3014
- package/node_modules/@types/node/inspector.generated.d.ts +4052 -0
- package/node_modules/@types/node/module.d.ts +890 -2
- package/node_modules/@types/node/net.d.ts +872 -105
- package/node_modules/@types/node/os.d.ts +452 -209
- package/node_modules/@types/node/package.json +78 -128
- package/node_modules/@types/node/path.d.ts +196 -155
- package/node_modules/@types/node/perf_hooks.d.ts +829 -120
- package/node_modules/@types/node/process.d.ts +2072 -3
- package/node_modules/@types/node/punycode.d.ts +69 -27
- package/node_modules/@types/node/querystring.d.ts +132 -9
- package/node_modules/@types/node/readline/promises.d.ts +161 -0
- package/node_modules/@types/node/readline.d.ts +485 -49
- package/node_modules/@types/node/repl.d.ts +121 -83
- package/node_modules/@types/node/sea.d.ts +153 -0
- package/node_modules/@types/node/sqlite.d.ts +721 -0
- package/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/node_modules/@types/node/stream/web.d.ts +622 -0
- package/node_modules/@types/node/stream.d.ts +1470 -140
- package/node_modules/@types/node/string_decoder.d.ts +64 -4
- package/node_modules/@types/node/test.d.ts +2163 -0
- package/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/node_modules/@types/node/timers.d.ts +284 -13
- package/node_modules/@types/node/tls.d.ts +850 -244
- package/node_modules/@types/node/trace_events.d.ts +147 -11
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +97 -0
- package/node_modules/@types/node/tty.d.ts +160 -18
- package/node_modules/@types/node/url.d.ts +890 -53
- package/node_modules/@types/node/util.d.ts +2566 -160
- package/node_modules/@types/node/v8.d.ts +806 -83
- package/node_modules/@types/node/vm.d.ts +932 -44
- package/node_modules/@types/node/wasi.d.ts +148 -22
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
- package/node_modules/@types/node/web-globals/navigator.d.ts +22 -0
- package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/node_modules/@types/node/worker_threads.d.ts +657 -80
- package/node_modules/@types/node/zlib.d.ts +510 -119
- package/node_modules/pino/.nojekyll +0 -0
- package/node_modules/pino/.prettierignore +1 -0
- package/node_modules/pino/CNAME +1 -0
- package/node_modules/pino/CONTRIBUTING.md +34 -0
- package/node_modules/pino/LICENSE +21 -0
- package/node_modules/pino/README.md +177 -0
- package/node_modules/pino/SECURITY.md +103 -0
- package/node_modules/pino/benchmarks/basic.bench.js +95 -0
- package/node_modules/pino/benchmarks/child-child.bench.js +52 -0
- package/node_modules/pino/benchmarks/child-creation.bench.js +73 -0
- package/node_modules/pino/benchmarks/child.bench.js +62 -0
- package/node_modules/pino/benchmarks/deep-object.bench.js +88 -0
- package/node_modules/pino/benchmarks/formatters.bench.js +50 -0
- package/node_modules/pino/benchmarks/internal/custom-levels.js +67 -0
- package/node_modules/pino/benchmarks/internal/just-pino-heavy.bench.js +76 -0
- package/node_modules/pino/benchmarks/internal/just-pino.bench.js +182 -0
- package/node_modules/pino/benchmarks/internal/parent-vs-child.bench.js +75 -0
- package/node_modules/pino/benchmarks/internal/redact.bench.js +86 -0
- package/node_modules/pino/benchmarks/long-string.bench.js +81 -0
- package/node_modules/pino/benchmarks/multi-arg.bench.js +193 -0
- package/node_modules/pino/benchmarks/multistream.js +98 -0
- package/node_modules/pino/benchmarks/object.bench.js +82 -0
- package/node_modules/pino/benchmarks/utils/generate-benchmark-doc.js +36 -0
- package/node_modules/pino/benchmarks/utils/runbench.js +138 -0
- package/node_modules/pino/benchmarks/utils/wrap-log-level.js +55 -0
- package/node_modules/pino/bin.js +6 -0
- package/node_modules/pino/browser.js +607 -0
- package/node_modules/pino/build/sync-version.js +25 -0
- package/node_modules/pino/docs/api.md +1664 -0
- package/node_modules/pino/docs/asynchronous.md +55 -0
- package/node_modules/pino/docs/benchmarks.md +55 -0
- package/node_modules/pino/docs/browser.md +341 -0
- package/node_modules/pino/docs/bundling.md +40 -0
- package/node_modules/pino/docs/child-loggers.md +116 -0
- package/node_modules/pino/docs/diagnostics.md +16 -0
- package/node_modules/pino/docs/ecosystem.md +87 -0
- package/node_modules/pino/docs/help.md +353 -0
- package/node_modules/pino/docs/lts.md +93 -0
- package/node_modules/pino/docs/pretty.md +38 -0
- package/node_modules/pino/docs/redaction.md +130 -0
- package/node_modules/pino/docs/transports.md +1447 -0
- package/node_modules/pino/docs/web.md +306 -0
- package/node_modules/pino/eslint.config.js +36 -0
- package/node_modules/pino/examples/basic.js +43 -0
- package/node_modules/pino/examples/transport.js +68 -0
- package/node_modules/pino/favicon.ico +0 -0
- package/node_modules/pino/file.js +12 -0
- package/node_modules/pino/inc-version.sh +42 -0
- package/node_modules/pino/index.html +55 -0
- package/node_modules/pino/lib/caller.js +40 -0
- package/node_modules/pino/lib/constants.js +28 -0
- package/node_modules/pino/lib/deprecations.js +8 -0
- package/node_modules/pino/lib/levels.js +241 -0
- package/node_modules/pino/lib/meta.js +3 -0
- package/node_modules/pino/lib/multistream.js +211 -0
- package/node_modules/pino/lib/proto.js +256 -0
- package/node_modules/pino/lib/redaction.js +119 -0
- package/node_modules/pino/lib/symbols.js +76 -0
- package/node_modules/pino/lib/time.js +39 -0
- package/node_modules/pino/lib/tools.js +427 -0
- package/node_modules/pino/lib/transport-stream.js +56 -0
- package/node_modules/pino/lib/transport.js +302 -0
- package/node_modules/pino/lib/worker.js +197 -0
- package/node_modules/pino/package.json +112 -0
- package/node_modules/pino/pino.d.ts +881 -0
- package/node_modules/pino/pino.js +259 -0
- package/node_modules/pino/test/basic.test.js +952 -0
- package/node_modules/pino/test/broken-pipe.test.js +59 -0
- package/node_modules/pino/test/browser-bindings.test.js +114 -0
- package/node_modules/pino/test/browser-child.test.js +132 -0
- package/node_modules/pino/test/browser-disabled.test.js +87 -0
- package/node_modules/pino/test/browser-early-console-freeze.test.js +12 -0
- package/node_modules/pino/test/browser-is-level-enabled.test.js +101 -0
- package/node_modules/pino/test/browser-levels.test.js +241 -0
- package/node_modules/pino/test/browser-redaction.test.js +264 -0
- package/node_modules/pino/test/browser-serializers.test.js +352 -0
- package/node_modules/pino/test/browser-set-bindings.test.js +99 -0
- package/node_modules/pino/test/browser-timestamp.test.js +88 -0
- package/node_modules/pino/test/browser-transmit.test.js +417 -0
- package/node_modules/pino/test/browser.test.js +698 -0
- package/node_modules/pino/test/caller.test.js +20 -0
- package/node_modules/pino/test/complex-objects.test.js +36 -0
- package/node_modules/pino/test/crlf.test.js +34 -0
- package/node_modules/pino/test/custom-levels.test.js +267 -0
- package/node_modules/pino/test/diagnostics.test.js +107 -0
- package/node_modules/pino/test/error-key.test.js +37 -0
- package/node_modules/pino/test/error.test.js +403 -0
- package/node_modules/pino/test/escaping.test.js +110 -0
- package/node_modules/pino/test/esm/esm.mjs +14 -0
- package/node_modules/pino/test/esm/index.test.js +21 -0
- package/node_modules/pino/test/esm/named-exports.mjs +29 -0
- package/node_modules/pino/test/exit.test.js +79 -0
- package/node_modules/pino/test/fixtures/broken-pipe/basic.js +9 -0
- package/node_modules/pino/test/fixtures/broken-pipe/destination.js +10 -0
- package/node_modules/pino/test/fixtures/broken-pipe/syncfalse.js +12 -0
- package/node_modules/pino/test/fixtures/caller-loop.js +6 -0
- package/node_modules/pino/test/fixtures/console-transport.js +13 -0
- package/node_modules/pino/test/fixtures/crashing-transport.js +13 -0
- package/node_modules/pino/test/fixtures/default-exit.js +8 -0
- package/node_modules/pino/test/fixtures/destination-exit.js +8 -0
- package/node_modules/pino/test/fixtures/eval/index.js +13 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/14-files.js +3 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/2-files.js +3 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file1.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file10.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file11.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file12.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file13.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file14.js +11 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file2.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file3.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file4.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file5.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file6.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file7.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file8.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file9.js +5 -0
- package/node_modules/pino/test/fixtures/noop-transport.js +10 -0
- package/node_modules/pino/test/fixtures/pretty/null-prototype.js +8 -0
- package/node_modules/pino/test/fixtures/stdout-hack-protection.js +11 -0
- package/node_modules/pino/test/fixtures/syncfalse-child.js +6 -0
- package/node_modules/pino/test/fixtures/syncfalse-exit.js +9 -0
- package/node_modules/pino/test/fixtures/syncfalse-flush-exit.js +10 -0
- package/node_modules/pino/test/fixtures/syncfalse.js +6 -0
- package/node_modules/pino/test/fixtures/syntax-error-esm.mjs +2 -0
- package/node_modules/pino/test/fixtures/to-file-transport-with-transform.js +20 -0
- package/node_modules/pino/test/fixtures/to-file-transport.js +13 -0
- package/node_modules/pino/test/fixtures/to-file-transport.mjs +8 -0
- package/node_modules/pino/test/fixtures/transport/index.js +12 -0
- package/node_modules/pino/test/fixtures/transport/package.json +5 -0
- package/node_modules/pino/test/fixtures/transport-exit-immediately-with-async-dest.js +16 -0
- package/node_modules/pino/test/fixtures/transport-exit-immediately.js +11 -0
- package/node_modules/pino/test/fixtures/transport-exit-on-ready.js +12 -0
- package/node_modules/pino/test/fixtures/transport-invalid-node-options.js +26 -0
- package/node_modules/pino/test/fixtures/transport-main.js +9 -0
- package/node_modules/pino/test/fixtures/transport-many-lines.js +29 -0
- package/node_modules/pino/test/fixtures/transport-preload-main.mjs +13 -0
- package/node_modules/pino/test/fixtures/transport-preload.mjs +13 -0
- package/node_modules/pino/test/fixtures/transport-string-stdout.js +9 -0
- package/node_modules/pino/test/fixtures/transport-transform.js +21 -0
- package/node_modules/pino/test/fixtures/transport-uses-pino-config.js +33 -0
- package/node_modules/pino/test/fixtures/transport-with-on-exit.js +12 -0
- package/node_modules/pino/test/fixtures/transport-worker-data.js +19 -0
- package/node_modules/pino/test/fixtures/transport-worker-name.js +24 -0
- package/node_modules/pino/test/fixtures/transport-worker.js +15 -0
- package/node_modules/pino/test/fixtures/transport-wrong-export-type.js +3 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport-native.mts +15 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport-with-transform.ts +18 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport.ts +11 -0
- package/node_modules/pino/test/fixtures/ts/transpile.cjs +36 -0
- package/node_modules/pino/test/fixtures/ts/transport-exit-immediately-with-async-dest.ts +15 -0
- package/node_modules/pino/test/fixtures/ts/transport-exit-immediately.ts +10 -0
- package/node_modules/pino/test/fixtures/ts/transport-exit-on-ready.ts +11 -0
- package/node_modules/pino/test/fixtures/ts/transport-main.ts +8 -0
- package/node_modules/pino/test/fixtures/ts/transport-string-stdout.ts +8 -0
- package/node_modules/pino/test/fixtures/ts/transport-worker.ts +14 -0
- package/node_modules/pino/test/formatters.test.js +364 -0
- package/node_modules/pino/test/helper.d.ts +4 -0
- package/node_modules/pino/test/helper.js +159 -0
- package/node_modules/pino/test/hooks.test.js +114 -0
- package/node_modules/pino/test/http.test.js +214 -0
- package/node_modules/pino/test/internals/version.test.js +17 -0
- package/node_modules/pino/test/is-level-enabled.test.js +179 -0
- package/node_modules/pino/test/jest/basic.spec.js +10 -0
- package/node_modules/pino/test/levels.test.js +810 -0
- package/node_modules/pino/test/metadata.test.js +120 -0
- package/node_modules/pino/test/mixin-merge-strategy.test.js +57 -0
- package/node_modules/pino/test/mixin.test.js +241 -0
- package/node_modules/pino/test/multistream.test.js +793 -0
- package/node_modules/pino/test/redact.test.js +923 -0
- package/node_modules/pino/test/serializers.test.js +257 -0
- package/node_modules/pino/test/smoke.js +59 -0
- package/node_modules/pino/test/stdout-protection.test.js +41 -0
- package/node_modules/pino/test/syncfalse.test.js +186 -0
- package/node_modules/pino/test/timestamp-nano.test.js +37 -0
- package/node_modules/pino/test/timestamp.test.js +124 -0
- package/node_modules/pino/test/transport/big.test.js +42 -0
- package/node_modules/pino/test/transport/bundlers-support.test.js +99 -0
- package/node_modules/pino/test/transport/caller.test.js +24 -0
- package/node_modules/pino/test/transport/core.test.js +818 -0
- package/node_modules/pino/test/transport/core.transpiled.test.ts +114 -0
- package/node_modules/pino/test/transport/crash.test.js +36 -0
- package/node_modules/pino/test/transport/module-link.test.js +241 -0
- package/node_modules/pino/test/transport/native-type-stripping.test.mjs +151 -0
- package/node_modules/pino/test/transport/node-options.test.js +116 -0
- package/node_modules/pino/test/transport/pipeline.test.js +137 -0
- package/node_modules/pino/test/transport/preload.test.js +54 -0
- package/node_modules/pino/test/transport/repl.test.js +15 -0
- package/node_modules/pino/test/transport/sync-false.test.js +79 -0
- package/node_modules/pino/test/transport/sync-true.test.js +57 -0
- package/node_modules/pino/test/transport/targets.test.js +48 -0
- package/node_modules/pino/test/transport/uses-pino-config.test.js +166 -0
- package/node_modules/pino/test/transport-stream.test.js +40 -0
- package/node_modules/pino/test/types/pino-import.tst.cts +30 -0
- package/node_modules/pino/test/types/pino-import.tst.js +73 -0
- package/node_modules/pino/test/types/pino-multistream.tst.ts +49 -0
- package/node_modules/pino/test/types/pino-top-export.tst.ts +32 -0
- package/node_modules/pino/test/types/pino-transport.tst.ts +171 -0
- package/node_modules/pino/test/types/pino-type-only.tst.ts +77 -0
- package/node_modules/pino/test/types/pino.ts +98 -0
- package/node_modules/pino/test/types/pino.tst.ts +681 -0
- package/node_modules/pino/test/types/tsconfig.json +10 -0
- package/node_modules/pino/tsconfig.json +14 -0
- package/node_modules/pino-pretty/.borp.yaml +6 -0
- package/node_modules/pino-pretty/.editorconfig +13 -0
- package/node_modules/pino-pretty/.github/dependabot.yml +13 -0
- package/node_modules/pino-pretty/.github/workflows/ci.yml +83 -0
- package/node_modules/pino-pretty/LICENSE +21 -0
- package/node_modules/pino-pretty/Readme.md +425 -0
- package/node_modules/pino-pretty/SECURITY.md +146 -0
- package/node_modules/pino-pretty/benchmark.js +105 -0
- package/node_modules/pino-pretty/bin.js +113 -0
- package/node_modules/pino-pretty/demo.png +0 -0
- package/node_modules/pino-pretty/docs/help.md +24 -0
- package/node_modules/pino-pretty/eslint.config.js +5 -0
- package/node_modules/pino-pretty/help/help.txt +68 -0
- package/node_modules/pino-pretty/index.d.ts +227 -0
- package/node_modules/pino-pretty/index.js +234 -0
- package/node_modules/pino-pretty/lib/colors.js +134 -0
- package/node_modules/pino-pretty/lib/colors.test.js +132 -0
- package/node_modules/pino-pretty/lib/constants.js +55 -0
- package/node_modules/pino-pretty/lib/pretty.js +171 -0
- package/node_modules/pino-pretty/lib/utils/build-safe-sonic-boom.js +69 -0
- package/node_modules/pino-pretty/lib/utils/build-safe-sonic-boom.test.js +84 -0
- package/node_modules/pino-pretty/lib/utils/create-date.js +26 -0
- package/node_modules/pino-pretty/lib/utils/create-date.test.js +20 -0
- package/node_modules/pino-pretty/lib/utils/delete-log-property.js +28 -0
- package/node_modules/pino-pretty/lib/utils/delete-log-property.test.js +31 -0
- package/node_modules/pino-pretty/lib/utils/filter-log.js +99 -0
- package/node_modules/pino-pretty/lib/utils/filter-log.test.js +265 -0
- package/node_modules/pino-pretty/lib/utils/format-time.js +66 -0
- package/node_modules/pino-pretty/lib/utils/format-time.test.js +71 -0
- package/node_modules/pino-pretty/lib/utils/get-level-label-data.js +29 -0
- package/node_modules/pino-pretty/lib/utils/get-property-value.js +30 -0
- package/node_modules/pino-pretty/lib/utils/get-property-value.test.js +31 -0
- package/node_modules/pino-pretty/lib/utils/handle-custom-levels-names-opts.js +38 -0
- package/node_modules/pino-pretty/lib/utils/handle-custom-levels-names-opts.test.js +45 -0
- package/node_modules/pino-pretty/lib/utils/handle-custom-levels-opts.js +39 -0
- package/node_modules/pino-pretty/lib/utils/handle-custom-levels-opts.test.js +47 -0
- package/node_modules/pino-pretty/lib/utils/index.js +108 -0
- package/node_modules/pino-pretty/lib/utils/index.test.js +37 -0
- package/node_modules/pino-pretty/lib/utils/interpret-conditionals.js +41 -0
- package/node_modules/pino-pretty/lib/utils/interpret-conditionals.test.js +84 -0
- package/node_modules/pino-pretty/lib/utils/is-object.js +7 -0
- package/node_modules/pino-pretty/lib/utils/is-object.test.js +10 -0
- package/node_modules/pino-pretty/lib/utils/is-valid-date.js +14 -0
- package/node_modules/pino-pretty/lib/utils/is-valid-date.test.js +16 -0
- package/node_modules/pino-pretty/lib/utils/join-lines-with-indentation.js +29 -0
- package/node_modules/pino-pretty/lib/utils/join-lines-with-indentation.test.js +16 -0
- package/node_modules/pino-pretty/lib/utils/noop.js +3 -0
- package/node_modules/pino-pretty/lib/utils/noop.test.js +12 -0
- package/node_modules/pino-pretty/lib/utils/parse-factory-options.js +171 -0
- package/node_modules/pino-pretty/lib/utils/prettify-error-log.js +76 -0
- package/node_modules/pino-pretty/lib/utils/prettify-error-log.test.js +143 -0
- package/node_modules/pino-pretty/lib/utils/prettify-error.js +54 -0
- package/node_modules/pino-pretty/lib/utils/prettify-error.test.js +25 -0
- package/node_modules/pino-pretty/lib/utils/prettify-level.js +41 -0
- package/node_modules/pino-pretty/lib/utils/prettify-level.test.js +70 -0
- package/node_modules/pino-pretty/lib/utils/prettify-message.js +65 -0
- package/node_modules/pino-pretty/lib/utils/prettify-message.test.js +287 -0
- package/node_modules/pino-pretty/lib/utils/prettify-metadata.js +75 -0
- package/node_modules/pino-pretty/lib/utils/prettify-metadata.test.js +170 -0
- package/node_modules/pino-pretty/lib/utils/prettify-object.js +115 -0
- package/node_modules/pino-pretty/lib/utils/prettify-object.test.js +217 -0
- package/node_modules/pino-pretty/lib/utils/prettify-time.js +43 -0
- package/node_modules/pino-pretty/lib/utils/prettify-time.test.js +264 -0
- package/node_modules/pino-pretty/lib/utils/split-property-key.js +49 -0
- package/node_modules/pino-pretty/lib/utils/split-property-key.test.js +29 -0
- package/node_modules/pino-pretty/lib/utils/strip-unsafe-control-chars.js +18 -0
- package/node_modules/pino-pretty/lib/utils/strip-unsafe-control-chars.test.js +9 -0
- package/node_modules/pino-pretty/package.json +64 -0
- package/node_modules/pino-pretty/test/basic.test.js +1305 -0
- package/node_modules/pino-pretty/test/boolean-options.test.js +228 -0
- package/node_modules/pino-pretty/test/cli-rc.test.js +275 -0
- package/node_modules/pino-pretty/test/cli.test.js +360 -0
- package/node_modules/pino-pretty/test/crlf.test.js +33 -0
- package/node_modules/pino-pretty/test/error-objects.test.js +494 -0
- package/node_modules/pino-pretty/test/example/example.js +33 -0
- package/node_modules/pino-pretty/test/helper.js +19 -0
- package/node_modules/pino-pretty/test/types/exports.tst.ts +15 -0
- package/node_modules/pino-pretty/test/types/pino-pretty.tst.ts +140 -0
- package/node_modules/pino-pretty/test/types/tsconfig.json +9 -0
- package/package.json +12 -5
- package/lib/cli/commands/init.d.ts +0 -1
- package/lib/cli/commands/init.js +0 -8
- package/node_modules/@types/node/globals.global.d.ts +0 -1
|
@@ -1,156 +1,579 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
/**
|
|
2
|
+
* HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a
|
|
3
|
+
* separate module.
|
|
4
|
+
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/https.js)
|
|
5
|
+
*/
|
|
6
|
+
declare module "https" {
|
|
7
|
+
import { NonSharedBuffer } from "node:buffer";
|
|
8
|
+
import { Duplex } from "node:stream";
|
|
9
|
+
import * as tls from "node:tls";
|
|
10
|
+
import * as http from "node:http";
|
|
11
|
+
import { URL } from "node:url";
|
|
12
|
+
interface ServerOptions<
|
|
13
|
+
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
14
|
+
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse,
|
|
15
|
+
> extends http.ServerOptions<Request, Response>, tls.TlsOptions {}
|
|
16
|
+
interface RequestOptions extends http.RequestOptions, tls.SecureContextOptions {
|
|
17
|
+
checkServerIdentity?:
|
|
18
|
+
| ((hostname: string, cert: tls.DetailedPeerCertificate) => Error | undefined)
|
|
19
|
+
| undefined;
|
|
10
20
|
rejectUnauthorized?: boolean | undefined; // Defaults to true
|
|
11
21
|
servername?: string | undefined; // SNI TLS Extension
|
|
12
|
-
}
|
|
13
|
-
|
|
22
|
+
}
|
|
14
23
|
interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
|
|
15
|
-
rejectUnauthorized?: boolean | undefined;
|
|
16
24
|
maxCachedSessions?: number | undefined;
|
|
17
25
|
}
|
|
18
|
-
|
|
26
|
+
/**
|
|
27
|
+
* An `Agent` object for HTTPS similar to `http.Agent`. See {@link request} for more information.
|
|
28
|
+
* @since v0.4.5
|
|
29
|
+
*/
|
|
19
30
|
class Agent extends http.Agent {
|
|
20
31
|
constructor(options?: AgentOptions);
|
|
21
32
|
options: AgentOptions;
|
|
33
|
+
createConnection(
|
|
34
|
+
options: RequestOptions,
|
|
35
|
+
callback?: (err: Error | null, stream: Duplex) => void,
|
|
36
|
+
): Duplex | null | undefined;
|
|
37
|
+
getName(options?: RequestOptions): string;
|
|
22
38
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
interface Server<
|
|
40
|
+
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
41
|
+
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse,
|
|
42
|
+
> extends http.Server<Request, Response> {}
|
|
43
|
+
/**
|
|
44
|
+
* See `http.Server` for more information.
|
|
45
|
+
* @since v0.3.4
|
|
46
|
+
*/
|
|
47
|
+
class Server<
|
|
48
|
+
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
49
|
+
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse,
|
|
50
|
+
> extends tls.Server {
|
|
51
|
+
constructor(requestListener?: http.RequestListener<Request, Response>);
|
|
52
|
+
constructor(
|
|
53
|
+
options: ServerOptions<Request, Response>,
|
|
54
|
+
requestListener?: http.RequestListener<Request, Response>,
|
|
55
|
+
);
|
|
31
56
|
/**
|
|
32
|
-
*
|
|
33
|
-
* @
|
|
34
|
-
* {@link https://nodejs.org/api/http.html#http_server_maxheaderscount}
|
|
57
|
+
* Closes all connections connected to this server.
|
|
58
|
+
* @since v18.2.0
|
|
35
59
|
*/
|
|
36
|
-
|
|
37
|
-
timeout: number;
|
|
60
|
+
closeAllConnections(): void;
|
|
38
61
|
/**
|
|
39
|
-
*
|
|
40
|
-
* @
|
|
41
|
-
* {@link https://nodejs.org/api/http.html#http_server_headerstimeout}
|
|
62
|
+
* Closes all connections connected to this server which are not sending a request or waiting for a response.
|
|
63
|
+
* @since v18.2.0
|
|
42
64
|
*/
|
|
43
|
-
|
|
44
|
-
keepAliveTimeout: number;
|
|
65
|
+
closeIdleConnections(): void;
|
|
45
66
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
46
|
-
addListener(event:
|
|
47
|
-
addListener(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
addListener(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
addListener(
|
|
60
|
-
|
|
61
|
-
|
|
67
|
+
addListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
68
|
+
addListener(
|
|
69
|
+
event: "newSession",
|
|
70
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
71
|
+
): this;
|
|
72
|
+
addListener(
|
|
73
|
+
event: "OCSPRequest",
|
|
74
|
+
listener: (
|
|
75
|
+
certificate: NonSharedBuffer,
|
|
76
|
+
issuer: NonSharedBuffer,
|
|
77
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
78
|
+
) => void,
|
|
79
|
+
): this;
|
|
80
|
+
addListener(
|
|
81
|
+
event: "resumeSession",
|
|
82
|
+
listener: (
|
|
83
|
+
sessionId: NonSharedBuffer,
|
|
84
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
85
|
+
) => void,
|
|
86
|
+
): this;
|
|
87
|
+
addListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
88
|
+
addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
89
|
+
addListener(event: "close", listener: () => void): this;
|
|
90
|
+
addListener(event: "connection", listener: (socket: Duplex) => void): this;
|
|
91
|
+
addListener(event: "error", listener: (err: Error) => void): this;
|
|
92
|
+
addListener(event: "listening", listener: () => void): this;
|
|
93
|
+
addListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
|
|
94
|
+
addListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
|
|
95
|
+
addListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
|
96
|
+
addListener(
|
|
97
|
+
event: "connect",
|
|
98
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
99
|
+
): this;
|
|
100
|
+
addListener(event: "request", listener: http.RequestListener<Request, Response>): this;
|
|
101
|
+
addListener(
|
|
102
|
+
event: "upgrade",
|
|
103
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
104
|
+
): this;
|
|
62
105
|
emit(event: string, ...args: any[]): boolean;
|
|
63
|
-
emit(event:
|
|
64
|
-
emit(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
emit(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
emit(
|
|
77
|
-
|
|
78
|
-
|
|
106
|
+
emit(event: "keylog", line: NonSharedBuffer, tlsSocket: tls.TLSSocket): boolean;
|
|
107
|
+
emit(
|
|
108
|
+
event: "newSession",
|
|
109
|
+
sessionId: NonSharedBuffer,
|
|
110
|
+
sessionData: NonSharedBuffer,
|
|
111
|
+
callback: () => void,
|
|
112
|
+
): boolean;
|
|
113
|
+
emit(
|
|
114
|
+
event: "OCSPRequest",
|
|
115
|
+
certificate: NonSharedBuffer,
|
|
116
|
+
issuer: NonSharedBuffer,
|
|
117
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
118
|
+
): boolean;
|
|
119
|
+
emit(
|
|
120
|
+
event: "resumeSession",
|
|
121
|
+
sessionId: NonSharedBuffer,
|
|
122
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
123
|
+
): boolean;
|
|
124
|
+
emit(event: "secureConnection", tlsSocket: tls.TLSSocket): boolean;
|
|
125
|
+
emit(event: "tlsClientError", err: Error, tlsSocket: tls.TLSSocket): boolean;
|
|
126
|
+
emit(event: "close"): boolean;
|
|
127
|
+
emit(event: "connection", socket: Duplex): boolean;
|
|
128
|
+
emit(event: "error", err: Error): boolean;
|
|
129
|
+
emit(event: "listening"): boolean;
|
|
130
|
+
emit(
|
|
131
|
+
event: "checkContinue",
|
|
132
|
+
req: InstanceType<Request>,
|
|
133
|
+
res: InstanceType<Response>,
|
|
134
|
+
): boolean;
|
|
135
|
+
emit(
|
|
136
|
+
event: "checkExpectation",
|
|
137
|
+
req: InstanceType<Request>,
|
|
138
|
+
res: InstanceType<Response>,
|
|
139
|
+
): boolean;
|
|
140
|
+
emit(event: "clientError", err: Error, socket: Duplex): boolean;
|
|
141
|
+
emit(event: "connect", req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer): boolean;
|
|
142
|
+
emit(
|
|
143
|
+
event: "request",
|
|
144
|
+
req: InstanceType<Request>,
|
|
145
|
+
res: InstanceType<Response>,
|
|
146
|
+
): boolean;
|
|
147
|
+
emit(event: "upgrade", req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer): boolean;
|
|
79
148
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
80
|
-
on(event:
|
|
81
|
-
on(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
on(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
on(
|
|
94
|
-
|
|
95
|
-
|
|
149
|
+
on(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
150
|
+
on(
|
|
151
|
+
event: "newSession",
|
|
152
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
153
|
+
): this;
|
|
154
|
+
on(
|
|
155
|
+
event: "OCSPRequest",
|
|
156
|
+
listener: (
|
|
157
|
+
certificate: NonSharedBuffer,
|
|
158
|
+
issuer: NonSharedBuffer,
|
|
159
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
160
|
+
) => void,
|
|
161
|
+
): this;
|
|
162
|
+
on(
|
|
163
|
+
event: "resumeSession",
|
|
164
|
+
listener: (
|
|
165
|
+
sessionId: NonSharedBuffer,
|
|
166
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
167
|
+
) => void,
|
|
168
|
+
): this;
|
|
169
|
+
on(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
170
|
+
on(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
171
|
+
on(event: "close", listener: () => void): this;
|
|
172
|
+
on(event: "connection", listener: (socket: Duplex) => void): this;
|
|
173
|
+
on(event: "error", listener: (err: Error) => void): this;
|
|
174
|
+
on(event: "listening", listener: () => void): this;
|
|
175
|
+
on(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
|
|
176
|
+
on(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
|
|
177
|
+
on(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
|
178
|
+
on(
|
|
179
|
+
event: "connect",
|
|
180
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
181
|
+
): this;
|
|
182
|
+
on(event: "request", listener: http.RequestListener<Request, Response>): this;
|
|
183
|
+
on(
|
|
184
|
+
event: "upgrade",
|
|
185
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
186
|
+
): this;
|
|
96
187
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
97
|
-
once(event:
|
|
98
|
-
once(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
once(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
once(
|
|
111
|
-
|
|
112
|
-
|
|
188
|
+
once(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
189
|
+
once(
|
|
190
|
+
event: "newSession",
|
|
191
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
192
|
+
): this;
|
|
193
|
+
once(
|
|
194
|
+
event: "OCSPRequest",
|
|
195
|
+
listener: (
|
|
196
|
+
certificate: NonSharedBuffer,
|
|
197
|
+
issuer: NonSharedBuffer,
|
|
198
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
199
|
+
) => void,
|
|
200
|
+
): this;
|
|
201
|
+
once(
|
|
202
|
+
event: "resumeSession",
|
|
203
|
+
listener: (
|
|
204
|
+
sessionId: NonSharedBuffer,
|
|
205
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
206
|
+
) => void,
|
|
207
|
+
): this;
|
|
208
|
+
once(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
209
|
+
once(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
210
|
+
once(event: "close", listener: () => void): this;
|
|
211
|
+
once(event: "connection", listener: (socket: Duplex) => void): this;
|
|
212
|
+
once(event: "error", listener: (err: Error) => void): this;
|
|
213
|
+
once(event: "listening", listener: () => void): this;
|
|
214
|
+
once(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
|
|
215
|
+
once(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
|
|
216
|
+
once(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
|
217
|
+
once(
|
|
218
|
+
event: "connect",
|
|
219
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
220
|
+
): this;
|
|
221
|
+
once(event: "request", listener: http.RequestListener<Request, Response>): this;
|
|
222
|
+
once(
|
|
223
|
+
event: "upgrade",
|
|
224
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
225
|
+
): this;
|
|
113
226
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
114
|
-
prependListener(event:
|
|
115
|
-
prependListener(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
prependListener(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
prependListener(
|
|
128
|
-
|
|
129
|
-
|
|
227
|
+
prependListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
228
|
+
prependListener(
|
|
229
|
+
event: "newSession",
|
|
230
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
231
|
+
): this;
|
|
232
|
+
prependListener(
|
|
233
|
+
event: "OCSPRequest",
|
|
234
|
+
listener: (
|
|
235
|
+
certificate: NonSharedBuffer,
|
|
236
|
+
issuer: NonSharedBuffer,
|
|
237
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
238
|
+
) => void,
|
|
239
|
+
): this;
|
|
240
|
+
prependListener(
|
|
241
|
+
event: "resumeSession",
|
|
242
|
+
listener: (
|
|
243
|
+
sessionId: NonSharedBuffer,
|
|
244
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
245
|
+
) => void,
|
|
246
|
+
): this;
|
|
247
|
+
prependListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
248
|
+
prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
249
|
+
prependListener(event: "close", listener: () => void): this;
|
|
250
|
+
prependListener(event: "connection", listener: (socket: Duplex) => void): this;
|
|
251
|
+
prependListener(event: "error", listener: (err: Error) => void): this;
|
|
252
|
+
prependListener(event: "listening", listener: () => void): this;
|
|
253
|
+
prependListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
|
|
254
|
+
prependListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
|
|
255
|
+
prependListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
|
256
|
+
prependListener(
|
|
257
|
+
event: "connect",
|
|
258
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
259
|
+
): this;
|
|
260
|
+
prependListener(event: "request", listener: http.RequestListener<Request, Response>): this;
|
|
261
|
+
prependListener(
|
|
262
|
+
event: "upgrade",
|
|
263
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
264
|
+
): this;
|
|
130
265
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
131
|
-
prependOnceListener(event:
|
|
132
|
-
prependOnceListener(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
prependOnceListener(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
prependOnceListener(
|
|
145
|
-
|
|
146
|
-
|
|
266
|
+
prependOnceListener(event: "keylog", listener: (line: NonSharedBuffer, tlsSocket: tls.TLSSocket) => void): this;
|
|
267
|
+
prependOnceListener(
|
|
268
|
+
event: "newSession",
|
|
269
|
+
listener: (sessionId: NonSharedBuffer, sessionData: NonSharedBuffer, callback: () => void) => void,
|
|
270
|
+
): this;
|
|
271
|
+
prependOnceListener(
|
|
272
|
+
event: "OCSPRequest",
|
|
273
|
+
listener: (
|
|
274
|
+
certificate: NonSharedBuffer,
|
|
275
|
+
issuer: NonSharedBuffer,
|
|
276
|
+
callback: (err: Error | null, resp: Buffer | null) => void,
|
|
277
|
+
) => void,
|
|
278
|
+
): this;
|
|
279
|
+
prependOnceListener(
|
|
280
|
+
event: "resumeSession",
|
|
281
|
+
listener: (
|
|
282
|
+
sessionId: NonSharedBuffer,
|
|
283
|
+
callback: (err: Error | null, sessionData: Buffer | null) => void,
|
|
284
|
+
) => void,
|
|
285
|
+
): this;
|
|
286
|
+
prependOnceListener(event: "secureConnection", listener: (tlsSocket: tls.TLSSocket) => void): this;
|
|
287
|
+
prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: tls.TLSSocket) => void): this;
|
|
288
|
+
prependOnceListener(event: "close", listener: () => void): this;
|
|
289
|
+
prependOnceListener(event: "connection", listener: (socket: Duplex) => void): this;
|
|
290
|
+
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
|
291
|
+
prependOnceListener(event: "listening", listener: () => void): this;
|
|
292
|
+
prependOnceListener(event: "checkContinue", listener: http.RequestListener<Request, Response>): this;
|
|
293
|
+
prependOnceListener(event: "checkExpectation", listener: http.RequestListener<Request, Response>): this;
|
|
294
|
+
prependOnceListener(event: "clientError", listener: (err: Error, socket: Duplex) => void): this;
|
|
295
|
+
prependOnceListener(
|
|
296
|
+
event: "connect",
|
|
297
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
298
|
+
): this;
|
|
299
|
+
prependOnceListener(event: "request", listener: http.RequestListener<Request, Response>): this;
|
|
300
|
+
prependOnceListener(
|
|
301
|
+
event: "upgrade",
|
|
302
|
+
listener: (req: InstanceType<Request>, socket: Duplex, head: NonSharedBuffer) => void,
|
|
303
|
+
): this;
|
|
147
304
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
305
|
+
/**
|
|
306
|
+
* ```js
|
|
307
|
+
* // curl -k https://localhost:8000/
|
|
308
|
+
* import https from 'node:https';
|
|
309
|
+
* import fs from 'node:fs';
|
|
310
|
+
*
|
|
311
|
+
* const options = {
|
|
312
|
+
* key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
|
|
313
|
+
* cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),
|
|
314
|
+
* };
|
|
315
|
+
*
|
|
316
|
+
* https.createServer(options, (req, res) => {
|
|
317
|
+
* res.writeHead(200);
|
|
318
|
+
* res.end('hello world\n');
|
|
319
|
+
* }).listen(8000);
|
|
320
|
+
* ```
|
|
321
|
+
*
|
|
322
|
+
* Or
|
|
323
|
+
*
|
|
324
|
+
* ```js
|
|
325
|
+
* import https from 'node:https';
|
|
326
|
+
* import fs from 'node:fs';
|
|
327
|
+
*
|
|
328
|
+
* const options = {
|
|
329
|
+
* pfx: fs.readFileSync('test/fixtures/test_cert.pfx'),
|
|
330
|
+
* passphrase: 'sample',
|
|
331
|
+
* };
|
|
332
|
+
*
|
|
333
|
+
* https.createServer(options, (req, res) => {
|
|
334
|
+
* res.writeHead(200);
|
|
335
|
+
* res.end('hello world\n');
|
|
336
|
+
* }).listen(8000);
|
|
337
|
+
* ```
|
|
338
|
+
* @since v0.3.4
|
|
339
|
+
* @param options Accepts `options` from `createServer`, `createSecureContext` and `createServer`.
|
|
340
|
+
* @param requestListener A listener to be added to the `'request'` event.
|
|
341
|
+
*/
|
|
342
|
+
function createServer<
|
|
343
|
+
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
344
|
+
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse,
|
|
345
|
+
>(requestListener?: http.RequestListener<Request, Response>): Server<Request, Response>;
|
|
346
|
+
function createServer<
|
|
347
|
+
Request extends typeof http.IncomingMessage = typeof http.IncomingMessage,
|
|
348
|
+
Response extends typeof http.ServerResponse<InstanceType<Request>> = typeof http.ServerResponse,
|
|
349
|
+
>(
|
|
350
|
+
options: ServerOptions<Request, Response>,
|
|
351
|
+
requestListener?: http.RequestListener<Request, Response>,
|
|
352
|
+
): Server<Request, Response>;
|
|
353
|
+
/**
|
|
354
|
+
* Makes a request to a secure web server.
|
|
355
|
+
*
|
|
356
|
+
* The following additional `options` from `tls.connect()` are also accepted: `ca`, `cert`, `ciphers`, `clientCertEngine`, `crl`, `dhparam`, `ecdhCurve`, `honorCipherOrder`, `key`, `passphrase`,
|
|
357
|
+
* `pfx`, `rejectUnauthorized`, `secureOptions`, `secureProtocol`, `servername`, `sessionIdContext`, `highWaterMark`.
|
|
358
|
+
*
|
|
359
|
+
* `options` can be an object, a string, or a `URL` object. If `options` is a
|
|
360
|
+
* string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object.
|
|
361
|
+
*
|
|
362
|
+
* `https.request()` returns an instance of the `http.ClientRequest` class. The `ClientRequest` instance is a writable stream. If one needs to
|
|
363
|
+
* upload a file with a POST request, then write to the `ClientRequest` object.
|
|
364
|
+
*
|
|
365
|
+
* ```js
|
|
366
|
+
* import https from 'node:https';
|
|
367
|
+
*
|
|
368
|
+
* const options = {
|
|
369
|
+
* hostname: 'encrypted.google.com',
|
|
370
|
+
* port: 443,
|
|
371
|
+
* path: '/',
|
|
372
|
+
* method: 'GET',
|
|
373
|
+
* };
|
|
374
|
+
*
|
|
375
|
+
* const req = https.request(options, (res) => {
|
|
376
|
+
* console.log('statusCode:', res.statusCode);
|
|
377
|
+
* console.log('headers:', res.headers);
|
|
378
|
+
*
|
|
379
|
+
* res.on('data', (d) => {
|
|
380
|
+
* process.stdout.write(d);
|
|
381
|
+
* });
|
|
382
|
+
* });
|
|
383
|
+
*
|
|
384
|
+
* req.on('error', (e) => {
|
|
385
|
+
* console.error(e);
|
|
386
|
+
* });
|
|
387
|
+
* req.end();
|
|
388
|
+
* ```
|
|
389
|
+
*
|
|
390
|
+
* Example using options from `tls.connect()`:
|
|
391
|
+
*
|
|
392
|
+
* ```js
|
|
393
|
+
* const options = {
|
|
394
|
+
* hostname: 'encrypted.google.com',
|
|
395
|
+
* port: 443,
|
|
396
|
+
* path: '/',
|
|
397
|
+
* method: 'GET',
|
|
398
|
+
* key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
|
|
399
|
+
* cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),
|
|
400
|
+
* };
|
|
401
|
+
* options.agent = new https.Agent(options);
|
|
402
|
+
*
|
|
403
|
+
* const req = https.request(options, (res) => {
|
|
404
|
+
* // ...
|
|
405
|
+
* });
|
|
406
|
+
* ```
|
|
407
|
+
*
|
|
408
|
+
* Alternatively, opt out of connection pooling by not using an `Agent`.
|
|
409
|
+
*
|
|
410
|
+
* ```js
|
|
411
|
+
* const options = {
|
|
412
|
+
* hostname: 'encrypted.google.com',
|
|
413
|
+
* port: 443,
|
|
414
|
+
* path: '/',
|
|
415
|
+
* method: 'GET',
|
|
416
|
+
* key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
|
|
417
|
+
* cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem'),
|
|
418
|
+
* agent: false,
|
|
419
|
+
* };
|
|
420
|
+
*
|
|
421
|
+
* const req = https.request(options, (res) => {
|
|
422
|
+
* // ...
|
|
423
|
+
* });
|
|
424
|
+
* ```
|
|
425
|
+
*
|
|
426
|
+
* Example using a `URL` as `options`:
|
|
427
|
+
*
|
|
428
|
+
* ```js
|
|
429
|
+
* const options = new URL('https://abc:xyz@example.com');
|
|
430
|
+
*
|
|
431
|
+
* const req = https.request(options, (res) => {
|
|
432
|
+
* // ...
|
|
433
|
+
* });
|
|
434
|
+
* ```
|
|
435
|
+
*
|
|
436
|
+
* Example pinning on certificate fingerprint, or the public key (similar to`pin-sha256`):
|
|
437
|
+
*
|
|
438
|
+
* ```js
|
|
439
|
+
* import tls from 'node:tls';
|
|
440
|
+
* import https from 'node:https';
|
|
441
|
+
* import crypto from 'node:crypto';
|
|
442
|
+
*
|
|
443
|
+
* function sha256(s) {
|
|
444
|
+
* return crypto.createHash('sha256').update(s).digest('base64');
|
|
445
|
+
* }
|
|
446
|
+
* const options = {
|
|
447
|
+
* hostname: 'github.com',
|
|
448
|
+
* port: 443,
|
|
449
|
+
* path: '/',
|
|
450
|
+
* method: 'GET',
|
|
451
|
+
* checkServerIdentity: function(host, cert) {
|
|
452
|
+
* // Make sure the certificate is issued to the host we are connected to
|
|
453
|
+
* const err = tls.checkServerIdentity(host, cert);
|
|
454
|
+
* if (err) {
|
|
455
|
+
* return err;
|
|
456
|
+
* }
|
|
457
|
+
*
|
|
458
|
+
* // Pin the public key, similar to HPKP pin-sha256 pinning
|
|
459
|
+
* const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=';
|
|
460
|
+
* if (sha256(cert.pubkey) !== pubkey256) {
|
|
461
|
+
* const msg = 'Certificate verification error: ' +
|
|
462
|
+
* `The public key of '${cert.subject.CN}' ` +
|
|
463
|
+
* 'does not match our pinned fingerprint';
|
|
464
|
+
* return new Error(msg);
|
|
465
|
+
* }
|
|
466
|
+
*
|
|
467
|
+
* // Pin the exact certificate, rather than the pub key
|
|
468
|
+
* const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' +
|
|
469
|
+
* 'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16';
|
|
470
|
+
* if (cert.fingerprint256 !== cert256) {
|
|
471
|
+
* const msg = 'Certificate verification error: ' +
|
|
472
|
+
* `The certificate of '${cert.subject.CN}' ` +
|
|
473
|
+
* 'does not match our pinned fingerprint';
|
|
474
|
+
* return new Error(msg);
|
|
475
|
+
* }
|
|
476
|
+
*
|
|
477
|
+
* // This loop is informational only.
|
|
478
|
+
* // Print the certificate and public key fingerprints of all certs in the
|
|
479
|
+
* // chain. Its common to pin the public key of the issuer on the public
|
|
480
|
+
* // internet, while pinning the public key of the service in sensitive
|
|
481
|
+
* // environments.
|
|
482
|
+
* do {
|
|
483
|
+
* console.log('Subject Common Name:', cert.subject.CN);
|
|
484
|
+
* console.log(' Certificate SHA256 fingerprint:', cert.fingerprint256);
|
|
485
|
+
*
|
|
486
|
+
* hash = crypto.createHash('sha256');
|
|
487
|
+
* console.log(' Public key ping-sha256:', sha256(cert.pubkey));
|
|
488
|
+
*
|
|
489
|
+
* lastprint256 = cert.fingerprint256;
|
|
490
|
+
* cert = cert.issuerCertificate;
|
|
491
|
+
* } while (cert.fingerprint256 !== lastprint256);
|
|
492
|
+
*
|
|
493
|
+
* },
|
|
494
|
+
* };
|
|
495
|
+
*
|
|
496
|
+
* options.agent = new https.Agent(options);
|
|
497
|
+
* const req = https.request(options, (res) => {
|
|
498
|
+
* console.log('All OK. Server matched our pinned cert or public key');
|
|
499
|
+
* console.log('statusCode:', res.statusCode);
|
|
500
|
+
* // Print the HPKP values
|
|
501
|
+
* console.log('headers:', res.headers['public-key-pins']);
|
|
502
|
+
*
|
|
503
|
+
* res.on('data', (d) => {});
|
|
504
|
+
* });
|
|
505
|
+
*
|
|
506
|
+
* req.on('error', (e) => {
|
|
507
|
+
* console.error(e.message);
|
|
508
|
+
* });
|
|
509
|
+
* req.end();
|
|
510
|
+
* ```
|
|
511
|
+
*
|
|
512
|
+
* Outputs for example:
|
|
513
|
+
*
|
|
514
|
+
* ```text
|
|
515
|
+
* Subject Common Name: github.com
|
|
516
|
+
* Certificate SHA256 fingerprint: 25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16
|
|
517
|
+
* Public key ping-sha256: pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=
|
|
518
|
+
* Subject Common Name: DigiCert SHA2 Extended Validation Server CA
|
|
519
|
+
* Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A
|
|
520
|
+
* Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho=
|
|
521
|
+
* Subject Common Name: DigiCert High Assurance EV Root CA
|
|
522
|
+
* Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF
|
|
523
|
+
* Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18=
|
|
524
|
+
* All OK. Server matched our pinned cert or public key
|
|
525
|
+
* statusCode: 200
|
|
526
|
+
* headers: max-age=0; pin-sha256="WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18="; pin-sha256="RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho=";
|
|
527
|
+
* pin-sha256="k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws="; pin-sha256="K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q="; pin-sha256="IQBnNBEiFuhj+8x6X8XLgh01V9Ic5/V3IRQLNFFc7v4=";
|
|
528
|
+
* pin-sha256="iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0="; pin-sha256="LvRiGEjRqfzurezaWuj8Wie2gyHMrW5Q06LspMnox7A="; includeSubDomains
|
|
529
|
+
* ```
|
|
530
|
+
* @since v0.3.6
|
|
531
|
+
* @param options Accepts all `options` from `request`, with some differences in default values:
|
|
532
|
+
*/
|
|
533
|
+
function request(
|
|
534
|
+
options: RequestOptions | string | URL,
|
|
535
|
+
callback?: (res: http.IncomingMessage) => void,
|
|
536
|
+
): http.ClientRequest;
|
|
537
|
+
function request(
|
|
538
|
+
url: string | URL,
|
|
539
|
+
options: RequestOptions,
|
|
540
|
+
callback?: (res: http.IncomingMessage) => void,
|
|
541
|
+
): http.ClientRequest;
|
|
542
|
+
/**
|
|
543
|
+
* Like `http.get()` but for HTTPS.
|
|
544
|
+
*
|
|
545
|
+
* `options` can be an object, a string, or a `URL` object. If `options` is a
|
|
546
|
+
* string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object.
|
|
547
|
+
*
|
|
548
|
+
* ```js
|
|
549
|
+
* import https from 'node:https';
|
|
550
|
+
*
|
|
551
|
+
* https.get('https://encrypted.google.com/', (res) => {
|
|
552
|
+
* console.log('statusCode:', res.statusCode);
|
|
553
|
+
* console.log('headers:', res.headers);
|
|
554
|
+
*
|
|
555
|
+
* res.on('data', (d) => {
|
|
556
|
+
* process.stdout.write(d);
|
|
557
|
+
* });
|
|
558
|
+
*
|
|
559
|
+
* }).on('error', (e) => {
|
|
560
|
+
* console.error(e);
|
|
561
|
+
* });
|
|
562
|
+
* ```
|
|
563
|
+
* @since v0.3.6
|
|
564
|
+
* @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`.
|
|
565
|
+
*/
|
|
566
|
+
function get(
|
|
567
|
+
options: RequestOptions | string | URL,
|
|
568
|
+
callback?: (res: http.IncomingMessage) => void,
|
|
569
|
+
): http.ClientRequest;
|
|
570
|
+
function get(
|
|
571
|
+
url: string | URL,
|
|
572
|
+
options: RequestOptions,
|
|
573
|
+
callback?: (res: http.IncomingMessage) => void,
|
|
574
|
+
): http.ClientRequest;
|
|
155
575
|
let globalAgent: Agent;
|
|
156
576
|
}
|
|
577
|
+
declare module "node:https" {
|
|
578
|
+
export * from "https";
|
|
579
|
+
}
|