@acrobits/ipc-sdk 0.11.2-alpha.7 → 0.11.2-alpha.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/docs/classes/IPCManager.html +24 -24
- package/docs/types/HostType.html +1 -1
- package/docs/types/IpcProtocolVersion.html +1 -1
- package/docs/types/UriContactItem.html +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/ipc-sdk.js +328 -284
- package/lib/ipc-sdk.js.map +1 -1
- package/lib/ipc-sdk.umd.cjs +3 -3
- package/lib/ipc-sdk.umd.cjs.map +1 -1
- package/package.json +2 -2
package/lib/ipc-sdk.js
CHANGED
|
@@ -38,8 +38,8 @@ function $(s, t) {
|
|
|
38
38
|
try {
|
|
39
39
|
for (; (t === void 0 || t-- > 0) && !(n = r.next()).done; )
|
|
40
40
|
i.push(n.value);
|
|
41
|
-
} catch (
|
|
42
|
-
o = { error:
|
|
41
|
+
} catch (a) {
|
|
42
|
+
o = { error: a };
|
|
43
43
|
} finally {
|
|
44
44
|
try {
|
|
45
45
|
n && !n.done && (e = r.return) && e.call(r);
|
|
@@ -92,15 +92,15 @@ var x = function() {
|
|
|
92
92
|
if (o)
|
|
93
93
|
if (this._parentage = null, Array.isArray(o))
|
|
94
94
|
try {
|
|
95
|
-
for (var
|
|
96
|
-
var
|
|
97
|
-
|
|
95
|
+
for (var a = Q(o), c = a.next(); !c.done; c = a.next()) {
|
|
96
|
+
var l = c.value;
|
|
97
|
+
l.remove(this);
|
|
98
98
|
}
|
|
99
99
|
} catch (v) {
|
|
100
100
|
t = { error: v };
|
|
101
101
|
} finally {
|
|
102
102
|
try {
|
|
103
|
-
|
|
103
|
+
c && !c.done && (e = a.return) && e.call(a);
|
|
104
104
|
} finally {
|
|
105
105
|
if (t)
|
|
106
106
|
throw t.error;
|
|
@@ -115,11 +115,11 @@ var x = function() {
|
|
|
115
115
|
} catch (v) {
|
|
116
116
|
i = v instanceof V ? v.errors : [v];
|
|
117
117
|
}
|
|
118
|
-
var
|
|
119
|
-
if (
|
|
118
|
+
var u = this._finalizers;
|
|
119
|
+
if (u) {
|
|
120
120
|
this._finalizers = null;
|
|
121
121
|
try {
|
|
122
|
-
for (var b = Q(
|
|
122
|
+
for (var b = Q(u), p = b.next(); !p.done; p = b.next()) {
|
|
123
123
|
var F = p.value;
|
|
124
124
|
try {
|
|
125
125
|
se(F);
|
|
@@ -282,13 +282,13 @@ var Oe = function() {
|
|
|
282
282
|
complete: n ?? void 0
|
|
283
283
|
};
|
|
284
284
|
else {
|
|
285
|
-
var
|
|
286
|
-
i && we.useDeprecatedNextContext ? (
|
|
285
|
+
var a;
|
|
286
|
+
i && we.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {
|
|
287
287
|
return i.unsubscribe();
|
|
288
288
|
}, o = {
|
|
289
|
-
next: e.next && H(e.next,
|
|
290
|
-
error: e.error && H(e.error,
|
|
291
|
-
complete: e.complete && H(e.complete,
|
|
289
|
+
next: e.next && H(e.next, a),
|
|
290
|
+
error: e.error && H(e.error, a),
|
|
291
|
+
complete: e.complete && H(e.complete, a)
|
|
292
292
|
}) : o = e;
|
|
293
293
|
}
|
|
294
294
|
return i.destination = new Oe(o), i;
|
|
@@ -329,8 +329,8 @@ var G = function() {
|
|
|
329
329
|
}, s.prototype.subscribe = function(t, e, r) {
|
|
330
330
|
var n = this, i = Ve(t) ? t : new N(t, e, r);
|
|
331
331
|
return O(function() {
|
|
332
|
-
var o = n,
|
|
333
|
-
i.add(
|
|
332
|
+
var o = n, a = o.operator, c = o.source;
|
|
333
|
+
i.add(a ? a.call(i, c) : c ? n._subscribe(i) : n._trySubscribe(i));
|
|
334
334
|
}), i;
|
|
335
335
|
}, s.prototype._trySubscribe = function(t) {
|
|
336
336
|
try {
|
|
@@ -342,11 +342,11 @@ var G = function() {
|
|
|
342
342
|
var r = this;
|
|
343
343
|
return e = ie(e), new e(function(n, i) {
|
|
344
344
|
var o = new N({
|
|
345
|
-
next: function(
|
|
345
|
+
next: function(a) {
|
|
346
346
|
try {
|
|
347
|
-
t(
|
|
348
|
-
} catch (
|
|
349
|
-
i(
|
|
347
|
+
t(a);
|
|
348
|
+
} catch (c) {
|
|
349
|
+
i(c), o.unsubscribe();
|
|
350
350
|
}
|
|
351
351
|
},
|
|
352
352
|
error: i,
|
|
@@ -410,31 +410,31 @@ function Me(s, t, e, r, n) {
|
|
|
410
410
|
}
|
|
411
411
|
var je = function(s) {
|
|
412
412
|
U(t, s);
|
|
413
|
-
function t(e, r, n, i, o,
|
|
414
|
-
var
|
|
415
|
-
return
|
|
413
|
+
function t(e, r, n, i, o, a) {
|
|
414
|
+
var c = s.call(this, e) || this;
|
|
415
|
+
return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(l) {
|
|
416
416
|
try {
|
|
417
|
-
r(
|
|
417
|
+
r(l);
|
|
418
418
|
} catch (h) {
|
|
419
419
|
e.error(h);
|
|
420
420
|
}
|
|
421
|
-
} : s.prototype._next,
|
|
421
|
+
} : s.prototype._next, c._error = i ? function(l) {
|
|
422
422
|
try {
|
|
423
|
-
i(
|
|
423
|
+
i(l);
|
|
424
424
|
} catch (h) {
|
|
425
425
|
e.error(h);
|
|
426
426
|
} finally {
|
|
427
427
|
this.unsubscribe();
|
|
428
428
|
}
|
|
429
|
-
} : s.prototype._error,
|
|
429
|
+
} : s.prototype._error, c._complete = n ? function() {
|
|
430
430
|
try {
|
|
431
431
|
n();
|
|
432
|
-
} catch (
|
|
433
|
-
e.error(
|
|
432
|
+
} catch (l) {
|
|
433
|
+
e.error(l);
|
|
434
434
|
} finally {
|
|
435
435
|
this.unsubscribe();
|
|
436
436
|
}
|
|
437
|
-
} : s.prototype._complete,
|
|
437
|
+
} : s.prototype._complete, c;
|
|
438
438
|
}
|
|
439
439
|
return t.prototype.unsubscribe = function() {
|
|
440
440
|
var e;
|
|
@@ -466,15 +466,15 @@ var je = function(s) {
|
|
|
466
466
|
if (r._throwIfClosed(), !r.isStopped) {
|
|
467
467
|
r.currentObservers || (r.currentObservers = Array.from(r.observers));
|
|
468
468
|
try {
|
|
469
|
-
for (var o = Q(r.currentObservers),
|
|
470
|
-
var
|
|
471
|
-
|
|
469
|
+
for (var o = Q(r.currentObservers), a = o.next(); !a.done; a = o.next()) {
|
|
470
|
+
var c = a.value;
|
|
471
|
+
c.next(e);
|
|
472
472
|
}
|
|
473
|
-
} catch (
|
|
474
|
-
n = { error:
|
|
473
|
+
} catch (l) {
|
|
474
|
+
n = { error: l };
|
|
475
475
|
} finally {
|
|
476
476
|
try {
|
|
477
|
-
|
|
477
|
+
a && !a.done && (i = o.return) && i.call(o);
|
|
478
478
|
} finally {
|
|
479
479
|
if (n)
|
|
480
480
|
throw n.error;
|
|
@@ -514,9 +514,9 @@ var je = function(s) {
|
|
|
514
514
|
}, t.prototype._subscribe = function(e) {
|
|
515
515
|
return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
|
|
516
516
|
}, t.prototype._innerSubscribe = function(e) {
|
|
517
|
-
var r = this, n = this, i = n.hasError, o = n.isStopped,
|
|
518
|
-
return i || o ? ve : (this.currentObservers = null,
|
|
519
|
-
r.currentObservers = null, D(
|
|
517
|
+
var r = this, n = this, i = n.hasError, o = n.isStopped, a = n.observers;
|
|
518
|
+
return i || o ? ve : (this.currentObservers = null, a.push(e), new x(function() {
|
|
519
|
+
r.currentObservers = null, D(a, e);
|
|
520
520
|
}));
|
|
521
521
|
}, t.prototype._checkFinalizedStatuses = function(e) {
|
|
522
522
|
var r = this, n = r.hasError, i = r.thrownError, o = r.isStopped;
|
|
@@ -696,19 +696,19 @@ function et(s, t, e) {
|
|
|
696
696
|
return r ? Ee(function(n, i) {
|
|
697
697
|
var o;
|
|
698
698
|
(o = r.subscribe) === null || o === void 0 || o.call(r);
|
|
699
|
-
var
|
|
700
|
-
n.subscribe(Me(i, function(
|
|
701
|
-
var
|
|
702
|
-
(
|
|
699
|
+
var a = !0;
|
|
700
|
+
n.subscribe(Me(i, function(c) {
|
|
701
|
+
var l;
|
|
702
|
+
(l = r.next) === null || l === void 0 || l.call(r, c), i.next(c);
|
|
703
703
|
}, function() {
|
|
704
|
-
var
|
|
705
|
-
|
|
706
|
-
}, function(
|
|
707
|
-
var
|
|
708
|
-
|
|
704
|
+
var c;
|
|
705
|
+
a = !1, (c = r.complete) === null || c === void 0 || c.call(r), i.complete();
|
|
706
|
+
}, function(c) {
|
|
707
|
+
var l;
|
|
708
|
+
a = !1, (l = r.error) === null || l === void 0 || l.call(r, c), i.error(c);
|
|
709
709
|
}, function() {
|
|
710
|
-
var
|
|
711
|
-
|
|
710
|
+
var c, l;
|
|
711
|
+
a && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (l = r.finalize) === null || l === void 0 || l.call(r);
|
|
712
712
|
}));
|
|
713
713
|
}) : Ce;
|
|
714
714
|
}
|
|
@@ -718,7 +718,7 @@ class d extends Error {
|
|
|
718
718
|
super(`Incorrect context (${t}). Cannot perform the requested operation.`), I(this, "context"), this.context = t;
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
|
-
class
|
|
721
|
+
class m extends Error {
|
|
722
722
|
constructor(t, e, r) {
|
|
723
723
|
super(`Invalid parameter (${t}). ${r}`), this.param = t, this.value = e, this.reason = r;
|
|
724
724
|
}
|
|
@@ -735,12 +735,12 @@ class st extends Error {
|
|
|
735
735
|
super(`Invalid version format: ${t}`);
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
|
-
class
|
|
738
|
+
class le extends Error {
|
|
739
739
|
constructor(t) {
|
|
740
740
|
super(`${t} needs to be initialized before it can be used.`);
|
|
741
741
|
}
|
|
742
742
|
}
|
|
743
|
-
class
|
|
743
|
+
class ue extends Error {
|
|
744
744
|
constructor(t, e) {
|
|
745
745
|
let r = `Unsupported Protocol ${Array.isArray(t) ? "versions" : "version"}: (${t}).`;
|
|
746
746
|
e && (r += ` Minimum version supported is ${e}.`), super(r), this.version = t;
|
|
@@ -802,8 +802,8 @@ function J(s, t) {
|
|
|
802
802
|
try {
|
|
803
803
|
for (; (t === void 0 || t-- > 0) && !(n = r.next()).done; )
|
|
804
804
|
i.push(n.value);
|
|
805
|
-
} catch (
|
|
806
|
-
o = { error:
|
|
805
|
+
} catch (a) {
|
|
806
|
+
o = { error: a };
|
|
807
807
|
} finally {
|
|
808
808
|
try {
|
|
809
809
|
n && !n.done && (e = r.return) && e.call(r);
|
|
@@ -853,15 +853,15 @@ var te = function() {
|
|
|
853
853
|
if (o)
|
|
854
854
|
if (this._parentage = null, Array.isArray(o))
|
|
855
855
|
try {
|
|
856
|
-
for (var
|
|
857
|
-
var
|
|
858
|
-
|
|
856
|
+
for (var a = he(o), c = a.next(); !c.done; c = a.next()) {
|
|
857
|
+
var l = c.value;
|
|
858
|
+
l.remove(this);
|
|
859
859
|
}
|
|
860
860
|
} catch (v) {
|
|
861
861
|
t = { error: v };
|
|
862
862
|
} finally {
|
|
863
863
|
try {
|
|
864
|
-
|
|
864
|
+
c && !c.done && (e = a.return) && e.call(a);
|
|
865
865
|
} finally {
|
|
866
866
|
if (t)
|
|
867
867
|
throw t.error;
|
|
@@ -876,11 +876,11 @@ var te = function() {
|
|
|
876
876
|
} catch (v) {
|
|
877
877
|
i = v instanceof j ? v.errors : [v];
|
|
878
878
|
}
|
|
879
|
-
var
|
|
880
|
-
if (
|
|
879
|
+
var u = this._finalizers;
|
|
880
|
+
if (u) {
|
|
881
881
|
this._finalizers = null;
|
|
882
882
|
try {
|
|
883
|
-
for (var b = he(
|
|
883
|
+
for (var b = he(u), p = b.next(); !p.done; p = b.next()) {
|
|
884
884
|
var F = p.value;
|
|
885
885
|
try {
|
|
886
886
|
pe(F);
|
|
@@ -997,11 +997,11 @@ var re = function(s) {
|
|
|
997
997
|
this.unsubscribe();
|
|
998
998
|
}
|
|
999
999
|
}, t;
|
|
1000
|
-
}(te),
|
|
1000
|
+
}(te), lt = Function.prototype.bind;
|
|
1001
1001
|
function q(s, t) {
|
|
1002
|
-
return
|
|
1002
|
+
return lt.call(s, t);
|
|
1003
1003
|
}
|
|
1004
|
-
var
|
|
1004
|
+
var ut = function() {
|
|
1005
1005
|
function s(t) {
|
|
1006
1006
|
this.partialObserver = t;
|
|
1007
1007
|
}
|
|
@@ -1043,16 +1043,16 @@ var lt = function() {
|
|
|
1043
1043
|
complete: n ?? void 0
|
|
1044
1044
|
};
|
|
1045
1045
|
else {
|
|
1046
|
-
var
|
|
1047
|
-
i && Te.useDeprecatedNextContext ? (
|
|
1046
|
+
var a;
|
|
1047
|
+
i && Te.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {
|
|
1048
1048
|
return i.unsubscribe();
|
|
1049
1049
|
}, o = {
|
|
1050
|
-
next: e.next && q(e.next,
|
|
1051
|
-
error: e.error && q(e.error,
|
|
1052
|
-
complete: e.complete && q(e.complete,
|
|
1050
|
+
next: e.next && q(e.next, a),
|
|
1051
|
+
error: e.error && q(e.error, a),
|
|
1052
|
+
complete: e.complete && q(e.complete, a)
|
|
1053
1053
|
}) : o = e;
|
|
1054
1054
|
}
|
|
1055
|
-
return i.destination = new
|
|
1055
|
+
return i.destination = new ut(o), i;
|
|
1056
1056
|
}
|
|
1057
1057
|
return t;
|
|
1058
1058
|
}(re);
|
|
@@ -1088,10 +1088,10 @@ var gt = function() {
|
|
|
1088
1088
|
var e = new s();
|
|
1089
1089
|
return e.source = this, e.operator = t, e;
|
|
1090
1090
|
}, s.prototype.subscribe = function(t, e, r) {
|
|
1091
|
-
var n = this, i =
|
|
1091
|
+
var n = this, i = mt(t) ? t : new K(t, e, r);
|
|
1092
1092
|
return at(function() {
|
|
1093
|
-
var o = n,
|
|
1094
|
-
i.add(
|
|
1093
|
+
var o = n, a = o.operator, c = o.source;
|
|
1094
|
+
i.add(a ? a.call(i, c) : c ? n._subscribe(i) : n._trySubscribe(i));
|
|
1095
1095
|
}), i;
|
|
1096
1096
|
}, s.prototype._trySubscribe = function(t) {
|
|
1097
1097
|
try {
|
|
@@ -1103,11 +1103,11 @@ var gt = function() {
|
|
|
1103
1103
|
var r = this;
|
|
1104
1104
|
return e = ge(e), new e(function(n, i) {
|
|
1105
1105
|
var o = new K({
|
|
1106
|
-
next: function(
|
|
1106
|
+
next: function(a) {
|
|
1107
1107
|
try {
|
|
1108
|
-
t(
|
|
1109
|
-
} catch (
|
|
1110
|
-
i(
|
|
1108
|
+
t(a);
|
|
1109
|
+
} catch (c) {
|
|
1110
|
+
i(c), o.unsubscribe();
|
|
1111
1111
|
}
|
|
1112
1112
|
},
|
|
1113
1113
|
error: i,
|
|
@@ -1144,42 +1144,42 @@ function ge(s) {
|
|
|
1144
1144
|
var t;
|
|
1145
1145
|
return (t = s ?? Te.Promise) !== null && t !== void 0 ? t : Promise;
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1147
|
+
function yt(s) {
|
|
1148
1148
|
return s && E(s.next) && E(s.error) && E(s.complete);
|
|
1149
1149
|
}
|
|
1150
|
-
function
|
|
1151
|
-
return s && s instanceof re ||
|
|
1150
|
+
function mt(s) {
|
|
1151
|
+
return s && s instanceof re || yt(s) && Ue(s);
|
|
1152
1152
|
}
|
|
1153
1153
|
function P(s, t, e, r, n) {
|
|
1154
1154
|
return new vt(s, t, e, r, n);
|
|
1155
1155
|
}
|
|
1156
1156
|
var vt = function(s) {
|
|
1157
1157
|
ee(t, s);
|
|
1158
|
-
function t(e, r, n, i, o,
|
|
1159
|
-
var
|
|
1160
|
-
return
|
|
1158
|
+
function t(e, r, n, i, o, a) {
|
|
1159
|
+
var c = s.call(this, e) || this;
|
|
1160
|
+
return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(l) {
|
|
1161
1161
|
try {
|
|
1162
|
-
r(
|
|
1162
|
+
r(l);
|
|
1163
1163
|
} catch (h) {
|
|
1164
1164
|
e.error(h);
|
|
1165
1165
|
}
|
|
1166
|
-
} : s.prototype._next,
|
|
1166
|
+
} : s.prototype._next, c._error = i ? function(l) {
|
|
1167
1167
|
try {
|
|
1168
|
-
i(
|
|
1168
|
+
i(l);
|
|
1169
1169
|
} catch (h) {
|
|
1170
1170
|
e.error(h);
|
|
1171
1171
|
} finally {
|
|
1172
1172
|
this.unsubscribe();
|
|
1173
1173
|
}
|
|
1174
|
-
} : s.prototype._error,
|
|
1174
|
+
} : s.prototype._error, c._complete = n ? function() {
|
|
1175
1175
|
try {
|
|
1176
1176
|
n();
|
|
1177
|
-
} catch (
|
|
1178
|
-
e.error(
|
|
1177
|
+
} catch (l) {
|
|
1178
|
+
e.error(l);
|
|
1179
1179
|
} finally {
|
|
1180
1180
|
this.unsubscribe();
|
|
1181
1181
|
}
|
|
1182
|
-
} : s.prototype._complete,
|
|
1182
|
+
} : s.prototype._complete, c;
|
|
1183
1183
|
}
|
|
1184
1184
|
return t.prototype.unsubscribe = function() {
|
|
1185
1185
|
var e;
|
|
@@ -1210,7 +1210,7 @@ function w(s) {
|
|
|
1210
1210
|
}));
|
|
1211
1211
|
});
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1213
|
+
function y(s, t) {
|
|
1214
1214
|
return R(function(e, r) {
|
|
1215
1215
|
var n = 0;
|
|
1216
1216
|
e.subscribe(P(r, function(i) {
|
|
@@ -1232,19 +1232,19 @@ function g(s, t, e) {
|
|
|
1232
1232
|
return r ? R(function(n, i) {
|
|
1233
1233
|
var o;
|
|
1234
1234
|
(o = r.subscribe) === null || o === void 0 || o.call(r);
|
|
1235
|
-
var
|
|
1236
|
-
n.subscribe(P(i, function(
|
|
1237
|
-
var
|
|
1238
|
-
(
|
|
1235
|
+
var a = !0;
|
|
1236
|
+
n.subscribe(P(i, function(c) {
|
|
1237
|
+
var l;
|
|
1238
|
+
(l = r.next) === null || l === void 0 || l.call(r, c), i.next(c);
|
|
1239
1239
|
}, function() {
|
|
1240
|
-
var
|
|
1241
|
-
|
|
1242
|
-
}, function(
|
|
1243
|
-
var
|
|
1244
|
-
|
|
1240
|
+
var c;
|
|
1241
|
+
a = !1, (c = r.complete) === null || c === void 0 || c.call(r), i.complete();
|
|
1242
|
+
}, function(c) {
|
|
1243
|
+
var l;
|
|
1244
|
+
a = !1, (l = r.error) === null || l === void 0 || l.call(r, c), i.error(c);
|
|
1245
1245
|
}, function() {
|
|
1246
|
-
var
|
|
1247
|
-
|
|
1246
|
+
var c, l;
|
|
1247
|
+
a && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (l = r.finalize) === null || l === void 0 || l.call(r);
|
|
1248
1248
|
}));
|
|
1249
1249
|
}) : xe;
|
|
1250
1250
|
}
|
|
@@ -1257,18 +1257,18 @@ function Ct(s) {
|
|
|
1257
1257
|
}
|
|
1258
1258
|
throw new st(s);
|
|
1259
1259
|
}
|
|
1260
|
-
function
|
|
1260
|
+
function ye(s) {
|
|
1261
1261
|
const t = Ct(s), [e, r] = t.split("."), [n, i] = [parseInt(e), parseInt(r)];
|
|
1262
1262
|
return [n, i];
|
|
1263
1263
|
}
|
|
1264
1264
|
function Re(s, t) {
|
|
1265
|
-
const [e, r] =
|
|
1265
|
+
const [e, r] = ye(s), [n, i] = ye(t);
|
|
1266
1266
|
return e < n ? -1 : e > n ? 1 : r < i ? -1 : r > i ? 1 : 0;
|
|
1267
1267
|
}
|
|
1268
1268
|
function Et(s, t) {
|
|
1269
1269
|
return Re(s, t) >= 0;
|
|
1270
1270
|
}
|
|
1271
|
-
const
|
|
1271
|
+
const me = "2.0";
|
|
1272
1272
|
class Mt {
|
|
1273
1273
|
/**
|
|
1274
1274
|
* Create a new instance of the {@link IpcHelper | IPC Protocol Helper}.
|
|
@@ -1280,8 +1280,8 @@ class Mt {
|
|
|
1280
1280
|
* @param logService - An instance of a logging service or utility
|
|
1281
1281
|
*/
|
|
1282
1282
|
constructor(t, e) {
|
|
1283
|
-
if (I(this, "negotiatedProtocolVersion"), I(this, "currentContext"), I(this, "incomingMessages$"), I(this, "inIframe", !1), I(this, "embeddedResult"), I(this, "iframePort1"), I(this, "iframePort2"), this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new Ie(), this.supportedVersions = t.filter((r) => Et(r,
|
|
1284
|
-
throw new
|
|
1283
|
+
if (I(this, "negotiatedProtocolVersion"), I(this, "currentContext"), I(this, "incomingMessages$"), I(this, "inIframe", !1), I(this, "embeddedResult"), I(this, "iframePort1"), I(this, "iframePort2"), this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new Ie(), this.supportedVersions = t.filter((r) => Et(r, me)), !this.supportedVersions.length)
|
|
1284
|
+
throw new ue(t, me);
|
|
1285
1285
|
this.negotiatedProtocolVersion = this.supportedVersions[0], this.embeddedResult = null, this.iframePort2 = null;
|
|
1286
1286
|
}
|
|
1287
1287
|
get parent() {
|
|
@@ -1303,11 +1303,11 @@ class Mt {
|
|
|
1303
1303
|
var t, e, r, n;
|
|
1304
1304
|
if (this.inIframe) {
|
|
1305
1305
|
if (!this.iframePort2)
|
|
1306
|
-
throw new
|
|
1306
|
+
throw new le("port2");
|
|
1307
1307
|
return this.iframePort2;
|
|
1308
1308
|
} else {
|
|
1309
1309
|
if (!((e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) != null && e.port2))
|
|
1310
|
-
throw new
|
|
1310
|
+
throw new le("port2");
|
|
1311
1311
|
return (n = (r = window.Acrobits) == null ? void 0 : r.messageChannel) == null ? void 0 : n.port2;
|
|
1312
1312
|
}
|
|
1313
1313
|
}
|
|
@@ -1334,12 +1334,12 @@ class Mt {
|
|
|
1334
1334
|
const t = "HELLO", e = this.createMessage(t);
|
|
1335
1335
|
e.protocolVersions = this.supportedVersions, this.logCreated(t, e);
|
|
1336
1336
|
const r = this.incomingMessages$.pipe(
|
|
1337
|
-
|
|
1337
|
+
y((n) => n.type === t && n.replyTo === e.id),
|
|
1338
1338
|
f((n) => n),
|
|
1339
1339
|
g(this.logReceived()),
|
|
1340
1340
|
f((n) => {
|
|
1341
1341
|
if (!this.supportedVersions.includes(n.protocolVersion))
|
|
1342
|
-
throw new
|
|
1342
|
+
throw new ue(n.protocolVersion, this.supportedVersions[0]);
|
|
1343
1343
|
return n.displayName || (n.displayName = n.cloudUsername), n;
|
|
1344
1344
|
}),
|
|
1345
1345
|
g((n) => {
|
|
@@ -1366,7 +1366,7 @@ class Mt {
|
|
|
1366
1366
|
const t = "TOKEN", e = this.createMessage(t);
|
|
1367
1367
|
this.logCreated(t, e);
|
|
1368
1368
|
const r = this.incomingMessages$.pipe(
|
|
1369
|
-
|
|
1369
|
+
y((n) => n.type === t && n.replyTo === e.id),
|
|
1370
1370
|
f((n) => n),
|
|
1371
1371
|
g(this.logReceived()),
|
|
1372
1372
|
w(1)
|
|
@@ -1395,11 +1395,11 @@ class Mt {
|
|
|
1395
1395
|
displayName: n,
|
|
1396
1396
|
jwtToken: i,
|
|
1397
1397
|
serverUrl: o,
|
|
1398
|
-
region:
|
|
1399
|
-
joinMicMuted:
|
|
1400
|
-
joinWithoutCamera:
|
|
1401
|
-
} = t, h = "JOINING ROOM",
|
|
1402
|
-
|
|
1398
|
+
region: a,
|
|
1399
|
+
joinMicMuted: c,
|
|
1400
|
+
joinWithoutCamera: l
|
|
1401
|
+
} = t, h = "JOINING ROOM", u = this.createMessage(h, !1);
|
|
1402
|
+
u.roomName = e, u.jwtToken = i, u.serverUrl = o, u.region = a, u.roomInvite = r, u.joinMicMuted = c ?? !1, u.joinWithoutCamera = l ?? !1, u.displayName = n, this.logCreated(h, u), this.port2.postMessage(u), this.logSent(h, u);
|
|
1403
1403
|
}
|
|
1404
1404
|
/**
|
|
1405
1405
|
* Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.
|
|
@@ -1449,7 +1449,7 @@ class Mt {
|
|
|
1449
1449
|
throw new d(this.currentContext);
|
|
1450
1450
|
const t = "JOIN ROOM";
|
|
1451
1451
|
return this.incomingMessages$.pipe(
|
|
1452
|
-
|
|
1452
|
+
y((e) => e.type === t && e.target === "client"),
|
|
1453
1453
|
f((e) => e),
|
|
1454
1454
|
g(this.logReceived()),
|
|
1455
1455
|
f((e) => e)
|
|
@@ -1485,7 +1485,7 @@ class Mt {
|
|
|
1485
1485
|
throw new d(this.currentContext);
|
|
1486
1486
|
const t = "LEAVE ROOM";
|
|
1487
1487
|
return this.incomingMessages$.pipe(
|
|
1488
|
-
|
|
1488
|
+
y((e) => e.type === t && e.target === "client"),
|
|
1489
1489
|
f((e) => e),
|
|
1490
1490
|
g(this.logReceived()),
|
|
1491
1491
|
f((e) => e)
|
|
@@ -1522,7 +1522,7 @@ class Mt {
|
|
|
1522
1522
|
throw new d(this.currentContext);
|
|
1523
1523
|
const t = "CONFIG";
|
|
1524
1524
|
return this.incomingMessages$.pipe(
|
|
1525
|
-
|
|
1525
|
+
y((e) => e.type === t && e.target === "client"),
|
|
1526
1526
|
f((e) => e),
|
|
1527
1527
|
g(this.logReceived()),
|
|
1528
1528
|
f((e) => ({
|
|
@@ -1546,7 +1546,7 @@ class Mt {
|
|
|
1546
1546
|
const e = "SCREENSHARE SOURCE", r = this.createMessage(e);
|
|
1547
1547
|
r.sourceTypes = t, this.logCreated(e, r);
|
|
1548
1548
|
const n = this.incomingMessages$.pipe(
|
|
1549
|
-
|
|
1549
|
+
y((i) => i.type === e && i.replyTo === r.id),
|
|
1550
1550
|
f((i) => i),
|
|
1551
1551
|
g(this.logReceived()),
|
|
1552
1552
|
f((i) => i),
|
|
@@ -1560,10 +1560,10 @@ class Mt {
|
|
|
1560
1560
|
const n = "LAYOUT CHANGE";
|
|
1561
1561
|
let i, o;
|
|
1562
1562
|
if (e && r ? (i = this.createMessage(n, !1, r), i.result = e) : (i = this.createMessage(n), o = this.incomingMessages$.pipe(
|
|
1563
|
-
|
|
1564
|
-
f((
|
|
1563
|
+
y((a) => a.type === n && a.replyTo === i.id),
|
|
1564
|
+
f((a) => a),
|
|
1565
1565
|
g(this.logReceived()),
|
|
1566
|
-
f((
|
|
1566
|
+
f((a) => a),
|
|
1567
1567
|
w(1)
|
|
1568
1568
|
), this.logService.debug(`Created ${n} Reply handler`)), i.layout = t, this.logCreated(n, i), this.port2.postMessage(i), this.logSent(n, i), o)
|
|
1569
1569
|
return o;
|
|
@@ -1604,7 +1604,7 @@ class Mt {
|
|
|
1604
1604
|
throw new d(this.currentContext);
|
|
1605
1605
|
const t = "LAYOUT CHANGE";
|
|
1606
1606
|
return this.incomingMessages$.pipe(
|
|
1607
|
-
|
|
1607
|
+
y((e) => e.type === t && e.target === "client" && e.replyTo === null),
|
|
1608
1608
|
f((e) => e),
|
|
1609
1609
|
g(this.logReceived()),
|
|
1610
1610
|
f((e) => e)
|
|
@@ -1617,7 +1617,7 @@ class Mt {
|
|
|
1617
1617
|
const e = "OAUTH TOKEN", r = this.createMessage(e);
|
|
1618
1618
|
r.providerTypes = t, this.logCreated(e, r);
|
|
1619
1619
|
const n = this.incomingMessages$.pipe(
|
|
1620
|
-
|
|
1620
|
+
y((i) => i.type === e && i.replyTo === r.id),
|
|
1621
1621
|
f((i) => i),
|
|
1622
1622
|
g(this.logReceived()),
|
|
1623
1623
|
w(1)
|
|
@@ -1635,13 +1635,13 @@ class Mt {
|
|
|
1635
1635
|
throw new d(this.currentContext);
|
|
1636
1636
|
if (this.negotiatedProtocolVersion === "2.0") {
|
|
1637
1637
|
if (e === void 0 || typeof e == "object")
|
|
1638
|
-
throw new
|
|
1638
|
+
throw new m(
|
|
1639
1639
|
"streamType",
|
|
1640
1640
|
e,
|
|
1641
1641
|
"streamType is missing or invalid"
|
|
1642
1642
|
);
|
|
1643
1643
|
if (r === void 0 || typeof r == "object" || typeof r == "number")
|
|
1644
|
-
throw new
|
|
1644
|
+
throw new m(
|
|
1645
1645
|
"contactType",
|
|
1646
1646
|
r,
|
|
1647
1647
|
"contactType is missing or invalid"
|
|
@@ -1654,9 +1654,9 @@ class Mt {
|
|
|
1654
1654
|
);
|
|
1655
1655
|
}
|
|
1656
1656
|
if (typeof e < "u" && typeof e != "object")
|
|
1657
|
-
throw new
|
|
1657
|
+
throw new m("options", e, "options is invalid");
|
|
1658
1658
|
if (typeof r < "u" && !Array.isArray(r))
|
|
1659
|
-
throw new
|
|
1659
|
+
throw new m(
|
|
1660
1660
|
"currentContacts",
|
|
1661
1661
|
r,
|
|
1662
1662
|
"currentContacts is invalid"
|
|
@@ -1666,120 +1666,148 @@ class Mt {
|
|
|
1666
1666
|
selectContactsV2_0(t, e, r, n) {
|
|
1667
1667
|
if (!this.isEmbedded())
|
|
1668
1668
|
throw new d(this.currentContext);
|
|
1669
|
-
n && n.length > 0 && (n = n.map((
|
|
1670
|
-
...
|
|
1671
|
-
cloudId:
|
|
1672
|
-
networkId:
|
|
1673
|
-
cloudUsername:
|
|
1674
|
-
} :
|
|
1669
|
+
n && n.length > 0 && (n = n.map((c) => c.type === "cloudUsername" && c.contactUser ? {
|
|
1670
|
+
...c,
|
|
1671
|
+
cloudId: c.cloudId || c.contactUser.cloudId,
|
|
1672
|
+
networkId: c.networkId || c.contactUser.networkId,
|
|
1673
|
+
cloudUsername: c.cloudUsername || c.contactUser.cloudUsername
|
|
1674
|
+
} : c));
|
|
1675
1675
|
const i = "SELECT CONTACTS", o = this.createMessage(i, !0);
|
|
1676
1676
|
o.streamId = t, o.streamType = e, o.contactType = r, o.resultTypes = [r], o.currentContacts = n, this.logCreated(i, o);
|
|
1677
|
-
const
|
|
1678
|
-
|
|
1677
|
+
const a = this.incomingMessages$.pipe(
|
|
1678
|
+
y((c) => c.type === i && c.replyTo === o.id),
|
|
1679
1679
|
g(this.logReceived()),
|
|
1680
|
-
f((
|
|
1681
|
-
const
|
|
1682
|
-
if (
|
|
1683
|
-
if (
|
|
1684
|
-
throw new ae(
|
|
1685
|
-
e === "direct" &&
|
|
1680
|
+
f((c) => {
|
|
1681
|
+
const l = c;
|
|
1682
|
+
if (l.result === "success") {
|
|
1683
|
+
if (l.streamId !== t)
|
|
1684
|
+
throw new ae(l.streamId, t);
|
|
1685
|
+
e === "direct" && l.contacts.length > 1 && (l.contacts = [l.contacts[0]]);
|
|
1686
1686
|
}
|
|
1687
|
-
return
|
|
1687
|
+
return l;
|
|
1688
1688
|
}),
|
|
1689
1689
|
w(1)
|
|
1690
1690
|
);
|
|
1691
|
-
return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(o), this.logSent(i, o),
|
|
1691
|
+
return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(o), this.logSent(i, o), a;
|
|
1692
1692
|
}
|
|
1693
1693
|
selectContactsV2_1(t, e, r) {
|
|
1694
1694
|
if (!this.isEmbedded())
|
|
1695
1695
|
throw new d(this.currentContext);
|
|
1696
1696
|
const n = {
|
|
1697
1697
|
allowMultipleSelection: (e == null ? void 0 : e.allowMultipleSelection) ?? !1,
|
|
1698
|
+
filterToSelectedType: (e == null ? void 0 : e.filterToSelectedType) ?? !1,
|
|
1698
1699
|
resultTypes: (e == null ? void 0 : e.resultTypes) ?? ["cloudUsername"],
|
|
1699
1700
|
streamName: e == null ? void 0 : e.streamName
|
|
1700
1701
|
};
|
|
1702
|
+
if (n.filterToSelectedType) {
|
|
1703
|
+
if (!n.allowMultipleSelection)
|
|
1704
|
+
throw new m(
|
|
1705
|
+
"filterToSelectedType",
|
|
1706
|
+
n.filterToSelectedType,
|
|
1707
|
+
"filterToSelectedType can only be set when allowMultipleSelection is true"
|
|
1708
|
+
);
|
|
1709
|
+
if (n.resultTypes.length === 1 && this.logService.warn(
|
|
1710
|
+
"[IPC] [SelectContacts] filterToSelectedType is redundant when resultTypes contains only one type"
|
|
1711
|
+
), r && r.length > 0) {
|
|
1712
|
+
const c = r[0].type;
|
|
1713
|
+
if (r.some((l) => l.type !== c))
|
|
1714
|
+
throw new m(
|
|
1715
|
+
"currentContacts",
|
|
1716
|
+
r,
|
|
1717
|
+
"When filterToSelectedType is true, all items in currentContacts must be of the same type"
|
|
1718
|
+
);
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1701
1721
|
if (r && r.length > 0)
|
|
1702
|
-
for (const
|
|
1703
|
-
if (
|
|
1704
|
-
throw new
|
|
1722
|
+
for (const c of r) {
|
|
1723
|
+
if (c.contactId === void 0)
|
|
1724
|
+
throw new m(
|
|
1705
1725
|
"currentContacts",
|
|
1706
1726
|
r,
|
|
1707
1727
|
"ContactItem contactId is required since v2.1 on all contacts"
|
|
1708
1728
|
);
|
|
1709
|
-
if (
|
|
1710
|
-
if (!
|
|
1711
|
-
throw new
|
|
1729
|
+
if (c.type === "cloudUsername") {
|
|
1730
|
+
if (!c.contactUser)
|
|
1731
|
+
throw new m(
|
|
1712
1732
|
"currentContacts",
|
|
1713
|
-
|
|
1733
|
+
c,
|
|
1714
1734
|
"CloudUsername contact must include contactUser since v2.1"
|
|
1715
1735
|
);
|
|
1716
|
-
if (!
|
|
1717
|
-
throw new
|
|
1736
|
+
if (!c.contactUser.cloudId || !c.contactUser.networkId || !c.contactUser.cloudUsername)
|
|
1737
|
+
throw new m(
|
|
1718
1738
|
"currentContacts",
|
|
1719
|
-
|
|
1739
|
+
c,
|
|
1720
1740
|
"CloudContact must define cloudUsername, cloudId, and networkId since v2.1"
|
|
1721
1741
|
);
|
|
1722
1742
|
}
|
|
1723
1743
|
}
|
|
1724
1744
|
const i = "SELECT CONTACTS", o = this.createMessage(i, !0);
|
|
1725
|
-
o.streamId = t, o.streamName = n.streamName, o.resultTypes = n.resultTypes, o.currentContacts = r, o.allowMultipleSelection = n.allowMultipleSelection, this.logCreated(i, o);
|
|
1726
|
-
const
|
|
1727
|
-
|
|
1745
|
+
o.streamId = t, o.streamName = n.streamName, o.resultTypes = n.resultTypes, o.currentContacts = r, o.allowMultipleSelection = n.allowMultipleSelection, o.filterToSelectedType = n.filterToSelectedType, this.logCreated(i, o);
|
|
1746
|
+
const a = this.incomingMessages$.pipe(
|
|
1747
|
+
y((c) => c.type === i && c.replyTo === o.id),
|
|
1728
1748
|
g(this.logReceived()),
|
|
1729
|
-
f((
|
|
1730
|
-
const
|
|
1731
|
-
if (
|
|
1732
|
-
if (
|
|
1733
|
-
throw new ae(
|
|
1734
|
-
const h =
|
|
1735
|
-
|
|
1736
|
-
(
|
|
1737
|
-
),
|
|
1738
|
-
`[IPC] [SelectContactsReply] Filtered ${h -
|
|
1739
|
-
), !n.allowMultipleSelection &&
|
|
1740
|
-
|
|
1741
|
-
if (l.
|
|
1742
|
-
|
|
1749
|
+
f((c) => {
|
|
1750
|
+
const l = c;
|
|
1751
|
+
if (l.result === "success") {
|
|
1752
|
+
if (l.streamId !== t)
|
|
1753
|
+
throw new ae(l.streamId, t);
|
|
1754
|
+
const h = l.contacts.length;
|
|
1755
|
+
if (l.contacts = l.contacts.filter(
|
|
1756
|
+
(u) => n.resultTypes.includes(u.type)
|
|
1757
|
+
), l.contacts.length !== h && this.logService.debug(
|
|
1758
|
+
`[IPC] [SelectContactsReply] Filtered ${h - l.contacts.length} contacts from reply`
|
|
1759
|
+
), !n.allowMultipleSelection && l.contacts.length > 1 && (l.contacts = [l.contacts[0]]), n.filterToSelectedType && l.contacts.length > 1) {
|
|
1760
|
+
const u = l.contacts[0].type;
|
|
1761
|
+
if (l.contacts.some(
|
|
1762
|
+
(b) => b.type !== u
|
|
1763
|
+
))
|
|
1764
|
+
throw new Error(
|
|
1765
|
+
`When filterToSelectedType is true, all contacts in the reply must be of the same type. Expected all contacts to be of type '${u}', but received mixed types.`
|
|
1766
|
+
);
|
|
1767
|
+
}
|
|
1768
|
+
for (const u of l.contacts) {
|
|
1769
|
+
if (u.type === "cloudUsername") {
|
|
1770
|
+
if (!u.contactUser)
|
|
1743
1771
|
throw new Error(
|
|
1744
1772
|
`CloudUsername contact must include contactUser since v2.1. ContactItem: ${JSON.stringify(
|
|
1745
|
-
|
|
1773
|
+
u
|
|
1746
1774
|
)}`
|
|
1747
1775
|
);
|
|
1748
|
-
if (!
|
|
1776
|
+
if (!u.contactUser.cloudId || !u.contactUser.networkId || !u.contactUser.cloudUsername)
|
|
1749
1777
|
throw new Error(
|
|
1750
1778
|
`CloudContact must define cloudUsername, cloudId, and networkId since v2.1. ContactItem: ${JSON.stringify(
|
|
1751
|
-
|
|
1779
|
+
u
|
|
1752
1780
|
)}`
|
|
1753
1781
|
);
|
|
1754
1782
|
}
|
|
1755
|
-
this.negotiatedProtocolVersion === "2.2" && (
|
|
1783
|
+
this.negotiatedProtocolVersion === "2.2" && (u.type === "number" && u.numbers.length > 1 ? u.numbers = [u.numbers[0]] : u.type === "email" && u.emails.length > 1 && (u.emails = [u.emails[0]]));
|
|
1756
1784
|
}
|
|
1757
1785
|
}
|
|
1758
|
-
return
|
|
1786
|
+
return l;
|
|
1759
1787
|
}),
|
|
1760
1788
|
w(1)
|
|
1761
1789
|
);
|
|
1762
|
-
return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(o), this.logSent(i, o),
|
|
1790
|
+
return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(o), this.logSent(i, o), a;
|
|
1763
1791
|
}
|
|
1764
1792
|
matchContacts(t) {
|
|
1765
1793
|
if (!this.isEmbedded())
|
|
1766
1794
|
throw new d(this.currentContext);
|
|
1767
1795
|
if (!Array.isArray(t))
|
|
1768
|
-
throw new
|
|
1796
|
+
throw new m("contacts", t, "contacts is not an array");
|
|
1769
1797
|
if (!t.length)
|
|
1770
|
-
throw new
|
|
1798
|
+
throw new m("contacts", t, "At least one contact is required");
|
|
1771
1799
|
const e = this.createMessage("MATCH CONTACTS");
|
|
1772
1800
|
if (this.compareVersion("2.1") >= 0) {
|
|
1773
1801
|
for (const n of t)
|
|
1774
1802
|
if (n.type === "cloudUsername") {
|
|
1775
1803
|
if (!n.contactUser)
|
|
1776
|
-
throw new
|
|
1804
|
+
throw new m(
|
|
1777
1805
|
"contacts",
|
|
1778
1806
|
n,
|
|
1779
1807
|
"CloudUsername contact must include contactUser"
|
|
1780
1808
|
);
|
|
1781
1809
|
if (!n.contactUser.cloudUsername || !n.contactUser.cloudId || !n.contactUser.networkId)
|
|
1782
|
-
throw new
|
|
1810
|
+
throw new m(
|
|
1783
1811
|
"contacts",
|
|
1784
1812
|
n,
|
|
1785
1813
|
"CloudContact must define cloudUsername, cloudId, and networkId"
|
|
@@ -1793,7 +1821,7 @@ class Mt {
|
|
|
1793
1821
|
}
|
|
1794
1822
|
this.logCreated(e.type, e);
|
|
1795
1823
|
const r = this.incomingMessages$.pipe(
|
|
1796
|
-
|
|
1824
|
+
y((n) => n.type === e.type && n.replyTo === e.id),
|
|
1797
1825
|
g(this.logReceived()),
|
|
1798
1826
|
f((n) => {
|
|
1799
1827
|
const i = n;
|
|
@@ -1802,29 +1830,29 @@ class Mt {
|
|
|
1802
1830
|
throw new Error(
|
|
1803
1831
|
"MatchContactsMessageReply should return a Record<string, DetailedContactItem> of contacts when using IPC Protocol v2.1+"
|
|
1804
1832
|
);
|
|
1805
|
-
for (const [o,
|
|
1806
|
-
if (
|
|
1833
|
+
for (const [o, a] of Object.entries(i.contacts)) {
|
|
1834
|
+
if (a == null) {
|
|
1807
1835
|
this.logService.debug(
|
|
1808
1836
|
`[IPC] [MatchContactsReply] Received null or undefined contact for ${o}`
|
|
1809
1837
|
);
|
|
1810
1838
|
continue;
|
|
1811
1839
|
}
|
|
1812
|
-
if (
|
|
1840
|
+
if (a.contactId === void 0)
|
|
1813
1841
|
throw new Error(
|
|
1814
1842
|
`ContactItem 'contactId' is required since v2.1. ContactItem: ${JSON.stringify(
|
|
1815
|
-
|
|
1843
|
+
a
|
|
1816
1844
|
)}`
|
|
1817
1845
|
);
|
|
1818
|
-
if (!
|
|
1846
|
+
if (!a.contactUser && (!a.uri || a.uri.length === 0) && (!a.numbers || a.numbers.length === 0))
|
|
1819
1847
|
throw new Error(
|
|
1820
1848
|
`DetailedContactItem must define at least one contact method (contactUser, uri, or numbers). ContactItem: ${JSON.stringify(
|
|
1821
|
-
|
|
1849
|
+
a
|
|
1822
1850
|
)}`
|
|
1823
1851
|
);
|
|
1824
|
-
if (
|
|
1852
|
+
if (a.contactUser && (!a.contactUser.cloudId || !a.contactUser.networkId || !a.contactUser.cloudUsername))
|
|
1825
1853
|
throw new Error(
|
|
1826
1854
|
`When contactUser is defined, cloudId, networkId, and cloudUsername must also be defined. ContactItem: ${JSON.stringify(
|
|
1827
|
-
|
|
1855
|
+
a
|
|
1828
1856
|
)}`
|
|
1829
1857
|
);
|
|
1830
1858
|
}
|
|
@@ -1838,14 +1866,14 @@ class Mt {
|
|
|
1838
1866
|
"The number of contacts in the reply does not match the number of contacts in the request"
|
|
1839
1867
|
);
|
|
1840
1868
|
for (const o of i.contacts) {
|
|
1841
|
-
const
|
|
1842
|
-
if (
|
|
1869
|
+
const a = o;
|
|
1870
|
+
if (a.type === "cloudUsername" && !("cloudUsername" in a))
|
|
1843
1871
|
throw new Error(
|
|
1844
1872
|
`CloudUsernameDetailedContactItem must define cloudUsername. ContactItem: ${JSON.stringify(
|
|
1845
1873
|
o
|
|
1846
1874
|
)}`
|
|
1847
1875
|
);
|
|
1848
|
-
if (
|
|
1876
|
+
if (a.type === "uri" && (!("uri" in a) || !Array.isArray(a.uri)))
|
|
1849
1877
|
throw new Error(
|
|
1850
1878
|
`UriDetailedContactItem must define uri as an array. ContactItem: ${JSON.stringify(
|
|
1851
1879
|
o
|
|
@@ -1890,7 +1918,7 @@ class Mt {
|
|
|
1890
1918
|
throw new d(this.currentContext);
|
|
1891
1919
|
const t = "PUSH MESSAGE";
|
|
1892
1920
|
return this.incomingMessages$.pipe(
|
|
1893
|
-
|
|
1921
|
+
y((e) => e.type === t && e.target === "client"),
|
|
1894
1922
|
f((e) => e),
|
|
1895
1923
|
g(this.logReceived())
|
|
1896
1924
|
);
|
|
@@ -1910,7 +1938,7 @@ class Mt {
|
|
|
1910
1938
|
const t = "PUSH TOKEN", e = this.createMessage(t);
|
|
1911
1939
|
this.logCreated(t, e);
|
|
1912
1940
|
const r = this.incomingMessages$.pipe(
|
|
1913
|
-
|
|
1941
|
+
y((n) => n.type === t && n.replyTo === e.id),
|
|
1914
1942
|
g(this.logReceived()),
|
|
1915
1943
|
f((n) => n),
|
|
1916
1944
|
w(1)
|
|
@@ -1949,7 +1977,7 @@ class Mt {
|
|
|
1949
1977
|
throw new d(this.currentContext);
|
|
1950
1978
|
const t = "PUSH TOKEN";
|
|
1951
1979
|
return this.incomingMessages$.pipe(
|
|
1952
|
-
|
|
1980
|
+
y(
|
|
1953
1981
|
(e) => e.type === t && e.target === "client" && e.replyTo === null && e.expectReply === !1
|
|
1954
1982
|
),
|
|
1955
1983
|
f((e) => {
|
|
@@ -1973,7 +2001,7 @@ class Mt {
|
|
|
1973
2001
|
throw new d(this.currentContext);
|
|
1974
2002
|
const t = "BADGE QUERY";
|
|
1975
2003
|
return this.incomingMessages$.pipe(
|
|
1976
|
-
|
|
2004
|
+
y((e) => e.type === t && e.target === "client"),
|
|
1977
2005
|
f((e) => e),
|
|
1978
2006
|
g(this.logReceived())
|
|
1979
2007
|
);
|
|
@@ -2031,7 +2059,7 @@ class Mt {
|
|
|
2031
2059
|
throw new d(this.currentContext);
|
|
2032
2060
|
const t = "LIFECYCLE";
|
|
2033
2061
|
return this.incomingMessages$.pipe(
|
|
2034
|
-
|
|
2062
|
+
y((e) => e.type === t && e.target === "client"),
|
|
2035
2063
|
f((e) => e),
|
|
2036
2064
|
g(this.logReceived())
|
|
2037
2065
|
);
|
|
@@ -2071,7 +2099,7 @@ class Mt {
|
|
|
2071
2099
|
throw new d(this.currentContext);
|
|
2072
2100
|
const t = "REQUEST LOGS";
|
|
2073
2101
|
return this.incomingMessages$.pipe(
|
|
2074
|
-
|
|
2102
|
+
y((e) => e.type === t && e.target === "client"),
|
|
2075
2103
|
f((e) => e),
|
|
2076
2104
|
g(this.logReceived())
|
|
2077
2105
|
);
|
|
@@ -2089,8 +2117,8 @@ class Mt {
|
|
|
2089
2117
|
sendRequestLogsMessageReply(t, e, r, n, i) {
|
|
2090
2118
|
if (!this.isEmbedded())
|
|
2091
2119
|
throw new d(this.currentContext);
|
|
2092
|
-
const o = "REQUEST LOGS",
|
|
2093
|
-
|
|
2120
|
+
const o = "REQUEST LOGS", a = this.createMessage(o, !1, i);
|
|
2121
|
+
a.fileId = t, a.fileHash = e, a.fileSize = r, a.format = n, this.logCreated(o, a), this.port2.postMessage(a), this.logSent(o, a);
|
|
2094
2122
|
}
|
|
2095
2123
|
/**
|
|
2096
2124
|
* Send a {@link ViewTransitionMessage} to the `Host` app, notifying it of a view transition
|
|
@@ -2155,28 +2183,28 @@ class Mt {
|
|
|
2155
2183
|
sendFileRequestMessage(t, e, r, n, i) {
|
|
2156
2184
|
if (!this.isEmbedded())
|
|
2157
2185
|
throw new d(this.currentContext);
|
|
2158
|
-
const o = "FILE REQUEST",
|
|
2159
|
-
if (
|
|
2186
|
+
const o = "FILE REQUEST", a = this.createMessage(o);
|
|
2187
|
+
if (a.fileId = t, a.fileHash = e.toLowerCase(), a.intent = r, a.maxChunkSizeInBytes = i, r === "attachment") {
|
|
2160
2188
|
if (!n)
|
|
2161
|
-
throw new
|
|
2189
|
+
throw new m(
|
|
2162
2190
|
"streamId",
|
|
2163
2191
|
n,
|
|
2164
2192
|
"streamId is required for attachment intent"
|
|
2165
2193
|
);
|
|
2166
|
-
|
|
2194
|
+
a.streamId = n;
|
|
2167
2195
|
}
|
|
2168
|
-
this.logCreated(o,
|
|
2169
|
-
let
|
|
2170
|
-
const
|
|
2171
|
-
|
|
2172
|
-
(h) => h.type === o && h.replyTo ===
|
|
2196
|
+
this.logCreated(o, a);
|
|
2197
|
+
let c = 0;
|
|
2198
|
+
const l = this.incomingMessages$.pipe(
|
|
2199
|
+
y(
|
|
2200
|
+
(h) => h.type === o && h.replyTo === a.id
|
|
2173
2201
|
),
|
|
2174
2202
|
g(this.logReceived()),
|
|
2175
|
-
g(() =>
|
|
2203
|
+
g(() => c++),
|
|
2176
2204
|
f((h) => (h.result === "success" && (h.chunkHash = h.chunkHash.toLowerCase(), h.fileHash = h.fileHash.toLowerCase()), h)),
|
|
2177
|
-
wt((h) => h.result === "success" &&
|
|
2205
|
+
wt((h) => h.result === "success" && c < h.totalChunks, !0)
|
|
2178
2206
|
);
|
|
2179
|
-
return this.port2.postMessage(
|
|
2207
|
+
return this.port2.postMessage(a), this.logSent(o, a), l;
|
|
2180
2208
|
}
|
|
2181
2209
|
/**
|
|
2182
2210
|
* Sends a {@link FileRequestMessageReply} to the Host app, to reply to a
|
|
@@ -2223,7 +2251,7 @@ class Mt {
|
|
|
2223
2251
|
throw new d(this.currentContext);
|
|
2224
2252
|
const t = "FILE REQUEST";
|
|
2225
2253
|
return this.incomingMessages$.pipe(
|
|
2226
|
-
|
|
2254
|
+
y(
|
|
2227
2255
|
(e) => e.type === t && e.target === "client" && e.replyTo === null
|
|
2228
2256
|
),
|
|
2229
2257
|
f((e) => (e.fileHash = e.fileHash.toLowerCase(), e)),
|
|
@@ -2255,35 +2283,35 @@ class Mt {
|
|
|
2255
2283
|
sendFileSelectionMessage(t = "attachment", e, r, n, i, o) {
|
|
2256
2284
|
if (!this.isEmbedded())
|
|
2257
2285
|
throw new d(this.currentContext);
|
|
2258
|
-
const
|
|
2259
|
-
if (
|
|
2286
|
+
const a = "FILE SELECTION", c = this.createMessage(a);
|
|
2287
|
+
if (c.intent = t, c.maxCount = n, c.maxFileSizeInBytes = i, c.mimeTypes = o, t === "attachment") {
|
|
2260
2288
|
if (!e)
|
|
2261
|
-
throw new
|
|
2289
|
+
throw new m(
|
|
2262
2290
|
"streamId",
|
|
2263
2291
|
e,
|
|
2264
2292
|
"streamId is required for attachment intent"
|
|
2265
2293
|
);
|
|
2266
2294
|
if (!r)
|
|
2267
|
-
throw new
|
|
2295
|
+
throw new m(
|
|
2268
2296
|
"correlationId",
|
|
2269
2297
|
r,
|
|
2270
2298
|
"correlationId is required for attachment intent"
|
|
2271
2299
|
);
|
|
2272
|
-
|
|
2300
|
+
c.streamId = e, c.correlationId = r;
|
|
2273
2301
|
}
|
|
2274
|
-
this.logCreated(
|
|
2275
|
-
const
|
|
2276
|
-
|
|
2277
|
-
(h) => h.type ===
|
|
2302
|
+
this.logCreated(a, c);
|
|
2303
|
+
const l = this.incomingMessages$.pipe(
|
|
2304
|
+
y(
|
|
2305
|
+
(h) => h.type === a && h.replyTo === c.id
|
|
2278
2306
|
),
|
|
2279
2307
|
f((h) => {
|
|
2280
|
-
var
|
|
2281
|
-
return h.result === "success" && (h.files = (
|
|
2308
|
+
var u;
|
|
2309
|
+
return h.result === "success" && (h.files = (u = h.files) == null ? void 0 : u.map((b) => (b.original.fileHash = b.original.fileHash.toLowerCase(), b.preview && (b.preview.fileHash = b.preview.fileHash.toLowerCase()), b))), h;
|
|
2282
2310
|
}),
|
|
2283
2311
|
g(this.logReceived()),
|
|
2284
2312
|
w(1)
|
|
2285
2313
|
);
|
|
2286
|
-
return this.port2.postMessage(
|
|
2314
|
+
return this.port2.postMessage(c), this.logSent(a, c), l;
|
|
2287
2315
|
}
|
|
2288
2316
|
/**
|
|
2289
2317
|
* Sends a {@link FileDownloadProgressQueryMessage} to the Host app, to query the progress of a
|
|
@@ -2313,11 +2341,11 @@ class Mt {
|
|
|
2313
2341
|
);
|
|
2314
2342
|
i.fileHash = t.toLowerCase(), i.url = e, i.correlationId = r, this.logCreated(n, i);
|
|
2315
2343
|
const o = this.incomingMessages$.pipe(
|
|
2316
|
-
|
|
2317
|
-
(
|
|
2344
|
+
y(
|
|
2345
|
+
(a) => a.type === "FILE DOWNLOAD PROGRESS UPDATE" && a.replyTo === i.id
|
|
2318
2346
|
),
|
|
2319
|
-
g((
|
|
2320
|
-
f((
|
|
2347
|
+
g((a) => this.logReceived(a)),
|
|
2348
|
+
f((a) => (a.fileHash && (a.fileHash = a.fileHash.toLowerCase()), a)),
|
|
2321
2349
|
w(1)
|
|
2322
2350
|
);
|
|
2323
2351
|
return this.port2.postMessage(i), this.logSent(n, i), o;
|
|
@@ -2334,7 +2362,7 @@ class Mt {
|
|
|
2334
2362
|
throw new d(this.currentContext);
|
|
2335
2363
|
const t = "FILE DOWNLOAD PROGRESS UPDATE";
|
|
2336
2364
|
return this.incomingMessages$.pipe(
|
|
2337
|
-
|
|
2365
|
+
y(
|
|
2338
2366
|
(e) => e.type === t && e.target === "client" && e.replyTo === null
|
|
2339
2367
|
),
|
|
2340
2368
|
f((e) => (e.fileHash && (e.fileHash = e.fileHash.toLowerCase()), e)),
|
|
@@ -2364,11 +2392,11 @@ class Mt {
|
|
|
2364
2392
|
);
|
|
2365
2393
|
i.fileHash = t.toLowerCase(), i.fileId = e, i.correlationId = r, this.logCreated(n, i);
|
|
2366
2394
|
const o = this.incomingMessages$.pipe(
|
|
2367
|
-
|
|
2368
|
-
(
|
|
2395
|
+
y(
|
|
2396
|
+
(a) => a.type === "FILE UPLOAD PROGRESS UPDATE" && a.replyTo === i.id
|
|
2369
2397
|
),
|
|
2370
2398
|
g(this.logReceived()),
|
|
2371
|
-
f((
|
|
2399
|
+
f((a) => (a.fileHash && (a.fileHash = a.fileHash.toLowerCase()), a)),
|
|
2372
2400
|
w(1)
|
|
2373
2401
|
);
|
|
2374
2402
|
return this.port2.postMessage(i), this.logSent(n, i), o;
|
|
@@ -2389,7 +2417,7 @@ class Mt {
|
|
|
2389
2417
|
throw new d(this.currentContext);
|
|
2390
2418
|
const t = "FILE UPLOAD PROGRESS UPDATE";
|
|
2391
2419
|
return this.incomingMessages$.pipe(
|
|
2392
|
-
|
|
2420
|
+
y(
|
|
2393
2421
|
(e) => e.type === t && e.target === "client" && e.replyTo === null
|
|
2394
2422
|
),
|
|
2395
2423
|
f((e) => (e.fileHash && (e.fileHash = e.fileHash.toLowerCase()), e)),
|
|
@@ -2421,39 +2449,39 @@ class Mt {
|
|
|
2421
2449
|
* @returns An observable which emits a {@link FileDownloadMessageReply} instance containing the
|
|
2422
2450
|
* result of the request. Emits once.
|
|
2423
2451
|
*/
|
|
2424
|
-
sendFileDownloadMessage(t, e, r, n, i, o,
|
|
2452
|
+
sendFileDownloadMessage(t, e, r, n, i, o, a, c, l) {
|
|
2425
2453
|
if (!this.isEmbedded())
|
|
2426
2454
|
throw new d(this.currentContext);
|
|
2427
|
-
if (
|
|
2428
|
-
|
|
2429
|
-
...
|
|
2430
|
-
cloudId:
|
|
2431
|
-
networkId:
|
|
2432
|
-
cloudUsername:
|
|
2455
|
+
if (c && this.compareVersion("2.1") < 0)
|
|
2456
|
+
c.type === "cloudUsername" && c.contactUser && (c = {
|
|
2457
|
+
...c,
|
|
2458
|
+
cloudId: c.cloudId || c.contactUser.cloudId,
|
|
2459
|
+
networkId: c.networkId || c.contactUser.networkId,
|
|
2460
|
+
cloudUsername: c.cloudUsername || c.contactUser.cloudUsername
|
|
2433
2461
|
});
|
|
2434
|
-
else if (
|
|
2435
|
-
if (!
|
|
2436
|
-
throw new
|
|
2462
|
+
else if (c && this.compareVersion("2.1") >= 0 && c.type === "cloudUsername") {
|
|
2463
|
+
if (!c.contactUser)
|
|
2464
|
+
throw new m(
|
|
2437
2465
|
"sender",
|
|
2438
|
-
|
|
2466
|
+
c,
|
|
2439
2467
|
"CloudUsername contact must include contactUser since v2.1"
|
|
2440
2468
|
);
|
|
2441
|
-
if (!
|
|
2442
|
-
throw new
|
|
2469
|
+
if (!c.contactUser.cloudId || !c.contactUser.networkId || !c.contactUser.cloudUsername)
|
|
2470
|
+
throw new m(
|
|
2443
2471
|
"sender",
|
|
2444
|
-
|
|
2472
|
+
c,
|
|
2445
2473
|
"CloudContact must define cloudUsername, cloudId, and networkId since v2.1"
|
|
2446
2474
|
);
|
|
2447
2475
|
}
|
|
2448
|
-
const h = "FILE DOWNLOAD",
|
|
2449
|
-
|
|
2476
|
+
const h = "FILE DOWNLOAD", u = this.createMessage(h, !0);
|
|
2477
|
+
u.url = t, u.key = e, u.fileHash = r.toLowerCase(), u.mimeType = n, u.fileName = i, u.streamId = o, u.correlationId = a, u.sender = c, u.intent = l ?? "download", this.logCreated(h, u);
|
|
2450
2478
|
const b = this.incomingMessages$.pipe(
|
|
2451
|
-
|
|
2479
|
+
y((p) => p.type === h && p.replyTo === u.id),
|
|
2452
2480
|
g(this.logReceived()),
|
|
2453
2481
|
f((p) => p),
|
|
2454
2482
|
w(1)
|
|
2455
2483
|
);
|
|
2456
|
-
return this.port2.postMessage(
|
|
2484
|
+
return this.port2.postMessage(u), this.logSent(h, u), b;
|
|
2457
2485
|
}
|
|
2458
2486
|
/**
|
|
2459
2487
|
* Sends a {@link CancelFileDownloadMessage} to the Host app, to cancel downloading of a file
|
|
@@ -2490,7 +2518,7 @@ class Mt {
|
|
|
2490
2518
|
const r = "FILE REMOVE", n = this.createMessage(r, !0);
|
|
2491
2519
|
n.hash = t.toLowerCase(), n.streamId = e, this.logCreated(r, n);
|
|
2492
2520
|
const i = this.incomingMessages$.pipe(
|
|
2493
|
-
|
|
2521
|
+
y((o) => o.type === r && o.replyTo === n.id),
|
|
2494
2522
|
g(this.logReceived()),
|
|
2495
2523
|
f((o) => o),
|
|
2496
2524
|
w(1)
|
|
@@ -2558,13 +2586,13 @@ class Mt {
|
|
|
2558
2586
|
* @returns An observable which emits a {@link SendMessageMessageReply} instance containing the
|
|
2559
2587
|
* result of the request. Emits once.
|
|
2560
2588
|
*/
|
|
2561
|
-
sendSendMessageMessage(t, e, r, n = "TEXT", i, o,
|
|
2589
|
+
sendSendMessageMessage(t, e, r, n = "TEXT", i, o, a, c = !0, l) {
|
|
2562
2590
|
if (!this.isEmbedded())
|
|
2563
2591
|
throw new d(this.currentContext);
|
|
2564
|
-
const h = "SEND MESSAGE",
|
|
2565
|
-
if (
|
|
2592
|
+
const h = "SEND MESSAGE", u = this.createMessage(h, !0);
|
|
2593
|
+
if (u.streamId = t, u.correlationId = e, u.body = r, u.messageType = n, i && i.length > 0)
|
|
2566
2594
|
if (this.compareVersion("2.1") < 0)
|
|
2567
|
-
|
|
2595
|
+
u.mentions = i.map((p) => p.contactUser ? {
|
|
2568
2596
|
...p,
|
|
2569
2597
|
cloudId: p.cloudId || p.contactUser.cloudId,
|
|
2570
2598
|
networkId: p.networkId || p.contactUser.networkId,
|
|
@@ -2573,30 +2601,30 @@ class Mt {
|
|
|
2573
2601
|
else {
|
|
2574
2602
|
for (const p of i) {
|
|
2575
2603
|
if (p.type === "cloudUsername" && !p.contactUser)
|
|
2576
|
-
throw new
|
|
2604
|
+
throw new m(
|
|
2577
2605
|
"mentions",
|
|
2578
2606
|
p,
|
|
2579
2607
|
"CloudUsername mention must include contactUser"
|
|
2580
2608
|
);
|
|
2581
2609
|
if (p.contactUser && (!p.contactUser.cloudId || !p.contactUser.networkId || !p.contactUser.cloudUsername))
|
|
2582
|
-
throw new
|
|
2610
|
+
throw new m(
|
|
2583
2611
|
"mentions",
|
|
2584
2612
|
p,
|
|
2585
2613
|
"CloudContact must define cloudUsername, cloudId, and networkId"
|
|
2586
2614
|
);
|
|
2587
2615
|
}
|
|
2588
|
-
|
|
2616
|
+
u.mentions = i;
|
|
2589
2617
|
}
|
|
2590
2618
|
else
|
|
2591
|
-
|
|
2592
|
-
|
|
2619
|
+
u.mentions = [];
|
|
2620
|
+
u.attachments = (o == null ? void 0 : o.map((p) => p.toLowerCase())) ?? [], u.relatedMessageId = a, u.setCursors = c, u.threadId = l, this.logCreated(h, u);
|
|
2593
2621
|
const b = this.incomingMessages$.pipe(
|
|
2594
|
-
|
|
2622
|
+
y((p) => p.type === h && p.replyTo === u.id),
|
|
2595
2623
|
g(this.logReceived()),
|
|
2596
2624
|
f((p) => p),
|
|
2597
2625
|
w(1)
|
|
2598
2626
|
);
|
|
2599
|
-
return this.port2.postMessage(
|
|
2627
|
+
return this.port2.postMessage(u), this.logSent(h, u), b;
|
|
2600
2628
|
}
|
|
2601
2629
|
/**
|
|
2602
2630
|
* Sends a {@link CancelSendMessageMessage} to the Host app, to cancel a message that was being
|
|
@@ -2645,7 +2673,7 @@ class Mt {
|
|
|
2645
2673
|
const r = "SEND MESSAGE STATUS QUERY", n = this.createMessage(r, !0);
|
|
2646
2674
|
n.correlationId = t, n.streamId = e, this.logCreated(r, n);
|
|
2647
2675
|
const i = this.incomingMessages$.pipe(
|
|
2648
|
-
|
|
2676
|
+
y(
|
|
2649
2677
|
(o) => o.type === "SEND MESSAGE STATUS UPDATE" && o.replyTo === n.id
|
|
2650
2678
|
),
|
|
2651
2679
|
g(this.logReceived()),
|
|
@@ -2666,7 +2694,7 @@ class Mt {
|
|
|
2666
2694
|
throw new d(this.currentContext);
|
|
2667
2695
|
const t = "SEND MESSAGE STATUS UPDATE";
|
|
2668
2696
|
return this.incomingMessages$.pipe(
|
|
2669
|
-
|
|
2697
|
+
y((e) => e.type === t && e.target === "client" && e.replyTo === null),
|
|
2670
2698
|
f((e) => e),
|
|
2671
2699
|
g(this.logReceived())
|
|
2672
2700
|
);
|
|
@@ -2691,13 +2719,13 @@ class Mt {
|
|
|
2691
2719
|
});
|
|
2692
2720
|
else if (t.type === "cloudUsername") {
|
|
2693
2721
|
if (!t.contactUser)
|
|
2694
|
-
throw new
|
|
2722
|
+
throw new m(
|
|
2695
2723
|
"contact",
|
|
2696
2724
|
t,
|
|
2697
2725
|
"CloudUsername contact must include contactUser since v2.1"
|
|
2698
2726
|
);
|
|
2699
2727
|
if (!t.contactUser.cloudId || !t.contactUser.networkId || !t.contactUser.cloudUsername)
|
|
2700
|
-
throw new
|
|
2728
|
+
throw new m(
|
|
2701
2729
|
"contact",
|
|
2702
2730
|
t,
|
|
2703
2731
|
"CloudContact must define cloudUsername, cloudId, and networkId since v2.1"
|
|
@@ -2760,7 +2788,7 @@ class Mt {
|
|
|
2760
2788
|
throw new d(this.currentContext);
|
|
2761
2789
|
const t = "BUTTONS";
|
|
2762
2790
|
return this.incomingMessages$.pipe(
|
|
2763
|
-
|
|
2791
|
+
y((e) => e.type === t && e.target === "client"),
|
|
2764
2792
|
f((e) => e),
|
|
2765
2793
|
g(this.logReceived())
|
|
2766
2794
|
);
|
|
@@ -2961,9 +2989,9 @@ class xt {
|
|
|
2961
2989
|
let i;
|
|
2962
2990
|
if (this.negotiatedVersion === "2.0") {
|
|
2963
2991
|
if (typeof e != "string")
|
|
2964
|
-
throw new
|
|
2992
|
+
throw new m("mode", e, 'mode must be "single" or "multi"');
|
|
2965
2993
|
if (n === "number")
|
|
2966
|
-
throw new
|
|
2994
|
+
throw new m(
|
|
2967
2995
|
"contactType",
|
|
2968
2996
|
n,
|
|
2969
2997
|
'contactType cannot be "number" for version 2.0 of the IPC protocol'
|
|
@@ -2976,7 +3004,7 @@ class xt {
|
|
|
2976
3004
|
);
|
|
2977
3005
|
} else {
|
|
2978
3006
|
if (typeof e != "object")
|
|
2979
|
-
throw new
|
|
3007
|
+
throw new m("options", e, "options must be an object");
|
|
2980
3008
|
i = this.selectContacts_V2_1(t, e);
|
|
2981
3009
|
}
|
|
2982
3010
|
return T(
|
|
@@ -2993,7 +3021,7 @@ class xt {
|
|
|
2993
3021
|
selectContacts_V2_0(t, e, r, n) {
|
|
2994
3022
|
if (this.logger.debug("Selecting Contacts: ", ...arguments), e === "multi") {
|
|
2995
3023
|
if (!r || !Array.isArray(r))
|
|
2996
|
-
throw new
|
|
3024
|
+
throw new m(
|
|
2997
3025
|
"currentContacts",
|
|
2998
3026
|
r,
|
|
2999
3027
|
"currentContacts is required for group streams"
|
|
@@ -3008,19 +3036,35 @@ class xt {
|
|
|
3008
3036
|
return n || (n = "cloudUsername"), this.helper.selectContacts(t.toString(), "direct", n);
|
|
3009
3037
|
}
|
|
3010
3038
|
selectContacts_V2_1(t, e) {
|
|
3011
|
-
|
|
3012
|
-
|
|
3039
|
+
this.logger.debug("Selecting Contacts: ", e);
|
|
3040
|
+
const r = t.toString(), n = e.resultTypes ?? ["cloudUsername"];
|
|
3041
|
+
if (e.mode === "single")
|
|
3042
|
+
return this.helper.selectContacts(r, {
|
|
3043
|
+
allowMultipleSelection: !1,
|
|
3044
|
+
resultTypes: n
|
|
3045
|
+
});
|
|
3046
|
+
if (!e.currentContacts || !Array.isArray(e.currentContacts))
|
|
3047
|
+
throw new m(
|
|
3013
3048
|
"currentContacts",
|
|
3014
3049
|
e.currentContacts,
|
|
3015
3050
|
"currentContacts is required for group streams"
|
|
3016
3051
|
);
|
|
3017
|
-
return this.helper.selectContacts(
|
|
3018
|
-
|
|
3052
|
+
return e.filterToSelectedType ? this.helper.selectContacts(
|
|
3053
|
+
r,
|
|
3054
|
+
{
|
|
3055
|
+
allowMultipleSelection: !0,
|
|
3056
|
+
filterToSelectedType: !0,
|
|
3057
|
+
resultTypes: n
|
|
3058
|
+
},
|
|
3059
|
+
e.currentContacts
|
|
3060
|
+
) : this.helper.selectContacts(
|
|
3061
|
+
r,
|
|
3019
3062
|
{
|
|
3020
|
-
allowMultipleSelection:
|
|
3021
|
-
|
|
3063
|
+
allowMultipleSelection: !0,
|
|
3064
|
+
filterToSelectedType: !1,
|
|
3065
|
+
resultTypes: n
|
|
3022
3066
|
},
|
|
3023
|
-
e.
|
|
3067
|
+
e.currentContacts
|
|
3024
3068
|
);
|
|
3025
3069
|
}
|
|
3026
3070
|
/**
|