@cirkay-eng/cirkay-components 0.7.2 → 0.7.4
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.
- package/dist/base/magic/MagicAPI.d.ts.map +1 -1
- package/dist/base/magic/MagicAPI.js +4 -3
- package/dist/base/magic/MagicAPI.js.map +1 -1
- package/dist/base/n3xus/N3xusAPI.d.ts +8 -5
- package/dist/base/n3xus/N3xusAPI.d.ts.map +1 -1
- package/dist/base/n3xus/N3xusAPI.js +110 -49
- package/dist/base/n3xus/N3xusAPI.js.map +1 -1
- package/dist/base/n3xus/types.d.ts +67 -24
- package/dist/base/n3xus/types.d.ts.map +1 -1
- package/dist/base/n3xus/types.js +1 -0
- package/dist/base/n3xus/types.js.map +1 -1
- package/dist/components/connected/connected.d.ts +33 -0
- package/dist/components/connected/connected.d.ts.map +1 -0
- package/dist/components/connected/connected.js +586 -0
- package/dist/components/connected/connected.js.map +1 -0
- package/dist/components/connected/index.d.ts +8 -0
- package/dist/components/connected/index.d.ts.map +1 -0
- package/dist/components/connected/index.js +6 -0
- package/dist/components/connected/index.js.map +1 -0
- package/dist/components/error-screen/error-screen.d.ts +4 -3
- package/dist/components/error-screen/error-screen.d.ts.map +1 -1
- package/dist/components/error-screen/error-screen.js +6 -11
- package/dist/components/error-screen/error-screen.js.map +1 -1
- package/dist/components/error-screen/index.d.ts +6 -1
- package/dist/components/error-screen/index.d.ts.map +1 -1
- package/dist/components/error-screen/index.js +6 -0
- package/dist/components/error-screen/index.js.map +1 -0
- package/dist/components/fan-pass-claim/fan-pass-claim.d.ts +32 -14
- package/dist/components/fan-pass-claim/fan-pass-claim.d.ts.map +1 -1
- package/dist/components/fan-pass-claim/fan-pass-claim.js +749 -322
- package/dist/components/fan-pass-claim/fan-pass-claim.js.map +1 -1
- package/dist/components/fan-pass-claim/index.d.ts +8 -2
- package/dist/components/fan-pass-claim/index.d.ts.map +1 -1
- package/dist/components/fan-pass-claim/index.js +6 -0
- package/dist/components/fan-pass-claim/index.js.map +1 -0
- package/dist/components/fan-pass-claim/types.d.ts +7 -0
- package/dist/components/fan-pass-claim/types.d.ts.map +1 -1
- package/dist/components/fan-pass-claim/types.js +9 -1
- package/dist/components/fan-pass-claim/types.js.map +1 -1
- package/dist/components/fan-pass-unlock/fan-pass-unlock.d.ts +31 -17
- package/dist/components/fan-pass-unlock/fan-pass-unlock.d.ts.map +1 -1
- package/dist/components/fan-pass-unlock/fan-pass-unlock.js +539 -198
- package/dist/components/fan-pass-unlock/fan-pass-unlock.js.map +1 -1
- package/dist/components/fan-pass-unlock/index.d.ts +8 -2
- package/dist/components/fan-pass-unlock/index.d.ts.map +1 -1
- package/dist/components/fan-pass-unlock/index.js +6 -0
- package/dist/components/fan-pass-unlock/index.js.map +1 -0
- package/dist/components/frame/frame.d.ts +1 -0
- package/dist/components/frame/frame.d.ts.map +1 -1
- package/dist/components/frame/frame.js +48 -20
- package/dist/components/frame/frame.js.map +1 -1
- package/dist/components/frame/index.d.ts +6 -1
- package/dist/components/frame/index.d.ts.map +1 -1
- package/dist/components/frame/index.js +6 -0
- package/dist/components/frame/index.js.map +1 -0
- package/dist/components/index.d.ts +4 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +7 -3
- package/dist/components/index.js.map +1 -1
- package/dist/components/login/index.d.ts +6 -1
- package/dist/components/login/index.d.ts.map +1 -1
- package/dist/components/login/index.js +6 -0
- package/dist/components/login/index.js.map +1 -0
- package/dist/components/login/login.d.ts +4 -3
- package/dist/components/login/login.d.ts.map +1 -1
- package/dist/components/login/login.js +97 -38
- package/dist/components/login/login.js.map +1 -1
- package/dist/components/login/types.d.ts +4 -0
- package/dist/components/login/types.d.ts.map +1 -1
- package/dist/components/mobile-pass/index.d.ts +8 -0
- package/dist/components/mobile-pass/index.d.ts.map +1 -0
- package/dist/components/mobile-pass/index.js +6 -0
- package/dist/components/mobile-pass/index.js.map +1 -0
- package/dist/components/mobile-pass/mobile-pass.d.ts +20 -0
- package/dist/components/mobile-pass/mobile-pass.d.ts.map +1 -0
- package/dist/components/mobile-pass/mobile-pass.js +150 -0
- package/dist/components/mobile-pass/mobile-pass.js.map +1 -0
- package/dist/constants/components.d.ts +1 -1
- package/dist/constants/components.d.ts.map +1 -1
- package/dist/constants/components.js +1 -1
- package/dist/controllers/LoginController.d.ts +33 -5
- package/dist/controllers/LoginController.d.ts.map +1 -1
- package/dist/controllers/LoginController.js +38 -24
- package/dist/controllers/LoginController.js.map +1 -1
- package/dist/docs/error-screen/designTokens.d.ts +1 -3
- package/dist/docs/error-screen/designTokens.d.ts.map +1 -1
- package/dist/docs/fan-pass-claim/designTokens.d.ts.map +1 -1
- package/dist/docs/fan-pass-claim/fan-pass-claim.stories.d.ts +1 -1
- package/dist/docs/fan-pass-claim/fan-pass-claim.stories.d.ts.map +1 -1
- package/dist/docs/fan-pass-unlock/designTokens.d.ts.map +1 -1
- package/dist/docs/fan-pass-unlock/fan-pass-unlock.stories.d.ts +1 -1
- package/dist/docs/fan-pass-unlock/fan-pass-unlock.stories.d.ts.map +1 -1
- package/dist/docs/login/designTokens.d.ts +1 -3
- package/dist/docs/login/designTokens.d.ts.map +1 -1
- package/dist/docs/login/login.stories.d.ts +1 -1
- package/dist/docs/login/login.stories.d.ts.map +1 -1
- package/dist/docs/mobile-pass/designTokens.d.ts +3 -0
- package/dist/docs/mobile-pass/designTokens.d.ts.map +1 -0
- package/dist/docs/mobile-pass/mobile-pass.stories.d.ts +6 -0
- package/dist/docs/mobile-pass/mobile-pass.stories.d.ts.map +1 -0
- package/dist/events/claim.d.ts +2 -1
- package/dist/events/claim.d.ts.map +1 -1
- package/dist/events/claim.js.map +1 -1
- package/dist/events/login.d.ts +8 -1
- package/dist/events/login.d.ts.map +1 -1
- package/dist/events/login.js +1 -0
- package/dist/events/login.js.map +1 -1
- package/dist/events/unlock.d.ts +15 -1
- package/dist/events/unlock.d.ts.map +1 -1
- package/dist/events/unlock.js +2 -0
- package/dist/events/unlock.js.map +1 -1
- package/dist/internal/CirkayElement.d.ts.map +1 -1
- package/dist/internal/CirkayElement.js +0 -2
- package/dist/internal/CirkayElement.js.map +1 -1
- package/dist/node_modules/.pnpm/@magic-sdk_provider@28.20.0_localforage@1.10.0/node_modules/@magic-sdk/provider/dist/es/index.js +10 -0
- package/dist/node_modules/.pnpm/@magic-sdk_provider@28.20.0_localforage@1.10.0/node_modules/@magic-sdk/provider/dist/es/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@magic-sdk_types@24.18.0/node_modules/@magic-sdk/types/dist/es/index.js +4 -0
- package/dist/node_modules/.pnpm/@magic-sdk_types@24.18.0/node_modules/@magic-sdk/types/dist/es/index.js.map +1 -0
- package/dist/node_modules/.pnpm/{@rollup_plugin-typescript@12.1.2_rollup@4.29.1_tslib@2.8.1_typescript@5.7.2 → @rollup_plugin-typescript@12.1.2_rollup@4.34.6_tslib@2.8.1_typescript@5.7.3}/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@12.1.2_rollup@4.34.8_tslib@2.8.1_typescript@5.7.3/node_modules/tslib/tslib.es6.js +31 -0
- package/dist/node_modules/.pnpm/@rollup_plugin-typescript@12.1.2_rollup@4.34.8_tslib@2.8.1_typescript@5.7.3/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/node_modules/.pnpm/magic-sdk@28.21.1/node_modules/magic-sdk/dist/es/index.js +9 -0
- package/dist/node_modules/.pnpm/magic-sdk@28.21.1/node_modules/magic-sdk/dist/es/index.js.map +1 -0
- package/dist/utils/helpers.d.ts +26 -2
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/helpers.js +65 -7
- package/dist/utils/helpers.js.map +1 -1
- package/package.json +21 -16
- package/dist/_virtual/_commonjsHelpers.js +0 -6
- package/dist/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/_virtual/index.js +0 -8
- package/dist/_virtual/index.js.map +0 -1
- package/dist/node_modules/.pnpm/axios-rate-limit@1.4.0_axios@1.7.9/node_modules/axios-rate-limit/src/index.js +0 -182
- package/dist/node_modules/.pnpm/axios-rate-limit@1.4.0_axios@1.7.9/node_modules/axios-rate-limit/src/index.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/adapters/adapters.js +0 -82
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/adapters/adapters.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/adapters/fetch.js +0 -230
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/adapters/fetch.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/adapters/xhr.js +0 -200
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/adapters/xhr.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/axios.js +0 -87
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/axios.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/cancel/CancelToken.js +0 -134
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/cancel/CancelToken.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/cancel/CanceledError.js +0 -24
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/cancel/CanceledError.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/cancel/isCancel.js +0 -6
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/cancel/isCancel.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/Axios.js +0 -232
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/Axios.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/AxiosError.js +0 -102
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/AxiosError.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/AxiosHeaders.js +0 -301
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/AxiosHeaders.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/InterceptorManager.js +0 -70
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/InterceptorManager.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/buildFullPath.js +0 -22
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/buildFullPath.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/dispatchRequest.js +0 -82
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/dispatchRequest.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/mergeConfig.js +0 -107
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/mergeConfig.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/settle.js +0 -28
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/settle.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/transformData.js +0 -29
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/transformData.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/defaults/index.js +0 -160
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/defaults/index.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/defaults/transitional.js +0 -8
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/defaults/transitional.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/env/data.js +0 -4
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/env/data.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -57
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/AxiosURLSearchParams.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -72
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/HttpStatusCode.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/bind.js +0 -8
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/bind.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/buildURL.js +0 -70
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/buildURL.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/combineURLs.js +0 -16
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/combineURLs.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/composeSignals.js +0 -49
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/composeSignals.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/cookies.js +0 -44
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/cookies.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/formDataToJSON.js +0 -94
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/formDataToJSON.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -16
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/isAbsoluteURL.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/isAxiosError.js +0 -15
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/isAxiosError.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -17
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/isURLSameOrigin.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/null.js +0 -5
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/null.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/parseHeaders.js +0 -56
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/parseHeaders.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/parseProtocol.js +0 -7
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/parseProtocol.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/progressEventReducer.js +0 -47
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/progressEventReducer.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/resolveConfig.js +0 -59
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/resolveConfig.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/speedometer.js +0 -54
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/speedometer.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/spread.js +0 -29
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/spread.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/throttle.js +0 -45
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/throttle.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/toFormData.js +0 -216
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/toFormData.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -19
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/toURLEncodedForm.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/trackStream.js +0 -89
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/trackStream.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/validator.js +0 -100
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/helpers/validator.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -4
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/browser/classes/Blob.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -4
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/browser/classes/FormData.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -6
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/browser/index.js +0 -16
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/browser/index.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/common/utils.js +0 -46
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/common/utils.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/index.js +0 -10
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/platform/index.js.map +0 -1
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/utils.js +0 -761
- package/dist/node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/utils.js.map +0 -1
- package/dist/utils/settings.js +0 -7
- package/dist/utils/settings.js.map +0 -1
- /package/dist/node_modules/.pnpm/{@rollup_plugin-typescript@12.1.2_rollup@4.29.1_tslib@2.8.1_typescript@5.7.2 → @rollup_plugin-typescript@12.1.2_rollup@4.34.6_tslib@2.8.1_typescript@5.7.3}/node_modules/tslib/tslib.es6.js +0 -0
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import utils from '../utils.js';
|
|
2
|
-
import buildURL from '../helpers/buildURL.js';
|
|
3
|
-
import InterceptorManager from './InterceptorManager.js';
|
|
4
|
-
import dispatchRequest from './dispatchRequest.js';
|
|
5
|
-
import mergeConfig from './mergeConfig.js';
|
|
6
|
-
import buildFullPath from './buildFullPath.js';
|
|
7
|
-
import validator from '../helpers/validator.js';
|
|
8
|
-
import AxiosHeaders from './AxiosHeaders.js';
|
|
9
|
-
|
|
10
|
-
const validators = validator.validators;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Create a new instance of Axios
|
|
14
|
-
*
|
|
15
|
-
* @param {Object} instanceConfig The default config for the instance
|
|
16
|
-
*
|
|
17
|
-
* @return {Axios} A new instance of Axios
|
|
18
|
-
*/
|
|
19
|
-
class Axios {
|
|
20
|
-
constructor(instanceConfig) {
|
|
21
|
-
this.defaults = instanceConfig;
|
|
22
|
-
this.interceptors = {
|
|
23
|
-
request: new InterceptorManager(),
|
|
24
|
-
response: new InterceptorManager()
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Dispatch a request
|
|
30
|
-
*
|
|
31
|
-
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
|
|
32
|
-
* @param {?Object} config
|
|
33
|
-
*
|
|
34
|
-
* @returns {Promise} The Promise to be fulfilled
|
|
35
|
-
*/
|
|
36
|
-
async request(configOrUrl, config) {
|
|
37
|
-
try {
|
|
38
|
-
return await this._request(configOrUrl, config);
|
|
39
|
-
} catch (err) {
|
|
40
|
-
if (err instanceof Error) {
|
|
41
|
-
let dummy = {};
|
|
42
|
-
|
|
43
|
-
Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
|
|
44
|
-
|
|
45
|
-
// slice off the Error: ... line
|
|
46
|
-
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
|
47
|
-
try {
|
|
48
|
-
if (!err.stack) {
|
|
49
|
-
err.stack = stack;
|
|
50
|
-
// match without the 2 top stack lines
|
|
51
|
-
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
|
|
52
|
-
err.stack += '\n' + stack;
|
|
53
|
-
}
|
|
54
|
-
} catch (e) {
|
|
55
|
-
// ignore the case where "stack" is an un-writable property
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
throw err;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
_request(configOrUrl, config) {
|
|
64
|
-
/*eslint no-param-reassign:0*/
|
|
65
|
-
// Allow for axios('example/url'[, config]) a la fetch API
|
|
66
|
-
if (typeof configOrUrl === 'string') {
|
|
67
|
-
config = config || {};
|
|
68
|
-
config.url = configOrUrl;
|
|
69
|
-
} else {
|
|
70
|
-
config = configOrUrl || {};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
config = mergeConfig(this.defaults, config);
|
|
74
|
-
|
|
75
|
-
const {transitional, paramsSerializer, headers} = config;
|
|
76
|
-
|
|
77
|
-
if (transitional !== undefined) {
|
|
78
|
-
validator.assertOptions(transitional, {
|
|
79
|
-
silentJSONParsing: validators.transitional(validators.boolean),
|
|
80
|
-
forcedJSONParsing: validators.transitional(validators.boolean),
|
|
81
|
-
clarifyTimeoutError: validators.transitional(validators.boolean)
|
|
82
|
-
}, false);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (paramsSerializer != null) {
|
|
86
|
-
if (utils.isFunction(paramsSerializer)) {
|
|
87
|
-
config.paramsSerializer = {
|
|
88
|
-
serialize: paramsSerializer
|
|
89
|
-
};
|
|
90
|
-
} else {
|
|
91
|
-
validator.assertOptions(paramsSerializer, {
|
|
92
|
-
encode: validators.function,
|
|
93
|
-
serialize: validators.function
|
|
94
|
-
}, true);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
validator.assertOptions(config, {
|
|
99
|
-
baseUrl: validators.spelling('baseURL'),
|
|
100
|
-
withXsrfToken: validators.spelling('withXSRFToken')
|
|
101
|
-
}, true);
|
|
102
|
-
|
|
103
|
-
// Set config.method
|
|
104
|
-
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
|
|
105
|
-
|
|
106
|
-
// Flatten headers
|
|
107
|
-
let contextHeaders = headers && utils.merge(
|
|
108
|
-
headers.common,
|
|
109
|
-
headers[config.method]
|
|
110
|
-
);
|
|
111
|
-
|
|
112
|
-
headers && utils.forEach(
|
|
113
|
-
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
|
|
114
|
-
(method) => {
|
|
115
|
-
delete headers[method];
|
|
116
|
-
}
|
|
117
|
-
);
|
|
118
|
-
|
|
119
|
-
config.headers = AxiosHeaders.concat(contextHeaders, headers);
|
|
120
|
-
|
|
121
|
-
// filter out skipped interceptors
|
|
122
|
-
const requestInterceptorChain = [];
|
|
123
|
-
let synchronousRequestInterceptors = true;
|
|
124
|
-
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
125
|
-
if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
130
|
-
|
|
131
|
-
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
const responseInterceptorChain = [];
|
|
135
|
-
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
|
|
136
|
-
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
let promise;
|
|
140
|
-
let i = 0;
|
|
141
|
-
let len;
|
|
142
|
-
|
|
143
|
-
if (!synchronousRequestInterceptors) {
|
|
144
|
-
const chain = [dispatchRequest.bind(this), undefined];
|
|
145
|
-
chain.unshift.apply(chain, requestInterceptorChain);
|
|
146
|
-
chain.push.apply(chain, responseInterceptorChain);
|
|
147
|
-
len = chain.length;
|
|
148
|
-
|
|
149
|
-
promise = Promise.resolve(config);
|
|
150
|
-
|
|
151
|
-
while (i < len) {
|
|
152
|
-
promise = promise.then(chain[i++], chain[i++]);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
return promise;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
len = requestInterceptorChain.length;
|
|
159
|
-
|
|
160
|
-
let newConfig = config;
|
|
161
|
-
|
|
162
|
-
i = 0;
|
|
163
|
-
|
|
164
|
-
while (i < len) {
|
|
165
|
-
const onFulfilled = requestInterceptorChain[i++];
|
|
166
|
-
const onRejected = requestInterceptorChain[i++];
|
|
167
|
-
try {
|
|
168
|
-
newConfig = onFulfilled(newConfig);
|
|
169
|
-
} catch (error) {
|
|
170
|
-
onRejected.call(this, error);
|
|
171
|
-
break;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
try {
|
|
176
|
-
promise = dispatchRequest.call(this, newConfig);
|
|
177
|
-
} catch (error) {
|
|
178
|
-
return Promise.reject(error);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
i = 0;
|
|
182
|
-
len = responseInterceptorChain.length;
|
|
183
|
-
|
|
184
|
-
while (i < len) {
|
|
185
|
-
promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
return promise;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
getUri(config) {
|
|
192
|
-
config = mergeConfig(this.defaults, config);
|
|
193
|
-
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
194
|
-
return buildURL(fullPath, config.params, config.paramsSerializer);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
// Provide aliases for supported request methods
|
|
199
|
-
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
|
|
200
|
-
/*eslint func-names:0*/
|
|
201
|
-
Axios.prototype[method] = function(url, config) {
|
|
202
|
-
return this.request(mergeConfig(config || {}, {
|
|
203
|
-
method,
|
|
204
|
-
url,
|
|
205
|
-
data: (config || {}).data
|
|
206
|
-
}));
|
|
207
|
-
};
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
|
|
211
|
-
/*eslint func-names:0*/
|
|
212
|
-
|
|
213
|
-
function generateHTTPMethod(isForm) {
|
|
214
|
-
return function httpMethod(url, data, config) {
|
|
215
|
-
return this.request(mergeConfig(config || {}, {
|
|
216
|
-
method,
|
|
217
|
-
headers: isForm ? {
|
|
218
|
-
'Content-Type': 'multipart/form-data'
|
|
219
|
-
} : {},
|
|
220
|
-
url,
|
|
221
|
-
data
|
|
222
|
-
}));
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
Axios.prototype[method] = generateHTTPMethod();
|
|
227
|
-
|
|
228
|
-
Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
export { Axios as default };
|
|
232
|
-
//# sourceMappingURL=Axios.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Axios.js","sources":["../../../../../../../../../../node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/Axios.js"],"sourcesContent":["'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n validator.assertOptions(config, {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken')\n }, true);\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n"],"names":[],"mappings":";;;;;;;;;AAWA,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,KAAK,CAAC;AACZ,EAAE,WAAW,CAAC,cAAc,EAAE;AAC9B,IAAI,IAAI,CAAC,QAAQ,GAAG,cAAc;AAClC,IAAI,IAAI,CAAC,YAAY,GAAG;AACxB,MAAM,OAAO,EAAE,IAAI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C,MAAM,EAAE;AAC/E;;AAEA,EAAE,SAAS,kBAAkB,CAAC,MAAM,EAAE;AACtC,IAAI,OAAO,SAAS,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE;AAClD,MAAM,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,IAAI,EAAE,EAAE;AACpD,QAAQ,MAAM;AACd,QAAQ,OAAO,EAAE,MAAM,GAAG;AAC1B,UAAU,cAAc,EAAE;AAC1B,SAAS,GAAG,EAAE;AACd,QAAQ,GAAG;AACX,QAAQ;AACR,OAAO,CAAC,CAAC;AACT,KAAK;AACL;;AAEA,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,kBAAkB,EAAE;;AAEhD,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,kBAAkB,CAAC,IAAI,CAAC;AAC7D,CAAC,CAAC;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import utils from '../utils.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Create an Error with the specified message, config, error code, request and response.
|
|
5
|
-
*
|
|
6
|
-
* @param {string} message The error message.
|
|
7
|
-
* @param {string} [code] The error code (for example, 'ECONNABORTED').
|
|
8
|
-
* @param {Object} [config] The config.
|
|
9
|
-
* @param {Object} [request] The request.
|
|
10
|
-
* @param {Object} [response] The response.
|
|
11
|
-
*
|
|
12
|
-
* @returns {Error} The created error.
|
|
13
|
-
*/
|
|
14
|
-
function AxiosError(message, code, config, request, response) {
|
|
15
|
-
Error.call(this);
|
|
16
|
-
|
|
17
|
-
if (Error.captureStackTrace) {
|
|
18
|
-
Error.captureStackTrace(this, this.constructor);
|
|
19
|
-
} else {
|
|
20
|
-
this.stack = (new Error()).stack;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
this.message = message;
|
|
24
|
-
this.name = 'AxiosError';
|
|
25
|
-
code && (this.code = code);
|
|
26
|
-
config && (this.config = config);
|
|
27
|
-
request && (this.request = request);
|
|
28
|
-
if (response) {
|
|
29
|
-
this.response = response;
|
|
30
|
-
this.status = response.status ? response.status : null;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
utils.inherits(AxiosError, Error, {
|
|
35
|
-
toJSON: function toJSON() {
|
|
36
|
-
return {
|
|
37
|
-
// Standard
|
|
38
|
-
message: this.message,
|
|
39
|
-
name: this.name,
|
|
40
|
-
// Microsoft
|
|
41
|
-
description: this.description,
|
|
42
|
-
number: this.number,
|
|
43
|
-
// Mozilla
|
|
44
|
-
fileName: this.fileName,
|
|
45
|
-
lineNumber: this.lineNumber,
|
|
46
|
-
columnNumber: this.columnNumber,
|
|
47
|
-
stack: this.stack,
|
|
48
|
-
// Axios
|
|
49
|
-
config: utils.toJSONObject(this.config),
|
|
50
|
-
code: this.code,
|
|
51
|
-
status: this.status
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
const prototype = AxiosError.prototype;
|
|
57
|
-
const descriptors = {};
|
|
58
|
-
|
|
59
|
-
[
|
|
60
|
-
'ERR_BAD_OPTION_VALUE',
|
|
61
|
-
'ERR_BAD_OPTION',
|
|
62
|
-
'ECONNABORTED',
|
|
63
|
-
'ETIMEDOUT',
|
|
64
|
-
'ERR_NETWORK',
|
|
65
|
-
'ERR_FR_TOO_MANY_REDIRECTS',
|
|
66
|
-
'ERR_DEPRECATED',
|
|
67
|
-
'ERR_BAD_RESPONSE',
|
|
68
|
-
'ERR_BAD_REQUEST',
|
|
69
|
-
'ERR_CANCELED',
|
|
70
|
-
'ERR_NOT_SUPPORT',
|
|
71
|
-
'ERR_INVALID_URL'
|
|
72
|
-
// eslint-disable-next-line func-names
|
|
73
|
-
].forEach(code => {
|
|
74
|
-
descriptors[code] = {value: code};
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
Object.defineProperties(AxiosError, descriptors);
|
|
78
|
-
Object.defineProperty(prototype, 'isAxiosError', {value: true});
|
|
79
|
-
|
|
80
|
-
// eslint-disable-next-line func-names
|
|
81
|
-
AxiosError.from = (error, code, config, request, response, customProps) => {
|
|
82
|
-
const axiosError = Object.create(prototype);
|
|
83
|
-
|
|
84
|
-
utils.toFlatObject(error, axiosError, function filter(obj) {
|
|
85
|
-
return obj !== Error.prototype;
|
|
86
|
-
}, prop => {
|
|
87
|
-
return prop !== 'isAxiosError';
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
AxiosError.call(axiosError, error.message, code, config, request, response);
|
|
91
|
-
|
|
92
|
-
axiosError.cause = error;
|
|
93
|
-
|
|
94
|
-
axiosError.name = error.name;
|
|
95
|
-
|
|
96
|
-
customProps && Object.assign(axiosError, customProps);
|
|
97
|
-
|
|
98
|
-
return axiosError;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export { AxiosError as default };
|
|
102
|
-
//# sourceMappingURL=AxiosError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AxiosError.js","sources":["../../../../../../../../../../node_modules/.pnpm/axios@1.7.9/node_modules/axios/lib/core/AxiosError.js"],"sourcesContent":["'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status ? response.status : null;\n }\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.status\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n"],"names":[],"mappings":";;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE;AAC9D,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;;AAElB,EAAE,IAAI,KAAK,CAAC,iBAAiB,EAAE;AAC/B,IAAI,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC;AACnD,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,KAA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AAEvD,EAAE,OAAO,UAAU;AACnB,CAAC;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
import utils from '../utils.js';
|
|
2
|
-
import parseHeaders from '../helpers/parseHeaders.js';
|
|
3
|
-
|
|
4
|
-
const $internals = Symbol('internals');
|
|
5
|
-
|
|
6
|
-
function normalizeHeader(header) {
|
|
7
|
-
return header && String(header).trim().toLowerCase();
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function normalizeValue(value) {
|
|
11
|
-
if (value === false || value == null) {
|
|
12
|
-
return value;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return utils.isArray(value) ? value.map(normalizeValue) : String(value);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function parseTokens(str) {
|
|
19
|
-
const tokens = Object.create(null);
|
|
20
|
-
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
21
|
-
let match;
|
|
22
|
-
|
|
23
|
-
while ((match = tokensRE.exec(str))) {
|
|
24
|
-
tokens[match[1]] = match[2];
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return tokens;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
|
|
31
|
-
|
|
32
|
-
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
|
|
33
|
-
if (utils.isFunction(filter)) {
|
|
34
|
-
return filter.call(this, value, header);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (isHeaderNameFilter) {
|
|
38
|
-
value = header;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (!utils.isString(value)) return;
|
|
42
|
-
|
|
43
|
-
if (utils.isString(filter)) {
|
|
44
|
-
return value.indexOf(filter) !== -1;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (utils.isRegExp(filter)) {
|
|
48
|
-
return filter.test(value);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function formatHeader(header) {
|
|
53
|
-
return header.trim()
|
|
54
|
-
.toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
|
|
55
|
-
return char.toUpperCase() + str;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function buildAccessors(obj, header) {
|
|
60
|
-
const accessorName = utils.toCamelCase(' ' + header);
|
|
61
|
-
|
|
62
|
-
['get', 'set', 'has'].forEach(methodName => {
|
|
63
|
-
Object.defineProperty(obj, methodName + accessorName, {
|
|
64
|
-
value: function(arg1, arg2, arg3) {
|
|
65
|
-
return this[methodName].call(this, header, arg1, arg2, arg3);
|
|
66
|
-
},
|
|
67
|
-
configurable: true
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
class AxiosHeaders {
|
|
73
|
-
constructor(headers) {
|
|
74
|
-
headers && this.set(headers);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
set(header, valueOrRewrite, rewrite) {
|
|
78
|
-
const self = this;
|
|
79
|
-
|
|
80
|
-
function setHeader(_value, _header, _rewrite) {
|
|
81
|
-
const lHeader = normalizeHeader(_header);
|
|
82
|
-
|
|
83
|
-
if (!lHeader) {
|
|
84
|
-
throw new Error('header name must be a non-empty string');
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const key = utils.findKey(self, lHeader);
|
|
88
|
-
|
|
89
|
-
if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
|
|
90
|
-
self[key || _header] = normalizeValue(_value);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const setHeaders = (headers, _rewrite) =>
|
|
95
|
-
utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
|
|
96
|
-
|
|
97
|
-
if (utils.isPlainObject(header) || header instanceof this.constructor) {
|
|
98
|
-
setHeaders(header, valueOrRewrite);
|
|
99
|
-
} else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
100
|
-
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
101
|
-
} else if (utils.isHeaders(header)) {
|
|
102
|
-
for (const [key, value] of header.entries()) {
|
|
103
|
-
setHeader(value, key, rewrite);
|
|
104
|
-
}
|
|
105
|
-
} else {
|
|
106
|
-
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return this;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
get(header, parser) {
|
|
113
|
-
header = normalizeHeader(header);
|
|
114
|
-
|
|
115
|
-
if (header) {
|
|
116
|
-
const key = utils.findKey(this, header);
|
|
117
|
-
|
|
118
|
-
if (key) {
|
|
119
|
-
const value = this[key];
|
|
120
|
-
|
|
121
|
-
if (!parser) {
|
|
122
|
-
return value;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (parser === true) {
|
|
126
|
-
return parseTokens(value);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (utils.isFunction(parser)) {
|
|
130
|
-
return parser.call(this, value, key);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (utils.isRegExp(parser)) {
|
|
134
|
-
return parser.exec(value);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
throw new TypeError('parser must be boolean|regexp|function');
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
has(header, matcher) {
|
|
143
|
-
header = normalizeHeader(header);
|
|
144
|
-
|
|
145
|
-
if (header) {
|
|
146
|
-
const key = utils.findKey(this, header);
|
|
147
|
-
|
|
148
|
-
return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
return false;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
delete(header, matcher) {
|
|
155
|
-
const self = this;
|
|
156
|
-
let deleted = false;
|
|
157
|
-
|
|
158
|
-
function deleteHeader(_header) {
|
|
159
|
-
_header = normalizeHeader(_header);
|
|
160
|
-
|
|
161
|
-
if (_header) {
|
|
162
|
-
const key = utils.findKey(self, _header);
|
|
163
|
-
|
|
164
|
-
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
|
|
165
|
-
delete self[key];
|
|
166
|
-
|
|
167
|
-
deleted = true;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
if (utils.isArray(header)) {
|
|
173
|
-
header.forEach(deleteHeader);
|
|
174
|
-
} else {
|
|
175
|
-
deleteHeader(header);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
return deleted;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
clear(matcher) {
|
|
182
|
-
const keys = Object.keys(this);
|
|
183
|
-
let i = keys.length;
|
|
184
|
-
let deleted = false;
|
|
185
|
-
|
|
186
|
-
while (i--) {
|
|
187
|
-
const key = keys[i];
|
|
188
|
-
if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
|
|
189
|
-
delete this[key];
|
|
190
|
-
deleted = true;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
return deleted;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
normalize(format) {
|
|
198
|
-
const self = this;
|
|
199
|
-
const headers = {};
|
|
200
|
-
|
|
201
|
-
utils.forEach(this, (value, header) => {
|
|
202
|
-
const key = utils.findKey(headers, header);
|
|
203
|
-
|
|
204
|
-
if (key) {
|
|
205
|
-
self[key] = normalizeValue(value);
|
|
206
|
-
delete self[header];
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const normalized = format ? formatHeader(header) : String(header).trim();
|
|
211
|
-
|
|
212
|
-
if (normalized !== header) {
|
|
213
|
-
delete self[header];
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
self[normalized] = normalizeValue(value);
|
|
217
|
-
|
|
218
|
-
headers[normalized] = true;
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
return this;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
concat(...targets) {
|
|
225
|
-
return this.constructor.concat(this, ...targets);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
toJSON(asStrings) {
|
|
229
|
-
const obj = Object.create(null);
|
|
230
|
-
|
|
231
|
-
utils.forEach(this, (value, header) => {
|
|
232
|
-
value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
return obj;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
[Symbol.iterator]() {
|
|
239
|
-
return Object.entries(this.toJSON())[Symbol.iterator]();
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
toString() {
|
|
243
|
-
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
get [Symbol.toStringTag]() {
|
|
247
|
-
return 'AxiosHeaders';
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
static from(thing) {
|
|
251
|
-
return thing instanceof this ? thing : new this(thing);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
static concat(first, ...targets) {
|
|
255
|
-
const computed = new this(first);
|
|
256
|
-
|
|
257
|
-
targets.forEach((target) => computed.set(target));
|
|
258
|
-
|
|
259
|
-
return computed;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
static accessor(header) {
|
|
263
|
-
const internals = this[$internals] = (this[$internals] = {
|
|
264
|
-
accessors: {}
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
const accessors = internals.accessors;
|
|
268
|
-
const prototype = this.prototype;
|
|
269
|
-
|
|
270
|
-
function defineAccessor(_header) {
|
|
271
|
-
const lHeader = normalizeHeader(_header);
|
|
272
|
-
|
|
273
|
-
if (!accessors[lHeader]) {
|
|
274
|
-
buildAccessors(prototype, _header);
|
|
275
|
-
accessors[lHeader] = true;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
|
|
280
|
-
|
|
281
|
-
return this;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
|
|
286
|
-
|
|
287
|
-
// reserved names hotfix
|
|
288
|
-
utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
|
|
289
|
-
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
|
|
290
|
-
return {
|
|
291
|
-
get: () => value,
|
|
292
|
-
set(headerValue) {
|
|
293
|
-
this[mapped] = headerValue;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
utils.freezeMethods(AxiosHeaders);
|
|
299
|
-
|
|
300
|
-
export { AxiosHeaders as default };
|
|
301
|
-
//# sourceMappingURL=AxiosHeaders.js.map
|