cloudstructs 0.9.19 → 0.9.20

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 (233) hide show
  1. package/.jsii +3 -3
  2. package/assets/slack-textract/detect.lambda/index.js +21 -10
  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/@babel/runtime/helpers/esm/superPropGet.js +4 -4
  19. package/node_modules/@babel/runtime/helpers/esm/superPropSet.js +2 -2
  20. package/node_modules/@babel/runtime/helpers/superPropGet.js +4 -4
  21. package/node_modules/@babel/runtime/helpers/superPropSet.js +2 -2
  22. package/node_modules/@babel/runtime/package.json +1 -1
  23. package/node_modules/@slack/logger/node_modules/@types/node/README.md +1 -1
  24. package/node_modules/@slack/logger/node_modules/@types/node/assert.d.ts +2 -2
  25. package/node_modules/@slack/logger/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  26. package/node_modules/@slack/logger/node_modules/@types/node/compatibility/index.d.ts +9 -0
  27. package/node_modules/@slack/logger/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
  28. package/node_modules/@slack/logger/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  29. package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +10 -9
  30. package/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +2 -2
  31. package/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +15 -4
  32. package/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +1 -1
  33. package/node_modules/@slack/logger/node_modules/@types/node/globals.d.ts +17 -48
  34. package/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +37 -0
  35. package/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +8 -10
  36. package/node_modules/@slack/logger/node_modules/@types/node/module.d.ts +91 -0
  37. package/node_modules/@slack/logger/node_modules/@types/node/package.json +4 -3
  38. package/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +24 -0
  39. package/node_modules/@slack/logger/node_modules/@types/node/readline.d.ts +1 -1
  40. package/node_modules/@slack/logger/node_modules/@types/node/stream/promises.d.ts +8 -1
  41. package/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +5 -2
  42. package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +2 -2
  43. package/node_modules/@slack/logger/node_modules/@types/node/test.d.ts +17 -5
  44. package/node_modules/@slack/logger/node_modules/@types/node/ts5.6/index.d.ts +8 -10
  45. package/node_modules/@slack/logger/node_modules/@types/node/url.d.ts +7 -4
  46. package/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +15 -10
  47. package/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +81 -27
  48. package/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +1 -1
  49. package/node_modules/@slack/web-api/dist/WebClient.d.ts +36 -4
  50. package/node_modules/@slack/web-api/dist/WebClient.d.ts.map +1 -1
  51. package/node_modules/@slack/web-api/dist/WebClient.js +23 -10
  52. package/node_modules/@slack/web-api/dist/WebClient.js.map +1 -1
  53. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
  54. package/node_modules/@slack/web-api/node_modules/@types/node/assert.d.ts +2 -2
  55. package/node_modules/@slack/web-api/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  56. package/node_modules/@slack/web-api/node_modules/@types/node/compatibility/index.d.ts +9 -0
  57. package/node_modules/@slack/web-api/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
  58. package/node_modules/@slack/web-api/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  59. package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +10 -9
  60. package/node_modules/@slack/web-api/node_modules/@types/node/events.d.ts +2 -2
  61. package/node_modules/@slack/web-api/node_modules/@types/node/fs/promises.d.ts +15 -4
  62. package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +1 -1
  63. package/node_modules/@slack/web-api/node_modules/@types/node/globals.d.ts +17 -48
  64. package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +37 -0
  65. package/node_modules/@slack/web-api/node_modules/@types/node/index.d.ts +8 -10
  66. package/node_modules/@slack/web-api/node_modules/@types/node/module.d.ts +91 -0
  67. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +4 -3
  68. package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +24 -0
  69. package/node_modules/@slack/web-api/node_modules/@types/node/readline.d.ts +1 -1
  70. package/node_modules/@slack/web-api/node_modules/@types/node/stream/promises.d.ts +8 -1
  71. package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +5 -2
  72. package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +2 -2
  73. package/node_modules/@slack/web-api/node_modules/@types/node/test.d.ts +17 -5
  74. package/node_modules/@slack/web-api/node_modules/@types/node/ts5.6/index.d.ts +8 -10
  75. package/node_modules/@slack/web-api/node_modules/@types/node/url.d.ts +7 -4
  76. package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +15 -10
  77. package/node_modules/@slack/web-api/node_modules/@types/node/vm.d.ts +81 -27
  78. package/node_modules/@slack/web-api/node_modules/@types/node/worker_threads.d.ts +1 -1
  79. package/node_modules/@slack/web-api/package.json +1 -1
  80. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +1 -1
  81. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +2 -2
  82. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  83. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/index.d.ts +9 -0
  84. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
  85. package/node_modules/@types/cacheable-request/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  86. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +10 -9
  87. package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +2 -2
  88. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +15 -4
  89. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +1 -1
  90. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +17 -48
  91. package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +37 -0
  92. package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +8 -10
  93. package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +91 -0
  94. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +4 -3
  95. package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +24 -0
  96. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +1 -1
  97. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +8 -1
  98. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +5 -2
  99. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +2 -2
  100. package/node_modules/@types/cacheable-request/node_modules/@types/node/test.d.ts +17 -5
  101. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts5.6/index.d.ts +8 -10
  102. package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +7 -4
  103. package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +15 -10
  104. package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +81 -27
  105. package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +1 -1
  106. package/node_modules/@types/keyv/node_modules/@types/node/README.md +1 -1
  107. package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +2 -2
  108. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  109. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/index.d.ts +9 -0
  110. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
  111. package/node_modules/@types/keyv/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  112. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +10 -9
  113. package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +2 -2
  114. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +15 -4
  115. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +1 -1
  116. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +17 -48
  117. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +37 -0
  118. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +8 -10
  119. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +91 -0
  120. package/node_modules/@types/keyv/node_modules/@types/node/package.json +4 -3
  121. package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +24 -0
  122. package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +1 -1
  123. package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +8 -1
  124. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +5 -2
  125. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +2 -2
  126. package/node_modules/@types/keyv/node_modules/@types/node/test.d.ts +17 -5
  127. package/node_modules/@types/keyv/node_modules/@types/node/ts5.6/index.d.ts +8 -10
  128. package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +7 -4
  129. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +15 -10
  130. package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +81 -27
  131. package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +1 -1
  132. package/node_modules/@types/responselike/node_modules/@types/node/README.md +1 -1
  133. package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +2 -2
  134. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  135. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/index.d.ts +9 -0
  136. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
  137. package/node_modules/@types/responselike/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  138. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +10 -9
  139. package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +2 -2
  140. package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +15 -4
  141. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +1 -1
  142. package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +17 -48
  143. package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +37 -0
  144. package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +8 -10
  145. package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +91 -0
  146. package/node_modules/@types/responselike/node_modules/@types/node/package.json +4 -3
  147. package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +24 -0
  148. package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +1 -1
  149. package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +8 -1
  150. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +5 -2
  151. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +2 -2
  152. package/node_modules/@types/responselike/node_modules/@types/node/test.d.ts +17 -5
  153. package/node_modules/@types/responselike/node_modules/@types/node/ts5.6/index.d.ts +8 -10
  154. package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +7 -4
  155. package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +15 -10
  156. package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +81 -27
  157. package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +1 -1
  158. package/node_modules/form-data/Readme.md +4 -4
  159. package/node_modules/form-data/lib/form_data.js +1 -1
  160. package/node_modules/form-data/package.json +9 -6
  161. package/node_modules/parse5/dist/cjs/common/doctype.d.ts +0 -1
  162. package/node_modules/parse5/dist/cjs/common/doctype.js +2 -4
  163. package/node_modules/parse5/dist/cjs/common/error-codes.d.ts +0 -1
  164. package/node_modules/parse5/dist/cjs/common/error-codes.js +1 -2
  165. package/node_modules/parse5/dist/cjs/common/foreign-content.d.ts +0 -1
  166. package/node_modules/parse5/dist/cjs/common/foreign-content.js +7 -9
  167. package/node_modules/parse5/dist/cjs/common/html.d.ts +32 -31
  168. package/node_modules/parse5/dist/cjs/common/html.js +41 -42
  169. package/node_modules/parse5/dist/cjs/common/token.d.ts +0 -1
  170. package/node_modules/parse5/dist/cjs/common/token.js +3 -4
  171. package/node_modules/parse5/dist/cjs/common/unicode.d.ts +1 -8
  172. package/node_modules/parse5/dist/cjs/common/unicode.js +7 -14
  173. package/node_modules/parse5/dist/cjs/index.d.ts +15 -4
  174. package/node_modules/parse5/dist/cjs/index.js +3 -6
  175. package/node_modules/parse5/dist/cjs/parser/formatting-element-list.d.ts +0 -1
  176. package/node_modules/parse5/dist/cjs/parser/formatting-element-list.js +1 -2
  177. package/node_modules/parse5/dist/cjs/parser/index.d.ts +72 -8
  178. package/node_modules/parse5/dist/cjs/parser/index.js +81 -9
  179. package/node_modules/parse5/dist/cjs/parser/open-element-stack.d.ts +2 -2
  180. package/node_modules/parse5/dist/cjs/parser/open-element-stack.js +95 -87
  181. package/node_modules/parse5/dist/cjs/serializer/index.d.ts +1 -2
  182. package/node_modules/parse5/dist/cjs/serializer/index.js +8 -9
  183. package/node_modules/parse5/dist/cjs/tokenizer/index.d.ts +130 -131
  184. package/node_modules/parse5/dist/cjs/tokenizer/index.js +87 -281
  185. package/node_modules/parse5/dist/cjs/tokenizer/preprocessor.d.ts +3 -4
  186. package/node_modules/parse5/dist/cjs/tokenizer/preprocessor.js +8 -7
  187. package/node_modules/parse5/dist/cjs/tree-adapters/default.d.ts +0 -1
  188. package/node_modules/parse5/dist/cjs/tree-adapters/default.js +9 -10
  189. package/node_modules/parse5/dist/cjs/tree-adapters/interface.d.ts +7 -2
  190. package/node_modules/parse5/dist/cjs/tree-adapters/interface.js +0 -1
  191. package/node_modules/parse5/dist/common/doctype.d.ts +0 -1
  192. package/node_modules/parse5/dist/common/doctype.js +0 -1
  193. package/node_modules/parse5/dist/common/error-codes.d.ts +0 -1
  194. package/node_modules/parse5/dist/common/error-codes.js +1 -2
  195. package/node_modules/parse5/dist/common/foreign-content.d.ts +0 -1
  196. package/node_modules/parse5/dist/common/foreign-content.js +0 -2
  197. package/node_modules/parse5/dist/common/html.d.ts +32 -31
  198. package/node_modules/parse5/dist/common/html.js +38 -38
  199. package/node_modules/parse5/dist/common/token.d.ts +0 -1
  200. package/node_modules/parse5/dist/common/token.js +1 -2
  201. package/node_modules/parse5/dist/common/unicode.d.ts +1 -8
  202. package/node_modules/parse5/dist/common/unicode.js +1 -8
  203. package/node_modules/parse5/dist/index.d.ts +15 -4
  204. package/node_modules/parse5/dist/index.js +0 -3
  205. package/node_modules/parse5/dist/parser/formatting-element-list.d.ts +0 -1
  206. package/node_modules/parse5/dist/parser/formatting-element-list.js +1 -2
  207. package/node_modules/parse5/dist/parser/index.d.ts +72 -8
  208. package/node_modules/parse5/dist/parser/index.js +82 -10
  209. package/node_modules/parse5/dist/parser/open-element-stack.d.ts +2 -2
  210. package/node_modules/parse5/dist/parser/open-element-stack.js +96 -88
  211. package/node_modules/parse5/dist/serializer/index.d.ts +1 -2
  212. package/node_modules/parse5/dist/serializer/index.js +6 -6
  213. package/node_modules/parse5/dist/tokenizer/index.d.ts +130 -131
  214. package/node_modules/parse5/dist/tokenizer/index.js +88 -282
  215. package/node_modules/parse5/dist/tokenizer/preprocessor.d.ts +3 -4
  216. package/node_modules/parse5/dist/tokenizer/preprocessor.js +8 -7
  217. package/node_modules/parse5/dist/tree-adapters/default.d.ts +0 -1
  218. package/node_modules/parse5/dist/tree-adapters/default.js +9 -10
  219. package/node_modules/parse5/dist/tree-adapters/interface.d.ts +7 -2
  220. package/node_modules/parse5/dist/tree-adapters/interface.js +0 -1
  221. package/node_modules/parse5/package.json +4 -4
  222. package/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/index.d.ts +1 -2
  223. package/node_modules/parse5-htmlparser2-tree-adapter/dist/cjs/index.js +11 -12
  224. package/node_modules/parse5-htmlparser2-tree-adapter/dist/index.d.ts +1 -2
  225. package/node_modules/parse5-htmlparser2-tree-adapter/dist/index.js +9 -10
  226. package/node_modules/parse5-htmlparser2-tree-adapter/package.json +7 -6
  227. package/package.json +16 -16
  228. package/node_modules/@slack/logger/node_modules/@types/node/globals.global.d.ts +0 -1
  229. package/node_modules/@slack/web-api/node_modules/@types/node/globals.global.d.ts +0 -1
  230. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.global.d.ts +0 -1
  231. package/node_modules/@types/keyv/node_modules/@types/node/globals.global.d.ts +0 -1
  232. package/node_modules/@types/responselike/node_modules/@types/node/globals.global.d.ts +0 -1
  233. package/node_modules/form-data/README.md.bak +0 -358
