@acrobits/ipc-sdk 0.8.0 → 0.8.1-alpha.1
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/CloudUsernameContactItem.html +3 -3
- package/docs/interfaces/DetailedContactItem.html +8 -8
- package/docs/interfaces/DetailedContactURI.html +3 -3
- package/docs/interfaces/UriContactItem.html +3 -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/ipc-sdk.js +390 -338
- 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
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
|
|
5
|
-
return
|
|
3
|
+
var I = (n, t, e) => (Pe(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
var w = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n))(w || {}), B = function(n, t) {
|
|
5
|
+
return B = 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
|
+
}, B(n, t);
|
|
11
11
|
};
|
|
12
12
|
function M(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
|
+
B(n, t);
|
|
16
16
|
function e() {
|
|
17
17
|
this.constructor = n;
|
|
18
18
|
}
|
|
@@ -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 (c) {
|
|
42
|
+
o = { error: c };
|
|
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 S(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 c = Q(o), a = c.next(); !a.done; a = c.next()) {
|
|
96
|
+
var u = a.value;
|
|
97
97
|
u.remove(this);
|
|
98
98
|
}
|
|
99
|
-
} catch (
|
|
100
|
-
t = { error:
|
|
99
|
+
} catch (g) {
|
|
100
|
+
t = { error: g };
|
|
101
101
|
} finally {
|
|
102
102
|
try {
|
|
103
|
-
|
|
103
|
+
a && !a.done && (e = c.return) && e.call(c);
|
|
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 l = this.initialTeardown;
|
|
112
|
+
if (S(l))
|
|
113
113
|
try {
|
|
114
|
-
|
|
115
|
-
} catch (
|
|
116
|
-
s =
|
|
114
|
+
l();
|
|
115
|
+
} catch (g) {
|
|
116
|
+
s = g instanceof N ? g.errors : [g];
|
|
117
117
|
}
|
|
118
|
-
var
|
|
119
|
-
if (
|
|
118
|
+
var d = this._finalizers;
|
|
119
|
+
if (d) {
|
|
120
120
|
this._finalizers = null;
|
|
121
121
|
try {
|
|
122
|
-
for (var b = Q(
|
|
123
|
-
var j =
|
|
122
|
+
for (var b = Q(d), y = b.next(); !y.done; y = b.next()) {
|
|
123
|
+
var j = y.value;
|
|
124
124
|
try {
|
|
125
125
|
ie(j);
|
|
126
|
-
} catch (
|
|
127
|
-
s = s ?? [],
|
|
126
|
+
} catch (g) {
|
|
127
|
+
s = s ?? [], g instanceof N ? s = k(k([], $(s)), $(g.errors)) : s.push(g);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
} catch (
|
|
131
|
-
r = { error:
|
|
130
|
+
} catch (g) {
|
|
131
|
+
r = { error: g };
|
|
132
132
|
} finally {
|
|
133
133
|
try {
|
|
134
|
-
|
|
134
|
+
y && !y.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 && S(n.remove) && S(n.add) && S(n.unsubscribe);
|
|
176
176
|
}
|
|
177
177
|
function ie(n) {
|
|
178
|
-
|
|
178
|
+
S(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 D(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 (S(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 c;
|
|
286
|
+
s && we.useDeprecatedNextContext ? (c = Object.create(e), c.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 && D(e.next, c),
|
|
290
|
+
error: e.error && D(e.error, c),
|
|
291
|
+
complete: e.complete && D(e.complete, c)
|
|
292
292
|
}) : o = e;
|
|
293
293
|
}
|
|
294
294
|
return s.destination = new Le(o), s;
|
|
@@ -319,7 +319,7 @@ function Fe(n) {
|
|
|
319
319
|
}, e);
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
|
-
var
|
|
322
|
+
var G = function() {
|
|
323
323
|
function n(t) {
|
|
324
324
|
t && (this._subscribe = t);
|
|
325
325
|
}
|
|
@@ -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, c = o.operator, a = o.source;
|
|
333
|
+
s.add(c ? c.call(s, a) : a ? 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(c) {
|
|
346
346
|
try {
|
|
347
|
-
t(
|
|
348
|
-
} catch (
|
|
349
|
-
s(
|
|
347
|
+
t(c);
|
|
348
|
+
} catch (a) {
|
|
349
|
+
s(a), 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 && S(n.next) && S(n.error) && S(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 S(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 De(n, t, e, r, i);
|
|
410
410
|
}
|
|
411
|
-
var
|
|
411
|
+
var De = 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, c) {
|
|
414
|
+
var a = n.call(this, e) || this;
|
|
415
|
+
return a.onFinalize = o, a.shouldUnsubscribe = c, a._next = r ? function(u) {
|
|
416
416
|
try {
|
|
417
417
|
r(u);
|
|
418
|
-
} catch (
|
|
419
|
-
e.error(
|
|
418
|
+
} catch (l) {
|
|
419
|
+
e.error(l);
|
|
420
420
|
}
|
|
421
|
-
} : n.prototype._next,
|
|
421
|
+
} : n.prototype._next, a._error = s ? function(u) {
|
|
422
422
|
try {
|
|
423
423
|
s(u);
|
|
424
|
-
} catch (
|
|
425
|
-
e.error(
|
|
424
|
+
} catch (l) {
|
|
425
|
+
e.error(l);
|
|
426
426
|
} finally {
|
|
427
427
|
this.unsubscribe();
|
|
428
428
|
}
|
|
429
|
-
} : n.prototype._error,
|
|
429
|
+
} : n.prototype._error, a._complete = i ? function() {
|
|
430
430
|
try {
|
|
431
431
|
i();
|
|
432
432
|
} catch (u) {
|
|
@@ -434,7 +434,7 @@ var qe = function(n) {
|
|
|
434
434
|
} finally {
|
|
435
435
|
this.unsubscribe();
|
|
436
436
|
}
|
|
437
|
-
} : n.prototype._complete,
|
|
437
|
+
} : n.prototype._complete, a;
|
|
438
438
|
}
|
|
439
439
|
return t.prototype.unsubscribe = function() {
|
|
440
440
|
var e;
|
|
@@ -443,7 +443,7 @@ var qe = 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), He = X(function(n) {
|
|
447
447
|
return function() {
|
|
448
448
|
n(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
449
449
|
};
|
|
@@ -454,11 +454,11 @@ var qe = function(n) {
|
|
|
454
454
|
return e.closed = !1, e.currentObservers = null, e.observers = [], e.isStopped = !1, e.hasError = !1, e.thrownError = null, e;
|
|
455
455
|
}
|
|
456
456
|
return t.prototype.lift = function(e) {
|
|
457
|
-
var r = new
|
|
457
|
+
var r = new ae(this, this);
|
|
458
458
|
return r.operator = e, r;
|
|
459
459
|
}, t.prototype._throwIfClosed = function() {
|
|
460
460
|
if (this.closed)
|
|
461
|
-
throw new
|
|
461
|
+
throw new He();
|
|
462
462
|
}, t.prototype.next = function(e) {
|
|
463
463
|
var r = this;
|
|
464
464
|
U(function() {
|
|
@@ -466,15 +466,15 @@ var qe = 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), c = o.next(); !c.done; c = o.next()) {
|
|
470
|
+
var a = c.value;
|
|
471
|
+
a.next(e);
|
|
472
472
|
}
|
|
473
473
|
} catch (u) {
|
|
474
474
|
i = { error: u };
|
|
475
475
|
} finally {
|
|
476
476
|
try {
|
|
477
|
-
|
|
477
|
+
c && !c.done && (s = o.return) && s.call(o);
|
|
478
478
|
} finally {
|
|
479
479
|
if (i)
|
|
480
480
|
throw i.error;
|
|
@@ -514,20 +514,20 @@ var qe = 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, c = i.observers;
|
|
518
|
+
return s || o ? ye : (this.currentObservers = null, c.push(e), new T(function() {
|
|
519
|
+
r.currentObservers = null, F(c, e);
|
|
520
520
|
}));
|
|
521
521
|
}, t.prototype._checkFinalizedStatuses = function(e) {
|
|
522
522
|
var r = this, i = r.hasError, s = r.thrownError, o = r.isStopped;
|
|
523
523
|
i ? e.error(s) : o && e.complete();
|
|
524
524
|
}, t.prototype.asObservable = function() {
|
|
525
|
-
var e = new
|
|
525
|
+
var e = new G();
|
|
526
526
|
return e.source = this, e;
|
|
527
527
|
}, t.create = function(e, r) {
|
|
528
|
-
return new
|
|
528
|
+
return new ae(e, r);
|
|
529
529
|
}, t;
|
|
530
|
-
}(
|
|
530
|
+
}(G), ae = function(n) {
|
|
531
531
|
M(t, n);
|
|
532
532
|
function t(e, r) {
|
|
533
533
|
var i = n.call(this) || this;
|
|
@@ -546,12 +546,12 @@ var qe = function(n) {
|
|
|
546
546
|
var r, i;
|
|
547
547
|
return (i = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e)) !== null && i !== void 0 ? i : ye;
|
|
548
548
|
}, t;
|
|
549
|
-
}(xe),
|
|
549
|
+
}(xe), qe = {
|
|
550
550
|
now: function() {
|
|
551
551
|
return Date.now();
|
|
552
552
|
},
|
|
553
553
|
delegate: void 0
|
|
554
|
-
},
|
|
554
|
+
}, Be = function(n) {
|
|
555
555
|
M(t, n);
|
|
556
556
|
function t(e, r) {
|
|
557
557
|
return n.call(this) || this;
|
|
@@ -559,14 +559,14 @@ var qe = function(n) {
|
|
|
559
559
|
return t.prototype.schedule = function(e, r) {
|
|
560
560
|
return this;
|
|
561
561
|
}, t;
|
|
562
|
-
}(T),
|
|
562
|
+
}(T), z = {
|
|
563
563
|
setInterval: function(n, t) {
|
|
564
564
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
565
565
|
e[r - 2] = arguments[r];
|
|
566
566
|
return setInterval.apply(void 0, k([n, t], $(e)));
|
|
567
567
|
},
|
|
568
568
|
clearInterval: function(n) {
|
|
569
|
-
var t =
|
|
569
|
+
var t = z.delegate;
|
|
570
570
|
return ((t == null ? void 0 : t.clearInterval) || clearInterval)(n);
|
|
571
571
|
},
|
|
572
572
|
delegate: void 0
|
|
@@ -584,11 +584,11 @@ var qe = function(n) {
|
|
|
584
584
|
var s = this.id, o = this.scheduler;
|
|
585
585
|
return s != null && (this.id = this.recycleAsyncId(o, s, r)), this.pending = !0, this.delay = r, this.id = (i = this.id) !== null && i !== void 0 ? i : this.requestAsyncId(o, this.id, r), this;
|
|
586
586
|
}, t.prototype.requestAsyncId = function(e, r, i) {
|
|
587
|
-
return i === void 0 && (i = 0),
|
|
587
|
+
return i === void 0 && (i = 0), z.setInterval(e.flush.bind(e, this), i);
|
|
588
588
|
}, t.prototype.recycleAsyncId = function(e, r, i) {
|
|
589
589
|
if (i === void 0 && (i = 0), i != null && this.delay === i && this.pending === !1)
|
|
590
590
|
return r;
|
|
591
|
-
r != null &&
|
|
591
|
+
r != null && z.clearInterval(r);
|
|
592
592
|
}, t.prototype.execute = function(e, r) {
|
|
593
593
|
if (this.closed)
|
|
594
594
|
return new Error("executing a cancelled action");
|
|
@@ -612,17 +612,17 @@ var qe = function(n) {
|
|
|
612
612
|
this.work = this.state = this.scheduler = null, this.pending = !1, F(s, this), r != null && (this.id = this.recycleAsyncId(i, r, null)), this.delay = null, n.prototype.unsubscribe.call(this);
|
|
613
613
|
}
|
|
614
614
|
}, t;
|
|
615
|
-
}(
|
|
615
|
+
}(Be), ce = function() {
|
|
616
616
|
function n(t, e) {
|
|
617
617
|
e === void 0 && (e = n.now), this.schedulerActionCtor = t, this.now = e;
|
|
618
618
|
}
|
|
619
619
|
return n.prototype.schedule = function(t, e, r) {
|
|
620
620
|
return e === void 0 && (e = 0), new this.schedulerActionCtor(this, t).schedule(r, e);
|
|
621
|
-
}, n.now =
|
|
622
|
-
}(),
|
|
621
|
+
}, n.now = qe.now, n;
|
|
622
|
+
}(), Ge = function(n) {
|
|
623
623
|
M(t, n);
|
|
624
624
|
function t(e, r) {
|
|
625
|
-
r === void 0 && (r =
|
|
625
|
+
r === void 0 && (r = ce.now);
|
|
626
626
|
var i = n.call(this, e, r) || this;
|
|
627
627
|
return i.actions = [], i._active = !1, i;
|
|
628
628
|
}
|
|
@@ -644,16 +644,16 @@ var qe = function(n) {
|
|
|
644
644
|
throw i;
|
|
645
645
|
}
|
|
646
646
|
}, t;
|
|
647
|
-
}(
|
|
647
|
+
}(ce), ze = new Ge(Qe), Ye = ze;
|
|
648
648
|
function Ke(n) {
|
|
649
|
-
return n &&
|
|
649
|
+
return n && S(n.schedule);
|
|
650
650
|
}
|
|
651
651
|
var Je = X(function(n) {
|
|
652
652
|
return function() {
|
|
653
653
|
n(this), this.name = "EmptyError", this.message = "no elements in sequence";
|
|
654
654
|
};
|
|
655
655
|
});
|
|
656
|
-
function
|
|
656
|
+
function _(n, t) {
|
|
657
657
|
var e = typeof t == "object";
|
|
658
658
|
return new Promise(function(r, i) {
|
|
659
659
|
var s = new V({
|
|
@@ -680,9 +680,9 @@ function O(n, t) {
|
|
|
680
680
|
});
|
|
681
681
|
}
|
|
682
682
|
function Xe(n, t, e) {
|
|
683
|
-
n === void 0 && (n = 0), e === void 0 && (e =
|
|
683
|
+
n === void 0 && (n = 0), e === void 0 && (e = Ye);
|
|
684
684
|
var r = -1;
|
|
685
|
-
return t != null && (Ke(t) ? e = t : r = t), new
|
|
685
|
+
return t != null && (Ke(t) ? e = t : r = t), new G(function(i) {
|
|
686
686
|
var s = We(n) ? +n - e.now() : n;
|
|
687
687
|
s < 0 && (s = 0);
|
|
688
688
|
var o = 0;
|
|
@@ -692,28 +692,28 @@ function Xe(n, t, e) {
|
|
|
692
692
|
});
|
|
693
693
|
}
|
|
694
694
|
function Ze(n, t, e) {
|
|
695
|
-
var r =
|
|
695
|
+
var r = S(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 c = !0;
|
|
700
|
+
i.subscribe(Me(s, function(a) {
|
|
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, a), s.next(a);
|
|
703
703
|
}, function() {
|
|
704
|
-
var
|
|
705
|
-
|
|
706
|
-
}, function(
|
|
704
|
+
var a;
|
|
705
|
+
c = !1, (a = r.complete) === null || a === void 0 || a.call(r), s.complete();
|
|
706
|
+
}, function(a) {
|
|
707
707
|
var u;
|
|
708
|
-
|
|
708
|
+
c = !1, (u = r.error) === null || u === void 0 || u.call(r, a), s.error(a);
|
|
709
709
|
}, function() {
|
|
710
|
-
var
|
|
711
|
-
|
|
710
|
+
var a, u;
|
|
711
|
+
c && ((a = r.unsubscribe) === null || a === void 0 || a.call(r)), (u = r.finalize) === null || u === void 0 || u.call(r);
|
|
712
712
|
}));
|
|
713
713
|
}) : Ee;
|
|
714
714
|
}
|
|
715
715
|
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);
|
|
716
|
-
class
|
|
716
|
+
class h extends Error {
|
|
717
717
|
constructor(t) {
|
|
718
718
|
super(`Incorrect context (${t}). Cannot perform the requested operation.`), C(this, "context"), this.context = t;
|
|
719
719
|
}
|
|
@@ -765,18 +765,18 @@ function R(n) {
|
|
|
765
765
|
throw new TypeError("Unable to lift unknown Observable type");
|
|
766
766
|
};
|
|
767
767
|
}
|
|
768
|
-
var
|
|
769
|
-
return
|
|
768
|
+
var Y = function(n, t) {
|
|
769
|
+
return Y = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
770
770
|
e.__proto__ = r;
|
|
771
771
|
} || function(e, r) {
|
|
772
772
|
for (var i in r)
|
|
773
773
|
Object.prototype.hasOwnProperty.call(r, i) && (e[i] = r[i]);
|
|
774
|
-
},
|
|
774
|
+
}, Y(n, t);
|
|
775
775
|
};
|
|
776
776
|
function ee(n, t) {
|
|
777
777
|
if (typeof t != "function" && t !== null)
|
|
778
778
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
779
|
-
|
|
779
|
+
Y(n, t);
|
|
780
780
|
function e() {
|
|
781
781
|
this.constructor = n;
|
|
782
782
|
}
|
|
@@ -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 (c) {
|
|
806
|
+
o = { error: c };
|
|
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 H = 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 c = he(o), a = c.next(); !a.done; a = c.next()) {
|
|
857
|
+
var u = a.value;
|
|
858
858
|
u.remove(this);
|
|
859
859
|
}
|
|
860
|
-
} catch (
|
|
861
|
-
t = { error:
|
|
860
|
+
} catch (g) {
|
|
861
|
+
t = { error: g };
|
|
862
862
|
} finally {
|
|
863
863
|
try {
|
|
864
|
-
|
|
864
|
+
a && !a.done && (e = c.return) && e.call(c);
|
|
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 (E(
|
|
872
|
+
var l = this.initialTeardown;
|
|
873
|
+
if (E(l))
|
|
874
874
|
try {
|
|
875
|
-
|
|
876
|
-
} catch (
|
|
877
|
-
s =
|
|
875
|
+
l();
|
|
876
|
+
} catch (g) {
|
|
877
|
+
s = g instanceof H ? g.errors : [g];
|
|
878
878
|
}
|
|
879
|
-
var
|
|
880
|
-
if (
|
|
879
|
+
var d = this._finalizers;
|
|
880
|
+
if (d) {
|
|
881
881
|
this._finalizers = null;
|
|
882
882
|
try {
|
|
883
|
-
for (var b = he(
|
|
884
|
-
var j =
|
|
883
|
+
for (var b = he(d), y = b.next(); !y.done; y = b.next()) {
|
|
884
|
+
var j = y.value;
|
|
885
885
|
try {
|
|
886
886
|
pe(j);
|
|
887
|
-
} catch (
|
|
888
|
-
s = s ?? [],
|
|
887
|
+
} catch (g) {
|
|
888
|
+
s = s ?? [], g instanceof H ? s = J(J([], K(s)), K(g.errors)) : s.push(g);
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
|
-
} catch (
|
|
892
|
-
r = { error:
|
|
891
|
+
} catch (g) {
|
|
892
|
+
r = { error: g };
|
|
893
893
|
} finally {
|
|
894
894
|
try {
|
|
895
|
-
|
|
895
|
+
y && !y.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 H(s);
|
|
904
904
|
}
|
|
905
905
|
}, n.prototype.add = function(t) {
|
|
906
906
|
var e;
|
|
@@ -933,13 +933,13 @@ var te = function() {
|
|
|
933
933
|
}(), n;
|
|
934
934
|
}();
|
|
935
935
|
te.EMPTY;
|
|
936
|
-
function
|
|
936
|
+
function Ie(n) {
|
|
937
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
|
-
var
|
|
942
|
+
var _e = {
|
|
943
943
|
onUnhandledError: null,
|
|
944
944
|
onStoppedNotification: null,
|
|
945
945
|
Promise: void 0,
|
|
@@ -956,21 +956,21 @@ var Ie = {
|
|
|
956
956
|
},
|
|
957
957
|
delegate: void 0
|
|
958
958
|
};
|
|
959
|
-
function
|
|
959
|
+
function at(n) {
|
|
960
960
|
ot.setTimeout(function() {
|
|
961
961
|
throw n;
|
|
962
962
|
});
|
|
963
963
|
}
|
|
964
964
|
function fe() {
|
|
965
965
|
}
|
|
966
|
-
function
|
|
966
|
+
function ct(n) {
|
|
967
967
|
n();
|
|
968
968
|
}
|
|
969
969
|
var re = function(n) {
|
|
970
970
|
ee(t, n);
|
|
971
971
|
function t(e) {
|
|
972
972
|
var r = n.call(this) || this;
|
|
973
|
-
return r.isStopped = !1, e ? (r.destination = e,
|
|
973
|
+
return r.isStopped = !1, e ? (r.destination = e, Ie(e) && e.add(r)) : r.destination = dt, r;
|
|
974
974
|
}
|
|
975
975
|
return t.create = function(e, r, i) {
|
|
976
976
|
return new W(e, r, i);
|
|
@@ -998,7 +998,7 @@ var re = function(n) {
|
|
|
998
998
|
}
|
|
999
999
|
}, t;
|
|
1000
1000
|
}(te), ut = Function.prototype.bind;
|
|
1001
|
-
function
|
|
1001
|
+
function q(n, t) {
|
|
1002
1002
|
return ut.call(n, t);
|
|
1003
1003
|
}
|
|
1004
1004
|
var lt = function() {
|
|
@@ -1043,13 +1043,13 @@ var lt = function() {
|
|
|
1043
1043
|
complete: i ?? void 0
|
|
1044
1044
|
};
|
|
1045
1045
|
else {
|
|
1046
|
-
var
|
|
1047
|
-
s &&
|
|
1046
|
+
var c;
|
|
1047
|
+
s && _e.useDeprecatedNextContext ? (c = Object.create(e), c.unsubscribe = function() {
|
|
1048
1048
|
return s.unsubscribe();
|
|
1049
1049
|
}, o = {
|
|
1050
|
-
next: e.next &&
|
|
1051
|
-
error: e.error &&
|
|
1052
|
-
complete: e.complete &&
|
|
1050
|
+
next: e.next && q(e.next, c),
|
|
1051
|
+
error: e.error && q(e.error, c),
|
|
1052
|
+
complete: e.complete && q(e.complete, c)
|
|
1053
1053
|
}) : o = e;
|
|
1054
1054
|
}
|
|
1055
1055
|
return s.destination = new lt(o), s;
|
|
@@ -1057,7 +1057,7 @@ var lt = function() {
|
|
|
1057
1057
|
return t;
|
|
1058
1058
|
}(re);
|
|
1059
1059
|
function L(n) {
|
|
1060
|
-
|
|
1060
|
+
at(n);
|
|
1061
1061
|
}
|
|
1062
1062
|
function ht(n) {
|
|
1063
1063
|
throw n;
|
|
@@ -1089,9 +1089,9 @@ var gt = function() {
|
|
|
1089
1089
|
return e.source = this, e.operator = t, e;
|
|
1090
1090
|
}, n.prototype.subscribe = function(t, e, r) {
|
|
1091
1091
|
var i = this, s = bt(t) ? t : new W(t, e, r);
|
|
1092
|
-
return
|
|
1093
|
-
var o = i,
|
|
1094
|
-
s.add(
|
|
1092
|
+
return ct(function() {
|
|
1093
|
+
var o = i, c = o.operator, a = o.source;
|
|
1094
|
+
s.add(c ? c.call(s, a) : a ? 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(c) {
|
|
1107
1107
|
try {
|
|
1108
|
-
t(
|
|
1109
|
-
} catch (
|
|
1110
|
-
s(
|
|
1108
|
+
t(c);
|
|
1109
|
+
} catch (a) {
|
|
1110
|
+
s(a), o.unsubscribe();
|
|
1111
1111
|
}
|
|
1112
1112
|
},
|
|
1113
1113
|
error: s,
|
|
@@ -1142,36 +1142,36 @@ var gt = function() {
|
|
|
1142
1142
|
}();
|
|
1143
1143
|
function ge(n) {
|
|
1144
1144
|
var t;
|
|
1145
|
-
return (t = n ??
|
|
1145
|
+
return (t = n ?? _e.Promise) !== null && t !== void 0 ? t : Promise;
|
|
1146
1146
|
}
|
|
1147
1147
|
function vt(n) {
|
|
1148
1148
|
return n && E(n.next) && E(n.error) && E(n.complete);
|
|
1149
1149
|
}
|
|
1150
1150
|
function bt(n) {
|
|
1151
|
-
return n && n instanceof re || vt(n) &&
|
|
1151
|
+
return n && n instanceof re || vt(n) && Ie(n);
|
|
1152
1152
|
}
|
|
1153
1153
|
function P(n, t, e, r, i) {
|
|
1154
1154
|
return new yt(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, c) {
|
|
1159
|
+
var a = n.call(this, e) || this;
|
|
1160
|
+
return a.onFinalize = o, a.shouldUnsubscribe = c, a._next = r ? function(u) {
|
|
1161
1161
|
try {
|
|
1162
1162
|
r(u);
|
|
1163
|
-
} catch (
|
|
1164
|
-
e.error(
|
|
1163
|
+
} catch (l) {
|
|
1164
|
+
e.error(l);
|
|
1165
1165
|
}
|
|
1166
|
-
} : n.prototype._next,
|
|
1166
|
+
} : n.prototype._next, a._error = s ? function(u) {
|
|
1167
1167
|
try {
|
|
1168
1168
|
s(u);
|
|
1169
|
-
} catch (
|
|
1170
|
-
e.error(
|
|
1169
|
+
} catch (l) {
|
|
1170
|
+
e.error(l);
|
|
1171
1171
|
} finally {
|
|
1172
1172
|
this.unsubscribe();
|
|
1173
1173
|
}
|
|
1174
|
-
} : n.prototype._error,
|
|
1174
|
+
} : n.prototype._error, a._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, a;
|
|
1183
1183
|
}
|
|
1184
1184
|
return t.prototype.unsubscribe = function() {
|
|
1185
1185
|
var e;
|
|
@@ -1189,7 +1189,7 @@ var yt = function(n) {
|
|
|
1189
1189
|
}
|
|
1190
1190
|
}, t;
|
|
1191
1191
|
}(re);
|
|
1192
|
-
function
|
|
1192
|
+
function p(n, t) {
|
|
1193
1193
|
return R(function(e, r) {
|
|
1194
1194
|
var i = 0;
|
|
1195
1195
|
e.subscribe(P(r, function(s) {
|
|
@@ -1210,7 +1210,7 @@ function m(n) {
|
|
|
1210
1210
|
}));
|
|
1211
1211
|
});
|
|
1212
1212
|
}
|
|
1213
|
-
function
|
|
1213
|
+
function v(n, t) {
|
|
1214
1214
|
return R(function(e, r) {
|
|
1215
1215
|
var i = 0;
|
|
1216
1216
|
e.subscribe(P(r, function(s) {
|
|
@@ -1227,24 +1227,24 @@ function wt(n, t) {
|
|
|
1227
1227
|
}));
|
|
1228
1228
|
});
|
|
1229
1229
|
}
|
|
1230
|
-
function
|
|
1230
|
+
function f(n, t, e) {
|
|
1231
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 c = !0;
|
|
1236
|
+
i.subscribe(P(s, function(a) {
|
|
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, a), s.next(a);
|
|
1239
1239
|
}, function() {
|
|
1240
|
-
var
|
|
1241
|
-
|
|
1242
|
-
}, function(
|
|
1240
|
+
var a;
|
|
1241
|
+
c = !1, (a = r.complete) === null || a === void 0 || a.call(r), s.complete();
|
|
1242
|
+
}, function(a) {
|
|
1243
1243
|
var u;
|
|
1244
|
-
|
|
1244
|
+
c = !1, (u = r.error) === null || u === void 0 || u.call(r, a), s.error(a);
|
|
1245
1245
|
}, function() {
|
|
1246
|
-
var
|
|
1247
|
-
|
|
1246
|
+
var a, u;
|
|
1247
|
+
c && ((a = r.unsubscribe) === null || a === void 0 || a.call(r)), (u = r.finalize) === null || u === void 0 || u.call(r);
|
|
1248
1248
|
}));
|
|
1249
1249
|
}) : Te;
|
|
1250
1250
|
}
|
|
@@ -1321,7 +1321,7 @@ class xt {
|
|
|
1321
1321
|
*/
|
|
1322
1322
|
determineContext() {
|
|
1323
1323
|
return Xe(1e3).pipe(
|
|
1324
|
-
|
|
1324
|
+
p(() => (this.isEmbedded() ? this.currentContext = "user" : this.currentContext = "guest", this.currentContext)),
|
|
1325
1325
|
m(1)
|
|
1326
1326
|
);
|
|
1327
1327
|
}
|
|
@@ -1333,19 +1333,19 @@ class xt {
|
|
|
1333
1333
|
*/
|
|
1334
1334
|
openBridge() {
|
|
1335
1335
|
if (!this.isEmbedded())
|
|
1336
|
-
throw new
|
|
1336
|
+
throw new h(this.currentContext);
|
|
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
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1340
|
+
v((i) => i.type === t && i.replyTo === e.id),
|
|
1341
|
+
p((i) => i),
|
|
1342
|
+
f(this.logReceived(t)),
|
|
1343
|
+
p((i) => {
|
|
1344
1344
|
if (this.supportedVersions.some((s) => Ct(s, i.protocolVersion)))
|
|
1345
1345
|
throw new le(i.protocolVersion, this.supportedVersions[0]);
|
|
1346
1346
|
return i;
|
|
1347
1347
|
}),
|
|
1348
|
-
|
|
1348
|
+
f((i) => {
|
|
1349
1349
|
this.negotiatedProtocolVersion = i.protocolVersion, this.logService.info(
|
|
1350
1350
|
`[IPC] Negotiated IPC Protocol Version: ${this.negotiatedProtocolVersion}`
|
|
1351
1351
|
);
|
|
@@ -1363,13 +1363,13 @@ class xt {
|
|
|
1363
1363
|
*/
|
|
1364
1364
|
requestSSOToken() {
|
|
1365
1365
|
if (!this.isEmbedded())
|
|
1366
|
-
throw new
|
|
1366
|
+
throw new h(this.currentContext);
|
|
1367
1367
|
const t = "TOKEN", e = this.createMessage(t);
|
|
1368
1368
|
this.logCreated(t, e);
|
|
1369
1369
|
const r = this.incomingMessages$.pipe(
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1370
|
+
v((i) => i.type === t && i.replyTo === e.id),
|
|
1371
|
+
p((i) => i),
|
|
1372
|
+
f(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;
|
|
@@ -1389,18 +1389,18 @@ class xt {
|
|
|
1389
1389
|
*/
|
|
1390
1390
|
sendJoiningRoomMessage(t) {
|
|
1391
1391
|
if (!this.isEmbedded())
|
|
1392
|
-
throw new
|
|
1392
|
+
throw new h(this.currentContext);
|
|
1393
1393
|
const {
|
|
1394
1394
|
roomName: e,
|
|
1395
1395
|
roomInvite: r,
|
|
1396
1396
|
displayName: i,
|
|
1397
1397
|
jwtToken: s,
|
|
1398
1398
|
serverUrl: o,
|
|
1399
|
-
region:
|
|
1400
|
-
joinMicMuted:
|
|
1399
|
+
region: c,
|
|
1400
|
+
joinMicMuted: a,
|
|
1401
1401
|
joinWithoutCamera: u
|
|
1402
|
-
} = t,
|
|
1403
|
-
|
|
1402
|
+
} = t, l = "JOINING ROOM", d = this.createMessage(l, !1);
|
|
1403
|
+
d.roomName = e, d.jwtToken = s, d.serverUrl = o, d.region = c, d.roomInvite = r, d.joinMicMuted = a ?? !1, d.joinWithoutCamera = u ?? !1, d.displayName = i, this.logCreated(l, d), this.port2.postMessage(d), this.logSent(l, d);
|
|
1404
1404
|
}
|
|
1405
1405
|
/**
|
|
1406
1406
|
* Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.
|
|
@@ -1415,7 +1415,7 @@ class xt {
|
|
|
1415
1415
|
*/
|
|
1416
1416
|
sendLeavingRoomMessage(t) {
|
|
1417
1417
|
if (!this.isEmbedded())
|
|
1418
|
-
throw new
|
|
1418
|
+
throw new h(this.currentContext);
|
|
1419
1419
|
const e = "LEAVING ROOM", r = this.createMessage(e, !1);
|
|
1420
1420
|
r.roomName = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);
|
|
1421
1421
|
}
|
|
@@ -1447,13 +1447,13 @@ class xt {
|
|
|
1447
1447
|
*/
|
|
1448
1448
|
onJoinRoomMessage() {
|
|
1449
1449
|
if (!this.isEmbedded())
|
|
1450
|
-
throw new
|
|
1450
|
+
throw new h(this.currentContext);
|
|
1451
1451
|
const t = "JOIN ROOM";
|
|
1452
1452
|
return this.incomingMessages$.pipe(
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1453
|
+
v((e) => e.type === t && e.target === "client"),
|
|
1454
|
+
p((e) => e),
|
|
1455
|
+
f(this.logReceived(t)),
|
|
1456
|
+
p((e) => e)
|
|
1457
1457
|
);
|
|
1458
1458
|
}
|
|
1459
1459
|
/**
|
|
@@ -1483,13 +1483,13 @@ class xt {
|
|
|
1483
1483
|
*/
|
|
1484
1484
|
onLeaveRoomMessage() {
|
|
1485
1485
|
if (!this.isEmbedded())
|
|
1486
|
-
throw new
|
|
1486
|
+
throw new h(this.currentContext);
|
|
1487
1487
|
const t = "LEAVE ROOM";
|
|
1488
1488
|
return this.incomingMessages$.pipe(
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1489
|
+
v((e) => e.type === t && e.target === "client"),
|
|
1490
|
+
p((e) => e),
|
|
1491
|
+
f(this.logReceived(t)),
|
|
1492
|
+
p((e) => e)
|
|
1493
1493
|
);
|
|
1494
1494
|
}
|
|
1495
1495
|
/**
|
|
@@ -1520,13 +1520,13 @@ class xt {
|
|
|
1520
1520
|
*/
|
|
1521
1521
|
onConfigMessage() {
|
|
1522
1522
|
if (!this.isEmbedded())
|
|
1523
|
-
throw new
|
|
1523
|
+
throw new h(this.currentContext);
|
|
1524
1524
|
const t = "CONFIG";
|
|
1525
1525
|
return this.incomingMessages$.pipe(
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1526
|
+
v((e) => e.type === t && e.target === "client"),
|
|
1527
|
+
p((e) => e),
|
|
1528
|
+
f(this.logReceived(t)),
|
|
1529
|
+
p((e) => ({
|
|
1530
1530
|
preferredCameraType: e.preferredCameraType,
|
|
1531
1531
|
preferredMicType: e.preferredMicType,
|
|
1532
1532
|
preferredOutputType: e.preferredOutputType,
|
|
@@ -1542,28 +1542,28 @@ class xt {
|
|
|
1542
1542
|
}
|
|
1543
1543
|
sendScreenshareSourceMessage(t) {
|
|
1544
1544
|
if (!this.isEmbedded())
|
|
1545
|
-
throw new
|
|
1545
|
+
throw new h(this.currentContext);
|
|
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
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1549
|
+
v((s) => s.type === e && s.replyTo === r.id),
|
|
1550
|
+
p((s) => s),
|
|
1551
|
+
f(this.logReceived(e)),
|
|
1552
|
+
p((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
|
}
|
|
1557
1557
|
layoutChange(t, e, r) {
|
|
1558
1558
|
if (!this.isEmbedded())
|
|
1559
|
-
throw new
|
|
1559
|
+
throw new h(this.currentContext);
|
|
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
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1563
|
+
v((c) => c.type === i && c.replyTo === s.id),
|
|
1564
|
+
p((c) => c),
|
|
1565
|
+
f(this.logReceived(i)),
|
|
1566
|
+
p((c) => c),
|
|
1567
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;
|
|
@@ -1601,38 +1601,38 @@ class xt {
|
|
|
1601
1601
|
*/
|
|
1602
1602
|
onLayoutChangeMessage() {
|
|
1603
1603
|
if (!this.isEmbedded())
|
|
1604
|
-
throw new
|
|
1604
|
+
throw new h(this.currentContext);
|
|
1605
1605
|
const t = "LAYOUT CHANGE";
|
|
1606
1606
|
return this.incomingMessages$.pipe(
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1607
|
+
v((e) => e.type === t && e.target === "client" && e.replyTo === null),
|
|
1608
|
+
p((e) => e),
|
|
1609
|
+
f(this.logReceived(t)),
|
|
1610
|
+
p((e) => e)
|
|
1611
1611
|
);
|
|
1612
1612
|
}
|
|
1613
1613
|
requestOAuthToken(t) {
|
|
1614
1614
|
if (!this.isEmbedded())
|
|
1615
|
-
throw new
|
|
1615
|
+
throw new h(this.currentContext);
|
|
1616
1616
|
Array.isArray(t) || (t = [t]);
|
|
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
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1620
|
+
v((s) => s.type === e && s.replyTo === r.id),
|
|
1621
|
+
p((s) => s),
|
|
1622
|
+
f(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
|
}
|
|
1627
1627
|
openUrl(t, e) {
|
|
1628
1628
|
if (!this.isEmbedded())
|
|
1629
|
-
throw new
|
|
1629
|
+
throw new h(this.currentContext);
|
|
1630
1630
|
const r = "OPEN URL", i = this.createMessage(r, !1);
|
|
1631
1631
|
i.url = t, i.data = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
|
|
1632
1632
|
}
|
|
1633
1633
|
selectContacts(t, e, r, i) {
|
|
1634
1634
|
if (!this.isEmbedded())
|
|
1635
|
-
throw new
|
|
1635
|
+
throw new h(this.currentContext);
|
|
1636
1636
|
if (e === "group" && i === void 0)
|
|
1637
1637
|
throw new x(
|
|
1638
1638
|
"currentContacts",
|
|
@@ -1647,19 +1647,19 @@ class xt {
|
|
|
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
|
-
|
|
1652
|
-
|
|
1650
|
+
const c = this.incomingMessages$.pipe(
|
|
1651
|
+
v((a) => a.type === s && a.replyTo === o.id),
|
|
1652
|
+
f(this.logReceived(s)),
|
|
1653
1653
|
// validate if `streamId` is the same as we sent
|
|
1654
|
-
|
|
1655
|
-
const u =
|
|
1654
|
+
p((a) => {
|
|
1655
|
+
const u = a;
|
|
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), c;
|
|
1663
1663
|
}
|
|
1664
1664
|
/**
|
|
1665
1665
|
* Request detailed contact information for the given Cloud usernames.
|
|
@@ -1671,15 +1671,15 @@ class xt {
|
|
|
1671
1671
|
*/
|
|
1672
1672
|
matchContacts(t) {
|
|
1673
1673
|
if (!this.isEmbedded())
|
|
1674
|
-
throw new
|
|
1674
|
+
throw new h(this.currentContext);
|
|
1675
1675
|
if (!t.length)
|
|
1676
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
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1680
|
+
v((s) => s.type === e && s.replyTo === r.id),
|
|
1681
|
+
f(this.logReceived(e)),
|
|
1682
|
+
p((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;
|
|
@@ -1712,12 +1712,12 @@ class xt {
|
|
|
1712
1712
|
*/
|
|
1713
1713
|
onPushMessageMessage() {
|
|
1714
1714
|
if (!this.isEmbedded())
|
|
1715
|
-
throw new
|
|
1715
|
+
throw new h(this.currentContext);
|
|
1716
1716
|
const t = "PUSH MESSAGE";
|
|
1717
1717
|
return this.incomingMessages$.pipe(
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1718
|
+
v((e) => e.type === t && e.target === "client"),
|
|
1719
|
+
p((e) => e),
|
|
1720
|
+
f(this.logReceived(t))
|
|
1721
1721
|
);
|
|
1722
1722
|
}
|
|
1723
1723
|
/**
|
|
@@ -1731,13 +1731,13 @@ class xt {
|
|
|
1731
1731
|
*/
|
|
1732
1732
|
requestPushToken() {
|
|
1733
1733
|
if (!this.isEmbedded())
|
|
1734
|
-
throw new
|
|
1734
|
+
throw new h(this.currentContext);
|
|
1735
1735
|
const t = "PUSH TOKEN", e = this.createMessage(t);
|
|
1736
1736
|
this.logCreated(t, e);
|
|
1737
1737
|
const r = this.incomingMessages$.pipe(
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1738
|
+
v((i) => i.type === t && i.replyTo === e.id),
|
|
1739
|
+
f(this.logReceived(t)),
|
|
1740
|
+
p((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;
|
|
@@ -1771,19 +1771,19 @@ class xt {
|
|
|
1771
1771
|
*/
|
|
1772
1772
|
onPushTokenMessage() {
|
|
1773
1773
|
if (!this.isEmbedded())
|
|
1774
|
-
throw new
|
|
1774
|
+
throw new h(this.currentContext);
|
|
1775
1775
|
const t = "PUSH TOKEN";
|
|
1776
1776
|
return this.incomingMessages$.pipe(
|
|
1777
|
-
|
|
1777
|
+
v(
|
|
1778
1778
|
(e) => e.type === t && e.target === "client" && e.replyTo === null && e.expectReply === !1
|
|
1779
1779
|
),
|
|
1780
|
-
|
|
1780
|
+
p((e) => {
|
|
1781
1781
|
if (e.pushToken && e.selector && e.appId)
|
|
1782
1782
|
return e;
|
|
1783
1783
|
throw new Error("PushTokenMessage is missing required PushTokenPayload fields");
|
|
1784
1784
|
}),
|
|
1785
|
-
|
|
1786
|
-
|
|
1785
|
+
f((e) => e.pushToken),
|
|
1786
|
+
f(this.logReceived(t))
|
|
1787
1787
|
);
|
|
1788
1788
|
}
|
|
1789
1789
|
/**
|
|
@@ -1795,12 +1795,12 @@ class xt {
|
|
|
1795
1795
|
*/
|
|
1796
1796
|
onBadgeQueryMessage() {
|
|
1797
1797
|
if (!this.isEmbedded())
|
|
1798
|
-
throw new
|
|
1798
|
+
throw new h(this.currentContext);
|
|
1799
1799
|
const t = "BADGE QUERY";
|
|
1800
1800
|
return this.incomingMessages$.pipe(
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1801
|
+
v((e) => e.type === t && e.target === "client"),
|
|
1802
|
+
p((e) => e),
|
|
1803
|
+
f(this.logReceived(t))
|
|
1804
1804
|
);
|
|
1805
1805
|
}
|
|
1806
1806
|
/**
|
|
@@ -1817,7 +1817,7 @@ class xt {
|
|
|
1817
1817
|
*/
|
|
1818
1818
|
sendBadgeUpdateMessage(t, e, r) {
|
|
1819
1819
|
if (!this.isEmbedded())
|
|
1820
|
-
throw new
|
|
1820
|
+
throw new h(this.currentContext);
|
|
1821
1821
|
const i = "BADGE UPDATE", s = this.createMessage(i, !1, r);
|
|
1822
1822
|
s.count = t, s.activity = e ?? !1, this.logCreated(i, s), this.port2.postMessage(s), this.logSent(i, s);
|
|
1823
1823
|
}
|
|
@@ -1836,7 +1836,7 @@ class xt {
|
|
|
1836
1836
|
*/
|
|
1837
1837
|
sendLifecycleMessage(t, e) {
|
|
1838
1838
|
if (!this.isEmbedded())
|
|
1839
|
-
throw new
|
|
1839
|
+
throw new h(this.currentContext);
|
|
1840
1840
|
const r = "LIFECYCLE", i = this.createMessage(r, !1);
|
|
1841
1841
|
i.eventName = t, i.payload = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
|
|
1842
1842
|
}
|
|
@@ -1853,12 +1853,12 @@ class xt {
|
|
|
1853
1853
|
*/
|
|
1854
1854
|
onLifecycleMessage() {
|
|
1855
1855
|
if (!this.isEmbedded())
|
|
1856
|
-
throw new
|
|
1856
|
+
throw new h(this.currentContext);
|
|
1857
1857
|
const t = "LIFECYCLE";
|
|
1858
1858
|
return this.incomingMessages$.pipe(
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1859
|
+
v((e) => e.type === t && e.target === "client"),
|
|
1860
|
+
p((e) => e),
|
|
1861
|
+
f(this.logReceived(t))
|
|
1862
1862
|
);
|
|
1863
1863
|
}
|
|
1864
1864
|
/**
|
|
@@ -1875,7 +1875,7 @@ class xt {
|
|
|
1875
1875
|
*/
|
|
1876
1876
|
sendLogMessage(t, e) {
|
|
1877
1877
|
if (!this.isEmbedded())
|
|
1878
|
-
throw new
|
|
1878
|
+
throw new h(this.currentContext);
|
|
1879
1879
|
const r = "LOG", i = this.createMessage(r, !1);
|
|
1880
1880
|
i.level = t, i.message = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
|
|
1881
1881
|
}
|
|
@@ -1893,12 +1893,12 @@ class xt {
|
|
|
1893
1893
|
*/
|
|
1894
1894
|
onRequestLogsMessage() {
|
|
1895
1895
|
if (!this.isEmbedded())
|
|
1896
|
-
throw new
|
|
1896
|
+
throw new h(this.currentContext);
|
|
1897
1897
|
const t = "REQUEST LOGS";
|
|
1898
1898
|
return this.incomingMessages$.pipe(
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1899
|
+
v((e) => e.type === t && e.target === "client"),
|
|
1900
|
+
p((e) => e),
|
|
1901
|
+
f(this.logReceived(t))
|
|
1902
1902
|
);
|
|
1903
1903
|
}
|
|
1904
1904
|
/**
|
|
@@ -1916,7 +1916,7 @@ class xt {
|
|
|
1916
1916
|
*/
|
|
1917
1917
|
sendViewTransitionMessage(t, e) {
|
|
1918
1918
|
if (!this.isEmbedded())
|
|
1919
|
-
throw new
|
|
1919
|
+
throw new h(this.currentContext);
|
|
1920
1920
|
const r = "VIEW TRANSITION", i = this.createMessage(r, !1);
|
|
1921
1921
|
i.transitionType = t, i.targetView = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
|
|
1922
1922
|
}
|
|
@@ -1950,6 +1950,7 @@ class xt {
|
|
|
1950
1950
|
* });
|
|
1951
1951
|
* ```
|
|
1952
1952
|
*
|
|
1953
|
+
* @param fileId - An identifier for the file being requested. This should be a UUIDv4 string.
|
|
1953
1954
|
* @param fileHash - An SHA256 hash of the file being requested.
|
|
1954
1955
|
* @param intent - The intent of the file request. Can be either `attachment` or `general`.
|
|
1955
1956
|
* @param streamId - _Optional_. The ID of the message stream to which the files will be attached
|
|
@@ -1960,31 +1961,31 @@ class xt {
|
|
|
1960
1961
|
* @returns An observable that either emits once if the result is `error` or `not found` or
|
|
1961
1962
|
* emits as many times as the number of chunks in the file if the result is `success`.
|
|
1962
1963
|
*/
|
|
1963
|
-
sendFileRequestMessage(t, e, r, i) {
|
|
1964
|
+
sendFileRequestMessage(t, e, r, i, s) {
|
|
1964
1965
|
if (!this.isEmbedded())
|
|
1965
|
-
throw new
|
|
1966
|
-
const
|
|
1967
|
-
if (
|
|
1968
|
-
if (!
|
|
1966
|
+
throw new h(this.currentContext);
|
|
1967
|
+
const o = "FILE REQUEST", c = this.createMessage(o);
|
|
1968
|
+
if (c.fileId = t, c.fileHash = e.toLowerCase(), c.intent = r, c.maxChunkSizeInBytes = s, r === "attachment") {
|
|
1969
|
+
if (!i)
|
|
1969
1970
|
throw new x(
|
|
1970
1971
|
"streamId",
|
|
1971
|
-
|
|
1972
|
+
i,
|
|
1972
1973
|
"streamId is required for attachment intent"
|
|
1973
1974
|
);
|
|
1974
|
-
|
|
1975
|
+
c.streamId = i;
|
|
1975
1976
|
}
|
|
1976
|
-
this.logCreated(
|
|
1977
|
+
this.logCreated(o, c);
|
|
1977
1978
|
let a = 0;
|
|
1978
|
-
const
|
|
1979
|
-
|
|
1980
|
-
(
|
|
1979
|
+
const u = this.incomingMessages$.pipe(
|
|
1980
|
+
v(
|
|
1981
|
+
(l) => l.type === o && l.replyTo === c.id
|
|
1981
1982
|
),
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
wt((
|
|
1983
|
+
f(this.logReceived(o)),
|
|
1984
|
+
f(() => a++),
|
|
1985
|
+
p((l) => (l.result === "success" && (l.chunkHash = l.chunkHash.toLowerCase(), l.fileHash = l.fileHash.toLowerCase()), l)),
|
|
1986
|
+
wt((l) => l.result === "success" && a < l.totalChunks, !0)
|
|
1986
1987
|
);
|
|
1987
|
-
return this.port2.postMessage(
|
|
1988
|
+
return this.port2.postMessage(c), this.logSent(o, c), u;
|
|
1988
1989
|
}
|
|
1989
1990
|
/**
|
|
1990
1991
|
* Sends a {@link FileRequestMessageReply} to the Host app, to reply to a
|
|
@@ -2007,7 +2008,7 @@ class xt {
|
|
|
2007
2008
|
*/
|
|
2008
2009
|
sendFileRequestMessageReply(t, e) {
|
|
2009
2010
|
if (!this.isEmbedded())
|
|
2010
|
-
throw new
|
|
2011
|
+
throw new h(this.currentContext);
|
|
2011
2012
|
const r = "FILE REQUEST", i = Object.assign(
|
|
2012
2013
|
e,
|
|
2013
2014
|
this.createMessage(r, !1, t.id)
|
|
@@ -2028,14 +2029,14 @@ class xt {
|
|
|
2028
2029
|
*/
|
|
2029
2030
|
onFileRequestMessage() {
|
|
2030
2031
|
if (!this.isEmbedded())
|
|
2031
|
-
throw new
|
|
2032
|
+
throw new h(this.currentContext);
|
|
2032
2033
|
const t = "FILE REQUEST";
|
|
2033
2034
|
return this.incomingMessages$.pipe(
|
|
2034
|
-
|
|
2035
|
+
v(
|
|
2035
2036
|
(e) => e.type === t && e.target === "client" && e.replyTo === null
|
|
2036
2037
|
),
|
|
2037
|
-
|
|
2038
|
-
|
|
2038
|
+
p((e) => (e.fileHash = e.fileHash.toLowerCase(), e)),
|
|
2039
|
+
f(this.logReceived(t))
|
|
2039
2040
|
);
|
|
2040
2041
|
}
|
|
2041
2042
|
/**
|
|
@@ -2050,6 +2051,8 @@ class xt {
|
|
|
2050
2051
|
* `general`. Defaults to `attachment`.
|
|
2051
2052
|
* @param streamId - _Optional_. The ID of the message stream to which the files will be attached
|
|
2052
2053
|
* to. Only used if `intent` is set to `attachment`.
|
|
2054
|
+
* @param correlationId - _Optional_. The correlation ID of the message the attachments are being
|
|
2055
|
+
* selected for. This should be a UUIDv4 string. Only used if `intent` is set to `attachment`.
|
|
2053
2056
|
* @param maxCount - _Optional_. The maximum number of files the user can select. Defaults to
|
|
2054
2057
|
* unlimited.
|
|
2055
2058
|
* @param maxFileSize - _Optional_. The maximum size of the files to select in bytes. Defaults to
|
|
@@ -2060,9 +2063,9 @@ class xt {
|
|
|
2060
2063
|
*/
|
|
2061
2064
|
sendFileSelectionMessage(t = "attachment", e, r, i, s, o) {
|
|
2062
2065
|
if (!this.isEmbedded())
|
|
2063
|
-
throw new
|
|
2064
|
-
const
|
|
2065
|
-
if (
|
|
2066
|
+
throw new h(this.currentContext);
|
|
2067
|
+
const c = "FILE SELECTION", a = this.createMessage(c);
|
|
2068
|
+
if (a.intent = t, a.maxCount = i, a.maxFileSizeInBytes = s, a.mimeTypes = o, t === "attachment") {
|
|
2066
2069
|
if (!e)
|
|
2067
2070
|
throw new x(
|
|
2068
2071
|
"streamId",
|
|
@@ -2075,21 +2078,21 @@ class xt {
|
|
|
2075
2078
|
r,
|
|
2076
2079
|
"correlationId is required for attachment intent"
|
|
2077
2080
|
);
|
|
2078
|
-
|
|
2081
|
+
a.streamId = e, a.correlationId = r;
|
|
2079
2082
|
}
|
|
2080
|
-
this.logCreated(
|
|
2083
|
+
this.logCreated(c, a);
|
|
2081
2084
|
const u = this.incomingMessages$.pipe(
|
|
2082
|
-
|
|
2083
|
-
(
|
|
2085
|
+
v(
|
|
2086
|
+
(l) => l.type === c && l.replyTo === a.id
|
|
2084
2087
|
),
|
|
2085
|
-
|
|
2086
|
-
var
|
|
2087
|
-
return
|
|
2088
|
+
p((l) => {
|
|
2089
|
+
var d;
|
|
2090
|
+
return l.files = (d = l.files) == null ? void 0 : d.map((b) => (b.original.fileHash = b.original.fileHash.toLowerCase(), b.preview && (b.preview.fileHash = b.preview.fileHash.toLowerCase()), b)), l;
|
|
2088
2091
|
}),
|
|
2089
|
-
|
|
2092
|
+
f(this.logReceived(c)),
|
|
2090
2093
|
m(1)
|
|
2091
2094
|
);
|
|
2092
|
-
return this.port2.postMessage(
|
|
2095
|
+
return this.port2.postMessage(a), this.logSent(c, a), u;
|
|
2093
2096
|
}
|
|
2094
2097
|
/**
|
|
2095
2098
|
* Sends a {@link FileDownloadMessage} to the Host app, to request the download of a file.
|
|
@@ -2107,16 +2110,16 @@ class xt {
|
|
|
2107
2110
|
*/
|
|
2108
2111
|
sendFileDownloadMessage(t, e, r, i) {
|
|
2109
2112
|
if (!this.isEmbedded())
|
|
2110
|
-
throw new
|
|
2113
|
+
throw new h(this.currentContext);
|
|
2111
2114
|
const s = "FILE DOWNLOAD", o = this.createMessage(s);
|
|
2112
2115
|
o.url = t, o.key = e, o.fileName = r, o.mimeType = i, this.logCreated(s, o);
|
|
2113
|
-
const
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2116
|
+
const c = this.incomingMessages$.pipe(
|
|
2117
|
+
v((a) => a.type === s && a.replyTo === o.id),
|
|
2118
|
+
f(this.logReceived(s)),
|
|
2119
|
+
p((a) => a),
|
|
2117
2120
|
m(1)
|
|
2118
2121
|
);
|
|
2119
|
-
return this.port2.postMessage(o), this.logSent(s, o),
|
|
2122
|
+
return this.port2.postMessage(o), this.logSent(s, o), c;
|
|
2120
2123
|
}
|
|
2121
2124
|
sendFileUploadMessage() {
|
|
2122
2125
|
throw new Error("Not implemented");
|
|
@@ -2140,11 +2143,11 @@ class xt {
|
|
|
2140
2143
|
*
|
|
2141
2144
|
* @returns This method returns void.
|
|
2142
2145
|
*/
|
|
2143
|
-
sendFileOpenMessage(t, e, r, i, s, o,
|
|
2146
|
+
sendFileOpenMessage(t, e, r, i, s, o, c) {
|
|
2144
2147
|
if (!this.isEmbedded())
|
|
2145
|
-
throw new
|
|
2146
|
-
const
|
|
2147
|
-
u.fileHash = t.toLowerCase(), u.fileName = e, u.streamId = r, u.url = i, u.correlationId = s, u.key = o, u.sender =
|
|
2148
|
+
throw new h(this.currentContext);
|
|
2149
|
+
const a = "FILE OPEN", u = this.createMessage(a, !1);
|
|
2150
|
+
u.fileHash = t.toLowerCase(), u.fileName = e, u.streamId = r, u.url = i, u.correlationId = s, u.key = o, u.sender = c, this.logCreated(a, u), this.port2.postMessage(u), this.logSent(a, u);
|
|
2148
2151
|
}
|
|
2149
2152
|
/**
|
|
2150
2153
|
* Sends a {@link FileRemoveMessage} to the Host app, to request removal of a file from the
|
|
@@ -2163,13 +2166,13 @@ class xt {
|
|
|
2163
2166
|
*/
|
|
2164
2167
|
sendFileRemoveMessage(t, e) {
|
|
2165
2168
|
if (!this.isEmbedded())
|
|
2166
|
-
throw new
|
|
2169
|
+
throw new h(this.currentContext);
|
|
2167
2170
|
const r = "FILE REMOVE", i = this.createMessage(r, !0);
|
|
2168
2171
|
i.hash = t.toLowerCase(), i.streamId = e, this.logCreated(r, i);
|
|
2169
2172
|
const s = this.incomingMessages$.pipe(
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
+
v((o) => o.type === r && o.replyTo === i.id),
|
|
2174
|
+
f(this.logReceived(r)),
|
|
2175
|
+
p((o) => o),
|
|
2173
2176
|
m(1)
|
|
2174
2177
|
);
|
|
2175
2178
|
return this.port2.postMessage(i), this.logSent(r, i), s;
|
|
@@ -2189,29 +2192,78 @@ class xt {
|
|
|
2189
2192
|
*/
|
|
2190
2193
|
sendAppResetMessage() {
|
|
2191
2194
|
if (!this.isEmbedded())
|
|
2192
|
-
throw new
|
|
2195
|
+
throw new h(this.currentContext);
|
|
2193
2196
|
const t = "APP RESET", e = this.createMessage(t, !1);
|
|
2194
2197
|
this.logCreated(t, e), this.port2.postMessage(e), this.logSent(t, e);
|
|
2195
2198
|
}
|
|
2196
2199
|
/**
|
|
2197
2200
|
* Sends a {@link MessageSentMessage} to the Host app, to notify it of a message that has been
|
|
2198
|
-
* sent to the specified stream
|
|
2201
|
+
* sent to the specified stream.
|
|
2199
2202
|
*
|
|
2200
2203
|
* @remarks
|
|
2201
|
-
*
|
|
2202
|
-
*
|
|
2204
|
+
* @remarks
|
|
2205
|
+
* The `streamId` field is used to specify the ID of the message stream the message is being sent
|
|
2206
|
+
* to. The `correlationId` field is used to identify the message being composed and as an
|
|
2207
|
+
* idempotency key.
|
|
2208
|
+
*
|
|
2209
|
+
* The `host` app can use the `correlationId` to identify any attachments associated with the
|
|
2210
|
+
* message in it's storage
|
|
2203
2211
|
*
|
|
2204
2212
|
* @param streamId - ID of the stream the message was sent to.
|
|
2205
|
-
* @param
|
|
2206
|
-
* message.
|
|
2213
|
+
* @param correlationId - Correlation ID of the message that was sent.
|
|
2207
2214
|
*
|
|
2208
2215
|
* @returns This method returns void.
|
|
2209
2216
|
*/
|
|
2210
2217
|
sendMessageSentMessage(t, e) {
|
|
2211
2218
|
if (!this.isEmbedded())
|
|
2212
|
-
throw new
|
|
2219
|
+
throw new h(this.currentContext);
|
|
2213
2220
|
const r = "MESSAGE SENT", i = this.createMessage(r, !1);
|
|
2214
|
-
i.streamId = t, i.
|
|
2221
|
+
i.streamId = t, i.correlationId = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
|
|
2222
|
+
}
|
|
2223
|
+
/**
|
|
2224
|
+
* Sends a {@link SendMessageMessage} to the Host app, to send a message to the specified stream.
|
|
2225
|
+
*
|
|
2226
|
+
* @param streamId - ID of the stream the message is being sent to.
|
|
2227
|
+
* @param correlationId - Correlation ID of the message being sent.
|
|
2228
|
+
* @param body - The body of the message.
|
|
2229
|
+
* @param messageType - The type of the message. Defaults to `TEXT`.
|
|
2230
|
+
* @param mentions - _Optional_. A list of mentions in the message.
|
|
2231
|
+
* @param attachments - _Optional_. A list of file IDs of the attachments being sent with the
|
|
2232
|
+
* message.
|
|
2233
|
+
* @param relatedMessageId - _Optional_. The ID of the related message in case `messageType` is
|
|
2234
|
+
* `REPLY` or `UPDATE`.
|
|
2235
|
+
* @param setCursors - _Optional_. Whether to set the cursors for the message. Defaults to `true`.
|
|
2236
|
+
* @param threadId - _Optional_. The ID of the thread the message is being sent to.
|
|
2237
|
+
*
|
|
2238
|
+
* @returns This method returns void.
|
|
2239
|
+
*/
|
|
2240
|
+
sendSendMessageMessage(t, e, r, i = "TEXT", s, o, c, a = !0, u) {
|
|
2241
|
+
if (!this.isEmbedded())
|
|
2242
|
+
throw new h(this.currentContext);
|
|
2243
|
+
const l = "SEND MESSAGE", d = this.createMessage(l, !0);
|
|
2244
|
+
d.streamId = t, d.correlationId = e, d.body = r, d.messageType = i, d.mentions = s ?? [], d.attachments = (o == null ? void 0 : o.map((y) => y.toLowerCase())) ?? [], d.relatedMessageId = c, d.setCursors = a, d.threadId = u, this.logCreated(l, d);
|
|
2245
|
+
const b = this.incomingMessages$.pipe(
|
|
2246
|
+
v((y) => y.type === l && y.replyTo === d.id),
|
|
2247
|
+
f(this.logReceived(l)),
|
|
2248
|
+
p((y) => y),
|
|
2249
|
+
m(1)
|
|
2250
|
+
);
|
|
2251
|
+
return this.port2.postMessage(d), this.logSent(l, d), b;
|
|
2252
|
+
}
|
|
2253
|
+
/**
|
|
2254
|
+
* Sends a {@link CancelSendMessageMessage} to the Host app, to cancel a message that was being
|
|
2255
|
+
* sent to the specified stream.
|
|
2256
|
+
*
|
|
2257
|
+
* @param streamId - ID of the stream the message was being sent to.
|
|
2258
|
+
* @param correlationId - Correlation ID of the message that was being sent.
|
|
2259
|
+
*
|
|
2260
|
+
* @returns This method returns void.
|
|
2261
|
+
*/
|
|
2262
|
+
sendCancelSendMessageMessage(t, e) {
|
|
2263
|
+
if (!this.isEmbedded())
|
|
2264
|
+
throw new h(this.currentContext);
|
|
2265
|
+
const r = "CANCEL SEND MESSAGE", i = this.createMessage(r, !1);
|
|
2266
|
+
i.streamId = t, i.correlationId = e, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
|
|
2215
2267
|
}
|
|
2216
2268
|
/**
|
|
2217
2269
|
* Sends a {@link SipCallMessage} to the Host app to initiate a SIP call between the current user
|
|
@@ -2221,7 +2273,7 @@ class xt {
|
|
|
2221
2273
|
*/
|
|
2222
2274
|
sendSipCallMessage(t) {
|
|
2223
2275
|
if (!this.isEmbedded())
|
|
2224
|
-
throw new
|
|
2276
|
+
throw new h(this.currentContext);
|
|
2225
2277
|
const e = "SIP CALL", r = this.createMessage(e, !1);
|
|
2226
2278
|
r.contact = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);
|
|
2227
2279
|
}
|
|
@@ -2265,7 +2317,7 @@ class xt {
|
|
|
2265
2317
|
return ne(this.negotiatedProtocolVersion, t);
|
|
2266
2318
|
}
|
|
2267
2319
|
logReceived(t, e) {
|
|
2268
|
-
e &&
|
|
2320
|
+
e && It(e) && (e = { ...e, data: "..." });
|
|
2269
2321
|
const r = (i) => this.logService.debug(`[IPC] Received ${t} message`, i);
|
|
2270
2322
|
return e && r(e), r;
|
|
2271
2323
|
}
|
|
@@ -2308,10 +2360,10 @@ class xt {
|
|
|
2308
2360
|
return i.join("");
|
|
2309
2361
|
}
|
|
2310
2362
|
}
|
|
2311
|
-
function
|
|
2363
|
+
function It(n) {
|
|
2312
2364
|
return n.type === "FILE REQUEST" && n.replyTo !== null;
|
|
2313
2365
|
}
|
|
2314
|
-
const
|
|
2366
|
+
const _t = ["2.0"];
|
|
2315
2367
|
class Rt {
|
|
2316
2368
|
/**
|
|
2317
2369
|
* A class that manages the IPC communication between the `Client` and the `Host`.
|
|
@@ -2327,15 +2379,15 @@ class Rt {
|
|
|
2327
2379
|
/**
|
|
2328
2380
|
* The type of the `Host` app the `Client` is embedded in.
|
|
2329
2381
|
*/
|
|
2330
|
-
|
|
2382
|
+
I(this, "host");
|
|
2331
2383
|
/**
|
|
2332
2384
|
* The cloud ID of the `Host` app the `Client` is embedded in.
|
|
2333
2385
|
*/
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
this.logger = t ?? console, this.helper = new xt(
|
|
2386
|
+
I(this, "cloudId");
|
|
2387
|
+
I(this, "logger");
|
|
2388
|
+
I(this, "helper");
|
|
2389
|
+
I(this, "listeners");
|
|
2390
|
+
this.logger = t ?? console, this.helper = new xt(_t, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(w.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(w.Lifecycle, /* @__PURE__ */ new Set()), this.listeners.set(w.PushToken, /* @__PURE__ */ new Set());
|
|
2339
2391
|
}
|
|
2340
2392
|
/**
|
|
2341
2393
|
* Returns whether the app is running inside a native WebView (`host` context) or as a
|
|
@@ -2362,7 +2414,7 @@ class Rt {
|
|
|
2362
2414
|
* @returns A promise with {@link IPCContext} the app is running under.
|
|
2363
2415
|
*/
|
|
2364
2416
|
async determineContext() {
|
|
2365
|
-
const t = await
|
|
2417
|
+
const t = await _(this.helper.determineContext(), {
|
|
2366
2418
|
defaultValue: "guest"
|
|
2367
2419
|
});
|
|
2368
2420
|
return this.evaluateContext(t);
|
|
@@ -2371,23 +2423,23 @@ class Rt {
|
|
|
2371
2423
|
* Initiates the IPC handshake with the `Host` app.
|
|
2372
2424
|
*/
|
|
2373
2425
|
initiateConnection() {
|
|
2374
|
-
return
|
|
2426
|
+
return _(
|
|
2375
2427
|
this.helper.openBridge().pipe(
|
|
2376
2428
|
Ze((t) => {
|
|
2377
2429
|
this.helper.onBadgeQueryMessage().subscribe((e) => {
|
|
2378
2430
|
var r;
|
|
2379
2431
|
this.logger.debug("Received Badge Query: ", e);
|
|
2380
|
-
for (const i of ((r = this.listeners.get(
|
|
2432
|
+
for (const i of ((r = this.listeners.get(w.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
|
|
2381
2433
|
i();
|
|
2382
2434
|
}), this.helper.onLifecycleMessage().subscribe((e) => {
|
|
2383
2435
|
var r;
|
|
2384
2436
|
this.logger.debug("Received Lifecycle Event: ", e);
|
|
2385
|
-
for (const i of ((r = this.listeners.get(
|
|
2437
|
+
for (const i of ((r = this.listeners.get(w.Lifecycle)) == null ? void 0 : r.values()) ?? [])
|
|
2386
2438
|
i(e.eventName, e.payload);
|
|
2387
2439
|
}), this.helper.onPushTokenMessage().subscribe((e) => {
|
|
2388
2440
|
var r;
|
|
2389
2441
|
this.logger.debug("Received Push Token: ", e);
|
|
2390
|
-
for (const i of ((r = this.listeners.get(
|
|
2442
|
+
for (const i of ((r = this.listeners.get(w.PushToken)) == null ? void 0 : r.values()) ?? [])
|
|
2391
2443
|
i(e.pushToken, e.appId, e.selector);
|
|
2392
2444
|
}), this.cloudId = t.cloudId, this.host = t.host;
|
|
2393
2445
|
}),
|
|
@@ -2414,7 +2466,7 @@ class Rt {
|
|
|
2414
2466
|
);
|
|
2415
2467
|
} else
|
|
2416
2468
|
r ? i = r : i = "cloudUsername", s = this.helper.selectContacts(t.toString(), "direct", i);
|
|
2417
|
-
return
|
|
2469
|
+
return _(s.pipe(O((o) => o.contacts)));
|
|
2418
2470
|
}
|
|
2419
2471
|
/**
|
|
2420
2472
|
* Matches batch of {@link ContactItem} objects against the Host's contact list to fetch detailed
|
|
@@ -2426,7 +2478,7 @@ class Rt {
|
|
|
2426
2478
|
* Host's contact list.
|
|
2427
2479
|
*/
|
|
2428
2480
|
matchContacts(t) {
|
|
2429
|
-
return this.logger.debug("Match Contacts: ", t),
|
|
2481
|
+
return this.logger.debug("Match Contacts: ", t), _(this.helper.matchContacts(t).pipe(O((e) => e.contacts)));
|
|
2430
2482
|
}
|
|
2431
2483
|
/**
|
|
2432
2484
|
* Requests the `Host` app to provide the Push Token for the current device.
|
|
@@ -2434,7 +2486,7 @@ class Rt {
|
|
|
2434
2486
|
* @returns A promise with the Push Token as `string`.
|
|
2435
2487
|
*/
|
|
2436
2488
|
requestPushToken() {
|
|
2437
|
-
return this.logger.debug("Requesting Push Token"),
|
|
2489
|
+
return this.logger.debug("Requesting Push Token"), _(this.helper.requestPushToken().pipe(O((t) => t.pushToken)));
|
|
2438
2490
|
}
|
|
2439
2491
|
/**
|
|
2440
2492
|
* Sends the current badge count to the `Host` app.
|
|
@@ -2484,9 +2536,9 @@ class Rt {
|
|
|
2484
2536
|
*/
|
|
2485
2537
|
onBadgeQueryRequest(t) {
|
|
2486
2538
|
var e;
|
|
2487
|
-
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(
|
|
2539
|
+
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(w.BadgeQuery)) == null || e.add(t), () => {
|
|
2488
2540
|
var r;
|
|
2489
|
-
return (r = this.listeners.get(
|
|
2541
|
+
return (r = this.listeners.get(w.BadgeQuery)) == null ? void 0 : r.delete(t);
|
|
2490
2542
|
};
|
|
2491
2543
|
}
|
|
2492
2544
|
/**
|
|
@@ -2503,9 +2555,9 @@ class Rt {
|
|
|
2503
2555
|
*/
|
|
2504
2556
|
onLifecycleEvent(t) {
|
|
2505
2557
|
var e;
|
|
2506
|
-
return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(
|
|
2558
|
+
return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(w.Lifecycle)) == null || e.add(t), () => {
|
|
2507
2559
|
var r;
|
|
2508
|
-
return (r = this.listeners.get(
|
|
2560
|
+
return (r = this.listeners.get(w.Lifecycle)) == null ? void 0 : r.delete(t);
|
|
2509
2561
|
};
|
|
2510
2562
|
}
|
|
2511
2563
|
/**
|
|
@@ -2521,9 +2573,9 @@ class Rt {
|
|
|
2521
2573
|
*/
|
|
2522
2574
|
onPushToken(t) {
|
|
2523
2575
|
var e;
|
|
2524
|
-
return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(
|
|
2576
|
+
return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(w.PushToken)) == null || e.add(t), () => {
|
|
2525
2577
|
var r;
|
|
2526
|
-
return (r = this.listeners.get(
|
|
2578
|
+
return (r = this.listeners.get(w.PushToken)) == null ? void 0 : r.delete(t);
|
|
2527
2579
|
};
|
|
2528
2580
|
}
|
|
2529
2581
|
evaluateContext(t) {
|
|
@@ -2534,6 +2586,6 @@ class Rt {
|
|
|
2534
2586
|
}
|
|
2535
2587
|
}
|
|
2536
2588
|
export {
|
|
2537
|
-
|
|
2589
|
+
w as IPCEvents,
|
|
2538
2590
|
Rt as IPCManager
|
|
2539
2591
|
};
|