@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
@@ -9,14 +9,56 @@
9
9
 
10
10
  // Code generated by Oracle. DO NOT EDIT.
11
11
 
12
- import { caseconv, record } from "@synnaxlabs/x";
12
+ import { array, caseconv, record } from "@synnaxlabs/x";
13
13
  import { z } from "zod";
14
14
 
15
15
  import { ontology } from "@/ontology";
16
16
 
17
+ /** Cell is a single cell in a table, identified by key and variant. */
18
+ export const cellZ = z.object({
19
+ /** key is the unique identifier for this cell within the table. */
20
+ key: z.string(),
21
+ /**
22
+ * variant is the cell variant identifier (e.g. "text", "value"). The variant
23
+ * determines the shape of props and which Pluto cell component renders
24
+ * the cell.
25
+ */
26
+ variant: z.string(),
27
+ /**
28
+ * props is the variant-specific cell configuration. The shape is determined
29
+ * by the variant; the wire format intentionally stores it as an
30
+ * opaque record so new variants can be added without a schema
31
+ * migration.
32
+ */
33
+ props: caseconv.preserveCase(record.nullishToEmpty()),
34
+ });
35
+ export interface Cell extends z.infer<typeof cellZ> {}
36
+
37
+ /** Row is a single row in a table, with height and ordered cell keys. */
38
+ export const rowZ = z.object({
39
+ /** size is the height of the row in pixels. */
40
+ size: z.number(),
41
+ /**
42
+ * cells is the ordered list of cell keys in this row from left to right.
43
+ * Each key points at an entry in the table's cells map.
44
+ */
45
+ cells: array.nullishToEmpty(z.string()),
46
+ });
47
+ export interface Row extends z.infer<typeof rowZ> {}
48
+
49
+ /** Column is a single column in a table, with width. */
50
+ export const columnZ = z.object({
51
+ /** size is the width of the column in pixels. */
52
+ size: z.number(),
53
+ });
54
+ export interface Column extends z.infer<typeof columnZ> {}
55
+
17
56
  export const keyZ = z.uuid();
18
57
  export type Key = z.infer<typeof keyZ>;
19
58
 
59
+ export const cellTemplateZ = cellZ.omit({ key: true });
60
+ export interface CellTemplate extends z.infer<typeof cellTemplateZ> {}
61
+
20
62
  /**
21
63
  * Table is a tabular data display component for viewing structured telemetry
22
64
  * data. Tables support multiple columns, channel data sources, and
@@ -27,15 +69,26 @@ export const tableZ = z.object({
27
69
  key: keyZ,
28
70
  /** name is a human-readable name for the table. */
29
71
  name: z.string(),
72
+ /** rows are the table rows in display order, top to bottom. */
73
+ rows: array.nullishToEmpty(rowZ),
74
+ /** columns are the table columns in display order, left to right. */
75
+ columns: array.nullishToEmpty(columnZ),
30
76
  /**
31
- * data is the table configuration including column definitions, channel
32
- * references, and formatting options.
77
+ * cells contains all cells in the table, keyed by cell key. Cell positions
78
+ * are derived from rows[*].cells[*] references; cells not referenced
79
+ * by any row are orphaned and will be pruned on the next structural
80
+ * edit.
33
81
  */
34
- data: caseconv.preserveCase(record.nullishToEmpty()),
82
+ cells: caseconv.preserveCase(record.nullishToEmpty(z.string(), cellZ)),
35
83
  });
36
84
  export interface Table extends z.infer<typeof tableZ> {}
37
85
 
38
- export const newZ = tableZ.partial({ key: true });
86
+ export const newZ = tableZ.partial({
87
+ key: true,
88
+ rows: true,
89
+ columns: true,
90
+ cells: true,
91
+ });
39
92
  export interface New extends z.input<typeof newZ> {}
40
93
 
41
94
  export const ontologyID = ontology.createIDFactory<Key>("table");
@@ -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
  caseconv,
