@noodleseed/one 0.16.0 → 0.18.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 (348) hide show
  1. package/dist/cli.d.ts.map +1 -1
  2. package/dist/cli.js +52 -5
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/alerts-ops.d.ts +2 -0
  5. package/dist/commands/alerts-ops.d.ts.map +1 -0
  6. package/dist/commands/alerts-ops.js +249 -0
  7. package/dist/commands/alerts-ops.js.map +1 -0
  8. package/dist/commands/analytics-ops.d.ts +13 -0
  9. package/dist/commands/analytics-ops.d.ts.map +1 -1
  10. package/dist/commands/analytics-ops.js +5 -2
  11. package/dist/commands/analytics-ops.js.map +1 -1
  12. package/dist/commands/apps-ops.d.ts +17 -0
  13. package/dist/commands/apps-ops.d.ts.map +1 -0
  14. package/dist/commands/apps-ops.js +285 -0
  15. package/dist/commands/apps-ops.js.map +1 -0
  16. package/dist/commands/archive-ops.js +2 -2
  17. package/dist/commands/archive-ops.js.map +1 -1
  18. package/dist/commands/catalog-data-config.d.ts +9 -0
  19. package/dist/commands/catalog-data-config.d.ts.map +1 -0
  20. package/dist/commands/catalog-data-config.js +67 -0
  21. package/dist/commands/catalog-data-config.js.map +1 -0
  22. package/dist/commands/catalog-data-core.d.ts +13 -0
  23. package/dist/commands/catalog-data-core.d.ts.map +1 -0
  24. package/dist/commands/catalog-data-core.js +354 -0
  25. package/dist/commands/catalog-data-core.js.map +1 -0
  26. package/dist/commands/catalog-data-resources.d.ts +8 -0
  27. package/dist/commands/catalog-data-resources.d.ts.map +1 -0
  28. package/dist/commands/catalog-data-resources.js +551 -0
  29. package/dist/commands/catalog-data-resources.js.map +1 -0
  30. package/dist/commands/catalog-dispatch.d.ts +15 -0
  31. package/dist/commands/catalog-dispatch.d.ts.map +1 -0
  32. package/dist/commands/catalog-dispatch.js +95 -0
  33. package/dist/commands/catalog-dispatch.js.map +1 -0
  34. package/dist/commands/catalog-render.d.ts +28 -0
  35. package/dist/commands/catalog-render.d.ts.map +1 -0
  36. package/dist/commands/catalog-render.js +142 -0
  37. package/dist/commands/catalog-render.js.map +1 -0
  38. package/dist/commands/catalog-types.d.ts +46 -0
  39. package/dist/commands/catalog-types.d.ts.map +1 -0
  40. package/dist/commands/catalog-types.js +7 -0
  41. package/dist/commands/catalog-types.js.map +1 -0
  42. package/dist/commands/catalog.d.ts +30 -0
  43. package/dist/commands/catalog.d.ts.map +1 -0
  44. package/dist/commands/catalog.js +108 -0
  45. package/dist/commands/catalog.js.map +1 -0
  46. package/dist/commands/commands-ops.d.ts +2 -0
  47. package/dist/commands/commands-ops.d.ts.map +1 -0
  48. package/dist/commands/commands-ops.js +19 -0
  49. package/dist/commands/commands-ops.js.map +1 -0
  50. package/dist/commands/deploy-ops.d.ts +45 -3
  51. package/dist/commands/deploy-ops.d.ts.map +1 -1
  52. package/dist/commands/deploy-ops.js +200 -227
  53. package/dist/commands/deploy-ops.js.map +1 -1
  54. package/dist/commands/deploy-status-ops.d.ts +13 -0
  55. package/dist/commands/deploy-status-ops.d.ts.map +1 -0
  56. package/dist/commands/deploy-status-ops.js +252 -0
  57. package/dist/commands/deploy-status-ops.js.map +1 -0
  58. package/dist/commands/deployments-ops.d.ts +30 -0
  59. package/dist/commands/deployments-ops.d.ts.map +1 -0
  60. package/dist/commands/deployments-ops.js +248 -0
  61. package/dist/commands/deployments-ops.js.map +1 -0
  62. package/dist/commands/envs-ops.d.ts +8 -0
  63. package/dist/commands/envs-ops.d.ts.map +1 -0
  64. package/dist/commands/envs-ops.js +240 -0
  65. package/dist/commands/envs-ops.js.map +1 -0
  66. package/dist/commands/github-ops.d.ts +15 -0
  67. package/dist/commands/github-ops.d.ts.map +1 -0
  68. package/dist/commands/github-ops.js +316 -0
  69. package/dist/commands/github-ops.js.map +1 -0
  70. package/dist/commands/github-runs-ops.d.ts +32 -0
  71. package/dist/commands/github-runs-ops.d.ts.map +1 -0
  72. package/dist/commands/github-runs-ops.js +132 -0
  73. package/dist/commands/github-runs-ops.js.map +1 -0
  74. package/dist/commands/github-shared.d.ts +60 -0
  75. package/dist/commands/github-shared.d.ts.map +1 -0
  76. package/dist/commands/github-shared.js +175 -0
  77. package/dist/commands/github-shared.js.map +1 -0
  78. package/dist/commands/org-admin.d.ts.map +1 -1
  79. package/dist/commands/org-admin.js +223 -43
  80. package/dist/commands/org-admin.js.map +1 -1
  81. package/dist/commands/output.d.ts +35 -0
  82. package/dist/commands/output.d.ts.map +1 -0
  83. package/dist/commands/output.js +34 -0
  84. package/dist/commands/output.js.map +1 -0
  85. package/dist/commands/resource-shared.d.ts +132 -0
  86. package/dist/commands/resource-shared.d.ts.map +1 -0
  87. package/dist/commands/resource-shared.js +159 -0
  88. package/dist/commands/resource-shared.js.map +1 -0
  89. package/dist/commands/session.d.ts +6 -9
  90. package/dist/commands/session.d.ts.map +1 -1
  91. package/dist/commands/session.js +42 -116
  92. package/dist/commands/session.js.map +1 -1
  93. package/dist/commands/shared.d.ts.map +1 -1
  94. package/dist/commands/shared.js +3 -91
  95. package/dist/commands/shared.js.map +1 -1
  96. package/dist/commands/target-picker.d.ts +44 -0
  97. package/dist/commands/target-picker.d.ts.map +1 -0
  98. package/dist/commands/target-picker.js +88 -0
  99. package/dist/commands/target-picker.js.map +1 -0
  100. package/dist/commands/update-ops.js +1 -1
  101. package/dist/diagnostics.d.ts +5 -0
  102. package/dist/diagnostics.d.ts.map +1 -1
  103. package/dist/diagnostics.js +1 -1
  104. package/dist/diagnostics.js.map +1 -1
  105. package/dist/doctor.d.ts.map +1 -1
  106. package/dist/doctor.js +33 -0
  107. package/dist/doctor.js.map +1 -1
  108. package/dist/fire.d.ts +94 -0
  109. package/dist/fire.d.ts.map +1 -0
  110. package/dist/fire.js +418 -0
  111. package/dist/fire.js.map +1 -0
  112. package/dist/flavor.d.ts +19 -0
  113. package/dist/flavor.d.ts.map +1 -0
  114. package/dist/flavor.js +95 -0
  115. package/dist/flavor.js.map +1 -0
  116. package/dist/project.js +2 -2
  117. package/dist/prompts.d.ts.map +1 -1
  118. package/dist/prompts.js +30 -17
  119. package/dist/prompts.js.map +1 -1
  120. package/dist/relative-time.d.ts +8 -0
  121. package/dist/relative-time.d.ts.map +1 -0
  122. package/dist/relative-time.js +29 -0
  123. package/dist/relative-time.js.map +1 -0
  124. package/dist/table.d.ts +47 -0
  125. package/dist/table.d.ts.map +1 -0
  126. package/dist/table.js +152 -0
  127. package/dist/table.js.map +1 -0
  128. package/dist/update-binary.js +1 -1
  129. package/dist/update-check.d.ts +1 -1
  130. package/dist/update-check.js +1 -1
  131. package/dist/update.js +1 -1
  132. package/dist/watch.d.ts +52 -0
  133. package/dist/watch.d.ts.map +1 -0
  134. package/dist/watch.js +177 -0
  135. package/dist/watch.js.map +1 -0
  136. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.d.ts.map +1 -1
  137. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js +28 -1
  138. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js.map +1 -1
  139. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.d.ts.map +1 -1
  140. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +6 -0
  141. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js.map +1 -1
  142. package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
  143. package/node_modules/@noodle-borg/authoring/dist/connectors.js +14 -0
  144. package/node_modules/@noodle-borg/authoring/dist/connectors.js.map +1 -1
  145. package/node_modules/@noodle-borg/authoring/dist/recording.js +18 -23
  146. package/node_modules/@noodle-borg/authoring/dist/recording.js.map +1 -1
  147. package/node_modules/@noodle-borg/connector-defs/dist/compile.js +9 -0
  148. package/node_modules/@noodle-borg/connector-defs/dist/compile.js.map +1 -1
  149. package/node_modules/@noodle-borg/openapi-import/dist/index.d.ts.map +1 -1
  150. package/node_modules/@noodle-borg/openapi-import/dist/index.js +3 -1
  151. package/node_modules/@noodle-borg/openapi-import/dist/index.js.map +1 -1
  152. package/node_modules/@noodle-borg/service/dist/alert-evaluator.d.ts +57 -0
  153. package/node_modules/@noodle-borg/service/dist/alert-evaluator.d.ts.map +1 -0
  154. package/node_modules/@noodle-borg/service/dist/alert-evaluator.js +158 -0
  155. package/node_modules/@noodle-borg/service/dist/alert-evaluator.js.map +1 -0
  156. package/node_modules/@noodle-borg/service/dist/alert-webhook.d.ts +72 -0
  157. package/node_modules/@noodle-borg/service/dist/alert-webhook.d.ts.map +1 -0
  158. package/node_modules/@noodle-borg/service/dist/alert-webhook.js +138 -0
  159. package/node_modules/@noodle-borg/service/dist/alert-webhook.js.map +1 -0
  160. package/node_modules/@noodle-borg/service/dist/github/app-client.d.ts +49 -0
  161. package/node_modules/@noodle-borg/service/dist/github/app-client.d.ts.map +1 -0
  162. package/node_modules/@noodle-borg/service/dist/github/app-client.js +23 -0
  163. package/node_modules/@noodle-borg/service/dist/github/app-client.js.map +1 -0
  164. package/node_modules/@noodle-borg/service/dist/github/install-nonce.d.ts +23 -0
  165. package/node_modules/@noodle-borg/service/dist/github/install-nonce.d.ts.map +1 -0
  166. package/node_modules/@noodle-borg/service/dist/github/install-nonce.js +57 -0
  167. package/node_modules/@noodle-borg/service/dist/github/install-nonce.js.map +1 -0
  168. package/node_modules/@noodle-borg/service/dist/github/pending-installations.d.ts +38 -0
  169. package/node_modules/@noodle-borg/service/dist/github/pending-installations.d.ts.map +1 -0
  170. package/node_modules/@noodle-borg/service/dist/github/pending-installations.js +41 -0
  171. package/node_modules/@noodle-borg/service/dist/github/pending-installations.js.map +1 -0
  172. package/node_modules/@noodle-borg/service/dist/index.d.ts +15 -1
  173. package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
  174. package/node_modules/@noodle-borg/service/dist/index.js +15 -1
  175. package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
  176. package/node_modules/@noodle-borg/service/dist/options.d.ts +47 -1
  177. package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
  178. package/node_modules/@noodle-borg/service/dist/registry-state.d.ts +28 -7
  179. package/node_modules/@noodle-borg/service/dist/registry-state.d.ts.map +1 -1
  180. package/node_modules/@noodle-borg/service/dist/registry-state.js +116 -3
  181. package/node_modules/@noodle-borg/service/dist/registry-state.js.map +1 -1
  182. package/node_modules/@noodle-borg/service/dist/registry.d.ts +14 -1
  183. package/node_modules/@noodle-borg/service/dist/registry.d.ts.map +1 -1
  184. package/node_modules/@noodle-borg/service/dist/registry.js +20 -45
  185. package/node_modules/@noodle-borg/service/dist/registry.js.map +1 -1
  186. package/node_modules/@noodle-borg/service/dist/routes/alerts-dispatch.d.ts +28 -0
  187. package/node_modules/@noodle-borg/service/dist/routes/alerts-dispatch.d.ts.map +1 -0
  188. package/node_modules/@noodle-borg/service/dist/routes/alerts-dispatch.js +50 -0
  189. package/node_modules/@noodle-borg/service/dist/routes/alerts-dispatch.js.map +1 -0
  190. package/node_modules/@noodle-borg/service/dist/routes/alerts.d.ts +39 -0
  191. package/node_modules/@noodle-borg/service/dist/routes/alerts.d.ts.map +1 -0
  192. package/node_modules/@noodle-borg/service/dist/routes/alerts.js +204 -0
  193. package/node_modules/@noodle-borg/service/dist/routes/alerts.js.map +1 -0
  194. package/node_modules/@noodle-borg/service/dist/routes/analytics-dispatch.d.ts +23 -0
  195. package/node_modules/@noodle-borg/service/dist/routes/analytics-dispatch.d.ts.map +1 -0
  196. package/node_modules/@noodle-borg/service/dist/routes/analytics-dispatch.js +53 -0
  197. package/node_modules/@noodle-borg/service/dist/routes/analytics-dispatch.js.map +1 -0
  198. package/node_modules/@noodle-borg/service/dist/routes/apps.d.ts +24 -0
  199. package/node_modules/@noodle-borg/service/dist/routes/apps.d.ts.map +1 -0
  200. package/node_modules/@noodle-borg/service/dist/routes/apps.js +72 -0
  201. package/node_modules/@noodle-borg/service/dist/routes/apps.js.map +1 -0
  202. package/node_modules/@noodle-borg/service/dist/routes/contracts.d.ts +465 -0
  203. package/node_modules/@noodle-borg/service/dist/routes/contracts.d.ts.map +1 -0
  204. package/node_modules/@noodle-borg/service/dist/routes/contracts.js +233 -0
  205. package/node_modules/@noodle-borg/service/dist/routes/contracts.js.map +1 -0
  206. package/node_modules/@noodle-borg/service/dist/routes/deployments.d.ts +12 -1
  207. package/node_modules/@noodle-borg/service/dist/routes/deployments.d.ts.map +1 -1
  208. package/node_modules/@noodle-borg/service/dist/routes/deployments.js +31 -2
  209. package/node_modules/@noodle-borg/service/dist/routes/deployments.js.map +1 -1
  210. package/node_modules/@noodle-borg/service/dist/routes/endpoint-enrichment.d.ts +17 -0
  211. package/node_modules/@noodle-borg/service/dist/routes/endpoint-enrichment.d.ts.map +1 -0
  212. package/node_modules/@noodle-borg/service/dist/routes/endpoint-enrichment.js +15 -0
  213. package/node_modules/@noodle-borg/service/dist/routes/endpoint-enrichment.js.map +1 -0
  214. package/node_modules/@noodle-borg/service/dist/routes/envs.d.ts +22 -0
  215. package/node_modules/@noodle-borg/service/dist/routes/envs.d.ts.map +1 -0
  216. package/node_modules/@noodle-borg/service/dist/routes/envs.js +46 -0
  217. package/node_modules/@noodle-borg/service/dist/routes/envs.js.map +1 -0
  218. package/node_modules/@noodle-borg/service/dist/routes/github-connection.d.ts +29 -0
  219. package/node_modules/@noodle-borg/service/dist/routes/github-connection.d.ts.map +1 -0
  220. package/node_modules/@noodle-borg/service/dist/routes/github-connection.js +202 -0
  221. package/node_modules/@noodle-borg/service/dist/routes/github-connection.js.map +1 -0
  222. package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.d.ts +30 -0
  223. package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.d.ts.map +1 -0
  224. package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.js +95 -0
  225. package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.js.map +1 -0
  226. package/node_modules/@noodle-borg/service/dist/routes/github-runs.d.ts +8 -0
  227. package/node_modules/@noodle-borg/service/dist/routes/github-runs.d.ts.map +1 -0
  228. package/node_modules/@noodle-borg/service/dist/routes/github-runs.js +33 -0
  229. package/node_modules/@noodle-borg/service/dist/routes/github-runs.js.map +1 -0
  230. package/node_modules/@noodle-borg/service/dist/routes/github-setup.d.ts +28 -0
  231. package/node_modules/@noodle-borg/service/dist/routes/github-setup.d.ts.map +1 -0
  232. package/node_modules/@noodle-borg/service/dist/routes/github-setup.js +80 -0
  233. package/node_modules/@noodle-borg/service/dist/routes/github-setup.js.map +1 -0
  234. package/node_modules/@noodle-borg/service/dist/routes/github-webhook.d.ts +29 -0
  235. package/node_modules/@noodle-borg/service/dist/routes/github-webhook.d.ts.map +1 -0
  236. package/node_modules/@noodle-borg/service/dist/routes/github-webhook.js +355 -0
  237. package/node_modules/@noodle-borg/service/dist/routes/github-webhook.js.map +1 -0
  238. package/node_modules/@noodle-borg/service/dist/routes/org-admin-dispatch.d.ts +27 -0
  239. package/node_modules/@noodle-borg/service/dist/routes/org-admin-dispatch.d.ts.map +1 -0
  240. package/node_modules/@noodle-borg/service/dist/routes/org-admin-dispatch.js +61 -0
  241. package/node_modules/@noodle-borg/service/dist/routes/org-admin-dispatch.js.map +1 -0
  242. package/node_modules/@noodle-borg/service/dist/routes/org-admin.d.ts +5 -0
  243. package/node_modules/@noodle-borg/service/dist/routes/org-admin.d.ts.map +1 -1
  244. package/node_modules/@noodle-borg/service/dist/routes/org-admin.js +13 -1
  245. package/node_modules/@noodle-borg/service/dist/routes/org-admin.js.map +1 -1
  246. package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts +64 -1
  247. package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts.map +1 -1
  248. package/node_modules/@noodle-borg/service/dist/routes/paths.js +170 -1
  249. package/node_modules/@noodle-borg/service/dist/routes/paths.js.map +1 -1
  250. package/node_modules/@noodle-borg/service/dist/routes/resource-read-dispatch.d.ts +33 -0
  251. package/node_modules/@noodle-borg/service/dist/routes/resource-read-dispatch.d.ts.map +1 -0
  252. package/node_modules/@noodle-borg/service/dist/routes/resource-read-dispatch.js +69 -0
  253. package/node_modules/@noodle-borg/service/dist/routes/resource-read-dispatch.js.map +1 -0
  254. package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
  255. package/node_modules/@noodle-borg/service/dist/serve.js +42 -1
  256. package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
  257. package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
  258. package/node_modules/@noodle-borg/service/dist/service.js +81 -82
  259. package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
  260. package/node_modules/@noodle-borg/service/dist/store/alert-rules-json-file.d.ts +21 -0
  261. package/node_modules/@noodle-borg/service/dist/store/alert-rules-json-file.d.ts.map +1 -0
  262. package/node_modules/@noodle-borg/service/dist/store/alert-rules-json-file.js +115 -0
  263. package/node_modules/@noodle-borg/service/dist/store/alert-rules-json-file.js.map +1 -0
  264. package/node_modules/@noodle-borg/service/dist/store/alert-rules.d.ts +108 -0
  265. package/node_modules/@noodle-borg/service/dist/store/alert-rules.d.ts.map +1 -0
  266. package/node_modules/@noodle-borg/service/dist/store/alert-rules.js +181 -0
  267. package/node_modules/@noodle-borg/service/dist/store/alert-rules.js.map +1 -0
  268. package/node_modules/@noodle-borg/service/dist/store/control-plane.d.ts +1 -0
  269. package/node_modules/@noodle-borg/service/dist/store/control-plane.d.ts.map +1 -1
  270. package/node_modules/@noodle-borg/service/dist/store/control-plane.js +3 -0
  271. package/node_modules/@noodle-borg/service/dist/store/control-plane.js.map +1 -1
  272. package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.d.ts +24 -0
  273. package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.d.ts.map +1 -0
  274. package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.js +141 -0
  275. package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.js.map +1 -0
  276. package/node_modules/@noodle-borg/service/dist/store/github-connections.d.ts +31 -0
  277. package/node_modules/@noodle-borg/service/dist/store/github-connections.d.ts.map +1 -0
  278. package/node_modules/@noodle-borg/service/dist/store/github-connections.js +120 -0
  279. package/node_modules/@noodle-borg/service/dist/store/github-connections.js.map +1 -0
  280. package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.d.ts +22 -0
  281. package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.d.ts.map +1 -0
  282. package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.js +116 -0
  283. package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.js.map +1 -0
  284. package/node_modules/@noodle-borg/service/dist/store/github-runs.d.ts +51 -0
  285. package/node_modules/@noodle-borg/service/dist/store/github-runs.d.ts.map +1 -0
  286. package/node_modules/@noodle-borg/service/dist/store/github-runs.js +158 -0
  287. package/node_modules/@noodle-borg/service/dist/store/github-runs.js.map +1 -0
  288. package/node_modules/@noodle-borg/service/dist/store/in-memory.d.ts +32 -0
  289. package/node_modules/@noodle-borg/service/dist/store/in-memory.d.ts.map +1 -0
  290. package/node_modules/@noodle-borg/service/dist/store/in-memory.js +169 -0
  291. package/node_modules/@noodle-borg/service/dist/store/in-memory.js.map +1 -0
  292. package/node_modules/@noodle-borg/service/dist/store/json-file.d.ts +14 -1
  293. package/node_modules/@noodle-borg/service/dist/store/json-file.d.ts.map +1 -1
  294. package/node_modules/@noodle-borg/service/dist/store/json-file.js +54 -1
  295. package/node_modules/@noodle-borg/service/dist/store/json-file.js.map +1 -1
  296. package/node_modules/@noodle-borg/service/dist/store/pending-installations-postgres.d.ts +19 -0
  297. package/node_modules/@noodle-borg/service/dist/store/pending-installations-postgres.d.ts.map +1 -0
  298. package/node_modules/@noodle-borg/service/dist/store/pending-installations-postgres.js +46 -0
  299. package/node_modules/@noodle-borg/service/dist/store/pending-installations-postgres.js.map +1 -0
  300. package/node_modules/@noodle-borg/service/dist/store/postgres-alerts.d.ts +26 -0
  301. package/node_modules/@noodle-borg/service/dist/store/postgres-alerts.d.ts.map +1 -0
  302. package/node_modules/@noodle-borg/service/dist/store/postgres-alerts.js +142 -0
  303. package/node_modules/@noodle-borg/service/dist/store/postgres-alerts.js.map +1 -0
  304. package/node_modules/@noodle-borg/service/dist/store/postgres-apps.d.ts +11 -0
  305. package/node_modules/@noodle-borg/service/dist/store/postgres-apps.d.ts.map +1 -0
  306. package/node_modules/@noodle-borg/service/dist/store/postgres-apps.js +31 -0
  307. package/node_modules/@noodle-borg/service/dist/store/postgres-apps.js.map +1 -0
  308. package/node_modules/@noodle-borg/service/dist/store/postgres-config.d.ts +21 -0
  309. package/node_modules/@noodle-borg/service/dist/store/postgres-config.d.ts.map +1 -0
  310. package/node_modules/@noodle-borg/service/dist/store/postgres-config.js +80 -0
  311. package/node_modules/@noodle-borg/service/dist/store/postgres-config.js.map +1 -0
  312. package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.d.ts +1 -0
  313. package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.d.ts.map +1 -1
  314. package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.js +6 -0
  315. package/node_modules/@noodle-borg/service/dist/store/postgres-control-plane.js.map +1 -1
  316. package/node_modules/@noodle-borg/service/dist/store/postgres-envs.d.ts +7 -0
  317. package/node_modules/@noodle-borg/service/dist/store/postgres-envs.d.ts.map +1 -0
  318. package/node_modules/@noodle-borg/service/dist/store/postgres-envs.js +34 -0
  319. package/node_modules/@noodle-borg/service/dist/store/postgres-envs.js.map +1 -0
  320. package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.d.ts +9 -0
  321. package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.d.ts.map +1 -0
  322. package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js +113 -0
  323. package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js.map +1 -0
  324. package/node_modules/@noodle-borg/service/dist/store/postgres-github.d.ts +13 -0
  325. package/node_modules/@noodle-borg/service/dist/store/postgres-github.d.ts.map +1 -0
  326. package/node_modules/@noodle-borg/service/dist/store/postgres-github.js +130 -0
  327. package/node_modules/@noodle-borg/service/dist/store/postgres-github.js.map +1 -0
  328. package/node_modules/@noodle-borg/service/dist/store/postgres-schema.d.ts.map +1 -1
  329. package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js +85 -0
  330. package/node_modules/@noodle-borg/service/dist/store/postgres-schema.js.map +1 -1
  331. package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts +32 -2
  332. package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts.map +1 -1
  333. package/node_modules/@noodle-borg/service/dist/store/postgres.js +72 -75
  334. package/node_modules/@noodle-borg/service/dist/store/postgres.js.map +1 -1
  335. package/node_modules/@noodle-borg/service/dist/store/records.d.ts +56 -3
  336. package/node_modules/@noodle-borg/service/dist/store/records.d.ts.map +1 -1
  337. package/node_modules/@noodle-borg/service/dist/store/records.js +158 -0
  338. package/node_modules/@noodle-borg/service/dist/store/records.js.map +1 -1
  339. package/node_modules/@noodle-borg/service/dist/store/validate.d.ts +2 -0
  340. package/node_modules/@noodle-borg/service/dist/store/validate.d.ts.map +1 -1
  341. package/node_modules/@noodle-borg/service/dist/store/validate.js +7 -0
  342. package/node_modules/@noodle-borg/service/dist/store/validate.js.map +1 -1
  343. package/node_modules/@noodle-borg/service/dist/store.d.ts +265 -17
  344. package/node_modules/@noodle-borg/service/dist/store.d.ts.map +1 -1
  345. package/node_modules/@noodle-borg/service/dist/store.js +10 -118
  346. package/node_modules/@noodle-borg/service/dist/store.js.map +1 -1
  347. package/node_modules/@noodle-borg/service/package.json +2 -1
  348. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/routes/contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,YAAY,GAAG;IACnB,YAAY;IACZ,aAAa;IACb,QAAQ;IACR,OAAO;IACP,WAAW;IACX,eAAe;CACP,CAAC;AAEX,yDAAyD;AACzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM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AM,EAAE,CAAC"}
