@synnaxlabs/client 0.37.0 → 0.38.1

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 (178) hide show
  1. package/.turbo/turbo-build.log +7 -7
  2. package/dist/access/policy/payload.d.ts +10 -10
  3. package/dist/channel/client.d.ts +13 -1
  4. package/dist/channel/client.d.ts.map +1 -1
  5. package/dist/channel/payload.d.ts +14 -0
  6. package/dist/channel/payload.d.ts.map +1 -1
  7. package/dist/client.cjs +30 -30
  8. package/dist/client.js +2302 -2210
  9. package/dist/framer/frame.d.ts.map +1 -1
  10. package/dist/hardware/device/payload.d.ts +2 -2
  11. package/dist/hardware/device/payload.d.ts.map +1 -1
  12. package/dist/hardware/task/client.d.ts.map +1 -1
  13. package/dist/hardware/task/payload.d.ts +4 -4
  14. package/dist/hardware/task/payload.d.ts.map +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/label/client.d.ts.map +1 -1
  18. package/dist/ontology/client.d.ts.map +1 -1
  19. package/dist/ontology/group/group.d.ts.map +1 -1
  20. package/dist/ontology/payload.d.ts.map +1 -1
  21. package/dist/ranger/client.d.ts.map +1 -1
  22. package/dist/ranger/payload.d.ts +2 -2
  23. package/dist/ranger/payload.d.ts.map +1 -1
  24. package/dist/util/retrieve.d.ts.map +1 -1
  25. package/dist/util/zod.d.ts +1 -1
  26. package/dist/util/zod.d.ts.map +1 -1
  27. package/dist/workspace/client.d.ts.map +1 -1
  28. package/dist/workspace/lineplot/client.d.ts.map +1 -1
  29. package/dist/workspace/log/client.d.ts.map +1 -1
  30. package/dist/workspace/schematic/client.d.ts.map +1 -1
  31. package/dist/workspace/table/client.d.ts.map +1 -1
  32. package/eslint.config.js +1 -1
  33. package/examples/node/basicReadWrite.js +1 -1
  34. package/examples/node/liveStream.js +1 -1
  35. package/examples/node/package-lock.json +56 -5509
  36. package/examples/node/package.json +1 -1
  37. package/examples/node/seriesAndFrames.js +1 -1
  38. package/examples/node/streamWrite.js +1 -1
  39. package/package.json +11 -15
  40. package/src/access/client.ts +1 -1
  41. package/src/access/external.ts +1 -1
  42. package/src/access/index.ts +1 -1
  43. package/src/access/payload.ts +1 -1
  44. package/src/access/policy/client.ts +1 -1
  45. package/src/access/policy/external.ts +1 -1
  46. package/src/access/policy/index.ts +1 -1
  47. package/src/access/policy/payload.ts +1 -1
  48. package/src/access/policy/policy.spec.ts +2 -5
  49. package/src/access/policy/retriever.ts +1 -1
  50. package/src/access/policy/writer.ts +1 -1
  51. package/src/auth/auth.spec.ts +1 -1
  52. package/src/auth/auth.ts +1 -1
  53. package/src/auth/index.ts +1 -1
  54. package/src/channel/batchRetriever.spec.ts +5 -1
  55. package/src/channel/channel.spec.ts +109 -38
  56. package/src/channel/client.ts +48 -3
  57. package/src/channel/creator.ts +1 -1
  58. package/src/channel/external.ts +1 -1
  59. package/src/channel/index.ts +1 -1
  60. package/src/channel/payload.ts +6 -1
  61. package/src/channel/retriever.ts +1 -1
  62. package/src/channel/writer.ts +1 -1
  63. package/src/client.ts +1 -1
  64. package/src/connection/checker.ts +1 -1
  65. package/src/connection/connection.spec.ts +1 -1
  66. package/src/connection/index.ts +1 -1
  67. package/src/control/client.ts +1 -1
  68. package/src/control/external.ts +1 -1
  69. package/src/control/index.ts +1 -1
  70. package/src/control/state.spec.ts +1 -1
  71. package/src/control/state.ts +1 -1
  72. package/src/errors.spec.ts +1 -1
  73. package/src/errors.ts +1 -1
  74. package/src/framer/adapter.spec.ts +1 -1
  75. package/src/framer/adapter.ts +1 -1
  76. package/src/framer/client.spec.ts +1 -1
  77. package/src/framer/client.ts +1 -1
  78. package/src/framer/deleter.spec.ts +1 -1
  79. package/src/framer/deleter.ts +1 -1
  80. package/src/framer/external.ts +1 -1
  81. package/src/framer/frame.spec.ts +1 -1
  82. package/src/framer/frame.ts +4 -5
  83. package/src/framer/index.ts +1 -1
  84. package/src/framer/iterator.spec.ts +1 -1
  85. package/src/framer/iterator.ts +1 -1
  86. package/src/framer/streamProxy.ts +2 -2
  87. package/src/framer/streamer.spec.ts +179 -1
  88. package/src/framer/streamer.ts +1 -1
  89. package/src/framer/writer.spec.ts +1 -1
  90. package/src/framer/writer.ts +1 -1
  91. package/src/hardware/client.ts +1 -1
  92. package/src/hardware/device/client.ts +1 -1
  93. package/src/hardware/device/device.spec.ts +1 -1
  94. package/src/hardware/device/external.ts +1 -1
  95. package/src/hardware/device/index.ts +1 -1
  96. package/src/hardware/device/payload.ts +1 -1
  97. package/src/hardware/external.ts +1 -1
  98. package/src/hardware/index.ts +1 -1
  99. package/src/hardware/rack/client.ts +1 -1
  100. package/src/hardware/rack/external.ts +1 -1
  101. package/src/hardware/rack/index.ts +1 -1
  102. package/src/hardware/rack/payload.ts +1 -1
  103. package/src/hardware/rack/rack.spec.ts +1 -1
  104. package/src/hardware/task/client.ts +4 -3
  105. package/src/hardware/task/external.ts +1 -1
  106. package/src/hardware/task/index.ts +1 -1
  107. package/src/hardware/task/payload.ts +1 -1
  108. package/src/hardware/task/task.spec.ts +1 -1
  109. package/src/index.ts +2 -2
  110. package/src/label/client.ts +3 -3
  111. package/src/label/external.ts +1 -1
  112. package/src/label/index.ts +1 -1
  113. package/src/label/label.spec.ts +1 -1
  114. package/src/label/payload.ts +1 -1
  115. package/src/label/retriever.ts +1 -1
  116. package/src/label/writer.ts +1 -1
  117. package/src/ontology/client.ts +14 -7
  118. package/src/ontology/external.ts +1 -1
  119. package/src/ontology/group/client.ts +1 -1
  120. package/src/ontology/group/external.ts +1 -1
  121. package/src/ontology/group/group.spec.ts +1 -1
  122. package/src/ontology/group/group.ts +4 -6
  123. package/src/ontology/group/index.ts +1 -1
  124. package/src/ontology/group/payload.ts +1 -1
  125. package/src/ontology/group/writer.ts +1 -1
  126. package/src/ontology/index.ts +1 -1
  127. package/src/ontology/ontology.spec.ts +1 -1
  128. package/src/ontology/payload.ts +2 -2
  129. package/src/ontology/writer.ts +1 -1
  130. package/src/ranger/alias.ts +1 -1
  131. package/src/ranger/client.ts +11 -14
  132. package/src/ranger/external.ts +1 -1
  133. package/src/ranger/index.ts +1 -1
  134. package/src/ranger/kv.ts +1 -1
  135. package/src/ranger/payload.ts +3 -3
  136. package/src/ranger/ranger.spec.ts +1 -1
  137. package/src/ranger/writer.ts +1 -1
  138. package/src/setupspecs.ts +1 -1
  139. package/src/signals/external.ts +1 -1
  140. package/src/signals/index.ts +1 -1
  141. package/src/signals/observable.ts +1 -1
  142. package/src/transport.ts +1 -1
  143. package/src/user/client.ts +1 -1
  144. package/src/user/external.ts +1 -1
  145. package/src/user/index.ts +1 -1
  146. package/src/user/payload.ts +1 -1
  147. package/src/user/retriever.ts +1 -1
  148. package/src/user/user.spec.ts +1 -1
  149. package/src/user/writer.ts +1 -1
  150. package/src/util/retrieve.spec.ts +1 -1
  151. package/src/util/retrieve.ts +3 -3
  152. package/src/util/telem.ts +1 -1
  153. package/src/util/zod.ts +5 -2
  154. package/src/vite-env.d.ts +1 -1
  155. package/src/workspace/client.ts +11 -2
  156. package/src/workspace/index.ts +1 -1
  157. package/src/workspace/lineplot/client.ts +9 -0
  158. package/src/workspace/lineplot/index.ts +1 -1
  159. package/src/workspace/lineplot/linePlot.spec.ts +1 -1
  160. package/src/workspace/log/client.ts +9 -0
  161. package/src/workspace/log/index.ts +1 -1
  162. package/src/workspace/log/log.spec.ts +1 -1
  163. package/src/workspace/schematic/client.ts +9 -0
  164. package/src/workspace/schematic/index.ts +1 -1
  165. package/src/workspace/schematic/schematic.spec.ts +1 -1
  166. package/src/workspace/table/client.ts +9 -0
  167. package/src/workspace/table/index.ts +1 -1
  168. package/src/workspace/table/table.spec.ts +1 -1
  169. package/src/workspace/workspace.spec.ts +1 -1
  170. package/vite.config.ts +6 -13
  171. package/api/client.api.md +0 -3473
  172. package/api-extractor.json +0 -7
  173. package/dist/hardware/task/ni/types.d.ts +0 -14495
  174. package/dist/hardware/task/ni/types.d.ts.map +0 -1
  175. package/dist/workspace/lineplot/payload.d.ts +0 -23
  176. package/dist/workspace/lineplot/payload.d.ts.map +0 -1
  177. package/src/hardware/task/ni/types.ts +0 -1716
  178. package/src/workspace/lineplot/payload.ts +0 -30
