@mavogel/awscdk-rootmail 0.0.334 → 0.0.335

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