@synnaxlabs/client 0.55.0 → 0.56.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 (197) hide show
  1. package/.turbo/turbo-build.log +10 -13
  2. package/dist/client.cjs +60 -36
  3. package/dist/client.js +6435 -4786
  4. package/dist/src/access/policy/client.d.ts +70 -80
  5. package/dist/src/access/policy/client.d.ts.map +1 -1
  6. package/dist/src/access/policy/types.gen.d.ts +18 -20
  7. package/dist/src/access/policy/types.gen.d.ts.map +1 -1
  8. package/dist/src/access/role/client.d.ts.map +1 -1
  9. package/dist/src/access/role/types.gen.d.ts +2 -2
  10. package/dist/src/actions/actions.d.ts +68 -0
  11. package/dist/src/actions/actions.d.ts.map +1 -0
  12. package/dist/src/actions/actions.spec.d.ts +2 -0
  13. package/dist/src/actions/actions.spec.d.ts.map +1 -0
  14. package/dist/src/actions/external.d.ts +2 -0
  15. package/dist/src/actions/external.d.ts.map +1 -0
  16. package/dist/src/actions/index.d.ts +2 -0
  17. package/dist/src/actions/index.d.ts.map +1 -0
  18. package/dist/src/arc/client.d.ts.map +1 -1
  19. package/dist/src/arc/compiler/types.gen.d.ts +1 -1
  20. package/dist/src/arc/compiler/types.gen.d.ts.map +1 -1
  21. package/dist/src/arc/graph/types.gen.d.ts +29 -29
  22. package/dist/src/arc/graph/types.gen.d.ts.map +1 -1
  23. package/dist/src/arc/ir/types.gen.d.ts +123 -123
  24. package/dist/src/arc/ir/types.gen.d.ts.map +1 -1
  25. package/dist/src/arc/module/types.gen.d.ts +45 -45
  26. package/dist/src/arc/program/types.gen.d.ts +45 -45
  27. package/dist/src/arc/types/types.gen.d.ts +11 -11
  28. package/dist/src/arc/types/types.gen.d.ts.map +1 -1
  29. package/dist/src/arc/types.gen.d.ts +99 -99
  30. package/dist/src/auth/auth.d.ts +3 -3
  31. package/dist/src/auth/auth.d.ts.map +1 -1
  32. package/dist/src/channel/client.d.ts +2 -2
  33. package/dist/src/channel/client.d.ts.map +1 -1
  34. package/dist/src/channel/retriever.d.ts +5 -8
  35. package/dist/src/channel/retriever.d.ts.map +1 -1
  36. package/dist/src/channel/types.gen.d.ts +3 -3
  37. package/dist/src/channel/writer.d.ts.map +1 -1
  38. package/dist/src/connection/checker.d.ts +1 -1
  39. package/dist/src/connection/checker.d.ts.map +1 -1
  40. package/dist/src/device/client.d.ts.map +1 -1
  41. package/dist/src/device/types.gen.d.ts +6 -8
  42. package/dist/src/device/types.gen.d.ts.map +1 -1
  43. package/dist/src/errors.d.ts +2 -0
  44. package/dist/src/errors.d.ts.map +1 -1
  45. package/dist/src/framer/adapter.d.ts.map +1 -1
  46. package/dist/src/framer/client.d.ts +2 -2
  47. package/dist/src/framer/codec.d.ts +9 -1
  48. package/dist/src/framer/codec.d.ts.map +1 -1
  49. package/dist/src/framer/deleter.d.ts.map +1 -1
  50. package/dist/src/framer/frame.d.ts +1 -1
  51. package/dist/src/framer/iterator.d.ts +84 -3
  52. package/dist/src/framer/iterator.d.ts.map +1 -1
  53. package/dist/src/framer/streamProxy.d.ts.map +1 -1
  54. package/dist/src/framer/streamer.d.ts +1 -3
  55. package/dist/src/framer/streamer.d.ts.map +1 -1
  56. package/dist/src/framer/types.gen.d.ts +18 -0
  57. package/dist/src/framer/types.gen.d.ts.map +1 -1
  58. package/dist/src/framer/writer.d.ts +8 -8
  59. package/dist/src/framer/writer.d.ts.map +1 -1
  60. package/dist/src/group/client.d.ts +1 -2
  61. package/dist/src/group/client.d.ts.map +1 -1
  62. package/dist/src/group/types.gen.d.ts +2 -2
  63. package/dist/src/index.d.ts +2 -1
  64. package/dist/src/index.d.ts.map +1 -1
  65. package/dist/src/label/client.d.ts +5 -8
  66. package/dist/src/label/client.d.ts.map +1 -1
  67. package/dist/src/lineplot/client.d.ts.map +1 -1
  68. package/dist/src/lineplot/types.gen.d.ts +2 -2
  69. package/dist/src/log/client.d.ts.map +1 -1
  70. package/dist/src/log/types.gen.d.ts +2 -2
  71. package/dist/src/ontology/client.d.ts +1 -3
  72. package/dist/src/ontology/client.d.ts.map +1 -1
  73. package/dist/src/ontology/payload.d.ts +12 -16
  74. package/dist/src/ontology/payload.d.ts.map +1 -1
  75. package/dist/src/ontology/types.gen.d.ts +1 -2
  76. package/dist/src/ontology/types.gen.d.ts.map +1 -1
  77. package/dist/src/ontology/writer.d.ts +5 -10
  78. package/dist/src/ontology/writer.d.ts.map +1 -1
  79. package/dist/src/rack/client.d.ts.map +1 -1
  80. package/dist/src/rack/types.gen.d.ts +3 -3
  81. package/dist/src/ranger/alias/client.d.ts.map +1 -1
  82. package/dist/src/ranger/client.d.ts.map +1 -1
  83. package/dist/src/ranger/kv/client.d.ts.map +1 -1
  84. package/dist/src/ranger/types.gen.d.ts +6 -6
  85. package/dist/src/ranger/types.gen.d.ts.map +1 -1
  86. package/dist/src/ranger/writer.d.ts +2 -3
  87. package/dist/src/ranger/writer.d.ts.map +1 -1
  88. package/dist/src/schematic/actions.d.ts +147 -0
  89. package/dist/src/schematic/actions.d.ts.map +1 -0
  90. package/dist/src/schematic/actions.gen.d.ts +484 -0
  91. package/dist/src/schematic/actions.gen.d.ts.map +1 -0
  92. package/dist/src/schematic/actions.spec.d.ts +2 -0
  93. package/dist/src/schematic/actions.spec.d.ts.map +1 -0
  94. package/dist/src/schematic/client.d.ts +53 -2
  95. package/dist/src/schematic/client.d.ts.map +1 -1
  96. package/dist/src/schematic/external.d.ts +2 -0
  97. package/dist/src/schematic/external.d.ts.map +1 -1
  98. package/dist/src/schematic/symbol/client.d.ts.map +1 -1
  99. package/dist/src/schematic/symbol/types.gen.d.ts +48 -58
  100. package/dist/src/schematic/symbol/types.gen.d.ts.map +1 -1
  101. package/dist/src/schematic/types.gen.d.ts +131 -5
  102. package/dist/src/schematic/types.gen.d.ts.map +1 -1
  103. package/dist/src/status/client.d.ts.map +1 -1
  104. package/dist/src/status/payload.d.ts +3 -3
  105. package/dist/src/table/actions.d.ts +156 -0
  106. package/dist/src/table/actions.d.ts.map +1 -0
  107. package/dist/src/table/actions.gen.d.ts +587 -0
  108. package/dist/src/table/actions.gen.d.ts.map +1 -0
  109. package/dist/src/table/client.d.ts +28 -2
  110. package/dist/src/table/client.d.ts.map +1 -1
  111. package/dist/src/table/external.d.ts +2 -0
  112. package/dist/src/table/external.d.ts.map +1 -1
  113. package/dist/src/table/types.gen.d.ts +71 -4
  114. package/dist/src/table/types.gen.d.ts.map +1 -1
  115. package/dist/src/task/client.d.ts.map +1 -1
  116. package/dist/src/task/types.gen.d.ts +7 -7
  117. package/dist/src/task/types.gen.d.ts.map +1 -1
  118. package/dist/src/user/client.d.ts +2 -2
  119. package/dist/src/user/client.d.ts.map +1 -1
  120. package/dist/src/user/types.gen.d.ts +2 -2
  121. package/dist/src/view/client.d.ts.map +1 -1
  122. package/dist/src/view/types.gen.d.ts +2 -2
  123. package/dist/src/workspace/client.d.ts.map +1 -1
  124. package/dist/src/workspace/types.gen.d.ts +3 -3
  125. package/dist/src/workspace/types.gen.d.ts.map +1 -1
  126. package/package.json +12 -11
  127. package/src/access/policy/client.ts +4 -7
  128. package/src/access/role/client.ts +6 -26
  129. package/src/actions/actions.spec.ts +229 -0
  130. package/src/actions/actions.ts +104 -0
  131. package/src/actions/external.ts +10 -0
  132. package/src/actions/index.ts +10 -0
  133. package/src/arc/client.ts +3 -7
  134. package/src/arc/compiler/types.gen.ts +2 -1
  135. package/src/arc/ir/types.gen.ts +2 -2
  136. package/src/arc/lsp.spec.ts +3 -7
  137. package/src/arc/types/types.gen.ts +3 -3
  138. package/src/auth/auth.spec.ts +12 -13
  139. package/src/auth/auth.ts +36 -34
  140. package/src/channel/batchRetriever.spec.ts +13 -4
  141. package/src/channel/client.ts +8 -6
  142. package/src/channel/retriever.ts +7 -16
  143. package/src/channel/writer.ts +4 -20
  144. package/src/connection/checker.ts +6 -6
  145. package/src/connection/connection.spec.ts +5 -8
  146. package/src/device/client.ts +5 -8
  147. package/src/device/types.gen.ts +4 -4
  148. package/src/errors.ts +9 -9
  149. package/src/framer/adapter.ts +2 -4
  150. package/src/framer/client.ts +1 -1
  151. package/src/framer/codec.spec.ts +53 -3
  152. package/src/framer/codec.ts +58 -25
  153. package/src/framer/deleter.ts +2 -8
  154. package/src/framer/iterator.ts +43 -40
  155. package/src/framer/streamProxy.ts +13 -13
  156. package/src/framer/streamer.spec.ts +12 -3
  157. package/src/framer/streamer.ts +7 -12
  158. package/src/framer/types.gen.ts +20 -0
  159. package/src/framer/writer.spec.ts +77 -0
  160. package/src/framer/writer.ts +51 -28
  161. package/src/group/client.ts +4 -7
  162. package/src/index.ts +3 -2
  163. package/src/label/client.ts +6 -16
  164. package/src/lineplot/client.ts +6 -21
  165. package/src/log/client.ts +6 -21
  166. package/src/ontology/client.ts +3 -4
  167. package/src/ontology/types.gen.ts +0 -1
  168. package/src/ontology/writer.ts +4 -7
  169. package/src/rack/client.ts +4 -7
  170. package/src/ranger/alias/client.ts +6 -11
  171. package/src/ranger/client.ts +3 -4
  172. package/src/ranger/kv/client.ts +5 -8
  173. package/src/ranger/writer.ts +4 -17
  174. package/src/schematic/access.spec.ts +6 -6
  175. package/src/schematic/actions.gen.ts +200 -0
  176. package/src/schematic/actions.spec.ts +699 -0
  177. package/src/schematic/actions.ts +168 -0
  178. package/src/schematic/client.ts +34 -30
  179. package/src/schematic/external.ts +2 -0
  180. package/src/schematic/schematic.spec.ts +233 -69
  181. package/src/schematic/symbol/client.ts +6 -11
  182. package/src/schematic/symbol/types.gen.ts +1 -10
  183. package/src/schematic/types.gen.ts +55 -6
  184. package/src/status/client.ts +4 -10
  185. package/src/table/access.spec.ts +0 -6
  186. package/src/table/actions.gen.ts +243 -0
  187. package/src/table/actions.ts +255 -0
  188. package/src/table/client.ts +21 -25
  189. package/src/table/external.ts +2 -0
  190. package/src/table/table.spec.ts +588 -43
  191. package/src/table/types.gen.ts +58 -5
  192. package/src/task/client.ts +7 -11
  193. package/src/task/types.gen.ts +8 -6
  194. package/src/user/client.ts +6 -11
  195. package/src/view/client.ts +4 -7
  196. package/src/workspace/client.ts +6 -16
  197. package/src/workspace/types.gen.ts +2 -1
