@soundretouch/api 1.3.0 → 1.4.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/index.device.d.ts +1 -1
- package/dist/index.device.d.ts.map +1 -1
- package/dist/src/device/SoundTouchDevice.d.ts +14 -0
- package/dist/src/device/SoundTouchDevice.d.ts.map +1 -1
- package/dist/src/device/SoundTouchDevice.js +39 -107
- package/dist/src/device/SoundTouchDevice.js.map +1 -1
- package/dist/src/endpoints/bass.d.ts +9 -0
- package/dist/src/endpoints/bass.d.ts.map +1 -1
- package/dist/src/endpoints/bass.js +15 -0
- package/dist/src/endpoints/bass.js.map +1 -1
- package/dist/src/endpoints/info.d.ts +9 -0
- package/dist/src/endpoints/info.d.ts.map +1 -1
- package/dist/src/endpoints/info.js +15 -0
- package/dist/src/endpoints/info.js.map +1 -1
- package/dist/src/endpoints/nowPlaying.d.ts +9 -0
- package/dist/src/endpoints/nowPlaying.d.ts.map +1 -1
- package/dist/src/endpoints/nowPlaying.js +20 -2
- package/dist/src/endpoints/nowPlaying.js.map +1 -1
- package/dist/src/endpoints/presets.d.ts +18 -1
- package/dist/src/endpoints/presets.d.ts.map +1 -1
- package/dist/src/endpoints/presets.js +42 -2
- package/dist/src/endpoints/presets.js.map +1 -1
- package/dist/src/endpoints/sources.d.ts +9 -0
- package/dist/src/endpoints/sources.d.ts.map +1 -1
- package/dist/src/endpoints/sources.js +19 -2
- package/dist/src/endpoints/sources.js.map +1 -1
- package/dist/src/endpoints/trackInfo.d.ts.map +1 -1
- package/dist/src/endpoints/trackInfo.js +4 -2
- package/dist/src/endpoints/trackInfo.js.map +1 -1
- package/dist/src/endpoints/updates.d.ts +59 -0
- package/dist/src/endpoints/updates.d.ts.map +1 -0
- package/dist/src/endpoints/updates.js +107 -0
- package/dist/src/endpoints/updates.js.map +1 -0
- package/dist/src/endpoints/userTrackControl.d.ts +16 -0
- package/dist/src/endpoints/userTrackControl.d.ts.map +1 -0
- package/dist/src/endpoints/userTrackControl.js +25 -0
- package/dist/src/endpoints/userTrackControl.js.map +1 -0
- package/dist/src/endpoints/volume.d.ts +9 -0
- package/dist/src/endpoints/volume.d.ts.map +1 -1
- package/dist/src/endpoints/volume.js +17 -0
- package/dist/src/endpoints/volume.js.map +1 -1
- package/dist/src/endpoints/zone.d.ts +9 -0
- package/dist/src/endpoints/zone.d.ts.map +1 -1
- package/dist/src/endpoints/zone.js +19 -2
- package/dist/src/endpoints/zone.js.map +1 -1
- package/dist/src/types/Enums.d.ts +1 -0
- package/dist/src/types/Enums.d.ts.map +1 -1
- package/dist/src/types/NowPlaying.d.ts +22 -2
- package/dist/src/types/NowPlaying.d.ts.map +1 -1
- package/dist/src/types/NowPlaying.js +26 -1
- package/dist/src/types/NowPlaying.js.map +1 -1
- package/dist/src/types/Presets.d.ts +3 -3
- package/dist/src/types/Presets.d.ts.map +1 -1
- package/dist/src/types/Sources.d.ts +20 -2
- package/dist/src/types/Sources.d.ts.map +1 -1
- package/dist/src/types/Sources.js +29 -1
- package/dist/src/types/Sources.js.map +1 -1
- package/dist/src/types/Updates.d.ts +2 -2
- package/dist/src/types/Updates.d.ts.map +1 -1
- package/dist/src/types/Zone.d.ts +17 -1
- package/dist/src/types/Zone.d.ts.map +1 -1
- package/dist/src/types/Zone.js +25 -1
- package/dist/src/types/Zone.js.map +1 -1
- package/package.json +5 -4
|
@@ -1,2 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Converts a raw source item to the normalized SourceItem shape.
|
|
3
|
+
*/
|
|
4
|
+
function normalizeSourceItem(item) {
|
|
5
|
+
return {
|
|
6
|
+
source: item.source,
|
|
7
|
+
sourceAccount: item.sourceAccount,
|
|
8
|
+
status: item.status,
|
|
9
|
+
isLocal: item.isLocal,
|
|
10
|
+
multiroomallowed: item.multiroomallowed,
|
|
11
|
+
...(item['#text'] ? { name: item['#text'] } : {}),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Converts a raw XML response shape to the normalized Sources shape.
|
|
16
|
+
*/
|
|
17
|
+
export function normalizeSources(sources) {
|
|
18
|
+
if (!sources)
|
|
19
|
+
return {};
|
|
20
|
+
const sourceItem = Array.isArray(sources.sourceItem)
|
|
21
|
+
? sources.sourceItem.map((item) => normalizeSourceItem(item))
|
|
22
|
+
: sources.sourceItem
|
|
23
|
+
? normalizeSourceItem(sources.sourceItem)
|
|
24
|
+
: undefined;
|
|
25
|
+
return {
|
|
26
|
+
deviceID: sources.deviceID,
|
|
27
|
+
sourceItem,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
2
30
|
//# sourceMappingURL=Sources.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sources.js","sourceRoot":"","sources":["../../../src/types/Sources.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Sources.js","sourceRoot":"","sources":["../../../src/types/Sources.ts"],"names":[],"mappings":"AA8BA;;GAEG;AACH,SAAS,mBAAmB,CAAC,IAA2B;IACpD,OAAO;QACH,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;QACvC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACpD,CAAA;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAA4B;IACzD,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAA;IAEvB,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;QAChD,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC7D,CAAC,CAAC,OAAO,CAAC,UAAU;YAClB,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,UAAU,CAAC;YACzC,CAAC,CAAC,SAAS,CAAA;IAEjB,OAAO;QACH,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,UAAU;KACb,CAAA;AACL,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { NowPlayingRawResponse } from './NowPlaying';
|
|
2
2
|
import type { Preset } from './Presets';
|
|
3
3
|
import type { Recent } from './Recents';
|
|
4
4
|
import type { Volume } from './Volume';
|
|
5
5
|
export type Updates = {
|
|
6
6
|
deviceID?: string;
|
|
7
7
|
nowPlayingUpdated?: {
|
|
8
|
-
nowPlaying?:
|
|
8
|
+
nowPlaying?: NowPlayingRawResponse;
|
|
9
9
|
};
|
|
10
10
|
presetsUpdated?: {
|
|
11
11
|
presets?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Updates.d.ts","sourceRoot":"","sources":["../../../src/types/Updates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Updates.d.ts","sourceRoot":"","sources":["../../../src/types/Updates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC,MAAM,MAAM,OAAO,GAAG;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iBAAiB,CAAC,EAAE;QAChB,UAAU,CAAC,EAAE,qBAAqB,CAAA;KACrC,CAAA;IACD,cAAc,CAAC,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?: string;
|
|
4
7
|
};
|
|
5
8
|
export type Zone = {
|
|
6
9
|
master?: string;
|
|
7
10
|
member?: ZoneMember | ZoneMember[];
|
|
8
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Raw response types.
|
|
14
|
+
*/
|
|
15
|
+
export type ZoneMemberRawResponse = Omit<ZoneMember, 'macAddress'> & {
|
|
16
|
+
'#text'?: string;
|
|
17
|
+
};
|
|
18
|
+
export type ZoneRawResponse = Omit<Zone, 'member'> & {
|
|
19
|
+
member?: ZoneMemberRawResponse | ZoneMemberRawResponse[];
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Converts a raw XML response shape to the normalized Zone shape.
|
|
23
|
+
*/
|
|
24
|
+
export declare function normalizeZone(zone?: ZoneRawResponse): Zone;
|
|
9
25
|
export type ZoneConfigMember = {
|
|
10
26
|
ipaddress: string;
|
|
11
27
|
macAddress: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Zone.d.ts","sourceRoot":"","sources":["../../../src/types/Zone.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,
|
|
1
|
+
{"version":3,"file":"Zone.d.ts","sourceRoot":"","sources":["../../../src/types/Zone.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,IAAI,GAAG;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,CAAA;CACrC,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,GAAG;IACjE,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG;IACjD,MAAM,CAAC,EAAE,qBAAqB,GAAG,qBAAqB,EAAE,CAAA;CAC3D,CAAA;AAYD;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,IAAI,CAa1D;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,eAAe,EAAE,MAAM,CAAA;IACvB,OAAO,EAAE,gBAAgB,EAAE,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,gBAAgB,EAAE,CAAA;CAC9B,CAAA"}
|
package/dist/src/types/Zone.js
CHANGED
|
@@ -1,2 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Converts a raw zone member to the normalized ZoneMember shape.
|
|
3
|
+
*/
|
|
4
|
+
function normalizeZoneMember(member) {
|
|
5
|
+
return {
|
|
6
|
+
ipaddress: member.ipaddress,
|
|
7
|
+
...(member['#text'] ? { macAddress: member['#text'] } : {}),
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Converts a raw XML response shape to the normalized Zone shape.
|
|
12
|
+
*/
|
|
13
|
+
export function normalizeZone(zone) {
|
|
14
|
+
if (!zone)
|
|
15
|
+
return {};
|
|
16
|
+
const member = Array.isArray(zone.member)
|
|
17
|
+
? zone.member.map((item) => normalizeZoneMember(item))
|
|
18
|
+
: zone.member
|
|
19
|
+
? normalizeZoneMember(zone.member)
|
|
20
|
+
: undefined;
|
|
21
|
+
return {
|
|
22
|
+
master: zone.master,
|
|
23
|
+
member,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
2
26
|
//# sourceMappingURL=Zone.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Zone.js","sourceRoot":"","sources":["../../../src/types/Zone.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Zone.js","sourceRoot":"","sources":["../../../src/types/Zone.ts"],"names":[],"mappings":"AAwBA;;GAEG;AACH,SAAS,mBAAmB,CAAC,MAA6B;IACtD,OAAO;QACH,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC9D,CAAA;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,IAAsB;IAChD,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAA;IAEpB,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;QACrC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACtD,CAAC,CAAC,IAAI,CAAC,MAAM;YACX,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC;YAClC,CAAC,CAAC,SAAS,CAAA;IAEjB,OAAO;QACH,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,MAAM;KACT,CAAA;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soundretouch/api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Unofficial TypeScript API wrapper for managing Bose SoundTouch devices.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bose",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"lint": "eslint . --ext .ts",
|
|
56
56
|
"prepare": "husky",
|
|
57
57
|
"prepublishOnly": "npm run build",
|
|
58
|
+
"smoke": "tsx scripts/smoke.ts",
|
|
58
59
|
"start": "tsx index.ts",
|
|
59
60
|
"test": "vitest"
|
|
60
61
|
},
|
|
@@ -81,8 +82,8 @@
|
|
|
81
82
|
"@typescript-eslint/eslint-plugin": "^8.53.0",
|
|
82
83
|
"@typescript-eslint/parser": "^8.53.0",
|
|
83
84
|
"eslint": "^9.39.2",
|
|
84
|
-
"eslint-config-prettier": "^
|
|
85
|
-
"eslint-plugin-unused-imports": "^
|
|
85
|
+
"eslint-config-prettier": "^6.15.0",
|
|
86
|
+
"eslint-plugin-unused-imports": "^1.1.3",
|
|
86
87
|
"husky": "^9.1.7",
|
|
87
88
|
"lint-staged": "^16.2.7",
|
|
88
89
|
"prettier": "^3.7.4",
|
|
@@ -90,7 +91,7 @@
|
|
|
90
91
|
"rimraf": "^6.0.1",
|
|
91
92
|
"tsx": "^4.21.0",
|
|
92
93
|
"typescript": "5.9.3",
|
|
93
|
-
"typescript-eslint": "^8.
|
|
94
|
+
"typescript-eslint": "^8.14.0",
|
|
94
95
|
"vitest": "^4.0.17"
|
|
95
96
|
}
|
|
96
97
|
}
|