qa360 2.2.20 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +155 -262
- package/{cli/dist → dist}/commands/ai.js +1 -1
- package/{cli/dist → dist}/commands/coverage.js +1 -1
- package/{cli/dist → dist}/commands/crawl.d.ts +12 -1
- package/{cli/dist → dist}/commands/crawl.js +70 -9
- package/{cli/dist → dist}/commands/doctor.js +2 -2
- package/{cli/dist → dist}/commands/explain.js +2 -2
- package/{cli/dist → dist}/commands/flakiness.js +1 -1
- package/{cli/dist → dist}/commands/generate.js +1 -1
- package/{cli/dist → dist}/commands/history.js +1 -1
- package/{cli/dist → dist}/commands/monitor.js +3 -3
- package/{cli/dist → dist}/commands/ollama.js +1 -1
- package/{cli/dist → dist}/commands/pack.js +2 -2
- package/{cli/dist → dist}/commands/regression.js +1 -1
- package/{cli/dist → dist}/commands/repair.js +1 -1
- package/{cli/dist → dist}/commands/retry.js +1 -1
- package/{cli/dist → dist}/commands/run.d.ts +1 -1
- package/{cli/dist → dist}/commands/run.js +1 -1
- package/{cli/dist → dist}/commands/secrets.js +1 -1
- package/{cli/dist → dist}/commands/serve.js +1 -1
- package/{cli/dist → dist}/commands/slo.js +1 -1
- package/{cli/dist → dist}/commands/verify.js +1 -1
- package/{cli/dist → dist}/core/adapters/playwright-native-api.d.ts +2 -0
- package/{cli/dist → dist}/core/adapters/playwright-native-api.js +20 -1
- package/{cli/dist → dist}/core/adapters/playwright-ui.d.ts +21 -0
- package/dist/core/adapters/playwright-ui.js +2050 -0
- package/{cli/dist → dist}/core/ai/ollama-provider.js +15 -3
- package/{cli/dist → dist}/core/artifacts/ui-artifacts.js +24 -4
- package/dist/core/auth/backup-codes-provider.d.ts +91 -0
- package/dist/core/auth/backup-codes-provider.js +215 -0
- package/{cli/dist → dist}/core/auth/basic-auth-provider.d.ts +6 -0
- package/{cli/dist → dist}/core/auth/basic-auth-provider.js +24 -6
- package/dist/core/auth/digest-auth-provider.d.ts +116 -0
- package/dist/core/auth/digest-auth-provider.js +244 -0
- package/dist/core/auth/hcaptcha-handler.d.ts +103 -0
- package/dist/core/auth/hcaptcha-handler.js +288 -0
- package/{cli/dist → dist}/core/auth/index.d.ts +81 -4
- package/{cli/dist → dist}/core/auth/index.js +15 -1
- package/dist/core/auth/oauth-handler.d.ts +408 -0
- package/dist/core/auth/oauth-handler.js +636 -0
- package/{cli/dist → dist}/core/auth/oauth2-provider.d.ts +9 -0
- package/dist/core/auth/oauth2-provider.js +227 -0
- package/dist/core/auth/otp-provider.d.ts +93 -0
- package/dist/core/auth/otp-provider.js +288 -0
- package/dist/core/auth/recaptcha-handler.d.ts +119 -0
- package/dist/core/auth/recaptcha-handler.js +301 -0
- package/dist/core/auth/remember-me-handler.d.ts +142 -0
- package/dist/core/auth/remember-me-handler.js +255 -0
- package/dist/core/auth/saml-handler.d.ts +173 -0
- package/dist/core/auth/saml-handler.js +364 -0
- package/dist/core/auth/webauthn-handler.d.ts +182 -0
- package/dist/core/auth/webauthn-handler.js +310 -0
- package/dist/core/crawler/advanced-interactions.d.ts +342 -0
- package/dist/core/crawler/advanced-interactions.js +1069 -0
- package/dist/core/crawler/blob-url-download-handler.d.ts +145 -0
- package/dist/core/crawler/blob-url-download-handler.js +392 -0
- package/dist/core/crawler/consent-handler.d.ts +49 -0
- package/dist/core/crawler/consent-handler.js +258 -0
- package/dist/core/crawler/cookie-manager.d.ts +166 -0
- package/dist/core/crawler/cookie-manager.js +353 -0
- package/dist/core/crawler/coop-coep-handler.d.ts +136 -0
- package/dist/core/crawler/coop-coep-handler.js +338 -0
- package/dist/core/crawler/csp-handler.d.ts +151 -0
- package/dist/core/crawler/csp-handler.js +415 -0
- package/dist/core/crawler/download-handler.d.ts +155 -0
- package/dist/core/crawler/download-handler.js +370 -0
- package/dist/core/crawler/email-testing-handler.d.ts +214 -0
- package/dist/core/crawler/email-testing-handler.js +398 -0
- package/dist/core/crawler/error-tracking-handler.d.ts +177 -0
- package/dist/core/crawler/error-tracking-handler.js +378 -0
- package/dist/core/crawler/form-handler.d.ts +100 -0
- package/dist/core/crawler/form-handler.js +465 -0
- package/dist/core/crawler/framework-wait-handler.d.ts +96 -0
- package/dist/core/crawler/framework-wait-handler.js +464 -0
- package/dist/core/crawler/geolocation-handler.d.ts +112 -0
- package/dist/core/crawler/geolocation-handler.js +276 -0
- package/dist/core/crawler/index.d.ts +78 -0
- package/{cli/dist → dist}/core/crawler/index.js +74 -1
- package/dist/core/crawler/intelligent-selector-generator.d.ts +164 -0
- package/dist/core/crawler/intelligent-selector-generator.js +612 -0
- package/{cli/dist → dist}/core/crawler/journey-generator.js +44 -1
- package/{cli/dist → dist}/core/crawler/page-analyzer.d.ts +16 -1
- package/{cli/dist → dist}/core/crawler/page-analyzer.js +469 -17
- package/dist/core/crawler/permissions-handler.d.ts +112 -0
- package/dist/core/crawler/permissions-handler.js +236 -0
- package/dist/core/crawler/permissions-policy-handler.d.ts +113 -0
- package/dist/core/crawler/permissions-policy-handler.js +402 -0
- package/dist/core/crawler/presets.d.ts +100 -0
- package/dist/core/crawler/presets.js +887 -0
- package/dist/core/crawler/repl-debug-handler.d.ts +105 -0
- package/dist/core/crawler/repl-debug-handler.js +552 -0
- package/dist/core/crawler/reporting-api-handler.d.ts +212 -0
- package/dist/core/crawler/reporting-api-handler.js +344 -0
- package/{cli/dist → dist}/core/crawler/selector-generator.d.ts +9 -0
- package/{cli/dist → dist}/core/crawler/selector-generator.js +99 -23
- package/dist/core/crawler/site-profiler.d.ts +89 -0
- package/dist/core/crawler/site-profiler.js +290 -0
- package/dist/core/crawler/sourcemaps-handler.d.ts +144 -0
- package/dist/core/crawler/sourcemaps-handler.js +420 -0
- package/dist/core/crawler/stacked-modals-handler.d.ts +118 -0
- package/dist/core/crawler/stacked-modals-handler.js +429 -0
- package/dist/core/crawler/trusted-types-handler.d.ts +149 -0
- package/dist/core/crawler/trusted-types-handler.js +413 -0
- package/{cli/dist → dist}/core/crawler/types.d.ts +68 -2
- package/dist/core/crawler/wait-strategies.d.ts +108 -0
- package/dist/core/crawler/wait-strategies.js +399 -0
- package/dist/core/fixtures/factories.d.ts +180 -0
- package/dist/core/fixtures/factories.js +279 -0
- package/dist/core/fixtures/index.d.ts +6 -0
- package/dist/core/fixtures/index.js +6 -0
- package/{cli/dist → dist}/core/generation/crawler-pack-generator.d.ts +13 -3
- package/dist/core/generation/crawler-pack-generator.js +232 -0
- package/{cli/dist → dist}/core/generation/index.d.ts +2 -0
- package/{cli/dist → dist}/core/generation/index.js +2 -0
- package/{cli/dist → dist}/core/index.d.ts +2 -0
- package/{cli/dist → dist}/core/index.js +4 -0
- package/dist/core/network/index.d.ts +7 -0
- package/dist/core/network/index.js +7 -0
- package/dist/core/network/network-manager.d.ts +237 -0
- package/dist/core/network/network-manager.js +343 -0
- package/dist/core/network/network-simulator.d.ts +158 -0
- package/dist/core/network/network-simulator.js +261 -0
- package/{cli/dist → dist}/core/pack/validator.js +2 -2
- package/{cli/dist → dist}/core/pack-v2/migrator.d.ts +5 -0
- package/{cli/dist → dist}/core/pack-v2/migrator.js +81 -6
- package/{cli/dist → dist}/core/pack-v2/validator.js +4 -3
- package/{cli/dist → dist}/core/pom/base-page.js +1 -1
- package/{cli/dist → dist}/core/pom/loader.js +1 -1
- package/dist/core/reporting/index.d.ts +9 -0
- package/dist/core/reporting/index.js +10 -0
- package/dist/core/reporting/junit-reporter.d.ts +114 -0
- package/dist/core/reporting/junit-reporter.js +306 -0
- package/{cli/dist → dist}/core/runner/e2e-helpers.d.ts +1 -1
- package/{cli/dist → dist}/core/runner/e2e-helpers.js +2 -2
- package/{cli/dist → dist}/core/runner/phase3-runner.d.ts +3 -0
- package/{cli/dist → dist}/core/runner/phase3-runner.js +45 -14
- package/dist/core/sharding/test-sharding.d.ts +137 -0
- package/dist/core/sharding/test-sharding.js +233 -0
- package/dist/core/storage/cookie-manager.d.ts +160 -0
- package/dist/core/storage/cookie-manager.js +268 -0
- package/dist/core/storage/index.d.ts +7 -0
- package/dist/core/storage/index.js +7 -0
- package/dist/core/storage/storage-helpers.d.ts +138 -0
- package/dist/core/storage/storage-helpers.js +315 -0
- package/dist/core/test-helpers/index.d.ts +6 -0
- package/dist/core/test-helpers/index.js +6 -0
- package/dist/core/test-helpers/state-reset.d.ts +119 -0
- package/dist/core/test-helpers/state-reset.js +234 -0
- package/{cli/dist → dist}/core/types/pack-v1.d.ts +15 -2
- package/{cli/dist → dist}/core/types/pack-v2.d.ts +1 -1
- package/dist/core/upload/chunked-uploader.d.ts +150 -0
- package/dist/core/upload/chunked-uploader.js +289 -0
- package/dist/core/upload/index.d.ts +11 -0
- package/dist/core/upload/index.js +8 -0
- package/dist/core/upload/mime-validator.d.ts +119 -0
- package/dist/core/upload/mime-validator.js +373 -0
- package/dist/core/upload/presigned-uploader.d.ts +118 -0
- package/dist/core/upload/presigned-uploader.js +274 -0
- package/dist/core/utils/device-emulation.d.ts +194 -0
- package/dist/core/utils/device-emulation.js +380 -0
- package/dist/core/utils/index.d.ts +8 -0
- package/dist/core/utils/index.js +8 -0
- package/dist/core/utils/retry.d.ts +145 -0
- package/dist/core/utils/retry.js +242 -0
- package/dist/core/utils/smart-wait.d.ts +133 -0
- package/dist/core/utils/smart-wait.js +417 -0
- package/dist/core/visual/index.d.ts +7 -0
- package/dist/core/visual/index.js +7 -0
- package/dist/core/visual/pixel-diff.d.ts +87 -0
- package/dist/core/visual/pixel-diff.js +213 -0
- package/dist/core/visual/screenshot-helper.d.ts +130 -0
- package/dist/core/visual/screenshot-helper.js +223 -0
- package/{cli/dist → dist}/utils/config.d.ts +1 -1
- package/examples/README.md +160 -0
- package/examples/accessibility.yml +48 -0
- package/examples/api-basic.yml +27 -0
- package/examples/complete.yml +146 -0
- package/examples/crawler.yml +38 -0
- package/examples/fullstack.yml +78 -0
- package/examples/security.yml +58 -0
- package/examples/ui-advanced.yml +49 -0
- package/examples/ui-basic.yml +24 -0
- package/package.json +33 -67
- package/CHANGELOG.md +0 -262
- package/CONTRIBUTING.md +0 -273
- package/QUICK_START.md +0 -191
- package/cli/CHANGELOG.md +0 -84
- package/cli/LICENSE +0 -24
- package/cli/README.md +0 -222
- package/cli/dist/core/adapters/playwright-ui.js +0 -864
- package/cli/dist/core/auth/oauth2-provider.js +0 -114
- package/cli/dist/core/coverage/analyzer.d.ts +0 -101
- package/cli/dist/core/coverage/analyzer.js +0 -415
- package/cli/dist/core/coverage/collector.d.ts +0 -74
- package/cli/dist/core/coverage/collector.js +0 -459
- package/cli/dist/core/coverage/config.d.ts +0 -37
- package/cli/dist/core/coverage/config.js +0 -156
- package/cli/dist/core/coverage/index.d.ts +0 -11
- package/cli/dist/core/coverage/index.js +0 -15
- package/cli/dist/core/coverage/types.d.ts +0 -267
- package/cli/dist/core/coverage/types.js +0 -6
- package/cli/dist/core/coverage/vault.d.ts +0 -95
- package/cli/dist/core/coverage/vault.js +0 -405
- package/cli/dist/core/crawler/index.d.ts +0 -57
- package/cli/dist/core/fixtures/index.d.ts +0 -8
- package/cli/dist/core/fixtures/index.js +0 -8
- package/cli/dist/core/generation/crawler-pack-generator.js +0 -231
- package/cli/dist/core/reporting/index.d.ts +0 -6
- package/cli/dist/core/reporting/index.js +0 -6
- package/cli/dist/core/visual/index.d.ts +0 -6
- package/cli/dist/core/visual/index.js +0 -6
- package/cli/package.json +0 -76
- package/core/LICENSE +0 -24
- package/core/README.md +0 -64
- package/core/package.json +0 -81
- package/core/schemas/pack.schema.json +0 -236
- /package/{cli/bin → bin}/qa360.js +0 -0
- /package/{cli/dist → dist}/cli-minimal.d.ts +0 -0
- /package/{cli/dist → dist}/cli-minimal.js +0 -0
- /package/{cli/dist → dist}/commands/ai.d.ts +0 -0
- /package/{cli/dist → dist}/commands/ask.d.ts +0 -0
- /package/{cli/dist → dist}/commands/ask.js +0 -0
- /package/{cli/dist → dist}/commands/coverage.d.ts +0 -0
- /package/{cli/dist → dist}/commands/doctor.d.ts +0 -0
- /package/{cli/dist → dist}/commands/examples.d.ts +0 -0
- /package/{cli/dist → dist}/commands/examples.js +0 -0
- /package/{cli/dist → dist}/commands/explain.d.ts +0 -0
- /package/{cli/dist → dist}/commands/flakiness.d.ts +0 -0
- /package/{cli/dist → dist}/commands/generate.d.ts +0 -0
- /package/{cli/dist → dist}/commands/history.d.ts +0 -0
- /package/{cli/dist → dist}/commands/init.d.ts +0 -0
- /package/{cli/dist → dist}/commands/init.js +0 -0
- /package/{cli/dist → dist}/commands/monitor.d.ts +0 -0
- /package/{cli/dist → dist}/commands/ollama.d.ts +0 -0
- /package/{cli/dist → dist}/commands/pack.d.ts +0 -0
- /package/{cli/dist → dist}/commands/regression.d.ts +0 -0
- /package/{cli/dist → dist}/commands/repair.d.ts +0 -0
- /package/{cli/dist → dist}/commands/report.d.ts +0 -0
- /package/{cli/dist → dist}/commands/report.js +0 -0
- /package/{cli/dist → dist}/commands/retry.d.ts +0 -0
- /package/{cli/dist → dist}/commands/scan.d.ts +0 -0
- /package/{cli/dist → dist}/commands/scan.js +0 -0
- /package/{cli/dist → dist}/commands/secrets.d.ts +0 -0
- /package/{cli/dist → dist}/commands/serve.d.ts +0 -0
- /package/{cli/dist → dist}/commands/slo.d.ts +0 -0
- /package/{cli/dist → dist}/commands/verify.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/gitleaks-secrets.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/gitleaks-secrets.js +0 -0
- /package/{cli/dist → dist}/core/adapters/jest-adapter.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/jest-adapter.js +0 -0
- /package/{cli/dist → dist}/core/adapters/k6-perf.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/k6-perf.js +0 -0
- /package/{cli/dist → dist}/core/adapters/osv-deps.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/osv-deps.js +0 -0
- /package/{cli/dist → dist}/core/adapters/playwright-native-adapter.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/playwright-native-adapter.js +0 -0
- /package/{cli/dist → dist}/core/adapters/pytest-adapter.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/pytest-adapter.js +0 -0
- /package/{cli/dist → dist}/core/adapters/semgrep-sast.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/semgrep-sast.js +0 -0
- /package/{cli/dist → dist}/core/adapters/unit-test-types.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/unit-test-types.js +0 -0
- /package/{cli/dist → dist}/core/adapters/vitest-adapter.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/vitest-adapter.js +0 -0
- /package/{cli/dist → dist}/core/adapters/zap-dast.d.ts +0 -0
- /package/{cli/dist → dist}/core/adapters/zap-dast.js +0 -0
- /package/{cli/dist → dist}/core/ai/anthropic-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/ai/anthropic-provider.js +0 -0
- /package/{cli/dist → dist}/core/ai/deepseek-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/ai/deepseek-provider.js +0 -0
- /package/{cli/dist → dist}/core/ai/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/ai/index.js +0 -0
- /package/{cli/dist → dist}/core/ai/llm-client.d.ts +0 -0
- /package/{cli/dist → dist}/core/ai/llm-client.js +0 -0
- /package/{cli/dist → dist}/core/ai/mock-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/ai/mock-provider.js +0 -0
- /package/{cli/dist → dist}/core/ai/ollama-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/ai/openai-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/ai/openai-provider.js +0 -0
- /package/{cli/dist → dist}/core/ai/provider-factory.d.ts +0 -0
- /package/{cli/dist → dist}/core/ai/provider-factory.js +0 -0
- /package/{cli/dist → dist}/core/artifacts/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/artifacts/index.js +0 -0
- /package/{cli/dist → dist}/core/artifacts/ui-artifacts.d.ts +0 -0
- /package/{cli/dist → dist}/core/assertions/engine.d.ts +0 -0
- /package/{cli/dist → dist}/core/assertions/engine.js +0 -0
- /package/{cli/dist → dist}/core/assertions/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/assertions/index.js +0 -0
- /package/{cli/dist → dist}/core/assertions/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/assertions/types.js +0 -0
- /package/{cli/dist → dist}/core/auth/api-key-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/auth/api-key-provider.js +0 -0
- /package/{cli/dist → dist}/core/auth/aws-iam-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/auth/aws-iam-provider.js +0 -0
- /package/{cli/dist → dist}/core/auth/azure-ad-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/auth/azure-ad-provider.js +0 -0
- /package/{cli/dist → dist}/core/auth/gcp-adc-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/auth/gcp-adc-provider.js +0 -0
- /package/{cli/dist → dist}/core/auth/jwt-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/auth/jwt-provider.js +0 -0
- /package/{cli/dist → dist}/core/auth/manager.d.ts +0 -0
- /package/{cli/dist → dist}/core/auth/manager.js +0 -0
- /package/{cli/dist → dist}/core/auth/totp-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/auth/totp-provider.js +0 -0
- /package/{cli/dist → dist}/core/auth/ui-login-provider.d.ts +0 -0
- /package/{cli/dist → dist}/core/auth/ui-login-provider.js +0 -0
- /package/{cli/dist → dist}/core/cache/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/cache/index.js +0 -0
- /package/{cli/dist → dist}/core/cache/lru-cache.d.ts +0 -0
- /package/{cli/dist → dist}/core/cache/lru-cache.js +0 -0
- /package/{cli/dist/core → dist}/core/coverage/analyzer.d.ts +0 -0
- /package/{cli/dist/core → dist}/core/coverage/analyzer.js +0 -0
- /package/{cli/dist/core → dist}/core/coverage/collector.d.ts +0 -0
- /package/{cli/dist/core → dist}/core/coverage/collector.js +0 -0
- /package/{cli/dist/core → dist}/core/coverage/config.d.ts +0 -0
- /package/{cli/dist/core → dist}/core/coverage/config.js +0 -0
- /package/{cli/dist/core → dist}/core/coverage/index.d.ts +0 -0
- /package/{cli/dist/core → dist}/core/coverage/index.js +0 -0
- /package/{cli/dist/core → dist}/core/coverage/types.d.ts +0 -0
- /package/{cli/dist/core → dist}/core/coverage/types.js +0 -0
- /package/{cli/dist/core → dist}/core/coverage/vault.d.ts +0 -0
- /package/{cli/dist/core → dist}/core/coverage/vault.js +0 -0
- /package/{cli/dist → dist}/core/crawler/journey-generator.d.ts +0 -0
- /package/{cli/dist → dist}/core/crawler/types.js +0 -0
- /package/{cli/dist → dist}/core/dashboard/assets.d.ts +0 -0
- /package/{cli/dist → dist}/core/dashboard/assets.js +0 -0
- /package/{cli/dist → dist}/core/dashboard/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/dashboard/index.js +0 -0
- /package/{cli/dist → dist}/core/dashboard/server.d.ts +0 -0
- /package/{cli/dist → dist}/core/dashboard/server.js +0 -0
- /package/{cli/dist → dist}/core/dashboard/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/dashboard/types.js +0 -0
- /package/{cli/dist → dist}/core/discoverer/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/discoverer/index.js +0 -0
- /package/{cli/dist → dist}/core/fixtures/loader.d.ts +0 -0
- /package/{cli/dist → dist}/core/fixtures/loader.js +0 -0
- /package/{cli/dist → dist}/core/fixtures/resolver.d.ts +0 -0
- /package/{cli/dist → dist}/core/fixtures/resolver.js +0 -0
- /package/{cli/dist → dist}/core/fixtures/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/fixtures/types.js +0 -0
- /package/{cli/dist → dist}/core/flakiness/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/flakiness/index.js +0 -0
- /package/{cli/dist → dist}/core/generation/code-formatter.d.ts +0 -0
- /package/{cli/dist → dist}/core/generation/code-formatter.js +0 -0
- /package/{cli/dist → dist}/core/generation/code-generator.d.ts +0 -0
- /package/{cli/dist → dist}/core/generation/code-generator.js +0 -0
- /package/{cli/dist → dist}/core/generation/generator.d.ts +0 -0
- /package/{cli/dist → dist}/core/generation/generator.js +0 -0
- /package/{cli/dist → dist}/core/generation/pack-generator.d.ts +0 -0
- /package/{cli/dist → dist}/core/generation/pack-generator.js +0 -0
- /package/{cli/dist → dist}/core/generation/prompt-builder.d.ts +0 -0
- /package/{cli/dist → dist}/core/generation/prompt-builder.js +0 -0
- /package/{cli/dist → dist}/core/generation/source-analyzer.d.ts +0 -0
- /package/{cli/dist → dist}/core/generation/source-analyzer.js +0 -0
- /package/{cli/dist → dist}/core/generation/test-optimizer.d.ts +0 -0
- /package/{cli/dist → dist}/core/generation/test-optimizer.js +0 -0
- /package/{cli/dist → dist}/core/generation/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/generation/types.js +0 -0
- /package/{cli/dist → dist}/core/hooks/compose.d.ts +0 -0
- /package/{cli/dist → dist}/core/hooks/compose.js +0 -0
- /package/{cli/dist → dist}/core/hooks/runner.d.ts +0 -0
- /package/{cli/dist → dist}/core/hooks/runner.js +0 -0
- /package/{cli/dist → dist}/core/pack/migrator.d.ts +0 -0
- /package/{cli/dist → dist}/core/pack/migrator.js +0 -0
- /package/{cli/dist → dist}/core/pack/validator.d.ts +0 -0
- /package/{cli/dist → dist}/core/pack-v2/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/pack-v2/index.js +0 -0
- /package/{cli/dist → dist}/core/pack-v2/loader.d.ts +0 -0
- /package/{cli/dist → dist}/core/pack-v2/loader.js +0 -0
- /package/{cli/dist → dist}/core/pack-v2/validator.d.ts +0 -0
- /package/{cli/dist → dist}/core/parallel/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/parallel/index.js +0 -0
- /package/{cli/dist → dist}/core/parallel/parallel-runner.d.ts +0 -0
- /package/{cli/dist → dist}/core/parallel/parallel-runner.js +0 -0
- /package/{cli/dist → dist}/core/pom/base-page.d.ts +0 -0
- /package/{cli/dist → dist}/core/pom/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/pom/index.js +0 -0
- /package/{cli/dist → dist}/core/pom/loader.d.ts +0 -0
- /package/{cli/dist → dist}/core/pom/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/pom/types.js +0 -0
- /package/{cli/dist → dist}/core/proof/bundle.d.ts +0 -0
- /package/{cli/dist → dist}/core/proof/bundle.js +0 -0
- /package/{cli/dist → dist}/core/proof/canonicalize.d.ts +0 -0
- /package/{cli/dist → dist}/core/proof/canonicalize.js +0 -0
- /package/{cli/dist → dist}/core/proof/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/proof/index.js +0 -0
- /package/{cli/dist → dist}/core/proof/schema.d.ts +0 -0
- /package/{cli/dist → dist}/core/proof/schema.js +0 -0
- /package/{cli/dist → dist}/core/proof/signer.d.ts +0 -0
- /package/{cli/dist → dist}/core/proof/signer.js +0 -0
- /package/{cli/dist → dist}/core/proof/verifier.d.ts +0 -0
- /package/{cli/dist → dist}/core/proof/verifier.js +0 -0
- /package/{cli/dist → dist}/core/regression/detector.d.ts +0 -0
- /package/{cli/dist → dist}/core/regression/detector.js +0 -0
- /package/{cli/dist → dist}/core/regression/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/regression/index.js +0 -0
- /package/{cli/dist → dist}/core/regression/trend-analyzer.d.ts +0 -0
- /package/{cli/dist → dist}/core/regression/trend-analyzer.js +0 -0
- /package/{cli/dist → dist}/core/regression/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/regression/types.js +0 -0
- /package/{cli/dist → dist}/core/regression/vault.d.ts +0 -0
- /package/{cli/dist → dist}/core/regression/vault.js +0 -0
- /package/{cli/dist → dist}/core/repair/engine/fixer.d.ts +0 -0
- /package/{cli/dist → dist}/core/repair/engine/fixer.js +0 -0
- /package/{cli/dist → dist}/core/repair/engine/suggestion-engine.d.ts +0 -0
- /package/{cli/dist → dist}/core/repair/engine/suggestion-engine.js +0 -0
- /package/{cli/dist → dist}/core/repair/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/repair/index.js +0 -0
- /package/{cli/dist → dist}/core/repair/repairer.d.ts +0 -0
- /package/{cli/dist → dist}/core/repair/repairer.js +0 -0
- /package/{cli/dist → dist}/core/repair/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/repair/types.js +0 -0
- /package/{cli/dist → dist}/core/repair/utils/error-analyzer.d.ts +0 -0
- /package/{cli/dist → dist}/core/repair/utils/error-analyzer.js +0 -0
- /package/{cli/dist → dist}/core/reporting/html-reporter.d.ts +0 -0
- /package/{cli/dist → dist}/core/reporting/html-reporter.js +0 -0
- /package/{cli/dist → dist}/core/retry/flakiness-integration.d.ts +0 -0
- /package/{cli/dist → dist}/core/retry/flakiness-integration.js +0 -0
- /package/{cli/dist → dist}/core/retry/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/retry/index.js +0 -0
- /package/{cli/dist → dist}/core/retry/retry-engine.d.ts +0 -0
- /package/{cli/dist → dist}/core/retry/retry-engine.js +0 -0
- /package/{cli/dist → dist}/core/retry/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/retry/types.js +0 -0
- /package/{cli/dist → dist}/core/retry/vault.d.ts +0 -0
- /package/{cli/dist → dist}/core/retry/vault.js +0 -0
- /package/{cli/dist → dist}/core/schemas/pack.schema.json +0 -0
- /package/{cli/dist → dist}/core/secrets/crypto.d.ts +0 -0
- /package/{cli/dist → dist}/core/secrets/crypto.js +0 -0
- /package/{cli/dist → dist}/core/secrets/manager.d.ts +0 -0
- /package/{cli/dist → dist}/core/secrets/manager.js +0 -0
- /package/{cli/dist → dist}/core/security/redaction-patterns-extended.d.ts +0 -0
- /package/{cli/dist → dist}/core/security/redaction-patterns-extended.js +0 -0
- /package/{cli/dist → dist}/core/security/redactor.d.ts +0 -0
- /package/{cli/dist → dist}/core/security/redactor.js +0 -0
- /package/{cli/dist → dist}/core/self-healing/assertion-healer.d.ts +0 -0
- /package/{cli/dist → dist}/core/self-healing/assertion-healer.js +0 -0
- /package/{cli/dist → dist}/core/self-healing/engine.d.ts +0 -0
- /package/{cli/dist → dist}/core/self-healing/engine.js +0 -0
- /package/{cli/dist → dist}/core/self-healing/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/self-healing/index.js +0 -0
- /package/{cli/dist → dist}/core/self-healing/selector-healer.d.ts +0 -0
- /package/{cli/dist → dist}/core/self-healing/selector-healer.js +0 -0
- /package/{cli/dist → dist}/core/self-healing/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/self-healing/types.js +0 -0
- /package/{cli/dist → dist}/core/serve/diagnostics-collector.d.ts +0 -0
- /package/{cli/dist → dist}/core/serve/diagnostics-collector.js +0 -0
- /package/{cli/dist → dist}/core/serve/health-checker.d.ts +0 -0
- /package/{cli/dist → dist}/core/serve/health-checker.js +0 -0
- /package/{cli/dist → dist}/core/serve/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/serve/index.js +0 -0
- /package/{cli/dist → dist}/core/serve/metrics-collector.d.ts +0 -0
- /package/{cli/dist → dist}/core/serve/metrics-collector.js +0 -0
- /package/{cli/dist → dist}/core/serve/process-manager.d.ts +0 -0
- /package/{cli/dist → dist}/core/serve/process-manager.js +0 -0
- /package/{cli/dist → dist}/core/serve/server.d.ts +0 -0
- /package/{cli/dist → dist}/core/serve/server.js +0 -0
- /package/{cli/dist → dist}/core/slo/config.d.ts +0 -0
- /package/{cli/dist → dist}/core/slo/config.js +0 -0
- /package/{cli/dist → dist}/core/slo/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/slo/index.js +0 -0
- /package/{cli/dist → dist}/core/slo/sli-calculator.d.ts +0 -0
- /package/{cli/dist → dist}/core/slo/sli-calculator.js +0 -0
- /package/{cli/dist → dist}/core/slo/slo-tracker.d.ts +0 -0
- /package/{cli/dist → dist}/core/slo/slo-tracker.js +0 -0
- /package/{cli/dist → dist}/core/slo/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/slo/types.js +0 -0
- /package/{cli/dist → dist}/core/slo/vault.d.ts +0 -0
- /package/{cli/dist → dist}/core/slo/vault.js +0 -0
- /package/{cli/dist → dist}/core/tui/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/tui/index.js +0 -0
- /package/{cli/dist → dist}/core/tui/monitor.d.ts +0 -0
- /package/{cli/dist → dist}/core/tui/monitor.js +0 -0
- /package/{cli/dist → dist}/core/tui/renderer.d.ts +0 -0
- /package/{cli/dist → dist}/core/tui/renderer.js +0 -0
- /package/{cli/dist → dist}/core/tui/types.d.ts +0 -0
- /package/{cli/dist → dist}/core/tui/types.js +0 -0
- /package/{cli/dist → dist}/core/types/pack-v1.js +0 -0
- /package/{cli/dist → dist}/core/types/pack-v2.js +0 -0
- /package/{cli/dist → dist}/core/types/trust-score.d.ts +0 -0
- /package/{cli/dist → dist}/core/types/trust-score.js +0 -0
- /package/{cli/dist → dist}/core/vault/cas.d.ts +0 -0
- /package/{cli/dist → dist}/core/vault/cas.js +0 -0
- /package/{cli/dist → dist}/core/vault/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/vault/index.js +0 -0
- /package/{cli/dist → dist}/core/visual/visual-regression.d.ts +0 -0
- /package/{cli/dist → dist}/core/visual/visual-regression.js +0 -0
- /package/{cli/dist → dist}/core/watch/index.d.ts +0 -0
- /package/{cli/dist → dist}/core/watch/index.js +0 -0
- /package/{cli/dist → dist}/core/watch/watch-mode.d.ts +0 -0
- /package/{cli/dist → dist}/core/watch/watch-mode.js +0 -0
- /package/{cli/dist → dist}/generators/index.d.ts +0 -0
- /package/{cli/dist → dist}/generators/index.js +0 -0
- /package/{cli/dist → dist}/generators/json-reporter.d.ts +0 -0
- /package/{cli/dist → dist}/generators/json-reporter.js +0 -0
- /package/{cli/dist → dist}/generators/test-generator.d.ts +0 -0
- /package/{cli/dist → dist}/generators/test-generator.js +0 -0
- /package/{cli/dist → dist}/index.d.ts +0 -0
- /package/{cli/dist → dist}/index.js +0 -0
- /package/{cli/dist → dist}/scanners/dom-scanner.d.ts +0 -0
- /package/{cli/dist → dist}/scanners/dom-scanner.js +0 -0
- /package/{cli/dist → dist}/scanners/index.d.ts +0 -0
- /package/{cli/dist → dist}/scanners/index.js +0 -0
- /package/{cli/dist → dist}/schemas/pack.schema.json +0 -0
- /package/{cli/dist → dist}/types/scan.d.ts +0 -0
- /package/{cli/dist → dist}/types/scan.js +0 -0
- /package/{cli/dist → dist}/utils/config.js +0 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Presigned URL Uploader
|
|
3
|
+
*
|
|
4
|
+
* Handles file uploads using presigned URLs for cloud storage.
|
|
5
|
+
* Supports:
|
|
6
|
+
* - AWS S3 presigned URLs
|
|
7
|
+
* - Azure Blob Storage SAS URLs
|
|
8
|
+
* - Google Cloud Storage signed URLs
|
|
9
|
+
* - Custom presigned URL providers
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Presigned URL uploader class
|
|
13
|
+
*/
|
|
14
|
+
export class PresignedUploader {
|
|
15
|
+
config;
|
|
16
|
+
constructor(config) {
|
|
17
|
+
this.config = {
|
|
18
|
+
presignedUrlEndpoint: config.presignedUrlEndpoint,
|
|
19
|
+
method: config.method || 'POST',
|
|
20
|
+
headers: config.headers || {},
|
|
21
|
+
requestFields: config.requestFields || {},
|
|
22
|
+
requestParams: config.requestParams || {},
|
|
23
|
+
fileField: config.fileField || 'file',
|
|
24
|
+
uploadFields: config.uploadFields || {},
|
|
25
|
+
uploadMethod: config.uploadMethod || 'PUT',
|
|
26
|
+
uploadHeaders: config.uploadHeaders || {},
|
|
27
|
+
onProgress: config.onProgress || (() => { }),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Upload a file using a presigned URL
|
|
32
|
+
*/
|
|
33
|
+
async upload(file, fileName) {
|
|
34
|
+
try {
|
|
35
|
+
// Step 1: Request presigned URL
|
|
36
|
+
const presignedResponse = await this.requestPresignedUrl(fileName || file.name || 'upload', file.size, file.type);
|
|
37
|
+
if (!presignedResponse.url) {
|
|
38
|
+
return {
|
|
39
|
+
success: false,
|
|
40
|
+
error: 'No presigned URL received',
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
// Step 2: Upload file to presigned URL
|
|
44
|
+
const uploadResult = await this.uploadToPresignedUrl(file, presignedResponse);
|
|
45
|
+
if (!uploadResult.success) {
|
|
46
|
+
return uploadResult;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
success: true,
|
|
50
|
+
key: presignedResponse.key,
|
|
51
|
+
url: presignedResponse.url.split('?')[0], // Remove query params
|
|
52
|
+
response: uploadResult.response,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
return {
|
|
57
|
+
success: false,
|
|
58
|
+
error: error instanceof Error ? error.message : 'Upload failed',
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Request a presigned URL from the server
|
|
64
|
+
*/
|
|
65
|
+
async requestPresignedUrl(fileName, fileSize, contentType) {
|
|
66
|
+
// Build request body
|
|
67
|
+
const requestBody = {
|
|
68
|
+
fileName,
|
|
69
|
+
fileSize,
|
|
70
|
+
contentType,
|
|
71
|
+
...this.config.requestFields,
|
|
72
|
+
};
|
|
73
|
+
// Build URL with params
|
|
74
|
+
let url = this.config.presignedUrlEndpoint;
|
|
75
|
+
const queryParams = new URLSearchParams(this.config.requestParams).toString();
|
|
76
|
+
if (queryParams) {
|
|
77
|
+
url += (url.includes('?') ? '&' : '?') + queryParams;
|
|
78
|
+
}
|
|
79
|
+
const response = await fetch(url, {
|
|
80
|
+
method: this.config.method,
|
|
81
|
+
headers: {
|
|
82
|
+
'Content-Type': 'application/json',
|
|
83
|
+
...this.config.headers,
|
|
84
|
+
},
|
|
85
|
+
body: JSON.stringify(requestBody),
|
|
86
|
+
});
|
|
87
|
+
if (!response.ok) {
|
|
88
|
+
throw new Error(`Presigned URL request failed: ${response.statusText}`);
|
|
89
|
+
}
|
|
90
|
+
const data = await response.json();
|
|
91
|
+
// Handle different response formats
|
|
92
|
+
return {
|
|
93
|
+
url: data.url || data.uploadUrl || data.presignedUrl,
|
|
94
|
+
method: data.method || this.config.uploadMethod,
|
|
95
|
+
headers: data.headers || {},
|
|
96
|
+
fields: data.fields || {},
|
|
97
|
+
key: data.key || data.fileId || data.id,
|
|
98
|
+
expiresAt: data.expiresAt,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Upload file to the presigned URL
|
|
103
|
+
*/
|
|
104
|
+
async uploadToPresignedUrl(file, presigned) {
|
|
105
|
+
const method = presigned.method || this.config.uploadMethod;
|
|
106
|
+
if (method === 'PUT') {
|
|
107
|
+
return await this.uploadViaPut(file, presigned);
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
return await this.uploadViaPost(file, presigned);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Upload via PUT request (S3 style)
|
|
115
|
+
*/
|
|
116
|
+
async uploadViaPut(file, presigned) {
|
|
117
|
+
const xhr = new XMLHttpRequest();
|
|
118
|
+
return new Promise((resolve, reject) => {
|
|
119
|
+
xhr.upload.addEventListener('progress', (e) => {
|
|
120
|
+
if (e.lengthComputable) {
|
|
121
|
+
this.config.onProgress({
|
|
122
|
+
loaded: e.loaded,
|
|
123
|
+
total: e.total,
|
|
124
|
+
percentage: (e.loaded / e.total) * 100,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
xhr.addEventListener('load', () => {
|
|
129
|
+
if (xhr.status >= 200 && xhr.status < 300) {
|
|
130
|
+
resolve({
|
|
131
|
+
success: true,
|
|
132
|
+
response: xhr.response,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
resolve({
|
|
137
|
+
success: false,
|
|
138
|
+
error: `Upload failed with status ${xhr.status}`,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
xhr.addEventListener('error', () => {
|
|
143
|
+
resolve({
|
|
144
|
+
success: false,
|
|
145
|
+
error: 'Network error during upload',
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
xhr.open('PUT', presigned.url);
|
|
149
|
+
// Add required headers
|
|
150
|
+
const headers = {
|
|
151
|
+
'Content-Type': file.type || 'application/octet-stream',
|
|
152
|
+
...this.config.uploadHeaders,
|
|
153
|
+
...presigned.headers,
|
|
154
|
+
};
|
|
155
|
+
Object.entries(headers).forEach(([key, value]) => {
|
|
156
|
+
xhr.setRequestHeader(key, value);
|
|
157
|
+
});
|
|
158
|
+
xhr.send(file);
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Upload via POST request (multipart/form-data style)
|
|
163
|
+
*/
|
|
164
|
+
async uploadViaPost(file, presigned) {
|
|
165
|
+
const formData = new FormData();
|
|
166
|
+
// Add file
|
|
167
|
+
formData.append(this.config.fileField, file);
|
|
168
|
+
// Add required fields from presigned response
|
|
169
|
+
Object.entries({ ...presigned.fields, ...this.config.uploadFields }).forEach(([key, value]) => {
|
|
170
|
+
formData.append(key, value);
|
|
171
|
+
});
|
|
172
|
+
const xhr = new XMLHttpRequest();
|
|
173
|
+
return new Promise((resolve, reject) => {
|
|
174
|
+
xhr.upload.addEventListener('progress', (e) => {
|
|
175
|
+
if (e.lengthComputable) {
|
|
176
|
+
this.config.onProgress({
|
|
177
|
+
loaded: e.loaded,
|
|
178
|
+
total: e.total,
|
|
179
|
+
percentage: (e.loaded / e.total) * 100,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
xhr.addEventListener('load', () => {
|
|
184
|
+
if (xhr.status >= 200 && xhr.status < 300) {
|
|
185
|
+
resolve({
|
|
186
|
+
success: true,
|
|
187
|
+
response: xhr.response,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
resolve({
|
|
192
|
+
success: false,
|
|
193
|
+
error: `Upload failed with status ${xhr.status}`,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
xhr.addEventListener('error', () => {
|
|
198
|
+
resolve({
|
|
199
|
+
success: false,
|
|
200
|
+
error: 'Network error during upload',
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
xhr.open('POST', presigned.url);
|
|
204
|
+
// Add headers (don't set Content-Type for FormData, browser does it with boundary)
|
|
205
|
+
Object.entries({ ...presigned.headers, ...this.config.uploadHeaders }).forEach(([key, value]) => {
|
|
206
|
+
if (key.toLowerCase() !== 'content-type') {
|
|
207
|
+
xhr.setRequestHeader(key, value);
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
xhr.send(formData);
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Upload multiple files concurrently
|
|
215
|
+
*/
|
|
216
|
+
async uploadMultiple(files, concurrency = 3) {
|
|
217
|
+
const results = [];
|
|
218
|
+
const queue = [...files];
|
|
219
|
+
const activeUploads = [];
|
|
220
|
+
while (queue.length > 0) {
|
|
221
|
+
while (activeUploads.length < concurrency && queue.length > 0) {
|
|
222
|
+
const file = queue.shift();
|
|
223
|
+
const uploadPromise = this.upload(file).then((result) => {
|
|
224
|
+
results.push(result);
|
|
225
|
+
activeUploads.splice(activeUploads.indexOf(uploadPromise), 1);
|
|
226
|
+
});
|
|
227
|
+
activeUploads.push(uploadPromise);
|
|
228
|
+
}
|
|
229
|
+
await Promise.race(activeUploads);
|
|
230
|
+
}
|
|
231
|
+
await Promise.all(activeUploads);
|
|
232
|
+
return results;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Create a presigned URL uploader instance
|
|
237
|
+
*/
|
|
238
|
+
export function createPresignedUploader(config) {
|
|
239
|
+
return new PresignedUploader(config);
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Upload a file using a presigned URL (convenience function)
|
|
243
|
+
*/
|
|
244
|
+
export async function uploadWithPresignedUrl(file, config) {
|
|
245
|
+
const uploader = new PresignedUploader(config);
|
|
246
|
+
return uploader.upload(file);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* AWS S3 specific presigned uploader
|
|
250
|
+
*/
|
|
251
|
+
export class S3PresignedUploader extends PresignedUploader {
|
|
252
|
+
constructor(config) {
|
|
253
|
+
super({
|
|
254
|
+
...config,
|
|
255
|
+
uploadMethod: 'PUT',
|
|
256
|
+
uploadFields: {},
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Azure Blob Storage specific presigned uploader
|
|
262
|
+
*/
|
|
263
|
+
export class AzurePresignedUploader extends PresignedUploader {
|
|
264
|
+
constructor(config) {
|
|
265
|
+
super({
|
|
266
|
+
...config,
|
|
267
|
+
uploadMethod: 'PUT',
|
|
268
|
+
uploadHeaders: {
|
|
269
|
+
'x-ms-blob-type': 'BlockBlob',
|
|
270
|
+
},
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
export default PresignedUploader;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QA360 Device Emulation Module
|
|
3
|
+
*
|
|
4
|
+
* P0: Mobile and tablet device emulation
|
|
5
|
+
* - Predefined device profiles
|
|
6
|
+
* - Viewport resizing
|
|
7
|
+
* - User agent emulation
|
|
8
|
+
* - Touch/Mouse interaction switching
|
|
9
|
+
* - Device pixel ratio handling
|
|
10
|
+
* - Orientation (portrait/landscape)
|
|
11
|
+
*/
|
|
12
|
+
import type { Page } from '@playwright/test';
|
|
13
|
+
/**
|
|
14
|
+
* Device viewport configuration
|
|
15
|
+
*/
|
|
16
|
+
export interface ViewportConfig {
|
|
17
|
+
/** Viewport width in pixels */
|
|
18
|
+
width: number;
|
|
19
|
+
/** Viewport height in pixels */
|
|
20
|
+
height: number;
|
|
21
|
+
/** Device scale factor (default: 1) */
|
|
22
|
+
deviceScaleFactor?: number;
|
|
23
|
+
/** Whether to emulate mobile (default: false) */
|
|
24
|
+
isMobile?: boolean;
|
|
25
|
+
/** Whether to emulate touch (default: false for desktop, true for mobile) */
|
|
26
|
+
hasTouch?: boolean;
|
|
27
|
+
/** Screen orientation */
|
|
28
|
+
landscape?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Device profile with full configuration
|
|
32
|
+
*/
|
|
33
|
+
export interface DeviceProfile extends ViewportConfig {
|
|
34
|
+
/** Device name */
|
|
35
|
+
name: string;
|
|
36
|
+
/** User agent string */
|
|
37
|
+
userAgent: string;
|
|
38
|
+
/** Device category */
|
|
39
|
+
category: 'desktop' | 'tablet' | 'mobile';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Orientation options
|
|
43
|
+
*/
|
|
44
|
+
export type Orientation = 'portrait' | 'landscape';
|
|
45
|
+
/**
|
|
46
|
+
* Device Emulation Helper
|
|
47
|
+
*/
|
|
48
|
+
export declare class DeviceEmulator {
|
|
49
|
+
private page;
|
|
50
|
+
private static profiles;
|
|
51
|
+
constructor(page: Page);
|
|
52
|
+
/**
|
|
53
|
+
* Get all available device profiles
|
|
54
|
+
*/
|
|
55
|
+
static getProfiles(): Record<string, DeviceProfile>;
|
|
56
|
+
/**
|
|
57
|
+
* Get a specific device profile
|
|
58
|
+
*/
|
|
59
|
+
static getProfile(name: string): DeviceProfile | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Get all profiles by category
|
|
62
|
+
*/
|
|
63
|
+
static getProfilesByCategory(category: 'desktop' | 'tablet' | 'mobile'): DeviceProfile[];
|
|
64
|
+
/**
|
|
65
|
+
* Emulate a device by name
|
|
66
|
+
*/
|
|
67
|
+
emulate(device: string): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Emulate a device profile
|
|
70
|
+
*/
|
|
71
|
+
emulateProfile(profile: DeviceProfile): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Set viewport size
|
|
74
|
+
*/
|
|
75
|
+
setViewport(width: number, height: number, options?: Partial<ViewportConfig>): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Set viewport to predefined dimensions
|
|
78
|
+
*/
|
|
79
|
+
desktop(): Promise<void>;
|
|
80
|
+
tablet(): Promise<void>;
|
|
81
|
+
mobile(): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Set screen orientation
|
|
84
|
+
*/
|
|
85
|
+
setOrientation(orientation: Orientation): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Rotate device (swap width and height)
|
|
88
|
+
*/
|
|
89
|
+
rotate(): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Set device pixel ratio
|
|
92
|
+
*/
|
|
93
|
+
setDeviceScaleFactor(dpr: number): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Enable/disable touch emulation
|
|
96
|
+
*/
|
|
97
|
+
setTouch(enabled: boolean): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Get current viewport info
|
|
100
|
+
*/
|
|
101
|
+
getViewport(): Promise<ViewportConfig | null>;
|
|
102
|
+
/**
|
|
103
|
+
* Test at multiple viewport sizes (responsive testing)
|
|
104
|
+
*/
|
|
105
|
+
testAtSizes(sizes: Array<{
|
|
106
|
+
width: number;
|
|
107
|
+
height: number;
|
|
108
|
+
}>, testFn: () => Promise<void>): Promise<Array<{
|
|
109
|
+
size: {
|
|
110
|
+
width: number;
|
|
111
|
+
height: number;
|
|
112
|
+
};
|
|
113
|
+
passed: boolean;
|
|
114
|
+
error?: Error;
|
|
115
|
+
}>>;
|
|
116
|
+
/**
|
|
117
|
+
* Test at multiple breakpoints (common responsive sizes)
|
|
118
|
+
*/
|
|
119
|
+
testResponsive(testFn: () => Promise<void>): Promise<Array<{
|
|
120
|
+
breakpoint: string;
|
|
121
|
+
passed: boolean;
|
|
122
|
+
error?: Error;
|
|
123
|
+
}>>;
|
|
124
|
+
/**
|
|
125
|
+
* Test on multiple device profiles
|
|
126
|
+
*/
|
|
127
|
+
testOnDevices(devices: string[], testFn: () => Promise<void>): Promise<Array<{
|
|
128
|
+
device: string;
|
|
129
|
+
passed: boolean;
|
|
130
|
+
error?: Error;
|
|
131
|
+
}>>;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Convenience function to create device emulator
|
|
135
|
+
*/
|
|
136
|
+
export declare function device(page: Page): DeviceEmulator;
|
|
137
|
+
/**
|
|
138
|
+
* Common viewport presets
|
|
139
|
+
*/
|
|
140
|
+
export declare const Viewport: {
|
|
141
|
+
'desktop-xl': {
|
|
142
|
+
width: number;
|
|
143
|
+
height: number;
|
|
144
|
+
};
|
|
145
|
+
'desktop-lg': {
|
|
146
|
+
width: number;
|
|
147
|
+
height: number;
|
|
148
|
+
};
|
|
149
|
+
'desktop-md': {
|
|
150
|
+
width: number;
|
|
151
|
+
height: number;
|
|
152
|
+
};
|
|
153
|
+
'desktop-sm': {
|
|
154
|
+
width: number;
|
|
155
|
+
height: number;
|
|
156
|
+
};
|
|
157
|
+
'tablet-lg': {
|
|
158
|
+
width: number;
|
|
159
|
+
height: number;
|
|
160
|
+
};
|
|
161
|
+
'tablet-md': {
|
|
162
|
+
width: number;
|
|
163
|
+
height: number;
|
|
164
|
+
};
|
|
165
|
+
'tablet-sm': {
|
|
166
|
+
width: number;
|
|
167
|
+
height: number;
|
|
168
|
+
};
|
|
169
|
+
'mobile-lg': {
|
|
170
|
+
width: number;
|
|
171
|
+
height: number;
|
|
172
|
+
};
|
|
173
|
+
'mobile-md': {
|
|
174
|
+
width: number;
|
|
175
|
+
height: number;
|
|
176
|
+
};
|
|
177
|
+
'mobile-sm': {
|
|
178
|
+
width: number;
|
|
179
|
+
height: number;
|
|
180
|
+
};
|
|
181
|
+
'mobile-xs': {
|
|
182
|
+
width: number;
|
|
183
|
+
height: number;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Common device lists
|
|
188
|
+
*/
|
|
189
|
+
export declare const Devices: {
|
|
190
|
+
desktop: readonly ["desktop-1920x1080", "desktop-1366x768", "macbook-16"];
|
|
191
|
+
tablet: readonly ["ipad-pro", "ipad", "ipad-mini", "surface-pro"];
|
|
192
|
+
mobile: readonly ["iphone-15-pro-max", "iphone-15-pro", "iphone-se", "pixel-7-pro", "samsung-s23"];
|
|
193
|
+
popular: readonly ["desktop-1920x1080", "ipad", "iphone-15-pro", "pixel-7-pro"];
|
|
194
|
+
};
|