@tai42/api-client 20.0.0 → 22.0.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 (401) hide show
  1. package/README.md +29 -0
  2. package/dist/agents.d.ts.map +1 -1
  3. package/dist/agents.js +6 -4
  4. package/dist/agents.js.map +1 -1
  5. package/dist/client/agents-client.d.ts.map +1 -1
  6. package/dist/client/agents-client.js +3 -2
  7. package/dist/client/agents-client.js.map +1 -1
  8. package/dist/client/auth-client.d.ts +129 -127
  9. package/dist/client/auth-client.d.ts.map +1 -1
  10. package/dist/client/auth-client.js +68 -28
  11. package/dist/client/auth-client.js.map +1 -1
  12. package/dist/client/backend-client.d.ts +14 -13
  13. package/dist/client/backend-client.d.ts.map +1 -1
  14. package/dist/client/backend-client.js +7 -3
  15. package/dist/client/backend-client.js.map +1 -1
  16. package/dist/client/backup-client.d.ts +45 -19
  17. package/dist/client/backup-client.d.ts.map +1 -1
  18. package/dist/client/backup-client.js +8 -3
  19. package/dist/client/backup-client.js.map +1 -1
  20. package/dist/client/capabilities-client.d.ts +20 -16
  21. package/dist/client/capabilities-client.d.ts.map +1 -1
  22. package/dist/client/capabilities-client.js +3 -2
  23. package/dist/client/capabilities-client.js.map +1 -1
  24. package/dist/client/channels-client.d.ts.map +1 -1
  25. package/dist/client/channels-client.js +2 -1
  26. package/dist/client/channels-client.js.map +1 -1
  27. package/dist/client/config-client.d.ts +44 -17
  28. package/dist/client/config-client.d.ts.map +1 -1
  29. package/dist/client/config-client.js +10 -4
  30. package/dist/client/config-client.js.map +1 -1
  31. package/dist/client/connectors-client.d.ts +270 -81
  32. package/dist/client/connectors-client.d.ts.map +1 -1
  33. package/dist/client/connectors-client.js +38 -10
  34. package/dist/client/connectors-client.js.map +1 -1
  35. package/dist/client/conversations-client.d.ts +440 -86
  36. package/dist/client/conversations-client.d.ts.map +1 -1
  37. package/dist/client/conversations-client.js +46 -17
  38. package/dist/client/conversations-client.js.map +1 -1
  39. package/dist/client/hooks-client.d.ts +3 -3
  40. package/dist/client/hooks-client.d.ts.map +1 -1
  41. package/dist/client/hooks-client.js +12 -7
  42. package/dist/client/hooks-client.js.map +1 -1
  43. package/dist/client/index.d.ts +2272 -914
  44. package/dist/client/index.d.ts.map +1 -1
  45. package/dist/client/index.js +10 -2
  46. package/dist/client/index.js.map +1 -1
  47. package/dist/client/interactions-client.d.ts +19 -14
  48. package/dist/client/interactions-client.d.ts.map +1 -1
  49. package/dist/client/interactions-client.js +21 -9
  50. package/dist/client/interactions-client.js.map +1 -1
  51. package/dist/client/login-client.d.ts +18 -17
  52. package/dist/client/login-client.d.ts.map +1 -1
  53. package/dist/client/login-client.js +8 -4
  54. package/dist/client/login-client.js.map +1 -1
  55. package/dist/client/manifest-client.d.ts +276 -105
  56. package/dist/client/manifest-client.d.ts.map +1 -1
  57. package/dist/client/manifest-client.js +22 -16
  58. package/dist/client/manifest-client.js.map +1 -1
  59. package/dist/client/marketplace-client.d.ts +181 -51
  60. package/dist/client/marketplace-client.d.ts.map +1 -1
  61. package/dist/client/marketplace-client.js +23 -12
  62. package/dist/client/marketplace-client.js.map +1 -1
  63. package/dist/client/mcp-config-schema-client.d.ts.map +1 -1
  64. package/dist/client/mcp-config-schema-client.js +2 -1
  65. package/dist/client/mcp-config-schema-client.js.map +1 -1
  66. package/dist/client/notifications-client.d.ts +43 -6
  67. package/dist/client/notifications-client.d.ts.map +1 -1
  68. package/dist/client/notifications-client.js +2 -1
  69. package/dist/client/notifications-client.js.map +1 -1
  70. package/dist/client/observability-client.d.ts +78 -38
  71. package/dist/client/observability-client.d.ts.map +1 -1
  72. package/dist/client/observability-client.js +29 -6
  73. package/dist/client/observability-client.js.map +1 -1
  74. package/dist/client/plugins-client.d.ts +8 -6
  75. package/dist/client/plugins-client.d.ts.map +1 -1
  76. package/dist/client/plugins-client.js +2 -1
  77. package/dist/client/plugins-client.js.map +1 -1
  78. package/dist/client/policy-client.d.ts +4 -4
  79. package/dist/client/policy-client.d.ts.map +1 -1
  80. package/dist/client/policy-client.js +11 -4
  81. package/dist/client/policy-client.js.map +1 -1
  82. package/dist/client/presets-client.d.ts +84 -39
  83. package/dist/client/presets-client.d.ts.map +1 -1
  84. package/dist/client/presets-client.js +25 -13
  85. package/dist/client/presets-client.js.map +1 -1
  86. package/dist/client/profiles-client.d.ts +40 -33
  87. package/dist/client/profiles-client.d.ts.map +1 -1
  88. package/dist/client/profiles-client.js +15 -10
  89. package/dist/client/profiles-client.js.map +1 -1
  90. package/dist/client/schedules-client.d.ts +21 -17
  91. package/dist/client/schedules-client.d.ts.map +1 -1
  92. package/dist/client/schedules-client.js +8 -5
  93. package/dist/client/schedules-client.js.map +1 -1
  94. package/dist/client/settings-schema-client.d.ts +1 -1
  95. package/dist/client/settings-schema-client.d.ts.map +1 -1
  96. package/dist/client/settings-schema-client.js +2 -1
  97. package/dist/client/settings-schema-client.js.map +1 -1
  98. package/dist/client/states-client.d.ts +215 -87
  99. package/dist/client/states-client.d.ts.map +1 -1
  100. package/dist/client/states-client.js +98 -37
  101. package/dist/client/states-client.js.map +1 -1
  102. package/dist/client/storage-client.d.ts +5 -5
  103. package/dist/client/storage-client.d.ts.map +1 -1
  104. package/dist/client/storage-client.js +24 -12
  105. package/dist/client/storage-client.js.map +1 -1
  106. package/dist/client/sub-mcp-client.d.ts +3 -1
  107. package/dist/client/sub-mcp-client.d.ts.map +1 -1
  108. package/dist/client/sub-mcp-client.js +9 -4
  109. package/dist/client/sub-mcp-client.js.map +1 -1
  110. package/dist/client/system-client.d.ts +2 -2
  111. package/dist/client/system-client.d.ts.map +1 -1
  112. package/dist/client/system-client.js +2 -1
  113. package/dist/client/system-client.js.map +1 -1
  114. package/dist/client/templates-client.d.ts +65 -6
  115. package/dist/client/templates-client.d.ts.map +1 -1
  116. package/dist/client/templates-client.js +25 -7
  117. package/dist/client/templates-client.js.map +1 -1
  118. package/dist/client/tool-extensions-client.d.ts +41 -16
  119. package/dist/client/tool-extensions-client.d.ts.map +1 -1
  120. package/dist/client/tool-extensions-client.js +6 -4
  121. package/dist/client/tool-extensions-client.js.map +1 -1
  122. package/dist/client/tool-meta-client.d.ts +8 -8
  123. package/dist/client/tool-meta-client.d.ts.map +1 -1
  124. package/dist/client/tool-meta-client.js +12 -8
  125. package/dist/client/tool-meta-client.js.map +1 -1
  126. package/dist/client/tools-client.d.ts +150 -23
  127. package/dist/client/tools-client.d.ts.map +1 -1
  128. package/dist/client/tools-client.js +8 -8
  129. package/dist/client/tools-client.js.map +1 -1
  130. package/dist/client/trigger-links-client.d.ts +11 -9
  131. package/dist/client/trigger-links-client.d.ts.map +1 -1
  132. package/dist/client/trigger-links-client.js +4 -4
  133. package/dist/client/trigger-links-client.js.map +1 -1
  134. package/dist/fleet-report.d.ts +21 -5
  135. package/dist/fleet-report.d.ts.map +1 -1
  136. package/dist/fleet-report.js +31 -6
  137. package/dist/fleet-report.js.map +1 -1
  138. package/dist/generated/api-routes.d.ts +1014 -0
  139. package/dist/generated/api-routes.d.ts.map +1 -0
  140. package/dist/generated/api-routes.js +322 -0
  141. package/dist/generated/api-routes.js.map +1 -0
  142. package/dist/generated/openapi-schemas.d.ts +12425 -0
  143. package/dist/generated/openapi-schemas.d.ts.map +1 -0
  144. package/dist/generated/openapi-schemas.js +671 -0
  145. package/dist/generated/openapi-schemas.js.map +1 -0
  146. package/dist/generated/served-schemas.d.ts +6698 -349
  147. package/dist/generated/served-schemas.d.ts.map +1 -1
  148. package/dist/generated/served-schemas.js +7062 -21
  149. package/dist/generated/served-schemas.js.map +1 -1
  150. package/dist/headers.d.ts +4 -0
  151. package/dist/headers.d.ts.map +1 -0
  152. package/dist/headers.js +4 -0
  153. package/dist/headers.js.map +1 -0
  154. package/dist/http.d.ts.map +1 -1
  155. package/dist/http.js +4 -3
  156. package/dist/http.js.map +1 -1
  157. package/dist/index.d.ts +7 -3
  158. package/dist/index.d.ts.map +1 -1
  159. package/dist/index.js +3 -0
  160. package/dist/index.js.map +1 -1
  161. package/dist/schemas/api-keys.d.ts +14 -12
  162. package/dist/schemas/api-keys.d.ts.map +1 -1
  163. package/dist/schemas/api-keys.js +9 -23
  164. package/dist/schemas/api-keys.js.map +1 -1
  165. package/dist/schemas/auth-routes.d.ts +34 -29
  166. package/dist/schemas/auth-routes.d.ts.map +1 -1
  167. package/dist/schemas/auth-routes.js +22 -27
  168. package/dist/schemas/auth-routes.js.map +1 -1
  169. package/dist/schemas/backup.d.ts +157 -36
  170. package/dist/schemas/backup.d.ts.map +1 -1
  171. package/dist/schemas/backup.js +27 -26
  172. package/dist/schemas/backup.js.map +1 -1
  173. package/dist/schemas/capabilities.d.ts +32 -22
  174. package/dist/schemas/capabilities.d.ts.map +1 -1
  175. package/dist/schemas/capabilities.js +15 -40
  176. package/dist/schemas/capabilities.js.map +1 -1
  177. package/dist/schemas/channels.d.ts +1 -1
  178. package/dist/schemas/channels.d.ts.map +1 -1
  179. package/dist/schemas/channels.js +2 -5
  180. package/dist/schemas/channels.js.map +1 -1
  181. package/dist/schemas/config.d.ts.map +1 -1
  182. package/dist/schemas/config.js +4 -6
  183. package/dist/schemas/config.js.map +1 -1
  184. package/dist/schemas/connectors.d.ts +381 -185
  185. package/dist/schemas/connectors.d.ts.map +1 -1
  186. package/dist/schemas/connectors.js +54 -101
  187. package/dist/schemas/connectors.js.map +1 -1
  188. package/dist/schemas/conversations.d.ts +977 -248
  189. package/dist/schemas/conversations.d.ts.map +1 -1
  190. package/dist/schemas/conversations.js +40 -134
  191. package/dist/schemas/conversations.js.map +1 -1
  192. package/dist/schemas/extensions.d.ts +9 -6
  193. package/dist/schemas/extensions.d.ts.map +1 -1
  194. package/dist/schemas/extensions.js +6 -4
  195. package/dist/schemas/extensions.js.map +1 -1
  196. package/dist/schemas/fleet.d.ts +153 -99
  197. package/dist/schemas/fleet.d.ts.map +1 -1
  198. package/dist/schemas/fleet.js +41 -51
  199. package/dist/schemas/fleet.js.map +1 -1
  200. package/dist/schemas/hooks.d.ts +34 -34
  201. package/dist/schemas/hooks.d.ts.map +1 -1
  202. package/dist/schemas/hooks.js +15 -34
  203. package/dist/schemas/hooks.js.map +1 -1
  204. package/dist/schemas/index.d.ts +0 -1
  205. package/dist/schemas/index.d.ts.map +1 -1
  206. package/dist/schemas/index.js +0 -1
  207. package/dist/schemas/index.js.map +1 -1
  208. package/dist/schemas/interactions.d.ts +400 -128
  209. package/dist/schemas/interactions.d.ts.map +1 -1
  210. package/dist/schemas/interactions.js +202 -131
  211. package/dist/schemas/interactions.js.map +1 -1
  212. package/dist/schemas/login.d.ts +36 -37
  213. package/dist/schemas/login.d.ts.map +1 -1
  214. package/dist/schemas/login.js +8 -42
  215. package/dist/schemas/login.js.map +1 -1
  216. package/dist/schemas/manifest-mcp.d.ts +61 -35
  217. package/dist/schemas/manifest-mcp.d.ts.map +1 -1
  218. package/dist/schemas/manifest-mcp.js +13 -19
  219. package/dist/schemas/manifest-mcp.js.map +1 -1
  220. package/dist/schemas/marketplace.d.ts +219 -133
  221. package/dist/schemas/marketplace.d.ts.map +1 -1
  222. package/dist/schemas/marketplace.js +35 -120
  223. package/dist/schemas/marketplace.js.map +1 -1
  224. package/dist/schemas/members.d.ts +59 -52
  225. package/dist/schemas/members.d.ts.map +1 -1
  226. package/dist/schemas/members.js +20 -52
  227. package/dist/schemas/members.js.map +1 -1
  228. package/dist/schemas/notifications.d.ts +115 -17
  229. package/dist/schemas/notifications.d.ts.map +1 -1
  230. package/dist/schemas/notifications.js +9 -35
  231. package/dist/schemas/notifications.js.map +1 -1
  232. package/dist/schemas/observability.d.ts +174 -72
  233. package/dist/schemas/observability.d.ts.map +1 -1
  234. package/dist/schemas/observability.js +23 -76
  235. package/dist/schemas/observability.js.map +1 -1
  236. package/dist/schemas/policy.d.ts +11 -11
  237. package/dist/schemas/policy.d.ts.map +1 -1
  238. package/dist/schemas/policy.js +5 -12
  239. package/dist/schemas/policy.js.map +1 -1
  240. package/dist/schemas/presets.d.ts +109 -64
  241. package/dist/schemas/presets.d.ts.map +1 -1
  242. package/dist/schemas/presets.js +12 -48
  243. package/dist/schemas/presets.js.map +1 -1
  244. package/dist/schemas/principals.d.ts +28 -21
  245. package/dist/schemas/principals.d.ts.map +1 -1
  246. package/dist/schemas/principals.js +13 -25
  247. package/dist/schemas/principals.js.map +1 -1
  248. package/dist/schemas/profiles.d.ts +75 -63
  249. package/dist/schemas/profiles.d.ts.map +1 -1
  250. package/dist/schemas/profiles.js +24 -54
  251. package/dist/schemas/profiles.js.map +1 -1
  252. package/dist/schemas/roles.d.ts +22 -22
  253. package/dist/schemas/roles.d.ts.map +1 -1
  254. package/dist/schemas/roles.js +10 -17
  255. package/dist/schemas/roles.js.map +1 -1
  256. package/dist/schemas/schedules.d.ts +21 -15
  257. package/dist/schemas/schedules.d.ts.map +1 -1
  258. package/dist/schemas/schedules.js +4 -13
  259. package/dist/schemas/schedules.js.map +1 -1
  260. package/dist/schemas/served.d.ts +6373 -181
  261. package/dist/schemas/served.d.ts.map +1 -1
  262. package/dist/schemas/served.js +21 -0
  263. package/dist/schemas/served.js.map +1 -1
  264. package/dist/schemas/settings-schema.d.ts +1 -1
  265. package/dist/schemas/settings-schema.d.ts.map +1 -1
  266. package/dist/schemas/settings-schema.js +17 -19
  267. package/dist/schemas/settings-schema.js.map +1 -1
  268. package/dist/schemas/setup.d.ts +6 -6
  269. package/dist/schemas/setup.d.ts.map +1 -1
  270. package/dist/schemas/setup.js +2 -11
  271. package/dist/schemas/setup.js.map +1 -1
  272. package/dist/schemas/states.d.ts +450 -135
  273. package/dist/schemas/states.d.ts.map +1 -1
  274. package/dist/schemas/states.js +76 -140
  275. package/dist/schemas/states.js.map +1 -1
  276. package/dist/schemas/storage.d.ts +7 -8
  277. package/dist/schemas/storage.d.ts.map +1 -1
  278. package/dist/schemas/storage.js +8 -17
  279. package/dist/schemas/storage.js.map +1 -1
  280. package/dist/schemas/studio-plugins.d.ts +24 -18
  281. package/dist/schemas/studio-plugins.d.ts.map +1 -1
  282. package/dist/schemas/studio-plugins.js +5 -19
  283. package/dist/schemas/studio-plugins.js.map +1 -1
  284. package/dist/schemas/sub-mcp.d.ts +11 -8
  285. package/dist/schemas/sub-mcp.d.ts.map +1 -1
  286. package/dist/schemas/sub-mcp.js +10 -19
  287. package/dist/schemas/sub-mcp.js.map +1 -1
  288. package/dist/schemas/system-kinds.d.ts +76 -46
  289. package/dist/schemas/system-kinds.d.ts.map +1 -1
  290. package/dist/schemas/system-kinds.js +11 -28
  291. package/dist/schemas/system-kinds.js.map +1 -1
  292. package/dist/schemas/templates.d.ts +83 -25
  293. package/dist/schemas/templates.d.ts.map +1 -1
  294. package/dist/schemas/templates.js +8 -9
  295. package/dist/schemas/templates.js.map +1 -1
  296. package/dist/schemas/tool-meta.d.ts +15 -15
  297. package/dist/schemas/tool-meta.d.ts.map +1 -1
  298. package/dist/schemas/tool-meta.js +6 -21
  299. package/dist/schemas/tool-meta.js.map +1 -1
  300. package/dist/schemas/tools.d.ts +177 -56
  301. package/dist/schemas/tools.d.ts.map +1 -1
  302. package/dist/schemas/tools.js +20 -41
  303. package/dist/schemas/tools.js.map +1 -1
  304. package/dist/schemas/trigger-links.d.ts +22 -17
  305. package/dist/schemas/trigger-links.d.ts.map +1 -1
  306. package/dist/schemas/trigger-links.js +7 -27
  307. package/dist/schemas/trigger-links.js.map +1 -1
  308. package/dist/tool-runs.d.ts +175 -54
  309. package/dist/tool-runs.d.ts.map +1 -1
  310. package/dist/tool-runs.js +33 -34
  311. package/dist/tool-runs.js.map +1 -1
  312. package/package.json +4 -3
  313. package/src/agents.ts +16 -4
  314. package/src/client/agents-client.ts +3 -2
  315. package/src/client/auth-client.ts +102 -37
  316. package/src/client/backend-client.ts +8 -3
  317. package/src/client/backup-client.ts +8 -3
  318. package/src/client/capabilities-client.ts +4 -2
  319. package/src/client/channels-client.ts +3 -1
  320. package/src/client/config-client.ts +13 -5
  321. package/src/client/connectors-client.ts +91 -16
  322. package/src/client/conversations-client.ts +79 -30
  323. package/src/client/hooks-client.ts +25 -12
  324. package/src/client/index.ts +16 -4
  325. package/src/client/interactions-client.ts +40 -16
  326. package/src/client/login-client.ts +8 -4
  327. package/src/client/manifest-client.ts +48 -24
  328. package/src/client/marketplace-client.ts +23 -12
  329. package/src/client/mcp-config-schema-client.ts +2 -1
  330. package/src/client/notifications-client.ts +2 -1
  331. package/src/client/observability-client.ts +60 -8
  332. package/src/client/plugins-client.ts +2 -1
  333. package/src/client/policy-client.ts +24 -9
  334. package/src/client/presets-client.ts +26 -13
  335. package/src/client/profiles-client.ts +53 -24
  336. package/src/client/schedules-client.ts +14 -20
  337. package/src/client/settings-schema-client.ts +2 -1
  338. package/src/client/states-client.ts +151 -49
  339. package/src/client/storage-client.ts +43 -14
  340. package/src/client/sub-mcp-client.ts +10 -4
  341. package/src/client/system-client.ts +2 -1
  342. package/src/client/templates-client.ts +26 -7
  343. package/src/client/tool-extensions-client.ts +14 -7
  344. package/src/client/tool-meta-client.ts +46 -21
  345. package/src/client/tools-client.ts +13 -8
  346. package/src/client/trigger-links-client.ts +10 -6
  347. package/src/fleet-report.ts +48 -7
  348. package/src/generated/api-routes.ts +327 -0
  349. package/src/generated/openapi-schemas.ts +1508 -0
  350. package/src/generated/served-schemas.ts +7120 -40
  351. package/src/headers.ts +4 -0
  352. package/src/http.ts +4 -3
  353. package/src/index.ts +54 -10
  354. package/src/schemas/api-keys.ts +9 -25
  355. package/src/schemas/auth-routes.ts +27 -28
  356. package/src/schemas/backup.ts +33 -31
  357. package/src/schemas/capabilities.ts +16 -39
  358. package/src/schemas/channels.ts +4 -4
  359. package/src/schemas/config.ts +6 -6
  360. package/src/schemas/connectors.ts +61 -102
  361. package/src/schemas/conversations.ts +43 -133
  362. package/src/schemas/extensions.ts +7 -4
  363. package/src/schemas/fleet.ts +51 -51
  364. package/src/schemas/hooks.ts +18 -37
  365. package/src/schemas/index.ts +0 -1
  366. package/src/schemas/interactions.ts +227 -131
  367. package/src/schemas/login.ts +10 -41
  368. package/src/schemas/manifest-mcp.ts +13 -19
  369. package/src/schemas/marketplace.ts +37 -120
  370. package/src/schemas/members.ts +21 -51
  371. package/src/schemas/notifications.ts +10 -34
  372. package/src/schemas/observability.ts +34 -79
  373. package/src/schemas/policy.ts +5 -12
  374. package/src/schemas/presets.ts +13 -48
  375. package/src/schemas/principals.ts +17 -24
  376. package/src/schemas/profiles.ts +25 -55
  377. package/src/schemas/roles.ts +11 -17
  378. package/src/schemas/schedules.ts +4 -15
  379. package/src/schemas/served.ts +33 -0
  380. package/src/schemas/settings-schema.ts +18 -23
  381. package/src/schemas/setup.ts +4 -10
  382. package/src/schemas/states.ts +88 -139
  383. package/src/schemas/storage.ts +10 -16
  384. package/src/schemas/studio-plugins.ts +8 -19
  385. package/src/schemas/sub-mcp.ts +12 -18
  386. package/src/schemas/system-kinds.ts +12 -29
  387. package/src/schemas/templates.ts +8 -10
  388. package/src/schemas/tool-meta.ts +8 -20
  389. package/src/schemas/tools.ts +22 -45
  390. package/src/schemas/trigger-links.ts +8 -26
  391. package/src/tool-runs.ts +47 -38
  392. package/dist/client/web-entry-gate-client.d.ts +0 -34
  393. package/dist/client/web-entry-gate-client.d.ts.map +0 -1
  394. package/dist/client/web-entry-gate-client.js +0 -25
  395. package/dist/client/web-entry-gate-client.js.map +0 -1
  396. package/dist/schemas/web-entry.d.ts +0 -45
  397. package/dist/schemas/web-entry.d.ts.map +0 -1
  398. package/dist/schemas/web-entry.js +0 -36
  399. package/dist/schemas/web-entry.js.map +0 -1
  400. package/src/client/web-entry-gate-client.ts +0 -45
  401. package/src/schemas/web-entry.ts +0 -46
