@viamrobotics/sdk 0.4.0-rc.0 → 0.5.0-rc.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/dist/main.es.js CHANGED
@@ -13835,11 +13835,11 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
13835
13835
  for (; ; ) {
13836
13836
  if (!u(this.buffer, this.position, 5))
13837
13837
  return b;
13838
- var C = c(this.buffer, this.position, this.position + 5), z = new DataView(C.buffer, C.byteOffset, C.byteLength), A = r(z);
13839
- if (!u(this.buffer, this.position, 5 + A))
13838
+ var C = c(this.buffer, this.position, this.position + 5), z = new DataView(C.buffer, C.byteOffset, C.byteLength), j = r(z);
13839
+ if (!u(this.buffer, this.position, 5 + j))
13840
13840
  return b;
13841
- var L = c(this.buffer, this.position + 5, this.position + 5 + A);
13842
- if (this.position += 5 + A, o(z))
13841
+ var L = c(this.buffer, this.position + 5, this.position + 5 + j);
13842
+ if (this.position += 5 + j, o(z))
13843
13843
  return b.push({ chunkType: l.TRAILERS, trailers: (y = L, new g.Metadata(t(y))) }), b;
13844
13844
  b.push({ chunkType: l.MESSAGE, data: L });
13845
13845
  }
@@ -20368,8 +20368,8 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20368
20368
  h ? (f = h.getCode(), y = h.getMessage(), b.set("grpc-status", "".concat(h.getCode())), y !== void 0 && b.set("grpc-message", h.getMessage())) : (f = 0, b.set("grpc-status", "0"), y = "");
