@detiq/crawler 0.1.3
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/Dockerfile +49 -0
- package/README.md +11 -0
- package/dist/accessibility-auditor.d.ts +29 -0
- package/dist/accessibility-auditor.js +57 -0
- package/dist/accessibility-auditor.js.map +7 -0
- package/dist/ai-login.d.ts +32 -0
- package/dist/ai-login.js +177 -0
- package/dist/ai-login.js.map +7 -0
- package/dist/auth-token-rotator.d.ts +47 -0
- package/dist/auth-token-rotator.js +58 -0
- package/dist/auth-token-rotator.js.map +7 -0
- package/dist/auth.d.ts +20 -0
- package/dist/auth.js +329 -0
- package/dist/auth.js.map +7 -0
- package/dist/browser-extension.d.ts +37 -0
- package/dist/browser-extension.js +113 -0
- package/dist/browser-extension.js.map +7 -0
- package/dist/captcha-solver.d.ts +16 -0
- package/dist/captcha-solver.js +105 -0
- package/dist/captcha-solver.js.map +7 -0
- package/dist/color-contrast.d.ts +30 -0
- package/dist/color-contrast.js +78 -0
- package/dist/color-contrast.js.map +7 -0
- package/dist/content-chunker.d.ts +18 -0
- package/dist/content-chunker.js +152 -0
- package/dist/content-chunker.js.map +7 -0
- package/dist/content-dedup.d.ts +23 -0
- package/dist/content-dedup.js +60 -0
- package/dist/content-dedup.js.map +7 -0
- package/dist/cookie-consent.d.ts +25 -0
- package/dist/cookie-consent.js +78 -0
- package/dist/cookie-consent.js.map +7 -0
- package/dist/cookie-jar.d.ts +20 -0
- package/dist/cookie-jar.js +61 -0
- package/dist/cookie-jar.js.map +7 -0
- package/dist/crawler.d.ts +179 -0
- package/dist/crawler.js +3672 -0
- package/dist/crawler.js.map +7 -0
- package/dist/custom-js-injector.d.ts +42 -0
- package/dist/custom-js-injector.js +50 -0
- package/dist/custom-js-injector.js.map +7 -0
- package/dist/dark-mode-capture.d.ts +23 -0
- package/dist/dark-mode-capture.js +75 -0
- package/dist/dark-mode-capture.js.map +7 -0
- package/dist/dead-link-detector.d.ts +37 -0
- package/dist/dead-link-detector.js +50 -0
- package/dist/dead-link-detector.js.map +7 -0
- package/dist/element-hash.d.ts +9 -0
- package/dist/element-hash.js +9 -0
- package/dist/element-hash.js.map +7 -0
- package/dist/email-otp.d.ts +42 -0
- package/dist/email-otp.js +177 -0
- package/dist/email-otp.js.map +7 -0
- package/dist/engine-router.d.ts +47 -0
- package/dist/engine-router.js +94 -0
- package/dist/engine-router.js.map +7 -0
- package/dist/export/bulk-export.d.ts +26 -0
- package/dist/export/bulk-export.js +76 -0
- package/dist/export/bulk-export.js.map +7 -0
- package/dist/export/vector-export.d.ts +76 -0
- package/dist/export/vector-export.js +85 -0
- package/dist/export/vector-export.js.map +7 -0
- package/dist/extractors/advanced.d.ts +54 -0
- package/dist/extractors/advanced.js +245 -0
- package/dist/extractors/advanced.js.map +7 -0
- package/dist/extractors/artifact-envelope.d.ts +63 -0
- package/dist/extractors/artifact-envelope.js +63 -0
- package/dist/extractors/artifact-envelope.js.map +7 -0
- package/dist/failure-analysis-agent.d.ts +16 -0
- package/dist/failure-analysis-agent.js +40 -0
- package/dist/failure-analysis-agent.js.map +7 -0
- package/dist/feature-flag-detector.d.ts +30 -0
- package/dist/feature-flag-detector.js +55 -0
- package/dist/feature-flag-detector.js.map +7 -0
- package/dist/form-detector.d.ts +34 -0
- package/dist/form-detector.js +58 -0
- package/dist/form-detector.js.map +7 -0
- package/dist/frontier.d.ts +32 -0
- package/dist/frontier.js +83 -0
- package/dist/frontier.js.map +7 -0
- package/dist/gap-pass.d.ts +35 -0
- package/dist/gap-pass.js +81 -0
- package/dist/gap-pass.js.map +7 -0
- package/dist/graphql-detector.d.ts +39 -0
- package/dist/graphql-detector.js +86 -0
- package/dist/graphql-detector.js.map +7 -0
- package/dist/http-engine.d.ts +80 -0
- package/dist/http-engine.js +304 -0
- package/dist/http-engine.js.map +7 -0
- package/dist/incremental-diff.d.ts +59 -0
- package/dist/incremental-diff.js +61 -0
- package/dist/incremental-diff.js.map +7 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +61 -0
- package/dist/index.js.map +7 -0
- package/dist/input-fuzzer.d.ts +30 -0
- package/dist/input-fuzzer.js +105 -0
- package/dist/input-fuzzer.js.map +7 -0
- package/dist/interactive-probe.d.ts +104 -0
- package/dist/interactive-probe.js +442 -0
- package/dist/interactive-probe.js.map +7 -0
- package/dist/job-queue.d.ts +171 -0
- package/dist/job-queue.js +2256 -0
- package/dist/job-queue.js.map +7 -0
- package/dist/js-coverage.d.ts +29 -0
- package/dist/js-coverage.js +56 -0
- package/dist/js-coverage.js.map +7 -0
- package/dist/js-router-detector.d.ts +17 -0
- package/dist/js-router-detector.js +90 -0
- package/dist/js-router-detector.js.map +7 -0
- package/dist/language-detector.d.ts +22 -0
- package/dist/language-detector.js +57 -0
- package/dist/language-detector.js.map +7 -0
- package/dist/link-classifier.d.ts +23 -0
- package/dist/link-classifier.js +40 -0
- package/dist/link-classifier.js.map +7 -0
- package/dist/live-view.d.ts +36 -0
- package/dist/live-view.js +100 -0
- package/dist/live-view.js.map +7 -0
- package/dist/logger.d.ts +2 -0
- package/dist/logger.js +10 -0
- package/dist/logger.js.map +7 -0
- package/dist/markdown-extract.d.ts +8 -0
- package/dist/markdown-extract.js +54 -0
- package/dist/markdown-extract.js.map +7 -0
- package/dist/native-crawler.d.ts +69 -0
- package/dist/native-crawler.js +839 -0
- package/dist/native-crawler.js.map +7 -0
- package/dist/network-observer.d.ts +49 -0
- package/dist/network-observer.js +149 -0
- package/dist/network-observer.js.map +7 -0
- package/dist/network-throttle.d.ts +25 -0
- package/dist/network-throttle.js +34 -0
- package/dist/network-throttle.js.map +7 -0
- package/dist/openapi-generator.d.ts +49 -0
- package/dist/openapi-generator.js +89 -0
- package/dist/openapi-generator.js.map +7 -0
- package/dist/pdf-extractor.d.ts +28 -0
- package/dist/pdf-extractor.js +81 -0
- package/dist/pdf-extractor.js.map +7 -0
- package/dist/performance-metrics.d.ts +53 -0
- package/dist/performance-metrics.js +83 -0
- package/dist/performance-metrics.js.map +7 -0
- package/dist/phash.d.ts +38 -0
- package/dist/phash.js +115 -0
- package/dist/phash.js.map +7 -0
- package/dist/pii-scrubber.d.ts +21 -0
- package/dist/pii-scrubber.js +75 -0
- package/dist/pii-scrubber.js.map +7 -0
- package/dist/playwright-recorder.d.ts +39 -0
- package/dist/playwright-recorder.js +123 -0
- package/dist/playwright-recorder.js.map +7 -0
- package/dist/policies/crawl-safety.d.ts +9 -0
- package/dist/policies/crawl-safety.js +37 -0
- package/dist/policies/crawl-safety.js.map +7 -0
- package/dist/profiles/domain-profile.d.ts +19 -0
- package/dist/profiles/domain-profile.js +140 -0
- package/dist/profiles/domain-profile.js.map +7 -0
- package/dist/proxy.d.ts +50 -0
- package/dist/proxy.js +165 -0
- package/dist/proxy.js.map +7 -0
- package/dist/rate-limiter.d.ts +31 -0
- package/dist/rate-limiter.js +64 -0
- package/dist/rate-limiter.js.map +7 -0
- package/dist/redirect-tracker.d.ts +37 -0
- package/dist/redirect-tracker.js +65 -0
- package/dist/redirect-tracker.js.map +7 -0
- package/dist/redis-frontier.d.ts +48 -0
- package/dist/redis-frontier.js +126 -0
- package/dist/redis-frontier.js.map +7 -0
- package/dist/redis-queue.d.ts +48 -0
- package/dist/redis-queue.js +165 -0
- package/dist/redis-queue.js.map +7 -0
- package/dist/response-cache.d.ts +38 -0
- package/dist/response-cache.js +140 -0
- package/dist/response-cache.js.map +7 -0
- package/dist/responsive-detector.d.ts +29 -0
- package/dist/responsive-detector.js +46 -0
- package/dist/responsive-detector.js.map +7 -0
- package/dist/retry-policy.d.ts +20 -0
- package/dist/retry-policy.js +54 -0
- package/dist/retry-policy.js.map +7 -0
- package/dist/robots-txt.d.ts +9 -0
- package/dist/robots-txt.js +77 -0
- package/dist/robots-txt.js.map +7 -0
- package/dist/screen-reader.d.ts +16 -0
- package/dist/screen-reader.js +46 -0
- package/dist/screen-reader.js.map +7 -0
- package/dist/screenshot-masker.d.ts +28 -0
- package/dist/screenshot-masker.js +62 -0
- package/dist/screenshot-masker.js.map +7 -0
- package/dist/seo-checker.d.ts +33 -0
- package/dist/seo-checker.js +91 -0
- package/dist/seo-checker.js.map +7 -0
- package/dist/session-capture.d.ts +35 -0
- package/dist/session-capture.js +267 -0
- package/dist/session-capture.js.map +7 -0
- package/dist/session-export.d.ts +49 -0
- package/dist/session-export.js +117 -0
- package/dist/session-export.js.map +7 -0
- package/dist/sitemap-writer.d.ts +21 -0
- package/dist/sitemap-writer.js +47 -0
- package/dist/sitemap-writer.js.map +7 -0
- package/dist/sitemap.d.ts +51 -0
- package/dist/sitemap.js +152 -0
- package/dist/sitemap.js.map +7 -0
- package/dist/skyvern.d.ts +56 -0
- package/dist/skyvern.js +129 -0
- package/dist/skyvern.js.map +7 -0
- package/dist/sqs-queue.d.ts +2 -0
- package/dist/sqs-queue.js +47 -0
- package/dist/sqs-queue.js.map +7 -0
- package/dist/sso-token.d.ts +29 -0
- package/dist/sso-token.js +76 -0
- package/dist/sso-token.js.map +7 -0
- package/dist/stealth/human-behavior.d.ts +20 -0
- package/dist/stealth/human-behavior.js +168 -0
- package/dist/stealth/human-behavior.js.map +7 -0
- package/dist/telemetry.d.ts +34 -0
- package/dist/telemetry.js +77 -0
- package/dist/telemetry.js.map +7 -0
- package/dist/test-executor.d.ts +67 -0
- package/dist/test-executor.js +311 -0
- package/dist/test-executor.js.map +7 -0
- package/dist/tls-fingerprint.d.ts +50 -0
- package/dist/tls-fingerprint.js +81 -0
- package/dist/tls-fingerprint.js.map +7 -0
- package/dist/url-pattern-completer.d.ts +28 -0
- package/dist/url-pattern-completer.js +87 -0
- package/dist/url-pattern-completer.js.map +7 -0
- package/dist/visual-diff-verdict.d.ts +40 -0
- package/dist/visual-diff-verdict.js +25 -0
- package/dist/visual-diff-verdict.js.map +7 -0
- package/dist/webhook-notifier.d.ts +30 -0
- package/dist/webhook-notifier.js +76 -0
- package/dist/webhook-notifier.js.map +7 -0
- package/dist/websocket-detector.d.ts +24 -0
- package/dist/websocket-detector.js +60 -0
- package/dist/websocket-detector.js.map +7 -0
- package/dist/worker.d.ts +1 -0
- package/dist/worker.js +33 -0
- package/dist/worker.js.map +7 -0
- package/package.json +45 -0
- package/src/accessibility-auditor.ts +102 -0
- package/src/ai-login.ts +218 -0
- package/src/auth-token-rotator.ts +89 -0
- package/src/auth.ts +396 -0
- package/src/browser-extension.ts +186 -0
- package/src/captcha-solver.ts +143 -0
- package/src/color-contrast.ts +116 -0
- package/src/content-chunker.ts +170 -0
- package/src/content-dedup.ts +99 -0
- package/src/cookie-consent.ts +106 -0
- package/src/cookie-jar.ts +91 -0
- package/src/crawler.ts +4305 -0
- package/src/custom-js-injector.ts +93 -0
- package/src/dark-mode-capture.ts +110 -0
- package/src/dead-link-detector.ts +76 -0
- package/src/element-hash.ts +16 -0
- package/src/email-otp.ts +252 -0
- package/src/engine-router.ts +141 -0
- package/src/export/bulk-export.ts +85 -0
- package/src/export/vector-export.ts +160 -0
- package/src/extractors/advanced.ts +283 -0
- package/src/extractors/artifact-envelope.ts +111 -0
- package/src/failure-analysis-agent.ts +49 -0
- package/src/feature-flag-detector.ts +97 -0
- package/src/form-detector.ts +103 -0
- package/src/frontier.test.ts +64 -0
- package/src/frontier.ts +112 -0
- package/src/gap-pass.ts +122 -0
- package/src/graphql-detector.ts +129 -0
- package/src/http-engine.ts +433 -0
- package/src/incremental-diff.ts +121 -0
- package/src/index.ts +35 -0
- package/src/input-fuzzer.ts +129 -0
- package/src/interactive-probe.ts +623 -0
- package/src/job-queue.test.ts +120 -0
- package/src/job-queue.ts +2701 -0
- package/src/js-coverage.ts +87 -0
- package/src/js-router-detector.ts +112 -0
- package/src/language-detector.ts +82 -0
- package/src/link-classifier.ts +65 -0
- package/src/live-view.ts +141 -0
- package/src/logger.ts +9 -0
- package/src/markdown-extract.test.ts +73 -0
- package/src/markdown-extract.ts +76 -0
- package/src/native-crawler.ts +1106 -0
- package/src/network-observer.ts +204 -0
- package/src/network-throttle.ts +69 -0
- package/src/openapi-generator.ts +135 -0
- package/src/pdf-extractor.ts +123 -0
- package/src/performance-metrics.ts +134 -0
- package/src/phash.ts +151 -0
- package/src/pii-scrubber.ts +99 -0
- package/src/playwright-recorder.ts +170 -0
- package/src/policies/crawl-safety.ts +46 -0
- package/src/profiles/domain-profile.ts +167 -0
- package/src/proxy.ts +238 -0
- package/src/rate-limiter.ts +87 -0
- package/src/redirect-tracker.ts +97 -0
- package/src/redis-frontier.ts +143 -0
- package/src/redis-queue.ts +208 -0
- package/src/response-cache.ts +150 -0
- package/src/responsive-detector.ts +92 -0
- package/src/retry-policy.ts +87 -0
- package/src/robots-txt.ts +96 -0
- package/src/screen-reader.ts +89 -0
- package/src/screenshot-masker.ts +98 -0
- package/src/seo-checker.ts +134 -0
- package/src/session-capture.ts +325 -0
- package/src/session-export.test.ts +75 -0
- package/src/session-export.ts +172 -0
- package/src/sitemap-writer.ts +65 -0
- package/src/sitemap.test.ts +131 -0
- package/src/sitemap.ts +224 -0
- package/src/skyvern.ts +199 -0
- package/src/sqs-queue.ts +49 -0
- package/src/sso-token.ts +120 -0
- package/src/stealth/human-behavior.ts +191 -0
- package/src/telemetry.ts +122 -0
- package/src/test-executor.test.ts +72 -0
- package/src/test-executor.ts +424 -0
- package/src/tls-fingerprint.ts +111 -0
- package/src/url-pattern-completer.ts +114 -0
- package/src/visual-diff-verdict.test.ts +80 -0
- package/src/visual-diff-verdict.ts +57 -0
- package/src/webhook-notifier.ts +109 -0
- package/src/websocket-detector.ts +83 -0
- package/src/worker.ts +48 -0
- package/tsconfig.json +13 -0
- package/types/accessibility-auditor.d.ts +29 -0
- package/types/ai-login.d.ts +32 -0
- package/types/auth-token-rotator.d.ts +47 -0
- package/types/auth.d.ts +20 -0
- package/types/browser-extension.d.ts +37 -0
- package/types/bull-worker.d.ts +6 -0
- package/types/captcha-solver.d.ts +16 -0
- package/types/color-contrast.d.ts +30 -0
- package/types/content-chunker.d.ts +18 -0
- package/types/content-dedup.d.ts +23 -0
- package/types/cookie-consent.d.ts +25 -0
- package/types/cookie-jar.d.ts +20 -0
- package/types/crawler.d.ts +179 -0
- package/types/custom-js-injector.d.ts +42 -0
- package/types/dark-mode-capture.d.ts +23 -0
- package/types/dead-link-detector.d.ts +37 -0
- package/types/element-hash.d.ts +9 -0
- package/types/email-otp.d.ts +42 -0
- package/types/engine-router.d.ts +47 -0
- package/types/export/bulk-export.d.ts +26 -0
- package/types/export/vector-export.d.ts +76 -0
- package/types/extractors/advanced.d.ts +54 -0
- package/types/extractors/artifact-envelope.d.ts +63 -0
- package/types/failure-analysis-agent.d.ts +16 -0
- package/types/feature-flag-detector.d.ts +30 -0
- package/types/form-detector.d.ts +34 -0
- package/types/frontier.d.ts +32 -0
- package/types/gap-pass.d.ts +35 -0
- package/types/graphql-detector.d.ts +39 -0
- package/types/http-engine.d.ts +80 -0
- package/types/incremental-diff.d.ts +59 -0
- package/types/index.d.ts +35 -0
- package/types/input-fuzzer.d.ts +30 -0
- package/types/interactive-probe.d.ts +104 -0
- package/types/job-queue.d.ts +171 -0
- package/types/js-coverage.d.ts +29 -0
- package/types/js-router-detector.d.ts +17 -0
- package/types/language-detector.d.ts +22 -0
- package/types/link-classifier.d.ts +23 -0
- package/types/live-view.d.ts +36 -0
- package/types/logger.d.ts +2 -0
- package/types/markdown-extract.d.ts +8 -0
- package/types/native-crawler.d.ts +69 -0
- package/types/network-observer.d.ts +49 -0
- package/types/network-throttle.d.ts +25 -0
- package/types/openapi-generator.d.ts +49 -0
- package/types/pdf-extractor.d.ts +28 -0
- package/types/performance-metrics.d.ts +53 -0
- package/types/phash.d.ts +38 -0
- package/types/pii-scrubber.d.ts +21 -0
- package/types/playwright-recorder.d.ts +39 -0
- package/types/policies/crawl-safety.d.ts +9 -0
- package/types/profiles/domain-profile.d.ts +19 -0
- package/types/proxy.d.ts +50 -0
- package/types/rate-limiter.d.ts +31 -0
- package/types/redirect-tracker.d.ts +37 -0
- package/types/redis-frontier.d.ts +48 -0
- package/types/redis-queue.d.ts +48 -0
- package/types/response-cache.d.ts +38 -0
- package/types/responsive-detector.d.ts +29 -0
- package/types/retry-policy.d.ts +20 -0
- package/types/robots-txt.d.ts +9 -0
- package/types/screen-reader.d.ts +16 -0
- package/types/screenshot-masker.d.ts +28 -0
- package/types/seo-checker.d.ts +33 -0
- package/types/session-capture.d.ts +38 -0
- package/types/session-export.d.ts +49 -0
- package/types/sitemap-writer.d.ts +21 -0
- package/types/sitemap.d.ts +51 -0
- package/types/skyvern.d.ts +56 -0
- package/types/sqs-queue.d.ts +2 -0
- package/types/sso-token.d.ts +29 -0
- package/types/stealth/human-behavior.d.ts +20 -0
- package/types/telemetry.d.ts +34 -0
- package/types/test-executor.d.ts +67 -0
- package/types/tls-fingerprint.d.ts +50 -0
- package/types/url-pattern-completer.d.ts +28 -0
- package/types/visual-diff-verdict.d.ts +40 -0
- package/types/webhook-notifier.d.ts +30 -0
- package/types/websocket-detector.d.ts +24 -0
- package/types/worker.d.ts +1 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
const LOREM = "Lorem ipsum dolor sit amet consectetur adipiscing elit";
|
|
2
|
+
function generateEmailCases() {
|
|
3
|
+
return [
|
|
4
|
+
{ label: "valid email", value: "test@example.com", expectedValid: true, category: "happy" },
|
|
5
|
+
{ label: "email with plus", value: "test+tag@example.com", expectedValid: true, category: "happy" },
|
|
6
|
+
{ label: "missing @", value: "notanemail.com", expectedValid: false, category: "invalid" },
|
|
7
|
+
{ label: "missing domain", value: "test@", expectedValid: false, category: "invalid" },
|
|
8
|
+
{ label: "empty", value: "", expectedValid: false, category: "edge" },
|
|
9
|
+
{ label: "very long email", value: "a".repeat(100) + "@example.com", expectedValid: false, category: "boundary" },
|
|
10
|
+
{ label: "special chars", value: "test<script>@example.com", expectedValid: false, category: "edge" }
|
|
11
|
+
];
|
|
12
|
+
}
|
|
13
|
+
function generatePasswordCases(minLength, maxLength) {
|
|
14
|
+
const min = minLength ?? 8;
|
|
15
|
+
const max = maxLength ?? 128;
|
|
16
|
+
return [
|
|
17
|
+
{ label: "valid password", value: "ValidP@ss1", expectedValid: true, category: "happy" },
|
|
18
|
+
{ label: "minimum length", value: "A".repeat(min), expectedValid: true, category: "boundary" },
|
|
19
|
+
{ label: "below minimum", value: "A".repeat(Math.max(1, min - 1)), expectedValid: false, category: "boundary" },
|
|
20
|
+
{ label: "max length", value: "Aa1!".repeat(Math.ceil(max / 4)).slice(0, max), expectedValid: true, category: "boundary" },
|
|
21
|
+
{ label: "empty", value: "", expectedValid: false, category: "edge" },
|
|
22
|
+
{ label: "spaces only", value: " ", expectedValid: false, category: "edge" }
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
function generateTextCases(minLength, maxLength, required) {
|
|
26
|
+
const cases = [
|
|
27
|
+
{ label: "typical text", value: "Test Input Value", expectedValid: true, category: "happy" },
|
|
28
|
+
{ label: "single char", value: "A", expectedValid: !minLength || minLength <= 1, category: "boundary" },
|
|
29
|
+
{ label: "empty", value: "", expectedValid: !required, category: "edge" },
|
|
30
|
+
{ label: "spaces only", value: " ", expectedValid: !required, category: "edge" },
|
|
31
|
+
{ label: "very long text", value: LOREM.repeat(20), expectedValid: !maxLength || maxLength > LOREM.length * 20, category: "boundary" },
|
|
32
|
+
{ label: "unicode", value: "\u65E5\u672C\u8A9E\u30C6\u30B9\u30C8 \xDCn\xEFc\xF6d\xE9 Emojitest \u{1F389}", expectedValid: true, category: "edge" },
|
|
33
|
+
{ label: "HTML special chars", value: "<script>alert(1)</script>", expectedValid: true, category: "edge" },
|
|
34
|
+
{ label: "SQL probe", value: "' OR '1'='1", expectedValid: true, category: "edge" }
|
|
35
|
+
];
|
|
36
|
+
if (minLength) cases.push({ label: `below min (${minLength})`, value: "x".repeat(Math.max(0, minLength - 1)), expectedValid: false, category: "boundary" });
|
|
37
|
+
if (maxLength) cases.push({ label: `above max (${maxLength})`, value: "x".repeat(maxLength + 1), expectedValid: false, category: "boundary" });
|
|
38
|
+
return cases;
|
|
39
|
+
}
|
|
40
|
+
function generateNumberCases(min, max) {
|
|
41
|
+
const minN = min !== void 0 ? parseFloat(min) : void 0;
|
|
42
|
+
const maxN = max !== void 0 ? parseFloat(max) : void 0;
|
|
43
|
+
return [
|
|
44
|
+
{ label: "valid number", value: "42", expectedValid: true, category: "happy" },
|
|
45
|
+
{ label: "zero", value: "0", expectedValid: minN === void 0 || minN <= 0, category: "boundary" },
|
|
46
|
+
{ label: "negative", value: "-1", expectedValid: minN === void 0 || minN < 0, category: "boundary" },
|
|
47
|
+
{ label: "decimal", value: "3.14", expectedValid: true, category: "happy" },
|
|
48
|
+
{ label: "text as number", value: "notanumber", expectedValid: false, category: "invalid" },
|
|
49
|
+
{ label: "empty", value: "", expectedValid: false, category: "edge" },
|
|
50
|
+
...minN !== void 0 ? [{ label: `below min (${min})`, value: String(minN - 1), expectedValid: false, category: "boundary" }] : [],
|
|
51
|
+
...maxN !== void 0 ? [{ label: `above max (${max})`, value: String(maxN + 1), expectedValid: false, category: "boundary" }] : []
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
function generateSelectCases(options) {
|
|
55
|
+
if (!options?.length) return [{ label: "first option", value: "", expectedValid: true, category: "happy" }];
|
|
56
|
+
return [
|
|
57
|
+
{ label: `first option (${options[0]})`, value: options[0], expectedValid: true, category: "happy" },
|
|
58
|
+
{ label: "invalid option", value: "__INVALID_OPTION__", expectedValid: false, category: "invalid" },
|
|
59
|
+
{ label: "empty selection", value: "", expectedValid: false, category: "edge" },
|
|
60
|
+
...options.length > 1 ? [{ label: `last option (${options[options.length - 1]})`, value: options[options.length - 1], expectedValid: true, category: "happy" }] : []
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
function generateFieldCases(field) {
|
|
64
|
+
switch (field.type) {
|
|
65
|
+
case "email":
|
|
66
|
+
return generateEmailCases();
|
|
67
|
+
case "password":
|
|
68
|
+
return generatePasswordCases(field.minLength, field.maxLength);
|
|
69
|
+
case "number":
|
|
70
|
+
return generateNumberCases(field.min, field.max);
|
|
71
|
+
case "select":
|
|
72
|
+
return generateSelectCases(field.options);
|
|
73
|
+
case "checkbox":
|
|
74
|
+
return [
|
|
75
|
+
{ label: "checked", value: "true", expectedValid: true, category: "happy" },
|
|
76
|
+
{ label: "unchecked", value: "false", expectedValid: !field.required, category: field.required ? "invalid" : "happy" }
|
|
77
|
+
];
|
|
78
|
+
case "date":
|
|
79
|
+
return [
|
|
80
|
+
{ label: "valid date", value: "2026-01-15", expectedValid: true, category: "happy" },
|
|
81
|
+
{ label: "invalid date", value: "9999-99-99", expectedValid: false, category: "invalid" },
|
|
82
|
+
{ label: "empty", value: "", expectedValid: !field.required, category: "edge" }
|
|
83
|
+
];
|
|
84
|
+
case "url":
|
|
85
|
+
return [
|
|
86
|
+
{ label: "valid URL", value: "https://example.com", expectedValid: true, category: "happy" },
|
|
87
|
+
{ label: "missing protocol", value: "example.com", expectedValid: false, category: "invalid" },
|
|
88
|
+
{ label: "empty", value: "", expectedValid: !field.required, category: "edge" }
|
|
89
|
+
];
|
|
90
|
+
default:
|
|
91
|
+
return generateTextCases(field.minLength, field.maxLength, field.required);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function fuzzForm(form) {
|
|
95
|
+
return {
|
|
96
|
+
formIndex: form.index,
|
|
97
|
+
purpose: form.purpose,
|
|
98
|
+
fieldCases: form.fields.map((field) => ({ field, cases: generateFieldCases(field) }))
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
fuzzForm,
|
|
103
|
+
generateFieldCases
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=input-fuzzer.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/input-fuzzer.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Input fuzzer \u2014 generate test data for form fields.\n *\n * For each field type, produces a set of test values covering:\n * - Happy path (valid, normal input)\n * - Boundary (min/max length, min/max value)\n * - Edge cases (empty, very long, special chars, SQL injection probe, XSS probe)\n * - Type-invalid (wrong type for the field)\n *\n * This feeds ZeTa's test generator to automatically create form validation tests.\n * Values are safe probes (NOT actual exploits) \u2014 they test whether the app\n * properly rejects/accepts boundary inputs.\n */\n\nimport type { FormField } from './form-detector.js';\n\nexport type InputCase = {\n label: string; // human-readable test case name\n value: string;\n expectedValid: boolean; // true if input should be accepted\n category: 'happy' | 'boundary' | 'edge' | 'invalid';\n};\n\nconst LOREM = 'Lorem ipsum dolor sit amet consectetur adipiscing elit';\n\nfunction generateEmailCases(): InputCase[] {\n return [\n { label: 'valid email', value: 'test@example.com', expectedValid: true, category: 'happy' },\n { label: 'email with plus', value: 'test+tag@example.com', expectedValid: true, category: 'happy' },\n { label: 'missing @', value: 'notanemail.com', expectedValid: false, category: 'invalid' },\n { label: 'missing domain', value: 'test@', expectedValid: false, category: 'invalid' },\n { label: 'empty', value: '', expectedValid: false, category: 'edge' },\n { label: 'very long email', value: 'a'.repeat(100) + '@example.com', expectedValid: false, category: 'boundary' },\n { label: 'special chars', value: 'test<script>@example.com', expectedValid: false, category: 'edge' },\n ];\n}\n\nfunction generatePasswordCases(minLength?: number, maxLength?: number): InputCase[] {\n const min = minLength ?? 8;\n const max = maxLength ?? 128;\n return [\n { label: 'valid password', value: 'ValidP@ss1', expectedValid: true, category: 'happy' },\n { label: 'minimum length', value: 'A'.repeat(min), expectedValid: true, category: 'boundary' },\n { label: 'below minimum', value: 'A'.repeat(Math.max(1, min - 1)), expectedValid: false, category: 'boundary' },\n { label: 'max length', value: 'Aa1!'.repeat(Math.ceil(max / 4)).slice(0, max), expectedValid: true, category: 'boundary' },\n { label: 'empty', value: '', expectedValid: false, category: 'edge' },\n { label: 'spaces only', value: ' ', expectedValid: false, category: 'edge' },\n ];\n}\n\nfunction generateTextCases(minLength?: number, maxLength?: number, required?: boolean): InputCase[] {\n const cases: InputCase[] = [\n { label: 'typical text', value: 'Test Input Value', expectedValid: true, category: 'happy' },\n { label: 'single char', value: 'A', expectedValid: !minLength || minLength <= 1, category: 'boundary' },\n { label: 'empty', value: '', expectedValid: !required, category: 'edge' },\n { label: 'spaces only', value: ' ', expectedValid: !required, category: 'edge' },\n { label: 'very long text', value: LOREM.repeat(20), expectedValid: !maxLength || maxLength > LOREM.length * 20, category: 'boundary' },\n { label: 'unicode', value: '\u65E5\u672C\u8A9E\u30C6\u30B9\u30C8 \u00DCn\u00EFc\u00F6d\u00E9 Emojitest \uD83C\uDF89', expectedValid: true, category: 'edge' },\n { label: 'HTML special chars', value: '<script>alert(1)</script>', expectedValid: true, category: 'edge' },\n { label: 'SQL probe', value: \"' OR '1'='1\", expectedValid: true, category: 'edge' },\n ];\n if (minLength) cases.push({ label: `below min (${minLength})`, value: 'x'.repeat(Math.max(0, minLength - 1)), expectedValid: false, category: 'boundary' });\n if (maxLength) cases.push({ label: `above max (${maxLength})`, value: 'x'.repeat(maxLength + 1), expectedValid: false, category: 'boundary' });\n return cases;\n}\n\nfunction generateNumberCases(min?: string, max?: string): InputCase[] {\n const minN = min !== undefined ? parseFloat(min) : undefined;\n const maxN = max !== undefined ? parseFloat(max) : undefined;\n return [\n { label: 'valid number', value: '42', expectedValid: true, category: 'happy' },\n { label: 'zero', value: '0', expectedValid: minN === undefined || minN <= 0, category: 'boundary' },\n { label: 'negative', value: '-1', expectedValid: minN === undefined || minN < 0, category: 'boundary' },\n { label: 'decimal', value: '3.14', expectedValid: true, category: 'happy' },\n { label: 'text as number', value: 'notanumber', expectedValid: false, category: 'invalid' },\n { label: 'empty', value: '', expectedValid: false, category: 'edge' },\n ...(minN !== undefined ? [{ label: `below min (${min})`, value: String(minN - 1), expectedValid: false, category: 'boundary' as const }] : []),\n ...(maxN !== undefined ? [{ label: `above max (${max})`, value: String(maxN + 1), expectedValid: false, category: 'boundary' as const }] : []),\n ];\n}\n\nfunction generateSelectCases(options?: string[]): InputCase[] {\n if (!options?.length) return [{ label: 'first option', value: '', expectedValid: true, category: 'happy' }];\n return [\n { label: `first option (${options[0]})`, value: options[0], expectedValid: true, category: 'happy' },\n { label: 'invalid option', value: '__INVALID_OPTION__', expectedValid: false, category: 'invalid' },\n { label: 'empty selection', value: '', expectedValid: false, category: 'edge' },\n ...(options.length > 1 ? [{ label: `last option (${options[options.length - 1]})`, value: options[options.length - 1], expectedValid: true, category: 'happy' as const }] : []),\n ];\n}\n\nexport function generateFieldCases(field: FormField): InputCase[] {\n switch (field.type) {\n case 'email': return generateEmailCases();\n case 'password': return generatePasswordCases(field.minLength, field.maxLength);\n case 'number': return generateNumberCases(field.min, field.max);\n case 'select': return generateSelectCases(field.options);\n case 'checkbox': return [\n { label: 'checked', value: 'true', expectedValid: true, category: 'happy' },\n { label: 'unchecked', value: 'false', expectedValid: !field.required, category: field.required ? 'invalid' : 'happy' },\n ];\n case 'date': return [\n { label: 'valid date', value: '2026-01-15', expectedValid: true, category: 'happy' },\n { label: 'invalid date', value: '9999-99-99', expectedValid: false, category: 'invalid' },\n { label: 'empty', value: '', expectedValid: !field.required, category: 'edge' },\n ];\n case 'url': return [\n { label: 'valid URL', value: 'https://example.com', expectedValid: true, category: 'happy' },\n { label: 'missing protocol', value: 'example.com', expectedValid: false, category: 'invalid' },\n { label: 'empty', value: '', expectedValid: !field.required, category: 'edge' },\n ];\n default:\n return generateTextCases(field.minLength, field.maxLength, field.required);\n }\n}\n\nexport interface FuzzedForm {\n formIndex: number;\n purpose: string;\n fieldCases: Array<{ field: FormField; cases: InputCase[] }>;\n}\n\nexport function fuzzForm(form: import('./form-detector.js').DetectedForm): FuzzedForm {\n return {\n formIndex: form.index,\n purpose: form.purpose,\n fieldCases: form.fields.map(field => ({ field, cases: generateFieldCases(field) })),\n };\n}\n"],
|
|
5
|
+
"mappings": "AAuBA,MAAM,QAAQ;AAEd,SAAS,qBAAkC;AACzC,SAAO;AAAA,IACL,EAAE,OAAO,eAAe,OAAO,oBAAoB,eAAe,MAAM,UAAU,QAAQ;AAAA,IAC1F,EAAE,OAAO,mBAAmB,OAAO,wBAAwB,eAAe,M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
+
*
|
|
4
|
+
* The static crawl captures DOM structure at rest. This module runs AFTER the static crawl
|
|
5
|
+
* to observe dynamic behaviour by actually interacting with the UI:
|
|
6
|
+
*
|
|
7
|
+
* 1. Empty submit → captures required-field validation error messages
|
|
8
|
+
* 2. Invalid format → captures format validation errors (bad email, short password)
|
|
9
|
+
* 3. Button clicks → captures modal/dialog contents
|
|
10
|
+
* 4. Select changes → captures conditional reveals (show/hide logic)
|
|
11
|
+
* 5. Success paths → captures toast/banner messages (where input is safe)
|
|
12
|
+
*
|
|
13
|
+
* Results are stored as KnowledgeChunks (sourceType='probe') and update the
|
|
14
|
+
* ERROR_CATALOGUE + INTERACTION_PATTERNS skill files with real observed data
|
|
15
|
+
* instead of LLM inference.
|
|
16
|
+
*
|
|
17
|
+
* Call signature: probeScreen(page, screenId, elements, opts)
|
|
18
|
+
* Called from crawlProject() after static element extraction when opts.interactive=true.
|
|
19
|
+
*/
|
|
20
|
+
import type { Page } from 'playwright';
|
|
21
|
+
export interface ProbeElementFact {
|
|
22
|
+
meaning: string;
|
|
23
|
+
role: string;
|
|
24
|
+
expectedData?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ValidationError {
|
|
27
|
+
field: string;
|
|
28
|
+
trigger: 'empty_submit' | 'invalid_format' | 'boundary';
|
|
29
|
+
errorText: string;
|
|
30
|
+
}
|
|
31
|
+
export interface SuccessMessage {
|
|
32
|
+
type: 'toast' | 'inline_success' | 'redirect';
|
|
33
|
+
content: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ModalObservation {
|
|
36
|
+
triggerElement: string;
|
|
37
|
+
title: string;
|
|
38
|
+
content: string;
|
|
39
|
+
fields: string[];
|
|
40
|
+
}
|
|
41
|
+
export interface ConditionalReveal {
|
|
42
|
+
triggerElement: string;
|
|
43
|
+
triggerValue: string;
|
|
44
|
+
revealedText: string;
|
|
45
|
+
}
|
|
46
|
+
export interface ProbeResult {
|
|
47
|
+
screenId: string;
|
|
48
|
+
url: string;
|
|
49
|
+
validationErrors: ValidationError[];
|
|
50
|
+
successMessages: SuccessMessage[];
|
|
51
|
+
modals: ModalObservation[];
|
|
52
|
+
conditionals: ConditionalReveal[];
|
|
53
|
+
loadingPatterns: string[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Run interactive probing on a single screen page.
|
|
57
|
+
* The page must already be navigated to the screen URL.
|
|
58
|
+
* `elements` is the output of the static extractElements pass.
|
|
59
|
+
*/
|
|
60
|
+
export declare function probeScreen(page: Page, screenId: string, url: string, elements: ProbeElementFact[]): Promise<ProbeResult>;
|
|
61
|
+
/** Phase 5: Convert ProbeResult to typed ProbeObservationFact rows for direct DB storage. */
|
|
62
|
+
export declare function probeResultToObservations(result: ProbeResult): Array<{
|
|
63
|
+
elementMeaning: string;
|
|
64
|
+
observationType: string;
|
|
65
|
+
observedText: string;
|
|
66
|
+
triggeredBy: string;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Convert a ProbeResult into markdown to store as KnowledgeChunks
|
|
70
|
+
* and update ERROR_CATALOGUE + INTERACTION_PATTERNS skill files.
|
|
71
|
+
*/
|
|
72
|
+
export declare function probeResultToMarkdown(result: ProbeResult): {
|
|
73
|
+
errorCatalogueChunk: string;
|
|
74
|
+
interactionPatternsChunk: string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Run interactive probing for all screens discovered in a crawl session.
|
|
78
|
+
* Called from crawlProject() when opts.interactive = true.
|
|
79
|
+
*/
|
|
80
|
+
export declare function probeAllScreens(page: any, tenantId: string, projectId: string, discovered: Array<{
|
|
81
|
+
url: string;
|
|
82
|
+
screenId?: string;
|
|
83
|
+
elements?: any[];
|
|
84
|
+
}>, onProgress?: (pct: number, step: string) => Promise<void>): Promise<void>;
|
|
85
|
+
export interface FocusableElement {
|
|
86
|
+
tag: string;
|
|
87
|
+
role: string | null;
|
|
88
|
+
ariaLabel: string | null;
|
|
89
|
+
text: string | null;
|
|
90
|
+
hasFocusIndicator: boolean;
|
|
91
|
+
tabIndex: number | null;
|
|
92
|
+
}
|
|
93
|
+
export interface KeyboardNavResult {
|
|
94
|
+
focusableCount: number;
|
|
95
|
+
elementsWithNoFocusIndicator: number;
|
|
96
|
+
sequence: FocusableElement[];
|
|
97
|
+
issues: string[];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Probe keyboard navigation accessibility by pressing Tab up to 50 times and
|
|
101
|
+
* recording each focused element's properties and focus-indicator visibility.
|
|
102
|
+
* Stops early if focus wraps back to the start or hits the same element twice.
|
|
103
|
+
*/
|
|
104
|
+
export declare function probeKeyboardNav(page: Page): Promise<KeyboardNavResult>;
|