@@ -127,7 +127,7 @@ export class Task<S extends Schemas = Schemas> {
127
127
  ({
128
128
  type: z.string(),
129
129
  config: z.unknown(),
130
- statusData: z.unknown(),
130
+ statusData: z.unknown().optional(),
131
131
  } as unknown as S);
132
132
  this.internal = internal;
133
133
  this.snapshot = snapshot;
@@ -279,10 +279,9 @@ export class Client {
279
279
  const isSingle = !Array.isArray(task);
280
280
  const createReq = createReqZ(schemas);
281
281
  const createRes = createResZ(schemas);
282
- const res = await sendRequired(
283
- this.client,
282
+ const res = await this.client.send(
284
283
  "/task/create",
285
- { tasks: array.toArray(task) } as z.infer<typeof createReq>,
284
+ { tasks: array.toArray(task) },
286
285
  createReq,
287
286
  createRes,
288
287
  );
@@ -291,8 +290,7 @@ export class Client {
291
290
  }
292
291
 
293
292
  async delete(keys: Key | Key[]): Promise<void> {
294
- await sendRequired<typeof deleteReqZ, typeof deleteResZ>(
295
- this.client,
293
+ await this.client.send(
296
294
  "/task/delete",
297
295
  { keys: array.toArray(keys) },
298
296
  deleteReqZ,
@@ -313,8 +311,7 @@ export class Client {
313
311
  ...args
314
312
  }: RetrieveArgs & RetrieveSchemas<S>): Promise<Task<S> | Task<S>[]> {
315
313
  const isSingle = singleRetrieveArgsZ.safeParse(args).success;
316
- const res = await sendRequired(
317
- this.client,
314
+ const res = await this.client.send(
318
315
  "/task/retrieve",
319
316
  args,
320
317
  retrieveArgsZ,
@@ -328,8 +325,7 @@ export class Client {
328
325
 
329
326
  async copy(key: Key, name: string, snapshot: boolean): Promise<Task> {
330
327
  const copyRes = copyResZ();
331
- const response = await sendRequired(
332
- this.client,
328
+ const response = await this.client.send(
333
329
  "/task/copy",
334
330
  { key, name, snapshot },
335
331
  copyReqZ,
@@ -23,7 +23,7 @@ export type StatusDetailsZodObject<Data extends z.ZodType = z.ZodNever> = z.ZodO
23
23
  task: typeof keyZ;
24
24
  running: z.ZodBoolean;
25
25
  cmd: z.ZodOptional<z.ZodString>;
26
- data: [Data] extends [z.ZodNever] ? z.ZodOptional<z.ZodUnknown> : Data;
26
+ data: [Data] extends [z.ZodNever] ? z.ZodOptional<z.ZodUnknown> : z.ZodOptional<Data>;
27
27
  }>;
28
28
 
29
29
  export interface StatusDetailsZFunction {
@@ -38,20 +38,22 @@ export const statusDetailsZ: StatusDetailsZFunction = <Data extends z.ZodType>(
38
38
  task: keyZ,
39
39
  running: z.boolean(),
40
40
  cmd: z.string().optional(),
41
- data: data ?? z.unknown().optional(),
41
+ data: (data ?? z.unknown()).optional(),
42
42
  });
43
43
  export type StatusDetails<Data extends z.ZodType = z.ZodNever> = {
44
44
  task: Key;
45
45
  running: boolean;
46
46
  cmd?: string;
47
- } & ([Data] extends [z.ZodNever] ? {} : { data: z.infer<Data> });
47
+ } & ([Data] extends [z.ZodNever] ? {} : { data?: z.infer<Data> });
48
48
 
49
49
  export type NewStatusDetailsZodObject<Data extends z.ZodType = z.ZodNever> =
50
50
  z.ZodObject<{
51
51
  task: z.ZodOptional<typeof keyZ>;
52
52
  running: z.ZodBoolean;
53
53
  cmd: z.ZodOptional<z.ZodString>;
54
- data: [Data] extends [z.ZodNever] ? z.ZodOptional<z.ZodUnknown> : Data;
54
+ data: [Data] extends [z.ZodNever]
55
+ ? z.ZodOptional<z.ZodUnknown>
56
+ : z.ZodOptional<Data>;
55
57
  }>;
56
58
 
57
59
  export interface NewStatusDetailsZFunction {
@@ -66,13 +68,13 @@ export const newStatusDetailsZ: NewStatusDetailsZFunction = <Data extends z.ZodT
66
68
  task: keyZ.optional(),
67
69
  running: z.boolean(),
68
70
  cmd: z.string().optional(),
69
- data: data ?? z.unknown().optional(),
71
+ data: (data ?? z.unknown()).optional(),
70
72
  });
71
73
  export type NewStatusDetails<Data extends z.ZodType = z.ZodNever> = {
72
74
  task?: Key;
73
75
  running: boolean;
74
76
  cmd?: string;
75
- } & ([Data] extends [z.ZodNever] ? {} : { data: z.infer<Data> });
77
+ } & ([Data] extends [z.ZodNever] ? {} : { data?: z.infer<Data> });
76
78
 
77
79
  /** Command is a command to execute on a task in the Driver system. */
78
80
  export const commandZ = z.object({
@@ -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
  async create(users: New[]): Promise<User[]>;
83
83
  async create(users: New | New[]): Promise<User | User[]> {
84
84
  const isMany = Array.isArray(users);
85
- const res = await sendRequired<typeof createReqZ, typeof createResZ>(
86
- this.client,
85
+ const res = await this.client.send(
87
86
  "/user/create",
88
87
  { users: array.toArray(users) },
89
88
  createReqZ,
@@ -93,8 +92,7 @@ export class Client {
93
92
  }
94
93
 
95
94
  async changeUsername(key: Key, newUsername: string): Promise<void> {
96
- await sendRequired<typeof changeUsernameReqZ, typeof changeUsernameResZ>(
97
- this.client,
95
+ await this.client.send(
98
96
  "/user/change-username",
99
97
  { key, username: newUsername },
100
98
  changeUsernameReqZ,
@@ -107,8 +105,7 @@ export class Client {
107
105
  async retrieve(args: RetrieveArgs): Promise<User[]>;
108
106
  async retrieve(args: RetrieveArgs): Promise<User | User[]> {
109
107
  const isSingle = "key" in args || "username" in args;
110
- const res = await sendRequired<typeof retrieveArgsZ, typeof retrieveResZ>(
111
- this.client,
108
+ const res = await this.client.send(
112
109
  "/user/retrieve",
113
110
  args,
114
111
  retrieveArgsZ,
@@ -131,8 +128,7 @@ export class Client {
131
128
  }
132
129
 
133
130
  async rename(key: Key, firstName?: string, lastName?: string): Promise<void> {
134
- await sendRequired<typeof renameReqZ, typeof renameResZ>(
135
- this.client,
131
+ await this.client.send(
136
132
  "/user/rename",
137
133
  { key, firstName, lastName },
138
134
  renameReqZ,
@@ -143,8 +139,7 @@ export class Client {
143
139
  async delete(key: Key): Promise<void>;
144
140
  async delete(keys: Key[]): Promise<void>;
145
141
  async delete(keys: Key | Key[]): Promise<void> {
146
- await sendRequired<typeof deleteReqZ, typeof deleteResZ>(
147
- this.client,
142
+ await this.client.send(
148
143
  "/user/delete",
149
144
  { keys: array.toArray(keys) },
150
145
  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 } from "@synnaxlabs/x";
12
12
  import { z } from "zod";
13
13
 
@@ -54,8 +54,7 @@ export class Client {
54
54
  args: RetrieveSingleParams | RetrieveMultipleParams,
55
55
  ): Promise<View | View[]> {
56
56
  const isSingle = "key" in args;
57
- const res = await sendRequired(
58
- this.client,
57
+ const res = await this.client.send(
59
58
  "/view/retrieve",
60
59
  args,
61
60
  retrieveArgsZ,
@@ -69,8 +68,7 @@ export class Client {
69
68
  async create(views: New[]): Promise<View[]>;
70
69
  async create(views: New | New[]): Promise<View | View[]> {
71
70
  const isMany = Array.isArray(views);
72
- const res = await sendRequired<typeof createReqZ, typeof createResZ>(
73
- this.client,
71
+ const res = await this.client.send(
74
72
  "/view/create",
75
73
  { views: array.toArray(views) },
76
74
  createReqZ,
@@ -80,8 +78,7 @@ export class Client {
80
78
  }
81
79
 
82
80
  async delete(keys: Key | Key[]): Promise<void> {
83
- await sendRequired<typeof deleteReqZ, typeof emptyResZ>(
84
- this.client,
81
+ await this.client.send(
85
82
  "/view/delete",
86
83
  { keys: array.toArray(keys) },
87
84
  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
 
@@ -57,8 +57,7 @@ export class Client {
57
57
  async create(workspaces: New[]): Promise<Workspace[]>;
58
58
  async create(workspaces: New | New[]): Promise<Workspace | Workspace[]> {
59
59
  const isMany = Array.isArray(workspaces);
60
- const res = await sendRequired(
61
- this.client,
60
+ const res = await this.client.send(
62
61
  "/workspace/create",
63
62
  { workspaces: array.toArray(workspaces) },
64
63
  createReqZ,
@@ -68,18 +67,11 @@ export class Client {
68
67
  }
69
68
 
70
69
  async rename(key: Key, name: string): Promise<void> {
71
- await sendRequired(
72
- this.client,
73
- "/workspace/rename",
74
- { key, name },
75
- renameReqZ,
76
- emptyResZ,
77
- );
70
+ await this.client.send("/workspace/rename", { key, name }, renameReqZ, emptyResZ);
78
71
  }
79
72
 
80
73
  async setLayout(key: Key, layout: record.Unknown): Promise<void> {
81
- await sendRequired(
82
- this.client,
74
+ await this.client.send(
83
75
  "/workspace/set-layout",
84
76
  { key, layout },
85
77
  setLayoutReqZ,
@@ -98,8 +90,7 @@ export class Client {
98
90
  if (typeof keys === "string" || Array.isArray(keys))
99
91
  req = { keys: array.toArray(keys) };
100
92
  else req = keys;
101
- const res = await sendRequired(
102
- this.client,
93
+ const res = await this.client.send(
103
94
  "/workspace/retrieve",
104
95
  req,
105
96
  retrieveReqZ,
@@ -111,8 +102,7 @@ export class Client {
111
102
  async delete(key: Key): Promise<void>;
112
103
  async delete(keys: Key[]): Promise<void>;
113
104
  async delete(keys: Key | Key[]): Promise<void> {
114
- await sendRequired(
115
- this.client,
105
+ await this.client.send(
116
106
  "/workspace/delete",
117
107
  { keys: array.toArray(keys) },
118
108
  deleteReqZ,
@@ -13,6 +13,7 @@ import { caseconv, record } from "@synnaxlabs/x";
13
13
  import { z } from "zod";
14
14
 
15
15
  import { ontology } from "@/ontology";
16
+ import { user } from "@/user";
16
17
 
17
18
  export const keyZ = z.uuid();
18
19
  export type Key = z.infer<typeof keyZ>;
@@ -28,7 +29,7 @@ export const workspaceZ = z.object({
28
29
  /** name is a human-readable name for the workspace. */
29
30
  name: z.string().min(1, "Name is required"),
30
31
  /** author is the UUID of the user who created this workspace. */
31
- author: z.uuid().optional(),
32
+ author: user.keyZ.optional(),
32
33
  /**
33
34
  * layout is the mosaic tree structure that defines how visualizations are
34
35
  * arranged. Contains tab layout, split configurations, and window