@@ -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 { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
10
+ import { type UnaryClient } from "@synnaxlabs/freighter";
11
11
  import { array } from "@synnaxlabs/x";
12
12
  import z from "zod";
13
13
 
@@ -66,8 +66,7 @@ export class Client {
66
66
  async retrieve(args: RetrieveMultipleParams): Promise<Label[]>;
67
67
  async retrieve(args: RetrieveArgs): Promise<Label | Label[]> {
68
68
  const isSingle = "key" in args;
69
- const res = await sendRequired(
70
- this.client,
69
+ const res = await this.client.send(
71
70
  "/label/retrieve",
72
71
  args,
73
72
  retrieveArgsZ,
@@ -78,8 +77,7 @@ export class Client {
78
77
  }
79
78
 
80
79
  async label(id: ontology.ID, labels: Key[], opts: SetOptions = {}): Promise<void> {
81
- await sendRequired<typeof setReqZ, typeof emptyResZ>(
82
- this.client,
80
+ await this.client.send(
83
81
  "/label/set",
84
82
  { id, labels, replace: opts.replace },
85
83
  setReqZ,
@@ -88,21 +86,14 @@ export class Client {
88
86
  }
89
87
 
90
88
  async remove(id: ontology.ID, labels: Key[]): Promise<void> {
91
- await sendRequired<typeof removeReqZ, typeof emptyResZ>(
92
- this.client,
93
- "/label/remove",
94
- { id, labels },
95
- removeReqZ,
96
- emptyResZ,
97
- );
89
+ await this.client.send("/label/remove", { id, labels }, removeReqZ, emptyResZ);
98
90
  }
99
91
 
100
92
  async create(label: New): Promise<Label>;
101
93
  async create(labels: New[]): Promise<Label[]>;
102
94
  async create(labels: New | New[]): Promise<Label | Label[]> {
103
95
  const isMany = Array.isArray(labels);
104
- const res = await sendRequired<typeof createReqZ, typeof createResZ>(
105
- this.client,
96
+ const res = await this.client.send(
106
97
  "/label/create",
107
98
  { labels: array.toArray(labels) },
108
99
  createReqZ,
@@ -112,8 +103,7 @@ export class Client {
112
103
  }
113
104
 
114
105
  async delete(keys: Key | Key[]): Promise<void> {
115
- await sendRequired<typeof deleteReqZ, typeof emptyResZ>(
116
- this.client,
106
+ await this.client.send(
117
107
  "/label/delete",
118
108
  { keys: array.toArray(keys) },
119
109
  deleteReqZ,
@@ -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 { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
10
+ import { type UnaryClient } from "@synnaxlabs/freighter";
11
11
  import { array, caseconv, record } from "@synnaxlabs/x";
12
12
  import { z } from "zod";
13
13
 
@@ -61,8 +61,7 @@ export class Client {
61
61
  linePlots: New | New[],
62
62
  ): Promise<LinePlot | LinePlot[]> {
63
63
  const isMany = Array.isArray(linePlots);
64
- const res = await sendRequired(
65
- this.client,
64
+ const res = await this.client.send(
66
65
  "/lineplot/create",
67
66
  { workspace, linePlots: array.toArray(linePlots) },
68
67
  createReqZ,
@@ -72,23 +71,11 @@ export class Client {
72
71
  }
73
72
 
74
73
  async rename(key: Key, name: string): Promise<void> {
75
- await sendRequired(
76
- this.client,
77
- "/lineplot/rename",
78
- { key, name },
79
- renameReqZ,
80
- emptyResZ,
81
- );
74
+ await this.client.send("/lineplot/rename", { key, name }, renameReqZ, emptyResZ);
82
75
  }
83
76
 
84
77
  async setData(key: Key, data: record.Unknown): Promise<void> {
85
- await sendRequired(
86
- this.client,
87
- "/lineplot/set-data",
88
- { key, data },
89
- setDataReqZ,
90
- emptyResZ,
91
- );
78
+ await this.client.send("/lineplot/set-data", { key, data }, setDataReqZ, emptyResZ);
92
79
  }
93
80
 
94
81
  async retrieve(args: RetrieveSingleParams): Promise<LinePlot>;
@@ -97,8 +84,7 @@ export class Client {
97
84
  args: RetrieveSingleParams | RetrieveMultipleParams,
98
85
  ): Promise<LinePlot | LinePlot[]> {
99
86
  const isSingle = singleRetrieveArgsZ.safeParse(args).success;
100
- const res = await sendRequired(
101
- this.client,
87
+ const res = await this.client.send(
102
88
  "/lineplot/retrieve",
103
89
  args,
104
90
  retrieveArgsZ,
@@ -109,8 +95,7 @@ export class Client {
109
95
  }
110
96
 
111
97
  async delete(keys: Key | Key[]): Promise<void> {
112
- await sendRequired(
113
- this.client,
98
+ await this.client.send(
114
99
  "/lineplot/delete",
115
100
  { keys: array.toArray(keys) },
116
101
  deleteReqZ,
package/src/log/client.ts CHANGED
@@ -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 { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
10
+ import { type UnaryClient } from "@synnaxlabs/freighter";
11
11
  import { array, caseconv, record } from "@synnaxlabs/x";
12
12
  import { z } from "zod";
13
13
 
@@ -51,8 +51,7 @@ export class Client {
51
51
  async create(workspace: workspace.Key, logs: New[]): Promise<Log[]>;
52
52
  async create(workspace: workspace.Key, logs: New | New[]): Promise<Log | Log[]> {
53
53
  const isMany = Array.isArray(logs);
54
- const res = await sendRequired(
55
- this.client,
54
+ const res = await this.client.send(
56
55
  "/log/create",
57
56
  { workspace, logs: array.toArray(logs) },
58
57
  createReqZ,
@@ -62,23 +61,11 @@ export class Client {
62
61
  }
63
62
 
64
63
  async rename(key: Key, name: string): Promise<void> {
65
- await sendRequired(
66
- this.client,
67
- "/log/rename",
68
- { key, name },
69
- renameReqZ,
70
- emptyResZ,
71
- );
64
+ await this.client.send("/log/rename", { key, name }, renameReqZ, emptyResZ);
72
65
  }
73
66
 
74
67
  async setData(key: Key, data: record.Unknown): Promise<void> {
75
- await sendRequired(
76
- this.client,
77
- "/log/set-data",
78
- { key, data },
79
- setDataReqZ,
80
- emptyResZ,
81
- );
68
+ await this.client.send("/log/set-data", { key, data }, setDataReqZ, emptyResZ);
82
69
  }
83
70
 
84
71
  async retrieve(args: RetrieveSingleParams): Promise<Log>;
@@ -87,8 +74,7 @@ export class Client {
87
74
  args: RetrieveSingleParams | RetrieveMultipleParams,
88
75
  ): Promise<Log | Log[]> {
89
76
  const isSingle = singleRetrieveArgsZ.safeParse(args).success;
90
- const res = await sendRequired(
91
- this.client,
77
+ const res = await this.client.send(
92
78
  "/log/retrieve",
93
79
  args,
94
80
  retrieveArgsZ,
@@ -99,8 +85,7 @@ export class Client {
99
85
  }
100
86
 
101
87
  async delete(keys: Key | Key[]): Promise<void> {
102
- await sendRequired(
103
- this.client,
88
+ await this.client.send(
104
89
  "/log/delete",
105
90
  { keys: array.toArray(keys) },
106
91
  deleteReqZ,
@@ -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 { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
10
+ import { type UnaryClient } from "@synnaxlabs/freighter";
11
11
  import { array, strings } from "@synnaxlabs/x";
12
12
  import { z } from "zod";
13
13
 
@@ -83,7 +83,7 @@ export class Client {
83
83
  options?: RetrieveOptions,
84
84
  ): Promise<Resource | Resource[]> {
85
85
  if (!Array.isArray(ids) && typeof ids === "object" && !("key" in ids))
86
- return this.execRetrieve(ids);
86
+ return await this.execRetrieve(ids);
87
87
  const parsedIDs = parseIDs(ids);
88
88
  const resources = await this.execRetrieve({ ids: parsedIDs, ...options });
89
89
  if (Array.isArray(ids)) return resources;
@@ -163,8 +163,7 @@ export class Client {
163
163
  }
164
164
 
165
165
  private async execRetrieve(request: RetrieveRequest): Promise<Resource[]> {
166
- const { resources } = await sendRequired(
167
- this.client,
166
+ const { resources } = await this.client.send(
168
167
  "/ontology/retrieve",
169
168
  request,
170
169
  retrieveReqZ,
@@ -15,7 +15,6 @@ export const RESOURCE_TYPES = [
15
15
  "arc",
16
16
  "builtin",
17
17
  "channel",
18
- "cluster",
19
18
  "device",
20
19
  "framer",
21
20
  "group",
@@ -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 { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
10
+ import { type UnaryClient } from "@synnaxlabs/freighter";
11
11
  import { z } from "zod";
12
12
 
13
13
  import { type ID, idZ } from "@/ontology/payload";
@@ -24,8 +24,7 @@ export class Writer {
24
24
  }
25
25
 
26
26
  async addChildren(id: ID, ...children: ID[]): Promise<void> {
27
- await sendRequired<typeof addRemoveChildrenReqZ, typeof emptyResZ>(
28
- this.client,
27
+ await this.client.send(
29
28
  "/ontology/add-children",
30
29
  { id, children },
31
30
  addRemoveChildrenReqZ,
@@ -34,8 +33,7 @@ export class Writer {
34
33
  }
35
34
 
36
35
  async removeChildren(id: ID, ...children: ID[]): Promise<void> {
37
- await sendRequired<typeof addRemoveChildrenReqZ, typeof emptyResZ>(
38
- this.client,
36
+ await this.client.send(
39
37
  "/ontology/remove-children",
40
38
  { id, children },
41
39
  addRemoveChildrenReqZ,
@@ -44,8 +42,7 @@ export class Writer {
44
42
  }
45
43
 
46
44
  async moveChildren(from: ID, to: ID, ...children: ID[]): Promise<void> {
47
- await sendRequired<typeof moveChildrenReqZ, typeof emptyResZ>(
48
- this.client,
45
+ await this.client.send(
49
46
  "/ontology/move-children",
50
47
  { from, to, children },
51
48
  moveChildrenReqZ,
@@ -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 { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
10
+ import { type UnaryClient } from "@synnaxlabs/freighter";
11
11
  import { array } from "@synnaxlabs/x";
12
12
  import { z } from "zod";
13
13
 
@@ -82,8 +82,7 @@ export class Client {
82
82
  }
83
83
 
84
84
  async delete(keys: Key | Key[]): Promise<void> {
85
- await sendRequired<typeof deleteReqZ, typeof deleteResZ>(
86
- this.client,
85
+ await this.client.send(
87
86
  "/rack/delete",
88
87
  { keys: array.toArray(keys) },
89
88
  deleteReqZ,
@@ -95,8 +94,7 @@ export class Client {
95
94
  async create(racks: New[]): Promise<Rack[]>;
96
95
  async create(rack: New | New[]): Promise<Rack | Rack[]> {
97
96
  const isSingle = !Array.isArray(rack);
98
- const res = await sendRequired<typeof createReqZ, typeof createResZ>(
99
- this.client,
97
+ const res = await this.client.send(
100
98
  "/rack/create",
101
99
  { racks: array.toArray(rack) },
102
100
  createReqZ,
@@ -110,8 +108,7 @@ export class Client {
110
108
  async retrieve(args: RetrieveMultipleParams): Promise<Rack[]>;
111
109
  async retrieve(args: RetrieveArgs): Promise<Rack | Rack[]> {
112
110
  const isSingle = "key" in args || "name" in args;
113
- const res = await sendRequired(
114
- this.client,
111
+ const res = await this.client.send(
115
112
  "/rack/retrieve",
116
113
  args,
117
114
  retrieveArgsZ,
@@ -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 { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
10
+ import { type UnaryClient } from "@synnaxlabs/freighter";
11
11
  import { array } from "@synnaxlabs/x";
12
12
  import { z } from "zod";
13
13
 
@@ -64,8 +64,7 @@ export class Client {
64
64
  else toFetch.push(alias);
65
65
  });
66
66
  if (toFetch.length === 0) return cached;
67
- const res = await sendRequired<typeof resolveReqZ, typeof resolveResZ>(
68
- this.client,
67
+ const res = await this.client.send(
69
68
  "/range/alias/resolve",
70
69
  { range: this.rangeKey, aliases: toFetch },
71
70
  resolveReqZ,
@@ -76,8 +75,7 @@ export class Client {
76
75
  }
77
76
 
78
77
  async set(aliases: Record<channel.Key, string>): Promise<void> {
79
- await sendRequired<typeof setReqZ, typeof setResZ>(
80
- this.client,
78
+ await this.client.send(
81
79
  "/range/alias/set",
82
80
  { range: this.rangeKey, aliases },
83
81
  setReqZ,
@@ -87,8 +85,7 @@ export class Client {
87
85
 
88
86
  async list(): Promise<Record<channel.Key, string>> {
89
87
  return (
90
- await sendRequired<typeof listReqZ, typeof listResZ>(
91
- this.client,
88
+ await this.client.send(
92
89
  "/range/alias/list",
93
90
  { range: this.rangeKey },
94
91
  listReqZ,
@@ -104,8 +101,7 @@ export class Client {
104
101
  alias: channel.Key | channel.Key[],
105
102
  ): Promise<string | Record<channel.Key, string>> {
106
103
  const isSingle = typeof alias === "number";
107
- const res = await sendRequired<typeof retrieveReqZ, typeof retrieveResZ>(
108
- this.client,
104
+ const res = await this.client.send(
109
105
  "/range/alias/retrieve",
110
106
  { range: this.rangeKey, channels: array.toArray(alias) },
111
107
  retrieveReqZ,
@@ -115,8 +111,7 @@ export class Client {
115
111
  }
116
112
 
117
113
  async delete(aliases: channel.Key | channel.Key[]): Promise<void> {
118
- await sendRequired<typeof deleteReqZ, typeof deleteResZ>(
119
- this.client,
114
+ await this.client.send(
120
115
  "/range/alias/delete",
121
116
  { range: this.rangeKey, channels: array.toArray(aliases) },
122
117
  deleteReqZ,
@@ -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 { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
10
+ import { type UnaryClient } from "@synnaxlabs/freighter";
11
11
  import {
12
12
  array,
13
13
  color,
@@ -128,7 +128,7 @@ export class Range {
128
128
  }
129
129
 
130
130
  async retrieveParent(): Promise<Range | null> {
131
- return this.rangeClient.retrieveParent(this.key);
131
+ return await this.rangeClient.retrieveParent(this.key);
132
132
  }
133
133
 
134
134
  async retrieveChildren(): Promise<Range[]> {
@@ -249,8 +249,7 @@ export class Client {
249
249
  async retrieve(params: RetrieveRequest): Promise<Range[]>;
250
250
  async retrieve(params: RetrieveArgs): Promise<Range | Range[]> {
251
251
  const isSingle = typeof params === "string";
252
- const { ranges } = await sendRequired(
253
- this.unaryClient,
252
+ const { ranges } = await this.unaryClient.send(
254
253
  "/range/retrieve",
255
254
  params,
256
255
  retrieveArgsZ,
@@ -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 { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
10
+ import { type UnaryClient } from "@synnaxlabs/freighter";
11
11
  import { array } from "@synnaxlabs/x";
12
12
  import { z } from "zod";
13
13
 
@@ -31,8 +31,7 @@ export class Client {
31
31
  async get(key: string): Promise<string>;
32
32
  async get(keys: string[]): Promise<Record<string, string>>;
33
33
  async get(keys: string | string[]): Promise<string | Record<string, string>> {
34
- const res = await sendRequired(
35
- this.client,
34
+ const res = await this.client.send(
36
35
  "/range/kv/get",
37
36
  { range: this.rangeKey, keys: array.toArray(keys) },
38
37
  getReqZ,
@@ -43,7 +42,7 @@ export class Client {
43
42
  }
44
43
 
45
44
  async list(): Promise<Record<string, string>> {
46
- return this.get([]);
45
+ return await this.get([]);
47
46
  }
48
47
 
49
48
  async set(key: string, value: string): Promise<void>;
@@ -58,8 +57,7 @@ export class Client {
58
57
  value: v,
59
58
  }));
60
59
 
61
- await sendRequired(
62
- this.client,
60
+ await this.client.send(
63
61
  "/range/kv/set",
64
62
  { range: this.rangeKey, pairs },
65
63
  setReqZ,
@@ -68,8 +66,7 @@ export class Client {
68
66
  }
69
67
 
70
68
  async delete(key: string | string[]): Promise<void> {
71
- await sendRequired(
72
- this.client,
69
+ await this.client.send(
73
70
  "/range/kv/delete",
74
71
  { range: this.rangeKey, keys: array.toArray(key) },
75
72
  deleteReqZ,
@@ -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 { sendRequired, type UnaryClient } from "@synnaxlabs/freighter";
10
+ import { type UnaryClient } from "@synnaxlabs/freighter";
11
11
  import { z } from "zod";
12
12
 
13
13
  import { ontology } from "@/ontology";
@@ -35,18 +35,11 @@ export class Writer {
35
35
  }
36
36
 
37
37
  async rename(key: string, name: string): Promise<void> {
38
- await sendRequired<typeof renameReqZ, typeof renameResZ>(
39
- this.client,
40
- "/range/rename",
41
- { key, name },
42
- renameReqZ,
43
- renameResZ,
44
- );
38
+ await this.client.send("/range/rename", { key, name }, renameReqZ, renameResZ);
45
39
  }
46
40
 
47
41
  async create(ranges: New[], options?: CreateOptions): Promise<Payload[]> {
48
- const res = await sendRequired<typeof createReqZ, typeof createResZ>(
49
- this.client,
42
+ const res = await this.client.send(
50
43
  "/range/create",
51
44
  { ranges, ...options },
52
45
  createReqZ,
@@ -56,12 +49,6 @@ export class Writer {
56
49
  }
57
50
 
58
51
  async delete(keys: string[]): Promise<void> {
59
- await sendRequired<typeof deleteReqZ, typeof deleteResZ>(
60
- this.client,
61
- "/range/delete",
62
- { keys },
63
- deleteReqZ,
64
- deleteResZ,
65
- );
52
+ await this.client.send("/range/delete", { keys }, deleteReqZ, deleteResZ);
66
53
  }
67
54
  }
@@ -29,8 +29,8 @@ describe("schematic", () => {
29
29
  layout: {},
30
30
  });
31
31
  const randomSchematic = await client.schematics.create(ws.key, {
32
+ ...schematic.ZERO_NEW,
32
33
  name: "test",
33
- data: {},
34
34
  });
35
35
  await expect(
36
36
  userClient.schematics.retrieve({ key: randomSchematic.key }),
@@ -48,8 +48,8 @@ describe("schematic", () => {
48
48
  layout: {},
49
49
  });
50
50
  const randomSchematic = await client.schematics.create(ws.key, {
51
+ ...schematic.ZERO_NEW,
51
52
  name: "test",
52
- data: {},
53
53
  });
54
54
  const retrieved = await userClient.schematics.retrieve({
55
55
  key: randomSchematic.key,
@@ -69,8 +69,8 @@ describe("schematic", () => {
69
69
  layout: {},
70
70
  });
71
71
  await userClient.schematics.create(ws.key, {
72
+ ...schematic.ZERO_NEW,
72
73
  name: "test",
73
- data: {},
74
74
  });
75
75
  });
76
76
 
@@ -86,8 +86,8 @@ describe("schematic", () => {
86
86
  });
87
87
  await expect(
88
88
  userClient.schematics.create(ws.key, {
89
+ ...schematic.ZERO_NEW,
89
90
  name: "test",
90
- data: {},
91
91
  }),
92
92
  ).rejects.toThrow(AuthError);
93
93
  });
@@ -103,8 +103,8 @@ describe("schematic", () => {
103
103
  layout: {},
104
104
  });
105
105
  const randomSchematic = await client.schematics.create(ws.key, {
106
+ ...schematic.ZERO_NEW,
106
107
  name: "test",
107
- data: {},
108
108
  });
109
109
  await userClient.schematics.delete(randomSchematic.key);
110
110
  await expect(
@@ -123,8 +123,8 @@ describe("schematic", () => {
123
123
  layout: {},
124
124
  });
125
125
  const randomSchematic = await client.schematics.create(ws.key, {
126
+ ...schematic.ZERO_NEW,
126
127
  name: "test",
127
- data: {},
128
128
  });
129
129
  await expect(userClient.schematics.delete(randomSchematic.key)).rejects.toThrow(
130
130
  AuthError,