@inluxc/propmaster 0.0.0-stage → 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 +696 -2
- package/dist/src/annotations/index.d.ts +11 -0
- package/dist/src/annotations/index.d.ts.map +1 -0
- package/dist/src/annotations/index.js +11 -0
- package/dist/src/annotations/index.js.map +1 -0
- package/dist/src/annotations/recorder.d.ts +57 -0
- package/dist/src/annotations/recorder.d.ts.map +1 -0
- package/dist/src/annotations/recorder.js +100 -0
- package/dist/src/annotations/recorder.js.map +1 -0
- package/dist/src/annotations/truncation.d.ts +34 -0
- package/dist/src/annotations/truncation.d.ts.map +1 -0
- package/dist/src/annotations/truncation.js +54 -0
- package/dist/src/annotations/truncation.js.map +1 -0
- package/dist/src/auth/apply.d.ts +15 -0
- package/dist/src/auth/apply.d.ts.map +1 -0
- package/dist/src/auth/apply.js +21 -0
- package/dist/src/auth/apply.js.map +1 -0
- package/dist/src/auth/setup.d.ts +56 -0
- package/dist/src/auth/setup.d.ts.map +1 -0
- package/dist/src/auth/setup.js +79 -0
- package/dist/src/auth/setup.js.map +1 -0
- package/dist/src/auth/state-file.d.ts +8 -0
- package/dist/src/auth/state-file.d.ts.map +1 -0
- package/dist/src/auth/state-file.js +13 -0
- package/dist/src/auth/state-file.js.map +1 -0
- package/dist/src/auth/token-manager.d.ts +61 -0
- package/dist/src/auth/token-manager.d.ts.map +1 -0
- package/dist/src/auth/token-manager.js +200 -0
- package/dist/src/auth/token-manager.js.map +1 -0
- package/dist/src/cli/banner.d.ts +23 -0
- package/dist/src/cli/banner.d.ts.map +1 -0
- package/dist/src/cli/banner.js +67 -0
- package/dist/src/cli/banner.js.map +1 -0
- package/dist/src/cli/check-tests.d.ts +143 -0
- package/dist/src/cli/check-tests.d.ts.map +1 -0
- package/dist/src/cli/check-tests.js +541 -0
- package/dist/src/cli/check-tests.js.map +1 -0
- package/dist/src/cli/coverage.d.ts +14 -0
- package/dist/src/cli/coverage.d.ts.map +1 -0
- package/dist/src/cli/coverage.js +97 -0
- package/dist/src/cli/coverage.js.map +1 -0
- package/dist/src/cli/doctor.d.ts +82 -0
- package/dist/src/cli/doctor.d.ts.map +1 -0
- package/dist/src/cli/doctor.js +656 -0
- package/dist/src/cli/doctor.js.map +1 -0
- package/dist/src/cli/env.d.ts +76 -0
- package/dist/src/cli/env.d.ts.map +1 -0
- package/dist/src/cli/env.js +344 -0
- package/dist/src/cli/env.js.map +1 -0
- package/dist/src/cli/failures.d.ts +29 -0
- package/dist/src/cli/failures.d.ts.map +1 -0
- package/dist/src/cli/failures.js +114 -0
- package/dist/src/cli/failures.js.map +1 -0
- package/dist/src/cli/fixture-catalog.d.ts +83 -0
- package/dist/src/cli/fixture-catalog.d.ts.map +1 -0
- package/dist/src/cli/fixture-catalog.js +773 -0
- package/dist/src/cli/fixture-catalog.js.map +1 -0
- package/dist/src/cli/fixture.d.ts +149 -0
- package/dist/src/cli/fixture.d.ts.map +1 -0
- package/dist/src/cli/fixture.js +742 -0
- package/dist/src/cli/fixture.js.map +1 -0
- package/dist/src/cli/flaky.d.ts +25 -0
- package/dist/src/cli/flaky.d.ts.map +1 -0
- package/dist/src/cli/flaky.js +96 -0
- package/dist/src/cli/flaky.js.map +1 -0
- package/dist/src/cli/generate.d.ts +37 -0
- package/dist/src/cli/generate.d.ts.map +1 -0
- package/dist/src/cli/generate.js +230 -0
- package/dist/src/cli/generate.js.map +1 -0
- package/dist/src/cli/init.d.ts +36 -0
- package/dist/src/cli/init.d.ts.map +1 -0
- package/dist/src/cli/init.js +1039 -0
- package/dist/src/cli/init.js.map +1 -0
- package/dist/src/cli/json-edit.d.ts +58 -0
- package/dist/src/cli/json-edit.d.ts.map +1 -0
- package/dist/src/cli/json-edit.js +250 -0
- package/dist/src/cli/json-edit.js.map +1 -0
- package/dist/src/cli/layout.d.ts +31 -0
- package/dist/src/cli/layout.d.ts.map +1 -0
- package/dist/src/cli/layout.js +175 -0
- package/dist/src/cli/layout.js.map +1 -0
- package/dist/src/cli/mcp-setup.d.ts +141 -0
- package/dist/src/cli/mcp-setup.d.ts.map +1 -0
- package/dist/src/cli/mcp-setup.js +548 -0
- package/dist/src/cli/mcp-setup.js.map +1 -0
- package/dist/src/cli/organize.d.ts +136 -0
- package/dist/src/cli/organize.d.ts.map +1 -0
- package/dist/src/cli/organize.js +467 -0
- package/dist/src/cli/organize.js.map +1 -0
- package/dist/src/cli/prompts.d.ts +102 -0
- package/dist/src/cli/prompts.d.ts.map +1 -0
- package/dist/src/cli/prompts.js +346 -0
- package/dist/src/cli/prompts.js.map +1 -0
- package/dist/src/cli/standards.d.ts +160 -0
- package/dist/src/cli/standards.d.ts.map +1 -0
- package/dist/src/cli/standards.js +389 -0
- package/dist/src/cli/standards.js.map +1 -0
- package/dist/src/cli/style.d.ts +28 -0
- package/dist/src/cli/style.d.ts.map +1 -0
- package/dist/src/cli/style.js +57 -0
- package/dist/src/cli/style.js.map +1 -0
- package/dist/src/config/env-loader.d.ts +33 -0
- package/dist/src/config/env-loader.d.ts.map +1 -0
- package/dist/src/config/env-loader.js +72 -0
- package/dist/src/config/env-loader.js.map +1 -0
- package/dist/src/config/index.d.ts +10 -0
- package/dist/src/config/index.d.ts.map +1 -0
- package/dist/src/config/index.js +10 -0
- package/dist/src/config/index.js.map +1 -0
- package/dist/src/config/loader.d.ts +66 -0
- package/dist/src/config/loader.d.ts.map +1 -0
- package/dist/src/config/loader.js +810 -0
- package/dist/src/config/loader.js.map +1 -0
- package/dist/src/config/schema.d.ts +596 -0
- package/dist/src/config/schema.d.ts.map +1 -0
- package/dist/src/config/schema.js +9 -0
- package/dist/src/config/schema.js.map +1 -0
- package/dist/src/containers/container-manager.d.ts +157 -0
- package/dist/src/containers/container-manager.d.ts.map +1 -0
- package/dist/src/containers/container-manager.js +627 -0
- package/dist/src/containers/container-manager.js.map +1 -0
- package/dist/src/coverage/code-coverage.d.ts +89 -0
- package/dist/src/coverage/code-coverage.d.ts.map +1 -0
- package/dist/src/coverage/code-coverage.js +395 -0
- package/dist/src/coverage/code-coverage.js.map +1 -0
- package/dist/src/coverage/inventory.d.ts +80 -0
- package/dist/src/coverage/inventory.d.ts.map +1 -0
- package/dist/src/coverage/inventory.js +417 -0
- package/dist/src/coverage/inventory.js.map +1 -0
- package/dist/src/coverage/languages.d.ts +34 -0
- package/dist/src/coverage/languages.d.ts.map +1 -0
- package/dist/src/coverage/languages.js +156 -0
- package/dist/src/coverage/languages.js.map +1 -0
- package/dist/src/coverage/report.d.ts +128 -0
- package/dist/src/coverage/report.d.ts.map +1 -0
- package/dist/src/coverage/report.js +472 -0
- package/dist/src/coverage/report.js.map +1 -0
- package/dist/src/errors.d.ts +164 -0
- package/dist/src/errors.d.ts.map +1 -0
- package/dist/src/errors.js +267 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/fixtures/amqp.fixture.d.ts +163 -0
- package/dist/src/fixtures/amqp.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/amqp.fixture.js +494 -0
- package/dist/src/fixtures/amqp.fixture.js.map +1 -0
- package/dist/src/fixtures/appium.fixture.d.ts +112 -0
- package/dist/src/fixtures/appium.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/appium.fixture.js +309 -0
- package/dist/src/fixtures/appium.fixture.js.map +1 -0
- package/dist/src/fixtures/aws.d.ts +44 -0
- package/dist/src/fixtures/aws.d.ts.map +1 -0
- package/dist/src/fixtures/aws.js +93 -0
- package/dist/src/fixtures/aws.js.map +1 -0
- package/dist/src/fixtures/cassandra.fixture.d.ts +179 -0
- package/dist/src/fixtures/cassandra.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/cassandra.fixture.js +489 -0
- package/dist/src/fixtures/cassandra.fixture.js.map +1 -0
- package/dist/src/fixtures/clickhouse.fixture.d.ts +171 -0
- package/dist/src/fixtures/clickhouse.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/clickhouse.fixture.js +514 -0
- package/dist/src/fixtures/clickhouse.fixture.js.map +1 -0
- package/dist/src/fixtures/database.fixture.d.ts +63 -0
- package/dist/src/fixtures/database.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/database.fixture.js +407 -0
- package/dist/src/fixtures/database.fixture.js.map +1 -0
- package/dist/src/fixtures/dynamodb.fixture.d.ts +243 -0
- package/dist/src/fixtures/dynamodb.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/dynamodb.fixture.js +580 -0
- package/dist/src/fixtures/dynamodb.fixture.js.map +1 -0
- package/dist/src/fixtures/graphql.fixture.d.ts +107 -0
- package/dist/src/fixtures/graphql.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/graphql.fixture.js +158 -0
- package/dist/src/fixtures/graphql.fixture.js.map +1 -0
- package/dist/src/fixtures/grpc.fixture.d.ts +167 -0
- package/dist/src/fixtures/grpc.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/grpc.fixture.js +635 -0
- package/dist/src/fixtures/grpc.fixture.js.map +1 -0
- package/dist/src/fixtures/inbox.fixture.d.ts +136 -0
- package/dist/src/fixtures/inbox.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/inbox.fixture.js +239 -0
- package/dist/src/fixtures/inbox.fixture.js.map +1 -0
- package/dist/src/fixtures/index.d.ts +174 -0
- package/dist/src/fixtures/index.d.ts.map +1 -0
- package/dist/src/fixtures/index.js +370 -0
- package/dist/src/fixtures/index.js.map +1 -0
- package/dist/src/fixtures/kafka-driver.d.ts +108 -0
- package/dist/src/fixtures/kafka-driver.d.ts.map +1 -0
- package/dist/src/fixtures/kafka-driver.js +113 -0
- package/dist/src/fixtures/kafka-driver.js.map +1 -0
- package/dist/src/fixtures/kafka.fixture.d.ts +75 -0
- package/dist/src/fixtures/kafka.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/kafka.fixture.js +188 -0
- package/dist/src/fixtures/kafka.fixture.js.map +1 -0
- package/dist/src/fixtures/mock-server.fixture.d.ts +142 -0
- package/dist/src/fixtures/mock-server.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/mock-server.fixture.js +271 -0
- package/dist/src/fixtures/mock-server.fixture.js.map +1 -0
- package/dist/src/fixtures/mongodb.fixture.d.ts +121 -0
- package/dist/src/fixtures/mongodb.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/mongodb.fixture.js +258 -0
- package/dist/src/fixtures/mongodb.fixture.js.map +1 -0
- package/dist/src/fixtures/neo4j.fixture.d.ts +72 -0
- package/dist/src/fixtures/neo4j.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/neo4j.fixture.js +202 -0
- package/dist/src/fixtures/neo4j.fixture.js.map +1 -0
- package/dist/src/fixtures/openapi.fixture.d.ts +101 -0
- package/dist/src/fixtures/openapi.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/openapi.fixture.js +266 -0
- package/dist/src/fixtures/openapi.fixture.js.map +1 -0
- package/dist/src/fixtures/optional-package.d.ts +54 -0
- package/dist/src/fixtures/optional-package.d.ts.map +1 -0
- package/dist/src/fixtures/optional-package.js +79 -0
- package/dist/src/fixtures/optional-package.js.map +1 -0
- package/dist/src/fixtures/otp.fixture.d.ts +60 -0
- package/dist/src/fixtures/otp.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/otp.fixture.js +101 -0
- package/dist/src/fixtures/otp.fixture.js.map +1 -0
- package/dist/src/fixtures/realtime.fixture.d.ts +205 -0
- package/dist/src/fixtures/realtime.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/realtime.fixture.js +606 -0
- package/dist/src/fixtures/realtime.fixture.js.map +1 -0
- package/dist/src/fixtures/redis.fixture.d.ts +55 -0
- package/dist/src/fixtures/redis.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/redis.fixture.js +209 -0
- package/dist/src/fixtures/redis.fixture.js.map +1 -0
- package/dist/src/fixtures/s3.fixture.d.ts +126 -0
- package/dist/src/fixtures/s3.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/s3.fixture.js +296 -0
- package/dist/src/fixtures/s3.fixture.js.map +1 -0
- package/dist/src/fixtures/search.fixture.d.ts +178 -0
- package/dist/src/fixtures/search.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/search.fixture.js +472 -0
- package/dist/src/fixtures/search.fixture.js.map +1 -0
- package/dist/src/fixtures/sqs.fixture.d.ts +172 -0
- package/dist/src/fixtures/sqs.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/sqs.fixture.js +428 -0
- package/dist/src/fixtures/sqs.fixture.js.map +1 -0
- package/dist/src/index.d.ts +43 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +48 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/mcp/guards.d.ts +21 -0
- package/dist/src/mcp/guards.d.ts.map +1 -0
- package/dist/src/mcp/guards.js +118 -0
- package/dist/src/mcp/guards.js.map +1 -0
- package/dist/src/mcp/project-tools.d.ts +14 -0
- package/dist/src/mcp/project-tools.d.ts.map +1 -0
- package/dist/src/mcp/project-tools.js +252 -0
- package/dist/src/mcp/project-tools.js.map +1 -0
- package/dist/src/mcp/protocol.d.ts +116 -0
- package/dist/src/mcp/protocol.d.ts.map +1 -0
- package/dist/src/mcp/protocol.js +199 -0
- package/dist/src/mcp/protocol.js.map +1 -0
- package/dist/src/mcp/server.d.ts +43 -0
- package/dist/src/mcp/server.d.ts.map +1 -0
- package/dist/src/mcp/server.js +244 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/test-tools.d.ts +65 -0
- package/dist/src/mcp/test-tools.d.ts.map +1 -0
- package/dist/src/mcp/test-tools.js +380 -0
- package/dist/src/mcp/test-tools.js.map +1 -0
- package/dist/src/mcp/tools.d.ts +49 -0
- package/dist/src/mcp/tools.d.ts.map +1 -0
- package/dist/src/mcp/tools.js +726 -0
- package/dist/src/mcp/tools.js.map +1 -0
- package/dist/src/network-error.d.ts +11 -0
- package/dist/src/network-error.d.ts.map +1 -0
- package/dist/src/network-error.js +34 -0
- package/dist/src/network-error.js.map +1 -0
- package/dist/src/openapi/contract.d.ts +98 -0
- package/dist/src/openapi/contract.d.ts.map +1 -0
- package/dist/src/openapi/contract.js +407 -0
- package/dist/src/openapi/contract.js.map +1 -0
- package/dist/src/openapi/generate.d.ts +89 -0
- package/dist/src/openapi/generate.d.ts.map +1 -0
- package/dist/src/openapi/generate.js +607 -0
- package/dist/src/openapi/generate.js.map +1 -0
- package/dist/src/openapi/load.d.ts +8 -0
- package/dist/src/openapi/load.d.ts.map +1 -0
- package/dist/src/openapi/load.js +26 -0
- package/dist/src/openapi/load.js.map +1 -0
- package/dist/src/package-manager.d.ts +58 -0
- package/dist/src/package-manager.d.ts.map +1 -0
- package/dist/src/package-manager.js +137 -0
- package/dist/src/package-manager.js.map +1 -0
- package/dist/src/reporter/history.d.ts +85 -0
- package/dist/src/reporter/history.d.ts.map +1 -0
- package/dist/src/reporter/history.js +147 -0
- package/dist/src/reporter/history.js.map +1 -0
- package/dist/src/reporter/index.d.ts +59 -0
- package/dist/src/reporter/index.d.ts.map +1 -0
- package/dist/src/reporter/index.js +201 -0
- package/dist/src/reporter/index.js.map +1 -0
- package/dist/src/reporter/last-run.d.ts +88 -0
- package/dist/src/reporter/last-run.d.ts.map +1 -0
- package/dist/src/reporter/last-run.js +133 -0
- package/dist/src/reporter/last-run.js.map +1 -0
- package/dist/src/reporter/quarantine.d.ts +62 -0
- package/dist/src/reporter/quarantine.d.ts.map +1 -0
- package/dist/src/reporter/quarantine.js +148 -0
- package/dist/src/reporter/quarantine.js.map +1 -0
- package/dist/src/secrets/index.d.ts +4 -0
- package/dist/src/secrets/index.d.ts.map +1 -0
- package/dist/src/secrets/index.js +3 -0
- package/dist/src/secrets/index.js.map +1 -0
- package/dist/src/secrets/provider.interface.d.ts +30 -0
- package/dist/src/secrets/provider.interface.d.ts.map +1 -0
- package/dist/src/secrets/provider.interface.js +2 -0
- package/dist/src/secrets/provider.interface.js.map +1 -0
- package/dist/src/secrets/providers/aws.provider.d.ts +33 -0
- package/dist/src/secrets/providers/aws.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/aws.provider.js +88 -0
- package/dist/src/secrets/providers/aws.provider.js.map +1 -0
- package/dist/src/secrets/providers/azure.provider.d.ts +26 -0
- package/dist/src/secrets/providers/azure.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/azure.provider.js +71 -0
- package/dist/src/secrets/providers/azure.provider.js.map +1 -0
- package/dist/src/secrets/providers/env-file.provider.d.ts +29 -0
- package/dist/src/secrets/providers/env-file.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/env-file.provider.js +56 -0
- package/dist/src/secrets/providers/env-file.provider.js.map +1 -0
- package/dist/src/secrets/providers/gitlab.provider.d.ts +26 -0
- package/dist/src/secrets/providers/gitlab.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/gitlab.provider.js +67 -0
- package/dist/src/secrets/providers/gitlab.provider.js.map +1 -0
- package/dist/src/secrets/providers/index.d.ts +52 -0
- package/dist/src/secrets/providers/index.d.ts.map +1 -0
- package/dist/src/secrets/providers/index.js +81 -0
- package/dist/src/secrets/providers/index.js.map +1 -0
- package/dist/src/secrets/providers/openbao.provider.d.ts +28 -0
- package/dist/src/secrets/providers/openbao.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/openbao.provider.js +29 -0
- package/dist/src/secrets/providers/openbao.provider.js.map +1 -0
- package/dist/src/secrets/providers/vault-compatible.d.ts +140 -0
- package/dist/src/secrets/providers/vault-compatible.d.ts.map +1 -0
- package/dist/src/secrets/providers/vault-compatible.js +405 -0
- package/dist/src/secrets/providers/vault-compatible.js.map +1 -0
- package/dist/src/secrets/providers/vault.provider.d.ts +27 -0
- package/dist/src/secrets/providers/vault.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/vault.provider.js +23 -0
- package/dist/src/secrets/providers/vault.provider.js.map +1 -0
- package/dist/src/secrets/secrets-manager.d.ts +67 -0
- package/dist/src/secrets/secrets-manager.d.ts.map +1 -0
- package/dist/src/secrets/secrets-manager.js +255 -0
- package/dist/src/secrets/secrets-manager.js.map +1 -0
- package/dist/src/steps/amqp.steps.d.ts +37 -0
- package/dist/src/steps/amqp.steps.d.ts.map +1 -0
- package/dist/src/steps/amqp.steps.js +86 -0
- package/dist/src/steps/amqp.steps.js.map +1 -0
- package/dist/src/steps/appium.steps.d.ts +53 -0
- package/dist/src/steps/appium.steps.d.ts.map +1 -0
- package/dist/src/steps/appium.steps.js +109 -0
- package/dist/src/steps/appium.steps.js.map +1 -0
- package/dist/src/steps/aws.steps.d.ts +47 -0
- package/dist/src/steps/aws.steps.d.ts.map +1 -0
- package/dist/src/steps/aws.steps.js +116 -0
- package/dist/src/steps/aws.steps.js.map +1 -0
- package/dist/src/steps/browser.steps.d.ts +54 -0
- package/dist/src/steps/browser.steps.d.ts.map +1 -0
- package/dist/src/steps/browser.steps.js +102 -0
- package/dist/src/steps/browser.steps.js.map +1 -0
- package/dist/src/steps/cassandra.steps.d.ts +32 -0
- package/dist/src/steps/cassandra.steps.d.ts.map +1 -0
- package/dist/src/steps/cassandra.steps.js +81 -0
- package/dist/src/steps/cassandra.steps.js.map +1 -0
- package/dist/src/steps/clickhouse.steps.d.ts +30 -0
- package/dist/src/steps/clickhouse.steps.d.ts.map +1 -0
- package/dist/src/steps/clickhouse.steps.js +73 -0
- package/dist/src/steps/clickhouse.steps.js.map +1 -0
- package/dist/src/steps/database.steps.d.ts +43 -0
- package/dist/src/steps/database.steps.d.ts.map +1 -0
- package/dist/src/steps/database.steps.js +79 -0
- package/dist/src/steps/database.steps.js.map +1 -0
- package/dist/src/steps/dynamodb.steps.d.ts +32 -0
- package/dist/src/steps/dynamodb.steps.d.ts.map +1 -0
- package/dist/src/steps/dynamodb.steps.js +89 -0
- package/dist/src/steps/dynamodb.steps.js.map +1 -0
- package/dist/src/steps/graphql.steps.d.ts +60 -0
- package/dist/src/steps/graphql.steps.d.ts.map +1 -0
- package/dist/src/steps/graphql.steps.js +76 -0
- package/dist/src/steps/graphql.steps.js.map +1 -0
- package/dist/src/steps/grpc.steps.d.ts +29 -0
- package/dist/src/steps/grpc.steps.d.ts.map +1 -0
- package/dist/src/steps/grpc.steps.js +68 -0
- package/dist/src/steps/grpc.steps.js.map +1 -0
- package/dist/src/steps/inbox.steps.d.ts +30 -0
- package/dist/src/steps/inbox.steps.d.ts.map +1 -0
- package/dist/src/steps/inbox.steps.js +72 -0
- package/dist/src/steps/inbox.steps.js.map +1 -0
- package/dist/src/steps/index.d.ts +43 -0
- package/dist/src/steps/index.d.ts.map +1 -0
- package/dist/src/steps/index.js +26 -0
- package/dist/src/steps/index.js.map +1 -0
- package/dist/src/steps/kafka.steps.d.ts +56 -0
- package/dist/src/steps/kafka.steps.d.ts.map +1 -0
- package/dist/src/steps/kafka.steps.js +61 -0
- package/dist/src/steps/kafka.steps.js.map +1 -0
- package/dist/src/steps/mock-server.steps.d.ts +21 -0
- package/dist/src/steps/mock-server.steps.d.ts.map +1 -0
- package/dist/src/steps/mock-server.steps.js +45 -0
- package/dist/src/steps/mock-server.steps.js.map +1 -0
- package/dist/src/steps/mongodb.steps.d.ts +107 -0
- package/dist/src/steps/mongodb.steps.d.ts.map +1 -0
- package/dist/src/steps/mongodb.steps.js +117 -0
- package/dist/src/steps/mongodb.steps.js.map +1 -0
- package/dist/src/steps/openapi.steps.d.ts +49 -0
- package/dist/src/steps/openapi.steps.d.ts.map +1 -0
- package/dist/src/steps/openapi.steps.js +113 -0
- package/dist/src/steps/openapi.steps.js.map +1 -0
- package/dist/src/steps/otp.steps.d.ts +43 -0
- package/dist/src/steps/otp.steps.d.ts.map +1 -0
- package/dist/src/steps/otp.steps.js +83 -0
- package/dist/src/steps/otp.steps.js.map +1 -0
- package/dist/src/steps/realtime.steps.d.ts +40 -0
- package/dist/src/steps/realtime.steps.d.ts.map +1 -0
- package/dist/src/steps/realtime.steps.js +116 -0
- package/dist/src/steps/realtime.steps.js.map +1 -0
- package/dist/src/steps/redis.steps.d.ts +54 -0
- package/dist/src/steps/redis.steps.d.ts.map +1 -0
- package/dist/src/steps/redis.steps.js +89 -0
- package/dist/src/steps/redis.steps.js.map +1 -0
- package/dist/src/steps/search.steps.d.ts +23 -0
- package/dist/src/steps/search.steps.d.ts.map +1 -0
- package/dist/src/steps/search.steps.js +54 -0
- package/dist/src/steps/search.steps.js.map +1 -0
- package/dist/src/test-data/factory.d.ts +82 -0
- package/dist/src/test-data/factory.d.ts.map +1 -0
- package/dist/src/test-data/factory.js +116 -0
- package/dist/src/test-data/factory.js.map +1 -0
- package/dist/src/test-data/index.d.ts +4 -0
- package/dist/src/test-data/index.d.ts.map +1 -0
- package/dist/src/test-data/index.js +4 -0
- package/dist/src/test-data/index.js.map +1 -0
- package/dist/src/test-data/registry.d.ts +37 -0
- package/dist/src/test-data/registry.d.ts.map +1 -0
- package/dist/src/test-data/registry.js +51 -0
- package/dist/src/test-data/registry.js.map +1 -0
- package/dist/src/test-data/tracking.d.ts +47 -0
- package/dist/src/test-data/tracking.d.ts.map +1 -0
- package/dist/src/test-data/tracking.js +166 -0
- package/dist/src/test-data/tracking.js.map +1 -0
- package/environments.json +263 -0
- package/package.json +299 -5
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Appium fixture for the Playwright Framework Template.
|
|
3
|
+
*
|
|
4
|
+
* Opens an Appium session with WebdriverIO (`remote()`) and gives the test the
|
|
5
|
+
* WebdriverIO `Browser` as `appiumDriver`. It works with any Appium-compatible
|
|
6
|
+
* server: a local `appium` server, Selenium Grid, a cloud farm, or a GADS hub.
|
|
7
|
+
*
|
|
8
|
+
* GADS preset (https://github.com/shamanec/GADS) — set `appium.gads`:
|
|
9
|
+
* - sessions go through the hub's `/grid` endpoint, which allocates a device
|
|
10
|
+
* (queueing up to `gads.queueTimeout` seconds when all are busy)
|
|
11
|
+
* - `gads:clientSecret` / `gads:queueTimeout` capabilities are added
|
|
12
|
+
* - `deviceName` is a regex resolved to a UDID from `GET /grid/status`, free devices first
|
|
13
|
+
* - `gadsHub` lists devices and reports hub status without reserving one
|
|
14
|
+
*
|
|
15
|
+
* Lifecycle:
|
|
16
|
+
* Setup: build capabilities → (GADS: resolve device) → POST /session via WebdriverIO
|
|
17
|
+
* Teardown: DELETE /session/<id> → the server (or GADS hub) frees the device
|
|
18
|
+
*
|
|
19
|
+
* Error handling:
|
|
20
|
+
* - FixtureInitError when the server is unreachable, rejects the credentials,
|
|
21
|
+
* or no matching device can be allocated — the GADS client secret is redacted
|
|
22
|
+
* - WebdriverIO's own errors for commands inside the test
|
|
23
|
+
*/
|
|
24
|
+
import { errorReason } from '../network-error.js';
|
|
25
|
+
import { loadOptional } from './optional-package.js';
|
|
26
|
+
import { FixtureInitError } from '../errors.js';
|
|
27
|
+
import { redactCredentials } from '../annotations/truncation.js';
|
|
28
|
+
/** Default session creation timeout (ms): covers device queueing and app install. */
|
|
29
|
+
const DEFAULT_SESSION_TIMEOUT = 240_000;
|
|
30
|
+
/** Default timeout for GADS hub REST calls (ms). */
|
|
31
|
+
const HUB_REQUEST_TIMEOUT = 30_000;
|
|
32
|
+
/** Strips trailing slashes, and for GADS a trailing `/grid`, so paths can be appended safely. */
|
|
33
|
+
export function normalizeServerUrl(serverUrl, gads) {
|
|
34
|
+
let url = serverUrl.replace(/\/+$/, '');
|
|
35
|
+
if (gads)
|
|
36
|
+
url = url.replace(/\/grid$/, '');
|
|
37
|
+
return url;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Removes a secret from a string: the literal value, plus anything
|
|
41
|
+
* `redactCredentials` recognises (Bearer tokens, password=..., JWTs).
|
|
42
|
+
*/
|
|
43
|
+
export function redactSecret(text, secret) {
|
|
44
|
+
let out = text;
|
|
45
|
+
if (secret)
|
|
46
|
+
out = out.split(secret).join('[REDACTED]');
|
|
47
|
+
return redactCredentials(out);
|
|
48
|
+
}
|
|
49
|
+
/** Returns a copy of `caps` with `gads:clientSecret` replaced by `[REDACTED]`. */
|
|
50
|
+
export function redactCapabilities(caps) {
|
|
51
|
+
const out = { ...caps };
|
|
52
|
+
if ('gads:clientSecret' in out)
|
|
53
|
+
out['gads:clientSecret'] = '[REDACTED]';
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
/** Selects matching GADS devices, free devices first. */
|
|
57
|
+
export function filterDevices(devices, criteria = {}) {
|
|
58
|
+
const nameRe = criteria.deviceName ? new RegExp(criteria.deviceName, 'i') : undefined;
|
|
59
|
+
const matches = devices.filter((d) => {
|
|
60
|
+
if (criteria.udid && d.udid !== criteria.udid)
|
|
61
|
+
return false;
|
|
62
|
+
if (criteria.platform && d.os?.toLowerCase() !== criteria.platform)
|
|
63
|
+
return false;
|
|
64
|
+
if (nameRe && !nameRe.test(d.name ?? ''))
|
|
65
|
+
return false;
|
|
66
|
+
if (criteria.platformVersion) {
|
|
67
|
+
const wanted = criteria.platformVersion;
|
|
68
|
+
const version = d.os_version ?? '';
|
|
69
|
+
// `17.5.1` must match exactly; `17` matches any 17.x.
|
|
70
|
+
const ok = wanted.includes('.') ? version === wanted : version.split('.')[0] === wanted;
|
|
71
|
+
if (!ok)
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
75
|
+
});
|
|
76
|
+
return [...matches].sort((a, b) => Number(b.available) - Number(a.available));
|
|
77
|
+
}
|
|
78
|
+
/** Default Appium automation engine for a platform. */
|
|
79
|
+
function defaultAutomationName(platform) {
|
|
80
|
+
if (platform === 'ios')
|
|
81
|
+
return 'XCUITest';
|
|
82
|
+
if (platform === 'android')
|
|
83
|
+
return 'UiAutomator2';
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Builds the W3C capabilities for the session. `udid` overrides `config.udid`
|
|
88
|
+
* (used after resolving a GADS device by name).
|
|
89
|
+
*/
|
|
90
|
+
export function buildCapabilities(config, udid) {
|
|
91
|
+
const caps = {};
|
|
92
|
+
const gads = config.gads;
|
|
93
|
+
if (config.platform)
|
|
94
|
+
caps.platformName = config.platform === 'ios' ? 'iOS' : 'Android';
|
|
95
|
+
const automationName = config.automationName ?? defaultAutomationName(config.platform);
|
|
96
|
+
if (automationName)
|
|
97
|
+
caps['appium:automationName'] = automationName;
|
|
98
|
+
const targetUdid = udid ?? config.udid;
|
|
99
|
+
if (targetUdid)
|
|
100
|
+
caps['appium:udid'] = targetUdid;
|
|
101
|
+
// For GADS the name is resolved to a UDID; plain Appium gets it as a capability.
|
|
102
|
+
if (config.deviceName && !gads)
|
|
103
|
+
caps['appium:deviceName'] = config.deviceName;
|
|
104
|
+
if (config.platformVersion)
|
|
105
|
+
caps['appium:platformVersion'] = config.platformVersion;
|
|
106
|
+
if (config.app)
|
|
107
|
+
caps['appium:app'] = config.app;
|
|
108
|
+
if (config.newCommandTimeout !== undefined)
|
|
109
|
+
caps['appium:newCommandTimeout'] = config.newCommandTimeout;
|
|
110
|
+
for (const [key, value] of Object.entries(config.capabilities ?? {})) {
|
|
111
|
+
if (key === 'gads:clientSecret')
|
|
112
|
+
continue; // never let extra caps override the configured secret
|
|
113
|
+
caps[key] = value;
|
|
114
|
+
}
|
|
115
|
+
if (gads) {
|
|
116
|
+
caps['gads:clientSecret'] = gads.clientSecret;
|
|
117
|
+
if (gads.queueTimeout !== undefined)
|
|
118
|
+
caps['gads:queueTimeout'] = gads.queueTimeout;
|
|
119
|
+
}
|
|
120
|
+
if (!caps.platformName) {
|
|
121
|
+
throw new FixtureInitError('appium', 'init', {
|
|
122
|
+
serverUrl: config.serverUrl,
|
|
123
|
+
reason: 'platformName is required. Set appium.platform (PW_APPIUM_PLATFORM) or capabilities.platformName.',
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return caps;
|
|
127
|
+
}
|
|
128
|
+
function assertConfig(config) {
|
|
129
|
+
const missing = [];
|
|
130
|
+
if (!config.serverUrl)
|
|
131
|
+
missing.push('serverUrl (PW_APPIUM_SERVER_URL)');
|
|
132
|
+
if (config.gads && !config.gads.clientSecret)
|
|
133
|
+
missing.push('gads.clientSecret (PW_GADS_CLIENT_SECRET)');
|
|
134
|
+
if (missing.length > 0) {
|
|
135
|
+
throw new FixtureInitError('appium', 'init', {
|
|
136
|
+
reason: `Appium configuration is incomplete — missing ${missing.join(', ')}`,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
/** Extracts a human-readable error from a WebDriver or GADS error body. */
|
|
141
|
+
function hubErrorMessage(body, status) {
|
|
142
|
+
if (body && typeof body === 'object') {
|
|
143
|
+
const b = body;
|
|
144
|
+
const value = b.value;
|
|
145
|
+
for (const c of [value?.message, value?.error, b.message, b.error]) {
|
|
146
|
+
if (typeof c === 'string' && c)
|
|
147
|
+
return `HTTP ${status}: ${c}`;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return `HTTP ${status}`;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Creates a GADS hub client for status and device listing.
|
|
154
|
+
* Requires `config.gads`.
|
|
155
|
+
*/
|
|
156
|
+
export function createGadsHubClient(config) {
|
|
157
|
+
assertConfig(config);
|
|
158
|
+
if (!config.gads) {
|
|
159
|
+
throw new FixtureInitError('gads', 'init', {
|
|
160
|
+
reason: 'GADS is not configured. Set appium.gads (PW_GADS_CLIENT_SECRET) and point serverUrl at the hub.',
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
const secret = config.gads.clientSecret;
|
|
164
|
+
const hubUrl = normalizeServerUrl(config.serverUrl, true);
|
|
165
|
+
const status = async () => {
|
|
166
|
+
let response;
|
|
167
|
+
let body;
|
|
168
|
+
try {
|
|
169
|
+
response = await fetch(`${hubUrl}/grid/status`, {
|
|
170
|
+
headers: { Accept: 'application/json', Authorization: `Bearer ${secret}` },
|
|
171
|
+
signal: AbortSignal.timeout(HUB_REQUEST_TIMEOUT),
|
|
172
|
+
});
|
|
173
|
+
const text = await response.text();
|
|
174
|
+
try {
|
|
175
|
+
body = text ? JSON.parse(text) : undefined;
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
body = text;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
catch (error) {
|
|
182
|
+
throw new FixtureInitError('gads', 'connect', {
|
|
183
|
+
hubUrl,
|
|
184
|
+
reason: redactSecret(errorReason(error), secret),
|
|
185
|
+
}, error instanceof Error ? error : undefined);
|
|
186
|
+
}
|
|
187
|
+
if (response.status !== 200) {
|
|
188
|
+
throw new FixtureInitError('gads', 'connect', {
|
|
189
|
+
hubUrl,
|
|
190
|
+
reason: redactSecret(hubErrorMessage(body, response.status), secret),
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
const value = (body?.value ?? {});
|
|
194
|
+
return {
|
|
195
|
+
ready: Boolean(value.ready),
|
|
196
|
+
message: value.message ?? '',
|
|
197
|
+
queued: value.queued ?? 0,
|
|
198
|
+
devices: value.devices ?? [],
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
return {
|
|
202
|
+
hubUrl,
|
|
203
|
+
status,
|
|
204
|
+
async listDevices(criteria) {
|
|
205
|
+
const { devices } = await status();
|
|
206
|
+
return filterDevices(devices, criteria);
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
/** Resolves a GADS `deviceName` regex to a UDID. Returns undefined when the hub can pick on its own. */
|
|
211
|
+
async function resolveGadsUdid(hub, config) {
|
|
212
|
+
if (config.udid || !config.deviceName)
|
|
213
|
+
return config.udid;
|
|
214
|
+
const devices = (await hub.status()).devices;
|
|
215
|
+
const matches = filterDevices(devices, {
|
|
216
|
+
platform: config.platform,
|
|
217
|
+
deviceName: config.deviceName,
|
|
218
|
+
platformVersion: config.platformVersion,
|
|
219
|
+
});
|
|
220
|
+
if (matches.length === 0) {
|
|
221
|
+
throw new FixtureInitError('gads', 'init', {
|
|
222
|
+
hubUrl: hub.hubUrl,
|
|
223
|
+
platform: config.platform,
|
|
224
|
+
deviceName: config.deviceName,
|
|
225
|
+
platformVersion: config.platformVersion,
|
|
226
|
+
reason: `No GADS device matches. Known devices: ${devices.map((d) => `${d.name} (${d.os} ${d.os_version}, ${d.udid})`).join('; ') || 'none'}`,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
// The first match is free if any is; otherwise the hub queues for it.
|
|
230
|
+
return matches[0].udid;
|
|
231
|
+
}
|
|
232
|
+
/** Reads the device details GADS adds to the session capabilities. */
|
|
233
|
+
export function gadsSessionInfo(driver) {
|
|
234
|
+
const caps = (driver.capabilities ?? {});
|
|
235
|
+
return {
|
|
236
|
+
udid: (caps['gads:deviceUdid'] ?? caps['appium:udid'] ?? caps.udid),
|
|
237
|
+
name: (caps['gads:deviceName'] ?? caps['appium:deviceName'] ?? caps.deviceName),
|
|
238
|
+
provider: caps['gads:provider'],
|
|
239
|
+
controlUrl: caps['gads:controlUrl'],
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Opens an Appium session and returns the WebdriverIO Browser.
|
|
244
|
+
* Call `driver.deleteSession()` when done (the fixture does this for you).
|
|
245
|
+
*/
|
|
246
|
+
export async function startAppiumSession(config, hub) {
|
|
247
|
+
assertConfig(config);
|
|
248
|
+
const isGads = Boolean(config.gads);
|
|
249
|
+
const secret = config.gads?.clientSecret;
|
|
250
|
+
let udid = config.udid;
|
|
251
|
+
if (isGads) {
|
|
252
|
+
udid = await resolveGadsUdid(hub ?? createGadsHubClient(config), config);
|
|
253
|
+
}
|
|
254
|
+
const capabilities = buildCapabilities(config, udid);
|
|
255
|
+
const base = new URL(normalizeServerUrl(config.serverUrl, isGads));
|
|
256
|
+
const path = isGads ? `${base.pathname.replace(/\/+$/, '')}/grid` : (base.pathname || '/');
|
|
257
|
+
const timeout = config.sessionTimeout ?? DEFAULT_SESSION_TIMEOUT;
|
|
258
|
+
// webdriverio is an optional peer dependency, loaded on first use.
|
|
259
|
+
const { remote } = await loadOptional('webdriverio', 'appiumDriver');
|
|
260
|
+
try {
|
|
261
|
+
return await remote({
|
|
262
|
+
protocol: base.protocol.replace(':', ''),
|
|
263
|
+
hostname: base.hostname,
|
|
264
|
+
port: base.port ? Number(base.port) : base.protocol === 'https:' ? 443 : 80,
|
|
265
|
+
path,
|
|
266
|
+
capabilities: capabilities,
|
|
267
|
+
logLevel: config.logLevel ?? 'warn',
|
|
268
|
+
connectionRetryTimeout: timeout,
|
|
269
|
+
// A failed allocation (no device, bad secret) won't succeed on retry.
|
|
270
|
+
connectionRetryCount: 0,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
catch (error) {
|
|
274
|
+
const cause = error instanceof Error ? error : new Error(String(error));
|
|
275
|
+
throw new FixtureInitError(isGads ? 'gads' : 'appium', 'connect', {
|
|
276
|
+
serverUrl: `${base.origin}${path}`,
|
|
277
|
+
capabilities: redactCapabilities(capabilities),
|
|
278
|
+
timeout,
|
|
279
|
+
reason: redactSecret(cause.message, secret),
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Appium fixture definitions for Playwright's test.extend() pattern.
|
|
285
|
+
*
|
|
286
|
+
* - `appiumDriver`: a WebdriverIO Browser for an Appium session, ended on teardown.
|
|
287
|
+
* - `gadsHub`: GADS hub status and device listing (requires `appium.gads`). Reserves nothing.
|
|
288
|
+
*/
|
|
289
|
+
export const appiumFixture = {
|
|
290
|
+
gadsHub: async ({ appiumConfig }, use) => {
|
|
291
|
+
await use(createGadsHubClient(appiumConfig));
|
|
292
|
+
},
|
|
293
|
+
appiumDriver: async ({ appiumConfig }, use) => {
|
|
294
|
+
const driver = await startAppiumSession(appiumConfig);
|
|
295
|
+
try {
|
|
296
|
+
await use(driver);
|
|
297
|
+
}
|
|
298
|
+
finally {
|
|
299
|
+
try {
|
|
300
|
+
await driver.deleteSession();
|
|
301
|
+
}
|
|
302
|
+
catch {
|
|
303
|
+
// Don't fail the test on teardown errors — the server frees the
|
|
304
|
+
// device after newCommandTimeout anyway.
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
};
|
|
309
|
+
//# sourceMappingURL=appium.fixture.js.map
|
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E,YAAY,EAAyC,EACvD,GAA0C,EAC5C,EAAE;QACA,MAAM,GAAG,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC;IACjD,CAAC;IAED,YAAY,EAAE,KAAK,EACf,EAAE,YAAY,EAAyC,EACvD,GAA4C,EAC9C,EAAE;QACA,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,YAAY,CAAC,CAAC;QACtD,IAAI,CAAC;YACD,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC;QACtB,CAAC;gBAAS,CAAC;YACP,IAAI,CAAC;gBACD,MAAM,MAAM,CAAC,aAAa,EAAE,CAAC;YACjC,CAAC;YAAC,MAAM,CAAC;gBACL,gEAAgE;gBAChE,yCAAyC;YAC7C,CAAC;QACL,CAAC;IACL,CAAC;CACJ,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared AWS settings for the S3 and SQS/SNS fixtures: one config turns into
|
|
3
|
+
* the client options every AWS SDK v3 client takes, and resolves the same
|
|
4
|
+
* way for both fixtures.
|
|
5
|
+
*/
|
|
6
|
+
import type { AwsFixtureConfig } from '../config/schema.js';
|
|
7
|
+
export declare const DEFAULT_AWS_TIMEOUT = 10000;
|
|
8
|
+
export declare const DEFAULT_S3_PREFIX = "propmaster-tests/";
|
|
9
|
+
/** The options every AWS SDK v3 client constructor takes. */
|
|
10
|
+
export interface AwsClientOptions {
|
|
11
|
+
region: string;
|
|
12
|
+
endpoint?: string;
|
|
13
|
+
credentials?: {
|
|
14
|
+
accessKeyId: string;
|
|
15
|
+
secretAccessKey: string;
|
|
16
|
+
sessionToken?: string;
|
|
17
|
+
};
|
|
18
|
+
profile?: string;
|
|
19
|
+
forcePathStyle?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Client options for a config. With an `endpoint` (an emulator) the region
|
|
23
|
+
* defaults to us-east-1 and the credentials to `test`/`test`, so a test run
|
|
24
|
+
* never picks up real credentials from the machine by accident. Without one,
|
|
25
|
+
* the standard AWS chain supplies whatever the config leaves out.
|
|
26
|
+
*/
|
|
27
|
+
export declare function awsClientOptions(config: AwsFixtureConfig, env?: NodeJS.ProcessEnv): AwsClientOptions;
|
|
28
|
+
/** The AWS config: the project option, else ConfigLoader (environments.json, .env, PW_AWS_*), else the standard chain alone. */
|
|
29
|
+
export declare function resolveAwsConfig(aws: AwsFixtureConfig | undefined): Promise<AwsFixtureConfig>;
|
|
30
|
+
export declare const reasonOf: (error: unknown) => string;
|
|
31
|
+
/** True when an SDK error is a "doesn't exist" (404, NoSuchKey, NoSuchBucket, NonExistentQueue, NotFound). */
|
|
32
|
+
export declare function isNotFound(error: unknown): boolean;
|
|
33
|
+
/** A body for S3 or SQS: a string or Buffer as is, anything else as JSON. */
|
|
34
|
+
export type AwsBody = string | Buffer | Uint8Array | Record<string, unknown> | unknown[] | number | boolean | null;
|
|
35
|
+
/** Encodes a body and the content type it implies. */
|
|
36
|
+
export declare function encodeAwsBody(body: AwsBody, contentType?: string): {
|
|
37
|
+
content: Buffer;
|
|
38
|
+
contentType?: string;
|
|
39
|
+
};
|
|
40
|
+
/** `JSON.parse` that names what it was parsing when it fails. */
|
|
41
|
+
export declare function parseJson<T>(text: string, fixture: string, details: Record<string, unknown>): T;
|
|
42
|
+
/** Waits `ms` milliseconds. */
|
|
43
|
+
export declare const sleep: (ms: number) => Promise<unknown>;
|
|
44
|
+
//# sourceMappingURL=aws.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws.d.ts","sourceRoot":"","sources":["../../../src/fixtures/aws.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAC1C,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD,6DAA6D;AAC7D,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,MAA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1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared AWS settings for the S3 and SQS/SNS fixtures: one config turns into
|
|
3
|
+
* the client options every AWS SDK v3 client takes, and resolves the same
|
|
4
|
+
* way for both fixtures.
|
|
5
|
+
*/
|
|
6
|
+
import { FixtureInitError, FixtureOperationError } from '../errors.js';
|
|
7
|
+
export const DEFAULT_AWS_TIMEOUT = 10_000;
|
|
8
|
+
export const DEFAULT_S3_PREFIX = 'propmaster-tests/';
|
|
9
|
+
/**
|
|
10
|
+
* Client options for a config. With an `endpoint` (an emulator) the region
|
|
11
|
+
* defaults to us-east-1 and the credentials to `test`/`test`, so a test run
|
|
12
|
+
* never picks up real credentials from the machine by accident. Without one,
|
|
13
|
+
* the standard AWS chain supplies whatever the config leaves out.
|
|
14
|
+
*/
|
|
15
|
+
export function awsClientOptions(config, env = process.env) {
|
|
16
|
+
const region = config.region ?? env.AWS_REGION ?? env.AWS_DEFAULT_REGION ?? (config.endpoint ? 'us-east-1' : undefined);
|
|
17
|
+
if (!region) {
|
|
18
|
+
throw new FixtureInitError('aws', 'connect', {
|
|
19
|
+
reason: 'AWS configuration has no region: set PW_AWS_REGION (or AWS_REGION), PW_AWS_ENDPOINT for an emulator, PW_AWS_CONTAINER=true, or aws in environments.json or the project use block.',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const options = { region };
|
|
23
|
+
if (config.endpoint)
|
|
24
|
+
options.endpoint = config.endpoint;
|
|
25
|
+
if (config.accessKeyId || config.secretAccessKey) {
|
|
26
|
+
if (!config.accessKeyId || !config.secretAccessKey) {
|
|
27
|
+
throw new FixtureInitError('aws', 'connect', { reason: 'set both accessKeyId and secretAccessKey (PW_AWS_ACCESS_KEY_ID, PW_AWS_SECRET_ACCESS_KEY), or neither to use the standard AWS chain.' });
|
|
28
|
+
}
|
|
29
|
+
options.credentials = { accessKeyId: config.accessKeyId, secretAccessKey: config.secretAccessKey, ...(config.sessionToken ? { sessionToken: config.sessionToken } : {}) };
|
|
30
|
+
}
|
|
31
|
+
else if (config.endpoint && !config.profile) {
|
|
32
|
+
options.credentials = { accessKeyId: 'test', secretAccessKey: 'test' };
|
|
33
|
+
}
|
|
34
|
+
if (config.profile)
|
|
35
|
+
options.profile = config.profile;
|
|
36
|
+
options.forcePathStyle = config.forcePathStyle ?? Boolean(config.endpoint);
|
|
37
|
+
return options;
|
|
38
|
+
}
|
|
39
|
+
/** The AWS config: the project option, else ConfigLoader (environments.json, .env, PW_AWS_*), else the standard chain alone. */
|
|
40
|
+
export async function resolveAwsConfig(aws) {
|
|
41
|
+
if (aws)
|
|
42
|
+
return aws;
|
|
43
|
+
const { ConfigLoader } = await import('../config/loader.js');
|
|
44
|
+
try {
|
|
45
|
+
return new ConfigLoader().load().aws ?? {};
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// no environments.json: rely on AWS_REGION and the standard chain
|
|
49
|
+
return {};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export const reasonOf = (error) => {
|
|
53
|
+
if (!(error instanceof Error))
|
|
54
|
+
return String(error);
|
|
55
|
+
const e = error;
|
|
56
|
+
const code = e.Code ?? (e.name !== 'Error' ? e.name : undefined);
|
|
57
|
+
return code && !e.message.includes(code) ? `${code}: ${e.message}` : e.message;
|
|
58
|
+
};
|
|
59
|
+
/** True when an SDK error is a "doesn't exist" (404, NoSuchKey, NoSuchBucket, NonExistentQueue, NotFound). */
|
|
60
|
+
export function isNotFound(error) {
|
|
61
|
+
const e = error;
|
|
62
|
+
if (!e)
|
|
63
|
+
return false;
|
|
64
|
+
return e.$metadata?.httpStatusCode === 404
|
|
65
|
+
|| /^(NoSuchKey|NoSuchBucket|NotFound|NonExistentQueue|AWS\.SimpleQueueService\.NonExistentQueue|QueueDoesNotExist)$/.test(e.name ?? e.Code ?? '');
|
|
66
|
+
}
|
|
67
|
+
/** Encodes a body and the content type it implies. */
|
|
68
|
+
export function encodeAwsBody(body, contentType) {
|
|
69
|
+
if (Buffer.isBuffer(body))
|
|
70
|
+
return { content: body, contentType };
|
|
71
|
+
if (body instanceof Uint8Array)
|
|
72
|
+
return { content: Buffer.from(body), contentType };
|
|
73
|
+
if (typeof body === 'string')
|
|
74
|
+
return { content: Buffer.from(body, 'utf8'), contentType: contentType ?? 'text/plain' };
|
|
75
|
+
if (body === undefined)
|
|
76
|
+
throw new TypeError('body is undefined');
|
|
77
|
+
return { content: Buffer.from(JSON.stringify(body), 'utf8'), contentType: contentType ?? 'application/json' };
|
|
78
|
+
}
|
|
79
|
+
/** `JSON.parse` that names what it was parsing when it fails. */
|
|
80
|
+
export function parseJson(text, fixture, details) {
|
|
81
|
+
try {
|
|
82
|
+
return JSON.parse(text);
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
throw new FixtureOperationError(fixture, 'json', {
|
|
86
|
+
...details,
|
|
87
|
+
reason: `the body isn't JSON (${error.message}): ${text.length > 200 ? `${text.slice(0, 200)}…` : text}`,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/** Waits `ms` milliseconds. */
|
|
92
|
+
export const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
93
|
+
//# sourceMappingURL=aws.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aws.js","sourceRoot":"","sources":["../../../src/fixtures/aws.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAC1C,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAWrD;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAwB,EAAE,GAAG,GAAsB,OAAO,CAAC,GAAG;IAC3F,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,k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AACL,CAAC;AAED,+BAA+B;AAC/B,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cassandra / ScyllaDB fixture.
|
|
3
|
+
*
|
|
4
|
+
* `cassandraClient` runs parameterized CQL against Cassandra or ScyllaDB, in
|
|
5
|
+
* the same shape as `databaseClient`:
|
|
6
|
+
*
|
|
7
|
+
* - `query()` returns rows as plain objects: UUIDs, inet addresses, dates and
|
|
8
|
+
* decimals as strings, bigints and varints as numbers (bigint beyond 2^53).
|
|
9
|
+
* - `execute()` runs anything else and reports whether a lightweight
|
|
10
|
+
* transaction (`IF NOT EXISTS`, `IF col = ?`) was applied.
|
|
11
|
+
* - `insert()` writes rows and undoes them after the test: a new row is
|
|
12
|
+
* deleted, an overwritten one gets its previous values back.
|
|
13
|
+
* - `waitForRows()` polls until the application has written what the test
|
|
14
|
+
* expects, and fails with what is there instead.
|
|
15
|
+
* - `createKeyspace()` makes a keyspace of the test's own, dropped afterwards;
|
|
16
|
+
* `createKeyspace: true` in the config creates the configured one when it's
|
|
17
|
+
* missing (local runs, containers).
|
|
18
|
+
*
|
|
19
|
+
* Statements are always prepared with their parameters, never built from
|
|
20
|
+
* strings. Uses cassandra-driver, an optional peer dependency loaded on first use.
|
|
21
|
+
*/
|
|
22
|
+
import type { Client as DriverClient } from 'cassandra-driver';
|
|
23
|
+
import type { CassandraFixtureConfig } from '../config/schema.js';
|
|
24
|
+
import type { ContainerManager } from '../containers/container-manager.js';
|
|
25
|
+
import type { CleanupRegistry, KeepOption } from '../test-data/registry.js';
|
|
26
|
+
export declare const DEFAULT_CASSANDRA_PORT = 9042;
|
|
27
|
+
export declare const DEFAULT_CASSANDRA_DATA_CENTER = "datacenter1";
|
|
28
|
+
export declare const DEFAULT_CASSANDRA_TIMEOUT = 10000;
|
|
29
|
+
export declare const DEFAULT_REPLICATION: {
|
|
30
|
+
readonly class: 'NetworkTopologyStrategy';
|
|
31
|
+
readonly replication_factor: 1;
|
|
32
|
+
};
|
|
33
|
+
/** Bound values: positional (`?`) as an array, or named (`:name`) as an object. */
|
|
34
|
+
export type CqlParams = unknown[] | Record<string, unknown>;
|
|
35
|
+
export type CassandraRow = Record<string, unknown>;
|
|
36
|
+
export interface CqlOptions {
|
|
37
|
+
/** Consistency level for this statement, e.g. `quorum` (default: the config's). */
|
|
38
|
+
consistency?: NonNullable<CassandraFixtureConfig['consistency']>;
|
|
39
|
+
/** Rows per page while reading (default: the driver's, 5000). Every page is read. */
|
|
40
|
+
fetchSize?: number;
|
|
41
|
+
/** Driver values (`Uuid`, `Long`, `LocalDate`, ...) instead of plain ones. */
|
|
42
|
+
raw?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface CassandraInsertOptions extends KeepOption {
|
|
45
|
+
/** Expire the rows after this many seconds (`USING TTL`). */
|
|
46
|
+
ttl?: number;
|
|
47
|
+
/** Only insert rows that don't exist yet (`IF NOT EXISTS`); `insert()` then reports which were applied. */
|
|
48
|
+
ifNotExists?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface CassandraWaitOptions<T> extends CqlOptions {
|
|
51
|
+
/** Milliseconds to wait (default: the config's `timeout`, else 10000). */
|
|
52
|
+
timeout?: number;
|
|
53
|
+
/** How many rows to wait for (default: 1). */
|
|
54
|
+
count?: number;
|
|
55
|
+
/** Keep waiting until the rows also pass this check. */
|
|
56
|
+
until?: (rows: T[]) => boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface CassandraWaitForRowOptions<T> extends CqlOptions {
|
|
59
|
+
timeout?: number;
|
|
60
|
+
/** Keep waiting until the first row also passes this check (e.g. `(r) => r.status === 'shipped'`). */
|
|
61
|
+
until?: (row: T) => boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface CassandraKeyspaceOptions extends KeepOption {
|
|
64
|
+
/** Replication (default: the config's `replication`, else NetworkTopologyStrategy with factor 1). */
|
|
65
|
+
replication?: Record<string, string | number>;
|
|
66
|
+
}
|
|
67
|
+
/** A table's primary key. */
|
|
68
|
+
export interface CassandraPrimaryKey {
|
|
69
|
+
partitionKeys: string[];
|
|
70
|
+
clusteringKeys: string[];
|
|
71
|
+
}
|
|
72
|
+
export interface CassandraClient {
|
|
73
|
+
/** Runs a SELECT (or any statement) and returns every row, as plain objects. */
|
|
74
|
+
query<T extends CassandraRow = CassandraRow>(cql: string, params?: CqlParams, options?: CqlOptions): Promise<T[]>;
|
|
75
|
+
/** Runs a statement. `applied` is false when a lightweight transaction's condition didn't hold. Not undone. */
|
|
76
|
+
execute(cql: string, params?: CqlParams, options?: CqlOptions): Promise<{
|
|
77
|
+
applied: boolean;
|
|
78
|
+
}>;
|
|
79
|
+
/** Runs statements in one logged batch (unlogged with `{ logged: false }`). Not undone. */
|
|
80
|
+
batch(statements: Array<{
|
|
81
|
+
cql: string;
|
|
82
|
+
params?: CqlParams;
|
|
83
|
+
}>, options?: Omit<CqlOptions, 'raw' | 'fetchSize'> & {
|
|
84
|
+
logged?: boolean;
|
|
85
|
+
}): Promise<{
|
|
86
|
+
applied: boolean;
|
|
87
|
+
}>;
|
|
88
|
+
/**
|
|
89
|
+
* Inserts one row or many and undoes them after the test: a new row is
|
|
90
|
+
* deleted, an existing one gets its previous values back. Every row needs
|
|
91
|
+
* its whole primary key. Returns how many were applied.
|
|
92
|
+
*/
|
|
93
|
+
insert(table: string, rows: CassandraRow | CassandraRow[], options?: CassandraInsertOptions): Promise<{
|
|
94
|
+
applied: number;
|
|
95
|
+
}>;
|
|
96
|
+
/** Polls a query until it returns `count` rows (default 1) and they pass `until`. Throws on timeout with what was there. */
|
|
97
|
+
waitForRows<T extends CassandraRow = CassandraRow>(cql: string, params?: CqlParams, options?: CassandraWaitOptions<T>): Promise<T[]>;
|
|
98
|
+
/** Polls until the query returns a row (passing `until`), and returns it. */
|
|
99
|
+
waitForRow<T extends CassandraRow = CassandraRow>(cql: string, params?: CqlParams, options?: CassandraWaitForRowOptions<T>): Promise<T>;
|
|
100
|
+
/**
|
|
101
|
+
* Creates a keyspace (default name: one of this test's own, e.g.
|
|
102
|
+
* `propmaster_t0_9f2a1c0b`) and returns its name. Dropped after the test
|
|
103
|
+
* unless `{ keep: true }` or it already existed.
|
|
104
|
+
*/
|
|
105
|
+
createKeyspace(name?: string, options?: CassandraKeyspaceOptions): Promise<string>;
|
|
106
|
+
/** Makes a keyspace the default for unqualified table names. */
|
|
107
|
+
useKeyspace(name: string): Promise<void>;
|
|
108
|
+
/** Drops a keyspace (not undone). */
|
|
109
|
+
dropKeyspace(name: string): Promise<void>;
|
|
110
|
+
/** The partition and clustering key columns of a table (`table` or `keyspace.table`). */
|
|
111
|
+
primaryKey(table: string): Promise<CassandraPrimaryKey>;
|
|
112
|
+
/** The keyspace unqualified names resolve against, if any. */
|
|
113
|
+
readonly keyspace: string | undefined;
|
|
114
|
+
/** The driver client, for anything else (prepared statement options, metadata, paging). */
|
|
115
|
+
readonly driver: DriverClient;
|
|
116
|
+
close(): Promise<void>;
|
|
117
|
+
}
|
|
118
|
+
export interface CreateCassandraClientOptions {
|
|
119
|
+
/** Undo stack for inserts and keyspaces; without one nothing is cleaned up. */
|
|
120
|
+
registry?: CleanupRegistry;
|
|
121
|
+
/** Run ID in the default keyspace name of createKeyspace() (default: a new one). */
|
|
122
|
+
runId?: string;
|
|
123
|
+
}
|
|
124
|
+
/** A plain identifier, lowercased as Cassandra folds unquoted names. Throws for anything else. */
|
|
125
|
+
export declare function identifier(name: string, what: string): string;
|
|
126
|
+
/** `ks.table` or `table` (in the session keyspace) → both parts, lowercased. */
|
|
127
|
+
export declare function splitTable(table: string, keyspace: string | undefined): {
|
|
128
|
+
keyspace: string;
|
|
129
|
+
table: string;
|
|
130
|
+
};
|
|
131
|
+
/** The keyspace name for a run ID: `propmaster_t0_9f2a1c0b`. */
|
|
132
|
+
export declare function testKeyspaceName(runId: string): string;
|
|
133
|
+
/** The replication map in CQL: `{'class': 'NetworkTopologyStrategy', 'replication_factor': 1}`. */
|
|
134
|
+
export declare function replicationCql(replication: Record<string, string | number>): string;
|
|
135
|
+
/** The INSERT for one row, with a `?` per column. */
|
|
136
|
+
export declare function buildCqlInsert(keyspace: string, table: string, row: CassandraRow, options?: Pick<CassandraInsertOptions, 'ttl' | 'ifNotExists'>): {
|
|
137
|
+
cql: string;
|
|
138
|
+
params: unknown[];
|
|
139
|
+
};
|
|
140
|
+
/** The WHERE clause and values that pick one row by its primary key. */
|
|
141
|
+
export declare function keyWhere(row: CassandraRow, key: CassandraPrimaryKey, table: string): {
|
|
142
|
+
where: string;
|
|
143
|
+
params: unknown[];
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* A driver value as a plain one: Uuid, TimeUuid, InetAddress, LocalDate,
|
|
147
|
+
* LocalTime, BigDecimal and Duration as strings; Long and Integer (varint) as
|
|
148
|
+
* numbers, or bigint beyond Number.MAX_SAFE_INTEGER; Tuple as an array; maps,
|
|
149
|
+
* sets and lists inside out. Buffers and Dates stay as they are.
|
|
150
|
+
*/
|
|
151
|
+
export declare function toPlainValue(value: unknown): unknown;
|
|
152
|
+
/**
|
|
153
|
+
* Bound values as the driver takes them: a BigInt (as `query()` returns for
|
|
154
|
+
* values beyond 2^53) becomes its decimal string, which the driver accepts
|
|
155
|
+
* for bigint and varint columns. Inside lists, sets and maps too.
|
|
156
|
+
*/
|
|
157
|
+
export declare function toDriverParams(params: CqlParams | undefined): CqlParams | undefined;
|
|
158
|
+
/** Short JSON for messages. */
|
|
159
|
+
export declare function previewRows(value: unknown, max?: number): string;
|
|
160
|
+
/** A driver error as one readable line. */
|
|
161
|
+
export declare function cassandraReason(error: unknown): string;
|
|
162
|
+
/** Connects, creating `keyspace` first when `createKeyspace` is set. */
|
|
163
|
+
export declare function createCassandraClient(config: CassandraFixtureConfig, options?: CreateCassandraClientOptions): Promise<CassandraClient>;
|
|
164
|
+
/** The Cassandra config: the project option, else ConfigLoader (environments.json, .env, PW_CASSANDRA_*), else localhost. */
|
|
165
|
+
export declare function resolveCassandraConfig(cassandra: CassandraFixtureConfig | undefined): Promise<CassandraFixtureConfig>;
|
|
166
|
+
/**
|
|
167
|
+
* Fixture definition for test.extend(). The undo actions run before the
|
|
168
|
+
* driver shuts down.
|
|
169
|
+
*/
|
|
170
|
+
export declare const cassandraFixture: {
|
|
171
|
+
cassandraClient: ({ cassandra, stagehandContainers, dataCleanup }: {
|
|
172
|
+
cassandra: CassandraFixtureConfig | undefined;
|
|
173
|
+
stagehandContainers: ContainerManager;
|
|
174
|
+
dataCleanup: CleanupRegistry;
|
|
175
|
+
}, use: (client: CassandraClient) => Promise<void>, testInfo: {
|
|
176
|
+
workerIndex: number;
|
|
177
|
+
}) => Promise<void>;
|
|
178
|
+
};
|
|
179
|
+
//# sourceMappingURL=cassandra.fixture.d.ts.map
|