@synnaxlabs/client 0.22.0 → 0.23.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 (229) hide show
  1. package/.turbo/turbo-build.log +7 -6
  2. package/dist/auth/auth.d.ts.map +1 -1
  3. package/dist/channel/client.d.ts +14 -4
  4. package/dist/channel/client.d.ts.map +1 -1
  5. package/dist/channel/creator.d.ts +1 -1
  6. package/dist/channel/creator.d.ts.map +1 -1
  7. package/dist/channel/external.d.ts +1 -1
  8. package/dist/channel/external.d.ts.map +1 -1
  9. package/dist/channel/payload.d.ts +21 -8
  10. package/dist/channel/payload.d.ts.map +1 -1
  11. package/dist/channel/retriever.d.ts +6 -6
  12. package/dist/channel/retriever.d.ts.map +1 -1
  13. package/dist/channel/writer.d.ts +13 -1
  14. package/dist/channel/writer.d.ts.map +1 -1
  15. package/dist/client.cjs +17 -18
  16. package/dist/client.d.ts +4 -2
  17. package/dist/client.d.ts.map +1 -1
  18. package/dist/client.js +5487 -13607
  19. package/dist/connection/checker.d.ts +4 -4
  20. package/dist/control/client.d.ts +9 -0
  21. package/dist/control/client.d.ts.map +1 -0
  22. package/dist/control/external.d.ts +1 -1
  23. package/dist/control/external.d.ts.map +1 -1
  24. package/dist/control/state.d.ts +17 -52
  25. package/dist/control/state.d.ts.map +1 -1
  26. package/dist/errors.d.ts +6 -0
  27. package/dist/errors.d.ts.map +1 -1
  28. package/dist/framer/adapter.d.ts +1 -1
  29. package/dist/framer/adapter.d.ts.map +1 -1
  30. package/dist/framer/client.d.ts +7 -5
  31. package/dist/framer/client.d.ts.map +1 -1
  32. package/dist/framer/deleter.d.ts +68 -0
  33. package/dist/framer/deleter.d.ts.map +1 -0
  34. package/dist/framer/deleter.spec.d.ts +2 -0
  35. package/dist/framer/deleter.spec.d.ts.map +1 -0
  36. package/dist/framer/frame.d.ts +45 -241
  37. package/dist/framer/frame.d.ts.map +1 -1
  38. package/dist/framer/iterator.d.ts +1 -1
  39. package/dist/framer/iterator.d.ts.map +1 -1
  40. package/dist/framer/streamProxy.d.ts.map +1 -1
  41. package/dist/framer/streamer.d.ts.map +1 -1
  42. package/dist/framer/writer.d.ts +86 -231
  43. package/dist/framer/writer.d.ts.map +1 -1
  44. package/dist/hardware/device/client.d.ts +9 -7
  45. package/dist/hardware/device/client.d.ts.map +1 -1
  46. package/dist/hardware/task/client.d.ts +17 -14
  47. package/dist/hardware/task/client.d.ts.map +1 -1
  48. package/dist/index.d.ts +12 -11
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/label/client.d.ts.map +1 -1
  51. package/dist/label/external.d.ts +2 -2
  52. package/dist/label/external.d.ts.map +1 -1
  53. package/dist/label/writer.d.ts +4 -2
  54. package/dist/label/writer.d.ts.map +1 -1
  55. package/dist/ontology/client.d.ts +8 -8
  56. package/dist/ontology/client.d.ts.map +1 -1
  57. package/dist/ontology/group/client.d.ts +1 -1
  58. package/dist/ontology/group/client.d.ts.map +1 -1
  59. package/dist/ontology/group/external.d.ts +1 -1
  60. package/dist/ontology/group/external.d.ts.map +1 -1
  61. package/dist/ontology/group/writer.d.ts +1 -1
  62. package/dist/ontology/group/writer.d.ts.map +1 -1
  63. package/dist/ontology/payload.d.ts +14 -26
  64. package/dist/ontology/payload.d.ts.map +1 -1
  65. package/dist/ontology/writer.d.ts.map +1 -1
  66. package/dist/ranger/active.d.ts +1 -1
  67. package/dist/ranger/active.d.ts.map +1 -1
  68. package/dist/ranger/alias.d.ts.map +1 -1
  69. package/dist/ranger/client.d.ts +16 -100
  70. package/dist/ranger/client.d.ts.map +1 -1
  71. package/dist/ranger/external.d.ts +2 -2
  72. package/dist/ranger/external.d.ts.map +1 -1
  73. package/dist/ranger/kv.d.ts.map +1 -1
  74. package/dist/ranger/payload.d.ts +34 -270
  75. package/dist/ranger/payload.d.ts.map +1 -1
  76. package/dist/ranger/range.d.ts +1 -1
  77. package/dist/ranger/range.d.ts.map +1 -1
  78. package/dist/ranger/writer.d.ts.map +1 -1
  79. package/dist/transport.d.ts.map +1 -1
  80. package/dist/util/retrieve.d.ts.map +1 -1
  81. package/dist/util/zod.d.ts +1 -1
  82. package/dist/util/zod.d.ts.map +1 -1
  83. package/dist/workspace/client.d.ts.map +1 -1
  84. package/dist/workspace/external.d.ts +1 -1
  85. package/dist/workspace/external.d.ts.map +1 -1
  86. package/dist/workspace/lineplot/client.d.ts +1 -1
  87. package/dist/workspace/lineplot/client.d.ts.map +1 -1
  88. package/dist/workspace/lineplot/external.d.ts +1 -1
  89. package/dist/workspace/lineplot/external.d.ts.map +1 -1
  90. package/dist/workspace/lineplot/payload.d.ts +2 -2
  91. package/dist/workspace/lineplot/retriever.d.ts.map +1 -1
  92. package/dist/workspace/lineplot/writer.d.ts +4 -4
  93. package/dist/workspace/lineplot/writer.d.ts.map +1 -1
  94. package/dist/workspace/payload.d.ts +6 -4
  95. package/dist/workspace/payload.d.ts.map +1 -1
  96. package/dist/workspace/retriever.d.ts.map +1 -1
  97. package/dist/workspace/schematic/client.d.ts.map +1 -1
  98. package/dist/workspace/schematic/external.d.ts +1 -1
  99. package/dist/workspace/schematic/external.d.ts.map +1 -1
  100. package/dist/workspace/schematic/payload.d.ts +2 -2
  101. package/dist/workspace/schematic/retriever.d.ts +1 -1
  102. package/dist/workspace/schematic/retriever.d.ts.map +1 -1
  103. package/dist/workspace/schematic/writer.d.ts +4 -4
  104. package/dist/workspace/schematic/writer.d.ts.map +1 -1
  105. package/dist/workspace/writer.d.ts +7 -5
  106. package/dist/workspace/writer.d.ts.map +1 -1
  107. package/eslint.config.js +12 -0
  108. package/examples/node/basicReadWrite.js +11 -2
  109. package/examples/node/liveStream.js +13 -4
  110. package/examples/node/seriesAndFrames.js +12 -3
  111. package/examples/node/streamWrite.js +15 -6
  112. package/package.json +11 -8
  113. package/src/auth/auth.spec.ts +7 -6
  114. package/src/auth/auth.ts +17 -13
  115. package/src/auth/index.ts +1 -1
  116. package/src/channel/batchRetriever.spec.ts +16 -5
  117. package/src/channel/channel.spec.ts +42 -4
  118. package/src/channel/client.ts +26 -9
  119. package/src/channel/creator.ts +2 -2
  120. package/src/channel/external.ts +2 -2
  121. package/src/channel/index.ts +1 -1
  122. package/src/channel/payload.ts +3 -1
  123. package/src/channel/retriever.ts +6 -4
  124. package/src/channel/writer.ts +23 -4
  125. package/src/client.ts +5 -3
  126. package/src/connection/checker.ts +1 -1
  127. package/src/connection/connection.spec.ts +1 -1
  128. package/src/connection/index.ts +1 -1
  129. package/src/control/client.ts +17 -0
  130. package/src/control/external.ts +2 -2
  131. package/src/control/index.ts +1 -1
  132. package/src/control/state.spec.ts +2 -3
  133. package/src/control/state.ts +20 -84
  134. package/src/errors.ts +18 -7
  135. package/src/framer/adapter.spec.ts +9 -0
  136. package/src/framer/adapter.ts +3 -3
  137. package/src/framer/client.spec.ts +1 -1
  138. package/src/framer/client.ts +34 -14
  139. package/src/framer/deleter.spec.ts +129 -0
  140. package/src/framer/deleter.ts +49 -0
  141. package/src/framer/external.ts +1 -1
  142. package/src/framer/frame.spec.ts +1 -1
  143. package/src/framer/frame.ts +14 -14
  144. package/src/framer/index.ts +1 -1
  145. package/src/framer/iterator.spec.ts +2 -2
  146. package/src/framer/iterator.ts +2 -2
  147. package/src/framer/streamProxy.ts +2 -4
  148. package/src/framer/streamer.spec.ts +2 -2
  149. package/src/framer/streamer.ts +6 -5
  150. package/src/framer/writer.spec.ts +18 -1
  151. package/src/framer/writer.ts +19 -27
  152. package/src/hardware/device/client.ts +2 -2
  153. package/src/hardware/device/index.ts +1 -1
  154. package/src/hardware/external.ts +1 -1
  155. package/src/hardware/index.ts +1 -1
  156. package/src/hardware/rack/rack.spec.ts +1 -1
  157. package/src/hardware/task/client.ts +3 -3
  158. package/src/hardware/task/task.spec.ts +2 -2
  159. package/src/index.ts +26 -25
  160. package/src/label/client.ts +2 -2
  161. package/src/label/external.ts +3 -3
  162. package/src/label/index.ts +1 -1
  163. package/src/label/label.spec.ts +1 -1
  164. package/src/label/payload.ts +1 -1
  165. package/src/label/retriever.ts +1 -1
  166. package/src/label/writer.ts +1 -1
  167. package/src/ontology/client.ts +7 -7
  168. package/src/ontology/external.ts +1 -1
  169. package/src/ontology/group/client.ts +3 -3
  170. package/src/ontology/group/external.ts +2 -2
  171. package/src/ontology/group/group.spec.ts +2 -2
  172. package/src/ontology/group/group.ts +1 -1
  173. package/src/ontology/group/index.ts +1 -1
  174. package/src/ontology/group/payload.ts +1 -1
  175. package/src/ontology/group/writer.ts +22 -6
  176. package/src/ontology/index.ts +1 -1
  177. package/src/ontology/ontology.spec.ts +2 -2
  178. package/src/ontology/payload.ts +3 -3
  179. package/src/ontology/writer.ts +2 -2
  180. package/src/ranger/active.ts +2 -2
  181. package/src/ranger/alias.ts +2 -2
  182. package/src/ranger/client.ts +15 -16
  183. package/src/ranger/external.ts +3 -3
  184. package/src/ranger/index.ts +1 -1
  185. package/src/ranger/kv.ts +2 -2
  186. package/src/ranger/payload.ts +1 -1
  187. package/src/ranger/range.ts +2 -2
  188. package/src/ranger/ranger.spec.ts +1 -1
  189. package/src/ranger/writer.ts +3 -3
  190. package/src/setupspecs.ts +1 -1
  191. package/src/signals/external.ts +1 -1
  192. package/src/signals/index.ts +1 -1
  193. package/src/signals/observable.ts +1 -1
  194. package/src/transport.ts +2 -2
  195. package/src/user/index.ts +1 -1
  196. package/src/user/payload.ts +1 -1
  197. package/src/util/retrieve.spec.ts +1 -1
  198. package/src/util/retrieve.ts +1 -1
  199. package/src/util/telem.ts +1 -1
  200. package/src/util/zod.ts +11 -2
  201. package/src/vite-env.d.ts +2 -2
  202. package/src/workspace/client.ts +2 -2
  203. package/src/workspace/external.ts +2 -2
  204. package/src/workspace/index.ts +1 -1
  205. package/src/workspace/lineplot/client.ts +2 -2
  206. package/src/workspace/lineplot/external.ts +2 -2
  207. package/src/workspace/lineplot/index.ts +1 -1
  208. package/src/workspace/lineplot/linePlot.spec.ts +2 -2
  209. package/src/workspace/lineplot/payload.ts +1 -1
  210. package/src/workspace/lineplot/retriever.ts +4 -10
  211. package/src/workspace/lineplot/writer.ts +4 -4
  212. package/src/workspace/payload.ts +11 -6
  213. package/src/workspace/retriever.ts +12 -6
  214. package/src/workspace/schematic/client.ts +2 -2
  215. package/src/workspace/schematic/external.ts +2 -2
  216. package/src/workspace/schematic/index.ts +1 -1
  217. package/src/workspace/schematic/payload.ts +1 -1
  218. package/src/workspace/schematic/retriever.ts +17 -18
  219. package/src/workspace/schematic/schematic.spec.ts +2 -2
  220. package/src/workspace/schematic/writer.ts +5 -5
  221. package/src/workspace/workspace.spec.ts +2 -2
  222. package/src/workspace/writer.ts +3 -3
  223. package/vite.config.ts +3 -4
  224. package/.eslintrc.cjs +0 -18
  225. package/dist/client.cjs.map +0 -1
  226. package/dist/client.js.map +0 -1
  227. package/dist/control/authority.d.ts +0 -8
  228. package/dist/control/authority.d.ts.map +0 -1
  229. package/src/control/authority.ts +0 -26
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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,10 +8,11 @@
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
10
  export * from "@/channel";
