@acrobits/ipc-sdk 0.1.8 → 0.2.1-alpha.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 +346 -226
- 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,18 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
return
|
|
1
|
+
var Ae = Object.defineProperty;
|
|
2
|
+
var Re = (n, t, e) => t in n ? Ae(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var M = (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 || {}), z = function(n, t) {
|
|
5
|
+
return z = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
6
6
|
e.__proto__ = r;
|
|
7
7
|
} || function(e, r) {
|
|
8
8
|
for (var i in r)
|
|
9
9
|
Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
|
|
10
|
-
},
|
|
10
|
+
}, z(n, t);
|
|
11
11
|
};
|
|
12
12
|
function x(n, t) {
|
|
13
13
|
if (typeof t != "function" && t !== null)
|
|
14
14
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
15
|
-
|
|
15
|
+
z(n, t);
|
|
16
16
|
function e() {
|
|
17
17
|
this.constructor = n;
|
|
18
18
|
}
|
|
@@ -30,7 +30,7 @@ function G(n) {
|
|
|
30
30
|
};
|
|
31
31
|
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function _(n, t) {
|
|
34
34
|
var e = typeof Symbol == "function" && n[Symbol.iterator];
|
|
35
35
|
if (!e)
|
|
36
36
|
return n;
|
|
@@ -65,7 +65,7 @@ function Z(n) {
|
|
|
65
65
|
}, e = n(t);
|
|
66
66
|
return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
|
|
67
67
|
}
|
|
68
|
-
var
|
|
68
|
+
var H = Z(function(n) {
|
|
69
69
|
return function(e) {
|
|
70
70
|
n(this), this.message = e ? e.length + ` errors occurred during unsubscription:
|
|
71
71
|
` + e.map(function(r, i) {
|
|
@@ -108,30 +108,30 @@ var T = function() {
|
|
|
108
108
|
}
|
|
109
109
|
else
|
|
110
110
|
s.remove(this);
|
|
111
|
-
var
|
|
112
|
-
if (b(
|
|
111
|
+
var g = this.initialTeardown;
|
|
112
|
+
if (b(g))
|
|
113
113
|
try {
|
|
114
|
-
|
|
114
|
+
g();
|
|
115
115
|
} catch (d) {
|
|
116
|
-
o = d instanceof
|
|
116
|
+
o = d instanceof H ? d.errors : [d];
|
|
117
117
|
}
|
|
118
|
-
var
|
|
119
|
-
if (
|
|
118
|
+
var v = this._finalizers;
|
|
119
|
+
if (v) {
|
|
120
120
|
this._finalizers = null;
|
|
121
121
|
try {
|
|
122
|
-
for (var
|
|
122
|
+
for (var S = G(v), y = S.next(); !y.done; y = S.next()) {
|
|
123
123
|
var D = y.value;
|
|
124
124
|
try {
|
|
125
125
|
oe(D);
|
|
126
126
|
} catch (d) {
|
|
127
|
-
o = o ?? [], d instanceof
|
|
127
|
+
o = o ?? [], d instanceof H ? o = I(I([], _(o)), _(d.errors)) : o.push(d);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
} catch (d) {
|
|
131
131
|
r = { error: d };
|
|
132
132
|
} finally {
|
|
133
133
|
try {
|
|
134
|
-
y && !y.done && (i =
|
|
134
|
+
y && !y.done && (i = S.return) && i.call(S);
|
|
135
135
|
} finally {
|
|
136
136
|
if (r)
|
|
137
137
|
throw r.error;
|
|
@@ -139,7 +139,7 @@ var T = function() {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
if (o)
|
|
142
|
-
throw new
|
|
142
|
+
throw new H(o);
|
|
143
143
|
}
|
|
144
144
|
}, n.prototype.add = function(t) {
|
|
145
145
|
var e;
|
|
@@ -183,21 +183,21 @@ var Se = {
|
|
|
183
183
|
Promise: void 0,
|
|
184
184
|
useDeprecatedSynchronousErrorHandling: !1,
|
|
185
185
|
useDeprecatedNextContext: !1
|
|
186
|
-
},
|
|
186
|
+
}, Q = {
|
|
187
187
|
setTimeout: function(n, t) {
|
|
188
188
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
189
189
|
e[r - 2] = arguments[r];
|
|
190
|
-
var i =
|
|
191
|
-
return i != null && i.setTimeout ? i.setTimeout.apply(i, I([n, t],
|
|
190
|
+
var i = Q.delegate;
|
|
191
|
+
return i != null && i.setTimeout ? i.setTimeout.apply(i, I([n, t], _(e))) : setTimeout.apply(void 0, I([n, t], _(e)));
|
|
192
192
|
},
|
|
193
193
|
clearTimeout: function(n) {
|
|
194
|
-
var t =
|
|
194
|
+
var t = Q.delegate;
|
|
195
195
|
return ((t == null ? void 0 : t.clearTimeout) || clearTimeout)(n);
|
|
196
196
|
},
|
|
197
197
|
delegate: void 0
|
|
198
198
|
};
|
|
199
|
-
function
|
|
200
|
-
|
|
199
|
+
function Pe(n) {
|
|
200
|
+
Q.setTimeout(function() {
|
|
201
201
|
throw n;
|
|
202
202
|
});
|
|
203
203
|
}
|
|
@@ -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 = Fe, r;
|
|
214
214
|
}
|
|
215
215
|
return t.create = function(e, r, i) {
|
|
216
|
-
return new
|
|
216
|
+
return new F(e, r, i);
|
|
217
217
|
}, t.prototype.next = function(e) {
|
|
218
218
|
this.isStopped || this._next(e);
|
|
219
219
|
}, t.prototype.error = function(e) {
|
|
@@ -251,7 +251,7 @@ var $e = function() {
|
|
|
251
251
|
try {
|
|
252
252
|
e.next(t);
|
|
253
253
|
} catch (r) {
|
|
254
|
-
|
|
254
|
+
A(r);
|
|
255
255
|
}
|
|
256
256
|
}, n.prototype.error = function(t) {
|
|
257
257
|
var e = this.partialObserver;
|
|
@@ -259,20 +259,20 @@ var $e = function() {
|
|
|
259
259
|
try {
|
|
260
260
|
e.error(t);
|
|
261
261
|
} catch (r) {
|
|
262
|
-
|
|
262
|
+
A(r);
|
|
263
263
|
}
|
|
264
264
|
else
|
|
265
|
-
|
|
265
|
+
A(t);
|
|
266
266
|
}, n.prototype.complete = function() {
|
|
267
267
|
var t = this.partialObserver;
|
|
268
268
|
if (t.complete)
|
|
269
269
|
try {
|
|
270
270
|
t.complete();
|
|
271
271
|
} catch (e) {
|
|
272
|
-
|
|
272
|
+
A(e);
|
|
273
273
|
}
|
|
274
274
|
}, n;
|
|
275
|
-
}(),
|
|
275
|
+
}(), F = function(n) {
|
|
276
276
|
x(t, n);
|
|
277
277
|
function t(e, r, i) {
|
|
278
278
|
var o = n.call(this) || this, s;
|
|
@@ -296,25 +296,25 @@ var $e = function() {
|
|
|
296
296
|
}
|
|
297
297
|
return t;
|
|
298
298
|
}(ee);
|
|
299
|
-
function
|
|
300
|
-
|
|
299
|
+
function A(n) {
|
|
300
|
+
Pe(n);
|
|
301
301
|
}
|
|
302
302
|
function Le(n) {
|
|
303
303
|
throw n;
|
|
304
304
|
}
|
|
305
|
-
var
|
|
305
|
+
var Fe = {
|
|
306
306
|
closed: !0,
|
|
307
307
|
next: se,
|
|
308
308
|
error: Le,
|
|
309
309
|
complete: se
|
|
310
|
-
},
|
|
310
|
+
}, Ve = 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
|
-
function
|
|
317
|
-
return n.length === 0 ?
|
|
316
|
+
function je(n) {
|
|
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 F(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 F({
|
|
346
346
|
next: function(c) {
|
|
347
347
|
try {
|
|
348
348
|
t(c);
|
|
@@ -358,12 +358,12 @@ 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[Ve] = function() {
|
|
362
362
|
return this;
|
|
363
363
|
}, n.prototype.pipe = function() {
|
|
364
364
|
for (var t = [], e = 0; e < arguments.length; e++)
|
|
365
365
|
t[e] = arguments[e];
|
|
366
|
-
return
|
|
366
|
+
return je(t)(this);
|
|
367
367
|
}, n.prototype.toPromise = function(t) {
|
|
368
368
|
var e = this;
|
|
369
369
|
return t = ue(t), new t(function(r, i) {
|
|
@@ -384,18 +384,18 @@ function ue(n) {
|
|
|
384
384
|
var t;
|
|
385
385
|
return (t = n ?? Se.Promise) !== null && t !== void 0 ? t : Promise;
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function Ne(n) {
|
|
388
388
|
return n && b(n.next) && b(n.error) && b(n.complete);
|
|
389
389
|
}
|
|
390
390
|
function De(n) {
|
|
391
|
-
return n && n instanceof ee ||
|
|
391
|
+
return n && n instanceof ee || Ne(n) && we(n);
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function He(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
|
-
if (
|
|
398
|
+
if (He(t))
|
|
399
399
|
return t.lift(function(e) {
|
|
400
400
|
try {
|
|
401
401
|
return n(e, this);
|
|
@@ -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 (g) {
|
|
420
|
+
e.error(g);
|
|
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 (g) {
|
|
426
|
+
e.error(g);
|
|
427
427
|
} finally {
|
|
428
428
|
this.unsubscribe();
|
|
429
429
|
}
|
|
@@ -448,7 +448,7 @@ var ke = function(n) {
|
|
|
448
448
|
return function() {
|
|
449
449
|
n(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
450
450
|
};
|
|
451
|
-
}),
|
|
451
|
+
}), Me = function(n) {
|
|
452
452
|
x(t, n);
|
|
453
453
|
function t() {
|
|
454
454
|
var e = n.call(this) || this;
|
|
@@ -547,9 +547,9 @@ var ke = function(n) {
|
|
|
547
547
|
var r, i;
|
|
548
548
|
return (i = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e)) !== null && i !== void 0 ? i : me;
|
|
549
549
|
}, t;
|
|
550
|
-
}(
|
|
550
|
+
}(Me), _e = {
|
|
551
551
|
now: function() {
|
|
552
|
-
return (
|
|
552
|
+
return (_e.delegate || Date).now();
|
|
553
553
|
},
|
|
554
554
|
delegate: void 0
|
|
555
555
|
}, qe = function(n) {
|
|
@@ -560,19 +560,19 @@ var ke = function(n) {
|
|
|
560
560
|
return t.prototype.schedule = function(e, r) {
|
|
561
561
|
return this;
|
|
562
562
|
}, t;
|
|
563
|
-
}(T),
|
|
563
|
+
}(T), V = {
|
|
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 =
|
|
568
|
-
return i != null && i.setInterval ? i.setInterval.apply(i, I([n, t],
|
|
567
|
+
var i = V.delegate;
|
|
568
|
+
return i != null && i.setInterval ? i.setInterval.apply(i, I([n, t], _(e))) : setInterval.apply(void 0, I([n, t], _(e)));
|
|
569
569
|
},
|
|
570
570
|
clearInterval: function(n) {
|
|
571
|
-
var t =
|
|
571
|
+
var t = V.delegate;
|
|
572
572
|
return ((t == null ? void 0 : t.clearInterval) || clearInterval)(n);
|
|
573
573
|
},
|
|
574
574
|
delegate: void 0
|
|
575
|
-
},
|
|
575
|
+
}, ze = function(n) {
|
|
576
576
|
x(t, n);
|
|
577
577
|
function t(e, r) {
|
|
578
578
|
var i = n.call(this, e, r) || this;
|
|
@@ -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), V.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 && V.clearInterval(r);
|
|
594
594
|
}, t.prototype.execute = function(e, r) {
|
|
595
595
|
if (this.closed)
|
|
596
596
|
return new Error("executing a cancelled action");
|
|
@@ -620,7 +620,7 @@ var ke = function(n) {
|
|
|
620
620
|
}
|
|
621
621
|
return n.prototype.schedule = function(t, e, r) {
|
|
622
622
|
return e === void 0 && (e = 0), new this.schedulerActionCtor(this, t).schedule(r, e);
|
|
623
|
-
}, n.now =
|
|
623
|
+
}, n.now = _e.now, n;
|
|
624
624
|
}(), Ge = function(n) {
|
|
625
625
|
x(t, n);
|
|
626
626
|
function t(e, r) {
|
|
@@ -646,7 +646,7 @@ var ke = function(n) {
|
|
|
646
646
|
throw i;
|
|
647
647
|
}
|
|
648
648
|
}, t;
|
|
649
|
-
}(ae),
|
|
649
|
+
}(ae), Qe = new Ge(ze), Ye = Qe;
|
|
650
650
|
function Je(n) {
|
|
651
651
|
return n && b(n.schedule);
|
|
652
652
|
}
|
|
@@ -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 F({
|
|
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 l 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 {
|
|
@@ -748,13 +748,13 @@ class he extends Error {
|
|
|
748
748
|
e && (r += ` Minimum version supported is ${e}.`), super(r), this.version = t;
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function w(n) {
|
|
752
752
|
return typeof n == "function";
|
|
753
753
|
}
|
|
754
754
|
function it(n) {
|
|
755
|
-
return
|
|
755
|
+
return w(n == null ? void 0 : n.lift);
|
|
756
756
|
}
|
|
757
|
-
function
|
|
757
|
+
function j(n) {
|
|
758
758
|
return function(t) {
|
|
759
759
|
if (it(t))
|
|
760
760
|
return t.lift(function(e) {
|
|
@@ -871,18 +871,18 @@ var re = function() {
|
|
|
871
871
|
}
|
|
872
872
|
else
|
|
873
873
|
s.remove(this);
|
|
874
|
-
var
|
|
875
|
-
if (
|
|
874
|
+
var g = this.initialTeardown;
|
|
875
|
+
if (w(g))
|
|
876
876
|
try {
|
|
877
|
-
|
|
877
|
+
g();
|
|
878
878
|
} catch (d) {
|
|
879
879
|
o = d instanceof B ? d.errors : [d];
|
|
880
880
|
}
|
|
881
|
-
var
|
|
882
|
-
if (
|
|
881
|
+
var v = this._finalizers;
|
|
882
|
+
if (v) {
|
|
883
883
|
this._finalizers = null;
|
|
884
884
|
try {
|
|
885
|
-
for (var
|
|
885
|
+
for (var S = de(v), y = S.next(); !y.done; y = S.next()) {
|
|
886
886
|
var D = y.value;
|
|
887
887
|
try {
|
|
888
888
|
fe(D);
|
|
@@ -894,7 +894,7 @@ var re = function() {
|
|
|
894
894
|
r = { error: d };
|
|
895
895
|
} finally {
|
|
896
896
|
try {
|
|
897
|
-
y && !y.done && (i =
|
|
897
|
+
y && !y.done && (i = S.return) && i.call(S);
|
|
898
898
|
} finally {
|
|
899
899
|
if (r)
|
|
900
900
|
throw r.error;
|
|
@@ -936,10 +936,10 @@ var re = function() {
|
|
|
936
936
|
}();
|
|
937
937
|
re.EMPTY;
|
|
938
938
|
function Ie(n) {
|
|
939
|
-
return n instanceof re || n && "closed" in n &&
|
|
939
|
+
return n instanceof re || n && "closed" in n && w(n.remove) && w(n.add) && w(n.unsubscribe);
|
|
940
940
|
}
|
|
941
941
|
function fe(n) {
|
|
942
|
-
|
|
942
|
+
w(n) ? n() : n.unsubscribe();
|
|
943
943
|
}
|
|
944
944
|
var Oe = {
|
|
945
945
|
onUnhandledError: null,
|
|
@@ -1013,7 +1013,7 @@ var lt = function() {
|
|
|
1013
1013
|
try {
|
|
1014
1014
|
e.next(t);
|
|
1015
1015
|
} catch (r) {
|
|
1016
|
-
|
|
1016
|
+
P(r);
|
|
1017
1017
|
}
|
|
1018
1018
|
}, n.prototype.error = function(t) {
|
|
1019
1019
|
var e = this.partialObserver;
|
|
@@ -1021,24 +1021,24 @@ var lt = function() {
|
|
|
1021
1021
|
try {
|
|
1022
1022
|
e.error(t);
|
|
1023
1023
|
} catch (r) {
|
|
1024
|
-
|
|
1024
|
+
P(r);
|
|
1025
1025
|
}
|
|
1026
1026
|
else
|
|
1027
|
-
|
|
1027
|
+
P(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
|
+
P(e);
|
|
1035
1035
|
}
|
|
1036
1036
|
}, n;
|
|
1037
1037
|
}(), X = function(n) {
|
|
1038
1038
|
te(t, n);
|
|
1039
1039
|
function t(e, r, i) {
|
|
1040
1040
|
var o = n.call(this) || this, s;
|
|
1041
|
-
if (
|
|
1041
|
+
if (w(e) || !e)
|
|
1042
1042
|
s = {
|
|
1043
1043
|
next: e ?? void 0,
|
|
1044
1044
|
error: r ?? void 0,
|
|
@@ -1058,7 +1058,7 @@ var lt = function() {
|
|
|
1058
1058
|
}
|
|
1059
1059
|
return t;
|
|
1060
1060
|
}(ne);
|
|
1061
|
-
function
|
|
1061
|
+
function P(n) {
|
|
1062
1062
|
ut(n);
|
|
1063
1063
|
}
|
|
1064
1064
|
function ht(n) {
|
|
@@ -1147,12 +1147,12 @@ function ve(n) {
|
|
|
1147
1147
|
return (t = n ?? Oe.Promise) !== null && t !== void 0 ? t : Promise;
|
|
1148
1148
|
}
|
|
1149
1149
|
function vt(n) {
|
|
1150
|
-
return n &&
|
|
1150
|
+
return n && w(n.next) && w(n.error) && w(n.complete);
|
|
1151
1151
|
}
|
|
1152
1152
|
function bt(n) {
|
|
1153
1153
|
return n && n instanceof ne || vt(n) && Ie(n);
|
|
1154
1154
|
}
|
|
1155
|
-
function
|
|
1155
|
+
function N(n, t, e, r, i) {
|
|
1156
1156
|
return new yt(n, t, e, r, i);
|
|
1157
1157
|
}
|
|
1158
1158
|
var yt = function(n) {
|
|
@@ -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 (g) {
|
|
1166
|
+
e.error(g);
|
|
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 (g) {
|
|
1172
|
+
e.error(g);
|
|
1173
1173
|
} finally {
|
|
1174
1174
|
this.unsubscribe();
|
|
1175
1175
|
}
|
|
@@ -1191,10 +1191,10 @@ var yt = function(n) {
|
|
|
1191
1191
|
}
|
|
1192
1192
|
}, t;
|
|
1193
1193
|
}(ne);
|
|
1194
|
-
function
|
|
1195
|
-
return
|
|
1194
|
+
function h(n, t) {
|
|
1195
|
+
return j(function(e, r) {
|
|
1196
1196
|
var i = 0;
|
|
1197
|
-
e.subscribe(
|
|
1197
|
+
e.subscribe(N(r, function(o) {
|
|
1198
1198
|
r.next(n.call(t, o, i++));
|
|
1199
1199
|
}));
|
|
1200
1200
|
});
|
|
@@ -1202,31 +1202,31 @@ function l(n, t) {
|
|
|
1202
1202
|
var mt = new gt(function(n) {
|
|
1203
1203
|
return n.complete();
|
|
1204
1204
|
});
|
|
1205
|
-
function
|
|
1205
|
+
function m(n) {
|
|
1206
1206
|
return n <= 0 ? function() {
|
|
1207
1207
|
return mt;
|
|
1208
|
-
} :
|
|
1208
|
+
} : j(function(t, e) {
|
|
1209
1209
|
var r = 0;
|
|
1210
|
-
t.subscribe(
|
|
1210
|
+
t.subscribe(N(e, function(i) {
|
|
1211
1211
|
++r <= n && (e.next(i), n <= r && e.complete());
|
|
1212
1212
|
}));
|
|
1213
1213
|
});
|
|
1214
1214
|
}
|
|
1215
|
-
function
|
|
1216
|
-
return
|
|
1215
|
+
function f(n, t) {
|
|
1216
|
+
return j(function(e, r) {
|
|
1217
1217
|
var i = 0;
|
|
1218
|
-
e.subscribe(
|
|
1218
|
+
e.subscribe(N(r, function(o) {
|
|
1219
1219
|
return n.call(t, o, i++) && r.next(o);
|
|
1220
1220
|
}));
|
|
1221
1221
|
});
|
|
1222
1222
|
}
|
|
1223
1223
|
function p(n, t, e) {
|
|
1224
|
-
var r =
|
|
1225
|
-
return r ?
|
|
1224
|
+
var r = w(n) || t || e ? { next: n, error: t, complete: e } : n;
|
|
1225
|
+
return r ? j(function(i, o) {
|
|
1226
1226
|
var s;
|
|
1227
1227
|
(s = r.subscribe) === null || s === void 0 || s.call(r);
|
|
1228
1228
|
var c = !0;
|
|
1229
|
-
i.subscribe(
|
|
1229
|
+
i.subscribe(N(o, function(u) {
|
|
1230
1230
|
var a;
|
|
1231
1231
|
(a = r.next) === null || a === void 0 || a.call(r, u), o.next(u);
|
|
1232
1232
|
}, function() {
|
|
@@ -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 Me(), 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
|
}
|
|
@@ -1314,8 +1314,8 @@ class xt {
|
|
|
1314
1314
|
*/
|
|
1315
1315
|
determineContext() {
|
|
1316
1316
|
return Xe(1e3).pipe(
|
|
1317
|
-
|
|
1318
|
-
|
|
1317
|
+
h(() => (this.isEmbedded() ? this.currentContext = "user" : this.currentContext = "guest", this.currentContext)),
|
|
1318
|
+
m(1)
|
|
1319
1319
|
);
|
|
1320
1320
|
}
|
|
1321
1321
|
/**
|
|
@@ -1326,15 +1326,15 @@ class xt {
|
|
|
1326
1326
|
*/
|
|
1327
1327
|
openBridge() {
|
|
1328
1328
|
if (!this.isEmbedded())
|
|
1329
|
-
throw new
|
|
1329
|
+
throw new l(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
|
-
|
|
1334
|
-
|
|
1333
|
+
f((i) => i.type === t && i.replyTo === e.id),
|
|
1334
|
+
h((i) => i),
|
|
1335
1335
|
p(this.logReceived(t)),
|
|
1336
|
-
|
|
1337
|
-
if (this.supportedVersions.some((o) =>
|
|
1336
|
+
h((i) => {
|
|
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
|
}),
|
|
@@ -1343,7 +1343,7 @@ class xt {
|
|
|
1343
1343
|
`[IPC] Negotiated IPC Protocol Version: ${this.negotiatedProtocolVersion}`
|
|
1344
1344
|
);
|
|
1345
1345
|
}),
|
|
1346
|
-
|
|
1346
|
+
m(1)
|
|
1347
1347
|
);
|
|
1348
1348
|
return this.logService.debug(`Created ${t} Reply handler`), this.inIframe ? this.createIframeChannel().then(() => this.finishIpcSetup(e)) : this.finishIpcSetup(e), r;
|
|
1349
1349
|
}
|
|
@@ -1356,14 +1356,14 @@ class xt {
|
|
|
1356
1356
|
*/
|
|
1357
1357
|
requestSSOToken() {
|
|
1358
1358
|
if (!this.isEmbedded())
|
|
1359
|
-
throw new
|
|
1359
|
+
throw new l(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
|
-
|
|
1364
|
-
|
|
1363
|
+
f((i) => i.type === t && i.replyTo === e.id),
|
|
1364
|
+
h((i) => i),
|
|
1365
1365
|
p(this.logReceived(t)),
|
|
1366
|
-
|
|
1366
|
+
m(1)
|
|
1367
1367
|
);
|
|
1368
1368
|
return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
|
|
1369
1369
|
}
|
|
@@ -1382,7 +1382,7 @@ class xt {
|
|
|
1382
1382
|
*/
|
|
1383
1383
|
sendJoiningRoomMessage(t) {
|
|
1384
1384
|
if (!this.isEmbedded())
|
|
1385
|
-
throw new
|
|
1385
|
+
throw new l(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, g = "JOINING ROOM", v = this.createMessage(g, !1);
|
|
1396
|
+
v.roomName = e, v.jwtToken = o, v.serverUrl = s, v.region = c, v.roomInvite = r, v.joinMicMuted = u ?? !1, v.joinWithoutCamera = a ?? !1, v.displayName = i, this.logCreated(g, v), this.port2.postMessage(v), this.logSent(g, v);
|
|
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 l(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,13 +1440,13 @@ class xt {
|
|
|
1440
1440
|
*/
|
|
1441
1441
|
onJoinRoomMessage() {
|
|
1442
1442
|
if (!this.isEmbedded())
|
|
1443
|
-
throw new
|
|
1443
|
+
throw new l(this.currentContext);
|
|
1444
1444
|
const t = "JOIN ROOM";
|
|
1445
1445
|
return this.incomingMessages$.pipe(
|
|
1446
|
-
|
|
1447
|
-
|
|
1446
|
+
f((e) => e.type === t && e.target === "client"),
|
|
1447
|
+
h((e) => e),
|
|
1448
1448
|
p(this.logReceived(t)),
|
|
1449
|
-
|
|
1449
|
+
h((e) => e)
|
|
1450
1450
|
);
|
|
1451
1451
|
}
|
|
1452
1452
|
/**
|
|
@@ -1476,13 +1476,13 @@ class xt {
|
|
|
1476
1476
|
*/
|
|
1477
1477
|
onLeaveRoomMessage() {
|
|
1478
1478
|
if (!this.isEmbedded())
|
|
1479
|
-
throw new
|
|
1479
|
+
throw new l(this.currentContext);
|
|
1480
1480
|
const t = "LEAVE ROOM";
|
|
1481
1481
|
return this.incomingMessages$.pipe(
|
|
1482
|
-
|
|
1483
|
-
|
|
1482
|
+
f((e) => e.type === t && e.target === "client"),
|
|
1483
|
+
h((e) => e),
|
|
1484
1484
|
p(this.logReceived(t)),
|
|
1485
|
-
|
|
1485
|
+
h((e) => e)
|
|
1486
1486
|
);
|
|
1487
1487
|
}
|
|
1488
1488
|
/**
|
|
@@ -1513,13 +1513,13 @@ class xt {
|
|
|
1513
1513
|
*/
|
|
1514
1514
|
onConfigMessage() {
|
|
1515
1515
|
if (!this.isEmbedded())
|
|
1516
|
-
throw new
|
|
1516
|
+
throw new l(this.currentContext);
|
|
1517
1517
|
const t = "CONFIG";
|
|
1518
1518
|
return this.incomingMessages$.pipe(
|
|
1519
|
-
|
|
1520
|
-
|
|
1519
|
+
f((e) => e.type === t && e.target === "client"),
|
|
1520
|
+
h((e) => e),
|
|
1521
1521
|
p(this.logReceived(t)),
|
|
1522
|
-
|
|
1522
|
+
h((e) => ({
|
|
1523
1523
|
preferredCameraType: e.preferredCameraType,
|
|
1524
1524
|
preferredMicType: e.preferredMicType,
|
|
1525
1525
|
preferredOutputType: e.preferredOutputType,
|
|
@@ -1535,29 +1535,29 @@ class xt {
|
|
|
1535
1535
|
}
|
|
1536
1536
|
sendScreenshareSourceMessage(t) {
|
|
1537
1537
|
if (!this.isEmbedded())
|
|
1538
|
-
throw new
|
|
1538
|
+
throw new l(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
|
-
|
|
1543
|
-
|
|
1542
|
+
f((o) => o.type === e && o.replyTo === r.id),
|
|
1543
|
+
h((o) => o),
|
|
1544
1544
|
p(this.logReceived(e)),
|
|
1545
|
-
|
|
1546
|
-
|
|
1545
|
+
h((o) => o),
|
|
1546
|
+
m(1)
|
|
1547
1547
|
);
|
|
1548
1548
|
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
|
|
1549
1549
|
}
|
|
1550
1550
|
layoutChange(t, e, r) {
|
|
1551
1551
|
if (!this.isEmbedded())
|
|
1552
|
-
throw new
|
|
1552
|
+
throw new l(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
|
-
|
|
1557
|
-
|
|
1556
|
+
f((c) => c.type === i && c.replyTo === o.id),
|
|
1557
|
+
h((c) => c),
|
|
1558
1558
|
p(this.logReceived(i)),
|
|
1559
|
-
|
|
1560
|
-
|
|
1559
|
+
h((c) => c),
|
|
1560
|
+
m(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)
|
|
1562
1562
|
return s;
|
|
1563
1563
|
}
|
|
@@ -1594,65 +1594,65 @@ class xt {
|
|
|
1594
1594
|
*/
|
|
1595
1595
|
onLayoutChangeMessage() {
|
|
1596
1596
|
if (!this.isEmbedded())
|
|
1597
|
-
throw new
|
|
1597
|
+
throw new l(this.currentContext);
|
|
1598
1598
|
const t = "LAYOUT CHANGE";
|
|
1599
1599
|
return this.incomingMessages$.pipe(
|
|
1600
|
-
|
|
1601
|
-
|
|
1600
|
+
f((e) => e.type === t && e.target === "client" && e.replyTo === null),
|
|
1601
|
+
h((e) => e),
|
|
1602
1602
|
p(this.logReceived(t)),
|
|
1603
|
-
|
|
1603
|
+
h((e) => e)
|
|
1604
1604
|
);
|
|
1605
1605
|
}
|
|
1606
1606
|
requestOAuthToken(t) {
|
|
1607
1607
|
if (!this.isEmbedded())
|
|
1608
|
-
throw new
|
|
1608
|
+
throw new l(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
|
-
|
|
1614
|
-
|
|
1613
|
+
f((o) => o.type === e && o.replyTo === r.id),
|
|
1614
|
+
h((o) => o),
|
|
1615
1615
|
p(this.logReceived(e)),
|
|
1616
|
-
|
|
1616
|
+
m(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 l(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 l(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
|
-
p(this.logReceived(
|
|
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
|
+
f((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
|
-
|
|
1648
|
-
const
|
|
1649
|
-
if (
|
|
1650
|
-
throw new rt(
|
|
1651
|
-
return e === "direct" &&
|
|
1647
|
+
h((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
|
+
m(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,16 +1664,16 @@ class xt {
|
|
|
1664
1664
|
*/
|
|
1665
1665
|
matchContacts(t) {
|
|
1666
1666
|
if (!this.isEmbedded())
|
|
1667
|
-
throw new
|
|
1667
|
+
throw new l(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
|
-
|
|
1673
|
+
f((o) => o.type === e && o.replyTo === r.id),
|
|
1674
1674
|
p(this.logReceived(e)),
|
|
1675
|
-
|
|
1676
|
-
|
|
1675
|
+
h((o) => o),
|
|
1676
|
+
m(1)
|
|
1677
1677
|
);
|
|
1678
1678
|
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
|
|
1679
1679
|
}
|
|
@@ -1705,11 +1705,11 @@ class xt {
|
|
|
1705
1705
|
*/
|
|
1706
1706
|
onPushMessageMessage() {
|
|
1707
1707
|
if (!this.isEmbedded())
|
|
1708
|
-
throw new
|
|
1708
|
+
throw new l(this.currentContext);
|
|
1709
1709
|
const t = "PUSH MESSAGE";
|
|
1710
1710
|
return this.incomingMessages$.pipe(
|
|
1711
|
-
|
|
1712
|
-
|
|
1711
|
+
f((e) => e.type === t && e.target === "client"),
|
|
1712
|
+
h((e) => e),
|
|
1713
1713
|
p(this.logReceived(t))
|
|
1714
1714
|
);
|
|
1715
1715
|
}
|
|
@@ -1724,14 +1724,14 @@ class xt {
|
|
|
1724
1724
|
*/
|
|
1725
1725
|
requestPushToken() {
|
|
1726
1726
|
if (!this.isEmbedded())
|
|
1727
|
-
throw new
|
|
1727
|
+
throw new l(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
|
-
|
|
1731
|
+
f((i) => i.type === t && i.replyTo === e.id),
|
|
1732
1732
|
p(this.logReceived(t)),
|
|
1733
|
-
|
|
1734
|
-
|
|
1733
|
+
h((i) => i),
|
|
1734
|
+
m(1)
|
|
1735
1735
|
);
|
|
1736
1736
|
return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
|
|
1737
1737
|
}
|
|
@@ -1744,11 +1744,11 @@ class xt {
|
|
|
1744
1744
|
*/
|
|
1745
1745
|
onBadgeQueryMessage() {
|
|
1746
1746
|
if (!this.isEmbedded())
|
|
1747
|
-
throw new
|
|
1747
|
+
throw new l(this.currentContext);
|
|
1748
1748
|
const t = "BADGE QUERY";
|
|
1749
1749
|
return this.incomingMessages$.pipe(
|
|
1750
|
-
|
|
1751
|
-
|
|
1750
|
+
f((e) => e.type === t && e.target === "client"),
|
|
1751
|
+
h((e) => e),
|
|
1752
1752
|
p(this.logReceived(t))
|
|
1753
1753
|
);
|
|
1754
1754
|
}
|
|
@@ -1765,7 +1765,7 @@ class xt {
|
|
|
1765
1765
|
*/
|
|
1766
1766
|
sendBadgeUpdateMessage(t, e) {
|
|
1767
1767
|
if (!this.isEmbedded())
|
|
1768
|
-
throw new
|
|
1768
|
+
throw new l(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,11 +1782,11 @@ class xt {
|
|
|
1782
1782
|
*/
|
|
1783
1783
|
onHostInForegroundMessage() {
|
|
1784
1784
|
if (!this.isEmbedded())
|
|
1785
|
-
throw new
|
|
1785
|
+
throw new l(this.currentContext);
|
|
1786
1786
|
const t = "HOST IN FOREGROUND";
|
|
1787
1787
|
return this.incomingMessages$.pipe(
|
|
1788
|
-
|
|
1789
|
-
|
|
1788
|
+
f((e) => e.type === t && e.target === "client"),
|
|
1789
|
+
h((e) => e),
|
|
1790
1790
|
p(this.logReceived(t))
|
|
1791
1791
|
);
|
|
1792
1792
|
}
|
|
@@ -1805,7 +1805,7 @@ class xt {
|
|
|
1805
1805
|
*/
|
|
1806
1806
|
sendLifecycleMessage(t, e) {
|
|
1807
1807
|
if (!this.isEmbedded())
|
|
1808
|
-
throw new
|
|
1808
|
+
throw new l(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
|
}
|
|
@@ -1822,11 +1822,11 @@ class xt {
|
|
|
1822
1822
|
*/
|
|
1823
1823
|
onLifecycleMessage() {
|
|
1824
1824
|
if (!this.isEmbedded())
|
|
1825
|
-
throw new
|
|
1825
|
+
throw new l(this.currentContext);
|
|
1826
1826
|
const t = "LIFECYCLE";
|
|
1827
1827
|
return this.incomingMessages$.pipe(
|
|
1828
|
-
|
|
1829
|
-
|
|
1828
|
+
f((e) => e.type === t && e.target === "client"),
|
|
1829
|
+
h((e) => e),
|
|
1830
1830
|
p(this.logReceived(t))
|
|
1831
1831
|
);
|
|
1832
1832
|
}
|
|
@@ -1844,7 +1844,7 @@ class xt {
|
|
|
1844
1844
|
*/
|
|
1845
1845
|
sendLogMessage(t, e) {
|
|
1846
1846
|
if (!this.isEmbedded())
|
|
1847
|
-
throw new
|
|
1847
|
+
throw new l(this.currentContext);
|
|
1848
1848
|
const r = "LOG", i = this.createMessage(r, !1);
|
|
1849
1849
|
i.level = t, i.message = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
|
|
1850
1850
|
}
|
|
@@ -1862,11 +1862,11 @@ class xt {
|
|
|
1862
1862
|
*/
|
|
1863
1863
|
onRequestLogsMessage() {
|
|
1864
1864
|
if (!this.isEmbedded())
|
|
1865
|
-
throw new
|
|
1865
|
+
throw new l(this.currentContext);
|
|
1866
1866
|
const t = "REQUEST LOGS";
|
|
1867
1867
|
return this.incomingMessages$.pipe(
|
|
1868
|
-
|
|
1869
|
-
|
|
1868
|
+
f((e) => e.type === t && e.target === "client"),
|
|
1869
|
+
h((e) => e),
|
|
1870
1870
|
p(this.logReceived(t))
|
|
1871
1871
|
);
|
|
1872
1872
|
}
|
|
@@ -1885,10 +1885,125 @@ class xt {
|
|
|
1885
1885
|
*/
|
|
1886
1886
|
sendViewTransitionMessage(t, e) {
|
|
1887
1887
|
if (!this.isEmbedded())
|
|
1888
|
-
throw new
|
|
1888
|
+
throw new l(this.currentContext);
|
|
1889
1889
|
const r = "VIEW TRANSITION", i = this.createMessage(r, !1);
|
|
1890
1890
|
i.transitionType = t, i.targetView = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
|
|
1891
1891
|
}
|
|
1892
|
+
/**
|
|
1893
|
+
* Send a {@link FileTransferMessage} to the `Host` app, to transfer a file.
|
|
1894
|
+
*
|
|
1895
|
+
* @remarks
|
|
1896
|
+
* The file data can be either `base64` encoded string or a raw byte array `buffer` encoded as an
|
|
1897
|
+
* ArrayBuffer. An SHA256 hash of the file is also sent to the `Host` app to verify the file
|
|
1898
|
+
* integrity.
|
|
1899
|
+
*
|
|
1900
|
+
* @param payload - The {@link FileTransferPayload} to send to the host app.
|
|
1901
|
+
*
|
|
1902
|
+
* @returns This method returns void.
|
|
1903
|
+
*/
|
|
1904
|
+
fileTransfer(t) {
|
|
1905
|
+
if (!this.isEmbedded())
|
|
1906
|
+
throw new l(this.currentContext);
|
|
1907
|
+
const e = "FILE TRANSFER", r = this.createMessage(e, !1);
|
|
1908
|
+
r.mimeType = t.mimeType, r.fileName = t.fileName, r.fileSize = t.fileSize, r.fileHash = t.fileHash, r.dataType = t.dataType, r.fileId = t.fileId, r.data = t.data, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);
|
|
1909
|
+
}
|
|
1910
|
+
/**
|
|
1911
|
+
* Setup listener for {@link FileTransferMessage}, which can be sent by a `Host` app to transfer
|
|
1912
|
+
* a file to the `Client` app.
|
|
1913
|
+
*
|
|
1914
|
+
* @remarks
|
|
1915
|
+
* The `Host` app can send the file as a `base64` encoded string or a raw byte array `buffer` in
|
|
1916
|
+
* an ArrayBuffer. An SHA256 hash of the file is also sent to the `Client` app to verify the file
|
|
1917
|
+
* integrity.
|
|
1918
|
+
*
|
|
1919
|
+
* @returns An observable that emits whenever {@link FileTransferMessage} is received so it can
|
|
1920
|
+
* be subscribed to indefinitely.
|
|
1921
|
+
*/
|
|
1922
|
+
onFileTransferMessage() {
|
|
1923
|
+
if (!this.isEmbedded())
|
|
1924
|
+
throw new l(this.currentContext);
|
|
1925
|
+
const t = "FILE TRANSFER";
|
|
1926
|
+
return this.incomingMessages$.pipe(
|
|
1927
|
+
f((e) => e.type === t && e.target === "client"),
|
|
1928
|
+
h((e) => e),
|
|
1929
|
+
p(this.logReceived(t))
|
|
1930
|
+
);
|
|
1931
|
+
}
|
|
1932
|
+
/**
|
|
1933
|
+
* Sends a {@link FileSelectionMessage} to the Host app, to request the user to select on or
|
|
1934
|
+
* more files.
|
|
1935
|
+
*
|
|
1936
|
+
* @remarks
|
|
1937
|
+
* The `Host` app should reply with a {@link FileSelectionMessageReply} containing the number of
|
|
1938
|
+
* files the user selected along with the file identifiers.
|
|
1939
|
+
*
|
|
1940
|
+
* The file identifiers can be used to corelate files being transferred via the
|
|
1941
|
+
* {@link FileTransferMessage} afterwards.
|
|
1942
|
+
*
|
|
1943
|
+
* @param maxCount - _Optional_. The maximum number of files the user can select. Defaults to
|
|
1944
|
+
* unlimited.
|
|
1945
|
+
* @param mimeTypes - _Optional_. The MIME type of the files to select. Defaults to `*\/*`.
|
|
1946
|
+
*
|
|
1947
|
+
* @returns This method returns void.
|
|
1948
|
+
*/
|
|
1949
|
+
sendFileSelectionMessage(t, e) {
|
|
1950
|
+
if (!this.isEmbedded())
|
|
1951
|
+
throw new l(this.currentContext);
|
|
1952
|
+
const r = "FILE SELECTION", i = this.createMessage(r);
|
|
1953
|
+
i.maxCount = t, i.mimeTypes = e, this.logCreated(r, i);
|
|
1954
|
+
const o = this.incomingMessages$.pipe(
|
|
1955
|
+
f((s) => s.type === r && s.replyTo === i.id),
|
|
1956
|
+
p(this.logReceived(r)),
|
|
1957
|
+
h((s) => s),
|
|
1958
|
+
m(1)
|
|
1959
|
+
);
|
|
1960
|
+
return this.port2.postMessage(i), this.logSent(r, i), o;
|
|
1961
|
+
}
|
|
1962
|
+
/**
|
|
1963
|
+
* Sends a {@link FileDownloadMessage} to the Host app, to request the download of a file.
|
|
1964
|
+
*
|
|
1965
|
+
* @remarks
|
|
1966
|
+
* The file at the specified `url` is encrypted using the provided `key` and the Host app needs
|
|
1967
|
+
* to decrypt it.
|
|
1968
|
+
*
|
|
1969
|
+
* The reply does not include the file itself. The file will be transferred via the
|
|
1970
|
+
* {@link FileTransferMessage} afterwards if required.
|
|
1971
|
+
*
|
|
1972
|
+
* @param url - The URL to download the file from
|
|
1973
|
+
* @param key - The decryption key for the file stream
|
|
1974
|
+
* @param fileName - The name of the file to download
|
|
1975
|
+
* @param mimeType - The MIME type of the file to download
|
|
1976
|
+
* @returns An observable which emits a {@link FileDownloadMessageReply} instance containing the
|
|
1977
|
+
* file ID and the file size in bytes. Emits once.
|
|
1978
|
+
*/
|
|
1979
|
+
sendFileDownloadMessage(t, e, r, i) {
|
|
1980
|
+
if (!this.isEmbedded())
|
|
1981
|
+
throw new l(this.currentContext);
|
|
1982
|
+
const o = "FILE DOWNLOAD", s = this.createMessage(o);
|
|
1983
|
+
s.url = t, s.key = e, s.fileName = r, s.mimeType = i, this.logCreated(o, s);
|
|
1984
|
+
const c = this.incomingMessages$.pipe(
|
|
1985
|
+
f((u) => u.type === o && u.replyTo === s.id),
|
|
1986
|
+
p(this.logReceived(o)),
|
|
1987
|
+
h((u) => u),
|
|
1988
|
+
m(1)
|
|
1989
|
+
);
|
|
1990
|
+
return this.port2.postMessage(s), this.logSent(o, s), c;
|
|
1991
|
+
}
|
|
1992
|
+
sendFileUploadMessage() {
|
|
1993
|
+
throw new Error("Not implemented");
|
|
1994
|
+
}
|
|
1995
|
+
/**
|
|
1996
|
+
* Sends a {@link FileOpenMessage} to the Host app, to request opening a previously downloaded
|
|
1997
|
+
* or selected file.
|
|
1998
|
+
*
|
|
1999
|
+
* @param fileId - The ID of the file to open.
|
|
2000
|
+
*/
|
|
2001
|
+
sendFileOpenMessage(t) {
|
|
2002
|
+
if (!this.isEmbedded())
|
|
2003
|
+
throw new l(this.currentContext);
|
|
2004
|
+
const e = "FILE OPEN", r = this.createMessage(e, !1);
|
|
2005
|
+
r.fileId = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);
|
|
2006
|
+
}
|
|
1892
2007
|
/**
|
|
1893
2008
|
* Checks if the client app is either embedded in an iframe or in a native webview.
|
|
1894
2009
|
*
|
|
@@ -1971,7 +2086,7 @@ class xt {
|
|
|
1971
2086
|
return i.join("");
|
|
1972
2087
|
}
|
|
1973
2088
|
}
|
|
1974
|
-
const
|
|
2089
|
+
const Mt = ["2.0"];
|
|
1975
2090
|
class It {
|
|
1976
2091
|
/**
|
|
1977
2092
|
* A class that manages the IPC communication between the `Client` and the `Host`.
|
|
@@ -1987,15 +2102,15 @@ class It {
|
|
|
1987
2102
|
/**
|
|
1988
2103
|
* The type of the `Host` app the `Client` is embedded in.
|
|
1989
2104
|
*/
|
|
1990
|
-
|
|
2105
|
+
M(this, "host");
|
|
1991
2106
|
/**
|
|
1992
2107
|
* The cloud ID of the `Host` app the `Client` is embedded in.
|
|
1993
2108
|
*/
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
this.logger = t ?? console, this.helper = new xt(
|
|
2109
|
+
M(this, "cloudId");
|
|
2110
|
+
M(this, "logger");
|
|
2111
|
+
M(this, "helper");
|
|
2112
|
+
M(this, "listeners");
|
|
2113
|
+
this.logger = t ?? console, this.helper = new xt(Mt, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(E.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(E.HostInForeground, /* @__PURE__ */ new Set());
|
|
1999
2114
|
}
|
|
2000
2115
|
/**
|
|
2001
2116
|
* Returns whether the app is running inside a native WebView (`host` context) or as a
|
|
@@ -2037,34 +2152,39 @@ class It {
|
|
|
2037
2152
|
this.helper.onBadgeQueryMessage().subscribe((e) => {
|
|
2038
2153
|
var r;
|
|
2039
2154
|
this.logger.debug("Received Badge Query: ", e);
|
|
2040
|
-
for (const i of ((r = this.listeners.get(
|
|
2155
|
+
for (const i of ((r = this.listeners.get(E.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
|
|
2041
2156
|
i();
|
|
2042
2157
|
}), this.helper.onHostInForegroundMessage().subscribe((e) => {
|
|
2043
2158
|
var r;
|
|
2044
2159
|
this.logger.debug("Received Host In Foreground: ", e);
|
|
2045
|
-
for (const i of ((r = this.listeners.get(
|
|
2160
|
+
for (const i of ((r = this.listeners.get(E.HostInForeground)) == null ? void 0 : r.values()) ?? [])
|
|
2046
2161
|
i();
|
|
2047
2162
|
}), this.cloudId = t.cloudId, this.host = t.host;
|
|
2048
2163
|
}),
|
|
2049
|
-
|
|
2164
|
+
R(() => {
|
|
2050
2165
|
})
|
|
2051
2166
|
)
|
|
2052
2167
|
);
|
|
2053
2168
|
}
|
|
2054
|
-
selectContacts(t, e, r) {
|
|
2169
|
+
selectContacts(t, e, r, i) {
|
|
2055
2170
|
this.logger.debug("Selecting Contacts: ", ...arguments);
|
|
2056
|
-
let
|
|
2171
|
+
let o;
|
|
2057
2172
|
if (e === "multi") {
|
|
2058
|
-
if (!r)
|
|
2173
|
+
if (!r || !Array.isArray(r))
|
|
2059
2174
|
throw new $(
|
|
2060
2175
|
"currentContacts",
|
|
2061
2176
|
r,
|
|
2062
2177
|
"currentContacts is required for group streams"
|
|
2063
2178
|
);
|
|
2064
|
-
i = this.helper.selectContacts(
|
|
2179
|
+
i || (i = "cloudUsername"), o = this.helper.selectContacts(
|
|
2180
|
+
t.toString(),
|
|
2181
|
+
"group",
|
|
2182
|
+
i,
|
|
2183
|
+
r
|
|
2184
|
+
);
|
|
2065
2185
|
} else
|
|
2066
|
-
i = this.helper.selectContacts(t.toString(), "direct");
|
|
2067
|
-
return O(
|
|
2186
|
+
r ? i = r : i = "cloudUsername", o = this.helper.selectContacts(t.toString(), "direct", i);
|
|
2187
|
+
return O(o.pipe(R((s) => s.contacts)));
|
|
2068
2188
|
}
|
|
2069
2189
|
/**
|
|
2070
2190
|
* Matches batch of {@link ContactItem} objects against the Host's contact list to fetch detailed
|
|
@@ -2076,7 +2196,7 @@ class It {
|
|
|
2076
2196
|
* Host's contact list.
|
|
2077
2197
|
*/
|
|
2078
2198
|
matchContacts(t) {
|
|
2079
|
-
return this.logger.debug("Match Contacts: ", t), O(this.helper.matchContacts(t).pipe(
|
|
2199
|
+
return this.logger.debug("Match Contacts: ", t), O(this.helper.matchContacts(t).pipe(R((e) => e.contacts)));
|
|
2080
2200
|
}
|
|
2081
2201
|
/**
|
|
2082
2202
|
* Requests the `Host` app to provide the Push Token for the current device.
|
|
@@ -2084,7 +2204,7 @@ class It {
|
|
|
2084
2204
|
* @returns A promise with the Push Token as `string`.
|
|
2085
2205
|
*/
|
|
2086
2206
|
requestPushToken() {
|
|
2087
|
-
return this.logger.debug("Requesting Push Token"), O(this.helper.requestPushToken().pipe(
|
|
2207
|
+
return this.logger.debug("Requesting Push Token"), O(this.helper.requestPushToken().pipe(R((t) => t.pushToken)));
|
|
2088
2208
|
}
|
|
2089
2209
|
/**
|
|
2090
2210
|
* Sends the current badge count to the `Host` app.
|
|
@@ -2103,9 +2223,9 @@ class It {
|
|
|
2103
2223
|
*/
|
|
2104
2224
|
onBadgeQueryRequest(t) {
|
|
2105
2225
|
var e;
|
|
2106
|
-
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(
|
|
2226
|
+
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(E.BadgeQuery)) == null || e.add(t), () => {
|
|
2107
2227
|
var r;
|
|
2108
|
-
return (r = this.listeners.get(
|
|
2228
|
+
return (r = this.listeners.get(E.BadgeQuery)) == null ? void 0 : r.delete(t);
|
|
2109
2229
|
};
|
|
2110
2230
|
}
|
|
2111
2231
|
/**
|
|
@@ -2117,9 +2237,9 @@ class It {
|
|
|
2117
2237
|
*/
|
|
2118
2238
|
onHostInForeground(t) {
|
|
2119
2239
|
var e;
|
|
2120
|
-
return this.logger.debug("Registering for Host In Foreground"), (e = this.listeners.get(
|
|
2240
|
+
return this.logger.debug("Registering for Host In Foreground"), (e = this.listeners.get(E.HostInForeground)) == null || e.add(t), () => {
|
|
2121
2241
|
var r;
|
|
2122
|
-
return (r = this.listeners.get(
|
|
2242
|
+
return (r = this.listeners.get(E.HostInForeground)) == null ? void 0 : r.delete(t);
|
|
2123
2243
|
};
|
|
2124
2244
|
}
|
|
2125
2245
|
evaluateContext(t) {
|
|
@@ -2130,6 +2250,6 @@ class It {
|
|
|
2130
2250
|
}
|
|
2131
2251
|
}
|
|
2132
2252
|
export {
|
|
2133
|
-
|
|
2253
|
+
E as IPCEvents,
|
|
2134
2254
|
It as IPCManager
|
|
2135
2255
|
};
|