@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.
- package/dist/{analytics-facade-BOxQ8IP2.d.cts → analytics-facade-DwOtlXPP.d.cts} +5 -87
- package/dist/{analytics-facade-yfMJ69vw.d.ts → analytics-facade-Nk6J9Ncm.d.ts} +5 -87
- package/dist/{chunk-3HVTEZ7N.js → chunk-NP4NIY7A.js} +24 -14
- package/dist/chunk-NP4NIY7A.js.map +1 -0
- package/dist/index.cjs +23 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.js +1 -1
- package/dist/internal.cjs +23 -13
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +4 -16
- package/dist/internal.d.ts +4 -16
- package/dist/internal.js +1 -1
- package/dist/next/client.cjs +23 -13
- package/dist/next/client.cjs.map +1 -1
- package/dist/next/client.js +1 -1
- package/dist/next/index.cjs +23 -13
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.d.cts +2 -3
- package/dist/next/index.d.ts +2 -3
- package/dist/next/index.js +1 -1
- package/dist/{pb-B3h3NIPE.d.cts → pb-C9v5dEO6.d.cts} +1 -1
- package/dist/{pb-QRISxPd1.d.ts → pb-FG_nV7NR.d.ts} +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +1 -2
- package/dist/react/index.d.ts +1 -2
- package/dist/react/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-3HVTEZ7N.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -765,19 +765,29 @@ var PalbeAuth = class {
|
|
|
765
765
|
|
|
766
766
|
// src/calls/facade.ts
|
|
767
767
|
var import_livekit_client = require("livekit-client");
|
|
768
|
-
var Call = class {
|
|
768
|
+
var Call = class _Call {
|
|
769
769
|
id;
|
|
770
770
|
_state = "connecting";
|
|
771
771
|
_participants = /* @__PURE__ */ new Map();
|
|
772
772
|
_listeners = /* @__PURE__ */ new Set();
|
|
773
773
|
_room;
|
|
774
774
|
_keyProvider;
|
|
775
|
-
|
|
775
|
+
// PRIVATE constructor + `@internal` factory: the media-engine types (`Room`,
|
|
776
|
+
// `ExternalE2EEKeyProvider`) appear ONLY on a private constructor and an
|
|
777
|
+
// `@internal` static factory, both of which `stripInternal` (set in this
|
|
778
|
+
// package's tsconfig) removes from the emitted public `.d.ts`. So no engine type
|
|
779
|
+
// ever reaches the public API surface — the same "no engine type in the public
|
|
780
|
+
// interface" contract the iOS SDK enforces. Consumers obtain a `Call` only
|
|
781
|
+
// through `pb.calls.start()` / `.accept()`.
|
|
776
782
|
constructor(callId, room, keyProvider) {
|
|
777
783
|
this.id = callId;
|
|
778
784
|
this._room = room;
|
|
779
785
|
this._keyProvider = keyProvider;
|
|
780
|
-
this.
|
|
786
|
+
this._wireMediaEvents();
|
|
787
|
+
}
|
|
788
|
+
/** @internal — facade-only factory; stripped from the public `.d.ts`. */
|
|
789
|
+
static _create(callId, room, keyProvider) {
|
|
790
|
+
return new _Call(callId, room, keyProvider);
|
|
781
791
|
}
|
|
782
792
|
// ─── State ──────────────────────────────────────────────────────────────
|
|
783
793
|
get state() {
|
|
@@ -787,9 +797,9 @@ var Call = class {
|
|
|
787
797
|
get participants() {
|
|
788
798
|
return Array.from(this._participants.values());
|
|
789
799
|
}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
800
|
+
// (No `localParticipant` accessor: it would return a raw media-engine participant
|
|
801
|
+
// object and leak the engine type onto the public API. Local mic/camera control is
|
|
802
|
+
// exposed engine-agnostically via `mute()` / `setCamera()` below.)
|
|
793
803
|
// ─── Subscribe ──────────────────────────────────────────────────────────
|
|
794
804
|
/**
|
|
795
805
|
* Subscribe to call changes (state + participant updates).
|
|
@@ -813,7 +823,7 @@ var Call = class {
|
|
|
813
823
|
/**
|
|
814
824
|
* Set a raw frame encryption key (ArrayBuffer) for this call.
|
|
815
825
|
* Design seam for SP-1.x web-MLS: call this with the MLS exporter secret
|
|
816
|
-
* to enable frame-level E2EE via
|
|
826
|
+
* to enable frame-level E2EE via the media engine's external key provider.
|
|
817
827
|
*
|
|
818
828
|
* NOTE: The room must have been opened with `e2ee` options for this to take
|
|
819
829
|
* effect. Currently calls connect WITHOUT e2ee — see module docstring.
|
|
@@ -823,7 +833,7 @@ var Call = class {
|
|
|
823
833
|
async setMediaKey(key) {
|
|
824
834
|
await this._keyProvider.setKey(key);
|
|
825
835
|
}
|
|
826
|
-
/** Leave the call and disconnect from the
|
|
836
|
+
/** Leave the call and disconnect from the media room. */
|
|
827
837
|
async leave() {
|
|
828
838
|
await this._room.disconnect();
|
|
829
839
|
this._setState("ended");
|
|
@@ -865,7 +875,7 @@ var Call = class {
|
|
|
865
875
|
}
|
|
866
876
|
this._emit();
|
|
867
877
|
}
|
|
868
|
-
|
|
878
|
+
_wireMediaEvents() {
|
|
869
879
|
this._room.on(import_livekit_client.RoomEvent.Connected, () => {
|
|
870
880
|
this._setState("active");
|
|
871
881
|
}).on(
|
|
@@ -906,9 +916,9 @@ var PalbeCalls = class {
|
|
|
906
916
|
*
|
|
907
917
|
* @param groupId - Messaging group display-id (`grp_<uuidv7>`)
|
|
908
918
|
* @param media - Which media tracks to publish (default: audio + video)
|
|
909
|
-
* @returns A `Call` in `connecting` state; transitions to `active` once
|
|
919
|
+
* @returns A `Call` in `connecting` state; transitions to `active` once the media room connects.
|
|
910
920
|
*
|
|
911
|
-
* @throws BackendError('network', { code: 'call_service_unavailable' }) if
|
|
921
|
+
* @throws BackendError('network', { code: 'call_service_unavailable' }) if the SFU is down (503)
|
|
912
922
|
* @throws BackendError('forbidden', { code: 'not_group_member' }) if the caller is not a member (403)
|
|
913
923
|
* @throws BackendError('conflict', { code: 'call_room_full' }) if the room is full (409)
|
|
914
924
|
*/
|
|
@@ -965,7 +975,7 @@ var PalbeCalls = class {
|
|
|
965
975
|
adaptiveStream: true,
|
|
966
976
|
dynacast: true
|
|
967
977
|
});
|
|
968
|
-
const call =
|
|
978
|
+
const call = Call._create(callId, room, keyProvider);
|
|
969
979
|
await room.connect(edgeUrl, token);
|
|
970
980
|
if (media.includes("audio")) {
|
|
971
981
|
await room.localParticipant.setMicrophoneEnabled(true);
|
|
@@ -7611,7 +7621,7 @@ function localStorageSessionStorage(key = DEFAULT_KEY) {
|
|
|
7611
7621
|
}
|
|
7612
7622
|
|
|
7613
7623
|
// src/version.ts
|
|
7614
|
-
var VERSION = "
|
|
7624
|
+
var VERSION = "4.0.0";
|
|
7615
7625
|
|
|
7616
7626
|
// src/internal.ts
|
|
7617
7627
|
function getRuntime() {
|