@synnaxlabs/client 0.49.3 → 0.50.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.
- package/.turbo/turbo-build.log +10 -10
- package/CONTRIBUTING.md +1 -2
- package/README.md +1 -1
- package/dist/client.cjs +32 -32
- package/dist/client.js +3222 -3155
- package/dist/src/access/policy/client.d.ts +90 -76
- package/dist/src/access/policy/client.d.ts.map +1 -1
- package/dist/src/access/policy/payload.d.ts +17 -14
- package/dist/src/access/policy/payload.d.ts.map +1 -1
- package/dist/src/access/role/payload.d.ts +2 -2
- package/dist/src/arc/payload.d.ts +21 -20
- package/dist/src/arc/payload.d.ts.map +1 -1
- package/dist/src/channel/client.d.ts +5 -10
- package/dist/src/channel/client.d.ts.map +1 -1
- package/dist/src/channel/payload.d.ts +11 -9
- package/dist/src/channel/payload.d.ts.map +1 -1
- package/dist/src/channel/retriever.d.ts.map +1 -1
- package/dist/src/client.d.ts +2 -0
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/device/client.d.ts +2 -2
- package/dist/src/device/payload.d.ts +1 -1
- package/dist/src/framer/client.d.ts +2 -2
- package/dist/src/framer/streamer.d.ts +1 -11
- package/dist/src/framer/streamer.d.ts.map +1 -1
- package/dist/src/framer/writer.d.ts +0 -10
- package/dist/src/framer/writer.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/label/client.d.ts +11 -8
- package/dist/src/label/client.d.ts.map +1 -1
- package/dist/src/ontology/client.d.ts +6 -4
- package/dist/src/ontology/client.d.ts.map +1 -1
- package/dist/src/ontology/group/client.d.ts +3 -2
- package/dist/src/ontology/group/client.d.ts.map +1 -1
- package/dist/src/ontology/group/payload.d.ts +1 -1
- package/dist/src/ontology/group/payload.d.ts.map +1 -1
- package/dist/src/ontology/payload.d.ts +25 -20
- package/dist/src/ontology/payload.d.ts.map +1 -1
- package/dist/src/ontology/writer.d.ts +15 -10
- package/dist/src/ontology/writer.d.ts.map +1 -1
- package/dist/src/rack/client.d.ts +2 -2
- package/dist/src/ranger/client.d.ts +2 -2
- package/dist/src/ranger/writer.d.ts +3 -2
- package/dist/src/ranger/writer.d.ts.map +1 -1
- package/dist/src/status/payload.d.ts +2 -2
- package/dist/src/task/client.d.ts +2 -2
- package/dist/src/task/client.d.ts.map +1 -1
- package/dist/src/task/payload.d.ts +1 -0
- package/dist/src/task/payload.d.ts.map +1 -1
- package/dist/src/task/payload.spec.d.ts +2 -0
- package/dist/src/task/payload.spec.d.ts.map +1 -0
- package/dist/src/user/client.d.ts +2 -2
- package/dist/src/view/client.d.ts +43 -0
- package/dist/src/view/client.d.ts.map +1 -0
- package/dist/src/view/external.d.ts +3 -0
- package/dist/src/view/external.d.ts.map +1 -0
- package/dist/src/view/index.d.ts +2 -0
- package/dist/src/view/index.d.ts.map +1 -0
- package/dist/src/view/payload.d.ts +20 -0
- package/dist/src/view/payload.d.ts.map +1 -0
- package/dist/src/view/view.spec.d.ts +2 -0
- package/dist/src/view/view.spec.d.ts.map +1 -0
- package/dist/src/workspace/client.d.ts +3 -3
- package/dist/src/workspace/lineplot/client.d.ts +2 -2
- package/dist/src/workspace/lineplot/payload.d.ts +3 -3
- package/dist/src/workspace/log/client.d.ts +2 -2
- package/dist/src/workspace/log/payload.d.ts +3 -3
- package/dist/src/workspace/payload.d.ts +3 -3
- package/dist/src/workspace/schematic/client.d.ts +2 -2
- package/dist/src/workspace/schematic/payload.d.ts +3 -3
- package/dist/src/workspace/table/client.d.ts +2 -2
- package/dist/src/workspace/table/payload.d.ts +3 -3
- package/eslint.config.ts +1 -1
- package/examples/node/basicReadWrite.js +1 -1
- package/examples/node/createChannels.js +50 -0
- package/examples/node/createRange.js +67 -0
- package/examples/node/readLatest.js +76 -0
- package/examples/node/seriesAndFrames.js +2 -2
- package/examples/node/{liveStream.js → streamRead.js} +1 -1
- package/examples/node/streamWrite.js +1 -1
- package/package.json +10 -10
- package/src/access/client.ts +1 -1
- package/src/access/enforce.spec.ts +1 -1
- package/src/access/enforce.ts +1 -1
- package/src/access/external.ts +1 -1
- package/src/access/index.ts +1 -1
- package/src/access/payload.ts +1 -1
- package/src/access/policy/access.spec.ts +1 -1
- package/src/access/policy/client.ts +1 -1
- package/src/access/policy/external.ts +1 -1
- package/src/access/policy/index.ts +1 -1
- package/src/access/policy/payload.ts +1 -1
- package/src/access/role/client.ts +1 -1
- package/src/access/role/external.ts +1 -1
- package/src/access/role/index.ts +1 -1
- package/src/access/role/payload.ts +1 -1
- package/src/access/role/role.spec.ts +1 -1
- package/src/arc/access.spec.ts +1 -7
- package/src/arc/client.ts +1 -1
- package/src/arc/external.ts +1 -1
- package/src/arc/index.ts +1 -1
- package/src/arc/lsp.spec.ts +2 -5
- package/src/arc/payload.ts +7 -12
- package/src/auth/auth.spec.ts +1 -1
- package/src/auth/auth.ts +1 -1
- package/src/auth/index.ts +1 -1
- package/src/channel/access.spec.ts +1 -1
- package/src/channel/batchRetriever.spec.ts +1 -3
- package/src/channel/channel.spec.ts +13 -20
- package/src/channel/client.ts +5 -36
- package/src/channel/external.ts +1 -1
- package/src/channel/index.ts +1 -1
- package/src/channel/payload.spec.ts +1 -1
- package/src/channel/payload.ts +12 -5
- package/src/channel/retriever.ts +5 -3
- package/src/channel/writer.ts +1 -1
- package/src/client.ts +8 -3
- package/src/connection/checker.ts +2 -2
- package/src/connection/connection.spec.ts +1 -1
- package/src/connection/index.ts +1 -1
- package/src/connection.spec.ts +1 -1
- package/src/control/client.ts +1 -1
- package/src/control/external.ts +1 -1
- package/src/control/index.ts +1 -1
- package/src/control/state.spec.ts +1 -1
- package/src/control/state.ts +1 -1
- package/src/device/access.spec.ts +1 -1
- package/src/device/client.ts +1 -1
- package/src/device/device.spec.ts +1 -1
- package/src/device/external.ts +1 -1
- package/src/device/index.ts +1 -1
- package/src/device/payload.ts +1 -1
- package/src/errors.spec.ts +1 -1
- package/src/errors.ts +1 -1
- package/src/framer/adapter.spec.ts +1 -1
- package/src/framer/adapter.ts +1 -1
- package/src/framer/client.spec.ts +1 -1
- package/src/framer/client.ts +1 -1
- package/src/framer/codec.spec.ts +1 -1
- package/src/framer/codec.ts +1 -1
- package/src/framer/deleter.spec.ts +1 -1
- package/src/framer/deleter.ts +1 -1
- package/src/framer/external.ts +1 -1
- package/src/framer/frame.spec.ts +1 -1
- package/src/framer/frame.ts +1 -1
- package/src/framer/index.ts +1 -1
- package/src/framer/iterator.spec.ts +1 -1
- package/src/framer/iterator.ts +1 -1
- package/src/framer/payload.ts +1 -1
- package/src/framer/reader.spec.ts +1 -1
- package/src/framer/reader.ts +1 -1
- package/src/framer/streamProxy.ts +1 -1
- package/src/framer/streamer.spec.ts +1 -2
- package/src/framer/streamer.ts +4 -4
- package/src/framer/writer.spec.ts +1 -1
- package/src/framer/writer.ts +1 -1
- package/src/index.ts +2 -1
- package/src/label/access.spec.ts +1 -1
- package/src/label/client.ts +1 -1
- package/src/label/external.ts +1 -1
- package/src/label/index.ts +1 -1
- package/src/label/label.spec.ts +1 -1
- package/src/label/payload.ts +1 -1
- package/src/ontology/client.ts +6 -7
- package/src/ontology/external.ts +1 -1
- package/src/ontology/group/access.spec.ts +1 -1
- package/src/ontology/group/client.ts +1 -1
- package/src/ontology/group/external.ts +1 -1
- package/src/ontology/group/group.spec.ts +1 -1
- package/src/ontology/group/index.ts +1 -1
- package/src/ontology/group/payload.ts +1 -1
- package/src/ontology/index.ts +1 -1
- package/src/ontology/ontology.spec.ts +1 -1
- package/src/ontology/payload.ts +6 -3
- package/src/ontology/writer.ts +1 -1
- package/src/rack/access.spec.ts +1 -1
- package/src/rack/client.ts +1 -1
- package/src/rack/external.ts +1 -1
- package/src/rack/index.ts +1 -1
- package/src/rack/payload.ts +1 -1
- package/src/rack/rack.spec.ts +1 -1
- package/src/ranger/access.spec.ts +1 -1
- package/src/ranger/alias.ts +1 -1
- package/src/ranger/client.ts +1 -1
- package/src/ranger/external.ts +1 -1
- package/src/ranger/index.ts +1 -1
- package/src/ranger/kv.ts +1 -1
- package/src/ranger/payload.ts +1 -1
- package/src/ranger/ranger.spec.ts +1 -1
- package/src/ranger/writer.ts +1 -1
- package/src/status/access.spec.ts +1 -1
- package/src/status/client.ts +1 -1
- package/src/status/external.ts +1 -1
- package/src/status/index.ts +1 -1
- package/src/status/payload.ts +1 -1
- package/src/status/status.spec.ts +1 -1
- package/src/task/access.spec.ts +1 -1
- package/src/task/client.ts +11 -6
- package/src/task/external.ts +1 -1
- package/src/task/index.ts +1 -1
- package/src/task/payload.spec.ts +113 -0
- package/src/task/payload.ts +10 -5
- package/src/task/task.spec.ts +1 -1
- package/src/testutil/access.ts +1 -1
- package/src/testutil/channels.ts +1 -1
- package/src/testutil/client.ts +1 -1
- package/src/testutil/telem.ts +1 -1
- package/src/transport.ts +1 -1
- package/src/user/access.spec.ts +1 -1
- package/src/user/client.ts +1 -1
- package/src/user/external.ts +1 -1
- package/src/user/index.ts +1 -1
- package/src/user/payload.ts +1 -1
- package/src/user/user.spec.ts +1 -1
- package/src/util/decodeJSONString.ts +1 -1
- package/src/util/parseWithoutKeyConversion.ts +1 -1
- package/src/util/retrieve.spec.ts +1 -1
- package/src/util/retrieve.ts +1 -1
- package/src/util/telem.ts +1 -1
- package/src/view/client.ts +96 -0
- package/src/view/external.ts +11 -0
- package/src/view/index.ts +10 -0
- package/src/view/payload.ts +25 -0
- package/src/view/view.spec.ts +161 -0
- package/src/vite-env.d.ts +1 -1
- package/src/workspace/access.spec.ts +1 -1
- package/src/workspace/client.ts +1 -1
- package/src/workspace/external.ts +1 -1
- package/src/workspace/index.ts +1 -1
- package/src/workspace/lineplot/access.spec.ts +1 -1
- package/src/workspace/lineplot/client.ts +1 -1
- package/src/workspace/lineplot/external.ts +1 -1
- package/src/workspace/lineplot/index.ts +1 -1
- package/src/workspace/lineplot/lineplot.spec.ts +1 -1
- package/src/workspace/lineplot/payload.ts +1 -1
- package/src/workspace/log/access.spec.ts +1 -1
- package/src/workspace/log/client.ts +1 -1
- package/src/workspace/log/external.ts +1 -1
- package/src/workspace/log/index.ts +1 -1
- package/src/workspace/log/log.spec.ts +1 -1
- package/src/workspace/log/payload.ts +1 -1
- package/src/workspace/payload.ts +1 -1
- package/src/workspace/schematic/access.spec.ts +1 -1
- package/src/workspace/schematic/client.ts +1 -1
- package/src/workspace/schematic/external.ts +1 -1
- package/src/workspace/schematic/index.ts +1 -1
- package/src/workspace/schematic/payload.ts +1 -1
- package/src/workspace/schematic/schematic.spec.ts +1 -1
- package/src/workspace/schematic/symbol/access.spec.ts +1 -1
- package/src/workspace/schematic/symbol/client.spec.ts +1 -1
- package/src/workspace/schematic/symbol/client.ts +1 -1
- package/src/workspace/schematic/symbol/external.ts +1 -1
- package/src/workspace/schematic/symbol/index.ts +1 -1
- package/src/workspace/schematic/symbol/payload.ts +1 -1
- package/src/workspace/table/access.spec.ts +1 -1
- package/src/workspace/table/client.ts +1 -1
- package/src/workspace/table/external.ts +1 -1
- package/src/workspace/table/index.ts +1 -1
- package/src/workspace/table/payload.ts +1 -1
- package/src/workspace/table/table.spec.ts +1 -1
- package/src/workspace/workspace.spec.ts +1 -1
- package/vite.config.ts +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as z } from 'zod';
|
|
2
|
+
export declare const keyZ: z.ZodUUID;
|
|
3
|
+
export type Key = z.infer<typeof keyZ>;
|
|
4
|
+
export declare const viewZ: z.ZodObject<{
|
|
5
|
+
key: z.ZodUUID;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
type: z.ZodString;
|
|
8
|
+
query: z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export interface View extends z.infer<typeof viewZ> {
|
|
11
|
+
}
|
|
12
|
+
export declare const newZ: z.ZodObject<{
|
|
13
|
+
name: z.ZodString;
|
|
14
|
+
type: z.ZodString;
|
|
15
|
+
query: z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>;
|
|
16
|
+
key: z.ZodOptional<z.ZodUUID>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export interface New extends z.infer<typeof newZ> {
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=payload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/view/payload.ts"],"names":[],"mappings":"AAUA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,eAAO,MAAM,IAAI,WAAW,CAAC;AAC7B,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAEvC,eAAO,MAAM,KAAK;;;;;iBAKhB,CAAC;AACH,MAAM,WAAW,IAAK,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC;CAAG;AAEtD,eAAO,MAAM,IAAI;;;;;iBAAyC,CAAC;AAC3D,MAAM,WAAW,GAAI,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.spec.d.ts","sourceRoot":"","sources":["../../../src/view/view.spec.ts"],"names":[],"mappings":""}
|
|
@@ -18,7 +18,7 @@ export interface RetrieveRequest extends z.infer<typeof retrieveReqZ> {
|
|
|
18
18
|
}
|
|
19
19
|
declare const setLayoutReqZ: z.ZodObject<{
|
|
20
20
|
key: z.ZodUUID;
|
|
21
|
-
layout: z.ZodPipe<z.ZodRecord<z.ZodUnion<readonly [z.
|
|
21
|
+
layout: z.ZodPipe<z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>, z.ZodTransform<string, Record<string | number, unknown>>>;
|
|
22
22
|
}, z.core.$strip>;
|
|
23
23
|
export declare const SET_CHANNEL_NAME = "sy_workspace_set";
|
|
24
24
|
export declare const DELETE_CHANNEL_NAME = "sy_workspace_delete";
|
|
@@ -43,10 +43,10 @@ export declare class Client {
|
|
|
43
43
|
}
|
|
44
44
|
export declare const ontologyID: ontology.CreateID<string>;
|
|
45
45
|
export declare const TYPE_ONTOLOGY_ID: {
|
|
46
|
-
type: "status" | "label" | "log" | "builtin" | "cluster" | "
|
|
46
|
+
type: "channel" | "status" | "label" | "log" | "builtin" | "cluster" | "node" | "group" | "range" | "framer" | "range-alias" | "user" | "workspace" | "schematic" | "lineplot" | "rack" | "device" | "task" | "policy" | "role" | "table" | "arc" | "schematic_symbol" | "view";
|
|
47
47
|
key: string;
|
|
48
48
|
} | {
|
|
49
|
-
type: "status" | "label" | "log" | "builtin" | "cluster" | "
|
|
49
|
+
type: "channel" | "status" | "label" | "log" | "builtin" | "cluster" | "node" | "group" | "range" | "framer" | "range-alias" | "user" | "workspace" | "schematic" | "lineplot" | "rack" | "device" | "task" | "policy" | "role" | "table" | "arc" | "schematic_symbol" | "view";
|
|
50
50
|
key: string;
|
|
51
51
|
};
|
|
52
52
|
export {};
|
|
@@ -39,10 +39,10 @@ export declare class Client {
|
|
|
39
39
|
}
|
|
40
40
|
export declare const ontologyID: ontology.CreateID<string>;
|
|
41
41
|
export declare const TYPE_ONTOLOGY_ID: {
|
|
42
|
-
type: "status" | "label" | "log" | "builtin" | "cluster" | "
|
|
42
|
+
type: "channel" | "status" | "label" | "log" | "builtin" | "cluster" | "node" | "group" | "range" | "framer" | "range-alias" | "user" | "workspace" | "schematic" | "lineplot" | "rack" | "device" | "task" | "policy" | "role" | "table" | "arc" | "schematic_symbol" | "view";
|
|
43
43
|
key: string;
|
|
44
44
|
} | {
|
|
45
|
-
type: "status" | "label" | "log" | "builtin" | "cluster" | "
|
|
45
|
+
type: "channel" | "status" | "label" | "log" | "builtin" | "cluster" | "node" | "group" | "range" | "framer" | "range-alias" | "user" | "workspace" | "schematic" | "lineplot" | "rack" | "device" | "task" | "policy" | "role" | "table" | "arc" | "schematic_symbol" | "view";
|
|
46
46
|
key: string;
|
|
47
47
|
};
|
|
48
48
|
export {};
|
|
@@ -6,21 +6,21 @@ export type Params = Key | Key[];
|
|
|
6
6
|
export declare const linePlotZ: z.ZodObject<{
|
|
7
7
|
key: z.ZodUUID;
|
|
8
8
|
name: z.ZodString;
|
|
9
|
-
data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.
|
|
9
|
+
data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>, z.ZodPipe<z.ZodString, z.ZodTransform<record.Unknown, string>>]>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export interface LinePlot extends z.infer<typeof linePlotZ> {
|
|
12
12
|
}
|
|
13
13
|
export declare const newZ: z.ZodPipe<z.ZodObject<{
|
|
14
14
|
key: z.ZodOptional<z.ZodUUID>;
|
|
15
15
|
name: z.ZodString;
|
|
16
|
-
data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.
|
|
16
|
+
data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>, z.ZodPipe<z.ZodString, z.ZodTransform<record.Unknown, string>>]>;
|
|
17
17
|
}, z.core.$strip>, z.ZodTransform<{
|
|
18
18
|
data: string;
|
|
19
19
|
name: string;
|
|
20
20
|
key?: string | undefined;
|
|
21
21
|
}, {
|
|
22
22
|
name: string;
|
|
23
|
-
data: record.Unknown | Record<string | number
|
|
23
|
+
data: record.Unknown | Record<string | number, unknown>;
|
|
24
24
|
key?: string | undefined;
|
|
25
25
|
}>>;
|
|
26
26
|
export interface New extends z.input<typeof newZ> {
|
|
@@ -39,10 +39,10 @@ export declare class Client {
|
|
|
39
39
|
}
|
|
40
40
|
export declare const ontologyID: ontology.CreateID<string>;
|
|
41
41
|
export declare const TYPE_ONTOLOGY_ID: {
|
|
42
|
-
type: "status" | "label" | "log" | "builtin" | "cluster" | "
|
|
42
|
+
type: "channel" | "status" | "label" | "log" | "builtin" | "cluster" | "node" | "group" | "range" | "framer" | "range-alias" | "user" | "workspace" | "schematic" | "lineplot" | "rack" | "device" | "task" | "policy" | "role" | "table" | "arc" | "schematic_symbol" | "view";
|
|
43
43
|
key: string;
|
|
44
44
|
} | {
|
|
45
|
-
type: "status" | "label" | "log" | "builtin" | "cluster" | "
|
|
45
|
+
type: "channel" | "status" | "label" | "log" | "builtin" | "cluster" | "node" | "group" | "range" | "framer" | "range-alias" | "user" | "workspace" | "schematic" | "lineplot" | "rack" | "device" | "task" | "policy" | "role" | "table" | "arc" | "schematic_symbol" | "view";
|
|
46
46
|
key: string;
|
|
47
47
|
};
|
|
48
48
|
export {};
|
|
@@ -6,21 +6,21 @@ export type Params = Key | Key[];
|
|
|
6
6
|
export declare const logZ: z.ZodObject<{
|
|
7
7
|
key: z.ZodUUID;
|
|
8
8
|
name: z.ZodString;
|
|
9
|
-
data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.
|
|
9
|
+
data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>, z.ZodPipe<z.ZodString, z.ZodTransform<record.Unknown, string>>]>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export interface Log extends z.infer<typeof logZ> {
|
|
12
12
|
}
|
|
13
13
|
export declare const newZ: z.ZodPipe<z.ZodObject<{
|
|
14
14
|
key: z.ZodOptional<z.ZodUUID>;
|
|
15
15
|
name: z.ZodString;
|
|
16
|
-
data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.
|
|
16
|
+
data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>, z.ZodPipe<z.ZodString, z.ZodTransform<record.Unknown, string>>]>;
|
|
17
17
|
}, z.core.$strip>, z.ZodTransform<{
|
|
18
18
|
data: string;
|
|
19
19
|
name: string;
|
|
20
20
|
key?: string | undefined;
|
|
21
21
|
}, {
|
|
22
22
|
name: string;
|
|
23
|
-
data: record.Unknown | Record<string | number
|
|
23
|
+
data: record.Unknown | Record<string | number, unknown>;
|
|
24
24
|
key?: string | undefined;
|
|
25
25
|
}>>;
|
|
26
26
|
export interface New extends z.input<typeof newZ> {
|
|
@@ -6,21 +6,21 @@ export type Params = Key | Key[];
|
|
|
6
6
|
export declare const workspaceZ: z.ZodObject<{
|
|
7
7
|
key: z.ZodUUID;
|
|
8
8
|
name: z.ZodString;
|
|
9
|
-
layout: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.
|
|
9
|
+
layout: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>, z.ZodPipe<z.ZodString, z.ZodTransform<record.Unknown, string>>]>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export interface Workspace extends z.infer<typeof workspaceZ> {
|
|
12
12
|
}
|
|
13
13
|
export declare const newZ: z.ZodPipe<z.ZodObject<{
|
|
14
14
|
key: z.ZodOptional<z.ZodUUID>;
|
|
15
15
|
name: z.ZodString;
|
|
16
|
-
layout: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.
|
|
16
|
+
layout: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>, z.ZodPipe<z.ZodString, z.ZodTransform<record.Unknown, string>>]>;
|
|
17
17
|
}, z.core.$strip>, z.ZodTransform<{
|
|
18
18
|
layout: string;
|
|
19
19
|
name: string;
|
|
20
20
|
key?: string | undefined;
|
|
21
21
|
}, {
|
|
22
22
|
name: string;
|
|
23
|
-
layout: record.Unknown | Record<string | number
|
|
23
|
+
layout: record.Unknown | Record<string | number, unknown>;
|
|
24
24
|
key?: string | undefined;
|
|
25
25
|
}>>;
|
|
26
26
|
export interface New extends z.input<typeof newZ> {
|
|
@@ -48,10 +48,10 @@ export declare class Client {
|
|
|
48
48
|
}
|
|
49
49
|
export declare const ontologyID: ontology.CreateID<string>;
|
|
50
50
|
export declare const TYPE_ONTOLOGY_ID: {
|
|
51
|
-
type: "status" | "label" | "log" | "builtin" | "cluster" | "
|
|
51
|
+
type: "channel" | "status" | "label" | "log" | "builtin" | "cluster" | "node" | "group" | "range" | "framer" | "range-alias" | "user" | "workspace" | "schematic" | "lineplot" | "rack" | "device" | "task" | "policy" | "role" | "table" | "arc" | "schematic_symbol" | "view";
|
|
52
52
|
key: string;
|
|
53
53
|
} | {
|
|
54
|
-
type: "status" | "label" | "log" | "builtin" | "cluster" | "
|
|
54
|
+
type: "channel" | "status" | "label" | "log" | "builtin" | "cluster" | "node" | "group" | "range" | "framer" | "range-alias" | "user" | "workspace" | "schematic" | "lineplot" | "rack" | "device" | "task" | "policy" | "role" | "table" | "arc" | "schematic_symbol" | "view";
|
|
55
55
|
key: string;
|
|
56
56
|
};
|
|
57
57
|
export {};
|
|
@@ -6,7 +6,7 @@ export type Params = Key | Key[];
|
|
|
6
6
|
export declare const schematicZ: z.ZodObject<{
|
|
7
7
|
key: z.ZodUUID;
|
|
8
8
|
name: z.ZodString;
|
|
9
|
-
data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.
|
|
9
|
+
data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>, z.ZodPipe<z.ZodString, z.ZodTransform<record.Unknown, string>>]>;
|
|
10
10
|
snapshot: z.ZodBoolean;
|
|
11
11
|
}, z.core.$strip>;
|
|
12
12
|
export interface Schematic extends z.infer<typeof schematicZ> {
|
|
@@ -14,7 +14,7 @@ export interface Schematic extends z.infer<typeof schematicZ> {
|
|
|
14
14
|
export declare const newZ: z.ZodPipe<z.ZodObject<{
|
|
15
15
|
key: z.ZodOptional<z.ZodUUID>;
|
|
16
16
|
name: z.ZodString;
|
|
17
|
-
data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.
|
|
17
|
+
data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>, z.ZodPipe<z.ZodString, z.ZodTransform<record.Unknown, string>>]>;
|
|
18
18
|
snapshot: z.ZodOptional<z.ZodBoolean>;
|
|
19
19
|
}, z.core.$strip>, z.ZodTransform<{
|
|
20
20
|
data: string;
|
|
@@ -23,7 +23,7 @@ export declare const newZ: z.ZodPipe<z.ZodObject<{
|
|
|
23
23
|
snapshot?: boolean | undefined;
|
|
24
24
|
}, {
|
|
25
25
|
name: string;
|
|
26
|
-
data: record.Unknown | Record<string | number
|
|
26
|
+
data: record.Unknown | Record<string | number, unknown>;
|
|
27
27
|
key?: string | undefined;
|
|
28
28
|
snapshot?: boolean | undefined;
|
|
29
29
|
}>>;
|
|
@@ -39,10 +39,10 @@ export declare class Client {
|
|
|
39
39
|
}
|
|
40
40
|
export declare const ontologyID: ontology.CreateID<string>;
|
|
41
41
|
export declare const TYPE_ONTOLOGY_ID: {
|
|
42
|
-
type: "status" | "label" | "log" | "builtin" | "cluster" | "
|
|
42
|
+
type: "channel" | "status" | "label" | "log" | "builtin" | "cluster" | "node" | "group" | "range" | "framer" | "range-alias" | "user" | "workspace" | "schematic" | "lineplot" | "rack" | "device" | "task" | "policy" | "role" | "table" | "arc" | "schematic_symbol" | "view";
|
|
43
43
|
key: string;
|
|
44
44
|
} | {
|
|
45
|
-
type: "status" | "label" | "log" | "builtin" | "cluster" | "
|
|
45
|
+
type: "channel" | "status" | "label" | "log" | "builtin" | "cluster" | "node" | "group" | "range" | "framer" | "range-alias" | "user" | "workspace" | "schematic" | "lineplot" | "rack" | "device" | "task" | "policy" | "role" | "table" | "arc" | "schematic_symbol" | "view";
|
|
46
46
|
key: string;
|
|
47
47
|
};
|
|
48
48
|
export {};
|
|
@@ -6,21 +6,21 @@ export type Params = Key | Key[];
|
|
|
6
6
|
export declare const tableZ: z.ZodObject<{
|
|
7
7
|
key: z.ZodUUID;
|
|
8
8
|
name: z.ZodString;
|
|
9
|
-
data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.
|
|
9
|
+
data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>, z.ZodPipe<z.ZodString, z.ZodTransform<record.Unknown, string>>]>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export interface Table extends z.infer<typeof tableZ> {
|
|
12
12
|
}
|
|
13
13
|
export declare const newZ: z.ZodPipe<z.ZodObject<{
|
|
14
14
|
key: z.ZodOptional<z.ZodUUID>;
|
|
15
15
|
name: z.ZodString;
|
|
16
|
-
data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.
|
|
16
|
+
data: z.ZodUnion<[z.ZodRecord<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodUnknown>, z.ZodPipe<z.ZodString, z.ZodTransform<record.Unknown, string>>]>;
|
|
17
17
|
}, z.core.$strip>, z.ZodTransform<{
|
|
18
18
|
data: string;
|
|
19
19
|
name: string;
|
|
20
20
|
key?: string | undefined;
|
|
21
21
|
}, {
|
|
22
22
|
name: string;
|
|
23
|
-
data: record.Unknown | Record<string | number
|
|
23
|
+
data: record.Unknown | Record<string | number, unknown>;
|
|
24
24
|
key?: string | undefined;
|
|
25
25
|
}>>;
|
|
26
26
|
export interface New extends z.input<typeof newZ> {
|
package/eslint.config.ts
CHANGED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Copyright 2026 Synnax Labs, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Use of this software is governed by the Business Source License included in the file
|
|
4
|
+
// licenses/BSL.txt.
|
|
5
|
+
//
|
|
6
|
+
// As of the Change Date specified in that file, in accordance with the Business Source
|
|
7
|
+
// License, use of this software will be governed by the Apache License, Version 2.0,
|
|
8
|
+
// included in the file licenses/APL.txt.
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A simple example that creates a large number of channels that are indexed by a single
|
|
12
|
+
* timestamp channel.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { DataType, Synnax } from "@synnaxlabs/client";
|
|
16
|
+
|
|
17
|
+
// Connect to a locally running, insecure Synnax cluster. If your connection parameters
|
|
18
|
+
// are different, enter them here. See https://docs.synnaxlabs.com/reference/client/quick-start.
|
|
19
|
+
const client = new Synnax({
|
|
20
|
+
host: "localhost",
|
|
21
|
+
port: 9090,
|
|
22
|
+
username: "synnax",
|
|
23
|
+
password: "seldon",
|
|
24
|
+
secure: false,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const CHANNEL_COUNT = 100;
|
|
28
|
+
|
|
29
|
+
// Create an index channel that will be used to store our timestamps.
|
|
30
|
+
const timeChannel = await client.channels.create({
|
|
31
|
+
name: "create_channels_time",
|
|
32
|
+
dataType: DataType.TIMESTAMP,
|
|
33
|
+
isIndex: true,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Create data channels to store our data. Since we did not call client.channels.create
|
|
37
|
+
// here, the channels are not actually created in the Synnax cluster yet. We will do that
|
|
38
|
+
// in the next step.
|
|
39
|
+
let dataChannels = Array.from({ length: CHANNEL_COUNT }, (_, i) => ({
|
|
40
|
+
name: `create_channels_data_${i}`,
|
|
41
|
+
dataType: DataType.FLOAT64,
|
|
42
|
+
index: timeChannel.key,
|
|
43
|
+
}));
|
|
44
|
+
|
|
45
|
+
// Notice how we reassign the result of the create call to the dataChannels variable.
|
|
46
|
+
// This means that all of the channels will have the correct key given to the channel by
|
|
47
|
+
// the server.
|
|
48
|
+
dataChannels = await client.channels.create(dataChannels);
|
|
49
|
+
|
|
50
|
+
client.close();
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Copyright 2026 Synnax Labs, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Use of this software is governed by the Business Source License included in the file
|
|
4
|
+
// licenses/BSL.txt.
|
|
5
|
+
//
|
|
6
|
+
// As of the Change Date specified in that file, in accordance with the Business Source
|
|
7
|
+
// License, use of this software will be governed by the Apache License, Version 2.0,
|
|
8
|
+
// included in the file licenses/APL.txt.
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* This example shows how to create a named range in Synnax, which can be used to identify
|
|
12
|
+
* and lookup specific periods of time in your data.
|
|
13
|
+
*
|
|
14
|
+
* We'll write data to an index and data channel, and then create a range that spans the
|
|
15
|
+
* entire time range of the data. Then, we'll show how to read the data back using the
|
|
16
|
+
* range.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { DataType, Synnax, TimeSpan, TimeStamp } from "@synnaxlabs/client";
|
|
20
|
+
|
|
21
|
+
// Connect to a locally running, insecure Synnax cluster. If your connection parameters
|
|
22
|
+
// are different, enter them here. See https://docs.synnaxlabs.com/reference/client/quick-start.
|
|
23
|
+
const client = new Synnax({});
|
|
24
|
+
|
|
25
|
+
// Define the data.
|
|
26
|
+
const start = TimeStamp.now();
|
|
27
|
+
const end = start.add(TimeSpan.seconds(10));
|
|
28
|
+
|
|
29
|
+
const timeData = BigInt64Array.from({ length: 1000 }, (_, i) =>
|
|
30
|
+
start.add(TimeSpan.milliseconds(i * 10)).valueOf(),
|
|
31
|
+
);
|
|
32
|
+
const data = Float64Array.from({ length: 1000 }, (_, i) => Math.sin(i * 0.01));
|
|
33
|
+
|
|
34
|
+
// Create an index channel that will be used to store our timestamps.
|
|
35
|
+
const timeChannel = await client.channels.create({
|
|
36
|
+
name: "create_range_time",
|
|
37
|
+
dataType: DataType.TIMESTAMP,
|
|
38
|
+
isIndex: true,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Create a data channel that will be used to store our fake sensor data.
|
|
42
|
+
const dataChannel = await client.channels.create({
|
|
43
|
+
name: "create_range_data",
|
|
44
|
+
dataType: DataType.FLOAT64,
|
|
45
|
+
index: timeChannel.key,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Write the data to the Synnax cluster through the channels. Note that we need to write
|
|
49
|
+
// to the index channel first, otherwise our write will fail.
|
|
50
|
+
await timeChannel.write(start, timeData);
|
|
51
|
+
await dataChannel.write(start, data);
|
|
52
|
+
|
|
53
|
+
// Create a range that spans the start and end of the data.
|
|
54
|
+
const exampleRange = await client.ranges.create({
|
|
55
|
+
name: "create_range_range",
|
|
56
|
+
timeRange: { start, end },
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// We can pull and plot the data from the range by just accessing the channel names as if
|
|
60
|
+
// they were attributes of the range itself.
|
|
61
|
+
const rangeTimeData = await exampleRange.read("create_range_time");
|
|
62
|
+
const rangeData = await exampleRange.read("create_range_data");
|
|
63
|
+
|
|
64
|
+
console.log("Time:", rangeTimeData.at(0), "to", rangeTimeData.at(-1));
|
|
65
|
+
console.log("Data:", rangeData.at(0), "to", rangeData.at(-1));
|
|
66
|
+
|
|
67
|
+
client.close();
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Copyright 2026 Synnax Labs, Inc.
|
|
2
|
+
//
|
|
3
|
+
// Use of this software is governed by the Business Source License included in the file
|
|
4
|
+
// licenses/BSL.txt.
|
|
5
|
+
//
|
|
6
|
+
// As of the Change Date specified in that file, in accordance with the Business Source
|
|
7
|
+
// License, use of this software will be governed by the Apache License, Version 2.0,
|
|
8
|
+
// included in the file licenses/APL.txt.
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* This example demonstrates how to read the latest N samples from Synnax channels. We'll:
|
|
12
|
+
* 1. Create an index channel for timestamps and a data channel for values
|
|
13
|
+
* 2. Write some sample data to these channels
|
|
14
|
+
* 3. Read the latest N samples using an iterator
|
|
15
|
+
* 4. Print the results
|
|
16
|
+
*
|
|
17
|
+
* This pattern is useful for real-time monitoring applications where you need to access
|
|
18
|
+
* the most recent data points.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { DataType, Synnax, TimeSpan, TimeStamp } from "@synnaxlabs/client";
|
|
22
|
+
|
|
23
|
+
// Connect to a locally running, insecure Synnax cluster. If your connection parameters
|
|
24
|
+
// are different, enter them here. See https://docs.synnaxlabs.com/reference/client/quick-start.
|
|
25
|
+
const client = new Synnax({
|
|
26
|
+
host: "localhost",
|
|
27
|
+
port: 9090,
|
|
28
|
+
username: "synnax",
|
|
29
|
+
password: "seldon",
|
|
30
|
+
secure: false,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Create an index channel that will be used to store our timestamps.
|
|
34
|
+
const timeChannel = await client.channels.create({
|
|
35
|
+
name: "read_latest_time",
|
|
36
|
+
isIndex: true,
|
|
37
|
+
dataType: DataType.TIMESTAMP,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// Create a data channel that will be used to store our data.
|
|
41
|
+
const dataChannel = await client.channels.create({
|
|
42
|
+
name: "read_latest_data",
|
|
43
|
+
// We need to specify the index channel that will be used to store the timestamps for
|
|
44
|
+
// this data channel.
|
|
45
|
+
index: timeChannel.key,
|
|
46
|
+
dataType: DataType.FLOAT32,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const SAMPLE_COUNT = 100;
|
|
50
|
+
|
|
51
|
+
// We'll start our write at the current time. This timestamp should be the same as or
|
|
52
|
+
// just before the first timestamp we write.
|
|
53
|
+
const start = TimeStamp.now();
|
|
54
|
+
|
|
55
|
+
// We'll end our write 100 seconds later
|
|
56
|
+
const end = start.add(TimeSpan.seconds(2));
|
|
57
|
+
|
|
58
|
+
// Generate linearly spaced int64 timestamps
|
|
59
|
+
const stamps = BigInt64Array.from({ length: SAMPLE_COUNT }, (_, i) =>
|
|
60
|
+
start.add(TimeSpan.milliseconds((i * 2000) / SAMPLE_COUNT)).valueOf(),
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// Generate a sine wave with some noise as our data
|
|
64
|
+
const data = Float32Array.from(
|
|
65
|
+
{ length: SAMPLE_COUNT },
|
|
66
|
+
(_, i) => Math.sin(1 + (i * 9) / SAMPLE_COUNT) * 20 + (Math.random() - 0.5),
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
// Write the data to the Synnax cluster through the channels. Note that we need to write
|
|
70
|
+
// to the index channel first, otherwise our write will fail.
|
|
71
|
+
await timeChannel.write(start, stamps);
|
|
72
|
+
await dataChannel.write(start, data);
|
|
73
|
+
|
|
74
|
+
console.log(await client.readLatest(["read_latest_time", "read_latest_data"], 1));
|
|
75
|
+
|
|
76
|
+
client.close();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2026 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.
|
|
@@ -82,7 +82,7 @@ import { DataType } from "@synnaxlabs/client";
|
|
|
82
82
|
|
|
83
83
|
series = new Series([1, 2, 3, 4, 5]);
|
|
84
84
|
console.log(series.dataType.toString()); // "float64"
|
|
85
|
-
console.log(series.dataType.equals(DataType.
|
|
85
|
+
console.log(series.dataType.equals(DataType.FLOAT64)); // true
|
|
86
86
|
|
|
87
87
|
series = new Series([1, 2, 3, 4, 5]);
|
|
88
88
|
console.log(series.max); // 5
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synnaxlabs/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.50.0",
|
|
4
4
|
"description": "The Synnax Client Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"synnax",
|
|
@@ -25,21 +25,21 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"async-mutex": "^0.5.0",
|
|
28
|
-
"zod": "^4.1.
|
|
29
|
-
"@synnaxlabs/
|
|
30
|
-
"@synnaxlabs/
|
|
28
|
+
"zod": "^4.1.13",
|
|
29
|
+
"@synnaxlabs/freighter": "^0.50.0",
|
|
30
|
+
"@synnaxlabs/x": "^0.50.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@vitest/coverage-v8": "^3.2.4",
|
|
34
|
-
"@types/node": "^
|
|
35
|
-
"eslint": "^9.39.
|
|
34
|
+
"@types/node": "^25.0.2",
|
|
35
|
+
"eslint": "^9.39.2",
|
|
36
36
|
"madge": "^8.0.0",
|
|
37
37
|
"typescript": "^5.9.3",
|
|
38
|
-
"vite": "^7.
|
|
38
|
+
"vite": "^7.2.7",
|
|
39
39
|
"vitest": "^3.2.4",
|
|
40
|
-
"@synnaxlabs/tsconfig": "^0.
|
|
41
|
-
"eslint-config-synnaxlabs": "^0.
|
|
42
|
-
"@synnaxlabs/vite-plugin": "^0.
|
|
40
|
+
"@synnaxlabs/tsconfig": "^0.50.0",
|
|
41
|
+
"eslint-config-synnaxlabs": "^0.50.0",
|
|
42
|
+
"@synnaxlabs/vite-plugin": "^0.50.0"
|
|
43
43
|
},
|
|
44
44
|
"type": "module",
|
|
45
45
|
"types": "dist/src/index.d.ts",
|
package/src/access/client.ts
CHANGED
package/src/access/enforce.ts
CHANGED
package/src/access/external.ts
CHANGED
package/src/access/index.ts
CHANGED
package/src/access/payload.ts
CHANGED