@acrobits/ipc-sdk 0.1.7 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/assets/search.js +1 -1
- package/docs/classes/IPCManager.html +38 -23
- package/docs/interfaces/BaseContactItem.html +10 -0
- package/docs/interfaces/CloudUsernameContactItem.html +14 -3
- package/docs/interfaces/DetailedContactItem.html +17 -7
- package/docs/interfaces/UriContactItem.html +14 -3
- package/docs/types/ContactItem.html +1 -1
- package/docs/types/ContactLabel.html +1 -1
- package/docs/types/ContactType.html +1 -1
- package/docs/types/ContactURI.html +1 -1
- package/docs/types/HostType.html +1 -1
- package/docs/types/IpcProtocolVersion.html +1 -1
- package/lib/index.d.ts +14 -2
- package/lib/ipc-sdk.js +216 -190
- 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Pe = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var _ = (n, t, e) => (
|
|
4
|
-
var
|
|
2
|
+
var Re = (n, t, e) => t in n ? Pe(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var _ = (n, t, e) => (Re(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
var E = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.HostInForeground = "HOST IN FOREGROUND", n))(E || {}), Q = function(n, t) {
|
|
5
5
|
return Q = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
6
6
|
e.__proto__ = r;
|
|
7
7
|
} || function(e, r) {
|
|
@@ -74,13 +74,13 @@ 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);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
var
|
|
83
|
+
var A = function() {
|
|
84
84
|
function n(t) {
|
|
85
85
|
this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
86
86
|
}
|
|
@@ -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,17 +162,17 @@ 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;
|
|
172
172
|
}(), n;
|
|
173
|
-
}(), me =
|
|
173
|
+
}(), me = A.EMPTY;
|
|
174
174
|
function we(n) {
|
|
175
|
-
return n instanceof
|
|
175
|
+
return n instanceof A || n && "closed" in n && b(n.remove) && b(n.add) && b(n.unsubscribe);
|
|
176
176
|
}
|
|
177
177
|
function oe(n) {
|
|
178
178
|
b(n) ? n() : n.unsubscribe();
|
|
@@ -196,7 +196,7 @@ var Se = {
|
|
|
196
196
|
},
|
|
197
197
|
delegate: void 0
|
|
198
198
|
};
|
|
199
|
-
function
|
|
199
|
+
function Te(n) {
|
|
200
200
|
z.setTimeout(function() {
|
|
201
201
|
throw n;
|
|
202
202
|
});
|
|
@@ -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) {
|
|
@@ -237,7 +237,7 @@ var ee = function(n) {
|
|
|
237
237
|
this.unsubscribe();
|
|
238
238
|
}
|
|
239
239
|
}, t;
|
|
240
|
-
}(
|
|
240
|
+
}(A), Ue = Function.prototype.bind;
|
|
241
241
|
function k(n, t) {
|
|
242
242
|
return Ue.call(n, t);
|
|
243
243
|
}
|
|
@@ -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;
|
|
@@ -297,24 +297,24 @@ var $e = function() {
|
|
|
297
297
|
return t;
|
|
298
298
|
}(ee);
|
|
299
299
|
function P(n) {
|
|
300
|
-
|
|
300
|
+
Te(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
|
-
function
|
|
313
|
+
function Ee(n) {
|
|
314
314
|
return n;
|
|
315
315
|
}
|
|
316
316
|
function Fe(n) {
|
|
317
|
-
return n.length === 0 ?
|
|
317
|
+
return n.length === 0 ? Ee : n.length === 1 ? n[0] : function(e) {
|
|
318
318
|
return n.reduce(function(r, i) {
|
|
319
319
|
return i(r);
|
|
320
320
|
}, e);
|
|
@@ -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++)
|
|
@@ -393,7 +393,7 @@ function De(n) {
|
|
|
393
393
|
function Ne(n) {
|
|
394
394
|
return b(n == null ? void 0 : n.lift);
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function Ce(n) {
|
|
397
397
|
return function(t) {
|
|
398
398
|
if (Ne(t))
|
|
399
399
|
return t.lift(function(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
|
}
|
|
@@ -516,8 +516,8 @@ var ke = function(n) {
|
|
|
516
516
|
return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
|
|
517
517
|
}, t.prototype._innerSubscribe = function(e) {
|
|
518
518
|
var r = this, i = this, o = i.hasError, s = i.isStopped, c = i.observers;
|
|
519
|
-
return o || s ? me : (this.currentObservers = null, c.push(e), new
|
|
520
|
-
r.currentObservers = null,
|
|
519
|
+
return o || s ? me : (this.currentObservers = null, c.push(e), new A(function() {
|
|
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
|
-
}(
|
|
563
|
+
}(A), 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
|
},
|
|
@@ -673,8 +673,8 @@ function O(n, t) {
|
|
|
673
673
|
function Ke(n) {
|
|
674
674
|
return n instanceof Date && !isNaN(n);
|
|
675
675
|
}
|
|
676
|
-
function
|
|
677
|
-
return
|
|
676
|
+
function R(n, t) {
|
|
677
|
+
return Ce(function(e, r) {
|
|
678
678
|
var i = 0;
|
|
679
679
|
e.subscribe(xe(r, function(o) {
|
|
680
680
|
r.next(n.call(t, o, i++));
|
|
@@ -695,7 +695,7 @@ function Xe(n, t, e) {
|
|
|
695
695
|
}
|
|
696
696
|
function Ze(n, t, e) {
|
|
697
697
|
var r = b(n) || t || e ? { next: n, error: t, complete: e } : n;
|
|
698
|
-
return r ?
|
|
698
|
+
return r ? Ce(function(i, o) {
|
|
699
699
|
var s;
|
|
700
700
|
(s = r.subscribe) === null || s === void 0 || s.call(r);
|
|
701
701
|
var c = !0;
|
|
@@ -712,12 +712,12 @@ function Ze(n, t, e) {
|
|
|
712
712
|
var u, a;
|
|
713
713
|
c && ((u = r.unsubscribe) === null || u === void 0 || u.call(r)), (a = r.finalize) === null || a === void 0 || a.call(r);
|
|
714
714
|
}));
|
|
715
|
-
}) :
|
|
715
|
+
}) : Ee;
|
|
716
716
|
}
|
|
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,
|
|
718
|
-
class
|
|
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, C = (n, t, e) => (tt(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
718
|
+
class h extends Error {
|
|
719
719
|
constructor(t) {
|
|
720
|
-
super(`Incorrect context (${t}). Cannot perform the requested operation.`),
|
|
720
|
+
super(`Incorrect context (${t}). Cannot perform the requested operation.`), C(this, "context"), this.context = t;
|
|
721
721
|
}
|
|
722
722
|
}
|
|
723
723
|
class $ extends Error {
|
|
@@ -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();
|
|
@@ -1013,7 +1013,7 @@ var lt = function() {
|
|
|
1013
1013
|
try {
|
|
1014
1014
|
e.next(t);
|
|
1015
1015
|
} catch (r) {
|
|
1016
|
-
|
|
1016
|
+
T(r);
|
|
1017
1017
|
}
|
|
1018
1018
|
}, n.prototype.error = function(t) {
|
|
1019
1019
|
var e = this.partialObserver;
|
|
@@ -1021,17 +1021,17 @@ var lt = function() {
|
|
|
1021
1021
|
try {
|
|
1022
1022
|
e.error(t);
|
|
1023
1023
|
} catch (r) {
|
|
1024
|
-
|
|
1024
|
+
T(r);
|
|
1025
1025
|
}
|
|
1026
1026
|
else
|
|
1027
|
-
|
|
1027
|
+
T(t);
|
|
1028
1028
|
}, n.prototype.complete = function() {
|
|
1029
1029
|
var t = this.partialObserver;
|
|
1030
1030
|
if (t.complete)
|
|
1031
1031
|
try {
|
|
1032
1032
|
t.complete();
|
|
1033
1033
|
} catch (e) {
|
|
1034
|
-
|
|
1034
|
+
T(e);
|
|
1035
1035
|
}
|
|
1036
1036
|
}, n;
|
|
1037
1037
|
}(), X = function(n) {
|
|
@@ -1058,7 +1058,7 @@ var lt = function() {
|
|
|
1058
1058
|
}
|
|
1059
1059
|
return t;
|
|
1060
1060
|
}(ne);
|
|
1061
|
-
function
|
|
1061
|
+
function T(n) {
|
|
1062
1062
|
ut(n);
|
|
1063
1063
|
}
|
|
1064
1064
|
function ht(n) {
|
|
@@ -1066,23 +1066,23 @@ 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
|
}();
|
|
1075
|
-
function
|
|
1075
|
+
function Ae(n) {
|
|
1076
1076
|
return n;
|
|
1077
1077
|
}
|
|
1078
1078
|
function ft(n) {
|
|
1079
|
-
return n.length === 0 ?
|
|
1079
|
+
return n.length === 0 ? Ae : n.length === 1 ? n[0] : function(t) {
|
|
1080
1080
|
return n.reduce(function(e, r) {
|
|
1081
1081
|
return r(e);
|
|
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;
|
|
@@ -1239,7 +1239,7 @@ function v(n, t, e) {
|
|
|
1239
1239
|
var u, a;
|
|
1240
1240
|
c && ((u = r.unsubscribe) === null || u === void 0 || u.call(r)), (a = r.finalize) === null || a === void 0 || a.call(r);
|
|
1241
1241
|
}));
|
|
1242
|
-
}) :
|
|
1242
|
+
}) : Ae;
|
|
1243
1243
|
}
|
|
1244
1244
|
const wt = /^(\d+)\.(\d+)$/;
|
|
1245
1245
|
function St(n) {
|
|
@@ -1258,10 +1258,10 @@ function ie(n, t) {
|
|
|
1258
1258
|
const [e, r] = be(n), [i, o] = be(t);
|
|
1259
1259
|
return e < i ? -1 : e > i ? 1 : r < o ? -1 : r > o ? 1 : 0;
|
|
1260
1260
|
}
|
|
1261
|
-
function
|
|
1261
|
+
function Et(n, t) {
|
|
1262
1262
|
return ie(n, t) === 1;
|
|
1263
1263
|
}
|
|
1264
|
-
function
|
|
1264
|
+
function Ct(n, t) {
|
|
1265
1265
|
return ie(n, t) >= 0;
|
|
1266
1266
|
}
|
|
1267
1267
|
const ye = "2.0";
|
|
@@ -1276,7 +1276,7 @@ class xt {
|
|
|
1276
1276
|
* @param logService - An instance of a logging service or utility
|
|
1277
1277
|
*/
|
|
1278
1278
|
constructor(t, e) {
|
|
1279
|
-
if (
|
|
1279
|
+
if (C(this, "negotiatedProtocolVersion"), C(this, "currentContext"), C(this, "incomingMessages$"), C(this, "inIframe", !1), C(this, "embeddedResult"), C(this, "iframePort1"), C(this, "iframePort2"), this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new _e(), this.supportedVersions = t.filter((r) => Ct(r, ye)), !this.supportedVersions.length)
|
|
1280
1280
|
throw new he(t, ye);
|
|
1281
1281
|
this.negotiatedProtocolVersion = this.supportedVersions[0], this.embeddedResult = null, this.iframePort2 = null;
|
|
1282
1282
|
}
|
|
@@ -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
|
-
if (this.supportedVersions.some((o) =>
|
|
1337
|
+
if (this.supportedVersions.some((o) => Et(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,65 +1594,65 @@ 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
|
-
selectContacts(t, e, r) {
|
|
1626
|
+
selectContacts(t, e, r, i) {
|
|
1627
1627
|
if (!this.isEmbedded())
|
|
1628
|
-
throw new
|
|
1629
|
-
if (e === "group" &&
|
|
1628
|
+
throw new h(this.currentContext);
|
|
1629
|
+
if (e === "group" && i === void 0)
|
|
1630
1630
|
throw new $(
|
|
1631
1631
|
"currentContacts",
|
|
1632
|
-
|
|
1632
|
+
i,
|
|
1633
1633
|
"currentContacts is required for group streams"
|
|
1634
1634
|
);
|
|
1635
|
-
if (e === "direct" &&
|
|
1635
|
+
if (e === "direct" && i !== void 0)
|
|
1636
1636
|
throw new $(
|
|
1637
1637
|
"currentContacts",
|
|
1638
|
-
|
|
1638
|
+
i,
|
|
1639
1639
|
"currentContacts should not be passed for direct streams"
|
|
1640
1640
|
);
|
|
1641
|
-
const
|
|
1642
|
-
|
|
1643
|
-
const
|
|
1644
|
-
|
|
1645
|
-
|
|
1641
|
+
const o = "SELECT CONTACTS", s = this.createMessage(o, !0);
|
|
1642
|
+
s.streamType = e, s.streamId = t, s.contactType = r, s.currentContacts = i, this.logCreated(o, s);
|
|
1643
|
+
const c = this.incomingMessages$.pipe(
|
|
1644
|
+
v((u) => u.type === o && u.replyTo === s.id),
|
|
1645
|
+
p(this.logReceived(o)),
|
|
1646
1646
|
// validate if `streamId` is the same as we sent
|
|
1647
|
-
l((
|
|
1648
|
-
const
|
|
1649
|
-
if (
|
|
1650
|
-
throw new rt(
|
|
1651
|
-
return e === "direct" &&
|
|
1647
|
+
l((u) => {
|
|
1648
|
+
const a = u;
|
|
1649
|
+
if (a.streamId !== t)
|
|
1650
|
+
throw new rt(a.streamId, t);
|
|
1651
|
+
return e === "direct" && a.contacts.length > 1 && (a.contacts = [a.contacts[0]]), a;
|
|
1652
1652
|
}),
|
|
1653
1653
|
S(1)
|
|
1654
1654
|
);
|
|
1655
|
-
return this.logService.debug(`Created ${
|
|
1655
|
+
return this.logService.debug(`Created ${o} Reply handler`), this.port2.postMessage(s), this.logSent(o, s), c;
|
|
1656
1656
|
}
|
|
1657
1657
|
/**
|
|
1658
1658
|
* Request detailed contact information for the given Cloud usernames.
|
|
@@ -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
|
}
|
|
@@ -1974,7 +1995,7 @@ class It {
|
|
|
1974
1995
|
_(this, "logger");
|
|
1975
1996
|
_(this, "helper");
|
|
1976
1997
|
_(this, "listeners");
|
|
1977
|
-
this.logger = t ?? console, this.helper = new xt(_t, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(
|
|
1998
|
+
this.logger = t ?? console, this.helper = new xt(_t, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(E.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(E.HostInForeground, /* @__PURE__ */ new Set());
|
|
1978
1999
|
}
|
|
1979
2000
|
/**
|
|
1980
2001
|
* Returns whether the app is running inside a native WebView (`host` context) or as a
|
|
@@ -2016,34 +2037,39 @@ class It {
|
|
|
2016
2037
|
this.helper.onBadgeQueryMessage().subscribe((e) => {
|
|
2017
2038
|
var r;
|
|
2018
2039
|
this.logger.debug("Received Badge Query: ", e);
|
|
2019
|
-
for (const i of ((r = this.listeners.get(
|
|
2040
|
+
for (const i of ((r = this.listeners.get(E.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
|
|
2020
2041
|
i();
|
|
2021
2042
|
}), this.helper.onHostInForegroundMessage().subscribe((e) => {
|
|
2022
2043
|
var r;
|
|
2023
2044
|
this.logger.debug("Received Host In Foreground: ", e);
|
|
2024
|
-
for (const i of ((r = this.listeners.get(
|
|
2045
|
+
for (const i of ((r = this.listeners.get(E.HostInForeground)) == null ? void 0 : r.values()) ?? [])
|
|
2025
2046
|
i();
|
|
2026
2047
|
}), this.cloudId = t.cloudId, this.host = t.host;
|
|
2027
2048
|
}),
|
|
2028
|
-
|
|
2049
|
+
R(() => {
|
|
2029
2050
|
})
|
|
2030
2051
|
)
|
|
2031
2052
|
);
|
|
2032
2053
|
}
|
|
2033
|
-
selectContacts(t, e, r) {
|
|
2054
|
+
selectContacts(t, e, r, i) {
|
|
2034
2055
|
this.logger.debug("Selecting Contacts: ", ...arguments);
|
|
2035
|
-
let
|
|
2056
|
+
let o;
|
|
2036
2057
|
if (e === "multi") {
|
|
2037
|
-
if (!r)
|
|
2058
|
+
if (!r || !Array.isArray(r))
|
|
2038
2059
|
throw new $(
|
|
2039
2060
|
"currentContacts",
|
|
2040
2061
|
r,
|
|
2041
2062
|
"currentContacts is required for group streams"
|
|
2042
2063
|
);
|
|
2043
|
-
i = this.helper.selectContacts(
|
|
2064
|
+
i || (i = "cloudUsername"), o = this.helper.selectContacts(
|
|
2065
|
+
t.toString(),
|
|
2066
|
+
"group",
|
|
2067
|
+
i,
|
|
2068
|
+
r
|
|
2069
|
+
);
|
|
2044
2070
|
} else
|
|
2045
|
-
i = this.helper.selectContacts(t.toString(), "direct");
|
|
2046
|
-
return O(
|
|
2071
|
+
r ? i = r : i = "cloudUsername", o = this.helper.selectContacts(t.toString(), "direct", i);
|
|
2072
|
+
return O(o.pipe(R((s) => s.contacts)));
|
|
2047
2073
|
}
|
|
2048
2074
|
/**
|
|
2049
2075
|
* Matches batch of {@link ContactItem} objects against the Host's contact list to fetch detailed
|
|
@@ -2055,7 +2081,7 @@ class It {
|
|
|
2055
2081
|
* Host's contact list.
|
|
2056
2082
|
*/
|
|
2057
2083
|
matchContacts(t) {
|
|
2058
|
-
return this.logger.debug("Match Contacts: ", t), O(this.helper.matchContacts(t).pipe(
|
|
2084
|
+
return this.logger.debug("Match Contacts: ", t), O(this.helper.matchContacts(t).pipe(R((e) => e.contacts)));
|
|
2059
2085
|
}
|
|
2060
2086
|
/**
|
|
2061
2087
|
* Requests the `Host` app to provide the Push Token for the current device.
|
|
@@ -2063,7 +2089,7 @@ class It {
|
|
|
2063
2089
|
* @returns A promise with the Push Token as `string`.
|
|
2064
2090
|
*/
|
|
2065
2091
|
requestPushToken() {
|
|
2066
|
-
return this.logger.debug("Requesting Push Token"), O(this.helper.requestPushToken().pipe(
|
|
2092
|
+
return this.logger.debug("Requesting Push Token"), O(this.helper.requestPushToken().pipe(R((t) => t.pushToken)));
|
|
2067
2093
|
}
|
|
2068
2094
|
/**
|
|
2069
2095
|
* Sends the current badge count to the `Host` app.
|
|
@@ -2082,9 +2108,9 @@ class It {
|
|
|
2082
2108
|
*/
|
|
2083
2109
|
onBadgeQueryRequest(t) {
|
|
2084
2110
|
var e;
|
|
2085
|
-
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(
|
|
2111
|
+
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(E.BadgeQuery)) == null || e.add(t), () => {
|
|
2086
2112
|
var r;
|
|
2087
|
-
return (r = this.listeners.get(
|
|
2113
|
+
return (r = this.listeners.get(E.BadgeQuery)) == null ? void 0 : r.delete(t);
|
|
2088
2114
|
};
|
|
2089
2115
|
}
|
|
2090
2116
|
/**
|
|
@@ -2096,9 +2122,9 @@ class It {
|
|
|
2096
2122
|
*/
|
|
2097
2123
|
onHostInForeground(t) {
|
|
2098
2124
|
var e;
|
|
2099
|
-
return this.logger.debug("Registering for Host In Foreground"), (e = this.listeners.get(
|
|
2125
|
+
return this.logger.debug("Registering for Host In Foreground"), (e = this.listeners.get(E.HostInForeground)) == null || e.add(t), () => {
|
|
2100
2126
|
var r;
|
|
2101
|
-
return (r = this.listeners.get(
|
|
2127
|
+
return (r = this.listeners.get(E.HostInForeground)) == null ? void 0 : r.delete(t);
|
|
2102
2128
|
};
|
|
2103
2129
|
}
|
|
2104
2130
|
evaluateContext(t) {
|
|
@@ -2109,6 +2135,6 @@ class It {
|
|
|
2109
2135
|
}
|
|
2110
2136
|
}
|
|
2111
2137
|
export {
|
|
2112
|
-
|
|
2138
|
+
E as IPCEvents,
|
|
2113
2139
|
It as IPCManager
|
|
2114
2140
|
};
|