@poolse/sdk 2.14.0 → 2.14.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/CHANGELOG.md +13 -0
- package/dist/index.cjs +13 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -35
- package/dist/index.d.ts +11 -35
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1590,8 +1590,17 @@ interface CheckedLiveKitModule {
|
|
|
1590
1590
|
* Optional because it is a static on livekit-client's `Room`, and
|
|
1591
1591
|
* `CallRoom` falls back to `navigator.mediaDevices` where it is
|
|
1592
1592
|
* absent rather than losing the picker entirely.
|
|
1593
|
+
*
|
|
1594
|
+
* Typed as the raw device shape, NOT as {@link CallDevice}. These
|
|
1595
|
+
* are `MediaDeviceInfo` instances, whose fields are accessors on the
|
|
1596
|
+
* prototype — declaring them as plain objects invites the spread
|
|
1597
|
+
* that silently loses every id and label.
|
|
1593
1598
|
*/
|
|
1594
|
-
getLocalDevices?(kind?: string, requestPermissions?: boolean): Promise<
|
|
1599
|
+
getLocalDevices?(kind?: string, requestPermissions?: boolean): Promise<readonly {
|
|
1600
|
+
deviceId?: string;
|
|
1601
|
+
kind?: string;
|
|
1602
|
+
label?: string;
|
|
1603
|
+
}[]>;
|
|
1595
1604
|
};
|
|
1596
1605
|
RoomEvent: Record<string, string>;
|
|
1597
1606
|
Track: {
|
|
@@ -1709,39 +1718,6 @@ declare class CallTokensResource {
|
|
|
1709
1718
|
}
|
|
1710
1719
|
|
|
1711
1720
|
type Unsubscribe = () => void;
|
|
1712
|
-
/**
|
|
1713
|
-
* A call's media, carried by the LiveKit SFU.
|
|
1714
|
-
*
|
|
1715
|
-
* ## What this is not
|
|
1716
|
-
*
|
|
1717
|
-
* It is not the call. Ringing, accept/decline/hangup, presence, the
|
|
1718
|
-
* roster and mute state all stay on poolse's own channels — see
|
|
1719
|
-
* `CallsResource` and `VoiceRoom`. This object owns audio and video
|
|
1720
|
-
* packets and nothing else. A client joins both: `voice:conversation:<id>`
|
|
1721
|
-
* for who is here and what they are doing, this for what they sound and
|
|
1722
|
-
* look like.
|
|
1723
|
-
*
|
|
1724
|
-
* ## Why an SFU rather than the mesh
|
|
1725
|
-
*
|
|
1726
|
-
* {@link VoiceRoom} connects every participant to every other one, so
|
|
1727
|
-
* each uploads N-1 encoded copies of their own camera. At four people
|
|
1728
|
-
* that is roughly 3 Mbps of sustained upload from a phone plus three
|
|
1729
|
-
* simultaneous encodes — the handset overheats, iOS throttles, and
|
|
1730
|
-
* quality collapses for everyone. Audio survives it because Opus is
|
|
1731
|
-
* ~25x cheaper; video does not.
|
|
1732
|
-
*
|
|
1733
|
-
* The SFU also makes the mid-call camera toggle tractable. Turning a
|
|
1734
|
-
* camera on mid-call means renegotiating a live peer connection, which
|
|
1735
|
-
* the mesh cannot do — it offers once, on peer discovery. Here it is
|
|
1736
|
-
* `setCameraEnabled`.
|
|
1737
|
-
*
|
|
1738
|
-
* ## Availability
|
|
1739
|
-
*
|
|
1740
|
-
* A deployment with no SFU configured answers 503, which arrives as
|
|
1741
|
-
* `tokenProvider` returning `null`. That is not an error: the caller
|
|
1742
|
-
* falls back to the mesh, which is what every call used before this
|
|
1743
|
-
* existed. `join()` resolves `false` to say so.
|
|
1744
|
-
*/
|
|
1745
1721
|
declare class CallRoom {
|
|
1746
1722
|
private readonly livekit;
|
|
1747
1723
|
private readonly tokenProvider;
|
|
@@ -2041,7 +2017,7 @@ declare class AuthError extends ApiError {
|
|
|
2041
2017
|
declare function isWebRtcAvailable(): boolean;
|
|
2042
2018
|
declare function createBrowserWebRtcAdapter(): WebRtcAdapter;
|
|
2043
2019
|
|
|
2044
|
-
declare const version = "2.14.
|
|
2020
|
+
declare const version = "2.14.1";
|
|
2045
2021
|
|
|
2046
2022
|
declare function safeUuid(): string;
|
|
2047
2023
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1590,8 +1590,17 @@ interface CheckedLiveKitModule {
|
|
|
1590
1590
|
* Optional because it is a static on livekit-client's `Room`, and
|
|
1591
1591
|
* `CallRoom` falls back to `navigator.mediaDevices` where it is
|
|
1592
1592
|
* absent rather than losing the picker entirely.
|
|
1593
|
+
*
|
|
1594
|
+
* Typed as the raw device shape, NOT as {@link CallDevice}. These
|
|
1595
|
+
* are `MediaDeviceInfo` instances, whose fields are accessors on the
|
|
1596
|
+
* prototype — declaring them as plain objects invites the spread
|
|
1597
|
+
* that silently loses every id and label.
|
|
1593
1598
|
*/
|
|
1594
|
-
getLocalDevices?(kind?: string, requestPermissions?: boolean): Promise<
|
|
1599
|
+
getLocalDevices?(kind?: string, requestPermissions?: boolean): Promise<readonly {
|
|
1600
|
+
deviceId?: string;
|
|
1601
|
+
kind?: string;
|
|
1602
|
+
label?: string;
|
|
1603
|
+
}[]>;
|
|
1595
1604
|
};
|
|
1596
1605
|
RoomEvent: Record<string, string>;
|
|
1597
1606
|
Track: {
|
|
@@ -1709,39 +1718,6 @@ declare class CallTokensResource {
|
|
|
1709
1718
|
}
|
|
1710
1719
|
|
|
1711
1720
|
type Unsubscribe = () => void;
|
|
1712
|
-
/**
|
|
1713
|
-
* A call's media, carried by the LiveKit SFU.
|
|
1714
|
-
*
|
|
1715
|
-
* ## What this is not
|
|
1716
|
-
*
|
|
1717
|
-
* It is not the call. Ringing, accept/decline/hangup, presence, the
|
|
1718
|
-
* roster and mute state all stay on poolse's own channels — see
|
|
1719
|
-
* `CallsResource` and `VoiceRoom`. This object owns audio and video
|
|
1720
|
-
* packets and nothing else. A client joins both: `voice:conversation:<id>`
|
|
1721
|
-
* for who is here and what they are doing, this for what they sound and
|
|
1722
|
-
* look like.
|
|
1723
|
-
*
|
|
1724
|
-
* ## Why an SFU rather than the mesh
|
|
1725
|
-
*
|
|
1726
|
-
* {@link VoiceRoom} connects every participant to every other one, so
|
|
1727
|
-
* each uploads N-1 encoded copies of their own camera. At four people
|
|
1728
|
-
* that is roughly 3 Mbps of sustained upload from a phone plus three
|
|
1729
|
-
* simultaneous encodes — the handset overheats, iOS throttles, and
|
|
1730
|
-
* quality collapses for everyone. Audio survives it because Opus is
|
|
1731
|
-
* ~25x cheaper; video does not.
|
|
1732
|
-
*
|
|
1733
|
-
* The SFU also makes the mid-call camera toggle tractable. Turning a
|
|
1734
|
-
* camera on mid-call means renegotiating a live peer connection, which
|
|
1735
|
-
* the mesh cannot do — it offers once, on peer discovery. Here it is
|
|
1736
|
-
* `setCameraEnabled`.
|
|
1737
|
-
*
|
|
1738
|
-
* ## Availability
|
|
1739
|
-
*
|
|
1740
|
-
* A deployment with no SFU configured answers 503, which arrives as
|
|
1741
|
-
* `tokenProvider` returning `null`. That is not an error: the caller
|
|
1742
|
-
* falls back to the mesh, which is what every call used before this
|
|
1743
|
-
* existed. `join()` resolves `false` to say so.
|
|
1744
|
-
*/
|
|
1745
1721
|
declare class CallRoom {
|
|
1746
1722
|
private readonly livekit;
|
|
1747
1723
|
private readonly tokenProvider;
|
|
@@ -2041,7 +2017,7 @@ declare class AuthError extends ApiError {
|
|
|
2041
2017
|
declare function isWebRtcAvailable(): boolean;
|
|
2042
2018
|
declare function createBrowserWebRtcAdapter(): WebRtcAdapter;
|
|
2043
2019
|
|
|
2044
|
-
declare const version = "2.14.
|
|
2020
|
+
declare const version = "2.14.1";
|
|
2045
2021
|
|
|
2046
2022
|
declare function safeUuid(): string;
|
|
2047
2023
|
|
package/dist/index.js
CHANGED
|
@@ -1658,6 +1658,16 @@ var CallTokensResource = class {
|
|
|
1658
1658
|
};
|
|
1659
1659
|
|
|
1660
1660
|
// src/voice/call-room.ts
|
|
1661
|
+
function toDevices(raw, kind) {
|
|
1662
|
+
const out = [];
|
|
1663
|
+
for (const device of raw) {
|
|
1664
|
+
if (device.kind && device.kind !== kind) continue;
|
|
1665
|
+
const deviceId = device.deviceId ?? "";
|
|
1666
|
+
if (!deviceId) continue;
|
|
1667
|
+
out.push({ deviceId, kind, label: device.label ?? "" });
|
|
1668
|
+
}
|
|
1669
|
+
return out;
|
|
1670
|
+
}
|
|
1661
1671
|
var CallRoom = class {
|
|
1662
1672
|
livekit;
|
|
1663
1673
|
tokenProvider;
|
|
@@ -1881,14 +1891,13 @@ var CallRoom = class {
|
|
|
1881
1891
|
async listDevices(kind) {
|
|
1882
1892
|
try {
|
|
1883
1893
|
const fromLiveKit = await this.livekit.Room.getLocalDevices?.(kind, false);
|
|
1884
|
-
if (fromLiveKit) return fromLiveKit
|
|
1894
|
+
if (fromLiveKit?.length) return toDevices(fromLiveKit, kind);
|
|
1885
1895
|
} catch {
|
|
1886
1896
|
}
|
|
1887
1897
|
const media = globalThis.navigator?.mediaDevices;
|
|
1888
1898
|
if (!media?.enumerateDevices) return [];
|
|
1889
1899
|
try {
|
|
1890
|
-
|
|
1891
|
-
return all.filter((d) => d.kind === kind).map((d) => ({ deviceId: d.deviceId, kind, label: d.label }));
|
|
1900
|
+
return toDevices(await media.enumerateDevices(), kind);
|
|
1892
1901
|
} catch {
|
|
1893
1902
|
return [];
|
|
1894
1903
|
}
|
|
@@ -2424,7 +2433,7 @@ var Poolse = class {
|
|
|
2424
2433
|
};
|
|
2425
2434
|
|
|
2426
2435
|
// src/version.ts
|
|
2427
|
-
var version = "2.14.
|
|
2436
|
+
var version = "2.14.1";
|
|
2428
2437
|
|
|
2429
2438
|
export { ApiError, AttachmentHandle, AttachmentsResource, AuthError, CallRoom, CallTokensResource, CallsResource, ConversationChannel, ConversationHandle, ConversationMessages, ConversationsResource, DevicesResource, IceServersResource, MeResource, MessageHandle, MessagesResource, NetworkError, POOLSE_API_URL, Poolse, PoolseError, PoolseRealtime, RateLimitedError, UserChannel, UsersResource, VoiceRoom, createBrowserWebRtcAdapter, isWebRtcAvailable, safeUuid, version };
|
|
2430
2439
|
//# sourceMappingURL=index.js.map
|