@acrobits/ipc-sdk 0.8.0-alpha.3 → 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/lib/ipc-sdk.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var x = (n, t, e) => (
|
|
1
|
+
var Re = Object.defineProperty;
|
|
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 x = (n, t, e) => (Pe(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
4
|
var b = /* @__PURE__ */ ((n) => (n.BadgeQuery = "BADGE QUERY", n.Lifecycle = "LIFECYCLE", n.PushToken = "PUSH TOKEN", n))(b || {}), H = function(n, t) {
|
|
5
5
|
return H = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {
|
|
6
6
|
e.__proto__ = r;
|
|
@@ -92,15 +92,15 @@ var T = function() {
|
|
|
92
92
|
if (o)
|
|
93
93
|
if (this._parentage = null, Array.isArray(o))
|
|
94
94
|
try {
|
|
95
|
-
for (var c = Q(o),
|
|
96
|
-
var
|
|
97
|
-
|
|
95
|
+
for (var c = Q(o), a = c.next(); !a.done; a = c.next()) {
|
|
96
|
+
var u = a.value;
|
|
97
|
+
u.remove(this);
|
|
98
98
|
}
|
|
99
99
|
} catch (p) {
|
|
100
100
|
t = { error: p };
|
|
101
101
|
} finally {
|
|
102
102
|
try {
|
|
103
|
-
|
|
103
|
+
a && !a.done && (e = c.return) && e.call(c);
|
|
104
104
|
} finally {
|
|
105
105
|
if (t)
|
|
106
106
|
throw t.error;
|
|
@@ -329,8 +329,8 @@ var z = function() {
|
|
|
329
329
|
}, n.prototype.subscribe = function(t, e, r) {
|
|
330
330
|
var i = this, s = je(t) ? t : new V(t, e, r);
|
|
331
331
|
return U(function() {
|
|
332
|
-
var o = i, c = o.operator,
|
|
333
|
-
s.add(c ? c.call(s,
|
|
332
|
+
var o = i, c = o.operator, a = o.source;
|
|
333
|
+
s.add(c ? c.call(s, a) : a ? i._subscribe(s) : i._trySubscribe(s));
|
|
334
334
|
}), s;
|
|
335
335
|
}, n.prototype._trySubscribe = function(t) {
|
|
336
336
|
try {
|
|
@@ -345,8 +345,8 @@ var z = function() {
|
|
|
345
345
|
next: function(c) {
|
|
346
346
|
try {
|
|
347
347
|
t(c);
|
|
348
|
-
} catch (
|
|
349
|
-
s(
|
|
348
|
+
} catch (a) {
|
|
349
|
+
s(a), o.unsubscribe();
|
|
350
350
|
}
|
|
351
351
|
},
|
|
352
352
|
error: s,
|
|
@@ -411,30 +411,30 @@ function Me(n, t, e, r, i) {
|
|
|
411
411
|
var De = function(n) {
|
|
412
412
|
M(t, n);
|
|
413
413
|
function t(e, r, i, s, o, c) {
|
|
414
|
-
var
|
|
415
|
-
return
|
|
414
|
+
var a = n.call(this, e) || this;
|
|
415
|
+
return a.onFinalize = o, a.shouldUnsubscribe = c, a._next = r ? function(u) {
|
|
416
416
|
try {
|
|
417
|
-
r(
|
|
417
|
+
r(u);
|
|
418
418
|
} catch (v) {
|
|
419
419
|
e.error(v);
|
|
420
420
|
}
|
|
421
|
-
} : n.prototype._next,
|
|
421
|
+
} : n.prototype._next, a._error = s ? function(u) {
|
|
422
422
|
try {
|
|
423
|
-
s(
|
|
423
|
+
s(u);
|
|
424
424
|
} catch (v) {
|
|
425
425
|
e.error(v);
|
|
426
426
|
} finally {
|
|
427
427
|
this.unsubscribe();
|
|
428
428
|
}
|
|
429
|
-
} : n.prototype._error,
|
|
429
|
+
} : n.prototype._error, a._complete = i ? function() {
|
|
430
430
|
try {
|
|
431
431
|
i();
|
|
432
|
-
} catch (
|
|
433
|
-
e.error(
|
|
432
|
+
} catch (u) {
|
|
433
|
+
e.error(u);
|
|
434
434
|
} finally {
|
|
435
435
|
this.unsubscribe();
|
|
436
436
|
}
|
|
437
|
-
} : n.prototype._complete,
|
|
437
|
+
} : n.prototype._complete, a;
|
|
438
438
|
}
|
|
439
439
|
return t.prototype.unsubscribe = function() {
|
|
440
440
|
var e;
|
|
@@ -467,11 +467,11 @@ var De = function(n) {
|
|
|
467
467
|
r.currentObservers || (r.currentObservers = Array.from(r.observers));
|
|
468
468
|
try {
|
|
469
469
|
for (var o = Q(r.currentObservers), c = o.next(); !c.done; c = o.next()) {
|
|
470
|
-
var
|
|
471
|
-
|
|
470
|
+
var a = c.value;
|
|
471
|
+
a.next(e);
|
|
472
472
|
}
|
|
473
|
-
} catch (
|
|
474
|
-
i = { error:
|
|
473
|
+
} catch (u) {
|
|
474
|
+
i = { error: u };
|
|
475
475
|
} finally {
|
|
476
476
|
try {
|
|
477
477
|
c && !c.done && (s = o.return) && s.call(o);
|
|
@@ -612,7 +612,7 @@ var De = function(n) {
|
|
|
612
612
|
this.work = this.state = this.scheduler = null, this.pending = !1, F(s, this), r != null && (this.id = this.recycleAsyncId(i, r, null)), this.delay = null, n.prototype.unsubscribe.call(this);
|
|
613
613
|
}
|
|
614
614
|
}, t;
|
|
615
|
-
}(He),
|
|
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
|
}
|
|
@@ -622,7 +622,7 @@ var De = function(n) {
|
|
|
622
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
|
}
|
|
@@ -697,18 +697,18 @@ function Ze(n, t, e) {
|
|
|
697
697
|
var o;
|
|
698
698
|
(o = r.subscribe) === null || o === void 0 || o.call(r);
|
|
699
699
|
var c = !0;
|
|
700
|
-
i.subscribe(Me(s, function(
|
|
701
|
-
var a;
|
|
702
|
-
(a = r.next) === null || a === void 0 || a.call(r, u), s.next(u);
|
|
703
|
-
}, function() {
|
|
700
|
+
i.subscribe(Me(s, function(a) {
|
|
704
701
|
var u;
|
|
705
|
-
|
|
706
|
-
}, function(
|
|
702
|
+
(u = r.next) === null || u === void 0 || u.call(r, a), s.next(a);
|
|
703
|
+
}, function() {
|
|
707
704
|
var a;
|
|
708
|
-
c = !1, (a = r.
|
|
705
|
+
c = !1, (a = r.complete) === null || a === void 0 || a.call(r), s.complete();
|
|
706
|
+
}, function(a) {
|
|
707
|
+
var u;
|
|
708
|
+
c = !1, (u = r.error) === null || u === void 0 || u.call(r, a), s.error(a);
|
|
709
709
|
}, function() {
|
|
710
|
-
var
|
|
711
|
-
c && ((
|
|
710
|
+
var a, u;
|
|
711
|
+
c && ((a = r.unsubscribe) === null || a === void 0 || a.call(r)), (u = r.finalize) === null || u === void 0 || u.call(r);
|
|
712
712
|
}));
|
|
713
713
|
}) : Ee;
|
|
714
714
|
}
|
|
@@ -735,7 +735,7 @@ class nt extends Error {
|
|
|
735
735
|
super(`Invalid version format: ${t}`);
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
|
-
class
|
|
738
|
+
class ue extends Error {
|
|
739
739
|
constructor(t) {
|
|
740
740
|
super(`${t} needs to be initialized before it can be used.`);
|
|
741
741
|
}
|
|
@@ -752,7 +752,7 @@ function S(n) {
|
|
|
752
752
|
function it(n) {
|
|
753
753
|
return S(n == null ? void 0 : n.lift);
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function R(n) {
|
|
756
756
|
return function(t) {
|
|
757
757
|
if (it(t))
|
|
758
758
|
return t.lift(function(e) {
|
|
@@ -853,15 +853,15 @@ var te = function() {
|
|
|
853
853
|
if (o)
|
|
854
854
|
if (this._parentage = null, Array.isArray(o))
|
|
855
855
|
try {
|
|
856
|
-
for (var c = he(o),
|
|
857
|
-
var
|
|
858
|
-
|
|
856
|
+
for (var c = he(o), a = c.next(); !a.done; a = c.next()) {
|
|
857
|
+
var u = a.value;
|
|
858
|
+
u.remove(this);
|
|
859
859
|
}
|
|
860
860
|
} catch (p) {
|
|
861
861
|
t = { error: p };
|
|
862
862
|
} finally {
|
|
863
863
|
try {
|
|
864
|
-
|
|
864
|
+
a && !a.done && (e = c.return) && e.call(c);
|
|
865
865
|
} finally {
|
|
866
866
|
if (t)
|
|
867
867
|
throw t.error;
|
|
@@ -963,7 +963,7 @@ function ct(n) {
|
|
|
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) {
|
|
@@ -997,9 +997,9 @@ var re = function(n) {
|
|
|
997
997
|
this.unsubscribe();
|
|
998
998
|
}
|
|
999
999
|
}, t;
|
|
1000
|
-
}(te),
|
|
1000
|
+
}(te), ut = Function.prototype.bind;
|
|
1001
1001
|
function B(n, t) {
|
|
1002
|
-
return
|
|
1002
|
+
return ut.call(n, t);
|
|
1003
1003
|
}
|
|
1004
1004
|
var lt = function() {
|
|
1005
1005
|
function n(t) {
|
|
@@ -1089,9 +1089,9 @@ var gt = function() {
|
|
|
1089
1089
|
return e.source = this, e.operator = t, e;
|
|
1090
1090
|
}, n.prototype.subscribe = function(t, e, r) {
|
|
1091
1091
|
var i = this, s = bt(t) ? t : new W(t, e, r);
|
|
1092
|
-
return
|
|
1093
|
-
var o = i, c = o.operator,
|
|
1094
|
-
s.add(c ? c.call(s,
|
|
1092
|
+
return at(function() {
|
|
1093
|
+
var o = i, c = o.operator, a = o.source;
|
|
1094
|
+
s.add(c ? c.call(s, a) : a ? i._subscribe(s) : i._trySubscribe(s));
|
|
1095
1095
|
}), s;
|
|
1096
1096
|
}, n.prototype._trySubscribe = function(t) {
|
|
1097
1097
|
try {
|
|
@@ -1106,8 +1106,8 @@ var gt = function() {
|
|
|
1106
1106
|
next: function(c) {
|
|
1107
1107
|
try {
|
|
1108
1108
|
t(c);
|
|
1109
|
-
} catch (
|
|
1110
|
-
s(
|
|
1109
|
+
} catch (a) {
|
|
1110
|
+
s(a), o.unsubscribe();
|
|
1111
1111
|
}
|
|
1112
1112
|
},
|
|
1113
1113
|
error: s,
|
|
@@ -1150,36 +1150,36 @@ function vt(n) {
|
|
|
1150
1150
|
function bt(n) {
|
|
1151
1151
|
return n && n instanceof re || vt(n) && _e(n);
|
|
1152
1152
|
}
|
|
1153
|
-
function
|
|
1153
|
+
function P(n, t, e, r, i) {
|
|
1154
1154
|
return new yt(n, t, e, r, i);
|
|
1155
1155
|
}
|
|
1156
1156
|
var yt = function(n) {
|
|
1157
1157
|
ee(t, n);
|
|
1158
1158
|
function t(e, r, i, s, o, c) {
|
|
1159
|
-
var
|
|
1160
|
-
return
|
|
1159
|
+
var a = n.call(this, e) || this;
|
|
1160
|
+
return a.onFinalize = o, a.shouldUnsubscribe = c, a._next = r ? function(u) {
|
|
1161
1161
|
try {
|
|
1162
|
-
r(
|
|
1162
|
+
r(u);
|
|
1163
1163
|
} catch (v) {
|
|
1164
1164
|
e.error(v);
|
|
1165
1165
|
}
|
|
1166
|
-
} : n.prototype._next,
|
|
1166
|
+
} : n.prototype._next, a._error = s ? function(u) {
|
|
1167
1167
|
try {
|
|
1168
|
-
s(
|
|
1168
|
+
s(u);
|
|
1169
1169
|
} catch (v) {
|
|
1170
1170
|
e.error(v);
|
|
1171
1171
|
} finally {
|
|
1172
1172
|
this.unsubscribe();
|
|
1173
1173
|
}
|
|
1174
|
-
} : n.prototype._error,
|
|
1174
|
+
} : n.prototype._error, a._complete = i ? function() {
|
|
1175
1175
|
try {
|
|
1176
1176
|
i();
|
|
1177
|
-
} catch (
|
|
1178
|
-
e.error(
|
|
1177
|
+
} catch (u) {
|
|
1178
|
+
e.error(u);
|
|
1179
1179
|
} finally {
|
|
1180
1180
|
this.unsubscribe();
|
|
1181
1181
|
}
|
|
1182
|
-
} : n.prototype._complete,
|
|
1182
|
+
} : n.prototype._complete, a;
|
|
1183
1183
|
}
|
|
1184
1184
|
return t.prototype.unsubscribe = function() {
|
|
1185
1185
|
var e;
|
|
@@ -1190,9 +1190,9 @@ var yt = function(n) {
|
|
|
1190
1190
|
}, t;
|
|
1191
1191
|
}(re);
|
|
1192
1192
|
function h(n, t) {
|
|
1193
|
-
return
|
|
1193
|
+
return R(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
|
});
|
|
@@ -1203,25 +1203,25 @@ var mt = new gt(function(n) {
|
|
|
1203
1203
|
function y(n) {
|
|
1204
1204
|
return n <= 0 ? function() {
|
|
1205
1205
|
return mt;
|
|
1206
|
-
} :
|
|
1206
|
+
} : R(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 R(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
1221
|
function wt(n, t) {
|
|
1222
|
-
return t === void 0 && (t = !1),
|
|
1222
|
+
return t === void 0 && (t = !1), R(function(e, r) {
|
|
1223
1223
|
var i = 0;
|
|
1224
|
-
e.subscribe(
|
|
1224
|
+
e.subscribe(P(r, function(s) {
|
|
1225
1225
|
var o = n(s, i++);
|
|
1226
1226
|
(o || t) && r.next(s), !o && r.complete();
|
|
1227
1227
|
}));
|
|
@@ -1229,22 +1229,22 @@ function wt(n, t) {
|
|
|
1229
1229
|
}
|
|
1230
1230
|
function d(n, t, e) {
|
|
1231
1231
|
var r = S(n) || t || e ? { next: n, error: t, complete: e } : n;
|
|
1232
|
-
return r ?
|
|
1232
|
+
return r ? R(function(i, s) {
|
|
1233
1233
|
var o;
|
|
1234
1234
|
(o = r.subscribe) === null || o === void 0 || o.call(r);
|
|
1235
1235
|
var c = !0;
|
|
1236
|
-
i.subscribe(
|
|
1237
|
-
var a;
|
|
1238
|
-
(a = r.next) === null || a === void 0 || a.call(r, u), s.next(u);
|
|
1239
|
-
}, function() {
|
|
1236
|
+
i.subscribe(P(s, function(a) {
|
|
1240
1237
|
var u;
|
|
1241
|
-
|
|
1242
|
-
}, function(
|
|
1238
|
+
(u = r.next) === null || u === void 0 || u.call(r, a), s.next(a);
|
|
1239
|
+
}, function() {
|
|
1243
1240
|
var a;
|
|
1244
|
-
c = !1, (a = r.
|
|
1241
|
+
c = !1, (a = r.complete) === null || a === void 0 || a.call(r), s.complete();
|
|
1242
|
+
}, function(a) {
|
|
1243
|
+
var u;
|
|
1244
|
+
c = !1, (u = r.error) === null || u === void 0 || u.call(r, a), s.error(a);
|
|
1245
1245
|
}, function() {
|
|
1246
|
-
var
|
|
1247
|
-
c && ((
|
|
1246
|
+
var a, u;
|
|
1247
|
+
c && ((a = r.unsubscribe) === null || a === void 0 || a.call(r)), (u = r.finalize) === null || u === void 0 || u.call(r);
|
|
1248
1248
|
}));
|
|
1249
1249
|
}) : Te;
|
|
1250
1250
|
}
|
|
@@ -1306,11 +1306,11 @@ class xt {
|
|
|
1306
1306
|
var t, e, r, i;
|
|
1307
1307
|
if (this.inIframe) {
|
|
1308
1308
|
if (!this.iframePort2)
|
|
1309
|
-
throw new
|
|
1309
|
+
throw new ue("port2");
|
|
1310
1310
|
return this.iframePort2;
|
|
1311
1311
|
} else {
|
|
1312
1312
|
if (!((e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) != null && e.port2))
|
|
1313
|
-
throw new
|
|
1313
|
+
throw new ue("port2");
|
|
1314
1314
|
return (i = (r = window.Acrobits) == null ? void 0 : r.messageChannel) == null ? void 0 : i.port2;
|
|
1315
1315
|
}
|
|
1316
1316
|
}
|
|
@@ -1397,10 +1397,10 @@ class xt {
|
|
|
1397
1397
|
jwtToken: s,
|
|
1398
1398
|
serverUrl: o,
|
|
1399
1399
|
region: c,
|
|
1400
|
-
joinMicMuted:
|
|
1401
|
-
joinWithoutCamera:
|
|
1400
|
+
joinMicMuted: a,
|
|
1401
|
+
joinWithoutCamera: u
|
|
1402
1402
|
} = t, v = "JOINING ROOM", g = this.createMessage(v, !1);
|
|
1403
|
-
g.roomName = e, g.jwtToken = s, g.serverUrl = o, g.region = c, g.roomInvite = r, g.joinMicMuted =
|
|
1403
|
+
g.roomName = e, g.jwtToken = s, g.serverUrl = o, g.region = c, g.roomInvite = r, g.joinMicMuted = a ?? !1, g.joinWithoutCamera = u ?? !1, g.displayName = i, this.logCreated(v, g), this.port2.postMessage(g), this.logSent(v, g);
|
|
1404
1404
|
}
|
|
1405
1405
|
/**
|
|
1406
1406
|
* Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.
|
|
@@ -1648,14 +1648,14 @@ class xt {
|
|
|
1648
1648
|
const s = "SELECT CONTACTS", o = this.createMessage(s, !0);
|
|
1649
1649
|
o.streamType = e, o.streamId = t, o.contactType = r, o.currentContacts = i, this.logCreated(s, o);
|
|
1650
1650
|
const c = this.incomingMessages$.pipe(
|
|
1651
|
-
f((
|
|
1651
|
+
f((a) => a.type === s && a.replyTo === o.id),
|
|
1652
1652
|
d(this.logReceived(s)),
|
|
1653
1653
|
// validate if `streamId` is the same as we sent
|
|
1654
|
-
h((
|
|
1655
|
-
const
|
|
1656
|
-
if (
|
|
1657
|
-
throw new rt(
|
|
1658
|
-
return e === "direct" &&
|
|
1654
|
+
h((a) => {
|
|
1655
|
+
const u = a;
|
|
1656
|
+
if (u.streamId !== t)
|
|
1657
|
+
throw new rt(u.streamId, t);
|
|
1658
|
+
return e === "direct" && u.contacts.length > 1 && (u.contacts = [u.contacts[0]]), u;
|
|
1659
1659
|
}),
|
|
1660
1660
|
y(1)
|
|
1661
1661
|
);
|
|
@@ -1975,16 +1975,41 @@ class xt {
|
|
|
1975
1975
|
}
|
|
1976
1976
|
this.logCreated(s, o);
|
|
1977
1977
|
let c = 0;
|
|
1978
|
-
const
|
|
1978
|
+
const a = this.incomingMessages$.pipe(
|
|
1979
1979
|
f(
|
|
1980
|
-
(
|
|
1980
|
+
(u) => u.type === s && u.replyTo === o.id
|
|
1981
1981
|
),
|
|
1982
1982
|
d(this.logReceived(s)),
|
|
1983
1983
|
d(() => c++),
|
|
1984
|
-
h((
|
|
1985
|
-
wt((
|
|
1984
|
+
h((u) => (u.result === "success" && (u.chunkHash = u.chunkHash.toLowerCase()), u)),
|
|
1985
|
+
wt((u) => u.result === "success" && c < u.totalChunks, !0)
|
|
1986
|
+
);
|
|
1987
|
+
return this.port2.postMessage(o), this.logSent(s, o), a;
|
|
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)
|
|
1986
2011
|
);
|
|
1987
|
-
|
|
2012
|
+
this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);
|
|
1988
2013
|
}
|
|
1989
2014
|
/**
|
|
1990
2015
|
* Setup a listener for {@link FileRequestMessage}, which can be sent by a Host app to request a
|
|
@@ -2044,18 +2069,18 @@ class xt {
|
|
|
2044
2069
|
c.streamId = e;
|
|
2045
2070
|
}
|
|
2046
2071
|
this.logCreated(o, c);
|
|
2047
|
-
const
|
|
2072
|
+
const a = this.incomingMessages$.pipe(
|
|
2048
2073
|
f(
|
|
2049
|
-
(
|
|
2074
|
+
(u) => u.type === o && u.replyTo === c.id
|
|
2050
2075
|
),
|
|
2051
|
-
h((
|
|
2076
|
+
h((u) => {
|
|
2052
2077
|
var v;
|
|
2053
|
-
return
|
|
2078
|
+
return u.files = (v = u.files) == null ? void 0 : v.map((g) => (g.fileHash = g.fileHash.toLowerCase(), g)), u;
|
|
2054
2079
|
}),
|
|
2055
2080
|
d(this.logReceived(o)),
|
|
2056
2081
|
y(1)
|
|
2057
2082
|
);
|
|
2058
|
-
return this.port2.postMessage(c), this.logSent(o, c),
|
|
2083
|
+
return this.port2.postMessage(c), this.logSent(o, c), a;
|
|
2059
2084
|
}
|
|
2060
2085
|
/**
|
|
2061
2086
|
* Sends a {@link FileDownloadMessage} to the Host app, to request the download of a file.
|
|
@@ -2077,9 +2102,9 @@ class xt {
|
|
|
2077
2102
|
const s = "FILE DOWNLOAD", o = this.createMessage(s);
|
|
2078
2103
|
o.url = t, o.key = e, o.fileName = r, o.mimeType = i, this.logCreated(s, o);
|
|
2079
2104
|
const c = this.incomingMessages$.pipe(
|
|
2080
|
-
f((
|
|
2105
|
+
f((a) => a.type === s && a.replyTo === o.id),
|
|
2081
2106
|
d(this.logReceived(s)),
|
|
2082
|
-
h((
|
|
2107
|
+
h((a) => a),
|
|
2083
2108
|
y(1)
|
|
2084
2109
|
);
|
|
2085
2110
|
return this.port2.postMessage(o), this.logSent(s, o), c;
|
|
@@ -2272,7 +2297,7 @@ function _t(n) {
|
|
|
2272
2297
|
return n.type === "FILE REQUEST" && n.replyTo !== null;
|
|
2273
2298
|
}
|
|
2274
2299
|
const It = ["2.0"];
|
|
2275
|
-
class
|
|
2300
|
+
class Rt {
|
|
2276
2301
|
/**
|
|
2277
2302
|
* A class that manages the IPC communication between the `Client` and the `Host`.
|
|
2278
2303
|
*
|
|
@@ -2495,5 +2520,5 @@ class Pt {
|
|
|
2495
2520
|
}
|
|
2496
2521
|
export {
|
|
2497
2522
|
b as IPCEvents,
|
|
2498
|
-
|
|
2523
|
+
Rt as IPCManager
|
|
2499
2524
|
};
|