@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 CHANGED
@@ -4,6 +4,19 @@ All notable changes to `@poolse/sdk` are documented here. Format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
5
5
  [semver](https://semver.org).
6
6
 
7
+ ## [2.14.1] — 2026-08-23
8
+
9
+ ### Fixed
10
+
11
+ - **Device lists came back with no ids and no names.** `listDevices`
12
+ built its result by spreading each `MediaDeviceInfo`, but that is a
13
+ WebIDL interface whose `deviceId`, `kind` and `label` are accessors on
14
+ the _prototype_ — so `{ ...device }` produces `{}`. Every picker was a
15
+ list of blank, unselectable rows. Each field is now read explicitly.
16
+ - Entries with an empty `deviceId` are dropped. A browser returns that
17
+ placeholder for a device the page has not been granted, and offering
18
+ it gives the user a row that cannot be selected.
19
+
7
20
  ## [2.14.0] — 2026-08-23
8
21
 
9
22
  ### Added
package/dist/index.cjs CHANGED
@@ -1660,6 +1660,16 @@ var CallTokensResource = class {
1660
1660
  };
1661
1661
 
1662
1662
  // src/voice/call-room.ts
1663
+ function toDevices(raw, kind) {
1664
+ const out = [];
1665
+ for (const device of raw) {
1666
+ if (device.kind && device.kind !== kind) continue;
1667
+ const deviceId = device.deviceId ?? "";
1668
+ if (!deviceId) continue;
1669
+ out.push({ deviceId, kind, label: device.label ?? "" });
1670
+ }
1671
+ return out;
1672
+ }
1663
1673
  var CallRoom = class {
1664
1674
  livekit;
1665
1675
  tokenProvider;
@@ -1883,14 +1893,13 @@ var CallRoom = class {
1883
1893
  async listDevices(kind) {
1884
1894
  try {
1885
1895
  const fromLiveKit = await this.livekit.Room.getLocalDevices?.(kind, false);
1886
- if (fromLiveKit) return fromLiveKit.map((d) => ({ ...d, kind }));
1896
+ if (fromLiveKit?.length) return toDevices(fromLiveKit, kind);
1887
1897
  } catch {
1888
1898
  }
1889
1899
  const media = globalThis.navigator?.mediaDevices;
1890
1900
  if (!media?.enumerateDevices) return [];
1891
1901
  try {
1892
- const all = await media.enumerateDevices();
1893
- return all.filter((d) => d.kind === kind).map((d) => ({ deviceId: d.deviceId, kind, label: d.label }));
1902
+ return toDevices(await media.enumerateDevices(), kind);
1894
1903
  } catch {
1895
1904
  return [];
1896
1905
  }
@@ -2426,7 +2435,7 @@ var Poolse = class {
2426
2435
  };
2427
2436
 
2428
2437
  // src/version.ts
2429
- var version = "2.14.0";
2438
+ var version = "2.14.1";
2430
2439
 
2431
2440
  exports.ApiError = ApiError;
2432
2441
  exports.AttachmentHandle = AttachmentHandle;