cloudstructs 0.9.39 → 0.9.40

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 (263) hide show
  1. package/.jsii +4 -4
  2. package/assets/slack-textract/detect.lambda/index.js +232 -5
  3. package/lib/codecommit-mirror/index.js +2 -2
  4. package/lib/dmarc/index.js +1 -1
  5. package/lib/ecs-service-roller/index.js +2 -2
  6. package/lib/email-receiver/receiver.js +1 -1
  7. package/lib/mjml-template/index.js +1 -1
  8. package/lib/saml-identity-provider/index.js +2 -2
  9. package/lib/slack-app/manifest.js +1 -1
  10. package/lib/slack-app/slack-app.js +2 -2
  11. package/lib/slack-events/index.js +1 -1
  12. package/lib/slack-textract/index.js +1 -1
  13. package/lib/ssl-server-test/index.js +1 -1
  14. package/lib/state-machine-cr-provider/index.js +1 -1
  15. package/lib/static-website/index.js +1 -1
  16. package/lib/toolkit-cleaner/index.js +1 -1
  17. package/lib/url-shortener/index.js +1 -1
  18. package/node_modules/@slack/logger/node_modules/@types/node/README.md +1 -1
  19. package/node_modules/@slack/logger/node_modules/@types/node/assert.d.ts +1 -1
  20. package/node_modules/@slack/logger/node_modules/@types/node/child_process.d.ts +15 -9
  21. package/node_modules/@slack/logger/node_modules/@types/node/cluster.d.ts +4 -5
  22. package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +900 -193
  23. package/node_modules/@slack/logger/node_modules/@types/node/diagnostics_channel.d.ts +0 -2
  24. package/node_modules/@slack/logger/node_modules/@types/node/dns.d.ts +1 -1
  25. package/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +1 -1
  26. package/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +15 -11
  27. package/node_modules/@slack/logger/node_modules/@types/node/globals.d.ts +2 -0
  28. package/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +14 -5
  29. package/node_modules/@slack/logger/node_modules/@types/node/http2.d.ts +149 -30
  30. package/node_modules/@slack/logger/node_modules/@types/node/https.d.ts +9 -12
  31. package/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +2 -0
  32. package/node_modules/@slack/logger/node_modules/@types/node/inspector.d.ts +24 -0
  33. package/node_modules/@slack/logger/node_modules/@types/node/inspector.generated.d.ts +181 -0
  34. package/node_modules/@slack/logger/node_modules/@types/node/net.d.ts +5 -5
  35. package/node_modules/@slack/logger/node_modules/@types/node/os.d.ts +13 -3
  36. package/node_modules/@slack/logger/node_modules/@types/node/package.json +3 -3
  37. package/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +6 -8
  38. package/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +7 -19
  39. package/node_modules/@slack/logger/node_modules/@types/node/readline/promises.d.ts +1 -1
  40. package/node_modules/@slack/logger/node_modules/@types/node/sea.d.ts +9 -0
  41. package/node_modules/@slack/logger/node_modules/@types/node/sqlite.d.ts +6 -4
  42. package/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +6 -55
  43. package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +38 -23
  44. package/node_modules/@slack/logger/node_modules/@types/node/test.d.ts +29 -3
  45. package/node_modules/@slack/logger/node_modules/@types/node/tls.d.ts +2 -2
  46. package/node_modules/@slack/logger/node_modules/@types/node/ts5.6/index.d.ts +2 -0
  47. package/node_modules/@slack/logger/node_modules/@types/node/ts5.7/index.d.ts +2 -0
  48. package/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +1 -1
  49. package/node_modules/@slack/logger/node_modules/@types/node/v8.d.ts +18 -2
  50. package/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +146 -86
  51. package/node_modules/@slack/logger/node_modules/@types/node/wasi.d.ts +1 -1
  52. package/node_modules/@slack/logger/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
  53. package/node_modules/@slack/logger/node_modules/@types/node/web-globals/streams.d.ts +22 -0
  54. package/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +39 -1
  55. package/node_modules/@slack/logger/node_modules/undici-types/eventsource.d.ts +6 -1
  56. package/node_modules/@slack/logger/node_modules/undici-types/index.d.ts +4 -1
  57. package/node_modules/@slack/logger/node_modules/undici-types/package.json +1 -1
  58. package/node_modules/@slack/types/dist/block-kit/block-elements.d.ts +79 -3
  59. package/node_modules/@slack/types/dist/block-kit/block-elements.d.ts.map +1 -1
  60. package/node_modules/@slack/types/dist/block-kit/blocks.d.ts +19 -2
  61. package/node_modules/@slack/types/dist/block-kit/blocks.d.ts.map +1 -1
  62. package/node_modules/@slack/types/dist/events/message.d.ts +1 -0
  63. package/node_modules/@slack/types/dist/events/message.d.ts.map +1 -1
  64. package/node_modules/@slack/types/package.json +2 -2
  65. package/node_modules/@slack/web-api/README.md +5 -5
  66. package/node_modules/@slack/web-api/dist/WebClient.d.ts +30 -3
  67. package/node_modules/@slack/web-api/dist/WebClient.d.ts.map +1 -1
  68. package/node_modules/@slack/web-api/dist/WebClient.js +43 -0
  69. package/node_modules/@slack/web-api/dist/WebClient.js.map +1 -1
  70. package/node_modules/@slack/web-api/dist/chat-stream.d.ts +86 -0
  71. package/node_modules/@slack/web-api/dist/chat-stream.d.ts.map +1 -0
  72. package/node_modules/@slack/web-api/dist/chat-stream.js +149 -0
  73. package/node_modules/@slack/web-api/dist/chat-stream.js.map +1 -0
  74. package/node_modules/@slack/web-api/dist/methods.d.ts +15 -3
  75. package/node_modules/@slack/web-api/dist/methods.d.ts.map +1 -1
  76. package/node_modules/@slack/web-api/dist/methods.js +13 -1
  77. package/node_modules/@slack/web-api/dist/methods.js.map +1 -1
  78. package/node_modules/@slack/web-api/dist/types/request/assistant.d.ts +2 -0
  79. package/node_modules/@slack/web-api/dist/types/request/assistant.d.ts.map +1 -1
  80. package/node_modules/@slack/web-api/dist/types/request/chat.d.ts +28 -6
  81. package/node_modules/@slack/web-api/dist/types/request/chat.d.ts.map +1 -1
  82. package/node_modules/@slack/web-api/dist/types/request/index.d.ts +1 -1
  83. package/node_modules/@slack/web-api/dist/types/request/index.d.ts.map +1 -1
  84. package/node_modules/@slack/web-api/dist/types/response/ChatAppendStreamResponse.d.ts +10 -0
  85. package/node_modules/@slack/web-api/dist/types/response/ChatAppendStreamResponse.d.ts.map +1 -0
  86. package/node_modules/@slack/web-api/dist/types/response/ChatAppendStreamResponse.js +3 -0
  87. package/node_modules/@slack/web-api/dist/types/response/ChatAppendStreamResponse.js.map +1 -0
  88. package/node_modules/@slack/web-api/dist/types/response/ChatStartStreamResponse.d.ts +10 -0
  89. package/node_modules/@slack/web-api/dist/types/response/ChatStartStreamResponse.d.ts.map +1 -0
  90. package/node_modules/@slack/web-api/dist/types/response/ChatStartStreamResponse.js +3 -0
  91. package/node_modules/@slack/web-api/dist/types/response/ChatStartStreamResponse.js.map +1 -0
  92. package/node_modules/@slack/web-api/dist/types/response/ChatStopStreamResponse.d.ts +24 -0
  93. package/node_modules/@slack/web-api/dist/types/response/ChatStopStreamResponse.d.ts.map +1 -0
  94. package/node_modules/@slack/web-api/dist/types/response/ChatStopStreamResponse.js +3 -0
  95. package/node_modules/@slack/web-api/dist/types/response/ChatStopStreamResponse.js.map +1 -0
  96. package/node_modules/@slack/web-api/dist/types/response/index.d.ts +3 -0
  97. package/node_modules/@slack/web-api/dist/types/response/index.d.ts.map +1 -1
  98. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
  99. package/node_modules/@slack/web-api/node_modules/@types/node/assert.d.ts +1 -1
  100. package/node_modules/@slack/web-api/node_modules/@types/node/child_process.d.ts +15 -9
  101. package/node_modules/@slack/web-api/node_modules/@types/node/cluster.d.ts +4 -5
  102. package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +900 -193
  103. package/node_modules/@slack/web-api/node_modules/@types/node/diagnostics_channel.d.ts +0 -2
  104. package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +1 -1
  105. package/node_modules/@slack/web-api/node_modules/@types/node/events.d.ts +1 -1
  106. package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +15 -11
  107. package/node_modules/@slack/web-api/node_modules/@types/node/globals.d.ts +2 -0
  108. package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +14 -5
  109. package/node_modules/@slack/web-api/node_modules/@types/node/http2.d.ts +149 -30
  110. package/node_modules/@slack/web-api/node_modules/@types/node/https.d.ts +9 -12
  111. package/node_modules/@slack/web-api/node_modules/@types/node/index.d.ts +2 -0
  112. package/node_modules/@slack/web-api/node_modules/@types/node/inspector.d.ts +24 -0
  113. package/node_modules/@slack/web-api/node_modules/@types/node/inspector.generated.d.ts +181 -0
  114. package/node_modules/@slack/web-api/node_modules/@types/node/net.d.ts +5 -5
  115. package/node_modules/@slack/web-api/node_modules/@types/node/os.d.ts +13 -3
  116. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +3 -3
  117. package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +6 -8
  118. package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +7 -19
  119. package/node_modules/@slack/web-api/node_modules/@types/node/readline/promises.d.ts +1 -1
  120. package/node_modules/@slack/web-api/node_modules/@types/node/sea.d.ts +9 -0
  121. package/node_modules/@slack/web-api/node_modules/@types/node/sqlite.d.ts +6 -4
  122. package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +6 -55
  123. package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +38 -23
  124. package/node_modules/@slack/web-api/node_modules/@types/node/test.d.ts +29 -3
  125. package/node_modules/@slack/web-api/node_modules/@types/node/tls.d.ts +2 -2
  126. package/node_modules/@slack/web-api/node_modules/@types/node/ts5.6/index.d.ts +2 -0
  127. package/node_modules/@slack/web-api/node_modules/@types/node/ts5.7/index.d.ts +2 -0
  128. package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +1 -1
  129. package/node_modules/@slack/web-api/node_modules/@types/node/v8.d.ts +18 -2
  130. package/node_modules/@slack/web-api/node_modules/@types/node/vm.d.ts +146 -86
  131. package/node_modules/@slack/web-api/node_modules/@types/node/wasi.d.ts +1 -1
  132. package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
  133. package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/streams.d.ts +22 -0
  134. package/node_modules/@slack/web-api/node_modules/@types/node/worker_threads.d.ts +39 -1
  135. package/node_modules/@slack/web-api/node_modules/undici-types/eventsource.d.ts +6 -1
  136. package/node_modules/@slack/web-api/node_modules/undici-types/index.d.ts +4 -1
  137. package/node_modules/@slack/web-api/node_modules/undici-types/package.json +1 -1
  138. package/node_modules/@slack/web-api/package.json +4 -4
  139. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +1 -1
  140. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +1 -1
  141. package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +15 -9
  142. package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +4 -5
  143. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +900 -193
  144. package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +0 -2
  145. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +1 -1
  146. package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +1 -1
  147. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +15 -11
  148. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +2 -0
  149. package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +14 -5
  150. package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +149 -30
  151. package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +9 -12
  152. package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +2 -0
  153. package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +24 -0
  154. package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.generated.d.ts +181 -0
  155. package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +5 -5
  156. package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +13 -3
  157. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +3 -3
  158. package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +6 -8
  159. package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +7 -19
  160. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline/promises.d.ts +1 -1
  161. package/node_modules/@types/cacheable-request/node_modules/@types/node/sea.d.ts +9 -0
  162. package/node_modules/@types/cacheable-request/node_modules/@types/node/sqlite.d.ts +6 -4
  163. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +6 -55
  164. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +38 -23
  165. package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +29 -3
  166. package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +2 -2
  167. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/index.d.ts +2 -0
  168. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.7/index.d.ts +2 -0
  169. package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +1 -1
  170. package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +18 -2
  171. package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +146 -86
  172. package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +1 -1
  173. package/node_modules/@types/cacheable-request/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
  174. package/node_modules/@types/cacheable-request/node_modules/@types/node/web-globals/streams.d.ts +22 -0
  175. package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +39 -1
  176. package/node_modules/@types/cacheable-request/node_modules/undici-types/eventsource.d.ts +6 -1
  177. package/node_modules/@types/cacheable-request/node_modules/undici-types/index.d.ts +4 -1
  178. package/node_modules/@types/cacheable-request/node_modules/undici-types/package.json +1 -1
  179. package/node_modules/@types/keyv/node_modules/@types/node/README.md +1 -1
  180. package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +1 -1
  181. package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +15 -9
  182. package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +4 -5
  183. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +900 -193
  184. package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +0 -2
  185. package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +1 -1
  186. package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +1 -1
  187. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +15 -11
  188. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +2 -0
  189. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +14 -5
  190. package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +149 -30
  191. package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +9 -12
  192. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +2 -0
  193. package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +24 -0
  194. package/node_modules/@types/keyv/node_modules/@types/node/inspector.generated.d.ts +181 -0
  195. package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +5 -5
  196. package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +13 -3
  197. package/node_modules/@types/keyv/node_modules/@types/node/package.json +3 -3
  198. package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +6 -8
  199. package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +7 -19
  200. package/node_modules/@types/keyv/node_modules/@types/node/readline/promises.d.ts +1 -1
  201. package/node_modules/@types/keyv/node_modules/@types/node/sea.d.ts +9 -0
  202. package/node_modules/@types/keyv/node_modules/@types/node/sqlite.d.ts +6 -4
  203. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +6 -55
  204. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +38 -23
  205. package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +29 -3
  206. package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +2 -2
  207. package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/index.d.ts +2 -0
  208. package/node_modules/@types/keyv/node_modules/@types/node/ts5.7/index.d.ts +2 -0
  209. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +1 -1
  210. package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +18 -2
  211. package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +146 -86
  212. package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +1 -1
  213. package/node_modules/@types/keyv/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
  214. package/node_modules/@types/keyv/node_modules/@types/node/web-globals/streams.d.ts +22 -0
  215. package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +39 -1
  216. package/node_modules/@types/keyv/node_modules/undici-types/eventsource.d.ts +6 -1
  217. package/node_modules/@types/keyv/node_modules/undici-types/index.d.ts +4 -1
  218. package/node_modules/@types/keyv/node_modules/undici-types/package.json +1 -1
  219. package/node_modules/@types/responselike/node_modules/@types/node/README.md +1 -1
  220. package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +1 -1
  221. package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +15 -9
  222. package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +4 -5
  223. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +900 -193
  224. package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +0 -2
  225. package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +1 -1
  226. package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +1 -1
  227. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +15 -11
  228. package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +2 -0
  229. package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +14 -5
  230. package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +149 -30
  231. package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +9 -12
  232. package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +2 -0
  233. package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +24 -0
  234. package/node_modules/@types/responselike/node_modules/@types/node/inspector.generated.d.ts +181 -0
  235. package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +5 -5
  236. package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +13 -3
  237. package/node_modules/@types/responselike/node_modules/@types/node/package.json +3 -3
  238. package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +6 -8
  239. package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +7 -19
  240. package/node_modules/@types/responselike/node_modules/@types/node/readline/promises.d.ts +1 -1
  241. package/node_modules/@types/responselike/node_modules/@types/node/sea.d.ts +9 -0
  242. package/node_modules/@types/responselike/node_modules/@types/node/sqlite.d.ts +6 -4
  243. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +6 -55
  244. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +38 -23
  245. package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +29 -3
  246. package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +2 -2
  247. package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/index.d.ts +2 -0
  248. package/node_modules/@types/responselike/node_modules/@types/node/ts5.7/index.d.ts +2 -0
  249. package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +1 -1
  250. package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +18 -2
  251. package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +146 -86
  252. package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +1 -1
  253. package/node_modules/@types/responselike/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
  254. package/node_modules/@types/responselike/node_modules/@types/node/web-globals/streams.d.ts +22 -0
  255. package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +39 -1
  256. package/node_modules/@types/responselike/node_modules/undici-types/eventsource.d.ts +6 -1
  257. package/node_modules/@types/responselike/node_modules/undici-types/index.d.ts +4 -1
  258. package/node_modules/@types/responselike/node_modules/undici-types/package.json +1 -1
  259. package/node_modules/semver/classes/range.js +1 -0
  260. package/node_modules/semver/classes/semver.js +19 -5
  261. package/node_modules/semver/internal/identifiers.js +4 -0
  262. package/node_modules/semver/package.json +3 -3
  263. package/package.json +18 -18