20369
20369
  var R = function(T) {
20370
20370
  var C = "";
20371
- return T.forEach(function(z, A) {
20372
- C += "".concat(z, ": ").concat(A.join(", "), `\r
20371
+ return T.forEach(function(z, j) {
20372
+ C += "".concat(z, ": ").concat(j.join(", "), `\r
20373
20373
  `);
20374
20374
  }), r(C);
20375
20375
  }(b), w = new ArrayBuffer(R.length + 5);
@@ -20408,17 +20408,17 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20408
20408
  return s.__awaiter(this, void 0, void 0, function() {
20409
20409
  var T, C;
20410
20410
  return s.__generator(this, function(z) {
20411
- return h(w), T = function(A) {
20412
- return l.grpc.CrossBrowserHttpTransport({ withCredentials: !1 })(A);
20413
- }, !w?.accessToken || w?.externalAuthAddress && w?.externalAuthToEntity ? w && (w?.credentials || w?.accessToken) ? [2, f(R, T, w)] : [2, T] : ((C = new l.grpc.Metadata()).set("authorization", "Bearer ".concat(w.accessToken)), [2, function(A) {
20414
- return new y(A, T, C);
20411
+ return h(w), T = function(j) {
20412
+ return l.grpc.CrossBrowserHttpTransport({ withCredentials: !1 })(j);
20413
+ }, !w?.accessToken || w?.externalAuthAddress && w?.externalAuthToEntity ? w && (w?.credentials || w?.accessToken) ? [2, f(R, T, w)] : [2, T] : ((C = new l.grpc.Metadata()).set("authorization", "Bearer ".concat(w.accessToken)), [2, function(j) {
20414
+ return new y(j, T, C);
20415
20415
  }]);
20416
20416
  });
20417
20417
  });
20418
20418
  }
20419
20419
  function f(R, w, T) {
20420
20420
  return s.__awaiter(this, void 0, void 0, function() {
20421
- var C, z, A, L = this;
20421
+ var C, z, j, L = this;
20422
20422
  return s.__generator(this, function(x) {
20423
20423
  switch (x.label) {
20424
20424
  case 0:
@@ -20428,24 +20428,24 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20428
20428
  return s.__generator(this, function(P) {
20429
20429
  switch (P.label) {
20430
20430
  case 0:
20431
- return C != "" ? [3, 5] : (I = "", T.accessToken && T.accessToken !== "" ? [3, 2] : ((F = new r.AuthenticateRequest()).setEntity(T.authEntity ? T.authEntity : R.replace(/^(.*:\/\/)/, "")), (M = new r.Credentials()).setType((D = T.credentials) === null || D === void 0 ? void 0 : D.type), M.setPayload((O = T.credentials) === null || O === void 0 ? void 0 : O.payload), F.setCredentials(M), B = new Promise(function(W, j) {
20432
- U = W, k = j;
20431
+ return C != "" ? [3, 5] : (I = "", T.accessToken && T.accessToken !== "" ? [3, 2] : ((F = new r.AuthenticateRequest()).setEntity(T.authEntity ? T.authEntity : R.replace(/^(.*:\/\/)/, "")), (M = new r.Credentials()).setType((D = T.credentials) === null || D === void 0 ? void 0 : D.type), M.setPayload((O = T.credentials) === null || O === void 0 ? void 0 : O.payload), F.setCredentials(M), B = new Promise(function(W, A) {
20432
+ U = W, k = A;
20433
20433
  }), l.grpc.invoke(u.AuthService.Authenticate, { request: F, host: T.externalAuthAddress ? T.externalAuthAddress : R, transport: w, onMessage: function(W) {
20434
20434
  I = W.getAccessToken();
20435
- }, onEnd: function(W, j, _) {
20436
- W == l.grpc.Code.OK ? U(E) : k(j);
20435
+ }, onEnd: function(W, A, _) {
20436
+ W == l.grpc.Code.OK ? U(E) : k(A);
20437
20437
  } }), [4, B]));
20438
20438
  case 1:
20439
20439
  return P.sent(), [3, 3];
20440
20440
  case 2:
20441
20441
  I = T.accessToken, P.label = 3;
20442
20442
  case 3:
20443
- return C = I, T.externalAuthAddress && T.externalAuthToEntity ? ((S = new l.grpc.Metadata()).set("authorization", "Bearer ".concat(C)), B = new Promise(function(W, j) {
20444
- U = W, k = j;
20443
+ return C = I, T.externalAuthAddress && T.externalAuthToEntity ? ((S = new l.grpc.Metadata()).set("authorization", "Bearer ".concat(C)), B = new Promise(function(W, A) {
20444
+ U = W, k = A;
20445
20445
  }), I = "", (F = new r.AuthenticateToRequest()).setEntity(T.externalAuthToEntity), l.grpc.invoke(u.ExternalAuthService.AuthenticateTo, { request: F, host: T.externalAuthAddress, transport: w, metadata: S, onMessage: function(W) {
20446
20446
  I = W.getAccessToken();
20447
- }, onEnd: function(W, j, _) {
20448
- W == l.grpc.Code.OK ? U(S) : k(j);
20447
+ }, onEnd: function(W, A, _) {
20448
+ W == l.grpc.Code.OK ? U(S) : k(A);
20449
20449
  } }), [4, B]) : [3, 5];
20450
20450
  case 4:
20451
20451
  P.sent(), C = I, P.label = 5;
@@ -20456,8 +20456,8 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20456
20456
  });
20457
20457
  }, [4, z()];
20458
20458
  case 1:
20459
- return A = x.sent(), [2, function(I) {
20460
- return new y(I, w, A);
20459
+ return j = x.sent(), [2, function(I) {
20460
+ return new y(I, w, j);
20461
20461
  }];
20462
20462
  }
20463
20463
  });
@@ -20482,20 +20482,20 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20482
20482
  }();
20483
20483
  function b(R, w, T) {
20484
20484
  return s.__awaiter(this, void 0, void 0, function() {
20485
- var C, z, A, L, x, I;
20485
+ var C, z, j, L, x, I;
20486
20486
  return s.__generator(this, function(U) {
20487
20487
  switch (U.label) {
20488
20488
  case 0:
20489
20489
  return C = s.__assign({}, T), [4, v(R, C)];
20490
20490
  case 1:
20491
20491
  return z = U.sent(), I = new Promise(function(k, M) {
20492
- A = k, L = M;
20492
+ j = k, L = M;
20493
20493
  }), l.grpc.unary(d.SignalingService.OptionalWebRTCConfig, { request: new c.OptionalWebRTCConfigRequest(), metadata: { "rpc-host": w }, host: R, transport: z, onEnd: function(k) {
20494
20494
  var M = k.status, S = k.statusMessage, B = k.message;
20495
20495
  if (M === l.grpc.Code.OK && B) {
20496
20496
  if (!(x = B.getConfig()))
20497
- return void A(new c.WebRTCConfig());
20498
- A(x);
20497
+ return void j(new c.WebRTCConfig());
20498
+ j(x);
20499
20499
  } else
20500
20500
  L(S);
20501
20501
  } }), [4, I];
@@ -20533,9 +20533,9 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20533
20533
  }
20534
20534
  }
20535
20535
  e.dialWebRTC = function(R, w, T) {
20536
- var C, z, A, L, x, I, U;
20536
+ var C, z, j, L, x, I, U;
20537
20537
  return s.__awaiter(this, void 0, void 0, function() {
20538
- var k, M, S, B, F, E, D, O, P, W, j, _, G, V, Z, oe, re, le, ae, ie, pe, ne, ge, se, ce, ue, de = this;
20538
+ var k, M, S, B, F, E, D, O, P, W, A, _, G, V, Z, oe, re, le, ae, ie, pe, ne, ge, se, ce, ue, de = this;
20539
20539
  return s.__generator(this, function(J) {
20540
20540
  switch (J.label) {
20541
20541
  case 0:
@@ -20547,13 +20547,13 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20547
20547
  case 2:
20548
20548
  B = J.sent(), F = B.pc, E = B.dc, D = !1, J.label = 3;
20549
20549
  case 3:
20550
- return J.trys.push([3, , 10, 11]), O = T, T && (O = s.__assign({}, T), T.accessToken || (O.authEntity = (C = T?.webrtcOptions) === null || C === void 0 ? void 0 : C.signalingAuthEntity, O.authEntity || (O.externalAuthAddress ? O.authEntity = (z = T.externalAuthAddress) === null || z === void 0 ? void 0 : z.replace(/^(.*:\/\/)/, "") : O.authEntity = R.replace(/^(.*:\/\/)/, "")), O.credentials = (A = T?.webrtcOptions) === null || A === void 0 ? void 0 : A.signalingCredentials, O.accessToken = (L = T?.webrtcOptions) === null || L === void 0 ? void 0 : L.signalingAccessToken), O.externalAuthAddress = (x = T?.webrtcOptions) === null || x === void 0 ? void 0 : x.signalingExternalAuthAddress, O.externalAuthToEntity = (I = T?.webrtcOptions) === null || I === void 0 ? void 0 : I.signalingExternalAuthToEntity), [4, v(R, O)];
20550
+ return J.trys.push([3, , 10, 11]), O = T, T && (O = s.__assign({}, T), T.accessToken || (O.authEntity = (C = T?.webrtcOptions) === null || C === void 0 ? void 0 : C.signalingAuthEntity, O.authEntity || (O.externalAuthAddress ? O.authEntity = (z = T.externalAuthAddress) === null || z === void 0 ? void 0 : z.replace(/^(.*:\/\/)/, "") : O.authEntity = R.replace(/^(.*:\/\/)/, "")), O.credentials = (j = T?.webrtcOptions) === null || j === void 0 ? void 0 : j.signalingCredentials, O.accessToken = (L = T?.webrtcOptions) === null || L === void 0 ? void 0 : L.signalingAccessToken), O.externalAuthAddress = (x = T?.webrtcOptions) === null || x === void 0 ? void 0 : x.signalingExternalAuthAddress, O.externalAuthToEntity = (I = T?.webrtcOptions) === null || I === void 0 ? void 0 : I.signalingExternalAuthToEntity), [4, v(R, O)];
20551
20551
  case 4:
20552
- return P = J.sent(), W = l.grpc.client(d.SignalingService.Call, { host: R, transport: P }), j = "", _ = !1, G = function(q) {
20552
+ return P = J.sent(), W = l.grpc.client(d.SignalingService.Call, { host: R, transport: P }), A = "", _ = !1, G = function(q) {
20553
20553
  if (!_) {
20554
20554
  _ = !0;
20555
20555
  var N = new c.CallUpdateRequest();
20556
- N.setUuid(j);
20556
+ N.setUuid(A);
20557
20557
  var $ = new o.Status();
20558
20558
  $.setCode(t.Code.UNKNOWN), $.setMessage(q), N.setError($), l.grpc.unary(d.SignalingService.CallUpdate, { request: N, metadata: { "rpc-host": w }, host: R, transport: P, onEnd: function(K) {
20559
20559
  var H = K.status, Y = K.statusMessage, Q = K.message;
@@ -20564,7 +20564,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20564
20564
  if (!_) {
20565
20565
  _ = !0;
20566
20566
  var q = new c.CallUpdateRequest();
20567
- q.setUuid(j), q.setDone(!0), l.grpc.unary(d.SignalingService.CallUpdate, { request: q, metadata: { "rpc-host": w }, host: R, transport: P, onEnd: function(N) {
20567
+ q.setUuid(A), q.setDone(!0), l.grpc.unary(d.SignalingService.CallUpdate, { request: q, metadata: { "rpc-host": w }, host: R, transport: P, onEnd: function(N) {
20568
20568
  var $ = N.status, K = N.statusMessage, H = N.message;
20569
20569
  $ === l.grpc.Code.OK && H || console.error(K);
20570
20570
  } });
@@ -20581,7 +20581,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20581
20581
  case 0:
20582
20582
  return [4, oe];
20583
20583
  case 1:
20584
- return K.sent(), re ? [2] : q.candidate === null ? (ae = !0, V(), [2]) : (H = q.candidate, (Y = new c.ICECandidate()).setCandidate(H.candidate), H.sdpMid && Y.setSdpMid(H.sdpMid), H.sdpMLineIndex && Y.setSdpmLineIndex(H.sdpMLineIndex), H.usernameFragment && Y.setUsernameFragment(H.usernameFragment), N = Y, ($ = new c.CallUpdateRequest()).setUuid(j), $.setCandidate(N), l.grpc.unary(d.SignalingService.CallUpdate, { request: $, metadata: { "rpc-host": w }, host: R, transport: P, onEnd: function(Q) {
20584
+ return K.sent(), re ? [2] : q.candidate === null ? (ae = !0, V(), [2]) : (H = q.candidate, (Y = new c.ICECandidate()).setCandidate(H.candidate), H.sdpMid && Y.setSdpMid(H.sdpMid), H.sdpMLineIndex && Y.setSdpmLineIndex(H.sdpMLineIndex), H.usernameFragment && Y.setUsernameFragment(H.usernameFragment), N = Y, ($ = new c.CallUpdateRequest()).setUuid(A), $.setCandidate(N), l.grpc.unary(d.SignalingService.CallUpdate, { request: $, metadata: { "rpc-host": w }, host: R, transport: P, onEnd: function(Q) {
20585
20585
  var ee = Q.status, X = Q.statusMessage, te = Q.message;
20586
20586
  ee === l.grpc.Code.OK && te || re || ae || console.error("error sending candidate", X);
20587
20587
  } }), [2]);
@@ -20599,7 +20599,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20599
20599
  return s.__generator(this, function(ee) {
20600
20600
  switch (ee.label) {
20601
20601
  case 0:
20602
- return (N = q).hasInit() ? ie ? (G("got init stage more than once"), [2]) : ($ = N.getInit(), ie = !0, j = N.getUuid(), K = new RTCSessionDescription(JSON.parse(atob($.getSdp()))), [4, F.setRemoteDescription(K)]) : [3, 2];
20602
+ return (N = q).hasInit() ? ie ? (G("got init stage more than once"), [2]) : ($ = N.getInit(), ie = !0, A = N.getUuid(), K = new RTCSessionDescription(JSON.parse(atob($.getSdp()))), [4, F.setRemoteDescription(K)]) : [3, 2];
20603
20603
  case 1:
20604
20604
  return ee.sent(), Z(!0), S?.disableTrickleICE ? (re = !0, V(), [2]) : [3, 8];
20605
20605
  case 2:
@@ -20607,8 +20607,8 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20607
20607
  return [3, 7];
20608
20608
  if (!ie)
20609
20609
  return G("got update stage before init stage"), [2];
20610
- if (N.getUuid() !== j)
20611
- return G("uuid mismatch; have=".concat(N.getUuid(), " want=").concat(j)), [2];
20610
+ if (N.getUuid() !== A)
20611
+ return G("uuid mismatch; have=".concat(N.getUuid(), " want=").concat(A)), [2];
20612
20612
  H = N.getUpdate(), X = H.getCandidate(), te = { candidate: X.getCandidate() }, X.hasSdpMid() && (te.sdpMid = X.getSdpMid()), X.hasSdpmLineIndex() && (te.sdpMLineIndex = X.getSdpmLineIndex()), X.hasUsernameFragment() && (te.usernameFragment = X.getUsernameFragment()), Y = te, ee.label = 3;
20613
20613
  case 3:
20614
20614
  return ee.trys.push([3, 5, , 6]), [4, F.addIceCandidate(Y)];
@@ -20798,23 +20798,23 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20798
20798
  }
20799
20799
  function u(M, S, B, F) {
20800
20800
  return new (B || (B = Promise))(function(E, D) {
20801
- function O(j) {
20801
+ function O(A) {
20802
20802
  try {
20803
- W(F.next(j));
20803
+ W(F.next(A));
20804
20804
  } catch (_) {
20805
20805
  D(_);
20806
20806
  }
20807
20807
  }
20808
- function P(j) {
20808
+ function P(A) {
20809
20809
  try {
20810
- W(F.throw(j));
20810
+ W(F.throw(A));
20811
20811
  } catch (_) {
20812
20812
  D(_);
20813
20813
  }
20814
20814
  }
20815
- function W(j) {
20815
+ function W(A) {
20816
20816
  var _;
20817
- j.done ? E(j.value) : (_ = j.value, _ instanceof B ? _ : new B(function(G) {
20817
+ A.done ? E(A.value) : (_ = A.value, _ instanceof B ? _ : new B(function(G) {
20818
20818
  G(_);
20819
20819
  })).then(O, P);
20820
20820
  }
@@ -20831,7 +20831,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20831
20831
  return this;
20832
20832
  }), D;
20833
20833
  function P(W) {
20834
- return function(j) {
20834
+ return function(A) {
20835
20835
  return function(_) {
20836
20836
  if (B)
20837
20837
  throw new TypeError("Generator is already executing.");
@@ -20881,7 +20881,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20881
20881
  if (5 & _[0])
20882
20882
  throw _[1];
20883
20883
  return { value: _[0] ? _[1] : void 0, done: !0 };
20884
- }([W, j]);
20884
+ }([W, A]);
20885
20885
  };
20886
20886
  }
20887
20887
  }
@@ -20967,7 +20967,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20967
20967
  }
20968
20968
  function P(G, V) {
20969
20969
  try {
20970
- (Z = E[G](V)).value instanceof R ? Promise.resolve(Z.value.v).then(W, j) : _(D[0][2], Z);
20970
+ (Z = E[G](V)).value instanceof R ? Promise.resolve(Z.value.v).then(W, A) : _(D[0][2], Z);
20971
20971
  } catch (oe) {
20972
20972
  _(D[0][3], oe);
20973
20973
  }
@@ -20976,7 +20976,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
20976
20976
  function W(G) {
20977
20977
  P("next", G);
20978
20978
  }
20979
- function j(G) {
20979
+ function A(G) {
20980
20980
  P("throw", G);
20981
20981
  }
20982
20982
  function _(G, V) {
@@ -21006,10 +21006,10 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
21006
21006
  function F(E) {
21007
21007
  S[E] = M[E] && function(D) {
21008
21008
  return new Promise(function(O, P) {
21009
- (function(W, j, _, G) {
21009
+ (function(W, A, _, G) {
21010
21010
  Promise.resolve(G).then(function(V) {
21011
21011
  W({ value: V, done: _ });
21012
- }, j);
21012
+ }, A);
21013
21013
  })(O, P, (D = M[E](D)).done, D.value);
21014
21014
  });
21015
21015
  };
@@ -21018,7 +21018,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
21018
21018
  function z(M, S) {
21019
21019
  return Object.defineProperty ? Object.defineProperty(M, "raw", { value: S }) : M.raw = S, M;
21020
21020
  }
21021
- var A = Object.create ? function(M, S) {
21021
+ var j = Object.create ? function(M, S) {
21022
21022
  Object.defineProperty(M, "default", { enumerable: !0, value: S });
21023
21023
  } : function(M, S) {
21024
21024
  M.default = S;
@@ -21030,7 +21030,7 @@ var backOff_1 = backoff.backOff = backOff, BackOff = (
21030
21030
  if (M != null)
21031
21031
  for (var B in M)
21032
21032
  B !== "default" && Object.prototype.hasOwnProperty.call(M, B) && d(S, M, B);
21033
- return A(S, M), S;
21033
+ return j(S, M), S;
21034
21034
  }
21035
21035
  function x(M) {
21036
21036
  return M && M.__esModule ? M : { default: M };
@@ -23254,8 +23254,8 @@ var grpcWebClient_umdExports$1 = {}, grpcWebClient_umd$1 = {
23254
23254
  else {
23255
23255
  var T = this.buffer.byteLength - this.position, C = new Uint8Array(T + b.byteLength), z = v(this.buffer, this.position);
23256
23256
  C.set(z, 0);
23257
- var A = new Uint8Array(b);
23258
- C.set(A, T), this.buffer = C, this.position = 0;
23257
+ var j = new Uint8Array(b);
23258
+ C.set(j, T), this.buffer = C, this.position = 0;
23259
23259
  }
23260
23260
  for (; ; ) {
23261
23261
  if (!m(this.buffer, this.position, 5))
@@ -26036,7 +26036,7 @@ var BaseServiceClient_1 = BaseServiceClient, board_pb = {};
26036
26036
  var p = duration_pb;
26037
26037
  n.object.extend(proto, p);
26038
26038
  var t = struct_pb;
26039
- n.object.extend(proto, t), n.exportSymbol("proto.viam.component.board.v1.GetDigitalInterruptValueRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.GetDigitalInterruptValueResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.GetGPIORequest", null, s), n.exportSymbol("proto.viam.component.board.v1.GetGPIOResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.PWMFrequencyRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.PWMFrequencyResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.PWMRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.PWMResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.PowerMode", null, s), n.exportSymbol("proto.viam.component.board.v1.ReadAnalogReaderRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.ReadAnalogReaderResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.SetGPIORequest", null, s), n.exportSymbol("proto.viam.component.board.v1.SetGPIOResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.SetPWMFrequencyRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.SetPWMFrequencyResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.SetPWMRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.SetPWMResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.SetPowerModeRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.SetPowerModeResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.StatusRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.StatusResponse", null, s), proto.viam.component.board.v1.StatusRequest = function(o) {
26039
+ n.object.extend(proto, t), n.exportSymbol("proto.viam.component.board.v1.GetDigitalInterruptValueRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.GetDigitalInterruptValueResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.GetGPIORequest", null, s), n.exportSymbol("proto.viam.component.board.v1.GetGPIOResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.PWMFrequencyRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.PWMFrequencyResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.PWMRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.PWMResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.PowerMode", null, s), n.exportSymbol("proto.viam.component.board.v1.ReadAnalogReaderRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.ReadAnalogReaderResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.SetGPIORequest", null, s), n.exportSymbol("proto.viam.component.board.v1.SetGPIOResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.SetPWMFrequencyRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.SetPWMFrequencyResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.SetPWMRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.SetPWMResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.SetPowerModeRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.SetPowerModeResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.StatusRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.StatusResponse", null, s), n.exportSymbol("proto.viam.component.board.v1.WriteAnalogRequest", null, s), n.exportSymbol("proto.viam.component.board.v1.WriteAnalogResponse", null, s), proto.viam.component.board.v1.StatusRequest = function(o) {
26040
26040
  e.Message.initialize(this, o, 0, -1, null, null);
26041
26041
  }, n.inherits(proto.viam.component.board.v1.StatusRequest, e.Message), n.DEBUG && !COMPILED && (proto.viam.component.board.v1.StatusRequest.displayName = "proto.viam.component.board.v1.StatusRequest"), proto.viam.component.board.v1.StatusResponse = function(o) {
26042
26042
  e.Message.initialize(this, o, 0, -1, null, null);
@@ -26068,7 +26068,11 @@ var BaseServiceClient_1 = BaseServiceClient, board_pb = {};
26068
26068
  e.Message.initialize(this, o, 0, -1, null, null);
26069
26069
  }, n.inherits(proto.viam.component.board.v1.ReadAnalogReaderRequest, e.Message), n.DEBUG && !COMPILED && (proto.viam.component.board.v1.ReadAnalogReaderRequest.displayName = "proto.viam.component.board.v1.ReadAnalogReaderRequest"), proto.viam.component.board.v1.ReadAnalogReaderResponse = function(o) {
26070
26070
  e.Message.initialize(this, o, 0, -1, null, null);
26071
- }, n.inherits(proto.viam.component.board.v1.ReadAnalogReaderResponse, e.Message), n.DEBUG && !COMPILED && (proto.viam.component.board.v1.ReadAnalogReaderResponse.displayName = "proto.viam.component.board.v1.ReadAnalogReaderResponse"), proto.viam.component.board.v1.GetDigitalInterruptValueRequest = function(o) {
26071
+ }, n.inherits(proto.viam.component.board.v1.ReadAnalogReaderResponse, e.Message), n.DEBUG && !COMPILED && (proto.viam.component.board.v1.ReadAnalogReaderResponse.displayName = "proto.viam.component.board.v1.ReadAnalogReaderResponse"), proto.viam.component.board.v1.WriteAnalogRequest = function(o) {
26072
+ e.Message.initialize(this, o, 0, -1, null, null);
26073
+ }, n.inherits(proto.viam.component.board.v1.WriteAnalogRequest, e.Message), n.DEBUG && !COMPILED && (proto.viam.component.board.v1.WriteAnalogRequest.displayName = "proto.viam.component.board.v1.WriteAnalogRequest"), proto.viam.component.board.v1.WriteAnalogResponse = function(o) {
26074
+ e.Message.initialize(this, o, 0, -1, null, null);
26075
+ }, n.inherits(proto.viam.component.board.v1.WriteAnalogResponse, e.Message), n.DEBUG && !COMPILED && (proto.viam.component.board.v1.WriteAnalogResponse.displayName = "proto.viam.component.board.v1.WriteAnalogResponse"), proto.viam.component.board.v1.GetDigitalInterruptValueRequest = function(o) {
26072
26076
  e.Message.initialize(this, o, 0, -1, null, null);
26073
26077
  }, n.inherits(proto.viam.component.board.v1.GetDigitalInterruptValueRequest, e.Message), n.DEBUG && !COMPILED && (proto.viam.component.board.v1.GetDigitalInterruptValueRequest.displayName = "proto.viam.component.board.v1.GetDigitalInterruptValueRequest"), proto.viam.component.board.v1.GetDigitalInterruptValueResponse = function(o) {
26074
26078
  e.Message.initialize(this, o, 0, -1, null, null);
@@ -27043,6 +27047,127 @@ var BaseServiceClient_1 = BaseServiceClient, board_pb = {};
27043
27047
  );
27044
27048
  }, proto.viam.component.board.v1.ReadAnalogReaderResponse.prototype.setValue = function(o) {
27045
27049
  return e.Message.setProto3IntField(this, 1, o);
27050
+ }, e.Message.GENERATE_TO_OBJECT && (proto.viam.component.board.v1.WriteAnalogRequest.prototype.toObject = function(o) {
27051
+ return proto.viam.component.board.v1.WriteAnalogRequest.toObject(o, this);
27052
+ }, proto.viam.component.board.v1.WriteAnalogRequest.toObject = function(o, r) {
27053
+ var u, c = {
27054
+ name: e.Message.getFieldWithDefault(r, 1, ""),
27055
+ pin: e.Message.getFieldWithDefault(r, 2, ""),
27056
+ value: e.Message.getFieldWithDefault(r, 3, 0),
27057
+ extra: (u = r.getExtra()) && t.Struct.toObject(o, u)
27058
+ };
27059
+ return o && (c.$jspbMessageInstance = r), c;
27060
+ }), proto.viam.component.board.v1.WriteAnalogRequest.deserializeBinary = function(o) {
27061
+ var r = new e.BinaryReader(o), u = new proto.viam.component.board.v1.WriteAnalogRequest();
27062
+ return proto.viam.component.board.v1.WriteAnalogRequest.deserializeBinaryFromReader(u, r);
27063
+ }, proto.viam.component.board.v1.WriteAnalogRequest.deserializeBinaryFromReader = function(o, r) {
27064
+ for (; r.nextField() && !r.isEndGroup(); ) {
27065
+ var u = r.getFieldNumber();
27066
+ switch (u) {
27067
+ case 1:
27068
+ var c = (
27069
+ /** @type {string} */
27070
+ r.readString()
27071
+ );
27072
+ o.setName(c);
27073
+ break;
27074
+ case 2:
27075
+ var c = (
27076
+ /** @type {string} */
27077
+ r.readString()
27078
+ );
27079
+ o.setPin(c);
27080
+ break;
27081
+ case 3:
27082
+ var c = (
27083
+ /** @type {number} */
27084
+ r.readInt32()
27085
+ );
27086
+ o.setValue(c);
27087
+ break;
27088
+ case 99:
27089
+ var c = new t.Struct();
27090
+ r.readMessage(c, t.Struct.deserializeBinaryFromReader), o.setExtra(c);
27091
+ break;
27092
+ default:
27093
+ r.skipField();
27094
+ break;
27095
+ }
27096
+ }
27097
+ return o;
27098
+ }, proto.viam.component.board.v1.WriteAnalogRequest.prototype.serializeBinary = function() {
27099
+ var o = new e.BinaryWriter();
27100
+ return proto.viam.component.board.v1.WriteAnalogRequest.serializeBinaryToWriter(this, o), o.getResultBuffer();
27101
+ }, proto.viam.component.board.v1.WriteAnalogRequest.serializeBinaryToWriter = function(o, r) {
27102
+ var u = void 0;
27103
+ u = o.getName(), u.length > 0 && r.writeString(
27104
+ 1,
27105
+ u
27106
+ ), u = o.getPin(), u.length > 0 && r.writeString(
27107
+ 2,
27108
+ u
27109
+ ), u = o.getValue(), u !== 0 && r.writeInt32(
27110
+ 3,
27111
+ u
27112
+ ), u = o.getExtra(), u != null && r.writeMessage(
27113
+ 99,
27114
+ u,
27115
+ t.Struct.serializeBinaryToWriter
27116
+ );
27117
+ }, proto.viam.component.board.v1.WriteAnalogRequest.prototype.getName = function() {
27118
+ return (
27119
+ /** @type {string} */
27120
+ e.Message.getFieldWithDefault(this, 1, "")
27121
+ );
27122
+ }, proto.viam.component.board.v1.WriteAnalogRequest.prototype.setName = function(o) {
27123
+ return e.Message.setProto3StringField(this, 1, o);
27124
+ }, proto.viam.component.board.v1.WriteAnalogRequest.prototype.getPin = function() {
27125
+ return (
27126
+ /** @type {string} */
27127
+ e.Message.getFieldWithDefault(this, 2, "")
27128
+ );
27129
+ }, proto.viam.component.board.v1.WriteAnalogRequest.prototype.setPin = function(o) {
27130
+ return e.Message.setProto3StringField(this, 2, o);
27131
+ }, proto.viam.component.board.v1.WriteAnalogRequest.prototype.getValue = function() {
27132
+ return (
27133
+ /** @type {number} */
27134
+ e.Message.getFieldWithDefault(this, 3, 0)
27135
+ );
27136
+ }, proto.viam.component.board.v1.WriteAnalogRequest.prototype.setValue = function(o) {
27137
+ return e.Message.setProto3IntField(this, 3, o);
27138
+ }, proto.viam.component.board.v1.WriteAnalogRequest.prototype.getExtra = function() {
27139
+ return (
27140
+ /** @type{?proto.google.protobuf.Struct} */
27141
+ e.Message.getWrapperField(this, t.Struct, 99)
27142
+ );
27143
+ }, proto.viam.component.board.v1.WriteAnalogRequest.prototype.setExtra = function(o) {
27144
+ return e.Message.setWrapperField(this, 99, o);
27145
+ }, proto.viam.component.board.v1.WriteAnalogRequest.prototype.clearExtra = function() {
27146
+ return this.setExtra(void 0);
27147
+ }, proto.viam.component.board.v1.WriteAnalogRequest.prototype.hasExtra = function() {
27148
+ return e.Message.getField(this, 99) != null;
27149
+ }, e.Message.GENERATE_TO_OBJECT && (proto.viam.component.board.v1.WriteAnalogResponse.prototype.toObject = function(o) {
27150
+ return proto.viam.component.board.v1.WriteAnalogResponse.toObject(o, this);
27151
+ }, proto.viam.component.board.v1.WriteAnalogResponse.toObject = function(o, r) {
27152
+ var u = {};
27153
+ return o && (u.$jspbMessageInstance = r), u;
27154
+ }), proto.viam.component.board.v1.WriteAnalogResponse.deserializeBinary = function(o) {
27155
+ var r = new e.BinaryReader(o), u = new proto.viam.component.board.v1.WriteAnalogResponse();
27156
+ return proto.viam.component.board.v1.WriteAnalogResponse.deserializeBinaryFromReader(u, r);
27157
+ }, proto.viam.component.board.v1.WriteAnalogResponse.deserializeBinaryFromReader = function(o, r) {
27158
+ for (; r.nextField() && !r.isEndGroup(); ) {
27159
+ var u = r.getFieldNumber();
27160
+ switch (u) {
27161
+ default:
27162
+ r.skipField();
27163
+ break;
27164
+ }
27165
+ }
27166
+ return o;
27167
+ }, proto.viam.component.board.v1.WriteAnalogResponse.prototype.serializeBinary = function() {
27168
+ var o = new e.BinaryWriter();
27169
+ return proto.viam.component.board.v1.WriteAnalogResponse.serializeBinaryToWriter(this, o), o.getResultBuffer();
27170
+ }, proto.viam.component.board.v1.WriteAnalogResponse.serializeBinaryToWriter = function(o, r) {
27046
27171
  }, e.Message.GENERATE_TO_OBJECT && (proto.viam.component.board.v1.GetDigitalInterruptValueRequest.prototype.toObject = function(o) {
27047
27172
  return proto.viam.component.board.v1.GetDigitalInterruptValueRequest.toObject(o, this);
27048
27173
  }, proto.viam.component.board.v1.GetDigitalInterruptValueRequest.toObject = function(o, r) {
@@ -27373,6 +27498,14 @@ BoardService.ReadAnalogReader = {
27373
27498
  requestType: component_board_v1_board_pb.ReadAnalogReaderRequest,
27374
27499
  responseType: component_board_v1_board_pb.ReadAnalogReaderResponse
27375
27500
  };
27501
+ BoardService.WriteAnalog = {
27502
+ methodName: "WriteAnalog",
27503
+ service: BoardService,
27504
+ requestStream: !1,
27505
+ responseStream: !1,
27506
+ requestType: component_board_v1_board_pb.WriteAnalogRequest,
27507
+ responseType: component_board_v1_board_pb.WriteAnalogResponse
27508
+ };
27376
27509
  BoardService.GetDigitalInterruptValue = {
27377
27510
  methodName: "GetDigitalInterruptValue",
27378
27511
  service: BoardService,
@@ -27607,6 +27740,29 @@ BoardServiceClient.prototype.readAnalogReader = function i(e, n, s) {
27607
27740
  }
27608
27741
  };
27609
27742
  };
27743
+ BoardServiceClient.prototype.writeAnalog = function i(e, n, s) {
27744
+ arguments.length === 2 && (s = arguments[1]);
27745
+ var l = grpc$n.unary(BoardService.WriteAnalog, {
27746
+ request: e,
27747
+ host: this.serviceHost,
27748
+ metadata: n,
27749
+ transport: this.options.transport,
27750
+ debug: this.options.debug,
27751
+ onEnd: function(g) {
27752
+ if (s)
27753
+ if (g.status !== grpc$n.Code.OK) {
27754
+ var p = new Error(g.statusMessage);
27755
+ p.code = g.status, p.metadata = g.trailers, s(p, null);
27756
+ } else
27757
+ s(null, g.message);
27758
+ }
27759
+ });
27760
+ return {
27761
+ cancel: function() {
27762
+ s = null, l.close();
27763
+ }
27764
+ };
27765
+ };
27610
27766
  BoardServiceClient.prototype.getDigitalInterruptValue = function i(e, n, s) {
27611
27767
  arguments.length === 2 && (s = arguments[1]);
27612
27768
  var l = grpc$n.unary(BoardService.GetDigitalInterruptValue, {
@@ -41171,9 +41327,9 @@ class GRPCConnectionManager {
41171
41327
  this.client.getOperations(
41172
41328
  s,
41173
41329
  new grpcWebClient_umdExports$1.grpc.Metadata(),
41174
- (l, g) => {
41330
+ (l) => {
41175
41331
  if (l) {
41176
- console.debug(l, g), events.emit(DISCONNECTED, {});
41332
+ events.emit(DISCONNECTED, {});
41177
41333
  return;
41178
41334
  }
41179
41335
  e ? e.postMessage(this.heartbeatIntervalMs) : setTimeout(() => n(), this.heartbeatIntervalMs);
@@ -42177,7 +42333,7 @@ var grpcWebClient_umdExports = {}, grpcWebClient_umd = {
42177
42333
  for (; ; ) {
42178
42334
  if (!d(this.buffer, this.position, 5))
42179
42335
  return R;
42180
- var A = m(this.buffer, this.position, this.position + 5), L = new DataView(A.buffer, A.byteOffset, A.byteLength), x = c(L);
42336
+ var j = m(this.buffer, this.position, this.position + 5), L = new DataView(j.buffer, j.byteOffset, j.byteLength), x = c(L);
42181
42337
  if (!d(this.buffer, this.position, 5 + x))
42182
42338
  return R;
42183
42339
  var I = m(this.buffer, this.position + 5, this.position + 5 + x);
@@ -46171,6 +46327,13 @@ const isPosInt = (i) => !!(i > 0 && Number.isInteger(i)), isLocalConnection = (i
46171
46327
  return typeof e.signalingAddress != "string" ? !1 : !e.iceServers || Array.isArray(e.iceServers);
46172
46328
  }, createRobotClient = async (i) => {
46173
46329
  let e;
46330
+ if (i.authEntity)
46331
+ try {
46332
+ i.authEntity = new URL(i.authEntity).host;
46333
+ } catch (n) {
46334
+ if (!(n instanceof TypeError))
46335
+ throw n;
46336
+ }
46174
46337
  if (i.reconnectMaxAttempts && !isPosInt(i.reconnectMaxAttempts))
46175
46338
  throw new Error(
46176
46339
  `Value of max reconnect attempts (${i.reconnectMaxAttempts}) should be a positive integer`
@@ -50556,6 +50719,7 @@ class BaseClient {
50556
50719
  return s.setName(this.name), s.setExtra(struct_pb.Struct.fromJavaScript(e)), this.options.requestLogger?.(s), (await promisify(n.getProperties.bind(n), s)).toObject();
50557
50720
  }
50558
50721
  }
50722
+ const { PowerMode } = board_pb;
50559
50723
  class BoardClient {
50560
50724
  client;
50561
50725
  name;
@@ -50636,10 +50800,28 @@ class BoardClient {
50636
50800
  const { boardService: s } = this, l = new board_pb.ReadAnalogReaderRequest();
50637
50801
  return l.setBoardName(this.name), l.setAnalogReaderName(e), l.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(l), (await promisify(s.readAnalogReader.bind(s), l)).getValue();
50638
50802
  }
50803
+ async writeAnalog(e, n, s = {}) {
50804
+ const { boardService: l } = this, g = new board_pb.WriteAnalogRequest();
50805
+ g.setName(this.name), g.setPin(e), g.setValue(n), g.setExtra(struct_pb.Struct.fromJavaScript(s)), this.options.requestLogger?.(g), await promisify(
50806
+ l.writeAnalog.bind(l),
50807
+ g
50808
+ );
50809
+ }
50639
50810
  async getDigitalInterruptValue(e, n = {}) {
50640
50811
  const { boardService: s } = this, l = new board_pb.GetDigitalInterruptValueRequest();
50641
50812
  return l.setBoardName(this.name), l.setDigitalInterruptName(e), l.setExtra(struct_pb.Struct.fromJavaScript(n)), this.options.requestLogger?.(l), (await promisify(s.getDigitalInterruptValue.bind(s), l)).getValue();
50642
50813
  }
50814
+ async setPowerMode(e, n, s, l = {}) {
50815
+ const { boardService: g } = this, p = new board_pb.SetPowerModeRequest();
50816
+ if (p.setName(e), p.setPowerMode(n), s) {
50817
+ const t = new duration_pb.Duration();
50818
+ t.setNanos(s.nanos), t.setSeconds(s.seconds), p.setDuration(t);
50819
+ }
50820
+ p.setExtra(struct_pb.Struct.fromJavaScript(l)), this.options.requestLogger?.(p), await promisify(
50821
+ g.setPowerMode.bind(g),
50822
+ p
50823
+ );
50824
+ }
50643
50825
  async doCommand(e) {
50644
50826
  const { boardService: n } = this;
50645
50827
  return doCommandFromClient(n, this.name, e, this.options);
@@ -54241,7 +54423,7 @@ const concatArrayU8 = (i) => {
54241
54423
  for (const l of i)
54242
54424
  n.set(l, s), s += l.length;
54243
54425
  return n;
54244
- }, version = "0.4.0-rc.0";
54426
+ }, version = "0.5.0-rc.0";
54245
54427
  export {
54246
54428
  ArmClient,
54247
54429
  BaseClient,
@@ -54257,6 +54439,7 @@ export {
54257
54439
  MotorClient,
54258
54440
  MovementSensorClient,
54259
54441
  NavigationClient,
54442
+ PowerMode,
54260
54443
  PowerSensorClient,
54261
54444
  RobotClient,
54262
54445
  SensorClient,