@synnaxlabs/client 0.50.0 → 0.53.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 (264) hide show
  1. package/.turbo/turbo-build.log +7 -7
  2. package/dist/client.cjs +58 -34
  3. package/dist/client.js +5368 -4546
  4. package/dist/eslint.config.d.ts +2 -2
  5. package/dist/eslint.config.d.ts.map +1 -1
  6. package/dist/src/access/policy/client.d.ts +90 -90
  7. package/dist/src/access/policy/payload.d.ts +17 -17
  8. package/dist/src/access/role/payload.d.ts +2 -2
  9. package/dist/src/arc/payload.d.ts +2 -2
  10. package/dist/src/channel/client.d.ts +4 -5
  11. package/dist/src/channel/client.d.ts.map +1 -1
  12. package/dist/src/channel/payload.d.ts +9 -11
  13. package/dist/src/channel/payload.d.ts.map +1 -1
  14. package/dist/src/channel/retriever.d.ts.map +1 -1
  15. package/dist/src/client.d.ts +10 -0
  16. package/dist/src/client.d.ts.map +1 -1
  17. package/dist/src/device/client.d.ts +14 -7
  18. package/dist/src/device/client.d.ts.map +1 -1
  19. package/dist/src/device/payload.d.ts +65 -32
  20. package/dist/src/device/payload.d.ts.map +1 -1
  21. package/dist/src/device/payload.spec.d.ts +2 -0
  22. package/dist/src/device/payload.spec.d.ts.map +1 -0
  23. package/dist/src/framer/adapter.d.ts.map +1 -1
  24. package/dist/src/framer/client.d.ts +2 -2
  25. package/dist/src/framer/frame.d.ts +5 -5
  26. package/dist/src/framer/frame.d.ts.map +1 -1
  27. package/dist/src/framer/streamer.d.ts +6 -6
  28. package/dist/src/framer/writer.d.ts +9 -9
  29. package/dist/src/group/access.spec.d.ts.map +1 -0
  30. package/dist/src/{ontology/group → group}/client.d.ts +3 -3
  31. package/dist/src/group/client.d.ts.map +1 -0
  32. package/dist/src/group/external.d.ts.map +1 -0
  33. package/dist/src/group/group.spec.d.ts.map +1 -0
  34. package/dist/src/group/index.d.ts.map +1 -0
  35. package/dist/src/{ontology/group → group}/payload.d.ts +1 -1
  36. package/dist/src/group/payload.d.ts.map +1 -0
  37. package/dist/src/index.d.ts +5 -5
  38. package/dist/src/index.d.ts.map +1 -1
  39. package/dist/src/label/client.d.ts +27 -13
  40. package/dist/src/label/client.d.ts.map +1 -1
  41. package/dist/src/label/payload.d.ts +15 -1
  42. package/dist/src/label/payload.d.ts.map +1 -1
  43. package/dist/src/lineplot/access.spec.d.ts.map +1 -0
  44. package/dist/src/{workspace/lineplot → lineplot}/client.d.ts +6 -6
  45. package/dist/src/lineplot/client.d.ts.map +1 -0
  46. package/dist/src/lineplot/external.d.ts.map +1 -0
  47. package/dist/src/lineplot/index.d.ts.map +1 -0
  48. package/dist/src/lineplot/lineplot.spec.d.ts.map +1 -0
  49. package/dist/src/lineplot/payload.d.ts.map +1 -0
  50. package/dist/src/log/access.spec.d.ts.map +1 -0
  51. package/dist/src/{workspace/log → log}/client.d.ts +6 -6
  52. package/dist/src/log/client.d.ts.map +1 -0
  53. package/dist/src/log/external.d.ts.map +1 -0
  54. package/dist/src/log/index.d.ts.map +1 -0
  55. package/dist/src/log/log.spec.d.ts.map +1 -0
  56. package/dist/src/log/payload.d.ts.map +1 -0
  57. package/dist/src/ontology/client.d.ts +6 -10
  58. package/dist/src/ontology/client.d.ts.map +1 -1
  59. package/dist/src/ontology/payload.d.ts +22 -22
  60. package/dist/src/ontology/writer.d.ts +15 -15
  61. package/dist/src/rack/client.d.ts +3 -3
  62. package/dist/src/rack/client.d.ts.map +1 -1
  63. package/dist/src/rack/payload.d.ts +44 -16
  64. package/dist/src/rack/payload.d.ts.map +1 -1
  65. package/dist/src/ranger/alias/client.d.ts +17 -0
  66. package/dist/src/ranger/alias/client.d.ts.map +1 -0
  67. package/dist/src/ranger/alias/external.d.ts +2 -0
  68. package/dist/src/ranger/alias/external.d.ts.map +1 -0
  69. package/dist/src/ranger/alias/index.d.ts +2 -0
  70. package/dist/src/ranger/alias/index.d.ts.map +1 -0
  71. package/dist/src/ranger/{alias.d.ts → alias/payload.d.ts} +14 -20
  72. package/dist/src/ranger/alias/payload.d.ts.map +1 -0
  73. package/dist/src/ranger/client.d.ts +10 -10
  74. package/dist/src/ranger/client.d.ts.map +1 -1
  75. package/dist/src/ranger/external.d.ts +20 -0
  76. package/dist/src/ranger/external.d.ts.map +1 -1
  77. package/dist/src/ranger/kv/client.d.ts +14 -0
  78. package/dist/src/ranger/kv/client.d.ts.map +1 -0
  79. package/dist/src/ranger/kv/external.d.ts +2 -0
  80. package/dist/src/ranger/kv/external.d.ts.map +1 -0
  81. package/dist/src/ranger/kv/index.d.ts +2 -0
  82. package/dist/src/ranger/kv/index.d.ts.map +1 -0
  83. package/dist/src/ranger/kv/payload.d.ts +26 -0
  84. package/dist/src/ranger/kv/payload.d.ts.map +1 -0
  85. package/dist/src/ranger/payload.d.ts +45 -3
  86. package/dist/src/ranger/payload.d.ts.map +1 -1
  87. package/dist/src/ranger/writer.d.ts +18 -4
  88. package/dist/src/ranger/writer.d.ts.map +1 -1
  89. package/dist/src/schematic/access.spec.d.ts.map +1 -0
  90. package/dist/src/{workspace/schematic → schematic}/client.d.ts +6 -6
  91. package/dist/src/schematic/client.d.ts.map +1 -0
  92. package/dist/src/schematic/external.d.ts.map +1 -0
  93. package/dist/src/schematic/index.d.ts.map +1 -0
  94. package/dist/src/schematic/payload.d.ts.map +1 -0
  95. package/dist/src/schematic/schematic.spec.d.ts.map +1 -0
  96. package/dist/src/schematic/symbol/access.spec.d.ts.map +1 -0
  97. package/dist/src/{workspace/schematic → schematic}/symbol/client.d.ts +2 -2
  98. package/dist/src/schematic/symbol/client.d.ts.map +1 -0
  99. package/dist/src/schematic/symbol/client.spec.d.ts.map +1 -0
  100. package/dist/src/schematic/symbol/external.d.ts.map +1 -0
  101. package/dist/src/schematic/symbol/index.d.ts.map +1 -0
  102. package/dist/src/schematic/symbol/payload.d.ts.map +1 -0
  103. package/dist/src/status/payload.d.ts +43 -7
  104. package/dist/src/status/payload.d.ts.map +1 -1
  105. package/dist/src/table/access.spec.d.ts.map +1 -0
  106. package/dist/src/{workspace/table → table}/client.d.ts +6 -6
  107. package/dist/src/table/client.d.ts.map +1 -0
  108. package/dist/src/table/external.d.ts.map +1 -0
  109. package/dist/src/table/index.d.ts.map +1 -0
  110. package/dist/src/table/payload.d.ts.map +1 -0
  111. package/dist/src/table/table.spec.d.ts.map +1 -0
  112. package/dist/src/task/client.d.ts +19 -21
  113. package/dist/src/task/client.d.ts.map +1 -1
  114. package/dist/src/task/payload.d.ts +32 -27
  115. package/dist/src/task/payload.d.ts.map +1 -1
  116. package/dist/src/user/client.d.ts +2 -2
  117. package/dist/src/view/client.d.ts +2 -2
  118. package/dist/src/workspace/client.d.ts +2 -10
  119. package/dist/src/workspace/client.d.ts.map +1 -1
  120. package/eslint.config.ts +2 -3
  121. package/package.json +10 -9
  122. package/src/arc/lsp.spec.ts +155 -283
  123. package/src/channel/client.ts +3 -5
  124. package/src/channel/payload.spec.ts +0 -57
  125. package/src/channel/payload.ts +7 -14
  126. package/src/channel/retriever.ts +2 -3
  127. package/src/client.ts +16 -1
  128. package/src/device/client.ts +89 -43
  129. package/src/device/payload.spec.ts +118 -0
  130. package/src/device/payload.ts +55 -30
  131. package/src/errors.spec.ts +1 -1
  132. package/src/framer/adapter.ts +5 -7
  133. package/src/framer/frame.ts +8 -8
  134. package/src/{ontology/group → group}/access.spec.ts +7 -7
  135. package/src/{ontology/group → group}/client.ts +1 -1
  136. package/src/group/external.ts +11 -0
  137. package/src/{ontology/group → group}/group.spec.ts +9 -9
  138. package/src/{workspace/log → group}/index.ts +1 -1
  139. package/src/index.ts +5 -5
  140. package/src/label/access.spec.ts +1 -1
  141. package/src/label/client.ts +1 -1
  142. package/src/label/label.spec.ts +4 -4
  143. package/src/{workspace/lineplot → lineplot}/access.spec.ts +14 -14
  144. package/src/{workspace/lineplot → lineplot}/client.ts +13 -13
  145. package/src/lineplot/external.ts +11 -0
  146. package/src/{ontology/group → lineplot}/index.ts +1 -1
  147. package/src/{workspace/lineplot → lineplot}/lineplot.spec.ts +12 -12
  148. package/src/{workspace/log → log}/access.spec.ts +16 -18
  149. package/src/{workspace/log → log}/client.ts +13 -13
  150. package/src/{workspace/schematic/index.ts → log/external.ts} +2 -1
  151. package/src/{workspace/table → log}/index.ts +1 -1
  152. package/src/{workspace/log → log}/log.spec.ts +10 -10
  153. package/src/ontology/client.ts +1 -7
  154. package/src/ontology/ontology.spec.ts +12 -12
  155. package/src/rack/client.ts +10 -21
  156. package/src/ranger/{alias.ts → alias/client.ts} +6 -37
  157. package/src/{workspace/lineplot → ranger/alias}/external.ts +10 -2
  158. package/src/{workspace/lineplot → ranger/alias}/index.ts +1 -1
  159. package/src/ranger/alias/payload.ts +50 -0
  160. package/src/ranger/client.ts +26 -19
  161. package/src/ranger/external.ts +22 -0
  162. package/src/ranger/{kv.ts → kv/client.ts} +5 -19
  163. package/src/{workspace/schematic → ranger/kv}/external.ts +7 -3
  164. package/src/ranger/kv/index.ts +10 -0
  165. package/src/ranger/kv/payload.ts +32 -0
  166. package/src/ranger/payload.ts +2 -2
  167. package/src/ranger/ranger.spec.ts +1 -1
  168. package/src/{workspace/schematic → schematic}/access.spec.ts +14 -14
  169. package/src/{workspace/schematic → schematic}/client.ts +14 -14
  170. package/src/{workspace/log → schematic}/external.ts +3 -2
  171. package/src/schematic/index.ts +10 -0
  172. package/src/{workspace/schematic → schematic}/schematic.spec.ts +17 -17
  173. package/src/{workspace/schematic → schematic}/symbol/access.spec.ts +19 -19
  174. package/src/{workspace/schematic → schematic}/symbol/client.spec.ts +16 -16
  175. package/src/{workspace/schematic → schematic}/symbol/client.ts +8 -8
  176. package/src/{ontology/group → schematic/symbol}/external.ts +2 -2
  177. package/src/schematic/symbol/index.ts +10 -0
  178. package/src/status/payload.ts +1 -1
  179. package/src/status/status.spec.ts +2 -2
  180. package/src/{workspace/table → table}/access.spec.ts +14 -14
  181. package/src/{workspace/table → table}/client.ts +15 -12
  182. package/src/table/external.ts +11 -0
  183. package/src/table/index.ts +10 -0
  184. package/src/{workspace/table → table}/table.spec.ts +12 -12
  185. package/src/task/client.ts +56 -148
  186. package/src/task/payload.ts +34 -58
  187. package/src/workspace/client.ts +0 -12
  188. package/dist/src/ontology/group/access.spec.d.ts.map +0 -1
  189. package/dist/src/ontology/group/client.d.ts.map +0 -1
  190. package/dist/src/ontology/group/external.d.ts.map +0 -1
  191. package/dist/src/ontology/group/group.spec.d.ts.map +0 -1
  192. package/dist/src/ontology/group/index.d.ts.map +0 -1
  193. package/dist/src/ontology/group/payload.d.ts.map +0 -1
  194. package/dist/src/ranger/alias.d.ts.map +0 -1
  195. package/dist/src/ranger/kv.d.ts +0 -48
  196. package/dist/src/ranger/kv.d.ts.map +0 -1
  197. package/dist/src/workspace/lineplot/access.spec.d.ts.map +0 -1
  198. package/dist/src/workspace/lineplot/client.d.ts.map +0 -1
  199. package/dist/src/workspace/lineplot/external.d.ts.map +0 -1
  200. package/dist/src/workspace/lineplot/index.d.ts.map +0 -1
  201. package/dist/src/workspace/lineplot/lineplot.spec.d.ts.map +0 -1
  202. package/dist/src/workspace/lineplot/payload.d.ts.map +0 -1
  203. package/dist/src/workspace/log/access.spec.d.ts.map +0 -1
  204. package/dist/src/workspace/log/client.d.ts.map +0 -1
  205. package/dist/src/workspace/log/external.d.ts.map +0 -1
  206. package/dist/src/workspace/log/index.d.ts.map +0 -1
  207. package/dist/src/workspace/log/log.spec.d.ts.map +0 -1
  208. package/dist/src/workspace/log/payload.d.ts.map +0 -1
  209. package/dist/src/workspace/schematic/access.spec.d.ts.map +0 -1
  210. package/dist/src/workspace/schematic/client.d.ts.map +0 -1
  211. package/dist/src/workspace/schematic/external.d.ts.map +0 -1
  212. package/dist/src/workspace/schematic/index.d.ts.map +0 -1
  213. package/dist/src/workspace/schematic/payload.d.ts.map +0 -1
  214. package/dist/src/workspace/schematic/schematic.spec.d.ts.map +0 -1
  215. package/dist/src/workspace/schematic/symbol/access.spec.d.ts.map +0 -1
  216. package/dist/src/workspace/schematic/symbol/client.d.ts.map +0 -1
  217. package/dist/src/workspace/schematic/symbol/client.spec.d.ts.map +0 -1
  218. package/dist/src/workspace/schematic/symbol/external.d.ts.map +0 -1
  219. package/dist/src/workspace/schematic/symbol/index.d.ts.map +0 -1
  220. package/dist/src/workspace/schematic/symbol/payload.d.ts.map +0 -1
  221. package/dist/src/workspace/table/access.spec.d.ts.map +0 -1
  222. package/dist/src/workspace/table/client.d.ts.map +0 -1
  223. package/dist/src/workspace/table/external.d.ts.map +0 -1
  224. package/dist/src/workspace/table/index.d.ts.map +0 -1
  225. package/dist/src/workspace/table/payload.d.ts.map +0 -1
  226. package/dist/src/workspace/table/table.spec.d.ts.map +0 -1
  227. package/src/workspace/schematic/symbol/external.ts +0 -11
  228. package/src/workspace/schematic/symbol/index.ts +0 -10
  229. package/src/workspace/table/external.ts +0 -11
  230. /package/dist/src/{ontology/group → group}/access.spec.d.ts +0 -0
  231. /package/dist/src/{ontology/group → group}/external.d.ts +0 -0
  232. /package/dist/src/{ontology/group → group}/group.spec.d.ts +0 -0
  233. /package/dist/src/{ontology/group → group}/index.d.ts +0 -0
  234. /package/dist/src/{workspace/lineplot → lineplot}/access.spec.d.ts +0 -0
  235. /package/dist/src/{workspace/lineplot → lineplot}/external.d.ts +0 -0
  236. /package/dist/src/{workspace/lineplot → lineplot}/index.d.ts +0 -0
  237. /package/dist/src/{workspace/lineplot → lineplot}/lineplot.spec.d.ts +0 -0
  238. /package/dist/src/{workspace/lineplot → lineplot}/payload.d.ts +0 -0
  239. /package/dist/src/{workspace/log → log}/access.spec.d.ts +0 -0
  240. /package/dist/src/{workspace/log → log}/external.d.ts +0 -0
  241. /package/dist/src/{workspace/log → log}/index.d.ts +0 -0
  242. /package/dist/src/{workspace/log → log}/log.spec.d.ts +0 -0
  243. /package/dist/src/{workspace/log → log}/payload.d.ts +0 -0
  244. /package/dist/src/{workspace/schematic → schematic}/access.spec.d.ts +0 -0
  245. /package/dist/src/{workspace/schematic → schematic}/external.d.ts +0 -0
  246. /package/dist/src/{workspace/schematic → schematic}/index.d.ts +0 -0
  247. /package/dist/src/{workspace/schematic → schematic}/payload.d.ts +0 -0
  248. /package/dist/src/{workspace/schematic → schematic}/schematic.spec.d.ts +0 -0
  249. /package/dist/src/{workspace/schematic → schematic}/symbol/access.spec.d.ts +0 -0
  250. /package/dist/src/{workspace/schematic → schematic}/symbol/client.spec.d.ts +0 -0
  251. /package/dist/src/{workspace/schematic → schematic}/symbol/external.d.ts +0 -0
  252. /package/dist/src/{workspace/schematic → schematic}/symbol/index.d.ts +0 -0
  253. /package/dist/src/{workspace/schematic → schematic}/symbol/payload.d.ts +0 -0
  254. /package/dist/src/{workspace/table → table}/access.spec.d.ts +0 -0
  255. /package/dist/src/{workspace/table → table}/external.d.ts +0 -0
  256. /package/dist/src/{workspace/table → table}/index.d.ts +0 -0
  257. /package/dist/src/{workspace/table → table}/payload.d.ts +0 -0
  258. /package/dist/src/{workspace/table → table}/table.spec.d.ts +0 -0
  259. /package/src/{ontology/group → group}/payload.ts +0 -0
  260. /package/src/{workspace/lineplot → lineplot}/payload.ts +0 -0
  261. /package/src/{workspace/log → log}/payload.ts +0 -0
  262. /package/src/{workspace/schematic → schematic}/payload.ts +0 -0
  263. /package/src/{workspace/schematic → schematic}/symbol/payload.ts +0 -0
  264. /package/src/{workspace/table → table}/payload.ts +0 -0
