@viamrobotics/sdk 0.1.1-0 → 0.2.0-pre.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/dist/main.d.ts CHANGED
@@ -9,7 +9,7 @@ export declare const version: string;
9
9
  * @group Raw Protobufs
10
10
  */
11
11
  export { default as robotApi } from './gen/robot/v1/robot_pb';
12
- export { type Robot, type DialConf, type DialDirectConf, type DialWebRTCConf, RobotClient, createRobotClient, } from './robot';
12
+ export { type Robot, type DialConf, type DialDirectConf, type DialWebRTCConf, type RobotStatusStream, RobotClient, createRobotClient, } from './robot';
13
13
  /**
14
14
  * @deprecated Use {@link RobotClient} instead.
15
15
  * @group Clients
package/dist/main.es.js CHANGED
@@ -20228,7 +20228,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20228
20228
  return i.__generator(this, function(J) {
20229
20229
  switch (J.label) {
20230
20230
  case 0:
20231
- return M(w), [4, b(h, O, w)];
20231
+ return h = h.replace(/(\/)$/, ""), M(w), [4, b(h, O, w)];
20232
20232
  case 1:
20233
20233
  return k = J.sent(), S = k.toObject().additionalIceServersList.map(function(L) {
20234
20234
  return { urls: L.urlsList, credential: L.credential, username: L.username };
@@ -38427,6 +38427,18 @@ class EventDispatcher {
38427
38427
  }
38428
38428
  }
38429
38429
  const events = new EventDispatcher();
38430
+ class ViamResponseStream extends EventDispatcher {
38431
+ stream;
38432
+ constructor(e) {
38433
+ super(), this.stream = e;
38434
+ }
38435
+ on(e, s) {
38436
+ return super.on(e, s), this;
38437
+ }
38438
+ cancel() {
38439
+ this.listeners = {}, this.stream.cancel();
38440
+ }
38441
+ }
38430
38442
  class SessionTransport {
38431
38443
  opts;
38432
38444
  transport;
@@ -38890,9 +38902,20 @@ class RobotClient {
38890
38902
  const { robotService: s } = this, i = new robot_pb.GetStatusRequest();
38891
38903
  return i.setResourceNamesList(e), (await promisify(s.getStatus.bind(s), i)).getStatusList();
38892
38904
  }
38893
- async streamStatus(e, s) {
38905
+ streamStatus(e, s) {
38894
38906
  const { robotService: i } = this, u = new robot_pb.StreamStatusRequest();
38895
- return u.setResourceNamesList(e), u.setEvery(s), (await promisify(i.streamStatus.bind(i), u)).getStatusList();
38907
+ u.setResourceNamesList(e), u.setEvery(s);
38908
+ const g = i.streamStatus(u);
38909
+ if (!g)
38910
+ throw new Error("no stream");
38911
+ const p = new ViamResponseStream(g);
38912
+ return g.on("data", (o) => {
38913
+ p.emit("data", o.getStatusList());
38914
+ }), g.on("status", (o) => {
38915
+ p.emit("status", o);
38916
+ }), g.on("end", (o) => {
38917
+ p.emit("end", o);
38918
+ }), p;
38896
38919
  }
38897
38920
  }
38898
38921
  const isLocalConnection = (t) => t.includes(".local"), dialDirect = async (t) => {
@@ -41645,7 +41668,7 @@ class ServoClient {
41645
41668
  return doCommandFromClient(s, this.name, e, this.options);
41646
41669
  }
41647
41670
  }
41648
- const version = "0.1.1-0";
41671
+ const version = "0.2.0-pre.1";
41649
41672
  export {
41650
41673
  ArmClient,
41651
41674
  BaseClient,