@marinoscar/platform-contract 0.0.0-stage → 0.1.0-next.4

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 (758) hide show
  1. package/CHANGELOG.md +206 -0
  2. package/LICENSE +21 -0
  3. package/README.md +167 -2
  4. package/dist/cjs/ai/capabilities.d.ts +85 -0
  5. package/dist/cjs/ai/capabilities.d.ts.map +1 -0
  6. package/dist/cjs/ai/capabilities.js +93 -0
  7. package/dist/cjs/ai/capabilities.js.map +1 -0
  8. package/dist/cjs/ai/constants.d.ts +239 -0
  9. package/dist/cjs/ai/constants.d.ts.map +1 -0
  10. package/dist/cjs/ai/constants.js +233 -0
  11. package/dist/cjs/ai/constants.js.map +1 -0
  12. package/dist/cjs/ai/features.d.ts +24 -0
  13. package/dist/cjs/ai/features.d.ts.map +1 -0
  14. package/dist/cjs/ai/features.js +33 -0
  15. package/dist/cjs/ai/features.js.map +1 -0
  16. package/dist/cjs/ai/index.d.ts +11 -0
  17. package/dist/cjs/ai/index.d.ts.map +1 -0
  18. package/dist/cjs/ai/index.js +81 -0
  19. package/dist/cjs/ai/index.js.map +1 -0
  20. package/dist/cjs/ai/org-keys.d.ts +50 -0
  21. package/dist/cjs/ai/org-keys.d.ts.map +1 -0
  22. package/dist/cjs/ai/org-keys.js +43 -0
  23. package/dist/cjs/ai/org-keys.js.map +1 -0
  24. package/dist/cjs/ai/schemas.d.ts +642 -0
  25. package/dist/cjs/ai/schemas.d.ts.map +1 -0
  26. package/dist/cjs/ai/schemas.js +894 -0
  27. package/dist/cjs/ai/schemas.js.map +1 -0
  28. package/dist/cjs/android-app/constants.d.ts +337 -0
  29. package/dist/cjs/android-app/constants.d.ts.map +1 -0
  30. package/dist/cjs/android-app/constants.js +312 -0
  31. package/dist/cjs/android-app/constants.js.map +1 -0
  32. package/dist/cjs/android-app/index.d.ts +5 -0
  33. package/dist/cjs/android-app/index.d.ts.map +1 -0
  34. package/dist/cjs/android-app/index.js +57 -0
  35. package/dist/cjs/android-app/index.js.map +1 -0
  36. package/dist/cjs/android-app/schemas.d.ts +358 -0
  37. package/dist/cjs/android-app/schemas.d.ts.map +1 -0
  38. package/dist/cjs/android-app/schemas.js +310 -0
  39. package/dist/cjs/android-app/schemas.js.map +1 -0
  40. package/dist/cjs/credentials/constants.d.ts +35 -0
  41. package/dist/cjs/credentials/constants.d.ts.map +1 -0
  42. package/dist/cjs/credentials/constants.js +39 -0
  43. package/dist/cjs/credentials/constants.js.map +1 -0
  44. package/dist/cjs/credentials/index.d.ts +5 -0
  45. package/dist/cjs/credentials/index.d.ts.map +1 -0
  46. package/dist/cjs/credentials/index.js +17 -0
  47. package/dist/cjs/credentials/index.js.map +1 -0
  48. package/dist/cjs/credentials/schemas.d.ts +64 -0
  49. package/dist/cjs/credentials/schemas.d.ts.map +1 -0
  50. package/dist/cjs/credentials/schemas.js +82 -0
  51. package/dist/cjs/credentials/schemas.js.map +1 -0
  52. package/dist/cjs/db-backup/config.d.ts +76 -0
  53. package/dist/cjs/db-backup/config.d.ts.map +1 -0
  54. package/dist/cjs/db-backup/config.js +115 -0
  55. package/dist/cjs/db-backup/config.js.map +1 -0
  56. package/dist/cjs/db-backup/constants.d.ts +314 -0
  57. package/dist/cjs/db-backup/constants.d.ts.map +1 -0
  58. package/dist/cjs/db-backup/constants.js +243 -0
  59. package/dist/cjs/db-backup/constants.js.map +1 -0
  60. package/dist/cjs/db-backup/index.d.ts +19 -0
  61. package/dist/cjs/db-backup/index.d.ts.map +1 -0
  62. package/dist/cjs/db-backup/index.js +81 -0
  63. package/dist/cjs/db-backup/index.js.map +1 -0
  64. package/dist/cjs/db-backup/node-credential.d.ts +37 -0
  65. package/dist/cjs/db-backup/node-credential.d.ts.map +1 -0
  66. package/dist/cjs/db-backup/node-credential.js +107 -0
  67. package/dist/cjs/db-backup/node-credential.js.map +1 -0
  68. package/dist/cjs/db-backup/node-result.d.ts +34 -0
  69. package/dist/cjs/db-backup/node-result.d.ts.map +1 -0
  70. package/dist/cjs/db-backup/node-result.js +168 -0
  71. package/dist/cjs/db-backup/node-result.js.map +1 -0
  72. package/dist/cjs/db-backup/restore.d.ts +405 -0
  73. package/dist/cjs/db-backup/restore.d.ts.map +1 -0
  74. package/dist/cjs/db-backup/restore.js +497 -0
  75. package/dist/cjs/db-backup/restore.js.map +1 -0
  76. package/dist/cjs/db-backup/run-actions.d.ts +49 -0
  77. package/dist/cjs/db-backup/run-actions.d.ts.map +1 -0
  78. package/dist/cjs/db-backup/run-actions.js +121 -0
  79. package/dist/cjs/db-backup/run-actions.js.map +1 -0
  80. package/dist/cjs/db-backup/runs-list-query.d.ts +20 -0
  81. package/dist/cjs/db-backup/runs-list-query.d.ts.map +1 -0
  82. package/dist/cjs/db-backup/runs-list-query.js +53 -0
  83. package/dist/cjs/db-backup/runs-list-query.js.map +1 -0
  84. package/dist/cjs/db-backup/runs.d.ts +46 -0
  85. package/dist/cjs/db-backup/runs.d.ts.map +1 -0
  86. package/dist/cjs/db-backup/runs.js +232 -0
  87. package/dist/cjs/db-backup/runs.js.map +1 -0
  88. package/dist/cjs/db-backup/schemas.d.ts +9 -0
  89. package/dist/cjs/db-backup/schemas.d.ts.map +1 -0
  90. package/dist/cjs/db-backup/schemas.js +31 -0
  91. package/dist/cjs/db-backup/schemas.js.map +1 -0
  92. package/dist/cjs/db-backup/settings-schemas.d.ts +217 -0
  93. package/dist/cjs/db-backup/settings-schemas.d.ts.map +1 -0
  94. package/dist/cjs/db-backup/settings-schemas.js +319 -0
  95. package/dist/cjs/db-backup/settings-schemas.js.map +1 -0
  96. package/dist/cjs/doctor/constants.d.ts +59 -0
  97. package/dist/cjs/doctor/constants.d.ts.map +1 -0
  98. package/dist/cjs/doctor/constants.js +57 -0
  99. package/dist/cjs/doctor/constants.js.map +1 -0
  100. package/dist/cjs/doctor/index.d.ts +5 -0
  101. package/dist/cjs/doctor/index.d.ts.map +1 -0
  102. package/dist/cjs/doctor/index.js +24 -0
  103. package/dist/cjs/doctor/index.js.map +1 -0
  104. package/dist/cjs/doctor/schemas.d.ts +186 -0
  105. package/dist/cjs/doctor/schemas.d.ts.map +1 -0
  106. package/dist/cjs/doctor/schemas.js +183 -0
  107. package/dist/cjs/doctor/schemas.js.map +1 -0
  108. package/dist/cjs/email/constants.d.ts +82 -0
  109. package/dist/cjs/email/constants.d.ts.map +1 -0
  110. package/dist/cjs/email/constants.js +82 -0
  111. package/dist/cjs/email/constants.js.map +1 -0
  112. package/dist/cjs/email/index.d.ts +5 -0
  113. package/dist/cjs/email/index.d.ts.map +1 -0
  114. package/dist/cjs/email/index.js +30 -0
  115. package/dist/cjs/email/index.js.map +1 -0
  116. package/dist/cjs/email/schemas.d.ts +276 -0
  117. package/dist/cjs/email/schemas.d.ts.map +1 -0
  118. package/dist/cjs/email/schemas.js +280 -0
  119. package/dist/cjs/email/schemas.js.map +1 -0
  120. package/dist/cjs/exports/constants.d.ts +123 -0
  121. package/dist/cjs/exports/constants.d.ts.map +1 -0
  122. package/dist/cjs/exports/constants.js +109 -0
  123. package/dist/cjs/exports/constants.js.map +1 -0
  124. package/dist/cjs/exports/index.d.ts +5 -0
  125. package/dist/cjs/exports/index.d.ts.map +1 -0
  126. package/dist/cjs/exports/index.js +42 -0
  127. package/dist/cjs/exports/index.js.map +1 -0
  128. package/dist/cjs/exports/schemas.d.ts +386 -0
  129. package/dist/cjs/exports/schemas.d.ts.map +1 -0
  130. package/dist/cjs/exports/schemas.js +288 -0
  131. package/dist/cjs/exports/schemas.js.map +1 -0
  132. package/dist/cjs/identity/constants.d.ts +273 -0
  133. package/dist/cjs/identity/constants.d.ts.map +1 -0
  134. package/dist/cjs/identity/constants.js +248 -0
  135. package/dist/cjs/identity/constants.js.map +1 -0
  136. package/dist/cjs/identity/index.d.ts +5 -0
  137. package/dist/cjs/identity/index.d.ts.map +1 -0
  138. package/dist/cjs/identity/index.js +73 -0
  139. package/dist/cjs/identity/index.js.map +1 -0
  140. package/dist/cjs/identity/schemas.d.ts +784 -0
  141. package/dist/cjs/identity/schemas.d.ts.map +1 -0
  142. package/dist/cjs/identity/schemas.js +684 -0
  143. package/dist/cjs/identity/schemas.js.map +1 -0
  144. package/dist/cjs/index.d.ts +13 -0
  145. package/dist/cjs/index.d.ts.map +1 -0
  146. package/dist/cjs/index.js +16 -0
  147. package/dist/cjs/index.js.map +1 -0
  148. package/dist/cjs/jobs/constants.d.ts +135 -0
  149. package/dist/cjs/jobs/constants.d.ts.map +1 -0
  150. package/dist/cjs/jobs/constants.js +130 -0
  151. package/dist/cjs/jobs/constants.js.map +1 -0
  152. package/dist/cjs/jobs/index.d.ts +9 -0
  153. package/dist/cjs/jobs/index.d.ts.map +1 -0
  154. package/dist/cjs/jobs/index.js +59 -0
  155. package/dist/cjs/jobs/index.js.map +1 -0
  156. package/dist/cjs/jobs/retention-schemas.d.ts +252 -0
  157. package/dist/cjs/jobs/retention-schemas.d.ts.map +1 -0
  158. package/dist/cjs/jobs/retention-schemas.js +233 -0
  159. package/dist/cjs/jobs/retention-schemas.js.map +1 -0
  160. package/dist/cjs/jobs/schemas.d.ts +361 -0
  161. package/dist/cjs/jobs/schemas.d.ts.map +1 -0
  162. package/dist/cjs/jobs/schemas.js +706 -0
  163. package/dist/cjs/jobs/schemas.js.map +1 -0
  164. package/dist/cjs/jobs/settings-schemas.d.ts +84 -0
  165. package/dist/cjs/jobs/settings-schemas.d.ts.map +1 -0
  166. package/dist/cjs/jobs/settings-schemas.js +116 -0
  167. package/dist/cjs/jobs/settings-schemas.js.map +1 -0
  168. package/dist/cjs/nodes/admin-schemas.d.ts +204 -0
  169. package/dist/cjs/nodes/admin-schemas.d.ts.map +1 -0
  170. package/dist/cjs/nodes/admin-schemas.js +153 -0
  171. package/dist/cjs/nodes/admin-schemas.js.map +1 -0
  172. package/dist/cjs/nodes/constants.d.ts +86 -0
  173. package/dist/cjs/nodes/constants.d.ts.map +1 -0
  174. package/dist/cjs/nodes/constants.js +102 -0
  175. package/dist/cjs/nodes/constants.js.map +1 -0
  176. package/dist/cjs/nodes/index.d.ts +8 -0
  177. package/dist/cjs/nodes/index.d.ts.map +1 -0
  178. package/dist/cjs/nodes/index.js +50 -0
  179. package/dist/cjs/nodes/index.js.map +1 -0
  180. package/dist/cjs/nodes/schemas.d.ts +332 -0
  181. package/dist/cjs/nodes/schemas.d.ts.map +1 -0
  182. package/dist/cjs/nodes/schemas.js +937 -0
  183. package/dist/cjs/nodes/schemas.js.map +1 -0
  184. package/dist/cjs/nodes/settings-schemas.d.ts +82 -0
  185. package/dist/cjs/nodes/settings-schemas.d.ts.map +1 -0
  186. package/dist/cjs/nodes/settings-schemas.js +106 -0
  187. package/dist/cjs/nodes/settings-schemas.js.map +1 -0
  188. package/dist/cjs/notifications/constants.d.ts +197 -0
  189. package/dist/cjs/notifications/constants.d.ts.map +1 -0
  190. package/dist/cjs/notifications/constants.js +181 -0
  191. package/dist/cjs/notifications/constants.js.map +1 -0
  192. package/dist/cjs/notifications/index.d.ts +5 -0
  193. package/dist/cjs/notifications/index.d.ts.map +1 -0
  194. package/dist/cjs/notifications/index.js +86 -0
  195. package/dist/cjs/notifications/index.js.map +1 -0
  196. package/dist/cjs/notifications/schemas.d.ts +1016 -0
  197. package/dist/cjs/notifications/schemas.d.ts.map +1 -0
  198. package/dist/cjs/notifications/schemas.js +851 -0
  199. package/dist/cjs/notifications/schemas.js.map +1 -0
  200. package/dist/cjs/onboarding/constants.d.ts +138 -0
  201. package/dist/cjs/onboarding/constants.d.ts.map +1 -0
  202. package/dist/cjs/onboarding/constants.js +123 -0
  203. package/dist/cjs/onboarding/constants.js.map +1 -0
  204. package/dist/cjs/onboarding/index.d.ts +5 -0
  205. package/dist/cjs/onboarding/index.d.ts.map +1 -0
  206. package/dist/cjs/onboarding/index.js +42 -0
  207. package/dist/cjs/onboarding/index.js.map +1 -0
  208. package/dist/cjs/onboarding/schemas.d.ts +360 -0
  209. package/dist/cjs/onboarding/schemas.d.ts.map +1 -0
  210. package/dist/cjs/onboarding/schemas.js +260 -0
  211. package/dist/cjs/onboarding/schemas.js.map +1 -0
  212. package/dist/cjs/package.json +3 -0
  213. package/dist/cjs/settings/constants.d.ts +206 -0
  214. package/dist/cjs/settings/constants.d.ts.map +1 -0
  215. package/dist/cjs/settings/constants.js +200 -0
  216. package/dist/cjs/settings/constants.js.map +1 -0
  217. package/dist/cjs/settings/index.d.ts +6 -0
  218. package/dist/cjs/settings/index.d.ts.map +1 -0
  219. package/dist/cjs/settings/index.js +62 -0
  220. package/dist/cjs/settings/index.js.map +1 -0
  221. package/dist/cjs/settings/schemas.d.ts +574 -0
  222. package/dist/cjs/settings/schemas.d.ts.map +1 -0
  223. package/dist/cjs/settings/schemas.js +437 -0
  224. package/dist/cjs/settings/schemas.js.map +1 -0
  225. package/dist/cjs/settings/types.d.ts +79 -0
  226. package/dist/cjs/settings/types.d.ts.map +1 -0
  227. package/dist/cjs/settings/types.js +6 -0
  228. package/dist/cjs/settings/types.js.map +1 -0
  229. package/dist/cjs/sharing/constants.d.ts +216 -0
  230. package/dist/cjs/sharing/constants.d.ts.map +1 -0
  231. package/dist/cjs/sharing/constants.js +163 -0
  232. package/dist/cjs/sharing/constants.js.map +1 -0
  233. package/dist/cjs/sharing/enum.d.ts +5 -0
  234. package/dist/cjs/sharing/enum.d.ts.map +1 -0
  235. package/dist/cjs/sharing/enum.js +9 -0
  236. package/dist/cjs/sharing/enum.js.map +1 -0
  237. package/dist/cjs/sharing/grants.d.ts +490 -0
  238. package/dist/cjs/sharing/grants.d.ts.map +1 -0
  239. package/dist/cjs/sharing/grants.js +447 -0
  240. package/dist/cjs/sharing/grants.js.map +1 -0
  241. package/dist/cjs/sharing/groups.d.ts +410 -0
  242. package/dist/cjs/sharing/groups.d.ts.map +1 -0
  243. package/dist/cjs/sharing/groups.js +375 -0
  244. package/dist/cjs/sharing/groups.js.map +1 -0
  245. package/dist/cjs/sharing/index.d.ts +5 -0
  246. package/dist/cjs/sharing/index.d.ts.map +1 -0
  247. package/dist/cjs/sharing/index.js +77 -0
  248. package/dist/cjs/sharing/index.js.map +1 -0
  249. package/dist/cjs/sharing/schemas.d.ts +3 -0
  250. package/dist/cjs/sharing/schemas.d.ts.map +1 -0
  251. package/dist/cjs/sharing/schemas.js +21 -0
  252. package/dist/cjs/sharing/schemas.js.map +1 -0
  253. package/dist/cjs/storage/constants.d.ts +111 -0
  254. package/dist/cjs/storage/constants.d.ts.map +1 -0
  255. package/dist/cjs/storage/constants.js +107 -0
  256. package/dist/cjs/storage/constants.js.map +1 -0
  257. package/dist/cjs/storage/index.d.ts +27 -0
  258. package/dist/cjs/storage/index.d.ts.map +1 -0
  259. package/dist/cjs/storage/index.js +69 -0
  260. package/dist/cjs/storage/index.js.map +1 -0
  261. package/dist/cjs/storage/objects-complete-upload.d.ts +19 -0
  262. package/dist/cjs/storage/objects-complete-upload.d.ts.map +1 -0
  263. package/dist/cjs/storage/objects-complete-upload.js +19 -0
  264. package/dist/cjs/storage/objects-complete-upload.js.map +1 -0
  265. package/dist/cjs/storage/objects-download-url.d.ts +17 -0
  266. package/dist/cjs/storage/objects-download-url.d.ts.map +1 -0
  267. package/dist/cjs/storage/objects-download-url.js +16 -0
  268. package/dist/cjs/storage/objects-download-url.js.map +1 -0
  269. package/dist/cjs/storage/objects-init-upload.d.ts +39 -0
  270. package/dist/cjs/storage/objects-init-upload.d.ts.map +1 -0
  271. package/dist/cjs/storage/objects-init-upload.js +40 -0
  272. package/dist/cjs/storage/objects-init-upload.js.map +1 -0
  273. package/dist/cjs/storage/objects-list-query.d.ts +50 -0
  274. package/dist/cjs/storage/objects-list-query.d.ts.map +1 -0
  275. package/dist/cjs/storage/objects-list-query.js +23 -0
  276. package/dist/cjs/storage/objects-list-query.js.map +1 -0
  277. package/dist/cjs/storage/objects-object-response.d.ts +49 -0
  278. package/dist/cjs/storage/objects-object-response.d.ts.map +1 -0
  279. package/dist/cjs/storage/objects-object-response.js +54 -0
  280. package/dist/cjs/storage/objects-object-response.js.map +1 -0
  281. package/dist/cjs/storage/objects-update-metadata.d.ts +16 -0
  282. package/dist/cjs/storage/objects-update-metadata.d.ts.map +1 -0
  283. package/dist/cjs/storage/objects-update-metadata.js +14 -0
  284. package/dist/cjs/storage/objects-update-metadata.js.map +1 -0
  285. package/dist/cjs/storage/schemas.d.ts +13 -0
  286. package/dist/cjs/storage/schemas.d.ts.map +1 -0
  287. package/dist/cjs/storage/schemas.js +35 -0
  288. package/dist/cjs/storage/schemas.js.map +1 -0
  289. package/dist/cjs/storage/settings-schemas.d.ts +188 -0
  290. package/dist/cjs/storage/settings-schemas.d.ts.map +1 -0
  291. package/dist/cjs/storage/settings-schemas.js +223 -0
  292. package/dist/cjs/storage/settings-schemas.js.map +1 -0
  293. package/dist/cjs/storage/storage-bucket-provision.d.ts +152 -0
  294. package/dist/cjs/storage/storage-bucket-provision.d.ts.map +1 -0
  295. package/dist/cjs/storage/storage-bucket-provision.js +216 -0
  296. package/dist/cjs/storage/storage-bucket-provision.js.map +1 -0
  297. package/dist/cjs/storage/storage-config-response.d.ts +99 -0
  298. package/dist/cjs/storage/storage-config-response.d.ts.map +1 -0
  299. package/dist/cjs/storage/storage-config-response.js +173 -0
  300. package/dist/cjs/storage/storage-config-response.js.map +1 -0
  301. package/dist/cjs/storage/storage-config-update.d.ts +46 -0
  302. package/dist/cjs/storage/storage-config-update.d.ts.map +1 -0
  303. package/dist/cjs/storage/storage-config-update.js +133 -0
  304. package/dist/cjs/storage/storage-config-update.js.map +1 -0
  305. package/dist/cjs/storage/storage-connection-test.d.ts +129 -0
  306. package/dist/cjs/storage/storage-connection-test.d.ts.map +1 -0
  307. package/dist/cjs/storage/storage-connection-test.js +244 -0
  308. package/dist/cjs/storage/storage-connection-test.js.map +1 -0
  309. package/dist/cjs/storage/storage-status.d.ts +16 -0
  310. package/dist/cjs/storage/storage-status.d.ts.map +1 -0
  311. package/dist/cjs/storage/storage-status.js +23 -0
  312. package/dist/cjs/storage/storage-status.js.map +1 -0
  313. package/dist/cjs/telemetry/assistant.d.ts +173 -0
  314. package/dist/cjs/telemetry/assistant.d.ts.map +1 -0
  315. package/dist/cjs/telemetry/assistant.js +43 -0
  316. package/dist/cjs/telemetry/assistant.js.map +1 -0
  317. package/dist/cjs/telemetry/config.d.ts +96 -0
  318. package/dist/cjs/telemetry/config.d.ts.map +1 -0
  319. package/dist/cjs/telemetry/config.js +115 -0
  320. package/dist/cjs/telemetry/config.js.map +1 -0
  321. package/dist/cjs/telemetry/connection.d.ts +355 -0
  322. package/dist/cjs/telemetry/connection.d.ts.map +1 -0
  323. package/dist/cjs/telemetry/connection.js +451 -0
  324. package/dist/cjs/telemetry/connection.js.map +1 -0
  325. package/dist/cjs/telemetry/constants.d.ts +814 -0
  326. package/dist/cjs/telemetry/constants.d.ts.map +1 -0
  327. package/dist/cjs/telemetry/constants.js +685 -0
  328. package/dist/cjs/telemetry/constants.js.map +1 -0
  329. package/dist/cjs/telemetry/dashboard.d.ts +997 -0
  330. package/dist/cjs/telemetry/dashboard.d.ts.map +1 -0
  331. package/dist/cjs/telemetry/dashboard.js +755 -0
  332. package/dist/cjs/telemetry/dashboard.js.map +1 -0
  333. package/dist/cjs/telemetry/enum.d.ts +5 -0
  334. package/dist/cjs/telemetry/enum.d.ts.map +1 -0
  335. package/dist/cjs/telemetry/enum.js +12 -0
  336. package/dist/cjs/telemetry/enum.js.map +1 -0
  337. package/dist/cjs/telemetry/index.d.ts +5 -0
  338. package/dist/cjs/telemetry/index.d.ts.map +1 -0
  339. package/dist/cjs/telemetry/index.js +160 -0
  340. package/dist/cjs/telemetry/index.js.map +1 -0
  341. package/dist/cjs/telemetry/presentation.d.ts +243 -0
  342. package/dist/cjs/telemetry/presentation.d.ts.map +1 -0
  343. package/dist/cjs/telemetry/presentation.js +300 -0
  344. package/dist/cjs/telemetry/presentation.js.map +1 -0
  345. package/dist/cjs/telemetry/query.d.ts +147 -0
  346. package/dist/cjs/telemetry/query.d.ts.map +1 -0
  347. package/dist/cjs/telemetry/query.js +141 -0
  348. package/dist/cjs/telemetry/query.js.map +1 -0
  349. package/dist/cjs/telemetry/schemas.d.ts +20 -0
  350. package/dist/cjs/telemetry/schemas.d.ts.map +1 -0
  351. package/dist/cjs/telemetry/schemas.js +109 -0
  352. package/dist/cjs/telemetry/schemas.js.map +1 -0
  353. package/dist/cjs/telemetry/settings.d.ts +65 -0
  354. package/dist/cjs/telemetry/settings.d.ts.map +1 -0
  355. package/dist/cjs/telemetry/settings.js +77 -0
  356. package/dist/cjs/telemetry/settings.js.map +1 -0
  357. package/dist/cjs/telemetry/stack.d.ts +87 -0
  358. package/dist/cjs/telemetry/stack.d.ts.map +1 -0
  359. package/dist/cjs/telemetry/stack.js +93 -0
  360. package/dist/cjs/telemetry/stack.js.map +1 -0
  361. package/dist/cjs/telemetry/status.d.ts +65 -0
  362. package/dist/cjs/telemetry/status.d.ts.map +1 -0
  363. package/dist/cjs/telemetry/status.js +65 -0
  364. package/dist/cjs/telemetry/status.js.map +1 -0
  365. package/dist/cjs/telemetry/store.d.ts +111 -0
  366. package/dist/cjs/telemetry/store.d.ts.map +1 -0
  367. package/dist/cjs/telemetry/store.js +83 -0
  368. package/dist/cjs/telemetry/store.js.map +1 -0
  369. package/dist/cjs/user-data/constants.d.ts +157 -0
  370. package/dist/cjs/user-data/constants.d.ts.map +1 -0
  371. package/dist/cjs/user-data/constants.js +137 -0
  372. package/dist/cjs/user-data/constants.js.map +1 -0
  373. package/dist/cjs/user-data/index.d.ts +5 -0
  374. package/dist/cjs/user-data/index.d.ts.map +1 -0
  375. package/dist/cjs/user-data/index.js +46 -0
  376. package/dist/cjs/user-data/index.js.map +1 -0
  377. package/dist/cjs/user-data/schemas.d.ts +306 -0
  378. package/dist/cjs/user-data/schemas.d.ts.map +1 -0
  379. package/dist/cjs/user-data/schemas.js +333 -0
  380. package/dist/cjs/user-data/schemas.js.map +1 -0
  381. package/dist/esm/ai/capabilities.d.ts +85 -0
  382. package/dist/esm/ai/capabilities.d.ts.map +1 -0
  383. package/dist/esm/ai/capabilities.js +90 -0
  384. package/dist/esm/ai/capabilities.js.map +1 -0
  385. package/dist/esm/ai/constants.d.ts +239 -0
  386. package/dist/esm/ai/constants.d.ts.map +1 -0
  387. package/dist/esm/ai/constants.js +229 -0
  388. package/dist/esm/ai/constants.js.map +1 -0
  389. package/dist/esm/ai/features.d.ts +24 -0
  390. package/dist/esm/ai/features.d.ts.map +1 -0
  391. package/dist/esm/ai/features.js +30 -0
  392. package/dist/esm/ai/features.js.map +1 -0
  393. package/dist/esm/ai/index.d.ts +11 -0
  394. package/dist/esm/ai/index.d.ts.map +1 -0
  395. package/dist/esm/ai/index.js +16 -0
  396. package/dist/esm/ai/index.js.map +1 -0
  397. package/dist/esm/ai/org-keys.d.ts +50 -0
  398. package/dist/esm/ai/org-keys.d.ts.map +1 -0
  399. package/dist/esm/ai/org-keys.js +40 -0
  400. package/dist/esm/ai/org-keys.js.map +1 -0
  401. package/dist/esm/ai/schemas.d.ts +642 -0
  402. package/dist/esm/ai/schemas.d.ts.map +1 -0
  403. package/dist/esm/ai/schemas.js +889 -0
  404. package/dist/esm/ai/schemas.js.map +1 -0
  405. package/dist/esm/android-app/constants.d.ts +337 -0
  406. package/dist/esm/android-app/constants.d.ts.map +1 -0
  407. package/dist/esm/android-app/constants.js +306 -0
  408. package/dist/esm/android-app/constants.js.map +1 -0
  409. package/dist/esm/android-app/index.d.ts +5 -0
  410. package/dist/esm/android-app/index.d.ts.map +1 -0
  411. package/dist/esm/android-app/index.js +8 -0
  412. package/dist/esm/android-app/index.js.map +1 -0
  413. package/dist/esm/android-app/schemas.d.ts +358 -0
  414. package/dist/esm/android-app/schemas.d.ts.map +1 -0
  415. package/dist/esm/android-app/schemas.js +306 -0
  416. package/dist/esm/android-app/schemas.js.map +1 -0
  417. package/dist/esm/credentials/constants.d.ts +35 -0
  418. package/dist/esm/credentials/constants.d.ts.map +1 -0
  419. package/dist/esm/credentials/constants.js +36 -0
  420. package/dist/esm/credentials/constants.js.map +1 -0
  421. package/dist/esm/credentials/index.d.ts +5 -0
  422. package/dist/esm/credentials/index.d.ts.map +1 -0
  423. package/dist/esm/credentials/index.js +8 -0
  424. package/dist/esm/credentials/index.js.map +1 -0
  425. package/dist/esm/credentials/schemas.d.ts +64 -0
  426. package/dist/esm/credentials/schemas.d.ts.map +1 -0
  427. package/dist/esm/credentials/schemas.js +79 -0
  428. package/dist/esm/credentials/schemas.js.map +1 -0
  429. package/dist/esm/db-backup/config.d.ts +76 -0
  430. package/dist/esm/db-backup/config.d.ts.map +1 -0
  431. package/dist/esm/db-backup/config.js +112 -0
  432. package/dist/esm/db-backup/config.js.map +1 -0
  433. package/dist/esm/db-backup/constants.d.ts +314 -0
  434. package/dist/esm/db-backup/constants.d.ts.map +1 -0
  435. package/dist/esm/db-backup/constants.js +240 -0
  436. package/dist/esm/db-backup/constants.js.map +1 -0
  437. package/dist/esm/db-backup/index.d.ts +19 -0
  438. package/dist/esm/db-backup/index.d.ts.map +1 -0
  439. package/dist/esm/db-backup/index.js +25 -0
  440. package/dist/esm/db-backup/index.js.map +1 -0
  441. package/dist/esm/db-backup/node-credential.d.ts +37 -0
  442. package/dist/esm/db-backup/node-credential.d.ts.map +1 -0
  443. package/dist/esm/db-backup/node-credential.js +104 -0
  444. package/dist/esm/db-backup/node-credential.js.map +1 -0
  445. package/dist/esm/db-backup/node-result.d.ts +34 -0
  446. package/dist/esm/db-backup/node-result.d.ts.map +1 -0
  447. package/dist/esm/db-backup/node-result.js +165 -0
  448. package/dist/esm/db-backup/node-result.js.map +1 -0
  449. package/dist/esm/db-backup/restore.d.ts +405 -0
  450. package/dist/esm/db-backup/restore.d.ts.map +1 -0
  451. package/dist/esm/db-backup/restore.js +494 -0
  452. package/dist/esm/db-backup/restore.js.map +1 -0
  453. package/dist/esm/db-backup/run-actions.d.ts +49 -0
  454. package/dist/esm/db-backup/run-actions.d.ts.map +1 -0
  455. package/dist/esm/db-backup/run-actions.js +118 -0
  456. package/dist/esm/db-backup/run-actions.js.map +1 -0
  457. package/dist/esm/db-backup/runs-list-query.d.ts +20 -0
  458. package/dist/esm/db-backup/runs-list-query.d.ts.map +1 -0
  459. package/dist/esm/db-backup/runs-list-query.js +50 -0
  460. package/dist/esm/db-backup/runs-list-query.js.map +1 -0
  461. package/dist/esm/db-backup/runs.d.ts +46 -0
  462. package/dist/esm/db-backup/runs.d.ts.map +1 -0
  463. package/dist/esm/db-backup/runs.js +229 -0
  464. package/dist/esm/db-backup/runs.js.map +1 -0
  465. package/dist/esm/db-backup/schemas.d.ts +9 -0
  466. package/dist/esm/db-backup/schemas.d.ts.map +1 -0
  467. package/dist/esm/db-backup/schemas.js +15 -0
  468. package/dist/esm/db-backup/schemas.js.map +1 -0
  469. package/dist/esm/db-backup/settings-schemas.d.ts +217 -0
  470. package/dist/esm/db-backup/settings-schemas.d.ts.map +1 -0
  471. package/dist/esm/db-backup/settings-schemas.js +316 -0
  472. package/dist/esm/db-backup/settings-schemas.js.map +1 -0
  473. package/dist/esm/doctor/constants.d.ts +59 -0
  474. package/dist/esm/doctor/constants.d.ts.map +1 -0
  475. package/dist/esm/doctor/constants.js +54 -0
  476. package/dist/esm/doctor/constants.js.map +1 -0
  477. package/dist/esm/doctor/index.d.ts +5 -0
  478. package/dist/esm/doctor/index.d.ts.map +1 -0
  479. package/dist/esm/doctor/index.js +10 -0
  480. package/dist/esm/doctor/index.js.map +1 -0
  481. package/dist/esm/doctor/schemas.d.ts +186 -0
  482. package/dist/esm/doctor/schemas.d.ts.map +1 -0
  483. package/dist/esm/doctor/schemas.js +180 -0
  484. package/dist/esm/doctor/schemas.js.map +1 -0
  485. package/dist/esm/email/constants.d.ts +82 -0
  486. package/dist/esm/email/constants.d.ts.map +1 -0
  487. package/dist/esm/email/constants.js +79 -0
  488. package/dist/esm/email/constants.js.map +1 -0
  489. package/dist/esm/email/index.d.ts +5 -0
  490. package/dist/esm/email/index.d.ts.map +1 -0
  491. package/dist/esm/email/index.js +8 -0
  492. package/dist/esm/email/index.js.map +1 -0
  493. package/dist/esm/email/schemas.d.ts +276 -0
  494. package/dist/esm/email/schemas.d.ts.map +1 -0
  495. package/dist/esm/email/schemas.js +277 -0
  496. package/dist/esm/email/schemas.js.map +1 -0
  497. package/dist/esm/exports/constants.d.ts +123 -0
  498. package/dist/esm/exports/constants.d.ts.map +1 -0
  499. package/dist/esm/exports/constants.js +106 -0
  500. package/dist/esm/exports/constants.js.map +1 -0
  501. package/dist/esm/exports/index.d.ts +5 -0
  502. package/dist/esm/exports/index.d.ts.map +1 -0
  503. package/dist/esm/exports/index.js +7 -0
  504. package/dist/esm/exports/index.js.map +1 -0
  505. package/dist/esm/exports/schemas.d.ts +386 -0
  506. package/dist/esm/exports/schemas.d.ts.map +1 -0
  507. package/dist/esm/exports/schemas.js +285 -0
  508. package/dist/esm/exports/schemas.js.map +1 -0
  509. package/dist/esm/identity/constants.d.ts +273 -0
  510. package/dist/esm/identity/constants.d.ts.map +1 -0
  511. package/dist/esm/identity/constants.js +244 -0
  512. package/dist/esm/identity/constants.js.map +1 -0
  513. package/dist/esm/identity/index.d.ts +5 -0
  514. package/dist/esm/identity/index.d.ts.map +1 -0
  515. package/dist/esm/identity/index.js +10 -0
  516. package/dist/esm/identity/index.js.map +1 -0
  517. package/dist/esm/identity/schemas.d.ts +784 -0
  518. package/dist/esm/identity/schemas.d.ts.map +1 -0
  519. package/dist/esm/identity/schemas.js +681 -0
  520. package/dist/esm/identity/schemas.js.map +1 -0
  521. package/dist/esm/index.d.ts +13 -0
  522. package/dist/esm/index.d.ts.map +1 -0
  523. package/dist/esm/index.js +13 -0
  524. package/dist/esm/index.js.map +1 -0
  525. package/dist/esm/jobs/constants.d.ts +135 -0
  526. package/dist/esm/jobs/constants.d.ts.map +1 -0
  527. package/dist/esm/jobs/constants.js +127 -0
  528. package/dist/esm/jobs/constants.js.map +1 -0
  529. package/dist/esm/jobs/index.d.ts +9 -0
  530. package/dist/esm/jobs/index.d.ts.map +1 -0
  531. package/dist/esm/jobs/index.js +11 -0
  532. package/dist/esm/jobs/index.js.map +1 -0
  533. package/dist/esm/jobs/retention-schemas.d.ts +252 -0
  534. package/dist/esm/jobs/retention-schemas.d.ts.map +1 -0
  535. package/dist/esm/jobs/retention-schemas.js +229 -0
  536. package/dist/esm/jobs/retention-schemas.js.map +1 -0
  537. package/dist/esm/jobs/schemas.d.ts +361 -0
  538. package/dist/esm/jobs/schemas.d.ts.map +1 -0
  539. package/dist/esm/jobs/schemas.js +703 -0
  540. package/dist/esm/jobs/schemas.js.map +1 -0
  541. package/dist/esm/jobs/settings-schemas.d.ts +84 -0
  542. package/dist/esm/jobs/settings-schemas.d.ts.map +1 -0
  543. package/dist/esm/jobs/settings-schemas.js +113 -0
  544. package/dist/esm/jobs/settings-schemas.js.map +1 -0
  545. package/dist/esm/nodes/admin-schemas.d.ts +204 -0
  546. package/dist/esm/nodes/admin-schemas.d.ts.map +1 -0
  547. package/dist/esm/nodes/admin-schemas.js +150 -0
  548. package/dist/esm/nodes/admin-schemas.js.map +1 -0
  549. package/dist/esm/nodes/constants.d.ts +86 -0
  550. package/dist/esm/nodes/constants.d.ts.map +1 -0
  551. package/dist/esm/nodes/constants.js +99 -0
  552. package/dist/esm/nodes/constants.js.map +1 -0
  553. package/dist/esm/nodes/index.d.ts +8 -0
  554. package/dist/esm/nodes/index.d.ts.map +1 -0
  555. package/dist/esm/nodes/index.js +11 -0
  556. package/dist/esm/nodes/index.js.map +1 -0
  557. package/dist/esm/nodes/schemas.d.ts +332 -0
  558. package/dist/esm/nodes/schemas.d.ts.map +1 -0
  559. package/dist/esm/nodes/schemas.js +934 -0
  560. package/dist/esm/nodes/schemas.js.map +1 -0
  561. package/dist/esm/nodes/settings-schemas.d.ts +82 -0
  562. package/dist/esm/nodes/settings-schemas.d.ts.map +1 -0
  563. package/dist/esm/nodes/settings-schemas.js +103 -0
  564. package/dist/esm/nodes/settings-schemas.js.map +1 -0
  565. package/dist/esm/notifications/constants.d.ts +197 -0
  566. package/dist/esm/notifications/constants.d.ts.map +1 -0
  567. package/dist/esm/notifications/constants.js +178 -0
  568. package/dist/esm/notifications/constants.js.map +1 -0
  569. package/dist/esm/notifications/index.d.ts +5 -0
  570. package/dist/esm/notifications/index.d.ts.map +1 -0
  571. package/dist/esm/notifications/index.js +9 -0
  572. package/dist/esm/notifications/index.js.map +1 -0
  573. package/dist/esm/notifications/schemas.d.ts +1016 -0
  574. package/dist/esm/notifications/schemas.d.ts.map +1 -0
  575. package/dist/esm/notifications/schemas.js +848 -0
  576. package/dist/esm/notifications/schemas.js.map +1 -0
  577. package/dist/esm/onboarding/constants.d.ts +138 -0
  578. package/dist/esm/onboarding/constants.d.ts.map +1 -0
  579. package/dist/esm/onboarding/constants.js +120 -0
  580. package/dist/esm/onboarding/constants.js.map +1 -0
  581. package/dist/esm/onboarding/index.d.ts +5 -0
  582. package/dist/esm/onboarding/index.d.ts.map +1 -0
  583. package/dist/esm/onboarding/index.js +7 -0
  584. package/dist/esm/onboarding/index.js.map +1 -0
  585. package/dist/esm/onboarding/schemas.d.ts +360 -0
  586. package/dist/esm/onboarding/schemas.d.ts.map +1 -0
  587. package/dist/esm/onboarding/schemas.js +257 -0
  588. package/dist/esm/onboarding/schemas.js.map +1 -0
  589. package/dist/esm/package.json +3 -0
  590. package/dist/esm/settings/constants.d.ts +206 -0
  591. package/dist/esm/settings/constants.d.ts.map +1 -0
  592. package/dist/esm/settings/constants.js +197 -0
  593. package/dist/esm/settings/constants.js.map +1 -0
  594. package/dist/esm/settings/index.d.ts +6 -0
  595. package/dist/esm/settings/index.d.ts.map +1 -0
  596. package/dist/esm/settings/index.js +11 -0
  597. package/dist/esm/settings/index.js.map +1 -0
  598. package/dist/esm/settings/schemas.d.ts +574 -0
  599. package/dist/esm/settings/schemas.d.ts.map +1 -0
  600. package/dist/esm/settings/schemas.js +434 -0
  601. package/dist/esm/settings/schemas.js.map +1 -0
  602. package/dist/esm/settings/types.d.ts +79 -0
  603. package/dist/esm/settings/types.d.ts.map +1 -0
  604. package/dist/esm/settings/types.js +5 -0
  605. package/dist/esm/settings/types.js.map +1 -0
  606. package/dist/esm/sharing/constants.d.ts +216 -0
  607. package/dist/esm/sharing/constants.d.ts.map +1 -0
  608. package/dist/esm/sharing/constants.js +159 -0
  609. package/dist/esm/sharing/constants.js.map +1 -0
  610. package/dist/esm/sharing/enum.d.ts +5 -0
  611. package/dist/esm/sharing/enum.d.ts.map +1 -0
  612. package/dist/esm/sharing/enum.js +6 -0
  613. package/dist/esm/sharing/enum.js.map +1 -0
  614. package/dist/esm/sharing/grants.d.ts +490 -0
  615. package/dist/esm/sharing/grants.d.ts.map +1 -0
  616. package/dist/esm/sharing/grants.js +444 -0
  617. package/dist/esm/sharing/grants.js.map +1 -0
  618. package/dist/esm/sharing/groups.d.ts +410 -0
  619. package/dist/esm/sharing/groups.d.ts.map +1 -0
  620. package/dist/esm/sharing/groups.js +372 -0
  621. package/dist/esm/sharing/groups.js.map +1 -0
  622. package/dist/esm/sharing/index.d.ts +5 -0
  623. package/dist/esm/sharing/index.d.ts.map +1 -0
  624. package/dist/esm/sharing/index.js +11 -0
  625. package/dist/esm/sharing/index.js.map +1 -0
  626. package/dist/esm/sharing/schemas.d.ts +3 -0
  627. package/dist/esm/sharing/schemas.d.ts.map +1 -0
  628. package/dist/esm/sharing/schemas.js +5 -0
  629. package/dist/esm/sharing/schemas.js.map +1 -0
  630. package/dist/esm/storage/constants.d.ts +111 -0
  631. package/dist/esm/storage/constants.d.ts.map +1 -0
  632. package/dist/esm/storage/constants.js +104 -0
  633. package/dist/esm/storage/constants.js.map +1 -0
  634. package/dist/esm/storage/index.d.ts +27 -0
  635. package/dist/esm/storage/index.d.ts.map +1 -0
  636. package/dist/esm/storage/index.js +23 -0
  637. package/dist/esm/storage/index.js.map +1 -0
  638. package/dist/esm/storage/objects-complete-upload.d.ts +19 -0
  639. package/dist/esm/storage/objects-complete-upload.d.ts.map +1 -0
  640. package/dist/esm/storage/objects-complete-upload.js +16 -0
  641. package/dist/esm/storage/objects-complete-upload.js.map +1 -0
  642. package/dist/esm/storage/objects-download-url.d.ts +17 -0
  643. package/dist/esm/storage/objects-download-url.d.ts.map +1 -0
  644. package/dist/esm/storage/objects-download-url.js +13 -0
  645. package/dist/esm/storage/objects-download-url.js.map +1 -0
  646. package/dist/esm/storage/objects-init-upload.d.ts +39 -0
  647. package/dist/esm/storage/objects-init-upload.d.ts.map +1 -0
  648. package/dist/esm/storage/objects-init-upload.js +37 -0
  649. package/dist/esm/storage/objects-init-upload.js.map +1 -0
  650. package/dist/esm/storage/objects-list-query.d.ts +50 -0
  651. package/dist/esm/storage/objects-list-query.d.ts.map +1 -0
  652. package/dist/esm/storage/objects-list-query.js +20 -0
  653. package/dist/esm/storage/objects-list-query.js.map +1 -0
  654. package/dist/esm/storage/objects-object-response.d.ts +49 -0
  655. package/dist/esm/storage/objects-object-response.d.ts.map +1 -0
  656. package/dist/esm/storage/objects-object-response.js +51 -0
  657. package/dist/esm/storage/objects-object-response.js.map +1 -0
  658. package/dist/esm/storage/objects-update-metadata.d.ts +16 -0
  659. package/dist/esm/storage/objects-update-metadata.d.ts.map +1 -0
  660. package/dist/esm/storage/objects-update-metadata.js +11 -0
  661. package/dist/esm/storage/objects-update-metadata.js.map +1 -0
  662. package/dist/esm/storage/schemas.d.ts +13 -0
  663. package/dist/esm/storage/schemas.d.ts.map +1 -0
  664. package/dist/esm/storage/schemas.js +19 -0
  665. package/dist/esm/storage/schemas.js.map +1 -0
  666. package/dist/esm/storage/settings-schemas.d.ts +188 -0
  667. package/dist/esm/storage/settings-schemas.d.ts.map +1 -0
  668. package/dist/esm/storage/settings-schemas.js +220 -0
  669. package/dist/esm/storage/settings-schemas.js.map +1 -0
  670. package/dist/esm/storage/storage-bucket-provision.d.ts +152 -0
  671. package/dist/esm/storage/storage-bucket-provision.d.ts.map +1 -0
  672. package/dist/esm/storage/storage-bucket-provision.js +213 -0
  673. package/dist/esm/storage/storage-bucket-provision.js.map +1 -0
  674. package/dist/esm/storage/storage-config-response.d.ts +99 -0
  675. package/dist/esm/storage/storage-config-response.d.ts.map +1 -0
  676. package/dist/esm/storage/storage-config-response.js +170 -0
  677. package/dist/esm/storage/storage-config-response.js.map +1 -0
  678. package/dist/esm/storage/storage-config-update.d.ts +46 -0
  679. package/dist/esm/storage/storage-config-update.d.ts.map +1 -0
  680. package/dist/esm/storage/storage-config-update.js +130 -0
  681. package/dist/esm/storage/storage-config-update.js.map +1 -0
  682. package/dist/esm/storage/storage-connection-test.d.ts +129 -0
  683. package/dist/esm/storage/storage-connection-test.d.ts.map +1 -0
  684. package/dist/esm/storage/storage-connection-test.js +241 -0
  685. package/dist/esm/storage/storage-connection-test.js.map +1 -0
  686. package/dist/esm/storage/storage-status.d.ts +16 -0
  687. package/dist/esm/storage/storage-status.d.ts.map +1 -0
  688. package/dist/esm/storage/storage-status.js +20 -0
  689. package/dist/esm/storage/storage-status.js.map +1 -0
  690. package/dist/esm/telemetry/assistant.d.ts +173 -0
  691. package/dist/esm/telemetry/assistant.d.ts.map +1 -0
  692. package/dist/esm/telemetry/assistant.js +40 -0
  693. package/dist/esm/telemetry/assistant.js.map +1 -0
  694. package/dist/esm/telemetry/config.d.ts +96 -0
  695. package/dist/esm/telemetry/config.d.ts.map +1 -0
  696. package/dist/esm/telemetry/config.js +112 -0
  697. package/dist/esm/telemetry/config.js.map +1 -0
  698. package/dist/esm/telemetry/connection.d.ts +355 -0
  699. package/dist/esm/telemetry/connection.d.ts.map +1 -0
  700. package/dist/esm/telemetry/connection.js +447 -0
  701. package/dist/esm/telemetry/connection.js.map +1 -0
  702. package/dist/esm/telemetry/constants.d.ts +814 -0
  703. package/dist/esm/telemetry/constants.d.ts.map +1 -0
  704. package/dist/esm/telemetry/constants.js +681 -0
  705. package/dist/esm/telemetry/constants.js.map +1 -0
  706. package/dist/esm/telemetry/dashboard.d.ts +997 -0
  707. package/dist/esm/telemetry/dashboard.d.ts.map +1 -0
  708. package/dist/esm/telemetry/dashboard.js +748 -0
  709. package/dist/esm/telemetry/dashboard.js.map +1 -0
  710. package/dist/esm/telemetry/enum.d.ts +5 -0
  711. package/dist/esm/telemetry/enum.d.ts.map +1 -0
  712. package/dist/esm/telemetry/enum.js +9 -0
  713. package/dist/esm/telemetry/enum.js.map +1 -0
  714. package/dist/esm/telemetry/index.d.ts +5 -0
  715. package/dist/esm/telemetry/index.d.ts.map +1 -0
  716. package/dist/esm/telemetry/index.js +10 -0
  717. package/dist/esm/telemetry/index.js.map +1 -0
  718. package/dist/esm/telemetry/presentation.d.ts +243 -0
  719. package/dist/esm/telemetry/presentation.d.ts.map +1 -0
  720. package/dist/esm/telemetry/presentation.js +297 -0
  721. package/dist/esm/telemetry/presentation.js.map +1 -0
  722. package/dist/esm/telemetry/query.d.ts +147 -0
  723. package/dist/esm/telemetry/query.d.ts.map +1 -0
  724. package/dist/esm/telemetry/query.js +138 -0
  725. package/dist/esm/telemetry/query.js.map +1 -0
  726. package/dist/esm/telemetry/schemas.d.ts +20 -0
  727. package/dist/esm/telemetry/schemas.d.ts.map +1 -0
  728. package/dist/esm/telemetry/schemas.js +14 -0
  729. package/dist/esm/telemetry/schemas.js.map +1 -0
  730. package/dist/esm/telemetry/settings.d.ts +65 -0
  731. package/dist/esm/telemetry/settings.d.ts.map +1 -0
  732. package/dist/esm/telemetry/settings.js +74 -0
  733. package/dist/esm/telemetry/settings.js.map +1 -0
  734. package/dist/esm/telemetry/stack.d.ts +87 -0
  735. package/dist/esm/telemetry/stack.d.ts.map +1 -0
  736. package/dist/esm/telemetry/stack.js +90 -0
  737. package/dist/esm/telemetry/stack.js.map +1 -0
  738. package/dist/esm/telemetry/status.d.ts +65 -0
  739. package/dist/esm/telemetry/status.d.ts.map +1 -0
  740. package/dist/esm/telemetry/status.js +62 -0
  741. package/dist/esm/telemetry/status.js.map +1 -0
  742. package/dist/esm/telemetry/store.d.ts +111 -0
  743. package/dist/esm/telemetry/store.d.ts.map +1 -0
  744. package/dist/esm/telemetry/store.js +80 -0
  745. package/dist/esm/telemetry/store.js.map +1 -0
  746. package/dist/esm/user-data/constants.d.ts +157 -0
  747. package/dist/esm/user-data/constants.d.ts.map +1 -0
  748. package/dist/esm/user-data/constants.js +134 -0
  749. package/dist/esm/user-data/constants.js.map +1 -0
  750. package/dist/esm/user-data/index.d.ts +5 -0
  751. package/dist/esm/user-data/index.d.ts.map +1 -0
  752. package/dist/esm/user-data/index.js +7 -0
  753. package/dist/esm/user-data/index.js.map +1 -0
  754. package/dist/esm/user-data/schemas.d.ts +306 -0
  755. package/dist/esm/user-data/schemas.d.ts.map +1 -0
  756. package/dist/esm/user-data/schemas.js +330 -0
  757. package/dist/esm/user-data/schemas.js.map +1 -0
  758. package/package.json +228 -4
