cdk-ecr-deployment 3.2.2 → 3.3.1

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 (562) hide show
  1. package/.jsii +30 -34
  2. package/README.md +2 -2
  3. package/lambda-bin/.gitkeep +0 -0
  4. package/lambda-bin/bootstrap +0 -0
  5. package/{lambda → lambda-src}/Makefile +1 -1
  6. package/lib/index.js +6 -9
  7. package/package.json +1 -13
  8. package/lambda/install.js +0 -82
  9. package/node_modules/@sindresorhus/is/dist/index.d.ts +0 -232
  10. package/node_modules/@sindresorhus/is/dist/index.js +0 -434
  11. package/node_modules/@sindresorhus/is/dist/types.d.ts +0 -25
  12. package/node_modules/@sindresorhus/is/dist/types.js +0 -3
  13. package/node_modules/@sindresorhus/is/license +0 -9
  14. package/node_modules/@sindresorhus/is/package.json +0 -96
  15. package/node_modules/@sindresorhus/is/readme.md +0 -669
  16. package/node_modules/@szmarczak/http-timer/LICENSE +0 -21
  17. package/node_modules/@szmarczak/http-timer/README.md +0 -93
  18. package/node_modules/@szmarczak/http-timer/dist/source/index.d.ts +0 -32
  19. package/node_modules/@szmarczak/http-timer/dist/source/index.js +0 -126
  20. package/node_modules/@szmarczak/http-timer/package.json +0 -72
  21. package/node_modules/@types/cacheable-request/LICENSE +0 -21
  22. package/node_modules/@types/cacheable-request/README.md +0 -16
  23. package/node_modules/@types/cacheable-request/index.d.ts +0 -137
  24. package/node_modules/@types/cacheable-request/node_modules/@types/node/LICENSE +0 -21
  25. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +0 -15
  26. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert/strict.d.ts +0 -8
  27. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +0 -1095
  28. package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +0 -541
  29. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.buffer.d.ts +0 -460
  30. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +0 -1926
  31. package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +0 -1549
  32. package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +0 -579
  33. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
  34. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/index.d.ts +0 -9
  35. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
  36. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  37. package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +0 -452
  38. package/node_modules/@types/cacheable-request/node_modules/@types/node/constants.d.ts +0 -21
  39. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +0 -4510
  40. package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +0 -599
  41. package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
  42. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +0 -476
  43. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +0 -865
  44. package/node_modules/@types/cacheable-request/node_modules/@types/node/dom-events.d.ts +0 -124
  45. package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +0 -170
  46. package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +0 -931
  47. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +0 -1275
  48. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +0 -4343
  49. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +0 -511
  50. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.typedarray.d.ts +0 -21
  51. package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +0 -1959
  52. package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +0 -2558
  53. package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +0 -543
  54. package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +0 -92
  55. package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +0 -3966
  56. package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +0 -702
  57. package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +0 -1029
  58. package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +0 -495
  59. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +0 -220
  60. package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +0 -200
  61. package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +0 -970
  62. package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +0 -2013
  63. package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +0 -117
  64. package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +0 -153
  65. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline/promises.d.ts +0 -162
  66. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +0 -589
  67. package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +0 -430
  68. package/node_modules/@types/cacheable-request/node_modules/@types/node/sea.d.ts +0 -153
  69. package/node_modules/@types/cacheable-request/node_modules/@types/node/sqlite.d.ts +0 -439
  70. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +0 -12
  71. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +0 -90
  72. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +0 -614
  73. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +0 -1662
  74. package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +0 -67
  75. package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +0 -2150
  76. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +0 -97
  77. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +0 -240
  78. package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +0 -1226
  79. package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +0 -197
  80. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -457
  81. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
  82. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/index.d.ts +0 -92
  83. package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +0 -208
  84. package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +0 -972
  85. package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +0 -2439
  86. package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +0 -808
  87. package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +0 -976
  88. package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +0 -181
  89. package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +0 -745
  90. package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +0 -539
  91. package/node_modules/@types/cacheable-request/node_modules/undici-types/LICENSE +0 -21
  92. package/node_modules/@types/cacheable-request/node_modules/undici-types/README.md +0 -6
  93. package/node_modules/@types/cacheable-request/node_modules/undici-types/agent.d.ts +0 -31
  94. package/node_modules/@types/cacheable-request/node_modules/undici-types/api.d.ts +0 -43
  95. package/node_modules/@types/cacheable-request/node_modules/undici-types/balanced-pool.d.ts +0 -29
  96. package/node_modules/@types/cacheable-request/node_modules/undici-types/cache.d.ts +0 -36
  97. package/node_modules/@types/cacheable-request/node_modules/undici-types/client.d.ts +0 -108
  98. package/node_modules/@types/cacheable-request/node_modules/undici-types/connector.d.ts +0 -34
  99. package/node_modules/@types/cacheable-request/node_modules/undici-types/content-type.d.ts +0 -21
  100. package/node_modules/@types/cacheable-request/node_modules/undici-types/cookies.d.ts +0 -28
  101. package/node_modules/@types/cacheable-request/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  102. package/node_modules/@types/cacheable-request/node_modules/undici-types/dispatcher.d.ts +0 -255
  103. package/node_modules/@types/cacheable-request/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  104. package/node_modules/@types/cacheable-request/node_modules/undici-types/errors.d.ts +0 -149
  105. package/node_modules/@types/cacheable-request/node_modules/undici-types/eventsource.d.ts +0 -61
  106. package/node_modules/@types/cacheable-request/node_modules/undici-types/fetch.d.ts +0 -209
  107. package/node_modules/@types/cacheable-request/node_modules/undici-types/file.d.ts +0 -39
  108. package/node_modules/@types/cacheable-request/node_modules/undici-types/filereader.d.ts +0 -54
  109. package/node_modules/@types/cacheable-request/node_modules/undici-types/formdata.d.ts +0 -108
  110. package/node_modules/@types/cacheable-request/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  111. package/node_modules/@types/cacheable-request/node_modules/undici-types/global-origin.d.ts +0 -7
  112. package/node_modules/@types/cacheable-request/node_modules/undici-types/handlers.d.ts +0 -15
  113. package/node_modules/@types/cacheable-request/node_modules/undici-types/header.d.ts +0 -4
  114. package/node_modules/@types/cacheable-request/node_modules/undici-types/index.d.ts +0 -71
  115. package/node_modules/@types/cacheable-request/node_modules/undici-types/interceptors.d.ts +0 -17
  116. package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-agent.d.ts +0 -50
  117. package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-client.d.ts +0 -25
  118. package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-errors.d.ts +0 -12
  119. package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  120. package/node_modules/@types/cacheable-request/node_modules/undici-types/mock-pool.d.ts +0 -25
  121. package/node_modules/@types/cacheable-request/node_modules/undici-types/package.json +0 -55
  122. package/node_modules/@types/cacheable-request/node_modules/undici-types/patch.d.ts +0 -33
  123. package/node_modules/@types/cacheable-request/node_modules/undici-types/pool-stats.d.ts +0 -19
  124. package/node_modules/@types/cacheable-request/node_modules/undici-types/pool.d.ts +0 -39
  125. package/node_modules/@types/cacheable-request/node_modules/undici-types/proxy-agent.d.ts +0 -28
  126. package/node_modules/@types/cacheable-request/node_modules/undici-types/readable.d.ts +0 -60
  127. package/node_modules/@types/cacheable-request/node_modules/undici-types/retry-agent.d.ts +0 -8
  128. package/node_modules/@types/cacheable-request/node_modules/undici-types/retry-handler.d.ts +0 -116
  129. package/node_modules/@types/cacheable-request/node_modules/undici-types/util.d.ts +0 -18
  130. package/node_modules/@types/cacheable-request/node_modules/undici-types/webidl.d.ts +0 -222
  131. package/node_modules/@types/cacheable-request/node_modules/undici-types/websocket.d.ts +0 -150
  132. package/node_modules/@types/cacheable-request/package.json +0 -35
  133. package/node_modules/@types/http-cache-semantics/LICENSE +0 -21
  134. package/node_modules/@types/http-cache-semantics/README.md +0 -15
  135. package/node_modules/@types/http-cache-semantics/index.d.ts +0 -165
  136. package/node_modules/@types/http-cache-semantics/package.json +0 -25
  137. package/node_modules/@types/keyv/LICENSE +0 -21
  138. package/node_modules/@types/keyv/README.md +0 -16
  139. package/node_modules/@types/keyv/index.d.ts +0 -90
  140. package/node_modules/@types/keyv/node_modules/@types/node/LICENSE +0 -21
  141. package/node_modules/@types/keyv/node_modules/@types/node/README.md +0 -15
  142. package/node_modules/@types/keyv/node_modules/@types/node/assert/strict.d.ts +0 -8
  143. package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +0 -1095
  144. package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +0 -541
  145. package/node_modules/@types/keyv/node_modules/@types/node/buffer.buffer.d.ts +0 -460
  146. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +0 -1926
  147. package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +0 -1549
  148. package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +0 -579
  149. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
  150. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/index.d.ts +0 -9
  151. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
  152. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  153. package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +0 -452
  154. package/node_modules/@types/keyv/node_modules/@types/node/constants.d.ts +0 -21
  155. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +0 -4510
  156. package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +0 -599
  157. package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
  158. package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +0 -476
  159. package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +0 -865
  160. package/node_modules/@types/keyv/node_modules/@types/node/dom-events.d.ts +0 -124
  161. package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +0 -170
  162. package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +0 -931
  163. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +0 -1275
  164. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +0 -4343
  165. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +0 -511
  166. package/node_modules/@types/keyv/node_modules/@types/node/globals.typedarray.d.ts +0 -21
  167. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +0 -1959
  168. package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +0 -2558
  169. package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +0 -543
  170. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +0 -92
  171. package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +0 -3966
  172. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +0 -702
  173. package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +0 -1029
  174. package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +0 -495
  175. package/node_modules/@types/keyv/node_modules/@types/node/package.json +0 -220
  176. package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +0 -200
  177. package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +0 -970
  178. package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +0 -2013
  179. package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +0 -117
  180. package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +0 -153
  181. package/node_modules/@types/keyv/node_modules/@types/node/readline/promises.d.ts +0 -162
  182. package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +0 -589
  183. package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +0 -430
  184. package/node_modules/@types/keyv/node_modules/@types/node/sea.d.ts +0 -153
  185. package/node_modules/@types/keyv/node_modules/@types/node/sqlite.d.ts +0 -439
  186. package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +0 -12
  187. package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +0 -90
  188. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +0 -614
  189. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +0 -1662
  190. package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +0 -67
  191. package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +0 -2150
  192. package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +0 -97
  193. package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +0 -240
  194. package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +0 -1226
  195. package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +0 -197
  196. package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -457
  197. package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
  198. package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/index.d.ts +0 -92
  199. package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +0 -208
  200. package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +0 -972
  201. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +0 -2439
  202. package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +0 -808
  203. package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +0 -976
  204. package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +0 -181
  205. package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +0 -745
  206. package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +0 -539
  207. package/node_modules/@types/keyv/node_modules/undici-types/LICENSE +0 -21
  208. package/node_modules/@types/keyv/node_modules/undici-types/README.md +0 -6
  209. package/node_modules/@types/keyv/node_modules/undici-types/agent.d.ts +0 -31
  210. package/node_modules/@types/keyv/node_modules/undici-types/api.d.ts +0 -43
  211. package/node_modules/@types/keyv/node_modules/undici-types/balanced-pool.d.ts +0 -29
  212. package/node_modules/@types/keyv/node_modules/undici-types/cache.d.ts +0 -36
  213. package/node_modules/@types/keyv/node_modules/undici-types/client.d.ts +0 -108
  214. package/node_modules/@types/keyv/node_modules/undici-types/connector.d.ts +0 -34
  215. package/node_modules/@types/keyv/node_modules/undici-types/content-type.d.ts +0 -21
  216. package/node_modules/@types/keyv/node_modules/undici-types/cookies.d.ts +0 -28
  217. package/node_modules/@types/keyv/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  218. package/node_modules/@types/keyv/node_modules/undici-types/dispatcher.d.ts +0 -255
  219. package/node_modules/@types/keyv/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  220. package/node_modules/@types/keyv/node_modules/undici-types/errors.d.ts +0 -149
  221. package/node_modules/@types/keyv/node_modules/undici-types/eventsource.d.ts +0 -61
  222. package/node_modules/@types/keyv/node_modules/undici-types/fetch.d.ts +0 -209
  223. package/node_modules/@types/keyv/node_modules/undici-types/file.d.ts +0 -39
  224. package/node_modules/@types/keyv/node_modules/undici-types/filereader.d.ts +0 -54
  225. package/node_modules/@types/keyv/node_modules/undici-types/formdata.d.ts +0 -108
  226. package/node_modules/@types/keyv/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  227. package/node_modules/@types/keyv/node_modules/undici-types/global-origin.d.ts +0 -7
  228. package/node_modules/@types/keyv/node_modules/undici-types/handlers.d.ts +0 -15
  229. package/node_modules/@types/keyv/node_modules/undici-types/header.d.ts +0 -4
  230. package/node_modules/@types/keyv/node_modules/undici-types/index.d.ts +0 -71
  231. package/node_modules/@types/keyv/node_modules/undici-types/interceptors.d.ts +0 -17
  232. package/node_modules/@types/keyv/node_modules/undici-types/mock-agent.d.ts +0 -50
  233. package/node_modules/@types/keyv/node_modules/undici-types/mock-client.d.ts +0 -25
  234. package/node_modules/@types/keyv/node_modules/undici-types/mock-errors.d.ts +0 -12
  235. package/node_modules/@types/keyv/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  236. package/node_modules/@types/keyv/node_modules/undici-types/mock-pool.d.ts +0 -25
  237. package/node_modules/@types/keyv/node_modules/undici-types/package.json +0 -55
  238. package/node_modules/@types/keyv/node_modules/undici-types/patch.d.ts +0 -33
  239. package/node_modules/@types/keyv/node_modules/undici-types/pool-stats.d.ts +0 -19
  240. package/node_modules/@types/keyv/node_modules/undici-types/pool.d.ts +0 -39
  241. package/node_modules/@types/keyv/node_modules/undici-types/proxy-agent.d.ts +0 -28
  242. package/node_modules/@types/keyv/node_modules/undici-types/readable.d.ts +0 -60
  243. package/node_modules/@types/keyv/node_modules/undici-types/retry-agent.d.ts +0 -8
  244. package/node_modules/@types/keyv/node_modules/undici-types/retry-handler.d.ts +0 -116
  245. package/node_modules/@types/keyv/node_modules/undici-types/util.d.ts +0 -18
  246. package/node_modules/@types/keyv/node_modules/undici-types/webidl.d.ts +0 -222
  247. package/node_modules/@types/keyv/node_modules/undici-types/websocket.d.ts +0 -150
  248. package/node_modules/@types/keyv/package.json +0 -32
  249. package/node_modules/@types/responselike/LICENSE +0 -21
  250. package/node_modules/@types/responselike/README.md +0 -48
  251. package/node_modules/@types/responselike/index.d.ts +0 -29
  252. package/node_modules/@types/responselike/node_modules/@types/node/LICENSE +0 -21
  253. package/node_modules/@types/responselike/node_modules/@types/node/README.md +0 -15
  254. package/node_modules/@types/responselike/node_modules/@types/node/assert/strict.d.ts +0 -8
  255. package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +0 -1095
  256. package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +0 -541
  257. package/node_modules/@types/responselike/node_modules/@types/node/buffer.buffer.d.ts +0 -460
  258. package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +0 -1926
  259. package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +0 -1549
  260. package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +0 -579
  261. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/disposable.d.ts +0 -16
  262. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/index.d.ts +0 -9
  263. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/indexable.d.ts +0 -23
  264. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  265. package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +0 -452
  266. package/node_modules/@types/responselike/node_modules/@types/node/constants.d.ts +0 -21
  267. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +0 -4510
  268. package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +0 -599
  269. package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
  270. package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +0 -476
  271. package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +0 -865
  272. package/node_modules/@types/responselike/node_modules/@types/node/dom-events.d.ts +0 -124
  273. package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +0 -170
  274. package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +0 -931
  275. package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +0 -1275
  276. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +0 -4343
  277. package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +0 -511
  278. package/node_modules/@types/responselike/node_modules/@types/node/globals.typedarray.d.ts +0 -21
  279. package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +0 -1959
  280. package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +0 -2558
  281. package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +0 -543
  282. package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +0 -92
  283. package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +0 -3966
  284. package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +0 -702
  285. package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +0 -1029
  286. package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +0 -495
  287. package/node_modules/@types/responselike/node_modules/@types/node/package.json +0 -220
  288. package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +0 -200
  289. package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +0 -970
  290. package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +0 -2013
  291. package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +0 -117
  292. package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +0 -153
  293. package/node_modules/@types/responselike/node_modules/@types/node/readline/promises.d.ts +0 -162
  294. package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +0 -589
  295. package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +0 -430
  296. package/node_modules/@types/responselike/node_modules/@types/node/sea.d.ts +0 -153
  297. package/node_modules/@types/responselike/node_modules/@types/node/sqlite.d.ts +0 -439
  298. package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +0 -12
  299. package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +0 -90
  300. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +0 -614
  301. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +0 -1662
  302. package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +0 -67
  303. package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +0 -2150
  304. package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +0 -97
  305. package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +0 -240
  306. package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +0 -1226
  307. package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +0 -197
  308. package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +0 -457
  309. package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -19
  310. package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/index.d.ts +0 -92
  311. package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +0 -208
  312. package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +0 -972
  313. package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +0 -2439
  314. package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +0 -808
  315. package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +0 -976
  316. package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +0 -181
  317. package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +0 -745
  318. package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +0 -539
  319. package/node_modules/@types/responselike/node_modules/undici-types/LICENSE +0 -21
  320. package/node_modules/@types/responselike/node_modules/undici-types/README.md +0 -6
  321. package/node_modules/@types/responselike/node_modules/undici-types/agent.d.ts +0 -31
  322. package/node_modules/@types/responselike/node_modules/undici-types/api.d.ts +0 -43
  323. package/node_modules/@types/responselike/node_modules/undici-types/balanced-pool.d.ts +0 -29
  324. package/node_modules/@types/responselike/node_modules/undici-types/cache.d.ts +0 -36
  325. package/node_modules/@types/responselike/node_modules/undici-types/client.d.ts +0 -108
  326. package/node_modules/@types/responselike/node_modules/undici-types/connector.d.ts +0 -34
  327. package/node_modules/@types/responselike/node_modules/undici-types/content-type.d.ts +0 -21
  328. package/node_modules/@types/responselike/node_modules/undici-types/cookies.d.ts +0 -28
  329. package/node_modules/@types/responselike/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
  330. package/node_modules/@types/responselike/node_modules/undici-types/dispatcher.d.ts +0 -255
  331. package/node_modules/@types/responselike/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
  332. package/node_modules/@types/responselike/node_modules/undici-types/errors.d.ts +0 -149
  333. package/node_modules/@types/responselike/node_modules/undici-types/eventsource.d.ts +0 -61
  334. package/node_modules/@types/responselike/node_modules/undici-types/fetch.d.ts +0 -209
  335. package/node_modules/@types/responselike/node_modules/undici-types/file.d.ts +0 -39
  336. package/node_modules/@types/responselike/node_modules/undici-types/filereader.d.ts +0 -54
  337. package/node_modules/@types/responselike/node_modules/undici-types/formdata.d.ts +0 -108
  338. package/node_modules/@types/responselike/node_modules/undici-types/global-dispatcher.d.ts +0 -9
  339. package/node_modules/@types/responselike/node_modules/undici-types/global-origin.d.ts +0 -7
  340. package/node_modules/@types/responselike/node_modules/undici-types/handlers.d.ts +0 -15
  341. package/node_modules/@types/responselike/node_modules/undici-types/header.d.ts +0 -4
  342. package/node_modules/@types/responselike/node_modules/undici-types/index.d.ts +0 -71
  343. package/node_modules/@types/responselike/node_modules/undici-types/interceptors.d.ts +0 -17
  344. package/node_modules/@types/responselike/node_modules/undici-types/mock-agent.d.ts +0 -50
  345. package/node_modules/@types/responselike/node_modules/undici-types/mock-client.d.ts +0 -25
  346. package/node_modules/@types/responselike/node_modules/undici-types/mock-errors.d.ts +0 -12
  347. package/node_modules/@types/responselike/node_modules/undici-types/mock-interceptor.d.ts +0 -93
  348. package/node_modules/@types/responselike/node_modules/undici-types/mock-pool.d.ts +0 -25
  349. package/node_modules/@types/responselike/node_modules/undici-types/package.json +0 -55
  350. package/node_modules/@types/responselike/node_modules/undici-types/patch.d.ts +0 -33
  351. package/node_modules/@types/responselike/node_modules/undici-types/pool-stats.d.ts +0 -19
  352. package/node_modules/@types/responselike/node_modules/undici-types/pool.d.ts +0 -39
  353. package/node_modules/@types/responselike/node_modules/undici-types/proxy-agent.d.ts +0 -28
  354. package/node_modules/@types/responselike/node_modules/undici-types/readable.d.ts +0 -60
  355. package/node_modules/@types/responselike/node_modules/undici-types/retry-agent.d.ts +0 -8
  356. package/node_modules/@types/responselike/node_modules/undici-types/retry-handler.d.ts +0 -116
  357. package/node_modules/@types/responselike/node_modules/undici-types/util.d.ts +0 -18
  358. package/node_modules/@types/responselike/node_modules/undici-types/webidl.d.ts +0 -222
  359. package/node_modules/@types/responselike/node_modules/undici-types/websocket.d.ts +0 -150
  360. package/node_modules/@types/responselike/package.json +0 -27
  361. package/node_modules/cacheable-lookup/LICENSE +0 -21
  362. package/node_modules/cacheable-lookup/README.md +0 -240
  363. package/node_modules/cacheable-lookup/index.d.ts +0 -139
  364. package/node_modules/cacheable-lookup/package.json +0 -45
  365. package/node_modules/cacheable-lookup/source/index.js +0 -436
  366. package/node_modules/cacheable-request/LICENSE +0 -21
  367. package/node_modules/cacheable-request/README.md +0 -206
  368. package/node_modules/cacheable-request/package.json +0 -56
  369. package/node_modules/cacheable-request/src/index.js +0 -251
  370. package/node_modules/clone-response/LICENSE +0 -21
  371. package/node_modules/clone-response/README.md +0 -62
  372. package/node_modules/clone-response/node_modules/mimic-response/index.js +0 -32
  373. package/node_modules/clone-response/node_modules/mimic-response/license +0 -9
  374. package/node_modules/clone-response/node_modules/mimic-response/package.json +0 -37
  375. package/node_modules/clone-response/node_modules/mimic-response/readme.md +0 -54
  376. package/node_modules/clone-response/package.json +0 -41
  377. package/node_modules/clone-response/src/index.js +0 -17
  378. package/node_modules/decompress-response/index.d.ts +0 -22
  379. package/node_modules/decompress-response/index.js +0 -58
  380. package/node_modules/decompress-response/license +0 -9
  381. package/node_modules/decompress-response/package.json +0 -56
  382. package/node_modules/decompress-response/readme.md +0 -48
  383. package/node_modules/defer-to-connect/LICENSE +0 -21
  384. package/node_modules/defer-to-connect/README.md +0 -38
  385. package/node_modules/defer-to-connect/dist/source/index.d.ts +0 -10
  386. package/node_modules/defer-to-connect/dist/source/index.js +0 -47
  387. package/node_modules/defer-to-connect/package.json +0 -71
  388. package/node_modules/end-of-stream/LICENSE +0 -21
  389. package/node_modules/end-of-stream/README.md +0 -54
  390. package/node_modules/end-of-stream/index.js +0 -94
  391. package/node_modules/end-of-stream/package.json +0 -37
  392. package/node_modules/get-stream/buffer-stream.js +0 -52
  393. package/node_modules/get-stream/index.d.ts +0 -108
  394. package/node_modules/get-stream/index.js +0 -60
  395. package/node_modules/get-stream/license +0 -9
  396. package/node_modules/get-stream/package.json +0 -50
  397. package/node_modules/get-stream/readme.md +0 -124
  398. package/node_modules/got/dist/source/as-promise/create-rejection.d.ts +0 -2
  399. package/node_modules/got/dist/source/as-promise/create-rejection.js +0 -30
  400. package/node_modules/got/dist/source/as-promise/index.d.ts +0 -3
  401. package/node_modules/got/dist/source/as-promise/index.js +0 -176
  402. package/node_modules/got/dist/source/as-promise/normalize-arguments.d.ts +0 -3
  403. package/node_modules/got/dist/source/as-promise/normalize-arguments.js +0 -78
  404. package/node_modules/got/dist/source/as-promise/parse-body.d.ts +0 -3
  405. package/node_modules/got/dist/source/as-promise/parse-body.js +0 -25
  406. package/node_modules/got/dist/source/as-promise/types.d.ts +0 -256
  407. package/node_modules/got/dist/source/as-promise/types.js +0 -42
  408. package/node_modules/got/dist/source/core/calculate-retry-delay.d.ts +0 -5
  409. package/node_modules/got/dist/source/core/calculate-retry-delay.js +0 -29
  410. package/node_modules/got/dist/source/core/index.d.ts +0 -1124
  411. package/node_modules/got/dist/source/core/index.js +0 -1505
  412. package/node_modules/got/dist/source/core/utils/dns-ip-version.d.ts +0 -5
  413. package/node_modules/got/dist/source/core/utils/dns-ip-version.js +0 -17
  414. package/node_modules/got/dist/source/core/utils/get-body-size.d.ts +0 -3
  415. package/node_modules/got/dist/source/core/utils/get-body-size.js +0 -32
  416. package/node_modules/got/dist/source/core/utils/get-buffer.d.ts +0 -4
  417. package/node_modules/got/dist/source/core/utils/get-buffer.js +0 -16
  418. package/node_modules/got/dist/source/core/utils/is-form-data.d.ts +0 -8
  419. package/node_modules/got/dist/source/core/utils/is-form-data.js +0 -4
  420. package/node_modules/got/dist/source/core/utils/is-response-ok.d.ts +0 -2
  421. package/node_modules/got/dist/source/core/utils/is-response-ok.js +0 -8
  422. package/node_modules/got/dist/source/core/utils/options-to-url.d.ts +0 -14
  423. package/node_modules/got/dist/source/core/utils/options-to-url.js +0 -53
  424. package/node_modules/got/dist/source/core/utils/proxy-events.d.ts +0 -3
  425. package/node_modules/got/dist/source/core/utils/proxy-events.js +0 -17
  426. package/node_modules/got/dist/source/core/utils/timed-out.d.ts +0 -29
  427. package/node_modules/got/dist/source/core/utils/timed-out.js +0 -121
  428. package/node_modules/got/dist/source/core/utils/unhandle.d.ts +0 -11
  429. package/node_modules/got/dist/source/core/utils/unhandle.js +0 -22
  430. package/node_modules/got/dist/source/core/utils/url-to-options.d.ts +0 -15
  431. package/node_modules/got/dist/source/core/utils/url-to-options.js +0 -24
  432. package/node_modules/got/dist/source/core/utils/weakable-map.d.ts +0 -8
  433. package/node_modules/got/dist/source/core/utils/weakable-map.js +0 -29
  434. package/node_modules/got/dist/source/create.d.ts +0 -5
  435. package/node_modules/got/dist/source/create.js +0 -240
  436. package/node_modules/got/dist/source/index.d.ts +0 -4
  437. package/node_modules/got/dist/source/index.js +0 -132
  438. package/node_modules/got/dist/source/types.d.ts +0 -344
  439. package/node_modules/got/dist/source/types.js +0 -2
  440. package/node_modules/got/dist/source/utils/deep-freeze.d.ts +0 -1
  441. package/node_modules/got/dist/source/utils/deep-freeze.js +0 -12
  442. package/node_modules/got/dist/source/utils/deprecation-warning.d.ts +0 -2
  443. package/node_modules/got/dist/source/utils/deprecation-warning.js +0 -13
  444. package/node_modules/got/license +0 -9
  445. package/node_modules/got/package.json +0 -131
  446. package/node_modules/got/readme.md +0 -2477
  447. package/node_modules/hpagent/.github/dependabot.yml +0 -8
  448. package/node_modules/hpagent/.github/workflows/build.yml +0 -29
  449. package/node_modules/hpagent/LICENSE +0 -21
  450. package/node_modules/hpagent/README.md +0 -138
  451. package/node_modules/hpagent/index.d.ts +0 -26
  452. package/node_modules/hpagent/index.js +0 -101
  453. package/node_modules/hpagent/index.mjs +0 -5
  454. package/node_modules/hpagent/package.json +0 -49
  455. package/node_modules/hpagent/test/got.test.js +0 -111
  456. package/node_modules/hpagent/test/http-http.test.js +0 -351
  457. package/node_modules/hpagent/test/http-https.test.js +0 -313
  458. package/node_modules/hpagent/test/https-http.test.js +0 -313
  459. package/node_modules/hpagent/test/https-https.test.js +0 -313
  460. package/node_modules/hpagent/test/index.test-d.ts +0 -45
  461. package/node_modules/hpagent/test/needle.test.js +0 -103
  462. package/node_modules/hpagent/test/node-fetch.test.js +0 -103
  463. package/node_modules/hpagent/test/simple-get.test.js +0 -139
  464. package/node_modules/hpagent/test/ssl.cert +0 -19
  465. package/node_modules/hpagent/test/ssl.key +0 -27
  466. package/node_modules/hpagent/test/utils.js +0 -59
  467. package/node_modules/http-cache-semantics/LICENSE +0 -9
  468. package/node_modules/http-cache-semantics/README.md +0 -203
  469. package/node_modules/http-cache-semantics/index.js +0 -674
  470. package/node_modules/http-cache-semantics/package.json +0 -18
  471. package/node_modules/http2-wrapper/LICENSE +0 -21
  472. package/node_modules/http2-wrapper/README.md +0 -470
  473. package/node_modules/http2-wrapper/package.json +0 -54
  474. package/node_modules/http2-wrapper/source/agent.js +0 -670
  475. package/node_modules/http2-wrapper/source/auto.js +0 -149
  476. package/node_modules/http2-wrapper/source/client-request.js +0 -445
  477. package/node_modules/http2-wrapper/source/incoming-message.js +0 -58
  478. package/node_modules/http2-wrapper/source/index.js +0 -28
  479. package/node_modules/http2-wrapper/source/utils/calculate-server-name.js +0 -27
  480. package/node_modules/http2-wrapper/source/utils/errors.js +0 -45
  481. package/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js +0 -13
  482. package/node_modules/http2-wrapper/source/utils/proxy-events.js +0 -7
  483. package/node_modules/http2-wrapper/source/utils/url-to-options.js +0 -25
  484. package/node_modules/json-buffer/.travis.yml +0 -3
  485. package/node_modules/json-buffer/LICENSE +0 -22
  486. package/node_modules/json-buffer/README.md +0 -24
  487. package/node_modules/json-buffer/index.js +0 -58
  488. package/node_modules/json-buffer/package.json +0 -34
  489. package/node_modules/json-buffer/test/index.js +0 -63
  490. package/node_modules/keyv/README.md +0 -429
  491. package/node_modules/keyv/package.json +0 -57
  492. package/node_modules/keyv/src/index.d.ts +0 -112
  493. package/node_modules/keyv/src/index.js +0 -259
  494. package/node_modules/lowercase-keys/index.d.ts +0 -16
  495. package/node_modules/lowercase-keys/index.js +0 -10
  496. package/node_modules/lowercase-keys/license +0 -9
  497. package/node_modules/lowercase-keys/package.json +0 -38
  498. package/node_modules/lowercase-keys/readme.md +0 -32
  499. package/node_modules/mimic-response/index.d.ts +0 -17
  500. package/node_modules/mimic-response/index.js +0 -77
  501. package/node_modules/mimic-response/license +0 -9
  502. package/node_modules/mimic-response/package.json +0 -42
  503. package/node_modules/mimic-response/readme.md +0 -78
  504. package/node_modules/normalize-url/index.d.ts +0 -267
  505. package/node_modules/normalize-url/index.js +0 -216
  506. package/node_modules/normalize-url/license +0 -9
  507. package/node_modules/normalize-url/package.json +0 -50
  508. package/node_modules/normalize-url/readme.md +0 -286
  509. package/node_modules/once/LICENSE +0 -15
  510. package/node_modules/once/README.md +0 -79
  511. package/node_modules/once/once.js +0 -42
  512. package/node_modules/once/package.json +0 -33
  513. package/node_modules/p-cancelable/index.d.ts +0 -176
  514. package/node_modules/p-cancelable/index.js +0 -111
  515. package/node_modules/p-cancelable/license +0 -9
  516. package/node_modules/p-cancelable/package.json +0 -49
  517. package/node_modules/p-cancelable/readme.md +0 -153
  518. package/node_modules/pump/.github/FUNDING.yml +0 -2
  519. package/node_modules/pump/.travis.yml +0 -5
  520. package/node_modules/pump/LICENSE +0 -21
  521. package/node_modules/pump/README.md +0 -74
  522. package/node_modules/pump/SECURITY.md +0 -5
  523. package/node_modules/pump/index.js +0 -86
  524. package/node_modules/pump/package.json +0 -24
  525. package/node_modules/pump/test-browser.js +0 -66
  526. package/node_modules/pump/test-node.js +0 -53
  527. package/node_modules/quick-lru/index.d.ts +0 -97
  528. package/node_modules/quick-lru/index.js +0 -123
  529. package/node_modules/quick-lru/license +0 -9
  530. package/node_modules/quick-lru/package.json +0 -43
  531. package/node_modules/quick-lru/readme.md +0 -111
  532. package/node_modules/resolve-alpn/LICENSE +0 -22
  533. package/node_modules/resolve-alpn/README.md +0 -60
  534. package/node_modules/resolve-alpn/index.js +0 -43
  535. package/node_modules/resolve-alpn/package.json +0 -34
  536. package/node_modules/responselike/LICENSE +0 -19
  537. package/node_modules/responselike/README.md +0 -77
  538. package/node_modules/responselike/package.json +0 -39
  539. package/node_modules/responselike/src/index.js +0 -34
  540. package/node_modules/wrappy/LICENSE +0 -15
  541. package/node_modules/wrappy/README.md +0 -36
  542. package/node_modules/wrappy/package.json +0 -29
  543. package/node_modules/wrappy/wrappy.js +0 -33
  544. /package/{lambda → lambda-src}/.dockerignore +0 -0
  545. /package/{lambda → lambda-src}/Dockerfile +0 -0
  546. /package/{lambda → lambda-src}/go.mod +0 -0
  547. /package/{lambda → lambda-src}/go.sum +0 -0
  548. /package/{lambda → lambda-src}/internal/iolimits/iolimits.go +0 -0
  549. /package/{lambda → lambda-src}/internal/iolimits/iolimits_test.go +0 -0
  550. /package/{lambda → lambda-src}/internal/tarfile/reader.go +0 -0
  551. /package/{lambda → lambda-src}/internal/tarfile/reader_test.go +0 -0
  552. /package/{lambda → lambda-src}/internal/tarfile/s3file.go +0 -0
  553. /package/{lambda → lambda-src}/internal/tarfile/s3file_test.go +0 -0
  554. /package/{lambda → lambda-src}/internal/tarfile/src.go +0 -0
  555. /package/{lambda → lambda-src}/internal/tarfile/types.go +0 -0
  556. /package/{lambda → lambda-src}/main.go +0 -0
  557. /package/{lambda → lambda-src}/main_test.go +0 -0
  558. /package/{lambda → lambda-src}/s3/src.go +0 -0
  559. /package/{lambda → lambda-src}/s3/transport.go +0 -0
  560. /package/{lambda → lambda-src}/s3/transport_test.go +0 -0
  561. /package/{lambda → lambda-src}/utils.go +0 -0
  562. /package/{lambda → lambda-src}/utils_test.go +0 -0
