@viamrobotics/sdk 0.0.12 → 0.0.13
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/components/base/Base.d.ts +6 -6
- package/dist/components/base/Client.d.ts +10 -8
- package/dist/components/board/Board.d.ts +8 -8
- package/dist/components/board/Client.d.ts +12 -10
- package/dist/components/camera/Client.d.ts +3 -1
- package/dist/components/motor/Client.d.ts +9 -8
- package/dist/components/motor/Motor.d.ts +5 -6
- package/dist/components/sensor/Client.d.ts +4 -2
- package/dist/extra/stream/Client.d.ts +3 -1
- package/dist/main.es.js +87 -81
- package/dist/main.umd.js +7 -7
- package/package.json +1 -1
package/dist/main.es.js
CHANGED
|
@@ -15673,43 +15673,44 @@ const promisify = function(o, e) {
|
|
|
15673
15673
|
class BaseClient {
|
|
15674
15674
|
client;
|
|
15675
15675
|
name;
|
|
15676
|
-
|
|
15677
|
-
|
|
15676
|
+
options;
|
|
15677
|
+
constructor(e, r, s = {}) {
|
|
15678
|
+
this.client = e.createServiceClient(BaseServiceClient_1), this.name = r, this.options = s;
|
|
15678
15679
|
}
|
|
15679
15680
|
get baseService() {
|
|
15680
15681
|
return this.client;
|
|
15681
15682
|
}
|
|
15682
15683
|
async moveStraight(e, r, s = {}) {
|
|
15683
15684
|
const t = this.baseService, i = new base_pb.MoveStraightRequest();
|
|
15684
|
-
|
|
15685
|
+
i.setName(this.name), i.setMmPerSec(r), i.setDistanceMm(e), i.setExtra(struct_pb$y.Struct.fromJavaScript(s)), this.options.requestLogger?.(i), await promisify(
|
|
15685
15686
|
t.moveStraight.bind(t),
|
|
15686
15687
|
i
|
|
15687
15688
|
);
|
|
15688
15689
|
}
|
|
15689
15690
|
async spin(e, r, s = {}) {
|
|
15690
15691
|
const t = this.baseService, i = new base_pb.SpinRequest();
|
|
15691
|
-
|
|
15692
|
+
i.setName(this.name), i.setAngleDeg(e), i.setDegsPerSec(r), i.setExtra(struct_pb$y.Struct.fromJavaScript(s)), this.options.requestLogger?.(i), await promisify(
|
|
15692
15693
|
t.spin.bind(t),
|
|
15693
15694
|
i
|
|
15694
15695
|
);
|
|
15695
15696
|
}
|
|
15696
15697
|
async setPower(e, r, s = {}) {
|
|
15697
15698
|
const t = this.baseService, i = new base_pb.SetPowerRequest();
|
|
15698
|
-
|
|
15699
|
+
i.setName(this.name), i.setLinear(e), i.setAngular(r), i.setExtra(struct_pb$y.Struct.fromJavaScript(s)), this.options.requestLogger?.(i), await promisify(
|
|
15699
15700
|
t.setPower.bind(t),
|
|
15700
15701
|
i
|
|
15701
15702
|
);
|
|
15702
15703
|
}
|
|
15703
15704
|
async setVelocity(e, r, s = {}) {
|
|
15704
15705
|
const t = this.baseService, i = new base_pb.SetVelocityRequest();
|
|
15705
|
-
|
|
15706
|
+
i.setName(this.name), i.setLinear(e), i.setAngular(r), i.setExtra(struct_pb$y.Struct.fromJavaScript(s)), this.options.requestLogger?.(i), await promisify(
|
|
15706
15707
|
t.setVelocity.bind(t),
|
|
15707
15708
|
i
|
|
15708
15709
|
);
|
|
15709
15710
|
}
|
|
15710
15711
|
async stop(e = {}) {
|
|
15711
15712
|
const r = this.baseService, s = new base_pb.StopRequest();
|
|
15712
|
-
|
|
15713
|
+
s.setName(this.name), s.setExtra(struct_pb$y.Struct.fromJavaScript(e)), this.options.requestLogger?.(s), await promisify(
|
|
15713
15714
|
r.stop.bind(r),
|
|
15714
15715
|
s
|
|
15715
15716
|
);
|
|
@@ -26686,74 +26687,75 @@ var BoardServiceClient_1 = BoardServiceClient;
|
|
|
26686
26687
|
class BoardClient {
|
|
26687
26688
|
client;
|
|
26688
26689
|
name;
|
|
26689
|
-
|
|
26690
|
-
|
|
26690
|
+
options;
|
|
26691
|
+
constructor(e, r, s = {}) {
|
|
26692
|
+
this.client = e.createServiceClient(BoardServiceClient_1), this.name = r, this.options = s;
|
|
26691
26693
|
}
|
|
26692
26694
|
get boardService() {
|
|
26693
26695
|
return this.client;
|
|
26694
26696
|
}
|
|
26695
26697
|
async status(e = {}) {
|
|
26696
26698
|
const r = this.boardService, s = new board_pb.StatusRequest();
|
|
26697
|
-
return s.setName(this.name), s.setExtra(struct_pb$y.Struct.fromJavaScript(e)), await promisify(
|
|
26699
|
+
return s.setName(this.name), s.setExtra(struct_pb$y.Struct.fromJavaScript(e)), this.options.requestLogger?.(s), await promisify(
|
|
26698
26700
|
r.status.bind(r),
|
|
26699
26701
|
s
|
|
26700
26702
|
);
|
|
26701
26703
|
}
|
|
26702
26704
|
async setGPIO(e, r, s = {}) {
|
|
26703
26705
|
const t = this.boardService, i = new board_pb.SetGPIORequest();
|
|
26704
|
-
|
|
26706
|
+
i.setName(this.name), i.setPin(e), i.setHigh(r), i.setExtra(struct_pb$y.Struct.fromJavaScript(s)), this.options.requestLogger?.(i), await promisify(
|
|
26705
26707
|
t.setGPIO.bind(t),
|
|
26706
26708
|
i
|
|
26707
26709
|
);
|
|
26708
26710
|
}
|
|
26709
26711
|
async getGPIO(e, r = {}) {
|
|
26710
26712
|
const s = this.boardService, t = new board_pb.GetGPIORequest();
|
|
26711
|
-
return t.setName(this.name), t.setPin(e), t.setExtra(struct_pb$y.Struct.fromJavaScript(r)), await promisify(
|
|
26713
|
+
return t.setName(this.name), t.setPin(e), t.setExtra(struct_pb$y.Struct.fromJavaScript(r)), this.options.requestLogger?.(t), (await promisify(
|
|
26712
26714
|
s.getGPIO.bind(s),
|
|
26713
26715
|
t
|
|
26714
|
-
);
|
|
26716
|
+
)).getHigh();
|
|
26715
26717
|
}
|
|
26716
|
-
async
|
|
26718
|
+
async getPWM(e, r = {}) {
|
|
26717
26719
|
const s = this.boardService, t = new board_pb.PWMRequest();
|
|
26718
|
-
return t.setName(this.name), t.setPin(e), t.setExtra(struct_pb$y.Struct.fromJavaScript(r)), await promisify(
|
|
26720
|
+
return t.setName(this.name), t.setPin(e), t.setExtra(struct_pb$y.Struct.fromJavaScript(r)), this.options.requestLogger?.(t), (await promisify(
|
|
26719
26721
|
s.pWM.bind(s),
|
|
26720
26722
|
t
|
|
26721
|
-
);
|
|
26723
|
+
)).getDutyCyclePct();
|
|
26722
26724
|
}
|
|
26723
26725
|
async setPWM(e, r, s = {}) {
|
|
26724
26726
|
const t = this.boardService, i = new board_pb.SetPWMRequest();
|
|
26725
|
-
|
|
26727
|
+
i.setName(this.name), i.setPin(e), i.setDutyCyclePct(r), i.setExtra(struct_pb$y.Struct.fromJavaScript(s)), this.options.requestLogger?.(i), await promisify(
|
|
26726
26728
|
t.setPWM.bind(t),
|
|
26727
26729
|
i
|
|
26728
26730
|
);
|
|
26729
26731
|
}
|
|
26730
|
-
async
|
|
26732
|
+
async getPWMFrequency(e, r = {}) {
|
|
26731
26733
|
const s = this.boardService, t = new board_pb.PWMFrequencyRequest();
|
|
26732
|
-
return t.setName(this.name), t.setPin(e), t.setExtra(struct_pb$y.Struct.fromJavaScript(r)), await promisify(
|
|
26734
|
+
return t.setName(this.name), t.setPin(e), t.setExtra(struct_pb$y.Struct.fromJavaScript(r)), this.options.requestLogger?.(t), (await promisify(
|
|
26733
26735
|
s.pWMFrequency.bind(s),
|
|
26734
26736
|
t
|
|
26735
|
-
);
|
|
26737
|
+
)).getFrequencyHz();
|
|
26736
26738
|
}
|
|
26737
26739
|
async setPWMFrequency(e, r, s = {}) {
|
|
26738
26740
|
const t = this.boardService, i = new board_pb.SetPWMFrequencyRequest();
|
|
26739
|
-
|
|
26741
|
+
i.setName(this.name), i.setPin(e), i.setFrequencyHz(r), i.setExtra(struct_pb$y.Struct.fromJavaScript(s)), this.options.requestLogger?.(i), await promisify(
|
|
26740
26742
|
t.setPWMFrequency.bind(t),
|
|
26741
26743
|
i
|
|
26742
26744
|
);
|
|
26743
26745
|
}
|
|
26744
26746
|
async readAnalogReader(e, r, s = {}) {
|
|
26745
26747
|
const t = this.boardService, i = new board_pb.ReadAnalogReaderRequest();
|
|
26746
|
-
return i.setBoardName(e), i.setAnalogReaderName(r), i.setExtra(struct_pb$y.Struct.fromJavaScript(s)), await promisify(
|
|
26748
|
+
return i.setBoardName(e), i.setAnalogReaderName(r), i.setExtra(struct_pb$y.Struct.fromJavaScript(s)), this.options.requestLogger?.(i), (await promisify(
|
|
26747
26749
|
t.readAnalogReader.bind(t),
|
|
26748
26750
|
i
|
|
26749
|
-
);
|
|
26751
|
+
)).getValue();
|
|
26750
26752
|
}
|
|
26751
26753
|
async getDigitalInterruptValue(e, r, s = {}) {
|
|
26752
26754
|
const t = this.boardService, i = new board_pb.GetDigitalInterruptValueRequest();
|
|
26753
|
-
return i.setBoardName(e), i.setDigitalInterruptName(r), i.setExtra(struct_pb$y.Struct.fromJavaScript(s)), await promisify(
|
|
26755
|
+
return i.setBoardName(e), i.setDigitalInterruptName(r), i.setExtra(struct_pb$y.Struct.fromJavaScript(s)), this.options.requestLogger?.(i), (await promisify(
|
|
26754
26756
|
t.getDigitalInterruptValue.bind(t),
|
|
26755
26757
|
i
|
|
26756
|
-
);
|
|
26758
|
+
)).getValue();
|
|
26757
26759
|
}
|
|
26758
26760
|
}
|
|
26759
26761
|
var commonjsGlobal$A = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, camera_pb$1 = {}, googleProtobuf$A = {};
|
|
@@ -44429,22 +44431,23 @@ var httpbody_pb = {}, any_pb = {};
|
|
|
44429
44431
|
class CameraClient {
|
|
44430
44432
|
client;
|
|
44431
44433
|
name;
|
|
44432
|
-
|
|
44433
|
-
|
|
44434
|
+
options;
|
|
44435
|
+
constructor(e, r, s = {}) {
|
|
44436
|
+
this.client = e.createServiceClient(CameraServiceClient_1), this.name = r, this.options = s;
|
|
44434
44437
|
}
|
|
44435
44438
|
get cameraService() {
|
|
44436
44439
|
return this.client;
|
|
44437
44440
|
}
|
|
44438
44441
|
async getImage(e) {
|
|
44439
44442
|
const r = this.cameraService, s = new camera_pb.GetImageRequest();
|
|
44440
|
-
return s.setName(this.name), s.setMimeType(e), (await promisify(
|
|
44443
|
+
return s.setName(this.name), s.setMimeType(e), this.options.requestLogger?.(s), (await promisify(
|
|
44441
44444
|
r.getImage.bind(r),
|
|
44442
44445
|
s
|
|
44443
44446
|
)).getImage_asU8();
|
|
44444
44447
|
}
|
|
44445
44448
|
async renderFrame(e) {
|
|
44446
44449
|
const r = this.cameraService, s = new camera_pb.GetPointCloudRequest();
|
|
44447
|
-
s.setName(this.name), s.setMimeType(e);
|
|
44450
|
+
s.setName(this.name), s.setMimeType(e), this.options.requestLogger?.(s);
|
|
44448
44451
|
const t = await promisify(
|
|
44449
44452
|
r.renderFrame.bind(r),
|
|
44450
44453
|
s
|
|
@@ -44453,11 +44456,11 @@ class CameraClient {
|
|
|
44453
44456
|
}
|
|
44454
44457
|
async getPointCloud() {
|
|
44455
44458
|
const e = this.cameraService, r = new camera_pb.GetPointCloudRequest();
|
|
44456
|
-
return r.setName(this.name), r.setMimeType(MimeType.PCD), (await promisify(e.getPointCloud.bind(e), r)).getPointCloud_asU8();
|
|
44459
|
+
return r.setName(this.name), r.setMimeType(MimeType.PCD), this.options.requestLogger?.(r), (await promisify(e.getPointCloud.bind(e), r)).getPointCloud_asU8();
|
|
44457
44460
|
}
|
|
44458
44461
|
async getProperties() {
|
|
44459
44462
|
const e = this.cameraService, r = new camera_pb.GetPropertiesRequest();
|
|
44460
|
-
return r.setName(this.name), (await promisify(e.getProperties.bind(e), r)).toObject();
|
|
44463
|
+
return r.setName(this.name), this.options.requestLogger?.(r), (await promisify(e.getProperties.bind(e), r)).toObject();
|
|
44461
44464
|
}
|
|
44462
44465
|
}
|
|
44463
44466
|
var __webpack_modules__ = { 37: function(o) {
|
|
@@ -51651,7 +51654,7 @@ var __webpack_modules__ = { 37: function(o) {
|
|
|
51651
51654
|
P = L, x = U;
|
|
51652
51655
|
}), t.grpc.invoke(u.AuthService.Authenticate, { request: A, host: E.externalAuthAddress ? E.externalAuthAddress : v, transport: S, onMessage: function(L) {
|
|
51653
51656
|
T = L.getAccessToken();
|
|
51654
|
-
}, onEnd: function(L, U,
|
|
51657
|
+
}, onEnd: function(L, U, V) {
|
|
51655
51658
|
L == t.grpc.Code.OK ? P(R) : x(U);
|
|
51656
51659
|
} }), [4, O]));
|
|
51657
51660
|
case 1:
|
|
@@ -51663,7 +51666,7 @@ var __webpack_modules__ = { 37: function(o) {
|
|
|
51663
51666
|
P = L, x = U;
|
|
51664
51667
|
}), T = "", (A = new l.AuthenticateToRequest()).setEntity(E.externalAuthToEntity), t.grpc.invoke(u.ExternalAuthService.AuthenticateTo, { request: A, host: E.externalAuthAddress, transport: S, metadata: M, onMessage: function(L) {
|
|
51665
51668
|
T = L.getAccessToken();
|
|
51666
|
-
}, onEnd: function(L, U,
|
|
51669
|
+
}, onEnd: function(L, U, V) {
|
|
51667
51670
|
L == t.grpc.Code.OK ? P(M) : x(U);
|
|
51668
51671
|
} }), [4, O]) : [3, 5];
|
|
51669
51672
|
case 4:
|
|
@@ -51727,7 +51730,7 @@ var __webpack_modules__ = { 37: function(o) {
|
|
|
51727
51730
|
e.dialWebRTC = function(v, S, E) {
|
|
51728
51731
|
var _, D, I, j, B, T, P;
|
|
51729
51732
|
return s.__awaiter(this, void 0, void 0, function() {
|
|
51730
|
-
var x, X, M, O, A, R, F, N, w, L, U,
|
|
51733
|
+
var x, X, M, O, A, R, F, N, w, L, U, V, C, G, z, Z, ee, re, se, ie, pe, ne, ge, ae, le = this;
|
|
51731
51734
|
return s.__generator(this, function($) {
|
|
51732
51735
|
switch ($.label) {
|
|
51733
51736
|
case 0:
|
|
@@ -51737,31 +51740,31 @@ var __webpack_modules__ = { 37: function(o) {
|
|
|
51737
51740
|
case 2:
|
|
51738
51741
|
return $.trys.push([2, , 9, 10]), R = E, E && (R = s.__assign({}, E), E.accessToken || (R.authEntity = (_ = E?.webrtcOptions) === null || _ === void 0 ? void 0 : _.signalingAuthEntity, R.authEntity || (R.externalAuthAddress ? R.authEntity = (D = E.externalAuthAddress) === null || D === void 0 ? void 0 : D.replace(/^(.*:\/\/)/, "") : R.authEntity = v.replace(/^(.*:\/\/)/, "")), R.credentials = (I = E?.webrtcOptions) === null || I === void 0 ? void 0 : I.signalingCredentials, R.accessToken = (j = E?.webrtcOptions) === null || j === void 0 ? void 0 : j.signalingAccessToken), R.externalAuthAddress = (B = E?.webrtcOptions) === null || B === void 0 ? void 0 : B.signalingExternalAuthAddress, R.externalAuthToEntity = (T = E?.webrtcOptions) === null || T === void 0 ? void 0 : T.signalingExternalAuthToEntity), [4, m(v, R)];
|
|
51739
51742
|
case 3:
|
|
51740
|
-
return F = $.sent(), N = t.grpc.client(y.SignalingService.Call, { host: v, transport: F }), w = "", L = !1, U = function(
|
|
51743
|
+
return F = $.sent(), N = t.grpc.client(y.SignalingService.Call, { host: v, transport: F }), w = "", L = !1, U = function(k) {
|
|
51741
51744
|
if (!L) {
|
|
51742
51745
|
L = !0;
|
|
51743
51746
|
var W = new c.CallUpdateRequest();
|
|
51744
51747
|
W.setUuid(w);
|
|
51745
51748
|
var Y = new g.Status();
|
|
51746
|
-
Y.setCode(p.Code.UNKNOWN), Y.setMessage(
|
|
51749
|
+
Y.setCode(p.Code.UNKNOWN), Y.setMessage(k), W.setError(Y), t.grpc.unary(y.SignalingService.CallUpdate, { request: W, metadata: { "rpc-host": S }, host: v, transport: F, onEnd: function(q) {
|
|
51747
51750
|
var H = q.status, K = q.statusMessage, Q = q.message;
|
|
51748
51751
|
H === t.grpc.Code.OK && Q || console.error(K);
|
|
51749
51752
|
} });
|
|
51750
51753
|
}
|
|
51751
|
-
},
|
|
51754
|
+
}, V = function() {
|
|
51752
51755
|
if (!L) {
|
|
51753
51756
|
L = !0;
|
|
51754
|
-
var
|
|
51755
|
-
|
|
51757
|
+
var k = new c.CallUpdateRequest();
|
|
51758
|
+
k.setUuid(w), k.setDone(!0), t.grpc.unary(y.SignalingService.CallUpdate, { request: k, metadata: { "rpc-host": S }, host: v, transport: F, onEnd: function(W) {
|
|
51756
51759
|
var Y = W.status, q = W.statusMessage, H = W.message;
|
|
51757
51760
|
Y === t.grpc.Code.OK && H || console.error(q);
|
|
51758
51761
|
} });
|
|
51759
51762
|
}
|
|
51760
|
-
}, G = new Promise(function(
|
|
51761
|
-
C =
|
|
51763
|
+
}, G = new Promise(function(k) {
|
|
51764
|
+
C = k;
|
|
51762
51765
|
}), z = !1, x?.disableTrickleICE ? [3, 6] : [4, M.createOffer()];
|
|
51763
51766
|
case 4:
|
|
51764
|
-
return Z = $.sent(), ee = !1, M.onicecandidate = function(
|
|
51767
|
+
return Z = $.sent(), ee = !1, M.onicecandidate = function(k) {
|
|
51765
51768
|
return s.__awaiter(le, void 0, void 0, function() {
|
|
51766
51769
|
var W, Y;
|
|
51767
51770
|
return s.__generator(this, function(q) {
|
|
@@ -51769,7 +51772,7 @@ var __webpack_modules__ = { 37: function(o) {
|
|
|
51769
51772
|
case 0:
|
|
51770
51773
|
return [4, G];
|
|
51771
51774
|
case 1:
|
|
51772
|
-
return q.sent(), z ? [2] :
|
|
51775
|
+
return q.sent(), z ? [2] : k.candidate === null ? (ee = !0, V(), [2]) : (H = k.candidate, (K = new c.ICECandidate()).setCandidate(H.candidate), H.sdpMid && K.setSdpMid(H.sdpMid), H.sdpMLineIndex && K.setSdpmLineIndex(H.sdpMLineIndex), H.usernameFragment && K.setUsernameFragment(H.usernameFragment), W = K, (Y = new c.CallUpdateRequest()).setUuid(w), Y.setCandidate(W), t.grpc.unary(y.SignalingService.CallUpdate, { request: Y, metadata: { "rpc-host": S }, host: v, transport: F, onEnd: function(Q) {
|
|
51773
51776
|
var oe = Q.status, J = Q.statusMessage, te = Q.message;
|
|
51774
51777
|
oe === t.grpc.Code.OK && te || z || ee || console.error("error sending candidate", J);
|
|
51775
51778
|
} }), [2]);
|
|
@@ -51781,13 +51784,13 @@ var __webpack_modules__ = { 37: function(o) {
|
|
|
51781
51784
|
case 5:
|
|
51782
51785
|
$.sent(), $.label = 6;
|
|
51783
51786
|
case 6:
|
|
51784
|
-
return re = !1, N.onMessage(function(
|
|
51787
|
+
return re = !1, N.onMessage(function(k) {
|
|
51785
51788
|
return s.__awaiter(le, void 0, void 0, function() {
|
|
51786
51789
|
var W, Y, q, H, K, Q;
|
|
51787
51790
|
return s.__generator(this, function(oe) {
|
|
51788
51791
|
switch (oe.label) {
|
|
51789
51792
|
case 0:
|
|
51790
|
-
return (W =
|
|
51793
|
+
return (W = k).hasInit() ? re ? (U("got init stage more than once"), [2]) : (Y = W.getInit(), re = !0, w = W.getUuid(), q = new RTCSessionDescription(JSON.parse(atob(Y.getSdp()))), M.setRemoteDescription(q), C(!0), x?.disableTrickleICE ? (z = !0, V(), [2]) : [3, 7]) : [3, 1];
|
|
51791
51794
|
case 1:
|
|
51792
51795
|
if (!W.hasUpdate())
|
|
51793
51796
|
return [3, 6];
|
|
@@ -51812,19 +51815,19 @@ var __webpack_modules__ = { 37: function(o) {
|
|
|
51812
51815
|
var J, te;
|
|
51813
51816
|
});
|
|
51814
51817
|
});
|
|
51815
|
-
}), pe = new Promise(function(
|
|
51816
|
-
se =
|
|
51817
|
-
}), N.onEnd(function(
|
|
51818
|
-
|
|
51818
|
+
}), pe = new Promise(function(k, W) {
|
|
51819
|
+
se = k, ie = W;
|
|
51820
|
+
}), N.onEnd(function(k, W, Y) {
|
|
51821
|
+
k !== t.grpc.Code.OK ? W !== "Response closed without headers" ? (console.error(W), ie(W)) : ie(new n.ConnectionClosedError("failed to dial")) : se();
|
|
51819
51822
|
}), N.start({ "rpc-host": S }), ne = new c.CallRequest(), ge = btoa(JSON.stringify(M.localDescription)), ne.setSdp(ge), x && x.disableTrickleICE && ne.setDisableTrickle(x.disableTrickleICE), N.send(ne), (ae = new i.ClientChannel(M, O)).ready.then(function() {
|
|
51820
51823
|
return se();
|
|
51821
|
-
}).catch(function(
|
|
51822
|
-
return ie(
|
|
51824
|
+
}).catch(function(k) {
|
|
51825
|
+
return ie(k);
|
|
51823
51826
|
}), [4, pe];
|
|
51824
51827
|
case 7:
|
|
51825
51828
|
return $.sent(), [4, ae.ready];
|
|
51826
51829
|
case 8:
|
|
51827
|
-
return $.sent(), z = !0,
|
|
51830
|
+
return $.sent(), z = !0, V(), E?.externalAuthAddress || (P = E?.credentials) === null || P === void 0 || P.type, A = !0, [2, { transportFactory: ae.transportFactory(), peerConnection: M }];
|
|
51828
51831
|
case 9:
|
|
51829
51832
|
return A || M.close(), [7];
|
|
51830
51833
|
case 10:
|
|
@@ -51984,23 +51987,23 @@ var __webpack_modules__ = { 37: function(o) {
|
|
|
51984
51987
|
}
|
|
51985
51988
|
function u(M, O, A, R) {
|
|
51986
51989
|
return new (A || (A = Promise))(function(F, N) {
|
|
51987
|
-
function w(
|
|
51990
|
+
function w(V) {
|
|
51988
51991
|
try {
|
|
51989
|
-
U(R.next(
|
|
51992
|
+
U(R.next(V));
|
|
51990
51993
|
} catch (C) {
|
|
51991
51994
|
N(C);
|
|
51992
51995
|
}
|
|
51993
51996
|
}
|
|
51994
|
-
function L(
|
|
51997
|
+
function L(V) {
|
|
51995
51998
|
try {
|
|
51996
|
-
U(R.throw(
|
|
51999
|
+
U(R.throw(V));
|
|
51997
52000
|
} catch (C) {
|
|
51998
52001
|
N(C);
|
|
51999
52002
|
}
|
|
52000
52003
|
}
|
|
52001
|
-
function U(
|
|
52004
|
+
function U(V) {
|
|
52002
52005
|
var C;
|
|
52003
|
-
|
|
52006
|
+
V.done ? F(V.value) : (C = V.value, C instanceof A ? C : new A(function(G) {
|
|
52004
52007
|
G(C);
|
|
52005
52008
|
})).then(w, L);
|
|
52006
52009
|
}
|
|
@@ -52017,7 +52020,7 @@ var __webpack_modules__ = { 37: function(o) {
|
|
|
52017
52020
|
return this;
|
|
52018
52021
|
}), N;
|
|
52019
52022
|
function L(U) {
|
|
52020
|
-
return function(
|
|
52023
|
+
return function(V) {
|
|
52021
52024
|
return function(C) {
|
|
52022
52025
|
if (A)
|
|
52023
52026
|
throw new TypeError("Generator is already executing.");
|
|
@@ -52067,7 +52070,7 @@ var __webpack_modules__ = { 37: function(o) {
|
|
|
52067
52070
|
if (5 & C[0])
|
|
52068
52071
|
throw C[1];
|
|
52069
52072
|
return { value: C[0] ? C[1] : void 0, done: !0 };
|
|
52070
|
-
}([U,
|
|
52073
|
+
}([U, V]);
|
|
52071
52074
|
};
|
|
52072
52075
|
}
|
|
52073
52076
|
}
|
|
@@ -52153,7 +52156,7 @@ var __webpack_modules__ = { 37: function(o) {
|
|
|
52153
52156
|
}
|
|
52154
52157
|
function L(G, z) {
|
|
52155
52158
|
try {
|
|
52156
|
-
(Z = F[G](z)).value instanceof S ? Promise.resolve(Z.value.v).then(U,
|
|
52159
|
+
(Z = F[G](z)).value instanceof S ? Promise.resolve(Z.value.v).then(U, V) : C(N[0][2], Z);
|
|
52157
52160
|
} catch (ee) {
|
|
52158
52161
|
C(N[0][3], ee);
|
|
52159
52162
|
}
|
|
@@ -52162,7 +52165,7 @@ var __webpack_modules__ = { 37: function(o) {
|
|
|
52162
52165
|
function U(G) {
|
|
52163
52166
|
L("next", G);
|
|
52164
52167
|
}
|
|
52165
|
-
function
|
|
52168
|
+
function V(G) {
|
|
52166
52169
|
L("throw", G);
|
|
52167
52170
|
}
|
|
52168
52171
|
function C(G, z) {
|
|
@@ -52192,10 +52195,10 @@ var __webpack_modules__ = { 37: function(o) {
|
|
|
52192
52195
|
function R(F) {
|
|
52193
52196
|
O[F] = M[F] && function(N) {
|
|
52194
52197
|
return new Promise(function(w, L) {
|
|
52195
|
-
(function(U,
|
|
52198
|
+
(function(U, V, C, G) {
|
|
52196
52199
|
Promise.resolve(G).then(function(z) {
|
|
52197
52200
|
U({ value: z, done: C });
|
|
52198
|
-
},
|
|
52201
|
+
}, V);
|
|
52199
52202
|
})(w, L, (N = M[F](N)).done, N.value);
|
|
52200
52203
|
});
|
|
52201
52204
|
};
|
|
@@ -212718,64 +212721,65 @@ class Client {
|
|
|
212718
212721
|
class MotorClient {
|
|
212719
212722
|
client;
|
|
212720
212723
|
name;
|
|
212721
|
-
|
|
212722
|
-
|
|
212724
|
+
options;
|
|
212725
|
+
constructor(e, r, s = {}) {
|
|
212726
|
+
this.client = e.createServiceClient(MotorServiceClient_1), this.name = r, this.options = s;
|
|
212723
212727
|
}
|
|
212724
212728
|
get motorService() {
|
|
212725
212729
|
return this.client;
|
|
212726
212730
|
}
|
|
212727
212731
|
async setPower(e, r = {}) {
|
|
212728
212732
|
const s = this.motorService, t = new motor_pb.SetPowerRequest();
|
|
212729
|
-
|
|
212733
|
+
t.setName(this.name), t.setPowerPct(e), t.setExtra(struct_pb$y.Struct.fromJavaScript(r)), this.options.requestLogger?.(t), await promisify(
|
|
212730
212734
|
s.setPower.bind(s),
|
|
212731
212735
|
t
|
|
212732
212736
|
);
|
|
212733
212737
|
}
|
|
212734
212738
|
async goFor(e, r, s = {}) {
|
|
212735
212739
|
const t = this.motorService, i = new motor_pb.GoForRequest();
|
|
212736
|
-
|
|
212740
|
+
i.setName(this.name), i.setRpm(e), i.setRevolutions(r), i.setExtra(struct_pb$y.Struct.fromJavaScript(s)), this.options.requestLogger?.(i), await promisify(
|
|
212737
212741
|
t.goFor.bind(t),
|
|
212738
212742
|
i
|
|
212739
212743
|
);
|
|
212740
212744
|
}
|
|
212741
212745
|
async goTo(e, r, s = {}) {
|
|
212742
212746
|
const t = this.motorService, i = new motor_pb.GoToRequest();
|
|
212743
|
-
|
|
212747
|
+
i.setName(this.name), i.setRpm(e), i.setPositionRevolutions(r), i.setExtra(struct_pb$y.Struct.fromJavaScript(s)), this.options.requestLogger?.(i), await promisify(
|
|
212744
212748
|
t.goTo.bind(t),
|
|
212745
212749
|
i
|
|
212746
212750
|
);
|
|
212747
212751
|
}
|
|
212748
212752
|
async resetZeroPosition(e, r = {}) {
|
|
212749
212753
|
const s = this.motorService, t = new motor_pb.ResetZeroPositionRequest();
|
|
212750
|
-
|
|
212754
|
+
t.setName(this.name), t.setOffset(e), t.setExtra(struct_pb$y.Struct.fromJavaScript(r)), this.options.requestLogger?.(t), await promisify(
|
|
212751
212755
|
s.resetZeroPosition.bind(s),
|
|
212752
212756
|
t
|
|
212753
212757
|
);
|
|
212754
212758
|
}
|
|
212755
212759
|
async motorStop(e = {}) {
|
|
212756
212760
|
const r = this.motorService, s = new motor_pb.StopRequest();
|
|
212757
|
-
|
|
212761
|
+
s.setName(this.name), s.setExtra(struct_pb$y.Struct.fromJavaScript(e)), this.options.requestLogger?.(s), await promisify(
|
|
212758
212762
|
r.stop.bind(r),
|
|
212759
212763
|
s
|
|
212760
212764
|
);
|
|
212761
212765
|
}
|
|
212762
212766
|
async getProperties(e = {}) {
|
|
212763
212767
|
const r = this.motorService, s = new motor_pb.GetPropertiesRequest();
|
|
212764
|
-
return s.setName(this.name), s.setExtra(struct_pb$y.Struct.fromJavaScript(e)), { positionReporting: (await promisify(
|
|
212768
|
+
return s.setName(this.name), s.setExtra(struct_pb$y.Struct.fromJavaScript(e)), this.options.requestLogger?.(s), { positionReporting: (await promisify(
|
|
212765
212769
|
r.getProperties.bind(r),
|
|
212766
212770
|
s
|
|
212767
212771
|
)).getPositionReporting() };
|
|
212768
212772
|
}
|
|
212769
212773
|
async getPosition(e = {}) {
|
|
212770
212774
|
const r = this.motorService, s = new motor_pb.GetPositionRequest();
|
|
212771
|
-
return s.setName(this.name), s.setExtra(struct_pb$y.Struct.fromJavaScript(e)), (await promisify(
|
|
212775
|
+
return s.setName(this.name), s.setExtra(struct_pb$y.Struct.fromJavaScript(e)), this.options.requestLogger?.(s), (await promisify(
|
|
212772
212776
|
r.getPosition.bind(r),
|
|
212773
212777
|
s
|
|
212774
212778
|
)).getPosition();
|
|
212775
212779
|
}
|
|
212776
212780
|
async isPowered(e = {}) {
|
|
212777
212781
|
const r = this.motorService, s = new motor_pb.IsPoweredRequest();
|
|
212778
|
-
s.setName(this.name), s.setExtra(struct_pb$y.Struct.fromJavaScript(e));
|
|
212782
|
+
s.setName(this.name), s.setExtra(struct_pb$y.Struct.fromJavaScript(e)), this.options.requestLogger?.(s);
|
|
212779
212783
|
const t = await promisify(
|
|
212780
212784
|
r.isPowered.bind(r),
|
|
212781
212785
|
s
|
|
@@ -221495,15 +221499,16 @@ var SensorServiceClient_1 = SensorServiceClient;
|
|
|
221495
221499
|
class SensorClient {
|
|
221496
221500
|
client;
|
|
221497
221501
|
name;
|
|
221498
|
-
|
|
221499
|
-
|
|
221502
|
+
options;
|
|
221503
|
+
constructor(e, r, s = {}) {
|
|
221504
|
+
this.client = e.createServiceClient(SensorServiceClient_1), this.name = r, this.options = s;
|
|
221500
221505
|
}
|
|
221501
221506
|
get sensorService() {
|
|
221502
221507
|
return this.client;
|
|
221503
221508
|
}
|
|
221504
221509
|
async getReadings(e = {}) {
|
|
221505
221510
|
const r = this.sensorService, s = new sensor_pb.GetReadingsRequest();
|
|
221506
|
-
return s.setName(this.name), s.setExtra(struct_pb$y.Struct.fromJavaScript(e)), await promisify(
|
|
221511
|
+
return s.setName(this.name), s.setExtra(struct_pb$y.Struct.fromJavaScript(e)), this.options.requestLogger?.(s), await promisify(
|
|
221507
221512
|
r.getReadings.bind(r),
|
|
221508
221513
|
s
|
|
221509
221514
|
);
|
|
@@ -230922,22 +230927,23 @@ var StreamServiceClient_1 = StreamServiceClient, commonjsGlobal$h = typeof globa
|
|
|
230922
230927
|
})(stream_pb);
|
|
230923
230928
|
class StreamClient {
|
|
230924
230929
|
client;
|
|
230925
|
-
|
|
230926
|
-
|
|
230930
|
+
options;
|
|
230931
|
+
constructor(e, r = {}) {
|
|
230932
|
+
this.client = e.createServiceClient(StreamServiceClient_1), this.options = r;
|
|
230927
230933
|
}
|
|
230928
230934
|
get streamService() {
|
|
230929
230935
|
return this.client;
|
|
230930
230936
|
}
|
|
230931
230937
|
async add(e) {
|
|
230932
230938
|
const r = this.streamService, s = new stream_pb.AddStreamRequest();
|
|
230933
|
-
s.setName(e), await promisify(
|
|
230939
|
+
s.setName(e), this.options.requestLogger?.(s), await promisify(
|
|
230934
230940
|
r.addStream.bind(r),
|
|
230935
230941
|
s
|
|
230936
230942
|
);
|
|
230937
230943
|
}
|
|
230938
230944
|
async remove(e) {
|
|
230939
230945
|
const r = this.streamService, s = new stream_pb.RemoveStreamRequest();
|
|
230940
|
-
s.setName(e), await promisify(
|
|
230946
|
+
s.setName(e), this.options.requestLogger?.(s), await promisify(
|
|
230941
230947
|
r.removeStream.bind(r),
|
|
230942
230948
|
s
|
|
230943
230949
|
);
|