@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.
@@ -1,8 +1,7 @@
1
- import { P as PalbeConfig, d as PalbeRuntime } from './analytics-facade-BOxQ8IP2.cjs';
2
- export { e as buildRuntime } from './analytics-facade-BOxQ8IP2.cjs';
1
+ import { P as PalbeConfig } from './analytics-facade-DwOtlXPP.cjs';
2
+ export { d as PalbeRuntime, e as buildRuntime } from './analytics-facade-DwOtlXPP.cjs';
3
3
  import { B as BackendError } from './errors-fDoNdTrJ.cjs';
4
- export { P as PB, c as createBoundClient } from './pb-B3h3NIPE.cjs';
5
- import 'livekit-client';
4
+ export { P as PB, c as createBoundClient } from './pb-C9v5dEO6.cjs';
6
5
  import './storage-BPaeSG8K.cjs';
7
6
  import './pooled-flags-4GtDtsiu.js';
8
7
 
@@ -31,18 +30,7 @@ declare function __registerNamespaces(tree: NamespaceTree): void;
31
30
  * gen file re-registers its static descriptors right after.
32
31
  */
33
32
  declare function __configure(config: PalbeConfig): void;
34
- /**
35
- * Register a callback that fires synchronously after every successful
36
- * `__configure` call (including re-configure / watch-mode regen).
37
- *
38
- * Returns an unsubscribe function. Safe to call before the first `__configure`.
39
- *
40
- * @internal — consumed by `palbe/react`; not part of the public `palbe` surface.
41
- */
42
- declare function onConfigured(cb: () => void): () => void;
43
- /** @internal */
44
- declare function getRuntime(): PalbeRuntime;
45
33
  /** Test-only: drop runtime + registered namespaces. */
46
34
  declare function __reset(): void;
47
35
 
48
- export { type EndpointDescriptor, type NamespaceTree, PalbeConfig, PalbeRuntime, __configure, __registerNamespaces, __reset, getRuntime, onConfigured };
36
+ export { type EndpointDescriptor, type NamespaceTree, PalbeConfig, __configure, __registerNamespaces, __reset };
@@ -1,8 +1,7 @@
1
- import { P as PalbeConfig, d as PalbeRuntime } from './analytics-facade-yfMJ69vw.js';
2
- export { e as buildRuntime } from './analytics-facade-yfMJ69vw.js';
1
+ import { P as PalbeConfig } from './analytics-facade-Nk6J9Ncm.js';
2
+ export { d as PalbeRuntime, e as buildRuntime } from './analytics-facade-Nk6J9Ncm.js';
3
3
  import { B as BackendError } from './errors-fDoNdTrJ.js';
4
- export { P as PB, c as createBoundClient } from './pb-QRISxPd1.js';
5
- import 'livekit-client';
4
+ export { P as PB, c as createBoundClient } from './pb-FG_nV7NR.js';
6
5
  import './storage-BPaeSG8K.js';
7
6
  import './pooled-flags-4GtDtsiu.js';
8
7
 
@@ -31,18 +30,7 @@ declare function __registerNamespaces(tree: NamespaceTree): void;
31
30
  * gen file re-registers its static descriptors right after.
32
31
  */
33
32
  declare function __configure(config: PalbeConfig): void;
34
- /**
35
- * Register a callback that fires synchronously after every successful
36
- * `__configure` call (including re-configure / watch-mode regen).
37
- *
38
- * Returns an unsubscribe function. Safe to call before the first `__configure`.
39
- *
40
- * @internal — consumed by `palbe/react`; not part of the public `palbe` surface.
41
- */
42
- declare function onConfigured(cb: () => void): () => void;
43
- /** @internal */
44
- declare function getRuntime(): PalbeRuntime;
45
33
  /** Test-only: drop runtime + registered namespaces. */
46
34
  declare function __reset(): void;
47
35
 
48
- export { type EndpointDescriptor, type NamespaceTree, PalbeConfig, PalbeRuntime, __configure, __registerNamespaces, __reset, getRuntime, onConfigured };
36
+ export { type EndpointDescriptor, type NamespaceTree, PalbeConfig, __configure, __registerNamespaces, __reset };
package/dist/internal.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  createBoundClient,
7
7
  getRuntime,
8
8
  onConfigured
9
- } from "./chunk-3HVTEZ7N.js";
9
+ } from "./chunk-NP4NIY7A.js";
10
10
  import "./chunk-S7NAY3MW.js";