@@ -8,7 +8,29 @@
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
10
  export * from "@/ranger/alias";
11
+ export {
12
+ /** @deprecated Use {@link alias.createKey} instead. */
13
+ createKey as aliasKey,
14
+ /** @deprecated Use {@link alias.decodeDeleteChange} instead. */
15
+ decodeDeleteChange as decodeDeleteAliasChange,
16
+ /** @deprecated Use {@link alias.DELETE_CHANNEL_NAME} instead. */
17
+ DELETE_CHANNEL_NAME as DELETE_ALIAS_CHANNEL_NAME,
18
+ /** @deprecated Use {@link SET_CHANNEL_NAME} instead. */
19
+ SET_CHANNEL_NAME as SET_ALIAS_CHANNEL_NAME,
20
+ } from "@/ranger/alias/payload";
11
21
  export * from "@/ranger/client";
12
22
  export * from "@/ranger/kv";
23
+ export {
24
+ /** @deprecated Use {@link kv.DELETE_CHANNEL_NAME} instead. */
25
+ DELETE_CHANNEL_NAME as KV_DELETE_CHANNEL,
26
+ /** @deprecated Use {@link kv.SET_CHANNEL_NAME} instead. */
27
+ SET_CHANNEL_NAME as KV_SET_CHANNEL,
28
+ /** @deprecated Use {@link kv.Pair} instead. */
29
+ type Pair as KVPair,
30
+ /** @deprecated Use {@link kv.createPairKey} instead. */
31
+ createPairKey as kvPairKey,
32
+ /** @deprecated Use {@link kv.pairZ} instead. */
33
+ pairZ as kvPairZ,
34
+ } from "@/ranger/kv/payload";
13
35
  export * from "@/ranger/payload";
