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.
Files changed (542) hide show
  1. package/README.md +24 -221
  2. package/dist/agent-blackboard/feedback-audit-source.mjs +2 -2
  3. package/dist/agent-blackboard/feedback-canonical.mjs +1 -1
  4. package/dist/agent-blackboard/feedback-codec.mjs +3 -3
  5. package/dist/agent-blackboard/feedback-compose.mjs +5 -5
  6. package/dist/agent-blackboard/feedback-deadline.mjs +1 -1
  7. package/dist/agent-blackboard/feedback-delivery.mjs +6 -6
  8. package/dist/agent-blackboard/feedback-fields.mjs +1 -1
  9. package/dist/agent-blackboard/feedback-identity.mjs +3 -3
  10. package/dist/agent-blackboard/feedback-journal-audit.mjs +4 -4
  11. package/dist/agent-blackboard/feedback-journal-sandbox.mjs +1 -1
  12. package/dist/agent-blackboard/feedback-online-error.mjs +1 -1
  13. package/dist/agent-blackboard/feedback-online.mjs +7 -7
  14. package/dist/agent-blackboard/feedback-outbox-counts.mjs +2 -2
  15. package/dist/agent-blackboard/feedback-outbox.mjs +7 -7
  16. package/dist/agent-blackboard/index.mjs +13 -13
  17. package/dist/agent-blackboard/journal.mjs +3 -3
  18. package/dist/agent-blackboard/session-tools.mjs +4 -4
  19. package/dist/agent-blackboard/snapshot-cleanup-directory.mjs +3 -3
  20. package/dist/agent-blackboard/snapshot-cleanup-receipt.mjs +1 -1
  21. package/dist/agent-blackboard/snapshot-cleanup-resume.mjs +2 -2
  22. package/dist/agent-blackboard/snapshot-partition-cleanup.mjs +3 -3
  23. package/dist/agent-blackboard/snapshot-partition-format.mjs +3 -3
  24. package/dist/agent-blackboard/snapshot-partition-predicates.mjs +2 -2
  25. package/dist/agent-blackboard/snapshot-partition-read.mjs +2 -2
  26. package/dist/agent-blackboard/snapshot-partition-validate.mjs +2 -2
  27. package/dist/agent-blackboard/snapshot-partition-write.mjs +2 -2
  28. package/dist/agent-blackboard/snapshot-partitions.mjs +4 -4
  29. package/dist/agent-blackboard/snapshot.mjs +2 -2
  30. package/dist/agent-harness-identity/index.d.mts +1 -1
  31. package/dist/api-fixtures/fixture-contract-validation.mjs +1 -1
  32. package/dist/api-fixtures/index.mjs +3 -3
  33. package/dist/ast-grep-examples/companion-parity.mjs +1 -1
  34. package/dist/ast-grep-examples/index.mjs +1 -1
  35. package/dist/basic-auth-doc-sync/index.mjs +2 -2
  36. package/dist/basic-auth-doc-sync/runbook.mjs +4 -4
  37. package/dist/basic-auth-doc-sync/source.mjs +2 -2
  38. package/dist/browser-session-runner/attempt.mjs +5 -5
  39. package/dist/browser-session-runner/index.mjs +4 -4
  40. package/dist/browser-session-runner/output.mjs +1 -1
  41. package/dist/ci-local/index.mjs +2 -2
  42. package/dist/cli/commands/agent-blackboard-flags.mjs +1 -1
  43. package/dist/cli/commands/agent-blackboard.mjs +3 -3
  44. package/dist/cli/commands/ast-grep-examples.mjs +1 -1
  45. package/dist/cli/commands/ast-grep-pack.mjs +1 -1
  46. package/dist/cli/commands/gha-artifacts-cleanup.mjs +1 -1
  47. package/dist/cli/commands/gha-runtime-audit.mjs +1 -1
  48. package/dist/cli/commands/gha-workspace-policy.mjs +2 -2
  49. package/dist/cli/commands/http-origin.mjs +1 -1
  50. package/dist/cli/commands/link-skill.mjs +1 -1
  51. package/dist/cli/commands/mcp.mjs +2 -2
  52. package/dist/cli/commands/nuget-central-version.mjs +1 -1
  53. package/dist/cli/commands/pnpm-install.mjs +1 -1
  54. package/dist/cli/commands/prepare-vitest-reports.mjs +1 -1
  55. package/dist/cli/commands/require-up-to-date.mjs +1 -1
  56. package/dist/cli/commands/retrospective-facts.mjs +1 -1
  57. package/dist/cli/commands/retrospective-transcript.mjs +1 -1
  58. package/dist/cli/commands/runner-port-policy.mjs +1 -1
  59. package/dist/cli/commands/vitest-blob-manifest.mjs +1 -1
  60. package/dist/cli/commands/vitest-report-attempt.mjs +1 -1
  61. package/dist/cli/index.mjs +27 -27
  62. package/dist/cli/installed-version.mjs +1 -1
  63. package/dist/cli/parse-gha-runtime-audit.mjs +1 -1
  64. package/dist/cli/parse-options.mjs +2 -2
  65. package/dist/cli/parse.mjs +5 -5
  66. package/dist/compiler-build/index.mjs +3 -3
  67. package/dist/compiler-build/program.mjs +3 -3
  68. package/dist/config-inventory/collect.mjs +5 -5
  69. package/dist/config-inventory/dynamic-configs.mjs +1 -1
  70. package/dist/config-inventory/env-expression-readers.mjs +1 -1
  71. package/dist/config-inventory/env-prefix-readers.mjs +2 -2
  72. package/dist/config-inventory/env-var-accumulator.mjs +1 -1
  73. package/dist/config-inventory/env-vars.mjs +5 -5
  74. package/dist/config-inventory/index.mjs +2 -2
  75. package/dist/contract-schema/contract-schema-bounded-array.mjs +2 -2
  76. package/dist/contract-schema/contract-schema-extractor.mjs +3 -3
  77. package/dist/contract-schema/contract-schema-object-tuple.mjs +2 -2
  78. package/dist/contract-schema/contract-schema-type-extractor.mjs +5 -5
  79. package/dist/contract-schema/contract-schema-type-utils.mjs +2 -2
  80. package/dist/contract-schema/contract-schema-validator.mjs +1 -1
  81. package/dist/contract-schema/index.mjs +7 -7
  82. package/dist/contract-schema/type-query-call.mjs +3 -3
  83. package/dist/contract-schema/type-query.mjs +2 -2
  84. package/dist/contract-schema/virtual-program.mjs +1 -1
  85. package/dist/coverage-transport/control-v2-parse-object.mjs +2 -2
  86. package/dist/coverage-transport/control-v2.mjs +4 -4
  87. package/dist/coverage-transport/control.mjs +2 -2
  88. package/dist/coverage-transport/discovery.mjs +4 -4
  89. package/dist/coverage-transport/http.mjs +1 -1
  90. package/dist/coverage-transport/index.mjs +10 -10
  91. package/dist/coverage-transport/keys.mjs +1 -1
  92. package/dist/coverage-transport/lib.mjs +6 -6
  93. package/dist/coverage-transport/prefix-transfer.mjs +4 -4
  94. package/dist/coverage-transport/prefix.mjs +3 -3
  95. package/dist/coverage-transport/presign.mjs +1 -1
  96. package/dist/coverage-transport/vitest-blob-transport.mjs +2 -2
  97. package/dist/dependency-license-policy/collect.mjs +5 -5
  98. package/dist/dependency-license-policy/index.mjs +3 -3
  99. package/dist/dependency-license-policy/policy.mjs +1 -1
  100. package/dist/dependency-license-policy/workspace.mjs +1 -1
  101. package/dist/dockerfile-parse/index.mjs +2 -2
  102. package/dist/dockerfile-parse/prewarm-ports.mjs +1 -1
  103. package/dist/dockerfile-parse/runtime-cmd.mjs +2 -2
  104. package/dist/finite-enum-ripple/check.mjs +3 -3
  105. package/dist/finite-enum-ripple/compare.mjs +3 -5
  106. package/dist/finite-enum-ripple/component-paths.mjs +2 -2
  107. package/dist/finite-enum-ripple/configured-object-mutations.mjs +1 -1
  108. package/dist/finite-enum-ripple/create-page-jsx.mjs +1 -1
  109. package/dist/finite-enum-ripple/create-page-literals.mjs +4 -4
  110. package/dist/finite-enum-ripple/create-page-object-visitor.mjs +2 -2
  111. package/dist/finite-enum-ripple/create-page-properties.mjs +1 -1
  112. package/dist/finite-enum-ripple/index.mjs +1 -1
  113. package/dist/finite-enum-ripple/model.d.mts +4 -0
  114. package/dist/finite-enum-ripple/parser-support.mjs +16 -3
  115. package/dist/finite-enum-ripple/parsers.mjs +5 -3
  116. package/dist/finite-enum-ripple/structured-route-check.mjs +5 -5
  117. package/dist/finite-enum-ripple/types.mjs +3 -3
  118. package/dist/finite-enum-ripple/union-factory-check.mjs +2 -2
  119. package/dist/finite-enum-ripple/union-types.mjs +5 -5
  120. package/dist/gh-api-shell-quoting/index.mjs +2 -2
  121. package/dist/gh-api-shell-quoting/logical-line.mjs +1 -1
  122. package/dist/gh-api-shell-quoting/scan.mjs +1 -1
  123. package/dist/gh-api-shell-quoting/yaml.mjs +1 -1
  124. package/dist/gh-cli/index.mjs +4 -4
  125. package/dist/gha-artifacts-cleanup/commands.mjs +2 -2
  126. package/dist/gha-artifacts-cleanup/index.mjs +4 -4
  127. package/dist/gha-check-run/cli.mjs +2 -2
  128. package/dist/gha-check-run/index.mjs +2 -2
  129. package/dist/gha-claude-post-review/index.mjs +2 -2
  130. package/dist/gha-post-review/claude-token.d.mts +2 -2
  131. package/dist/gha-post-review/claude-token.mjs +1 -1
  132. package/dist/gha-post-review/cli.mjs +1 -1
  133. package/dist/gha-post-review/github.mjs +7 -7
  134. package/dist/gha-post-review/index.mjs +6 -6
  135. package/dist/gha-post-review/post.mjs +2 -2
  136. package/dist/gha-post-review/pull-io.mjs +1 -1
  137. package/dist/gha-post-review/token.mjs +1 -1
  138. package/dist/gha-pr-checkpoint/index.mjs +3 -3
  139. package/dist/gha-pr-checkpoint/resume.mjs +1 -1
  140. package/dist/gha-pr-checkpoint/update.mjs +1 -1
  141. package/dist/gha-review-payload/cli.mjs +2 -2
  142. package/dist/gha-review-payload/file.mjs +1 -1
  143. package/dist/gha-review-payload/index.mjs +4 -4
  144. package/dist/gha-review-payload/remap.mjs +1 -1
  145. package/dist/gha-runtime-audit/audit.mjs +4 -4
  146. package/dist/gha-runtime-audit/index.mjs +3 -3
  147. package/dist/gha-workspace-policy/docker-options.mjs +1 -1
  148. package/dist/gha-workspace-policy/docker-workspace-user.mjs +2 -2
  149. package/dist/gha-workspace-policy/index.mjs +3 -3
  150. package/dist/gha-workspace-policy/shell-tokens.mjs +1 -1
  151. package/dist/gha-workspace-policy/sparse-checkout.mjs +1 -1
  152. package/dist/github-projects/index.mjs +2 -2
  153. package/dist/github-projects/project-audit.mjs +1 -1
  154. package/dist/index.mjs +55 -55
  155. package/dist/markdown/content-facts.mjs +1 -1
  156. package/dist/markdown/document-sections.mjs +2 -2
  157. package/dist/markdown/html-blocks.mjs +1 -1
  158. package/dist/markdown/index.mjs +10 -10
  159. package/dist/markdown/sections.mjs +2 -2
  160. package/dist/markdown/tables.mjs +2 -2
  161. package/dist/markdown/tasks.mjs +1 -1
  162. package/dist/mcp-server/context.mjs +2 -2
  163. package/dist/mcp-server/dispatch.mjs +8 -8
  164. package/dist/mcp-server/git-fixture.test-helpers.mjs +1 -1
  165. package/dist/mcp-server/handlers-journal.mjs +4 -4
  166. package/dist/mcp-server/handlers-outbox.mjs +2 -2
  167. package/dist/mcp-server/handlers-session.mjs +3 -3
  168. package/dist/mcp-server/harness.test-helpers.mjs +4 -4
  169. package/dist/mcp-server/main.mjs +1 -1
  170. package/dist/mcp-server/run.mjs +3 -3
  171. package/dist/mcp-server/sdk.mjs +1 -1
  172. package/dist/mcp-server/server.mjs +2 -2
  173. package/dist/mcp-server/worktree.mjs +2 -2
  174. package/dist/nuget-central-version/cli.mjs +1 -1
  175. package/dist/openapi-document/build-openapi-catalog-sse.mjs +1 -1
  176. package/dist/openapi-document/build-openapi-document.mjs +8 -8
  177. package/dist/openapi-document/build-openapi-request.mjs +1 -1
  178. package/dist/openapi-document/build-openapi-response.mjs +3 -3
  179. package/dist/openapi-document/build-openapi-sse-events.mjs +1 -1
  180. package/dist/openapi-document/component-registry.mjs +1 -1
  181. package/dist/openapi-document/contract-schema-intersection-merge.mjs +1 -1
  182. package/dist/openapi-document/contract-schema-to-openapi.mjs +1 -1
  183. package/dist/openapi-document/index.mjs +12 -12
  184. package/dist/openapi-document/openapi-route-helpers.mjs +1 -1
  185. package/dist/pg-schema-snapshot/build-snapshot.mjs +3 -3
  186. package/dist/pg-schema-snapshot/catalog-objects.mjs +1 -1
  187. package/dist/pg-schema-snapshot/catalog-queries.mjs +4 -4
  188. package/dist/pg-schema-snapshot/catalog-table-constraints.mjs +1 -1
  189. package/dist/pg-schema-snapshot/catalog-table-indexes.mjs +1 -1
  190. package/dist/pg-schema-snapshot/catalog-tables.mjs +1 -1
  191. package/dist/pg-schema-snapshot/generate.mjs +5 -5
  192. package/dist/pg-schema-snapshot/index.mjs +6 -6
  193. package/dist/pg-schema-snapshot/markdown-files.mjs +1 -1
  194. package/dist/pg-schema-snapshot/render-markdown.mjs +1 -1
  195. package/dist/pg-schema-snapshot/table-snapshot-constraints.mjs +1 -1
  196. package/dist/pg-schema-snapshot/table-snapshot.mjs +3 -3
  197. package/dist/pnpm-deploy/index.mjs +3 -3
  198. package/dist/pnpm-deploy/restore.mjs +1 -1
  199. package/dist/pnpm-install/exec.mjs +1 -1
  200. package/dist/pnpm-install/index.mjs +8 -8
  201. package/dist/pnpm-install/install-operations.mjs +6 -6
  202. package/dist/pnpm-install/metadata-legacy.mjs +1 -1
  203. package/dist/pnpm-install/metadata.d.mts +1 -1
  204. package/dist/pnpm-install/metadata.mjs +2 -2
  205. package/dist/pnpm-install/native-health.mjs +2 -2
  206. package/dist/pnpm-install/pnpm-install-fixture.test-helpers.mjs +2 -2
  207. package/dist/pnpm-install/runner.mjs +7 -7
  208. package/dist/post-publication-inventory/index.d.mts +6 -0
  209. package/dist/post-publication-inventory/index.mjs +6 -2
  210. package/dist/post-publication-inventory/readers/compose-appends.d.mts +7 -0
  211. package/dist/post-publication-inventory/readers/compose-appends.mjs +38 -0
  212. package/dist/post-publication-inventory/readers/composes.d.mts +2 -0
  213. package/dist/post-publication-inventory/readers/composes.mjs +79 -0
  214. package/dist/post-publication-inventory/readers/composition.d.mts +2 -0
  215. package/dist/post-publication-inventory/readers/composition.mjs +62 -0
  216. package/dist/post-publication-inventory/readers/public-boundary-ast.d.mts +5 -0
  217. package/dist/post-publication-inventory/readers/public-boundary-ast.mjs +33 -0
  218. package/dist/post-publication-inventory/readers/public-boundary-consumed.d.mts +3 -0
  219. package/dist/post-publication-inventory/readers/public-boundary-consumed.mjs +39 -0
  220. package/dist/post-publication-inventory/readers/public-boundary-dataflow.d.mts +3 -0
  221. package/dist/post-publication-inventory/readers/public-boundary-dataflow.mjs +61 -0
  222. package/dist/post-publication-inventory/readers/public-boundary-then.d.mts +9 -0
  223. package/dist/post-publication-inventory/readers/public-boundary-then.mjs +31 -0
  224. package/dist/post-publication-inventory/readers/public-boundary.d.mts +3 -0
  225. package/dist/post-publication-inventory/readers/public-boundary.mjs +71 -0
  226. package/dist/post-publication-inventory/readers/public-view-ast.d.mts +6 -0
  227. package/dist/post-publication-inventory/readers/public-view-ast.mjs +67 -0
  228. package/dist/post-publication-inventory/readers/public-view-options.d.mts +8 -0
  229. package/dist/post-publication-inventory/readers/public-view-protection.d.mts +2 -0
  230. package/dist/post-publication-inventory/readers/public-view-protection.mjs +83 -0
  231. package/dist/post-publication-inventory/readers/public-view.d.mts +2 -0
  232. package/dist/post-publication-inventory/readers/public-view.mjs +117 -0
  233. package/dist/post-publication-inventory/readers/source-ast.d.mts +30 -0
  234. package/dist/post-publication-inventory/readers/source-ast.mjs +52 -0
  235. package/dist/post-publication-inventory/readers/source-executors.d.mts +4 -0
  236. package/dist/post-publication-inventory/readers/source-executors.mjs +38 -0
  237. package/dist/post-publication-inventory/readers/source-helpers.d.mts +16 -0
  238. package/dist/post-publication-inventory/readers/source-helpers.mjs +72 -0
  239. package/dist/post-publication-inventory/readers/source-options.d.mts +8 -0
  240. package/dist/post-publication-inventory/readers/source-sql.d.mts +3 -0
  241. package/dist/post-publication-inventory/readers/source-sql.mjs +17 -0
  242. package/dist/post-publication-inventory/readers/sql-executors.mjs +2 -2
  243. package/dist/post-publication-inventory/readers/sql-source.mjs +3 -3
  244. package/dist/post-publication-inventory/readers/sql-template.mjs +1 -1
  245. package/dist/post-publication-inventory/writers/source.mjs +1 -1
  246. package/dist/retrospective-facts/coverage.mjs +1 -1
  247. package/dist/retrospective-facts/foreign.mjs +3 -3
  248. package/dist/retrospective-facts/index.mjs +4 -4
  249. package/dist/retrospective-facts/local.mjs +4 -4
  250. package/dist/retrospective-transcript/claude-blocks.mjs +1 -1
  251. package/dist/retrospective-transcript/claude.mjs +2 -2
  252. package/dist/retrospective-transcript/codex-messages.mjs +1 -1
  253. package/dist/retrospective-transcript/codex-payload.mjs +2 -2
  254. package/dist/retrospective-transcript/codex-records.mjs +3 -3
  255. package/dist/retrospective-transcript/codex-segment.mjs +1 -1
  256. package/dist/retrospective-transcript/codex.mjs +2 -2
  257. package/dist/retrospective-transcript/index.mjs +9 -9
  258. package/dist/retrospective-transcript/resolve-transcript-file.mjs +2 -2
  259. package/dist/scc-complexity/baseline.mjs +2 -2
  260. package/dist/scc-complexity/index.mjs +8 -8
  261. package/dist/scc-complexity/parser.mjs +1 -1
  262. package/dist/scc-complexity/scope-config.mjs +1 -1
  263. package/dist/session-friction/audit-block.mjs +1 -1
  264. package/dist/session-friction/ci-failures.mjs +2 -2
  265. package/dist/session-friction/classify.mjs +2 -2
  266. package/dist/session-friction/coverage-ledger.mjs +1 -1
  267. package/dist/session-friction/index.mjs +5 -5
  268. package/dist/session-friction/log-file.mjs +2 -2
  269. package/dist/session-friction/log.mjs +7 -7
  270. package/dist/session-friction/normalize.mjs +1 -1
  271. package/dist/session-friction/report.mjs +5 -5
  272. package/dist/session-friction/sandbox.mjs +1 -1
  273. package/dist/session-friction/session-id.mjs +1 -1
  274. package/dist/shared-context/index.mjs +1 -1
  275. package/dist/skill-discovery/index.mjs +3 -3
  276. package/dist/sql-ast/add-column.mjs +1 -1
  277. package/dist/sql-ast/constraint-do-block.mjs +2 -2
  278. package/dist/sql-ast/constraint-shared.mjs +1 -1
  279. package/dist/sql-ast/constraint.mjs +4 -4
  280. package/dist/sql-ast/create-table.mjs +2 -2
  281. package/dist/sql-ast/drop-index.mjs +2 -2
  282. package/dist/sql-ast/implicit-indexes.mjs +1 -1
  283. package/dist/sql-ast/index-metadata.mjs +3 -3
  284. package/dist/sql-ast/index.mjs +8 -8
  285. package/dist/sql-scanner/comments.mjs +1 -1
  286. package/dist/sql-scanner/index.mjs +3 -3
  287. package/dist/sql-scanner/literals.mjs +1 -1
  288. package/dist/swift-semantic-equal/cli.mjs +1 -1
  289. package/dist/swift-semantic-equal/index.mjs +1 -1
  290. package/dist/transient-retry/index.mjs +2 -2
  291. package/dist/vitest-blob-manifest/cli.mjs +2 -2
  292. package/dist/vitest-blob-manifest/index.mjs +4 -4
  293. package/dist/vitest-blob-manifest/report-attempt-cli.mjs +2 -2
  294. package/dist/vitest-blob-manifest/report-attempt.mjs +1 -1
  295. package/dist/vitest-blob-manifest/reports-cli.mjs +3 -3
  296. package/dist/vitest-blob-manifest/reports-source.mjs +2 -2
  297. package/dist/vitest-blob-manifest/reports.mjs +2 -2
  298. package/dist/vitest-diagnostics/index.mjs +8 -8
  299. package/dist/vitest-diagnostics/vitest-fork-exit-records.mjs +1 -1
  300. package/dist/vitest-diagnostics/vitest-fork-exit-sentinel.mjs +2 -2
  301. package/dist/vitest-diagnostics/vitest-fork-leak-detection.mjs +2 -2
  302. package/dist/vitest-diagnostics/vitest-worker-exit-diagnostics-reporter.mjs +2 -2
  303. package/dist/workflow-policy/condition-entailment.mjs +1 -1
  304. package/dist/workflow-policy/index.d.mts +1 -3
  305. package/dist/workflow-policy/index.mjs +4 -6
  306. package/dist/workflow-policy/permission-inheritance.mjs +1 -1
  307. package/dist/workflow-policy/permission-mismatches.mjs +2 -2
  308. package/dist/workflow-policy/secret-readiness.mjs +2 -2
  309. package/dist/workflow-policy/types.d.mts +2 -28
  310. package/dist/workspace-gates/first-party-graph.mjs +2 -2
  311. package/dist/workspace-gates/index.mjs +1 -1
  312. package/dist/workspace-gates/manifest-version-assertions.mjs +2 -2
  313. package/dist/workspace-gates/manifest-version-parser.mjs +1 -1
  314. package/dist/workspace-gates/options.mjs +1 -1
  315. package/dist/workspace-gates/policy.mjs +7 -7
  316. package/dist/workspace-gates/test-helpers.d.mts +2 -2
  317. package/docs/workflow-and-compiler.md +7 -16
  318. package/package.json +3 -6
  319. package/dist/api-contract-discovery/header-contract-parser.d.mts +0 -3
  320. package/dist/api-contract-discovery/header-contract-parser.mjs +0 -93
  321. package/dist/api-contract-discovery/header-contract-registry.d.mts +0 -3
  322. package/dist/api-contract-discovery/header-contract-registry.mjs +0 -40
  323. package/dist/api-contract-discovery/header-contract-types.d.mts +0 -19
  324. package/dist/api-contract-discovery/index.d.mts +0 -34
  325. package/dist/api-contract-discovery/index.mjs +0 -27
  326. package/dist/api-contract-discovery/protocol-analysis-cache.d.mts +0 -21
  327. package/dist/api-contract-discovery/protocol-analysis-cache.mjs +0 -7
  328. package/dist/api-contract-discovery/protocol-body-status.d.mts +0 -2
  329. package/dist/api-contract-discovery/protocol-body-status.mjs +0 -4
  330. package/dist/api-contract-discovery/protocol-callback-argument-bindings.d.mts +0 -7
  331. package/dist/api-contract-discovery/protocol-callback-argument-bindings.mjs +0 -33
  332. package/dist/api-contract-discovery/protocol-callback-invocation.d.mts +0 -6
  333. package/dist/api-contract-discovery/protocol-callback-invocation.mjs +0 -111
  334. package/dist/api-contract-discovery/protocol-callback-mutations.d.mts +0 -5
  335. package/dist/api-contract-discovery/protocol-callback-mutations.mjs +0 -42
  336. package/dist/api-contract-discovery/protocol-callback-registration.d.mts +0 -3
  337. package/dist/api-contract-discovery/protocol-callback-registration.mjs +0 -27
  338. package/dist/api-contract-discovery/protocol-callback-values.d.mts +0 -18
  339. package/dist/api-contract-discovery/protocol-callback-values.mjs +0 -114
  340. package/dist/api-contract-discovery/protocol-context-alias.d.mts +0 -3
  341. package/dist/api-contract-discovery/protocol-context-alias.mjs +0 -20
  342. package/dist/api-contract-discovery/protocol-contract-extraction.d.mts +0 -9
  343. package/dist/api-contract-discovery/protocol-contract-extraction.mjs +0 -87
  344. package/dist/api-contract-discovery/protocol-contract-keys.d.mts +0 -1
  345. package/dist/api-contract-discovery/protocol-contract-keys.mjs +0 -8
  346. package/dist/api-contract-discovery/protocol-contract-registry.d.mts +0 -5
  347. package/dist/api-contract-discovery/protocol-contract-registry.mjs +0 -133
  348. package/dist/api-contract-discovery/protocol-executable-path.d.mts +0 -3
  349. package/dist/api-contract-discovery/protocol-executable-path.mjs +0 -64
  350. package/dist/api-contract-discovery/protocol-execution-path.d.mts +0 -4
  351. package/dist/api-contract-discovery/protocol-execution-path.mjs +0 -16
  352. package/dist/api-contract-discovery/protocol-http-association.d.mts +0 -7
  353. package/dist/api-contract-discovery/protocol-http-association.mjs +0 -108
  354. package/dist/api-contract-discovery/protocol-http-body-kinds.d.mts +0 -3
  355. package/dist/api-contract-discovery/protocol-http-body-kinds.mjs +0 -19
  356. package/dist/api-contract-discovery/protocol-http-context-callers.d.mts +0 -7
  357. package/dist/api-contract-discovery/protocol-http-context-callers.mjs +0 -40
  358. package/dist/api-contract-discovery/protocol-http-context-escapes.d.mts +0 -3
  359. package/dist/api-contract-discovery/protocol-http-context-escapes.mjs +0 -95
  360. package/dist/api-contract-discovery/protocol-http-context.d.mts +0 -8
  361. package/dist/api-contract-discovery/protocol-http-context.mjs +0 -85
  362. package/dist/api-contract-discovery/protocol-http-emission.d.mts +0 -3
  363. package/dist/api-contract-discovery/protocol-http-emission.mjs +0 -76
  364. package/dist/api-contract-discovery/protocol-http-implicit-taint.d.mts +0 -7
  365. package/dist/api-contract-discovery/protocol-http-implicit-taint.mjs +0 -26
  366. package/dist/api-contract-discovery/protocol-http-method-access.d.mts +0 -9
  367. package/dist/api-contract-discovery/protocol-http-method-access.mjs +0 -34
  368. package/dist/api-contract-discovery/protocol-http-method-mutations.d.mts +0 -3
  369. package/dist/api-contract-discovery/protocol-http-method-mutations.mjs +0 -31
  370. package/dist/api-contract-discovery/protocol-http-reflect.d.mts +0 -5
  371. package/dist/api-contract-discovery/protocol-http-reflect.mjs +0 -45
  372. package/dist/api-contract-discovery/protocol-http-registration.d.mts +0 -12
  373. package/dist/api-contract-discovery/protocol-http-registration.mjs +0 -53
  374. package/dist/api-contract-discovery/protocol-http-response-mutations.d.mts +0 -3
  375. package/dist/api-contract-discovery/protocol-http-response-mutations.mjs +0 -31
  376. package/dist/api-contract-discovery/protocol-marker-analysis.d.mts +0 -7
  377. package/dist/api-contract-discovery/protocol-marker-analysis.mjs +0 -50
  378. package/dist/api-contract-discovery/protocol-opaque-callback.d.mts +0 -3
  379. package/dist/api-contract-discovery/protocol-opaque-callback.mjs +0 -107
  380. package/dist/api-contract-discovery/protocol-platform-callbacks.d.mts +0 -7
  381. package/dist/api-contract-discovery/protocol-platform-callbacks.mjs +0 -76
  382. package/dist/api-contract-discovery/protocol-platform-mutation-targets.d.mts +0 -5
  383. package/dist/api-contract-discovery/protocol-platform-mutation-targets.mjs +0 -89
  384. package/dist/api-contract-discovery/protocol-platform-writes.d.mts +0 -3
  385. package/dist/api-contract-discovery/protocol-platform-writes.mjs +0 -92
  386. package/dist/api-contract-discovery/protocol-requested-keys.d.mts +0 -5
  387. package/dist/api-contract-discovery/protocol-requested-keys.mjs +0 -45
  388. package/dist/api-contract-discovery/protocol-sse-callers.d.mts +0 -7
  389. package/dist/api-contract-discovery/protocol-sse-callers.mjs +0 -67
  390. package/dist/api-contract-discovery/protocol-sse-emission.d.mts +0 -11
  391. package/dist/api-contract-discovery/protocol-sse-emission.mjs +0 -61
  392. package/dist/api-contract-discovery/protocol-sse-feasible-status.d.mts +0 -3
  393. package/dist/api-contract-discovery/protocol-sse-feasible-status.mjs +0 -24
  394. package/dist/api-contract-discovery/protocol-sse-raw-writes.d.mts +0 -9
  395. package/dist/api-contract-discovery/protocol-sse-raw-writes.mjs +0 -99
  396. package/dist/api-contract-discovery/protocol-sse-status.d.mts +0 -3
  397. package/dist/api-contract-discovery/protocol-sse-status.mjs +0 -84
  398. package/dist/api-contract-discovery/protocol-sse-write-access.d.mts +0 -9
  399. package/dist/api-contract-discovery/protocol-sse-write-access.mjs +0 -42
  400. package/dist/api-contract-discovery/protocol-sse-write-helpers.d.mts +0 -7
  401. package/dist/api-contract-discovery/protocol-sse-write-helpers.mjs +0 -82
  402. package/dist/api-contract-discovery/protocol-sse-write-mutations.d.mts +0 -9
  403. package/dist/api-contract-discovery/protocol-sse-write-mutations.mjs +0 -42
  404. package/dist/api-contract-discovery/protocol-sse-write-resolution.d.mts +0 -14
  405. package/dist/api-contract-discovery/protocol-sse-write-resolution.mjs +0 -79
  406. package/dist/api-contract-discovery/protocol-status-dominance.d.mts +0 -5
  407. package/dist/api-contract-discovery/protocol-status-dominance.mjs +0 -35
  408. package/dist/api-contract-discovery/protocol-write-receiver.d.mts +0 -9
  409. package/dist/api-contract-discovery/protocol-write-receiver.mjs +0 -79
  410. package/dist/api-contract-discovery/query-contract-extraction.d.mts +0 -3
  411. package/dist/api-contract-discovery/query-contract-extraction.mjs +0 -82
  412. package/dist/api-contract-discovery/query-contract-literals.d.mts +0 -13
  413. package/dist/api-contract-discovery/query-contract-literals.mjs +0 -83
  414. package/dist/api-contract-discovery/query-contract-registry.d.mts +0 -3
  415. package/dist/api-contract-discovery/query-contract-registry.mjs +0 -70
  416. package/dist/api-contract-discovery/query-contract-types.d.mts +0 -8
  417. package/dist/api-contract-discovery/registered-route-binding-writes.d.mts +0 -4
  418. package/dist/api-contract-discovery/registered-route-binding-writes.mjs +0 -47
  419. package/dist/api-contract-discovery/registered-route-catalog.d.mts +0 -10
  420. package/dist/api-contract-discovery/registered-route-catalog.mjs +0 -85
  421. package/dist/api-contract-discovery/registered-route-factory-returns.d.mts +0 -3
  422. package/dist/api-contract-discovery/registered-route-factory-returns.mjs +0 -29
  423. package/dist/api-contract-discovery/registered-route-handler-analysis.d.mts +0 -12
  424. package/dist/api-contract-discovery/registered-route-handler-analysis.mjs +0 -119
  425. package/dist/api-contract-discovery/registered-route-handler-helpers.d.mts +0 -3
  426. package/dist/api-contract-discovery/registered-route-handler-helpers.mjs +0 -16
  427. package/dist/api-contract-discovery/registered-route-runtime-parameters.d.mts +0 -3
  428. package/dist/api-contract-discovery/registered-route-runtime-parameters.mjs +0 -5
  429. package/dist/api-contract-discovery/registered-route-terminal-error.d.mts +0 -3
  430. package/dist/api-contract-discovery/registered-route-terminal-error.mjs +0 -98
  431. package/dist/api-contract-discovery/request-contract-implicit.d.mts +0 -17
  432. package/dist/api-contract-discovery/request-contract-implicit.mjs +0 -73
  433. package/dist/api-contract-discovery/request-contract-lenient.d.mts +0 -28
  434. package/dist/api-contract-discovery/request-contract-lenient.mjs +0 -59
  435. package/dist/api-contract-discovery/request-contract-registry.d.mts +0 -14
  436. package/dist/api-contract-discovery/request-contract-registry.mjs +0 -63
  437. package/dist/api-contract-discovery/request-contract-route-analysis.d.mts +0 -25
  438. package/dist/api-contract-discovery/request-contract-route-analysis.mjs +0 -68
  439. package/dist/api-contract-discovery/request-contract-types.d.mts +0 -12
  440. package/dist/api-contract-discovery/request-contract-types.mjs +0 -1
  441. package/dist/api-contract-discovery/request-validation-callbacks.d.mts +0 -9
  442. package/dist/api-contract-discovery/request-validation-callbacks.mjs +0 -27
  443. package/dist/api-contract-discovery/request-validation-checker.d.mts +0 -7
  444. package/dist/api-contract-discovery/request-validation-checker.mjs +0 -25
  445. package/dist/api-contract-discovery/request-validation-conditional.d.mts +0 -6
  446. package/dist/api-contract-discovery/request-validation-conditional.mjs +0 -31
  447. package/dist/api-contract-discovery/request-validation-factory-calls.d.mts +0 -11
  448. package/dist/api-contract-discovery/request-validation-factory-calls.mjs +0 -23
  449. package/dist/api-contract-discovery/request-validation-facts.d.mts +0 -16
  450. package/dist/api-contract-discovery/request-validation-facts.mjs +0 -64
  451. package/dist/api-contract-discovery/request-validation-follow.d.mts +0 -24
  452. package/dist/api-contract-discovery/request-validation-follow.mjs +0 -38
  453. package/dist/api-contract-discovery/request-validation-handler-state.d.mts +0 -8
  454. package/dist/api-contract-discovery/request-validation-handler-state.mjs +0 -35
  455. package/dist/api-contract-discovery/request-validation-input.d.mts +0 -12
  456. package/dist/api-contract-discovery/request-validation-input.mjs +0 -43
  457. package/dist/api-contract-discovery/request-validation-keys.d.mts +0 -25
  458. package/dist/api-contract-discovery/request-validation-keys.mjs +0 -119
  459. package/dist/api-contract-discovery/request-validation-match.d.mts +0 -11
  460. package/dist/api-contract-discovery/request-validation-match.mjs +0 -47
  461. package/dist/api-contract-discovery/request-validation-mutation.d.mts +0 -7
  462. package/dist/api-contract-discovery/request-validation-mutation.mjs +0 -80
  463. package/dist/api-contract-discovery/request-validation-origin.d.mts +0 -20
  464. package/dist/api-contract-discovery/request-validation-origin.mjs +0 -71
  465. package/dist/api-contract-discovery/request-validation-reads.d.mts +0 -13
  466. package/dist/api-contract-discovery/request-validation-reads.mjs +0 -88
  467. package/dist/api-contract-discovery/request-validation-registration.d.mts +0 -9
  468. package/dist/api-contract-discovery/request-validation-registration.mjs +0 -32
  469. package/dist/api-contract-discovery/request-validation-report.d.mts +0 -3
  470. package/dist/api-contract-discovery/request-validation-report.mjs +0 -21
  471. package/dist/api-contract-discovery/request-validation-request-origin.d.mts +0 -5
  472. package/dist/api-contract-discovery/request-validation-request-origin.mjs +0 -13
  473. package/dist/api-contract-discovery/request-validation-select.d.mts +0 -9
  474. package/dist/api-contract-discovery/request-validation-select.mjs +0 -36
  475. package/dist/api-contract-discovery/request-validation-sites.d.mts +0 -9
  476. package/dist/api-contract-discovery/request-validation-sites.mjs +0 -77
  477. package/dist/api-contract-discovery/request-validation-state-key.d.mts +0 -13
  478. package/dist/api-contract-discovery/request-validation-state-key.mjs +0 -30
  479. package/dist/api-contract-discovery/request-validation-trace-helpers.d.mts +0 -14
  480. package/dist/api-contract-discovery/request-validation-trace-helpers.mjs +0 -80
  481. package/dist/api-contract-discovery/request-validation-trace-select.d.mts +0 -23
  482. package/dist/api-contract-discovery/request-validation-trace-select.mjs +0 -45
  483. package/dist/api-contract-discovery/request-validation-trace.d.mts +0 -8
  484. package/dist/api-contract-discovery/request-validation-trace.mjs +0 -130
  485. package/dist/api-contract-discovery/request-validation-types.d.mts +0 -84
  486. package/dist/api-contract-discovery/request-validation-types.mjs +0 -1
  487. package/dist/api-contract-discovery/request-validation-walker.d.mts +0 -26
  488. package/dist/api-contract-discovery/request-validation-walker.mjs +0 -143
  489. package/dist/api-contract-discovery/request-validation.test-helpers.d.mts +0 -39
  490. package/dist/api-contract-discovery/request-validation.test-helpers.mjs +0 -108
  491. package/dist/api-contract-discovery/response-contract-attribution-facts.d.mts +0 -2
  492. package/dist/api-contract-discovery/response-contract-attribution-facts.mjs +0 -18
  493. package/dist/api-contract-discovery/response-contract-attribution.d.mts +0 -3
  494. package/dist/api-contract-discovery/response-contract-attribution.mjs +0 -23
  495. package/dist/api-contract-discovery/response-contract-call-classification.d.mts +0 -3
  496. package/dist/api-contract-discovery/response-contract-call-classification.mjs +0 -37
  497. package/dist/api-contract-discovery/response-contract-ctx-analysis.d.mts +0 -7
  498. package/dist/api-contract-discovery/response-contract-ctx-analysis.mjs +0 -28
  499. package/dist/api-contract-discovery/response-contract-error-branch.d.mts +0 -15
  500. package/dist/api-contract-discovery/response-contract-error-branch.mjs +0 -150
  501. package/dist/api-contract-discovery/response-contract-handler-bindings.d.mts +0 -3
  502. package/dist/api-contract-discovery/response-contract-handler-bindings.mjs +0 -126
  503. package/dist/api-contract-discovery/response-contract-handler-calls.d.mts +0 -3
  504. package/dist/api-contract-discovery/response-contract-handler-calls.mjs +0 -81
  505. package/dist/api-contract-discovery/response-contract-implicit-sources.test-helpers.d.mts +0 -145
  506. package/dist/api-contract-discovery/response-contract-implicit-sources.test-helpers.mjs +0 -145
  507. package/dist/api-contract-discovery/response-contract-implicit-variants.d.mts +0 -2
  508. package/dist/api-contract-discovery/response-contract-implicit-variants.mjs +0 -6
  509. package/dist/api-contract-discovery/response-contract-implicit.d.mts +0 -6
  510. package/dist/api-contract-discovery/response-contract-implicit.mjs +0 -120
  511. package/dist/api-contract-discovery/response-contract-lenient.d.mts +0 -41
  512. package/dist/api-contract-discovery/response-contract-lenient.mjs +0 -52
  513. package/dist/api-contract-discovery/response-contract-media.d.mts +0 -3
  514. package/dist/api-contract-discovery/response-contract-media.mjs +0 -46
  515. package/dist/api-contract-discovery/response-contract-object-symbols.d.mts +0 -3
  516. package/dist/api-contract-discovery/response-contract-object-symbols.mjs +0 -80
  517. package/dist/api-contract-discovery/response-contract-property-mutations.d.mts +0 -5
  518. package/dist/api-contract-discovery/response-contract-property-mutations.mjs +0 -84
  519. package/dist/api-contract-discovery/response-contract-registration.d.mts +0 -11
  520. package/dist/api-contract-discovery/response-contract-registration.mjs +0 -65
  521. package/dist/api-contract-discovery/response-contract-registry.d.mts +0 -7
  522. package/dist/api-contract-discovery/response-contract-registry.mjs +0 -124
  523. package/dist/api-contract-discovery/response-contract-route-analysis.d.mts +0 -12
  524. package/dist/api-contract-discovery/response-contract-route-analysis.mjs +0 -65
  525. package/dist/api-contract-discovery/response-contract-route-syntax.d.mts +0 -7
  526. package/dist/api-contract-discovery/response-contract-route-syntax.mjs +0 -41
  527. package/dist/api-contract-discovery/response-contract-status.d.mts +0 -27
  528. package/dist/api-contract-discovery/response-contract-status.mjs +0 -82
  529. package/dist/api-contract-discovery/response-contract-symbols.d.mts +0 -5
  530. package/dist/api-contract-discovery/response-contract-symbols.mjs +0 -82
  531. package/dist/api-contract-discovery/response-contract-types.d.mts +0 -23
  532. package/dist/api-contract-discovery/response-contract-types.mjs +0 -1
  533. package/dist/api-contract-discovery/test-setup.test-helpers.d.mts +0 -3
  534. package/dist/api-contract-discovery/test-setup.test-helpers.mjs +0 -2
  535. package/dist/workflow-policy/concurrency-scope.d.mts +0 -4
  536. package/dist/workflow-policy/concurrency-scope.mjs +0 -66
  537. package/dist/workflow-policy/concurrency.d.mts +0 -10
  538. package/dist/workflow-policy/concurrency.mjs +0 -77
  539. package/dist/workflow-policy/graph.d.mts +0 -2
  540. package/dist/workflow-policy/graph.mjs +0 -138
  541. /package/dist/{api-contract-discovery/header-contract-types.mjs → post-publication-inventory/readers/public-view-options.mjs} +0 -0
  542. /package/dist/{api-contract-discovery/query-contract-types.mjs → post-publication-inventory/readers/source-options.mjs} +0 -0
