@synnaxlabs/client 0.25.0 → 0.26.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 +6 -6
- package/dist/access/access.spec.d.ts +2 -0
- package/dist/access/access.spec.d.ts.map +1 -0
- package/dist/access/client.d.ts +13 -0
- package/dist/access/client.d.ts.map +1 -0
- package/dist/access/external.d.ts +3 -0
- package/dist/access/external.d.ts.map +1 -0
- package/dist/access/index.d.ts +2 -0
- package/dist/access/index.d.ts.map +1 -0
- package/dist/access/payload.d.ts +105 -0
- package/dist/access/payload.d.ts.map +1 -0
- package/dist/auth/auth.d.ts.map +1 -1
- package/dist/channel/payload.d.ts +17 -14
- package/dist/channel/payload.d.ts.map +1 -1
- package/dist/channel/retriever.d.ts +7 -7
- package/dist/client.cjs +18 -18
- package/dist/client.d.ts +4 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2223 -2126
- package/dist/control/state.d.ts +1 -1
- package/dist/control/state.d.ts.map +1 -1
- package/dist/framer/adapter.d.ts +2 -0
- package/dist/framer/adapter.d.ts.map +1 -1
- package/dist/framer/client.d.ts.map +1 -1
- package/dist/framer/deleter.d.ts +1 -1
- package/dist/framer/deleter.d.ts.map +1 -1
- package/dist/framer/writer.d.ts +9 -6
- package/dist/framer/writer.d.ts.map +1 -1
- package/dist/hardware/device/client.d.ts +1 -66
- package/dist/hardware/device/client.d.ts.map +1 -1
- package/dist/hardware/device/external.d.ts +1 -0
- package/dist/hardware/device/external.d.ts.map +1 -1
- package/dist/hardware/device/index.d.ts +1 -1
- package/dist/hardware/device/index.d.ts.map +1 -1
- package/dist/hardware/device/payload.d.ts +73 -0
- package/dist/hardware/device/payload.d.ts.map +1 -0
- package/dist/hardware/rack/client.d.ts +2 -25
- package/dist/hardware/rack/client.d.ts.map +1 -1
- package/dist/hardware/rack/external.d.ts +1 -0
- package/dist/hardware/rack/external.d.ts.map +1 -1
- package/dist/hardware/rack/payload.d.ts +30 -0
- package/dist/hardware/rack/payload.d.ts.map +1 -0
- package/dist/hardware/task/client.d.ts +1 -145
- package/dist/hardware/task/client.d.ts.map +1 -1
- package/dist/hardware/task/external.d.ts +3 -0
- package/dist/hardware/task/external.d.ts.map +1 -0
- package/dist/hardware/task/index.d.ts +1 -1
- package/dist/hardware/task/index.d.ts.map +1 -1
- package/dist/hardware/task/payload.d.ts +151 -0
- package/dist/hardware/task/payload.d.ts.map +1 -0
- package/dist/label/payload.d.ts +1 -0
- package/dist/label/payload.d.ts.map +1 -1
- package/dist/ontology/client.d.ts +5 -5
- package/dist/ontology/payload.d.ts +40 -37
- package/dist/ontology/payload.d.ts.map +1 -1
- package/dist/ranger/payload.d.ts +5 -0
- package/dist/ranger/payload.d.ts.map +1 -1
- package/dist/setupspecs.d.ts.map +1 -1
- package/dist/signals/observable.d.ts +1 -1
- package/dist/signals/observable.d.ts.map +1 -1
- package/dist/user/client.d.ts +9 -0
- package/dist/user/client.d.ts.map +1 -0
- package/dist/user/external.d.ts +3 -0
- package/dist/user/external.d.ts.map +1 -0
- package/dist/user/index.d.ts +1 -1
- package/dist/user/index.d.ts.map +1 -1
- package/dist/user/payload.d.ts +5 -0
- package/dist/user/payload.d.ts.map +1 -1
- package/dist/workspace/lineplot/payload.d.ts +3 -0
- package/dist/workspace/lineplot/payload.d.ts.map +1 -1
- package/dist/workspace/payload.d.ts +3 -0
- package/dist/workspace/payload.d.ts.map +1 -1
- package/dist/workspace/schematic/payload.d.ts +3 -0
- package/dist/workspace/schematic/payload.d.ts.map +1 -1
- package/examples/node/basicReadWrite.js +28 -18
- package/examples/node/liveStream.js +7 -8
- package/examples/node/package-lock.json +2165 -2365
- package/examples/node/package.json +1 -1
- package/examples/node/seriesAndFrames.js +48 -47
- package/examples/node/streamWrite.js +34 -33
- package/package.json +5 -5
- package/src/access/access.spec.ts +276 -0
- package/src/access/client.ts +86 -0
- package/src/access/external.ts +11 -0
- package/src/access/index.ts +10 -0
- package/src/access/payload.ts +35 -0
- package/src/auth/auth.ts +1 -1
- package/src/channel/payload.ts +7 -0
- package/src/client.ts +7 -1
- package/src/control/state.ts +3 -3
- package/src/framer/adapter.spec.ts +9 -0
- package/src/framer/adapter.ts +12 -0
- package/src/framer/client.ts +3 -2
- package/src/framer/deleter.ts +2 -4
- package/src/framer/writer.spec.ts +99 -14
- package/src/framer/writer.ts +56 -23
- package/src/hardware/device/client.ts +8 -36
- package/src/hardware/device/external.ts +1 -0
- package/src/hardware/device/index.ts +1 -1
- package/src/hardware/device/payload.ts +44 -0
- package/src/hardware/rack/client.ts +10 -15
- package/src/hardware/rack/external.ts +1 -0
- package/src/hardware/rack/payload.ts +23 -0
- package/src/hardware/task/client.ts +1 -84
- package/src/hardware/task/external.ts +11 -0
- package/src/hardware/task/index.ts +1 -1
- package/src/hardware/task/payload.ts +92 -0
- package/src/label/payload.ts +3 -1
- package/src/ontology/payload.ts +6 -1
- package/src/ranger/payload.ts +11 -0
- package/src/setupspecs.ts +4 -2
- package/src/signals/observable.ts +5 -3
- package/src/transport.ts +3 -3
- package/src/user/client.ts +37 -0
- package/src/user/external.ts +11 -0
- package/src/user/index.ts +1 -1
- package/src/user/payload.ts +11 -0
- package/src/workspace/lineplot/payload.ts +7 -0
- package/src/workspace/payload.ts +7 -0
- package/src/workspace/schematic/payload.ts +7 -0
- package/tsconfig.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/workspace/lineplot/payload.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,aAAa,EAAkB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,IAAI,aAAoB,CAAC;AACtC,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AACvC,MAAM,MAAM,MAAM,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC;AAEjC,eAAO,MAAM,SAAS;;;;;;;;;;;;EAIpB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/workspace/lineplot/payload.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,aAAa,EAAkB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAO,MAAM,IAAI,aAAoB,CAAC;AACtC,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AACvC,MAAM,MAAM,MAAM,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC;AAEjC,eAAO,MAAM,SAAS;;;;;;;;;;;;EAIpB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAEjD,eAAO,MAAM,oBAAoB,EAAiB,QAAQ,CAAC,YAAY,CAAC;AAExE,eAAO,MAAM,UAAU,QAAS,GAAG,KAAG,QAAQ,CAAC,EACY,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UnknownRecord } from '@synnaxlabs/x/record';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { ontology } from '../ontology';
|
|
3
4
|
|
|
4
5
|
export declare const keyZ: z.ZodString;
|
|
5
6
|
export type Key = z.infer<typeof keyZ>;
|
|
@@ -33,4 +34,6 @@ export declare const workspaceRemoteZ: z.ZodObject<z.objectUtil.extendShape<Omit
|
|
|
33
34
|
layout: string;
|
|
34
35
|
}>;
|
|
35
36
|
export type Workspace = z.infer<typeof workspaceZ>;
|
|
37
|
+
export declare const WorkspaceOntologyType: ontology.ResourceType;
|
|
38
|
+
export declare const ontologyID: (key: Key) => ontology.ID;
|
|
36
39
|
//# sourceMappingURL=payload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/workspace/payload.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,aAAa,EAAkB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,IAAI,aAAoB,CAAC;AAEtC,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAEvC,MAAM,MAAM,MAAM,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC;AAUjC,eAAO,MAAM,UAAU;;;;;;;;;;;;EAIrB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;EAE3B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/workspace/payload.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,aAAa,EAAkB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAO,MAAM,IAAI,aAAoB,CAAC;AAEtC,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAEvC,MAAM,MAAM,MAAM,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC;AAUjC,eAAO,MAAM,UAAU;;;;;;;;;;;;EAIrB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;EAE3B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEnD,eAAO,MAAM,qBAAqB,EAAkB,QAAQ,CAAC,YAAY,CAAC;AAE1E,eAAO,MAAM,UAAU,QAAS,GAAG,KAAG,QAAQ,CAAC,EACa,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UnknownRecord } from '@synnaxlabs/x/record';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { ontology } from '../../ontology';
|
|
3
4
|
|
|
4
5
|
export declare const keyZ: z.ZodString;
|
|
5
6
|
export type Key = z.infer<typeof keyZ>;
|
|
@@ -37,4 +38,6 @@ export declare const schematicRemoteZ: z.ZodObject<{
|
|
|
37
38
|
snapshot: boolean;
|
|
38
39
|
}>;
|
|
39
40
|
export type Schematic = z.infer<typeof schematicZ>;
|
|
41
|
+
export declare const SchematicOntologyType: ontology.ResourceType;
|
|
42
|
+
export declare const ontologyID: (key: Key) => ontology.ID;
|
|
40
43
|
//# sourceMappingURL=payload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/workspace/schematic/payload.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,aAAa,EAAkB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,IAAI,aAAoB,CAAC;AACtC,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AACvC,MAAM,MAAM,MAAM,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC;AAEjC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;EAKrB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAK3B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../src/workspace/schematic/payload.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,aAAa,EAAkB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,eAAO,MAAM,IAAI,aAAoB,CAAC;AACtC,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AACvC,MAAM,MAAM,MAAM,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC;AAEjC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;EAKrB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;EAK3B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEnD,eAAO,MAAM,qBAAqB,EAAkB,QAAQ,CAAC,YAAY,CAAC;AAE1E,eAAO,MAAM,UAAU,QAAS,GAAG,KAAG,QAAQ,CAAC,EACa,CAAC"}
|
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
import { DataType, Synnax, TimeRange, TimeSpan, TimeStamp } from "@synnaxlabs/client";
|
|
11
11
|
|
|
12
|
-
// This example demonstrates the basics of reading and writing data from an index and
|
|
13
|
-
// channel in Synnax. We'll write a sine wave of data to a channel and then read it
|
|
12
|
+
// This example demonstrates the basics of reading and writing data from an index and
|
|
13
|
+
// data channel in Synnax. We'll write a sine wave of data to a channel and then read it
|
|
14
|
+
// back.
|
|
14
15
|
|
|
15
16
|
// Connect to a locally running, insecure Synnax cluster. If your connection parameters
|
|
16
17
|
// are different, enter them here.
|
|
@@ -19,25 +20,31 @@ const client = new Synnax({
|
|
|
19
20
|
port: 9090,
|
|
20
21
|
username: "synnax",
|
|
21
22
|
password: "seldon",
|
|
22
|
-
secure: false
|
|
23
|
+
secure: false,
|
|
23
24
|
});
|
|
24
25
|
|
|
25
26
|
// Create an index channel that will be used to store our timestamps.
|
|
26
|
-
const timeChannel = await client.channels.create(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const timeChannel = await client.channels.create(
|
|
28
|
+
{
|
|
29
|
+
name: "basic_read_write_time",
|
|
30
|
+
isIndex: true,
|
|
31
|
+
dataType: DataType.TIMESTAMP,
|
|
32
|
+
},
|
|
33
|
+
{ retrieveIfNameExists: true },
|
|
34
|
+
);
|
|
31
35
|
|
|
32
36
|
// Create a channel that will be used to store our data.
|
|
33
|
-
const dataChannel = await client.channels.create(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
const dataChannel = await client.channels.create(
|
|
38
|
+
{
|
|
39
|
+
name: "basic_read_write_data",
|
|
40
|
+
isIndex: false,
|
|
41
|
+
dataType: DataType.FLOAT32,
|
|
42
|
+
// We need to specify the index channel that we want to use to store the timestamps
|
|
43
|
+
// for this data channel.
|
|
44
|
+
index: timeChannel.key,
|
|
45
|
+
},
|
|
46
|
+
{ retrieveIfNameExists: true },
|
|
47
|
+
);
|
|
41
48
|
|
|
42
49
|
const N_SAMPLES = 5000;
|
|
43
50
|
|
|
@@ -46,7 +53,10 @@ const N_SAMPLES = 5000;
|
|
|
46
53
|
const start = TimeStamp.now();
|
|
47
54
|
|
|
48
55
|
// Generate a new timestamp every millisecond for N_SAMPLES.
|
|
49
|
-
const time = BigInt64Array.from({ length: N_SAMPLES }, (_, i) =>
|
|
56
|
+
const time = BigInt64Array.from({ length: N_SAMPLES }, (_, i) =>
|
|
57
|
+
start.add(TimeSpan.milliseconds(i)).valueOf(),
|
|
58
|
+
);
|
|
59
|
+
|
|
50
60
|
// Generate a sine wave for N_SAMPLES.
|
|
51
61
|
const data = Float32Array.from({ length: N_SAMPLES }, (_, i) => Math.sin(i / 100));
|
|
52
62
|
|
|
@@ -73,4 +83,4 @@ console.log({
|
|
|
73
83
|
});
|
|
74
84
|
|
|
75
85
|
// Make sure to close the client when you're done.
|
|
76
|
-
client.close();
|
|
86
|
+
client.close();
|
|
@@ -7,13 +7,13 @@
|
|
|
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 { Synnax
|
|
10
|
+
import { Synnax } from "@synnaxlabs/client";
|
|
11
11
|
|
|
12
12
|
// This example demonstrates how to stream live data from a channel in Synnax.
|
|
13
13
|
// Live-streaming is useful for real-time data processing and analysis, and is an
|
|
14
14
|
// integral part of Synnax's control sequence and data streaming capabilities.
|
|
15
15
|
|
|
16
|
-
// This example is meant to be used in conjunction with the stream_write.
|
|
16
|
+
// This example is meant to be used in conjunction with the stream_write.js example, and
|
|
17
17
|
// assumes that example is running in a separate terminal.
|
|
18
18
|
|
|
19
19
|
// Connect to a locally running, insecure Synnax cluster. If your connection parameters
|
|
@@ -23,21 +23,21 @@ const client = new Synnax({
|
|
|
23
23
|
port: 9090,
|
|
24
24
|
username: "synnax",
|
|
25
25
|
password: "seldon",
|
|
26
|
-
secure: false
|
|
26
|
+
secure: false,
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
// We can just specify the names of the channels we'd like to stream from.
|
|
30
30
|
const read_from = [
|
|
31
31
|
"stream_write_example_time",
|
|
32
32
|
"stream_write_example_data_1",
|
|
33
|
-
"stream_write_example_data_2"
|
|
34
|
-
]
|
|
33
|
+
"stream_write_example_data_2",
|
|
34
|
+
];
|
|
35
35
|
|
|
36
36
|
const streamer = await client.openStreamer(read_from);
|
|
37
37
|
|
|
38
38
|
// It's very important that we close the streamer when we're done with it to release
|
|
39
|
-
// network connections and other resources, so we wrap the streaming loop in a
|
|
40
|
-
// block.
|
|
39
|
+
// network connections and other resources, so we wrap the streaming loop in a
|
|
40
|
+
// try-finally block.
|
|
41
41
|
try {
|
|
42
42
|
// Loop through the frames in the streamer. Each iteration will block until a new
|
|
43
43
|
// frame is available, and then we'll just print out the last sample for each
|
|
@@ -48,4 +48,3 @@ try {
|
|
|
48
48
|
// Close the client when we're done with it.
|
|
49
49
|
client.close();
|
|
50
50
|
}
|
|
51
|
-
|