@acrobits/ipc-sdk 0.8.0-alpha.5 → 0.8.0-alpha.6
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/interfaces/UriContactItem.html +3 -3
- package/docs/types/HostType.html +1 -1
- package/docs/types/IpcProtocolVersion.html +1 -1
- package/lib/ipc-sdk.js +236 -224
- 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 Re = Object.defineProperty;
|
|
2
2
|
var Pe = (n, t, e) => t in n ? Re(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var _ = (n, t, e) => (Pe(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
var y = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n))(y || {}), H = function(n, t) {
|
|
5
5
|
return H = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
6
6
|
e.__proto__ = r;
|
|
7
7
|
} || function(e, r) {
|
|
@@ -38,8 +38,8 @@ function $(n, t) {
|
|
|
38
38
|
try {
|
|
39
39
|
for (; (t === void 0 || t-- > 0) && !(i = r.next()).done; )
|
|
40
40
|
s.push(i.value);
|
|
41
|
-
} catch (
|
|
42
|
-
o = { error:
|
|
41
|
+
} catch (a) {
|
|
42
|
+
o = { error: a };
|
|
43
43
|
} finally {
|
|
44
44
|
try {
|
|
45
45
|
i && !i.done && (e = r.return) && e.call(r);
|
|
@@ -56,7 +56,7 @@ function k(n, t, e) {
|
|
|
56
56
|
(s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[r]);
|
|
57
57
|
return n.concat(s || Array.prototype.slice.call(t));
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function w(n) {
|
|
60
60
|
return typeof n == "function";
|
|
61
61
|
}
|
|
62
62
|
function X(n) {
|
|
@@ -92,15 +92,15 @@ var T = function() {
|
|
|
92
92
|
if (o)
|
|
93
93
|
if (this._parentage = null, Array.isArray(o))
|
|
94
94
|
try {
|
|
95
|
-
for (var
|
|
96
|
-
var u =
|
|
95
|
+
for (var a = Q(o), c = a.next(); !c.done; c = a.next()) {
|
|
96
|
+
var u = c.value;
|
|
97
97
|
u.remove(this);
|
|
98
98
|
}
|
|
99
|
-
} catch (
|
|
100
|
-
t = { error:
|
|
99
|
+
} catch (f) {
|
|
100
|
+
t = { error: f };
|
|
101
101
|
} finally {
|
|
102
102
|
try {
|
|
103
|
-
|
|
103
|
+
c && !c.done && (e = a.return) && e.call(a);
|
|
104
104
|
} finally {
|
|
105
105
|
if (t)
|
|
106
106
|
throw t.error;
|
|
@@ -108,30 +108,30 @@ var T = function() {
|
|
|
108
108
|
}
|
|
109
109
|
else
|
|
110
110
|
o.remove(this);
|
|
111
|
-
var
|
|
112
|
-
if (
|
|
111
|
+
var p = this.initialTeardown;
|
|
112
|
+
if (w(p))
|
|
113
113
|
try {
|
|
114
|
-
|
|
115
|
-
} catch (
|
|
116
|
-
s =
|
|
114
|
+
p();
|
|
115
|
+
} catch (f) {
|
|
116
|
+
s = f instanceof N ? f.errors : [f];
|
|
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
|
|
123
|
-
var j =
|
|
122
|
+
for (var b = Q(v), S = b.next(); !S.done; S = b.next()) {
|
|
123
|
+
var j = S.value;
|
|
124
124
|
try {
|
|
125
125
|
ie(j);
|
|
126
|
-
} catch (
|
|
127
|
-
s = s ?? [],
|
|
126
|
+
} catch (f) {
|
|
127
|
+
s = s ?? [], f instanceof N ? s = k(k([], $(s)), $(f.errors)) : s.push(f);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
} catch (
|
|
131
|
-
r = { error:
|
|
130
|
+
} catch (f) {
|
|
131
|
+
r = { error: f };
|
|
132
132
|
} finally {
|
|
133
133
|
try {
|
|
134
|
-
|
|
134
|
+
S && !S.done && (i = b.return) && i.call(b);
|
|
135
135
|
} finally {
|
|
136
136
|
if (r)
|
|
137
137
|
throw r.error;
|
|
@@ -172,10 +172,10 @@ var T = function() {
|
|
|
172
172
|
}(), n;
|
|
173
173
|
}(), ye = T.EMPTY;
|
|
174
174
|
function me(n) {
|
|
175
|
-
return n instanceof T || n && "closed" in n &&
|
|
175
|
+
return n instanceof T || n && "closed" in n && w(n.remove) && w(n.add) && w(n.unsubscribe);
|
|
176
176
|
}
|
|
177
177
|
function ie(n) {
|
|
178
|
-
|
|
178
|
+
w(n) ? n() : n.unsubscribe();
|
|
179
179
|
}
|
|
180
180
|
var we = {
|
|
181
181
|
onUnhandledError: null,
|
|
@@ -237,7 +237,7 @@ var Z = function(n) {
|
|
|
237
237
|
}
|
|
238
238
|
}, t;
|
|
239
239
|
}(T), Oe = Function.prototype.bind;
|
|
240
|
-
function
|
|
240
|
+
function q(n, t) {
|
|
241
241
|
return Oe.call(n, t);
|
|
242
242
|
}
|
|
243
243
|
var Le = function() {
|
|
@@ -275,20 +275,20 @@ var Le = function() {
|
|
|
275
275
|
M(t, n);
|
|
276
276
|
function t(e, r, i) {
|
|
277
277
|
var s = n.call(this) || this, o;
|
|
278
|
-
if (
|
|
278
|
+
if (w(e) || !e)
|
|
279
279
|
o = {
|
|
280
280
|
next: e ?? void 0,
|
|
281
281
|
error: r ?? void 0,
|
|
282
282
|
complete: i ?? void 0
|
|
283
283
|
};
|
|
284
284
|
else {
|
|
285
|
-
var
|
|
286
|
-
s && we.useDeprecatedNextContext ? (
|
|
285
|
+
var a;
|
|
286
|
+
s && we.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {
|
|
287
287
|
return s.unsubscribe();
|
|
288
288
|
}, o = {
|
|
289
|
-
next: e.next &&
|
|
290
|
-
error: e.error &&
|
|
291
|
-
complete: e.complete &&
|
|
289
|
+
next: e.next && q(e.next, a),
|
|
290
|
+
error: e.error && q(e.error, a),
|
|
291
|
+
complete: e.complete && q(e.complete, a)
|
|
292
292
|
}) : o = e;
|
|
293
293
|
}
|
|
294
294
|
return s.destination = new Le(o), s;
|
|
@@ -329,8 +329,8 @@ var z = function() {
|
|
|
329
329
|
}, n.prototype.subscribe = function(t, e, r) {
|
|
330
330
|
var i = this, s = je(t) ? t : new V(t, e, r);
|
|
331
331
|
return U(function() {
|
|
332
|
-
var o = i,
|
|
333
|
-
s.add(
|
|
332
|
+
var o = i, a = o.operator, c = o.source;
|
|
333
|
+
s.add(a ? a.call(s, c) : c ? i._subscribe(s) : i._trySubscribe(s));
|
|
334
334
|
}), s;
|
|
335
335
|
}, n.prototype._trySubscribe = function(t) {
|
|
336
336
|
try {
|
|
@@ -342,11 +342,11 @@ var z = function() {
|
|
|
342
342
|
var r = this;
|
|
343
343
|
return e = oe(e), new e(function(i, s) {
|
|
344
344
|
var o = new V({
|
|
345
|
-
next: function(
|
|
345
|
+
next: function(a) {
|
|
346
346
|
try {
|
|
347
|
-
t(
|
|
348
|
-
} catch (
|
|
349
|
-
s(
|
|
347
|
+
t(a);
|
|
348
|
+
} catch (c) {
|
|
349
|
+
s(c), o.unsubscribe();
|
|
350
350
|
}
|
|
351
351
|
},
|
|
352
352
|
error: s,
|
|
@@ -384,13 +384,13 @@ function oe(n) {
|
|
|
384
384
|
return (t = n ?? we.Promise) !== null && t !== void 0 ? t : Promise;
|
|
385
385
|
}
|
|
386
386
|
function Ve(n) {
|
|
387
|
-
return n &&
|
|
387
|
+
return n && w(n.next) && w(n.error) && w(n.complete);
|
|
388
388
|
}
|
|
389
389
|
function je(n) {
|
|
390
390
|
return n && n instanceof Z || Ve(n) && me(n);
|
|
391
391
|
}
|
|
392
392
|
function Ne(n) {
|
|
393
|
-
return
|
|
393
|
+
return w(n == null ? void 0 : n.lift);
|
|
394
394
|
}
|
|
395
395
|
function Ce(n) {
|
|
396
396
|
return function(t) {
|
|
@@ -406,27 +406,27 @@ function Ce(n) {
|
|
|
406
406
|
};
|
|
407
407
|
}
|
|
408
408
|
function Me(n, t, e, r, i) {
|
|
409
|
-
return new
|
|
409
|
+
return new qe(n, t, e, r, i);
|
|
410
410
|
}
|
|
411
|
-
var
|
|
411
|
+
var qe = function(n) {
|
|
412
412
|
M(t, n);
|
|
413
|
-
function t(e, r, i, s, o,
|
|
414
|
-
var
|
|
415
|
-
return
|
|
413
|
+
function t(e, r, i, s, o, a) {
|
|
414
|
+
var c = n.call(this, e) || this;
|
|
415
|
+
return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(u) {
|
|
416
416
|
try {
|
|
417
417
|
r(u);
|
|
418
|
-
} catch (
|
|
419
|
-
e.error(
|
|
418
|
+
} catch (p) {
|
|
419
|
+
e.error(p);
|
|
420
420
|
}
|
|
421
|
-
} : n.prototype._next,
|
|
421
|
+
} : n.prototype._next, c._error = s ? function(u) {
|
|
422
422
|
try {
|
|
423
423
|
s(u);
|
|
424
|
-
} catch (
|
|
425
|
-
e.error(
|
|
424
|
+
} catch (p) {
|
|
425
|
+
e.error(p);
|
|
426
426
|
} finally {
|
|
427
427
|
this.unsubscribe();
|
|
428
428
|
}
|
|
429
|
-
} : n.prototype._error,
|
|
429
|
+
} : n.prototype._error, c._complete = i ? function() {
|
|
430
430
|
try {
|
|
431
431
|
i();
|
|
432
432
|
} catch (u) {
|
|
@@ -434,7 +434,7 @@ var De = function(n) {
|
|
|
434
434
|
} finally {
|
|
435
435
|
this.unsubscribe();
|
|
436
436
|
}
|
|
437
|
-
} : n.prototype._complete,
|
|
437
|
+
} : n.prototype._complete, c;
|
|
438
438
|
}
|
|
439
439
|
return t.prototype.unsubscribe = function() {
|
|
440
440
|
var e;
|
|
@@ -443,7 +443,7 @@ var De = function(n) {
|
|
|
443
443
|
n.prototype.unsubscribe.call(this), !r && ((e = this.onFinalize) === null || e === void 0 || e.call(this));
|
|
444
444
|
}
|
|
445
445
|
}, t;
|
|
446
|
-
}(Z),
|
|
446
|
+
}(Z), De = X(function(n) {
|
|
447
447
|
return function() {
|
|
448
448
|
n(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
449
449
|
};
|
|
@@ -458,7 +458,7 @@ var De = function(n) {
|
|
|
458
458
|
return r.operator = e, r;
|
|
459
459
|
}, t.prototype._throwIfClosed = function() {
|
|
460
460
|
if (this.closed)
|
|
461
|
-
throw new
|
|
461
|
+
throw new De();
|
|
462
462
|
}, t.prototype.next = function(e) {
|
|
463
463
|
var r = this;
|
|
464
464
|
U(function() {
|
|
@@ -466,15 +466,15 @@ var De = function(n) {
|
|
|
466
466
|
if (r._throwIfClosed(), !r.isStopped) {
|
|
467
467
|
r.currentObservers || (r.currentObservers = Array.from(r.observers));
|
|
468
468
|
try {
|
|
469
|
-
for (var o = Q(r.currentObservers),
|
|
470
|
-
var
|
|
471
|
-
|
|
469
|
+
for (var o = Q(r.currentObservers), a = o.next(); !a.done; a = o.next()) {
|
|
470
|
+
var c = a.value;
|
|
471
|
+
c.next(e);
|
|
472
472
|
}
|
|
473
473
|
} catch (u) {
|
|
474
474
|
i = { error: u };
|
|
475
475
|
} finally {
|
|
476
476
|
try {
|
|
477
|
-
|
|
477
|
+
a && !a.done && (s = o.return) && s.call(o);
|
|
478
478
|
} finally {
|
|
479
479
|
if (i)
|
|
480
480
|
throw i.error;
|
|
@@ -514,9 +514,9 @@ var De = function(n) {
|
|
|
514
514
|
}, t.prototype._subscribe = function(e) {
|
|
515
515
|
return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
|
|
516
516
|
}, t.prototype._innerSubscribe = function(e) {
|
|
517
|
-
var r = this, i = this, s = i.hasError, o = i.isStopped,
|
|
518
|
-
return s || o ? ye : (this.currentObservers = null,
|
|
519
|
-
r.currentObservers = null, F(
|
|
517
|
+
var r = this, i = this, s = i.hasError, o = i.isStopped, a = i.observers;
|
|
518
|
+
return s || o ? ye : (this.currentObservers = null, a.push(e), new T(function() {
|
|
519
|
+
r.currentObservers = null, F(a, e);
|
|
520
520
|
}));
|
|
521
521
|
}, t.prototype._checkFinalizedStatuses = function(e) {
|
|
522
522
|
var r = this, i = r.hasError, s = r.thrownError, o = r.isStopped;
|
|
@@ -646,7 +646,7 @@ var De = function(n) {
|
|
|
646
646
|
}, t;
|
|
647
647
|
}(ae), Ye = new ze(Qe), Ge = Ye;
|
|
648
648
|
function Ke(n) {
|
|
649
|
-
return n &&
|
|
649
|
+
return n && w(n.schedule);
|
|
650
650
|
}
|
|
651
651
|
var Je = X(function(n) {
|
|
652
652
|
return function() {
|
|
@@ -692,23 +692,23 @@ function Xe(n, t, e) {
|
|
|
692
692
|
});
|
|
693
693
|
}
|
|
694
694
|
function Ze(n, t, e) {
|
|
695
|
-
var r =
|
|
695
|
+
var r = w(n) || t || e ? { next: n, error: t, complete: e } : n;
|
|
696
696
|
return r ? Ce(function(i, s) {
|
|
697
697
|
var o;
|
|
698
698
|
(o = r.subscribe) === null || o === void 0 || o.call(r);
|
|
699
|
-
var
|
|
700
|
-
i.subscribe(Me(s, function(
|
|
699
|
+
var a = !0;
|
|
700
|
+
i.subscribe(Me(s, function(c) {
|
|
701
701
|
var u;
|
|
702
|
-
(u = r.next) === null || u === void 0 || u.call(r,
|
|
702
|
+
(u = r.next) === null || u === void 0 || u.call(r, c), s.next(c);
|
|
703
703
|
}, function() {
|
|
704
|
-
var
|
|
705
|
-
|
|
706
|
-
}, function(
|
|
704
|
+
var c;
|
|
705
|
+
a = !1, (c = r.complete) === null || c === void 0 || c.call(r), s.complete();
|
|
706
|
+
}, function(c) {
|
|
707
707
|
var u;
|
|
708
|
-
|
|
708
|
+
a = !1, (u = r.error) === null || u === void 0 || u.call(r, c), s.error(c);
|
|
709
709
|
}, function() {
|
|
710
|
-
var
|
|
711
|
-
|
|
710
|
+
var c, u;
|
|
711
|
+
a && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (u = r.finalize) === null || u === void 0 || u.call(r);
|
|
712
712
|
}));
|
|
713
713
|
}) : Ee;
|
|
714
714
|
}
|
|
@@ -718,7 +718,7 @@ class l extends Error {
|
|
|
718
718
|
super(`Incorrect context (${t}). Cannot perform the requested operation.`), C(this, "context"), this.context = t;
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
|
-
class
|
|
721
|
+
class x extends Error {
|
|
722
722
|
constructor(t, e, r) {
|
|
723
723
|
super(`Invalid parameter (${t}). ${r}`), this.param = t, this.value = e, this.reason = r;
|
|
724
724
|
}
|
|
@@ -746,11 +746,11 @@ class le extends Error {
|
|
|
746
746
|
e && (r += ` Minimum version supported is ${e}.`), super(r), this.version = t;
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function E(n) {
|
|
750
750
|
return typeof n == "function";
|
|
751
751
|
}
|
|
752
752
|
function it(n) {
|
|
753
|
-
return
|
|
753
|
+
return E(n == null ? void 0 : n.lift);
|
|
754
754
|
}
|
|
755
755
|
function R(n) {
|
|
756
756
|
return function(t) {
|
|
@@ -802,8 +802,8 @@ function K(n, t) {
|
|
|
802
802
|
try {
|
|
803
803
|
for (; (t === void 0 || t-- > 0) && !(i = r.next()).done; )
|
|
804
804
|
s.push(i.value);
|
|
805
|
-
} catch (
|
|
806
|
-
o = { error:
|
|
805
|
+
} catch (a) {
|
|
806
|
+
o = { error: a };
|
|
807
807
|
} finally {
|
|
808
808
|
try {
|
|
809
809
|
i && !i.done && (e = r.return) && e.call(r);
|
|
@@ -826,7 +826,7 @@ function st(n) {
|
|
|
826
826
|
}, e = n(t);
|
|
827
827
|
return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
|
|
828
828
|
}
|
|
829
|
-
var
|
|
829
|
+
var D = st(function(n) {
|
|
830
830
|
return function(t) {
|
|
831
831
|
n(this), this.message = t ? t.length + ` errors occurred during unsubscription:
|
|
832
832
|
` + t.map(function(e, r) {
|
|
@@ -853,15 +853,15 @@ var te = function() {
|
|
|
853
853
|
if (o)
|
|
854
854
|
if (this._parentage = null, Array.isArray(o))
|
|
855
855
|
try {
|
|
856
|
-
for (var
|
|
857
|
-
var u =
|
|
856
|
+
for (var a = he(o), c = a.next(); !c.done; c = a.next()) {
|
|
857
|
+
var u = c.value;
|
|
858
858
|
u.remove(this);
|
|
859
859
|
}
|
|
860
|
-
} catch (
|
|
861
|
-
t = { error:
|
|
860
|
+
} catch (f) {
|
|
861
|
+
t = { error: f };
|
|
862
862
|
} finally {
|
|
863
863
|
try {
|
|
864
|
-
|
|
864
|
+
c && !c.done && (e = a.return) && e.call(a);
|
|
865
865
|
} finally {
|
|
866
866
|
if (t)
|
|
867
867
|
throw t.error;
|
|
@@ -869,30 +869,30 @@ var te = function() {
|
|
|
869
869
|
}
|
|
870
870
|
else
|
|
871
871
|
o.remove(this);
|
|
872
|
-
var
|
|
873
|
-
if (
|
|
872
|
+
var p = this.initialTeardown;
|
|
873
|
+
if (E(p))
|
|
874
874
|
try {
|
|
875
|
-
|
|
876
|
-
} catch (
|
|
877
|
-
s =
|
|
875
|
+
p();
|
|
876
|
+
} catch (f) {
|
|
877
|
+
s = f instanceof D ? f.errors : [f];
|
|
878
878
|
}
|
|
879
|
-
var
|
|
880
|
-
if (
|
|
879
|
+
var v = this._finalizers;
|
|
880
|
+
if (v) {
|
|
881
881
|
this._finalizers = null;
|
|
882
882
|
try {
|
|
883
|
-
for (var
|
|
884
|
-
var j =
|
|
883
|
+
for (var b = he(v), S = b.next(); !S.done; S = b.next()) {
|
|
884
|
+
var j = S.value;
|
|
885
885
|
try {
|
|
886
886
|
pe(j);
|
|
887
|
-
} catch (
|
|
888
|
-
s = s ?? [],
|
|
887
|
+
} catch (f) {
|
|
888
|
+
s = s ?? [], f instanceof D ? s = J(J([], K(s)), K(f.errors)) : s.push(f);
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
|
-
} catch (
|
|
892
|
-
r = { error:
|
|
891
|
+
} catch (f) {
|
|
892
|
+
r = { error: f };
|
|
893
893
|
} finally {
|
|
894
894
|
try {
|
|
895
|
-
|
|
895
|
+
S && !S.done && (i = b.return) && i.call(b);
|
|
896
896
|
} finally {
|
|
897
897
|
if (r)
|
|
898
898
|
throw r.error;
|
|
@@ -900,7 +900,7 @@ var te = function() {
|
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
902
|
if (s)
|
|
903
|
-
throw new
|
|
903
|
+
throw new D(s);
|
|
904
904
|
}
|
|
905
905
|
}, n.prototype.add = function(t) {
|
|
906
906
|
var e;
|
|
@@ -934,10 +934,10 @@ var te = function() {
|
|
|
934
934
|
}();
|
|
935
935
|
te.EMPTY;
|
|
936
936
|
function _e(n) {
|
|
937
|
-
return n instanceof te || n && "closed" in n &&
|
|
937
|
+
return n instanceof te || n && "closed" in n && E(n.remove) && E(n.add) && E(n.unsubscribe);
|
|
938
938
|
}
|
|
939
939
|
function pe(n) {
|
|
940
|
-
|
|
940
|
+
E(n) ? n() : n.unsubscribe();
|
|
941
941
|
}
|
|
942
942
|
var Ie = {
|
|
943
943
|
onUnhandledError: null,
|
|
@@ -1036,20 +1036,20 @@ var lt = function() {
|
|
|
1036
1036
|
ee(t, n);
|
|
1037
1037
|
function t(e, r, i) {
|
|
1038
1038
|
var s = n.call(this) || this, o;
|
|
1039
|
-
if (
|
|
1039
|
+
if (E(e) || !e)
|
|
1040
1040
|
o = {
|
|
1041
1041
|
next: e ?? void 0,
|
|
1042
1042
|
error: r ?? void 0,
|
|
1043
1043
|
complete: i ?? void 0
|
|
1044
1044
|
};
|
|
1045
1045
|
else {
|
|
1046
|
-
var
|
|
1047
|
-
s && Ie.useDeprecatedNextContext ? (
|
|
1046
|
+
var a;
|
|
1047
|
+
s && Ie.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {
|
|
1048
1048
|
return s.unsubscribe();
|
|
1049
1049
|
}, o = {
|
|
1050
|
-
next: e.next && B(e.next,
|
|
1051
|
-
error: e.error && B(e.error,
|
|
1052
|
-
complete: e.complete && B(e.complete,
|
|
1050
|
+
next: e.next && B(e.next, a),
|
|
1051
|
+
error: e.error && B(e.error, a),
|
|
1052
|
+
complete: e.complete && B(e.complete, a)
|
|
1053
1053
|
}) : o = e;
|
|
1054
1054
|
}
|
|
1055
1055
|
return s.destination = new lt(o), s;
|
|
@@ -1090,8 +1090,8 @@ var gt = function() {
|
|
|
1090
1090
|
}, n.prototype.subscribe = function(t, e, r) {
|
|
1091
1091
|
var i = this, s = bt(t) ? t : new W(t, e, r);
|
|
1092
1092
|
return at(function() {
|
|
1093
|
-
var o = i,
|
|
1094
|
-
s.add(
|
|
1093
|
+
var o = i, a = o.operator, c = o.source;
|
|
1094
|
+
s.add(a ? a.call(s, c) : c ? i._subscribe(s) : i._trySubscribe(s));
|
|
1095
1095
|
}), s;
|
|
1096
1096
|
}, n.prototype._trySubscribe = function(t) {
|
|
1097
1097
|
try {
|
|
@@ -1103,11 +1103,11 @@ var gt = function() {
|
|
|
1103
1103
|
var r = this;
|
|
1104
1104
|
return e = ge(e), new e(function(i, s) {
|
|
1105
1105
|
var o = new W({
|
|
1106
|
-
next: function(
|
|
1106
|
+
next: function(a) {
|
|
1107
1107
|
try {
|
|
1108
|
-
t(
|
|
1109
|
-
} catch (
|
|
1110
|
-
s(
|
|
1108
|
+
t(a);
|
|
1109
|
+
} catch (c) {
|
|
1110
|
+
s(c), o.unsubscribe();
|
|
1111
1111
|
}
|
|
1112
1112
|
},
|
|
1113
1113
|
error: s,
|
|
@@ -1145,7 +1145,7 @@ function ge(n) {
|
|
|
1145
1145
|
return (t = n ?? Ie.Promise) !== null && t !== void 0 ? t : Promise;
|
|
1146
1146
|
}
|
|
1147
1147
|
function vt(n) {
|
|
1148
|
-
return n &&
|
|
1148
|
+
return n && E(n.next) && E(n.error) && E(n.complete);
|
|
1149
1149
|
}
|
|
1150
1150
|
function bt(n) {
|
|
1151
1151
|
return n && n instanceof re || vt(n) && _e(n);
|
|
@@ -1155,23 +1155,23 @@ function P(n, t, e, r, i) {
|
|
|
1155
1155
|
}
|
|
1156
1156
|
var yt = function(n) {
|
|
1157
1157
|
ee(t, n);
|
|
1158
|
-
function t(e, r, i, s, o,
|
|
1159
|
-
var
|
|
1160
|
-
return
|
|
1158
|
+
function t(e, r, i, s, o, a) {
|
|
1159
|
+
var c = n.call(this, e) || this;
|
|
1160
|
+
return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(u) {
|
|
1161
1161
|
try {
|
|
1162
1162
|
r(u);
|
|
1163
|
-
} catch (
|
|
1164
|
-
e.error(
|
|
1163
|
+
} catch (p) {
|
|
1164
|
+
e.error(p);
|
|
1165
1165
|
}
|
|
1166
|
-
} : n.prototype._next,
|
|
1166
|
+
} : n.prototype._next, c._error = s ? function(u) {
|
|
1167
1167
|
try {
|
|
1168
1168
|
s(u);
|
|
1169
|
-
} catch (
|
|
1170
|
-
e.error(
|
|
1169
|
+
} catch (p) {
|
|
1170
|
+
e.error(p);
|
|
1171
1171
|
} finally {
|
|
1172
1172
|
this.unsubscribe();
|
|
1173
1173
|
}
|
|
1174
|
-
} : n.prototype._error,
|
|
1174
|
+
} : n.prototype._error, c._complete = i ? function() {
|
|
1175
1175
|
try {
|
|
1176
1176
|
i();
|
|
1177
1177
|
} catch (u) {
|
|
@@ -1179,7 +1179,7 @@ var yt = function(n) {
|
|
|
1179
1179
|
} finally {
|
|
1180
1180
|
this.unsubscribe();
|
|
1181
1181
|
}
|
|
1182
|
-
} : n.prototype._complete,
|
|
1182
|
+
} : n.prototype._complete, c;
|
|
1183
1183
|
}
|
|
1184
1184
|
return t.prototype.unsubscribe = function() {
|
|
1185
1185
|
var e;
|
|
@@ -1200,7 +1200,7 @@ function h(n, t) {
|
|
|
1200
1200
|
var mt = new gt(function(n) {
|
|
1201
1201
|
return n.complete();
|
|
1202
1202
|
});
|
|
1203
|
-
function
|
|
1203
|
+
function m(n) {
|
|
1204
1204
|
return n <= 0 ? function() {
|
|
1205
1205
|
return mt;
|
|
1206
1206
|
} : R(function(t, e) {
|
|
@@ -1210,7 +1210,7 @@ function y(n) {
|
|
|
1210
1210
|
}));
|
|
1211
1211
|
});
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1213
|
+
function g(n, t) {
|
|
1214
1214
|
return R(function(e, r) {
|
|
1215
1215
|
var i = 0;
|
|
1216
1216
|
e.subscribe(P(r, function(s) {
|
|
@@ -1228,23 +1228,23 @@ function wt(n, t) {
|
|
|
1228
1228
|
});
|
|
1229
1229
|
}
|
|
1230
1230
|
function d(n, t, e) {
|
|
1231
|
-
var r =
|
|
1231
|
+
var r = E(n) || t || e ? { next: n, error: t, complete: e } : n;
|
|
1232
1232
|
return r ? R(function(i, s) {
|
|
1233
1233
|
var o;
|
|
1234
1234
|
(o = r.subscribe) === null || o === void 0 || o.call(r);
|
|
1235
|
-
var
|
|
1236
|
-
i.subscribe(P(s, function(
|
|
1235
|
+
var a = !0;
|
|
1236
|
+
i.subscribe(P(s, function(c) {
|
|
1237
1237
|
var u;
|
|
1238
|
-
(u = r.next) === null || u === void 0 || u.call(r,
|
|
1238
|
+
(u = r.next) === null || u === void 0 || u.call(r, c), s.next(c);
|
|
1239
1239
|
}, function() {
|
|
1240
|
-
var
|
|
1241
|
-
|
|
1242
|
-
}, function(
|
|
1240
|
+
var c;
|
|
1241
|
+
a = !1, (c = r.complete) === null || c === void 0 || c.call(r), s.complete();
|
|
1242
|
+
}, function(c) {
|
|
1243
1243
|
var u;
|
|
1244
|
-
|
|
1244
|
+
a = !1, (u = r.error) === null || u === void 0 || u.call(r, c), s.error(c);
|
|
1245
1245
|
}, function() {
|
|
1246
|
-
var
|
|
1247
|
-
|
|
1246
|
+
var c, u;
|
|
1247
|
+
a && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (u = r.finalize) === null || u === void 0 || u.call(r);
|
|
1248
1248
|
}));
|
|
1249
1249
|
}) : Te;
|
|
1250
1250
|
}
|
|
@@ -1322,7 +1322,7 @@ class xt {
|
|
|
1322
1322
|
determineContext() {
|
|
1323
1323
|
return Xe(1e3).pipe(
|
|
1324
1324
|
h(() => (this.isEmbedded() ? this.currentContext = "user" : this.currentContext = "guest", this.currentContext)),
|
|
1325
|
-
|
|
1325
|
+
m(1)
|
|
1326
1326
|
);
|
|
1327
1327
|
}
|
|
1328
1328
|
/**
|
|
@@ -1337,7 +1337,7 @@ class xt {
|
|
|
1337
1337
|
const t = "HELLO", e = this.createMessage(t);
|
|
1338
1338
|
e.protocolVersions = this.supportedVersions, this.logCreated(t, e);
|
|
1339
1339
|
const r = this.incomingMessages$.pipe(
|
|
1340
|
-
|
|
1340
|
+
g((i) => i.type === t && i.replyTo === e.id),
|
|
1341
1341
|
h((i) => i),
|
|
1342
1342
|
d(this.logReceived(t)),
|
|
1343
1343
|
h((i) => {
|
|
@@ -1350,7 +1350,7 @@ class xt {
|
|
|
1350
1350
|
`[IPC] Negotiated IPC Protocol Version: ${this.negotiatedProtocolVersion}`
|
|
1351
1351
|
);
|
|
1352
1352
|
}),
|
|
1353
|
-
|
|
1353
|
+
m(1)
|
|
1354
1354
|
);
|
|
1355
1355
|
return this.logService.debug(`Created ${t} Reply handler`), this.inIframe ? this.createIframeChannel().then(() => this.finishIpcSetup(e)) : this.finishIpcSetup(e), r;
|
|
1356
1356
|
}
|
|
@@ -1367,10 +1367,10 @@ class xt {
|
|
|
1367
1367
|
const t = "TOKEN", e = this.createMessage(t);
|
|
1368
1368
|
this.logCreated(t, e);
|
|
1369
1369
|
const r = this.incomingMessages$.pipe(
|
|
1370
|
-
|
|
1370
|
+
g((i) => i.type === t && i.replyTo === e.id),
|
|
1371
1371
|
h((i) => i),
|
|
1372
1372
|
d(this.logReceived(t)),
|
|
1373
|
-
|
|
1373
|
+
m(1)
|
|
1374
1374
|
);
|
|
1375
1375
|
return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
|
|
1376
1376
|
}
|
|
@@ -1396,11 +1396,11 @@ class xt {
|
|
|
1396
1396
|
displayName: i,
|
|
1397
1397
|
jwtToken: s,
|
|
1398
1398
|
serverUrl: o,
|
|
1399
|
-
region:
|
|
1400
|
-
joinMicMuted:
|
|
1399
|
+
region: a,
|
|
1400
|
+
joinMicMuted: c,
|
|
1401
1401
|
joinWithoutCamera: u
|
|
1402
|
-
} = t,
|
|
1403
|
-
|
|
1402
|
+
} = t, p = "JOINING ROOM", v = this.createMessage(p, !1);
|
|
1403
|
+
v.roomName = e, v.jwtToken = s, v.serverUrl = o, v.region = a, v.roomInvite = r, v.joinMicMuted = c ?? !1, v.joinWithoutCamera = u ?? !1, v.displayName = i, this.logCreated(p, v), this.port2.postMessage(v), this.logSent(p, v);
|
|
1404
1404
|
}
|
|
1405
1405
|
/**
|
|
1406
1406
|
* Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.
|
|
@@ -1450,7 +1450,7 @@ class xt {
|
|
|
1450
1450
|
throw new l(this.currentContext);
|
|
1451
1451
|
const t = "JOIN ROOM";
|
|
1452
1452
|
return this.incomingMessages$.pipe(
|
|
1453
|
-
|
|
1453
|
+
g((e) => e.type === t && e.target === "client"),
|
|
1454
1454
|
h((e) => e),
|
|
1455
1455
|
d(this.logReceived(t)),
|
|
1456
1456
|
h((e) => e)
|
|
@@ -1486,7 +1486,7 @@ class xt {
|
|
|
1486
1486
|
throw new l(this.currentContext);
|
|
1487
1487
|
const t = "LEAVE ROOM";
|
|
1488
1488
|
return this.incomingMessages$.pipe(
|
|
1489
|
-
|
|
1489
|
+
g((e) => e.type === t && e.target === "client"),
|
|
1490
1490
|
h((e) => e),
|
|
1491
1491
|
d(this.logReceived(t)),
|
|
1492
1492
|
h((e) => e)
|
|
@@ -1523,7 +1523,7 @@ class xt {
|
|
|
1523
1523
|
throw new l(this.currentContext);
|
|
1524
1524
|
const t = "CONFIG";
|
|
1525
1525
|
return this.incomingMessages$.pipe(
|
|
1526
|
-
|
|
1526
|
+
g((e) => e.type === t && e.target === "client"),
|
|
1527
1527
|
h((e) => e),
|
|
1528
1528
|
d(this.logReceived(t)),
|
|
1529
1529
|
h((e) => ({
|
|
@@ -1546,11 +1546,11 @@ class xt {
|
|
|
1546
1546
|
const e = "SCREENSHARE SOURCE", r = this.createMessage(e);
|
|
1547
1547
|
r.sourceTypes = t, this.logCreated(e, r);
|
|
1548
1548
|
const i = this.incomingMessages$.pipe(
|
|
1549
|
-
|
|
1549
|
+
g((s) => s.type === e && s.replyTo === r.id),
|
|
1550
1550
|
h((s) => s),
|
|
1551
1551
|
d(this.logReceived(e)),
|
|
1552
1552
|
h((s) => s),
|
|
1553
|
-
|
|
1553
|
+
m(1)
|
|
1554
1554
|
);
|
|
1555
1555
|
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
|
|
1556
1556
|
}
|
|
@@ -1560,11 +1560,11 @@ class xt {
|
|
|
1560
1560
|
const i = "LAYOUT CHANGE";
|
|
1561
1561
|
let s, o;
|
|
1562
1562
|
if (e && r ? (s = this.createMessage(i, !1, r), s.result = e) : (s = this.createMessage(i), o = this.incomingMessages$.pipe(
|
|
1563
|
-
|
|
1564
|
-
h((
|
|
1563
|
+
g((a) => a.type === i && a.replyTo === s.id),
|
|
1564
|
+
h((a) => a),
|
|
1565
1565
|
d(this.logReceived(i)),
|
|
1566
|
-
h((
|
|
1567
|
-
|
|
1566
|
+
h((a) => a),
|
|
1567
|
+
m(1)
|
|
1568
1568
|
), this.logService.debug(`Created ${i} Reply handler`)), s.layout = t, this.logCreated(i, s), this.port2.postMessage(s), this.logSent(i, s), o)
|
|
1569
1569
|
return o;
|
|
1570
1570
|
}
|
|
@@ -1604,7 +1604,7 @@ class xt {
|
|
|
1604
1604
|
throw new l(this.currentContext);
|
|
1605
1605
|
const t = "LAYOUT CHANGE";
|
|
1606
1606
|
return this.incomingMessages$.pipe(
|
|
1607
|
-
|
|
1607
|
+
g((e) => e.type === t && e.target === "client" && e.replyTo === null),
|
|
1608
1608
|
h((e) => e),
|
|
1609
1609
|
d(this.logReceived(t)),
|
|
1610
1610
|
h((e) => e)
|
|
@@ -1617,10 +1617,10 @@ class xt {
|
|
|
1617
1617
|
const e = "OAUTH TOKEN", r = this.createMessage(e);
|
|
1618
1618
|
r.providerTypes = t, this.logCreated(e, r);
|
|
1619
1619
|
const i = this.incomingMessages$.pipe(
|
|
1620
|
-
|
|
1620
|
+
g((s) => s.type === e && s.replyTo === r.id),
|
|
1621
1621
|
h((s) => s),
|
|
1622
1622
|
d(this.logReceived(e)),
|
|
1623
|
-
|
|
1623
|
+
m(1)
|
|
1624
1624
|
);
|
|
1625
1625
|
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
|
|
1626
1626
|
}
|
|
@@ -1634,32 +1634,32 @@ class xt {
|
|
|
1634
1634
|
if (!this.isEmbedded())
|
|
1635
1635
|
throw new l(this.currentContext);
|
|
1636
1636
|
if (e === "group" && i === void 0)
|
|
1637
|
-
throw new
|
|
1637
|
+
throw new x(
|
|
1638
1638
|
"currentContacts",
|
|
1639
1639
|
i,
|
|
1640
1640
|
"currentContacts is required for group streams"
|
|
1641
1641
|
);
|
|
1642
1642
|
if (e === "direct" && i !== void 0)
|
|
1643
|
-
throw new
|
|
1643
|
+
throw new x(
|
|
1644
1644
|
"currentContacts",
|
|
1645
1645
|
i,
|
|
1646
1646
|
"currentContacts should not be passed for direct streams"
|
|
1647
1647
|
);
|
|
1648
1648
|
const s = "SELECT CONTACTS", o = this.createMessage(s, !0);
|
|
1649
1649
|
o.streamType = e, o.streamId = t, o.contactType = r, o.currentContacts = i, this.logCreated(s, o);
|
|
1650
|
-
const
|
|
1651
|
-
|
|
1650
|
+
const a = this.incomingMessages$.pipe(
|
|
1651
|
+
g((c) => c.type === s && c.replyTo === o.id),
|
|
1652
1652
|
d(this.logReceived(s)),
|
|
1653
1653
|
// validate if `streamId` is the same as we sent
|
|
1654
|
-
h((
|
|
1655
|
-
const u =
|
|
1654
|
+
h((c) => {
|
|
1655
|
+
const u = c;
|
|
1656
1656
|
if (u.streamId !== t)
|
|
1657
1657
|
throw new rt(u.streamId, t);
|
|
1658
1658
|
return e === "direct" && u.contacts.length > 1 && (u.contacts = [u.contacts[0]]), u;
|
|
1659
1659
|
}),
|
|
1660
|
-
|
|
1660
|
+
m(1)
|
|
1661
1661
|
);
|
|
1662
|
-
return this.logService.debug(`Created ${s} Reply handler`), this.port2.postMessage(o), this.logSent(s, o),
|
|
1662
|
+
return this.logService.debug(`Created ${s} Reply handler`), this.port2.postMessage(o), this.logSent(s, o), a;
|
|
1663
1663
|
}
|
|
1664
1664
|
/**
|
|
1665
1665
|
* Request detailed contact information for the given Cloud usernames.
|
|
@@ -1673,14 +1673,14 @@ class xt {
|
|
|
1673
1673
|
if (!this.isEmbedded())
|
|
1674
1674
|
throw new l(this.currentContext);
|
|
1675
1675
|
if (!t.length)
|
|
1676
|
-
throw new
|
|
1676
|
+
throw new x("contacts", t, "At least one contact is required");
|
|
1677
1677
|
const e = "MATCH CONTACTS", r = this.createMessage(e);
|
|
1678
1678
|
r.contacts = [...t], this.logCreated(e, r);
|
|
1679
1679
|
const i = this.incomingMessages$.pipe(
|
|
1680
|
-
|
|
1680
|
+
g((s) => s.type === e && s.replyTo === r.id),
|
|
1681
1681
|
d(this.logReceived(e)),
|
|
1682
1682
|
h((s) => s),
|
|
1683
|
-
|
|
1683
|
+
m(1)
|
|
1684
1684
|
);
|
|
1685
1685
|
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
|
|
1686
1686
|
}
|
|
@@ -1715,7 +1715,7 @@ class xt {
|
|
|
1715
1715
|
throw new l(this.currentContext);
|
|
1716
1716
|
const t = "PUSH MESSAGE";
|
|
1717
1717
|
return this.incomingMessages$.pipe(
|
|
1718
|
-
|
|
1718
|
+
g((e) => e.type === t && e.target === "client"),
|
|
1719
1719
|
h((e) => e),
|
|
1720
1720
|
d(this.logReceived(t))
|
|
1721
1721
|
);
|
|
@@ -1735,10 +1735,10 @@ class xt {
|
|
|
1735
1735
|
const t = "PUSH TOKEN", e = this.createMessage(t);
|
|
1736
1736
|
this.logCreated(t, e);
|
|
1737
1737
|
const r = this.incomingMessages$.pipe(
|
|
1738
|
-
|
|
1738
|
+
g((i) => i.type === t && i.replyTo === e.id),
|
|
1739
1739
|
d(this.logReceived(t)),
|
|
1740
1740
|
h((i) => i),
|
|
1741
|
-
|
|
1741
|
+
m(1)
|
|
1742
1742
|
);
|
|
1743
1743
|
return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
|
|
1744
1744
|
}
|
|
@@ -1774,7 +1774,7 @@ class xt {
|
|
|
1774
1774
|
throw new l(this.currentContext);
|
|
1775
1775
|
const t = "PUSH TOKEN";
|
|
1776
1776
|
return this.incomingMessages$.pipe(
|
|
1777
|
-
|
|
1777
|
+
g(
|
|
1778
1778
|
(e) => e.type === t && e.target === "client" && e.replyTo === null && e.expectReply === !1
|
|
1779
1779
|
),
|
|
1780
1780
|
h((e) => {
|
|
@@ -1798,7 +1798,7 @@ class xt {
|
|
|
1798
1798
|
throw new l(this.currentContext);
|
|
1799
1799
|
const t = "BADGE QUERY";
|
|
1800
1800
|
return this.incomingMessages$.pipe(
|
|
1801
|
-
|
|
1801
|
+
g((e) => e.type === t && e.target === "client"),
|
|
1802
1802
|
h((e) => e),
|
|
1803
1803
|
d(this.logReceived(t))
|
|
1804
1804
|
);
|
|
@@ -1856,7 +1856,7 @@ class xt {
|
|
|
1856
1856
|
throw new l(this.currentContext);
|
|
1857
1857
|
const t = "LIFECYCLE";
|
|
1858
1858
|
return this.incomingMessages$.pipe(
|
|
1859
|
-
|
|
1859
|
+
g((e) => e.type === t && e.target === "client"),
|
|
1860
1860
|
h((e) => e),
|
|
1861
1861
|
d(this.logReceived(t))
|
|
1862
1862
|
);
|
|
@@ -1896,7 +1896,7 @@ class xt {
|
|
|
1896
1896
|
throw new l(this.currentContext);
|
|
1897
1897
|
const t = "REQUEST LOGS";
|
|
1898
1898
|
return this.incomingMessages$.pipe(
|
|
1899
|
-
|
|
1899
|
+
g((e) => e.type === t && e.target === "client"),
|
|
1900
1900
|
h((e) => e),
|
|
1901
1901
|
d(this.logReceived(t))
|
|
1902
1902
|
);
|
|
@@ -1966,7 +1966,7 @@ class xt {
|
|
|
1966
1966
|
const s = "FILE REQUEST", o = this.createMessage(s);
|
|
1967
1967
|
if (o.fileHash = t.toLowerCase(), o.intent = e, o.maxChunkSizeInBytes = i, e === "attachment") {
|
|
1968
1968
|
if (!r)
|
|
1969
|
-
throw new
|
|
1969
|
+
throw new x(
|
|
1970
1970
|
"streamId",
|
|
1971
1971
|
r,
|
|
1972
1972
|
"streamId is required for attachment intent"
|
|
@@ -1974,17 +1974,17 @@ class xt {
|
|
|
1974
1974
|
o.streamId = r;
|
|
1975
1975
|
}
|
|
1976
1976
|
this.logCreated(s, o);
|
|
1977
|
-
let
|
|
1978
|
-
const
|
|
1979
|
-
|
|
1977
|
+
let a = 0;
|
|
1978
|
+
const c = this.incomingMessages$.pipe(
|
|
1979
|
+
g(
|
|
1980
1980
|
(u) => u.type === s && u.replyTo === o.id
|
|
1981
1981
|
),
|
|
1982
1982
|
d(this.logReceived(s)),
|
|
1983
|
-
d(() =>
|
|
1983
|
+
d(() => a++),
|
|
1984
1984
|
h((u) => (u.result === "success" && (u.chunkHash = u.chunkHash.toLowerCase()), u)),
|
|
1985
|
-
wt((u) => u.result === "success" &&
|
|
1985
|
+
wt((u) => u.result === "success" && a < u.totalChunks, !0)
|
|
1986
1986
|
);
|
|
1987
|
-
return this.port2.postMessage(o), this.logSent(s, o),
|
|
1987
|
+
return this.port2.postMessage(o), this.logSent(s, o), c;
|
|
1988
1988
|
}
|
|
1989
1989
|
/**
|
|
1990
1990
|
* Sends a {@link FileRequestMessageReply} to the Host app, to reply to a
|
|
@@ -2031,7 +2031,7 @@ class xt {
|
|
|
2031
2031
|
throw new l(this.currentContext);
|
|
2032
2032
|
const t = "FILE REQUEST";
|
|
2033
2033
|
return this.incomingMessages$.pipe(
|
|
2034
|
-
|
|
2034
|
+
g(
|
|
2035
2035
|
(e) => e.type === t && e.target === "client" && e.replyTo === null
|
|
2036
2036
|
),
|
|
2037
2037
|
h((e) => (e.fileHash = e.fileHash.toLowerCase(), e)),
|
|
@@ -2058,32 +2058,38 @@ class xt {
|
|
|
2058
2058
|
*
|
|
2059
2059
|
* @returns This method returns void.
|
|
2060
2060
|
*/
|
|
2061
|
-
sendFileSelectionMessage(t = "attachment", e, r, i, s) {
|
|
2061
|
+
sendFileSelectionMessage(t = "attachment", e, r, i, s, o) {
|
|
2062
2062
|
if (!this.isEmbedded())
|
|
2063
2063
|
throw new l(this.currentContext);
|
|
2064
|
-
const
|
|
2065
|
-
if (c.intent = t, c.maxCount =
|
|
2064
|
+
const a = "FILE SELECTION", c = this.createMessage(a);
|
|
2065
|
+
if (c.intent = t, c.maxCount = i, c.maxFileSizeInBytes = s, c.mimeTypes = o, t === "attachment") {
|
|
2066
2066
|
if (!e)
|
|
2067
|
-
throw new
|
|
2067
|
+
throw new x(
|
|
2068
2068
|
"streamId",
|
|
2069
2069
|
e,
|
|
2070
2070
|
"streamId is required for attachment intent"
|
|
2071
2071
|
);
|
|
2072
|
-
|
|
2072
|
+
if (!r)
|
|
2073
|
+
throw new x(
|
|
2074
|
+
"correlationId",
|
|
2075
|
+
r,
|
|
2076
|
+
"correlationId is required for attachment intent"
|
|
2077
|
+
);
|
|
2078
|
+
c.streamId = e, c.correlationId = r;
|
|
2073
2079
|
}
|
|
2074
|
-
this.logCreated(
|
|
2075
|
-
const
|
|
2076
|
-
|
|
2077
|
-
(
|
|
2080
|
+
this.logCreated(a, c);
|
|
2081
|
+
const u = this.incomingMessages$.pipe(
|
|
2082
|
+
g(
|
|
2083
|
+
(p) => p.type === a && p.replyTo === c.id
|
|
2078
2084
|
),
|
|
2079
|
-
h((
|
|
2085
|
+
h((p) => {
|
|
2080
2086
|
var v;
|
|
2081
|
-
return
|
|
2087
|
+
return p.files = (v = p.files) == null ? void 0 : v.map((b) => (b.fileHash = b.fileHash.toLowerCase(), b)), p;
|
|
2082
2088
|
}),
|
|
2083
|
-
d(this.logReceived(
|
|
2084
|
-
|
|
2089
|
+
d(this.logReceived(a)),
|
|
2090
|
+
m(1)
|
|
2085
2091
|
);
|
|
2086
|
-
return this.port2.postMessage(c), this.logSent(
|
|
2092
|
+
return this.port2.postMessage(c), this.logSent(a, c), u;
|
|
2087
2093
|
}
|
|
2088
2094
|
/**
|
|
2089
2095
|
* Sends a {@link FileDownloadMessage} to the Host app, to request the download of a file.
|
|
@@ -2104,13 +2110,13 @@ class xt {
|
|
|
2104
2110
|
throw new l(this.currentContext);
|
|
2105
2111
|
const s = "FILE DOWNLOAD", o = this.createMessage(s);
|
|
2106
2112
|
o.url = t, o.key = e, o.fileName = r, o.mimeType = i, this.logCreated(s, o);
|
|
2107
|
-
const
|
|
2108
|
-
|
|
2113
|
+
const a = this.incomingMessages$.pipe(
|
|
2114
|
+
g((c) => c.type === s && c.replyTo === o.id),
|
|
2109
2115
|
d(this.logReceived(s)),
|
|
2110
|
-
h((
|
|
2111
|
-
|
|
2116
|
+
h((c) => c),
|
|
2117
|
+
m(1)
|
|
2112
2118
|
);
|
|
2113
|
-
return this.port2.postMessage(o), this.logSent(s, o),
|
|
2119
|
+
return this.port2.postMessage(o), this.logSent(s, o), a;
|
|
2114
2120
|
}
|
|
2115
2121
|
sendFileUploadMessage() {
|
|
2116
2122
|
throw new Error("Not implemented");
|
|
@@ -2127,12 +2133,18 @@ class xt {
|
|
|
2127
2133
|
* @param fileHash - The SHA256 hash of the file to open.
|
|
2128
2134
|
* @param fileName - _Optional_. The name of the file to open.
|
|
2129
2135
|
* @param streamId - _Optional_. The ID of the message stream from which the file is opened from.
|
|
2136
|
+
* @param url - _Optional_. URL from where the host can download the file if it isn't in storage.
|
|
2137
|
+
* @param correlationId - _Optional_. Correlation ID of the message this file was attached to.
|
|
2138
|
+
* @param key - _Optional_. Key used to encrypt the original attachment.
|
|
2139
|
+
* @param sender - _Optional_. The {@link ContactItem} of the sender of the file.
|
|
2140
|
+
*
|
|
2141
|
+
* @returns This method returns void.
|
|
2130
2142
|
*/
|
|
2131
|
-
sendFileOpenMessage(t, e, r) {
|
|
2143
|
+
sendFileOpenMessage(t, e, r, i, s, o, a) {
|
|
2132
2144
|
if (!this.isEmbedded())
|
|
2133
2145
|
throw new l(this.currentContext);
|
|
2134
|
-
const
|
|
2135
|
-
|
|
2146
|
+
const c = "FILE OPEN", u = this.createMessage(c, !1);
|
|
2147
|
+
u.fileHash = t.toLowerCase(), u.fileName = e, u.streamId = r, u.url = i, u.correlationId = s, u.key = o, u.sender = a, this.logCreated(c, u), this.port2.postMessage(u), this.logSent(c, u);
|
|
2136
2148
|
}
|
|
2137
2149
|
/**
|
|
2138
2150
|
* Sends a {@link FileRemoveMessage} to the Host app, to request removal of a file from the
|
|
@@ -2155,10 +2167,10 @@ class xt {
|
|
|
2155
2167
|
const r = "FILE REMOVE", i = this.createMessage(r, !0);
|
|
2156
2168
|
i.hash = t.toLowerCase(), i.streamId = e, this.logCreated(r, i);
|
|
2157
2169
|
const s = this.incomingMessages$.pipe(
|
|
2158
|
-
|
|
2170
|
+
g((o) => o.type === r && o.replyTo === i.id),
|
|
2159
2171
|
d(this.logReceived(r)),
|
|
2160
2172
|
h((o) => o),
|
|
2161
|
-
|
|
2173
|
+
m(1)
|
|
2162
2174
|
);
|
|
2163
2175
|
return this.port2.postMessage(i), this.logSent(r, i), s;
|
|
2164
2176
|
}
|
|
@@ -2315,15 +2327,15 @@ class Rt {
|
|
|
2315
2327
|
/**
|
|
2316
2328
|
* The type of the `Host` app the `Client` is embedded in.
|
|
2317
2329
|
*/
|
|
2318
|
-
|
|
2330
|
+
_(this, "host");
|
|
2319
2331
|
/**
|
|
2320
2332
|
* The cloud ID of the `Host` app the `Client` is embedded in.
|
|
2321
2333
|
*/
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
this.logger = t ?? console, this.helper = new xt(It, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(
|
|
2334
|
+
_(this, "cloudId");
|
|
2335
|
+
_(this, "logger");
|
|
2336
|
+
_(this, "helper");
|
|
2337
|
+
_(this, "listeners");
|
|
2338
|
+
this.logger = t ?? console, this.helper = new xt(It, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(y.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(y.Lifecycle, /* @__PURE__ */ new Set()), this.listeners.set(y.PushToken, /* @__PURE__ */ new Set());
|
|
2327
2339
|
}
|
|
2328
2340
|
/**
|
|
2329
2341
|
* Returns whether the app is running inside a native WebView (`host` context) or as a
|
|
@@ -2365,17 +2377,17 @@ class Rt {
|
|
|
2365
2377
|
this.helper.onBadgeQueryMessage().subscribe((e) => {
|
|
2366
2378
|
var r;
|
|
2367
2379
|
this.logger.debug("Received Badge Query: ", e);
|
|
2368
|
-
for (const i of ((r = this.listeners.get(
|
|
2380
|
+
for (const i of ((r = this.listeners.get(y.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
|
|
2369
2381
|
i();
|
|
2370
2382
|
}), this.helper.onLifecycleMessage().subscribe((e) => {
|
|
2371
2383
|
var r;
|
|
2372
2384
|
this.logger.debug("Received Lifecycle Event: ", e);
|
|
2373
|
-
for (const i of ((r = this.listeners.get(
|
|
2385
|
+
for (const i of ((r = this.listeners.get(y.Lifecycle)) == null ? void 0 : r.values()) ?? [])
|
|
2374
2386
|
i(e.eventName, e.payload);
|
|
2375
2387
|
}), this.helper.onPushTokenMessage().subscribe((e) => {
|
|
2376
2388
|
var r;
|
|
2377
2389
|
this.logger.debug("Received Push Token: ", e);
|
|
2378
|
-
for (const i of ((r = this.listeners.get(
|
|
2390
|
+
for (const i of ((r = this.listeners.get(y.PushToken)) == null ? void 0 : r.values()) ?? [])
|
|
2379
2391
|
i(e.pushToken, e.appId, e.selector);
|
|
2380
2392
|
}), this.cloudId = t.cloudId, this.host = t.host;
|
|
2381
2393
|
}),
|
|
@@ -2389,7 +2401,7 @@ class Rt {
|
|
|
2389
2401
|
let s;
|
|
2390
2402
|
if (e === "multi") {
|
|
2391
2403
|
if (!r || !Array.isArray(r))
|
|
2392
|
-
throw new
|
|
2404
|
+
throw new x(
|
|
2393
2405
|
"currentContacts",
|
|
2394
2406
|
r,
|
|
2395
2407
|
"currentContacts is required for group streams"
|
|
@@ -2472,9 +2484,9 @@ class Rt {
|
|
|
2472
2484
|
*/
|
|
2473
2485
|
onBadgeQueryRequest(t) {
|
|
2474
2486
|
var e;
|
|
2475
|
-
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(
|
|
2487
|
+
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(y.BadgeQuery)) == null || e.add(t), () => {
|
|
2476
2488
|
var r;
|
|
2477
|
-
return (r = this.listeners.get(
|
|
2489
|
+
return (r = this.listeners.get(y.BadgeQuery)) == null ? void 0 : r.delete(t);
|
|
2478
2490
|
};
|
|
2479
2491
|
}
|
|
2480
2492
|
/**
|
|
@@ -2491,9 +2503,9 @@ class Rt {
|
|
|
2491
2503
|
*/
|
|
2492
2504
|
onLifecycleEvent(t) {
|
|
2493
2505
|
var e;
|
|
2494
|
-
return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(
|
|
2506
|
+
return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(y.Lifecycle)) == null || e.add(t), () => {
|
|
2495
2507
|
var r;
|
|
2496
|
-
return (r = this.listeners.get(
|
|
2508
|
+
return (r = this.listeners.get(y.Lifecycle)) == null ? void 0 : r.delete(t);
|
|
2497
2509
|
};
|
|
2498
2510
|
}
|
|
2499
2511
|
/**
|
|
@@ -2509,9 +2521,9 @@ class Rt {
|
|
|
2509
2521
|
*/
|
|
2510
2522
|
onPushToken(t) {
|
|
2511
2523
|
var e;
|
|
2512
|
-
return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(
|
|
2524
|
+
return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(y.PushToken)) == null || e.add(t), () => {
|
|
2513
2525
|
var r;
|
|
2514
|
-
return (r = this.listeners.get(
|
|
2526
|
+
return (r = this.listeners.get(y.PushToken)) == null ? void 0 : r.delete(t);
|
|
2515
2527
|
};
|
|
2516
2528
|
}
|
|
2517
2529
|
evaluateContext(t) {
|
|
@@ -2522,6 +2534,6 @@ class Rt {
|
|
|
2522
2534
|
}
|
|
2523
2535
|
}
|
|
2524
2536
|
export {
|
|
2525
|
-
|
|
2537
|
+
y as IPCEvents,
|
|
2526
2538
|
Rt as IPCManager
|
|
2527
2539
|
};
|