vouchington-tooling 0.34.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 +3 -5
- 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/model.d.mts +4 -0
- package/dist/finite-enum-ripple/parser-support.mjs +16 -3
- package/dist/finite-enum-ripple/parsers.mjs +5 -3
- package/dist/finite-enum-ripple/structured-route-check.mjs +5 -5
- 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 +5 -5
- 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.d.mts +1 -3
- package/dist/workflow-policy/index.mjs +4 -6
- 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/workflow-policy/types.d.mts +2 -28
- 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/docs/workflow-and-compiler.md +7 -16
- 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/workflow-policy/concurrency-scope.d.mts +0 -4
- package/dist/workflow-policy/concurrency-scope.mjs +0 -66
- package/dist/workflow-policy/concurrency.d.mts +0 -10
- package/dist/workflow-policy/concurrency.mjs +0 -77
- package/dist/workflow-policy/graph.d.mts +0 -2
- package/dist/workflow-policy/graph.mjs +0 -138
- /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,126 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { executableProtocolPath } from './protocol-execution-path.mjs';
|
|
3
|
-
import { potentiallyExecuted } from './protocol-executable-path.mjs';
|
|
4
|
-
import { attributionSymbol, resolveSymbol } from './response-contract-symbols.mjs';
|
|
5
|
-
import { findMutatedBindings, findMutatedProperties, } from './response-contract-property-mutations.mjs';
|
|
6
|
-
import { handlerArgumentSymbols, isMutatedPropertyAccess, } from './response-contract-handler-calls.mjs';
|
|
7
|
-
import { HTTP_METHODS, propertyName, routeTemplateFromExpression, unwrapTransparentExpression, visit, } from './response-contract-route-syntax.mjs';
|
|
8
|
-
import { destructuredPropertyImplementationSymbol, propertyImplementationSymbol, } from './response-contract-object-symbols.mjs';
|
|
9
|
-
export function collectHandlerBindings(sourceFiles, checker, ambiguousBindings) {
|
|
10
|
-
const bindingsBySymbol = new Map();
|
|
11
|
-
const attributionBindingsBySymbol = new Map();
|
|
12
|
-
const mutatedProperties = ambiguousBindings
|
|
13
|
-
? findMutatedProperties(sourceFiles, checker)
|
|
14
|
-
: undefined;
|
|
15
|
-
const mutatedBindings = ambiguousBindings ? findMutatedBindings(sourceFiles, checker) : undefined;
|
|
16
|
-
for (const sourceFile of sourceFiles) {
|
|
17
|
-
visit(sourceFile, (node) => {
|
|
18
|
-
if (!ts.isCallExpression(node))
|
|
19
|
-
return;
|
|
20
|
-
const method = propertyName(node.expression)?.toUpperCase();
|
|
21
|
-
if (!method || !HTTP_METHODS.has(method))
|
|
22
|
-
return;
|
|
23
|
-
const routeTemplate = routeTemplateFromExpression(node.expression);
|
|
24
|
-
if (!routeTemplate)
|
|
25
|
-
return;
|
|
26
|
-
const binding = { method, routeTemplate };
|
|
27
|
-
for (const symbol of handlerArgumentSymbols(node, checker)) {
|
|
28
|
-
const resolved = resolveSymbol(symbol, checker);
|
|
29
|
-
const candidates = bindingsBySymbol.get(resolved) ?? [];
|
|
30
|
-
candidates.push(binding);
|
|
31
|
-
bindingsBySymbol.set(resolved, candidates);
|
|
32
|
-
}
|
|
33
|
-
if (ambiguousBindings) {
|
|
34
|
-
if (!potentiallyExecuted(node))
|
|
35
|
-
return;
|
|
36
|
-
if (!isExportedRouteBuilder(node) && !executableProtocolPath(node, checker))
|
|
37
|
-
return;
|
|
38
|
-
for (const symbol of handlerArgumentSymbols(node, checker, true, mutatedProperties)) {
|
|
39
|
-
const propertySymbol = attributionSymbol(resolveSymbol(symbol, checker), checker);
|
|
40
|
-
if (mutatedProperties?.has(propertySymbol))
|
|
41
|
-
continue;
|
|
42
|
-
const handlerSymbol = resolveHandlerSymbol(symbol, checker, mutatedProperties);
|
|
43
|
-
const resolvedAttributionSymbol = attributionSymbol(handlerSymbol, checker);
|
|
44
|
-
if (mutatedProperties?.has(resolvedAttributionSymbol))
|
|
45
|
-
continue;
|
|
46
|
-
if (mutatedBindings?.has(resolvedAttributionSymbol))
|
|
47
|
-
continue;
|
|
48
|
-
const attributionCandidates = attributionBindingsBySymbol.get(resolvedAttributionSymbol) ?? [];
|
|
49
|
-
attributionCandidates.push(binding);
|
|
50
|
-
attributionBindingsBySymbol.set(resolvedAttributionSymbol, attributionCandidates);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
const bindings = new Map();
|
|
56
|
-
for (const [symbol, candidates] of bindingsBySymbol) {
|
|
57
|
-
const [first] = candidates;
|
|
58
|
-
const unambiguous = candidates.every((candidate) => candidate.method === first.method && candidate.routeTemplate === first.routeTemplate);
|
|
59
|
-
if (unambiguous) {
|
|
60
|
-
bindings.set(symbol, first);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (ambiguousBindings) {
|
|
64
|
-
for (const [symbol, candidates] of attributionBindingsBySymbol) {
|
|
65
|
-
const [first] = candidates;
|
|
66
|
-
const unambiguous = candidates.every((candidate) => candidate.method === first.method && candidate.routeTemplate === first.routeTemplate);
|
|
67
|
-
if (!unambiguous) {
|
|
68
|
-
ambiguousBindings.set(symbol, [
|
|
69
|
-
...new Set(candidates.map(({ method, routeTemplate }) => `${method}:${routeTemplate}`)),
|
|
70
|
-
].toSorted());
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return bindings;
|
|
75
|
-
}
|
|
76
|
-
function isExportedRouteBuilder(node) {
|
|
77
|
-
let current = node.parent;
|
|
78
|
-
while (current) {
|
|
79
|
-
if (ts.isFunctionLike(current))
|
|
80
|
-
return (ts.isFunctionDeclaration(current) &&
|
|
81
|
-
!!(ts.getCombinedModifierFlags(current) &
|
|
82
|
-
(ts.ModifierFlags.Export | ts.ModifierFlags.Default)));
|
|
83
|
-
current = current.parent;
|
|
84
|
-
}
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
function resolveHandlerSymbol(symbol, checker, mutatedProperties) {
|
|
88
|
-
const seen = new Set();
|
|
89
|
-
let current = resolveSymbol(symbol, checker);
|
|
90
|
-
while (!seen.has(current)) {
|
|
91
|
-
seen.add(current);
|
|
92
|
-
const declaration = current.valueDeclaration;
|
|
93
|
-
if (declaration && ts.isBindingElement(declaration)) {
|
|
94
|
-
const value = destructuredPropertyImplementationSymbol(declaration, checker);
|
|
95
|
-
if (!value)
|
|
96
|
-
return current;
|
|
97
|
-
current = resolveSymbol(value, checker);
|
|
98
|
-
continue;
|
|
99
|
-
}
|
|
100
|
-
if (declaration && ts.isShorthandPropertyAssignment(declaration)) {
|
|
101
|
-
const value = checker.getShorthandAssignmentValueSymbol(declaration);
|
|
102
|
-
if (!value)
|
|
103
|
-
return current;
|
|
104
|
-
current = resolveSymbol(value, checker);
|
|
105
|
-
continue;
|
|
106
|
-
}
|
|
107
|
-
if (!declaration || !ts.isVariableDeclaration(declaration) || !declaration.initializer)
|
|
108
|
-
return current;
|
|
109
|
-
if (!ts.isVariableDeclarationList(declaration.parent) ||
|
|
110
|
-
!(declaration.parent.flags & ts.NodeFlags.Const))
|
|
111
|
-
return current;
|
|
112
|
-
const initializer = unwrapTransparentExpression(declaration.initializer);
|
|
113
|
-
if (ts.isPropertyAccessExpression(initializer) &&
|
|
114
|
-
isMutatedPropertyAccess(initializer, checker, mutatedProperties))
|
|
115
|
-
return current;
|
|
116
|
-
const next = ts.isIdentifier(initializer)
|
|
117
|
-
? checker.getSymbolAtLocation(initializer)
|
|
118
|
-
: ts.isPropertyAccessExpression(initializer)
|
|
119
|
-
? propertyImplementationSymbol(initializer, checker)
|
|
120
|
-
: undefined;
|
|
121
|
-
if (!next)
|
|
122
|
-
return current;
|
|
123
|
-
current = resolveSymbol(next, checker);
|
|
124
|
-
}
|
|
125
|
-
return current;
|
|
126
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
export declare function handlerArgumentSymbols(node: ts.CallExpression, checker: ts.TypeChecker, unwrapArguments?: boolean, mutatedProperties?: ReadonlySet<ts.Symbol>): ts.Symbol[];
|
|
3
|
-
export declare function isMutatedPropertyAccess(expression: ts.Expression, checker: ts.TypeChecker, mutatedProperties: ReadonlySet<ts.Symbol> | undefined): boolean;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { executableProtocolPath } from './protocol-execution-path.mjs';
|
|
3
|
-
import { attributionSymbol, resolveSymbol } from './response-contract-symbols.mjs';
|
|
4
|
-
import { propertyImplementationSymbol } from './response-contract-object-symbols.mjs';
|
|
5
|
-
import { isInlineRouteHandler, unwrapTransparentExpression, } from './response-contract-route-syntax.mjs';
|
|
6
|
-
export function handlerArgumentSymbols(node, checker, unwrapArguments = false, mutatedProperties) {
|
|
7
|
-
const symbols = [];
|
|
8
|
-
for (const originalArgument of node.arguments) {
|
|
9
|
-
const argument = unwrapArguments
|
|
10
|
-
? unwrapTransparentExpression(originalArgument)
|
|
11
|
-
: originalArgument;
|
|
12
|
-
if (ts.isIdentifier(argument)) {
|
|
13
|
-
const symbol = checker.getSymbolAtLocation(argument);
|
|
14
|
-
if (symbol)
|
|
15
|
-
symbols.push(symbol);
|
|
16
|
-
continue;
|
|
17
|
-
}
|
|
18
|
-
if (unwrapArguments && ts.isPropertyAccessExpression(argument)) {
|
|
19
|
-
const mutatedSymbol = mutatedPropertyAccessSymbol(argument, checker, mutatedProperties);
|
|
20
|
-
if (mutatedSymbol) {
|
|
21
|
-
symbols.push(mutatedSymbol);
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
const symbol = propertyImplementationSymbol(argument, checker);
|
|
25
|
-
if (symbol)
|
|
26
|
-
symbols.push(symbol);
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
if (!isFunctionLike(argument))
|
|
30
|
-
continue;
|
|
31
|
-
visitHandlerCalls(argument, argument, checker, unwrapArguments, (child) => {
|
|
32
|
-
const callee = unwrapArguments
|
|
33
|
-
? unwrapTransparentExpression(child.expression)
|
|
34
|
-
: child.expression;
|
|
35
|
-
const mutatedSymbol = mutatedPropertyAccessSymbol(callee, checker, mutatedProperties);
|
|
36
|
-
if (mutatedSymbol) {
|
|
37
|
-
symbols.push(mutatedSymbol);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const symbol = handlerSymbol(callee, checker, unwrapArguments);
|
|
41
|
-
if (symbol)
|
|
42
|
-
symbols.push(symbol);
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
return symbols;
|
|
46
|
-
}
|
|
47
|
-
export function isMutatedPropertyAccess(expression, checker, mutatedProperties) {
|
|
48
|
-
return !!mutatedPropertyAccessSymbol(expression, checker, mutatedProperties);
|
|
49
|
-
}
|
|
50
|
-
function mutatedPropertyAccessSymbol(expression, checker, mutatedProperties) {
|
|
51
|
-
if (!mutatedProperties || !ts.isPropertyAccessExpression(expression))
|
|
52
|
-
return undefined;
|
|
53
|
-
const contextual = checker.getSymbolAtLocation(expression.name);
|
|
54
|
-
return contextual &&
|
|
55
|
-
mutatedProperties.has(attributionSymbol(resolveSymbol(contextual, checker), checker))
|
|
56
|
-
? contextual
|
|
57
|
-
: undefined;
|
|
58
|
-
}
|
|
59
|
-
function handlerSymbol(expression, checker, resolvePropertyImplementation) {
|
|
60
|
-
if (resolvePropertyImplementation && ts.isPropertyAccessExpression(expression))
|
|
61
|
-
return propertyImplementationSymbol(expression, checker);
|
|
62
|
-
return checker.getSymbolAtLocation(expression);
|
|
63
|
-
}
|
|
64
|
-
function visitHandlerCalls(node, root, checker, attributeNestedCalls, onCall) {
|
|
65
|
-
if (node !== root && isInlineRouteHandler(node))
|
|
66
|
-
return;
|
|
67
|
-
const callee = ts.isCallExpression(node)
|
|
68
|
-
? attributeNestedCalls
|
|
69
|
-
? unwrapTransparentExpression(node.expression)
|
|
70
|
-
: node.expression
|
|
71
|
-
: undefined;
|
|
72
|
-
if (ts.isCallExpression(node) &&
|
|
73
|
-
!!callee &&
|
|
74
|
-
(ts.isIdentifier(callee) || (attributeNestedCalls && ts.isPropertyAccessExpression(callee))) &&
|
|
75
|
-
executableProtocolPath(node, checker, attributeNestedCalls ? root : undefined))
|
|
76
|
-
onCall(node);
|
|
77
|
-
ts.forEachChild(node, (child) => visitHandlerCalls(child, root, checker, attributeNestedCalls, onCall));
|
|
78
|
-
}
|
|
79
|
-
function isFunctionLike(node) {
|
|
80
|
-
return ts.isArrowFunction(node) || ts.isFunctionExpression(node);
|
|
81
|
-
}
|
|
@@ -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
|
-
}
|