@@ -1,4 +1,4 @@
1
- // Copyright 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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.
@@ -7,6 +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 { toArray, unique } from "@synnaxlabs/x";
10
11
  import {
11
12
  MultiSeries,
12
13
  Series,
@@ -17,8 +18,6 @@ import {
17
18
  TimeRange,
18
19
  TimeStamp,
19
20
  } from "@synnaxlabs/x/telem";
20
- import { toArray } from "@synnaxlabs/x/toArray";
21
- import { unique } from "@synnaxlabs/x/unique";
22
21
  import { z } from "zod";
23
22
 
24
23
  import {
@@ -177,7 +176,7 @@ export class Frame {
177
176
  * error otherwise.
178
177
  */
179
178
  get uniqueKeys(): Keys {
180
- return unique(this.keys);
179
+ return unique.unique(this.keys);
181
180
  }
182
181
 
183
182
  /**
@@ -194,7 +193,7 @@ export class Frame {
194
193
  * otherwise.
195
194
  */
196
195
  get uniqueNames(): Names {
197
- return unique(this.names);
196
+ return unique.unique(this.names);
198
197
  }
199
198
 
200
199
  /**
@@ -1,4 +1,4 @@
1
- // Copyright 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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.
@@ -35,7 +35,7 @@ export class StreamProxy<RQ extends z.ZodTypeAny, RS extends z.ZodTypeAny> {
35
35
  const [res, err] = await this.stream.receive();
36
36
  if (res != null)
37
37
  console.warn(
38
- `${this.name} received unexpected response on closure.
38
+ `${this.name} received unexpected response on closure.
39
39
  Please report this error to the Synnax team. ${JSON.stringify(res)}`,
40
40
  );
41
41
  if (err != null) {
@@ -1,4 +1,4 @@
1
- // Copyright 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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.
@@ -108,3 +108,181 @@ describe("Streamer", () => {
108
108
  expect(Array.from(d.get(ch.key))).toEqual([1]);
109
109
  });
110
110
  });
111
+
112
+ describe("Streamer - Calculated Channels", () => {
113
+ test("basic calculated channel streaming", async () => {
114
+ // Create a timestamp index channel
115
+ const timeChannel = await client.channels.create({
116
+ name: "calc_test_time",
117
+ isIndex: true,
118
+ dataType: DataType.TIMESTAMP,
119
+ });
120
+
121
+ // Create source channels with the timestamp index
122
+ const [channelA, channelB] = await client.channels.create([
123
+ {
124
+ name: "test_a",
125
+ dataType: DataType.FLOAT64,
126
+ index: timeChannel.key,
127
+ },
128
+ {
129
+ name: "test_b",
130
+ dataType: DataType.FLOAT64,
131
+ index: timeChannel.key,
132
+ },
133
+ ]);
134
+
135
+ // Create calculated channel that adds the two source channels
136
+ const calcChannel = await client.channels.create({
137
+ name: "test_calc",
138
+ dataType: DataType.FLOAT64,
139
+ index: timeChannel.key,
140
+ virtual: true,
141
+ expression: "return test_a + test_b",
142
+ requires: [channelA.key, channelB.key],
143
+ });
144
+
145
+ // Set up streamer to listen for calculated results
146
+ const streamer = await client.openStreamer(calcChannel.key);
147
+
148
+ // Give streamer time to initialize
149
+ await new Promise((resolve) => setTimeout(resolve, 100));
150
+
151
+ // Write test data
152
+ const startTime = TimeStamp.now();
153
+ const writer = await client.openWriter({
154
+ start: startTime,
155
+ channels: [timeChannel.key, channelA.key, channelB.key],
156
+ });
157
+
158
+ try {
159
+ // Write test values - each source gets 2.5 so sum should be 5.0
160
+ await writer.write({
161
+ [timeChannel.key]: [startTime],
162
+ [channelA.key]: new Float64Array([2.5]),
163
+ [channelB.key]: new Float64Array([2.5]),
164
+ });
165
+
166
+ // Read from streamer
167
+ const frame = await streamer.read();
168
+
169
+ // Verify calculated results
170
+ const calcData = Array.from(frame.get(calcChannel.key));
171
+ expect(calcData).toEqual([5.0]);
172
+ } finally {
173
+ await writer.close();
174
+ streamer.close();
175
+ }
176
+ });
177
+ test("calculated channel with constant", async () => {
178
+ // Create an index channel for timestamps
179
+ const timeChannel = await client.channels.create({
180
+ name: "calc_const_time",
181
+ isIndex: true,
182
+ dataType: DataType.TIMESTAMP,
183
+ });
184
+
185
+ // Create base channel with index
186
+ const baseChannel = await client.channels.create({
187
+ name: "base_channel",
188
+ dataType: DataType.FLOAT64,
189
+ index: timeChannel.key,
190
+ });
191
+
192
+ // Create calculated channel that adds 5
193
+ const calcChannel = await client.channels.create({
194
+ name: "calc_const_channel",
195
+ dataType: DataType.FLOAT64,
196
+ index: timeChannel.key,
197
+ virtual: true,
198
+ expression: `return ${baseChannel.name} + 5`,
199
+ requires: [baseChannel.key],
200
+ });
201
+
202
+ const streamer = await client.openStreamer(calcChannel.key);
203
+ await new Promise((resolve) => setTimeout(resolve, 100));
204
+
205
+ const startTime = TimeStamp.now();
206
+ const writer = await client.openWriter({
207
+ start: startTime,
208
+ channels: [timeChannel.key, baseChannel.key],
209
+ });
210
+
211
+ try {
212
+ const timestamps = [
213
+ startTime,
214
+ new TimeStamp(startTime.valueOf() + BigInt(1000000000)),
215
+ new TimeStamp(startTime.valueOf() + BigInt(2000000000)),
216
+ ];
217
+
218
+ await writer.write({
219
+ [timeChannel.key]: timestamps,
220
+ [baseChannel.key]: new Float64Array([1, 2, 3]),
221
+ });
222
+
223
+ const frame = await streamer.read();
224
+ const calcData = Array.from(frame.get(calcChannel.key));
225
+ expect(calcData).toEqual([6, 7, 8]); // Original values + 5
226
+ } finally {
227
+ await writer.close();
228
+ streamer.close();
229
+ }
230
+ });
231
+
232
+ test("calculated channel with multiple operations", async () => {
233
+ // Create timestamp channel
234
+ const timeChannel = await client.channels.create({
235
+ name: "calc_multi_time",
236
+ isIndex: true,
237
+ dataType: DataType.TIMESTAMP,
238
+ });
239
+
240
+ // Create source channels
241
+ const [channelA, channelB] = await client.channels.create([
242
+ {
243
+ name: "multi_test_a",
244
+ dataType: DataType.FLOAT64,
245
+ index: timeChannel.key,
246
+ },
247
+ {
248
+ name: "multi_test_b",
249
+ dataType: DataType.FLOAT64,
250
+ index: timeChannel.key,
251
+ },
252
+ ]);
253
+
254
+ // Create calculated channel with multiple operations
255
+ const calcChannel = await client.channels.create({
256
+ name: "multi_calc",
257
+ dataType: DataType.FLOAT64,
258
+ index: timeChannel.key,
259
+ virtual: true,
260
+ expression: "return (multi_test_a * 2) + (multi_test_b / 2)",
261
+ requires: [channelA.key, channelB.key],
262
+ });
263
+
264
+ const streamer = await client.openStreamer(calcChannel.key);
265
+ await new Promise((resolve) => setTimeout(resolve, 100));
266
+
267
+ const startTime = TimeStamp.now();
268
+ const writer = await client.openWriter({
269
+ start: startTime,
270
+ channels: [timeChannel.key, channelA.key, channelB.key],
271
+ });
272
+
273
+ try {
274
+ await writer.write({
275
+ [timeChannel.key]: [startTime],
276
+ [channelA.key]: new Float64Array([2.0]), // Will be multiplied by 2 = 4.0
277
+ [channelB.key]: new Float64Array([4.0]), // Will be divided by 2 = 2.0
278
+ });
279
+
280
+ const frame = await streamer.read();
281
+ const calcData = Array.from(frame.get(calcChannel.key));
282
+ expect(calcData).toEqual([6.0]); // (2.0 * 2) + (4.0 / 2) = 4.0 + 2.0 = 6.0
283
+ } finally {
284
+ await writer.close();
285
+ streamer.close();
286
+ }
287
+ });
288
+ });
@@ -1,4 +1,4 @@
1
- // Copyright 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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.
@@ -24,6 +24,7 @@ import {
24
24
  commandZ,
25
25
  type NewTask,
26
26
  newTaskZ,
27
+ ontologyID as payloadOntologyID,
27
28
  type Payload,
28
29
  type State,
29
30
  type StateObservable,
@@ -32,7 +33,7 @@ import {
32
33
  taskKeyZ,
33
34
  taskZ,
34
35
  } from "@/hardware/task/payload";
35
- import { ontology } from "@/ontology";
36
+ import { type ontology } from "@/ontology";
36
37
  import { type ranger } from "@/ranger";
37
38
  import { signals } from "@/signals";
38
39
  import { analyzeParams, checkForMultipleOrNoResults } from "@/util/retrieve";
@@ -95,7 +96,7 @@ export class Task<
95
96
  }
96
97
 
97
98
  get ontologyID(): ontology.ID {
98
- return new ontology.ID({ type: "task", key: this.key });
99
+ return payloadOntologyID(this.key);
99
100
  }
100
101
 
101
102
  async executeCommand(type: string, args?: UnknownRecord): Promise<string> {
@@ -1,4 +1,4 @@
1
- // Copyright 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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.
@@ -10,7 +10,7 @@
10
10
  export { access } from "@/access";
11
11
  export { policy } from "@/access/policy";
12
12
  export { channel } from "@/channel";
13
- export { Channel } from "@/channel/client";
13
+ export { Channel, isCalculated } from "@/channel/client";
14
14
  export { default as Synnax, type SynnaxProps, synnaxPropsZ } from "@/client";
15
15
  export * from "@/connection";
16
16
  export { control } from "@/control";
@@ -1,4 +1,4 @@
1
- // Copyright 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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.
@@ -12,7 +12,7 @@ import { observe } from "@synnaxlabs/x";
12
12
  import { type AsyncTermSearcher } from "@synnaxlabs/x/search";
13
13
 
14
14
  import { type framer } from "@/framer";
15
- import { type Key, type Label, labelZ } from "@/label/payload";
15
+ import { type Key, type Label, labelZ, ontologyID } from "@/label/payload";
16
16
  import { Retriever } from "@/label/retriever";
17
17
  import { type NewLabelPayload, type SetOptions, Writer } from "@/label/writer";
18
18
  import { ontology } from "@/ontology";
@@ -105,7 +105,7 @@ export class Client implements AsyncTermSearcher<string, Key, Label> {
105
105
  ): Promise<observe.ObservableAsyncCloseable<Label[]>> {
106
106
  const wrapper = new observe.Observer<Label[]>();
107
107
  const initial = (await this.retrieveFor(id)).map((l) => ({
108
- id: new ontology.ID({ key: l.key, type: "label" }),
108
+ id: ontologyID(l.key),
109
109
  key: l.key,
110
110
  name: l.name,
111
111
  data: l,
@@ -1,4 +1,4 @@
1
- // Copyright 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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.
@@ -8,7 +8,7 @@
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
10
  import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
11
- import { observe, toArray } from "@synnaxlabs/x";
11
+ import { observe, strings, toArray } from "@synnaxlabs/x";
12
12
  import { type AsyncTermSearcher } from "@synnaxlabs/x/search";
13
13
  import { z } from "zod";
14
14
 
@@ -123,7 +123,11 @@ export class Client implements AsyncTermSearcher<string, string, Resource> {
123
123
  const resources = await this.execRetrieve({ ids: parseIDs(ids), ...options });
124
124
  if (Array.isArray(ids)) return resources;
125
125
  if (resources.length === 0)
126
- throw new QueryError(`No resource found with ID ${ids.toString()}`);
126
+ throw new QueryError(
127
+ `No resource found with ID ${strings.naturalLanguageJoin(
128
+ toArray(ids).map((id) => new ID(id).toString()),
129
+ )}`,
130
+ );
127
131
  return resources[0];
128
132
  }
129
133
 
@@ -458,10 +462,13 @@ export class DependentTracker
458
462
  c.key[oppositeDirection(this.relDir)].type === this.resourceType),
459
463
  );
460
464
  if (sets.length === 0) return this.notify(this.dependents);
461
- this.client.retrieve(sets.map((s) => s.key.to)).then((resources) => {
462
- this.dependents = this.dependents.concat(resources);
463
- this.notify(this.dependents);
464
- });
465
+ this.client
466
+ .retrieve(sets.map((s) => s.key.to))
467
+ .then((resources) => {
468
+ this.dependents = this.dependents.concat(resources);
469
+ this.notify(this.dependents);
470
+ })
471
+ .catch(console.error);
465
472
  };
466
473
 
467
474
  async close(): Promise<void> {
@@ -1,4 +1,4 @@
1
- // Copyright 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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 2024 Synnax Labs, Inc.
1
+ // Copyright 2025 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.