cloudstructs 0.1.37 → 0.1.41

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