@acrobits/ipc-sdk 0.8.0-alpha.2 → 0.8.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/IPCManager.html +1 -1
- package/docs/enums/IPCEvents.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +1 -1
- package/docs/interfaces/BaseContactItem.html +1 -1
- package/docs/interfaces/CloudUsernameContactItem.html +1 -1
- package/docs/interfaces/DetailedContactItem.html +9 -11
- package/docs/interfaces/DetailedContactURI.html +6 -0
- package/docs/interfaces/ILogger.html +1 -1
- package/docs/interfaces/UriContactItem.html +3 -3
- package/docs/modules.html +2 -1
- 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/IPCContext.html +1 -1
- package/docs/types/IpcProtocolVersion.html +1 -1
- package/docs/types/UnsubscribeCallback.html +1 -1
- package/lib/index.d.ts +17 -5
- package/lib/ipc-sdk.js +180 -209
- 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,24 +1,24 @@
|
|
|
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 b = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n))(b || {}),
|
|
5
|
-
return
|
|
3
|
+
var x = (n, t, e) => (Pe(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
var b = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n))(b || {}), H = function(n, t) {
|
|
5
|
+
return H = 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
|
+
}, H(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
|
+
H(n, t);
|
|
16
16
|
function e() {
|
|
17
17
|
this.constructor = n;
|
|
18
18
|
}
|
|
19
19
|
n.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Q(n) {
|
|
22
22
|
var t = typeof Symbol == "function" && Symbol.iterator, e = t && n[t], r = 0;
|
|
23
23
|
if (e)
|
|
24
24
|
return e.call(n);
|
|
@@ -50,7 +50,7 @@ function $(n, t) {
|
|
|
50
50
|
}
|
|
51
51
|
return s;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function k(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]);
|
|
@@ -65,7 +65,7 @@ function X(n) {
|
|
|
65
65
|
}, e = n(t);
|
|
66
66
|
return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;
|
|
67
67
|
}
|
|
68
|
-
var
|
|
68
|
+
var N = X(function(n) {
|
|
69
69
|
return function(e) {
|
|
70
70
|
n(this), this.message = e ? e.length + ` errors occurred during unsubscription:
|
|
71
71
|
` + e.map(function(r, i) {
|
|
@@ -74,13 +74,13 @@ var j = X(function(n) {
|
|
|
74
74
|
`) : "", this.name = "UnsubscriptionError", this.errors = e;
|
|
75
75
|
};
|
|
76
76
|
});
|
|
77
|
-
function
|
|
77
|
+
function F(n, t) {
|
|
78
78
|
if (n) {
|
|
79
79
|
var e = n.indexOf(t);
|
|
80
80
|
0 <= e && n.splice(e, 1);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
var
|
|
83
|
+
var T = function() {
|
|
84
84
|
function n(t) {
|
|
85
85
|
this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;
|
|
86
86
|
}
|
|
@@ -92,7 +92,7 @@ var I = function() {
|
|
|
92
92
|
if (o)
|
|
93
93
|
if (this._parentage = null, Array.isArray(o))
|
|
94
94
|
try {
|
|
95
|
-
for (var c =
|
|
95
|
+
for (var c = Q(o), a = c.next(); !a.done; a = c.next()) {
|
|
96
96
|
var u = a.value;
|
|
97
97
|
u.remove(this);
|
|
98
98
|
}
|
|
@@ -113,18 +113,18 @@ var I = function() {
|
|
|
113
113
|
try {
|
|
114
114
|
v();
|
|
115
115
|
} catch (p) {
|
|
116
|
-
s = p instanceof
|
|
116
|
+
s = p instanceof N ? p.errors : [p];
|
|
117
117
|
}
|
|
118
118
|
var g = this._finalizers;
|
|
119
119
|
if (g) {
|
|
120
120
|
this._finalizers = null;
|
|
121
121
|
try {
|
|
122
|
-
for (var E =
|
|
123
|
-
var
|
|
122
|
+
for (var E = Q(g), w = E.next(); !w.done; w = E.next()) {
|
|
123
|
+
var j = w.value;
|
|
124
124
|
try {
|
|
125
|
-
ie(
|
|
125
|
+
ie(j);
|
|
126
126
|
} catch (p) {
|
|
127
|
-
s = s ?? [], p instanceof
|
|
127
|
+
s = s ?? [], p instanceof N ? s = k(k([], $(s)), $(p.errors)) : s.push(p);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
} catch (p) {
|
|
@@ -139,7 +139,7 @@ var I = function() {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
if (s)
|
|
142
|
-
throw new
|
|
142
|
+
throw new N(s);
|
|
143
143
|
}
|
|
144
144
|
}, n.prototype.add = function(t) {
|
|
145
145
|
var e;
|
|
@@ -162,17 +162,17 @@ var I = 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) && F(e, t);
|
|
166
166
|
}, n.prototype.remove = function(t) {
|
|
167
167
|
var e = this._finalizers;
|
|
168
|
-
e &&
|
|
168
|
+
e && F(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
|
+
}(), ye = T.EMPTY;
|
|
174
174
|
function me(n) {
|
|
175
|
-
return n instanceof
|
|
175
|
+
return n instanceof T || n && "closed" in n && m(n.remove) && m(n.add) && m(n.unsubscribe);
|
|
176
176
|
}
|
|
177
177
|
function ie(n) {
|
|
178
178
|
m(n) ? n() : n.unsubscribe();
|
|
@@ -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, k([n, t], $(e)));
|
|
191
191
|
},
|
|
192
192
|
clearTimeout: function(n) {
|
|
193
193
|
var t = Se.delegate;
|
|
@@ -212,7 +212,7 @@ var Z = function(n) {
|
|
|
212
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 V(e, r, i);
|
|
216
216
|
}, t.prototype.next = function(e) {
|
|
217
217
|
this.isStopped || this._next(e);
|
|
218
218
|
}, t.prototype.error = function(e) {
|
|
@@ -236,7 +236,7 @@ var Z = function(n) {
|
|
|
236
236
|
this.unsubscribe();
|
|
237
237
|
}
|
|
238
238
|
}, t;
|
|
239
|
-
}(
|
|
239
|
+
}(T), Oe = Function.prototype.bind;
|
|
240
240
|
function D(n, t) {
|
|
241
241
|
return Oe.call(n, t);
|
|
242
242
|
}
|
|
@@ -271,7 +271,7 @@ var Le = function() {
|
|
|
271
271
|
A(e);
|
|
272
272
|
}
|
|
273
273
|
}, n;
|
|
274
|
-
}(),
|
|
274
|
+
}(), V = function(n) {
|
|
275
275
|
M(t, n);
|
|
276
276
|
function t(e, r, i) {
|
|
277
277
|
var s = n.call(this) || this, o;
|
|
@@ -306,20 +306,20 @@ var $e = {
|
|
|
306
306
|
next: se,
|
|
307
307
|
error: Ue,
|
|
308
308
|
complete: se
|
|
309
|
-
},
|
|
309
|
+
}, ke = function() {
|
|
310
310
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
311
311
|
}();
|
|
312
312
|
function Ee(n) {
|
|
313
313
|
return n;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function Fe(n) {
|
|
316
316
|
return n.length === 0 ? Ee : n.length === 1 ? n[0] : function(e) {
|
|
317
317
|
return n.reduce(function(r, i) {
|
|
318
318
|
return i(r);
|
|
319
319
|
}, e);
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
|
-
var
|
|
322
|
+
var z = function() {
|
|
323
323
|
function n(t) {
|
|
324
324
|
t && (this._subscribe = t);
|
|
325
325
|
}
|
|
@@ -327,7 +327,7 @@ 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 =
|
|
330
|
+
var i = this, s = je(t) ? t : new V(t, e, r);
|
|
331
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));
|
|
@@ -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 V({
|
|
345
345
|
next: function(c) {
|
|
346
346
|
try {
|
|
347
347
|
t(c);
|
|
@@ -357,12 +357,12 @@ var Q = function() {
|
|
|
357
357
|
}, n.prototype._subscribe = function(t) {
|
|
358
358
|
var e;
|
|
359
359
|
return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);
|
|
360
|
-
}, n.prototype[
|
|
360
|
+
}, n.prototype[ke] = function() {
|
|
361
361
|
return this;
|
|
362
362
|
}, n.prototype.pipe = function() {
|
|
363
363
|
for (var t = [], e = 0; e < arguments.length; e++)
|
|
364
364
|
t[e] = arguments[e];
|
|
365
|
-
return
|
|
365
|
+
return Fe(t)(this);
|
|
366
366
|
}, n.prototype.toPromise = function(t) {
|
|
367
367
|
var e = this;
|
|
368
368
|
return t = oe(t), new t(function(r, i) {
|
|
@@ -383,18 +383,18 @@ function oe(n) {
|
|
|
383
383
|
var t;
|
|
384
384
|
return (t = n ?? we.Promise) !== null && t !== void 0 ? t : Promise;
|
|
385
385
|
}
|
|
386
|
-
function Ne(n) {
|
|
387
|
-
return n && m(n.next) && m(n.error) && m(n.complete);
|
|
388
|
-
}
|
|
389
386
|
function Ve(n) {
|
|
390
|
-
return n && n
|
|
387
|
+
return n && m(n.next) && m(n.error) && m(n.complete);
|
|
391
388
|
}
|
|
392
389
|
function je(n) {
|
|
390
|
+
return n && n instanceof Z || Ve(n) && me(n);
|
|
391
|
+
}
|
|
392
|
+
function Ne(n) {
|
|
393
393
|
return m(n == null ? void 0 : n.lift);
|
|
394
394
|
}
|
|
395
395
|
function Ce(n) {
|
|
396
396
|
return function(t) {
|
|
397
|
-
if (
|
|
397
|
+
if (Ne(t))
|
|
398
398
|
return t.lift(function(e) {
|
|
399
399
|
try {
|
|
400
400
|
return n(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), qe = 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 De = 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 ce(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 qe();
|
|
462
462
|
}, t.prototype.next = function(e) {
|
|
463
463
|
var r = this;
|
|
464
464
|
U(function() {
|
|
@@ -466,7 +466,7 @@ var De = function(n) {
|
|
|
466
466
|
if (r._throwIfClosed(), !r.isStopped) {
|
|
467
467
|
r.currentObservers || (r.currentObservers = Array.from(r.observers));
|
|
468
468
|
try {
|
|
469
|
-
for (var o =
|
|
469
|
+
for (var o = Q(r.currentObservers), c = o.next(); !c.done; c = o.next()) {
|
|
470
470
|
var a = c.value;
|
|
471
471
|
a.next(e);
|
|
472
472
|
}
|
|
@@ -515,19 +515,19 @@ var De = function(n) {
|
|
|
515
515
|
return this._throwIfClosed(), this._checkFinalizedStatuses(e), this._innerSubscribe(e);
|
|
516
516
|
}, t.prototype._innerSubscribe = function(e) {
|
|
517
517
|
var r = this, i = this, s = i.hasError, o = i.isStopped, c = i.observers;
|
|
518
|
-
return s || o ?
|
|
519
|
-
r.currentObservers = null,
|
|
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 z();
|
|
526
526
|
return e.source = this, e;
|
|
527
527
|
}, t.create = function(e, r) {
|
|
528
|
-
return new
|
|
528
|
+
return new ce(e, r);
|
|
529
529
|
}, t;
|
|
530
|
-
}(
|
|
530
|
+
}(z), ce = function(n) {
|
|
531
531
|
M(t, n);
|
|
532
532
|
function t(e, r) {
|
|
533
533
|
var i = n.call(this) || this;
|
|
@@ -544,14 +544,14 @@ var De = function(n) {
|
|
|
544
544
|
(r = (e = this.destination) === null || e === void 0 ? void 0 : e.complete) === null || r === void 0 || r.call(e);
|
|
545
545
|
}, t.prototype._subscribe = function(e) {
|
|
546
546
|
var r, i;
|
|
547
|
-
return (i = (r = this.source) === null || r === void 0 ? void 0 : r.subscribe(e)) !== null && i !== void 0 ? i :
|
|
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), Be = {
|
|
550
550
|
now: function() {
|
|
551
551
|
return Date.now();
|
|
552
552
|
},
|
|
553
553
|
delegate: void 0
|
|
554
|
-
},
|
|
554
|
+
}, He = function(n) {
|
|
555
555
|
M(t, n);
|
|
556
556
|
function t(e, r) {
|
|
557
557
|
return n.call(this) || this;
|
|
@@ -559,18 +559,18 @@ var De = function(n) {
|
|
|
559
559
|
return t.prototype.schedule = function(e, r) {
|
|
560
560
|
return this;
|
|
561
561
|
}, t;
|
|
562
|
-
}(
|
|
562
|
+
}(T), Y = {
|
|
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, k([n, t], $(e)));
|
|
567
567
|
},
|
|
568
568
|
clearInterval: function(n) {
|
|
569
569
|
var t = Y.delegate;
|
|
570
570
|
return ((t == null ? void 0 : t.clearInterval) || clearInterval)(n);
|
|
571
571
|
},
|
|
572
572
|
delegate: void 0
|
|
573
|
-
},
|
|
573
|
+
}, Qe = function(n) {
|
|
574
574
|
M(t, n);
|
|
575
575
|
function t(e, r) {
|
|
576
576
|
var i = n.call(this, e, r) || this;
|
|
@@ -609,20 +609,20 @@ 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, 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
|
+
}(He), ae = 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 = Be.now, n;
|
|
622
|
+
}(), ze = function(n) {
|
|
623
623
|
M(t, n);
|
|
624
624
|
function t(e, r) {
|
|
625
|
-
r === void 0 && (r =
|
|
625
|
+
r === void 0 && (r = ae.now);
|
|
626
626
|
var i = n.call(this, e, r) || this;
|
|
627
627
|
return i.actions = [], i._active = !1, i;
|
|
628
628
|
}
|
|
@@ -644,7 +644,7 @@ var De = function(n) {
|
|
|
644
644
|
throw i;
|
|
645
645
|
}
|
|
646
646
|
}, t;
|
|
647
|
-
}(
|
|
647
|
+
}(ae), Ye = new ze(Qe), Ge = Ye;
|
|
648
648
|
function Ke(n) {
|
|
649
649
|
return n && m(n.schedule);
|
|
650
650
|
}
|
|
@@ -653,10 +653,10 @@ var Je = X(function(n) {
|
|
|
653
653
|
n(this), this.name = "EmptyError", this.message = "no elements in sequence";
|
|
654
654
|
};
|
|
655
655
|
});
|
|
656
|
-
function
|
|
656
|
+
function I(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 V({
|
|
660
660
|
next: function(o) {
|
|
661
661
|
r(o), s.unsubscribe();
|
|
662
662
|
},
|
|
@@ -682,7 +682,7 @@ function O(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 && (Ke(t) ? e = t : r = t), new
|
|
685
|
+
return t != null && (Ke(t) ? e = t : r = t), new z(function(i) {
|
|
686
686
|
var s = We(n) ? +n - e.now() : n;
|
|
687
687
|
s < 0 && (s = 0);
|
|
688
688
|
var o = 0;
|
|
@@ -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 _ 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
|
}
|
|
@@ -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 q = 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) {
|
|
@@ -874,18 +874,18 @@ var te = function() {
|
|
|
874
874
|
try {
|
|
875
875
|
v();
|
|
876
876
|
} catch (p) {
|
|
877
|
-
s = p instanceof
|
|
877
|
+
s = p instanceof q ? p.errors : [p];
|
|
878
878
|
}
|
|
879
879
|
var g = this._finalizers;
|
|
880
880
|
if (g) {
|
|
881
881
|
this._finalizers = null;
|
|
882
882
|
try {
|
|
883
883
|
for (var E = he(g), w = E.next(); !w.done; w = E.next()) {
|
|
884
|
-
var
|
|
884
|
+
var j = w.value;
|
|
885
885
|
try {
|
|
886
|
-
pe(
|
|
886
|
+
pe(j);
|
|
887
887
|
} catch (p) {
|
|
888
|
-
s = s ?? [], p instanceof
|
|
888
|
+
s = s ?? [], p instanceof q ? s = J(J([], K(s)), K(p.errors)) : s.push(p);
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
} catch (p) {
|
|
@@ -900,7 +900,7 @@ var te = function() {
|
|
|
900
900
|
}
|
|
901
901
|
}
|
|
902
902
|
if (s)
|
|
903
|
-
throw new
|
|
903
|
+
throw new q(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 _e(n) {
|
|
937
937
|
return n instanceof te || n && "closed" in n && S(n.remove) && S(n.add) && S(n.unsubscribe);
|
|
938
938
|
}
|
|
939
939
|
function pe(n) {
|
|
940
940
|
S(n) ? n() : n.unsubscribe();
|
|
941
941
|
}
|
|
942
|
-
var
|
|
942
|
+
var Ie = {
|
|
943
943
|
onUnhandledError: null,
|
|
944
944
|
onStoppedNotification: null,
|
|
945
945
|
Promise: void 0,
|
|
@@ -956,21 +956,21 @@ var _e = {
|
|
|
956
956
|
},
|
|
957
957
|
delegate: void 0
|
|
958
958
|
};
|
|
959
|
-
function
|
|
959
|
+
function ct(n) {
|
|
960
960
|
ot.setTimeout(function() {
|
|
961
961
|
throw n;
|
|
962
962
|
});
|
|
963
963
|
}
|
|
964
964
|
function fe() {
|
|
965
965
|
}
|
|
966
|
-
function
|
|
966
|
+
function at(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, _e(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 B(n, t) {
|
|
1002
1002
|
return ut.call(n, t);
|
|
1003
1003
|
}
|
|
1004
1004
|
var lt = function() {
|
|
@@ -1044,12 +1044,12 @@ var lt = function() {
|
|
|
1044
1044
|
};
|
|
1045
1045
|
else {
|
|
1046
1046
|
var c;
|
|
1047
|
-
s &&
|
|
1047
|
+
s && Ie.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 && B(e.next, c),
|
|
1051
|
+
error: e.error && B(e.error, c),
|
|
1052
|
+
complete: e.complete && B(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
|
+
ct(n);
|
|
1061
1061
|
}
|
|
1062
1062
|
function ht(n) {
|
|
1063
1063
|
throw n;
|
|
@@ -1070,11 +1070,11 @@ var dt = {
|
|
|
1070
1070
|
}, pt = function() {
|
|
1071
1071
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
1072
1072
|
}();
|
|
1073
|
-
function
|
|
1073
|
+
function Te(n) {
|
|
1074
1074
|
return n;
|
|
1075
1075
|
}
|
|
1076
1076
|
function ft(n) {
|
|
1077
|
-
return n.length === 0 ?
|
|
1077
|
+
return n.length === 0 ? Te : n.length === 1 ? n[0] : function(t) {
|
|
1078
1078
|
return n.reduce(function(e, r) {
|
|
1079
1079
|
return r(e);
|
|
1080
1080
|
}, t);
|
|
@@ -1088,8 +1088,8 @@ var gt = function() {
|
|
|
1088
1088
|
var e = new n();
|
|
1089
1089
|
return e.source = this, e.operator = t, e;
|
|
1090
1090
|
}, n.prototype.subscribe = function(t, e, r) {
|
|
1091
|
-
var i = this, s =
|
|
1092
|
-
return
|
|
1091
|
+
var i = this, s = bt(t) ? t : new W(t, e, r);
|
|
1092
|
+
return at(function() {
|
|
1093
1093
|
var o = i, c = o.operator, a = o.source;
|
|
1094
1094
|
s.add(c ? c.call(s, a) : a ? i._subscribe(s) : i._trySubscribe(s));
|
|
1095
1095
|
}), s;
|
|
@@ -1142,18 +1142,18 @@ var gt = function() {
|
|
|
1142
1142
|
}();
|
|
1143
1143
|
function ge(n) {
|
|
1144
1144
|
var t;
|
|
1145
|
-
return (t = n ??
|
|
1145
|
+
return (t = n ?? Ie.Promise) !== null && t !== void 0 ? t : Promise;
|
|
1146
1146
|
}
|
|
1147
1147
|
function vt(n) {
|
|
1148
1148
|
return n && S(n.next) && S(n.error) && S(n.complete);
|
|
1149
1149
|
}
|
|
1150
|
-
function
|
|
1151
|
-
return n && n instanceof re || vt(n) &&
|
|
1150
|
+
function bt(n) {
|
|
1151
|
+
return n && n instanceof re || vt(n) && _e(n);
|
|
1152
1152
|
}
|
|
1153
1153
|
function P(n, t, e, r, i) {
|
|
1154
|
-
return new
|
|
1154
|
+
return new yt(n, t, e, r, i);
|
|
1155
1155
|
}
|
|
1156
|
-
var
|
|
1156
|
+
var yt = function(n) {
|
|
1157
1157
|
ee(t, n);
|
|
1158
1158
|
function t(e, r, i, s, o, c) {
|
|
1159
1159
|
var a = n.call(this, e) || this;
|
|
@@ -1246,7 +1246,7 @@ function d(n, t, e) {
|
|
|
1246
1246
|
var a, u;
|
|
1247
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
|
}
|
|
1251
1251
|
const St = /^(\d+)\.(\d+)$/;
|
|
1252
1252
|
function Et(n) {
|
|
@@ -1271,7 +1271,7 @@ function Ct(n, t) {
|
|
|
1271
1271
|
function Mt(n, t) {
|
|
1272
1272
|
return ne(n, t) >= 0;
|
|
1273
1273
|
}
|
|
1274
|
-
const
|
|
1274
|
+
const be = "2.0";
|
|
1275
1275
|
class xt {
|
|
1276
1276
|
/**
|
|
1277
1277
|
* Create a new instance of the {@link IpcHelper | IPC Protocol Helper}.
|
|
@@ -1283,8 +1283,8 @@ class xt {
|
|
|
1283
1283
|
* @param logService - An instance of a logging service or utility
|
|
1284
1284
|
*/
|
|
1285
1285
|
constructor(t, e) {
|
|
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,
|
|
1287
|
-
throw new le(t,
|
|
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, be)), !this.supportedVersions.length)
|
|
1287
|
+
throw new le(t, be);
|
|
1288
1288
|
this.negotiatedProtocolVersion = this.supportedVersions[0], this.embeddedResult = null, this.iframePort2 = null;
|
|
1289
1289
|
}
|
|
1290
1290
|
get parent() {
|
|
@@ -1634,13 +1634,13 @@ class xt {
|
|
|
1634
1634
|
if (!this.isEmbedded())
|
|
1635
1635
|
throw new l(this.currentContext);
|
|
1636
1636
|
if (e === "group" && i === void 0)
|
|
1637
|
-
throw new
|
|
1637
|
+
throw new _(
|
|
1638
1638
|
"currentContacts",
|
|
1639
1639
|
i,
|
|
1640
1640
|
"currentContacts is required for group streams"
|
|
1641
1641
|
);
|
|
1642
1642
|
if (e === "direct" && i !== void 0)
|
|
1643
|
-
throw new
|
|
1643
|
+
throw new _(
|
|
1644
1644
|
"currentContacts",
|
|
1645
1645
|
i,
|
|
1646
1646
|
"currentContacts should not be passed for direct streams"
|
|
@@ -1673,7 +1673,7 @@ class xt {
|
|
|
1673
1673
|
if (!this.isEmbedded())
|
|
1674
1674
|
throw new l(this.currentContext);
|
|
1675
1675
|
if (!t.length)
|
|
1676
|
-
throw new
|
|
1676
|
+
throw new _("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(
|
|
@@ -1884,9 +1884,9 @@ class xt {
|
|
|
1884
1884
|
* logs from the `Client` app.
|
|
1885
1885
|
*
|
|
1886
1886
|
* @remarks
|
|
1887
|
-
* The `Host` app can either request that logs be sent as a
|
|
1888
|
-
*
|
|
1889
|
-
*
|
|
1887
|
+
* The `Host` app can either request that logs be sent as a transfer via the IPC Protocol or
|
|
1888
|
+
* trigger a file download by the `Client` by passing a {@link RequestLogsResponseType} in the
|
|
1889
|
+
* `responseType` property.
|
|
1890
1890
|
*
|
|
1891
1891
|
* @returns An observable that emits whenever a {@link RequestLogsMessage} is received so it can
|
|
1892
1892
|
* be subscribed to indefinitely.
|
|
@@ -1920,85 +1920,6 @@ class xt {
|
|
|
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
|
}
|
|
1923
|
-
/**
|
|
1924
|
-
* Send a {@link FileTransferMessage} to the `Host` app, to transfer a file.
|
|
1925
|
-
*
|
|
1926
|
-
* @remarks
|
|
1927
|
-
* The file data can be either `base64` encoded string or a raw byte array `buffer` encoded as an
|
|
1928
|
-
* ArrayBuffer. An SHA256 hash of the file is also sent to the `Host` app to verify the file
|
|
1929
|
-
* integrity.
|
|
1930
|
-
*
|
|
1931
|
-
* @param payload - The {@link FileTransferPayload} to send to the host app.
|
|
1932
|
-
* @param intent - _Optional_. The intent of the file transfer. Can be either `attachment` or
|
|
1933
|
-
* `general`. Defaults to `attachment`.
|
|
1934
|
-
* @param streamId - _Optional_. The ID of the message stream to which the files will be attached
|
|
1935
|
-
* to. Only used if `intent` is set to `attachment`.
|
|
1936
|
-
* @param shouldOpen - _Optional_. Whether the file should be opened after it's transferred.
|
|
1937
|
-
*
|
|
1938
|
-
* @returns This method returns void.
|
|
1939
|
-
*/
|
|
1940
|
-
sendFileTransferMessage(t, e = "attachment", r, i) {
|
|
1941
|
-
if (!this.isEmbedded())
|
|
1942
|
-
throw new l(this.currentContext);
|
|
1943
|
-
const s = "FILE TRANSFER", o = this.createMessage(s, !1);
|
|
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") {
|
|
1945
|
-
if (!r)
|
|
1946
|
-
throw new x(
|
|
1947
|
-
"streamId",
|
|
1948
|
-
r,
|
|
1949
|
-
"streamId is required for attachment intent"
|
|
1950
|
-
);
|
|
1951
|
-
o.streamId = r;
|
|
1952
|
-
}
|
|
1953
|
-
i && (o.shouldOpen = i), this.logCreated(s, o);
|
|
1954
|
-
const c = this.incomingMessages$.pipe(
|
|
1955
|
-
f((a) => a.type === s && a.replyTo === o.id),
|
|
1956
|
-
d(this.logReceived(s)),
|
|
1957
|
-
h((a) => a),
|
|
1958
|
-
y(1)
|
|
1959
|
-
);
|
|
1960
|
-
return this.port2.postMessage(o), this.logSent(s, o), c;
|
|
1961
|
-
}
|
|
1962
|
-
/**
|
|
1963
|
-
* Send a {@link FileTransferMessageReply} to the `Host` app, to reply to a
|
|
1964
|
-
* {@link FileTransferMessage} sent by the `Host` app.
|
|
1965
|
-
*
|
|
1966
|
-
* @param replyTo - ID of the {@link FileTransferMessage} being replied to
|
|
1967
|
-
* @param result - The result of the file transfer. Should be of {@link FileTransferMessageResult}
|
|
1968
|
-
* @param errorMessage - _Optional_. The error message to send if the result is `error`.
|
|
1969
|
-
*
|
|
1970
|
-
* @returns This method returns void.
|
|
1971
|
-
*/
|
|
1972
|
-
sendFileTransferMessageReply(t, e, r) {
|
|
1973
|
-
if (!this.isEmbedded())
|
|
1974
|
-
throw new l(this.currentContext);
|
|
1975
|
-
const i = "FILE TRANSFER", s = this.createMessage(i, !1, t);
|
|
1976
|
-
s.result = e, r && e === "error" && (s.errorMessage = r), this.logCreated(i, s), this.port2.postMessage(s), this.logSent(i, s);
|
|
1977
|
-
}
|
|
1978
|
-
/**
|
|
1979
|
-
* Setup listener for {@link FileTransferMessage}, which can be sent by a `Host` app to transfer
|
|
1980
|
-
* a file to the `Client` app.
|
|
1981
|
-
*
|
|
1982
|
-
* @remarks
|
|
1983
|
-
* The `Host` app can send the file as a `base64` encoded string or a raw byte array `buffer` in
|
|
1984
|
-
* an ArrayBuffer. An SHA256 hash of the file is also sent to the `Client` app to verify the file
|
|
1985
|
-
* integrity.
|
|
1986
|
-
*
|
|
1987
|
-
* @returns An observable that emits whenever {@link FileTransferMessage} is received so it can
|
|
1988
|
-
* be subscribed to indefinitely.
|
|
1989
|
-
*/
|
|
1990
|
-
onFileTransferMessage() {
|
|
1991
|
-
if (!this.isEmbedded())
|
|
1992
|
-
throw new l(this.currentContext);
|
|
1993
|
-
const t = "FILE TRANSFER";
|
|
1994
|
-
return this.incomingMessages$.pipe(
|
|
1995
|
-
f(
|
|
1996
|
-
(e) => e.type === t && e.target === "client" && e.replyTo === null
|
|
1997
|
-
),
|
|
1998
|
-
h((e) => (e.fileHash = e.fileHash.toLowerCase(), e)),
|
|
1999
|
-
d(this.logReceived(t))
|
|
2000
|
-
);
|
|
2001
|
-
}
|
|
2002
1923
|
/**
|
|
2003
1924
|
* Sends a {@link FileRequestMessage} to the Host app, to request a file by it's SHA256 hash.
|
|
2004
1925
|
*
|
|
@@ -2045,7 +1966,7 @@ class xt {
|
|
|
2045
1966
|
const s = "FILE REQUEST", o = this.createMessage(s);
|
|
2046
1967
|
if (o.fileHash = t.toLowerCase(), o.intent = e, o.maxChunkSizeInBytes = i, e === "attachment") {
|
|
2047
1968
|
if (!r)
|
|
2048
|
-
throw new
|
|
1969
|
+
throw new _(
|
|
2049
1970
|
"streamId",
|
|
2050
1971
|
r,
|
|
2051
1972
|
"streamId is required for attachment intent"
|
|
@@ -2065,6 +1986,55 @@ class xt {
|
|
|
2065
1986
|
);
|
|
2066
1987
|
return this.port2.postMessage(o), this.logSent(s, o), a;
|
|
2067
1988
|
}
|
|
1989
|
+
/**
|
|
1990
|
+
* Sends a {@link FileRequestMessageReply} to the Host app, to reply to a
|
|
1991
|
+
* {@link FileRequestMessage} that was received.
|
|
1992
|
+
*
|
|
1993
|
+
* @remarks
|
|
1994
|
+
* The `result` parameter can be either `success`, `error` or `not found` along with the
|
|
1995
|
+
* associated {@link FileRequestResult} properties.
|
|
1996
|
+
*
|
|
1997
|
+
* In case of `success`, multiple `FileRequestMessageReply` messages can be sent to the Host app
|
|
1998
|
+
* to send the file chunks. The `chunkHash` field should be set to the SHA256 hash of the chunk
|
|
1999
|
+
* being sent.
|
|
2000
|
+
*
|
|
2001
|
+
* @param receivedMsg - The original {@link FileRequestMessage} that was received
|
|
2002
|
+
* @param result - The result of the file request. Can be either `success`, `error` or `not found`
|
|
2003
|
+
* along with the associated {@link FileRequestResult} properties.
|
|
2004
|
+
*/
|
|
2005
|
+
sendFileRequestMessageReply(t, e) {
|
|
2006
|
+
if (!this.isEmbedded())
|
|
2007
|
+
throw new l(this.currentContext);
|
|
2008
|
+
const r = "FILE REQUEST", i = Object.assign(
|
|
2009
|
+
e,
|
|
2010
|
+
this.createMessage(r, !1, t.id)
|
|
2011
|
+
);
|
|
2012
|
+
this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
|
|
2013
|
+
}
|
|
2014
|
+
/**
|
|
2015
|
+
* Setup a listener for {@link FileRequestMessage}, which can be sent by a Host app to request a
|
|
2016
|
+
* file by it's SHA256 hash.
|
|
2017
|
+
*
|
|
2018
|
+
* @remarks
|
|
2019
|
+
* The initiating party can optionally suggest the other party to limit the size of the chunks
|
|
2020
|
+
* sent in the response by setting the `maxChunkSizeInBytes` field. However, this is only a
|
|
2021
|
+
* suggestion and the other party can still choose to send chunks of a different size.
|
|
2022
|
+
*
|
|
2023
|
+
* @returns An observable that emits whenever {@link FileRequestMessage} is received so it can
|
|
2024
|
+
* be subscribed to indefinitely.
|
|
2025
|
+
*/
|
|
2026
|
+
onFileRequestMessage() {
|
|
2027
|
+
if (!this.isEmbedded())
|
|
2028
|
+
throw new l(this.currentContext);
|
|
2029
|
+
const t = "FILE REQUEST";
|
|
2030
|
+
return this.incomingMessages$.pipe(
|
|
2031
|
+
f(
|
|
2032
|
+
(e) => e.type === t && e.target === "client" && e.replyTo === null
|
|
2033
|
+
),
|
|
2034
|
+
h((e) => (e.fileHash = e.fileHash.toLowerCase(), e)),
|
|
2035
|
+
d(this.logReceived(t))
|
|
2036
|
+
);
|
|
2037
|
+
}
|
|
2068
2038
|
/**
|
|
2069
2039
|
* Sends a {@link FileSelectionMessage} to the Host app, to request the user to select on or
|
|
2070
2040
|
* more files.
|
|
@@ -2073,15 +2043,14 @@ class xt {
|
|
|
2073
2043
|
* The `Host` app should reply with a {@link FileSelectionMessageReply} containing the number of
|
|
2074
2044
|
* files the user selected along with the file identifiers.
|
|
2075
2045
|
*
|
|
2076
|
-
* The file identifiers can be used to corelate files being transferred via the
|
|
2077
|
-
* {@link FileTransferMessage} afterwards.
|
|
2078
|
-
*
|
|
2079
2046
|
* @param intent - _Optional_. The intent of the file selection. Can be either `attachment` or
|
|
2080
2047
|
* `general`. Defaults to `attachment`.
|
|
2081
2048
|
* @param streamId - _Optional_. The ID of the message stream to which the files will be attached
|
|
2082
2049
|
* to. Only used if `intent` is set to `attachment`.
|
|
2083
2050
|
* @param maxCount - _Optional_. The maximum number of files the user can select. Defaults to
|
|
2084
2051
|
* unlimited.
|
|
2052
|
+
* @param maxFileSize - _Optional_. The maximum size of the files to select in bytes. Defaults to
|
|
2053
|
+
* unlimited.
|
|
2085
2054
|
* @param mimeTypes - _Optional_. The MIME type of the files to select. Defaults to `*\/*`.
|
|
2086
2055
|
*
|
|
2087
2056
|
* @returns This method returns void.
|
|
@@ -2092,7 +2061,7 @@ class xt {
|
|
|
2092
2061
|
const o = "FILE SELECTION", c = this.createMessage(o);
|
|
2093
2062
|
if (c.intent = t, c.maxCount = r, c.maxFileSizeInBytes = i, c.mimeTypes = s, t === "attachment") {
|
|
2094
2063
|
if (!e)
|
|
2095
|
-
throw new
|
|
2064
|
+
throw new _(
|
|
2096
2065
|
"streamId",
|
|
2097
2066
|
e,
|
|
2098
2067
|
"streamId is required for attachment intent"
|
|
@@ -2120,9 +2089,6 @@ class xt {
|
|
|
2120
2089
|
* The file at the specified `url` is encrypted using the provided `key` and the Host app needs
|
|
2121
2090
|
* to decrypt it.
|
|
2122
2091
|
*
|
|
2123
|
-
* The reply does not include the file itself. The file will be transferred via the
|
|
2124
|
-
* {@link FileTransferMessage} afterwards if required.
|
|
2125
|
-
*
|
|
2126
2092
|
* @param url - The URL to download the file from
|
|
2127
2093
|
* @param key - The decryption key for the file stream
|
|
2128
2094
|
* @param fileName - The name of the file to download
|
|
@@ -2151,17 +2117,19 @@ class xt {
|
|
|
2151
2117
|
* have in it's storage.
|
|
2152
2118
|
*
|
|
2153
2119
|
* @remarks
|
|
2154
|
-
* The `
|
|
2155
|
-
* for the target file in the `Host` app as well as to verify the integrity of the
|
|
2120
|
+
* The `fileHash` parameter is the SHA256 hash of the decrypted file, which is used as an
|
|
2121
|
+
* identifier for the target file in the `Host` app as well as to verify the integrity of the
|
|
2122
|
+
* file.
|
|
2156
2123
|
*
|
|
2157
|
-
* @param
|
|
2124
|
+
* @param fileHash - The SHA256 hash of the file to open.
|
|
2125
|
+
* @param fileName - _Optional_. The name of the file to open.
|
|
2158
2126
|
* @param streamId - _Optional_. The ID of the message stream from which the file is opened from.
|
|
2159
2127
|
*/
|
|
2160
|
-
sendFileOpenMessage(t, e) {
|
|
2128
|
+
sendFileOpenMessage(t, e, r) {
|
|
2161
2129
|
if (!this.isEmbedded())
|
|
2162
2130
|
throw new l(this.currentContext);
|
|
2163
|
-
const
|
|
2164
|
-
|
|
2131
|
+
const i = "FILE OPEN", s = this.createMessage(i, !1);
|
|
2132
|
+
s.fileHash = t.toLowerCase(), s.fileName = e, s.streamId = r, this.logCreated(i, s), this.port2.postMessage(s), this.logSent(i, s);
|
|
2165
2133
|
}
|
|
2166
2134
|
/**
|
|
2167
2135
|
* Sends a {@link FileRemoveMessage} to the Host app, to request removal of a file from the
|
|
@@ -2282,15 +2250,15 @@ class xt {
|
|
|
2282
2250
|
return ne(this.negotiatedProtocolVersion, t);
|
|
2283
2251
|
}
|
|
2284
2252
|
logReceived(t, e) {
|
|
2285
|
-
|
|
2253
|
+
e && _t(e) && (e = { ...e, data: "..." });
|
|
2286
2254
|
const r = (i) => this.logService.debug(`[IPC] Received ${t} message`, i);
|
|
2287
2255
|
return e && r(e), r;
|
|
2288
2256
|
}
|
|
2289
2257
|
logSent(t, e) {
|
|
2290
|
-
|
|
2258
|
+
e.type === "FILE REQUEST" && e.result === "success" && (e = { ...e, data: "..." }), this.logService.debug(`[IPC] Sent ${t} message`, e);
|
|
2291
2259
|
}
|
|
2292
2260
|
logCreated(t, e) {
|
|
2293
|
-
|
|
2261
|
+
e.type === "FILE REQUEST" && e.result === "success" && (e = { ...e, data: "..." }), this.logService.debug(`[IPC] Created ${t} message`, e);
|
|
2294
2262
|
}
|
|
2295
2263
|
async createIframeChannel() {
|
|
2296
2264
|
return new Promise((t) => {
|
|
@@ -2325,8 +2293,11 @@ class xt {
|
|
|
2325
2293
|
return i.join("");
|
|
2326
2294
|
}
|
|
2327
2295
|
}
|
|
2328
|
-
|
|
2329
|
-
|
|
2296
|
+
function _t(n) {
|
|
2297
|
+
return n.type === "FILE REQUEST" && n.replyTo !== null;
|
|
2298
|
+
}
|
|
2299
|
+
const It = ["2.0"];
|
|
2300
|
+
class Rt {
|
|
2330
2301
|
/**
|
|
2331
2302
|
* A class that manages the IPC communication between the `Client` and the `Host`.
|
|
2332
2303
|
*
|
|
@@ -2341,15 +2312,15 @@ class It {
|
|
|
2341
2312
|
/**
|
|
2342
2313
|
* The type of the `Host` app the `Client` is embedded in.
|
|
2343
2314
|
*/
|
|
2344
|
-
|
|
2315
|
+
x(this, "host");
|
|
2345
2316
|
/**
|
|
2346
2317
|
* The cloud ID of the `Host` app the `Client` is embedded in.
|
|
2347
2318
|
*/
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
this.logger = t ?? console, this.helper = new xt(
|
|
2319
|
+
x(this, "cloudId");
|
|
2320
|
+
x(this, "logger");
|
|
2321
|
+
x(this, "helper");
|
|
2322
|
+
x(this, "listeners");
|
|
2323
|
+
this.logger = t ?? console, this.helper = new xt(It, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(b.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(b.Lifecycle, /* @__PURE__ */ new Set()), this.listeners.set(b.PushToken, /* @__PURE__ */ new Set());
|
|
2353
2324
|
}
|
|
2354
2325
|
/**
|
|
2355
2326
|
* Returns whether the app is running inside a native WebView (`host` context) or as a
|
|
@@ -2376,7 +2347,7 @@ class It {
|
|
|
2376
2347
|
* @returns A promise with {@link IPCContext} the app is running under.
|
|
2377
2348
|
*/
|
|
2378
2349
|
async determineContext() {
|
|
2379
|
-
const t = await
|
|
2350
|
+
const t = await I(this.helper.determineContext(), {
|
|
2380
2351
|
defaultValue: "guest"
|
|
2381
2352
|
});
|
|
2382
2353
|
return this.evaluateContext(t);
|
|
@@ -2385,7 +2356,7 @@ class It {
|
|
|
2385
2356
|
* Initiates the IPC handshake with the `Host` app.
|
|
2386
2357
|
*/
|
|
2387
2358
|
initiateConnection() {
|
|
2388
|
-
return
|
|
2359
|
+
return I(
|
|
2389
2360
|
this.helper.openBridge().pipe(
|
|
2390
2361
|
Ze((t) => {
|
|
2391
2362
|
this.helper.onBadgeQueryMessage().subscribe((e) => {
|
|
@@ -2415,7 +2386,7 @@ class It {
|
|
|
2415
2386
|
let s;
|
|
2416
2387
|
if (e === "multi") {
|
|
2417
2388
|
if (!r || !Array.isArray(r))
|
|
2418
|
-
throw new
|
|
2389
|
+
throw new _(
|
|
2419
2390
|
"currentContacts",
|
|
2420
2391
|
r,
|
|
2421
2392
|
"currentContacts is required for group streams"
|
|
@@ -2428,7 +2399,7 @@ class It {
|
|
|
2428
2399
|
);
|
|
2429
2400
|
} else
|
|
2430
2401
|
r ? i = r : i = "cloudUsername", s = this.helper.selectContacts(t.toString(), "direct", i);
|
|
2431
|
-
return
|
|
2402
|
+
return I(s.pipe(O((o) => o.contacts)));
|
|
2432
2403
|
}
|
|
2433
2404
|
/**
|
|
2434
2405
|
* Matches batch of {@link ContactItem} objects against the Host's contact list to fetch detailed
|
|
@@ -2440,7 +2411,7 @@ class It {
|
|
|
2440
2411
|
* Host's contact list.
|
|
2441
2412
|
*/
|
|
2442
2413
|
matchContacts(t) {
|
|
2443
|
-
return this.logger.debug("Match Contacts: ", t),
|
|
2414
|
+
return this.logger.debug("Match Contacts: ", t), I(this.helper.matchContacts(t).pipe(O((e) => e.contacts)));
|
|
2444
2415
|
}
|
|
2445
2416
|
/**
|
|
2446
2417
|
* Requests the `Host` app to provide the Push Token for the current device.
|
|
@@ -2448,7 +2419,7 @@ class It {
|
|
|
2448
2419
|
* @returns A promise with the Push Token as `string`.
|
|
2449
2420
|
*/
|
|
2450
2421
|
requestPushToken() {
|
|
2451
|
-
return this.logger.debug("Requesting Push Token"),
|
|
2422
|
+
return this.logger.debug("Requesting Push Token"), I(this.helper.requestPushToken().pipe(O((t) => t.pushToken)));
|
|
2452
2423
|
}
|
|
2453
2424
|
/**
|
|
2454
2425
|
* Sends the current badge count to the `Host` app.
|
|
@@ -2549,5 +2520,5 @@ class It {
|
|
|
2549
2520
|
}
|
|
2550
2521
|
export {
|
|
2551
2522
|
b as IPCEvents,
|
|
2552
|
-
|
|
2523
|
+
Rt as IPCManager
|
|
2553
2524
|
};
|