@@ -45,22 +45,22 @@ declare module "stream" {
45
45
  emitClose?: boolean | undefined;
46
46
  highWaterMark?: number | undefined;
47
47
  objectMode?: boolean | undefined;
48
- construct?(this: T, callback: (error?: Error | null) => void): void;
49
- destroy?(this: T, error: Error | null, callback: (error?: Error | null) => void): void;
48
+ construct?: ((this: T, callback: (error?: Error | null) => void) => void) | undefined;
49
+ destroy?: ((this: T, error: Error | null, callback: (error?: Error | null) => void) => void) | undefined;
50
50
  autoDestroy?: boolean | undefined;
51
51
  }
52
52
  interface ReadableOptions<T extends Readable = Readable> extends StreamOptions<T> {
53
53
  encoding?: BufferEncoding | undefined;
54
- read?(this: T, size: number): void;
54
+ read?: ((this: T, size: number) => void) | undefined;
55
55
  }
56
56
  interface ArrayOptions {
57
57
  /**
58
58
  * The maximum concurrent invocations of `fn` to call on the stream at once.
59
59
  * @default 1
60
60
  */
61
- concurrency?: number;
61
+ concurrency?: number | undefined;
62
62
  /** Allows destroying the stream if the signal is aborted. */
63
- signal?: AbortSignal;
63
+ signal?: AbortSignal | undefined;
64
64
  }
