@openclaw/slack 2026.7.2-beta.3 → 2026.7.2-beta.5

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 (627) hide show
  1. package/README.md +1 -1
  2. package/dist/account-inspect-api.js +1 -1
  3. package/dist/{account-inspect-Bvbtu3iH.js → account-inspect-jn1xLaVi.js} +2 -2
  4. package/dist/account-reply-mode-DrUXogvO.js +14 -0
  5. package/dist/{accounts-DQEbYKh9.js → accounts-BSr252c_.js} +6 -27
  6. package/dist/{accounts.runtime-BIKmJdtJ.js → accounts.runtime-CjULMLTa.js} +1 -1
  7. package/dist/{action-runtime-DqkRwO3Z.js → action-runtime-BO3HK_50.js} +7 -7
  8. package/dist/action-runtime.runtime-DbEcqEXC.js +2 -0
  9. package/dist/{actions-CF0tUY5q.js → actions-BkOaiDSX.js} +6 -6
  10. package/dist/{actions.runtime-hCbx4RXg.js → actions.runtime-Do-iOL51.js} +1 -1
  11. package/dist/api.js +15 -15
  12. package/dist/{approval-handler.runtime-Em8I1-8-.js → approval-handler.runtime-BAnGN7w0.js} +2 -2
  13. package/dist/{channel-4-TRi1D6.js → channel-Cnrlie9S.js} +26 -36
  14. package/dist/channel-config-api.js +1 -1
  15. package/dist/channel-plugin-api.js +1 -1
  16. package/dist/{channel-type-Cu1yjNg2.js → channel-type-CPDX8EV-.js} +4 -4
  17. package/dist/{channel.setup-CgkADtZg.js → channel.setup-DyZdLwUB.js} +6 -25
  18. package/dist/{setup-core-CeiAVwQ3.js → config-adapter-Bb8hn2tM.js} +141 -72
  19. package/dist/{config-schema-XjJGfwQC.js → config-schema-BajbuJGL.js} +229 -30
  20. package/dist/{directory-config-Bv0lcUlH.js → directory-config-CeixfVuC.js} +2 -2
  21. package/dist/directory-contract-api.js +1 -1
  22. package/dist/{directory-live-CzUIB7th.js → directory-live-CUwGPX2d.js} +3 -3
  23. package/dist/doctor-contract-CsGH1Dfc.js +158 -0
  24. package/dist/doctor-contract-api.js +1 -1
  25. package/dist/{group-policy-Bw-65m3V.js → group-policy-CthIXE2T.js} +48 -7
  26. package/dist/{message-tool-api-C2pcf5du.js → message-tool-api-CvKoWYYQ.js} +1 -6
  27. package/dist/message-tool-api.js +1 -1
  28. package/dist/{monitor-CNFeF30h.js → monitor-Cb5ZsOTY.js} +4 -4
  29. package/dist/{outbound-adapter-CVi2uok0.js → outbound-adapter-sGrozuRg.js} +11 -68
  30. package/dist/{pipeline.runtime-CTvokbty.js → pipeline.runtime-mFCCSllA.js} +2173 -1999
  31. package/dist/{policy-b_dOPDCq.js → policy-DVg6FyMP.js} +1 -1
  32. package/dist/{probe-Borhn9PQ.js → probe-BhQTDVBQ.js} +51 -58
  33. package/dist/{provider-B-HVL5ZE.js → provider-PSppCU_K.js} +435 -252
  34. package/dist/{relay-source-Ea_P9VcO.js → relay-source-D0mb_JBk.js} +1 -1
  35. package/dist/{replies-B4bOdrYb.js → replies-BkPPM2Ri.js} +50 -13
  36. package/dist/{resolve-channels-KTc568SU.js → resolve-channels-B3RlJKyV.js} +2 -2
  37. package/dist/{resolve-users-DeGJf1yp.js → resolve-users-DTm7PEMa.js} +2 -2
  38. package/dist/{rolldown-runtime-D7D4PA-g.js → rolldown-runtime-8H4AJuhK.js} +1 -0
  39. package/dist/{runtime-api-BFfNpzDe.js → runtime-api-jpn3vQ7e.js} +3 -2
  40. package/dist/runtime-api.js +11 -11
  41. package/dist/{scopes-lx08L56K.js → scopes-B2SqZ--4.js} +1 -1
  42. package/dist/{security-audit-CikQhBUY.js → security-audit-DR097212.js} +1 -11
  43. package/dist/security-contract-api.js +1 -1
  44. package/dist/{send-KuTDky7i.js → send-2IoDXPeB.js} +8 -22
  45. package/dist/{send.runtime-CXyxws1D.js → send.runtime-BKd_PAEw.js} +1 -1
  46. package/dist/setup-plugin-api.js +1 -1
  47. package/dist/{setup-surface-DLA0vHXp.js → setup-surface-Dyam58nO.js} +47 -39
  48. package/dist/{shared-C4yVB0Q-.js → shared-g55DV75U.js} +16 -37
  49. package/dist/{slash-dispatch.runtime-BT-mMm-f.js → slash-dispatch.runtime-BRQbvn2e.js} +10 -9
  50. package/node_modules/@slack/bolt/dist/App.d.ts +4 -19
  51. package/node_modules/@slack/bolt/dist/App.d.ts.map +1 -1
  52. package/node_modules/@slack/bolt/dist/App.js +21 -40
  53. package/node_modules/@slack/bolt/dist/App.js.map +1 -1
  54. package/node_modules/@slack/bolt/dist/context/create-respond.d.ts +3 -3
  55. package/node_modules/@slack/bolt/dist/context/create-respond.d.ts.map +1 -1
  56. package/node_modules/@slack/bolt/dist/context/create-respond.js +13 -2
  57. package/node_modules/@slack/bolt/dist/context/create-respond.js.map +1 -1
  58. package/node_modules/@slack/bolt/dist/errors.d.ts +6 -8
  59. package/node_modules/@slack/bolt/dist/errors.d.ts.map +1 -1
  60. package/node_modules/@slack/bolt/dist/errors.js +11 -11
  61. package/node_modules/@slack/bolt/dist/errors.js.map +1 -1
  62. package/node_modules/@slack/bolt/dist/helpers.d.ts.map +1 -1
  63. package/node_modules/@slack/bolt/dist/helpers.js +1 -2
  64. package/node_modules/@slack/bolt/dist/helpers.js.map +1 -1
  65. package/node_modules/@slack/bolt/dist/index.d.ts +0 -1
  66. package/node_modules/@slack/bolt/dist/index.d.ts.map +1 -1
  67. package/node_modules/@slack/bolt/dist/index.js +1 -3
  68. package/node_modules/@slack/bolt/dist/index.js.map +1 -1
  69. package/node_modules/@slack/bolt/dist/receivers/AwsLambdaReceiver.d.ts +10 -1
  70. package/node_modules/@slack/bolt/dist/receivers/AwsLambdaReceiver.d.ts.map +1 -1
  71. package/node_modules/@slack/bolt/dist/receivers/AwsLambdaReceiver.js +5 -1
  72. package/node_modules/@slack/bolt/dist/receivers/AwsLambdaReceiver.js.map +1 -1
  73. package/node_modules/@slack/bolt/dist/receivers/HTTPModuleFunctions.d.ts.map +1 -1
  74. package/node_modules/@slack/bolt/dist/receivers/HTTPModuleFunctions.js +10 -14
  75. package/node_modules/@slack/bolt/dist/receivers/HTTPModuleFunctions.js.map +1 -1
  76. package/node_modules/@slack/bolt/dist/receivers/SocketModeFunctions.d.ts.map +1 -1
  77. package/node_modules/@slack/bolt/dist/receivers/SocketModeFunctions.js +1 -1
  78. package/node_modules/@slack/bolt/dist/receivers/SocketModeFunctions.js.map +1 -1
  79. package/node_modules/@slack/bolt/dist/receivers/SocketModeReceiver.d.ts +3 -1
  80. package/node_modules/@slack/bolt/dist/receivers/SocketModeReceiver.d.ts.map +1 -1
  81. package/node_modules/@slack/bolt/dist/receivers/SocketModeReceiver.js +2 -1
  82. package/node_modules/@slack/bolt/dist/receivers/SocketModeReceiver.js.map +1 -1
  83. package/node_modules/@slack/bolt/dist/types/actions/index.d.ts +2 -4
  84. package/node_modules/@slack/bolt/dist/types/actions/index.d.ts.map +1 -1
  85. package/node_modules/@slack/bolt/dist/types/actions/index.js +0 -2
  86. package/node_modules/@slack/bolt/dist/types/actions/index.js.map +1 -1
  87. package/node_modules/@slack/bolt/dist/types/events/index.d.ts +2 -0
  88. package/node_modules/@slack/bolt/dist/types/events/index.d.ts.map +1 -1
  89. package/node_modules/@slack/bolt/dist/types/utilities.d.ts +2 -2
  90. package/node_modules/@slack/bolt/dist/types/utilities.d.ts.map +1 -1
  91. package/node_modules/@slack/bolt/dist/types/view/index.d.ts +1 -31
  92. package/node_modules/@slack/bolt/dist/types/view/index.d.ts.map +1 -1
  93. package/node_modules/@slack/bolt/package.json +10 -11
  94. package/node_modules/@slack/logger/README.md +1 -1
  95. package/node_modules/@slack/logger/dist/index.js +17 -13
  96. package/node_modules/@slack/logger/dist/index.js.map +1 -1
  97. package/node_modules/@slack/logger/package.json +6 -7
  98. package/node_modules/@slack/oauth/README.md +1 -1
  99. package/node_modules/@slack/oauth/dist/errors.d.ts +25 -14
  100. package/node_modules/@slack/oauth/dist/errors.d.ts.map +1 -1
  101. package/node_modules/@slack/oauth/dist/errors.js +24 -33
  102. package/node_modules/@slack/oauth/dist/errors.js.map +1 -1
  103. package/node_modules/@slack/oauth/dist/install-provider.js +58 -16
  104. package/node_modules/@slack/oauth/dist/install-provider.js.map +1 -1
  105. package/node_modules/@slack/oauth/dist/installation-stores/file-store.js +4 -2
  106. package/node_modules/@slack/oauth/dist/installation-stores/file-store.js.map +1 -1
  107. package/node_modules/@slack/oauth/dist/installation-stores/memory-store.js +3 -16
  108. package/node_modules/@slack/oauth/dist/installation-stores/memory-store.js.map +1 -1
  109. package/node_modules/@slack/oauth/dist/state-stores/clear-state-store.js +2 -0
  110. package/node_modules/@slack/oauth/dist/state-stores/clear-state-store.js.map +1 -1
  111. package/node_modules/@slack/oauth/dist/state-stores/file-state-store.js +3 -0
  112. package/node_modules/@slack/oauth/dist/state-stores/file-state-store.js.map +1 -1
  113. package/node_modules/@slack/oauth/package.json +8 -9
  114. package/node_modules/@slack/socket-mode/README.md +1 -1
  115. package/node_modules/@slack/socket-mode/dist/package.json +21 -13
  116. package/node_modules/@slack/socket-mode/dist/src/SlackWebSocket.d.ts +14 -8
  117. package/node_modules/@slack/socket-mode/dist/src/SlackWebSocket.d.ts.map +1 -1
  118. package/node_modules/@slack/socket-mode/dist/src/SlackWebSocket.js +136 -48
  119. package/node_modules/@slack/socket-mode/dist/src/SlackWebSocket.js.map +1 -1
  120. package/node_modules/@slack/socket-mode/dist/src/SocketModeClient.d.ts +12 -6
  121. package/node_modules/@slack/socket-mode/dist/src/SocketModeClient.d.ts.map +1 -1
  122. package/node_modules/@slack/socket-mode/dist/src/SocketModeClient.js +87 -38
  123. package/node_modules/@slack/socket-mode/dist/src/SocketModeClient.js.map +1 -1
  124. package/node_modules/@slack/socket-mode/dist/src/SocketModeOptions.d.ts +31 -1
  125. package/node_modules/@slack/socket-mode/dist/src/SocketModeOptions.d.ts.map +1 -1
  126. package/node_modules/@slack/socket-mode/dist/src/errors.d.ts +31 -37
  127. package/node_modules/@slack/socket-mode/dist/src/errors.d.ts.map +1 -1
  128. package/node_modules/@slack/socket-mode/dist/src/errors.js +43 -47
  129. package/node_modules/@slack/socket-mode/dist/src/errors.js.map +1 -1
  130. package/node_modules/@slack/socket-mode/dist/src/index.d.ts +2 -2
  131. package/node_modules/@slack/socket-mode/dist/src/index.d.ts.map +1 -1
  132. package/node_modules/@slack/socket-mode/dist/src/index.js +7 -1
  133. package/node_modules/@slack/socket-mode/dist/src/index.js.map +1 -1
  134. package/node_modules/@slack/socket-mode/package.json +21 -13
  135. package/node_modules/@slack/types/README.md +1 -1
  136. package/node_modules/@slack/types/dist/events/app.d.ts +28 -0
  137. package/node_modules/@slack/types/dist/events/app.d.ts.map +1 -1
  138. package/node_modules/@slack/types/dist/events/index.d.ts +2 -2
  139. package/node_modules/@slack/types/dist/events/index.d.ts.map +1 -1
  140. package/node_modules/@slack/types/dist/events/index.js.map +1 -1
  141. package/node_modules/@slack/types/dist/events/message.d.ts +2 -0
  142. package/node_modules/@slack/types/dist/events/message.d.ts.map +1 -1
  143. package/node_modules/@slack/types/package.json +3 -3
  144. package/node_modules/@slack/web-api/README.md +1 -1
  145. package/node_modules/@slack/web-api/dist/WebClient.d.ts +42 -71
  146. package/node_modules/@slack/web-api/dist/WebClient.d.ts.map +1 -1
  147. package/node_modules/@slack/web-api/dist/WebClient.js +180 -248
  148. package/node_modules/@slack/web-api/dist/WebClient.js.map +1 -1
  149. package/node_modules/@slack/web-api/dist/chat-stream.js +37 -22
  150. package/node_modules/@slack/web-api/dist/chat-stream.js.map +1 -1
  151. package/node_modules/@slack/web-api/dist/errors.d.ts +32 -51
  152. package/node_modules/@slack/web-api/dist/errors.d.ts.map +1 -1
  153. package/node_modules/@slack/web-api/dist/errors.js +64 -55
  154. package/node_modules/@slack/web-api/dist/errors.js.map +1 -1
  155. package/node_modules/@slack/web-api/dist/file-upload.d.ts +0 -9
  156. package/node_modules/@slack/web-api/dist/file-upload.d.ts.map +1 -1
  157. package/node_modules/@slack/web-api/dist/file-upload.js +41 -46
  158. package/node_modules/@slack/web-api/dist/file-upload.js.map +1 -1
  159. package/node_modules/@slack/web-api/dist/index.d.ts +2 -2
  160. package/node_modules/@slack/web-api/dist/index.d.ts.map +1 -1
  161. package/node_modules/@slack/web-api/dist/index.js +8 -1
  162. package/node_modules/@slack/web-api/dist/index.js.map +1 -1
  163. package/node_modules/@slack/web-api/dist/methods.d.ts +2 -38
  164. package/node_modules/@slack/web-api/dist/methods.d.ts.map +1 -1
  165. package/node_modules/@slack/web-api/dist/methods.js +1347 -1384
  166. package/node_modules/@slack/web-api/dist/methods.js.map +1 -1
  167. package/node_modules/@slack/web-api/dist/types/request/files.d.ts +0 -1
  168. package/node_modules/@slack/web-api/dist/types/request/files.d.ts.map +1 -1
  169. package/node_modules/@slack/web-api/dist/types/request/index.d.ts +3 -3
  170. package/node_modules/@slack/web-api/dist/types/request/index.d.ts.map +1 -1
  171. package/node_modules/@slack/web-api/dist/types/request/manifest.d.ts +66 -1
  172. package/node_modules/@slack/web-api/dist/types/request/manifest.d.ts.map +1 -1
  173. package/node_modules/@slack/web-api/dist/types/request/rtm.d.ts +1 -14
  174. package/node_modules/@slack/web-api/dist/types/request/rtm.d.ts.map +1 -1
  175. package/node_modules/@slack/web-api/dist/types/request/workflows.d.ts +0 -29
  176. package/node_modules/@slack/web-api/dist/types/request/workflows.d.ts.map +1 -1
  177. package/node_modules/@slack/web-api/package.json +6 -10
  178. package/node_modules/@types/node/README.md +1 -1
  179. package/node_modules/@types/node/fs/promises.d.ts +16 -6
  180. package/node_modules/@types/node/package.json +2 -2
  181. package/node_modules/@types/retry/LICENSE +21 -21
  182. package/node_modules/@types/retry/README.md +5 -4
  183. package/node_modules/@types/retry/index.d.ts +20 -13
  184. package/node_modules/@types/retry/package.json +9 -11
  185. package/node_modules/iconv-lite/encodings/sbcs-data.js +2 -0
  186. package/node_modules/iconv-lite/encodings/utf32.js +10 -3
  187. package/node_modules/iconv-lite/package.json +2 -2
  188. package/node_modules/iconv-lite/types/encodings.d.ts +2 -0
  189. package/node_modules/path-to-regexp/Readme.md +3 -3
  190. package/node_modules/path-to-regexp/dist/index.js +135 -158
  191. package/node_modules/path-to-regexp/dist/index.js.map +1 -1
  192. package/node_modules/path-to-regexp/package.json +2 -2
  193. package/node_modules/qs/CHANGELOG.md +11 -0
  194. package/node_modules/qs/dist/qs.js +17 -17
  195. package/node_modules/qs/lib/parse.js +19 -8
  196. package/node_modules/qs/lib/utils.js +47 -8
  197. package/node_modules/qs/package.json +6 -5
  198. package/node_modules/qs/test/parse.js +230 -0
  199. package/node_modules/qs/test/utils.js +194 -0
  200. package/node_modules/typebox/build/compile/validator.d.mts +1 -4
  201. package/node_modules/typebox/build/guard/guard.d.mts +1 -1
  202. package/node_modules/typebox/build/guard/guard.mjs +5 -2
  203. package/node_modules/typebox/build/guard/string.mjs +16 -4
  204. package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
  205. package/node_modules/typebox/build/type/action/readonly_object.d.mts +5 -0
  206. package/node_modules/typebox/build/type/action/readonly_object.mjs +8 -0
  207. package/node_modules/typebox/build/typebox.d.mts +1 -1
  208. package/node_modules/typebox/build/typebox.mjs +1 -1
  209. package/node_modules/typebox/package.json +1 -1
  210. package/node_modules/typebox/readme.md +29 -32
  211. package/node_modules/{es-set-tostringtag → undici}/LICENSE +1 -1
  212. package/node_modules/undici/README.md +741 -0
  213. package/node_modules/undici/docs/docs/api/Agent.md +84 -0
  214. package/node_modules/undici/docs/docs/api/BalancedPool.md +99 -0
  215. package/node_modules/undici/docs/docs/api/CacheStorage.md +30 -0
  216. package/node_modules/undici/docs/docs/api/CacheStore.md +164 -0
  217. package/node_modules/undici/docs/docs/api/Client.md +288 -0
  218. package/node_modules/undici/docs/docs/api/ClientStats.md +27 -0
  219. package/node_modules/undici/docs/docs/api/Connector.md +115 -0
  220. package/node_modules/undici/docs/docs/api/ContentType.md +57 -0
  221. package/node_modules/undici/docs/docs/api/Cookies.md +128 -0
  222. package/node_modules/undici/docs/docs/api/Debug.md +62 -0
  223. package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +315 -0
  224. package/node_modules/undici/docs/docs/api/Dispatcher.md +1392 -0
  225. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +159 -0
  226. package/node_modules/undici/docs/docs/api/Errors.md +49 -0
  227. package/node_modules/undici/docs/docs/api/EventSource.md +45 -0
  228. package/node_modules/undici/docs/docs/api/Fetch.md +60 -0
  229. package/node_modules/undici/docs/docs/api/GlobalInstallation.md +139 -0
  230. package/node_modules/undici/docs/docs/api/H2CClient.md +263 -0
  231. package/node_modules/undici/docs/docs/api/MockAgent.md +603 -0
  232. package/node_modules/undici/docs/docs/api/MockCallHistory.md +197 -0
  233. package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +43 -0
  234. package/node_modules/undici/docs/docs/api/MockClient.md +81 -0
  235. package/node_modules/undici/docs/docs/api/MockErrors.md +12 -0
  236. package/node_modules/undici/docs/docs/api/MockPool.md +555 -0
  237. package/node_modules/undici/docs/docs/api/Pool.md +84 -0
  238. package/node_modules/undici/docs/docs/api/PoolStats.md +35 -0
  239. package/node_modules/undici/docs/docs/api/ProxyAgent.md +229 -0
  240. package/node_modules/undici/docs/docs/api/RedirectHandler.md +93 -0
  241. package/node_modules/undici/docs/docs/api/RetryAgent.md +50 -0
  242. package/node_modules/undici/docs/docs/api/RetryHandler.md +118 -0
  243. package/node_modules/undici/docs/docs/api/RoundRobinPool.md +145 -0
  244. package/node_modules/undici/docs/docs/api/SnapshotAgent.md +616 -0
  245. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +275 -0
  246. package/node_modules/undici/docs/docs/api/Util.md +25 -0
  247. package/node_modules/undici/docs/docs/api/WebSocket.md +141 -0
  248. package/node_modules/undici/docs/docs/api/api-lifecycle.md +91 -0
  249. package/node_modules/undici/docs/docs/best-practices/client-certificate.md +64 -0
  250. package/node_modules/undici/docs/docs/best-practices/crawling.md +58 -0
  251. package/node_modules/undici/docs/docs/best-practices/mocking-request.md +190 -0
  252. package/node_modules/undici/docs/docs/best-practices/proxy.md +127 -0
  253. package/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +224 -0
  254. package/node_modules/undici/docs/docs/best-practices/writing-tests.md +63 -0
  255. package/node_modules/undici/index-fetch.js +65 -0
  256. package/node_modules/undici/index.d.ts +3 -0
  257. package/node_modules/undici/index.js +234 -0
  258. package/node_modules/undici/lib/api/abort-signal.js +59 -0
  259. package/node_modules/undici/lib/api/api-connect.js +110 -0
  260. package/node_modules/undici/lib/api/api-pipeline.js +252 -0
  261. package/node_modules/undici/lib/api/api-request.js +214 -0
  262. package/node_modules/undici/lib/api/api-stream.js +209 -0
  263. package/node_modules/undici/lib/api/api-upgrade.js +111 -0
  264. package/node_modules/undici/lib/api/index.js +7 -0
  265. package/node_modules/undici/lib/api/readable.js +580 -0
  266. package/node_modules/undici/lib/cache/memory-cache-store.js +234 -0
  267. package/node_modules/undici/lib/cache/sqlite-cache-store.js +461 -0
  268. package/node_modules/undici/lib/core/connect.js +153 -0
  269. package/node_modules/undici/lib/core/constants.js +143 -0
  270. package/node_modules/undici/lib/core/diagnostics.js +227 -0
  271. package/node_modules/undici/lib/core/errors.js +477 -0
  272. package/node_modules/undici/lib/core/request.js +453 -0
  273. package/node_modules/undici/lib/core/socks5-client.js +422 -0
  274. package/node_modules/undici/lib/core/socks5-utils.js +212 -0
  275. package/node_modules/undici/lib/core/symbols.js +75 -0
  276. package/node_modules/undici/lib/core/tree.js +160 -0
  277. package/node_modules/undici/lib/core/util.js +992 -0
  278. package/node_modules/undici/lib/dispatcher/agent.js +158 -0
  279. package/node_modules/undici/lib/dispatcher/balanced-pool.js +219 -0
  280. package/node_modules/undici/lib/dispatcher/client-h1.js +1722 -0
  281. package/node_modules/undici/lib/dispatcher/client-h2.js +995 -0
  282. package/node_modules/undici/lib/dispatcher/client.js +664 -0
  283. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +184 -0
  284. package/node_modules/undici/lib/dispatcher/dispatcher.js +48 -0
  285. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +146 -0
  286. package/node_modules/undici/lib/dispatcher/fixed-queue.js +135 -0
  287. package/node_modules/undici/lib/dispatcher/h2c-client.js +51 -0
  288. package/node_modules/undici/lib/dispatcher/pool-base.js +214 -0
  289. package/node_modules/undici/lib/dispatcher/pool.js +118 -0
  290. package/node_modules/undici/lib/dispatcher/proxy-agent.js +319 -0
  291. package/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
  292. package/node_modules/undici/lib/dispatcher/round-robin-pool.js +137 -0
  293. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +260 -0
  294. package/node_modules/undici/lib/encoding/index.js +33 -0
  295. package/node_modules/undici/lib/global.js +59 -0
  296. package/node_modules/undici/lib/handler/cache-handler.js +578 -0
  297. package/node_modules/undici/lib/handler/cache-revalidation-handler.js +124 -0
  298. package/node_modules/undici/lib/handler/decorator-handler.js +67 -0
  299. package/node_modules/undici/lib/handler/deduplication-handler.js +460 -0
  300. package/node_modules/undici/lib/handler/redirect-handler.js +238 -0
  301. package/node_modules/undici/lib/handler/retry-handler.js +394 -0
  302. package/node_modules/undici/lib/handler/unwrap-handler.js +106 -0
  303. package/node_modules/undici/lib/handler/wrap-handler.js +105 -0
  304. package/node_modules/undici/lib/interceptor/cache.js +495 -0
  305. package/node_modules/undici/lib/interceptor/decompress.js +259 -0
  306. package/node_modules/undici/lib/interceptor/deduplicate.js +117 -0
  307. package/node_modules/undici/lib/interceptor/dns.js +571 -0
  308. package/node_modules/undici/lib/interceptor/dump.js +112 -0
  309. package/node_modules/undici/lib/interceptor/redirect.js +21 -0
  310. package/node_modules/undici/lib/interceptor/response-error.js +95 -0
  311. package/node_modules/undici/lib/interceptor/retry.js +19 -0
  312. package/node_modules/undici/lib/llhttp/.gitkeep +0 -0
  313. package/node_modules/undici/lib/llhttp/constants.d.ts +195 -0
  314. package/node_modules/undici/lib/llhttp/constants.js +531 -0
  315. package/node_modules/undici/lib/llhttp/llhttp-wasm.js +15 -0
  316. package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +15 -0
  317. package/node_modules/undici/lib/llhttp/utils.d.ts +2 -0
  318. package/node_modules/undici/lib/llhttp/utils.js +12 -0
  319. package/node_modules/undici/lib/mock/mock-agent.js +232 -0
  320. package/node_modules/undici/lib/mock/mock-call-history.js +248 -0
  321. package/node_modules/undici/lib/mock/mock-client.js +68 -0
  322. package/node_modules/undici/lib/mock/mock-errors.js +29 -0
  323. package/node_modules/undici/lib/mock/mock-interceptor.js +209 -0
  324. package/node_modules/undici/lib/mock/mock-pool.js +68 -0
  325. package/node_modules/undici/lib/mock/mock-symbols.js +32 -0
  326. package/node_modules/undici/lib/mock/mock-utils.js +486 -0
  327. package/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
  328. package/node_modules/undici/lib/mock/snapshot-agent.js +353 -0
  329. package/node_modules/undici/lib/mock/snapshot-recorder.js +588 -0
  330. package/node_modules/undici/lib/mock/snapshot-utils.js +158 -0
  331. package/node_modules/undici/lib/util/cache.js +414 -0
  332. package/node_modules/undici/lib/util/date.js +653 -0
  333. package/node_modules/undici/lib/util/promise.js +28 -0
  334. package/node_modules/undici/lib/util/runtime-features.js +124 -0
  335. package/node_modules/undici/lib/util/stats.js +32 -0
  336. package/node_modules/undici/lib/util/timers.js +425 -0
  337. package/node_modules/undici/lib/web/cache/cache.js +864 -0
  338. package/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
  339. package/node_modules/undici/lib/web/cache/util.js +45 -0
  340. package/node_modules/undici/lib/web/cookies/constants.js +12 -0
  341. package/node_modules/undici/lib/web/cookies/index.js +199 -0
  342. package/node_modules/undici/lib/web/cookies/parse.js +314 -0
  343. package/node_modules/undici/lib/web/cookies/util.js +282 -0
  344. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +399 -0
  345. package/node_modules/undici/lib/web/eventsource/eventsource.js +501 -0
  346. package/node_modules/undici/lib/web/eventsource/util.js +29 -0
  347. package/node_modules/{has-tostringtag → undici/lib/web/fetch}/LICENSE +1 -1
  348. package/node_modules/undici/lib/web/fetch/body.js +509 -0
  349. package/node_modules/undici/lib/web/fetch/constants.js +131 -0
  350. package/node_modules/undici/lib/web/fetch/data-url.js +596 -0
  351. package/node_modules/undici/lib/web/fetch/formdata-parser.js +586 -0
  352. package/node_modules/undici/lib/web/fetch/formdata.js +259 -0
  353. package/node_modules/undici/lib/web/fetch/global.js +40 -0
  354. package/node_modules/undici/lib/web/fetch/headers.js +719 -0
  355. package/node_modules/undici/lib/web/fetch/index.js +2413 -0
  356. package/node_modules/undici/lib/web/fetch/request.js +1115 -0
  357. package/node_modules/undici/lib/web/fetch/response.js +641 -0
  358. package/node_modules/undici/lib/web/fetch/util.js +1522 -0
  359. package/node_modules/undici/lib/web/infra/index.js +229 -0
  360. package/node_modules/undici/lib/web/subresource-integrity/Readme.md +9 -0
  361. package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +307 -0
  362. package/node_modules/undici/lib/web/webidl/index.js +1006 -0
  363. package/node_modules/undici/lib/web/websocket/connection.js +329 -0
  364. package/node_modules/undici/lib/web/websocket/constants.js +126 -0
  365. package/node_modules/undici/lib/web/websocket/events.js +331 -0
  366. package/node_modules/undici/lib/web/websocket/frame.js +133 -0
  367. package/node_modules/undici/lib/web/websocket/permessage-deflate.js +100 -0
  368. package/node_modules/undici/lib/web/websocket/receiver.js +507 -0
  369. package/node_modules/undici/lib/web/websocket/sender.js +109 -0
  370. package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +104 -0
  371. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +498 -0
  372. package/node_modules/undici/lib/web/websocket/util.js +347 -0
  373. package/node_modules/undici/lib/web/websocket/websocket.js +758 -0
  374. package/node_modules/undici/package.json +152 -0
  375. package/node_modules/undici/scripts/strip-comments.js +10 -0
  376. package/node_modules/undici/types/README.md +6 -0
  377. package/node_modules/undici/types/agent.d.ts +32 -0
  378. package/node_modules/undici/types/api.d.ts +43 -0
  379. package/node_modules/undici/types/balanced-pool.d.ts +30 -0
  380. package/node_modules/undici/types/cache-interceptor.d.ts +179 -0
  381. package/node_modules/undici/types/cache.d.ts +36 -0
  382. package/node_modules/undici/types/client-stats.d.ts +15 -0
  383. package/node_modules/undici/types/client.d.ts +139 -0
  384. package/node_modules/undici/types/connector.d.ts +36 -0
  385. package/node_modules/undici/types/content-type.d.ts +21 -0
  386. package/node_modules/undici/types/cookies.d.ts +30 -0
  387. package/node_modules/undici/types/diagnostics-channel.d.ts +74 -0
  388. package/node_modules/undici/types/dispatcher.d.ts +275 -0
  389. package/node_modules/undici/types/env-http-proxy-agent.d.ts +22 -0
  390. package/node_modules/undici/types/errors.d.ts +177 -0
  391. package/node_modules/undici/types/eventsource.d.ts +66 -0
  392. package/node_modules/undici/types/fetch.d.ts +231 -0
  393. package/node_modules/undici/types/formdata.d.ts +114 -0
  394. package/node_modules/undici/types/global-dispatcher.d.ts +9 -0
  395. package/node_modules/undici/types/global-origin.d.ts +7 -0
  396. package/node_modules/undici/types/h2c-client.d.ts +73 -0
  397. package/node_modules/undici/types/handlers.d.ts +14 -0
  398. package/node_modules/undici/types/header.d.ts +160 -0
  399. package/node_modules/undici/types/index.d.ts +91 -0
  400. package/node_modules/undici/types/interceptors.d.ts +80 -0
  401. package/node_modules/undici/types/mock-agent.d.ts +68 -0
  402. package/node_modules/undici/types/mock-call-history.d.ts +111 -0
  403. package/node_modules/undici/types/mock-client.d.ts +27 -0
  404. package/node_modules/undici/types/mock-errors.d.ts +12 -0
  405. package/node_modules/undici/types/mock-interceptor.d.ts +94 -0
  406. package/node_modules/undici/types/mock-pool.d.ts +27 -0
  407. package/node_modules/undici/types/patch.d.ts +29 -0
  408. package/node_modules/undici/types/pool-stats.d.ts +19 -0
  409. package/node_modules/undici/types/pool.d.ts +41 -0
  410. package/node_modules/undici/types/proxy-agent.d.ts +29 -0
  411. package/node_modules/undici/types/readable.d.ts +68 -0
  412. package/node_modules/undici/types/retry-agent.d.ts +8 -0
  413. package/node_modules/undici/types/retry-handler.d.ts +125 -0
  414. package/node_modules/undici/types/round-robin-pool.d.ts +41 -0
  415. package/node_modules/undici/types/snapshot-agent.d.ts +109 -0
  416. package/node_modules/undici/types/socks5-proxy-agent.d.ts +25 -0
  417. package/node_modules/undici/types/util.d.ts +18 -0
  418. package/node_modules/undici/types/utility.d.ts +7 -0
  419. package/node_modules/undici/types/webidl.d.ts +347 -0
  420. package/node_modules/undici/types/websocket.d.ts +188 -0
  421. package/node_modules/ws/lib/receiver.js +15 -32
  422. package/node_modules/ws/lib/websocket-server.js +4 -4
  423. package/node_modules/ws/lib/websocket.js +4 -4
  424. package/node_modules/ws/package.json +5 -1
  425. package/openclaw.plugin.json +1064 -1243
  426. package/package.json +99 -18
  427. package/dist/action-runtime.runtime-DEWOcFM4.js +0 -2
  428. package/dist/config-api-Df9a1B8C.js +0 -3
  429. package/dist/doctor-contract-DKpe5VBr.js +0 -202
  430. package/dist/interactive-replies-Dm_t2R9S.js +0 -197
  431. package/dist/interactive-replies-api.js +0 -2
  432. package/node_modules/@slack/bolt/dist/WorkflowStep.d.ts +0 -159
  433. package/node_modules/@slack/bolt/dist/WorkflowStep.d.ts.map +0 -1
  434. package/node_modules/@slack/bolt/dist/WorkflowStep.js +0 -217
  435. package/node_modules/@slack/bolt/dist/WorkflowStep.js.map +0 -1
  436. package/node_modules/@slack/bolt/dist/types/actions/workflow-step-edit.d.ts +0 -49
  437. package/node_modules/@slack/bolt/dist/types/actions/workflow-step-edit.d.ts.map +0 -1
  438. package/node_modules/@slack/bolt/dist/types/actions/workflow-step-edit.js +0 -3
  439. package/node_modules/@slack/bolt/dist/types/actions/workflow-step-edit.js.map +0 -1
  440. package/node_modules/@types/ws/LICENSE +0 -21
  441. package/node_modules/@types/ws/README.md +0 -15
  442. package/node_modules/@types/ws/index.d.mts +0 -451
  443. package/node_modules/@types/ws/index.d.ts +0 -445
  444. package/node_modules/@types/ws/package.json +0 -72
  445. package/node_modules/asynckit/LICENSE +0 -21
  446. package/node_modules/asynckit/README.md +0 -233
  447. package/node_modules/asynckit/bench.js +0 -76
  448. package/node_modules/asynckit/index.js +0 -6
  449. package/node_modules/asynckit/lib/abort.js +0 -29
  450. package/node_modules/asynckit/lib/async.js +0 -34
  451. package/node_modules/asynckit/lib/defer.js +0 -26
  452. package/node_modules/asynckit/lib/iterate.js +0 -75
  453. package/node_modules/asynckit/lib/readable_asynckit.js +0 -91
  454. package/node_modules/asynckit/lib/readable_parallel.js +0 -25
  455. package/node_modules/asynckit/lib/readable_serial.js +0 -25
  456. package/node_modules/asynckit/lib/readable_serial_ordered.js +0 -29
  457. package/node_modules/asynckit/lib/state.js +0 -37
  458. package/node_modules/asynckit/lib/streamify.js +0 -141
  459. package/node_modules/asynckit/lib/terminator.js +0 -29
  460. package/node_modules/asynckit/package.json +0 -63
  461. package/node_modules/asynckit/parallel.js +0 -43
  462. package/node_modules/asynckit/serial.js +0 -17
  463. package/node_modules/asynckit/serialOrdered.js +0 -75
  464. package/node_modules/asynckit/stream.js +0 -21
  465. package/node_modules/axios/CHANGELOG.md +0 -1676
  466. package/node_modules/axios/LICENSE +0 -7
  467. package/node_modules/axios/MIGRATION_GUIDE.md +0 -877
  468. package/node_modules/axios/README.md +0 -2391
  469. package/node_modules/axios/dist/axios.js +0 -4864
  470. package/node_modules/axios/dist/axios.js.map +0 -1
  471. package/node_modules/axios/dist/axios.min.js +0 -5
  472. package/node_modules/axios/dist/axios.min.js.map +0 -1
  473. package/node_modules/axios/dist/browser/axios.cjs +0 -4701
  474. package/node_modules/axios/dist/browser/axios.cjs.map +0 -1
  475. package/node_modules/axios/dist/esm/axios.js +0 -4722
  476. package/node_modules/axios/dist/esm/axios.js.map +0 -1
  477. package/node_modules/axios/dist/esm/axios.min.js +0 -3
  478. package/node_modules/axios/dist/esm/axios.min.js.map +0 -1
  479. package/node_modules/axios/dist/node/axios.cjs +0 -5348
  480. package/node_modules/axios/dist/node/axios.cjs.map +0 -1
  481. package/node_modules/axios/index.d.cts +0 -715
  482. package/node_modules/axios/index.d.ts +0 -734
  483. package/node_modules/axios/index.js +0 -45
  484. package/node_modules/axios/lib/adapters/README.md +0 -36
  485. package/node_modules/axios/lib/adapters/adapters.js +0 -132
  486. package/node_modules/axios/lib/adapters/fetch.js +0 -469
  487. package/node_modules/axios/lib/adapters/http.js +0 -1202
  488. package/node_modules/axios/lib/adapters/xhr.js +0 -226
  489. package/node_modules/axios/lib/axios.js +0 -89
  490. package/node_modules/axios/lib/cancel/CancelToken.js +0 -135
  491. package/node_modules/axios/lib/cancel/CanceledError.js +0 -22
  492. package/node_modules/axios/lib/cancel/isCancel.js +0 -5
  493. package/node_modules/axios/lib/core/Axios.js +0 -281
  494. package/node_modules/axios/lib/core/AxiosError.js +0 -176
  495. package/node_modules/axios/lib/core/AxiosHeaders.js +0 -380
  496. package/node_modules/axios/lib/core/InterceptorManager.js +0 -72
  497. package/node_modules/axios/lib/core/README.md +0 -8
  498. package/node_modules/axios/lib/core/buildFullPath.js +0 -22
  499. package/node_modules/axios/lib/core/dispatchRequest.js +0 -89
  500. package/node_modules/axios/lib/core/mergeConfig.js +0 -124
  501. package/node_modules/axios/lib/core/settle.js +0 -27
  502. package/node_modules/axios/lib/core/transformData.js +0 -28
  503. package/node_modules/axios/lib/defaults/index.js +0 -177
  504. package/node_modules/axios/lib/defaults/transitional.js +0 -8
  505. package/node_modules/axios/lib/env/README.md +0 -3
  506. package/node_modules/axios/lib/env/classes/FormData.js +0 -2
  507. package/node_modules/axios/lib/env/data.js +0 -1
  508. package/node_modules/axios/lib/helpers/AxiosTransformStream.js +0 -156
  509. package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -61
  510. package/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -77
  511. package/node_modules/axios/lib/helpers/README.md +0 -7
  512. package/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +0 -29
  513. package/node_modules/axios/lib/helpers/bind.js +0 -14
  514. package/node_modules/axios/lib/helpers/buildURL.js +0 -66
  515. package/node_modules/axios/lib/helpers/callbackify.js +0 -18
  516. package/node_modules/axios/lib/helpers/combineURLs.js +0 -15
  517. package/node_modules/axios/lib/helpers/composeSignals.js +0 -56
  518. package/node_modules/axios/lib/helpers/cookies.js +0 -60
  519. package/node_modules/axios/lib/helpers/deprecatedMethod.js +0 -31
  520. package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +0 -100
  521. package/node_modules/axios/lib/helpers/formDataToJSON.js +0 -97
  522. package/node_modules/axios/lib/helpers/formDataToStream.js +0 -119
  523. package/node_modules/axios/lib/helpers/fromDataURI.js +0 -53
  524. package/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -19
  525. package/node_modules/axios/lib/helpers/isAxiosError.js +0 -14
  526. package/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -16
  527. package/node_modules/axios/lib/helpers/null.js +0 -2
  528. package/node_modules/axios/lib/helpers/parseHeaders.js +0 -69
  529. package/node_modules/axios/lib/helpers/parseProtocol.js +0 -6
  530. package/node_modules/axios/lib/helpers/progressEventReducer.js +0 -51
  531. package/node_modules/axios/lib/helpers/readBlob.js +0 -15
  532. package/node_modules/axios/lib/helpers/resolveConfig.js +0 -106
  533. package/node_modules/axios/lib/helpers/shouldBypassProxy.js +0 -178
  534. package/node_modules/axios/lib/helpers/speedometer.js +0 -55
  535. package/node_modules/axios/lib/helpers/spread.js +0 -28
  536. package/node_modules/axios/lib/helpers/throttle.js +0 -44
  537. package/node_modules/axios/lib/helpers/toFormData.js +0 -249
  538. package/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -19
  539. package/node_modules/axios/lib/helpers/trackStream.js +0 -89
  540. package/node_modules/axios/lib/helpers/validator.js +0 -112
  541. package/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -3
  542. package/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -3
  543. package/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -4
  544. package/node_modules/axios/lib/platform/browser/index.js +0 -13
  545. package/node_modules/axios/lib/platform/common/utils.js +0 -52
  546. package/node_modules/axios/lib/platform/index.js +0 -7
  547. package/node_modules/axios/lib/platform/node/classes/FormData.js +0 -3
  548. package/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +0 -4
  549. package/node_modules/axios/lib/platform/node/index.js +0 -37
  550. package/node_modules/axios/lib/utils.js +0 -931
  551. package/node_modules/axios/package.json +0 -183
  552. package/node_modules/combined-stream/License +0 -19
  553. package/node_modules/combined-stream/Readme.md +0 -138
  554. package/node_modules/combined-stream/lib/combined_stream.js +0 -208
  555. package/node_modules/combined-stream/package.json +0 -25
  556. package/node_modules/delayed-stream/.npmignore +0 -1
  557. package/node_modules/delayed-stream/License +0 -19
  558. package/node_modules/delayed-stream/Makefile +0 -7
  559. package/node_modules/delayed-stream/Readme.md +0 -141
  560. package/node_modules/delayed-stream/lib/delayed_stream.js +0 -107
  561. package/node_modules/delayed-stream/package.json +0 -27
  562. package/node_modules/es-set-tostringtag/.eslintrc +0 -13
  563. package/node_modules/es-set-tostringtag/.nycrc +0 -9
  564. package/node_modules/es-set-tostringtag/CHANGELOG.md +0 -67
  565. package/node_modules/es-set-tostringtag/README.md +0 -53
  566. package/node_modules/es-set-tostringtag/index.d.ts +0 -10
  567. package/node_modules/es-set-tostringtag/index.js +0 -35
  568. package/node_modules/es-set-tostringtag/package.json +0 -78
  569. package/node_modules/es-set-tostringtag/test/index.js +0 -85
  570. package/node_modules/es-set-tostringtag/tsconfig.json +0 -9
  571. package/node_modules/follow-redirects/LICENSE +0 -18
  572. package/node_modules/follow-redirects/README.md +0 -157
  573. package/node_modules/follow-redirects/debug.js +0 -15
  574. package/node_modules/follow-redirects/http.js +0 -1
  575. package/node_modules/follow-redirects/https.js +0 -1
  576. package/node_modules/follow-redirects/index.js +0 -709
  577. package/node_modules/follow-redirects/package.json +0 -58
  578. package/node_modules/form-data/CHANGELOG.md +0 -669
  579. package/node_modules/form-data/License +0 -19
  580. package/node_modules/form-data/README.md +0 -350
  581. package/node_modules/form-data/index.d.ts +0 -51
  582. package/node_modules/form-data/lib/browser.js +0 -4
  583. package/node_modules/form-data/lib/form_data.js +0 -514
  584. package/node_modules/form-data/lib/populate.js +0 -10
  585. package/node_modules/form-data/node_modules/mime-db/HISTORY.md +0 -507
  586. package/node_modules/form-data/node_modules/mime-db/LICENSE +0 -23
  587. package/node_modules/form-data/node_modules/mime-db/README.md +0 -100
  588. package/node_modules/form-data/node_modules/mime-db/db.json +0 -8519
  589. package/node_modules/form-data/node_modules/mime-db/index.js +0 -12
  590. package/node_modules/form-data/node_modules/mime-db/package.json +0 -60
  591. package/node_modules/form-data/node_modules/mime-types/HISTORY.md +0 -397
  592. package/node_modules/form-data/node_modules/mime-types/LICENSE +0 -23
  593. package/node_modules/form-data/node_modules/mime-types/README.md +0 -113
  594. package/node_modules/form-data/node_modules/mime-types/index.js +0 -188
  595. package/node_modules/form-data/node_modules/mime-types/package.json +0 -44
  596. package/node_modules/form-data/package.json +0 -83
  597. package/node_modules/has-tostringtag/.eslintrc +0 -5
  598. package/node_modules/has-tostringtag/.github/FUNDING.yml +0 -12
  599. package/node_modules/has-tostringtag/.nycrc +0 -13
  600. package/node_modules/has-tostringtag/CHANGELOG.md +0 -42
  601. package/node_modules/has-tostringtag/README.md +0 -46
  602. package/node_modules/has-tostringtag/index.d.ts +0 -3
  603. package/node_modules/has-tostringtag/index.js +0 -8
  604. package/node_modules/has-tostringtag/package.json +0 -108
  605. package/node_modules/has-tostringtag/shams.d.ts +0 -3
  606. package/node_modules/has-tostringtag/shams.js +0 -8
  607. package/node_modules/has-tostringtag/test/index.js +0 -21
  608. package/node_modules/has-tostringtag/test/shams/core-js.js +0 -31
  609. package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +0 -30
  610. package/node_modules/has-tostringtag/test/tests.js +0 -15
  611. package/node_modules/has-tostringtag/tsconfig.json +0 -49
  612. package/node_modules/is-electron/LICENSE +0 -21
  613. package/node_modules/is-electron/README.md +0 -25
  614. package/node_modules/is-electron/index.d.ts +0 -2
  615. package/node_modules/is-electron/index.js +0 -21
  616. package/node_modules/is-electron/package.json +0 -34
  617. package/node_modules/is-stream/index.d.ts +0 -79
  618. package/node_modules/is-stream/index.js +0 -28
  619. package/node_modules/is-stream/license +0 -9
  620. package/node_modules/is-stream/package.json +0 -42
  621. package/node_modules/is-stream/readme.md +0 -60
  622. package/node_modules/proxy-from-env/LICENSE +0 -20
  623. package/node_modules/proxy-from-env/README.md +0 -163
  624. package/node_modules/proxy-from-env/index.cjs +0 -105
  625. package/node_modules/proxy-from-env/index.js +0 -103
  626. package/node_modules/proxy-from-env/package.json +0 -43
  627. package/npm-shrinkwrap.json +0 -1440
