@acrobits/ipc-sdk 0.12.0-alpha.10 → 0.12.0-alpha.12
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 +51 -39
- package/docs/classes/InvalidParameterError.html +9 -0
- package/docs/classes/UnsupportedVersionError.html +7 -0
- package/docs/enums/IPCEvents.html +8 -6
- package/docs/interfaces/CallInfoItem.html +8 -8
- package/docs/interfaces/DetailedContactURI.html +3 -3
- package/docs/interfaces/ILogger.html +2 -2
- package/docs/interfaces/RemoteUser.html +3 -3
- package/docs/modules.html +1 -1
- package/docs/types/BaseContactItem.html +5 -5
- package/docs/types/CallState.html +1 -1
- package/docs/types/CloudUsernameContactItem.html +1 -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/DetailedContactItem.html +8 -8
- package/docs/types/HostType.html +1 -1
- package/docs/types/IPCContext.html +1 -1
- package/docs/types/IpcProtocolVersion.html +1 -1
- package/docs/types/SelectContactsOptions.html +10 -0
- package/docs/types/UnsubscribeCallback.html +1 -1
- package/docs/types/UriContactItem.html +1 -1
- package/lib/index.d.ts +76 -2
- package/lib/ipc-sdk.js +123 -115
- package/lib/ipc-sdk.js.map +1 -1
- package/lib/ipc-sdk.umd.cjs +3 -3
- package/lib/ipc-sdk.umd.cjs.map +1 -1
- package/package.json +2 -2
package/lib/ipc-sdk.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var I = (n, t, e) => (
|
|
4
|
-
var
|
|
1
|
+
var Pe = Object.defineProperty;
|
|
2
|
+
var Ae = (n, t, e) => t in n ? Pe(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var I = (n, t, e) => (Ae(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
var G = function(n, t) {
|
|
5
5
|
return G = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
6
6
|
e.__proto__ = r;
|
|
7
7
|
} || function(e, r) {
|
|
@@ -9,7 +9,7 @@ var w = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LI
|
|
|
9
9
|
Object.prototype.hasOwnProperty.call(r, s) && (e[s] = r[s]);
|
|
10
10
|
}, G(n, t);
|
|
11
11
|
};
|
|
12
|
-
function
|
|
12
|
+
function T(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
|
G(n, t);
|
|
@@ -30,7 +30,7 @@ function Q(n) {
|
|
|
30
30
|
};
|
|
31
31
|
throw new TypeError(t ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function k(n, t) {
|
|
34
34
|
var e = typeof Symbol == "function" && n[Symbol.iterator];
|
|
35
35
|
if (!e)
|
|
36
36
|
return n;
|
|
@@ -50,7 +50,7 @@ function $(n, t) {
|
|
|
50
50
|
}
|
|
51
51
|
return i;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function $(n, t, e) {
|
|
54
54
|
if (e || arguments.length === 2)
|
|
55
55
|
for (var r = 0, s = t.length, i; r < s; r++)
|
|
56
56
|
(i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
|
|
@@ -96,8 +96,8 @@ var x = function() {
|
|
|
96
96
|
var l = c.value;
|
|
97
97
|
l.remove(this);
|
|
98
98
|
}
|
|
99
|
-
} catch (
|
|
100
|
-
t = { error:
|
|
99
|
+
} catch (b) {
|
|
100
|
+
t = { error: b };
|
|
101
101
|
} finally {
|
|
102
102
|
try {
|
|
103
103
|
c && !c.done && (e = a.return) && e.call(a);
|
|
@@ -112,26 +112,26 @@ var x = function() {
|
|
|
112
112
|
if (S(d))
|
|
113
113
|
try {
|
|
114
114
|
d();
|
|
115
|
-
} catch (
|
|
116
|
-
i =
|
|
115
|
+
} catch (b) {
|
|
116
|
+
i = b instanceof H ? b.errors : [b];
|
|
117
117
|
}
|
|
118
118
|
var u = this._finalizers;
|
|
119
119
|
if (u) {
|
|
120
120
|
this._finalizers = null;
|
|
121
121
|
try {
|
|
122
|
-
for (var
|
|
122
|
+
for (var w = Q(u), p = w.next(); !p.done; p = w.next()) {
|
|
123
123
|
var F = p.value;
|
|
124
124
|
try {
|
|
125
125
|
ne(F);
|
|
126
|
-
} catch (
|
|
127
|
-
i = i ?? [],
|
|
126
|
+
} catch (b) {
|
|
127
|
+
i = i ?? [], b instanceof H ? i = $($([], k(i)), k(b.errors)) : i.push(b);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
} catch (
|
|
131
|
-
r = { error:
|
|
130
|
+
} catch (b) {
|
|
131
|
+
r = { error: b };
|
|
132
132
|
} finally {
|
|
133
133
|
try {
|
|
134
|
-
p && !p.done && (s =
|
|
134
|
+
p && !p.done && (s = w.return) && s.call(w);
|
|
135
135
|
} finally {
|
|
136
136
|
if (r)
|
|
137
137
|
throw r.error;
|
|
@@ -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, $([n, t], k(e)));
|
|
191
191
|
},
|
|
192
192
|
clearTimeout: function(n) {
|
|
193
193
|
var t = Ce.delegate;
|
|
@@ -206,10 +206,10 @@ function O(n) {
|
|
|
206
206
|
n();
|
|
207
207
|
}
|
|
208
208
|
var ee = function(n) {
|
|
209
|
-
|
|
209
|
+
T(t, n);
|
|
210
210
|
function t(e) {
|
|
211
211
|
var r = n.call(this) || this;
|
|
212
|
-
return r.isStopped = !1, e ? (r.destination = e, be(e) && e.add(r)) : r.destination =
|
|
212
|
+
return r.isStopped = !1, e ? (r.destination = e, be(e) && e.add(r)) : r.destination = $e, r;
|
|
213
213
|
}
|
|
214
214
|
return t.create = function(e, r, s) {
|
|
215
215
|
return new D(e, r, s);
|
|
@@ -272,7 +272,7 @@ var Oe = function() {
|
|
|
272
272
|
}
|
|
273
273
|
}, n;
|
|
274
274
|
}(), D = function(n) {
|
|
275
|
-
|
|
275
|
+
T(t, n);
|
|
276
276
|
function t(e, r, s) {
|
|
277
277
|
var i = n.call(this) || this, o;
|
|
278
278
|
if (S(e) || !e)
|
|
@@ -298,13 +298,13 @@ var Oe = function() {
|
|
|
298
298
|
function _(n) {
|
|
299
299
|
_e(n);
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function ke(n) {
|
|
302
302
|
throw n;
|
|
303
303
|
}
|
|
304
|
-
var
|
|
304
|
+
var $e = {
|
|
305
305
|
closed: !0,
|
|
306
306
|
next: ie,
|
|
307
|
-
error:
|
|
307
|
+
error: ke,
|
|
308
308
|
complete: ie
|
|
309
309
|
}, Ne = function() {
|
|
310
310
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
@@ -409,7 +409,7 @@ function Ie(n, t, e, r, s) {
|
|
|
409
409
|
return new qe(n, t, e, r, s);
|
|
410
410
|
}
|
|
411
411
|
var qe = function(n) {
|
|
412
|
-
|
|
412
|
+
T(t, n);
|
|
413
413
|
function t(e, r, s, i, o, a) {
|
|
414
414
|
var c = n.call(this, e) || this;
|
|
415
415
|
return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(l) {
|
|
@@ -448,7 +448,7 @@ var qe = function(n) {
|
|
|
448
448
|
n(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
449
449
|
};
|
|
450
450
|
}), Me = function(n) {
|
|
451
|
-
|
|
451
|
+
T(t, n);
|
|
452
452
|
function t() {
|
|
453
453
|
var e = n.call(this) || this;
|
|
454
454
|
return e.closed = !1, e.currentObservers = null, e.observers = [], e.isStopped = !1, e.hasError = !1, e.thrownError = null, e;
|
|
@@ -528,7 +528,7 @@ var qe = function(n) {
|
|
|
528
528
|
return new ce(e, r);
|
|
529
529
|
}, t;
|
|
530
530
|
}(Y), ce = function(n) {
|
|
531
|
-
|
|
531
|
+
T(t, n);
|
|
532
532
|
function t(e, r) {
|
|
533
533
|
var s = n.call(this) || this;
|
|
534
534
|
return s.destination = e, s.source = r, s;
|
|
@@ -552,7 +552,7 @@ var qe = function(n) {
|
|
|
552
552
|
},
|
|
553
553
|
delegate: void 0
|
|
554
554
|
}, Ge = function(n) {
|
|
555
|
-
|
|
555
|
+
T(t, n);
|
|
556
556
|
function t(e, r) {
|
|
557
557
|
return n.call(this) || this;
|
|
558
558
|
}
|
|
@@ -563,7 +563,7 @@ var qe = 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, $([n, t], k(e)));
|
|
567
567
|
},
|
|
568
568
|
clearInterval: function(n) {
|
|
569
569
|
var t = z.delegate;
|
|
@@ -571,7 +571,7 @@ var qe = function(n) {
|
|
|
571
571
|
},
|
|
572
572
|
delegate: void 0
|
|
573
573
|
}, Qe = function(n) {
|
|
574
|
-
|
|
574
|
+
T(t, n);
|
|
575
575
|
function t(e, r) {
|
|
576
576
|
var s = n.call(this, e, r) || this;
|
|
577
577
|
return s.scheduler = e, s.work = r, s.pending = !1, s;
|
|
@@ -620,7 +620,7 @@ var qe = function(n) {
|
|
|
620
620
|
return e === void 0 && (e = 0), new this.schedulerActionCtor(this, t).schedule(r, e);
|
|
621
621
|
}, n.now = Be.now, n;
|
|
622
622
|
}(), Ye = function(n) {
|
|
623
|
-
|
|
623
|
+
T(t, n);
|
|
624
624
|
function t(e, r) {
|
|
625
625
|
r === void 0 && (r = ae.now);
|
|
626
626
|
var s = n.call(this, e, r) || this;
|
|
@@ -653,7 +653,7 @@ var Ke = Z(function(n) {
|
|
|
653
653
|
n(this), this.name = "EmptyError", this.message = "no elements in sequence";
|
|
654
654
|
};
|
|
655
655
|
});
|
|
656
|
-
function
|
|
656
|
+
function U(n, t) {
|
|
657
657
|
var e = typeof t == "object";
|
|
658
658
|
return new Promise(function(r, s) {
|
|
659
659
|
var i = new D({
|
|
@@ -752,7 +752,7 @@ function E(n) {
|
|
|
752
752
|
function nt(n) {
|
|
753
753
|
return E(n == null ? void 0 : n.lift);
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function P(n) {
|
|
756
756
|
return function(t) {
|
|
757
757
|
if (nt(t))
|
|
758
758
|
return t.lift(function(e) {
|
|
@@ -857,8 +857,8 @@ var re = function() {
|
|
|
857
857
|
var l = c.value;
|
|
858
858
|
l.remove(this);
|
|
859
859
|
}
|
|
860
|
-
} catch (
|
|
861
|
-
t = { error:
|
|
860
|
+
} catch (b) {
|
|
861
|
+
t = { error: b };
|
|
862
862
|
} finally {
|
|
863
863
|
try {
|
|
864
864
|
c && !c.done && (e = a.return) && e.call(a);
|
|
@@ -873,26 +873,26 @@ var re = function() {
|
|
|
873
873
|
if (E(d))
|
|
874
874
|
try {
|
|
875
875
|
d();
|
|
876
|
-
} catch (
|
|
877
|
-
i =
|
|
876
|
+
} catch (b) {
|
|
877
|
+
i = b instanceof j ? b.errors : [b];
|
|
878
878
|
}
|
|
879
879
|
var u = this._finalizers;
|
|
880
880
|
if (u) {
|
|
881
881
|
this._finalizers = null;
|
|
882
882
|
try {
|
|
883
|
-
for (var
|
|
883
|
+
for (var w = he(u), p = w.next(); !p.done; p = w.next()) {
|
|
884
884
|
var F = p.value;
|
|
885
885
|
try {
|
|
886
886
|
pe(F);
|
|
887
|
-
} catch (
|
|
888
|
-
i = i ?? [],
|
|
887
|
+
} catch (b) {
|
|
888
|
+
i = i ?? [], b instanceof j ? i = K(K([], W(i)), W(b.errors)) : i.push(b);
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
|
-
} catch (
|
|
892
|
-
r = { error:
|
|
891
|
+
} catch (b) {
|
|
892
|
+
r = { error: b };
|
|
893
893
|
} finally {
|
|
894
894
|
try {
|
|
895
|
-
p && !p.done && (s =
|
|
895
|
+
p && !p.done && (s = w.return) && s.call(w);
|
|
896
896
|
} finally {
|
|
897
897
|
if (r)
|
|
898
898
|
throw r.error;
|
|
@@ -933,13 +933,13 @@ var re = function() {
|
|
|
933
933
|
}(), n;
|
|
934
934
|
}();
|
|
935
935
|
re.EMPTY;
|
|
936
|
-
function
|
|
936
|
+
function Te(n) {
|
|
937
937
|
return n instanceof re || 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 Ue = {
|
|
943
943
|
onUnhandledError: null,
|
|
944
944
|
onStoppedNotification: null,
|
|
945
945
|
Promise: void 0,
|
|
@@ -970,7 +970,7 @@ var se = function(n) {
|
|
|
970
970
|
te(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, s) {
|
|
976
976
|
return new X(e, r, s);
|
|
@@ -1044,7 +1044,7 @@ var ut = function() {
|
|
|
1044
1044
|
};
|
|
1045
1045
|
else {
|
|
1046
1046
|
var a;
|
|
1047
|
-
i &&
|
|
1047
|
+
i && Ue.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {
|
|
1048
1048
|
return i.unsubscribe();
|
|
1049
1049
|
}, o = {
|
|
1050
1050
|
next: e.next && B(e.next, a),
|
|
@@ -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 ?? Ue.Promise) !== null && t !== void 0 ? t : Promise;
|
|
1146
1146
|
}
|
|
1147
1147
|
function yt(n) {
|
|
1148
1148
|
return n && E(n.next) && E(n.error) && E(n.complete);
|
|
1149
1149
|
}
|
|
1150
1150
|
function mt(n) {
|
|
1151
|
-
return n && n instanceof se || yt(n) &&
|
|
1151
|
+
return n && n instanceof se || yt(n) && Te(n);
|
|
1152
1152
|
}
|
|
1153
|
-
function
|
|
1153
|
+
function A(n, t, e, r, s) {
|
|
1154
1154
|
return new vt(n, t, e, r, s);
|
|
1155
1155
|
}
|
|
1156
1156
|
var vt = function(n) {
|
|
@@ -1190,9 +1190,9 @@ var vt = function(n) {
|
|
|
1190
1190
|
}, t;
|
|
1191
1191
|
}(se);
|
|
1192
1192
|
function f(n, t) {
|
|
1193
|
-
return
|
|
1193
|
+
return P(function(e, r) {
|
|
1194
1194
|
var s = 0;
|
|
1195
|
-
e.subscribe(
|
|
1195
|
+
e.subscribe(A(r, function(i) {
|
|
1196
1196
|
r.next(n.call(t, i, s++));
|
|
1197
1197
|
}));
|
|
1198
1198
|
});
|
|
@@ -1203,25 +1203,25 @@ var bt = new gt(function(n) {
|
|
|
1203
1203
|
function C(n) {
|
|
1204
1204
|
return n <= 0 ? function() {
|
|
1205
1205
|
return bt;
|
|
1206
|
-
} :
|
|
1206
|
+
} : P(function(t, e) {
|
|
1207
1207
|
var r = 0;
|
|
1208
|
-
t.subscribe(
|
|
1208
|
+
t.subscribe(A(e, function(s) {
|
|
1209
1209
|
++r <= n && (e.next(s), n <= r && e.complete());
|
|
1210
1210
|
}));
|
|
1211
1211
|
});
|
|
1212
1212
|
}
|
|
1213
1213
|
function y(n, t) {
|
|
1214
|
-
return
|
|
1214
|
+
return P(function(e, r) {
|
|
1215
1215
|
var s = 0;
|
|
1216
|
-
e.subscribe(
|
|
1216
|
+
e.subscribe(A(r, function(i) {
|
|
1217
1217
|
return n.call(t, i, s++) && r.next(i);
|
|
1218
1218
|
}));
|
|
1219
1219
|
});
|
|
1220
1220
|
}
|
|
1221
1221
|
function wt(n, t) {
|
|
1222
|
-
return t === void 0 && (t = !1),
|
|
1222
|
+
return t === void 0 && (t = !1), P(function(e, r) {
|
|
1223
1223
|
var s = 0;
|
|
1224
|
-
e.subscribe(
|
|
1224
|
+
e.subscribe(A(r, function(i) {
|
|
1225
1225
|
var o = n(i, s++);
|
|
1226
1226
|
(o || t) && r.next(i), !o && r.complete();
|
|
1227
1227
|
}));
|
|
@@ -1229,11 +1229,11 @@ function wt(n, t) {
|
|
|
1229
1229
|
}
|
|
1230
1230
|
function g(n, t, e) {
|
|
1231
1231
|
var r = E(n) || t || e ? { next: n, error: t, complete: e } : n;
|
|
1232
|
-
return r ?
|
|
1232
|
+
return r ? P(function(s, i) {
|
|
1233
1233
|
var o;
|
|
1234
1234
|
(o = r.subscribe) === null || o === void 0 || o.call(r);
|
|
1235
1235
|
var a = !0;
|
|
1236
|
-
s.subscribe(
|
|
1236
|
+
s.subscribe(A(i, function(c) {
|
|
1237
1237
|
var l;
|
|
1238
1238
|
(l = r.next) === null || l === void 0 || l.call(r, c), i.next(c);
|
|
1239
1239
|
}, function() {
|
|
@@ -1759,7 +1759,7 @@ class It {
|
|
|
1759
1759
|
), !s.allowMultipleSelection && l.contacts.length > 1 && (l.contacts = [l.contacts[0]]), s.filterToSelectedType && l.contacts.length > 1) {
|
|
1760
1760
|
const u = l.contacts[0].type;
|
|
1761
1761
|
if (l.contacts.some(
|
|
1762
|
-
(
|
|
1762
|
+
(w) => w.type !== u
|
|
1763
1763
|
))
|
|
1764
1764
|
throw new Error(
|
|
1765
1765
|
`When filterToSelectedType is true, all contacts in the reply must be of the same type. Expected all contacts to be of type '${u}', but received mixed types.`
|
|
@@ -2408,7 +2408,7 @@ class It {
|
|
|
2408
2408
|
),
|
|
2409
2409
|
f((d) => {
|
|
2410
2410
|
var u;
|
|
2411
|
-
return d.result === "success" && (d.files = (u = d.files) == null ? void 0 : u.map((
|
|
2411
|
+
return d.result === "success" && (d.files = (u = d.files) == null ? void 0 : u.map((w) => (w.original.fileHash = w.original.fileHash.toLowerCase(), w.preview && (w.preview.fileHash = w.preview.fileHash.toLowerCase()), w))), d;
|
|
2412
2412
|
}),
|
|
2413
2413
|
g(this.logReceived()),
|
|
2414
2414
|
C(1)
|
|
@@ -2577,13 +2577,13 @@ class It {
|
|
|
2577
2577
|
}
|
|
2578
2578
|
const d = "FILE DOWNLOAD", u = this.createMessage(d, !0);
|
|
2579
2579
|
u.url = t, u.key = e, u.fileHash = r.toLowerCase(), u.mimeType = s, u.fileName = i, u.streamId = o, u.correlationId = a, u.sender = c, u.intent = l ?? "download", this.logCreated(d, u);
|
|
2580
|
-
const
|
|
2580
|
+
const w = this.incomingMessages$.pipe(
|
|
2581
2581
|
y((p) => p.type === d && p.replyTo === u.id),
|
|
2582
2582
|
g(this.logReceived()),
|
|
2583
2583
|
f((p) => p),
|
|
2584
2584
|
C(1)
|
|
2585
2585
|
);
|
|
2586
|
-
return this.port2.postMessage(u), this.logSent(d, u),
|
|
2586
|
+
return this.port2.postMessage(u), this.logSent(d, u), w;
|
|
2587
2587
|
}
|
|
2588
2588
|
/**
|
|
2589
2589
|
* Sends a {@link CancelFileDownloadMessage} to the Host app, to cancel downloading of a file
|
|
@@ -2720,13 +2720,13 @@ class It {
|
|
|
2720
2720
|
else
|
|
2721
2721
|
u.mentions = [];
|
|
2722
2722
|
u.attachments = (o == null ? void 0 : o.map((p) => p.toLowerCase())) ?? [], u.relatedMessageId = a, u.setCursors = c, u.threadId = l, this.logCreated(d, u);
|
|
2723
|
-
const
|
|
2723
|
+
const w = this.incomingMessages$.pipe(
|
|
2724
2724
|
y((p) => p.type === d && p.replyTo === u.id),
|
|
2725
2725
|
g(this.logReceived()),
|
|
2726
2726
|
f((p) => p),
|
|
2727
2727
|
C(1)
|
|
2728
2728
|
);
|
|
2729
|
-
return this.port2.postMessage(u), this.logSent(d, u),
|
|
2729
|
+
return this.port2.postMessage(u), this.logSent(d, u), w;
|
|
2730
2730
|
}
|
|
2731
2731
|
/**
|
|
2732
2732
|
* Sends a {@link CancelSendMessageMessage} to the Host app, to cancel a message that was being
|
|
@@ -2987,7 +2987,8 @@ class It {
|
|
|
2987
2987
|
function Mt(n) {
|
|
2988
2988
|
return n.type === "FILE REQUEST" && n.replyTo !== null;
|
|
2989
2989
|
}
|
|
2990
|
-
|
|
2990
|
+
var v = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n.PushTokenPayload = "PUSH TOKEN PAYLOAD", n.RequestLogs = "REQUEST LOGS", n.CallInfo = "CALL INFO", n))(v || {});
|
|
2991
|
+
const Tt = ["2.2", "2.1", "2.0"];
|
|
2991
2992
|
class Rt {
|
|
2992
2993
|
/**
|
|
2993
2994
|
* A class that manages the IPC communication between the `Client` and the `Host`.
|
|
@@ -3019,7 +3020,7 @@ class Rt {
|
|
|
3019
3020
|
I(this, "logger");
|
|
3020
3021
|
I(this, "helper");
|
|
3021
3022
|
I(this, "listeners");
|
|
3022
|
-
this.logger = t ?? console, this.helper = new It(
|
|
3023
|
+
this.logger = t ?? console, this.helper = new It(Tt, this.logger), this.listeners = /* @__PURE__ */ new Map(), this.listeners.set(v.BadgeQuery, /* @__PURE__ */ new Set()), this.listeners.set(v.Lifecycle, /* @__PURE__ */ new Set()), this.listeners.set(v.PushToken, /* @__PURE__ */ new Set()), this.listeners.set(v.PushTokenPayload, /* @__PURE__ */ new Set()), this.listeners.set(v.RequestLogs, /* @__PURE__ */ new Set()), this.listeners.set(v.CallInfo, /* @__PURE__ */ new Set());
|
|
3023
3024
|
}
|
|
3024
3025
|
/**
|
|
3025
3026
|
* Returns whether the app is running inside a native WebView (`host` context) or as a
|
|
@@ -3046,7 +3047,7 @@ class Rt {
|
|
|
3046
3047
|
* @returns A promise with {@link IPCContext} the app is running under.
|
|
3047
3048
|
*/
|
|
3048
3049
|
async determineContext() {
|
|
3049
|
-
const t = await
|
|
3050
|
+
const t = await U(this.helper.determineContext(), {
|
|
3050
3051
|
defaultValue: "guest"
|
|
3051
3052
|
});
|
|
3052
3053
|
return this.evaluateContext(t);
|
|
@@ -3055,34 +3056,42 @@ class Rt {
|
|
|
3055
3056
|
* Initiates the IPC handshake with the `Host` app.
|
|
3056
3057
|
*/
|
|
3057
3058
|
initiateConnection() {
|
|
3058
|
-
return
|
|
3059
|
+
return U(
|
|
3059
3060
|
this.helper.openBridge().pipe(
|
|
3060
3061
|
et((t) => {
|
|
3061
3062
|
this.helper.onBadgeQueryMessage().subscribe((e) => {
|
|
3062
3063
|
var r;
|
|
3063
3064
|
this.logger.debug("Received Badge Query: ", e);
|
|
3064
|
-
for (const s of ((r = this.listeners.get(
|
|
3065
|
+
for (const s of ((r = this.listeners.get(v.BadgeQuery)) == null ? void 0 : r.values()) ?? [])
|
|
3065
3066
|
s();
|
|
3066
3067
|
}), this.helper.onLifecycleMessage().subscribe((e) => {
|
|
3067
3068
|
var r;
|
|
3068
3069
|
this.logger.debug("Received Lifecycle Event: ", e);
|
|
3069
|
-
for (const s of ((r = this.listeners.get(
|
|
3070
|
+
for (const s of ((r = this.listeners.get(v.Lifecycle)) == null ? void 0 : r.values()) ?? [])
|
|
3070
3071
|
s(e.eventName, e.payload);
|
|
3071
3072
|
}), this.helper.onPushTokenMessage().subscribe((e) => {
|
|
3072
|
-
var r;
|
|
3073
|
+
var r, s;
|
|
3073
3074
|
this.logger.debug("Received Push Token: ", e);
|
|
3074
|
-
for (const
|
|
3075
|
-
|
|
3075
|
+
for (const i of ((r = this.listeners.get(v.PushToken)) == null ? void 0 : r.values()) ?? [])
|
|
3076
|
+
i(e.pushToken, e.appId, e.selector);
|
|
3077
|
+
for (const i of ((s = this.listeners.get(v.PushTokenPayload)) == null ? void 0 : s.values()) ?? [])
|
|
3078
|
+
i({
|
|
3079
|
+
pushToken: e.pushToken,
|
|
3080
|
+
appId: e.appId,
|
|
3081
|
+
selector: e.selector,
|
|
3082
|
+
isRegistered: e.isRegistered,
|
|
3083
|
+
installationId: e.installationId
|
|
3084
|
+
});
|
|
3076
3085
|
}), this.helper.onRequestLogsMessage().subscribe((e) => {
|
|
3077
3086
|
var r;
|
|
3078
3087
|
if (this.logger.debug("Received Request Logs Message: ", e), e.responseType === "file")
|
|
3079
3088
|
throw this.logger.error("File response type not supported"), new Error("File response type not supported");
|
|
3080
|
-
for (const s of ((r = this.listeners.get(
|
|
3089
|
+
for (const s of ((r = this.listeners.get(v.RequestLogs)) == null ? void 0 : r.values()) ?? [])
|
|
3081
3090
|
s(e.skipCompression);
|
|
3082
3091
|
}), this.helper.onCallInfoMessage().subscribe((e) => {
|
|
3083
3092
|
var r;
|
|
3084
3093
|
this.logger.debug("Received Call Info update: ", e);
|
|
3085
|
-
for (const s of ((r = this.listeners.get(
|
|
3094
|
+
for (const s of ((r = this.listeners.get(v.CallInfo)) == null ? void 0 : r.values()) ?? [])
|
|
3086
3095
|
s(e.calls);
|
|
3087
3096
|
}), this.cloudId = t.cloudId, this.cloudUsername = t.cloudUsername, this.displayName = t.displayName, this.host = t.host;
|
|
3088
3097
|
}),
|
|
@@ -3125,7 +3134,7 @@ class Rt {
|
|
|
3125
3134
|
};
|
|
3126
3135
|
i = this.selectContacts_V2_1(t, l);
|
|
3127
3136
|
}
|
|
3128
|
-
return
|
|
3137
|
+
return U(
|
|
3129
3138
|
i.pipe(
|
|
3130
3139
|
R((o) => o.result === "error" ? {
|
|
3131
3140
|
result: "error",
|
|
@@ -3195,15 +3204,20 @@ class Rt {
|
|
|
3195
3204
|
* Host's contact list.
|
|
3196
3205
|
*/
|
|
3197
3206
|
matchContacts(t) {
|
|
3198
|
-
return this.logger.debug("Match Contacts: ", t),
|
|
3199
|
-
}
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
+
return this.logger.debug("Match Contacts: ", t), U(this.helper.matchContacts(t).pipe(R((e) => e.contacts)));
|
|
3208
|
+
}
|
|
3209
|
+
requestPushToken(t) {
|
|
3210
|
+
return this.logger.debug("Requesting Push Token"), t != null && t.extended ? U(
|
|
3211
|
+
this.helper.requestPushToken().pipe(
|
|
3212
|
+
R((e) => ({
|
|
3213
|
+
pushToken: e.pushToken,
|
|
3214
|
+
appId: e.appId,
|
|
3215
|
+
selector: e.selector,
|
|
3216
|
+
isRegistered: e.isRegistered,
|
|
3217
|
+
installationId: e.installationId
|
|
3218
|
+
}))
|
|
3219
|
+
)
|
|
3220
|
+
) : U(this.helper.requestPushToken().pipe(R((e) => e.pushToken)));
|
|
3207
3221
|
}
|
|
3208
3222
|
/**
|
|
3209
3223
|
* Sends the current badge count to the `Host` app.
|
|
@@ -3272,9 +3286,9 @@ class Rt {
|
|
|
3272
3286
|
*/
|
|
3273
3287
|
onBadgeQueryRequest(t) {
|
|
3274
3288
|
var e;
|
|
3275
|
-
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(
|
|
3289
|
+
return this.logger.debug("Registering for Badge Query"), (e = this.listeners.get(v.BadgeQuery)) == null || e.add(t), () => {
|
|
3276
3290
|
var r;
|
|
3277
|
-
return (r = this.listeners.get(
|
|
3291
|
+
return (r = this.listeners.get(v.BadgeQuery)) == null ? void 0 : r.delete(t);
|
|
3278
3292
|
};
|
|
3279
3293
|
}
|
|
3280
3294
|
/**
|
|
@@ -3291,28 +3305,20 @@ class Rt {
|
|
|
3291
3305
|
*/
|
|
3292
3306
|
onLifecycleEvent(t) {
|
|
3293
3307
|
var e;
|
|
3294
|
-
return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(
|
|
3308
|
+
return this.logger.debug("Registering for Lifecycle Event"), (e = this.listeners.get(v.Lifecycle)) == null || e.add(t), () => {
|
|
3295
3309
|
var r;
|
|
3296
|
-
return (r = this.listeners.get(
|
|
3310
|
+
return (r = this.listeners.get(v.Lifecycle)) == null ? void 0 : r.delete(t);
|
|
3297
3311
|
};
|
|
3298
3312
|
}
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
* @returns An unsubscribe callback to remove the listener.
|
|
3309
|
-
*/
|
|
3310
|
-
onPushToken(t) {
|
|
3311
|
-
var e;
|
|
3312
|
-
return this.logger.debug("Registering for Push Token"), (e = this.listeners.get(w.PushToken)) == null || e.add(t), () => {
|
|
3313
|
-
var r;
|
|
3314
|
-
return (r = this.listeners.get(w.PushToken)) == null ? void 0 : r.delete(t);
|
|
3315
|
-
};
|
|
3313
|
+
onPushToken(t, e) {
|
|
3314
|
+
var r, s;
|
|
3315
|
+
return this.logger.debug("Registering for Push Token"), e != null && e.asPayload ? ((r = this.listeners.get(v.PushTokenPayload)) == null || r.add(t), () => {
|
|
3316
|
+
var i;
|
|
3317
|
+
return (i = this.listeners.get(v.PushTokenPayload)) == null ? void 0 : i.delete(t);
|
|
3318
|
+
}) : ((s = this.listeners.get(v.PushToken)) == null || s.add(t), () => {
|
|
3319
|
+
var i;
|
|
3320
|
+
return (i = this.listeners.get(v.PushToken)) == null ? void 0 : i.delete(t);
|
|
3321
|
+
});
|
|
3316
3322
|
}
|
|
3317
3323
|
/**
|
|
3318
3324
|
* Registers a callback to be invoked when a {@link IPCEvents.RequestLogs} event is received.
|
|
@@ -3331,9 +3337,9 @@ class Rt {
|
|
|
3331
3337
|
*/
|
|
3332
3338
|
onRequestLogsMessage(t) {
|
|
3333
3339
|
var e;
|
|
3334
|
-
return this.logger.debug("Registering for Request Logs Message"), (e = this.listeners.get(
|
|
3340
|
+
return this.logger.debug("Registering for Request Logs Message"), (e = this.listeners.get(v.RequestLogs)) == null || e.add(t), () => {
|
|
3335
3341
|
var r;
|
|
3336
|
-
return (r = this.listeners.get(
|
|
3342
|
+
return (r = this.listeners.get(v.RequestLogs)) == null ? void 0 : r.delete(t);
|
|
3337
3343
|
};
|
|
3338
3344
|
}
|
|
3339
3345
|
/**
|
|
@@ -3351,7 +3357,7 @@ class Rt {
|
|
|
3351
3357
|
requestCallInfo() {
|
|
3352
3358
|
if (this.logger.debug("Requesting Call Info"), this.negotiatedVersion === "2.0" || this.negotiatedVersion === "2.1")
|
|
3353
3359
|
throw new V("2.2", this.negotiatedVersion);
|
|
3354
|
-
return
|
|
3360
|
+
return U(this.helper.requestCallInfo().pipe(R((t) => t.calls)));
|
|
3355
3361
|
}
|
|
3356
3362
|
/**
|
|
3357
3363
|
* Registers a callback to be invoked when a {@link IPCEvents.CallInfo} event is received.
|
|
@@ -3370,9 +3376,9 @@ class Rt {
|
|
|
3370
3376
|
*/
|
|
3371
3377
|
onCallInfo(t) {
|
|
3372
3378
|
var e;
|
|
3373
|
-
return this.logger.debug("Registering for Call Info updates"), (e = this.listeners.get(
|
|
3379
|
+
return this.logger.debug("Registering for Call Info updates"), (e = this.listeners.get(v.CallInfo)) == null || e.add(t), () => {
|
|
3374
3380
|
var r;
|
|
3375
|
-
return (r = this.listeners.get(
|
|
3381
|
+
return (r = this.listeners.get(v.CallInfo)) == null ? void 0 : r.delete(t);
|
|
3376
3382
|
};
|
|
3377
3383
|
}
|
|
3378
3384
|
evaluateContext(t) {
|
|
@@ -3383,6 +3389,8 @@ class Rt {
|
|
|
3383
3389
|
}
|
|
3384
3390
|
}
|
|
3385
3391
|
export {
|
|
3386
|
-
|
|
3387
|
-
Rt as IPCManager
|
|
3392
|
+
v as IPCEvents,
|
|
3393
|
+
Rt as IPCManager,
|
|
3394
|
+
m as InvalidParameterError,
|
|
3395
|
+
V as UnsupportedVersionError
|
|
3388
3396
|
};
|