65
65
  /**
66
66
  * @since v0.9.4
@@ -697,21 +697,25 @@ declare module "stream" {
697
697
  interface WritableOptions<T extends Writable = Writable> extends StreamOptions<T> {
698
698
  decodeStrings?: boolean | undefined;
699
699
  defaultEncoding?: BufferEncoding | undefined;
700
- write?(
701
- this: T,
702
- chunk: any,
703
- encoding: BufferEncoding,
704
- callback: (error?: Error | null) => void,
705
- ): void;
706
- writev?(
707
- this: T,
708
- chunks: Array<{
709
- chunk: any;
710
- encoding: BufferEncoding;
711
- }>,
712
- callback: (error?: Error | null) => void,
713
- ): void;
714
- final?(this: T, callback: (error?: Error | null) => void): void;
700
+ write?:
701
+ | ((
702
+ this: T,
703
+ chunk: any,
704
+ encoding: BufferEncoding,
705
+ callback: (error?: Error | null) => void,
706
+ ) => void)
707
+ | undefined;
708
+ writev?:
709
+ | ((
710
+ this: T,
711
+ chunks: Array<{
712
+ chunk: any;
713
+ encoding: BufferEncoding;
714
+ }>,
715
+ callback: (error?: Error | null) => void,
716
+ ) => void)
717
+ | undefined;
718
+ final?: ((this: T, callback: (error?: Error | null) => void) => void) | undefined;
715
719
  }
716
720
  /**
717
721
  * @since v0.9.4
@@ -1235,8 +1239,10 @@ declare module "stream" {
1235
1239
  function duplexPair(options?: DuplexOptions): [Duplex, Duplex];
1236
1240
  type TransformCallback = (error?: Error | null, data?: any) => void;
1237
1241
  interface TransformOptions<T extends Transform = Transform> extends DuplexOptions<T> {
1238
- transform?(this: T, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void;
1239
- flush?(this: T, callback: TransformCallback): void;
1242
+ transform?:
1243
+ | ((this: T, chunk: any, encoding: BufferEncoding, callback: TransformCallback) => void)
1244
+ | undefined;
1245
+ flush?: ((this: T, callback: TransformCallback) => void) | undefined;
1240
1246
  }
1241
1247
  /**
1242
1248
  * Transform streams are `Duplex` streams where the output is in some way
@@ -1643,12 +1649,14 @@ declare module "stream" {
1643
1649
  ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
1644
1650
  ): Promise<void>;
1645
1651
  }
1652
+ // TODO: this interface never existed; remove in next major
1646
1653
  interface Pipe {
1647
1654
  close(): void;
1648
1655
  hasRef(): boolean;
1649
1656
  ref(): void;
1650
1657
  unref(): void;
1651
1658
  }
1659
+ // TODO: these should all take webstream arguments
1652
1660
  /**
1653
1661
  * Returns whether the stream has encountered an error.
1654
1662
  * @since v17.3.0, v16.14.0
@@ -1657,8 +1665,15 @@ declare module "stream" {
1657
1665
  /**
1658
1666
  * Returns whether the stream is readable.
1659
1667
  * @since v17.4.0, v16.14.0
1668
+ * @returns Only returns `null` if `stream` is not a valid `Readable`, `Duplex` or `ReadableStream`.
1669
+ */
1670
+ function isReadable(stream: Readable | NodeJS.ReadableStream): boolean | null;
1671
+ /**
1672
+ * Returns whether the stream is writable.
1673
+ * @since v20.0.0
1674
+ * @returns Only returns `null` if `stream` is not a valid `Writable`, `Duplex` or `WritableStream`.
1660
1675
  */
