vouchington-tooling 0.35.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (532) 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 +2 -2
  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/parser-support.mjs +2 -2
  114. package/dist/finite-enum-ripple/parsers.mjs +3 -3
  115. package/dist/finite-enum-ripple/structured-route-check.mjs +4 -4
  116. package/dist/finite-enum-ripple/types.mjs +3 -3
  117. package/dist/finite-enum-ripple/union-factory-check.mjs +2 -2
  118. package/dist/finite-enum-ripple/union-types.mjs +4 -4
  119. package/dist/gh-api-shell-quoting/index.mjs +2 -2
  120. package/dist/gh-api-shell-quoting/logical-line.mjs +1 -1
  121. package/dist/gh-api-shell-quoting/scan.mjs +1 -1
  122. package/dist/gh-api-shell-quoting/yaml.mjs +1 -1
  123. package/dist/gh-cli/index.mjs +4 -4
  124. package/dist/gha-artifacts-cleanup/commands.mjs +2 -2
  125. package/dist/gha-artifacts-cleanup/index.mjs +4 -4
  126. package/dist/gha-check-run/cli.mjs +2 -2
  127. package/dist/gha-check-run/index.mjs +2 -2
  128. package/dist/gha-claude-post-review/index.mjs +2 -2
  129. package/dist/gha-post-review/claude-token.d.mts +2 -2
  130. package/dist/gha-post-review/claude-token.mjs +1 -1
  131. package/dist/gha-post-review/cli.mjs +1 -1
  132. package/dist/gha-post-review/github.mjs +7 -7
  133. package/dist/gha-post-review/index.mjs +6 -6
  134. package/dist/gha-post-review/post.mjs +2 -2
  135. package/dist/gha-post-review/pull-io.mjs +1 -1
  136. package/dist/gha-post-review/token.mjs +1 -1
  137. package/dist/gha-pr-checkpoint/index.mjs +3 -3
  138. package/dist/gha-pr-checkpoint/resume.mjs +1 -1
  139. package/dist/gha-pr-checkpoint/update.mjs +1 -1
  140. package/dist/gha-review-payload/cli.mjs +2 -2
  141. package/dist/gha-review-payload/file.mjs +1 -1
  142. package/dist/gha-review-payload/index.mjs +4 -4
  143. package/dist/gha-review-payload/remap.mjs +1 -1
  144. package/dist/gha-runtime-audit/audit.mjs +4 -4
  145. package/dist/gha-runtime-audit/index.mjs +3 -3
  146. package/dist/gha-workspace-policy/docker-options.mjs +1 -1
  147. package/dist/gha-workspace-policy/docker-workspace-user.mjs +2 -2
  148. package/dist/gha-workspace-policy/index.mjs +3 -3
  149. package/dist/gha-workspace-policy/shell-tokens.mjs +1 -1
  150. package/dist/gha-workspace-policy/sparse-checkout.mjs +1 -1
  151. package/dist/github-projects/index.mjs +2 -2
  152. package/dist/github-projects/project-audit.mjs +1 -1
  153. package/dist/index.mjs +55 -55
  154. package/dist/markdown/content-facts.mjs +1 -1
  155. package/dist/markdown/document-sections.mjs +2 -2
  156. package/dist/markdown/html-blocks.mjs +1 -1
  157. package/dist/markdown/index.mjs +10 -10
  158. package/dist/markdown/sections.mjs +2 -2
  159. package/dist/markdown/tables.mjs +2 -2
  160. package/dist/markdown/tasks.mjs +1 -1
  161. package/dist/mcp-server/context.mjs +2 -2
  162. package/dist/mcp-server/dispatch.mjs +8 -8
  163. package/dist/mcp-server/git-fixture.test-helpers.mjs +1 -1
  164. package/dist/mcp-server/handlers-journal.mjs +4 -4
  165. package/dist/mcp-server/handlers-outbox.mjs +2 -2
  166. package/dist/mcp-server/handlers-session.mjs +3 -3
  167. package/dist/mcp-server/harness.test-helpers.mjs +4 -4
  168. package/dist/mcp-server/main.mjs +1 -1
  169. package/dist/mcp-server/run.mjs +3 -3
  170. package/dist/mcp-server/sdk.mjs +1 -1
  171. package/dist/mcp-server/server.mjs +2 -2
  172. package/dist/mcp-server/worktree.mjs +2 -2
  173. package/dist/nuget-central-version/cli.mjs +1 -1
  174. package/dist/openapi-document/build-openapi-catalog-sse.mjs +1 -1
  175. package/dist/openapi-document/build-openapi-document.mjs +8 -8
  176. package/dist/openapi-document/build-openapi-request.mjs +1 -1
  177. package/dist/openapi-document/build-openapi-response.mjs +3 -3
  178. package/dist/openapi-document/build-openapi-sse-events.mjs +1 -1
  179. package/dist/openapi-document/component-registry.mjs +1 -1
  180. package/dist/openapi-document/contract-schema-intersection-merge.mjs +1 -1
  181. package/dist/openapi-document/contract-schema-to-openapi.mjs +1 -1
  182. package/dist/openapi-document/index.mjs +12 -12
  183. package/dist/openapi-document/openapi-route-helpers.mjs +1 -1
  184. package/dist/pg-schema-snapshot/build-snapshot.mjs +3 -3
  185. package/dist/pg-schema-snapshot/catalog-objects.mjs +1 -1
  186. package/dist/pg-schema-snapshot/catalog-queries.mjs +4 -4
  187. package/dist/pg-schema-snapshot/catalog-table-constraints.mjs +1 -1
  188. package/dist/pg-schema-snapshot/catalog-table-indexes.mjs +1 -1
  189. package/dist/pg-schema-snapshot/catalog-tables.mjs +1 -1
  190. package/dist/pg-schema-snapshot/generate.mjs +5 -5
  191. package/dist/pg-schema-snapshot/index.mjs +6 -6
  192. package/dist/pg-schema-snapshot/markdown-files.mjs +1 -1
  193. package/dist/pg-schema-snapshot/render-markdown.mjs +1 -1
  194. package/dist/pg-schema-snapshot/table-snapshot-constraints.mjs +1 -1
  195. package/dist/pg-schema-snapshot/table-snapshot.mjs +3 -3
  196. package/dist/pnpm-deploy/index.mjs +3 -3
  197. package/dist/pnpm-deploy/restore.mjs +1 -1
  198. package/dist/pnpm-install/exec.mjs +1 -1
  199. package/dist/pnpm-install/index.mjs +8 -8
  200. package/dist/pnpm-install/install-operations.mjs +6 -6
  201. package/dist/pnpm-install/metadata-legacy.mjs +1 -1
  202. package/dist/pnpm-install/metadata.d.mts +1 -1
  203. package/dist/pnpm-install/metadata.mjs +2 -2
  204. package/dist/pnpm-install/native-health.mjs +2 -2
  205. package/dist/pnpm-install/pnpm-install-fixture.test-helpers.mjs +2 -2
  206. package/dist/pnpm-install/runner.mjs +7 -7
  207. package/dist/post-publication-inventory/index.d.mts +6 -0
  208. package/dist/post-publication-inventory/index.mjs +6 -2
  209. package/dist/post-publication-inventory/readers/compose-appends.d.mts +7 -0
  210. package/dist/post-publication-inventory/readers/compose-appends.mjs +38 -0
  211. package/dist/post-publication-inventory/readers/composes.d.mts +2 -0
  212. package/dist/post-publication-inventory/readers/composes.mjs +79 -0
  213. package/dist/post-publication-inventory/readers/composition.d.mts +2 -0
  214. package/dist/post-publication-inventory/readers/composition.mjs +62 -0
  215. package/dist/post-publication-inventory/readers/public-boundary-ast.d.mts +5 -0
  216. package/dist/post-publication-inventory/readers/public-boundary-ast.mjs +33 -0
  217. package/dist/post-publication-inventory/readers/public-boundary-consumed.d.mts +3 -0
  218. package/dist/post-publication-inventory/readers/public-boundary-consumed.mjs +39 -0
  219. package/dist/post-publication-inventory/readers/public-boundary-dataflow.d.mts +3 -0
  220. package/dist/post-publication-inventory/readers/public-boundary-dataflow.mjs +61 -0
  221. package/dist/post-publication-inventory/readers/public-boundary-then.d.mts +9 -0
  222. package/dist/post-publication-inventory/readers/public-boundary-then.mjs +31 -0
  223. package/dist/post-publication-inventory/readers/public-boundary.d.mts +3 -0
  224. package/dist/post-publication-inventory/readers/public-boundary.mjs +71 -0
  225. package/dist/post-publication-inventory/readers/public-view-ast.d.mts +6 -0
  226. package/dist/post-publication-inventory/readers/public-view-ast.mjs +67 -0
  227. package/dist/post-publication-inventory/readers/public-view-options.d.mts +8 -0
  228. package/dist/post-publication-inventory/readers/public-view-protection.d.mts +2 -0
  229. package/dist/post-publication-inventory/readers/public-view-protection.mjs +83 -0
  230. package/dist/post-publication-inventory/readers/public-view.d.mts +2 -0
  231. package/dist/post-publication-inventory/readers/public-view.mjs +117 -0
  232. package/dist/post-publication-inventory/readers/source-ast.d.mts +30 -0
  233. package/dist/post-publication-inventory/readers/source-ast.mjs +52 -0
  234. package/dist/post-publication-inventory/readers/source-executors.d.mts +4 -0
  235. package/dist/post-publication-inventory/readers/source-executors.mjs +38 -0
  236. package/dist/post-publication-inventory/readers/source-helpers.d.mts +16 -0
  237. package/dist/post-publication-inventory/readers/source-helpers.mjs +72 -0
  238. package/dist/post-publication-inventory/readers/source-options.d.mts +8 -0
  239. package/dist/post-publication-inventory/readers/source-sql.d.mts +3 -0
  240. package/dist/post-publication-inventory/readers/source-sql.mjs +17 -0
  241. package/dist/post-publication-inventory/readers/sql-executors.mjs +2 -2
  242. package/dist/post-publication-inventory/readers/sql-source.mjs +3 -3
  243. package/dist/post-publication-inventory/readers/sql-template.mjs +1 -1
  244. package/dist/post-publication-inventory/writers/source.mjs +1 -1
  245. package/dist/retrospective-facts/coverage.mjs +1 -1
  246. package/dist/retrospective-facts/foreign.mjs +3 -3
  247. package/dist/retrospective-facts/index.mjs +4 -4
  248. package/dist/retrospective-facts/local.mjs +4 -4
  249. package/dist/retrospective-transcript/claude-blocks.mjs +1 -1
  250. package/dist/retrospective-transcript/claude.mjs +2 -2
  251. package/dist/retrospective-transcript/codex-messages.mjs +1 -1
  252. package/dist/retrospective-transcript/codex-payload.mjs +2 -2
  253. package/dist/retrospective-transcript/codex-records.mjs +3 -3
  254. package/dist/retrospective-transcript/codex-segment.mjs +1 -1
  255. package/dist/retrospective-transcript/codex.mjs +2 -2
  256. package/dist/retrospective-transcript/index.mjs +9 -9
  257. package/dist/retrospective-transcript/resolve-transcript-file.mjs +2 -2
  258. package/dist/scc-complexity/baseline.mjs +2 -2
  259. package/dist/scc-complexity/index.mjs +8 -8
  260. package/dist/scc-complexity/parser.mjs +1 -1
  261. package/dist/scc-complexity/scope-config.mjs +1 -1
  262. package/dist/session-friction/audit-block.mjs +1 -1
  263. package/dist/session-friction/ci-failures.mjs +2 -2
  264. package/dist/session-friction/classify.mjs +2 -2
  265. package/dist/session-friction/coverage-ledger.mjs +1 -1
  266. package/dist/session-friction/index.mjs +5 -5
  267. package/dist/session-friction/log-file.mjs +2 -2
  268. package/dist/session-friction/log.mjs +7 -7
  269. package/dist/session-friction/normalize.mjs +1 -1
  270. package/dist/session-friction/report.mjs +5 -5
  271. package/dist/session-friction/sandbox.mjs +1 -1
  272. package/dist/session-friction/session-id.mjs +1 -1
  273. package/dist/shared-context/index.mjs +1 -1
  274. package/dist/skill-discovery/index.mjs +3 -3
  275. package/dist/sql-ast/add-column.mjs +1 -1
  276. package/dist/sql-ast/constraint-do-block.mjs +2 -2
  277. package/dist/sql-ast/constraint-shared.mjs +1 -1
  278. package/dist/sql-ast/constraint.mjs +4 -4
  279. package/dist/sql-ast/create-table.mjs +2 -2
  280. package/dist/sql-ast/drop-index.mjs +2 -2
  281. package/dist/sql-ast/implicit-indexes.mjs +1 -1
  282. package/dist/sql-ast/index-metadata.mjs +3 -3
  283. package/dist/sql-ast/index.mjs +8 -8
  284. package/dist/sql-scanner/comments.mjs +1 -1
  285. package/dist/sql-scanner/index.mjs +3 -3
  286. package/dist/sql-scanner/literals.mjs +1 -1
  287. package/dist/swift-semantic-equal/cli.mjs +1 -1
  288. package/dist/swift-semantic-equal/index.mjs +1 -1
  289. package/dist/transient-retry/index.mjs +2 -2
  290. package/dist/vitest-blob-manifest/cli.mjs +2 -2
  291. package/dist/vitest-blob-manifest/index.mjs +4 -4
  292. package/dist/vitest-blob-manifest/report-attempt-cli.mjs +2 -2
  293. package/dist/vitest-blob-manifest/report-attempt.mjs +1 -1
  294. package/dist/vitest-blob-manifest/reports-cli.mjs +3 -3
  295. package/dist/vitest-blob-manifest/reports-source.mjs +2 -2
  296. package/dist/vitest-blob-manifest/reports.mjs +2 -2
  297. package/dist/vitest-diagnostics/index.mjs +8 -8
  298. package/dist/vitest-diagnostics/vitest-fork-exit-records.mjs +1 -1
  299. package/dist/vitest-diagnostics/vitest-fork-exit-sentinel.mjs +2 -2
  300. package/dist/vitest-diagnostics/vitest-fork-leak-detection.mjs +2 -2
  301. package/dist/vitest-diagnostics/vitest-worker-exit-diagnostics-reporter.mjs +2 -2
  302. package/dist/workflow-policy/condition-entailment.mjs +1 -1
  303. package/dist/workflow-policy/index.mjs +4 -4
  304. package/dist/workflow-policy/permission-inheritance.mjs +1 -1
  305. package/dist/workflow-policy/permission-mismatches.mjs +2 -2
  306. package/dist/workflow-policy/secret-readiness.mjs +2 -2
  307. package/dist/workspace-gates/first-party-graph.mjs +2 -2
  308. package/dist/workspace-gates/index.mjs +1 -1
  309. package/dist/workspace-gates/manifest-version-assertions.mjs +2 -2
  310. package/dist/workspace-gates/manifest-version-parser.mjs +1 -1
  311. package/dist/workspace-gates/options.mjs +1 -1
  312. package/dist/workspace-gates/policy.mjs +7 -7
  313. package/dist/workspace-gates/test-helpers.d.mts +2 -2
  314. package/package.json +3 -6
  315. package/dist/api-contract-discovery/header-contract-parser.d.mts +0 -3
  316. package/dist/api-contract-discovery/header-contract-parser.mjs +0 -93
  317. package/dist/api-contract-discovery/header-contract-registry.d.mts +0 -3
  318. package/dist/api-contract-discovery/header-contract-registry.mjs +0 -40
  319. package/dist/api-contract-discovery/header-contract-types.d.mts +0 -19
  320. package/dist/api-contract-discovery/index.d.mts +0 -34
  321. package/dist/api-contract-discovery/index.mjs +0 -27
  322. package/dist/api-contract-discovery/protocol-analysis-cache.d.mts +0 -21
  323. package/dist/api-contract-discovery/protocol-analysis-cache.mjs +0 -7
  324. package/dist/api-contract-discovery/protocol-body-status.d.mts +0 -2
  325. package/dist/api-contract-discovery/protocol-body-status.mjs +0 -4
  326. package/dist/api-contract-discovery/protocol-callback-argument-bindings.d.mts +0 -7
  327. package/dist/api-contract-discovery/protocol-callback-argument-bindings.mjs +0 -33
  328. package/dist/api-contract-discovery/protocol-callback-invocation.d.mts +0 -6
  329. package/dist/api-contract-discovery/protocol-callback-invocation.mjs +0 -111
  330. package/dist/api-contract-discovery/protocol-callback-mutations.d.mts +0 -5
  331. package/dist/api-contract-discovery/protocol-callback-mutations.mjs +0 -42
  332. package/dist/api-contract-discovery/protocol-callback-registration.d.mts +0 -3
  333. package/dist/api-contract-discovery/protocol-callback-registration.mjs +0 -27
  334. package/dist/api-contract-discovery/protocol-callback-values.d.mts +0 -18
  335. package/dist/api-contract-discovery/protocol-callback-values.mjs +0 -114
  336. package/dist/api-contract-discovery/protocol-context-alias.d.mts +0 -3
  337. package/dist/api-contract-discovery/protocol-context-alias.mjs +0 -20
  338. package/dist/api-contract-discovery/protocol-contract-extraction.d.mts +0 -9
  339. package/dist/api-contract-discovery/protocol-contract-extraction.mjs +0 -87
  340. package/dist/api-contract-discovery/protocol-contract-keys.d.mts +0 -1
  341. package/dist/api-contract-discovery/protocol-contract-keys.mjs +0 -8
  342. package/dist/api-contract-discovery/protocol-contract-registry.d.mts +0 -5
  343. package/dist/api-contract-discovery/protocol-contract-registry.mjs +0 -133
  344. package/dist/api-contract-discovery/protocol-executable-path.d.mts +0 -3
  345. package/dist/api-contract-discovery/protocol-executable-path.mjs +0 -64
  346. package/dist/api-contract-discovery/protocol-execution-path.d.mts +0 -4
  347. package/dist/api-contract-discovery/protocol-execution-path.mjs +0 -16
  348. package/dist/api-contract-discovery/protocol-http-association.d.mts +0 -7
  349. package/dist/api-contract-discovery/protocol-http-association.mjs +0 -108
  350. package/dist/api-contract-discovery/protocol-http-body-kinds.d.mts +0 -3
  351. package/dist/api-contract-discovery/protocol-http-body-kinds.mjs +0 -19
  352. package/dist/api-contract-discovery/protocol-http-context-callers.d.mts +0 -7
  353. package/dist/api-contract-discovery/protocol-http-context-callers.mjs +0 -40
  354. package/dist/api-contract-discovery/protocol-http-context-escapes.d.mts +0 -3
  355. package/dist/api-contract-discovery/protocol-http-context-escapes.mjs +0 -95
  356. package/dist/api-contract-discovery/protocol-http-context.d.mts +0 -8
  357. package/dist/api-contract-discovery/protocol-http-context.mjs +0 -85
  358. package/dist/api-contract-discovery/protocol-http-emission.d.mts +0 -3
  359. package/dist/api-contract-discovery/protocol-http-emission.mjs +0 -76
  360. package/dist/api-contract-discovery/protocol-http-implicit-taint.d.mts +0 -7
  361. package/dist/api-contract-discovery/protocol-http-implicit-taint.mjs +0 -26
  362. package/dist/api-contract-discovery/protocol-http-method-access.d.mts +0 -9
  363. package/dist/api-contract-discovery/protocol-http-method-access.mjs +0 -34
  364. package/dist/api-contract-discovery/protocol-http-method-mutations.d.mts +0 -3
  365. package/dist/api-contract-discovery/protocol-http-method-mutations.mjs +0 -31
  366. package/dist/api-contract-discovery/protocol-http-reflect.d.mts +0 -5
  367. package/dist/api-contract-discovery/protocol-http-reflect.mjs +0 -45
  368. package/dist/api-contract-discovery/protocol-http-registration.d.mts +0 -12
  369. package/dist/api-contract-discovery/protocol-http-registration.mjs +0 -53
  370. package/dist/api-contract-discovery/protocol-http-response-mutations.d.mts +0 -3
  371. package/dist/api-contract-discovery/protocol-http-response-mutations.mjs +0 -31
  372. package/dist/api-contract-discovery/protocol-marker-analysis.d.mts +0 -7
  373. package/dist/api-contract-discovery/protocol-marker-analysis.mjs +0 -50
  374. package/dist/api-contract-discovery/protocol-opaque-callback.d.mts +0 -3
  375. package/dist/api-contract-discovery/protocol-opaque-callback.mjs +0 -107
  376. package/dist/api-contract-discovery/protocol-platform-callbacks.d.mts +0 -7
  377. package/dist/api-contract-discovery/protocol-platform-callbacks.mjs +0 -76
  378. package/dist/api-contract-discovery/protocol-platform-mutation-targets.d.mts +0 -5
  379. package/dist/api-contract-discovery/protocol-platform-mutation-targets.mjs +0 -89
  380. package/dist/api-contract-discovery/protocol-platform-writes.d.mts +0 -3
  381. package/dist/api-contract-discovery/protocol-platform-writes.mjs +0 -92
  382. package/dist/api-contract-discovery/protocol-requested-keys.d.mts +0 -5
  383. package/dist/api-contract-discovery/protocol-requested-keys.mjs +0 -45
  384. package/dist/api-contract-discovery/protocol-sse-callers.d.mts +0 -7
  385. package/dist/api-contract-discovery/protocol-sse-callers.mjs +0 -67
  386. package/dist/api-contract-discovery/protocol-sse-emission.d.mts +0 -11
  387. package/dist/api-contract-discovery/protocol-sse-emission.mjs +0 -61
  388. package/dist/api-contract-discovery/protocol-sse-feasible-status.d.mts +0 -3
  389. package/dist/api-contract-discovery/protocol-sse-feasible-status.mjs +0 -24
  390. package/dist/api-contract-discovery/protocol-sse-raw-writes.d.mts +0 -9
  391. package/dist/api-contract-discovery/protocol-sse-raw-writes.mjs +0 -99
  392. package/dist/api-contract-discovery/protocol-sse-status.d.mts +0 -3
  393. package/dist/api-contract-discovery/protocol-sse-status.mjs +0 -84
  394. package/dist/api-contract-discovery/protocol-sse-write-access.d.mts +0 -9
  395. package/dist/api-contract-discovery/protocol-sse-write-access.mjs +0 -42
  396. package/dist/api-contract-discovery/protocol-sse-write-helpers.d.mts +0 -7
  397. package/dist/api-contract-discovery/protocol-sse-write-helpers.mjs +0 -82
  398. package/dist/api-contract-discovery/protocol-sse-write-mutations.d.mts +0 -9
  399. package/dist/api-contract-discovery/protocol-sse-write-mutations.mjs +0 -42
  400. package/dist/api-contract-discovery/protocol-sse-write-resolution.d.mts +0 -14
  401. package/dist/api-contract-discovery/protocol-sse-write-resolution.mjs +0 -79
  402. package/dist/api-contract-discovery/protocol-status-dominance.d.mts +0 -5
  403. package/dist/api-contract-discovery/protocol-status-dominance.mjs +0 -35
  404. package/dist/api-contract-discovery/protocol-write-receiver.d.mts +0 -9
  405. package/dist/api-contract-discovery/protocol-write-receiver.mjs +0 -79
  406. package/dist/api-contract-discovery/query-contract-extraction.d.mts +0 -3
  407. package/dist/api-contract-discovery/query-contract-extraction.mjs +0 -82
  408. package/dist/api-contract-discovery/query-contract-literals.d.mts +0 -13
  409. package/dist/api-contract-discovery/query-contract-literals.mjs +0 -83
  410. package/dist/api-contract-discovery/query-contract-registry.d.mts +0 -3
  411. package/dist/api-contract-discovery/query-contract-registry.mjs +0 -70
  412. package/dist/api-contract-discovery/query-contract-types.d.mts +0 -8
  413. package/dist/api-contract-discovery/registered-route-binding-writes.d.mts +0 -4
  414. package/dist/api-contract-discovery/registered-route-binding-writes.mjs +0 -47
  415. package/dist/api-contract-discovery/registered-route-catalog.d.mts +0 -10
  416. package/dist/api-contract-discovery/registered-route-catalog.mjs +0 -85
  417. package/dist/api-contract-discovery/registered-route-factory-returns.d.mts +0 -3
  418. package/dist/api-contract-discovery/registered-route-factory-returns.mjs +0 -29
  419. package/dist/api-contract-discovery/registered-route-handler-analysis.d.mts +0 -12
  420. package/dist/api-contract-discovery/registered-route-handler-analysis.mjs +0 -119
  421. package/dist/api-contract-discovery/registered-route-handler-helpers.d.mts +0 -3
  422. package/dist/api-contract-discovery/registered-route-handler-helpers.mjs +0 -16
  423. package/dist/api-contract-discovery/registered-route-runtime-parameters.d.mts +0 -3
  424. package/dist/api-contract-discovery/registered-route-runtime-parameters.mjs +0 -5
  425. package/dist/api-contract-discovery/registered-route-terminal-error.d.mts +0 -3
  426. package/dist/api-contract-discovery/registered-route-terminal-error.mjs +0 -98
  427. package/dist/api-contract-discovery/request-contract-implicit.d.mts +0 -17
  428. package/dist/api-contract-discovery/request-contract-implicit.mjs +0 -73
  429. package/dist/api-contract-discovery/request-contract-lenient.d.mts +0 -28
  430. package/dist/api-contract-discovery/request-contract-lenient.mjs +0 -59
  431. package/dist/api-contract-discovery/request-contract-registry.d.mts +0 -14
  432. package/dist/api-contract-discovery/request-contract-registry.mjs +0 -63
  433. package/dist/api-contract-discovery/request-contract-route-analysis.d.mts +0 -25
  434. package/dist/api-contract-discovery/request-contract-route-analysis.mjs +0 -68
  435. package/dist/api-contract-discovery/request-contract-types.d.mts +0 -12
  436. package/dist/api-contract-discovery/request-contract-types.mjs +0 -1
  437. package/dist/api-contract-discovery/request-validation-callbacks.d.mts +0 -9
  438. package/dist/api-contract-discovery/request-validation-callbacks.mjs +0 -27
  439. package/dist/api-contract-discovery/request-validation-checker.d.mts +0 -7
  440. package/dist/api-contract-discovery/request-validation-checker.mjs +0 -25
  441. package/dist/api-contract-discovery/request-validation-conditional.d.mts +0 -6
  442. package/dist/api-contract-discovery/request-validation-conditional.mjs +0 -31
  443. package/dist/api-contract-discovery/request-validation-factory-calls.d.mts +0 -11
  444. package/dist/api-contract-discovery/request-validation-factory-calls.mjs +0 -23
  445. package/dist/api-contract-discovery/request-validation-facts.d.mts +0 -16
  446. package/dist/api-contract-discovery/request-validation-facts.mjs +0 -64
  447. package/dist/api-contract-discovery/request-validation-follow.d.mts +0 -24
  448. package/dist/api-contract-discovery/request-validation-follow.mjs +0 -38
  449. package/dist/api-contract-discovery/request-validation-handler-state.d.mts +0 -8
  450. package/dist/api-contract-discovery/request-validation-handler-state.mjs +0 -35
  451. package/dist/api-contract-discovery/request-validation-input.d.mts +0 -12
  452. package/dist/api-contract-discovery/request-validation-input.mjs +0 -43
  453. package/dist/api-contract-discovery/request-validation-keys.d.mts +0 -25
  454. package/dist/api-contract-discovery/request-validation-keys.mjs +0 -119
  455. package/dist/api-contract-discovery/request-validation-match.d.mts +0 -11
  456. package/dist/api-contract-discovery/request-validation-match.mjs +0 -47
  457. package/dist/api-contract-discovery/request-validation-mutation.d.mts +0 -7
  458. package/dist/api-contract-discovery/request-validation-mutation.mjs +0 -80
  459. package/dist/api-contract-discovery/request-validation-origin.d.mts +0 -20
  460. package/dist/api-contract-discovery/request-validation-origin.mjs +0 -71
  461. package/dist/api-contract-discovery/request-validation-reads.d.mts +0 -13
  462. package/dist/api-contract-discovery/request-validation-reads.mjs +0 -88
  463. package/dist/api-contract-discovery/request-validation-registration.d.mts +0 -9
  464. package/dist/api-contract-discovery/request-validation-registration.mjs +0 -32
  465. package/dist/api-contract-discovery/request-validation-report.d.mts +0 -3
  466. package/dist/api-contract-discovery/request-validation-report.mjs +0 -21
  467. package/dist/api-contract-discovery/request-validation-request-origin.d.mts +0 -5
  468. package/dist/api-contract-discovery/request-validation-request-origin.mjs +0 -13
  469. package/dist/api-contract-discovery/request-validation-select.d.mts +0 -9
  470. package/dist/api-contract-discovery/request-validation-select.mjs +0 -36
  471. package/dist/api-contract-discovery/request-validation-sites.d.mts +0 -9
  472. package/dist/api-contract-discovery/request-validation-sites.mjs +0 -77
  473. package/dist/api-contract-discovery/request-validation-state-key.d.mts +0 -13
  474. package/dist/api-contract-discovery/request-validation-state-key.mjs +0 -30
  475. package/dist/api-contract-discovery/request-validation-trace-helpers.d.mts +0 -14
  476. package/dist/api-contract-discovery/request-validation-trace-helpers.mjs +0 -80
  477. package/dist/api-contract-discovery/request-validation-trace-select.d.mts +0 -23
  478. package/dist/api-contract-discovery/request-validation-trace-select.mjs +0 -45
  479. package/dist/api-contract-discovery/request-validation-trace.d.mts +0 -8
  480. package/dist/api-contract-discovery/request-validation-trace.mjs +0 -130
  481. package/dist/api-contract-discovery/request-validation-types.d.mts +0 -84
  482. package/dist/api-contract-discovery/request-validation-types.mjs +0 -1
  483. package/dist/api-contract-discovery/request-validation-walker.d.mts +0 -26
  484. package/dist/api-contract-discovery/request-validation-walker.mjs +0 -143
  485. package/dist/api-contract-discovery/request-validation.test-helpers.d.mts +0 -39
  486. package/dist/api-contract-discovery/request-validation.test-helpers.mjs +0 -108
  487. package/dist/api-contract-discovery/response-contract-attribution-facts.d.mts +0 -2
  488. package/dist/api-contract-discovery/response-contract-attribution-facts.mjs +0 -18
  489. package/dist/api-contract-discovery/response-contract-attribution.d.mts +0 -3
  490. package/dist/api-contract-discovery/response-contract-attribution.mjs +0 -23
  491. package/dist/api-contract-discovery/response-contract-call-classification.d.mts +0 -3
  492. package/dist/api-contract-discovery/response-contract-call-classification.mjs +0 -37
  493. package/dist/api-contract-discovery/response-contract-ctx-analysis.d.mts +0 -7
  494. package/dist/api-contract-discovery/response-contract-ctx-analysis.mjs +0 -28
  495. package/dist/api-contract-discovery/response-contract-error-branch.d.mts +0 -15
  496. package/dist/api-contract-discovery/response-contract-error-branch.mjs +0 -150
  497. package/dist/api-contract-discovery/response-contract-handler-bindings.d.mts +0 -3
  498. package/dist/api-contract-discovery/response-contract-handler-bindings.mjs +0 -126
  499. package/dist/api-contract-discovery/response-contract-handler-calls.d.mts +0 -3
  500. package/dist/api-contract-discovery/response-contract-handler-calls.mjs +0 -81
  501. package/dist/api-contract-discovery/response-contract-implicit-sources.test-helpers.d.mts +0 -145
  502. package/dist/api-contract-discovery/response-contract-implicit-sources.test-helpers.mjs +0 -145
  503. package/dist/api-contract-discovery/response-contract-implicit-variants.d.mts +0 -2
  504. package/dist/api-contract-discovery/response-contract-implicit-variants.mjs +0 -6
  505. package/dist/api-contract-discovery/response-contract-implicit.d.mts +0 -6
  506. package/dist/api-contract-discovery/response-contract-implicit.mjs +0 -120
  507. package/dist/api-contract-discovery/response-contract-lenient.d.mts +0 -41
  508. package/dist/api-contract-discovery/response-contract-lenient.mjs +0 -52
  509. package/dist/api-contract-discovery/response-contract-media.d.mts +0 -3
  510. package/dist/api-contract-discovery/response-contract-media.mjs +0 -46
  511. package/dist/api-contract-discovery/response-contract-object-symbols.d.mts +0 -3
  512. package/dist/api-contract-discovery/response-contract-object-symbols.mjs +0 -80
  513. package/dist/api-contract-discovery/response-contract-property-mutations.d.mts +0 -5
  514. package/dist/api-contract-discovery/response-contract-property-mutations.mjs +0 -84
  515. package/dist/api-contract-discovery/response-contract-registration.d.mts +0 -11
  516. package/dist/api-contract-discovery/response-contract-registration.mjs +0 -65
  517. package/dist/api-contract-discovery/response-contract-registry.d.mts +0 -7
  518. package/dist/api-contract-discovery/response-contract-registry.mjs +0 -124
  519. package/dist/api-contract-discovery/response-contract-route-analysis.d.mts +0 -12
  520. package/dist/api-contract-discovery/response-contract-route-analysis.mjs +0 -65
  521. package/dist/api-contract-discovery/response-contract-route-syntax.d.mts +0 -7
  522. package/dist/api-contract-discovery/response-contract-route-syntax.mjs +0 -41
  523. package/dist/api-contract-discovery/response-contract-status.d.mts +0 -27
  524. package/dist/api-contract-discovery/response-contract-status.mjs +0 -82
  525. package/dist/api-contract-discovery/response-contract-symbols.d.mts +0 -5
  526. package/dist/api-contract-discovery/response-contract-symbols.mjs +0 -82
  527. package/dist/api-contract-discovery/response-contract-types.d.mts +0 -23
  528. package/dist/api-contract-discovery/response-contract-types.mjs +0 -1
  529. package/dist/api-contract-discovery/test-setup.test-helpers.d.mts +0 -3
  530. package/dist/api-contract-discovery/test-setup.test-helpers.mjs +0 -2
  531. /package/dist/{api-contract-discovery/header-contract-types.mjs → post-publication-inventory/readers/public-view-options.mjs} +0 -0
  532. /package/dist/{api-contract-discovery/query-contract-types.mjs → post-publication-inventory/readers/source-options.mjs} +0 -0
