@inluxc/propmaster 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +379 -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,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test data factories.
|
|
3
|
+
*
|
|
4
|
+
* // tests/factories.ts
|
|
5
|
+
* import { defineFactory } from '@inluxc/propmaster';
|
|
6
|
+
* export const user = defineFactory('user', (f) => ({
|
|
7
|
+
* email: f.email('user'), // user-t3-9f2a1c0b-1@example.test — unique across workers
|
|
8
|
+
* name: `User ${f.seq}`,
|
|
9
|
+
* active: true,
|
|
10
|
+
* }));
|
|
11
|
+
*
|
|
12
|
+
* // in a test
|
|
13
|
+
* const alice = testData.build(user, { name: 'Alice' });
|
|
14
|
+
* await databaseClient.insert('users', alice); // deleted again after the test
|
|
15
|
+
*/
|
|
16
|
+
import { CleanupRegistry } from './registry.js';
|
|
17
|
+
/** The Faker instance from `@faker-js/faker` (typed loosely so the package stays optional). */
|
|
18
|
+
export type FakerLike = any;
|
|
19
|
+
export interface FactoryContext {
|
|
20
|
+
/** 1, 2, 3, ... per test; shared by every factory and `unique()` in the test. */
|
|
21
|
+
readonly seq: number;
|
|
22
|
+
/** The test's run ID, unique across workers and runs (e.g. `t3-9f2a1c0b`). */
|
|
23
|
+
readonly runId: string;
|
|
24
|
+
/** `<prefix>-<runId>-<n>`: unique across parallel workers and runs. */
|
|
25
|
+
unique(prefix?: string): string;
|
|
26
|
+
/** `<prefix>-<runId>-<n>@example.test` (or another domain). */
|
|
27
|
+
email(prefix?: string, domain?: string): string;
|
|
28
|
+
/** Faker, when `@faker-js/faker` is installed. Its values aren't unique: combine with `unique()` for keys. */
|
|
29
|
+
readonly faker: FakerLike;
|
|
30
|
+
}
|
|
31
|
+
export interface Factory<T extends object> {
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly build: (f: FactoryContext) => T;
|
|
34
|
+
}
|
|
35
|
+
/** Defines a factory. `build` returns one object; overrides are merged over it. */
|
|
36
|
+
export declare function defineFactory<T extends object>(name: string, build: (f: FactoryContext) => T): Factory<T>;
|
|
37
|
+
export type Overrides<T> = Partial<T> | ((built: T, index: number) => Partial<T>);
|
|
38
|
+
/** A run ID unique across workers and runs: `t<worker>-<8 hex>`. */
|
|
39
|
+
export declare function newRunId(workerIndex?: number | string): string;
|
|
40
|
+
/**
|
|
41
|
+
* The `testData` fixture: factories, unique values and the test's cleanup
|
|
42
|
+
* stack. Everything it hands out is scoped to one test.
|
|
43
|
+
*/
|
|
44
|
+
export declare class TestData {
|
|
45
|
+
private readonly registry;
|
|
46
|
+
readonly runId: string;
|
|
47
|
+
private counter;
|
|
48
|
+
private readonly factories;
|
|
49
|
+
constructor(registry?: CleanupRegistry, options?: {
|
|
50
|
+
runId?: string;
|
|
51
|
+
faker?: FakerLike;
|
|
52
|
+
fakerError?: Error;
|
|
53
|
+
});
|
|
54
|
+
private readonly fakerInstance;
|
|
55
|
+
private readonly fakerError;
|
|
56
|
+
/** Faker, when `@faker-js/faker` is installed (MissingPackageError otherwise). */
|
|
57
|
+
get faker(): FakerLike;
|
|
58
|
+
/** `<prefix>-<runId>-<n>`: unique across parallel workers and runs. */
|
|
59
|
+
unique(prefix?: string): string;
|
|
60
|
+
/** `<prefix>-<runId>-<n>@example.test`. */
|
|
61
|
+
email(prefix?: string, domain?: string): string;
|
|
62
|
+
/** Registers a factory under a name, for `build('user')`. Returns it. */
|
|
63
|
+
define<T extends object>(name: string, build: (f: FactoryContext) => T): Factory<T>;
|
|
64
|
+
/** Builds one object: the factory's, with `overrides` merged over it. Nothing is stored. */
|
|
65
|
+
build<T extends object>(factory: Factory<T> | string, overrides?: Overrides<T>): T;
|
|
66
|
+
/** Builds `count` objects. `overrides` may be a function of the built object and its index. */
|
|
67
|
+
buildMany<T extends object>(factory: Factory<T> | string, count: number, overrides?: Overrides<T>): T[];
|
|
68
|
+
/**
|
|
69
|
+
* Adds an undo action, run when the test ends (pass or fail), newest first,
|
|
70
|
+
* before the clients disconnect. Use it for data made by other means: an
|
|
71
|
+
* API call, raw SQL, a browser flow.
|
|
72
|
+
*/
|
|
73
|
+
cleanup(label: string, run: () => unknown): void;
|
|
74
|
+
cleanup(run: () => unknown): void;
|
|
75
|
+
/** Undo actions still waiting to run, newest last. */
|
|
76
|
+
get pendingCleanups(): readonly string[];
|
|
77
|
+
/** Runs the pending undo actions now, instead of when the test ends. */
|
|
78
|
+
flushCleanups(): Promise<void>;
|
|
79
|
+
private resolve;
|
|
80
|
+
private buildAt;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/test-data/factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,+FAA+F;AAC/F,MAAM,MAAM,SAAS,GAAG,GAAG,CAAC;AAE5B,MAAM,WAAW,cAAc;IAC3B,iFAAiF;IACjF,QAAQ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BlB"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test data factories.
|
|
3
|
+
*
|
|
4
|
+
* // tests/factories.ts
|
|
5
|
+
* import { defineFactory } from '@inluxc/propmaster';
|
|
6
|
+
* export const user = defineFactory('user', (f) => ({
|
|
7
|
+
* email: f.email('user'), // user-t3-9f2a1c0b-1@example.test — unique across workers
|
|
8
|
+
* name: `User ${f.seq}`,
|
|
9
|
+
* active: true,
|
|
10
|
+
* }));
|
|
11
|
+
*
|
|
12
|
+
* // in a test
|
|
13
|
+
* const alice = testData.build(user, { name: 'Alice' });
|
|
14
|
+
* await databaseClient.insert('users', alice); // deleted again after the test
|
|
15
|
+
*/
|
|
16
|
+
import { randomBytes } from 'node:crypto';
|
|
17
|
+
import { FixtureOperationError, MissingPackageError } from '../errors.js';
|
|
18
|
+
import { CleanupRegistry } from './registry.js';
|
|
19
|
+
/** Defines a factory. `build` returns one object; overrides are merged over it. */
|
|
20
|
+
export function defineFactory(name, build) {
|
|
21
|
+
return { name, build };
|
|
22
|
+
}
|
|
23
|
+
/** A run ID unique across workers and runs: `t<worker>-<8 hex>`. */
|
|
24
|
+
export function newRunId(workerIndex = process.env.TEST_WORKER_INDEX ?? 0) {
|
|
25
|
+
return `t${workerIndex}-${randomBytes(4).toString('hex')}`;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The `testData` fixture: factories, unique values and the test's cleanup
|
|
29
|
+
* stack. Everything it hands out is scoped to one test.
|
|
30
|
+
*/
|
|
31
|
+
export class TestData {
|
|
32
|
+
registry;
|
|
33
|
+
runId;
|
|
34
|
+
counter = 0;
|
|
35
|
+
factories = new Map();
|
|
36
|
+
constructor(registry = new CleanupRegistry(), options = {}) {
|
|
37
|
+
this.registry = registry;
|
|
38
|
+
this.runId = options.runId ?? newRunId();
|
|
39
|
+
this.fakerInstance = options.faker;
|
|
40
|
+
this.fakerError = options.fakerError;
|
|
41
|
+
}
|
|
42
|
+
fakerInstance;
|
|
43
|
+
fakerError;
|
|
44
|
+
/** Faker, when `@faker-js/faker` is installed (MissingPackageError otherwise). */
|
|
45
|
+
get faker() {
|
|
46
|
+
if (this.fakerInstance)
|
|
47
|
+
return this.fakerInstance;
|
|
48
|
+
throw this.fakerError ?? new MissingPackageError('testData (faker)', '@faker-js/faker', ['@faker-js/faker']);
|
|
49
|
+
}
|
|
50
|
+
/** `<prefix>-<runId>-<n>`: unique across parallel workers and runs. */
|
|
51
|
+
unique(prefix = 'id') {
|
|
52
|
+
return `${prefix}-${this.runId}-${++this.counter}`;
|
|
53
|
+
}
|
|
54
|
+
/** `<prefix>-<runId>-<n>@example.test`. */
|
|
55
|
+
email(prefix = 'user', domain = 'example.test') {
|
|
56
|
+
return `${this.unique(prefix)}@${domain}`;
|
|
57
|
+
}
|
|
58
|
+
/** Registers a factory under a name, for `build('user')`. Returns it. */
|
|
59
|
+
define(name, build) {
|
|
60
|
+
const factory = defineFactory(name, build);
|
|
61
|
+
this.factories.set(name, factory);
|
|
62
|
+
return factory;
|
|
63
|
+
}
|
|
64
|
+
/** Builds one object: the factory's, with `overrides` merged over it. Nothing is stored. */
|
|
65
|
+
build(factory, overrides) {
|
|
66
|
+
return this.buildAt(this.resolve(factory), overrides, 0);
|
|
67
|
+
}
|
|
68
|
+
/** Builds `count` objects. `overrides` may be a function of the built object and its index. */
|
|
69
|
+
buildMany(factory, count, overrides) {
|
|
70
|
+
const f = this.resolve(factory);
|
|
71
|
+
return Array.from({ length: count }, (_, i) => this.buildAt(f, overrides, i));
|
|
72
|
+
}
|
|
73
|
+
cleanup(labelOrRun, run) {
|
|
74
|
+
if (typeof labelOrRun === 'function')
|
|
75
|
+
this.registry.add('testData.cleanup', labelOrRun);
|
|
76
|
+
else
|
|
77
|
+
this.registry.add(labelOrRun, run);
|
|
78
|
+
}
|
|
79
|
+
/** Undo actions still waiting to run, newest last. */
|
|
80
|
+
get pendingCleanups() {
|
|
81
|
+
return this.registry.pending;
|
|
82
|
+
}
|
|
83
|
+
/** Runs the pending undo actions now, instead of when the test ends. */
|
|
84
|
+
async flushCleanups() {
|
|
85
|
+
await this.registry.flush();
|
|
86
|
+
}
|
|
87
|
+
resolve(factory) {
|
|
88
|
+
if (typeof factory !== 'string')
|
|
89
|
+
return factory;
|
|
90
|
+
const found = this.factories.get(factory);
|
|
91
|
+
if (!found) {
|
|
92
|
+
throw new FixtureOperationError('testData', 'build', {
|
|
93
|
+
factory,
|
|
94
|
+
reason: `no factory named "${factory}"; defined: ${[...this.factories.keys()].join(', ') || 'none'}. Use testData.define("${factory}", ...) or pass the factory itself.`,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
return found;
|
|
98
|
+
}
|
|
99
|
+
buildAt(factory, overrides, index) {
|
|
100
|
+
const seq = ++this.counter;
|
|
101
|
+
const getFaker = () => this.faker; // only when the factory reads f.faker
|
|
102
|
+
const ctx = {
|
|
103
|
+
seq,
|
|
104
|
+
runId: this.runId,
|
|
105
|
+
unique: (prefix) => this.unique(prefix),
|
|
106
|
+
email: (prefix, domain) => this.email(prefix, domain),
|
|
107
|
+
get faker() {
|
|
108
|
+
return getFaker();
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
const built = factory.build(ctx);
|
|
112
|
+
const extra = typeof overrides === 'function' ? overrides(built, index) : overrides;
|
|
113
|
+
return { ...built, ...extra };
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../src/test-data/factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAuBhD,mFAAmF;AACnF,MAAM,UAAU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AAS,CAAC;QACpF,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC;IAClC,CAAC;CACJ"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { CleanupRegistry, type CleanupEntry, type KeepOption } from './registry.js';
|
|
2
|
+
export { TestData, defineFactory, newRunId, type Factory, type FactoryContext, type Overrides, type FakerLike } from './factory.js';
|
|
3
|
+
export { buildInsert, buildDelete, keyColumns, runIdOf, trackDatabase, trackMongo, trackRedis, trackNeo4j } from './tracking.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test-data/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpI,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { CleanupRegistry } from './registry.js';
|
|
2
|
+
export { TestData, defineFactory, newRunId } from './factory.js';
|
|
3
|
+
export { buildInsert, buildDelete, keyColumns, runIdOf, trackDatabase, trackMongo, trackRedis, trackNeo4j } from './tracking.js';
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/test-data/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAsC,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAqE,MAAM,cAAc,CAAC;AACpI,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cleanup registry: a per-test stack of undo actions.
|
|
3
|
+
*
|
|
4
|
+
* The client fixtures record an undo for each insert they make (a Mongo
|
|
5
|
+
* insert, a Redis set, a SQL `insert`, a Neo4j write tagged with a run ID),
|
|
6
|
+
* and tests add their own with `testData.cleanup()`. The stack runs in
|
|
7
|
+
* reverse order when the test ends, pass or fail, while every client the
|
|
8
|
+
* test used is still connected.
|
|
9
|
+
*/
|
|
10
|
+
/** Per-call opt-out: leave this call's data in place after the test. */
|
|
11
|
+
export interface KeepOption {
|
|
12
|
+
keep?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface CleanupEntry {
|
|
15
|
+
/** What the undo removes, shown when it fails (e.g. `mongodb users: 2 documents`). */
|
|
16
|
+
label: string;
|
|
17
|
+
run: () => unknown;
|
|
18
|
+
}
|
|
19
|
+
export declare class CleanupRegistry {
|
|
20
|
+
readonly autoCleanup: boolean;
|
|
21
|
+
private readonly entries;
|
|
22
|
+
/**
|
|
23
|
+
* @param autoCleanup when false, the client fixtures record nothing; undo
|
|
24
|
+
* actions added with `add()` (testData.cleanup) still run.
|
|
25
|
+
*/
|
|
26
|
+
constructor(autoCleanup?: boolean);
|
|
27
|
+
/** Adds an undo action. Actions run last-in, first-out. */
|
|
28
|
+
add(label: string, run: () => unknown): void;
|
|
29
|
+
/** Undo actions not yet run. */
|
|
30
|
+
get pending(): readonly string[];
|
|
31
|
+
/**
|
|
32
|
+
* Runs every pending undo action, newest first. All of them run even when
|
|
33
|
+
* one fails; then a FixtureOperationError lists the ones that failed.
|
|
34
|
+
*/
|
|
35
|
+
flush(): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/test-data/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,wEAAwE;AACxE,MAAM,WAAW,UAAU;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IACzB,sFAAsF;IACtF,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,OAAO,CAAC;CACtB;AAED,qBAAa,eAAe;aAOI,WAAW;IANvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;IAE9C;;;OAGG;IACH,YAA4B,WAAW,UAAO,EAAI;IAElD,2DAA2D;IAC3D,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,OAAO,GAAG,IAAI,CAE3C;IAED,gCAAgC;IAChC,IAAI,OAAO,IAAI,SAAS,MAAM,EAAE,CAE/B;IAED;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAoB3B;CACJ"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cleanup registry: a per-test stack of undo actions.
|
|
3
|
+
*
|
|
4
|
+
* The client fixtures record an undo for each insert they make (a Mongo
|
|
5
|
+
* insert, a Redis set, a SQL `insert`, a Neo4j write tagged with a run ID),
|
|
6
|
+
* and tests add their own with `testData.cleanup()`. The stack runs in
|
|
7
|
+
* reverse order when the test ends, pass or fail, while every client the
|
|
8
|
+
* test used is still connected.
|
|
9
|
+
*/
|
|
10
|
+
import { FixtureOperationError } from '../errors.js';
|
|
11
|
+
export class CleanupRegistry {
|
|
12
|
+
autoCleanup;
|
|
13
|
+
entries = [];
|
|
14
|
+
/**
|
|
15
|
+
* @param autoCleanup when false, the client fixtures record nothing; undo
|
|
16
|
+
* actions added with `add()` (testData.cleanup) still run.
|
|
17
|
+
*/
|
|
18
|
+
constructor(autoCleanup = true) {
|
|
19
|
+
this.autoCleanup = autoCleanup;
|
|
20
|
+
}
|
|
21
|
+
/** Adds an undo action. Actions run last-in, first-out. */
|
|
22
|
+
add(label, run) {
|
|
23
|
+
this.entries.push({ label, run });
|
|
24
|
+
}
|
|
25
|
+
/** Undo actions not yet run. */
|
|
26
|
+
get pending() {
|
|
27
|
+
return this.entries.map((e) => e.label);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Runs every pending undo action, newest first. All of them run even when
|
|
31
|
+
* one fails; then a FixtureOperationError lists the ones that failed.
|
|
32
|
+
*/
|
|
33
|
+
async flush() {
|
|
34
|
+
const failures = [];
|
|
35
|
+
let first;
|
|
36
|
+
for (let entry = this.entries.pop(); entry; entry = this.entries.pop()) {
|
|
37
|
+
try {
|
|
38
|
+
await entry.run();
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
42
|
+
first ??= err;
|
|
43
|
+
failures.push(`${entry.label}: ${err.message}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (failures.length) {
|
|
47
|
+
throw new FixtureOperationError('testData', 'cleanup', { failed: failures.length, reason: failures.join('; ') }, first);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/test-data/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAarD,MAAM,OAAO,eAAe;IAOI,WAAW;IANtB,OAAO,GAAmB,EAAE,CAAC;IAE9C;;;OAGG;IACH,YAA4B,WAAW,GAAG,IAAI;2BAAlB,WAAW;IAAU,CAAC;IAElD,2DAA2D;IAC3D,GAAG,CAAC,KAAa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in
|
|
3
|
+
* a test record their own undo in the test's CleanupRegistry.
|
|
4
|
+
*
|
|
5
|
+
* What is tracked, and how it is undone:
|
|
6
|
+
* databaseClient.insert(table, rows) → DELETE the rows (by `key`, `id`, or every inserted column)
|
|
7
|
+
* mongoDbClient.insertOne/insertMany → deleteMany by the inserted _ids
|
|
8
|
+
* redisClient.set(key, ...) → DEL the key, or restore the value it had before
|
|
9
|
+
* neo4jClient.write(cypher, { runId }) → MATCH (n {runId}) DETACH DELETE n
|
|
10
|
+
*
|
|
11
|
+
* Raw SQL through `databaseClient.execute()` isn't tracked (its effect can't
|
|
12
|
+
* be undone reliably); use `insert()` or `testData.cleanup()`. Every tracked
|
|
13
|
+
* call takes `{ keep: true }` to leave its data in place.
|
|
14
|
+
*/
|
|
15
|
+
import type { CleanupRegistry } from './registry.js';
|
|
16
|
+
import type { DatabaseClient, DatabaseConnection } from '../fixtures/database.fixture.js';
|
|
17
|
+
import type { MongoDbClient } from '../fixtures/mongodb.fixture.js';
|
|
18
|
+
import type { RedisClient } from '../fixtures/redis.fixture.js';
|
|
19
|
+
import type { CypherParams, Neo4jClient } from '../fixtures/neo4j.fixture.js';
|
|
20
|
+
export type { KeepOption } from './registry.js';
|
|
21
|
+
/** Builds the parameterized multi-row INSERT for `rows` (placeholders `$1, $2, ...`, valid for every dialect). */
|
|
22
|
+
export declare function buildInsert(table: string, rows: Record<string, unknown>[]): {
|
|
23
|
+
sql: string;
|
|
24
|
+
params: unknown[];
|
|
25
|
+
columns: string[];
|
|
26
|
+
};
|
|
27
|
+
/** The DELETE that removes one inserted row, matching on `keys` (NULLs with IS NULL). */
|
|
28
|
+
export declare function buildDelete(table: string, row: Record<string, unknown>, keys: string[]): {
|
|
29
|
+
sql: string;
|
|
30
|
+
params: unknown[];
|
|
31
|
+
};
|
|
32
|
+
/** The columns that identify an inserted row: `key`, else `id` when every row has one, else every inserted column. */
|
|
33
|
+
export declare function keyColumns(rows: Record<string, unknown>[], columns: string[], key?: string | string[]): string[];
|
|
34
|
+
/** Adds `insert()` to a database connection, recording a DELETE for each inserted row. */
|
|
35
|
+
export declare function trackDatabase(conn: DatabaseConnection, registry: CleanupRegistry): DatabaseClient;
|
|
36
|
+
/** Records a deleteMany by _id for every document inserted through the client. */
|
|
37
|
+
export declare function trackMongo(client: MongoDbClient, registry: CleanupRegistry): MongoDbClient;
|
|
38
|
+
/** Records, for each key set through the client, a DEL (new key) or a restore of the previous value. */
|
|
39
|
+
export declare function trackRedis(client: RedisClient, registry: CleanupRegistry): RedisClient;
|
|
40
|
+
/** The run IDs a Cypher write tags its data with (`runId` parameter). */
|
|
41
|
+
export declare function runIdOf(params?: CypherParams): string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Records, for each distinct `runId` parameter a write uses, a DETACH DELETE
|
|
44
|
+
* of every node carrying that runId. Writes without a `runId` aren't tracked.
|
|
45
|
+
*/
|
|
46
|
+
export declare function trackNeo4j(client: Neo4jClient, registry: CleanupRegistry): Neo4jClient;
|
|
47
|
+
//# sourceMappingURL=tracking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking.d.ts","sourceRoot":"","sources":["../../../src/test-data/tracking.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAc,MAAM,eAAe,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAiB,MAAM,iCAAiC,CAAC;AACzG,OAAO,KAAK,EAAE,aAAa,EAAqC,MAAM,gCAAgC,CAAC;AACvG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAoB,MAAM,8BAA8B,CAAC;AAEhG,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAahD,kHAAkH;AAClH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,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
5
|
+
* What is tracked, and how it is undone:
|
|
6
|
+
* databaseClient.insert(table, rows) → DELETE the rows (by `key`, `id`, or every inserted column)
|
|
7
|
+
* mongoDbClient.insertOne/insertMany → deleteMany by the inserted _ids
|
|
8
|
+
* redisClient.set(key, ...) → DEL the key, or restore the value it had before
|
|
9
|
+
* neo4jClient.write(cypher, { runId }) → MATCH (n {runId}) DETACH DELETE n
|
|
10
|
+
*
|
|
11
|
+
* Raw SQL through `databaseClient.execute()` isn't tracked (its effect can't
|
|
12
|
+
* be undone reliably); use `insert()` or `testData.cleanup()`. Every tracked
|
|
13
|
+
* call takes `{ keep: true }` to leave its data in place.
|
|
14
|
+
*/
|
|
15
|
+
import { FixtureOperationError } from '../errors.js';
|
|
16
|
+
const IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_$]*(\.[A-Za-z_][A-Za-z0-9_$]*)*$/;
|
|
17
|
+
function assertIdentifier(name, what) {
|
|
18
|
+
if (!IDENTIFIER.test(name)) {
|
|
19
|
+
throw new FixtureOperationError('database', 'insert', {
|
|
20
|
+
[what]: name,
|
|
21
|
+
reason: `"${name}" isn't a plain ${what} name (letters, digits, _ and $, optionally schema-qualified); use execute() for anything else`,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** Builds the parameterized multi-row INSERT for `rows` (placeholders `$1, $2, ...`, valid for every dialect). */
|
|
26
|
+
export function buildInsert(table, rows) {
|
|
27
|
+
assertIdentifier(table, 'table');
|
|
28
|
+
const columns = [...new Set(rows.flatMap((r) => Object.keys(r)))];
|
|
29
|
+
if (!columns.length) {
|
|
30
|
+
throw new FixtureOperationError('database', 'insert', { table, reason: 'rows have no columns' });
|
|
31
|
+
}
|
|
32
|
+
columns.forEach((c) => assertIdentifier(c, 'column'));
|
|
33
|
+
const params = [];
|
|
34
|
+
const tuples = rows.map((row) => `(${columns.map((c) => (params.push(row[c] ?? null), `$${params.length}`)).join(', ')})`);
|
|
35
|
+
return { sql: `INSERT INTO ${table} (${columns.join(', ')}) VALUES ${tuples.join(', ')}`, params, columns };
|
|
36
|
+
}
|
|
37
|
+
/** The DELETE that removes one inserted row, matching on `keys` (NULLs with IS NULL). */
|
|
38
|
+
export function buildDelete(table, row, keys) {
|
|
39
|
+
const params = [];
|
|
40
|
+
const where = keys.map((k) => {
|
|
41
|
+
const v = row[k];
|
|
42
|
+
if (v === null || v === undefined)
|
|
43
|
+
return `${k} IS NULL`;
|
|
44
|
+
params.push(v);
|
|
45
|
+
return `${k} = $${params.length}`;
|
|
46
|
+
});
|
|
47
|
+
return { sql: `DELETE FROM ${table} WHERE ${where.join(' AND ')}`, params };
|
|
48
|
+
}
|
|
49
|
+
/** The columns that identify an inserted row: `key`, else `id` when every row has one, else every inserted column. */
|
|
50
|
+
export function keyColumns(rows, columns, key) {
|
|
51
|
+
if (key) {
|
|
52
|
+
const keys = Array.isArray(key) ? key : [key];
|
|
53
|
+
keys.forEach((k) => assertIdentifier(k, 'column'));
|
|
54
|
+
return keys;
|
|
55
|
+
}
|
|
56
|
+
if (rows.every((r) => r.id !== undefined && r.id !== null))
|
|
57
|
+
return ['id'];
|
|
58
|
+
return columns;
|
|
59
|
+
}
|
|
60
|
+
/** Adds `insert()` to a database connection, recording a DELETE for each inserted row. */
|
|
61
|
+
export function trackDatabase(conn, registry) {
|
|
62
|
+
return {
|
|
63
|
+
...conn,
|
|
64
|
+
async insert(table, rows, options = {}) {
|
|
65
|
+
const list = Array.isArray(rows) ? rows : [rows];
|
|
66
|
+
if (!list.length)
|
|
67
|
+
return { affectedRows: 0 };
|
|
68
|
+
const { sql, params, columns } = buildInsert(table, list);
|
|
69
|
+
const keys = keyColumns(list, columns, options.key);
|
|
70
|
+
const result = await conn.execute(sql, params);
|
|
71
|
+
if (!options.keep && registry.autoCleanup) {
|
|
72
|
+
registry.add(`database ${table}: ${list.length} row(s)`, async () => {
|
|
73
|
+
for (const row of [...list].reverse()) {
|
|
74
|
+
const del = buildDelete(table, row, keys);
|
|
75
|
+
await conn.execute(del.sql, del.params);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** Records a deleteMany by _id for every document inserted through the client. */
|
|
84
|
+
export function trackMongo(client, registry) {
|
|
85
|
+
const undo = (collection, ids) => {
|
|
86
|
+
if (!ids.length || !registry.autoCleanup)
|
|
87
|
+
return;
|
|
88
|
+
registry.add(`mongodb ${collection}: ${ids.length} document(s)`, () => client.deleteMany(collection, { _id: { $in: ids } }));
|
|
89
|
+
};
|
|
90
|
+
return {
|
|
91
|
+
...client,
|
|
92
|
+
async insertOne(collection, document, options) {
|
|
93
|
+
const result = await client.insertOne(collection, document);
|
|
94
|
+
if (!options?.keep)
|
|
95
|
+
undo(collection, [result.insertedId]);
|
|
96
|
+
return result;
|
|
97
|
+
},
|
|
98
|
+
async insertMany(collection, documents, options) {
|
|
99
|
+
const result = await client.insertMany(collection, documents);
|
|
100
|
+
if (!options?.keep)
|
|
101
|
+
undo(collection, Object.values(result.insertedIds));
|
|
102
|
+
return result;
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/** Records, for each key set through the client, a DEL (new key) or a restore of the previous value. */
|
|
107
|
+
export function trackRedis(client, registry) {
|
|
108
|
+
return {
|
|
109
|
+
...client,
|
|
110
|
+
async set(key, value, ttl, options) {
|
|
111
|
+
const track = !options?.keep && registry.autoCleanup;
|
|
112
|
+
const previous = track ? await client.get(key) : null;
|
|
113
|
+
await client.set(key, value, ttl);
|
|
114
|
+
if (!track)
|
|
115
|
+
return;
|
|
116
|
+
if (previous === null)
|
|
117
|
+
registry.add(`redis ${key}: delete`, () => client.del(key));
|
|
118
|
+
else
|
|
119
|
+
registry.add(`redis ${key}: restore previous value`, () => client.set(key, previous));
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/** The run IDs a Cypher write tags its data with (`runId` parameter). */
|
|
124
|
+
export function runIdOf(params) {
|
|
125
|
+
const id = params?.runId;
|
|
126
|
+
return typeof id === 'string' && id ? id : undefined;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Records, for each distinct `runId` parameter a write uses, a DETACH DELETE
|
|
130
|
+
* of every node carrying that runId. Writes without a `runId` aren't tracked.
|
|
131
|
+
*/
|
|
132
|
+
export function trackNeo4j(client, registry) {
|
|
133
|
+
const seen = new Set();
|
|
134
|
+
const note = (params, options) => {
|
|
135
|
+
const runId = runIdOf(params);
|
|
136
|
+
if (!runId || options?.keep || !registry.autoCleanup || seen.has(runId))
|
|
137
|
+
return;
|
|
138
|
+
seen.add(runId);
|
|
139
|
+
registry.add(`neo4j nodes with runId ${runId}`, async () => {
|
|
140
|
+
seen.delete(runId);
|
|
141
|
+
await client.write('MATCH (n {runId: $runId}) DETACH DELETE n', { runId });
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
return {
|
|
145
|
+
...client,
|
|
146
|
+
async write(cypher, params, options) {
|
|
147
|
+
const result = await client.write(cypher, params);
|
|
148
|
+
note(params, options);
|
|
149
|
+
return result;
|
|
150
|
+
},
|
|
151
|
+
async executeInTransaction(fn) {
|
|
152
|
+
const used = [];
|
|
153
|
+
const result = await client.executeInTransaction((tx) => fn({
|
|
154
|
+
...tx,
|
|
155
|
+
run: (cypher, params) => {
|
|
156
|
+
if (params)
|
|
157
|
+
used.push(params);
|
|
158
|
+
return tx.run(cypher, params);
|
|
159
|
+
},
|
|
160
|
+
}));
|
|
161
|
+
used.forEach((p) => note(p)); // committed: now there is something to undo
|
|
162
|
+
return result;
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=tracking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking.js","sourceRoot":"","sources":["../../../src/test-data/tracking.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,O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