@synnaxlabs/client 0.17.2 → 0.17.3

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @synnaxlabs/client@0.17.2 build /home/runner/work/synnax/synnax/client/ts
2
+ > @synnaxlabs/client@0.17.3 build /home/runner/work/synnax/synnax/client/ts
3
3
  > tsc --noEmit && vite build
4
4
 
5
5
  vite v5.1.2 building for production...
@@ -10,7 +10,7 @@ rendering chunks...
10
10
  [vite:dts] Start generate declaration files...
11
11
  computing gzip size...
12
12
  dist/client.js 531.80 kB │ gzip: 116.94 kB │ map: 1,195.62 kB
13
- [vite:dts] Declaration files built in 3744ms.
13
+ [vite:dts] Declaration files built in 3656ms.
14
14
  
15
15
  dist/client.cjs 350.76 kB │ gzip: 92.53 kB │ map: 1,140.70 kB
16
- ✓ built in 5.29s
16
+ ✓ built in 5.18s
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A client library for interacting with a Synnax cluster. It supports Typescript and can be used in both node and browser environments.
4
4
 
5
- Detailed documentation is available [here](https://docs.synnaxlabs.com/typescript-client/get-started]).
5
+ Detailed documentation is available [here](https://docs.synnaxlabs.com/typescript-client/get-started).
6
6
 
7
7
  ## Installation
8
8
 
@@ -0,0 +1,41 @@
1
+ import { Synnax, TimeStamp } from "@synnaxlabs/client";
2
+
3
+ // This example demonstrates how to stream live data from a channel in Synnax.
4
+ // Live-streaming is useful for real-time data processing and analysis, and is an
5
+ // integral part of Synnax's control sequence and data streaming capabilities.
6
+
7
+ // This example is meant to be used in conjunction with the stream_write.py example, and
8
+ // assumes that example is running in a separate terminal.
9
+
10
+ // Connect to a locally running, insecure Synnax cluster. If your connection parameters
11
+ // are different, enter them here.
12
+ const client = new Synnax({
13
+ host: "localhost",
14
+ port: 9090,
15
+ username: "synnax",
16
+ password: "seldon",
17
+ secure: false
18
+ });
19
+
20
+ // We can just specify the names of the channels we'd like to stream from.
21
+ const read_from = ["stream_write_example_time", "stream_write_example_data"]
22
+
23
+ const streamer = await client.telem.newStreamer(read_from);
24
+
25
+ // It's very important that we close the streamer when we're done with it to release
26
+ // network connections and other resources, so we wrap the streaming loop in a try-finally
27
+ // block.
28
+ try {
29
+ // Loop through the frames in the streamer. Each iteration will block until a new
30
+ // frame is available, and then we'll just print it out.
31
+ for await (const frame of streamer)
32
+ console.log({
33
+ time: new TimeStamp(frame.get("stream_write_example_time")[0].at(0)).toString(),
34
+ data: frame.get("stream_write_example_data")[0].at(0)
35
+ })
36
+ } finally {
37
+ streamer.close();
38
+ // Close the client when we're done with it.
39
+ client.close();
40
+ }
41
+
@@ -9,7 +9,7 @@
9
9
  "version": "1.0.0",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
- "@synnaxlabs/client": "^0.17.1"
12
+ "@synnaxlabs/client": "^0.17.2"
13
13
  }
14
14
  },
15
15
  "node_modules/@grpc/grpc-js": {
@@ -3653,9 +3653,9 @@
3653
3653
  }
3654
3654
  },
3655
3655
  "node_modules/@synnaxlabs/client": {
3656
- "version": "0.17.1",
3657
- "resolved": "https://registry.npmjs.org/@synnaxlabs/client/-/client-0.17.1.tgz",
3658
- "integrity": "sha512-8LONAhvloau3ErXMMieLeyDXqA8fPmW1tloE+VRVjUVwHI+K5lnortnN9uddWzZ+re1cgnVEoIpgw/y88hOdpw==",
3656
+ "version": "0.17.2",
3657
+ "resolved": "https://registry.npmjs.org/@synnaxlabs/client/-/client-0.17.2.tgz",
3658
+ "integrity": "sha512-9r8C7KbWBHluBRnu8qw34hf+u8JW1CkM6VmAT+51N+m0z2AZA0pbK01MNNIjLQAZ1bAdKpzc57BxqSzCwIceGQ==",
3659
3659
  "dependencies": {
3660
3660
  "@synnaxlabs/freighter": "0.9.1",
3661
3661
  "@synnaxlabs/x": "0.14.1",
@@ -11,6 +11,6 @@
11
11
  "author": "",
12
12
  "license": "ISC",
13
13
  "dependencies": {
14
- "@synnaxlabs/client": "^0.17.1"
14
+ "@synnaxlabs/client": "^0.17.2"
15
15
  }
16
16
  }
@@ -58,7 +58,6 @@ try {
58
58
  [timeChannel.key]: new Series({ data: new timeChannel.dataType.Array([timestamp]) }),
59
59
  [dataChannel.key]: new Series({ data: new dataChannel.dataType.Array([data]) })
60
60
  });
61
- console.log(fr.columns);
62
61
  await writer.write(fr);
63
62
 
64
63
  if (i % 60 == 0)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@synnaxlabs/client",
3
3
  "private": false,
4
- "version": "0.17.2",
4
+ "version": "0.17.3",
5
5
  "type": "module",
6
6
  "description": "The Client Library for Synnax",
7
7
  "repository": "https://github.com/synnaxlabs/synnax/tree/main/client/ts",