cdk-ecr-deployment 0.0.76 → 0.0.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/.gitattributes +20 -21
  2. package/.jsii +43 -35
  3. package/lambda/Dockerfile +25 -0
  4. package/lambda/install.js +64 -0
  5. package/lib/index.js +40 -23
  6. package/node_modules/@sindresorhus/is/dist/index.d.ts +225 -0
  7. package/node_modules/@sindresorhus/is/dist/index.js +427 -0
  8. package/node_modules/@sindresorhus/is/dist/types.d.ts +24 -0
  9. package/node_modules/@sindresorhus/is/dist/types.js +3 -0
  10. package/node_modules/@sindresorhus/is/license +9 -0
  11. package/node_modules/@sindresorhus/is/package.json +96 -0
  12. package/node_modules/@sindresorhus/is/readme.md +628 -0
  13. package/node_modules/@szmarczak/http-timer/LICENSE +21 -0
  14. package/node_modules/@szmarczak/http-timer/README.md +93 -0
  15. package/node_modules/@szmarczak/http-timer/dist/source/index.d.ts +32 -0
  16. package/node_modules/@szmarczak/http-timer/dist/source/index.js +126 -0
  17. package/node_modules/@szmarczak/http-timer/package.json +72 -0
  18. package/node_modules/@types/cacheable-request/LICENSE +21 -0
  19. package/node_modules/@types/cacheable-request/README.md +16 -0
  20. package/node_modules/@types/cacheable-request/index.d.ts +137 -0
  21. package/node_modules/@types/cacheable-request/node_modules/@types/node/LICENSE +21 -0
  22. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +16 -0
  23. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert/strict.d.ts +8 -0
  24. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +912 -0
  25. package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +497 -0
  26. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +2142 -0
  27. package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +1366 -0
  28. package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +414 -0
  29. package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +412 -0
  30. package/node_modules/@types/cacheable-request/node_modules/@types/node/constants.d.ts +18 -0
  31. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +3307 -0
  32. package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +545 -0
  33. package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +134 -0
  34. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +368 -0
  35. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +654 -0
  36. package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +169 -0
  37. package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +623 -0
  38. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +1091 -0
  39. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +3784 -0
  40. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +284 -0
  41. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.global.d.ts +1 -0
  42. package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +1369 -0
  43. package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +2100 -0
  44. package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +391 -0
  45. package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +131 -0
  46. package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +2745 -0
  47. package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +114 -0
  48. package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +783 -0
  49. package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +455 -0
  50. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +230 -0
  51. package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +172 -0
  52. package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +555 -0
  53. package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +1481 -0
  54. package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +117 -0
  55. package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +131 -0
  56. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +543 -0
  57. package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +424 -0
  58. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +24 -0
  59. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +42 -0
  60. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +391 -0
  61. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +1249 -0
  62. package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +67 -0
  63. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +68 -0
  64. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +94 -0
  65. package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +1019 -0
  66. package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +161 -0
  67. package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +204 -0
  68. package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +821 -0
  69. package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +1594 -0
  70. package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +378 -0
  71. package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +507 -0
  72. package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +158 -0
  73. package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +649 -0
  74. package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +517 -0
  75. package/node_modules/@types/cacheable-request/package.json +35 -0
  76. package/node_modules/@types/http-cache-semantics/LICENSE +21 -0
  77. package/node_modules/@types/http-cache-semantics/README.md +16 -0
  78. package/node_modules/@types/http-cache-semantics/index.d.ts +170 -0
  79. package/node_modules/@types/http-cache-semantics/package.json +25 -0
  80. package/node_modules/@types/keyv/LICENSE +21 -0
  81. package/node_modules/@types/keyv/README.md +16 -0
  82. package/node_modules/@types/keyv/index.d.ts +77 -0
  83. package/node_modules/@types/keyv/node_modules/@types/node/LICENSE +21 -0
  84. package/node_modules/@types/keyv/node_modules/@types/node/README.md +16 -0
  85. package/node_modules/@types/keyv/node_modules/@types/node/assert/strict.d.ts +8 -0
  86. package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +912 -0
  87. package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +497 -0
  88. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +2142 -0
  89. package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +1366 -0
  90. package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +414 -0
  91. package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +412 -0
  92. package/node_modules/@types/keyv/node_modules/@types/node/constants.d.ts +18 -0
  93. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +3307 -0
  94. package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +545 -0
  95. package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +134 -0
  96. package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +368 -0
  97. package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +654 -0
  98. package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +169 -0
  99. package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +623 -0
  100. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +1091 -0
  101. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +3784 -0
  102. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +284 -0
  103. package/node_modules/@types/keyv/node_modules/@types/node/globals.global.d.ts +1 -0
  104. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +1369 -0
  105. package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +2100 -0
  106. package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +391 -0
  107. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +131 -0
  108. package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +2745 -0
  109. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +114 -0
  110. package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +783 -0
  111. package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +455 -0
  112. package/node_modules/@types/keyv/node_modules/@types/node/package.json +230 -0
  113. package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +172 -0
  114. package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +555 -0
  115. package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +1481 -0
  116. package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +117 -0
  117. package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +131 -0
  118. package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +543 -0
  119. package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +424 -0
  120. package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +24 -0
  121. package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +42 -0
  122. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +391 -0
  123. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +1249 -0
  124. package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +67 -0
  125. package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +68 -0
  126. package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +94 -0
  127. package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +1019 -0
  128. package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +161 -0
  129. package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +204 -0
  130. package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +821 -0
  131. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +1594 -0
  132. package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +378 -0
  133. package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +507 -0
  134. package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +158 -0
  135. package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +649 -0
  136. package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +517 -0
  137. package/node_modules/@types/keyv/package.json +32 -0
  138. package/node_modules/@types/responselike/LICENSE +21 -0
  139. package/node_modules/@types/responselike/README.md +16 -0
  140. package/node_modules/@types/responselike/index.d.ts +34 -0
  141. package/node_modules/@types/responselike/node_modules/@types/node/LICENSE +21 -0
  142. package/node_modules/@types/responselike/node_modules/@types/node/README.md +16 -0
  143. package/node_modules/@types/responselike/node_modules/@types/node/assert/strict.d.ts +8 -0
  144. package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +912 -0
  145. package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +497 -0
  146. package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +2142 -0
  147. package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +1366 -0
  148. package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +414 -0
  149. package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +412 -0
  150. package/node_modules/@types/responselike/node_modules/@types/node/constants.d.ts +18 -0
  151. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +3307 -0
  152. package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +545 -0
  153. package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +134 -0
  154. package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +368 -0
  155. package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +654 -0
  156. package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +169 -0
  157. package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +623 -0
  158. package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +1091 -0
  159. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +3784 -0
  160. package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +284 -0
  161. package/node_modules/@types/responselike/node_modules/@types/node/globals.global.d.ts +1 -0
  162. package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +1369 -0
  163. package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +2100 -0
  164. package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +391 -0
  165. package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +131 -0
  166. package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +2745 -0
  167. package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +114 -0
  168. package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +783 -0
  169. package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +455 -0
  170. package/node_modules/@types/responselike/node_modules/@types/node/package.json +230 -0
  171. package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +172 -0
  172. package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +555 -0
  173. package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +1481 -0
  174. package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +117 -0
  175. package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +131 -0
  176. package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +543 -0
  177. package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +424 -0
  178. package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +24 -0
  179. package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +42 -0
  180. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +391 -0
  181. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +1249 -0
  182. package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +67 -0
  183. package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +68 -0
  184. package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +94 -0
  185. package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +1019 -0
  186. package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +161 -0
  187. package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +204 -0
  188. package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +821 -0
  189. package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +1594 -0
  190. package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +378 -0
  191. package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +507 -0
  192. package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +158 -0
  193. package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +649 -0
  194. package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +517 -0
  195. package/node_modules/@types/responselike/package.json +25 -0
  196. package/node_modules/cacheable-lookup/LICENSE +21 -0
  197. package/node_modules/cacheable-lookup/README.md +240 -0
  198. package/node_modules/cacheable-lookup/index.d.ts +139 -0
  199. package/node_modules/cacheable-lookup/package.json +45 -0
  200. package/node_modules/cacheable-lookup/source/index.js +436 -0
  201. package/node_modules/cacheable-request/LICENSE +21 -0
  202. package/node_modules/cacheable-request/README.md +206 -0
  203. package/node_modules/cacheable-request/package.json +56 -0
  204. package/node_modules/cacheable-request/src/index.js +251 -0
  205. package/node_modules/clone-response/LICENSE +21 -0
  206. package/node_modules/clone-response/README.md +62 -0
  207. package/node_modules/clone-response/package.json +44 -0
  208. package/node_modules/clone-response/src/index.js +17 -0
  209. package/node_modules/decompress-response/index.d.ts +22 -0
  210. package/node_modules/decompress-response/index.js +58 -0
  211. package/node_modules/decompress-response/license +9 -0
  212. package/node_modules/decompress-response/node_modules/mimic-response/index.d.ts +17 -0
  213. package/node_modules/decompress-response/node_modules/mimic-response/index.js +77 -0
  214. package/node_modules/decompress-response/node_modules/mimic-response/license +9 -0
  215. package/node_modules/decompress-response/node_modules/mimic-response/package.json +42 -0
  216. package/node_modules/decompress-response/node_modules/mimic-response/readme.md +78 -0
  217. package/node_modules/decompress-response/package.json +56 -0
  218. package/node_modules/decompress-response/readme.md +48 -0
  219. package/node_modules/defer-to-connect/LICENSE +21 -0
  220. package/node_modules/defer-to-connect/README.md +38 -0
  221. package/node_modules/defer-to-connect/dist/source/index.d.ts +10 -0
  222. package/node_modules/defer-to-connect/dist/source/index.js +47 -0
  223. package/node_modules/defer-to-connect/package.json +71 -0
  224. package/node_modules/end-of-stream/LICENSE +21 -0
  225. package/node_modules/end-of-stream/README.md +54 -0
  226. package/node_modules/end-of-stream/index.js +94 -0
  227. package/node_modules/end-of-stream/package.json +37 -0
  228. package/node_modules/get-stream/buffer-stream.js +52 -0
  229. package/node_modules/get-stream/index.d.ts +108 -0
  230. package/node_modules/get-stream/index.js +60 -0
  231. package/node_modules/get-stream/license +9 -0
  232. package/node_modules/get-stream/package.json +50 -0
  233. package/node_modules/get-stream/readme.md +124 -0
  234. package/node_modules/got/dist/source/as-promise/create-rejection.d.ts +2 -0
  235. package/node_modules/got/dist/source/as-promise/create-rejection.js +30 -0
  236. package/node_modules/got/dist/source/as-promise/index.d.ts +3 -0
  237. package/node_modules/got/dist/source/as-promise/index.js +175 -0
  238. package/node_modules/got/dist/source/as-promise/normalize-arguments.d.ts +3 -0
  239. package/node_modules/got/dist/source/as-promise/normalize-arguments.js +78 -0
  240. package/node_modules/got/dist/source/as-promise/parse-body.d.ts +3 -0
  241. package/node_modules/got/dist/source/as-promise/parse-body.js +25 -0
  242. package/node_modules/got/dist/source/as-promise/types.d.ts +256 -0
  243. package/node_modules/got/dist/source/as-promise/types.js +42 -0
  244. package/node_modules/got/dist/source/core/calculate-retry-delay.d.ts +5 -0
  245. package/node_modules/got/dist/source/core/calculate-retry-delay.js +29 -0
  246. package/node_modules/got/dist/source/core/index.d.ts +1124 -0
  247. package/node_modules/got/dist/source/core/index.js +1497 -0
  248. package/node_modules/got/dist/source/core/utils/dns-ip-version.d.ts +5 -0
  249. package/node_modules/got/dist/source/core/utils/dns-ip-version.js +17 -0
  250. package/node_modules/got/dist/source/core/utils/get-body-size.d.ts +3 -0
  251. package/node_modules/got/dist/source/core/utils/get-body-size.js +32 -0
  252. package/node_modules/got/dist/source/core/utils/get-buffer.d.ts +4 -0
  253. package/node_modules/got/dist/source/core/utils/get-buffer.js +16 -0
  254. package/node_modules/got/dist/source/core/utils/is-form-data.d.ts +8 -0
  255. package/node_modules/got/dist/source/core/utils/is-form-data.js +4 -0
  256. package/node_modules/got/dist/source/core/utils/is-response-ok.d.ts +2 -0
  257. package/node_modules/got/dist/source/core/utils/is-response-ok.js +8 -0
  258. package/node_modules/got/dist/source/core/utils/options-to-url.d.ts +14 -0
  259. package/node_modules/got/dist/source/core/utils/options-to-url.js +53 -0
  260. package/node_modules/got/dist/source/core/utils/proxy-events.d.ts +3 -0
  261. package/node_modules/got/dist/source/core/utils/proxy-events.js +17 -0
  262. package/node_modules/got/dist/source/core/utils/timed-out.d.ts +29 -0
  263. package/node_modules/got/dist/source/core/utils/timed-out.js +121 -0
  264. package/node_modules/got/dist/source/core/utils/unhandle.d.ts +11 -0
  265. package/node_modules/got/dist/source/core/utils/unhandle.js +22 -0
  266. package/node_modules/got/dist/source/core/utils/url-to-options.d.ts +15 -0
  267. package/node_modules/got/dist/source/core/utils/url-to-options.js +24 -0
  268. package/node_modules/got/dist/source/core/utils/weakable-map.d.ts +8 -0
  269. package/node_modules/got/dist/source/core/utils/weakable-map.js +29 -0
  270. package/node_modules/got/dist/source/create.d.ts +5 -0
  271. package/node_modules/got/dist/source/create.js +240 -0
  272. package/node_modules/got/dist/source/index.d.ts +4 -0
  273. package/node_modules/got/dist/source/index.js +132 -0
  274. package/node_modules/got/dist/source/types.d.ts +344 -0
  275. package/node_modules/got/dist/source/types.js +2 -0
  276. package/node_modules/got/dist/source/utils/deep-freeze.d.ts +1 -0
  277. package/node_modules/got/dist/source/utils/deep-freeze.js +12 -0
  278. package/node_modules/got/dist/source/utils/deprecation-warning.d.ts +2 -0
  279. package/node_modules/got/dist/source/utils/deprecation-warning.js +13 -0
  280. package/node_modules/got/license +9 -0
  281. package/node_modules/got/package.json +130 -0
  282. package/node_modules/got/readme.md +2477 -0
  283. package/node_modules/http-cache-semantics/LICENSE +9 -0
  284. package/node_modules/http-cache-semantics/README.md +203 -0
  285. package/node_modules/http-cache-semantics/index.js +673 -0
  286. package/node_modules/http-cache-semantics/package.json +24 -0
  287. package/node_modules/http2-wrapper/LICENSE +21 -0
  288. package/node_modules/http2-wrapper/README.md +470 -0
  289. package/node_modules/http2-wrapper/package.json +54 -0
  290. package/node_modules/http2-wrapper/source/agent.js +670 -0
  291. package/node_modules/http2-wrapper/source/auto.js +149 -0
  292. package/node_modules/http2-wrapper/source/client-request.js +445 -0
  293. package/node_modules/http2-wrapper/source/incoming-message.js +58 -0
  294. package/node_modules/http2-wrapper/source/index.js +28 -0
  295. package/node_modules/http2-wrapper/source/utils/calculate-server-name.js +27 -0
  296. package/node_modules/http2-wrapper/source/utils/errors.js +45 -0
  297. package/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js +13 -0
  298. package/node_modules/http2-wrapper/source/utils/proxy-events.js +7 -0
  299. package/node_modules/http2-wrapper/source/utils/url-to-options.js +25 -0
  300. package/node_modules/json-buffer/.travis.yml +3 -0
  301. package/node_modules/json-buffer/LICENSE +22 -0
  302. package/node_modules/json-buffer/README.md +24 -0
  303. package/node_modules/json-buffer/index.js +58 -0
  304. package/node_modules/json-buffer/package.json +34 -0
  305. package/node_modules/json-buffer/test/index.js +63 -0
  306. package/node_modules/keyv/LICENSE +21 -0
  307. package/node_modules/keyv/README.md +290 -0
  308. package/node_modules/keyv/package.json +54 -0
  309. package/node_modules/keyv/src/index.js +109 -0
  310. package/node_modules/lowercase-keys/index.d.ts +16 -0
  311. package/node_modules/lowercase-keys/index.js +10 -0
  312. package/node_modules/lowercase-keys/license +9 -0
  313. package/node_modules/lowercase-keys/package.json +38 -0
  314. package/node_modules/lowercase-keys/readme.md +32 -0
  315. package/node_modules/mimic-response/index.js +32 -0
  316. package/node_modules/mimic-response/license +9 -0
  317. package/node_modules/mimic-response/package.json +37 -0
  318. package/node_modules/mimic-response/readme.md +54 -0
  319. package/node_modules/normalize-url/index.d.ts +267 -0
  320. package/node_modules/normalize-url/index.js +216 -0
  321. package/node_modules/normalize-url/license +9 -0
  322. package/node_modules/normalize-url/package.json +50 -0
  323. package/node_modules/normalize-url/readme.md +286 -0
  324. package/node_modules/once/LICENSE +15 -0
  325. package/node_modules/once/README.md +79 -0
  326. package/node_modules/once/once.js +42 -0
  327. package/node_modules/once/package.json +33 -0
  328. package/node_modules/p-cancelable/index.d.ts +176 -0
  329. package/node_modules/p-cancelable/index.js +111 -0
  330. package/node_modules/p-cancelable/license +9 -0
  331. package/node_modules/p-cancelable/package.json +49 -0
  332. package/node_modules/p-cancelable/readme.md +153 -0
  333. package/node_modules/pump/.travis.yml +5 -0
  334. package/node_modules/pump/LICENSE +21 -0
  335. package/node_modules/pump/README.md +65 -0
  336. package/node_modules/pump/index.js +82 -0
  337. package/node_modules/pump/package.json +24 -0
  338. package/node_modules/pump/test-browser.js +66 -0
  339. package/node_modules/pump/test-node.js +53 -0
  340. package/node_modules/quick-lru/index.d.ts +97 -0
  341. package/node_modules/quick-lru/index.js +123 -0
  342. package/node_modules/quick-lru/license +9 -0
  343. package/node_modules/quick-lru/package.json +43 -0
  344. package/node_modules/quick-lru/readme.md +111 -0
  345. package/node_modules/resolve-alpn/LICENSE +22 -0
  346. package/node_modules/resolve-alpn/README.md +60 -0
  347. package/node_modules/resolve-alpn/index.js +43 -0
  348. package/node_modules/resolve-alpn/package.json +34 -0
  349. package/node_modules/responselike/LICENSE +19 -0
  350. package/node_modules/responselike/README.md +77 -0
  351. package/node_modules/responselike/package.json +38 -0
  352. package/node_modules/responselike/src/index.js +34 -0
  353. package/node_modules/wrappy/LICENSE +15 -0
  354. package/node_modules/wrappy/README.md +36 -0
  355. package/node_modules/wrappy/package.json +29 -0
  356. package/node_modules/wrappy/wrappy.js +33 -0
  357. package/package.json +42 -39
