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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (673) hide show
  1. package/CHANGELOG.md +173 -0
  2. package/README.md +23 -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/android-app/constants.d.ts +337 -0
  28. package/dist/cjs/android-app/constants.d.ts.map +1 -0
  29. package/dist/cjs/android-app/constants.js +312 -0
  30. package/dist/cjs/android-app/constants.js.map +1 -0
  31. package/dist/cjs/android-app/index.d.ts +5 -0
  32. package/dist/cjs/android-app/index.d.ts.map +1 -0
  33. package/dist/cjs/android-app/index.js +57 -0
  34. package/dist/cjs/android-app/index.js.map +1 -0
  35. package/dist/cjs/android-app/schemas.d.ts +358 -0
  36. package/dist/cjs/android-app/schemas.d.ts.map +1 -0
  37. package/dist/cjs/android-app/schemas.js +310 -0
  38. package/dist/cjs/android-app/schemas.js.map +1 -0
  39. package/dist/cjs/credentials/constants.d.ts +35 -0
  40. package/dist/cjs/credentials/constants.d.ts.map +1 -0
  41. package/dist/cjs/credentials/constants.js +39 -0
  42. package/dist/cjs/credentials/constants.js.map +1 -0
  43. package/dist/cjs/credentials/index.d.ts +5 -0
  44. package/dist/cjs/credentials/index.d.ts.map +1 -0
  45. package/dist/cjs/credentials/index.js +17 -0
  46. package/dist/cjs/credentials/index.js.map +1 -0
  47. package/dist/cjs/credentials/schemas.d.ts +64 -0
  48. package/dist/cjs/credentials/schemas.d.ts.map +1 -0
  49. package/dist/cjs/credentials/schemas.js +82 -0
  50. package/dist/cjs/credentials/schemas.js.map +1 -0
  51. package/dist/cjs/db-backup/config.d.ts +76 -0
  52. package/dist/cjs/db-backup/config.d.ts.map +1 -0
  53. package/dist/cjs/db-backup/config.js +115 -0
  54. package/dist/cjs/db-backup/config.js.map +1 -0
  55. package/dist/cjs/db-backup/constants.d.ts +314 -0
  56. package/dist/cjs/db-backup/constants.d.ts.map +1 -0
  57. package/dist/cjs/db-backup/constants.js +243 -0
  58. package/dist/cjs/db-backup/constants.js.map +1 -0
  59. package/dist/cjs/db-backup/index.d.ts +19 -0
  60. package/dist/cjs/db-backup/index.d.ts.map +1 -0
  61. package/dist/cjs/db-backup/index.js +81 -0
  62. package/dist/cjs/db-backup/index.js.map +1 -0
  63. package/dist/cjs/db-backup/node-credential.d.ts +37 -0
  64. package/dist/cjs/db-backup/node-credential.d.ts.map +1 -0
  65. package/dist/cjs/db-backup/node-credential.js +107 -0
  66. package/dist/cjs/db-backup/node-credential.js.map +1 -0
  67. package/dist/cjs/db-backup/node-result.d.ts +34 -0
  68. package/dist/cjs/db-backup/node-result.d.ts.map +1 -0
  69. package/dist/cjs/db-backup/node-result.js +168 -0
  70. package/dist/cjs/db-backup/node-result.js.map +1 -0
  71. package/dist/cjs/db-backup/restore.d.ts +405 -0
  72. package/dist/cjs/db-backup/restore.d.ts.map +1 -0
  73. package/dist/cjs/db-backup/restore.js +497 -0
  74. package/dist/cjs/db-backup/restore.js.map +1 -0
  75. package/dist/cjs/db-backup/run-actions.d.ts +49 -0
  76. package/dist/cjs/db-backup/run-actions.d.ts.map +1 -0
  77. package/dist/cjs/db-backup/run-actions.js +121 -0
  78. package/dist/cjs/db-backup/run-actions.js.map +1 -0
  79. package/dist/cjs/db-backup/runs-list-query.d.ts +20 -0
  80. package/dist/cjs/db-backup/runs-list-query.d.ts.map +1 -0
  81. package/dist/cjs/db-backup/runs-list-query.js +53 -0
  82. package/dist/cjs/db-backup/runs-list-query.js.map +1 -0
  83. package/dist/cjs/db-backup/runs.d.ts +46 -0
  84. package/dist/cjs/db-backup/runs.d.ts.map +1 -0
  85. package/dist/cjs/db-backup/runs.js +232 -0
  86. package/dist/cjs/db-backup/runs.js.map +1 -0
  87. package/dist/cjs/db-backup/schemas.d.ts +9 -0
  88. package/dist/cjs/db-backup/schemas.d.ts.map +1 -0
  89. package/dist/cjs/db-backup/schemas.js +31 -0
  90. package/dist/cjs/db-backup/schemas.js.map +1 -0
  91. package/dist/cjs/db-backup/settings-schemas.d.ts +217 -0
  92. package/dist/cjs/db-backup/settings-schemas.d.ts.map +1 -0
  93. package/dist/cjs/db-backup/settings-schemas.js +319 -0
  94. package/dist/cjs/db-backup/settings-schemas.js.map +1 -0
  95. package/dist/cjs/email/constants.d.ts +82 -0
  96. package/dist/cjs/email/constants.d.ts.map +1 -0
  97. package/dist/cjs/email/constants.js +82 -0
  98. package/dist/cjs/email/constants.js.map +1 -0
  99. package/dist/cjs/email/index.d.ts +5 -0
  100. package/dist/cjs/email/index.d.ts.map +1 -0
  101. package/dist/cjs/email/index.js +30 -0
  102. package/dist/cjs/email/index.js.map +1 -0
  103. package/dist/cjs/email/schemas.d.ts +276 -0
  104. package/dist/cjs/email/schemas.d.ts.map +1 -0
  105. package/dist/cjs/email/schemas.js +280 -0
  106. package/dist/cjs/email/schemas.js.map +1 -0
  107. package/dist/cjs/exports/constants.d.ts +123 -0
  108. package/dist/cjs/exports/constants.d.ts.map +1 -0
  109. package/dist/cjs/exports/constants.js +109 -0
  110. package/dist/cjs/exports/constants.js.map +1 -0
  111. package/dist/cjs/exports/index.d.ts +5 -0
  112. package/dist/cjs/exports/index.d.ts.map +1 -0
  113. package/dist/cjs/exports/index.js +42 -0
  114. package/dist/cjs/exports/index.js.map +1 -0
  115. package/dist/cjs/exports/schemas.d.ts +386 -0
  116. package/dist/cjs/exports/schemas.d.ts.map +1 -0
  117. package/dist/cjs/exports/schemas.js +288 -0
  118. package/dist/cjs/exports/schemas.js.map +1 -0
  119. package/dist/cjs/identity/constants.d.ts +273 -0
  120. package/dist/cjs/identity/constants.d.ts.map +1 -0
  121. package/dist/cjs/identity/constants.js +248 -0
  122. package/dist/cjs/identity/constants.js.map +1 -0
  123. package/dist/cjs/identity/index.d.ts +5 -0
  124. package/dist/cjs/identity/index.d.ts.map +1 -0
  125. package/dist/cjs/identity/index.js +73 -0
  126. package/dist/cjs/identity/index.js.map +1 -0
  127. package/dist/cjs/identity/schemas.d.ts +784 -0
  128. package/dist/cjs/identity/schemas.d.ts.map +1 -0
  129. package/dist/cjs/identity/schemas.js +684 -0
  130. package/dist/cjs/identity/schemas.js.map +1 -0
  131. package/dist/cjs/jobs/constants.d.ts +135 -0
  132. package/dist/cjs/jobs/constants.d.ts.map +1 -0
  133. package/dist/cjs/jobs/constants.js +130 -0
  134. package/dist/cjs/jobs/constants.js.map +1 -0
  135. package/dist/cjs/jobs/index.d.ts +9 -0
  136. package/dist/cjs/jobs/index.d.ts.map +1 -0
  137. package/dist/cjs/jobs/index.js +59 -0
  138. package/dist/cjs/jobs/index.js.map +1 -0
  139. package/dist/cjs/jobs/retention-schemas.d.ts +252 -0
  140. package/dist/cjs/jobs/retention-schemas.d.ts.map +1 -0
  141. package/dist/cjs/jobs/retention-schemas.js +233 -0
  142. package/dist/cjs/jobs/retention-schemas.js.map +1 -0
  143. package/dist/cjs/jobs/schemas.d.ts +361 -0
  144. package/dist/cjs/jobs/schemas.d.ts.map +1 -0
  145. package/dist/cjs/jobs/schemas.js +706 -0
  146. package/dist/cjs/jobs/schemas.js.map +1 -0
  147. package/dist/cjs/jobs/settings-schemas.d.ts +84 -0
  148. package/dist/cjs/jobs/settings-schemas.d.ts.map +1 -0
  149. package/dist/cjs/jobs/settings-schemas.js +116 -0
  150. package/dist/cjs/jobs/settings-schemas.js.map +1 -0
  151. package/dist/cjs/nodes/admin-schemas.d.ts +204 -0
  152. package/dist/cjs/nodes/admin-schemas.d.ts.map +1 -0
  153. package/dist/cjs/nodes/admin-schemas.js +153 -0
  154. package/dist/cjs/nodes/admin-schemas.js.map +1 -0
  155. package/dist/cjs/nodes/constants.d.ts +86 -0
  156. package/dist/cjs/nodes/constants.d.ts.map +1 -0
  157. package/dist/cjs/nodes/constants.js +102 -0
  158. package/dist/cjs/nodes/constants.js.map +1 -0
  159. package/dist/cjs/nodes/index.d.ts +8 -0
  160. package/dist/cjs/nodes/index.d.ts.map +1 -0
  161. package/dist/cjs/nodes/index.js +50 -0
  162. package/dist/cjs/nodes/index.js.map +1 -0
  163. package/dist/cjs/nodes/schemas.d.ts +332 -0
  164. package/dist/cjs/nodes/schemas.d.ts.map +1 -0
  165. package/dist/cjs/nodes/schemas.js +937 -0
  166. package/dist/cjs/nodes/schemas.js.map +1 -0
  167. package/dist/cjs/nodes/settings-schemas.d.ts +82 -0
  168. package/dist/cjs/nodes/settings-schemas.d.ts.map +1 -0
  169. package/dist/cjs/nodes/settings-schemas.js +106 -0
  170. package/dist/cjs/nodes/settings-schemas.js.map +1 -0
  171. package/dist/cjs/notifications/constants.d.ts +197 -0
  172. package/dist/cjs/notifications/constants.d.ts.map +1 -0
  173. package/dist/cjs/notifications/constants.js +181 -0
  174. package/dist/cjs/notifications/constants.js.map +1 -0
  175. package/dist/cjs/notifications/index.d.ts +5 -0
  176. package/dist/cjs/notifications/index.d.ts.map +1 -0
  177. package/dist/cjs/notifications/index.js +86 -0
  178. package/dist/cjs/notifications/index.js.map +1 -0
  179. package/dist/cjs/notifications/schemas.d.ts +1016 -0
  180. package/dist/cjs/notifications/schemas.d.ts.map +1 -0
  181. package/dist/cjs/notifications/schemas.js +851 -0
  182. package/dist/cjs/notifications/schemas.js.map +1 -0
  183. package/dist/cjs/onboarding/constants.d.ts +138 -0
  184. package/dist/cjs/onboarding/constants.d.ts.map +1 -0
  185. package/dist/cjs/onboarding/constants.js +123 -0
  186. package/dist/cjs/onboarding/constants.js.map +1 -0
  187. package/dist/cjs/onboarding/index.d.ts +5 -0
  188. package/dist/cjs/onboarding/index.d.ts.map +1 -0
  189. package/dist/cjs/onboarding/index.js +42 -0
  190. package/dist/cjs/onboarding/index.js.map +1 -0
  191. package/dist/cjs/onboarding/schemas.d.ts +360 -0
  192. package/dist/cjs/onboarding/schemas.d.ts.map +1 -0
  193. package/dist/cjs/onboarding/schemas.js +260 -0
  194. package/dist/cjs/onboarding/schemas.js.map +1 -0
  195. package/dist/cjs/settings/constants.d.ts +206 -0
  196. package/dist/cjs/settings/constants.d.ts.map +1 -0
  197. package/dist/cjs/settings/constants.js +200 -0
  198. package/dist/cjs/settings/constants.js.map +1 -0
  199. package/dist/cjs/settings/index.d.ts +6 -0
  200. package/dist/cjs/settings/index.d.ts.map +1 -0
  201. package/dist/cjs/settings/index.js +62 -0
  202. package/dist/cjs/settings/index.js.map +1 -0
  203. package/dist/cjs/settings/schemas.d.ts +574 -0
  204. package/dist/cjs/settings/schemas.d.ts.map +1 -0
  205. package/dist/cjs/settings/schemas.js +437 -0
  206. package/dist/cjs/settings/schemas.js.map +1 -0
  207. package/dist/cjs/settings/types.d.ts +79 -0
  208. package/dist/cjs/settings/types.d.ts.map +1 -0
  209. package/dist/cjs/settings/types.js +6 -0
  210. package/dist/cjs/settings/types.js.map +1 -0
  211. package/dist/cjs/sharing/constants.d.ts +216 -0
  212. package/dist/cjs/sharing/constants.d.ts.map +1 -0
  213. package/dist/cjs/sharing/constants.js +163 -0
  214. package/dist/cjs/sharing/constants.js.map +1 -0
  215. package/dist/cjs/sharing/enum.d.ts +5 -0
  216. package/dist/cjs/sharing/enum.d.ts.map +1 -0
  217. package/dist/cjs/sharing/enum.js +9 -0
  218. package/dist/cjs/sharing/enum.js.map +1 -0
  219. package/dist/cjs/sharing/grants.d.ts +490 -0
  220. package/dist/cjs/sharing/grants.d.ts.map +1 -0
  221. package/dist/cjs/sharing/grants.js +447 -0
  222. package/dist/cjs/sharing/grants.js.map +1 -0
  223. package/dist/cjs/sharing/groups.d.ts +410 -0
  224. package/dist/cjs/sharing/groups.d.ts.map +1 -0
  225. package/dist/cjs/sharing/groups.js +375 -0
  226. package/dist/cjs/sharing/groups.js.map +1 -0
  227. package/dist/cjs/sharing/index.d.ts +5 -0
  228. package/dist/cjs/sharing/index.d.ts.map +1 -0
  229. package/dist/cjs/sharing/index.js +77 -0
  230. package/dist/cjs/sharing/index.js.map +1 -0
  231. package/dist/cjs/sharing/schemas.d.ts +3 -0
  232. package/dist/cjs/sharing/schemas.d.ts.map +1 -0
  233. package/dist/cjs/sharing/schemas.js +21 -0
  234. package/dist/cjs/sharing/schemas.js.map +1 -0
  235. package/dist/cjs/storage/constants.d.ts +111 -0
  236. package/dist/cjs/storage/constants.d.ts.map +1 -0
  237. package/dist/cjs/storage/constants.js +107 -0
  238. package/dist/cjs/storage/constants.js.map +1 -0
  239. package/dist/cjs/storage/index.d.ts +27 -0
  240. package/dist/cjs/storage/index.d.ts.map +1 -0
  241. package/dist/cjs/storage/index.js +69 -0
  242. package/dist/cjs/storage/index.js.map +1 -0
  243. package/dist/cjs/storage/objects-complete-upload.d.ts +19 -0
  244. package/dist/cjs/storage/objects-complete-upload.d.ts.map +1 -0
  245. package/dist/cjs/storage/objects-complete-upload.js +19 -0
  246. package/dist/cjs/storage/objects-complete-upload.js.map +1 -0
  247. package/dist/cjs/storage/objects-download-url.d.ts +17 -0
  248. package/dist/cjs/storage/objects-download-url.d.ts.map +1 -0
  249. package/dist/cjs/storage/objects-download-url.js +16 -0
  250. package/dist/cjs/storage/objects-download-url.js.map +1 -0
  251. package/dist/cjs/storage/objects-init-upload.d.ts +39 -0
  252. package/dist/cjs/storage/objects-init-upload.d.ts.map +1 -0
  253. package/dist/cjs/storage/objects-init-upload.js +40 -0
  254. package/dist/cjs/storage/objects-init-upload.js.map +1 -0
  255. package/dist/cjs/storage/objects-list-query.d.ts +50 -0
  256. package/dist/cjs/storage/objects-list-query.d.ts.map +1 -0
  257. package/dist/cjs/storage/objects-list-query.js +23 -0
  258. package/dist/cjs/storage/objects-list-query.js.map +1 -0
  259. package/dist/cjs/storage/objects-object-response.d.ts +49 -0
  260. package/dist/cjs/storage/objects-object-response.d.ts.map +1 -0
  261. package/dist/cjs/storage/objects-object-response.js +54 -0
  262. package/dist/cjs/storage/objects-object-response.js.map +1 -0
  263. package/dist/cjs/storage/objects-update-metadata.d.ts +16 -0
  264. package/dist/cjs/storage/objects-update-metadata.d.ts.map +1 -0
  265. package/dist/cjs/storage/objects-update-metadata.js +14 -0
  266. package/dist/cjs/storage/objects-update-metadata.js.map +1 -0
  267. package/dist/cjs/storage/schemas.d.ts +13 -0
  268. package/dist/cjs/storage/schemas.d.ts.map +1 -0
  269. package/dist/cjs/storage/schemas.js +35 -0
  270. package/dist/cjs/storage/schemas.js.map +1 -0
  271. package/dist/cjs/storage/settings-schemas.d.ts +188 -0
  272. package/dist/cjs/storage/settings-schemas.d.ts.map +1 -0
  273. package/dist/cjs/storage/settings-schemas.js +223 -0
  274. package/dist/cjs/storage/settings-schemas.js.map +1 -0
  275. package/dist/cjs/storage/storage-bucket-provision.d.ts +152 -0
  276. package/dist/cjs/storage/storage-bucket-provision.d.ts.map +1 -0
  277. package/dist/cjs/storage/storage-bucket-provision.js +216 -0
  278. package/dist/cjs/storage/storage-bucket-provision.js.map +1 -0
  279. package/dist/cjs/storage/storage-config-response.d.ts +99 -0
  280. package/dist/cjs/storage/storage-config-response.d.ts.map +1 -0
  281. package/dist/cjs/storage/storage-config-response.js +173 -0
  282. package/dist/cjs/storage/storage-config-response.js.map +1 -0
  283. package/dist/cjs/storage/storage-config-update.d.ts +46 -0
  284. package/dist/cjs/storage/storage-config-update.d.ts.map +1 -0
  285. package/dist/cjs/storage/storage-config-update.js +133 -0
  286. package/dist/cjs/storage/storage-config-update.js.map +1 -0
  287. package/dist/cjs/storage/storage-connection-test.d.ts +129 -0
  288. package/dist/cjs/storage/storage-connection-test.d.ts.map +1 -0
  289. package/dist/cjs/storage/storage-connection-test.js +244 -0
  290. package/dist/cjs/storage/storage-connection-test.js.map +1 -0
  291. package/dist/cjs/storage/storage-status.d.ts +16 -0
  292. package/dist/cjs/storage/storage-status.d.ts.map +1 -0
  293. package/dist/cjs/storage/storage-status.js +23 -0
  294. package/dist/cjs/storage/storage-status.js.map +1 -0
  295. package/dist/cjs/telemetry/config.d.ts +4 -0
  296. package/dist/cjs/telemetry/config.d.ts.map +1 -1
  297. package/dist/cjs/telemetry/config.js +16 -2
  298. package/dist/cjs/telemetry/config.js.map +1 -1
  299. package/dist/cjs/telemetry/connection.d.ts +1 -1
  300. package/dist/cjs/telemetry/constants.d.ts +378 -6
  301. package/dist/cjs/telemetry/constants.d.ts.map +1 -1
  302. package/dist/cjs/telemetry/constants.js +290 -5
  303. package/dist/cjs/telemetry/constants.js.map +1 -1
  304. package/dist/cjs/telemetry/dashboard.d.ts +188 -17
  305. package/dist/cjs/telemetry/dashboard.d.ts.map +1 -1
  306. package/dist/cjs/telemetry/dashboard.js +61 -3
  307. package/dist/cjs/telemetry/dashboard.js.map +1 -1
  308. package/dist/cjs/telemetry/index.d.ts +4 -4
  309. package/dist/cjs/telemetry/index.d.ts.map +1 -1
  310. package/dist/cjs/telemetry/index.js +35 -3
  311. package/dist/cjs/telemetry/index.js.map +1 -1
  312. package/dist/cjs/telemetry/presentation.d.ts +243 -0
  313. package/dist/cjs/telemetry/presentation.d.ts.map +1 -0
  314. package/dist/cjs/telemetry/presentation.js +300 -0
  315. package/dist/cjs/telemetry/presentation.js.map +1 -0
  316. package/dist/cjs/telemetry/query.d.ts +2 -2
  317. package/dist/cjs/telemetry/schemas.d.ts +5 -2
  318. package/dist/cjs/telemetry/schemas.d.ts.map +1 -1
  319. package/dist/cjs/telemetry/schemas.js +21 -1
  320. package/dist/cjs/telemetry/schemas.js.map +1 -1
  321. package/dist/cjs/telemetry/stack.d.ts +5 -5
  322. package/dist/cjs/telemetry/store.d.ts +111 -0
  323. package/dist/cjs/telemetry/store.d.ts.map +1 -0
  324. package/dist/cjs/telemetry/store.js +83 -0
  325. package/dist/cjs/telemetry/store.js.map +1 -0
  326. package/dist/cjs/user-data/constants.d.ts +157 -0
  327. package/dist/cjs/user-data/constants.d.ts.map +1 -0
  328. package/dist/cjs/user-data/constants.js +137 -0
  329. package/dist/cjs/user-data/constants.js.map +1 -0
  330. package/dist/cjs/user-data/index.d.ts +5 -0
  331. package/dist/cjs/user-data/index.d.ts.map +1 -0
  332. package/dist/cjs/user-data/index.js +46 -0
  333. package/dist/cjs/user-data/index.js.map +1 -0
  334. package/dist/cjs/user-data/schemas.d.ts +306 -0
  335. package/dist/cjs/user-data/schemas.d.ts.map +1 -0
  336. package/dist/cjs/user-data/schemas.js +333 -0
  337. package/dist/cjs/user-data/schemas.js.map +1 -0
  338. package/dist/esm/ai/capabilities.d.ts +85 -0
  339. package/dist/esm/ai/capabilities.d.ts.map +1 -0
  340. package/dist/esm/ai/capabilities.js +90 -0
  341. package/dist/esm/ai/capabilities.js.map +1 -0
  342. package/dist/esm/ai/constants.d.ts +239 -0
  343. package/dist/esm/ai/constants.d.ts.map +1 -0
  344. package/dist/esm/ai/constants.js +229 -0
  345. package/dist/esm/ai/constants.js.map +1 -0
  346. package/dist/esm/ai/features.d.ts +24 -0
  347. package/dist/esm/ai/features.d.ts.map +1 -0
  348. package/dist/esm/ai/features.js +30 -0
  349. package/dist/esm/ai/features.js.map +1 -0
  350. package/dist/esm/ai/index.d.ts +11 -0
  351. package/dist/esm/ai/index.d.ts.map +1 -0
  352. package/dist/esm/ai/index.js +16 -0
  353. package/dist/esm/ai/index.js.map +1 -0
  354. package/dist/esm/ai/org-keys.d.ts +50 -0
  355. package/dist/esm/ai/org-keys.d.ts.map +1 -0
  356. package/dist/esm/ai/org-keys.js +40 -0
  357. package/dist/esm/ai/org-keys.js.map +1 -0
  358. package/dist/esm/ai/schemas.d.ts +642 -0
  359. package/dist/esm/ai/schemas.d.ts.map +1 -0
  360. package/dist/esm/ai/schemas.js +889 -0
  361. package/dist/esm/ai/schemas.js.map +1 -0
  362. package/dist/esm/android-app/constants.d.ts +337 -0
  363. package/dist/esm/android-app/constants.d.ts.map +1 -0
  364. package/dist/esm/android-app/constants.js +306 -0
  365. package/dist/esm/android-app/constants.js.map +1 -0
  366. package/dist/esm/android-app/index.d.ts +5 -0
  367. package/dist/esm/android-app/index.d.ts.map +1 -0
  368. package/dist/esm/android-app/index.js +8 -0
  369. package/dist/esm/android-app/index.js.map +1 -0
  370. package/dist/esm/android-app/schemas.d.ts +358 -0
  371. package/dist/esm/android-app/schemas.d.ts.map +1 -0
  372. package/dist/esm/android-app/schemas.js +306 -0
  373. package/dist/esm/android-app/schemas.js.map +1 -0
  374. package/dist/esm/credentials/constants.d.ts +35 -0
  375. package/dist/esm/credentials/constants.d.ts.map +1 -0
  376. package/dist/esm/credentials/constants.js +36 -0
  377. package/dist/esm/credentials/constants.js.map +1 -0
  378. package/dist/esm/credentials/index.d.ts +5 -0
  379. package/dist/esm/credentials/index.d.ts.map +1 -0
  380. package/dist/esm/credentials/index.js +8 -0
  381. package/dist/esm/credentials/index.js.map +1 -0
  382. package/dist/esm/credentials/schemas.d.ts +64 -0
  383. package/dist/esm/credentials/schemas.d.ts.map +1 -0
  384. package/dist/esm/credentials/schemas.js +79 -0
  385. package/dist/esm/credentials/schemas.js.map +1 -0
  386. package/dist/esm/db-backup/config.d.ts +76 -0
  387. package/dist/esm/db-backup/config.d.ts.map +1 -0
  388. package/dist/esm/db-backup/config.js +112 -0
  389. package/dist/esm/db-backup/config.js.map +1 -0
  390. package/dist/esm/db-backup/constants.d.ts +314 -0
  391. package/dist/esm/db-backup/constants.d.ts.map +1 -0
  392. package/dist/esm/db-backup/constants.js +240 -0
  393. package/dist/esm/db-backup/constants.js.map +1 -0
  394. package/dist/esm/db-backup/index.d.ts +19 -0
  395. package/dist/esm/db-backup/index.d.ts.map +1 -0
  396. package/dist/esm/db-backup/index.js +25 -0
  397. package/dist/esm/db-backup/index.js.map +1 -0
  398. package/dist/esm/db-backup/node-credential.d.ts +37 -0
  399. package/dist/esm/db-backup/node-credential.d.ts.map +1 -0
  400. package/dist/esm/db-backup/node-credential.js +104 -0
  401. package/dist/esm/db-backup/node-credential.js.map +1 -0
  402. package/dist/esm/db-backup/node-result.d.ts +34 -0
  403. package/dist/esm/db-backup/node-result.d.ts.map +1 -0
  404. package/dist/esm/db-backup/node-result.js +165 -0
  405. package/dist/esm/db-backup/node-result.js.map +1 -0
  406. package/dist/esm/db-backup/restore.d.ts +405 -0
  407. package/dist/esm/db-backup/restore.d.ts.map +1 -0
  408. package/dist/esm/db-backup/restore.js +494 -0
  409. package/dist/esm/db-backup/restore.js.map +1 -0
  410. package/dist/esm/db-backup/run-actions.d.ts +49 -0
  411. package/dist/esm/db-backup/run-actions.d.ts.map +1 -0
  412. package/dist/esm/db-backup/run-actions.js +118 -0
  413. package/dist/esm/db-backup/run-actions.js.map +1 -0
  414. package/dist/esm/db-backup/runs-list-query.d.ts +20 -0
  415. package/dist/esm/db-backup/runs-list-query.d.ts.map +1 -0
  416. package/dist/esm/db-backup/runs-list-query.js +50 -0
  417. package/dist/esm/db-backup/runs-list-query.js.map +1 -0
  418. package/dist/esm/db-backup/runs.d.ts +46 -0
  419. package/dist/esm/db-backup/runs.d.ts.map +1 -0
  420. package/dist/esm/db-backup/runs.js +229 -0
  421. package/dist/esm/db-backup/runs.js.map +1 -0
  422. package/dist/esm/db-backup/schemas.d.ts +9 -0
  423. package/dist/esm/db-backup/schemas.d.ts.map +1 -0
  424. package/dist/esm/db-backup/schemas.js +15 -0
  425. package/dist/esm/db-backup/schemas.js.map +1 -0
  426. package/dist/esm/db-backup/settings-schemas.d.ts +217 -0
  427. package/dist/esm/db-backup/settings-schemas.d.ts.map +1 -0
  428. package/dist/esm/db-backup/settings-schemas.js +316 -0
  429. package/dist/esm/db-backup/settings-schemas.js.map +1 -0
  430. package/dist/esm/email/constants.d.ts +82 -0
  431. package/dist/esm/email/constants.d.ts.map +1 -0
  432. package/dist/esm/email/constants.js +79 -0
  433. package/dist/esm/email/constants.js.map +1 -0
  434. package/dist/esm/email/index.d.ts +5 -0
  435. package/dist/esm/email/index.d.ts.map +1 -0
  436. package/dist/esm/email/index.js +8 -0
  437. package/dist/esm/email/index.js.map +1 -0
  438. package/dist/esm/email/schemas.d.ts +276 -0
  439. package/dist/esm/email/schemas.d.ts.map +1 -0
  440. package/dist/esm/email/schemas.js +277 -0
  441. package/dist/esm/email/schemas.js.map +1 -0
  442. package/dist/esm/exports/constants.d.ts +123 -0
  443. package/dist/esm/exports/constants.d.ts.map +1 -0
  444. package/dist/esm/exports/constants.js +106 -0
  445. package/dist/esm/exports/constants.js.map +1 -0
  446. package/dist/esm/exports/index.d.ts +5 -0
  447. package/dist/esm/exports/index.d.ts.map +1 -0
  448. package/dist/esm/exports/index.js +7 -0
  449. package/dist/esm/exports/index.js.map +1 -0
  450. package/dist/esm/exports/schemas.d.ts +386 -0
  451. package/dist/esm/exports/schemas.d.ts.map +1 -0
  452. package/dist/esm/exports/schemas.js +285 -0
  453. package/dist/esm/exports/schemas.js.map +1 -0
  454. package/dist/esm/identity/constants.d.ts +273 -0
  455. package/dist/esm/identity/constants.d.ts.map +1 -0
  456. package/dist/esm/identity/constants.js +244 -0
  457. package/dist/esm/identity/constants.js.map +1 -0
  458. package/dist/esm/identity/index.d.ts +5 -0
  459. package/dist/esm/identity/index.d.ts.map +1 -0
  460. package/dist/esm/identity/index.js +10 -0
  461. package/dist/esm/identity/index.js.map +1 -0
  462. package/dist/esm/identity/schemas.d.ts +784 -0
  463. package/dist/esm/identity/schemas.d.ts.map +1 -0
  464. package/dist/esm/identity/schemas.js +681 -0
  465. package/dist/esm/identity/schemas.js.map +1 -0
  466. package/dist/esm/jobs/constants.d.ts +135 -0
  467. package/dist/esm/jobs/constants.d.ts.map +1 -0
  468. package/dist/esm/jobs/constants.js +127 -0
  469. package/dist/esm/jobs/constants.js.map +1 -0
  470. package/dist/esm/jobs/index.d.ts +9 -0
  471. package/dist/esm/jobs/index.d.ts.map +1 -0
  472. package/dist/esm/jobs/index.js +11 -0
  473. package/dist/esm/jobs/index.js.map +1 -0
  474. package/dist/esm/jobs/retention-schemas.d.ts +252 -0
  475. package/dist/esm/jobs/retention-schemas.d.ts.map +1 -0
  476. package/dist/esm/jobs/retention-schemas.js +229 -0
  477. package/dist/esm/jobs/retention-schemas.js.map +1 -0
  478. package/dist/esm/jobs/schemas.d.ts +361 -0
  479. package/dist/esm/jobs/schemas.d.ts.map +1 -0
  480. package/dist/esm/jobs/schemas.js +703 -0
  481. package/dist/esm/jobs/schemas.js.map +1 -0
  482. package/dist/esm/jobs/settings-schemas.d.ts +84 -0
  483. package/dist/esm/jobs/settings-schemas.d.ts.map +1 -0
  484. package/dist/esm/jobs/settings-schemas.js +113 -0
  485. package/dist/esm/jobs/settings-schemas.js.map +1 -0
  486. package/dist/esm/nodes/admin-schemas.d.ts +204 -0
  487. package/dist/esm/nodes/admin-schemas.d.ts.map +1 -0
  488. package/dist/esm/nodes/admin-schemas.js +150 -0
  489. package/dist/esm/nodes/admin-schemas.js.map +1 -0
  490. package/dist/esm/nodes/constants.d.ts +86 -0
  491. package/dist/esm/nodes/constants.d.ts.map +1 -0
  492. package/dist/esm/nodes/constants.js +99 -0
  493. package/dist/esm/nodes/constants.js.map +1 -0
  494. package/dist/esm/nodes/index.d.ts +8 -0
  495. package/dist/esm/nodes/index.d.ts.map +1 -0
  496. package/dist/esm/nodes/index.js +11 -0
  497. package/dist/esm/nodes/index.js.map +1 -0
  498. package/dist/esm/nodes/schemas.d.ts +332 -0
  499. package/dist/esm/nodes/schemas.d.ts.map +1 -0
  500. package/dist/esm/nodes/schemas.js +934 -0
  501. package/dist/esm/nodes/schemas.js.map +1 -0
  502. package/dist/esm/nodes/settings-schemas.d.ts +82 -0
  503. package/dist/esm/nodes/settings-schemas.d.ts.map +1 -0
  504. package/dist/esm/nodes/settings-schemas.js +103 -0
  505. package/dist/esm/nodes/settings-schemas.js.map +1 -0
  506. package/dist/esm/notifications/constants.d.ts +197 -0
  507. package/dist/esm/notifications/constants.d.ts.map +1 -0
  508. package/dist/esm/notifications/constants.js +178 -0
  509. package/dist/esm/notifications/constants.js.map +1 -0
  510. package/dist/esm/notifications/index.d.ts +5 -0
  511. package/dist/esm/notifications/index.d.ts.map +1 -0
  512. package/dist/esm/notifications/index.js +9 -0
  513. package/dist/esm/notifications/index.js.map +1 -0
  514. package/dist/esm/notifications/schemas.d.ts +1016 -0
  515. package/dist/esm/notifications/schemas.d.ts.map +1 -0
  516. package/dist/esm/notifications/schemas.js +848 -0
  517. package/dist/esm/notifications/schemas.js.map +1 -0
  518. package/dist/esm/onboarding/constants.d.ts +138 -0
  519. package/dist/esm/onboarding/constants.d.ts.map +1 -0
  520. package/dist/esm/onboarding/constants.js +120 -0
  521. package/dist/esm/onboarding/constants.js.map +1 -0
  522. package/dist/esm/onboarding/index.d.ts +5 -0
  523. package/dist/esm/onboarding/index.d.ts.map +1 -0
  524. package/dist/esm/onboarding/index.js +7 -0
  525. package/dist/esm/onboarding/index.js.map +1 -0
  526. package/dist/esm/onboarding/schemas.d.ts +360 -0
  527. package/dist/esm/onboarding/schemas.d.ts.map +1 -0
  528. package/dist/esm/onboarding/schemas.js +257 -0
  529. package/dist/esm/onboarding/schemas.js.map +1 -0
  530. package/dist/esm/settings/constants.d.ts +206 -0
  531. package/dist/esm/settings/constants.d.ts.map +1 -0
  532. package/dist/esm/settings/constants.js +197 -0
  533. package/dist/esm/settings/constants.js.map +1 -0
  534. package/dist/esm/settings/index.d.ts +6 -0
  535. package/dist/esm/settings/index.d.ts.map +1 -0
  536. package/dist/esm/settings/index.js +11 -0
  537. package/dist/esm/settings/index.js.map +1 -0
  538. package/dist/esm/settings/schemas.d.ts +574 -0
  539. package/dist/esm/settings/schemas.d.ts.map +1 -0
  540. package/dist/esm/settings/schemas.js +434 -0
  541. package/dist/esm/settings/schemas.js.map +1 -0
  542. package/dist/esm/settings/types.d.ts +79 -0
  543. package/dist/esm/settings/types.d.ts.map +1 -0
  544. package/dist/esm/settings/types.js +5 -0
  545. package/dist/esm/settings/types.js.map +1 -0
  546. package/dist/esm/sharing/constants.d.ts +216 -0
  547. package/dist/esm/sharing/constants.d.ts.map +1 -0
  548. package/dist/esm/sharing/constants.js +159 -0
  549. package/dist/esm/sharing/constants.js.map +1 -0
  550. package/dist/esm/sharing/enum.d.ts +5 -0
  551. package/dist/esm/sharing/enum.d.ts.map +1 -0
  552. package/dist/esm/sharing/enum.js +6 -0
  553. package/dist/esm/sharing/enum.js.map +1 -0
  554. package/dist/esm/sharing/grants.d.ts +490 -0
  555. package/dist/esm/sharing/grants.d.ts.map +1 -0
  556. package/dist/esm/sharing/grants.js +444 -0
  557. package/dist/esm/sharing/grants.js.map +1 -0
  558. package/dist/esm/sharing/groups.d.ts +410 -0
  559. package/dist/esm/sharing/groups.d.ts.map +1 -0
  560. package/dist/esm/sharing/groups.js +372 -0
  561. package/dist/esm/sharing/groups.js.map +1 -0
  562. package/dist/esm/sharing/index.d.ts +5 -0
  563. package/dist/esm/sharing/index.d.ts.map +1 -0
  564. package/dist/esm/sharing/index.js +11 -0
  565. package/dist/esm/sharing/index.js.map +1 -0
  566. package/dist/esm/sharing/schemas.d.ts +3 -0
  567. package/dist/esm/sharing/schemas.d.ts.map +1 -0
  568. package/dist/esm/sharing/schemas.js +5 -0
  569. package/dist/esm/sharing/schemas.js.map +1 -0
  570. package/dist/esm/storage/constants.d.ts +111 -0
  571. package/dist/esm/storage/constants.d.ts.map +1 -0
  572. package/dist/esm/storage/constants.js +104 -0
  573. package/dist/esm/storage/constants.js.map +1 -0
  574. package/dist/esm/storage/index.d.ts +27 -0
  575. package/dist/esm/storage/index.d.ts.map +1 -0
  576. package/dist/esm/storage/index.js +23 -0
  577. package/dist/esm/storage/index.js.map +1 -0
  578. package/dist/esm/storage/objects-complete-upload.d.ts +19 -0
  579. package/dist/esm/storage/objects-complete-upload.d.ts.map +1 -0
  580. package/dist/esm/storage/objects-complete-upload.js +16 -0
  581. package/dist/esm/storage/objects-complete-upload.js.map +1 -0
  582. package/dist/esm/storage/objects-download-url.d.ts +17 -0
  583. package/dist/esm/storage/objects-download-url.d.ts.map +1 -0
  584. package/dist/esm/storage/objects-download-url.js +13 -0
  585. package/dist/esm/storage/objects-download-url.js.map +1 -0
  586. package/dist/esm/storage/objects-init-upload.d.ts +39 -0
  587. package/dist/esm/storage/objects-init-upload.d.ts.map +1 -0
  588. package/dist/esm/storage/objects-init-upload.js +37 -0
  589. package/dist/esm/storage/objects-init-upload.js.map +1 -0
  590. package/dist/esm/storage/objects-list-query.d.ts +50 -0
  591. package/dist/esm/storage/objects-list-query.d.ts.map +1 -0
  592. package/dist/esm/storage/objects-list-query.js +20 -0
  593. package/dist/esm/storage/objects-list-query.js.map +1 -0
  594. package/dist/esm/storage/objects-object-response.d.ts +49 -0
  595. package/dist/esm/storage/objects-object-response.d.ts.map +1 -0
  596. package/dist/esm/storage/objects-object-response.js +51 -0
  597. package/dist/esm/storage/objects-object-response.js.map +1 -0
  598. package/dist/esm/storage/objects-update-metadata.d.ts +16 -0
  599. package/dist/esm/storage/objects-update-metadata.d.ts.map +1 -0
  600. package/dist/esm/storage/objects-update-metadata.js +11 -0
  601. package/dist/esm/storage/objects-update-metadata.js.map +1 -0
  602. package/dist/esm/storage/schemas.d.ts +13 -0
  603. package/dist/esm/storage/schemas.d.ts.map +1 -0
  604. package/dist/esm/storage/schemas.js +19 -0
  605. package/dist/esm/storage/schemas.js.map +1 -0
  606. package/dist/esm/storage/settings-schemas.d.ts +188 -0
  607. package/dist/esm/storage/settings-schemas.d.ts.map +1 -0
  608. package/dist/esm/storage/settings-schemas.js +220 -0
  609. package/dist/esm/storage/settings-schemas.js.map +1 -0
  610. package/dist/esm/storage/storage-bucket-provision.d.ts +152 -0
  611. package/dist/esm/storage/storage-bucket-provision.d.ts.map +1 -0
  612. package/dist/esm/storage/storage-bucket-provision.js +213 -0
  613. package/dist/esm/storage/storage-bucket-provision.js.map +1 -0
  614. package/dist/esm/storage/storage-config-response.d.ts +99 -0
  615. package/dist/esm/storage/storage-config-response.d.ts.map +1 -0
  616. package/dist/esm/storage/storage-config-response.js +170 -0
  617. package/dist/esm/storage/storage-config-response.js.map +1 -0
  618. package/dist/esm/storage/storage-config-update.d.ts +46 -0
  619. package/dist/esm/storage/storage-config-update.d.ts.map +1 -0
  620. package/dist/esm/storage/storage-config-update.js +130 -0
  621. package/dist/esm/storage/storage-config-update.js.map +1 -0
  622. package/dist/esm/storage/storage-connection-test.d.ts +129 -0
  623. package/dist/esm/storage/storage-connection-test.d.ts.map +1 -0
  624. package/dist/esm/storage/storage-connection-test.js +241 -0
  625. package/dist/esm/storage/storage-connection-test.js.map +1 -0
  626. package/dist/esm/storage/storage-status.d.ts +16 -0
  627. package/dist/esm/storage/storage-status.d.ts.map +1 -0
  628. package/dist/esm/storage/storage-status.js +20 -0
  629. package/dist/esm/storage/storage-status.js.map +1 -0
  630. package/dist/esm/telemetry/config.d.ts +4 -0
  631. package/dist/esm/telemetry/config.d.ts.map +1 -1
  632. package/dist/esm/telemetry/config.js +16 -2
  633. package/dist/esm/telemetry/config.js.map +1 -1
  634. package/dist/esm/telemetry/connection.d.ts +1 -1
  635. package/dist/esm/telemetry/constants.d.ts +378 -6
  636. package/dist/esm/telemetry/constants.d.ts.map +1 -1
  637. package/dist/esm/telemetry/constants.js +288 -4
  638. package/dist/esm/telemetry/constants.js.map +1 -1
  639. package/dist/esm/telemetry/dashboard.d.ts +188 -17
  640. package/dist/esm/telemetry/dashboard.d.ts.map +1 -1
  641. package/dist/esm/telemetry/dashboard.js +61 -3
  642. package/dist/esm/telemetry/dashboard.js.map +1 -1
  643. package/dist/esm/telemetry/index.d.ts +4 -4
  644. package/dist/esm/telemetry/index.d.ts.map +1 -1
  645. package/dist/esm/telemetry/index.js +2 -2
  646. package/dist/esm/telemetry/index.js.map +1 -1
  647. package/dist/esm/telemetry/presentation.d.ts +243 -0
  648. package/dist/esm/telemetry/presentation.d.ts.map +1 -0
  649. package/dist/esm/telemetry/presentation.js +297 -0
  650. package/dist/esm/telemetry/presentation.js.map +1 -0
  651. package/dist/esm/telemetry/query.d.ts +2 -2
  652. package/dist/esm/telemetry/schemas.d.ts +5 -2
  653. package/dist/esm/telemetry/schemas.d.ts.map +1 -1
  654. package/dist/esm/telemetry/schemas.js +3 -1
  655. package/dist/esm/telemetry/schemas.js.map +1 -1
  656. package/dist/esm/telemetry/stack.d.ts +5 -5
  657. package/dist/esm/telemetry/store.d.ts +111 -0
  658. package/dist/esm/telemetry/store.d.ts.map +1 -0
  659. package/dist/esm/telemetry/store.js +80 -0
  660. package/dist/esm/telemetry/store.js.map +1 -0
  661. package/dist/esm/user-data/constants.d.ts +157 -0
  662. package/dist/esm/user-data/constants.d.ts.map +1 -0
  663. package/dist/esm/user-data/constants.js +134 -0
  664. package/dist/esm/user-data/constants.js.map +1 -0
  665. package/dist/esm/user-data/index.d.ts +5 -0
  666. package/dist/esm/user-data/index.d.ts.map +1 -0
  667. package/dist/esm/user-data/index.js +7 -0
  668. package/dist/esm/user-data/index.js.map +1 -0
  669. package/dist/esm/user-data/schemas.d.ts +306 -0
  670. package/dist/esm/user-data/schemas.d.ts.map +1 -0
  671. package/dist/esm/user-data/schemas.js +330 -0
  672. package/dist/esm/user-data/schemas.js.map +1 -0
  673. package/package.json +151 -1
