@palbase/web 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  __configure,
8
8
  getRuntime
9
- } from "../chunk-3HVTEZ7N.js";
9
+ } from "../chunk-NP4NIY7A.js";
10
10
  import "../chunk-S7NAY3MW.js";
11
11
 
12
12
  // src/next/client.ts
@@ -1784,19 +1784,29 @@ var PalbeAuth = class {
1784
1784
 
1785
1785
  // src/calls/facade.ts
1786
1786
  var import_livekit_client = require("livekit-client");
1787
- var Call = class {
1787
+ var Call = class _Call {
1788
1788
  id;
1789
1789
  _state = "connecting";
1790
1790
  _participants = /* @__PURE__ */ new Map();
1791
1791
  _listeners = /* @__PURE__ */ new Set();
1792
1792
  _room;
1793
1793
  _keyProvider;
1794
- /** @internal obtain via PalbeCalls.start() / .accept() */
1794
+ // PRIVATE constructor + `@internal` factory: the media-engine types (`Room`,
1795
+ // `ExternalE2EEKeyProvider`) appear ONLY on a private constructor and an
1796
+ // `@internal` static factory, both of which `stripInternal` (set in this
1797
+ // package's tsconfig) removes from the emitted public `.d.ts`. So no engine type
1798
+ // ever reaches the public API surface — the same "no engine type in the public
1799
+ // interface" contract the iOS SDK enforces. Consumers obtain a `Call` only
1800
+ // through `pb.calls.start()` / `.accept()`.
1795
1801
  constructor(callId, room, keyProvider) {
1796
1802
  this.id = callId;
1797
1803
  this._room = room;
1798
1804
  this._keyProvider = keyProvider;
1799
- this._wireRoomEvents();
1805
+ this._wireMediaEvents();
1806
+ }
1807
+ /** @internal — facade-only factory; stripped from the public `.d.ts`. */
1808
+ static _create(callId, room, keyProvider) {
1809
+ return new _Call(callId, room, keyProvider);
1800
1810
  }
1801
1811
  // ─── State ──────────────────────────────────────────────────────────────
1802
1812
  get state() {
@@ -1806,9 +1816,9 @@ var Call = class {
1806
1816
  get participants() {
1807
1817
  return Array.from(this._participants.values());
1808
1818
  }
1809
- get localParticipant() {
1810
- return this._room.localParticipant;
1811
- }
1819
+ // (No `localParticipant` accessor: it would return a raw media-engine participant
1820
+ // object and leak the engine type onto the public API. Local mic/camera control is
1821
+ // exposed engine-agnostically via `mute()` / `setCamera()` below.)
1812
1822
  // ─── Subscribe ──────────────────────────────────────────────────────────
1813
1823
  /**
1814
1824
  * Subscribe to call changes (state + participant updates).
@@ -1832,7 +1842,7 @@ var Call = class {
1832
1842
  /**
1833
1843
  * Set a raw frame encryption key (ArrayBuffer) for this call.
1834
1844
  * Design seam for SP-1.x web-MLS: call this with the MLS exporter secret
1835
- * to enable frame-level E2EE via ExternalE2EEKeyProvider.
1845
+ * to enable frame-level E2EE via the media engine's external key provider.
1836
1846
  *
1837
1847
  * NOTE: The room must have been opened with `e2ee` options for this to take
1838
1848
  * effect. Currently calls connect WITHOUT e2ee — see module docstring.
@@ -1842,7 +1852,7 @@ var Call = class {
1842
1852
  async setMediaKey(key) {
1843
1853
  await this._keyProvider.setKey(key);
1844
1854
  }
1845
- /** Leave the call and disconnect from the LiveKit room. */
1855
+ /** Leave the call and disconnect from the media room. */
1846
1856
  async leave() {
1847
1857
  await this._room.disconnect();
1848
1858
  this._setState("ended");
@@ -1884,7 +1894,7 @@ var Call = class {
1884
1894
  }
1885
1895
  this._emit();
1886
1896
  }
1887
- _wireRoomEvents() {
1897
+ _wireMediaEvents() {
1888
1898
  this._room.on(import_livekit_client.RoomEvent.Connected, () => {
1889
1899
  this._setState("active");
1890
1900
  }).on(
@@ -1925,9 +1935,9 @@ var PalbeCalls = class {
1925
1935
  *
1926
1936
  * @param groupId - Messaging group display-id (`grp_<uuidv7>`)
1927
1937
  * @param media - Which media tracks to publish (default: audio + video)
1928
- * @returns A `Call` in `connecting` state; transitions to `active` once LiveKit connects.
1938
+ * @returns A `Call` in `connecting` state; transitions to `active` once the media room connects.
1929
1939
  *
1930
- * @throws BackendError('network', { code: 'call_service_unavailable' }) if LiveKit SFU is down (503)
1940
+ * @throws BackendError('network', { code: 'call_service_unavailable' }) if the SFU is down (503)
1931
1941
  * @throws BackendError('forbidden', { code: 'not_group_member' }) if the caller is not a member (403)
1932
1942
  * @throws BackendError('conflict', { code: 'call_room_full' }) if the room is full (409)
1933
1943
  */
@@ -1984,7 +1994,7 @@ var PalbeCalls = class {
1984
1994
  adaptiveStream: true,
1985
1995
  dynacast: true
1986
1996
  });
1987
- const call = new Call(callId, room, keyProvider);
1997
+ const call = Call._create(callId, room, keyProvider);
1988
1998
  await room.connect(edgeUrl, token);
1989
1999
  if (media.includes("audio")) {
1990
2000
  await room.localParticipant.setMicrophoneEnabled(true);
@@ -8974,7 +8984,7 @@ function defaultSessionStorage(key) {
8974
8984
  }
8975
8985
 
8976
8986
  // src/version.ts
8977
- var VERSION = "3.0.0";
8987
+ var VERSION = "4.0.0";
8978
8988
 
8979
8989
  // src/runtime.ts
8980
8990
  function buildRuntime(config) {