@synnaxlabs/client 0.53.0 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/.turbo/turbo-build.log +14 -8
  2. package/dist/client.cjs +48 -54
  3. package/dist/client.js +12360 -15511
  4. package/dist/src/access/action/index.d.ts +2 -0
  5. package/dist/src/access/action/index.d.ts.map +1 -0
  6. package/dist/src/access/{payload.d.ts → action/types.gen.d.ts} +2 -1
  7. package/dist/src/access/action/types.gen.d.ts.map +1 -0
  8. package/dist/src/access/enforce.d.ts +2 -2
  9. package/dist/src/access/enforce.d.ts.map +1 -1
  10. package/dist/src/access/external.d.ts +1 -1
  11. package/dist/src/access/external.d.ts.map +1 -1
  12. package/dist/src/access/policy/client.d.ts +233 -389
  13. package/dist/src/access/policy/client.d.ts.map +1 -1
  14. package/dist/src/access/policy/external.d.ts +1 -1
  15. package/dist/src/access/policy/external.d.ts.map +1 -1
  16. package/dist/src/access/policy/types.gen.d.ts +120 -0
  17. package/dist/src/access/policy/types.gen.d.ts.map +1 -0
  18. package/dist/src/access/role/client.d.ts +1 -1
  19. package/dist/src/access/role/client.d.ts.map +1 -1
  20. package/dist/src/access/role/external.d.ts +1 -1
  21. package/dist/src/access/role/external.d.ts.map +1 -1
  22. package/dist/src/access/role/types.gen.d.ts +34 -0
  23. package/dist/src/access/role/types.gen.d.ts.map +1 -0
  24. package/dist/src/arc/client.d.ts +2 -2
  25. package/dist/src/arc/client.d.ts.map +1 -1
  26. package/dist/src/arc/compiler/index.d.ts +2 -0
  27. package/dist/src/arc/compiler/index.d.ts.map +1 -0
  28. package/dist/src/arc/compiler/types.gen.d.ts +12 -0
  29. package/dist/src/arc/compiler/types.gen.d.ts.map +1 -0
  30. package/dist/src/arc/external.d.ts +6 -1
  31. package/dist/src/arc/external.d.ts.map +1 -1
  32. package/dist/src/arc/graph/index.d.ts +2 -0
  33. package/dist/src/arc/graph/index.d.ts.map +1 -0
  34. package/dist/src/arc/graph/types.gen.d.ts +644 -0
  35. package/dist/src/arc/graph/types.gen.d.ts.map +1 -0
  36. package/dist/src/arc/ir/index.d.ts +2 -0
  37. package/dist/src/arc/ir/index.d.ts.map +1 -0
  38. package/dist/src/arc/ir/types.gen.d.ts +2988 -0
  39. package/dist/src/arc/ir/types.gen.d.ts.map +1 -0
  40. package/dist/src/arc/module/index.d.ts +2 -0
  41. package/dist/src/arc/module/index.d.ts.map +1 -0
  42. package/dist/src/arc/module/types.gen.d.ts +1138 -0
  43. package/dist/src/arc/module/types.gen.d.ts.map +1 -0
  44. package/dist/src/arc/program/index.d.ts +2 -0
  45. package/dist/src/arc/program/index.d.ts.map +1 -0
  46. package/dist/src/arc/program/types.gen.d.ts +1138 -0
  47. package/dist/src/arc/program/types.gen.d.ts.map +1 -0
  48. package/dist/src/arc/text/index.d.ts +2 -0
  49. package/dist/src/arc/text/index.d.ts.map +1 -0
  50. package/dist/src/arc/text/types.gen.d.ts +8 -0
  51. package/dist/src/arc/text/types.gen.d.ts.map +1 -0
  52. package/dist/src/arc/types/index.d.ts +2 -0
  53. package/dist/src/arc/types/index.d.ts.map +1 -0
  54. package/dist/src/arc/types/types.gen.d.ts +237 -0
  55. package/dist/src/arc/types/types.gen.d.ts.map +1 -0
  56. package/dist/src/arc/types.gen.d.ts +2394 -0
  57. package/dist/src/arc/types.gen.d.ts.map +1 -0
  58. package/dist/src/channel/client.d.ts +5 -4
  59. package/dist/src/channel/client.d.ts.map +1 -1
  60. package/dist/src/channel/external.d.ts +1 -0
  61. package/dist/src/channel/external.d.ts.map +1 -1
  62. package/dist/src/channel/payload.d.ts +93 -178
  63. package/dist/src/channel/payload.d.ts.map +1 -1
  64. package/dist/src/channel/retriever.d.ts +3 -2
  65. package/dist/src/channel/retriever.d.ts.map +1 -1
  66. package/dist/src/channel/types.gen.d.ts +151 -0
  67. package/dist/src/channel/types.gen.d.ts.map +1 -0
  68. package/dist/src/channel/writer.d.ts +1 -1
  69. package/dist/src/channel/writer.d.ts.map +1 -1
  70. package/dist/src/client.d.ts.map +1 -1
  71. package/dist/src/cluster/index.d.ts +2 -0
  72. package/dist/src/cluster/index.d.ts.map +1 -0
  73. package/dist/src/cluster/types.gen.d.ts +4 -0
  74. package/dist/src/cluster/types.gen.d.ts.map +1 -0
  75. package/dist/src/control/state.d.ts +14 -9
  76. package/dist/src/control/state.d.ts.map +1 -1
  77. package/dist/src/device/client.d.ts +7 -12
  78. package/dist/src/device/client.d.ts.map +1 -1
  79. package/dist/src/device/external.d.ts +1 -1
  80. package/dist/src/device/external.d.ts.map +1 -1
  81. package/dist/src/device/types.gen.d.ts +163 -0
  82. package/dist/src/device/types.gen.d.ts.map +1 -0
  83. package/dist/src/framer/adapter.d.ts +2 -2
  84. package/dist/src/framer/adapter.d.ts.map +1 -1
  85. package/dist/src/framer/client.d.ts +7 -7
  86. package/dist/src/framer/client.d.ts.map +1 -1
  87. package/dist/src/framer/codec.d.ts +5 -5
  88. package/dist/src/framer/codec.d.ts.map +1 -1
  89. package/dist/src/framer/external.d.ts +1 -1
  90. package/dist/src/framer/external.d.ts.map +1 -1
  91. package/dist/src/framer/frame.d.ts +18 -18
  92. package/dist/src/framer/frame.d.ts.map +1 -1
  93. package/dist/src/framer/reader.d.ts +1 -1
  94. package/dist/src/framer/reader.d.ts.map +1 -1
  95. package/dist/src/framer/streamer.d.ts +177 -114
  96. package/dist/src/framer/streamer.d.ts.map +1 -1
  97. package/dist/src/framer/types.gen.d.ts +9 -0
  98. package/dist/src/framer/types.gen.d.ts.map +1 -0
  99. package/dist/src/framer/writer.d.ts +192 -128
  100. package/dist/src/framer/writer.d.ts.map +1 -1
  101. package/dist/src/group/client.d.ts +17 -17
  102. package/dist/src/group/client.d.ts.map +1 -1
  103. package/dist/src/group/external.d.ts +1 -1
  104. package/dist/src/group/external.d.ts.map +1 -1
  105. package/dist/src/group/types.gen.d.ts +23 -0
  106. package/dist/src/group/types.gen.d.ts.map +1 -0
  107. package/dist/src/label/client.d.ts +51 -72
  108. package/dist/src/label/client.d.ts.map +1 -1
  109. package/dist/src/label/payload.d.ts +30 -8
  110. package/dist/src/label/payload.d.ts.map +1 -1
  111. package/dist/src/lineplot/client.d.ts +2 -11
  112. package/dist/src/lineplot/client.d.ts.map +1 -1
  113. package/dist/src/lineplot/external.d.ts +1 -1
  114. package/dist/src/lineplot/external.d.ts.map +1 -1
  115. package/dist/src/lineplot/types.gen.d.ts +33 -0
  116. package/dist/src/lineplot/types.gen.d.ts.map +1 -0
  117. package/dist/src/log/client.d.ts +2 -11
  118. package/dist/src/log/client.d.ts.map +1 -1
  119. package/dist/src/log/external.d.ts +1 -1
  120. package/dist/src/log/external.d.ts.map +1 -1
  121. package/dist/src/log/types.gen.d.ts +33 -0
  122. package/dist/src/log/types.gen.d.ts.map +1 -0
  123. package/dist/src/ontology/client.d.ts +31 -31
  124. package/dist/src/ontology/payload.d.ts +74 -99
  125. package/dist/src/ontology/payload.d.ts.map +1 -1
  126. package/dist/src/ontology/types.gen.d.ts +30 -0
  127. package/dist/src/ontology/types.gen.d.ts.map +1 -0
  128. package/dist/src/ontology/writer.d.ts +80 -80
  129. package/dist/src/rack/client.d.ts +22 -11
  130. package/dist/src/rack/client.d.ts.map +1 -1
  131. package/dist/src/rack/external.d.ts +1 -1
  132. package/dist/src/rack/external.d.ts.map +1 -1
  133. package/dist/src/rack/types.gen.d.ts +72 -0
  134. package/dist/src/rack/types.gen.d.ts.map +1 -0
  135. package/dist/src/range/alias/types.gen.d.ts +14 -0
  136. package/dist/src/range/alias/types.gen.d.ts.map +1 -0
  137. package/dist/src/range/kv/types.gen.d.ts +13 -0
  138. package/dist/src/range/kv/types.gen.d.ts.map +1 -0
  139. package/dist/src/ranger/alias/client.d.ts +1 -1
  140. package/dist/src/ranger/alias/client.d.ts.map +1 -1
  141. package/dist/src/ranger/alias/external.d.ts +3 -1
  142. package/dist/src/ranger/alias/external.d.ts.map +1 -1
  143. package/dist/src/ranger/alias/payload.d.ts +5 -9
  144. package/dist/src/ranger/alias/payload.d.ts.map +1 -1
  145. package/dist/src/ranger/alias/payload.spec.d.ts +2 -0
  146. package/dist/src/ranger/alias/payload.spec.d.ts.map +1 -0
  147. package/dist/src/ranger/alias/types.gen.d.ts +14 -0
  148. package/dist/src/ranger/alias/types.gen.d.ts.map +1 -0
  149. package/dist/src/ranger/client.d.ts +10 -15
  150. package/dist/src/ranger/client.d.ts.map +1 -1
  151. package/dist/src/ranger/external.d.ts +4 -4
  152. package/dist/src/ranger/external.d.ts.map +1 -1
  153. package/dist/src/ranger/kv/client.d.ts +1 -1
  154. package/dist/src/ranger/kv/client.d.ts.map +1 -1
  155. package/dist/src/ranger/kv/external.d.ts +3 -1
  156. package/dist/src/ranger/kv/external.d.ts.map +1 -1
  157. package/dist/src/ranger/kv/payload.d.ts +6 -13
  158. package/dist/src/ranger/kv/payload.d.ts.map +1 -1
  159. package/dist/src/ranger/kv/types.gen.d.ts +13 -0
  160. package/dist/src/ranger/kv/types.gen.d.ts.map +1 -0
  161. package/dist/src/ranger/payload.d.ts +2 -97
  162. package/dist/src/ranger/payload.d.ts.map +1 -1
  163. package/dist/src/ranger/types.gen.d.ts +219 -0
  164. package/dist/src/ranger/types.gen.d.ts.map +1 -0
  165. package/dist/src/ranger/writer.d.ts +25 -25
  166. package/dist/src/ranger/writer.d.ts.map +1 -1
  167. package/dist/src/schematic/client.d.ts +2 -11
  168. package/dist/src/schematic/client.d.ts.map +1 -1
  169. package/dist/src/schematic/external.d.ts +1 -1
  170. package/dist/src/schematic/external.d.ts.map +1 -1
  171. package/dist/src/schematic/symbol/client.d.ts +1 -2
  172. package/dist/src/schematic/symbol/client.d.ts.map +1 -1
  173. package/dist/src/schematic/symbol/external.d.ts +1 -1
  174. package/dist/src/schematic/symbol/external.d.ts.map +1 -1
  175. package/dist/src/schematic/symbol/types.gen.d.ts +277 -0
  176. package/dist/src/schematic/symbol/types.gen.d.ts.map +1 -0
  177. package/dist/src/schematic/types.gen.d.ts +35 -0
  178. package/dist/src/schematic/types.gen.d.ts.map +1 -0
  179. package/dist/src/status/client.d.ts +2 -0
  180. package/dist/src/status/client.d.ts.map +1 -1
  181. package/dist/src/status/payload.d.ts +25 -54
  182. package/dist/src/status/payload.d.ts.map +1 -1
  183. package/dist/src/table/client.d.ts +2 -11
  184. package/dist/src/table/client.d.ts.map +1 -1
  185. package/dist/src/table/external.d.ts +1 -1
  186. package/dist/src/table/external.d.ts.map +1 -1
  187. package/dist/src/table/types.gen.d.ts +33 -0
  188. package/dist/src/table/types.gen.d.ts.map +1 -0
  189. package/dist/src/task/client.d.ts +15 -20
  190. package/dist/src/task/client.d.ts.map +1 -1
  191. package/dist/src/task/external.d.ts +1 -1
  192. package/dist/src/task/external.d.ts.map +1 -1
  193. package/dist/src/task/types.gen.d.ts +155 -0
  194. package/dist/src/task/types.gen.d.ts.map +1 -0
  195. package/dist/src/user/client.d.ts +3 -3
  196. package/dist/src/user/client.d.ts.map +1 -1
  197. package/dist/src/user/external.d.ts +1 -1
  198. package/dist/src/user/external.d.ts.map +1 -1
  199. package/dist/src/user/types.gen.d.ts +35 -0
  200. package/dist/src/user/types.gen.d.ts.map +1 -0
  201. package/dist/src/util/decodeJSONString.d.ts.map +1 -1
  202. package/dist/src/view/client.d.ts +1 -10
  203. package/dist/src/view/client.d.ts.map +1 -1
  204. package/dist/src/view/external.d.ts +1 -1
  205. package/dist/src/view/external.d.ts.map +1 -1
  206. package/dist/src/view/types.gen.d.ts +35 -0
  207. package/dist/src/view/types.gen.d.ts.map +1 -0
  208. package/dist/src/workspace/client.d.ts +2 -11
  209. package/dist/src/workspace/client.d.ts.map +1 -1
  210. package/dist/src/workspace/external.d.ts +1 -1
  211. package/dist/src/workspace/external.d.ts.map +1 -1
  212. package/dist/src/workspace/types.gen.d.ts +34 -0
  213. package/dist/src/workspace/types.gen.d.ts.map +1 -0
  214. package/package.json +11 -11
  215. package/src/access/action/index.ts +11 -0
  216. package/src/access/{payload.ts → action/types.gen.ts} +4 -1
  217. package/src/access/enforce.spec.ts +1 -2
  218. package/src/access/enforce.ts +2 -2
  219. package/src/access/external.ts +1 -1
  220. package/src/access/policy/client.ts +2 -2
  221. package/src/access/policy/external.ts +1 -1
  222. package/src/access/policy/types.gen.ts +44 -0
  223. package/src/access/role/client.ts +2 -2
  224. package/src/access/role/external.ts +1 -1
  225. package/src/access/role/types.gen.ts +46 -0
  226. package/src/arc/access.spec.ts +18 -6
  227. package/src/arc/client.ts +3 -3
  228. package/src/{framer/payload.ts → arc/compiler/index.ts} +1 -6
  229. package/src/arc/compiler/types.gen.ts +27 -0
  230. package/src/arc/external.ts +6 -1
  231. package/src/arc/graph/index.ts +10 -0
  232. package/src/arc/graph/types.gen.ts +59 -0
  233. package/src/arc/ir/index.ts +10 -0
  234. package/src/arc/ir/types.gen.ts +166 -0
  235. package/src/arc/module/index.ts +10 -0
  236. package/src/arc/module/types.gen.ts +18 -0
  237. package/src/arc/program/index.ts +10 -0
  238. package/src/arc/program/types.gen.ts +18 -0
  239. package/src/arc/text/index.ts +10 -0
  240. package/src/arc/text/types.gen.ts +19 -0
  241. package/src/arc/types/index.ts +10 -0
  242. package/src/arc/types/types.gen.ts +132 -0
  243. package/src/arc/types.gen.ts +85 -0
  244. package/src/channel/client.ts +14 -15
  245. package/src/channel/external.ts +1 -0
  246. package/src/channel/payload.spec.ts +19 -16
  247. package/src/channel/payload.ts +14 -82
  248. package/src/channel/retriever.ts +9 -18
  249. package/src/channel/types.gen.ts +137 -0
  250. package/src/channel/writer.ts +2 -2
  251. package/src/client.ts +4 -0
  252. package/src/cluster/index.ts +10 -0
  253. package/src/cluster/types.gen.ts +16 -0
  254. package/src/control/state.ts +8 -6
  255. package/src/device/client.ts +14 -11
  256. package/src/device/device.spec.ts +95 -1
  257. package/src/device/external.ts +1 -1
  258. package/src/device/payload.spec.ts +26 -2
  259. package/src/device/types.gen.ts +100 -0
  260. package/src/framer/adapter.ts +7 -4
  261. package/src/framer/client.ts +15 -9
  262. package/src/framer/codec.spec.ts +25 -5
  263. package/src/framer/codec.ts +11 -9
  264. package/src/framer/deleter.spec.ts +0 -15
  265. package/src/framer/external.ts +1 -1
  266. package/src/framer/frame.ts +44 -36
  267. package/src/framer/reader.spec.ts +2 -2
  268. package/src/framer/reader.ts +6 -6
  269. package/src/framer/streamer.spec.ts +98 -0
  270. package/src/framer/streamer.ts +10 -0
  271. package/src/framer/types.gen.ts +20 -0
  272. package/src/framer/writer.ts +14 -8
  273. package/src/group/client.ts +1 -1
  274. package/src/group/external.ts +1 -1
  275. package/src/group/group.spec.ts +1 -1
  276. package/src/{access/role/payload.ts → group/types.gen.ts} +11 -11
  277. package/src/label/client.ts +2 -5
  278. package/src/label/label.spec.ts +12 -3
  279. package/src/label/payload.ts +3 -1
  280. package/src/lineplot/client.ts +9 -11
  281. package/src/lineplot/external.ts +1 -1
  282. package/src/lineplot/lineplot.spec.ts +40 -0
  283. package/src/lineplot/types.gen.ts +42 -0
  284. package/src/log/client.ts +9 -18
  285. package/src/log/external.ts +1 -1
  286. package/src/log/log.spec.ts +38 -0
  287. package/src/log/types.gen.ts +42 -0
  288. package/src/ontology/payload.ts +5 -29
  289. package/src/ontology/types.gen.ts +41 -0
  290. package/src/rack/client.ts +26 -10
  291. package/src/rack/external.ts +1 -1
  292. package/src/rack/rack.spec.ts +37 -0
  293. package/src/rack/types.gen.ts +62 -0
  294. package/src/range/alias/types.gen.ts +30 -0
  295. package/src/range/kv/types.gen.ts +28 -0
  296. package/src/ranger/alias/client.ts +1 -1
  297. package/src/ranger/alias/external.ts +3 -10
  298. package/src/ranger/alias/payload.spec.ts +52 -0
  299. package/src/ranger/alias/payload.ts +11 -10
  300. package/src/ranger/alias/types.gen.ts +30 -0
  301. package/src/ranger/client.ts +34 -45
  302. package/src/ranger/external.ts +3 -3
  303. package/src/ranger/kv/client.ts +3 -3
  304. package/src/ranger/kv/external.ts +3 -7
  305. package/src/ranger/kv/payload.ts +1 -6
  306. package/src/ranger/kv/types.gen.ts +28 -0
  307. package/src/ranger/payload.ts +2 -46
  308. package/src/ranger/ranger.spec.ts +2 -4
  309. package/src/ranger/types.gen.ts +66 -0
  310. package/src/ranger/writer.ts +2 -1
  311. package/src/schematic/client.ts +11 -14
  312. package/src/schematic/external.ts +1 -1
  313. package/src/schematic/schematic.spec.ts +54 -2
  314. package/src/schematic/symbol/client.ts +2 -4
  315. package/src/schematic/symbol/external.ts +1 -1
  316. package/src/schematic/symbol/types.gen.ts +124 -0
  317. package/src/schematic/types.gen.ts +44 -0
  318. package/src/status/client.ts +4 -3
  319. package/src/status/payload.ts +5 -4
  320. package/src/status/status.spec.ts +106 -11
  321. package/src/table/client.ts +10 -19
  322. package/src/table/external.ts +1 -1
  323. package/src/table/table.spec.ts +38 -0
  324. package/src/table/types.gen.ts +42 -0
  325. package/src/task/client.ts +30 -28
  326. package/src/task/external.ts +1 -1
  327. package/src/task/payload.spec.ts +19 -19
  328. package/src/task/task.spec.ts +127 -9
  329. package/src/task/types.gen.ts +169 -0
  330. package/src/user/client.ts +2 -2
  331. package/src/user/external.ts +1 -1
  332. package/src/user/types.gen.ts +49 -0
  333. package/src/util/decodeJSONString.ts +1 -1
  334. package/src/util/retrieve.ts +2 -2
  335. package/src/view/client.ts +2 -7
  336. package/src/view/external.ts +1 -1
  337. package/src/view/types.gen.ts +44 -0
  338. package/src/workspace/client.ts +10 -14
  339. package/src/workspace/external.ts +1 -1
  340. package/src/workspace/types.gen.ts +45 -0
  341. package/src/workspace/workspace.spec.ts +37 -0
  342. package/tsconfig.json +1 -3
  343. package/vite.config.ts +9 -2
  344. package/dist/src/access/payload.d.ts.map +0 -1
  345. package/dist/src/access/policy/payload.d.ts +0 -156
  346. package/dist/src/access/policy/payload.d.ts.map +0 -1
  347. package/dist/src/access/role/payload.d.ts +0 -27
  348. package/dist/src/access/role/payload.d.ts.map +0 -1
  349. package/dist/src/arc/payload.d.ts +0 -167
  350. package/dist/src/arc/payload.d.ts.map +0 -1
  351. package/dist/src/device/payload.d.ts +0 -281
  352. package/dist/src/device/payload.d.ts.map +0 -1
  353. package/dist/src/framer/payload.d.ts +0 -7
  354. package/dist/src/framer/payload.d.ts.map +0 -1
  355. package/dist/src/group/payload.d.ts +0 -16
  356. package/dist/src/group/payload.d.ts.map +0 -1
  357. package/dist/src/lineplot/payload.d.ts +0 -28
  358. package/dist/src/lineplot/payload.d.ts.map +0 -1
  359. package/dist/src/log/payload.d.ts +0 -28
  360. package/dist/src/log/payload.d.ts.map +0 -1
  361. package/dist/src/rack/payload.d.ts +0 -243
  362. package/dist/src/rack/payload.d.ts.map +0 -1
  363. package/dist/src/schematic/payload.d.ts +0 -38
  364. package/dist/src/schematic/payload.d.ts.map +0 -1
  365. package/dist/src/schematic/symbol/payload.d.ts +0 -169
  366. package/dist/src/schematic/symbol/payload.d.ts.map +0 -1
  367. package/dist/src/table/payload.d.ts +0 -33
  368. package/dist/src/table/payload.d.ts.map +0 -1
  369. package/dist/src/task/payload.d.ts +0 -123
  370. package/dist/src/task/payload.d.ts.map +0 -1
  371. package/dist/src/user/payload.d.ts +0 -22
  372. package/dist/src/user/payload.d.ts.map +0 -1
  373. package/dist/src/view/payload.d.ts +0 -20
  374. package/dist/src/view/payload.d.ts.map +0 -1
  375. package/dist/src/workspace/payload.d.ts +0 -33
  376. package/dist/src/workspace/payload.d.ts.map +0 -1
  377. package/src/access/policy/payload.ts +0 -37
  378. package/src/arc/payload.ts +0 -73
  379. package/src/device/payload.ts +0 -83
  380. package/src/group/payload.ts +0 -24
  381. package/src/lineplot/payload.ts +0 -29
  382. package/src/log/payload.ts +0 -29
  383. package/src/rack/payload.ts +0 -30
  384. package/src/schematic/payload.ts +0 -34
  385. package/src/schematic/symbol/payload.ts +0 -70
  386. package/src/table/payload.ts +0 -33
  387. package/src/task/payload.ts +0 -127
  388. package/src/user/payload.ts +0 -29
  389. package/src/view/payload.ts +0 -25
  390. package/src/workspace/payload.ts +0 -33
