@synnaxlabs/client 0.49.2 → 0.50.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 (268) hide show
  1. package/.turbo/turbo-build.log +10 -10
  2. package/CONTRIBUTING.md +1 -2
  3. package/README.md +1 -1
  4. package/dist/client.cjs +29 -29
  5. package/dist/client.js +3660 -3598
  6. package/dist/src/access/policy/client.d.ts +90 -76
  7. package/dist/src/access/policy/client.d.ts.map +1 -1
  8. package/dist/src/access/policy/payload.d.ts +17 -14
  9. package/dist/src/access/policy/payload.d.ts.map +1 -1
  10. package/dist/src/access/role/payload.d.ts +2 -2
  11. package/dist/src/arc/payload.d.ts +21 -20
  12. package/dist/src/arc/payload.d.ts.map +1 -1
  13. package/dist/src/channel/client.d.ts +5 -10
  14. package/dist/src/channel/client.d.ts.map +1 -1
  15. package/dist/src/channel/payload.d.ts +11 -9
  16. package/dist/src/channel/payload.d.ts.map +1 -1
  17. package/dist/src/channel/retriever.d.ts.map +1 -1
  18. package/dist/src/client.d.ts +2 -0
  19. package/dist/src/client.d.ts.map +1 -1
  20. package/dist/src/device/client.d.ts +2 -2
  21. package/dist/src/device/payload.d.ts +1 -1
  22. package/dist/src/framer/client.d.ts +2 -2
  23. package/dist/src/framer/external.d.ts +1 -0
  24. package/dist/src/framer/external.d.ts.map +1 -1
  25. package/dist/src/framer/iterator.d.ts +5 -0
  26. package/dist/src/framer/iterator.d.ts.map +1 -1
  27. package/dist/src/framer/reader.d.ts +3 -1
  28. package/dist/src/framer/reader.d.ts.map +1 -1
  29. package/dist/src/framer/streamer.d.ts +1 -11
  30. package/dist/src/framer/streamer.d.ts.map +1 -1
  31. package/dist/src/framer/writer.d.ts +0 -10
  32. package/dist/src/framer/writer.d.ts.map +1 -1
  33. package/dist/src/index.d.ts +1 -0
  34. package/dist/src/index.d.ts.map +1 -1
  35. package/dist/src/label/client.d.ts +11 -8
  36. package/dist/src/label/client.d.ts.map +1 -1
  37. package/dist/src/ontology/client.d.ts +6 -4
  38. package/dist/src/ontology/client.d.ts.map +1 -1
  39. package/dist/src/ontology/group/client.d.ts +3 -2
  40. package/dist/src/ontology/group/client.d.ts.map +1 -1
  41. package/dist/src/ontology/group/payload.d.ts +1 -1
  42. package/dist/src/ontology/group/payload.d.ts.map +1 -1
  43. package/dist/src/ontology/payload.d.ts +25 -20
  44. package/dist/src/ontology/payload.d.ts.map +1 -1
  45. package/dist/src/ontology/writer.d.ts +15 -10
  46. package/dist/src/ontology/writer.d.ts.map +1 -1
  47. package/dist/src/rack/client.d.ts +2 -2
  48. package/dist/src/ranger/client.d.ts +2 -2
  49. package/dist/src/ranger/writer.d.ts +3 -2
  50. package/dist/src/ranger/writer.d.ts.map +1 -1
  51. package/dist/src/status/payload.d.ts +2 -2
  52. package/dist/src/task/client.d.ts +2 -2
  53. package/dist/src/task/client.d.ts.map +1 -1
  54. package/dist/src/task/payload.d.ts +1 -0
  55. package/dist/src/task/payload.d.ts.map +1 -1
  56. package/dist/src/task/payload.spec.d.ts +2 -0
  57. package/dist/src/task/payload.spec.d.ts.map +1 -0
  58. package/dist/src/user/client.d.ts +2 -2
  59. package/dist/src/view/client.d.ts +43 -0
  60. package/dist/src/view/client.d.ts.map +1 -0
  61. package/dist/src/view/external.d.ts +3 -0
  62. package/dist/src/view/external.d.ts.map +1 -0
  63. package/dist/src/view/index.d.ts +2 -0
  64. package/dist/src/view/index.d.ts.map +1 -0
  65. package/dist/src/view/payload.d.ts +20 -0
  66. package/dist/src/view/payload.d.ts.map +1 -0
  67. package/dist/src/view/view.spec.d.ts +2 -0
  68. package/dist/src/view/view.spec.d.ts.map +1 -0
  69. package/dist/src/workspace/client.d.ts +3 -3
  70. package/dist/src/workspace/lineplot/client.d.ts +2 -2
  71. package/dist/src/workspace/lineplot/payload.d.ts +3 -3
  72. package/dist/src/workspace/log/client.d.ts +2 -2
  73. package/dist/src/workspace/log/payload.d.ts +3 -3
  74. package/dist/src/workspace/payload.d.ts +3 -3
  75. package/dist/src/workspace/schematic/client.d.ts +2 -2
  76. package/dist/src/workspace/schematic/payload.d.ts +3 -3
  77. package/dist/src/workspace/table/client.d.ts +2 -2
  78. package/dist/src/workspace/table/payload.d.ts +3 -3
  79. package/eslint.config.ts +1 -1
  80. package/examples/node/basicReadWrite.js +1 -1
  81. package/examples/node/createChannels.js +50 -0
  82. package/examples/node/createRange.js +67 -0
  83. package/examples/node/readLatest.js +76 -0
  84. package/examples/node/seriesAndFrames.js +2 -2
  85. package/examples/node/{liveStream.js → streamRead.js} +1 -1
  86. package/examples/node/streamWrite.js +1 -1
  87. package/package.json +10 -10
  88. package/src/access/client.ts +1 -1
  89. package/src/access/enforce.spec.ts +1 -1
  90. package/src/access/enforce.ts +1 -1
  91. package/src/access/external.ts +1 -1
  92. package/src/access/index.ts +1 -1
  93. package/src/access/payload.ts +1 -1
  94. package/src/access/policy/access.spec.ts +1 -1
  95. package/src/access/policy/client.ts +1 -1
  96. package/src/access/policy/external.ts +1 -1
  97. package/src/access/policy/index.ts +1 -1
  98. package/src/access/policy/payload.ts +1 -1
  99. package/src/access/role/client.ts +1 -1
  100. package/src/access/role/external.ts +1 -1
  101. package/src/access/role/index.ts +1 -1
  102. package/src/access/role/payload.ts +1 -1
  103. package/src/access/role/role.spec.ts +1 -1
  104. package/src/arc/access.spec.ts +1 -7
  105. package/src/arc/client.ts +1 -1
  106. package/src/arc/external.ts +1 -1
  107. package/src/arc/index.ts +1 -1
  108. package/src/arc/lsp.spec.ts +2 -5
  109. package/src/arc/payload.ts +7 -12
  110. package/src/auth/auth.spec.ts +1 -1
  111. package/src/auth/auth.ts +1 -1
  112. package/src/auth/index.ts +1 -1
  113. package/src/channel/access.spec.ts +1 -1
  114. package/src/channel/batchRetriever.spec.ts +1 -3
  115. package/src/channel/channel.spec.ts +13 -20
  116. package/src/channel/client.ts +5 -36
  117. package/src/channel/external.ts +1 -1
  118. package/src/channel/index.ts +1 -1
  119. package/src/channel/payload.spec.ts +1 -1
  120. package/src/channel/payload.ts +12 -5
  121. package/src/channel/retriever.ts +5 -3
  122. package/src/channel/writer.ts +1 -1
  123. package/src/client.ts +8 -3
  124. package/src/connection/checker.ts +2 -2
  125. package/src/connection/connection.spec.ts +1 -1
  126. package/src/connection/index.ts +1 -1
  127. package/src/connection.spec.ts +1 -1
  128. package/src/control/client.ts +1 -1
  129. package/src/control/external.ts +1 -1
  130. package/src/control/index.ts +1 -1
  131. package/src/control/state.spec.ts +1 -1
  132. package/src/control/state.ts +1 -1
  133. package/src/device/access.spec.ts +1 -1
  134. package/src/device/client.ts +1 -1
  135. package/src/device/device.spec.ts +1 -1
  136. package/src/device/external.ts +1 -1
  137. package/src/device/index.ts +1 -1
  138. package/src/device/payload.ts +1 -1
  139. package/src/errors.spec.ts +1 -1
  140. package/src/errors.ts +1 -1
  141. package/src/framer/adapter.spec.ts +1 -1
  142. package/src/framer/adapter.ts +1 -1
  143. package/src/framer/client.spec.ts +1 -1
  144. package/src/framer/client.ts +1 -1
  145. package/src/framer/codec.spec.ts +1 -1
  146. package/src/framer/codec.ts +1 -1
  147. package/src/framer/deleter.spec.ts +1 -1
  148. package/src/framer/deleter.ts +1 -1
  149. package/src/framer/external.ts +2 -1
  150. package/src/framer/frame.spec.ts +1 -1
  151. package/src/framer/frame.ts +1 -1
  152. package/src/framer/index.ts +1 -1
  153. package/src/framer/iterator.spec.ts +68 -1
  154. package/src/framer/iterator.ts +8 -1
  155. package/src/framer/payload.ts +1 -1
  156. package/src/framer/reader.spec.ts +213 -84
  157. package/src/framer/reader.ts +14 -7
  158. package/src/framer/streamProxy.ts +1 -1
  159. package/src/framer/streamer.spec.ts +1 -2
  160. package/src/framer/streamer.ts +4 -4
  161. package/src/framer/writer.spec.ts +1 -1
  162. package/src/framer/writer.ts +1 -1
  163. package/src/index.ts +2 -1
  164. package/src/label/access.spec.ts +1 -1
  165. package/src/label/client.ts +1 -1
  166. package/src/label/external.ts +1 -1
  167. package/src/label/index.ts +1 -1
  168. package/src/label/label.spec.ts +1 -1
  169. package/src/label/payload.ts +1 -1
  170. package/src/ontology/client.ts +6 -7
  171. package/src/ontology/external.ts +1 -1
  172. package/src/ontology/group/access.spec.ts +1 -1
  173. package/src/ontology/group/client.ts +1 -1
  174. package/src/ontology/group/external.ts +1 -1
  175. package/src/ontology/group/group.spec.ts +1 -1
  176. package/src/ontology/group/index.ts +1 -1
  177. package/src/ontology/group/payload.ts +1 -1
  178. package/src/ontology/index.ts +1 -1
  179. package/src/ontology/ontology.spec.ts +1 -1
  180. package/src/ontology/payload.ts +6 -3
  181. package/src/ontology/writer.ts +1 -1
  182. package/src/rack/access.spec.ts +1 -1
  183. package/src/rack/client.ts +1 -1
  184. package/src/rack/external.ts +1 -1
  185. package/src/rack/index.ts +1 -1
  186. package/src/rack/payload.ts +1 -1
  187. package/src/rack/rack.spec.ts +1 -1
  188. package/src/ranger/access.spec.ts +1 -1
  189. package/src/ranger/alias.ts +1 -1
  190. package/src/ranger/client.ts +1 -1
  191. package/src/ranger/external.ts +1 -1
  192. package/src/ranger/index.ts +1 -1
  193. package/src/ranger/kv.ts +1 -1
  194. package/src/ranger/payload.ts +1 -1
  195. package/src/ranger/ranger.spec.ts +1 -1
  196. package/src/ranger/writer.ts +1 -1
  197. package/src/status/access.spec.ts +1 -1
  198. package/src/status/client.ts +1 -1
  199. package/src/status/external.ts +1 -1
  200. package/src/status/index.ts +1 -1
  201. package/src/status/payload.ts +1 -1
  202. package/src/status/status.spec.ts +1 -1
  203. package/src/task/access.spec.ts +1 -1
  204. package/src/task/client.ts +11 -6
  205. package/src/task/external.ts +1 -1
  206. package/src/task/index.ts +1 -1
  207. package/src/task/payload.spec.ts +113 -0
  208. package/src/task/payload.ts +10 -5
  209. package/src/task/task.spec.ts +1 -1
  210. package/src/testutil/access.ts +1 -1
  211. package/src/testutil/channels.ts +1 -1
  212. package/src/testutil/client.ts +1 -1
  213. package/src/testutil/telem.ts +1 -1
  214. package/src/transport.ts +1 -1
  215. package/src/user/access.spec.ts +1 -1
  216. package/src/user/client.ts +1 -1
  217. package/src/user/external.ts +1 -1
  218. package/src/user/index.ts +1 -1
  219. package/src/user/payload.ts +1 -1
  220. package/src/user/user.spec.ts +1 -1
  221. package/src/util/decodeJSONString.ts +1 -1
  222. package/src/util/parseWithoutKeyConversion.ts +1 -1
  223. package/src/util/retrieve.spec.ts +1 -1
  224. package/src/util/retrieve.ts +1 -1
  225. package/src/util/telem.ts +1 -1
  226. package/src/view/client.ts +96 -0
  227. package/src/view/external.ts +11 -0
  228. package/src/view/index.ts +10 -0
  229. package/src/view/payload.ts +25 -0
  230. package/src/view/view.spec.ts +161 -0
  231. package/src/vite-env.d.ts +1 -1
  232. package/src/workspace/access.spec.ts +1 -1
  233. package/src/workspace/client.ts +1 -1
  234. package/src/workspace/external.ts +1 -1
  235. package/src/workspace/index.ts +1 -1
  236. package/src/workspace/lineplot/access.spec.ts +1 -1
  237. package/src/workspace/lineplot/client.ts +1 -1
  238. package/src/workspace/lineplot/external.ts +1 -1
  239. package/src/workspace/lineplot/index.ts +1 -1
  240. package/src/workspace/lineplot/lineplot.spec.ts +1 -1
  241. package/src/workspace/lineplot/payload.ts +1 -1
  242. package/src/workspace/log/access.spec.ts +1 -1
  243. package/src/workspace/log/client.ts +1 -1
  244. package/src/workspace/log/external.ts +1 -1
  245. package/src/workspace/log/index.ts +1 -1
  246. package/src/workspace/log/log.spec.ts +1 -1
  247. package/src/workspace/log/payload.ts +1 -1
  248. package/src/workspace/payload.ts +1 -1
  249. package/src/workspace/schematic/access.spec.ts +1 -1
  250. package/src/workspace/schematic/client.ts +1 -1
  251. package/src/workspace/schematic/external.ts +1 -1
  252. package/src/workspace/schematic/index.ts +1 -1
  253. package/src/workspace/schematic/payload.ts +1 -1
  254. package/src/workspace/schematic/schematic.spec.ts +1 -1
  255. package/src/workspace/schematic/symbol/access.spec.ts +1 -1
  256. package/src/workspace/schematic/symbol/client.spec.ts +1 -1
  257. package/src/workspace/schematic/symbol/client.ts +1 -1
  258. package/src/workspace/schematic/symbol/external.ts +1 -1
  259. package/src/workspace/schematic/symbol/index.ts +1 -1
  260. package/src/workspace/schematic/symbol/payload.ts +1 -1
  261. package/src/workspace/table/access.spec.ts +1 -1
  262. package/src/workspace/table/client.ts +1 -1
  263. package/src/workspace/table/external.ts +1 -1
  264. package/src/workspace/table/index.ts +1 -1
  265. package/src/workspace/table/payload.ts +1 -1
  266. package/src/workspace/table/table.spec.ts +1 -1
  267. package/src/workspace/workspace.spec.ts +1 -1
  268. package/vite.config.ts +1 -1
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -31,7 +31,6 @@ describe("arc", () => {
31
31
  edges: [],
32
32
  },
33
33
  text: { raw: "" },
34
- deploy: false,
35
34
  version: "1.0.0",
36
35
  };