@@ -1,34 +1,22 @@
1
- /** Principal (identity) reference, row, listing and delete-result schemas. */
2
- import { z } from 'zod';
1
+ import * as openapi from '../generated/openapi-schemas';
3
2
  /**
4
3
  * A compact reference to a principal — the owner of a key, or the human behind a
5
4
  * session — carried inline on payloads that name one.
6
5
  */
7
- export const principalRef = z.object({
8
- user_id: z.string(),
9
- kind: z.enum(['human', 'service']),
10
- display_name: z.string(),
11
- });
6
+ export const principalRef = openapi.principalRef;
12
7
  /**
13
- * A principal row (`/api/auth/principals`). `kind` is `human` (logs in
14
- * interactively) or `service` (holds keys only, never logs in). `created_by` is
15
- * the principal that created this one, or `null` for the owner the setup door
16
- * mints. `disabled` turns off every credential the principal owns. `created_at`
17
- * is an ISO-8601 instant.
8
+ * A principal's kind: `human` (logs in interactively) or `service` (holds keys only,
9
+ * never logs in).
18
10
  */
19
- export const principal = z.object({
20
- user_id: z.string(),
21
- kind: z.enum(['human', 'service']),
22
- display_name: z.string(),
23
- created_by: z.string().nullable(),
24
- disabled: z.boolean(),
25
- created_at: z.string(),
26
- });
11
+ export const principalKind = openapi.principal.shape.kind;
12
+ /**
13
+ * A principal row (`/api/auth/principals`). `created_by` is the principal that created
14
+ * this one, or `null` for the owner the setup door mints. `disabled` turns off every
15
+ * credential the principal owns. `created_at` is an ISO-8601 instant.
16
+ */
17
+ export const principal = openapi.principal;
27
18
  /** The principals listing (`GET /api/auth/principals`). */