@@ -1,20 +0,0 @@
1
- import { default as z } from 'zod';
2
- export declare const keyZ: z.ZodUUID;
3
- export type Key = z.infer<typeof keyZ>;
4
- export declare const viewZ: z.ZodObject<{
5
- key: z.ZodUUID;
6
- name: z.ZodString;
7
- type: z.ZodString;
8
- query: z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>;
9
- }, z.core.$strip>;
10
- export interface View extends z.infer<typeof viewZ> {
11
- }
12
- export declare const newZ: z.ZodObject<{
13
- name: z.ZodString;
14
- type: z.ZodString;
15
- query: z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>;
16
- key: z.ZodOptional<z.ZodUUID>;
17
- }, z.core.$strip>;
18
- export interface New extends z.infer<typeof newZ> {
19
- }
20
- //# sourceMappingURL=payload.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/view/payload.ts"],"names":[],"mappings":"AAUA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,eAAO,MAAM,IAAI,WAAW,CAAC;AAC7B,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAEvC,eAAO,MAAM,KAAK;;;;;iBAKhB,CAAC;AACH,MAAM,WAAW,IAAK,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC;CAAG;AAEtD,eAAO,MAAM,IAAI;;;;;iBAAyC,CAAC;AAC3D,MAAM,WAAW,GAAI,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC;CAAG"}
@@ -1,33 +0,0 @@
1
- import { record } from '@synnaxlabs/x';
2
- import { z } from 'zod';
3
- export declare const keyZ: z.ZodUUID;
4
- export type Key = z.infer<typeof keyZ>;
5
- export type Params = Key | Key[];
6
- export declare const workspaceZ: z.ZodObject<{
7
- key: z.ZodUUID;
8
- name: z.ZodString;
9
- layout: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>, z.ZodPipe<z.ZodString, z.ZodTransform<record.Unknown, string>>]>;
10
- }, z.core.$strip>;
11
- export interface Workspace extends z.infer<typeof workspaceZ> {
12
- }
13
- export declare const newZ: z.ZodPipe<z.ZodObject<{
14
- key: z.ZodOptional<z.ZodUUID>;
15
- name: z.ZodString;
16
- layout: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>, z.ZodPipe<z.ZodString, z.ZodTransform<record.Unknown, string>>]>;
17
- }, z.core.$strip>, z.ZodTransform<{
18
- layout: string;
19
- name: string;
20
- key?: string | undefined;
21
- }, {
22
- name: string;
23
- layout: record.Unknown | Record<string | number, unknown>;
24
- key?: string | undefined;
25
- }>>;
26
- export interface New extends z.input<typeof newZ> {
27
- }
28
- export declare const remoteZ: z.ZodObject<{
29
- key: z.ZodUUID;
30
- name: z.ZodString;
31
- layout: z.ZodPipe<z.ZodString, z.ZodTransform<record.Unknown, string>>;
32
- }, z.core.$strip>;
33
- //# sourceMappingURL=payload.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/workspace/payload.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,IAAI,WAAW,CAAC;AAC7B,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AACvC,MAAM,MAAM,MAAM,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC;AAEjC,eAAO,MAAM,UAAU;;;;iBAIrB,CAAC;AACH,MAAM,WAAW,SAAU,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC;CAAG;AAEhE,eAAO,MAAM,IAAI;;;;;;;;;;;;GAEgD,CAAC;AAClE,MAAM,WAAW,GAAI,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC;CAAG;AAEpD,eAAO,MAAM,OAAO;;;;iBAEkD,CAAC"}
@@ -1,37 +0,0 @@
1
- // Copyright 2026 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { array, zod } from "@synnaxlabs/x";
11
- import { z } from "zod";
12
-
13
- import { actionZ } from "@/access/payload";
14
- import { ontology } from "@/ontology";
15
-
16
- export const keyZ = z.uuid();
17
- export type Key = z.infer<typeof keyZ>;
18
-
19
- export const policyZ = z.object({
20
- key: keyZ,
21
- name: z.string(),
22
- objects: array.nullableZ(ontology.idZ),
23
- actions: array.nullableZ(actionZ),
24
- internal: z.boolean(),
25
- });
26
- export interface Policy extends z.infer<typeof policyZ> {}
27
-
28
- export const newZ = z.object({
29
- key: keyZ.optional(),
30
- name: z.string(),
31
- objects: zod.toArray(ontology.idZ),
32
- actions: zod.toArray(actionZ),
33
- });
34
- export interface New extends z.input<typeof newZ> {}
35
-
36
- export const ontologyID = ontology.createIDFactory<Key>("policy");
37
- export const TYPE_ONTOLOGY_ID = ontologyID("");
@@ -1,73 +0,0 @@
1
- // Copyright 2026 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { record, xy } from "@synnaxlabs/x";
11
- import { z } from "zod/v4";
12
-
13
- import { ontology } from "@/ontology";
14
- import { parseWithoutKeyConversion } from "@/util/parseWithoutKeyConversion";
15
-
16
- export const irNodeZ = z.object({
17
- key: z.string(),
18
- type: z.string(),
19
- config: record.unknownZ.or(z.string().transform(parseWithoutKeyConversion)),
20
- });
21
-
22
- export const graphNodeZ = irNodeZ.extend({
23
- position: xy.xy,
24
- });
25
-
26
- export const handleZ = z.object({ param: z.string(), node: z.string() });
27
-
28
- export const edgeZ = z.object({ source: handleZ, target: handleZ });
29
-
30
- export const irZ = z.object({
31
- nodes: irNodeZ.array(),
32
- edges: edgeZ.array(),
33
- });
34
-
35
- export const graphZ = z.object({
36
- nodes: graphNodeZ.array(),
37
- edges: edgeZ.array(),
38
- });
39
-
40
- export const textZ = z.object({ raw: z.string() });
41
-
42
- export interface IR extends z.infer<typeof irZ> {}
43
- export interface Graph extends z.infer<typeof graphZ> {}
44
- export interface Text extends z.infer<typeof textZ> {}
45
-
46
- export const keyZ = z.uuid();
47
- export type Key = z.infer<typeof keyZ>;
48
- export type Params = Key | Key[];
49
-
50
- export const modeZ = z
51
- .enum(["graph", "text"])
52
- .or(z.literal("").transform<"graph">(() => "graph"));
53
- export type Mode = z.infer<typeof modeZ>;
54
-
55
- export const arcZ = z.object({
56
- key: keyZ,
57
- name: z.string(),
58
- graph: graphZ,
59
- text: textZ,
60
- version: z.string(),
61
- mode: modeZ,
62
- });
63
-
64
- export interface Arc extends z.infer<typeof arcZ> {}
65
-
66
- export const newZ = arcZ.partial({ key: true, mode: true });
67
- export interface New extends z.input<typeof newZ> {}
68
-
69
- export const ONTOLOGY_TYPE = "arc";
70
- export type OntologyType = typeof ONTOLOGY_TYPE;
71
-
72
- export const ontologyID = ontology.createIDFactory<Key>("arc");
73
- export const TYPE_ONTOLOGY_ID = ontologyID("");
@@ -1,83 +0,0 @@
1
- // Copyright 2026 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { record, status, zod } from "@synnaxlabs/x";
11
- import { z } from "zod";
12
-
13
- import { keyZ as rackKeyZ } from "@/rack/payload";
14
-
15
- export const keyZ = z.string();
16
- export type Key = z.infer<typeof keyZ>;
17
-
18
- export const statusDetailsZ = z.object({ rack: rackKeyZ, device: keyZ });
19
- export const statusZ = status.statusZ(statusDetailsZ);
20
-
21
- export interface Status extends z.infer<typeof statusZ> {}
22
-
23
- export interface DeviceSchemas<
24
- Properties extends z.ZodType<record.Unknown> = typeof record.unknownZ,
25
- Make extends z.ZodType<string> = z.ZodString,
26
- Model extends z.ZodType<string> = z.ZodString,
27
- > {
28
- properties?: Properties;
29
- make?: Make;
30
- model?: Model;
31
- }
32
-
33
- export const deviceZ = <
34
- Properties extends z.ZodType<record.Unknown> = typeof record.unknownZ,
35
- Make extends z.ZodType<string> = z.ZodString,
36
- Model extends z.ZodType<string> = z.ZodString,
37
- >({ properties, make, model }: DeviceSchemas<Properties, Make, Model> = {}) =>
38
- z.object({
39
- key: keyZ,
40
- rack: rackKeyZ.min(1, "Must select a location to connect from"),
41
- name: z.string().min(1, "Name is required"),
42
- make: make ?? z.string().min(1, "Make is required"),
43
- model: model ?? z.string().min(1, "Model is required"),
44
- location: z.string().min(1, "Location is required"),
45
- configured: z.boolean().optional(),
46
- properties: properties ?? record.nullishToEmpty(),
47
- status: zod.nullToUndefined(statusZ),
48
- });
49
-
50
- export interface Device<
51
- Properties extends z.ZodType<record.Unknown> = typeof record.unknownZ,
52
- Make extends z.ZodType<string> = z.ZodString,
53
- Model extends z.ZodType<string> = z.ZodString,
54
- > extends Omit<
55
- z.infer<ReturnType<typeof deviceZ>>,
56
- "properties" | "make" | "model" | "status"
57
- > {
58
- properties: z.infer<Properties>;
59
- make: z.infer<Make>;
60
- model: z.infer<Model>;
61
- status?: Status;
62
- }
63
-
64
- export const newZ = <
65
- Properties extends z.ZodType<record.Unknown> = typeof record.unknownZ,
66
- Make extends z.ZodType<string> = z.ZodString,
67
- Model extends z.ZodType<string> = z.ZodString,
68
- >(
69
- schemas: DeviceSchemas<Properties, Make, Model> = {},
70
- ) =>
71
- deviceZ(schemas).extend({
72
- properties: schemas?.properties ?? record.nullishToEmpty(),
73
- });
74
-
75
- export interface New<
76
- Properties extends z.ZodType<record.Unknown> = typeof record.unknownZ,
77
- Make extends z.ZodType<string> = z.ZodString,
78
- Model extends z.ZodType<string> = z.ZodString,
79
- > extends Omit<z.input<ReturnType<typeof newZ>>, "properties"> {
80
- properties: z.infer<Properties>;
81
- make: z.infer<Make>;
82
- model: z.infer<Model>;
83
- }
@@ -1,24 +0,0 @@
1
- // Copyright 2026 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { z } from "zod";
11
-
12
- import { createIDFactory } from "@/ontology/payload";
13
-
14
- export const keyZ = z.uuid();
15
- export type Key = z.infer<typeof keyZ>;
16
- export const nameZ = z.string();
17
- export type Name = z.infer<typeof nameZ>;
18
- export type Keys = Key[];
19
- export type Names = Name[];
20
- export type Params = Key | Name | Keys | Names;
21
- export const groupZ = z.object({ key: keyZ, name: nameZ });
22
- export interface Group extends z.infer<typeof groupZ> {}
23
-
24
- export const ontologyID = createIDFactory("group");
@@ -1,29 +0,0 @@
1
- // Copyright 2026 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { record } from "@synnaxlabs/x";
11
- import { z } from "zod";
12
-
13
- import { parseWithoutKeyConversion } from "@/util/parseWithoutKeyConversion";
14
-
15
- export const keyZ = z.uuid();
16
- export type Key = z.infer<typeof keyZ>;
17
- export type Params = Key | Key[];
18
-
19
- export const linePlotZ = z.object({
20
- key: keyZ,
21
- name: z.string(),
22
- data: record.unknownZ.or(z.string().transform(parseWithoutKeyConversion)),
23
- });
24
- export interface LinePlot extends z.infer<typeof linePlotZ> {}
25
-
26
- export const newZ = linePlotZ
27
- .partial({ key: true })
28
- .transform((p) => ({ ...p, data: JSON.stringify(p.data) }));
29
- export interface New extends z.input<typeof newZ> {}
@@ -1,29 +0,0 @@
1
- // Copyright 2026 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { record } from "@synnaxlabs/x";
11
- import { z } from "zod";
12
-
13
- import { parseWithoutKeyConversion } from "@/util/parseWithoutKeyConversion";
14
-
15
- export const keyZ = z.uuid();
16
- export type Key = z.infer<typeof keyZ>;
17
- export type Params = Key | Key[];
18
-
19
- export const logZ = z.object({
20
- key: keyZ,
21
- name: z.string(),
22
- data: record.unknownZ.or(z.string().transform(parseWithoutKeyConversion)),
23
- });
24
- export interface Log extends z.infer<typeof logZ> {}
25
-
26
- export const newZ = logZ
27
- .partial({ key: true })
28
- .transform((p) => ({ ...p, data: JSON.stringify(p.data) }));
29
- export interface New extends z.input<typeof newZ> {}
@@ -1,30 +0,0 @@
1
- // Copyright 2026 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { status, zod } from "@synnaxlabs/x";
11
- import { z } from "zod";
12
-
13
- export const keyZ = z.uint32();
14
- export type Key = z.infer<typeof keyZ>;
15
-
16
- export const statusDetailsZ = z.object({ rack: keyZ });
17
- export const statusZ = status.statusZ(statusDetailsZ);
18
-
19
- export interface Status extends z.infer<typeof statusZ> {}
20
-
21
- export const rackZ = z.object({
22
- key: keyZ,
23
- name: z.string(),
24
- status: zod.nullToUndefined(statusZ),
25
- });
26
-
27
- export interface Payload extends z.infer<typeof rackZ> {}
28
-
29
- export const newZ = rackZ.partial({ key: true });
30
- export interface New extends z.input<typeof newZ> {}
@@ -1,34 +0,0 @@
1
- // Copyright 2026 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { record } from "@synnaxlabs/x";
11
- import { z } from "zod";
12
-
13
- import { parseWithoutKeyConversion } from "@/util/parseWithoutKeyConversion";
14
-
15
- export const keyZ = z.uuid();
16
- export type Key = z.infer<typeof keyZ>;
17
- export type Params = Key | Key[];
18
-
19
- export const schematicZ = z.object({
20
- key: keyZ,
21
- name: z.string(),
22
- data: record.unknownZ.or(z.string().transform(parseWithoutKeyConversion)),
23
- snapshot: z.boolean(),
24
- });
25
- export interface Schematic extends z.infer<typeof schematicZ> {}
26
-
27
- export const newZ = schematicZ
28
- .partial({ key: true, snapshot: true })
29
- .transform((p) => ({ ...p, data: JSON.stringify(p.data) }));
30
- export interface New extends z.input<typeof newZ> {}
31
-
32
- export const remoteZ = schematicZ.extend({
33
- data: z.string().transform(parseWithoutKeyConversion),
34
- });
@@ -1,70 +0,0 @@
1
- // Copyright 2026 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { location, xy } from "@synnaxlabs/x";
11
- import { z } from "zod";
12
-
13
- export const keyZ = z.uuid();
14
- export type Key = z.infer<typeof keyZ>;
15
- export type Params = Key | Key[];
16
-
17
- export const regionZ = z.object({
18
- key: z.string(),
19
- name: z.string(),
20
- selectors: z.string().array().default([]),
21
- strokeColor: z.string().optional(),
22
- fillColor: z.string().optional(),
23
- });
24
-
25
- export interface Region extends z.infer<typeof regionZ> {}
26
-
27
- export const stateZ = z.object({
28
- key: z.string(),
29
- name: z.string(),
30
- regions: regionZ.array(),
31
- });
32
-
33
- export interface State extends z.infer<typeof stateZ> {}
34
-
35
- export const handleZ = z.object({
36
- key: z.string(),
37
- position: xy.xy,
38
- orientation: location.outer,
39
- });
40
-
41
- export interface Handle extends z.infer<typeof handleZ> {}
42
-
43
- const viewportZ = z.object({
44
- zoom: z.number().positive().default(1),
45
- position: xy.xy,
46
- });
47
-
48
- export const specZ = z.object({
49
- svg: z.string().min(1, "SVG is required"),
50
- states: stateZ.array(),
51
- variant: z.string().min(1, "Variant is required"),
52
- handles: handleZ.array(),
53
- scale: z.number().positive().default(1),
54
- scaleStroke: z.boolean().default(false),
55
- previewViewport: viewportZ.default({ zoom: 1, position: { x: 0, y: 0 } }),
56
- });
57
-
58
- export interface Spec extends z.infer<typeof specZ> {}
59
-
60
- export const symbolZ = z.object({
61
- key: keyZ,
62
- version: z.literal(1).default(1),
63
- name: z.string().min(1, "Name is required"),
64
- data: specZ,
65
- });
66
-
67
- export const newZ = symbolZ.partial({ key: true });
68
- export interface New extends z.input<typeof newZ> {}
69
-
70
- export interface Symbol extends z.infer<typeof symbolZ> {}
@@ -1,33 +0,0 @@
1
- // Copyright 2026 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { record } from "@synnaxlabs/x";
11
- import { z } from "zod";
12
-
13
- import { parseWithoutKeyConversion } from "@/util/parseWithoutKeyConversion";
14
-
15
- export const keyZ = z.uuid();
16
- export type Key = z.infer<typeof keyZ>;
17
- export type Params = Key | Key[];
18
-
19
- export const tableZ = z.object({
20
- key: keyZ,
21
- name: z.string(),
22
- data: record.unknownZ.or(z.string().transform(parseWithoutKeyConversion)),
23
- });
24
- export interface Table extends z.infer<typeof tableZ> {}
25
-
26
- export const newZ = tableZ
27
- .partial({ key: true })
28
- .transform((p) => ({ ...p, data: JSON.stringify(p.data) }));
29
- export interface New extends z.input<typeof newZ> {}
30
-
31
- export const remoteZ = tableZ.extend({
32
- data: z.string().transform(parseWithoutKeyConversion),
33
- });
@@ -1,127 +0,0 @@
1
- // Copyright 2026 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { type observe, record, status } from "@synnaxlabs/x";
11
- import { z } from "zod";
12
-
13
- import { type Key as RackKey } from "@/rack/payload";
14
- import { parseWithoutKeyConversion } from "@/util/parseWithoutKeyConversion";
15
-
16
- export const keyZ = z.union([
17
- z.string(),
18
- z.bigint().transform((k) => k.toString()),
19
- z.number().transform((k) => k.toString()),
20
- ]);
21
- export type Key = z.infer<typeof keyZ>;
22
-
23
- export const statusDetailsZ = <DataSchema extends z.ZodType>(data: DataSchema) =>
24
- z.object({ task: keyZ, running: z.boolean(), data, cmd: z.string().optional() });
25
-
26
- export type StatusDetails<DataSchema extends z.ZodType> = z.infer<
27
- ReturnType<typeof statusDetailsZ<DataSchema>>
28
- >;
29
-
30
- export const statusZ = <DataSchema extends z.ZodType>(data: DataSchema) =>
31
- status.statusZ(statusDetailsZ(data));
32
-
33
- export interface Status<StatusData extends z.ZodType = z.ZodUnknown> extends z.infer<
34
- ReturnType<typeof statusZ<StatusData>>
35
- > {}
36
-
37
- const newStatusDetailsZ = <DataSchema extends z.ZodType>(data: DataSchema) =>
38
- statusDetailsZ(data).partial({ task: true });
39
-
40
- export const newStatusZ = <DataSchema extends z.ZodType>(data: DataSchema) =>
41
- status.statusZ(newStatusDetailsZ(data)).partial({ key: true, name: true });
42
-
43
- export interface NewStatus<DataSchema extends z.ZodType = z.ZodType> extends z.infer<
44
- ReturnType<typeof newStatusZ<DataSchema>>
45
- > {}
46
-
47
- export interface Schemas<
48
- Type extends z.ZodLiteral<string> = z.ZodLiteral<string>,
49
- Config extends z.ZodType = z.ZodType,
50
- StatusData extends z.ZodType = z.ZodType,
51
- > {
52
- type: Type;
53
- config: Config;
54
- statusData: StatusData;
55
- }
56
-
57
- export const taskZ = <S extends Schemas = Schemas>(
58
- schemas = {
59
- type: z.string() as unknown as S["type"],
60
- config: record.nullishToEmpty() as S["config"],
61
- statusData: z.unknown() as S["statusData"],
62
- },
63
- ) =>
64
- z.object({
65
- key: keyZ,
66
- name: z.string(),
67
- type: schemas.type,
68
- internal: z.boolean().optional(),
69
- config: schemas.config,
70
- status: statusZ(schemas.statusData).optional().nullable(),
71
- snapshot: z.boolean().optional(),
72
- });
73
-
74
- export interface Payload<S extends Schemas = Schemas> {
75
- key: Key;
76
- name: string;
77
- type: z.infer<S["type"]>;
78
- config: z.infer<S["config"]>;
79
- status?: Status<S["statusData"]>;
80
- snapshot?: boolean;
81
- internal?: boolean;
82
- }
83
-
84
- export const newZ = <S extends Schemas = Schemas>(schemas?: S) =>
85
- taskZ(schemas)
86
- .omit({ key: true, status: true })
87
- .extend({
88
- key: keyZ.transform((k) => k.toString()).optional(),
89
- config: schemas?.config ?? record.nullishToEmpty(),
90
- status: newStatusZ(schemas?.statusData ?? z.unknown())
91
- .optional()
92
- .nullable(),
93
- });
94
-
95
- export interface New<S extends Schemas = Schemas> {
96
- key?: Key;
97
- name: string;
98
- type: z.infer<S["type"]>;
99
- config: z.infer<S["config"]>;
100
- status?: NewStatus<S["statusData"]>;
101
- }
102
-
103
- export const commandZ = z.object({
104
- task: keyZ,
105
- type: z.string(),
106
- key: z.string(),
107
- args: record.unknownZ
108
- .or(z.string().transform(parseWithoutKeyConversion))
109
- .or(z.array(z.unknown()))
110
- .or(z.null())
111
- .optional() as z.ZodOptional<z.ZodType<record.Unknown>>,
112
- });
113
-
114
- export interface Command extends Omit<z.infer<typeof commandZ>, "args"> {
115
- args?: record.Unknown;
116
- }
117
-
118
- export interface StateObservable<
119
- StatusData extends z.ZodType,
120
- > extends observe.ObservableAsyncCloseable<Status<StatusData>> {}
121
-
122
- export interface CommandObservable extends observe.ObservableAsyncCloseable<Command> {}
123
-
124
- export const rackKey = (key: Key): RackKey => Number(BigInt(key) >> 32n);
125
-
126
- export const newKey = (rackKey: RackKey, taskKey: number = 0): Key =>
127
- ((BigInt(rackKey) << 32n) + BigInt(taskKey)).toString();
@@ -1,29 +0,0 @@
1
- // Copyright 2026 Synnax Labs, Inc.
2
- //
3
- // Use of this software is governed by the Business Source License included in the file
4
- // licenses/BSL.txt.
5
- //
6
- // As of the Change Date specified in that file, in accordance with the Business Source
7
- // License, use of this software will be governed by the Apache License, Version 2.0,
8
- // included in the file licenses/APL.txt.
9
-
10
- import { z } from "zod";
11
-
12
- export const keyZ = z.uuid();
13
- export type Key = z.infer<typeof keyZ>;
14
-
15
- export const userZ = z.object({
16
- key: keyZ,
17
- username: z.string().min(1, "Username is required"),
18
- firstName: z.string().default(""),
19
- lastName: z.string().default(""),
20
- rootUser: z.boolean().default(false),
21
- });
22
-
23
- export interface User extends z.infer<typeof userZ> {}
24
-
25
- export const newZ = userZ
26
- .omit({ rootUser: true })
27
- .partial({ key: true, firstName: true, lastName: true })
28
- .extend({ password: z.string().min(1) });
29
- export interface New extends z.infer<typeof newZ> {}