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,19 +0,0 @@
|
|
|
1
|
-
export type HeaderContract = {
|
|
2
|
-
requestHeaders: Readonly<Record<string, HeaderDescriptor>>;
|
|
3
|
-
responseHeaders: Readonly<Record<number, ResponseHeaderDescriptor>>;
|
|
4
|
-
};
|
|
5
|
-
export type HeaderDescriptor = {
|
|
6
|
-
description?: string;
|
|
7
|
-
format?: 'uuid';
|
|
8
|
-
required: boolean;
|
|
9
|
-
type: 'integer' | 'string';
|
|
10
|
-
};
|
|
11
|
-
export type ResponseHeaderDescriptor = {
|
|
12
|
-
description?: string;
|
|
13
|
-
errors?: readonly {
|
|
14
|
-
code: string;
|
|
15
|
-
message: string;
|
|
16
|
-
}[];
|
|
17
|
-
headers: Readonly<Record<string, HeaderDescriptor>>;
|
|
18
|
-
};
|
|
19
|
-
export type HeaderContractRegistry = Readonly<Record<string, HeaderContract>>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
import type { DiscoverApiResponseContractsOptions } from './response-contract-lenient.mts';
|
|
3
|
-
export declare const APP_ROUTE_CTX_ADAPTER_VERSION: 1;
|
|
4
|
-
export type AppRouteCtxDiscoveryInput = {
|
|
5
|
-
program: ts.Program;
|
|
6
|
-
sourceFiles: readonly ts.SourceFile[];
|
|
7
|
-
requestedKeys?: ReadonlySet<string>;
|
|
8
|
-
options?: DiscoverApiResponseContractsOptions;
|
|
9
|
-
};
|
|
10
|
-
/** Discovers the version-one `app.route(...).method(handler)` and `ctx` convention. */
|
|
11
|
-
export declare function discoverAppRouteCtxContractsV1(input: AppRouteCtxDiscoveryInput): {
|
|
12
|
-
adapterVersion: 1;
|
|
13
|
-
routes: import("./registered-route-catalog.mts").RegisteredRoute[];
|
|
14
|
-
responses: Record<string, import("./response-contract-types.mts").BackendResponseContract>;
|
|
15
|
-
requests: Record<string, import("./request-contract-types.mts").BackendRequestContract>;
|
|
16
|
-
queries: Readonly<Record<string, import("./query-contract-types.mts").BackendQueryContract>>;
|
|
17
|
-
headers: Readonly<Record<string, import("./header-contract-types.mts").HeaderContract>>;
|
|
18
|
-
};
|
|
19
|
-
export { discoverApiResponseContracts } from './response-contract-registry.mts';
|
|
20
|
-
export { discoverApiRequestContracts } from './request-contract-registry.mts';
|
|
21
|
-
export { discoverApiQueryContracts } from './query-contract-registry.mts';
|
|
22
|
-
export { discoverApiHeaderContracts } from './header-contract-registry.mts';
|
|
23
|
-
export { discoverRegisteredRoutes, routeShape } from './registered-route-catalog.mts';
|
|
24
|
-
export { responseStatusCodesForContract } from './response-contract-status.mts';
|
|
25
|
-
export type { BackendResponseContract } from './response-contract-types.mts';
|
|
26
|
-
export type { BackendRequestContract } from './request-contract-types.mts';
|
|
27
|
-
export type { BackendQueryContract, BackendQueryContractRegistry } from './query-contract-types.mts';
|
|
28
|
-
export type { HeaderContract, HeaderContractRegistry } from './header-contract-types.mts';
|
|
29
|
-
export type { RegisteredRoute } from './registered-route-catalog.mts';
|
|
30
|
-
export type { AmbiguousAttributionFact, RouteDiscoveryError, DiscoverApiResponseContractsOptions, } from './response-contract-lenient.mts';
|
|
31
|
-
export type { DiscoverApiRequestContractsOptions } from './request-contract-lenient.mts';
|
|
32
|
-
export { discoverRequestValidationFacts } from './request-validation-facts.mts';
|
|
33
|
-
export type { RequestValidationFactsInput } from './request-validation-facts.mts';
|
|
34
|
-
export type { Carrier, CarrierRead, ExecutedCallbackConfig, FactoryConfig, FactorySite, RouteValidationFacts, ValidatorConfig, ValidatorSite, ValidatorSiteCarrier, } from './request-validation-types.mts';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { discoverApiHeaderContracts } from './header-contract-registry.mjs';
|
|
2
|
-
import { discoverApiQueryContracts } from './query-contract-registry.mjs';
|
|
3
|
-
import { discoverRegisteredRoutes } from './registered-route-catalog.mjs';
|
|
4
|
-
import { discoverApiRequestContracts } from './request-contract-registry.mjs';
|
|
5
|
-
import { discoverApiResponseContracts } from './response-contract-registry.mjs';
|
|
6
|
-
export const APP_ROUTE_CTX_ADAPTER_VERSION = 1;
|
|
7
|
-
/** Discovers the version-one `app.route(...).method(handler)` and `ctx` convention. */
|
|
8
|
-
export function discoverAppRouteCtxContractsV1(input) {
|
|
9
|
-
const { program, sourceFiles, requestedKeys, options } = input;
|
|
10
|
-
const responses = discoverApiResponseContracts(program, sourceFiles, requestedKeys, options);
|
|
11
|
-
const knownResponseRoutes = new Set(Object.keys(responses));
|
|
12
|
-
return {
|
|
13
|
-
adapterVersion: APP_ROUTE_CTX_ADAPTER_VERSION,
|
|
14
|
-
routes: discoverRegisteredRoutes(program, sourceFiles),
|
|
15
|
-
responses,
|
|
16
|
-
requests: discoverApiRequestContracts(program, sourceFiles, requestedKeys, options),
|
|
17
|
-
queries: discoverApiQueryContracts(program, sourceFiles, knownResponseRoutes),
|
|
18
|
-
headers: discoverApiHeaderContracts(program, sourceFiles, knownResponseRoutes),
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export { discoverApiResponseContracts } from './response-contract-registry.mjs';
|
|
22
|
-
export { discoverApiRequestContracts } from './request-contract-registry.mjs';
|
|
23
|
-
export { discoverApiQueryContracts } from './query-contract-registry.mjs';
|
|
24
|
-
export { discoverApiHeaderContracts } from './header-contract-registry.mjs';
|
|
25
|
-
export { discoverRegisteredRoutes, routeShape } from './registered-route-catalog.mjs';
|
|
26
|
-
export { responseStatusCodesForContract } from './response-contract-status.mjs';
|
|
27
|
-
export { discoverRequestValidationFacts } from './request-validation-facts.mjs';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
export type Assignment = {
|
|
3
|
-
node: ts.BinaryExpression;
|
|
4
|
-
direct: boolean;
|
|
5
|
-
start: number;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Memoized protocol-proof results for one analysis run. Nodes are immutable, so every entry stays
|
|
9
|
-
* valid for the run; callers create one per run and drop it afterwards.
|
|
10
|
-
*/
|
|
11
|
-
export type ProtocolCache = {
|
|
12
|
-
/** Plain assignments per owning function (or source file), grouped by the symbol they write. */
|
|
13
|
-
assignments: Map<ts.Node, Map<ts.Symbol, Assignment[]>>;
|
|
14
|
-
/** Symbols written (assigned, updated, or looped over) anywhere in a source file. */
|
|
15
|
-
writtenSymbols: Map<ts.SourceFile, Set<ts.Symbol | undefined>>;
|
|
16
|
-
/** Whether a function is a supported protocol callback. */
|
|
17
|
-
supported: Map<ts.Node, boolean>;
|
|
18
|
-
/** Executable call expressions of a source file. */
|
|
19
|
-
calls: Map<ts.SourceFile, ts.CallExpression[]>;
|
|
20
|
-
};
|
|
21
|
-
export declare const createProtocolCache: () => ProtocolCache;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
import type { CallbackBindings, createProtocolCallbackValueResolver } from './protocol-callback-values.mts';
|
|
3
|
-
/** Binds literal callback parameters, declining unsupported destructuring shapes. */
|
|
4
|
-
export declare function callbackArgumentBindings(fn: ts.FunctionLikeDeclaration, call: ts.CallExpression | ts.NewExpression, env: CallbackBindings, captured: CallbackBindings, checker: ts.TypeChecker, resolver: ReturnType<typeof createProtocolCallbackValueResolver>): Map<ts.Symbol, {
|
|
5
|
-
node: ts.Node;
|
|
6
|
-
env: CallbackBindings;
|
|
7
|
-
}> | undefined;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { runtimeParameters } from './registered-route-runtime-parameters.mjs';
|
|
3
|
-
/** Binds literal callback parameters, declining unsupported destructuring shapes. */
|
|
4
|
-
export function callbackArgumentBindings(fn, call, env, captured, checker, resolver) {
|
|
5
|
-
const next = new Map(captured);
|
|
6
|
-
for (const [index, parameter] of runtimeParameters(fn).entries()) {
|
|
7
|
-
const argument = call.arguments?.[index];
|
|
8
|
-
if (!argument)
|
|
9
|
-
continue;
|
|
10
|
-
if (ts.isSpreadElement(argument))
|
|
11
|
-
return undefined;
|
|
12
|
-
if (ts.isIdentifier(parameter.name)) {
|
|
13
|
-
next.set(checker.getSymbolAtLocation(parameter.name), { node: argument, env });
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
if (!ts.isObjectBindingPattern(parameter.name))
|
|
17
|
-
return undefined;
|
|
18
|
-
const value = resolver.resolve(argument, env);
|
|
19
|
-
for (const element of parameter.name.elements) {
|
|
20
|
-
const key = element.propertyName ?? element.name;
|
|
21
|
-
if (!ts.isIdentifier(element.name) ||
|
|
22
|
-
element.dotDotDotToken ||
|
|
23
|
-
element.initializer ||
|
|
24
|
-
!(ts.isIdentifier(key) || ts.isStringLiteral(key)))
|
|
25
|
-
return undefined;
|
|
26
|
-
const bound = resolver.property(value, key.text, new Set());
|
|
27
|
-
if (bound)
|
|
28
|
-
next.set(checker.getSymbolAtLocation(element.name), bound);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return next;
|
|
33
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
import type { ProtocolCache } from './protocol-analysis-cache.mts';
|
|
3
|
-
type FunctionNode = ts.FunctionLikeDeclaration;
|
|
4
|
-
/** Proves callback consumption through concrete helper bodies, without executing nested closures. */
|
|
5
|
-
export declare function isSupportedProtocolCallback(fn: FunctionNode, checker: ts.TypeChecker, cache?: ProtocolCache): boolean;
|
|
6
|
-
export {};
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { runtimeParameters } from './registered-route-runtime-parameters.mjs';
|
|
3
|
-
import { invokedResult, registeredHandler } from './protocol-callback-registration.mjs';
|
|
4
|
-
import { platformCallbackArgument } from './protocol-platform-callbacks.mjs';
|
|
5
|
-
import { potentiallyExecuted } from './protocol-executable-path.mjs';
|
|
6
|
-
import { callbackBindingReplaced, callbackOptionsEscape } from './protocol-callback-mutations.mjs';
|
|
7
|
-
import { enclosingFunction } from './protocol-marker-analysis.mjs';
|
|
8
|
-
import { createProtocolCallbackValueResolver, isProtocolCallbackFunction as functionNode, protocolCallbackSourceCalls, protocolCallbackHasWrittenBindings, } from './protocol-callback-values.mjs';
|
|
9
|
-
/** Proves callback consumption through concrete helper bodies, without executing nested closures. */
|
|
10
|
-
export function isSupportedProtocolCallback(fn, checker, cache) {
|
|
11
|
-
const known = cache?.supported.get(fn);
|
|
12
|
-
if (known !== undefined)
|
|
13
|
-
return known;
|
|
14
|
-
const supported = proveProtocolCallback(fn, checker, cache);
|
|
15
|
-
cache?.supported.set(fn, supported);
|
|
16
|
-
return supported;
|
|
17
|
-
}
|
|
18
|
-
function proveProtocolCallback(fn, checker, cache) {
|
|
19
|
-
if (!fn.body || fn.asteriskToken || protocolCallbackHasWrittenBindings(fn, checker, cache))
|
|
20
|
-
return false;
|
|
21
|
-
const resolver = createProtocolCallbackValueResolver(checker);
|
|
22
|
-
const { resolve, symbol } = resolver;
|
|
23
|
-
let invalidated = false;
|
|
24
|
-
function consumed(call, env, active, returned = false) {
|
|
25
|
-
const platform = platformCallbackArgument(call, checker);
|
|
26
|
-
const callee = resolve(platform ?? call.expression, env);
|
|
27
|
-
if (!callee || !functionNode(callee.node) || !callee.node.body || callee.node.asteriskToken) {
|
|
28
|
-
invalidated ||= callbackOptionsEscape(call, env, fn, resolver);
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
if (protocolCallbackHasWrittenBindings(callee.node, checker, cache)) {
|
|
32
|
-
invalidated = true;
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
if (callee.node === fn)
|
|
36
|
-
return !returned;
|
|
37
|
-
if (active.has(callee.node))
|
|
38
|
-
return false;
|
|
39
|
-
const chain = new Set([...active, callee.node]);
|
|
40
|
-
if (platform)
|
|
41
|
-
return body(callee.node.body, callee.env, chain, false);
|
|
42
|
-
const next = new Map(callee.env);
|
|
43
|
-
runtimeParameters(callee.node).forEach((parameter, index) => {
|
|
44
|
-
const argument = call.arguments[index];
|
|
45
|
-
const target = symbol(parameter.name);
|
|
46
|
-
if (argument && !ts.isSpreadElement(argument))
|
|
47
|
-
next.set(target, { node: argument, env });
|
|
48
|
-
});
|
|
49
|
-
return body(callee.node.body, next, chain, returned || invokedResult(call));
|
|
50
|
-
}
|
|
51
|
-
function body(content, env, active, returned) {
|
|
52
|
-
let found = false;
|
|
53
|
-
let replaced = false;
|
|
54
|
-
function visit(node) {
|
|
55
|
-
if (found || replaced || !potentiallyExecuted(node))
|
|
56
|
-
return;
|
|
57
|
-
if (functionNode(node))
|
|
58
|
-
return;
|
|
59
|
-
if (callbackBindingReplaced(node, env, fn, resolver)) {
|
|
60
|
-
replaced = true;
|
|
61
|
-
invalidated = true;
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
if ((ts.isCallExpression(node) || ts.isNewExpression(node)) &&
|
|
65
|
-
consumed(node, env, active, returned && ts.isReturnStatement(node.parent)) &&
|
|
66
|
-
(!returned || ts.isReturnStatement(node.parent))) {
|
|
67
|
-
found = true;
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (returned && ts.isReturnStatement(node) && node.expression) {
|
|
71
|
-
const value = resolve(node.expression, env);
|
|
72
|
-
if (value &&
|
|
73
|
-
functionNode(value.node) &&
|
|
74
|
-
value.node.body &&
|
|
75
|
-
!value.node.asteriskToken &&
|
|
76
|
-
!active.has(value.node) &&
|
|
77
|
-
body(value.node.body, value.env, new Set([...active, value.node]), false)) {
|
|
78
|
-
found = true;
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
ts.forEachChild(node, visit);
|
|
83
|
-
}
|
|
84
|
-
visit(content);
|
|
85
|
-
return found && !invalidated;
|
|
86
|
-
}
|
|
87
|
-
let argument = fn;
|
|
88
|
-
while (ts.isPropertyAssignment(argument.parent) ||
|
|
89
|
-
ts.isObjectLiteralExpression(argument.parent) ||
|
|
90
|
-
ts.isParenthesizedExpression(argument.parent) ||
|
|
91
|
-
ts.isAsExpression(argument.parent) ||
|
|
92
|
-
ts.isNonNullExpression(argument.parent))
|
|
93
|
-
argument = argument.parent;
|
|
94
|
-
const call = argument.parent;
|
|
95
|
-
if (!ts.isCallExpression(call) && !ts.isNewExpression(call)) {
|
|
96
|
-
const owner = enclosingFunction(fn);
|
|
97
|
-
if (owner && isSupportedProtocolCallback(owner, checker, cache))
|
|
98
|
-
return body(owner.body, new Map(), new Set([owner]), false);
|
|
99
|
-
return protocolCallbackSourceCalls(fn).some((candidate) => potentiallyExecuted(candidate) &&
|
|
100
|
-
((registeredHandler(candidate) &&
|
|
101
|
-
candidate.arguments.some((value) => resolve(value, new Map())?.node === fn)) ||
|
|
102
|
-
consumed(candidate, new Map(), new Set())));
|
|
103
|
-
}
|
|
104
|
-
if (!potentiallyExecuted(call))
|
|
105
|
-
return false;
|
|
106
|
-
if (ts.isCallExpression(call) && call.expression === argument)
|
|
107
|
-
return true;
|
|
108
|
-
if (argument === fn && ts.isCallExpression(call) && registeredHandler(call))
|
|
109
|
-
return true;
|
|
110
|
-
return (!!call.arguments?.includes(argument) && consumed(call, new Map(), new Set()));
|
|
111
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
import type { CallbackBindings, createProtocolCallbackValueResolver } from './protocol-callback-values.mts';
|
|
3
|
-
export declare function callbackBindingReplaced(node: ts.Node, env: CallbackBindings, fn: ts.FunctionLikeDeclaration, resolver: ReturnType<typeof createProtocolCallbackValueResolver>): boolean;
|
|
4
|
-
/** An opaque callee may replace a callback stored in a forwarded options object. */
|
|
5
|
-
export declare function callbackOptionsEscape(node: ts.CallExpression | ts.NewExpression, env: CallbackBindings, fn: ts.FunctionLikeDeclaration, resolver: ReturnType<typeof createProtocolCallbackValueResolver>): boolean;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { unwrapExpression } from './protocol-marker-analysis.mjs';
|
|
3
|
-
export function callbackBindingReplaced(node, env, fn, resolver) {
|
|
4
|
-
const { resolve, symbol } = resolver;
|
|
5
|
-
const write = ts.isDeleteExpression(node)
|
|
6
|
-
? node.expression
|
|
7
|
-
: ts.isBinaryExpression(node) &&
|
|
8
|
-
node.operatorToken.kind >= ts.SyntaxKind.FirstAssignment &&
|
|
9
|
-
node.operatorToken.kind <= ts.SyntaxKind.LastAssignment
|
|
10
|
-
? node.left
|
|
11
|
-
: undefined;
|
|
12
|
-
if (!write)
|
|
13
|
-
return false;
|
|
14
|
-
let root = unwrapExpression(write);
|
|
15
|
-
while (ts.isPropertyAccessExpression(root) || ts.isElementAccessExpression(root))
|
|
16
|
-
root = unwrapExpression(root.expression);
|
|
17
|
-
return (ts.isIdentifier(root) && env.has(symbol(root))) || resolve(write, env)?.node === fn;
|
|
18
|
-
}
|
|
19
|
-
/** An opaque callee may replace a callback stored in a forwarded options object. */
|
|
20
|
-
export function callbackOptionsEscape(node, env, fn, resolver) {
|
|
21
|
-
function contains(value, bindings, seen = new Set()) {
|
|
22
|
-
const resolved = resolver.resolve(value, bindings);
|
|
23
|
-
if (!resolved || seen.has(resolved.node))
|
|
24
|
-
return false;
|
|
25
|
-
seen.add(resolved.node);
|
|
26
|
-
if (resolved.node === fn)
|
|
27
|
-
return true;
|
|
28
|
-
if (ts.isArrayLiteralExpression(resolved.node))
|
|
29
|
-
return resolved.node.elements.some((element) => contains(ts.isSpreadElement(element) ? element.expression : element, resolved.env, seen));
|
|
30
|
-
if (!ts.isObjectLiteralExpression(resolved.node))
|
|
31
|
-
return false;
|
|
32
|
-
return resolved.node.properties.some((member) => member === fn ||
|
|
33
|
-
(ts.isPropertyAssignment(member)
|
|
34
|
-
? contains(member.initializer, resolved.env, seen)
|
|
35
|
-
: ts.isShorthandPropertyAssignment(member) &&
|
|
36
|
-
(() => {
|
|
37
|
-
const target = resolver.property(resolved, member.name.text, new Set());
|
|
38
|
-
return !!target && contains(target.node, target.env, seen);
|
|
39
|
-
})()));
|
|
40
|
-
}
|
|
41
|
-
return !!node.arguments?.some((argument) => contains(argument, env));
|
|
42
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { unwrapExpression } from './protocol-marker-analysis.mjs';
|
|
3
|
-
export function registeredHandler(call) {
|
|
4
|
-
const method = unwrapExpression(call.expression);
|
|
5
|
-
if (!ts.isPropertyAccessExpression(method) ||
|
|
6
|
-
!['get', 'post', 'put', 'patch', 'delete', 'head', 'options'].includes(method.name.text))
|
|
7
|
-
return false;
|
|
8
|
-
let receiver = method.expression;
|
|
9
|
-
while (ts.isCallExpression(receiver) && ts.isPropertyAccessExpression(receiver.expression)) {
|
|
10
|
-
if (receiver.expression.name.text === 'route')
|
|
11
|
-
return true;
|
|
12
|
-
receiver = receiver.expression.expression;
|
|
13
|
-
}
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
export function invokedResult(call) {
|
|
17
|
-
let node = call;
|
|
18
|
-
while (ts.isParenthesizedExpression(node.parent) ||
|
|
19
|
-
ts.isAsExpression(node.parent) ||
|
|
20
|
-
ts.isNonNullExpression(node.parent) ||
|
|
21
|
-
ts.isAwaitExpression(node.parent))
|
|
22
|
-
node = node.parent;
|
|
23
|
-
const parent = node.parent;
|
|
24
|
-
return (ts.isCallExpression(parent) &&
|
|
25
|
-
(parent.expression === node ||
|
|
26
|
-
(registeredHandler(parent) && parent.arguments.includes(node))));
|
|
27
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
import type { ProtocolCache } from './protocol-analysis-cache.mts';
|
|
3
|
-
type FunctionNode = ts.FunctionLikeDeclaration;
|
|
4
|
-
export type CallbackValue = {
|
|
5
|
-
node: ts.Node;
|
|
6
|
-
env: CallbackBindings;
|
|
7
|
-
};
|
|
8
|
-
export type CallbackBindings = ReadonlyMap<ts.Symbol, CallbackValue>;
|
|
9
|
-
export declare function isProtocolCallbackFunction(node: ts.Node): node is FunctionNode;
|
|
10
|
-
/** Resolves stable named uses in outer statements and directly registered inline handlers. */
|
|
11
|
-
export declare function protocolCallbackSourceCalls(fn: FunctionNode): ts.CallExpression[];
|
|
12
|
-
export declare function createProtocolCallbackValueResolver(checker: ts.TypeChecker): {
|
|
13
|
-
resolve: (node: ts.Node, env: CallbackBindings, seen?: Set<ts.Node>) => CallbackValue | undefined;
|
|
14
|
-
symbol: (node: ts.Node) => ts.Symbol | undefined;
|
|
15
|
-
property: (value: CallbackValue | undefined, name: string, seen: Set<ts.Node>) => CallbackValue | undefined;
|
|
16
|
-
};
|
|
17
|
-
export declare function protocolCallbackHasWrittenBindings(fn: FunctionNode, checker: ts.TypeChecker, cache?: ProtocolCache): boolean;
|
|
18
|
-
export {};
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { registeredHandler } from './protocol-callback-registration.mjs';
|
|
3
|
-
import { runtimeParameters } from './registered-route-runtime-parameters.mjs';
|
|
4
|
-
import { hasBindingWrite } from './registered-route-binding-writes.mjs';
|
|
5
|
-
import { unwrapExpression } from './protocol-marker-analysis.mjs';
|
|
6
|
-
export function isProtocolCallbackFunction(node) {
|
|
7
|
-
return ts.isFunctionLike(node) && 'body' in node;
|
|
8
|
-
}
|
|
9
|
-
/** Resolves stable named uses in outer statements and directly registered inline handlers. */
|
|
10
|
-
export function protocolCallbackSourceCalls(fn) {
|
|
11
|
-
const declaration = fn.parent;
|
|
12
|
-
if (!ts.isFunctionDeclaration(fn) &&
|
|
13
|
-
(!ts.isVariableDeclaration(declaration) ||
|
|
14
|
-
!ts.isIdentifier(declaration.name) ||
|
|
15
|
-
!ts.isVariableDeclarationList(declaration.parent) ||
|
|
16
|
-
!(declaration.parent.flags & ts.NodeFlags.Const)))
|
|
17
|
-
return [];
|
|
18
|
-
const calls = [];
|
|
19
|
-
function visit(node) {
|
|
20
|
-
if (isProtocolCallbackFunction(node) &&
|
|
21
|
-
!(ts.isCallExpression(node.parent) &&
|
|
22
|
-
registeredHandler(node.parent) &&
|
|
23
|
-
node.parent.arguments.includes(node)))
|
|
24
|
-
return;
|
|
25
|
-
if (ts.isCallExpression(node))
|
|
26
|
-
calls.push(node);
|
|
27
|
-
ts.forEachChild(node, visit);
|
|
28
|
-
}
|
|
29
|
-
visit(fn.getSourceFile());
|
|
30
|
-
return calls;
|
|
31
|
-
}
|
|
32
|
-
function literalName(node) {
|
|
33
|
-
return ts.isIdentifier(node) || ts.isStringLiteral(node) ? node.text : undefined;
|
|
34
|
-
}
|
|
35
|
-
export function createProtocolCallbackValueResolver(checker) {
|
|
36
|
-
function symbol(node) {
|
|
37
|
-
const found = checker.getSymbolAtLocation(node);
|
|
38
|
-
return found?.flags && found.flags & ts.SymbolFlags.Alias
|
|
39
|
-
? checker.getAliasedSymbol(found)
|
|
40
|
-
: found;
|
|
41
|
-
}
|
|
42
|
-
function property(value, name, seen) {
|
|
43
|
-
if (!value ||
|
|
44
|
-
!ts.isObjectLiteralExpression(value.node) ||
|
|
45
|
-
value.node.properties.some(ts.isSpreadAssignment))
|
|
46
|
-
return undefined;
|
|
47
|
-
const member = value.node.properties.find((item) => item.name && literalName(item.name) === name);
|
|
48
|
-
if (member && ts.isPropertyAssignment(member))
|
|
49
|
-
return resolve(member.initializer, value.env, seen);
|
|
50
|
-
if (member && ts.isShorthandPropertyAssignment(member)) {
|
|
51
|
-
const target = checker.getShorthandAssignmentValueSymbol(member);
|
|
52
|
-
return target ? declaration(target, value.env, seen) : undefined;
|
|
53
|
-
}
|
|
54
|
-
return member && isProtocolCallbackFunction(member)
|
|
55
|
-
? { node: member, env: value.env }
|
|
56
|
-
: undefined;
|
|
57
|
-
}
|
|
58
|
-
function declaration(target, env, seen) {
|
|
59
|
-
const bound = env.get(target);
|
|
60
|
-
if (bound)
|
|
61
|
-
return resolve(bound.node, bound.env, seen);
|
|
62
|
-
const implemented = target.declarations?.find((item) => isProtocolCallbackFunction(item) && item.body);
|
|
63
|
-
if (implemented)
|
|
64
|
-
return { node: implemented, env };
|
|
65
|
-
const node = target.valueDeclaration;
|
|
66
|
-
if (!node || seen.has(node))
|
|
67
|
-
return undefined;
|
|
68
|
-
seen.add(node);
|
|
69
|
-
if (ts.isVariableDeclaration(node) &&
|
|
70
|
-
node.initializer &&
|
|
71
|
-
ts.isVariableDeclarationList(node.parent) &&
|
|
72
|
-
node.parent.flags & ts.NodeFlags.Const)
|
|
73
|
-
return resolve(node.initializer, env, seen);
|
|
74
|
-
if (ts.isBindingElement(node) && ts.isObjectBindingPattern(node.parent)) {
|
|
75
|
-
const owner = node.parent.parent;
|
|
76
|
-
const name = literalName(node.propertyName ?? node.name);
|
|
77
|
-
if (name &&
|
|
78
|
-
ts.isVariableDeclaration(owner) &&
|
|
79
|
-
owner.initializer &&
|
|
80
|
-
ts.isVariableDeclarationList(owner.parent) &&
|
|
81
|
-
owner.parent.flags & ts.NodeFlags.Const)
|
|
82
|
-
return property(resolve(owner.initializer, env, seen), name, seen);
|
|
83
|
-
}
|
|
84
|
-
return undefined;
|
|
85
|
-
}
|
|
86
|
-
function resolve(node, env, seen = new Set()) {
|
|
87
|
-
if (ts.isExpression(node))
|
|
88
|
-
node = unwrapExpression(node);
|
|
89
|
-
if (seen.has(node))
|
|
90
|
-
return undefined;
|
|
91
|
-
seen.add(node);
|
|
92
|
-
if (isProtocolCallbackFunction(node) ||
|
|
93
|
-
ts.isObjectLiteralExpression(node) ||
|
|
94
|
-
ts.isArrayLiteralExpression(node))
|
|
95
|
-
return { node, env };
|
|
96
|
-
if (ts.isIdentifier(node)) {
|
|
97
|
-
const target = symbol(node);
|
|
98
|
-
return target ? declaration(target, env, seen) : undefined;
|
|
99
|
-
}
|
|
100
|
-
if (ts.isPropertyAccessExpression(node)) {
|
|
101
|
-
const member = property(resolve(node.expression, env, seen), node.name.text, seen);
|
|
102
|
-
if (member)
|
|
103
|
-
return member;
|
|
104
|
-
const target = symbol(node.name);
|
|
105
|
-
return target ? declaration(target, env, seen) : undefined;
|
|
106
|
-
}
|
|
107
|
-
return undefined;
|
|
108
|
-
}
|
|
109
|
-
return { resolve, symbol, property };
|
|
110
|
-
}
|
|
111
|
-
export function protocolCallbackHasWrittenBindings(fn, checker, cache) {
|
|
112
|
-
return ((ts.isFunctionDeclaration(fn) && hasBindingWrite(fn, checker, cache)) ||
|
|
113
|
-
runtimeParameters(fn).some((parameter) => hasBindingWrite(parameter, checker, cache)));
|
|
114
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
export declare function unsupportedContextAlias(node: ts.VariableDeclaration, context: ts.Symbol, checker: ts.TypeChecker): boolean;
|
|
3
|
-
export declare function unsupportedContextAssignment(node: ts.Node, context: ts.Symbol, checker: ts.TypeChecker): boolean;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { expressionReceiver } from './protocol-write-receiver.mjs';
|
|
3
|
-
export function unsupportedContextAlias(node, context, checker) {
|
|
4
|
-
if (!node.initializer)
|
|
5
|
-
return false;
|
|
6
|
-
const receiver = expressionReceiver(node.initializer, checker);
|
|
7
|
-
return (receiver?.root === context &&
|
|
8
|
-
(receiver.path.length === 0 ||
|
|
9
|
-
(receiver.path.length === 1 && receiver.path[0] === 'response')) &&
|
|
10
|
-
(!ts.isIdentifier(node.name) ||
|
|
11
|
-
!ts.isVariableDeclarationList(node.parent) ||
|
|
12
|
-
!(node.parent.flags & ts.NodeFlags.Const)));
|
|
13
|
-
}
|
|
14
|
-
export function unsupportedContextAssignment(node, context, checker) {
|
|
15
|
-
if (!ts.isBinaryExpression(node) || node.operatorToken.kind !== ts.SyntaxKind.EqualsToken)
|
|
16
|
-
return false;
|
|
17
|
-
const receiver = expressionReceiver(node.right, checker);
|
|
18
|
-
return (receiver?.root === context &&
|
|
19
|
-
(receiver.path.length === 0 || (receiver.path.length === 1 && receiver.path[0] === 'response')));
|
|
20
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mts';
|
|
2
|
-
import { type ExtractedResponseContract } from '../contract-schema/index.mts';
|
|
3
|
-
import type { DiscoverApiResponseContractsOptions } from './response-contract-lenient.mts';
|
|
4
|
-
import type { BackendResponseContract } from './response-contract-types.mts';
|
|
5
|
-
export declare function extractSseEvents(type: ts.Type, checker: ts.TypeChecker, source: string, options: DiscoverApiResponseContractsOptions | undefined): {
|
|
6
|
-
eventName: string;
|
|
7
|
-
contract: ExtractedResponseContract;
|
|
8
|
-
}[];
|
|
9
|
-
export declare function extractHttpVariants(type: ts.Type, checker: ts.TypeChecker, source: string, options: DiscoverApiResponseContractsOptions | undefined, selectRow: (index: number) => boolean): Omit<BackendResponseContract, 'method' | 'routeTemplate'>[];
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import ts from '../contract-schema/typescript-api.mjs';
|
|
2
|
-
import { extractContractSchema } from '../contract-schema/index.mjs';
|
|
3
|
-
import { propertyType, stringLiterals, typeVariants } from './protocol-marker-analysis.mjs';
|
|
4
|
-
import { noContentContract } from './response-contract-registration.mjs';
|
|
5
|
-
import { statusForbidsBody } from './protocol-body-status.mjs';
|
|
6
|
-
export function extractSseEvents(type, checker, source, options) {
|
|
7
|
-
return typeVariants(type).flatMap((variant) => {
|
|
8
|
-
const names = stringLiterals(propertyType(variant, 'event', checker));
|
|
9
|
-
const contract = concretePayload(propertyType(variant, 'data', checker), checker, source, options);
|
|
10
|
-
return names.map((eventName) => ({ eventName, contract }));
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
export function extractHttpVariants(type, checker, source, options, selectRow) {
|
|
14
|
-
const carrier = propertyType(type, 'apiHttpResponseVariants', checker);
|
|
15
|
-
const variants = typeVariants(carrier).filter((variant) => !(variant.flags & ts.TypeFlags.Undefined));
|
|
16
|
-
if (variants.length === 0)
|
|
17
|
-
throw new Error('HTTP response requires concrete variants');
|
|
18
|
-
let row = 0;
|
|
19
|
-
const selections = variants.map((variant) => {
|
|
20
|
-
const rawMedia = rawPropertyType(variant, 'mediaType', checker);
|
|
21
|
-
const rawKind = rawPropertyType(variant, 'bodyKind', checker);
|
|
22
|
-
const count = rawKind?.isStringLiteral() && rawKind.value === 'none'
|
|
23
|
-
? 1
|
|
24
|
-
: rawMedia?.isUnion()
|
|
25
|
-
? rawMedia.types.length
|
|
26
|
-
: 1;
|
|
27
|
-
const selected = Array.from({ length: count }, () => selectRow(row++));
|
|
28
|
-
return selected;
|
|
29
|
-
});
|
|
30
|
-
return variants.flatMap((variant, index) => {
|
|
31
|
-
const selected = selections[index];
|
|
32
|
-
if (!selected.some(Boolean))
|
|
33
|
-
return [];
|
|
34
|
-
const status = propertyType(variant, 'status', checker);
|
|
35
|
-
if (!(status.flags & ts.TypeFlags.NumberLiteral))
|
|
36
|
-
throw new Error('HTTP response requires a literal status');
|
|
37
|
-
const value = status.value;
|
|
38
|
-
if (!Number.isInteger(value) || value < 100 || value > 599)
|
|
39
|
-
throw new Error('HTTP response status is invalid');
|
|
40
|
-
const kinds = stringLiterals(propertyType(variant, 'bodyKind', checker));
|
|
41
|
-
if (kinds.length !== 1)
|
|
42
|
-
throw new Error('HTTP response requires one concrete body kind per variant');
|
|
43
|
-
const statusCodes = [value];
|
|
44
|
-
if (kinds[0] === 'none')
|
|
45
|
-
return [
|
|
46
|
-
{
|
|
47
|
-
...noContentContract(source),
|
|
48
|
-
statusCodes,
|
|
49
|
-
statusKnowledge: 'explicit',
|
|
50
|
-
bodyKind: 'none',
|
|
51
|
-
mediaTypeKnowledge: 'none',
|
|
52
|
-
...(value === 400 ? { includeDefaultError: true } : {}),
|
|
53
|
-
},
|
|
54
|
-
];
|
|
55
|
-
if (kinds[0] !== 'content')
|
|
56
|
-
throw new Error('HTTP response body kind is invalid');
|
|
57
|
-
if (statusForbidsBody(value))
|
|
58
|
-
throw new Error(`HTTP status ${value} forbids response content`);
|
|
59
|
-
const contract = concretePayload(propertyType(variant, 'body', checker), checker, source, options);
|
|
60
|
-
return stringLiterals(propertyType(variant, 'mediaType', checker)).flatMap((mediaType, index) => selected[index]
|
|
61
|
-
? [
|
|
62
|
-
{
|
|
63
|
-
...contract,
|
|
64
|
-
statusCodes,
|
|
65
|
-
statusKnowledge: 'explicit',
|
|
66
|
-
bodyKind: 'content',
|
|
67
|
-
mediaType,
|
|
68
|
-
mediaTypeKnowledge: 'known',
|
|
69
|
-
...(value === 400 ? { includeDefaultError: true } : {}),
|
|
70
|
-
},
|
|
71
|
-
]
|
|
72
|
-
: []);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
function concretePayload(type, checker, source, options) {
|
|
76
|
-
const contract = extractContractSchema(type, checker, source, options);
|
|
77
|
-
if (contract.schema.root.type === 'unknown')
|
|
78
|
-
throw new Error('Protocol payload must have a concrete root');
|
|
79
|
-
return contract;
|
|
80
|
-
}
|
|
81
|
-
function rawPropertyType(type, name, checker) {
|
|
82
|
-
const property = checker.getPropertyOfType(type, name);
|
|
83
|
-
const declaration = property?.valueDeclaration ?? property?.declarations?.[0];
|
|
84
|
-
return property && declaration
|
|
85
|
-
? checker.getTypeOfSymbolAtLocation(property, declaration)
|
|
86
|
-
: undefined;
|
|
87
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function nextProtocolKey(contracts: ReadonlyMap<string, unknown>, key: string): string;
|