1661
- function isReadable(stream: Readable | NodeJS.ReadableStream): boolean;
1676
+ function isWritable(stream: Writable | NodeJS.WritableStream): boolean | null;
1662
1677
  }
1663
1678
  export = Stream;
1664
1679
  }
@@ -343,6 +343,13 @@ declare module "node:test" {
343
343
  * @default undefined
344
344
  */
345
345
  shard?: TestShard | undefined;
346
+ /**
347
+ * A file path where the test runner will
348
+ * store the state of the tests to allow rerunning only the failed tests on a next run.
349
+ * @since v24.7.0
350
+ * @default undefined
351
+ */
352
+ rerunFailuresFilePath?: string | undefined;
346
353
  /**
347
354
  * enable [code coverage](https://nodejs.org/docs/latest-v24.x/api/test.html#collecting-code-coverage) collection.
348
355
  * @since v22.10.0
@@ -711,7 +718,7 @@ declare module "node:test" {
711
718
  /**
712
719
  * The type of the test, used to denote whether this is a suite.
713
720
  */
714
- type?: "suite";
721
+ type?: "suite" | "test";
715
722
  };
716
723
  /**
717
724
  * The test name.
@@ -781,7 +788,13 @@ declare module "node:test" {
781
788
  * The type of the test, used to denote whether this is a suite.
782
789
  * @since v20.0.0, v19.9.0, v18.17.0
783
790
  */
784
- type?: "suite";
791
+ type?: "suite" | "test";
792
+ /**
793
+ * The attempt number of the test run,
794
+ * present only when using the `--test-rerun-failures` flag.
795
+ * @since v24.7.0
796
+ */
797
+ attempt?: number;
785
798
  };