@@ -0,0 +1,703 @@
1
+ // =============================================================================
2
+ // Jobs: the admin job routes' wire shapes (issue #734, PP-8.2)
3
+ // =============================================================================
4
+ //
5
+ // `GET /api/admin/jobs` (list query and row), `/stats`, `/insights` and the
6
+ // bulk actions' bodies and results, as zod schemas. Moved verbatim (comments
7
+ // included) from `@marinoscar/platform-api/jobs`'s dto files, which now wrap
8
+ // these with `createZodDto`. Node result schemas are NOT here: they stay with
9
+ // their handlers and cross to nodes as JSON Schema (`GET /api/nodes/job-types`).
10
+ // =============================================================================
11
+ import { z } from 'zod';
12
+ import { DEFAULT_INSIGHTS_WINDOW_DAYS, JOB_ETA_BASES, JOB_REASON_PATTERN, JOB_STATUSES, MAX_INSIGHTS_WINDOW_DAYS, PROCESSED_WITHIN_VALUES, } from './constants.js';
13
+ /**
14
+ * A job reason id: a string of the shape {@link JOB_REASON_PATTERN}, not an
15
+ * enum, so an app's `registerJobReason` ids pass. Whether an id is registered
16
+ * is checked where a job is enqueued, never in this schema.
17
+ *
18
+ * @stability experimental
19
+ */
20
+ export const jobReasonSchema = z
21
+ .string()
22
+ .regex(JOB_REASON_PATTERN, 'A job reason is 2 to 48 lower-case letters, digits, "_", "." or "-", starting with a letter');
23
+ // -----------------------------------------------------------------------------
24
+ // From job-response.dto.ts: One `jobs` row, as the admin API publishes it (issue #264, epic #254)
25
+ // -----------------------------------------------------------------------------
26
+ // =============================================================================
27
+ // One `jobs` row, as the admin API publishes it (issue #264, epic #254)
28
+ // =============================================================================
29
+ //
30
+ // This schema describes the JSON an operator receives, NOT the Prisma model.
31
+ // The two differ in three deliberate ways, and each one is a decision rather
32
+ // than an oversight:
33
+ //
34
+ // 1. TIMESTAMPS ARE ISO STRINGS, not `Date`s. `JobAdminService` hands the
35
+ // controller the Prisma row and the serializer turns every `Date` into an
36
+ // ISO-8601 string on the way out. Documenting `z.date()` here would
37
+ // publish a type no HTTP client can ever receive. This mirrors
38
+ // `allowlist/dto/allowlist-response.dto.ts`, which describes its own
39
+ // response the same way and for the same reason.
40
+ //
41
+ // 2. `typeLabel` IS ADDED. `type` is a machine key (`'example.echo'`) and is
42
+ // what every filter matches on, so it must stay on the wire verbatim. The
43
+ // label is resolved server-side through `jobTypeLabel()` rather than
44
+ // shipped as a map the client joins against, because that helper's whole
45
+ // contract is "an unmapped type renders as itself, never blank" (see
46
+ // `job-type-labels.ts`) — and a client doing its own lookup is a client
47
+ // that can forget the `?? type` fallback and render an empty cell for
48
+ // exactly the job types a fork cares most about.
49
+ //
50
+ // 3. `payload` IS OMITTED, and this is the one worth arguing. A job's
51
+ // payload is arbitrary application JSONB with no size bound anywhere in
52
+ // the schema; a hundred rows of it is a response whose size is set by
53
+ // whatever a fork's largest handler input happens to be, on an endpoint
54
+ // that a dashboard polls. The fields an operator actually triages with —
55
+ // `type`, `subjectType`/`subjectId`, `attempts`, `lastError`, the
56
+ // timestamps — are all here, and `subjectType`/`subjectId` exist
57
+ // precisely so that "which thing was this job about" is answerable
58
+ // without reading the payload. A later per-job detail route can publish
59
+ // the payload for ONE row, where its size is bounded by construction;
60
+ // putting it in a paginated list is the shape that cannot be made safe.
61
+ //
62
+ // These DTO classes are documentation, not runtime validation. Nothing parses
63
+ // a response through them — `createZodDto` is used because it is how every
64
+ // other schema in this API reaches the OpenAPI document.
65
+ // =============================================================================
66
+ /**
67
+ * One `jobs` row as `GET /api/admin/jobs` lists it (no payload, no claim token).
68
+ *
69
+ * @stability experimental
70
+ */
71
+ export const jobSchema = z.object({
72
+ /** The job id (UUID). */
73
+ id: z.uuid(),
74
+ /** The machine key a handler is registered under; what `type=` filters on. */
75
+ type: z.string(),
76
+ /** `type` run through `jobTypeLabel()`; equal to `type` when unmapped. */
77
+ typeLabel: z.string(),
78
+ /** What this job is about, when the enqueuer said so. */
79
+ subjectType: z.string().nullable(),
80
+ /** Which one, when the enqueuer named a subject. */
81
+ subjectId: z.string().nullable(),
82
+ /**
83
+ * The active-dedup key. Non-null only when the enqueuer wanted collapsing;
84
+ * see `jobs.service.ts` for why a NULL key can never collide.
85
+ */
86
+ dedupKey: z.string().nullable(),
87
+ /** Lifecycle status: `pending`, `running`, `succeeded` or `failed`. */
88
+ status: z.enum(JOB_STATUSES),
89
+ /** Why it was queued: a built-in (`upload`, `rerun`, `backfill`) or an app's registered reason. */
90
+ reason: jobReasonSchema,
91
+ /** `reason` run through `jobReasonLabel()`; equal to `reason` when unregistered. */
92
+ reasonLabel: z.string(),
93
+ /** Ascending is more urgent; the claim orders by it first. */
94
+ priority: z.number().int(),
95
+ /** The provider throttle bucket the work ran under, when it calls a rate-limited provider. */
96
+ providerKey: z.string().nullable(),
97
+ /** The model version the work ran under, when there is one. */
98
+ modelVersion: z.string().nullable(),
99
+ /** Attempts STARTED, charged at claim time — not attempts that reported back. */
100
+ attempts: z.number().int(),
101
+ /** The last failure's message, bounded; never secret material. */
102
+ lastError: z.string().nullable(),
103
+ /** When it was queued (ISO 8601). */
104
+ createdAt: z.iso.datetime(),
105
+ /** When the current (or last) attempt started (ISO 8601). */
106
+ startedAt: z.iso.datetime().nullable(),
107
+ /** When it reached a terminal status (ISO 8601). */
108
+ finishedAt: z.iso.datetime().nullable(),
109
+ /** When set in the future on a `pending` row, the job is in backoff. */
110
+ scheduledFor: z.iso.datetime().nullable(),
111
+ /** When a provider last rate-limited it (ISO 8601). */
112
+ rateLimitedAt: z.iso.datetime().nullable(),
113
+ /** Rate-limit deferrals so far; not charged against `attempts`. */
114
+ rateLimitHits: z.number().int(),
115
+ /** Ownership, while a row is claimed. All three are cleared by a retry. */
116
+ claimedByNodeId: z.uuid().nullable(),
117
+ /** When the current claim's lease runs out (ISO 8601). */
118
+ leaseExpiresAt: z.iso.datetime().nullable(),
119
+ /** `server` or `node`: who runs (or ran) the current attempt. */
120
+ executor: z.string().nullable(),
121
+ /**
122
+ * The organization the work belongs to (#734), or `null` for a
123
+ * deployment-wide (system) job such as housekeeping.
124
+ */
125
+ orgId: z.uuid().nullable(),
126
+ });
127
+ // -----------------------------------------------------------------------------
128
+ // From job-list-query.dto.ts: The job list's filters (issue #264, epic #254)
129
+ // -----------------------------------------------------------------------------
130
+ // =============================================================================
131
+ // The job list's filters (issue #264, epic #254)
132
+ // =============================================================================
133
+ //
134
+ // Seven query parameters, every one of which exists because an operator with a
135
+ // misbehaving queue asks a specific question. The three that are more than a
136
+ // plain column match are documented individually below; the rest (`type`,
137
+ // `subjectType`, `subjectId`, `page`, `pageSize`) are exactly what they look
138
+ // like, and `page`/`pageSize` are copied field-for-field from
139
+ // `users/dto/user-list-query.dto.ts` so that every paginated list in this API
140
+ // takes the same names and enforces the same 100-row ceiling.
141
+ //
142
+ // -----------------------------------------------------------------------------
143
+ // `scheduled` IS A BOOLEAN THAT OVERRIDES `status`, NOT A FIFTH STATUS
144
+ // -----------------------------------------------------------------------------
145
+ //
146
+ // "In backoff" is not a status — it is a `pending` row whose `scheduled_for`
147
+ // is still in the future, which is how `job-terminal.service.ts` records a
148
+ // retry and how `provider-throttle.service.ts` records a rate-limit deferral.
149
+ // There was a real temptation to publish it as `status=scheduled`, and it was
150
+ // rejected: `status` is a database enum with four values, a filter value that
151
+ // is not one of them cannot round-trip against a row, and a client would then
152
+ // have a `status` field whose vocabulary differs from the `status` field on
153
+ // every row it receives.
154
+ //
155
+ // So it is a separate boolean, and `scheduled=true` FORCES `status=pending`
156
+ // rather than intersecting with whatever `status` was also sent. The
157
+ // alternative — honouring both, so `?scheduled=true&status=failed` returns
158
+ // nothing — is technically defensible and practically useless: the request is
159
+ // a contradiction, and answering a contradiction with an empty page tells the
160
+ // operator that no such job exists, when what is true is that no such job CAN
161
+ // exist. Overriding answers the question they meant. `JobAdminService.list`
162
+ // is where that precedence is applied, so it is one rule in one place.
163
+ //
164
+ // -----------------------------------------------------------------------------
165
+ // `processedWithin` IS AN ACTIVITY WINDOW, NOT A `createdAt` WINDOW
166
+ // -----------------------------------------------------------------------------
167
+ //
168
+ // It filters on `COALESCE(finished_at, created_at)`: when a job last did
169
+ // something, falling back to when it appeared if it has not finished. A plain
170
+ // `createdAt >= …` window would hide the single most interesting row on the
171
+ // dashboard — a job enqueued two days ago that failed ninety seconds ago —
172
+ // from the "last 4 hours" view, which is the view an operator opens while the
173
+ // incident is happening.
174
+ //
175
+ // Prisma has no `COALESCE` in a `where`, so it is expressed as the two
176
+ // disjoint cases, `{ finishedAt: { gte } }` OR `{ finishedAt: null, createdAt:
177
+ // { gte } }`. They are disjoint because the second pins `finishedAt` to null,
178
+ // so no row can match both and no row is double-counted by a `count`.
179
+ //
180
+ // `all` is the DEFAULT and is a real value rather than an absent parameter:
181
+ // an operator hunting a rare historical failure needs a way to say "no window"
182
+ // that is visible in the URL, and a dashboard needs a value to put in its
183
+ // dropdown. Making a window the default would mean the unfiltered list
184
+ // silently hides rows.
185
+ // =============================================================================
186
+ /**
187
+ * The query of `GET /api/admin/jobs`: filters, the activity window and pagination.
188
+ *
189
+ * @stability experimental
190
+ */
191
+ export const jobListQuerySchema = z.object({
192
+ /** The 1-based page; default 1. */
193
+ page: z.coerce.number().int().min(1).default(1),
194
+ /** Rows per page; default 20, at most 100. */
195
+ pageSize: z.coerce.number().int().min(1).max(100).default(20),
196
+ /** Only jobs in this status. */
197
+ status: z.enum(JOB_STATUSES).optional(),
198
+ /** Only jobs of this type (an exact match on the machine key). */
199
+ type: z.string().min(1).max(200).optional(),
200
+ /** Only jobs about this kind of subject. */
201
+ subjectType: z.string().min(1).max(200).optional(),
202
+ /** Only jobs about this subject. */
203
+ subjectId: z.string().min(1).max(200).optional(),
204
+ /**
205
+ * Only this organization's jobs (#734). Omitted, every job is listed,
206
+ * deployment-wide system jobs (`orgId: null`) included.
207
+ */
208
+ orgId: z.uuid().optional(),
209
+ /**
210
+ * `z.enum(['true','false']).transform(...)` and NOT `z.coerce.boolean()`.
211
+ *
212
+ * Every query parameter arrives as a string, and `Boolean('false')` is
213
+ * `true` — so a coercing schema would turn the explicit opt-OUT
214
+ * `?scheduled=false` into the opt-IN, which is the worst possible direction
215
+ * for a filter that overrides `status`. The same reasoning, and the same
216
+ * shape, as `notifications/dto/notification.dto.ts` and
217
+ * `users/dto/user-list-query.dto.ts`.
218
+ */
219
+ scheduled: z.enum(['true', 'false'])
220
+ .transform((value) => value === 'true')
221
+ .optional(),
222
+ /** Only jobs that finished (or, unfinished, were created) within this window; default `all`. */
223
+ processedWithin: z.enum(PROCESSED_WITHIN_VALUES).default('all'),
224
+ });
225
+ // -----------------------------------------------------------------------------
226
+ // From job-stats.dto.ts: The queue's summary (issue #264, epic #254)
227
+ // -----------------------------------------------------------------------------
228
+ // =============================================================================
229
+ // The queue's summary (issue #264, epic #254)
230
+ // =============================================================================
231
+ //
232
+ // What a dashboard polls: how much work exists, in what state, of what type,
233
+ // and how much of it is in trouble. One request, because the alternative — a
234
+ // count endpoint per tile — is five round trips whose answers are taken at
235
+ // five different instants, so the tiles do not add up and an operator learns
236
+ // to distrust the page.
237
+ //
238
+ // -----------------------------------------------------------------------------
239
+ // EVERY STATUS KEY IS ALWAYS PRESENT, INCLUDING THE ZEROES
240
+ // -----------------------------------------------------------------------------
241
+ //
242
+ // `byStatus` and each entry's `byStatus` are zero-filled from `JOB_STATUSES`
243
+ // before the `groupBy` rows are folded in. A `GROUP BY` returns no row for a
244
+ // status nothing is in, so the natural shape of this response is one where
245
+ // `failed` is simply absent on a healthy queue — and a client rendering
246
+ // `stats.byStatus.failed` then shows `undefined` exactly when everything is
247
+ // fine. Zero-filling makes "no failures" and "the key is missing" the same
248
+ // thing on the wire, which is what a tile can render without a fallback.
249
+ //
250
+ // -----------------------------------------------------------------------------
251
+ // `stuckThresholdMinutes` IS PUBLISHED BECAUSE `stuckRunning` IS MEANINGLESS
252
+ // WITHOUT IT
253
+ // -----------------------------------------------------------------------------
254
+ //
255
+ // `stuckRunning` is a count against a threshold the caller cannot see: it
256
+ // lives in the `jobs.stuckThresholdMinutes` system setting, it is read through
257
+ // `JobStuckService.getStuckThresholdMinutes()`, and it can be changed while
258
+ // the dashboard is open. A UI that showed "4 stuck" and had to hardcode "(over
259
+ // 30 minutes)" would go on saying 30 after an operator moved the setting to 5,
260
+ // which turns a status line into a false one. Sending the number that was
261
+ // ACTUALLY used for this response removes that possibility.
262
+ //
263
+ // It is also what the `reset-stuck` control needs to prefill its "older than"
264
+ // input with the value an empty body would use.
265
+ // =============================================================================
266
+ /**
267
+ * Counts per status, zero-filled — every key is always present.
268
+ *
269
+ * @stability experimental
270
+ */
271
+ export const jobStatusCountsSchema = z.object({
272
+ /** Jobs waiting to be claimed (including those in backoff). */
273
+ pending: z.number().int(),
274
+ /** Jobs claimed and in progress. */
275
+ running: z.number().int(),
276
+ /** Jobs that finished successfully. */
277
+ succeeded: z.number().int(),
278
+ /** Jobs that failed permanently. */
279
+ failed: z.number().int(),
280
+ });
281
+ /**
282
+ * One row of the by-type breakdown.
283
+ *
284
+ * Ordered by `total` descending then `type` ascending in the service, so the
285
+ * busiest type is first and the order is stable between two polls that see the
286
+ * same counts — a table whose rows reshuffle every two seconds is unreadable.
287
+ *
288
+ * @stability experimental
289
+ */
290
+ export const jobTypeStatsSchema = z.object({
291
+ /** The job type. */
292
+ type: z.string(),
293
+ /** `type` through `jobTypeLabel()`; equal to `type` when unmapped. */
294
+ label: z.string(),
295
+ /** Every row of this type. */
296
+ total: z.number().int(),
297
+ /** Its rows per status. */
298
+ byStatus: jobStatusCountsSchema,
299
+ });
300
+ /**
301
+ * The body of `GET /api/admin/jobs/stats`: the queue's summary.
302
+ *
303
+ * @stability experimental
304
+ */
305
+ export const jobStatsSchema = z.object({
306
+ /** Every `jobs` row, whatever its status or age. */
307
+ total: z.number().int(),
308
+ /** Every row per status. */
309
+ byStatus: jobStatusCountsSchema,
310
+ /** Per-type breakdown, busiest first. */
311
+ byType: z.array(jobTypeStatsSchema),
312
+ /**
313
+ * `pending` rows whose `scheduledFor` is still in the future — retry
314
+ * backoff and rate-limit deferrals. A subset of `byStatus.pending`, never a
315
+ * fifth status; see `job-list-query.dto.ts` for why that distinction is
316
+ * kept on the wire.
317
+ */
318
+ scheduled: z.number().int(),
319
+ /**
320
+ * `running` rows the lease reaper would reclaim right now, counted with the
321
+ * reaper's own `stuckRunningWhere()` so the dashboard and the sweeper can
322
+ * never disagree about which rows those are.
323
+ */
324
+ stuckRunning: z.number().int(),
325
+ /** The threshold `stuckRunning` was computed against, in minutes. */
326
+ stuckThresholdMinutes: z.number().int().positive(),
327
+ /** When these counts were taken. Every field above shares this instant. */
328
+ generatedAt: z.iso.datetime(),
329
+ });
330
+ // -----------------------------------------------------------------------------
331
+ // From job-insights.dto.ts: The queue's insights response (issue #265, epic #254)
332
+ // -----------------------------------------------------------------------------
333
+ // =============================================================================
334
+ // The queue's insights response (issue #265, epic #254)
335
+ // =============================================================================
336
+ //
337
+ // `stats` (#264) answers "what is the queue doing right now". This answers the
338
+ // two questions it structurally cannot: "how long will this take" and "is it
339
+ // getting faster or slower". One response, four blocks, because an operator
340
+ // reading a backlog wants the backlog, its recent speed and the resulting
341
+ // estimate to have been taken at the SAME instant — three endpoints polled
342
+ // separately produce an ETA computed from a queue depth that has already
343
+ // changed, which is how a progress number ends up going backwards.
344
+ //
345
+ // -----------------------------------------------------------------------------
346
+ // `avgMs`, `p50Ms` AND `p95Ms` ARE NULLABLE, AND ZERO WOULD BE A LIE
347
+ // -----------------------------------------------------------------------------
348
+ //
349
+ // A type with no succeeded jobs inside the window has no average duration.
350
+ // The tempting shape is `avgMs: 0`, and it is wrong twice over: a UI renders
351
+ // "0 ms" as a fact ("this job type is instant"), and the ETA below MULTIPLIES
352
+ // this number by a queue depth — so a zero average turns a thousand queued
353
+ // jobs into an estimate of "done already". `null` is the only value a client
354
+ // cannot accidentally do arithmetic on, and it is what makes the ETA's
355
+ // three-step fallback (below) necessary rather than optional.
356
+ //
357
+ // `samples` is therefore the field that says whether the other three mean
358
+ // anything, and it is always a number.
359
+ //
360
+ // -----------------------------------------------------------------------------
361
+ // `basis` EXISTS BECAUSE AN ESTIMATE MUST SAY HOW MUCH OF IT IS REAL
362
+ // -----------------------------------------------------------------------------
363
+ //
364
+ // Every ETA in the response is `remaining x avgMs / concurrency`, but `avgMs`
365
+ // can come from three very different places:
366
+ //
367
+ // - `live` — this type's OWN succeeded jobs inside the window. The
368
+ // estimate is measurement.
369
+ // - `partial` — the overall average across every type, because this type has
370
+ // no history of its own yet. The estimate is an analogy, and a
371
+ // bad one whenever job types differ in cost (they always do).
372
+ // - `none` — nothing has ever succeeded inside the window, so the number
373
+ // is a shipped constant. The estimate is a placeholder.
374
+ //
375
+ // Publishing only the milliseconds would make those three indistinguishable on
376
+ // the wire, and a UI would render all of them with the same confidence. With
377
+ // `basis` a client can say "about 4 minutes", "roughly 4 minutes, based on
378
+ // other job types" and "no idea yet" from one field — which is the difference
379
+ // between a useful estimate and a number nobody believes twice.
380
+ //
381
+ // -----------------------------------------------------------------------------
382
+ // `lifetime` HAS COUNTS AND AVERAGES AND NO PERCENTILES, DELIBERATELY
383
+ // -----------------------------------------------------------------------------
384
+ //
385
+ // Lifetime numbers are `JobStatsRollup` (the purged rows, #263) merged with
386
+ // the rows still in the table. A rollup row is four accumulators — two counts,
387
+ // a sum and a sample count — and those four are exactly the quantities that
388
+ // SURVIVE summarisation: counts add, and a mean can be reconstructed from a
389
+ // sum and a denominator.
390
+ //
391
+ // A percentile cannot. p95 is a position in a sorted distribution, and the
392
+ // distribution was deleted; nothing about `sumDurationMs` and
393
+ // `durationSamples` can recover it, and no scheme of storing "the p95 at purge
394
+ // time" and averaging it with a live p95 produces the p95 of the union — it
395
+ // produces a number that looks like one. So the rollup does not store
396
+ // percentiles and this block does not publish them. `history` publishes real
397
+ // percentiles over a bounded window, where the rows still exist to be sorted.
398
+ //
399
+ // The honest split is therefore: `history` = distribution over a window,
400
+ // `lifetime` = totals over all time. Neither pretends to be the other.
401
+ // =============================================================================
402
+ // ---------------------------------------------------------------------------
403
+ // Request
404
+ // ---------------------------------------------------------------------------
405
+ /**
406
+ * The query of `GET /api/admin/jobs/insights`: the history window in days.
407
+ *
408
+ * @stability experimental
409
+ */
410
+ export const jobInsightsQuerySchema = z.object({
411
+ /**
412
+ * How many days of succeeded jobs the `history` block covers.
413
+ *
414
+ * `z.coerce` because every query parameter arrives as a string. The bounds
415
+ * are the schema's, so an out-of-range value is a clean 400 from the global
416
+ * `ZodValidationPipe` before this service ever runs a query.
417
+ */
418
+ windowDays: z.coerce
419
+ .number()
420
+ .int()
421
+ .min(1)
422
+ .max(MAX_INSIGHTS_WINDOW_DAYS)
423
+ .default(DEFAULT_INSIGHTS_WINDOW_DAYS),
424
+ });
425
+ // ---------------------------------------------------------------------------
426
+ // Response
427
+ // ---------------------------------------------------------------------------
428
+ /**
429
+ * Durations over one set of succeeded jobs. See the header on the nulls.
430
+ *
431
+ * @stability experimental
432
+ */
433
+ export const jobDurationStatsSchema = z.object({
434
+ /** Succeeded, fully timestamped jobs in the window. 0 means the rest is null. */
435
+ samples: z.number().int(),
436
+ /** Mean duration, or `null` when `samples` is 0. */
437
+ avgMs: z.number().nullable(),
438
+ /** Median, via `PERCENTILE_CONT(0.5)`. `null` when `samples` is 0. */
439
+ p50Ms: z.number().nullable(),
440
+ /**
441
+ * 95th percentile, via `PERCENTILE_CONT(0.95)` — INTERPOLATED, not the
442
+ * nearest sample (`PERCENTILE_DISC`), so a small sample set still moves the
443
+ * number continuously as jobs get slower rather than jumping between two
444
+ * observed durations.
445
+ */
446
+ p95Ms: z.number().nullable(),
447
+ /**
448
+ * Jobs succeeded per minute over the LAST HOUR — not over the window; see
449
+ * `THROUGHPUT_WINDOW_MS`. `history.throughputSince` publishes the instant it
450
+ * was measured from, so a client never has to hardcode "(last hour)".
451
+ */
452
+ throughputPerMin: z.number(),
453
+ });
454
+ /**
455
+ * Duration percentiles of one job type over the window.
456
+ *
457
+ * @stability experimental
458
+ */
459
+ export const jobTypeDurationStatsSchema = jobDurationStatsSchema.extend({
460
+ /** The job type. */
461
+ type: z.string(),
462
+ /** `type` through `jobTypeLabel()`; equal to `type` when unmapped. */
463
+ label: z.string(),
464
+ });
465
+ /**
466
+ * One job type's drain estimate.
467
+ *
468
+ * @stability experimental
469
+ */
470
+ export const jobEtaSchema = z.object({
471
+ /** The job type. */
472
+ type: z.string(),
473
+ /** Its display label (`jobTypeLabel`). */
474
+ label: z.string(),
475
+ /** Jobs of this type not yet finished: `pending + running`. */
476
+ pending: z.number().int(),
477
+ /** Jobs of this type running now. */
478
+ running: z.number().int(),
479
+ /** `pending + running`: what the estimate covers. */
480
+ remaining: z.number().int(),
481
+ /** The per-job average this estimate multiplied. Never null — see `basis`. */
482
+ avgMs: z.number(),
483
+ /** What the average came from: `live` (this window), `partial` (lifetime fallback) or `none`. */
484
+ basis: z.enum(JOB_ETA_BASES),
485
+ /** `remaining x avgMs / concurrency`, in milliseconds. */
486
+ estimatedMs: z.number(),
487
+ });
488
+ /**
489
+ * One job type's all-time totals (rollup plus live rows).
490
+ *
491
+ * @stability experimental
492
+ */
493
+ export const jobLifetimeStatsSchema = z.object({
494
+ /** The job type. */
495
+ type: z.string(),
496
+ /** Its display label (`jobTypeLabel`). */
497
+ label: z.string(),
498
+ /** Rollup (purged rows) plus the rows still in the table. Never both. */
499
+ succeeded: z.number().int(),
500
+ /** Failed, rollup plus live rows. */
501
+ failed: z.number().int(),
502
+ /** `succeeded + failed` — jobs that ran, whatever the outcome. */
503
+ total: z.number().int(),
504
+ /**
505
+ * `(rollup.sumDurationMs + liveSum) / (rollup.durationSamples + liveSamples)`,
506
+ * or `null` when nothing timed has ever succeeded for this type.
507
+ */
508
+ avgMs: z.number().nullable(),
509
+ /** The denominator above, published so `avgMs` can be weighed. */
510
+ durationSamples: z.number().int(),
511
+ });
512
+ /**
513
+ * The body of `GET /api/admin/jobs/insights`: live counts, windowed history, lifetime totals and ETAs.
514
+ *
515
+ * @stability experimental
516
+ */
517
+ export const jobInsightsSchema = z.object({
518
+ /** The window actually used, after clamping. Echoed so a client can label it. */
519
+ windowDays: z.number().int(),
520
+ /** When every number below was taken. One instant for the whole response. */
521
+ generatedAt: z.iso.datetime(),
522
+ /**
523
+ * `JOBS_WORKER_CONCURRENCY` as this process reads it — the divisor every
524
+ * `eta.estimatedMs` used. Published for the same reason `stats` publishes
525
+ * `stuckThresholdMinutes`: an estimate computed against a number the caller
526
+ * cannot see is one a UI has to guess at, and it would guess wrong the
527
+ * moment a deployment changed the setting.
528
+ */
529
+ concurrency: z.number().int(),
530
+ /** The queue right now: the same counts as `GET /api/admin/jobs/stats`. */
531
+ live: z.object({
532
+ /** Every `jobs` row now. */
533
+ total: z.number().int(),
534
+ /** Every row per status. */
535
+ byStatus: jobStatusCountsSchema,
536
+ /** Per-type breakdown, busiest first. */
537
+ byType: z.array(jobTypeStatsSchema),
538
+ /** `pending` rows whose `scheduledFor` is still in the future. */
539
+ scheduled: z.number().int(),
540
+ /**
541
+ * Non-terminal rows that have been deferred by a provider rate limit at
542
+ * least once (`rateLimitHits > 0`). Terminal rows are excluded because a
543
+ * job that finished is no longer being held up by anything.
544
+ */
545
+ rateLimited: z.number().int(),
546
+ /**
547
+ * Rows that have been claimed more than once (`attempts > 1`) — the
548
+ * queue's flakiness signal, and the predicate `jobs_attempts_gt1_idx` was
549
+ * built for. Includes terminal rows: "how much of this history needed a
550
+ * second go" is the question.
551
+ */
552
+ retried: z.number().int(),
553
+ }),
554
+ /** Duration distribution of succeeded jobs over the window. */
555
+ history: z.object({
556
+ /** The oldest `finishedAt` the percentiles cover. */
557
+ windowStart: z.iso.datetime(),
558
+ /** The instant `throughputPerMin` counts from — one hour before `generatedAt`. */
559
+ throughputSince: z.iso.datetime(),
560
+ /**
561
+ * Every succeeded job in the window, as ONE distribution.
562
+ *
563
+ * Not derivable from `byType`: a mean could be re-weighted, but p50 and
564
+ * p95 cannot be combined from per-group percentiles at all. It is computed
565
+ * in the same scan as `byType` (a `GROUPING SETS` grand total), so the two
566
+ * always describe exactly the same rows.
567
+ */
568
+ overall: jobDurationStatsSchema,
569
+ /** Per-type duration percentiles over the window. */
570
+ byType: z.array(jobTypeDurationStatsSchema),
571
+ }),
572
+ /** One entry per type with work outstanding, slowest estimate first. */
573
+ eta: z.array(jobEtaSchema),
574
+ /** All-time totals per type: rollup + live, counts and averages only. */
575
+ lifetime: z.array(jobLifetimeStatsSchema),
576
+ });
577
+ /**
578
+ * The result of resetting the job history.
579
+ *
580
+ * @stability experimental
581
+ */
582
+ export const resetHistoryResultSchema = z.object({
583
+ /**
584
+ * `JobStatsRollup` rows deleted.
585
+ *
586
+ * Rows, not jobs: one row per job type, each holding that type's whole
587
+ * purged history. A deployment with four job types reports `4` however many
588
+ * millions of jobs those four accumulators summarised.
589
+ */
590
+ reset: z.number().int(),
591
+ });
592
+ // -----------------------------------------------------------------------------
593
+ // From job-actions.dto.ts: The bodies and results of the four job actions (issue #264, epic #254)
594
+ // -----------------------------------------------------------------------------
595
+ // =============================================================================
596
+ // The bodies and results of the four job actions (issue #264, epic #254)
597
+ // =============================================================================
598
+ //
599
+ // Two request bodies, both entirely optional, and three result shapes. They
600
+ // share a file because each is a handful of numbers and because splitting them
601
+ // would put the request and the result of the same operation in different
602
+ // places, which is exactly where they drift.
603
+ //
604
+ // -----------------------------------------------------------------------------
605
+ // `olderThanMinutes` HAS NO DEFAULT, AND THAT ABSENCE IS THE FEATURE
606
+ // -----------------------------------------------------------------------------
607
+ //
608
+ // `resetStuckSchema` gives `olderThanMinutes` no `.default(...)`, so an empty
609
+ // body parses to `{}` and `JobStuckService.resetStuck(undefined)` falls
610
+ // through to `getStuckThresholdMinutes()` — the `jobs.stuckThresholdMinutes`
611
+ // system setting, the same number the lease reaper's cron sweep uses.
612
+ //
613
+ // A default here — even `.default(30)`, even spelled as
614
+ // `DEFAULT_SYSTEM_SETTINGS.jobs.stuckThresholdMinutes` — would be a SECOND
615
+ // place the threshold is decided, and it would win: the parsed value is always
616
+ // defined, so the service's settings lookup would become dead code reachable
617
+ // only from the cron. An operator who moved the setting to 5 minutes would
618
+ // then find the dashboard button still sweeping at 30 and no way to tell why.
619
+ // The value is deliberately allowed to be `undefined` all the way down to the
620
+ // one function that knows where the number lives.
621
+ //
622
+ // The parameter still exists because there is a real use for it: sweeping
623
+ // tighter than the configured threshold during an incident, without changing a
624
+ // setting that the cron will then keep using afterwards. `0` is permitted and
625
+ // means "every running job that matches any recovery signal, at any age" —
626
+ // the lease signal in `stuckRunningWhere()` is independent of the threshold,
627
+ // so `0` is not a synonym for "everything running".
628
+ // =============================================================================
629
+ // ---------------------------------------------------------------------------
630
+ // Requests
631
+ // ---------------------------------------------------------------------------
632
+ /**
633
+ * The body of `POST /api/admin/jobs/retry-failed`.
634
+ *
635
+ * @stability experimental
636
+ */
637
+ export const retryFailedSchema = z.object({
638
+ /**
639
+ * Restrict the sweep to one job type. Omitted, every failed job is retried.
640
+ *
641
+ * A plain equality match on the machine key, not a prefix or a glob: `type`
642
+ * is what dispatch keys on, so "all the types starting with `billing.`" is a
643
+ * question about a naming convention this queue does not enforce.
644
+ */
645
+ type: z.string().min(1).max(200).optional(),
646
+ });
647
+ /**
648
+ * The body of `POST /api/admin/jobs/reset-stuck`.
649
+ *
650
+ * @stability experimental
651
+ */
652
+ export const resetStuckSchema = z.object({
653
+ /**
654
+ * Sweep rows stuck for longer than this many minutes.
655
+ *
656
+ * DELIBERATELY UNDEFAULTED — see the file header. Omitting it defers to the
657
+ * `jobs.stuckThresholdMinutes` system setting, which is the behaviour the
658
+ * cron sweep already has.
659
+ */
660
+ olderThanMinutes: z.coerce.number().int().min(0).max(60 * 24 * 365).optional(),
661
+ });
662
+ // ---------------------------------------------------------------------------
663
+ // Results
664
+ // ---------------------------------------------------------------------------
665
+ /**
666
+ * The result of `POST /api/admin/jobs/retry-failed`.
667
+ *
668
+ * @stability experimental
669
+ */
670
+ export const retryFailedResultSchema = z.object({
671
+ /** Rows moved back to `pending`. */
672
+ retried: z.number().int(),
673
+ /**
674
+ * Rows left `failed` because an active job already holds their dedup key.
675
+ *
676
+ * Not an error: a non-zero `skipped` means the work those rows describe is
677
+ * already queued or running, which is the outcome the retry was asking for.
678
+ * See `job-admin.service.ts` for why this is counted rather than thrown.
679
+ */
680
+ skipped: z.number().int(),
681
+ /**
682
+ * Failed rows still matching the scope after the sweep.
683
+ *
684
+ * Non-zero either because the batch cap was reached (run it again) or
685
+ * because everything left was skipped. A client can decide which by
686
+ * comparing against `skipped`.
687
+ */
688
+ remaining: z.number().int(),
689
+ });
690
+ /**
691
+ * The result of `POST /api/admin/jobs/reset-stuck`.
692
+ *
693
+ * @stability experimental
694
+ */
695
+ export const resetStuckResultSchema = z.object({
696
+ /** Rows requeued as `pending` for another executor to claim. */
697
+ reset: z.number().int(),
698
+ /** Rows failed permanently because their attempt budget was spent. */
699
+ failed: z.number().int(),
700
+ /** The threshold actually applied, whether it came from the body or settings. */
701
+ thresholdMinutes: z.number().int(),
702
+ });
703
+ //# sourceMappingURL=schemas.js.map