cloudstructs 0.1.38 → 0.1.42

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 (396) hide show
  1. package/.gitattributes +19 -19
  2. package/.jsii +75 -31
  3. package/lib/codecommit-mirror/index.js +2 -2
  4. package/lib/ecs-service-roller/index.js +2 -2
  5. package/lib/email-receiver/receiver.js +1 -1
  6. package/lib/saml-identity-provider/index.js +2 -2
  7. package/lib/slack-events/index.js +1 -1
  8. package/lib/slack-textract/index.js +1 -1
  9. package/lib/state-machine-cr-provider/index.js +1 -1
  10. package/lib/static-website/index.js +1 -1
  11. package/lib/url-shortener/index.handler.js +2 -1
  12. package/lib/url-shortener/index.js +1 -1
  13. package/node_modules/@sindresorhus/is/dist/index.d.ts +9 -4
  14. package/node_modules/@sindresorhus/is/dist/index.js +9 -0
  15. package/node_modules/@sindresorhus/is/package.json +1 -1
  16. package/node_modules/@sindresorhus/is/readme.md +26 -0
  17. package/node_modules/@slack/logger/node_modules/@types/node/README.md +3 -3
  18. package/node_modules/@slack/logger/node_modules/@types/node/assert/strict.d.ts +0 -1
  19. package/node_modules/@slack/logger/node_modules/@types/node/assert.d.ts +823 -40
  20. package/node_modules/@slack/logger/node_modules/@types/node/async_hooks.d.ts +359 -90
  21. package/node_modules/@slack/logger/node_modules/@types/node/buffer.d.ts +1895 -113
  22. package/node_modules/@slack/logger/node_modules/@types/node/child_process.d.ts +1080 -247
  23. package/node_modules/@slack/logger/node_modules/@types/node/cluster.d.ts +327 -101
  24. package/node_modules/@slack/logger/node_modules/@types/node/console.d.ts +310 -32
  25. package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +2454 -742
  26. package/node_modules/@slack/logger/node_modules/@types/node/dgram.d.ts +463 -63
  27. package/node_modules/@slack/logger/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  28. package/node_modules/@slack/logger/node_modules/@types/node/dns/promises.d.ts +303 -36
  29. package/node_modules/@slack/logger/node_modules/@types/node/dns.d.ts +425 -97
  30. package/node_modules/@slack/logger/node_modules/@types/node/domain.d.ts +154 -10
  31. package/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +559 -34
  32. package/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +812 -269
  33. package/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +2408 -874
  34. package/node_modules/@slack/logger/node_modules/@types/node/globals.d.ts +24 -14
  35. package/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +1031 -98
  36. package/node_modules/@slack/logger/node_modules/@types/node/http2.d.ts +1579 -459
  37. package/node_modules/@slack/logger/node_modules/@types/node/https.d.ts +363 -12
  38. package/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +88 -15
  39. package/node_modules/@slack/logger/node_modules/@types/node/inspector.d.ts +360 -661
  40. package/node_modules/@slack/logger/node_modules/@types/node/module.d.ts +52 -11
  41. package/node_modules/@slack/logger/node_modules/@types/node/net.d.ts +557 -142
  42. package/node_modules/@slack/logger/node_modules/@types/node/os.d.ts +236 -26
  43. package/node_modules/@slack/logger/node_modules/@types/node/package.json +23 -25
  44. package/node_modules/@slack/logger/node_modules/@types/node/path.d.ts +9 -5
  45. package/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +289 -91
  46. package/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +1173 -155
  47. package/node_modules/@slack/logger/node_modules/@types/node/punycode.d.ts +64 -26
  48. package/node_modules/@slack/logger/node_modules/@types/node/querystring.d.ts +107 -8
  49. package/node_modules/@slack/logger/node_modules/@types/node/readline.d.ts +426 -79
  50. package/node_modules/@slack/logger/node_modules/@types/node/repl.d.ts +135 -110
  51. package/node_modules/@slack/logger/node_modules/@types/node/stream/consumers.d.ts +24 -0
  52. package/node_modules/@slack/logger/node_modules/@types/node/stream/promises.d.ts +15 -44
  53. package/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +391 -0
  54. package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +998 -225
  55. package/node_modules/@slack/logger/node_modules/@types/node/string_decoder.d.ts +57 -1
  56. package/node_modules/@slack/logger/node_modules/@types/node/timers/promises.d.ts +52 -9
  57. package/node_modules/@slack/logger/node_modules/@types/node/timers.d.ts +30 -11
  58. package/node_modules/@slack/logger/node_modules/@types/node/tls.d.ts +447 -225
  59. package/node_modules/@slack/logger/node_modules/@types/node/trace_events.d.ts +107 -11
  60. package/node_modules/@slack/logger/node_modules/@types/node/tty.d.ts +157 -23
  61. package/node_modules/@slack/logger/node_modules/@types/node/url.d.ts +724 -30
  62. package/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +1399 -73
  63. package/node_modules/@slack/logger/node_modules/@types/node/v8.d.ts +254 -78
  64. package/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +384 -33
  65. package/node_modules/@slack/logger/node_modules/@types/node/wasi.d.ts +92 -24
  66. package/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +494 -131
  67. package/node_modules/@slack/logger/node_modules/@types/node/zlib.d.ts +215 -63
  68. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +3 -3
  69. package/node_modules/@slack/web-api/node_modules/@types/node/assert/strict.d.ts +0 -1
  70. package/node_modules/@slack/web-api/node_modules/@types/node/assert.d.ts +823 -40
  71. package/node_modules/@slack/web-api/node_modules/@types/node/async_hooks.d.ts +359 -90
  72. package/node_modules/@slack/web-api/node_modules/@types/node/buffer.d.ts +1895 -113
  73. package/node_modules/@slack/web-api/node_modules/@types/node/child_process.d.ts +1080 -247
  74. package/node_modules/@slack/web-api/node_modules/@types/node/cluster.d.ts +327 -101
  75. package/node_modules/@slack/web-api/node_modules/@types/node/console.d.ts +310 -32
  76. package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +2454 -742
  77. package/node_modules/@slack/web-api/node_modules/@types/node/dgram.d.ts +463 -63
  78. package/node_modules/@slack/web-api/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  79. package/node_modules/@slack/web-api/node_modules/@types/node/dns/promises.d.ts +303 -36
  80. package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +425 -97
  81. package/node_modules/@slack/web-api/node_modules/@types/node/domain.d.ts +154 -10
  82. package/node_modules/@slack/web-api/node_modules/@types/node/events.d.ts +559 -34
  83. package/node_modules/@slack/web-api/node_modules/@types/node/fs/promises.d.ts +812 -269
  84. package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +2408 -874
  85. package/node_modules/@slack/web-api/node_modules/@types/node/globals.d.ts +24 -14
  86. package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +1031 -98
  87. package/node_modules/@slack/web-api/node_modules/@types/node/http2.d.ts +1579 -459
  88. package/node_modules/@slack/web-api/node_modules/@types/node/https.d.ts +363 -12
  89. package/node_modules/@slack/web-api/node_modules/@types/node/index.d.ts +88 -15
  90. package/node_modules/@slack/web-api/node_modules/@types/node/inspector.d.ts +360 -661
  91. package/node_modules/@slack/web-api/node_modules/@types/node/module.d.ts +52 -11
  92. package/node_modules/@slack/web-api/node_modules/@types/node/net.d.ts +557 -142
  93. package/node_modules/@slack/web-api/node_modules/@types/node/os.d.ts +236 -26
  94. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +23 -25
  95. package/node_modules/@slack/web-api/node_modules/@types/node/path.d.ts +9 -5
  96. package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +289 -91
  97. package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +1173 -155
  98. package/node_modules/@slack/web-api/node_modules/@types/node/punycode.d.ts +64 -26
  99. package/node_modules/@slack/web-api/node_modules/@types/node/querystring.d.ts +107 -8
  100. package/node_modules/@slack/web-api/node_modules/@types/node/readline.d.ts +426 -79
  101. package/node_modules/@slack/web-api/node_modules/@types/node/repl.d.ts +135 -110
  102. package/node_modules/@slack/web-api/node_modules/@types/node/stream/consumers.d.ts +24 -0
  103. package/node_modules/@slack/web-api/node_modules/@types/node/stream/promises.d.ts +15 -44
  104. package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +391 -0
  105. package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +998 -225
  106. package/node_modules/@slack/web-api/node_modules/@types/node/string_decoder.d.ts +57 -1
  107. package/node_modules/@slack/web-api/node_modules/@types/node/timers/promises.d.ts +52 -9
  108. package/node_modules/@slack/web-api/node_modules/@types/node/timers.d.ts +30 -11
  109. package/node_modules/@slack/web-api/node_modules/@types/node/tls.d.ts +447 -225
  110. package/node_modules/@slack/web-api/node_modules/@types/node/trace_events.d.ts +107 -11
  111. package/node_modules/@slack/web-api/node_modules/@types/node/tty.d.ts +157 -23
  112. package/node_modules/@slack/web-api/node_modules/@types/node/url.d.ts +724 -30
  113. package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +1399 -73
  114. package/node_modules/@slack/web-api/node_modules/@types/node/v8.d.ts +254 -78
  115. package/node_modules/@slack/web-api/node_modules/@types/node/vm.d.ts +384 -33
  116. package/node_modules/@slack/web-api/node_modules/@types/node/wasi.d.ts +92 -24
  117. package/node_modules/@slack/web-api/node_modules/@types/node/worker_threads.d.ts +494 -131
  118. package/node_modules/@slack/web-api/node_modules/@types/node/zlib.d.ts +215 -63
  119. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +3 -3
  120. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert/strict.d.ts +0 -1
  121. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +823 -40
  122. package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +359 -90
  123. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +1895 -113
  124. package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +1080 -247
  125. package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +327 -101
  126. package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +310 -32
  127. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +2454 -742
  128. package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +463 -63
  129. package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  130. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +303 -36
  131. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +425 -97
  132. package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +154 -10
  133. package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +559 -34
  134. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +812 -269
  135. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +2408 -874
  136. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +24 -14
  137. package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +1031 -98
  138. package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +1579 -459
  139. package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +363 -12
  140. package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +88 -15
  141. package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +360 -661
  142. package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +52 -11
  143. package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +557 -142
  144. package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +236 -26
  145. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +23 -25
  146. package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +9 -5
  147. package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +289 -91
  148. package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +1173 -155
  149. package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +64 -26
  150. package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +107 -8
  151. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +426 -79
  152. package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +135 -110
  153. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +24 -0
  154. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +15 -44
  155. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +391 -0
  156. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +998 -225
  157. package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +57 -1
  158. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +52 -9
  159. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +30 -11
  160. package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +447 -225
  161. package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +107 -11
  162. package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +157 -23
  163. package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +724 -30
  164. package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +1399 -73
  165. package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +254 -78
  166. package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +384 -33
  167. package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +92 -24
  168. package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +494 -131
  169. package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +215 -63
  170. package/node_modules/@types/is-stream/node_modules/@types/node/README.md +3 -3
  171. package/node_modules/@types/is-stream/node_modules/@types/node/assert/strict.d.ts +0 -1
  172. package/node_modules/@types/is-stream/node_modules/@types/node/assert.d.ts +823 -40
  173. package/node_modules/@types/is-stream/node_modules/@types/node/async_hooks.d.ts +359 -90
  174. package/node_modules/@types/is-stream/node_modules/@types/node/buffer.d.ts +1895 -113
  175. package/node_modules/@types/is-stream/node_modules/@types/node/child_process.d.ts +1080 -247
  176. package/node_modules/@types/is-stream/node_modules/@types/node/cluster.d.ts +327 -101
  177. package/node_modules/@types/is-stream/node_modules/@types/node/console.d.ts +310 -32
  178. package/node_modules/@types/is-stream/node_modules/@types/node/crypto.d.ts +2454 -742
  179. package/node_modules/@types/is-stream/node_modules/@types/node/dgram.d.ts +463 -63
  180. package/node_modules/@types/is-stream/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  181. package/node_modules/@types/is-stream/node_modules/@types/node/dns/promises.d.ts +303 -36
  182. package/node_modules/@types/is-stream/node_modules/@types/node/dns.d.ts +425 -97
  183. package/node_modules/@types/is-stream/node_modules/@types/node/domain.d.ts +154 -10
  184. package/node_modules/@types/is-stream/node_modules/@types/node/events.d.ts +559 -34
  185. package/node_modules/@types/is-stream/node_modules/@types/node/fs/promises.d.ts +812 -269
  186. package/node_modules/@types/is-stream/node_modules/@types/node/fs.d.ts +2408 -874
  187. package/node_modules/@types/is-stream/node_modules/@types/node/globals.d.ts +24 -14
  188. package/node_modules/@types/is-stream/node_modules/@types/node/http.d.ts +1031 -98
  189. package/node_modules/@types/is-stream/node_modules/@types/node/http2.d.ts +1579 -459
  190. package/node_modules/@types/is-stream/node_modules/@types/node/https.d.ts +363 -12
  191. package/node_modules/@types/is-stream/node_modules/@types/node/index.d.ts +88 -15
  192. package/node_modules/@types/is-stream/node_modules/@types/node/inspector.d.ts +360 -661
  193. package/node_modules/@types/is-stream/node_modules/@types/node/module.d.ts +52 -11
  194. package/node_modules/@types/is-stream/node_modules/@types/node/net.d.ts +557 -142
  195. package/node_modules/@types/is-stream/node_modules/@types/node/os.d.ts +236 -26
  196. package/node_modules/@types/is-stream/node_modules/@types/node/package.json +23 -25
  197. package/node_modules/@types/is-stream/node_modules/@types/node/path.d.ts +9 -5
  198. package/node_modules/@types/is-stream/node_modules/@types/node/perf_hooks.d.ts +289 -91
  199. package/node_modules/@types/is-stream/node_modules/@types/node/process.d.ts +1173 -155
  200. package/node_modules/@types/is-stream/node_modules/@types/node/punycode.d.ts +64 -26
  201. package/node_modules/@types/is-stream/node_modules/@types/node/querystring.d.ts +107 -8
  202. package/node_modules/@types/is-stream/node_modules/@types/node/readline.d.ts +426 -79
  203. package/node_modules/@types/is-stream/node_modules/@types/node/repl.d.ts +135 -110
  204. package/node_modules/@types/is-stream/node_modules/@types/node/stream/consumers.d.ts +24 -0
  205. package/node_modules/@types/is-stream/node_modules/@types/node/stream/promises.d.ts +15 -44
  206. package/node_modules/@types/is-stream/node_modules/@types/node/stream/web.d.ts +391 -0
  207. package/node_modules/@types/is-stream/node_modules/@types/node/stream.d.ts +998 -225
  208. package/node_modules/@types/is-stream/node_modules/@types/node/string_decoder.d.ts +57 -1
  209. package/node_modules/@types/is-stream/node_modules/@types/node/timers/promises.d.ts +52 -9
  210. package/node_modules/@types/is-stream/node_modules/@types/node/timers.d.ts +30 -11
  211. package/node_modules/@types/is-stream/node_modules/@types/node/tls.d.ts +447 -225
  212. package/node_modules/@types/is-stream/node_modules/@types/node/trace_events.d.ts +107 -11
  213. package/node_modules/@types/is-stream/node_modules/@types/node/tty.d.ts +157 -23
  214. package/node_modules/@types/is-stream/node_modules/@types/node/url.d.ts +724 -30
  215. package/node_modules/@types/is-stream/node_modules/@types/node/util.d.ts +1399 -73
  216. package/node_modules/@types/is-stream/node_modules/@types/node/v8.d.ts +254 -78
  217. package/node_modules/@types/is-stream/node_modules/@types/node/vm.d.ts +384 -33
  218. package/node_modules/@types/is-stream/node_modules/@types/node/wasi.d.ts +92 -24
  219. package/node_modules/@types/is-stream/node_modules/@types/node/worker_threads.d.ts +494 -131
  220. package/node_modules/@types/is-stream/node_modules/@types/node/zlib.d.ts +215 -63
  221. package/node_modules/@types/keyv/README.md +1 -1
  222. package/node_modules/@types/keyv/index.d.ts +10 -3
  223. package/node_modules/@types/keyv/node_modules/@types/node/README.md +3 -3
  224. package/node_modules/@types/keyv/node_modules/@types/node/assert/strict.d.ts +0 -1
  225. package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +823 -40
  226. package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +359 -90
  227. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +1895 -113
  228. package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +1080 -247
  229. package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +327 -101
  230. package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +310 -32
  231. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +2454 -742
  232. package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +463 -63
  233. package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  234. package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +303 -36
  235. package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +425 -97
  236. package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +154 -10
  237. package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +559 -34
  238. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +812 -269
  239. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +2408 -874
  240. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +24 -14
  241. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +1031 -98
  242. package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +1579 -459
  243. package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +363 -12
  244. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +88 -15
  245. package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +360 -661
  246. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +52 -11
  247. package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +557 -142
  248. package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +236 -26
  249. package/node_modules/@types/keyv/node_modules/@types/node/package.json +23 -25
  250. package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +9 -5
  251. package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +289 -91
  252. package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +1173 -155
  253. package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +64 -26
  254. package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +107 -8
  255. package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +426 -79
  256. package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +135 -110
  257. package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +24 -0
  258. package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +15 -44
  259. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +391 -0
  260. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +998 -225
  261. package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +57 -1
  262. package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +52 -9
  263. package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +30 -11
  264. package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +447 -225
  265. package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +107 -11
  266. package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +157 -23
  267. package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +724 -30
  268. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +1399 -73
  269. package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +254 -78
  270. package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +384 -33
  271. package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +92 -24
  272. package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +494 -131
  273. package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +215 -63
  274. package/node_modules/@types/keyv/package.json +3 -3
  275. package/node_modules/@types/responselike/node_modules/@types/node/README.md +3 -3
  276. package/node_modules/@types/responselike/node_modules/@types/node/assert/strict.d.ts +0 -1
  277. package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +823 -40
  278. package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +359 -90
  279. package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +1895 -113
  280. package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +1080 -247
  281. package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +327 -101
  282. package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +310 -32
  283. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +2454 -742
  284. package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +463 -63
  285. package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +109 -13
  286. package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +303 -36
  287. package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +425 -97
  288. package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +154 -10
  289. package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +559 -34
  290. package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +812 -269
  291. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +2408 -874
  292. package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +24 -14
  293. package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +1031 -98
  294. package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +1579 -459
  295. package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +363 -12
  296. package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +88 -15
  297. package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +360 -661
  298. package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +52 -11
  299. package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +557 -142
  300. package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +236 -26
  301. package/node_modules/@types/responselike/node_modules/@types/node/package.json +23 -25
  302. package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +9 -5
  303. package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +289 -91
  304. package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +1173 -155
  305. package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +64 -26
  306. package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +107 -8
  307. package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +426 -79
  308. package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +135 -110
  309. package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +24 -0
  310. package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +15 -44
  311. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +391 -0
  312. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +998 -225
  313. package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +57 -1
  314. package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +52 -9
  315. package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +30 -11
  316. package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +447 -225
  317. package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +107 -11
  318. package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +157 -23
  319. package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +724 -30
  320. package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +1399 -73
  321. package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +254 -78
  322. package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +384 -33
  323. package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +92 -24
  324. package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +494 -131
  325. package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +215 -63
  326. package/node_modules/axios/CHANGELOG.md +98 -8
  327. package/node_modules/axios/README.md +74 -6
  328. package/node_modules/axios/SECURITY.md +5 -0
  329. package/node_modules/axios/dist/axios.js +2028 -1591
  330. package/node_modules/axios/dist/axios.map +1 -1
  331. package/node_modules/axios/dist/axios.min.js +2 -2
  332. package/node_modules/axios/dist/axios.min.map +1 -1
  333. package/node_modules/axios/index.d.ts +8 -1
  334. package/node_modules/axios/lib/adapters/http.js +33 -5
  335. package/node_modules/axios/lib/adapters/xhr.js +35 -25
  336. package/node_modules/axios/lib/core/Axios.js +60 -7
  337. package/node_modules/axios/lib/core/InterceptorManager.js +4 -2
  338. package/node_modules/axios/lib/core/README.md +1 -0
  339. package/node_modules/axios/lib/core/dispatchRequest.js +6 -3
  340. package/node_modules/axios/lib/core/transformData.js +3 -1
  341. package/node_modules/axios/lib/defaults.js +43 -7
  342. package/node_modules/axios/lib/helpers/validator.js +105 -0
  343. package/node_modules/axios/lib/utils.js +1 -3
  344. package/node_modules/axios/package.json +19 -21
  345. package/node_modules/follow-redirects/debug.js +2 -1
  346. package/node_modules/follow-redirects/index.js +59 -21
  347. package/node_modules/follow-redirects/package.json +1 -1
  348. package/node_modules/got/dist/source/as-promise/parse-body.d.ts +1 -1
  349. package/node_modules/got/dist/source/as-promise/types.js +2 -0
  350. package/node_modules/got/dist/source/core/index.d.ts +1 -1
  351. package/node_modules/got/dist/source/core/index.js +9 -3
  352. package/node_modules/got/dist/source/types.d.ts +14 -12
  353. package/node_modules/got/package.json +2 -2
  354. package/node_modules/got/readme.md +11 -10
  355. package/node_modules/keyv/LICENSE +1 -1
  356. package/node_modules/keyv/README.md +12 -10
  357. package/node_modules/keyv/package.json +17 -12
  358. package/node_modules/keyv/src/index.js +14 -16
  359. package/node_modules/mime-db/HISTORY.md +19 -0
  360. package/node_modules/mime-db/db.json +93 -1
  361. package/node_modules/mime-db/package.json +7 -7
  362. package/node_modules/mime-types/HISTORY.md +20 -3
  363. package/node_modules/mime-types/package.json +7 -7
  364. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/index.d.ts +0 -0
  365. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/index.js +0 -0
  366. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/license +0 -0
  367. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/package.json +0 -0
  368. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/readme.md +0 -0
  369. package/node_modules/resolve-alpn/README.md +8 -1
  370. package/node_modules/resolve-alpn/index.js +14 -4
  371. package/node_modules/resolve-alpn/package.json +1 -1
  372. package/package.json +33 -34
  373. package/node_modules/@slack/logger/node_modules/@types/node/base.d.ts +0 -19
  374. package/node_modules/@slack/logger/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  375. package/node_modules/@slack/logger/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  376. package/node_modules/@slack/logger/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  377. package/node_modules/@slack/web-api/node_modules/@types/node/base.d.ts +0 -19
  378. package/node_modules/@slack/web-api/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  379. package/node_modules/@slack/web-api/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  380. package/node_modules/@slack/web-api/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  381. package/node_modules/@types/cacheable-request/node_modules/@types/node/base.d.ts +0 -19
  382. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  383. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  384. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  385. package/node_modules/@types/is-stream/node_modules/@types/node/base.d.ts +0 -19
  386. package/node_modules/@types/is-stream/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  387. package/node_modules/@types/is-stream/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  388. package/node_modules/@types/is-stream/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  389. package/node_modules/@types/keyv/node_modules/@types/node/base.d.ts +0 -19
  390. package/node_modules/@types/keyv/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  391. package/node_modules/@types/keyv/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  392. package/node_modules/@types/keyv/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  393. package/node_modules/@types/responselike/node_modules/@types/node/base.d.ts +0 -19
  394. package/node_modules/@types/responselike/node_modules/@types/node/ts3.6/assert.d.ts +0 -103
  395. package/node_modules/@types/responselike/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  396. package/node_modules/@types/responselike/node_modules/@types/node/ts3.6/index.d.ts +0 -7