786
799
  /**
787
800
  * The test name.
@@ -817,7 +830,19 @@ declare module "node:test" {
817
830
  * The type of the test, used to denote whether this is a suite.
818
831
  * @since 20.0.0, 19.9.0, 18.17.0
819
832
  */
820
- type?: "suite";
833
+ type?: "suite" | "test";
834
+ /**
835
+ * The attempt number of the test run,
836
+ * present only when using the `--test-rerun-failures` flag.
837
+ * @since v24.7.0
838
+ */
839
+ attempt?: number;
840
+ /**
841
+ * The attempt number the test passed on,
842
+ * present only when using the `--test-rerun-failures` flag.
843
+ * @since v24.7.0
844
+ */
845
+ passed_on_attempt?: number;
821
846
  };
822
847
  /**
823
848
  * The test name.
@@ -962,6 +987,7 @@ declare module "node:test" {
962
987
  * @since v22.2.0, v20.15.0
963
988
  */
964
989
  readonly assert: TestContextAssert;
990
+ readonly attempt: number;
965
991
  /**
966
992
  * This function is used to create a hook running before subtest of the current test.
967
993
  * @param fn The hook function. The first argument to this function is a `TestContext` object.
@@ -586,7 +586,7 @@ declare module "tls" {
586
586
  * requires explicitly specifying a cipher suite with the `ciphers` option.
587
587
  * More information can be found in the RFC 4279.
588
588
  */
589
- pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null;
589
+ pskCallback?: ((socket: TLSSocket, identity: string) => NodeJS.ArrayBufferView | null) | undefined;
590
590
  /**
591
591
  * hint to send to a client to help
592
592
  * with selecting the identity during TLS-PSK negotiation. Will be ignored
@@ -627,7 +627,7 @@ declare module "tls" {
627
627
  * compatible with the selected cipher's digest.
628
628
  * `identity` must use UTF-8 encoding.
629
629
  */
630
- pskCallback?(hint: string | null): PSKCallbackNegotation | null;
630
+ pskCallback?: ((hint: string | null) => PSKCallbackNegotation | null) | undefined;
631
631
  }
632
632
  /**
633
633
  * Accepts encrypted connections using TLS or SSL.
@@ -41,11 +41,13 @@
41
41
  // Definitions for Node.js modules that are not specific to any version of TypeScript:
42
42
  /// <reference path="../globals.d.ts" />
43
43
  /// <reference path="../web-globals/abortcontroller.d.ts" />
44
+ /// <reference path="../web-globals/crypto.d.ts" />
44
45
  /// <reference path="../web-globals/domexception.d.ts" />
45
46
  /// <reference path="../web-globals/events.d.ts" />
46
47
  /// <reference path="../web-globals/fetch.d.ts" />
47
48
  /// <reference path="../web-globals/navigator.d.ts" />
48
49
  /// <reference path="../web-globals/storage.d.ts" />
50
+ /// <reference path="../web-globals/streams.d.ts" />
49
51
  /// <reference path="../assert.d.ts" />
50
52
  /// <reference path="../assert/strict.d.ts" />
51
53
  /// <reference path="../async_hooks.d.ts" />
@@ -41,11 +41,13 @@
41
41
  // Definitions for Node.js modules that are not specific to any version of TypeScript:
42
42
  /// <reference path="../globals.d.ts" />
43
43
  /// <reference path="../web-globals/abortcontroller.d.ts" />
44
+ /// <reference path="../web-globals/crypto.d.ts" />
44
45
  /// <reference path="../web-globals/domexception.d.ts" />
45
46
  /// <reference path="../web-globals/events.d.ts" />
46
47
  /// <reference path="../web-globals/fetch.d.ts" />
47
48
  /// <reference path="../web-globals/navigator.d.ts" />
48
49
  /// <reference path="../web-globals/storage.d.ts" />
50
+ /// <reference path="../web-globals/streams.d.ts" />
49
51
  /// <reference path="../assert.d.ts" />
50
52
  /// <reference path="../assert/strict.d.ts" />
51
53
  /// <reference path="../async_hooks.d.ts" />
@@ -1442,7 +1442,7 @@ declare module "util" {
1442
1442
  /**
1443
1443
  * Array of argument strings.
1444
1444
  */
1445
- args?: string[] | undefined;
1445
+ args?: readonly string[] | undefined;
1446
1446
  /**
1447
1447
  * Used to describe arguments known to the parser.
1448
1448
  */
@@ -43,12 +43,12 @@ declare module "v8" {
43
43
  * If true, expose internals in the heap snapshot.
44
44
  * @default false
45
45
  */
46
- exposeInternals?: boolean;
46
+ exposeInternals?: boolean | undefined;
47
47
  /**
48
48
  * If true, expose numeric values in artificial fields.
49
49
  * @default false
50
50
  */
51
- exposeNumericValues?: boolean;
51
+ exposeNumericValues?: boolean | undefined;
52
52
  }
53
53
  /**
54
54
  * Returns an integer representing a version tag derived from the V8 version,
@@ -400,6 +400,22 @@ declare module "v8" {
400
400
  * @since v12.8.0
401
401
  */
402
402
  function getHeapCodeStatistics(): HeapCodeStatistics;
403
+ /**
404
+ * @since v24.8.0
405
+ */
406
+ interface CPUProfileHandle {
407
+ /**
408
+ * Stopping collecting the profile, then return a Promise that fulfills with an error or the
409
+ * profile data.
410
+ * @since v24.8.0
411
+ */
412
+ stop(): Promise<string>;
413
+ /**
414
+ * Stopping collecting the profile and the profile will be discarded.
415
+ * @since v24.8.0
416
+ */
417
+ [Symbol.asyncDispose](): Promise<void>;
418
+ }
403
419
  /**
404
420
  * V8 only supports `Latin-1/ISO-8859-1` and `UTF16` as the underlying representation of a string.
405
421
  * If the `content` uses `Latin-1/ISO-8859-1` as the underlying representation, this function will return true;
@@ -99,28 +99,22 @@ declare module "vm" {
99
99
  */
100
100
  breakOnSigint?: boolean | undefined;