@@ -10,7 +10,18 @@ import type { AuditSink } from '../store/audit.js';
10
10
  import type { ControlPlaneStore } from '../store.js';
11
11
  export declare function handleDeployments(req: IncomingMessage, res: ServerResponse, registry: ServerRegistry, gate: DeployAuthGate, controlPlane: ControlPlaneStore, ref: {
12
12
  org: string;
13
- }, url: URL): Promise<void>;
13
+ }, url: URL, endpointBase: string): Promise<void>;
14
+ /**
15
+ * The single-deployment item route: `GET /v1/orgs/{org}/deployments/{deploymentId}` (deployment
16
+ * inspect). Membership-gated exactly like the `apps`/`envs` item routes (`authorizeTenantControl`); a
17
+ * deployment that exists but belongs to a different org 404s identically to an unknown id — cross-org
18
+ * existence must never leak. Archived deployments ARE returned (with `archivedAt` set): inspecting
19
+ * history, including an archived deployment, is the point of this lookup.
20
+ */
21
+ export declare function handleDeploymentItem(req: IncomingMessage, res: ServerResponse, registry: ServerRegistry, gate: DeployAuthGate, controlPlane: ControlPlaneStore, ref: {
22
+ org: string;
23
+ deploymentId: string;
24
+ }, endpointBase: string): Promise<void>;
14
25
  export declare function handleAuditEvents(req: IncomingMessage, res: ServerResponse, gate: DeployAuthGate, controlPlane: ControlPlaneStore, audit: AuditSink, ref: {
15
26
  org: string;
16
27
  }, url: URL): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"deployments.d.ts","sourceRoot":"","sources":["../../src/routes/deployments.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAc,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,eAAe,EACp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,EACnB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,cAAc,EACpB,YAAY,EAAE,iBAAiB,EAC/B,GAAG,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,EAC1C,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAYf;AAED,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,cAAc,EACpB,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,EACpB,GAAG,EAAE,GAAG,GACP,OAAO,CAAC,IAAI,CAAC,CA0Cf"}
