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,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reporting API Handler
|
|
3
|
+
*
|
|
4
|
+
* P1 - Reporting API and Reporting Observer management
|
|
5
|
+
*
|
|
6
|
+
* Supports:
|
|
7
|
+
* - Reporting API header parsing
|
|
8
|
+
* - Reporting Observer setup
|
|
9
|
+
* - Report collection (CSP, COOP/COEP, etc.)
|
|
10
|
+
* - Report analysis and categorization
|
|
11
|
+
* - Reporting endpoint monitoring
|
|
12
|
+
*
|
|
13
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Reporting_API
|
|
14
|
+
*/
|
|
15
|
+
export type ReportType = 'csp-violation' | 'permissions-policy-violation' | 'intervention' | 'deprecation' | 'network-error' | 'crash';
|
|
16
|
+
export interface Report {
|
|
17
|
+
/** Report type */
|
|
18
|
+
type: ReportType;
|
|
19
|
+
/** Report URL (where it was generated) */
|
|
20
|
+
url: string;
|
|
21
|
+
/** Report body (type-specific) */
|
|
22
|
+
body: Record<string, unknown>;
|
|
23
|
+
/** Report timestamp */
|
|
24
|
+
timestamp: number;
|
|
25
|
+
/** Report ID (for deduplication) */
|
|
26
|
+
id: string;
|
|
27
|
+
}
|
|
28
|
+
export interface CSPViolationReport extends Report {
|
|
29
|
+
type: 'csp-violation';
|
|
30
|
+
body: {
|
|
31
|
+
/** Violated directive */
|
|
32
|
+
directive: string;
|
|
33
|
+
/** Blocked resource */
|
|
34
|
+
blockedURL?: string;
|
|
35
|
+
/** Original policy */
|
|
36
|
+
policy?: string;
|
|
37
|
+
/** Source file */
|
|
38
|
+
sourceFile?: string;
|
|
39
|
+
/** Line number */
|
|
40
|
+
lineNumber?: number;
|
|
41
|
+
/** Column number */
|
|
42
|
+
columnNumber?: number;
|
|
43
|
+
/** Disposition */
|
|
44
|
+
disposition?: 'report' | 'enforce';
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export interface PermissionsPolicyViolationReport extends Report {
|
|
48
|
+
type: 'permissions-policy-violation';
|
|
49
|
+
body: {
|
|
50
|
+
/** Violated feature */
|
|
51
|
+
feature: string;
|
|
52
|
+
/** Source file */
|
|
53
|
+
sourceFile?: string;
|
|
54
|
+
/** Line number */
|
|
55
|
+
lineNumber?: number;
|
|
56
|
+
/** Column number */
|
|
57
|
+
columnNumber?: number;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export interface InterventionReport extends Report {
|
|
61
|
+
type: 'intervention';
|
|
62
|
+
body: {
|
|
63
|
+
/** Intervention reason */
|
|
64
|
+
reason?: string;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export interface DeprecationReport extends Report {
|
|
68
|
+
type: 'deprecation';
|
|
69
|
+
body: {
|
|
70
|
+
/** Deprecated feature */
|
|
71
|
+
id?: string;
|
|
72
|
+
/** Expected removal date */
|
|
73
|
+
anticipatedRemoval?: string;
|
|
74
|
+
/** Message */
|
|
75
|
+
message?: string;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export interface ReportingEndpoint {
|
|
79
|
+
/** Endpoint name */
|
|
80
|
+
name: string;
|
|
81
|
+
/** Endpoint URL */
|
|
82
|
+
url: string;
|
|
83
|
+
/** Priority */
|
|
84
|
+
priority?: number;
|
|
85
|
+
/** Weight for load balancing */
|
|
86
|
+
weight?: number;
|
|
87
|
+
}
|
|
88
|
+
export interface ReportingAPIConfig {
|
|
89
|
+
/** Report-To header value */
|
|
90
|
+
reportTo: string | null;
|
|
91
|
+
/** Reporting endpoints */
|
|
92
|
+
endpoints: ReportingEndpoint[];
|
|
93
|
+
/** Reporting-Endpoints header value */
|
|
94
|
+
reportingEndpoints: string | null;
|
|
95
|
+
}
|
|
96
|
+
export interface ReportingSummary {
|
|
97
|
+
/** Total reports collected */
|
|
98
|
+
totalReports: number;
|
|
99
|
+
/** Reports by type */
|
|
100
|
+
reportsByType: Record<ReportType, number>;
|
|
101
|
+
/** CSP violations */
|
|
102
|
+
cspViolations: CSPViolationReport[];
|
|
103
|
+
/** Permissions policy violations */
|
|
104
|
+
permissionsViolations: PermissionsPolicyViolationReport[];
|
|
105
|
+
/** Interventions */
|
|
106
|
+
interventions: InterventionReport[];
|
|
107
|
+
/** Deprecations */
|
|
108
|
+
deprecations: DeprecationReport[];
|
|
109
|
+
/** Most common issues */
|
|
110
|
+
commonIssues: Array<{
|
|
111
|
+
type: string;
|
|
112
|
+
count: number;
|
|
113
|
+
description: string;
|
|
114
|
+
}>;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Reporting API Handler class
|
|
118
|
+
*/
|
|
119
|
+
export declare class ReportingAPIHandler {
|
|
120
|
+
private page;
|
|
121
|
+
private reports;
|
|
122
|
+
private observerInstalled;
|
|
123
|
+
constructor(page: any);
|
|
124
|
+
/**
|
|
125
|
+
* Check if Reporting Observer is supported
|
|
126
|
+
*/
|
|
127
|
+
isSupported(): Promise<boolean>;
|
|
128
|
+
/**
|
|
129
|
+
* Get Reporting API headers
|
|
130
|
+
*/
|
|
131
|
+
getReportingHeaders(): Promise<ReportingAPIConfig>;
|
|
132
|
+
/**
|
|
133
|
+
* Install Reporting Observer
|
|
134
|
+
*/
|
|
135
|
+
installObserver(options?: {
|
|
136
|
+
buffered?: boolean;
|
|
137
|
+
types?: ReportType[];
|
|
138
|
+
}): Promise<boolean>;
|
|
139
|
+
/**
|
|
140
|
+
* Get all collected reports
|
|
141
|
+
*/
|
|
142
|
+
getReports(): Promise<Report[]>;
|
|
143
|
+
/**
|
|
144
|
+
* Get reports by type
|
|
145
|
+
*/
|
|
146
|
+
getReportsByType<T extends Report>(type: ReportType): Promise<T[]>;
|
|
147
|
+
/**
|
|
148
|
+
* Get CSP violation reports
|
|
149
|
+
*/
|
|
150
|
+
getCSPViolations(): Promise<CSPViolationReport[]>;
|
|
151
|
+
/**
|
|
152
|
+
* Get permissions policy violation reports
|
|
153
|
+
*/
|
|
154
|
+
getPermissionsPolicyViolations(): Promise<PermissionsPolicyViolationReport[]>;
|
|
155
|
+
/**
|
|
156
|
+
* Get intervention reports
|
|
157
|
+
*/
|
|
158
|
+
getInterventions(): Promise<InterventionReport[]>;
|
|
159
|
+
/**
|
|
160
|
+
* Get deprecation reports
|
|
161
|
+
*/
|
|
162
|
+
getDeprecations(): Promise<DeprecationReport[]>;
|
|
163
|
+
/**
|
|
164
|
+
* Generate reporting summary
|
|
165
|
+
*/
|
|
166
|
+
getSummary(): Promise<ReportingSummary>;
|
|
167
|
+
/**
|
|
168
|
+
* Clear all collected reports
|
|
169
|
+
*/
|
|
170
|
+
clearReports(): Promise<void>;
|
|
171
|
+
/**
|
|
172
|
+
* Wait for new reports
|
|
173
|
+
*/
|
|
174
|
+
waitForNewReports(timeout?: number): Promise<Report[]>;
|
|
175
|
+
/**
|
|
176
|
+
* Generate mock report (for testing)
|
|
177
|
+
*/
|
|
178
|
+
generateMockReport(type: ReportType, body: Record<string, unknown>): Promise<void>;
|
|
179
|
+
/**
|
|
180
|
+
* Analyze CSP violations for patterns
|
|
181
|
+
*/
|
|
182
|
+
analyzeCSPViolations(): Promise<{
|
|
183
|
+
total: number;
|
|
184
|
+
byDirective: Record<string, number>;
|
|
185
|
+
byBlockedURL: Record<string, number>;
|
|
186
|
+
recommendations: string[];
|
|
187
|
+
}>;
|
|
188
|
+
/**
|
|
189
|
+
* Check for critical issues
|
|
190
|
+
*/
|
|
191
|
+
checkCriticalIssues(): Promise<{
|
|
192
|
+
hasCriticalIssues: boolean;
|
|
193
|
+
issues: string[];
|
|
194
|
+
}>;
|
|
195
|
+
/**
|
|
196
|
+
* Export reports as JSON
|
|
197
|
+
*/
|
|
198
|
+
exportReports(): Promise<string>;
|
|
199
|
+
/**
|
|
200
|
+
* Get Reporting API documentation
|
|
201
|
+
*/
|
|
202
|
+
getDocumentation(): {
|
|
203
|
+
overview: string;
|
|
204
|
+
url: string;
|
|
205
|
+
reportTypes: Record<ReportType, string>;
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Factory function to create Reporting API Handler
|
|
210
|
+
*/
|
|
211
|
+
export declare function createReportingAPIHandler(page: any): ReportingAPIHandler;
|
|
212
|
+
export default ReportingAPIHandler;
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reporting API Handler
|
|
3
|
+
*
|
|
4
|
+
* P1 - Reporting API and Reporting Observer management
|
|
5
|
+
*
|
|
6
|
+
* Supports:
|
|
7
|
+
* - Reporting API header parsing
|
|
8
|
+
* - Reporting Observer setup
|
|
9
|
+
* - Report collection (CSP, COOP/COEP, etc.)
|
|
10
|
+
* - Report analysis and categorization
|
|
11
|
+
* - Reporting endpoint monitoring
|
|
12
|
+
*
|
|
13
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Reporting_API
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Reporting API Handler class
|
|
17
|
+
*/
|
|
18
|
+
export class ReportingAPIHandler {
|
|
19
|
+
page;
|
|
20
|
+
reports = [];
|
|
21
|
+
observerInstalled = false;
|
|
22
|
+
constructor(page) {
|
|
23
|
+
this.page = page;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Check if Reporting Observer is supported
|
|
27
|
+
*/
|
|
28
|
+
async isSupported() {
|
|
29
|
+
return await this.page.evaluate(() => {
|
|
30
|
+
return 'ReportingObserver' in window;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get Reporting API headers
|
|
35
|
+
*/
|
|
36
|
+
async getReportingHeaders() {
|
|
37
|
+
return await this.page.evaluate(async () => {
|
|
38
|
+
try {
|
|
39
|
+
const response = await fetch(window.location.href, { method: 'HEAD' });
|
|
40
|
+
const reportTo = response.headers.get('Report-To');
|
|
41
|
+
const reportingEndpoints = response.headers.get('Reporting-Endpoints');
|
|
42
|
+
// Parse Report-To header (JSON format)
|
|
43
|
+
let endpoints = [];
|
|
44
|
+
if (reportTo) {
|
|
45
|
+
try {
|
|
46
|
+
const parsed = JSON.parse(reportTo);
|
|
47
|
+
if (parsed.headers) {
|
|
48
|
+
endpoints = parsed.headers;
|
|
49
|
+
}
|
|
50
|
+
else if (Array.isArray(parsed)) {
|
|
51
|
+
endpoints = parsed;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
// Invalid JSON
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
reportTo,
|
|
60
|
+
endpoints,
|
|
61
|
+
reportingEndpoints,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return {
|
|
66
|
+
reportTo: null,
|
|
67
|
+
endpoints: [],
|
|
68
|
+
reportingEndpoints: null,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Install Reporting Observer
|
|
75
|
+
*/
|
|
76
|
+
async installObserver(options) {
|
|
77
|
+
if (!(await this.isSupported())) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
await this.page.evaluate((opts) => {
|
|
81
|
+
// Initialize report storage
|
|
82
|
+
if (!window.__reportingObserverReports) {
|
|
83
|
+
window.__reportingObserverReports = [];
|
|
84
|
+
}
|
|
85
|
+
const observerOptions = {
|
|
86
|
+
buffered: opts.buffered ?? true,
|
|
87
|
+
};
|
|
88
|
+
if (opts.types && opts.types.length > 0) {
|
|
89
|
+
observerOptions.types = opts.types;
|
|
90
|
+
}
|
|
91
|
+
const observer = new ReportingObserver((reports) => {
|
|
92
|
+
reports.forEach((report) => {
|
|
93
|
+
const enriched = {
|
|
94
|
+
...report,
|
|
95
|
+
id: `${report.type}-${report.url}-${Date.now()}`,
|
|
96
|
+
timestamp: Date.now(),
|
|
97
|
+
};
|
|
98
|
+
window.__reportingObserverReports.push(enriched);
|
|
99
|
+
});
|
|
100
|
+
}, observerOptions);
|
|
101
|
+
observer.observe();
|
|
102
|
+
window.__reportingObserver = observer;
|
|
103
|
+
}, {
|
|
104
|
+
buffered: options?.buffered,
|
|
105
|
+
types: options?.types,
|
|
106
|
+
});
|
|
107
|
+
this.observerInstalled = true;
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Get all collected reports
|
|
112
|
+
*/
|
|
113
|
+
async getReports() {
|
|
114
|
+
if (!this.observerInstalled) {
|
|
115
|
+
await this.installObserver();
|
|
116
|
+
}
|
|
117
|
+
const pageReports = await this.page.evaluate(() => {
|
|
118
|
+
return window.__reportingObserverReports || [];
|
|
119
|
+
});
|
|
120
|
+
// Combine with local reports
|
|
121
|
+
return [...pageReports, ...this.reports];
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Get reports by type
|
|
125
|
+
*/
|
|
126
|
+
async getReportsByType(type) {
|
|
127
|
+
const allReports = await this.getReports();
|
|
128
|
+
return allReports.filter(r => r.type === type);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Get CSP violation reports
|
|
132
|
+
*/
|
|
133
|
+
async getCSPViolations() {
|
|
134
|
+
return await this.getReportsByType('csp-violation');
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Get permissions policy violation reports
|
|
138
|
+
*/
|
|
139
|
+
async getPermissionsPolicyViolations() {
|
|
140
|
+
return await this.getReportsByType('permissions-policy-violation');
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Get intervention reports
|
|
144
|
+
*/
|
|
145
|
+
async getInterventions() {
|
|
146
|
+
return await this.getReportsByType('intervention');
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Get deprecation reports
|
|
150
|
+
*/
|
|
151
|
+
async getDeprecations() {
|
|
152
|
+
return await this.getReportsByType('deprecation');
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Generate reporting summary
|
|
156
|
+
*/
|
|
157
|
+
async getSummary() {
|
|
158
|
+
const allReports = await this.getReports();
|
|
159
|
+
// Count by type
|
|
160
|
+
const reportsByType = {
|
|
161
|
+
'csp-violation': 0,
|
|
162
|
+
'permissions-policy-violation': 0,
|
|
163
|
+
'intervention': 0,
|
|
164
|
+
'deprecation': 0,
|
|
165
|
+
'network-error': 0,
|
|
166
|
+
'crash': 0,
|
|
167
|
+
};
|
|
168
|
+
for (const report of allReports) {
|
|
169
|
+
reportsByType[report.type]++;
|
|
170
|
+
}
|
|
171
|
+
// Get typed reports
|
|
172
|
+
const cspViolations = await this.getCSPViolations();
|
|
173
|
+
const permissionsViolations = await this.getPermissionsPolicyViolations();
|
|
174
|
+
const interventions = await this.getInterventions();
|
|
175
|
+
const deprecations = await this.getDeprecations();
|
|
176
|
+
// Find common issues
|
|
177
|
+
const commonIssues = [];
|
|
178
|
+
// CSP violations summary
|
|
179
|
+
const cspByDirective = new Map();
|
|
180
|
+
for (const violation of cspViolations) {
|
|
181
|
+
const dir = violation.body.directive || 'unknown';
|
|
182
|
+
cspByDirective.set(dir, (cspByDirective.get(dir) || 0) + 1);
|
|
183
|
+
}
|
|
184
|
+
for (const [directive, count] of cspByDirective) {
|
|
185
|
+
commonIssues.push({
|
|
186
|
+
type: 'CSP',
|
|
187
|
+
count,
|
|
188
|
+
description: `"${directive}" directive violations`,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
// Deprecations summary
|
|
192
|
+
for (const dep of deprecations) {
|
|
193
|
+
commonIssues.push({
|
|
194
|
+
type: 'Deprecation',
|
|
195
|
+
count: 1,
|
|
196
|
+
description: dep.body.id || dep.body.message || 'Deprecated API used',
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
// Sort by count
|
|
200
|
+
commonIssues.sort((a, b) => b.count - a.count);
|
|
201
|
+
return {
|
|
202
|
+
totalReports: allReports.length,
|
|
203
|
+
reportsByType,
|
|
204
|
+
cspViolations,
|
|
205
|
+
permissionsViolations,
|
|
206
|
+
interventions,
|
|
207
|
+
deprecations,
|
|
208
|
+
commonIssues: commonIssues.slice(0, 10),
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Clear all collected reports
|
|
213
|
+
*/
|
|
214
|
+
async clearReports() {
|
|
215
|
+
this.reports = [];
|
|
216
|
+
await this.page.evaluate(() => {
|
|
217
|
+
if (window.__reportingObserverReports) {
|
|
218
|
+
window.__reportingObserverReports = [];
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Wait for new reports
|
|
224
|
+
*/
|
|
225
|
+
async waitForNewReports(timeout = 5000) {
|
|
226
|
+
const startTime = Date.now();
|
|
227
|
+
const initialReports = await this.getReports();
|
|
228
|
+
while (Date.now() - startTime < timeout) {
|
|
229
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
230
|
+
const currentReports = await this.getReports();
|
|
231
|
+
if (currentReports.length > initialReports.length) {
|
|
232
|
+
return currentReports.slice(initialReports.length);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return [];
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Generate mock report (for testing)
|
|
239
|
+
*/
|
|
240
|
+
async generateMockReport(type, body) {
|
|
241
|
+
const report = {
|
|
242
|
+
type,
|
|
243
|
+
url: this.page.url(),
|
|
244
|
+
body,
|
|
245
|
+
timestamp: Date.now(),
|
|
246
|
+
id: `mock-${type}-${Date.now()}`,
|
|
247
|
+
};
|
|
248
|
+
this.reports.push(report);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Analyze CSP violations for patterns
|
|
252
|
+
*/
|
|
253
|
+
async analyzeCSPViolations() {
|
|
254
|
+
const violations = await this.getCSPViolations();
|
|
255
|
+
const byDirective = {};
|
|
256
|
+
const byBlockedURL = {};
|
|
257
|
+
const recommendations = [];
|
|
258
|
+
for (const violation of violations) {
|
|
259
|
+
const dir = violation.body.directive || 'unknown';
|
|
260
|
+
byDirective[dir] = (byDirective[dir] || 0) + 1;
|
|
261
|
+
const url = violation.body.blockedURL || 'unknown';
|
|
262
|
+
// Group by domain
|
|
263
|
+
try {
|
|
264
|
+
const domain = new URL(url).hostname;
|
|
265
|
+
byBlockedURL[domain] = (byBlockedURL[domain] || 0) + 1;
|
|
266
|
+
}
|
|
267
|
+
catch {
|
|
268
|
+
byBlockedURL[url] = (byBlockedURL[url] || 0) + 1;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
// Generate recommendations
|
|
272
|
+
if (byDirective['script-src'] > 5) {
|
|
273
|
+
recommendations.push('Review script-src directive: many violations detected');
|
|
274
|
+
}
|
|
275
|
+
if (byDirective['style-src'] > 5) {
|
|
276
|
+
recommendations.push('Review style-src directive: consider allowing unsafe-inline or using nonces');
|
|
277
|
+
}
|
|
278
|
+
if (byDirective['img-src'] > 10) {
|
|
279
|
+
recommendations.push('Review img-src directive: many image violations');
|
|
280
|
+
}
|
|
281
|
+
return {
|
|
282
|
+
total: violations.length,
|
|
283
|
+
byDirective,
|
|
284
|
+
byBlockedURL: Object.fromEntries(Object.entries(byBlockedURL)
|
|
285
|
+
.sort(([, a], [, b]) => b - a)
|
|
286
|
+
.slice(0, 10)),
|
|
287
|
+
recommendations,
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Check for critical issues
|
|
292
|
+
*/
|
|
293
|
+
async checkCriticalIssues() {
|
|
294
|
+
const summary = await this.getSummary();
|
|
295
|
+
const issues = [];
|
|
296
|
+
// Check for CSP violations
|
|
297
|
+
if (summary.reportsByType['csp-violation'] > 0) {
|
|
298
|
+
issues.push(`CSP violations detected: ${summary.reportsByType['csp-violation']}`);
|
|
299
|
+
}
|
|
300
|
+
// Check for deprecations
|
|
301
|
+
if (summary.reportsByType['deprecation'] > 0) {
|
|
302
|
+
issues.push(`Deprecated APIs in use: ${summary.reportsByType['deprecation']}`);
|
|
303
|
+
}
|
|
304
|
+
// Check for interventions
|
|
305
|
+
if (summary.reportsByType['intervention'] > 0) {
|
|
306
|
+
issues.push(`Browser interventions: ${summary.reportsByType['intervention']}`);
|
|
307
|
+
}
|
|
308
|
+
return {
|
|
309
|
+
hasCriticalIssues: issues.length > 0,
|
|
310
|
+
issues,
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Export reports as JSON
|
|
315
|
+
*/
|
|
316
|
+
async exportReports() {
|
|
317
|
+
const summary = await this.getSummary();
|
|
318
|
+
return JSON.stringify(summary, null, 2);
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Get Reporting API documentation
|
|
322
|
+
*/
|
|
323
|
+
getDocumentation() {
|
|
324
|
+
return {
|
|
325
|
+
overview: 'The Reporting API provides a generic mechanism for web applications to report various browser warnings and errors to server endpoints',
|
|
326
|
+
url: 'https://developer.mozilla.org/en-US/docs/Web/API/Reporting_API',
|
|
327
|
+
reportTypes: {
|
|
328
|
+
'csp-violation': 'Content Security Policy violations',
|
|
329
|
+
'permissions-policy-violation': 'Permissions Policy violations',
|
|
330
|
+
'intervention': 'Browser interventions (ad filtering, etc.)',
|
|
331
|
+
'deprecation': 'Use of deprecated features',
|
|
332
|
+
'network-error': 'Network errors (resource loading failures)',
|
|
333
|
+
'crash': 'Browser/tab crashes',
|
|
334
|
+
},
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Factory function to create Reporting API Handler
|
|
340
|
+
*/
|
|
341
|
+
export function createReportingAPIHandler(page) {
|
|
342
|
+
return new ReportingAPIHandler(page);
|
|
343
|
+
}
|
|
344
|
+
export default ReportingAPIHandler;
|
|
@@ -2,8 +2,17 @@
|
|
|
2
2
|
* QA360 Selector Generator
|
|
3
3
|
*
|
|
4
4
|
* Generates stable, resilient CSS selectors for web elements
|
|
5
|
+
*
|
|
6
|
+
* NOW WITH INTELLIGENT PROFILE-AWARE GENERATION!
|
|
7
|
+
* The selector generation adapts to the detected site profile:
|
|
8
|
+
* - PROFIL_MODERN: data-testid first (React apps, SaaS)
|
|
9
|
+
* - PROFIL_ACCESSIBLE: ARIA role first (banks, government)
|
|
10
|
+
* - PROFIL_LEGACY: Semantic ID first (ASP.NET, PHP legacy)
|
|
11
|
+
* - PROFIL_MINIMAL: Text content first (landing pages)
|
|
5
12
|
*/
|
|
6
13
|
import type { ElementInfo } from './types.js';
|
|
14
|
+
export { SiteProfiler, analyzeSite, determineSiteProfile, type SiteAnalysis, type SiteProfile, type Framework, type CssFramework, } from './site-profiler.js';
|
|
15
|
+
export { IntelligentSelectorGenerator, generateSelector as generateIntelligentSelector, generateSelectorWithMetadata, initializeSelectorGenerator, getSiteProfile, getSelectorStrategy, SELECTOR_STRATEGIES, isGeneratedId, isSemanticId, isUtilityClass, type SelectorResult, type SelectorTier, type ElementInfo as IntelligentElementInfo, } from './intelligent-selector-generator.js';
|
|
7
16
|
/**
|
|
8
17
|
* Generate optimal selector for an element
|
|
9
18
|
*/
|