@synnaxlabs/client 0.16.3 → 0.16.4

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.
@@ -0,0 +1,37 @@
1
+ import { DataType, Synnax, TimeSpan, TimeStamp } from "@synnaxlabs/client";
2
+
3
+ const client = new Synnax({
4
+ host: "localhost",
5
+ port: 9090,
6
+ username: "synnax",
7
+ password: "seldon",
8
+ secure: false
9
+ });
10
+
11
+ const time_channel = await client.channels.create({
12
+ name: "basic_read_write_time",
13
+ isIndex: true,
14
+ dataType: DataType.TIMESTAMP
15
+ });
16
+
17
+ const data_channel = await client.channels.create({
18
+ name: "basic_read_write_data",
19
+ isIndex: false,
20
+ dataType: DataType.FLOAT32,
21
+ index: time_channel.key,
22
+ });
23
+
24
+ const N_SAMPLES = 500;
25
+
26
+ const start = TimeStamp.now();
27
+
28
+ const data = Float32Array.from({ length: N_SAMPLES }, (_, i) => Math.sin(i / 100));
29
+ const time = BigInt64Array.from({ length: N_SAMPLES }, (_, i) => start.add(TimeSpan.milliseconds(i)).bigInt);
30
+
31
+ await client.telem.write("basic_read_write_time", start, time);
32
+ // console.log("HERE")
33
+ // // await data_channel.write(start, data);
34
+
35
+ console.log("HERE")
36
+
37
+ client.close();