@@ -1,6 +1,9 @@
1
1
  import { sendForbidden, sendJson } from '../http-util.js';
2
+ import { sendContract } from './apps.js';
3
+ import { DeploymentResponseSchema } from './contracts.js';
2
4
  import { authorizeControlPlane, authorizeTenantControl } from './control-plane.js';
3
- export async function handleDeployments(req, res, registry, gate, controlPlane, ref, url) {
5
+ import { withEndpointUrl } from './endpoint-enrichment.js';
6
+ export async function handleDeployments(req, res, registry, gate, controlPlane, ref, url, endpointBase) {
4
7
  const identity = await authorizeControlPlane(req, res, gate, { requireIdentity: true });
5
8
  if (identity === false)
6
9
  return;
@@ -19,11 +22,37 @@ export async function handleDeployments(req, res, registry, gate, controlPlane,
19
22
  ...(env !== undefined ? { env } : {}),
20
23
  ...(includeArchived ? { includeArchived: true } : {}),
21
24
  });
22
- return sendJson(res, 200, { ok: true, deployments });
25
+ return sendJson(res, 200, {
26
+ ok: true,
27
+ deployments: deployments.map((record) => withEndpointUrl(record, endpointBase)),
28
+ });
29
+ }
30
+ catch (error) {
31
+ return sendJson(res, 400, { error: error.message });
32
+ }
33
+ }
34
+ /**
35
+ * The single-deployment item route: `GET /v1/orgs/{org}/deployments/{deploymentId}` (deployment
36
+ * inspect). Membership-gated exactly like the `apps`/`envs` item routes (`authorizeTenantControl`); a
37
+ * deployment that exists but belongs to a different org 404s identically to an unknown id — cross-org
38
+ * existence must never leak. Archived deployments ARE returned (with `archivedAt` set): inspecting
39
+ * history, including an archived deployment, is the point of this lookup.
40
+ */
41
+ export async function handleDeploymentItem(req, res, registry, gate, controlPlane, ref, endpointBase) {
42
+ const identity = await authorizeTenantControl(req, res, gate, controlPlane, ref.org);
43
+ if (identity === false)
44
+ return;
45
+ let deployment;
46
+ try {
47
+ deployment = await registry.getDeployment(ref.org, ref.deploymentId);
23
48
  }
24
49
  catch (error) {
25
50
  return sendJson(res, 400, { error: error.message });
26
51
  }
52
+ if (deployment === undefined)
53
+ return sendJson(res, 404, { error: 'unknown deployment' });
54
+ const enriched = withEndpointUrl(deployment, endpointBase);
55
+ return sendContract(res, () => DeploymentResponseSchema.parse({ ok: true, data: enriched }));
27
56
  }
