@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
package/src/framer/client.ts
CHANGED
package/src/framer/codec.spec.ts
CHANGED
package/src/framer/codec.ts
CHANGED
package/src/framer/deleter.ts
CHANGED
package/src/framer/external.ts
CHANGED
package/src/framer/frame.spec.ts
CHANGED
package/src/framer/frame.ts
CHANGED
package/src/framer/index.ts
CHANGED
package/src/framer/iterator.ts
CHANGED
package/src/framer/payload.ts
CHANGED
package/src/framer/reader.ts
CHANGED
|
@@ -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.
|
|
@@ -389,7 +389,6 @@ describe("Streamer", () => {
|
|
|
389
389
|
dataType: DataType.FLOAT64,
|
|
390
390
|
virtual: true,
|
|
391
391
|
expression: `return ${channelA.name} + ${channelB.name}`,
|
|
392
|
-
requires: [channelA.key, channelB.key],
|
|
393
392
|
});
|
|
394
393
|
|
|
395
394
|
const streamer = await client.openStreamer(calcChannel.key);
|
package/src/framer/streamer.ts
CHANGED
|
@@ -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.
|
|
@@ -74,7 +74,7 @@ type ParsedStreamerConfig = z.output<typeof streamerConfigZ>;
|
|
|
74
74
|
* resources. We recommend using the streamer within a try-finally block to ensure
|
|
75
75
|
* that it is closed properly in the event of an error.
|
|
76
76
|
*
|
|
77
|
-
* For
|
|
77
|
+
* For detailed documentation, see https://docs.synnaxlabs.com/reference/client/working-with-data/streaming-data
|
|
78
78
|
*/
|
|
79
79
|
export interface Streamer extends AsyncIterator<Frame>, AsyncIterable<Frame> {
|
|
80
80
|
/** The keys of the channels currently being streamed from. */
|
|
@@ -111,7 +111,7 @@ export const createStreamOpener =
|
|
|
111
111
|
if (cfg.useHighPerformanceCodec)
|
|
112
112
|
client = client.withCodec(new WSStreamerCodec(adapter.codec));
|
|
113
113
|
const stream = await client.stream("/frame/stream", reqZ, resZ);
|
|
114
|
-
const streamer = new
|
|
114
|
+
const streamer = new BaseStreamer(
|
|
115
115
|
stream,
|
|
116
116
|
adapter,
|
|
117
117
|
cfg.downsampleFactor,
|
|
@@ -140,7 +140,7 @@ export const openStreamer = async (
|
|
|
140
140
|
config: StreamerConfig,
|
|
141
141
|
): Promise<Streamer> => await createStreamOpener(retriever, client)(config);
|
|
142
142
|
|
|
143
|
-
class
|
|
143
|
+
class BaseStreamer implements Streamer {
|
|
144
144
|
private readonly stream: StreamProxy<typeof reqZ, typeof resZ>;
|
|
145
145
|
private readonly adapter: ReadAdapter;
|
|
146
146
|
private readonly downsampleFactor: number;
|
package/src/framer/writer.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -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.
|
|
@@ -45,6 +45,7 @@ export { task } from "@/task";
|
|
|
45
45
|
export { createTestClientWithPolicy } from "@/testutil/access";
|
|
46
46
|
export { createTestClient, TEST_CLIENT_PARAMS } from "@/testutil/client";
|
|
47
47
|
export { user } from "@/user";
|
|
48
|
+
export { view } from "@/view";
|
|
48
49
|
export { workspace } from "@/workspace";
|
|
49
50
|
export { lineplot } from "@/workspace/lineplot";
|
|
50
51
|
export { log } from "@/workspace/log";
|
package/src/label/access.spec.ts
CHANGED
package/src/label/client.ts
CHANGED
package/src/label/external.ts
CHANGED
package/src/label/index.ts
CHANGED
package/src/label/label.spec.ts
CHANGED
package/src/label/payload.ts
CHANGED
package/src/ontology/client.ts
CHANGED
|
@@ -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.
|
|
@@ -37,15 +37,14 @@ const retrieveReqZ = z.object({
|
|
|
37
37
|
});
|
|
38
38
|
export interface RetrieveRequest extends z.infer<typeof retrieveReqZ> {}
|
|
39
39
|
|
|
40
|
-
export interface RetrieveOptions
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
> {}
|
|
40
|
+
export interface RetrieveOptions extends Pick<
|
|
41
|
+
RetrieveRequest,
|
|
42
|
+
"excludeFieldData" | "types" | "children" | "parents"
|
|
43
|
+
> {}
|
|
45
44
|
|
|
46
45
|
const retrieveResZ = z.object({ resources: resourceZ.array() });
|
|
47
46
|
|
|
48
|
-
/** The
|
|
47
|
+
/** The main client class for executing queries against a Synnax cluster ontology */
|
|
49
48
|
export class Client {
|
|
50
49
|
readonly type: string = "ontology";
|
|
51
50
|
groups: group.Client;
|
package/src/ontology/external.ts
CHANGED
package/src/ontology/index.ts
CHANGED
package/src/ontology/payload.ts
CHANGED
|
@@ -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.
|
|
@@ -43,6 +43,7 @@ export const resourceTypeZ = z.enum([
|
|
|
43
43
|
"arc",
|
|
44
44
|
"schematic_symbol",
|
|
45
45
|
"status",
|
|
46
|
+
"view",
|
|
46
47
|
]);
|
|
47
48
|
export type ResourceType = z.infer<typeof resourceTypeZ>;
|
|
48
49
|
|
|
@@ -103,8 +104,10 @@ export const resourceZ = z
|
|
|
103
104
|
data: record.unknownZ.optional().nullable(),
|
|
104
105
|
})
|
|
105
106
|
.transform((resource) => ({ key: idToString(resource.id), ...resource }));
|
|
106
|
-
export interface Resource<T extends record.Unknown = record.Unknown>
|
|
107
|
-
|
|
107
|
+
export interface Resource<T extends record.Unknown = record.Unknown> extends Omit<
|
|
108
|
+
z.infer<typeof resourceZ>,
|
|
109
|
+
"data"
|
|
110
|
+
> {
|
|
108
111
|
data?: T | null;
|
|
109
112
|
}
|
|
110
113
|
|
package/src/ontology/writer.ts
CHANGED
package/src/rack/access.spec.ts
CHANGED
package/src/rack/client.ts
CHANGED
package/src/rack/external.ts
CHANGED
package/src/rack/index.ts
CHANGED
package/src/rack/payload.ts
CHANGED
package/src/rack/rack.spec.ts
CHANGED
package/src/ranger/alias.ts
CHANGED
package/src/ranger/client.ts
CHANGED
package/src/ranger/external.ts
CHANGED
package/src/ranger/index.ts
CHANGED
package/src/ranger/kv.ts
CHANGED
package/src/ranger/payload.ts
CHANGED
package/src/ranger/writer.ts
CHANGED
package/src/status/client.ts
CHANGED
package/src/status/external.ts
CHANGED
package/src/status/index.ts
CHANGED
package/src/status/payload.ts
CHANGED
package/src/task/access.spec.ts
CHANGED
package/src/task/client.ts
CHANGED
|
@@ -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.
|
|
@@ -66,11 +66,15 @@ export interface TaskExecuteCommandSyncParams extends TaskExecuteCommandParams {
|
|
|
66
66
|
timeout?: CrudeTimeSpan;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
export interface ExecuteCommandsSyncParams<StatusData extends z.ZodType>
|
|
70
|
-
|
|
69
|
+
export interface ExecuteCommandsSyncParams<StatusData extends z.ZodType> extends Omit<
|
|
70
|
+
ExecuteCommandsSyncInternalParams<StatusData>,
|
|
71
|
+
"frameClient" | "name"
|
|
72
|
+
> {}
|
|
71
73
|
|
|
72
|
-
export interface ExecuteCommandSyncParams<StatusData extends z.ZodType>
|
|
73
|
-
|
|
74
|
+
export interface ExecuteCommandSyncParams<StatusData extends z.ZodType> extends Omit<
|
|
75
|
+
ExecuteCommandSyncInternalParams<StatusData>,
|
|
76
|
+
"frameClient" | "name"
|
|
77
|
+
> {}
|
|
74
78
|
|
|
75
79
|
export class Task<
|
|
76
80
|
Type extends z.ZodLiteral<string> = z.ZodLiteral<string>,
|
|
@@ -558,7 +562,8 @@ const executeCommands = async ({
|
|
|
558
562
|
};
|
|
559
563
|
|
|
560
564
|
interface ExecuteCommandSyncInternalParams<StatusData extends z.ZodType = z.ZodType>
|
|
561
|
-
extends
|
|
565
|
+
extends
|
|
566
|
+
Omit<ExecuteCommandsSyncInternalParams<StatusData>, "commands">,
|
|
562
567
|
TaskExecuteCommandSyncParams {
|
|
563
568
|
task: Key;
|
|
564
569
|
}
|
package/src/task/external.ts
CHANGED
package/src/task/index.ts
CHANGED