@@ -1,79 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { unwrapExpression } from './protocol-marker-analysis.mjs';
3
- export function writeAccess(expression) {
4
- expression = unwrapExpression(expression);
5
- if (ts.isPropertyAccessExpression(expression))
6
- return { receiver: expression.expression, method: expression.name.text };
7
- if (!ts.isElementAccessExpression(expression))
8
- return undefined;
9
- const method = unwrapExpression(expression.argumentExpression);
10
- return {
11
- receiver: expression.expression,
12
- method: ts.isStringLiteralLike(method) ? method.text : undefined,
13
- };
14
- }
15
- export function reflectApplyInvocation(call, checker) {
16
- const expression = unwrapExpression(call.expression);
17
- if (!ts.isPropertyAccessExpression(expression) ||
18
- expression.name.text !== 'apply' ||
19
- !ts.isIdentifier(expression.expression) ||
20
- expression.expression.text !== 'Reflect')
21
- return undefined;
22
- const defaultApply = checker
23
- .getSymbolAtLocation(expression.name)
24
- ?.declarations?.some((declaration) => declaration.getSourceFile().fileName.endsWith('/lib.es2015.reflect.d.ts'));
25
- if (!defaultApply)
26
- return undefined;
27
- const target = call.arguments[0] && writeAccess(call.arguments[0]);
28
- const receiver = call.arguments[1];
29
- const payload = applyPayload(call.arguments[2], checker);
30
- if (target?.method === 'pipe') {
31
- const destination = payload?.[0];
32
- return {
33
- receiver: destination,
34
- method: 'write',
35
- rawBytes: payload === undefined || destination !== undefined,
36
- };
37
- }
38
- const method = target?.method === 'write' || target?.method === 'end' ? target.method : undefined;
39
- return {
40
- receiver,
41
- method,
42
- rawBytes: payload === undefined || hasRawBytes(method, payload, checker, true),
43
- };
44
- }
45
- export function indirectPayload(method, call, checker) {
46
- if (method === 'call')
47
- return call.arguments.slice(1);
48
- return applyPayload(call.arguments[1], checker);
49
- }
50
- function applyPayload(argument, checker) {
51
- if (!argument)
52
- return [];
53
- const value = unwrapExpression(argument);
54
- if (isNullish(argument, checker))
55
- return [];
56
- if (!ts.isArrayLiteralExpression(value) || value.elements.some(ts.isSpreadElement))
57
- return undefined;
58
- return value.elements.filter(ts.isExpression);
59
- }
60
- function isNullish(expression, checker) {
61
- const value = unwrapExpression(expression);
62
- if (value.kind === ts.SyntaxKind.NullKeyword)
63
- return true;
64
- if (ts.isIdentifier(value) && value.text === 'undefined')
65
- return true;
66
- const flags = checker.getTypeAtLocation(expression).flags;
67
- return !!(flags & (ts.TypeFlags.Undefined | ts.TypeFlags.Null));
68
- }
69
- export function hasRawBytes(method, payload, checker, indirect) {
70
- if (payload === undefined || method === undefined)
71
- return true;
72
- if (method === 'write')
73
- return !indirect || payload.length > 0;
74
- if (method !== 'end' || !payload[0])
75
- return false;
76
- const type = checker.getTypeAtLocation(payload[0]);
77
- return (!(type.flags & (ts.TypeFlags.Undefined | ts.TypeFlags.Null)) &&
78
- type.getCallSignatures().length === 0);
79
- }
@@ -1,5 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- /** Requires the last potentially preceding proven status setter to belong to this response. */
3
- export declare function statusDominatesEmission(emission: ts.CallExpression | ts.NewExpression, statuses: ReadonlySet<ts.CallExpression>, allStatuses?: ReadonlySet<ts.CallExpression>): boolean;
4
- /** Finds the last setter through unconditional blocks, excluding conditional compound statements. */
5
- export declare function unconditionalStatusSetter(statement: ts.Statement, statuses: ReadonlySet<ts.CallExpression>): ts.CallExpression | undefined;
@@ -1,35 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- /** Requires the last potentially preceding proven status setter to belong to this response. */
3
- export function statusDominatesEmission(emission, statuses, allStatuses = statuses) {
4
- let current = emission;
5
- while (current.parent && !ts.isFunctionLike(current.parent)) {
6
- const parent = current.parent;
7
- if (ts.isBlock(parent)) {
8
- const index = parent.statements.indexOf(current);
9
- for (const statement of parent.statements.slice(0, index).toReversed())
10
- if (containsStatus(statement, allStatuses)) {
11
- const setter = unconditionalStatusSetter(statement, allStatuses);
12
- return !!setter && statuses.has(setter);
13
- }
14
- }
15
- current = parent;
16
- }
17
- return false;
18
- }
19
- /** Finds the last setter through unconditional blocks, excluding conditional compound statements. */
20
- export function unconditionalStatusSetter(statement, statuses) {
21
- if (ts.isBlock(statement)) {
22
- for (const child of statement.statements.toReversed())
23
- if (containsStatus(child, statuses))
24
- return unconditionalStatusSetter(child, statuses);
25
- }
26
- else if (ts.isExpressionStatement(statement) &&
27
- ts.isCallExpression(statement.expression) &&
28
- statuses.has(statement.expression))
29
- return statement.expression;
30
- return undefined;
31
- }
32
- function containsStatus(node, statuses) {
33
- return ((ts.isCallExpression(node) && statuses.has(node)) ||
34
- (ts.forEachChild(node, (child) => containsStatus(child, statuses)) ?? false));
35
- }
@@ -1,9 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- export type WriteReceiver = {
3
- root: ts.Symbol;
4
- path: readonly string[];
5
- mutableAlias?: boolean;
6
- };
7
- export declare function writeReceiver(call: ts.CallExpression, checker: ts.TypeChecker): WriteReceiver | undefined;
8
- export declare function sameWriteReceiver(left: WriteReceiver, right: WriteReceiver | undefined): boolean;
9
- export declare function expressionReceiver(expression: ts.Expression, checker: ts.TypeChecker, active?: Set<ts.Symbol>): WriteReceiver | undefined;
@@ -1,79 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { unwrapExpression } from './protocol-marker-analysis.mjs';
3
- export function writeReceiver(call, checker) {
4
- const target = unwrapExpression(call.expression);
5
- if (!ts.isPropertyAccessExpression(target) || target.name.text !== 'write')
6
- return undefined;
7
- return expressionReceiver(target.expression, checker);
8
- }
9
- export function sameWriteReceiver(left, right) {
10
- return (right !== undefined &&
11
- left.root === right.root &&
12
- left.path.length === right.path.length &&
13
- left.path.every((part, index) => part === right.path[index]));
14
- }
15
- export function expressionReceiver(expression, checker, active = new Set()) {
16
- const value = unwrapExpression(expression);
17
- if (ts.isIdentifier(value)) {
18
- const symbol = checker.getSymbolAtLocation(value);
19
- if (!symbol)
20
- return undefined;
21
- return symbolReceiver(symbol, checker, active);
22
- }
23
- if (!ts.isPropertyAccessExpression(value))
24
- return undefined;
25
- const propertySymbol = checker.getSymbolAtLocation(value.name);
26
- if (propertySymbol && active.has(propertySymbol))
27
- return undefined;
28
- const property = literalProperty(value, checker) ?? propertySymbol?.valueDeclaration;
29
- const propertyActive = new Set(active);
30
- if (propertySymbol)
31
- propertyActive.add(propertySymbol);
32
- // Object literal properties remain writable even when their variable is const.
33
- // Track the original receiver for raw-write rejection; never trust a marked wrapper.
34
- if (property && ts.isPropertyAssignment(property)) {
35
- const receiver = expressionReceiver(property.initializer, checker, propertyActive);
36
- return receiver && { ...receiver, mutableAlias: true };
37
- }
38
- if (property && ts.isShorthandPropertyAssignment(property)) {
39
- const symbol = checker.getShorthandAssignmentValueSymbol(property);
40
- const receiver = symbol && symbolReceiver(symbol, checker, propertyActive);
41
- return receiver && { ...receiver, mutableAlias: true };
42
- }
43
- const parent = expressionReceiver(value.expression, checker, active);
44
- return parent ? { ...parent, path: [...parent.path, value.name.text] } : undefined;
45
- }
46
- function symbolReceiver(symbol, checker, active) {
47
- const root = symbol.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(symbol) : symbol;
48
- if (active.has(root))
49
- return undefined;
50
- const declaration = root.valueDeclaration;
51
- if (declaration &&
52
- ts.isVariableDeclaration(declaration) &&
53
- declaration.initializer &&
54
- ts.isVariableDeclarationList(declaration.parent)) {
55
- const initializer = unwrapExpression(declaration.initializer);
56
- if (ts.isIdentifier(initializer) || ts.isPropertyAccessExpression(initializer)) {
57
- const receiver = expressionReceiver(initializer, checker, new Set(active).add(root));
58
- return (receiver && {
59
- ...receiver,
60
- ...(!(declaration.parent.flags & ts.NodeFlags.Const) ? { mutableAlias: true } : {}),
61
- });
62
- }
63
- }
64
- return { root, path: [] };
65
- }
66
- function literalProperty(value, checker) {
67
- const base = unwrapExpression(value.expression);
68
- if (!ts.isIdentifier(base))
69
- return undefined;
70
- const declaration = checker.getSymbolAtLocation(base)?.valueDeclaration;
71
- if (!declaration || !ts.isVariableDeclaration(declaration) || !declaration.initializer)
72
- return undefined;
73
- const initializer = unwrapExpression(declaration.initializer);
74
- if (!ts.isObjectLiteralExpression(initializer))
75
- return undefined;
76
- return initializer.properties.find((member) => (ts.isPropertyAssignment(member) || ts.isShorthandPropertyAssignment(member)) &&
77
- ts.isIdentifier(member.name) &&
78
- member.name.text === value.name.text);
79
- }
@@ -1,3 +0,0 @@
1
- import type { QueryParameterContract } from './query-contract-types.mts';
2
- import ts from '../contract-schema/typescript-api.mts';
3
- export declare function extractQueryParameterDescriptor(type: ts.Type, checker: ts.TypeChecker, sourceFile: ts.SourceFile, node: ts.Node, parameterName: string): QueryParameterContract;
@@ -1,82 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { contractError } from './response-contract-registration.mjs';
3
- import { optionalNumberLiteral, declaresProperty, optionalTrueLiteral, optionalStringLiteral, requiredBooleanLiteral, requiredNumberLiteral, requiredPropertyType, rejectUnresolvedType, requiredStringLiteral, stringTuple, } from './query-contract-literals.mjs';
4
- export function extractQueryParameterDescriptor(type, checker, sourceFile, node, parameterName) {
5
- rejectUnresolvedType(type, failure(sourceFile, node, parameterName));
6
- const descriptor = extractDescriptorShape(type, checker, sourceFile, node, parameterName);
7
- if (!optionalTrueLiteral(type, 'required', checker, failure(sourceFile, node, parameterName))) {
8
- return descriptor;
9
- }
10
- if (declaresProperty(type, 'default')) {
11
- failure(sourceFile, node, parameterName)('required cannot be combined with default');
12
- }
13
- return { ...descriptor, required: true };
14
- }
15
- function failure(sourceFile, node, parameterName) {
16
- return (detail) => {
17
- throw contractError(sourceFile, node, `Malformed query parameter "${parameterName}": ${detail}`);
18
- };
19
- }
20
- function extractDescriptorShape(type, checker, sourceFile, node, parameterName) {
21
- const fail = failure(sourceFile, node, parameterName);
22
- const kind = requiredStringLiteral(type, 'kind', checker, fail);
23
- const description = optionalStringLiteral(type, 'description', checker, node, fail);
24
- const options = description === undefined ? {} : { description };
25
- if (kind === 'string') {
26
- const format = optionalStringLiteral(type, 'format', checker, node, fail);
27
- if (format === 'uuid')
28
- return { kind, format, ...options };
29
- if (format === 'uri')
30
- return { kind, format, ...options };
31
- if (format !== undefined)
32
- fail('unsupported format');
33
- return { kind, ...options };
34
- }
35
- if (kind === 'uuid-or-uri' ||
36
- kind === 'boolean' ||
37
- kind === 'nullable-boolean' ||
38
- kind === 'number') {
39
- return { kind, ...options };
40
- }
41
- if (kind === 'integer') {
42
- const minimum = requiredNumberLiteral(type, 'minimum', checker, fail);
43
- const maximum = requiredNumberLiteral(type, 'maximum', checker, fail);
44
- const defaultValue = optionalNumberLiteral(type, 'default', checker, node, fail);
45
- return {
46
- kind,
47
- minimum,
48
- maximum,
49
- ...(defaultValue === undefined ? {} : { default: defaultValue }),
50
- ...options,
51
- };
52
- }
53
- if (kind === 'enum') {
54
- const values = stringTuple(type, 'values', checker, fail);
55
- const defaultValue = optionalStringLiteral(type, 'default', checker, node, fail);
56
- if (defaultValue !== undefined && !values.includes(defaultValue)) {
57
- fail('default must be one of values');
58
- }
59
- return {
60
- kind,
61
- values,
62
- ...(defaultValue === undefined ? {} : { default: defaultValue }),
63
- ...options,
64
- };
65
- }
66
- if (kind === 'csv-array') {
67
- if (requiredStringLiteral(type, 'style', checker, fail) !== 'form')
68
- fail('style must be form');
69
- if (requiredBooleanLiteral(type, 'explode', checker, fail) !== false)
70
- fail('explode must be false');
71
- const itemType = requiredPropertyType(type, 'items', checker, fail);
72
- rejectUnresolvedType(itemType, fail);
73
- if (declaresProperty(itemType, 'required'))
74
- fail('array items cannot be required');
75
- const items = extractDescriptorShape(itemType, checker, sourceFile, node, `${parameterName}[]`);
76
- if (items.kind === 'string' || items.kind === 'enum') {
77
- return { kind, items, style: 'form', explode: false, ...options };
78
- }
79
- return fail('array items must be string or enum');
80
- }
81
- return fail(`unsupported kind "${kind}"`);
82
- }
@@ -1,13 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- export declare function requiredPropertyType(type: ts.Type, name: string, checker: ts.TypeChecker, fail: (detail: string) => never): ts.Type;
3
- export declare function requiredStringLiteral(type: ts.Type, name: string, checker: ts.TypeChecker, fail: (detail: string) => never): string;
4
- export declare function requiredNumberLiteral(type: ts.Type, name: string, checker: ts.TypeChecker, fail: (detail: string) => never): number;
5
- export declare function requiredBooleanLiteral(type: ts.Type, name: string, checker: ts.TypeChecker, fail: (detail: string) => never): boolean;
6
- export declare function optionalStringLiteral(type: ts.Type, name: string, checker: ts.TypeChecker, node: ts.Node, fail: (detail: string) => never): string | undefined;
7
- export declare function optionalNumberLiteral(type: ts.Type, name: string, checker: ts.TypeChecker, node: ts.Node, fail: (detail: string) => never): number | undefined;
8
- export declare function optionalTrueLiteral(type: ts.Type, name: string, checker: ts.TypeChecker, fail: (detail: string) => never): boolean;
9
- /** True when the type, or any member of a union type, declares the property. */
10
- export declare function declaresProperty(type: ts.Type, name: string): boolean;
11
- export declare function stringTuple(type: ts.Type, name: string, checker: ts.TypeChecker, fail: (detail: string) => never): readonly string[];
12
- /** Fails when the type, or any union/intersection constituent, is conditional or generic. */
13
- export declare function rejectUnresolvedType(type: ts.Type, fail: (detail: string) => never): void;
@@ -1,83 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- export function requiredPropertyType(type, name, checker, fail) {
3
- const property = type.getProperty(name);
4
- if (!property || property.flags & ts.SymbolFlags.Optional)
5
- return fail(`requires literal ${name}`);
6
- const location = property.valueDeclaration ?? property.declarations?.[0];
7
- if (!location)
8
- return fail(`requires declared ${name}`);
9
- return checker.getTypeOfSymbolAtLocation(property, location);
10
- }
11
- export function requiredStringLiteral(type, name, checker, fail) {
12
- const value = requiredPropertyType(type, name, checker, fail);
13
- return value.isStringLiteral() ? value.value : fail(`requires literal ${name}`);
14
- }
15
- export function requiredNumberLiteral(type, name, checker, fail) {
16
- const value = requiredPropertyType(type, name, checker, fail);
17
- return value.isNumberLiteral() ? value.value : fail(`requires literal ${name}`);
18
- }
19
- export function requiredBooleanLiteral(type, name, checker, fail) {
20
- const value = requiredPropertyType(type, name, checker, fail);
21
- if (value.flags & ts.TypeFlags.BooleanLiteral)
22
- return checker.typeToString(value) === 'true';
23
- return fail(`requires literal ${name}`);
24
- }
25
- export function optionalStringLiteral(type, name, checker, node, fail) {
26
- const property = type.getProperty(name);
27
- if (!property)
28
- return undefined;
29
- if (property.flags & ts.SymbolFlags.Optional)
30
- return fail(`${name} must be literal when present`);
31
- const location = property.valueDeclaration ?? property.declarations?.[0] ?? node;
32
- const value = checker.getTypeOfSymbolAtLocation(property, location);
33
- return value.isStringLiteral() ? value.value : fail(`requires literal ${name}`);
34
- }
35
- export function optionalNumberLiteral(type, name, checker, node, fail) {
36
- const property = type.getProperty(name);
37
- if (!property)
38
- return undefined;
39
- if (property.flags & ts.SymbolFlags.Optional)
40
- return fail(`${name} must be literal when present`);
41
- const location = property.valueDeclaration ?? property.declarations?.[0] ?? node;
42
- const value = checker.getTypeOfSymbolAtLocation(property, location);
43
- return value.isNumberLiteral() ? value.value : fail(`requires literal ${name}`);
44
- }
45
- export function optionalTrueLiteral(type, name, checker, fail) {
46
- const property = type.getProperty(name);
47
- if (!property) {
48
- if (declaresProperty(type, name))
49
- return fail(`${name} must be present on every union member`);
50
- return false;
51
- }
52
- if (property.flags & ts.SymbolFlags.Optional)
53
- return fail(`${name} must be literal when present`);
54
- const value = requiredPropertyType(type, name, checker, fail);
55
- const isTrue = value.flags & ts.TypeFlags.BooleanLiteral && checker.typeToString(value) === 'true';
56
- return isTrue ? true : fail(`${name} must be the literal true`);
57
- }
58
- /** True when the type, or any member of a union type, declares the property. */
59
- export function declaresProperty(type, name) {
60
- if (type.getProperty(name))
61
- return true;
62
- return type.isUnion() && type.types.some((member) => member.getProperty(name) !== undefined);
63
- }
64
- export function stringTuple(type, name, checker, fail) {
65
- const value = requiredPropertyType(type, name, checker, fail);
66
- if (!checker.isTupleType(value))
67
- return fail(`${name} must be a literal tuple`);
68
- const values = checker.getTypeArguments(value);
69
- if (values.length === 0 || values.some((item) => !item.isStringLiteral())) {
70
- return fail(`${name} must contain string literals`);
71
- }
72
- return values.map((item) => item.value);
73
- }
74
- /** Fails when the type, or any union/intersection constituent, is conditional or generic. */
75
- export function rejectUnresolvedType(type, fail) {
76
- if (type.flags & (ts.TypeFlags.Conditional | ts.TypeFlags.Instantiable)) {
77
- fail('descriptor must not contain unresolved conditional or generic types');
78
- }
79
- if (type.isUnionOrIntersection()) {
80
- for (const member of type.types)
81
- rejectUnresolvedType(member, fail);
82
- }
83
- }
@@ -1,3 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import type { BackendQueryContractRegistry } from './query-contract-types.mts';
3
- export declare function discoverApiQueryContracts(program: ts.Program, sourceFiles: readonly ts.SourceFile[], knownResponseRoutes: ReadonlySet<string>): BackendQueryContractRegistry;
@@ -1,70 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { registerPlatformCompilerLibraries } from './protocol-platform-callbacks.mjs';
3
- import { extractQueryParameterDescriptor } from './query-contract-extraction.mjs';
4
- import { contractError } from './response-contract-registration.mjs';
5
- import { collectHandlerBindings, enclosingRouteBinding, visit, } from './response-contract-route-analysis.mjs';
6
- export function discoverApiQueryContracts(program, sourceFiles, knownResponseRoutes) {
7
- registerPlatformCompilerLibraries(program);
8
- const checker = program.getTypeChecker();
9
- const handlerBindings = collectHandlerBindings(sourceFiles, checker);
10
- const contracts = new Map();
11
- const knownOperations = new Set([...knownResponseRoutes].map((key) => key.split('#')[0]));
12
- for (const sourceFile of sourceFiles) {
13
- visit(sourceFile, (node) => {
14
- if (!ts.isCallExpression(node) || !isApiQueryMarker(node.expression))
15
- return;
16
- const keyNode = node.arguments[0];
17
- if (!keyNode || !ts.isStringLiteral(keyNode)) {
18
- throw contractError(sourceFile, node, 'apiQuery requires a literal operation key');
19
- }
20
- const binding = enclosingRouteBinding(node, checker, handlerBindings);
21
- if (!binding)
22
- throw contractError(sourceFile, node, 'apiQuery must be inside an app.route handler');
23
- const expectedKey = `${binding.method}:${binding.routeTemplate}`;
24
- if (keyNode.text !== expectedKey) {
25
- throw contractError(sourceFile, keyNode, `Query operation key "${keyNode.text}" does not match enclosing route ${expectedKey}`);
26
- }
27
- if (!knownOperations.has(expectedKey)) {
28
- throw contractError(sourceFile, keyNode, `apiQuery references unknown response route ${expectedKey}`);
29
- }
30
- if (contracts.has(expectedKey)) {
31
- throw contractError(sourceFile, keyNode, `Duplicate apiQuery marker for ${expectedKey}`);
32
- }
33
- if (node.arguments.length < 2) {
34
- throw contractError(sourceFile, node, 'apiQuery requires at least one query contract carrier');
35
- }
36
- const parameters = Object.create(null);
37
- for (const carrier of node.arguments.slice(1)) {
38
- const carrierType = checker.getTypeAtLocation(carrier);
39
- const queryContractSymbol = carrierType.getProperty('queryContract');
40
- if (!queryContractSymbol || queryContractSymbol.flags & ts.SymbolFlags.Optional) {
41
- throw contractError(sourceFile, carrier, 'apiQuery carrier requires a queryContract property');
42
- }
43
- const queryContractType = checker.getTypeOfSymbolAtLocation(queryContractSymbol, carrier);
44
- if (queryContractType.getStringIndexType()) {
45
- throw contractError(sourceFile, carrier, 'apiQuery queryContract keys must be literal names');
46
- }
47
- const properties = queryContractType.getProperties();
48
- if (properties.length === 0) {
49
- throw contractError(sourceFile, carrier, 'apiQuery queryContract must define parameters');
50
- }
51
- for (const property of properties) {
52
- const name = property.getName();
53
- if (property.flags & ts.SymbolFlags.Optional) {
54
- throw contractError(sourceFile, carrier, `Query parameter "${name}" must not be optional`);
55
- }
56
- if (Object.hasOwn(parameters, name)) {
57
- throw contractError(sourceFile, carrier, `Duplicate query parameter contract: ${name}`);
58
- }
59
- const descriptorType = checker.getTypeOfSymbolAtLocation(property, carrier);
60
- parameters[name] = extractQueryParameterDescriptor(descriptorType, checker, sourceFile, carrier, name);
61
- }
62
- }
63
- contracts.set(expectedKey, { ...binding, parameters });
64
- });
65
- }
66
- return Object.fromEntries([...contracts.entries()].toSorted(([left], [right]) => left.localeCompare(right)));
67
- }
68
- function isApiQueryMarker(expression) {
69
- return ts.isIdentifier(expression) && expression.text === 'apiQuery';
70
- }
@@ -1,8 +0,0 @@
1
- import type { OpenApiQueryContract, OpenApiQueryParameter } from '../openapi-document/index.mts';
2
- export type QueryParameterContract = OpenApiQueryParameter;
3
- export type BackendQueryContract = {
4
- method: string;
5
- routeTemplate: string;
6
- parameters: OpenApiQueryContract;
7
- };
8
- export type BackendQueryContractRegistry = Readonly<Record<string, BackendQueryContract>>;
@@ -1,4 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- import type { ProtocolCache } from './protocol-analysis-cache.mts';
3
- /** Helper and factory parameter bindings must remain unchanged in their declaring source. */
4
- export declare function hasBindingWrite(declaration: ts.FunctionDeclaration | ts.ParameterDeclaration, checker: ts.TypeChecker, cache?: ProtocolCache): boolean;
@@ -1,47 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- /** Every symbol assigned, updated, or looped over in the source file, found in one scan. */
3
- function writtenSymbols(sourceFile, checker) {
4
- const written = new Set();
5
- const referencesBinding = (node) => {
6
- // Index expressions and computed property names read their keys, not write them.
7
- // inspect still visits these expressions separately to detect nested side-effect writes.
8
- if (ts.isComputedPropertyName(node))
9
- return;
10
- if (ts.isElementAccessExpression(node)) {
11
- referencesBinding(node.expression);
12
- return;
13
- }
14
- if (ts.isIdentifier(node))
15
- written.add(checker.getSymbolAtLocation(node));
16
- node.forEachChild(referencesBinding);
17
- };
18
- const inspect = (node) => {
19
- if (ts.isBinaryExpression(node) &&
20
- node.operatorToken.kind >= ts.SyntaxKind.FirstAssignment &&
21
- node.operatorToken.kind <= ts.SyntaxKind.LastAssignment)
22
- referencesBinding(node.left);
23
- if ((ts.isPrefixUnaryExpression(node) || ts.isPostfixUnaryExpression(node)) &&
24
- (node.operator === ts.SyntaxKind.PlusPlusToken ||
25
- node.operator === ts.SyntaxKind.MinusMinusToken))
26
- referencesBinding(node.operand);
27
- if (ts.isForOfStatement(node) || ts.isForInStatement(node))
28
- referencesBinding(node.initializer);
29
- node.forEachChild(inspect);
30
- };
31
- inspect(sourceFile);
32
- return written;
33
- }
34
- /** Helper and factory parameter bindings must remain unchanged in their declaring source. */
35
- export function hasBindingWrite(declaration, checker, cache) {
36
- if (!declaration.name)
37
- return false;
38
- if (!ts.isIdentifier(declaration.name))
39
- return true;
40
- const sourceFile = declaration.getSourceFile();
41
- let written = cache?.writtenSymbols.get(sourceFile);
42
- if (!written) {
43
- written = writtenSymbols(sourceFile, checker);
44
- cache?.writtenSymbols.set(sourceFile, written);
45
- }
46
- return written.has(checker.getSymbolAtLocation(declaration.name));
47
- }
@@ -1,10 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- export type RegisteredRoute = {
3
- method: string;
4
- routeTemplate: string;
5
- kind: 'ordinary' | 'sse' | 'error-only' | 'fixed-no-content';
6
- fixedStatus?: number;
7
- source: string;
8
- };
9
- export declare const routeShape: (routeTemplate: string) => string;
10
- export declare function discoverRegisteredRoutes(program: ts.Program, sourceFiles: readonly ts.SourceFile[]): RegisteredRoute[];
@@ -1,85 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mjs';
2
- import { handlerNodes } from './registered-route-handler-analysis.mjs';
3
- import { isTerminal405Handler } from './registered-route-terminal-error.mjs';
4
- import { propertyName, routeTemplateFromExpression, visit, } from './response-contract-route-analysis.mjs';
5
- export const routeShape = (routeTemplate) => routeTemplate.replace(/:[^/]+/g, ':');
6
- export function discoverRegisteredRoutes(program, sourceFiles) {
7
- const checker = program.getTypeChecker();
8
- const routes = [];
9
- const registrations = new Map();
10
- sourceFiles.forEach((sourceFile) => {
11
- visit(sourceFile, (node) => {
12
- if (!ts.isCallExpression(node))
13
- return;
14
- const method = propertyName(node.expression)?.toUpperCase();
15
- if (!method || !['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].includes(method))
16
- return;
17
- const routeTemplate = routeTemplateFromExpression(node.expression);
18
- if (!routeTemplate)
19
- return;
20
- const key = `${method}:${routeShape(routeTemplate)}`;
21
- const source = `${sourceFile.fileName}:${sourceFile.getLineAndCharacterOfPosition(node.getStart()).line + 1}`;
22
- const classification = classifyHandler(node, checker, method, routeTemplate);
23
- const route = {
24
- method,
25
- routeTemplate,
26
- ...classification,
27
- source,
28
- };
29
- const existing = registrations.get(key);
30
- if (existing)
31
- throw new Error(`Duplicate registered API route ${key} at ${existing.source} and ${source}`);
32
- registrations.set(key, route);
33
- routes.push(route);
34
- });
35
- });
36
- return routes.toSorted((left, right) => `${left.method}:${left.routeTemplate}`.localeCompare(`${right.method}:${right.routeTemplate}`));
37
- }
38
- function classifyHandler(call, checker, method, routeTemplate) {
39
- const nodes = call.arguments.flatMap((argument) => handlerNodes(argument, checker));
40
- if (nodes.length === 0)
41
- throw new Error(`Cannot inspect registered route handler ${method}:${routeTemplate}`);
42
- let sse = false;
43
- const proofGroups = call.arguments
44
- .filter((argument) => !ts.isStringLiteral(argument))
45
- .map((argument) => {
46
- const proofs = [];
47
- const nodes = handlerNodes(argument, checker, new Map(), new Set(), true, proofs);
48
- return nodes.some(ts.isFunctionLike) ? proofs : [];
49
- });
50
- const error405 = proofGroups.length > 0 &&
51
- proofGroups.every((handlers) => handlers.length > 0 &&
52
- handlers.every((proof) => isTerminal405Handler(proof.node, checker, proof.bindings)));
53
- let fixedStatus;
54
- nodes.forEach((node) => {
55
- visit(node, (child) => {
56
- if (!ts.isCallExpression(child))
57
- return;
58
- if (ts.isIdentifier(child.expression) && child.expression.text === 'apiOpenApiNoContent') {
59
- const [key, status] = child.arguments;
60
- if (!key || !ts.isStringLiteral(key) || key.text !== `${method}:${routeTemplate}`)
61
- throw new Error(`apiOpenApiNoContent key must match registered route ${method}:${routeTemplate}`);
62
- if (!status || !ts.isNumericLiteral(status))
63
- throw new Error('apiOpenApiNoContent status requires a numeric literal');
64
- const value = Number(status.text);
65
- if (fixedStatus !== undefined && fixedStatus !== value)
66
- throw new Error(`Conflicting apiOpenApiNoContent statuses for ${method}:${routeTemplate}`);
67
- fixedStatus = value;
68
- }
69
- if (ts.isIdentifier(child.expression) && child.expression.text === 'startSSE')
70
- sse = true;
71
- if (ts.isPropertyAccessExpression(child.expression) &&
72
- child.expression.name.text === 'setType' &&
73
- child.arguments[0] &&
74
- ts.isStringLiteral(child.arguments[0]) &&
75
- child.arguments[0].text.toLowerCase() === 'text/event-stream')
76
- sse = true;
77
- });
78
- });
79
- if (fixedStatus !== undefined) {
80
- if (sse)
81
- throw new Error(`apiOpenApiNoContent conflicts with SSE response handling for ${method}:${routeTemplate}`);
82
- return { kind: 'fixed-no-content', fixedStatus };
83
- }
84
- return { kind: sse ? 'sse' : error405 ? 'error-only' : 'ordinary' };
85
- }
@@ -1,3 +0,0 @@
1
- import ts from '../contract-schema/typescript-api.mts';
2
- export declare function returnedExpressions(declaration: ts.FunctionLikeDeclaration): (ts.Expression | undefined)[];
3
- export declare function returnsOnEveryPath(node: ts.ConciseBody | ts.Statement): boolean;