28
57
  export async function handleAuditEvents(req, res, gate, controlPlane, audit, ref, url) {
29
58
  const identity = await authorizeTenantControl(req, res, gate, controlPlane, ref.org);
@@ -1 +1 @@
1
- {"version":3,"file":"deployments.js","sourceRoot":"","sources":["../../src/routes/deployments.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAI1D,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEnF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,GAAoB,EACpB,GAAmB,EACnB,QAAwB,EACxB,IAAoB,EACpB,YAA+B,EAC/B,GAAoB,EACpB,GAAQ;IAER,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IACxF,IAAI,QAAQ,KAAK,KAAK;QAAE,OAAO;IAC/B,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QACzB,MAAM,MAAM,GAA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,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,KAAgB;IACpC,OAAO,MAAM,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;AAC7D,CAAC;AAED,SAAS,aAAa,CAAC,GAAQ,EAAE,GAAW;IAC1C,MAAM,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;AACnE,CAAC;AAED,SAAS,eAAe,CAAC,KAAoB;IAC3C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAC5D,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,GAAG;QAAE,OAAO,KAAK,CAAC;IAC1E,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Route-layer endpoint enrichment for the resource read surface (CodeRabbit finding, 2026-07-05):
3
+ * `DeploymentSummary.endpointUrl` is derived from the REQUEST's public base (it is a wire concern,
4
+ * not stored state — the same deployment answers on whatever host the service is reached through),
5
+ * so the store/aggregation layers stay base-agnostic and the routes stamp the URL on the way out.
6
+ * Used by the apps/envs facing deployments and the deployments collection/item responses, keeping
7
+ * the whole resource family consistent with what `deploy`/`status` already report.
8
+ */
9
+ import type { IncomingMessage } from 'node:http';
10
+ import type { AppSummary, DeploymentSummary, EnvSummary } from '../store.js';
11
+ /** Per-request endpoint base: explicit `publicBaseUrl` wins, else the request's own origin. */
12
+ export type ResolveEndpointBase = (req: IncomingMessage) => string;
13
+ /** Stamp `endpointUrl` onto one deployment summary. */
14
+ export declare function withEndpointUrl(summary: DeploymentSummary, base: string): DeploymentSummary;
15
+ export declare function appWithEndpointUrl(app: AppSummary, base: string): AppSummary;
16
+ export declare function envWithEndpointUrl(env: EnvSummary, base: string): EnvSummary;
17
+ //# sourceMappingURL=endpoint-enrichment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-enrichment.d.ts","sourceRoot":"","sources":["../../src/routes/endpoint-enrichment.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE7E,+FAA+F;AAC/F,MAAM,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,eAAe,KAAK,MAAM,CAAC;AAEnE,uDAAuD;AACvD,wBAAgB,eAAe,CAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAS3F;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAE5E;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAE5E"}
@@ -0,0 +1,15 @@
1
+ import { tenantMcpUrl } from '../registry-helpers.js';
2
+ /** Stamp `endpointUrl` onto one deployment summary. */
3
+ export function withEndpointUrl(summary, base) {
4
+ return {
5
+ ...summary,
6
+ endpointUrl: tenantMcpUrl(base, { org: summary.orgSlug, app: summary.appSlug, env: summary.environment }, summary.serverVersion),
7
+ };
8
+ }
9
+ export function appWithEndpointUrl(app, base) {
10
+ return app.latest === undefined ? app : { ...app, latest: withEndpointUrl(app.latest, base) };
11
+ }
12
+ export function envWithEndpointUrl(env, base) {
13
+ return env.latest === undefined ? env : { ...env, latest: withEndpointUrl(env.latest, base) };
14
+ }
15
+ //# sourceMappingURL=endpoint-enrichment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint-enrichment.js","sourceRoot":"","sources":["../../src/routes/endpoint-enrichment.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAMtD,uDAAuD;AACvD,MAAM,UAAU,eAAe,CAAC,OAA0B,EAAE,IAAY;IACtE,OAAO;QACL,GAAG,OAAO;QACV,WAAW,EAAE,YAAY,CACvB,IAAI,EACJ,EAAE,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,WAAW,EAAE,EACxE,OAAO,CAAC,aAAa,CACtB;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,GAAe,EAAE,IAAY;IAC9D,OAAO,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,MAAM,EAAE,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;AAChG,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,GAAe,EAAE,IAAY;IAC9D,OAAO,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,MAAM,EAAE,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;AAChG,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The `envs` resource read routes: `GET /v1/orgs/{org}/apps/{app}/envs` (list) and
3
+ * `GET /v1/orgs/{org}/apps/{app}/envs/{env}` (inspect). Membership-gated exactly like the `apps`
4
+ * routes (`authorizeTenantControl`); the response payload is `.parse()`d through the Zod contracts
5
+ * (`./contracts.js`) before it goes on the wire, so the shape can never drift from what's declared
6
+ * there. Contract-parse failures return 500 via `sendContract` (our bug, not the caller's); store
7
+ * lookups keep 400. No pagination — env counts per app are small.
8
+ */
9
+ import type { IncomingMessage, ServerResponse } from 'node:http';
10
+ import type { DeployAuthGate } from '../auth/deploy-gate.js';
11
+ import type { ServerRegistry } from '../registry.js';
12
+ import type { ControlPlaneStore } from '../store.js';
13
+ export declare function handleEnvs(req: IncomingMessage, res: ServerResponse, registry: ServerRegistry, gate: DeployAuthGate, controlPlane: ControlPlaneStore, ref: {
14
+ org: string;
15
+ app: string;
16
+ }, url: URL, endpointBase: string): Promise<void>;
17
+ export declare function handleEnv(req: IncomingMessage, res: ServerResponse, registry: ServerRegistry, gate: DeployAuthGate, controlPlane: ControlPlaneStore, ref: {
18
+ org: string;
19
+ app: string;
20
+ env: string;
21
+ }, endpointBase: string): Promise<void>;
22
+ //# sourceMappingURL=envs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envs.d.ts","sourceRoot":"","sources":["../../src/routes/envs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAMrD,wBAAsB,UAAU,CAC9B,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,cAAc,EACpB,YAAY,EAAE,iBAAiB,EAC/B,GAAG,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACjC,GAAG,EAAE,GAAG,EACR,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAsBf;AAED,wBAAsB,SAAS,CAC7B,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,cAAc,EACpB,YAAY,EAAE,iBAAiB,EAC/B,GAAG,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAC9C,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAYf"}
@@ -0,0 +1,46 @@
1
+ import { sendJson } from '../http-util.js';
2
+ import { sendContract } from './apps.js';
3
+ import { EnvResponseSchema, EnvsListResponseSchema } from './contracts.js';
4
+ import { authorizeTenantControl } from './control-plane.js';
5
+ import { envWithEndpointUrl } from './endpoint-enrichment.js';
6
+ export async function handleEnvs(req, res, registry, gate, controlPlane, ref, url, endpointBase) {
7
+ const identity = await authorizeTenantControl(req, res, gate, controlPlane, ref.org);
8
+ if (identity === false)
9
+ return;
10
+ const includeArchived = url.searchParams.get('archived') === 'true';
11
+ let envs;
12
+ try {
13
+ // Distinguish "app has no envs yet" (200, empty list) from "app does not exist" (404) — the same
14
+ // way `handleApp` treats a missing `getApp` result as not-found.
15
+ const app = await registry.getApp(ref.org, ref.app);
16
+ if (app === undefined)
17
+ return sendJson(res, 404, { error: 'not found' });
18
+ envs = await registry.listEnvironments(ref.org, ref.app, {
19
+ ...(includeArchived ? { includeArchived: true } : {}),
20
+ });
21
+ }
22
+ catch (error) {
23
+ return sendJson(res, 400, { error: error.message });
24
+ }
25
+ return sendContract(res, () => EnvsListResponseSchema.parse({
26
+ ok: true,
27
+ data: { envs: envs.map((env) => envWithEndpointUrl(env, endpointBase)) },
28
+ }));
29
+ }
30
+ export async function handleEnv(req, res, registry, gate, controlPlane, ref, endpointBase) {
31
+ const identity = await authorizeTenantControl(req, res, gate, controlPlane, ref.org);
32
+ if (identity === false)
33
+ return;
34
+ let env;
35
+ try {
36
+ env = await registry.getEnvironment(ref.org, ref.app, ref.env);
37
+ }
38
+ catch (error) {
39
+ return sendJson(res, 400, { error: error.message });
40
+ }
41
+ if (env === undefined)
42
+ return sendJson(res, 404, { error: 'not found' });
43
+ const enriched = envWithEndpointUrl(env, endpointBase);
44
+ return sendContract(res, () => EnvResponseSchema.parse({ ok: true, data: enriched }));
45
+ }
46
+ //# sourceMappingURL=envs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"envs.js","sourceRoot":"","sources":["../../src/routes/envs.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,GAAoB,EACpB,GAAmB,EACnB,QAAwB,EACxB,IAAoB,EACpB,YAA+B,EAC/B,GAAiC,EACjC,GAAQ,EACR,YAAoB;IAEpB,MAAM,QAAQ,GAAG,MAAM,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACrF,IAAI,QAAQ,KAAK,KAAK;QAAE,OAAO;IAC/B,MAAM,eAAe,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,MAAM,CAAC;IACpE,IAAI,IAA6D,CAAC;IAClE,IAAI,CAAC;QACH,iGAAiG;QACjG,iEAAiE;QACjE,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,G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AC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IACD,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;IACzE,MAAM,QAAQ,GAAG,kBAAkB,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IACvD,OAAO,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;AACxF,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { IncomingMessage, ServerResponse } from 'node:http';
2
+ import type { DeployAuthGate } from '../auth/deploy-gate.js';
3
+ import type { GitHubAppClient, GithubAppConfig } from '../github/app-client.js';
4
+ import type { PendingGithubInstallationStore } from '../github/pending-installations.js';
5
+ import type { AuditSink } from '../store/audit.js';
6
+ import type { ControlPlaneStore, GithubConnectionStore } from '../store.js';
7
+ export interface GithubConnectionRouteRef {
8
+ readonly org: string;
9
+ readonly app: string;
10
+ }
11
+ export declare function handleGithubConnection(req: IncomingMessage, res: ServerResponse, gate: DeployAuthGate, controlPlane: ControlPlaneStore, store: GithubConnectionStore, client: GitHubAppClient | undefined, githubApp: GithubAppConfig | undefined, maxBody: number, ref: GithubConnectionRouteRef, audit: AuditSink): Promise<void>;
12
+ /**
13
+ * `GET /v1/github/install-url` — authenticated (any identity, membership is checked later at claim/connect
14
+ * time); `?org=`/`?app=` name the target. Returns GitHub's installations/new URL plus an HMAC-signed,
15
+ * 10-minute `state` nonce binding `{subject, org, app, issuedAt}` so a later `claim` can only be completed
16
+ * by the same caller for the same org/app. 409 when the GitHub App is not configured.
17
+ */
18
+ export declare function handleGithubInstallUrl(req: IncomingMessage, res: ServerResponse, gate: DeployAuthGate, githubApp: GithubAppConfig | undefined, url: URL): Promise<void>;
19
+ /**
20
+ * `POST /v1/github/installations/claim` — verifies the `state` nonce (signature, expiry, and that the
21
+ * caller is the same subject who requested it), then requires the caller to be an org OWNER of the
22
+ * nonce's bound org before returning the installation's repositories for the client to pick from. Any
23
+ * nonce problem (tampered, expired, foreign subject) is a 403 with no state change. The installationId
24
+ * is derived EXCLUSIVELY from the pending store entry GitHub's setup redirect landed for this state —
25
+ * never from the request body — so a caller can only ever enumerate the installation they themselves
26
+ * just installed, not an arbitrary tenant's (409 when the redirect hasn't landed).
27
+ */
28
+ export declare function handleGithubInstallationClaim(req: IncomingMessage, res: ServerResponse, gate: DeployAuthGate, controlPlane: ControlPlaneStore, client: GitHubAppClient | undefined, githubApp: GithubAppConfig | undefined, pendingStore: PendingGithubInstallationStore, maxBody: number): Promise<void>;
29
+ //# sourceMappingURL=github-connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-connection.d.ts","sourceRoot":"","sources":["../../src/routes/github-connection.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAMhF,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AAEzF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAM5E,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,cAAc,EACpB,YAAY,EAAE,iBAAiB,EAC/B,KAAK,EAAE,qBAAqB,EAC5B,MAAM,EAAE,eAAe,GAAG,SAAS,EACnC,SAAS,EAAE,eAAe,GAAG,SAAS,EACtC,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,wBAAwB,EAC7B,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,IAAI,CAAC,CAOf;AA0ID;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,cAAc,EACpB,SAAS,EAAE,eAAe,GAAG,SAAS,EACtC,GAAG,EAAE,GAAG,GACP,OAAO,CAAC,IAAI,CAAC,CA0Bf;AAED;;;;;;;;GAQG;AACH,wBAAsB,6BAA6B,CACjD,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,cAAc,EACpB,YAAY,EAAE,iBAAiB,EAC/B,MAAM,EAAE,eAAe,GAAG,SAAS,EACnC,SAAS,EAAE,eAAe,GAAG,SAAS,EACtC,YAAY,EAAE,8BAA8B,EAC5C,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CA2Bf"}
@@ -0,0 +1,202 @@
1
+ /**
2
+ * GHD-1 GitHub repository connection routes: `GET`/`POST`/`DELETE
3
+ * /v1/orgs/{org}/apps/{app}/github/connection`, plus the installation hand-off
4
+ * `GET /v1/github/install-url` and `POST /v1/github/installations/claim`. Membership rules mirror the
5
+ * org-admin routes exactly (`authorizeTenantControl` for member reads, `canManageMembers` for owner-only
6
+ * writes) — this file is the security review point for GHD-1.2. The server NEVER trusts caller-supplied
7
+ * repo metadata: `POST .../connection` always re-derives `ownerLogin`/`repoName`/`defaultBranch` from the
8
+ * {@link GitHubAppClient}, and no route here ever persists a token.
9
+ */
10
+ import { randomUUID } from 'node:crypto';
11
+ import { resolveGithubStateSecret, signInstallNonce, verifyInstallNonce, } from '../github/install-nonce.js';
12
+ import { readJsonBody, sendForbidden, sendJson } from '../http-util.js';
13
+ import { sendContract } from './apps.js';
14
+ import { GithubConnectionResponseSchema, GithubInstallUrlResponseSchema } from './contracts.js';
15
+ import { authorizeControlPlane, authorizeTenantControl } from './control-plane.js';
16
+ import { canManageMembers } from './org-admin.js';
17
+ export async function handleGithubConnection(req, res, gate, controlPlane, store, client, githubApp, maxBody, ref, audit) {
18
+ if (req.method === 'GET')
19
+ return handleGet(req, res, gate, controlPlane, store, ref);
20
+ if (req.method === 'POST') {
21
+ return handlePost(req, res, gate, controlPlane, store, client, githubApp, maxBody, ref, audit);
22
+ }
23
+ if (req.method === 'DELETE')
24
+ return handleDelete(req, res, gate, controlPlane, store, ref, audit);
25
+ return sendJson(res, 404, { error: 'not found' });
26
+ }
27
+ /** `GET .../github/connection` — org MEMBER read; 404 when no connection is enabled. */
28
+ async function handleGet(req, res, gate, controlPlane, store, ref) {
29
+ const identity = await authorizeTenantControl(req, res, gate, controlPlane, ref.org);
30
+ if (identity === false)
31
+ return;
32
+ const record = await store.getRepoConnection(ref.org, ref.app);
33
+ if (record === undefined)
34
+ return sendJson(res, 404, { error: 'not found' });
35
+ return sendContract(res, () => GithubConnectionResponseSchema.parse({ ok: true, data: record }));
36
+ }
37
+ /**
38
+ * `POST .../github/connection` — org OWNER only. Verifies the installation exists AND the repository
39
+ * belongs to it via the {@link GitHubAppClient} before writing anything (a mismatch is a 400 with no
40
+ * state change); fills `ownerLogin`/`repoName`/`defaultBranch` from the client, never from the request
41
+ * body. Uniqueness conflicts (same app already connected to a different repo, or vice versa) are a 409.
42
+ */
43
+ async function handlePost(req, res, gate, controlPlane, store, client, githubApp, maxBody, ref, audit) {
44
+ const identity = await authorizeControlPlane(req, res, gate, { requireIdentity: true });
45
+ if (identity === false)
46
+ return;
47
+ if (!(await canManageMembers(controlPlane, ref.org, identity)))
48
+ return sendForbidden(res, 'forbidden');
49
+ if (githubApp?.appSlug === undefined) {
50
+ return sendJson(res, 409, { error: 'the GitHub App is not configured for this service' });
51
+ }
52
+ if (client === undefined) {
53
+ return sendJson(res, 409, {
54
+ error: 'the GitHub App client is not configured for this service',
55
+ });
56
+ }
57
+ const body = await readJsonBody(req, maxBody);
58
+ if (!body.ok)
59
+ return sendJson(res, body.status, { error: body.error });
60
+ const parsed = body.value;
61
+ if (!isPositiveInteger(parsed.installationId)) {
62
+ return sendJson(res, 400, { error: '"installationId" must be a positive integer' });
63
+ }
64
+ if (!isPositiveInteger(parsed.githubRepositoryId)) {
65
+ return sendJson(res, 400, { error: '"githubRepositoryId" must be a positive integer' });
66
+ }
67
+ if (parsed.repoRoot !== undefined && typeof parsed.repoRoot !== 'string') {
68
+ return sendJson(res, 400, { error: '"repoRoot" must be a string' });
69
+ }
70
+ const installationId = parsed.installationId;
71
+ const githubRepositoryId = parsed.githubRepositoryId;
72
+ const repoRoot = typeof parsed.repoRoot === 'string' ? parsed.repoRoot : undefined;
73
+ const installation = await client.getInstallation(installationId);
74
+ if (installation === undefined) {
75
+ return sendJson(res, 400, { error: `installation ${installationId} not found` });
76
+ }
77
+ const repositories = await client.listInstallationRepositories(installationId);
78
+ const repository = repositories.find((candidate) => candidate.id === githubRepositoryId);
79
+ if (repository === undefined) {
80
+ return sendJson(res, 400, {
81
+ error: `repository ${githubRepositoryId} does not belong to installation ${installationId}`,
82
+ });
83
+ }
84
+ const result = await store.upsertRepoConnection({
85
+ githubRepositoryId,
86
+ installationId,
87
+ ownerLogin: installation.accountLogin,
88
+ repoName: repository.fullName,
89
+ defaultBranch: repository.defaultBranch,
90
+ ...(repoRoot !== undefined ? { repoRoot } : {}),
91
+ orgSlug: ref.org,
92
+ appSlug: ref.app,
93
+ createdBySubject: identity.subject,
94
+ });
95
+ if (!result.ok)
96
+ return sendJson(res, 409, { error: result.error.message });
97
+ await audit.emit({
98
+ eventType: 'github.connection.connected',
99
+ org: ref.org,
100
+ app: ref.app,
101
+ decision: 'allow',
102
+ status: 200,
103
+ actorSubject: identity.subject,
104
+ ...(identity.email !== undefined ? { actorEmail: identity.email } : {}),
105
+ details: { githubRepositoryId, installationId },
106
+ });
107
+ return sendContract(res, () => GithubConnectionResponseSchema.parse({ ok: true, data: result.record }));
108
+ }
109
+ /** `DELETE .../github/connection` — org OWNER only; idempotent disable. */
110
+ async function handleDelete(req, res, gate, controlPlane, store, ref, audit) {
111
+ const identity = await authorizeControlPlane(req, res, gate, { requireIdentity: true });
112
+ if (identity === false)
113
+ return;
114
+ if (!(await canManageMembers(controlPlane, ref.org, identity)))
115
+ return sendForbidden(res, 'forbidden');
116
+ const disabled = await store.disableRepoConnection(ref.org, ref.app);
117
+ if (disabled) {
118
+ await audit.emit({
119
+ eventType: 'github.connection.disabled',
120
+ org: ref.org,
121
+ app: ref.app,
122
+ decision: 'allow',
123
+ status: 200,
124
+ actorSubject: identity.subject,
125
+ ...(identity.email !== undefined ? { actorEmail: identity.email } : {}),
126
+ details: {},
127
+ });
128
+ }
129
+ return sendJson(res, 200, { ok: true, data: { disabled } });
130
+ }
131
+ /**
132
+ * `GET /v1/github/install-url` — authenticated (any identity, membership is checked later at claim/connect
133
+ * time); `?org=`/`?app=` name the target. Returns GitHub's installations/new URL plus an HMAC-signed,
134
+ * 10-minute `state` nonce binding `{subject, org, app, issuedAt}` so a later `claim` can only be completed
135
+ * by the same caller for the same org/app. 409 when the GitHub App is not configured.
136
+ */
137
+ export async function handleGithubInstallUrl(req, res, gate, githubApp, url) {
138
+ const identity = await authorizeControlPlane(req, res, gate, { requireIdentity: true });
139
+ if (identity === false)
140
+ return;
141
+ if (githubApp?.appSlug === undefined) {
142
+ return sendJson(res, 409, { error: 'the GitHub App is not configured for this service' });
143
+ }
144
+ const orgParam = url.searchParams.get('org');
145
+ const appParam = url.searchParams.get('app');
146
+ if (orgParam === null || appParam === null) {
147
+ return sendJson(res, 400, { error: '"org" and "app" query parameters are required' });
148
+ }
149
+ const secret = resolveGithubStateSecret(githubApp.webhookSecret);
150
+ const state = signInstallNonce({
151
+ nonceId: randomUUID(),
152
+ subject: identity.subject,
153
+ org: orgParam,
154
+ app: appParam,
155
+ issuedAt: Date.now(),
156
+ }, secret);
157
+ const installUrl = `https://github.com/apps/${encodeURIComponent(githubApp.appSlug)}/installations/new?state=${encodeURIComponent(state)}`;
158
+ return sendContract(res, () => GithubInstallUrlResponseSchema.parse({ ok: true, data: { installUrl, state } }));
159
+ }
160
+ /**
161
+ * `POST /v1/github/installations/claim` — verifies the `state` nonce (signature, expiry, and that the
162
+ * caller is the same subject who requested it), then requires the caller to be an org OWNER of the
163
+ * nonce's bound org before returning the installation's repositories for the client to pick from. Any
164
+ * nonce problem (tampered, expired, foreign subject) is a 403 with no state change. The installationId
165
+ * is derived EXCLUSIVELY from the pending store entry GitHub's setup redirect landed for this state —
166
+ * never from the request body — so a caller can only ever enumerate the installation they themselves
167
+ * just installed, not an arbitrary tenant's (409 when the redirect hasn't landed).
168
+ */
169
+ export async function handleGithubInstallationClaim(req, res, gate, controlPlane, client, githubApp, pendingStore, maxBody) {
170
+ const identity = await authorizeControlPlane(req, res, gate, { requireIdentity: true });
171
+ if (identity === false)
172
+ return;
173
+ const body = await readJsonBody(req, maxBody);
174
+ if (!body.ok)
175
+ return sendJson(res, body.status, { error: body.error });
176
+ const parsed = body.value;
177
+ if (typeof parsed.state !== 'string')
178
+ return sendJson(res, 400, { error: '"state" must be a string' });
179
+ const secret = resolveGithubStateSecret(githubApp?.webhookSecret);
180
+ const verification = verifyInstallNonce(parsed.state, secret);
181
+ if (!verification.ok || verification.payload.subject !== identity.subject) {
182
+ return sendForbidden(res, 'invalid or expired state');
183
+ }
184
+ if (!(await canManageMembers(controlPlane, verification.payload.org, identity))) {
185
+ return sendForbidden(res, 'forbidden');
186
+ }
187
+ if (client === undefined) {
188
+ return sendJson(res, 409, {
189
+ error: 'the GitHub App client is not configured for this service',
190
+ });
191
+ }
192
+ const installationId = await pendingStore.get(parsed.state);
193
+ if (installationId === undefined) {
194
+ return sendJson(res, 409, { error: 'the GitHub installation has not landed yet' });
195
+ }
196
+ const repositories = await client.listInstallationRepositories(installationId);
197
+ return sendJson(res, 200, { ok: true, data: { installationId, repositories } });
198
+ }
199
+ function isPositiveInteger(value) {
200
+ return typeof value === 'number' && Number.isInteger(value) && value > 0;
201
+ }
202
+ //# sourceMappingURL=github-connection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-connection.js","sourceRoot":"","sources":["../../src/routes/github-connection.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGxE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAOlD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,GAAoB,EACpB,GAAmB,EACnB,IAAoB,EACpB,YAA+B,EAC/B,KAA4B,EAC5B,MAAmC,EACnC,SAAsC,EACtC,OAAe,EACf,GAA6B,EAC7B,KAAgB;IAEhB,IAAI,GAAG,CAAC,MAAM,KAAK,KAAK;QAAE,OAAO,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IACrF,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QAC1B,OAAO,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,CAAC,GAAG,EAAE,GAAG,EAAE;YACxB,KAAK,EAAE,0DAA0D;SAClE,CAAC,CAAC;IACL,CAAC;IACD,MAAM,cAAc,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5D,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QACjC,OAAO,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,4CAA4C,EAAE,CAAC,CAAC;IACrF,CAAC;IACD,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,4BAA4B,CAAC,cAAc,CAAC,CAAC;IAC/E,OAAO,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,cAAc,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC;AAClF,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACvC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC;AAC3E,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Dispatch for the GHD-1 GitHub connection routes. Extracted the same way as
3
+ * `resource-read-dispatch.ts`/`analytics-dispatch.ts` so `service.ts` stays a thin composition root
4
+ * under the size gate.
5
+ */
6
+ import type { IncomingMessage, ServerResponse } from 'node:http';
7
+ import type { TlsPosture } from '@noodle-borg/transport-http';
8
+ import type { DeployAuthGate } from '../auth/deploy-gate.js';
9
+ import type { GitHubAppClient, GithubAppConfig } from '../github/app-client.js';
10
+ import type { PendingGithubInstallationStore } from '../github/pending-installations.js';
11
+ import type { AuditSink } from '../store/audit.js';
12
+ import type { ControlPlaneStore, GithubConnectionStore, GithubDeployRunStore } from '../store.js';
13
+ export interface GithubDispatchDeps {
14
+ readonly gate: DeployAuthGate;
15
+ readonly controlPlane: ControlPlaneStore;
16
+ readonly githubConnectionStore: GithubConnectionStore;
17
+ readonly githubDeployRunStore: GithubDeployRunStore;
18
+ readonly githubAppClient: GitHubAppClient | undefined;
19
+ readonly githubApp: GithubAppConfig | undefined;
20
+ readonly pendingGithubInstallationStore: PendingGithubInstallationStore;
21
+ readonly audit: AuditSink;
22
+ readonly maxBody: number;
23
+ readonly applySecurityHeaders: (res: ServerResponse, tls: TlsPosture) => void;
24
+ readonly enforceHttps: (req: IncomingMessage, res: ServerResponse, tls: TlsPosture) => boolean;
25
+ readonly sendJson: (res: ServerResponse, status: number, body: unknown) => void;
26
+ readonly tls: TlsPosture;
27
+ }
28
+ /** Try the GHD-1 GitHub routes; returns true when the request was handled (or a guard ended it). */
29
+ export declare function dispatchGithubRoutes(req: IncomingMessage, res: ServerResponse, url: URL, deps: GithubDispatchDeps): boolean;
30
+ //# sourceMappingURL=github-dispatch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-dispatch.d.ts","sourceRoot":"","sources":["../../src/routes/github-dispatch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAmBlG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;IACzC,QAAQ,CA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