37
36
  const randomArc = await client.arcs.create(a);
@@ -53,7 +52,6 @@ describe("arc", () => {
53
52
  edges: [],
54
53
  },
55
54
  text: { raw: "" },
56
- deploy: false,
57
55
  version: "1.0.0",
58
56
  });
59
57
  const retrieved = await userClient.arcs.retrieve({ key: randomArc.key });
@@ -74,7 +72,6 @@ describe("arc", () => {
74
72
  edges: [],
75
73
  },
76
74
  text: { raw: "" },
77
- deploy: false,
78
75
  version: "1.0.0",
79
76
  });
80
77
  });
@@ -93,7 +90,6 @@ describe("arc", () => {
93
90
  edges: [],
94
91
  },
95
92
  text: { raw: "" },
96
- deploy: false,
97
93
  version: "1.0.0",
98
94
  }),
99
95
  ).rejects.toThrow(AuthError);
@@ -112,7 +108,6 @@ describe("arc", () => {
112
108
  edges: [],
113
109
  },
114
110
  text: { raw: "" },
115
- deploy: false,
116
111
  version: "1.0.0",
117
112
  });
118
113
  await userClient.arcs.delete(randomArc.key);
@@ -134,7 +129,6 @@ describe("arc", () => {
134
129
  edges: [],
135
130
  },
136
131
  text: { raw: "" },
137
- deploy: false,
138
132
  version: "1.0.0",
139
133
  });
