@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
|
@@ -268,7 +268,8 @@ declare namespace axios {
|
|
|
268
268
|
| 'document'
|
|
269
269
|
| 'json'
|
|
270
270
|
| 'text'
|
|
271
|
-
| 'stream'
|
|
271
|
+
| 'stream'
|
|
272
|
+
| 'formdata';
|
|
272
273
|
|
|
273
274
|
type responseEncoding =
|
|
274
275
|
| 'ascii' | 'ASCII'
|
|
@@ -353,11 +354,12 @@ declare namespace axios {
|
|
|
353
354
|
upload?: boolean;
|
|
354
355
|
download?: boolean;
|
|
355
356
|
event?: BrowserProgressEvent;
|
|
357
|
+
lengthComputable: boolean;
|
|
356
358
|
}
|
|
357
359
|
|
|
358
360
|
type Milliseconds = number;
|
|
359
361
|
|
|
360
|
-
type AxiosAdapterName = 'xhr' | 'http' | string;
|
|
362
|
+
type AxiosAdapterName = 'fetch' | 'xhr' | 'http' | string;
|
|
361
363
|
|
|
362
364
|
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
|
|
363
365
|
|
|
@@ -415,6 +417,7 @@ declare namespace axios {
|
|
|
415
417
|
lookup?: ((hostname: string, options: object, cb: (err: Error | null, address: LookupAddress | LookupAddress[], family?: AddressFamily) => void) => void) |
|
|
416
418
|
((hostname: string, options: object) => Promise<[address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress>);
|
|
417
419
|
withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined);
|
|
420
|
+
fetchOptions?: Record<string, any>;
|
|
418
421
|
}
|
|
419
422
|
|
|
420
423
|
// Alias
|
|
@@ -209,7 +209,8 @@ export type ResponseType =
|
|
|
209
209
|
| 'document'
|
|
210
210
|
| 'json'
|
|
211
211
|
| 'text'
|
|
212
|
-
| 'stream'
|
|
212
|
+
| 'stream'
|
|
213
|
+
| 'formdata';
|
|
213
214
|
|
|
214
215
|
export type responseEncoding =
|
|
215
216
|
| 'ascii' | 'ASCII'
|
|
@@ -294,11 +295,12 @@ export interface AxiosProgressEvent {
|
|
|
294
295
|
upload?: boolean;
|
|
295
296
|
download?: boolean;
|
|
296
297
|
event?: BrowserProgressEvent;
|
|
298
|
+
lengthComputable: boolean;
|
|
297
299
|
}
|
|
298
300
|
|
|
299
301
|
type Milliseconds = number;
|
|
300
302
|
|
|
301
|
-
type AxiosAdapterName = 'xhr' | 'http' | string;
|
|
303
|
+
type AxiosAdapterName = 'fetch' | 'xhr' | 'http' | string;
|
|
302
304
|
|
|
303
305
|
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
|
|
304
306
|
|
|
@@ -356,6 +358,7 @@ export interface AxiosRequestConfig<D = any> {
|
|
|
356
358
|
lookup?: ((hostname: string, options: object, cb: (err: Error | null, address: LookupAddress | LookupAddress[], family?: AddressFamily) => void) => void) |
|
|
357
359
|
((hostname: string, options: object) => Promise<[address: LookupAddressEntry | LookupAddressEntry[], family?: AddressFamily] | LookupAddress>);
|
|
358
360
|
withXSRFToken?: boolean | ((config: InternalAxiosRequestConfig) => boolean | undefined);
|
|
361
|
+
fetchOptions?: Record<string, any>;
|
|
359
362
|
}
|
|
360
363
|
|
|
361
364
|
// Alias
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import utils from '../utils.js';
|
|
2
2
|
import httpAdapter from './http.js';
|
|
3
3
|
import xhrAdapter from './xhr.js';
|
|
4
|
+
import fetchAdapter from './fetch.js';
|
|
4
5
|
import AxiosError from "../core/AxiosError.js";
|
|
5
6
|
|
|
6
7
|
const knownAdapters = {
|
|
7
8
|
http: httpAdapter,
|
|
8
|
-
xhr: xhrAdapter
|
|
9
|
+
xhr: xhrAdapter,
|
|
10
|
+
fetch: fetchAdapter
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
utils.forEach(knownAdapters, (fn, value) => {
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import platform from "../platform/index.js";
|
|
2
|
+
import utils from "../utils.js";
|
|
3
|
+
import AxiosError from "../core/AxiosError.js";
|
|
4
|
+
import composeSignals from "../helpers/composeSignals.js";
|
|
5
|
+
import {trackStream} from "../helpers/trackStream.js";
|
|
6
|
+
import AxiosHeaders from "../core/AxiosHeaders.js";
|
|
7
|
+
import {progressEventReducer, progressEventDecorator, asyncDecorator} from "../helpers/progressEventReducer.js";
|
|
8
|
+
import resolveConfig from "../helpers/resolveConfig.js";
|
|
9
|
+
import settle from "../core/settle.js";
|
|
10
|
+
|
|
11
|
+
const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';
|
|
12
|
+
const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';
|
|
13
|
+
|
|
14
|
+
// used only inside the fetch adapter
|
|
15
|
+
const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
|
|
16
|
+
((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
|
|
17
|
+
async (str) => new Uint8Array(await new Response(str).arrayBuffer())
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const test = (fn, ...args) => {
|
|
21
|
+
try {
|
|
22
|
+
return !!fn(...args);
|
|
23
|
+
} catch (e) {
|
|
24
|
+
return false
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const supportsRequestStream = isReadableStreamSupported && test(() => {
|
|
29
|
+
let duplexAccessed = false;
|
|
30
|
+
|
|
31
|
+
const hasContentType = new Request(platform.origin, {
|
|
32
|
+
body: new ReadableStream(),
|
|
33
|
+
method: 'POST',
|
|
34
|
+
get duplex() {
|
|
35
|
+
duplexAccessed = true;
|
|
36
|
+
return 'half';
|
|
37
|
+
},
|
|
38
|
+
}).headers.has('Content-Type');
|
|
39
|
+
|
|
40
|
+
return duplexAccessed && !hasContentType;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
44
|
+
|
|
45
|
+
const supportsResponseStream = isReadableStreamSupported &&
|
|
46
|
+
test(() => utils.isReadableStream(new Response('').body));
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
const resolvers = {
|
|
50
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
isFetchSupported && (((res) => {
|
|
54
|
+
['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
|
|
55
|
+
!resolvers[type] && (resolvers[type] = utils.isFunction(res[type]) ? (res) => res[type]() :
|
|
56
|
+
(_, config) => {
|
|
57
|
+
throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
})(new Response));
|
|
61
|
+
|
|
62
|
+
const getBodyLength = async (body) => {
|
|
63
|
+
if (body == null) {
|
|
64
|
+
return 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if(utils.isBlob(body)) {
|
|
68
|
+
return body.size;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if(utils.isSpecCompliantForm(body)) {
|
|
72
|
+
const _request = new Request(platform.origin, {
|
|
73
|
+
method: 'POST',
|
|
74
|
+
body,
|
|
75
|
+
});
|
|
76
|
+
return (await _request.arrayBuffer()).byteLength;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if(utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {
|
|
80
|
+
return body.byteLength;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if(utils.isURLSearchParams(body)) {
|
|
84
|
+
body = body + '';
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if(utils.isString(body)) {
|
|
88
|
+
return (await encodeText(body)).byteLength;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const resolveBodyLength = async (headers, body) => {
|
|
93
|
+
const length = utils.toFiniteNumber(headers.getContentLength());
|
|
94
|
+
|
|
95
|
+
return length == null ? getBodyLength(body) : length;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export default isFetchSupported && (async (config) => {
|
|
99
|
+
let {
|
|
100
|
+
url,
|
|
101
|
+
method,
|
|
102
|
+
data,
|
|
103
|
+
signal,
|
|
104
|
+
cancelToken,
|
|
105
|
+
timeout,
|
|
106
|
+
onDownloadProgress,
|
|
107
|
+
onUploadProgress,
|
|
108
|
+
responseType,
|
|
109
|
+
headers,
|
|
110
|
+
withCredentials = 'same-origin',
|
|
111
|
+
fetchOptions
|
|
112
|
+
} = resolveConfig(config);
|
|
113
|
+
|
|
114
|
+
responseType = responseType ? (responseType + '').toLowerCase() : 'text';
|
|
115
|
+
|
|
116
|
+
let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
117
|
+
|
|
118
|
+
let request;
|
|
119
|
+
|
|
120
|
+
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
121
|
+
composedSignal.unsubscribe();
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
let requestContentLength;
|
|
125
|
+
|
|
126
|
+
try {
|
|
127
|
+
if (
|
|
128
|
+
onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
|
|
129
|
+
(requestContentLength = await resolveBodyLength(headers, data)) !== 0
|
|
130
|
+
) {
|
|
131
|
+
let _request = new Request(url, {
|
|
132
|
+
method: 'POST',
|
|
133
|
+
body: data,
|
|
134
|
+
duplex: "half"
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
let contentTypeHeader;
|
|
138
|
+
|
|
139
|
+
if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {
|
|
140
|
+
headers.setContentType(contentTypeHeader)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (_request.body) {
|
|
144
|
+
const [onProgress, flush] = progressEventDecorator(
|
|
145
|
+
requestContentLength,
|
|
146
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (!utils.isString(withCredentials)) {
|
|
154
|
+
withCredentials = withCredentials ? 'include' : 'omit';
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Cloudflare Workers throws when credentials are defined
|
|
158
|
+
// see https://github.com/cloudflare/workerd/issues/902
|
|
159
|
+
const isCredentialsSupported = "credentials" in Request.prototype;
|
|
160
|
+
request = new Request(url, {
|
|
161
|
+
...fetchOptions,
|
|
162
|
+
signal: composedSignal,
|
|
163
|
+
method: method.toUpperCase(),
|
|
164
|
+
headers: headers.normalize().toJSON(),
|
|
165
|
+
body: data,
|
|
166
|
+
duplex: "half",
|
|
167
|
+
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
let response = await fetch(request);
|
|
171
|
+
|
|
172
|
+
const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
|
|
173
|
+
|
|
174
|
+
if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
|
|
175
|
+
const options = {};
|
|
176
|
+
|
|
177
|
+
['status', 'statusText', 'headers'].forEach(prop => {
|
|
178
|
+
options[prop] = response[prop];
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));
|
|
182
|
+
|
|
183
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
184
|
+
responseContentLength,
|
|
185
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
186
|
+
) || [];
|
|
187
|
+
|
|
188
|
+
response = new Response(
|
|
189
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
190
|
+
flush && flush();
|
|
191
|
+
unsubscribe && unsubscribe();
|
|
192
|
+
}),
|
|
193
|
+
options
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
responseType = responseType || 'text';
|
|
198
|
+
|
|
199
|
+
let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config);
|
|
200
|
+
|
|
201
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
|
202
|
+
|
|
203
|
+
return await new Promise((resolve, reject) => {
|
|
204
|
+
settle(resolve, reject, {
|
|
205
|
+
data: responseData,
|
|
206
|
+
headers: AxiosHeaders.from(response.headers),
|
|
207
|
+
status: response.status,
|
|
208
|
+
statusText: response.statusText,
|
|
209
|
+
config,
|
|
210
|
+
request
|
|
211
|
+
})
|
|
212
|
+
})
|
|
213
|
+
} catch (err) {
|
|
214
|
+
unsubscribe && unsubscribe();
|
|
215
|
+
|
|
216
|
+
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {
|
|
217
|
+
throw Object.assign(
|
|
218
|
+
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
|
|
219
|
+
{
|
|
220
|
+
cause: err.cause || err
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
throw AxiosError.from(err, err && err.code, config, request);
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
|
|
@@ -24,6 +24,7 @@ import formDataToStream from "../helpers/formDataToStream.js";
|
|
|
24
24
|
import readBlob from "../helpers/readBlob.js";
|
|
25
25
|
import ZlibHeaderTransformStream from '../helpers/ZlibHeaderTransformStream.js';
|
|
26
26
|
import callbackify from "../helpers/callbackify.js";
|
|
27
|
+
import {progressEventReducer, progressEventDecorator, asyncDecorator} from "../helpers/progressEventReducer.js";
|
|
27
28
|
|
|
28
29
|
const zlibOptions = {
|
|
29
30
|
flush: zlib.constants.Z_SYNC_FLUSH,
|
|
@@ -45,6 +46,14 @@ const supportedProtocols = platform.protocols.map(protocol => {
|
|
|
45
46
|
return protocol + ':';
|
|
46
47
|
});
|
|
47
48
|
|
|
49
|
+
const flushOnFinish = (stream, [throttled, flush]) => {
|
|
50
|
+
stream
|
|
51
|
+
.on('end', flush)
|
|
52
|
+
.on('error', flush);
|
|
53
|
+
|
|
54
|
+
return throttled;
|
|
55
|
+
}
|
|
56
|
+
|
|
48
57
|
/**
|
|
49
58
|
* If the proxy or config beforeRedirects functions are defined, call them with the options
|
|
50
59
|
* object.
|
|
@@ -220,7 +229,7 @@ export default isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
220
229
|
|
|
221
230
|
// Parse url
|
|
222
231
|
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
223
|
-
const parsed = new URL(fullPath,
|
|
232
|
+
const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);
|
|
224
233
|
const protocol = parsed.protocol || supportedProtocols[0];
|
|
225
234
|
|
|
226
235
|
if (protocol === 'data:') {
|
|
@@ -278,8 +287,7 @@ export default isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
278
287
|
// Only set header if it hasn't been set in config
|
|
279
288
|
headers.set('User-Agent', 'axios/' + VERSION, false);
|
|
280
289
|
|
|
281
|
-
const onDownloadProgress = config
|
|
282
|
-
const onUploadProgress = config.onUploadProgress;
|
|
290
|
+
const {onUploadProgress, onDownloadProgress} = config;
|
|
283
291
|
const maxRate = config.maxRate;
|
|
284
292
|
let maxUploadRate = undefined;
|
|
285
293
|
let maxDownloadRate = undefined;
|
|
@@ -352,15 +360,16 @@ export default isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
352
360
|
}
|
|
353
361
|
|
|
354
362
|
data = stream.pipeline([data, new AxiosTransformStream({
|
|
355
|
-
length: contentLength,
|
|
356
363
|
maxRate: utils.toFiniteNumber(maxUploadRate)
|
|
357
364
|
})], utils.noop);
|
|
358
365
|
|
|
359
|
-
onUploadProgress && data.on('progress',
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
366
|
+
onUploadProgress && data.on('progress', flushOnFinish(
|
|
367
|
+
data,
|
|
368
|
+
progressEventDecorator(
|
|
369
|
+
contentLength,
|
|
370
|
+
progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
|
|
371
|
+
)
|
|
372
|
+
));
|
|
364
373
|
}
|
|
365
374
|
|
|
366
375
|
// HTTP basic authentication
|
|
@@ -418,7 +427,7 @@ export default isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
418
427
|
if (config.socketPath) {
|
|
419
428
|
options.socketPath = config.socketPath;
|
|
420
429
|
} else {
|
|
421
|
-
options.hostname = parsed.hostname;
|
|
430
|
+
options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
|
|
422
431
|
options.port = parsed.port;
|
|
423
432
|
setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
|
|
424
433
|
}
|
|
@@ -459,17 +468,18 @@ export default isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
459
468
|
|
|
460
469
|
const responseLength = +res.headers['content-length'];
|
|
461
470
|
|
|
462
|
-
if (onDownloadProgress) {
|
|
471
|
+
if (onDownloadProgress || maxDownloadRate) {
|
|
463
472
|
const transformStream = new AxiosTransformStream({
|
|
464
|
-
length: utils.toFiniteNumber(responseLength),
|
|
465
473
|
maxRate: utils.toFiniteNumber(maxDownloadRate)
|
|
466
474
|
});
|
|
467
475
|
|
|
468
|
-
onDownloadProgress && transformStream.on('progress',
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
476
|
+
onDownloadProgress && transformStream.on('progress', flushOnFinish(
|
|
477
|
+
transformStream,
|
|
478
|
+
progressEventDecorator(
|
|
479
|
+
responseLength,
|
|
480
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
|
|
481
|
+
)
|
|
482
|
+
));
|
|
473
483
|
|
|
474
484
|
streams.push(transformStream);
|
|
475
485
|
}
|
|
@@ -1,93 +1,41 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
1
|
import utils from './../utils.js';
|
|
4
2
|
import settle from './../core/settle.js';
|
|
5
|
-
import cookies from './../helpers/cookies.js';
|
|
6
|
-
import buildURL from './../helpers/buildURL.js';
|
|
7
|
-
import buildFullPath from '../core/buildFullPath.js';
|
|
8
|
-
import isURLSameOrigin from './../helpers/isURLSameOrigin.js';
|
|
9
3
|
import transitionalDefaults from '../defaults/transitional.js';
|
|
10
4
|
import AxiosError from '../core/AxiosError.js';
|
|
11
5
|
import CanceledError from '../cancel/CanceledError.js';
|
|
12
6
|
import parseProtocol from '../helpers/parseProtocol.js';
|
|
13
7
|
import platform from '../platform/index.js';
|
|
14
8
|
import AxiosHeaders from '../core/AxiosHeaders.js';
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
function progressEventReducer(listener, isDownloadStream) {
|
|
18
|
-
let bytesNotified = 0;
|
|
19
|
-
const _speedometer = speedometer(50, 250);
|
|
20
|
-
|
|
21
|
-
return e => {
|
|
22
|
-
const loaded = e.loaded;
|
|
23
|
-
const total = e.lengthComputable ? e.total : undefined;
|
|
24
|
-
const progressBytes = loaded - bytesNotified;
|
|
25
|
-
const rate = _speedometer(progressBytes);
|
|
26
|
-
const inRange = loaded <= total;
|
|
27
|
-
|
|
28
|
-
bytesNotified = loaded;
|
|
29
|
-
|
|
30
|
-
const data = {
|
|
31
|
-
loaded,
|
|
32
|
-
total,
|
|
33
|
-
progress: total ? (loaded / total) : undefined,
|
|
34
|
-
bytes: progressBytes,
|
|
35
|
-
rate: rate ? rate : undefined,
|
|
36
|
-
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
|
|
37
|
-
event: e
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
data[isDownloadStream ? 'download' : 'upload'] = true;
|
|
41
|
-
|
|
42
|
-
listener(data);
|
|
43
|
-
};
|
|
44
|
-
}
|
|
9
|
+
import {progressEventReducer} from '../helpers/progressEventReducer.js';
|
|
10
|
+
import resolveConfig from "../helpers/resolveConfig.js";
|
|
45
11
|
|
|
46
12
|
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
|
|
47
13
|
|
|
48
14
|
export default isXHRAdapterSupported && function (config) {
|
|
49
15
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
16
|
+
const _config = resolveConfig(config);
|
|
17
|
+
let requestData = _config.data;
|
|
18
|
+
const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
|
|
19
|
+
let {responseType, onUploadProgress, onDownloadProgress} = _config;
|
|
53
20
|
let onCanceled;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
config.cancelToken.unsubscribe(onCanceled);
|
|
57
|
-
}
|
|
21
|
+
let uploadThrottled, downloadThrottled;
|
|
22
|
+
let flushUpload, flushDownload;
|
|
58
23
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
24
|
+
function done() {
|
|
25
|
+
flushUpload && flushUpload(); // flush events
|
|
26
|
+
flushDownload && flushDownload(); // flush events
|
|
63
27
|
|
|
64
|
-
|
|
28
|
+
_config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
|
|
65
29
|
|
|
66
|
-
|
|
67
|
-
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
68
|
-
requestHeaders.setContentType(false); // Let the browser set it
|
|
69
|
-
} else if ((contentType = requestHeaders.getContentType()) !== false) {
|
|
70
|
-
// fix semicolon duplication issue for ReactNative FormData implementation
|
|
71
|
-
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
|
|
72
|
-
requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
|
|
73
|
-
}
|
|
30
|
+
_config.signal && _config.signal.removeEventListener('abort', onCanceled);
|
|
74
31
|
}
|
|
75
32
|
|
|
76
33
|
let request = new XMLHttpRequest();
|
|
77
34
|
|
|
78
|
-
|
|
79
|
-
if (config.auth) {
|
|
80
|
-
const username = config.auth.username || '';
|
|
81
|
-
const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
|
|
82
|
-
requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const fullPath = buildFullPath(config.baseURL, config.url);
|
|
86
|
-
|
|
87
|
-
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
|
|
35
|
+
request.open(_config.method.toUpperCase(), _config.url, true);
|
|
88
36
|
|
|
89
37
|
// Set the request timeout in MS
|
|
90
|
-
request.timeout =
|
|
38
|
+
request.timeout = _config.timeout;
|
|
91
39
|
|
|
92
40
|
function onloadend() {
|
|
93
41
|
if (!request) {
|
|
@@ -167,10 +115,10 @@ export default isXHRAdapterSupported && function (config) {
|
|
|
167
115
|
|
|
168
116
|
// Handle timeout
|
|
169
117
|
request.ontimeout = function handleTimeout() {
|
|
170
|
-
let timeoutErrorMessage =
|
|
171
|
-
const transitional =
|
|
172
|
-
if (
|
|
173
|
-
timeoutErrorMessage =
|
|
118
|
+
let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
|
|
119
|
+
const transitional = _config.transitional || transitionalDefaults;
|
|
120
|
+
if (_config.timeoutErrorMessage) {
|
|
121
|
+
timeoutErrorMessage = _config.timeoutErrorMessage;
|
|
174
122
|
}
|
|
175
123
|
reject(new AxiosError(
|
|
176
124
|
timeoutErrorMessage,
|
|
@@ -182,22 +130,6 @@ export default isXHRAdapterSupported && function (config) {
|
|
|
182
130
|
request = null;
|
|
183
131
|
};
|
|
184
132
|
|
|
185
|
-
// Add xsrf header
|
|
186
|
-
// This is only done if running in a standard browser environment.
|
|
187
|
-
// Specifically not if we're in a web worker, or react-native.
|
|
188
|
-
if(platform.hasStandardBrowserEnv) {
|
|
189
|
-
withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
|
|
190
|
-
|
|
191
|
-
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
|
|
192
|
-
// Add xsrf header
|
|
193
|
-
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
|
|
194
|
-
|
|
195
|
-
if (xsrfValue) {
|
|
196
|
-
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
133
|
// Remove Content-Type if data is undefined
|
|
202
134
|
requestData === undefined && requestHeaders.setContentType(null);
|
|
203
135
|
|
|
@@ -209,26 +141,31 @@ export default isXHRAdapterSupported && function (config) {
|
|
|
209
141
|
}
|
|
210
142
|
|
|
211
143
|
// Add withCredentials to request if needed
|
|
212
|
-
if (!utils.isUndefined(
|
|
213
|
-
request.withCredentials = !!
|
|
144
|
+
if (!utils.isUndefined(_config.withCredentials)) {
|
|
145
|
+
request.withCredentials = !!_config.withCredentials;
|
|
214
146
|
}
|
|
215
147
|
|
|
216
148
|
// Add responseType to request if needed
|
|
217
149
|
if (responseType && responseType !== 'json') {
|
|
218
|
-
request.responseType =
|
|
150
|
+
request.responseType = _config.responseType;
|
|
219
151
|
}
|
|
220
152
|
|
|
221
153
|
// Handle progress if needed
|
|
222
|
-
if (
|
|
223
|
-
|
|
154
|
+
if (onDownloadProgress) {
|
|
155
|
+
([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));
|
|
156
|
+
request.addEventListener('progress', downloadThrottled);
|
|
224
157
|
}
|
|
225
158
|
|
|
226
159
|
// Not all browsers support upload events
|
|
227
|
-
if (
|
|
228
|
-
|
|
160
|
+
if (onUploadProgress && request.upload) {
|
|
161
|
+
([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
|
|
162
|
+
|
|
163
|
+
request.upload.addEventListener('progress', uploadThrottled);
|
|
164
|
+
|
|
165
|
+
request.upload.addEventListener('loadend', flushUpload);
|
|
229
166
|
}
|
|
230
167
|
|
|
231
|
-
if (
|
|
168
|
+
if (_config.cancelToken || _config.signal) {
|
|
232
169
|
// Handle cancellation
|
|
233
170
|
// eslint-disable-next-line func-names
|
|
234
171
|
onCanceled = cancel => {
|
|
@@ -240,13 +177,13 @@ export default isXHRAdapterSupported && function (config) {
|
|
|
240
177
|
request = null;
|
|
241
178
|
};
|
|
242
179
|
|
|
243
|
-
|
|
244
|
-
if (
|
|
245
|
-
|
|
180
|
+
_config.cancelToken && _config.cancelToken.subscribe(onCanceled);
|
|
181
|
+
if (_config.signal) {
|
|
182
|
+
_config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
|
|
246
183
|
}
|
|
247
184
|
}
|
|
248
185
|
|
|
249
|
-
const protocol = parseProtocol(
|
|
186
|
+
const protocol = parseProtocol(_config.url);
|
|
250
187
|
|
|
251
188
|
if (protocol && platform.protocols.indexOf(protocol) === -1) {
|
|
252
189
|
reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
|
|
@@ -102,6 +102,20 @@ class CancelToken {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
toAbortSignal() {
|
|
106
|
+
const controller = new AbortController();
|
|
107
|
+
|
|
108
|
+
const abort = (err) => {
|
|
109
|
+
controller.abort(err);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
this.subscribe(abort);
|
|
113
|
+
|
|
114
|
+
controller.signal.unsubscribe = () => this.unsubscribe(abort);
|
|
115
|
+
|
|
116
|
+
return controller.signal;
|
|
117
|
+
}
|
|
118
|
+
|
|
105
119
|
/**
|
|
106
120
|
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
107
121
|
* cancels the `CancelToken`.
|
|
@@ -46,12 +46,15 @@ class Axios {
|
|
|
46
46
|
|
|
47
47
|
// slice off the Error: ... line
|
|
48
48
|
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
try {
|
|
50
|
+
if (!err.stack) {
|
|
51
|
+
err.stack = stack;
|
|
52
|
+
// match without the 2 top stack lines
|
|
53
|
+
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
|
|
54
|
+
err.stack += '\n' + stack
|
|
55
|
+
}
|
|
56
|
+
} catch (e) {
|
|
57
|
+
// ignore the case where "stack" is an un-writable property
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
|
|
@@ -27,7 +27,10 @@ function AxiosError(message, code, config, request, response) {
|
|
|
27
27
|
code && (this.code = code);
|
|
28
28
|
config && (this.config = config);
|
|
29
29
|
request && (this.request = request);
|
|
30
|
-
|
|
30
|
+
if (response) {
|
|
31
|
+
this.response = response;
|
|
32
|
+
this.status = response.status ? response.status : null;
|
|
33
|
+
}
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
utils.inherits(AxiosError, Error, {
|
|
@@ -47,7 +50,7 @@ utils.inherits(AxiosError, Error, {
|
|
|
47
50
|
// Axios
|
|
48
51
|
config: utils.toJSONObject(this.config),
|
|
49
52
|
code: this.code,
|
|
50
|
-
status: this.
|
|
53
|
+
status: this.status
|
|
51
54
|
};
|
|
52
55
|
}
|
|
53
56
|
});
|