@@ -1,11 +1,51 @@
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
+ */
1
42
  declare module 'http' {
2
43
  import * as stream from 'node:stream';
3
44
  import { URL } from 'node:url';
4
- import { Socket, Server as NetServer } from 'node:net';
5
-
45
+ import { TcpSocketConnectOpts, Socket, Server as NetServer, LookupFunction } from 'node:net';
6
46
  // incoming headers will never contain number
7
47
  interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
8
- 'accept'?: string | undefined;
48
+ accept?: string | undefined;
9
49
  'accept-language'?: string | undefined;
10
50
  'accept-patch'?: string | undefined;
11
51
  'accept-ranges'?: string | undefined;
@@ -17,12 +57,12 @@ declare module 'http' {
17
57
  'access-control-max-age'?: string | undefined;
18
58
  'access-control-request-headers'?: string | undefined;
19
59
  'access-control-request-method'?: string | undefined;
20
- 'age'?: string | undefined;
21
- 'allow'?: string | undefined;
60
+ age?: string | undefined;
61
+ allow?: string | undefined;
22
62
  'alt-svc'?: string | undefined;
23
- 'authorization'?: string | undefined;
63
+ authorization?: string | undefined;
24
64
  'cache-control'?: string | undefined;
25
- 'connection'?: string | undefined;
65
+ connection?: string | undefined;
26
66
  'content-disposition'?: string | undefined;
27
67
  'content-encoding'?: string | undefined;
28
68
  'content-language'?: string | undefined;
@@ -30,27 +70,27 @@ declare module 'http' {
30
70
  'content-location'?: string | undefined;
31
71
  'content-range'?: string | undefined;
32
72
  'content-type'?: string | undefined;
33
- 'cookie'?: string | undefined;
34
- 'date'?: string | undefined;
35
- 'etag'?: string | undefined;
36
- 'expect'?: string | undefined;
37
- 'expires'?: string | undefined;
38
- 'forwarded'?: string | undefined;
39
- 'from'?: string | undefined;
40
- 'host'?: 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;
41
81
  'if-match'?: string | undefined;
42
82
  'if-modified-since'?: string | undefined;
43
83
  'if-none-match'?: string | undefined;
44
84
  'if-unmodified-since'?: string | undefined;
45
85
  'last-modified'?: string | undefined;
46
- 'location'?: string | undefined;
47
- 'origin'?: string | undefined;
48
- 'pragma'?: string | undefined;
86
+ location?: string | undefined;
87
+ origin?: string | undefined;
88
+ pragma?: string | undefined;
49
89
  'proxy-authenticate'?: string | undefined;
50
90
  'proxy-authorization'?: string | undefined;
51
91
  'public-key-pins'?: string | undefined;
52
- 'range'?: string | undefined;
53
- 'referer'?: string | undefined;
92
+ range?: string | undefined;
93
+ referer?: string | undefined;
54
94
  'retry-after'?: string | undefined;
55
95
  'sec-websocket-accept'?: string | undefined;
56
96
  'sec-websocket-extensions'?: string | undefined;
@@ -59,25 +99,21 @@ declare module 'http' {
59
99
  'sec-websocket-version'?: string | undefined;
60
100
  'set-cookie'?: string[] | undefined;
61
101
  'strict-transport-security'?: string | undefined;
62
- 'tk'?: string | undefined;
63
- 'trailer'?: string | undefined;
102
+ tk?: string | undefined;
103
+ trailer?: string | undefined;
64
104
  'transfer-encoding'?: string | undefined;
65
- 'upgrade'?: string | undefined;
105
+ upgrade?: string | undefined;
66
106
  'user-agent'?: string | undefined;
67
- 'vary'?: string | undefined;
68
- 'via'?: string | undefined;
69
- 'warning'?: string | undefined;
107
+ vary?: string | undefined;
108
+ via?: string | undefined;
109
+ warning?: string | undefined;
70
110
  'www-authenticate'?: string | undefined;
71
111
  }
72
-
73
112
  // outgoing headers allows numbers (as they are converted internally to strings)
74
113
  type OutgoingHttpHeader = number | string | string[];
75
-
76
- interface OutgoingHttpHeaders extends NodeJS.Dict<OutgoingHttpHeader> {
77
- }
78
-
114
+ interface OutgoingHttpHeaders extends NodeJS.Dict<OutgoingHttpHeader> {}
79
115
  interface ClientRequestArgs {
80
- abort?: AbortSignal | undefined;
116
+ signal?: AbortSignal | undefined;
81
117
  protocol?: string | null | undefined;
82
118
  host?: string | null | undefined;
83
119
  hostname?: string | null | undefined;
@@ -100,8 +136,8 @@ declare module 'http' {
100
136
  setHost?: boolean | undefined;
101
137
  // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278
102
138
  createConnection?: ((options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket) | undefined;
139
+ lookup?: LookupFunction | undefined;
103
140
  }
104
-
105
141
  interface ServerOptions {
106
142
  IncomingMessage?: typeof IncomingMessage | undefined;
107
143
  ServerResponse?: typeof ServerResponse | undefined;
@@ -120,44 +156,175 @@ declare module 'http' {
120
156
  */
121
157
  insecureHTTPParser?: boolean | undefined;
122
158
  }
123
-
124
159
  type RequestListener = (req: IncomingMessage, res: ServerResponse) => void;
125
-
126
- interface HttpBase {
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
+ */
127
180
  setTimeout(msecs?: number, callback?: () => void): this;
128
181
  setTimeout(callback: () => void): this;
129
182
  /**
130
183
  * Limits maximum incoming headers count. If set to 0, no limit will be applied.
131
- * @default 2000
132
- * {@link https://nodejs.org/api/http.html#http_server_maxheaderscount}
184
+ * @since v0.7.0
133
185
  */
134
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
+ */
135
209
  timeout: number;
136
210
  /**
137
- * Limit the amount of time the parser will wait to receive the complete HTTP headers.
138
- * @default 60000
139
- * {@link https://nodejs.org/api/http.html#http_server_headerstimeout}
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
140
223
  */
141
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
+ */
142
240
  keepAliveTimeout: number;
143
241
  /**
144
- * Sets the timeout value in milliseconds for receiving the entire request from the client.
145
- * @default 0
146
- * {@link https://nodejs.org/api/http.html#http_server_requesttimeout}
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
147
252
  */
148
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;
149
320
  }
150
-
151
- interface Server extends HttpBase {}
152
- class Server extends NetServer {
153
- constructor(requestListener?: RequestListener);
154
- constructor(options: ServerOptions, requestListener?: RequestListener);
155
- }
156
-
157
- // https://github.com/nodejs/node/blob/master/lib/_http_outgoing.js
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
+ */
158
326
  class OutgoingMessage extends stream.Writable {
159
327
  readonly req: IncomingMessage;
160
-
161
328
  chunkedEncoding: boolean;
162
329
  shouldKeepAlive: boolean;
163
330
  useChunkedEncodingByDefault: boolean;
@@ -166,43 +333,239 @@ declare module 'http' {
166
333
  * @deprecated Use `writableEnded` instead.
167
334
  */
168
335
  finished: boolean;
336
+ /**
337
+ * Read-only. `true` if the headers were sent, otherwise `false`.
338
+ * @since v0.9.3
339
+ */
169
340
  readonly headersSent: boolean;
170
341
  /**
171
- * @deprecated Use `socket` instead.
342
+ * Aliases of `outgoingMessage.socket`
343
+ * @since v0.3.0
344
+ * @deprecated Since v15.12.0 - Use `socket` instead.
172
345
  */
173
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
+ */
174
354
  readonly socket: Socket | null;
175
-
176
355
  constructor();
177
-
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
+ */
178
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
+ */
179
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
+ */
180
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
+ */
181
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
+ */
182
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
+ */
183
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
+ */
184
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
+ */
185
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
+ */
186
457
  flushHeaders(): void;
187
458
  }
188
-
189
- // https://github.com/nodejs/node/blob/master/lib/_http_server.js#L108-L256
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
+ */
190
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
+ */
191
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
+ */
192
493
  statusMessage: string;
193
-
194
494
  constructor(req: IncomingMessage);
195
-
196
495
  assignSocket(socket: Socket): void;
197
496
  detachSocket(socket: Socket): void;
198
- // https://github.com/nodejs/node/blob/master/test/parallel/test-http-write-callbacks.js#L53
199
- // no args in writeContinue callback
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
+ */
200
502
  writeContinue(callback?: () => void): void;
201
- writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
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;
202
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
+ */
203
567
  writeProcessing(): void;
204
568
  }
205
-
206
569
  interface InformationEvent {
207
570
  statusCode: number;
208
571
  statusMessage: string;
@@ -212,29 +575,101 @@ declare module 'http' {
212
575
  headers: IncomingHttpHeaders;
213
576
  rawHeaders: string[];
214
577
  }
215
-
216
- // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77
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
+ */
217
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
+ */
218
612
  aborted: boolean;
613
+ /**
614
+ * The request host.
615
+ * @since v14.5.0, v12.19.0
616
+ */
219
617
  host: string;
618
+ /**
619
+ * The request protocol.
620
+ * @since v14.5.0, v12.19.0
621
+ */
220
622
  protocol: string;
221
-
222
623
  constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
223
-
624
+ /**
625
+ * The request method.
626
+ * @since v0.1.97
627
+ */
224
628
  method: string;
629
+ /**
630
+ * The request path.
631
+ * @since v0.4.0
632
+ */
225
633
  path: string;
226
- /** @deprecated since v14.1.0 Use `request.destroy()` instead. */
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
+ */
227
640
  abort(): void;
228
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
+ */
229
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
+ */
230
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
+ */
231
658
  setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
232
659
  /**
233
- * Returns an array containing the unique names of the current outgoing raw headers.
234
- * Header names are returned with their exact casing being set.
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
235
671
  */
236
672
  getRawHeaderNames(): string[];
237
-
238
673
  addListener(event: 'abort', listener: () => void): this;
239
674
  addListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
240
675
  addListener(event: 'continue', listener: () => void): this;
@@ -250,7 +685,6 @@ declare module 'http' {
250
685
  addListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
251
686
  addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
252
687
  addListener(event: string | symbol, listener: (...args: any[]) => void): this;
253
-
254
688
  on(event: 'abort', listener: () => void): this;
255
689
  on(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
256
690
  on(event: 'continue', listener: () => void): this;
@@ -266,7 +700,6 @@ declare module 'http' {
266
700
  on(event: 'pipe', listener: (src: stream.Readable) => void): this;
267
701
  on(event: 'unpipe', listener: (src: stream.Readable) => void): this;
268
702
  on(event: string | symbol, listener: (...args: any[]) => void): this;
269
-
270
703
  once(event: 'abort', listener: () => void): this;
271
704
  once(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
272
705
  once(event: 'continue', listener: () => void): this;
@@ -282,7 +715,6 @@ declare module 'http' {
282
715
  once(event: 'pipe', listener: (src: stream.Readable) => void): this;
283
716
  once(event: 'unpipe', listener: (src: stream.Readable) => void): this;
284
717
  once(event: string | symbol, listener: (...args: any[]) => void): this;
285
-
286
718
  prependListener(event: 'abort', listener: () => void): this;
287
719
  prependListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
288
720
  prependListener(event: 'continue', listener: () => void): this;
@@ -298,7 +730,6 @@ declare module 'http' {
298
730
  prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
299
731
  prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
300
732
  prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
301
-
302
733
  prependOnceListener(event: 'abort', listener: () => void): this;
303
734
  prependOnceListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
304
735
  prependOnceListener(event: 'continue', listener: () => void): this;
@@ -315,45 +746,212 @@ declare module 'http' {
315
746
  prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
316
747
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
317
748
  }
318
-
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
+ */
319
759
  class IncomingMessage extends stream.Readable {
320
760
  constructor(socket: Socket);
321
-
761
+ /**
762
+ * The `message.aborted` property will be `true` if the request has
763
+ * been aborted.
764
+ * @since v10.1.0
765
+ */
322
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
+ */
323
775
  httpVersion: string;
324
776
  httpVersionMajor: number;
325
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
+ */
326
801
  complete: boolean;
327
802
  /**
328
- * @deprecated since v13.0.0 - Use `socket` instead.
803
+ * Alias for `message.socket`.
804
+ * @since v0.1.90
805
+ * @deprecated Since v16.0.0 - Use `socket`.
329
806
  */
330
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
+ */
331
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
+ */
332
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
+ */
333
869
  rawHeaders: string[];
870
+ /**
871
+ * The request/response trailers object. Only populated at the `'end'` event.
872
+ * @since v0.3.0
873
+ */
334
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
+ */
335
880
  rawTrailers: string[];
881
+ /**
882
+ * Calls `message.socket.setTimeout(msecs, callback)`.
883
+ * @since v0.5.9
884
+ */
336
885
  setTimeout(msecs: number, callback?: () => void): this;
337
886
  /**
338
- * Only valid for request obtained from http.Server.
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
339
891
  */
340
892
  method?: string | undefined;
341
893
  /**
342
- * Only valid for request obtained from http.Server.
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
343
931
  */
344
932
  url?: string | undefined;
345
933
  /**
346
- * Only valid for response obtained from http.ClientRequest.
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
347
938
  */
348
939
  statusCode?: number | undefined;
349
940
  /**
350
- * Only valid for response obtained from http.ClientRequest.
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
351
945
  */
352
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
+ */
353
952
  destroy(error?: Error): void;
354
953
  }
355
-
356
- interface AgentOptions {
954
+ interface AgentOptions extends Partial<TcpSocketConnectOpts> {
357
955
  /**
358
956
  * Keep sockets around in a pool to be used by other requests in the future. Default = false
359
957
  */
@@ -385,52 +983,387 @@ declare module 'http' {
385
983
  */
386
984
  scheduling?: 'fifo' | 'lifo' | undefined;
387
985
  }
388
-
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
+ */
389
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
+ */
390
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
+ */
391
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
+ */
392
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
+ */
393
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
+ */
394
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
+ */
395
1081
  readonly requests: NodeJS.ReadOnlyDict<IncomingMessage[]>;
396
-
397
1082
  constructor(opts?: AgentOptions);
398
-
399
1083
  /**
400
1084
  * Destroy any sockets that are currently in use by the agent.
401
- * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
402
- * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
403
- * sockets may hang open for quite a long time before the server terminates them.
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
404
1092
  */
405
1093
  destroy(): void;
406
1094
  }
407
-
408
1095
  const METHODS: string[];
409
-
410
1096
  const STATUS_CODES: {
411
1097
  [errorCode: number]: string | undefined;
412
1098
  [errorCode: string]: string | undefined;
413
1099
  };
414
-
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
+ */
415
1107
  function createServer(requestListener?: RequestListener): Server;
416
1108
  function createServer(options: ServerOptions, requestListener?: RequestListener): Server;
417
-
418
1109
  // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly,
419
1110
  // create interface RequestOptions would make the naming more clear to developers
420
- interface RequestOptions extends ClientRequestArgs { }
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
+ */
421
1296
  function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
422
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
+ */
423
1358
  function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
424
1359
  function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
425
1360
  let globalAgent: Agent;
426
-
427
1361
  /**
428
1362
  * Read-only property specifying the maximum allowed size of HTTP headers in bytes.
429
1363
  * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option.
430
1364
  */
431
1365
  const maxHeaderSize: number;
432
1366
  }
433
-
434
1367
  declare module 'node:http' {
435
1368
  export * from 'http';
436
1369
  }