cdk-ecr-deployment 2.5.6 → 2.5.21

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 (376) hide show
  1. package/.gitattributes +5 -4
  2. package/.jsii +673 -21
  3. package/.jsii.tabl.json +1 -0
  4. package/.projenrc.ts +100 -0
  5. package/API.md +4 -4
  6. package/README.md +4 -4
  7. package/lambda/go.mod +2 -5
  8. package/lambda/go.sum +39 -14
  9. package/lib/index.d.ts +7 -65
  10. package/lib/index.js +7 -45
  11. package/node_modules/@sindresorhus/is/dist/index.d.ts +12 -7
  12. package/node_modules/@sindresorhus/is/dist/index.js +9 -4
  13. package/node_modules/@sindresorhus/is/dist/types.d.ts +1 -0
  14. package/node_modules/@sindresorhus/is/package.json +1 -1
  15. package/node_modules/@sindresorhus/is/readme.md +25 -7
  16. package/node_modules/@types/cacheable-request/README.md +2 -2
  17. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +2 -2
  18. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +135 -75
  19. package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +67 -38
  20. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +226 -104
  21. package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +87 -58
  22. package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +29 -29
  23. package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +5 -5
  24. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +888 -256
  25. package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +16 -16
  26. package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +60 -21
  27. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +52 -8
  28. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +27 -18
  29. package/node_modules/@types/cacheable-request/node_modules/@types/node/dom-events.d.ts +126 -0
  30. package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +6 -5
  31. package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +166 -93
  32. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +169 -70
  33. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +301 -126
  34. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +22 -13
  35. package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +453 -125
  36. package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +74 -46
  37. package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +103 -53
  38. package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +6 -2
  39. package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +20 -16
  40. package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +6 -4
  41. package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +114 -22
  42. package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +36 -14
  43. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +15 -3
  44. package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +37 -26
  45. package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +96 -15
  46. package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +95 -82
  47. package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +1 -1
  48. package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +6 -6
  49. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline/promises.d.ts +145 -0
  50. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +51 -175
  51. package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +21 -21
  52. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +2 -14
  53. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +983 -824
  54. package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +6 -6
  55. package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +1052 -0
  56. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +26 -1
  57. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +127 -6
  58. package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +149 -50
  59. package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +30 -9
  60. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
  61. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/assert.d.ts +972 -0
  62. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/async_hooks.d.ts +530 -0
  63. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/buffer.d.ts +2354 -0
  64. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/child_process.d.ts +1395 -0
  65. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/cluster.d.ts +414 -0
  66. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/console.d.ts +412 -0
  67. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
  68. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/crypto.d.ts +3969 -0
  69. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
  70. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
  71. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/dns/promises.d.ts +414 -0
  72. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/dns.d.ts +668 -0
  73. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
  74. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
  75. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/events.d.ts +724 -0
  76. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/fs/promises.d.ts +1189 -0
  77. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/fs.d.ts +4044 -0
  78. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/globals.d.ts +303 -0
  79. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  80. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/http.d.ts +1724 -0
  81. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/http2.d.ts +2129 -0
  82. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/https.d.ts +441 -0
  83. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/index.d.ts +88 -0
  84. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/inspector.d.ts +2748 -0
  85. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/module.d.ts +116 -0
  86. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/net.d.ts +888 -0
  87. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/os.d.ts +477 -0
  88. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/path.d.ts +191 -0
  89. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/perf_hooks.d.ts +638 -0
  90. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/process.d.ts +1494 -0
  91. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
  92. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
  93. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/readline/promises.d.ts +145 -0
  94. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/readline.d.ts +526 -0
  95. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
  96. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
  97. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
  98. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
  99. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/stream.d.ts +1392 -0
  100. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
  101. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/test.d.ts +1052 -0
  102. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
  103. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/timers.d.ts +215 -0
  104. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/tls.d.ts +1119 -0
  105. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/trace_events.d.ts +182 -0
  106. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/tty.d.ts +208 -0
  107. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/url.d.ts +901 -0
  108. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/util.d.ts +2052 -0
  109. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/v8.d.ts +635 -0
  110. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/vm.d.ts +894 -0
  111. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/wasi.d.ts +152 -0
  112. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/worker_threads.d.ts +693 -0
  113. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
  114. package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +11 -7
  115. package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +66 -56
  116. package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +528 -70
  117. package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +271 -14
  118. package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +421 -34
  119. package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +15 -21
  120. package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +81 -37
  121. package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +11 -11
  122. package/node_modules/@types/cacheable-request/package.json +5 -5
  123. package/node_modules/@types/keyv/README.md +1 -1
  124. package/node_modules/@types/keyv/index.d.ts +16 -3
  125. package/node_modules/@types/keyv/node_modules/@types/node/README.md +2 -2
  126. package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +135 -75
  127. package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +67 -38
  128. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +226 -104
  129. package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +87 -58
  130. package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +29 -29
  131. package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +5 -5
  132. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +888 -256
  133. package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +16 -16
  134. package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +60 -21
  135. package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +52 -8
  136. package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +27 -18
  137. package/node_modules/@types/keyv/node_modules/@types/node/dom-events.d.ts +126 -0
  138. package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +6 -5
  139. package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +166 -93
  140. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +169 -70
  141. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +301 -126
  142. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +22 -13
  143. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +453 -125
  144. package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +74 -46
  145. package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +103 -53
  146. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +6 -2
  147. package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +20 -16
  148. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +6 -4
  149. package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +114 -22
  150. package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +36 -14
  151. package/node_modules/@types/keyv/node_modules/@types/node/package.json +15 -3
  152. package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +37 -26
  153. package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +96 -15
  154. package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +95 -82
  155. package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +1 -1
  156. package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +6 -6
  157. package/node_modules/@types/keyv/node_modules/@types/node/readline/promises.d.ts +145 -0
  158. package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +51 -175
  159. package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +21 -21
  160. package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +2 -14
  161. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +983 -824
  162. package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +6 -6
  163. package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +1052 -0
  164. package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +26 -1
  165. package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +127 -6
  166. package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +149 -50
  167. package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +30 -9
  168. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
  169. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/assert.d.ts +972 -0
  170. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/async_hooks.d.ts +530 -0
  171. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/buffer.d.ts +2354 -0
  172. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/child_process.d.ts +1395 -0
  173. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/cluster.d.ts +414 -0
  174. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/console.d.ts +412 -0
  175. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
  176. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/crypto.d.ts +3969 -0
  177. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
  178. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
  179. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/dns/promises.d.ts +414 -0
  180. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/dns.d.ts +668 -0
  181. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
  182. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
  183. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/events.d.ts +724 -0
  184. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/fs/promises.d.ts +1189 -0
  185. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/fs.d.ts +4044 -0
  186. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/globals.d.ts +303 -0
  187. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  188. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/http.d.ts +1724 -0
  189. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/http2.d.ts +2129 -0
  190. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/https.d.ts +441 -0
  191. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/index.d.ts +88 -0
  192. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/inspector.d.ts +2748 -0
  193. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/module.d.ts +116 -0
  194. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/net.d.ts +888 -0
  195. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/os.d.ts +477 -0
  196. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/path.d.ts +191 -0
  197. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/perf_hooks.d.ts +638 -0
  198. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/process.d.ts +1494 -0
  199. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
  200. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
  201. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/readline/promises.d.ts +145 -0
  202. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/readline.d.ts +526 -0
  203. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
  204. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
  205. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
  206. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
  207. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/stream.d.ts +1392 -0
  208. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
  209. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/test.d.ts +1052 -0
  210. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
  211. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/timers.d.ts +215 -0
  212. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/tls.d.ts +1119 -0
  213. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/trace_events.d.ts +182 -0
  214. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/tty.d.ts +208 -0
  215. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/url.d.ts +901 -0
  216. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/util.d.ts +2052 -0
  217. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/v8.d.ts +635 -0
  218. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/vm.d.ts +894 -0
  219. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/wasi.d.ts +152 -0
  220. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/worker_threads.d.ts +693 -0
  221. package/node_modules/@types/keyv/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
  222. package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +11 -7
  223. package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +66 -56
  224. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +528 -70
  225. package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +271 -14
  226. package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +421 -34
  227. package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +15 -21
  228. package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +81 -37
  229. package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +11 -11
  230. package/node_modules/@types/keyv/package.json +3 -3
  231. package/node_modules/@types/responselike/node_modules/@types/node/README.md +2 -2
  232. package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +135 -75
  233. package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +67 -38
  234. package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +226 -104
  235. package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +87 -58
  236. package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +29 -29
  237. package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +5 -5
  238. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +888 -256
  239. package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +16 -16
  240. package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +60 -21
  241. package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +52 -8
  242. package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +27 -18
  243. package/node_modules/@types/responselike/node_modules/@types/node/dom-events.d.ts +126 -0
  244. package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +6 -5
  245. package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +166 -93
  246. package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +169 -70
  247. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +301 -126
  248. package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +22 -13
  249. package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +453 -125
  250. package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +74 -46
  251. package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +103 -53
  252. package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +6 -2
  253. package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +20 -16
  254. package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +6 -4
  255. package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +114 -22
  256. package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +36 -14
  257. package/node_modules/@types/responselike/node_modules/@types/node/package.json +15 -3
  258. package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +37 -26
  259. package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +96 -15
  260. package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +95 -82
  261. package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +1 -1
  262. package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +6 -6
  263. package/node_modules/@types/responselike/node_modules/@types/node/readline/promises.d.ts +145 -0
  264. package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +51 -175
  265. package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +21 -21
  266. package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +2 -14
  267. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +983 -824
  268. package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +6 -6
  269. package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +1052 -0
  270. package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +26 -1
  271. package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +127 -6
  272. package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +149 -50
  273. package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +30 -9
  274. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
  275. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/assert.d.ts +972 -0
  276. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/async_hooks.d.ts +530 -0
  277. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/buffer.d.ts +2354 -0
  278. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/child_process.d.ts +1395 -0
  279. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/cluster.d.ts +414 -0
  280. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/console.d.ts +412 -0
  281. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
  282. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/crypto.d.ts +3969 -0
  283. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
  284. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
  285. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/dns/promises.d.ts +414 -0
  286. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/dns.d.ts +668 -0
  287. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
  288. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
  289. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/events.d.ts +724 -0
  290. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/fs/promises.d.ts +1189 -0
  291. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/fs.d.ts +4044 -0
  292. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/globals.d.ts +303 -0
  293. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  294. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/http.d.ts +1724 -0
  295. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/http2.d.ts +2129 -0
  296. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/https.d.ts +441 -0
  297. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/index.d.ts +88 -0
  298. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/inspector.d.ts +2748 -0
  299. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/module.d.ts +116 -0
  300. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/net.d.ts +888 -0
  301. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/os.d.ts +477 -0
  302. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/path.d.ts +191 -0
  303. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/perf_hooks.d.ts +638 -0
  304. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/process.d.ts +1494 -0
  305. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
  306. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
  307. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/readline/promises.d.ts +145 -0
  308. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/readline.d.ts +526 -0
  309. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
  310. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
  311. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
  312. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
  313. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/stream.d.ts +1392 -0
  314. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
  315. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/test.d.ts +1052 -0
  316. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
  317. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/timers.d.ts +215 -0
  318. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/tls.d.ts +1119 -0
  319. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/trace_events.d.ts +182 -0
  320. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/tty.d.ts +208 -0
  321. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/url.d.ts +901 -0
  322. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/util.d.ts +2052 -0
  323. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/v8.d.ts +635 -0
  324. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/vm.d.ts +894 -0
  325. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/wasi.d.ts +152 -0
  326. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/worker_threads.d.ts +693 -0
  327. package/node_modules/@types/responselike/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
  328. package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +11 -7
  329. package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +66 -56
  330. package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +528 -70
  331. package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +271 -14
  332. package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +421 -34
  333. package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +15 -21
  334. package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +81 -37
  335. package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +11 -11
  336. package/node_modules/cacheable-request/package.json +1 -1
  337. package/node_modules/clone-response/node_modules/mimic-response/index.js +32 -0
  338. package/node_modules/{get-stream → clone-response/node_modules/mimic-response}/license +1 -1
  339. package/node_modules/clone-response/node_modules/mimic-response/package.json +37 -0
  340. package/node_modules/clone-response/node_modules/mimic-response/readme.md +54 -0
  341. package/node_modules/clone-response/package.json +3 -6
  342. package/node_modules/got/dist/source/as-promise/index.js +1 -0
  343. package/node_modules/got/package.json +2 -1
  344. package/node_modules/http-cache-semantics/index.js +4 -3
  345. package/node_modules/http-cache-semantics/package.json +2 -8
  346. package/node_modules/keyv/README.md +141 -5
  347. package/node_modules/keyv/package.json +56 -50
  348. package/node_modules/keyv/src/index.d.ts +116 -0
  349. package/node_modules/keyv/src/index.js +179 -24
  350. package/node_modules/mimic-response/index.js +58 -13
  351. package/node_modules/mimic-response/license +1 -1
  352. package/node_modules/mimic-response/package.json +40 -35
  353. package/node_modules/mimic-response/readme.md +33 -9
  354. package/node_modules/responselike/package.json +3 -2
  355. package/package.json +54 -25
  356. package/rosetta/default.ts-fixture +17 -0
  357. package/changelog.md +0 -2
  358. package/node_modules/decompress-response/node_modules/mimic-response/index.js +0 -77
  359. package/node_modules/decompress-response/node_modules/mimic-response/package.json +0 -42
  360. package/node_modules/decompress-response/node_modules/mimic-response/readme.md +0 -78
  361. package/node_modules/keyv/.nyc_output/37411020-4142-4b08-b825-343ba2427bf7.json +0 -1
  362. package/node_modules/keyv/.nyc_output/cd79f2de-c8b8-4493-bc15-b2bde28efa4b.json +0 -1
  363. package/node_modules/keyv/.nyc_output/processinfo/37411020-4142-4b08-b825-343ba2427bf7.json +0 -1
  364. package/node_modules/keyv/.nyc_output/processinfo/cd79f2de-c8b8-4493-bc15-b2bde28efa4b.json +0 -1
  365. package/node_modules/keyv/.nyc_output/processinfo/index.json +0 -1
  366. package/node_modules/keyv/test/test.js +0 -132
  367. package/node_modules/keyv/test/testdb.sqlite +0 -0
  368. package/releasetag.txt +0 -1
  369. package/version.txt +0 -1
  370. /package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/buffer-stream.js +0 -0
  371. /package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/index.d.ts +0 -0
  372. /package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/index.js +0 -0
  373. /package/node_modules/{decompress-response/node_modules/mimic-response → cacheable-request/node_modules/get-stream}/license +0 -0
  374. /package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/package.json +0 -0
  375. /package/node_modules/{get-stream → cacheable-request/node_modules/get-stream}/readme.md +0 -0
  376. /package/node_modules/{decompress-response/node_modules/mimic-response → mimic-response}/index.d.ts +0 -0