@@ -0,0 +1,149 @@
1
+ 'use strict';
2
+ const http = require('http');
3
+ const https = require('https');
4
+ const resolveALPN = require('resolve-alpn');
5
+ const QuickLRU = require('quick-lru');
6
+ const Http2ClientRequest = require('./client-request');
7
+ const calculateServerName = require('./utils/calculate-server-name');
8
+ const urlToOptions = require('./utils/url-to-options');
9
+
10
+ const cache = new QuickLRU({maxSize: 100});
11
+ const queue = new Map();
12
+
13
+ const installSocket = (agent, socket, options) => {
14
+ socket._httpMessage = {shouldKeepAlive: true};
15
+
16
+ const onFree = () => {
17
+ agent.emit('free', socket, options);
18
+ };
19
+
20
+ socket.on('free', onFree);
21
+
22
+ const onClose = () => {
23
+ agent.removeSocket(socket, options);
24
+ };
25
+
26
+ socket.on('close', onClose);
27
+
28
+ const onRemove = () => {
29
+ agent.removeSocket(socket, options);
30
+ socket.off('close', onClose);
31
+ socket.off('free', onFree);
32
+ socket.off('agentRemove', onRemove);
33
+ };
34
+
35
+ socket.on('agentRemove', onRemove);
36
+
37
+ agent.emit('free', socket, options);
38
+ };
39
+
40
+ const resolveProtocol = async options => {
41
+ const name = `${options.host}:${options.port}:${options.ALPNProtocols.sort()}`;
42
+
43
+ if (!cache.has(name)) {
44
+ if (queue.has(name)) {
45
+ const result = await queue.get(name);
46
+ return result.alpnProtocol;
47
+ }
48
+
49
+ const {path, agent} = options;
50
+ options.path = options.socketPath;
51
+
52
+ const resultPromise = resolveALPN(options);
53
+ queue.set(name, resultPromise);
54
+
55
+ try {
56
+ const {socket, alpnProtocol} = await resultPromise;
57
+ cache.set(name, alpnProtocol);
58
+
59
+ options.path = path;
60
+
61
+ if (alpnProtocol === 'h2') {
62
+ // https://github.com/nodejs/node/issues/33343
63
+ socket.destroy();
64
+ } else {
65
+ const {globalAgent} = https;
66
+ const defaultCreateConnection = https.Agent.prototype.createConnection;
67
+
68
+ if (agent) {
69
+ if (agent.createConnection === defaultCreateConnection) {
70
+ installSocket(agent, socket, options);
71
+ } else {
72
+ socket.destroy();
73
+ }
74
+ } else if (globalAgent.createConnection === defaultCreateConnection) {
75
+ installSocket(globalAgent, socket, options);
76
+ } else {
77
+ socket.destroy();
78
+ }
79
+ }
80
+
81
+ queue.delete(name);
82
+
83
+ return alpnProtocol;
84
+ } catch (error) {
85
+ queue.delete(name);
86
+
87
+ throw error;
88
+ }
89
+ }
90
+
91
+ return cache.get(name);
92
+ };
93
+
94
+ module.exports = async (input, options, callback) => {
95
+ if (typeof input === 'string' || input instanceof URL) {
96
+ input = urlToOptions(new URL(input));
97
+ }
98
+
99
+ if (typeof options === 'function') {
100
+ callback = options;
101
+ options = undefined;
102
+ }
103
+
104
+ options = {
105
+ ALPNProtocols: ['h2', 'http/1.1'],
106
+ ...input,
107
+ ...options,
108
+ resolveSocket: true
109
+ };
110
+
111
+ if (!Array.isArray(options.ALPNProtocols) || options.ALPNProtocols.length === 0) {
112
+ throw new Error('The `ALPNProtocols` option must be an Array with at least one entry');
113
+ }
114
+
115
+ options.protocol = options.protocol || 'https:';
116
+ const isHttps = options.protocol === 'https:';
117
+
118
+ options.host = options.hostname || options.host || 'localhost';
119
+ options.session = options.tlsSession;
120
+ options.servername = options.servername || calculateServerName(options);
121
+ options.port = options.port || (isHttps ? 443 : 80);
122
+ options._defaultAgent = isHttps ? https.globalAgent : http.globalAgent;
123
+
124
+ const agents = options.agent;
125
+
126
+ if (agents) {
127
+ if (agents.addRequest) {
128
+ throw new Error('The `options.agent` object can contain only `http`, `https` or `http2` properties');
129
+ }
130
+
131
+ options.agent = agents[isHttps ? 'https' : 'http'];
132
+ }
133
+
134
+ if (isHttps) {
135
+ const protocol = await resolveProtocol(options);
136
+
137
+ if (protocol === 'h2') {
138
+ if (agents) {
139
+ options.agent = agents.http2;
140
+ }
141
+
142
+ return new Http2ClientRequest(options, callback);
143
+ }
144
+ }
145
+
146
+ return http.request(options, callback);
147
+ };
148
+
149
+ module.exports.protocolCache = cache;
@@ -0,0 +1,445 @@
1
+ 'use strict';
2
+ const http2 = require('http2');
3
+ const {Writable} = require('stream');
4
+ const {Agent, globalAgent} = require('./agent');
5
+ const IncomingMessage = require('./incoming-message');
6
+ const urlToOptions = require('./utils/url-to-options');
7
+ const proxyEvents = require('./utils/proxy-events');
8
+ const isRequestPseudoHeader = require('./utils/is-request-pseudo-header');
9
+ const {
10
+ ERR_INVALID_ARG_TYPE,
11
+ ERR_INVALID_PROTOCOL,
12
+ ERR_HTTP_HEADERS_SENT,
13
+ ERR_INVALID_HTTP_TOKEN,
14
+ ERR_HTTP_INVALID_HEADER_VALUE,
15
+ ERR_INVALID_CHAR
16
+ } = require('./utils/errors');
17
+
18
+ const {
19
+ HTTP2_HEADER_STATUS,
20
+ HTTP2_HEADER_METHOD,
21
+ HTTP2_HEADER_PATH,
22
+ HTTP2_METHOD_CONNECT
23
+ } = http2.constants;
24
+
25
+ const kHeaders = Symbol('headers');
26
+ const kOrigin = Symbol('origin');
27
+ const kSession = Symbol('session');
28
+ const kOptions = Symbol('options');
29
+ const kFlushedHeaders = Symbol('flushedHeaders');
30
+ const kJobs = Symbol('jobs');
31
+
32
+ const isValidHttpToken = /^[\^`\-\w!#$%&*+.|~]+$/;
33
+ const isInvalidHeaderValue = /[^\t\u0020-\u007E\u0080-\u00FF]/;
34
+
35
+ class ClientRequest extends Writable {
36
+ constructor(input, options, callback) {
37
+ super({
38
+ autoDestroy: false
39
+ });
40
+
41
+ const hasInput = typeof input === 'string' || input instanceof URL;
42
+ if (hasInput) {
43
+ input = urlToOptions(input instanceof URL ? input : new URL(input));
44
+ }
45
+
46
+ if (typeof options === 'function' || options === undefined) {
47
+ // (options, callback)
48
+ callback = options;
49
+ options = hasInput ? input : {...input};
50
+ } else {
51
+ // (input, options, callback)
52
+ options = {...input, ...options};
53
+ }
54
+
55
+ if (options.h2session) {
56
+ this[kSession] = options.h2session;
57
+ } else if (options.agent === false) {
58
+ this.agent = new Agent({maxFreeSessions: 0});
59
+ } else if (typeof options.agent === 'undefined' || options.agent === null) {
60
+ if (typeof options.createConnection === 'function') {
61
+ // This is a workaround - we don't have to create the session on our own.
62
+ this.agent = new Agent({maxFreeSessions: 0});
63
+ this.agent.createConnection = options.createConnection;
64
+ } else {
65
+ this.agent = globalAgent;
66
+ }
67
+ } else if (typeof options.agent.request === 'function') {
68
+ this.agent = options.agent;
69
+ } else {
70
+ throw new ERR_INVALID_ARG_TYPE('options.agent', ['Agent-like Object', 'undefined', 'false'], options.agent);
71
+ }
72
+
73
+ if (options.protocol && options.protocol !== 'https:') {
74
+ throw new ERR_INVALID_PROTOCOL(options.protocol, 'https:');
75
+ }
76
+
77
+ const port = options.port || options.defaultPort || (this.agent && this.agent.defaultPort) || 443;
78
+ const host = options.hostname || options.host || 'localhost';
79
+
80
+ // Don't enforce the origin via options. It may be changed in an Agent.
81
+ delete options.hostname;
82
+ delete options.host;
83
+ delete options.port;
84
+
85
+ const {timeout} = options;
86
+ options.timeout = undefined;
87
+
88
+ this[kHeaders] = Object.create(null);
89
+ this[kJobs] = [];
90
+
91
+ this.socket = null;
92
+ this.connection = null;
93
+
94
+ this.method = options.method || 'GET';
95
+ this.path = options.path;
96
+
97
+ this.res = null;
98
+ this.aborted = false;
99
+ this.reusedSocket = false;
100
+
101
+ if (options.headers) {
102
+ for (const [header, value] of Object.entries(options.headers)) {
103
+ this.setHeader(header, value);
104
+ }
105
+ }
106
+
107
+ if (options.auth && !('authorization' in this[kHeaders])) {
108
+ this[kHeaders].authorization = 'Basic ' + Buffer.from(options.auth).toString('base64');
109
+ }
110
+
111
+ options.session = options.tlsSession;
112
+ options.path = options.socketPath;
113
+
114
+ this[kOptions] = options;
115
+
116
+ // Clients that generate HTTP/2 requests directly SHOULD use the :authority pseudo-header field instead of the Host header field.
117
+ if (port === 443) {
118
+ this[kOrigin] = `https://${host}`;
119
+
120
+ if (!(':authority' in this[kHeaders])) {
121
+ this[kHeaders][':authority'] = host;
122
+ }
123
+ } else {
124
+ this[kOrigin] = `https://${host}:${port}`;
125
+
126
+ if (!(':authority' in this[kHeaders])) {
127
+ this[kHeaders][':authority'] = `${host}:${port}`;
128
+ }
129
+ }
130
+
131
+ if (timeout) {
132
+ this.setTimeout(timeout);
133
+ }
134
+
135
+ if (callback) {
136
+ this.once('response', callback);
137
+ }
138
+
139
+ this[kFlushedHeaders] = false;
140
+ }
141
+
142
+ get method() {
143
+ return this[kHeaders][HTTP2_HEADER_METHOD];
144
+ }
145
+
146
+ set method(value) {
147
+ if (value) {
148
+ this[kHeaders][HTTP2_HEADER_METHOD] = value.toUpperCase();
149
+ }
150
+ }
151
+
152
+ get path() {
153
+ return this[kHeaders][HTTP2_HEADER_PATH];
154
+ }
155
+
156
+ set path(value) {
157
+ if (value) {
158
+ this[kHeaders][HTTP2_HEADER_PATH] = value;
159
+ }
160
+ }
161
+
162
+ get _mustNotHaveABody() {
163
+ return this.method === 'GET' || this.method === 'HEAD' || this.method === 'DELETE';
164
+ }
165
+
166
+ _write(chunk, encoding, callback) {
167
+ // https://github.com/nodejs/node/blob/654df09ae0c5e17d1b52a900a545f0664d8c7627/lib/internal/http2/util.js#L148-L156
168
+ if (this._mustNotHaveABody) {
169
+ callback(new Error('The GET, HEAD and DELETE methods must NOT have a body'));
170
+ /* istanbul ignore next: Node.js 12 throws directly */
171
+ return;
172
+ }
173
+
174
+ this.flushHeaders();
175
+
176
+ const callWrite = () => this._request.write(chunk, encoding, callback);
177
+ if (this._request) {
178
+ callWrite();
179
+ } else {
180
+ this[kJobs].push(callWrite);
181
+ }
182
+ }
183
+
184
+ _final(callback) {
185
+ if (this.destroyed) {
186
+ return;
187
+ }
188
+
189
+ this.flushHeaders();
190
+
191
+ const callEnd = () => {
192
+ // For GET, HEAD and DELETE
193
+ if (this._mustNotHaveABody) {
194
+ callback();
195
+ return;
196
+ }
197
+
198
+ this._request.end(callback);
199
+ };
200
+
201
+ if (this._request) {
202
+ callEnd();
203
+ } else {
204
+ this[kJobs].push(callEnd);
205
+ }
206
+ }
207
+
208
+ abort() {
209
+ if (this.res && this.res.complete) {
210
+ return;
211
+ }
212
+
213
+ if (!this.aborted) {
214
+ process.nextTick(() => this.emit('abort'));
215
+ }
216
+
217
+ this.aborted = true;
218
+
219
+ this.destroy();
220
+ }
221
+
222
+ _destroy(error, callback) {
223
+ if (this.res) {
224
+ this.res._dump();
225
+ }
226
+
227
+ if (this._request) {
228
+ this._request.destroy();
229
+ }
230
+
231
+ callback(error);
232
+ }
233
+
234
+ async flushHeaders() {
235
+ if (this[kFlushedHeaders] || this.destroyed) {
236
+ return;
237
+ }
238
+
239
+ this[kFlushedHeaders] = true;
240
+
241
+ const isConnectMethod = this.method === HTTP2_METHOD_CONNECT;
242
+
243
+ // The real magic is here
244
+ const onStream = stream => {
245
+ this._request = stream;
246
+
247
+ if (this.destroyed) {
248
+ stream.destroy();
249
+ return;
250
+ }
251
+
252
+ // Forwards `timeout`, `continue`, `close` and `error` events to this instance.
253
+ if (!isConnectMethod) {
254
+ proxyEvents(stream, this, ['timeout', 'continue', 'close', 'error']);
255
+ }
256
+
257
+ // Wait for the `finish` event. We don't want to emit the `response` event
258
+ // before `request.end()` is called.
259
+ const waitForEnd = fn => {
260
+ return (...args) => {
261
+ if (!this.writable && !this.destroyed) {
262
+ fn(...args);
263
+ } else {
264
+ this.once('finish', () => {
265
+ fn(...args);
266
+ });
267
+ }
268
+ };
269
+ };
270
+
271
+ // This event tells we are ready to listen for the data.
272
+ stream.once('response', waitForEnd((headers, flags, rawHeaders) => {
273
+ // If we were to emit raw request stream, it would be as fast as the native approach.
274
+ // Note that wrapping the raw stream in a Proxy instance won't improve the performance (already tested it).
275
+ const response = new IncomingMessage(this.socket, stream.readableHighWaterMark);
276
+ this.res = response;
277
+
278
+ response.req = this;
279
+ response.statusCode = headers[HTTP2_HEADER_STATUS];
280
+ response.headers = headers;
281
+ response.rawHeaders = rawHeaders;
282
+
283
+ response.once('end', () => {
284
+ if (this.aborted) {
285
+ response.aborted = true;
286
+ response.emit('aborted');
287
+ } else {
288
+ response.complete = true;
289
+
290
+ // Has no effect, just be consistent with the Node.js behavior
291
+ response.socket = null;
292
+ response.connection = null;
293
+ }
294
+ });
295
+
296
+ if (isConnectMethod) {
297
+ response.upgrade = true;
298
+
299
+ // The HTTP1 API says the socket is detached here,
300
+ // but we can't do that so we pass the original HTTP2 request.
301
+ if (this.emit('connect', response, stream, Buffer.alloc(0))) {
302
+ this.emit('close');
303
+ } else {
304
+ // No listeners attached, destroy the original request.
305
+ stream.destroy();
306
+ }
307
+ } else {
308
+ // Forwards data
309
+ stream.on('data', chunk => {
310
+ if (!response._dumped && !response.push(chunk)) {
311
+ stream.pause();
312
+ }
313
+ });
314
+
315
+ stream.once('end', () => {
316
+ response.push(null);
317
+ });
318
+
319
+ if (!this.emit('response', response)) {
320
+ // No listeners attached, dump the response.
321
+ response._dump();
322
+ }
323
+ }
324
+ }));
325
+
326
+ // Emits `information` event
327
+ stream.once('headers', waitForEnd(
328
+ headers => this.emit('information', {statusCode: headers[HTTP2_HEADER_STATUS]})
329
+ ));
330
+
331
+ stream.once('trailers', waitForEnd((trailers, flags, rawTrailers) => {
332
+ const {res} = this;
333
+
334
+ // Assigns trailers to the response object.
335
+ res.trailers = trailers;
336
+ res.rawTrailers = rawTrailers;
337
+ }));
338
+
339
+ const {socket} = stream.session;
340
+ this.socket = socket;
341
+ this.connection = socket;
342
+
343
+ for (const job of this[kJobs]) {
344
+ job();
345
+ }
346
+
347
+ this.emit('socket', this.socket);
348
+ };
349
+
350
+ // Makes a HTTP2 request
351
+ if (this[kSession]) {
352
+ try {
353
+ onStream(this[kSession].request(this[kHeaders]));
354
+ } catch (error) {
355
+ this.emit('error', error);
356
+ }
357
+ } else {
358
+ this.reusedSocket = true;
359
+
360
+ try {
361
+ onStream(await this.agent.request(this[kOrigin], this[kOptions], this[kHeaders]));
362
+ } catch (error) {
363
+ this.emit('error', error);
364
+ }
365
+ }
366
+ }
367
+
368
+ getHeader(name) {
369
+ if (typeof name !== 'string') {
370
+ throw new ERR_INVALID_ARG_TYPE('name', 'string', name);
371
+ }
372
+
373
+ return this[kHeaders][name.toLowerCase()];
374
+ }
375
+
376
+ get headersSent() {
377
+ return this[kFlushedHeaders];
378
+ }
379
+
380
+ removeHeader(name) {
381
+ if (typeof name !== 'string') {
382
+ throw new ERR_INVALID_ARG_TYPE('name', 'string', name);
383
+ }
384
+
385
+ if (this.headersSent) {
386
+ throw new ERR_HTTP_HEADERS_SENT('remove');
387
+ }
388
+
389
+ delete this[kHeaders][name.toLowerCase()];
390
+ }
391
+
392
+ setHeader(name, value) {
393
+ if (this.headersSent) {
394
+ throw new ERR_HTTP_HEADERS_SENT('set');
395
+ }
396
+
397
+ if (typeof name !== 'string' || (!isValidHttpToken.test(name) && !isRequestPseudoHeader(name))) {
398
+ throw new ERR_INVALID_HTTP_TOKEN('Header name', name);
399
+ }
400
+
401
+ if (typeof value === 'undefined') {
402
+ throw new ERR_HTTP_INVALID_HEADER_VALUE(value, name);
403
+ }
404
+
405
+ if (isInvalidHeaderValue.test(value)) {
406
+ throw new ERR_INVALID_CHAR('header content', name);
407
+ }
408
+
409
+ this[kHeaders][name.toLowerCase()] = value;
410
+ }
411
+
412
+ setNoDelay() {
413
+ // HTTP2 sockets cannot be malformed, do nothing.
414
+ }
415
+
416
+ setSocketKeepAlive() {
417
+ // HTTP2 sockets cannot be malformed, do nothing.
418
+ }
419
+
420
+ setTimeout(ms, callback) {
421
+ const applyTimeout = () => this._request.setTimeout(ms, callback);
422
+
423
+ if (this._request) {
424
+ applyTimeout();
425
+ } else {
426
+ this[kJobs].push(applyTimeout);
427
+ }
428
+
429
+ return this;
430
+ }
431
+
432
+ get maxHeadersCount() {
433
+ if (!this.destroyed && this._request) {
434
+ return this._request.session.localSettings.maxHeaderListSize;
435
+ }
436
+
437
+ return undefined;
438
+ }
439
+
440
+ set maxHeadersCount(_value) {
441
+ // Updating HTTP2 settings would affect all requests, do nothing.
442
+ }
443
+ }
444
+
445
+ module.exports = ClientRequest;
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+ const {Readable} = require('stream');
3
+
4
+ class IncomingMessage extends Readable {
5
+ constructor(socket, highWaterMark) {
6
+ super({
7
+ highWaterMark,
8
+ autoDestroy: false
9
+ });
10
+
11
+ this.statusCode = null;
12
+ this.statusMessage = '';
13
+ this.httpVersion = '2.0';
14
+ this.httpVersionMajor = 2;
15
+ this.httpVersionMinor = 0;
16
+ this.headers = {};
17
+ this.trailers = {};
18
+ this.req = null;
19
+
20
+ this.aborted = false;
21
+ this.complete = false;
22
+ this.upgrade = null;
23
+
24
+ this.rawHeaders = [];
25
+ this.rawTrailers = [];
26
+
27
+ this.socket = socket;
28
+ this.connection = socket;
29
+
30
+ this._dumped = false;
31
+ }
32
+
33
+ _destroy(error) {
34
+ this.req._request.destroy(error);
35
+ }
36
+
37
+ setTimeout(ms, callback) {
38
+ this.req.setTimeout(ms, callback);
39
+ return this;
40
+ }
41
+
42
+ _dump() {
43
+ if (!this._dumped) {
44
+ this._dumped = true;
45
+
46
+ this.removeAllListeners('data');
47
+ this.resume();
48
+ }
49
+ }
50
+
51
+ _read() {
52
+ if (this.req) {
53
+ this.req._request.resume();
54
+ }
55
+ }
56
+ }
57
+
58
+ module.exports = IncomingMessage;
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+ const http2 = require('http2');
3
+ const agent = require('./agent');
4
+ const ClientRequest = require('./client-request');
5
+ const IncomingMessage = require('./incoming-message');
6
+ const auto = require('./auto');
7
+
8
+ const request = (url, options, callback) => {
9
+ return new ClientRequest(url, options, callback);
10
+ };
11
+
12
+ const get = (url, options, callback) => {
13
+ // eslint-disable-next-line unicorn/prevent-abbreviations
14
+ const req = new ClientRequest(url, options, callback);
15
+ req.end();
16
+
17
+ return req;
18
+ };
19
+
20
+ module.exports = {
21
+ ...http2,
22
+ ClientRequest,
23
+ IncomingMessage,
24
+ ...agent,
25
+ request,
26
+ get,
27
+ auto
28
+ };
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+ const net = require('net');
3
+ /* istanbul ignore file: https://github.com/nodejs/node/blob/v13.0.1/lib/_http_agent.js */
4
+
5
+ module.exports = options => {
6
+ let servername = options.host;
7
+ const hostHeader = options.headers && options.headers.host;
8
+
9
+ if (hostHeader) {
10
+ if (hostHeader.startsWith('[')) {
11
+ const index = hostHeader.indexOf(']');
12
+ if (index === -1) {
13
+ servername = hostHeader;
14
+ } else {
15
+ servername = hostHeader.slice(1, -1);
16
+ }
17
+ } else {
18
+ servername = hostHeader.split(':', 1)[0];
19
+ }
20
+ }
21
+
22
+ if (net.isIP(servername)) {
23
+ return '';
24
+ }
25
+
26
+ return servername;
27
+ };