140
134
  await expect(userClient.arcs.delete(randomArc.key)).rejects.toThrow(AuthError);
package/src/arc/client.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
package/src/arc/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -592,11 +592,8 @@ describe("Arc LSP", () => {
592
592
  expect(diagnostics.length).toBeGreaterThan(0);
593
593
 
594
594
  // Position should be mapped correctly (line 0 for original expression)
595
- // Note: Parse errors may not be position-mapped correctly yet
596
- // This is a known limitation - for now we just verify diagnostics exist
597
595
  const firstDiag = diagnostics[0];
598
- console.log("Diagnostic position:", firstDiag.range.start);
599
- // expect(firstDiag.range.start.line).toBe(0);
596
+ expect(firstDiag.range.start.line).toBe(0);
600
597
  }
601
598
 
602
599
  stream.closeSend();
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -11,7 +11,6 @@ import { record, xy } from "@synnaxlabs/x";
11
11
  import { z } from "zod/v4";
12
12
 
13
13
  import { ontology } from "@/ontology";
14
- import { statusZ as baseStatusZ } from "@/status/payload";
15
14
  import { parseWithoutKeyConversion } from "@/util/parseWithoutKeyConversion";
16
15
 
17
16
  export const irNodeZ = z.object({
@@ -48,27 +47,23 @@ export const keyZ = z.uuid();
48
47
  export type Key = z.infer<typeof keyZ>;
49
48
  export type Params = Key | Key[];
50
49
 
51
- export const statusDetailsZ = z.object({
52
- running: z.boolean(),
53
- });
54
-
55
- export const statusZ = baseStatusZ(statusDetailsZ);
56
-
57
- export type Status = z.infer<typeof statusZ>;
50
+ export const modeZ = z
51
+ .enum(["graph", "text"])
52
+ .or(z.literal("").transform<"graph">(() => "graph"));
53
+ export type Mode = z.infer<typeof modeZ>;
58
54
 
59
55
  export const arcZ = z.object({
60
56
  key: keyZ,
61
57
  name: z.string(),
62
58
  graph: graphZ,
63
59
  text: textZ,
64
- deploy: z.boolean(),
65
60
  version: z.string(),
66
- status: statusZ.optional().nullable(),
61
+ mode: modeZ,
67
62
  });
68
63
 
69
64
  export interface Arc extends z.infer<typeof arcZ> {}
70
65
 
71
- export const newZ = arcZ.partial({ key: true }).omit({ status: true });
66
+ export const newZ = arcZ.partial({ key: true, mode: true });
72
67
  export interface New extends z.input<typeof newZ> {}
73
68
 
74
69
  export const ONTOLOGY_TYPE = "arc";
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
package/src/auth/auth.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
package/src/auth/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -55,7 +55,6 @@ describe("channelchannel.Retriever", () => {
55
55
  virtual: false,
56
56
  expression: "",
57
57
  operations: [],
58
- requires: [],
59
58
  }));
60
59
  });
