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