101
101
  }
102
- interface RunningScriptInNewContextOptions extends RunningScriptOptions {
102
+ interface RunningScriptInNewContextOptions
103
+ extends RunningScriptOptions, Pick<CreateContextOptions, "microtaskMode">
104
+ {
103
105
  /**
104
106
  * Human-readable name of the newly created context.
105
107
  */
106
- contextName?: CreateContextOptions["name"];
108
+ contextName?: CreateContextOptions["name"] | undefined;
107
109
  /**
108
110
  * Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL,
109
111
  * but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object.
110
112
  * Most notably, this string should omit the trailing slash, as that denotes a path.
111
113
  */
112
- contextOrigin?: CreateContextOptions["origin"];
113
- contextCodeGeneration?: CreateContextOptions["codeGeneration"];
114
- /**
115
- * If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
116
- */
117
- microtaskMode?: CreateContextOptions["microtaskMode"];
114
+ contextOrigin?: CreateContextOptions["origin"] | undefined;
115
+ contextCodeGeneration?: CreateContextOptions["codeGeneration"] | undefined;
118
116
  }
119
- interface RunningCodeOptions extends RunningScriptOptions {
120
- /**
121
- * Provides an optional data with V8's code cache data for the supplied source.
122
- */
123
- cachedData?: ScriptOptions["cachedData"] | undefined;
117
+ interface RunningCodeOptions extends RunningScriptOptions, Pick<ScriptOptions, "cachedData"> {
124
118
  /**
125
119
  * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
126
120
  * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
@@ -132,11 +126,9 @@ declare module "vm" {
132
126
  | typeof constants.USE_MAIN_CONTEXT_DEFAULT_LOADER
133
127
  | undefined;
134
128
  }
135
- interface RunningCodeInNewContextOptions extends RunningScriptInNewContextOptions {
136
- /**
137
- * Provides an optional data with V8's code cache data for the supplied source.
138
- */
139
- cachedData?: ScriptOptions["cachedData"] | undefined;
129
+ interface RunningCodeInNewContextOptions
130
+ extends RunningScriptInNewContextOptions, Pick<ScriptOptions, "cachedData">
131
+ {
140
132
  /**
141
133
  * Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is
142
134
  * part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see
@@ -148,16 +140,7 @@ declare module "vm" {
148
140
  | typeof constants.USE_MAIN_CONTEXT_DEFAULT_LOADER
149
141
  | undefined;
150
142
  }
151
- interface CompileFunctionOptions extends BaseOptions {
152
- /**
153
- * Provides an optional data with V8's code cache data for the supplied source.
154
- */
155
- cachedData?: ScriptOptions["cachedData"] | undefined;
156
- /**
157
- * Specifies whether to produce new cache data.
158
- * @default false
159
- */
160
- produceCachedData?: boolean | undefined;
143
+ interface CompileFunctionOptions extends BaseOptions, Pick<ScriptOptions, "cachedData" | "produceCachedData"> {
161
144
  /**
162
145
  * The sandbox/context in which the said function should be compiled in.
163
146
  */
@@ -386,15 +369,15 @@ declare module "vm" {
386
369
  */
387
370
  createCachedData(): Buffer;
388
371
  /** @deprecated in favor of `script.createCachedData()` */
389
- cachedDataProduced?: boolean | undefined;
372
+ cachedDataProduced?: boolean;
390
373
  /**
391
374
  * When `cachedData` is supplied to create the `vm.Script`, this value will be set
392
375
  * to either `true` or `false` depending on acceptance of the data by V8.
393
376
  * Otherwise the value is `undefined`.
394
377
  * @since v5.7.0
395
378
  */
396
- cachedDataRejected?: boolean | undefined;
397
- cachedData?: Buffer | undefined;
379
+ cachedDataRejected?: boolean;
380
+ cachedData?: Buffer;
398
381
  /**
399
382
  * When the script is compiled from a source that contains a source map magic
400
383
  * comment, this property will be set to the URL of the source map.
@@ -412,7 +395,7 @@ declare module "vm" {
412
395
  * ```
413
396
  * @since v19.1.0, v18.13.0
414
397
  */
415
- sourceMapURL?: string | undefined;
398
+ sourceMapURL: string | undefined;
416
399
  }
417
400
  /**
418
401
  * If the given `contextObject` is an object, the `vm.createContext()` method will
@@ -622,11 +605,7 @@ declare module "vm" {
622
605
  code: string,
623
606
  params?: readonly string[],
624
607
  options?: CompileFunctionOptions,
625
- ): Function & {
626
- cachedData?: Script["cachedData"] | undefined;
627
- cachedDataProduced?: Script["cachedDataProduced"] | undefined;
628
- cachedDataRejected?: Script["cachedDataRejected"] | undefined;
629
- };
608
+ ): Function & Pick<Script, "cachedData" | "cachedDataProduced" | "cachedDataRejected">;
630
609
  /**
631
610
  * Measure the memory known to V8 and used by all contexts known to the
632
611
  * current V8 isolate, or the main context.
@@ -683,10 +662,7 @@ declare module "vm" {
683
662
  * @experimental
684
663
  */
685
664
  function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>;
686
- interface ModuleEvaluateOptions {
687
- timeout?: RunningScriptOptions["timeout"] | undefined;
688
- breakOnSigint?: RunningScriptOptions["breakOnSigint"] | undefined;
689
- }
665
+ interface ModuleEvaluateOptions extends Pick<RunningScriptOptions, "breakOnSigint" | "timeout"> {}
690
666
  type ModuleLinker = (
691
667
  specifier: string,
692
668
  referencingModule: Module,
@@ -700,14 +676,12 @@ declare module "vm" {
700
676
  * flag enabled.
701
677
  *
702
678
  * The `vm.Module` class provides a low-level interface for using
703
- * ECMAScript modules in VM contexts. It is the counterpart of the `vm.Script` class that closely mirrors [Module Record](https://262.ecma-international.org/14.0/#sec-abstract-module-records) s as
704
- * defined in the ECMAScript
679
+ * ECMAScript modules in VM contexts. It is the counterpart of the `vm.Script`
680
+ * class that closely mirrors [Module Record](https://tc39.es/ecma262/#sec-abstract-module-records)s as defined in the ECMAScript
705
681
  * specification.
706
682
  *
707
683
  * Unlike `vm.Script` however, every `vm.Module` object is bound to a context from
708
- * its creation. Operations on `vm.Module` objects are intrinsically asynchronous,
709
- * in contrast with the synchronous nature of `vm.Script` objects. The use of
710
- * 'async' functions can help with manipulating `vm.Module` objects.
684
+ * its creation.
711
685
  *
712
686
  * Using a `vm.Module` object requires three distinct steps: creation/parsing,
713
687
  * linking, and evaluation. These three steps are illustrated in the following
@@ -735,7 +709,7 @@ declare module "vm" {
735
709
  * // Here, we attempt to obtain the default export from the module "foo", and
736
710
  * // put it into local binding "secret".
737
711
  *
738
- * const bar = new vm.SourceTextModule(`
712
+ * const rootModule = new vm.SourceTextModule(`
739
713
  * import s from 'foo';
740
714
  * s;
741
715
  * print(s);
@@ -745,39 +719,48 @@ declare module "vm" {
745
719
  * //
746
720
  * // "Link" the imported dependencies of this Module to it.
747
721
  * //
748
- * // The provided linking callback (the "linker") accepts two arguments: the
749
- * // parent module (`bar` in this case) and the string that is the specifier of
750
- * // the imported module. The callback is expected to return a Module that
751
- * // corresponds to the provided specifier, with certain requirements documented
752
- * // in `module.link()`.
753
- * //
754
- * // If linking has not started for the returned Module, the same linker
755
- * // callback will be called on the returned Module.
722
+ * // Obtain the requested dependencies of a SourceTextModule by
723
+ * // `sourceTextModule.moduleRequests` and resolve them.
756
724
  * //
757
725
  * // Even top-level Modules without dependencies must be explicitly linked. The
758
- * // callback provided would never be called, however.
726
+ * // array passed to `sourceTextModule.linkRequests(modules)` can be
727
+ * // empty, however.
759
728
  * //
760
- * // The link() method returns a Promise that will be resolved when all the
761
- * // Promises returned by the linker resolve.
762
- * //
763
- * // Note: This is a contrived example in that the linker function creates a new
764
- * // "foo" module every time it is called. In a full-fledged module system, a
765
- * // cache would probably be used to avoid duplicated modules.
729
+ * // Note: This is a contrived example in that the resolveAndLinkDependencies
730
+ * // creates a new "foo" module every time it is called. In a full-fledged
731
+ * // module system, a cache would probably be used to avoid duplicated modules.
732
+ *
733
+ * const moduleMap = new Map([
734
+ * ['root', rootModule],
735
+ * ]);
736
+ *
737
+ * function resolveAndLinkDependencies(module) {
738
+ * const requestedModules = module.moduleRequests.map((request) => {
739
+ * // In a full-fledged module system, the resolveAndLinkDependencies would
740
+ * // resolve the module with the module cache key `[specifier, attributes]`.
741
+ * // In this example, we just use the specifier as the key.
742
+ * const specifier = request.specifier;
766
743
  *
767
- * async function linker(specifier, referencingModule) {
768
- * if (specifier === 'foo') {
769
- * return new vm.SourceTextModule(`
770
- * // The "secret" variable refers to the global variable we added to
771
- * // "contextifiedObject" when creating the context.
772
- * export default secret;
773
- * `, { context: referencingModule.context });
744
+ * let requestedModule = moduleMap.get(specifier);
745
+ * if (requestedModule === undefined) {
746
+ * requestedModule = new vm.SourceTextModule(`
747
+ * // The "secret" variable refers to the global variable we added to
748
+ * // "contextifiedObject" when creating the context.
749
+ * export default secret;
750
+ * `, { context: referencingModule.context });
751
+ * moduleMap.set(specifier, linkedModule);
752
+ * // Resolve the dependencies of the new module as well.
753
+ * resolveAndLinkDependencies(requestedModule);
754
+ * }
774
755
  *
775
- * // Using `contextifiedObject` instead of `referencingModule.context`
776
- * // here would work as well.
777
- * }
778
- * throw new Error(`Unable to resolve dependency: ${specifier}`);
756
+ * return requestedModule;
757
+ * });
758
+ *
759
+ * module.linkRequests(requestedModules);
779
760
  * }
780
- * await bar.link(linker);
761
+ *
762
+ * resolveAndLinkDependencies(rootModule);
763
+ * rootModule.instantiate();
781
764
  *
782
765
  * // Step 3
783
766
  * //
@@ -785,7 +768,7 @@ declare module "vm" {
785
768
  * // resolve after the module has finished evaluating.
786
769
  *
787
770
  * // Prints 42.
788
- * await bar.evaluate();
771
+ * await rootModule.evaluate();
789
772
  * ```
790
773
  * @since v13.0.0, v12.16.0
791
774
  * @experimental
@@ -855,6 +838,10 @@ declare module "vm" {
855
838
  * Link module dependencies. This method must be called before evaluation, and
856
839
  * can only be called once per module.
857
840
  *
841
+ * Use `sourceTextModule.linkRequests(modules)` and
842
+ * `sourceTextModule.instantiate()` to link modules either synchronously or
843
+ * asynchronously.
844
+ *
858
845
  * The function is expected to return a `Module` object or a `Promise` that
859
846
  * eventually resolves to a `Module` object. The returned `Module` must satisfy the
860
847
  * following two invariants:
@@ -885,19 +872,13 @@ declare module "vm" {
885
872
  */
886
873
  link(linker: ModuleLinker): Promise<void>;
887
874
  }
888
- interface SourceTextModuleOptions {
875
+ interface SourceTextModuleOptions extends Pick<ScriptOptions, "cachedData" | "columnOffset" | "lineOffset"> {
889
876
  /**
890
877
  * String used in stack traces.
891
878
  * @default 'vm:module(i)' where i is a context-specific ascending index.
892
879
  */
893
880
  identifier?: string | undefined;
894
- /**
895
- * Provides an optional data with V8's code cache data for the supplied source.
896
- */
897
- cachedData?: ScriptOptions["cachedData"] | undefined;
898
881
  context?: Context | undefined;
899
- lineOffset?: BaseOptions["lineOffset"] | undefined;
900
- columnOffset?: BaseOptions["columnOffset"] | undefined;
901
882
  /**
902
883
  * Called during evaluation of this module to initialize the `import.meta`.
903
884
  */
@@ -941,6 +922,39 @@ declare module "vm" {
941
922
  class SourceTextModule extends Module {
942
923
  /**
943
924
  * Creates a new `SourceTextModule` instance.
925
+ *
926
+ * Properties assigned to the `import.meta` object that are objects may
927
+ * allow the module to access information outside the specified `context`. Use
928
+ * `vm.runInContext()` to create objects in a specific context.
929
+ *
930
+ * ```js
931
+ * import vm from 'node:vm';
932
+ *
933
+ * const contextifiedObject = vm.createContext({ secret: 42 });
934
+ *
935
+ * const module = new vm.SourceTextModule(
936
+ * 'Object.getPrototypeOf(import.meta.prop).secret = secret;',
937
+ * {
938
+ * initializeImportMeta(meta) {
939
+ * // Note: this object is created in the top context. As such,
940
+ * // Object.getPrototypeOf(import.meta.prop) points to the
941
+ * // Object.prototype in the top context rather than that in
942
+ * // the contextified object.
943
+ * meta.prop = {};
944
+ * },
945
+ * });
946
+ * // The module has an empty `moduleRequests` array.
947
+ * module.linkRequests([]);
948
+ * module.instantiate();
949
+ * await module.evaluate();
950
+ *
951
+ * // Now, Object.prototype.secret will be equal to 42.
952
+ * //
953
+ * // To fix this problem, replace
954
+ * // meta.prop = {};
955
+ * // above with
956
+ * // meta.prop = vm.runInContext('{}', contextifiedObject);
957
+ * ```
944
958
  * @param code JavaScript Module code to parse
945
959
  */
946
960
  constructor(code: string, options?: SourceTextModuleOptions);
@@ -948,6 +962,55 @@ declare module "vm" {
948
962
  * @deprecated Use `sourceTextModule.moduleRequests` instead.
949
963
  */
950
964
  readonly dependencySpecifiers: readonly string[];
965
+ /**
966
+ * Instantiate the module with the linked requested modules.
967
+ *
968
+ * This resolves the imported bindings of the module, including re-exported
969
+ * binding names. When there are any bindings that cannot be resolved,
970
+ * an error would be thrown synchronously.
971
+ *
972
+ * If the requested modules include cyclic dependencies, the
973
+ * `sourceTextModule.linkRequests(modules)` method must be called on all
974
+ * modules in the cycle before calling this method.
975
+ * @since v24.8.0
976
+ */
977
+ instantiate(): void;
978
+ /**
979
+ * Link module dependencies. This method must be called before evaluation, and
980
+ * can only be called once per module.
981
+ *
982
+ * The order of the module instances in the `modules` array should correspond to the order of
983
+ * `sourceTextModule.moduleRequests` being resolved. If two module requests have the same
984
+ * specifier and import attributes, they must be resolved with the same module instance or an
985
+ * `ERR_MODULE_LINK_MISMATCH` would be thrown. For example, when linking requests for this
986
+ * module:
987
+ *
988
+ * ```js
989
+ * import foo from 'foo';
990
+ * import source Foo from 'foo';
991
+ * ```
992
+ *
993
+ * The `modules` array must contain two references to the same instance, because the two
994
+ * module requests are identical but in two phases.
995
+ *
996
+ * If the module has no dependencies, the `modules` array can be empty.
997
+ *
998
+ * Users can use `sourceTextModule.moduleRequests` to implement the host-defined
999
+ * [HostLoadImportedModule](https://tc39.es/ecma262/#sec-HostLoadImportedModule) abstract operation in the ECMAScript specification,
1000
+ * and using `sourceTextModule.linkRequests()` to invoke specification defined
1001
+ * [FinishLoadingImportedModule](https://tc39.es/ecma262/#sec-FinishLoadingImportedModule), on the module with all dependencies in a batch.
1002
+ *
1003
+ * It's up to the creator of the `SourceTextModule` to determine if the resolution
1004
+ * of the dependencies is synchronous or asynchronous.
1005
+ *
1006
+ * After each module in the `modules` array is linked, call
1007
+ * `sourceTextModule.instantiate()`.
1008
+ * @since v24.8.0
1009
+ * @param modules Array of `vm.Module` objects that this module depends on.
1010
+ * The order of the modules in the array is the order of
1011
+ * `sourceTextModule.moduleRequests`.
1012
+ */
1013
+ linkRequests(modules: readonly Module[]): void;
951
1014
  /**
952
1015
  * The requested import dependencies of this module. The returned array is frozen
953
1016
  * to disallow any changes to it.
@@ -1043,9 +1106,7 @@ declare module "vm" {
1043
1106
  options?: SyntheticModuleOptions,
1044
1107
  );
1045
1108
  /**
1046
- * This method is used after the module is linked to set the values of exports. If
1047
- * it is called before the module is linked, an `ERR_VM_MODULE_STATUS` error
1048
- * will be thrown.
1109
+ * This method sets the module export binding slots with the given value.
1049
1110
  *
1050
1111
  * ```js
1051
1112
  * import vm from 'node:vm';
@@ -1054,7 +1115,6 @@ declare module "vm" {
1054
1115
  * m.setExport('x', 1);
1055
1116
  * });
1056
1117
  *
1057
- * await m.link(() => {});
1058
1118
  * await m.evaluate();
1059
1119
  *
1060
1120
  * assert.strictEqual(m.namespace.x, 1);