61
60
  const retriever = new channel.DebouncedBatchRetriever(base, 10);
@@ -85,7 +84,6 @@ describe("channelchannel.Retriever", () => {
85
84
  virtual: false,
86
85
  expression: "",
87
86
  operations: [],
88
- requires: [],
89
87
  }));
90
88
  });
91
89
  const retriever = new channel.DebouncedBatchRetriever(base, 10);
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -11,7 +11,7 @@ import { DataType, id } from "@synnaxlabs/x";
11
11
  import { describe, expect, it, test } from "vitest";
12
12
 
13
13
  import { Channel } from "@/channel/client";
14
- import { NotFoundError, PathError } from "@/errors";
14
+ import { NotFoundError } from "@/errors";
15
15
  import { createTestClient } from "@/testutil/client";
16
16
 
17
17
  const client = createTestClient();
@@ -51,24 +51,17 @@ describe("Channel", () => {
51
51
  expect(calculatedCH.expression).toEqual(`return ${chOneName} * 2`);
52
52
  });
53
53
 
54
- test("create calculated, missing required channel", async () => {
55
- try {
56
- await client.channels.create({
57
- name: id.create(),
58
- virtual: true,
59
- dataType: DataType.FLOAT32,
60
- expression: `return 2`,
61
- });
62
- } catch (e) {
63
- expect((e as Error).message).toContain(
64
- "calculated channels must require at least one channel",
65
- );
66
- expect(PathError.matches(e)).toBe(true);
67
- expect((e as PathError).path).toEqual(["requires"]);
68
- expect((e as PathError).error.message).contain(
69
- "calculated channels must require at least one channel",
70
- );
71
- }
54
+ test("create calculated channel with constant expression", async () => {
55
+ // Calculated channels can now have constant expressions that don't
56
+ // reference other channels
57
+ const calculatedCH = await client.channels.create({
58
+ name: id.create(),
59
+ virtual: true,
60
+ dataType: DataType.FLOAT32,
61
+ expression: `return 2`,
62
+ });
63
+ expect(calculatedCH.virtual).toEqual(true);
64
+ expect(calculatedCH.expression).toEqual(`return 2`);
72
65
  });
73
66
 
74
67
  test("create index and indexed pair", async () => {
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -111,12 +111,11 @@ export class Channel {
111
111
  */
112
112
  readonly virtual: boolean;
113
113
  /**
114
- * Only used for calculated channels. Specifies the Lua expression used to evaluate
114
+ * Only used for calculated channels. Specifies the Arc expression used to evaluate
115
115
  * the calculated value
116
116
  */
117
117
  readonly expression: string;
118
118
  readonly operations: Operation[];
119
- readonly requires: Key[];
120
119
  /**
121
120
  * The status of the channel.
122
121
  */
@@ -136,14 +135,12 @@ export class Channel {
136
135
  status: argsStatus,
137
136
  expression = "",
138
137
  operations = [],
139
- requires = [],
140
138
  }: New & {
141
139
  internal?: boolean;
142
140
  frameClient?: framer.Client;
143
141
  density?: CrudeDensity;
144
142
  status?: status.Crude;
145
143
  operations?: Operation[];
146
- requires?: Key[];
147
144
  }) {
148
145
  this.key = keyZ.parse(key);
149
146
  this.name = name;
@@ -156,7 +153,6 @@ export class Channel {
156
153
  this.virtual = virtual;
157
154
  this.expression = expression;
158
155
  this.operations = operations;
159
- this.requires = requires;
160
156
  if (argsStatus != null) this.status = status.create(argsStatus);
161
157
  this._frameClient = frameClient ?? null;
162
158
  }
@@ -182,7 +178,6 @@ export class Channel {
182
178
  isIndex: this.isIndex,
183
179
  internal: this.internal,
184
180
  virtual: this.virtual,
185
- requires: this.requires,
186
181
  expression: this.expression,
187
182
  status: this.status,
188
183
  operations: this.operations,
@@ -222,16 +217,14 @@ export class Channel {
222
217
  }
223
218
  }
224
219
 
225
- export const CALCULATION_STATUS_CHANNEL_NAME = "sy_calculation_status";
226
-
227
220
  const retrieveGroupReqZ = z.object({});
228
221
 
229
222
  const retrieveGroupResZ = z.object({ group: group.groupZ });
230
223
 
231
224
  /**
232
- * The core client class for executing channel operations against a Synnax
233
- * cluster. This class should not be instantiated directly, and instead should be used
234
- * through the `channels` property of an {@link Synnax} client.
225
+ * The main client class for executing channel operations against a Synnax Core. This
226
+ * class should not be instantiated directly, and instead should be used through the
227
+ * `channels` property of an {@link Synnax} client.
235
228
  */
236
229
  export class Client {
237
230
  private readonly frameClient: framer.Client;
@@ -437,27 +430,3 @@ export class Client {
437
430
 
438
431
  export const isCalculated = ({ virtual, expression }: Payload): boolean =>
439
432
  virtual && expression !== "";
440
-
441
- export const isLegacyCalculated = (pld: Payload): boolean =>
442
- isCalculated(pld) && pld.requires.length > 0;
443
-
444
- export const resolveLegacyCalculatedIndex = async (
445
- retrieve: (key: Key) => Promise<Payload | null>,
446
- channel: Payload,
447
- ): Promise<Key | null> => {
448
- if (!isCalculated(channel)) return channel.index;
449
- for (const required of channel.requires) {
450
- const requiredChannel = await retrieve(required);
451
- if (requiredChannel == null) return null;
452
- if (!requiredChannel.virtual) return requiredChannel.index;
453
- }
454
- for (const required of channel.requires) {
455
- const requiredChannel = await retrieve(required);
456
- if (requiredChannel == null) return null;
457
- if (isCalculated(requiredChannel)) {
458
- const index = await resolveLegacyCalculatedIndex(retrieve, requiredChannel);
459
- if (index != null) return index;
460
- }
461
- }
462
- return null;
463
- };
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -58,6 +58,13 @@ export type Operation = z.infer<typeof operationZ>;
58
58
 
59
59
  export const statusZ = status.statusZ();
60
60
  export type Status = z.infer<typeof statusZ>;
61
+
62
+ export const calculationStatusDetailsZ = z.object({ channel: keyZ });
63
+ export type CalculationStatusDetails = z.infer<typeof calculationStatusDetailsZ>;
64
+ export const calculationStatusZ = status.statusZ(calculationStatusDetailsZ);
65
+ export type CalculationStatus = z.infer<typeof calculationStatusZ>;
66
+
67
+ export const statusKey = (key: Key): string => ontology.idToString(ontologyID(key));
61
68
  export const payloadZ = z.object({
62
69
  name: z.string(),
63
70
  key: keyZ,
@@ -71,7 +78,6 @@ export const payloadZ = z.object({
71
78
  expression: z.string().default(""),
72
79
  status: statusZ.optional(),
73
80
  operations: array.nullableZ(operationZ),
74
- requires: array.nullableZ(keyZ),
75
81
  });
76
82
  export interface Payload extends z.infer<typeof payloadZ> {}
77
83
 
@@ -85,11 +91,12 @@ export const newZ = payloadZ.extend({
85
91
  virtual: z.boolean().default(false),
86
92
  expression: z.string().default(""),
87
93
  operations: array.nullableZ(operationZ).optional(),
88
- requires: array.nullableZ(keyZ).optional(),
89
94
  });
90
95
 
91
- export interface New
92
- extends Omit<z.input<typeof newZ>, "dataType" | "status" | "internal"> {
96
+ export interface New extends Omit<
97
+ z.input<typeof newZ>,
98
+ "dataType" | "status" | "internal"
99
+ > {
93
100
  dataType: CrudeDataType;
94
101
  }
95
102
 
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -48,8 +48,10 @@ const reqZ = z.object({
48
48
  });
49
49
  export interface RetrieveRequest extends z.input<typeof reqZ> {}
50
50
 
51
- export interface RetrieveOptions
52
- extends Omit<RetrieveRequest, "keys" | "names" | "search"> {}
51
+ export interface RetrieveOptions extends Omit<
52
+ RetrieveRequest,
53
+ "keys" | "names" | "search"
54
+ > {}
53
55
  export interface PageOptions extends Omit<RetrieveOptions, "offset" | "limit"> {}
54
56
 
55
57
  const resZ = z.object({ channels: array.nullableZ(payloadZ) });
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
package/src/client.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -27,6 +27,7 @@ import { status } from "@/status";
27
27
  import { task } from "@/task";
28
28
  import { Transport } from "@/transport";
29
29
  import { user } from "@/user";
30
+ import { view } from "@/view";
30
31
  import { workspace } from "@/workspace";
31
32
 
32
33
  export const synnaxParamsZ = z.object({
@@ -71,6 +72,7 @@ export default class Synnax extends framer.Client {
71
72
  readonly devices: device.Client;
72
73
  readonly control: control.Client;
73
74
  readonly arcs: arc.Client;
75
+ readonly views: view.Client;
74
76
  static readonly connectivity = connection.Checker;
75
77
  private readonly transport: Transport;
76
78
 
@@ -153,6 +155,7 @@ export default class Synnax extends framer.Client {
153
155
  this.racks = new rack.Client(this.transport.unary, this.tasks);
154
156
  this.devices = new device.Client(this.transport.unary);
155
157
  this.arcs = new arc.Client(this.transport.unary, this.transport.stream);
158
+ this.views = new view.Client(this.transport.unary);
156
159
  }
157
160
 
158
161
  get key(): string {
@@ -164,8 +167,10 @@ export default class Synnax extends framer.Client {
164
167
  }
165
168
  }
166
169
 
167
- export interface CheckConnectionParams
168
- extends Pick<SynnaxParams, "host" | "port" | "secure" | "retry" | "name"> {}
170
+ export interface CheckConnectionParams extends Pick<
171
+ SynnaxParams,
172
+ "host" | "port" | "secure" | "retry" | "name"
173
+ > {}
169
174
 
170
175
  export const checkConnection = async (params: CheckConnectionParams) =>
171
176
  await newConnectionChecker(params).check();
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -48,7 +48,7 @@ const createWarning = (
48
48
  const toUpgrade = clientIsNewer ? "Core" : "client";
49
49
  return `Synnax Core version ${nodeVersion != null ? `${nodeVersion} ` : ""}is too ${clientIsNewer ? "old" : "new"} for client version ${clientVersion}.
50
50
  This may cause compatibility issues. We recommend updating the ${toUpgrade}. For more information, see
51
- https://docs.synnaxlabs.com/reference/typescript-client/troubleshooting#old-${toUpgrade}-version`;
51
+ https://docs.synnaxlabs.com/reference/client/resources/troubleshooting#old-${toUpgrade}-version`;
52
52
  };
53
53
 
54
54
  /** Polls a synnax cluster for connectivity information. */
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
package/src/errors.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.
@@ -1,4 +1,4 @@
1
- // Copyright 2025 Synnax Labs, Inc.
1
+ // Copyright 2026 Synnax Labs, Inc.
2
2
  //
3
3
  // Use of this software is governed by the Business Source License included in the file
4
4
  // licenses/BSL.txt.