cdk-ecr-deployment 2.5.5 → 2.5.21
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/.gitattributes +5 -4
- package/.jsii +673 -21
- package/.jsii.tabl.json +1 -0
- package/.projenrc.ts +100 -0
- package/API.md +4 -4
- package/README.md +4 -4
- package/lambda/go.mod +2 -5
- package/lambda/go.sum +39 -14
- package/lib/index.d.ts +7 -65
- package/lib/index.js +7 -45
- package/node_modules/@sindresorhus/is/dist/index.d.ts +12 -7
- package/node_modules/@sindresorhus/is/dist/index.js +9 -4
- package/node_modules/@sindresorhus/is/dist/types.d.ts +1 -0
- package/node_modules/@sindresorhus/is/package.json +1 -1
- package/node_modules/@sindresorhus/is/readme.md +25 -7
- package/node_modules/@types/cacheable-request/README.md +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +135 -75
- package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +67 -38
- package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +226 -104
- package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +87 -58
- package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +29 -29
- package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +5 -5
- package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +888 -256
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +16 -16
- package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +60 -21
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +52 -8
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +27 -18
- package/node_modules/@types/cacheable-request/node_modules/@types/node/dom-events.d.ts +126 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +6 -5
- package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +166 -93
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +169 -70
- package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +301 -126
- package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +22 -13
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +453 -125
- package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +74 -46
- package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +103 -53
- package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +6 -2
- package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +20 -16
- package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +6 -4
- package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +114 -22
- package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +36 -14
- package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +15 -3
- package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +37 -26
- package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +96 -15
- package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +95 -82
- package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +6 -6
- package/node_modules/@types/cacheable-request/node_modules/@types/node/readline/promises.d.ts +145 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +51 -175
- package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +21 -21
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +2 -14
- package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +983 -824
- package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +6 -6
- package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +1052 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +26 -1
- package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +127 -6
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +149 -50
- package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +30 -9
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/assert.d.ts +972 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/async_hooks.d.ts +530 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/buffer.d.ts +2354 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/child_process.d.ts +1395 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/cluster.d.ts +414 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/console.d.ts +412 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/crypto.d.ts +3969 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/dns/promises.d.ts +414 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/dns.d.ts +668 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/events.d.ts +724 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/fs/promises.d.ts +1189 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/fs.d.ts +4044 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/globals.d.ts +303 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/http.d.ts +1724 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/http2.d.ts +2129 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/https.d.ts +441 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/index.d.ts +88 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/inspector.d.ts +2748 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/module.d.ts +116 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/net.d.ts +888 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/os.d.ts +477 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/path.d.ts +191 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/perf_hooks.d.ts +638 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/process.d.ts +1494 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/readline/promises.d.ts +145 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/readline.d.ts +526 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/stream.d.ts +1392 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/test.d.ts +1052 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/timers.d.ts +215 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/tls.d.ts +1119 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/trace_events.d.ts +182 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/tty.d.ts +208 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/url.d.ts +901 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/util.d.ts +2052 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/v8.d.ts +635 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/vm.d.ts +894 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/wasi.d.ts +152 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/worker_threads.d.ts +693 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
- package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +11 -7
- package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +66 -56
- package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +528 -70
- package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +271 -14
- package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +421 -34
- package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +15 -21
- package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +81 -37
- package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +11 -11
- package/node_modules/@types/cacheable-request/package.json +5 -5
- package/node_modules/@types/keyv/README.md +1 -1
- package/node_modules/@types/keyv/index.d.ts +16 -3
- package/node_modules/@types/keyv/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +135 -75
- package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +67 -38
- package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +226 -104
- package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +87 -58
- package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +29 -29
- package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +5 -5
- package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +888 -256
- package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +16 -16
- package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +60 -21
- package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +52 -8
- package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +27 -18
- package/node_modules/@types/keyv/node_modules/@types/node/dom-events.d.ts +126 -0
- package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +6 -5
- package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +166 -93
- package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +169 -70
- package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +301 -126
- package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +22 -13
- package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +453 -125
- package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +74 -46
- package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +103 -53
- package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +6 -2
- package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +20 -16
- package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +6 -4
- package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +114 -22
- package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +36 -14
- package/node_modules/@types/keyv/node_modules/@types/node/package.json +15 -3
- package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +37 -26
- package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +96 -15
- package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +95 -82
- package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +6 -6
- package/node_modules/@types/keyv/node_modules/@types/node/readline/promises.d.ts +145 -0
- package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +51 -175
- package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +21 -21
- package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +2 -14
- package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +983 -824
- package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +6 -6
- package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +1052 -0
- package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +26 -1
- package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +127 -6
- package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +149 -50
- package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +30 -9
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/assert.d.ts +972 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/async_hooks.d.ts +530 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/buffer.d.ts +2354 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/child_process.d.ts +1395 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/cluster.d.ts +414 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/console.d.ts +412 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/crypto.d.ts +3969 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/dns/promises.d.ts +414 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/dns.d.ts +668 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/events.d.ts +724 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/fs/promises.d.ts +1189 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/fs.d.ts +4044 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/globals.d.ts +303 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/http.d.ts +1724 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/http2.d.ts +2129 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/https.d.ts +441 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/index.d.ts +88 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/inspector.d.ts +2748 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/module.d.ts +116 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/net.d.ts +888 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/os.d.ts +477 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/path.d.ts +191 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/perf_hooks.d.ts +638 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/process.d.ts +1494 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/readline/promises.d.ts +145 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/readline.d.ts +526 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/stream.d.ts +1392 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/test.d.ts +1052 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/timers.d.ts +215 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/tls.d.ts +1119 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/trace_events.d.ts +182 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/tty.d.ts +208 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/url.d.ts +901 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/util.d.ts +2052 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/v8.d.ts +635 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/vm.d.ts +894 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/wasi.d.ts +152 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/worker_threads.d.ts +693 -0
- package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
- package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +11 -7
- package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +66 -56
- package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +528 -70
- package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +271 -14
- package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +421 -34
- package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +15 -21
- package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +81 -37
- package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +11 -11
- package/node_modules/@types/keyv/package.json +3 -3
- package/node_modules/@types/responselike/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +135 -75
- package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +67 -38
- package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +226 -104
- package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +87 -58
- package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +29 -29
- package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +5 -5
- package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +888 -256
- package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +16 -16
- package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +60 -21
- package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +52 -8
- package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +27 -18
- package/node_modules/@types/responselike/node_modules/@types/node/dom-events.d.ts +126 -0
- package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +6 -5
- package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +166 -93
- package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +169 -70
- package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +301 -126
- package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +22 -13
- package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +453 -125
- package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +74 -46
- package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +103 -53
- package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +6 -2
- package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +20 -16
- package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +6 -4
- package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +114 -22
- package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +36 -14
- package/node_modules/@types/responselike/node_modules/@types/node/package.json +15 -3
- package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +37 -26
- package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +96 -15
- package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +95 -82
- package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +1 -1
- package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +6 -6
- package/node_modules/@types/responselike/node_modules/@types/node/readline/promises.d.ts +145 -0
- package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +51 -175
- package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +21 -21
- package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +2 -14
- package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +983 -824
- package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +6 -6
- package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +1052 -0
- package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +26 -1
- package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +127 -6
- package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +149 -50
- package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +30 -9
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/assert.d.ts +972 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/async_hooks.d.ts +530 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/buffer.d.ts +2354 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/child_process.d.ts +1395 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/cluster.d.ts +414 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/console.d.ts +412 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/crypto.d.ts +3969 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/dns/promises.d.ts +414 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/dns.d.ts +668 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/events.d.ts +724 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/fs/promises.d.ts +1189 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/fs.d.ts +4044 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/globals.d.ts +303 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/http.d.ts +1724 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/http2.d.ts +2129 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/https.d.ts +441 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/index.d.ts +88 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/inspector.d.ts +2748 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/module.d.ts +116 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/net.d.ts +888 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/os.d.ts +477 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/path.d.ts +191 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/perf_hooks.d.ts +638 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/process.d.ts +1494 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/readline/promises.d.ts +145 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/readline.d.ts +526 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/stream.d.ts +1392 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/test.d.ts +1052 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/timers.d.ts +215 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/tls.d.ts +1119 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/trace_events.d.ts +182 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/tty.d.ts +208 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/url.d.ts +901 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/util.d.ts +2052 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/v8.d.ts +635 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/vm.d.ts +894 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/wasi.d.ts +152 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/worker_threads.d.ts +693 -0
- package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
- package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +11 -7
- package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +66 -56
- package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +528 -70
- package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +271 -14
- package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +421 -34
- package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +15 -21
- package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +81 -37
- package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +11 -11
- package/node_modules/cacheable-request/package.json +1 -1
- package/node_modules/clone-response/node_modules/mimic-response/index.js +32 -0
- package/node_modules/{get-stream → clone-response/node_modules/mimic-response}/license +1 -1
- package/node_modules/clone-response/node_modules/mimic-response/package.json +37 -0
- package/node_modules/clone-response/node_modules/mimic-response/readme.md +54 -0
- package/node_modules/clone-response/package.json +3 -6
- package/node_modules/got/dist/source/as-promise/index.js +2 -1
- package/node_modules/got/dist/source/core/index.js +8 -0
- package/node_modules/got/dist/source/types.d.ts +8 -8
- package/node_modules/got/package.json +2 -1
- package/node_modules/http-cache-semantics/index.js +4 -3
- package/node_modules/http-cache-semantics/package.json +2 -8
- package/node_modules/keyv/README.md +141 -5
- package/node_modules/keyv/package.json +56 -50
- package/node_modules/keyv/src/index.d.ts +116 -0
- package/node_modules/keyv/src/index.js +179 -24
- package/node_modules/mimic-response/index.js +58 -13
- package/node_modules/mimic-response/license +1 -1
- package/node_modules/mimic-response/package.json +40 -35
- package/node_modules/mimic-response/readme.md +33 -9
- package/node_modules/responselike/package.json +3 -2
- package/package.json +54 -25
- package/rosetta/default.ts-fixture +17 -0
- package/changelog.md +0 -2
- package/node_modules/decompress-response/node_modules/mimic-response/index.js +0 -77
- package/node_modules/decompress-response/node_modules/mimic-response/package.json +0 -42
- package/node_modules/decompress-response/node_modules/mimic-response/readme.md +0 -78
- package/node_modules/keyv/.nyc_output/37411020-4142-4b08-b825-343ba2427bf7.json +0 -1
- package/node_modules/keyv/.nyc_output/cd79f2de-c8b8-4493-bc15-b2bde28efa4b.json +0 -1
- package/node_modules/keyv/.nyc_output/processinfo/37411020-4142-4b08-b825-343ba2427bf7.json +0 -1
- package/node_modules/keyv/.nyc_output/processinfo/cd79f2de-c8b8-4493-bc15-b2bde28efa4b.json +0 -1
- package/node_modules/keyv/.nyc_output/processinfo/index.json +0 -1
- package/node_modules/keyv/test/test.js +0 -132
- package/node_modules/keyv/test/testdb.sqlite +0 -0
- package/releasetag.txt +0 -1
- package/version.txt +0 -1
- /package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/buffer-stream.js +0 -0
- /package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/index.d.ts +0 -0
- /package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/index.js +0 -0
- /package/node_modules/{decompress-response/node_modules/mimic-response → cacheable-request/node_modules/get-stream}/license +0 -0
- /package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/package.json +0 -0
- /package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/readme.md +0 -0
- /package/node_modules/{decompress-response/node_modules/mimic-response → mimic-response}/index.d.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* To use the HTTP server and client one must `require('http')`.
|
|
2
|
+
* To use the HTTP server and client one must `require('node:http')`.
|
|
3
3
|
*
|
|
4
4
|
* The HTTP interfaces in Node.js are designed to support many features
|
|
5
5
|
* of the protocol which have been traditionally difficult to use.
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* { 'content-length': '123',
|
|
14
14
|
* 'content-type': 'text/plain',
|
|
15
15
|
* 'connection': 'keep-alive',
|
|
16
|
-
* 'host': '
|
|
16
|
+
* 'host': 'example.com',
|
|
17
17
|
* 'accept': '*' }
|
|
18
18
|
* ```
|
|
19
19
|
*
|
|
@@ -34,14 +34,16 @@
|
|
|
34
34
|
* 'content-LENGTH', '123',
|
|
35
35
|
* 'content-type', 'text/plain',
|
|
36
36
|
* 'CONNECTION', 'keep-alive',
|
|
37
|
-
* 'Host', '
|
|
37
|
+
* 'Host', 'example.com',
|
|
38
38
|
* 'accepT', '*' ]
|
|
39
39
|
* ```
|
|
40
|
-
* @see [source](https://github.com/nodejs/node/blob/
|
|
40
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/http.js)
|
|
41
41
|
*/
|
|
42
42
|
declare module 'http' {
|
|
43
43
|
import * as stream from 'node:stream';
|
|
44
44
|
import { URL } from 'node:url';
|
|
45
|
+
import { LookupOptions } from 'node:dns';
|
|
46
|
+
import { EventEmitter } from 'node:events';
|
|
45
47
|
import { TcpSocketConnectOpts, Socket, Server as NetServer, LookupFunction } from 'node:net';
|
|
46
48
|
// incoming headers will never contain number
|
|
47
49
|
interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
|
|
@@ -113,56 +115,136 @@ declare module 'http' {
|
|
|
113
115
|
type OutgoingHttpHeader = number | string | string[];
|
|
114
116
|
interface OutgoingHttpHeaders extends NodeJS.Dict<OutgoingHttpHeader> {}
|
|
115
117
|
interface ClientRequestArgs {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
+
_defaultAgent?: Agent | undefined;
|
|
119
|
+
agent?: Agent | boolean | undefined;
|
|
120
|
+
auth?: string | null | undefined;
|
|
121
|
+
// https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278
|
|
122
|
+
createConnection?:
|
|
123
|
+
| ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket)
|
|
124
|
+
| undefined;
|
|
125
|
+
defaultPort?: number | string | undefined;
|
|
126
|
+
family?: number | undefined;
|
|
127
|
+
headers?: OutgoingHttpHeaders | undefined;
|
|
128
|
+
hints?: LookupOptions['hints'];
|
|
118
129
|
host?: string | null | undefined;
|
|
119
130
|
hostname?: string | null | undefined;
|
|
120
|
-
|
|
121
|
-
port?: number | string | null | undefined;
|
|
122
|
-
defaultPort?: number | string | undefined;
|
|
131
|
+
insecureHTTPParser?: boolean | undefined;
|
|
123
132
|
localAddress?: string | undefined;
|
|
124
|
-
|
|
133
|
+
localPort?: number | undefined;
|
|
134
|
+
lookup?: LookupFunction | undefined;
|
|
125
135
|
/**
|
|
126
|
-
* @default
|
|
136
|
+
* @default 16384
|
|
127
137
|
*/
|
|
128
138
|
maxHeaderSize?: number | undefined;
|
|
129
139
|
method?: string | undefined;
|
|
130
140
|
path?: string | null | undefined;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
agent?: Agent | boolean | undefined;
|
|
134
|
-
_defaultAgent?: Agent | undefined;
|
|
135
|
-
timeout?: number | undefined;
|
|
141
|
+
port?: number | string | null | undefined;
|
|
142
|
+
protocol?: string | null | undefined;
|
|
136
143
|
setHost?: boolean | undefined;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
144
|
+
signal?: AbortSignal | undefined;
|
|
145
|
+
socketPath?: string | undefined;
|
|
146
|
+
timeout?: number | undefined;
|
|
147
|
+
uniqueHeaders?: Array<string | string[]> | undefined;
|
|
148
|
+
joinDuplicateHeaders?: boolean;
|
|
140
149
|
}
|
|
141
|
-
interface ServerOptions
|
|
142
|
-
|
|
143
|
-
|
|
150
|
+
interface ServerOptions<
|
|
151
|
+
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
152
|
+
Response extends typeof ServerResponse = typeof ServerResponse,
|
|
153
|
+
> {
|
|
154
|
+
/**
|
|
155
|
+
* Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`.
|
|
156
|
+
*/
|
|
157
|
+
IncomingMessage?: Request | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`.
|
|
160
|
+
*/
|
|
161
|
+
ServerResponse?: Response | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* Sets the timeout value in milliseconds for receiving the entire request from the client.
|
|
164
|
+
* @see Server.requestTimeout for more information.
|
|
165
|
+
* @default 300000
|
|
166
|
+
* @since v18.0.0
|
|
167
|
+
*/
|
|
168
|
+
requestTimeout?: number | undefined;
|
|
169
|
+
/**
|
|
170
|
+
* It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates.
|
|
171
|
+
* @default false
|
|
172
|
+
* @since v18.14.0
|
|
173
|
+
*/
|
|
174
|
+
joinDuplicateHeaders?: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* The number of milliseconds of inactivity a server needs to wait for additional incoming data,
|
|
177
|
+
* after it has finished writing the last response, before a socket will be destroyed.
|
|
178
|
+
* @see Server.keepAliveTimeout for more information.
|
|
179
|
+
* @default 5000
|
|
180
|
+
* @since v18.0.0
|
|
181
|
+
*/
|
|
182
|
+
keepAliveTimeout?: number | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests.
|
|
185
|
+
* @default 30000
|
|
186
|
+
*/
|
|
187
|
+
connectionsCheckingInterval?: number | undefined;
|
|
188
|
+
/**
|
|
189
|
+
* Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`.
|
|
190
|
+
* This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`.
|
|
191
|
+
* Default: @see stream.getDefaultHighWaterMark().
|
|
192
|
+
* @since v20.1.0
|
|
193
|
+
*/
|
|
194
|
+
highWaterMark?: number | undefined;
|
|
195
|
+
/**
|
|
196
|
+
* Use an insecure HTTP parser that accepts invalid HTTP headers when `true`.
|
|
197
|
+
* Using the insecure parser should be avoided.
|
|
198
|
+
* See --insecure-http-parser for more information.
|
|
199
|
+
* @default false
|
|
200
|
+
*/
|
|
201
|
+
insecureHTTPParser?: boolean | undefined;
|
|
144
202
|
/**
|
|
145
203
|
* Optionally overrides the value of
|
|
146
204
|
* `--max-http-header-size` for requests received by this server, i.e.
|
|
147
205
|
* the maximum length of request headers in bytes.
|
|
148
|
-
* @default
|
|
206
|
+
* @default 16384
|
|
207
|
+
* @since v13.3.0
|
|
149
208
|
*/
|
|
150
209
|
maxHeaderSize?: number | undefined;
|
|
151
210
|
/**
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
211
|
+
* If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received.
|
|
212
|
+
* @default true
|
|
213
|
+
* @since v16.5.0
|
|
214
|
+
*/
|
|
215
|
+
noDelay?: boolean | undefined;
|
|
216
|
+
/**
|
|
217
|
+
* If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
|
|
218
|
+
* similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`.
|
|
155
219
|
* @default false
|
|
220
|
+
* @since v16.5.0
|
|
156
221
|
*/
|
|
157
|
-
|
|
222
|
+
keepAlive?: boolean | undefined;
|
|
223
|
+
/**
|
|
224
|
+
* If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket.
|
|
225
|
+
* @default 0
|
|
226
|
+
* @since v16.5.0
|
|
227
|
+
*/
|
|
228
|
+
keepAliveInitialDelay?: number | undefined;
|
|
229
|
+
/**
|
|
230
|
+
* A list of response headers that should be sent only once.
|
|
231
|
+
* If the header's value is an array, the items will be joined using `; `.
|
|
232
|
+
*/
|
|
233
|
+
uniqueHeaders?: Array<string | string[]> | undefined;
|
|
158
234
|
}
|
|
159
|
-
type RequestListener
|
|
235
|
+
type RequestListener<
|
|
236
|
+
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
237
|
+
Response extends typeof ServerResponse = typeof ServerResponse,
|
|
238
|
+
> = (req: InstanceType<Request>, res: InstanceType<Response> & { req: InstanceType<Request> }) => void;
|
|
160
239
|
/**
|
|
161
240
|
* @since v0.1.17
|
|
162
241
|
*/
|
|
163
|
-
class Server
|
|
164
|
-
|
|
165
|
-
|
|
242
|
+
class Server<
|
|
243
|
+
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
244
|
+
Response extends typeof ServerResponse = typeof ServerResponse,
|
|
245
|
+
> extends NetServer {
|
|
246
|
+
constructor(requestListener?: RequestListener<Request, Response>);
|
|
247
|
+
constructor(options: ServerOptions<Request, Response>, requestListener?: RequestListener<Request, Response>);
|
|
166
248
|
/**
|
|
167
249
|
* Sets the timeout value for sockets, and emits a `'timeout'` event on
|
|
168
250
|
* the Server object, passing the socket as an argument, if a timeout
|
|
@@ -211,14 +293,12 @@ declare module 'http' {
|
|
|
211
293
|
* Limit the amount of time the parser will wait to receive the complete HTTP
|
|
212
294
|
* headers.
|
|
213
295
|
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
* See `server.timeout` for more information on how timeout behavior can be
|
|
221
|
-
* customized.
|
|
296
|
+
* If the timeout expires, the server responds with status 408 without
|
|
297
|
+
* forwarding the request to the request listener and then closes the connection.
|
|
298
|
+
*
|
|
299
|
+
* It must be set to a non-zero value (e.g. 120 seconds) to protect against
|
|
300
|
+
* potential Denial-of-Service attacks in case the server is deployed without a
|
|
301
|
+
* reverse proxy in front.
|
|
222
302
|
* @since v11.3.0, v10.14.0
|
|
223
303
|
*/
|
|
224
304
|
headersTimeout: number;
|
|
@@ -251,80 +331,109 @@ declare module 'http' {
|
|
|
251
331
|
* @since v14.11.0
|
|
252
332
|
*/
|
|
253
333
|
requestTimeout: number;
|
|
334
|
+
/**
|
|
335
|
+
* Closes all connections connected to this server.
|
|
336
|
+
* @since v18.2.0
|
|
337
|
+
*/
|
|
338
|
+
closeAllConnections(): void;
|
|
339
|
+
/**
|
|
340
|
+
* Closes all connections connected to this server which are not sending a request
|
|
341
|
+
* or waiting for a response.
|
|
342
|
+
* @since v18.2.0
|
|
343
|
+
*/
|
|
344
|
+
closeIdleConnections(): void;
|
|
254
345
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
255
346
|
addListener(event: 'close', listener: () => void): this;
|
|
256
347
|
addListener(event: 'connection', listener: (socket: Socket) => void): this;
|
|
257
348
|
addListener(event: 'error', listener: (err: Error) => void): this;
|
|
258
349
|
addListener(event: 'listening', listener: () => void): this;
|
|
259
|
-
addListener(event: 'checkContinue', listener: RequestListener): this;
|
|
260
|
-
addListener(event: 'checkExpectation', listener: RequestListener): this;
|
|
350
|
+
addListener(event: 'checkContinue', listener: RequestListener<Request, Response>): this;
|
|
351
|
+
addListener(event: 'checkExpectation', listener: RequestListener<Request, Response>): this;
|
|
261
352
|
addListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
|
|
262
|
-
addListener(event: 'connect', listener: (req:
|
|
263
|
-
addListener(event: '
|
|
264
|
-
addListener(event: '
|
|
353
|
+
addListener(event: 'connect', listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
|
|
354
|
+
addListener(event: 'dropRequest', listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
|
|
355
|
+
addListener(event: 'request', listener: RequestListener<Request, Response>): this;
|
|
356
|
+
addListener(event: 'upgrade', listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
|
|
265
357
|
emit(event: string, ...args: any[]): boolean;
|
|
266
358
|
emit(event: 'close'): boolean;
|
|
267
359
|
emit(event: 'connection', socket: Socket): boolean;
|
|
268
360
|
emit(event: 'error', err: Error): boolean;
|
|
269
361
|
emit(event: 'listening'): boolean;
|
|
270
|
-
emit(
|
|
271
|
-
|
|
362
|
+
emit(
|
|
363
|
+
event: 'checkContinue',
|
|
364
|
+
req: InstanceType<Request>,
|
|
365
|
+
res: InstanceType<Response> & { req: InstanceType<Request> },
|
|
366
|
+
): boolean;
|
|
367
|
+
emit(
|
|
368
|
+
event: 'checkExpectation',
|
|
369
|
+
req: InstanceType<Request>,
|
|
370
|
+
res: InstanceType<Response> & { req: InstanceType<Request> },
|
|
371
|
+
): boolean;
|
|
272
372
|
emit(event: 'clientError', err: Error, socket: stream.Duplex): boolean;
|
|
273
|
-
emit(event: 'connect', req:
|
|
274
|
-
emit(event: '
|
|
275
|
-
emit(
|
|
373
|
+
emit(event: 'connect', req: InstanceType<Request>, socket: stream.Duplex, head: Buffer): boolean;
|
|
374
|
+
emit(event: 'dropRequest', req: InstanceType<Request>, socket: stream.Duplex): boolean;
|
|
375
|
+
emit(
|
|
376
|
+
event: 'request',
|
|
377
|
+
req: InstanceType<Request>,
|
|
378
|
+
res: InstanceType<Response> & { req: InstanceType<Request> },
|
|
379
|
+
): boolean;
|
|
380
|
+
emit(event: 'upgrade', req: InstanceType<Request>, socket: stream.Duplex, head: Buffer): boolean;
|
|
276
381
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
277
382
|
on(event: 'close', listener: () => void): this;
|
|
278
383
|
on(event: 'connection', listener: (socket: Socket) => void): this;
|
|
279
384
|
on(event: 'error', listener: (err: Error) => void): this;
|
|
280
385
|
on(event: 'listening', listener: () => void): this;
|
|
281
|
-
on(event: 'checkContinue', listener: RequestListener): this;
|
|
282
|
-
on(event: 'checkExpectation', listener: RequestListener): this;
|
|
386
|
+
on(event: 'checkContinue', listener: RequestListener<Request, Response>): this;
|
|
387
|
+
on(event: 'checkExpectation', listener: RequestListener<Request, Response>): this;
|
|
283
388
|
on(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
|
|
284
|
-
on(event: 'connect', listener: (req:
|
|
285
|
-
on(event: '
|
|
286
|
-
on(event: '
|
|
389
|
+
on(event: 'connect', listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
|
|
390
|
+
on(event: 'dropRequest', listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
|
|
391
|
+
on(event: 'request', listener: RequestListener<Request, Response>): this;
|
|
392
|
+
on(event: 'upgrade', listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
|
|
287
393
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
288
394
|
once(event: 'close', listener: () => void): this;
|
|
289
395
|
once(event: 'connection', listener: (socket: Socket) => void): this;
|
|
290
396
|
once(event: 'error', listener: (err: Error) => void): this;
|
|
291
397
|
once(event: 'listening', listener: () => void): this;
|
|
292
|
-
once(event: 'checkContinue', listener: RequestListener): this;
|
|
293
|
-
once(event: 'checkExpectation', listener: RequestListener): this;
|
|
398
|
+
once(event: 'checkContinue', listener: RequestListener<Request, Response>): this;
|
|
399
|
+
once(event: 'checkExpectation', listener: RequestListener<Request, Response>): this;
|
|
294
400
|
once(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
|
|
295
|
-
once(event: 'connect', listener: (req:
|
|
296
|
-
once(event: '
|
|
297
|
-
once(event: '
|
|
401
|
+
once(event: 'connect', listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
|
|
402
|
+
once(event: 'dropRequest', listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
|
|
403
|
+
once(event: 'request', listener: RequestListener<Request, Response>): this;
|
|
404
|
+
once(event: 'upgrade', listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
|
|
298
405
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
299
406
|
prependListener(event: 'close', listener: () => void): this;
|
|
300
407
|
prependListener(event: 'connection', listener: (socket: Socket) => void): this;
|
|
301
408
|
prependListener(event: 'error', listener: (err: Error) => void): this;
|
|
302
409
|
prependListener(event: 'listening', listener: () => void): this;
|
|
303
|
-
prependListener(event: 'checkContinue', listener: RequestListener): this;
|
|
304
|
-
prependListener(event: 'checkExpectation', listener: RequestListener): this;
|
|
410
|
+
prependListener(event: 'checkContinue', listener: RequestListener<Request, Response>): this;
|
|
411
|
+
prependListener(event: 'checkExpectation', listener: RequestListener<Request, Response>): this;
|
|
305
412
|
prependListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
|
|
306
|
-
prependListener(event: 'connect', listener: (req:
|
|
307
|
-
prependListener(event: '
|
|
308
|
-
prependListener(event: '
|
|
413
|
+
prependListener(event: 'connect', listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
|
|
414
|
+
prependListener(event: 'dropRequest', listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
|
|
415
|
+
prependListener(event: 'request', listener: RequestListener<Request, Response>): this;
|
|
416
|
+
prependListener(event: 'upgrade', listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
|
|
309
417
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
310
418
|
prependOnceListener(event: 'close', listener: () => void): this;
|
|
311
419
|
prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this;
|
|
312
420
|
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
|
|
313
421
|
prependOnceListener(event: 'listening', listener: () => void): this;
|
|
314
|
-
prependOnceListener(event: 'checkContinue', listener: RequestListener): this;
|
|
315
|
-
prependOnceListener(event: 'checkExpectation', listener: RequestListener): this;
|
|
422
|
+
prependOnceListener(event: 'checkContinue', listener: RequestListener<Request, Response>): this;
|
|
423
|
+
prependOnceListener(event: 'checkExpectation', listener: RequestListener<Request, Response>): this;
|
|
316
424
|
prependOnceListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
|
|
317
|
-
prependOnceListener(event: 'connect', listener: (req:
|
|
318
|
-
prependOnceListener(event: '
|
|
319
|
-
prependOnceListener(event: '
|
|
425
|
+
prependOnceListener(event: 'connect', listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
|
|
426
|
+
prependOnceListener(event: 'dropRequest', listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
|
|
427
|
+
prependOnceListener(event: 'request', listener: RequestListener<Request, Response>): this;
|
|
428
|
+
prependOnceListener(event: 'upgrade', listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
|
|
320
429
|
}
|
|
321
430
|
/**
|
|
322
|
-
* This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract
|
|
323
|
-
* the perspective of the participants of HTTP transaction.
|
|
431
|
+
* This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract outgoing message from
|
|
432
|
+
* the perspective of the participants of an HTTP transaction.
|
|
324
433
|
* @since v0.1.17
|
|
325
434
|
*/
|
|
326
|
-
class OutgoingMessage extends stream.Writable {
|
|
327
|
-
readonly req:
|
|
435
|
+
class OutgoingMessage<Request extends IncomingMessage = IncomingMessage> extends stream.Writable {
|
|
436
|
+
readonly req: Request;
|
|
328
437
|
chunkedEncoding: boolean;
|
|
329
438
|
shouldKeepAlive: boolean;
|
|
330
439
|
useChunkedEncodingByDefault: boolean;
|
|
@@ -339,7 +448,7 @@ declare module 'http' {
|
|
|
339
448
|
*/
|
|
340
449
|
readonly headersSent: boolean;
|
|
341
450
|
/**
|
|
342
|
-
*
|
|
451
|
+
* Alias of `outgoingMessage.socket`.
|
|
343
452
|
* @since v0.3.0
|
|
344
453
|
* @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead.
|
|
345
454
|
*/
|
|
@@ -360,15 +469,33 @@ declare module 'http' {
|
|
|
360
469
|
*/
|
|
361
470
|
setTimeout(msecs: number, callback?: () => void): this;
|
|
362
471
|
/**
|
|
363
|
-
* Sets a single header value
|
|
472
|
+
* Sets a single header value. If the header already exists in the to-be-sent
|
|
473
|
+
* headers, its value will be replaced. Use an array of strings to send multiple
|
|
474
|
+
* headers with the same name.
|
|
364
475
|
* @since v0.4.0
|
|
365
476
|
* @param name Header name
|
|
366
477
|
* @param value Header value
|
|
367
478
|
*/
|
|
368
479
|
setHeader(name: string, value: number | string | ReadonlyArray<string>): this;
|
|
369
480
|
/**
|
|
370
|
-
*
|
|
371
|
-
*
|
|
481
|
+
* Append a single header value for the header object.
|
|
482
|
+
*
|
|
483
|
+
* If the value is an array, this is equivalent of calling this method multiple
|
|
484
|
+
* times.
|
|
485
|
+
*
|
|
486
|
+
* If there were no previous value for the header, this is equivalent of calling `outgoingMessage.setHeader(name, value)`.
|
|
487
|
+
*
|
|
488
|
+
* Depending of the value of `options.uniqueHeaders` when the client request or the
|
|
489
|
+
* server were created, this will end up in the header being sent multiple times or
|
|
490
|
+
* a single time with values joined using `; `.
|
|
491
|
+
* @since v18.3.0, v16.17.0
|
|
492
|
+
* @param name Header name
|
|
493
|
+
* @param value Header value
|
|
494
|
+
*/
|
|
495
|
+
appendHeader(name: string, value: string | ReadonlyArray<string>): this;
|
|
496
|
+
/**
|
|
497
|
+
* Gets the value of the HTTP header with the given name. If that header is not
|
|
498
|
+
* set, the returned value will be `undefined`.
|
|
372
499
|
* @since v0.4.0
|
|
373
500
|
* @param name Name of header
|
|
374
501
|
*/
|
|
@@ -381,8 +508,8 @@ declare module 'http' {
|
|
|
381
508
|
* values. All header names are lowercase.
|
|
382
509
|
*
|
|
383
510
|
* The object returned by the `outgoingMessage.getHeaders()` method does
|
|
384
|
-
* not prototypically inherit from the JavaScript Object
|
|
385
|
-
* typical Object methods such as `obj.toString()`, `obj.hasOwnProperty()`,
|
|
511
|
+
* not prototypically inherit from the JavaScript `Object`. This means that
|
|
512
|
+
* typical `Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`,
|
|
386
513
|
* and others are not defined and will not work.
|
|
387
514
|
*
|
|
388
515
|
* ```js
|
|
@@ -392,13 +519,13 @@ declare module 'http' {
|
|
|
392
519
|
* const headers = outgoingMessage.getHeaders();
|
|
393
520
|
* // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] }
|
|
394
521
|
* ```
|
|
395
|
-
* @since
|
|
522
|
+
* @since v7.7.0
|
|
396
523
|
*/
|
|
397
524
|
getHeaders(): OutgoingHttpHeaders;
|
|
398
525
|
/**
|
|
399
|
-
* Returns an array
|
|
400
|
-
* names are lowercase.
|
|
401
|
-
* @since
|
|
526
|
+
* Returns an array containing the unique names of the current outgoing headers.
|
|
527
|
+
* All names are lowercase.
|
|
528
|
+
* @since v7.7.0
|
|
402
529
|
*/
|
|
403
530
|
getHeaderNames(): string[];
|
|
404
531
|
/**
|
|
@@ -408,7 +535,7 @@ declare module 'http' {
|
|
|
408
535
|
* ```js
|
|
409
536
|
* const hasContentType = outgoingMessage.hasHeader('content-type');
|
|
410
537
|
* ```
|
|
411
|
-
* @since
|
|
538
|
+
* @since v7.7.0
|
|
412
539
|
*/
|
|
413
540
|
hasHeader(name: string): boolean;
|
|
414
541
|
/**
|
|
@@ -418,16 +545,17 @@ declare module 'http' {
|
|
|
418
545
|
* outgoingMessage.removeHeader('Content-Encoding');
|
|
419
546
|
* ```
|
|
420
547
|
* @since v0.4.0
|
|
548
|
+
* @param name Header name
|
|
421
549
|
*/
|
|
422
550
|
removeHeader(name: string): void;
|
|
423
551
|
/**
|
|
424
552
|
* Adds HTTP trailers (headers but at the end of the message) to the message.
|
|
425
553
|
*
|
|
426
|
-
* Trailers
|
|
427
|
-
* the
|
|
554
|
+
* Trailers will **only** be emitted if the message is chunked encoded. If not,
|
|
555
|
+
* the trailers will be silently discarded.
|
|
428
556
|
*
|
|
429
557
|
* HTTP requires the `Trailer` header to be sent to emit trailers,
|
|
430
|
-
* with a list of header
|
|
558
|
+
* with a list of header field names in its value, e.g.
|
|
431
559
|
*
|
|
432
560
|
* ```js
|
|
433
561
|
* message.writeHead(200, { 'Content-Type': 'text/plain',
|
|
@@ -443,7 +571,7 @@ declare module 'http' {
|
|
|
443
571
|
*/
|
|
444
572
|
addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
|
|
445
573
|
/**
|
|
446
|
-
*
|
|
574
|
+
* Flushes the message headers.
|
|
447
575
|
*
|
|
448
576
|
* For efficiency reason, Node.js normally buffers the message headers
|
|
449
577
|
* until `outgoingMessage.end()` is called or the first chunk of message data
|
|
@@ -451,7 +579,7 @@ declare module 'http' {
|
|
|
451
579
|
* packet.
|
|
452
580
|
*
|
|
453
581
|
* It is usually desired (it saves a TCP round-trip), but not when the first
|
|
454
|
-
* data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the
|
|
582
|
+
* data is not sent until possibly much later. `outgoingMessage.flushHeaders()`bypasses the optimization and kickstarts the message.
|
|
455
583
|
* @since v1.6.0
|
|
456
584
|
*/
|
|
457
585
|
flushHeaders(): void;
|
|
@@ -461,7 +589,7 @@ declare module 'http' {
|
|
|
461
589
|
* passed as the second parameter to the `'request'` event.
|
|
462
590
|
* @since v0.1.17
|
|
463
591
|
*/
|
|
464
|
-
class ServerResponse extends OutgoingMessage {
|
|
592
|
+
class ServerResponse<Request extends IncomingMessage = IncomingMessage> extends OutgoingMessage<Request> {
|
|
465
593
|
/**
|
|
466
594
|
* When using implicit headers (not calling `response.writeHead()` explicitly),
|
|
467
595
|
* this property controls the status code that will be sent to the client when
|
|
@@ -491,15 +619,56 @@ declare module 'http' {
|
|
|
491
619
|
* @since v0.11.8
|
|
492
620
|
*/
|
|
493
621
|
statusMessage: string;
|
|
494
|
-
|
|
622
|
+
/**
|
|
623
|
+
* If set to `true`, Node.js will check whether the `Content-Length`header value and the size of the body, in bytes, are equal.
|
|
624
|
+
* Mismatching the `Content-Length` header value will result
|
|
625
|
+
* in an `Error` being thrown, identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`.
|
|
626
|
+
* @since v18.10.0, v16.18.0
|
|
627
|
+
*/
|
|
628
|
+
strictContentLength: boolean;
|
|
629
|
+
constructor(req: Request);
|
|
495
630
|
assignSocket(socket: Socket): void;
|
|
496
631
|
detachSocket(socket: Socket): void;
|
|
497
632
|
/**
|
|
498
|
-
* Sends
|
|
633
|
+
* Sends an HTTP/1.1 100 Continue message to the client, indicating that
|
|
499
634
|
* the request body should be sent. See the `'checkContinue'` event on`Server`.
|
|
500
635
|
* @since v0.3.0
|
|
501
636
|
*/
|
|
502
637
|
writeContinue(callback?: () => void): void;
|
|
638
|
+
/**
|
|
639
|
+
* Sends an HTTP/1.1 103 Early Hints message to the client with a Link header,
|
|
640
|
+
* indicating that the user agent can preload/preconnect the linked resources.
|
|
641
|
+
* The `hints` is an object containing the values of headers to be sent with
|
|
642
|
+
* early hints message. The optional `callback` argument will be called when
|
|
643
|
+
* the response message has been written.
|
|
644
|
+
*
|
|
645
|
+
* **Example**
|
|
646
|
+
*
|
|
647
|
+
* ```js
|
|
648
|
+
* const earlyHintsLink = '</styles.css>; rel=preload; as=style';
|
|
649
|
+
* response.writeEarlyHints({
|
|
650
|
+
* 'link': earlyHintsLink,
|
|
651
|
+
* });
|
|
652
|
+
*
|
|
653
|
+
* const earlyHintsLinks = [
|
|
654
|
+
* '</styles.css>; rel=preload; as=style',
|
|
655
|
+
* '</scripts.js>; rel=preload; as=script',
|
|
656
|
+
* ];
|
|
657
|
+
* response.writeEarlyHints({
|
|
658
|
+
* 'link': earlyHintsLinks,
|
|
659
|
+
* 'x-trace-id': 'id for diagnostics',
|
|
660
|
+
* });
|
|
661
|
+
*
|
|
662
|
+
* const earlyHintsCallback = () => console.log('early hints message sent');
|
|
663
|
+
* response.writeEarlyHints({
|
|
664
|
+
* 'link': earlyHintsLinks,
|
|
665
|
+
* }, earlyHintsCallback);
|
|
666
|
+
* ```
|
|
667
|
+
* @since v18.11.0
|
|
668
|
+
* @param hints An object containing the values of headers
|
|
669
|
+
* @param callback Will be called when the response message has been written
|
|
670
|
+
*/
|
|
671
|
+
writeEarlyHints(hints: Record<string, string | string[]>, callback?: () => void): void;
|
|
503
672
|
/**
|
|
504
673
|
* Sends a response header to the request. The status code is a 3-digit HTTP
|
|
505
674
|
* status code, like `404`. The last argument, `headers`, are the response headers.
|
|
@@ -518,7 +687,7 @@ declare module 'http' {
|
|
|
518
687
|
* response
|
|
519
688
|
* .writeHead(200, {
|
|
520
689
|
* 'Content-Length': Buffer.byteLength(body),
|
|
521
|
-
* 'Content-Type': 'text/plain'
|
|
690
|
+
* 'Content-Type': 'text/plain',
|
|
522
691
|
* })
|
|
523
692
|
* .end(body);
|
|
524
693
|
* ```
|
|
@@ -549,15 +718,19 @@ declare module 'http' {
|
|
|
549
718
|
* });
|
|
550
719
|
* ```
|
|
551
720
|
*
|
|
552
|
-
* `Content-Length` is
|
|
553
|
-
*
|
|
721
|
+
* `Content-Length` is read in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js
|
|
722
|
+
* will check whether `Content-Length` and the length of the body which has
|
|
554
723
|
* been transmitted are equal or not.
|
|
555
724
|
*
|
|
556
725
|
* Attempting to set a header field name or value that contains invalid characters
|
|
557
|
-
* will result in a `
|
|
726
|
+
* will result in a \[`Error`\]\[\] being thrown.
|
|
558
727
|
* @since v0.1.30
|
|
559
728
|
*/
|
|
560
|
-
writeHead(
|
|
729
|
+
writeHead(
|
|
730
|
+
statusCode: number,
|
|
731
|
+
statusMessage?: string,
|
|
732
|
+
headers?: OutgoingHttpHeaders | OutgoingHttpHeader[],
|
|
733
|
+
): this;
|
|
561
734
|
writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
|
|
562
735
|
/**
|
|
563
736
|
* Sends a HTTP/1.1 102 Processing message to the client, indicating that
|
|
@@ -599,8 +772,11 @@ declare module 'http' {
|
|
|
599
772
|
*
|
|
600
773
|
* For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered.
|
|
601
774
|
*
|
|
602
|
-
*
|
|
603
|
-
*
|
|
775
|
+
* Set `Content-Length` header to limit the response body size.
|
|
776
|
+
* If `response.strictContentLength` is set to `true`, mismatching the`Content-Length` header value will result in an `Error` being thrown,
|
|
777
|
+
* identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`.
|
|
778
|
+
*
|
|
779
|
+
* `Content-Length` value should be in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes.
|
|
604
780
|
* @since v0.1.17
|
|
605
781
|
*/
|
|
606
782
|
class ClientRequest extends OutgoingMessage {
|
|
@@ -608,7 +784,7 @@ declare module 'http' {
|
|
|
608
784
|
* The `request.aborted` property will be `true` if the request has
|
|
609
785
|
* been aborted.
|
|
610
786
|
* @since v0.11.14
|
|
611
|
-
* @deprecated Since v17.0.0 - Check `destroyed` instead.
|
|
787
|
+
* @deprecated Since v17.0.0,v16.12.0 - Check `destroyed` instead.
|
|
612
788
|
*/
|
|
613
789
|
aborted: boolean;
|
|
614
790
|
/**
|
|
@@ -622,13 +798,58 @@ declare module 'http' {
|
|
|
622
798
|
*/
|
|
623
799
|
protocol: string;
|
|
624
800
|
/**
|
|
625
|
-
*
|
|
801
|
+
* When sending request through a keep-alive enabled agent, the underlying socket
|
|
802
|
+
* might be reused. But if server closes connection at unfortunate time, client
|
|
803
|
+
* may run into a 'ECONNRESET' error.
|
|
804
|
+
*
|
|
805
|
+
* ```js
|
|
806
|
+
* const http = require('node:http');
|
|
807
|
+
*
|
|
808
|
+
* // Server has a 5 seconds keep-alive timeout by default
|
|
809
|
+
* http
|
|
810
|
+
* .createServer((req, res) => {
|
|
811
|
+
* res.write('hello\n');
|
|
812
|
+
* res.end();
|
|
813
|
+
* })
|
|
814
|
+
* .listen(3000);
|
|
815
|
+
*
|
|
816
|
+
* setInterval(() => {
|
|
817
|
+
* // Adapting a keep-alive agent
|
|
818
|
+
* http.get('http://localhost:3000', { agent }, (res) => {
|
|
819
|
+
* res.on('data', (data) => {
|
|
820
|
+
* // Do nothing
|
|
821
|
+
* });
|
|
822
|
+
* });
|
|
823
|
+
* }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout
|
|
824
|
+
* ```
|
|
825
|
+
*
|
|
826
|
+
* By marking a request whether it reused socket or not, we can do
|
|
827
|
+
* automatic error retry base on it.
|
|
828
|
+
*
|
|
829
|
+
* ```js
|
|
830
|
+
* const http = require('node:http');
|
|
831
|
+
* const agent = new http.Agent({ keepAlive: true });
|
|
832
|
+
*
|
|
833
|
+
* function retriableRequest() {
|
|
834
|
+
* const req = http
|
|
835
|
+
* .get('http://localhost:3000', { agent }, (res) => {
|
|
836
|
+
* // ...
|
|
837
|
+
* })
|
|
838
|
+
* .on('error', (err) => {
|
|
839
|
+
* // Check if retry is needed
|
|
840
|
+
* if (req.reusedSocket && err.code === 'ECONNRESET') {
|
|
841
|
+
* retriableRequest();
|
|
842
|
+
* }
|
|
843
|
+
* });
|
|
844
|
+
* }
|
|
845
|
+
*
|
|
846
|
+
* retriableRequest();
|
|
847
|
+
* ```
|
|
626
848
|
* @since v13.0.0, v12.16.0
|
|
627
849
|
*/
|
|
628
850
|
reusedSocket: boolean;
|
|
629
851
|
/**
|
|
630
852
|
* Limits maximum response headers count. If set to 0, no limit will be applied.
|
|
631
|
-
* @default 2000
|
|
632
853
|
*/
|
|
633
854
|
maxHeadersCount: number;
|
|
634
855
|
constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
|
|
@@ -775,7 +996,7 @@ declare module 'http' {
|
|
|
775
996
|
/**
|
|
776
997
|
* An `IncomingMessage` object is created by {@link Server} or {@link ClientRequest} and passed as the first argument to the `'request'` and `'response'` event respectively. It may be used to
|
|
777
998
|
* access response
|
|
778
|
-
* status, headers and data.
|
|
999
|
+
* status, headers, and data.
|
|
779
1000
|
*
|
|
780
1001
|
* Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to
|
|
781
1002
|
* parse and emit the incoming HTTP headers and payload, as the underlying socket
|
|
@@ -788,7 +1009,7 @@ declare module 'http' {
|
|
|
788
1009
|
* The `message.aborted` property will be `true` if the request has
|
|
789
1010
|
* been aborted.
|
|
790
1011
|
* @since v10.1.0
|
|
791
|
-
* @deprecated Since v17.0.0 - Check `message.destroyed` from
|
|
1012
|
+
* @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from <a href="stream.html#class-streamreadable" class="type">stream.Readable</a>.
|
|
792
1013
|
*/
|
|
793
1014
|
aborted: boolean;
|
|
794
1015
|
/**
|
|
@@ -813,7 +1034,7 @@ declare module 'http' {
|
|
|
813
1034
|
* const req = http.request({
|
|
814
1035
|
* host: '127.0.0.1',
|
|
815
1036
|
* port: 8080,
|
|
816
|
-
* method: 'POST'
|
|
1037
|
+
* method: 'POST',
|
|
817
1038
|
* }, (res) => {
|
|
818
1039
|
* res.resume();
|
|
819
1040
|
* res.on('end', () => {
|
|
@@ -840,7 +1061,7 @@ declare module 'http' {
|
|
|
840
1061
|
*
|
|
841
1062
|
* This property is guaranteed to be an instance of the `net.Socket` class,
|
|
842
1063
|
* a subclass of `stream.Duplex`, unless the user specified a socket
|
|
843
|
-
* type other than `net.Socket
|
|
1064
|
+
* type other than `net.Socket` or internally nulled.
|
|
844
1065
|
* @since v0.3.0
|
|
845
1066
|
*/
|
|
846
1067
|
socket: Socket;
|
|
@@ -863,12 +1084,30 @@ declare module 'http' {
|
|
|
863
1084
|
*
|
|
864
1085
|
* * Duplicates of `age`, `authorization`, `content-length`, `content-type`,`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,`last-modified`, `location`,
|
|
865
1086
|
* `max-forwards`, `proxy-authorization`, `referer`,`retry-after`, `server`, or `user-agent` are discarded.
|
|
1087
|
+
* To allow duplicate values of the headers listed above to be joined,
|
|
1088
|
+
* use the option `joinDuplicateHeaders` in {@link request} and {@link createServer}. See RFC 9110 Section 5.3 for more
|
|
1089
|
+
* information.
|
|
866
1090
|
* * `set-cookie` is always an array. Duplicates are added to the array.
|
|
867
|
-
* * For duplicate `cookie` headers, the values are joined together with
|
|
868
|
-
* * For all other headers, the values are joined together with
|
|
1091
|
+
* * For duplicate `cookie` headers, the values are joined together with `; `.
|
|
1092
|
+
* * For all other headers, the values are joined together with `, `.
|
|
869
1093
|
* @since v0.1.5
|
|
870
1094
|
*/
|
|
871
1095
|
headers: IncomingHttpHeaders;
|
|
1096
|
+
/**
|
|
1097
|
+
* Similar to `message.headers`, but there is no join logic and the values are
|
|
1098
|
+
* always arrays of strings, even for headers received just once.
|
|
1099
|
+
*
|
|
1100
|
+
* ```js
|
|
1101
|
+
* // Prints something like:
|
|
1102
|
+
* //
|
|
1103
|
+
* // { 'user-agent': ['curl/7.22.0'],
|
|
1104
|
+
* // host: ['127.0.0.1:8000'],
|
|
1105
|
+
* // accept: ['*'] }
|
|
1106
|
+
* console.log(request.headersDistinct);
|
|
1107
|
+
* ```
|
|
1108
|
+
* @since v18.3.0, v16.17.0
|
|
1109
|
+
*/
|
|
1110
|
+
headersDistinct: NodeJS.Dict<string[]>;
|
|
872
1111
|
/**
|
|
873
1112
|
* The raw request/response headers list exactly as they were received.
|
|
874
1113
|
*
|
|
@@ -899,6 +1138,13 @@ declare module 'http' {
|
|
|
899
1138
|
* @since v0.3.0
|
|
900
1139
|
*/
|
|
901
1140
|
trailers: NodeJS.Dict<string>;
|
|
1141
|
+
/**
|
|
1142
|
+
* Similar to `message.trailers`, but there is no join logic and the values are
|
|
1143
|
+
* always arrays of strings, even for headers received just once.
|
|
1144
|
+
* Only populated at the `'end'` event.
|
|
1145
|
+
* @since v18.3.0, v16.17.0
|
|
1146
|
+
*/
|
|
1147
|
+
trailersDistinct: NodeJS.Dict<string[]>;
|
|
902
1148
|
/**
|
|
903
1149
|
* The raw request/response trailer keys and values exactly as they were
|
|
904
1150
|
* received. Only populated at the `'end'` event.
|
|
@@ -934,7 +1180,7 @@ declare module 'http' {
|
|
|
934
1180
|
* new URL(request.url, `http://${request.headers.host}`);
|
|
935
1181
|
* ```
|
|
936
1182
|
*
|
|
937
|
-
* When `request.url` is `'/status?name=ryan'` and`request.headers.host` is
|
|
1183
|
+
* When `request.url` is `'/status?name=ryan'` and `request.headers.host` is`'localhost:3000'`:
|
|
938
1184
|
*
|
|
939
1185
|
* ```console
|
|
940
1186
|
* $ node
|
|
@@ -1058,16 +1304,16 @@ declare module 'http' {
|
|
|
1058
1304
|
* hostname: 'localhost',
|
|
1059
1305
|
* port: 80,
|
|
1060
1306
|
* path: '/',
|
|
1061
|
-
* agent: false // Create a new agent just for this one request
|
|
1307
|
+
* agent: false, // Create a new agent just for this one request
|
|
1062
1308
|
* }, (res) => {
|
|
1063
1309
|
* // Do stuff with response
|
|
1064
1310
|
* });
|
|
1065
1311
|
* ```
|
|
1066
1312
|
* @since v0.3.4
|
|
1067
1313
|
*/
|
|
1068
|
-
class Agent {
|
|
1314
|
+
class Agent extends EventEmitter {
|
|
1069
1315
|
/**
|
|
1070
|
-
* By default set to 256
|
|
1316
|
+
* By default set to 256. For agents with `keepAlive` enabled, this
|
|
1071
1317
|
* sets the maximum number of sockets that will be left open in the free
|
|
1072
1318
|
* state.
|
|
1073
1319
|
* @since v0.11.7
|
|
@@ -1131,12 +1377,23 @@ declare module 'http' {
|
|
|
1131
1377
|
* added to the `'request'` event.
|
|
1132
1378
|
* @since v0.1.13
|
|
1133
1379
|
*/
|
|
1134
|
-
function createServer
|
|
1135
|
-
|
|
1380
|
+
function createServer<
|
|
1381
|
+
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
1382
|
+
Response extends typeof ServerResponse = typeof ServerResponse,
|
|
1383
|
+
>(requestListener?: RequestListener<Request, Response>): Server<Request, Response>;
|
|
1384
|
+
function createServer<
|
|
1385
|
+
Request extends typeof IncomingMessage = typeof IncomingMessage,
|
|
1386
|
+
Response extends typeof ServerResponse = typeof ServerResponse,
|
|
1387
|
+
>(
|
|
1388
|
+
options: ServerOptions<Request, Response>,
|
|
1389
|
+
requestListener?: RequestListener<Request, Response>,
|
|
1390
|
+
): Server<Request, Response>;
|
|
1136
1391
|
// although RequestOptions are passed as ClientRequestArgs to ClientRequest directly,
|
|
1137
1392
|
// create interface RequestOptions would make the naming more clear to developers
|
|
1138
1393
|
interface RequestOptions extends ClientRequestArgs {}
|
|
1139
1394
|
/**
|
|
1395
|
+
* `options` in `socket.connect()` are also supported.
|
|
1396
|
+
*
|
|
1140
1397
|
* Node.js maintains several connections per server to make HTTP requests.
|
|
1141
1398
|
* This function allows one to transparently issue requests.
|
|
1142
1399
|
*
|
|
@@ -1152,10 +1409,10 @@ declare module 'http' {
|
|
|
1152
1409
|
* upload a file with a POST request, then write to the `ClientRequest` object.
|
|
1153
1410
|
*
|
|
1154
1411
|
* ```js
|
|
1155
|
-
* const http = require('http');
|
|
1412
|
+
* const http = require('node:http');
|
|
1156
1413
|
*
|
|
1157
1414
|
* const postData = JSON.stringify({
|
|
1158
|
-
* 'msg': 'Hello World!'
|
|
1415
|
+
* 'msg': 'Hello World!',
|
|
1159
1416
|
* });
|
|
1160
1417
|
*
|
|
1161
1418
|
* const options = {
|
|
@@ -1165,8 +1422,8 @@ declare module 'http' {
|
|
|
1165
1422
|
* method: 'POST',
|
|
1166
1423
|
* headers: {
|
|
1167
1424
|
* 'Content-Type': 'application/json',
|
|
1168
|
-
* 'Content-Length': Buffer.byteLength(postData)
|
|
1169
|
-
* }
|
|
1425
|
+
* 'Content-Length': Buffer.byteLength(postData),
|
|
1426
|
+
* },
|
|
1170
1427
|
* };
|
|
1171
1428
|
*
|
|
1172
1429
|
* const req = http.request(options, (res) => {
|
|
@@ -1253,7 +1510,7 @@ declare module 'http' {
|
|
|
1253
1510
|
* * `'data'` any number of times, on the `res` object
|
|
1254
1511
|
* * (connection closed here)
|
|
1255
1512
|
* * `'aborted'` on the `res` object
|
|
1256
|
-
* * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'
|
|
1513
|
+
* * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`
|
|
1257
1514
|
* * `'close'`
|
|
1258
1515
|
* * `'close'` on the `res` object
|
|
1259
1516
|
*
|
|
@@ -1261,7 +1518,7 @@ declare module 'http' {
|
|
|
1261
1518
|
* events will be emitted in the following order:
|
|
1262
1519
|
*
|
|
1263
1520
|
* * (`req.destroy()` called here)
|
|
1264
|
-
* * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`
|
|
1521
|
+
* * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`, or the error with which `req.destroy()` was called
|
|
1265
1522
|
* * `'close'`
|
|
1266
1523
|
*
|
|
1267
1524
|
* If `req.destroy()` is called before the connection succeeds, the following
|
|
@@ -1269,7 +1526,7 @@ declare module 'http' {
|
|
|
1269
1526
|
*
|
|
1270
1527
|
* * `'socket'`
|
|
1271
1528
|
* * (`req.destroy()` called here)
|
|
1272
|
-
* * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`
|
|
1529
|
+
* * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`, or the error with which `req.destroy()` was called
|
|
1273
1530
|
* * `'close'`
|
|
1274
1531
|
*
|
|
1275
1532
|
* If `req.destroy()` is called after the response is received, the following
|
|
@@ -1280,7 +1537,7 @@ declare module 'http' {
|
|
|
1280
1537
|
* * `'data'` any number of times, on the `res` object
|
|
1281
1538
|
* * (`req.destroy()` called here)
|
|
1282
1539
|
* * `'aborted'` on the `res` object
|
|
1283
|
-
* * `'error'` on the `res` object with an error with message`'Error: aborted'`
|
|
1540
|
+
* * `'error'` on the `res` object with an error with message `'Error: aborted'`and code `'ECONNRESET'`, or the error with which `req.destroy()` was called
|
|
1284
1541
|
* * `'close'`
|
|
1285
1542
|
* * `'close'` on the `res` object
|
|
1286
1543
|
*
|
|
@@ -1316,8 +1573,9 @@ declare module 'http' {
|
|
|
1316
1573
|
* Setting the `timeout` option or using the `setTimeout()` function will
|
|
1317
1574
|
* not abort the request or do anything besides add a `'timeout'` event.
|
|
1318
1575
|
*
|
|
1319
|
-
* Passing an `AbortSignal` and then calling `abort` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the
|
|
1320
|
-
* request
|
|
1576
|
+
* Passing an `AbortSignal` and then calling `abort()` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the
|
|
1577
|
+
* request. Specifically, the `'error'` event will be emitted with an error with
|
|
1578
|
+
* the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'`and the `cause`, if one was provided.
|
|
1321
1579
|
* @since v0.3.6
|
|
1322
1580
|
*/
|
|
1323
1581
|
function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
|
|
@@ -1373,7 +1631,7 @@ declare module 'http' {
|
|
|
1373
1631
|
* const server = http.createServer((req, res) => {
|
|
1374
1632
|
* res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
1375
1633
|
* res.end(JSON.stringify({
|
|
1376
|
-
* data: 'Hello World!'
|
|
1634
|
+
* data: 'Hello World!',
|
|
1377
1635
|
* }));
|
|
1378
1636
|
* });
|
|
1379
1637
|
*
|
|
@@ -1384,6 +1642,76 @@ declare module 'http' {
|
|
|
1384
1642
|
*/
|
|
1385
1643
|
function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
|
|
1386
1644
|
function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
|
|
1645
|
+
/**
|
|
1646
|
+
* Performs the low-level validations on the provided `name` that are done when`res.setHeader(name, value)` is called.
|
|
1647
|
+
*
|
|
1648
|
+
* Passing illegal value as `name` will result in a `TypeError` being thrown,
|
|
1649
|
+
* identified by `code: 'ERR_INVALID_HTTP_TOKEN'`.
|
|
1650
|
+
*
|
|
1651
|
+
* It is not necessary to use this method before passing headers to an HTTP request
|
|
1652
|
+
* or response. The HTTP module will automatically validate such headers.
|
|
1653
|
+
* Examples:
|
|
1654
|
+
*
|
|
1655
|
+
* Example:
|
|
1656
|
+
*
|
|
1657
|
+
* ```js
|
|
1658
|
+
* const { validateHeaderName } = require('node:http');
|
|
1659
|
+
*
|
|
1660
|
+
* try {
|
|
1661
|
+
* validateHeaderName('');
|
|
1662
|
+
* } catch (err) {
|
|
1663
|
+
* console.error(err instanceof TypeError); // --> true
|
|
1664
|
+
* console.error(err.code); // --> 'ERR_INVALID_HTTP_TOKEN'
|
|
1665
|
+
* console.error(err.message); // --> 'Header name must be a valid HTTP token [""]'
|
|
1666
|
+
* }
|
|
1667
|
+
* ```
|
|
1668
|
+
* @since v14.3.0
|
|
1669
|
+
* @param [label='Header name'] Label for error message.
|
|
1670
|
+
*/
|
|
1671
|
+
function validateHeaderName(name: string): void;
|
|
1672
|
+
/**
|
|
1673
|
+
* Performs the low-level validations on the provided `value` that are done when`res.setHeader(name, value)` is called.
|
|
1674
|
+
*
|
|
1675
|
+
* Passing illegal value as `value` will result in a `TypeError` being thrown.
|
|
1676
|
+
*
|
|
1677
|
+
* * Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`.
|
|
1678
|
+
* * Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`.
|
|
1679
|
+
*
|
|
1680
|
+
* It is not necessary to use this method before passing headers to an HTTP request
|
|
1681
|
+
* or response. The HTTP module will automatically validate such headers.
|
|
1682
|
+
*
|
|
1683
|
+
* Examples:
|
|
1684
|
+
*
|
|
1685
|
+
* ```js
|
|
1686
|
+
* const { validateHeaderValue } = require('node:http');
|
|
1687
|
+
*
|
|
1688
|
+
* try {
|
|
1689
|
+
* validateHeaderValue('x-my-header', undefined);
|
|
1690
|
+
* } catch (err) {
|
|
1691
|
+
* console.error(err instanceof TypeError); // --> true
|
|
1692
|
+
* console.error(err.code === 'ERR_HTTP_INVALID_HEADER_VALUE'); // --> true
|
|
1693
|
+
* console.error(err.message); // --> 'Invalid value "undefined" for header "x-my-header"'
|
|
1694
|
+
* }
|
|
1695
|
+
*
|
|
1696
|
+
* try {
|
|
1697
|
+
* validateHeaderValue('x-my-header', 'oʊmɪɡə');
|
|
1698
|
+
* } catch (err) {
|
|
1699
|
+
* console.error(err instanceof TypeError); // --> true
|
|
1700
|
+
* console.error(err.code === 'ERR_INVALID_CHAR'); // --> true
|
|
1701
|
+
* console.error(err.message); // --> 'Invalid character in header content ["x-my-header"]'
|
|
1702
|
+
* }
|
|
1703
|
+
* ```
|
|
1704
|
+
* @since v14.3.0
|
|
1705
|
+
* @param name Header name
|
|
1706
|
+
* @param value Header value
|
|
1707
|
+
*/
|
|
1708
|
+
function validateHeaderValue(name: string, value: string): void;
|
|
1709
|
+
/**
|
|
1710
|
+
* Set the maximum number of idle HTTP parsers.
|
|
1711
|
+
* @since v18.8.0, v16.18.0
|
|
1712
|
+
* @param [max=1000]
|
|
1713
|
+
*/
|
|
1714
|
+
function setMaxIdleHTTPParsers(max: number): void;
|
|
1387
1715
|
let globalAgent: Agent;
|
|
1388
1716
|
/**
|
|
1389
1717
|
* Read-only property specifying the maximum allowed size of HTTP headers in bytes.
|