@wopee-io/wopee.wdio 4.0.0
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/README.md +5 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getDocumentScrollHeight.d.ts +5 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getDocumentScrollHeight.d.ts.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getDocumentScrollHeight.js +48 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getDocumentScrollHeight.js.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopDom.d.ts +9 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopDom.d.ts.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopDom.js +20 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopDom.js.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopWindow.d.ts +9 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopWindow.d.ts.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopWindow.js +22 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getElementPositionTopWindow.js.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getScreenDimensions.d.ts +8 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getScreenDimensions.d.ts.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getScreenDimensions.js +39 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/getScreenDimensions.js.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/screenDimensions.interfaces.d.ts +85 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/screenDimensions.interfaces.d.ts.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/screenDimensions.interfaces.js +2 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/screenDimensions.interfaces.js.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollElementIntoView.d.ts +8 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollElementIntoView.d.ts.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollElementIntoView.js +35 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollElementIntoView.js.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollToPosition.d.ts +8 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollToPosition.d.ts.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollToPosition.js +27 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/clientSideScripts/scrollToPosition.js.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/desktopBrowserClientOperationAdapter.d.ts +13 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/desktopBrowserClientOperationAdapter.d.ts.map +1 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/desktopBrowserClientOperationAdapter.js +27 -0
- package/build/adapter/desktopBrowserClientOperationAdapter/desktopBrowserClientOperationAdapter.js.map +1 -0
- package/build/adapter/driven/localSaveScreenshot/default.d.ts +14 -0
- package/build/adapter/driven/localSaveScreenshot/default.d.ts.map +1 -0
- package/build/adapter/driven/localSaveScreenshot/default.js +20 -0
- package/build/adapter/driven/localSaveScreenshot/default.js.map +1 -0
- package/build/adapter/driven/localSaveScreenshot/localSaveScreenshot.d.ts +42 -0
- package/build/adapter/driven/localSaveScreenshot/localSaveScreenshot.d.ts.map +1 -0
- package/build/adapter/driven/localSaveScreenshot/localSaveScreenshot.interface.d.ts +43 -0
- package/build/adapter/driven/localSaveScreenshot/localSaveScreenshot.interface.d.ts.map +1 -0
- package/build/adapter/driven/localSaveScreenshot/localSaveScreenshot.interface.js +2 -0
- package/build/adapter/driven/localSaveScreenshot/localSaveScreenshot.interface.js.map +1 -0
- package/build/adapter/driven/localSaveScreenshot/localSaveScreenshot.js +76 -0
- package/build/adapter/driven/localSaveScreenshot/localSaveScreenshot.js.map +1 -0
- package/build/adapter/driven/wdioLoggerAdapter/wdioLoggerAdapter.d.ts +10 -0
- package/build/adapter/driven/wdioLoggerAdapter/wdioLoggerAdapter.d.ts.map +1 -0
- package/build/adapter/driven/wdioLoggerAdapter/wdioLoggerAdapter.js +20 -0
- package/build/adapter/driven/wdioLoggerAdapter/wdioLoggerAdapter.js.map +1 -0
- package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.d.ts +31 -0
- package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.d.ts.map +1 -0
- package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.js +138 -0
- package/build/adapter/fullPageScreenshotAdapter/fullPageScreenshotAdapter.js.map +1 -0
- package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.d.ts +10 -0
- package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.d.ts.map +1 -0
- package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.interface.d.ts +28 -0
- package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.interface.d.ts.map +1 -0
- package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.interface.js +12 -0
- package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.interface.js.map +1 -0
- package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.js +57 -0
- package/build/adapter/wdioConfigAdapter/wdioConfigAdapter.js.map +1 -0
- package/build/adapter/wdioLoggerAdapter/wdioLoggerAdapter.d.ts +10 -0
- package/build/adapter/wdioLoggerAdapter/wdioLoggerAdapter.d.ts.map +1 -0
- package/build/adapter/wdioLoggerAdapter/wdioLoggerAdapter.js +20 -0
- package/build/adapter/wdioLoggerAdapter/wdioLoggerAdapter.js.map +1 -0
- package/build/core/domain/valueObjects/elementPosition.interface.d.ts +7 -0
- package/build/core/domain/valueObjects/elementPosition.interface.d.ts.map +1 -0
- package/build/core/domain/valueObjects/elementPosition.interface.js +2 -0
- package/build/core/domain/valueObjects/elementPosition.interface.js.map +1 -0
- package/build/core/domain/valueObjects/index.d.ts +4 -0
- package/build/core/domain/valueObjects/index.d.ts.map +1 -0
- package/build/core/domain/valueObjects/index.js +2 -0
- package/build/core/domain/valueObjects/index.js.map +1 -0
- package/build/core/domain/valueObjects/track.interface.d.ts +22 -0
- package/build/core/domain/valueObjects/track.interface.d.ts.map +1 -0
- package/build/core/domain/valueObjects/track.interface.js +2 -0
- package/build/core/domain/valueObjects/track.interface.js.map +1 -0
- package/build/desktopBrowser/clientSideScript/screenDimensions.interfaces.d.ts +85 -0
- package/build/desktopBrowser/clientSideScript/screenDimensions.interfaces.d.ts.map +1 -0
- package/build/desktopBrowser/clientSideScript/screenDimensions.interfaces.js +2 -0
- package/build/desktopBrowser/clientSideScript/screenDimensions.interfaces.js.map +1 -0
- package/build/desktopBrowser/commands/element.interfaces.d.ts +11 -0
- package/build/desktopBrowser/commands/element.interfaces.d.ts.map +1 -0
- package/build/desktopBrowser/commands/element.interfaces.js +2 -0
- package/build/desktopBrowser/commands/element.interfaces.js.map +1 -0
- package/build/desktopBrowser/commands/fullPage.interfaces.d.ts +11 -0
- package/build/desktopBrowser/commands/fullPage.interfaces.d.ts.map +1 -0
- package/build/desktopBrowser/commands/fullPage.interfaces.js +2 -0
- package/build/desktopBrowser/commands/fullPage.interfaces.js.map +1 -0
- package/build/desktopBrowser/commands/screen.interfaces.d.ts +8 -0
- package/build/desktopBrowser/commands/screen.interfaces.d.ts.map +1 -0
- package/build/desktopBrowser/commands/screen.interfaces.js +2 -0
- package/build/desktopBrowser/commands/screen.interfaces.js.map +1 -0
- package/build/desktopBrowser/commands/trackElement.d.ts +7 -0
- package/build/desktopBrowser/commands/trackElement.d.ts.map +1 -0
- package/build/desktopBrowser/commands/trackElement.js +63 -0
- package/build/desktopBrowser/commands/trackElement.js.map +1 -0
- package/build/desktopBrowser/commands/trackFullPageScreen.d.ts +7 -0
- package/build/desktopBrowser/commands/trackFullPageScreen.d.ts.map +1 -0
- package/build/desktopBrowser/commands/trackFullPageScreen.js +49 -0
- package/build/desktopBrowser/commands/trackFullPageScreen.js.map +1 -0
- package/build/desktopBrowser/commands/trackImage.d.ts +6 -0
- package/build/desktopBrowser/commands/trackImage.d.ts.map +1 -0
- package/build/desktopBrowser/commands/trackImage.interface.d.ts +8 -0
- package/build/desktopBrowser/commands/trackImage.interface.d.ts.map +1 -0
- package/build/desktopBrowser/commands/trackImage.interface.js +2 -0
- package/build/desktopBrowser/commands/trackImage.interface.js.map +1 -0
- package/build/desktopBrowser/commands/trackImage.js +27 -0
- package/build/desktopBrowser/commands/trackImage.js.map +1 -0
- package/build/desktopBrowser/commands/trackScreen.d.ts +7 -0
- package/build/desktopBrowser/commands/trackScreen.d.ts.map +1 -0
- package/build/desktopBrowser/commands/trackScreen.js +52 -0
- package/build/desktopBrowser/commands/trackScreen.js.map +1 -0
- package/build/desktopBrowser/helpers/utils.d.ts +33 -0
- package/build/desktopBrowser/helpers/utils.d.ts.map +1 -0
- package/build/desktopBrowser/helpers/utils.js +77 -0
- package/build/desktopBrowser/helpers/utils.js.map +1 -0
- package/build/desktopBrowser/index.d.ts +8 -0
- package/build/desktopBrowser/index.d.ts.map +1 -0
- package/build/desktopBrowser/index.js +6 -0
- package/build/desktopBrowser/index.js.map +1 -0
- package/build/desktopBrowser/methods/elementPosition.d.ts +23 -0
- package/build/desktopBrowser/methods/elementPosition.d.ts.map +1 -0
- package/build/desktopBrowser/methods/elementPosition.js +26 -0
- package/build/desktopBrowser/methods/elementPosition.js.map +1 -0
- package/build/desktopBrowser/methods/images.d.ts +27 -0
- package/build/desktopBrowser/methods/images.d.ts.map +1 -0
- package/build/desktopBrowser/methods/images.interfaces.d.ts +31 -0
- package/build/desktopBrowser/methods/images.interfaces.d.ts.map +1 -0
- package/build/desktopBrowser/methods/images.interfaces.js +2 -0
- package/build/desktopBrowser/methods/images.interfaces.js.map +1 -0
- package/build/desktopBrowser/methods/images.js +109 -0
- package/build/desktopBrowser/methods/images.js.map +1 -0
- package/build/desktopBrowser/methods/instanceData.interfaces.d.ts +10 -0
- package/build/desktopBrowser/methods/instanceData.interfaces.d.ts.map +1 -0
- package/build/desktopBrowser/methods/instanceData.interfaces.js +2 -0
- package/build/desktopBrowser/methods/instanceData.interfaces.js.map +1 -0
- package/build/desktopBrowser/methods/methods.interface.d.ts +13 -0
- package/build/desktopBrowser/methods/methods.interface.d.ts.map +1 -0
- package/build/desktopBrowser/methods/methods.interface.js +2 -0
- package/build/desktopBrowser/methods/methods.interface.js.map +1 -0
- package/build/desktopBrowser/methods/rectangles.d.ts +23 -0
- package/build/desktopBrowser/methods/rectangles.d.ts.map +1 -0
- package/build/desktopBrowser/methods/rectangles.interfaces.d.ts +23 -0
- package/build/desktopBrowser/methods/rectangles.interfaces.d.ts.map +1 -0
- package/build/desktopBrowser/methods/rectangles.interfaces.js +2 -0
- package/build/desktopBrowser/methods/rectangles.interfaces.js.map +1 -0
- package/build/desktopBrowser/methods/rectangles.js +51 -0
- package/build/desktopBrowser/methods/rectangles.js.map +1 -0
- package/build/desktopBrowser/methods/screenshots.d.ts +29 -0
- package/build/desktopBrowser/methods/screenshots.d.ts.map +1 -0
- package/build/desktopBrowser/methods/screenshots.interfaces.d.ts +27 -0
- package/build/desktopBrowser/methods/screenshots.interfaces.d.ts.map +1 -0
- package/build/desktopBrowser/methods/screenshots.interfaces.js +2 -0
- package/build/desktopBrowser/methods/screenshots.interfaces.js.map +1 -0
- package/build/desktopBrowser/methods/screenshots.js +91 -0
- package/build/desktopBrowser/methods/screenshots.js.map +1 -0
- package/build/domain/model/afterScreenshotOptions.interface.d.ts +11 -0
- package/build/domain/model/afterScreenshotOptions.interface.d.ts.map +1 -0
- package/build/domain/model/afterScreenshotOptions.interface.js +2 -0
- package/build/domain/model/afterScreenshotOptions.interface.js.map +1 -0
- package/build/domain/model/beforeScreenshotOptions.interface.d.ts +7 -0
- package/build/domain/model/beforeScreenshotOptions.interface.d.ts.map +1 -0
- package/build/domain/model/beforeScreenshotOptions.interface.js +2 -0
- package/build/domain/model/beforeScreenshotOptions.interface.js.map +1 -0
- package/build/domain/model/config.interface.d.ts +19 -0
- package/build/domain/model/config.interface.d.ts.map +1 -0
- package/build/domain/model/config.interface.js +2 -0
- package/build/domain/model/config.interface.js.map +1 -0
- package/build/domain/model/constants.d.ts +9 -0
- package/build/domain/model/constants.d.ts.map +1 -0
- package/build/domain/model/constants.js +9 -0
- package/build/domain/model/constants.js.map +1 -0
- package/build/domain/model/croppingOptions.interface.d.ts +8 -0
- package/build/domain/model/croppingOptions.interface.d.ts.map +1 -0
- package/build/domain/model/croppingOptions.interface.js +12 -0
- package/build/domain/model/croppingOptions.interface.js.map +1 -0
- package/build/domain/model/instances.interface.d.ts +16 -0
- package/build/domain/model/instances.interface.d.ts.map +1 -0
- package/build/domain/model/instances.interface.js +2 -0
- package/build/domain/model/instances.interface.js.map +1 -0
- package/build/domain/model/instancesOptions.interface.d.ts +7 -0
- package/build/domain/model/instancesOptions.interface.d.ts.map +1 -0
- package/build/domain/model/instancesOptions.interface.js +10 -0
- package/build/domain/model/instancesOptions.interface.js.map +1 -0
- package/build/domain/model/methods.interface.d.ts +17 -0
- package/build/domain/model/methods.interface.d.ts.map +1 -0
- package/build/domain/model/methods.interface.js +2 -0
- package/build/domain/model/methods.interface.js.map +1 -0
- package/build/domain/model/permanentStorageResult.interface.d.ts +14 -0
- package/build/domain/model/permanentStorageResult.interface.d.ts.map +1 -0
- package/build/domain/model/permanentStorageResult.interface.js +2 -0
- package/build/domain/model/permanentStorageResult.interface.js.map +1 -0
- package/build/domain/model/saveBase64ImageOptions.interface.d.ts +54 -0
- package/build/domain/model/saveBase64ImageOptions.interface.d.ts.map +1 -0
- package/build/domain/model/saveBase64ImageOptions.interface.js +2 -0
- package/build/domain/model/saveBase64ImageOptions.interface.js.map +1 -0
- package/build/domain/model/screenshotOutput.interface.d.ts +16 -0
- package/build/domain/model/screenshotOutput.interface.d.ts.map +1 -0
- package/build/domain/model/screenshotOutput.interface.js +2 -0
- package/build/domain/model/screenshotOutput.interface.js.map +1 -0
- package/build/domain/model/screenshotSize.interface.d.ts +14 -0
- package/build/domain/model/screenshotSize.interface.d.ts.map +1 -0
- package/build/domain/model/screenshotSize.interface.js +2 -0
- package/build/domain/model/screenshotSize.interface.js.map +1 -0
- package/build/domain/model/screenshotValidationPayload.interface.d.ts +47 -0
- package/build/domain/model/screenshotValidationPayload.interface.d.ts.map +1 -0
- package/build/domain/model/screenshotValidationPayload.interface.js +2 -0
- package/build/domain/model/screenshotValidationPayload.interface.js.map +1 -0
- package/build/domain/model/screenshotValidationResult.interface.d.ts +23 -0
- package/build/domain/model/screenshotValidationResult.interface.d.ts.map +1 -0
- package/build/domain/model/screenshotValidationResult.interface.js +11 -0
- package/build/domain/model/screenshotValidationResult.interface.js.map +1 -0
- package/build/domain/model/service.interface.d.ts +33 -0
- package/build/domain/model/service.interface.d.ts.map +1 -0
- package/build/domain/model/service.interface.js +2 -0
- package/build/domain/model/service.interface.js.map +1 -0
- package/build/domain/model/trackImage.interface.d.ts +17 -0
- package/build/domain/model/trackImage.interface.d.ts.map +1 -0
- package/build/domain/model/trackImage.interface.js +2 -0
- package/build/domain/model/trackImage.interface.js.map +1 -0
- package/build/domain/service/afterScreenshot.d.ts +11 -0
- package/build/domain/service/afterScreenshot.d.ts.map +1 -0
- package/build/domain/service/afterScreenshot.js +15 -0
- package/build/domain/service/afterScreenshot.js.map +1 -0
- package/build/domain/service/beforeScreenshot.d.ts +12 -0
- package/build/domain/service/beforeScreenshot.d.ts.map +1 -0
- package/build/domain/service/beforeScreenshot.js +41 -0
- package/build/domain/service/beforeScreenshot.js.map +1 -0
- package/build/domain/service/webdriverService.d.ts +19 -0
- package/build/domain/service/webdriverService.d.ts.map +1 -0
- package/build/domain/service/webdriverService.js +98 -0
- package/build/domain/service/webdriverService.js.map +1 -0
- package/build/domain/service/wopeeService.d.ts +37 -0
- package/build/domain/service/wopeeService.d.ts.map +1 -0
- package/build/domain/service/wopeeService.js +83 -0
- package/build/domain/service/wopeeService.js.map +1 -0
- package/build/index.d.ts +59 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +4 -0
- package/build/index.js.map +1 -0
- package/build/port/clientSideOperationPort/clientSideOperationPort.d.ts +12 -0
- package/build/port/clientSideOperationPort/clientSideOperationPort.d.ts.map +1 -0
- package/build/port/clientSideOperationPort/clientSideOperationPort.js +3 -0
- package/build/port/clientSideOperationPort/clientSideOperationPort.js.map +1 -0
- package/build/port/driven/configDrivingPort/configDrivingPort.d.ts +9 -0
- package/build/port/driven/configDrivingPort/configDrivingPort.d.ts.map +1 -0
- package/build/port/driven/configDrivingPort/configDrivingPort.js +15 -0
- package/build/port/driven/configDrivingPort/configDrivingPort.js.map +1 -0
- package/build/port/driven/configDrivingPort/configDrivingPortDefaults.d.ts +6 -0
- package/build/port/driven/configDrivingPort/configDrivingPortDefaults.d.ts.map +1 -0
- package/build/port/driven/configDrivingPort/configDrivingPortDefaults.js +36 -0
- package/build/port/driven/configDrivingPort/configDrivingPortDefaults.js.map +1 -0
- package/build/port/driven/permanentStoragePort.d.ts +15 -0
- package/build/port/driven/permanentStoragePort.d.ts.map +1 -0
- package/build/port/driven/permanentStoragePort.js +6 -0
- package/build/port/driven/permanentStoragePort.js.map +1 -0
- package/build/port/driven/screenshotValidationPort.d.ts +28 -0
- package/build/port/driven/screenshotValidationPort.d.ts.map +1 -0
- package/build/port/driven/screenshotValidationPort.js +6 -0
- package/build/port/driven/screenshotValidationPort.js.map +1 -0
- package/build/types.d.ts +1 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +2 -0
- package/build/types.js.map +1 -0
- package/build/utils/versionMetadata.d.ts +10 -0
- package/build/utils/versionMetadata.d.ts.map +1 -0
- package/build/utils/versionMetadata.js +26 -0
- package/build/utils/versionMetadata.js.map +1 -0
- package/build/utils/wopeeError.d.ts +4 -0
- package/build/utils/wopeeError.d.ts.map +1 -0
- package/build/utils/wopeeError.js +8 -0
- package/build/utils/wopeeError.js.map +1 -0
- package/build/utils.d.ts +34 -0
- package/build/utils.d.ts.map +1 -0
- package/build/utils.js +57 -0
- package/build/utils.js.map +1 -0
- package/docs/commands.md +37 -0
- package/docs/configuration.md +241 -0
- package/docs/mobile_native.md +31 -0
- package/node_modules/@autonomous-testing/sdk/.commitlintrc.json +3 -0
- package/node_modules/@autonomous-testing/sdk/.eslintignore +2 -0
- package/node_modules/@autonomous-testing/sdk/.eslintrc +21 -0
- package/node_modules/@autonomous-testing/sdk/.github/actions/npm_clean_install/action.yaml +35 -0
- package/node_modules/@autonomous-testing/sdk/.github/workflows/ci_cd.yaml +137 -0
- package/node_modules/@autonomous-testing/sdk/.prettierignore +3 -0
- package/node_modules/@autonomous-testing/sdk/.prettierrc +12 -0
- package/node_modules/@autonomous-testing/sdk/README.md +57 -0
- package/node_modules/@autonomous-testing/sdk/build/core/domain/index.d.ts +2 -0
- package/node_modules/@autonomous-testing/sdk/build/core/domain/index.js +18 -0
- package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/imageTrackingResult.interface.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/imageTrackingResult.interface.js +3 -0
- package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/index.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/index.js +3 -0
- package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/trackPayload.interface.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/core/domain/valueObjects/trackPayload.interface.js +3 -0
- package/node_modules/@autonomous-testing/sdk/build/core/index.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/core/index.js +19 -0
- package/node_modules/@autonomous-testing/sdk/build/core/ports/imageTracker.d.ts +6 -0
- package/node_modules/@autonomous-testing/sdk/build/core/ports/imageTracker.js +7 -0
- package/node_modules/@autonomous-testing/sdk/build/core/ports/index.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/core/ports/index.js +8 -0
- package/node_modules/@autonomous-testing/sdk/build/core/ports/logger.d.ts +7 -0
- package/node_modules/@autonomous-testing/sdk/build/core/ports/logger.js +7 -0
- package/node_modules/@autonomous-testing/sdk/build/index.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/index.js +20 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.d.ts +39 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.default.d.ts +16 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.default.js +31 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.interface.d.ts +93 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.interface.js +14 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapter.js +153 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapterQueries.d.ts +5 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapterQueries.js +102 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapterUtils.d.ts +9 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/apolloTrackAdapterUtils.js +26 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/index.d.ts +7 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/apolloTrackAdapter/index.js +8 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/consoleLogger/consoleLogger.d.ts +36 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/consoleLogger/consoleLogger.js +49 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/consoleLogger/index.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/consoleLogger/index.js +6 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/index.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/index.js +20 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/noLogger/index.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/noLogger/index.js +6 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/noLogger/noLogger.d.ts +31 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/adapters/noLogger/noLogger.js +34 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/index.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/index.js +19 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/apolloTrackAdapterService.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/apolloTrackAdapterService.interface.d.ts +51 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/apolloTrackAdapterService.interface.js +24 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/apolloTrackAdapterService.js +13 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/index.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/apolloTrackAdapterService/index.js +6 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/index.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/index.js +19 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/consoleLoggerOptions.interface.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/consoleLoggerOptions.interface.js +3 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/index.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/index.js +6 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/loggerOptions.interface.d.ts +8 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/loggerOptions.interface.js +3 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/loggerService.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/infrastructure/services/loggerService/loggerService.js +24 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/index.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/index.js +19 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/metadata/index.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/metadata/index.js +7 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/metadata/versionMetadata.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/metadata/versionMetadata.js +6 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/error.interface.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/error.interface.js +12 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/index.d.ts +4 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/index.js +21 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/zodHelper/index.d.ts +3 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/zodHelper/index.js +6 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/zodHelper/zodHelper.d.ts +14 -0
- package/node_modules/@autonomous-testing/sdk/build/shared/utils/zodHelper/zodHelper.js +39 -0
- package/node_modules/@autonomous-testing/sdk/package.json +53 -0
- package/node_modules/asynckit/LICENSE +21 -0
- package/node_modules/asynckit/README.md +233 -0
- package/node_modules/asynckit/bench.js +76 -0
- package/node_modules/asynckit/index.js +6 -0
- package/node_modules/asynckit/lib/abort.js +29 -0
- package/node_modules/asynckit/lib/async.js +34 -0
- package/node_modules/asynckit/lib/defer.js +26 -0
- package/node_modules/asynckit/lib/iterate.js +75 -0
- package/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/node_modules/asynckit/lib/state.js +37 -0
- package/node_modules/asynckit/lib/streamify.js +141 -0
- package/node_modules/asynckit/lib/terminator.js +29 -0
- package/node_modules/asynckit/package.json +63 -0
- package/node_modules/asynckit/parallel.js +43 -0
- package/node_modules/asynckit/serial.js +17 -0
- package/node_modules/asynckit/serialOrdered.js +75 -0
- package/node_modules/asynckit/stream.js +21 -0
- package/node_modules/axios/CHANGELOG.md +952 -0
- package/node_modules/axios/LICENSE +7 -0
- package/node_modules/axios/MIGRATION_GUIDE.md +3 -0
- package/node_modules/axios/README.md +1695 -0
- package/node_modules/axios/SECURITY.md +6 -0
- package/node_modules/axios/dist/axios.js +4172 -0
- package/node_modules/axios/dist/axios.js.map +1 -0
- package/node_modules/axios/dist/axios.min.js +2 -0
- package/node_modules/axios/dist/axios.min.js.map +1 -0
- package/node_modules/axios/dist/browser/axios.cjs +3638 -0
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -0
- package/node_modules/axios/dist/esm/axios.js +3661 -0
- package/node_modules/axios/dist/esm/axios.js.map +1 -0
- package/node_modules/axios/dist/esm/axios.min.js +2 -0
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -0
- package/node_modules/axios/dist/node/axios.cjs +4705 -0
- package/node_modules/axios/dist/node/axios.cjs.map +1 -0
- package/node_modules/axios/index.d.cts +545 -0
- package/node_modules/axios/index.d.ts +562 -0
- package/node_modules/axios/index.js +43 -0
- package/node_modules/axios/lib/adapters/README.md +37 -0
- package/node_modules/axios/lib/adapters/adapters.js +79 -0
- package/node_modules/axios/lib/adapters/fetch.js +227 -0
- package/node_modules/axios/lib/adapters/http.js +685 -0
- package/node_modules/axios/lib/adapters/xhr.js +190 -0
- package/node_modules/axios/lib/axios.js +89 -0
- package/node_modules/axios/lib/cancel/CancelToken.js +121 -0
- package/node_modules/axios/lib/cancel/CanceledError.js +25 -0
- package/node_modules/axios/lib/cancel/isCancel.js +5 -0
- package/node_modules/axios/lib/core/Axios.js +228 -0
- package/node_modules/axios/lib/core/AxiosError.js +100 -0
- package/node_modules/axios/lib/core/AxiosHeaders.js +302 -0
- package/node_modules/axios/lib/core/InterceptorManager.js +71 -0
- package/node_modules/axios/lib/core/README.md +8 -0
- package/node_modules/axios/lib/core/buildFullPath.js +21 -0
- package/node_modules/axios/lib/core/dispatchRequest.js +81 -0
- package/node_modules/axios/lib/core/mergeConfig.js +106 -0
- package/node_modules/axios/lib/core/settle.js +27 -0
- package/node_modules/axios/lib/core/transformData.js +28 -0
- package/node_modules/axios/lib/defaults/index.js +161 -0
- package/node_modules/axios/lib/defaults/transitional.js +7 -0
- package/node_modules/axios/lib/env/README.md +3 -0
- package/node_modules/axios/lib/env/classes/FormData.js +2 -0
- package/node_modules/axios/lib/env/data.js +1 -0
- package/node_modules/axios/lib/helpers/AxiosTransformStream.js +192 -0
- package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +58 -0
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +71 -0
- package/node_modules/axios/lib/helpers/README.md +7 -0
- package/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +28 -0
- package/node_modules/axios/lib/helpers/bind.js +7 -0
- package/node_modules/axios/lib/helpers/buildURL.js +63 -0
- package/node_modules/axios/lib/helpers/callbackify.js +16 -0
- package/node_modules/axios/lib/helpers/combineURLs.js +15 -0
- package/node_modules/axios/lib/helpers/composeSignals.js +46 -0
- package/node_modules/axios/lib/helpers/cookies.js +42 -0
- package/node_modules/axios/lib/helpers/deprecatedMethod.js +26 -0
- package/node_modules/axios/lib/helpers/formDataToJSON.js +95 -0
- package/node_modules/axios/lib/helpers/formDataToStream.js +111 -0
- package/node_modules/axios/lib/helpers/fromDataURI.js +53 -0
- package/node_modules/axios/lib/helpers/isAbsoluteURL.js +15 -0
- package/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
- package/node_modules/axios/lib/helpers/isURLSameOrigin.js +67 -0
- package/node_modules/axios/lib/helpers/null.js +2 -0
- package/node_modules/axios/lib/helpers/parseHeaders.js +55 -0
- package/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
- package/node_modules/axios/lib/helpers/progressEventReducer.js +32 -0
- package/node_modules/axios/lib/helpers/readBlob.js +15 -0
- package/node_modules/axios/lib/helpers/resolveConfig.js +57 -0
- package/node_modules/axios/lib/helpers/speedometer.js +55 -0
- package/node_modules/axios/lib/helpers/spread.js +28 -0
- package/node_modules/axios/lib/helpers/throttle.js +35 -0
- package/node_modules/axios/lib/helpers/toFormData.js +219 -0
- package/node_modules/axios/lib/helpers/toURLEncodedForm.js +18 -0
- package/node_modules/axios/lib/helpers/trackStream.js +55 -0
- package/node_modules/axios/lib/helpers/validator.js +91 -0
- package/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
- package/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
- package/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
- package/node_modules/axios/lib/platform/browser/index.js +13 -0
- package/node_modules/axios/lib/platform/common/utils.js +50 -0
- package/node_modules/axios/lib/platform/index.js +7 -0
- package/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
- package/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
- package/node_modules/axios/lib/platform/node/index.js +12 -0
- package/node_modules/axios/lib/utils.js +728 -0
- package/node_modules/axios/package.json +219 -0
- package/node_modules/combined-stream/License +19 -0
- package/node_modules/combined-stream/Readme.md +138 -0
- package/node_modules/combined-stream/lib/combined_stream.js +208 -0
- package/node_modules/combined-stream/package.json +25 -0
- package/node_modules/delayed-stream/.npmignore +1 -0
- package/node_modules/delayed-stream/License +19 -0
- package/node_modules/delayed-stream/Makefile +7 -0
- package/node_modules/delayed-stream/Readme.md +141 -0
- package/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
- package/node_modules/delayed-stream/package.json +27 -0
- package/node_modules/follow-redirects/LICENSE +18 -0
- package/node_modules/follow-redirects/README.md +155 -0
- package/node_modules/follow-redirects/debug.js +15 -0
- package/node_modules/follow-redirects/http.js +1 -0
- package/node_modules/follow-redirects/https.js +1 -0
- package/node_modules/follow-redirects/index.js +672 -0
- package/node_modules/follow-redirects/package.json +58 -0
- package/node_modules/form-data/License +19 -0
- package/node_modules/form-data/README.md.bak +358 -0
- package/node_modules/form-data/Readme.md +358 -0
- package/node_modules/form-data/index.d.ts +62 -0
- package/node_modules/form-data/lib/browser.js +2 -0
- package/node_modules/form-data/lib/form_data.js +501 -0
- package/node_modules/form-data/lib/populate.js +10 -0
- package/node_modules/form-data/package.json +68 -0
- package/node_modules/mime-db/HISTORY.md +507 -0
- package/node_modules/mime-db/LICENSE +23 -0
- package/node_modules/mime-db/README.md +100 -0
- package/node_modules/mime-db/db.json +8519 -0
- package/node_modules/mime-db/index.js +12 -0
- package/node_modules/mime-db/package.json +60 -0
- package/node_modules/mime-types/HISTORY.md +397 -0
- package/node_modules/mime-types/LICENSE +23 -0
- package/node_modules/mime-types/README.md +113 -0
- package/node_modules/mime-types/index.js +188 -0
- package/node_modules/mime-types/package.json +44 -0
- package/node_modules/proxy-from-env/.eslintrc +29 -0
- package/node_modules/proxy-from-env/.travis.yml +10 -0
- package/node_modules/proxy-from-env/LICENSE +20 -0
- package/node_modules/proxy-from-env/README.md +131 -0
- package/node_modules/proxy-from-env/index.js +108 -0
- package/node_modules/proxy-from-env/package.json +34 -0
- package/node_modules/proxy-from-env/test.js +483 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +2876 -0
- package/node_modules/zod/index.d.ts +2 -0
- package/node_modules/zod/lib/ZodError.d.ts +164 -0
- package/node_modules/zod/lib/ZodError.js +137 -0
- package/node_modules/zod/lib/__tests__/Mocker.d.ts +17 -0
- package/node_modules/zod/lib/__tests__/Mocker.js +57 -0
- package/node_modules/zod/lib/benchmarks/datetime.d.ts +5 -0
- package/node_modules/zod/lib/benchmarks/datetime.js +54 -0
- package/node_modules/zod/lib/benchmarks/discriminatedUnion.d.ts +5 -0
- package/node_modules/zod/lib/benchmarks/discriminatedUnion.js +79 -0
- package/node_modules/zod/lib/benchmarks/index.d.ts +1 -0
- package/node_modules/zod/lib/benchmarks/index.js +59 -0
- package/node_modules/zod/lib/benchmarks/ipv4.d.ts +5 -0
- package/node_modules/zod/lib/benchmarks/ipv4.js +54 -0
- package/node_modules/zod/lib/benchmarks/object.d.ts +5 -0
- package/node_modules/zod/lib/benchmarks/object.js +70 -0
- package/node_modules/zod/lib/benchmarks/primitives.d.ts +5 -0
- package/node_modules/zod/lib/benchmarks/primitives.js +170 -0
- package/node_modules/zod/lib/benchmarks/realworld.d.ts +5 -0
- package/node_modules/zod/lib/benchmarks/realworld.js +56 -0
- package/node_modules/zod/lib/benchmarks/string.d.ts +5 -0
- package/node_modules/zod/lib/benchmarks/string.js +55 -0
- package/node_modules/zod/lib/benchmarks/union.d.ts +5 -0
- package/node_modules/zod/lib/benchmarks/union.js +79 -0
- package/node_modules/zod/lib/errors.d.ts +5 -0
- package/node_modules/zod/lib/errors.js +17 -0
- package/node_modules/zod/lib/external.d.ts +6 -0
- package/node_modules/zod/lib/external.js +18 -0
- package/node_modules/zod/lib/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/lib/helpers/enumUtil.js +2 -0
- package/node_modules/zod/lib/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/lib/helpers/errorUtil.js +8 -0
- package/node_modules/zod/lib/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/lib/helpers/parseUtil.js +125 -0
- package/node_modules/zod/lib/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/lib/helpers/partialUtil.js +2 -0
- package/node_modules/zod/lib/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/lib/helpers/typeAliases.js +2 -0
- package/node_modules/zod/lib/helpers/util.d.ts +82 -0
- package/node_modules/zod/lib/helpers/util.js +142 -0
- package/node_modules/zod/lib/index.d.ts +4 -0
- package/node_modules/zod/lib/index.js +29 -0
- package/node_modules/zod/lib/index.mjs +4236 -0
- package/node_modules/zod/lib/index.umd.js +4351 -0
- package/node_modules/zod/lib/locales/en.d.ts +3 -0
- package/node_modules/zod/lib/locales/en.js +129 -0
- package/node_modules/zod/lib/types.d.ts +1127 -0
- package/node_modules/zod/lib/types.js +3677 -0
- package/node_modules/zod/package.json +119 -0
- package/package.json +79 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import AxiosError from './AxiosError.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Resolve or reject a Promise based on response status.
|
|
7
|
+
*
|
|
8
|
+
* @param {Function} resolve A function that resolves the promise.
|
|
9
|
+
* @param {Function} reject A function that rejects the promise.
|
|
10
|
+
* @param {object} response The response.
|
|
11
|
+
*
|
|
12
|
+
* @returns {object} The response.
|
|
13
|
+
*/
|
|
14
|
+
export default function settle(resolve, reject, response) {
|
|
15
|
+
const validateStatus = response.config.validateStatus;
|
|
16
|
+
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
17
|
+
resolve(response);
|
|
18
|
+
} else {
|
|
19
|
+
reject(new AxiosError(
|
|
20
|
+
'Request failed with status code ' + response.status,
|
|
21
|
+
[AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
22
|
+
response.config,
|
|
23
|
+
response.request,
|
|
24
|
+
response
|
|
25
|
+
));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import utils from './../utils.js';
|
|
4
|
+
import defaults from '../defaults/index.js';
|
|
5
|
+
import AxiosHeaders from '../core/AxiosHeaders.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Transform the data for a request or a response
|
|
9
|
+
*
|
|
10
|
+
* @param {Array|Function} fns A single function or Array of functions
|
|
11
|
+
* @param {?Object} response The response object
|
|
12
|
+
*
|
|
13
|
+
* @returns {*} The resulting transformed data
|
|
14
|
+
*/
|
|
15
|
+
export default function transformData(fns, response) {
|
|
16
|
+
const config = this || defaults;
|
|
17
|
+
const context = response || config;
|
|
18
|
+
const headers = AxiosHeaders.from(context.headers);
|
|
19
|
+
let data = context.data;
|
|
20
|
+
|
|
21
|
+
utils.forEach(fns, function transform(fn) {
|
|
22
|
+
data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
headers.normalize();
|
|
26
|
+
|
|
27
|
+
return data;
|
|
28
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import utils from '../utils.js';
|
|
4
|
+
import AxiosError from '../core/AxiosError.js';
|
|
5
|
+
import transitionalDefaults from './transitional.js';
|
|
6
|
+
import toFormData from '../helpers/toFormData.js';
|
|
7
|
+
import toURLEncodedForm from '../helpers/toURLEncodedForm.js';
|
|
8
|
+
import platform from '../platform/index.js';
|
|
9
|
+
import formDataToJSON from '../helpers/formDataToJSON.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* It takes a string, tries to parse it, and if it fails, it returns the stringified version
|
|
13
|
+
* of the input
|
|
14
|
+
*
|
|
15
|
+
* @param {any} rawValue - The value to be stringified.
|
|
16
|
+
* @param {Function} parser - A function that parses a string into a JavaScript object.
|
|
17
|
+
* @param {Function} encoder - A function that takes a value and returns a string.
|
|
18
|
+
*
|
|
19
|
+
* @returns {string} A stringified version of the rawValue.
|
|
20
|
+
*/
|
|
21
|
+
function stringifySafely(rawValue, parser, encoder) {
|
|
22
|
+
if (utils.isString(rawValue)) {
|
|
23
|
+
try {
|
|
24
|
+
(parser || JSON.parse)(rawValue);
|
|
25
|
+
return utils.trim(rawValue);
|
|
26
|
+
} catch (e) {
|
|
27
|
+
if (e.name !== 'SyntaxError') {
|
|
28
|
+
throw e;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return (encoder || JSON.stringify)(rawValue);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const defaults = {
|
|
37
|
+
|
|
38
|
+
transitional: transitionalDefaults,
|
|
39
|
+
|
|
40
|
+
adapter: ['xhr', 'http', 'fetch'],
|
|
41
|
+
|
|
42
|
+
transformRequest: [function transformRequest(data, headers) {
|
|
43
|
+
const contentType = headers.getContentType() || '';
|
|
44
|
+
const hasJSONContentType = contentType.indexOf('application/json') > -1;
|
|
45
|
+
const isObjectPayload = utils.isObject(data);
|
|
46
|
+
|
|
47
|
+
if (isObjectPayload && utils.isHTMLForm(data)) {
|
|
48
|
+
data = new FormData(data);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const isFormData = utils.isFormData(data);
|
|
52
|
+
|
|
53
|
+
if (isFormData) {
|
|
54
|
+
return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (utils.isArrayBuffer(data) ||
|
|
58
|
+
utils.isBuffer(data) ||
|
|
59
|
+
utils.isStream(data) ||
|
|
60
|
+
utils.isFile(data) ||
|
|
61
|
+
utils.isBlob(data) ||
|
|
62
|
+
utils.isReadableStream(data)
|
|
63
|
+
) {
|
|
64
|
+
return data;
|
|
65
|
+
}
|
|
66
|
+
if (utils.isArrayBufferView(data)) {
|
|
67
|
+
return data.buffer;
|
|
68
|
+
}
|
|
69
|
+
if (utils.isURLSearchParams(data)) {
|
|
70
|
+
headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
|
|
71
|
+
return data.toString();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
let isFileList;
|
|
75
|
+
|
|
76
|
+
if (isObjectPayload) {
|
|
77
|
+
if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
|
|
78
|
+
return toURLEncodedForm(data, this.formSerializer).toString();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
|
|
82
|
+
const _FormData = this.env && this.env.FormData;
|
|
83
|
+
|
|
84
|
+
return toFormData(
|
|
85
|
+
isFileList ? {'files[]': data} : data,
|
|
86
|
+
_FormData && new _FormData(),
|
|
87
|
+
this.formSerializer
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (isObjectPayload || hasJSONContentType ) {
|
|
93
|
+
headers.setContentType('application/json', false);
|
|
94
|
+
return stringifySafely(data);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return data;
|
|
98
|
+
}],
|
|
99
|
+
|
|
100
|
+
transformResponse: [function transformResponse(data) {
|
|
101
|
+
const transitional = this.transitional || defaults.transitional;
|
|
102
|
+
const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
|
|
103
|
+
const JSONRequested = this.responseType === 'json';
|
|
104
|
+
|
|
105
|
+
if (utils.isResponse(data) || utils.isReadableStream(data)) {
|
|
106
|
+
return data;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
|
|
110
|
+
const silentJSONParsing = transitional && transitional.silentJSONParsing;
|
|
111
|
+
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
return JSON.parse(data);
|
|
115
|
+
} catch (e) {
|
|
116
|
+
if (strictJSONParsing) {
|
|
117
|
+
if (e.name === 'SyntaxError') {
|
|
118
|
+
throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);
|
|
119
|
+
}
|
|
120
|
+
throw e;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return data;
|
|
126
|
+
}],
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
130
|
+
* timeout is not created.
|
|
131
|
+
*/
|
|
132
|
+
timeout: 0,
|
|
133
|
+
|
|
134
|
+
xsrfCookieName: 'XSRF-TOKEN',
|
|
135
|
+
xsrfHeaderName: 'X-XSRF-TOKEN',
|
|
136
|
+
|
|
137
|
+
maxContentLength: -1,
|
|
138
|
+
maxBodyLength: -1,
|
|
139
|
+
|
|
140
|
+
env: {
|
|
141
|
+
FormData: platform.classes.FormData,
|
|
142
|
+
Blob: platform.classes.Blob
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
validateStatus: function validateStatus(status) {
|
|
146
|
+
return status >= 200 && status < 300;
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
headers: {
|
|
150
|
+
common: {
|
|
151
|
+
'Accept': 'application/json, text/plain, */*',
|
|
152
|
+
'Content-Type': undefined
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
utils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
|
|
158
|
+
defaults.headers[method] = {};
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
export default defaults;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const VERSION = "1.7.2";
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import stream from 'stream';
|
|
4
|
+
import utils from '../utils.js';
|
|
5
|
+
import throttle from './throttle.js';
|
|
6
|
+
import speedometer from './speedometer.js';
|
|
7
|
+
|
|
8
|
+
const kInternals = Symbol('internals');
|
|
9
|
+
|
|
10
|
+
class AxiosTransformStream extends stream.Transform{
|
|
11
|
+
constructor(options) {
|
|
12
|
+
options = utils.toFlatObject(options, {
|
|
13
|
+
maxRate: 0,
|
|
14
|
+
chunkSize: 64 * 1024,
|
|
15
|
+
minChunkSize: 100,
|
|
16
|
+
timeWindow: 500,
|
|
17
|
+
ticksRate: 2,
|
|
18
|
+
samplesCount: 15
|
|
19
|
+
}, null, (prop, source) => {
|
|
20
|
+
return !utils.isUndefined(source[prop]);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
super({
|
|
24
|
+
readableHighWaterMark: options.chunkSize
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const self = this;
|
|
28
|
+
|
|
29
|
+
const internals = this[kInternals] = {
|
|
30
|
+
length: options.length,
|
|
31
|
+
timeWindow: options.timeWindow,
|
|
32
|
+
ticksRate: options.ticksRate,
|
|
33
|
+
chunkSize: options.chunkSize,
|
|
34
|
+
maxRate: options.maxRate,
|
|
35
|
+
minChunkSize: options.minChunkSize,
|
|
36
|
+
bytesSeen: 0,
|
|
37
|
+
isCaptured: false,
|
|
38
|
+
notifiedBytesLoaded: 0,
|
|
39
|
+
ts: Date.now(),
|
|
40
|
+
bytes: 0,
|
|
41
|
+
onReadCallback: null
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const _speedometer = speedometer(internals.ticksRate * options.samplesCount, internals.timeWindow);
|
|
45
|
+
|
|
46
|
+
this.on('newListener', event => {
|
|
47
|
+
if (event === 'progress') {
|
|
48
|
+
if (!internals.isCaptured) {
|
|
49
|
+
internals.isCaptured = true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
let bytesNotified = 0;
|
|
55
|
+
|
|
56
|
+
internals.updateProgress = throttle(function throttledHandler() {
|
|
57
|
+
const totalBytes = internals.length;
|
|
58
|
+
const bytesTransferred = internals.bytesSeen;
|
|
59
|
+
const progressBytes = bytesTransferred - bytesNotified;
|
|
60
|
+
if (!progressBytes || self.destroyed) return;
|
|
61
|
+
|
|
62
|
+
const rate = _speedometer(progressBytes);
|
|
63
|
+
|
|
64
|
+
bytesNotified = bytesTransferred;
|
|
65
|
+
|
|
66
|
+
process.nextTick(() => {
|
|
67
|
+
self.emit('progress', {
|
|
68
|
+
loaded: bytesTransferred,
|
|
69
|
+
total: totalBytes,
|
|
70
|
+
progress: totalBytes ? (bytesTransferred / totalBytes) : undefined,
|
|
71
|
+
bytes: progressBytes,
|
|
72
|
+
rate: rate ? rate : undefined,
|
|
73
|
+
estimated: rate && totalBytes && bytesTransferred <= totalBytes ?
|
|
74
|
+
(totalBytes - bytesTransferred) / rate : undefined,
|
|
75
|
+
lengthComputable: totalBytes != null
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
}, internals.ticksRate);
|
|
79
|
+
|
|
80
|
+
const onFinish = () => {
|
|
81
|
+
internals.updateProgress.call(true);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
this.once('end', onFinish);
|
|
85
|
+
this.once('error', onFinish);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
_read(size) {
|
|
89
|
+
const internals = this[kInternals];
|
|
90
|
+
|
|
91
|
+
if (internals.onReadCallback) {
|
|
92
|
+
internals.onReadCallback();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return super._read(size);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
_transform(chunk, encoding, callback) {
|
|
99
|
+
const self = this;
|
|
100
|
+
const internals = this[kInternals];
|
|
101
|
+
const maxRate = internals.maxRate;
|
|
102
|
+
|
|
103
|
+
const readableHighWaterMark = this.readableHighWaterMark;
|
|
104
|
+
|
|
105
|
+
const timeWindow = internals.timeWindow;
|
|
106
|
+
|
|
107
|
+
const divider = 1000 / timeWindow;
|
|
108
|
+
const bytesThreshold = (maxRate / divider);
|
|
109
|
+
const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
|
|
110
|
+
|
|
111
|
+
function pushChunk(_chunk, _callback) {
|
|
112
|
+
const bytes = Buffer.byteLength(_chunk);
|
|
113
|
+
internals.bytesSeen += bytes;
|
|
114
|
+
internals.bytes += bytes;
|
|
115
|
+
|
|
116
|
+
if (internals.isCaptured) {
|
|
117
|
+
internals.updateProgress();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (self.push(_chunk)) {
|
|
121
|
+
process.nextTick(_callback);
|
|
122
|
+
} else {
|
|
123
|
+
internals.onReadCallback = () => {
|
|
124
|
+
internals.onReadCallback = null;
|
|
125
|
+
process.nextTick(_callback);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const transformChunk = (_chunk, _callback) => {
|
|
131
|
+
const chunkSize = Buffer.byteLength(_chunk);
|
|
132
|
+
let chunkRemainder = null;
|
|
133
|
+
let maxChunkSize = readableHighWaterMark;
|
|
134
|
+
let bytesLeft;
|
|
135
|
+
let passed = 0;
|
|
136
|
+
|
|
137
|
+
if (maxRate) {
|
|
138
|
+
const now = Date.now();
|
|
139
|
+
|
|
140
|
+
if (!internals.ts || (passed = (now - internals.ts)) >= timeWindow) {
|
|
141
|
+
internals.ts = now;
|
|
142
|
+
bytesLeft = bytesThreshold - internals.bytes;
|
|
143
|
+
internals.bytes = bytesLeft < 0 ? -bytesLeft : 0;
|
|
144
|
+
passed = 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
bytesLeft = bytesThreshold - internals.bytes;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (maxRate) {
|
|
151
|
+
if (bytesLeft <= 0) {
|
|
152
|
+
// next time window
|
|
153
|
+
return setTimeout(() => {
|
|
154
|
+
_callback(null, _chunk);
|
|
155
|
+
}, timeWindow - passed);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (bytesLeft < maxChunkSize) {
|
|
159
|
+
maxChunkSize = bytesLeft;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (maxChunkSize && chunkSize > maxChunkSize && (chunkSize - maxChunkSize) > minChunkSize) {
|
|
164
|
+
chunkRemainder = _chunk.subarray(maxChunkSize);
|
|
165
|
+
_chunk = _chunk.subarray(0, maxChunkSize);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
pushChunk(_chunk, chunkRemainder ? () => {
|
|
169
|
+
process.nextTick(_callback, null, chunkRemainder);
|
|
170
|
+
} : _callback);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
transformChunk(chunk, function transformNextChunk(err, _chunk) {
|
|
174
|
+
if (err) {
|
|
175
|
+
return callback(err);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (_chunk) {
|
|
179
|
+
transformChunk(_chunk, transformNextChunk);
|
|
180
|
+
} else {
|
|
181
|
+
callback(null);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
setLength(length) {
|
|
187
|
+
this[kInternals].length = +length;
|
|
188
|
+
return this;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export default AxiosTransformStream;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import toFormData from './toFormData.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* It encodes a string by replacing all characters that are not in the unreserved set with
|
|
7
|
+
* their percent-encoded equivalents
|
|
8
|
+
*
|
|
9
|
+
* @param {string} str - The string to encode.
|
|
10
|
+
*
|
|
11
|
+
* @returns {string} The encoded string.
|
|
12
|
+
*/
|
|
13
|
+
function encode(str) {
|
|
14
|
+
const charMap = {
|
|
15
|
+
'!': '%21',
|
|
16
|
+
"'": '%27',
|
|
17
|
+
'(': '%28',
|
|
18
|
+
')': '%29',
|
|
19
|
+
'~': '%7E',
|
|
20
|
+
'%20': '+',
|
|
21
|
+
'%00': '\x00'
|
|
22
|
+
};
|
|
23
|
+
return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
|
|
24
|
+
return charMap[match];
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* It takes a params object and converts it to a FormData object
|
|
30
|
+
*
|
|
31
|
+
* @param {Object<string, any>} params - The parameters to be converted to a FormData object.
|
|
32
|
+
* @param {Object<string, any>} options - The options object passed to the Axios constructor.
|
|
33
|
+
*
|
|
34
|
+
* @returns {void}
|
|
35
|
+
*/
|
|
36
|
+
function AxiosURLSearchParams(params, options) {
|
|
37
|
+
this._pairs = [];
|
|
38
|
+
|
|
39
|
+
params && toFormData(params, this, options);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const prototype = AxiosURLSearchParams.prototype;
|
|
43
|
+
|
|
44
|
+
prototype.append = function append(name, value) {
|
|
45
|
+
this._pairs.push([name, value]);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
prototype.toString = function toString(encoder) {
|
|
49
|
+
const _encode = encoder ? function(value) {
|
|
50
|
+
return encoder.call(this, value, encode);
|
|
51
|
+
} : encode;
|
|
52
|
+
|
|
53
|
+
return this._pairs.map(function each(pair) {
|
|
54
|
+
return _encode(pair[0]) + '=' + _encode(pair[1]);
|
|
55
|
+
}, '').join('&');
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export default AxiosURLSearchParams;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
const HttpStatusCode = {
|
|
2
|
+
Continue: 100,
|
|
3
|
+
SwitchingProtocols: 101,
|
|
4
|
+
Processing: 102,
|
|
5
|
+
EarlyHints: 103,
|
|
6
|
+
Ok: 200,
|
|
7
|
+
Created: 201,
|
|
8
|
+
Accepted: 202,
|
|
9
|
+
NonAuthoritativeInformation: 203,
|
|
10
|
+
NoContent: 204,
|
|
11
|
+
ResetContent: 205,
|
|
12
|
+
PartialContent: 206,
|
|
13
|
+
MultiStatus: 207,
|
|
14
|
+
AlreadyReported: 208,
|
|
15
|
+
ImUsed: 226,
|
|
16
|
+
MultipleChoices: 300,
|
|
17
|
+
MovedPermanently: 301,
|
|
18
|
+
Found: 302,
|
|
19
|
+
SeeOther: 303,
|
|
20
|
+
NotModified: 304,
|
|
21
|
+
UseProxy: 305,
|
|
22
|
+
Unused: 306,
|
|
23
|
+
TemporaryRedirect: 307,
|
|
24
|
+
PermanentRedirect: 308,
|
|
25
|
+
BadRequest: 400,
|
|
26
|
+
Unauthorized: 401,
|
|
27
|
+
PaymentRequired: 402,
|
|
28
|
+
Forbidden: 403,
|
|
29
|
+
NotFound: 404,
|
|
30
|
+
MethodNotAllowed: 405,
|
|
31
|
+
NotAcceptable: 406,
|
|
32
|
+
ProxyAuthenticationRequired: 407,
|
|
33
|
+
RequestTimeout: 408,
|
|
34
|
+
Conflict: 409,
|
|
35
|
+
Gone: 410,
|
|
36
|
+
LengthRequired: 411,
|
|
37
|
+
PreconditionFailed: 412,
|
|
38
|
+
PayloadTooLarge: 413,
|
|
39
|
+
UriTooLong: 414,
|
|
40
|
+
UnsupportedMediaType: 415,
|
|
41
|
+
RangeNotSatisfiable: 416,
|
|
42
|
+
ExpectationFailed: 417,
|
|
43
|
+
ImATeapot: 418,
|
|
44
|
+
MisdirectedRequest: 421,
|
|
45
|
+
UnprocessableEntity: 422,
|
|
46
|
+
Locked: 423,
|
|
47
|
+
FailedDependency: 424,
|
|
48
|
+
TooEarly: 425,
|
|
49
|
+
UpgradeRequired: 426,
|
|
50
|
+
PreconditionRequired: 428,
|
|
51
|
+
TooManyRequests: 429,
|
|
52
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
53
|
+
UnavailableForLegalReasons: 451,
|
|
54
|
+
InternalServerError: 500,
|
|
55
|
+
NotImplemented: 501,
|
|
56
|
+
BadGateway: 502,
|
|
57
|
+
ServiceUnavailable: 503,
|
|
58
|
+
GatewayTimeout: 504,
|
|
59
|
+
HttpVersionNotSupported: 505,
|
|
60
|
+
VariantAlsoNegotiates: 506,
|
|
61
|
+
InsufficientStorage: 507,
|
|
62
|
+
LoopDetected: 508,
|
|
63
|
+
NotExtended: 510,
|
|
64
|
+
NetworkAuthenticationRequired: 511,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
Object.entries(HttpStatusCode).forEach(([key, value]) => {
|
|
68
|
+
HttpStatusCode[value] = key;
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export default HttpStatusCode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# axios // helpers
|
|
2
|
+
|
|
3
|
+
The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like:
|
|
4
|
+
|
|
5
|
+
- Browser polyfills
|
|
6
|
+
- Managing cookies
|
|
7
|
+
- Parsing HTTP headers
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import stream from "stream";
|
|
4
|
+
|
|
5
|
+
class ZlibHeaderTransformStream extends stream.Transform {
|
|
6
|
+
__transform(chunk, encoding, callback) {
|
|
7
|
+
this.push(chunk);
|
|
8
|
+
callback();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
_transform(chunk, encoding, callback) {
|
|
12
|
+
if (chunk.length !== 0) {
|
|
13
|
+
this._transform = this.__transform;
|
|
14
|
+
|
|
15
|
+
// Add Default Compression headers if no zlib headers are present
|
|
16
|
+
if (chunk[0] !== 120) { // Hex: 78
|
|
17
|
+
const header = Buffer.alloc(2);
|
|
18
|
+
header[0] = 120; // Hex: 78
|
|
19
|
+
header[1] = 156; // Hex: 9C
|
|
20
|
+
this.push(header, encoding);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
this.__transform(chunk, encoding, callback);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default ZlibHeaderTransformStream;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import utils from '../utils.js';
|
|
4
|
+
import AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
|
|
8
|
+
* URI encoded counterparts
|
|
9
|
+
*
|
|
10
|
+
* @param {string} val The value to be encoded.
|
|
11
|
+
*
|
|
12
|
+
* @returns {string} The encoded value.
|
|
13
|
+
*/
|
|
14
|
+
function encode(val) {
|
|
15
|
+
return encodeURIComponent(val).
|
|
16
|
+
replace(/%3A/gi, ':').
|
|
17
|
+
replace(/%24/g, '$').
|
|
18
|
+
replace(/%2C/gi, ',').
|
|
19
|
+
replace(/%20/g, '+').
|
|
20
|
+
replace(/%5B/gi, '[').
|
|
21
|
+
replace(/%5D/gi, ']');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Build a URL by appending params to the end
|
|
26
|
+
*
|
|
27
|
+
* @param {string} url The base of the url (e.g., http://www.google.com)
|
|
28
|
+
* @param {object} [params] The params to be appended
|
|
29
|
+
* @param {?object} options
|
|
30
|
+
*
|
|
31
|
+
* @returns {string} The formatted url
|
|
32
|
+
*/
|
|
33
|
+
export default function buildURL(url, params, options) {
|
|
34
|
+
/*eslint no-param-reassign:0*/
|
|
35
|
+
if (!params) {
|
|
36
|
+
return url;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const _encode = options && options.encode || encode;
|
|
40
|
+
|
|
41
|
+
const serializeFn = options && options.serialize;
|
|
42
|
+
|
|
43
|
+
let serializedParams;
|
|
44
|
+
|
|
45
|
+
if (serializeFn) {
|
|
46
|
+
serializedParams = serializeFn(params, options);
|
|
47
|
+
} else {
|
|
48
|
+
serializedParams = utils.isURLSearchParams(params) ?
|
|
49
|
+
params.toString() :
|
|
50
|
+
new AxiosURLSearchParams(params, options).toString(_encode);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (serializedParams) {
|
|
54
|
+
const hashmarkIndex = url.indexOf("#");
|
|
55
|
+
|
|
56
|
+
if (hashmarkIndex !== -1) {
|
|
57
|
+
url = url.slice(0, hashmarkIndex);
|
|
58
|
+
}
|
|
59
|
+
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return url;
|
|
63
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import utils from "../utils.js";
|
|
2
|
+
|
|
3
|
+
const callbackify = (fn, reducer) => {
|
|
4
|
+
return utils.isAsyncFn(fn) ? function (...args) {
|
|
5
|
+
const cb = args.pop();
|
|
6
|
+
fn.apply(this, args).then((value) => {
|
|
7
|
+
try {
|
|
8
|
+
reducer ? cb(null, ...reducer(value)) : cb(null, value);
|
|
9
|
+
} catch (err) {
|
|
10
|
+
cb(err);
|
|
11
|
+
}
|
|
12
|
+
}, cb);
|
|
13
|
+
} : fn;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default callbackify;
|