@marinoscar/platform-contract 0.1.0-next.3 → 0.1.0-next.30

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 (777) hide show
  1. package/CHANGELOG.md +278 -0
  2. package/README.md +28 -1
  3. package/dist/cjs/ai/capabilities.d.ts +85 -0
  4. package/dist/cjs/ai/capabilities.d.ts.map +1 -0
  5. package/dist/cjs/ai/capabilities.js +93 -0
  6. package/dist/cjs/ai/capabilities.js.map +1 -0
  7. package/dist/cjs/ai/constants.d.ts +239 -0
  8. package/dist/cjs/ai/constants.d.ts.map +1 -0
  9. package/dist/cjs/ai/constants.js +233 -0
  10. package/dist/cjs/ai/constants.js.map +1 -0
  11. package/dist/cjs/ai/features.d.ts +24 -0
  12. package/dist/cjs/ai/features.d.ts.map +1 -0
  13. package/dist/cjs/ai/features.js +33 -0
  14. package/dist/cjs/ai/features.js.map +1 -0
  15. package/dist/cjs/ai/index.d.ts +11 -0
  16. package/dist/cjs/ai/index.d.ts.map +1 -0
  17. package/dist/cjs/ai/index.js +81 -0
  18. package/dist/cjs/ai/index.js.map +1 -0
  19. package/dist/cjs/ai/org-keys.d.ts +50 -0
  20. package/dist/cjs/ai/org-keys.d.ts.map +1 -0
  21. package/dist/cjs/ai/org-keys.js +43 -0
  22. package/dist/cjs/ai/org-keys.js.map +1 -0
  23. package/dist/cjs/ai/schemas.d.ts +642 -0
  24. package/dist/cjs/ai/schemas.d.ts.map +1 -0
  25. package/dist/cjs/ai/schemas.js +894 -0
  26. package/dist/cjs/ai/schemas.js.map +1 -0
  27. package/dist/cjs/alerts/constants.d.ts +195 -0
  28. package/dist/cjs/alerts/constants.d.ts.map +1 -0
  29. package/dist/cjs/alerts/constants.js +165 -0
  30. package/dist/cjs/alerts/constants.js.map +1 -0
  31. package/dist/cjs/alerts/enum.d.ts +5 -0
  32. package/dist/cjs/alerts/enum.d.ts.map +1 -0
  33. package/dist/cjs/alerts/enum.js +9 -0
  34. package/dist/cjs/alerts/enum.js.map +1 -0
  35. package/dist/cjs/alerts/index.d.ts +5 -0
  36. package/dist/cjs/alerts/index.d.ts.map +1 -0
  37. package/dist/cjs/alerts/index.js +68 -0
  38. package/dist/cjs/alerts/index.js.map +1 -0
  39. package/dist/cjs/alerts/schemas.d.ts +351 -0
  40. package/dist/cjs/alerts/schemas.d.ts.map +1 -0
  41. package/dist/cjs/alerts/schemas.js +432 -0
  42. package/dist/cjs/alerts/schemas.js.map +1 -0
  43. package/dist/cjs/android-app/constants.d.ts +337 -0
  44. package/dist/cjs/android-app/constants.d.ts.map +1 -0
  45. package/dist/cjs/android-app/constants.js +312 -0
  46. package/dist/cjs/android-app/constants.js.map +1 -0
  47. package/dist/cjs/android-app/index.d.ts +5 -0
  48. package/dist/cjs/android-app/index.d.ts.map +1 -0
  49. package/dist/cjs/android-app/index.js +57 -0
  50. package/dist/cjs/android-app/index.js.map +1 -0
  51. package/dist/cjs/android-app/schemas.d.ts +358 -0
  52. package/dist/cjs/android-app/schemas.d.ts.map +1 -0
  53. package/dist/cjs/android-app/schemas.js +310 -0
  54. package/dist/cjs/android-app/schemas.js.map +1 -0
  55. package/dist/cjs/credentials/constants.d.ts +35 -0
  56. package/dist/cjs/credentials/constants.d.ts.map +1 -0
  57. package/dist/cjs/credentials/constants.js +39 -0
  58. package/dist/cjs/credentials/constants.js.map +1 -0
  59. package/dist/cjs/credentials/index.d.ts +5 -0
  60. package/dist/cjs/credentials/index.d.ts.map +1 -0
  61. package/dist/cjs/credentials/index.js +17 -0
  62. package/dist/cjs/credentials/index.js.map +1 -0
  63. package/dist/cjs/credentials/schemas.d.ts +64 -0
  64. package/dist/cjs/credentials/schemas.d.ts.map +1 -0
  65. package/dist/cjs/credentials/schemas.js +82 -0
  66. package/dist/cjs/credentials/schemas.js.map +1 -0
  67. package/dist/cjs/db-backup/config.d.ts +76 -0
  68. package/dist/cjs/db-backup/config.d.ts.map +1 -0
  69. package/dist/cjs/db-backup/config.js +115 -0
  70. package/dist/cjs/db-backup/config.js.map +1 -0
  71. package/dist/cjs/db-backup/constants.d.ts +314 -0
  72. package/dist/cjs/db-backup/constants.d.ts.map +1 -0
  73. package/dist/cjs/db-backup/constants.js +243 -0
  74. package/dist/cjs/db-backup/constants.js.map +1 -0
  75. package/dist/cjs/db-backup/index.d.ts +19 -0
  76. package/dist/cjs/db-backup/index.d.ts.map +1 -0
  77. package/dist/cjs/db-backup/index.js +81 -0
  78. package/dist/cjs/db-backup/index.js.map +1 -0
  79. package/dist/cjs/db-backup/node-credential.d.ts +37 -0
  80. package/dist/cjs/db-backup/node-credential.d.ts.map +1 -0
  81. package/dist/cjs/db-backup/node-credential.js +107 -0
  82. package/dist/cjs/db-backup/node-credential.js.map +1 -0
  83. package/dist/cjs/db-backup/node-result.d.ts +34 -0
  84. package/dist/cjs/db-backup/node-result.d.ts.map +1 -0
  85. package/dist/cjs/db-backup/node-result.js +168 -0
  86. package/dist/cjs/db-backup/node-result.js.map +1 -0
  87. package/dist/cjs/db-backup/restore.d.ts +405 -0
  88. package/dist/cjs/db-backup/restore.d.ts.map +1 -0
  89. package/dist/cjs/db-backup/restore.js +497 -0
  90. package/dist/cjs/db-backup/restore.js.map +1 -0
  91. package/dist/cjs/db-backup/run-actions.d.ts +49 -0
  92. package/dist/cjs/db-backup/run-actions.d.ts.map +1 -0
  93. package/dist/cjs/db-backup/run-actions.js +121 -0
  94. package/dist/cjs/db-backup/run-actions.js.map +1 -0
  95. package/dist/cjs/db-backup/runs-list-query.d.ts +20 -0
  96. package/dist/cjs/db-backup/runs-list-query.d.ts.map +1 -0
  97. package/dist/cjs/db-backup/runs-list-query.js +53 -0
  98. package/dist/cjs/db-backup/runs-list-query.js.map +1 -0
  99. package/dist/cjs/db-backup/runs.d.ts +46 -0
  100. package/dist/cjs/db-backup/runs.d.ts.map +1 -0
  101. package/dist/cjs/db-backup/runs.js +232 -0
  102. package/dist/cjs/db-backup/runs.js.map +1 -0
  103. package/dist/cjs/db-backup/schemas.d.ts +9 -0
  104. package/dist/cjs/db-backup/schemas.d.ts.map +1 -0
  105. package/dist/cjs/db-backup/schemas.js +31 -0
  106. package/dist/cjs/db-backup/schemas.js.map +1 -0
  107. package/dist/cjs/db-backup/settings-schemas.d.ts +217 -0
  108. package/dist/cjs/db-backup/settings-schemas.d.ts.map +1 -0
  109. package/dist/cjs/db-backup/settings-schemas.js +319 -0
  110. package/dist/cjs/db-backup/settings-schemas.js.map +1 -0
  111. package/dist/cjs/email/constants.d.ts +82 -0
  112. package/dist/cjs/email/constants.d.ts.map +1 -0
  113. package/dist/cjs/email/constants.js +82 -0
  114. package/dist/cjs/email/constants.js.map +1 -0
  115. package/dist/cjs/email/index.d.ts +5 -0
  116. package/dist/cjs/email/index.d.ts.map +1 -0
  117. package/dist/cjs/email/index.js +30 -0
  118. package/dist/cjs/email/index.js.map +1 -0
  119. package/dist/cjs/email/schemas.d.ts +276 -0
  120. package/dist/cjs/email/schemas.d.ts.map +1 -0
  121. package/dist/cjs/email/schemas.js +280 -0
  122. package/dist/cjs/email/schemas.js.map +1 -0
  123. package/dist/cjs/exports/constants.d.ts +123 -0
  124. package/dist/cjs/exports/constants.d.ts.map +1 -0
  125. package/dist/cjs/exports/constants.js +109 -0
  126. package/dist/cjs/exports/constants.js.map +1 -0
  127. package/dist/cjs/exports/index.d.ts +5 -0
  128. package/dist/cjs/exports/index.d.ts.map +1 -0
  129. package/dist/cjs/exports/index.js +42 -0
  130. package/dist/cjs/exports/index.js.map +1 -0
  131. package/dist/cjs/exports/schemas.d.ts +386 -0
  132. package/dist/cjs/exports/schemas.d.ts.map +1 -0
  133. package/dist/cjs/exports/schemas.js +288 -0
  134. package/dist/cjs/exports/schemas.js.map +1 -0
  135. package/dist/cjs/identity/constants.d.ts +326 -0
  136. package/dist/cjs/identity/constants.d.ts.map +1 -0
  137. package/dist/cjs/identity/constants.js +318 -0
  138. package/dist/cjs/identity/constants.js.map +1 -0
  139. package/dist/cjs/identity/index.d.ts +5 -0
  140. package/dist/cjs/identity/index.d.ts.map +1 -0
  141. package/dist/cjs/identity/index.js +79 -0
  142. package/dist/cjs/identity/index.js.map +1 -0
  143. package/dist/cjs/identity/schemas.d.ts +792 -0
  144. package/dist/cjs/identity/schemas.d.ts.map +1 -0
  145. package/dist/cjs/identity/schemas.js +703 -0
  146. package/dist/cjs/identity/schemas.js.map +1 -0
  147. package/dist/cjs/jobs/constants.d.ts +135 -0
  148. package/dist/cjs/jobs/constants.d.ts.map +1 -0
  149. package/dist/cjs/jobs/constants.js +130 -0
  150. package/dist/cjs/jobs/constants.js.map +1 -0
  151. package/dist/cjs/jobs/index.d.ts +9 -0
  152. package/dist/cjs/jobs/index.d.ts.map +1 -0
  153. package/dist/cjs/jobs/index.js +59 -0
  154. package/dist/cjs/jobs/index.js.map +1 -0
  155. package/dist/cjs/jobs/retention-schemas.d.ts +252 -0
  156. package/dist/cjs/jobs/retention-schemas.d.ts.map +1 -0
  157. package/dist/cjs/jobs/retention-schemas.js +233 -0
  158. package/dist/cjs/jobs/retention-schemas.js.map +1 -0
  159. package/dist/cjs/jobs/schemas.d.ts +361 -0
  160. package/dist/cjs/jobs/schemas.d.ts.map +1 -0
  161. package/dist/cjs/jobs/schemas.js +706 -0
  162. package/dist/cjs/jobs/schemas.js.map +1 -0
  163. package/dist/cjs/jobs/settings-schemas.d.ts +84 -0
  164. package/dist/cjs/jobs/settings-schemas.d.ts.map +1 -0
  165. package/dist/cjs/jobs/settings-schemas.js +116 -0
  166. package/dist/cjs/jobs/settings-schemas.js.map +1 -0
  167. package/dist/cjs/nodes/admin-schemas.d.ts +288 -0
  168. package/dist/cjs/nodes/admin-schemas.d.ts.map +1 -0
  169. package/dist/cjs/nodes/admin-schemas.js +207 -0
  170. package/dist/cjs/nodes/admin-schemas.js.map +1 -0
  171. package/dist/cjs/nodes/constants.d.ts +98 -0
  172. package/dist/cjs/nodes/constants.d.ts.map +1 -0
  173. package/dist/cjs/nodes/constants.js +114 -0
  174. package/dist/cjs/nodes/constants.js.map +1 -0
  175. package/dist/cjs/nodes/index.d.ts +8 -0
  176. package/dist/cjs/nodes/index.d.ts.map +1 -0
  177. package/dist/cjs/nodes/index.js +63 -0
  178. package/dist/cjs/nodes/index.js.map +1 -0
  179. package/dist/cjs/nodes/schemas.d.ts +510 -0
  180. package/dist/cjs/nodes/schemas.d.ts.map +1 -0
  181. package/dist/cjs/nodes/schemas.js +1085 -0
  182. package/dist/cjs/nodes/schemas.js.map +1 -0
  183. package/dist/cjs/nodes/settings-schemas.d.ts +82 -0
  184. package/dist/cjs/nodes/settings-schemas.d.ts.map +1 -0
  185. package/dist/cjs/nodes/settings-schemas.js +106 -0
  186. package/dist/cjs/nodes/settings-schemas.js.map +1 -0
  187. package/dist/cjs/notifications/constants.d.ts +243 -0
  188. package/dist/cjs/notifications/constants.d.ts.map +1 -0
  189. package/dist/cjs/notifications/constants.js +209 -0
  190. package/dist/cjs/notifications/constants.js.map +1 -0
  191. package/dist/cjs/notifications/index.d.ts +5 -0
  192. package/dist/cjs/notifications/index.d.ts.map +1 -0
  193. package/dist/cjs/notifications/index.js +93 -0
  194. package/dist/cjs/notifications/index.js.map +1 -0
  195. package/dist/cjs/notifications/schemas.d.ts +1094 -0
  196. package/dist/cjs/notifications/schemas.d.ts.map +1 -0
  197. package/dist/cjs/notifications/schemas.js +915 -0
  198. package/dist/cjs/notifications/schemas.js.map +1 -0
  199. package/dist/cjs/onboarding/constants.d.ts +138 -0
  200. package/dist/cjs/onboarding/constants.d.ts.map +1 -0
  201. package/dist/cjs/onboarding/constants.js +123 -0
  202. package/dist/cjs/onboarding/constants.js.map +1 -0
  203. package/dist/cjs/onboarding/index.d.ts +5 -0
  204. package/dist/cjs/onboarding/index.d.ts.map +1 -0
  205. package/dist/cjs/onboarding/index.js +42 -0
  206. package/dist/cjs/onboarding/index.js.map +1 -0
  207. package/dist/cjs/onboarding/schemas.d.ts +360 -0
  208. package/dist/cjs/onboarding/schemas.d.ts.map +1 -0
  209. package/dist/cjs/onboarding/schemas.js +260 -0
  210. package/dist/cjs/onboarding/schemas.js.map +1 -0
  211. package/dist/cjs/settings/constants.d.ts +206 -0
  212. package/dist/cjs/settings/constants.d.ts.map +1 -0
  213. package/dist/cjs/settings/constants.js +200 -0
  214. package/dist/cjs/settings/constants.js.map +1 -0
  215. package/dist/cjs/settings/index.d.ts +6 -0
  216. package/dist/cjs/settings/index.d.ts.map +1 -0
  217. package/dist/cjs/settings/index.js +67 -0
  218. package/dist/cjs/settings/index.js.map +1 -0
  219. package/dist/cjs/settings/schemas.d.ts +610 -0
  220. package/dist/cjs/settings/schemas.d.ts.map +1 -0
  221. package/dist/cjs/settings/schemas.js +498 -0
  222. package/dist/cjs/settings/schemas.js.map +1 -0
  223. package/dist/cjs/settings/types.d.ts +81 -0
  224. package/dist/cjs/settings/types.d.ts.map +1 -0
  225. package/dist/cjs/settings/types.js +6 -0
  226. package/dist/cjs/settings/types.js.map +1 -0
  227. package/dist/cjs/sharing/constants.d.ts +232 -0
  228. package/dist/cjs/sharing/constants.d.ts.map +1 -0
  229. package/dist/cjs/sharing/constants.js +179 -0
  230. package/dist/cjs/sharing/constants.js.map +1 -0
  231. package/dist/cjs/sharing/enum.d.ts +5 -0
  232. package/dist/cjs/sharing/enum.d.ts.map +1 -0
  233. package/dist/cjs/sharing/enum.js +9 -0
  234. package/dist/cjs/sharing/enum.js.map +1 -0
  235. package/dist/cjs/sharing/grants.d.ts +518 -0
  236. package/dist/cjs/sharing/grants.d.ts.map +1 -0
  237. package/dist/cjs/sharing/grants.js +484 -0
  238. package/dist/cjs/sharing/grants.js.map +1 -0
  239. package/dist/cjs/sharing/groups.d.ts +410 -0
  240. package/dist/cjs/sharing/groups.d.ts.map +1 -0
  241. package/dist/cjs/sharing/groups.js +375 -0
  242. package/dist/cjs/sharing/groups.js.map +1 -0
  243. package/dist/cjs/sharing/index.d.ts +5 -0
  244. package/dist/cjs/sharing/index.d.ts.map +1 -0
  245. package/dist/cjs/sharing/index.js +80 -0
  246. package/dist/cjs/sharing/index.js.map +1 -0
  247. package/dist/cjs/sharing/schemas.d.ts +3 -0
  248. package/dist/cjs/sharing/schemas.d.ts.map +1 -0
  249. package/dist/cjs/sharing/schemas.js +21 -0
  250. package/dist/cjs/sharing/schemas.js.map +1 -0
  251. package/dist/cjs/storage/constants.d.ts +142 -0
  252. package/dist/cjs/storage/constants.d.ts.map +1 -0
  253. package/dist/cjs/storage/constants.js +126 -0
  254. package/dist/cjs/storage/constants.js.map +1 -0
  255. package/dist/cjs/storage/index.d.ts +29 -0
  256. package/dist/cjs/storage/index.d.ts.map +1 -0
  257. package/dist/cjs/storage/index.js +86 -0
  258. package/dist/cjs/storage/index.js.map +1 -0
  259. package/dist/cjs/storage/objects-complete-upload.d.ts +19 -0
  260. package/dist/cjs/storage/objects-complete-upload.d.ts.map +1 -0
  261. package/dist/cjs/storage/objects-complete-upload.js +19 -0
  262. package/dist/cjs/storage/objects-complete-upload.js.map +1 -0
  263. package/dist/cjs/storage/objects-download-url.d.ts +17 -0
  264. package/dist/cjs/storage/objects-download-url.d.ts.map +1 -0
  265. package/dist/cjs/storage/objects-download-url.js +16 -0
  266. package/dist/cjs/storage/objects-download-url.js.map +1 -0
  267. package/dist/cjs/storage/objects-init-upload.d.ts +152 -0
  268. package/dist/cjs/storage/objects-init-upload.d.ts.map +1 -0
  269. package/dist/cjs/storage/objects-init-upload.js +129 -0
  270. package/dist/cjs/storage/objects-init-upload.js.map +1 -0
  271. package/dist/cjs/storage/objects-list-query.d.ts +50 -0
  272. package/dist/cjs/storage/objects-list-query.d.ts.map +1 -0
  273. package/dist/cjs/storage/objects-list-query.js +23 -0
  274. package/dist/cjs/storage/objects-list-query.js.map +1 -0
  275. package/dist/cjs/storage/objects-object-response.d.ts +49 -0
  276. package/dist/cjs/storage/objects-object-response.d.ts.map +1 -0
  277. package/dist/cjs/storage/objects-object-response.js +54 -0
  278. package/dist/cjs/storage/objects-object-response.js.map +1 -0
  279. package/dist/cjs/storage/objects-update-metadata.d.ts +16 -0
  280. package/dist/cjs/storage/objects-update-metadata.d.ts.map +1 -0
  281. package/dist/cjs/storage/objects-update-metadata.js +14 -0
  282. package/dist/cjs/storage/objects-update-metadata.js.map +1 -0
  283. package/dist/cjs/storage/schemas.d.ts +14 -0
  284. package/dist/cjs/storage/schemas.d.ts.map +1 -0
  285. package/dist/cjs/storage/schemas.js +36 -0
  286. package/dist/cjs/storage/schemas.js.map +1 -0
  287. package/dist/cjs/storage/settings-schemas.d.ts +188 -0
  288. package/dist/cjs/storage/settings-schemas.d.ts.map +1 -0
  289. package/dist/cjs/storage/settings-schemas.js +223 -0
  290. package/dist/cjs/storage/settings-schemas.js.map +1 -0
  291. package/dist/cjs/storage/storage-bucket-provision.d.ts +152 -0
  292. package/dist/cjs/storage/storage-bucket-provision.d.ts.map +1 -0
  293. package/dist/cjs/storage/storage-bucket-provision.js +216 -0
  294. package/dist/cjs/storage/storage-bucket-provision.js.map +1 -0
  295. package/dist/cjs/storage/storage-config-response.d.ts +105 -0
  296. package/dist/cjs/storage/storage-config-response.d.ts.map +1 -0
  297. package/dist/cjs/storage/storage-config-response.js +181 -0
  298. package/dist/cjs/storage/storage-config-response.js.map +1 -0
  299. package/dist/cjs/storage/storage-config-update.d.ts +46 -0
  300. package/dist/cjs/storage/storage-config-update.d.ts.map +1 -0
  301. package/dist/cjs/storage/storage-config-update.js +133 -0
  302. package/dist/cjs/storage/storage-config-update.js.map +1 -0
  303. package/dist/cjs/storage/storage-connection-test.d.ts +129 -0
  304. package/dist/cjs/storage/storage-connection-test.d.ts.map +1 -0
  305. package/dist/cjs/storage/storage-connection-test.js +244 -0
  306. package/dist/cjs/storage/storage-connection-test.js.map +1 -0
  307. package/dist/cjs/storage/storage-migration.d.ts +102 -0
  308. package/dist/cjs/storage/storage-migration.d.ts.map +1 -0
  309. package/dist/cjs/storage/storage-migration.js +107 -0
  310. package/dist/cjs/storage/storage-migration.js.map +1 -0
  311. package/dist/cjs/storage/storage-status.d.ts +16 -0
  312. package/dist/cjs/storage/storage-status.d.ts.map +1 -0
  313. package/dist/cjs/storage/storage-status.js +23 -0
  314. package/dist/cjs/storage/storage-status.js.map +1 -0
  315. package/dist/cjs/telemetry/config.d.ts +4 -0
  316. package/dist/cjs/telemetry/config.d.ts.map +1 -1
  317. package/dist/cjs/telemetry/config.js +16 -2
  318. package/dist/cjs/telemetry/config.js.map +1 -1
  319. package/dist/cjs/telemetry/connection.d.ts +1 -1
  320. package/dist/cjs/telemetry/constants.d.ts +378 -6
  321. package/dist/cjs/telemetry/constants.d.ts.map +1 -1
  322. package/dist/cjs/telemetry/constants.js +296 -5
  323. package/dist/cjs/telemetry/constants.js.map +1 -1
  324. package/dist/cjs/telemetry/dashboard.d.ts +188 -17
  325. package/dist/cjs/telemetry/dashboard.d.ts.map +1 -1
  326. package/dist/cjs/telemetry/dashboard.js +61 -3
  327. package/dist/cjs/telemetry/dashboard.js.map +1 -1
  328. package/dist/cjs/telemetry/index.d.ts +4 -4
  329. package/dist/cjs/telemetry/index.d.ts.map +1 -1
  330. package/dist/cjs/telemetry/index.js +35 -3
  331. package/dist/cjs/telemetry/index.js.map +1 -1
  332. package/dist/cjs/telemetry/presentation.d.ts +243 -0
  333. package/dist/cjs/telemetry/presentation.d.ts.map +1 -0
  334. package/dist/cjs/telemetry/presentation.js +300 -0
  335. package/dist/cjs/telemetry/presentation.js.map +1 -0
  336. package/dist/cjs/telemetry/query.d.ts +2 -2
  337. package/dist/cjs/telemetry/schemas.d.ts +5 -2
  338. package/dist/cjs/telemetry/schemas.d.ts.map +1 -1
  339. package/dist/cjs/telemetry/schemas.js +21 -1
  340. package/dist/cjs/telemetry/schemas.js.map +1 -1
  341. package/dist/cjs/telemetry/stack.d.ts +5 -5
  342. package/dist/cjs/telemetry/store.d.ts +111 -0
  343. package/dist/cjs/telemetry/store.d.ts.map +1 -0
  344. package/dist/cjs/telemetry/store.js +83 -0
  345. package/dist/cjs/telemetry/store.js.map +1 -0
  346. package/dist/cjs/timezone/constants.d.ts +16 -0
  347. package/dist/cjs/timezone/constants.d.ts.map +1 -0
  348. package/dist/cjs/timezone/constants.js +19 -0
  349. package/dist/cjs/timezone/constants.js.map +1 -0
  350. package/dist/cjs/timezone/index.d.ts +15 -0
  351. package/dist/cjs/timezone/index.d.ts.map +1 -0
  352. package/dist/cjs/timezone/index.js +34 -0
  353. package/dist/cjs/timezone/index.js.map +1 -0
  354. package/dist/cjs/timezone/schemas.d.ts +111 -0
  355. package/dist/cjs/timezone/schemas.d.ts.map +1 -0
  356. package/dist/cjs/timezone/schemas.js +194 -0
  357. package/dist/cjs/timezone/schemas.js.map +1 -0
  358. package/dist/cjs/user-data/constants.d.ts +157 -0
  359. package/dist/cjs/user-data/constants.d.ts.map +1 -0
  360. package/dist/cjs/user-data/constants.js +137 -0
  361. package/dist/cjs/user-data/constants.js.map +1 -0
  362. package/dist/cjs/user-data/index.d.ts +5 -0
  363. package/dist/cjs/user-data/index.d.ts.map +1 -0
  364. package/dist/cjs/user-data/index.js +46 -0
  365. package/dist/cjs/user-data/index.js.map +1 -0
  366. package/dist/cjs/user-data/schemas.d.ts +306 -0
  367. package/dist/cjs/user-data/schemas.d.ts.map +1 -0
  368. package/dist/cjs/user-data/schemas.js +333 -0
  369. package/dist/cjs/user-data/schemas.js.map +1 -0
  370. package/dist/cjs/webhooks/constants.d.ts +154 -0
  371. package/dist/cjs/webhooks/constants.d.ts.map +1 -0
  372. package/dist/cjs/webhooks/constants.js +136 -0
  373. package/dist/cjs/webhooks/constants.js.map +1 -0
  374. package/dist/cjs/webhooks/enum.d.ts +5 -0
  375. package/dist/cjs/webhooks/enum.d.ts.map +1 -0
  376. package/dist/cjs/webhooks/enum.js +9 -0
  377. package/dist/cjs/webhooks/enum.js.map +1 -0
  378. package/dist/cjs/webhooks/index.d.ts +7 -0
  379. package/dist/cjs/webhooks/index.d.ts.map +1 -0
  380. package/dist/cjs/webhooks/index.js +48 -0
  381. package/dist/cjs/webhooks/index.js.map +1 -0
  382. package/dist/cjs/webhooks/schemas.d.ts +288 -0
  383. package/dist/cjs/webhooks/schemas.d.ts.map +1 -0
  384. package/dist/cjs/webhooks/schemas.js +295 -0
  385. package/dist/cjs/webhooks/schemas.js.map +1 -0
  386. package/dist/cjs/webhooks/signature.d.ts +54 -0
  387. package/dist/cjs/webhooks/signature.d.ts.map +1 -0
  388. package/dist/cjs/webhooks/signature.js +97 -0
  389. package/dist/cjs/webhooks/signature.js.map +1 -0
  390. package/dist/esm/ai/capabilities.d.ts +85 -0
  391. package/dist/esm/ai/capabilities.d.ts.map +1 -0
  392. package/dist/esm/ai/capabilities.js +90 -0
  393. package/dist/esm/ai/capabilities.js.map +1 -0
  394. package/dist/esm/ai/constants.d.ts +239 -0
  395. package/dist/esm/ai/constants.d.ts.map +1 -0
  396. package/dist/esm/ai/constants.js +229 -0
  397. package/dist/esm/ai/constants.js.map +1 -0
  398. package/dist/esm/ai/features.d.ts +24 -0
  399. package/dist/esm/ai/features.d.ts.map +1 -0
  400. package/dist/esm/ai/features.js +30 -0
  401. package/dist/esm/ai/features.js.map +1 -0
  402. package/dist/esm/ai/index.d.ts +11 -0
  403. package/dist/esm/ai/index.d.ts.map +1 -0
  404. package/dist/esm/ai/index.js +16 -0
  405. package/dist/esm/ai/index.js.map +1 -0
  406. package/dist/esm/ai/org-keys.d.ts +50 -0
  407. package/dist/esm/ai/org-keys.d.ts.map +1 -0
  408. package/dist/esm/ai/org-keys.js +40 -0
  409. package/dist/esm/ai/org-keys.js.map +1 -0
  410. package/dist/esm/ai/schemas.d.ts +642 -0
  411. package/dist/esm/ai/schemas.d.ts.map +1 -0
  412. package/dist/esm/ai/schemas.js +889 -0
  413. package/dist/esm/ai/schemas.js.map +1 -0
  414. package/dist/esm/alerts/constants.d.ts +195 -0
  415. package/dist/esm/alerts/constants.d.ts.map +1 -0
  416. package/dist/esm/alerts/constants.js +162 -0
  417. package/dist/esm/alerts/constants.js.map +1 -0
  418. package/dist/esm/alerts/enum.d.ts +5 -0
  419. package/dist/esm/alerts/enum.d.ts.map +1 -0
  420. package/dist/esm/alerts/enum.js +6 -0
  421. package/dist/esm/alerts/enum.js.map +1 -0
  422. package/dist/esm/alerts/index.d.ts +5 -0
  423. package/dist/esm/alerts/index.d.ts.map +1 -0
  424. package/dist/esm/alerts/index.js +8 -0
  425. package/dist/esm/alerts/index.js.map +1 -0
  426. package/dist/esm/alerts/schemas.d.ts +351 -0
  427. package/dist/esm/alerts/schemas.d.ts.map +1 -0
  428. package/dist/esm/alerts/schemas.js +429 -0
  429. package/dist/esm/alerts/schemas.js.map +1 -0
  430. package/dist/esm/android-app/constants.d.ts +337 -0
  431. package/dist/esm/android-app/constants.d.ts.map +1 -0
  432. package/dist/esm/android-app/constants.js +306 -0
  433. package/dist/esm/android-app/constants.js.map +1 -0
  434. package/dist/esm/android-app/index.d.ts +5 -0
  435. package/dist/esm/android-app/index.d.ts.map +1 -0
  436. package/dist/esm/android-app/index.js +8 -0
  437. package/dist/esm/android-app/index.js.map +1 -0
  438. package/dist/esm/android-app/schemas.d.ts +358 -0
  439. package/dist/esm/android-app/schemas.d.ts.map +1 -0
  440. package/dist/esm/android-app/schemas.js +306 -0
  441. package/dist/esm/android-app/schemas.js.map +1 -0
  442. package/dist/esm/credentials/constants.d.ts +35 -0
  443. package/dist/esm/credentials/constants.d.ts.map +1 -0
  444. package/dist/esm/credentials/constants.js +36 -0
  445. package/dist/esm/credentials/constants.js.map +1 -0
  446. package/dist/esm/credentials/index.d.ts +5 -0
  447. package/dist/esm/credentials/index.d.ts.map +1 -0
  448. package/dist/esm/credentials/index.js +8 -0
  449. package/dist/esm/credentials/index.js.map +1 -0
  450. package/dist/esm/credentials/schemas.d.ts +64 -0
  451. package/dist/esm/credentials/schemas.d.ts.map +1 -0
  452. package/dist/esm/credentials/schemas.js +79 -0
  453. package/dist/esm/credentials/schemas.js.map +1 -0
  454. package/dist/esm/db-backup/config.d.ts +76 -0
  455. package/dist/esm/db-backup/config.d.ts.map +1 -0
  456. package/dist/esm/db-backup/config.js +112 -0
  457. package/dist/esm/db-backup/config.js.map +1 -0
  458. package/dist/esm/db-backup/constants.d.ts +314 -0
  459. package/dist/esm/db-backup/constants.d.ts.map +1 -0
  460. package/dist/esm/db-backup/constants.js +240 -0
  461. package/dist/esm/db-backup/constants.js.map +1 -0
  462. package/dist/esm/db-backup/index.d.ts +19 -0
  463. package/dist/esm/db-backup/index.d.ts.map +1 -0
  464. package/dist/esm/db-backup/index.js +25 -0
  465. package/dist/esm/db-backup/index.js.map +1 -0
  466. package/dist/esm/db-backup/node-credential.d.ts +37 -0
  467. package/dist/esm/db-backup/node-credential.d.ts.map +1 -0
  468. package/dist/esm/db-backup/node-credential.js +104 -0
  469. package/dist/esm/db-backup/node-credential.js.map +1 -0
  470. package/dist/esm/db-backup/node-result.d.ts +34 -0
  471. package/dist/esm/db-backup/node-result.d.ts.map +1 -0
  472. package/dist/esm/db-backup/node-result.js +165 -0
  473. package/dist/esm/db-backup/node-result.js.map +1 -0
  474. package/dist/esm/db-backup/restore.d.ts +405 -0
  475. package/dist/esm/db-backup/restore.d.ts.map +1 -0
  476. package/dist/esm/db-backup/restore.js +494 -0
  477. package/dist/esm/db-backup/restore.js.map +1 -0
  478. package/dist/esm/db-backup/run-actions.d.ts +49 -0
  479. package/dist/esm/db-backup/run-actions.d.ts.map +1 -0
  480. package/dist/esm/db-backup/run-actions.js +118 -0
  481. package/dist/esm/db-backup/run-actions.js.map +1 -0
  482. package/dist/esm/db-backup/runs-list-query.d.ts +20 -0
  483. package/dist/esm/db-backup/runs-list-query.d.ts.map +1 -0
  484. package/dist/esm/db-backup/runs-list-query.js +50 -0
  485. package/dist/esm/db-backup/runs-list-query.js.map +1 -0
  486. package/dist/esm/db-backup/runs.d.ts +46 -0
  487. package/dist/esm/db-backup/runs.d.ts.map +1 -0
  488. package/dist/esm/db-backup/runs.js +229 -0
  489. package/dist/esm/db-backup/runs.js.map +1 -0
  490. package/dist/esm/db-backup/schemas.d.ts +9 -0
  491. package/dist/esm/db-backup/schemas.d.ts.map +1 -0
  492. package/dist/esm/db-backup/schemas.js +15 -0
  493. package/dist/esm/db-backup/schemas.js.map +1 -0
  494. package/dist/esm/db-backup/settings-schemas.d.ts +217 -0
  495. package/dist/esm/db-backup/settings-schemas.d.ts.map +1 -0
  496. package/dist/esm/db-backup/settings-schemas.js +316 -0
  497. package/dist/esm/db-backup/settings-schemas.js.map +1 -0
  498. package/dist/esm/email/constants.d.ts +82 -0
  499. package/dist/esm/email/constants.d.ts.map +1 -0
  500. package/dist/esm/email/constants.js +79 -0
  501. package/dist/esm/email/constants.js.map +1 -0
  502. package/dist/esm/email/index.d.ts +5 -0
  503. package/dist/esm/email/index.d.ts.map +1 -0
  504. package/dist/esm/email/index.js +8 -0
  505. package/dist/esm/email/index.js.map +1 -0
  506. package/dist/esm/email/schemas.d.ts +276 -0
  507. package/dist/esm/email/schemas.d.ts.map +1 -0
  508. package/dist/esm/email/schemas.js +277 -0
  509. package/dist/esm/email/schemas.js.map +1 -0
  510. package/dist/esm/exports/constants.d.ts +123 -0
  511. package/dist/esm/exports/constants.d.ts.map +1 -0
  512. package/dist/esm/exports/constants.js +106 -0
  513. package/dist/esm/exports/constants.js.map +1 -0
  514. package/dist/esm/exports/index.d.ts +5 -0
  515. package/dist/esm/exports/index.d.ts.map +1 -0
  516. package/dist/esm/exports/index.js +7 -0
  517. package/dist/esm/exports/index.js.map +1 -0
  518. package/dist/esm/exports/schemas.d.ts +386 -0
  519. package/dist/esm/exports/schemas.d.ts.map +1 -0
  520. package/dist/esm/exports/schemas.js +285 -0
  521. package/dist/esm/exports/schemas.js.map +1 -0
  522. package/dist/esm/identity/constants.d.ts +326 -0
  523. package/dist/esm/identity/constants.d.ts.map +1 -0
  524. package/dist/esm/identity/constants.js +312 -0
  525. package/dist/esm/identity/constants.js.map +1 -0
  526. package/dist/esm/identity/index.d.ts +5 -0
  527. package/dist/esm/identity/index.d.ts.map +1 -0
  528. package/dist/esm/identity/index.js +10 -0
  529. package/dist/esm/identity/index.js.map +1 -0
  530. package/dist/esm/identity/schemas.d.ts +792 -0
  531. package/dist/esm/identity/schemas.d.ts.map +1 -0
  532. package/dist/esm/identity/schemas.js +700 -0
  533. package/dist/esm/identity/schemas.js.map +1 -0
  534. package/dist/esm/jobs/constants.d.ts +135 -0
  535. package/dist/esm/jobs/constants.d.ts.map +1 -0
  536. package/dist/esm/jobs/constants.js +127 -0
  537. package/dist/esm/jobs/constants.js.map +1 -0
  538. package/dist/esm/jobs/index.d.ts +9 -0
  539. package/dist/esm/jobs/index.d.ts.map +1 -0
  540. package/dist/esm/jobs/index.js +11 -0
  541. package/dist/esm/jobs/index.js.map +1 -0
  542. package/dist/esm/jobs/retention-schemas.d.ts +252 -0
  543. package/dist/esm/jobs/retention-schemas.d.ts.map +1 -0
  544. package/dist/esm/jobs/retention-schemas.js +229 -0
  545. package/dist/esm/jobs/retention-schemas.js.map +1 -0
  546. package/dist/esm/jobs/schemas.d.ts +361 -0
  547. package/dist/esm/jobs/schemas.d.ts.map +1 -0
  548. package/dist/esm/jobs/schemas.js +703 -0
  549. package/dist/esm/jobs/schemas.js.map +1 -0
  550. package/dist/esm/jobs/settings-schemas.d.ts +84 -0
  551. package/dist/esm/jobs/settings-schemas.d.ts.map +1 -0
  552. package/dist/esm/jobs/settings-schemas.js +113 -0
  553. package/dist/esm/jobs/settings-schemas.js.map +1 -0
  554. package/dist/esm/nodes/admin-schemas.d.ts +288 -0
  555. package/dist/esm/nodes/admin-schemas.d.ts.map +1 -0
  556. package/dist/esm/nodes/admin-schemas.js +204 -0
  557. package/dist/esm/nodes/admin-schemas.js.map +1 -0
  558. package/dist/esm/nodes/constants.d.ts +98 -0
  559. package/dist/esm/nodes/constants.d.ts.map +1 -0
  560. package/dist/esm/nodes/constants.js +111 -0
  561. package/dist/esm/nodes/constants.js.map +1 -0
  562. package/dist/esm/nodes/index.d.ts +8 -0
  563. package/dist/esm/nodes/index.d.ts.map +1 -0
  564. package/dist/esm/nodes/index.js +11 -0
  565. package/dist/esm/nodes/index.js.map +1 -0
  566. package/dist/esm/nodes/schemas.d.ts +510 -0
  567. package/dist/esm/nodes/schemas.d.ts.map +1 -0
  568. package/dist/esm/nodes/schemas.js +1082 -0
  569. package/dist/esm/nodes/schemas.js.map +1 -0
  570. package/dist/esm/nodes/settings-schemas.d.ts +82 -0
  571. package/dist/esm/nodes/settings-schemas.d.ts.map +1 -0
  572. package/dist/esm/nodes/settings-schemas.js +103 -0
  573. package/dist/esm/nodes/settings-schemas.js.map +1 -0
  574. package/dist/esm/notifications/constants.d.ts +243 -0
  575. package/dist/esm/notifications/constants.d.ts.map +1 -0
  576. package/dist/esm/notifications/constants.js +206 -0
  577. package/dist/esm/notifications/constants.js.map +1 -0
  578. package/dist/esm/notifications/index.d.ts +5 -0
  579. package/dist/esm/notifications/index.d.ts.map +1 -0
  580. package/dist/esm/notifications/index.js +9 -0
  581. package/dist/esm/notifications/index.js.map +1 -0
  582. package/dist/esm/notifications/schemas.d.ts +1094 -0
  583. package/dist/esm/notifications/schemas.d.ts.map +1 -0
  584. package/dist/esm/notifications/schemas.js +911 -0
  585. package/dist/esm/notifications/schemas.js.map +1 -0
  586. package/dist/esm/onboarding/constants.d.ts +138 -0
  587. package/dist/esm/onboarding/constants.d.ts.map +1 -0
  588. package/dist/esm/onboarding/constants.js +120 -0
  589. package/dist/esm/onboarding/constants.js.map +1 -0
  590. package/dist/esm/onboarding/index.d.ts +5 -0
  591. package/dist/esm/onboarding/index.d.ts.map +1 -0
  592. package/dist/esm/onboarding/index.js +7 -0
  593. package/dist/esm/onboarding/index.js.map +1 -0
  594. package/dist/esm/onboarding/schemas.d.ts +360 -0
  595. package/dist/esm/onboarding/schemas.d.ts.map +1 -0
  596. package/dist/esm/onboarding/schemas.js +257 -0
  597. package/dist/esm/onboarding/schemas.js.map +1 -0
  598. package/dist/esm/settings/constants.d.ts +206 -0
  599. package/dist/esm/settings/constants.d.ts.map +1 -0
  600. package/dist/esm/settings/constants.js +197 -0
  601. package/dist/esm/settings/constants.js.map +1 -0
  602. package/dist/esm/settings/index.d.ts +6 -0
  603. package/dist/esm/settings/index.d.ts.map +1 -0
  604. package/dist/esm/settings/index.js +11 -0
  605. package/dist/esm/settings/index.js.map +1 -0
  606. package/dist/esm/settings/schemas.d.ts +610 -0
  607. package/dist/esm/settings/schemas.d.ts.map +1 -0
  608. package/dist/esm/settings/schemas.js +493 -0
  609. package/dist/esm/settings/schemas.js.map +1 -0
  610. package/dist/esm/settings/types.d.ts +81 -0
  611. package/dist/esm/settings/types.d.ts.map +1 -0
  612. package/dist/esm/settings/types.js +5 -0
  613. package/dist/esm/settings/types.js.map +1 -0
  614. package/dist/esm/sharing/constants.d.ts +232 -0
  615. package/dist/esm/sharing/constants.d.ts.map +1 -0
  616. package/dist/esm/sharing/constants.js +175 -0
  617. package/dist/esm/sharing/constants.js.map +1 -0
  618. package/dist/esm/sharing/enum.d.ts +5 -0
  619. package/dist/esm/sharing/enum.d.ts.map +1 -0
  620. package/dist/esm/sharing/enum.js +6 -0
  621. package/dist/esm/sharing/enum.js.map +1 -0
  622. package/dist/esm/sharing/grants.d.ts +518 -0
  623. package/dist/esm/sharing/grants.d.ts.map +1 -0
  624. package/dist/esm/sharing/grants.js +481 -0
  625. package/dist/esm/sharing/grants.js.map +1 -0
  626. package/dist/esm/sharing/groups.d.ts +410 -0
  627. package/dist/esm/sharing/groups.d.ts.map +1 -0
  628. package/dist/esm/sharing/groups.js +372 -0
  629. package/dist/esm/sharing/groups.js.map +1 -0
  630. package/dist/esm/sharing/index.d.ts +5 -0
  631. package/dist/esm/sharing/index.d.ts.map +1 -0
  632. package/dist/esm/sharing/index.js +11 -0
  633. package/dist/esm/sharing/index.js.map +1 -0
  634. package/dist/esm/sharing/schemas.d.ts +3 -0
  635. package/dist/esm/sharing/schemas.d.ts.map +1 -0
  636. package/dist/esm/sharing/schemas.js +5 -0
  637. package/dist/esm/sharing/schemas.js.map +1 -0
  638. package/dist/esm/storage/constants.d.ts +142 -0
  639. package/dist/esm/storage/constants.d.ts.map +1 -0
  640. package/dist/esm/storage/constants.js +123 -0
  641. package/dist/esm/storage/constants.js.map +1 -0
  642. package/dist/esm/storage/index.d.ts +29 -0
  643. package/dist/esm/storage/index.d.ts.map +1 -0
  644. package/dist/esm/storage/index.js +25 -0
  645. package/dist/esm/storage/index.js.map +1 -0
  646. package/dist/esm/storage/objects-complete-upload.d.ts +19 -0
  647. package/dist/esm/storage/objects-complete-upload.d.ts.map +1 -0
  648. package/dist/esm/storage/objects-complete-upload.js +16 -0
  649. package/dist/esm/storage/objects-complete-upload.js.map +1 -0
  650. package/dist/esm/storage/objects-download-url.d.ts +17 -0
  651. package/dist/esm/storage/objects-download-url.d.ts.map +1 -0
  652. package/dist/esm/storage/objects-download-url.js +13 -0
  653. package/dist/esm/storage/objects-download-url.js.map +1 -0
  654. package/dist/esm/storage/objects-init-upload.d.ts +152 -0
  655. package/dist/esm/storage/objects-init-upload.d.ts.map +1 -0
  656. package/dist/esm/storage/objects-init-upload.js +126 -0
  657. package/dist/esm/storage/objects-init-upload.js.map +1 -0
  658. package/dist/esm/storage/objects-list-query.d.ts +50 -0
  659. package/dist/esm/storage/objects-list-query.d.ts.map +1 -0
  660. package/dist/esm/storage/objects-list-query.js +20 -0
  661. package/dist/esm/storage/objects-list-query.js.map +1 -0
  662. package/dist/esm/storage/objects-object-response.d.ts +49 -0
  663. package/dist/esm/storage/objects-object-response.d.ts.map +1 -0
  664. package/dist/esm/storage/objects-object-response.js +51 -0
  665. package/dist/esm/storage/objects-object-response.js.map +1 -0
  666. package/dist/esm/storage/objects-update-metadata.d.ts +16 -0
  667. package/dist/esm/storage/objects-update-metadata.d.ts.map +1 -0
  668. package/dist/esm/storage/objects-update-metadata.js +11 -0
  669. package/dist/esm/storage/objects-update-metadata.js.map +1 -0
  670. package/dist/esm/storage/schemas.d.ts +14 -0
  671. package/dist/esm/storage/schemas.d.ts.map +1 -0
  672. package/dist/esm/storage/schemas.js +20 -0
  673. package/dist/esm/storage/schemas.js.map +1 -0
  674. package/dist/esm/storage/settings-schemas.d.ts +188 -0
  675. package/dist/esm/storage/settings-schemas.d.ts.map +1 -0
  676. package/dist/esm/storage/settings-schemas.js +220 -0
  677. package/dist/esm/storage/settings-schemas.js.map +1 -0
  678. package/dist/esm/storage/storage-bucket-provision.d.ts +152 -0
  679. package/dist/esm/storage/storage-bucket-provision.d.ts.map +1 -0
  680. package/dist/esm/storage/storage-bucket-provision.js +213 -0
  681. package/dist/esm/storage/storage-bucket-provision.js.map +1 -0
  682. package/dist/esm/storage/storage-config-response.d.ts +105 -0
  683. package/dist/esm/storage/storage-config-response.d.ts.map +1 -0
  684. package/dist/esm/storage/storage-config-response.js +178 -0
  685. package/dist/esm/storage/storage-config-response.js.map +1 -0
  686. package/dist/esm/storage/storage-config-update.d.ts +46 -0
  687. package/dist/esm/storage/storage-config-update.d.ts.map +1 -0
  688. package/dist/esm/storage/storage-config-update.js +130 -0
  689. package/dist/esm/storage/storage-config-update.js.map +1 -0
  690. package/dist/esm/storage/storage-connection-test.d.ts +129 -0
  691. package/dist/esm/storage/storage-connection-test.d.ts.map +1 -0
  692. package/dist/esm/storage/storage-connection-test.js +241 -0
  693. package/dist/esm/storage/storage-connection-test.js.map +1 -0
  694. package/dist/esm/storage/storage-migration.d.ts +102 -0
  695. package/dist/esm/storage/storage-migration.d.ts.map +1 -0
  696. package/dist/esm/storage/storage-migration.js +104 -0
  697. package/dist/esm/storage/storage-migration.js.map +1 -0
  698. package/dist/esm/storage/storage-status.d.ts +16 -0
  699. package/dist/esm/storage/storage-status.d.ts.map +1 -0
  700. package/dist/esm/storage/storage-status.js +20 -0
  701. package/dist/esm/storage/storage-status.js.map +1 -0
  702. package/dist/esm/telemetry/config.d.ts +4 -0
  703. package/dist/esm/telemetry/config.d.ts.map +1 -1
  704. package/dist/esm/telemetry/config.js +16 -2
  705. package/dist/esm/telemetry/config.js.map +1 -1
  706. package/dist/esm/telemetry/connection.d.ts +1 -1
  707. package/dist/esm/telemetry/constants.d.ts +378 -6
  708. package/dist/esm/telemetry/constants.d.ts.map +1 -1
  709. package/dist/esm/telemetry/constants.js +294 -4
  710. package/dist/esm/telemetry/constants.js.map +1 -1
  711. package/dist/esm/telemetry/dashboard.d.ts +188 -17
  712. package/dist/esm/telemetry/dashboard.d.ts.map +1 -1
  713. package/dist/esm/telemetry/dashboard.js +61 -3
  714. package/dist/esm/telemetry/dashboard.js.map +1 -1
  715. package/dist/esm/telemetry/index.d.ts +4 -4
  716. package/dist/esm/telemetry/index.d.ts.map +1 -1
  717. package/dist/esm/telemetry/index.js +2 -2
  718. package/dist/esm/telemetry/index.js.map +1 -1
  719. package/dist/esm/telemetry/presentation.d.ts +243 -0
  720. package/dist/esm/telemetry/presentation.d.ts.map +1 -0
  721. package/dist/esm/telemetry/presentation.js +297 -0
  722. package/dist/esm/telemetry/presentation.js.map +1 -0
  723. package/dist/esm/telemetry/query.d.ts +2 -2
  724. package/dist/esm/telemetry/schemas.d.ts +5 -2
  725. package/dist/esm/telemetry/schemas.d.ts.map +1 -1
  726. package/dist/esm/telemetry/schemas.js +3 -1
  727. package/dist/esm/telemetry/schemas.js.map +1 -1
  728. package/dist/esm/telemetry/stack.d.ts +5 -5
  729. package/dist/esm/telemetry/store.d.ts +111 -0
  730. package/dist/esm/telemetry/store.d.ts.map +1 -0
  731. package/dist/esm/telemetry/store.js +80 -0
  732. package/dist/esm/telemetry/store.js.map +1 -0
  733. package/dist/esm/timezone/constants.d.ts +16 -0
  734. package/dist/esm/timezone/constants.d.ts.map +1 -0
  735. package/dist/esm/timezone/constants.js +16 -0
  736. package/dist/esm/timezone/constants.js.map +1 -0
  737. package/dist/esm/timezone/index.d.ts +15 -0
  738. package/dist/esm/timezone/index.d.ts.map +1 -0
  739. package/dist/esm/timezone/index.js +15 -0
  740. package/dist/esm/timezone/index.js.map +1 -0
  741. package/dist/esm/timezone/schemas.d.ts +111 -0
  742. package/dist/esm/timezone/schemas.d.ts.map +1 -0
  743. package/dist/esm/timezone/schemas.js +185 -0
  744. package/dist/esm/timezone/schemas.js.map +1 -0
  745. package/dist/esm/user-data/constants.d.ts +157 -0
  746. package/dist/esm/user-data/constants.d.ts.map +1 -0
  747. package/dist/esm/user-data/constants.js +134 -0
  748. package/dist/esm/user-data/constants.js.map +1 -0
  749. package/dist/esm/user-data/index.d.ts +5 -0
  750. package/dist/esm/user-data/index.d.ts.map +1 -0
  751. package/dist/esm/user-data/index.js +7 -0
  752. package/dist/esm/user-data/index.js.map +1 -0
  753. package/dist/esm/user-data/schemas.d.ts +306 -0
  754. package/dist/esm/user-data/schemas.d.ts.map +1 -0
  755. package/dist/esm/user-data/schemas.js +330 -0
  756. package/dist/esm/user-data/schemas.js.map +1 -0
  757. package/dist/esm/webhooks/constants.d.ts +154 -0
  758. package/dist/esm/webhooks/constants.d.ts.map +1 -0
  759. package/dist/esm/webhooks/constants.js +133 -0
  760. package/dist/esm/webhooks/constants.js.map +1 -0
  761. package/dist/esm/webhooks/enum.d.ts +5 -0
  762. package/dist/esm/webhooks/enum.d.ts.map +1 -0
  763. package/dist/esm/webhooks/enum.js +6 -0
  764. package/dist/esm/webhooks/enum.js.map +1 -0
  765. package/dist/esm/webhooks/index.d.ts +7 -0
  766. package/dist/esm/webhooks/index.d.ts.map +1 -0
  767. package/dist/esm/webhooks/index.js +8 -0
  768. package/dist/esm/webhooks/index.js.map +1 -0
  769. package/dist/esm/webhooks/schemas.d.ts +288 -0
  770. package/dist/esm/webhooks/schemas.d.ts.map +1 -0
  771. package/dist/esm/webhooks/schemas.js +292 -0
  772. package/dist/esm/webhooks/schemas.js.map +1 -0
  773. package/dist/esm/webhooks/signature.d.ts +54 -0
  774. package/dist/esm/webhooks/signature.d.ts.map +1 -0
  775. package/dist/esm/webhooks/signature.js +93 -0
  776. package/dist/esm/webhooks/signature.js.map +1 -0
  777. package/package.json +181 -1
