@enricai/barnacle 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +958 -0
- package/dist/api/errors.d.ts +88 -0
- package/dist/api/errors.d.ts.map +1 -0
- package/dist/api/errors.js +164 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/api/helpers/envelope.d.ts +13 -0
- package/dist/api/helpers/envelope.d.ts.map +1 -0
- package/dist/api/helpers/envelope.js +20 -0
- package/dist/api/helpers/envelope.js.map +1 -0
- package/dist/api/helpers/reply.d.ts +9 -0
- package/dist/api/helpers/reply.d.ts.map +1 -0
- package/dist/api/helpers/reply.js +14 -0
- package/dist/api/helpers/reply.js.map +1 -0
- package/dist/api/plugins/auth.d.ts +27 -0
- package/dist/api/plugins/auth.d.ts.map +1 -0
- package/dist/api/plugins/auth.js +111 -0
- package/dist/api/plugins/auth.js.map +1 -0
- package/dist/api/plugins/error-handler.d.ts +12 -0
- package/dist/api/plugins/error-handler.d.ts.map +1 -0
- package/dist/api/plugins/error-handler.js +72 -0
- package/dist/api/plugins/error-handler.js.map +1 -0
- package/dist/api/plugins/request-context.d.ts +17 -0
- package/dist/api/plugins/request-context.d.ts.map +1 -0
- package/dist/api/plugins/request-context.js +61 -0
- package/dist/api/plugins/request-context.js.map +1 -0
- package/dist/api/routes/health.d.ts +55 -0
- package/dist/api/routes/health.d.ts.map +1 -0
- package/dist/api/routes/health.js +137 -0
- package/dist/api/routes/health.js.map +1 -0
- package/dist/api/routes/plugins-introspection.d.ts +17 -0
- package/dist/api/routes/plugins-introspection.d.ts.map +1 -0
- package/dist/api/routes/plugins-introspection.js +13 -0
- package/dist/api/routes/plugins-introspection.js.map +1 -0
- package/dist/api/schemas/common.d.ts +114 -0
- package/dist/api/schemas/common.d.ts.map +1 -0
- package/dist/api/schemas/common.js +109 -0
- package/dist/api/schemas/common.js.map +1 -0
- package/dist/api/schemas/telemetry.d.ts +66 -0
- package/dist/api/schemas/telemetry.d.ts.map +1 -0
- package/dist/api/schemas/telemetry.js +52 -0
- package/dist/api/schemas/telemetry.js.map +1 -0
- package/dist/cache/keyed-ttl-cache.d.ts +45 -0
- package/dist/cache/keyed-ttl-cache.d.ts.map +1 -0
- package/dist/cache/keyed-ttl-cache.js +69 -0
- package/dist/cache/keyed-ttl-cache.js.map +1 -0
- package/dist/cache/response-cache.d.ts +37 -0
- package/dist/cache/response-cache.d.ts.map +1 -0
- package/dist/cache/response-cache.js +114 -0
- package/dist/cache/response-cache.js.map +1 -0
- package/dist/config.d.ts +258 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +138 -0
- package/dist/config.js.map +1 -0
- package/dist/lib/applicant-payload.d.ts +28 -0
- package/dist/lib/applicant-payload.d.ts.map +1 -0
- package/dist/lib/applicant-payload.js +20 -0
- package/dist/lib/applicant-payload.js.map +1 -0
- package/dist/lib/application-address.d.ts +16 -0
- package/dist/lib/application-address.d.ts.map +1 -0
- package/dist/lib/application-address.js +20 -0
- package/dist/lib/application-address.js.map +1 -0
- package/dist/lib/application-answers.d.ts +151 -0
- package/dist/lib/application-answers.d.ts.map +1 -0
- package/dist/lib/application-answers.js +95 -0
- package/dist/lib/application-answers.js.map +1 -0
- package/dist/lib/application-identity.d.ts +18 -0
- package/dist/lib/application-identity.d.ts.map +1 -0
- package/dist/lib/application-identity.js +20 -0
- package/dist/lib/application-identity.js.map +1 -0
- package/dist/lib/application-resume.d.ts +21 -0
- package/dist/lib/application-resume.d.ts.map +1 -0
- package/dist/lib/application-resume.js +23 -0
- package/dist/lib/application-resume.js.map +1 -0
- package/dist/lib/bedrock.d.ts +22 -0
- package/dist/lib/bedrock.d.ts.map +1 -0
- package/dist/lib/bedrock.js +35 -0
- package/dist/lib/bedrock.js.map +1 -0
- package/dist/lib/case-insensitive-headers.d.ts +15 -0
- package/dist/lib/case-insensitive-headers.d.ts.map +1 -0
- package/dist/lib/case-insensitive-headers.js +29 -0
- package/dist/lib/case-insensitive-headers.js.map +1 -0
- package/dist/lib/chromium-client-hints.d.ts +11 -0
- package/dist/lib/chromium-client-hints.d.ts.map +1 -0
- package/dist/lib/chromium-client-hints.js +17 -0
- package/dist/lib/chromium-client-hints.js.map +1 -0
- package/dist/lib/cookie-value.d.ts +8 -0
- package/dist/lib/cookie-value.d.ts.map +1 -0
- package/dist/lib/cookie-value.js +14 -0
- package/dist/lib/cookie-value.js.map +1 -0
- package/dist/lib/datadog.d.ts +8 -0
- package/dist/lib/datadog.d.ts.map +1 -0
- package/dist/lib/datadog.js +27 -0
- package/dist/lib/datadog.js.map +1 -0
- package/dist/lib/dd-metrics.d.ts +28 -0
- package/dist/lib/dd-metrics.d.ts.map +1 -0
- package/dist/lib/dd-metrics.js +62 -0
- package/dist/lib/dd-metrics.js.map +1 -0
- package/dist/lib/dispatch-metrics.d.ts +19 -0
- package/dist/lib/dispatch-metrics.d.ts.map +1 -0
- package/dist/lib/dispatch-metrics.js +65 -0
- package/dist/lib/dispatch-metrics.js.map +1 -0
- package/dist/lib/env.d.ts +37 -0
- package/dist/lib/env.d.ts.map +1 -0
- package/dist/lib/env.js +70 -0
- package/dist/lib/env.js.map +1 -0
- package/dist/lib/errors.d.ts +15 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +20 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/http.d.ts +7 -0
- package/dist/lib/http.d.ts.map +1 -0
- package/dist/lib/http.js +14 -0
- package/dist/lib/http.js.map +1 -0
- package/dist/lib/job-tracking.d.ts +17 -0
- package/dist/lib/job-tracking.d.ts.map +1 -0
- package/dist/lib/job-tracking.js +19 -0
- package/dist/lib/job-tracking.js.map +1 -0
- package/dist/lib/llm/anthropic-client.d.ts +12 -0
- package/dist/lib/llm/anthropic-client.d.ts.map +1 -0
- package/dist/lib/llm/anthropic-client.js +23 -0
- package/dist/lib/llm/anthropic-client.js.map +1 -0
- package/dist/lib/llm/judge.d.ts +57 -0
- package/dist/lib/llm/judge.d.ts.map +1 -0
- package/dist/lib/llm/judge.js +123 -0
- package/dist/lib/llm/judge.js.map +1 -0
- package/dist/lib/llm/judges/error-messages.d.ts +38 -0
- package/dist/lib/llm/judges/error-messages.d.ts.map +1 -0
- package/dist/lib/llm/judges/error-messages.js +72 -0
- package/dist/lib/llm/judges/error-messages.js.map +1 -0
- package/dist/lib/llm/judges/invalid-fields.d.ts +43 -0
- package/dist/lib/llm/judges/invalid-fields.d.ts.map +1 -0
- package/dist/lib/llm/judges/invalid-fields.js +80 -0
- package/dist/lib/llm/judges/invalid-fields.js.map +1 -0
- package/dist/lib/llm/judges/modal-priority.d.ts +41 -0
- package/dist/lib/llm/judges/modal-priority.d.ts.map +1 -0
- package/dist/lib/llm/judges/modal-priority.js +74 -0
- package/dist/lib/llm/judges/modal-priority.js.map +1 -0
- package/dist/lib/llm/judges/select-option.d.ts +49 -0
- package/dist/lib/llm/judges/select-option.d.ts.map +1 -0
- package/dist/lib/llm/judges/select-option.js +90 -0
- package/dist/lib/llm/judges/select-option.js.map +1 -0
- package/dist/lib/llm/judges/verify-submit.d.ts +68 -0
- package/dist/lib/llm/judges/verify-submit.d.ts.map +1 -0
- package/dist/lib/llm/judges/verify-submit.js +89 -0
- package/dist/lib/llm/judges/verify-submit.js.map +1 -0
- package/dist/lib/llm/schemas.d.ts +220 -0
- package/dist/lib/llm/schemas.d.ts.map +1 -0
- package/dist/lib/llm/schemas.js +239 -0
- package/dist/lib/llm/schemas.js.map +1 -0
- package/dist/lib/logging.d.ts +39 -0
- package/dist/lib/logging.d.ts.map +1 -0
- package/dist/lib/logging.js +219 -0
- package/dist/lib/logging.js.map +1 -0
- package/dist/lib/multipart.d.ts +34 -0
- package/dist/lib/multipart.d.ts.map +1 -0
- package/dist/lib/multipart.js +55 -0
- package/dist/lib/multipart.js.map +1 -0
- package/dist/lib/option-matcher.d.ts +15 -0
- package/dist/lib/option-matcher.d.ts.map +1 -0
- package/dist/lib/option-matcher.js +69 -0
- package/dist/lib/option-matcher.js.map +1 -0
- package/dist/lib/phone.d.ts +11 -0
- package/dist/lib/phone.d.ts.map +1 -0
- package/dist/lib/phone.js +17 -0
- package/dist/lib/phone.js.map +1 -0
- package/dist/lib/random.d.ts +22 -0
- package/dist/lib/random.d.ts.map +1 -0
- package/dist/lib/random.js +33 -0
- package/dist/lib/random.js.map +1 -0
- package/dist/lib/statsd.d.ts +11 -0
- package/dist/lib/statsd.d.ts.map +1 -0
- package/dist/lib/statsd.js +68 -0
- package/dist/lib/statsd.js.map +1 -0
- package/dist/lib/telemetry/call-capture.d.ts +89 -0
- package/dist/lib/telemetry/call-capture.d.ts.map +1 -0
- package/dist/lib/telemetry/call-capture.js +190 -0
- package/dist/lib/telemetry/call-capture.js.map +1 -0
- package/dist/lib/telemetry/call-types.d.ts +65 -0
- package/dist/lib/telemetry/call-types.d.ts.map +1 -0
- package/dist/lib/telemetry/call-types.js +68 -0
- package/dist/lib/telemetry/call-types.js.map +1 -0
- package/dist/lib/telemetry/run-state.d.ts +15 -0
- package/dist/lib/telemetry/run-state.d.ts.map +1 -0
- package/dist/lib/telemetry/run-state.js +23 -0
- package/dist/lib/telemetry/run-state.js.map +1 -0
- package/dist/lib/telemetry/s3-sink.d.ts +48 -0
- package/dist/lib/telemetry/s3-sink.d.ts.map +1 -0
- package/dist/lib/telemetry/s3-sink.js +229 -0
- package/dist/lib/telemetry/s3-sink.js.map +1 -0
- package/dist/lib/telemetry/submission-capture.d.ts +45 -0
- package/dist/lib/telemetry/submission-capture.d.ts.map +1 -0
- package/dist/lib/telemetry/submission-capture.js +57 -0
- package/dist/lib/telemetry/submission-capture.js.map +1 -0
- package/dist/lib/telemetry/telemetry-paths.d.ts +59 -0
- package/dist/lib/telemetry/telemetry-paths.d.ts.map +1 -0
- package/dist/lib/telemetry/telemetry-paths.js +103 -0
- package/dist/lib/telemetry/telemetry-paths.js.map +1 -0
- package/dist/lib/tracking-click.d.ts +20 -0
- package/dist/lib/tracking-click.d.ts.map +1 -0
- package/dist/lib/tracking-click.js +75 -0
- package/dist/lib/tracking-click.js.map +1 -0
- package/dist/lib/url-capture.d.ts +8 -0
- package/dist/lib/url-capture.d.ts.map +1 -0
- package/dist/lib/url-capture.js +17 -0
- package/dist/lib/url-capture.js.map +1 -0
- package/dist/lib/us-states.d.ts +20 -0
- package/dist/lib/us-states.d.ts.map +1 -0
- package/dist/lib/us-states.js +86 -0
- package/dist/lib/us-states.js.map +1 -0
- package/dist/lib/zod-multipart.d.ts +18 -0
- package/dist/lib/zod-multipart.d.ts.map +1 -0
- package/dist/lib/zod-multipart.js +35 -0
- package/dist/lib/zod-multipart.js.map +1 -0
- package/dist/plugins/config-plugin.d.ts +77 -0
- package/dist/plugins/config-plugin.d.ts.map +1 -0
- package/dist/plugins/config-plugin.js +216 -0
- package/dist/plugins/config-plugin.js.map +1 -0
- package/dist/plugins/discover.d.ts +72 -0
- package/dist/plugins/discover.d.ts.map +1 -0
- package/dist/plugins/discover.js +265 -0
- package/dist/plugins/discover.js.map +1 -0
- package/dist/plugins/json-schema-to-zod.d.ts +47 -0
- package/dist/plugins/json-schema-to-zod.d.ts.map +1 -0
- package/dist/plugins/json-schema-to-zod.js +85 -0
- package/dist/plugins/json-schema-to-zod.js.map +1 -0
- package/dist/plugins/loader.d.ts +34 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +348 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/plugin-api-version.d.ts +8 -0
- package/dist/plugins/plugin-api-version.d.ts.map +1 -0
- package/dist/plugins/plugin-api-version.js +11 -0
- package/dist/plugins/plugin-api-version.js.map +1 -0
- package/dist/plugins/plugin-manifest-envelope.d.ts +16 -0
- package/dist/plugins/plugin-manifest-envelope.d.ts.map +1 -0
- package/dist/plugins/plugin-manifest-envelope.js +19 -0
- package/dist/plugins/plugin-manifest-envelope.js.map +1 -0
- package/dist/scraper/behavioral-signals.d.ts +16 -0
- package/dist/scraper/behavioral-signals.d.ts.map +1 -0
- package/dist/scraper/behavioral-signals.js +30 -0
- package/dist/scraper/behavioral-signals.js.map +1 -0
- package/dist/scraper/errors.d.ts +193 -0
- package/dist/scraper/errors.d.ts.map +1 -0
- package/dist/scraper/errors.js +226 -0
- package/dist/scraper/errors.js.map +1 -0
- package/dist/scraper/fixtures.d.ts +23 -0
- package/dist/scraper/fixtures.d.ts.map +1 -0
- package/dist/scraper/fixtures.js +48 -0
- package/dist/scraper/fixtures.js.map +1 -0
- package/dist/scraper/flow-runner.d.ts +1319 -0
- package/dist/scraper/flow-runner.d.ts.map +1 -0
- package/dist/scraper/flow-runner.js +5637 -0
- package/dist/scraper/flow-runner.js.map +1 -0
- package/dist/scraper/graphql-client.d.ts +30 -0
- package/dist/scraper/graphql-client.d.ts.map +1 -0
- package/dist/scraper/graphql-client.js +14 -0
- package/dist/scraper/graphql-client.js.map +1 -0
- package/dist/scraper/http-client.d.ts +75 -0
- package/dist/scraper/http-client.d.ts.map +1 -0
- package/dist/scraper/http-client.js +189 -0
- package/dist/scraper/http-client.js.map +1 -0
- package/dist/scraper/http-status-classifier.d.ts +12 -0
- package/dist/scraper/http-status-classifier.d.ts.map +1 -0
- package/dist/scraper/http-status-classifier.js +29 -0
- package/dist/scraper/http-status-classifier.js.map +1 -0
- package/dist/scraper/metrics.d.ts +50 -0
- package/dist/scraper/metrics.d.ts.map +1 -0
- package/dist/scraper/metrics.js +85 -0
- package/dist/scraper/metrics.js.map +1 -0
- package/dist/scraper/navigate.d.ts +20 -0
- package/dist/scraper/navigate.d.ts.map +1 -0
- package/dist/scraper/navigate.js +30 -0
- package/dist/scraper/navigate.js.map +1 -0
- package/dist/scraper/oracle-sentinels.d.ts +22 -0
- package/dist/scraper/oracle-sentinels.d.ts.map +1 -0
- package/dist/scraper/oracle-sentinels.js +40 -0
- package/dist/scraper/oracle-sentinels.js.map +1 -0
- package/dist/scraper/parse-json-response.d.ts +16 -0
- package/dist/scraper/parse-json-response.d.ts.map +1 -0
- package/dist/scraper/parse-json-response.js +37 -0
- package/dist/scraper/parse-json-response.js.map +1 -0
- package/dist/scraper/pool.d.ts +37 -0
- package/dist/scraper/pool.d.ts.map +1 -0
- package/dist/scraper/pool.js +105 -0
- package/dist/scraper/pool.js.map +1 -0
- package/dist/scraper/rate-limited-json-client.d.ts +35 -0
- package/dist/scraper/rate-limited-json-client.d.ts.map +1 -0
- package/dist/scraper/rate-limited-json-client.js +29 -0
- package/dist/scraper/rate-limited-json-client.js.map +1 -0
- package/dist/scraper/raw-fetch.d.ts +49 -0
- package/dist/scraper/raw-fetch.d.ts.map +1 -0
- package/dist/scraper/raw-fetch.js +40 -0
- package/dist/scraper/raw-fetch.js.map +1 -0
- package/dist/scraper/require-response-field.d.ts +23 -0
- package/dist/scraper/require-response-field.d.ts.map +1 -0
- package/dist/scraper/require-response-field.js +42 -0
- package/dist/scraper/require-response-field.js.map +1 -0
- package/dist/scraper/retry.d.ts +33 -0
- package/dist/scraper/retry.d.ts.map +1 -0
- package/dist/scraper/retry.js +122 -0
- package/dist/scraper/retry.js.map +1 -0
- package/dist/scraper/session-browserbase.d.ts +35 -0
- package/dist/scraper/session-browserbase.d.ts.map +1 -0
- package/dist/scraper/session-browserbase.js +198 -0
- package/dist/scraper/session-browserbase.js.map +1 -0
- package/dist/scraper/session-shared.d.ts +29 -0
- package/dist/scraper/session-shared.d.ts.map +1 -0
- package/dist/scraper/session-shared.js +35 -0
- package/dist/scraper/session-shared.js.map +1 -0
- package/dist/scraper/session-steel.d.ts +31 -0
- package/dist/scraper/session-steel.d.ts.map +1 -0
- package/dist/scraper/session-steel.js +140 -0
- package/dist/scraper/session-steel.js.map +1 -0
- package/dist/scraper/session-warmup.d.ts +31 -0
- package/dist/scraper/session-warmup.d.ts.map +1 -0
- package/dist/scraper/session-warmup.js +46 -0
- package/dist/scraper/session-warmup.js.map +1 -0
- package/dist/scraper/session.d.ts +21 -0
- package/dist/scraper/session.d.ts.map +1 -0
- package/dist/scraper/session.js +28 -0
- package/dist/scraper/session.js.map +1 -0
- package/dist/scraper/stagehand-guard.d.ts +128 -0
- package/dist/scraper/stagehand-guard.d.ts.map +1 -0
- package/dist/scraper/stagehand-guard.js +337 -0
- package/dist/scraper/stagehand-guard.js.map +1 -0
- package/dist/scraper/throttle.d.ts +21 -0
- package/dist/scraper/throttle.d.ts.map +1 -0
- package/dist/scraper/throttle.js +45 -0
- package/dist/scraper/throttle.js.map +1 -0
- package/dist/scripts/hca-inbox-poll.d.ts +19 -0
- package/dist/scripts/hca-inbox-poll.d.ts.map +1 -0
- package/dist/scripts/hca-inbox-poll.js +151 -0
- package/dist/scripts/hca-inbox-poll.js.map +1 -0
- package/dist/scripts/judge-llm-batch.d.ts +98 -0
- package/dist/scripts/judge-llm-batch.d.ts.map +1 -0
- package/dist/scripts/judge-llm-batch.js +350 -0
- package/dist/scripts/judge-llm-batch.js.map +1 -0
- package/dist/scripts/llm-heal.d.ts +165 -0
- package/dist/scripts/llm-heal.d.ts.map +1 -0
- package/dist/scripts/llm-heal.js +595 -0
- package/dist/scripts/llm-heal.js.map +1 -0
- package/dist/scripts/migrate-telemetry-dir-names.d.ts +57 -0
- package/dist/scripts/migrate-telemetry-dir-names.d.ts.map +1 -0
- package/dist/scripts/migrate-telemetry-dir-names.js +156 -0
- package/dist/scripts/migrate-telemetry-dir-names.js.map +1 -0
- package/dist/scripts/probe-setinputfiles.d.ts +28 -0
- package/dist/scripts/probe-setinputfiles.d.ts.map +1 -0
- package/dist/scripts/probe-setinputfiles.js +95 -0
- package/dist/scripts/probe-setinputfiles.js.map +1 -0
- package/dist/scripts/recon-browser.d.ts +304 -0
- package/dist/scripts/recon-browser.d.ts.map +1 -0
- package/dist/scripts/recon-browser.js +1833 -0
- package/dist/scripts/recon-browser.js.map +1 -0
- package/dist/scripts/recon-generate.d.ts +182 -0
- package/dist/scripts/recon-generate.d.ts.map +1 -0
- package/dist/scripts/recon-generate.js +2572 -0
- package/dist/scripts/recon-generate.js.map +1 -0
- package/dist/scripts/recon-heal.d.ts +176 -0
- package/dist/scripts/recon-heal.d.ts.map +1 -0
- package/dist/scripts/recon-heal.js +584 -0
- package/dist/scripts/recon-heal.js.map +1 -0
- package/dist/scripts/recon-http.d.ts +19 -0
- package/dist/scripts/recon-http.d.ts.map +1 -0
- package/dist/scripts/recon-http.js +377 -0
- package/dist/scripts/recon-http.js.map +1 -0
- package/dist/scripts/recon-replay-jobs.d.ts +21 -0
- package/dist/scripts/recon-replay-jobs.d.ts.map +1 -0
- package/dist/scripts/recon-replay-jobs.js +221 -0
- package/dist/scripts/recon-replay-jobs.js.map +1 -0
- package/dist/scripts/recon-shared.d.ts +52 -0
- package/dist/scripts/recon-shared.d.ts.map +1 -0
- package/dist/scripts/recon-shared.js +68 -0
- package/dist/scripts/recon-shared.js.map +1 -0
- package/dist/scripts/recon-summarize.d.ts +15 -0
- package/dist/scripts/recon-summarize.d.ts.map +1 -0
- package/dist/scripts/recon-summarize.js +233 -0
- package/dist/scripts/recon-summarize.js.map +1 -0
- package/dist/scripts/smoke-test.d.ts +22 -0
- package/dist/scripts/smoke-test.d.ts.map +1 -0
- package/dist/scripts/smoke-test.js +236 -0
- package/dist/scripts/smoke-test.js.map +1 -0
- package/dist/server.d.ts +10 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +189 -0
- package/dist/server.js.map +1 -0
- package/dist/site-plugin.d.ts +226 -0
- package/dist/site-plugin.d.ts.map +1 -0
- package/dist/site-plugin.js +13 -0
- package/dist/site-plugin.js.map +1 -0
- package/dist/testing/answers-fixture.d.ts +13 -0
- package/dist/testing/answers-fixture.d.ts.map +1 -0
- package/dist/testing/answers-fixture.js +37 -0
- package/dist/testing/answers-fixture.js.map +1 -0
- package/dist/testing/batch-email-confirmation.d.ts +58 -0
- package/dist/testing/batch-email-confirmation.d.ts.map +1 -0
- package/dist/testing/batch-email-confirmation.js +62 -0
- package/dist/testing/batch-email-confirmation.js.map +1 -0
- package/dist/testing/batch-report.d.ts +33 -0
- package/dist/testing/batch-report.d.ts.map +1 -0
- package/dist/testing/batch-report.js +30 -0
- package/dist/testing/batch-report.js.map +1 -0
- package/dist/testing/contract-parity-suite.d.ts +55 -0
- package/dist/testing/contract-parity-suite.d.ts.map +1 -0
- package/dist/testing/contract-parity-suite.js +39 -0
- package/dist/testing/contract-parity-suite.js.map +1 -0
- package/dist/testing/coverage-guard-suite.d.ts +46 -0
- package/dist/testing/coverage-guard-suite.d.ts.map +1 -0
- package/dist/testing/coverage-guard-suite.js +39 -0
- package/dist/testing/coverage-guard-suite.js.map +1 -0
- package/dist/testing/fixtures/resume.pdf +54 -0
- package/dist/testing/integration-runner.d.ts +62 -0
- package/dist/testing/integration-runner.d.ts.map +1 -0
- package/dist/testing/integration-runner.js +46 -0
- package/dist/testing/integration-runner.js.map +1 -0
- package/dist/testing/mock-fetch-response.d.ts +7 -0
- package/dist/testing/mock-fetch-response.d.ts.map +1 -0
- package/dist/testing/mock-fetch-response.js +16 -0
- package/dist/testing/mock-fetch-response.js.map +1 -0
- package/dist/testing/persona-fixture.d.ts +77 -0
- package/dist/testing/persona-fixture.d.ts.map +1 -0
- package/dist/testing/persona-fixture.js +83 -0
- package/dist/testing/persona-fixture.js.map +1 -0
- package/dist/testing/replay-integration-suite.d.ts +50 -0
- package/dist/testing/replay-integration-suite.d.ts.map +1 -0
- package/dist/testing/replay-integration-suite.js +45 -0
- package/dist/testing/replay-integration-suite.js.map +1 -0
- package/dist/testing/resume-fixture.d.ts +39 -0
- package/dist/testing/resume-fixture.d.ts.map +1 -0
- package/dist/testing/resume-fixture.js +38 -0
- package/dist/testing/resume-fixture.js.map +1 -0
- package/dist/testmail/client.d.ts +61 -0
- package/dist/testmail/client.d.ts.map +1 -0
- package/dist/testmail/client.js +190 -0
- package/dist/testmail/client.js.map +1 -0
- package/dist/testmail/errors.d.ts +18 -0
- package/dist/testmail/errors.d.ts.map +1 -0
- package/dist/testmail/errors.js +29 -0
- package/dist/testmail/errors.js.map +1 -0
- package/dist/types/dispatch-metrics.d.ts +46 -0
- package/dist/types/dispatch-metrics.d.ts.map +1 -0
- package/dist/types/dispatch-metrics.js +25 -0
- package/dist/types/dispatch-metrics.js.map +1 -0
- package/dist/types/logging.d.ts +11 -0
- package/dist/types/logging.d.ts.map +1 -0
- package/dist/types/logging.js +3 -0
- package/dist/types/logging.js.map +1 -0
- package/package.json +283 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.runBatchEmailConfirmation = runBatchEmailConfirmation;
|
|
7
|
+
const p_queue_1 = __importDefault(require("p-queue"));
|
|
8
|
+
const logging_1 = require("../lib/logging");
|
|
9
|
+
const logger = (0, logging_1.getLogger)({ name: "testing/batch-email-confirmation" });
|
|
10
|
+
/**
|
|
11
|
+
* Site-agnostic two-phase batch runner: submit each job with a fresh testmail
|
|
12
|
+
* inbox (phase 1), then poll each successful inbox for a confirmation email
|
|
13
|
+
* (phase 2). Returns one verdict per input job.
|
|
14
|
+
*
|
|
15
|
+
* Phase separation is intentional — all submits complete before any polling
|
|
16
|
+
* begins, matching the expected cadence for ATS email confirmations that
|
|
17
|
+
* arrive seconds after submission. The caller supplies all site-specific
|
|
18
|
+
* behaviour via injected callbacks.
|
|
19
|
+
*/
|
|
20
|
+
async function runBatchEmailConfirmation(jobs, opts) {
|
|
21
|
+
const { allocateInbox, submit, pollEmail, mapVerdict, concurrency = 1 } = opts;
|
|
22
|
+
logger.info(`--- phase 1: submitting ${jobs.length} jobs (concurrency=${concurrency}) ---`);
|
|
23
|
+
const queue = new p_queue_1.default({ concurrency });
|
|
24
|
+
const phase1Results = await Promise.all(jobs.map((job, i) => queue.add(async () => {
|
|
25
|
+
const inbox = allocateInbox(job);
|
|
26
|
+
const outcome = await submit(job, inbox).catch((err) => {
|
|
27
|
+
const durationMs = 0;
|
|
28
|
+
return {
|
|
29
|
+
ok: false,
|
|
30
|
+
error: err instanceof Error ? err.message : String(err),
|
|
31
|
+
durationMs,
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
const status = outcome.ok ? "PASS" : "FAIL";
|
|
35
|
+
logger.info(`[${i + 1}/${jobs.length}] ${status} → ${inbox.address}`);
|
|
36
|
+
return { job, inbox, outcome };
|
|
37
|
+
})));
|
|
38
|
+
const phase1 = phase1Results.filter((r) => r != null);
|
|
39
|
+
const passed = phase1.filter((r) => r.outcome.ok);
|
|
40
|
+
const failCount = phase1.length - passed.length;
|
|
41
|
+
logger.info(`phase 1 complete: ${passed.length}/${phase1.length} submitted, ${failCount} failed`);
|
|
42
|
+
// serial to stay within testmail's per-account rate limit
|
|
43
|
+
logger.info(`--- phase 2: polling ${passed.length} inboxes for confirmation emails ---`);
|
|
44
|
+
const pollResults = new Map();
|
|
45
|
+
for (const [i, r] of passed.entries()) {
|
|
46
|
+
const pollOutcome = await pollEmail(r.inbox);
|
|
47
|
+
pollResults.set(r.job, pollOutcome);
|
|
48
|
+
if (pollOutcome.received) {
|
|
49
|
+
logger.info(`[${i + 1}/${passed.length}] EMAIL: "${pollOutcome.message.subject}" from ${pollOutcome.message.from}`);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
logger.info(`[${i + 1}/${passed.length}] NO EMAIL within timeout`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const emailCount = [...pollResults.values()].filter((p) => p.received).length;
|
|
56
|
+
logger.info(`final: ${passed.length} submitted, ${failCount} failed, ${emailCount} confirmation emails received`);
|
|
57
|
+
return phase1.map(({ job, outcome }) => {
|
|
58
|
+
const pollOutcome = outcome.ok ? (pollResults.get(job) ?? null) : null;
|
|
59
|
+
return mapVerdict(job, outcome, pollOutcome);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=batch-email-confirmation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-email-confirmation.js","sourceRoot":"","sources":["../../src/testing/batch-email-confirmation.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Site-agnostic batch-test verdict type and markdown report renderer. Any
|
|
3
|
+
* plugin batch script can populate `BatchJobVerdict[]` and call
|
|
4
|
+
* `renderBatchReport` to get a consistent table + summary without reimplementing
|
|
5
|
+
* the formatting logic. Site-specific fields (employer, reqNum, hospitalState, etc.)
|
|
6
|
+
* stay in the per-site script; only the cross-cutting outcome fields live here.
|
|
7
|
+
*/
|
|
8
|
+
/** Per-job outcome produced after the submit + email-poll phases. */
|
|
9
|
+
export interface BatchJobVerdict {
|
|
10
|
+
/** Stable job identifier shown in the report row (e.g. reqNum, auditJobId). */
|
|
11
|
+
jobId: string;
|
|
12
|
+
/** Whether the HTTP submit phase succeeded. */
|
|
13
|
+
submitStatus: "PASS" | "FAIL";
|
|
14
|
+
/** Round-trip duration of the submit phase, milliseconds. */
|
|
15
|
+
submitDurationMs: number | null;
|
|
16
|
+
/** Whether a confirmation email arrived during the poll window. */
|
|
17
|
+
emailReceived: boolean;
|
|
18
|
+
/** Subject line of the confirmation email, if one arrived. */
|
|
19
|
+
emailSubject?: string;
|
|
20
|
+
/** Error message from whichever phase failed first. */
|
|
21
|
+
error?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface RenderBatchReportOptions {
|
|
24
|
+
/** Label for the first column header. Defaults to `"jobId"`. */
|
|
25
|
+
jobIdLabel?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Renders a markdown table plus a `Net: N/M received confirmation email` summary
|
|
29
|
+
* line for a batch run. Returns the formatted string — callers decide how to emit
|
|
30
|
+
* it (process.stdout.write, logger, file, etc.).
|
|
31
|
+
*/
|
|
32
|
+
export declare function renderBatchReport(verdicts: BatchJobVerdict[], opts?: RenderBatchReportOptions): string;
|
|
33
|
+
//# sourceMappingURL=batch-report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-report.d.ts","sourceRoot":"","sources":["../../src/testing/batch-report.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,qEAAqE;AACrE,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,6DAA6D;IAC7D,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,mEAAmE;IACnE,aAAa,EAAE,OAAO,CAAC;IACvB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,wBAAwB;IACvC,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,eAAe,EAAE,EAC3B,IAAI,GAAE,wBAA6B,GAClC,MAAM,CAaR"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Site-agnostic batch-test verdict type and markdown report renderer. Any
|
|
4
|
+
* plugin batch script can populate `BatchJobVerdict[]` and call
|
|
5
|
+
* `renderBatchReport` to get a consistent table + summary without reimplementing
|
|
6
|
+
* the formatting logic. Site-specific fields (employer, reqNum, hospitalState, etc.)
|
|
7
|
+
* stay in the per-site script; only the cross-cutting outcome fields live here.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.renderBatchReport = renderBatchReport;
|
|
11
|
+
/**
|
|
12
|
+
* Renders a markdown table plus a `Net: N/M received confirmation email` summary
|
|
13
|
+
* line for a batch run. Returns the formatted string — callers decide how to emit
|
|
14
|
+
* it (process.stdout.write, logger, file, etc.).
|
|
15
|
+
*/
|
|
16
|
+
function renderBatchReport(verdicts, opts = {}) {
|
|
17
|
+
const jobIdLabel = opts.jobIdLabel ?? "jobId";
|
|
18
|
+
const rows = [
|
|
19
|
+
`| ${jobIdLabel} | submit | dur (s) | email | subject / error |`,
|
|
20
|
+
`|---|---|---|---|---|`,
|
|
21
|
+
...verdicts.map((v) => {
|
|
22
|
+
const dur = v.submitDurationMs != null ? (v.submitDurationMs / 1000).toFixed(1) : "-";
|
|
23
|
+
const detail = v.emailSubject ? v.emailSubject.slice(0, 60) : (v.error ?? "—");
|
|
24
|
+
return `| ${v.jobId} | ${v.submitStatus} | ${dur} | ${v.emailReceived ? "Y" : "N"} | ${detail} |`;
|
|
25
|
+
}),
|
|
26
|
+
];
|
|
27
|
+
const emailCount = verdicts.filter((v) => v.emailReceived).length;
|
|
28
|
+
return `\n${rows.join("\n")}\n\nNet: ${emailCount}/${verdicts.length} received confirmation email\n`;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=batch-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-report.js","sourceRoot":"","sources":["../../src/testing/batch-report.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AA4BH,8CAgBC;AArBD;;;;GAIG;AACH,SAAgB,iBAAiB,CAC/B,QAA2B,EAC3B,OAAiC,EAAE;IAEnC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,OAAO,CAAC;IAC9C,MAAM,IAAI,GAAG;QACX,KAAK,UAAU,iDAAiD;QAChE,uBAAuB;QACvB,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACpB,MAAM,GAAG,GAAG,CAAC,CAAC,gBAAgB,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;YACtF,MAAM,MAAM,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC;YAC/E,OAAO,KAAK,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,YAAY,MAAM,GAAG,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,MAAM,IAAI,CAAC;QACpG,CAAC,CAAC;KACH,CAAC;IACF,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC;IAClE,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,UAAU,IAAI,QAAQ,CAAC,MAAM,gCAAgC,CAAC;AACvG,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Eliminates the duplicated offline schema-parity scaffold that every contract
|
|
3
|
+
* parity test repeats: build canonical payload → assert safeParse succeeds →
|
|
4
|
+
* assert each rejection case (omission, enum violation, etc.) fails with an
|
|
5
|
+
* issue on the expected path. Mirrors the shape of defineReplayIntegrationSuite
|
|
6
|
+
* so adding a parity guard for a new site is a one-call drop-in.
|
|
7
|
+
*/
|
|
8
|
+
import type { SitePluginMeta } from "../site-plugin";
|
|
9
|
+
/** One case that must be rejected by the plugin's bodySchema. */
|
|
10
|
+
export interface ParityRejectionCase {
|
|
11
|
+
/** Human-readable label for the `it` test title. */
|
|
12
|
+
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* Transforms the canonical payload into the invalid variant.
|
|
15
|
+
* The function receives a shallow copy — mutating it in place is safe.
|
|
16
|
+
*/
|
|
17
|
+
mutate: (payload: Record<string, unknown>) => Record<string, unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* When provided, the test asserts that at least one Zod issue has a `path`
|
|
20
|
+
* that includes this element (string or index). Omit when the rejection
|
|
21
|
+
* is asserted solely by `result.success === false`.
|
|
22
|
+
*/
|
|
23
|
+
expectIssuePath?: (string | number)[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Options for `defineContractParitySuite`. Accepting `{ meta: SitePluginMeta }`
|
|
27
|
+
* rather than the generic `SitePlugin<TPayload, TResult>` sidesteps contravariance
|
|
28
|
+
* on `execute(payload: TPayload, …)` — the helper only reads `plugin.meta.bodySchema`.
|
|
29
|
+
*/
|
|
30
|
+
export interface ContractParitySuiteOptions {
|
|
31
|
+
/** Human-readable suite name, passed to `describe`. */
|
|
32
|
+
suiteName: string;
|
|
33
|
+
/** The plugin under test — only `meta.bodySchema` is accessed. */
|
|
34
|
+
plugin: {
|
|
35
|
+
meta: SitePluginMeta;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Returns the canonical, fully-valid payload for the plugin. Called once per
|
|
39
|
+
* test case so each case receives a fresh object.
|
|
40
|
+
*/
|
|
41
|
+
buildPayload: () => Record<string, unknown>;
|
|
42
|
+
/**
|
|
43
|
+
* Cases that must be rejected by `plugin.meta.bodySchema.safeParse`. Each
|
|
44
|
+
* receives a shallow copy of the canonical payload; the `mutate` function
|
|
45
|
+
* introduces exactly one invalid state (field omission, enum violation, etc.).
|
|
46
|
+
*/
|
|
47
|
+
rejectionCases: ParityRejectionCase[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Defines an offline schema-parity suite. Runs unconditionally — no
|
|
51
|
+
* INTEGRATION environment variable needed. The suite has one accept case and
|
|
52
|
+
* one `it` per rejection case.
|
|
53
|
+
*/
|
|
54
|
+
export declare function defineContractParitySuite(opts: ContractParitySuiteOptions): void;
|
|
55
|
+
//# sourceMappingURL=contract-parity-suite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-parity-suite.d.ts","sourceRoot":"","sources":["../../src/testing/contract-parity-suite.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,iEAAiE;AACjE,MAAM,WAAW,mBAAmB;IAClC,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtE;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CACvC;AAED;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,MAAM,EAAE;QAAE,IAAI,EAAE,cAAc,CAAA;KAAE,CAAC;IACjC;;;OAGG;IACH,YAAY,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C;;;;OAIG;IACH,cAAc,EAAE,mBAAmB,EAAE,CAAC;CACvC;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,0BAA0B,GAAG,IAAI,CA+BhF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Eliminates the duplicated offline schema-parity scaffold that every contract
|
|
4
|
+
* parity test repeats: build canonical payload → assert safeParse succeeds →
|
|
5
|
+
* assert each rejection case (omission, enum violation, etc.) fails with an
|
|
6
|
+
* issue on the expected path. Mirrors the shape of defineReplayIntegrationSuite
|
|
7
|
+
* so adding a parity guard for a new site is a one-call drop-in.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.defineContractParitySuite = defineContractParitySuite;
|
|
11
|
+
const vitest_1 = require("vitest");
|
|
12
|
+
/**
|
|
13
|
+
* Defines an offline schema-parity suite. Runs unconditionally — no
|
|
14
|
+
* INTEGRATION environment variable needed. The suite has one accept case and
|
|
15
|
+
* one `it` per rejection case.
|
|
16
|
+
*/
|
|
17
|
+
function defineContractParitySuite(opts) {
|
|
18
|
+
const { suiteName, plugin, buildPayload, rejectionCases } = opts;
|
|
19
|
+
const schema = plugin.meta.bodySchema;
|
|
20
|
+
(0, vitest_1.describe)(suiteName, () => {
|
|
21
|
+
(0, vitest_1.it)("accepts the canonical payload", () => {
|
|
22
|
+
const result = schema.safeParse(buildPayload());
|
|
23
|
+
(0, vitest_1.expect)(result.success, result.success ? "" : JSON.stringify(result.error)).toBe(true);
|
|
24
|
+
});
|
|
25
|
+
for (const rc of rejectionCases) {
|
|
26
|
+
(0, vitest_1.it)(`rejects: ${rc.name}`, () => {
|
|
27
|
+
const mutated = rc.mutate({ ...buildPayload() });
|
|
28
|
+
const result = schema.safeParse(mutated);
|
|
29
|
+
(0, vitest_1.expect)(result.success).toBe(false);
|
|
30
|
+
if (!result.success && rc.expectIssuePath !== undefined) {
|
|
31
|
+
const path = rc.expectIssuePath;
|
|
32
|
+
const hit = result.error.issues.find((issue) => path.every((segment) => issue.path.includes(segment)));
|
|
33
|
+
(0, vitest_1.expect)(hit, `expected an issue whose path includes ${JSON.stringify(path)}, got: ${JSON.stringify(result.error.issues.map((i) => i.path))}`).toBeDefined();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=contract-parity-suite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-parity-suite.js","sourceRoot":"","sources":["../../src/testing/contract-parity-suite.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAmDH,8DA+BC;AAhFD,mCAA8C;AA4C9C;;;;GAIG;AACH,SAAgB,yBAAyB,CAAC,IAAgC;IACxE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IACjE,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;IAEtC,IAAA,iBAAQ,EAAC,SAAS,EAAE,GAAG,EAAE;QACvB,IAAA,WAAE,EAAC,+BAA+B,EAAE,GAAG,EAAE;YACvC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC,CAAC;YAChD,IAAA,eAAM,EACJ,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAE,MAA6B,CAAC,KAAK,CAAC,CAC3E,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACf,CAAC,CAAC,CAAC;QAEH,KAAK,MAAM,EAAE,IAAI,cAAc,EAAE,CAAC;YAChC,IAAA,WAAE,EAAC,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE;gBAC7B,MAAM,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,YAAY,EAAE,EAAE,CAAC,CAAC;gBACjD,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;gBACzC,IAAA,eAAM,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACnC,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;oBACxD,MAAM,IAAI,GAAG,EAAE,CAAC,eAAe,CAAC;oBAChC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAC7C,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CACtD,CAAC;oBACF,IAAA,eAAM,EACJ,GAAG,EACH,yCAAyC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAChI,CAAC,WAAW,EAAE,CAAC;gBAClB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides a registry-driven structural coverage guard for site plugins.
|
|
3
|
+
* Mirrors the registry-first design of the loader: iterates SITE_PLUGINS (or a
|
|
4
|
+
* caller-supplied stub) and asserts that each registered plugin has its required
|
|
5
|
+
* co-located test file — without hardcoding any site name. Safe to run on main
|
|
6
|
+
* where SITE_PLUGINS ships empty (0 iterations → trivially green); branches that
|
|
7
|
+
* populate the registry gain coverage automatically.
|
|
8
|
+
*/
|
|
9
|
+
/** Minimal plugin shape required by the guard — only `meta.siteId` is needed. */
|
|
10
|
+
export interface CoverageGuardPlugin {
|
|
11
|
+
meta: {
|
|
12
|
+
siteId: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface CoverageGuardSuiteOptions {
|
|
16
|
+
/** Human-readable suite name, passed to `describe`. */
|
|
17
|
+
suiteName: string;
|
|
18
|
+
/**
|
|
19
|
+
* Registry of plugins to guard. Pass `SITE_PLUGINS` from the loader for
|
|
20
|
+
* production coverage, or a stub array in unit tests.
|
|
21
|
+
*/
|
|
22
|
+
plugins: CoverageGuardPlugin[];
|
|
23
|
+
/**
|
|
24
|
+
* Absolute path to the directory that contains one sub-folder per siteId.
|
|
25
|
+
* Typically `resolve(__dirname, '../sites')` from the caller's test file.
|
|
26
|
+
*/
|
|
27
|
+
sitesDir: string;
|
|
28
|
+
/**
|
|
29
|
+
* Optional predicate that, when provided, is invoked once per plugin to
|
|
30
|
+
* register additional `it` assertions beyond the mandatory
|
|
31
|
+
* `contract.parity.test.ts` existence check. Defaults to no extra assertions.
|
|
32
|
+
* The predicate receives the resolved plugin directory path and the siteId.
|
|
33
|
+
*/
|
|
34
|
+
extraAssertions?: (pluginDir: string, siteId: string) => void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Defines a registry-driven structural coverage guard. For each plugin in
|
|
38
|
+
* `opts.plugins`, registers an `it` that asserts
|
|
39
|
+
* `<sitesDir>/<siteId>/contract.parity.test.ts` exists. Given an empty
|
|
40
|
+
* registry, registers no assertions (always green). The optional
|
|
41
|
+
* `extraAssertions` predicate allows callers to attach additional per-plugin
|
|
42
|
+
* `it` blocks (e.g. integration test file or replay fixture presence) without
|
|
43
|
+
* baking site-specific logic into the engine helper.
|
|
44
|
+
*/
|
|
45
|
+
export declare function defineCoverageGuardSuite(opts: CoverageGuardSuiteOptions): void;
|
|
46
|
+
//# sourceMappingURL=coverage-guard-suite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coverage-guard-suite.d.ts","sourceRoot":"","sources":["../../src/testing/coverage-guard-suite.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,iFAAiF;AACjF,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1B;AAED,MAAM,WAAW,yBAAyB;IACxC,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,yBAAyB,GAAG,IAAI,CAoB9E"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Provides a registry-driven structural coverage guard for site plugins.
|
|
4
|
+
* Mirrors the registry-first design of the loader: iterates SITE_PLUGINS (or a
|
|
5
|
+
* caller-supplied stub) and asserts that each registered plugin has its required
|
|
6
|
+
* co-located test file — without hardcoding any site name. Safe to run on main
|
|
7
|
+
* where SITE_PLUGINS ships empty (0 iterations → trivially green); branches that
|
|
8
|
+
* populate the registry gain coverage automatically.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.defineCoverageGuardSuite = defineCoverageGuardSuite;
|
|
12
|
+
const node_fs_1 = require("node:fs");
|
|
13
|
+
const node_path_1 = require("node:path");
|
|
14
|
+
const vitest_1 = require("vitest");
|
|
15
|
+
/**
|
|
16
|
+
* Defines a registry-driven structural coverage guard. For each plugin in
|
|
17
|
+
* `opts.plugins`, registers an `it` that asserts
|
|
18
|
+
* `<sitesDir>/<siteId>/contract.parity.test.ts` exists. Given an empty
|
|
19
|
+
* registry, registers no assertions (always green). The optional
|
|
20
|
+
* `extraAssertions` predicate allows callers to attach additional per-plugin
|
|
21
|
+
* `it` blocks (e.g. integration test file or replay fixture presence) without
|
|
22
|
+
* baking site-specific logic into the engine helper.
|
|
23
|
+
*/
|
|
24
|
+
function defineCoverageGuardSuite(opts) {
|
|
25
|
+
const { suiteName, plugins, sitesDir, extraAssertions } = opts;
|
|
26
|
+
if (plugins.length === 0)
|
|
27
|
+
return;
|
|
28
|
+
(0, vitest_1.describe)(suiteName, () => {
|
|
29
|
+
for (const plugin of plugins) {
|
|
30
|
+
const { siteId } = plugin.meta;
|
|
31
|
+
const pluginDir = (0, node_path_1.resolve)(sitesDir, siteId);
|
|
32
|
+
(0, vitest_1.it)(`${siteId}: contract.parity.test.ts exists`, () => {
|
|
33
|
+
(0, vitest_1.expect)((0, node_fs_1.existsSync)((0, node_path_1.resolve)(pluginDir, "contract.parity.test.ts")), `${siteId}/contract.parity.test.ts must exist`).toBe(true);
|
|
34
|
+
});
|
|
35
|
+
extraAssertions?.(pluginDir, siteId);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=coverage-guard-suite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coverage-guard-suite.js","sourceRoot":"","sources":["../../src/testing/coverage-guard-suite.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AA2CH,4DAoBC;AA7DD,qCAAqC;AACrC,yCAAoC;AAEpC,mCAA8C;AA6B9C;;;;;;;;GAQG;AACH,SAAgB,wBAAwB,CAAC,IAA+B;IACtE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC;IAE/D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAEjC,IAAA,iBAAQ,EAAC,SAAS,EAAE,GAAG,EAAE;QACvB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;YAC/B,MAAM,SAAS,GAAG,IAAA,mBAAO,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAE5C,IAAA,WAAE,EAAC,GAAG,MAAM,kCAAkC,EAAE,GAAG,EAAE;gBACnD,IAAA,eAAM,EACJ,IAAA,oBAAU,EAAC,IAAA,mBAAO,EAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC,EACzD,GAAG,MAAM,qCAAqC,CAC/C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACf,CAAC,CAAC,CAAC;YAEH,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QACvC,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
%PDF-1.4
|
|
2
|
+
%����
|
|
3
|
+
1 0 obj
|
|
4
|
+
<< /Type /Catalog /Pages 2 0 R >>
|
|
5
|
+
endobj
|
|
6
|
+
2 0 obj
|
|
7
|
+
<< /Type /Pages /Kids [3 0 R] /Count 1 >>
|
|
8
|
+
endobj
|
|
9
|
+
3 0 obj
|
|
10
|
+
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Contents 4 0 R /Resources << /Font << /F1 5 0 R >> >> >>
|
|
11
|
+
endobj
|
|
12
|
+
4 0 obj
|
|
13
|
+
<< /Length 363 >>
|
|
14
|
+
stream
|
|
15
|
+
BT
|
|
16
|
+
/F1 14 Tf
|
|
17
|
+
50 740 Td
|
|
18
|
+
(Maximo Tableta) Tj
|
|
19
|
+
0 -25 Td
|
|
20
|
+
(Resume) Tj
|
|
21
|
+
0 -30 Td
|
|
22
|
+
/F1 10 Tf
|
|
23
|
+
(Email: vibrasmeditationdev@gmail.com) Tj
|
|
24
|
+
0 -15 Td
|
|
25
|
+
(Phone: 555-867-5309) Tj
|
|
26
|
+
0 -25 Td
|
|
27
|
+
(EXPERIENCE) Tj
|
|
28
|
+
0 -15 Td
|
|
29
|
+
(Test Candidate, 2020-present) Tj
|
|
30
|
+
0 -15 Td
|
|
31
|
+
( - Automated form submission specialist) Tj
|
|
32
|
+
0 -25 Td
|
|
33
|
+
(SKILLS) Tj
|
|
34
|
+
0 -15 Td
|
|
35
|
+
( - Filling out fields with correct values) Tj
|
|
36
|
+
ET
|
|
37
|
+
endstream
|
|
38
|
+
endobj
|
|
39
|
+
5 0 obj
|
|
40
|
+
<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>
|
|
41
|
+
endobj
|
|
42
|
+
xref
|
|
43
|
+
0 6
|
|
44
|
+
0000000000 65535 f
|
|
45
|
+
0000000015 00000 n
|
|
46
|
+
0000000064 00000 n
|
|
47
|
+
0000000121 00000 n
|
|
48
|
+
0000000247 00000 n
|
|
49
|
+
0000000660 00000 n
|
|
50
|
+
trailer
|
|
51
|
+
<< /Size 6 /Root 1 0 R >>
|
|
52
|
+
startxref
|
|
53
|
+
730
|
|
54
|
+
%%EOF
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Site-agnostic scaffold for integration tests that submit via a plugin and
|
|
3
|
+
* verify success by polling a testmail.app inbox. Each integration test owns
|
|
4
|
+
* its per-job payload mapping; this module owns the orchestration that is
|
|
5
|
+
* identical across every site: allocate inbox → build context → dispatch →
|
|
6
|
+
* poll → return.
|
|
7
|
+
*/
|
|
8
|
+
import type { SitePlugin, SitePluginResult } from "../site-plugin";
|
|
9
|
+
import { allocateTestmailInbox, type PollTestmailInboxOptions, type TestmailInbox, type TestmailMessage } from "../testmail/client";
|
|
10
|
+
/**
|
|
11
|
+
* Options accepted by `runIntegrationJob`. The payload builder is the only
|
|
12
|
+
* per-site concern — everything else (inbox allocation, context construction,
|
|
13
|
+
* dispatch, poll) is generic.
|
|
14
|
+
*/
|
|
15
|
+
export interface IntegrationJobOptions {
|
|
16
|
+
/**
|
|
17
|
+
* The plugin under test. Cast via `as SitePlugin<unknown, unknown>` at the
|
|
18
|
+
* call site when the payload type is site-specific.
|
|
19
|
+
*/
|
|
20
|
+
plugin: SitePlugin<unknown, unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* Called with the freshly allocated testmail inbox so the caller can embed
|
|
23
|
+
* `inbox.address` in the site-specific payload fields (e.g. `Email`,
|
|
24
|
+
* `ContactEmailAddress`). Returns the complete payload to pass to dispatch.
|
|
25
|
+
*/
|
|
26
|
+
buildPayload: (inbox: TestmailInbox) => unknown;
|
|
27
|
+
/**
|
|
28
|
+
* The `baseUrl` injected into the plugin context. Typically `job.baseUrl`
|
|
29
|
+
* from the replay-jobs fixture.
|
|
30
|
+
*/
|
|
31
|
+
baseUrl: string;
|
|
32
|
+
/** Total wait budget passed to `pollTestmailInbox`. Default 120_000 ms. */
|
|
33
|
+
pollTimeoutMs?: number;
|
|
34
|
+
/** Optional subject filter passed to `pollTestmailInbox`. Omit to accept any message. */
|
|
35
|
+
pollSubjectContains?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Override for inbox allocation options (e.g. `namespace` in tests that
|
|
38
|
+
* stub testmail without a real TESTMAIL_NAMESPACE in env).
|
|
39
|
+
*/
|
|
40
|
+
inboxOptions?: Parameters<typeof allocateTestmailInbox>[0];
|
|
41
|
+
/**
|
|
42
|
+
* Override the `pollTestmailInbox` implementation. Injected by unit tests
|
|
43
|
+
* to avoid real network calls.
|
|
44
|
+
*/
|
|
45
|
+
pollFn?: (opts: PollTestmailInboxOptions) => Promise<TestmailMessage>;
|
|
46
|
+
}
|
|
47
|
+
/** Combined return value so callers can inspect both the dispatch result and the inbox message. */
|
|
48
|
+
export interface IntegrationJobResult<TResult> {
|
|
49
|
+
result: SitePluginResult<TResult>;
|
|
50
|
+
message: TestmailMessage;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Runs one integration-test job end-to-end. Allocates a testmail inbox,
|
|
54
|
+
* delegates payload construction to `buildPayload`, dispatches the plugin,
|
|
55
|
+
* and polls for a confirmation email — returning both the dispatch result and
|
|
56
|
+
* the received message so callers can make assertions on either.
|
|
57
|
+
*
|
|
58
|
+
* Throws when dispatch rejects or when the inbox poll times out (via
|
|
59
|
+
* `TestmailTimeoutError`).
|
|
60
|
+
*/
|
|
61
|
+
export declare function runIntegrationJob<TResult = Record<string, unknown>>(opts: IntegrationJobOptions): Promise<IntegrationJobResult<TResult>>;
|
|
62
|
+
//# sourceMappingURL=integration-runner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-runner.d.ts","sourceRoot":"","sources":["../../src/testing/integration-runner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EACL,qBAAqB,EACrB,KAAK,wBAAwB,EAE7B,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,mBAAmB,CAAC;AAI3B;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,MAAM,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACrC;;;;OAIG;IACH,YAAY,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC;IAChD;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yFAAyF;IACzF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;OAGG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,wBAAwB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;CACvE;AAED,mGAAmG;AACnG,MAAM,WAAW,oBAAoB,CAAC,OAAO;IAC3C,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvE,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAgCxC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Site-agnostic scaffold for integration tests that submit via a plugin and
|
|
4
|
+
* verify success by polling a testmail.app inbox. Each integration test owns
|
|
5
|
+
* its per-job payload mapping; this module owns the orchestration that is
|
|
6
|
+
* identical across every site: allocate inbox → build context → dispatch →
|
|
7
|
+
* poll → return.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.runIntegrationJob = runIntegrationJob;
|
|
11
|
+
const config_1 = require("../config");
|
|
12
|
+
const dispatch_metrics_1 = require("../lib/dispatch-metrics");
|
|
13
|
+
const logging_1 = require("../lib/logging");
|
|
14
|
+
const loader_1 = require("../plugins/loader");
|
|
15
|
+
const client_1 = require("../testmail/client");
|
|
16
|
+
const DEFAULT_POLL_TIMEOUT_MS = 120_000;
|
|
17
|
+
/**
|
|
18
|
+
* Runs one integration-test job end-to-end. Allocates a testmail inbox,
|
|
19
|
+
* delegates payload construction to `buildPayload`, dispatches the plugin,
|
|
20
|
+
* and polls for a confirmation email — returning both the dispatch result and
|
|
21
|
+
* the received message so callers can make assertions on either.
|
|
22
|
+
*
|
|
23
|
+
* Throws when dispatch rejects or when the inbox poll times out (via
|
|
24
|
+
* `TestmailTimeoutError`).
|
|
25
|
+
*/
|
|
26
|
+
async function runIntegrationJob(opts) {
|
|
27
|
+
const { plugin, buildPayload, baseUrl, pollTimeoutMs = DEFAULT_POLL_TIMEOUT_MS, pollSubjectContains, inboxOptions, pollFn = client_1.pollTestmailInbox, } = opts;
|
|
28
|
+
const logger = (0, logging_1.getLogger)({ name: `integration/${plugin.meta.siteId}` });
|
|
29
|
+
const inbox = (0, client_1.allocateTestmailInbox)(inboxOptions);
|
|
30
|
+
const payload = buildPayload(inbox);
|
|
31
|
+
const context = {
|
|
32
|
+
baseUrl,
|
|
33
|
+
logger,
|
|
34
|
+
config: config_1.config,
|
|
35
|
+
requestId: "integration-test",
|
|
36
|
+
metricsCollector: new dispatch_metrics_1.MetricsCollector(),
|
|
37
|
+
};
|
|
38
|
+
const result = await (0, loader_1.dispatch)(plugin, payload, context);
|
|
39
|
+
const message = await pollFn({
|
|
40
|
+
inbox,
|
|
41
|
+
timeoutMs: pollTimeoutMs,
|
|
42
|
+
...(pollSubjectContains ? { subjectContains: pollSubjectContains } : {}),
|
|
43
|
+
});
|
|
44
|
+
return { result, message };
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=integration-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-runner.js","sourceRoot":"","sources":["../../src/testing/integration-runner.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAsEH,8CAkCC;AAtGD,qCAAkC;AAClC,6DAA0D;AAC1D,2CAA0C;AAC1C,6CAA4C;AAE5C,8CAM2B;AAE3B,MAAM,uBAAuB,GAAG,OAAO,CAAC;AA8CxC;;;;;;;;GAQG;AACI,KAAK,UAAU,iBAAiB,CACrC,IAA2B;IAE3B,MAAM,EACJ,MAAM,EACN,YAAY,EACZ,OAAO,EACP,aAAa,GAAG,uBAAuB,EACvC,mBAAmB,EACnB,YAAY,EACZ,MAAM,GAAG,0BAAiB,GAC3B,GAAG,IAAI,CAAC;IAET,MAAM,MAAM,GAAG,IAAA,mBAAS,EAAC,EAAE,IAAI,EAAE,eAAe,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACxE,MAAM,KAAK,GAAG,IAAA,8BAAqB,EAAC,YAAY,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAEpC,MAAM,OAAO,GAAG;QACd,OAAO;QACP,MAAM;QACN,MAAM,EAAN,eAAM;QACN,SAAS,EAAE,kBAAkB;QAC7B,gBAAgB,EAAE,IAAI,mCAAgB,EAAE;KACzC,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,IAAA,iBAAQ,EAAU,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAEjE,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC;QAC3B,KAAK;QACL,SAAS,EAAE,aAAa;QACxB,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzE,CAAC,CAAC;IAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { fetch as undiciFetch } from "undici";
|
|
2
|
+
/**
|
|
3
|
+
* Centralises the undici-compatible Response stub so every flow test stops
|
|
4
|
+
* hand-rolling its own makeResponse with an inconsistent method surface.
|
|
5
|
+
*/
|
|
6
|
+
export declare function makeMockFetchResponse(status: number, body: string, headers?: Record<string, string>): Awaited<ReturnType<typeof undiciFetch>>;
|
|
7
|
+
//# sourceMappingURL=mock-fetch-response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-fetch-response.d.ts","sourceRoot":"","sources":["../../src/testing/mock-fetch-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACnC,OAAO,CAAC,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAOzC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeMockFetchResponse = makeMockFetchResponse;
|
|
4
|
+
/**
|
|
5
|
+
* Centralises the undici-compatible Response stub so every flow test stops
|
|
6
|
+
* hand-rolling its own makeResponse with an inconsistent method surface.
|
|
7
|
+
*/
|
|
8
|
+
function makeMockFetchResponse(status, body, headers = {}) {
|
|
9
|
+
return {
|
|
10
|
+
status,
|
|
11
|
+
headers: new Headers(headers),
|
|
12
|
+
text: () => Promise.resolve(body),
|
|
13
|
+
json: () => Promise.resolve(JSON.parse(body)),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=mock-fetch-response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-fetch-response.js","sourceRoot":"","sources":["../../src/testing/mock-fetch-response.ts"],"names":[],"mappings":";;AAMA,sDAWC;AAfD;;;GAGG;AACH,SAAgB,qBAAqB,CACnC,MAAc,EACd,IAAY,EACZ,UAAkC,EAAE;IAEpC,OAAO;QACL,MAAM;QACN,OAAO,EAAE,IAAI,OAAO,CAAC,OAAO,CAAC;QAC7B,IAAI,EAAE,GAAoB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;QAClD,IAAI,EAAE,GAAqB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;KACV,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard test persona used by recon runs + integration tests. Centralised
|
|
3
|
+
* so every plugin uses the same identity (helps cross-site audit-log
|
|
4
|
+
* correlation) and so we change it in one place when a field gets rejected
|
|
5
|
+
* by a new validator (e.g. the 555 → 310 phone-number swap during the
|
|
6
|
+
* AppCast recon investigation).
|
|
7
|
+
*
|
|
8
|
+
* The Email field is intentionally omitted — callers should compose the
|
|
9
|
+
* payload by combining this fixture with a freshly allocated testmail.app
|
|
10
|
+
* address. See `src/testmail/client.ts:allocateTestmailInbox`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const TEST_PERSONA: {
|
|
13
|
+
readonly FirstName: "Reginald";
|
|
14
|
+
readonly LastName: "Reconaldo";
|
|
15
|
+
/**
|
|
16
|
+
* Avoid both the 555 fictional range AND famously-fictional numbers like
|
|
17
|
+
* 310-867-5309 ("Jenny / 867-5309" pop-song). Some ATS phone-input
|
|
18
|
+
* widgets reject both with "Please provide correct phone number."
|
|
19
|
+
*
|
|
20
|
+
* 208-377-2156: Boise area code, random NXX-XXXX, no known
|
|
21
|
+
* pop-culture meaning.
|
|
22
|
+
*/
|
|
23
|
+
readonly Phone: "+1 208-377-2156";
|
|
24
|
+
readonly Address: {
|
|
25
|
+
readonly Line1: "123 Test Lane";
|
|
26
|
+
readonly City: "Austin";
|
|
27
|
+
/** Two-letter region code for forms that want abbreviations. */
|
|
28
|
+
readonly StateAbbreviation: "TX";
|
|
29
|
+
/** Full state name for forms that want the long form (e.g. ClearCompany). */
|
|
30
|
+
readonly StateName: "Texas";
|
|
31
|
+
readonly PostalCode: "78701";
|
|
32
|
+
/** Texas county for Austin. Required by tenants (Encompass Health, etc.)
|
|
33
|
+
* that nest a County field inside the Address group. */
|
|
34
|
+
readonly County: "Travis County";
|
|
35
|
+
/** Long-form for `<select>`s that show country names. */
|
|
36
|
+
readonly CountryName: "United States";
|
|
37
|
+
/** Two-letter code for ISO-3166-style inputs. */
|
|
38
|
+
readonly CountryCode: "US";
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Throwaway values for forms that require SSN / DOB even for testing.
|
|
42
|
+
* 123-45-6789 is a documented IRS test SSN; 01/01/1990 is a stable adult
|
|
43
|
+
* birthday that won't trip age-bracket validators.
|
|
44
|
+
*/
|
|
45
|
+
readonly Ssn: "123-45-6789";
|
|
46
|
+
readonly DateOfBirth: "01/01/1990";
|
|
47
|
+
/** Generic employment row used to fill required Employment History sections. */
|
|
48
|
+
readonly Employment: {
|
|
49
|
+
readonly Title: "Automation Testing Specialist";
|
|
50
|
+
readonly CompanyName: "Self-employed";
|
|
51
|
+
readonly CompanyPhone: "+1 310-867-5311";
|
|
52
|
+
readonly StartDate: "01/01/2020";
|
|
53
|
+
readonly EndDate: "12/31/2025";
|
|
54
|
+
readonly PositionDescription: "Designed and executed automated browser testing workflows for healthcare application portals";
|
|
55
|
+
};
|
|
56
|
+
/** Three reference rows used by ClearCompany and similar ATSes that ask for them. */
|
|
57
|
+
readonly References: readonly [{
|
|
58
|
+
readonly FirstName: "Pat";
|
|
59
|
+
readonly LastName: "Smith";
|
|
60
|
+
readonly Email: "pat.smith.ref@example.com";
|
|
61
|
+
readonly Phone: "+1 310-867-5312";
|
|
62
|
+
}, {
|
|
63
|
+
readonly FirstName: "Jamie";
|
|
64
|
+
readonly LastName: "Johnson";
|
|
65
|
+
readonly Email: "jamie.johnson.ref@example.com";
|
|
66
|
+
readonly Phone: "+1 310-867-5313";
|
|
67
|
+
}, {
|
|
68
|
+
readonly FirstName: "Taylor";
|
|
69
|
+
readonly LastName: "Brown";
|
|
70
|
+
readonly Email: "taylor.brown.ref@example.com";
|
|
71
|
+
readonly Phone: "+1 310-867-5314";
|
|
72
|
+
}];
|
|
73
|
+
/** Signature text used in legal-attestation sections. */
|
|
74
|
+
readonly SignatureName: "Reginald Reconaldo";
|
|
75
|
+
};
|
|
76
|
+
export type TestPersona = typeof TEST_PERSONA;
|
|
77
|
+
//# sourceMappingURL=persona-fixture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persona-fixture.d.ts","sourceRoot":"","sources":["../../src/testing/persona-fixture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY;;;IAGvB;;;;;;;OAOG;;;;;QAKD,gEAAgE;;QAEhE,6EAA6E;;;QAG7E;gEACwD;;QAExD,yDAAyD;;QAEzD,iDAAiD;;;IAGnD;;;;OAIG;;;IAGH,gFAAgF;;;;;;;;;IAUhF,qFAAqF;;;;;;;;;;;;;;;;;IAqBrF,yDAAyD;;CAEjD,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,OAAO,YAAY,CAAC"}
|