cdk-ecr-deployment 0.0.75 → 0.0.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/.gitattributes +20 -21
  2. package/.jsii +43 -35
  3. package/lambda/Dockerfile +25 -0
  4. package/lambda/install.js +64 -0
  5. package/lib/index.js +40 -23
  6. package/node_modules/@sindresorhus/is/dist/index.d.ts +225 -0
  7. package/node_modules/@sindresorhus/is/dist/index.js +427 -0
  8. package/node_modules/@sindresorhus/is/dist/types.d.ts +24 -0
  9. package/node_modules/@sindresorhus/is/dist/types.js +3 -0
  10. package/node_modules/@sindresorhus/is/license +9 -0
  11. package/node_modules/@sindresorhus/is/package.json +96 -0
  12. package/node_modules/@sindresorhus/is/readme.md +628 -0
  13. package/node_modules/@szmarczak/http-timer/LICENSE +21 -0
  14. package/node_modules/@szmarczak/http-timer/README.md +93 -0
  15. package/node_modules/@szmarczak/http-timer/dist/source/index.d.ts +32 -0
  16. package/node_modules/@szmarczak/http-timer/dist/source/index.js +126 -0
  17. package/node_modules/@szmarczak/http-timer/package.json +72 -0
  18. package/node_modules/@types/cacheable-request/LICENSE +21 -0
  19. package/node_modules/@types/cacheable-request/README.md +16 -0
  20. package/node_modules/@types/cacheable-request/index.d.ts +137 -0
  21. package/node_modules/@types/cacheable-request/node_modules/@types/node/LICENSE +21 -0
  22. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +16 -0
  23. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert/strict.d.ts +8 -0
  24. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +912 -0
  25. package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +497 -0
  26. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +2142 -0
  27. package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +1366 -0
  28. package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +414 -0
  29. package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +412 -0
  30. package/node_modules/@types/cacheable-request/node_modules/@types/node/constants.d.ts +18 -0
  31. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +3307 -0
  32. package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +545 -0
  33. package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +134 -0
  34. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +368 -0
  35. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +654 -0
  36. package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +169 -0
  37. package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +623 -0
  38. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +1091 -0
  39. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +3784 -0
  40. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +284 -0
  41. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.global.d.ts +1 -0
  42. package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +1369 -0
  43. package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +2100 -0
  44. package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +391 -0
  45. package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +131 -0
  46. package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +2745 -0
  47. package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +114 -0
  48. package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +783 -0
  49. package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +455 -0
  50. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +230 -0
  51. package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +172 -0
  52. package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +555 -0
  53. package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +1481 -0
  54. package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +117 -0
  55. package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +131 -0
  56. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +543 -0
  57. package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +424 -0
  58. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +24 -0
  59. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +42 -0
  60. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +6 -0
  61. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +1249 -0
  62. package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +67 -0
  63. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +68 -0
  64. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +94 -0
  65. package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +1019 -0
  66. package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +161 -0
  67. package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +204 -0
  68. package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +821 -0
  69. package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +1594 -0
  70. package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +378 -0
  71. package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +507 -0
  72. package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +158 -0
  73. package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +649 -0
  74. package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +517 -0
  75. package/node_modules/@types/cacheable-request/package.json +35 -0
  76. package/node_modules/@types/http-cache-semantics/LICENSE +21 -0
  77. package/node_modules/@types/http-cache-semantics/README.md +16 -0
  78. package/node_modules/@types/http-cache-semantics/index.d.ts +170 -0
  79. package/node_modules/@types/http-cache-semantics/package.json +25 -0
  80. package/node_modules/@types/keyv/LICENSE +21 -0
  81. package/node_modules/@types/keyv/README.md +16 -0
  82. package/node_modules/@types/keyv/index.d.ts +77 -0
  83. package/node_modules/@types/keyv/node_modules/@types/node/LICENSE +21 -0
  84. package/node_modules/@types/keyv/node_modules/@types/node/README.md +16 -0
  85. package/node_modules/@types/keyv/node_modules/@types/node/assert/strict.d.ts +8 -0
  86. package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +912 -0
  87. package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +497 -0
  88. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +2142 -0
  89. package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +1366 -0
  90. package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +414 -0
  91. package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +412 -0
  92. package/node_modules/@types/keyv/node_modules/@types/node/constants.d.ts +18 -0
  93. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +3307 -0
  94. package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +545 -0
  95. package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +134 -0
  96. package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +368 -0
  97. package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +654 -0
  98. package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +169 -0
  99. package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +623 -0
  100. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +1091 -0
  101. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +3784 -0
  102. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +284 -0
  103. package/node_modules/@types/keyv/node_modules/@types/node/globals.global.d.ts +1 -0
  104. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +1369 -0
  105. package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +2100 -0
  106. package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +391 -0
  107. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +131 -0
  108. package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +2745 -0
  109. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +114 -0
  110. package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +783 -0
  111. package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +455 -0
  112. package/node_modules/@types/keyv/node_modules/@types/node/package.json +230 -0
  113. package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +172 -0
  114. package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +555 -0
  115. package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +1481 -0
  116. package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +117 -0
  117. package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +131 -0
  118. package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +543 -0
  119. package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +424 -0
  120. package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +24 -0
  121. package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +42 -0
  122. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +6 -0
  123. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +1249 -0
  124. package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +67 -0
  125. package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +68 -0
  126. package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +94 -0
  127. package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +1019 -0
  128. package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +161 -0
  129. package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +204 -0
  130. package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +821 -0
  131. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +1594 -0
  132. package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +378 -0
  133. package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +507 -0
  134. package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +158 -0
  135. package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +649 -0
  136. package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +517 -0
  137. package/node_modules/@types/keyv/package.json +32 -0
  138. package/node_modules/@types/responselike/LICENSE +21 -0
  139. package/node_modules/@types/responselike/README.md +16 -0
  140. package/node_modules/@types/responselike/index.d.ts +34 -0
  141. package/node_modules/@types/responselike/node_modules/@types/node/LICENSE +21 -0
  142. package/node_modules/@types/responselike/node_modules/@types/node/README.md +16 -0
  143. package/node_modules/@types/responselike/node_modules/@types/node/assert/strict.d.ts +8 -0
  144. package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +912 -0
  145. package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +497 -0
  146. package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +2142 -0
  147. package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +1366 -0
  148. package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +414 -0
  149. package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +412 -0
  150. package/node_modules/@types/responselike/node_modules/@types/node/constants.d.ts +18 -0
  151. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +3307 -0
  152. package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +545 -0
  153. package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +134 -0
  154. package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +368 -0
  155. package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +654 -0
  156. package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +169 -0
  157. package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +623 -0
  158. package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +1091 -0
  159. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +3784 -0
  160. package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +284 -0
  161. package/node_modules/@types/responselike/node_modules/@types/node/globals.global.d.ts +1 -0
  162. package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +1369 -0
  163. package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +2100 -0
  164. package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +391 -0
  165. package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +131 -0
  166. package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +2745 -0
  167. package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +114 -0
  168. package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +783 -0
  169. package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +455 -0
  170. package/node_modules/@types/responselike/node_modules/@types/node/package.json +230 -0
  171. package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +172 -0
  172. package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +555 -0
  173. package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +1481 -0
  174. package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +117 -0
  175. package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +131 -0
  176. package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +543 -0
  177. package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +424 -0
  178. package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +24 -0
  179. package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +42 -0
  180. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +6 -0
  181. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +1249 -0
  182. package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +67 -0
  183. package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +68 -0
  184. package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +94 -0
  185. package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +1019 -0
  186. package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +161 -0
  187. package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +204 -0
  188. package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +821 -0
  189. package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +1594 -0
  190. package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +378 -0
  191. package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +507 -0
  192. package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +158 -0
  193. package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +649 -0
  194. package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +517 -0
  195. package/node_modules/@types/responselike/package.json +25 -0
  196. package/node_modules/cacheable-lookup/LICENSE +21 -0
  197. package/node_modules/cacheable-lookup/README.md +240 -0
  198. package/node_modules/cacheable-lookup/index.d.ts +139 -0
  199. package/node_modules/cacheable-lookup/package.json +45 -0
  200. package/node_modules/cacheable-lookup/source/index.js +436 -0
  201. package/node_modules/cacheable-request/LICENSE +21 -0
  202. package/node_modules/cacheable-request/README.md +206 -0
  203. package/node_modules/cacheable-request/package.json +56 -0
  204. package/node_modules/cacheable-request/src/index.js +251 -0
  205. package/node_modules/clone-response/LICENSE +21 -0
  206. package/node_modules/clone-response/README.md +62 -0
  207. package/node_modules/clone-response/package.json +44 -0
  208. package/node_modules/clone-response/src/index.js +17 -0
  209. package/node_modules/decompress-response/index.d.ts +22 -0
  210. package/node_modules/decompress-response/index.js +58 -0
  211. package/node_modules/decompress-response/license +9 -0
  212. package/node_modules/decompress-response/node_modules/mimic-response/index.d.ts +17 -0
  213. package/node_modules/decompress-response/node_modules/mimic-response/index.js +77 -0
  214. package/node_modules/decompress-response/node_modules/mimic-response/license +9 -0
  215. package/node_modules/decompress-response/node_modules/mimic-response/package.json +42 -0
  216. package/node_modules/decompress-response/node_modules/mimic-response/readme.md +78 -0
  217. package/node_modules/decompress-response/package.json +56 -0
  218. package/node_modules/decompress-response/readme.md +48 -0
  219. package/node_modules/defer-to-connect/LICENSE +21 -0
  220. package/node_modules/defer-to-connect/README.md +38 -0
  221. package/node_modules/defer-to-connect/dist/source/index.d.ts +10 -0
  222. package/node_modules/defer-to-connect/dist/source/index.js +47 -0
  223. package/node_modules/defer-to-connect/package.json +71 -0
  224. package/node_modules/end-of-stream/LICENSE +21 -0
  225. package/node_modules/end-of-stream/README.md +54 -0
  226. package/node_modules/end-of-stream/index.js +94 -0
  227. package/node_modules/end-of-stream/package.json +37 -0
  228. package/node_modules/get-stream/buffer-stream.js +52 -0
  229. package/node_modules/get-stream/index.d.ts +108 -0
  230. package/node_modules/get-stream/index.js +60 -0
  231. package/node_modules/get-stream/license +9 -0
  232. package/node_modules/get-stream/package.json +50 -0
  233. package/node_modules/get-stream/readme.md +124 -0
  234. package/node_modules/got/dist/source/as-promise/create-rejection.d.ts +2 -0
  235. package/node_modules/got/dist/source/as-promise/create-rejection.js +30 -0
  236. package/node_modules/got/dist/source/as-promise/index.d.ts +3 -0
  237. package/node_modules/got/dist/source/as-promise/index.js +175 -0
  238. package/node_modules/got/dist/source/as-promise/normalize-arguments.d.ts +3 -0
  239. package/node_modules/got/dist/source/as-promise/normalize-arguments.js +78 -0
  240. package/node_modules/got/dist/source/as-promise/parse-body.d.ts +3 -0
  241. package/node_modules/got/dist/source/as-promise/parse-body.js +25 -0
  242. package/node_modules/got/dist/source/as-promise/types.d.ts +256 -0
  243. package/node_modules/got/dist/source/as-promise/types.js +40 -0
  244. package/node_modules/got/dist/source/core/calculate-retry-delay.d.ts +5 -0
  245. package/node_modules/got/dist/source/core/calculate-retry-delay.js +29 -0
  246. package/node_modules/got/dist/source/core/index.d.ts +1124 -0
  247. package/node_modules/got/dist/source/core/index.js +1491 -0
  248. package/node_modules/got/dist/source/core/utils/dns-ip-version.d.ts +5 -0
  249. package/node_modules/got/dist/source/core/utils/dns-ip-version.js +17 -0
  250. package/node_modules/got/dist/source/core/utils/get-body-size.d.ts +3 -0
  251. package/node_modules/got/dist/source/core/utils/get-body-size.js +32 -0
  252. package/node_modules/got/dist/source/core/utils/get-buffer.d.ts +4 -0
  253. package/node_modules/got/dist/source/core/utils/get-buffer.js +16 -0
  254. package/node_modules/got/dist/source/core/utils/is-form-data.d.ts +8 -0
  255. package/node_modules/got/dist/source/core/utils/is-form-data.js +4 -0
  256. package/node_modules/got/dist/source/core/utils/is-response-ok.d.ts +2 -0
  257. package/node_modules/got/dist/source/core/utils/is-response-ok.js +8 -0
  258. package/node_modules/got/dist/source/core/utils/options-to-url.d.ts +14 -0
  259. package/node_modules/got/dist/source/core/utils/options-to-url.js +53 -0
  260. package/node_modules/got/dist/source/core/utils/proxy-events.d.ts +3 -0
  261. package/node_modules/got/dist/source/core/utils/proxy-events.js +17 -0
  262. package/node_modules/got/dist/source/core/utils/timed-out.d.ts +29 -0
  263. package/node_modules/got/dist/source/core/utils/timed-out.js +121 -0
  264. package/node_modules/got/dist/source/core/utils/unhandle.d.ts +11 -0
  265. package/node_modules/got/dist/source/core/utils/unhandle.js +22 -0
  266. package/node_modules/got/dist/source/core/utils/url-to-options.d.ts +15 -0
  267. package/node_modules/got/dist/source/core/utils/url-to-options.js +24 -0
  268. package/node_modules/got/dist/source/core/utils/weakable-map.d.ts +8 -0
  269. package/node_modules/got/dist/source/core/utils/weakable-map.js +29 -0
  270. package/node_modules/got/dist/source/create.d.ts +5 -0
  271. package/node_modules/got/dist/source/create.js +240 -0
  272. package/node_modules/got/dist/source/index.d.ts +4 -0
  273. package/node_modules/got/dist/source/index.js +132 -0
  274. package/node_modules/got/dist/source/types.d.ts +342 -0
  275. package/node_modules/got/dist/source/types.js +2 -0
  276. package/node_modules/got/dist/source/utils/deep-freeze.d.ts +1 -0
  277. package/node_modules/got/dist/source/utils/deep-freeze.js +12 -0
  278. package/node_modules/got/dist/source/utils/deprecation-warning.d.ts +2 -0
  279. package/node_modules/got/dist/source/utils/deprecation-warning.js +13 -0
  280. package/node_modules/got/license +9 -0
  281. package/node_modules/got/package.json +130 -0
  282. package/node_modules/got/readme.md +2476 -0
  283. package/node_modules/http-cache-semantics/LICENSE +9 -0
  284. package/node_modules/http-cache-semantics/README.md +203 -0
  285. package/node_modules/http-cache-semantics/index.js +673 -0
  286. package/node_modules/http-cache-semantics/package.json +24 -0
  287. package/node_modules/http2-wrapper/LICENSE +21 -0
  288. package/node_modules/http2-wrapper/README.md +470 -0
  289. package/node_modules/http2-wrapper/package.json +54 -0
  290. package/node_modules/http2-wrapper/source/agent.js +670 -0
  291. package/node_modules/http2-wrapper/source/auto.js +149 -0
  292. package/node_modules/http2-wrapper/source/client-request.js +445 -0
  293. package/node_modules/http2-wrapper/source/incoming-message.js +58 -0
  294. package/node_modules/http2-wrapper/source/index.js +28 -0
  295. package/node_modules/http2-wrapper/source/utils/calculate-server-name.js +27 -0
  296. package/node_modules/http2-wrapper/source/utils/errors.js +45 -0
  297. package/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js +13 -0
  298. package/node_modules/http2-wrapper/source/utils/proxy-events.js +7 -0
  299. package/node_modules/http2-wrapper/source/utils/url-to-options.js +25 -0
  300. package/node_modules/json-buffer/.travis.yml +3 -0
  301. package/node_modules/json-buffer/LICENSE +22 -0
  302. package/node_modules/json-buffer/README.md +24 -0
  303. package/node_modules/json-buffer/index.js +58 -0
  304. package/node_modules/json-buffer/package.json +34 -0
  305. package/node_modules/json-buffer/test/index.js +63 -0
  306. package/node_modules/keyv/LICENSE +21 -0
  307. package/node_modules/keyv/README.md +288 -0
  308. package/node_modules/keyv/package.json +49 -0
  309. package/node_modules/keyv/src/index.js +111 -0
  310. package/node_modules/lowercase-keys/index.d.ts +16 -0
  311. package/node_modules/lowercase-keys/index.js +10 -0
  312. package/node_modules/lowercase-keys/license +9 -0
  313. package/node_modules/lowercase-keys/package.json +38 -0
  314. package/node_modules/lowercase-keys/readme.md +32 -0
  315. package/node_modules/mimic-response/index.js +32 -0
  316. package/node_modules/mimic-response/license +9 -0
  317. package/node_modules/mimic-response/package.json +37 -0
  318. package/node_modules/mimic-response/readme.md +54 -0
  319. package/node_modules/normalize-url/index.d.ts +267 -0
  320. package/node_modules/normalize-url/index.js +216 -0
  321. package/node_modules/normalize-url/license +9 -0
  322. package/node_modules/normalize-url/package.json +50 -0
  323. package/node_modules/normalize-url/readme.md +286 -0
  324. package/node_modules/once/LICENSE +15 -0
  325. package/node_modules/once/README.md +79 -0
  326. package/node_modules/once/once.js +42 -0
  327. package/node_modules/once/package.json +33 -0
  328. package/node_modules/p-cancelable/index.d.ts +176 -0
  329. package/node_modules/p-cancelable/index.js +111 -0
  330. package/node_modules/p-cancelable/license +9 -0
  331. package/node_modules/p-cancelable/package.json +49 -0
  332. package/node_modules/p-cancelable/readme.md +153 -0
  333. package/node_modules/pump/.travis.yml +5 -0
  334. package/node_modules/pump/LICENSE +21 -0
  335. package/node_modules/pump/README.md +65 -0
  336. package/node_modules/pump/index.js +82 -0
  337. package/node_modules/pump/package.json +24 -0
  338. package/node_modules/pump/test-browser.js +66 -0
  339. package/node_modules/pump/test-node.js +53 -0
  340. package/node_modules/quick-lru/index.d.ts +97 -0
  341. package/node_modules/quick-lru/index.js +123 -0
  342. package/node_modules/quick-lru/license +9 -0
  343. package/node_modules/quick-lru/package.json +43 -0
  344. package/node_modules/quick-lru/readme.md +111 -0
  345. package/node_modules/resolve-alpn/LICENSE +22 -0
  346. package/node_modules/resolve-alpn/README.md +60 -0
  347. package/node_modules/resolve-alpn/index.js +43 -0
  348. package/node_modules/resolve-alpn/package.json +34 -0
  349. package/node_modules/responselike/LICENSE +19 -0
  350. package/node_modules/responselike/README.md +77 -0
  351. package/node_modules/responselike/package.json +38 -0
  352. package/node_modules/responselike/src/index.js +34 -0
  353. package/node_modules/wrappy/LICENSE +15 -0
  354. package/node_modules/wrappy/README.md +36 -0
  355. package/node_modules/wrappy/package.json +29 -0
  356. package/node_modules/wrappy/wrappy.js +33 -0
  357. package/package.json +41 -38
