@acrobits/ipc-sdk 0.7.1 → 0.7.2-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/interfaces/CloudUsernameContactItem.html +3 -3
- package/docs/interfaces/DetailedContactItem.html +9 -9
- 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 +231 -193
- 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 Ie = Object.defineProperty;
|
|
2
2
|
var Pe = (n, t, e) => t in n ? Ie(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
return
|
|
3
|
+
var T = (n, t, e) => (Pe(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
var m = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n))(m || {}), 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
|
}
|
|
@@ -30,7 +30,7 @@ function z(n) {
|
|
|
30
30
|
};
|
|
31
31
|
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function $(n, t) {
|
|
34
34
|
var e = typeof Symbol == "function" && n[Symbol.iterator];
|
|
35
35
|
if (!e)
|
|
36
36
|
return n;
|
|
@@ -50,13 +50,13 @@ function L(n, t) {
|
|
|
50
50
|
}
|
|
51
51
|
return s;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function F(n, t, e) {
|
|
54
54
|
if (e || arguments.length === 2)
|
|
55
55
|
for (var r = 0, i = t.length, s; r < i; r++)
|
|
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) {
|
|
@@ -74,7 +74,7 @@ var j = X(function(n) {
|
|
|
74
74
|
`) : "", this.name = "UnsubscriptionError", this.errors = e;
|
|
75
75
|
};
|
|
76
76
|
});
|
|
77
|
-
function
|
|
77
|
+
function k(n, t) {
|
|
78
78
|
if (n) {
|
|
79
79
|
var e = n.indexOf(t);
|
|
80
80
|
0 <= e && n.splice(e, 1);
|
|
@@ -96,8 +96,8 @@ var R = function() {
|
|
|
96
96
|
var u = a.value;
|
|
97
97
|
u.remove(this);
|
|
98
98
|
}
|
|
99
|
-
} catch (
|
|
100
|
-
t = { error:
|
|
99
|
+
} catch (v) {
|
|
100
|
+
t = { error: v };
|
|
101
101
|
} finally {
|
|
102
102
|
try {
|
|
103
103
|
a && !a.done && (e = c.return) && e.call(c);
|
|
@@ -109,29 +109,29 @@ var R = function() {
|
|
|
109
109
|
else
|
|
110
110
|
o.remove(this);
|
|
111
111
|
var g = this.initialTeardown;
|
|
112
|
-
if (
|
|
112
|
+
if (w(g))
|
|
113
113
|
try {
|
|
114
114
|
g();
|
|
115
|
-
} catch (
|
|
116
|
-
s =
|
|
115
|
+
} catch (v) {
|
|
116
|
+
s = v instanceof j ? v.errors : [v];
|
|
117
117
|
}
|
|
118
|
-
var
|
|
119
|
-
if (
|
|
118
|
+
var y = this._finalizers;
|
|
119
|
+
if (y) {
|
|
120
120
|
this._finalizers = null;
|
|
121
121
|
try {
|
|
122
|
-
for (var
|
|
123
|
-
var V =
|
|
122
|
+
for (var p = z(y), S = p.next(); !S.done; S = p.next()) {
|
|
123
|
+
var V = S.value;
|
|
124
124
|
try {
|
|
125
125
|
ie(V);
|
|
126
|
-
} catch (
|
|
127
|
-
s = s ?? [],
|
|
126
|
+
} catch (v) {
|
|
127
|
+
s = s ?? [], v instanceof j ? s = F(F([], $(s)), $(v.errors)) : s.push(v);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
} catch (
|
|
131
|
-
r = { error:
|
|
130
|
+
} catch (v) {
|
|
131
|
+
r = { error: v };
|
|
132
132
|
} finally {
|
|
133
133
|
try {
|
|
134
|
-
|
|
134
|
+
S && !S.done && (i = p.return) && i.call(p);
|
|
135
135
|
} finally {
|
|
136
136
|
if (r)
|
|
137
137
|
throw r.error;
|
|
@@ -162,20 +162,20 @@ var R = function() {
|
|
|
162
162
|
this._parentage = Array.isArray(e) ? (e.push(t), e) : e ? [e, t] : t;
|
|
163
163
|
}, n.prototype._removeParent = function(t) {
|
|
164
164
|
var e = this._parentage;
|
|
165
|
-
e === t ? this._parentage = null : Array.isArray(e) &&
|
|
165
|
+
e === t ? this._parentage = null : Array.isArray(e) && k(e, t);
|
|
166
166
|
}, n.prototype.remove = function(t) {
|
|
167
167
|
var e = this._finalizers;
|
|
168
|
-
e &&
|
|
168
|
+
e && k(e, t), t instanceof n && t._removeParent(this);
|
|
169
169
|
}, n.EMPTY = function() {
|
|
170
170
|
var t = new n();
|
|
171
171
|
return t.closed = !0, t;
|
|
172
172
|
}(), n;
|
|
173
173
|
}(), be = R.EMPTY;
|
|
174
174
|
function me(n) {
|
|
175
|
-
return n instanceof R || n && "closed" in n &&
|
|
175
|
+
return n instanceof R || 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,
|
|
@@ -187,7 +187,7 @@ var we = {
|
|
|
187
187
|
setTimeout: function(n, t) {
|
|
188
188
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
189
189
|
e[r - 2] = arguments[r];
|
|
190
|
-
return setTimeout.apply(void 0,
|
|
190
|
+
return setTimeout.apply(void 0, F([n, t], $(e)));
|
|
191
191
|
},
|
|
192
192
|
clearTimeout: function(n) {
|
|
193
193
|
var t = Se.delegate;
|
|
@@ -202,17 +202,17 @@ function Ae(n) {
|
|
|
202
202
|
}
|
|
203
203
|
function se() {
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function U(n) {
|
|
206
206
|
n();
|
|
207
207
|
}
|
|
208
208
|
var Z = function(n) {
|
|
209
209
|
M(t, n);
|
|
210
210
|
function t(e) {
|
|
211
211
|
var r = n.call(this) || this;
|
|
212
|
-
return r.isStopped = !1, e ? (r.destination = e, me(e) && e.add(r)) : r.destination =
|
|
212
|
+
return r.isStopped = !1, e ? (r.destination = e, me(e) && e.add(r)) : r.destination = $e, r;
|
|
213
213
|
}
|
|
214
214
|
return t.create = function(e, r, i) {
|
|
215
|
-
return new
|
|
215
|
+
return new N(e, r, i);
|
|
216
216
|
}, t.prototype.next = function(e) {
|
|
217
217
|
this.isStopped || this._next(e);
|
|
218
218
|
}, t.prototype.error = function(e) {
|
|
@@ -237,7 +237,7 @@ var Z = function(n) {
|
|
|
237
237
|
}
|
|
238
238
|
}, t;
|
|
239
239
|
}(R), Oe = Function.prototype.bind;
|
|
240
|
-
function
|
|
240
|
+
function H(n, t) {
|
|
241
241
|
return Oe.call(n, t);
|
|
242
242
|
}
|
|
243
243
|
var Le = function() {
|
|
@@ -250,7 +250,7 @@ var Le = function() {
|
|
|
250
250
|
try {
|
|
251
251
|
e.next(t);
|
|
252
252
|
} catch (r) {
|
|
253
|
-
|
|
253
|
+
A(r);
|
|
254
254
|
}
|
|
255
255
|
}, n.prototype.error = function(t) {
|
|
256
256
|
var e = this.partialObserver;
|
|
@@ -258,24 +258,24 @@ var Le = function() {
|
|
|
258
258
|
try {
|
|
259
259
|
e.error(t);
|
|
260
260
|
} catch (r) {
|
|
261
|
-
|
|
261
|
+
A(r);
|
|
262
262
|
}
|
|
263
263
|
else
|
|
264
|
-
|
|
264
|
+
A(t);
|
|
265
265
|
}, n.prototype.complete = function() {
|
|
266
266
|
var t = this.partialObserver;
|
|
267
267
|
if (t.complete)
|
|
268
268
|
try {
|
|
269
269
|
t.complete();
|
|
270
270
|
} catch (e) {
|
|
271
|
-
|
|
271
|
+
A(e);
|
|
272
272
|
}
|
|
273
273
|
}, n;
|
|
274
|
-
}(),
|
|
274
|
+
}(), N = function(n) {
|
|
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,
|
|
@@ -286,25 +286,25 @@ var Le = function() {
|
|
|
286
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 && H(e.next, c),
|
|
290
|
+
error: e.error && H(e.error, c),
|
|
291
|
+
complete: e.complete && H(e.complete, c)
|
|
292
292
|
}) : o = e;
|
|
293
293
|
}
|
|
294
294
|
return s.destination = new Le(o), s;
|
|
295
295
|
}
|
|
296
296
|
return t;
|
|
297
297
|
}(Z);
|
|
298
|
-
function
|
|
298
|
+
function A(n) {
|
|
299
299
|
Ae(n);
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function Ue(n) {
|
|
302
302
|
throw n;
|
|
303
303
|
}
|
|
304
|
-
var
|
|
304
|
+
var $e = {
|
|
305
305
|
closed: !0,
|
|
306
306
|
next: se,
|
|
307
|
-
error:
|
|
307
|
+
error: Ue,
|
|
308
308
|
complete: se
|
|
309
309
|
}, Fe = function() {
|
|
310
310
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
@@ -327,8 +327,8 @@ var Q = function() {
|
|
|
327
327
|
var e = new n();
|
|
328
328
|
return e.source = this, e.operator = t, e;
|
|
329
329
|
}, n.prototype.subscribe = function(t, e, r) {
|
|
330
|
-
var i = this, s = Ve(t) ? t : new
|
|
331
|
-
return
|
|
330
|
+
var i = this, s = Ve(t) ? t : new N(t, e, r);
|
|
331
|
+
return U(function() {
|
|
332
332
|
var o = i, c = o.operator, a = o.source;
|
|
333
333
|
s.add(c ? c.call(s, a) : a ? i._subscribe(s) : i._trySubscribe(s));
|
|
334
334
|
}), s;
|
|
@@ -341,7 +341,7 @@ var Q = function() {
|
|
|
341
341
|
}, n.prototype.forEach = function(t, e) {
|
|
342
342
|
var r = this;
|
|
343
343
|
return e = oe(e), new e(function(i, s) {
|
|
344
|
-
var o = new
|
|
344
|
+
var o = new N({
|
|
345
345
|
next: function(c) {
|
|
346
346
|
try {
|
|
347
347
|
t(c);
|
|
@@ -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 Ne(n) {
|
|
387
|
-
return n &&
|
|
387
|
+
return n && w(n.next) && w(n.error) && w(n.complete);
|
|
388
388
|
}
|
|
389
389
|
function Ve(n) {
|
|
390
390
|
return n && n instanceof Z || Ne(n) && me(n);
|
|
391
391
|
}
|
|
392
392
|
function je(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,9 +406,9 @@ function Ce(n) {
|
|
|
406
406
|
};
|
|
407
407
|
}
|
|
408
408
|
function Me(n, t, e, r, i) {
|
|
409
|
-
return new
|
|
409
|
+
return new He(n, t, e, r, i);
|
|
410
410
|
}
|
|
411
|
-
var
|
|
411
|
+
var He = function(n) {
|
|
412
412
|
M(t, n);
|
|
413
413
|
function t(e, r, i, s, o, c) {
|
|
414
414
|
var a = n.call(this, e) || this;
|
|
@@ -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,10 +458,10 @@ 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() {
|
|
465
465
|
var i, s;
|
|
466
466
|
if (r._throwIfClosed(), !r.isStopped) {
|
|
467
467
|
r.currentObservers || (r.currentObservers = Array.from(r.observers));
|
|
@@ -484,7 +484,7 @@ var De = function(n) {
|
|
|
484
484
|
});
|
|
485
485
|
}, t.prototype.error = function(e) {
|
|
486
486
|
var r = this;
|
|
487
|
-
|
|
487
|
+
U(function() {
|
|
488
488
|
if (r._throwIfClosed(), !r.isStopped) {
|
|
489
489
|
r.hasError = r.isStopped = !0, r.thrownError = e;
|
|
490
490
|
for (var i = r.observers; i.length; )
|
|
@@ -493,7 +493,7 @@ var De = function(n) {
|
|
|
493
493
|
});
|
|
494
494
|
}, t.prototype.complete = function() {
|
|
495
495
|
var e = this;
|
|
496
|
-
|
|
496
|
+
U(function() {
|
|
497
497
|
if (e._throwIfClosed(), !e.isStopped) {
|
|
498
498
|
e.isStopped = !0;
|
|
499
499
|
for (var r = e.observers; r.length; )
|
|
@@ -516,7 +516,7 @@ var De = function(n) {
|
|
|
516
516
|
}, t.prototype._innerSubscribe = function(e) {
|
|
517
517
|
var r = this, i = this, s = i.hasError, o = i.isStopped, c = i.observers;
|
|
518
518
|
return s || o ? be : (this.currentObservers = null, c.push(e), new R(function() {
|
|
519
|
-
r.currentObservers = null,
|
|
519
|
+
r.currentObservers = null, k(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;
|
|
@@ -546,12 +546,12 @@ var De = 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 : be;
|
|
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;
|
|
@@ -563,7 +563,7 @@ var De = function(n) {
|
|
|
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
|
-
return setInterval.apply(void 0,
|
|
566
|
+
return setInterval.apply(void 0, F([n, t], $(e)));
|
|
567
567
|
},
|
|
568
568
|
clearInterval: function(n) {
|
|
569
569
|
var t = Y.delegate;
|
|
@@ -609,16 +609,16 @@ var De = function(n) {
|
|
|
609
609
|
}, t.prototype.unsubscribe = function() {
|
|
610
610
|
if (!this.closed) {
|
|
611
611
|
var e = this, r = e.id, i = e.scheduler, s = i.actions;
|
|
612
|
-
this.work = this.state = this.scheduler = null, this.pending = !1,
|
|
612
|
+
this.work = this.state = this.scheduler = null, this.pending = !1, k(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 =
|
|
621
|
+
}, n.now = qe.now, n;
|
|
622
622
|
}(), Qe = function(n) {
|
|
623
623
|
M(t, n);
|
|
624
624
|
function t(e, r) {
|
|
@@ -645,24 +645,24 @@ var De = function(n) {
|
|
|
645
645
|
}
|
|
646
646
|
}, t;
|
|
647
647
|
}(ce), Ye = new Qe(ze), Ge = Ye;
|
|
648
|
-
function
|
|
649
|
-
return n &&
|
|
648
|
+
function Ke(n) {
|
|
649
|
+
return n && w(n.schedule);
|
|
650
650
|
}
|
|
651
|
-
var
|
|
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
|
-
var s = new
|
|
659
|
+
var s = new N({
|
|
660
660
|
next: function(o) {
|
|
661
661
|
r(o), s.unsubscribe();
|
|
662
662
|
},
|
|
663
663
|
error: i,
|
|
664
664
|
complete: function() {
|
|
665
|
-
e ? r(t.defaultValue) : i(new
|
|
665
|
+
e ? r(t.defaultValue) : i(new Je());
|
|
666
666
|
}
|
|
667
667
|
});
|
|
668
668
|
n.subscribe(s);
|
|
@@ -671,7 +671,7 @@ function T(n, t) {
|
|
|
671
671
|
function We(n) {
|
|
672
672
|
return n instanceof Date && !isNaN(n);
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function O(n, t) {
|
|
675
675
|
return Ce(function(e, r) {
|
|
676
676
|
var i = 0;
|
|
677
677
|
e.subscribe(Me(r, function(s) {
|
|
@@ -682,7 +682,7 @@ function P(n, t) {
|
|
|
682
682
|
function Xe(n, t, e) {
|
|
683
683
|
n === void 0 && (n = 0), e === void 0 && (e = Ge);
|
|
684
684
|
var r = -1;
|
|
685
|
-
return t != null && (
|
|
685
|
+
return t != null && (Ke(t) ? e = t : r = t), new Q(function(i) {
|
|
686
686
|
var s = We(n) ? +n - e.now() : n;
|
|
687
687
|
s < 0 && (s = 0);
|
|
688
688
|
var o = 0;
|
|
@@ -692,7 +692,7 @@ 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);
|
|
@@ -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,13 +746,13 @@ 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
|
-
function
|
|
755
|
+
function I(n) {
|
|
756
756
|
return function(t) {
|
|
757
757
|
if (it(t))
|
|
758
758
|
return t.lift(function(e) {
|
|
@@ -794,7 +794,7 @@ function he(n) {
|
|
|
794
794
|
};
|
|
795
795
|
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function K(n, t) {
|
|
798
798
|
var e = typeof Symbol == "function" && n[Symbol.iterator];
|
|
799
799
|
if (!e)
|
|
800
800
|
return n;
|
|
@@ -814,7 +814,7 @@ function J(n, t) {
|
|
|
814
814
|
}
|
|
815
815
|
return s;
|
|
816
816
|
}
|
|
817
|
-
function
|
|
817
|
+
function J(n, t, e) {
|
|
818
818
|
if (e || arguments.length === 2)
|
|
819
819
|
for (var r = 0, i = t.length, s; r < i; r++)
|
|
820
820
|
(s || !(r in t)) && (s || (s = Array.prototype.slice.call(t, 0, r)), s[r] = t[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) {
|
|
@@ -857,8 +857,8 @@ var te = function() {
|
|
|
857
857
|
var u = a.value;
|
|
858
858
|
u.remove(this);
|
|
859
859
|
}
|
|
860
|
-
} catch (
|
|
861
|
-
t = { error:
|
|
860
|
+
} catch (v) {
|
|
861
|
+
t = { error: v };
|
|
862
862
|
} finally {
|
|
863
863
|
try {
|
|
864
864
|
a && !a.done && (e = c.return) && e.call(c);
|
|
@@ -870,29 +870,29 @@ var te = function() {
|
|
|
870
870
|
else
|
|
871
871
|
o.remove(this);
|
|
872
872
|
var g = this.initialTeardown;
|
|
873
|
-
if (
|
|
873
|
+
if (E(g))
|
|
874
874
|
try {
|
|
875
875
|
g();
|
|
876
|
-
} catch (
|
|
877
|
-
s =
|
|
876
|
+
} catch (v) {
|
|
877
|
+
s = v instanceof D ? v.errors : [v];
|
|
878
878
|
}
|
|
879
|
-
var
|
|
880
|
-
if (
|
|
879
|
+
var y = this._finalizers;
|
|
880
|
+
if (y) {
|
|
881
881
|
this._finalizers = null;
|
|
882
882
|
try {
|
|
883
|
-
for (var
|
|
884
|
-
var V =
|
|
883
|
+
for (var p = he(y), S = p.next(); !S.done; S = p.next()) {
|
|
884
|
+
var V = S.value;
|
|
885
885
|
try {
|
|
886
886
|
pe(V);
|
|
887
|
-
} catch (
|
|
888
|
-
s = s ?? [],
|
|
887
|
+
} catch (v) {
|
|
888
|
+
s = s ?? [], v instanceof D ? s = J(J([], K(s)), K(v.errors)) : s.push(v);
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
|
-
} catch (
|
|
892
|
-
r = { error:
|
|
891
|
+
} catch (v) {
|
|
892
|
+
r = { error: v };
|
|
893
893
|
} finally {
|
|
894
894
|
try {
|
|
895
|
-
|
|
895
|
+
S && !S.done && (i = p.return) && i.call(p);
|
|
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;
|
|
@@ -933,13 +933,13 @@ var te = function() {
|
|
|
933
933
|
}(), n;
|
|
934
934
|
}();
|
|
935
935
|
te.EMPTY;
|
|
936
|
-
function
|
|
937
|
-
return n instanceof te || n && "closed" in n &&
|
|
936
|
+
function Te(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
|
-
var
|
|
942
|
+
var _e = {
|
|
943
943
|
onUnhandledError: null,
|
|
944
944
|
onStoppedNotification: null,
|
|
945
945
|
Promise: void 0,
|
|
@@ -949,7 +949,7 @@ var Te = {
|
|
|
949
949
|
setTimeout: function(n, t) {
|
|
950
950
|
for (var e = [], r = 2; r < arguments.length; r++)
|
|
951
951
|
e[r - 2] = arguments[r];
|
|
952
|
-
return setTimeout.apply(void 0,
|
|
952
|
+
return setTimeout.apply(void 0, J([n, t], K(e)));
|
|
953
953
|
},
|
|
954
954
|
clearTimeout: function(n) {
|
|
955
955
|
return clearTimeout(n);
|
|
@@ -970,7 +970,7 @@ 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, Te(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() {
|
|
@@ -1011,7 +1011,7 @@ var lt = function() {
|
|
|
1011
1011
|
try {
|
|
1012
1012
|
e.next(t);
|
|
1013
1013
|
} catch (r) {
|
|
1014
|
-
|
|
1014
|
+
L(r);
|
|
1015
1015
|
}
|
|
1016
1016
|
}, n.prototype.error = function(t) {
|
|
1017
1017
|
var e = this.partialObserver;
|
|
@@ -1019,24 +1019,24 @@ var lt = function() {
|
|
|
1019
1019
|
try {
|
|
1020
1020
|
e.error(t);
|
|
1021
1021
|
} catch (r) {
|
|
1022
|
-
|
|
1022
|
+
L(r);
|
|
1023
1023
|
}
|
|
1024
1024
|
else
|
|
1025
|
-
|
|
1025
|
+
L(t);
|
|
1026
1026
|
}, n.prototype.complete = function() {
|
|
1027
1027
|
var t = this.partialObserver;
|
|
1028
1028
|
if (t.complete)
|
|
1029
1029
|
try {
|
|
1030
1030
|
t.complete();
|
|
1031
1031
|
} catch (e) {
|
|
1032
|
-
|
|
1032
|
+
L(e);
|
|
1033
1033
|
}
|
|
1034
1034
|
}, n;
|
|
1035
1035
|
}(), W = function(n) {
|
|
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,
|
|
@@ -1044,19 +1044,19 @@ var lt = function() {
|
|
|
1044
1044
|
};
|
|
1045
1045
|
else {
|
|
1046
1046
|
var c;
|
|
1047
|
-
s &&
|
|
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;
|
|
1056
1056
|
}
|
|
1057
1057
|
return t;
|
|
1058
1058
|
}(re);
|
|
1059
|
-
function
|
|
1059
|
+
function L(n) {
|
|
1060
1060
|
at(n);
|
|
1061
1061
|
}
|
|
1062
1062
|
function ht(n) {
|
|
@@ -1142,15 +1142,15 @@ 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
|
-
return n &&
|
|
1148
|
+
return n && E(n.next) && E(n.error) && E(n.complete);
|
|
1149
1149
|
}
|
|
1150
1150
|
function yt(n) {
|
|
1151
|
-
return n && n instanceof re || vt(n) &&
|
|
1151
|
+
return n && n instanceof re || vt(n) && Te(n);
|
|
1152
1152
|
}
|
|
1153
|
-
function
|
|
1153
|
+
function P(n, t, e, r, i) {
|
|
1154
1154
|
return new bt(n, t, e, r, i);
|
|
1155
1155
|
}
|
|
1156
1156
|
var bt = function(n) {
|
|
@@ -1190,9 +1190,9 @@ var bt = function(n) {
|
|
|
1190
1190
|
}, t;
|
|
1191
1191
|
}(re);
|
|
1192
1192
|
function h(n, t) {
|
|
1193
|
-
return
|
|
1193
|
+
return I(function(e, r) {
|
|
1194
1194
|
var i = 0;
|
|
1195
|
-
e.subscribe(
|
|
1195
|
+
e.subscribe(P(r, function(s) {
|
|
1196
1196
|
r.next(n.call(t, s, i++));
|
|
1197
1197
|
}));
|
|
1198
1198
|
});
|
|
@@ -1200,31 +1200,40 @@ function h(n, t) {
|
|
|
1200
1200
|
var mt = new gt(function(n) {
|
|
1201
1201
|
return n.complete();
|
|
1202
1202
|
});
|
|
1203
|
-
function
|
|
1203
|
+
function b(n) {
|
|
1204
1204
|
return n <= 0 ? function() {
|
|
1205
1205
|
return mt;
|
|
1206
|
-
} :
|
|
1206
|
+
} : I(function(t, e) {
|
|
1207
1207
|
var r = 0;
|
|
1208
|
-
t.subscribe(
|
|
1208
|
+
t.subscribe(P(e, function(i) {
|
|
1209
1209
|
++r <= n && (e.next(i), n <= r && e.complete());
|
|
1210
1210
|
}));
|
|
1211
1211
|
});
|
|
1212
1212
|
}
|
|
1213
1213
|
function f(n, t) {
|
|
1214
|
-
return
|
|
1214
|
+
return I(function(e, r) {
|
|
1215
1215
|
var i = 0;
|
|
1216
|
-
e.subscribe(
|
|
1216
|
+
e.subscribe(P(r, function(s) {
|
|
1217
1217
|
return n.call(t, s, i++) && r.next(s);
|
|
1218
1218
|
}));
|
|
1219
1219
|
});
|
|
1220
1220
|
}
|
|
1221
|
+
function wt(n, t) {
|
|
1222
|
+
return t === void 0 && (t = !1), I(function(e, r) {
|
|
1223
|
+
var i = 0;
|
|
1224
|
+
e.subscribe(P(r, function(s) {
|
|
1225
|
+
var o = n(s, i++);
|
|
1226
|
+
(o || t) && r.next(s), !o && r.complete();
|
|
1227
|
+
}));
|
|
1228
|
+
});
|
|
1229
|
+
}
|
|
1221
1230
|
function d(n, t, e) {
|
|
1222
|
-
var r =
|
|
1223
|
-
return r ?
|
|
1231
|
+
var r = E(n) || t || e ? { next: n, error: t, complete: e } : n;
|
|
1232
|
+
return r ? I(function(i, s) {
|
|
1224
1233
|
var o;
|
|
1225
1234
|
(o = r.subscribe) === null || o === void 0 || o.call(r);
|
|
1226
1235
|
var c = !0;
|
|
1227
|
-
i.subscribe(
|
|
1236
|
+
i.subscribe(P(s, function(a) {
|
|
1228
1237
|
var u;
|
|
1229
1238
|
(u = r.next) === null || u === void 0 || u.call(r, a), s.next(a);
|
|
1230
1239
|
}, function() {
|
|
@@ -1239,31 +1248,31 @@ function d(n, t, e) {
|
|
|
1239
1248
|
}));
|
|
1240
1249
|
}) : Re;
|
|
1241
1250
|
}
|
|
1242
|
-
const
|
|
1243
|
-
function
|
|
1251
|
+
const St = /^(\d+)\.(\d+)$/;
|
|
1252
|
+
function Et(n) {
|
|
1244
1253
|
if (typeof n == "string") {
|
|
1245
|
-
const t = n.match(
|
|
1254
|
+
const t = n.match(St);
|
|
1246
1255
|
if (t)
|
|
1247
1256
|
return `${t[1]}.${t[2]}`;
|
|
1248
1257
|
}
|
|
1249
1258
|
throw new nt(n);
|
|
1250
1259
|
}
|
|
1251
1260
|
function ve(n) {
|
|
1252
|
-
const t =
|
|
1261
|
+
const t = Et(n), [e, r] = t.split("."), [i, s] = [parseInt(e), parseInt(r)];
|
|
1253
1262
|
return [i, s];
|
|
1254
1263
|
}
|
|
1255
1264
|
function ne(n, t) {
|
|
1256
1265
|
const [e, r] = ve(n), [i, s] = ve(t);
|
|
1257
1266
|
return e < i ? -1 : e > i ? 1 : r < s ? -1 : r > s ? 1 : 0;
|
|
1258
1267
|
}
|
|
1259
|
-
function
|
|
1268
|
+
function Ct(n, t) {
|
|
1260
1269
|
return ne(n, t) === 1;
|
|
1261
1270
|
}
|
|
1262
|
-
function
|
|
1271
|
+
function Mt(n, t) {
|
|
1263
1272
|
return ne(n, t) >= 0;
|
|
1264
1273
|
}
|
|
1265
1274
|
const ye = "2.0";
|
|
1266
|
-
class
|
|
1275
|
+
class xt {
|
|
1267
1276
|
/**
|
|
1268
1277
|
* Create a new instance of the {@link IpcHelper | IPC Protocol Helper}.
|
|
1269
1278
|
*
|
|
@@ -1274,7 +1283,7 @@ class Mt {
|
|
|
1274
1283
|
* @param logService - An instance of a logging service or utility
|
|
1275
1284
|
*/
|
|
1276
1285
|
constructor(t, e) {
|
|
1277
|
-
if (C(this, "negotiatedProtocolVersion"), C(this, "currentContext"), C(this, "incomingMessages$"), C(this, "inIframe", !1), C(this, "embeddedResult"), C(this, "iframePort1"), C(this, "iframePort2"), this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new xe(), this.supportedVersions = t.filter((r) =>
|
|
1286
|
+
if (C(this, "negotiatedProtocolVersion"), C(this, "currentContext"), C(this, "incomingMessages$"), C(this, "inIframe", !1), C(this, "embeddedResult"), C(this, "iframePort1"), C(this, "iframePort2"), this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new xe(), this.supportedVersions = t.filter((r) => Mt(r, ye)), !this.supportedVersions.length)
|
|
1278
1287
|
throw new le(t, ye);
|
|
1279
1288
|
this.negotiatedProtocolVersion = this.supportedVersions[0], this.embeddedResult = null, this.iframePort2 = null;
|
|
1280
1289
|
}
|
|
@@ -1313,7 +1322,7 @@ class Mt {
|
|
|
1313
1322
|
determineContext() {
|
|
1314
1323
|
return Xe(1e3).pipe(
|
|
1315
1324
|
h(() => (this.isEmbedded() ? this.currentContext = "user" : this.currentContext = "guest", this.currentContext)),
|
|
1316
|
-
|
|
1325
|
+
b(1)
|
|
1317
1326
|
);
|
|
1318
1327
|
}
|
|
1319
1328
|
/**
|
|
@@ -1332,7 +1341,7 @@ class Mt {
|
|
|
1332
1341
|
h((i) => i),
|
|
1333
1342
|
d(this.logReceived(t)),
|
|
1334
1343
|
h((i) => {
|
|
1335
|
-
if (this.supportedVersions.some((s) =>
|
|
1344
|
+
if (this.supportedVersions.some((s) => Ct(s, i.protocolVersion)))
|
|
1336
1345
|
throw new le(i.protocolVersion, this.supportedVersions[0]);
|
|
1337
1346
|
return i;
|
|
1338
1347
|
}),
|
|
@@ -1341,7 +1350,7 @@ class Mt {
|
|
|
1341
1350
|
`[IPC] Negotiated IPC Protocol Version: ${this.negotiatedProtocolVersion}`
|
|
1342
1351
|
);
|
|
1343
1352
|
}),
|
|
1344
|
-
|
|
1353
|
+
b(1)
|
|
1345
1354
|
);
|
|
1346
1355
|
return this.logService.debug(`Created ${t} Reply handler`), this.inIframe ? this.createIframeChannel().then(() => this.finishIpcSetup(e)) : this.finishIpcSetup(e), r;
|
|
1347
1356
|
}
|
|
@@ -1361,7 +1370,7 @@ class Mt {
|
|
|
1361
1370
|
f((i) => i.type === t && i.replyTo === e.id),
|
|
1362
1371
|
h((i) => i),
|
|
1363
1372
|
d(this.logReceived(t)),
|
|
1364
|
-
|
|
1373
|
+
b(1)
|
|
1365
1374
|
);
|
|
1366
1375
|
return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
|
|
1367
1376
|
}
|
|
@@ -1390,8 +1399,8 @@ class Mt {
|
|
|
1390
1399
|
region: c,
|
|
1391
1400
|
joinMicMuted: a,
|
|
1392
1401
|
joinWithoutCamera: u
|
|
1393
|
-
} = t, g = "JOINING ROOM",
|
|
1394
|
-
|
|
1402
|
+
} = t, g = "JOINING ROOM", y = this.createMessage(g, !1);
|
|
1403
|
+
y.roomName = e, y.jwtToken = s, y.serverUrl = o, y.region = c, y.roomInvite = r, y.joinMicMuted = a ?? !1, y.joinWithoutCamera = u ?? !1, y.displayName = i, this.logCreated(g, y), this.port2.postMessage(y), this.logSent(g, y);
|
|
1395
1404
|
}
|
|
1396
1405
|
/**
|
|
1397
1406
|
* Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.
|
|
@@ -1541,7 +1550,7 @@ class Mt {
|
|
|
1541
1550
|
h((s) => s),
|
|
1542
1551
|
d(this.logReceived(e)),
|
|
1543
1552
|
h((s) => s),
|
|
1544
|
-
|
|
1553
|
+
b(1)
|
|
1545
1554
|
);
|
|
1546
1555
|
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
|
|
1547
1556
|
}
|
|
@@ -1555,7 +1564,7 @@ class Mt {
|
|
|
1555
1564
|
h((c) => c),
|
|
1556
1565
|
d(this.logReceived(i)),
|
|
1557
1566
|
h((c) => c),
|
|
1558
|
-
|
|
1567
|
+
b(1)
|
|
1559
1568
|
), this.logService.debug(`Created ${i} Reply handler`)), s.layout = t, this.logCreated(i, s), this.port2.postMessage(s), this.logSent(i, s), o)
|
|
1560
1569
|
return o;
|
|
1561
1570
|
}
|
|
@@ -1611,7 +1620,7 @@ class Mt {
|
|
|
1611
1620
|
f((s) => s.type === e && s.replyTo === r.id),
|
|
1612
1621
|
h((s) => s),
|
|
1613
1622
|
d(this.logReceived(e)),
|
|
1614
|
-
|
|
1623
|
+
b(1)
|
|
1615
1624
|
);
|
|
1616
1625
|
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
|
|
1617
1626
|
}
|
|
@@ -1625,13 +1634,13 @@ class Mt {
|
|
|
1625
1634
|
if (!this.isEmbedded())
|
|
1626
1635
|
throw new l(this.currentContext);
|
|
1627
1636
|
if (e === "group" && i === void 0)
|
|
1628
|
-
throw new
|
|
1637
|
+
throw new x(
|
|
1629
1638
|
"currentContacts",
|
|
1630
1639
|
i,
|
|
1631
1640
|
"currentContacts is required for group streams"
|
|
1632
1641
|
);
|
|
1633
1642
|
if (e === "direct" && i !== void 0)
|
|
1634
|
-
throw new
|
|
1643
|
+
throw new x(
|
|
1635
1644
|
"currentContacts",
|
|
1636
1645
|
i,
|
|
1637
1646
|
"currentContacts should not be passed for direct streams"
|
|
@@ -1648,7 +1657,7 @@ class Mt {
|
|
|
1648
1657
|
throw new rt(u.streamId, t);
|
|
1649
1658
|
return e === "direct" && u.contacts.length > 1 && (u.contacts = [u.contacts[0]]), u;
|
|
1650
1659
|
}),
|
|
1651
|
-
|
|
1660
|
+
b(1)
|
|
1652
1661
|
);
|
|
1653
1662
|
return this.logService.debug(`Created ${s} Reply handler`), this.port2.postMessage(o), this.logSent(s, o), c;
|
|
1654
1663
|
}
|
|
@@ -1664,14 +1673,14 @@ class Mt {
|
|
|
1664
1673
|
if (!this.isEmbedded())
|
|
1665
1674
|
throw new l(this.currentContext);
|
|
1666
1675
|
if (!t.length)
|
|
1667
|
-
throw new
|
|
1676
|
+
throw new x("contacts", t, "At least one contact is required");
|
|
1668
1677
|
const e = "MATCH CONTACTS", r = this.createMessage(e);
|
|
1669
1678
|
r.contacts = [...t], this.logCreated(e, r);
|
|
1670
1679
|
const i = this.incomingMessages$.pipe(
|
|
1671
1680
|
f((s) => s.type === e && s.replyTo === r.id),
|
|
1672
1681
|
d(this.logReceived(e)),
|
|
1673
1682
|
h((s) => s),
|
|
1674
|
-
|
|
1683
|
+
b(1)
|
|
1675
1684
|
);
|
|
1676
1685
|
return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), i;
|
|
1677
1686
|
}
|
|
@@ -1729,7 +1738,7 @@ class Mt {
|
|
|
1729
1738
|
f((i) => i.type === t && i.replyTo === e.id),
|
|
1730
1739
|
d(this.logReceived(t)),
|
|
1731
1740
|
h((i) => i),
|
|
1732
|
-
|
|
1741
|
+
b(1)
|
|
1733
1742
|
);
|
|
1734
1743
|
return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;
|
|
1735
1744
|
}
|
|
@@ -1934,7 +1943,7 @@ class Mt {
|
|
|
1934
1943
|
const s = "FILE TRANSFER", o = this.createMessage(s, !1);
|
|
1935
1944
|
if (o.mimeType = t.mimeType, o.fileName = t.fileName, o.fileSize = t.fileSize, o.fileHash = t.fileHash.toLowerCase(), o.dataType = t.dataType, o.data = t.data, o.intent = e, e === "attachment") {
|
|
1936
1945
|
if (!r)
|
|
1937
|
-
throw new
|
|
1946
|
+
throw new x(
|
|
1938
1947
|
"streamId",
|
|
1939
1948
|
r,
|
|
1940
1949
|
"streamId is required for attachment intent"
|
|
@@ -1946,7 +1955,7 @@ class Mt {
|
|
|
1946
1955
|
f((a) => a.type === s && a.replyTo === o.id),
|
|
1947
1956
|
d(this.logReceived(s)),
|
|
1948
1957
|
h((a) => a),
|
|
1949
|
-
|
|
1958
|
+
b(1)
|
|
1950
1959
|
);
|
|
1951
1960
|
return this.port2.postMessage(o), this.logSent(s, o), c;
|
|
1952
1961
|
}
|
|
@@ -1990,6 +1999,32 @@ class Mt {
|
|
|
1990
1999
|
d(this.logReceived(t))
|
|
1991
2000
|
);
|
|
1992
2001
|
}
|
|
2002
|
+
sendFileRequestMessage({ fileName: t, fileHash: e, fileSize: r, mimeType: i }, s, o, c) {
|
|
2003
|
+
if (!this.isEmbedded())
|
|
2004
|
+
throw new l(this.currentContext);
|
|
2005
|
+
const a = "FILE REQUEST", u = this.createMessage(a);
|
|
2006
|
+
if (u.fileName = t, u.fileHash = e.toLowerCase(), u.fileSize = r, u.mimeType = i, u.intent = s, u.maxChunkSize = c, s === "attachment") {
|
|
2007
|
+
if (!o)
|
|
2008
|
+
throw new x(
|
|
2009
|
+
"streamId",
|
|
2010
|
+
o,
|
|
2011
|
+
"streamId is required for attachment intent"
|
|
2012
|
+
);
|
|
2013
|
+
u.streamId = o;
|
|
2014
|
+
}
|
|
2015
|
+
this.logCreated(a, u);
|
|
2016
|
+
let g = 0;
|
|
2017
|
+
const y = this.incomingMessages$.pipe(
|
|
2018
|
+
f(
|
|
2019
|
+
(p) => p.type === a && p.replyTo === u.id
|
|
2020
|
+
),
|
|
2021
|
+
d(this.logReceived(a)),
|
|
2022
|
+
d(() => g++),
|
|
2023
|
+
h((p) => (p.result === "success" && (p.chunkHash = p.chunkHash.toLowerCase()), p)),
|
|
2024
|
+
wt((p) => p.result === "success" && g < p.totalChunks)
|
|
2025
|
+
);
|
|
2026
|
+
return this.port2.postMessage(u), this.logSent(a, u), y;
|
|
2027
|
+
}
|
|
1993
2028
|
/**
|
|
1994
2029
|
* Sends a {@link FileSelectionMessage} to the Host app, to request the user to select on or
|
|
1995
2030
|
* more files.
|
|
@@ -2011,29 +2046,32 @@ class Mt {
|
|
|
2011
2046
|
*
|
|
2012
2047
|
* @returns This method returns void.
|
|
2013
2048
|
*/
|
|
2014
|
-
sendFileSelectionMessage(t = "attachment", e, r, i) {
|
|
2049
|
+
sendFileSelectionMessage(t = "attachment", e, r, i, s) {
|
|
2015
2050
|
if (!this.isEmbedded())
|
|
2016
2051
|
throw new l(this.currentContext);
|
|
2017
|
-
const
|
|
2018
|
-
if (
|
|
2052
|
+
const o = "FILE SELECTION", c = this.createMessage(o);
|
|
2053
|
+
if (c.intent = t, c.maxCount = r, c.maxFileSize = i, c.mimeTypes = s, t === "attachment") {
|
|
2019
2054
|
if (!e)
|
|
2020
|
-
throw new
|
|
2055
|
+
throw new x(
|
|
2021
2056
|
"streamId",
|
|
2022
2057
|
e,
|
|
2023
2058
|
"streamId is required for attachment intent"
|
|
2024
2059
|
);
|
|
2025
|
-
|
|
2060
|
+
c.streamId = e;
|
|
2026
2061
|
}
|
|
2027
|
-
this.logCreated(
|
|
2028
|
-
const
|
|
2062
|
+
this.logCreated(o, c);
|
|
2063
|
+
const a = this.incomingMessages$.pipe(
|
|
2029
2064
|
f(
|
|
2030
|
-
(
|
|
2065
|
+
(u) => u.type === o && u.replyTo === c.id
|
|
2031
2066
|
),
|
|
2032
|
-
h((
|
|
2033
|
-
|
|
2034
|
-
|
|
2067
|
+
h((u) => {
|
|
2068
|
+
var g, y;
|
|
2069
|
+
return u.files = (g = u.files) == null ? void 0 : g.map((p) => (p.fileHash = p.fileHash.toLowerCase(), p)), u.fileHashes = (y = u.fileHashes) == null ? void 0 : y.map((p) => p.toLowerCase()), u;
|
|
2070
|
+
}),
|
|
2071
|
+
d(this.logReceived(o)),
|
|
2072
|
+
b(1)
|
|
2035
2073
|
);
|
|
2036
|
-
return this.port2.postMessage(
|
|
2074
|
+
return this.port2.postMessage(c), this.logSent(o, c), a;
|
|
2037
2075
|
}
|
|
2038
2076
|
/**
|
|
2039
2077
|
* Sends a {@link FileDownloadMessage} to the Host app, to request the download of a file.
|
|
@@ -2061,7 +2099,7 @@ class Mt {
|
|
|
2061
2099
|
f((a) => a.type === s && a.replyTo === o.id),
|
|
2062
2100
|
d(this.logReceived(s)),
|
|
2063
2101
|
h((a) => a),
|
|
2064
|
-
|
|
2102
|
+
b(1)
|
|
2065
2103
|
);
|
|
2066
2104
|
return this.port2.postMessage(o), this.logSent(s, o), c;
|
|
2067
2105
|
}
|
|
@@ -2088,7 +2126,7 @@ class Mt {
|
|
|
2088
2126
|
f((o) => o.type === r && o.replyTo === i.id),
|
|
2089
2127
|
d(this.logReceived(r)),
|
|
2090
2128
|
h((o) => o),
|
|
2091
|
-
|
|
2129
|
+
b(1)
|
|
2092
2130
|
);
|
|
2093
2131
|
return this.port2.postMessage(i), this.logSent(r, i), s;
|
|
2094
2132
|
}
|
|
@@ -2116,7 +2154,7 @@ class Mt {
|
|
|
2116
2154
|
f((o) => o.type === r && o.replyTo === i.id),
|
|
2117
2155
|
d(this.logReceived(r)),
|
|
2118
2156
|
h((o) => o),
|
|
2119
|
-
|
|
2157
|
+
b(1)
|
|
2120
2158
|
);
|
|
2121
2159
|
return this.port2.postMessage(i), this.logSent(r, i), s;
|
|
2122
2160
|
}
|
|
@@ -2199,7 +2237,7 @@ class Mt {
|
|
|
2199
2237
|
return ne(this.negotiatedProtocolVersion, t);
|
|
2200
2238
|
}
|
|
2201
2239
|
logReceived(t, e) {
|
|
2202
|
-
|
|
2240
|
+
["FILE TRANSFER", "FILE REQUEST"].includes(t) && e != null && e.data && (e = { ...e, data: "..." });
|
|
2203
2241
|
const r = (i) => this.logService.debug(`[IPC] Received ${t} message`, i);
|
|
2204
2242
|
return e && r(e), r;
|
|
2205
2243
|
}
|
|
@@ -2242,8 +2280,8 @@ class Mt {
|
|
|
2242
2280
|
return i.join("");
|
|
2243
2281
|
}
|
|
2244
2282
|
}
|
|
2245
|
-
const
|
|
2246
|
-
class
|
|
2283
|
+
const Tt = ["2.0"];
|
|
2284
|
+
class Rt {
|
|
2247
2285
|
/**
|
|
2248
2286
|
* A class that manages the IPC communication between the `Client` and the `Host`.
|
|
2249
2287
|
*
|
|
@@ -2258,15 +2296,15 @@ class Tt {
|
|
|
2258
2296
|
/**
|
|
2259
2297
|
* The type of the `Host` app the `Client` is embedded in.
|
|
2260
2298
|
*/
|
|
2261
|
-
|
|
2299
|
+
T(this, "host");
|
|
2262
2300
|
/**
|
|
2263
2301
|
* The cloud ID of the `Host` app the `Client` is embedded in.
|
|
2264
2302
|
*/
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
this.logger = t ?? console, this.helper = new
|
|
2303
|
+
T(this, "cloudId");
|
|
2304
|
+
T(this, "logger");
|
|
2305
|
+
T(this, "helper");
|
|
2306
|
+
T(this, "listeners");
|
|
2307
|
+
this.logger = t ?? console, this.helper = new xt(Tt, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(m.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(m.Lifecycle, /* @__PURE__ */ new Set()), this.listeners.set(m.PushToken, /* @__PURE__ */ new Set());
|
|
2270
2308
|
}
|
|
2271
2309
|
/**
|
|
2272
2310
|
* Returns whether the app is running inside a native WebView (`host` context) or as a
|
|
@@ -2293,7 +2331,7 @@ class Tt {
|
|
|
2293
2331
|
* @returns A promise with {@link IPCContext} the app is running under.
|
|
2294
2332
|
*/
|
|
2295
2333
|
async determineContext() {
|
|
2296
|
-
const t = await
|
|
2334
|
+
const t = await _(this.helper.determineContext(), {
|
|
2297
2335
|
defaultValue: "guest"
|
|
2298
2336
|
});
|
|
2299
2337
|
return this.evaluateContext(t);
|
|
@@ -2302,27 +2340,27 @@ class Tt {
|
|
|
2302
2340
|
* Initiates the IPC handshake with the `Host` app.
|
|
2303
2341
|
*/
|
|
2304
2342
|
initiateConnection() {
|
|
2305
|
-
return
|
|
2343
|
+
return _(
|
|
2306
2344
|
this.helper.openBridge().pipe(
|
|
2307
2345
|
Ze((t) => {
|
|
2308
2346
|
this.helper.onBadgeQueryMessage().subscribe((e) => {
|
|
2309
2347
|
var r;
|
|
2310
2348
|
this.logger.debug("Received Badge Query: ", e);
|
|
2311
|
-
for (const i of ((r = this.listeners.get(
|
|
2349
|
+
for (const i of ((r = this.listeners.get(m.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
|
|
2312
2350
|
i();
|
|
2313
2351
|
}), this.helper.onLifecycleMessage().subscribe((e) => {
|
|
2314
2352
|
var r;
|
|
2315
2353
|
this.logger.debug("Received Lifecycle Event: ", e);
|
|
2316
|
-
for (const i of ((r = this.listeners.get(
|
|
2354
|
+
for (const i of ((r = this.listeners.get(m.Lifecycle)) == null ? void 0 : r.values()) ?? [])
|
|
2317
2355
|
i(e.eventName, e.payload);
|
|
2318
2356
|
}), this.helper.onPushTokenMessage().subscribe((e) => {
|
|
2319
2357
|
var r;
|
|
2320
2358
|
this.logger.debug("Received Push Token: ", e);
|
|
2321
|
-
for (const i of ((r = this.listeners.get(
|
|
2359
|
+
for (const i of ((r = this.listeners.get(m.PushToken)) == null ? void 0 : r.values()) ?? [])
|
|
2322
2360
|
i(e.pushToken, e.appId, e.selector);
|
|
2323
2361
|
}), this.cloudId = t.cloudId, this.host = t.host;
|
|
2324
2362
|
}),
|
|
2325
|
-
|
|
2363
|
+
O(() => {
|
|
2326
2364
|
})
|
|
2327
2365
|
)
|
|
2328
2366
|
);
|
|
@@ -2332,7 +2370,7 @@ class Tt {
|
|
|
2332
2370
|
let s;
|
|
2333
2371
|
if (e === "multi") {
|
|
2334
2372
|
if (!r || !Array.isArray(r))
|
|
2335
|
-
throw new
|
|
2373
|
+
throw new x(
|
|
2336
2374
|
"currentContacts",
|
|
2337
2375
|
r,
|
|
2338
2376
|
"currentContacts is required for group streams"
|
|
@@ -2345,7 +2383,7 @@ class Tt {
|
|
|
2345
2383
|
);
|
|
2346
2384
|
} else
|
|
2347
2385
|
r ? i = r : i = "cloudUsername", s = this.helper.selectContacts(t.toString(), "direct", i);
|
|
2348
|
-
return
|
|
2386
|
+
return _(s.pipe(O((o) => o.contacts)));
|
|
2349
2387
|
}
|
|
2350
2388
|
/**
|
|
2351
2389
|
* Matches batch of {@link ContactItem} objects against the Host's contact list to fetch detailed
|
|
@@ -2357,7 +2395,7 @@ class Tt {
|
|
|
2357
2395
|
* Host's contact list.
|
|
2358
2396
|
*/
|
|
2359
2397
|
matchContacts(t) {
|
|
2360
|
-
return this.logger.debug("Match Contacts: ", t),
|
|
2398
|
+
return this.logger.debug("Match Contacts: ", t), _(this.helper.matchContacts(t).pipe(O((e) => e.contacts)));
|
|
2361
2399
|
}
|
|
2362
2400
|
/**
|
|
2363
2401
|
* Requests the `Host` app to provide the Push Token for the current device.
|
|
@@ -2365,7 +2403,7 @@ class Tt {
|
|
|
2365
2403
|
* @returns A promise with the Push Token as `string`.
|
|
2366
2404
|
*/
|
|
2367
2405
|
requestPushToken() {
|
|
2368
|
-
return this.logger.debug("Requesting Push Token"),
|
|
2406
|
+
return this.logger.debug("Requesting Push Token"), _(this.helper.requestPushToken().pipe(O((t) => t.pushToken)));
|
|
2369
2407
|
}
|
|
2370
2408
|
/**
|
|
2371
2409
|
* Sends the current badge count to the `Host` app.
|
|
@@ -2407,9 +2445,9 @@ class Tt {
|
|
|
2407
2445
|
*/
|
|
2408
2446
|
onBadgeQueryRequest(t) {
|
|
2409
2447
|
var e;
|
|
2410
|
-
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(
|
|
2448
|
+
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(m.BadgeQuery)) == null || e.add(t), () => {
|
|
2411
2449
|
var r;
|
|
2412
|
-
return (r = this.listeners.get(
|
|
2450
|
+
return (r = this.listeners.get(m.BadgeQuery)) == null ? void 0 : r.delete(t);
|
|
2413
2451
|
};
|
|
2414
2452
|
}
|
|
2415
2453
|
/**
|
|
@@ -2426,9 +2464,9 @@ class Tt {
|
|
|
2426
2464
|
*/
|
|
2427
2465
|
onLifecycleEvent(t) {
|
|
2428
2466
|
var e;
|
|
2429
|
-
return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(
|
|
2467
|
+
return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(m.Lifecycle)) == null || e.add(t), () => {
|
|
2430
2468
|
var r;
|
|
2431
|
-
return (r = this.listeners.get(
|
|
2469
|
+
return (r = this.listeners.get(m.Lifecycle)) == null ? void 0 : r.delete(t);
|
|
2432
2470
|
};
|
|
2433
2471
|
}
|
|
2434
2472
|
/**
|
|
@@ -2444,9 +2482,9 @@ class Tt {
|
|
|
2444
2482
|
*/
|
|
2445
2483
|
onPushToken(t) {
|
|
2446
2484
|
var e;
|
|
2447
|
-
return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(
|
|
2485
|
+
return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(m.PushToken)) == null || e.add(t), () => {
|
|
2448
2486
|
var r;
|
|
2449
|
-
return (r = this.listeners.get(
|
|
2487
|
+
return (r = this.listeners.get(m.PushToken)) == null ? void 0 : r.delete(t);
|
|
2450
2488
|
};
|
|
2451
2489
|
}
|
|
2452
2490
|
evaluateContext(t) {
|
|
@@ -2457,6 +2495,6 @@ class Tt {
|
|
|
2457
2495
|
}
|
|
2458
2496
|
}
|
|
2459
2497
|
export {
|
|
2460
|
-
|
|
2461
|
-
|
|
2498
|
+
m as IPCEvents,
|
|
2499
|
+
Rt as IPCManager
|
|
2462
2500
|
};
|