@@ -1,4722 +0,0 @@
1
- /*! Axios v1.16.0 Copyright (c) 2026 Matt Zabriskie and contributors */
2
- /**
3
- * Create a bound version of a function with a specified `this` context
4
- *
5
- * @param {Function} fn - The function to bind
6
- * @param {*} thisArg - The value to be passed as the `this` parameter
7
- * @returns {Function} A new function that will call the original function with the specified `this` context
8
- */
9
- function bind(fn, thisArg) {
10
- return function wrap() {
11
- return fn.apply(thisArg, arguments);
12
- };
13
- }
14
-
15
- // utils is a library of generic helper functions non-specific to axios
16
-
17
- const { toString } = Object.prototype;
18
- const { getPrototypeOf } = Object;
19
- const { iterator, toStringTag } = Symbol;
20
-
21
- const kindOf = ((cache) => (thing) => {
22
- const str = toString.call(thing);
23
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
24
- })(Object.create(null));
25
-
26
- const kindOfTest = (type) => {
27
- type = type.toLowerCase();
28
- return (thing) => kindOf(thing) === type;
29
- };
30
-
31
- const typeOfTest = (type) => (thing) => typeof thing === type;
32
-
33
- /**
34
- * Determine if a value is a non-null object
35
- *
36
- * @param {Object} val The value to test
37
- *
38
- * @returns {boolean} True if value is an Array, otherwise false
39
- */
40
- const { isArray } = Array;
41
-
42
- /**
43
- * Determine if a value is undefined
44
- *
45
- * @param {*} val The value to test
46
- *
47
- * @returns {boolean} True if the value is undefined, otherwise false
48
- */
49
- const isUndefined = typeOfTest('undefined');
50
-
51
- /**
52
- * Determine if a value is a Buffer
53
- *
54
- * @param {*} val The value to test
55
- *
56
- * @returns {boolean} True if value is a Buffer, otherwise false
57
- */
58
- function isBuffer(val) {
59
- return (
60
- val !== null &&
61
- !isUndefined(val) &&
62
- val.constructor !== null &&
63
- !isUndefined(val.constructor) &&
64
- isFunction$1(val.constructor.isBuffer) &&
65
- val.constructor.isBuffer(val)
66
- );
67
- }
68
-
69
- /**
70
- * Determine if a value is an ArrayBuffer
71
- *
72
- * @param {*} val The value to test
73
- *
74
- * @returns {boolean} True if value is an ArrayBuffer, otherwise false
75
- */
76
- const isArrayBuffer = kindOfTest('ArrayBuffer');
77
-
78
- /**
79
- * Determine if a value is a view on an ArrayBuffer
80
- *
81
- * @param {*} val The value to test
82
- *
83
- * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
84
- */
85
- function isArrayBufferView(val) {
86
- let result;
87
- if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
88
- result = ArrayBuffer.isView(val);
89
- } else {
90
- result = val && val.buffer && isArrayBuffer(val.buffer);
91
- }
92
- return result;
93
- }
94
-
95
- /**
96
- * Determine if a value is a String
97
- *
98
- * @param {*} val The value to test
99
- *
100
- * @returns {boolean} True if value is a String, otherwise false
101
- */
102
- const isString = typeOfTest('string');
103
-
104
- /**
105
- * Determine if a value is a Function
106
- *
107
- * @param {*} val The value to test
108
- * @returns {boolean} True if value is a Function, otherwise false
109
- */
110
- const isFunction$1 = typeOfTest('function');
111
-
112
- /**
113
- * Determine if a value is a Number
114
- *
115
- * @param {*} val The value to test
116
- *
117
- * @returns {boolean} True if value is a Number, otherwise false
118
- */
119
- const isNumber = typeOfTest('number');
120
-
121
- /**
122
- * Determine if a value is an Object
123
- *
124
- * @param {*} thing The value to test
125
- *
126
- * @returns {boolean} True if value is an Object, otherwise false
127
- */
128
- const isObject = (thing) => thing !== null && typeof thing === 'object';
129
-
130
- /**
131
- * Determine if a value is a Boolean
132
- *
133
- * @param {*} thing The value to test
134
- * @returns {boolean} True if value is a Boolean, otherwise false
135
- */
136
- const isBoolean = (thing) => thing === true || thing === false;
137
-
138
- /**
139
- * Determine if a value is a plain Object
140
- *
141
- * @param {*} val The value to test
142
- *
143
- * @returns {boolean} True if value is a plain Object, otherwise false
144
- */
145
- const isPlainObject = (val) => {
146
- if (kindOf(val) !== 'object') {
147
- return false;
148
- }
149
-
150
- const prototype = getPrototypeOf(val);
151
- return (
152
- (prototype === null ||
153
- prototype === Object.prototype ||
154
- Object.getPrototypeOf(prototype) === null) &&
155
- !(toStringTag in val) &&
156
- !(iterator in val)
157
- );
158
- };
159
-
160
- /**
161
- * Determine if a value is an empty object (safely handles Buffers)
162
- *
163
- * @param {*} val The value to test
164
- *
165
- * @returns {boolean} True if value is an empty object, otherwise false
166
- */
167
- const isEmptyObject = (val) => {
168
- // Early return for non-objects or Buffers to prevent RangeError
169
- if (!isObject(val) || isBuffer(val)) {
170
- return false;
171
- }
172
-
173
- try {
174
- return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;
175
- } catch (e) {
176
- // Fallback for any other objects that might cause RangeError with Object.keys()
177
- return false;
178
- }
179
- };
180
-
181
- /**
182
- * Determine if a value is a Date
183
- *
184
- * @param {*} val The value to test
185
- *
186
- * @returns {boolean} True if value is a Date, otherwise false
187
- */
188
- const isDate = kindOfTest('Date');
189
-
190
- /**
191
- * Determine if a value is a File
192
- *
193
- * @param {*} val The value to test
194
- *
195
- * @returns {boolean} True if value is a File, otherwise false
196
- */
197
- const isFile = kindOfTest('File');
198
-
199
- /**
200
- * Determine if a value is a React Native Blob
201
- * React Native "blob": an object with a `uri` attribute. Optionally, it can
202
- * also have a `name` and `type` attribute to specify filename and content type
203
- *
204
- * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
205
- *
206
- * @param {*} value The value to test
207
- *
208
- * @returns {boolean} True if value is a React Native Blob, otherwise false
209
- */
210
- const isReactNativeBlob = (value) => {
211
- return !!(value && typeof value.uri !== 'undefined');
212
- };
213
-
214
- /**
215
- * Determine if environment is React Native
216
- * ReactNative `FormData` has a non-standard `getParts()` method
217
- *
218
- * @param {*} formData The formData to test
219
- *
220
- * @returns {boolean} True if environment is React Native, otherwise false
221
- */
222
- const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
223
-
224
- /**
225
- * Determine if a value is a Blob
226
- *
227
- * @param {*} val The value to test
228
- *
229
- * @returns {boolean} True if value is a Blob, otherwise false
230
- */
231
- const isBlob = kindOfTest('Blob');
232
-
233
- /**
234
- * Determine if a value is a FileList
235
- *
236
- * @param {*} val The value to test
237
- *
238
- * @returns {boolean} True if value is a FileList, otherwise false
239
- */
240
- const isFileList = kindOfTest('FileList');
241
-
242
- /**
243
- * Determine if a value is a Stream
244
- *
245
- * @param {*} val The value to test
246
- *
247
- * @returns {boolean} True if value is a Stream, otherwise false
248
- */
249
- const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
250
-
251
- /**
252
- * Determine if a value is a FormData
253
- *
254
- * @param {*} thing The value to test
255
- *
256
- * @returns {boolean} True if value is an FormData, otherwise false
257
- */
258
- function getGlobal() {
259
- if (typeof globalThis !== 'undefined') return globalThis;
260
- if (typeof self !== 'undefined') return self;
261
- if (typeof window !== 'undefined') return window;
262
- if (typeof global !== 'undefined') return global;
263
- return {};
264
- }
265
-
266
- const G = getGlobal();
267
- const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
268
-
269
- const isFormData = (thing) => {
270
- if (!thing) return false;
271
- if (FormDataCtor && thing instanceof FormDataCtor) return true;
272
- // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData.
273
- const proto = getPrototypeOf(thing);
274
- if (!proto || proto === Object.prototype) return false;
275
- if (!isFunction$1(thing.append)) return false;
276
- const kind = kindOf(thing);
277
- return (
278
- kind === 'formdata' ||
279
- // detect form-data instance
280
- (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
281
- );
282
- };
283
-
284
- /**
285
- * Determine if a value is a URLSearchParams object
286
- *
287
- * @param {*} val The value to test
288
- *
289
- * @returns {boolean} True if value is a URLSearchParams object, otherwise false
290
- */
291
- const isURLSearchParams = kindOfTest('URLSearchParams');
292
-
293
- const [isReadableStream, isRequest, isResponse, isHeaders] = [
294
- 'ReadableStream',
295
- 'Request',
296
- 'Response',
297
- 'Headers',
298
- ].map(kindOfTest);
299
-
300
- /**
301
- * Trim excess whitespace off the beginning and end of a string
302
- *
303
- * @param {String} str The String to trim
304
- *
305
- * @returns {String} The String freed of excess whitespace
306
- */
307
- const trim = (str) => {
308
- return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
309
- };
310
- /**
311
- * Iterate over an Array or an Object invoking a function for each item.
312
- *
313
- * If `obj` is an Array callback will be called passing
314
- * the value, index, and complete array for each item.
315
- *
316
- * If 'obj' is an Object callback will be called passing
317
- * the value, key, and complete object for each property.
318
- *
319
- * @param {Object|Array<unknown>} obj The object to iterate
320
- * @param {Function} fn The callback to invoke for each item
321
- *
322
- * @param {Object} [options]
323
- * @param {Boolean} [options.allOwnKeys = false]
324
- * @returns {any}
325
- */
326
- function forEach(obj, fn, { allOwnKeys = false } = {}) {
327
- // Don't bother if no value provided
328
- if (obj === null || typeof obj === 'undefined') {
329
- return;
330
- }
331
-
332
- let i;
333
- let l;
334
-
335
- // Force an array if not already something iterable
336
- if (typeof obj !== 'object') {
337
- /*eslint no-param-reassign:0*/
338
- obj = [obj];
339
- }
340
-
341
- if (isArray(obj)) {
342
- // Iterate over array values
343
- for (i = 0, l = obj.length; i < l; i++) {
344
- fn.call(null, obj[i], i, obj);
345
- }
346
- } else {
347
- // Buffer check
348
- if (isBuffer(obj)) {
349
- return;
350
- }
351
-
352
- // Iterate over object keys
353
- const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
354
- const len = keys.length;
355
- let key;
356
-
357
- for (i = 0; i < len; i++) {
358
- key = keys[i];
359
- fn.call(null, obj[key], key, obj);
360
- }
361
- }
362
- }
363
-
364
- /**
365
- * Finds a key in an object, case-insensitive, returning the actual key name.
366
- * Returns null if the object is a Buffer or if no match is found.
367
- *
368
- * @param {Object} obj - The object to search.
369
- * @param {string} key - The key to find (case-insensitive).
370
- * @returns {?string} The actual key name if found, otherwise null.
371
- */
372
- function findKey(obj, key) {
373
- if (isBuffer(obj)) {
374
- return null;
375
- }
376
-
377
- key = key.toLowerCase();
378
- const keys = Object.keys(obj);
379
- let i = keys.length;
380
- let _key;
381
- while (i-- > 0) {
382
- _key = keys[i];
383
- if (key === _key.toLowerCase()) {
384
- return _key;
385
- }
386
- }
387
- return null;
388
- }
389
-
390
- const _global = (() => {
391
- /*eslint no-undef:0*/
392
- if (typeof globalThis !== 'undefined') return globalThis;
393
- return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global;
394
- })();
395
-
396
- const isContextDefined = (context) => !isUndefined(context) && context !== _global;
397
-
398
- /**
399
- * Accepts varargs expecting each argument to be an object, then
400
- * immutably merges the properties of each object and returns result.
401
- *
402
- * When multiple objects contain the same key the later object in
403
- * the arguments list will take precedence.
404
- *
405
- * Example:
406
- *
407
- * ```js
408
- * const result = merge({foo: 123}, {foo: 456});
409
- * console.log(result.foo); // outputs 456
410
- * ```
411
- *
412
- * @param {Object} obj1 Object to merge
413
- *
414
- * @returns {Object} Result of all merge properties
415
- */
416
- function merge(...objs) {
417
- const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
418
- const result = {};
419
- const assignValue = (val, key) => {
420
- // Skip dangerous property names to prevent prototype pollution
421
- if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
422
- return;
423
- }
424
-
425
- const targetKey = (caseless && findKey(result, key)) || key;
426
- // Read via own-prop only — a bare `result[targetKey]` walks the prototype
427
- // chain, so a polluted Object.prototype value could surface here and get
428
- // copied into the merged result.
429
- const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;
430
- if (isPlainObject(existing) && isPlainObject(val)) {
431
- result[targetKey] = merge(existing, val);
432
- } else if (isPlainObject(val)) {
433
- result[targetKey] = merge({}, val);
434
- } else if (isArray(val)) {
435
- result[targetKey] = val.slice();
436
- } else if (!skipUndefined || !isUndefined(val)) {
437
- result[targetKey] = val;
438
- }
439
- };
440
-
441
- for (let i = 0, l = objs.length; i < l; i++) {
442
- objs[i] && forEach(objs[i], assignValue);
443
- }
444
- return result;
445
- }
446
-
447
- /**
448
- * Extends object a by mutably adding to it the properties of object b.
449
- *
450
- * @param {Object} a The object to be extended
451
- * @param {Object} b The object to copy properties from
452
- * @param {Object} thisArg The object to bind function to
453
- *
454
- * @param {Object} [options]
455
- * @param {Boolean} [options.allOwnKeys]
456
- * @returns {Object} The resulting value of object a
457
- */
458
- const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
459
- forEach(
460
- b,
461
- (val, key) => {
462
- if (thisArg && isFunction$1(val)) {
463
- Object.defineProperty(a, key, {
464
- // Null-proto descriptor so a polluted Object.prototype.get cannot
465
- // hijack defineProperty's accessor-vs-data resolution.
466
- __proto__: null,
467
- value: bind(val, thisArg),
468
- writable: true,
469
- enumerable: true,
470
- configurable: true,
471
- });
472
- } else {
473
- Object.defineProperty(a, key, {
474
- __proto__: null,
475
- value: val,
476
- writable: true,
477
- enumerable: true,
478
- configurable: true,
479
- });
480
- }
481
- },
482
- { allOwnKeys }
483
- );
484
- return a;
485
- };
486
-
487
- /**
488
- * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
489
- *
490
- * @param {string} content with BOM
491
- *
492
- * @returns {string} content value without BOM
493
- */
494
- const stripBOM = (content) => {
495
- if (content.charCodeAt(0) === 0xfeff) {
496
- content = content.slice(1);
497
- }
498
- return content;
499
- };
500
-
501
- /**
502
- * Inherit the prototype methods from one constructor into another
503
- * @param {function} constructor
504
- * @param {function} superConstructor
505
- * @param {object} [props]
506
- * @param {object} [descriptors]
507
- *
508
- * @returns {void}
509
- */
510
- const inherits = (constructor, superConstructor, props, descriptors) => {
511
- constructor.prototype = Object.create(superConstructor.prototype, descriptors);
512
- Object.defineProperty(constructor.prototype, 'constructor', {
513
- __proto__: null,
514
- value: constructor,
515
- writable: true,
516
- enumerable: false,
517
- configurable: true,
518
- });
519
- Object.defineProperty(constructor, 'super', {
520
- __proto__: null,
521
- value: superConstructor.prototype,
522
- });
523
- props && Object.assign(constructor.prototype, props);
524
- };
525
-
526
- /**
527
- * Resolve object with deep prototype chain to a flat object
528
- * @param {Object} sourceObj source object
529
- * @param {Object} [destObj]
530
- * @param {Function|Boolean} [filter]
531
- * @param {Function} [propFilter]
532
- *
533
- * @returns {Object}
534
- */
535
- const toFlatObject = (sourceObj, destObj, filter, propFilter) => {
536
- let props;
537
- let i;
538
- let prop;
539
- const merged = {};
540
-
541
- destObj = destObj || {};
542
- // eslint-disable-next-line no-eq-null,eqeqeq
543
- if (sourceObj == null) return destObj;
544
-
545
- do {
546
- props = Object.getOwnPropertyNames(sourceObj);
547
- i = props.length;
548
- while (i-- > 0) {
549
- prop = props[i];
550
- if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
551
- destObj[prop] = sourceObj[prop];
552
- merged[prop] = true;
553
- }
554
- }
555
- sourceObj = filter !== false && getPrototypeOf(sourceObj);
556
- } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);
557
-
558
- return destObj;
559
- };
560
-
561
- /**
562
- * Determines whether a string ends with the characters of a specified string
563
- *
564
- * @param {String} str
565
- * @param {String} searchString
566
- * @param {Number} [position= 0]
567
- *
568
- * @returns {boolean}
569
- */
570
- const endsWith = (str, searchString, position) => {
571
- str = String(str);
572
- if (position === undefined || position > str.length) {
573
- position = str.length;
574
- }
575
- position -= searchString.length;
576
- const lastIndex = str.indexOf(searchString, position);
577
- return lastIndex !== -1 && lastIndex === position;
578
- };
579
-
580
- /**
581
- * Returns new array from array like object or null if failed
582
- *
583
- * @param {*} [thing]
584
- *
585
- * @returns {?Array}
586
- */
587
- const toArray = (thing) => {
588
- if (!thing) return null;
589
- if (isArray(thing)) return thing;
590
- let i = thing.length;
591
- if (!isNumber(i)) return null;
592
- const arr = new Array(i);
593
- while (i-- > 0) {
594
- arr[i] = thing[i];
595
- }
596
- return arr;
597
- };
598
-
599
- /**
600
- * Checking if the Uint8Array exists and if it does, it returns a function that checks if the
601
- * thing passed in is an instance of Uint8Array
602
- *
603
- * @param {TypedArray}
604
- *
605
- * @returns {Array}
606
- */
607
- // eslint-disable-next-line func-names
608
- const isTypedArray = ((TypedArray) => {
609
- // eslint-disable-next-line func-names
610
- return (thing) => {
611
- return TypedArray && thing instanceof TypedArray;
612
- };
613
- })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
614
-
615
- /**
616
- * For each entry in the object, call the function with the key and value.
617
- *
618
- * @param {Object<any, any>} obj - The object to iterate over.
619
- * @param {Function} fn - The function to call for each entry.
620
- *
621
- * @returns {void}
622
- */
623
- const forEachEntry = (obj, fn) => {
624
- const generator = obj && obj[iterator];
625
-
626
- const _iterator = generator.call(obj);
627
-
628
- let result;
629
-
630
- while ((result = _iterator.next()) && !result.done) {
631
- const pair = result.value;
632
- fn.call(obj, pair[0], pair[1]);
633
- }
634
- };
635
-
636
- /**
637
- * It takes a regular expression and a string, and returns an array of all the matches
638
- *
639
- * @param {string} regExp - The regular expression to match against.
640
- * @param {string} str - The string to search.
641
- *
642
- * @returns {Array<boolean>}
643
- */
644
- const matchAll = (regExp, str) => {
645
- let matches;
646
- const arr = [];
647
-
648
- while ((matches = regExp.exec(str)) !== null) {
649
- arr.push(matches);
650
- }
651
-
652
- return arr;
653
- };
654
-
655
- /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
656
- const isHTMLForm = kindOfTest('HTMLFormElement');
657
-
658
- const toCamelCase = (str) => {
659
- return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
660
- return p1.toUpperCase() + p2;
661
- });
662
- };
663
-
664
- /* Creating a function that will check if an object has a property. */
665
- const hasOwnProperty = (
666
- ({ hasOwnProperty }) =>
667
- (obj, prop) =>
668
- hasOwnProperty.call(obj, prop)
669
- )(Object.prototype);
670
-
671
- /**
672
- * Determine if a value is a RegExp object
673
- *
674
- * @param {*} val The value to test
675
- *
676
- * @returns {boolean} True if value is a RegExp object, otherwise false
677
- */
678
- const isRegExp = kindOfTest('RegExp');
679
-
680
- const reduceDescriptors = (obj, reducer) => {
681
- const descriptors = Object.getOwnPropertyDescriptors(obj);
682
- const reducedDescriptors = {};
683
-
684
- forEach(descriptors, (descriptor, name) => {
685
- let ret;
686
- if ((ret = reducer(descriptor, name, obj)) !== false) {
687
- reducedDescriptors[name] = ret || descriptor;
688
- }
689
- });
690
-
691
- Object.defineProperties(obj, reducedDescriptors);
692
- };
693
-
694
- /**
695
- * Makes all methods read-only
696
- * @param {Object} obj
697
- */
698
-
699
- const freezeMethods = (obj) => {
700
- reduceDescriptors(obj, (descriptor, name) => {
701
- // skip restricted props in strict mode
702
- if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].includes(name)) {
703
- return false;
704
- }
705
-
706
- const value = obj[name];
707
-
708
- if (!isFunction$1(value)) return;
709
-
710
- descriptor.enumerable = false;
711
-
712
- if ('writable' in descriptor) {
713
- descriptor.writable = false;
714
- return;
715
- }
716
-
717
- if (!descriptor.set) {
718
- descriptor.set = () => {
719
- throw Error("Can not rewrite read-only method '" + name + "'");
720
- };
721
- }
722
- });
723
- };
724
-
725
- /**
726
- * Converts an array or a delimited string into an object set with values as keys and true as values.
727
- * Useful for fast membership checks.
728
- *
729
- * @param {Array|string} arrayOrString - The array or string to convert.
730
- * @param {string} delimiter - The delimiter to use if input is a string.
731
- * @returns {Object} An object with keys from the array or string, values set to true.
732
- */
733
- const toObjectSet = (arrayOrString, delimiter) => {
734
- const obj = {};
735
-
736
- const define = (arr) => {
737
- arr.forEach((value) => {
738
- obj[value] = true;
739
- });
740
- };
741
-
742
- isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
743
-
744
- return obj;
745
- };
746
-
747
- const noop = () => {};
748
-
749
- const toFiniteNumber = (value, defaultValue) => {
750
- return value != null && Number.isFinite((value = +value)) ? value : defaultValue;
751
- };
752
-
753
- /**
754
- * If the thing is a FormData object, return true, otherwise return false.
755
- *
756
- * @param {unknown} thing - The thing to check.
757
- *
758
- * @returns {boolean}
759
- */
760
- function isSpecCompliantForm(thing) {
761
- return !!(
762
- thing &&
763
- isFunction$1(thing.append) &&
764
- thing[toStringTag] === 'FormData' &&
765
- thing[iterator]
766
- );
767
- }
768
-
769
- /**
770
- * Recursively converts an object to a JSON-compatible object, handling circular references and Buffers.
771
- *
772
- * @param {Object} obj - The object to convert.
773
- * @returns {Object} The JSON-compatible object.
774
- */
775
- const toJSONObject = (obj) => {
776
- const stack = new Array(10);
777
-
778
- const visit = (source, i) => {
779
- if (isObject(source)) {
780
- if (stack.indexOf(source) >= 0) {
781
- return;
782
- }
783
-
784
- //Buffer check
785
- if (isBuffer(source)) {
786
- return source;
787
- }
788
-
789
- if (!('toJSON' in source)) {
790
- stack[i] = source;
791
- const target = isArray(source) ? [] : {};
792
-
793
- forEach(source, (value, key) => {
794
- const reducedValue = visit(value, i + 1);
795
- !isUndefined(reducedValue) && (target[key] = reducedValue);
796
- });
797
-
798
- stack[i] = undefined;
799
-
800
- return target;
801
- }
802
- }
803
-
804
- return source;
805
- };
806
-
807
- return visit(obj, 0);
808
- };
809
-
810
- /**
811
- * Determines if a value is an async function.
812
- *
813
- * @param {*} thing - The value to test.
814
- * @returns {boolean} True if value is an async function, otherwise false.
815
- */
816
- const isAsyncFn = kindOfTest('AsyncFunction');
817
-
818
- /**
819
- * Determines if a value is thenable (has then and catch methods).
820
- *
821
- * @param {*} thing - The value to test.
822
- * @returns {boolean} True if value is thenable, otherwise false.
823
- */
824
- const isThenable = (thing) =>
825
- thing &&
826
- (isObject(thing) || isFunction$1(thing)) &&
827
- isFunction$1(thing.then) &&
828
- isFunction$1(thing.catch);
829
-
830
- // original code
831
- // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
832
-
833
- /**
834
- * Provides a cross-platform setImmediate implementation.
835
- * Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout.
836
- *
837
- * @param {boolean} setImmediateSupported - Whether setImmediate is supported.
838
- * @param {boolean} postMessageSupported - Whether postMessage is supported.
839
- * @returns {Function} A function to schedule a callback asynchronously.
840
- */
841
- const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
842
- if (setImmediateSupported) {
843
- return setImmediate;
844
- }
845
-
846
- return postMessageSupported
847
- ? ((token, callbacks) => {
848
- _global.addEventListener(
849
- 'message',
850
- ({ source, data }) => {
851
- if (source === _global && data === token) {
852
- callbacks.length && callbacks.shift()();
853
- }
854
- },
855
- false
856
- );
857
-
858
- return (cb) => {
859
- callbacks.push(cb);
860
- _global.postMessage(token, '*');
861
- };
862
- })(`axios@${Math.random()}`, [])
863
- : (cb) => setTimeout(cb);
864
- })(typeof setImmediate === 'function', isFunction$1(_global.postMessage));
865
-
866
- /**
867
- * Schedules a microtask or asynchronous callback as soon as possible.
868
- * Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate.
869
- *
870
- * @type {Function}
871
- */
872
- const asap =
873
- typeof queueMicrotask !== 'undefined'
874
- ? queueMicrotask.bind(_global)
875
- : (typeof process !== 'undefined' && process.nextTick) || _setImmediate;
876
-
877
- // *********************
878
-
879
- const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
880
-
881
- var utils$1 = {
882
- isArray,
883
- isArrayBuffer,
884
- isBuffer,
885
- isFormData,
886
- isArrayBufferView,
887
- isString,
888
- isNumber,
889
- isBoolean,
890
- isObject,
891
- isPlainObject,
892
- isEmptyObject,
893
- isReadableStream,
894
- isRequest,
895
- isResponse,
896
- isHeaders,
897
- isUndefined,
898
- isDate,
899
- isFile,
900
- isReactNativeBlob,
901
- isReactNative,
902
- isBlob,
903
- isRegExp,
904
- isFunction: isFunction$1,
905
- isStream,
906
- isURLSearchParams,
907
- isTypedArray,
908
- isFileList,
909
- forEach,
910
- merge,
911
- extend,
912
- trim,
913
- stripBOM,
914
- inherits,
915
- toFlatObject,
916
- kindOf,
917
- kindOfTest,
918
- endsWith,
919
- toArray,
920
- forEachEntry,
921
- matchAll,
922
- isHTMLForm,
923
- hasOwnProperty,
924
- hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection
925
- reduceDescriptors,
926
- freezeMethods,
927
- toObjectSet,
928
- toCamelCase,
929
- noop,
930
- toFiniteNumber,
931
- findKey,
932
- global: _global,
933
- isContextDefined,
934
- isSpecCompliantForm,
935
- toJSONObject,
936
- isAsyncFn,
937
- isThenable,
938
- setImmediate: _setImmediate,
939
- asap,
940
- isIterable,
941
- };
942
-
943
- // RawAxiosHeaders whose duplicates are ignored by node
944
- // c.f. https://nodejs.org/api/http.html#http_message_headers
945
- const ignoreDuplicateOf = utils$1.toObjectSet([
946
- 'age',
947
- 'authorization',
948
- 'content-length',
949
- 'content-type',
950
- 'etag',
951
- 'expires',
952
- 'from',
953
- 'host',
954
- 'if-modified-since',
955
- 'if-unmodified-since',
956
- 'last-modified',
957
- 'location',
958
- 'max-forwards',
959
- 'proxy-authorization',
960
- 'referer',
961
- 'retry-after',
962
- 'user-agent',
963
- ]);
964
-
965
- /**
966
- * Parse headers into an object
967
- *
968
- * ```
969
- * Date: Wed, 27 Aug 2014 08:58:49 GMT
970
- * Content-Type: application/json
971
- * Connection: keep-alive
972
- * Transfer-Encoding: chunked
973
- * ```
974
- *
975
- * @param {String} rawHeaders Headers needing to be parsed
976
- *
977
- * @returns {Object} Headers parsed into an object
978
- */
979
- var parseHeaders = (rawHeaders) => {
980
- const parsed = {};
981
- let key;
982
- let val;
983
- let i;
984
-
985
- rawHeaders &&
986
- rawHeaders.split('\n').forEach(function parser(line) {
987
- i = line.indexOf(':');
988
- key = line.substring(0, i).trim().toLowerCase();
989
- val = line.substring(i + 1).trim();
990
-
991
- if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
992
- return;
993
- }
994
-
995
- if (key === 'set-cookie') {
996
- if (parsed[key]) {
997
- parsed[key].push(val);
998
- } else {
999
- parsed[key] = [val];
1000
- }
1001
- } else {
1002
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
1003
- }
1004
- });
1005
-
1006
- return parsed;
1007
- };
1008
-
1009
- const $internals = Symbol('internals');
1010
-
1011
- const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
1012
-
1013
- function trimSPorHTAB(str) {
1014
- let start = 0;
1015
- let end = str.length;
1016
-
1017
- while (start < end) {
1018
- const code = str.charCodeAt(start);
1019
-
1020
- if (code !== 0x09 && code !== 0x20) {
1021
- break;
1022
- }
1023
-
1024
- start += 1;
1025
- }
1026
-
1027
- while (end > start) {
1028
- const code = str.charCodeAt(end - 1);
1029
-
1030
- if (code !== 0x09 && code !== 0x20) {
1031
- break;
1032
- }
1033
-
1034
- end -= 1;
1035
- }
1036
-
1037
- return start === 0 && end === str.length ? str : str.slice(start, end);
1038
- }
1039
-
1040
- function normalizeHeader(header) {
1041
- return header && String(header).trim().toLowerCase();
1042
- }
1043
-
1044
- function sanitizeHeaderValue(str) {
1045
- return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
1046
- }
1047
-
1048
- function normalizeValue(value) {
1049
- if (value === false || value == null) {
1050
- return value;
1051
- }
1052
-
1053
- return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
1054
- }
1055
-
1056
- function parseTokens(str) {
1057
- const tokens = Object.create(null);
1058
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1059
- let match;
1060
-
1061
- while ((match = tokensRE.exec(str))) {
1062
- tokens[match[1]] = match[2];
1063
- }
1064
-
1065
- return tokens;
1066
- }
1067
-
1068
- const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1069
-
1070
- function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
1071
- if (utils$1.isFunction(filter)) {
1072
- return filter.call(this, value, header);
1073
- }
1074
-
1075
- if (isHeaderNameFilter) {
1076
- value = header;
1077
- }
1078
-
1079
- if (!utils$1.isString(value)) return;
1080
-
1081
- if (utils$1.isString(filter)) {
1082
- return value.indexOf(filter) !== -1;
1083
- }
1084
-
1085
- if (utils$1.isRegExp(filter)) {
1086
- return filter.test(value);
1087
- }
1088
- }
1089
-
1090
- function formatHeader(header) {
1091
- return header
1092
- .trim()
1093
- .toLowerCase()
1094
- .replace(/([a-z\d])(\w*)/g, (w, char, str) => {
1095
- return char.toUpperCase() + str;
1096
- });
1097
- }
1098
-
1099
- function buildAccessors(obj, header) {
1100
- const accessorName = utils$1.toCamelCase(' ' + header);
1101
-
1102
- ['get', 'set', 'has'].forEach((methodName) => {
1103
- Object.defineProperty(obj, methodName + accessorName, {
1104
- // Null-proto descriptor so a polluted Object.prototype.get cannot turn
1105
- // this data descriptor into an accessor descriptor on the way in.
1106
- __proto__: null,
1107
- value: function (arg1, arg2, arg3) {
1108
- return this[methodName].call(this, header, arg1, arg2, arg3);
1109
- },
1110
- configurable: true,
1111
- });
1112
- });
1113
- }
1114
-
1115
- let AxiosHeaders$1 = class AxiosHeaders {
1116
- constructor(headers) {
1117
- headers && this.set(headers);
1118
- }
1119
-
1120
- set(header, valueOrRewrite, rewrite) {
1121
- const self = this;
1122
-
1123
- function setHeader(_value, _header, _rewrite) {
1124
- const lHeader = normalizeHeader(_header);
1125
-
1126
- if (!lHeader) {
1127
- throw new Error('header name must be a non-empty string');
1128
- }
1129
-
1130
- const key = utils$1.findKey(self, lHeader);
1131
-
1132
- if (
1133
- !key ||
1134
- self[key] === undefined ||
1135
- _rewrite === true ||
1136
- (_rewrite === undefined && self[key] !== false)
1137
- ) {
1138
- self[key || _header] = normalizeValue(_value);
1139
- }
1140
- }
1141
-
1142
- const setHeaders = (headers, _rewrite) =>
1143
- utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1144
-
1145
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
1146
- setHeaders(header, valueOrRewrite);
1147
- } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1148
- setHeaders(parseHeaders(header), valueOrRewrite);
1149
- } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
1150
- let obj = {},
1151
- dest,
1152
- key;
1153
- for (const entry of header) {
1154
- if (!utils$1.isArray(entry)) {
1155
- throw TypeError('Object iterator must return a key-value pair');
1156
- }
1157
-
1158
- obj[(key = entry[0])] = (dest = obj[key])
1159
- ? utils$1.isArray(dest)
1160
- ? [...dest, entry[1]]
1161
- : [dest, entry[1]]
1162
- : entry[1];
1163
- }
1164
-
1165
- setHeaders(obj, valueOrRewrite);
1166
- } else {
1167
- header != null && setHeader(valueOrRewrite, header, rewrite);
1168
- }
1169
-
1170
- return this;
1171
- }
1172
-
1173
- get(header, parser) {
1174
- header = normalizeHeader(header);
1175
-
1176
- if (header) {
1177
- const key = utils$1.findKey(this, header);
1178
-
1179
- if (key) {
1180
- const value = this[key];
1181
-
1182
- if (!parser) {
1183
- return value;
1184
- }
1185
-
1186
- if (parser === true) {
1187
- return parseTokens(value);
1188
- }
1189
-
1190
- if (utils$1.isFunction(parser)) {
1191
- return parser.call(this, value, key);
1192
- }
1193
-
1194
- if (utils$1.isRegExp(parser)) {
1195
- return parser.exec(value);
1196
- }
1197
-
1198
- throw new TypeError('parser must be boolean|regexp|function');
1199
- }
1200
- }
1201
- }
1202
-
1203
- has(header, matcher) {
1204
- header = normalizeHeader(header);
1205
-
1206
- if (header) {
1207
- const key = utils$1.findKey(this, header);
1208
-
1209
- return !!(
1210
- key &&
1211
- this[key] !== undefined &&
1212
- (!matcher || matchHeaderValue(this, this[key], key, matcher))
1213
- );
1214
- }
1215
-
1216
- return false;
1217
- }
1218
-
1219
- delete(header, matcher) {
1220
- const self = this;
1221
- let deleted = false;
1222
-
1223
- function deleteHeader(_header) {
1224
- _header = normalizeHeader(_header);
1225
-
1226
- if (_header) {
1227
- const key = utils$1.findKey(self, _header);
1228
-
1229
- if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
1230
- delete self[key];
1231
-
1232
- deleted = true;
1233
- }
1234
- }
1235
- }
1236
-
1237
- if (utils$1.isArray(header)) {
1238
- header.forEach(deleteHeader);
1239
- } else {
1240
- deleteHeader(header);
1241
- }
1242
-
1243
- return deleted;
1244
- }
1245
-
1246
- clear(matcher) {
1247
- const keys = Object.keys(this);
1248
- let i = keys.length;
1249
- let deleted = false;
1250
-
1251
- while (i--) {
1252
- const key = keys[i];
1253
- if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
1254
- delete this[key];
1255
- deleted = true;
1256
- }
1257
- }
1258
-
1259
- return deleted;
1260
- }
1261
-
1262
- normalize(format) {
1263
- const self = this;
1264
- const headers = {};
1265
-
1266
- utils$1.forEach(this, (value, header) => {
1267
- const key = utils$1.findKey(headers, header);
1268
-
1269
- if (key) {
1270
- self[key] = normalizeValue(value);
1271
- delete self[header];
1272
- return;
1273
- }
1274
-
1275
- const normalized = format ? formatHeader(header) : String(header).trim();
1276
-
1277
- if (normalized !== header) {
1278
- delete self[header];
1279
- }
1280
-
1281
- self[normalized] = normalizeValue(value);
1282
-
1283
- headers[normalized] = true;
1284
- });
1285
-
1286
- return this;
1287
- }
1288
-
1289
- concat(...targets) {
1290
- return this.constructor.concat(this, ...targets);
1291
- }
1292
-
1293
- toJSON(asStrings) {
1294
- const obj = Object.create(null);
1295
-
1296
- utils$1.forEach(this, (value, header) => {
1297
- value != null &&
1298
- value !== false &&
1299
- (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
1300
- });
1301
-
1302
- return obj;
1303
- }
1304
-
1305
- [Symbol.iterator]() {
1306
- return Object.entries(this.toJSON())[Symbol.iterator]();
1307
- }
1308
-
1309
- toString() {
1310
- return Object.entries(this.toJSON())
1311
- .map(([header, value]) => header + ': ' + value)
1312
- .join('\n');
1313
- }
1314
-
1315
- getSetCookie() {
1316
- return this.get('set-cookie') || [];
1317
- }
1318
-
1319
- get [Symbol.toStringTag]() {
1320
- return 'AxiosHeaders';
1321
- }
1322
-
1323
- static from(thing) {
1324
- return thing instanceof this ? thing : new this(thing);
1325
- }
1326
-
1327
- static concat(first, ...targets) {
1328
- const computed = new this(first);
1329
-
1330
- targets.forEach((target) => computed.set(target));
1331
-
1332
- return computed;
1333
- }
1334
-
1335
- static accessor(header) {
1336
- const internals =
1337
- (this[$internals] =
1338
- this[$internals] =
1339
- {
1340
- accessors: {},
1341
- });
1342
-
1343
- const accessors = internals.accessors;
1344
- const prototype = this.prototype;
1345
-
1346
- function defineAccessor(_header) {
1347
- const lHeader = normalizeHeader(_header);
1348
-
1349
- if (!accessors[lHeader]) {
1350
- buildAccessors(prototype, _header);
1351
- accessors[lHeader] = true;
1352
- }
1353
- }
1354
-
1355
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
1356
-
1357
- return this;
1358
- }
1359
- };
1360
-
1361
- AxiosHeaders$1.accessor([
1362
- 'Content-Type',
1363
- 'Content-Length',
1364
- 'Accept',
1365
- 'Accept-Encoding',
1366
- 'User-Agent',
1367
- 'Authorization',
1368
- ]);
1369
-
1370
- // reserved names hotfix
1371
- utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
1372
- let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
1373
- return {
1374
- get: () => value,
1375
- set(headerValue) {
1376
- this[mapped] = headerValue;
1377
- },
1378
- };
1379
- });
1380
-
1381
- utils$1.freezeMethods(AxiosHeaders$1);
1382
-
1383
- const REDACTED = '[REDACTED ****]';
1384
-
1385
- function hasOwnOrPrototypeToJSON(source) {
1386
- if (utils$1.hasOwnProp(source, 'toJSON')) {
1387
- return true;
1388
- }
1389
-
1390
- let prototype = Object.getPrototypeOf(source);
1391
-
1392
- while (prototype && prototype !== Object.prototype) {
1393
- if (utils$1.hasOwnProp(prototype, 'toJSON')) {
1394
- return true;
1395
- }
1396
-
1397
- prototype = Object.getPrototypeOf(prototype);
1398
- }
1399
-
1400
- return false;
1401
- }
1402
-
1403
- // Build a plain-object snapshot of `config` and replace the value of any key
1404
- // (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays
1405
- // and AxiosHeaders, and short-circuits on circular references.
1406
- function redactConfig(config, redactKeys) {
1407
- const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
1408
- const seen = [];
1409
-
1410
- const visit = (source) => {
1411
- if (source === null || typeof source !== 'object') return source;
1412
- if (utils$1.isBuffer(source)) return source;
1413
- if (seen.indexOf(source) !== -1) return undefined;
1414
-
1415
- if (source instanceof AxiosHeaders$1) {
1416
- source = source.toJSON();
1417
- }
1418
-
1419
- seen.push(source);
1420
-
1421
- let result;
1422
- if (utils$1.isArray(source)) {
1423
- result = [];
1424
- source.forEach((v, i) => {
1425
- const reducedValue = visit(v);
1426
- if (!utils$1.isUndefined(reducedValue)) {
1427
- result[i] = reducedValue;
1428
- }
1429
- });
1430
- } else {
1431
- if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
1432
- seen.pop();
1433
- return source;
1434
- }
1435
-
1436
- result = Object.create(null);
1437
- for (const [key, value] of Object.entries(source)) {
1438
- const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
1439
- if (!utils$1.isUndefined(reducedValue)) {
1440
- result[key] = reducedValue;
1441
- }
1442
- }
1443
- }
1444
-
1445
- seen.pop();
1446
- return result;
1447
- };
1448
-
1449
- return visit(config);
1450
- }
1451
-
1452
- let AxiosError$1 = class AxiosError extends Error {
1453
- static from(error, code, config, request, response, customProps) {
1454
- const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
1455
- axiosError.cause = error;
1456
- axiosError.name = error.name;
1457
-
1458
- // Preserve status from the original error if not already set from response
1459
- if (error.status != null && axiosError.status == null) {
1460
- axiosError.status = error.status;
1461
- }
1462
-
1463
- customProps && Object.assign(axiosError, customProps);
1464
- return axiosError;
1465
- }
1466
-
1467
- /**
1468
- * Create an Error with the specified message, config, error code, request and response.
1469
- *
1470
- * @param {string} message The error message.
1471
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
1472
- * @param {Object} [config] The config.
1473
- * @param {Object} [request] The request.
1474
- * @param {Object} [response] The response.
1475
- *
1476
- * @returns {Error} The created error.
1477
- */
1478
- constructor(message, code, config, request, response) {
1479
- super(message);
1480
-
1481
- // Make message enumerable to maintain backward compatibility
1482
- // The native Error constructor sets message as non-enumerable,
1483
- // but axios < v1.13.3 had it as enumerable
1484
- Object.defineProperty(this, 'message', {
1485
- // Null-proto descriptor so a polluted Object.prototype.get cannot turn
1486
- // this data descriptor into an accessor descriptor on the way in.
1487
- __proto__: null,
1488
- value: message,
1489
- enumerable: true,
1490
- writable: true,
1491
- configurable: true,
1492
- });
1493
-
1494
- this.name = 'AxiosError';
1495
- this.isAxiosError = true;
1496
- code && (this.code = code);
1497
- config && (this.config = config);
1498
- request && (this.request = request);
1499
- if (response) {
1500
- this.response = response;
1501
- this.status = response.status;
1502
- }
1503
- }
1504
-
1505
- toJSON() {
1506
- // Opt-in redaction: when the request config carries a `redact` array, the
1507
- // value of any matching key (case-insensitive, at any depth) is replaced
1508
- // with REDACTED in the serialized snapshot. Undefined or empty leaves the
1509
- // existing serialization behavior unchanged.
1510
- const config = this.config;
1511
- const redactKeys = config && utils$1.hasOwnProp(config, 'redact') ? config.redact : undefined;
1512
- const serializedConfig =
1513
- utils$1.isArray(redactKeys) && redactKeys.length > 0
1514
- ? redactConfig(config, redactKeys)
1515
- : utils$1.toJSONObject(config);
1516
-
1517
- return {
1518
- // Standard
1519
- message: this.message,
1520
- name: this.name,
1521
- // Microsoft
1522
- description: this.description,
1523
- number: this.number,
1524
- // Mozilla
1525
- fileName: this.fileName,
1526
- lineNumber: this.lineNumber,
1527
- columnNumber: this.columnNumber,
1528
- stack: this.stack,
1529
- // Axios
1530
- config: serializedConfig,
1531
- code: this.code,
1532
- status: this.status,
1533
- };
1534
- }
1535
- };
1536
-
1537
- // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
1538
- AxiosError$1.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
1539
- AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
1540
- AxiosError$1.ECONNABORTED = 'ECONNABORTED';
1541
- AxiosError$1.ETIMEDOUT = 'ETIMEDOUT';
1542
- AxiosError$1.ECONNREFUSED = 'ECONNREFUSED';
1543
- AxiosError$1.ERR_NETWORK = 'ERR_NETWORK';
1544
- AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
1545
- AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED';
1546
- AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
1547
- AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
1548
- AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
1549
- AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
1550
- AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
1551
- AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
1552
-
1553
- // eslint-disable-next-line strict
1554
- var httpAdapter = null;
1555
-
1556
- /**
1557
- * Determines if the given thing is a array or js object.
1558
- *
1559
- * @param {string} thing - The object or array to be visited.
1560
- *
1561
- * @returns {boolean}
1562
- */
1563
- function isVisitable(thing) {
1564
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
1565
- }
1566
-
1567
- /**
1568
- * It removes the brackets from the end of a string
1569
- *
1570
- * @param {string} key - The key of the parameter.
1571
- *
1572
- * @returns {string} the key without the brackets.
1573
- */
1574
- function removeBrackets(key) {
1575
- return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
1576
- }
1577
-
1578
- /**
1579
- * It takes a path, a key, and a boolean, and returns a string
1580
- *
1581
- * @param {string} path - The path to the current key.
1582
- * @param {string} key - The key of the current object being iterated over.
1583
- * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
1584
- *
1585
- * @returns {string} The path to the current key.
1586
- */
1587
- function renderKey(path, key, dots) {
1588
- if (!path) return key;
1589
- return path
1590
- .concat(key)
1591
- .map(function each(token, i) {
1592
- // eslint-disable-next-line no-param-reassign
1593
- token = removeBrackets(token);
1594
- return !dots && i ? '[' + token + ']' : token;
1595
- })
1596
- .join(dots ? '.' : '');
1597
- }
1598
-
1599
- /**
1600
- * If the array is an array and none of its elements are visitable, then it's a flat array.
1601
- *
1602
- * @param {Array<any>} arr - The array to check
1603
- *
1604
- * @returns {boolean}
1605
- */
1606
- function isFlatArray(arr) {
1607
- return utils$1.isArray(arr) && !arr.some(isVisitable);
1608
- }
1609
-
1610
- const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
1611
- return /^is[A-Z]/.test(prop);
1612
- });
1613
-
1614
- /**
1615
- * Convert a data object to FormData
1616
- *
1617
- * @param {Object} obj
1618
- * @param {?Object} [formData]
1619
- * @param {?Object} [options]
1620
- * @param {Function} [options.visitor]
1621
- * @param {Boolean} [options.metaTokens = true]
1622
- * @param {Boolean} [options.dots = false]
1623
- * @param {?Boolean} [options.indexes = false]
1624
- *
1625
- * @returns {Object}
1626
- **/
1627
-
1628
- /**
1629
- * It converts an object into a FormData object
1630
- *
1631
- * @param {Object<any, any>} obj - The object to convert to form data.
1632
- * @param {string} formData - The FormData object to append to.
1633
- * @param {Object<string, any>} options
1634
- *
1635
- * @returns
1636
- */
1637
- function toFormData$1(obj, formData, options) {
1638
- if (!utils$1.isObject(obj)) {
1639
- throw new TypeError('target must be an object');
1640
- }
1641
-
1642
- // eslint-disable-next-line no-param-reassign
1643
- formData = formData || new (FormData)();
1644
-
1645
- // eslint-disable-next-line no-param-reassign
1646
- options = utils$1.toFlatObject(
1647
- options,
1648
- {
1649
- metaTokens: true,
1650
- dots: false,
1651
- indexes: false,
1652
- },
1653
- false,
1654
- function defined(option, source) {
1655
- // eslint-disable-next-line no-eq-null,eqeqeq
1656
- return !utils$1.isUndefined(source[option]);
1657
- }
1658
- );
1659
-
1660
- const metaTokens = options.metaTokens;
1661
- // eslint-disable-next-line no-use-before-define
1662
- const visitor = options.visitor || defaultVisitor;
1663
- const dots = options.dots;
1664
- const indexes = options.indexes;
1665
- const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
1666
- const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
1667
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
1668
-
1669
- if (!utils$1.isFunction(visitor)) {
1670
- throw new TypeError('visitor must be a function');
1671
- }
1672
-
1673
- function convertValue(value) {
1674
- if (value === null) return '';
1675
-
1676
- if (utils$1.isDate(value)) {
1677
- return value.toISOString();
1678
- }
1679
-
1680
- if (utils$1.isBoolean(value)) {
1681
- return value.toString();
1682
- }
1683
-
1684
- if (!useBlob && utils$1.isBlob(value)) {
1685
- throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
1686
- }
1687
-
1688
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
1689
- return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
1690
- }
1691
-
1692
- return value;
1693
- }
1694
-
1695
- /**
1696
- * Default visitor.
1697
- *
1698
- * @param {*} value
1699
- * @param {String|Number} key
1700
- * @param {Array<String|Number>} path
1701
- * @this {FormData}
1702
- *
1703
- * @returns {boolean} return true to visit the each prop of the value recursively
1704
- */
1705
- function defaultVisitor(value, key, path) {
1706
- let arr = value;
1707
-
1708
- if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
1709
- formData.append(renderKey(path, key, dots), convertValue(value));
1710
- return false;
1711
- }
1712
-
1713
- if (value && !path && typeof value === 'object') {
1714
- if (utils$1.endsWith(key, '{}')) {
1715
- // eslint-disable-next-line no-param-reassign
1716
- key = metaTokens ? key : key.slice(0, -2);
1717
- // eslint-disable-next-line no-param-reassign
1718
- value = JSON.stringify(value);
1719
- } else if (
1720
- (utils$1.isArray(value) && isFlatArray(value)) ||
1721
- ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
1722
- ) {
1723
- // eslint-disable-next-line no-param-reassign
1724
- key = removeBrackets(key);
1725
-
1726
- arr.forEach(function each(el, index) {
1727
- !(utils$1.isUndefined(el) || el === null) &&
1728
- formData.append(
1729
- // eslint-disable-next-line no-nested-ternary
1730
- indexes === true
1731
- ? renderKey([key], index, dots)
1732
- : indexes === null
1733
- ? key
1734
- : key + '[]',
1735
- convertValue(el)
1736
- );
1737
- });
1738
- return false;
1739
- }
1740
- }
1741
-
1742
- if (isVisitable(value)) {
1743
- return true;
1744
- }
1745
-
1746
- formData.append(renderKey(path, key, dots), convertValue(value));
1747
-
1748
- return false;
1749
- }
1750
-
1751
- const stack = [];
1752
-
1753
- const exposedHelpers = Object.assign(predicates, {
1754
- defaultVisitor,
1755
- convertValue,
1756
- isVisitable,
1757
- });
1758
-
1759
- function build(value, path, depth = 0) {
1760
- if (utils$1.isUndefined(value)) return;
1761
-
1762
- if (depth > maxDepth) {
1763
- throw new AxiosError$1(
1764
- 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
1765
- AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED
1766
- );
1767
- }
1768
-
1769
- if (stack.indexOf(value) !== -1) {
1770
- throw Error('Circular reference detected in ' + path.join('.'));
1771
- }
1772
-
1773
- stack.push(value);
1774
-
1775
- utils$1.forEach(value, function each(el, key) {
1776
- const result =
1777
- !(utils$1.isUndefined(el) || el === null) &&
1778
- visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
1779
-
1780
- if (result === true) {
1781
- build(el, path ? path.concat(key) : [key], depth + 1);
1782
- }
1783
- });
1784
-
1785
- stack.pop();
1786
- }
1787
-
1788
- if (!utils$1.isObject(obj)) {
1789
- throw new TypeError('data must be an object');
1790
- }
1791
-
1792
- build(obj);
1793
-
1794
- return formData;
1795
- }
1796
-
1797
- /**
1798
- * It encodes a string by replacing all characters that are not in the unreserved set with
1799
- * their percent-encoded equivalents
1800
- *
1801
- * @param {string} str - The string to encode.
1802
- *
1803
- * @returns {string} The encoded string.
1804
- */
1805
- function encode$1(str) {
1806
- const charMap = {
1807
- '!': '%21',
1808
- "'": '%27',
1809
- '(': '%28',
1810
- ')': '%29',
1811
- '~': '%7E',
1812
- '%20': '+',
1813
- };
1814
- return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
1815
- return charMap[match];
1816
- });
1817
- }
1818
-
1819
- /**
1820
- * It takes a params object and converts it to a FormData object
1821
- *
1822
- * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
1823
- * @param {Object<string, any>} options - The options object passed to the Axios constructor.
1824
- *
1825
- * @returns {void}
1826
- */
1827
- function AxiosURLSearchParams(params, options) {
1828
- this._pairs = [];
1829
-
1830
- params && toFormData$1(params, this, options);
1831
- }
1832
-
1833
- const prototype = AxiosURLSearchParams.prototype;
1834
-
1835
- prototype.append = function append(name, value) {
1836
- this._pairs.push([name, value]);
1837
- };
1838
-
1839
- prototype.toString = function toString(encoder) {
1840
- const _encode = encoder
1841
- ? function (value) {
1842
- return encoder.call(this, value, encode$1);
1843
- }
1844
- : encode$1;
1845
-
1846
- return this._pairs
1847
- .map(function each(pair) {
1848
- return _encode(pair[0]) + '=' + _encode(pair[1]);
1849
- }, '')
1850
- .join('&');
1851
- };
1852
-
1853
- /**
1854
- * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
1855
- * their plain counterparts (`:`, `$`, `,`, `+`).
1856
- *
1857
- * @param {string} val The value to be encoded.
1858
- *
1859
- * @returns {string} The encoded value.
1860
- */
1861
- function encode(val) {
1862
- return encodeURIComponent(val)
1863
- .replace(/%3A/gi, ':')
1864
- .replace(/%24/g, '$')
1865
- .replace(/%2C/gi, ',')
1866
- .replace(/%20/g, '+');
1867
- }
1868
-
1869
- /**
1870
- * Build a URL by appending params to the end
1871
- *
1872
- * @param {string} url The base of the url (e.g., http://www.google.com)
1873
- * @param {object} [params] The params to be appended
1874
- * @param {?(object|Function)} options
1875
- *
1876
- * @returns {string} The formatted url
1877
- */
1878
- function buildURL(url, params, options) {
1879
- if (!params) {
1880
- return url;
1881
- }
1882
-
1883
- const _encode = (options && options.encode) || encode;
1884
-
1885
- const _options = utils$1.isFunction(options)
1886
- ? {
1887
- serialize: options,
1888
- }
1889
- : options;
1890
-
1891
- const serializeFn = _options && _options.serialize;
1892
-
1893
- let serializedParams;
1894
-
1895
- if (serializeFn) {
1896
- serializedParams = serializeFn(params, _options);
1897
- } else {
1898
- serializedParams = utils$1.isURLSearchParams(params)
1899
- ? params.toString()
1900
- : new AxiosURLSearchParams(params, _options).toString(_encode);
1901
- }
1902
-
1903
- if (serializedParams) {
1904
- const hashmarkIndex = url.indexOf('#');
1905
-
1906
- if (hashmarkIndex !== -1) {
1907
- url = url.slice(0, hashmarkIndex);
1908
- }
1909
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
1910
- }
1911
-
1912
- return url;
1913
- }
1914
-
1915
- class InterceptorManager {
1916
- constructor() {
1917
- this.handlers = [];
1918
- }
1919
-
1920
- /**
1921
- * Add a new interceptor to the stack
1922
- *
1923
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
1924
- * @param {Function} rejected The function to handle `reject` for a `Promise`
1925
- * @param {Object} options The options for the interceptor, synchronous and runWhen
1926
- *
1927
- * @return {Number} An ID used to remove interceptor later
1928
- */
1929
- use(fulfilled, rejected, options) {
1930
- this.handlers.push({
1931
- fulfilled,
1932
- rejected,
1933
- synchronous: options ? options.synchronous : false,
1934
- runWhen: options ? options.runWhen : null,
1935
- });
1936
- return this.handlers.length - 1;
1937
- }
1938
-
1939
- /**
1940
- * Remove an interceptor from the stack
1941
- *
1942
- * @param {Number} id The ID that was returned by `use`
1943
- *
1944
- * @returns {void}
1945
- */
1946
- eject(id) {
1947
- if (this.handlers[id]) {
1948
- this.handlers[id] = null;
1949
- }
1950
- }
1951
-
1952
- /**
1953
- * Clear all interceptors from the stack
1954
- *
1955
- * @returns {void}
1956
- */
1957
- clear() {
1958
- if (this.handlers) {
1959
- this.handlers = [];
1960
- }
1961
- }
1962
-
1963
- /**
1964
- * Iterate over all the registered interceptors
1965
- *
1966
- * This method is particularly useful for skipping over any
1967
- * interceptors that may have become `null` calling `eject`.
1968
- *
1969
- * @param {Function} fn The function to call for each interceptor
1970
- *
1971
- * @returns {void}
1972
- */
1973
- forEach(fn) {
1974
- utils$1.forEach(this.handlers, function forEachHandler(h) {
1975
- if (h !== null) {
1976
- fn(h);
1977
- }
1978
- });
1979
- }
1980
- }
1981
-
1982
- var transitionalDefaults = {
1983
- silentJSONParsing: true,
1984
- forcedJSONParsing: true,
1985
- clarifyTimeoutError: false,
1986
- legacyInterceptorReqResOrdering: true,
1987
- };
1988
-
1989
- var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
1990
-
1991
- var FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
1992
-
1993
- var Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
1994
-
1995
- var platform$1 = {
1996
- isBrowser: true,
1997
- classes: {
1998
- URLSearchParams: URLSearchParams$1,
1999
- FormData: FormData$1,
2000
- Blob: Blob$1,
2001
- },
2002
- protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
2003
- };
2004
-
2005
- const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
2006
-
2007
- const _navigator = (typeof navigator === 'object' && navigator) || undefined;
2008
-
2009
- /**
2010
- * Determine if we're running in a standard browser environment
2011
- *
2012
- * This allows axios to run in a web worker, and react-native.
2013
- * Both environments support XMLHttpRequest, but not fully standard globals.
2014
- *
2015
- * web workers:
2016
- * typeof window -> undefined
2017
- * typeof document -> undefined
2018
- *
2019
- * react-native:
2020
- * navigator.product -> 'ReactNative'
2021
- * nativescript
2022
- * navigator.product -> 'NativeScript' or 'NS'
2023
- *
2024
- * @returns {boolean}
2025
- */
2026
- const hasStandardBrowserEnv =
2027
- hasBrowserEnv &&
2028
- (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
2029
-
2030
- /**
2031
- * Determine if we're running in a standard browser webWorker environment
2032
- *
2033
- * Although the `isStandardBrowserEnv` method indicates that
2034
- * `allows axios to run in a web worker`, the WebWorker will still be
2035
- * filtered out due to its judgment standard
2036
- * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
2037
- * This leads to a problem when axios post `FormData` in webWorker
2038
- */
2039
- const hasStandardBrowserWebWorkerEnv = (() => {
2040
- return (
2041
- typeof WorkerGlobalScope !== 'undefined' &&
2042
- // eslint-disable-next-line no-undef
2043
- self instanceof WorkerGlobalScope &&
2044
- typeof self.importScripts === 'function'
2045
- );
2046
- })();
2047
-
2048
- const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
2049
-
2050
- var utils = /*#__PURE__*/Object.freeze({
2051
- __proto__: null,
2052
- hasBrowserEnv: hasBrowserEnv,
2053
- hasStandardBrowserEnv: hasStandardBrowserEnv,
2054
- hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
2055
- navigator: _navigator,
2056
- origin: origin
2057
- });
2058
-
2059
- var platform = {
2060
- ...utils,
2061
- ...platform$1,
2062
- };
2063
-
2064
- function toURLEncodedForm(data, options) {
2065
- return toFormData$1(data, new platform.classes.URLSearchParams(), {
2066
- visitor: function (value, key, path, helpers) {
2067
- if (platform.isNode && utils$1.isBuffer(value)) {
2068
- this.append(key, value.toString('base64'));
2069
- return false;
2070
- }
2071
-
2072
- return helpers.defaultVisitor.apply(this, arguments);
2073
- },
2074
- ...options,
2075
- });
2076
- }
2077
-
2078
- /**
2079
- * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
2080
- *
2081
- * @param {string} name - The name of the property to get.
2082
- *
2083
- * @returns An array of strings.
2084
- */
2085
- function parsePropPath(name) {
2086
- // foo[x][y][z]
2087
- // foo.x.y.z
2088
- // foo-x-y-z
2089
- // foo x y z
2090
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
2091
- return match[0] === '[]' ? '' : match[1] || match[0];
2092
- });
2093
- }
2094
-
2095
- /**
2096
- * Convert an array to an object.
2097
- *
2098
- * @param {Array<any>} arr - The array to convert to an object.
2099
- *
2100
- * @returns An object with the same keys and values as the array.
2101
- */
2102
- function arrayToObject(arr) {
2103
- const obj = {};
2104
- const keys = Object.keys(arr);
2105
- let i;
2106
- const len = keys.length;
2107
- let key;
2108
- for (i = 0; i < len; i++) {
2109
- key = keys[i];
2110
- obj[key] = arr[key];
2111
- }
2112
- return obj;
2113
- }
2114
-
2115
- /**
2116
- * It takes a FormData object and returns a JavaScript object
2117
- *
2118
- * @param {string} formData The FormData object to convert to JSON.
2119
- *
2120
- * @returns {Object<string, any> | null} The converted object.
2121
- */
2122
- function formDataToJSON(formData) {
2123
- function buildPath(path, value, target, index) {
2124
- let name = path[index++];
2125
-
2126
- if (name === '__proto__') return true;
2127
-
2128
- const isNumericKey = Number.isFinite(+name);
2129
- const isLast = index >= path.length;
2130
- name = !name && utils$1.isArray(target) ? target.length : name;
2131
-
2132
- if (isLast) {
2133
- if (utils$1.hasOwnProp(target, name)) {
2134
- target[name] = utils$1.isArray(target[name])
2135
- ? target[name].concat(value)
2136
- : [target[name], value];
2137
- } else {
2138
- target[name] = value;
2139
- }
2140
-
2141
- return !isNumericKey;
2142
- }
2143
-
2144
- if (!target[name] || !utils$1.isObject(target[name])) {
2145
- target[name] = [];
2146
- }
2147
-
2148
- const result = buildPath(path, value, target[name], index);
2149
-
2150
- if (result && utils$1.isArray(target[name])) {
2151
- target[name] = arrayToObject(target[name]);
2152
- }
2153
-
2154
- return !isNumericKey;
2155
- }
2156
-
2157
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
2158
- const obj = {};
2159
-
2160
- utils$1.forEachEntry(formData, (name, value) => {
2161
- buildPath(parsePropPath(name), value, obj, 0);
2162
- });
2163
-
2164
- return obj;
2165
- }
2166
-
2167
- return null;
2168
- }
2169
-
2170
- const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
2171
-
2172
- /**
2173
- * It takes a string, tries to parse it, and if it fails, it returns the stringified version
2174
- * of the input
2175
- *
2176
- * @param {any} rawValue - The value to be stringified.
2177
- * @param {Function} parser - A function that parses a string into a JavaScript object.
2178
- * @param {Function} encoder - A function that takes a value and returns a string.
2179
- *
2180
- * @returns {string} A stringified version of the rawValue.
2181
- */
2182
- function stringifySafely(rawValue, parser, encoder) {
2183
- if (utils$1.isString(rawValue)) {
2184
- try {
2185
- (parser || JSON.parse)(rawValue);
2186
- return utils$1.trim(rawValue);
2187
- } catch (e) {
2188
- if (e.name !== 'SyntaxError') {
2189
- throw e;
2190
- }
2191
- }
2192
- }
2193
-
2194
- return (encoder || JSON.stringify)(rawValue);
2195
- }
2196
-
2197
- const defaults = {
2198
- transitional: transitionalDefaults,
2199
-
2200
- adapter: ['xhr', 'http', 'fetch'],
2201
-
2202
- transformRequest: [
2203
- function transformRequest(data, headers) {
2204
- const contentType = headers.getContentType() || '';
2205
- const hasJSONContentType = contentType.indexOf('application/json') > -1;
2206
- const isObjectPayload = utils$1.isObject(data);
2207
-
2208
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
2209
- data = new FormData(data);
2210
- }
2211
-
2212
- const isFormData = utils$1.isFormData(data);
2213
-
2214
- if (isFormData) {
2215
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
2216
- }
2217
-
2218
- if (
2219
- utils$1.isArrayBuffer(data) ||
2220
- utils$1.isBuffer(data) ||
2221
- utils$1.isStream(data) ||
2222
- utils$1.isFile(data) ||
2223
- utils$1.isBlob(data) ||
2224
- utils$1.isReadableStream(data)
2225
- ) {
2226
- return data;
2227
- }
2228
- if (utils$1.isArrayBufferView(data)) {
2229
- return data.buffer;
2230
- }
2231
- if (utils$1.isURLSearchParams(data)) {
2232
- headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
2233
- return data.toString();
2234
- }
2235
-
2236
- let isFileList;
2237
-
2238
- if (isObjectPayload) {
2239
- const formSerializer = own(this, 'formSerializer');
2240
- if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
2241
- return toURLEncodedForm(data, formSerializer).toString();
2242
- }
2243
-
2244
- if (
2245
- (isFileList = utils$1.isFileList(data)) ||
2246
- contentType.indexOf('multipart/form-data') > -1
2247
- ) {
2248
- const env = own(this, 'env');
2249
- const _FormData = env && env.FormData;
2250
-
2251
- return toFormData$1(
2252
- isFileList ? { 'files[]': data } : data,
2253
- _FormData && new _FormData(),
2254
- formSerializer
2255
- );
2256
- }
2257
- }
2258
-
2259
- if (isObjectPayload || hasJSONContentType) {
2260
- headers.setContentType('application/json', false);
2261
- return stringifySafely(data);
2262
- }
2263
-
2264
- return data;
2265
- },
2266
- ],
2267
-
2268
- transformResponse: [
2269
- function transformResponse(data) {
2270
- const transitional = own(this, 'transitional') || defaults.transitional;
2271
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
2272
- const responseType = own(this, 'responseType');
2273
- const JSONRequested = responseType === 'json';
2274
-
2275
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
2276
- return data;
2277
- }
2278
-
2279
- if (
2280
- data &&
2281
- utils$1.isString(data) &&
2282
- ((forcedJSONParsing && !responseType) || JSONRequested)
2283
- ) {
2284
- const silentJSONParsing = transitional && transitional.silentJSONParsing;
2285
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
2286
-
2287
- try {
2288
- return JSON.parse(data, own(this, 'parseReviver'));
2289
- } catch (e) {
2290
- if (strictJSONParsing) {
2291
- if (e.name === 'SyntaxError') {
2292
- throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
2293
- }
2294
- throw e;
2295
- }
2296
- }
2297
- }
2298
-
2299
- return data;
2300
- },
2301
- ],
2302
-
2303
- /**
2304
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
2305
- * timeout is not created.
2306
- */
2307
- timeout: 0,
2308
-
2309
- xsrfCookieName: 'XSRF-TOKEN',
2310
- xsrfHeaderName: 'X-XSRF-TOKEN',
2311
-
2312
- maxContentLength: -1,
2313
- maxBodyLength: -1,
2314
-
2315
- env: {
2316
- FormData: platform.classes.FormData,
2317
- Blob: platform.classes.Blob,
2318
- },
2319
-
2320
- validateStatus: function validateStatus(status) {
2321
- return status >= 200 && status < 300;
2322
- },
2323
-
2324
- headers: {
2325
- common: {
2326
- Accept: 'application/json, text/plain, */*',
2327
- 'Content-Type': undefined,
2328
- },
2329
- },
2330
- };
2331
-
2332
- utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], (method) => {
2333
- defaults.headers[method] = {};
2334
- });
2335
-
2336
- /**
2337
- * Transform the data for a request or a response
2338
- *
2339
- * @param {Array|Function} fns A single function or Array of functions
2340
- * @param {?Object} response The response object
2341
- *
2342
- * @returns {*} The resulting transformed data
2343
- */
2344
- function transformData(fns, response) {
2345
- const config = this || defaults;
2346
- const context = response || config;
2347
- const headers = AxiosHeaders$1.from(context.headers);
2348
- let data = context.data;
2349
-
2350
- utils$1.forEach(fns, function transform(fn) {
2351
- data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
2352
- });
2353
-
2354
- headers.normalize();
2355
-
2356
- return data;
2357
- }
2358
-
2359
- function isCancel$1(value) {
2360
- return !!(value && value.__CANCEL__);
2361
- }
2362
-
2363
- let CanceledError$1 = class CanceledError extends AxiosError$1 {
2364
- /**
2365
- * A `CanceledError` is an object that is thrown when an operation is canceled.
2366
- *
2367
- * @param {string=} message The message.
2368
- * @param {Object=} config The config.
2369
- * @param {Object=} request The request.
2370
- *
2371
- * @returns {CanceledError} The created error.
2372
- */
2373
- constructor(message, config, request) {
2374
- super(message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
2375
- this.name = 'CanceledError';
2376
- this.__CANCEL__ = true;
2377
- }
2378
- };
2379
-
2380
- /**
2381
- * Resolve or reject a Promise based on response status.
2382
- *
2383
- * @param {Function} resolve A function that resolves the promise.
2384
- * @param {Function} reject A function that rejects the promise.
2385
- * @param {object} response The response.
2386
- *
2387
- * @returns {object} The response.
2388
- */
2389
- function settle(resolve, reject, response) {
2390
- const validateStatus = response.config.validateStatus;
2391
- if (!response.status || !validateStatus || validateStatus(response.status)) {
2392
- resolve(response);
2393
- } else {
2394
- reject(new AxiosError$1(
2395
- 'Request failed with status code ' + response.status,
2396
- response.status >= 400 && response.status < 500 ? AxiosError$1.ERR_BAD_REQUEST : AxiosError$1.ERR_BAD_RESPONSE,
2397
- response.config,
2398
- response.request,
2399
- response
2400
- ));
2401
- }
2402
- }
2403
-
2404
- function parseProtocol(url) {
2405
- const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
2406
- return (match && match[1]) || '';
2407
- }
2408
-
2409
- /**
2410
- * Calculate data maxRate
2411
- * @param {Number} [samplesCount= 10]
2412
- * @param {Number} [min= 1000]
2413
- * @returns {Function}
2414
- */
2415
- function speedometer(samplesCount, min) {
2416
- samplesCount = samplesCount || 10;
2417
- const bytes = new Array(samplesCount);
2418
- const timestamps = new Array(samplesCount);
2419
- let head = 0;
2420
- let tail = 0;
2421
- let firstSampleTS;
2422
-
2423
- min = min !== undefined ? min : 1000;
2424
-
2425
- return function push(chunkLength) {
2426
- const now = Date.now();
2427
-
2428
- const startedAt = timestamps[tail];
2429
-
2430
- if (!firstSampleTS) {
2431
- firstSampleTS = now;
2432
- }
2433
-
2434
- bytes[head] = chunkLength;
2435
- timestamps[head] = now;
2436
-
2437
- let i = tail;
2438
- let bytesCount = 0;
2439
-
2440
- while (i !== head) {
2441
- bytesCount += bytes[i++];
2442
- i = i % samplesCount;
2443
- }
2444
-
2445
- head = (head + 1) % samplesCount;
2446
-
2447
- if (head === tail) {
2448
- tail = (tail + 1) % samplesCount;
2449
- }
2450
-
2451
- if (now - firstSampleTS < min) {
2452
- return;
2453
- }
2454
-
2455
- const passed = startedAt && now - startedAt;
2456
-
2457
- return passed ? Math.round((bytesCount * 1000) / passed) : undefined;
2458
- };
2459
- }
2460
-
2461
- /**
2462
- * Throttle decorator
2463
- * @param {Function} fn
2464
- * @param {Number} freq
2465
- * @return {Function}
2466
- */
2467
- function throttle(fn, freq) {
2468
- let timestamp = 0;
2469
- let threshold = 1000 / freq;
2470
- let lastArgs;
2471
- let timer;
2472
-
2473
- const invoke = (args, now = Date.now()) => {
2474
- timestamp = now;
2475
- lastArgs = null;
2476
- if (timer) {
2477
- clearTimeout(timer);
2478
- timer = null;
2479
- }
2480
- fn(...args);
2481
- };
2482
-
2483
- const throttled = (...args) => {
2484
- const now = Date.now();
2485
- const passed = now - timestamp;
2486
- if (passed >= threshold) {
2487
- invoke(args, now);
2488
- } else {
2489
- lastArgs = args;
2490
- if (!timer) {
2491
- timer = setTimeout(() => {
2492
- timer = null;
2493
- invoke(lastArgs);
2494
- }, threshold - passed);
2495
- }
2496
- }
2497
- };
2498
-
2499
- const flush = () => lastArgs && invoke(lastArgs);
2500
-
2501
- return [throttled, flush];
2502
- }
2503
-
2504
- const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
2505
- let bytesNotified = 0;
2506
- const _speedometer = speedometer(50, 250);
2507
-
2508
- return throttle((e) => {
2509
- const rawLoaded = e.loaded;
2510
- const total = e.lengthComputable ? e.total : undefined;
2511
- const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
2512
- const progressBytes = Math.max(0, loaded - bytesNotified);
2513
- const rate = _speedometer(progressBytes);
2514
-
2515
- bytesNotified = Math.max(bytesNotified, loaded);
2516
-
2517
- const data = {
2518
- loaded,
2519
- total,
2520
- progress: total ? loaded / total : undefined,
2521
- bytes: progressBytes,
2522
- rate: rate ? rate : undefined,
2523
- estimated: rate && total ? (total - loaded) / rate : undefined,
2524
- event: e,
2525
- lengthComputable: total != null,
2526
- [isDownloadStream ? 'download' : 'upload']: true,
2527
- };
2528
-
2529
- listener(data);
2530
- }, freq);
2531
- };
2532
-
2533
- const progressEventDecorator = (total, throttled) => {
2534
- const lengthComputable = total != null;
2535
-
2536
- return [
2537
- (loaded) =>
2538
- throttled[0]({
2539
- lengthComputable,
2540
- total,
2541
- loaded,
2542
- }),
2543
- throttled[1],
2544
- ];
2545
- };
2546
-
2547
- const asyncDecorator =
2548
- (fn) =>
2549
- (...args) =>
2550
- utils$1.asap(() => fn(...args));
2551
-
2552
- var isURLSameOrigin = platform.hasStandardBrowserEnv
2553
- ? ((origin, isMSIE) => (url) => {
2554
- url = new URL(url, platform.origin);
2555
-
2556
- return (
2557
- origin.protocol === url.protocol &&
2558
- origin.host === url.host &&
2559
- (isMSIE || origin.port === url.port)
2560
- );
2561
- })(
2562
- new URL(platform.origin),
2563
- platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
2564
- )
2565
- : () => true;
2566
-
2567
- var cookies = platform.hasStandardBrowserEnv
2568
- ? // Standard browser envs support document.cookie
2569
- {
2570
- write(name, value, expires, path, domain, secure, sameSite) {
2571
- if (typeof document === 'undefined') return;
2572
-
2573
- const cookie = [`${name}=${encodeURIComponent(value)}`];
2574
-
2575
- if (utils$1.isNumber(expires)) {
2576
- cookie.push(`expires=${new Date(expires).toUTCString()}`);
2577
- }
2578
- if (utils$1.isString(path)) {
2579
- cookie.push(`path=${path}`);
2580
- }
2581
- if (utils$1.isString(domain)) {
2582
- cookie.push(`domain=${domain}`);
2583
- }
2584
- if (secure === true) {
2585
- cookie.push('secure');
2586
- }
2587
- if (utils$1.isString(sameSite)) {
2588
- cookie.push(`SameSite=${sameSite}`);
2589
- }
2590
-
2591
- document.cookie = cookie.join('; ');
2592
- },
2593
-
2594
- read(name) {
2595
- if (typeof document === 'undefined') return null;
2596
- // Match name=value by splitting on the semicolon separator instead of building a
2597
- // RegExp from `name` — interpolating an unescaped string into a RegExp would let
2598
- // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
2599
- // match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
2600
- // "; ", so ignore optional whitespace before each cookie name.
2601
- const cookies = document.cookie.split(';');
2602
- for (let i = 0; i < cookies.length; i++) {
2603
- const cookie = cookies[i].replace(/^\s+/, '');
2604
- const eq = cookie.indexOf('=');
2605
- if (eq !== -1 && cookie.slice(0, eq) === name) {
2606
- return decodeURIComponent(cookie.slice(eq + 1));
2607
- }
2608
- }
2609
- return null;
2610
- },
2611
-
2612
- remove(name) {
2613
- this.write(name, '', Date.now() - 86400000, '/');
2614
- },
2615
- }
2616
- : // Non-standard browser env (web workers, react-native) lack needed support.
2617
- {
2618
- write() {},
2619
- read() {
2620
- return null;
2621
- },
2622
- remove() {},
2623
- };
2624
-
2625
- /**
2626
- * Determines whether the specified URL is absolute
2627
- *
2628
- * @param {string} url The URL to test
2629
- *
2630
- * @returns {boolean} True if the specified URL is absolute, otherwise false
2631
- */
2632
- function isAbsoluteURL(url) {
2633
- // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
2634
- // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
2635
- // by any combination of letters, digits, plus, period, or hyphen.
2636
- if (typeof url !== 'string') {
2637
- return false;
2638
- }
2639
-
2640
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
2641
- }
2642
-
2643
- /**
2644
- * Creates a new URL by combining the specified URLs
2645
- *
2646
- * @param {string} baseURL The base URL
2647
- * @param {string} relativeURL The relative URL
2648
- *
2649
- * @returns {string} The combined URL
2650
- */
2651
- function combineURLs(baseURL, relativeURL) {
2652
- return relativeURL
2653
- ? baseURL.replace(/\/?\/$/, '') + '/' + relativeURL.replace(/^\/+/, '')
2654
- : baseURL;
2655
- }
2656
-
2657
- /**
2658
- * Creates a new URL by combining the baseURL with the requestedURL,
2659
- * only when the requestedURL is not already an absolute URL.
2660
- * If the requestURL is absolute, this function returns the requestedURL untouched.
2661
- *
2662
- * @param {string} baseURL The base URL
2663
- * @param {string} requestedURL Absolute or relative URL to combine
2664
- *
2665
- * @returns {string} The combined full path
2666
- */
2667
- function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
2668
- let isRelativeUrl = !isAbsoluteURL(requestedURL);
2669
- if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
2670
- return combineURLs(baseURL, requestedURL);
2671
- }
2672
- return requestedURL;
2673
- }
2674
-
2675
- const headersToObject = (thing) => (thing instanceof AxiosHeaders$1 ? { ...thing } : thing);
2676
-
2677
- /**
2678
- * Config-specific merge-function which creates a new config-object
2679
- * by merging two configuration objects together.
2680
- *
2681
- * @param {Object} config1
2682
- * @param {Object} config2
2683
- *
2684
- * @returns {Object} New object resulting from merging config2 to config1
2685
- */
2686
- function mergeConfig$1(config1, config2) {
2687
- // eslint-disable-next-line no-param-reassign
2688
- config2 = config2 || {};
2689
-
2690
- // Use a null-prototype object so that downstream reads such as `config.auth`
2691
- // or `config.baseURL` cannot inherit polluted values from Object.prototype.
2692
- // `hasOwnProperty` is restored as a non-enumerable own slot to preserve
2693
- // ergonomics for user code that relies on it.
2694
- const config = Object.create(null);
2695
- Object.defineProperty(config, 'hasOwnProperty', {
2696
- // Null-proto descriptor so a polluted Object.prototype.get cannot turn
2697
- // this data descriptor into an accessor descriptor on the way in.
2698
- __proto__: null,
2699
- value: Object.prototype.hasOwnProperty,
2700
- enumerable: false,
2701
- writable: true,
2702
- configurable: true,
2703
- });
2704
-
2705
- function getMergedValue(target, source, prop, caseless) {
2706
- if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
2707
- return utils$1.merge.call({ caseless }, target, source);
2708
- } else if (utils$1.isPlainObject(source)) {
2709
- return utils$1.merge({}, source);
2710
- } else if (utils$1.isArray(source)) {
2711
- return source.slice();
2712
- }
2713
- return source;
2714
- }
2715
-
2716
- function mergeDeepProperties(a, b, prop, caseless) {
2717
- if (!utils$1.isUndefined(b)) {
2718
- return getMergedValue(a, b, prop, caseless);
2719
- } else if (!utils$1.isUndefined(a)) {
2720
- return getMergedValue(undefined, a, prop, caseless);
2721
- }
2722
- }
2723
-
2724
- // eslint-disable-next-line consistent-return
2725
- function valueFromConfig2(a, b) {
2726
- if (!utils$1.isUndefined(b)) {
2727
- return getMergedValue(undefined, b);
2728
- }
2729
- }
2730
-
2731
- // eslint-disable-next-line consistent-return
2732
- function defaultToConfig2(a, b) {
2733
- if (!utils$1.isUndefined(b)) {
2734
- return getMergedValue(undefined, b);
2735
- } else if (!utils$1.isUndefined(a)) {
2736
- return getMergedValue(undefined, a);
2737
- }
2738
- }
2739
-
2740
- // eslint-disable-next-line consistent-return
2741
- function mergeDirectKeys(a, b, prop) {
2742
- if (utils$1.hasOwnProp(config2, prop)) {
2743
- return getMergedValue(a, b);
2744
- } else if (utils$1.hasOwnProp(config1, prop)) {
2745
- return getMergedValue(undefined, a);
2746
- }
2747
- }
2748
-
2749
- const mergeMap = {
2750
- url: valueFromConfig2,
2751
- method: valueFromConfig2,
2752
- data: valueFromConfig2,
2753
- baseURL: defaultToConfig2,
2754
- transformRequest: defaultToConfig2,
2755
- transformResponse: defaultToConfig2,
2756
- paramsSerializer: defaultToConfig2,
2757
- timeout: defaultToConfig2,
2758
- timeoutMessage: defaultToConfig2,
2759
- withCredentials: defaultToConfig2,
2760
- withXSRFToken: defaultToConfig2,
2761
- adapter: defaultToConfig2,
2762
- responseType: defaultToConfig2,
2763
- xsrfCookieName: defaultToConfig2,
2764
- xsrfHeaderName: defaultToConfig2,
2765
- onUploadProgress: defaultToConfig2,
2766
- onDownloadProgress: defaultToConfig2,
2767
- decompress: defaultToConfig2,
2768
- maxContentLength: defaultToConfig2,
2769
- maxBodyLength: defaultToConfig2,
2770
- beforeRedirect: defaultToConfig2,
2771
- transport: defaultToConfig2,
2772
- httpAgent: defaultToConfig2,
2773
- httpsAgent: defaultToConfig2,
2774
- cancelToken: defaultToConfig2,
2775
- socketPath: defaultToConfig2,
2776
- allowedSocketPaths: defaultToConfig2,
2777
- responseEncoding: defaultToConfig2,
2778
- validateStatus: mergeDirectKeys,
2779
- headers: (a, b, prop) =>
2780
- mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
2781
- };
2782
-
2783
- utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
2784
- if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
2785
- const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
2786
- const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined;
2787
- const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : undefined;
2788
- const configValue = merge(a, b, prop);
2789
- (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
2790
- });
2791
-
2792
- return config;
2793
- }
2794
-
2795
- const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
2796
-
2797
- function setFormDataHeaders(headers, formHeaders, policy) {
2798
- if (policy !== 'content-only') {
2799
- headers.set(formHeaders);
2800
- return;
2801
- }
2802
-
2803
- Object.entries(formHeaders).forEach(([key, val]) => {
2804
- if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
2805
- headers.set(key, val);
2806
- }
2807
- });
2808
- }
2809
-
2810
- /**
2811
- * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
2812
- * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
2813
- *
2814
- * @param {string} str The string to encode
2815
- *
2816
- * @returns {string} UTF-8 bytes as a Latin-1 string
2817
- */
2818
- const encodeUTF8 = (str) =>
2819
- encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>
2820
- String.fromCharCode(parseInt(hex, 16))
2821
- );
2822
-
2823
- var resolveConfig = (config) => {
2824
- const newConfig = mergeConfig$1({}, config);
2825
-
2826
- // Read only own properties to prevent prototype pollution gadgets
2827
- // (e.g. Object.prototype.baseURL = 'https://evil.com').
2828
- const own = (key) => (utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);
2829
-
2830
- const data = own('data');
2831
- let withXSRFToken = own('withXSRFToken');
2832
- const xsrfHeaderName = own('xsrfHeaderName');
2833
- const xsrfCookieName = own('xsrfCookieName');
2834
- let headers = own('headers');
2835
- const auth = own('auth');
2836
- const baseURL = own('baseURL');
2837
- const allowAbsoluteUrls = own('allowAbsoluteUrls');
2838
- const url = own('url');
2839
-
2840
- newConfig.headers = headers = AxiosHeaders$1.from(headers);
2841
-
2842
- newConfig.url = buildURL(
2843
- buildFullPath(baseURL, url, allowAbsoluteUrls),
2844
- config.params,
2845
- config.paramsSerializer
2846
- );
2847
-
2848
- // HTTP basic authentication
2849
- if (auth) {
2850
- headers.set(
2851
- 'Authorization',
2852
- 'Basic ' +
2853
- btoa((auth.username || '') + ':' + (auth.password ? encodeUTF8(auth.password) : ''))
2854
- );
2855
- }
2856
-
2857
- if (utils$1.isFormData(data)) {
2858
- if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
2859
- headers.setContentType(undefined); // browser handles it
2860
- } else if (utils$1.isFunction(data.getHeaders)) {
2861
- // Node.js FormData (like form-data package)
2862
- setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));
2863
- }
2864
- }
2865
-
2866
- // Add xsrf header
2867
- // This is only done if running in a standard browser environment.
2868
- // Specifically not if we're in a web worker, or react-native.
2869
-
2870
- if (platform.hasStandardBrowserEnv) {
2871
- if (utils$1.isFunction(withXSRFToken)) {
2872
- withXSRFToken = withXSRFToken(newConfig);
2873
- }
2874
-
2875
- // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
2876
- // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
2877
- // the XSRF token cross-origin.
2878
- const shouldSendXSRF =
2879
- withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url));
2880
-
2881
- if (shouldSendXSRF) {
2882
- const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
2883
-
2884
- if (xsrfValue) {
2885
- headers.set(xsrfHeaderName, xsrfValue);
2886
- }
2887
- }
2888
- }
2889
-
2890
- return newConfig;
2891
- };
2892
-
2893
- const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
2894
-
2895
- var xhrAdapter = isXHRAdapterSupported &&
2896
- function (config) {
2897
- return new Promise(function dispatchXhrRequest(resolve, reject) {
2898
- const _config = resolveConfig(config);
2899
- let requestData = _config.data;
2900
- const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
2901
- let { responseType, onUploadProgress, onDownloadProgress } = _config;
2902
- let onCanceled;
2903
- let uploadThrottled, downloadThrottled;
2904
- let flushUpload, flushDownload;
2905
-
2906
- function done() {
2907
- flushUpload && flushUpload(); // flush events
2908
- flushDownload && flushDownload(); // flush events
2909
-
2910
- _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
2911
-
2912
- _config.signal && _config.signal.removeEventListener('abort', onCanceled);
2913
- }
2914
-
2915
- let request = new XMLHttpRequest();
2916
-
2917
- request.open(_config.method.toUpperCase(), _config.url, true);
2918
-
2919
- // Set the request timeout in MS
2920
- request.timeout = _config.timeout;
2921
-
2922
- function onloadend() {
2923
- if (!request) {
2924
- return;
2925
- }
2926
- // Prepare the response
2927
- const responseHeaders = AxiosHeaders$1.from(
2928
- 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
2929
- );
2930
- const responseData =
2931
- !responseType || responseType === 'text' || responseType === 'json'
2932
- ? request.responseText
2933
- : request.response;
2934
- const response = {
2935
- data: responseData,
2936
- status: request.status,
2937
- statusText: request.statusText,
2938
- headers: responseHeaders,
2939
- config,
2940
- request,
2941
- };
2942
-
2943
- settle(
2944
- function _resolve(value) {
2945
- resolve(value);
2946
- done();
2947
- },
2948
- function _reject(err) {
2949
- reject(err);
2950
- done();
2951
- },
2952
- response
2953
- );
2954
-
2955
- // Clean up request
2956
- request = null;
2957
- }
2958
-
2959
- if ('onloadend' in request) {
2960
- // Use onloadend if available
2961
- request.onloadend = onloadend;
2962
- } else {
2963
- // Listen for ready state to emulate onloadend
2964
- request.onreadystatechange = function handleLoad() {
2965
- if (!request || request.readyState !== 4) {
2966
- return;
2967
- }
2968
-
2969
- // The request errored out and we didn't get a response, this will be
2970
- // handled by onerror instead
2971
- // With one exception: request that using file: protocol, most browsers
2972
- // will return status as 0 even though it's a successful request
2973
- if (
2974
- request.status === 0 &&
2975
- !(request.responseURL && request.responseURL.startsWith('file:'))
2976
- ) {
2977
- return;
2978
- }
2979
- // readystate handler is calling before onerror or ontimeout handlers,
2980
- // so we should call onloadend on the next 'tick'
2981
- setTimeout(onloadend);
2982
- };
2983
- }
2984
-
2985
- // Handle browser request cancellation (as opposed to a manual cancellation)
2986
- request.onabort = function handleAbort() {
2987
- if (!request) {
2988
- return;
2989
- }
2990
-
2991
- reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
2992
- done();
2993
-
2994
- // Clean up request
2995
- request = null;
2996
- };
2997
-
2998
- // Handle low level network errors
2999
- request.onerror = function handleError(event) {
3000
- // Browsers deliver a ProgressEvent in XHR onerror
3001
- // (message may be empty; when present, surface it)
3002
- // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
3003
- const msg = event && event.message ? event.message : 'Network Error';
3004
- const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
3005
- // attach the underlying event for consumers who want details
3006
- err.event = event || null;
3007
- reject(err);
3008
- done();
3009
- request = null;
3010
- };
3011
-
3012
- // Handle timeout
3013
- request.ontimeout = function handleTimeout() {
3014
- let timeoutErrorMessage = _config.timeout
3015
- ? 'timeout of ' + _config.timeout + 'ms exceeded'
3016
- : 'timeout exceeded';
3017
- const transitional = _config.transitional || transitionalDefaults;
3018
- if (_config.timeoutErrorMessage) {
3019
- timeoutErrorMessage = _config.timeoutErrorMessage;
3020
- }
3021
- reject(
3022
- new AxiosError$1(
3023
- timeoutErrorMessage,
3024
- transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
3025
- config,
3026
- request
3027
- )
3028
- );
3029
- done();
3030
-
3031
- // Clean up request
3032
- request = null;
3033
- };
3034
-
3035
- // Remove Content-Type if data is undefined
3036
- requestData === undefined && requestHeaders.setContentType(null);
3037
-
3038
- // Add headers to the request
3039
- if ('setRequestHeader' in request) {
3040
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
3041
- request.setRequestHeader(key, val);
3042
- });
3043
- }
3044
-
3045
- // Add withCredentials to request if needed
3046
- if (!utils$1.isUndefined(_config.withCredentials)) {
3047
- request.withCredentials = !!_config.withCredentials;
3048
- }
3049
-
3050
- // Add responseType to request if needed
3051
- if (responseType && responseType !== 'json') {
3052
- request.responseType = _config.responseType;
3053
- }
3054
-
3055
- // Handle progress if needed
3056
- if (onDownloadProgress) {
3057
- [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
3058
- request.addEventListener('progress', downloadThrottled);
3059
- }
3060
-
3061
- // Not all browsers support upload events
3062
- if (onUploadProgress && request.upload) {
3063
- [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
3064
-
3065
- request.upload.addEventListener('progress', uploadThrottled);
3066
-
3067
- request.upload.addEventListener('loadend', flushUpload);
3068
- }
3069
-
3070
- if (_config.cancelToken || _config.signal) {
3071
- // Handle cancellation
3072
- // eslint-disable-next-line func-names
3073
- onCanceled = (cancel) => {
3074
- if (!request) {
3075
- return;
3076
- }
3077
- reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
3078
- request.abort();
3079
- done();
3080
- request = null;
3081
- };
3082
-
3083
- _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
3084
- if (_config.signal) {
3085
- _config.signal.aborted
3086
- ? onCanceled()
3087
- : _config.signal.addEventListener('abort', onCanceled);
3088
- }
3089
- }
3090
-
3091
- const protocol = parseProtocol(_config.url);
3092
-
3093
- if (protocol && !platform.protocols.includes(protocol)) {
3094
- reject(
3095
- new AxiosError$1(
3096
- 'Unsupported protocol ' + protocol + ':',
3097
- AxiosError$1.ERR_BAD_REQUEST,
3098
- config
3099
- )
3100
- );
3101
- return;
3102
- }
3103
-
3104
- // Send the request
3105
- request.send(requestData || null);
3106
- });
3107
- };
3108
-
3109
- const composeSignals = (signals, timeout) => {
3110
- const { length } = (signals = signals ? signals.filter(Boolean) : []);
3111
-
3112
- if (timeout || length) {
3113
- let controller = new AbortController();
3114
-
3115
- let aborted;
3116
-
3117
- const onabort = function (reason) {
3118
- if (!aborted) {
3119
- aborted = true;
3120
- unsubscribe();
3121
- const err = reason instanceof Error ? reason : this.reason;
3122
- controller.abort(
3123
- err instanceof AxiosError$1
3124
- ? err
3125
- : new CanceledError$1(err instanceof Error ? err.message : err)
3126
- );
3127
- }
3128
- };
3129
-
3130
- let timer =
3131
- timeout &&
3132
- setTimeout(() => {
3133
- timer = null;
3134
- onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
3135
- }, timeout);
3136
-
3137
- const unsubscribe = () => {
3138
- if (signals) {
3139
- timer && clearTimeout(timer);
3140
- timer = null;
3141
- signals.forEach((signal) => {
3142
- signal.unsubscribe
3143
- ? signal.unsubscribe(onabort)
3144
- : signal.removeEventListener('abort', onabort);
3145
- });
3146
- signals = null;
3147
- }
3148
- };
3149
-
3150
- signals.forEach((signal) => signal.addEventListener('abort', onabort));
3151
-
3152
- const { signal } = controller;
3153
-
3154
- signal.unsubscribe = () => utils$1.asap(unsubscribe);
3155
-
3156
- return signal;
3157
- }
3158
- };
3159
-
3160
- const streamChunk = function* (chunk, chunkSize) {
3161
- let len = chunk.byteLength;
3162
-
3163
- if (len < chunkSize) {
3164
- yield chunk;
3165
- return;
3166
- }
3167
-
3168
- let pos = 0;
3169
- let end;
3170
-
3171
- while (pos < len) {
3172
- end = pos + chunkSize;
3173
- yield chunk.slice(pos, end);
3174
- pos = end;
3175
- }
3176
- };
3177
-
3178
- const readBytes = async function* (iterable, chunkSize) {
3179
- for await (const chunk of readStream(iterable)) {
3180
- yield* streamChunk(chunk, chunkSize);
3181
- }
3182
- };
3183
-
3184
- const readStream = async function* (stream) {
3185
- if (stream[Symbol.asyncIterator]) {
3186
- yield* stream;
3187
- return;
3188
- }
3189
-
3190
- const reader = stream.getReader();
3191
- try {
3192
- for (;;) {
3193
- const { done, value } = await reader.read();
3194
- if (done) {
3195
- break;
3196
- }
3197
- yield value;
3198
- }
3199
- } finally {
3200
- await reader.cancel();
3201
- }
3202
- };
3203
-
3204
- const trackStream = (stream, chunkSize, onProgress, onFinish) => {
3205
- const iterator = readBytes(stream, chunkSize);
3206
-
3207
- let bytes = 0;
3208
- let done;
3209
- let _onFinish = (e) => {
3210
- if (!done) {
3211
- done = true;
3212
- onFinish && onFinish(e);
3213
- }
3214
- };
3215
-
3216
- return new ReadableStream(
3217
- {
3218
- async pull(controller) {
3219
- try {
3220
- const { done, value } = await iterator.next();
3221
-
3222
- if (done) {
3223
- _onFinish();
3224
- controller.close();
3225
- return;
3226
- }
3227
-
3228
- let len = value.byteLength;
3229
- if (onProgress) {
3230
- let loadedBytes = (bytes += len);
3231
- onProgress(loadedBytes);
3232
- }
3233
- controller.enqueue(new Uint8Array(value));
3234
- } catch (err) {
3235
- _onFinish(err);
3236
- throw err;
3237
- }
3238
- },
3239
- cancel(reason) {
3240
- _onFinish(reason);
3241
- return iterator.return();
3242
- },
3243
- },
3244
- {
3245
- highWaterMark: 2,
3246
- }
3247
- );
3248
- };
3249
-
3250
- /**
3251
- * Estimate decoded byte length of a data:// URL *without* allocating large buffers.
3252
- * - For base64: compute exact decoded size using length and padding;
3253
- * handle %XX at the character-count level (no string allocation).
3254
- * - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound.
3255
- *
3256
- * @param {string} url
3257
- * @returns {number}
3258
- */
3259
- function estimateDataURLDecodedBytes(url) {
3260
- if (!url || typeof url !== 'string') return 0;
3261
- if (!url.startsWith('data:')) return 0;
3262
-
3263
- const comma = url.indexOf(',');
3264
- if (comma < 0) return 0;
3265
-
3266
- const meta = url.slice(5, comma);
3267
- const body = url.slice(comma + 1);
3268
- const isBase64 = /;base64/i.test(meta);
3269
-
3270
- if (isBase64) {
3271
- let effectiveLen = body.length;
3272
- const len = body.length; // cache length
3273
-
3274
- for (let i = 0; i < len; i++) {
3275
- if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
3276
- const a = body.charCodeAt(i + 1);
3277
- const b = body.charCodeAt(i + 2);
3278
- const isHex =
3279
- ((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) &&
3280
- ((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102));
3281
-
3282
- if (isHex) {
3283
- effectiveLen -= 2;
3284
- i += 2;
3285
- }
3286
- }
3287
- }
3288
-
3289
- let pad = 0;
3290
- let idx = len - 1;
3291
-
3292
- const tailIsPct3D = (j) =>
3293
- j >= 2 &&
3294
- body.charCodeAt(j - 2) === 37 && // '%'
3295
- body.charCodeAt(j - 1) === 51 && // '3'
3296
- (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
3297
-
3298
- if (idx >= 0) {
3299
- if (body.charCodeAt(idx) === 61 /* '=' */) {
3300
- pad++;
3301
- idx--;
3302
- } else if (tailIsPct3D(idx)) {
3303
- pad++;
3304
- idx -= 3;
3305
- }
3306
- }
3307
-
3308
- if (pad === 1 && idx >= 0) {
3309
- if (body.charCodeAt(idx) === 61 /* '=' */) {
3310
- pad++;
3311
- } else if (tailIsPct3D(idx)) {
3312
- pad++;
3313
- }
3314
- }
3315
-
3316
- const groups = Math.floor(effectiveLen / 4);
3317
- const bytes = groups * 3 - (pad || 0);
3318
- return bytes > 0 ? bytes : 0;
3319
- }
3320
-
3321
- if (typeof Buffer !== 'undefined' && typeof Buffer.byteLength === 'function') {
3322
- return Buffer.byteLength(body, 'utf8');
3323
- }
3324
-
3325
- // Compute UTF-8 byte length directly from UTF-16 code units without allocating
3326
- // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).
3327
- // Using body.length here would undercount non-ASCII (e.g. '€' is 1 code unit
3328
- // but 3 UTF-8 bytes).
3329
- let bytes = 0;
3330
- for (let i = 0, len = body.length; i < len; i++) {
3331
- const c = body.charCodeAt(i);
3332
- if (c < 0x80) {
3333
- bytes += 1;
3334
- } else if (c < 0x800) {
3335
- bytes += 2;
3336
- } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {
3337
- const next = body.charCodeAt(i + 1);
3338
- if (next >= 0xdc00 && next <= 0xdfff) {
3339
- bytes += 4;
3340
- i++;
3341
- } else {
3342
- bytes += 3;
3343
- }
3344
- } else {
3345
- bytes += 3;
3346
- }
3347
- }
3348
- return bytes;
3349
- }
3350
-
3351
- const VERSION$1 = "1.16.0";
3352
-
3353
- const DEFAULT_CHUNK_SIZE = 64 * 1024;
3354
-
3355
- const { isFunction } = utils$1;
3356
-
3357
- const test = (fn, ...args) => {
3358
- try {
3359
- return !!fn(...args);
3360
- } catch (e) {
3361
- return false;
3362
- }
3363
- };
3364
-
3365
- const factory = (env) => {
3366
- const globalObject = utils$1.global ?? globalThis;
3367
- const { ReadableStream, TextEncoder } = globalObject;
3368
-
3369
- env = utils$1.merge.call(
3370
- {
3371
- skipUndefined: true,
3372
- },
3373
- {
3374
- Request: globalObject.Request,
3375
- Response: globalObject.Response,
3376
- },
3377
- env
3378
- );
3379
-
3380
- const { fetch: envFetch, Request, Response } = env;
3381
- const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
3382
- const isRequestSupported = isFunction(Request);
3383
- const isResponseSupported = isFunction(Response);
3384
-
3385
- if (!isFetchSupported) {
3386
- return false;
3387
- }
3388
-
3389
- const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);
3390
-
3391
- const encodeText =
3392
- isFetchSupported &&
3393
- (typeof TextEncoder === 'function'
3394
- ? (
3395
- (encoder) => (str) =>
3396
- encoder.encode(str)
3397
- )(new TextEncoder())
3398
- : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
3399
-
3400
- const supportsRequestStream =
3401
- isRequestSupported &&
3402
- isReadableStreamSupported &&
3403
- test(() => {
3404
- let duplexAccessed = false;
3405
-
3406
- const request = new Request(platform.origin, {
3407
- body: new ReadableStream(),
3408
- method: 'POST',
3409
- get duplex() {
3410
- duplexAccessed = true;
3411
- return 'half';
3412
- },
3413
- });
3414
-
3415
- const hasContentType = request.headers.has('Content-Type');
3416
-
3417
- if (request.body != null) {
3418
- request.body.cancel();
3419
- }
3420
-
3421
- return duplexAccessed && !hasContentType;
3422
- });
3423
-
3424
- const supportsResponseStream =
3425
- isResponseSupported &&
3426
- isReadableStreamSupported &&
3427
- test(() => utils$1.isReadableStream(new Response('').body));
3428
-
3429
- const resolvers = {
3430
- stream: supportsResponseStream && ((res) => res.body),
3431
- };
3432
-
3433
- isFetchSupported &&
3434
- (() => {
3435
- ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => {
3436
- !resolvers[type] &&
3437
- (resolvers[type] = (res, config) => {
3438
- let method = res && res[type];
3439
-
3440
- if (method) {
3441
- return method.call(res);
3442
- }
3443
-
3444
- throw new AxiosError$1(
3445
- `Response type '${type}' is not supported`,
3446
- AxiosError$1.ERR_NOT_SUPPORT,
3447
- config
3448
- );
3449
- });
3450
- });
3451
- })();
3452
-
3453
- const getBodyLength = async (body) => {
3454
- if (body == null) {
3455
- return 0;
3456
- }
3457
-
3458
- if (utils$1.isBlob(body)) {
3459
- return body.size;
3460
- }
3461
-
3462
- if (utils$1.isSpecCompliantForm(body)) {
3463
- const _request = new Request(platform.origin, {
3464
- method: 'POST',
3465
- body,
3466
- });
3467
- return (await _request.arrayBuffer()).byteLength;
3468
- }
3469
-
3470
- if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
3471
- return body.byteLength;
3472
- }
3473
-
3474
- if (utils$1.isURLSearchParams(body)) {
3475
- body = body + '';
3476
- }
3477
-
3478
- if (utils$1.isString(body)) {
3479
- return (await encodeText(body)).byteLength;
3480
- }
3481
- };
3482
-
3483
- const resolveBodyLength = async (headers, body) => {
3484
- const length = utils$1.toFiniteNumber(headers.getContentLength());
3485
-
3486
- return length == null ? getBodyLength(body) : length;
3487
- };
3488
-
3489
- return async (config) => {
3490
- let {
3491
- url,
3492
- method,
3493
- data,
3494
- signal,
3495
- cancelToken,
3496
- timeout,
3497
- onDownloadProgress,
3498
- onUploadProgress,
3499
- responseType,
3500
- headers,
3501
- withCredentials = 'same-origin',
3502
- fetchOptions,
3503
- maxContentLength,
3504
- maxBodyLength,
3505
- } = resolveConfig(config);
3506
-
3507
- const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
3508
- const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
3509
-
3510
- let _fetch = envFetch || fetch;
3511
-
3512
- responseType = responseType ? (responseType + '').toLowerCase() : 'text';
3513
-
3514
- let composedSignal = composeSignals(
3515
- [signal, cancelToken && cancelToken.toAbortSignal()],
3516
- timeout
3517
- );
3518
-
3519
- let request = null;
3520
-
3521
- const unsubscribe =
3522
- composedSignal &&
3523
- composedSignal.unsubscribe &&
3524
- (() => {
3525
- composedSignal.unsubscribe();
3526
- });
3527
-
3528
- let requestContentLength;
3529
-
3530
- try {
3531
- // Enforce maxContentLength for data: URLs up-front so we never materialize
3532
- // an oversized payload. The HTTP adapter applies the same check (see http.js
3533
- // "if (protocol === 'data:')" branch).
3534
- if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {
3535
- const estimated = estimateDataURLDecodedBytes(url);
3536
- if (estimated > maxContentLength) {
3537
- throw new AxiosError$1(
3538
- 'maxContentLength size of ' + maxContentLength + ' exceeded',
3539
- AxiosError$1.ERR_BAD_RESPONSE,
3540
- config,
3541
- request
3542
- );
3543
- }
3544
- }
3545
-
3546
- // Enforce maxBodyLength against the outbound request body before dispatch.
3547
- // Mirrors http.js behavior (ERR_BAD_REQUEST / 'Request body larger than
3548
- // maxBodyLength limit'). Skip when the body length cannot be determined
3549
- // (e.g. a live ReadableStream supplied by the caller).
3550
- if (hasMaxBodyLength && method !== 'get' && method !== 'head') {
3551
- const outboundLength = await resolveBodyLength(headers, data);
3552
- if (
3553
- typeof outboundLength === 'number' &&
3554
- isFinite(outboundLength) &&
3555
- outboundLength > maxBodyLength
3556
- ) {
3557
- throw new AxiosError$1(
3558
- 'Request body larger than maxBodyLength limit',
3559
- AxiosError$1.ERR_BAD_REQUEST,
3560
- config,
3561
- request
3562
- );
3563
- }
3564
- }
3565
-
3566
- if (
3567
- onUploadProgress &&
3568
- supportsRequestStream &&
3569
- method !== 'get' &&
3570
- method !== 'head' &&
3571
- (requestContentLength = await resolveBodyLength(headers, data)) !== 0
3572
- ) {
3573
- let _request = new Request(url, {
3574
- method: 'POST',
3575
- body: data,
3576
- duplex: 'half',
3577
- });
3578
-
3579
- let contentTypeHeader;
3580
-
3581
- if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
3582
- headers.setContentType(contentTypeHeader);
3583
- }
3584
-
3585
- if (_request.body) {
3586
- const [onProgress, flush] = progressEventDecorator(
3587
- requestContentLength,
3588
- progressEventReducer(asyncDecorator(onUploadProgress))
3589
- );
3590
-
3591
- data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
3592
- }
3593
- }
3594
-
3595
- if (!utils$1.isString(withCredentials)) {
3596
- withCredentials = withCredentials ? 'include' : 'omit';
3597
- }
3598
-
3599
- // Cloudflare Workers throws when credentials are defined
3600
- // see https://github.com/cloudflare/workerd/issues/902
3601
- const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;
3602
-
3603
- // If data is FormData and Content-Type is multipart/form-data without boundary,
3604
- // delete it so fetch can set it correctly with the boundary
3605
- if (utils$1.isFormData(data)) {
3606
- const contentType = headers.getContentType();
3607
- if (
3608
- contentType &&
3609
- /^multipart\/form-data/i.test(contentType) &&
3610
- !/boundary=/i.test(contentType)
3611
- ) {
3612
- headers.delete('content-type');
3613
- }
3614
- }
3615
-
3616
- // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
3617
- headers.set('User-Agent', 'axios/' + VERSION$1, false);
3618
-
3619
- const resolvedOptions = {
3620
- ...fetchOptions,
3621
- signal: composedSignal,
3622
- method: method.toUpperCase(),
3623
- headers: headers.normalize().toJSON(),
3624
- body: data,
3625
- duplex: 'half',
3626
- credentials: isCredentialsSupported ? withCredentials : undefined,
3627
- };
3628
-
3629
- request = isRequestSupported && new Request(url, resolvedOptions);
3630
-
3631
- let response = await (isRequestSupported
3632
- ? _fetch(request, fetchOptions)
3633
- : _fetch(url, resolvedOptions));
3634
-
3635
- // Cheap pre-check: if the server honestly declares a content-length that
3636
- // already exceeds the cap, reject before we start streaming.
3637
- if (hasMaxContentLength) {
3638
- const declaredLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
3639
- if (declaredLength != null && declaredLength > maxContentLength) {
3640
- throw new AxiosError$1(
3641
- 'maxContentLength size of ' + maxContentLength + ' exceeded',
3642
- AxiosError$1.ERR_BAD_RESPONSE,
3643
- config,
3644
- request
3645
- );
3646
- }
3647
- }
3648
-
3649
- const isStreamResponse =
3650
- supportsResponseStream && (responseType === 'stream' || responseType === 'response');
3651
-
3652
- if (
3653
- supportsResponseStream &&
3654
- response.body &&
3655
- (onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe))
3656
- ) {
3657
- const options = {};
3658
-
3659
- ['status', 'statusText', 'headers'].forEach((prop) => {
3660
- options[prop] = response[prop];
3661
- });
3662
-
3663
- const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
3664
-
3665
- const [onProgress, flush] =
3666
- (onDownloadProgress &&
3667
- progressEventDecorator(
3668
- responseContentLength,
3669
- progressEventReducer(asyncDecorator(onDownloadProgress), true)
3670
- )) ||
3671
- [];
3672
-
3673
- let bytesRead = 0;
3674
- const onChunkProgress = (loadedBytes) => {
3675
- if (hasMaxContentLength) {
3676
- bytesRead = loadedBytes;
3677
- if (bytesRead > maxContentLength) {
3678
- throw new AxiosError$1(
3679
- 'maxContentLength size of ' + maxContentLength + ' exceeded',
3680
- AxiosError$1.ERR_BAD_RESPONSE,
3681
- config,
3682
- request
3683
- );
3684
- }
3685
- }
3686
- onProgress && onProgress(loadedBytes);
3687
- };
3688
-
3689
- response = new Response(
3690
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
3691
- flush && flush();
3692
- unsubscribe && unsubscribe();
3693
- }),
3694
- options
3695
- );
3696
- }
3697
-
3698
- responseType = responseType || 'text';
3699
-
3700
- let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](
3701
- response,
3702
- config
3703
- );
3704
-
3705
- // Fallback enforcement for environments without ReadableStream support
3706
- // (legacy runtimes). Detect materialized size from typed output; skip
3707
- // streams/Response passthrough since the user will read those themselves.
3708
- if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
3709
- let materializedSize;
3710
- if (responseData != null) {
3711
- if (typeof responseData.byteLength === 'number') {
3712
- materializedSize = responseData.byteLength;
3713
- } else if (typeof responseData.size === 'number') {
3714
- materializedSize = responseData.size;
3715
- } else if (typeof responseData === 'string') {
3716
- materializedSize =
3717
- typeof TextEncoder === 'function'
3718
- ? new TextEncoder().encode(responseData).byteLength
3719
- : responseData.length;
3720
- }
3721
- }
3722
- if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {
3723
- throw new AxiosError$1(
3724
- 'maxContentLength size of ' + maxContentLength + ' exceeded',
3725
- AxiosError$1.ERR_BAD_RESPONSE,
3726
- config,
3727
- request
3728
- );
3729
- }
3730
- }
3731
-
3732
- !isStreamResponse && unsubscribe && unsubscribe();
3733
-
3734
- return await new Promise((resolve, reject) => {
3735
- settle(resolve, reject, {
3736
- data: responseData,
3737
- headers: AxiosHeaders$1.from(response.headers),
3738
- status: response.status,
3739
- statusText: response.statusText,
3740
- config,
3741
- request,
3742
- });
3743
- });
3744
- } catch (err) {
3745
- unsubscribe && unsubscribe();
3746
-
3747
- // Safari can surface fetch aborts as a DOMException-like object whose
3748
- // branded getters throw. Prefer our composed signal reason before reading
3749
- // the caught error, preserving timeout vs cancellation semantics.
3750
- if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError$1) {
3751
- const canceledError = composedSignal.reason;
3752
- canceledError.config = config;
3753
- request && (canceledError.request = request);
3754
- err !== canceledError && (canceledError.cause = err);
3755
- throw canceledError;
3756
- }
3757
-
3758
- if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
3759
- throw Object.assign(
3760
- new AxiosError$1(
3761
- 'Network Error',
3762
- AxiosError$1.ERR_NETWORK,
3763
- config,
3764
- request,
3765
- err && err.response
3766
- ),
3767
- {
3768
- cause: err.cause || err,
3769
- }
3770
- );
3771
- }
3772
-
3773
- throw AxiosError$1.from(err, err && err.code, config, request, err && err.response);
3774
- }
3775
- };
3776
- };
3777
-
3778
- const seedCache = new Map();
3779
-
3780
- const getFetch = (config) => {
3781
- let env = (config && config.env) || {};
3782
- const { fetch, Request, Response } = env;
3783
- const seeds = [Request, Response, fetch];
3784
-
3785
- let len = seeds.length,
3786
- i = len,
3787
- seed,
3788
- target,
3789
- map = seedCache;
3790
-
3791
- while (i--) {
3792
- seed = seeds[i];
3793
- target = map.get(seed);
3794
-
3795
- target === undefined && map.set(seed, (target = i ? new Map() : factory(env)));
3796
-
3797
- map = target;
3798
- }
3799
-
3800
- return target;
3801
- };
3802
-
3803
- getFetch();
3804
-
3805
- /**
3806
- * Known adapters mapping.
3807
- * Provides environment-specific adapters for Axios:
3808
- * - `http` for Node.js
3809
- * - `xhr` for browsers
3810
- * - `fetch` for fetch API-based requests
3811
- *
3812
- * @type {Object<string, Function|Object>}
3813
- */
3814
- const knownAdapters = {
3815
- http: httpAdapter,
3816
- xhr: xhrAdapter,
3817
- fetch: {
3818
- get: getFetch,
3819
- },
3820
- };
3821
-
3822
- // Assign adapter names for easier debugging and identification
3823
- utils$1.forEach(knownAdapters, (fn, value) => {
3824
- if (fn) {
3825
- try {
3826
- // Null-proto descriptors so a polluted Object.prototype.get cannot turn
3827
- // these data descriptors into accessor descriptors on the way in.
3828
- Object.defineProperty(fn, 'name', { __proto__: null, value });
3829
- } catch (e) {
3830
- // eslint-disable-next-line no-empty
3831
- }
3832
- Object.defineProperty(fn, 'adapterName', { __proto__: null, value });
3833
- }
3834
- });
3835
-
3836
- /**
3837
- * Render a rejection reason string for unknown or unsupported adapters
3838
- *
3839
- * @param {string} reason
3840
- * @returns {string}
3841
- */
3842
- const renderReason = (reason) => `- ${reason}`;
3843
-
3844
- /**
3845
- * Check if the adapter is resolved (function, null, or false)
3846
- *
3847
- * @param {Function|null|false} adapter
3848
- * @returns {boolean}
3849
- */
3850
- const isResolvedHandle = (adapter) =>
3851
- utils$1.isFunction(adapter) || adapter === null || adapter === false;
3852
-
3853
- /**
3854
- * Get the first suitable adapter from the provided list.
3855
- * Tries each adapter in order until a supported one is found.
3856
- * Throws an AxiosError if no adapter is suitable.
3857
- *
3858
- * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
3859
- * @param {Object} config - Axios request configuration
3860
- * @throws {AxiosError} If no suitable adapter is available
3861
- * @returns {Function} The resolved adapter function
3862
- */
3863
- function getAdapter$1(adapters, config) {
3864
- adapters = utils$1.isArray(adapters) ? adapters : [adapters];
3865
-
3866
- const { length } = adapters;
3867
- let nameOrAdapter;
3868
- let adapter;
3869
-
3870
- const rejectedReasons = {};
3871
-
3872
- for (let i = 0; i < length; i++) {
3873
- nameOrAdapter = adapters[i];
3874
- let id;
3875
-
3876
- adapter = nameOrAdapter;
3877
-
3878
- if (!isResolvedHandle(nameOrAdapter)) {
3879
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
3880
-
3881
- if (adapter === undefined) {
3882
- throw new AxiosError$1(`Unknown adapter '${id}'`);
3883
- }
3884
- }
3885
-
3886
- if (adapter && (utils$1.isFunction(adapter) || (adapter = adapter.get(config)))) {
3887
- break;
3888
- }
3889
-
3890
- rejectedReasons[id || '#' + i] = adapter;
3891
- }
3892
-
3893
- if (!adapter) {
3894
- const reasons = Object.entries(rejectedReasons).map(
3895
- ([id, state]) =>
3896
- `adapter ${id} ` +
3897
- (state === false ? 'is not supported by the environment' : 'is not available in the build')
3898
- );
3899
-
3900
- let s = length
3901
- ? reasons.length > 1
3902
- ? 'since :\n' + reasons.map(renderReason).join('\n')
3903
- : ' ' + renderReason(reasons[0])
3904
- : 'as no adapter specified';
3905
-
3906
- throw new AxiosError$1(
3907
- `There is no suitable adapter to dispatch the request ` + s,
3908
- 'ERR_NOT_SUPPORT'
3909
- );
3910
- }
3911
-
3912
- return adapter;
3913
- }
3914
-
3915
- /**
3916
- * Exports Axios adapters and utility to resolve an adapter
3917
- */
3918
- var adapters = {
3919
- /**
3920
- * Resolve an adapter from a list of adapter names or functions.
3921
- * @type {Function}
3922
- */
3923
- getAdapter: getAdapter$1,
3924
-
3925
- /**
3926
- * Exposes all known adapters
3927
- * @type {Object<string, Function|Object>}
3928
- */
3929
- adapters: knownAdapters,
3930
- };
3931
-
3932
- /**
3933
- * Throws a `CanceledError` if cancellation has been requested.
3934
- *
3935
- * @param {Object} config The config that is to be used for the request
3936
- *
3937
- * @returns {void}
3938
- */
3939
- function throwIfCancellationRequested(config) {
3940
- if (config.cancelToken) {
3941
- config.cancelToken.throwIfRequested();
3942
- }
3943
-
3944
- if (config.signal && config.signal.aborted) {
3945
- throw new CanceledError$1(null, config);
3946
- }
3947
- }
3948
-
3949
- /**
3950
- * Dispatch a request to the server using the configured adapter.
3951
- *
3952
- * @param {object} config The config that is to be used for the request
3953
- *
3954
- * @returns {Promise} The Promise to be fulfilled
3955
- */
3956
- function dispatchRequest(config) {
3957
- throwIfCancellationRequested(config);
3958
-
3959
- config.headers = AxiosHeaders$1.from(config.headers);
3960
-
3961
- // Transform request data
3962
- config.data = transformData.call(config, config.transformRequest);
3963
-
3964
- if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
3965
- config.headers.setContentType('application/x-www-form-urlencoded', false);
3966
- }
3967
-
3968
- const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
3969
-
3970
- return adapter(config).then(
3971
- function onAdapterResolution(response) {
3972
- throwIfCancellationRequested(config);
3973
-
3974
- // Expose the current response on config so that transformResponse can
3975
- // attach it to any AxiosError it throws (e.g. on JSON parse failure).
3976
- // We clean it up afterwards to avoid polluting the config object.
3977
- config.response = response;
3978
- try {
3979
- response.data = transformData.call(config, config.transformResponse, response);
3980
- } finally {
3981
- delete config.response;
3982
- }
3983
-
3984
- response.headers = AxiosHeaders$1.from(response.headers);
3985
-
3986
- return response;
3987
- },
3988
- function onAdapterRejection(reason) {
3989
- if (!isCancel$1(reason)) {
3990
- throwIfCancellationRequested(config);
3991
-
3992
- // Transform response data
3993
- if (reason && reason.response) {
3994
- config.response = reason.response;
3995
- try {
3996
- reason.response.data = transformData.call(
3997
- config,
3998
- config.transformResponse,
3999
- reason.response
4000
- );
4001
- } finally {
4002
- delete config.response;
4003
- }
4004
- reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
4005
- }
4006
- }
4007
-
4008
- return Promise.reject(reason);
4009
- }
4010
- );
4011
- }
4012
-
4013
- const validators$1 = {};
4014
-
4015
- // eslint-disable-next-line func-names
4016
- ['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {
4017
- validators$1[type] = function validator(thing) {
4018
- return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;
4019
- };
4020
- });
4021
-
4022
- const deprecatedWarnings = {};
4023
-
4024
- /**
4025
- * Transitional option validator
4026
- *
4027
- * @param {function|boolean?} validator - set to false if the transitional option has been removed
4028
- * @param {string?} version - deprecated version / removed since version
4029
- * @param {string?} message - some message with additional info
4030
- *
4031
- * @returns {function}
4032
- */
4033
- validators$1.transitional = function transitional(validator, version, message) {
4034
- function formatMessage(opt, desc) {
4035
- return (
4036
- '[Axios v' +
4037
- VERSION$1 +
4038
- "] Transitional option '" +
4039
- opt +
4040
- "'" +
4041
- desc +
4042
- (message ? '. ' + message : '')
4043
- );
4044
- }
4045
-
4046
- // eslint-disable-next-line func-names
4047
- return (value, opt, opts) => {
4048
- if (validator === false) {
4049
- throw new AxiosError$1(
4050
- formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
4051
- AxiosError$1.ERR_DEPRECATED
4052
- );
4053
- }
4054
-
4055
- if (version && !deprecatedWarnings[opt]) {
4056
- deprecatedWarnings[opt] = true;
4057
- // eslint-disable-next-line no-console
4058
- console.warn(
4059
- formatMessage(
4060
- opt,
4061
- ' has been deprecated since v' + version + ' and will be removed in the near future'
4062
- )
4063
- );
4064
- }
4065
-
4066
- return validator ? validator(value, opt, opts) : true;
4067
- };
4068
- };
4069
-
4070
- validators$1.spelling = function spelling(correctSpelling) {
4071
- return (value, opt) => {
4072
- // eslint-disable-next-line no-console
4073
- console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
4074
- return true;
4075
- };
4076
- };
4077
-
4078
- /**
4079
- * Assert object's properties type
4080
- *
4081
- * @param {object} options
4082
- * @param {object} schema
4083
- * @param {boolean?} allowUnknown
4084
- *
4085
- * @returns {object}
4086
- */
4087
-
4088
- function assertOptions(options, schema, allowUnknown) {
4089
- if (typeof options !== 'object') {
4090
- throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
4091
- }
4092
- const keys = Object.keys(options);
4093
- let i = keys.length;
4094
- while (i-- > 0) {
4095
- const opt = keys[i];
4096
- // Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply
4097
- // a non-function validator and cause a TypeError.
4098
- const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
4099
- if (validator) {
4100
- const value = options[opt];
4101
- const result = value === undefined || validator(value, opt, options);
4102
- if (result !== true) {
4103
- throw new AxiosError$1(
4104
- 'option ' + opt + ' must be ' + result,
4105
- AxiosError$1.ERR_BAD_OPTION_VALUE
4106
- );
4107
- }
4108
- continue;
4109
- }
4110
- if (allowUnknown !== true) {
4111
- throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
4112
- }
4113
- }
4114
- }
4115
-
4116
- var validator = {
4117
- assertOptions,
4118
- validators: validators$1,
4119
- };
4120
-
4121
- const validators = validator.validators;
4122
-
4123
- /**
4124
- * Create a new instance of Axios
4125
- *
4126
- * @param {Object} instanceConfig The default config for the instance
4127
- *
4128
- * @return {Axios} A new instance of Axios
4129
- */
4130
- let Axios$1 = class Axios {
4131
- constructor(instanceConfig) {
4132
- this.defaults = instanceConfig || {};
4133
- this.interceptors = {
4134
- request: new InterceptorManager(),
4135
- response: new InterceptorManager(),
4136
- };
4137
- }
4138
-
4139
- /**
4140
- * Dispatch a request
4141
- *
4142
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
4143
- * @param {?Object} config
4144
- *
4145
- * @returns {Promise} The Promise to be fulfilled
4146
- */
4147
- async request(configOrUrl, config) {
4148
- try {
4149
- return await this._request(configOrUrl, config);
4150
- } catch (err) {
4151
- if (err instanceof Error) {
4152
- let dummy = {};
4153
-
4154
- Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
4155
-
4156
- // slice off the Error: ... line
4157
- const stack = (() => {
4158
- if (!dummy.stack) {
4159
- return '';
4160
- }
4161
-
4162
- const firstNewlineIndex = dummy.stack.indexOf('\n');
4163
-
4164
- return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1);
4165
- })();
4166
- try {
4167
- if (!err.stack) {
4168
- err.stack = stack;
4169
- // match without the 2 top stack lines
4170
- } else if (stack) {
4171
- const firstNewlineIndex = stack.indexOf('\n');
4172
- const secondNewlineIndex =
4173
- firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1);
4174
- const stackWithoutTwoTopLines =
4175
- secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);
4176
-
4177
- if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
4178
- err.stack += '\n' + stack;
4179
- }
4180
- }
4181
- } catch (e) {
4182
- // ignore the case where "stack" is an un-writable property
4183
- }
4184
- }
4185
-
4186
- throw err;
4187
- }
4188
- }
4189
-
4190
- _request(configOrUrl, config) {
4191
- /*eslint no-param-reassign:0*/
4192
- // Allow for axios('example/url'[, config]) a la fetch API
4193
- if (typeof configOrUrl === 'string') {
4194
- config = config || {};
4195
- config.url = configOrUrl;
4196
- } else {
4197
- config = configOrUrl || {};
4198
- }
4199
-
4200
- config = mergeConfig$1(this.defaults, config);
4201
-
4202
- const { transitional, paramsSerializer, headers } = config;
4203
-
4204
- if (transitional !== undefined) {
4205
- validator.assertOptions(
4206
- transitional,
4207
- {
4208
- silentJSONParsing: validators.transitional(validators.boolean),
4209
- forcedJSONParsing: validators.transitional(validators.boolean),
4210
- clarifyTimeoutError: validators.transitional(validators.boolean),
4211
- legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),
4212
- },
4213
- false
4214
- );
4215
- }
4216
-
4217
- if (paramsSerializer != null) {
4218
- if (utils$1.isFunction(paramsSerializer)) {
4219
- config.paramsSerializer = {
4220
- serialize: paramsSerializer,
4221
- };
4222
- } else {
4223
- validator.assertOptions(
4224
- paramsSerializer,
4225
- {
4226
- encode: validators.function,
4227
- serialize: validators.function,
4228
- },
4229
- true
4230
- );
4231
- }
4232
- }
4233
-
4234
- // Set config.allowAbsoluteUrls
4235
- if (config.allowAbsoluteUrls !== undefined) ; else if (this.defaults.allowAbsoluteUrls !== undefined) {
4236
- config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
4237
- } else {
4238
- config.allowAbsoluteUrls = true;
4239
- }
4240
-
4241
- validator.assertOptions(
4242
- config,
4243
- {
4244
- baseUrl: validators.spelling('baseURL'),
4245
- withXsrfToken: validators.spelling('withXSRFToken'),
4246
- },
4247
- true
4248
- );
4249
-
4250
- // Set config.method
4251
- config.method = (config.method || this.defaults.method || 'get').toLowerCase();
4252
-
4253
- // Flatten headers
4254
- let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
4255
-
4256
- headers &&
4257
- utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], (method) => {
4258
- delete headers[method];
4259
- });
4260
-
4261
- config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
4262
-
4263
- // filter out skipped interceptors
4264
- const requestInterceptorChain = [];
4265
- let synchronousRequestInterceptors = true;
4266
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
4267
- if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
4268
- return;
4269
- }
4270
-
4271
- synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
4272
-
4273
- const transitional = config.transitional || transitionalDefaults;
4274
- const legacyInterceptorReqResOrdering =
4275
- transitional && transitional.legacyInterceptorReqResOrdering;
4276
-
4277
- if (legacyInterceptorReqResOrdering) {
4278
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
4279
- } else {
4280
- requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
4281
- }
4282
- });
4283
-
4284
- const responseInterceptorChain = [];
4285
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
4286
- responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
4287
- });
4288
-
4289
- let promise;
4290
- let i = 0;
4291
- let len;
4292
-
4293
- if (!synchronousRequestInterceptors) {
4294
- const chain = [dispatchRequest.bind(this), undefined];
4295
- chain.unshift(...requestInterceptorChain);
4296
- chain.push(...responseInterceptorChain);
4297
- len = chain.length;
4298
-
4299
- promise = Promise.resolve(config);
4300
-
4301
- while (i < len) {
4302
- promise = promise.then(chain[i++], chain[i++]);
4303
- }
4304
-
4305
- return promise;
4306
- }
4307
-
4308
- len = requestInterceptorChain.length;
4309
-
4310
- let newConfig = config;
4311
-
4312
- while (i < len) {
4313
- const onFulfilled = requestInterceptorChain[i++];
4314
- const onRejected = requestInterceptorChain[i++];
4315
- try {
4316
- newConfig = onFulfilled(newConfig);
4317
- } catch (error) {
4318
- onRejected.call(this, error);
4319
- break;
4320
- }
4321
- }
4322
-
4323
- try {
4324
- promise = dispatchRequest.call(this, newConfig);
4325
- } catch (error) {
4326
- return Promise.reject(error);
4327
- }
4328
-
4329
- i = 0;
4330
- len = responseInterceptorChain.length;
4331
-
4332
- while (i < len) {
4333
- promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
4334
- }
4335
-
4336
- return promise;
4337
- }
4338
-
4339
- getUri(config) {
4340
- config = mergeConfig$1(this.defaults, config);
4341
- const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
4342
- return buildURL(fullPath, config.params, config.paramsSerializer);
4343
- }
4344
- };
4345
-
4346
- // Provide aliases for supported request methods
4347
- utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
4348
- /*eslint func-names:0*/
4349
- Axios$1.prototype[method] = function (url, config) {
4350
- return this.request(
4351
- mergeConfig$1(config || {}, {
4352
- method,
4353
- url,
4354
- data: (config || {}).data,
4355
- })
4356
- );
4357
- };
4358
- });
4359
-
4360
- utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {
4361
- function generateHTTPMethod(isForm) {
4362
- return function httpMethod(url, data, config) {
4363
- return this.request(
4364
- mergeConfig$1(config || {}, {
4365
- method,
4366
- headers: isForm
4367
- ? {
4368
- 'Content-Type': 'multipart/form-data',
4369
- }
4370
- : {},
4371
- url,
4372
- data,
4373
- })
4374
- );
4375
- };
4376
- }
4377
-
4378
- Axios$1.prototype[method] = generateHTTPMethod();
4379
-
4380
- // QUERY is a safe/idempotent read method; multipart form bodies don't fit
4381
- // its semantics, so no queryForm shorthand is generated.
4382
- if (method !== 'query') {
4383
- Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
4384
- }
4385
- });
4386
-
4387
- /**
4388
- * A `CancelToken` is an object that can be used to request cancellation of an operation.
4389
- *
4390
- * @param {Function} executor The executor function.
4391
- *
4392
- * @returns {CancelToken}
4393
- */
4394
- let CancelToken$1 = class CancelToken {
4395
- constructor(executor) {
4396
- if (typeof executor !== 'function') {
4397
- throw new TypeError('executor must be a function.');
4398
- }
4399
-
4400
- let resolvePromise;
4401
-
4402
- this.promise = new Promise(function promiseExecutor(resolve) {
4403
- resolvePromise = resolve;
4404
- });
4405
-
4406
- const token = this;
4407
-
4408
- // eslint-disable-next-line func-names
4409
- this.promise.then((cancel) => {
4410
- if (!token._listeners) return;
4411
-
4412
- let i = token._listeners.length;
4413
-
4414
- while (i-- > 0) {
4415
- token._listeners[i](cancel);
4416
- }
4417
- token._listeners = null;
4418
- });
4419
-
4420
- // eslint-disable-next-line func-names
4421
- this.promise.then = (onfulfilled) => {
4422
- let _resolve;
4423
- // eslint-disable-next-line func-names
4424
- const promise = new Promise((resolve) => {
4425
- token.subscribe(resolve);
4426
- _resolve = resolve;
4427
- }).then(onfulfilled);
4428
-
4429
- promise.cancel = function reject() {
4430
- token.unsubscribe(_resolve);
4431
- };
4432
-
4433
- return promise;
4434
- };
4435
-
4436
- executor(function cancel(message, config, request) {
4437
- if (token.reason) {
4438
- // Cancellation has already been requested
4439
- return;
4440
- }
4441
-
4442
- token.reason = new CanceledError$1(message, config, request);
4443
- resolvePromise(token.reason);
4444
- });
4445
- }
4446
-
4447
- /**
4448
- * Throws a `CanceledError` if cancellation has been requested.
4449
- */
4450
- throwIfRequested() {
4451
- if (this.reason) {
4452
- throw this.reason;
4453
- }
4454
- }
4455
-
4456
- /**
4457
- * Subscribe to the cancel signal
4458
- */
4459
-
4460
- subscribe(listener) {
4461
- if (this.reason) {
4462
- listener(this.reason);
4463
- return;
4464
- }
4465
-
4466
- if (this._listeners) {
4467
- this._listeners.push(listener);
4468
- } else {
4469
- this._listeners = [listener];
4470
- }
4471
- }
4472
-
4473
- /**
4474
- * Unsubscribe from the cancel signal
4475
- */
4476
-
4477
- unsubscribe(listener) {
4478
- if (!this._listeners) {
4479
- return;
4480
- }
4481
- const index = this._listeners.indexOf(listener);
4482
- if (index !== -1) {
4483
- this._listeners.splice(index, 1);
4484
- }
4485
- }
4486
-
4487
- toAbortSignal() {
4488
- const controller = new AbortController();
4489
-
4490
- const abort = (err) => {
4491
- controller.abort(err);
4492
- };
4493
-
4494
- this.subscribe(abort);
4495
-
4496
- controller.signal.unsubscribe = () => this.unsubscribe(abort);
4497
-
4498
- return controller.signal;
4499
- }
4500
-
4501
- /**
4502
- * Returns an object that contains a new `CancelToken` and a function that, when called,
4503
- * cancels the `CancelToken`.
4504
- */
4505
- static source() {
4506
- let cancel;
4507
- const token = new CancelToken(function executor(c) {
4508
- cancel = c;
4509
- });
4510
- return {
4511
- token,
4512
- cancel,
4513
- };
4514
- }
4515
- };
4516
-
4517
- /**
4518
- * Syntactic sugar for invoking a function and expanding an array for arguments.
4519
- *
4520
- * Common use case would be to use `Function.prototype.apply`.
4521
- *
4522
- * ```js
4523
- * function f(x, y, z) {}
4524
- * const args = [1, 2, 3];
4525
- * f.apply(null, args);
4526
- * ```
4527
- *
4528
- * With `spread` this example can be re-written.
4529
- *
4530
- * ```js
4531
- * spread(function(x, y, z) {})([1, 2, 3]);
4532
- * ```
4533
- *
4534
- * @param {Function} callback
4535
- *
4536
- * @returns {Function}
4537
- */
4538
- function spread$1(callback) {
4539
- return function wrap(arr) {
4540
- return callback.apply(null, arr);
4541
- };
4542
- }
4543
-
4544
- /**
4545
- * Determines whether the payload is an error thrown by Axios
4546
- *
4547
- * @param {*} payload The value to test
4548
- *
4549
- * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
4550
- */
4551
- function isAxiosError$1(payload) {
4552
- return utils$1.isObject(payload) && payload.isAxiosError === true;
4553
- }
4554
-
4555
- const HttpStatusCode$1 = {
4556
- Continue: 100,
4557
- SwitchingProtocols: 101,
4558
- Processing: 102,
4559
- EarlyHints: 103,
4560
- Ok: 200,
4561
- Created: 201,
4562
- Accepted: 202,
4563
- NonAuthoritativeInformation: 203,
4564
- NoContent: 204,
4565
- ResetContent: 205,
4566
- PartialContent: 206,
4567
- MultiStatus: 207,
4568
- AlreadyReported: 208,
4569
- ImUsed: 226,
4570
- MultipleChoices: 300,
4571
- MovedPermanently: 301,
4572
- Found: 302,
4573
- SeeOther: 303,
4574
- NotModified: 304,
4575
- UseProxy: 305,
4576
- Unused: 306,
4577
- TemporaryRedirect: 307,
4578
- PermanentRedirect: 308,
4579
- BadRequest: 400,
4580
- Unauthorized: 401,
4581
- PaymentRequired: 402,
4582
- Forbidden: 403,
4583
- NotFound: 404,
4584
- MethodNotAllowed: 405,
4585
- NotAcceptable: 406,
4586
- ProxyAuthenticationRequired: 407,
4587
- RequestTimeout: 408,
4588
- Conflict: 409,
4589
- Gone: 410,
4590
- LengthRequired: 411,
4591
- PreconditionFailed: 412,
4592
- PayloadTooLarge: 413,
4593
- UriTooLong: 414,
4594
- UnsupportedMediaType: 415,
4595
- RangeNotSatisfiable: 416,
4596
- ExpectationFailed: 417,
4597
- ImATeapot: 418,
4598
- MisdirectedRequest: 421,
4599
- UnprocessableEntity: 422,
4600
- Locked: 423,
4601
- FailedDependency: 424,
4602
- TooEarly: 425,
4603
- UpgradeRequired: 426,
4604
- PreconditionRequired: 428,
4605
- TooManyRequests: 429,
4606
- RequestHeaderFieldsTooLarge: 431,
4607
- UnavailableForLegalReasons: 451,
4608
- InternalServerError: 500,
4609
- NotImplemented: 501,
4610
- BadGateway: 502,
4611
- ServiceUnavailable: 503,
4612
- GatewayTimeout: 504,
4613
- HttpVersionNotSupported: 505,
4614
- VariantAlsoNegotiates: 506,
4615
- InsufficientStorage: 507,
4616
- LoopDetected: 508,
4617
- NotExtended: 510,
4618
- NetworkAuthenticationRequired: 511,
4619
- WebServerIsDown: 521,
4620
- ConnectionTimedOut: 522,
4621
- OriginIsUnreachable: 523,
4622
- TimeoutOccurred: 524,
4623
- SslHandshakeFailed: 525,
4624
- InvalidSslCertificate: 526,
4625
- };
4626
-
4627
- Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
4628
- HttpStatusCode$1[value] = key;
4629
- });
4630
-
4631
- /**
4632
- * Create an instance of Axios
4633
- *
4634
- * @param {Object} defaultConfig The default config for the instance
4635
- *
4636
- * @returns {Axios} A new instance of Axios
4637
- */
4638
- function createInstance(defaultConfig) {
4639
- const context = new Axios$1(defaultConfig);
4640
- const instance = bind(Axios$1.prototype.request, context);
4641
-
4642
- // Copy axios.prototype to instance
4643
- utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
4644
-
4645
- // Copy context to instance
4646
- utils$1.extend(instance, context, null, { allOwnKeys: true });
4647
-
4648
- // Factory for creating new instances
4649
- instance.create = function create(instanceConfig) {
4650
- return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
4651
- };
4652
-
4653
- return instance;
4654
- }
4655
-
4656
- // Create the default instance to be exported
4657
- const axios = createInstance(defaults);
4658
-
4659
- // Expose Axios class to allow class inheritance
4660
- axios.Axios = Axios$1;
4661
-
4662
- // Expose Cancel & CancelToken
4663
- axios.CanceledError = CanceledError$1;
4664
- axios.CancelToken = CancelToken$1;
4665
- axios.isCancel = isCancel$1;
4666
- axios.VERSION = VERSION$1;
4667
- axios.toFormData = toFormData$1;
4668
-
4669
- // Expose AxiosError class
4670
- axios.AxiosError = AxiosError$1;
4671
-
4672
- // alias for CanceledError for backward compatibility
4673
- axios.Cancel = axios.CanceledError;
4674
-
4675
- // Expose all/spread
4676
- axios.all = function all(promises) {
4677
- return Promise.all(promises);
4678
- };
4679
-
4680
- axios.spread = spread$1;
4681
-
4682
- // Expose isAxiosError
4683
- axios.isAxiosError = isAxiosError$1;
4684
-
4685
- // Expose mergeConfig
4686
- axios.mergeConfig = mergeConfig$1;
4687
-
4688
- axios.AxiosHeaders = AxiosHeaders$1;
4689
-
4690
- axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
4691
-
4692
- axios.getAdapter = adapters.getAdapter;
4693
-
4694
- axios.HttpStatusCode = HttpStatusCode$1;
4695
-
4696
- axios.default = axios;
4697
-
4698
- // This module is intended to unwrap Axios default export as named.
4699
- // Keep top-level export same with static properties
4700
- // so that it can keep same with es module or cjs
4701
- const {
4702
- Axios,
4703
- AxiosError,
4704
- CanceledError,
4705
- isCancel,
4706
- CancelToken,
4707
- VERSION,
4708
- all,
4709
- Cancel,
4710
- isAxiosError,
4711
- spread,
4712
- toFormData,
4713
- AxiosHeaders,
4714
- HttpStatusCode,
4715
- formToJSON,
4716
- getAdapter,
4717
- mergeConfig,
4718
- create,
4719
- } = axios;
4720
-
4721
- export { Axios, AxiosError, AxiosHeaders, Cancel, CancelToken, CanceledError, HttpStatusCode, VERSION, all, create, axios as default, formToJSON, getAdapter, isAxiosError, isCancel, mergeConfig, spread, toFormData };
4722
- //# sourceMappingURL=axios.js.map