@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.
- package/.turbo/turbo-build.log +10 -13
- package/dist/client.cjs +60 -36
- package/dist/client.js +6435 -4786
- package/dist/src/access/policy/client.d.ts +70 -80
- package/dist/src/access/policy/client.d.ts.map +1 -1
- package/dist/src/access/policy/types.gen.d.ts +18 -20
- package/dist/src/access/policy/types.gen.d.ts.map +1 -1
- package/dist/src/access/role/client.d.ts.map +1 -1
- package/dist/src/access/role/types.gen.d.ts +2 -2
- package/dist/src/actions/actions.d.ts +68 -0
- package/dist/src/actions/actions.d.ts.map +1 -0
- package/dist/src/actions/actions.spec.d.ts +2 -0
- package/dist/src/actions/actions.spec.d.ts.map +1 -0
- package/dist/src/actions/external.d.ts +2 -0
- package/dist/src/actions/external.d.ts.map +1 -0
- package/dist/src/actions/index.d.ts +2 -0
- package/dist/src/actions/index.d.ts.map +1 -0
- package/dist/src/arc/client.d.ts.map +1 -1
- package/dist/src/arc/compiler/types.gen.d.ts +1 -1
- package/dist/src/arc/compiler/types.gen.d.ts.map +1 -1
- package/dist/src/arc/graph/types.gen.d.ts +29 -29
- package/dist/src/arc/graph/types.gen.d.ts.map +1 -1
- package/dist/src/arc/ir/types.gen.d.ts +123 -123
- package/dist/src/arc/ir/types.gen.d.ts.map +1 -1
- package/dist/src/arc/module/types.gen.d.ts +45 -45
- package/dist/src/arc/program/types.gen.d.ts +45 -45
- package/dist/src/arc/types/types.gen.d.ts +11 -11
- package/dist/src/arc/types/types.gen.d.ts.map +1 -1
- package/dist/src/arc/types.gen.d.ts +99 -99
- package/dist/src/auth/auth.d.ts +3 -3
- package/dist/src/auth/auth.d.ts.map +1 -1
- package/dist/src/channel/client.d.ts +2 -2
- package/dist/src/channel/client.d.ts.map +1 -1
- package/dist/src/channel/retriever.d.ts +5 -8
- package/dist/src/channel/retriever.d.ts.map +1 -1
- package/dist/src/channel/types.gen.d.ts +3 -3
- package/dist/src/channel/writer.d.ts.map +1 -1
- package/dist/src/connection/checker.d.ts +1 -1
- package/dist/src/connection/checker.d.ts.map +1 -1
- package/dist/src/device/client.d.ts.map +1 -1
- package/dist/src/device/types.gen.d.ts +6 -8
- package/dist/src/device/types.gen.d.ts.map +1 -1
- package/dist/src/errors.d.ts +2 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/framer/adapter.d.ts.map +1 -1
- package/dist/src/framer/client.d.ts +2 -2
- package/dist/src/framer/codec.d.ts +9 -1
- package/dist/src/framer/codec.d.ts.map +1 -1
- package/dist/src/framer/deleter.d.ts.map +1 -1
- package/dist/src/framer/frame.d.ts +1 -1
- package/dist/src/framer/iterator.d.ts +84 -3
- package/dist/src/framer/iterator.d.ts.map +1 -1
- package/dist/src/framer/streamProxy.d.ts.map +1 -1
- package/dist/src/framer/streamer.d.ts +1 -3
- package/dist/src/framer/streamer.d.ts.map +1 -1
- package/dist/src/framer/types.gen.d.ts +18 -0
- package/dist/src/framer/types.gen.d.ts.map +1 -1
- package/dist/src/framer/writer.d.ts +8 -8
- package/dist/src/framer/writer.d.ts.map +1 -1
- package/dist/src/group/client.d.ts +1 -2
- package/dist/src/group/client.d.ts.map +1 -1
- package/dist/src/group/types.gen.d.ts +2 -2
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/label/client.d.ts +5 -8
- package/dist/src/label/client.d.ts.map +1 -1
- package/dist/src/lineplot/client.d.ts.map +1 -1
- package/dist/src/lineplot/types.gen.d.ts +2 -2
- package/dist/src/log/client.d.ts.map +1 -1
- package/dist/src/log/types.gen.d.ts +2 -2
- package/dist/src/ontology/client.d.ts +1 -3
- package/dist/src/ontology/client.d.ts.map +1 -1
- package/dist/src/ontology/payload.d.ts +12 -16
- package/dist/src/ontology/payload.d.ts.map +1 -1
- package/dist/src/ontology/types.gen.d.ts +1 -2
- package/dist/src/ontology/types.gen.d.ts.map +1 -1
- package/dist/src/ontology/writer.d.ts +5 -10
- package/dist/src/ontology/writer.d.ts.map +1 -1
- package/dist/src/rack/client.d.ts.map +1 -1
- package/dist/src/rack/types.gen.d.ts +3 -3
- package/dist/src/ranger/alias/client.d.ts.map +1 -1
- package/dist/src/ranger/client.d.ts.map +1 -1
- package/dist/src/ranger/kv/client.d.ts.map +1 -1
- package/dist/src/ranger/types.gen.d.ts +6 -6
- package/dist/src/ranger/types.gen.d.ts.map +1 -1
- package/dist/src/ranger/writer.d.ts +2 -3
- package/dist/src/ranger/writer.d.ts.map +1 -1
- package/dist/src/schematic/actions.d.ts +147 -0
- package/dist/src/schematic/actions.d.ts.map +1 -0
- package/dist/src/schematic/actions.gen.d.ts +484 -0
- package/dist/src/schematic/actions.gen.d.ts.map +1 -0
- package/dist/src/schematic/actions.spec.d.ts +2 -0
- package/dist/src/schematic/actions.spec.d.ts.map +1 -0
- package/dist/src/schematic/client.d.ts +53 -2
- package/dist/src/schematic/client.d.ts.map +1 -1
- package/dist/src/schematic/external.d.ts +2 -0
- package/dist/src/schematic/external.d.ts.map +1 -1
- package/dist/src/schematic/symbol/client.d.ts.map +1 -1
- package/dist/src/schematic/symbol/types.gen.d.ts +48 -58
- package/dist/src/schematic/symbol/types.gen.d.ts.map +1 -1
- package/dist/src/schematic/types.gen.d.ts +131 -5
- package/dist/src/schematic/types.gen.d.ts.map +1 -1
- package/dist/src/status/client.d.ts.map +1 -1
- package/dist/src/status/payload.d.ts +3 -3
- package/dist/src/table/actions.d.ts +156 -0
- package/dist/src/table/actions.d.ts.map +1 -0
- package/dist/src/table/actions.gen.d.ts +587 -0
- package/dist/src/table/actions.gen.d.ts.map +1 -0
- package/dist/src/table/client.d.ts +28 -2
- package/dist/src/table/client.d.ts.map +1 -1
- package/dist/src/table/external.d.ts +2 -0
- package/dist/src/table/external.d.ts.map +1 -1
- package/dist/src/table/types.gen.d.ts +71 -4
- package/dist/src/table/types.gen.d.ts.map +1 -1
- package/dist/src/task/client.d.ts.map +1 -1
- package/dist/src/task/types.gen.d.ts +7 -7
- package/dist/src/task/types.gen.d.ts.map +1 -1
- package/dist/src/user/client.d.ts +2 -2
- package/dist/src/user/client.d.ts.map +1 -1
- package/dist/src/user/types.gen.d.ts +2 -2
- package/dist/src/view/client.d.ts.map +1 -1
- package/dist/src/view/types.gen.d.ts +2 -2
- package/dist/src/workspace/client.d.ts.map +1 -1
- package/dist/src/workspace/types.gen.d.ts +3 -3
- package/dist/src/workspace/types.gen.d.ts.map +1 -1
- package/package.json +12 -11
- package/src/access/policy/client.ts +4 -7
- package/src/access/role/client.ts +6 -26
- package/src/actions/actions.spec.ts +229 -0
- package/src/actions/actions.ts +104 -0
- package/src/actions/external.ts +10 -0
- package/src/actions/index.ts +10 -0
- package/src/arc/client.ts +3 -7
- package/src/arc/compiler/types.gen.ts +2 -1
- package/src/arc/ir/types.gen.ts +2 -2
- package/src/arc/lsp.spec.ts +3 -7
- package/src/arc/types/types.gen.ts +3 -3
- package/src/auth/auth.spec.ts +12 -13
- package/src/auth/auth.ts +36 -34
- package/src/channel/batchRetriever.spec.ts +13 -4
- package/src/channel/client.ts +8 -6
- package/src/channel/retriever.ts +7 -16
- package/src/channel/writer.ts +4 -20
- package/src/connection/checker.ts +6 -6
- package/src/connection/connection.spec.ts +5 -8
- package/src/device/client.ts +5 -8
- package/src/device/types.gen.ts +4 -4
- package/src/errors.ts +9 -9
- package/src/framer/adapter.ts +2 -4
- package/src/framer/client.ts +1 -1
- package/src/framer/codec.spec.ts +53 -3
- package/src/framer/codec.ts +58 -25
- package/src/framer/deleter.ts +2 -8
- package/src/framer/iterator.ts +43 -40
- package/src/framer/streamProxy.ts +13 -13
- package/src/framer/streamer.spec.ts +12 -3
- package/src/framer/streamer.ts +7 -12
- package/src/framer/types.gen.ts +20 -0
- package/src/framer/writer.spec.ts +77 -0
- package/src/framer/writer.ts +51 -28
- package/src/group/client.ts +4 -7
- package/src/index.ts +3 -2
- package/src/label/client.ts +6 -16
- package/src/lineplot/client.ts +6 -21
- package/src/log/client.ts +6 -21
- package/src/ontology/client.ts +3 -4
- package/src/ontology/types.gen.ts +0 -1
- package/src/ontology/writer.ts +4 -7
- package/src/rack/client.ts +4 -7
- package/src/ranger/alias/client.ts +6 -11
- package/src/ranger/client.ts +3 -4
- package/src/ranger/kv/client.ts +5 -8
- package/src/ranger/writer.ts +4 -17
- package/src/schematic/access.spec.ts +6 -6
- package/src/schematic/actions.gen.ts +200 -0
- package/src/schematic/actions.spec.ts +699 -0
- package/src/schematic/actions.ts +168 -0
- package/src/schematic/client.ts +34 -30
- package/src/schematic/external.ts +2 -0
- package/src/schematic/schematic.spec.ts +233 -69
- package/src/schematic/symbol/client.ts +6 -11
- package/src/schematic/symbol/types.gen.ts +1 -10
- package/src/schematic/types.gen.ts +55 -6
- package/src/status/client.ts +4 -10
- package/src/table/access.spec.ts +0 -6
- package/src/table/actions.gen.ts +243 -0
- package/src/table/actions.ts +255 -0
- package/src/table/client.ts +21 -25
- package/src/table/external.ts +2 -0
- package/src/table/table.spec.ts +588 -43
- package/src/table/types.gen.ts +58 -5
- package/src/task/client.ts +7 -11
- package/src/task/types.gen.ts +8 -6
- package/src/user/client.ts +6 -11
- package/src/view/client.ts +4 -7
- package/src/workspace/client.ts +6 -16
- package/src/workspace/types.gen.ts +2 -1
package/src/table/types.gen.ts
CHANGED
|
@@ -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
|
-
*
|
|
32
|
-
* references
|
|
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
|
-
|
|
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({
|
|
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");
|
package/src/task/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 {
|
|
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
|
|
283
|
-
this.client,
|
|
282
|
+
const res = await this.client.send(
|
|
284
283
|
"/task/create",
|
|
285
|
-
{ tasks: array.toArray(task) }
|
|
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
|
|
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
|
|
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
|
|
332
|
-
this.client,
|
|
328
|
+
const response = await this.client.send(
|
|
333
329
|
"/task/copy",
|
|
334
330
|
{ key, name, snapshot },
|
|
335
331
|
copyReqZ,
|
package/src/task/types.gen.ts
CHANGED
|
@@ -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
|
|
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]
|
|
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
|
|
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({
|
package/src/user/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 {
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
147
|
-
this.client,
|
|
142
|
+
await this.client.send(
|
|
148
143
|
"/user/delete",
|
|
149
144
|
{ keys: array.toArray(keys) },
|
|
150
145
|
deleteReqZ,
|
package/src/view/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 {
|
|
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
|
|
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
|
|
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
|
|
84
|
-
this.client,
|
|
81
|
+
await this.client.send(
|
|
85
82
|
"/view/delete",
|
|
86
83
|
{ keys: array.toArray(keys) },
|
|
87
84
|
deleteReqZ,
|
package/src/workspace/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 {
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
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
|