@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,164 @@
|
|
|
1
|
+
import type { TypeOf, ZodType } from ".";
|
|
2
|
+
import { Primitive } from "./helpers/typeAliases";
|
|
3
|
+
import { util, ZodParsedType } from "./helpers/util";
|
|
4
|
+
declare type allKeys<T> = T extends any ? keyof T : never;
|
|
5
|
+
export declare type inferFlattenedErrors<T extends ZodType<any, any, any>, U = string> = typeToFlattenedError<TypeOf<T>, U>;
|
|
6
|
+
export declare type typeToFlattenedError<T, U = string> = {
|
|
7
|
+
formErrors: U[];
|
|
8
|
+
fieldErrors: {
|
|
9
|
+
[P in allKeys<T>]?: U[];
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const ZodIssueCode: {
|
|
13
|
+
invalid_type: "invalid_type";
|
|
14
|
+
invalid_literal: "invalid_literal";
|
|
15
|
+
custom: "custom";
|
|
16
|
+
invalid_union: "invalid_union";
|
|
17
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
18
|
+
invalid_enum_value: "invalid_enum_value";
|
|
19
|
+
unrecognized_keys: "unrecognized_keys";
|
|
20
|
+
invalid_arguments: "invalid_arguments";
|
|
21
|
+
invalid_return_type: "invalid_return_type";
|
|
22
|
+
invalid_date: "invalid_date";
|
|
23
|
+
invalid_string: "invalid_string";
|
|
24
|
+
too_small: "too_small";
|
|
25
|
+
too_big: "too_big";
|
|
26
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
27
|
+
not_multiple_of: "not_multiple_of";
|
|
28
|
+
not_finite: "not_finite";
|
|
29
|
+
};
|
|
30
|
+
export declare type ZodIssueCode = keyof typeof ZodIssueCode;
|
|
31
|
+
export declare type ZodIssueBase = {
|
|
32
|
+
path: (string | number)[];
|
|
33
|
+
message?: string;
|
|
34
|
+
};
|
|
35
|
+
export interface ZodInvalidTypeIssue extends ZodIssueBase {
|
|
36
|
+
code: typeof ZodIssueCode.invalid_type;
|
|
37
|
+
expected: ZodParsedType;
|
|
38
|
+
received: ZodParsedType;
|
|
39
|
+
}
|
|
40
|
+
export interface ZodInvalidLiteralIssue extends ZodIssueBase {
|
|
41
|
+
code: typeof ZodIssueCode.invalid_literal;
|
|
42
|
+
expected: unknown;
|
|
43
|
+
received: unknown;
|
|
44
|
+
}
|
|
45
|
+
export interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
|
|
46
|
+
code: typeof ZodIssueCode.unrecognized_keys;
|
|
47
|
+
keys: string[];
|
|
48
|
+
}
|
|
49
|
+
export interface ZodInvalidUnionIssue extends ZodIssueBase {
|
|
50
|
+
code: typeof ZodIssueCode.invalid_union;
|
|
51
|
+
unionErrors: ZodError[];
|
|
52
|
+
}
|
|
53
|
+
export interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
|
|
54
|
+
code: typeof ZodIssueCode.invalid_union_discriminator;
|
|
55
|
+
options: Primitive[];
|
|
56
|
+
}
|
|
57
|
+
export interface ZodInvalidEnumValueIssue extends ZodIssueBase {
|
|
58
|
+
received: string | number;
|
|
59
|
+
code: typeof ZodIssueCode.invalid_enum_value;
|
|
60
|
+
options: (string | number)[];
|
|
61
|
+
}
|
|
62
|
+
export interface ZodInvalidArgumentsIssue extends ZodIssueBase {
|
|
63
|
+
code: typeof ZodIssueCode.invalid_arguments;
|
|
64
|
+
argumentsError: ZodError;
|
|
65
|
+
}
|
|
66
|
+
export interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
|
|
67
|
+
code: typeof ZodIssueCode.invalid_return_type;
|
|
68
|
+
returnTypeError: ZodError;
|
|
69
|
+
}
|
|
70
|
+
export interface ZodInvalidDateIssue extends ZodIssueBase {
|
|
71
|
+
code: typeof ZodIssueCode.invalid_date;
|
|
72
|
+
}
|
|
73
|
+
export declare type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "base64" | {
|
|
74
|
+
includes: string;
|
|
75
|
+
position?: number;
|
|
76
|
+
} | {
|
|
77
|
+
startsWith: string;
|
|
78
|
+
} | {
|
|
79
|
+
endsWith: string;
|
|
80
|
+
};
|
|
81
|
+
export interface ZodInvalidStringIssue extends ZodIssueBase {
|
|
82
|
+
code: typeof ZodIssueCode.invalid_string;
|
|
83
|
+
validation: StringValidation;
|
|
84
|
+
}
|
|
85
|
+
export interface ZodTooSmallIssue extends ZodIssueBase {
|
|
86
|
+
code: typeof ZodIssueCode.too_small;
|
|
87
|
+
minimum: number | bigint;
|
|
88
|
+
inclusive: boolean;
|
|
89
|
+
exact?: boolean;
|
|
90
|
+
type: "array" | "string" | "number" | "set" | "date" | "bigint";
|
|
91
|
+
}
|
|
92
|
+
export interface ZodTooBigIssue extends ZodIssueBase {
|
|
93
|
+
code: typeof ZodIssueCode.too_big;
|
|
94
|
+
maximum: number | bigint;
|
|
95
|
+
inclusive: boolean;
|
|
96
|
+
exact?: boolean;
|
|
97
|
+
type: "array" | "string" | "number" | "set" | "date" | "bigint";
|
|
98
|
+
}
|
|
99
|
+
export interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
|
|
100
|
+
code: typeof ZodIssueCode.invalid_intersection_types;
|
|
101
|
+
}
|
|
102
|
+
export interface ZodNotMultipleOfIssue extends ZodIssueBase {
|
|
103
|
+
code: typeof ZodIssueCode.not_multiple_of;
|
|
104
|
+
multipleOf: number | bigint;
|
|
105
|
+
}
|
|
106
|
+
export interface ZodNotFiniteIssue extends ZodIssueBase {
|
|
107
|
+
code: typeof ZodIssueCode.not_finite;
|
|
108
|
+
}
|
|
109
|
+
export interface ZodCustomIssue extends ZodIssueBase {
|
|
110
|
+
code: typeof ZodIssueCode.custom;
|
|
111
|
+
params?: {
|
|
112
|
+
[k: string]: any;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
export declare type DenormalizedError = {
|
|
116
|
+
[k: string]: DenormalizedError | string[];
|
|
117
|
+
};
|
|
118
|
+
export declare type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
|
|
119
|
+
export declare type ZodIssue = ZodIssueOptionalMessage & {
|
|
120
|
+
fatal?: boolean;
|
|
121
|
+
message: string;
|
|
122
|
+
};
|
|
123
|
+
export declare const quotelessJson: (obj: any) => string;
|
|
124
|
+
declare type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? {
|
|
125
|
+
[K in keyof T]?: ZodFormattedError<T[K]>;
|
|
126
|
+
} : T extends any[] ? {
|
|
127
|
+
[k: number]: ZodFormattedError<T[number]>;
|
|
128
|
+
} : T extends object ? {
|
|
129
|
+
[K in keyof T]?: ZodFormattedError<T[K]>;
|
|
130
|
+
} : unknown;
|
|
131
|
+
export declare type ZodFormattedError<T, U = string> = {
|
|
132
|
+
_errors: U[];
|
|
133
|
+
} & recursiveZodFormattedError<NonNullable<T>>;
|
|
134
|
+
export declare type inferFormattedError<T extends ZodType<any, any, any>, U = string> = ZodFormattedError<TypeOf<T>, U>;
|
|
135
|
+
export declare class ZodError<T = any> extends Error {
|
|
136
|
+
issues: ZodIssue[];
|
|
137
|
+
get errors(): ZodIssue[];
|
|
138
|
+
constructor(issues: ZodIssue[]);
|
|
139
|
+
format(): ZodFormattedError<T>;
|
|
140
|
+
format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
|
|
141
|
+
static create: (issues: ZodIssue[]) => ZodError<any>;
|
|
142
|
+
static assert(value: unknown): asserts value is ZodError;
|
|
143
|
+
toString(): string;
|
|
144
|
+
get message(): string;
|
|
145
|
+
get isEmpty(): boolean;
|
|
146
|
+
addIssue: (sub: ZodIssue) => void;
|
|
147
|
+
addIssues: (subs?: ZodIssue[]) => void;
|
|
148
|
+
flatten(): typeToFlattenedError<T>;
|
|
149
|
+
flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
|
|
150
|
+
get formErrors(): typeToFlattenedError<T, string>;
|
|
151
|
+
}
|
|
152
|
+
declare type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
|
|
153
|
+
export declare type IssueData = stripPath<ZodIssueOptionalMessage> & {
|
|
154
|
+
path?: (string | number)[];
|
|
155
|
+
fatal?: boolean;
|
|
156
|
+
};
|
|
157
|
+
export declare type ErrorMapCtx = {
|
|
158
|
+
defaultError: string;
|
|
159
|
+
data: any;
|
|
160
|
+
};
|
|
161
|
+
export declare type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
|
|
162
|
+
message: string;
|
|
163
|
+
};
|
|
164
|
+
export {};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0;
|
|
4
|
+
const util_1 = require("./helpers/util");
|
|
5
|
+
exports.ZodIssueCode = util_1.util.arrayToEnum([
|
|
6
|
+
"invalid_type",
|
|
7
|
+
"invalid_literal",
|
|
8
|
+
"custom",
|
|
9
|
+
"invalid_union",
|
|
10
|
+
"invalid_union_discriminator",
|
|
11
|
+
"invalid_enum_value",
|
|
12
|
+
"unrecognized_keys",
|
|
13
|
+
"invalid_arguments",
|
|
14
|
+
"invalid_return_type",
|
|
15
|
+
"invalid_date",
|
|
16
|
+
"invalid_string",
|
|
17
|
+
"too_small",
|
|
18
|
+
"too_big",
|
|
19
|
+
"invalid_intersection_types",
|
|
20
|
+
"not_multiple_of",
|
|
21
|
+
"not_finite",
|
|
22
|
+
]);
|
|
23
|
+
const quotelessJson = (obj) => {
|
|
24
|
+
const json = JSON.stringify(obj, null, 2);
|
|
25
|
+
return json.replace(/"([^"]+)":/g, "$1:");
|
|
26
|
+
};
|
|
27
|
+
exports.quotelessJson = quotelessJson;
|
|
28
|
+
class ZodError extends Error {
|
|
29
|
+
constructor(issues) {
|
|
30
|
+
super();
|
|
31
|
+
this.issues = [];
|
|
32
|
+
this.addIssue = (sub) => {
|
|
33
|
+
this.issues = [...this.issues, sub];
|
|
34
|
+
};
|
|
35
|
+
this.addIssues = (subs = []) => {
|
|
36
|
+
this.issues = [...this.issues, ...subs];
|
|
37
|
+
};
|
|
38
|
+
const actualProto = new.target.prototype;
|
|
39
|
+
if (Object.setPrototypeOf) {
|
|
40
|
+
// eslint-disable-next-line ban/ban
|
|
41
|
+
Object.setPrototypeOf(this, actualProto);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.__proto__ = actualProto;
|
|
45
|
+
}
|
|
46
|
+
this.name = "ZodError";
|
|
47
|
+
this.issues = issues;
|
|
48
|
+
}
|
|
49
|
+
get errors() {
|
|
50
|
+
return this.issues;
|
|
51
|
+
}
|
|
52
|
+
format(_mapper) {
|
|
53
|
+
const mapper = _mapper ||
|
|
54
|
+
function (issue) {
|
|
55
|
+
return issue.message;
|
|
56
|
+
};
|
|
57
|
+
const fieldErrors = { _errors: [] };
|
|
58
|
+
const processError = (error) => {
|
|
59
|
+
for (const issue of error.issues) {
|
|
60
|
+
if (issue.code === "invalid_union") {
|
|
61
|
+
issue.unionErrors.map(processError);
|
|
62
|
+
}
|
|
63
|
+
else if (issue.code === "invalid_return_type") {
|
|
64
|
+
processError(issue.returnTypeError);
|
|
65
|
+
}
|
|
66
|
+
else if (issue.code === "invalid_arguments") {
|
|
67
|
+
processError(issue.argumentsError);
|
|
68
|
+
}
|
|
69
|
+
else if (issue.path.length === 0) {
|
|
70
|
+
fieldErrors._errors.push(mapper(issue));
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
let curr = fieldErrors;
|
|
74
|
+
let i = 0;
|
|
75
|
+
while (i < issue.path.length) {
|
|
76
|
+
const el = issue.path[i];
|
|
77
|
+
const terminal = i === issue.path.length - 1;
|
|
78
|
+
if (!terminal) {
|
|
79
|
+
curr[el] = curr[el] || { _errors: [] };
|
|
80
|
+
// if (typeof el === "string") {
|
|
81
|
+
// curr[el] = curr[el] || { _errors: [] };
|
|
82
|
+
// } else if (typeof el === "number") {
|
|
83
|
+
// const errorArray: any = [];
|
|
84
|
+
// errorArray._errors = [];
|
|
85
|
+
// curr[el] = curr[el] || errorArray;
|
|
86
|
+
// }
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
curr[el] = curr[el] || { _errors: [] };
|
|
90
|
+
curr[el]._errors.push(mapper(issue));
|
|
91
|
+
}
|
|
92
|
+
curr = curr[el];
|
|
93
|
+
i++;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
processError(this);
|
|
99
|
+
return fieldErrors;
|
|
100
|
+
}
|
|
101
|
+
static assert(value) {
|
|
102
|
+
if (!(value instanceof ZodError)) {
|
|
103
|
+
throw new Error(`Not a ZodError: ${value}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
toString() {
|
|
107
|
+
return this.message;
|
|
108
|
+
}
|
|
109
|
+
get message() {
|
|
110
|
+
return JSON.stringify(this.issues, util_1.util.jsonStringifyReplacer, 2);
|
|
111
|
+
}
|
|
112
|
+
get isEmpty() {
|
|
113
|
+
return this.issues.length === 0;
|
|
114
|
+
}
|
|
115
|
+
flatten(mapper = (issue) => issue.message) {
|
|
116
|
+
const fieldErrors = {};
|
|
117
|
+
const formErrors = [];
|
|
118
|
+
for (const sub of this.issues) {
|
|
119
|
+
if (sub.path.length > 0) {
|
|
120
|
+
fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
|
|
121
|
+
fieldErrors[sub.path[0]].push(mapper(sub));
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
formErrors.push(mapper(sub));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return { formErrors, fieldErrors };
|
|
128
|
+
}
|
|
129
|
+
get formErrors() {
|
|
130
|
+
return this.flatten();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
exports.ZodError = ZodError;
|
|
134
|
+
ZodError.create = (issues) => {
|
|
135
|
+
const error = new ZodError(issues);
|
|
136
|
+
return error;
|
|
137
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class Mocker {
|
|
2
|
+
pick: (...args: any[]) => any;
|
|
3
|
+
get string(): string;
|
|
4
|
+
get number(): number;
|
|
5
|
+
get bigint(): bigint;
|
|
6
|
+
get boolean(): boolean;
|
|
7
|
+
get date(): Date;
|
|
8
|
+
get symbol(): symbol;
|
|
9
|
+
get null(): null;
|
|
10
|
+
get undefined(): undefined;
|
|
11
|
+
get stringOptional(): any;
|
|
12
|
+
get stringNullable(): any;
|
|
13
|
+
get numberOptional(): any;
|
|
14
|
+
get numberNullable(): any;
|
|
15
|
+
get booleanOptional(): any;
|
|
16
|
+
get booleanNullable(): any;
|
|
17
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Mocker = void 0;
|
|
4
|
+
function getRandomInt(max) {
|
|
5
|
+
return Math.floor(Math.random() * Math.floor(max));
|
|
6
|
+
}
|
|
7
|
+
const testSymbol = Symbol("test");
|
|
8
|
+
class Mocker {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.pick = (...args) => {
|
|
11
|
+
return args[getRandomInt(args.length)];
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
get string() {
|
|
15
|
+
return Math.random().toString(36).substring(7);
|
|
16
|
+
}
|
|
17
|
+
get number() {
|
|
18
|
+
return Math.random() * 100;
|
|
19
|
+
}
|
|
20
|
+
get bigint() {
|
|
21
|
+
return BigInt(Math.floor(Math.random() * 10000));
|
|
22
|
+
}
|
|
23
|
+
get boolean() {
|
|
24
|
+
return Math.random() < 0.5;
|
|
25
|
+
}
|
|
26
|
+
get date() {
|
|
27
|
+
return new Date(Math.floor(Date.now() * Math.random()));
|
|
28
|
+
}
|
|
29
|
+
get symbol() {
|
|
30
|
+
return testSymbol;
|
|
31
|
+
}
|
|
32
|
+
get null() {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
get undefined() {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
get stringOptional() {
|
|
39
|
+
return this.pick(this.string, this.undefined);
|
|
40
|
+
}
|
|
41
|
+
get stringNullable() {
|
|
42
|
+
return this.pick(this.string, this.null);
|
|
43
|
+
}
|
|
44
|
+
get numberOptional() {
|
|
45
|
+
return this.pick(this.number, this.undefined);
|
|
46
|
+
}
|
|
47
|
+
get numberNullable() {
|
|
48
|
+
return this.pick(this.number, this.null);
|
|
49
|
+
}
|
|
50
|
+
get booleanOptional() {
|
|
51
|
+
return this.pick(this.boolean, this.undefined);
|
|
52
|
+
}
|
|
53
|
+
get booleanNullable() {
|
|
54
|
+
return this.pick(this.boolean, this.null);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.Mocker = Mocker;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const benchmark_1 = __importDefault(require("benchmark"));
|
|
7
|
+
const datetimeValidationSuite = new benchmark_1.default.Suite("datetime");
|
|
8
|
+
const DATA = "2021-01-01";
|
|
9
|
+
const MONTHS_31 = new Set([1, 3, 5, 7, 8, 10, 12]);
|
|
10
|
+
const MONTHS_30 = new Set([4, 6, 9, 11]);
|
|
11
|
+
const simpleDatetimeRegex = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
12
|
+
const datetimeRegexNoLeapYearValidation = /^\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\d|2\d))$/;
|
|
13
|
+
const datetimeRegexWithLeapYearValidation = /^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))$/;
|
|
14
|
+
datetimeValidationSuite
|
|
15
|
+
.add("new Date()", () => {
|
|
16
|
+
return !isNaN(new Date(DATA).getTime());
|
|
17
|
+
})
|
|
18
|
+
.add("regex (no validation)", () => {
|
|
19
|
+
return simpleDatetimeRegex.test(DATA);
|
|
20
|
+
})
|
|
21
|
+
.add("regex (no leap year)", () => {
|
|
22
|
+
return datetimeRegexNoLeapYearValidation.test(DATA);
|
|
23
|
+
})
|
|
24
|
+
.add("regex (w/ leap year)", () => {
|
|
25
|
+
return datetimeRegexWithLeapYearValidation.test(DATA);
|
|
26
|
+
})
|
|
27
|
+
.add("capture groups + code", () => {
|
|
28
|
+
const match = DATA.match(simpleDatetimeRegex);
|
|
29
|
+
if (!match)
|
|
30
|
+
return false;
|
|
31
|
+
// Extract year, month, and day from the capture groups
|
|
32
|
+
const year = Number.parseInt(match[1], 10);
|
|
33
|
+
const month = Number.parseInt(match[2], 10); // month is 0-indexed in JavaScript Date, so subtract 1
|
|
34
|
+
const day = Number.parseInt(match[3], 10);
|
|
35
|
+
if (month === 2) {
|
|
36
|
+
if ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {
|
|
37
|
+
return day <= 29;
|
|
38
|
+
}
|
|
39
|
+
return day <= 28;
|
|
40
|
+
}
|
|
41
|
+
if (MONTHS_30.has(month)) {
|
|
42
|
+
return day <= 30;
|
|
43
|
+
}
|
|
44
|
+
if (MONTHS_31.has(month)) {
|
|
45
|
+
return day <= 31;
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
})
|
|
49
|
+
.on("cycle", (e) => {
|
|
50
|
+
console.log(`${datetimeValidationSuite.name}: ${e.target}`);
|
|
51
|
+
});
|
|
52
|
+
exports.default = {
|
|
53
|
+
suites: [datetimeValidationSuite],
|
|
54
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const benchmark_1 = __importDefault(require("benchmark"));
|
|
7
|
+
const index_1 = require("../index");
|
|
8
|
+
const doubleSuite = new benchmark_1.default.Suite("z.discriminatedUnion: double");
|
|
9
|
+
const manySuite = new benchmark_1.default.Suite("z.discriminatedUnion: many");
|
|
10
|
+
const aSchema = index_1.z.object({
|
|
11
|
+
type: index_1.z.literal("a"),
|
|
12
|
+
});
|
|
13
|
+
const objA = {
|
|
14
|
+
type: "a",
|
|
15
|
+
};
|
|
16
|
+
const bSchema = index_1.z.object({
|
|
17
|
+
type: index_1.z.literal("b"),
|
|
18
|
+
});
|
|
19
|
+
const objB = {
|
|
20
|
+
type: "b",
|
|
21
|
+
};
|
|
22
|
+
const cSchema = index_1.z.object({
|
|
23
|
+
type: index_1.z.literal("c"),
|
|
24
|
+
});
|
|
25
|
+
const objC = {
|
|
26
|
+
type: "c",
|
|
27
|
+
};
|
|
28
|
+
const dSchema = index_1.z.object({
|
|
29
|
+
type: index_1.z.literal("d"),
|
|
30
|
+
});
|
|
31
|
+
const double = index_1.z.discriminatedUnion("type", [aSchema, bSchema]);
|
|
32
|
+
const many = index_1.z.discriminatedUnion("type", [aSchema, bSchema, cSchema, dSchema]);
|
|
33
|
+
doubleSuite
|
|
34
|
+
.add("valid: a", () => {
|
|
35
|
+
double.parse(objA);
|
|
36
|
+
})
|
|
37
|
+
.add("valid: b", () => {
|
|
38
|
+
double.parse(objB);
|
|
39
|
+
})
|
|
40
|
+
.add("invalid: null", () => {
|
|
41
|
+
try {
|
|
42
|
+
double.parse(null);
|
|
43
|
+
}
|
|
44
|
+
catch (err) { }
|
|
45
|
+
})
|
|
46
|
+
.add("invalid: wrong shape", () => {
|
|
47
|
+
try {
|
|
48
|
+
double.parse(objC);
|
|
49
|
+
}
|
|
50
|
+
catch (err) { }
|
|
51
|
+
})
|
|
52
|
+
.on("cycle", (e) => {
|
|
53
|
+
console.log(`${doubleSuite.name}: ${e.target}`);
|
|
54
|
+
});
|
|
55
|
+
manySuite
|
|
56
|
+
.add("valid: a", () => {
|
|
57
|
+
many.parse(objA);
|
|
58
|
+
})
|
|
59
|
+
.add("valid: c", () => {
|
|
60
|
+
many.parse(objC);
|
|
61
|
+
})
|
|
62
|
+
.add("invalid: null", () => {
|
|
63
|
+
try {
|
|
64
|
+
many.parse(null);
|
|
65
|
+
}
|
|
66
|
+
catch (err) { }
|
|
67
|
+
})
|
|
68
|
+
.add("invalid: wrong shape", () => {
|
|
69
|
+
try {
|
|
70
|
+
many.parse({ type: "unknown" });
|
|
71
|
+
}
|
|
72
|
+
catch (err) { }
|
|
73
|
+
})
|
|
74
|
+
.on("cycle", (e) => {
|
|
75
|
+
console.log(`${manySuite.name}: ${e.target}`);
|
|
76
|
+
});
|
|
77
|
+
exports.default = {
|
|
78
|
+
suites: [doubleSuite, manySuite],
|
|
79
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const datetime_1 = __importDefault(require("./datetime"));
|
|
7
|
+
const discriminatedUnion_1 = __importDefault(require("./discriminatedUnion"));
|
|
8
|
+
const ipv4_1 = __importDefault(require("./ipv4"));
|
|
9
|
+
const object_1 = __importDefault(require("./object"));
|
|
10
|
+
const primitives_1 = __importDefault(require("./primitives"));
|
|
11
|
+
const realworld_1 = __importDefault(require("./realworld"));
|
|
12
|
+
const string_1 = __importDefault(require("./string"));
|
|
13
|
+
const union_1 = __importDefault(require("./union"));
|
|
14
|
+
const argv = process.argv.slice(2);
|
|
15
|
+
let suites = [];
|
|
16
|
+
if (!argv.length) {
|
|
17
|
+
suites = [
|
|
18
|
+
...realworld_1.default.suites,
|
|
19
|
+
...primitives_1.default.suites,
|
|
20
|
+
...string_1.default.suites,
|
|
21
|
+
...object_1.default.suites,
|
|
22
|
+
...union_1.default.suites,
|
|
23
|
+
...discriminatedUnion_1.default.suites,
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
if (argv.includes("--realworld")) {
|
|
28
|
+
suites.push(...realworld_1.default.suites);
|
|
29
|
+
}
|
|
30
|
+
if (argv.includes("--primitives")) {
|
|
31
|
+
suites.push(...primitives_1.default.suites);
|
|
32
|
+
}
|
|
33
|
+
if (argv.includes("--string")) {
|
|
34
|
+
suites.push(...string_1.default.suites);
|
|
35
|
+
}
|
|
36
|
+
if (argv.includes("--object")) {
|
|
37
|
+
suites.push(...object_1.default.suites);
|
|
38
|
+
}
|
|
39
|
+
if (argv.includes("--union")) {
|
|
40
|
+
suites.push(...union_1.default.suites);
|
|
41
|
+
}
|
|
42
|
+
if (argv.includes("--discriminatedUnion")) {
|
|
43
|
+
suites.push(...datetime_1.default.suites);
|
|
44
|
+
}
|
|
45
|
+
if (argv.includes("--datetime")) {
|
|
46
|
+
suites.push(...datetime_1.default.suites);
|
|
47
|
+
}
|
|
48
|
+
if (argv.includes("--ipv4")) {
|
|
49
|
+
suites.push(...ipv4_1.default.suites);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
for (const suite of suites) {
|
|
53
|
+
suite.run({});
|
|
54
|
+
}
|
|
55
|
+
// exit on Ctrl-C
|
|
56
|
+
process.on("SIGINT", function () {
|
|
57
|
+
console.log("Exiting...");
|
|
58
|
+
process.exit();
|
|
59
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const benchmark_1 = __importDefault(require("benchmark"));
|
|
7
|
+
const suite = new benchmark_1.default.Suite("ipv4");
|
|
8
|
+
const DATA = "127.0.0.1";
|
|
9
|
+
const ipv4RegexA = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;
|
|
10
|
+
const ipv4RegexB = /^(?:(?:(?=(25[0-5]))\1|(?=(2[0-4][0-9]))\2|(?=(1[0-9]{2}))\3|(?=([0-9]{1,2}))\4)\.){3}(?:(?=(25[0-5]))\5|(?=(2[0-4][0-9]))\6|(?=(1[0-9]{2}))\7|(?=([0-9]{1,2}))\8)$/;
|
|
11
|
+
const ipv4RegexC = /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;
|
|
12
|
+
const ipv4RegexD = /^(\b25[0-5]|\b2[0-4][0-9]|\b[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/;
|
|
13
|
+
const ipv4RegexE = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.){3}(25[0-5]|(2[0-4]|1\d|[1-9]|)\d)$/;
|
|
14
|
+
const ipv4RegexF = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/;
|
|
15
|
+
const ipv4RegexG = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}$/;
|
|
16
|
+
const ipv4RegexH = /^((25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])(\.(?!$)|$)){4}$/;
|
|
17
|
+
const ipv4RegexI = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
18
|
+
suite
|
|
19
|
+
.add("A", () => {
|
|
20
|
+
return ipv4RegexA.test(DATA);
|
|
21
|
+
})
|
|
22
|
+
.add("B", () => {
|
|
23
|
+
return ipv4RegexB.test(DATA);
|
|
24
|
+
})
|
|
25
|
+
.add("C", () => {
|
|
26
|
+
return ipv4RegexC.test(DATA);
|
|
27
|
+
})
|
|
28
|
+
.add("D", () => {
|
|
29
|
+
return ipv4RegexD.test(DATA);
|
|
30
|
+
})
|
|
31
|
+
.add("E", () => {
|
|
32
|
+
return ipv4RegexE.test(DATA);
|
|
33
|
+
})
|
|
34
|
+
.add("F", () => {
|
|
35
|
+
return ipv4RegexF.test(DATA);
|
|
36
|
+
})
|
|
37
|
+
.add("G", () => {
|
|
38
|
+
return ipv4RegexG.test(DATA);
|
|
39
|
+
})
|
|
40
|
+
.add("H", () => {
|
|
41
|
+
return ipv4RegexH.test(DATA);
|
|
42
|
+
})
|
|
43
|
+
.add("I", () => {
|
|
44
|
+
return ipv4RegexI.test(DATA);
|
|
45
|
+
})
|
|
46
|
+
.on("cycle", (e) => {
|
|
47
|
+
console.log(`${suite.name}: ${e.target}`);
|
|
48
|
+
});
|
|
49
|
+
exports.default = {
|
|
50
|
+
suites: [suite],
|
|
51
|
+
};
|
|
52
|
+
if (require.main === module) {
|
|
53
|
+
suite.run();
|
|
54
|
+
}
|