28
- export const principalList = z.array(principal);
19
+ export const principalList = openapi.principalListing;
29
20
  /** The delete result (`DELETE /api/auth/principals/{user_id}`). */
30
- export const principalDeleted = z.object({
31
- user_id: z.string(),
32
- deleted: z.boolean(),
33
- });
21
+ export const principalDeleted = openapi.principalDeleted;
34
22
  //# sourceMappingURL=principals.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"principals.js","sourceRoot":"","sources":["../../src/schemas/principals.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAClC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;CACzB,CAAC,CAAC;AAGH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAClC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAGH,2DAA2D;AAC3D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AAGhD,mEAAmE;AACnE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC,CAAC"}
1
+ {"version":3,"file":"principals.js","sourceRoot":"","sources":["../../src/schemas/principals.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AAExD;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAGjD;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC;AAG1D;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;AAG3C,2DAA2D;AAC3D,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC;AAGtD,mEAAmE;AACnE,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /** Settings-profile record, version, diff and apply response schemas. */
2
- import { z } from 'zod';
2
+ import type { z } from 'zod';
3
3
  /**
4
4
  * `GET /api/config/profiles` — one row per stored profile. The list is
5
5
  * names+descriptions ONLY (action=read); no `env`, no `secret_keys`, no bodies.
@@ -7,13 +7,13 @@ import { z } from 'zod';
7
7
  * is the `/versions` surface — so the list renders no last-modified column.)
8
8
  */
9
9
  export declare const settingsProfileSummary: z.ZodObject<{
10
- name: z.ZodString;
11
10
  description: z.ZodString;
11
+ name: z.ZodString;
12
12
  }, z.core.$strip>;
13
13
  export type SettingsProfileSummary = z.infer<typeof settingsProfileSummary>;
14
14
  export declare const settingsProfileList: z.ZodArray<z.ZodObject<{
15
- name: z.ZodString;
16
15
  description: z.ZodString;
16
+ name: z.ZodString;
17
17
  }, z.core.$strip>>;
18
18
  /**
19
19
  * `GET /api/config/profiles/{name}` and each version body — the stored profile
@@ -21,24 +21,27 @@ export declare const settingsProfileList: z.ZodArray<z.ZodObject<{
21
21
  * per-profile secret-marks band folded into the secret-mask union for masking.
22
22
  */
23
23
  export declare const settingsProfileBody: z.ZodObject<{
24
- description: z.ZodString;
25
- env: z.ZodRecord<z.ZodString, z.ZodString>;
26
- secret_keys: z.ZodArray<z.ZodString>;
24
+ description: z.ZodDefault<z.ZodString>;
25
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
26
+ secret_keys: z.ZodDefault<z.ZodArray<z.ZodString>>;
27
27
  }, z.core.$strip>;
28
28
  export type SettingsProfileBody = z.infer<typeof settingsProfileBody>;
29
29
  /** `PUT /api/config/profiles/{name}` — a minimal save ack; `version` is the new store version. */
30
30
  export declare const settingsProfileSaved: z.ZodObject<{
31
- ok: z.ZodLiteral<true>;
32
- version: z.ZodOptional<z.ZodNumber>;
31
+ ok: z.ZodBoolean;
32
+ version: z.ZodNumber;
33
33
  }, z.core.$strip>;
34
34
  export type SettingsProfileSaved = z.infer<typeof settingsProfileSaved>;
35
35
  /** `DELETE /api/config/profiles/{name}` — a minimal removal ack. */
36
36
  export declare const settingsProfileDeleted: z.ZodObject<{
37
- ok: z.ZodLiteral<true>;
37
+ ok: z.ZodBoolean;
38
38
  }, z.core.$strip>;
39
- /** `POST /api/config/profiles/{name}/rollback` — the restore ack; `version` is the resulting active version. */
39
+ /**
40
+ * `POST /api/config/profiles/{name}/rollback` — the restore ack; `version` is the resulting
41
+ * active version.
42
+ */
40
43
  export declare const settingsProfileRollback: z.ZodObject<{
41
- ok: z.ZodLiteral<true>;
44
+ ok: z.ZodBoolean;
42
45
  version: z.ZodNumber;
43
46
  }, z.core.$strip>;
44
47
  export type SettingsProfileRollback = z.infer<typeof settingsProfileRollback>;
@@ -50,14 +53,14 @@ export type SettingsProfileRollback = z.infer<typeof settingsProfileRollback>;
50
53
  */
51
54
  export declare const settingsProfileDiff: z.ZodObject<{
52
55
  added: z.ZodArray<z.ZodString>;
53
- removed: z.ZodArray<z.ZodString>;
54
56
  changed: z.ZodArray<z.ZodObject<{
55
57
  key: z.ZodString;
56
- old: z.ZodString;
57
58
  new: z.ZodString;
59
+ old: z.ZodString;
58
60
  }, z.core.$strip>>;
59
61
  recycle_keys: z.ZodArray<z.ZodString>;
60
62
  refused_keys: z.ZodArray<z.ZodString>;
63
+ removed: z.ZodArray<z.ZodString>;
61
64
  }, z.core.$strip>;
62
65
  export type SettingsProfileDiff = z.infer<typeof settingsProfileDiff>;
63
66
  /**
@@ -69,75 +72,84 @@ export type SettingsProfileDiff = z.infer<typeof settingsProfileDiff>;
69
72
  * the `self-deferred` status literal when the diff has serve-affecting recycle keys;
70
73
  * `fresh` is the per-kind list of NEW ready lives observed since the pre-apply snapshot
71
74
  * (each `{name, kind, generation}`), evidence of fresh capacity and never claimed as any
72
- * target's successor; `refused` is `[]` on success by construction (populated
73
- * `{key, reason}` only on a refusal), the populated refusal surfaces being the diff
74
- * preview and the refusal error report. `fanout` is the mode-wrapped fleet broadcast,
75
- * parsed EXPLICITLY so a failed propagation reaches the shared fleet-report handler. A
76
- * drift throws `ApiSchemaError`.
75
+ * target's successor; `refused` is `[]` on success by construction (the refused key
76
+ * names only on a refusal), the populated refusal surfaces being the diff preview and
77
+ * the refusal error report; `recycle_stopped` names the target a stopped recycle roll
78
+ * halted at, or is `null` when the roll ran to its end; `awaiting_respawn` names the
79
+ * workers (name + keys) still awaiting a respawn after the apply (empty when the roll
80
+ * converged). `fanout` is the mode-wrapped fleet broadcast, parsed EXPLICITLY so a failed
81
+ * propagation reaches the shared fleet-report handler. A drift throws `ApiSchemaError`.
77
82
  */
78
83
  export declare const profileApplyResponse: z.ZodObject<{
84
+ awaiting_respawn: z.ZodDefault<z.ZodArray<z.ZodObject<{
85
+ keys: z.ZodArray<z.ZodString>;
86
+ name: z.ZodString;
87
+ }, z.core.$strip>>>;
88
+ fresh: z.ZodArray<z.ZodObject<{
89
+ generation: z.ZodNumber;
90
+ kind: z.ZodString;
91
+ name: z.ZodString;
92
+ }, z.core.$strip>>;
79
93
  hot: z.ZodArray<z.ZodString>;
80
94
  recycle: z.ZodArray<z.ZodObject<{
81
- name: z.ZodString;
95
+ detail: z.ZodDefault<z.ZodNullable<z.ZodString>>;
96
+ generation_before: z.ZodNumber;
82
97
  kind: z.ZodString;
98
+ name: z.ZodString;
83
99
  status: z.ZodString;
84
- generation_before: z.ZodNumber;
85
100
  }, z.core.$strip>>;
86
- fresh: z.ZodArray<z.ZodObject<{
87
- name: z.ZodString;
101
+ recycle_stopped: z.ZodDefault<z.ZodNullable<z.ZodObject<{
102
+ detail: z.ZodString;
88
103
  kind: z.ZodString;
89
- generation: z.ZodNumber;
90
- }, z.core.$strip>>;
91
- refused: z.ZodArray<z.ZodObject<{
92
- key: z.ZodString;
93
- reason: z.ZodString;
94
- }, z.core.$strip>>;
104
+ name: z.ZodNullable<z.ZodString>;
105
+ }, z.core.$strip>>>;
106
+ refused: z.ZodArray<z.ZodString>;
95
107
  fanout: z.ZodDiscriminatedUnion<[z.ZodObject<{
96
108
  mode: z.ZodLiteral<"local-only">;
97
109
  note: z.ZodString;
98
110
  }, z.core.$strip>, z.ZodObject<{
111
+ error: z.ZodDefault<z.ZodNullable<z.ZodString>>;
112
+ local_only: z.ZodDefault<z.ZodBoolean>;
99
113
  op: z.ZodString;
100
- reachable: z.ZodBoolean;
101
- local_only: z.ZodBoolean;
102
- results: z.ZodArray<z.ZodObject<{
114
+ reachable: z.ZodDefault<z.ZodBoolean>;
115
+ results: z.ZodDefault<z.ZodArray<z.ZodObject<{
116
+ detail: z.ZodDefault<z.ZodNullable<z.ZodString>>;
117
+ error: z.ZodDefault<z.ZodNullable<z.ZodString>>;
103
118
  name: z.ZodString;
104
119
  outcome: z.ZodEnum<{
105
- failed: "failed";
106
120
  applied: "applied";
107
- resyncing: "resyncing";
108
- recycling: "recycling";
109
- stale: "stale";
121
+ failed: "failed";
110
122
  missing: "missing";
111
123
  departed: "departed";
112
124
  timed_out: "timed_out";
125
+ resyncing: "resyncing";
126
+ recycling: "recycling";
127
+ stale: "stale";
113
128
  }>;
114
- payload: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
115
- error: z.ZodNullable<z.ZodString>;
116
- detail: z.ZodNullable<z.ZodString>;
117
- }, z.core.$strip>>;
118
- error: z.ZodNullable<z.ZodString>;
129
+ payload: z.ZodDefault<z.ZodNullable<z.ZodUnknown>>;
130
+ }, z.core.$strip>>>;
119
131
  mode: z.ZodLiteral<"fleet">;
120
132
  }, z.core.$strip>, z.ZodObject<{
133
+ error: z.ZodDefault<z.ZodNullable<z.ZodString>>;
134
+ local_only: z.ZodDefault<z.ZodBoolean>;
121
135
  op: z.ZodString;
122
- reachable: z.ZodBoolean;
123
- local_only: z.ZodBoolean;
124
- results: z.ZodArray<z.ZodObject<{
136
+ reachable: z.ZodDefault<z.ZodBoolean>;
137
+ results: z.ZodDefault<z.ZodArray<z.ZodObject<{
138
+ detail: z.ZodDefault<z.ZodNullable<z.ZodString>>;
139
+ error: z.ZodDefault<z.ZodNullable<z.ZodString>>;
125
140
  name: z.ZodString;
126
141
  outcome: z.ZodEnum<{
127
- failed: "failed";
128
142
  applied: "applied";
129
- resyncing: "resyncing";
130
- recycling: "recycling";
131
- stale: "stale";
143
+ failed: "failed";
132
144
  missing: "missing";
133
145
  departed: "departed";
134
146
  timed_out: "timed_out";
147
+ resyncing: "resyncing";
148
+ recycling: "recycling";
149
+ stale: "stale";
135
150
  }>;
136
- payload: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
137
- error: z.ZodNullable<z.ZodString>;
138
- detail: z.ZodNullable<z.ZodString>;
139
- }, z.core.$strip>>;
140
- error: z.ZodNullable<z.ZodString>;
151
+ payload: z.ZodDefault<z.ZodNullable<z.ZodUnknown>>;
152
+ }, z.core.$strip>>>;
141
153
  mode: z.ZodLiteral<"unreachable">;
142
154
  }, z.core.$strip>], "mode">;
143
155
  }, z.core.$strip>;
@@ -148,17 +160,17 @@ export type ProfileApplyResponse = z.infer<typeof profileApplyResponse>;
148
160
  * active pointer.
149
161
  */
150
162
  export declare const settingsProfileVersionMeta: z.ZodObject<{
151
- version: z.ZodNumber;
152
- tags: z.ZodArray<z.ZodString>;
153
163
  created_at: z.ZodString;
154
164
  is_current: z.ZodBoolean;
165
+ tags: z.ZodArray<z.ZodString>;
166
+ version: z.ZodNumber;
155
167
  }, z.core.$strip>;
156
168
  export type SettingsProfileVersionMeta = z.infer<typeof settingsProfileVersionMeta>;
157
169
  export declare const settingsProfileVersionList: z.ZodArray<z.ZodObject<{
158
- version: z.ZodNumber;
159
- tags: z.ZodArray<z.ZodString>;
160
170
  created_at: z.ZodString;
161
171
  is_current: z.ZodBoolean;
172
+ tags: z.ZodArray<z.ZodString>;
173
+ version: z.ZodNumber;
162
174
  }, z.core.$strip>>;
163
175
  /**
164
176
  * `GET /api/config/profiles/{name}/versions/{version}` — one immutable version WITH
@@ -166,15 +178,15 @@ export declare const settingsProfileVersionList: z.ZodArray<z.ZodObject<{
166
178
  * versioned-store row shape.
167
179
  */
168
180
  export declare const settingsProfileVersion: z.ZodObject<{
169
- version: z.ZodNumber;
170
- tags: z.ZodArray<z.ZodString>;
171
- created_at: z.ZodString;
172
- is_current: z.ZodBoolean;
173
181
  body: z.ZodObject<{
174
- description: z.ZodString;
175
- env: z.ZodRecord<z.ZodString, z.ZodString>;
176
- secret_keys: z.ZodArray<z.ZodString>;
182
+ description: z.ZodDefault<z.ZodString>;
183
+ env: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
184
+ secret_keys: z.ZodDefault<z.ZodArray<z.ZodString>>;
177
185
  }, z.core.$strip>;
186
+ created_at: z.ZodString;
187
+ is_current: z.ZodBoolean;
188
+ tags: z.ZodArray<z.ZodString>;
189
+ version: z.ZodNumber;
178
190
  }, z.core.$strip>;
179
191
  export type SettingsProfileVersion = z.infer<typeof settingsProfileVersion>;
180
192
  //# sourceMappingURL=profiles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../src/schemas/profiles.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;;iBAGjC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC5E,eAAO,MAAM,mBAAmB;;;kBAAkC,CAAC;AAEnE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;iBAI9B,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,kGAAkG;AAClG,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,oEAAoE;AACpE,eAAO,MAAM,sBAAsB;;iBAAoC,CAAC;AAExE,gHAAgH;AAChH,eAAO,MAAM,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AAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,kGAAkG;AAClG,eAAO,MAAM,oBAAoB;;;iBAA6B,CAAC;AAC/D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,oEAAoE;AACpE,eAAO,MAAM,sBAAsB;;iBAAmB,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;iBAA6B,CAAC;AAClE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;iBAAsB,CAAC;AACvD,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,0BAA0B;;;;;iBAAgC,CAAC;AACxE,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AACpF,eAAO,MAAM,0BAA0B;;;;;kBAAqC,CAAC;AAE7E;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;iBAA6B,CAAC;AACjE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -1,5 +1,4 @@
1
- /** Settings-profile record, version, diff and apply response schemas. */
2
- import { z } from 'zod';
1
+ import * as openapi from '../generated/openapi-schemas';
3
2
  import { fleetReportFanout } from './fleet';
4
3
  // The admin-only `/api/config/profiles/*` surface. Secrets ride the wire in the
5
4
  // clear (secret/fenced routes); masking is CLIENT-SIDE per the secret-mask union. A drift
@@ -10,46 +9,30 @@ import { fleetReportFanout } from './fleet';
10
9
  * (No `last_modified`: the list carries identity, not history — version metadata
11
10
  * is the `/versions` surface — so the list renders no last-modified column.)
12
11
  */
13
- export const settingsProfileSummary = z.object({
14
- name: z.string(),
15
- description: z.string(),
16
- });
17
- export const settingsProfileList = z.array(settingsProfileSummary);
12
+ export const settingsProfileSummary = openapi.profileSummary;
13
+ export const settingsProfileList = openapi.profileListResponse;
18
14
  /**
19
15
  * `GET /api/config/profiles/{name}` and each version body — the stored profile
20
16
  * document (action=secret). `env` carries REAL values; `secret_keys` is the
21
17
  * per-profile secret-marks band folded into the secret-mask union for masking.
22
18
  */
23
- export const settingsProfileBody = z.object({
24
- description: z.string(),
25
- env: z.record(z.string(), z.string()),
26
- secret_keys: z.array(z.string()),
27
- });
19
+ export const settingsProfileBody = openapi.settingsProfileBody;
28
20
  /** `PUT /api/config/profiles/{name}` — a minimal save ack; `version` is the new store version. */
29
- export const settingsProfileSaved = z.object({
30
- ok: z.literal(true),
31
- version: z.number().optional(),
32
- });
21
+ export const settingsProfileSaved = openapi.profileWriteResult;
33
22
  /** `DELETE /api/config/profiles/{name}` — a minimal removal ack. */
34
- export const settingsProfileDeleted = z.object({ ok: z.literal(true) });
35
- /** `POST /api/config/profiles/{name}/rollback` — the restore ack; `version` is the resulting active version. */
36
- export const settingsProfileRollback = z.object({
37
- ok: z.literal(true),
38
- version: z.number(),
39
- });
23
+ export const settingsProfileDeleted = openapi.okResult;
24
+ /**
25
+ * `POST /api/config/profiles/{name}/rollback` — the restore ack; `version` is the resulting
26
+ * active version.
27
+ */
28
+ export const settingsProfileRollback = openapi.profileWriteResult;
40
29
  /**
41
30
  * `POST /api/config/profiles/{name}/diff` — the SAVED profile vs the stored env
42
31
  * (action=secret). `changed` carries real `old`/`new` values (UI masks via
43
32
  * JsonDiff); `recycle_keys`/`refused_keys` are the diff's recycle-class and
44
33
  * boundary-refused key names, called out in the UI before apply.
45
34
  */
46
- export const settingsProfileDiff = z.object({
47
- added: z.array(z.string()),
48
- removed: z.array(z.string()),
49
- changed: z.array(z.object({ key: z.string(), old: z.string(), new: z.string() })),
50
- recycle_keys: z.array(z.string()),
51
- refused_keys: z.array(z.string()),
52
- });
35
+ export const settingsProfileDiff = openapi.profileDiff;
53
36
  /**
54
37
  * `POST /api/config/profiles/{name}/apply` — the dedicated `profile_apply_response`
55
38
  * (action=fenced, destructive). NAMES-ONLY (no env value in any
@@ -59,22 +42,16 @@ export const settingsProfileDiff = z.object({
59
42
  * the `self-deferred` status literal when the diff has serve-affecting recycle keys;
60
43
  * `fresh` is the per-kind list of NEW ready lives observed since the pre-apply snapshot
61
44
  * (each `{name, kind, generation}`), evidence of fresh capacity and never claimed as any
62
- * target's successor; `refused` is `[]` on success by construction (populated
63
- * `{key, reason}` only on a refusal), the populated refusal surfaces being the diff
64
- * preview and the refusal error report. `fanout` is the mode-wrapped fleet broadcast,
65
- * parsed EXPLICITLY so a failed propagation reaches the shared fleet-report handler. A
66
- * drift throws `ApiSchemaError`.
45
+ * target's successor; `refused` is `[]` on success by construction (the refused key
46
+ * names only on a refusal), the populated refusal surfaces being the diff preview and
47
+ * the refusal error report; `recycle_stopped` names the target a stopped recycle roll
48
+ * halted at, or is `null` when the roll ran to its end; `awaiting_respawn` names the
49
+ * workers (name + keys) still awaiting a respawn after the apply (empty when the roll
50
+ * converged). `fanout` is the mode-wrapped fleet broadcast, parsed EXPLICITLY so a failed
51
+ * propagation reaches the shared fleet-report handler. A drift throws `ApiSchemaError`.
67
52
  */
68
- export const profileApplyResponse = z.object({
69
- hot: z.array(z.string()),
70
- recycle: z.array(z.object({
71
- name: z.string(),
72
- kind: z.string(),
73
- status: z.string(),
74
- generation_before: z.number(),
75
- })),
76
- fresh: z.array(z.object({ name: z.string(), kind: z.string(), generation: z.number() })),
77
- refused: z.array(z.object({ key: z.string(), reason: z.string() })),
53
+ // The fan-out is hand-typed: the spec publishes it as one object with optional fields.
54
+ export const profileApplyResponse = openapi.profileApplyResponse.extend({
78
55
  fanout: fleetReportFanout,
79
56
  });
80
57
  /**
@@ -82,19 +59,12 @@ export const profileApplyResponse = z.object({
82
59
  * no bodies), the generic versioned-store row minus `body`. `is_current` flags the
83
60
  * active pointer.
84
61
  */
85
- export const settingsProfileVersionMeta = z.object({
86
- version: z.number(),
87
- tags: z.array(z.string()),
88
- created_at: z.string(),
89
- is_current: z.boolean(),
90
- });
91
- export const settingsProfileVersionList = z.array(settingsProfileVersionMeta);
62
+ export const settingsProfileVersionMeta = openapi.profileVersionSummary;
63
+ export const settingsProfileVersionList = openapi.profileVersionListResponse;
92
64
  /**
93
65
  * `GET /api/config/profiles/{name}/versions/{version}` — one immutable version WITH
94
66
  * its `body` (action=secret; body rendered masked per the secret-mask union). The generic
95
67
  * versioned-store row shape.
96
68
  */
97
- export const settingsProfileVersion = settingsProfileVersionMeta.extend({
98
- body: settingsProfileBody,
99
- });
69
+ export const settingsProfileVersion = openapi.profileVersionView;
100
70
  //# sourceMappingURL=profiles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/schemas/profiles.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,gFAAgF;AAChF,0FAA0F;AAC1F,2CAA2C;AAE3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,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O,CAAC,oBAAoB,CAAC,MAAM,CAAC;IACtE,MAAM,EAAE,iBAAiB;CAC1B,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAExE,MAAM,CAAC,MAAM,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,CAAC;AAE7E;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC,kBAAkB,CAAC"}
@@ -16,12 +16,12 @@ export declare const roleGrants: z.ZodRecord<z.ZodString, z.ZodEnum<{
16
16
  export type RoleGrants = z.infer<typeof roleGrants>;
17
17
  export declare const roleList: z.ZodArray<z.ZodObject<{
18
18
  allow_all: z.ZodDefault<z.ZodBoolean>;
19
- base_tier: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
20
- condition: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
19
+ base_tier: z.ZodDefault<z.ZodNullable<z.ZodString>>;
20
+ condition: z.ZodDefault<z.ZodNullable<z.ZodObject<{
21
21
  content: z.ZodOptional<z.ZodString>;
22
22
  id: z.ZodOptional<z.ZodString>;
23
23
  kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
24
- }, z.core.$strict>, z.ZodNull]>>;
24
+ }, z.core.$strict>>>;
25
25
  description: z.ZodString;
26
26
  grants: z.ZodRecord<z.ZodString, z.ZodEnum<{
27
27
  none: "none";
@@ -33,8 +33,8 @@ export declare const roleList: z.ZodArray<z.ZodObject<{
33
33
  }, z.core.$strip>>;
34
34
  /** `DELETE /api/auth/roles/{name}` — the deleted role's name. */
35
35
  export declare const roleDeleted: z.ZodObject<{
36
- name: z.ZodString;
37
36
  deleted: z.ZodBoolean;
37
+ name: z.ZodString;
38
38
  }, z.core.$strip>;
39
39
  /**
40
40
  * One immutable role-version row (`GET /api/auth/roles/{name}/versions` →
@@ -42,15 +42,18 @@ export declare const roleDeleted: z.ZodObject<{
42
42
  * active pointer. Mirrors the generic versioned-store row shape.
43
43
  */
44
44
  export declare const roleVersion: z.ZodObject<{
45
+ created_at: z.ZodString;
46
+ is_current: z.ZodDefault<z.ZodBoolean>;
47
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
45
48
  version: z.ZodNumber;
46
49
  body: z.ZodObject<{
47
50
  allow_all: z.ZodDefault<z.ZodBoolean>;
48
- base_tier: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
49
- condition: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
51
+ base_tier: z.ZodDefault<z.ZodNullable<z.ZodString>>;
52
+ condition: z.ZodDefault<z.ZodNullable<z.ZodObject<{
50
53
  content: z.ZodOptional<z.ZodString>;
51
54
  id: z.ZodOptional<z.ZodString>;
52
55
  kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
53
- }, z.core.$strict>, z.ZodNull]>>;
56
+ }, z.core.$strict>>>;
54
57
  description: z.ZodString;
55
58
  grants: z.ZodRecord<z.ZodString, z.ZodEnum<{
56
59
  none: "none";
@@ -60,9 +63,6 @@ export declare const roleVersion: z.ZodObject<{
60
63
  name: z.ZodString;
61
64
  scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
62
65
  }, z.core.$strip>;
63
- tags: z.ZodArray<z.ZodString>;
64
- created_at: z.ZodString;
65
- is_current: z.ZodBoolean;
66
66
  }, z.core.$strip>;
67
67
  export type RoleVersion = z.infer<typeof roleVersion>;
68
68
  /**
@@ -71,6 +71,9 @@ export type RoleVersion = z.infer<typeof roleVersion>;
71
71
  * role bodies (both `null` for a create's `before` / a delete's `after`).
72
72
  */
73
73
  export declare const roleAuditEvent: z.ZodObject<{
74
+ created_at: z.ZodString;
75
+ is_current: z.ZodDefault<z.ZodBoolean>;
76
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
74
77
  version: z.ZodNumber;
75
78
  body: z.ZodObject<{
76
79
  action: z.ZodString;
@@ -78,23 +81,23 @@ export declare const roleAuditEvent: z.ZodObject<{
78
81
  before: z.ZodNullable<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
79
82
  after: z.ZodNullable<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
80
83
  }, z.core.$strip>;
81
- tags: z.ZodArray<z.ZodString>;
82
- created_at: z.ZodString;
83
- is_current: z.ZodBoolean;
84
84
  }, z.core.$strip>;
85
85
  export type RoleAuditEvent = z.infer<typeof roleAuditEvent>;
86
86
  /** `GET /api/auth/roles/{name}/versions` — the append-only history + audit trail. */
87
87
  export declare const roleVersions: z.ZodObject<{
88
88
  versions: z.ZodArray<z.ZodObject<{
89
+ created_at: z.ZodString;
90
+ is_current: z.ZodDefault<z.ZodBoolean>;
91
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
89
92
  version: z.ZodNumber;
90
93
  body: z.ZodObject<{
91
94
  allow_all: z.ZodDefault<z.ZodBoolean>;
92
- base_tier: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
93
- condition: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
95
+ base_tier: z.ZodDefault<z.ZodNullable<z.ZodString>>;
96
+ condition: z.ZodDefault<z.ZodNullable<z.ZodObject<{
94
97
  content: z.ZodOptional<z.ZodString>;
95
98
  id: z.ZodOptional<z.ZodString>;
96
99
  kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
97
- }, z.core.$strict>, z.ZodNull]>>;
100
+ }, z.core.$strict>>>;
98
101
  description: z.ZodString;
99
102
  grants: z.ZodRecord<z.ZodString, z.ZodEnum<{
100
103
  none: "none";
@@ -104,11 +107,11 @@ export declare const roleVersions: z.ZodObject<{
104
107
  name: z.ZodString;
105
108
  scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
106
109
  }, z.core.$strip>;
107
- tags: z.ZodArray<z.ZodString>;
108
- created_at: z.ZodString;
109
- is_current: z.ZodBoolean;
110
110
  }, z.core.$strip>>;
111
111
  audit: z.ZodArray<z.ZodObject<{
112
+ created_at: z.ZodString;
113
+ is_current: z.ZodDefault<z.ZodBoolean>;
114
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
112
115
  version: z.ZodNumber;
113
116
  body: z.ZodObject<{
114
117
  action: z.ZodString;
@@ -116,9 +119,6 @@ export declare const roleVersions: z.ZodObject<{
116
119
  before: z.ZodNullable<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
117
120
  after: z.ZodNullable<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
118
121
  }, z.core.$strip>;
119
- tags: z.ZodArray<z.ZodString>;
120
- created_at: z.ZodString;
121
- is_current: z.ZodBoolean;
122
122
  }, z.core.$strip>>;
123
123
  }, z.core.$strip>;
124
124
  export type RoleVersions = z.infer<typeof roleVersions>;
@@ -1 +1 @@
1
- {"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/schemas/roles.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,6EAA6E;AAC7E,eAAO,MAAM,UAAU;;;;EAAoC,CAAC;AAC5D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,qFAAqF;AACrF,eAAO,MAAM,UAAU;;;;GAAmC,CAAC;AAC3D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;kBAAoB,CAAC;AAE1C,iEAAiE;AACjE,eAAO,MAAM,WAAW;;;iBAAuD,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;iBAMtB,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,K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;;;;;;;;;;;;;;;;;;;;;;;;iBAGvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
@@ -1,45 +1,38 @@
1
1
  /** Role grant, version and audit response schemas. */
2
2
  import { z } from 'zod';
3
+ import * as openapi from '../generated/openapi-schemas';
3
4
  import { roleBody } from './served';
4
5
  import { jsonValue } from './shared';
5
6
  /** A role's per-tag ACCESS LEVEL: `none` (no access), `read`, or `write`. */
6
- export const grantLevel = z.enum(['none', 'read', 'write']);
7
+ export const grantLevel = roleBody.shape.grants.valueType;
7
8
  /** A role's editable grant map: feature-group TAG name → the role's access level. */
8
- export const roleGrants = z.record(z.string(), grantLevel);
9
- export const roleList = z.array(roleBody);
9
+ export const roleGrants = roleBody.shape.grants;
10
+ export const roleList = openapi.roleDefinitionList;
10
11
  /** `DELETE /api/auth/roles/{name}` — the deleted role's name. */
11
- export const roleDeleted = z.object({ name: z.string(), deleted: z.boolean() });
12
+ export const roleDeleted = openapi.roleDeleted;
13
+ // The version and audit bodies are hand-typed: the spec publishes a version body as an open
14
+ // object.
12
15
  /**
13
16
  * One immutable role-version row (`GET /api/auth/roles/{name}/versions` →
14
17
  * `versions`). `body` is the role body at that version; `is_current` flags the
15
18
  * active pointer. Mirrors the generic versioned-store row shape.
16
19
  */
17
- export const roleVersion = z.object({
18
- version: z.number(),
19
- body: roleBody,
20
- tags: z.array(z.string()),
21
- created_at: z.string(),
22
- is_current: z.boolean(),
23
- });
20
+ export const roleVersion = openapi.documentVersion.extend({ body: roleBody });
24
21
  /**
25
22
  * One who/action/before→after audit row (`GET /api/auth/roles/{name}/versions` →
26
23
  * `audit`). Its `body` carries the mutation kind, the actor, and the before/after
27
24
  * role bodies (both `null` for a create's `before` / a delete's `after`).
28
25
  */
29
- export const roleAuditEvent = z.object({
30
- version: z.number(),
26
+ export const roleAuditEvent = openapi.documentVersion.extend({
31
27
  body: z.object({
32
28
  action: z.string(),
33
29
  actor: z.string().nullable(),
34
30
  before: jsonValue.nullable(),
35
31
  after: jsonValue.nullable(),
36
32
  }),
37
- tags: z.array(z.string()),
38
- created_at: z.string(),
39
- is_current: z.boolean(),
40
33
  });
41
34
  /** `GET /api/auth/roles/{name}/versions` — the append-only history + audit trail. */
42
- export const roleVersions = z.object({
35
+ export const roleVersions = openapi.roleVersionsView.extend({
43
36
  versions: z.array(roleVersion),
44
37
  audit: z.array(roleAuditEvent),
45
38
  });
@@ -1 +1 @@
1
- {"version":3,"file":"roles.js","sourceRoot":"","sources":["../../src/schemas/roles.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,6EAA6E;AAC7E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAG5D,qFAAqF;AACrF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC;AAG3D,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAE1C,iEAAiE;AACjE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AAEhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC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