@@ -0,0 +1,1082 @@
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_EVENT_SEVERITIES, NODE_POWER_SOURCES, 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
+ /** Ceiling on a battery time estimate: 7 days. */
331
+ const MAX_POWER_TIME_REMAINING_SECONDS = 7 * 24 * 60 * 60;
332
+ /**
333
+ * A finite, non-negative number no larger than `max`. (Zod 4's `z.number()`
334
+ * already refuses `NaN` and `Infinity`; JSON cannot carry them anyway.)
335
+ */
336
+ const boundedNumber = (max) => z.number().nonnegative().max(max);
337
+ /**
338
+ * A non-negative integer no larger than `max`. `.int()` comes FIRST: Zod 4's
339
+ * integer check carries its own safe-integer range, and applied after `.max()`
340
+ * it is that range, not ours, that reaches the generated OpenAPI schema.
341
+ */
342
+ const boundedInt = (max) => z.number().int().nonnegative().max(max);
343
+ /** A non-negative integer counter since the node process started. */
344
+ const vitalsCounter = boundedInt(MAX_VITALS_COUNTER);
345
+ /** A short, version-shaped string: letters, digits, spaces and `. + - _ ( ) ~`. */
346
+ const vitalsVersion = z
347
+ .string()
348
+ .trim()
349
+ .min(1)
350
+ .max(MAX_VITALS_VERSION_LENGTH)
351
+ .regex(/^[0-9A-Za-z .+\-_()~]+$/, 'Must be a version string');
352
+ /**
353
+ * Cumulative counters since the node process started; reset on restart.
354
+ *
355
+ * @stability experimental
356
+ */
357
+ export const nodeVitalsCountersSchema = z
358
+ .object({
359
+ /** Claim calls that returned at least one job. */
360
+ claims: vitalsCounter.optional(),
361
+ /** Claim calls that returned none. */
362
+ emptyPolls: vitalsCounter.optional(),
363
+ /** Claim calls that failed. */
364
+ claimFailures: vitalsCounter.optional(),
365
+ /** Jobs this process completed. */
366
+ succeeded: vitalsCounter.optional(),
367
+ /** Jobs this process reported failed. */
368
+ failed: vitalsCounter.optional(),
369
+ /** Jobs this process reported rate-limited. */
370
+ rateLimited: vitalsCounter.optional(),
371
+ /** Lease renewals that succeeded. */
372
+ leaseRenewals: vitalsCounter.optional(),
373
+ /** Lease renewals that failed. */
374
+ leaseRenewFailures: vitalsCounter.optional(),
375
+ /** Heartbeats that failed. */
376
+ heartbeatFailures: vitalsCounter.optional(),
377
+ /** Times the job watchdog killed a stuck job. */
378
+ watchdogTrips: vitalsCounter.optional(),
379
+ })
380
+ .strict();
381
+ /**
382
+ * App-defined numeric vitals: a bounded bag of `key -> number` an executor or
383
+ * the node's app reports beyond the closed fields (a transcoder's frames per
384
+ * second, a GPU's temperature). Still CLOSED IN SHAPE: at most
385
+ * {@link MAX_NODE_VITALS_EXTRA_KEYS} keys, each key matching
386
+ * {@link NODE_VITALS_EXTRA_KEY_PATTERN}, each value a finite number within
387
+ * +/-{@link MAX_NODE_VITALS_EXTRA_VALUE}. No strings, no nesting, so it stays
388
+ * the unbounded-JSONB-write-free surface the closed fields are. The CLI drops
389
+ * what would not pass before sending (a heartbeat the server refuses costs the
390
+ * node its liveness signal), and the fleet page labels a key through
391
+ * `registerNodeVital`.
392
+ *
393
+ * @stability experimental
394
+ */
395
+ export const nodeVitalsExtraSchema = z
396
+ .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))
397
+ .refine((extra) => Object.keys(extra).length <= MAX_NODE_VITALS_EXTRA_KEYS, {
398
+ message: `At most ${MAX_NODE_VITALS_EXTRA_KEYS} extra vitals`,
399
+ });
400
+ /**
401
+ * Machine-level (host) readings, sent only to a server that advertised
402
+ * {@link NODE_SERVER_CAPABILITY_HOST_VITALS}. Every field optional, closed and
403
+ * bounded; `cpuPercent` here is SYSTEM-wide (0..100), unlike the process-level
404
+ * `cpuPercent` on the vitals object.
405
+ *
406
+ * @stability experimental
407
+ */
408
+ export const nodeHostVitalsSchema = z
409
+ .object({
410
+ /** System-wide CPU utilisation over the last interval, 0..100. */
411
+ cpuPercent: z.number().min(0).max(100).optional(),
412
+ /** Logical CPU count. */
413
+ cpuCount: z.number().int().min(1).max(4096).optional(),
414
+ /** 1-minute load average. */
415
+ loadAvg1: z.number().min(0).max(10_000).optional(),
416
+ /** 5-minute load average. */
417
+ loadAvg5: z.number().min(0).max(10_000).optional(),
418
+ /** 15-minute load average. */
419
+ loadAvg15: z.number().min(0).max(10_000).optional(),
420
+ /** Total physical memory, in bytes. */
421
+ memTotalBytes: boundedInt(MAX_VITALS_MEMORY_BYTES).optional(),
422
+ /** Free physical memory, in bytes. */
423
+ memFreeBytes: boundedInt(MAX_VITALS_MEMORY_BYTES).optional(),
424
+ /** Memory available to new work (reclaimable included), in bytes. */
425
+ memAvailableBytes: boundedInt(MAX_VITALS_MEMORY_BYTES).optional(),
426
+ /** The OS release string. */
427
+ osRelease: z.string().max(128).optional(),
428
+ /** The CPU architecture (`x64`, `arm64`). */
429
+ arch: z.string().max(32).optional(),
430
+ /** Seconds since the machine booted. */
431
+ uptimeSeconds: boundedNumber(MAX_VITALS_UPTIME_SECONDS).optional(),
432
+ })
433
+ .strict();
434
+ /**
435
+ * Power state of the machine the node runs on.
436
+ *
437
+ * @stability experimental
438
+ */
439
+ export const nodePowerSchema = z
440
+ .object({
441
+ /** Where power comes from. */
442
+ source: z.enum(NODE_POWER_SOURCES),
443
+ /** Battery charge, 0..100. */
444
+ batteryPercent: z.number().min(0).max(100).optional(),
445
+ /** Whether the battery is charging. */
446
+ charging: z.boolean().optional(),
447
+ /** Estimated seconds of battery left (at most 7 days). */
448
+ timeRemainingSeconds: z.number().int().min(0).max(MAX_POWER_TIME_REMAINING_SECONDS).optional(),
449
+ /** Whether the OS low-power / battery-saver mode is on. */
450
+ lowPowerMode: z.boolean().optional(),
451
+ })
452
+ .strict();
453
+ /**
454
+ * A node's health snapshot, carried on its heartbeat; closed and bounded.
455
+ *
456
+ * @stability experimental
457
+ */
458
+ export const nodeVitalsSchema = z
459
+ .object({
460
+ /** Process CPU over the last interval; 100 = one full core. */
461
+ cpuPercent: boundedNumber(MAX_VITALS_CPU_PERCENT).optional(),
462
+ /** Resident set size of the node process, in bytes. */
463
+ rssBytes: boundedInt(MAX_VITALS_MEMORY_BYTES).optional(),
464
+ /** V8 heap in use, in bytes. */
465
+ heapUsedBytes: boundedInt(MAX_VITALS_MEMORY_BYTES).optional(),
466
+ /** V8 heap limit, in bytes. */
467
+ heapLimitBytes: boundedInt(MAX_VITALS_MEMORY_BYTES).optional(),
468
+ /** p99 event-loop delay over the last interval, in milliseconds. */
469
+ eventLoopDelayP99Ms: boundedNumber(MAX_VITALS_EVENT_LOOP_DELAY_MS).optional(),
470
+ /** Free/total bytes on the filesystem holding the node's state directory. */
471
+ stateDirFreeBytes: boundedNumber(MAX_VITALS_DISK_BYTES).optional(),
472
+ /** Total bytes of that filesystem. */
473
+ stateDirTotalBytes: boundedNumber(MAX_VITALS_DISK_BYTES).optional(),
474
+ /** Job slots in use / available. Bounded by the same ceiling as `concurrency`. */
475
+ slotsUsed: boundedInt(MAX_NODE_CONCURRENCY).optional(),
476
+ /** Job slots available. */
477
+ slotsTotal: boundedInt(MAX_NODE_CONCURRENCY).optional(),
478
+ /** Seconds since the node process started. */
479
+ uptimeSeconds: boundedNumber(MAX_VITALS_UPTIME_SECONDS).optional(),
480
+ /** Cumulative counters since the process started. */
481
+ counters: nodeVitalsCountersSchema.optional(),
482
+ /** The node CLI's version. */
483
+ cliVersion: vitalsVersion.optional(),
484
+ /** The Node.js runtime version. */
485
+ nodeVersion: vitalsVersion.optional(),
486
+ /** The `pg_dump` version banner, when the node has one. */
487
+ pgDumpVersion: vitalsVersion.optional(),
488
+ /** App-defined numeric vitals; see {@link nodeVitalsExtraSchema}. */
489
+ extra: nodeVitalsExtraSchema.optional(),
490
+ /** Machine-level readings (server feature `node_host_vitals`). */
491
+ host: nodeHostVitalsSchema.optional(),
492
+ /** Power / battery state (server feature `node_host_vitals`). */
493
+ power: nodePowerSchema.optional(),
494
+ })
495
+ .strict();
496
+ // =============================================================================
497
+ // Node events (heartbeat `events`)
498
+ // =============================================================================
499
+ /**
500
+ * Event types the platform's CLI emits. The `type` field itself stays an OPEN
501
+ * dotted string (an app's node may report its own); these are only the names
502
+ * the platform knows how to label.
503
+ *
504
+ * @stability experimental
505
+ */
506
+ export const NODE_EVENT_TYPES = {
507
+ /** The machine switched between AC and battery. */
508
+ POWER_SOURCE_CHANGED: 'power.source_changed',
509
+ /** The battery fell to the low threshold while on battery. */
510
+ BATTERY_LOW: 'power.battery_low',
511
+ /** The battery fell to the critical threshold while on battery. */
512
+ BATTERY_CRITICAL: 'power.battery_critical',
513
+ /** The battery recovered above the low threshold (or AC returned). */
514
+ BATTERY_RECOVERED: 'power.battery_recovered',
515
+ /** The machine woke from sleep. */
516
+ SLEEP_RESUMED: 'node.sleep_resumed',
517
+ /** The free space of the state directory fell below the threshold. */
518
+ DISK_LOW: 'node.disk_low',
519
+ };
520
+ /**
521
+ * Most events one heartbeat may carry.
522
+ *
523
+ * @stability experimental
524
+ */
525
+ export const MAX_NODE_EVENTS_PER_HEARTBEAT = 50;
526
+ /**
527
+ * Most attribute keys on one event.
528
+ *
529
+ * @stability experimental
530
+ */
531
+ export const MAX_NODE_EVENT_ATTRS = 16;
532
+ /**
533
+ * One event a node observed about itself (power change, low battery, wake from
534
+ * sleep). `at` is the node's clock and is display-only; the server stamps its
535
+ * own `receivedAt`.
536
+ *
537
+ * @stability experimental
538
+ */
539
+ export const nodeEventSchema = z
540
+ .object({
541
+ /** A dotted lower-case type, e.g. `power.battery_low`. Open, not an enum. */
542
+ type: z
543
+ .string()
544
+ .max(64)
545
+ .regex(/^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$/, 'Must be a dotted event type'),
546
+ /** How loud it is. */
547
+ severity: z.enum(NODE_EVENT_SEVERITIES),
548
+ /** When it happened, on the node's clock (ISO 8601). */
549
+ at: z.iso.datetime({ offset: true }),
550
+ /** Small scalar attributes. */
551
+ attrs: z
552
+ .record(z.string().max(64), z.union([z.string().max(256), z.number(), z.boolean()]))
553
+ .refine((attrs) => Object.keys(attrs).length <= MAX_NODE_EVENT_ATTRS, {
554
+ message: `At most ${MAX_NODE_EVENT_ATTRS} attributes`,
555
+ })
556
+ .optional(),
557
+ })
558
+ .strict();
559
+ // =============================================================================
560
+ // POST /nodes/register
561
+ // =============================================================================
562
+ /**
563
+ * The body of `POST /api/nodes/register`.
564
+ *
565
+ * @stability experimental
566
+ */
567
+ export const registerNodeSchema = z.object({
568
+ /**
569
+ * THE IDENTITY HALF OF `@@unique([createdById, name])`. Two registrations
570
+ * with the same name from the same owner are the SAME node — see
571
+ * `NodesService.register`. This is why a node's name belongs in its config
572
+ * file rather than being generated at startup: a generated name makes every
573
+ * container restart a new node row.
574
+ */
575
+ name: z.string().trim().min(1, 'Name is required').max(MAX_NODE_CREDENTIAL_NAME_LENGTH, 'Name must be 100 characters or less'),
576
+ /** The machine's hostname, as the node reports it. */
577
+ hostname: z.string().trim().min(1).max(255),
578
+ /** The OS and architecture (`linux-x64`). */
579
+ platform: z.string().trim().min(1).max(100),
580
+ /** The node CLI's version. */
581
+ cliVersion: z.string().trim().min(1).max(50),
582
+ /**
583
+ * The job types this node can run. An EMPTY LIST IS LEGAL and means "I can
584
+ * run nothing yet" — a node that registers before its handlers are
585
+ * configured is a real state, and refusing it would push the operator
586
+ * toward declaring a type the node cannot actually execute.
587
+ */
588
+ eligibleTypes: z.array(jobType).max(MAX_NODE_ELIGIBLE_TYPES).default([]),
589
+ /** How many jobs the node runs at once, 1 to `MAX_NODE_CONCURRENCY`. */
590
+ concurrency: z
591
+ .number()
592
+ .int('Concurrency must be a whole number')
593
+ .min(1, 'Concurrency must be at least 1')
594
+ .max(MAX_NODE_CONCURRENCY, `Concurrency must be at most ${MAX_NODE_CONCURRENCY}`),
595
+ /** The node's self-reported capability bag (open JSON, shown on the fleet page). */
596
+ capabilities: capabilities.optional(),
597
+ });
598
+ /**
599
+ * The server features a register response may advertise in `serverFeatures`.
600
+ * A node sends an optional capability only when the server named it; an older
601
+ * server sends no list at all.
602
+ *
603
+ * @stability experimental
604
+ */
605
+ export const NODE_SERVER_CAPABILITY_HOST_VITALS = 'node_host_vitals';
606
+ /**
607
+ * The register response's feature advertisement. The rest of the response
608
+ * (`node`, `reattached`) is the API's DTO; this schema names only the field the
609
+ * contract owns, so it is `.passthrough()`.
610
+ *
611
+ * @stability experimental
612
+ */
613
+ export const registerNodeResponseSchema = z
614
+ .object({
615
+ /** Optional server features (see {@link NODE_SERVER_CAPABILITY_HOST_VITALS}). */
616
+ serverFeatures: z.array(z.string().max(64)).max(32).optional(),
617
+ })
618
+ .passthrough();
619
+ // =============================================================================
620
+ // POST /nodes/:id/heartbeat
621
+ // =============================================================================
622
+ /**
623
+ * The body of `POST /api/nodes/:id/heartbeat`.
624
+ *
625
+ * @stability experimental
626
+ */
627
+ export const heartbeatNodeSchema = z.object({
628
+ /**
629
+ * The two states a node may report ABOUT ITSELF. `draining` and `disabled`
630
+ * are absent on purpose — see the file header.
631
+ */
632
+ status: z.enum(['online', 'offline']).optional(),
633
+ /**
634
+ * A runtime concurrency change (`appctl node set-concurrency`), which the
635
+ * NEXT claim reads live off the row. This is the whole reason the claim
636
+ * endpoint re-reads the node rather than trusting a value captured at
637
+ * registration.
638
+ */
639
+ concurrency: z.number().int().min(1).max(MAX_NODE_CONCURRENCY).optional(),
640
+ /** A replacement capability bag, when it changed. */
641
+ capabilities: capabilities.optional(),
642
+ /**
643
+ * A health snapshot (#604), stored as `lastVitals` with a server-stamped
644
+ * `lastVitalsAt`. OMITTED leaves the stored snapshot untouched, which is
645
+ * what every node that predates vitals sends. See "Vitals" above.
646
+ */
647
+ vitals: nodeVitalsSchema.optional(),
648
+ /**
649
+ * Events observed since the last heartbeat (power, sleep, disk). Sent only
650
+ * when the server advertised `node_host_vitals` at registration.
651
+ */
652
+ events: z.array(nodeEventSchema).max(MAX_NODE_EVENTS_PER_HEARTBEAT).optional(),
653
+ });
654
+ // =============================================================================
655
+ // POST /nodes/:id/claim
656
+ // =============================================================================
657
+ /**
658
+ * The body of `POST /api/nodes/:id/claim`.
659
+ *
660
+ * @stability experimental
661
+ */
662
+ export const claimJobsSchema = z.object({
663
+ /**
664
+ * Which of the node's own types it wants right now — a node with free
665
+ * slots for one type and none for another. OMITTED means "anything I
666
+ * declared", which is the common case.
667
+ *
668
+ * NARROWING ONLY. `NodesService.claimJobs` intersects this with the row's
669
+ * `eligibleTypes`; a type here that the node never registered is dropped,
670
+ * not honoured.
671
+ */
672
+ types: z.array(jobType).max(MAX_NODE_ELIGIBLE_TYPES).optional(),
673
+ /**
674
+ * How many rows to take. CLAMPED DOWN to the node's declared
675
+ * `concurrency`; a larger number is not an error, it is simply capped —
676
+ * a node asking for more than it declared is describing free slots it does
677
+ * not have, and refusing the whole call would stall a fleet over an
678
+ * arithmetic disagreement.
679
+ */
680
+ limit: z.number().int().min(1).max(MAX_NODE_CONCURRENCY).optional(),
681
+ });
682
+ // =============================================================================
683
+ // POST /nodes/:id/jobs/:jobId/renew
684
+ // =============================================================================
685
+ /**
686
+ * ⚠ THIS BODY EXISTS TO CARRY ONE OPTIONAL FIELD, AND IT MUST SURVIVE HAVING
687
+ * NO BODY AT ALL (#364).
688
+ *
689
+ * Until this change the renew route took no body, so every node in every fleet
690
+ * posts to it with no payload and no `Content-Type` — Fastify hands Nest
691
+ * `undefined`, and a bare `z.object({...})` would reject that outright and
692
+ * fail every renewal from every node that has not been upgraded yet. `.default({})`
693
+ * is what makes "no body" parse to "no assertion", which is the pre-#364
694
+ * behaviour spelled as data. It is the only reason this is a `ZodDefault` and
695
+ * not a plain object schema; do not unwrap it.
696
+ *
697
+ * REJECTED: coercing a `null` body to `{}` as well. That would quietly turn
698
+ * "I assert this row has no token" into "I assert nothing", and those are
699
+ * different statements at the `where` clause (see `claimToken` above).
700
+ *
701
+ * @stability experimental
702
+ */
703
+ export const renewLeaseSchema = z
704
+ .object({
705
+ /** Which claim of the job is asking (`claimTokenField`). */
706
+ claimToken: claimToken.optional(),
707
+ })
708
+ .default({});
709
+ // =============================================================================
710
+ // POST /nodes/:id/jobs/:jobId/result
711
+ // =============================================================================
712
+ /**
713
+ * The body of `POST /api/nodes/:id/jobs/:jobId/result`.
714
+ *
715
+ * @stability experimental
716
+ */
717
+ export const nodeJobResultSchema = z.object({
718
+ /**
719
+ * The job type this result is FOR, checked against the row's own `type`
720
+ * before anything is parsed or persisted.
721
+ *
722
+ * It is redundant with the row — which is the point. A node holding two
723
+ * jobs at once and crossing their ids would otherwise post job A's result
724
+ * against job B, and the only thing standing between that and a persisted,
725
+ * plausible, permanently wrong row would be whether B's schema happened to
726
+ * reject A's payload. Two IDs agreeing is a coincidence; an id and a type
727
+ * agreeing is a statement.
728
+ */
729
+ type: jobType,
730
+ /**
731
+ * The computed result, UNVALIDATED at this layer on purpose.
732
+ *
733
+ * The real validation is `handler.nodeResultSchema`, resolved per job type
734
+ * at runtime and applied manually in `NodesService.submitResult` — the
735
+ * global Zod pipe cannot do it, because which schema applies is not known
736
+ * until the job row has been read. Typing it `unknown` here rather than
737
+ * `Record<string, unknown>` also keeps a handler free to accept a bare
738
+ * array or scalar result if that is what its work produces.
739
+ */
740
+ result: z.unknown(),
741
+ /**
742
+ * WHICH CLAIM computed this result — see `claimToken` above.
743
+ *
744
+ * It matters MORE here than on renew, not less: a stale slot's renewal only
745
+ * delays the reaper, while a stale slot's RESULT settles a job its own later
746
+ * claim is still running, persisting output computed against an earlier
747
+ * attempt over a newer run. Optional for the same rolling-upgrade reason.
748
+ */
749
+ claimToken: claimToken.optional(),
750
+ });
751
+ // =============================================================================
752
+ // POST /nodes/:id/jobs/:jobId/failure
753
+ // =============================================================================
754
+ /**
755
+ * The body of `POST /api/nodes/:id/jobs/:jobId/failure`.
756
+ *
757
+ * @stability experimental
758
+ */
759
+ export const nodeJobFailureSchema = z.object({
760
+ /** What went wrong, in the words that will appear in `Job.lastError`. */
761
+ error: z.string().trim().min(1, 'An error message is required').max(MAX_ERROR_LENGTH),
762
+ /**
763
+ * "A provider throttled me." Treated IDENTICALLY to a `RateLimitError`
764
+ * thrown by an in-process handler — see `job-terminal.service.ts`'s header
765
+ * on why a flag and a throw must reach the same conclusion.
766
+ */
767
+ rateLimited: z.boolean().optional(),
768
+ /** A provider-requested delay in milliseconds; a FLOOR on the backoff, not an override. */
769
+ retryAfterMs: z
770
+ .number()
771
+ .int()
772
+ .min(0)
773
+ // One day. Past this, a "retry after" is a bug in whatever produced it,
774
+ // and honouring it would park a job for longer than most deployments
775
+ // keep their history.
776
+ .max(86_400_000)
777
+ .optional(),
778
+ /**
779
+ * ADVISORY ONLY, and accepted only so a node can say what it believes.
780
+ * The server's attempt budget decides; see the file header.
781
+ */
782
+ willRetry: z.boolean().optional(),
783
+ /**
784
+ * WHICH CLAIM failed — see `claimToken` above.
785
+ *
786
+ * Threaded here as well as on `result` because a failure is just as terminal:
787
+ * an old slot reporting "boom" settles the row (or charges an attempt against
788
+ * it) while a newer claim of the same job is still running fine. Optional for
789
+ * the same rolling-upgrade reason.
790
+ */
791
+ claimToken: claimToken.optional(),
792
+ });
793
+ // -----------------------------------------------------------------------------
794
+ // From node-data-plane.dto.ts: The data plane's request and response bodies (issue #269, epic #254)
795
+ // -----------------------------------------------------------------------------
796
+ // =============================================================================
797
+ // The data plane's request and response bodies (issue #269, epic #254)
798
+ // =============================================================================
799
+ //
800
+ // #268 gave a node a CONTROL plane: claim a job, renew its lease, report an
801
+ // outcome. What it could not do was read a single byte or write one, because
802
+ // a node holds no storage credentials — by design, and permanently. These
803
+ // bodies are the whole of the answer.
804
+ //
805
+ // -----------------------------------------------------------------------------
806
+ // THE SHAPE OF THE SOLUTION, AND THE TWO ALTERNATIVES IT BEATS
807
+ // -----------------------------------------------------------------------------
808
+ //
809
+ // The server mints a SHORT-LIVED, SINGLE-OBJECT signed URL and the node talks
810
+ // to the storage provider directly. Bytes never pass through the API.
811
+ //
812
+ // REJECTED: PROXYING BYTES THROUGH THE API (`GET /nodes/:id/jobs/:jobId/input`
813
+ // streaming the object, `POST …/output` accepting it). It is the smallest
814
+ // diff and it is the worst outcome. Every byte of every job would cross the
815
+ // API process twice — once in, once out — so the API's memory, its event loop
816
+ // and its egress bill become a function of how much work the FLEET is doing,
817
+ // which is the exact coupling a worker node exists to remove. A ten-node fleet
818
+ // hashing 1 GB objects would saturate the API before it saturated anything
819
+ // that was actually computing. It also puts long-lived streaming connections
820
+ // on the same process that serves interactive requests, so one large transfer
821
+ // degrades every page load, and a node on a slow link holds a request open for
822
+ // minutes against every timeout in the stack (Nginx, Fastify, the platform's
823
+ // load balancer) — each of which would have to be raised, for everyone.
824
+ //
825
+ // REJECTED: GIVING NODES STORAGE CREDENTIALS. Also small, also worse. A
826
+ // credential handed to a node is a bucket-wide capability sitting in a config
827
+ // file on a machine this deployment may not own, for as long as that machine
828
+ // exists — it does not expire when the job ends, it is not scoped to one
829
+ // object, and it cannot be revoked without rotating it for every other holder.
830
+ // A node compromised on Tuesday can read every object in the bucket on
831
+ // Friday. The signed URL below is the same capability reduced along three
832
+ // axes at once: ONE object, ONE verb, and MINUTES. Nothing has to be rotated
833
+ // when a node is decommissioned, because a decommissioned node holds nothing.
834
+ //
835
+ // -----------------------------------------------------------------------------
836
+ // ⚠ THE SERVER CHOOSES THE UPLOAD KEY. THE NODE NEVER DOES.
837
+ // -----------------------------------------------------------------------------
838
+ //
839
+ // REJECTED: `{ key: "outputs/my-thing.bin" }` in the upload request. A signed
840
+ // PUT is an unconditional overwrite of exactly the key it was signed for, so a
841
+ // key taken from the request body is a write primitive over the entire bucket,
842
+ // handed to the least trustworthy participant. `../../etc/config.json`,
843
+ // `uploads/<someone-else's-object>` and the storage key of any row in
844
+ // `storage_objects` are all just strings, and the provider will not object to
845
+ // any of them: S3 keys are opaque, `..` is not special, and there is no
846
+ // filesystem to refuse the traversal. The damage is silent — a job that
847
+ // "succeeded" while overwriting another user's file.
848
+ //
849
+ // The key is therefore derived server-side from the job id and a fresh UUID
850
+ // (`NodeDataPlaneService.createUploadTarget`), and a node-supplied one is
851
+ // REFUSED rather than silently ignored. Both are safe; the difference is what
852
+ // the node's author learns. Ignoring means their `key` field vanishes without
853
+ // a word: the upload succeeds, the bytes land somewhere they did not choose,
854
+ // and their code goes on referring to a path with nothing at it. That bug is
855
+ // found days later by a person, not minutes later by a machine. A `400` naming
856
+ // the field is found on the first run, by the person who just wrote it, and it
857
+ // costs a correct client exactly nothing — no legitimate node ever sends the
858
+ // field.
859
+ // =============================================================================
860
+ /**
861
+ * Cap on a node-declared `Content-Type`.
862
+ *
863
+ * It ends up in a signed header, so it is bounded for the same reason every
864
+ * other node-supplied string in this folder is: it arrives from a machine
865
+ * this deployment may not own.
866
+ */
867
+ const MAX_CONTENT_TYPE_LENGTH = 255;
868
+ // =============================================================================
869
+ // POST /nodes/:id/jobs/:jobId/download-url
870
+ // =============================================================================
871
+ //
872
+ // ONE FIELD, AND IT IS NOT A REQUEST FOR ANYTHING. This body had none at all
873
+ // until #364, and the distinction that let it acquire one is worth stating,
874
+ // because it is what keeps the next field out: `claimToken` does not ask the
875
+ // server for a different URL, a longer expiry or a different object. It
876
+ // answers "who is asking" — an ASSERTION about which claim of this job the
877
+ // caller is, checked against the row and never used to compute anything. A
878
+ // field that changed what came back would still be refused.
879
+ //
880
+ // So what has NOT changed: the server decides WHICH bytes (the job's
881
+ // `subjectId`, resolved server-side) and FOR HOW LONG. A DTO whose only field
882
+ // was `expiresIn` was considered and dropped for the same reason a
883
+ // node-supplied lease was dropped in #268 — the bound exists to limit the
884
+ // blast radius of a leaked URL, so the party the bound protects against does
885
+ // not get to set it.
886
+ //
887
+ // It is a POST rather than a GET even though it reads nothing, because it
888
+ // MINTS A CREDENTIAL. A GET's URL is the thing every layer between here and
889
+ // the node writes down — proxy access logs, browser history, a CDN cache key,
890
+ // an APM trace's endpoint label — and a response body containing a bearer URL
891
+ // has no business being cacheable by anything. POST is uncacheable by default
892
+ // and carries no such expectation.
893
+ /**
894
+ * What a node may say when asking to read its input: which claim is asking,
895
+ * and nothing else.
896
+ *
897
+ * ⚠ `.default({})` IS THE BACKWARD-COMPATIBILITY GUARANTEE, not a convenience.
898
+ * This route took no body at all until #364, so every node in every fleet
899
+ * posts to it with no payload and no `Content-Type` — Fastify hands Nest
900
+ * `undefined`, and a bare `z.object({...})` would reject that outright and
901
+ * fail every download from every node that has not been upgraded yet. The
902
+ * default is what makes "no body" parse to "no assertion", which is the
903
+ * pre-#364 behaviour spelled as data. Do not unwrap it. `nodeUploadUrlSchema`
904
+ * below and `nodeJobSecretRequestSchema` carry it for the milder version of
905
+ * the same reason — there, an empty body was always legal.
906
+ *
907
+ * A plain object rather than the `z.looseObject` its sibling uses: unknown
908
+ * keys here are stripped, exactly as they were ignored before this body
909
+ * existed. The loose-then-refuse-by-name treatment next door exists for `key`,
910
+ * a field whose silent omission would send a node's bytes somewhere it did not
911
+ * choose; nothing a node can put in THIS body has ever had an effect, so there
912
+ * is no misunderstanding to name.
913
+ *
914
+ * @stability experimental
915
+ */
916
+ export const nodeDownloadUrlSchema = z
917
+ .object({
918
+ /** Which claim of the job is asking (`claimTokenField`). */
919
+ claimToken: claimTokenField.optional(),
920
+ })
921
+ .default({});
922
+ // =============================================================================
923
+ // POST /nodes/:id/jobs/:jobId/upload-url
924
+ // =============================================================================
925
+ /**
926
+ * What a node may say when asking for somewhere to write.
927
+ *
928
+ * ⚠ `z.looseObject` RATHER THAN `z.strictObject`, AND THE REASON IS THE ERROR
929
+ * MESSAGE. Strict mode rejects an unknown key with a perfectly good Zod issue
930
+ * naming it — and that issue is then DESTROYED on the way out, because
931
+ * `http-exception.filter.ts` rebuilds every error body from a fixed key
932
+ * allowlist (`message`, `code`, `details`) and the validation pipe puts its
933
+ * issues under `errors`. The node would receive a bare
934
+ * `400 "Validation failed"`, which for the one field this endpoint most needs
935
+ * to talk about — `key` — is the least useful answer available.
936
+ *
937
+ * So unknown keys are CAPTURED here and refused in
938
+ * `NodeDataPlaneService.createUploadTarget`, which can raise a
939
+ * `BadRequestException` carrying a message that names the field, explains that
940
+ * the server chooses the key, and survives the filter intact. The security
941
+ * outcome is identical either way (the key is never read); what differs is
942
+ * whether the node's author is told why.
943
+ *
944
+ * `.default({})` so a node with nothing to declare may send an EMPTY BODY
945
+ * rather than being required to send `{}` to satisfy a parser.
946
+ *
947
+ * @stability experimental
948
+ */
949
+ export const nodeUploadUrlSchema = z
950
+ .looseObject({
951
+ /**
952
+ * The `Content-Type` the node will send on its PUT.
953
+ *
954
+ * ⚠ IT BECOMES PART OF THE SIGNATURE. A node that declares it MUST send
955
+ * exactly this header, or the provider answers `SignatureDoesNotMatch` —
956
+ * an error that names the signature and not the header that broke it. A
957
+ * node that is unsure should omit it and send whatever it likes.
958
+ */
959
+ contentType: z
960
+ .string()
961
+ .trim()
962
+ .min(1)
963
+ .max(MAX_CONTENT_TYPE_LENGTH)
964
+ .optional(),
965
+ /**
966
+ * WHICH CLAIM is asking for somewhere to write — see
967
+ * `claim-token.field.ts`.
968
+ *
969
+ * ⚠ THE SHARPEST OF THE SIX ROUTES THAT CARRY THIS, and the quietest if it
970
+ * is missing. Since #348 a type may derive its output key from the JOB
971
+ * (`deriveOutputKey`), so the key is a function of the row and not of the
972
+ * claim — which means a node's stale worker slot asking here is handed a
973
+ * signed PUT for the EXACT key its own later claim is currently writing.
974
+ * Both PUTs answer 200, the surviving bytes are whichever landed last, and
975
+ * nothing in any log ties the two together. The token is what refuses the
976
+ * first slot before the URL is minted.
977
+ *
978
+ * ⚠ IT IS ALSO A PERMITTED FIELD, which is not automatic here:
979
+ * `NodeDataPlaneService.rejectCallerSuppliedFields` refuses anything
980
+ * outside its allowlist by name, so adding a field to this schema without
981
+ * adding it there would 400 every upgraded node. The allowlist is the
982
+ * authority; this schema only describes.
983
+ */
984
+ claimToken: claimTokenField.optional(),
985
+ })
986
+ .default({});
987
+ // -----------------------------------------------------------------------------
988
+ // From node-job-secret.dto.ts: The per-job secret request and response bodies (issue #349, epic #345)
989
+ // -----------------------------------------------------------------------------
990
+ // =============================================================================
991
+ // The per-job secret request and response bodies (issue #349, epic #345)
992
+ // =============================================================================
993
+ //
994
+ // #269 gave a node a way to move BYTES with no storage credentials. This gives
995
+ // it a way to hold a CREDENTIAL for exactly one job, for exactly as long as it
996
+ // holds that job's lease. `job-secret-broker.ts` carries the argument for why
997
+ // the credential is brokered per job at all, and what the three rejected
998
+ // alternatives were; this file is about the wire shape, which has two
999
+ // properties worth stating on their own.
1000
+ //
1001
+ // -----------------------------------------------------------------------------
1002
+ // ⚠ THE REQUEST BODY ASKS FOR NOTHING, AND ANY FIELD THAT DOES IS A 400
1003
+ // -----------------------------------------------------------------------------
1004
+ //
1005
+ // Everything the server needs is already on the path (which node) and in the
1006
+ // row (which job, which type, which broker, which lease). There is nothing a
1007
+ // node could usefully ASK FOR — and, far more importantly, nothing it is
1008
+ // ALLOWED to ask for: A NODE MAY NOT REQUEST A SECRET IT WAS NOT ASSIGNED. A
1009
+ // `kind`, a `scope`, a `database`, a `ttl` in the body would each be a node
1010
+ // choosing some part of a credential's shape, and every one of those is the
1011
+ // server's choice derived from the job the node is holding.
1012
+ //
1013
+ // ⚠ `claimToken` (#364) IS THE ONE PERMITTED FIELD, AND IT IS NOT AN EXCEPTION
1014
+ // TO THAT RULE — it is the rule applied to a different question. Every field
1015
+ // above asks the server for something; this one ANSWERS something: which claim
1016
+ // of this job is asking. It changes nothing about the credential — not its
1017
+ // kind, not its scope, not its lifetime, all of which are still derived from
1018
+ // the row — and the only thing it can do is get the request REFUSED, which is
1019
+ // the whole point. Without it, the ambiguity this route is most exposed to is
1020
+ // also its worst: `claimedByNodeId` cannot tell a node's stalled, reaped slot
1021
+ // from the slot that re-claimed the job, so the stale one is handed a LIVE
1022
+ // DATABASE CREDENTIAL, bounded by a lease belonging to a claim that is not its
1023
+ // own. A field that can only ever narrow who may be answered is the one shape
1024
+ // of field this body can safely grow.
1025
+ //
1026
+ // So the refusal is the same one `NodeUploadUrlDto` makes about `key`, applied
1027
+ // to a body that permits nothing a node could ask for — including the `ttl`
1028
+ // case, which
1029
+ // is the one somebody will genuinely want. A node-chosen lifetime is refused
1030
+ // for the reason #268 refused a node-chosen lease: the bound exists to limit
1031
+ // the blast radius of a leaked credential, so the party the bound protects
1032
+ // against does not get to set it. The credential is bounded by the job's lease,
1033
+ // which the node is already renewing (#347), and there is deliberately no
1034
+ // second clock.
1035
+ //
1036
+ // `z.looseObject`, NOT `z.strictObject`, and the reason is the error message —
1037
+ // the identical reasoning `node-data-plane.dto.ts` records. Strict mode's
1038
+ // perfectly good Zod issue is DESTROYED on the way out, because
1039
+ // `http-exception.filter.ts` rebuilds every error body from a fixed key
1040
+ // allowlist and the validation pipe files its issues under `errors`; the node
1041
+ // would receive a bare `400 "Validation failed"` naming nothing. Unknown keys
1042
+ // are therefore CAPTURED here and refused in `NodeSecretBrokerService`, which
1043
+ // can raise a message that names the field and survives the filter intact. The
1044
+ // security outcome is identical either way — no field a node ASKS with is ever
1045
+ // read, and the one field that is read (`claimToken`) is declared in the schema
1046
+ // rather than swept up as an unknown key — and what differs is whether the
1047
+ // node's author is told why.
1048
+ //
1049
+ // -----------------------------------------------------------------------------
1050
+ // POST, NOT GET, AND `Cache-Control: no-store`
1051
+ // -----------------------------------------------------------------------------
1052
+ //
1053
+ // The same reason `worker-nodes.md`, "Data plane", gives for the two data-plane
1054
+ // routes, and it applies harder here because what comes back is not a scoped,
1055
+ // minutes-long URL but a credential. A `GET`'s URL is what every layer between
1056
+ // the server and the node writes down — proxy access logs, a CDN cache key, an
1057
+ // APM trace's endpoint label — and a response body containing a credential has
1058
+ // no business being cacheable by anything. `POST` is uncacheable by default;
1059
+ // `no-store` says so out loud for the intermediary that decides to be clever
1060
+ // anyway.
1061
+ // =============================================================================
1062
+ /**
1063
+ * What a node may say when asking for its job's credential: which claim is
1064
+ * asking, and nothing else.
1065
+ *
1066
+ * `.default({})` so a node with nothing to declare may send an empty body
1067
+ * rather than being made to send `{}` to satisfy a parser — an empty body is
1068
+ * still a correct request, and is what every node sent before #364. Anything
1069
+ * beyond `claimToken` is captured by the loose object and refused by name in
1070
+ * the service, whose allowlist — not this schema — is the authority on what
1071
+ * may be sent; adding a field here without adding it there would 400 the
1072
+ * clients that send it.
1073
+ *
1074
+ * @stability experimental
1075
+ */
1076
+ export const nodeJobSecretRequestSchema = z
1077
+ .looseObject({
1078
+ /** WHICH CLAIM is asking — see `claim-token.field.ts` and the header above. */
1079
+ claimToken: claimTokenField.optional(),
1080
+ })
1081
+ .default({});
1082
+ //# sourceMappingURL=schemas.js.map