@@ -22,22 +22,22 @@
22
22
  * IN THE SOFTWARE.
23
23
  */
24
24
 
25
- // NOTE: These definitions support NodeJS and TypeScript 4.9 through 5.6.
25
+ // NOTE: These definitions support Node.js and TypeScript 4.9 through 5.6.
26
26
 
27
- // Reference required types from the default lib:
27
+ // Reference required TypeScript libs:
28
28
  /// <reference lib="es2020" />
29
- /// <reference lib="esnext.asynciterable" />
30
- /// <reference lib="esnext.intl" />
31
- /// <reference lib="esnext.bigint" />
32
29
 
33
- // Definitions specific to TypeScript 4.9 through 5.6
30
+ // TypeScript backwards-compatibility definitions:
31
+ /// <reference path="../compatibility/index.d.ts" />
32
+
33
+ // Definitions specific to TypeScript 4.9 through 5.6:
34
34
  /// <reference path="./globals.typedarray.d.ts" />
35
35
  /// <reference path="./buffer.buffer.d.ts" />
36
36
 
37
- // Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
37
+ // Definitions for Node.js modules that are not specific to any version of TypeScript:
38
+ /// <reference path="../globals.d.ts" />
38
39
  /// <reference path="../assert.d.ts" />
39
40
  /// <reference path="../assert/strict.d.ts" />