@@ -0,0 +1,1369 @@
1
+ /**
2
+ * To use the HTTP server and client one must `require('http')`.
3
+ *
4
+ * The HTTP interfaces in Node.js are designed to support many features
5
+ * of the protocol which have been traditionally difficult to use.
6
+ * In particular, large, possibly chunk-encoded, messages. The interface is
7
+ * careful to never buffer entire requests or responses, so the
8
+ * user is able to stream data.
9
+ *
10
+ * HTTP message headers are represented by an object like this:
11
+ *
12
+ * ```js
13
+ * { 'content-length': '123',
14
+ * 'content-type': 'text/plain',
15
+ * 'connection': 'keep-alive',
16
+ * 'host': 'mysite.com',
17
+ * 'accept': '*' }
18
+ * ```
19
+ *
20
+ * Keys are lowercased. Values are not modified.
21
+ *
22
+ * In order to support the full spectrum of possible HTTP applications, the Node.js
23
+ * HTTP API is very low-level. It deals with stream handling and message
24
+ * parsing only. It parses a message into headers and body but it does not
25
+ * parse the actual headers or the body.
26
+ *
27
+ * See `message.headers` for details on how duplicate headers are handled.
28
+ *
29
+ * The raw headers as they were received are retained in the `rawHeaders`property, which is an array of `[key, value, key2, value2, ...]`. For
30
+ * example, the previous message header object might have a `rawHeaders`list like the following:
31
+ *
32
+ * ```js
33
+ * [ 'ConTent-Length', '123456',
34
+ * 'content-LENGTH', '123',
35
+ * 'content-type', 'text/plain',
36
+ * 'CONNECTION', 'keep-alive',
37
+ * 'Host', 'mysite.com',
38
+ * 'accepT', '*' ]
39
+ * ```
40
+ * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/http.js)
41
+ */
42
+ declare module 'http' {
43
+ import * as stream from 'node:stream';
44
+ import { URL } from 'node:url';
45
+ import { TcpSocketConnectOpts, Socket, Server as NetServer, LookupFunction } from 'node:net';
46
+ // incoming headers will never contain number
47
+ interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
48
+ accept?: string | undefined;
49
+ 'accept-language'?: string | undefined;
50
+ 'accept-patch'?: string | undefined;
51
+ 'accept-ranges'?: string | undefined;
52
+ 'access-control-allow-credentials'?: string | undefined;
53
+ 'access-control-allow-headers'?: string | undefined;
54
+ 'access-control-allow-methods'?: string | undefined;
55
+ 'access-control-allow-origin'?: string | undefined;
56
+ 'access-control-expose-headers'?: string | undefined;
57
+ 'access-control-max-age'?: string | undefined;
58
+ 'access-control-request-headers'?: string | undefined;
59
+ 'access-control-request-method'?: string | undefined;
60
+ age?: string | undefined;
61
+ allow?: string | undefined;
62
+ 'alt-svc'?: string | undefined;
63
+ authorization?: string | undefined;
64
+ 'cache-control'?: string | undefined;
65
+ connection?: string | undefined;
66
+ 'content-disposition'?: string | undefined;
67
+ 'content-encoding'?: string | undefined;
68
+ 'content-language'?: string | undefined;
69
+ 'content-length'?: string | undefined;
70
+ 'content-location'?: string | undefined;
71
+ 'content-range'?: string | undefined;
72
+ 'content-type'?: string | undefined;
73
+ cookie?: string | undefined;
74
+ date?: string | undefined;
75
+ etag?: string | undefined;
76
+ expect?: string | undefined;
77
+ expires?: string | undefined;
78
+ forwarded?: string | undefined;
79
+ from?: string | undefined;
80
+ host?: string | undefined;
81
+ 'if-match'?: string | undefined;
82
+ 'if-modified-since'?: string | undefined;
83
+ 'if-none-match'?: string | undefined;
84
+ 'if-unmodified-since'?: string | undefined;
85
+ 'last-modified'?: string | undefined;
86
+ location?: string | undefined;
87
+ origin?: string | undefined;
88
+ pragma?: string | undefined;
89
+ 'proxy-authenticate'?: string | undefined;
90
+ 'proxy-authorization'?: string | undefined;
91
+ 'public-key-pins'?: string | undefined;
92
+ range?: string | undefined;
93
+ referer?: string | undefined;
94
+ 'retry-after'?: string | undefined;
95
+ 'sec-websocket-accept'?: string | undefined;
96
+ 'sec-websocket-extensions'?: string | undefined;
97
+ 'sec-websocket-key'?: string | undefined;
98
+ 'sec-websocket-protocol'?: string | undefined;
99
+ 'sec-websocket-version'?: string | undefined;
100
+ 'set-cookie'?: string[] | undefined;
101
+ 'strict-transport-security'?: string | undefined;
102
+ tk?: string | undefined;
103
+ trailer?: string | undefined;
104
+ 'transfer-encoding'?: string | undefined;
105
+ upgrade?: string | undefined;
106
+ 'user-agent'?: string | undefined;
107
+ vary?: string | undefined;
108
+ via?: string | undefined;
109
+ warning?: string | undefined;
110
+ 'www-authenticate'?: string | undefined;
111
+ }
112
+ // outgoing headers allows numbers (as they are converted internally to strings)
113
+ type OutgoingHttpHeader = number | string | string[];
114
+ interface OutgoingHttpHeaders extends NodeJS.Dict<OutgoingHttpHeader> {}
115
+ interface ClientRequestArgs {
116
+ abort?: AbortSignal | undefined;
117
+ protocol?: string | null | undefined;
118
+ host?: string | null | undefined;
119
+ hostname?: string | null | undefined;
120
+ family?: number | undefined;
121
+ port?: number | string | null | undefined;
122
+ defaultPort?: number | string | undefined;
123
+ localAddress?: string | undefined;
124
+ socketPath?: string | undefined;
125
+ /**
126
+ * @default 8192
127
+ */
128
+ maxHeaderSize?: number | undefined;
129
+ method?: string | undefined;
130
+ path?: string | null | undefined;
131
+ headers?: OutgoingHttpHeaders | undefined;
132
+ auth?: string | null | undefined;
133
+ agent?: Agent | boolean | undefined;
134
+ _defaultAgent?: Agent | undefined;
135
+ timeout?: number | undefined;
136
+ setHost?: boolean | undefined;
137
+ // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278
138
+ createConnection?: ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket) | undefined;
139
+ lookup?: LookupFunction | undefined;
140
+ }
141
+ interface ServerOptions {
142
+ IncomingMessage?: typeof IncomingMessage | undefined;
143
+ ServerResponse?: typeof ServerResponse | undefined;
144
+ /**
145
+ * Optionally overrides the value of
146
+ * `--max-http-header-size` for requests received by this server, i.e.
147
+ * the maximum length of request headers in bytes.
148
+ * @default 8192
149
+ */
150
+ maxHeaderSize?: number | undefined;
151
+ /**
152
+ * Use an insecure HTTP parser that accepts invalid HTTP headers when true.
153
+ * Using the insecure parser should be avoided.
154
+ * See --insecure-http-parser for more information.
155
+ * @default false
156
+ */
157
+ insecureHTTPParser?: boolean | undefined;
158
+ }
159
+ type RequestListener = (req: IncomingMessage, res: ServerResponse) => void;
160
+ /**
161
+ * @since v0.1.17
162
+ */
163
+ class Server extends NetServer {
164
+ constructor(requestListener?: RequestListener);
165
+ constructor(options: ServerOptions, requestListener?: RequestListener);
166
+ /**
167
+ * Sets the timeout value for sockets, and emits a `'timeout'` event on
168
+ * the Server object, passing the socket as an argument, if a timeout
169
+ * occurs.
170
+ *
171
+ * If there is a `'timeout'` event listener on the Server object, then it
172
+ * will be called with the timed-out socket as an argument.
173
+ *
174
+ * By default, the Server does not timeout sockets. However, if a callback
175
+ * is assigned to the Server's `'timeout'` event, timeouts must be handled
176
+ * explicitly.
177
+ * @since v0.9.12
178
+ * @param [msecs=0 (no timeout)]
179
+ */
180
+ setTimeout(msecs?: number, callback?: () => void): this;
181
+ setTimeout(callback: () => void): this;
182
+ /**
183
+ * Limits maximum incoming headers count. If set to 0, no limit will be applied.
184
+ * @since v0.7.0
185
+ */
186
+ maxHeadersCount: number | null;
187
+ /**
188
+ * The maximum number of requests socket can handle
189
+ * before closing keep alive connection.
190
+ *
191
+ * A value of `0` will disable the limit.
192
+ *
193
+ * When the limit is reached it will set the `Connection` header value to `close`,
194
+ * but will not actually close the connection, subsequent requests sent
195
+ * after the limit is reached will get `503 Service Unavailable` as a response.
196
+ * @since v16.10.0
197
+ */
198
+ maxRequestsPerSocket: number | null;
199
+ /**
200
+ * The number of milliseconds of inactivity before a socket is presumed
201
+ * to have timed out.
202
+ *
203
+ * A value of `0` will disable the timeout behavior on incoming connections.
204
+ *
205
+ * The socket timeout logic is set up on connection, so changing this
206
+ * value only affects new connections to the server, not any existing connections.
207
+ * @since v0.9.12
208
+ */
209
+ timeout: number;
210
+ /**
211
+ * Limit the amount of time the parser will wait to receive the complete HTTP
212
+ * headers.
213
+ *
214
+ * In case of inactivity, the rules defined in `server.timeout` apply. However,
215
+ * that inactivity based timeout would still allow the connection to be kept open
216
+ * if the headers are being sent very slowly (by default, up to a byte per 2
217
+ * minutes). In order to prevent this, whenever header data arrives an additional
218
+ * check is made that more than `server.headersTimeout` milliseconds has not
219
+ * passed since the connection was established. If the check fails, a `'timeout'`event is emitted on the server object, and (by default) the socket is destroyed.
220
+ * See `server.timeout` for more information on how timeout behavior can be
221
+ * customized.
222
+ * @since v11.3.0, v10.14.0
223
+ */
224
+ headersTimeout: number;
225
+ /**
226
+ * The number of milliseconds of inactivity a server needs to wait for additional
227
+ * incoming data, after it has finished writing the last response, before a socket
228
+ * will be destroyed. If the server receives new data before the keep-alive
229
+ * timeout has fired, it will reset the regular inactivity timeout, i.e.,`server.timeout`.
230
+ *
231
+ * A value of `0` will disable the keep-alive timeout behavior on incoming
232
+ * connections.
233
+ * A value of `0` makes the http server behave similarly to Node.js versions prior
234
+ * to 8.0.0, which did not have a keep-alive timeout.
235
+ *
236
+ * The socket timeout logic is set up on connection, so changing this value only
237
+ * affects new connections to the server, not any existing connections.
238
+ * @since v8.0.0
239
+ */
240
+ keepAliveTimeout: number;
241
+ /**
242
+ * Sets the timeout value in milliseconds for receiving the entire request from
243
+ * the client.
244
+ *
245
+ * If the timeout expires, the server responds with status 408 without
246
+ * forwarding the request to the request listener and then closes the connection.
247
+ *
248
+ * It must be set to a non-zero value (e.g. 120 seconds) to protect against
249
+ * potential Denial-of-Service attacks in case the server is deployed without a
250
+ * reverse proxy in front.
251
+ * @since v14.11.0
252
+ */
253
+ requestTimeout: number;
254
+ addListener(event: string, listener: (...args: any[]) => void): this;
255
+ addListener(event: 'close', listener: () => void): this;
256
+ addListener(event: 'connection', listener: (socket: Socket) => void): this;
257
+ addListener(event: 'error', listener: (err: Error) => void): this;
258
+ addListener(event: 'listening', listener: () => void): this;
259
+ addListener(event: 'checkContinue', listener: RequestListener): this;
260
+ addListener(event: 'checkExpectation', listener: RequestListener): this;
261
+ addListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
262
+ addListener(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
263
+ addListener(event: 'request', listener: RequestListener): this;
264
+ addListener(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
265
+ emit(event: string, ...args: any[]): boolean;
266
+ emit(event: 'close'): boolean;
267
+ emit(event: 'connection', socket: Socket): boolean;
268
+ emit(event: 'error', err: Error): boolean;
269
+ emit(event: 'listening'): boolean;
270
+ emit(event: 'checkContinue', req: IncomingMessage, res: ServerResponse): boolean;
271
+ emit(event: 'checkExpectation', req: IncomingMessage, res: ServerResponse): boolean;
272
+ emit(event: 'clientError', err: Error, socket: stream.Duplex): boolean;
273
+ emit(event: 'connect', req: IncomingMessage, socket: stream.Duplex, head: Buffer): boolean;
274
+ emit(event: 'request', req: IncomingMessage, res: ServerResponse): boolean;
275
+ emit(event: 'upgrade', req: IncomingMessage, socket: stream.Duplex, head: Buffer): boolean;
276
+ on(event: string, listener: (...args: any[]) => void): this;
277
+ on(event: 'close', listener: () => void): this;
278
+ on(event: 'connection', listener: (socket: Socket) => void): this;
279
+ on(event: 'error', listener: (err: Error) => void): this;
280
+ on(event: 'listening', listener: () => void): this;
281
+ on(event: 'checkContinue', listener: RequestListener): this;
282
+ on(event: 'checkExpectation', listener: RequestListener): this;
283
+ on(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
284
+ on(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
285
+ on(event: 'request', listener: RequestListener): this;
286
+ on(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
287
+ once(event: string, listener: (...args: any[]) => void): this;
288
+ once(event: 'close', listener: () => void): this;
289
+ once(event: 'connection', listener: (socket: Socket) => void): this;
290
+ once(event: 'error', listener: (err: Error) => void): this;
291
+ once(event: 'listening', listener: () => void): this;
292
+ once(event: 'checkContinue', listener: RequestListener): this;
293
+ once(event: 'checkExpectation', listener: RequestListener): this;
294
+ once(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
295
+ once(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
296
+ once(event: 'request', listener: RequestListener): this;
297
+ once(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
298
+ prependListener(event: string, listener: (...args: any[]) => void): this;
299
+ prependListener(event: 'close', listener: () => void): this;
300
+ prependListener(event: 'connection', listener: (socket: Socket) => void): this;
301
+ prependListener(event: 'error', listener: (err: Error) => void): this;
302
+ prependListener(event: 'listening', listener: () => void): this;
303
+ prependListener(event: 'checkContinue', listener: RequestListener): this;
304
+ prependListener(event: 'checkExpectation', listener: RequestListener): this;
305
+ prependListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
306
+ prependListener(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
307
+ prependListener(event: 'request', listener: RequestListener): this;
308
+ prependListener(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
309
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
310
+ prependOnceListener(event: 'close', listener: () => void): this;
311
+ prependOnceListener(event: 'connection', listener: (socket: Socket) => void): this;
312
+ prependOnceListener(event: 'error', listener: (err: Error) => void): this;
313
+ prependOnceListener(event: 'listening', listener: () => void): this;
314
+ prependOnceListener(event: 'checkContinue', listener: RequestListener): this;
315
+ prependOnceListener(event: 'checkExpectation', listener: RequestListener): this;
316
+ prependOnceListener(event: 'clientError', listener: (err: Error, socket: stream.Duplex) => void): this;
317
+ prependOnceListener(event: 'connect', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
318
+ prependOnceListener(event: 'request', listener: RequestListener): this;
319
+ prependOnceListener(event: 'upgrade', listener: (req: IncomingMessage, socket: stream.Duplex, head: Buffer) => void): this;
320
+ }
321
+ /**
322
+ * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract of outgoing message from
323
+ * the perspective of the participants of HTTP transaction.
324
+ * @since v0.1.17
325
+ */
326
+ class OutgoingMessage extends stream.Writable {
327
+ readonly req: IncomingMessage;
328
+ chunkedEncoding: boolean;
329
+ shouldKeepAlive: boolean;
330
+ useChunkedEncodingByDefault: boolean;
331
+ sendDate: boolean;
332
+ /**
333
+ * @deprecated Use `writableEnded` instead.
334
+ */
335
+ finished: boolean;
336
+ /**
337
+ * Read-only. `true` if the headers were sent, otherwise `false`.
338
+ * @since v0.9.3
339
+ */
340
+ readonly headersSent: boolean;
341
+ /**
342
+ * Aliases of `outgoingMessage.socket`
343
+ * @since v0.3.0
344
+ * @deprecated Since v15.12.0 - Use `socket` instead.
345
+ */
346
+ readonly connection: Socket | null;
347
+ /**
348
+ * Reference to the underlying socket. Usually, users will not want to access
349
+ * this property.
350
+ *
351
+ * After calling `outgoingMessage.end()`, this property will be nulled.
352
+ * @since v0.3.0
353
+ */
354
+ readonly socket: Socket | null;
355
+ constructor();
356
+ /**
357
+ * Once a socket is associated with the message and is connected,`socket.setTimeout()` will be called with `msecs` as the first parameter.
358
+ * @since v0.9.12
359
+ * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event.
360
+ */
361
+ setTimeout(msecs: number, callback?: () => void): this;
362
+ /**
363
+ * Sets a single header value for the header object.
364
+ * @since v0.4.0
365
+ * @param name Header name
366
+ * @param value Header value
367
+ */
368
+ setHeader(name: string, value: number | string | ReadonlyArray<string>): this;
369
+ /**
370
+ * Gets the value of HTTP header with the given name. If such a name doesn't
371
+ * exist in message, it will be `undefined`.
372
+ * @since v0.4.0
373
+ * @param name Name of header
374
+ */
375
+ getHeader(name: string): number | string | string[] | undefined;
376
+ /**
377
+ * Returns a shallow copy of the current outgoing headers. Since a shallow
378
+ * copy is used, array values may be mutated without additional calls to
379
+ * various header-related HTTP module methods. The keys of the returned
380
+ * object are the header names and the values are the respective header
381
+ * values. All header names are lowercase.
382
+ *
383
+ * The object returned by the `outgoingMessage.getHeaders()` method does
384
+ * not prototypically inherit from the JavaScript Object. This means that
385
+ * typical Object methods such as `obj.toString()`, `obj.hasOwnProperty()`,
386
+ * and others are not defined and will not work.
387
+ *
388
+ * ```js
389
+ * outgoingMessage.setHeader('Foo', 'bar');
390
+ * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);
391
+ *
392
+ * const headers = outgoingMessage.getHeaders();
393
+ * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] }
394
+ * ```
395
+ * @since v8.0.0
396
+ */
397
+ getHeaders(): OutgoingHttpHeaders;
398
+ /**
399
+ * Returns an array of names of headers of the outgoing outgoingMessage. All
400
+ * names are lowercase.
401
+ * @since v8.0.0
402
+ */
403
+ getHeaderNames(): string[];
404
+ /**
405
+ * Returns `true` if the header identified by `name` is currently set in the
406
+ * outgoing headers. The header name is case-insensitive.
407
+ *
408
+ * ```js
409
+ * const hasContentType = outgoingMessage.hasHeader('content-type');
410
+ * ```
411
+ * @since v8.0.0
412
+ */
413
+ hasHeader(name: string): boolean;
414
+ /**
415
+ * Removes a header that is queued for implicit sending.
416
+ *
417
+ * ```js
418
+ * outgoingMessage.removeHeader('Content-Encoding');
419
+ * ```
420
+ * @since v0.4.0
421
+ */
422
+ removeHeader(name: string): void;
423
+ /**
424
+ * Adds HTTP trailers (headers but at the end of the message) to the message.
425
+ *
426
+ * Trailers are **only** be emitted if the message is chunked encoded. If not,
427
+ * the trailer will be silently discarded.
428
+ *
429
+ * HTTP requires the `Trailer` header to be sent to emit trailers,
430
+ * with a list of header fields in its value, e.g.
431
+ *
432
+ * ```js
433
+ * message.writeHead(200, { 'Content-Type': 'text/plain',
434
+ * 'Trailer': 'Content-MD5' });
435
+ * message.write(fileData);
436
+ * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' });
437
+ * message.end();
438
+ * ```
439
+ *
440
+ * Attempting to set a header field name or value that contains invalid characters
441
+ * will result in a `TypeError` being thrown.
442
+ * @since v0.3.0
443
+ */
444
+ addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
445
+ /**
446
+ * Compulsorily flushes the message headers
447
+ *
448
+ * For efficiency reason, Node.js normally buffers the message headers
449
+ * until `outgoingMessage.end()` is called or the first chunk of message data
450
+ * is written. It then tries to pack the headers and data into a single TCP
451
+ * packet.
452
+ *
453
+ * 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 request.
455
+ * @since v1.6.0
456
+ */
457
+ flushHeaders(): void;
458
+ }
459
+ /**
460
+ * This object is created internally by an HTTP server, not by the user. It is
461
+ * passed as the second parameter to the `'request'` event.
462
+ * @since v0.1.17
463
+ */
464
+ class ServerResponse extends OutgoingMessage {
465
+ /**
466
+ * When using implicit headers (not calling `response.writeHead()` explicitly),
467
+ * this property controls the status code that will be sent to the client when
468
+ * the headers get flushed.
469
+ *
470
+ * ```js
471
+ * response.statusCode = 404;
472
+ * ```
473
+ *
474
+ * After response header was sent to the client, this property indicates the
475
+ * status code which was sent out.
476
+ * @since v0.4.0
477
+ */
478
+ statusCode: number;
479
+ /**
480
+ * When using implicit headers (not calling `response.writeHead()` explicitly),
481
+ * this property controls the status message that will be sent to the client when
482
+ * the headers get flushed. If this is left as `undefined` then the standard
483
+ * message for the status code will be used.
484
+ *
485
+ * ```js
486
+ * response.statusMessage = 'Not found';
487
+ * ```
488
+ *
489
+ * After response header was sent to the client, this property indicates the
490
+ * status message which was sent out.
491
+ * @since v0.11.8
492
+ */
493
+ statusMessage: string;
494
+ constructor(req: IncomingMessage);
495
+ assignSocket(socket: Socket): void;
496
+ detachSocket(socket: Socket): void;
497
+ /**
498
+ * Sends a HTTP/1.1 100 Continue message to the client, indicating that
499
+ * the request body should be sent. See the `'checkContinue'` event on`Server`.
500
+ * @since v0.3.0
501
+ */
502
+ writeContinue(callback?: () => void): void;
503
+ /**
504
+ * Sends a response header to the request. The status code is a 3-digit HTTP
505
+ * status code, like `404`. The last argument, `headers`, are the response headers.
506
+ * Optionally one can give a human-readable `statusMessage` as the second
507
+ * argument.
508
+ *
509
+ * `headers` may be an `Array` where the keys and values are in the same list.
510
+ * It is _not_ a list of tuples. So, the even-numbered offsets are key values,
511
+ * and the odd-numbered offsets are the associated values. The array is in the same
512
+ * format as `request.rawHeaders`.
513
+ *
514
+ * Returns a reference to the `ServerResponse`, so that calls can be chained.
515
+ *
516
+ * ```js
517
+ * const body = 'hello world';
518
+ * response
519
+ * .writeHead(200, {
520
+ * 'Content-Length': Buffer.byteLength(body),
521
+ * 'Content-Type': 'text/plain'
522
+ * })
523
+ * .end(body);
524
+ * ```
525
+ *
526
+ * This method must only be called once on a message and it must
527
+ * be called before `response.end()` is called.
528
+ *
529
+ * If `response.write()` or `response.end()` are called before calling
530
+ * this, the implicit/mutable headers will be calculated and call this function.
531
+ *
532
+ * When headers have been set with `response.setHeader()`, they will be merged
533
+ * with any headers passed to `response.writeHead()`, with the headers passed
534
+ * to `response.writeHead()` given precedence.
535
+ *
536
+ * If this method is called and `response.setHeader()` has not been called,
537
+ * it will directly write the supplied header values onto the network channel
538
+ * without caching internally, and the `response.getHeader()` on the header
539
+ * will not yield the expected result. If progressive population of headers is
540
+ * desired with potential future retrieval and modification, use `response.setHeader()` instead.
541
+ *
542
+ * ```js
543
+ * // Returns content-type = text/plain
544
+ * const server = http.createServer((req, res) => {
545
+ * res.setHeader('Content-Type', 'text/html');
546
+ * res.setHeader('X-Foo', 'bar');
547
+ * res.writeHead(200, { 'Content-Type': 'text/plain' });
548
+ * res.end('ok');
549
+ * });
550
+ * ```
551
+ *
552
+ * `Content-Length` is given in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js
553
+ * does not check whether `Content-Length` and the length of the body which has
554
+ * been transmitted are equal or not.
555
+ *
556
+ * Attempting to set a header field name or value that contains invalid characters
557
+ * will result in a `TypeError` being thrown.
558
+ * @since v0.1.30
559
+ */
560
+ writeHead(statusCode: number, statusMessage?: string, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
561
+ writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
562
+ /**
563
+ * Sends a HTTP/1.1 102 Processing message to the client, indicating that
564
+ * the request body should be sent.
565
+ * @since v10.0.0
566
+ */
567
+ writeProcessing(): void;
568
+ }
569
+ interface InformationEvent {
570
+ statusCode: number;
571
+ statusMessage: string;
572
+ httpVersion: string;
573
+ httpVersionMajor: number;
574
+ httpVersionMinor: number;
575
+ headers: IncomingHttpHeaders;
576
+ rawHeaders: string[];
577
+ }
578
+ /**
579
+ * This object is created internally and returned from {@link request}. It
580
+ * represents an _in-progress_ request whose header has already been queued. The
581
+ * header is still mutable using the `setHeader(name, value)`,`getHeader(name)`, `removeHeader(name)` API. The actual header will
582
+ * be sent along with the first data chunk or when calling `request.end()`.
583
+ *
584
+ * To get the response, add a listener for `'response'` to the request object.`'response'` will be emitted from the request object when the response
585
+ * headers have been received. The `'response'` event is executed with one
586
+ * argument which is an instance of {@link IncomingMessage}.
587
+ *
588
+ * During the `'response'` event, one can add listeners to the
589
+ * response object; particularly to listen for the `'data'` event.
590
+ *
591
+ * If no `'response'` handler is added, then the response will be
592
+ * entirely discarded. However, if a `'response'` event handler is added,
593
+ * then the data from the response object **must** be consumed, either by
594
+ * calling `response.read()` whenever there is a `'readable'` event, or
595
+ * by adding a `'data'` handler, or by calling the `.resume()` method.
596
+ * Until the data is consumed, the `'end'` event will not fire. Also, until
597
+ * the data is read it will consume memory that can eventually lead to a
598
+ * 'process out of memory' error.
599
+ *
600
+ * For backward compatibility, `res` will only emit `'error'` if there is an`'error'` listener registered.
601
+ *
602
+ * Node.js does not check whether Content-Length and the length of the
603
+ * body which has been transmitted are equal or not.
604
+ * @since v0.1.17
605
+ */
606
+ class ClientRequest extends OutgoingMessage {
607
+ /**
608
+ * The `request.aborted` property will be `true` if the request has
609
+ * been aborted.
610
+ * @since v0.11.14
611
+ */
612
+ aborted: boolean;
613
+ /**
614
+ * The request host.
615
+ * @since v14.5.0, v12.19.0
616
+ */
617
+ host: string;
618
+ /**
619
+ * The request protocol.
620
+ * @since v14.5.0, v12.19.0
621
+ */
622
+ protocol: string;
623
+ constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
624
+ /**
625
+ * The request method.
626
+ * @since v0.1.97
627
+ */
628
+ method: string;
629
+ /**
630
+ * The request path.
631
+ * @since v0.4.0
632
+ */
633
+ path: string;
634
+ /**
635
+ * Marks the request as aborting. Calling this will cause remaining data
636
+ * in the response to be dropped and the socket to be destroyed.
637
+ * @since v0.3.8
638
+ * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead.
639
+ */
640
+ abort(): void;
641
+ onSocket(socket: Socket): void;
642
+ /**
643
+ * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called.
644
+ * @since v0.5.9
645
+ * @param timeout Milliseconds before a request times out.
646
+ * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event.
647
+ */
648
+ setTimeout(timeout: number, callback?: () => void): this;
649
+ /**
650
+ * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called.
651
+ * @since v0.5.9
652
+ */
653
+ setNoDelay(noDelay?: boolean): void;
654
+ /**
655
+ * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called.
656
+ * @since v0.5.9
657
+ */
658
+ setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
659
+ /**
660
+ * Returns an array containing the unique names of the current outgoing raw
661
+ * headers. Header names are returned with their exact casing being set.
662
+ *
663
+ * ```js
664
+ * request.setHeader('Foo', 'bar');
665
+ * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);
666
+ *
667
+ * const headerNames = request.getRawHeaderNames();
668
+ * // headerNames === ['Foo', 'Set-Cookie']
669
+ * ```
670
+ * @since v15.13.0
671
+ */
672
+ getRawHeaderNames(): string[];
673
+ addListener(event: 'abort', listener: () => void): this;
674
+ addListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
675
+ addListener(event: 'continue', listener: () => void): this;
676
+ addListener(event: 'information', listener: (info: InformationEvent) => void): this;
677
+ addListener(event: 'response', listener: (response: IncomingMessage) => void): this;
678
+ addListener(event: 'socket', listener: (socket: Socket) => void): this;
679
+ addListener(event: 'timeout', listener: () => void): this;
680
+ addListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
681
+ addListener(event: 'close', listener: () => void): this;
682
+ addListener(event: 'drain', listener: () => void): this;
683
+ addListener(event: 'error', listener: (err: Error) => void): this;
684
+ addListener(event: 'finish', listener: () => void): this;
685
+ addListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
686
+ addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
687
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
688
+ on(event: 'abort', listener: () => void): this;
689
+ on(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
690
+ on(event: 'continue', listener: () => void): this;
691
+ on(event: 'information', listener: (info: InformationEvent) => void): this;
692
+ on(event: 'response', listener: (response: IncomingMessage) => void): this;
693
+ on(event: 'socket', listener: (socket: Socket) => void): this;
694
+ on(event: 'timeout', listener: () => void): this;
695
+ on(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
696
+ on(event: 'close', listener: () => void): this;
697
+ on(event: 'drain', listener: () => void): this;
698
+ on(event: 'error', listener: (err: Error) => void): this;
699
+ on(event: 'finish', listener: () => void): this;
700
+ on(event: 'pipe', listener: (src: stream.Readable) => void): this;
701
+ on(event: 'unpipe', listener: (src: stream.Readable) => void): this;
702
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
703
+ once(event: 'abort', listener: () => void): this;
704
+ once(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
705
+ once(event: 'continue', listener: () => void): this;
706
+ once(event: 'information', listener: (info: InformationEvent) => void): this;
707
+ once(event: 'response', listener: (response: IncomingMessage) => void): this;
708
+ once(event: 'socket', listener: (socket: Socket) => void): this;
709
+ once(event: 'timeout', listener: () => void): this;
710
+ once(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
711
+ once(event: 'close', listener: () => void): this;
712
+ once(event: 'drain', listener: () => void): this;
713
+ once(event: 'error', listener: (err: Error) => void): this;
714
+ once(event: 'finish', listener: () => void): this;
715
+ once(event: 'pipe', listener: (src: stream.Readable) => void): this;
716
+ once(event: 'unpipe', listener: (src: stream.Readable) => void): this;
717
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
718
+ prependListener(event: 'abort', listener: () => void): this;
719
+ prependListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
720
+ prependListener(event: 'continue', listener: () => void): this;
721
+ prependListener(event: 'information', listener: (info: InformationEvent) => void): this;
722
+ prependListener(event: 'response', listener: (response: IncomingMessage) => void): this;
723
+ prependListener(event: 'socket', listener: (socket: Socket) => void): this;
724
+ prependListener(event: 'timeout', listener: () => void): this;
725
+ prependListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
726
+ prependListener(event: 'close', listener: () => void): this;
727
+ prependListener(event: 'drain', listener: () => void): this;
728
+ prependListener(event: 'error', listener: (err: Error) => void): this;
729
+ prependListener(event: 'finish', listener: () => void): this;
730
+ prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
731
+ prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
732
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
733
+ prependOnceListener(event: 'abort', listener: () => void): this;
734
+ prependOnceListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
735
+ prependOnceListener(event: 'continue', listener: () => void): this;
736
+ prependOnceListener(event: 'information', listener: (info: InformationEvent) => void): this;
737
+ prependOnceListener(event: 'response', listener: (response: IncomingMessage) => void): this;
738
+ prependOnceListener(event: 'socket', listener: (socket: Socket) => void): this;
739
+ prependOnceListener(event: 'timeout', listener: () => void): this;
740
+ prependOnceListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
741
+ prependOnceListener(event: 'close', listener: () => void): this;
742
+ prependOnceListener(event: 'drain', listener: () => void): this;
743
+ prependOnceListener(event: 'error', listener: (err: Error) => void): this;
744
+ prependOnceListener(event: 'finish', listener: () => void): this;
745
+ prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
746
+ prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
747
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
748
+ }
749
+ /**
750
+ * 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
751
+ * access response
752
+ * status, headers and data.
753
+ *
754
+ * Different from its `socket` value which is a subclass of `stream.Duplex`, the`IncomingMessage` itself extends `stream.Readable` and is created separately to
755
+ * parse and emit the incoming HTTP headers and payload, as the underlying socket
756
+ * may be reused multiple times in case of keep-alive.
757
+ * @since v0.1.17
758
+ */
759
+ class IncomingMessage extends stream.Readable {
760
+ constructor(socket: Socket);
761
+ /**
762
+ * The `message.aborted` property will be `true` if the request has
763
+ * been aborted.
764
+ * @since v10.1.0
765
+ */
766
+ aborted: boolean;
767
+ /**
768
+ * In case of server request, the HTTP version sent by the client. In the case of
769
+ * client response, the HTTP version of the connected-to server.
770
+ * Probably either `'1.1'` or `'1.0'`.
771
+ *
772
+ * Also `message.httpVersionMajor` is the first integer and`message.httpVersionMinor` is the second.
773
+ * @since v0.1.1
774
+ */
775
+ httpVersion: string;
776
+ httpVersionMajor: number;
777
+ httpVersionMinor: number;
778
+ /**
779
+ * The `message.complete` property will be `true` if a complete HTTP message has
780
+ * been received and successfully parsed.
781
+ *
782
+ * This property is particularly useful as a means of determining if a client or
783
+ * server fully transmitted a message before a connection was terminated:
784
+ *
785
+ * ```js
786
+ * const req = http.request({
787
+ * host: '127.0.0.1',
788
+ * port: 8080,
789
+ * method: 'POST'
790
+ * }, (res) => {
791
+ * res.resume();
792
+ * res.on('end', () => {
793
+ * if (!res.complete)
794
+ * console.error(
795
+ * 'The connection was terminated while the message was still being sent');
796
+ * });
797
+ * });
798
+ * ```
799
+ * @since v0.3.0
800
+ */
801
+ complete: boolean;
802
+ /**
803
+ * Alias for `message.socket`.
804
+ * @since v0.1.90
805
+ * @deprecated Since v16.0.0 - Use `socket`.
806
+ */
807
+ connection: Socket;
808
+ /**
809
+ * The `net.Socket` object associated with the connection.
810
+ *
811
+ * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the
812
+ * client's authentication details.
813
+ *
814
+ * This property is guaranteed to be an instance of the `net.Socket` class,
815
+ * a subclass of `stream.Duplex`, unless the user specified a socket
816
+ * type other than `net.Socket`.
817
+ * @since v0.3.0
818
+ */
819
+ socket: Socket;
820
+ /**
821
+ * The request/response headers object.
822
+ *
823
+ * Key-value pairs of header names and values. Header names are lower-cased.
824
+ *
825
+ * ```js
826
+ * // Prints something like:
827
+ * //
828
+ * // { 'user-agent': 'curl/7.22.0',
829
+ * // host: '127.0.0.1:8000',
830
+ * // accept: '*' }
831
+ * console.log(request.headers);
832
+ * ```
833
+ *
834
+ * Duplicates in raw headers are handled in the following ways, depending on the
835
+ * header name:
836
+ *
837
+ * * Duplicates of `age`, `authorization`, `content-length`, `content-type`,`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,`last-modified`, `location`,
838
+ * `max-forwards`, `proxy-authorization`, `referer`,`retry-after`, `server`, or `user-agent` are discarded.
839
+ * * `set-cookie` is always an array. Duplicates are added to the array.
840
+ * * For duplicate `cookie` headers, the values are joined together with '; '.
841
+ * * For all other headers, the values are joined together with ', '.
842
+ * @since v0.1.5
843
+ */
844
+ headers: IncomingHttpHeaders;
845
+ /**
846
+ * The raw request/response headers list exactly as they were received.
847
+ *
848
+ * The keys and values are in the same list. It is _not_ a
849
+ * list of tuples. So, the even-numbered offsets are key values, and the
850
+ * odd-numbered offsets are the associated values.
851
+ *
852
+ * Header names are not lowercased, and duplicates are not merged.
853
+ *
854
+ * ```js
855
+ * // Prints something like:
856
+ * //
857
+ * // [ 'user-agent',
858
+ * // 'this is invalid because there can be only one',
859
+ * // 'User-Agent',
860
+ * // 'curl/7.22.0',
861
+ * // 'Host',
862
+ * // '127.0.0.1:8000',
863
+ * // 'ACCEPT',
864
+ * // '*' ]
865
+ * console.log(request.rawHeaders);
866
+ * ```
867
+ * @since v0.11.6
868
+ */
869
+ rawHeaders: string[];
870
+ /**
871
+ * The request/response trailers object. Only populated at the `'end'` event.
872
+ * @since v0.3.0
873
+ */
874
+ trailers: NodeJS.Dict<string>;
875
+ /**
876
+ * The raw request/response trailer keys and values exactly as they were
877
+ * received. Only populated at the `'end'` event.
878
+ * @since v0.11.6
879
+ */
880
+ rawTrailers: string[];
881
+ /**
882
+ * Calls `message.socket.setTimeout(msecs, callback)`.
883
+ * @since v0.5.9
884
+ */
885
+ setTimeout(msecs: number, callback?: () => void): this;
886
+ /**
887
+ * **Only valid for request obtained from {@link Server}.**
888
+ *
889
+ * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`.
890
+ * @since v0.1.1
891
+ */
892
+ method?: string | undefined;
893
+ /**
894
+ * **Only valid for request obtained from {@link Server}.**
895
+ *
896
+ * Request URL string. This contains only the URL that is present in the actual
897
+ * HTTP request. Take the following request:
898
+ *
899
+ * ```http
900
+ * GET /status?name=ryan HTTP/1.1
901
+ * Accept: text/plain
902
+ * ```
903
+ *
904
+ * To parse the URL into its parts:
905
+ *
906
+ * ```js
907
+ * new URL(request.url, `http://${request.headers.host}`);
908
+ * ```
909
+ *
910
+ * When `request.url` is `'/status?name=ryan'` and`request.headers.host` is `'localhost:3000'`:
911
+ *
912
+ * ```console
913
+ * $ node
914
+ * > new URL(request.url, `http://${request.headers.host}`)
915
+ * URL {
916
+ * href: 'http://localhost:3000/status?name=ryan',
917
+ * origin: 'http://localhost:3000',
918
+ * protocol: 'http:',
919
+ * username: '',
920
+ * password: '',
921
+ * host: 'localhost:3000',
922
+ * hostname: 'localhost',
923
+ * port: '3000',
924
+ * pathname: '/status',
925
+ * search: '?name=ryan',
926
+ * searchParams: URLSearchParams { 'name' => 'ryan' },
927
+ * hash: ''
928
+ * }
929
+ * ```
930
+ * @since v0.1.90
931
+ */
932
+ url?: string | undefined;
933
+ /**
934
+ * **Only valid for response obtained from {@link ClientRequest}.**
935
+ *
936
+ * The 3-digit HTTP response status code. E.G. `404`.
937
+ * @since v0.1.1
938
+ */
939
+ statusCode?: number | undefined;
940
+ /**
941
+ * **Only valid for response obtained from {@link ClientRequest}.**
942
+ *
943
+ * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`.
944
+ * @since v0.11.10
945
+ */
946
+ statusMessage?: string | undefined;
947
+ /**
948
+ * Calls `destroy()` on the socket that received the `IncomingMessage`. If `error`is provided, an `'error'` event is emitted on the socket and `error` is passed
949
+ * as an argument to any listeners on the event.
950
+ * @since v0.3.0
951
+ */
952
+ destroy(error?: Error): void;
953
+ }
954
+ interface AgentOptions extends Partial<TcpSocketConnectOpts> {
955
+ /**
956
+ * Keep sockets around in a pool to be used by other requests in the future. Default = false
957
+ */
958
+ keepAlive?: boolean | undefined;
959
+ /**
960
+ * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
961
+ * Only relevant if keepAlive is set to true.
962
+ */
963
+ keepAliveMsecs?: number | undefined;
964
+ /**
965
+ * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
966
+ */
967
+ maxSockets?: number | undefined;
968
+ /**
969
+ * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity.
970
+ */
971
+ maxTotalSockets?: number | undefined;
972
+ /**
973
+ * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
974
+ */
975
+ maxFreeSockets?: number | undefined;
976
+ /**
977
+ * Socket timeout in milliseconds. This will set the timeout after the socket is connected.
978
+ */
979
+ timeout?: number | undefined;
980
+ /**
981
+ * Scheduling strategy to apply when picking the next free socket to use.
982
+ * @default `lifo`
983
+ */
984
+ scheduling?: 'fifo' | 'lifo' | undefined;
985
+ }
986
+ /**
987
+ * An `Agent` is responsible for managing connection persistence
988
+ * and reuse for HTTP clients. It maintains a queue of pending requests
989
+ * for a given host and port, reusing a single socket connection for each
990
+ * until the queue is empty, at which time the socket is either destroyed
991
+ * or put into a pool where it is kept to be used again for requests to the
992
+ * same host and port. Whether it is destroyed or pooled depends on the`keepAlive` `option`.
993
+ *
994
+ * Pooled connections have TCP Keep-Alive enabled for them, but servers may
995
+ * still close idle connections, in which case they will be removed from the
996
+ * pool and a new connection will be made when a new HTTP request is made for
997
+ * that host and port. Servers may also refuse to allow multiple requests
998
+ * over the same connection, in which case the connection will have to be
999
+ * remade for every request and cannot be pooled. The `Agent` will still make
1000
+ * the requests to that server, but each one will occur over a new connection.
1001
+ *
1002
+ * When a connection is closed by the client or the server, it is removed
1003
+ * from the pool. Any unused sockets in the pool will be unrefed so as not
1004
+ * to keep the Node.js process running when there are no outstanding requests.
1005
+ * (see `socket.unref()`).
1006
+ *
1007
+ * It is good practice, to `destroy()` an `Agent` instance when it is no
1008
+ * longer in use, because unused sockets consume OS resources.
1009
+ *
1010
+ * Sockets are removed from an agent when the socket emits either
1011
+ * a `'close'` event or an `'agentRemove'` event. When intending to keep one
1012
+ * HTTP request open for a long time without keeping it in the agent, something
1013
+ * like the following may be done:
1014
+ *
1015
+ * ```js
1016
+ * http.get(options, (res) => {
1017
+ * // Do stuff
1018
+ * }).on('socket', (socket) => {
1019
+ * socket.emit('agentRemove');
1020
+ * });
1021
+ * ```
1022
+ *
1023
+ * An agent may also be used for an individual request. By providing`{agent: false}` as an option to the `http.get()` or `http.request()`functions, a one-time use `Agent` with default options
1024
+ * will be used
1025
+ * for the client connection.
1026
+ *
1027
+ * `agent:false`:
1028
+ *
1029
+ * ```js
1030
+ * http.get({
1031
+ * hostname: 'localhost',
1032
+ * port: 80,
1033
+ * path: '/',
1034
+ * agent: false // Create a new agent just for this one request
1035
+ * }, (res) => {
1036
+ * // Do stuff with response
1037
+ * });
1038
+ * ```
1039
+ * @since v0.3.4
1040
+ */
1041
+ class Agent {
1042
+ /**
1043
+ * By default set to 256\. For agents with `keepAlive` enabled, this
1044
+ * sets the maximum number of sockets that will be left open in the free
1045
+ * state.
1046
+ * @since v0.11.7
1047
+ */
1048
+ maxFreeSockets: number;
1049
+ /**
1050
+ * By default set to `Infinity`. Determines how many concurrent sockets the agent
1051
+ * can have open per origin. Origin is the returned value of `agent.getName()`.
1052
+ * @since v0.3.6
1053
+ */
1054
+ maxSockets: number;
1055
+ /**
1056
+ * By default set to `Infinity`. Determines how many concurrent sockets the agent
1057
+ * can have open. Unlike `maxSockets`, this parameter applies across all origins.
1058
+ * @since v14.5.0, v12.19.0
1059
+ */
1060
+ maxTotalSockets: number;
1061
+ /**
1062
+ * An object which contains arrays of sockets currently awaiting use by
1063
+ * the agent when `keepAlive` is enabled. Do not modify.
1064
+ *
1065
+ * Sockets in the `freeSockets` list will be automatically destroyed and
1066
+ * removed from the array on `'timeout'`.
1067
+ * @since v0.11.4
1068
+ */
1069
+ readonly freeSockets: NodeJS.ReadOnlyDict<Socket[]>;
1070
+ /**
1071
+ * An object which contains arrays of sockets currently in use by the
1072
+ * agent. Do not modify.
1073
+ * @since v0.3.6
1074
+ */
1075
+ readonly sockets: NodeJS.ReadOnlyDict<Socket[]>;
1076
+ /**
1077
+ * An object which contains queues of requests that have not yet been assigned to
1078
+ * sockets. Do not modify.
1079
+ * @since v0.5.9
1080
+ */
1081
+ readonly requests: NodeJS.ReadOnlyDict<IncomingMessage[]>;
1082
+ constructor(opts?: AgentOptions);
1083
+ /**
1084
+ * Destroy any sockets that are currently in use by the agent.
1085
+ *
1086
+ * It is usually not necessary to do this. However, if using an
1087
+ * agent with `keepAlive` enabled, then it is best to explicitly shut down
1088
+ * the agent when it is no longer needed. Otherwise,
1089
+ * sockets might stay open for quite a long time before the server
1090
+ * terminates them.
1091
+ * @since v0.11.4
1092
+ */
1093
+ destroy(): void;
1094
+ }
1095
+ const METHODS: string[];
1096
+ const STATUS_CODES: {
1097
+ [errorCode: number]: string | undefined;
1098
+ [errorCode: string]: string | undefined;
1099
+ };
1100
+ /**
1101
+ * Returns a new instance of {@link Server}.
1102
+ *
1103
+ * The `requestListener` is a function which is automatically
1104
+ * added to the `'request'` event.
1105
+ * @since v0.1.13
1106
+ */
1107
+ function createServer(requestListener?: RequestListener): Server;
1108
+ function createServer(options: ServerOptions, requestListener?: RequestListener): Server;
1109
+ // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly,
1110
+ // create interface RequestOptions would make the naming more clear to developers
1111
+ interface RequestOptions extends ClientRequestArgs {}
1112
+ /**
1113
+ * Node.js maintains several connections per server to make HTTP requests.
1114
+ * This function allows one to transparently issue requests.
1115
+ *
1116
+ * `url` can be a string or a `URL` object. If `url` is a
1117
+ * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object.
1118
+ *
1119
+ * If both `url` and `options` are specified, the objects are merged, with the`options` properties taking precedence.
1120
+ *
1121
+ * The optional `callback` parameter will be added as a one-time listener for
1122
+ * the `'response'` event.
1123
+ *
1124
+ * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to
1125
+ * upload a file with a POST request, then write to the `ClientRequest` object.
1126
+ *
1127
+ * ```js
1128
+ * const http = require('http');
1129
+ *
1130
+ * const postData = JSON.stringify({
1131
+ * 'msg': 'Hello World!'
1132
+ * });
1133
+ *
1134
+ * const options = {
1135
+ * hostname: 'www.google.com',
1136
+ * port: 80,
1137
+ * path: '/upload',
1138
+ * method: 'POST',
1139
+ * headers: {
1140
+ * 'Content-Type': 'application/json',
1141
+ * 'Content-Length': Buffer.byteLength(postData)
1142
+ * }
1143
+ * };
1144
+ *
1145
+ * const req = http.request(options, (res) => {
1146
+ * console.log(`STATUS: ${res.statusCode}`);
1147
+ * console.log(`HEADERS: ${JSON.stringify(res.headers)}`);
1148
+ * res.setEncoding('utf8');
1149
+ * res.on('data', (chunk) => {
1150
+ * console.log(`BODY: ${chunk}`);
1151
+ * });
1152
+ * res.on('end', () => {
1153
+ * console.log('No more data in response.');
1154
+ * });
1155
+ * });
1156
+ *
1157
+ * req.on('error', (e) => {
1158
+ * console.error(`problem with request: ${e.message}`);
1159
+ * });
1160
+ *
1161
+ * // Write data to request body
1162
+ * req.write(postData);
1163
+ * req.end();
1164
+ * ```
1165
+ *
1166
+ * In the example `req.end()` was called. With `http.request()` one
1167
+ * must always call `req.end()` to signify the end of the request -
1168
+ * even if there is no data being written to the request body.
1169
+ *
1170
+ * If any error is encountered during the request (be that with DNS resolution,
1171
+ * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted
1172
+ * on the returned request object. As with all `'error'` events, if no listeners
1173
+ * are registered the error will be thrown.
1174
+ *
1175
+ * There are a few special headers that should be noted.
1176
+ *
1177
+ * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to
1178
+ * the server should be persisted until the next request.
1179
+ * * Sending a 'Content-Length' header will disable the default chunked encoding.
1180
+ * * Sending an 'Expect' header will immediately send the request headers.
1181
+ * Usually, when sending 'Expect: 100-continue', both a timeout and a listener
1182
+ * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more
1183
+ * information.
1184
+ * * Sending an Authorization header will override using the `auth` option
1185
+ * to compute basic authentication.
1186
+ *
1187
+ * Example using a `URL` as `options`:
1188
+ *
1189
+ * ```js
1190
+ * const options = new URL('http://abc:xyz@example.com');
1191
+ *
1192
+ * const req = http.request(options, (res) => {
1193
+ * // ...
1194
+ * });
1195
+ * ```
1196
+ *
1197
+ * In a successful request, the following events will be emitted in the following
1198
+ * order:
1199
+ *
1200
+ * * `'socket'`
1201
+ * * `'response'`
1202
+ * * `'data'` any number of times, on the `res` object
1203
+ * (`'data'` will not be emitted at all if the response body is empty, for
1204
+ * instance, in most redirects)
1205
+ * * `'end'` on the `res` object
1206
+ * * `'close'`
1207
+ *
1208
+ * In the case of a connection error, the following events will be emitted:
1209
+ *
1210
+ * * `'socket'`
1211
+ * * `'error'`
1212
+ * * `'close'`
1213
+ *
1214
+ * In the case of a premature connection close before the response is received,
1215
+ * the following events will be emitted in the following order:
1216
+ *
1217
+ * * `'socket'`
1218
+ * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`
1219
+ * * `'close'`
1220
+ *
1221
+ * In the case of a premature connection close after the response is received,
1222
+ * the following events will be emitted in the following order:
1223
+ *
1224
+ * * `'socket'`
1225
+ * * `'response'`
1226
+ * * `'data'` any number of times, on the `res` object
1227
+ * * (connection closed here)
1228
+ * * `'aborted'` on the `res` object
1229
+ * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`.
1230
+ * * `'close'`
1231
+ * * `'close'` on the `res` object
1232
+ *
1233
+ * If `req.destroy()` is called before a socket is assigned, the following
1234
+ * events will be emitted in the following order:
1235
+ *
1236
+ * * (`req.destroy()` called here)
1237
+ * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`
1238
+ * * `'close'`
1239
+ *
1240
+ * If `req.destroy()` is called before the connection succeeds, the following
1241
+ * events will be emitted in the following order:
1242
+ *
1243
+ * * `'socket'`
1244
+ * * (`req.destroy()` called here)
1245
+ * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`
1246
+ * * `'close'`
1247
+ *
1248
+ * If `req.destroy()` is called after the response is received, the following
1249
+ * events will be emitted in the following order:
1250
+ *
1251
+ * * `'socket'`
1252
+ * * `'response'`
1253
+ * * `'data'` any number of times, on the `res` object
1254
+ * * (`req.destroy()` called here)
1255
+ * * `'aborted'` on the `res` object
1256
+ * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`.
1257
+ * * `'close'`
1258
+ * * `'close'` on the `res` object
1259
+ *
1260
+ * If `req.abort()` is called before a socket is assigned, the following
1261
+ * events will be emitted in the following order:
1262
+ *
1263
+ * * (`req.abort()` called here)
1264
+ * * `'abort'`
1265
+ * * `'close'`
1266
+ *
1267
+ * If `req.abort()` is called before the connection succeeds, the following
1268
+ * events will be emitted in the following order:
1269
+ *
1270
+ * * `'socket'`
1271
+ * * (`req.abort()` called here)
1272
+ * * `'abort'`
1273
+ * * `'error'` with an error with message `'Error: socket hang up'` and code`'ECONNRESET'`
1274
+ * * `'close'`
1275
+ *
1276
+ * If `req.abort()` is called after the response is received, the following
1277
+ * events will be emitted in the following order:
1278
+ *
1279
+ * * `'socket'`
1280
+ * * `'response'`
1281
+ * * `'data'` any number of times, on the `res` object
1282
+ * * (`req.abort()` called here)
1283
+ * * `'abort'`
1284
+ * * `'aborted'` on the `res` object
1285
+ * * `'error'` on the `res` object with an error with message`'Error: aborted'` and code `'ECONNRESET'`.
1286
+ * * `'close'`
1287
+ * * `'close'` on the `res` object
1288
+ *
1289
+ * Setting the `timeout` option or using the `setTimeout()` function will
1290
+ * not abort the request or do anything besides add a `'timeout'` event.
1291
+ *
1292
+ * Passing an `AbortSignal` and then calling `abort` on the corresponding`AbortController` will behave the same way as calling `.destroy()` on the
1293
+ * request itself.
1294
+ * @since v0.3.6
1295
+ */
1296
+ function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
1297
+ function request(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
1298
+ /**
1299
+ * Since most requests are GET requests without bodies, Node.js provides this
1300
+ * convenience method. The only difference between this method and {@link request} is that it sets the method to GET and calls `req.end()`automatically. The callback must take care to consume the
1301
+ * response
1302
+ * data for reasons stated in {@link ClientRequest} section.
1303
+ *
1304
+ * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}.
1305
+ *
1306
+ * JSON fetching example:
1307
+ *
1308
+ * ```js
1309
+ * http.get('http://localhost:8000/', (res) => {
1310
+ * const { statusCode } = res;
1311
+ * const contentType = res.headers['content-type'];
1312
+ *
1313
+ * let error;
1314
+ * // Any 2xx status code signals a successful response but
1315
+ * // here we're only checking for 200.
1316
+ * if (statusCode !== 200) {
1317
+ * error = new Error('Request Failed.\n' +
1318
+ * `Status Code: ${statusCode}`);
1319
+ * } else if (!/^application\/json/.test(contentType)) {
1320
+ * error = new Error('Invalid content-type.\n' +
1321
+ * `Expected application/json but received ${contentType}`);
1322
+ * }
1323
+ * if (error) {
1324
+ * console.error(error.message);
1325
+ * // Consume response data to free up memory
1326
+ * res.resume();
1327
+ * return;
1328
+ * }
1329
+ *
1330
+ * res.setEncoding('utf8');
1331
+ * let rawData = '';
1332
+ * res.on('data', (chunk) => { rawData += chunk; });
1333
+ * res.on('end', () => {
1334
+ * try {
1335
+ * const parsedData = JSON.parse(rawData);
1336
+ * console.log(parsedData);
1337
+ * } catch (e) {
1338
+ * console.error(e.message);
1339
+ * }
1340
+ * });
1341
+ * }).on('error', (e) => {
1342
+ * console.error(`Got error: ${e.message}`);
1343
+ * });
1344
+ *
1345
+ * // Create a local server to receive data from
1346
+ * const server = http.createServer((req, res) => {
1347
+ * res.writeHead(200, { 'Content-Type': 'application/json' });
1348
+ * res.end(JSON.stringify({
1349
+ * data: 'Hello World!'
1350
+ * }));
1351
+ * });
1352
+ *
1353
+ * server.listen(8000);
1354
+ * ```
1355
+ * @since v0.3.6
1356
+ * @param options Accepts the same `options` as {@link request}, with the `method` always set to `GET`. Properties that are inherited from the prototype are ignored.
1357
+ */
1358
+ function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
1359
+ function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
1360
+ let globalAgent: Agent;
1361
+ /**
1362
+ * Read-only property specifying the maximum allowed size of HTTP headers in bytes.
1363
+ * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option.
1364
+ */
1365
+ const maxHeaderSize: number;
1366
+ }
1367
+ declare module 'node:http' {
1368
+ export * from 'http';
1369
+ }