@@ -1,1959 +0,0 @@
1
- /**
2
- * To use the HTTP server and client one must import the `node:http` module.
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
- * ```json
13
- * { "content-length": "123",
14
- * "content-type": "text/plain",
15
- * "connection": "keep-alive",
16
- * "host": "example.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', 'example.com',
38
- * 'accepT', '*' ]
39
- * ```
40
- * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/http.js)
41
- */
42
- declare module "http" {
43
- import * as stream from "node:stream";
44
- import { URL } from "node:url";
45
- import { LookupOptions } from "node:dns";
46
- import { EventEmitter } from "node:events";
47
- import { LookupFunction, Server as NetServer, Socket, TcpSocketConnectOpts } from "node:net";
48
- // incoming headers will never contain number
49
- interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
50
- accept?: string | undefined;
51
- "accept-language"?: string | undefined;
52
- "accept-patch"?: string | undefined;
53
- "accept-ranges"?: string | undefined;
54
- "access-control-allow-credentials"?: string | undefined;
55
- "access-control-allow-headers"?: string | undefined;
56
- "access-control-allow-methods"?: string | undefined;
57
- "access-control-allow-origin"?: string | undefined;
58
- "access-control-expose-headers"?: string | undefined;
59
- "access-control-max-age"?: string | undefined;
60
- "access-control-request-headers"?: string | undefined;
61
- "access-control-request-method"?: string | undefined;
62
- age?: string | undefined;
63
- allow?: string | undefined;
64
- "alt-svc"?: string | undefined;
65
- authorization?: string | undefined;
66
- "cache-control"?: string | undefined;
67
- connection?: string | undefined;
68
- "content-disposition"?: string | undefined;
69
- "content-encoding"?: string | undefined;
70
- "content-language"?: string | undefined;
71
- "content-length"?: string | undefined;
72
- "content-location"?: string | undefined;
73
- "content-range"?: string | undefined;
74
- "content-type"?: string | undefined;
75
- cookie?: string | undefined;
76
- date?: string | undefined;
77
- etag?: string | undefined;
78
- expect?: string | undefined;
79
- expires?: string | undefined;
80
- forwarded?: string | undefined;
81
- from?: string | undefined;
82
- host?: string | undefined;
83
- "if-match"?: string | undefined;
84
- "if-modified-since"?: string | undefined;
85
- "if-none-match"?: string | undefined;
86
- "if-unmodified-since"?: string | undefined;
87
- "last-modified"?: string | undefined;
88
- location?: string | undefined;
89
- origin?: string | undefined;
90
- pragma?: string | undefined;
91
- "proxy-authenticate"?: string | undefined;
92
- "proxy-authorization"?: string | undefined;
93
- "public-key-pins"?: string | undefined;
94
- range?: string | undefined;
95
- referer?: string | undefined;
96
- "retry-after"?: string | undefined;
97
- "sec-websocket-accept"?: string | undefined;
98
- "sec-websocket-extensions"?: string | undefined;
99
- "sec-websocket-key"?: string | undefined;
100
- "sec-websocket-protocol"?: string | undefined;
101
- "sec-websocket-version"?: string | undefined;
102
- "set-cookie"?: string[] | undefined;
103
- "strict-transport-security"?: string | undefined;
104
- tk?: string | undefined;
105
- trailer?: string | undefined;
106
- "transfer-encoding"?: string | undefined;
107
- upgrade?: string | undefined;
108
- "user-agent"?: string | undefined;
109
- vary?: string | undefined;
110
- via?: string | undefined;
111
- warning?: string | undefined;
112
- "www-authenticate"?: string | undefined;
113
- }
114
- // outgoing headers allows numbers (as they are converted internally to strings)
115
- type OutgoingHttpHeader = number | string | string[];
116
- interface OutgoingHttpHeaders extends NodeJS.Dict<OutgoingHttpHeader> {
117
- accept?: string | string[] | undefined;
118
- "accept-charset"?: string | string[] | undefined;
119
- "accept-encoding"?: string | string[] | undefined;
120
- "accept-language"?: string | string[] | undefined;
121
- "accept-ranges"?: string | undefined;
122
- "access-control-allow-credentials"?: string | undefined;
123
- "access-control-allow-headers"?: string | undefined;
124
- "access-control-allow-methods"?: string | undefined;
125
- "access-control-allow-origin"?: string | undefined;
126
- "access-control-expose-headers"?: string | undefined;
127
- "access-control-max-age"?: string | undefined;
128
- "access-control-request-headers"?: string | undefined;
129
- "access-control-request-method"?: string | undefined;
130
- age?: string | undefined;
131
- allow?: string | undefined;
132
- authorization?: string | undefined;
133
- "cache-control"?: string | undefined;
134
- "cdn-cache-control"?: string | undefined;
135
- connection?: string | string[] | undefined;
136
- "content-disposition"?: string | undefined;
137
- "content-encoding"?: string | undefined;
138
- "content-language"?: string | undefined;
139
- "content-length"?: string | number | undefined;
140
- "content-location"?: string | undefined;
141
- "content-range"?: string | undefined;
142
- "content-security-policy"?: string | undefined;
143
- "content-security-policy-report-only"?: string | undefined;
144
- "content-type"?: string | undefined;
145
- cookie?: string | string[] | undefined;
146
- dav?: string | string[] | undefined;
147
- dnt?: string | undefined;
148
- date?: string | undefined;
149
- etag?: string | undefined;
150
- expect?: string | undefined;
151
- expires?: string | undefined;
152
- forwarded?: string | undefined;
153
- from?: string | undefined;
154
- host?: string | undefined;
155
- "if-match"?: string | undefined;
156
- "if-modified-since"?: string | undefined;
157
- "if-none-match"?: string | undefined;
158
- "if-range"?: string | undefined;
159
- "if-unmodified-since"?: string | undefined;
160
- "last-modified"?: string | undefined;
161
- link?: string | string[] | undefined;
162
- location?: string | undefined;
163
- "max-forwards"?: string | undefined;
164
- origin?: string | undefined;
165
- pragma?: string | string[] | undefined;
166
- "proxy-authenticate"?: string | string[] | undefined;
167
- "proxy-authorization"?: string | undefined;
168
- "public-key-pins"?: string | undefined;
169
- "public-key-pins-report-only"?: string | undefined;
170
- range?: string | undefined;
171
- referer?: string | undefined;
172
- "referrer-policy"?: string | undefined;
173
- refresh?: string | undefined;
174
- "retry-after"?: string | undefined;
175
- "sec-websocket-accept"?: string | undefined;
176
- "sec-websocket-extensions"?: string | string[] | undefined;
177
- "sec-websocket-key"?: string | undefined;
178
- "sec-websocket-protocol"?: string | string[] | undefined;
179
- "sec-websocket-version"?: string | undefined;
180
- server?: string | undefined;
181
- "set-cookie"?: string | string[] | undefined;
182
- "strict-transport-security"?: string | undefined;
183
- te?: string | undefined;
184
- trailer?: string | undefined;
185
- "transfer-encoding"?: string | undefined;
186
- "user-agent"?: string | undefined;
187
- upgrade?: string | undefined;
188
- "upgrade-insecure-requests"?: string | undefined;
189
- vary?: string | undefined;
190
- via?: string | string[] | undefined;
191
- warning?: string | undefined;
192
- "www-authenticate"?: string | string[] | undefined;
193
- "x-content-type-options"?: string | undefined;
194
- "x-dns-prefetch-control"?: string | undefined;
195
- "x-frame-options"?: string | undefined;
196
- "x-xss-protection"?: string | undefined;
197
- }
198
- interface ClientRequestArgs {
199
- _defaultAgent?: Agent | undefined;
200
- agent?: Agent | boolean | undefined;
201
- auth?: string | null | undefined;
202
- createConnection?:
203
- | ((
204
- options: ClientRequestArgs,
205
- oncreate: (err: Error | null, socket: stream.Duplex) => void,
206
- ) => stream.Duplex | null | undefined)
207
- | undefined;
208
- defaultPort?: number | string | undefined;
209
- family?: number | undefined;
210
- headers?: OutgoingHttpHeaders | undefined;
211
- hints?: LookupOptions["hints"];
212
- host?: string | null | undefined;
213
- hostname?: string | null | undefined;
214
- insecureHTTPParser?: boolean | undefined;
215
- localAddress?: string | undefined;
216
- localPort?: number | undefined;
217
- lookup?: LookupFunction | undefined;
218
- /**
219
- * @default 16384
220
- */
221
- maxHeaderSize?: number | undefined;
222
- method?: string | undefined;
223
- path?: string | null | undefined;
224
- port?: number | string | null | undefined;
225
- protocol?: string | null | undefined;
226
- setDefaultHeaders?: boolean | undefined;
227
- setHost?: boolean | undefined;
228
- signal?: AbortSignal | undefined;
229
- socketPath?: string | undefined;
230
- timeout?: number | undefined;
231
- uniqueHeaders?: Array<string | string[]> | undefined;
232
- joinDuplicateHeaders?: boolean;
233
- }
234
- interface ServerOptions<
235
- Request extends typeof IncomingMessage = typeof IncomingMessage,
236
- Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse,
237
- > {
238
- /**
239
- * Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`.
240
- */
241
- IncomingMessage?: Request | undefined;
242
- /**
243
- * Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`.
244
- */
245
- ServerResponse?: Response | undefined;
246
- /**
247
- * Sets the timeout value in milliseconds for receiving the entire request from the client.
248
- * @see Server.requestTimeout for more information.
249
- * @default 300000
250
- * @since v18.0.0
251
- */
252
- requestTimeout?: number | undefined;
253
- /**
254
- * It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates.
255
- * @default false
256
- * @since v18.14.0
257
- */
258
- joinDuplicateHeaders?: boolean;
259
- /**
260
- * The number of milliseconds of inactivity a server needs to wait for additional incoming data,
261
- * after it has finished writing the last response, before a socket will be destroyed.
262
- * @see Server.keepAliveTimeout for more information.
263
- * @default 5000
264
- * @since v18.0.0
265
- */
266
- keepAliveTimeout?: number | undefined;
267
- /**
268
- * Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests.
269
- * @default 30000
270
- */
271
- connectionsCheckingInterval?: number | undefined;
272
- /**
273
- * Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`.
274
- * This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`.
275
- * Default: @see stream.getDefaultHighWaterMark().
276
- * @since v20.1.0
277
- */
278
- highWaterMark?: number | undefined;
279
- /**
280
- * Use an insecure HTTP parser that accepts invalid HTTP headers when `true`.
281
- * Using the insecure parser should be avoided.
282
- * See --insecure-http-parser for more information.
283
- * @default false
284
- */
285
- insecureHTTPParser?: boolean | undefined;
286
- /**
287
- * Optionally overrides the value of `--max-http-header-size` for requests received by
288
- * this server, i.e. the maximum length of request headers in bytes.
289
- * @default 16384
290
- * @since v13.3.0
291
- */
292
- maxHeaderSize?: number | undefined;
293
- /**
294
- * If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received.
295
- * @default true
296
- * @since v16.5.0
297
- */
298
- noDelay?: boolean | undefined;
299
- /**
300
- * If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received,
301
- * similarly on what is done in `socket.setKeepAlive([enable][, initialDelay])`.
302
- * @default false
303
- * @since v16.5.0
304
- */
305
- keepAlive?: boolean | undefined;
306
- /**
307
- * If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket.
308
- * @default 0
309
- * @since v16.5.0
310
- */
311
- keepAliveInitialDelay?: number | undefined;
312
- /**
313
- * A list of response headers that should be sent only once.
314
- * If the header's value is an array, the items will be joined using `; `.
315
- */
316
- uniqueHeaders?: Array<string | string[]> | undefined;
317
- }
318
- type RequestListener<
319
- Request extends typeof IncomingMessage = typeof IncomingMessage,
320
- Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse,
321
- > = (req: InstanceType<Request>, res: InstanceType<Response> & { req: InstanceType<Request> }) => void;
322
- /**
323
- * @since v0.1.17
324
- */
325
- class Server<
326
- Request extends typeof IncomingMessage = typeof IncomingMessage,
327
- Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse,
328
- > extends NetServer {
329
- constructor(requestListener?: RequestListener<Request, Response>);
330
- constructor(options: ServerOptions<Request, Response>, requestListener?: RequestListener<Request, Response>);
331
- /**
332
- * Sets the timeout value for sockets, and emits a `'timeout'` event on
333
- * the Server object, passing the socket as an argument, if a timeout
334
- * occurs.
335
- *
336
- * If there is a `'timeout'` event listener on the Server object, then it
337
- * will be called with the timed-out socket as an argument.
338
- *
339
- * By default, the Server does not timeout sockets. However, if a callback
340
- * is assigned to the Server's `'timeout'` event, timeouts must be handled
341
- * explicitly.
342
- * @since v0.9.12
343
- * @param [msecs=0 (no timeout)]
344
- */
345
- setTimeout(msecs?: number, callback?: () => void): this;
346
- setTimeout(callback: () => void): this;
347
- /**
348
- * Limits maximum incoming headers count. If set to 0, no limit will be applied.
349
- * @since v0.7.0
350
- */
351
- maxHeadersCount: number | null;
352
- /**
353
- * The maximum number of requests socket can handle
354
- * before closing keep alive connection.
355
- *
356
- * A value of `0` will disable the limit.
357
- *
358
- * When the limit is reached it will set the `Connection` header value to `close`,
359
- * but will not actually close the connection, subsequent requests sent
360
- * after the limit is reached will get `503 Service Unavailable` as a response.
361
- * @since v16.10.0
362
- */
363
- maxRequestsPerSocket: number | null;
364
- /**
365
- * The number of milliseconds of inactivity before a socket is presumed
366
- * to have timed out.
367
- *
368
- * A value of `0` will disable the timeout behavior on incoming connections.
369
- *
370
- * The socket timeout logic is set up on connection, so changing this
371
- * value only affects new connections to the server, not any existing connections.
372
- * @since v0.9.12
373
- */
374
- timeout: number;
375
- /**
376
- * Limit the amount of time the parser will wait to receive the complete HTTP
377
- * headers.
378
- *
379
- * If the timeout expires, the server responds with status 408 without
380
- * forwarding the request to the request listener and then closes the connection.
381
- *
382
- * It must be set to a non-zero value (e.g. 120 seconds) to protect against
383
- * potential Denial-of-Service attacks in case the server is deployed without a
384
- * reverse proxy in front.
385
- * @since v11.3.0, v10.14.0
386
- */
387
- headersTimeout: number;
388
- /**
389
- * The number of milliseconds of inactivity a server needs to wait for additional
390
- * incoming data, after it has finished writing the last response, before a socket
391
- * will be destroyed. If the server receives new data before the keep-alive
392
- * timeout has fired, it will reset the regular inactivity timeout, i.e., `server.timeout`.
393
- *
394
- * A value of `0` will disable the keep-alive timeout behavior on incoming
395
- * connections.
396
- * A value of `0` makes the http server behave similarly to Node.js versions prior
397
- * to 8.0.0, which did not have a keep-alive timeout.
398
- *
399
- * The socket timeout logic is set up on connection, so changing this value only
400
- * affects new connections to the server, not any existing connections.
401
- * @since v8.0.0
402
- */
403
- keepAliveTimeout: number;
404
- /**
405
- * Sets the timeout value in milliseconds for receiving the entire request from
406
- * the client.
407
- *
408
- * If the timeout expires, the server responds with status 408 without
409
- * forwarding the request to the request listener and then closes the connection.
410
- *
411
- * It must be set to a non-zero value (e.g. 120 seconds) to protect against
412
- * potential Denial-of-Service attacks in case the server is deployed without a
413
- * reverse proxy in front.
414
- * @since v14.11.0
415
- */
416
- requestTimeout: number;
417
- /**
418
- * Closes all connections connected to this server.
419
- * @since v18.2.0
420
- */
421
- closeAllConnections(): void;
422
- /**
423
- * Closes all connections connected to this server which are not sending a request
424
- * or waiting for a response.
425
- * @since v18.2.0
426
- */
427
- closeIdleConnections(): void;
428
- addListener(event: string, listener: (...args: any[]) => void): this;
429
- addListener(event: "close", listener: () => void): this;
430
- addListener(event: "connection", listener: (socket: Socket) => void): this;
431
- addListener(event: "error", listener: (err: Error) => void): this;
432
- addListener(event: "listening", listener: () => void): this;
433
- addListener(event: "checkContinue", listener: RequestListener<Request, Response>): this;
434
- addListener(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
435
- addListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
436
- addListener(
437
- event: "connect",
438
- listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
439
- ): this;
440
- addListener(event: "dropRequest", listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
441
- addListener(event: "request", listener: RequestListener<Request, Response>): this;
442
- addListener(
443
- event: "upgrade",
444
- listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
445
- ): this;
446
- emit(event: string, ...args: any[]): boolean;
447
- emit(event: "close"): boolean;
448
- emit(event: "connection", socket: Socket): boolean;
449
- emit(event: "error", err: Error): boolean;
450
- emit(event: "listening"): boolean;
451
- emit(
452
- event: "checkContinue",
453
- req: InstanceType<Request>,
454
- res: InstanceType<Response> & { req: InstanceType<Request> },
455
- ): boolean;
456
- emit(
457
- event: "checkExpectation",
458
- req: InstanceType<Request>,
459
- res: InstanceType<Response> & { req: InstanceType<Request> },
460
- ): boolean;
461
- emit(event: "clientError", err: Error, socket: stream.Duplex): boolean;
462
- emit(event: "connect", req: InstanceType<Request>, socket: stream.Duplex, head: Buffer): boolean;
463
- emit(event: "dropRequest", req: InstanceType<Request>, socket: stream.Duplex): boolean;
464
- emit(
465
- event: "request",
466
- req: InstanceType<Request>,
467
- res: InstanceType<Response> & { req: InstanceType<Request> },
468
- ): boolean;
469
- emit(event: "upgrade", req: InstanceType<Request>, socket: stream.Duplex, head: Buffer): boolean;
470
- on(event: string, listener: (...args: any[]) => void): this;
471
- on(event: "close", listener: () => void): this;
472
- on(event: "connection", listener: (socket: Socket) => void): this;
473
- on(event: "error", listener: (err: Error) => void): this;
474
- on(event: "listening", listener: () => void): this;
475
- on(event: "checkContinue", listener: RequestListener<Request, Response>): this;
476
- on(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
477
- on(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
478
- on(event: "connect", listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
479
- on(event: "dropRequest", listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
480
- on(event: "request", listener: RequestListener<Request, Response>): this;
481
- on(event: "upgrade", listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void): this;
482
- once(event: string, listener: (...args: any[]) => void): this;
483
- once(event: "close", listener: () => void): this;
484
- once(event: "connection", listener: (socket: Socket) => void): this;
485
- once(event: "error", listener: (err: Error) => void): this;
486
- once(event: "listening", listener: () => void): this;
487
- once(event: "checkContinue", listener: RequestListener<Request, Response>): this;
488
- once(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
489
- once(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
490
- once(
491
- event: "connect",
492
- listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
493
- ): this;
494
- once(event: "dropRequest", listener: (req: InstanceType<Request>, socket: stream.Duplex) => void): this;
495
- once(event: "request", listener: RequestListener<Request, Response>): this;
496
- once(
497
- event: "upgrade",
498
- listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
499
- ): this;
500
- prependListener(event: string, listener: (...args: any[]) => void): this;
501
- prependListener(event: "close", listener: () => void): this;
502
- prependListener(event: "connection", listener: (socket: Socket) => void): this;
503
- prependListener(event: "error", listener: (err: Error) => void): this;
504
- prependListener(event: "listening", listener: () => void): this;
505
- prependListener(event: "checkContinue", listener: RequestListener<Request, Response>): this;
506
- prependListener(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
507
- prependListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
508
- prependListener(
509
- event: "connect",
510
- listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
511
- ): this;
512
- prependListener(
513
- event: "dropRequest",
514
- listener: (req: InstanceType<Request>, socket: stream.Duplex) => void,
515
- ): this;
516
- prependListener(event: "request", listener: RequestListener<Request, Response>): this;
517
- prependListener(
518
- event: "upgrade",
519
- listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
520
- ): this;
521
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
522
- prependOnceListener(event: "close", listener: () => void): this;
523
- prependOnceListener(event: "connection", listener: (socket: Socket) => void): this;
524
- prependOnceListener(event: "error", listener: (err: Error) => void): this;
525
- prependOnceListener(event: "listening", listener: () => void): this;
526
- prependOnceListener(event: "checkContinue", listener: RequestListener<Request, Response>): this;
527
- prependOnceListener(event: "checkExpectation", listener: RequestListener<Request, Response>): this;
528
- prependOnceListener(event: "clientError", listener: (err: Error, socket: stream.Duplex) => void): this;
529
- prependOnceListener(
530
- event: "connect",
531
- listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
532
- ): this;
533
- prependOnceListener(
534
- event: "dropRequest",
535
- listener: (req: InstanceType<Request>, socket: stream.Duplex) => void,
536
- ): this;
537
- prependOnceListener(event: "request", listener: RequestListener<Request, Response>): this;
538
- prependOnceListener(
539
- event: "upgrade",
540
- listener: (req: InstanceType<Request>, socket: stream.Duplex, head: Buffer) => void,
541
- ): this;
542
- }
543
- /**
544
- * This class serves as the parent class of {@link ClientRequest} and {@link ServerResponse}. It is an abstract outgoing message from
545
- * the perspective of the participants of an HTTP transaction.
546
- * @since v0.1.17
547
- */
548
- class OutgoingMessage<Request extends IncomingMessage = IncomingMessage> extends stream.Writable {
549
- readonly req: Request;
550
- chunkedEncoding: boolean;
551
- shouldKeepAlive: boolean;
552
- useChunkedEncodingByDefault: boolean;
553
- sendDate: boolean;
554
- /**
555
- * @deprecated Use `writableEnded` instead.
556
- */
557
- finished: boolean;
558
- /**
559
- * Read-only. `true` if the headers were sent, otherwise `false`.
560
- * @since v0.9.3
561
- */
562
- readonly headersSent: boolean;
563
- /**
564
- * Alias of `outgoingMessage.socket`.
565
- * @since v0.3.0
566
- * @deprecated Since v15.12.0,v14.17.1 - Use `socket` instead.
567
- */
568
- readonly connection: Socket | null;
569
- /**
570
- * Reference to the underlying socket. Usually, users will not want to access
571
- * this property.
572
- *
573
- * After calling `outgoingMessage.end()`, this property will be nulled.
574
- * @since v0.3.0
575
- */
576
- readonly socket: Socket | null;
577
- constructor();
578
- /**
579
- * Once a socket is associated with the message and is connected, `socket.setTimeout()` will be called with `msecs` as the first parameter.
580
- * @since v0.9.12
581
- * @param callback Optional function to be called when a timeout occurs. Same as binding to the `timeout` event.
582
- */
583
- setTimeout(msecs: number, callback?: () => void): this;
584
- /**
585
- * Sets a single header value. If the header already exists in the to-be-sent
586
- * headers, its value will be replaced. Use an array of strings to send multiple
587
- * headers with the same name.
588
- * @since v0.4.0
589
- * @param name Header name
590
- * @param value Header value
591
- */
592
- setHeader(name: string, value: number | string | readonly string[]): this;
593
- /**
594
- * Sets multiple header values for implicit headers. headers must be an instance of
595
- * `Headers` or `Map`, if a header already exists in the to-be-sent headers, its
596
- * value will be replaced.
597
- *
598
- * ```js
599
- * const headers = new Headers({ foo: 'bar' });
600
- * outgoingMessage.setHeaders(headers);
601
- * ```
602
- *
603
- * or
604
- *
605
- * ```js
606
- * const headers = new Map([['foo', 'bar']]);
607
- * outgoingMessage.setHeaders(headers);
608
- * ```
609
- *
610
- * When headers have been set with `outgoingMessage.setHeaders()`, they will be
611
- * merged with any headers passed to `response.writeHead()`, with the headers passed
612
- * to `response.writeHead()` given precedence.
613
- *
614
- * ```js
615
- * // Returns content-type = text/plain
616
- * const server = http.createServer((req, res) => {
617
- * const headers = new Headers({ 'Content-Type': 'text/html' });
618
- * res.setHeaders(headers);
619
- * res.writeHead(200, { 'Content-Type': 'text/plain' });
620
- * res.end('ok');
621
- * });
622
- * ```
623
- *
624
- * @since v19.6.0, v18.15.0
625
- * @param name Header name
626
- * @param value Header value
627
- */
628
- setHeaders(headers: Headers | Map<string, number | string | readonly string[]>): this;
629
- /**
630
- * Append a single header value to the header object.
631
- *
632
- * If the value is an array, this is equivalent to calling this method multiple
633
- * times.
634
- *
635
- * If there were no previous values for the header, this is equivalent to calling `outgoingMessage.setHeader(name, value)`.
636
- *
637
- * Depending of the value of `options.uniqueHeaders` when the client request or the
638
- * server were created, this will end up in the header being sent multiple times or
639
- * a single time with values joined using `; `.
640
- * @since v18.3.0, v16.17.0
641
- * @param name Header name
642
- * @param value Header value
643
- */
644
- appendHeader(name: string, value: string | readonly string[]): this;
645
- /**
646
- * Gets the value of the HTTP header with the given name. If that header is not
647
- * set, the returned value will be `undefined`.
648
- * @since v0.4.0
649
- * @param name Name of header
650
- */
651
- getHeader(name: string): number | string | string[] | undefined;
652
- /**
653
- * Returns a shallow copy of the current outgoing headers. Since a shallow
654
- * copy is used, array values may be mutated without additional calls to
655
- * various header-related HTTP module methods. The keys of the returned
656
- * object are the header names and the values are the respective header
657
- * values. All header names are lowercase.
658
- *
659
- * The object returned by the `outgoingMessage.getHeaders()` method does
660
- * not prototypically inherit from the JavaScript `Object`. This means that
661
- * typical `Object` methods such as `obj.toString()`, `obj.hasOwnProperty()`,
662
- * and others are not defined and will not work.
663
- *
664
- * ```js
665
- * outgoingMessage.setHeader('Foo', 'bar');
666
- * outgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);
667
- *
668
- * const headers = outgoingMessage.getHeaders();
669
- * // headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] }
670
- * ```
671
- * @since v7.7.0
672
- */
673
- getHeaders(): OutgoingHttpHeaders;
674
- /**
675
- * Returns an array containing the unique names of the current outgoing headers.
676
- * All names are lowercase.
677
- * @since v7.7.0
678
- */
679
- getHeaderNames(): string[];
680
- /**
681
- * Returns `true` if the header identified by `name` is currently set in the
682
- * outgoing headers. The header name is case-insensitive.
683
- *
684
- * ```js
685
- * const hasContentType = outgoingMessage.hasHeader('content-type');
686
- * ```
687
- * @since v7.7.0
688
- */
689
- hasHeader(name: string): boolean;
690
- /**
691
- * Removes a header that is queued for implicit sending.
692
- *
693
- * ```js
694
- * outgoingMessage.removeHeader('Content-Encoding');
695
- * ```
696
- * @since v0.4.0
697
- * @param name Header name
698
- */
699
- removeHeader(name: string): void;
700
- /**
701
- * Adds HTTP trailers (headers but at the end of the message) to the message.
702
- *
703
- * Trailers will **only** be emitted if the message is chunked encoded. If not,
704
- * the trailers will be silently discarded.
705
- *
706
- * HTTP requires the `Trailer` header to be sent to emit trailers,
707
- * with a list of header field names in its value, e.g.
708
- *
709
- * ```js
710
- * message.writeHead(200, { 'Content-Type': 'text/plain',
711
- * 'Trailer': 'Content-MD5' });
712
- * message.write(fileData);
713
- * message.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' });
714
- * message.end();
715
- * ```
716
- *
717
- * Attempting to set a header field name or value that contains invalid characters
718
- * will result in a `TypeError` being thrown.
719
- * @since v0.3.0
720
- */
721
- addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
722
- /**
723
- * Flushes the message headers.
724
- *
725
- * For efficiency reason, Node.js normally buffers the message headers
726
- * until `outgoingMessage.end()` is called or the first chunk of message data
727
- * is written. It then tries to pack the headers and data into a single TCP
728
- * packet.
729
- *
730
- * It is usually desired (it saves a TCP round-trip), but not when the first
731
- * data is not sent until possibly much later. `outgoingMessage.flushHeaders()` bypasses the optimization and kickstarts the message.
732
- * @since v1.6.0
733
- */
734
- flushHeaders(): void;
735
- }
736
- /**
737
- * This object is created internally by an HTTP server, not by the user. It is
738
- * passed as the second parameter to the `'request'` event.
739
- * @since v0.1.17
740
- */
741
- class ServerResponse<Request extends IncomingMessage = IncomingMessage> extends OutgoingMessage<Request> {
742
- /**
743
- * When using implicit headers (not calling `response.writeHead()` explicitly),
744
- * this property controls the status code that will be sent to the client when
745
- * the headers get flushed.
746
- *
747
- * ```js
748
- * response.statusCode = 404;
749
- * ```
750
- *
751
- * After response header was sent to the client, this property indicates the
752
- * status code which was sent out.
753
- * @since v0.4.0
754
- */
755
- statusCode: number;
756
- /**
757
- * When using implicit headers (not calling `response.writeHead()` explicitly),
758
- * this property controls the status message that will be sent to the client when
759
- * the headers get flushed. If this is left as `undefined` then the standard
760
- * message for the status code will be used.
761
- *
762
- * ```js
763
- * response.statusMessage = 'Not found';
764
- * ```
765
- *
766
- * After response header was sent to the client, this property indicates the
767
- * status message which was sent out.
768
- * @since v0.11.8
769
- */
770
- statusMessage: string;
771
- /**
772
- * If set to `true`, Node.js will check whether the `Content-Length` header value and the size of the body, in bytes, are equal.
773
- * Mismatching the `Content-Length` header value will result
774
- * in an `Error` being thrown, identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`.
775
- * @since v18.10.0, v16.18.0
776
- */
777
- strictContentLength: boolean;
778
- constructor(req: Request);
779
- assignSocket(socket: Socket): void;
780
- detachSocket(socket: Socket): void;
781
- /**
782
- * Sends an HTTP/1.1 100 Continue message to the client, indicating that
783
- * the request body should be sent. See the `'checkContinue'` event on `Server`.
784
- * @since v0.3.0
785
- */
786
- writeContinue(callback?: () => void): void;
787
- /**
788
- * Sends an HTTP/1.1 103 Early Hints message to the client with a Link header,
789
- * indicating that the user agent can preload/preconnect the linked resources.
790
- * The `hints` is an object containing the values of headers to be sent with
791
- * early hints message. The optional `callback` argument will be called when
792
- * the response message has been written.
793
- *
794
- * **Example**
795
- *
796
- * ```js
797
- * const earlyHintsLink = '</styles.css>; rel=preload; as=style';
798
- * response.writeEarlyHints({
799
- * 'link': earlyHintsLink,
800
- * });
801
- *
802
- * const earlyHintsLinks = [
803
- * '</styles.css>; rel=preload; as=style',
804
- * '</scripts.js>; rel=preload; as=script',
805
- * ];
806
- * response.writeEarlyHints({
807
- * 'link': earlyHintsLinks,
808
- * 'x-trace-id': 'id for diagnostics',
809
- * });
810
- *
811
- * const earlyHintsCallback = () => console.log('early hints message sent');
812
- * response.writeEarlyHints({
813
- * 'link': earlyHintsLinks,
814
- * }, earlyHintsCallback);
815
- * ```
816
- * @since v18.11.0
817
- * @param hints An object containing the values of headers
818
- * @param callback Will be called when the response message has been written
819
- */
820
- writeEarlyHints(hints: Record<string, string | string[]>, callback?: () => void): void;
821
- /**
822
- * Sends a response header to the request. The status code is a 3-digit HTTP
823
- * status code, like `404`. The last argument, `headers`, are the response headers.
824
- * Optionally one can give a human-readable `statusMessage` as the second
825
- * argument.
826
- *
827
- * `headers` may be an `Array` where the keys and values are in the same list.
828
- * It is _not_ a list of tuples. So, the even-numbered offsets are key values,
829
- * and the odd-numbered offsets are the associated values. The array is in the same
830
- * format as `request.rawHeaders`.
831
- *
832
- * Returns a reference to the `ServerResponse`, so that calls can be chained.
833
- *
834
- * ```js
835
- * const body = 'hello world';
836
- * response
837
- * .writeHead(200, {
838
- * 'Content-Length': Buffer.byteLength(body),
839
- * 'Content-Type': 'text/plain',
840
- * })
841
- * .end(body);
842
- * ```
843
- *
844
- * This method must only be called once on a message and it must
845
- * be called before `response.end()` is called.
846
- *
847
- * If `response.write()` or `response.end()` are called before calling
848
- * this, the implicit/mutable headers will be calculated and call this function.
849
- *
850
- * When headers have been set with `response.setHeader()`, they will be merged
851
- * with any headers passed to `response.writeHead()`, with the headers passed
852
- * to `response.writeHead()` given precedence.
853
- *
854
- * If this method is called and `response.setHeader()` has not been called,
855
- * it will directly write the supplied header values onto the network channel
856
- * without caching internally, and the `response.getHeader()` on the header
857
- * will not yield the expected result. If progressive population of headers is
858
- * desired with potential future retrieval and modification, use `response.setHeader()` instead.
859
- *
860
- * ```js
861
- * // Returns content-type = text/plain
862
- * const server = http.createServer((req, res) => {
863
- * res.setHeader('Content-Type', 'text/html');
864
- * res.setHeader('X-Foo', 'bar');
865
- * res.writeHead(200, { 'Content-Type': 'text/plain' });
866
- * res.end('ok');
867
- * });
868
- * ```
869
- *
870
- * `Content-Length` is read in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes. Node.js
871
- * will check whether `Content-Length` and the length of the body which has
872
- * been transmitted are equal or not.
873
- *
874
- * Attempting to set a header field name or value that contains invalid characters
875
- * will result in a \[`Error`\]\[\] being thrown.
876
- * @since v0.1.30
877
- */
878
- writeHead(
879
- statusCode: number,
880
- statusMessage?: string,
881
- headers?: OutgoingHttpHeaders | OutgoingHttpHeader[],
882
- ): this;
883
- writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
884
- /**
885
- * Sends a HTTP/1.1 102 Processing message to the client, indicating that
886
- * the request body should be sent.
887
- * @since v10.0.0
888
- */
889
- writeProcessing(): void;
890
- }
891
- interface InformationEvent {
892
- statusCode: number;
893
- statusMessage: string;
894
- httpVersion: string;
895
- httpVersionMajor: number;
896
- httpVersionMinor: number;
897
- headers: IncomingHttpHeaders;
898
- rawHeaders: string[];
899
- }
900
- /**
901
- * This object is created internally and returned from {@link request}. It
902
- * represents an _in-progress_ request whose header has already been queued. The
903
- * header is still mutable using the `setHeader(name, value)`, `getHeader(name)`, `removeHeader(name)` API. The actual header will
904
- * be sent along with the first data chunk or when calling `request.end()`.
905
- *
906
- * To get the response, add a listener for `'response'` to the request object. `'response'` will be emitted from the request object when the response
907
- * headers have been received. The `'response'` event is executed with one
908
- * argument which is an instance of {@link IncomingMessage}.
909
- *
910
- * During the `'response'` event, one can add listeners to the
911
- * response object; particularly to listen for the `'data'` event.
912
- *
913
- * If no `'response'` handler is added, then the response will be
914
- * entirely discarded. However, if a `'response'` event handler is added,
915
- * then the data from the response object **must** be consumed, either by
916
- * calling `response.read()` whenever there is a `'readable'` event, or
917
- * by adding a `'data'` handler, or by calling the `.resume()` method.
918
- * Until the data is consumed, the `'end'` event will not fire. Also, until
919
- * the data is read it will consume memory that can eventually lead to a
920
- * 'process out of memory' error.
921
- *
922
- * For backward compatibility, `res` will only emit `'error'` if there is an `'error'` listener registered.
923
- *
924
- * Set `Content-Length` header to limit the response body size.
925
- * If `response.strictContentLength` is set to `true`, mismatching the `Content-Length` header value will result in an `Error` being thrown,
926
- * identified by `code:``'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`.
927
- *
928
- * `Content-Length` value should be in bytes, not characters. Use `Buffer.byteLength()` to determine the length of the body in bytes.
929
- * @since v0.1.17
930
- */
931
- class ClientRequest extends OutgoingMessage {
932
- /**
933
- * The `request.aborted` property will be `true` if the request has
934
- * been aborted.
935
- * @since v0.11.14
936
- * @deprecated Since v17.0.0, v16.12.0 - Check `destroyed` instead.
937
- */
938
- aborted: boolean;
939
- /**
940
- * The request host.
941
- * @since v14.5.0, v12.19.0
942
- */
943
- host: string;
944
- /**
945
- * The request protocol.
946
- * @since v14.5.0, v12.19.0
947
- */
948
- protocol: string;
949
- /**
950
- * When sending request through a keep-alive enabled agent, the underlying socket
951
- * might be reused. But if server closes connection at unfortunate time, client
952
- * may run into a 'ECONNRESET' error.
953
- *
954
- * ```js
955
- * import http from 'node:http';
956
- *
957
- * // Server has a 5 seconds keep-alive timeout by default
958
- * http
959
- * .createServer((req, res) => {
960
- * res.write('hello\n');
961
- * res.end();
962
- * })
963
- * .listen(3000);
964
- *
965
- * setInterval(() => {
966
- * // Adapting a keep-alive agent
967
- * http.get('http://localhost:3000', { agent }, (res) => {
968
- * res.on('data', (data) => {
969
- * // Do nothing
970
- * });
971
- * });
972
- * }, 5000); // Sending request on 5s interval so it's easy to hit idle timeout
973
- * ```
974
- *
975
- * By marking a request whether it reused socket or not, we can do
976
- * automatic error retry base on it.
977
- *
978
- * ```js
979
- * import http from 'node:http';
980
- * const agent = new http.Agent({ keepAlive: true });
981
- *
982
- * function retriableRequest() {
983
- * const req = http
984
- * .get('http://localhost:3000', { agent }, (res) => {
985
- * // ...
986
- * })
987
- * .on('error', (err) => {
988
- * // Check if retry is needed
989
- * if (req.reusedSocket &#x26;&#x26; err.code === 'ECONNRESET') {
990
- * retriableRequest();
991
- * }
992
- * });
993
- * }
994
- *
995
- * retriableRequest();
996
- * ```
997
- * @since v13.0.0, v12.16.0
998
- */
999
- reusedSocket: boolean;
1000
- /**
1001
- * Limits maximum response headers count. If set to 0, no limit will be applied.
1002
- */
1003
- maxHeadersCount: number;
1004
- constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
1005
- /**
1006
- * The request method.
1007
- * @since v0.1.97
1008
- */
1009
- method: string;
1010
- /**
1011
- * The request path.
1012
- * @since v0.4.0
1013
- */
1014
- path: string;
1015
- /**
1016
- * Marks the request as aborting. Calling this will cause remaining data
1017
- * in the response to be dropped and the socket to be destroyed.
1018
- * @since v0.3.8
1019
- * @deprecated Since v14.1.0,v13.14.0 - Use `destroy` instead.
1020
- */
1021
- abort(): void;
1022
- onSocket(socket: Socket): void;
1023
- /**
1024
- * Once a socket is assigned to this request and is connected `socket.setTimeout()` will be called.
1025
- * @since v0.5.9
1026
- * @param timeout Milliseconds before a request times out.
1027
- * @param callback Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event.
1028
- */
1029
- setTimeout(timeout: number, callback?: () => void): this;
1030
- /**
1031
- * Once a socket is assigned to this request and is connected `socket.setNoDelay()` will be called.
1032
- * @since v0.5.9
1033
- */
1034
- setNoDelay(noDelay?: boolean): void;
1035
- /**
1036
- * Once a socket is assigned to this request and is connected `socket.setKeepAlive()` will be called.
1037
- * @since v0.5.9
1038
- */
1039
- setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
1040
- /**
1041
- * Returns an array containing the unique names of the current outgoing raw
1042
- * headers. Header names are returned with their exact casing being set.
1043
- *
1044
- * ```js
1045
- * request.setHeader('Foo', 'bar');
1046
- * request.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);
1047
- *
1048
- * const headerNames = request.getRawHeaderNames();
1049
- * // headerNames === ['Foo', 'Set-Cookie']
1050
- * ```
1051
- * @since v15.13.0, v14.17.0
1052
- */
1053
- getRawHeaderNames(): string[];
1054
- /**
1055
- * @deprecated
1056
- */
1057
- addListener(event: "abort", listener: () => void): this;
1058
- addListener(
1059
- event: "connect",
1060
- listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
1061
- ): this;
1062
- addListener(event: "continue", listener: () => void): this;
1063
- addListener(event: "information", listener: (info: InformationEvent) => void): this;
1064
- addListener(event: "response", listener: (response: IncomingMessage) => void): this;
1065
- addListener(event: "socket", listener: (socket: Socket) => void): this;
1066
- addListener(event: "timeout", listener: () => void): this;
1067
- addListener(
1068
- event: "upgrade",
1069
- listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
1070
- ): this;
1071
- addListener(event: "close", listener: () => void): this;
1072
- addListener(event: "drain", listener: () => void): this;
1073
- addListener(event: "error", listener: (err: Error) => void): this;
1074
- addListener(event: "finish", listener: () => void): this;
1075
- addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
1076
- addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
1077
- addListener(event: string | symbol, listener: (...args: any[]) => void): this;
1078
- /**
1079
- * @deprecated
1080
- */
1081
- on(event: "abort", listener: () => void): this;
1082
- on(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
1083
- on(event: "continue", listener: () => void): this;
1084
- on(event: "information", listener: (info: InformationEvent) => void): this;
1085
- on(event: "response", listener: (response: IncomingMessage) => void): this;
1086
- on(event: "socket", listener: (socket: Socket) => void): this;
1087
- on(event: "timeout", listener: () => void): this;
1088
- on(event: "upgrade", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
1089
- on(event: "close", listener: () => void): this;
1090
- on(event: "drain", listener: () => void): this;
1091
- on(event: "error", listener: (err: Error) => void): this;
1092
- on(event: "finish", listener: () => void): this;
1093
- on(event: "pipe", listener: (src: stream.Readable) => void): this;
1094
- on(event: "unpipe", listener: (src: stream.Readable) => void): this;
1095
- on(event: string | symbol, listener: (...args: any[]) => void): this;
1096
- /**
1097
- * @deprecated
1098
- */
1099
- once(event: "abort", listener: () => void): this;
1100
- once(event: "connect", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
1101
- once(event: "continue", listener: () => void): this;
1102
- once(event: "information", listener: (info: InformationEvent) => void): this;
1103
- once(event: "response", listener: (response: IncomingMessage) => void): this;
1104
- once(event: "socket", listener: (socket: Socket) => void): this;
1105
- once(event: "timeout", listener: () => void): this;
1106
- once(event: "upgrade", listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
1107
- once(event: "close", listener: () => void): this;
1108
- once(event: "drain", listener: () => void): this;
1109
- once(event: "error", listener: (err: Error) => void): this;
1110
- once(event: "finish", listener: () => void): this;
1111
- once(event: "pipe", listener: (src: stream.Readable) => void): this;
1112
- once(event: "unpipe", listener: (src: stream.Readable) => void): this;
1113
- once(event: string | symbol, listener: (...args: any[]) => void): this;
1114
- /**
1115
- * @deprecated
1116
- */
1117
- prependListener(event: "abort", listener: () => void): this;
1118
- prependListener(
1119
- event: "connect",
1120
- listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
1121
- ): this;
1122
- prependListener(event: "continue", listener: () => void): this;
1123
- prependListener(event: "information", listener: (info: InformationEvent) => void): this;
1124
- prependListener(event: "response", listener: (response: IncomingMessage) => void): this;
1125
- prependListener(event: "socket", listener: (socket: Socket) => void): this;
1126
- prependListener(event: "timeout", listener: () => void): this;
1127
- prependListener(
1128
- event: "upgrade",
1129
- listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
1130
- ): this;
1131
- prependListener(event: "close", listener: () => void): this;
1132
- prependListener(event: "drain", listener: () => void): this;
1133
- prependListener(event: "error", listener: (err: Error) => void): this;
1134
- prependListener(event: "finish", listener: () => void): this;
1135
- prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
1136
- prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
1137
- prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
1138
- /**
1139
- * @deprecated
1140
- */
1141
- prependOnceListener(event: "abort", listener: () => void): this;
1142
- prependOnceListener(
1143
- event: "connect",
1144
- listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
1145
- ): this;
1146
- prependOnceListener(event: "continue", listener: () => void): this;
1147
- prependOnceListener(event: "information", listener: (info: InformationEvent) => void): this;
1148
- prependOnceListener(event: "response", listener: (response: IncomingMessage) => void): this;
1149
- prependOnceListener(event: "socket", listener: (socket: Socket) => void): this;
1150
- prependOnceListener(event: "timeout", listener: () => void): this;
1151
- prependOnceListener(
1152
- event: "upgrade",
1153
- listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void,
1154
- ): this;
1155
- prependOnceListener(event: "close", listener: () => void): this;
1156
- prependOnceListener(event: "drain", listener: () => void): this;
1157
- prependOnceListener(event: "error", listener: (err: Error) => void): this;
1158
- prependOnceListener(event: "finish", listener: () => void): this;
1159
- prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
1160
- prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
1161
- prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
1162
- }
1163
- /**
1164
- * 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
1165
- * access response
1166
- * status, headers, and data.
1167
- *
1168
- * Different from its `socket` value which is a subclass of `stream.Duplex`, the `IncomingMessage` itself extends `stream.Readable` and is created separately to
1169
- * parse and emit the incoming HTTP headers and payload, as the underlying socket
1170
- * may be reused multiple times in case of keep-alive.
1171
- * @since v0.1.17
1172
- */
1173
- class IncomingMessage extends stream.Readable {
1174
- constructor(socket: Socket);
1175
- /**
1176
- * The `message.aborted` property will be `true` if the request has
1177
- * been aborted.
1178
- * @since v10.1.0
1179
- * @deprecated Since v17.0.0,v16.12.0 - Check `message.destroyed` from <a href="stream.html#class-streamreadable" class="type">stream.Readable</a>.
1180
- */
1181
- aborted: boolean;
1182
- /**
1183
- * In case of server request, the HTTP version sent by the client. In the case of
1184
- * client response, the HTTP version of the connected-to server.
1185
- * Probably either `'1.1'` or `'1.0'`.
1186
- *
1187
- * Also `message.httpVersionMajor` is the first integer and `message.httpVersionMinor` is the second.
1188
- * @since v0.1.1
1189
- */
1190
- httpVersion: string;
1191
- httpVersionMajor: number;
1192
- httpVersionMinor: number;
1193
- /**
1194
- * The `message.complete` property will be `true` if a complete HTTP message has
1195
- * been received and successfully parsed.
1196
- *
1197
- * This property is particularly useful as a means of determining if a client or
1198
- * server fully transmitted a message before a connection was terminated:
1199
- *
1200
- * ```js
1201
- * const req = http.request({
1202
- * host: '127.0.0.1',
1203
- * port: 8080,
1204
- * method: 'POST',
1205
- * }, (res) => {
1206
- * res.resume();
1207
- * res.on('end', () => {
1208
- * if (!res.complete)
1209
- * console.error(
1210
- * 'The connection was terminated while the message was still being sent');
1211
- * });
1212
- * });
1213
- * ```
1214
- * @since v0.3.0
1215
- */
1216
- complete: boolean;
1217
- /**
1218
- * Alias for `message.socket`.
1219
- * @since v0.1.90
1220
- * @deprecated Since v16.0.0 - Use `socket`.
1221
- */
1222
- connection: Socket;
1223
- /**
1224
- * The `net.Socket` object associated with the connection.
1225
- *
1226
- * With HTTPS support, use `request.socket.getPeerCertificate()` to obtain the
1227
- * client's authentication details.
1228
- *
1229
- * This property is guaranteed to be an instance of the `net.Socket` class,
1230
- * a subclass of `stream.Duplex`, unless the user specified a socket
1231
- * type other than `net.Socket` or internally nulled.
1232
- * @since v0.3.0
1233
- */
1234
- socket: Socket;
1235
- /**
1236
- * The request/response headers object.
1237
- *
1238
- * Key-value pairs of header names and values. Header names are lower-cased.
1239
- *
1240
- * ```js
1241
- * // Prints something like:
1242
- * //
1243
- * // { 'user-agent': 'curl/7.22.0',
1244
- * // host: '127.0.0.1:8000',
1245
- * // accept: '*' }
1246
- * console.log(request.headers);
1247
- * ```
1248
- *
1249
- * Duplicates in raw headers are handled in the following ways, depending on the
1250
- * header name:
1251
- *
1252
- * * Duplicates of `age`, `authorization`, `content-length`, `content-type`, `etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`, `last-modified`, `location`,
1253
- * `max-forwards`, `proxy-authorization`, `referer`, `retry-after`, `server`, or `user-agent` are discarded.
1254
- * To allow duplicate values of the headers listed above to be joined,
1255
- * use the option `joinDuplicateHeaders` in {@link request} and {@link createServer}. See RFC 9110 Section 5.3 for more
1256
- * information.
1257
- * * `set-cookie` is always an array. Duplicates are added to the array.
1258
- * * For duplicate `cookie` headers, the values are joined together with `; `.
1259
- * * For all other headers, the values are joined together with `, `.
1260
- * @since v0.1.5
1261
- */
1262
- headers: IncomingHttpHeaders;
1263
- /**
1264
- * Similar to `message.headers`, but there is no join logic and the values are
1265
- * always arrays of strings, even for headers received just once.
1266
- *
1267
- * ```js
1268
- * // Prints something like:
1269
- * //
1270
- * // { 'user-agent': ['curl/7.22.0'],
1271
- * // host: ['127.0.0.1:8000'],
1272
- * // accept: ['*'] }
1273
- * console.log(request.headersDistinct);
1274
- * ```
1275
- * @since v18.3.0, v16.17.0
1276
- */
1277
- headersDistinct: NodeJS.Dict<string[]>;
1278
- /**
1279
- * The raw request/response headers list exactly as they were received.
1280
- *
1281
- * The keys and values are in the same list. It is _not_ a
1282
- * list of tuples. So, the even-numbered offsets are key values, and the
1283
- * odd-numbered offsets are the associated values.
1284
- *
1285
- * Header names are not lowercased, and duplicates are not merged.
1286
- *
1287
- * ```js
1288
- * // Prints something like:
1289
- * //
1290
- * // [ 'user-agent',
1291
- * // 'this is invalid because there can be only one',
1292
- * // 'User-Agent',
1293
- * // 'curl/7.22.0',
1294
- * // 'Host',
1295
- * // '127.0.0.1:8000',
1296
- * // 'ACCEPT',
1297
- * // '*' ]
1298
- * console.log(request.rawHeaders);
1299
- * ```
1300
- * @since v0.11.6
1301
- */
1302
- rawHeaders: string[];
1303
- /**
1304
- * The request/response trailers object. Only populated at the `'end'` event.
1305
- * @since v0.3.0
1306
- */
1307
- trailers: NodeJS.Dict<string>;
1308
- /**
1309
- * Similar to `message.trailers`, but there is no join logic and the values are
1310
- * always arrays of strings, even for headers received just once.
1311
- * Only populated at the `'end'` event.
1312
- * @since v18.3.0, v16.17.0
1313
- */
1314
- trailersDistinct: NodeJS.Dict<string[]>;
1315
- /**
1316
- * The raw request/response trailer keys and values exactly as they were
1317
- * received. Only populated at the `'end'` event.
1318
- * @since v0.11.6
1319
- */
1320
- rawTrailers: string[];
1321
- /**
1322
- * Calls `message.socket.setTimeout(msecs, callback)`.
1323
- * @since v0.5.9
1324
- */
1325
- setTimeout(msecs: number, callback?: () => void): this;
1326
- /**
1327
- * **Only valid for request obtained from {@link Server}.**
1328
- *
1329
- * The request method as a string. Read only. Examples: `'GET'`, `'DELETE'`.
1330
- * @since v0.1.1
1331
- */
1332
- method?: string | undefined;
1333
- /**
1334
- * **Only valid for request obtained from {@link Server}.**
1335
- *
1336
- * Request URL string. This contains only the URL that is present in the actual
1337
- * HTTP request. Take the following request:
1338
- *
1339
- * ```http
1340
- * GET /status?name=ryan HTTP/1.1
1341
- * Accept: text/plain
1342
- * ```
1343
- *
1344
- * To parse the URL into its parts:
1345
- *
1346
- * ```js
1347
- * new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`);
1348
- * ```
1349
- *
1350
- * When `request.url` is `'/status?name=ryan'` and `process.env.HOST` is undefined:
1351
- *
1352
- * ```console
1353
- * $ node
1354
- * > new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`);
1355
- * URL {
1356
- * href: 'http://localhost/status?name=ryan',
1357
- * origin: 'http://localhost',
1358
- * protocol: 'http:',
1359
- * username: '',
1360
- * password: '',
1361
- * host: 'localhost',
1362
- * hostname: 'localhost',
1363
- * port: '',
1364
- * pathname: '/status',
1365
- * search: '?name=ryan',
1366
- * searchParams: URLSearchParams { 'name' => 'ryan' },
1367
- * hash: ''
1368
- * }
1369
- * ```
1370
- *
1371
- * Ensure that you set `process.env.HOST` to the server's host name, or consider replacing this part entirely. If using `req.headers.host`, ensure proper
1372
- * validation is used, as clients may specify a custom `Host` header.
1373
- * @since v0.1.90
1374
- */
1375
- url?: string | undefined;
1376
- /**
1377
- * **Only valid for response obtained from {@link ClientRequest}.**
1378
- *
1379
- * The 3-digit HTTP response status code. E.G. `404`.
1380
- * @since v0.1.1
1381
- */
1382
- statusCode?: number | undefined;
1383
- /**
1384
- * **Only valid for response obtained from {@link ClientRequest}.**
1385
- *
1386
- * The HTTP response status message (reason phrase). E.G. `OK` or `Internal Server Error`.
1387
- * @since v0.11.10
1388
- */
1389
- statusMessage?: string | undefined;
1390
- /**
1391
- * 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
1392
- * as an argument to any listeners on the event.
1393
- * @since v0.3.0
1394
- */
1395
- destroy(error?: Error): this;
1396
- }
1397
- interface AgentOptions extends Partial<TcpSocketConnectOpts> {
1398
- /**
1399
- * Keep sockets around in a pool to be used by other requests in the future. Default = false
1400
- */
1401
- keepAlive?: boolean | undefined;
1402
- /**
1403
- * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
1404
- * Only relevant if keepAlive is set to true.
1405
- */
1406
- keepAliveMsecs?: number | undefined;
1407
- /**
1408
- * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
1409
- */
1410
- maxSockets?: number | undefined;
1411
- /**
1412
- * Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity.
1413
- */
1414
- maxTotalSockets?: number | undefined;
1415
- /**
1416
- * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
1417
- */
1418
- maxFreeSockets?: number | undefined;
1419
- /**
1420
- * Socket timeout in milliseconds. This will set the timeout after the socket is connected.
1421
- */
1422
- timeout?: number | undefined;
1423
- /**
1424
- * Scheduling strategy to apply when picking the next free socket to use.
1425
- * @default `lifo`
1426
- */
1427
- scheduling?: "fifo" | "lifo" | undefined;
1428
- }
1429
- /**
1430
- * An `Agent` is responsible for managing connection persistence
1431
- * and reuse for HTTP clients. It maintains a queue of pending requests
1432
- * for a given host and port, reusing a single socket connection for each
1433
- * until the queue is empty, at which time the socket is either destroyed
1434
- * or put into a pool where it is kept to be used again for requests to the
1435
- * same host and port. Whether it is destroyed or pooled depends on the `keepAlive` `option`.
1436
- *
1437
- * Pooled connections have TCP Keep-Alive enabled for them, but servers may
1438
- * still close idle connections, in which case they will be removed from the
1439
- * pool and a new connection will be made when a new HTTP request is made for
1440
- * that host and port. Servers may also refuse to allow multiple requests
1441
- * over the same connection, in which case the connection will have to be
1442
- * remade for every request and cannot be pooled. The `Agent` will still make
1443
- * the requests to that server, but each one will occur over a new connection.
1444
- *
1445
- * When a connection is closed by the client or the server, it is removed
1446
- * from the pool. Any unused sockets in the pool will be unrefed so as not
1447
- * to keep the Node.js process running when there are no outstanding requests.
1448
- * (see `socket.unref()`).
1449
- *
1450
- * It is good practice, to `destroy()` an `Agent` instance when it is no
1451
- * longer in use, because unused sockets consume OS resources.
1452
- *
1453
- * Sockets are removed from an agent when the socket emits either
1454
- * a `'close'` event or an `'agentRemove'` event. When intending to keep one
1455
- * HTTP request open for a long time without keeping it in the agent, something
1456
- * like the following may be done:
1457
- *
1458
- * ```js
1459
- * http.get(options, (res) => {
1460
- * // Do stuff
1461
- * }).on('socket', (socket) => {
1462
- * socket.emit('agentRemove');
1463
- * });
1464
- * ```
1465
- *
1466
- * 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
1467
- * will be used
1468
- * for the client connection.
1469
- *
1470
- * `agent:false`:
1471
- *
1472
- * ```js
1473
- * http.get({
1474
- * hostname: 'localhost',
1475
- * port: 80,
1476
- * path: '/',
1477
- * agent: false, // Create a new agent just for this one request
1478
- * }, (res) => {
1479
- * // Do stuff with response
1480
- * });
1481
- * ```
1482
- *
1483
- * `options` in [`socket.connect()`](https://nodejs.org/docs/latest-v22.x/api/net.html#socketconnectoptions-connectlistener) are also supported.
1484
- *
1485
- * To configure any of them, a custom {@link Agent} instance must be created.
1486
- *
1487
- * ```js
1488
- * import http from 'node:http';
1489
- * const keepAliveAgent = new http.Agent({ keepAlive: true });
1490
- * options.agent = keepAliveAgent;
1491
- * http.request(options, onResponseCallback)
1492
- * ```
1493
- * @since v0.3.4
1494
- */
1495
- class Agent extends EventEmitter {
1496
- /**
1497
- * By default set to 256. For agents with `keepAlive` enabled, this
1498
- * sets the maximum number of sockets that will be left open in the free
1499
- * state.
1500
- * @since v0.11.7
1501
- */
1502
- maxFreeSockets: number;
1503
- /**
1504
- * By default set to `Infinity`. Determines how many concurrent sockets the agent
1505
- * can have open per origin. Origin is the returned value of `agent.getName()`.
1506
- * @since v0.3.6
1507
- */
1508
- maxSockets: number;
1509
- /**
1510
- * By default set to `Infinity`. Determines how many concurrent sockets the agent
1511
- * can have open. Unlike `maxSockets`, this parameter applies across all origins.
1512
- * @since v14.5.0, v12.19.0
1513
- */
1514
- maxTotalSockets: number;
1515
- /**
1516
- * An object which contains arrays of sockets currently awaiting use by
1517
- * the agent when `keepAlive` is enabled. Do not modify.
1518
- *
1519
- * Sockets in the `freeSockets` list will be automatically destroyed and
1520
- * removed from the array on `'timeout'`.
1521
- * @since v0.11.4
1522
- */
1523
- readonly freeSockets: NodeJS.ReadOnlyDict<Socket[]>;
1524
- /**
1525
- * An object which contains arrays of sockets currently in use by the
1526
- * agent. Do not modify.
1527
- * @since v0.3.6
1528
- */
1529
- readonly sockets: NodeJS.ReadOnlyDict<Socket[]>;
1530
- /**
1531
- * An object which contains queues of requests that have not yet been assigned to
1532
- * sockets. Do not modify.
1533
- * @since v0.5.9
1534
- */
1535
- readonly requests: NodeJS.ReadOnlyDict<IncomingMessage[]>;
1536
- constructor(opts?: AgentOptions);
1537
- /**
1538
- * Destroy any sockets that are currently in use by the agent.
1539
- *
1540
- * It is usually not necessary to do this. However, if using an
1541
- * agent with `keepAlive` enabled, then it is best to explicitly shut down
1542
- * the agent when it is no longer needed. Otherwise,
1543
- * sockets might stay open for quite a long time before the server
1544
- * terminates them.
1545
- * @since v0.11.4
1546
- */
1547
- destroy(): void;
1548
- }
1549
- const METHODS: string[];
1550
- const STATUS_CODES: {
1551
- [errorCode: number]: string | undefined;
1552
- [errorCode: string]: string | undefined;
1553
- };
1554
- /**
1555
- * Returns a new instance of {@link Server}.
1556
- *
1557
- * The `requestListener` is a function which is automatically
1558
- * added to the `'request'` event.
1559
- *
1560
- * ```js
1561
- * import http from 'node:http';
1562
- *
1563
- * // Create a local server to receive data from
1564
- * const server = http.createServer((req, res) => {
1565
- * res.writeHead(200, { 'Content-Type': 'application/json' });
1566
- * res.end(JSON.stringify({
1567
- * data: 'Hello World!',
1568
- * }));
1569
- * });
1570
- *
1571
- * server.listen(8000);
1572
- * ```
1573
- *
1574
- * ```js
1575
- * import http from 'node:http';
1576
- *
1577
- * // Create a local server to receive data from
1578
- * const server = http.createServer();
1579
- *
1580
- * // Listen to the request event
1581
- * server.on('request', (request, res) => {
1582
- * res.writeHead(200, { 'Content-Type': 'application/json' });
1583
- * res.end(JSON.stringify({
1584
- * data: 'Hello World!',
1585
- * }));
1586
- * });
1587
- *
1588
- * server.listen(8000);
1589
- * ```
1590
- * @since v0.1.13
1591
- */
1592
- function createServer<
1593
- Request extends typeof IncomingMessage = typeof IncomingMessage,
1594
- Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse,
1595
- >(requestListener?: RequestListener<Request, Response>): Server<Request, Response>;
1596
- function createServer<
1597
- Request extends typeof IncomingMessage = typeof IncomingMessage,
1598
- Response extends typeof ServerResponse<InstanceType<Request>> = typeof ServerResponse,
1599
- >(
1600
- options: ServerOptions<Request, Response>,
1601
- requestListener?: RequestListener<Request, Response>,
1602
- ): Server<Request, Response>;
1603
- // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly,
1604
- // create interface RequestOptions would make the naming more clear to developers
1605
- interface RequestOptions extends ClientRequestArgs {}
1606
- /**
1607
- * `options` in `socket.connect()` are also supported.
1608
- *
1609
- * Node.js maintains several connections per server to make HTTP requests.
1610
- * This function allows one to transparently issue requests.
1611
- *
1612
- * `url` can be a string or a `URL` object. If `url` is a
1613
- * string, it is automatically parsed with `new URL()`. If it is a `URL` object, it will be automatically converted to an ordinary `options` object.
1614
- *
1615
- * If both `url` and `options` are specified, the objects are merged, with the `options` properties taking precedence.
1616
- *
1617
- * The optional `callback` parameter will be added as a one-time listener for
1618
- * the `'response'` event.
1619
- *
1620
- * `http.request()` returns an instance of the {@link ClientRequest} class. The `ClientRequest` instance is a writable stream. If one needs to
1621
- * upload a file with a POST request, then write to the `ClientRequest` object.
1622
- *
1623
- * ```js
1624
- * import http from 'node:http';
1625
- * import { Buffer } from 'node:buffer';
1626
- *
1627
- * const postData = JSON.stringify({
1628
- * 'msg': 'Hello World!',
1629
- * });
1630
- *
1631
- * const options = {
1632
- * hostname: 'www.google.com',
1633
- * port: 80,
1634
- * path: '/upload',
1635
- * method: 'POST',
1636
- * headers: {
1637
- * 'Content-Type': 'application/json',
1638
- * 'Content-Length': Buffer.byteLength(postData),
1639
- * },
1640
- * };
1641
- *
1642
- * const req = http.request(options, (res) => {
1643
- * console.log(`STATUS: ${res.statusCode}`);
1644
- * console.log(`HEADERS: ${JSON.stringify(res.headers)}`);
1645
- * res.setEncoding('utf8');
1646
- * res.on('data', (chunk) => {
1647
- * console.log(`BODY: ${chunk}`);
1648
- * });
1649
- * res.on('end', () => {
1650
- * console.log('No more data in response.');
1651
- * });
1652
- * });
1653
- *
1654
- * req.on('error', (e) => {
1655
- * console.error(`problem with request: ${e.message}`);
1656
- * });
1657
- *
1658
- * // Write data to request body
1659
- * req.write(postData);
1660
- * req.end();
1661
- * ```
1662
- *
1663
- * In the example `req.end()` was called. With `http.request()` one
1664
- * must always call `req.end()` to signify the end of the request -
1665
- * even if there is no data being written to the request body.
1666
- *
1667
- * If any error is encountered during the request (be that with DNS resolution,
1668
- * TCP level errors, or actual HTTP parse errors) an `'error'` event is emitted
1669
- * on the returned request object. As with all `'error'` events, if no listeners
1670
- * are registered the error will be thrown.
1671
- *
1672
- * There are a few special headers that should be noted.
1673
- *
1674
- * * Sending a 'Connection: keep-alive' will notify Node.js that the connection to
1675
- * the server should be persisted until the next request.
1676
- * * Sending a 'Content-Length' header will disable the default chunked encoding.
1677
- * * Sending an 'Expect' header will immediately send the request headers.
1678
- * Usually, when sending 'Expect: 100-continue', both a timeout and a listener
1679
- * for the `'continue'` event should be set. See RFC 2616 Section 8.2.3 for more
1680
- * information.
1681
- * * Sending an Authorization header will override using the `auth` option
1682
- * to compute basic authentication.
1683
- *
1684
- * Example using a `URL` as `options`:
1685
- *
1686
- * ```js
1687
- * const options = new URL('http://abc:xyz@example.com');
1688
- *
1689
- * const req = http.request(options, (res) => {
1690
- * // ...
1691
- * });
1692
- * ```
1693
- *
1694
- * In a successful request, the following events will be emitted in the following
1695
- * order:
1696
- *
1697
- * * `'socket'`
1698
- * * `'response'`
1699
- * * `'data'` any number of times, on the `res` object
1700
- * (`'data'` will not be emitted at all if the response body is empty, for
1701
- * instance, in most redirects)
1702
- * * `'end'` on the `res` object
1703
- * * `'close'`
1704
- *
1705
- * In the case of a connection error, the following events will be emitted:
1706
- *
1707
- * * `'socket'`
1708
- * * `'error'`
1709
- * * `'close'`
1710
- *
1711
- * In the case of a premature connection close before the response is received,
1712
- * the following events will be emitted in the following order:
1713
- *
1714
- * * `'socket'`
1715
- * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`
1716
- * * `'close'`
1717
- *
1718
- * In the case of a premature connection close after the response is received,
1719
- * the following events will be emitted in the following order:
1720
- *
1721
- * * `'socket'`
1722
- * * `'response'`
1723
- * * `'data'` any number of times, on the `res` object
1724
- * * (connection closed here)
1725
- * * `'aborted'` on the `res` object
1726
- * * `'close'`
1727
- * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'`
1728
- * * `'close'` on the `res` object
1729
- *
1730
- * If `req.destroy()` is called before a socket is assigned, the following
1731
- * events will be emitted in the following order:
1732
- *
1733
- * * (`req.destroy()` called here)
1734
- * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called
1735
- * * `'close'`
1736
- *
1737
- * If `req.destroy()` is called before the connection succeeds, the following
1738
- * events will be emitted in the following order:
1739
- *
1740
- * * `'socket'`
1741
- * * (`req.destroy()` called here)
1742
- * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called
1743
- * * `'close'`
1744
- *
1745
- * If `req.destroy()` is called after the response is received, the following
1746
- * events will be emitted in the following order:
1747
- *
1748
- * * `'socket'`
1749
- * * `'response'`
1750
- * * `'data'` any number of times, on the `res` object
1751
- * * (`req.destroy()` called here)
1752
- * * `'aborted'` on the `res` object
1753
- * * `'close'`
1754
- * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'`, or the error with which `req.destroy()` was called
1755
- * * `'close'` on the `res` object
1756
- *
1757
- * If `req.abort()` is called before a socket is assigned, the following
1758
- * events will be emitted in the following order:
1759
- *
1760
- * * (`req.abort()` called here)
1761
- * * `'abort'`
1762
- * * `'close'`
1763
- *
1764
- * If `req.abort()` is called before the connection succeeds, the following
1765
- * events will be emitted in the following order:
1766
- *
1767
- * * `'socket'`
1768
- * * (`req.abort()` called here)
1769
- * * `'abort'`
1770
- * * `'error'` with an error with message `'Error: socket hang up'` and code `'ECONNRESET'`
1771
- * * `'close'`
1772
- *
1773
- * If `req.abort()` is called after the response is received, the following
1774
- * events will be emitted in the following order:
1775
- *
1776
- * * `'socket'`
1777
- * * `'response'`
1778
- * * `'data'` any number of times, on the `res` object
1779
- * * (`req.abort()` called here)
1780
- * * `'abort'`
1781
- * * `'aborted'` on the `res` object
1782
- * * `'error'` on the `res` object with an error with message `'Error: aborted'` and code `'ECONNRESET'`.
1783
- * * `'close'`
1784
- * * `'close'` on the `res` object
1785
- *
1786
- * Setting the `timeout` option or using the `setTimeout()` function will
1787
- * not abort the request or do anything besides add a `'timeout'` event.
1788
- *
1789
- * Passing an `AbortSignal` and then calling `abort()` on the corresponding `AbortController` will behave the same way as calling `.destroy()` on the
1790
- * request. Specifically, the `'error'` event will be emitted with an error with
1791
- * the message `'AbortError: The operation was aborted'`, the code `'ABORT_ERR'` and the `cause`, if one was provided.
1792
- * @since v0.3.6
1793
- */
1794
- function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
1795
- function request(
1796
- url: string | URL,
1797
- options: RequestOptions,
1798
- callback?: (res: IncomingMessage) => void,
1799
- ): ClientRequest;
1800
- /**
1801
- * Since most requests are GET requests without bodies, Node.js provides this
1802
- * convenience method. The only difference between this method and {@link request} is that it sets the method to GET by default and calls `req.end()` automatically. The callback must take care to
1803
- * consume the response
1804
- * data for reasons stated in {@link ClientRequest} section.
1805
- *
1806
- * The `callback` is invoked with a single argument that is an instance of {@link IncomingMessage}.
1807
- *
1808
- * JSON fetching example:
1809
- *
1810
- * ```js
1811
- * http.get('http://localhost:8000/', (res) => {
1812
- * const { statusCode } = res;
1813
- * const contentType = res.headers['content-type'];
1814
- *
1815
- * let error;
1816
- * // Any 2xx status code signals a successful response but
1817
- * // here we're only checking for 200.
1818
- * if (statusCode !== 200) {
1819
- * error = new Error('Request Failed.\n' +
1820
- * `Status Code: ${statusCode}`);
1821
- * } else if (!/^application\/json/.test(contentType)) {
1822
- * error = new Error('Invalid content-type.\n' +
1823
- * `Expected application/json but received ${contentType}`);
1824
- * }
1825
- * if (error) {
1826
- * console.error(error.message);
1827
- * // Consume response data to free up memory
1828
- * res.resume();
1829
- * return;
1830
- * }
1831
- *
1832
- * res.setEncoding('utf8');
1833
- * let rawData = '';
1834
- * res.on('data', (chunk) => { rawData += chunk; });
1835
- * res.on('end', () => {
1836
- * try {
1837
- * const parsedData = JSON.parse(rawData);
1838
- * console.log(parsedData);
1839
- * } catch (e) {
1840
- * console.error(e.message);
1841
- * }
1842
- * });
1843
- * }).on('error', (e) => {
1844
- * console.error(`Got error: ${e.message}`);
1845
- * });
1846
- *
1847
- * // Create a local server to receive data from
1848
- * const server = http.createServer((req, res) => {
1849
- * res.writeHead(200, { 'Content-Type': 'application/json' });
1850
- * res.end(JSON.stringify({
1851
- * data: 'Hello World!',
1852
- * }));
1853
- * });
1854
- *
1855
- * server.listen(8000);
1856
- * ```
1857
- * @since v0.3.6
1858
- * @param options Accepts the same `options` as {@link request}, with the method set to GET by default.
1859
- */
1860
- function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
1861
- function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
1862
- /**
1863
- * Performs the low-level validations on the provided `name` that are done when `res.setHeader(name, value)` is called.
1864
- *
1865
- * Passing illegal value as `name` will result in a `TypeError` being thrown,
1866
- * identified by `code: 'ERR_INVALID_HTTP_TOKEN'`.
1867
- *
1868
- * It is not necessary to use this method before passing headers to an HTTP request
1869
- * or response. The HTTP module will automatically validate such headers.
1870
- *
1871
- * Example:
1872
- *
1873
- * ```js
1874
- * import { validateHeaderName } from 'node:http';
1875
- *
1876
- * try {
1877
- * validateHeaderName('');
1878
- * } catch (err) {
1879
- * console.error(err instanceof TypeError); // --> true
1880
- * console.error(err.code); // --> 'ERR_INVALID_HTTP_TOKEN'
1881
- * console.error(err.message); // --> 'Header name must be a valid HTTP token [""]'
1882
- * }
1883
- * ```
1884
- * @since v14.3.0
1885
- * @param [label='Header name'] Label for error message.
1886
- */
1887
- function validateHeaderName(name: string): void;
1888
- /**
1889
- * Performs the low-level validations on the provided `value` that are done when `res.setHeader(name, value)` is called.
1890
- *
1891
- * Passing illegal value as `value` will result in a `TypeError` being thrown.
1892
- *
1893
- * * Undefined value error is identified by `code: 'ERR_HTTP_INVALID_HEADER_VALUE'`.
1894
- * * Invalid value character error is identified by `code: 'ERR_INVALID_CHAR'`.
1895
- *
1896
- * It is not necessary to use this method before passing headers to an HTTP request
1897
- * or response. The HTTP module will automatically validate such headers.
1898
- *
1899
- * Examples:
1900
- *
1901
- * ```js
1902
- * import { validateHeaderValue } from 'node:http';
1903
- *
1904
- * try {
1905
- * validateHeaderValue('x-my-header', undefined);
1906
- * } catch (err) {
1907
- * console.error(err instanceof TypeError); // --> true
1908
- * console.error(err.code === 'ERR_HTTP_INVALID_HEADER_VALUE'); // --> true
1909
- * console.error(err.message); // --> 'Invalid value "undefined" for header "x-my-header"'
1910
- * }
1911
- *
1912
- * try {
1913
- * validateHeaderValue('x-my-header', 'oʊmɪɡə');
1914
- * } catch (err) {
1915
- * console.error(err instanceof TypeError); // --> true
1916
- * console.error(err.code === 'ERR_INVALID_CHAR'); // --> true
1917
- * console.error(err.message); // --> 'Invalid character in header content ["x-my-header"]'
1918
- * }
1919
- * ```
1920
- * @since v14.3.0
1921
- * @param name Header name
1922
- * @param value Header value
1923
- */
1924
- function validateHeaderValue(name: string, value: string): void;
1925
- /**
1926
- * Set the maximum number of idle HTTP parsers.
1927
- * @since v18.8.0, v16.18.0
1928
- * @param [max=1000]
1929
- */
1930
- function setMaxIdleHTTPParsers(max: number): void;
1931
- /**
1932
- * Global instance of `Agent` which is used as the default for all HTTP client
1933
- * requests. Diverges from a default `Agent` configuration by having `keepAlive`
1934
- * enabled and a `timeout` of 5 seconds.
1935
- * @since v0.5.9
1936
- */
1937
- let globalAgent: Agent;
1938
- /**
1939
- * Read-only property specifying the maximum allowed size of HTTP headers in bytes.
1940
- * Defaults to 16KB. Configurable using the `--max-http-header-size` CLI option.
1941
- */
1942
- const maxHeaderSize: number;
1943
- /**
1944
- * A browser-compatible implementation of [WebSocket](https://nodejs.org/docs/latest/api/http.html#websocket).
1945
- * @since v22.5.0
1946
- */
1947
- const WebSocket: import("undici-types").WebSocket;
1948
- /**
1949
- * @since v22.5.0
1950
- */
1951
- const CloseEvent: import("undici-types").CloseEvent;
1952
- /**
1953
- * @since v22.5.0
1954
- */
1955
- const MessageEvent: import("undici-types").MessageEvent;
1956
- }
1957
- declare module "node:http" {
1958
- export * from "http";
1959
- }