40
- /// <reference path="../globals.d.ts" />
41
41
  /// <reference path="../async_hooks.d.ts" />
42
42
  /// <reference path="../buffer.d.ts" />
43
43
  /// <reference path="../child_process.d.ts" />
@@ -90,5 +90,3 @@
90
90
  /// <reference path="../wasi.d.ts" />
91
91
  /// <reference path="../worker_threads.d.ts" />
92
92
  /// <reference path="../zlib.d.ts" />
93
-
94
- /// <reference path="../globals.global.d.ts" />
@@ -757,6 +757,9 @@ declare module "url" {
757
757
  */
758
758
  toJSON(): string;
759
759
  }
760
+ interface URLSearchParamsIterator<T> extends NodeJS.Iterator<T, NodeJS.BuiltinIteratorReturn, unknown> {
761
+ [Symbol.iterator](): URLSearchParamsIterator<T>;
762
+ }
760
763
  /**
761
764
  * The `URLSearchParams` API provides read and write access to the query of a `URL`. The `URLSearchParams` class can also be used standalone with one of the
762
765
  * four following constructors.
@@ -827,7 +830,7 @@ declare module "url" {
827
830
  *
828
831
  * Alias for `urlSearchParams[@@iterator]()`.
829
832
  */
830
- entries(): IterableIterator<[string, string]>;
833
+ entries(): URLSearchParamsIterator<[string, string]>;
831
834
  /**
832
835
  * Iterates over each name-value pair in the query and invokes the given function.
833
836
  *
@@ -881,7 +884,7 @@ declare module "url" {
881
884
  * // foo
882
885
  * ```
883
886
  */
884
- keys(): IterableIterator<string>;
887
+ keys(): URLSearchParamsIterator<string>;
885
888
  /**
886
889
  * Sets the value in the `URLSearchParams` object associated with `name` to `value`. If there are any pre-existing name-value pairs whose names are `name`,
887
890
  * set the first such pair's value to `value` and remove all others. If not,
@@ -931,8 +934,8 @@ declare module "url" {
931
934
  /**
932
935
  * Returns an ES6 `Iterator` over the values of each name-value pair.
933
936
  */
