@acrobits/ipc-sdk 0.7.2-alpha.0 → 0.7.2-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/ipc-sdk.js CHANGED
@@ -96,8 +96,8 @@ var R = function() {
96
96
  var u = a.value;
97
97
  u.remove(this);
98
98
  }
99
- } catch (v) {
100
- t = { error: v };
99
+ } catch (f) {
100
+ t = { error: f };
101
101
  } finally {
102
102
  try {
103
103
  a && !a.done && (e = c.return) && e.call(c);
@@ -112,26 +112,26 @@ var R = function() {
112
112
  if (w(g))
113
113
  try {
114
114
  g();
115
- } catch (v) {
116
- s = v instanceof j ? v.errors : [v];
115
+ } catch (f) {
116
+ s = f instanceof j ? f.errors : [f];
117
117
  }
118
- var y = this._finalizers;
119
- if (y) {
118
+ var v = this._finalizers;
119
+ if (v) {
120
120
  this._finalizers = null;
121
121
  try {
122
- for (var p = z(y), S = p.next(); !S.done; S = p.next()) {
122
+ for (var y = z(v), S = y.next(); !S.done; S = y.next()) {
123
123
  var V = S.value;
124
124
  try {
125
125
  ie(V);
126
- } catch (v) {
127
- s = s ?? [], v instanceof j ? s = F(F([], $(s)), $(v.errors)) : s.push(v);
126
+ } catch (f) {
127
+ s = s ?? [], f instanceof j ? s = F(F([], $(s)), $(f.errors)) : s.push(f);
128
128
  }
129
129
  }
130
- } catch (v) {
131
- r = { error: v };
130
+ } catch (f) {
131
+ r = { error: f };
132
132
  } finally {
133
133
  try {
134
- S && !S.done && (i = p.return) && i.call(p);
134
+ S && !S.done && (i = y.return) && i.call(y);
135
135
  } finally {
136
136
  if (r)
137
137
  throw r.error;
@@ -857,8 +857,8 @@ var te = function() {
857
857
  var u = a.value;
858
858
  u.remove(this);
859
859
  }
860
- } catch (v) {
861
- t = { error: v };
860
+ } catch (f) {
861
+ t = { error: f };
862
862
  } finally {
863
863
  try {
864
864
  a && !a.done && (e = c.return) && e.call(c);
@@ -873,26 +873,26 @@ var te = function() {
873
873
  if (E(g))
874
874
  try {
875
875
  g();
876
- } catch (v) {
877
- s = v instanceof D ? v.errors : [v];
876
+ } catch (f) {
877
+ s = f instanceof D ? f.errors : [f];
878
878
  }
879
- var y = this._finalizers;
880
- if (y) {
879
+ var v = this._finalizers;
880
+ if (v) {
881
881
  this._finalizers = null;
882
882
  try {
883
- for (var p = he(y), S = p.next(); !S.done; S = p.next()) {
883
+ for (var y = he(v), S = y.next(); !S.done; S = y.next()) {
884
884
  var V = S.value;
885
885
  try {
886
886
  pe(V);
887
- } catch (v) {
888
- s = s ?? [], v instanceof D ? s = J(J([], K(s)), K(v.errors)) : s.push(v);
887
+ } catch (f) {
888
+ s = s ?? [], f instanceof D ? s = J(J([], K(s)), K(f.errors)) : s.push(f);
889
889
  }
890
890
  }
891
- } catch (v) {
892
- r = { error: v };
891
+ } catch (f) {
892
+ r = { error: f };
893
893
  } finally {
894
894
  try {
895
- S && !S.done && (i = p.return) && i.call(p);
895
+ S && !S.done && (i = y.return) && i.call(y);
896
896
  } finally {
897
897
  if (r)
898
898
  throw r.error;
@@ -1210,7 +1210,7 @@ function b(n) {
1210
1210
  }));
1211
1211
  });
1212
1212
  }
1213
- function f(n, t) {
1213
+ function p(n, t) {
1214
1214
  return I(function(e, r) {
1215
1215
  var i = 0;
1216
1216
  e.subscribe(P(r, function(s) {
@@ -1337,7 +1337,7 @@ class xt {
1337
1337
  const t = "HELLO", e = this.createMessage(t);
1338
1338
  e.protocolVersions = this.supportedVersions, this.logCreated(t, e);
1339
1339
  const r = this.incomingMessages$.pipe(
1340
- f((i) => i.type === t && i.replyTo === e.id),
1340
+ p((i) => i.type === t && i.replyTo === e.id),
1341
1341
  h((i) => i),
1342
1342
  d(this.logReceived(t)),
1343
1343
  h((i) => {
@@ -1367,7 +1367,7 @@ class xt {
1367
1367
  const t = "TOKEN", e = this.createMessage(t);
1368
1368
  this.logCreated(t, e);
1369
1369
  const r = this.incomingMessages$.pipe(
1370
- f((i) => i.type === t && i.replyTo === e.id),
1370
+ p((i) => i.type === t && i.replyTo === e.id),
1371
1371
  h((i) => i),
1372
1372
  d(this.logReceived(t)),
1373
1373
  b(1)
@@ -1399,8 +1399,8 @@ class xt {
1399
1399
  region: c,
1400
1400
  joinMicMuted: a,
1401
1401
  joinWithoutCamera: u
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);
1402
+ } = t, g = "JOINING ROOM", v = this.createMessage(g, !1);
1403
+ v.roomName = e, v.jwtToken = s, v.serverUrl = o, v.region = c, v.roomInvite = r, v.joinMicMuted = a ?? !1, v.joinWithoutCamera = u ?? !1, v.displayName = i, this.logCreated(g, v), this.port2.postMessage(v), this.logSent(g, v);
1404
1404
  }
1405
1405
  /**
1406
1406
  * Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.
@@ -1450,7 +1450,7 @@ class xt {
1450
1450
  throw new l(this.currentContext);
1451
1451
  const t = "JOIN ROOM";
1452
1452
  return this.incomingMessages$.pipe(
1453
- f((e) => e.type === t && e.target === "client"),
1453
+ p((e) => e.type === t && e.target === "client"),
1454
1454
  h((e) => e),
1455
1455
  d(this.logReceived(t)),
1456
1456
  h((e) => e)
@@ -1486,7 +1486,7 @@ class xt {
1486
1486
  throw new l(this.currentContext);
1487
1487
  const t = "LEAVE ROOM";
1488
1488
  return this.incomingMessages$.pipe(
1489
- f((e) => e.type === t && e.target === "client"),
1489
+ p((e) => e.type === t && e.target === "client"),
1490
1490
  h((e) => e),
1491
1491
  d(this.logReceived(t)),
1492
1492
  h((e) => e)
@@ -1523,7 +1523,7 @@ class xt {
1523
1523
  throw new l(this.currentContext);
1524
1524
  const t = "CONFIG";
1525
1525
  return this.incomingMessages$.pipe(
1526
- f((e) => e.type === t && e.target === "client"),
1526
+ p((e) => e.type === t && e.target === "client"),
1527
1527
  h((e) => e),
1528
1528
  d(this.logReceived(t)),
1529
1529
  h((e) => ({
@@ -1546,7 +1546,7 @@ class xt {
1546
1546
  const e = "SCREENSHARE SOURCE", r = this.createMessage(e);
1547
1547
  r.sourceTypes = t, this.logCreated(e, r);
1548
1548
  const i = this.incomingMessages$.pipe(
1549
- f((s) => s.type === e && s.replyTo === r.id),
1549
+ p((s) => s.type === e && s.replyTo === r.id),
1550
1550
  h((s) => s),
1551
1551
  d(this.logReceived(e)),
1552
1552
  h((s) => s),
@@ -1560,7 +1560,7 @@ class xt {
1560
1560
  const i = "LAYOUT CHANGE";
1561
1561
  let s, o;
1562
1562
  if (e && r ? (s = this.createMessage(i, !1, r), s.result = e) : (s = this.createMessage(i), o = this.incomingMessages$.pipe(
1563
- f((c) => c.type === i && c.replyTo === s.id),
1563
+ p((c) => c.type === i && c.replyTo === s.id),
1564
1564
  h((c) => c),
1565
1565
  d(this.logReceived(i)),
1566
1566
  h((c) => c),
@@ -1604,7 +1604,7 @@ class xt {
1604
1604
  throw new l(this.currentContext);
1605
1605
  const t = "LAYOUT CHANGE";
1606
1606
  return this.incomingMessages$.pipe(
1607
- f((e) => e.type === t && e.target === "client" && e.replyTo === null),
1607
+ p((e) => e.type === t && e.target === "client" && e.replyTo === null),
1608
1608
  h((e) => e),
1609
1609
  d(this.logReceived(t)),
1610
1610
  h((e) => e)
@@ -1617,7 +1617,7 @@ class xt {
1617
1617
  const e = "OAUTH TOKEN", r = this.createMessage(e);
1618
1618
  r.providerTypes = t, this.logCreated(e, r);
1619
1619
  const i = this.incomingMessages$.pipe(
1620
- f((s) => s.type === e && s.replyTo === r.id),
1620
+ p((s) => s.type === e && s.replyTo === r.id),
1621
1621
  h((s) => s),
1622
1622
  d(this.logReceived(e)),
1623
1623
  b(1)
@@ -1648,7 +1648,7 @@ 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((a) => a.type === s && a.replyTo === o.id),
1651
+ p((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
1654
  h((a) => {
@@ -1677,7 +1677,7 @@ class xt {
1677
1677
  const e = "MATCH CONTACTS", r = this.createMessage(e);
1678
1678
  r.contacts = [...t], this.logCreated(e, r);
1679
1679
  const i = this.incomingMessages$.pipe(
1680
- f((s) => s.type === e && s.replyTo === r.id),
1680
+ p((s) => s.type === e && s.replyTo === r.id),
1681
1681
  d(this.logReceived(e)),
1682
1682
  h((s) => s),
1683
1683
  b(1)
@@ -1715,7 +1715,7 @@ class xt {
1715
1715
  throw new l(this.currentContext);
1716
1716
  const t = "PUSH MESSAGE";
1717
1717
  return this.incomingMessages$.pipe(
1718
- f((e) => e.type === t && e.target === "client"),
1718
+ p((e) => e.type === t && e.target === "client"),
1719
1719
  h((e) => e),
1720
1720
  d(this.logReceived(t))
1721
1721
  );
@@ -1735,7 +1735,7 @@ class xt {
1735
1735
  const t = "PUSH TOKEN", e = this.createMessage(t);
1736
1736
  this.logCreated(t, e);
1737
1737
  const r = this.incomingMessages$.pipe(
1738
- f((i) => i.type === t && i.replyTo === e.id),
1738
+ p((i) => i.type === t && i.replyTo === e.id),
1739
1739
  d(this.logReceived(t)),
1740
1740
  h((i) => i),
1741
1741
  b(1)
@@ -1774,7 +1774,7 @@ class xt {
1774
1774
  throw new l(this.currentContext);
1775
1775
  const t = "PUSH TOKEN";
1776
1776
  return this.incomingMessages$.pipe(
1777
- f(
1777
+ p(
1778
1778
  (e) => e.type === t && e.target === "client" && e.replyTo === null && e.expectReply === !1
1779
1779
  ),
1780
1780
  h((e) => {
@@ -1798,7 +1798,7 @@ class xt {
1798
1798
  throw new l(this.currentContext);
1799
1799
  const t = "BADGE QUERY";
1800
1800
  return this.incomingMessages$.pipe(
1801
- f((e) => e.type === t && e.target === "client"),
1801
+ p((e) => e.type === t && e.target === "client"),
1802
1802
  h((e) => e),
1803
1803
  d(this.logReceived(t))
1804
1804
  );
@@ -1856,7 +1856,7 @@ class xt {
1856
1856
  throw new l(this.currentContext);
1857
1857
  const t = "LIFECYCLE";
1858
1858
  return this.incomingMessages$.pipe(
1859
- f((e) => e.type === t && e.target === "client"),
1859
+ p((e) => e.type === t && e.target === "client"),
1860
1860
  h((e) => e),
1861
1861
  d(this.logReceived(t))
1862
1862
  );
@@ -1896,7 +1896,7 @@ class xt {
1896
1896
  throw new l(this.currentContext);
1897
1897
  const t = "REQUEST LOGS";
1898
1898
  return this.incomingMessages$.pipe(
1899
- f((e) => e.type === t && e.target === "client"),
1899
+ p((e) => e.type === t && e.target === "client"),
1900
1900
  h((e) => e),
1901
1901
  d(this.logReceived(t))
1902
1902
  );
@@ -1952,7 +1952,7 @@ class xt {
1952
1952
  }
1953
1953
  i && (o.shouldOpen = i), this.logCreated(s, o);
1954
1954
  const c = this.incomingMessages$.pipe(
1955
- f((a) => a.type === s && a.replyTo === o.id),
1955
+ p((a) => a.type === s && a.replyTo === o.id),
1956
1956
  d(this.logReceived(s)),
1957
1957
  h((a) => a),
1958
1958
  b(1)
@@ -1992,38 +1992,38 @@ class xt {
1992
1992
  throw new l(this.currentContext);
1993
1993
  const t = "FILE TRANSFER";
1994
1994
  return this.incomingMessages$.pipe(
1995
- f(
1995
+ p(
1996
1996
  (e) => e.type === t && e.target === "client" && e.replyTo === null
1997
1997
  ),
1998
1998
  h((e) => (e.fileHash = e.fileHash.toLowerCase(), e)),
1999
1999
  d(this.logReceived(t))
2000
2000
  );
2001
2001
  }
2002
- sendFileRequestMessage({ fileName: t, fileHash: e, fileSize: r, mimeType: i }, s, o, c) {
2002
+ sendFileRequestMessage(t, e, r, i) {
2003
2003
  if (!this.isEmbedded())
2004
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)
2005
+ const s = "FILE REQUEST", o = this.createMessage(s);
2006
+ if (o.fileHash = t.toLowerCase(), o.intent = e, o.maxChunkSize = i, e === "attachment") {
2007
+ if (!r)
2008
2008
  throw new x(
2009
2009
  "streamId",
2010
- o,
2010
+ r,
2011
2011
  "streamId is required for attachment intent"
2012
2012
  );
2013
- u.streamId = o;
2013
+ o.streamId = r;
2014
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
2015
+ this.logCreated(s, o);
2016
+ let c = 0;
2017
+ const a = this.incomingMessages$.pipe(
2018
+ p(
2019
+ (u) => u.type === s && u.replyTo === o.id
2020
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)
2021
+ d(this.logReceived(s)),
2022
+ d(() => c++),
2023
+ h((u) => (u.result === "success" && (u.chunkHash = u.chunkHash.toLowerCase()), u)),
2024
+ wt((u) => u.result === "success" && c < u.totalChunks)
2025
2025
  );
2026
- return this.port2.postMessage(u), this.logSent(a, u), y;
2026
+ return this.port2.postMessage(o), this.logSent(s, o), a;
2027
2027
  }
2028
2028
  /**
2029
2029
  * Sends a {@link FileSelectionMessage} to the Host app, to request the user to select on or
@@ -2061,12 +2061,12 @@ class xt {
2061
2061
  }
2062
2062
  this.logCreated(o, c);
2063
2063
  const a = this.incomingMessages$.pipe(
2064
- f(
2064
+ p(
2065
2065
  (u) => u.type === o && u.replyTo === c.id
2066
2066
  ),
2067
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;
2068
+ var g, v;
2069
+ return u.files = (g = u.files) == null ? void 0 : g.map((y) => (y.fileHash = y.fileHash.toLowerCase(), y)), u.fileHashes = (v = u.fileHashes) == null ? void 0 : v.map((y) => y.toLowerCase()), u;
2070
2070
  }),
2071
2071
  d(this.logReceived(o)),
2072
2072
  b(1)
@@ -2096,7 +2096,7 @@ class xt {
2096
2096
  const s = "FILE DOWNLOAD", o = this.createMessage(s);
2097
2097
  o.url = t, o.key = e, o.fileName = r, o.mimeType = i, this.logCreated(s, o);
2098
2098
  const c = this.incomingMessages$.pipe(
2099
- f((a) => a.type === s && a.replyTo === o.id),
2099
+ p((a) => a.type === s && a.replyTo === o.id),
2100
2100
  d(this.logReceived(s)),
2101
2101
  h((a) => a),
2102
2102
  b(1)
@@ -2123,7 +2123,7 @@ class xt {
2123
2123
  const r = "FILE OPEN", i = this.createMessage(r, !0);
2124
2124
  i.hash = t.toLowerCase(), i.streamId = e, this.logCreated(r, i);
2125
2125
  const s = this.incomingMessages$.pipe(
2126
- f((o) => o.type === r && o.replyTo === i.id),
2126
+ p((o) => o.type === r && o.replyTo === i.id),
2127
2127
  d(this.logReceived(r)),
2128
2128
  h((o) => o),
2129
2129
  b(1)
@@ -2151,7 +2151,7 @@ class xt {
2151
2151
  const r = "FILE REMOVE", i = this.createMessage(r, !0);
2152
2152
  i.hash = t.toLowerCase(), i.streamId = e, this.logCreated(r, i);
2153
2153
  const s = this.incomingMessages$.pipe(
2154
- f((o) => o.type === r && o.replyTo === i.id),
2154
+ p((o) => o.type === r && o.replyTo === i.id),
2155
2155
  d(this.logReceived(r)),
2156
2156
  h((o) => o),
2157
2157
  b(1)