11
- export { default as Synnax, synnaxPropsZ } from "@/client";
11
+ export { Channel } from "@/channel/client";
12
12
  export type { SynnaxProps } from "@/client";
13
+ export { default as Synnax, synnaxPropsZ } from "@/client";
13
14
  export * from "@/connection";
14
- export { Channel } from "@/channel/client";
15
+ export { control } from "@/control";
15
16
  export {
16
17
  AuthError,
17
18
  ContiguityError,
@@ -22,37 +23,37 @@ export {
22
23
  } from "@/errors";
23
24
  export { framer } from "@/framer";
24
25
  export { Frame } from "@/framer/frame";
26
+ export { hardware } from "@/hardware";
27
+ export { device } from "@/hardware/device";
28
+ export { rack } from "@/hardware/rack";
29
+ export { task } from "@/hardware/task";
30
+ export { label } from "@/label";
25
31
  export { ontology } from "@/ontology";
26
- export { control } from "@/control";
27
- export { Authority } from "@/control/authority";
28
- export {
29
- DataType,
30
- Density,
31
- Rate,
32
- Series,
33
- TimeRange,
34
- TimeSpan,
35
- TimeStamp,
36
- MultiSeries,
37
- } from "@synnaxlabs/x/telem";
32
+ export { ranger } from "@/ranger";
33
+ export { signals } from "@/signals";
34
+ export { workspace } from "@/workspace";
38
35
  export type {
39
- TypedArray,
40
36
  CrudeDataType,
41
37
  CrudeDensity,
42
38
  CrudeRate,
43
39
  CrudeSize,
44
40
  CrudeTimeSpan,
45
41
  CrudeTimeStamp,
46
- TelemValue,
47
42
  NumericTelemValue,
43
+ TelemValue,
48
44
  TimeStampStringFormat,
45
+ TypedArray,
49
46
  TZInfo,
50
47
  } from "@synnaxlabs/x/telem";
51
- export { workspace } from "@/workspace";
52
- export { ranger } from "@/ranger";
53
- export { label } from "@/label";
54
- export { hardware } from "@/hardware";
55
- export { rack } from "@/hardware/rack";
56
- export { task } from "@/hardware/task";
57
- export { device } from "@/hardware/device";
58
- export { signals } from "@/signals";
48
+ export {
49
+ DataType,
50
+ Density,
51
+ MultiSeries,
52
+ Rate,
53
+ Series,
54
+ TimeRange,
55
+ TimeSpan,
56
+ TimeStamp,
57
+ } from "@synnaxlabs/x/telem";
58
+ import { control } from "@synnaxlabs/x";
59
+ export const Authority = control.Authority;
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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.
@@ -13,7 +13,7 @@ import { type AsyncTermSearcher } from "@synnaxlabs/x/search";
13
13
  import { type framer } from "@/framer";
14
14
  import { type Key, type Label, labelZ } from "@/label/payload";
15
15
  import { Retriever } from "@/label/retriever";
16
- import { Writer, type NewLabelPayload } from "@/label/writer";
16
+ import { type NewLabelPayload,Writer } from "@/label/writer";
17
17
  import { type ontology } from "@/ontology";
18
18
  import { signals } from "@/signals";
19
19
 
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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,6 +8,6 @@
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
10
  export * from "@/label/client";
11
- export * from "@/label/writer";
12
- export * from "@/label/retriever";
13
11
  export * from "@/label/payload";
12
+ export * from "@/label/retriever";
13
+ export * from "@/label/writer";
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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,25 +8,25 @@
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
12
  import { type AsyncTermSearcher } from "@synnaxlabs/x/search";
13
+ import { z } from "zod";
12
14
 
13
15
  import { QueryError } from "@/errors";
14
16
  import { framer } from "@/framer";
17
+ import { Frame } from "@/framer/frame";
15
18
  import { group } from "@/ontology/group";
16
19
  import {
17
20
  ID,
18
21
  IDPayload,
19
- RelationshipChange,
20
- ResourceChange,
21
22
  idZ,
22
23
  parseRelationship,
23
- resourceSchemaZ,
24
+ RelationshipChange,
24
25
  type Resource,
26
+ ResourceChange,
27
+ resourceSchemaZ,
25
28
  } from "@/ontology/payload";
26
29
  import { Writer } from "@/ontology/writer";
27
- import { z } from "zod";
28
- import { observe, toArray } from "@synnaxlabs/x";
29
- import { Frame } from "@/framer/frame";
30
30
 
31
31
  const RETRIEVE_ENDPOINT = "/ontology/retrieve";
32
32
 
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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.
@@ -21,8 +21,8 @@ export class Client {
21
21
  this.creator = new Writer(unary);
22
22
  }
23
23
 
24
- async create(parent: ID, name: string): Promise<Group> {
25
- return this.sugar(await this.creator.create(parent, name));
24
+ async create(parent: ID, name: string, key?: string): Promise<Group> {
25
+ return this.sugar(await this.creator.create(parent, name, key));
26
26
  }
27
27
 
28
28
  async rename(key: string, name: string): Promise<void> {
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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,5 +7,5 @@
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 "@/ontology/group/group";
11
10
  export * from "@/ontology/group/client";
11
+ export * from "@/ontology/group/group";
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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,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 { describe, it, expect } from "vitest";
10
+ import { describe, expect,it } from "vitest";
11
11
 
12
12
  import { QueryError } from "@/errors";
13
13
  import { ontology } from "@/ontology";
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 { type UnaryClient } from "@synnaxlabs/freighter";
11
11
  import { z } from "zod";
12
12
 
13
13
  import { type Payload, payloadZ } from "@/ontology/group/payload";
14
- import { idZ, type ID } from "@/ontology/payload";
14
+ import { type ID, idZ } from "@/ontology/payload";
15
15
 
16
16
  const resZ = z.object({
17
17
  group: payloadZ,
@@ -19,6 +19,7 @@ const resZ = z.object({
19
19
 
20
20
  const createReqZ = z.object({
21
21
  parent: idZ,
22
+ key: z.string().uuid().optional(),
22
23
  name: z.string(),
23
24
  });
24
25
 
@@ -41,21 +42,36 @@ export class Writer {
41
42
  this.client = client;
42
43
  }
43
44
 
44
- async create(parent: ID, name: string): Promise<Payload> {
45
- const [res, err] = await this.client.send(Writer.ENDPOINT, {parent, name},createReqZ, resZ);
45
+ async create(parent: ID, name: string, key?: string): Promise<Payload> {
46
+ const [res, err] = await this.client.send(
47
+ Writer.ENDPOINT,
48
+ { parent, name, key },
49
+ createReqZ,
50
+ resZ,
51
+ );
46
52
  if (err != null) throw err;
47
53
  return res.group;
48
54
  }
49
55
 
50
56
  async rename(key: string, name: string): Promise<void> {
51
57
  const req = { key, name };
52
- const [, err] = await this.client.send(Writer.ENDPOINT_RENAME, req, renameReqZ, z.object({}));
58
+ const [, err] = await this.client.send(
59
+ Writer.ENDPOINT_RENAME,
60
+ req,
61
+ renameReqZ,
62
+ z.object({}),
63
+ );
53
64
  if (err != null) throw err;
54
65
  }
55
66
 
56
67
  async delete(keys: string[]): Promise<void> {
57
68
  const req = { keys };
58
- const [, err] = await this.client.send(Writer.ENDPOINT_DELETE, req, deleteReqZ, z.object({}));
69
+ const [, err] = await this.client.send(
70
+ Writer.ENDPOINT_DELETE,
71
+ req,
72
+ deleteReqZ,
73
+ z.object({}),
74
+ );
59
75
  if (err != null) throw err;
60
76
  }
61
77
  }
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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,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 { describe, expect, test, it } from "vitest";
10
+ import { describe, expect, it,test } from "vitest";
11
11
 
12
12
  import { ontology } from "@/ontology";
13
13
  import { newClient } from "@/setupspecs";
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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,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 { change } from "@synnaxlabs/x";
10
+ import { change,UnknownRecord } from "@synnaxlabs/x";
11
11
  import { z } from "zod";
12
12
 
13
13
  export type ResourceChange = change.Change<ID, Resource>;
@@ -109,7 +109,7 @@ export const resourceSchemaZ = z
109
109
  };
110
110
  });
111
111
 
112
- export type Resource<T extends {} = {}> = Omit<
112
+ export type Resource<T extends UnknownRecord = UnknownRecord> = Omit<
113
113
  z.output<typeof resourceSchemaZ>,
114
114
  "data"
115
115
  > & { data?: T | null };
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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
  import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
11
11
  import { z } from "zod";
12
12
 
13
- import { idZ, type ID } from "@/ontology/payload";
13
+ import { type ID,idZ } from "@/ontology/payload";
14
14
 
15
15
  const ENDPOINTS = {
16
16
  ADD_CHILDREN: "/ontology/add-children",
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
11
11
  import { z } from "zod";
12
12
 
13
13
  import { QueryError } from "@/errors";
14
- import { type Payload, payloadZ, type Key, keyZ } from "@/ranger/payload";
14
+ import { type Key, keyZ,type Payload, payloadZ } from "@/ranger/payload";
15
15
 
16
16
  const setActiveResZ = z.object({});
17
17
 
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 { type change } from "@synnaxlabs/x/change";
12
12
  import { z } from "zod";
13
13
 
14
14
  import { type channel } from "@/channel";
15
- import { keyZ as channelKeyZ, type Key as ChannelKey } from "@/channel/payload";
15
+ import { type Key as ChannelKey,keyZ as channelKeyZ } from "@/channel/payload";
16
16
  import { type Client as FrameClient } from "@/framer/client";
17
17
  import { type Key, keyZ } from "@/ranger/payload";
18
18
  import { signals } from "@/signals";
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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,33 +8,33 @@
8
8
  // included in the file licenses/APL.txt.
9
9
 
10
10
  import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
11
+ import { CrudeTimeRange, TimeRange } from "@synnaxlabs/x";
11
12
  import { type AsyncTermSearcher } from "@synnaxlabs/x/search";
12
13
  import { toArray } from "@synnaxlabs/x/toArray";
14
+ import { z } from "zod";
13
15
 
14
16
  import { type Retriever as ChannelRetriever } from "@/channel/retriever";
15
- import { MultipleFoundError, NotFoundError, QueryError } from "@/errors";
17
+ import { MultipleFoundError, NotFoundError } from "@/errors";
16
18
  import { type framer } from "@/framer";
17
19
  import { type label } from "@/label";
18
20
  import { Active } from "@/ranger/active";
19
21
  import { Aliaser } from "@/ranger/alias";
20
22
  import { KV } from "@/ranger/kv";
21
23
  import {
22
- type NewPayload,
24
+ analyzeParams,
23
25
  type Key,
24
26
  type Keys,
27
+ keyZ,
25
28
  type Name,
26
29
  type Names,
30
+ type NewPayload,
27
31
  type Params,
28
32
  type Payload,
29
- analyzeParams,
30
33
  payloadZ,
31
- keyZ,
32
34
  } from "@/ranger/payload";
33
35
  import { Range } from "@/ranger/range";
34
36
  import { type Writer } from "@/ranger/writer";
35
37
  import { signals } from "@/signals";
36
- import { z } from "zod";
37
- import { CrudeTimeRange, TimeRange } from "@synnaxlabs/x";
38
38
  import { nullableArrayZ } from "@/util/zod";
39
39
 
40
40
  const retrieveReqZ = z.object({
@@ -98,7 +98,7 @@ export class Client implements AsyncTermSearcher<string, Key, Range> {
98
98
  return this.sugar(await this.execRetrieve({ term }));
99
99
  }
100
100
 
101
- async page(offset: number, limit: number): Promise<Range[]> {
101
+ async page(): Promise<Range[]> {
102
102
  return [];
103
103
  }
104
104
 
@@ -122,15 +122,14 @@ export class Client implements AsyncTermSearcher<string, Key, Range> {
122
122
  }
123
123
 
124
124
  private async execRetrieve(req: RetrieveRequest): Promise<Range[]> {
125
- return this.sugar(
126
- await sendRequired<typeof retrieveReqZ, typeof retrieveResZ>(
127
- this.unaryClient,
128
- RETRIEVE_ENDPOINT,
129
- req,
130
- retrieveReqZ,
131
- retrieveResZ,
132
- ).then((res) => res.ranges),
125
+ const { ranges } = await sendRequired<typeof retrieveReqZ, typeof retrieveResZ>(
126
+ this.unaryClient,
127
+ RETRIEVE_ENDPOINT,
128
+ req,
129
+ retrieveReqZ,
130
+ retrieveResZ,
133
131
  );
132
+ return this.sugar(ranges);
134
133
  }
135
134
 
136
135
  async setActive(range: Key): Promise<void> {
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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,8 +7,8 @@
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 type { Alias, AliasChange } from "@/ranger/alias";
10
11
  export * from "@/ranger/client";
11
- export * from "@/ranger/writer";
12
12
  export * from "@/ranger/payload";
13
13
  export * from "@/ranger/range";
14
- export type { Alias, AliasChange } from "@/ranger/alias";
14
+ export * from "@/ranger/writer";
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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/ranger/kv.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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,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 { type UnaryClient, sendRequired } from "@synnaxlabs/freighter";
10
+ import { sendRequired,type UnaryClient } from "@synnaxlabs/freighter";
11
11
  import { isObject } from "@synnaxlabs/x/identity";
12
12
  import { toArray } from "@synnaxlabs/x/toArray";
13
13
  import { z } from "zod";
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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.
@@ -9,7 +9,7 @@
9
9
 
10
10
  import { type Series, TimeRange } from "@synnaxlabs/x/telem";
11
11
 
12
- import { type Key, type Params, type Name } from "@/channel/payload";
12
+ import { type Key, type Name,type Params } from "@/channel/payload";
13
13
  import { type Retriever as ChannelRetriever } from "@/channel/retriever";
14
14
  import { QueryError } from "@/errors";
15
15
  import { type framer } from "@/framer";
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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,11 +11,11 @@ import { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
11
11
  import { z } from "zod";
12
12
 
13
13
  import {
14
+ keyZ,
14
15
  type NewPayload,
16
+ newPayloadZ,
15
17
  type Payload,
16
18
  payloadZ,
17
- keyZ,
18
- newPayloadZ,
19
19
  } from "@/ranger/payload";
20
20
 
21
21
  const createResZ = z.object({
package/src/setupspecs.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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/transport.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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.
@@ -9,10 +9,10 @@
9
9
 
10
10
  import {
11
11
  HTTPClient,
12
- WebSocketClient,
13
12
  type Middleware,
14
13
  type StreamClient,
15
14
  type UnaryClient,
15
+ WebSocketClient,
16
16
  } from "@synnaxlabs/freighter";
17
17
  import { binary } from "@synnaxlabs/x/binary";
18
18
  import { type URL } from "@synnaxlabs/x/url";
package/src/user/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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 2023 Synnax Labs, Inc.
1
+ // Copyright 2024 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.