14
36
  export * from "@/ranger/writer";
@@ -11,29 +11,15 @@ import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
11
11
  import { array } from "@synnaxlabs/x";
12
12
  import { z } from "zod";
13
13
 
14
+ import { type Pair, pairZ } from "@/ranger/kv/payload";
14
15
  import { type Key, keyZ } from "@/ranger/payload";
15
16
 
16
- export const KV_SET_CHANNEL = "sy_range_kv_set";
17
- export const KV_DELETE_CHANNEL = "sy_range_kv_delete";
18
-
19
- export const kvPairZ = z.object({ range: keyZ, key: z.string(), value: z.string() });
20
- export interface KVPair extends z.infer<typeof kvPairZ> {}
21
-
22
- export const kvPairKey = ({ range, key }: Omit<KVPair, "value">) =>
23
- `${range}<--->${key}`;
24
-
25
17
  const getReqZ = z.object({ range: keyZ, keys: z.string().array() });
26
- export interface GetRequest extends z.infer<typeof getReqZ> {}
27
-
28
- const getResZ = z.object({ pairs: array.nullableZ(kvPairZ) });
29
-
30
- const setReqZ = z.object({ range: keyZ, pairs: kvPairZ.array() });
31
- export interface SetRequest extends z.infer<typeof setReqZ> {}
32
-
18
+ const getResZ = z.object({ pairs: array.nullableZ(pairZ) });
19
+ const setReqZ = z.object({ range: keyZ, pairs: pairZ.array() });
33
20
  const deleteReqZ = z.object({ range: keyZ, keys: z.string().array() });