11
11
  export {
12
12
  __configure,
@@ -1564,19 +1564,29 @@ var PalbeAuth = class {
1564
1564
 
1565
1565
  // src/calls/facade.ts
1566
1566
  var import_livekit_client = require("livekit-client");
1567
- var Call = class {
1567
+ var Call = class _Call {
1568
1568
  id;
1569
1569
  _state = "connecting";
1570
1570
  _participants = /* @__PURE__ */ new Map();
1571
1571
  _listeners = /* @__PURE__ */ new Set();
1572
1572
  _room;
1573
1573
  _keyProvider;
1574
- /** @internal obtain via PalbeCalls.start() / .accept() */
1574
+ // PRIVATE constructor + `@internal` factory: the media-engine types (`Room`,
1575
+ // `ExternalE2EEKeyProvider`) appear ONLY on a private constructor and an
1576
+ // `@internal` static factory, both of which `stripInternal` (set in this
1577
+ // package's tsconfig) removes from the emitted public `.d.ts`. So no engine type
1578
+ // ever reaches the public API surface — the same "no engine type in the public
1579
+ // interface" contract the iOS SDK enforces. Consumers obtain a `Call` only
1580
+ // through `pb.calls.start()` / `.accept()`.
1575
1581
  constructor(callId, room, keyProvider) {
1576
1582
  this.id = callId;
1577
1583
  this._room = room;
1578
1584
  this._keyProvider = keyProvider;
1579
- this._wireRoomEvents();
1585
+ this._wireMediaEvents();
1586
+ }
1587
+ /** @internal — facade-only factory; stripped from the public `.d.ts`. */
1588
+ static _create(callId, room, keyProvider) {
1589
+ return new _Call(callId, room, keyProvider);
1580
1590
  }
1581
1591
  // ─── State ──────────────────────────────────────────────────────────────
1582
1592
  get state() {
@@ -1586,9 +1596,9 @@ var Call = class {
1586
1596
  get participants() {
1587
1597
  return Array.from(this._participants.values());
1588
1598
  }
1589
- get localParticipant() {
1590
- return this._room.localParticipant;
1591
- }
1599
+ // (No `localParticipant` accessor: it would return a raw media-engine participant
1600
+ // object and leak the engine type onto the public API. Local mic/camera control is
1601
+ // exposed engine-agnostically via `mute()` / `setCamera()` below.)
1592
1602
  // ─── Subscribe ──────────────────────────────────────────────────────────
1593
1603
  /**
1594
1604
  * Subscribe to call changes (state + participant updates).
@@ -1612,7 +1622,7 @@ var Call = class {
1612
1622
  /**
1613
1623
  * Set a raw frame encryption key (ArrayBuffer) for this call.
1614
1624
  * Design seam for SP-1.x web-MLS: call this with the MLS exporter secret
1615
- * to enable frame-level E2EE via ExternalE2EEKeyProvider.
1625
+ * to enable frame-level E2EE via the media engine's external key provider.
1616
1626
  *
1617
1627
  * NOTE: The room must have been opened with `e2ee` options for this to take
1618
1628
  * effect. Currently calls connect WITHOUT e2ee — see module docstring.
@@ -1622,7 +1632,7 @@ var Call = class {
1622
1632
  async setMediaKey(key) {
1623
1633
  await this._keyProvider.setKey(key);
1624
1634
  }
1625
- /** Leave the call and disconnect from the LiveKit room. */
1635
+ /** Leave the call and disconnect from the media room. */
1626
1636
  async leave() {
1627
1637
  await this._room.disconnect();
1628
1638
  this._setState("ended");
@@ -1664,7 +1674,7 @@ var Call = class {
1664
1674
  }
1665
1675
  this._emit();
1666
1676
  }
1667
- _wireRoomEvents() {
1677
+ _wireMediaEvents() {
1668
1678
  this._room.on(import_livekit_client.RoomEvent.Connected, () => {
1669
1679
  this._setState("active");
1670
1680
  }).on(
@@ -1705,9 +1715,9 @@ var PalbeCalls = class {
1705
1715
  *
1706
1716
  * @param groupId - Messaging group display-id (`grp_<uuidv7>`)
1707
1717
  * @param media - Which media tracks to publish (default: audio + video)
1708
- * @returns A `Call` in `connecting` state; transitions to `active` once LiveKit connects.
1718
+ * @returns A `Call` in `connecting` state; transitions to `active` once the media room connects.
1709
1719
  *
1710
- * @throws BackendError('network', { code: 'call_service_unavailable' }) if LiveKit SFU is down (503)
1720
+ * @throws BackendError('network', { code: 'call_service_unavailable' }) if the SFU is down (503)
1711
1721
  * @throws BackendError('forbidden', { code: 'not_group_member' }) if the caller is not a member (403)
1712
1722
  * @throws BackendError('conflict', { code: 'call_room_full' }) if the room is full (409)
1713
1723
  */
@@ -1764,7 +1774,7 @@ var PalbeCalls = class {
1764
1774
  adaptiveStream: true,
1765
1775
  dynacast: true
1766
1776
  });
1767
- const call = new Call(callId, room, keyProvider);
1777
+ const call = Call._create(callId, room, keyProvider);
1768
1778
  await room.connect(edgeUrl, token);
1769
1779
  if (media.includes("audio")) {
1770
1780
  await room.localParticipant.setMicrophoneEnabled(true);
@@ -8754,7 +8764,7 @@ function defaultSessionStorage(key) {
8754
8764
  }
8755
8765
 
8756
8766
  // src/version.ts
8757
- var VERSION = "3.0.0";
8767
+ var VERSION = "4.0.0";
8758
8768
 
8759
8769
  // src/runtime.ts
8760
8770
  function buildRuntime(config) {