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,31 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { contextResponseMethod } from './protocol-http-context.mjs';
|
|
3
|
-
import { unwrapExpression } from './protocol-marker-analysis.mjs';
|
|
4
|
-
import { executableProtocolPath } from './protocol-execution-path.mjs';
|
|
5
|
-
import { opaqueProtocolCallbackPath } from './protocol-opaque-callback.mjs';
|
|
6
|
-
const responseMethods = new Set([
|
|
7
|
-
'setStatus',
|
|
8
|
-
'pipeline',
|
|
9
|
-
'json',
|
|
10
|
-
'response',
|
|
11
|
-
'response.buffer',
|
|
12
|
-
'response.empty',
|
|
13
|
-
]);
|
|
14
|
-
/** A feasible write through a canonical context alias invalidates response dispatch evidence. */
|
|
15
|
-
export function mutatesHttpResponseMethod(node, context, checker) {
|
|
16
|
-
let target;
|
|
17
|
-
if (ts.isBinaryExpression(node) &&
|
|
18
|
-
node.operatorToken.kind >= ts.SyntaxKind.FirstAssignment &&
|
|
19
|
-
node.operatorToken.kind <= ts.SyntaxKind.LastAssignment)
|
|
20
|
-
target = node.left;
|
|
21
|
-
if (ts.isDeleteExpression(node))
|
|
22
|
-
target = node.expression;
|
|
23
|
-
if ((ts.isPrefixUnaryExpression(node) || ts.isPostfixUnaryExpression(node)) &&
|
|
24
|
-
(node.operator === ts.SyntaxKind.PlusPlusToken ||
|
|
25
|
-
node.operator === ts.SyntaxKind.MinusMinusToken))
|
|
26
|
-
target = node.operand;
|
|
27
|
-
if (!target ||
|
|
28
|
-
!responseMethods.has(contextResponseMethod(unwrapExpression(target), context, checker, true) ?? ''))
|
|
29
|
-
return false;
|
|
30
|
-
return executableProtocolPath(node, checker) || opaqueProtocolCallbackPath(node, checker);
|
|
31
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
/** Both the actual invoked value and signature must belong to the compiler library. */
|
|
3
|
-
export declare function standardReflectApply(call: ts.CallExpression, checker: ts.TypeChecker): boolean;
|
|
4
|
-
/** Reflected context emissions cannot prove the marked status or response body. */
|
|
5
|
-
export declare function reflectHttpResponseMethod(call: ts.CallExpression, context: ts.Symbol, checker: ts.TypeChecker): string | undefined;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { standardCompilerDeclaration } from './protocol-platform-callbacks.mjs';
|
|
3
|
-
import { expressionReceiver } from './protocol-write-receiver.mjs';
|
|
4
|
-
import { unwrapExpression } from './protocol-marker-analysis.mjs';
|
|
5
|
-
import { contextResponseMethod, httpContextReceiver, methodAccess, } from './protocol-http-method-access.mjs';
|
|
6
|
-
/** Both the actual invoked value and signature must belong to the compiler library. */
|
|
7
|
-
export function standardReflectApply(call, checker) {
|
|
8
|
-
const access = methodAccess(unwrapExpression(call.expression));
|
|
9
|
-
const receiver = expressionReceiver(access?.receiver ?? call.expression, checker);
|
|
10
|
-
if (!receiver)
|
|
11
|
-
return false;
|
|
12
|
-
const path = [...receiver.path, ...(access ? [access.name] : [])];
|
|
13
|
-
if (path.join('.') !== 'apply')
|
|
14
|
-
return false;
|
|
15
|
-
if (!receiver.root.declarations?.every((value) => standardCompilerDeclaration(value, checker)))
|
|
16
|
-
return false;
|
|
17
|
-
const declaration = checker.getResolvedSignature(call)?.declaration;
|
|
18
|
-
if (!declaration || !ts.isFunctionDeclaration(declaration) || declaration.name?.text !== 'apply')
|
|
19
|
-
return false;
|
|
20
|
-
const namespace = declaration.parent.parent;
|
|
21
|
-
return (ts.isModuleDeclaration(namespace) &&
|
|
22
|
-
namespace.name.text === 'Reflect' &&
|
|
23
|
-
standardCompilerDeclaration(declaration, checker));
|
|
24
|
-
}
|
|
25
|
-
/** Reflected context emissions cannot prove the marked status or response body. */
|
|
26
|
-
export function reflectHttpResponseMethod(call, context, checker) {
|
|
27
|
-
if (!standardReflectApply(call, checker))
|
|
28
|
-
return undefined;
|
|
29
|
-
const target = call.arguments[0];
|
|
30
|
-
const direct = target && contextResponseMethod(target, context, checker, true);
|
|
31
|
-
if (direct)
|
|
32
|
-
return direct;
|
|
33
|
-
const method = target && expressionReceiver(target, checker);
|
|
34
|
-
if (method?.root === context)
|
|
35
|
-
return method.path[0] === 'response' ? method.path.slice(0, 2).join('.') : method.path[0];
|
|
36
|
-
const receiver = call.arguments[1] && httpContextReceiver(call.arguments[1], checker);
|
|
37
|
-
const name = (target && methodAccess(target)?.name) ?? method?.path.at(-1);
|
|
38
|
-
if (receiver?.root !== context || !name)
|
|
39
|
-
return undefined;
|
|
40
|
-
return receiver.path.length === 0
|
|
41
|
-
? name
|
|
42
|
-
: receiver.path.length === 1 && receiver.path[0] === 'response'
|
|
43
|
-
? `response.${name}`
|
|
44
|
-
: undefined;
|
|
45
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
import type { RouteBinding } from './response-contract-route-analysis.mts';
|
|
3
|
-
import type { BackendResponseContract } from './response-contract-types.mts';
|
|
4
|
-
export type PendingHttp = {
|
|
5
|
-
call: ts.CallExpression;
|
|
6
|
-
symbol: ts.Symbol;
|
|
7
|
-
keys: string[];
|
|
8
|
-
binding: RouteBinding;
|
|
9
|
-
variants: Omit<BackendResponseContract, 'method' | 'routeTemplate'>[];
|
|
10
|
-
declaredBodyKinds: ReadonlySet<'content' | 'none'>;
|
|
11
|
-
};
|
|
12
|
-
export declare function registerHttpProtocols(pending: readonly PendingHttp[], contracts: Map<string, BackendResponseContract>, checker: ts.TypeChecker, reject: (response: PendingHttp, error: unknown) => void): Set<ts.CallExpression>;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { associateHttpResponse } from './protocol-http-association.mjs';
|
|
3
|
-
import { enclosingFunction } from './protocol-marker-analysis.mjs';
|
|
4
|
-
import { statusDominatesEmission } from './protocol-status-dominance.mjs';
|
|
5
|
-
export function registerHttpProtocols(pending, contracts, checker, reject) {
|
|
6
|
-
const covered = new Set();
|
|
7
|
-
const groups = new Map();
|
|
8
|
-
for (const response of pending) {
|
|
9
|
-
const handler = enclosingFunction(response.call);
|
|
10
|
-
const group = groups.get(handler) ?? [];
|
|
11
|
-
group.push(response);
|
|
12
|
-
groups.set(handler, group);
|
|
13
|
-
}
|
|
14
|
-
for (const group of groups.values()) {
|
|
15
|
-
if (!group.some((response) => response.keys.length))
|
|
16
|
-
continue;
|
|
17
|
-
try {
|
|
18
|
-
const siblings = new Set(group.map((response) => response.symbol));
|
|
19
|
-
const associations = new Map(group.map((response) => [
|
|
20
|
-
response,
|
|
21
|
-
associateHttpResponse(response.call, response.symbol, checker, siblings),
|
|
22
|
-
]));
|
|
23
|
-
const allStatuses = new Set([...associations.values()].flatMap((emissions) => [...emissions].filter(([, kind]) => kind === 'status').map(([call]) => call)));
|
|
24
|
-
const proven = new Set();
|
|
25
|
-
for (const [response, emissions] of associations) {
|
|
26
|
-
proveHttpEmissions(response, emissions, allStatuses);
|
|
27
|
-
for (const call of emissions.keys())
|
|
28
|
-
proven.add(call);
|
|
29
|
-
}
|
|
30
|
-
// Every sibling must prove its own emissions before any group contract is published.
|
|
31
|
-
for (const response of group)
|
|
32
|
-
response.variants.forEach((variant, index) => contracts.set(response.keys[index], { ...variant, ...response.binding }));
|
|
33
|
-
for (const call of proven)
|
|
34
|
-
covered.add(call);
|
|
35
|
-
}
|
|
36
|
-
catch (error) {
|
|
37
|
-
for (const response of group)
|
|
38
|
-
if (response.keys.length)
|
|
39
|
-
reject(response, error);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return covered;
|
|
43
|
-
}
|
|
44
|
-
function proveHttpEmissions(response, emissions, allStatuses) {
|
|
45
|
-
const statuses = new Set([...emissions].filter(([, kind]) => kind === 'status').map(([call]) => call));
|
|
46
|
-
const kinds = new Set(emissions.values());
|
|
47
|
-
const declaredBodyKinds = response.declaredBodyKinds;
|
|
48
|
-
if (!kinds.has('status') ||
|
|
49
|
-
[...declaredBodyKinds].some((kind) => !kinds.has(kind)) ||
|
|
50
|
-
[...kinds].some((kind) => kind !== 'status' && !declaredBodyKinds.has(kind)) ||
|
|
51
|
-
[...emissions].some(([call, kind]) => kind !== 'status' && !statusDominatesEmission(call, statuses, allStatuses)))
|
|
52
|
-
throw new Error('HTTP response variants require dominating status and associated body emissions');
|
|
53
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { contextResponseMethod } from './protocol-http-context.mjs';
|
|
3
|
-
import { unwrapExpression } from './protocol-marker-analysis.mjs';
|
|
4
|
-
import { expressionReceiver } from './protocol-write-receiver.mjs';
|
|
5
|
-
import { executableProtocolPath } from './protocol-execution-path.mjs';
|
|
6
|
-
import { opaqueProtocolCallbackPath } from './protocol-opaque-callback.mjs';
|
|
7
|
-
/** Branded metadata requires the dispatched response's body and status to remain intact. */
|
|
8
|
-
export function mutatedHttpResponse(node, response, checker) {
|
|
9
|
-
const target = mutationTarget(node);
|
|
10
|
-
if (!target)
|
|
11
|
-
return false;
|
|
12
|
-
const receiver = expressionReceiver(target, checker);
|
|
13
|
-
const field = receiver?.root === response
|
|
14
|
-
? receiver.path[0]
|
|
15
|
-
: contextResponseMethod(unwrapExpression(target), response, checker, true);
|
|
16
|
-
return ((field === 'body' || field === 'status') &&
|
|
17
|
-
(executableProtocolPath(node, checker) || opaqueProtocolCallbackPath(node, checker)));
|
|
18
|
-
}
|
|
19
|
-
function mutationTarget(node) {
|
|
20
|
-
if (ts.isBinaryExpression(node) &&
|
|
21
|
-
node.operatorToken.kind >= ts.SyntaxKind.FirstAssignment &&
|
|
22
|
-
node.operatorToken.kind <= ts.SyntaxKind.LastAssignment)
|
|
23
|
-
return node.left;
|
|
24
|
-
if (ts.isDeleteExpression(node))
|
|
25
|
-
return node.expression;
|
|
26
|
-
if ((ts.isPrefixUnaryExpression(node) || ts.isPostfixUnaryExpression(node)) &&
|
|
27
|
-
(node.operator === ts.SyntaxKind.PlusPlusToken ||
|
|
28
|
-
node.operator === ts.SyntaxKind.MinusMinusToken))
|
|
29
|
-
return node.operand;
|
|
30
|
-
return undefined;
|
|
31
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
export declare function protocolMarker(expression: ts.Expression, checker: ts.TypeChecker): 'apiSseFrame' | 'apiOpenApiHttpResponse' | undefined;
|
|
3
|
-
export declare function propertyType(type: ts.Type, name: string, checker: ts.TypeChecker): ts.Type;
|
|
4
|
-
export declare function typeVariants(type: ts.Type): readonly ts.Type[];
|
|
5
|
-
export declare function stringLiterals(type: ts.Type): string[];
|
|
6
|
-
export declare function unwrapExpression(expression: ts.Expression): ts.Expression;
|
|
7
|
-
export declare function enclosingFunction(node: ts.Node): ts.FunctionLikeDeclaration | undefined;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
export function protocolMarker(expression, checker) {
|
|
3
|
-
const symbol = checker.getSymbolAtLocation(expression);
|
|
4
|
-
const resolved = symbol && (symbol.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(symbol) : symbol);
|
|
5
|
-
const name = resolved?.name;
|
|
6
|
-
return name === 'apiSseFrame' || name === 'apiOpenApiHttpResponse' ? name : undefined;
|
|
7
|
-
}
|
|
8
|
-
export function propertyType(type, name, checker) {
|
|
9
|
-
const property = checker.getPropertyOfType(type, name);
|
|
10
|
-
const declaration = property?.valueDeclaration ?? property?.declarations?.[0];
|
|
11
|
-
if (!property || !declaration)
|
|
12
|
-
throw new Error(`Protocol contract requires ${name}`);
|
|
13
|
-
return checker.getTypeOfSymbolAtLocation(property, declaration);
|
|
14
|
-
}
|
|
15
|
-
export function typeVariants(type) {
|
|
16
|
-
if (type.flags & (ts.TypeFlags.Any | ts.TypeFlags.Unknown | ts.TypeFlags.Never))
|
|
17
|
-
throw new Error('Protocol contract requires concrete variants');
|
|
18
|
-
return type.isUnion() ? type.types : [type];
|
|
19
|
-
}
|
|
20
|
-
export function stringLiterals(type) {
|
|
21
|
-
return typeVariants(type).map((variant) => {
|
|
22
|
-
if (!(variant.flags & ts.TypeFlags.StringLiteral))
|
|
23
|
-
throw new Error('Protocol contract requires literal names and media types');
|
|
24
|
-
const value = variant.value;
|
|
25
|
-
if (!value || /[\r\n]/.test(value))
|
|
26
|
-
throw new Error('Protocol contract requires nonempty single-line names');
|
|
27
|
-
return value;
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
export function unwrapExpression(expression) {
|
|
31
|
-
if (ts.isParenthesizedExpression(expression) ||
|
|
32
|
-
ts.isAsExpression(expression) ||
|
|
33
|
-
ts.isTypeAssertionExpression(expression) ||
|
|
34
|
-
ts.isNonNullExpression(expression) ||
|
|
35
|
-
ts.isAwaitExpression(expression))
|
|
36
|
-
return unwrapExpression(expression.expression);
|
|
37
|
-
return expression;
|
|
38
|
-
}
|
|
39
|
-
export function enclosingFunction(node) {
|
|
40
|
-
let current = node.parent;
|
|
41
|
-
while (current) {
|
|
42
|
-
if (ts.isArrowFunction(current) ||
|
|
43
|
-
ts.isFunctionExpression(current) ||
|
|
44
|
-
ts.isFunctionDeclaration(current) ||
|
|
45
|
-
ts.isMethodDeclaration(current))
|
|
46
|
-
return current;
|
|
47
|
-
current = current.parent;
|
|
48
|
-
}
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { callbackOptionsEscape } from './protocol-callback-mutations.mjs';
|
|
3
|
-
import { isSupportedProtocolCallback } from './protocol-callback-invocation.mjs';
|
|
4
|
-
import { potentiallyExecuted } from './protocol-executable-path.mjs';
|
|
5
|
-
import { enclosingFunction } from './protocol-marker-analysis.mjs';
|
|
6
|
-
import { callbackArgumentBindings } from './protocol-callback-argument-bindings.mjs';
|
|
7
|
-
import { createProtocolCallbackValueResolver, isProtocolCallbackFunction as functionNode, } from './protocol-callback-values.mjs';
|
|
8
|
-
function implementedFunction(node) {
|
|
9
|
-
return functionNode(node) && !!node.body;
|
|
10
|
-
}
|
|
11
|
-
/** Proves an executable lexical path containing at least one opaque callback escape. */
|
|
12
|
-
export function opaqueProtocolCallbackPath(node, checker) {
|
|
13
|
-
if (!potentiallyExecuted(node))
|
|
14
|
-
return false;
|
|
15
|
-
const functions = [];
|
|
16
|
-
for (let fn = enclosingFunction(node); fn; fn = enclosingFunction(fn))
|
|
17
|
-
functions.push(fn);
|
|
18
|
-
if (!functions.length ||
|
|
19
|
-
functions.some((fn) => !fn.body || fn.asteriskToken || !potentiallyExecuted(fn)))
|
|
20
|
-
return false;
|
|
21
|
-
let opaque = false;
|
|
22
|
-
for (const fn of functions) {
|
|
23
|
-
if (isSupportedProtocolCallback(fn, checker))
|
|
24
|
-
continue;
|
|
25
|
-
if (!escapesToOpaque(fn, checker))
|
|
26
|
-
return false;
|
|
27
|
-
opaque = true;
|
|
28
|
-
}
|
|
29
|
-
return opaque;
|
|
30
|
-
}
|
|
31
|
-
function escapesToOpaque(callback, checker) {
|
|
32
|
-
const resolver = createProtocolCallbackValueResolver(checker);
|
|
33
|
-
function opaque(call, env) {
|
|
34
|
-
const implementation = resolver.resolve(call.expression, env);
|
|
35
|
-
if (implementation && functionNode(implementation.node) && implementation.node.body)
|
|
36
|
-
return false;
|
|
37
|
-
const declaration = checker.getResolvedSignature(call)?.declaration;
|
|
38
|
-
return !declaration || !('body' in declaration && declaration.body);
|
|
39
|
-
}
|
|
40
|
-
function executableCallsite(call) {
|
|
41
|
-
const callbackAncestors = new Set();
|
|
42
|
-
for (let fn = enclosingFunction(callback); fn; fn = enclosingFunction(fn))
|
|
43
|
-
callbackAncestors.add(fn);
|
|
44
|
-
for (let fn = enclosingFunction(call); fn; fn = enclosingFunction(fn))
|
|
45
|
-
if (!fn.body ||
|
|
46
|
-
fn.asteriskToken ||
|
|
47
|
-
!potentiallyExecuted(fn) ||
|
|
48
|
-
(!callbackAncestors.has(fn) && !isSupportedProtocolCallback(fn, checker)))
|
|
49
|
-
return false;
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
function scanBody(fn, env, active) {
|
|
53
|
-
const chain = new Set([...active, fn]);
|
|
54
|
-
let escaped = false;
|
|
55
|
-
function visit(node) {
|
|
56
|
-
if (escaped || !potentiallyExecuted(node))
|
|
57
|
-
return;
|
|
58
|
-
if (ts.isFunctionLike(node))
|
|
59
|
-
return;
|
|
60
|
-
if (ts.isCallExpression(node) || ts.isNewExpression(node)) {
|
|
61
|
-
const forwards = callbackOptionsEscape(node, env, callback, resolver);
|
|
62
|
-
if (forwards && opaque(node, env)) {
|
|
63
|
-
escaped = true;
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const target = forwards ? resolver.resolve(node.expression, env) : undefined;
|
|
67
|
-
if (target &&
|
|
68
|
-
implementedFunction(target.node) &&
|
|
69
|
-
!target.node.asteriskToken &&
|
|
70
|
-
!chain.has(target.node)) {
|
|
71
|
-
const next = callbackArgumentBindings(target.node, node, env, target.env, checker, resolver);
|
|
72
|
-
if (!next || scanBody(target.node, next, chain))
|
|
73
|
-
escaped = true;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
ts.forEachChild(node, visit);
|
|
77
|
-
}
|
|
78
|
-
visit(fn.body);
|
|
79
|
-
return escaped;
|
|
80
|
-
}
|
|
81
|
-
function sourceCalls(source) {
|
|
82
|
-
let escaped = false;
|
|
83
|
-
function visit(node) {
|
|
84
|
-
if (escaped || !potentiallyExecuted(node))
|
|
85
|
-
return;
|
|
86
|
-
if (ts.isCallExpression(node) || ts.isNewExpression(node)) {
|
|
87
|
-
if (!executableCallsite(node))
|
|
88
|
-
return;
|
|
89
|
-
const forwards = callbackOptionsEscape(node, new Map(), callback, resolver);
|
|
90
|
-
if (forwards && opaque(node, new Map())) {
|
|
91
|
-
escaped = true;
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const target = forwards ? resolver.resolve(node.expression, new Map()) : undefined;
|
|
95
|
-
if (target && implementedFunction(target.node) && !target.node.asteriskToken) {
|
|
96
|
-
const next = callbackArgumentBindings(target.node, node, new Map(), target.env, checker, resolver);
|
|
97
|
-
if (!next || scanBody(target.node, next, new Set()))
|
|
98
|
-
escaped = true;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
ts.forEachChild(node, visit);
|
|
102
|
-
}
|
|
103
|
-
visit(source);
|
|
104
|
-
return escaped;
|
|
105
|
-
}
|
|
106
|
-
return sourceCalls(callback.getSourceFile());
|
|
107
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
/** Records the actual caller compiler's library identities, including another installation. */
|
|
3
|
-
export declare function registerPlatformCompilerLibraries(program: ts.Program): void;
|
|
4
|
-
/** Shares actual compiler-library identity with other standard API guards. */
|
|
5
|
-
export declare function standardCompilerDeclaration(declaration: ts.Declaration, checker: ts.TypeChecker): boolean;
|
|
6
|
-
/** Recognizes only callback APIs supplied by the compiler's standard libraries or Node typings. */
|
|
7
|
-
export declare function platformCallbackArgument(node: ts.CallExpression | ts.NewExpression, checker: ts.TypeChecker): ts.Expression | undefined;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { basename, dirname, resolve as resolvePath } from 'node:path';
|
|
2
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
3
|
-
import { unwrapExpression } from './protocol-marker-analysis.mjs';
|
|
4
|
-
import { writtenPlatformSymbols } from './protocol-platform-writes.mjs';
|
|
5
|
-
const standardLibrary = dirname(resolvePath(ts.getDefaultLibFilePath({})));
|
|
6
|
-
const platformWrites = new WeakMap();
|
|
7
|
-
const compilerLibraries = new WeakMap();
|
|
8
|
-
/** Records the actual caller compiler's library identities, including another installation. */
|
|
9
|
-
export function registerPlatformCompilerLibraries(program) {
|
|
10
|
-
const checker = program.getTypeChecker();
|
|
11
|
-
if (!compilerLibraries.has(checker)) {
|
|
12
|
-
const libraries = new Set(program.getSourceFiles().filter((file) => program.isSourceFileDefaultLibrary(file)));
|
|
13
|
-
compilerLibraries.set(checker, libraries);
|
|
14
|
-
platformWrites.set(checker, writtenPlatformSymbols(program.getSourceFiles(), checker, libraries));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function standardDeclaration(declaration, timer, checker) {
|
|
18
|
-
const source = declaration.getSourceFile();
|
|
19
|
-
if (!source.isDeclarationFile)
|
|
20
|
-
return false;
|
|
21
|
-
const file = resolvePath(source.fileName);
|
|
22
|
-
const libraries = compilerLibraries.get(checker);
|
|
23
|
-
if (libraries
|
|
24
|
-
? libraries.has(source)
|
|
25
|
-
: dirname(file) === standardLibrary && /^lib(?:\.[\w.-]+)?\.d\.ts$/.test(basename(file)))
|
|
26
|
-
return true;
|
|
27
|
-
return (timer &&
|
|
28
|
-
/\/node_modules\/@types\/node\/(?:web-globals\/)?timers\.d\.ts$/.test(file.replaceAll('\\', '/')));
|
|
29
|
-
}
|
|
30
|
-
/** Shares actual compiler-library identity with other standard API guards. */
|
|
31
|
-
export function standardCompilerDeclaration(declaration, checker) {
|
|
32
|
-
return standardDeclaration(declaration, false, checker);
|
|
33
|
-
}
|
|
34
|
-
function platformSymbol(expression, checker, seen = new Set()) {
|
|
35
|
-
const value = unwrapExpression(expression);
|
|
36
|
-
if (!ts.isIdentifier(value))
|
|
37
|
-
return undefined;
|
|
38
|
-
const symbol = checker.getSymbolAtLocation(value);
|
|
39
|
-
if (!symbol || seen.has(symbol))
|
|
40
|
-
return undefined;
|
|
41
|
-
seen.add(symbol);
|
|
42
|
-
if (symbol.flags & ts.SymbolFlags.Alias) {
|
|
43
|
-
const target = checker.getAliasedSymbol(symbol);
|
|
44
|
-
if (seen.has(target))
|
|
45
|
-
return undefined;
|
|
46
|
-
return target;
|
|
47
|
-
}
|
|
48
|
-
const declaration = symbol.valueDeclaration;
|
|
49
|
-
if (declaration &&
|
|
50
|
-
ts.isVariableDeclaration(declaration) &&
|
|
51
|
-
declaration.initializer &&
|
|
52
|
-
ts.isVariableDeclarationList(declaration.parent) &&
|
|
53
|
-
declaration.parent.flags & ts.NodeFlags.Const)
|
|
54
|
-
return platformSymbol(declaration.initializer, checker, seen);
|
|
55
|
-
return symbol;
|
|
56
|
-
}
|
|
57
|
-
/** Recognizes only callback APIs supplied by the compiler's standard libraries or Node typings. */
|
|
58
|
-
export function platformCallbackArgument(node, checker) {
|
|
59
|
-
if (ts.isCallExpression(node) && node.questionDotToken)
|
|
60
|
-
return undefined;
|
|
61
|
-
const argument = node.arguments?.[0];
|
|
62
|
-
if (!argument || ts.isSpreadElement(argument))
|
|
63
|
-
return undefined;
|
|
64
|
-
const symbol = platformSymbol(node.expression, checker);
|
|
65
|
-
if (!symbol?.declarations?.length)
|
|
66
|
-
return undefined;
|
|
67
|
-
const timer = symbol.name === 'setInterval' || symbol.name === 'setTimeout';
|
|
68
|
-
if (!(timer ? ts.isCallExpression(node) : symbol.name === 'Promise' && ts.isNewExpression(node)))
|
|
69
|
-
return undefined;
|
|
70
|
-
const writes = platformWrites.get(checker) ?? writtenPlatformSymbols([node.getSourceFile()], checker);
|
|
71
|
-
if (writes.has(symbol))
|
|
72
|
-
return undefined;
|
|
73
|
-
return symbol.declarations.every((declaration) => standardDeclaration(declaration, timer, checker))
|
|
74
|
-
? argument
|
|
75
|
-
: undefined;
|
|
76
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
export declare function literalStrings(expression: ts.Expression | undefined, checker: ts.TypeChecker): readonly string[] | undefined;
|
|
3
|
-
export declare function globalTarget(expression: ts.Expression, checker: ts.TypeChecker, seen?: Set<ts.Symbol>): ts.Expression | undefined;
|
|
4
|
-
export declare function mutatorKind(call: ts.CallExpression, checker: ts.TypeChecker, libraries: ReadonlySet<ts.SourceFile> | undefined): 'defineProperty' | 'set' | 'assign' | undefined;
|
|
5
|
-
export declare function sourceKeys(source: ts.Expression, checker: ts.TypeChecker): readonly string[] | undefined;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { basename, dirname, resolve as resolvePath } from 'node:path';
|
|
2
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
3
|
-
import { unwrapExpression } from './protocol-marker-analysis.mjs';
|
|
4
|
-
const standardLibrary = dirname(resolvePath(ts.getDefaultLibFilePath({})));
|
|
5
|
-
function isStandardDeclaration(declaration, libraries) {
|
|
6
|
-
const source = declaration.getSourceFile();
|
|
7
|
-
const file = resolvePath(source.fileName);
|
|
8
|
-
return libraries
|
|
9
|
-
? libraries.has(source)
|
|
10
|
-
: source.isDeclarationFile &&
|
|
11
|
-
dirname(file) === standardLibrary &&
|
|
12
|
-
/^lib(?:\.[\w.-]+)?\.d\.ts$/.test(basename(file));
|
|
13
|
-
}
|
|
14
|
-
export function literalStrings(expression, checker) {
|
|
15
|
-
if (!expression)
|
|
16
|
-
return undefined;
|
|
17
|
-
const strings = new Set();
|
|
18
|
-
function visit(type) {
|
|
19
|
-
if (type.isUnion())
|
|
20
|
-
return type.types.every(visit);
|
|
21
|
-
if (type.flags & ts.TypeFlags.StringLiteral) {
|
|
22
|
-
strings.add(type.value);
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
if (type.flags &
|
|
26
|
-
(ts.TypeFlags.String | ts.TypeFlags.Any | ts.TypeFlags.Unknown | ts.TypeFlags.TypeParameter))
|
|
27
|
-
return false;
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
return visit(checker.getTypeAtLocation(expression)) ? [...strings] : undefined;
|
|
31
|
-
}
|
|
32
|
-
export function globalTarget(expression, checker, seen = new Set()) {
|
|
33
|
-
const value = unwrapExpression(expression);
|
|
34
|
-
if (!ts.isIdentifier(value))
|
|
35
|
-
return undefined;
|
|
36
|
-
const symbol = checker.getSymbolAtLocation(value);
|
|
37
|
-
if (!symbol || seen.has(symbol))
|
|
38
|
-
return undefined;
|
|
39
|
-
seen.add(symbol);
|
|
40
|
-
if (value.text === 'globalThis')
|
|
41
|
-
return symbol.declarations?.length ? undefined : value;
|
|
42
|
-
if (symbol.name === 'global' &&
|
|
43
|
-
symbol.declarations?.some((declaration) => {
|
|
44
|
-
const source = declaration.getSourceFile();
|
|
45
|
-
return (ts.isVariableDeclaration(declaration) &&
|
|
46
|
-
source.isDeclarationFile &&
|
|
47
|
-
resolvePath(source.fileName)
|
|
48
|
-
.replaceAll('\\', '/')
|
|
49
|
-
.endsWith('/node_modules/@types/node/globals.d.ts'));
|
|
50
|
-
}))
|
|
51
|
-
return value;
|
|
52
|
-
const declaration = symbol.valueDeclaration;
|
|
53
|
-
return declaration && ts.isVariableDeclaration(declaration) && declaration.initializer
|
|
54
|
-
? globalTarget(declaration.initializer, checker, seen)
|
|
55
|
-
: undefined;
|
|
56
|
-
}
|
|
57
|
-
export function mutatorKind(call, checker, libraries) {
|
|
58
|
-
const callee = call.expression;
|
|
59
|
-
if (!ts.isPropertyAccessExpression(callee) || !ts.isIdentifier(callee.expression))
|
|
60
|
-
return undefined;
|
|
61
|
-
const owner = callee.expression.text;
|
|
62
|
-
const method = callee.name.text;
|
|
63
|
-
if (!((owner === 'Object' && ['defineProperty', 'assign'].includes(method)) ||
|
|
64
|
-
(owner === 'Reflect' && method === 'set')))
|
|
65
|
-
return undefined;
|
|
66
|
-
const ownerSymbol = checker.getSymbolAtLocation(callee.expression);
|
|
67
|
-
const methodSymbol = checker.getSymbolAtLocation(callee.name);
|
|
68
|
-
if (!ownerSymbol?.declarations?.length ||
|
|
69
|
-
!methodSymbol?.declarations?.length ||
|
|
70
|
-
!ownerSymbol.declarations.every((declaration) => isStandardDeclaration(declaration, libraries)) ||
|
|
71
|
-
!methodSymbol.declarations.every((declaration) => isStandardDeclaration(declaration, libraries)))
|
|
72
|
-
return undefined;
|
|
73
|
-
return method;
|
|
74
|
-
}
|
|
75
|
-
export function sourceKeys(source, checker) {
|
|
76
|
-
const keys = new Set();
|
|
77
|
-
function visit(type) {
|
|
78
|
-
if (type.flags & (ts.TypeFlags.Any | ts.TypeFlags.Unknown | ts.TypeFlags.TypeParameter))
|
|
79
|
-
return false;
|
|
80
|
-
if (type.isUnion())
|
|
81
|
-
return type.types.every(visit);
|
|
82
|
-
if (type.getStringIndexType())
|
|
83
|
-
return false;
|
|
84
|
-
for (const property of type.getProperties())
|
|
85
|
-
keys.add(property.name);
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
88
|
-
return visit(checker.getTypeAtLocation(unwrapExpression(source))) ? [...keys] : undefined;
|
|
89
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
/** Records global timer and Promise writes, including calls to standard property mutators. */
|
|
3
|
-
export declare function writtenPlatformSymbols(files: readonly ts.SourceFile[], checker: ts.TypeChecker, libraries?: ReadonlySet<ts.SourceFile>): Set<ts.Symbol>;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { unwrapExpression } from './protocol-marker-analysis.mjs';
|
|
3
|
-
import { globalTarget, literalStrings, mutatorKind, sourceKeys, } from './protocol-platform-mutation-targets.mjs';
|
|
4
|
-
const platformNames = ['setTimeout', 'setInterval', 'Promise'];
|
|
5
|
-
/** Records global timer and Promise writes, including calls to standard property mutators. */
|
|
6
|
-
export function writtenPlatformSymbols(files, checker, libraries) {
|
|
7
|
-
const written = new Set();
|
|
8
|
-
function mark(target, keys) {
|
|
9
|
-
const root = globalTarget(target, checker);
|
|
10
|
-
if (!root)
|
|
11
|
-
return;
|
|
12
|
-
const members = keys
|
|
13
|
-
? keys.map((key) => checker.getPropertyOfType(checker.getTypeAtLocation(root), key))
|
|
14
|
-
: platformNames.map((name) => checker.getPropertyOfType(checker.getTypeAtLocation(root), name));
|
|
15
|
-
for (const member of members)
|
|
16
|
-
if (member && platformNames.includes(member.name))
|
|
17
|
-
written.add(member);
|
|
18
|
-
}
|
|
19
|
-
function target(node) {
|
|
20
|
-
if (ts.isElementAccessExpression(node)) {
|
|
21
|
-
const keys = literalStrings(node.argumentExpression, checker);
|
|
22
|
-
mark(node.expression, keys);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (ts.isPropertyAccessExpression(node)) {
|
|
26
|
-
const symbol = checker.getSymbolAtLocation(node.name);
|
|
27
|
-
if (globalTarget(node.expression, checker) && symbol && platformNames.includes(symbol.name))
|
|
28
|
-
written.add(symbol);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const symbol = checker.getSymbolAtLocation(node);
|
|
32
|
-
if (symbol && platformNames.includes(symbol.name))
|
|
33
|
-
written.add(symbol);
|
|
34
|
-
if (ts.isObjectLiteralExpression(node) ||
|
|
35
|
-
ts.isArrayLiteralExpression(node) ||
|
|
36
|
-
ts.isPropertyAssignment(node) ||
|
|
37
|
-
ts.isSpreadAssignment(node) ||
|
|
38
|
-
ts.isSpreadElement(node))
|
|
39
|
-
ts.forEachChild(node, target);
|
|
40
|
-
}
|
|
41
|
-
function visit(node) {
|
|
42
|
-
if (ts.isBinaryExpression(node) &&
|
|
43
|
-
node.operatorToken.kind >= ts.SyntaxKind.FirstAssignment &&
|
|
44
|
-
node.operatorToken.kind <= ts.SyntaxKind.LastAssignment)
|
|
45
|
-
target(node.left);
|
|
46
|
-
if (ts.isDeleteExpression(node))
|
|
47
|
-
target(node.expression);
|
|
48
|
-
if (ts.isCallExpression(node)) {
|
|
49
|
-
const kind = mutatorKind(node, checker, libraries);
|
|
50
|
-
if (kind && node.arguments[0] && ts.isSpreadElement(node.arguments[0]))
|
|
51
|
-
for (const file of files)
|
|
52
|
-
for (const binding of checker.getSymbolsInScope(file, ts.SymbolFlags.Value | ts.SymbolFlags.Alias)) {
|
|
53
|
-
const symbol = binding.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(binding) : binding;
|
|
54
|
-
if (platformNames.includes(symbol.name))
|
|
55
|
-
written.add(symbol);
|
|
56
|
-
}
|
|
57
|
-
if (kind === 'defineProperty' || kind === 'set') {
|
|
58
|
-
const receiver = node.arguments[0];
|
|
59
|
-
if (receiver && !ts.isSpreadElement(receiver))
|
|
60
|
-
mark(receiver, literalStrings(node.arguments[1] && !ts.isSpreadElement(node.arguments[1])
|
|
61
|
-
? node.arguments[1]
|
|
62
|
-
: undefined, checker));
|
|
63
|
-
}
|
|
64
|
-
else if (kind === 'assign') {
|
|
65
|
-
const receiver = node.arguments[0];
|
|
66
|
-
if (receiver && !ts.isSpreadElement(receiver) && globalTarget(receiver, checker)) {
|
|
67
|
-
for (const source of node.arguments.slice(1)) {
|
|
68
|
-
if (ts.isSpreadElement(source)) {
|
|
69
|
-
const values = unwrapExpression(source.expression);
|
|
70
|
-
if (ts.isArrayLiteralExpression(values)) {
|
|
71
|
-
for (const value of values.elements)
|
|
72
|
-
if (ts.isSpreadElement(value))
|
|
73
|
-
mark(receiver, undefined);
|
|
74
|
-
else
|
|
75
|
-
mark(receiver, sourceKeys(value, checker));
|
|
76
|
-
}
|
|
77
|
-
else
|
|
78
|
-
mark(receiver, undefined);
|
|
79
|
-
}
|
|
80
|
-
else
|
|
81
|
-
mark(receiver, sourceKeys(source, checker));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
ts.forEachChild(node, visit);
|
|
87
|
-
}
|
|
88
|
-
for (const file of files)
|
|
89
|
-
if (!file.isDeclarationFile)
|
|
90
|
-
visit(file);
|
|
91
|
-
return written;
|
|
92
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { RouteBinding } from './response-contract-route-analysis.mts';
|
|
2
|
-
/** Whether requested protocol keys include a route binding, independent of its protocol variants. */
|
|
3
|
-
export declare function protocolBindingRequested(binding: RouteBinding, requestedKeys?: ReadonlySet<string>): boolean;
|
|
4
|
-
/** Maps one generated protocol key to its requested route spelling and exact variant suffix. */
|
|
5
|
-
export declare function requestedProtocolKey(key: string, binding: RouteBinding, requestedKeys?: ReadonlySet<string>): string | undefined;
|