@@ -0,0 +1,934 @@
1
+ // =============================================================================
2
+ // Nodes: the node routes' request shapes (issue #734, PP-8.2)
3
+ // =============================================================================
4
+ //
5
+ // The node control plane (`register`, `heartbeat`, `claim`, `renew`, `result`,
6
+ // `fail`), the data plane's two URL mints, the per-job secret request and the
7
+ // node credential mint, as zod schemas. Moved verbatim (comments included)
8
+ // from `@marinoscar/platform-api/nodes`'s dto files, which wrap these with
9
+ // `createZodDto`; the response shapes stay there as Swagger classes. The
10
+ // node runner of `@marinoscar/platform-cli` sends exactly these bodies.
11
+ // =============================================================================
12
+ import { z } from 'zod';
13
+ import { MAX_NODE_CONCURRENCY, MAX_NODE_CREDENTIAL_DAYS, MAX_NODE_CREDENTIAL_NAME_LENGTH, MAX_NODE_ELIGIBLE_TYPES, MAX_NODE_VITALS_EXTRA_KEYS, MAX_NODE_VITALS_EXTRA_VALUE, NODE_VITALS_EXTRA_KEY_PATTERN, } from './constants.js';
14
+ // -----------------------------------------------------------------------------
15
+ // From claim-token.field.ts: The claim token, as a node quotes it back (issue #364, epic #254)
16
+ // -----------------------------------------------------------------------------
17
+ // =============================================================================
18
+ // The claim token, as a node quotes it back (issue #364, epic #254)
19
+ // =============================================================================
20
+ //
21
+ // ONE FIELD IN ONE FILE, which in this folder needs a reason — the file beside
22
+ // it argues at length for keeping SIX request bodies together. The reason is
23
+ // that this field is not part of any one of those conversations: it is the
24
+ // same sentence spoken on SIX ROUTES ACROSS THREE DTO FILES — renew, result
25
+ // and failure (`node-control-plane.dto.ts`), download-url and upload-url
26
+ // (`node-data-plane.dto.ts`), and secret (`node-job-secret.dto.ts`) — and the
27
+ // one thing that must never differ between them is what that sentence means.
28
+ // Copied six times it drifts exactly once, in the direction that costs the
29
+ // most: somebody makes it `.nullable()` on one route to accommodate a client
30
+ // that serialises absent fields as `null`, and on that route alone a node
31
+ // asserting "no token" starts matching `claim_token IS NULL` instead of being
32
+ // refused.
33
+ //
34
+ // The alternative was exporting it from `node-control-plane.dto.ts`, and it is
35
+ // rejected for what it would say rather than what it would do: it would make
36
+ // the data plane's and the broker's guards look like borrowings from the
37
+ // control plane, when in fact all six are the same guard. Nothing here is
38
+ // control plane or data plane; it is the identity of a CLAIM.
39
+ // =============================================================================
40
+ /**
41
+ * THE CLAIM THIS MESSAGE IS ABOUT — `jobs.claim_token`, handed to the node in
42
+ * the claim response and quoted back on every route that speaks for a held
43
+ * job (#364).
44
+ *
45
+ * WHY A NODE ID IS NOT ENOUGH, which is the whole of this field. Every guard
46
+ * on the six routes above identified the caller by `claimedByNodeId` alone,
47
+ * which tells one node from another and NOT ONE NODE FROM ITSELF. A node that
48
+ * claims job J, stalls past its lease, is reaped, and then claims J again in a
49
+ * second worker slot has two live slots quoting the same node id, and every
50
+ * one of those six routes will believe the older one:
51
+ *
52
+ * - `renew` — the stale slot extends the lease its OWN newer claim is
53
+ * running under, so a second slot that dies is reaped late, for as long as
54
+ * the first keeps ticking.
55
+ * - `result` / `failure` — the stale slot SETTLES a job its newer claim is
56
+ * still executing, persisting output computed against an earlier attempt
57
+ * or charging a failure against a run that is going fine.
58
+ * - `upload-url` — the sharpest of the six, and the quietest. With
59
+ * `deriveOutputKey` (#348) the key is a function of the JOB, not of the
60
+ * claim, so a stale slot is handed a signed PUT for the exact output key
61
+ * its own later claim is currently writing. Both PUTs "succeed"; the
62
+ * bytes that survive are whichever finished last, and nothing anywhere
63
+ * records that two ran.
64
+ * - `download-url` — a bearer capability for the job's input, minted for a
65
+ * slot that no longer holds the row.
66
+ * - `secret` — a LIVE DATABASE CREDENTIAL handed to a slot that lost the
67
+ * job, valid for the lease of a claim that is not its own.
68
+ *
69
+ * The token is minted per row by the claim statement
70
+ * (`job-claim.service.ts`, `gen_random_uuid()`), so those two claims carry
71
+ * different tokens and the stale one is refused.
72
+ *
73
+ * ⚠ OPTIONAL ON THE WIRE EVERYWHERE, AND THAT IS LOAD-BEARING, not politeness.
74
+ * A fleet is upgraded one machine at a time; a node running older CLI code
75
+ * omits this field, and the server must then behave EXACTLY as it did before —
76
+ * the node id and the lease alone — rather than 400 the request or 409 the
77
+ * job. Same posture as `renewIntervalMs` in #347: additive, ignorable,
78
+ * strictly better when present. The ambiguity above stays open for that node
79
+ * until it is upgraded, which is a rolling-upgrade window rather than a new
80
+ * hole; nothing the server can do closes it earlier, because the only value
81
+ * able to tell two slots of one node apart is one only they hold.
82
+ *
83
+ * ⚠ OMITTED MUST STAY `undefined` AND MUST NOT BECOME `null`. Downstream this
84
+ * value reaches `heldLeaseWhere`, where the two mean opposite things:
85
+ * `undefined` drops the clause entirely ("I am not asserting a claim"), while
86
+ * `null` matches `claim_token IS NULL` ("I assert this row carries no token",
87
+ * which is what a claim taken before the column existed looks like).
88
+ * `.optional()` with no `.nullable()` is what keeps them apart — a body that
89
+ * spells the key as `null` is refused rather than silently reinterpreted as
90
+ * the other statement. Apply `.optional()` at each use site rather than baking
91
+ * it in here, so every body says out loud that the field may be absent.
92
+ *
93
+ * Validated as a uuid rather than as any bounded string because the column is
94
+ * `uuid`: a garbage value reaching a `where` clause is a Postgres cast error
95
+ * (a 500 about "inconsistent column data"), and a clean 400 naming the field
96
+ * is a better answer to a malformed token than a 500 is.
97
+ *
98
+ * @stability experimental
99
+ */
100
+ export const claimTokenField = z.uuid().describe(
101
+ // ⚠ THE PUBLISHED DESCRIPTION IS PART OF THE ONE DEFINITION, and it is here
102
+ // for the reason the schema is: six routes describing one grant six ways is
103
+ // six chances to describe it differently, and a node's author reads
104
+ // whichever one they happened to open. `.describe()` rides through
105
+ // `.optional()` into every generated body, so `openapi.json` says the same
106
+ // sentence six times by construction.
107
+ 'The `claimToken` this assignment was handed in the claim response, quoted back so the ' +
108
+ 'server can tell THIS claim of the job from a later one by the same node — the difference ' +
109
+ 'between renewing, settling, signing or crediting your own run and one your node started ' +
110
+ 'later. Optional: omit it and the request is identified by node id alone, exactly as ' +
111
+ 'before, so an older client is refused nothing and stays exactly as ambiguous as it was. ' +
112
+ 'Omit the key rather than sending `null`; `null` is a different assertion and is refused.');
113
+ // -----------------------------------------------------------------------------
114
+ // From create-node-credential.dto.ts: The create-credential request body (issue #267, epic #254)
115
+ // -----------------------------------------------------------------------------
116
+ // =============================================================================
117
+ // The create-credential request body (issue #267, epic #254)
118
+ // =============================================================================
119
+ //
120
+ // Deliberately NOT `CreatePatDto`'s `{ durationValue, durationUnit }` pair.
121
+ // That pair exists on a PAT because a PAT MUST expire — `PersonalAccessToken
122
+ // .expiresAt` is a required column — so its request body has to make the
123
+ // caller say when, and the two-field shape ("30" + "days") is friendlier than
124
+ // a raw timestamp for a human filling in a form.
125
+ //
126
+ // A node credential's expiry is OPTIONAL, and the reason is written out in
127
+ // full above `NodeCredential.expiresAt` in `prisma/schema.prisma`: a worker
128
+ // node runs unattended for months, and a mandatory expiry turns a fleet going
129
+ // dark at 3am into the DEFAULT behaviour rather than an incident. So the
130
+ // field is optional here, and its absence is a real, supported answer —
131
+ // "never expires, authenticate indefinitely until revoked" — not a validation
132
+ // hole and not an unset value some later code has to fill in.
133
+ //
134
+ // WHY `expiresInDays` AND NOT AN ISO TIMESTAMP. A caller-supplied absolute
135
+ // `expiresAt` would have to be validated against the server's clock (is it in
136
+ // the past? is it absurdly far in the future?) and would silently encode the
137
+ // CALLER's idea of "now" — a CLI on a box with a skewed clock could mint a
138
+ // credential that is already expired, or one that outlives the deployment. A
139
+ // relative duration is interpreted by the server against the server's own
140
+ // clock, which is the same clock `validateToken` compares against, so the two
141
+ // can never disagree. Days rather than a unit enum because a node credential
142
+ // measured in minutes is not a use case anybody has: this credential exists
143
+ // precisely for the long-lived, unattended case.
144
+ // =============================================================================
145
+ /**
146
+ * The body that mints a node credential (`nod_` token).
147
+ *
148
+ * @stability experimental
149
+ */
150
+ export const createNodeCredentialSchema = z.object({
151
+ /** The credential's display name, 1 to 100 characters. */
152
+ name: z
153
+ .string()
154
+ .trim()
155
+ .min(1, 'Name is required')
156
+ .max(MAX_NODE_CREDENTIAL_NAME_LENGTH, 'Name must be 100 characters or less'),
157
+ // Optional ON PURPOSE — see the file header. Omitted means `expiresAt: null`
158
+ // in the row, which `validateToken` treats as "no expiry to check", not as
159
+ // "expired" and not as "not configured yet".
160
+ /** Days until it expires, at most `MAX_NODE_CREDENTIAL_DAYS`; omitted, it never expires. */
161
+ expiresInDays: z
162
+ .number()
163
+ .int('Expiry must be a whole number of days')
164
+ .min(1, 'Expiry must be at least 1 day')
165
+ .max(MAX_NODE_CREDENTIAL_DAYS, `Expiry must be at most ${MAX_NODE_CREDENTIAL_DAYS} days`)
166
+ .optional(),
167
+ });
168
+ // -----------------------------------------------------------------------------
169
+ // From node-control-plane.dto.ts: The node control plane's request bodies (issue #268, epic #254)
170
+ // -----------------------------------------------------------------------------
171
+ // =============================================================================
172
+ // The node control plane's request bodies (issue #268, epic #254)
173
+ // =============================================================================
174
+ //
175
+ // SIX BODIES IN ONE FILE, deliberately, where `create-node-credential.dto.ts`
176
+ // beside it is one body in one file. These six are not six independent
177
+ // shapes; they are one CONVERSATION between a worker node and this server —
178
+ // register, heartbeat, claim, renew, result, failure — and every one of the
179
+ // limits below (`MAX_NODE_CONCURRENCY`, the type-list caps, the error length)
180
+ // has to be the same number in more than one of them or the conversation
181
+ // develops a step that accepts what an earlier step refused. Split across six
182
+ // files, those shared constants become six imports nobody keeps aligned;
183
+ // together, a change to the concurrency ceiling is one line that every body
184
+ // sees — and `claimToken` below is the same argument one level up: the three
185
+ // bodies here that speak for a held job share ONE field definition with the
186
+ // three outside this file that do the same (`node-data-plane.dto.ts`,
187
+ // `node-job-secret.dto.ts`), so "renew accepts a token but failure silently
188
+ // ignores it" is unwritable. That definition lives in `claim-token.field.ts`,
189
+ // which carries its own note on why one field earned a file of its own.
190
+ //
191
+ // -----------------------------------------------------------------------------
192
+ // EVERY FIELD HERE ARRIVES FROM A MACHINE THIS DEPLOYMENT MAY NOT OWN
193
+ // -----------------------------------------------------------------------------
194
+ //
195
+ // That is the whole reason these schemas are as tight as they are. A node is
196
+ // authenticated (a `nod_` credential resolves to its owner) but it is not
197
+ // TRUSTED in the sense a first-party service is: it runs unattended on
198
+ // somebody's spare box, its config file is editable by whoever has that box,
199
+ // and the numbers it reports about itself go straight into a row this server
200
+ // then makes scheduling decisions from. So:
201
+ //
202
+ // - `concurrency` is bounded because it becomes the CLAIM LIMIT. An
203
+ // unbounded value is a node that asks for every runnable row in the queue
204
+ // in one call and holds all of them under one lease — a fleet-wide denial
205
+ // of service written as a config typo.
206
+ // - `eligibleTypes` is bounded in both length and element size because it
207
+ // is stored as an array column and then used as a `text[]` parameter in
208
+ // the claim's `type = ANY(...)`.
209
+ // - `error` is bounded because it lands in `Job.lastError`, which the admin
210
+ // job list renders. `JobTerminalService` truncates too, at 2000 — the
211
+ // same number on purpose, so the wire limit and the storage limit cannot
212
+ // disagree about what "too long" means.
213
+ //
214
+ // -----------------------------------------------------------------------------
215
+ // WHAT IS DELIBERATELY *NOT* IN ANY OF THESE BODIES
216
+ // -----------------------------------------------------------------------------
217
+ //
218
+ // REJECTED: a node-supplied `leaseMs` on claim or renew. It reads as
219
+ // courteous — the node knows how long its work takes — and it hands the one
220
+ // safety property the lease exists for to the least trustworthy participant.
221
+ // A node that asks for a 24-hour lease parks every row it claims for a day:
222
+ // the reaper (#263) will not touch a live lease, so a node that then dies
223
+ // takes its jobs with it until tomorrow, and nothing in the fleet looks
224
+ // broken while it happens. The lease is DERIVED on the server from
225
+ // `JOBS_JOB_TIMEOUT_MS` (`resolveJobLeaseMs`), identically for both
226
+ // executors, and a node cannot influence it.
227
+ //
228
+ // REJECTED: a node-supplied `status: 'disabled' | 'draining'` on heartbeat.
229
+ // Those two are operator decisions — see `WorkerNode.status` in
230
+ // `schema.prisma` — and a node that could report them could also report its
231
+ // way out of them. The union below is the two states a node may claim about
232
+ // itself, and `NodesService.heartbeat` additionally refuses to let even those
233
+ // overwrite an operator's `disabled`/`draining`.
234
+ //
235
+ // REJECTED: `willRetry` being anything but advisory. It is accepted (a node
236
+ // that has just read a provider's response often does know) and it is never
237
+ // acted on: the server's attempt budget decides, in `JobTerminalService`,
238
+ // because a node that could dictate "retry me" could retry itself forever
239
+ // past a budget that exists precisely to bound a job nobody is watching.
240
+ // =============================================================================
241
+ /** Cap on one job-type string, matching what a handler `type` key ever is. */
242
+ const MAX_TYPE_LENGTH = 200;
243
+ /**
244
+ * Cap on a node-reported failure message.
245
+ *
246
+ * The same 2000 as `MAX_LAST_ERROR_LENGTH` in `job-terminal.service.ts`, and
247
+ * that is the point: the terminal service truncates whatever it is given, so
248
+ * a larger limit here would only mean accepting bytes that are guaranteed to
249
+ * be thrown away, and a smaller one would reject messages the storage layer
250
+ * would have kept.
251
+ */
252
+ const MAX_ERROR_LENGTH = 2000;
253
+ /** A non-empty, bounded job-type key. */
254
+ const jobType = z.string().trim().min(1).max(MAX_TYPE_LENGTH);
255
+ /**
256
+ * `jobs.claim_token`, as the node quotes it back — the field three of the
257
+ * bodies below carry, and three more outside this file (the two data-plane
258
+ * mints and the secret broker) carry for the same reason.
259
+ *
260
+ * SHARED, NOT REDECLARED: `claim-token.field.ts` holds the field and the whole
261
+ * argument for it, including why `undefined` and `null` must stay different
262
+ * statements. Six copies of a uuid would drift exactly once, and on one route
263
+ * only, which is the worst shape that drift can take.
264
+ */
265
+ const claimToken = claimTokenField;
266
+ /**
267
+ * The node's self-reported capability bag.
268
+ *
269
+ * `Record<string, unknown>` and nothing narrower, mirroring
270
+ * `WorkerNode.capabilities` being JSONB: the shape is the FLEET PAGE's
271
+ * business (#276), not this server's, and pinning it here would mean a node
272
+ * that learns to report one new fact needs an API deploy before it may say
273
+ * so. Depth and size are bounded by the global body-size limit, not by this
274
+ * schema.
275
+ */
276
+ const capabilities = z.record(z.string(), z.unknown());
277
+ // =============================================================================
278
+ // Vitals (issue #604) — carried on the heartbeat
279
+ // =============================================================================
280
+ //
281
+ // WHAT A NODE SAYS ABOUT ITS OWN HEALTH, and the file header's argument
282
+ // applies to every field: these numbers come from a machine this deployment
283
+ // may not own, they are stored verbatim (`WorkerNode.lastVitals`, JSONB) and
284
+ // rendered on the admin fleet page. So the shape is CLOSED and every value is
285
+ // BOUNDED:
286
+ //
287
+ // - `.strict()` at both levels, unlike `capabilities` above. Capabilities
288
+ // are an open bag on purpose (the fleet page's business, free to grow);
289
+ // vitals are a CONTRACT the fleet page reads field by field, and an open
290
+ // bag here would be an unbounded JSONB write on a route every node hits
291
+ // every few seconds. A node that learns a new vital needs an API change
292
+ // first, which is the review this surface should get.
293
+ // - Every number is finite and non-negative with an explicit ceiling, so
294
+ // `NaN`/`Infinity`/negative garbage never reaches the row, and a number
295
+ // too large to be true is refused rather than charted.
296
+ // - Every string is short and version-shaped, because the three it carries
297
+ // are version banners rendered as text — never a free-form message.
298
+ // - Every field is optional. A node reports what it can measure (a node
299
+ // without `pg_dump` has no `pgDumpVersion`), and an old node sends no
300
+ // `vitals` key at all, which leaves the stored snapshot untouched.
301
+ //
302
+ // ⚠ THE CEILINGS ARE GENEROUS ON PURPOSE. A vitals value out of range fails
303
+ // the WHOLE heartbeat with a 400, and a node whose heartbeats fail goes stale
304
+ // on the fleet page and is swept offline — a far worse outcome than one odd
305
+ // number. So each ceiling is "physically implausible", not "unusual": disk
306
+ // sizes in particular allow a network filesystem that reports exabytes free
307
+ // (some do), which is why they are not required to be safe integers.
308
+ //
309
+ // REJECTED: a node-supplied timestamp for the snapshot. `lastVitalsAt` is
310
+ // stamped by the SERVER when the heartbeat lands, for the same reason
311
+ // `lastHeartbeatAt` is — a node's clock is one more thing it could get wrong.
312
+ // =============================================================================
313
+ /** Ceiling on a counter: a trillion events is past any node's plausible lifetime. */
314
+ const MAX_VITALS_COUNTER = 1e12;
315
+ /** Ceiling on a process memory figure (RSS, heap): 1 PiB. */
316
+ const MAX_VITALS_MEMORY_BYTES = 2 ** 50;
317
+ /**
318
+ * Ceiling on a filesystem figure: 2^64 bytes. Not an integer check — a
319
+ * `statfs` total past 2^53 arrives as a (still finite) double.
320
+ */
321
+ const MAX_VITALS_DISK_BYTES = 2 ** 64;
322
+ /** Ceiling on `cpuPercent`: 100% per core, for up to 128 cores. */
323
+ const MAX_VITALS_CPU_PERCENT = 12_800;
324
+ /** Ceiling on event-loop delay: one hour. A loop blocked longer is not sending heartbeats. */
325
+ const MAX_VITALS_EVENT_LOOP_DELAY_MS = 3_600_000;
326
+ /** Ceiling on uptime: ten years. */
327
+ const MAX_VITALS_UPTIME_SECONDS = 10 * 365 * 24 * 60 * 60;
328
+ /** Cap on a reported version banner (`v24.3.0`, `pg_dump (PostgreSQL) 16.4`). */
329
+ const MAX_VITALS_VERSION_LENGTH = 64;
330
+ /**
331
+ * A finite, non-negative number no larger than `max`. (Zod 4's `z.number()`
332
+ * already refuses `NaN` and `Infinity`; JSON cannot carry them anyway.)
333
+ */
334
+ const boundedNumber = (max) => z.number().nonnegative().max(max);
335
+ /**
336
+ * A non-negative integer no larger than `max`. `.int()` comes FIRST: Zod 4's
337
+ * integer check carries its own safe-integer range, and applied after `.max()`
338
+ * it is that range, not ours, that reaches the generated OpenAPI schema.
339
+ */
340
+ const boundedInt = (max) => z.number().int().nonnegative().max(max);
341
+ /** A non-negative integer counter since the node process started. */
342
+ const vitalsCounter = boundedInt(MAX_VITALS_COUNTER);
343
+ /** A short, version-shaped string: letters, digits, spaces and `. + - _ ( ) ~`. */
344
+ const vitalsVersion = z
345
+ .string()
346
+ .trim()
347
+ .min(1)
348
+ .max(MAX_VITALS_VERSION_LENGTH)
349
+ .regex(/^[0-9A-Za-z .+\-_()~]+$/, 'Must be a version string');
350
+ /**
351
+ * Cumulative counters since the node process started; reset on restart.
352
+ *
353
+ * @stability experimental
354
+ */
355
+ export const nodeVitalsCountersSchema = z
356
+ .object({
357
+ /** Claim calls that returned at least one job. */
358
+ claims: vitalsCounter.optional(),
359
+ /** Claim calls that returned none. */
360
+ emptyPolls: vitalsCounter.optional(),
361
+ /** Claim calls that failed. */
362
+ claimFailures: vitalsCounter.optional(),
363
+ /** Jobs this process completed. */
364
+ succeeded: vitalsCounter.optional(),
365
+ /** Jobs this process reported failed. */
366
+ failed: vitalsCounter.optional(),
367
+ /** Jobs this process reported rate-limited. */
368
+ rateLimited: vitalsCounter.optional(),
369
+ /** Lease renewals that succeeded. */
370
+ leaseRenewals: vitalsCounter.optional(),
371
+ /** Lease renewals that failed. */
372
+ leaseRenewFailures: vitalsCounter.optional(),
373
+ /** Heartbeats that failed. */
374
+ heartbeatFailures: vitalsCounter.optional(),
375
+ /** Times the job watchdog killed a stuck job. */
376
+ watchdogTrips: vitalsCounter.optional(),
377
+ })
378
+ .strict();
379
+ /**
380
+ * App-defined numeric vitals: a bounded bag of `key -> number` an executor or
381
+ * the node's app reports beyond the closed fields (a transcoder's frames per
382
+ * second, a GPU's temperature). Still CLOSED IN SHAPE: at most
383
+ * {@link MAX_NODE_VITALS_EXTRA_KEYS} keys, each key matching
384
+ * {@link NODE_VITALS_EXTRA_KEY_PATTERN}, each value a finite number within
385
+ * +/-{@link MAX_NODE_VITALS_EXTRA_VALUE}. No strings, no nesting, so it stays
386
+ * the unbounded-JSONB-write-free surface the closed fields are. The CLI drops
387
+ * what would not pass before sending (a heartbeat the server refuses costs the
388
+ * node its liveness signal), and the fleet page labels a key through
389
+ * `registerNodeVital`.
390
+ *
391
+ * @stability experimental
392
+ */
393
+ export const nodeVitalsExtraSchema = z
394
+ .record(z.string().regex(NODE_VITALS_EXTRA_KEY_PATTERN, 'Must be a vital key'), z.number().min(-MAX_NODE_VITALS_EXTRA_VALUE).max(MAX_NODE_VITALS_EXTRA_VALUE))
395
+ .refine((extra) => Object.keys(extra).length <= MAX_NODE_VITALS_EXTRA_KEYS, {
396
+ message: `At most ${MAX_NODE_VITALS_EXTRA_KEYS} extra vitals`,
397
+ });
398
+ /**
399
+ * A node's health snapshot, carried on its heartbeat; closed and bounded.
400
+ *
401
+ * @stability experimental
402
+ */
403
+ export const nodeVitalsSchema = z
404
+ .object({
405
+ /** Process CPU over the last interval; 100 = one full core. */
406
+ cpuPercent: boundedNumber(MAX_VITALS_CPU_PERCENT).optional(),
407
+ /** Resident set size of the node process, in bytes. */
408
+ rssBytes: boundedInt(MAX_VITALS_MEMORY_BYTES).optional(),
409
+ /** V8 heap in use, in bytes. */
410
+ heapUsedBytes: boundedInt(MAX_VITALS_MEMORY_BYTES).optional(),
411
+ /** V8 heap limit, in bytes. */
412
+ heapLimitBytes: boundedInt(MAX_VITALS_MEMORY_BYTES).optional(),
413
+ /** p99 event-loop delay over the last interval, in milliseconds. */
414
+ eventLoopDelayP99Ms: boundedNumber(MAX_VITALS_EVENT_LOOP_DELAY_MS).optional(),
415
+ /** Free/total bytes on the filesystem holding the node's state directory. */
416
+ stateDirFreeBytes: boundedNumber(MAX_VITALS_DISK_BYTES).optional(),
417
+ /** Total bytes of that filesystem. */
418
+ stateDirTotalBytes: boundedNumber(MAX_VITALS_DISK_BYTES).optional(),
419
+ /** Job slots in use / available. Bounded by the same ceiling as `concurrency`. */
420
+ slotsUsed: boundedInt(MAX_NODE_CONCURRENCY).optional(),
421
+ /** Job slots available. */
422
+ slotsTotal: boundedInt(MAX_NODE_CONCURRENCY).optional(),
423
+ /** Seconds since the node process started. */
424
+ uptimeSeconds: boundedNumber(MAX_VITALS_UPTIME_SECONDS).optional(),
425
+ /** Cumulative counters since the process started. */
426
+ counters: nodeVitalsCountersSchema.optional(),
427
+ /** The node CLI's version. */
428
+ cliVersion: vitalsVersion.optional(),
429
+ /** The Node.js runtime version. */
430
+ nodeVersion: vitalsVersion.optional(),
431
+ /** The `pg_dump` version banner, when the node has one. */
432
+ pgDumpVersion: vitalsVersion.optional(),
433
+ /** App-defined numeric vitals; see {@link nodeVitalsExtraSchema}. */
434
+ extra: nodeVitalsExtraSchema.optional(),
435
+ })
436
+ .strict();
437
+ // =============================================================================
438
+ // POST /nodes/register
439
+ // =============================================================================
440
+ /**
441
+ * The body of `POST /api/nodes/register`.
442
+ *
443
+ * @stability experimental
444
+ */
445
+ export const registerNodeSchema = z.object({
446
+ /**
447
+ * THE IDENTITY HALF OF `@@unique([createdById, name])`. Two registrations
448
+ * with the same name from the same owner are the SAME node — see
449
+ * `NodesService.register`. This is why a node's name belongs in its config
450
+ * file rather than being generated at startup: a generated name makes every
451
+ * container restart a new node row.
452
+ */
453
+ name: z.string().trim().min(1, 'Name is required').max(MAX_NODE_CREDENTIAL_NAME_LENGTH, 'Name must be 100 characters or less'),
454
+ /** The machine's hostname, as the node reports it. */
455
+ hostname: z.string().trim().min(1).max(255),
456
+ /** The OS and architecture (`linux-x64`). */
457
+ platform: z.string().trim().min(1).max(100),
458
+ /** The node CLI's version. */
459
+ cliVersion: z.string().trim().min(1).max(50),
460
+ /**
461
+ * The job types this node can run. An EMPTY LIST IS LEGAL and means "I can
462
+ * run nothing yet" — a node that registers before its handlers are
463
+ * configured is a real state, and refusing it would push the operator
464
+ * toward declaring a type the node cannot actually execute.
465
+ */
466
+ eligibleTypes: z.array(jobType).max(MAX_NODE_ELIGIBLE_TYPES).default([]),
467
+ /** How many jobs the node runs at once, 1 to `MAX_NODE_CONCURRENCY`. */
468
+ concurrency: z
469
+ .number()
470
+ .int('Concurrency must be a whole number')
471
+ .min(1, 'Concurrency must be at least 1')
472
+ .max(MAX_NODE_CONCURRENCY, `Concurrency must be at most ${MAX_NODE_CONCURRENCY}`),
473
+ /** The node's self-reported capability bag (open JSON, shown on the fleet page). */
474
+ capabilities: capabilities.optional(),
475
+ });
476
+ // =============================================================================
477
+ // POST /nodes/:id/heartbeat
478
+ // =============================================================================
479
+ /**
480
+ * The body of `POST /api/nodes/:id/heartbeat`.
481
+ *
482
+ * @stability experimental
483
+ */
484
+ export const heartbeatNodeSchema = z.object({
485
+ /**
486
+ * The two states a node may report ABOUT ITSELF. `draining` and `disabled`
487
+ * are absent on purpose — see the file header.
488
+ */
489
+ status: z.enum(['online', 'offline']).optional(),
490
+ /**
491
+ * A runtime concurrency change (`appctl node set-concurrency`), which the
492
+ * NEXT claim reads live off the row. This is the whole reason the claim
493
+ * endpoint re-reads the node rather than trusting a value captured at
494
+ * registration.
495
+ */
496
+ concurrency: z.number().int().min(1).max(MAX_NODE_CONCURRENCY).optional(),
497
+ /** A replacement capability bag, when it changed. */
498
+ capabilities: capabilities.optional(),
499
+ /**
500
+ * A health snapshot (#604), stored as `lastVitals` with a server-stamped
501
+ * `lastVitalsAt`. OMITTED leaves the stored snapshot untouched, which is
502
+ * what every node that predates vitals sends. See "Vitals" above.
503
+ */
504
+ vitals: nodeVitalsSchema.optional(),
505
+ });
506
+ // =============================================================================
507
+ // POST /nodes/:id/claim
508
+ // =============================================================================
509
+ /**
510
+ * The body of `POST /api/nodes/:id/claim`.
511
+ *
512
+ * @stability experimental
513
+ */
514
+ export const claimJobsSchema = z.object({
515
+ /**
516
+ * Which of the node's own types it wants right now — a node with free
517
+ * slots for one type and none for another. OMITTED means "anything I
518
+ * declared", which is the common case.
519
+ *
520
+ * NARROWING ONLY. `NodesService.claimJobs` intersects this with the row's
521
+ * `eligibleTypes`; a type here that the node never registered is dropped,
522
+ * not honoured.
523
+ */
524
+ types: z.array(jobType).max(MAX_NODE_ELIGIBLE_TYPES).optional(),
525
+ /**
526
+ * How many rows to take. CLAMPED DOWN to the node's declared
527
+ * `concurrency`; a larger number is not an error, it is simply capped —
528
+ * a node asking for more than it declared is describing free slots it does
529
+ * not have, and refusing the whole call would stall a fleet over an
530
+ * arithmetic disagreement.
531
+ */
532
+ limit: z.number().int().min(1).max(MAX_NODE_CONCURRENCY).optional(),
533
+ });
534
+ // =============================================================================
535
+ // POST /nodes/:id/jobs/:jobId/renew
536
+ // =============================================================================
537
+ /**
538
+ * ⚠ THIS BODY EXISTS TO CARRY ONE OPTIONAL FIELD, AND IT MUST SURVIVE HAVING
539
+ * NO BODY AT ALL (#364).
540
+ *
541
+ * Until this change the renew route took no body, so every node in every fleet
542
+ * posts to it with no payload and no `Content-Type` — Fastify hands Nest
543
+ * `undefined`, and a bare `z.object({...})` would reject that outright and
544
+ * fail every renewal from every node that has not been upgraded yet. `.default({})`
545
+ * is what makes "no body" parse to "no assertion", which is the pre-#364
546
+ * behaviour spelled as data. It is the only reason this is a `ZodDefault` and
547
+ * not a plain object schema; do not unwrap it.
548
+ *
549
+ * REJECTED: coercing a `null` body to `{}` as well. That would quietly turn
550
+ * "I assert this row has no token" into "I assert nothing", and those are
551
+ * different statements at the `where` clause (see `claimToken` above).
552
+ *
553
+ * @stability experimental
554
+ */
555
+ export const renewLeaseSchema = z
556
+ .object({
557
+ /** Which claim of the job is asking (`claimTokenField`). */
558
+ claimToken: claimToken.optional(),
559
+ })
560
+ .default({});
561
+ // =============================================================================
562
+ // POST /nodes/:id/jobs/:jobId/result
563
+ // =============================================================================
564
+ /**
565
+ * The body of `POST /api/nodes/:id/jobs/:jobId/result`.
566
+ *
567
+ * @stability experimental
568
+ */
569
+ export const nodeJobResultSchema = z.object({
570
+ /**
571
+ * The job type this result is FOR, checked against the row's own `type`
572
+ * before anything is parsed or persisted.
573
+ *
574
+ * It is redundant with the row — which is the point. A node holding two
575
+ * jobs at once and crossing their ids would otherwise post job A's result
576
+ * against job B, and the only thing standing between that and a persisted,
577
+ * plausible, permanently wrong row would be whether B's schema happened to
578
+ * reject A's payload. Two IDs agreeing is a coincidence; an id and a type
579
+ * agreeing is a statement.
580
+ */
581
+ type: jobType,
582
+ /**
583
+ * The computed result, UNVALIDATED at this layer on purpose.
584
+ *
585
+ * The real validation is `handler.nodeResultSchema`, resolved per job type
586
+ * at runtime and applied manually in `NodesService.submitResult` — the
587
+ * global Zod pipe cannot do it, because which schema applies is not known
588
+ * until the job row has been read. Typing it `unknown` here rather than
589
+ * `Record<string, unknown>` also keeps a handler free to accept a bare
590
+ * array or scalar result if that is what its work produces.
591
+ */
592
+ result: z.unknown(),
593
+ /**
594
+ * WHICH CLAIM computed this result — see `claimToken` above.
595
+ *
596
+ * It matters MORE here than on renew, not less: a stale slot's renewal only
597
+ * delays the reaper, while a stale slot's RESULT settles a job its own later
598
+ * claim is still running, persisting output computed against an earlier
599
+ * attempt over a newer run. Optional for the same rolling-upgrade reason.
600
+ */
601
+ claimToken: claimToken.optional(),
602
+ });
603
+ // =============================================================================
604
+ // POST /nodes/:id/jobs/:jobId/failure
605
+ // =============================================================================
606
+ /**
607
+ * The body of `POST /api/nodes/:id/jobs/:jobId/failure`.
608
+ *
609
+ * @stability experimental
610
+ */
611
+ export const nodeJobFailureSchema = z.object({
612
+ /** What went wrong, in the words that will appear in `Job.lastError`. */
613
+ error: z.string().trim().min(1, 'An error message is required').max(MAX_ERROR_LENGTH),
614
+ /**
615
+ * "A provider throttled me." Treated IDENTICALLY to a `RateLimitError`
616
+ * thrown by an in-process handler — see `job-terminal.service.ts`'s header
617
+ * on why a flag and a throw must reach the same conclusion.
618
+ */
619
+ rateLimited: z.boolean().optional(),
620
+ /** A provider-requested delay in milliseconds; a FLOOR on the backoff, not an override. */
621
+ retryAfterMs: z
622
+ .number()
623
+ .int()
624
+ .min(0)
625
+ // One day. Past this, a "retry after" is a bug in whatever produced it,
626
+ // and honouring it would park a job for longer than most deployments
627
+ // keep their history.
628
+ .max(86_400_000)
629
+ .optional(),
630
+ /**
631
+ * ADVISORY ONLY, and accepted only so a node can say what it believes.
632
+ * The server's attempt budget decides; see the file header.
633
+ */
634
+ willRetry: z.boolean().optional(),
635
+ /**
636
+ * WHICH CLAIM failed — see `claimToken` above.
637
+ *
638
+ * Threaded here as well as on `result` because a failure is just as terminal:
639
+ * an old slot reporting "boom" settles the row (or charges an attempt against
640
+ * it) while a newer claim of the same job is still running fine. Optional for
641
+ * the same rolling-upgrade reason.
642
+ */
643
+ claimToken: claimToken.optional(),
644
+ });
645
+ // -----------------------------------------------------------------------------
646
+ // From node-data-plane.dto.ts: The data plane's request and response bodies (issue #269, epic #254)
647
+ // -----------------------------------------------------------------------------
648
+ // =============================================================================
649
+ // The data plane's request and response bodies (issue #269, epic #254)
650
+ // =============================================================================
651
+ //
652
+ // #268 gave a node a CONTROL plane: claim a job, renew its lease, report an
653
+ // outcome. What it could not do was read a single byte or write one, because
654
+ // a node holds no storage credentials — by design, and permanently. These
655
+ // bodies are the whole of the answer.
656
+ //
657
+ // -----------------------------------------------------------------------------
658
+ // THE SHAPE OF THE SOLUTION, AND THE TWO ALTERNATIVES IT BEATS
659
+ // -----------------------------------------------------------------------------
660
+ //
661
+ // The server mints a SHORT-LIVED, SINGLE-OBJECT signed URL and the node talks
662
+ // to the storage provider directly. Bytes never pass through the API.
663
+ //
664
+ // REJECTED: PROXYING BYTES THROUGH THE API (`GET /nodes/:id/jobs/:jobId/input`
665
+ // streaming the object, `POST …/output` accepting it). It is the smallest
666
+ // diff and it is the worst outcome. Every byte of every job would cross the
667
+ // API process twice — once in, once out — so the API's memory, its event loop
668
+ // and its egress bill become a function of how much work the FLEET is doing,
669
+ // which is the exact coupling a worker node exists to remove. A ten-node fleet
670
+ // hashing 1 GB objects would saturate the API before it saturated anything
671
+ // that was actually computing. It also puts long-lived streaming connections
672
+ // on the same process that serves interactive requests, so one large transfer
673
+ // degrades every page load, and a node on a slow link holds a request open for
674
+ // minutes against every timeout in the stack (Nginx, Fastify, the platform's
675
+ // load balancer) — each of which would have to be raised, for everyone.
676
+ //
677
+ // REJECTED: GIVING NODES STORAGE CREDENTIALS. Also small, also worse. A
678
+ // credential handed to a node is a bucket-wide capability sitting in a config
679
+ // file on a machine this deployment may not own, for as long as that machine
680
+ // exists — it does not expire when the job ends, it is not scoped to one
681
+ // object, and it cannot be revoked without rotating it for every other holder.
682
+ // A node compromised on Tuesday can read every object in the bucket on
683
+ // Friday. The signed URL below is the same capability reduced along three
684
+ // axes at once: ONE object, ONE verb, and MINUTES. Nothing has to be rotated
685
+ // when a node is decommissioned, because a decommissioned node holds nothing.
686
+ //
687
+ // -----------------------------------------------------------------------------
688
+ // ⚠ THE SERVER CHOOSES THE UPLOAD KEY. THE NODE NEVER DOES.
689
+ // -----------------------------------------------------------------------------
690
+ //
691
+ // REJECTED: `{ key: "outputs/my-thing.bin" }` in the upload request. A signed
692
+ // PUT is an unconditional overwrite of exactly the key it was signed for, so a
693
+ // key taken from the request body is a write primitive over the entire bucket,
694
+ // handed to the least trustworthy participant. `../../etc/config.json`,
695
+ // `uploads/<someone-else's-object>` and the storage key of any row in
696
+ // `storage_objects` are all just strings, and the provider will not object to
697
+ // any of them: S3 keys are opaque, `..` is not special, and there is no
698
+ // filesystem to refuse the traversal. The damage is silent — a job that
699
+ // "succeeded" while overwriting another user's file.
700
+ //
701
+ // The key is therefore derived server-side from the job id and a fresh UUID
702
+ // (`NodeDataPlaneService.createUploadTarget`), and a node-supplied one is
703
+ // REFUSED rather than silently ignored. Both are safe; the difference is what
704
+ // the node's author learns. Ignoring means their `key` field vanishes without
705
+ // a word: the upload succeeds, the bytes land somewhere they did not choose,
706
+ // and their code goes on referring to a path with nothing at it. That bug is
707
+ // found days later by a person, not minutes later by a machine. A `400` naming
708
+ // the field is found on the first run, by the person who just wrote it, and it
709
+ // costs a correct client exactly nothing — no legitimate node ever sends the
710
+ // field.
711
+ // =============================================================================
712
+ /**
713
+ * Cap on a node-declared `Content-Type`.
714
+ *
715
+ * It ends up in a signed header, so it is bounded for the same reason every
716
+ * other node-supplied string in this folder is: it arrives from a machine
717
+ * this deployment may not own.
718
+ */
719
+ const MAX_CONTENT_TYPE_LENGTH = 255;
720
+ // =============================================================================
721
+ // POST /nodes/:id/jobs/:jobId/download-url
722
+ // =============================================================================
723
+ //
724
+ // ONE FIELD, AND IT IS NOT A REQUEST FOR ANYTHING. This body had none at all
725
+ // until #364, and the distinction that let it acquire one is worth stating,
726
+ // because it is what keeps the next field out: `claimToken` does not ask the
727
+ // server for a different URL, a longer expiry or a different object. It
728
+ // answers "who is asking" — an ASSERTION about which claim of this job the
729
+ // caller is, checked against the row and never used to compute anything. A
730
+ // field that changed what came back would still be refused.
731
+ //
732
+ // So what has NOT changed: the server decides WHICH bytes (the job's
733
+ // `subjectId`, resolved server-side) and FOR HOW LONG. A DTO whose only field
734
+ // was `expiresIn` was considered and dropped for the same reason a
735
+ // node-supplied lease was dropped in #268 — the bound exists to limit the
736
+ // blast radius of a leaked URL, so the party the bound protects against does
737
+ // not get to set it.
738
+ //
739
+ // It is a POST rather than a GET even though it reads nothing, because it
740
+ // MINTS A CREDENTIAL. A GET's URL is the thing every layer between here and
741
+ // the node writes down — proxy access logs, browser history, a CDN cache key,
742
+ // an APM trace's endpoint label — and a response body containing a bearer URL
743
+ // has no business being cacheable by anything. POST is uncacheable by default
744
+ // and carries no such expectation.
745
+ /**
746
+ * What a node may say when asking to read its input: which claim is asking,
747
+ * and nothing else.
748
+ *
749
+ * ⚠ `.default({})` IS THE BACKWARD-COMPATIBILITY GUARANTEE, not a convenience.
750
+ * This route took no body at all until #364, so every node in every fleet
751
+ * posts to it with no payload and no `Content-Type` — Fastify hands Nest
752
+ * `undefined`, and a bare `z.object({...})` would reject that outright and
753
+ * fail every download from every node that has not been upgraded yet. The
754
+ * default is what makes "no body" parse to "no assertion", which is the
755
+ * pre-#364 behaviour spelled as data. Do not unwrap it. `nodeUploadUrlSchema`
756
+ * below and `nodeJobSecretRequestSchema` carry it for the milder version of
757
+ * the same reason — there, an empty body was always legal.
758
+ *
759
+ * A plain object rather than the `z.looseObject` its sibling uses: unknown
760
+ * keys here are stripped, exactly as they were ignored before this body
761
+ * existed. The loose-then-refuse-by-name treatment next door exists for `key`,
762
+ * a field whose silent omission would send a node's bytes somewhere it did not
763
+ * choose; nothing a node can put in THIS body has ever had an effect, so there
764
+ * is no misunderstanding to name.
765
+ *
766
+ * @stability experimental
767
+ */
768
+ export const nodeDownloadUrlSchema = z
769
+ .object({
770
+ /** Which claim of the job is asking (`claimTokenField`). */
771
+ claimToken: claimTokenField.optional(),
772
+ })
773
+ .default({});
774
+ // =============================================================================
775
+ // POST /nodes/:id/jobs/:jobId/upload-url
776
+ // =============================================================================
777
+ /**
778
+ * What a node may say when asking for somewhere to write.
779
+ *
780
+ * ⚠ `z.looseObject` RATHER THAN `z.strictObject`, AND THE REASON IS THE ERROR
781
+ * MESSAGE. Strict mode rejects an unknown key with a perfectly good Zod issue
782
+ * naming it — and that issue is then DESTROYED on the way out, because
783
+ * `http-exception.filter.ts` rebuilds every error body from a fixed key
784
+ * allowlist (`message`, `code`, `details`) and the validation pipe puts its
785
+ * issues under `errors`. The node would receive a bare
786
+ * `400 "Validation failed"`, which for the one field this endpoint most needs
787
+ * to talk about — `key` — is the least useful answer available.
788
+ *
789
+ * So unknown keys are CAPTURED here and refused in
790
+ * `NodeDataPlaneService.createUploadTarget`, which can raise a
791
+ * `BadRequestException` carrying a message that names the field, explains that
792
+ * the server chooses the key, and survives the filter intact. The security
793
+ * outcome is identical either way (the key is never read); what differs is
794
+ * whether the node's author is told why.
795
+ *
796
+ * `.default({})` so a node with nothing to declare may send an EMPTY BODY
797
+ * rather than being required to send `{}` to satisfy a parser.
798
+ *
799
+ * @stability experimental
800
+ */
801
+ export const nodeUploadUrlSchema = z
802
+ .looseObject({
803
+ /**
804
+ * The `Content-Type` the node will send on its PUT.
805
+ *
806
+ * ⚠ IT BECOMES PART OF THE SIGNATURE. A node that declares it MUST send
807
+ * exactly this header, or the provider answers `SignatureDoesNotMatch` —
808
+ * an error that names the signature and not the header that broke it. A
809
+ * node that is unsure should omit it and send whatever it likes.
810
+ */
811
+ contentType: z
812
+ .string()
813
+ .trim()
814
+ .min(1)
815
+ .max(MAX_CONTENT_TYPE_LENGTH)
816
+ .optional(),
817
+ /**
818
+ * WHICH CLAIM is asking for somewhere to write — see
819
+ * `claim-token.field.ts`.
820
+ *
821
+ * ⚠ THE SHARPEST OF THE SIX ROUTES THAT CARRY THIS, and the quietest if it
822
+ * is missing. Since #348 a type may derive its output key from the JOB
823
+ * (`deriveOutputKey`), so the key is a function of the row and not of the
824
+ * claim — which means a node's stale worker slot asking here is handed a
825
+ * signed PUT for the EXACT key its own later claim is currently writing.
826
+ * Both PUTs answer 200, the surviving bytes are whichever landed last, and
827
+ * nothing in any log ties the two together. The token is what refuses the
828
+ * first slot before the URL is minted.
829
+ *
830
+ * ⚠ IT IS ALSO A PERMITTED FIELD, which is not automatic here:
831
+ * `NodeDataPlaneService.rejectCallerSuppliedFields` refuses anything
832
+ * outside its allowlist by name, so adding a field to this schema without
833
+ * adding it there would 400 every upgraded node. The allowlist is the
834
+ * authority; this schema only describes.
835
+ */
836
+ claimToken: claimTokenField.optional(),
837
+ })
838
+ .default({});
839
+ // -----------------------------------------------------------------------------
840
+ // From node-job-secret.dto.ts: The per-job secret request and response bodies (issue #349, epic #345)
841
+ // -----------------------------------------------------------------------------
842
+ // =============================================================================
843
+ // The per-job secret request and response bodies (issue #349, epic #345)
844
+ // =============================================================================
845
+ //
846
+ // #269 gave a node a way to move BYTES with no storage credentials. This gives
847
+ // it a way to hold a CREDENTIAL for exactly one job, for exactly as long as it
848
+ // holds that job's lease. `job-secret-broker.ts` carries the argument for why
849
+ // the credential is brokered per job at all, and what the three rejected
850
+ // alternatives were; this file is about the wire shape, which has two
851
+ // properties worth stating on their own.
852
+ //
853
+ // -----------------------------------------------------------------------------
854
+ // ⚠ THE REQUEST BODY ASKS FOR NOTHING, AND ANY FIELD THAT DOES IS A 400
855
+ // -----------------------------------------------------------------------------
856
+ //
857
+ // Everything the server needs is already on the path (which node) and in the
858
+ // row (which job, which type, which broker, which lease). There is nothing a
859
+ // node could usefully ASK FOR — and, far more importantly, nothing it is
860
+ // ALLOWED to ask for: A NODE MAY NOT REQUEST A SECRET IT WAS NOT ASSIGNED. A
861
+ // `kind`, a `scope`, a `database`, a `ttl` in the body would each be a node
862
+ // choosing some part of a credential's shape, and every one of those is the
863
+ // server's choice derived from the job the node is holding.
864
+ //
865
+ // ⚠ `claimToken` (#364) IS THE ONE PERMITTED FIELD, AND IT IS NOT AN EXCEPTION
866
+ // TO THAT RULE — it is the rule applied to a different question. Every field
867
+ // above asks the server for something; this one ANSWERS something: which claim
868
+ // of this job is asking. It changes nothing about the credential — not its
869
+ // kind, not its scope, not its lifetime, all of which are still derived from
870
+ // the row — and the only thing it can do is get the request REFUSED, which is
871
+ // the whole point. Without it, the ambiguity this route is most exposed to is
872
+ // also its worst: `claimedByNodeId` cannot tell a node's stalled, reaped slot
873
+ // from the slot that re-claimed the job, so the stale one is handed a LIVE
874
+ // DATABASE CREDENTIAL, bounded by a lease belonging to a claim that is not its
875
+ // own. A field that can only ever narrow who may be answered is the one shape
876
+ // of field this body can safely grow.
877
+ //
878
+ // So the refusal is the same one `NodeUploadUrlDto` makes about `key`, applied
879
+ // to a body that permits nothing a node could ask for — including the `ttl`
880
+ // case, which
881
+ // is the one somebody will genuinely want. A node-chosen lifetime is refused
882
+ // for the reason #268 refused a node-chosen lease: the bound exists to limit
883
+ // the blast radius of a leaked credential, so the party the bound protects
884
+ // against does not get to set it. The credential is bounded by the job's lease,
885
+ // which the node is already renewing (#347), and there is deliberately no
886
+ // second clock.
887
+ //
888
+ // `z.looseObject`, NOT `z.strictObject`, and the reason is the error message —
889
+ // the identical reasoning `node-data-plane.dto.ts` records. Strict mode's
890
+ // perfectly good Zod issue is DESTROYED on the way out, because
891
+ // `http-exception.filter.ts` rebuilds every error body from a fixed key
892
+ // allowlist and the validation pipe files its issues under `errors`; the node
893
+ // would receive a bare `400 "Validation failed"` naming nothing. Unknown keys
894
+ // are therefore CAPTURED here and refused in `NodeSecretBrokerService`, which
895
+ // can raise a message that names the field and survives the filter intact. The
896
+ // security outcome is identical either way — no field a node ASKS with is ever
897
+ // read, and the one field that is read (`claimToken`) is declared in the schema
898
+ // rather than swept up as an unknown key — and what differs is whether the
899
+ // node's author is told why.
900
+ //
901
+ // -----------------------------------------------------------------------------
902
+ // POST, NOT GET, AND `Cache-Control: no-store`
903
+ // -----------------------------------------------------------------------------
904
+ //
905
+ // The same reason `worker-nodes.md`, "Data plane", gives for the two data-plane
906
+ // routes, and it applies harder here because what comes back is not a scoped,
907
+ // minutes-long URL but a credential. A `GET`'s URL is what every layer between
908
+ // the server and the node writes down — proxy access logs, a CDN cache key, an
909
+ // APM trace's endpoint label — and a response body containing a credential has
910
+ // no business being cacheable by anything. `POST` is uncacheable by default;
911
+ // `no-store` says so out loud for the intermediary that decides to be clever
912
+ // anyway.
913
+ // =============================================================================
914
+ /**
915
+ * What a node may say when asking for its job's credential: which claim is
916
+ * asking, and nothing else.
917
+ *
918
+ * `.default({})` so a node with nothing to declare may send an empty body
919
+ * rather than being made to send `{}` to satisfy a parser — an empty body is
920
+ * still a correct request, and is what every node sent before #364. Anything
921
+ * beyond `claimToken` is captured by the loose object and refused by name in
922
+ * the service, whose allowlist — not this schema — is the authority on what
923
+ * may be sent; adding a field here without adding it there would 400 the
924
+ * clients that send it.
925
+ *
926
+ * @stability experimental
927
+ */
928
+ export const nodeJobSecretRequestSchema = z
929
+ .looseObject({
930
+ /** WHICH CLAIM is asking — see `claim-token.field.ts` and the header above. */
931
+ claimToken: claimTokenField.optional(),
932
+ })
933
+ .default({});
934
+ //# sourceMappingURL=schemas.js.map