34
- export interface DeleteRequest extends z.infer<typeof deleteReqZ> {}
35
21
 
36
- export class KV {
22
+ export class Client {
37
23
  private readonly rangeKey: Key;
38
24
  private readonly client: UnaryClient;
39
25
 
@@ -63,7 +49,7 @@ export class KV {
63
49
  async set(key: string, value: string): Promise<void>;
64
50
  async set(kv: Record<string, string>): Promise<void>;
65
51
  async set(key: string | Record<string, string>, value: string = ""): Promise<void> {
66
- let pairs: KVPair[];
52
+ let pairs: Pair[];
67
53
  if (typeof key == "string") pairs = [{ range: this.rangeKey, key, value }];
68
54
  else
69
55
  pairs = Object.entries(key).map(([k, v]) => ({
@@ -7,6 +7,10 @@
7
7
  // License, use of this software will be governed by the Apache License, Version 2.0,
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
- export * from "@/workspace/schematic/client";
11
- export * from "@/workspace/schematic/payload";
12
- export * from "@/workspace/schematic/symbol";
10
+ export {
11
+ createPairKey,
12
+ DELETE_CHANNEL_NAME as DELETE_CHANNEL,
13
+ type Pair,
14
+ pairZ,
15
+ SET_CHANNEL_NAME as SET_CHANNEL,
16
+ } from "@/ranger/kv/payload";
@@ -0,0 +1,10 @@
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
+ export * as kv from "@/ranger/kv/external";
@@ -0,0 +1,32 @@
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 { keyZ } from "@/ranger/payload";
13
+
14
+ export const SET_CHANNEL_NAME = "sy_range_kv_set";
15
+ export const DELETE_CHANNEL_NAME = "sy_range_kv_delete";
16
+
17
+ export const pairZ = z.object({ range: keyZ, key: z.string(), value: z.string() });
18
+ export interface Pair extends z.infer<typeof pairZ> {}
19
+
20
+ export const createPairKey = ({ range, key }: Omit<Pair, "value">) =>
21
+ `${range}<--->${key}`;
22
+
23
+ /** @deprecated Use {@link SET_CHANNEL_NAME} instead. */
24
+ export const KV_SET_CHANNEL = SET_CHANNEL_NAME;
25
+ /** @deprecated Use {@link DELETE_CHANNEL_NAME} instead. */
26
+ export const KV_DELETE_CHANNEL = DELETE_CHANNEL_NAME;
27
+ /** @deprecated Use {@link pairZ} instead. */
28
+ export const kvPairZ = pairZ;
29
+ /** @deprecated Use {@link Pair} instead. */
30
+ export type KVPair = Pair;
31
+ /** @deprecated Use {@link createPairKey} instead. */
32
+ export const kvPairKey = createPairKey;
@@ -7,7 +7,7 @@
7
7
  // License, use of this software will be governed by the Apache License, Version 2.0,
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
- import { math, TimeRange } from "@synnaxlabs/x";
10
+ import { color, math, TimeRange } from "@synnaxlabs/x";
11
11
  import { z } from "zod";
12
12
 
13
13
  import { label } from "@/label";
@@ -35,7 +35,7 @@ export const payloadZ = z.object({
35
35
  error:
36
36
  "Time range start time must be greater than or equal to the minimum value of an int64",
37
37
  }),
38
- color: z.string().optional(),
38
+ color: color.colorZ.optional(),
39
39
  labels: label.labelZ
40
40
  .array()
41
41
  .or(z.null().transform(() => undefined))
@@ -90,7 +90,7 @@ describe("Ranger", () => {
90
90
  });
91
91
  expect(range.key).not.toHaveLength(0);
92
92
  expect(timeRange).toEqual(range.timeRange);
93
- expect(range.color).toEqual("#E774D0");
93
+ expect(range.color).toEqual([231, 116, 208, 1]);
94
94
  });
95
95
  it("should create multiple ranges", async () => {
96
96
  const ranges: ranger.New[] = [
@@ -10,9 +10,9 @@
10
10
  import { describe, expect, it } from "vitest";
11
11
 
12
12
  import { AuthError, NotFoundError } from "@/errors";
13
+ import { schematic } from "@/schematic";
13
14
  import { createTestClientWithPolicy } from "@/testutil/access";
14
15
  import { createTestClient } from "@/testutil/client";
15
- import { schematic } from "@/workspace/schematic";
16
16
 
17
17
  const client = createTestClient();
18
18
 
@@ -28,12 +28,12 @@ describe("schematic", () => {
28
28
  name: "test",
29
29
  layout: {},
30
30
  });
31
- const randomSchematic = await client.workspaces.schematics.create(ws.key, {
31
+ const randomSchematic = await client.schematics.create(ws.key, {
32
32
  name: "test",
33
33
  data: {},
34
34
  });
35
35
  await expect(
36
- userClient.workspaces.schematics.retrieve({ key: randomSchematic.key }),
36
+ userClient.schematics.retrieve({ key: randomSchematic.key }),
37
37
  ).rejects.toThrow(AuthError);
38
38
  });
39
39
 
@@ -47,11 +47,11 @@ describe("schematic", () => {
47
47
  name: "test",
48
48
  layout: {},
49
49
  });
50
- const randomSchematic = await client.workspaces.schematics.create(ws.key, {
50
+ const randomSchematic = await client.schematics.create(ws.key, {
51
51
  name: "test",
52
52
  data: {},
53
53
  });
54
- const retrieved = await userClient.workspaces.schematics.retrieve({
54
+ const retrieved = await userClient.schematics.retrieve({
55
55
  key: randomSchematic.key,
56
56
  });
57
57
  expect(retrieved.key).toBe(randomSchematic.key);
@@ -68,7 +68,7 @@ describe("schematic", () => {
68
68
  name: "test",
69
69
  layout: {},
70
70
  });
71
- await userClient.workspaces.schematics.create(ws.key, {
71
+ await userClient.schematics.create(ws.key, {
72
72
  name: "test",
73
73
  data: {},
74
74
  });
@@ -85,7 +85,7 @@ describe("schematic", () => {
85
85
  layout: {},
86
86
  });
87
87
  await expect(
88
- userClient.workspaces.schematics.create(ws.key, {
88
+ userClient.schematics.create(ws.key, {
89
89
  name: "test",
90
90
  data: {},
91
91
  }),
@@ -102,13 +102,13 @@ describe("schematic", () => {
102
102
  name: "test",
103
103
  layout: {},
104
104
  });
105
- const randomSchematic = await client.workspaces.schematics.create(ws.key, {
105
+ const randomSchematic = await client.schematics.create(ws.key, {
106
106
  name: "test",
107
107
  data: {},
108
108
  });
109
- await userClient.workspaces.schematics.delete(randomSchematic.key);
109
+ await userClient.schematics.delete(randomSchematic.key);
110
110
  await expect(
111
- userClient.workspaces.schematics.retrieve({ key: randomSchematic.key }),
111
+ userClient.schematics.retrieve({ key: randomSchematic.key }),
112
112
  ).rejects.toThrow(NotFoundError);
113
113
  });
114
114
 
@@ -122,13 +122,13 @@ describe("schematic", () => {
122
122
  name: "test",
123
123
  layout: {},
124
124
  });
125
- const randomSchematic = await client.workspaces.schematics.create(ws.key, {
125
+ const randomSchematic = await client.schematics.create(ws.key, {
126
126
  name: "test",
127
127
  data: {},
128
128
  });
129
- await expect(
130
- userClient.workspaces.schematics.delete(randomSchematic.key),
131
- ).rejects.toThrow(AuthError);
129
+ await expect(userClient.schematics.delete(randomSchematic.key)).rejects.toThrow(
130
+ AuthError,
131
+ );
132
132
  });
133
133
  });
134
134
  });
@@ -12,8 +12,6 @@ import { array, type record } from "@synnaxlabs/x";
12
12
  import { z } from "zod";
13
13
 
14
14
  import { ontology } from "@/ontology";
15
- import { checkForMultipleOrNoResults } from "@/util/retrieve";
16
- import { type Key as WorkspaceKey, keyZ as workspaceKeyZ } from "@/workspace/payload";
17
15
  import {
18
16
  type Key,
19
17
  keyZ,
@@ -23,8 +21,10 @@ import {
23
21
  remoteZ,
24
22
  type Schematic,
25
23
  schematicZ,
26
- } from "@/workspace/schematic/payload";
27
- import { symbol } from "@/workspace/schematic/symbol";
24
+ } from "@/schematic/payload";
25
+ import { symbol } from "@/schematic/symbol";
26
+ import { checkForMultipleOrNoResults } from "@/util/retrieve";
27
+ import { workspace } from "@/workspace";
28
28
 
29
29
  const renameReqZ = z.object({ key: keyZ, name: z.string() });
30
30
 
@@ -51,7 +51,7 @@ export type CopyArgs = z.input<typeof copyReqZ>;
51
51
  const retrieveResZ = z.object({ schematics: array.nullableZ(remoteZ) });
52
52
 
53
53
  const createReqZ = z.object({
54
- workspace: workspaceKeyZ,
54
+ workspace: workspace.keyZ,
55
55
  schematics: newZ.array(),
56
56
  });
57
57
  const createResZ = z.object({ schematics: remoteZ.array() });
@@ -68,16 +68,16 @@ export class Client {
68
68
  this.symbols = new symbol.Client(client);
69
69
  }
70
70
 
71
- async create(workspace: WorkspaceKey, schematic: New): Promise<Schematic>;
72
- async create(workspace: WorkspaceKey, schematics: New[]): Promise<Schematic[]>;
71
+ async create(workspace: workspace.Key, schematic: New): Promise<Schematic>;
72
+ async create(workspace: workspace.Key, schematics: New[]): Promise<Schematic[]>;
73
73
  async create(
74
- workspace: WorkspaceKey,
74
+ workspace: workspace.Key,
75
75
  schematics: New | New[],
76
76
  ): Promise<Schematic | Schematic[]> {
77
77
  const isMany = Array.isArray(schematics);
78
78
  const res = await sendRequired(
79
79
  this.client,
80
- "/workspace/schematic/create",
80
+ "/schematic/create",
81
81
  { workspace, schematics: array.toArray(schematics) },
82
82
  createReqZ,
83
83
  createResZ,
@@ -88,7 +88,7 @@ export class Client {
88
88
  async rename(key: Key, name: string): Promise<void> {
89
89
  await sendRequired(
90
90
  this.client,
91
- "/workspace/schematic/rename",
91
+ "/schematic/rename",
92
92
  { key, name },
93
93
  renameReqZ,
94
94
  emptyResZ,
@@ -98,7 +98,7 @@ export class Client {
98
98
  async setData(key: Key, data: record.Unknown): Promise<void> {
99
99
  await sendRequired(
100
100
  this.client,
101
- "/workspace/schematic/set-data",
101
+ "/schematic/set-data",
102
102
  { key, data: JSON.stringify(data) },
103
103
  setDataReqZ,
104
104
  emptyResZ,
@@ -113,7 +113,7 @@ export class Client {
113
113
  const isSingle = singleRetrieveArgsZ.safeParse(args).success;
114
114
  const res = await sendRequired(
115
115
  this.client,
116
- "/workspace/schematic/retrieve",
116
+ "/schematic/retrieve",
117
117
  args,
118
118
  retrieveArgsZ,
119
119
  retrieveResZ,
@@ -125,7 +125,7 @@ export class Client {
125
125
  async delete(keys: Params): Promise<void> {
126
126
  await sendRequired(
127
127
  this.client,
128
- "/workspace/schematic/delete",
128
+ "/schematic/delete",
129
129
  { keys: array.toArray(keys) },
130
130
  deleteReqZ,
131
131
  emptyResZ,
@@ -135,7 +135,7 @@ export class Client {
135
135
  async copy(args: CopyArgs): Promise<Schematic> {
136
136
  const res = await sendRequired(
137
137
  this.client,
138
- "/workspace/schematic/copy",
138
+ "/schematic/copy",
139
139
  args,
140
140
  copyReqZ,
141
141
  copyResZ,
@@ -7,5 +7,6 @@
7
7
  // License, use of this software will be governed by the Apache License, Version 2.0,
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
- export * from "@/workspace/log/client";
11
- export * from "@/workspace/log/payload";
10
+ export * from "@/schematic/client";
11
+ export * from "@/schematic/payload";
12
+ export * from "@/schematic/symbol";
@@ -0,0 +1,10 @@
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
+ export * as schematic from "@/schematic/external";
@@ -22,7 +22,7 @@ describe("Schematic", () => {
22
22
  name: "Schematic",
23
23
  layout: { one: 1 },
24
24
  });
25
- const schematic = await client.workspaces.schematics.create(ws.key, {
25
+ const schematic = await client.schematics.create(ws.key, {
26
26
  name: "Schematic",
27
27
  data: { one: 1 },
28
28
  });
@@ -37,12 +37,12 @@ describe("Schematic", () => {
37
37
  name: "Schematic",
38
38
  layout: { one: 1 },
39
39
  });
40
- const schematic = await client.workspaces.schematics.create(ws.key, {
40
+ const schematic = await client.schematics.create(ws.key, {
41
41
  name: "Schematic",
42
42
  data: { one: 1 },
43
43
  });
44
- await client.workspaces.schematics.rename(schematic.key, "Schematic2");
45
- const res = await client.workspaces.schematics.retrieve({
44
+ await client.schematics.rename(schematic.key, "Schematic2");
45
+ const res = await client.schematics.retrieve({
46
46
  key: schematic.key,
47
47
  });
48
48
  expect(res.name).toEqual("Schematic2");
@@ -54,12 +54,12 @@ describe("Schematic", () => {
54
54
  name: "Schematic",
55
55
  layout: { one: 1 },
56
56
  });
57
- const schematic = await client.workspaces.schematics.create(ws.key, {
57
+ const schematic = await client.schematics.create(ws.key, {
58
58
  name: "Schematic",
59
59
  data: { one: 1 },
60
60
  });
61
- await client.workspaces.schematics.setData(schematic.key, { two: 2 });
62
- const res = await client.workspaces.schematics.retrieve({
61
+ await client.schematics.setData(schematic.key, { two: 2 });
62
+ const res = await client.schematics.retrieve({
63
63
  key: schematic.key,
64
64
  });
65
65
  expect(res.data.two).toEqual(2);
@@ -71,14 +71,14 @@ describe("Schematic", () => {
71
71
  name: "Schematic",
72
72
  layout: { one: 1 },
73
73
  });
74
- const schematic = await client.workspaces.schematics.create(ws.key, {
74
+ const schematic = await client.schematics.create(ws.key, {
75
75
  name: "Schematic",
76
76
  data: { one: 1 },
77
77
  });
78
- await client.workspaces.schematics.delete(schematic.key);
79
- await expect(
80
- client.workspaces.schematics.retrieve({ key: schematic.key }),
81
- ).rejects.toThrow(NotFoundError);
78
+ await client.schematics.delete(schematic.key);
79
+ await expect(client.schematics.retrieve({ key: schematic.key })).rejects.toThrow(
80
+ NotFoundError,
81
+ );
82
82
  });
83
83
  });
84
84
  describe("copy", () => {
@@ -87,11 +87,11 @@ describe("Schematic", () => {
87
87
  name: "Schematic",
88
88
  layout: { one: 1 },
89
89
  });
90
- const schematic = await client.workspaces.schematics.create(ws.key, {
90
+ const schematic = await client.schematics.create(ws.key, {
91
91
  name: "Schematic",
92
92
  data: { one: 1 },
93
93
  });
94
- const schematic2 = await client.workspaces.schematics.copy({
94
+ const schematic2 = await client.schematics.copy({
95
95
  key: schematic.key,
96
96
  name: "Schematic2",
97
97
  snapshot: false,
@@ -106,17 +106,17 @@ describe("Schematic", () => {
106
106
  name: "Schematic",
107
107
  layout: { one: 1 },
108
108
  });
109
- const schematic = await client.workspaces.schematics.create(ws.key, {
109
+ const schematic = await client.schematics.create(ws.key, {
110
110
  name: "Schematic",
111
111
  data: { one: 1 },
112
112
  });
113
- const schematic2 = await client.workspaces.schematics.copy({
113
+ const schematic2 = await client.schematics.copy({
114
114
  key: schematic.key,
115
115
  name: "Schematic2",
116
116
  snapshot: true,
117
117
  });
118
118
  await expect(
119
- client.workspaces.schematics.setData(schematic2.key, { two: 2 }),
119
+ client.schematics.setData(schematic2.key, { two: 2 }),
120
120
  ).rejects.toThrow(ValidationError);
121
121
  });
122
122
  });
@@ -10,11 +10,11 @@
10
10
  import { describe, expect, it } from "vitest";
11
11
 
12
12
  import { AuthError, NotFoundError } from "@/errors";
13
+ import { group } from "@/group";
13
14
  import { ontology } from "@/ontology";
14
- import { group } from "@/ontology/group";
15
+ import { symbol } from "@/schematic/symbol";
15
16
  import { createTestClientWithPolicy } from "@/testutil/access";
16
17
  import { createTestClient } from "@/testutil/client";
17
- import { symbol } from "@/workspace/schematic/symbol";
18
18
 
19
19
  const client = createTestClient();
20
20
 
@@ -26,11 +26,11 @@ describe("schematic_symbol", () => {
26
26
  objects: [],
27
27
  actions: [],
28
28
  });
29
- const symbolGroup = await client.ontology.groups.create({
29
+ const symbolGroup = await client.groups.create({
30
30
  parent: ontology.ROOT_ID,
31
31
  name: "Test Symbols",
32
32
  });
33
- const randomSymbol = await client.workspaces.schematics.symbols.create({
33
+ const randomSymbol = await client.schematics.symbols.create({
34
34
  name: "test",
35
35
  data: {
36
36
  svg: "<svg></svg>",
@@ -41,7 +41,7 @@ describe("schematic_symbol", () => {
41
41
  parent: group.ontologyID(symbolGroup.key),
42
42
  });
43
43
  await expect(
44
- userClient.workspaces.schematics.symbols.retrieve({ key: randomSymbol.key }),
44
+ userClient.schematics.symbols.retrieve({ key: randomSymbol.key }),
45
45
  ).rejects.toThrow(AuthError);
46
46
  });
47
47
 
@@ -51,11 +51,11 @@ describe("schematic_symbol", () => {
51
51
  objects: [symbol.ontologyID("")],
52
52
  actions: ["retrieve"],
53
53
  });
54
- const symbolGroup = await client.ontology.groups.create({
54
+ const symbolGroup = await client.groups.create({
55
55
  parent: ontology.ROOT_ID,
56
56
  name: "Test Symbols",
57
57
  });
58
- const randomSymbol = await client.workspaces.schematics.symbols.create({
58
+ const randomSymbol = await client.schematics.symbols.create({
59
59
  name: "test",
60
60
  data: {
61
61
  svg: "<svg></svg>",
@@ -65,7 +65,7 @@ describe("schematic_symbol", () => {
65
65
  },
66
66
  parent: group.ontologyID(symbolGroup.key),
67
67
  });
68
- const retrieved = await userClient.workspaces.schematics.symbols.retrieve({
68
+ const retrieved = await userClient.schematics.symbols.retrieve({
69
69
  key: randomSymbol.key,
70
70
  });
71
71
  expect(retrieved.key).toBe(randomSymbol.key);
@@ -78,11 +78,11 @@ describe("schematic_symbol", () => {
78
78
  objects: [symbol.ontologyID("")],
79
79
  actions: ["create"],
80
80
  });
81
- const symbolGroup = await client.ontology.groups.create({
81
+ const symbolGroup = await client.groups.create({
82
82
  parent: ontology.ROOT_ID,
83
83
  name: "Test Symbols",
84
84
  });
85
- await userClient.workspaces.schematics.symbols.create({
85
+ await userClient.schematics.symbols.create({
86
86
  name: "test",
87
87
  data: {
88
88
  svg: "<svg></svg>",
@@ -100,12 +100,12 @@ describe("schematic_symbol", () => {
100
100
  objects: [symbol.ontologyID("")],
101
101
  actions: [],
102
102
  });
103
- const symbolGroup = await client.ontology.groups.create({
103
+ const symbolGroup = await client.groups.create({
104
104
  parent: ontology.ROOT_ID,
105
105
  name: "Test Symbols",
106
106
  });
107
107
  await expect(
108
- userClient.workspaces.schematics.symbols.create({
108
+ userClient.schematics.symbols.create({
109
109
  name: "test",
110
110
  data: {
111
111
  svg: "<svg></svg>",
@@ -124,11 +124,11 @@ describe("schematic_symbol", () => {
124
124
  objects: [symbol.ontologyID("")],
125
125
  actions: ["delete", "retrieve"],
126
126
  });
127
- const symbolGroup = await client.ontology.groups.create({
127
+ const symbolGroup = await client.groups.create({
128
128
  parent: ontology.ROOT_ID,
129
129
  name: "Test Symbols",
130
130
  });
131
- const randomSymbol = await client.workspaces.schematics.symbols.create({
131
+ const randomSymbol = await client.schematics.symbols.create({
132
132
  name: "test",
133
133
  data: {
134
134
  svg: "<svg></svg>",
@@ -138,9 +138,9 @@ describe("schematic_symbol", () => {
138
138
  },
139
139
  parent: group.ontologyID(symbolGroup.key),
140
140
  });
141
- await userClient.workspaces.schematics.symbols.delete(randomSymbol.key);
141
+ await userClient.schematics.symbols.delete(randomSymbol.key);
142
142
  await expect(
143
- userClient.workspaces.schematics.symbols.retrieve({ key: randomSymbol.key }),
143
+ userClient.schematics.symbols.retrieve({ key: randomSymbol.key }),
144
144
  ).rejects.toThrow(NotFoundError);
145
145
  });
146
146
 
@@ -150,11 +150,11 @@ describe("schematic_symbol", () => {
150
150
  objects: [symbol.ontologyID("")],
151
151
  actions: [],
152
152
  });
153
- const symbolGroup = await client.ontology.groups.create({
153
+ const symbolGroup = await client.groups.create({
154
154
  parent: ontology.ROOT_ID,
155
155
  name: "Test Symbols",
156
156
  });
157
- const randomSymbol = await client.workspaces.schematics.symbols.create({
157
+ const randomSymbol = await client.schematics.symbols.create({
158
158
  name: "test",
159
159
  data: {
160
160
  svg: "<svg></svg>",
@@ -165,7 +165,7 @@ describe("schematic_symbol", () => {
165
165
  parent: group.ontologyID(symbolGroup.key),
166
166
  });
167
167
  await expect(
168
- userClient.workspaces.schematics.symbols.delete(randomSymbol.key),
168
+ userClient.schematics.symbols.delete(randomSymbol.key),
169
169
  ).rejects.toThrow(AuthError);
170
170
  });
171
171
  });