@@ -0,0 +1,530 @@
1
+ /**
2
+ * We strongly discourage the use of the `async_hooks` API.
3
+ * Other APIs that can cover most of its use cases include:
4
+ *
5
+ * * `AsyncLocalStorage` tracks async context
6
+ * * `process.getActiveResourcesInfo()` tracks active resources
7
+ *
8
+ * The `node:async_hooks` module provides an API to track asynchronous resources.
9
+ * It can be accessed using:
10
+ *
11
+ * ```js
12
+ * import async_hooks from 'node:async_hooks';
13
+ * ```
14
+ * @experimental
15
+ * @see [source](https://github.com/nodejs/node/blob/v20.2.0/lib/async_hooks.js)
16
+ */
17
+ declare module 'async_hooks' {
18
+ /**
19
+ * ```js
20
+ * import { executionAsyncId } from 'node:async_hooks';
21
+ * import fs from 'node:fs';
22
+ *
23
+ * console.log(executionAsyncId()); // 1 - bootstrap
24
+ * fs.open(path, 'r', (err, fd) => {
25
+ * console.log(executionAsyncId()); // 6 - open()
26
+ * });
27
+ * ```
28
+ *
29
+ * The ID returned from `executionAsyncId()` is related to execution timing, not
30
+ * causality (which is covered by `triggerAsyncId()`):
31
+ *
32
+ * ```js
33
+ * const server = net.createServer((conn) => {
34
+ * // Returns the ID of the server, not of the new connection, because the
35
+ * // callback runs in the execution scope of the server's MakeCallback().
36
+ * async_hooks.executionAsyncId();
37
+ *
38
+ * }).listen(port, () => {
39
+ * // Returns the ID of a TickObject (process.nextTick()) because all
40
+ * // callbacks passed to .listen() are wrapped in a nextTick().
41
+ * async_hooks.executionAsyncId();
42
+ * });
43
+ * ```
44
+ *
45
+ * Promise contexts may not get precise `executionAsyncIds` by default.
46
+ * See the section on `promise execution tracking`.
47
+ * @since v8.1.0
48
+ * @return The `asyncId` of the current execution context. Useful to track when something calls.
49
+ */
50
+ function executionAsyncId(): number;
51
+ /**
52
+ * Resource objects returned by `executionAsyncResource()` are most often internal
53
+ * Node.js handle objects with undocumented APIs. Using any functions or properties
54
+ * on the object is likely to crash your application and should be avoided.
55
+ *
56
+ * Using `executionAsyncResource()` in the top-level execution context will
57
+ * return an empty object as there is no handle or request object to use,
58
+ * but having an object representing the top-level can be helpful.
59
+ *
60
+ * ```js
61
+ * import { open } from 'node:fs';
62
+ * import { executionAsyncId, executionAsyncResource } from 'node:async_hooks';
63
+ *
64
+ * console.log(executionAsyncId(), executionAsyncResource()); // 1 {}
65
+ * open(new URL(import.meta.url), 'r', (err, fd) => {
66
+ * console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap
67
+ * });
68
+ * ```
69
+ *
70
+ * This can be used to implement continuation local storage without the
71
+ * use of a tracking `Map` to store the metadata:
72
+ *
73
+ * ```js
74
+ * import { createServer } from 'node:http';
75
+ * import {
76
+ * executionAsyncId,
77
+ * executionAsyncResource,
78
+ * createHook,
79
+ * } from 'async_hooks';
80
+ * const sym = Symbol('state'); // Private symbol to avoid pollution
81
+ *
82
+ * createHook({
83
+ * init(asyncId, type, triggerAsyncId, resource) {
84
+ * const cr = executionAsyncResource();
85
+ * if (cr) {
86
+ * resource[sym] = cr[sym];
87
+ * }
88
+ * },
89
+ * }).enable();
90
+ *
91
+ * const server = createServer((req, res) => {
92
+ * executionAsyncResource()[sym] = { state: req.url };
93
+ * setTimeout(function() {
94
+ * res.end(JSON.stringify(executionAsyncResource()[sym]));
95
+ * }, 100);
96
+ * }).listen(3000);
97
+ * ```
98
+ * @since v13.9.0, v12.17.0
99
+ * @return The resource representing the current execution. Useful to store data within the resource.
100
+ */
101
+ function executionAsyncResource(): object;
102
+ /**
103
+ * ```js
104
+ * const server = net.createServer((conn) => {
105
+ * // The resource that caused (or triggered) this callback to be called
106
+ * // was that of the new connection. Thus the return value of triggerAsyncId()
107
+ * // is the asyncId of "conn".
108
+ * async_hooks.triggerAsyncId();
109
+ *
110
+ * }).listen(port, () => {
111
+ * // Even though all callbacks passed to .listen() are wrapped in a nextTick()
112
+ * // the callback itself exists because the call to the server's .listen()
113
+ * // was made. So the return value would be the ID of the server.
114
+ * async_hooks.triggerAsyncId();
115
+ * });
116
+ * ```
117
+ *
118
+ * Promise contexts may not get valid `triggerAsyncId`s by default. See
119
+ * the section on `promise execution tracking`.
120
+ * @return The ID of the resource responsible for calling the callback that is currently being executed.
121
+ */
122
+ function triggerAsyncId(): number;
123
+ interface HookCallbacks {
124
+ /**
125
+ * Called when a class is constructed that has the possibility to emit an asynchronous event.
126
+ * @param asyncId a unique ID for the async resource
127
+ * @param type the type of the async resource
128
+ * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
129
+ * @param resource reference to the resource representing the async operation, needs to be released during destroy
130
+ */
131
+ init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
132
+ /**
133
+ * When an asynchronous operation is initiated or completes a callback is called to notify the user.
134
+ * The before callback is called just before said callback is executed.
135
+ * @param asyncId the unique identifier assigned to the resource about to execute the callback.
136
+ */
137
+ before?(asyncId: number): void;
138
+ /**
139
+ * Called immediately after the callback specified in before is completed.
140
+ * @param asyncId the unique identifier assigned to the resource which has executed the callback.
141
+ */
142
+ after?(asyncId: number): void;
143
+ /**
144
+ * Called when a promise has resolve() called. This may not be in the same execution id
145
+ * as the promise itself.
146
+ * @param asyncId the unique id for the promise that was resolve()d.
147
+ */
148
+ promiseResolve?(asyncId: number): void;
149
+ /**
150
+ * Called after the resource corresponding to asyncId is destroyed
151
+ * @param asyncId a unique ID for the async resource
152
+ */
153
+ destroy?(asyncId: number): void;
154
+ }
155
+ interface AsyncHook {
156
+ /**
157
+ * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop.
158
+ */
159
+ enable(): this;
160
+ /**
161
+ * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled.
162
+ */
163
+ disable(): this;
164
+ }
165
+ /**
166
+ * Registers functions to be called for different lifetime events of each async
167
+ * operation.
168
+ *
169
+ * The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the
170
+ * respective asynchronous event during a resource's lifetime.
171
+ *
172
+ * All callbacks are optional. For example, if only resource cleanup needs to
173
+ * be tracked, then only the `destroy` callback needs to be passed. The
174
+ * specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section.
175
+ *
176
+ * ```js
177
+ * import { createHook } from 'node:async_hooks';
178
+ *
179
+ * const asyncHook = createHook({
180
+ * init(asyncId, type, triggerAsyncId, resource) { },
181
+ * destroy(asyncId) { },
182
+ * });
183
+ * ```
184
+ *
185
+ * The callbacks will be inherited via the prototype chain:
186
+ *
187
+ * ```js
188
+ * class MyAsyncCallbacks {
189
+ * init(asyncId, type, triggerAsyncId, resource) { }
190
+ * destroy(asyncId) {}
191
+ * }
192
+ *
193
+ * class MyAddedCallbacks extends MyAsyncCallbacks {
194
+ * before(asyncId) { }
195
+ * after(asyncId) { }
196
+ * }
197
+ *
198
+ * const asyncHook = async_hooks.createHook(new MyAddedCallbacks());
199
+ * ```
200
+ *
201
+ * Because promises are asynchronous resources whose lifecycle is tracked
202
+ * via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises.
203
+ * @since v8.1.0
204
+ * @param callbacks The `Hook Callbacks` to register
205
+ * @return Instance used for disabling and enabling hooks
206
+ */
207
+ function createHook(callbacks: HookCallbacks): AsyncHook;
208
+ interface AsyncResourceOptions {
209
+ /**
210
+ * The ID of the execution context that created this async event.
211
+ * @default executionAsyncId()
212
+ */
213
+ triggerAsyncId?: number | undefined;
214
+ /**
215
+ * Disables automatic `emitDestroy` when the object is garbage collected.
216
+ * This usually does not need to be set (even if `emitDestroy` is called
217
+ * manually), unless the resource's `asyncId` is retrieved and the
218
+ * sensitive API's `emitDestroy` is called with it.
219
+ * @default false
220
+ */
221
+ requireManualDestroy?: boolean | undefined;
222
+ }
223
+ /**
224
+ * The class `AsyncResource` is designed to be extended by the embedder's async
225
+ * resources. Using this, users can easily trigger the lifetime events of their
226
+ * own resources.
227
+ *
228
+ * The `init` hook will trigger when an `AsyncResource` is instantiated.
229
+ *
230
+ * The following is an overview of the `AsyncResource` API.
231
+ *
232
+ * ```js
233
+ * import { AsyncResource, executionAsyncId } from 'node:async_hooks';
234
+ *
235
+ * // AsyncResource() is meant to be extended. Instantiating a
236
+ * // new AsyncResource() also triggers init. If triggerAsyncId is omitted then
237
+ * // async_hook.executionAsyncId() is used.
238
+ * const asyncResource = new AsyncResource(
239
+ * type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false },
240
+ * );
241
+ *
242
+ * // Run a function in the execution context of the resource. This will
243
+ * // * establish the context of the resource
244
+ * // * trigger the AsyncHooks before callbacks
245
+ * // * call the provided function `fn` with the supplied arguments
246
+ * // * trigger the AsyncHooks after callbacks
247
+ * // * restore the original execution context
248
+ * asyncResource.runInAsyncScope(fn, thisArg, ...args);
249
+ *
250
+ * // Call AsyncHooks destroy callbacks.
251
+ * asyncResource.emitDestroy();
252
+ *
253
+ * // Return the unique ID assigned to the AsyncResource instance.
254
+ * asyncResource.asyncId();
255
+ *
256
+ * // Return the trigger ID for the AsyncResource instance.
257
+ * asyncResource.triggerAsyncId();
258
+ * ```
259
+ */
260
+ class AsyncResource {
261
+ /**
262
+ * AsyncResource() is meant to be extended. Instantiating a
263
+ * new AsyncResource() also triggers init. If triggerAsyncId is omitted then
264
+ * async_hook.executionAsyncId() is used.
265
+ * @param type The type of async event.
266
+ * @param triggerAsyncId The ID of the execution context that created
267
+ * this async event (default: `executionAsyncId()`), or an
268
+ * AsyncResourceOptions object (since v9.3.0)
269
+ */
270
+ constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions);
271
+ /**
272
+ * Binds the given function to the current execution context.
273
+ * @since v14.8.0, v12.19.0
274
+ * @param fn The function to bind to the current execution context.
275
+ * @param type An optional name to associate with the underlying `AsyncResource`.
276
+ */
277
+ static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(fn: Func, type?: string, thisArg?: ThisArg): Func;
278
+ /**
279
+ * Binds the given function to execute to this `AsyncResource`'s scope.
280
+ * @since v14.8.0, v12.19.0
281
+ * @param fn The function to bind to the current `AsyncResource`.
282
+ */
283
+ bind<Func extends (...args: any[]) => any>(fn: Func): Func;
284
+ /**
285
+ * Call the provided function with the provided arguments in the execution context
286
+ * of the async resource. This will establish the context, trigger the AsyncHooks
287
+ * before callbacks, call the function, trigger the AsyncHooks after callbacks, and
288
+ * then restore the original execution context.
289
+ * @since v9.6.0
290
+ * @param fn The function to call in the execution context of this async resource.
291
+ * @param thisArg The receiver to be used for the function call.
292
+ * @param args Optional arguments to pass to the function.
293
+ */
294
+ runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
295
+ /**
296
+ * Call all `destroy` hooks. This should only ever be called once. An error will
297
+ * be thrown if it is called more than once. This **must** be manually called. If
298
+ * the resource is left to be collected by the GC then the `destroy` hooks will
299
+ * never be called.
300
+ * @return A reference to `asyncResource`.
301
+ */
302
+ emitDestroy(): this;
303
+ /**
304
+ * @return The unique `asyncId` assigned to the resource.
305
+ */
306
+ asyncId(): number;
307
+ /**
308
+ *
309
+ * @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.
310
+ */
311
+ triggerAsyncId(): number;
312
+ }
313
+ /**
314
+ * This class creates stores that stay coherent through asynchronous operations.
315
+ *
316
+ * While you can create your own implementation on top of the `node:async_hooks`module, `AsyncLocalStorage` should be preferred as it is a performant and memory
317
+ * safe implementation that involves significant optimizations that are non-obvious
318
+ * to implement.
319
+ *
320
+ * The following example uses `AsyncLocalStorage` to build a simple logger
321
+ * that assigns IDs to incoming HTTP requests and includes them in messages
322
+ * logged within each request.
323
+ *
324
+ * ```js
325
+ * import http from 'node:http';
326
+ * import { AsyncLocalStorage } from 'node:async_hooks';
327
+ *
328
+ * const asyncLocalStorage = new AsyncLocalStorage();
329
+ *
330
+ * function logWithId(msg) {
331
+ * const id = asyncLocalStorage.getStore();
332
+ * console.log(`${id !== undefined ? id : '-'}:`, msg);
333
+ * }
334
+ *
335
+ * let idSeq = 0;
336
+ * http.createServer((req, res) => {
337
+ * asyncLocalStorage.run(idSeq++, () => {
338
+ * logWithId('start');
339
+ * // Imagine any chain of async operations here
340
+ * setImmediate(() => {
341
+ * logWithId('finish');
342
+ * res.end();
343
+ * });
344
+ * });
345
+ * }).listen(8080);
346
+ *
347
+ * http.get('http://localhost:8080');
348
+ * http.get('http://localhost:8080');
349
+ * // Prints:
350
+ * // 0: start
351
+ * // 1: start
352
+ * // 0: finish
353
+ * // 1: finish
354
+ * ```
355
+ *
356
+ * Each instance of `AsyncLocalStorage` maintains an independent storage context.
357
+ * Multiple instances can safely exist simultaneously without risk of interfering
358
+ * with each other's data.
359
+ * @since v13.10.0, v12.17.0
360
+ */
361
+ class AsyncLocalStorage<T> {
362
+ /**
363
+ * Binds the given function to the current execution context.
364
+ * @since v19.8.0
365
+ * @experimental
366
+ * @param fn The function to bind to the current execution context.
367
+ * @return A new function that calls `fn` within the captured execution context.
368
+ */
369
+ static bind<Func extends (...args: any[]) => any>(fn: Func): Func;
370
+ /**
371
+ * Captures the current execution context and returns a function that accepts a
372
+ * function as an argument. Whenever the returned function is called, it
373
+ * calls the function passed to it within the captured context.
374
+ *
375
+ * ```js
376
+ * const asyncLocalStorage = new AsyncLocalStorage();
377
+ * const runInAsyncScope = asyncLocalStorage.run(123, () => AsyncLocalStorage.snapshot());
378
+ * const result = asyncLocalStorage.run(321, () => runInAsyncScope(() => asyncLocalStorage.getStore()));
379
+ * console.log(result); // returns 123
380
+ * ```
381
+ *
382
+ * AsyncLocalStorage.snapshot() can replace the use of AsyncResource for simple
383
+ * async context tracking purposes, for example:
384
+ *
385
+ * ```js
386
+ * class Foo {
387
+ * #runInAsyncScope = AsyncLocalStorage.snapshot();
388
+ *
389
+ * get() { return this.#runInAsyncScope(() => asyncLocalStorage.getStore()); }
390
+ * }
391
+ *
392
+ * const foo = asyncLocalStorage.run(123, () => new Foo());
393
+ * console.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123
394
+ * ```
395
+ * @since v19.8.0
396
+ * @experimental
397
+ * @return A new function with the signature `(fn: (...args) : R, ...args) : R`.
398
+ */
399
+ static snapshot(): <R, TArgs extends any[]>(fn: (...args: TArgs) => R, ...args: TArgs) => R;
400
+ /**
401
+ * Disables the instance of `AsyncLocalStorage`. All subsequent calls
402
+ * to `asyncLocalStorage.getStore()` will return `undefined` until`asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` is called again.
403
+ *
404
+ * When calling `asyncLocalStorage.disable()`, all current contexts linked to the
405
+ * instance will be exited.
406
+ *
407
+ * Calling `asyncLocalStorage.disable()` is required before the`asyncLocalStorage` can be garbage collected. This does not apply to stores
408
+ * provided by the `asyncLocalStorage`, as those objects are garbage collected
409
+ * along with the corresponding async resources.
410
+ *
411
+ * Use this method when the `asyncLocalStorage` is not in use anymore
412
+ * in the current process.
413
+ * @since v13.10.0, v12.17.0
414
+ * @experimental
415
+ */
416
+ disable(): void;
417
+ /**
418
+ * Returns the current store.
419
+ * If called outside of an asynchronous context initialized by
420
+ * calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it
421
+ * returns `undefined`.
422
+ * @since v13.10.0, v12.17.0
423
+ */
424
+ getStore(): T | undefined;
425
+ /**
426
+ * Runs a function synchronously within a context and returns its
427
+ * return value. The store is not accessible outside of the callback function.
428
+ * The store is accessible to any asynchronous operations created within the
429
+ * callback.
430
+ *
431
+ * The optional `args` are passed to the callback function.
432
+ *
433
+ * If the callback function throws an error, the error is thrown by `run()` too.
434
+ * The stacktrace is not impacted by this call and the context is exited.
435
+ *
436
+ * Example:
437
+ *
438
+ * ```js
439
+ * const store = { id: 2 };
440
+ * try {
441
+ * asyncLocalStorage.run(store, () => {
442
+ * asyncLocalStorage.getStore(); // Returns the store object
443
+ * setTimeout(() => {
444
+ * asyncLocalStorage.getStore(); // Returns the store object
445
+ * }, 200);
446
+ * throw new Error();
447
+ * });
448
+ * } catch (e) {
449
+ * asyncLocalStorage.getStore(); // Returns undefined
450
+ * // The error will be caught here
451
+ * }
452
+ * ```
453
+ * @since v13.10.0, v12.17.0
454
+ */
455
+ run<R, TArgs extends any[]>(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R;
456
+ /**
457
+ * Runs a function synchronously outside of a context and returns its
458
+ * return value. The store is not accessible within the callback function or
459
+ * the asynchronous operations created within the callback. Any `getStore()`call done within the callback function will always return `undefined`.
460
+ *
461
+ * The optional `args` are passed to the callback function.
462
+ *
463
+ * If the callback function throws an error, the error is thrown by `exit()` too.
464
+ * The stacktrace is not impacted by this call and the context is re-entered.
465
+ *
466
+ * Example:
467
+ *
468
+ * ```js
469
+ * // Within a call to run
470
+ * try {
471
+ * asyncLocalStorage.getStore(); // Returns the store object or value
472
+ * asyncLocalStorage.exit(() => {
473
+ * asyncLocalStorage.getStore(); // Returns undefined
474
+ * throw new Error();
475
+ * });
476
+ * } catch (e) {
477
+ * asyncLocalStorage.getStore(); // Returns the same object or value
478
+ * // The error will be caught here
479
+ * }
480
+ * ```
481
+ * @since v13.10.0, v12.17.0
482
+ * @experimental
483
+ */
484
+ exit<R, TArgs extends any[]>(callback: (...args: TArgs) => R, ...args: TArgs): R;
485
+ /**
486
+ * Transitions into the context for the remainder of the current
487
+ * synchronous execution and then persists the store through any following
488
+ * asynchronous calls.
489
+ *
490
+ * Example:
491
+ *
492
+ * ```js
493
+ * const store = { id: 1 };
494
+ * // Replaces previous store with the given store object
495
+ * asyncLocalStorage.enterWith(store);
496
+ * asyncLocalStorage.getStore(); // Returns the store object
497
+ * someAsyncOperation(() => {
498
+ * asyncLocalStorage.getStore(); // Returns the same object
499
+ * });
500
+ * ```
501
+ *
502
+ * This transition will continue for the _entire_ synchronous execution.
503
+ * This means that if, for example, the context is entered within an event
504
+ * handler subsequent event handlers will also run within that context unless
505
+ * specifically bound to another context with an `AsyncResource`. That is why`run()` should be preferred over `enterWith()` unless there are strong reasons
506
+ * to use the latter method.
507
+ *
508
+ * ```js
509
+ * const store = { id: 1 };
510
+ *
511
+ * emitter.on('my-event', () => {
512
+ * asyncLocalStorage.enterWith(store);
513
+ * });
514
+ * emitter.on('my-event', () => {
515
+ * asyncLocalStorage.getStore(); // Returns the same object
516
+ * });
517
+ *
518
+ * asyncLocalStorage.getStore(); // Returns undefined
519
+ * emitter.emit('my-event');
520
+ * asyncLocalStorage.getStore(); // Returns the same object
521
+ * ```
522
+ * @since v13.11.0, v12.17.0
523
+ * @experimental
524
+ */
525
+ enterWith(store: T): void;
526
+ }
527
+ }
528
+ declare module 'node:async_hooks' {
529
+ export * from 'async_hooks';
530
+ }