@@ -1,43 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { propertyNameText, resolveObject } from './request-validation-keys.mjs';
3
- import { traceValue } from './request-validation-trace.mjs';
4
- import { CARRIERS } from './request-validation-types.mjs';
5
- /** Applies the object's properties in order, so later properties and spreads win. */
6
- function collect(object, scope, found, seen) {
7
- found.nodes.push(object);
8
- for (const property of object.properties) {
9
- if (ts.isSpreadAssignment(property)) {
10
- const spread = resolveObject(property.expression, scope.checker, scope.roots);
11
- if (spread && !seen.has(spread))
12
- collect(spread, scope, found, new Set(seen).add(spread));
13
- else
14
- found.unresolved ??= `spread \`${property.expression.getText()}\` is not statically resolvable`;
15
- }
16
- else if (property.name && ts.isComputedPropertyName(property.name)) {
17
- found.unresolved ??= 'a computed property name is not statically resolvable';
18
- }
19
- else if (ts.isPropertyAssignment(property) || ts.isShorthandPropertyAssignment(property)) {
20
- const carrier = CARRIERS.find((item) => item === propertyNameText(property.name));
21
- if (carrier)
22
- found.entries.set(carrier, ts.isPropertyAssignment(property) ? property.initializer : property.name);
23
- }
24
- }
25
- }
26
- /** Resolves the object a validator receives as input, through const objects and spreads. */
27
- export function resolveInput(input, scope) {
28
- const found = { entries: new Map(), nodes: input ? [input] : [] };
29
- const object = resolveObject(input, scope.checker, scope.roots);
30
- if (object)
31
- collect(object, scope, found, new Set([object]));
32
- else if (input)
33
- found.unresolved = `input \`${input.getText()}\` is not statically resolvable`;
34
- const carriers = [...found.entries].map(([carrier, value]) => {
35
- const { origins, unresolved } = traceValue(value, scope);
36
- return {
37
- carrier,
38
- origins: CARRIERS.filter((candidate) => origins.has(candidate)),
39
- ...(unresolved && { unresolved }),
40
- };
41
- });
42
- return { carriers, ...(found.unresolved && { unresolved: found.unresolved }), nodes: found.nodes };
43
- }
@@ -1,25 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- /** Static string values bound to helper or factory parameters. */
3
- export type KeyBindings = ReadonlyMap<ts.Symbol, string>;
4
- /** A property name written as an identifier or string literal; computed names are `undefined`. */
5
- export declare const propertyNameText: (name: ts.PropertyName | undefined) => string | undefined;
6
- /** The variable symbol an identifier reads, including a shorthand property's value. */
7
- export declare function identifierSymbol(identifier: ts.Identifier, checker: ts.TypeChecker): ts.Symbol | undefined;
8
- /** The const initializer an identifier names, unless a property of it is written before the use. */
9
- export declare function stableConstInitializer(identifier: ts.Identifier, checker: ts.TypeChecker): ts.Expression | undefined;
10
- /** Resolves string literals, templates, const identifiers and bound parameters, else `undefined`. */
11
- export declare function resolveKey(expression: ts.Expression | undefined, checker: ts.TypeChecker, bindings: KeyBindings, seen?: Set<ts.Node>): string | undefined;
12
- /** Call-site bindings of parameters; an `expression` is the argument the call passes. */
13
- export type ParamBindings = ReadonlyMap<ts.Symbol, {
14
- expression?: ts.Expression | undefined;
15
- }>;
16
- /** The object literal an expression denotes, through const identifiers and bound parameters. */
17
- export declare function resolveObject(expression: ts.Expression | undefined, checker: ts.TypeChecker, params?: ParamBindings, seen?: Set<ts.Node>): ts.ObjectLiteralExpression | undefined;
18
- export declare const ABSENT: unique symbol;
19
- /** `undefined` means the property cannot be statically resolved. */
20
- type Found = ts.Expression | undefined | typeof ABSENT;
21
- /** The value expression a property ends with, applying properties and spreads in order. */
22
- export declare function findProperty(object: ts.ObjectLiteralExpression, name: string, checker: ts.TypeChecker, params: ParamBindings, seen: Set<ts.Node>): Found;
23
- /** Resolves a string property of an options object, including from spread const objects. */
24
- export declare function resolveOptionString(expression: ts.Expression | undefined, name: string, checker: ts.TypeChecker, bindings: KeyBindings, params?: ParamBindings): string | undefined;
25
- export {};
@@ -1,119 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { unwrapTransparentExpression } from './response-contract-route-syntax.mjs';
3
- import { resolveSymbol } from './response-contract-symbols.mjs';
4
- import { hasPropertyWriteBefore } from './request-validation-mutation.mjs';
5
- import { reachingWrites } from './request-validation-trace-helpers.mjs';
6
- const isConst = (declaration) => !!(ts.getCombinedNodeFlags(declaration) & ts.NodeFlags.Const);
7
- /** A property name written as an identifier or string literal; computed names are `undefined`. */
8
- export const propertyNameText = (name) => name && (ts.isIdentifier(name) || ts.isStringLiteral(name)) ? name.text : undefined;
9
- /** The variable symbol an identifier reads, including a shorthand property's value. */
10
- export function identifierSymbol(identifier, checker) {
11
- return ts.isShorthandPropertyAssignment(identifier.parent)
12
- ? checker.getShorthandAssignmentValueSymbol(identifier.parent)
13
- : checker.getSymbolAtLocation(identifier);
14
- }
15
- /** The initializer of the const variable an identifier names, through imports and aliases. */
16
- function constInitializer(identifier, checker) {
17
- const symbol = identifierSymbol(identifier, checker);
18
- const declaration = symbol && resolveSymbol(symbol, checker).declarations?.find(ts.isVariableDeclaration);
19
- return declaration?.initializer && isConst(declaration) ? declaration.initializer : undefined;
20
- }
21
- /** The const initializer an identifier names, unless a property of it is written before the use. */
22
- export function stableConstInitializer(identifier, checker) {
23
- const initializer = constInitializer(identifier, checker);
24
- const symbol = identifierSymbol(identifier, checker);
25
- return initializer && !hasPropertyWriteBefore(identifier, symbol, checker)
26
- ? initializer
27
- : undefined;
28
- }
29
- /** Folds a template literal whose every substitution resolves to a static string. */
30
- function resolveTemplate(template, checker, bindings, seen) {
31
- let text = template.head.text;
32
- for (const span of template.templateSpans) {
33
- const part = resolveKey(span.expression, checker, bindings, seen);
34
- if (part === undefined)
35
- return undefined;
36
- text += part + span.literal.text;
37
- }
38
- return text;
39
- }
40
- /** A bound key unless the helper reassigns the parameter: then only a lone reaching write counts. */
41
- function reassignedKey(identifier, symbol, bound, checker, bindings, seen) {
42
- const { writes, initializer } = reachingWrites(identifier, symbol, checker);
43
- if (writes.length === 0)
44
- return bound;
45
- const [write] = writes;
46
- if (writes.length > 1 || initializer)
47
- return undefined;
48
- return resolveKey(write, checker, bindings, seen);
49
- }
50
- /** Resolves string literals, templates, const identifiers and bound parameters, else `undefined`. */
51
- export function resolveKey(expression, checker, bindings, seen = new Set()) {
52
- if (!expression)
53
- return undefined;
54
- const value = unwrapTransparentExpression(expression);
55
- if (ts.isStringLiteralLike(value))
56
- return value.text;
57
- if (ts.isTemplateExpression(value))
58
- return resolveTemplate(value, checker, bindings, seen);
59
- if (!ts.isIdentifier(value))
60
- return undefined;
61
- const symbol = identifierSymbol(value, checker);
62
- const bound = symbol && bindings.get(symbol);
63
- if (symbol && bound !== undefined)
64
- return reassignedKey(value, symbol, bound, checker, bindings, seen);
65
- const initializer = constInitializer(value, checker);
66
- if (!initializer || seen.has(initializer))
67
- return undefined;
68
- return resolveKey(initializer, checker, bindings, new Set(seen).add(initializer));
69
- }
70
- const NO_PARAMS = new Map();
71
- /** The argument bound to a parameter, unless the helper reassigns the parameter first. */
72
- function boundArgument(identifier, checker, params) {
73
- const symbol = identifierSymbol(identifier, checker);
74
- const expression = symbol && params.get(symbol)?.expression;
75
- if (!symbol || !expression)
76
- return undefined;
77
- return reachingWrites(identifier, symbol, checker).writes.length > 0 ? undefined : expression;
78
- }
79
- /** The object literal an expression denotes, through const identifiers and bound parameters. */
80
- export function resolveObject(expression, checker, params = NO_PARAMS, seen = new Set()) {
81
- if (!expression || seen.has(expression))
82
- return undefined;
83
- const value = unwrapTransparentExpression(expression);
84
- if (ts.isObjectLiteralExpression(value))
85
- return value;
86
- if (!ts.isIdentifier(value))
87
- return undefined;
88
- const next = boundArgument(value, checker, params) ?? stableConstInitializer(value, checker);
89
- return resolveObject(next, checker, params, new Set(seen).add(expression));
90
- }
91
- export const ABSENT = Symbol('absent');
92
- /** The value expression a property ends with, applying properties and spreads in order. */
93
- export function findProperty(object, name, checker, params, seen) {
94
- for (const property of object.properties.toReversed()) {
95
- if (ts.isSpreadAssignment(property)) {
96
- const spread = resolveObject(property.expression, checker, params);
97
- const found = spread && !seen.has(spread)
98
- ? findProperty(spread, name, checker, params, new Set(seen).add(spread))
99
- : undefined;
100
- if (found !== ABSENT)
101
- return found;
102
- }
103
- else if (ts.isComputedPropertyName(property.name)) {
104
- return undefined;
105
- }
106
- else if ((ts.isPropertyAssignment(property) || ts.isShorthandPropertyAssignment(property)) &&
107
- propertyNameText(property.name) === name)
108
- return ts.isPropertyAssignment(property) ? property.initializer : property.name;
109
- }
110
- return ABSENT;
111
- }
112
- /** Resolves a string property of an options object, including from spread const objects. */
113
- export function resolveOptionString(expression, name, checker, bindings, params = NO_PARAMS) {
114
- const object = resolveObject(expression, checker, params);
115
- if (!object)
116
- return undefined;
117
- const found = findProperty(object, name, checker, params, new Set([object]));
118
- return found === ABSENT ? undefined : resolveKey(found, checker, bindings);
119
- }
@@ -1,11 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- type ExportRef = {
3
- module: string;
4
- exportName: string;
5
- };
6
- /** Resolves a callee through aliases and re-exports to the symbol it ultimately names. */
7
- export declare function calleeSymbol(callee: ts.Expression, checker: ts.TypeChecker): ts.Symbol | undefined;
8
- export declare function findConfig<T extends ExportRef>(callee: ts.Expression, configs: readonly T[], checker: ts.TypeChecker): T | undefined;
9
- /** True when the node sits inside the implementation of a configured export. */
10
- export declare function insideConfiguredImplementation(node: ts.Node, configs: readonly ExportRef[], checker: ts.TypeChecker): boolean;
11
- export {};
@@ -1,47 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { unwrapTransparentExpression } from './response-contract-route-syntax.mjs';
3
- import { attributionFunctionSymbol, resolveSymbol } from './response-contract-symbols.mjs';
4
- /** Resolves a callee through aliases and re-exports to the symbol it ultimately names. */
5
- export function calleeSymbol(callee, checker) {
6
- const target = unwrapTransparentExpression(callee);
7
- const name = ts.isPropertyAccessExpression(target) ? target.name : target;
8
- const symbol = ts.isIdentifier(name) ? checker.getSymbolAtLocation(name) : undefined;
9
- return symbol && resolveSymbol(symbol, checker);
10
- }
11
- const stripExtension = (path) => path.replace(/\.d\.[cm]?ts$/, '').replace(/\.[cm]?[jt]sx?$/, '');
12
- /** Compares extension-less paths, so `.ts`, `.js`, `.mts` and `.d.ts` spellings all agree. */
13
- function moduleMatches(fileName, module) {
14
- const path = fileName.replaceAll('\\', '/');
15
- return (path.includes(`/node_modules/${module}/`) ||
16
- stripExtension(path).endsWith(`/${stripExtension(module.replace(/^\.?\//, ''))}`));
17
- }
18
- /** True when the symbol is the configured export of a declaration file matching the module. */
19
- function matchesExport(symbol, config, checker) {
20
- return (symbol.declarations ?? []).some((declaration) => {
21
- const file = declaration.getSourceFile();
22
- if (!moduleMatches(file.fileName, config.module))
23
- return false;
24
- const moduleSymbol = checker.getSymbolAtLocation(file);
25
- const exported = moduleSymbol
26
- ? checker
27
- .getExportsOfModule(moduleSymbol)
28
- .find((item) => item.getName() === config.exportName)
29
- : undefined;
30
- return !!exported && resolveSymbol(exported, checker) === symbol;
31
- });
32
- }
33
- export function findConfig(callee, configs, checker) {
34
- const symbol = calleeSymbol(callee, checker);
35
- return symbol ? configs.find((config) => matchesExport(symbol, config, checker)) : undefined;
36
- }
37
- /** True when the node sits inside the implementation of a configured export. */
38
- export function insideConfiguredImplementation(node, configs, checker) {
39
- for (let current = node; current; current = current.parent) {
40
- const symbol = ts.isFunctionLike(current)
41
- ? attributionFunctionSymbol(current, checker)
42
- : undefined;
43
- if (symbol && configs.some((config) => matchesExport(symbol, config, checker)))
44
- return true;
45
- }
46
- return false;
47
- }
@@ -1,7 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- /**
3
- * True when a property of the const object an identifier names may have been written before the
4
- * use: in the use's own function, or anywhere in the declaring function or module when that
5
- * differs. `const` fixes the binding, not the object, so a written object is not its initializer.
6
- */
7
- export declare function hasPropertyWriteBefore(identifier: ts.Identifier, symbol: ts.Symbol, checker: ts.TypeChecker): boolean;
@@ -1,80 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { unwrapTransparentExpression } from './response-contract-route-syntax.mjs';
3
- import { resolveSymbol } from './response-contract-symbols.mjs';
4
- const MUTATORS = new Set(['assign', 'defineProperty', 'defineProperties', 'setPrototypeOf']);
5
- const UPDATES = new Set([ts.SyntaxKind.PlusPlusToken, ts.SyntaxKind.MinusMinusToken]);
6
- /**
7
- * Property-write start positions per symbol, per function (or source file). Symbols belong to one
8
- * checker, so the memo is keyed by checker and never leaks between programs.
9
- */
10
- const writesByChecker = new WeakMap();
11
- const isMember = (node) => ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node);
12
- /** The identifier an `a.b[c]` chain starts from, through parentheses, `!` and `as`. */
13
- function rootIdentifier(target) {
14
- let current = unwrapTransparentExpression(target);
15
- while (isMember(current))
16
- current = unwrapTransparentExpression(current.expression);
17
- return ts.isIdentifier(current) ? current : undefined;
18
- }
19
- /** The object a node writes a property of: `o.p = v`, `delete o.p`, `o.p++`, `Object.assign(o)`. */
20
- function mutatedObject(node) {
21
- let target;
22
- if (ts.isBinaryExpression(node) &&
23
- node.operatorToken.kind >= ts.SyntaxKind.FirstAssignment &&
24
- node.operatorToken.kind <= ts.SyntaxKind.LastAssignment)
25
- target = node.left;
26
- else if (ts.isDeleteExpression(node))
27
- target = node.expression;
28
- else if ((ts.isPrefixUnaryExpression(node) || ts.isPostfixUnaryExpression(node)) &&
29
- UPDATES.has(node.operator))
30
- target = node.operand;
31
- if (target)
32
- return isMember(target) ? rootIdentifier(target) : undefined;
33
- const callee = ts.isCallExpression(node) ? node.expression : undefined;
34
- const mutates = callee &&
35
- ts.isPropertyAccessExpression(callee) &&
36
- ts.isIdentifier(callee.expression) &&
37
- callee.expression.text === 'Object' &&
38
- MUTATORS.has(callee.name.text);
39
- const [first] = mutates ? node.arguments : [];
40
- return first ? rootIdentifier(first) : undefined;
41
- }
42
- function propertyWrites(scope, checker) {
43
- const scopes = writesByChecker.get(checker) ?? new WeakMap();
44
- writesByChecker.set(checker, scopes);
45
- const cached = scopes.get(scope);
46
- if (cached)
47
- return cached;
48
- const found = new Map();
49
- const scan = (node) => {
50
- if (node !== scope && ts.isFunctionLike(node))
51
- return;
52
- const object = mutatedObject(node);
53
- const symbol = object && checker.getSymbolAtLocation(object);
54
- if (symbol)
55
- found.set(symbol, [...(found.get(symbol) ?? []), node.getStart()]);
56
- ts.forEachChild(node, scan);
57
- };
58
- scan(scope);
59
- scopes.set(scope, found);
60
- return found;
61
- }
62
- function ownerOf(node) {
63
- let current = node.parent;
64
- while (current && !ts.isFunctionLike(current))
65
- current = current.parent;
66
- return current ?? node.getSourceFile();
67
- }
68
- /**
69
- * True when a property of the const object an identifier names may have been written before the
70
- * use: in the use's own function, or anywhere in the declaring function or module when that
71
- * differs. `const` fixes the binding, not the object, so a written object is not its initializer.
72
- */
73
- export function hasPropertyWriteBefore(identifier, symbol, checker) {
74
- const resolved = resolveSymbol(symbol, checker);
75
- const useScope = ownerOf(identifier);
76
- const declaration = resolved.declarations.find(ts.isVariableDeclaration);
77
- return [...new Set([useScope, ownerOf(declaration)])].some((scope) => [symbol, resolved].some((candidate) => propertyWrites(scope, checker)
78
- .get(candidate)
79
- ?.some((start) => scope !== useScope || start < identifier.getStart())));
80
- }
@@ -1,20 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import type { Carrier } from './request-validation-types.mts';
3
- /** What a value is relative to the handler's request context. */
4
- export type RootKind = 'context' | 'request' | 'query' | 'path' | 'header';
5
- /** A value bound to a parameter at a call site, with the request carriers it derives from. */
6
- export type Bound = {
7
- kind?: RootKind | undefined;
8
- origins: readonly Carrier[];
9
- unresolved?: string | undefined;
10
- /** The argument expression the call passed, for resolving object literals through it. */
11
- expression?: ts.Expression | undefined;
12
- };
13
- export type RootBindings = ReadonlyMap<ts.Symbol, Bound>;
14
- /** The carrier object a named member of a context or request object denotes. */
15
- export declare function memberKind(base: RootKind | undefined, name: string): RootKind | undefined;
16
- export declare function rootKind(expression: ts.Expression, roots: RootBindings, checker: ts.TypeChecker, seen?: Set<ts.Symbol>): RootKind | undefined;
17
- /** `X.request.json()` and its siblings, where X is the request context. */
18
- export declare function isBodyRead(call: ts.CallExpression, roots: RootBindings, checker: ts.TypeChecker): boolean;
19
- /** `ctx.get(name)`. */
20
- export declare function isHeaderGet(call: ts.CallExpression, roots: RootBindings, checker: ts.TypeChecker): boolean;
@@ -1,71 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { identifierSymbol } from './request-validation-keys.mjs';
3
- import { unwrapTransparentExpression } from './response-contract-route-syntax.mjs';
4
- const BODY_READERS = new Set(['json', 'text', 'buffer', 'formData', 'arrayBuffer', 'blob']);
5
- /** The carrier object a named member of a context or request object denotes. */
6
- export function memberKind(base, name) {
7
- if (base === 'context' && (name === 'request' || name === 'req'))
8
- return 'request';
9
- if ((base === 'context' || base === 'request') && name === 'query')
10
- return 'query';
11
- if (base === 'context' && name === 'params')
12
- return 'path';
13
- if ((base === 'context' || base === 'request') && (name === 'headers' || name === 'header'))
14
- return 'header';
15
- return undefined;
16
- }
17
- /** The const initializer an identifier aliases, with the destructured key when it is a member. */
18
- function aliasSource(symbol) {
19
- for (const declaration of symbol.declarations ?? []) {
20
- const owner = ts.isBindingElement(declaration) ? declaration.parent.parent : declaration;
21
- if (!ts.isVariableDeclaration(owner) ||
22
- !owner.initializer ||
23
- !(ts.getCombinedNodeFlags(owner) & ts.NodeFlags.Const))
24
- continue;
25
- if (!ts.isBindingElement(declaration))
26
- return { initializer: owner.initializer };
27
- const name = declaration.propertyName ?? declaration.name;
28
- const member = ts.isObjectBindingPattern(declaration.parent) && !declaration.dotDotDotToken;
29
- const named = ts.isIdentifier(name) || ts.isStringLiteral(name);
30
- return { initializer: owner.initializer, key: member && named ? name.text : null };
31
- }
32
- return undefined;
33
- }
34
- export function rootKind(expression, roots, checker, seen = new Set()) {
35
- const value = unwrapTransparentExpression(expression);
36
- if (ts.isPropertyAccessExpression(value))
37
- return memberKind(rootKind(value.expression, roots, checker, seen), value.name.text);
38
- if (ts.isElementAccessExpression(value))
39
- return ts.isStringLiteralLike(value.argumentExpression)
40
- ? memberKind(rootKind(value.expression, roots, checker, seen), value.argumentExpression.text)
41
- : undefined;
42
- if (!ts.isIdentifier(value))
43
- return undefined;
44
- const symbol = identifierSymbol(value, checker);
45
- if (!symbol || seen.has(symbol))
46
- return undefined;
47
- const bound = roots.get(symbol);
48
- if (bound)
49
- return bound.kind;
50
- const alias = aliasSource(symbol);
51
- if (!alias)
52
- return undefined;
53
- const base = rootKind(alias.initializer, roots, checker, new Set(seen).add(symbol));
54
- if (alias.key === undefined)
55
- return base;
56
- return alias.key === null ? undefined : memberKind(base, alias.key);
57
- }
58
- /** `X.request.json()` and its siblings, where X is the request context. */
59
- export function isBodyRead(call, roots, checker) {
60
- const callee = unwrapTransparentExpression(call.expression);
61
- return (ts.isPropertyAccessExpression(callee) &&
62
- BODY_READERS.has(callee.name.text) &&
63
- rootKind(callee.expression, roots, checker) === 'request');
64
- }
65
- /** `ctx.get(name)`. */
66
- export function isHeaderGet(call, roots, checker) {
67
- const callee = unwrapTransparentExpression(call.expression);
68
- return (ts.isPropertyAccessExpression(callee) &&
69
- callee.name.text === 'get' &&
70
- rootKind(callee.expression, roots, checker) === 'context');
71
- }
@@ -1,13 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import { type KeyBindings } from './request-validation-keys.mts';
3
- import { type RootBindings } from './request-validation-origin.mts';
4
- import type { CarrierRead } from './request-validation-types.mts';
5
- export type RawRead = Omit<CarrierRead, 'source'>;
6
- type Scope = {
7
- checker: ts.TypeChecker;
8
- roots: RootBindings;
9
- keys: KeyBindings;
10
- };
11
- /** The raw request reads made by exactly this node, not by its children. */
12
- export declare function rawReadsAt(node: ts.Node, scope: Scope): RawRead[];
13
- export {};
@@ -1,88 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { resolveKey } from './request-validation-keys.mjs';
3
- import { isBodyRead, isHeaderGet, rootKind, } from './request-validation-origin.mjs';
4
- const carrierRoot = (node, scope) => {
5
- const kind = rootKind(node, scope.roots, scope.checker);
6
- return kind === 'query' || kind === 'path' || kind === 'header' ? kind : undefined;
7
- };
8
- const isTransparent = (node) => ts.isParenthesizedExpression(node) ||
9
- ts.isAsExpression(node) ||
10
- ts.isNonNullExpression(node) ||
11
- ts.isSatisfiesExpression(node) ||
12
- ts.isTypeAssertionExpression(node);
13
- /** True when an identifier sits where it declares or names a property rather than reads a value. */
14
- function namesSomething(node) {
15
- const { name, propertyName } = node.parent;
16
- return (name === node && !ts.isShorthandPropertyAssignment(node.parent)) || propertyName === node;
17
- }
18
- /** True when the carrier expression is consumed as a value, not indexed, aliased or destructured. */
19
- function consumedAsValue(node) {
20
- if (ts.isIdentifier(node) && namesSomething(node))
21
- return false;
22
- let outer = node;
23
- while (isTransparent(outer.parent))
24
- outer = outer.parent;
25
- const parent = outer.parent;
26
- if (ts.isPropertyAccessExpression(parent) || ts.isElementAccessExpression(parent))
27
- return parent.expression !== outer;
28
- if (ts.isVariableDeclaration(parent) && parent.initializer === outer)
29
- return !(ts.isObjectBindingPattern(parent.name) ||
30
- (ts.isIdentifier(parent.name) && !!(ts.getCombinedNodeFlags(parent) & ts.NodeFlags.Const)));
31
- return !ts.isExpressionStatement(parent);
32
- }
33
- /** A whole-carrier read: the carrier object itself used as a value, as in `consume(ctx.query)`. */
34
- function wholeRead(node, scope) {
35
- if (!ts.isExpression(node) || isTransparent(node))
36
- return [];
37
- const carrier = carrierRoot(node, scope);
38
- return carrier && consumedAsValue(node) ? [{ carrier, key: null, access: 'whole' }] : [];
39
- }
40
- function destructuredRead(element, carrier) {
41
- const name = element.propertyName ?? element.name;
42
- if (element.dotDotDotToken)
43
- return { carrier, key: null, access: 'whole' };
44
- if (ts.isIdentifier(name) || ts.isStringLiteral(name))
45
- return { carrier, key: name.text, access: 'key' };
46
- return { carrier, key: null, access: 'computed' };
47
- }
48
- /** True for the target of a plain assignment or `delete`, which replaces without reading. */
49
- function isWriteTarget(node) {
50
- let outer = node;
51
- while (isTransparent(outer.parent))
52
- outer = outer.parent;
53
- const parent = outer.parent;
54
- return (ts.isDeleteExpression(parent) ||
55
- (ts.isBinaryExpression(parent) &&
56
- parent.operatorToken.kind === ts.SyntaxKind.EqualsToken &&
57
- parent.left === outer));
58
- }
59
- /** The raw request reads made by exactly this node, not by its children. */
60
- export function rawReadsAt(node, scope) {
61
- const keyed = (carrier, expression) => {
62
- const key = resolveKey(expression, scope.checker, scope.keys) ?? null;
63
- return { carrier, key, access: key === null ? 'computed' : 'key' };
64
- };
65
- if (ts.isCallExpression(node)) {
66
- if (isBodyRead(node, scope.roots, scope.checker))
67
- return [{ carrier: 'body', key: null, access: 'whole' }];
68
- return isHeaderGet(node, scope.roots, scope.checker) ? [keyed('header', node.arguments[0])] : [];
69
- }
70
- if ((ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) &&
71
- isWriteTarget(node))
72
- return [];
73
- if (ts.isPropertyAccessExpression(node)) {
74
- const carrier = carrierRoot(node.expression, scope);
75
- if (carrier)
76
- return [{ carrier, key: node.name.text, access: 'key' }];
77
- }
78
- if (ts.isElementAccessExpression(node)) {
79
- const carrier = carrierRoot(node.expression, scope);
80
- if (carrier)
81
- return [keyed(carrier, node.argumentExpression)];
82
- }
83
- if (ts.isVariableDeclaration(node) && ts.isObjectBindingPattern(node.name) && node.initializer) {
84
- const carrier = carrierRoot(node.initializer, scope);
85
- return carrier ? node.name.elements.map((element) => destructuredRead(element, carrier)) : [];
86
- }
87
- return wholeRead(node, scope);
88
- }
@@ -1,9 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import { type Scope } from './request-validation-follow.mts';
3
- import { type WalkState } from './request-validation-state-key.mts';
4
- /**
5
- * Finds configured factory calls in registration-time expressions, without entering handlers.
6
- * Validators evaluated here run while the handler is built, not per request, so only the walk of
7
- * the handler itself reports them.
8
- */
9
- export declare function createRegistrationScanner(scopeOf: (state: WalkState) => Scope, reportFactory: (call: ts.CallExpression, state: WalkState) => boolean): (node: ts.Node, state?: WalkState) => void;
@@ -1,32 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { followedImplementations } from './request-validation-follow.mjs';
3
- import { bindArguments } from './request-validation-trace.mjs';
4
- import { returnedValues } from './request-validation-trace-helpers.mjs';
5
- import { emptyState } from './request-validation-state-key.mjs';
6
- /**
7
- * Finds configured factory calls in registration-time expressions, without entering handlers.
8
- * Validators evaluated here run while the handler is built, not per request, so only the walk of
9
- * the handler itself reports them.
10
- */
11
- export function createRegistrationScanner(scopeOf, reportFactory) {
12
- const scanning = new Set();
13
- function scan(node, state = emptyState) {
14
- if (ts.isFunctionLike(node))
15
- return;
16
- if (ts.isCallExpression(node) && reportFactory(node, state))
17
- return;
18
- if (ts.isCallExpression(node))
19
- // A helper that builds the handler: follow its returned values with bound arguments.
20
- for (const fn of followedImplementations(node, scopeOf(state))) {
21
- if (scanning.has(fn))
22
- continue;
23
- scanning.add(fn);
24
- const { keys, roots } = bindArguments(fn, node, scopeOf(state));
25
- for (const value of returnedValues(fn))
26
- scan(value, { ...state, keys, roots });
27
- scanning.delete(fn);
28
- }
29
- ts.forEachChild(node, (child) => scan(child, state));
30
- }
31
- return scan;
32
- }
@@ -1,3 +0,0 @@
1
- import type ts from '../contract-schema/typescript-api.mts';
2
- /** Collects facts once per originating AST node and fact; a repeat returns the fact reported. */
3
- export declare function createReporter(): <T extends object>(kind: string, target: T[], item: T, node?: ts.Node, identity?: object) => T;
@@ -1,21 +0,0 @@
1
- /** Collects facts once per originating AST node and fact; a repeat returns the fact reported. */
2
- export function createReporter() {
3
- const reported = new Map();
4
- const nodeIds = new Map();
5
- const nodeId = (node) => {
6
- if (!node)
7
- return '';
8
- if (!nodeIds.has(node))
9
- nodeIds.set(node, nodeIds.size);
10
- return nodeIds.get(node);
11
- };
12
- return (kind, target, item, node, identity = item) => {
13
- const key = `${kind}${nodeId(node)}${JSON.stringify(identity)}`;
14
- const existing = reported.get(key);
15
- if (existing)
16
- return existing;
17
- reported.set(key, item);
18
- target.push(item);
19
- return item;
20
- };
21
- }
@@ -1,5 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import { type RootBindings } from './request-validation-origin.mts';
3
- import type { Carrier } from './request-validation-types.mts';
4
- /** The carrier a node reads directly from the request context, if it is such a read. */
5
- export declare function requestOrigin(node: ts.Node, roots: RootBindings, checker: ts.TypeChecker): Carrier | undefined;
@@ -1,13 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { isBodyRead, isHeaderGet, rootKind, } from './request-validation-origin.mjs';
3
- /** The carrier a node reads directly from the request context, if it is such a read. */
4
- export function requestOrigin(node, roots, checker) {
5
- const kind = ts.isExpression(node) ? rootKind(node, roots, checker) : undefined;
6
- if (kind === 'query' || kind === 'path' || kind === 'header')
7
- return kind;
8
- if (!ts.isCallExpression(node))
9
- return undefined;
10
- if (isBodyRead(node, roots, checker))
11
- return 'body';
12
- return isHeaderGet(node, roots, checker) ? 'header' : undefined;
13
- }
@@ -1,9 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import type { Scope } from './request-validation-follow.mts';
3
- /** The property name or array position a destructured binding selects, when it is static. */
4
- export declare function bindingKey(element: ts.BindingElement): string | number | undefined;
5
- /**
6
- * The expression a literal (or a const naming one) holds at a property or position: `null` when
7
- * nothing is there, `undefined` when it cannot be resolved statically.
8
- */
9
- export declare function literalMember(node: ts.Node, key: string | number, scope: Scope, seen?: Set<ts.Node>): ts.Expression | null | undefined;