mass-queue-types 0.8.0 → 0.8.1-b1
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/package.json +1 -1
- package/packages/{utils.ts → mass_queue/utils.ts} +1 -1
- package/packages/music_assistant/actions/get_library.ts +30 -0
- package/packages/music_assistant/actions/get_queue.ts +31 -0
- package/packages/music_assistant/actions/play_announcement.ts +12 -0
- package/packages/music_assistant/actions/play_media.ts +17 -0
- package/packages/music_assistant/actions/search.ts +31 -0
- package/packages/music_assistant/actions/transfer_queue.ts +12 -0
- package/packages/music_assistant/types.ts +70 -0
- package/packages/music_assistant/utils.ts +23 -0
- package/packages/util.ts +0 -0
- /package/packages/{actions → mass_queue/actions}/get_group_volume.ts +0 -0
- /package/packages/{actions → mass_queue/actions}/get_queue_items.ts +0 -0
- /package/packages/{actions → mass_queue/actions}/get_recommendations.ts +0 -0
- /package/packages/{actions → mass_queue/actions}/move_queue_item_down.ts +0 -0
- /package/packages/{actions → mass_queue/actions}/move_queue_item_next.ts +0 -0
- /package/packages/{actions → mass_queue/actions}/move_queue_item_up.ts +0 -0
- /package/packages/{actions → mass_queue/actions}/play_queue_item.ts +0 -0
- /package/packages/{actions → mass_queue/actions}/remove_queue_item.ts +0 -0
- /package/packages/{actions → mass_queue/actions}/send_command.ts +0 -0
- /package/packages/{actions → mass_queue/actions}/set_group_volume.ts +0 -0
- /package/packages/{actions → mass_queue/actions}/unfavorite_current_item.ts +0 -0
- /package/packages/{ws → mass_queue/ws}/download_and_encode_image.ts +0 -0
- /package/packages/{ws → mass_queue/ws}/encode_images.ts +0 -0
- /package/packages/{ws → mass_queue/ws}/get_info.ts +0 -0
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Custom Types and Interfaces for Music Assistant Queue Actions",
|
|
4
4
|
"repository": "https://github.com/droans/mass-queue-types",
|
|
5
5
|
"author": "Michael Carroll",
|
|
6
|
-
"version": "0.8.
|
|
6
|
+
"version": "0.8.1-b1",
|
|
7
7
|
"module": "mass-queue-types.js",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"home-assistant",
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { baseMassQueueServiceWithResponseSchema } from "../../mass_queue/utils.js";
|
|
2
|
+
import { MediaItem, MediaItemOrder, MediaTypes } from "../types.js";
|
|
3
|
+
|
|
4
|
+
export interface getLibraryPartialServiceResponse {
|
|
5
|
+
items: MediaItem[];
|
|
6
|
+
limit: number;
|
|
7
|
+
offset: number;
|
|
8
|
+
ofder_by: MediaItemOrder;
|
|
9
|
+
media_type: MediaTypes;
|
|
10
|
+
}
|
|
11
|
+
export interface getLibraryServiceResponse {
|
|
12
|
+
response: getLibraryPartialServiceResponse
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface getLibraryPartialSchema {
|
|
16
|
+
config_entry_id: string;
|
|
17
|
+
media_type: MediaTypes;
|
|
18
|
+
favorite?: boolean;
|
|
19
|
+
limit?: number;
|
|
20
|
+
offset?: number;
|
|
21
|
+
album_artists_only?: boolean;
|
|
22
|
+
search?: string;
|
|
23
|
+
order_by?: MediaItemOrder
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface getLibraryServiceSchema
|
|
27
|
+
extends baseMassQueueServiceWithResponseSchema {
|
|
28
|
+
service: "get_library"
|
|
29
|
+
service_data: getLibraryPartialSchema
|
|
30
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { baseMassQueueServiceWithResponseSchema } from "../../mass_queue/utils.js";
|
|
2
|
+
import { QueueItemSchema } from "../types.js";
|
|
3
|
+
|
|
4
|
+
export interface getQueuePartialServiceResponse {
|
|
5
|
+
queue_id: string;
|
|
6
|
+
active: boolean;
|
|
7
|
+
name: string;
|
|
8
|
+
items: number;
|
|
9
|
+
shuffle_enabled: boolean;
|
|
10
|
+
repeat_mode: boolean;
|
|
11
|
+
current_index: number | null;
|
|
12
|
+
elapsed_time: number;
|
|
13
|
+
current_item: QueueItemSchema;
|
|
14
|
+
next_item: QueueItemSchema;
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
type getQueueServiceEntitiesResponse = Record<string, getQueuePartialServiceResponse>;
|
|
18
|
+
|
|
19
|
+
export interface getQueueServiceResponse {
|
|
20
|
+
response: getQueueServiceEntitiesResponse;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface getQueuePartialSchema {
|
|
24
|
+
entity_id: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface getQueueServiceSchema
|
|
28
|
+
extends baseMassQueueServiceWithResponseSchema {
|
|
29
|
+
service: "get_queue"
|
|
30
|
+
service_data: getQueuePartialSchema
|
|
31
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { baseMusicAssistantServiceWithTargetSchema } from "../utils.js";
|
|
2
|
+
|
|
3
|
+
export interface playAnnouncementPartialSchema {
|
|
4
|
+
url: string;
|
|
5
|
+
use_pre_announce?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface playAnnouncementServiceSchema
|
|
9
|
+
extends baseMusicAssistantServiceWithTargetSchema {
|
|
10
|
+
service: "play_announcement"
|
|
11
|
+
service_data: playAnnouncementPartialSchema
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EnqueueModes, MediaTypes } from "../types.js";
|
|
2
|
+
import { baseMusicAssistantServiceWithTargetSchema } from "../utils.js";
|
|
3
|
+
|
|
4
|
+
export interface playMediaPartialSchema {
|
|
5
|
+
media_id: string;
|
|
6
|
+
media_type?: MediaTypes;
|
|
7
|
+
artist?: string;
|
|
8
|
+
album?: string;
|
|
9
|
+
enqueue?: EnqueueModes;
|
|
10
|
+
radio_mode?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface playMediaServiceSchema
|
|
14
|
+
extends baseMusicAssistantServiceWithTargetSchema {
|
|
15
|
+
service: "play_media"
|
|
16
|
+
service_data: playMediaPartialSchema
|
|
17
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { baseMassQueueServiceWithResponseSchema } from "../../mass_queue/utils.js";
|
|
2
|
+
import { MediaItem, MediaTypes } from "../types.js";
|
|
3
|
+
|
|
4
|
+
export interface searchPartialServiceResponse {
|
|
5
|
+
artists: MediaItem[];
|
|
6
|
+
albums: MediaItem[];
|
|
7
|
+
tracks: MediaItem[];
|
|
8
|
+
playlists: MediaItem[];
|
|
9
|
+
radio: MediaItem[];
|
|
10
|
+
audiobooks: MediaItem[];
|
|
11
|
+
podcasts: MediaItem[];
|
|
12
|
+
}
|
|
13
|
+
export interface searchServiceResponse {
|
|
14
|
+
response: searchPartialServiceResponse
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface searchPartialSchema {
|
|
18
|
+
config_entry_id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
media_type?: MediaTypes[];
|
|
21
|
+
artist?: string;
|
|
22
|
+
album?: string;
|
|
23
|
+
limit?: number;
|
|
24
|
+
library_only?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface searchServiceSchema
|
|
28
|
+
extends baseMassQueueServiceWithResponseSchema {
|
|
29
|
+
service: "search"
|
|
30
|
+
service_data: searchPartialSchema
|
|
31
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { baseMusicAssistantServiceWithTargetSchema } from "../utils.js";
|
|
2
|
+
|
|
3
|
+
export interface transferQueuePartialSchema {
|
|
4
|
+
source_player?: string;
|
|
5
|
+
auto_play?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface transferQueueServiceSchema
|
|
9
|
+
extends baseMusicAssistantServiceWithTargetSchema {
|
|
10
|
+
service: "transfer_queue"
|
|
11
|
+
service_data: transferQueuePartialSchema
|
|
12
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
|
|
2
|
+
export type MediaTypes =
|
|
3
|
+
"artist"
|
|
4
|
+
| "album"
|
|
5
|
+
| "audiobook"
|
|
6
|
+
| "playlist"
|
|
7
|
+
| "podcast"
|
|
8
|
+
| "radio"
|
|
9
|
+
| "track"
|
|
10
|
+
|
|
11
|
+
export type MediaItemOrder =
|
|
12
|
+
"name"
|
|
13
|
+
| "name_desc"
|
|
14
|
+
| "sort_name"
|
|
15
|
+
| "sort_name_desc"
|
|
16
|
+
| "timestamp_added"
|
|
17
|
+
| "timestamp_added_desc"
|
|
18
|
+
| "last_played"
|
|
19
|
+
| "last_played_desc"
|
|
20
|
+
| "play_count"
|
|
21
|
+
| "play_count_desc"
|
|
22
|
+
| "year"
|
|
23
|
+
| "year_desc"
|
|
24
|
+
| "position"
|
|
25
|
+
| "position_desc"
|
|
26
|
+
| "artist_name"
|
|
27
|
+
| "artist_name_desc"
|
|
28
|
+
| "random"
|
|
29
|
+
| "random_play_count"
|
|
30
|
+
|
|
31
|
+
interface baseMediaItem {
|
|
32
|
+
media_type: MediaTypes;
|
|
33
|
+
uri: string;
|
|
34
|
+
name: string;
|
|
35
|
+
version: string;
|
|
36
|
+
image?: string | null;
|
|
37
|
+
favorite?: boolean;
|
|
38
|
+
explicit?: boolean | null;
|
|
39
|
+
discart_image?: boolean | null;
|
|
40
|
+
fanart_image?: boolean | null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface MediaItem extends baseMediaItem {
|
|
44
|
+
artists?: baseMediaItem[];
|
|
45
|
+
album?: baseMediaItem;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface AudioFormatSchema {
|
|
49
|
+
provider: string;
|
|
50
|
+
item_id: string;
|
|
51
|
+
content_type: string;
|
|
52
|
+
sample_rate: number;
|
|
53
|
+
bit_depth: number;
|
|
54
|
+
bitrate?: number;
|
|
55
|
+
}
|
|
56
|
+
export interface QueueItemSchema {
|
|
57
|
+
queue_item_id: string;
|
|
58
|
+
name: string;
|
|
59
|
+
duration?: number | null;
|
|
60
|
+
media_item?: MediaItem | null;
|
|
61
|
+
stream_title?: string | null;
|
|
62
|
+
stream_details?: AudioFormatSchema | null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type EnqueueModes =
|
|
66
|
+
"play"
|
|
67
|
+
| "replace"
|
|
68
|
+
| "next"
|
|
69
|
+
| "replace_next"
|
|
70
|
+
| "add"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface baseMusicAssistantServiceSchema {
|
|
2
|
+
type: "call_service";
|
|
3
|
+
domain: "music_assistant";
|
|
4
|
+
service: string;
|
|
5
|
+
}
|
|
6
|
+
export interface baseMusicAssistantServiceWithResponseSchema
|
|
7
|
+
extends baseMusicAssistantServiceSchema {
|
|
8
|
+
return_response: true;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface baseMusicAssistantServiceWithTargetSchema
|
|
12
|
+
extends baseMusicAssistantServiceSchema {
|
|
13
|
+
target: {
|
|
14
|
+
entity_id?: string | string[];
|
|
15
|
+
device_id?: string | string[];
|
|
16
|
+
floor_id?: string | string[];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface baseMusicAssistantServiceWithTargetAndResponseSchema
|
|
21
|
+
extends baseMusicAssistantServiceWithTargetSchema {
|
|
22
|
+
return_response: true
|
|
23
|
+
}
|
package/packages/util.ts
ADDED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|