@cnc-tools/storm 0.9.1 → 0.11.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/bin/storm.js +11 -2
- package/dist/application.d.ts +5 -5
- package/dist/application.js +11 -9
- package/dist/bin/storm.js +32 -20
- package/dist/build-info.js +1 -1
- package/dist/chunks/chunk-3ZZVZPMG.js +10 -0
- package/dist/chunks/{chunk-WV6WQFC6.js → chunk-4EU4AH7E.js} +150 -26
- package/dist/chunks/chunk-4PRAB24Y.js +4400 -0
- package/dist/chunks/chunk-AMTYHUYB.js +257 -0
- package/dist/chunks/chunk-ETCZ6WP7.js +431 -0
- package/dist/chunks/chunk-FVMQKYTT.js +10 -0
- package/dist/chunks/chunk-GRMD7G4J.js +1267 -0
- package/dist/chunks/chunk-ICB4BZJX.js +22 -0
- package/dist/chunks/chunk-KR7WIYLG.js +2184 -0
- package/dist/chunks/chunk-L4ZPMSKQ.js +808 -0
- package/dist/chunks/chunk-NPPJ57W7.js +569 -0
- package/dist/chunks/chunk-O4BUT7BE.js +3361 -0
- package/dist/chunks/chunk-OJOKQRM6.js +1457 -0
- package/dist/chunks/chunk-SLNKW4ZM.js +40 -0
- package/dist/chunks/chunk-TRFEAYNC.js +1952 -0
- package/dist/chunks/chunk-VZZTHCBW.js +93 -0
- package/dist/chunks/chunk-WNIQA5J6.js +19 -0
- package/dist/chunks/chunk-WSIF7SR6.js +10 -0
- package/dist/chunks/{live-app-X3PW2W42.js → live-app-LOGYUBKB.js} +73 -20
- package/dist/command-tree.d.ts +3 -0
- package/dist/command-tree.js +3 -0
- package/dist/commands/dashboard.d.ts +1 -1
- package/dist/commands/dashboard.js +1 -1
- package/dist/commands/exec/cleanup.d.ts +28 -44
- package/dist/commands/exec/cleanup.js +25 -55
- package/dist/commands/exec/command.d.ts +73 -545
- package/dist/commands/exec/command.js +65 -25
- package/dist/commands/exec/job-summary.d.ts +2 -2
- package/dist/commands/exec/job-summary.js +3 -3
- package/dist/commands/exec/live-view.d.ts +9 -9
- package/dist/commands/exec/live-view.js +49 -42
- package/dist/commands/exec/metadata.d.ts +0 -65
- package/dist/commands/exec/metadata.js +2 -61
- package/dist/commands/exec/mint-failed.d.ts +1 -1
- package/dist/commands/exec/mint-failed.js +8 -8
- package/dist/commands/exec/outcomes.d.ts +63 -468
- package/dist/commands/exec/outcomes.js +47 -75
- package/dist/commands/exec/plan-run.d.ts +148 -0
- package/dist/commands/exec/plan-run.js +121 -0
- package/dist/commands/exec/progress.d.ts +26 -16
- package/dist/commands/exec/progress.js +63 -42
- package/dist/commands/exec/redaction.d.ts +3 -3
- package/dist/commands/exec/redaction.js +4 -4
- package/dist/commands/exec/resource-flags.d.ts +50 -0
- package/dist/commands/exec/resource-flags.js +125 -0
- package/dist/commands/exec/resource-refusals.d.ts +64 -0
- package/dist/commands/exec/resource-refusals.js +58 -0
- package/dist/commands/exec/run-command.d.ts +87 -167
- package/dist/commands/exec/run-command.js +296 -418
- package/dist/commands/exec/run-metadata.d.ts +20 -43
- package/dist/commands/exec/run-metadata.js +18 -37
- package/dist/commands/exec/test-plan.d.ts +11 -0
- package/dist/commands/exec/test-plan.js +39 -0
- package/dist/commands/exec/tests-summary.d.ts +5 -5
- package/dist/commands/exec/tests-summary.js +2 -2
- package/dist/commands/exec/text.d.ts +8 -2
- package/dist/commands/exec/text.js +8 -0
- package/dist/commands/exec/view.d.ts +5 -7
- package/dist/commands/exec/view.js +22 -14
- package/dist/commands/exec/waterfall.d.ts +4 -9
- package/dist/commands/exec/waterfall.js +22 -26
- package/dist/commands/exec/worker-chart.d.ts +1 -1
- package/dist/commands/ext/metadata.d.ts +4 -0
- package/dist/commands/ext/metadata.js +8 -0
- package/dist/commands/runs/facts.d.ts +11 -6
- package/dist/commands/runs/facts.js +27 -15
- package/dist/commands/runs/list/command.d.ts +15 -8
- package/dist/commands/runs/list/command.js +39 -32
- package/dist/commands/runs/list/metadata.d.ts +16 -14
- package/dist/commands/runs/list/metadata.js +17 -15
- package/dist/commands/runs/list/outcomes.d.ts +6 -2
- package/dist/commands/runs/logs/command.d.ts +3 -4
- package/dist/commands/runs/logs/command.js +46 -41
- package/dist/commands/runs/logs/metadata.d.ts +17 -15
- package/dist/commands/runs/logs/metadata.js +20 -18
- package/dist/commands/runs/past-run.d.ts +3 -33
- package/dist/commands/runs/past-run.js +3 -52
- package/dist/commands/runs/show/command.d.ts +57 -42
- package/dist/commands/runs/show/command.js +93 -82
- package/dist/commands/runs/show/metadata.d.ts +20 -18
- package/dist/commands/runs/show/metadata.js +20 -18
- package/dist/commands/runs/show/outcomes.d.ts +27 -19
- package/dist/commands/runs/show/outcomes.js +8 -6
- package/dist/commands/vitest/command.d.ts +95 -560
- package/dist/commands/vitest/command.js +84 -100
- package/dist/commands/vitest/metadata.d.ts +0 -65
- package/dist/commands/vitest/metadata.js +2 -41
- package/dist/commands/vitest/outcomes.d.ts +44 -274
- package/dist/commands/vitest/outcomes.js +7 -14
- package/dist/config/credential-resolver.d.ts +134 -0
- package/dist/config/credential-resolver.js +70 -0
- package/dist/{credential/settle.d.ts → config/credential-settle.d.ts} +1 -2
- package/dist/config/errors.d.ts +1 -1
- package/dist/config/errors.js +5 -5
- package/dist/config/index.d.ts +7 -6
- package/dist/config/index.js +13 -9
- package/dist/config/load.d.ts +16 -13
- package/dist/config/load.js +55 -40
- package/dist/config/recipe-run.d.ts +26 -0
- package/dist/config/recipe-run.js +27 -0
- package/dist/config/resolve.d.ts +103 -15
- package/dist/config/resolve.js +137 -47
- package/dist/config/resolver.d.ts +40 -0
- package/dist/config/resolver.js +31 -0
- package/dist/config/schema.d.ts +13 -17
- package/dist/config/schema.js +14 -35
- package/dist/config/settings-file.d.ts +28 -16
- package/dist/config/settings-file.js +39 -24
- package/dist/config/typed-options.d.ts +21 -0
- package/dist/config/typed-options.js +28 -0
- package/dist/config-file/define.d.ts +33 -31
- package/dist/config-file/define.js +14 -4
- package/dist/config-file/toolchain.d.ts +1 -1
- package/dist/context.d.ts +60 -29
- package/dist/context.js +32 -13
- package/dist/core/before-run.d.ts +38 -0
- package/dist/core/before-run.js +44 -0
- package/dist/core/definition-lookup.d.ts +22 -0
- package/dist/core/definition-lookup.js +34 -0
- package/dist/core/events.d.ts +59 -64
- package/dist/core/gateways.d.ts +23 -164
- package/dist/core/index.d.ts +14 -15
- package/dist/core/index.js +13 -11
- package/dist/core/launcher-supplies.d.ts +11 -0
- package/dist/core/launcher-supplies.js +28 -0
- package/dist/core/live/terminal-command-gateway.d.ts +8 -0
- package/dist/core/live/terminal-command-gateway.js +49 -0
- package/dist/core/payload.d.ts +13 -14
- package/dist/core/payload.js +9 -8
- package/dist/core/presentations.d.ts +38 -37
- package/dist/core/presentations.js +48 -56
- package/dist/core/reports.d.ts +5 -0
- package/dist/core/reports.js +13 -0
- package/dist/core/resource-registry.d.ts +38 -0
- package/dist/core/resource-registry.js +30 -0
- package/dist/core/resource-reports.d.ts +69 -0
- package/dist/core/resource-reports.js +67 -0
- package/dist/core/resource.d.ts +135 -243
- package/dist/core/resource.js +7 -5
- package/dist/core/resources-of.d.ts +16 -0
- package/dist/core/resources-of.js +8 -0
- package/dist/core/resources.d.ts +97 -84
- package/dist/core/resources.js +166 -165
- package/dist/core/run-state.d.ts +30 -42
- package/dist/core/run-state.js +56 -60
- package/dist/core/run.d.ts +83 -90
- package/dist/core/run.js +109 -155
- package/dist/core/state-directory.js +4 -3
- package/dist/core/timeline.d.ts +42 -24
- package/dist/core/timeline.js +46 -27
- package/dist/core/timing.d.ts +3 -3
- package/dist/core/timing.js +1 -1
- package/dist/credential/events.d.ts +20 -0
- package/dist/credential/events.js +4 -0
- package/dist/credential/gateways.d.ts +1 -80
- package/dist/credential/index.d.ts +4 -5
- package/dist/credential/index.js +8 -5
- package/dist/credential/live/github-actions-token-response.js +1 -1
- package/dist/credential/live/vercel-cli-gateway.d.ts +2 -1
- package/dist/credential/live/vercel-cli-gateway.js +1 -1
- package/dist/credential/live/vercel-output.d.ts +1 -1
- package/dist/credential/source.d.ts +44 -75
- package/dist/credential/source.js +33 -28
- package/dist/credential/target.d.ts +1 -1
- package/dist/extension-commands.d.ts +20 -0
- package/dist/extension-commands.js +27 -0
- package/dist/extensions/github/definition.d.ts +26 -0
- package/dist/extensions/github/definition.js +29 -0
- package/dist/extensions/github/extension.d.ts +18 -0
- package/dist/extensions/github/extension.js +6 -0
- package/dist/{resources → extensions}/github/fixture-repo.d.ts +11 -8
- package/dist/{resources → extensions}/github/fixture-repo.js +8 -4
- package/dist/extensions/github/index.d.ts +13 -0
- package/dist/extensions/github/index.js +17 -0
- package/dist/extensions/github/lifecycle.d.ts +30 -0
- package/dist/extensions/github/lifecycle.js +69 -0
- package/dist/extensions/github/live/world.d.ts +6 -0
- package/dist/extensions/github/live/world.js +16 -0
- package/dist/extensions/github/options.d.ts +36 -0
- package/dist/extensions/github/options.js +36 -0
- package/dist/extensions/github/refusals.d.ts +32 -0
- package/dist/extensions/github/refusals.js +43 -0
- package/dist/extensions/github/release.d.ts +17 -0
- package/dist/extensions/github/release.js +34 -0
- package/dist/extensions/github/resource.d.ts +36 -0
- package/dist/extensions/github/resource.js +21 -0
- package/dist/extensions/github/run/payload.d.ts +27 -0
- package/dist/extensions/github/run/payload.js +42 -0
- package/dist/extensions/github/world.d.ts +15 -0
- package/dist/extensions/github/world.js +3 -0
- package/dist/extensions/story/command-tree.d.ts +6 -0
- package/dist/extensions/story/command-tree.js +21 -0
- package/dist/extensions/story/commands/app.d.ts +23 -0
- package/dist/extensions/story/commands/app.js +5 -0
- package/dist/extensions/story/commands/run/command.d.ts +211 -0
- package/dist/extensions/story/commands/run/command.js +259 -0
- package/dist/extensions/story/commands/run/metadata.d.ts +4 -0
- package/dist/extensions/story/commands/run/metadata.js +8 -0
- package/dist/extensions/story/commands/run/outcomes.d.ts +101 -0
- package/dist/extensions/story/commands/run/outcomes.js +73 -0
- package/dist/extensions/story/commands/tree.d.ts +2 -0
- package/dist/extensions/story/commands/tree.js +6 -0
- package/dist/extensions/story/extension.d.ts +2 -0
- package/dist/extensions/story/extension.js +8 -0
- package/dist/extensions/testserver/canceled.d.ts +7 -0
- package/dist/extensions/testserver/canceled.js +27 -0
- package/dist/extensions/testserver/command-tree.d.ts +6 -0
- package/dist/extensions/testserver/command-tree.js +20 -0
- package/dist/extensions/testserver/commands/app.d.ts +22 -0
- package/dist/extensions/testserver/commands/app.js +5 -0
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/create/command.d.ts +277 -237
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/create/command.js +112 -141
- package/dist/extensions/testserver/commands/pool/create/metadata.d.ts +33 -0
- package/dist/extensions/testserver/commands/pool/create/metadata.js +55 -0
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/create/outcomes.d.ts +132 -112
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/create/outcomes.js +6 -24
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/list/command.d.ts +3 -4
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/list/command.js +34 -28
- package/dist/extensions/testserver/commands/pool/list/metadata.d.ts +11 -0
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/list/metadata.js +7 -5
- package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/list/outcomes.js +1 -1
- package/dist/extensions/testserver/commands/pool/metadata.d.ts +3 -0
- package/dist/extensions/testserver/commands/pool/metadata.js +7 -0
- package/dist/extensions/testserver/commands/tree.d.ts +2 -0
- package/dist/extensions/testserver/commands/tree.js +6 -0
- package/dist/{resources → extensions}/testserver/credential-facts.d.ts +6 -40
- package/dist/{resources → extensions}/testserver/credential-facts.js +13 -35
- package/dist/extensions/testserver/definition.d.ts +57 -0
- package/dist/extensions/testserver/definition.js +71 -0
- package/dist/{resources → extensions}/testserver/events.d.ts +5 -4
- package/dist/extensions/testserver/events.js +4 -0
- package/dist/extensions/testserver/extension.d.ts +46 -0
- package/dist/extensions/testserver/extension.js +68 -0
- package/dist/extensions/testserver/index.d.ts +20 -0
- package/dist/extensions/testserver/index.js +31 -0
- package/dist/extensions/testserver/lifecycle.d.ts +24 -0
- package/dist/extensions/testserver/lifecycle.js +116 -0
- package/dist/{core → extensions/testserver}/limit.js +1 -0
- package/dist/extensions/testserver/live/world.d.ts +8 -0
- package/dist/extensions/testserver/live/world.js +38 -0
- package/dist/{resources/testserver/sandbox → extensions/testserver/options}/channels.d.ts +1 -1
- package/dist/extensions/testserver/options/index.d.ts +5 -0
- package/dist/extensions/testserver/options/index.js +11 -0
- package/dist/extensions/testserver/options/rules.d.ts +69 -0
- package/dist/extensions/testserver/options/rules.js +92 -0
- package/dist/extensions/testserver/options/sandboxes.d.ts +29 -0
- package/dist/extensions/testserver/options/sandboxes.js +33 -0
- package/dist/extensions/testserver/options/ttl.d.ts +23 -0
- package/dist/extensions/testserver/options/ttl.js +42 -0
- package/dist/{resources → extensions}/testserver/pool/channels.d.ts +3 -3
- package/dist/{resources → extensions}/testserver/pool/channels.js +2 -2
- package/dist/{resources → extensions}/testserver/pool/create.d.ts +1 -2
- package/dist/{resources → extensions}/testserver/pool/create.js +2 -1
- package/dist/{resources → extensions}/testserver/pool/index.d.ts +0 -1
- package/dist/{resources → extensions}/testserver/pool/index.js +2 -3
- package/dist/{resources → extensions}/testserver/pool/inspect.d.ts +1 -1
- package/dist/{resources → extensions}/testserver/pool/lease.d.ts +1 -1
- package/dist/extensions/testserver/pool/live/pool-store-gateway.d.ts +12 -0
- package/dist/{resources → extensions}/testserver/pool/live/pool-store-gateway.js +4 -4
- package/dist/{resources → extensions}/testserver/pool/pull-request.d.ts +8 -5
- package/dist/{resources → extensions}/testserver/pool/pull-request.js +2 -2
- package/dist/extensions/testserver/pr-build-facts.d.ts +156 -0
- package/dist/extensions/testserver/pr-build-facts.js +309 -0
- package/dist/extensions/testserver/presentation.d.ts +11 -0
- package/dist/{resources → extensions}/testserver/presentation.js +35 -56
- package/dist/{resources/testserver/lane.d.ts → extensions/testserver/progress.d.ts} +10 -6
- package/dist/{resources/testserver/lane.js → extensions/testserver/progress.js} +21 -16
- package/dist/extensions/testserver/provision.d.ts +160 -0
- package/dist/{resources/testserver/provider.js → extensions/testserver/provision.js} +80 -108
- package/dist/{resources → extensions}/testserver/pull-request/gateways.d.ts +1 -1
- package/dist/extensions/testserver/pull-request/gateways.js +5 -0
- package/dist/{resources → extensions}/testserver/pull-request/index.js +2 -2
- package/dist/{resources → extensions}/testserver/pull-request/live/github-token-gateway.d.ts +4 -4
- package/dist/{resources → extensions}/testserver/pull-request/live/github-token-gateway.js +4 -4
- package/dist/extensions/testserver/refusals.d.ts +72 -0
- package/dist/extensions/testserver/refusals.js +117 -0
- package/dist/extensions/testserver/release.d.ts +14 -0
- package/dist/extensions/testserver/release.js +26 -0
- package/dist/extensions/testserver/resource.d.ts +57 -0
- package/dist/extensions/testserver/resource.js +19 -0
- package/dist/extensions/testserver/result.d.ts +55 -0
- package/dist/extensions/testserver/result.js +98 -0
- package/dist/extensions/testserver/run/connection.d.ts +21 -0
- package/dist/extensions/testserver/run/connection.js +39 -0
- package/dist/extensions/testserver/run-sandbox.d.ts +16 -0
- package/dist/extensions/testserver/run-sandbox.js +11 -0
- package/dist/{resources → extensions}/testserver/sandbox/create.d.ts +1 -11
- package/dist/{resources → extensions}/testserver/sandbox/create.js +0 -15
- package/dist/{resources → extensions}/testserver/sandbox/gateways.d.ts +1 -1
- package/dist/{resources → extensions}/testserver/sandbox/index.d.ts +1 -3
- package/dist/extensions/testserver/sandbox/index.js +6 -0
- package/dist/extensions/testserver/testserver-sdk.d.ts +1 -0
- package/dist/extensions/testserver/testserver-sdk.js +4 -0
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/arguments.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/context.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/driver.d.ts +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/gateways.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/index.js +4 -4
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/invocation.d.ts +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/invocation.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/redaction.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/report.d.ts +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/report.js +1 -1
- package/dist/{vercel-cli → extensions/testserver/vercel-cli}/verbose.js +1 -1
- package/dist/extensions/testserver/vitest/config.d.ts +30 -0
- package/dist/extensions/testserver/vitest/config.js +41 -0
- package/dist/{vitest → extensions/testserver/vitest}/container-scope.d.ts +25 -14
- package/dist/{vitest → extensions/testserver/vitest}/container-scope.js +55 -17
- package/dist/extensions/testserver/vitest/container-start.d.ts +19 -0
- package/dist/extensions/testserver/vitest/container-start.js +31 -0
- package/dist/{vitest → extensions/testserver/vitest}/diagnostics.d.ts +66 -29
- package/dist/{vitest → extensions/testserver/vitest}/diagnostics.js +146 -50
- package/dist/{vitest → extensions/testserver/vitest}/fixtures.d.ts +7 -5
- package/dist/{vitest → extensions/testserver/vitest}/fixtures.js +69 -26
- package/dist/extensions/testserver/vitest/index.d.ts +3 -0
- package/dist/extensions/testserver/vitest/index.js +10 -0
- package/dist/extensions/testserver/vitest/sandbox.d.ts +25 -0
- package/dist/extensions/testserver/vitest/sandbox.js +43 -0
- package/dist/{vitest → extensions/testserver/vitest}/types.d.ts +1 -1
- package/dist/extensions/testserver/world.d.ts +25 -0
- package/dist/extensions/testserver/world.js +4 -0
- package/dist/extensions.d.ts +144 -0
- package/dist/extensions.js +41 -0
- package/dist/forward-sigterm.d.ts +8 -0
- package/dist/forward-sigterm.js +18 -0
- package/dist/help-logo.js +5 -5
- package/dist/launch.js +46 -0
- package/dist/launcher-resolvers/index.d.ts +2 -0
- package/dist/launcher-resolvers/index.js +8 -0
- package/dist/launcher-resolvers/local-services.d.ts +57 -0
- package/dist/launcher-resolvers/local-services.js +7 -0
- package/dist/live-app.js +12 -7
- package/dist/local-services.d.ts +19 -0
- package/dist/local-services.js +37 -0
- package/dist/presentation.js +2 -2
- package/dist/run-directory/gateways.d.ts +167 -0
- package/dist/run-directory/gateways.js +2 -0
- package/dist/run-directory/index.d.ts +8 -0
- package/dist/run-directory/index.js +13 -0
- package/dist/run-directory/plan.d.ts +35 -0
- package/dist/run-directory/plan.js +24 -0
- package/dist/run-directory/reader.d.ts +70 -0
- package/dist/run-directory/reader.js +51 -0
- package/dist/run-directory/recording.d.ts +92 -0
- package/dist/run-directory/recording.js +85 -0
- package/dist/run-directory/run-collector.d.ts +36 -0
- package/dist/{commands/exec → run-directory}/run-collector.js +10 -12
- package/dist/{core → run-directory}/run-directory.d.ts +13 -14
- package/dist/{core → run-directory}/run-directory.js +11 -11
- package/dist/{commands/exec → run-directory}/run-record.d.ts +92 -61
- package/dist/run-directory/run-record.js +209 -0
- package/dist/run-directory/timeline-facts.d.ts +53 -0
- package/dist/run-directory/timeline-facts.js +76 -0
- package/dist/runner/base.js +1 -1
- package/dist/runner/context.js +1 -1
- package/dist/runner/events.d.ts +6 -5
- package/dist/runner/events.js +1 -1
- package/dist/runner/gateways.d.ts +11 -11
- package/dist/runner/gateways.js +1 -1
- package/dist/runner/index.d.ts +13 -17
- package/dist/runner/index.js +10 -14
- package/dist/runner/live/sandbox-gateway.js +4 -4
- package/dist/runner/live/terminal.d.ts +1 -1
- package/dist/runner/live/terminal.js +1 -1
- package/dist/runner/prepare.d.ts +40 -17
- package/dist/runner/prepare.js +17 -11
- package/dist/runner/ready.js +2 -2
- package/dist/runner/recipe.d.ts +38 -20
- package/dist/runner/recipe.js +31 -17
- package/dist/runner/{remote-command.d.ts → sandboxed-command.d.ts} +18 -19
- package/dist/runner/{remote-command.js → sandboxed-command.js} +21 -22
- package/dist/runner/scope.d.ts +21 -14
- package/dist/runner/scope.js +12 -10
- package/dist/runner/secrets.js +1 -1
- package/dist/runner/session.d.ts +100 -0
- package/dist/runner/session.js +109 -0
- package/dist/runner/snapshot-key.d.ts +1 -1
- package/dist/runner/snapshot-key.js +4 -4
- package/dist/runner/snapshot-save.d.ts +3 -2
- package/dist/runner/snapshot-save.js +8 -7
- package/dist/sdk/extension/ci.d.ts +2 -0
- package/dist/sdk/extension/ci.js +6 -0
- package/dist/sdk/extension/commands.d.ts +69 -0
- package/dist/sdk/extension/commands.js +31 -0
- package/dist/{credential/diagnosis.d.ts → sdk/extension/credential-diagnosis.d.ts} +1 -7
- package/dist/{credential/diagnosis.js → sdk/extension/credential-diagnosis.js} +2 -11
- package/dist/sdk/extension/credential-source.d.ts +132 -0
- package/dist/sdk/extension/credential-source.js +5 -0
- package/dist/{credential → sdk/extension}/credential.d.ts +8 -7
- package/dist/{credential → sdk/extension}/credential.js +9 -6
- package/dist/sdk/extension/index.d.ts +16 -0
- package/dist/sdk/extension/index.js +40 -0
- package/dist/sdk/extension/launcher-supplies.d.ts +24 -0
- package/dist/sdk/extension/launcher-supplies.js +3 -0
- package/dist/sdk/extension/lifecycle.d.ts +212 -0
- package/dist/sdk/extension/lifecycle.js +9 -0
- package/dist/sdk/extension/presentation.d.ts +31 -0
- package/dist/sdk/extension/presentation.js +7 -0
- package/dist/sdk/extension/progress.d.ts +75 -0
- package/dist/sdk/extension/progress.js +8 -0
- package/dist/sdk/extension/reports.d.ts +15 -0
- package/dist/sdk/extension/reports.js +5 -0
- package/dist/sdk/extension/resource-definition.d.ts +204 -0
- package/dist/sdk/extension/resource-definition.js +24 -0
- package/dist/sdk/extension/resource-factory.d.ts +10 -0
- package/dist/sdk/extension/resource-factory.js +15 -0
- package/dist/sdk/extension/resource.d.ts +60 -0
- package/dist/sdk/extension/resource.js +42 -0
- package/dist/sdk/extension/rules.d.ts +16 -0
- package/dist/sdk/extension/rules.js +30 -0
- package/dist/sdk/extension/span.d.ts +8 -0
- package/dist/sdk/extension/span.js +4 -0
- package/dist/sdk/extension/time.d.ts +11 -0
- package/dist/sdk/extension/time.js +4 -0
- package/dist/sdk/extension/token-request-facts.d.ts +39 -0
- package/dist/sdk/extension/token-request-facts.js +35 -0
- package/dist/sdk/index.d.ts +4 -7
- package/dist/sdk/index.js +7 -15
- package/dist/sdk/run/contract.d.ts +32 -0
- package/dist/sdk/run/contract.js +12 -0
- package/dist/sdk/run/launcher.d.ts +5 -0
- package/dist/sdk/run/launcher.js +6 -0
- package/dist/sdk/run/payload.d.ts +58 -0
- package/dist/sdk/run/payload.js +73 -0
- package/dist/sdk/run/present.d.ts +11 -0
- package/dist/sdk/run/present.js +4 -0
- package/dist/sdk/run/redact.d.ts +5 -0
- package/dist/sdk/run/redact.js +12 -0
- package/dist/story/align.d.ts +1 -1
- package/dist/story/align.js +1 -1
- package/dist/story/command-line.d.ts +6 -16
- package/dist/story/command-line.js +11 -23
- package/dist/story/errors.d.ts +1 -1
- package/dist/story/errors.js +1 -1
- package/dist/story/host.d.ts +1 -1
- package/dist/story/host.js +2 -2
- package/dist/story/index.d.ts +2 -2
- package/dist/story/index.js +4 -3
- package/dist/story/launch.d.ts +70 -0
- package/dist/story/launch.js +77 -0
- package/dist/story/report.d.ts +2 -2
- package/dist/story/report.js +3 -4
- package/dist/story/settle.d.ts +7 -7
- package/dist/story/settle.js +5 -5
- package/dist/story/start.d.ts +2 -2
- package/dist/time/duration.js +2 -2
- package/dist/time/index.js +2 -1
- package/dist/time/time.d.ts +2 -11
- package/dist/time/time.js +2 -2
- package/dist/{sdk → vendor/testserver-sdk}/container/api-request.d.ts +14 -2
- package/dist/vendor/testserver-sdk/container/api-request.js +68 -0
- package/dist/vendor/testserver-sdk/container/container.d.ts +199 -0
- package/dist/vendor/testserver-sdk/container/container.js +458 -0
- package/dist/vendor/testserver-sdk/container/external.d.ts +111 -0
- package/dist/vendor/testserver-sdk/container/external.js +76 -0
- package/dist/vendor/testserver-sdk/container/gateways.d.ts +156 -0
- package/dist/{sdk → vendor/testserver-sdk}/container/index.d.ts +2 -1
- package/dist/{sdk → vendor/testserver-sdk}/container/index.js +2 -1
- package/dist/vendor/testserver-sdk/container/live/container-gateway.d.ts +22 -0
- package/dist/vendor/testserver-sdk/container/live/container-gateway.js +165 -0
- package/dist/vendor/testserver-sdk/container/recorder.d.ts +69 -0
- package/dist/vendor/testserver-sdk/container/recorder.js +121 -0
- package/dist/{sdk → vendor/testserver-sdk}/factories/build.d.ts +33 -12
- package/dist/{sdk → vendor/testserver-sdk}/factories/build.js +36 -14
- package/dist/vendor/testserver-sdk/factories/definition.d.ts +39 -0
- package/dist/{sdk → vendor/testserver-sdk}/factories/definition.js +1 -1
- package/dist/{sdk → vendor/testserver-sdk}/factories/definitions.d.ts +7 -4
- package/dist/{sdk → vendor/testserver-sdk}/factories/definitions.js +10 -0
- package/dist/vendor/testserver-sdk/factories/gateways.d.ts +31 -0
- package/dist/vendor/testserver-sdk/factories/index.d.ts +4 -0
- package/dist/{sdk → vendor/testserver-sdk}/factories/index.js +3 -3
- package/dist/vendor/testserver-sdk/index.d.ts +6 -0
- package/dist/vendor/testserver-sdk/index.js +11 -0
- package/dist/{sdk → vendor/testserver-sdk}/proxy/exchange.d.ts +2 -1
- package/dist/{sdk → vendor/testserver-sdk}/proxy/exchange.js +8 -4
- package/dist/{sdk → vendor/testserver-sdk}/proxy/faulted-exchange.js +7 -2
- package/dist/{sdk → vendor/testserver-sdk}/proxy/faults.d.ts +2 -1
- package/dist/{sdk → vendor/testserver-sdk}/proxy/records.d.ts +10 -1
- package/dist/{sdk → vendor/testserver-sdk}/proxy/records.js +13 -0
- package/dist/{sdk → vendor/testserver-sdk}/records/index.d.ts +1 -1
- package/dist/{sdk → vendor/testserver-sdk}/records/records.d.ts +17 -1
- package/dist/vendor/testserver-sdk/testserver/external-ids.d.ts +38 -0
- package/dist/vendor/testserver-sdk/testserver/external-ids.js +46 -0
- package/dist/vendor/testserver-sdk/testserver/failure.d.ts +102 -0
- package/dist/vendor/testserver-sdk/testserver/failure.js +109 -0
- package/dist/vendor/testserver-sdk/testserver/index.d.ts +7 -0
- package/dist/vendor/testserver-sdk/testserver/index.js +11 -0
- package/dist/{sdk → vendor/testserver-sdk}/testserver/live/request.d.ts +8 -10
- package/dist/{sdk → vendor/testserver-sdk}/testserver/live/request.js +8 -6
- package/dist/vendor/testserver-sdk/testserver/routes.d.ts +60 -0
- package/dist/vendor/testserver-sdk/testserver/routes.js +84 -0
- package/dist/vendor/testserver-sdk/testserver/service-ids.d.ts +31 -0
- package/dist/{sdk → vendor/testserver-sdk}/testserver/service-ids.js +27 -4
- package/dist/vitest/config.d.ts +2 -28
- package/dist/vitest/config.js +6 -36
- package/dist/vitest/gateways.js +1 -1
- package/dist/vitest/index.d.ts +2 -3
- package/dist/vitest/index.js +5 -9
- package/dist/vitest/plan.d.ts +1 -16
- package/dist/vitest/plan.js +4 -36
- package/dist/vitest/test-events.d.ts +1 -18
- package/dist/vitest/test-events.js +2 -31
- package/package.json +52 -23
- package/skills/overview.md +12 -9
- package/skills/read-run-output.md +26 -3
- package/skills/testserver-builds.md +8 -8
- package/dist/chunks/chunk-5CQCRX2L.js +0 -5768
- package/dist/chunks/chunk-5U5Q6VZR.js +0 -556
- package/dist/chunks/chunk-7O6UN63H.js +0 -63
- package/dist/chunks/chunk-NX55IJ5S.js +0 -1842
- package/dist/chunks/chunk-OCZJE5XV.js +0 -910
- package/dist/chunks/chunk-RRQ2ZGSE.js +0 -1512
- package/dist/chunks/chunk-S5NAIZYS.js +0 -13
- package/dist/chunks/chunk-UHO5OCEX.js +0 -360
- package/dist/chunks/chunk-WBIHJM7D.js +0 -188
- package/dist/combine-errors.d.ts +0 -11
- package/dist/combine-errors.js +0 -19
- package/dist/commands/exec/run-collector.d.ts +0 -30
- package/dist/commands/exec/run-record.js +0 -152
- package/dist/commands/exec/testserver-flags.d.ts +0 -48
- package/dist/commands/exec/testserver-flags.js +0 -80
- package/dist/config/by-name.d.ts +0 -24
- package/dist/config/by-name.js +0 -26
- package/dist/config/resource-config.d.ts +0 -132
- package/dist/config/resource-config.js +0 -19
- package/dist/config/set.d.ts +0 -27
- package/dist/config/set.js +0 -71
- package/dist/core/command-provider.d.ts +0 -126
- package/dist/core/command-provider.js +0 -13
- package/dist/core/command-slots.d.ts +0 -73
- package/dist/core/command-slots.js +0 -140
- package/dist/core/keyed.d.ts +0 -12
- package/dist/core/keyed.js +0 -24
- package/dist/core/lane.d.ts +0 -46
- package/dist/core/lane.js +0 -5
- package/dist/core/mint.d.ts +0 -10
- package/dist/core/mint.js +0 -14
- package/dist/core/presentation.d.ts +0 -87
- package/dist/core/presentation.js +0 -5
- package/dist/core/provider.d.ts +0 -79
- package/dist/core/provider.js +0 -5
- package/dist/resource-commands.d.ts +0 -13
- package/dist/resource-commands.js +0 -22
- package/dist/resources/github/cleanup.d.ts +0 -23
- package/dist/resources/github/cleanup.js +0 -39
- package/dist/resources/github/command.d.ts +0 -126
- package/dist/resources/github/command.js +0 -117
- package/dist/resources/github/config.d.ts +0 -16
- package/dist/resources/github/config.js +0 -37
- package/dist/resources/github/events.d.ts +0 -26
- package/dist/resources/github/events.js +0 -2
- package/dist/resources/github/index.d.ts +0 -12
- package/dist/resources/github/index.js +0 -15
- package/dist/resources/github/live/gateways.d.ts +0 -6
- package/dist/resources/github/live/gateways.js +0 -13
- package/dist/resources/github/presentation.d.ts +0 -13
- package/dist/resources/github/presentation.js +0 -43
- package/dist/resources/github/provider.d.ts +0 -66
- package/dist/resources/github/provider.js +0 -58
- package/dist/resources/github/resource-provider.d.ts +0 -6
- package/dist/resources/github/resource-provider.js +0 -20
- package/dist/resources/github/resource.d.ts +0 -33
- package/dist/resources/github/resource.js +0 -12
- package/dist/resources/testserver/cleanup.d.ts +0 -14
- package/dist/resources/testserver/cleanup.js +0 -22
- package/dist/resources/testserver/command-tree.d.ts +0 -4
- package/dist/resources/testserver/command-tree.js +0 -12
- package/dist/resources/testserver/command.d.ts +0 -520
- package/dist/resources/testserver/command.js +0 -252
- package/dist/resources/testserver/commands/app.d.ts +0 -18
- package/dist/resources/testserver/commands/app.js +0 -3
- package/dist/resources/testserver/commands/create/metadata.d.ts +0 -31
- package/dist/resources/testserver/commands/create/metadata.js +0 -53
- package/dist/resources/testserver/commands/list/metadata.d.ts +0 -9
- package/dist/resources/testserver/config.d.ts +0 -18
- package/dist/resources/testserver/config.js +0 -88
- package/dist/resources/testserver/events.js +0 -4
- package/dist/resources/testserver/index.d.ts +0 -16
- package/dist/resources/testserver/index.js +0 -25
- package/dist/resources/testserver/live/gateways.d.ts +0 -8
- package/dist/resources/testserver/live/gateways.js +0 -39
- package/dist/resources/testserver/options.d.ts +0 -5
- package/dist/resources/testserver/options.js +0 -5
- package/dist/resources/testserver/pool/directory.d.ts +0 -4
- package/dist/resources/testserver/pool/directory.js +0 -5
- package/dist/resources/testserver/pool/live/pool-store-gateway.d.ts +0 -12
- package/dist/resources/testserver/pr-build-facts.d.ts +0 -130
- package/dist/resources/testserver/pr-build-facts.js +0 -261
- package/dist/resources/testserver/presentation.d.ts +0 -9
- package/dist/resources/testserver/provider.d.ts +0 -187
- package/dist/resources/testserver/pull-request/gateways.js +0 -5
- package/dist/resources/testserver/ran.d.ts +0 -92
- package/dist/resources/testserver/ran.js +0 -156
- package/dist/resources/testserver/resource-provider.d.ts +0 -12
- package/dist/resources/testserver/resource-provider.js +0 -32
- package/dist/resources/testserver/resource.d.ts +0 -36
- package/dist/resources/testserver/resource.js +0 -10
- package/dist/resources/testserver/run-sandbox.d.ts +0 -13
- package/dist/resources/testserver/run-sandbox.js +0 -6
- package/dist/resources/testserver/sandbox/index.js +0 -8
- package/dist/resources.d.ts +0 -702
- package/dist/resources.js +0 -83
- package/dist/sdk/container/api-request.js +0 -46
- package/dist/sdk/container/container.d.ts +0 -144
- package/dist/sdk/container/container.js +0 -346
- package/dist/sdk/container/gateways.d.ts +0 -108
- package/dist/sdk/container/live/container-gateway.d.ts +0 -17
- package/dist/sdk/container/live/container-gateway.js +0 -114
- package/dist/sdk/factories/definition.d.ts +0 -28
- package/dist/sdk/factories/gateways.d.ts +0 -25
- package/dist/sdk/factories/index.d.ts +0 -5
- package/dist/sdk/factories/live/factory-gateway.d.ts +0 -10
- package/dist/sdk/factories/live/factory-gateway.js +0 -29
- package/dist/sdk/host.d.ts +0 -2
- package/dist/sdk/host.js +0 -7
- package/dist/sdk/payload/index.d.ts +0 -2
- package/dist/sdk/payload/index.js +0 -4
- package/dist/sdk/payload/payload.d.ts +0 -47
- package/dist/sdk/payload/payload.js +0 -74
- package/dist/sdk/testserver/failure.d.ts +0 -73
- package/dist/sdk/testserver/failure.js +0 -61
- package/dist/sdk/testserver/index.d.ts +0 -5
- package/dist/sdk/testserver/index.js +0 -8
- package/dist/sdk/testserver/service-ids.d.ts +0 -19
- package/dist/story/mode.d.ts +0 -17
- package/dist/story/mode.js +0 -21
- package/dist/vitest/sandbox.d.ts +0 -22
- package/dist/vitest/sandbox.js +0 -41
- /package/dist/{credential/settle.js → config/credential-settle.js} +0 -0
- /package/dist/{resources → extensions}/github/gateways.d.ts +0 -0
- /package/dist/{resources → extensions}/github/gateways.js +0 -0
- /package/dist/{resources → extensions}/github/live/fixture-repo-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/github/live/fixture-repo-gateway.js +0 -0
- /package/dist/{resources/testserver/commands → extensions/testserver/commands/pool}/list/outcomes.d.ts +0 -0
- /package/dist/{core → extensions/testserver}/limit.d.ts +0 -0
- /package/dist/{resources/testserver/sandbox → extensions/testserver/options}/build-reference.d.ts +0 -0
- /package/dist/{resources/testserver/sandbox → extensions/testserver/options}/build-reference.js +0 -0
- /package/dist/{resources/testserver/sandbox → extensions/testserver/options}/channels.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/gateways.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pool/gateways.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/host.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pool/host.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/inspect.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/lease.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/live/pool-records.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pool/live/pool-records.js +0 -0
- /package/dist/{resources → extensions}/testserver/pool/staleness.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pool/staleness.js +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/index.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/github-rest.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/github-rest.js +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/pull-request-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/pull-request-gateway.js +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/testserver-workflow-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/pull-request/live/testserver-workflow-gateway.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/create-failure.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/create-failure.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/gateways.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/builds-response.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/builds-response.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/control-plane-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/control-plane-gateway.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/create-response.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/create-response.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/fetch-failure.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/fetch-failure.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/health-check-gateway.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/health-check-gateway.js +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/sse.d.ts +0 -0
- /package/dist/{resources → extensions}/testserver/sandbox/live/sse.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/ansi.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/ansi.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/arguments.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/auth-config.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/auth-config.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/clock.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/clock.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/config-files.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/config-files.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/context.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/driver.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/entry.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/entry.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/environment.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/environment.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/errors.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/errors.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/gateways.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/index.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/keys.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/keys.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/live/config-files.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/live/config-files.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/live/process-gateway.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/live/process-gateway.js +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/redaction.d.ts +0 -0
- /package/dist/{vercel-cli → extensions/testserver/vercel-cli}/verbose.d.ts +0 -0
- /package/dist/{vitest → extensions/testserver/vitest}/types.js +0 -0
- /package/dist/{core → run-directory}/live/run-directory-gateway.d.ts +0 -0
- /package/dist/{core → run-directory}/live/run-directory-gateway.js +0 -0
- /package/dist/sdk/{payload → run}/test-events.d.ts +0 -0
- /package/dist/sdk/{payload → run}/test-events.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/container/feature-flags.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/container/feature-flags.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/container/gateways.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/factories/gateways.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/faulted-exchange.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/faults.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/index.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/index.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/proxy.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/proxy/proxy.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/records/body.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/records/body.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/records/index.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/records/records.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/seed/index.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/seed/index.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/seed/seed.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/seed/seed.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/clock.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/clock.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/live/connect-failure.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/live/connect-failure.js +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/test-id.d.ts +0 -0
- /package/dist/{sdk → vendor/testserver-sdk}/testserver/test-id.js +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { bearerToken, decodeBody, incomingHeaders, RECORDED_BODY_CAP_BYTES, redactBody, redactSecrets, redactTokenFields, tokenSecrets, } from "../records/index.js";
|
|
2
|
+
import { redactFailure } from "../testserver/index.js";
|
|
3
|
+
import { apiRequestRecord } from "./api-request.js";
|
|
4
|
+
/**
|
|
5
|
+
* What a container has done, and every token secret it has seen. Each write collects its secrets before it keeps
|
|
6
|
+
* its record, so `redact` replaces a secret as soon as anything holds it. Its reads return copies.
|
|
7
|
+
*/
|
|
8
|
+
export class ContainerRecorder {
|
|
9
|
+
#factoryCalls = [];
|
|
10
|
+
#apiRequests = [];
|
|
11
|
+
#externalCalls = [];
|
|
12
|
+
#setupCalls = [];
|
|
13
|
+
#warmups = [];
|
|
14
|
+
#secrets = new Set();
|
|
15
|
+
get factoryCalls() {
|
|
16
|
+
return [...this.#factoryCalls];
|
|
17
|
+
}
|
|
18
|
+
get apiRequests() {
|
|
19
|
+
return [...this.#apiRequests];
|
|
20
|
+
}
|
|
21
|
+
get externalCalls() {
|
|
22
|
+
return [...this.#externalCalls];
|
|
23
|
+
}
|
|
24
|
+
get setupCalls() {
|
|
25
|
+
return [...this.#setupCalls];
|
|
26
|
+
}
|
|
27
|
+
get warmups() {
|
|
28
|
+
return [...this.#warmups];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Keeps a factory call's record as it came, but a failure redacted, and learns every token secret in its input,
|
|
32
|
+
* options and response first.
|
|
33
|
+
*/
|
|
34
|
+
factoryCall(call) {
|
|
35
|
+
const seen = [call.input, call.options, call.outcome.ok ? call.outcome.response : undefined];
|
|
36
|
+
for (const value of seen)
|
|
37
|
+
this.#learn(value);
|
|
38
|
+
const { outcome } = call;
|
|
39
|
+
this.#factoryCalls.push(outcome.ok ? call : { ...call, outcome: { ok: false, failure: this.#redactFailure(outcome.failure) } });
|
|
40
|
+
}
|
|
41
|
+
/** Keeps a setup call's record, its return value with every token field reading `<token>`, once it has learned them. */
|
|
42
|
+
setupCall(run) {
|
|
43
|
+
const { scriptId, startedAt, durationMs } = run;
|
|
44
|
+
if (!run.outcome.ok) {
|
|
45
|
+
const failure = this.#redactFailure(run.outcome.failure);
|
|
46
|
+
this.#setupCalls.push({ scriptId, outcome: { ok: false, failure }, startedAt, durationMs });
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.#learn(run.outcome.value);
|
|
50
|
+
const response = redactTokenFields(run.outcome.value);
|
|
51
|
+
this.#setupCalls.push({ scriptId, outcome: { ok: true, response }, startedAt, durationMs });
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Begins the record of one exchange on `channel`: learns the bearer token it sends and keeps its request body, before
|
|
55
|
+
* it is sent, so `redact` covers a refused answer's excerpt.
|
|
56
|
+
*/
|
|
57
|
+
begin(channel, sent) {
|
|
58
|
+
const authorization = sent.headers.find(([name]) => name.toLowerCase() === "authorization")?.[1];
|
|
59
|
+
const bearer = bearerToken(authorization);
|
|
60
|
+
if (bearer !== undefined && bearer !== "")
|
|
61
|
+
this.#secrets.add(bearer);
|
|
62
|
+
const requestBody = this.#kept(sent.body, sent.headers, bearer);
|
|
63
|
+
let responseBody;
|
|
64
|
+
let ended = false;
|
|
65
|
+
return {
|
|
66
|
+
answered: (answer) => {
|
|
67
|
+
responseBody = this.#kept(answer.body, answer.headers, bearer);
|
|
68
|
+
},
|
|
69
|
+
end: (outcome, now) => {
|
|
70
|
+
if (ended)
|
|
71
|
+
return;
|
|
72
|
+
ended = true;
|
|
73
|
+
const fields = apiRequestRecord({
|
|
74
|
+
method: sent.method,
|
|
75
|
+
target: sent.target,
|
|
76
|
+
authorization: authorization !== undefined,
|
|
77
|
+
requestBody,
|
|
78
|
+
responseBody,
|
|
79
|
+
startedAt: sent.startedAt,
|
|
80
|
+
durationMs: now - sent.startedAt,
|
|
81
|
+
outcome,
|
|
82
|
+
});
|
|
83
|
+
if (channel.kind === "api")
|
|
84
|
+
this.#apiRequests.push(fields);
|
|
85
|
+
else
|
|
86
|
+
this.#externalCalls.push({ externalId: channel.externalId, ...fields });
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/** Keeps a warmup's record, each failed service's error redacted, and returns it. */
|
|
91
|
+
warmup(warmup) {
|
|
92
|
+
const kept = {
|
|
93
|
+
...warmup,
|
|
94
|
+
services: warmup.services.map((service) => service.ok ? service : { ...service, error: this.redact(service.error) }),
|
|
95
|
+
};
|
|
96
|
+
this.#warmups.push(kept);
|
|
97
|
+
return kept;
|
|
98
|
+
}
|
|
99
|
+
/** `text` with every token secret the container has seen replaced by `<token>`. */
|
|
100
|
+
redact(text) {
|
|
101
|
+
return redactSecrets(text, this.#secrets);
|
|
102
|
+
}
|
|
103
|
+
/** `failure` with every text it quotes of an answer redacted (`redactFailure`). */
|
|
104
|
+
#redactFailure(failure) {
|
|
105
|
+
return redactFailure(failure, (text) => this.redact(text));
|
|
106
|
+
}
|
|
107
|
+
/** A body as its record keeps it: decoded, capped and redacted, the strings under its JSON token fields learned. */
|
|
108
|
+
#kept(bytes, headers, bearer) {
|
|
109
|
+
if (bytes.byteLength === 0)
|
|
110
|
+
return undefined;
|
|
111
|
+
const raw = bytes.byteLength > RECORDED_BODY_CAP_BYTES ? undefined : bytes;
|
|
112
|
+
const decoded = decodeBody(raw, bytes.byteLength, incomingHeaders(headers));
|
|
113
|
+
if (decoded.kind === "json")
|
|
114
|
+
this.#learn(decoded.value);
|
|
115
|
+
return redactBody(decoded, bearer);
|
|
116
|
+
}
|
|
117
|
+
#learn(value) {
|
|
118
|
+
for (const secret of tokenSecrets(value))
|
|
119
|
+
this.#secrets.add(secret);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { z } from "zod";
|
|
2
2
|
import { type Clock, type TestserverFailure } from "../testserver/index.ts";
|
|
3
|
-
import { type AnyFactoryDefinition, type FactoryInput, type FactoryOutput } from "./definition.ts";
|
|
3
|
+
import { type AnyFactoryDefinition, type FactoryInput, type FactoryOptionsOf, type FactoryOutput } from "./definition.ts";
|
|
4
4
|
import type { FactoryGateway, FactoryOptions } from "./gateways.ts";
|
|
5
5
|
/**
|
|
6
|
-
* One factory call a container made, typed or untyped,
|
|
7
|
-
*
|
|
6
|
+
* One factory call a container made, typed or untyped, through one of Testserver's factories or, with `externalId`,
|
|
7
|
+
* one of that external service's, for failure output. `input` is the data sent. A call whose input its definition
|
|
8
|
+
* rejected was never sent and has no record.
|
|
8
9
|
*/
|
|
9
10
|
export interface FactoryCall {
|
|
11
|
+
/** The external service whose factory built it, such as `stripe`; absent for Testserver's own factories. */
|
|
12
|
+
readonly externalId?: string;
|
|
10
13
|
readonly path: string;
|
|
11
14
|
readonly input: unknown;
|
|
12
15
|
readonly options?: FactoryOptions;
|
|
@@ -26,19 +29,34 @@ export interface FactoryContext {
|
|
|
26
29
|
readonly factories: FactoryGateway;
|
|
27
30
|
readonly clock: Clock;
|
|
28
31
|
}
|
|
29
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* The container a factory call seeds, and what keeps its call records. With `externalId`, the call goes to that
|
|
34
|
+
* external service's factories.
|
|
35
|
+
*/
|
|
30
36
|
export interface FactoryTarget {
|
|
31
37
|
readonly testserverUrl: string;
|
|
32
38
|
readonly testId: string;
|
|
39
|
+
readonly externalId?: string;
|
|
33
40
|
/** Keeps the record of a call once it has ended, before the call resolves or rejects. */
|
|
34
41
|
readonly record: (call: FactoryCall) => void;
|
|
42
|
+
/** Hides every secret the target has learned, those in the call's record among them, in a failed call's error. */
|
|
43
|
+
readonly redact: (text: string) => string;
|
|
35
44
|
}
|
|
36
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* What part of a factory call the SDK refused before sending it: the data, which the definition's `input` schema
|
|
47
|
+
* rejected; the options, which its `options` schema rejected; or the path of an untyped call, which is no factory path.
|
|
48
|
+
*/
|
|
49
|
+
export type FactoryInputPart = "input" | "options" | "path";
|
|
50
|
+
/**
|
|
51
|
+
* A factory call was refused before anything was sent: its definition rejected the data or the options passed to it,
|
|
52
|
+
* or an untyped call's path is no factory path. `part` says which; a refused call has no record.
|
|
53
|
+
*/
|
|
37
54
|
export declare class FactoryInputError extends Error {
|
|
38
55
|
readonly name = "FactoryInputError";
|
|
39
56
|
readonly path: string;
|
|
57
|
+
readonly part: FactoryInputPart;
|
|
40
58
|
readonly issues: readonly z.core.$ZodIssue[];
|
|
41
|
-
constructor(path: string, message: string, issues?: readonly z.core.$ZodIssue[]);
|
|
59
|
+
constructor(path: string, part: FactoryInputPart, message: string, issues?: readonly z.core.$ZodIssue[]);
|
|
42
60
|
}
|
|
43
61
|
/**
|
|
44
62
|
* A factory answered with a response its definition's output schema rejects: the definition has drifted from
|
|
@@ -53,14 +71,17 @@ export declare class FactoryOutputError extends Error {
|
|
|
53
71
|
constructor(definition: AnyFactoryDefinition, issues: readonly z.core.$ZodIssue[], response: unknown);
|
|
54
72
|
}
|
|
55
73
|
/**
|
|
56
|
-
* Builds one entity through `definition`: checks `data` against its input schema
|
|
57
|
-
*
|
|
58
|
-
*
|
|
74
|
+
* Builds one entity through `definition`: checks `data` against its input schema and `options`, when given, against
|
|
75
|
+
* its options schema, when it has one, sends the parsed values, and returns the response parsed by its output
|
|
76
|
+
* schema. A definition with no options schema sends `options` unchecked. Throws a `FactoryInputError` before sending
|
|
77
|
+
* (`part` `input` or `options`), a `TestserverCallError` when the call fails, and a `FactoryOutputError` when the
|
|
78
|
+
* response doesn't match the definition.
|
|
59
79
|
*/
|
|
60
|
-
export declare function buildFactory<D extends AnyFactoryDefinition>(context: FactoryContext, target: FactoryTarget, definition: D, data: FactoryInput<D>, options?:
|
|
80
|
+
export declare function buildFactory<D extends AnyFactoryDefinition>(context: FactoryContext, target: FactoryTarget, definition: D, data: FactoryInput<D>, options?: FactoryOptionsOf<D>): Promise<FactoryOutput<D>>;
|
|
61
81
|
/**
|
|
62
82
|
* Builds one entity through the factory at `path` (such as `tokens/tokens`) with no definition, returning the
|
|
63
|
-
* response unchecked: for reaching a factory before its definition exists
|
|
64
|
-
*
|
|
83
|
+
* response unchecked: for reaching a factory before its definition exists, or one of an external service's factories
|
|
84
|
+
* (a target with an `externalId`). Throws a `FactoryInputError` (`part` `path`) for a malformed path before sending,
|
|
85
|
+
* and a `TestserverCallError` when the call fails or its answer isn't JSON.
|
|
65
86
|
*/
|
|
66
87
|
export declare function buildUntypedFactory(context: FactoryContext, target: FactoryTarget, path: string, data: unknown, options?: FactoryOptions): Promise<unknown>;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import { TestserverCallError } from "../testserver/index.js";
|
|
2
|
-
import { checkFactoryPath } from "./definition.js";
|
|
3
|
-
/**
|
|
1
|
+
import { redactFailure, TestserverCallError } from "../testserver/index.js";
|
|
2
|
+
import { checkFactoryPath, } from "./definition.js";
|
|
3
|
+
/**
|
|
4
|
+
* A factory call was refused before anything was sent: its definition rejected the data or the options passed to it,
|
|
5
|
+
* or an untyped call's path is no factory path. `part` says which; a refused call has no record.
|
|
6
|
+
*/
|
|
4
7
|
export class FactoryInputError extends Error {
|
|
5
8
|
name = "FactoryInputError";
|
|
6
9
|
path;
|
|
10
|
+
part;
|
|
7
11
|
issues;
|
|
8
|
-
constructor(path, message, issues = []) {
|
|
12
|
+
constructor(path, part, message, issues = []) {
|
|
9
13
|
super(message);
|
|
10
14
|
this.path = path;
|
|
15
|
+
this.part = part;
|
|
11
16
|
this.issues = issues;
|
|
12
17
|
}
|
|
13
18
|
}
|
|
@@ -30,16 +35,19 @@ export class FactoryOutputError extends Error {
|
|
|
30
35
|
}
|
|
31
36
|
}
|
|
32
37
|
/**
|
|
33
|
-
* Builds one entity through `definition`: checks `data` against its input schema
|
|
34
|
-
*
|
|
35
|
-
*
|
|
38
|
+
* Builds one entity through `definition`: checks `data` against its input schema and `options`, when given, against
|
|
39
|
+
* its options schema, when it has one, sends the parsed values, and returns the response parsed by its output
|
|
40
|
+
* schema. A definition with no options schema sends `options` unchecked. Throws a `FactoryInputError` before sending
|
|
41
|
+
* (`part` `input` or `options`), a `TestserverCallError` when the call fails, and a `FactoryOutputError` when the
|
|
42
|
+
* response doesn't match the definition.
|
|
36
43
|
*/
|
|
37
44
|
export async function buildFactory(context, target, definition, data, options) {
|
|
38
45
|
const input = definition.input.safeParse(data);
|
|
39
46
|
if (!input.success) {
|
|
40
|
-
throw new FactoryInputError(definition.path, `factory ${definition.path} rejected its input${describeIssue(input.error.issues)}`, input.error.issues);
|
|
47
|
+
throw new FactoryInputError(definition.path, "input", `factory ${definition.path} rejected its input${describeIssue(input.error.issues)}`, input.error.issues);
|
|
41
48
|
}
|
|
42
|
-
const
|
|
49
|
+
const checked = checkOptions(definition, options);
|
|
50
|
+
const response = await call(context, target, definition.path, input.data, checked);
|
|
43
51
|
const output = definition.output.safeParse(response);
|
|
44
52
|
if (!output.success)
|
|
45
53
|
throw new FactoryOutputError(definition, output.error.issues, response);
|
|
@@ -47,20 +55,33 @@ export async function buildFactory(context, target, definition, data, options) {
|
|
|
47
55
|
}
|
|
48
56
|
/**
|
|
49
57
|
* Builds one entity through the factory at `path` (such as `tokens/tokens`) with no definition, returning the
|
|
50
|
-
* response unchecked: for reaching a factory before its definition exists
|
|
51
|
-
*
|
|
58
|
+
* response unchecked: for reaching a factory before its definition exists, or one of an external service's factories
|
|
59
|
+
* (a target with an `externalId`). Throws a `FactoryInputError` (`part` `path`) for a malformed path before sending,
|
|
60
|
+
* and a `TestserverCallError` when the call fails or its answer isn't JSON.
|
|
52
61
|
*/
|
|
53
62
|
export async function buildUntypedFactory(context, target, path, data, options) {
|
|
54
63
|
const problem = checkFactoryPath(path);
|
|
55
64
|
if (problem !== undefined)
|
|
56
|
-
throw new FactoryInputError(path, problem);
|
|
65
|
+
throw new FactoryInputError(path, "path", problem);
|
|
57
66
|
return call(context, target, path, data, options);
|
|
58
67
|
}
|
|
68
|
+
/** `options` as its definition's options schema parsed them, or as given when it has none or none were given. */
|
|
69
|
+
function checkOptions(definition, options) {
|
|
70
|
+
if (options === undefined || definition.options === undefined)
|
|
71
|
+
return options;
|
|
72
|
+
const parsed = definition.options.safeParse(options);
|
|
73
|
+
if (!parsed.success) {
|
|
74
|
+
throw new FactoryInputError(definition.path, "options", `factory ${definition.path} rejected its options${describeIssue(parsed.error.issues)}`, parsed.error.issues);
|
|
75
|
+
}
|
|
76
|
+
return parsed.data;
|
|
77
|
+
}
|
|
59
78
|
async function call(context, target, path, data, options) {
|
|
60
79
|
const startedAt = context.clock.now();
|
|
80
|
+
const external = target.externalId === undefined ? {} : { externalId: target.externalId };
|
|
61
81
|
const outcome = await context.factories.build({
|
|
62
82
|
testserverUrl: target.testserverUrl,
|
|
63
83
|
testId: target.testId,
|
|
84
|
+
...external,
|
|
64
85
|
path,
|
|
65
86
|
data,
|
|
66
87
|
...(options === undefined ? {} : { options }),
|
|
@@ -68,6 +89,7 @@ async function call(context, target, path, data, options) {
|
|
|
68
89
|
const durationMs = context.clock.now() - startedAt;
|
|
69
90
|
const record = (recorded) => {
|
|
70
91
|
target.record({
|
|
92
|
+
...external,
|
|
71
93
|
path,
|
|
72
94
|
input: data,
|
|
73
95
|
...(options === undefined ? {} : { options }),
|
|
@@ -79,10 +101,10 @@ async function call(context, target, path, data, options) {
|
|
|
79
101
|
if (!outcome.ok) {
|
|
80
102
|
record({ ok: false, failure: outcome.failure });
|
|
81
103
|
throw new TestserverCallError({
|
|
82
|
-
call:
|
|
104
|
+
call: outcome.call,
|
|
83
105
|
testId: target.testId,
|
|
84
106
|
testserverUrl: target.testserverUrl,
|
|
85
|
-
failure: outcome.failure,
|
|
107
|
+
failure: redactFailure(outcome.failure, target.redact),
|
|
86
108
|
});
|
|
87
109
|
}
|
|
88
110
|
record({ ok: true, response: outcome.body });
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import type { FactoryOptions } from "./gateways.ts";
|
|
3
|
+
/** A factory definition's options schema: strict, as its input is. */
|
|
4
|
+
export type FactoryOptionsSchema = z.ZodObject<z.core.$ZodShape, z.core.$strict>;
|
|
5
|
+
/**
|
|
6
|
+
* The SDK's typed, schema-checked description of one factory.
|
|
7
|
+
*
|
|
8
|
+
* - `path` is the factory's path under `/_/factories/`, with `/` for nesting (`tokens/tokens`).
|
|
9
|
+
* - `checkedAgainst` is the `vercel/api` commit the schemas were checked against.
|
|
10
|
+
* - `input` is strict: an unknown field is rejected before anything is sent, because Testserver may ignore it.
|
|
11
|
+
* - `output` is loose: declared fields are checked and typed, and the rest pass through untyped.
|
|
12
|
+
* - `options`, when present, is strict like `input` and checks the options a call passes, the second element of the
|
|
13
|
+
* `[data, options]` body. Without it a call's options are `FactoryOptions`, sent unchecked.
|
|
14
|
+
*/
|
|
15
|
+
export interface FactoryDefinition<InputShape extends z.core.$ZodShape, OutputShape extends z.core.$ZodShape, Options extends FactoryOptionsSchema | undefined = undefined> {
|
|
16
|
+
readonly path: string;
|
|
17
|
+
readonly checkedAgainst: string;
|
|
18
|
+
readonly input: z.ZodObject<InputShape, z.core.$strict>;
|
|
19
|
+
readonly output: z.ZodObject<OutputShape, z.core.$loose>;
|
|
20
|
+
readonly options?: Options;
|
|
21
|
+
}
|
|
22
|
+
/** Any factory definition. */
|
|
23
|
+
export type AnyFactoryDefinition = FactoryDefinition<z.core.$ZodShape, z.core.$ZodShape, FactoryOptionsSchema | undefined>;
|
|
24
|
+
/** What a definition's factory takes. */
|
|
25
|
+
export type FactoryInput<D extends AnyFactoryDefinition> = z.input<D["input"]>;
|
|
26
|
+
/** What a definition's factory returns, past its output schema. */
|
|
27
|
+
export type FactoryOutput<D extends AnyFactoryDefinition> = z.output<D["output"]>;
|
|
28
|
+
/** The options a definition's factory takes: its `options` schema's input, or `FactoryOptions` when it has none. */
|
|
29
|
+
export type FactoryOptionsOf<D extends AnyFactoryDefinition> = OptionsInput<Exclude<D["options"], undefined>>;
|
|
30
|
+
/** `Schema`'s input, or `FactoryOptions` for no schema (`never`). */
|
|
31
|
+
type OptionsInput<Schema> = [Schema] extends [never] ? FactoryOptions : Schema extends FactoryOptionsSchema ? z.input<Schema> : FactoryOptions;
|
|
32
|
+
/**
|
|
33
|
+
* Why `path` is no factory path, or `undefined` when it is one or more `/`-separated names of letters, digits,
|
|
34
|
+
* `_` and `-`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function checkFactoryPath(path: string): string | undefined;
|
|
37
|
+
/** Declares a factory definition, with an `options` schema or without one. */
|
|
38
|
+
export declare function defineFactory<InputShape extends z.core.$ZodShape, OutputShape extends z.core.$ZodShape, Options extends FactoryOptionsSchema | undefined = undefined>(definition: FactoryDefinition<InputShape, OutputShape, Options>): FactoryDefinition<InputShape, OutputShape, Options>;
|
|
39
|
+
export {};
|
|
@@ -7,7 +7,7 @@ export function checkFactoryPath(path) {
|
|
|
7
7
|
? undefined
|
|
8
8
|
: `factory path ${JSON.stringify(path)} must be names of letters, digits, "_" and "-", separated by "/"`;
|
|
9
9
|
}
|
|
10
|
-
/** Declares a factory definition. */
|
|
10
|
+
/** Declares a factory definition, with an `options` schema or without one. */
|
|
11
11
|
export function defineFactory(definition) {
|
|
12
12
|
const problem = checkFactoryPath(definition.path);
|
|
13
13
|
if (problem !== undefined)
|
|
@@ -14,7 +14,7 @@ export declare const factories: {
|
|
|
14
14
|
name: z.ZodString;
|
|
15
15
|
email: z.ZodString;
|
|
16
16
|
defaultTeamId: z.ZodOptional<z.ZodString>;
|
|
17
|
-
}>;
|
|
17
|
+
}, undefined>;
|
|
18
18
|
readonly teams: import("./definition.ts").FactoryDefinition<{
|
|
19
19
|
id: z.ZodOptional<z.ZodString>;
|
|
20
20
|
slug: z.ZodOptional<z.ZodString>;
|
|
@@ -104,7 +104,10 @@ export declare const factories: {
|
|
|
104
104
|
off: "off";
|
|
105
105
|
on: "on";
|
|
106
106
|
}>>;
|
|
107
|
-
}
|
|
107
|
+
}, z.ZodObject<{
|
|
108
|
+
stripe: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
directV0UserIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
110
|
+
}, z.core.$strict>>;
|
|
108
111
|
readonly projects: import("./definition.ts").FactoryDefinition<{
|
|
109
112
|
id: z.ZodOptional<z.ZodString>;
|
|
110
113
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -130,7 +133,7 @@ export declare const factories: {
|
|
|
130
133
|
org: z.ZodOptional<z.ZodString>;
|
|
131
134
|
repo: z.ZodOptional<z.ZodString>;
|
|
132
135
|
}, z.core.$loose>>;
|
|
133
|
-
}>;
|
|
136
|
+
}, undefined>;
|
|
134
137
|
readonly tokens: {
|
|
135
138
|
readonly tokens: import("./definition.ts").FactoryDefinition<{
|
|
136
139
|
uid: z.ZodString;
|
|
@@ -161,6 +164,6 @@ export declare const factories: {
|
|
|
161
164
|
}, z.core.$loose>>;
|
|
162
165
|
projectId: z.ZodOptional<z.ZodString>;
|
|
163
166
|
projectScope: z.ZodOptional<z.ZodString>;
|
|
164
|
-
}>;
|
|
167
|
+
}, undefined>;
|
|
165
168
|
};
|
|
166
169
|
};
|
|
@@ -78,6 +78,12 @@ const onOffDefault = z.enum(["default", "on", "off"]);
|
|
|
78
78
|
* to `default`, and `disjunctiveProductionSecretPolicy` (production secrets kept apart from other environments' values
|
|
79
79
|
* for the same key) has no default; the factory stores either as given on the team (`packages/core-types/src/team.ts`,
|
|
80
80
|
* `Team`), where `GET /v2/teams/:teamId` reads them back.
|
|
81
|
+
*
|
|
82
|
+
* Its options, the same at vercel/api `49f61c3f111`: `stripe` creates the team's Stripe customer (its `customerId`)
|
|
83
|
+
* in the container's `stripe` external, through `POST /_/external/stripe/_/factories/customers`; it defaults to true
|
|
84
|
+
* under Testserver (`process.env.TESTSERVER === 'true'` in the factories service), and `false` skips it.
|
|
85
|
+
* `directV0UserIds` grants the `v0` entitlement to each listed member that is confirmed; Testserver's wrapper
|
|
86
|
+
* (`withSeededV0Entitlements`, `testserver/factories/src/server.ts`) takes it out of the options before building.
|
|
81
87
|
*/
|
|
82
88
|
const teams = defineFactory({
|
|
83
89
|
path: "teams",
|
|
@@ -141,6 +147,10 @@ const teams = defineFactory({
|
|
|
141
147
|
sensitiveEnvironmentVariablePolicy: onOffDefault.optional(),
|
|
142
148
|
disjunctiveProductionSecretPolicy: onOffDefault.optional(),
|
|
143
149
|
}),
|
|
150
|
+
options: z.strictObject({
|
|
151
|
+
stripe: z.boolean().optional(),
|
|
152
|
+
directV0UserIds: z.array(z.string()).optional(),
|
|
153
|
+
}),
|
|
144
154
|
});
|
|
145
155
|
/**
|
|
146
156
|
* A project's GitHub link (`packages/projects-types/types.ts`, `GithubProjectLink`), only the fields tests seed:
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { TestserverCallFailed } from "../testserver/index.ts";
|
|
2
|
+
/**
|
|
3
|
+
* A factory call's options, the second element of the `[data, options]` body, as the gateway sends them. A definition
|
|
4
|
+
* with an options schema types and checks them (`FactoryOptionsOf`).
|
|
5
|
+
*/
|
|
6
|
+
export type FactoryOptions = Readonly<Record<string, unknown>>;
|
|
7
|
+
/**
|
|
8
|
+
* One factory call: `path` (such as `tokens/tokens`) in the container `testId` selects, through one of Testserver's
|
|
9
|
+
* own factories, or with `externalId`, one of that external service's (such as Stripe's `customers`).
|
|
10
|
+
*/
|
|
11
|
+
export interface FactoryBuildRequest {
|
|
12
|
+
readonly testserverUrl: string;
|
|
13
|
+
readonly testId: string;
|
|
14
|
+
readonly externalId?: string;
|
|
15
|
+
readonly path: string;
|
|
16
|
+
readonly data: unknown;
|
|
17
|
+
readonly options?: FactoryOptions;
|
|
18
|
+
}
|
|
19
|
+
export type FactoryBuildOutcome = {
|
|
20
|
+
readonly ok: true;
|
|
21
|
+
readonly body: unknown;
|
|
22
|
+
} | TestserverCallFailed;
|
|
23
|
+
/**
|
|
24
|
+
* Testserver's factories, which seed entities into a container, and its external services' factories. An unknown
|
|
25
|
+
* path is an `http-error` 404, and a
|
|
26
|
+
* factory that fails to build is an `http-error` 500. It never rejects: every failure is in the outcome, with the call
|
|
27
|
+
* it sent.
|
|
28
|
+
*/
|
|
29
|
+
export interface FactoryGateway {
|
|
30
|
+
build(request: FactoryBuildRequest): Promise<FactoryBuildOutcome>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { buildFactory, buildUntypedFactory, type FactoryCall, type FactoryContext, FactoryInputError, type FactoryInputPart, FactoryOutputError, type FactoryTarget, } from "./build.ts";
|
|
2
|
+
export { type AnyFactoryDefinition, checkFactoryPath, defineFactory, type FactoryDefinition, type FactoryInput, type FactoryOptionsOf, type FactoryOptionsSchema, type FactoryOutput, } from "./definition.ts";
|
|
3
|
+
export { factories } from "./definitions.ts";
|
|
4
|
+
export type { FactoryBuildOutcome, FactoryBuildRequest, FactoryGateway, FactoryOptions } from "./gateways.ts";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// The SDK's `factories` module: factory definitions, the factory gateway, and building entities through them.
|
|
1
|
+
// The SDK's `factories` module: factory definitions, the factory gateway's port, and building entities through them.
|
|
2
|
+
// The container gateway implements the port (`ContainerGateway extends FactoryGateway`).
|
|
2
3
|
export { buildFactory, buildUntypedFactory, FactoryInputError, FactoryOutputError, } from "./build.js";
|
|
3
|
-
export { defineFactory, } from "./definition.js";
|
|
4
|
+
export { checkFactoryPath, defineFactory, } from "./definition.js";
|
|
4
5
|
export { factories } from "./definitions.js";
|
|
5
|
-
export { liveFactoryGateway } from "./live/factory-gateway.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { type Container, type ContainerInfo, type ContainerLogOptions, type ContainerLogRecord, type ContainerOptions, type ContainerRequestBody, type ContainerRequestInit, type ExternalService, FEATURE_FLAG_CLIENTS, type FeatureFlagClient, type FeatureFlags, featureFlagsKey, type FeatureFlagValue, type GitProvider, type GitProviderRequestLog, type GitProviderScenario, liveSdkContext, type SdkContext, type ServiceWarmup, type ServiceWarmupOutcome, type SetupCall, startContainer, withContainer, } from "./container/index.ts";
|
|
2
|
+
export { type AnyFactoryDefinition, defineFactory, type FactoryCall, factories, type FactoryDefinition, type FactoryInput, FactoryInputError, type FactoryInputPart, type FactoryOptions, type FactoryOptionsOf, type FactoryOptionsSchema, type FactoryOutput, FactoryOutputError, } from "./factories/index.ts";
|
|
3
|
+
export { type ContainerProxy, type FaultHandle, type FaultResponse, type FaultRule, type FaultUpstream, isOpenRecord, type OpenRequestOutcome, type ProxyFault, type ProxyOptions, type ProxyRequestOutcome, type ProxyRequestRecord, type ProxyTarget, startProxy, withProxy, } from "./proxy/index.ts";
|
|
4
|
+
export { type ApiRequestRecord, type ExternalCallRecord, RECORDED_BODY_CAP_BYTES, type RecordedBody, REDACTED, redactSecrets, redactTokenFields, } from "./records/index.ts";
|
|
5
|
+
export { type Login, type LoginOptions, type LoginProjectOption, type LoginTeamOptions, type SeededProject, type SeedProjectFields, type SeededTeam, type SeededTeamlessUser, type SeededToken, type SeededUser, type SeedTeamMember, type SeedDefaultTeamFields, type SeedUserFields, type Seeder, seeder, type SeederOptions, type TeamPolicies, type TeamPolicy, type TeamRole, } from "./seed/index.ts";
|
|
6
|
+
export { APP_SERVICE_IDS, APP_SERVICE_IDS_CHECKED_AGAINST, describeFailure, EXTERNAL_IDS_CHECKED_AGAINST, EXTERNAL_SERVICE_IDS, type ExternalServiceId, GIT_PROVIDER_IDS, type GitProviderId, type KnownExternalServiceId, type KnownSetupScriptId, type KnownTestserverServiceId, MAX_TEST_ID_LENGTH, SERVICE_IDS_CHECKED_AGAINST, SETUP_SCRIPT_IDS, type SetupScriptId, TESTSERVER_SERVICE_IDS, TESTSERVER_TRANSIENT_FAILURE, type TestserverServiceId, TEST_ID_HEADER, TestIdError, TestserverCallError, type TestserverFailure, } from "./testserver/index.ts";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// The Testserver SDK's published surface, `@vercel/testserver-sdk`: start containers on a Testserver sandbox, seed
|
|
2
|
+
// them through factories, the seeder's entity-level calls or setup scripts, send them API requests, reach their
|
|
3
|
+
// external services, warm their services, read their container logs, and proxy clients that can't send a test id. The gateway seams the SDK's own tests need live on each
|
|
4
|
+
// module's `index.ts`, and the fakes on `./testing` (`src/testing/index.ts`), not here. The package depends only on
|
|
5
|
+
// Node builtins and `zod`.
|
|
6
|
+
export { FEATURE_FLAG_CLIENTS, featureFlagsKey, liveSdkContext, startContainer, withContainer, } from "./container/index.js";
|
|
7
|
+
export { defineFactory, factories, FactoryInputError, FactoryOutputError, } from "./factories/index.js";
|
|
8
|
+
export { isOpenRecord, startProxy, withProxy, } from "./proxy/index.js";
|
|
9
|
+
export { RECORDED_BODY_CAP_BYTES, REDACTED, redactSecrets, redactTokenFields, } from "./records/index.js";
|
|
10
|
+
export { seeder, } from "./seed/index.js";
|
|
11
|
+
export { APP_SERVICE_IDS, APP_SERVICE_IDS_CHECKED_AGAINST, describeFailure, EXTERNAL_IDS_CHECKED_AGAINST, EXTERNAL_SERVICE_IDS, GIT_PROVIDER_IDS, MAX_TEST_ID_LENGTH, SERVICE_IDS_CHECKED_AGAINST, SETUP_SCRIPT_IDS, TESTSERVER_SERVICE_IDS, TESTSERVER_TRANSIENT_FAILURE, TEST_ID_HEADER, TestIdError, TestserverCallError, } from "./testserver/index.js";
|
|
@@ -53,6 +53,7 @@ export declare class Exchange {
|
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Forwards the request with no fault rule: Testserver's status and headers go to the client as they arrive, and both
|
|
56
|
-
* bodies stream through undecoded while the exchange keeps a copy of each for its record.
|
|
56
|
+
* bodies stream through undecoded while the exchange keeps a copy of each for its record. The record of Testserver's
|
|
57
|
+
* 503 for a stopped container has its `error` too (`answeredOutcome`).
|
|
57
58
|
*/
|
|
58
59
|
export declare function passThrough(exchange: Exchange): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { bearerToken, BodyCapture } from "../records/index.js";
|
|
2
|
-
import { forwardableHeaders, proxyRecord } from "./records.js";
|
|
2
|
+
import { answeredOutcome, forwardableHeaders, proxyRecord, } from "./records.js";
|
|
3
3
|
/** The error of an exchange that was still open when its proxy closed. */
|
|
4
4
|
const CLOSED_ERROR = "the proxy closed";
|
|
5
5
|
/** The error of an exchange whose client closed its connection before the response ended. */
|
|
@@ -98,7 +98,7 @@ export class Exchange {
|
|
|
98
98
|
unreachable(error, upstream) {
|
|
99
99
|
this.record({ error: error.message }, undefined, upstream);
|
|
100
100
|
this.response.writeHead(502, { "content-type": "text/plain" });
|
|
101
|
-
this.response.end(`
|
|
101
|
+
this.response.end(`testserver proxy: Testserver could not be reached: ${error.message}`);
|
|
102
102
|
}
|
|
103
103
|
/** Runs `step` after `delayMs`, at once for 0; the exchange's end cancels a pending one. */
|
|
104
104
|
after(delayMs, step) {
|
|
@@ -139,7 +139,8 @@ export class Exchange {
|
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
141
141
|
* Forwards the request with no fault rule: Testserver's status and headers go to the client as they arrive, and both
|
|
142
|
-
* bodies stream through undecoded while the exchange keeps a copy of each for its record.
|
|
142
|
+
* bodies stream through undecoded while the exchange keeps a copy of each for its record. The record of Testserver's
|
|
143
|
+
* 503 for a stopped container has its `error` too (`answeredOutcome`).
|
|
143
144
|
*/
|
|
144
145
|
export function passThrough(exchange) {
|
|
145
146
|
const { request, response } = exchange;
|
|
@@ -151,7 +152,10 @@ export function passThrough(exchange) {
|
|
|
151
152
|
answer.on("data", (chunk) => responseBody.push(chunk));
|
|
152
153
|
// Registered before `pipe`, whose own `end` listener ends the client's response: the record is in
|
|
153
154
|
// `requests` before the client sees its answer end.
|
|
154
|
-
answer.on("end", () =>
|
|
155
|
+
answer.on("end", () => {
|
|
156
|
+
const recorded = responseBody.complete(answer.headers, exchange.bearer);
|
|
157
|
+
exchange.record(answeredOutcome(status, recorded), recorded);
|
|
158
|
+
});
|
|
155
159
|
answer.on("error", (error) => {
|
|
156
160
|
exchange.record({ status, error: error.message }, responseBody.incomplete(answer.headers));
|
|
157
161
|
response.destroy();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BodyCapture } from "../records/index.js";
|
|
2
|
+
import { answeredOutcome } from "./records.js";
|
|
2
3
|
/** The error of an exchange a `reset` fault rule ended before the proxy forwarded its request. */
|
|
3
4
|
const RESET_BEFORE_ERROR = "the proxy injected a reset before forwarding";
|
|
4
5
|
/** The error of an exchange a `reset` fault rule ended after Testserver answered: a lost response. */
|
|
@@ -63,7 +64,8 @@ function act(exchange, rule, upstream) {
|
|
|
63
64
|
/**
|
|
64
65
|
* Forwards the held request body, reads Testserver's whole answer, then acts. When Testserver fails, with no answer
|
|
65
66
|
* or one that stops before its end, the proxy doesn't fake over it: the client gets a 502 or a destroyed connection,
|
|
66
|
-
* and only `fault.upstream` holds Testserver's status and body.
|
|
67
|
+
* and only `fault.upstream` holds Testserver's status and body. Testserver's 503 for a stopped container is a
|
|
68
|
+
* failure too, but it is an answer, so the rule acts on it, and `fault.upstream` holds its `error` beside it.
|
|
67
69
|
*/
|
|
68
70
|
function forwardThenAct(exchange, rule, body) {
|
|
69
71
|
let answer;
|
|
@@ -87,7 +89,10 @@ function forwardThenAct(exchange, rule, body) {
|
|
|
87
89
|
if (exchange.ended)
|
|
88
90
|
return;
|
|
89
91
|
const responseBody = captured.complete(incoming.headers, exchange.bearer);
|
|
90
|
-
act(exchange, rule, {
|
|
92
|
+
act(exchange, rule, {
|
|
93
|
+
...answeredOutcome(status, responseBody),
|
|
94
|
+
...(responseBody === undefined ? {} : { responseBody }),
|
|
95
|
+
});
|
|
91
96
|
});
|
|
92
97
|
incoming.on("error", brokenOff);
|
|
93
98
|
});
|
|
@@ -74,7 +74,8 @@ export interface ProxyFault {
|
|
|
74
74
|
/**
|
|
75
75
|
* What Testserver answered, under `replace` and an `after-answer` reset. Absent when the proxy didn't forward,
|
|
76
76
|
* and when the proxy itself cut the exchange off (the client hung up, or the proxy closed) before Testserver's
|
|
77
|
-
* answer ended. An `error` here means Testserver failed: no answer,
|
|
77
|
+
* answer ended. An `error` here means Testserver failed: no answer, one that stopped before its end, or its 503
|
|
78
|
+
* for a stopped container, beside that `status`.
|
|
78
79
|
*/
|
|
79
80
|
readonly upstream?: FaultUpstream;
|
|
80
81
|
}
|
|
@@ -17,7 +17,9 @@ export type ProxyRequestOutcome = RequestOutcome | OpenRequestOutcome;
|
|
|
17
17
|
* answer, or a fault rule's) or why it failed, or `open: true` while its exchange is still open. `url` is the target
|
|
18
18
|
* as the client sent it, `startedAt` is the proxy clock's reading at its arrival, `durationMs` runs from its arrival
|
|
19
19
|
* to the exchange's end (or, for an open record, to the read), a fault rule's delay included, and `error` without a
|
|
20
|
-
* `status` means no answer reached the client.
|
|
20
|
+
* `status` means no answer reached the client. An `error` beside a `status` says the answer broke off, or, with a
|
|
21
|
+
* `failure`, that it was Testserver's 503 for a stopped container (`answeredOutcome`). No token reaches a record
|
|
22
|
+
* (`records/body.ts`).
|
|
21
23
|
*/
|
|
22
24
|
export type ProxyRequestRecord = RequestRecordFields & {
|
|
23
25
|
readonly userAgent?: string;
|
|
@@ -43,6 +45,13 @@ export declare function proxyRecord(request: {
|
|
|
43
45
|
readonly responseBody?: RecordedBody | undefined;
|
|
44
46
|
readonly fault?: ProxyFault | undefined;
|
|
45
47
|
}): ProxyRequestRecord;
|
|
48
|
+
/**
|
|
49
|
+
* How an exchange whose answer from Testserver, with `status` and `responseBody`, arrived whole ended: with `status`
|
|
50
|
+
* alone, or, for Testserver's 503 for a stopped container (`httpFailure`), with its `container-stopped` failure and
|
|
51
|
+
* that failure's description as `error`, since the container the request was for had stopped, as when Testserver
|
|
52
|
+
* evicted it.
|
|
53
|
+
*/
|
|
54
|
+
export declare function answeredOutcome(status: number, responseBody: RecordedBody | undefined): RequestOutcome;
|
|
46
55
|
/**
|
|
47
56
|
* The headers to send upstream: the client's, less hop-by-hop headers, with `host` set to Testserver's and the
|
|
48
57
|
* test id header set to `testId`, replacing any the client sent.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { headerText, splitTarget, } from "../records/index.js";
|
|
2
|
+
import { BODY_EXCERPT_CHARS, describeFailure, httpFailure } from "../testserver/index.js";
|
|
2
3
|
/** The header the `vercel` CLI sends with the same id on every request of one invocation. */
|
|
3
4
|
export const SESSION_ID_HEADER = "x-vercel-cli-session-id";
|
|
4
5
|
/** Whether `record`'s exchange was still open when it was read. */
|
|
@@ -24,6 +25,18 @@ export function proxyRecord(request) {
|
|
|
24
25
|
...request.outcome,
|
|
25
26
|
};
|
|
26
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* How an exchange whose answer from Testserver, with `status` and `responseBody`, arrived whole ended: with `status`
|
|
30
|
+
* alone, or, for Testserver's 503 for a stopped container (`httpFailure`), with its `container-stopped` failure and
|
|
31
|
+
* that failure's description as `error`, since the container the request was for had stopped, as when Testserver
|
|
32
|
+
* evicted it.
|
|
33
|
+
*/
|
|
34
|
+
export function answeredOutcome(status, responseBody) {
|
|
35
|
+
if (status !== 503 || responseBody?.kind !== "text")
|
|
36
|
+
return { status };
|
|
37
|
+
const failure = httpFailure(status, responseBody.text.slice(0, BODY_EXCERPT_CHARS));
|
|
38
|
+
return failure.kind === "container-stopped" ? { status, error: describeFailure(failure), failure } : { status };
|
|
39
|
+
}
|
|
27
40
|
/** Headers that describe one connection, not the message, so the proxy never forwards them. */
|
|
28
41
|
const HOP_BY_HOP = new Set([
|
|
29
42
|
"connection",
|