@supernovaio/cli 1.0.10 → 1.1.1
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/commands/publish-documentation.js +25 -3
- package/dist/utils/figma-tokens-data-loader.js +51 -49
- package/node_modules/@supernova-studio/pulsar-core/build/main/pulsar-core.js +2 -2
- package/node_modules/@supernova-studio/pulsar-core/package.json +8 -26
- package/node_modules/@supernova-studio/pulsar-language/build/main/language/src/extensions/dsm/DSMBridge.d.ts +4 -0
- package/node_modules/@supernova-studio/pulsar-language/build/main/pulsar-language.js +1 -1
- package/node_modules/@supernova-studio/pulsar-language/package.json +7 -22
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/SDKDocumentation.d.ts +4 -4
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/data/SDKDataCore.d.ts +2 -2
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/exports.d.ts +1 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/SDKDocumentationPageBlock.d.ts +11 -4
- package/node_modules/@supernovaio/supernova-sdk/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockAssetGroup.d.ts +25 -0
- package/node_modules/@supernovaio/supernova-sdk/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockGuideline.d.ts +11 -0
- package/node_modules/@supernovaio/supernova-sdk/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockGuidelineProps.d.ts +17 -0
- package/node_modules/@supernovaio/supernova-sdk/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockGuidelines.d.ts +8 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockImage.d.ts +2 -0
- package/node_modules/@supernovaio/supernova-sdk/build/sdk-typescript/src/model/documentation/blocks/SDKDocumentationPageBlockSwatch.d.ts +9 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKDocumentationPageBlockType.d.ts +3 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/markdown-transform/SDKToolsMarkdownTransformBlock.d.ts +6 -0
- package/node_modules/@supernovaio/supernova-sdk/build/sdk-typescript/tsconfig.tsbuildinfo +6395 -0
- package/node_modules/@supernovaio/supernova-sdk/build/supernova-sdk-typescript.js +1 -1
- package/node_modules/@supernovaio/supernova-sdk/build/supernova-sdk-typescript.js.map +1 -1
- package/node_modules/@supernovaio/supernova-sdk/package.json +7 -8
- package/node_modules/axios/CHANGELOG.md +895 -746
- package/node_modules/axios/README.md +37 -42
- package/node_modules/axios/dist/axios.js +1168 -299
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +1 -1
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +810 -315
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +810 -315
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +1 -1
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +824 -396
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +5 -2
- package/node_modules/axios/index.d.ts +5 -2
- package/node_modules/axios/lib/adapters/adapters.js +3 -1
- package/node_modules/axios/lib/adapters/fetch.js +229 -0
- package/node_modules/axios/lib/adapters/http.js +27 -17
- package/node_modules/axios/lib/adapters/xhr.js +36 -99
- package/node_modules/axios/lib/cancel/CancelToken.js +14 -0
- package/node_modules/axios/lib/core/Axios.js +9 -6
- package/node_modules/axios/lib/core/AxiosError.js +5 -2
- package/node_modules/axios/lib/core/AxiosHeaders.js +4 -0
- package/node_modules/axios/lib/defaults/index.js +7 -2
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/AxiosTransformStream.js +3 -51
- package/node_modules/axios/lib/helpers/composeSignals.js +48 -0
- package/node_modules/axios/lib/helpers/isURLSameOrigin.js +1 -1
- package/node_modules/axios/lib/helpers/progressEventReducer.js +44 -0
- package/node_modules/axios/lib/helpers/resolveConfig.js +57 -0
- package/node_modules/axios/lib/helpers/throttle.js +30 -19
- package/node_modules/axios/lib/helpers/trackStream.js +87 -0
- package/node_modules/axios/lib/platform/common/utils.js +9 -5
- package/node_modules/axios/lib/utils.js +40 -3
- package/node_modules/axios/package.json +4 -3
- package/node_modules/{@supernovaio/supernova-sdk/node_modules/https-proxy-agent → https-proxy-agent}/dist/index.d.ts.map +1 -1
- package/node_modules/{@supernovaio/supernova-sdk/node_modules/https-proxy-agent → https-proxy-agent}/dist/index.js +2 -2
- package/node_modules/https-proxy-agent/dist/index.js.map +1 -0
- package/node_modules/{@supernovaio/supernova-sdk/node_modules/https-proxy-agent → https-proxy-agent}/package.json +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +108 -108
- package/node_modules/@supernova-studio/pulsar-core/node_modules/agent-base/README.md +0 -95
- package/node_modules/@supernova-studio/pulsar-core/node_modules/agent-base/dist/index.d.ts +0 -38
- package/node_modules/@supernova-studio/pulsar-core/node_modules/agent-base/dist/index.d.ts.map +0 -1
- package/node_modules/@supernova-studio/pulsar-core/node_modules/agent-base/dist/index.js +0 -112
- package/node_modules/@supernova-studio/pulsar-core/node_modules/agent-base/dist/index.js.map +0 -1
- package/node_modules/@supernova-studio/pulsar-core/node_modules/agent-base/package.json +0 -49
- package/node_modules/@supernova-studio/pulsar-core/node_modules/https-proxy-agent/README.md +0 -97
- package/node_modules/@supernova-studio/pulsar-core/node_modules/https-proxy-agent/dist/index.d.ts +0 -46
- package/node_modules/@supernova-studio/pulsar-core/node_modules/https-proxy-agent/dist/index.d.ts.map +0 -1
- package/node_modules/@supernova-studio/pulsar-core/node_modules/https-proxy-agent/dist/index.js +0 -174
- package/node_modules/@supernova-studio/pulsar-core/node_modules/https-proxy-agent/dist/index.js.map +0 -1
- package/node_modules/@supernova-studio/pulsar-core/node_modules/https-proxy-agent/package.json +0 -50
- package/node_modules/@supernova-studio/pulsar-language/node_modules/agent-base/dist/helpers.d.ts +0 -15
- package/node_modules/@supernova-studio/pulsar-language/node_modules/agent-base/dist/helpers.d.ts.map +0 -1
- package/node_modules/@supernova-studio/pulsar-language/node_modules/agent-base/dist/helpers.js +0 -66
- package/node_modules/@supernova-studio/pulsar-language/node_modules/agent-base/dist/helpers.js.map +0 -1
- package/node_modules/@supernova-studio/pulsar-language/node_modules/https-proxy-agent/dist/index.d.ts.map +0 -1
- package/node_modules/@supernova-studio/pulsar-language/node_modules/https-proxy-agent/dist/index.js +0 -175
- package/node_modules/@supernova-studio/pulsar-language/node_modules/https-proxy-agent/dist/index.js.map +0 -1
- package/node_modules/@supernova-studio/pulsar-language/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +0 -15
- package/node_modules/@supernova-studio/pulsar-language/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts.map +0 -1
- package/node_modules/@supernova-studio/pulsar-language/node_modules/https-proxy-agent/dist/parse-proxy-response.js +0 -101
- package/node_modules/@supernova-studio/pulsar-language/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +0 -1
- package/node_modules/@supernova-studio/pulsar-language/node_modules/https-proxy-agent/package.json +0 -50
- package/node_modules/@supernovaio/supernova-sdk/node_modules/agent-base/LICENSE +0 -22
- package/node_modules/@supernovaio/supernova-sdk/node_modules/agent-base/README.md +0 -69
- package/node_modules/@supernovaio/supernova-sdk/node_modules/agent-base/dist/helpers.d.ts +0 -15
- package/node_modules/@supernovaio/supernova-sdk/node_modules/agent-base/dist/helpers.d.ts.map +0 -1
- package/node_modules/@supernovaio/supernova-sdk/node_modules/agent-base/dist/helpers.js +0 -66
- package/node_modules/@supernovaio/supernova-sdk/node_modules/agent-base/dist/helpers.js.map +0 -1
- package/node_modules/@supernovaio/supernova-sdk/node_modules/agent-base/dist/index.d.ts +0 -41
- package/node_modules/@supernovaio/supernova-sdk/node_modules/agent-base/dist/index.d.ts.map +0 -1
- package/node_modules/@supernovaio/supernova-sdk/node_modules/agent-base/dist/index.js +0 -175
- package/node_modules/@supernovaio/supernova-sdk/node_modules/agent-base/dist/index.js.map +0 -1
- package/node_modules/@supernovaio/supernova-sdk/node_modules/agent-base/package.json +0 -49
- package/node_modules/@supernovaio/supernova-sdk/node_modules/https-proxy-agent/LICENSE +0 -22
- package/node_modules/@supernovaio/supernova-sdk/node_modules/https-proxy-agent/README.md +0 -70
- package/node_modules/@supernovaio/supernova-sdk/node_modules/https-proxy-agent/dist/index.d.ts +0 -47
- package/node_modules/@supernovaio/supernova-sdk/node_modules/https-proxy-agent/dist/index.js.map +0 -1
- package/node_modules/@supernovaio/supernova-sdk/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +0 -15
- package/node_modules/@supernovaio/supernova-sdk/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts.map +0 -1
- package/node_modules/@supernovaio/supernova-sdk/node_modules/https-proxy-agent/dist/parse-proxy-response.js +0 -101
- package/node_modules/@supernovaio/supernova-sdk/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +0 -1
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/browser-bundle.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/SDKBrand.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/SDKBrandWriter.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/SDKDesignSystem.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/SDKDesignSystemVersion.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/SDKDesignSystemVersionWriter.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/SDKSupernova.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/SDKWorkspace.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/data/SDKConfiguration.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/data/SDKDataBridge.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/errors/SDKSupernovaError.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/resolvers/SDKAssetGroupResolver.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/resolvers/SDKComponentResolver.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/resolvers/SDKDesignComponentGroupResolver.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/resolvers/SDKDocumentationItemResolver.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/resolvers/SDKTokenGroupResolver.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/core/resolvers/SDKTokenResolver.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/index.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/assets/SDKAsset.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/assets/SDKRenderedAsset.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/components/SDKComponent.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/components/SDKDesignComponent.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/SDKDocumentationConfiguration.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/SDKDocumentationGroup.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/SDKDocumentationItem.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/SDKDocumentationPage.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/SDKDocumentationPageAsset.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/SDKDocumentationRichText.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/SDKDocumentationRichTextSpan.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/SDKDocumentationRichTextSpanAttribute.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockAsset.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockAssets.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockCallout.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockCode.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockColumn.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockColumnItem.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockCustom.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockDivider.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockEmbedFigma.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockEmbedGeneric.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockEmbedLink.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockEmbedStorybook.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockEmbedYoutube.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockFrame.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockFrames.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockHeading.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockOrderedList.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockQuote.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockRenderCode.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockShortcut.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockShortcuts.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockTab.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockTabItem.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockTable.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockTableCell.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockTableColumn.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockTableRow.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockText.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockToken.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockTokenGroup.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockTokenList.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/blocks/SDKDocumentationPageBlockUnorderedList.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/builder/SDKDocumentationBlockBuilder.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/configuration/SDKDocumentationItemConfiguration.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/documentation/configuration/SDKDocumentationItemHeader.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/elements/SDKElementDataView.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/elements/SDKElementDataViewColumn.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/elements/SDKElementProperty.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/elements/SDKElementPropertyOption.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/elements/values/SDKElementPropertyValue.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKAlignment.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKAssetFormat.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKAssetScale.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKAssetScaleType.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKBlurType.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKBorderPosition.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKDocumentationCalloutType.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKDocumentationEnvironment.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKDocumentationGroupBehavior.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKDocumentationHeadingType.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKDocumentationItemType.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKDocumentationPageAssetType.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKDocumentationPageBlockThemeType.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKFrameAlignment.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKFrameLayout.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKGradientType.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKRichTextSpanAttributeType.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKShadowType.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKSourceType.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKTextCase.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKTextDecoration.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKTokenType.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/enums/SDKUnit.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/exporters/SDKExporter.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/exporters/custom_blocks/SDKExporterCustomBlock.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/exporters/custom_blocks/SDKExporterCustomBlockProperty.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/exporters/custom_blocks/SDKExporterCustomBlockVariant.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/exporters/custom_properties/SDKExporterConfigurationProperty.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/groups/SDKAssetGroup.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/groups/SDKDesignComponentGroup.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/groups/SDKTokenGroup.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/support/SDKDesignComponentOrigin.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/support/SDKFrameOrigin.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/support/SDKSize.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/support/SDKSource.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/support/SDKTokenOrigin.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/support/SDKWorkspaceNPMRegistry.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/themes/SDKThemeUtilities.d.ts +0 -0
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/themes/SDKTokenTheme.d.ts +5 -5
- package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/themes/SDKTokenThemeOverride.d.ts +5 -5
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/SDKBlurToken.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/SDKBorderToken.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/SDKColorToken.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/SDKFontToken.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/SDKGenericToken.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/SDKGradientToken.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/SDKMeasureToken.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/SDKRadiusToken.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/SDKShadowToken.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/SDKTextToken.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/SDKToken.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/SDKTokenCompator.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/SDKTokenValue.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/SDKTypographyToken.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/remote/SDKRemoteTokenData.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/remote/SDKRemoteTokenModel.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/tokens/remote/SDKRemoteTokenValue.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/model/users/SDKUser.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tests/Accessors/Brand.spec.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tests/Accessors/Components.spec.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tests/Accessors/DesignSystem.spec.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tests/Accessors/DesignSystemVersion.spec.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tests/Accessors/Documentation.spec.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tests/Accessors/Supernova.spec.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tests/Accessors/Theme.spec.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tests/Accessors/Workspace.spec.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tests/Tooling/PluginFigmaTokens.spec.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tests/Tooling/PluginJSONBuilder.spec.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tests/Tooling/ToolDocSearch.spec.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tests/Tooling/ToolMarkdownTransform.spec.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tests/helpers.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/SDKToolsDesignTokensPlugin.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/utilities/SDKDTJSONConverter.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/utilities/SDKDTJSONGroupBuilder.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/utilities/SDKDTJSONLoader.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/utilities/SDKDTJSONParser.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/utilities/SDKDTMapLoader.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/utilities/SDKDTMapResolver.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/utilities/SDKDTThemeMerger.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/utilities/SDKDTTokenGroupTreeMerger.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/utilities/SDKDTTokenMerger.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/utilities/SDKDTTokenReferenceResolver.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/utilities/SDKDTTokenSetResolver.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/utilities/collection/SDKDTTokenCollection.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/utilities/expression/SDKDTExpressionParser.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/utilities/tree/SDKDTGroupTree.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/utilities/tree/SDKDTGroupTreeNode.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/design-tokens/utilities/tree/SDKDTParentChildMapping.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/json-builder/SDKToolsJSONBuilder.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/json-builder/elements-transformers/SDKToolsJSONElementFigmaTokensTransformer.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/json-builder/elements-transformers/SDKToolsJSONElementStyleDictionaryTransformer.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/json-builder/elements-transformers/SDKToolsJSONElementTransformer.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/markdown-transform/SDKToolsMarkdownTransform.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/markdown-transform/SDKToolsMarkdownTransformCustomBlock.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/markdown-transform/SDKToolsMarkdownTransformUtil.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/search-index/SDKToolsDocSearch.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/tools/token-transform/SDKToolsTokenTransform.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/utils/FlowUtils.d.ts +0 -0
- /package/node_modules/@supernovaio/supernova-sdk/build/{Typescript → sdk-typescript}/src/utils/StringUtils.d.ts +0 -0
- /package/node_modules/{@supernova-studio/pulsar-language/node_modules/agent-base → agent-base}/LICENSE +0 -0
- /package/node_modules/{@supernova-studio/pulsar-language/node_modules/agent-base → agent-base}/README.md +0 -0
- /package/node_modules/{@supernova-studio/pulsar-core/node_modules/agent-base → agent-base}/dist/helpers.d.ts +0 -0
- /package/node_modules/{@supernova-studio/pulsar-core/node_modules/agent-base → agent-base}/dist/helpers.d.ts.map +0 -0
- /package/node_modules/{@supernova-studio/pulsar-core/node_modules/agent-base → agent-base}/dist/helpers.js +0 -0
- /package/node_modules/{@supernova-studio/pulsar-core/node_modules/agent-base → agent-base}/dist/helpers.js.map +0 -0
- /package/node_modules/{@supernova-studio/pulsar-language/node_modules/agent-base → agent-base}/dist/index.d.ts +0 -0
- /package/node_modules/{@supernova-studio/pulsar-language/node_modules/agent-base → agent-base}/dist/index.d.ts.map +0 -0
- /package/node_modules/{@supernova-studio/pulsar-language/node_modules/agent-base → agent-base}/dist/index.js +0 -0
- /package/node_modules/{@supernova-studio/pulsar-language/node_modules/agent-base → agent-base}/dist/index.js.map +0 -0
- /package/node_modules/{@supernova-studio/pulsar-language/node_modules/agent-base → agent-base}/package.json +0 -0
- /package/node_modules/{@supernova-studio/pulsar-language/node_modules/https-proxy-agent → https-proxy-agent}/LICENSE +0 -0
- /package/node_modules/{@supernova-studio/pulsar-language/node_modules/https-proxy-agent → https-proxy-agent}/README.md +0 -0
- /package/node_modules/{@supernova-studio/pulsar-language/node_modules/https-proxy-agent → https-proxy-agent}/dist/index.d.ts +0 -0
- /package/node_modules/{@supernova-studio/pulsar-core/node_modules/https-proxy-agent → https-proxy-agent}/dist/parse-proxy-response.d.ts +0 -0
- /package/node_modules/{@supernova-studio/pulsar-core/node_modules/https-proxy-agent → https-proxy-agent}/dist/parse-proxy-response.d.ts.map +0 -0
- /package/node_modules/{@supernova-studio/pulsar-core/node_modules/https-proxy-agent → https-proxy-agent}/dist/parse-proxy-response.js +0 -0
- /package/node_modules/{@supernova-studio/pulsar-core/node_modules/https-proxy-agent → https-proxy-agent}/dist/parse-proxy-response.js.map +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Axios v1.
|
|
1
|
+
// Axios v1.7.7 Copyright (c) 2024 Matt Zabriskie and contributors
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
const FormData$1 = require('form-data');
|
|
@@ -236,6 +236,8 @@ const isFormData = (thing) => {
|
|
|
236
236
|
*/
|
|
237
237
|
const isURLSearchParams = kindOfTest('URLSearchParams');
|
|
238
238
|
|
|
239
|
+
const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
|
|
240
|
+
|
|
239
241
|
/**
|
|
240
242
|
* Trim excess whitespace off the beginning and end of a string
|
|
241
243
|
*
|
|
@@ -624,8 +626,7 @@ const toObjectSet = (arrayOrString, delimiter) => {
|
|
|
624
626
|
const noop = () => {};
|
|
625
627
|
|
|
626
628
|
const toFiniteNumber = (value, defaultValue) => {
|
|
627
|
-
value = +value;
|
|
628
|
-
return Number.isFinite(value) ? value : defaultValue;
|
|
629
|
+
return value != null && Number.isFinite(value = +value) ? value : defaultValue;
|
|
629
630
|
};
|
|
630
631
|
|
|
631
632
|
const ALPHA = 'abcdefghijklmnopqrstuvwxyz';
|
|
@@ -695,6 +696,36 @@ const isAsyncFn = kindOfTest('AsyncFunction');
|
|
|
695
696
|
const isThenable = (thing) =>
|
|
696
697
|
thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
|
|
697
698
|
|
|
699
|
+
// original code
|
|
700
|
+
// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
|
|
701
|
+
|
|
702
|
+
const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
|
|
703
|
+
if (setImmediateSupported) {
|
|
704
|
+
return setImmediate;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
return postMessageSupported ? ((token, callbacks) => {
|
|
708
|
+
_global.addEventListener("message", ({source, data}) => {
|
|
709
|
+
if (source === _global && data === token) {
|
|
710
|
+
callbacks.length && callbacks.shift()();
|
|
711
|
+
}
|
|
712
|
+
}, false);
|
|
713
|
+
|
|
714
|
+
return (cb) => {
|
|
715
|
+
callbacks.push(cb);
|
|
716
|
+
_global.postMessage(token, "*");
|
|
717
|
+
}
|
|
718
|
+
})(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
|
|
719
|
+
})(
|
|
720
|
+
typeof setImmediate === 'function',
|
|
721
|
+
isFunction(_global.postMessage)
|
|
722
|
+
);
|
|
723
|
+
|
|
724
|
+
const asap = typeof queueMicrotask !== 'undefined' ?
|
|
725
|
+
queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);
|
|
726
|
+
|
|
727
|
+
// *********************
|
|
728
|
+
|
|
698
729
|
const utils$1 = {
|
|
699
730
|
isArray,
|
|
700
731
|
isArrayBuffer,
|
|
@@ -706,6 +737,10 @@ const utils$1 = {
|
|
|
706
737
|
isBoolean,
|
|
707
738
|
isObject,
|
|
708
739
|
isPlainObject,
|
|
740
|
+
isReadableStream,
|
|
741
|
+
isRequest,
|
|
742
|
+
isResponse,
|
|
743
|
+
isHeaders,
|
|
709
744
|
isUndefined,
|
|
710
745
|
isDate,
|
|
711
746
|
isFile,
|
|
@@ -746,7 +781,9 @@ const utils$1 = {
|
|
|
746
781
|
isSpecCompliantForm,
|
|
747
782
|
toJSONObject,
|
|
748
783
|
isAsyncFn,
|
|
749
|
-
isThenable
|
|
784
|
+
isThenable,
|
|
785
|
+
setImmediate: _setImmediate,
|
|
786
|
+
asap
|
|
750
787
|
};
|
|
751
788
|
|
|
752
789
|
/**
|
|
@@ -774,7 +811,10 @@ function AxiosError(message, code, config, request, response) {
|
|
|
774
811
|
code && (this.code = code);
|
|
775
812
|
config && (this.config = config);
|
|
776
813
|
request && (this.request = request);
|
|
777
|
-
|
|
814
|
+
if (response) {
|
|
815
|
+
this.response = response;
|
|
816
|
+
this.status = response.status ? response.status : null;
|
|
817
|
+
}
|
|
778
818
|
}
|
|
779
819
|
|
|
780
820
|
utils$1.inherits(AxiosError, Error, {
|
|
@@ -794,7 +834,7 @@ utils$1.inherits(AxiosError, Error, {
|
|
|
794
834
|
// Axios
|
|
795
835
|
config: utils$1.toJSONObject(this.config),
|
|
796
836
|
code: this.code,
|
|
797
|
-
status: this.
|
|
837
|
+
status: this.status
|
|
798
838
|
};
|
|
799
839
|
}
|
|
800
840
|
});
|
|
@@ -1255,6 +1295,8 @@ const platform$1 = {
|
|
|
1255
1295
|
|
|
1256
1296
|
const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
1257
1297
|
|
|
1298
|
+
const _navigator = typeof navigator === 'object' && navigator || undefined;
|
|
1299
|
+
|
|
1258
1300
|
/**
|
|
1259
1301
|
* Determine if we're running in a standard browser environment
|
|
1260
1302
|
*
|
|
@@ -1272,10 +1314,8 @@ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'unde
|
|
|
1272
1314
|
*
|
|
1273
1315
|
* @returns {boolean}
|
|
1274
1316
|
*/
|
|
1275
|
-
const hasStandardBrowserEnv =
|
|
1276
|
-
(product)
|
|
1277
|
-
return hasBrowserEnv && ['ReactNative', 'NativeScript', 'NS'].indexOf(product) < 0
|
|
1278
|
-
})(typeof navigator !== 'undefined' && navigator.product);
|
|
1317
|
+
const hasStandardBrowserEnv = hasBrowserEnv &&
|
|
1318
|
+
(!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
|
|
1279
1319
|
|
|
1280
1320
|
/**
|
|
1281
1321
|
* Determine if we're running in a standard browser webWorker environment
|
|
@@ -1295,11 +1335,15 @@ const hasStandardBrowserWebWorkerEnv = (() => {
|
|
|
1295
1335
|
);
|
|
1296
1336
|
})();
|
|
1297
1337
|
|
|
1338
|
+
const origin = hasBrowserEnv && window.location.href || 'http://localhost';
|
|
1339
|
+
|
|
1298
1340
|
const utils = /*#__PURE__*/Object.freeze({
|
|
1299
1341
|
__proto__: null,
|
|
1300
1342
|
hasBrowserEnv: hasBrowserEnv,
|
|
1301
1343
|
hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
|
|
1302
|
-
hasStandardBrowserEnv: hasStandardBrowserEnv
|
|
1344
|
+
hasStandardBrowserEnv: hasStandardBrowserEnv,
|
|
1345
|
+
navigator: _navigator,
|
|
1346
|
+
origin: origin
|
|
1303
1347
|
});
|
|
1304
1348
|
|
|
1305
1349
|
const platform = {
|
|
@@ -1439,7 +1483,7 @@ const defaults = {
|
|
|
1439
1483
|
|
|
1440
1484
|
transitional: transitionalDefaults,
|
|
1441
1485
|
|
|
1442
|
-
adapter: ['xhr', 'http'],
|
|
1486
|
+
adapter: ['xhr', 'http', 'fetch'],
|
|
1443
1487
|
|
|
1444
1488
|
transformRequest: [function transformRequest(data, headers) {
|
|
1445
1489
|
const contentType = headers.getContentType() || '';
|
|
@@ -1460,7 +1504,8 @@ const defaults = {
|
|
|
1460
1504
|
utils$1.isBuffer(data) ||
|
|
1461
1505
|
utils$1.isStream(data) ||
|
|
1462
1506
|
utils$1.isFile(data) ||
|
|
1463
|
-
utils$1.isBlob(data)
|
|
1507
|
+
utils$1.isBlob(data) ||
|
|
1508
|
+
utils$1.isReadableStream(data)
|
|
1464
1509
|
) {
|
|
1465
1510
|
return data;
|
|
1466
1511
|
}
|
|
@@ -1503,6 +1548,10 @@ const defaults = {
|
|
|
1503
1548
|
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
1504
1549
|
const JSONRequested = this.responseType === 'json';
|
|
1505
1550
|
|
|
1551
|
+
if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
|
|
1552
|
+
return data;
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1506
1555
|
if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
|
1507
1556
|
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
1508
1557
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
@@ -1706,6 +1755,10 @@ class AxiosHeaders {
|
|
|
1706
1755
|
setHeaders(header, valueOrRewrite);
|
|
1707
1756
|
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
|
|
1708
1757
|
setHeaders(parseHeaders(header), valueOrRewrite);
|
|
1758
|
+
} else if (utils$1.isHeaders(header)) {
|
|
1759
|
+
for (const [key, value] of header.entries()) {
|
|
1760
|
+
setHeader(value, key, rewrite);
|
|
1761
|
+
}
|
|
1709
1762
|
} else {
|
|
1710
1763
|
header != null && setHeader(valueOrRewrite, header, rewrite);
|
|
1711
1764
|
}
|
|
@@ -2018,7 +2071,7 @@ function buildFullPath(baseURL, requestedURL) {
|
|
|
2018
2071
|
return requestedURL;
|
|
2019
2072
|
}
|
|
2020
2073
|
|
|
2021
|
-
const VERSION = "1.
|
|
2074
|
+
const VERSION = "1.7.7";
|
|
2022
2075
|
|
|
2023
2076
|
function parseProtocol(url) {
|
|
2024
2077
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
@@ -2073,88 +2126,6 @@ function fromDataURI(uri, asBlob, options) {
|
|
|
2073
2126
|
throw new AxiosError('Unsupported protocol ' + protocol, AxiosError.ERR_NOT_SUPPORT);
|
|
2074
2127
|
}
|
|
2075
2128
|
|
|
2076
|
-
/**
|
|
2077
|
-
* Throttle decorator
|
|
2078
|
-
* @param {Function} fn
|
|
2079
|
-
* @param {Number} freq
|
|
2080
|
-
* @return {Function}
|
|
2081
|
-
*/
|
|
2082
|
-
function throttle(fn, freq) {
|
|
2083
|
-
let timestamp = 0;
|
|
2084
|
-
const threshold = 1000 / freq;
|
|
2085
|
-
let timer = null;
|
|
2086
|
-
return function throttled(force, args) {
|
|
2087
|
-
const now = Date.now();
|
|
2088
|
-
if (force || now - timestamp > threshold) {
|
|
2089
|
-
if (timer) {
|
|
2090
|
-
clearTimeout(timer);
|
|
2091
|
-
timer = null;
|
|
2092
|
-
}
|
|
2093
|
-
timestamp = now;
|
|
2094
|
-
return fn.apply(null, args);
|
|
2095
|
-
}
|
|
2096
|
-
if (!timer) {
|
|
2097
|
-
timer = setTimeout(() => {
|
|
2098
|
-
timer = null;
|
|
2099
|
-
timestamp = Date.now();
|
|
2100
|
-
return fn.apply(null, args);
|
|
2101
|
-
}, threshold - (now - timestamp));
|
|
2102
|
-
}
|
|
2103
|
-
};
|
|
2104
|
-
}
|
|
2105
|
-
|
|
2106
|
-
/**
|
|
2107
|
-
* Calculate data maxRate
|
|
2108
|
-
* @param {Number} [samplesCount= 10]
|
|
2109
|
-
* @param {Number} [min= 1000]
|
|
2110
|
-
* @returns {Function}
|
|
2111
|
-
*/
|
|
2112
|
-
function speedometer(samplesCount, min) {
|
|
2113
|
-
samplesCount = samplesCount || 10;
|
|
2114
|
-
const bytes = new Array(samplesCount);
|
|
2115
|
-
const timestamps = new Array(samplesCount);
|
|
2116
|
-
let head = 0;
|
|
2117
|
-
let tail = 0;
|
|
2118
|
-
let firstSampleTS;
|
|
2119
|
-
|
|
2120
|
-
min = min !== undefined ? min : 1000;
|
|
2121
|
-
|
|
2122
|
-
return function push(chunkLength) {
|
|
2123
|
-
const now = Date.now();
|
|
2124
|
-
|
|
2125
|
-
const startedAt = timestamps[tail];
|
|
2126
|
-
|
|
2127
|
-
if (!firstSampleTS) {
|
|
2128
|
-
firstSampleTS = now;
|
|
2129
|
-
}
|
|
2130
|
-
|
|
2131
|
-
bytes[head] = chunkLength;
|
|
2132
|
-
timestamps[head] = now;
|
|
2133
|
-
|
|
2134
|
-
let i = tail;
|
|
2135
|
-
let bytesCount = 0;
|
|
2136
|
-
|
|
2137
|
-
while (i !== head) {
|
|
2138
|
-
bytesCount += bytes[i++];
|
|
2139
|
-
i = i % samplesCount;
|
|
2140
|
-
}
|
|
2141
|
-
|
|
2142
|
-
head = (head + 1) % samplesCount;
|
|
2143
|
-
|
|
2144
|
-
if (head === tail) {
|
|
2145
|
-
tail = (tail + 1) % samplesCount;
|
|
2146
|
-
}
|
|
2147
|
-
|
|
2148
|
-
if (now - firstSampleTS < min) {
|
|
2149
|
-
return;
|
|
2150
|
-
}
|
|
2151
|
-
|
|
2152
|
-
const passed = startedAt && now - startedAt;
|
|
2153
|
-
|
|
2154
|
-
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
|
|
2155
|
-
};
|
|
2156
|
-
}
|
|
2157
|
-
|
|
2158
2129
|
const kInternals = Symbol('internals');
|
|
2159
2130
|
|
|
2160
2131
|
class AxiosTransformStream extends stream__default["default"].Transform{
|
|
@@ -2174,12 +2145,8 @@ class AxiosTransformStream extends stream__default["default"].Transform{
|
|
|
2174
2145
|
readableHighWaterMark: options.chunkSize
|
|
2175
2146
|
});
|
|
2176
2147
|
|
|
2177
|
-
const self = this;
|
|
2178
|
-
|
|
2179
2148
|
const internals = this[kInternals] = {
|
|
2180
|
-
length: options.length,
|
|
2181
2149
|
timeWindow: options.timeWindow,
|
|
2182
|
-
ticksRate: options.ticksRate,
|
|
2183
2150
|
chunkSize: options.chunkSize,
|
|
2184
2151
|
maxRate: options.maxRate,
|
|
2185
2152
|
minChunkSize: options.minChunkSize,
|
|
@@ -2191,8 +2158,6 @@ class AxiosTransformStream extends stream__default["default"].Transform{
|
|
|
2191
2158
|
onReadCallback: null
|
|
2192
2159
|
};
|
|
2193
2160
|
|
|
2194
|
-
const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow);
|
|
2195
|
-
|
|
2196
2161
|
this.on('newListener', event => {
|
|
2197
2162
|
if (event === 'progress') {
|
|
2198
2163
|
if (!internals.isCaptured) {
|
|
@@ -2200,38 +2165,6 @@ class AxiosTransformStream extends stream__default["default"].Transform{
|
|
|
2200
2165
|
}
|
|
2201
2166
|
}
|
|
2202
2167
|
});
|
|
2203
|
-
|
|
2204
|
-
let bytesNotified = 0;
|
|
2205
|
-
|
|
2206
|
-
internals.updateProgress = throttle(function throttledHandler() {
|
|
2207
|
-
const totalBytes = internals.length;
|
|
2208
|
-
const bytesTransferred = internals.bytesSeen;
|
|
2209
|
-
const progressBytes = bytesTransferred - bytesNotified;
|
|
2210
|
-
if (!progressBytes || self.destroyed) return;
|
|
2211
|
-
|
|
2212
|
-
const rate = _speedometer(progressBytes);
|
|
2213
|
-
|
|
2214
|
-
bytesNotified = bytesTransferred;
|
|
2215
|
-
|
|
2216
|
-
process.nextTick(() => {
|
|
2217
|
-
self.emit('progress', {
|
|
2218
|
-
'loaded': bytesTransferred,
|
|
2219
|
-
'total': totalBytes,
|
|
2220
|
-
'progress': totalBytes ? (bytesTransferred / totalBytes) : undefined,
|
|
2221
|
-
'bytes': progressBytes,
|
|
2222
|
-
'rate': rate ? rate : undefined,
|
|
2223
|
-
'estimated': rate && totalBytes && bytesTransferred <= totalBytes ?
|
|
2224
|
-
(totalBytes - bytesTransferred) / rate : undefined
|
|
2225
|
-
});
|
|
2226
|
-
});
|
|
2227
|
-
}, internals.ticksRate);
|
|
2228
|
-
|
|
2229
|
-
const onFinish = () => {
|
|
2230
|
-
internals.updateProgress(true);
|
|
2231
|
-
};
|
|
2232
|
-
|
|
2233
|
-
this.once('end', onFinish);
|
|
2234
|
-
this.once('error', onFinish);
|
|
2235
2168
|
}
|
|
2236
2169
|
|
|
2237
2170
|
_read(size) {
|
|
@@ -2245,7 +2178,6 @@ class AxiosTransformStream extends stream__default["default"].Transform{
|
|
|
2245
2178
|
}
|
|
2246
2179
|
|
|
2247
2180
|
_transform(chunk, encoding, callback) {
|
|
2248
|
-
const self = this;
|
|
2249
2181
|
const internals = this[kInternals];
|
|
2250
2182
|
const maxRate = internals.maxRate;
|
|
2251
2183
|
|
|
@@ -2257,16 +2189,14 @@ class AxiosTransformStream extends stream__default["default"].Transform{
|
|
|
2257
2189
|
const bytesThreshold = (maxRate / divider);
|
|
2258
2190
|
const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
|
|
2259
2191
|
|
|
2260
|
-
|
|
2192
|
+
const pushChunk = (_chunk, _callback) => {
|
|
2261
2193
|
const bytes = Buffer.byteLength(_chunk);
|
|
2262
2194
|
internals.bytesSeen += bytes;
|
|
2263
2195
|
internals.bytes += bytes;
|
|
2264
2196
|
|
|
2265
|
-
|
|
2266
|
-
internals.updateProgress();
|
|
2267
|
-
}
|
|
2197
|
+
internals.isCaptured && this.emit('progress', internals.bytesSeen);
|
|
2268
2198
|
|
|
2269
|
-
if (
|
|
2199
|
+
if (this.push(_chunk)) {
|
|
2270
2200
|
process.nextTick(_callback);
|
|
2271
2201
|
} else {
|
|
2272
2202
|
internals.onReadCallback = () => {
|
|
@@ -2274,7 +2204,7 @@ class AxiosTransformStream extends stream__default["default"].Transform{
|
|
|
2274
2204
|
process.nextTick(_callback);
|
|
2275
2205
|
};
|
|
2276
2206
|
}
|
|
2277
|
-
}
|
|
2207
|
+
};
|
|
2278
2208
|
|
|
2279
2209
|
const transformChunk = (_chunk, _callback) => {
|
|
2280
2210
|
const chunkSize = Buffer.byteLength(_chunk);
|
|
@@ -2331,11 +2261,6 @@ class AxiosTransformStream extends stream__default["default"].Transform{
|
|
|
2331
2261
|
}
|
|
2332
2262
|
});
|
|
2333
2263
|
}
|
|
2334
|
-
|
|
2335
|
-
setLength(length) {
|
|
2336
|
-
this[kInternals].length = +length;
|
|
2337
|
-
return this;
|
|
2338
|
-
}
|
|
2339
2264
|
}
|
|
2340
2265
|
|
|
2341
2266
|
const AxiosTransformStream$1 = AxiosTransformStream;
|
|
@@ -2503,6 +2428,142 @@ const callbackify = (fn, reducer) => {
|
|
|
2503
2428
|
|
|
2504
2429
|
const callbackify$1 = callbackify;
|
|
2505
2430
|
|
|
2431
|
+
/**
|
|
2432
|
+
* Calculate data maxRate
|
|
2433
|
+
* @param {Number} [samplesCount= 10]
|
|
2434
|
+
* @param {Number} [min= 1000]
|
|
2435
|
+
* @returns {Function}
|
|
2436
|
+
*/
|
|
2437
|
+
function speedometer(samplesCount, min) {
|
|
2438
|
+
samplesCount = samplesCount || 10;
|
|
2439
|
+
const bytes = new Array(samplesCount);
|
|
2440
|
+
const timestamps = new Array(samplesCount);
|
|
2441
|
+
let head = 0;
|
|
2442
|
+
let tail = 0;
|
|
2443
|
+
let firstSampleTS;
|
|
2444
|
+
|
|
2445
|
+
min = min !== undefined ? min : 1000;
|
|
2446
|
+
|
|
2447
|
+
return function push(chunkLength) {
|
|
2448
|
+
const now = Date.now();
|
|
2449
|
+
|
|
2450
|
+
const startedAt = timestamps[tail];
|
|
2451
|
+
|
|
2452
|
+
if (!firstSampleTS) {
|
|
2453
|
+
firstSampleTS = now;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
bytes[head] = chunkLength;
|
|
2457
|
+
timestamps[head] = now;
|
|
2458
|
+
|
|
2459
|
+
let i = tail;
|
|
2460
|
+
let bytesCount = 0;
|
|
2461
|
+
|
|
2462
|
+
while (i !== head) {
|
|
2463
|
+
bytesCount += bytes[i++];
|
|
2464
|
+
i = i % samplesCount;
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
head = (head + 1) % samplesCount;
|
|
2468
|
+
|
|
2469
|
+
if (head === tail) {
|
|
2470
|
+
tail = (tail + 1) % samplesCount;
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
if (now - firstSampleTS < min) {
|
|
2474
|
+
return;
|
|
2475
|
+
}
|
|
2476
|
+
|
|
2477
|
+
const passed = startedAt && now - startedAt;
|
|
2478
|
+
|
|
2479
|
+
return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
|
|
2480
|
+
};
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
/**
|
|
2484
|
+
* Throttle decorator
|
|
2485
|
+
* @param {Function} fn
|
|
2486
|
+
* @param {Number} freq
|
|
2487
|
+
* @return {Function}
|
|
2488
|
+
*/
|
|
2489
|
+
function throttle(fn, freq) {
|
|
2490
|
+
let timestamp = 0;
|
|
2491
|
+
let threshold = 1000 / freq;
|
|
2492
|
+
let lastArgs;
|
|
2493
|
+
let timer;
|
|
2494
|
+
|
|
2495
|
+
const invoke = (args, now = Date.now()) => {
|
|
2496
|
+
timestamp = now;
|
|
2497
|
+
lastArgs = null;
|
|
2498
|
+
if (timer) {
|
|
2499
|
+
clearTimeout(timer);
|
|
2500
|
+
timer = null;
|
|
2501
|
+
}
|
|
2502
|
+
fn.apply(null, args);
|
|
2503
|
+
};
|
|
2504
|
+
|
|
2505
|
+
const throttled = (...args) => {
|
|
2506
|
+
const now = Date.now();
|
|
2507
|
+
const passed = now - timestamp;
|
|
2508
|
+
if ( passed >= threshold) {
|
|
2509
|
+
invoke(args, now);
|
|
2510
|
+
} else {
|
|
2511
|
+
lastArgs = args;
|
|
2512
|
+
if (!timer) {
|
|
2513
|
+
timer = setTimeout(() => {
|
|
2514
|
+
timer = null;
|
|
2515
|
+
invoke(lastArgs);
|
|
2516
|
+
}, threshold - passed);
|
|
2517
|
+
}
|
|
2518
|
+
}
|
|
2519
|
+
};
|
|
2520
|
+
|
|
2521
|
+
const flush = () => lastArgs && invoke(lastArgs);
|
|
2522
|
+
|
|
2523
|
+
return [throttled, flush];
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
2527
|
+
let bytesNotified = 0;
|
|
2528
|
+
const _speedometer = speedometer(50, 250);
|
|
2529
|
+
|
|
2530
|
+
return throttle(e => {
|
|
2531
|
+
const loaded = e.loaded;
|
|
2532
|
+
const total = e.lengthComputable ? e.total : undefined;
|
|
2533
|
+
const progressBytes = loaded - bytesNotified;
|
|
2534
|
+
const rate = _speedometer(progressBytes);
|
|
2535
|
+
const inRange = loaded <= total;
|
|
2536
|
+
|
|
2537
|
+
bytesNotified = loaded;
|
|
2538
|
+
|
|
2539
|
+
const data = {
|
|
2540
|
+
loaded,
|
|
2541
|
+
total,
|
|
2542
|
+
progress: total ? (loaded / total) : undefined,
|
|
2543
|
+
bytes: progressBytes,
|
|
2544
|
+
rate: rate ? rate : undefined,
|
|
2545
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
2546
|
+
event: e,
|
|
2547
|
+
lengthComputable: total != null,
|
|
2548
|
+
[isDownloadStream ? 'download' : 'upload']: true
|
|
2549
|
+
};
|
|
2550
|
+
|
|
2551
|
+
listener(data);
|
|
2552
|
+
}, freq);
|
|
2553
|
+
};
|
|
2554
|
+
|
|
2555
|
+
const progressEventDecorator = (total, throttled) => {
|
|
2556
|
+
const lengthComputable = total != null;
|
|
2557
|
+
|
|
2558
|
+
return [(loaded) => throttled[0]({
|
|
2559
|
+
lengthComputable,
|
|
2560
|
+
total,
|
|
2561
|
+
loaded
|
|
2562
|
+
}), throttled[1]];
|
|
2563
|
+
};
|
|
2564
|
+
|
|
2565
|
+
const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
|
|
2566
|
+
|
|
2506
2567
|
const zlibOptions = {
|
|
2507
2568
|
flush: zlib__default["default"].constants.Z_SYNC_FLUSH,
|
|
2508
2569
|
finishFlush: zlib__default["default"].constants.Z_SYNC_FLUSH
|
|
@@ -2523,6 +2584,14 @@ const supportedProtocols = platform.protocols.map(protocol => {
|
|
|
2523
2584
|
return protocol + ':';
|
|
2524
2585
|
});
|
|
2525
2586
|
|
|
2587
|
+
const flushOnFinish = (stream, [throttled, flush]) => {
|
|
2588
|
+
stream
|
|
2589
|
+
.on('end', flush)
|
|
2590
|
+
.on('error', flush);
|
|
2591
|
+
|
|
2592
|
+
return throttled;
|
|
2593
|
+
};
|
|
2594
|
+
|
|
2526
2595
|
/**
|
|
2527
2596
|
* If the proxy or config beforeRedirects functions are defined, call them with the options
|
|
2528
2597
|
* object.
|
|
@@ -2698,7 +2767,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
2698
2767
|
|
|
2699
2768
|
// Parse url
|
|
2700
2769
|
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
2701
|
-
const parsed = new URL(fullPath,
|
|
2770
|
+
const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);
|
|
2702
2771
|
const protocol = parsed.protocol || supportedProtocols[0];
|
|
2703
2772
|
|
|
2704
2773
|
if (protocol === 'data:') {
|
|
@@ -2756,8 +2825,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
2756
2825
|
// Only set header if it hasn't been set in config
|
|
2757
2826
|
headers.set('User-Agent', 'axios/' + VERSION, false);
|
|
2758
2827
|
|
|
2759
|
-
const onDownloadProgress = config
|
|
2760
|
-
const onUploadProgress = config.onUploadProgress;
|
|
2828
|
+
const {onUploadProgress, onDownloadProgress} = config;
|
|
2761
2829
|
const maxRate = config.maxRate;
|
|
2762
2830
|
let maxUploadRate = undefined;
|
|
2763
2831
|
let maxDownloadRate = undefined;
|
|
@@ -2828,15 +2896,16 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
2828
2896
|
}
|
|
2829
2897
|
|
|
2830
2898
|
data = stream__default["default"].pipeline([data, new AxiosTransformStream$1({
|
|
2831
|
-
length: contentLength,
|
|
2832
2899
|
maxRate: utils$1.toFiniteNumber(maxUploadRate)
|
|
2833
2900
|
})], utils$1.noop);
|
|
2834
2901
|
|
|
2835
|
-
onUploadProgress && data.on('progress',
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2902
|
+
onUploadProgress && data.on('progress', flushOnFinish(
|
|
2903
|
+
data,
|
|
2904
|
+
progressEventDecorator(
|
|
2905
|
+
contentLength,
|
|
2906
|
+
progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
|
|
2907
|
+
)
|
|
2908
|
+
));
|
|
2840
2909
|
}
|
|
2841
2910
|
|
|
2842
2911
|
// HTTP basic authentication
|
|
@@ -2894,7 +2963,7 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
2894
2963
|
if (config.socketPath) {
|
|
2895
2964
|
options.socketPath = config.socketPath;
|
|
2896
2965
|
} else {
|
|
2897
|
-
options.hostname = parsed.hostname;
|
|
2966
|
+
options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
|
|
2898
2967
|
options.port = parsed.port;
|
|
2899
2968
|
setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
|
|
2900
2969
|
}
|
|
@@ -2935,17 +3004,18 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
2935
3004
|
|
|
2936
3005
|
const responseLength = +res.headers['content-length'];
|
|
2937
3006
|
|
|
2938
|
-
if (onDownloadProgress) {
|
|
3007
|
+
if (onDownloadProgress || maxDownloadRate) {
|
|
2939
3008
|
const transformStream = new AxiosTransformStream$1({
|
|
2940
|
-
length: utils$1.toFiniteNumber(responseLength),
|
|
2941
3009
|
maxRate: utils$1.toFiniteNumber(maxDownloadRate)
|
|
2942
3010
|
});
|
|
2943
3011
|
|
|
2944
|
-
onDownloadProgress && transformStream.on('progress',
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
3012
|
+
onDownloadProgress && transformStream.on('progress', flushOnFinish(
|
|
3013
|
+
transformStream,
|
|
3014
|
+
progressEventDecorator(
|
|
3015
|
+
responseLength,
|
|
3016
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
|
|
3017
|
+
)
|
|
3018
|
+
));
|
|
2949
3019
|
|
|
2950
3020
|
streams.push(transformStream);
|
|
2951
3021
|
}
|
|
@@ -3158,51 +3228,12 @@ const httpAdapter = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
3158
3228
|
});
|
|
3159
3229
|
};
|
|
3160
3230
|
|
|
3161
|
-
const cookies = platform.hasStandardBrowserEnv ?
|
|
3162
|
-
|
|
3163
|
-
// Standard browser envs support document.cookie
|
|
3164
|
-
{
|
|
3165
|
-
write(name, value, expires, path, domain, secure) {
|
|
3166
|
-
const cookie = [name + '=' + encodeURIComponent(value)];
|
|
3167
|
-
|
|
3168
|
-
utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
|
|
3169
|
-
|
|
3170
|
-
utils$1.isString(path) && cookie.push('path=' + path);
|
|
3171
|
-
|
|
3172
|
-
utils$1.isString(domain) && cookie.push('domain=' + domain);
|
|
3173
|
-
|
|
3174
|
-
secure === true && cookie.push('secure');
|
|
3175
|
-
|
|
3176
|
-
document.cookie = cookie.join('; ');
|
|
3177
|
-
},
|
|
3178
|
-
|
|
3179
|
-
read(name) {
|
|
3180
|
-
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
|
3181
|
-
return (match ? decodeURIComponent(match[3]) : null);
|
|
3182
|
-
},
|
|
3183
|
-
|
|
3184
|
-
remove(name) {
|
|
3185
|
-
this.write(name, '', Date.now() - 86400000);
|
|
3186
|
-
}
|
|
3187
|
-
}
|
|
3188
|
-
|
|
3189
|
-
:
|
|
3190
|
-
|
|
3191
|
-
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
3192
|
-
{
|
|
3193
|
-
write() {},
|
|
3194
|
-
read() {
|
|
3195
|
-
return null;
|
|
3196
|
-
},
|
|
3197
|
-
remove() {}
|
|
3198
|
-
};
|
|
3199
|
-
|
|
3200
3231
|
const isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
|
3201
3232
|
|
|
3202
3233
|
// Standard browser envs have full support of the APIs needed to test
|
|
3203
3234
|
// whether the request URL is of the same origin as current location.
|
|
3204
3235
|
(function standardBrowserEnv() {
|
|
3205
|
-
const msie = /(msie|trident)/i.test(navigator.userAgent);
|
|
3236
|
+
const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent);
|
|
3206
3237
|
const urlParsingNode = document.createElement('a');
|
|
3207
3238
|
let originURL;
|
|
3208
3239
|
|
|
@@ -3260,80 +3291,222 @@ const isURLSameOrigin = platform.hasStandardBrowserEnv ?
|
|
|
3260
3291
|
};
|
|
3261
3292
|
})();
|
|
3262
3293
|
|
|
3263
|
-
|
|
3264
|
-
let bytesNotified = 0;
|
|
3265
|
-
const _speedometer = speedometer(50, 250);
|
|
3294
|
+
const cookies = platform.hasStandardBrowserEnv ?
|
|
3266
3295
|
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
const rate = _speedometer(progressBytes);
|
|
3272
|
-
const inRange = loaded <= total;
|
|
3296
|
+
// Standard browser envs support document.cookie
|
|
3297
|
+
{
|
|
3298
|
+
write(name, value, expires, path, domain, secure) {
|
|
3299
|
+
const cookie = [name + '=' + encodeURIComponent(value)];
|
|
3273
3300
|
|
|
3274
|
-
|
|
3301
|
+
utils$1.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());
|
|
3275
3302
|
|
|
3276
|
-
|
|
3277
|
-
loaded,
|
|
3278
|
-
total,
|
|
3279
|
-
progress: total ? (loaded / total) : undefined,
|
|
3280
|
-
bytes: progressBytes,
|
|
3281
|
-
rate: rate ? rate : undefined,
|
|
3282
|
-
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
3283
|
-
event: e
|
|
3284
|
-
};
|
|
3303
|
+
utils$1.isString(path) && cookie.push('path=' + path);
|
|
3285
3304
|
|
|
3286
|
-
|
|
3305
|
+
utils$1.isString(domain) && cookie.push('domain=' + domain);
|
|
3287
3306
|
|
|
3288
|
-
|
|
3307
|
+
secure === true && cookie.push('secure');
|
|
3308
|
+
|
|
3309
|
+
document.cookie = cookie.join('; ');
|
|
3310
|
+
},
|
|
3311
|
+
|
|
3312
|
+
read(name) {
|
|
3313
|
+
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
|
|
3314
|
+
return (match ? decodeURIComponent(match[3]) : null);
|
|
3315
|
+
},
|
|
3316
|
+
|
|
3317
|
+
remove(name) {
|
|
3318
|
+
this.write(name, '', Date.now() - 86400000);
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
|
|
3322
|
+
:
|
|
3323
|
+
|
|
3324
|
+
// Non-standard browser env (web workers, react-native) lack needed support.
|
|
3325
|
+
{
|
|
3326
|
+
write() {},
|
|
3327
|
+
read() {
|
|
3328
|
+
return null;
|
|
3329
|
+
},
|
|
3330
|
+
remove() {}
|
|
3289
3331
|
};
|
|
3332
|
+
|
|
3333
|
+
const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
3334
|
+
|
|
3335
|
+
/**
|
|
3336
|
+
* Config-specific merge-function which creates a new config-object
|
|
3337
|
+
* by merging two configuration objects together.
|
|
3338
|
+
*
|
|
3339
|
+
* @param {Object} config1
|
|
3340
|
+
* @param {Object} config2
|
|
3341
|
+
*
|
|
3342
|
+
* @returns {Object} New object resulting from merging config2 to config1
|
|
3343
|
+
*/
|
|
3344
|
+
function mergeConfig(config1, config2) {
|
|
3345
|
+
// eslint-disable-next-line no-param-reassign
|
|
3346
|
+
config2 = config2 || {};
|
|
3347
|
+
const config = {};
|
|
3348
|
+
|
|
3349
|
+
function getMergedValue(target, source, caseless) {
|
|
3350
|
+
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
3351
|
+
return utils$1.merge.call({caseless}, target, source);
|
|
3352
|
+
} else if (utils$1.isPlainObject(source)) {
|
|
3353
|
+
return utils$1.merge({}, source);
|
|
3354
|
+
} else if (utils$1.isArray(source)) {
|
|
3355
|
+
return source.slice();
|
|
3356
|
+
}
|
|
3357
|
+
return source;
|
|
3358
|
+
}
|
|
3359
|
+
|
|
3360
|
+
// eslint-disable-next-line consistent-return
|
|
3361
|
+
function mergeDeepProperties(a, b, caseless) {
|
|
3362
|
+
if (!utils$1.isUndefined(b)) {
|
|
3363
|
+
return getMergedValue(a, b, caseless);
|
|
3364
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
3365
|
+
return getMergedValue(undefined, a, caseless);
|
|
3366
|
+
}
|
|
3367
|
+
}
|
|
3368
|
+
|
|
3369
|
+
// eslint-disable-next-line consistent-return
|
|
3370
|
+
function valueFromConfig2(a, b) {
|
|
3371
|
+
if (!utils$1.isUndefined(b)) {
|
|
3372
|
+
return getMergedValue(undefined, b);
|
|
3373
|
+
}
|
|
3374
|
+
}
|
|
3375
|
+
|
|
3376
|
+
// eslint-disable-next-line consistent-return
|
|
3377
|
+
function defaultToConfig2(a, b) {
|
|
3378
|
+
if (!utils$1.isUndefined(b)) {
|
|
3379
|
+
return getMergedValue(undefined, b);
|
|
3380
|
+
} else if (!utils$1.isUndefined(a)) {
|
|
3381
|
+
return getMergedValue(undefined, a);
|
|
3382
|
+
}
|
|
3383
|
+
}
|
|
3384
|
+
|
|
3385
|
+
// eslint-disable-next-line consistent-return
|
|
3386
|
+
function mergeDirectKeys(a, b, prop) {
|
|
3387
|
+
if (prop in config2) {
|
|
3388
|
+
return getMergedValue(a, b);
|
|
3389
|
+
} else if (prop in config1) {
|
|
3390
|
+
return getMergedValue(undefined, a);
|
|
3391
|
+
}
|
|
3392
|
+
}
|
|
3393
|
+
|
|
3394
|
+
const mergeMap = {
|
|
3395
|
+
url: valueFromConfig2,
|
|
3396
|
+
method: valueFromConfig2,
|
|
3397
|
+
data: valueFromConfig2,
|
|
3398
|
+
baseURL: defaultToConfig2,
|
|
3399
|
+
transformRequest: defaultToConfig2,
|
|
3400
|
+
transformResponse: defaultToConfig2,
|
|
3401
|
+
paramsSerializer: defaultToConfig2,
|
|
3402
|
+
timeout: defaultToConfig2,
|
|
3403
|
+
timeoutMessage: defaultToConfig2,
|
|
3404
|
+
withCredentials: defaultToConfig2,
|
|
3405
|
+
withXSRFToken: defaultToConfig2,
|
|
3406
|
+
adapter: defaultToConfig2,
|
|
3407
|
+
responseType: defaultToConfig2,
|
|
3408
|
+
xsrfCookieName: defaultToConfig2,
|
|
3409
|
+
xsrfHeaderName: defaultToConfig2,
|
|
3410
|
+
onUploadProgress: defaultToConfig2,
|
|
3411
|
+
onDownloadProgress: defaultToConfig2,
|
|
3412
|
+
decompress: defaultToConfig2,
|
|
3413
|
+
maxContentLength: defaultToConfig2,
|
|
3414
|
+
maxBodyLength: defaultToConfig2,
|
|
3415
|
+
beforeRedirect: defaultToConfig2,
|
|
3416
|
+
transport: defaultToConfig2,
|
|
3417
|
+
httpAgent: defaultToConfig2,
|
|
3418
|
+
httpsAgent: defaultToConfig2,
|
|
3419
|
+
cancelToken: defaultToConfig2,
|
|
3420
|
+
socketPath: defaultToConfig2,
|
|
3421
|
+
responseEncoding: defaultToConfig2,
|
|
3422
|
+
validateStatus: mergeDirectKeys,
|
|
3423
|
+
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
3424
|
+
};
|
|
3425
|
+
|
|
3426
|
+
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
3427
|
+
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
3428
|
+
const configValue = merge(config1[prop], config2[prop], prop);
|
|
3429
|
+
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
3430
|
+
});
|
|
3431
|
+
|
|
3432
|
+
return config;
|
|
3290
3433
|
}
|
|
3291
3434
|
|
|
3292
|
-
const
|
|
3435
|
+
const resolveConfig = (config) => {
|
|
3436
|
+
const newConfig = mergeConfig({}, config);
|
|
3293
3437
|
|
|
3294
|
-
|
|
3295
|
-
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
3296
|
-
let requestData = config.data;
|
|
3297
|
-
const requestHeaders = AxiosHeaders$1.from(config.headers).normalize();
|
|
3298
|
-
let {responseType, withXSRFToken} = config;
|
|
3299
|
-
let onCanceled;
|
|
3300
|
-
function done() {
|
|
3301
|
-
if (config.cancelToken) {
|
|
3302
|
-
config.cancelToken.unsubscribe(onCanceled);
|
|
3303
|
-
}
|
|
3438
|
+
let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;
|
|
3304
3439
|
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3440
|
+
newConfig.headers = headers = AxiosHeaders$1.from(headers);
|
|
3441
|
+
|
|
3442
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
|
|
3443
|
+
|
|
3444
|
+
// HTTP basic authentication
|
|
3445
|
+
if (auth) {
|
|
3446
|
+
headers.set('Authorization', 'Basic ' +
|
|
3447
|
+
btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
|
|
3448
|
+
);
|
|
3449
|
+
}
|
|
3450
|
+
|
|
3451
|
+
let contentType;
|
|
3452
|
+
|
|
3453
|
+
if (utils$1.isFormData(data)) {
|
|
3454
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
3455
|
+
headers.setContentType(undefined); // Let the browser set it
|
|
3456
|
+
} else if ((contentType = headers.getContentType()) !== false) {
|
|
3457
|
+
// fix semicolon duplication issue for ReactNative FormData implementation
|
|
3458
|
+
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
|
3459
|
+
headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
|
3308
3460
|
}
|
|
3461
|
+
}
|
|
3309
3462
|
|
|
3310
|
-
|
|
3463
|
+
// Add xsrf header
|
|
3464
|
+
// This is only done if running in a standard browser environment.
|
|
3465
|
+
// Specifically not if we're in a web worker, or react-native.
|
|
3311
3466
|
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3467
|
+
if (platform.hasStandardBrowserEnv) {
|
|
3468
|
+
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
3469
|
+
|
|
3470
|
+
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
|
|
3471
|
+
// Add xsrf header
|
|
3472
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
3473
|
+
|
|
3474
|
+
if (xsrfValue) {
|
|
3475
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
|
3319
3476
|
}
|
|
3320
3477
|
}
|
|
3478
|
+
}
|
|
3321
3479
|
|
|
3322
|
-
|
|
3480
|
+
return newConfig;
|
|
3481
|
+
};
|
|
3323
3482
|
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3483
|
+
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
3484
|
+
|
|
3485
|
+
const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
3486
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
3487
|
+
const _config = resolveConfig(config);
|
|
3488
|
+
let requestData = _config.data;
|
|
3489
|
+
const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
|
|
3490
|
+
let {responseType, onUploadProgress, onDownloadProgress} = _config;
|
|
3491
|
+
let onCanceled;
|
|
3492
|
+
let uploadThrottled, downloadThrottled;
|
|
3493
|
+
let flushUpload, flushDownload;
|
|
3494
|
+
|
|
3495
|
+
function done() {
|
|
3496
|
+
flushUpload && flushUpload(); // flush events
|
|
3497
|
+
flushDownload && flushDownload(); // flush events
|
|
3498
|
+
|
|
3499
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
3500
|
+
|
|
3501
|
+
_config.signal && _config.signal.removeEventListener('abort', onCanceled);
|
|
3329
3502
|
}
|
|
3330
3503
|
|
|
3331
|
-
|
|
3504
|
+
let request = new XMLHttpRequest();
|
|
3332
3505
|
|
|
3333
|
-
request.open(
|
|
3506
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
3334
3507
|
|
|
3335
3508
|
// Set the request timeout in MS
|
|
3336
|
-
request.timeout =
|
|
3509
|
+
request.timeout = _config.timeout;
|
|
3337
3510
|
|
|
3338
3511
|
function onloadend() {
|
|
3339
3512
|
if (!request) {
|
|
@@ -3413,10 +3586,10 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
3413
3586
|
|
|
3414
3587
|
// Handle timeout
|
|
3415
3588
|
request.ontimeout = function handleTimeout() {
|
|
3416
|
-
let timeoutErrorMessage =
|
|
3417
|
-
const transitional =
|
|
3418
|
-
if (
|
|
3419
|
-
timeoutErrorMessage =
|
|
3589
|
+
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
3590
|
+
const transitional = _config.transitional || transitionalDefaults;
|
|
3591
|
+
if (_config.timeoutErrorMessage) {
|
|
3592
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
3420
3593
|
}
|
|
3421
3594
|
reject(new AxiosError(
|
|
3422
3595
|
timeoutErrorMessage,
|
|
@@ -3428,22 +3601,6 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
3428
3601
|
request = null;
|
|
3429
3602
|
};
|
|
3430
3603
|
|
|
3431
|
-
// Add xsrf header
|
|
3432
|
-
// This is only done if running in a standard browser environment.
|
|
3433
|
-
// Specifically not if we're in a web worker, or react-native.
|
|
3434
|
-
if(platform.hasStandardBrowserEnv) {
|
|
3435
|
-
withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
|
|
3436
|
-
|
|
3437
|
-
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
|
|
3438
|
-
// Add xsrf header
|
|
3439
|
-
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
|
3440
|
-
|
|
3441
|
-
if (xsrfValue) {
|
|
3442
|
-
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
|
3443
|
-
}
|
|
3444
|
-
}
|
|
3445
|
-
}
|
|
3446
|
-
|
|
3447
3604
|
// Remove Content-Type if data is undefined
|
|
3448
3605
|
requestData === undefined && requestHeaders.setContentType(null);
|
|
3449
3606
|
|
|
@@ -3455,26 +3612,31 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
3455
3612
|
}
|
|
3456
3613
|
|
|
3457
3614
|
// Add withCredentials to request if needed
|
|
3458
|
-
if (!utils$1.isUndefined(
|
|
3459
|
-
request.withCredentials = !!
|
|
3615
|
+
if (!utils$1.isUndefined(_config.withCredentials)) {
|
|
3616
|
+
request.withCredentials = !!_config.withCredentials;
|
|
3460
3617
|
}
|
|
3461
3618
|
|
|
3462
3619
|
// Add responseType to request if needed
|
|
3463
3620
|
if (responseType && responseType !== 'json') {
|
|
3464
|
-
request.responseType =
|
|
3621
|
+
request.responseType = _config.responseType;
|
|
3465
3622
|
}
|
|
3466
3623
|
|
|
3467
3624
|
// Handle progress if needed
|
|
3468
|
-
if (
|
|
3469
|
-
|
|
3625
|
+
if (onDownloadProgress) {
|
|
3626
|
+
([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));
|
|
3627
|
+
request.addEventListener('progress', downloadThrottled);
|
|
3470
3628
|
}
|
|
3471
3629
|
|
|
3472
3630
|
// Not all browsers support upload events
|
|
3473
|
-
if (
|
|
3474
|
-
|
|
3631
|
+
if (onUploadProgress && request.upload) {
|
|
3632
|
+
([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
|
|
3633
|
+
|
|
3634
|
+
request.upload.addEventListener('progress', uploadThrottled);
|
|
3635
|
+
|
|
3636
|
+
request.upload.addEventListener('loadend', flushUpload);
|
|
3475
3637
|
}
|
|
3476
3638
|
|
|
3477
|
-
if (
|
|
3639
|
+
if (_config.cancelToken || _config.signal) {
|
|
3478
3640
|
// Handle cancellation
|
|
3479
3641
|
// eslint-disable-next-line func-names
|
|
3480
3642
|
onCanceled = cancel => {
|
|
@@ -3486,13 +3648,13 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
3486
3648
|
request = null;
|
|
3487
3649
|
};
|
|
3488
3650
|
|
|
3489
|
-
|
|
3490
|
-
if (
|
|
3491
|
-
|
|
3651
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
3652
|
+
if (_config.signal) {
|
|
3653
|
+
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
|
|
3492
3654
|
}
|
|
3493
3655
|
}
|
|
3494
3656
|
|
|
3495
|
-
const protocol = parseProtocol(
|
|
3657
|
+
const protocol = parseProtocol(_config.url);
|
|
3496
3658
|
|
|
3497
3659
|
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
3498
3660
|
reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
|
|
@@ -3505,9 +3667,360 @@ const xhrAdapter = isXHRAdapterSupported && function (config) {
|
|
|
3505
3667
|
});
|
|
3506
3668
|
};
|
|
3507
3669
|
|
|
3670
|
+
const composeSignals = (signals, timeout) => {
|
|
3671
|
+
const {length} = (signals = signals ? signals.filter(Boolean) : []);
|
|
3672
|
+
|
|
3673
|
+
if (timeout || length) {
|
|
3674
|
+
let controller = new AbortController();
|
|
3675
|
+
|
|
3676
|
+
let aborted;
|
|
3677
|
+
|
|
3678
|
+
const onabort = function (reason) {
|
|
3679
|
+
if (!aborted) {
|
|
3680
|
+
aborted = true;
|
|
3681
|
+
unsubscribe();
|
|
3682
|
+
const err = reason instanceof Error ? reason : this.reason;
|
|
3683
|
+
controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
|
|
3684
|
+
}
|
|
3685
|
+
};
|
|
3686
|
+
|
|
3687
|
+
let timer = timeout && setTimeout(() => {
|
|
3688
|
+
timer = null;
|
|
3689
|
+
onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
|
|
3690
|
+
}, timeout);
|
|
3691
|
+
|
|
3692
|
+
const unsubscribe = () => {
|
|
3693
|
+
if (signals) {
|
|
3694
|
+
timer && clearTimeout(timer);
|
|
3695
|
+
timer = null;
|
|
3696
|
+
signals.forEach(signal => {
|
|
3697
|
+
signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
|
|
3698
|
+
});
|
|
3699
|
+
signals = null;
|
|
3700
|
+
}
|
|
3701
|
+
};
|
|
3702
|
+
|
|
3703
|
+
signals.forEach((signal) => signal.addEventListener('abort', onabort));
|
|
3704
|
+
|
|
3705
|
+
const {signal} = controller;
|
|
3706
|
+
|
|
3707
|
+
signal.unsubscribe = () => utils$1.asap(unsubscribe);
|
|
3708
|
+
|
|
3709
|
+
return signal;
|
|
3710
|
+
}
|
|
3711
|
+
};
|
|
3712
|
+
|
|
3713
|
+
const composeSignals$1 = composeSignals;
|
|
3714
|
+
|
|
3715
|
+
const streamChunk = function* (chunk, chunkSize) {
|
|
3716
|
+
let len = chunk.byteLength;
|
|
3717
|
+
|
|
3718
|
+
if (!chunkSize || len < chunkSize) {
|
|
3719
|
+
yield chunk;
|
|
3720
|
+
return;
|
|
3721
|
+
}
|
|
3722
|
+
|
|
3723
|
+
let pos = 0;
|
|
3724
|
+
let end;
|
|
3725
|
+
|
|
3726
|
+
while (pos < len) {
|
|
3727
|
+
end = pos + chunkSize;
|
|
3728
|
+
yield chunk.slice(pos, end);
|
|
3729
|
+
pos = end;
|
|
3730
|
+
}
|
|
3731
|
+
};
|
|
3732
|
+
|
|
3733
|
+
const readBytes = async function* (iterable, chunkSize) {
|
|
3734
|
+
for await (const chunk of readStream(iterable)) {
|
|
3735
|
+
yield* streamChunk(chunk, chunkSize);
|
|
3736
|
+
}
|
|
3737
|
+
};
|
|
3738
|
+
|
|
3739
|
+
const readStream = async function* (stream) {
|
|
3740
|
+
if (stream[Symbol.asyncIterator]) {
|
|
3741
|
+
yield* stream;
|
|
3742
|
+
return;
|
|
3743
|
+
}
|
|
3744
|
+
|
|
3745
|
+
const reader = stream.getReader();
|
|
3746
|
+
try {
|
|
3747
|
+
for (;;) {
|
|
3748
|
+
const {done, value} = await reader.read();
|
|
3749
|
+
if (done) {
|
|
3750
|
+
break;
|
|
3751
|
+
}
|
|
3752
|
+
yield value;
|
|
3753
|
+
}
|
|
3754
|
+
} finally {
|
|
3755
|
+
await reader.cancel();
|
|
3756
|
+
}
|
|
3757
|
+
};
|
|
3758
|
+
|
|
3759
|
+
const trackStream = (stream, chunkSize, onProgress, onFinish) => {
|
|
3760
|
+
const iterator = readBytes(stream, chunkSize);
|
|
3761
|
+
|
|
3762
|
+
let bytes = 0;
|
|
3763
|
+
let done;
|
|
3764
|
+
let _onFinish = (e) => {
|
|
3765
|
+
if (!done) {
|
|
3766
|
+
done = true;
|
|
3767
|
+
onFinish && onFinish(e);
|
|
3768
|
+
}
|
|
3769
|
+
};
|
|
3770
|
+
|
|
3771
|
+
return new ReadableStream({
|
|
3772
|
+
async pull(controller) {
|
|
3773
|
+
try {
|
|
3774
|
+
const {done, value} = await iterator.next();
|
|
3775
|
+
|
|
3776
|
+
if (done) {
|
|
3777
|
+
_onFinish();
|
|
3778
|
+
controller.close();
|
|
3779
|
+
return;
|
|
3780
|
+
}
|
|
3781
|
+
|
|
3782
|
+
let len = value.byteLength;
|
|
3783
|
+
if (onProgress) {
|
|
3784
|
+
let loadedBytes = bytes += len;
|
|
3785
|
+
onProgress(loadedBytes);
|
|
3786
|
+
}
|
|
3787
|
+
controller.enqueue(new Uint8Array(value));
|
|
3788
|
+
} catch (err) {
|
|
3789
|
+
_onFinish(err);
|
|
3790
|
+
throw err;
|
|
3791
|
+
}
|
|
3792
|
+
},
|
|
3793
|
+
cancel(reason) {
|
|
3794
|
+
_onFinish(reason);
|
|
3795
|
+
return iterator.return();
|
|
3796
|
+
}
|
|
3797
|
+
}, {
|
|
3798
|
+
highWaterMark: 2
|
|
3799
|
+
})
|
|
3800
|
+
};
|
|
3801
|
+
|
|
3802
|
+
const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
|
|
3803
|
+
const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
|
|
3804
|
+
|
|
3805
|
+
// used only inside the fetch adapter
|
|
3806
|
+
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
|
3807
|
+
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
|
3808
|
+
async (str) => new Uint8Array(await new Response(str).arrayBuffer())
|
|
3809
|
+
);
|
|
3810
|
+
|
|
3811
|
+
const test = (fn, ...args) => {
|
|
3812
|
+
try {
|
|
3813
|
+
return !!fn(...args);
|
|
3814
|
+
} catch (e) {
|
|
3815
|
+
return false
|
|
3816
|
+
}
|
|
3817
|
+
};
|
|
3818
|
+
|
|
3819
|
+
const supportsRequestStream = isReadableStreamSupported && test(() => {
|
|
3820
|
+
let duplexAccessed = false;
|
|
3821
|
+
|
|
3822
|
+
const hasContentType = new Request(platform.origin, {
|
|
3823
|
+
body: new ReadableStream(),
|
|
3824
|
+
method: 'POST',
|
|
3825
|
+
get duplex() {
|
|
3826
|
+
duplexAccessed = true;
|
|
3827
|
+
return 'half';
|
|
3828
|
+
},
|
|
3829
|
+
}).headers.has('Content-Type');
|
|
3830
|
+
|
|
3831
|
+
return duplexAccessed && !hasContentType;
|
|
3832
|
+
});
|
|
3833
|
+
|
|
3834
|
+
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
3835
|
+
|
|
3836
|
+
const supportsResponseStream = isReadableStreamSupported &&
|
|
3837
|
+
test(() => utils$1.isReadableStream(new Response('').body));
|
|
3838
|
+
|
|
3839
|
+
|
|
3840
|
+
const resolvers = {
|
|
3841
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
3842
|
+
};
|
|
3843
|
+
|
|
3844
|
+
isFetchSupported && (((res) => {
|
|
3845
|
+
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
|
3846
|
+
!resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res) => res[type]() :
|
|
3847
|
+
(_, config) => {
|
|
3848
|
+
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
|
|
3849
|
+
});
|
|
3850
|
+
});
|
|
3851
|
+
})(new Response));
|
|
3852
|
+
|
|
3853
|
+
const getBodyLength = async (body) => {
|
|
3854
|
+
if (body == null) {
|
|
3855
|
+
return 0;
|
|
3856
|
+
}
|
|
3857
|
+
|
|
3858
|
+
if(utils$1.isBlob(body)) {
|
|
3859
|
+
return body.size;
|
|
3860
|
+
}
|
|
3861
|
+
|
|
3862
|
+
if(utils$1.isSpecCompliantForm(body)) {
|
|
3863
|
+
const _request = new Request(platform.origin, {
|
|
3864
|
+
method: 'POST',
|
|
3865
|
+
body,
|
|
3866
|
+
});
|
|
3867
|
+
return (await _request.arrayBuffer()).byteLength;
|
|
3868
|
+
}
|
|
3869
|
+
|
|
3870
|
+
if(utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
|
|
3871
|
+
return body.byteLength;
|
|
3872
|
+
}
|
|
3873
|
+
|
|
3874
|
+
if(utils$1.isURLSearchParams(body)) {
|
|
3875
|
+
body = body + '';
|
|
3876
|
+
}
|
|
3877
|
+
|
|
3878
|
+
if(utils$1.isString(body)) {
|
|
3879
|
+
return (await encodeText(body)).byteLength;
|
|
3880
|
+
}
|
|
3881
|
+
};
|
|
3882
|
+
|
|
3883
|
+
const resolveBodyLength = async (headers, body) => {
|
|
3884
|
+
const length = utils$1.toFiniteNumber(headers.getContentLength());
|
|
3885
|
+
|
|
3886
|
+
return length == null ? getBodyLength(body) : length;
|
|
3887
|
+
};
|
|
3888
|
+
|
|
3889
|
+
const fetchAdapter = isFetchSupported && (async (config) => {
|
|
3890
|
+
let {
|
|
3891
|
+
url,
|
|
3892
|
+
method,
|
|
3893
|
+
data,
|
|
3894
|
+
signal,
|
|
3895
|
+
cancelToken,
|
|
3896
|
+
timeout,
|
|
3897
|
+
onDownloadProgress,
|
|
3898
|
+
onUploadProgress,
|
|
3899
|
+
responseType,
|
|
3900
|
+
headers,
|
|
3901
|
+
withCredentials = 'same-origin',
|
|
3902
|
+
fetchOptions
|
|
3903
|
+
} = resolveConfig(config);
|
|
3904
|
+
|
|
3905
|
+
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
3906
|
+
|
|
3907
|
+
let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
3908
|
+
|
|
3909
|
+
let request;
|
|
3910
|
+
|
|
3911
|
+
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
3912
|
+
composedSignal.unsubscribe();
|
|
3913
|
+
});
|
|
3914
|
+
|
|
3915
|
+
let requestContentLength;
|
|
3916
|
+
|
|
3917
|
+
try {
|
|
3918
|
+
if (
|
|
3919
|
+
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
|
|
3920
|
+
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
|
3921
|
+
) {
|
|
3922
|
+
let _request = new Request(url, {
|
|
3923
|
+
method: 'POST',
|
|
3924
|
+
body: data,
|
|
3925
|
+
duplex: "half"
|
|
3926
|
+
});
|
|
3927
|
+
|
|
3928
|
+
let contentTypeHeader;
|
|
3929
|
+
|
|
3930
|
+
if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
|
3931
|
+
headers.setContentType(contentTypeHeader);
|
|
3932
|
+
}
|
|
3933
|
+
|
|
3934
|
+
if (_request.body) {
|
|
3935
|
+
const [onProgress, flush] = progressEventDecorator(
|
|
3936
|
+
requestContentLength,
|
|
3937
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
3938
|
+
);
|
|
3939
|
+
|
|
3940
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
3941
|
+
}
|
|
3942
|
+
}
|
|
3943
|
+
|
|
3944
|
+
if (!utils$1.isString(withCredentials)) {
|
|
3945
|
+
withCredentials = withCredentials ? 'include' : 'omit';
|
|
3946
|
+
}
|
|
3947
|
+
|
|
3948
|
+
// Cloudflare Workers throws when credentials are defined
|
|
3949
|
+
// see https://github.com/cloudflare/workerd/issues/902
|
|
3950
|
+
const isCredentialsSupported = "credentials" in Request.prototype;
|
|
3951
|
+
request = new Request(url, {
|
|
3952
|
+
...fetchOptions,
|
|
3953
|
+
signal: composedSignal,
|
|
3954
|
+
method: method.toUpperCase(),
|
|
3955
|
+
headers: headers.normalize().toJSON(),
|
|
3956
|
+
body: data,
|
|
3957
|
+
duplex: "half",
|
|
3958
|
+
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
3959
|
+
});
|
|
3960
|
+
|
|
3961
|
+
let response = await fetch(request);
|
|
3962
|
+
|
|
3963
|
+
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
3964
|
+
|
|
3965
|
+
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
|
3966
|
+
const options = {};
|
|
3967
|
+
|
|
3968
|
+
['status', 'statusText', 'headers'].forEach(prop => {
|
|
3969
|
+
options[prop] = response[prop];
|
|
3970
|
+
});
|
|
3971
|
+
|
|
3972
|
+
const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
|
|
3973
|
+
|
|
3974
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
3975
|
+
responseContentLength,
|
|
3976
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
3977
|
+
) || [];
|
|
3978
|
+
|
|
3979
|
+
response = new Response(
|
|
3980
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
3981
|
+
flush && flush();
|
|
3982
|
+
unsubscribe && unsubscribe();
|
|
3983
|
+
}),
|
|
3984
|
+
options
|
|
3985
|
+
);
|
|
3986
|
+
}
|
|
3987
|
+
|
|
3988
|
+
responseType = responseType || 'text';
|
|
3989
|
+
|
|
3990
|
+
let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
|
|
3991
|
+
|
|
3992
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
|
3993
|
+
|
|
3994
|
+
return await new Promise((resolve, reject) => {
|
|
3995
|
+
settle(resolve, reject, {
|
|
3996
|
+
data: responseData,
|
|
3997
|
+
headers: AxiosHeaders$1.from(response.headers),
|
|
3998
|
+
status: response.status,
|
|
3999
|
+
statusText: response.statusText,
|
|
4000
|
+
config,
|
|
4001
|
+
request
|
|
4002
|
+
});
|
|
4003
|
+
})
|
|
4004
|
+
} catch (err) {
|
|
4005
|
+
unsubscribe && unsubscribe();
|
|
4006
|
+
|
|
4007
|
+
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
|
|
4008
|
+
throw Object.assign(
|
|
4009
|
+
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
|
|
4010
|
+
{
|
|
4011
|
+
cause: err.cause || err
|
|
4012
|
+
}
|
|
4013
|
+
)
|
|
4014
|
+
}
|
|
4015
|
+
|
|
4016
|
+
throw AxiosError.from(err, err && err.code, config, request);
|
|
4017
|
+
}
|
|
4018
|
+
});
|
|
4019
|
+
|
|
3508
4020
|
const knownAdapters = {
|
|
3509
4021
|
http: httpAdapter,
|
|
3510
|
-
xhr: xhrAdapter
|
|
4022
|
+
xhr: xhrAdapter,
|
|
4023
|
+
fetch: fetchAdapter
|
|
3511
4024
|
};
|
|
3512
4025
|
|
|
3513
4026
|
utils$1.forEach(knownAdapters, (fn, value) => {
|
|
@@ -3651,108 +4164,6 @@ function dispatchRequest(config) {
|
|
|
3651
4164
|
});
|
|
3652
4165
|
}
|
|
3653
4166
|
|
|
3654
|
-
const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
|
|
3655
|
-
|
|
3656
|
-
/**
|
|
3657
|
-
* Config-specific merge-function which creates a new config-object
|
|
3658
|
-
* by merging two configuration objects together.
|
|
3659
|
-
*
|
|
3660
|
-
* @param {Object} config1
|
|
3661
|
-
* @param {Object} config2
|
|
3662
|
-
*
|
|
3663
|
-
* @returns {Object} New object resulting from merging config2 to config1
|
|
3664
|
-
*/
|
|
3665
|
-
function mergeConfig(config1, config2) {
|
|
3666
|
-
// eslint-disable-next-line no-param-reassign
|
|
3667
|
-
config2 = config2 || {};
|
|
3668
|
-
const config = {};
|
|
3669
|
-
|
|
3670
|
-
function getMergedValue(target, source, caseless) {
|
|
3671
|
-
if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
|
|
3672
|
-
return utils$1.merge.call({caseless}, target, source);
|
|
3673
|
-
} else if (utils$1.isPlainObject(source)) {
|
|
3674
|
-
return utils$1.merge({}, source);
|
|
3675
|
-
} else if (utils$1.isArray(source)) {
|
|
3676
|
-
return source.slice();
|
|
3677
|
-
}
|
|
3678
|
-
return source;
|
|
3679
|
-
}
|
|
3680
|
-
|
|
3681
|
-
// eslint-disable-next-line consistent-return
|
|
3682
|
-
function mergeDeepProperties(a, b, caseless) {
|
|
3683
|
-
if (!utils$1.isUndefined(b)) {
|
|
3684
|
-
return getMergedValue(a, b, caseless);
|
|
3685
|
-
} else if (!utils$1.isUndefined(a)) {
|
|
3686
|
-
return getMergedValue(undefined, a, caseless);
|
|
3687
|
-
}
|
|
3688
|
-
}
|
|
3689
|
-
|
|
3690
|
-
// eslint-disable-next-line consistent-return
|
|
3691
|
-
function valueFromConfig2(a, b) {
|
|
3692
|
-
if (!utils$1.isUndefined(b)) {
|
|
3693
|
-
return getMergedValue(undefined, b);
|
|
3694
|
-
}
|
|
3695
|
-
}
|
|
3696
|
-
|
|
3697
|
-
// eslint-disable-next-line consistent-return
|
|
3698
|
-
function defaultToConfig2(a, b) {
|
|
3699
|
-
if (!utils$1.isUndefined(b)) {
|
|
3700
|
-
return getMergedValue(undefined, b);
|
|
3701
|
-
} else if (!utils$1.isUndefined(a)) {
|
|
3702
|
-
return getMergedValue(undefined, a);
|
|
3703
|
-
}
|
|
3704
|
-
}
|
|
3705
|
-
|
|
3706
|
-
// eslint-disable-next-line consistent-return
|
|
3707
|
-
function mergeDirectKeys(a, b, prop) {
|
|
3708
|
-
if (prop in config2) {
|
|
3709
|
-
return getMergedValue(a, b);
|
|
3710
|
-
} else if (prop in config1) {
|
|
3711
|
-
return getMergedValue(undefined, a);
|
|
3712
|
-
}
|
|
3713
|
-
}
|
|
3714
|
-
|
|
3715
|
-
const mergeMap = {
|
|
3716
|
-
url: valueFromConfig2,
|
|
3717
|
-
method: valueFromConfig2,
|
|
3718
|
-
data: valueFromConfig2,
|
|
3719
|
-
baseURL: defaultToConfig2,
|
|
3720
|
-
transformRequest: defaultToConfig2,
|
|
3721
|
-
transformResponse: defaultToConfig2,
|
|
3722
|
-
paramsSerializer: defaultToConfig2,
|
|
3723
|
-
timeout: defaultToConfig2,
|
|
3724
|
-
timeoutMessage: defaultToConfig2,
|
|
3725
|
-
withCredentials: defaultToConfig2,
|
|
3726
|
-
withXSRFToken: defaultToConfig2,
|
|
3727
|
-
adapter: defaultToConfig2,
|
|
3728
|
-
responseType: defaultToConfig2,
|
|
3729
|
-
xsrfCookieName: defaultToConfig2,
|
|
3730
|
-
xsrfHeaderName: defaultToConfig2,
|
|
3731
|
-
onUploadProgress: defaultToConfig2,
|
|
3732
|
-
onDownloadProgress: defaultToConfig2,
|
|
3733
|
-
decompress: defaultToConfig2,
|
|
3734
|
-
maxContentLength: defaultToConfig2,
|
|
3735
|
-
maxBodyLength: defaultToConfig2,
|
|
3736
|
-
beforeRedirect: defaultToConfig2,
|
|
3737
|
-
transport: defaultToConfig2,
|
|
3738
|
-
httpAgent: defaultToConfig2,
|
|
3739
|
-
httpsAgent: defaultToConfig2,
|
|
3740
|
-
cancelToken: defaultToConfig2,
|
|
3741
|
-
socketPath: defaultToConfig2,
|
|
3742
|
-
responseEncoding: defaultToConfig2,
|
|
3743
|
-
validateStatus: mergeDirectKeys,
|
|
3744
|
-
headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
|
|
3745
|
-
};
|
|
3746
|
-
|
|
3747
|
-
utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
|
|
3748
|
-
const merge = mergeMap[prop] || mergeDeepProperties;
|
|
3749
|
-
const configValue = merge(config1[prop], config2[prop], prop);
|
|
3750
|
-
(utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
|
|
3751
|
-
});
|
|
3752
|
-
|
|
3753
|
-
return config;
|
|
3754
|
-
}
|
|
3755
|
-
|
|
3756
4167
|
const validators$1 = {};
|
|
3757
4168
|
|
|
3758
4169
|
// eslint-disable-next-line func-names
|
|
@@ -3877,12 +4288,15 @@ class Axios {
|
|
|
3877
4288
|
|
|
3878
4289
|
// slice off the Error: ... line
|
|
3879
4290
|
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
4291
|
+
try {
|
|
4292
|
+
if (!err.stack) {
|
|
4293
|
+
err.stack = stack;
|
|
4294
|
+
// match without the 2 top stack lines
|
|
4295
|
+
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
|
|
4296
|
+
err.stack += '\n' + stack;
|
|
4297
|
+
}
|
|
4298
|
+
} catch (e) {
|
|
4299
|
+
// ignore the case where "stack" is an un-writable property
|
|
3886
4300
|
}
|
|
3887
4301
|
}
|
|
3888
4302
|
|
|
@@ -4155,6 +4569,20 @@ class CancelToken {
|
|
|
4155
4569
|
}
|
|
4156
4570
|
}
|
|
4157
4571
|
|
|
4572
|
+
toAbortSignal() {
|
|
4573
|
+
const controller = new AbortController();
|
|
4574
|
+
|
|
4575
|
+
const abort = (err) => {
|
|
4576
|
+
controller.abort(err);
|
|
4577
|
+
};
|
|
4578
|
+
|
|
4579
|
+
this.subscribe(abort);
|
|
4580
|
+
|
|
4581
|
+
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
|
4582
|
+
|
|
4583
|
+
return controller.signal;
|
|
4584
|
+
}
|
|
4585
|
+
|
|
4158
4586
|
/**
|
|
4159
4587
|
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
4160
4588
|
* cancels the `CancelToken`.
|