@acrobits/ipc-sdk 0.1.6 → 0.1.8
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/lib/ipc-sdk.js
CHANGED
|
@@ -74,7 +74,7 @@ var N = Z(function(n) {
|
|
|
74
74
|
`) : "", this.name = "UnsubscriptionError", this.errors = e;
|
|
75
75
|
};
|
|
76
76
|
});
|
|
77
|
-
function
|
|
77
|
+
function L(n, t) {
|
|
78
78
|
if (n) {
|
|
79
79
|
var e = n.indexOf(t);
|
|
80
80
|
0 <= e && n.splice(e, 1);
|
|
@@ -96,8 +96,8 @@ var T = function() {
|
|
|
96
96
|
var a = u.value;
|
|
97
97
|
a.remove(this);
|
|
98
98
|
}
|
|
99
|
-
} catch (
|
|
100
|
-
t = { error:
|
|
99
|
+
} catch (d) {
|
|
100
|
+
t = { error: d };
|
|
101
101
|
} finally {
|
|
102
102
|
try {
|
|
103
103
|
u && !u.done && (e = c.return) && e.call(c);
|
|
@@ -108,27 +108,27 @@ var T = function() {
|
|
|
108
108
|
}
|
|
109
109
|
else
|
|
110
110
|
s.remove(this);
|
|
111
|
-
var
|
|
112
|
-
if (b(
|
|
111
|
+
var f = this.initialTeardown;
|
|
112
|
+
if (b(f))
|
|
113
113
|
try {
|
|
114
|
-
|
|
115
|
-
} catch (
|
|
116
|
-
o =
|
|
114
|
+
f();
|
|
115
|
+
} catch (d) {
|
|
116
|
+
o = d instanceof N ? d.errors : [d];
|
|
117
117
|
}
|
|
118
|
-
var
|
|
119
|
-
if (
|
|
118
|
+
var g = this._finalizers;
|
|
119
|
+
if (g) {
|
|
120
120
|
this._finalizers = null;
|
|
121
121
|
try {
|
|
122
|
-
for (var w = G(
|
|
122
|
+
for (var w = G(g), y = w.next(); !y.done; y = w.next()) {
|
|
123
123
|
var D = y.value;
|
|
124
124
|
try {
|
|
125
125
|
oe(D);
|
|
126
|
-
} catch (
|
|
127
|
-
o = o ?? [],
|
|
126
|
+
} catch (d) {
|
|
127
|
+
o = o ?? [], d instanceof N ? o = I(I([], M(o)), M(d.errors)) : o.push(d);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
} catch (
|
|
131
|
-
r = { error:
|
|
130
|
+
} catch (d) {
|
|
131
|
+
r = { error: d };
|
|
132
132
|
} finally {
|
|
133
133
|
try {
|
|
134
134
|
y && !y.done && (i = w.return) && i.call(w);
|
|
@@ -162,10 +162,10 @@ var T = function() {
|
|
|
162
162
|
this._parentage = Array.isArray(e) ? (e.push(t), e) : e ? [e, t] : t;
|
|
163
163
|
}, n.prototype._removeParent = function(t) {
|
|
164
164
|
var e = this._parentage;
|
|
165
|
-
e === t ? this._parentage = null : Array.isArray(e) &&
|
|
165
|
+
e === t ? this._parentage = null : Array.isArray(e) && L(e, t);
|
|
166
166
|
}, n.prototype.remove = function(t) {
|
|
167
167
|
var e = this._finalizers;
|
|
168
|
-
e &&
|
|
168
|
+
e && L(e, t), t instanceof n && t._removeParent(this);
|
|
169
169
|
}, n.EMPTY = function() {
|
|
170
170
|
var t = new n();
|
|
171
171
|
return t.closed = !0, t;
|
|
@@ -210,10 +210,10 @@ var ee = function(n) {
|
|
|
210
210
|
x(t, n);
|
|
211
211
|
function t(e) {
|
|
212
212
|
var r = n.call(this) || this;
|
|
213
|
-
return r.isStopped = !1, e ? (r.destination = e, we(e) && e.add(r)) : r.destination =
|
|
213
|
+
return r.isStopped = !1, e ? (r.destination = e, we(e) && e.add(r)) : r.destination = Ve, r;
|
|
214
214
|
}
|
|
215
215
|
return t.create = function(e, r, i) {
|
|
216
|
-
return new
|
|
216
|
+
return new V(e, r, i);
|
|
217
217
|
}, t.prototype.next = function(e) {
|
|
218
218
|
this.isStopped || this._next(e);
|
|
219
219
|
}, t.prototype.error = function(e) {
|
|
@@ -272,7 +272,7 @@ var $e = function() {
|
|
|
272
272
|
P(e);
|
|
273
273
|
}
|
|
274
274
|
}, n;
|
|
275
|
-
}(),
|
|
275
|
+
}(), V = function(n) {
|
|
276
276
|
x(t, n);
|
|
277
277
|
function t(e, r, i) {
|
|
278
278
|
var o = n.call(this) || this, s;
|
|
@@ -299,15 +299,15 @@ var $e = function() {
|
|
|
299
299
|
function P(n) {
|
|
300
300
|
Re(n);
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function Le(n) {
|
|
303
303
|
throw n;
|
|
304
304
|
}
|
|
305
|
-
var
|
|
305
|
+
var Ve = {
|
|
306
306
|
closed: !0,
|
|
307
307
|
next: se,
|
|
308
|
-
error:
|
|
308
|
+
error: Le,
|
|
309
309
|
complete: se
|
|
310
|
-
},
|
|
310
|
+
}, je = function() {
|
|
311
311
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
312
312
|
}();
|
|
313
313
|
function Ce(n) {
|
|
@@ -328,7 +328,7 @@ var Y = function() {
|
|
|
328
328
|
var e = new n();
|
|
329
329
|
return e.source = this, e.operator = t, e;
|
|
330
330
|
}, n.prototype.subscribe = function(t, e, r) {
|
|
331
|
-
var i = this, o = De(t) ? t : new
|
|
331
|
+
var i = this, o = De(t) ? t : new V(t, e, r);
|
|
332
332
|
return U(function() {
|
|
333
333
|
var s = i, c = s.operator, u = s.source;
|
|
334
334
|
o.add(c ? c.call(o, u) : u ? i._subscribe(o) : i._trySubscribe(o));
|
|
@@ -342,7 +342,7 @@ var Y = function() {
|
|
|
342
342
|
}, n.prototype.forEach = function(t, e) {
|
|
343
343
|
var r = this;
|
|
344
344
|
return e = ue(e), new e(function(i, o) {
|
|
345
|
-
var s = new
|
|
345
|
+
var s = new V({
|
|
346
346
|
next: function(c) {
|
|
347
347
|
try {
|
|
348
348
|
t(c);
|
|
@@ -358,7 +358,7 @@ var Y = function() {
|
|
|
358
358
|
}, n.prototype._subscribe = function(t) {
|
|
359
359
|
var e;
|
|
360
360
|
return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);
|
|
361
|
-
}, n.prototype[
|
|
361
|
+
}, n.prototype[je] = function() {
|
|
362
362
|
return this;
|
|
363
363
|
}, n.prototype.pipe = function() {
|
|
364
364
|
for (var t = [], e = 0; e < arguments.length; e++)
|
|
@@ -416,14 +416,14 @@ var ke = function(n) {
|
|
|
416
416
|
return u.onFinalize = s, u.shouldUnsubscribe = c, u._next = r ? function(a) {
|
|
417
417
|
try {
|
|
418
418
|
r(a);
|
|
419
|
-
} catch (
|
|
420
|
-
e.error(
|
|
419
|
+
} catch (f) {
|
|
420
|
+
e.error(f);
|
|
421
421
|
}
|
|
422
422
|
} : n.prototype._next, u._error = o ? function(a) {
|
|
423
423
|
try {
|
|
424
424
|
o(a);
|
|
425
|
-
} catch (
|
|
426
|
-
e.error(
|
|
425
|
+
} catch (f) {
|
|
426
|
+
e.error(f);
|
|
427
427
|
} finally {
|
|
428
428
|
this.unsubscribe();
|
|
429
429
|
}
|
|
@@ -517,7 +517,7 @@ var ke = function(n) {
|
|
|
517
517
|
}, t.prototype._innerSubscribe = function(e) {
|
|
518
518
|
var r = this, i = this, o = i.hasError, s = i.isStopped, c = i.observers;
|
|
519
519
|
return o || s ? me : (this.currentObservers = null, c.push(e), new T(function() {
|
|
520
|
-
r.currentObservers = null,
|
|
520
|
+
r.currentObservers = null, L(c, e);
|
|
521
521
|
}));
|
|
522
522
|
}, t.prototype._checkFinalizedStatuses = function(e) {
|
|
523
523
|
var r = this, i = r.hasError, o = r.thrownError, s = r.isStopped;
|
|
@@ -560,15 +560,15 @@ var ke = function(n) {
|
|
|
560
560
|
return t.prototype.schedule = function(e, r) {
|
|
561
561
|
return this;
|
|
562
562
|
}, t;
|
|
563
|
-
}(T),
|
|
563
|
+
}(T), j = {
|
|
564
564
|
setInterval: function(n, t) {
|
|
565
565
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
566
566
|
e[r - 2] = arguments[r];
|
|
567
|
-
var i =
|
|
567
|
+
var i = j.delegate;
|
|
568
568
|
return i != null && i.setInterval ? i.setInterval.apply(i, I([n, t], M(e))) : setInterval.apply(void 0, I([n, t], M(e)));
|
|
569
569
|
},
|
|
570
570
|
clearInterval: function(n) {
|
|
571
|
-
var t =
|
|
571
|
+
var t = j.delegate;
|
|
572
572
|
return ((t == null ? void 0 : t.clearInterval) || clearInterval)(n);
|
|
573
573
|
},
|
|
574
574
|
delegate: void 0
|
|
@@ -586,11 +586,11 @@ var ke = function(n) {
|
|
|
586
586
|
var o = this.id, s = this.scheduler;
|
|
587
587
|
return o != null && (this.id = this.recycleAsyncId(s, o, r)), this.pending = !0, this.delay = r, this.id = (i = this.id) !== null && i !== void 0 ? i : this.requestAsyncId(s, this.id, r), this;
|
|
588
588
|
}, t.prototype.requestAsyncId = function(e, r, i) {
|
|
589
|
-
return i === void 0 && (i = 0),
|
|
589
|
+
return i === void 0 && (i = 0), j.setInterval(e.flush.bind(e, this), i);
|
|
590
590
|
}, t.prototype.recycleAsyncId = function(e, r, i) {
|
|
591
591
|
if (i === void 0 && (i = 0), i != null && this.delay === i && this.pending === !1)
|
|
592
592
|
return r;
|
|
593
|
-
r != null &&
|
|
593
|
+
r != null && j.clearInterval(r);
|
|
594
594
|
}, t.prototype.execute = function(e, r) {
|
|
595
595
|
if (this.closed)
|
|
596
596
|
return new Error("executing a cancelled action");
|
|
@@ -611,7 +611,7 @@ var ke = function(n) {
|
|
|
611
611
|
}, t.prototype.unsubscribe = function() {
|
|
612
612
|
if (!this.closed) {
|
|
613
613
|
var e = this, r = e.id, i = e.scheduler, o = i.actions;
|
|
614
|
-
this.work = this.state = this.scheduler = null, this.pending = !1,
|
|
614
|
+
this.work = this.state = this.scheduler = null, this.pending = !1, L(o, this), r != null && (this.id = this.recycleAsyncId(i, r, null)), this.delay = null, n.prototype.unsubscribe.call(this);
|
|
615
615
|
}
|
|
616
616
|
}, t;
|
|
617
617
|
}(qe), ae = function() {
|
|
@@ -658,7 +658,7 @@ var We = Z(function(n) {
|
|
|
658
658
|
function O(n, t) {
|
|
659
659
|
var e = typeof t == "object";
|
|
660
660
|
return new Promise(function(r, i) {
|
|
661
|
-
var o = new
|
|
661
|
+
var o = new V({
|
|
662
662
|
next: function(s) {
|
|
663
663
|
r(s), o.unsubscribe();
|
|
664
664
|
},
|
|
@@ -715,7 +715,7 @@ function Ze(n, t, e) {
|
|
|
715
715
|
}) : Ce;
|
|
716
716
|
}
|
|
717
717
|
var et = Object.defineProperty, tt = (n, t, e) => t in n ? et(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, E = (n, t, e) => (tt(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
718
|
-
class
|
|
718
|
+
class h extends Error {
|
|
719
719
|
constructor(t) {
|
|
720
720
|
super(`Incorrect context (${t}). Cannot perform the requested operation.`), E(this, "context"), this.context = t;
|
|
721
721
|
}
|
|
@@ -859,8 +859,8 @@ var re = function() {
|
|
|
859
859
|
var a = u.value;
|
|
860
860
|
a.remove(this);
|
|
861
861
|
}
|
|
862
|
-
} catch (
|
|
863
|
-
t = { error:
|
|
862
|
+
} catch (d) {
|
|
863
|
+
t = { error: d };
|
|
864
864
|
} finally {
|
|
865
865
|
try {
|
|
866
866
|
u && !u.done && (e = c.return) && e.call(c);
|
|
@@ -871,27 +871,27 @@ var re = function() {
|
|
|
871
871
|
}
|
|
872
872
|
else
|
|
873
873
|
s.remove(this);
|
|
874
|
-
var
|
|
875
|
-
if (m(
|
|
874
|
+
var f = this.initialTeardown;
|
|
875
|
+
if (m(f))
|
|
876
876
|
try {
|
|
877
|
-
|
|
878
|
-
} catch (
|
|
879
|
-
o =
|
|
877
|
+
f();
|
|
878
|
+
} catch (d) {
|
|
879
|
+
o = d instanceof B ? d.errors : [d];
|
|
880
880
|
}
|
|
881
|
-
var
|
|
882
|
-
if (
|
|
881
|
+
var g = this._finalizers;
|
|
882
|
+
if (g) {
|
|
883
883
|
this._finalizers = null;
|
|
884
884
|
try {
|
|
885
|
-
for (var w = de(
|
|
885
|
+
for (var w = de(g), y = w.next(); !y.done; y = w.next()) {
|
|
886
886
|
var D = y.value;
|
|
887
887
|
try {
|
|
888
888
|
fe(D);
|
|
889
|
-
} catch (
|
|
890
|
-
o = o ?? [],
|
|
889
|
+
} catch (d) {
|
|
890
|
+
o = o ?? [], d instanceof B ? o = K(K([], W(o)), W(d.errors)) : o.push(d);
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
|
-
} catch (
|
|
894
|
-
r = { error:
|
|
893
|
+
} catch (d) {
|
|
894
|
+
r = { error: d };
|
|
895
895
|
} finally {
|
|
896
896
|
try {
|
|
897
897
|
y && !y.done && (i = w.return) && i.call(w);
|
|
@@ -963,7 +963,7 @@ function ut(n) {
|
|
|
963
963
|
throw n;
|
|
964
964
|
});
|
|
965
965
|
}
|
|
966
|
-
function
|
|
966
|
+
function ge() {
|
|
967
967
|
}
|
|
968
968
|
function ct(n) {
|
|
969
969
|
n();
|
|
@@ -1066,9 +1066,9 @@ function ht(n) {
|
|
|
1066
1066
|
}
|
|
1067
1067
|
var dt = {
|
|
1068
1068
|
closed: !0,
|
|
1069
|
-
next:
|
|
1069
|
+
next: ge,
|
|
1070
1070
|
error: ht,
|
|
1071
|
-
complete:
|
|
1071
|
+
complete: ge
|
|
1072
1072
|
}, pt = function() {
|
|
1073
1073
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
1074
1074
|
}();
|
|
@@ -1082,7 +1082,7 @@ function ft(n) {
|
|
|
1082
1082
|
}, t);
|
|
1083
1083
|
};
|
|
1084
1084
|
}
|
|
1085
|
-
var
|
|
1085
|
+
var gt = function() {
|
|
1086
1086
|
function n(t) {
|
|
1087
1087
|
t && (this._subscribe = t);
|
|
1088
1088
|
}
|
|
@@ -1103,7 +1103,7 @@ var vt = function() {
|
|
|
1103
1103
|
}
|
|
1104
1104
|
}, n.prototype.forEach = function(t, e) {
|
|
1105
1105
|
var r = this;
|
|
1106
|
-
return e =
|
|
1106
|
+
return e = ve(e), new e(function(i, o) {
|
|
1107
1107
|
var s = new X({
|
|
1108
1108
|
next: function(c) {
|
|
1109
1109
|
try {
|
|
@@ -1128,7 +1128,7 @@ var vt = function() {
|
|
|
1128
1128
|
return ft(t)(this);
|
|
1129
1129
|
}, n.prototype.toPromise = function(t) {
|
|
1130
1130
|
var e = this;
|
|
1131
|
-
return t =
|
|
1131
|
+
return t = ve(t), new t(function(r, i) {
|
|
1132
1132
|
var o;
|
|
1133
1133
|
e.subscribe(function(s) {
|
|
1134
1134
|
return o = s;
|
|
@@ -1142,15 +1142,15 @@ var vt = function() {
|
|
|
1142
1142
|
return new n(t);
|
|
1143
1143
|
}, n;
|
|
1144
1144
|
}();
|
|
1145
|
-
function
|
|
1145
|
+
function ve(n) {
|
|
1146
1146
|
var t;
|
|
1147
1147
|
return (t = n ?? Oe.Promise) !== null && t !== void 0 ? t : Promise;
|
|
1148
1148
|
}
|
|
1149
|
-
function
|
|
1149
|
+
function vt(n) {
|
|
1150
1150
|
return n && m(n.next) && m(n.error) && m(n.complete);
|
|
1151
1151
|
}
|
|
1152
1152
|
function bt(n) {
|
|
1153
|
-
return n && n instanceof ne ||
|
|
1153
|
+
return n && n instanceof ne || vt(n) && Ie(n);
|
|
1154
1154
|
}
|
|
1155
1155
|
function H(n, t, e, r, i) {
|
|
1156
1156
|
return new yt(n, t, e, r, i);
|
|
@@ -1162,14 +1162,14 @@ var yt = function(n) {
|
|
|
1162
1162
|
return u.onFinalize = s, u.shouldUnsubscribe = c, u._next = r ? function(a) {
|
|
1163
1163
|
try {
|
|
1164
1164
|
r(a);
|
|
1165
|
-
} catch (
|
|
1166
|
-
e.error(
|
|
1165
|
+
} catch (f) {
|
|
1166
|
+
e.error(f);
|
|
1167
1167
|
}
|
|
1168
1168
|
} : n.prototype._next, u._error = o ? function(a) {
|
|
1169
1169
|
try {
|
|
1170
1170
|
o(a);
|
|
1171
|
-
} catch (
|
|
1172
|
-
e.error(
|
|
1171
|
+
} catch (f) {
|
|
1172
|
+
e.error(f);
|
|
1173
1173
|
} finally {
|
|
1174
1174
|
this.unsubscribe();
|
|
1175
1175
|
}
|
|
@@ -1199,7 +1199,7 @@ function l(n, t) {
|
|
|
1199
1199
|
}));
|
|
1200
1200
|
});
|
|
1201
1201
|
}
|
|
1202
|
-
var mt = new
|
|
1202
|
+
var mt = new gt(function(n) {
|
|
1203
1203
|
return n.complete();
|
|
1204
1204
|
});
|
|
1205
1205
|
function S(n) {
|
|
@@ -1212,7 +1212,7 @@ function S(n) {
|
|
|
1212
1212
|
}));
|
|
1213
1213
|
});
|
|
1214
1214
|
}
|
|
1215
|
-
function
|
|
1215
|
+
function v(n, t) {
|
|
1216
1216
|
return F(function(e, r) {
|
|
1217
1217
|
var i = 0;
|
|
1218
1218
|
e.subscribe(H(r, function(o) {
|
|
@@ -1220,7 +1220,7 @@ function g(n, t) {
|
|
|
1220
1220
|
}));
|
|
1221
1221
|
});
|
|
1222
1222
|
}
|
|
1223
|
-
function
|
|
1223
|
+
function p(n, t, e) {
|
|
1224
1224
|
var r = m(n) || t || e ? { next: n, error: t, complete: e } : n;
|
|
1225
1225
|
return r ? F(function(i, o) {
|
|
1226
1226
|
var s;
|
|
@@ -1326,19 +1326,19 @@ class xt {
|
|
|
1326
1326
|
*/
|
|
1327
1327
|
openBridge() {
|
|
1328
1328
|
if (!this.isEmbedded())
|
|
1329
|
-
throw new
|
|
1329
|
+
throw new h(this.currentContext);
|
|
1330
1330
|
const t = "HELLO", e = this.createMessage(t);
|
|
1331
1331
|
e.protocolVersions = this.supportedVersions, this.logCreated(t, e);
|
|
1332
1332
|
const r = this.incomingMessages$.pipe(
|
|
1333
|
-
|
|
1333
|
+
v((i) => i.type === t && i.replyTo === e.id),
|
|
1334
1334
|
l((i) => i),
|
|
1335
|
-
|
|
1335
|
+
p(this.logReceived(t)),
|
|
1336
1336
|
l((i) => {
|
|
1337
1337
|
if (this.supportedVersions.some((o) => Ct(o, i.protocolVersion)))
|
|
1338
1338
|
throw new he(i.protocolVersion, this.supportedVersions[0]);
|
|
1339
1339
|
return i;
|
|
1340
1340
|
}),
|
|
1341
|
-
|
|
1341
|
+
p((i) => {
|
|
1342
1342
|
this.negotiatedProtocolVersion = i.protocolVersion, this.logService.info(
|
|
1343
1343
|
`[IPC] Negotiated IPC Protocol Version: ${this.negotiatedProtocolVersion}`
|
|
1344
1344
|
);
|
|
@@ -1356,13 +1356,13 @@ class xt {
|
|
|
1356
1356
|
*/
|
|
1357
1357
|
requestSSOToken() {
|
|
1358
1358
|
if (!this.isEmbedded())
|
|
1359
|
-
throw new
|
|
1359
|
+
throw new h(this.currentContext);
|
|
1360
1360
|
const t = "TOKEN", e = this.createMessage(t);
|
|
1361
1361
|
this.logCreated(t, e);
|
|
1362
1362
|
const r = this.incomingMessages$.pipe(
|
|
1363
|
-
|
|
1363
|
+
v((i) => i.type === t && i.replyTo === e.id),
|
|
1364
1364
|
l((i) => i),
|
|
1365
|
-
|
|
1365
|
+
p(this.logReceived(t)),
|
|
1366
1366
|
S(1)
|
|
1367
1367
|
);
|
|
1368
1368
|
return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
|
|
@@ -1382,7 +1382,7 @@ class xt {
|
|
|
1382
1382
|
*/
|
|
1383
1383
|
sendJoiningRoomMessage(t) {
|
|
1384
1384
|
if (!this.isEmbedded())
|
|
1385
|
-
throw new
|
|
1385
|
+
throw new h(this.currentContext);
|
|
1386
1386
|
const {
|
|
1387
1387
|
roomName: e,
|
|
1388
1388
|
roomInvite: r,
|
|
@@ -1392,8 +1392,8 @@ class xt {
|
|
|
1392
1392
|
region: c,
|
|
1393
1393
|
joinMicMuted: u,
|
|
1394
1394
|
joinWithoutCamera: a
|
|
1395
|
-
} = t,
|
|
1396
|
-
|
|
1395
|
+
} = t, f = "JOINING ROOM", g = this.createMessage(f, !1);
|
|
1396
|
+
g.roomName = e, g.jwtToken = o, g.serverUrl = s, g.region = c, g.roomInvite = r, g.joinMicMuted = u ?? !1, g.joinWithoutCamera = a ?? !1, g.displayName = i, this.logCreated(f, g), this.port2.postMessage(g), this.logSent(f, g);
|
|
1397
1397
|
}
|
|
1398
1398
|
/**
|
|
1399
1399
|
* Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.
|
|
@@ -1408,7 +1408,7 @@ class xt {
|
|
|
1408
1408
|
*/
|
|
1409
1409
|
sendLeavingRoomMessage(t) {
|
|
1410
1410
|
if (!this.isEmbedded())
|
|
1411
|
-
throw new
|
|
1411
|
+
throw new h(this.currentContext);
|
|
1412
1412
|
const e = "LEAVING ROOM", r = this.createMessage(e, !1);
|
|
1413
1413
|
r.roomName = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);
|
|
1414
1414
|
}
|
|
@@ -1440,12 +1440,12 @@ class xt {
|
|
|
1440
1440
|
*/
|
|
1441
1441
|
onJoinRoomMessage() {
|
|
1442
1442
|
if (!this.isEmbedded())
|
|
1443
|
-
throw new
|
|
1443
|
+
throw new h(this.currentContext);
|
|
1444
1444
|
const t = "JOIN ROOM";
|
|
1445
1445
|
return this.incomingMessages$.pipe(
|
|
1446
|
-
|
|
1446
|
+
v((e) => e.type === t && e.target === "client"),
|
|
1447
1447
|
l((e) => e),
|
|
1448
|
-
|
|
1448
|
+
p(this.logReceived(t)),
|
|
1449
1449
|
l((e) => e)
|
|
1450
1450
|
);
|
|
1451
1451
|
}
|
|
@@ -1476,12 +1476,12 @@ class xt {
|
|
|
1476
1476
|
*/
|
|
1477
1477
|
onLeaveRoomMessage() {
|
|
1478
1478
|
if (!this.isEmbedded())
|
|
1479
|
-
throw new
|
|
1479
|
+
throw new h(this.currentContext);
|
|
1480
1480
|
const t = "LEAVE ROOM";
|
|
1481
1481
|
return this.incomingMessages$.pipe(
|
|
1482
|
-
|
|
1482
|
+
v((e) => e.type === t && e.target === "client"),
|
|
1483
1483
|
l((e) => e),
|
|
1484
|
-
|
|
1484
|
+
p(this.logReceived(t)),
|
|
1485
1485
|
l((e) => e)
|
|
1486
1486
|
);
|
|
1487
1487
|
}
|
|
@@ -1513,12 +1513,12 @@ class xt {
|
|
|
1513
1513
|
*/
|
|
1514
1514
|
onConfigMessage() {
|
|
1515
1515
|
if (!this.isEmbedded())
|
|
1516
|
-
throw new
|
|
1516
|
+
throw new h(this.currentContext);
|
|
1517
1517
|
const t = "CONFIG";
|
|
1518
1518
|
return this.incomingMessages$.pipe(
|
|
1519
|
-
|
|
1519
|
+
v((e) => e.type === t && e.target === "client"),
|
|
1520
1520
|
l((e) => e),
|
|
1521
|
-
|
|
1521
|
+
p(this.logReceived(t)),
|
|
1522
1522
|
l((e) => ({
|
|
1523
1523
|
preferredCameraType: e.preferredCameraType,
|
|
1524
1524
|
preferredMicType: e.preferredMicType,
|
|
@@ -1535,13 +1535,13 @@ class xt {
|
|
|
1535
1535
|
}
|
|
1536
1536
|
sendScreenshareSourceMessage(t) {
|
|
1537
1537
|
if (!this.isEmbedded())
|
|
1538
|
-
throw new
|
|
1538
|
+
throw new h(this.currentContext);
|
|
1539
1539
|
const e = "SCREENSHARE SOURCE", r = this.createMessage(e);
|
|
1540
1540
|
r.sourceTypes = t, this.logCreated(e, r);
|
|
1541
1541
|
const i = this.incomingMessages$.pipe(
|
|
1542
|
-
|
|
1542
|
+
v((o) => o.type === e && o.replyTo === r.id),
|
|
1543
1543
|
l((o) => o),
|
|
1544
|
-
|
|
1544
|
+
p(this.logReceived(e)),
|
|
1545
1545
|
l((o) => o),
|
|
1546
1546
|
S(1)
|
|
1547
1547
|
);
|
|
@@ -1549,13 +1549,13 @@ class xt {
|
|
|
1549
1549
|
}
|
|
1550
1550
|
layoutChange(t, e, r) {
|
|
1551
1551
|
if (!this.isEmbedded())
|
|
1552
|
-
throw new
|
|
1552
|
+
throw new h(this.currentContext);
|
|
1553
1553
|
const i = "LAYOUT CHANGE";
|
|
1554
1554
|
let o, s;
|
|
1555
1555
|
if (e && r ? (o = this.createMessage(i, !1, r), o.result = e) : (o = this.createMessage(i), s = this.incomingMessages$.pipe(
|
|
1556
|
-
|
|
1556
|
+
v((c) => c.type === i && c.replyTo === o.id),
|
|
1557
1557
|
l((c) => c),
|
|
1558
|
-
|
|
1558
|
+
p(this.logReceived(i)),
|
|
1559
1559
|
l((c) => c),
|
|
1560
1560
|
S(1)
|
|
1561
1561
|
), this.logService.debug(`Created ${i} Reply handler`)), o.layout = t, this.logCreated(i, o), this.port2.postMessage(o), this.logSent(i, o), s)
|
|
@@ -1594,38 +1594,38 @@ class xt {
|
|
|
1594
1594
|
*/
|
|
1595
1595
|
onLayoutChangeMessage() {
|
|
1596
1596
|
if (!this.isEmbedded())
|
|
1597
|
-
throw new
|
|
1597
|
+
throw new h(this.currentContext);
|
|
1598
1598
|
const t = "LAYOUT CHANGE";
|
|
1599
1599
|
return this.incomingMessages$.pipe(
|
|
1600
|
-
|
|
1600
|
+
v((e) => e.type === t && e.target === "client" && e.replyTo === null),
|
|
1601
1601
|
l((e) => e),
|
|
1602
|
-
|
|
1602
|
+
p(this.logReceived(t)),
|
|
1603
1603
|
l((e) => e)
|
|
1604
1604
|
);
|
|
1605
1605
|
}
|
|
1606
1606
|
requestOAuthToken(t) {
|
|
1607
1607
|
if (!this.isEmbedded())
|
|
1608
|
-
throw new
|
|
1608
|
+
throw new h(this.currentContext);
|
|
1609
1609
|
Array.isArray(t) || (t = [t]);
|
|
1610
1610
|
const e = "OAUTH TOKEN", r = this.createMessage(e);
|
|
1611
1611
|
r.providerTypes = t, this.logCreated(e, r);
|
|
1612
1612
|
const i = this.incomingMessages$.pipe(
|
|
1613
|
-
|
|
1613
|
+
v((o) => o.type === e && o.replyTo === r.id),
|
|
1614
1614
|
l((o) => o),
|
|
1615
|
-
|
|
1615
|
+
p(this.logReceived(e)),
|
|
1616
1616
|
S(1)
|
|
1617
1617
|
);
|
|
1618
1618
|
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
|
|
1619
1619
|
}
|
|
1620
1620
|
openUrl(t, e) {
|
|
1621
1621
|
if (!this.isEmbedded())
|
|
1622
|
-
throw new
|
|
1622
|
+
throw new h(this.currentContext);
|
|
1623
1623
|
const r = "OPEN URL", i = this.createMessage(r, !1);
|
|
1624
1624
|
i.url = t, i.data = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
|
|
1625
1625
|
}
|
|
1626
1626
|
selectContacts(t, e, r) {
|
|
1627
1627
|
if (!this.isEmbedded())
|
|
1628
|
-
throw new
|
|
1628
|
+
throw new h(this.currentContext);
|
|
1629
1629
|
if (e === "group" && r === void 0)
|
|
1630
1630
|
throw new $(
|
|
1631
1631
|
"currentContacts",
|
|
@@ -1641,8 +1641,8 @@ class xt {
|
|
|
1641
1641
|
const i = "SELECT CONTACTS", o = this.createMessage(i, !0);
|
|
1642
1642
|
o.streamType = e, o.streamId = t, o.currentContacts = r, this.logCreated(i, o);
|
|
1643
1643
|
const s = this.incomingMessages$.pipe(
|
|
1644
|
-
|
|
1645
|
-
|
|
1644
|
+
v((c) => c.type === i && c.replyTo === o.id),
|
|
1645
|
+
p(this.logReceived(i)),
|
|
1646
1646
|
// validate if `streamId` is the same as we sent
|
|
1647
1647
|
l((c) => {
|
|
1648
1648
|
const u = c;
|
|
@@ -1664,14 +1664,14 @@ class xt {
|
|
|
1664
1664
|
*/
|
|
1665
1665
|
matchContacts(t) {
|
|
1666
1666
|
if (!this.isEmbedded())
|
|
1667
|
-
throw new
|
|
1667
|
+
throw new h(this.currentContext);
|
|
1668
1668
|
if (!t.length)
|
|
1669
1669
|
throw new $("contacts", t, "At least one contact is required");
|
|
1670
1670
|
const e = "MATCH CONTACTS", r = this.createMessage(e);
|
|
1671
1671
|
r.contacts = [...t], this.logCreated(e, r);
|
|
1672
1672
|
const i = this.incomingMessages$.pipe(
|
|
1673
|
-
|
|
1674
|
-
|
|
1673
|
+
v((o) => o.type === e && o.replyTo === r.id),
|
|
1674
|
+
p(this.logReceived(e)),
|
|
1675
1675
|
l((o) => o),
|
|
1676
1676
|
S(1)
|
|
1677
1677
|
);
|
|
@@ -1705,12 +1705,12 @@ class xt {
|
|
|
1705
1705
|
*/
|
|
1706
1706
|
onPushMessageMessage() {
|
|
1707
1707
|
if (!this.isEmbedded())
|
|
1708
|
-
throw new
|
|
1708
|
+
throw new h(this.currentContext);
|
|
1709
1709
|
const t = "PUSH MESSAGE";
|
|
1710
1710
|
return this.incomingMessages$.pipe(
|
|
1711
|
-
|
|
1711
|
+
v((e) => e.type === t && e.target === "client"),
|
|
1712
1712
|
l((e) => e),
|
|
1713
|
-
|
|
1713
|
+
p(this.logReceived(t))
|
|
1714
1714
|
);
|
|
1715
1715
|
}
|
|
1716
1716
|
/**
|
|
@@ -1724,12 +1724,12 @@ class xt {
|
|
|
1724
1724
|
*/
|
|
1725
1725
|
requestPushToken() {
|
|
1726
1726
|
if (!this.isEmbedded())
|
|
1727
|
-
throw new
|
|
1727
|
+
throw new h(this.currentContext);
|
|
1728
1728
|
const t = "PUSH TOKEN", e = this.createMessage(t);
|
|
1729
1729
|
this.logCreated(t, e);
|
|
1730
1730
|
const r = this.incomingMessages$.pipe(
|
|
1731
|
-
|
|
1732
|
-
|
|
1731
|
+
v((i) => i.type === t && i.replyTo === e.id),
|
|
1732
|
+
p(this.logReceived(t)),
|
|
1733
1733
|
l((i) => i),
|
|
1734
1734
|
S(1)
|
|
1735
1735
|
);
|
|
@@ -1744,12 +1744,12 @@ class xt {
|
|
|
1744
1744
|
*/
|
|
1745
1745
|
onBadgeQueryMessage() {
|
|
1746
1746
|
if (!this.isEmbedded())
|
|
1747
|
-
throw new
|
|
1747
|
+
throw new h(this.currentContext);
|
|
1748
1748
|
const t = "BADGE QUERY";
|
|
1749
1749
|
return this.incomingMessages$.pipe(
|
|
1750
|
-
|
|
1750
|
+
v((e) => e.type === t && e.target === "client"),
|
|
1751
1751
|
l((e) => e),
|
|
1752
|
-
|
|
1752
|
+
p(this.logReceived(t))
|
|
1753
1753
|
);
|
|
1754
1754
|
}
|
|
1755
1755
|
/**
|
|
@@ -1765,7 +1765,7 @@ class xt {
|
|
|
1765
1765
|
*/
|
|
1766
1766
|
sendBadgeUpdateMessage(t, e) {
|
|
1767
1767
|
if (!this.isEmbedded())
|
|
1768
|
-
throw new
|
|
1768
|
+
throw new h(this.currentContext);
|
|
1769
1769
|
const r = "BADGE UPDATE", i = this.createMessage(r, !1, e);
|
|
1770
1770
|
i.count = t, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
|
|
1771
1771
|
}
|
|
@@ -1782,12 +1782,12 @@ class xt {
|
|
|
1782
1782
|
*/
|
|
1783
1783
|
onHostInForegroundMessage() {
|
|
1784
1784
|
if (!this.isEmbedded())
|
|
1785
|
-
throw new
|
|
1785
|
+
throw new h(this.currentContext);
|
|
1786
1786
|
const t = "HOST IN FOREGROUND";
|
|
1787
1787
|
return this.incomingMessages$.pipe(
|
|
1788
|
-
|
|
1788
|
+
v((e) => e.type === t && e.target === "client"),
|
|
1789
1789
|
l((e) => e),
|
|
1790
|
-
|
|
1790
|
+
p(this.logReceived(t))
|
|
1791
1791
|
);
|
|
1792
1792
|
}
|
|
1793
1793
|
/**
|
|
@@ -1805,10 +1805,31 @@ class xt {
|
|
|
1805
1805
|
*/
|
|
1806
1806
|
sendLifecycleMessage(t, e) {
|
|
1807
1807
|
if (!this.isEmbedded())
|
|
1808
|
-
throw new
|
|
1808
|
+
throw new h(this.currentContext);
|
|
1809
1809
|
const r = "LIFECYCLE", i = this.createMessage(r, !1);
|
|
1810
1810
|
i.eventName = t, i.payload = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
|
|
1811
1811
|
}
|
|
1812
|
+
/**
|
|
1813
|
+
* Setup listener for {@link LifecycleMessage}, which can be sent by a `Host` app to notify the
|
|
1814
|
+
* `Client` app of a lifecycle event.
|
|
1815
|
+
*
|
|
1816
|
+
* @remarks
|
|
1817
|
+
* This message is used to notify the Client app of a lifecycle event, such as the host app
|
|
1818
|
+
* re-establishing a connection with it's server after being offline.
|
|
1819
|
+
*
|
|
1820
|
+
* @returns An observable that emits whenever {@link LifecycleMessage} is received so it can be
|
|
1821
|
+
* subscribed to indefinitely.
|
|
1822
|
+
*/
|
|
1823
|
+
onLifecycleMessage() {
|
|
1824
|
+
if (!this.isEmbedded())
|
|
1825
|
+
throw new h(this.currentContext);
|
|
1826
|
+
const t = "LIFECYCLE";
|
|
1827
|
+
return this.incomingMessages$.pipe(
|
|
1828
|
+
v((e) => e.type === t && e.target === "client"),
|
|
1829
|
+
l((e) => e),
|
|
1830
|
+
p(this.logReceived(t))
|
|
1831
|
+
);
|
|
1832
|
+
}
|
|
1812
1833
|
/**
|
|
1813
1834
|
* Sends a {@link LogMessage} to the Host app, to add to it's application logs.
|
|
1814
1835
|
*
|
|
@@ -1823,7 +1844,7 @@ class xt {
|
|
|
1823
1844
|
*/
|
|
1824
1845
|
sendLogMessage(t, e) {
|
|
1825
1846
|
if (!this.isEmbedded())
|
|
1826
|
-
throw new
|
|
1847
|
+
throw new h(this.currentContext);
|
|
1827
1848
|
const r = "LOG", i = this.createMessage(r, !1);
|
|
1828
1849
|
i.level = t, i.message = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
|
|
1829
1850
|
}
|
|
@@ -1841,12 +1862,12 @@ class xt {
|
|
|
1841
1862
|
*/
|
|
1842
1863
|
onRequestLogsMessage() {
|
|
1843
1864
|
if (!this.isEmbedded())
|
|
1844
|
-
throw new
|
|
1865
|
+
throw new h(this.currentContext);
|
|
1845
1866
|
const t = "REQUEST LOGS";
|
|
1846
1867
|
return this.incomingMessages$.pipe(
|
|
1847
|
-
|
|
1868
|
+
v((e) => e.type === t && e.target === "client"),
|
|
1848
1869
|
l((e) => e),
|
|
1849
|
-
|
|
1870
|
+
p(this.logReceived(t))
|
|
1850
1871
|
);
|
|
1851
1872
|
}
|
|
1852
1873
|
/**
|
|
@@ -1864,7 +1885,7 @@ class xt {
|
|
|
1864
1885
|
*/
|
|
1865
1886
|
sendViewTransitionMessage(t, e) {
|
|
1866
1887
|
if (!this.isEmbedded())
|
|
1867
|
-
throw new
|
|
1888
|
+
throw new h(this.currentContext);
|
|
1868
1889
|
const r = "VIEW TRANSITION", i = this.createMessage(r, !1);
|
|
1869
1890
|
i.transitionType = t, i.targetView = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
|
|
1870
1891
|
}
|