mass-queue-types 0.9.2 → 0.10.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/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.9.2",
6
+ "version": "0.10.1",
7
7
  "module": "mass-queue-types.js",
8
8
  "keywords": [
9
9
  "home-assistant",
@@ -0,0 +1,11 @@
1
+ import { Album } from "../types/media-items.js";
2
+ import { baseMassQueueServiceWithResponseSchema, getCollectionDataPartialServiceSchema } from "../utils.js";
3
+
4
+ export type getAlbumServiceResponse = Album;
5
+
6
+ export type getAlbumPartialServiceSchema = getCollectionDataPartialServiceSchema
7
+
8
+ export interface getAlbumServiceSchema extends baseMassQueueServiceWithResponseSchema {
9
+ service: 'get_album';
10
+ service_data: getAlbumPartialServiceSchema;
11
+ }
@@ -0,0 +1,10 @@
1
+ import { baseMassQueueServiceWithResponseSchema, getCollectionDataPartialServiceSchema, getTracksServiceResponse } from "../utils.js";
2
+
3
+ export type getAlbumTracksServiceResponse = getTracksServiceResponse;
4
+
5
+ export type getAlbumTracksPartialServiceSchema = getCollectionDataPartialServiceSchema
6
+
7
+ export interface getAlbumTracksServiceSchema extends baseMassQueueServiceWithResponseSchema {
8
+ service: 'get_album_tracks';
9
+ service_data: getAlbumTracksPartialServiceSchema;
10
+ }
@@ -0,0 +1,11 @@
1
+ import { Artist } from "../types/media-items.js";
2
+ import { baseMassQueueServiceWithResponseSchema, getCollectionDataPartialServiceSchema } from "../utils.js";
3
+
4
+ export type getArtistServiceResponse = Artist;
5
+
6
+ export type getArtistPartialServiceSchema = getCollectionDataPartialServiceSchema
7
+
8
+ export interface getArtistServiceSchema extends baseMassQueueServiceWithResponseSchema {
9
+ service: 'get_artist';
10
+ service_data: getArtistPartialServiceSchema;
11
+ }
@@ -0,0 +1,10 @@
1
+ import { baseMassQueueServiceWithResponseSchema, getCollectionDataPartialServiceSchema, getTracksServiceResponse } from "../utils.js";
2
+
3
+ export type getArtistTracksServiceResponse = getTracksServiceResponse;
4
+
5
+ export type getArtistTracksPartialServiceSchema = getCollectionDataPartialServiceSchema
6
+
7
+ export interface getArtistTracksServiceSchema extends baseMassQueueServiceWithResponseSchema {
8
+ service: 'get_artust_tracks';
9
+ service_data: getArtistTracksPartialServiceSchema;
10
+ }
@@ -0,0 +1,11 @@
1
+ import { Playlist } from "../types/media-items.js";
2
+ import { baseMassQueueServiceWithResponseSchema, getCollectionDataPartialServiceSchema } from "../utils.js";
3
+
4
+ export type getPlaylistServiceResponse = Playlist;
5
+
6
+ export type getPlaylistPartialSchema = getCollectionDataPartialServiceSchema
7
+
8
+ export interface getPlaylistSchema extends baseMassQueueServiceWithResponseSchema {
9
+ service: 'get_playlist';
10
+ service_data: getPlaylistPartialSchema;
11
+ }
@@ -1,30 +1,10 @@
1
- import { baseMassQueueServiceWithResponseSchema } from "../utils.js";
1
+ import { baseMassQueueServiceWithResponseSchema, getCollectionDataPartialServiceSchema, getTracksServiceResponse } from "../utils.js";
2
2
 
3
- export interface playlistTrack {
4
- media_title: string;
5
- media_album_name: string;
6
- media_artist: string;
7
- media_content_id: string;
8
- media_image: string;
9
- local_image_encoded?: string;
10
- favorite: boolean;
11
- }
3
+ export type getPlaylistTracksServiceResponse = getTracksServiceResponse;
12
4
 
13
- export type playlistTracks = playlistTrack[];
5
+ export type getPlaylistTracksPartialServiceSchema = getCollectionDataPartialServiceSchema
14
6
 
15
- export interface getPlaylistTracksServiceResponse {
16
- response: {
17
- tracks: playlistTracks
18
- };
19
- }
20
-
21
- export interface getPlaylistTracksPartialSchema {
22
- uri: string;
23
- config_entry_id: string;
24
- }
25
-
26
- export interface getPlaylistTracksServiceSchema
27
- extends baseMassQueueServiceWithResponseSchema {
28
- service: "get_playlist_tracks";
29
- service_data: getPlaylistTracksPartialSchema;
30
- }
7
+ export interface getPlaylistTracksServiceSchema extends baseMassQueueServiceWithResponseSchema {
8
+ service: 'get_playlist_tracks';
9
+ service_data: getPlaylistTracksPartialServiceSchema;
10
+ }
@@ -0,0 +1,9 @@
1
+ export interface AudioFormat {
2
+ content_type: string;
3
+ codec_type: string;
4
+ sample_rate: number;
5
+ bit_depth: number;
6
+ channels: number;
7
+ output_format_str: string;
8
+ bit_rate: number;
9
+ }
@@ -0,0 +1,135 @@
1
+ import { MediaType } from "./media-type.js";
2
+ import { ProviderMapping } from "./provider-mapping.js";
3
+
4
+ export interface MediaItem extends MediaItemBase {
5
+ provider_mappings: ProviderMapping[],
6
+ metadata: MediaItemMetadata;
7
+ favorite: boolean;
8
+ position: number | null;
9
+ }
10
+
11
+ export interface Artist extends Omit<MediaItem, 'media_type'> {
12
+ media_type: 'artist';
13
+ }
14
+ export interface Album extends Omit<MediaItem, 'media_type'> {
15
+ media_type: 'album';
16
+ year: number | null;
17
+ album_type: AlbumType;
18
+ artists: Artist[];
19
+ }
20
+ export interface Track extends Omit<MediaItem, 'media_type'> {
21
+ media_type: 'track';
22
+ duration: number | undefined;
23
+ artists: Artist[];
24
+ album: Album[];
25
+ disc_number: number;
26
+ track_number: number;
27
+ image?: MediaItemImage | null;
28
+ }
29
+ export interface Playlist extends Omit<MediaItem, 'media_type'> {
30
+ media_type: 'playlist';
31
+ owner: string;
32
+ is_editable: boolean;
33
+ }
34
+
35
+ export interface Radio extends Omit<MediaItem, 'media_type'> {
36
+ media_type: 'radio';
37
+ duration: number | null;
38
+ }
39
+ export interface Audiobook extends Omit<MediaItem, 'media_type'> {
40
+ media_type: 'audiobook';
41
+ publisher: string;
42
+ authors: string[];
43
+ narrators: string[];
44
+ duration: number | null;
45
+ fully_played: boolean | null;
46
+ resume_position_ms: number | null;
47
+ }
48
+ export interface Podcast extends Omit<MediaItem, 'media_type'> {
49
+ media_type: 'podcast';
50
+ publisher: string;
51
+ total_episodes: number | null;
52
+ }
53
+ export interface PodcastEpisode extends Omit<MediaItem, 'media_type'> {
54
+ media_type: 'podcast_episode';
55
+ fully_played: boolean | null;
56
+ resume_position_ms: number | null;
57
+ }
58
+
59
+ type externalIds = [string, string][];
60
+
61
+ interface MediaItemBase {
62
+ item_id: string;
63
+ provider: string;
64
+ name: string;
65
+ version: string;
66
+ sort_name: string | null;
67
+ uri: string | null;
68
+ external_ids: externalIds;
69
+ is_playable: boolean;
70
+ translation_key: string | null;
71
+ media_type: MediaType;
72
+ }
73
+
74
+ type MediaImageType =
75
+ "thumb"
76
+ | "landscape"
77
+ | "fanart"
78
+ | "logo"
79
+ | "clearart"
80
+ | "banner"
81
+ | "cutout"
82
+ | "back"
83
+ | "discart"
84
+ | "other"
85
+
86
+ type AlbumType =
87
+ "album"
88
+ | "single"
89
+ | "live"
90
+ | "soundtrack"
91
+ | "compilation"
92
+ | "ep"
93
+ | "unknown"
94
+
95
+ interface MediaItemImage {
96
+ type: MediaImageType;
97
+ path: string;
98
+ provider: string;
99
+ remotely_accessible: boolean;
100
+ }
101
+
102
+ interface MediaItemLinkType {
103
+ type: string;
104
+ url: string;
105
+ }
106
+
107
+ interface MediaItemChapter {
108
+ position: number;
109
+ name: string;
110
+ start: number;
111
+ end: number | null;
112
+ }
113
+
114
+ interface MediaItemMetadata {
115
+ description: string | null;
116
+ review: string | null;
117
+ explicit: boolean | null;
118
+ images: MediaItemImage | null;
119
+ grouping: string | null;
120
+ genres: string[] | null;
121
+ mood: string | null;
122
+ style: string | null;
123
+ copyright: string | null;
124
+ lyrics: string | null;
125
+ lrc_lyrics: string | null;
126
+ label: string | null;
127
+ links: MediaItemLinkType[] | null;
128
+ performers: string[] | null;
129
+ preview: string | null;
130
+ popularity: number | null;
131
+ release_date: string | null;
132
+ languages: string[] | null;
133
+ chapters: MediaItemChapter | null;
134
+ last_refresh: number | null;
135
+ }
@@ -0,0 +1,16 @@
1
+ export type MediaType =
2
+ "album"
3
+ | "announcement"
4
+ | "artist"
5
+ | "audiobook"
6
+ | "flow_stream"
7
+ | "folder"
8
+ | "genre"
9
+ | "playlist"
10
+ | "plugin_source"
11
+ | "podcast"
12
+ | "podcast_episode"
13
+ | "radio"
14
+ | "sound_effect"
15
+ | "track"
16
+ | "unknown"
@@ -0,0 +1,13 @@
1
+ import { AudioFormat } from "./audio-format.js";
2
+
3
+ export interface ProviderMapping {
4
+ item_id: string;
5
+ provider_domain: string;
6
+ provider_instance: string;
7
+ available: boolean;
8
+ in_library: boolean | null;
9
+ is_unique? : boolean | null;
10
+ audio_format: AudioFormat;
11
+ url: string | null;
12
+ details: string | null;
13
+ }
@@ -12,4 +12,26 @@ export interface baseMassQueueServiceWithResponseSchema
12
12
  export interface queueItemPartialSchema {
13
13
  entity: string;
14
14
  queue_item_id: string;
15
+ }
16
+ export interface Track {
17
+ media_title: string;
18
+ media_album_name: string;
19
+ media_artist: string;
20
+ media_content_id: string;
21
+ media_image: string;
22
+ local_image_encoded?: string;
23
+ favorite: boolean;
24
+ }
25
+
26
+ export type Tracks = Track[];
27
+
28
+ export interface getTracksServiceResponse {
29
+ response: {
30
+ tracks: Tracks
31
+ };
32
+ }
33
+
34
+ export interface getCollectionDataPartialServiceSchema {
35
+ uri: string;
36
+ config_entry_id: string;
15
37
  }