934
- values(): IterableIterator<string>;
935
- [Symbol.iterator](): IterableIterator<[string, string]>;
937
+ values(): URLSearchParamsIterator<string>;
938
+ [Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
936
939
  }
937
940
  import { URL as _URL, URLSearchParams as _URLSearchParams } from "url";
938
941
  global {
@@ -1517,18 +1517,23 @@ declare module "util" {
1517
1517
  string | boolean
1518
1518
  >;
1519
1519
 
1520
+ type ApplyOptionalModifiers<O extends ParseArgsOptionsConfig, V extends Record<keyof O, unknown>> = (
1521
+ & { -readonly [LongOption in keyof O]?: V[LongOption] }
1522
+ & { [LongOption in keyof O as O[LongOption]["default"] extends {} ? LongOption : never]: V[LongOption] }
1523
+ ) extends infer P ? { [K in keyof P]: P[K] } : never; // resolve intersection to object
1524
+
1520
1525
  type ParsedValues<T extends ParseArgsConfig> =
1521
1526
  & IfDefaultsTrue<T["strict"], unknown, { [longOption: string]: undefined | string | boolean }>
1522
- & (T["options"] extends ParseArgsOptionsConfig ? {
1523
- -readonly [LongOption in keyof T["options"]]:
1524
- // when "default" is not undefined, the value will be present
1525
- | (T["options"][LongOption]["default"] extends {} ? never : undefined)
1526
- | IfDefaultsFalse<
1527
+ & (T["options"] extends ParseArgsOptionsConfig ? ApplyOptionalModifiers<
1528
+ T["options"],
1529
+ {
1530
+ [LongOption in keyof T["options"]]: IfDefaultsFalse<
1527
1531
  T["options"][LongOption]["multiple"],
1528
1532
  Array<ExtractOptionValue<T, T["options"][LongOption]>>,
1529
1533
  ExtractOptionValue<T, T["options"][LongOption]>
1530
1534
  >;
1531
- }
1535
+ }
1536
+ >
1532
1537
  : {});
1533
1538
 
1534
1539
  type ParsedPositionals<T extends ParseArgsConfig> = IfDefaultsTrue<
@@ -1720,7 +1725,7 @@ declare module "util" {
1720
1725
  * Each item of the iterator is a JavaScript `Array`. The first item of the array
1721
1726
  * is the `name`, the second item of the array is the `value`.
1722
1727
  */
1723
- entries(): IterableIterator<[name: string, value: string]>;
1728
+ entries(): NodeJS.Iterator<[name: string, value: string]>;
1724
1729
  /**
1725
1730
  * Returns the value of the first name-value pair whose name is `name`. If there
1726
1731
  * are no such pairs, `null` is returned.
@@ -1746,7 +1751,7 @@ declare module "util" {
1746
1751
  * // bar
1747
1752
  * ```
1748
1753
  */
1749
- keys(): IterableIterator<string>;
1754
+ keys(): NodeJS.Iterator<string>;
1750
1755
  /**
1751
1756
  * Sets the value in the `MIMEParams` object associated with `name` to `value`. If there are any pre-existing name-value pairs whose names are `name`,
1752
1757
  * set the first such pair's value to `value`.
@@ -1765,11 +1770,11 @@ declare module "util" {
1765
1770
  /**
1766
1771
  * Returns an iterator over the values of each name-value pair.
1767
1772
  */
1768
- values(): IterableIterator<string>;
1773
+ values(): NodeJS.Iterator<string>;
1769
1774
  /**
1770
1775
  * Returns an iterator over each of the name-value pairs in the parameters.
1771
1776
  */
1772
- [Symbol.iterator]: typeof MIMEParams.prototype.entries;
1777
+ [Symbol.iterator](): NodeJS.Iterator<[name: string, value: string]>;
1773
1778
  }
1774
1779
  }
1775
1780
  declare module "util/types" {
@@ -230,16 +230,23 @@ declare module "vm" {
230
230
  */
231
231
  runInContext(contextifiedObject: Context, options?: RunningScriptOptions): any;
232
232
  /**
233
- * First contextifies the given `contextObject`, runs the compiled code contained
234
- * by the `vm.Script` object within the created context, and returns the result.
235
- * Running code does not have access to local scope.
233
+ * This method is a shortcut to `script.runInContext(vm.createContext(options), options)`.
234
+ * It does several things at once:
235
+ *
236
+ * 1. Creates a new context.
237
+ * 2. If `contextObject` is an object, contextifies it with the new context.
238
+ * If `contextObject` is undefined, creates a new object and contextifies it.
239
+ * If `contextObject` is `vm.constants.DONT_CONTEXTIFY`, don't contextify anything.
240
+ * 3. Runs the compiled code contained by the `vm.Script` object within the created context. The code
241
+ * does not have access to the scope in which this method is called.
242
+ * 4. Returns the result.
236
243
  *
237
244
  * The following example compiles code that sets a global variable, then executes
238
245
  * the code multiple times in different contexts. The globals are set on and
239
246
  * contained within each individual `context`.
240
247
  *
241
248
  * ```js
242
- * import vm from 'node:vm';
249
+ * const vm = require('node:vm');
243
250
  *
244
251
  * const script = new vm.Script('globalVar = "set"');
245
252
  *
@@ -250,12 +257,22 @@ declare module "vm" {
250
257
  *
251
258
  * console.log(contexts);
252
259
  * // Prints: [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }]
260
+ *
261
+ * // This would throw if the context is created from a contextified object.
262
+ * // vm.constants.DONT_CONTEXTIFY allows creating contexts with ordinary
263
+ * // global objects that can be frozen.
264
+ * const freezeScript = new vm.Script('Object.freeze(globalThis); globalThis;');
265
+ * const frozenContext = freezeScript.runInNewContext(vm.constants.DONT_CONTEXTIFY);
253
266
  * ```
254
267
  * @since v0.3.1
255
- * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created.
268
+ * @param contextObject Either `vm.constants.DONT_CONTEXTIFY` or an object that will be contextified.
269
+ * If `undefined`, an empty contextified object will be created for backwards compatibility.
256
270
  * @return the result of the very last statement executed in the script.
257
271
  */
258
- runInNewContext(contextObject?: Context, options?: RunningScriptInNewContextOptions): any;
272
+ runInNewContext(
273
+ contextObject?: Context | typeof constants.DONT_CONTEXTIFY,
274
+ options?: RunningScriptInNewContextOptions,
275
+ ): any;
259
276
  /**
260
277
  * Runs the compiled code contained by the `vm.Script` within the context of the
261
278
  * current `global` object. Running code does not have access to local scope, but _does_ have access to the current `global` object.
@@ -347,17 +364,17 @@ declare module "vm" {
347
364
  sourceMapURL?: string | undefined;
348
365
  }
349
366
  /**
350
- * If given a `contextObject`, the `vm.createContext()` method will
367
+ * If the given `contextObject` is an object, the `vm.createContext()` method will
351
368
  * [prepare that object](https://nodejs.org/docs/latest-v22.x/api/vm.html#what-does-it-mean-to-contextify-an-object)
352
- * and return a reference to it so that it can be used in `{@link runInContext}` or
353
- * [`script.runInContext()`](https://nodejs.org/docs/latest-v22.x/api/vm.html#scriptrunincontextcontextifiedobject-options). Inside such
354
- * scripts, the `contextObject` will be the global object, retaining all of its
355
- * existing properties but also having the built-in objects and functions any
356
- * standard [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global
369
+ * and return a reference to it so that it can be used in calls to {@link runInContext} or
370
+ * [`script.runInContext()`](https://nodejs.org/docs/latest-v22.x/api/vm.html#scriptrunincontextcontextifiedobject-options).
371
+ * Inside such scripts, the global object will be wrapped by the `contextObject`, retaining all of its
372
+ * existing properties but also having the built-in objects and functions any standard
373
+ * [global object](https://es5.github.io/#x15.1) has. Outside of scripts run by the vm module, global
357
374
  * variables will remain unchanged.
358
375
  *
359
376
  * ```js
360
- * import vm from 'node:vm';
377
+ * const vm = require('node:vm');
361
378
  *
362
379
  * global.globalVar = 3;
363
380
  *
@@ -374,7 +391,12 @@ declare module "vm" {
374
391
  * ```
375
392
  *
376
393
  * If `contextObject` is omitted (or passed explicitly as `undefined`), a new,
377
- * empty `contextified` object will be returned.
394
+ * empty contextified object will be returned.
395
+ *
396
+ * When the global object in the newly created context is contextified, it has some quirks
397
+ * compared to ordinary global objects. For example, it cannot be frozen. To create a context
398
+ * without the contextifying quirks, pass `vm.constants.DONT_CONTEXTIFY` as the `contextObject`
399
+ * argument. See the documentation of `vm.constants.DONT_CONTEXTIFY` for details.
378
400
  *
379
401
  * The `vm.createContext()` method is primarily useful for creating a single
380
402
  * context that can be used to run multiple scripts. For instance, if emulating a
@@ -385,11 +407,17 @@ declare module "vm" {
385
407
  * The provided `name` and `origin` of the context are made visible through the
386
408
  * Inspector API.
387
409
  * @since v0.3.1
410
+ * @param contextObject Either `vm.constants.DONT_CONTEXTIFY` or an object that will be contextified.
411
+ * If `undefined`, an empty contextified object will be created for backwards compatibility.
388
412
  * @return contextified object.
389
413
  */
390
- function createContext(sandbox?: Context, options?: CreateContextOptions): Context;
414
+ function createContext(
415
+ contextObject?: Context | typeof constants.DONT_CONTEXTIFY,
416
+ options?: CreateContextOptions,
417
+ ): Context;
391
418
  /**
392
- * Returns `true` if the given `object` object has been `contextified` using {@link createContext}.
419
+ * Returns `true` if the given `object` object has been contextified using {@link createContext},
420
+ * or if it's the global object of a context created using `vm.constants.DONT_CONTEXTIFY`.
393
421
  * @since v0.11.7
394
422
  */
395
423
  function isContext(sandbox: Context): boolean;
@@ -422,18 +450,26 @@ declare module "vm" {
422
450
  */
423
451
  function runInContext(code: string, contextifiedObject: Context, options?: RunningCodeOptions | string): any;
424
452
  /**
425
- * The `vm.runInNewContext()` first contextifies the given `contextObject` (or
426
- * creates a new `contextObject` if passed as `undefined`), compiles the `code`,
427
- * runs it within the created context, then returns the result. Running code
428
- * does not have access to the local scope.
429
- *
453
+ * This method is a shortcut to
454
+ * `(new vm.Script(code, options)).runInContext(vm.createContext(options), options)`.
430
455
  * If `options` is a string, then it specifies the filename.
431
456
  *
457
+ * It does several things at once:
458
+ *
459
+ * 1. Creates a new context.
460
+ * 2. If `contextObject` is an object, contextifies it with the new context.
461
+ * If `contextObject` is undefined, creates a new object and contextifies it.
462
+ * If `contextObject` is `vm.constants.DONT_CONTEXTIFY`, don't contextify anything.
463
+ * 3. Compiles the code as a`vm.Script`
464
+ * 4. Runs the compield code within the created context. The code does not have access to the scope in
465
+ * which this method is called.
466
+ * 5. Returns the result.
467
+ *
432
468
  * The following example compiles and executes code that increments a global
433
469
  * variable and sets a new one. These globals are contained in the `contextObject`.
434
470
  *
435
471
  * ```js
436
- * import vm from 'node:vm';
472
+ * const vm = require('node:vm');
437
473
  *
438
474
  * const contextObject = {
439
475
  * animal: 'cat',
@@ -443,15 +479,21 @@ declare module "vm" {
443
479
  * vm.runInNewContext('count += 1; name = "kitty"', contextObject);
444
480
  * console.log(contextObject);
445
481
  * // Prints: { animal: 'cat', count: 3, name: 'kitty' }
482
+ *
483
+ * // This would throw if the context is created from a contextified object.
484
+ * // vm.constants.DONT_CONTEXTIFY allows creating contexts with ordinary global objects that
485
+ * // can be frozen.
486
+ * const frozenContext = vm.runInNewContext('Object.freeze(globalThis); globalThis;', vm.constants.DONT_CONTEXTIFY);
446
487
  * ```
447
488
  * @since v0.3.1
448
489
  * @param code The JavaScript code to compile and run.
449
- * @param contextObject An object that will be `contextified`. If `undefined`, a new object will be created.
490
+ * @param contextObject Either `vm.constants.DONT_CONTEXTIFY` or an object that will be contextified.
491
+ * If `undefined`, an empty contextified object will be created for backwards compatibility.
450
492
  * @return the result of the very last statement executed in the script.
451
493
  */
452
494
  function runInNewContext(
453
495
  code: string,
454
- contextObject?: Context,
496
+ contextObject?: Context | typeof constants.DONT_CONTEXTIFY,
455
497
  options?: RunningCodeInNewContextOptions | string,
456
498
  ): any;
457
499
  /**
@@ -902,19 +944,31 @@ declare module "vm" {
902
944
  }
903
945
  /**
904
946
  * Returns an object containing commonly used constants for VM operations.
905
- * @since v20.12.0
947
+ * @since v21.7.0, v20.12.0
906
948
  */
907
949
  namespace constants {
908
950
  /**
909
- * Stability: 1.1 - Active development
910
- *
911
951
  * A constant that can be used as the `importModuleDynamically` option to `vm.Script`
912
952
  * and `vm.compileFunction()` so that Node.js uses the default ESM loader from the main
913
953
  * context to load the requested module.
914
954
  *
915
955
  * For detailed information, see [Support of dynamic `import()` in compilation APIs](https://nodejs.org/docs/latest-v22.x/api/vm.html#support-of-dynamic-import-in-compilation-apis).
956
+ * @since v21.7.0, v20.12.0
916
957
  */
917
958
  const USE_MAIN_CONTEXT_DEFAULT_LOADER: number;
959
+ /**
960
+ * This constant, when used as the `contextObject` argument in vm APIs, instructs Node.js to create
961
+ * a context without wrapping its global object with another object in a Node.js-specific manner.
962
+ * As a result, the `globalThis` value inside the new context would behave more closely to an ordinary
963
+ * one.
964
+ *
965
+ * When `vm.constants.DONT_CONTEXTIFY` is used as the `contextObject` argument to {@link createContext},
966
+ * the returned object is a proxy-like object to the global object in the newly created context with
967
+ * fewer Node.js-specific quirks. It is reference equal to the `globalThis` value in the new context,
968
+ * can be modified from outside the context, and can be used to access built-ins in the new context directly.
969
+ * @since v22.8.0
970
+ */
971
+ const DONT_CONTEXTIFY: number;
918
972
  }
919
973
  }
920
974
  declare module "node:vm" {
@@ -267,7 +267,7 @@ declare module "worker_threads" {
267
267
  trackUnmanagedFds?: boolean | undefined;
268
268
  /**
269
269
  * An optional `name` to be appended to the worker title
270
- * for debuggin/identification purposes, making the final title as
270
+ * for debugging/identification purposes, making the final title as
271
271
  * `[worker ${id}] ${name}`.
272
272
  */
273
273
  name?: string | undefined;
@@ -2,6 +2,7 @@
2
2
  /// <reference types="node" />
3
3
  import type { Agent } from 'node:http';
4
4
  import type { SecureContextOptions } from 'node:tls';
5
+ import { type InternalAxiosRequestConfig, type AxiosAdapter } from 'axios';
5
6
  import { LogLevel, type Logger } from './logger';
6
7
  import { Methods } from './methods';
7
8
  import { type RetryOptions } from './retry-policies';
@@ -26,6 +27,20 @@ export interface WebClientOptions {
26
27
  * @default true
27
28
  */
28
29
  attachOriginalToWebAPIRequestError?: boolean;
30
+ /**
31
+ * Custom function to modify outgoing requests. See {@link https://axios-http.com/docs/interceptors Axios interceptor documentation} for more details.
32
+ * @type {Function | undefined}
33
+ * @default undefined
34
+ */
35
+ requestInterceptor?: RequestInterceptor;
36
+ /**
37
+ * Custom functions for modifing and handling outgoing requests.
38
+ * Useful if you would like to manage outgoing request with a custom http client.
39
+ * See {@link https://github.com/axios/axios/blob/v1.x/README.md?plain=1#L586 Axios adapter documentation} for more information.
40
+ * @type {Function | undefined}
41
+ * @default undefined
42
+ */
43
+ adapter?: AdapterConfig;
29
44
  }
30
45
  export type TLSOptions = Pick<SecureContextOptions, 'pfx' | 'key' | 'passphrase' | 'cert' | 'ca'>;
31
46
  export declare enum WebClientEvent {
@@ -46,6 +61,21 @@ export interface WebAPICallResult {
46
61
  export type PaginatePredicate = (page: WebAPICallResult) => boolean | undefined | undefined;
47
62
  export type PageReducer<A = any> = (accumulator: A | undefined, page: WebAPICallResult, index: number) => A;
48
63
  export type PageAccumulator<R extends PageReducer> = R extends (accumulator: infer A | undefined, page: WebAPICallResult, index: number) => infer A ? A : never;
64
+ /**
65
+ * An alias to {@link https://github.com/axios/axios/blob/v1.x/index.d.ts#L367 Axios' `InternalAxiosRequestConfig`} object,
66
+ * which is the main parameter type provided to Axios interceptors and adapters.
67
+ */
68
+ export type RequestConfig = InternalAxiosRequestConfig;
69
+ /**
70
+ * An alias to {@link https://github.com/axios/axios/blob/v1.x/index.d.ts#L489 Axios' `AxiosInterceptorManager<InternalAxiosRequestConfig>` onFufilled} method,
71
+ * which controls the custom request interceptor logic
72
+ */
73
+ export type RequestInterceptor = (config: RequestConfig) => RequestConfig | Promise<RequestConfig>;
74
+ /**
75
+ * An alias to {@link https://github.com/axios/axios/blob/v1.x/index.d.ts#L112 Axios' `AxiosAdapter`} interface,
76
+ * which is the contract required to specify an adapter
77
+ */
78
+ export type AdapterConfig = AxiosAdapter;
49
79
  /**
50
80
  * A client for Slack's Web API
51
81
  *
@@ -101,8 +131,11 @@ export declare class WebClient extends Methods {
101
131
  private attachOriginalToWebAPIRequestError;
102
132
  /**
103
133
  * @param token - An API token to authenticate/authorize with Slack (usually start with `xoxp`, `xoxb`)
134
+ * @param {Object} [webClientOptions] - Configuration options.
135
+ * @param {Function} [webClientOptions.requestInterceptor] - An interceptor to mutate outgoing requests. See {@link https://axios-http.com/docs/interceptors Axios interceptors}
136
+ * @param {Function} [webClientOptions.adapter] - An adapter to allow custom handling of requests. Useful if you would like to use a pre-configured http client. See {@link https://github.com/axios/axios/blob/v1.x/README.md?plain=1#L586 Axios adapter}
104
137
  */
105
- constructor(token?: string, { slackApiUrl, logger, logLevel, maxRequestConcurrency, retryConfig, agent, tls, timeout, rejectRateLimitedCalls, headers, teamId, attachOriginalToWebAPIRequestError, }?: WebClientOptions);
138
+ constructor(token?: string, { slackApiUrl, logger, logLevel, maxRequestConcurrency, retryConfig, agent, tls, timeout, rejectRateLimitedCalls, headers, teamId, attachOriginalToWebAPIRequestError, requestInterceptor, adapter, }?: WebClientOptions);
106
139
  /**
107
140
  * Generic method for calling a Web API method
108
141
  * @param method - the Web API method to call {@link https://api.slack.com/methods}
@@ -180,10 +213,9 @@ export declare class WebClient extends Methods {
180
213
  * a string, used when posting with a content-type of url-encoded. Or, it can be a readable stream, used
181
214
  * when the options contain a binary (a stream or a buffer) and the upload should be done with content-type
182
215
  * multipart/form-data.
183
- * @param options - arguments for the Web API method
184
- * @param headers - a mutable object representing the HTTP headers for the outgoing request
216
+ * @param config - The Axios request configuration object
185
217
  */
186
- private serializeApiCallOptions;
218
+ private serializeApiCallData;
187
219
  /**
188
220
  * Processes an HTTP response into a WebAPICallResult by performing JSON parsing on the body and merging relevant
189
221
  * HTTP headers into the object.
@@ -1 +1 @@
1
- {"version":3,"file":"WebClient.d.ts","sourceRoot":"","sources":["../src/WebClient.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAIvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAyBrD,OAAO,EAAE,QAAQ,EAAE,KAAK,MAAM,EAAa,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,YAAY,EAAkC,MAAM,kBAAkB,CAAC;AAGrF,OAAO,KAAK,EAIV,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAIV,mCAAmC,EAEpC,MAAM,kBAAkB,CAAC;AA2B1B,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,GAAG,CAAC,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AAC;IAoB/E;;;;;OAKG;YACW,yBAAyB;IAoBvC;;;;OAIG;YACW,mBAAmB;IAKjC;;;;OAIG;YACW,4BAA4B;IAiC1C;;;OAGG;YACW,iBAAiB;IAe/B;;OAEG;YACW,WAAW;IAqGzB;;;;;;OAMG;IACH,OAAO,CAAC,oBAAoB;IAgF5B;;;;OAIG;YACW,WAAW;CAwE1B;AAED,eAAe,SAAS,CAAC;AA6GzB,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAElE"}
@@ -107,8 +107,11 @@ var WebClientEvent;
107
107
  class WebClient extends methods_1.Methods {
108
108
  /**
109
109
  * @param token - An API token to authenticate/authorize with Slack (usually start with `xoxp`, `xoxb`)
110
+ * @param {Object} [webClientOptions] - Configuration options.
111
+ * @param {Function} [webClientOptions.requestInterceptor] - An interceptor to mutate outgoing requests. See {@link https://axios-http.com/docs/interceptors Axios interceptors}
112
+ * @param {Function} [webClientOptions.adapter] - An adapter to allow custom handling of requests. Useful if you would like to use a pre-configured http client. See {@link https://github.com/axios/axios/blob/v1.x/README.md?plain=1#L586 Axios adapter}
110
113
  */
111
- constructor(token, { slackApiUrl = 'https://slack.com/api/', logger = undefined, logLevel = undefined, maxRequestConcurrency = 100, retryConfig = retry_policies_1.tenRetriesInAboutThirtyMinutes, agent = undefined, tls = undefined, timeout = 0, rejectRateLimitedCalls = false, headers = {}, teamId = undefined, attachOriginalToWebAPIRequestError = true, } = {}) {
114
+ constructor(token, { slackApiUrl = 'https://slack.com/api/', logger = undefined, logLevel = undefined, maxRequestConcurrency = 100, retryConfig = retry_policies_1.tenRetriesInAboutThirtyMinutes, agent = undefined, tls = undefined, timeout = 0, rejectRateLimitedCalls = false, headers = {}, teamId = undefined, attachOriginalToWebAPIRequestError = true, requestInterceptor = undefined, adapter = undefined, } = {}) {
112
115
  super();
113
116
  this.token = token;
114
117
  this.slackApiUrl = slackApiUrl;
@@ -132,12 +135,12 @@ class WebClient extends methods_1.Methods {
132
135
  if (this.token && !headers.Authorization)
133
136
  headers.Authorization = `Bearer ${this.token}`;
134
137
  this.axios = axios_1.default.create({
138
+ adapter: adapter ? (config) => adapter(Object.assign(Object.assign({}, config), { adapter: undefined })) : undefined,
135
139
  timeout,
136
140
  baseURL: slackApiUrl,
137
141
  headers: (0, is_electron_1.default)() ? headers : Object.assign({ 'User-Agent': (0, instrument_1.getUserAgent)() }, headers),
138
142
  httpAgent: agent,
139
143
  httpsAgent: agent,
140
- transformRequest: [this.serializeApiCallOptions.bind(this)],
141
144
  validateStatus: () => true, // all HTTP status codes should result in a resolved promise (as opposed to only 2xx)
142
145
  maxRedirects: 0,
143
146
  // disabling axios' automatic proxy support:
@@ -146,8 +149,14 @@ class WebClient extends methods_1.Methods {
146
149
  // protocols), users of this package should use the `agent` option to configure a proxy.
147
150
  proxy: false,
148
151
  });
149
- // serializeApiCallOptions will always determine the appropriate content-type
152
+ // serializeApiCallData will always determine the appropriate content-type
150
153
  this.axios.defaults.headers.post['Content-Type'] = undefined;
154
+ // request interceptors have reversed execution order
155
+ // see: https://github.com/axios/axios/blob/v1.x/test/specs/interceptors.spec.js#L88
156
+ if (requestInterceptor) {
157
+ this.axios.interceptors.request.use(requestInterceptor, null);
158
+ }
159
+ this.axios.interceptors.request.use(this.serializeApiCallData.bind(this), null);
151
160
  this.logger.debug('initialized');
152
161
  }
153
162
  /**
@@ -479,15 +488,15 @@ class WebClient extends methods_1.Methods {
479
488
  * a string, used when posting with a content-type of url-encoded. Or, it can be a readable stream, used
480
489
  * when the options contain a binary (a stream or a buffer) and the upload should be done with content-type
481
490
  * multipart/form-data.
482
- * @param options - arguments for the Web API method
483
- * @param headers - a mutable object representing the HTTP headers for the outgoing request
491
+ * @param config - The Axios request configuration object
484
492
  */
485
- serializeApiCallOptions(options, headers) {
493
+ serializeApiCallData(config) {
494
+ const { data, headers } = config;
486
495
  // The following operation both flattens complex objects into a JSON-encoded strings and searches the values for
487
496
  // binary content
488
497
  let containsBinaryData = false;
489
- // biome-ignore lint/suspicious/noExplicitAny: call options can be anything
490
- const flattened = Object.entries(options).map(([key, value]) => {
498
+ // biome-ignore lint/suspicious/noExplicitAny: HTTP request data can be anything
499
+ const flattened = Object.entries(data).map(([key, value]) => {
491
500
  if (value === undefined || value === null) {
492
501
  return [];
493
502
  }
@@ -537,19 +546,23 @@ class WebClient extends methods_1.Methods {
537
546
  headers[header] = value;
538
547
  }
539
548
  }
540
- return form;
549
+ config.data = form;
550
+ config.headers = headers;
551
+ return config;
541
552
  }
542
553
  // Otherwise, a simple key-value object is returned
543
554
  if (headers)
544
555
  headers['Content-Type'] = 'application/x-www-form-urlencoded';
545
556
  // biome-ignore lint/suspicious/noExplicitAny: form values can be anything
546
557
  const initialValue = {};
547
- return (0, node_querystring_1.stringify)(flattened.reduce((accumulator, [key, value]) => {
558
+ config.data = (0, node_querystring_1.stringify)(flattened.reduce((accumulator, [key, value]) => {
548
559
  if (key !== undefined && value !== undefined) {
549
560
  accumulator[key] = value;
550
561
  }
551
562
  return accumulator;
552
563
  }, initialValue));
564
+ config.headers = headers;
565
+ return config;
553
566
  }
554
567
  /**
555
568
  * Processes an HTTP response into a WebAPICallResult by performing JSON parsing on the body and merging relevant