vouchington-tooling 0.35.0 → 0.36.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/README.md +24 -221
- package/dist/agent-blackboard/feedback-audit-source.mjs +2 -2
- package/dist/agent-blackboard/feedback-canonical.mjs +1 -1
- package/dist/agent-blackboard/feedback-codec.mjs +3 -3
- package/dist/agent-blackboard/feedback-compose.mjs +5 -5
- package/dist/agent-blackboard/feedback-deadline.mjs +1 -1
- package/dist/agent-blackboard/feedback-delivery.mjs +6 -6
- package/dist/agent-blackboard/feedback-fields.mjs +1 -1
- package/dist/agent-blackboard/feedback-identity.mjs +3 -3
- package/dist/agent-blackboard/feedback-journal-audit.mjs +4 -4
- package/dist/agent-blackboard/feedback-journal-sandbox.mjs +1 -1
- package/dist/agent-blackboard/feedback-online-error.mjs +1 -1
- package/dist/agent-blackboard/feedback-online.mjs +7 -7
- package/dist/agent-blackboard/feedback-outbox-counts.mjs +2 -2
- package/dist/agent-blackboard/feedback-outbox.mjs +7 -7
- package/dist/agent-blackboard/index.mjs +13 -13
- package/dist/agent-blackboard/journal.mjs +3 -3
- package/dist/agent-blackboard/session-tools.mjs +4 -4
- package/dist/agent-blackboard/snapshot-cleanup-directory.mjs +3 -3
- package/dist/agent-blackboard/snapshot-cleanup-receipt.mjs +1 -1
- package/dist/agent-blackboard/snapshot-cleanup-resume.mjs +2 -2
- package/dist/agent-blackboard/snapshot-partition-cleanup.mjs +3 -3
- package/dist/agent-blackboard/snapshot-partition-format.mjs +3 -3
- package/dist/agent-blackboard/snapshot-partition-predicates.mjs +2 -2
- package/dist/agent-blackboard/snapshot-partition-read.mjs +2 -2
- package/dist/agent-blackboard/snapshot-partition-validate.mjs +2 -2
- package/dist/agent-blackboard/snapshot-partition-write.mjs +2 -2
- package/dist/agent-blackboard/snapshot-partitions.mjs +4 -4
- package/dist/agent-blackboard/snapshot.mjs +2 -2
- package/dist/agent-harness-identity/index.d.mts +1 -1
- package/dist/api-fixtures/fixture-contract-validation.mjs +1 -1
- package/dist/api-fixtures/index.mjs +3 -3
- package/dist/ast-grep-examples/companion-parity.mjs +1 -1
- package/dist/ast-grep-examples/index.mjs +1 -1
- package/dist/basic-auth-doc-sync/index.mjs +2 -2
- package/dist/basic-auth-doc-sync/runbook.mjs +4 -4
- package/dist/basic-auth-doc-sync/source.mjs +2 -2
- package/dist/browser-session-runner/attempt.mjs +5 -5
- package/dist/browser-session-runner/index.mjs +4 -4
- package/dist/browser-session-runner/output.mjs +1 -1
- package/dist/ci-local/index.mjs +2 -2
- package/dist/cli/commands/agent-blackboard-flags.mjs +1 -1
- package/dist/cli/commands/agent-blackboard.mjs +3 -3
- package/dist/cli/commands/ast-grep-examples.mjs +1 -1
- package/dist/cli/commands/ast-grep-pack.mjs +1 -1
- package/dist/cli/commands/gha-artifacts-cleanup.mjs +1 -1
- package/dist/cli/commands/gha-runtime-audit.mjs +1 -1
- package/dist/cli/commands/gha-workspace-policy.mjs +2 -2
- package/dist/cli/commands/http-origin.mjs +1 -1
- package/dist/cli/commands/link-skill.mjs +1 -1
- package/dist/cli/commands/mcp.mjs +2 -2
- package/dist/cli/commands/nuget-central-version.mjs +1 -1
- package/dist/cli/commands/pnpm-install.mjs +1 -1
- package/dist/cli/commands/prepare-vitest-reports.mjs +1 -1
- package/dist/cli/commands/require-up-to-date.mjs +1 -1
- package/dist/cli/commands/retrospective-facts.mjs +1 -1
- package/dist/cli/commands/retrospective-transcript.mjs +1 -1
- package/dist/cli/commands/runner-port-policy.mjs +1 -1
- package/dist/cli/commands/vitest-blob-manifest.mjs +1 -1
- package/dist/cli/commands/vitest-report-attempt.mjs +1 -1
- package/dist/cli/index.mjs +27 -27
- package/dist/cli/installed-version.mjs +1 -1
- package/dist/cli/parse-gha-runtime-audit.mjs +1 -1
- package/dist/cli/parse-options.mjs +2 -2
- package/dist/cli/parse.mjs +5 -5
- package/dist/compiler-build/index.mjs +3 -3
- package/dist/compiler-build/program.mjs +3 -3
- package/dist/config-inventory/collect.mjs +5 -5
- package/dist/config-inventory/dynamic-configs.mjs +1 -1
- package/dist/config-inventory/env-expression-readers.mjs +1 -1
- package/dist/config-inventory/env-prefix-readers.mjs +2 -2
- package/dist/config-inventory/env-var-accumulator.mjs +1 -1
- package/dist/config-inventory/env-vars.mjs +5 -5
- package/dist/config-inventory/index.mjs +2 -2
- package/dist/contract-schema/contract-schema-bounded-array.mjs +2 -2
- package/dist/contract-schema/contract-schema-extractor.mjs +3 -3
- package/dist/contract-schema/contract-schema-object-tuple.mjs +2 -2
- package/dist/contract-schema/contract-schema-type-extractor.mjs +5 -5
- package/dist/contract-schema/contract-schema-type-utils.mjs +2 -2
- package/dist/contract-schema/contract-schema-validator.mjs +1 -1
- package/dist/contract-schema/index.mjs +7 -7
- package/dist/contract-schema/type-query-call.mjs +3 -3
- package/dist/contract-schema/type-query.mjs +2 -2
- package/dist/contract-schema/virtual-program.mjs +1 -1
- package/dist/coverage-transport/control-v2-parse-object.mjs +2 -2
- package/dist/coverage-transport/control-v2.mjs +4 -4
- package/dist/coverage-transport/control.mjs +2 -2
- package/dist/coverage-transport/discovery.mjs +4 -4
- package/dist/coverage-transport/http.mjs +1 -1
- package/dist/coverage-transport/index.mjs +10 -10
- package/dist/coverage-transport/keys.mjs +1 -1
- package/dist/coverage-transport/lib.mjs +6 -6
- package/dist/coverage-transport/prefix-transfer.mjs +4 -4
- package/dist/coverage-transport/prefix.mjs +3 -3
- package/dist/coverage-transport/presign.mjs +1 -1
- package/dist/coverage-transport/vitest-blob-transport.mjs +2 -2
- package/dist/dependency-license-policy/collect.mjs +5 -5
- package/dist/dependency-license-policy/index.mjs +3 -3
- package/dist/dependency-license-policy/policy.mjs +1 -1
- package/dist/dependency-license-policy/workspace.mjs +1 -1
- package/dist/dockerfile-parse/index.mjs +2 -2
- package/dist/dockerfile-parse/prewarm-ports.mjs +1 -1
- package/dist/dockerfile-parse/runtime-cmd.mjs +2 -2
- package/dist/finite-enum-ripple/check.mjs +3 -3
- package/dist/finite-enum-ripple/compare.mjs +2 -2
- package/dist/finite-enum-ripple/component-paths.mjs +2 -2
- package/dist/finite-enum-ripple/configured-object-mutations.mjs +1 -1
- package/dist/finite-enum-ripple/create-page-jsx.mjs +1 -1
- package/dist/finite-enum-ripple/create-page-literals.mjs +4 -4
- package/dist/finite-enum-ripple/create-page-object-visitor.mjs +2 -2
- package/dist/finite-enum-ripple/create-page-properties.mjs +1 -1
- package/dist/finite-enum-ripple/index.mjs +1 -1
- package/dist/finite-enum-ripple/parser-support.mjs +2 -2
- package/dist/finite-enum-ripple/parsers.mjs +3 -3
- package/dist/finite-enum-ripple/structured-route-check.mjs +4 -4
- package/dist/finite-enum-ripple/types.mjs +3 -3
- package/dist/finite-enum-ripple/union-factory-check.mjs +2 -2
- package/dist/finite-enum-ripple/union-types.mjs +4 -4
- package/dist/gh-api-shell-quoting/index.mjs +2 -2
- package/dist/gh-api-shell-quoting/logical-line.mjs +1 -1
- package/dist/gh-api-shell-quoting/scan.mjs +1 -1
- package/dist/gh-api-shell-quoting/yaml.mjs +1 -1
- package/dist/gh-cli/index.mjs +4 -4
- package/dist/gha-artifacts-cleanup/commands.mjs +2 -2
- package/dist/gha-artifacts-cleanup/index.mjs +4 -4
- package/dist/gha-check-run/cli.mjs +2 -2
- package/dist/gha-check-run/index.mjs +2 -2
- package/dist/gha-claude-post-review/index.mjs +2 -2
- package/dist/gha-post-review/claude-token.d.mts +2 -2
- package/dist/gha-post-review/claude-token.mjs +1 -1
- package/dist/gha-post-review/cli.mjs +1 -1
- package/dist/gha-post-review/github.mjs +7 -7
- package/dist/gha-post-review/index.mjs +6 -6
- package/dist/gha-post-review/post.mjs +2 -2
- package/dist/gha-post-review/pull-io.mjs +1 -1
- package/dist/gha-post-review/token.mjs +1 -1
- package/dist/gha-pr-checkpoint/index.mjs +3 -3
- package/dist/gha-pr-checkpoint/resume.mjs +1 -1
- package/dist/gha-pr-checkpoint/update.mjs +1 -1
- package/dist/gha-review-payload/cli.mjs +2 -2
- package/dist/gha-review-payload/file.mjs +1 -1
- package/dist/gha-review-payload/index.mjs +4 -4
- package/dist/gha-review-payload/remap.mjs +1 -1
- package/dist/gha-runtime-audit/audit.mjs +4 -4
- package/dist/gha-runtime-audit/index.mjs +3 -3
- package/dist/gha-workspace-policy/docker-options.mjs +1 -1
- package/dist/gha-workspace-policy/docker-workspace-user.mjs +2 -2
- package/dist/gha-workspace-policy/index.mjs +3 -3
- package/dist/gha-workspace-policy/shell-tokens.mjs +1 -1
- package/dist/gha-workspace-policy/sparse-checkout.mjs +1 -1
- package/dist/github-projects/index.mjs +2 -2
- package/dist/github-projects/project-audit.mjs +1 -1
- package/dist/index.mjs +55 -55
- package/dist/markdown/content-facts.mjs +1 -1
- package/dist/markdown/document-sections.mjs +2 -2
- package/dist/markdown/html-blocks.mjs +1 -1
- package/dist/markdown/index.mjs +10 -10
- package/dist/markdown/sections.mjs +2 -2
- package/dist/markdown/tables.mjs +2 -2
- package/dist/markdown/tasks.mjs +1 -1
- package/dist/mcp-server/context.mjs +2 -2
- package/dist/mcp-server/dispatch.mjs +8 -8
- package/dist/mcp-server/git-fixture.test-helpers.mjs +1 -1
- package/dist/mcp-server/handlers-journal.mjs +4 -4
- package/dist/mcp-server/handlers-outbox.mjs +2 -2
- package/dist/mcp-server/handlers-session.mjs +3 -3
- package/dist/mcp-server/harness.test-helpers.mjs +4 -4
- package/dist/mcp-server/main.mjs +1 -1
- package/dist/mcp-server/run.mjs +3 -3
- package/dist/mcp-server/sdk.mjs +1 -1
- package/dist/mcp-server/server.mjs +2 -2
- package/dist/mcp-server/worktree.mjs +2 -2
- package/dist/nuget-central-version/cli.mjs +1 -1
- package/dist/openapi-document/build-openapi-catalog-sse.mjs +1 -1
- package/dist/openapi-document/build-openapi-document.mjs +8 -8
- package/dist/openapi-document/build-openapi-request.mjs +1 -1
- package/dist/openapi-document/build-openapi-response.mjs +3 -3
- package/dist/openapi-document/build-openapi-sse-events.mjs +1 -1
- package/dist/openapi-document/component-registry.mjs +1 -1
- package/dist/openapi-document/contract-schema-intersection-merge.mjs +1 -1
- package/dist/openapi-document/contract-schema-to-openapi.mjs +1 -1
- package/dist/openapi-document/index.mjs +12 -12
- package/dist/openapi-document/openapi-route-helpers.mjs +1 -1
- package/dist/pg-schema-snapshot/build-snapshot.mjs +3 -3
- package/dist/pg-schema-snapshot/catalog-objects.mjs +1 -1
- package/dist/pg-schema-snapshot/catalog-queries.mjs +4 -4
- package/dist/pg-schema-snapshot/catalog-table-constraints.mjs +1 -1
- package/dist/pg-schema-snapshot/catalog-table-indexes.mjs +1 -1
- package/dist/pg-schema-snapshot/catalog-tables.mjs +1 -1
- package/dist/pg-schema-snapshot/generate.mjs +5 -5
- package/dist/pg-schema-snapshot/index.mjs +6 -6
- package/dist/pg-schema-snapshot/markdown-files.mjs +1 -1
- package/dist/pg-schema-snapshot/render-markdown.mjs +1 -1
- package/dist/pg-schema-snapshot/table-snapshot-constraints.mjs +1 -1
- package/dist/pg-schema-snapshot/table-snapshot.mjs +3 -3
- package/dist/pnpm-deploy/index.mjs +3 -3
- package/dist/pnpm-deploy/restore.mjs +1 -1
- package/dist/pnpm-install/exec.mjs +1 -1
- package/dist/pnpm-install/index.mjs +8 -8
- package/dist/pnpm-install/install-operations.mjs +6 -6
- package/dist/pnpm-install/metadata-legacy.mjs +1 -1
- package/dist/pnpm-install/metadata.d.mts +1 -1
- package/dist/pnpm-install/metadata.mjs +2 -2
- package/dist/pnpm-install/native-health.mjs +2 -2
- package/dist/pnpm-install/pnpm-install-fixture.test-helpers.mjs +2 -2
- package/dist/pnpm-install/runner.mjs +7 -7
- package/dist/post-publication-inventory/index.d.mts +6 -0
- package/dist/post-publication-inventory/index.mjs +6 -2
- package/dist/post-publication-inventory/readers/compose-appends.d.mts +7 -0
- package/dist/post-publication-inventory/readers/compose-appends.mjs +38 -0
- package/dist/post-publication-inventory/readers/composes.d.mts +2 -0
- package/dist/post-publication-inventory/readers/composes.mjs +79 -0
- package/dist/post-publication-inventory/readers/composition.d.mts +2 -0
- package/dist/post-publication-inventory/readers/composition.mjs +62 -0
- package/dist/post-publication-inventory/readers/public-boundary-ast.d.mts +5 -0
- package/dist/post-publication-inventory/readers/public-boundary-ast.mjs +33 -0
- package/dist/post-publication-inventory/readers/public-boundary-consumed.d.mts +3 -0
- package/dist/post-publication-inventory/readers/public-boundary-consumed.mjs +39 -0
- package/dist/post-publication-inventory/readers/public-boundary-dataflow.d.mts +3 -0
- package/dist/post-publication-inventory/readers/public-boundary-dataflow.mjs +61 -0
- package/dist/post-publication-inventory/readers/public-boundary-then.d.mts +9 -0
- package/dist/post-publication-inventory/readers/public-boundary-then.mjs +31 -0
- package/dist/post-publication-inventory/readers/public-boundary.d.mts +3 -0
- package/dist/post-publication-inventory/readers/public-boundary.mjs +71 -0
- package/dist/post-publication-inventory/readers/public-view-ast.d.mts +6 -0
- package/dist/post-publication-inventory/readers/public-view-ast.mjs +67 -0
- package/dist/post-publication-inventory/readers/public-view-options.d.mts +8 -0
- package/dist/post-publication-inventory/readers/public-view-protection.d.mts +2 -0
- package/dist/post-publication-inventory/readers/public-view-protection.mjs +83 -0
- package/dist/post-publication-inventory/readers/public-view.d.mts +2 -0
- package/dist/post-publication-inventory/readers/public-view.mjs +117 -0
- package/dist/post-publication-inventory/readers/source-ast.d.mts +30 -0
- package/dist/post-publication-inventory/readers/source-ast.mjs +52 -0
- package/dist/post-publication-inventory/readers/source-executors.d.mts +4 -0
- package/dist/post-publication-inventory/readers/source-executors.mjs +38 -0
- package/dist/post-publication-inventory/readers/source-helpers.d.mts +16 -0
- package/dist/post-publication-inventory/readers/source-helpers.mjs +72 -0
- package/dist/post-publication-inventory/readers/source-options.d.mts +8 -0
- package/dist/post-publication-inventory/readers/source-sql.d.mts +3 -0
- package/dist/post-publication-inventory/readers/source-sql.mjs +17 -0
- package/dist/post-publication-inventory/readers/sql-executors.mjs +2 -2
- package/dist/post-publication-inventory/readers/sql-source.mjs +3 -3
- package/dist/post-publication-inventory/readers/sql-template.mjs +1 -1
- package/dist/post-publication-inventory/writers/source.mjs +1 -1
- package/dist/retrospective-facts/coverage.mjs +1 -1
- package/dist/retrospective-facts/foreign.mjs +3 -3
- package/dist/retrospective-facts/index.mjs +4 -4
- package/dist/retrospective-facts/local.mjs +4 -4
- package/dist/retrospective-transcript/claude-blocks.mjs +1 -1
- package/dist/retrospective-transcript/claude.mjs +2 -2
- package/dist/retrospective-transcript/codex-messages.mjs +1 -1
- package/dist/retrospective-transcript/codex-payload.mjs +2 -2
- package/dist/retrospective-transcript/codex-records.mjs +3 -3
- package/dist/retrospective-transcript/codex-segment.mjs +1 -1
- package/dist/retrospective-transcript/codex.mjs +2 -2
- package/dist/retrospective-transcript/index.mjs +9 -9
- package/dist/retrospective-transcript/resolve-transcript-file.mjs +2 -2
- package/dist/scc-complexity/baseline.mjs +2 -2
- package/dist/scc-complexity/index.mjs +8 -8
- package/dist/scc-complexity/parser.mjs +1 -1
- package/dist/scc-complexity/scope-config.mjs +1 -1
- package/dist/session-friction/audit-block.mjs +1 -1
- package/dist/session-friction/ci-failures.mjs +2 -2
- package/dist/session-friction/classify.mjs +2 -2
- package/dist/session-friction/coverage-ledger.mjs +1 -1
- package/dist/session-friction/index.mjs +5 -5
- package/dist/session-friction/log-file.mjs +2 -2
- package/dist/session-friction/log.mjs +7 -7
- package/dist/session-friction/normalize.mjs +1 -1
- package/dist/session-friction/report.mjs +5 -5
- package/dist/session-friction/sandbox.mjs +1 -1
- package/dist/session-friction/session-id.mjs +1 -1
- package/dist/shared-context/index.mjs +1 -1
- package/dist/skill-discovery/index.mjs +3 -3
- package/dist/sql-ast/add-column.mjs +1 -1
- package/dist/sql-ast/constraint-do-block.mjs +2 -2
- package/dist/sql-ast/constraint-shared.mjs +1 -1
- package/dist/sql-ast/constraint.mjs +4 -4
- package/dist/sql-ast/create-table.mjs +2 -2
- package/dist/sql-ast/drop-index.mjs +2 -2
- package/dist/sql-ast/implicit-indexes.mjs +1 -1
- package/dist/sql-ast/index-metadata.mjs +3 -3
- package/dist/sql-ast/index.mjs +8 -8
- package/dist/sql-scanner/comments.mjs +1 -1
- package/dist/sql-scanner/index.mjs +3 -3
- package/dist/sql-scanner/literals.mjs +1 -1
- package/dist/swift-semantic-equal/cli.mjs +1 -1
- package/dist/swift-semantic-equal/index.mjs +1 -1
- package/dist/transient-retry/index.mjs +2 -2
- package/dist/vitest-blob-manifest/cli.mjs +2 -2
- package/dist/vitest-blob-manifest/index.mjs +4 -4
- package/dist/vitest-blob-manifest/report-attempt-cli.mjs +2 -2
- package/dist/vitest-blob-manifest/report-attempt.mjs +1 -1
- package/dist/vitest-blob-manifest/reports-cli.mjs +3 -3
- package/dist/vitest-blob-manifest/reports-source.mjs +2 -2
- package/dist/vitest-blob-manifest/reports.mjs +2 -2
- package/dist/vitest-diagnostics/index.mjs +8 -8
- package/dist/vitest-diagnostics/vitest-fork-exit-records.mjs +1 -1
- package/dist/vitest-diagnostics/vitest-fork-exit-sentinel.mjs +2 -2
- package/dist/vitest-diagnostics/vitest-fork-leak-detection.mjs +2 -2
- package/dist/vitest-diagnostics/vitest-worker-exit-diagnostics-reporter.mjs +2 -2
- package/dist/workflow-policy/condition-entailment.mjs +1 -1
- package/dist/workflow-policy/index.mjs +4 -4
- package/dist/workflow-policy/permission-inheritance.mjs +1 -1
- package/dist/workflow-policy/permission-mismatches.mjs +2 -2
- package/dist/workflow-policy/secret-readiness.mjs +2 -2
- package/dist/workspace-gates/first-party-graph.mjs +2 -2
- package/dist/workspace-gates/index.mjs +1 -1
- package/dist/workspace-gates/manifest-version-assertions.mjs +2 -2
- package/dist/workspace-gates/manifest-version-parser.mjs +1 -1
- package/dist/workspace-gates/options.mjs +1 -1
- package/dist/workspace-gates/policy.mjs +7 -7
- package/dist/workspace-gates/test-helpers.d.mts +2 -2
- package/package.json +3 -6
- package/dist/api-contract-discovery/header-contract-parser.d.mts +0 -3
- package/dist/api-contract-discovery/header-contract-parser.mjs +0 -93
- package/dist/api-contract-discovery/header-contract-registry.d.mts +0 -3
- package/dist/api-contract-discovery/header-contract-registry.mjs +0 -40
- package/dist/api-contract-discovery/header-contract-types.d.mts +0 -19
- package/dist/api-contract-discovery/index.d.mts +0 -34
- package/dist/api-contract-discovery/index.mjs +0 -27
- package/dist/api-contract-discovery/protocol-analysis-cache.d.mts +0 -21
- package/dist/api-contract-discovery/protocol-analysis-cache.mjs +0 -7
- package/dist/api-contract-discovery/protocol-body-status.d.mts +0 -2
- package/dist/api-contract-discovery/protocol-body-status.mjs +0 -4
- package/dist/api-contract-discovery/protocol-callback-argument-bindings.d.mts +0 -7
- package/dist/api-contract-discovery/protocol-callback-argument-bindings.mjs +0 -33
- package/dist/api-contract-discovery/protocol-callback-invocation.d.mts +0 -6
- package/dist/api-contract-discovery/protocol-callback-invocation.mjs +0 -111
- package/dist/api-contract-discovery/protocol-callback-mutations.d.mts +0 -5
- package/dist/api-contract-discovery/protocol-callback-mutations.mjs +0 -42
- package/dist/api-contract-discovery/protocol-callback-registration.d.mts +0 -3
- package/dist/api-contract-discovery/protocol-callback-registration.mjs +0 -27
- package/dist/api-contract-discovery/protocol-callback-values.d.mts +0 -18
- package/dist/api-contract-discovery/protocol-callback-values.mjs +0 -114
- package/dist/api-contract-discovery/protocol-context-alias.d.mts +0 -3
- package/dist/api-contract-discovery/protocol-context-alias.mjs +0 -20
- package/dist/api-contract-discovery/protocol-contract-extraction.d.mts +0 -9
- package/dist/api-contract-discovery/protocol-contract-extraction.mjs +0 -87
- package/dist/api-contract-discovery/protocol-contract-keys.d.mts +0 -1
- package/dist/api-contract-discovery/protocol-contract-keys.mjs +0 -8
- package/dist/api-contract-discovery/protocol-contract-registry.d.mts +0 -5
- package/dist/api-contract-discovery/protocol-contract-registry.mjs +0 -133
- package/dist/api-contract-discovery/protocol-executable-path.d.mts +0 -3
- package/dist/api-contract-discovery/protocol-executable-path.mjs +0 -64
- package/dist/api-contract-discovery/protocol-execution-path.d.mts +0 -4
- package/dist/api-contract-discovery/protocol-execution-path.mjs +0 -16
- package/dist/api-contract-discovery/protocol-http-association.d.mts +0 -7
- package/dist/api-contract-discovery/protocol-http-association.mjs +0 -108
- package/dist/api-contract-discovery/protocol-http-body-kinds.d.mts +0 -3
- package/dist/api-contract-discovery/protocol-http-body-kinds.mjs +0 -19
- package/dist/api-contract-discovery/protocol-http-context-callers.d.mts +0 -7
- package/dist/api-contract-discovery/protocol-http-context-callers.mjs +0 -40
- package/dist/api-contract-discovery/protocol-http-context-escapes.d.mts +0 -3
- package/dist/api-contract-discovery/protocol-http-context-escapes.mjs +0 -95
- package/dist/api-contract-discovery/protocol-http-context.d.mts +0 -8
- package/dist/api-contract-discovery/protocol-http-context.mjs +0 -85
- package/dist/api-contract-discovery/protocol-http-emission.d.mts +0 -3
- package/dist/api-contract-discovery/protocol-http-emission.mjs +0 -76
- package/dist/api-contract-discovery/protocol-http-implicit-taint.d.mts +0 -7
- package/dist/api-contract-discovery/protocol-http-implicit-taint.mjs +0 -26
- package/dist/api-contract-discovery/protocol-http-method-access.d.mts +0 -9
- package/dist/api-contract-discovery/protocol-http-method-access.mjs +0 -34
- package/dist/api-contract-discovery/protocol-http-method-mutations.d.mts +0 -3
- package/dist/api-contract-discovery/protocol-http-method-mutations.mjs +0 -31
- package/dist/api-contract-discovery/protocol-http-reflect.d.mts +0 -5
- package/dist/api-contract-discovery/protocol-http-reflect.mjs +0 -45
- package/dist/api-contract-discovery/protocol-http-registration.d.mts +0 -12
- package/dist/api-contract-discovery/protocol-http-registration.mjs +0 -53
- package/dist/api-contract-discovery/protocol-http-response-mutations.d.mts +0 -3
- package/dist/api-contract-discovery/protocol-http-response-mutations.mjs +0 -31
- package/dist/api-contract-discovery/protocol-marker-analysis.d.mts +0 -7
- package/dist/api-contract-discovery/protocol-marker-analysis.mjs +0 -50
- package/dist/api-contract-discovery/protocol-opaque-callback.d.mts +0 -3
- package/dist/api-contract-discovery/protocol-opaque-callback.mjs +0 -107
- package/dist/api-contract-discovery/protocol-platform-callbacks.d.mts +0 -7
- package/dist/api-contract-discovery/protocol-platform-callbacks.mjs +0 -76
- package/dist/api-contract-discovery/protocol-platform-mutation-targets.d.mts +0 -5
- package/dist/api-contract-discovery/protocol-platform-mutation-targets.mjs +0 -89
- package/dist/api-contract-discovery/protocol-platform-writes.d.mts +0 -3
- package/dist/api-contract-discovery/protocol-platform-writes.mjs +0 -92
- package/dist/api-contract-discovery/protocol-requested-keys.d.mts +0 -5
- package/dist/api-contract-discovery/protocol-requested-keys.mjs +0 -45
- package/dist/api-contract-discovery/protocol-sse-callers.d.mts +0 -7
- package/dist/api-contract-discovery/protocol-sse-callers.mjs +0 -67
- package/dist/api-contract-discovery/protocol-sse-emission.d.mts +0 -11
- package/dist/api-contract-discovery/protocol-sse-emission.mjs +0 -61
- package/dist/api-contract-discovery/protocol-sse-feasible-status.d.mts +0 -3
- package/dist/api-contract-discovery/protocol-sse-feasible-status.mjs +0 -24
- package/dist/api-contract-discovery/protocol-sse-raw-writes.d.mts +0 -9
- package/dist/api-contract-discovery/protocol-sse-raw-writes.mjs +0 -99
- package/dist/api-contract-discovery/protocol-sse-status.d.mts +0 -3
- package/dist/api-contract-discovery/protocol-sse-status.mjs +0 -84
- package/dist/api-contract-discovery/protocol-sse-write-access.d.mts +0 -9
- package/dist/api-contract-discovery/protocol-sse-write-access.mjs +0 -42
- package/dist/api-contract-discovery/protocol-sse-write-helpers.d.mts +0 -7
- package/dist/api-contract-discovery/protocol-sse-write-helpers.mjs +0 -82
- package/dist/api-contract-discovery/protocol-sse-write-mutations.d.mts +0 -9
- package/dist/api-contract-discovery/protocol-sse-write-mutations.mjs +0 -42
- package/dist/api-contract-discovery/protocol-sse-write-resolution.d.mts +0 -14
- package/dist/api-contract-discovery/protocol-sse-write-resolution.mjs +0 -79
- package/dist/api-contract-discovery/protocol-status-dominance.d.mts +0 -5
- package/dist/api-contract-discovery/protocol-status-dominance.mjs +0 -35
- package/dist/api-contract-discovery/protocol-write-receiver.d.mts +0 -9
- package/dist/api-contract-discovery/protocol-write-receiver.mjs +0 -79
- package/dist/api-contract-discovery/query-contract-extraction.d.mts +0 -3
- package/dist/api-contract-discovery/query-contract-extraction.mjs +0 -82
- package/dist/api-contract-discovery/query-contract-literals.d.mts +0 -13
- package/dist/api-contract-discovery/query-contract-literals.mjs +0 -83
- package/dist/api-contract-discovery/query-contract-registry.d.mts +0 -3
- package/dist/api-contract-discovery/query-contract-registry.mjs +0 -70
- package/dist/api-contract-discovery/query-contract-types.d.mts +0 -8
- package/dist/api-contract-discovery/registered-route-binding-writes.d.mts +0 -4
- package/dist/api-contract-discovery/registered-route-binding-writes.mjs +0 -47
- package/dist/api-contract-discovery/registered-route-catalog.d.mts +0 -10
- package/dist/api-contract-discovery/registered-route-catalog.mjs +0 -85
- package/dist/api-contract-discovery/registered-route-factory-returns.d.mts +0 -3
- package/dist/api-contract-discovery/registered-route-factory-returns.mjs +0 -29
- package/dist/api-contract-discovery/registered-route-handler-analysis.d.mts +0 -12
- package/dist/api-contract-discovery/registered-route-handler-analysis.mjs +0 -119
- package/dist/api-contract-discovery/registered-route-handler-helpers.d.mts +0 -3
- package/dist/api-contract-discovery/registered-route-handler-helpers.mjs +0 -16
- package/dist/api-contract-discovery/registered-route-runtime-parameters.d.mts +0 -3
- package/dist/api-contract-discovery/registered-route-runtime-parameters.mjs +0 -5
- package/dist/api-contract-discovery/registered-route-terminal-error.d.mts +0 -3
- package/dist/api-contract-discovery/registered-route-terminal-error.mjs +0 -98
- package/dist/api-contract-discovery/request-contract-implicit.d.mts +0 -17
- package/dist/api-contract-discovery/request-contract-implicit.mjs +0 -73
- package/dist/api-contract-discovery/request-contract-lenient.d.mts +0 -28
- package/dist/api-contract-discovery/request-contract-lenient.mjs +0 -59
- package/dist/api-contract-discovery/request-contract-registry.d.mts +0 -14
- package/dist/api-contract-discovery/request-contract-registry.mjs +0 -63
- package/dist/api-contract-discovery/request-contract-route-analysis.d.mts +0 -25
- package/dist/api-contract-discovery/request-contract-route-analysis.mjs +0 -68
- package/dist/api-contract-discovery/request-contract-types.d.mts +0 -12
- package/dist/api-contract-discovery/request-contract-types.mjs +0 -1
- package/dist/api-contract-discovery/request-validation-callbacks.d.mts +0 -9
- package/dist/api-contract-discovery/request-validation-callbacks.mjs +0 -27
- package/dist/api-contract-discovery/request-validation-checker.d.mts +0 -7
- package/dist/api-contract-discovery/request-validation-checker.mjs +0 -25
- package/dist/api-contract-discovery/request-validation-conditional.d.mts +0 -6
- package/dist/api-contract-discovery/request-validation-conditional.mjs +0 -31
- package/dist/api-contract-discovery/request-validation-factory-calls.d.mts +0 -11
- package/dist/api-contract-discovery/request-validation-factory-calls.mjs +0 -23
- package/dist/api-contract-discovery/request-validation-facts.d.mts +0 -16
- package/dist/api-contract-discovery/request-validation-facts.mjs +0 -64
- package/dist/api-contract-discovery/request-validation-follow.d.mts +0 -24
- package/dist/api-contract-discovery/request-validation-follow.mjs +0 -38
- package/dist/api-contract-discovery/request-validation-handler-state.d.mts +0 -8
- package/dist/api-contract-discovery/request-validation-handler-state.mjs +0 -35
- package/dist/api-contract-discovery/request-validation-input.d.mts +0 -12
- package/dist/api-contract-discovery/request-validation-input.mjs +0 -43
- package/dist/api-contract-discovery/request-validation-keys.d.mts +0 -25
- package/dist/api-contract-discovery/request-validation-keys.mjs +0 -119
- package/dist/api-contract-discovery/request-validation-match.d.mts +0 -11
- package/dist/api-contract-discovery/request-validation-match.mjs +0 -47
- package/dist/api-contract-discovery/request-validation-mutation.d.mts +0 -7
- package/dist/api-contract-discovery/request-validation-mutation.mjs +0 -80
- package/dist/api-contract-discovery/request-validation-origin.d.mts +0 -20
- package/dist/api-contract-discovery/request-validation-origin.mjs +0 -71
- package/dist/api-contract-discovery/request-validation-reads.d.mts +0 -13
- package/dist/api-contract-discovery/request-validation-reads.mjs +0 -88
- package/dist/api-contract-discovery/request-validation-registration.d.mts +0 -9
- package/dist/api-contract-discovery/request-validation-registration.mjs +0 -32
- package/dist/api-contract-discovery/request-validation-report.d.mts +0 -3
- package/dist/api-contract-discovery/request-validation-report.mjs +0 -21
- package/dist/api-contract-discovery/request-validation-request-origin.d.mts +0 -5
- package/dist/api-contract-discovery/request-validation-request-origin.mjs +0 -13
- package/dist/api-contract-discovery/request-validation-select.d.mts +0 -9
- package/dist/api-contract-discovery/request-validation-select.mjs +0 -36
- package/dist/api-contract-discovery/request-validation-sites.d.mts +0 -9
- package/dist/api-contract-discovery/request-validation-sites.mjs +0 -77
- package/dist/api-contract-discovery/request-validation-state-key.d.mts +0 -13
- package/dist/api-contract-discovery/request-validation-state-key.mjs +0 -30
- package/dist/api-contract-discovery/request-validation-trace-helpers.d.mts +0 -14
- package/dist/api-contract-discovery/request-validation-trace-helpers.mjs +0 -80
- package/dist/api-contract-discovery/request-validation-trace-select.d.mts +0 -23
- package/dist/api-contract-discovery/request-validation-trace-select.mjs +0 -45
- package/dist/api-contract-discovery/request-validation-trace.d.mts +0 -8
- package/dist/api-contract-discovery/request-validation-trace.mjs +0 -130
- package/dist/api-contract-discovery/request-validation-types.d.mts +0 -84
- package/dist/api-contract-discovery/request-validation-types.mjs +0 -1
- package/dist/api-contract-discovery/request-validation-walker.d.mts +0 -26
- package/dist/api-contract-discovery/request-validation-walker.mjs +0 -143
- package/dist/api-contract-discovery/request-validation.test-helpers.d.mts +0 -39
- package/dist/api-contract-discovery/request-validation.test-helpers.mjs +0 -108
- package/dist/api-contract-discovery/response-contract-attribution-facts.d.mts +0 -2
- package/dist/api-contract-discovery/response-contract-attribution-facts.mjs +0 -18
- package/dist/api-contract-discovery/response-contract-attribution.d.mts +0 -3
- package/dist/api-contract-discovery/response-contract-attribution.mjs +0 -23
- package/dist/api-contract-discovery/response-contract-call-classification.d.mts +0 -3
- package/dist/api-contract-discovery/response-contract-call-classification.mjs +0 -37
- package/dist/api-contract-discovery/response-contract-ctx-analysis.d.mts +0 -7
- package/dist/api-contract-discovery/response-contract-ctx-analysis.mjs +0 -28
- package/dist/api-contract-discovery/response-contract-error-branch.d.mts +0 -15
- package/dist/api-contract-discovery/response-contract-error-branch.mjs +0 -150
- package/dist/api-contract-discovery/response-contract-handler-bindings.d.mts +0 -3
- package/dist/api-contract-discovery/response-contract-handler-bindings.mjs +0 -126
- package/dist/api-contract-discovery/response-contract-handler-calls.d.mts +0 -3
- package/dist/api-contract-discovery/response-contract-handler-calls.mjs +0 -81
- package/dist/api-contract-discovery/response-contract-implicit-sources.test-helpers.d.mts +0 -145
- package/dist/api-contract-discovery/response-contract-implicit-sources.test-helpers.mjs +0 -145
- package/dist/api-contract-discovery/response-contract-implicit-variants.d.mts +0 -2
- package/dist/api-contract-discovery/response-contract-implicit-variants.mjs +0 -6
- package/dist/api-contract-discovery/response-contract-implicit.d.mts +0 -6
- package/dist/api-contract-discovery/response-contract-implicit.mjs +0 -120
- package/dist/api-contract-discovery/response-contract-lenient.d.mts +0 -41
- package/dist/api-contract-discovery/response-contract-lenient.mjs +0 -52
- package/dist/api-contract-discovery/response-contract-media.d.mts +0 -3
- package/dist/api-contract-discovery/response-contract-media.mjs +0 -46
- package/dist/api-contract-discovery/response-contract-object-symbols.d.mts +0 -3
- package/dist/api-contract-discovery/response-contract-object-symbols.mjs +0 -80
- package/dist/api-contract-discovery/response-contract-property-mutations.d.mts +0 -5
- package/dist/api-contract-discovery/response-contract-property-mutations.mjs +0 -84
- package/dist/api-contract-discovery/response-contract-registration.d.mts +0 -11
- package/dist/api-contract-discovery/response-contract-registration.mjs +0 -65
- package/dist/api-contract-discovery/response-contract-registry.d.mts +0 -7
- package/dist/api-contract-discovery/response-contract-registry.mjs +0 -124
- package/dist/api-contract-discovery/response-contract-route-analysis.d.mts +0 -12
- package/dist/api-contract-discovery/response-contract-route-analysis.mjs +0 -65
- package/dist/api-contract-discovery/response-contract-route-syntax.d.mts +0 -7
- package/dist/api-contract-discovery/response-contract-route-syntax.mjs +0 -41
- package/dist/api-contract-discovery/response-contract-status.d.mts +0 -27
- package/dist/api-contract-discovery/response-contract-status.mjs +0 -82
- package/dist/api-contract-discovery/response-contract-symbols.d.mts +0 -5
- package/dist/api-contract-discovery/response-contract-symbols.mjs +0 -82
- package/dist/api-contract-discovery/response-contract-types.d.mts +0 -23
- package/dist/api-contract-discovery/response-contract-types.mjs +0 -1
- package/dist/api-contract-discovery/test-setup.test-helpers.d.mts +0 -3
- package/dist/api-contract-discovery/test-setup.test-helpers.mjs +0 -2
- /package/dist/{api-contract-discovery/header-contract-types.mjs → post-publication-inventory/readers/public-view-options.mjs} +0 -0
- /package/dist/{api-contract-discovery/query-contract-types.mjs → post-publication-inventory/readers/source-options.mjs} +0 -0
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
export declare const responseContractImplicitSources: {
|
|
2
|
-
readonly 'called-helper': `
|
|
3
|
-
declare const app: any
|
|
4
|
-
async function handleCreate(ctx: any) {
|
|
5
|
-
ctx.setStatus(201)
|
|
6
|
-
return { id: 'one' as string }
|
|
7
|
-
}
|
|
8
|
-
app.route('/api/v1/items').post(async (ctx: any) => {
|
|
9
|
-
ctx.json(await handleCreate(ctx))
|
|
10
|
-
})
|
|
11
|
-
`;
|
|
12
|
-
readonly 'shared-helper': `
|
|
13
|
-
declare const app: any
|
|
14
|
-
function markCreated(ctx: any) { ctx.setStatus(201) }
|
|
15
|
-
app.route('/api/v1/items').post((ctx: any) => {
|
|
16
|
-
markCreated(ctx)
|
|
17
|
-
ctx.json({ id: 'one' as string })
|
|
18
|
-
})
|
|
19
|
-
app.route('/api/v1/widgets').post((ctx: any) => {
|
|
20
|
-
markCreated(ctx)
|
|
21
|
-
ctx.json({ id: 'one' as string })
|
|
22
|
-
})
|
|
23
|
-
`;
|
|
24
|
-
readonly empty: `
|
|
25
|
-
declare const app: any
|
|
26
|
-
app.route('/api/v1/items/:id').delete((ctx: any) => {
|
|
27
|
-
ctx.setStatus(200)
|
|
28
|
-
ctx.response.empty()
|
|
29
|
-
})
|
|
30
|
-
`;
|
|
31
|
-
readonly 'error-guard': `
|
|
32
|
-
declare const app: any
|
|
33
|
-
app.route('/api/v1/auth/me').get((ctx: any) => {
|
|
34
|
-
if (!ctx.user) {
|
|
35
|
-
ctx.setStatus(401)
|
|
36
|
-
return ctx.json({ error: 'not authenticated' as string })
|
|
37
|
-
}
|
|
38
|
-
ctx.json({ user: { id: 'one' as string } })
|
|
39
|
-
})
|
|
40
|
-
`;
|
|
41
|
-
readonly 'two-guards': `
|
|
42
|
-
declare const app: any
|
|
43
|
-
app.route('/api/v1/items/:id').get((ctx: any) => {
|
|
44
|
-
if (!ctx.user) {
|
|
45
|
-
ctx.setStatus(401)
|
|
46
|
-
return ctx.json({ error: 'not authenticated' as string })
|
|
47
|
-
}
|
|
48
|
-
if (!ctx.item) {
|
|
49
|
-
ctx.setStatus(404)
|
|
50
|
-
return ctx.json({ error: 'not found' as string })
|
|
51
|
-
}
|
|
52
|
-
ctx.json({ item: { id: 'one' as string } })
|
|
53
|
-
})
|
|
54
|
-
`;
|
|
55
|
-
readonly conflict: `
|
|
56
|
-
declare const app: any
|
|
57
|
-
const sendConflict = (ctx: any, existing: any) => {
|
|
58
|
-
ctx.setStatus(409)
|
|
59
|
-
if (!existing) {
|
|
60
|
-
ctx.json({ error: 'conflict' as string })
|
|
61
|
-
return
|
|
62
|
-
}
|
|
63
|
-
ctx.json({ error: 'conflict' as string, id: 'x' as string })
|
|
64
|
-
}
|
|
65
|
-
app.route('/api/v1/items').post((ctx: any) => {
|
|
66
|
-
const conflict: any = {}
|
|
67
|
-
if (conflict.existing !== undefined) {
|
|
68
|
-
sendConflict(ctx, conflict.existing)
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
ctx.setStatus(201)
|
|
72
|
-
ctx.json({ id: 'one' as string, status: 'pending' as string })
|
|
73
|
-
})
|
|
74
|
-
`;
|
|
75
|
-
readonly ternary: `
|
|
76
|
-
declare const app: any
|
|
77
|
-
declare const created: boolean
|
|
78
|
-
app.route('/api/v1/items').post((ctx: any) => {
|
|
79
|
-
ctx.setStatus(created ? 201 : 200)
|
|
80
|
-
ctx.json({ id: 'one' as string })
|
|
81
|
-
})
|
|
82
|
-
`;
|
|
83
|
-
readonly variants: `
|
|
84
|
-
declare const app: any
|
|
85
|
-
declare function apiResponse<K extends string, T>(key: K, body: T): T
|
|
86
|
-
app.route('/api/v1/items').post((ctx: any) => {
|
|
87
|
-
ctx.setStatus(422)
|
|
88
|
-
apiResponse('POST:/api/v1/items#validation', { error: 'invalid' as string })
|
|
89
|
-
ctx.setStatus(201)
|
|
90
|
-
apiResponse('POST:/api/v1/items', { id: 'one' as string })
|
|
91
|
-
})
|
|
92
|
-
`;
|
|
93
|
-
readonly branches: `
|
|
94
|
-
declare const app: any
|
|
95
|
-
app.route('/api/v1/webhooks/:id').post((ctx: any) => {
|
|
96
|
-
if (ctx.body.event === 'known') {
|
|
97
|
-
ctx.json({ received: true as boolean })
|
|
98
|
-
return
|
|
99
|
-
}
|
|
100
|
-
ctx.json({ ignored: true as boolean })
|
|
101
|
-
})
|
|
102
|
-
`;
|
|
103
|
-
readonly 'secondary-failure': `
|
|
104
|
-
declare const app: any
|
|
105
|
-
declare function riskyLookup(): any
|
|
106
|
-
app.route('/api/v1/jobs/:id').get((ctx: any) => {
|
|
107
|
-
if (ctx.query.mode === 'basic') {
|
|
108
|
-
ctx.json({ ready: true as boolean })
|
|
109
|
-
return
|
|
110
|
-
}
|
|
111
|
-
ctx.json({ value: riskyLookup() })
|
|
112
|
-
})
|
|
113
|
-
`;
|
|
114
|
-
readonly 'empty-then-buffer': `
|
|
115
|
-
declare const app: any
|
|
116
|
-
declare const body: any
|
|
117
|
-
declare const contentType: string
|
|
118
|
-
app.route('/api/v1/mcp').post((ctx: any) => {
|
|
119
|
-
if (body.byteLength === 0) {
|
|
120
|
-
ctx.response.empty()
|
|
121
|
-
} else {
|
|
122
|
-
ctx.response.buffer(body, contentType)
|
|
123
|
-
}
|
|
124
|
-
})
|
|
125
|
-
`;
|
|
126
|
-
readonly 'buffer-then-empty': `
|
|
127
|
-
declare const app: any
|
|
128
|
-
declare const body: any
|
|
129
|
-
declare const contentType: string
|
|
130
|
-
app.route('/api/v1/mcp').post((ctx: any) => {
|
|
131
|
-
if (body.byteLength > 0) {
|
|
132
|
-
ctx.response.buffer(body, contentType)
|
|
133
|
-
} else {
|
|
134
|
-
ctx.response.empty()
|
|
135
|
-
}
|
|
136
|
-
})
|
|
137
|
-
`;
|
|
138
|
-
readonly 'single-failure': `
|
|
139
|
-
declare const app: any
|
|
140
|
-
declare function riskyLookup(): any
|
|
141
|
-
app.route('/api/v1/jobs/:id').get((ctx: any) => {
|
|
142
|
-
ctx.json({ value: riskyLookup() })
|
|
143
|
-
})
|
|
144
|
-
`;
|
|
145
|
-
};
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
export const responseContractImplicitSources = {
|
|
2
|
-
'called-helper': `
|
|
3
|
-
declare const app: any
|
|
4
|
-
async function handleCreate(ctx: any) {
|
|
5
|
-
ctx.setStatus(201)
|
|
6
|
-
return { id: 'one' as string }
|
|
7
|
-
}
|
|
8
|
-
app.route('/api/v1/items').post(async (ctx: any) => {
|
|
9
|
-
ctx.json(await handleCreate(ctx))
|
|
10
|
-
})
|
|
11
|
-
`,
|
|
12
|
-
'shared-helper': `
|
|
13
|
-
declare const app: any
|
|
14
|
-
function markCreated(ctx: any) { ctx.setStatus(201) }
|
|
15
|
-
app.route('/api/v1/items').post((ctx: any) => {
|
|
16
|
-
markCreated(ctx)
|
|
17
|
-
ctx.json({ id: 'one' as string })
|
|
18
|
-
})
|
|
19
|
-
app.route('/api/v1/widgets').post((ctx: any) => {
|
|
20
|
-
markCreated(ctx)
|
|
21
|
-
ctx.json({ id: 'one' as string })
|
|
22
|
-
})
|
|
23
|
-
`,
|
|
24
|
-
empty: `
|
|
25
|
-
declare const app: any
|
|
26
|
-
app.route('/api/v1/items/:id').delete((ctx: any) => {
|
|
27
|
-
ctx.setStatus(200)
|
|
28
|
-
ctx.response.empty()
|
|
29
|
-
})
|
|
30
|
-
`,
|
|
31
|
-
'error-guard': `
|
|
32
|
-
declare const app: any
|
|
33
|
-
app.route('/api/v1/auth/me').get((ctx: any) => {
|
|
34
|
-
if (!ctx.user) {
|
|
35
|
-
ctx.setStatus(401)
|
|
36
|
-
return ctx.json({ error: 'not authenticated' as string })
|
|
37
|
-
}
|
|
38
|
-
ctx.json({ user: { id: 'one' as string } })
|
|
39
|
-
})
|
|
40
|
-
`,
|
|
41
|
-
'two-guards': `
|
|
42
|
-
declare const app: any
|
|
43
|
-
app.route('/api/v1/items/:id').get((ctx: any) => {
|
|
44
|
-
if (!ctx.user) {
|
|
45
|
-
ctx.setStatus(401)
|
|
46
|
-
return ctx.json({ error: 'not authenticated' as string })
|
|
47
|
-
}
|
|
48
|
-
if (!ctx.item) {
|
|
49
|
-
ctx.setStatus(404)
|
|
50
|
-
return ctx.json({ error: 'not found' as string })
|
|
51
|
-
}
|
|
52
|
-
ctx.json({ item: { id: 'one' as string } })
|
|
53
|
-
})
|
|
54
|
-
`,
|
|
55
|
-
conflict: `
|
|
56
|
-
declare const app: any
|
|
57
|
-
const sendConflict = (ctx: any, existing: any) => {
|
|
58
|
-
ctx.setStatus(409)
|
|
59
|
-
if (!existing) {
|
|
60
|
-
ctx.json({ error: 'conflict' as string })
|
|
61
|
-
return
|
|
62
|
-
}
|
|
63
|
-
ctx.json({ error: 'conflict' as string, id: 'x' as string })
|
|
64
|
-
}
|
|
65
|
-
app.route('/api/v1/items').post((ctx: any) => {
|
|
66
|
-
const conflict: any = {}
|
|
67
|
-
if (conflict.existing !== undefined) {
|
|
68
|
-
sendConflict(ctx, conflict.existing)
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
ctx.setStatus(201)
|
|
72
|
-
ctx.json({ id: 'one' as string, status: 'pending' as string })
|
|
73
|
-
})
|
|
74
|
-
`,
|
|
75
|
-
ternary: `
|
|
76
|
-
declare const app: any
|
|
77
|
-
declare const created: boolean
|
|
78
|
-
app.route('/api/v1/items').post((ctx: any) => {
|
|
79
|
-
ctx.setStatus(created ? 201 : 200)
|
|
80
|
-
ctx.json({ id: 'one' as string })
|
|
81
|
-
})
|
|
82
|
-
`,
|
|
83
|
-
variants: `
|
|
84
|
-
declare const app: any
|
|
85
|
-
declare function apiResponse<K extends string, T>(key: K, body: T): T
|
|
86
|
-
app.route('/api/v1/items').post((ctx: any) => {
|
|
87
|
-
ctx.setStatus(422)
|
|
88
|
-
apiResponse('POST:/api/v1/items#validation', { error: 'invalid' as string })
|
|
89
|
-
ctx.setStatus(201)
|
|
90
|
-
apiResponse('POST:/api/v1/items', { id: 'one' as string })
|
|
91
|
-
})
|
|
92
|
-
`,
|
|
93
|
-
branches: `
|
|
94
|
-
declare const app: any
|
|
95
|
-
app.route('/api/v1/webhooks/:id').post((ctx: any) => {
|
|
96
|
-
if (ctx.body.event === 'known') {
|
|
97
|
-
ctx.json({ received: true as boolean })
|
|
98
|
-
return
|
|
99
|
-
}
|
|
100
|
-
ctx.json({ ignored: true as boolean })
|
|
101
|
-
})
|
|
102
|
-
`,
|
|
103
|
-
'secondary-failure': `
|
|
104
|
-
declare const app: any
|
|
105
|
-
declare function riskyLookup(): any
|
|
106
|
-
app.route('/api/v1/jobs/:id').get((ctx: any) => {
|
|
107
|
-
if (ctx.query.mode === 'basic') {
|
|
108
|
-
ctx.json({ ready: true as boolean })
|
|
109
|
-
return
|
|
110
|
-
}
|
|
111
|
-
ctx.json({ value: riskyLookup() })
|
|
112
|
-
})
|
|
113
|
-
`,
|
|
114
|
-
'empty-then-buffer': `
|
|
115
|
-
declare const app: any
|
|
116
|
-
declare const body: any
|
|
117
|
-
declare const contentType: string
|
|
118
|
-
app.route('/api/v1/mcp').post((ctx: any) => {
|
|
119
|
-
if (body.byteLength === 0) {
|
|
120
|
-
ctx.response.empty()
|
|
121
|
-
} else {
|
|
122
|
-
ctx.response.buffer(body, contentType)
|
|
123
|
-
}
|
|
124
|
-
})
|
|
125
|
-
`,
|
|
126
|
-
'buffer-then-empty': `
|
|
127
|
-
declare const app: any
|
|
128
|
-
declare const body: any
|
|
129
|
-
declare const contentType: string
|
|
130
|
-
app.route('/api/v1/mcp').post((ctx: any) => {
|
|
131
|
-
if (body.byteLength > 0) {
|
|
132
|
-
ctx.response.buffer(body, contentType)
|
|
133
|
-
} else {
|
|
134
|
-
ctx.response.empty()
|
|
135
|
-
}
|
|
136
|
-
})
|
|
137
|
-
`,
|
|
138
|
-
'single-failure': `
|
|
139
|
-
declare const app: any
|
|
140
|
-
declare function riskyLookup(): any
|
|
141
|
-
app.route('/api/v1/jobs/:id').get((ctx: any) => {
|
|
142
|
-
ctx.json({ value: riskyLookup() })
|
|
143
|
-
})
|
|
144
|
-
`,
|
|
145
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
import type { ImplicitResponseCallLabel } from './response-contract-call-classification.mts';
|
|
3
|
-
import { type DiscoverApiResponseContractsOptions } from './response-contract-lenient.mts';
|
|
4
|
-
import { type HandlerBindings } from './response-contract-route-analysis.mts';
|
|
5
|
-
import type { BackendResponseContract } from './response-contract-types.mts';
|
|
6
|
-
export declare function discoverImplicitContract(call: ts.CallExpression, checker: ts.TypeChecker, sourceFile: ts.SourceFile, contracts: Map<string, BackendResponseContract>, handlerBindings: HandlerBindings, callLabel: ImplicitResponseCallLabel | undefined, requestedKeys: ReadonlySet<string> | undefined, options: DiscoverApiResponseContractsOptions | undefined): void;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { extractContractSchema } from '../contract-schema/index.mjs';
|
|
3
|
-
import { isInErrorBranch } from './response-contract-error-branch.mjs';
|
|
4
|
-
import { containsResponseMarker, noContentContract, registerContract, responseBodyExpression, sourceLocation, } from './response-contract-registration.mjs';
|
|
5
|
-
import { streamingTextMediaType } from './response-contract-media.mjs';
|
|
6
|
-
import { nextImplicitVariantKey } from './response-contract-implicit-variants.mjs';
|
|
7
|
-
import { markBufferedRouteUnavailable, registerRouteContract, } from './response-contract-lenient.mjs';
|
|
8
|
-
import { enclosingRouteBinding, isContextMethod, requestedKeyForBinding, responseMarker, } from './response-contract-route-analysis.mjs';
|
|
9
|
-
import { resolveEmissionStatus } from './response-contract-status.mjs';
|
|
10
|
-
import { opaqueHttpResponse, unsupportedContextResponse, supportedResponseContext, } from './protocol-http-association.mjs';
|
|
11
|
-
import { contextResponseMethod } from './protocol-http-context.mjs';
|
|
12
|
-
import { taintRouteKeys, markRouteTaint, isSseSetter } from './protocol-http-implicit-taint.mjs';
|
|
13
|
-
export function discoverImplicitContract(call, checker, sourceFile, contracts, handlerBindings, callLabel, requestedKeys, options) {
|
|
14
|
-
const opaqueResponse = opaqueHttpResponse(call, checker);
|
|
15
|
-
const binding = enclosingRouteBinding(call, checker, handlerBindings, !opaqueResponse);
|
|
16
|
-
if (!binding)
|
|
17
|
-
return;
|
|
18
|
-
const key = requestedKeyForBinding(binding, requestedKeys);
|
|
19
|
-
const taintKeys = taintRouteKeys(contracts, binding, key);
|
|
20
|
-
if (!taintKeys.length)
|
|
21
|
-
return;
|
|
22
|
-
const context = supportedResponseContext(call, checker);
|
|
23
|
-
const bracketResponse = context &&
|
|
24
|
-
(ts.isElementAccessExpression(call.expression) ||
|
|
25
|
-
(ts.isPropertyAccessExpression(call.expression) &&
|
|
26
|
-
ts.isElementAccessExpression(call.expression.expression))) &&
|
|
27
|
-
contextResponseMethod(call.expression, context, checker);
|
|
28
|
-
const mutableResponse = unsupportedContextResponse(call, checker);
|
|
29
|
-
const sseSetter = isSseSetter(contracts, binding, bracketResponse || undefined);
|
|
30
|
-
if (opaqueResponse ||
|
|
31
|
-
mutableResponse ||
|
|
32
|
-
(bracketResponse && !sseSetter && !containsResponseMarker(call))) {
|
|
33
|
-
markRouteTaint(contracts, taintKeys, binding, sourceLocation(sourceFile, call), !!mutableResponse &&
|
|
34
|
-
!!context &&
|
|
35
|
-
!!contextResponseMethod(call.expression, context, checker, true));
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (!key)
|
|
39
|
-
return;
|
|
40
|
-
const body = responseBodyExpression(call);
|
|
41
|
-
if (body) {
|
|
42
|
-
if (ts.isCallExpression(body) && responseMarker(body.expression))
|
|
43
|
-
return;
|
|
44
|
-
if (requestedKeys && contracts.has(key))
|
|
45
|
-
return;
|
|
46
|
-
if (isInErrorBranch(call))
|
|
47
|
-
return;
|
|
48
|
-
const location = sourceLocation(sourceFile, call);
|
|
49
|
-
const extract = () => extractContractSchema(checker.getTypeAtLocation(body), checker, location, options);
|
|
50
|
-
const status = resolveEmissionStatus(call);
|
|
51
|
-
const emission = {
|
|
52
|
-
bodyKind: 'content',
|
|
53
|
-
mediaType: 'application/json',
|
|
54
|
-
mediaTypeKnowledge: 'known',
|
|
55
|
-
...status,
|
|
56
|
-
};
|
|
57
|
-
// Keep primary extraction failures unavailable in both full and subset discovery.
|
|
58
|
-
if (requestedKeys || !contracts.has(key)) {
|
|
59
|
-
registerRouteContract(contracts, key, binding, location, emission, extract, options);
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
// Preserve every additional unmarked body under a deterministic variant key, including
|
|
63
|
-
// unavailable secondary extractions. Route grouping merges these without hiding a branch.
|
|
64
|
-
registerRouteContract(contracts, nextImplicitVariantKey(contracts, key), binding, location, emission, extract, options);
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
if (callLabel === 'ctx.response.xml()') {
|
|
68
|
-
if (requestedKeys && contracts.has(key))
|
|
69
|
-
return;
|
|
70
|
-
const body = call.arguments[0];
|
|
71
|
-
const location = sourceLocation(sourceFile, call);
|
|
72
|
-
registerRouteContract(contracts, contracts.has(key) ? nextImplicitVariantKey(contracts, key) : key, binding, location, {
|
|
73
|
-
bodyKind: 'content',
|
|
74
|
-
mediaType: 'application/xml',
|
|
75
|
-
mediaTypeKnowledge: 'known',
|
|
76
|
-
...resolveEmissionStatus(call),
|
|
77
|
-
}, () => extractContractSchema(checker.getTypeAtLocation(body), checker, location, options), options);
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
const streamedTextMediaType = isContextMethod(call.expression, 'pipeline')
|
|
81
|
-
? streamingTextMediaType(call)
|
|
82
|
-
: undefined;
|
|
83
|
-
if (streamedTextMediaType) {
|
|
84
|
-
const location = sourceLocation(sourceFile, call);
|
|
85
|
-
registerRouteContract(contracts, contracts.has(key) ? nextImplicitVariantKey(contracts, key) : key, binding, location, {
|
|
86
|
-
bodyKind: 'content',
|
|
87
|
-
mediaType: streamedTextMediaType,
|
|
88
|
-
mediaTypeKnowledge: 'known',
|
|
89
|
-
...resolveEmissionStatus(call),
|
|
90
|
-
}, () => extractContractSchema(checker.getStringType(), checker, location, options), options);
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
// Empty branches must not hide any unmarked buffer or pipeline body.
|
|
94
|
-
if (callLabel === 'ctx.response.buffer()' ||
|
|
95
|
-
(callLabel === 'ctx.pipeline()' && !body && !containsResponseMarker(call))) {
|
|
96
|
-
markBufferedRouteUnavailable(contracts, key, binding, sourceLocation(sourceFile, call));
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
if (requestedKeys && contracts.has(key))
|
|
100
|
-
return;
|
|
101
|
-
const emissionStatus = resolveEmissionStatus(call);
|
|
102
|
-
const isExplicitNoContentCall = (isContextMethod(call.expression, 'setStatus') &&
|
|
103
|
-
call.arguments[0] &&
|
|
104
|
-
ts.isNumericLiteral(call.arguments[0]) &&
|
|
105
|
-
(call.arguments[0].text === '204' || call.arguments[0].text === '205')) ||
|
|
106
|
-
callLabel === 'ctx.response.empty()';
|
|
107
|
-
if (isExplicitNoContentCall) {
|
|
108
|
-
registerContract(contracts, contracts.has(key) ? nextImplicitVariantKey(contracts, key) : key, {
|
|
109
|
-
...noContentContract(sourceLocation(sourceFile, call)),
|
|
110
|
-
...binding,
|
|
111
|
-
bodyKind: 'none',
|
|
112
|
-
mediaTypeKnowledge: 'none',
|
|
113
|
-
...(emissionStatus.statusCodes ? { statusCodes: emissionStatus.statusCodes } : {}),
|
|
114
|
-
statusKnowledge: emissionStatus.statusKnowledge,
|
|
115
|
-
...(emissionStatus.unavailableReason
|
|
116
|
-
? { unavailableReason: emissionStatus.unavailableReason }
|
|
117
|
-
: {}),
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ExtractedResponseContract, ExtractContractSchemaOptions } from '../contract-schema/index.mts';
|
|
2
|
-
import type { RouteBinding } from './response-contract-route-analysis.mts';
|
|
3
|
-
import type { BackendResponseContract } from './response-contract-types.mts';
|
|
4
|
-
export type RouteDiscoveryError = {
|
|
5
|
-
method: string;
|
|
6
|
-
routeTemplate: string;
|
|
7
|
-
source: string;
|
|
8
|
-
reason: string;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* A response emitter found in a named handler registered for multiple routes. `sourceLocation`
|
|
12
|
-
* is a normalized source path followed by one-based line and column; `routes` contains unique,
|
|
13
|
-
* lexically sorted `METHOD:path` keys. `label` identifies the implicit response form.
|
|
14
|
-
*/
|
|
15
|
-
export type AmbiguousAttributionFact = {
|
|
16
|
-
sourceLocation: string;
|
|
17
|
-
label: string;
|
|
18
|
-
routes: readonly string[];
|
|
19
|
-
};
|
|
20
|
-
export type DiscoverApiResponseContractsOptions = ExtractContractSchemaOptions & {
|
|
21
|
-
onRouteError?: (error: RouteDiscoveryError) => void;
|
|
22
|
-
/**
|
|
23
|
-
* Opt in to response-attribution facts from the existing discovery pass. Facts are delivered
|
|
24
|
-
* after discovery succeeds, ordered by normalized source location; each callback receives its
|
|
25
|
-
* own copy of the sorted route list. Dynamic error payloads paired with a non-literal status are
|
|
26
|
-
* excluded from these facts; discovery output keeps its existing behavior. Consumers choose
|
|
27
|
-
* whether a fact needs a diagnostic or policy.
|
|
28
|
-
*/
|
|
29
|
-
onAmbiguousAttribution?: (fact: AmbiguousAttributionFact) => void;
|
|
30
|
-
};
|
|
31
|
-
/** Marks `key` unavailable regardless of AST visit order, for a route that can send a raw buffered body (e.g. a proxied MCP response) alongside a no-content branch. */
|
|
32
|
-
export declare function markBufferedRouteUnavailable(contracts: Map<string, BackendResponseContract>, key: string, binding: RouteBinding, source: string): void;
|
|
33
|
-
/**
|
|
34
|
-
* Extracts a route's response contract and registers it. When `options.onRouteError` is
|
|
35
|
-
* set, an extraction failure is caught, reported, and replaced with an `unavailable`
|
|
36
|
-
* placeholder instead of aborting discovery for every other route. With `options` absent
|
|
37
|
-
* (or `onRouteError` unset), behavior is unchanged: extraction failures throw.
|
|
38
|
-
*/
|
|
39
|
-
export declare function registerRouteContract(contracts: Map<string, BackendResponseContract>, key: string, binding: RouteBinding, location: string, emission: Pick<BackendResponseContract, 'bodyKind' | 'mediaType' | 'mediaTypeKnowledge' | 'statusCodes' | 'statusKnowledge'> & {
|
|
40
|
-
unavailableReason?: string;
|
|
41
|
-
}, extract: () => ExtractedResponseContract, options: DiscoverApiResponseContractsOptions | undefined): void;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { hashContractSchema } from '../contract-schema/index.mjs';
|
|
2
|
-
import { registerContract } from './response-contract-registration.mjs';
|
|
3
|
-
/** Placeholder contract for a route whose response type could not be extracted. */
|
|
4
|
-
function unavailableContract(source, reason) {
|
|
5
|
-
const schema = { root: { type: 'unknown' }, definitions: {} };
|
|
6
|
-
return { source, schema, hash: hashContractSchema(schema), unavailableReason: reason };
|
|
7
|
-
}
|
|
8
|
-
/** Marks `key` unavailable regardless of AST visit order, for a route that can send a raw buffered body (e.g. a proxied MCP response) alongside a no-content branch. */
|
|
9
|
-
export function markBufferedRouteUnavailable(contracts, key, binding, source) {
|
|
10
|
-
contracts.set(key, {
|
|
11
|
-
...unavailableContract(source, 'route can send a raw buffered response body (ctx.response.buffer) whose shape is not statically determinable'),
|
|
12
|
-
...binding,
|
|
13
|
-
bodyKind: 'content',
|
|
14
|
-
statusKnowledge: 'unknown',
|
|
15
|
-
mediaTypeKnowledge: 'unknown',
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Extracts a route's response contract and registers it. When `options.onRouteError` is
|
|
20
|
-
* set, an extraction failure is caught, reported, and replaced with an `unavailable`
|
|
21
|
-
* placeholder instead of aborting discovery for every other route. With `options` absent
|
|
22
|
-
* (or `onRouteError` unset), behavior is unchanged: extraction failures throw.
|
|
23
|
-
*/
|
|
24
|
-
export function registerRouteContract(contracts, key, binding, location, emission, extract, options) {
|
|
25
|
-
let extracted;
|
|
26
|
-
try {
|
|
27
|
-
if (emission.unavailableReason)
|
|
28
|
-
throw new Error(emission.unavailableReason);
|
|
29
|
-
extracted = extract();
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
if (!options?.onRouteError)
|
|
33
|
-
throw error;
|
|
34
|
-
const reason = error instanceof Error ? error.message : String(error);
|
|
35
|
-
options.onRouteError({
|
|
36
|
-
method: binding.method,
|
|
37
|
-
routeTemplate: binding.routeTemplate,
|
|
38
|
-
source: location,
|
|
39
|
-
reason,
|
|
40
|
-
});
|
|
41
|
-
extracted = unavailableContract(location, reason);
|
|
42
|
-
}
|
|
43
|
-
registerContract(contracts, key, {
|
|
44
|
-
...extracted,
|
|
45
|
-
...binding,
|
|
46
|
-
...(emission.bodyKind ? { bodyKind: emission.bodyKind } : {}),
|
|
47
|
-
...(emission.mediaType ? { mediaType: emission.mediaType } : {}),
|
|
48
|
-
...(emission.mediaTypeKnowledge ? { mediaTypeKnowledge: emission.mediaTypeKnowledge } : {}),
|
|
49
|
-
...(emission.statusCodes ? { statusCodes: emission.statusCodes } : {}),
|
|
50
|
-
...(emission.statusKnowledge ? { statusKnowledge: emission.statusKnowledge } : {}),
|
|
51
|
-
});
|
|
52
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { isContextMethod } from './response-contract-route-analysis.mjs';
|
|
3
|
-
export function isXmlResponseCall(call) {
|
|
4
|
-
const expression = call.expression;
|
|
5
|
-
return (ts.isPropertyAccessExpression(expression) &&
|
|
6
|
-
expression.name.text === 'xml' &&
|
|
7
|
-
isContextMethod(expression.expression, 'response'));
|
|
8
|
-
}
|
|
9
|
-
export function streamingTextMediaType(call) {
|
|
10
|
-
let statement = call;
|
|
11
|
-
while (!ts.isStatement(statement))
|
|
12
|
-
statement = statement.parent;
|
|
13
|
-
const contentType = precedingContentType(statement);
|
|
14
|
-
return contentType === 'unsupported' ? undefined : contentType;
|
|
15
|
-
}
|
|
16
|
-
function precedingContentType(statement) {
|
|
17
|
-
const block = statement.parent;
|
|
18
|
-
if (!ts.isBlock(block))
|
|
19
|
-
return undefined;
|
|
20
|
-
const index = block.statements.indexOf(statement);
|
|
21
|
-
for (let i = index - 1; i >= 0; i--) {
|
|
22
|
-
const contentType = contentTypeStatement(block.statements[i]);
|
|
23
|
-
if (contentType)
|
|
24
|
-
return contentType;
|
|
25
|
-
}
|
|
26
|
-
const enclosing = block.parent;
|
|
27
|
-
return ts.isStatement(enclosing) ? precedingContentType(enclosing) : undefined;
|
|
28
|
-
}
|
|
29
|
-
function contentTypeStatement(statement) {
|
|
30
|
-
if (!ts.isExpressionStatement(statement) || !ts.isCallExpression(statement.expression))
|
|
31
|
-
return undefined;
|
|
32
|
-
const setter = statement.expression;
|
|
33
|
-
if (!isContextMethod(setter.expression, 'set'))
|
|
34
|
-
return undefined;
|
|
35
|
-
const [name, value] = setter.arguments;
|
|
36
|
-
if (!name || !ts.isStringLiteral(name) || name.text.toLowerCase() !== 'content-type')
|
|
37
|
-
return undefined;
|
|
38
|
-
if (!value || !ts.isStringLiteral(value))
|
|
39
|
-
return 'unsupported';
|
|
40
|
-
const contentType = value.text.toLowerCase();
|
|
41
|
-
if (contentType.startsWith('text/csv'))
|
|
42
|
-
return 'text/csv';
|
|
43
|
-
if (contentType.startsWith('application/xml'))
|
|
44
|
-
return 'application/xml';
|
|
45
|
-
return 'unsupported';
|
|
46
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
export declare function propertyImplementationSymbol(access: ts.PropertyAccessExpression, checker: ts.TypeChecker): ts.Symbol | undefined;
|
|
3
|
-
export declare function destructuredPropertyImplementationSymbol(declaration: ts.BindingElement, checker: ts.TypeChecker): ts.Symbol | undefined;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { unwrapTransparentExpression } from './response-contract-route-syntax.mjs';
|
|
3
|
-
export function propertyImplementationSymbol(access, checker) {
|
|
4
|
-
const contextual = checker.getSymbolAtLocation(access.name);
|
|
5
|
-
const receiver = unwrapTransparentExpression(access.expression);
|
|
6
|
-
if (!contextual || !ts.isIdentifier(receiver))
|
|
7
|
-
return undefined;
|
|
8
|
-
const receiverSymbol = checker.getSymbolAtLocation(receiver);
|
|
9
|
-
const declaration = receiverSymbol?.valueDeclaration;
|
|
10
|
-
if (!declaration || !ts.isVariableDeclaration(declaration))
|
|
11
|
-
return contextual;
|
|
12
|
-
if (!declaration.initializer ||
|
|
13
|
-
!ts.isVariableDeclarationList(declaration.parent) ||
|
|
14
|
-
!(declaration.parent.flags & ts.NodeFlags.Const))
|
|
15
|
-
return undefined;
|
|
16
|
-
return constObjectPropertySymbol(receiver, access.name.text, checker);
|
|
17
|
-
}
|
|
18
|
-
export function destructuredPropertyImplementationSymbol(declaration, checker) {
|
|
19
|
-
const pattern = declaration.parent;
|
|
20
|
-
if (!ts.isObjectBindingPattern(pattern) || !ts.isIdentifier(declaration.name))
|
|
21
|
-
return undefined;
|
|
22
|
-
const variable = pattern.parent;
|
|
23
|
-
if (!ts.isVariableDeclaration(variable) ||
|
|
24
|
-
!variable.initializer ||
|
|
25
|
-
!ts.isVariableDeclarationList(variable.parent) ||
|
|
26
|
-
!(variable.parent.flags & ts.NodeFlags.Const))
|
|
27
|
-
return undefined;
|
|
28
|
-
if (declaration.dotDotDotToken || declaration.initializer)
|
|
29
|
-
return undefined;
|
|
30
|
-
const property = declaration.propertyName ?? declaration.name;
|
|
31
|
-
if (!ts.isIdentifier(property) && !ts.isStringLiteral(property))
|
|
32
|
-
return undefined;
|
|
33
|
-
const initializer = unwrapTransparentExpression(variable.initializer);
|
|
34
|
-
return ts.isIdentifier(initializer)
|
|
35
|
-
? constObjectPropertySymbol(initializer, property.text, checker)
|
|
36
|
-
: undefined;
|
|
37
|
-
}
|
|
38
|
-
function constObjectPropertySymbol(receiver, key, checker, seen = new Set()) {
|
|
39
|
-
const receiverSymbol = checker.getSymbolAtLocation(receiver);
|
|
40
|
-
if (!receiverSymbol || seen.has(receiverSymbol))
|
|
41
|
-
return undefined;
|
|
42
|
-
seen.add(receiverSymbol);
|
|
43
|
-
const declaration = receiverSymbol.valueDeclaration;
|
|
44
|
-
if (!declaration ||
|
|
45
|
-
!ts.isVariableDeclaration(declaration) ||
|
|
46
|
-
!declaration.initializer ||
|
|
47
|
-
!ts.isVariableDeclarationList(declaration.parent) ||
|
|
48
|
-
!(declaration.parent.flags & ts.NodeFlags.Const))
|
|
49
|
-
return undefined;
|
|
50
|
-
const initializer = unwrapTransparentExpression(declaration.initializer);
|
|
51
|
-
if (ts.isIdentifier(initializer))
|
|
52
|
-
return constObjectPropertySymbol(initializer, key, checker, seen);
|
|
53
|
-
if (!ts.isObjectLiteralExpression(initializer))
|
|
54
|
-
return undefined;
|
|
55
|
-
if (initializer.properties.some(ts.isSpreadAssignment))
|
|
56
|
-
return undefined;
|
|
57
|
-
const implementation = initializer.properties.findLast((property) => {
|
|
58
|
-
const name = property.name;
|
|
59
|
-
return objectLiteralPropertyName(name) === key;
|
|
60
|
-
});
|
|
61
|
-
if (implementation && ts.isPropertyAssignment(implementation)) {
|
|
62
|
-
const value = unwrapTransparentExpression(implementation.initializer);
|
|
63
|
-
if (ts.isIdentifier(value))
|
|
64
|
-
return checker.getSymbolAtLocation(value);
|
|
65
|
-
}
|
|
66
|
-
if (implementation &&
|
|
67
|
-
(ts.isGetAccessorDeclaration(implementation) || ts.isSetAccessorDeclaration(implementation)))
|
|
68
|
-
return undefined;
|
|
69
|
-
return implementation?.name && checker.getSymbolAtLocation(implementation.name);
|
|
70
|
-
}
|
|
71
|
-
function objectLiteralPropertyName(name) {
|
|
72
|
-
if (ts.isIdentifier(name) || ts.isStringLiteral(name) || ts.isNumericLiteral(name))
|
|
73
|
-
return name.text;
|
|
74
|
-
if (!ts.isComputedPropertyName(name))
|
|
75
|
-
return undefined;
|
|
76
|
-
const expression = unwrapTransparentExpression(name.expression);
|
|
77
|
-
return ts.isStringLiteral(expression) || ts.isNoSubstitutionTemplateLiteral(expression)
|
|
78
|
-
? expression.text
|
|
79
|
-
: undefined;
|
|
80
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
/** Direct syntactic property writes are excluded; indirect mutation is outside this proof. */
|
|
3
|
-
export declare function findMutatedProperties(sourceFiles: readonly ts.SourceFile[], checker: ts.TypeChecker): Set<ts.Symbol>;
|
|
4
|
-
/** Direct identifier and destructuring writes are excluded; indirect writes are unproven. */
|
|
5
|
-
export declare function findMutatedBindings(sourceFiles: readonly ts.SourceFile[], checker: ts.TypeChecker): Set<ts.Symbol>;
|