javascript-ampache 1.1.10 → 2.0.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.
Files changed (108) hide show
  1. package/README.md +16 -6
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.m.js +1 -1
  5. package/dist/index.m.js.map +1 -1
  6. package/dist/index.modern.mjs +1 -1
  7. package/dist/index.modern.mjs.map +1 -1
  8. package/dist/index.umd.js +1 -1
  9. package/dist/index.umd.js.map +1 -1
  10. package/package.json +8 -7
  11. package/src/albums.js +106 -0
  12. package/src/artists.js +105 -0
  13. package/src/auth.js +142 -0
  14. package/src/base.js +145 -0
  15. package/src/bookmarks.js +106 -0
  16. package/src/catalogs.js +133 -0
  17. package/src/genres.js +57 -0
  18. package/src/index.js +30 -0
  19. package/src/labels.js +53 -0
  20. package/src/licenses.js +47 -0
  21. package/src/live-streams.js +97 -0
  22. package/src/playlists.js +241 -0
  23. package/src/podcasts.js +230 -0
  24. package/src/preferences.js +114 -0
  25. package/src/shares.js +99 -0
  26. package/src/shouts.js +24 -0
  27. package/src/songs.js +273 -0
  28. package/src/system.js +510 -0
  29. package/src/users.js +224 -0
  30. package/src/{utils.ts → utils.js} +16 -16
  31. package/src/videos.js +84 -0
  32. package/dist/albums/index.d.ts +0 -64
  33. package/dist/albums/types.d.ts +0 -37
  34. package/dist/artists/index.d.ts +0 -64
  35. package/dist/artists/types.d.ts +0 -35
  36. package/dist/auth/index.d.ts +0 -56
  37. package/dist/auth/types.d.ts +0 -32
  38. package/dist/base.d.ts +0 -47
  39. package/dist/bookmarks/index.d.ts +0 -91
  40. package/dist/bookmarks/types.d.ts +0 -13
  41. package/dist/catalogs/index.d.ts +0 -87
  42. package/dist/catalogs/types.d.ts +0 -19
  43. package/dist/genres/index.d.ts +0 -28
  44. package/dist/genres/types.d.ts +0 -22
  45. package/dist/index.d.ts +0 -24
  46. package/dist/labels/index.d.ts +0 -32
  47. package/dist/labels/types.d.ts +0 -18
  48. package/dist/licenses/index.d.ts +0 -32
  49. package/dist/licenses/types.d.ts +0 -12
  50. package/dist/live-streams/index.d.ts +0 -80
  51. package/dist/live-streams/types.d.ts +0 -14
  52. package/dist/playlists/index.d.ts +0 -204
  53. package/dist/playlists/types.d.ts +0 -26
  54. package/dist/podcasts/index.d.ts +0 -121
  55. package/dist/podcasts/types.d.ts +0 -79
  56. package/dist/preferences/index.d.ts +0 -80
  57. package/dist/preferences/types.d.ts +0 -18
  58. package/dist/shares/index.d.ts +0 -69
  59. package/dist/shares/types.d.ts +0 -23
  60. package/dist/shouts/index.d.ts +0 -17
  61. package/dist/shouts/types.d.ts +0 -10
  62. package/dist/songs/index.d.ts +0 -143
  63. package/dist/songs/types.d.ts +0 -73
  64. package/dist/system/index.d.ts +0 -407
  65. package/dist/system/types.d.ts +0 -24
  66. package/dist/users/index.d.ts +0 -190
  67. package/dist/users/types.d.ts +0 -34
  68. package/dist/utils.d.ts +0 -4
  69. package/dist/videos/index.d.ts +0 -33
  70. package/dist/videos/types.d.ts +0 -38
  71. package/src/albums/index.ts +0 -88
  72. package/src/albums/types.ts +0 -40
  73. package/src/artists/index.ts +0 -88
  74. package/src/artists/types.ts +0 -38
  75. package/src/auth/index.ts +0 -118
  76. package/src/auth/types.ts +0 -32
  77. package/src/base.ts +0 -133
  78. package/src/bookmarks/index.ts +0 -116
  79. package/src/bookmarks/types.ts +0 -15
  80. package/src/catalogs/index.ts +0 -130
  81. package/src/catalogs/types.ts +0 -27
  82. package/src/genres/index.ts +0 -39
  83. package/src/genres/types.ts +0 -25
  84. package/src/index.ts +0 -63
  85. package/src/labels/index.ts +0 -43
  86. package/src/labels/types.ts +0 -20
  87. package/src/licenses/index.ts +0 -43
  88. package/src/licenses/types.ts +0 -14
  89. package/src/live-streams/index.ts +0 -104
  90. package/src/live-streams/types.ts +0 -16
  91. package/src/playlists/index.ts +0 -280
  92. package/src/playlists/types.ts +0 -29
  93. package/src/podcasts/index.ts +0 -174
  94. package/src/podcasts/types.ts +0 -85
  95. package/src/preferences/index.ts +0 -114
  96. package/src/preferences/types.ts +0 -20
  97. package/src/shares/index.ts +0 -100
  98. package/src/shares/types.ts +0 -25
  99. package/src/shouts/index.ts +0 -18
  100. package/src/shouts/types.ts +0 -11
  101. package/src/songs/index.ts +0 -221
  102. package/src/songs/types.ts +0 -77
  103. package/src/system/index.ts +0 -845
  104. package/src/system/types.ts +0 -42
  105. package/src/users/index.ts +0 -227
  106. package/src/users/types.ts +0 -38
  107. package/src/videos/index.ts +0 -49
  108. package/src/videos/types.ts +0 -42
@@ -1,143 +0,0 @@
1
- import { SongResponse, SongsResponse, DeletedSongsResponse } from "./types";
2
- import { Base, BinaryBoolean, ExtendedPagination, Pagination, Success, UID } from "../base";
3
- export declare class Songs extends Base {
4
- /**
5
- * Returns songs based on the specified filter
6
- * @remarks MINIMUM_API_VERSION=380001
7
- * @param [params.filter] Filter results to match this string
8
- * @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
9
- * @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
10
- * @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
11
- * @param [params.offset]
12
- * @param [params.limit]
13
- * @param [params.cond]
14
- * @param [params.sort]
15
- * @see {@link https://ampache.org/api/api-json-methods#songs}
16
- */
17
- songs(params?: {
18
- filter?: string;
19
- exact?: BinaryBoolean;
20
- add?: Date;
21
- update?: Date;
22
- } & ExtendedPagination): Promise<SongsResponse>;
23
- /**
24
- * Returns a single song
25
- * @remarks MINIMUM_API_VERSION=380001
26
- * @param params.filter UID to find
27
- * @see {@link https://ampache.org/api/api-json-methods#song}
28
- */
29
- song(params: {
30
- filter: UID;
31
- }): Promise<SongResponse>;
32
- /**
33
- * Songs of the specified artist
34
- * @remarks MINIMUM_API_VERSION=380001
35
- * @param params.filter UID to find
36
- * @param [params.top50] 0, 1 (if true filter to the artist top 50)
37
- * @param [params.offset]
38
- * @param [params.limit]
39
- * @param [params.cond]
40
- * @param [params.sort]
41
- * @see {@link https://ampache.org/api/api-json-methods#artist_songs}
42
- */
43
- artistSongs(params: {
44
- filter: UID;
45
- top50?: BinaryBoolean;
46
- } & ExtendedPagination): Promise<SongsResponse>;
47
- /**
48
- * Songs of the specified album
49
- * @remarks MINIMUM_API_VERSION=380001
50
- * @param params.filter UID to find
51
- * @param [params.offset]
52
- * @param [params.limit]
53
- * @param [params.cond]
54
- * @param [params.sort]
55
- * @see {@link https://ampache.org/api/api-json-methods#album_songs}
56
- */
57
- albumSongs(params: {
58
- filter: UID;
59
- } & ExtendedPagination): Promise<SongsResponse>;
60
- /**
61
- * Songs of the specified genre
62
- * @remarks MINIMUM_API_VERSION=380001
63
- * @param params.filter UID to find
64
- * @param [params.offset]
65
- * @param [params.limit]
66
- * @param [params.cond]
67
- * @param [params.sort]
68
- * @see {@link https://ampache.org/api/api-json-methods#genre_songs}
69
- */
70
- genreSongs(params: {
71
- filter: UID;
72
- } & ExtendedPagination): Promise<SongsResponse>;
73
- /**
74
- * This returns the songs for a playlist
75
- * @remarks MINIMUM_API_VERSION=380001
76
- * @param params.filter UID to find
77
- * @param [params.random] 0, 1 (if true get random songs using limit)
78
- * @param [params.offset]
79
- * @param [params.limit]
80
- * @see {@link https://ampache.org/api/api-json-methods#playlist_songs}
81
- */
82
- playlistSongs(params: {
83
- filter: UID;
84
- random?: BinaryBoolean;
85
- } & Pagination): Promise<SongsResponse>;
86
- /**
87
- * This returns the songs for a license
88
- * @remarks MINIMUM_API_VERSION=420000
89
- * @param params.filter UID to find
90
- * @param [params.offset]
91
- * @param [params.limit]
92
- * @param [params.cond]
93
- * @param [params.sort]
94
- * @see {@link https://ampache.org/api/api-json-methods#license_songs}
95
- */
96
- licenseSongs(params: {
97
- filter: UID;
98
- } & ExtendedPagination): Promise<SongsResponse>;
99
- /**
100
- * Delete an existing song. (if you are allowed to)
101
- * @remarks MINIMUM_API_VERSION=5.0.0
102
- * @param params.filter UID of song to delete
103
- * @see {@link https://ampache.org/api/api-json-methods#song_delete}
104
- */
105
- songDelete(params: {
106
- filter: UID;
107
- }): Promise<Success>;
108
- /**
109
- * Get the full song file tags using VaInfo
110
- * This is used to get tags for remote catalogs to allow maximum data to be returned
111
- * @remarks MINIMUM_API_VERSION=7.5.0
112
- * @param params.filter UID of song to fetch
113
- * @see {@link https://ampache.org/api/api-json-methods#song_tags}
114
- */
115
- /**
116
- * This takes a URL and returns the song object in question
117
- * @remarks MINIMUM_API_VERSION=380001
118
- * @param params.url Full Ampache URL from server
119
- * @see {@link https://ampache.org/api/api-json-methods#url_to_song}
120
- */
121
- urlToSong(params: {
122
- url: string;
123
- }): Promise<SongResponse>;
124
- /**
125
- * This searches the songs and returns... songs
126
- * @remarks MINIMUM_API_VERSION=380001
127
- * @param params.filter Filter results to match this string
128
- * @param [params.offset]
129
- * @param [params.limit]
130
- * @see {@link https://ampache.org/api/api-json-methods#search_songs}
131
- */
132
- searchSongs(params: {
133
- filter: string;
134
- } & Pagination): Promise<SongsResponse>;
135
- /**
136
- * Returns songs that have been deleted from the server
137
- * @remarks MINIMUM_API_VERSION=500000
138
- * @param [params.offset]
139
- * @param [params.limit]
140
- * @see {@link https://ampache.org/api/api-json-methods#deleted_songs}
141
- */
142
- deletedSongs(params?: {} & Pagination): Promise<DeletedSongsResponse>;
143
- }
@@ -1,73 +0,0 @@
1
- import { ArtistSummary } from "../artists/types";
2
- import { GenreSummary } from "../genres/types";
3
- import { UID } from "../base";
4
- import { AlbumSummary } from "../albums/types";
5
- export type SongResponse = {
6
- id: UID;
7
- title: string;
8
- name: string;
9
- artist: ArtistSummary;
10
- album: AlbumSummary;
11
- albumartist: ArtistSummary;
12
- disk: number;
13
- track: number;
14
- filename: string;
15
- genre: GenreSummary[];
16
- playlisttrack: number;
17
- time: number;
18
- year: number | string;
19
- format: string;
20
- stream_format: string;
21
- rate: number;
22
- mode: string;
23
- mime: string;
24
- stream_mime: string;
25
- url: string;
26
- size: number;
27
- mbid: string | null;
28
- album_mbid: string | null;
29
- artist_mbid: string | null;
30
- art: string;
31
- has_art: boolean;
32
- flag: boolean;
33
- rating: number | null;
34
- averagerating: number | null;
35
- playcount: number;
36
- catalog: number;
37
- composer: string;
38
- channels: number | null;
39
- comment: string;
40
- license: string | null;
41
- publisher: string;
42
- language: string;
43
- lyrics: string;
44
- replaygain_album_gain: number | null;
45
- replaygain_album_peak: number | null;
46
- replaygain_track_gain: number | null;
47
- replaygain_track_peak: number | null;
48
- r128_album_gain: number | null;
49
- r128_track_gain: number | null;
50
- };
51
- export type SongsResponse = {
52
- total_count: number;
53
- md5: string;
54
- song: SongResponse[];
55
- };
56
- export type DeletedSongResponse = {
57
- id: UID;
58
- addition_time: number;
59
- delete_time: number;
60
- update_time: number;
61
- title: string;
62
- file: string;
63
- catalog: UID;
64
- total_count: number;
65
- total_skip: number;
66
- album: UID;
67
- artist: UID;
68
- };
69
- export type DeletedSongsResponse = {
70
- total_count: number;
71
- md5: string;
72
- deleted_song: DeletedSongResponse[];
73
- };
@@ -1,407 +0,0 @@
1
- import { Base, BinaryBoolean, ExtendedPagination, Pagination, Success, UID } from "../base";
2
- import { IndexEntry, NowPlayingResponse } from "./types";
3
- export declare class System extends Base {
4
- /**
5
- * Check Ampache for updates and run the update if there is one.
6
- * @remarks MINIMUM_API_VERSION=5.0.0
7
- * @see {@link https://ampache.org/api/api-json-methods#system_update}
8
- */
9
- systemUpdate(): Promise<Success>;
10
- /**
11
- * This takes a collection of inputs and returns ID + name for the object type
12
- * @remarks MINIMUM_API_VERSION=400001
13
- * @param params.type type of object to find
14
- * @param [params.filter] search the name of the object_type
15
- * @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
16
- * @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
17
- * @param [params.include] 0, 1 (include songs in a playlist or episodes in a podcast)
18
- * @param [params.hide_search] 0, 1 (if true do not include searches/smartlists in the result)
19
- * @param [params.offset]
20
- * @param [params.limit]
21
- * @param [params.cond]
22
- * @param [params.sort]
23
- * @see {@link https://ampache.org/api/api-json-methods#get_indexes}
24
- * @deprecated Being removed in 7.0.0. Use `list` instead.
25
- */
26
- getIndexes(params: {
27
- type: "song" | "album" | "artist" | "album_artist" | "playlist" | "podcast" | "podcast_episode" | "live_stream" | "catalog" | "song_artist";
28
- filter?: string;
29
- add?: Date;
30
- update?: Date;
31
- include?: BinaryBoolean;
32
- hide_search?: BinaryBoolean;
33
- } & ExtendedPagination): any;
34
- /**
35
- * This takes a named array of objects and returning `id`, `name`, `prefix` and `basename`
36
- * @remarks MINIMUM_API_VERSION=6.0.0
37
- * @param params.type type of object to find
38
- * @param [params.filter] Value is Alpha Match for returned results, may be more than one letter/number
39
- * @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
40
- * @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
41
- * @param [params.hide_search] 0, 1 (if true do not include searches/smartlists in the result)
42
- * @param [params.offset]
43
- * @param [params.limit]
44
- * @param [params.cond]
45
- * @param [params.sort]
46
- * @see {@link https://ampache.org/api/api-json-methods#list}
47
- */
48
- list(params: {
49
- type: "song" | "album" | "artist" | "album_artist" | "playlist" | "podcast" | "podcast_episode" | "live_stream" | "catalog" | "song_artist";
50
- filter?: string;
51
- add?: Date;
52
- update?: Date;
53
- hide_search?: BinaryBoolean;
54
- } & ExtendedPagination): Promise<{
55
- list: IndexEntry[];
56
- }>;
57
- /**
58
- * This takes a collection of inputs and return ID's for the object type.
59
- * @remarks MINIMUM_API_VERSION=6.3.0
60
- * @param params.type type of object to find
61
- * @param [params.filter] Value is Alpha Match for returned results, may be more than one letter/number
62
- * @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
63
- * @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
64
- * @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
65
- * @param [params.include] 0, 1, (include child objects)
66
- * @param [params.hide_search] 0, 1 (if true do not include searches/smartlists in the result)
67
- * @param [params.offset]
68
- * @param [params.limit]
69
- * @param [params.cond]
70
- * @param [params.sort]
71
- * @see {@link https://ampache.org/api/api-json-methods#index}
72
- */
73
- index(params: {
74
- type: "catalog" | "song" | "album" | "artist" | "album_artist" | "song_artist" | "playlist" | "podcast" | "podcast_episode" | "share" | "video" | "live_stream";
75
- filter?: string;
76
- exact?: BinaryBoolean;
77
- add?: Date;
78
- update?: Date;
79
- include?: BinaryBoolean;
80
- hide_search?: BinaryBoolean;
81
- } & ExtendedPagination): Promise<{
82
- index: [];
83
- }>;
84
- /**
85
- * Return children of a parent object in a folder traversal/browse style
86
- * If you don't send any parameters you'll get a catalog list (the 'root' path)
87
- * @remarks MINIMUM_API_VERSION=6.0.0
88
- * @param [params.filter] object_id
89
- * @param [params.type] type of object to find
90
- * @param [params.catalog] catalog ID you are browsing (required on 'artist', 'album', 'podcast')
91
- * @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
92
- * @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
93
- * @param [params.offset]
94
- * @param [params.limit]
95
- * @param [params.cond]
96
- * @param [params.sort]
97
- * @see {@link https://ampache.org/api/api-json-methods#browse}
98
- */
99
- browse(params: {
100
- filter?: UID;
101
- type?: "root" | "catalog" | "artist" | "album" | "podcast";
102
- catalog?: number;
103
- add?: Date;
104
- update?: Date;
105
- } & ExtendedPagination): Promise<{
106
- browse: IndexEntry[];
107
- }>;
108
- /**
109
- * Return similar artist IDs or similar song IDs compared to the input filter
110
- * @remarks MINIMUM_API_VERSION=420000
111
- * @param params.type type of object to check against
112
- * @param params.filter UID to find
113
- * @param [params.offset]
114
- * @param [params.limit]
115
- * @see {@link https://ampache.org/api/api-json-methods#get_similar}
116
- */
117
- getSimilar(params: {
118
- type: "song" | "artist";
119
- filter: UID;
120
- } & Pagination): any;
121
- /**
122
- * Get some items based on some simple search types and filters. (Random by default)
123
- * @remarks MINIMUM_API_VERSION=380001; CHANGED_IN_API_VERSION=400001
124
- * @param params.type Object type
125
- * @param [params.filter] newest, highest, frequent, recent, forgotten, flagged, random
126
- * @param [params.user_id] Filter results to a certain user by UID
127
- * @param [params.username] Filter results to a certain user by username
128
- * @param [params.offset]
129
- * @param [params.limit]
130
- * @see {@link https://ampache.org/api/api-json-methods#stats}
131
- */
132
- stats(params: {
133
- type: "song" | "album" | "artist" | "video" | "playlist" | "podcast" | "podcast_episode";
134
- filter?: "newest" | "highest" | "frequent" | "recent" | "forgotten" | "flagged" | "random";
135
- user_id?: number;
136
- username?: string;
137
- } & Pagination): any;
138
- /**
139
- * This rates a library item
140
- * @remarks MINIMUM_API_VERSION=380001
141
- * @param params.type Object type
142
- * @param params.id UID to find
143
- * @param params.rating Rating to apply
144
- * @see {@link https://ampache.org/api/api-json-methods#rate}
145
- */
146
- rate(params: {
147
- type: "song" | "album" | "artist" | "playlist" | "podcast" | "podcast_episode" | "video" | "tvshow" | "tvshow_season";
148
- id: UID;
149
- rating: 0 | 1 | 2 | 3 | 4 | 5;
150
- }): Promise<Success>;
151
- /**
152
- * This flags a library item as a favorite
153
- * @remarks MINIMUM_API_VERSION=400001
154
- * @param params.type Object type
155
- * @param params.id UID to find
156
- * @param params.flag 0, 1
157
- * @param [params.date] UNIXTIME
158
- * @see {@link https://ampache.org/api/api-json-methods#flag}
159
- */
160
- flag(params: {
161
- type: "song" | "album" | "artist" | "playlist" | "podcast" | "podcast_episode" | "video" | "tvshow" | "tvshow_season";
162
- id: UID;
163
- flag: BinaryBoolean;
164
- date?: number;
165
- }): Promise<Success>;
166
- /**
167
- * Take a song_id and update the object_count and user_activity table with a play. This allows other sources to record play history to Ampache.
168
- * If you don't supply a user id (optional) then just fall back to you.
169
- * ACCESS REQUIRED: 100 (Admin) permission to change another user's play history
170
- * @remarks MINIMUM_API_VERSION=400001
171
- * @param params.id UID of song
172
- * @param [params.user] UID of user
173
- * @param [params.client] Client string
174
- * @param [params.date] UNIXTIME
175
- * @see {@link https://ampache.org/api/api-json-methods#record_play}
176
- */
177
- recordPlay(params: {
178
- id: UID;
179
- user?: UID;
180
- client?: string;
181
- date?: number;
182
- }): Promise<Success>;
183
- /**
184
- * Search for a song using text info and then record a play if found. This allows other sources to record play history to ampache
185
- * @remarks MINIMUM_API_VERSION=400001
186
- * @param params.song HTML encoded string
187
- * @param params.artist HTML encoded string
188
- * @param params.album HTML encoded string
189
- * @param [params.songmbid] Song MBID
190
- * @param [params.artistmbid] Artist MBID
191
- * @param [params.albummbid] Album MBID
192
- * @param [params.song_mbid] Alias of songmbid
193
- * @param [params.artist_mbid] Alias of artistmbid
194
- * @param [params.album_mbid] Alias of albummbid
195
- * @param [params.date] UNIXTIME
196
- * @param [params.client] Client string
197
- * @see {@link https://ampache.org/api/api-json-methods#scrobble}
198
- */
199
- scrobble(params: {
200
- song: string;
201
- artist: string;
202
- album: string;
203
- songmbid?: string;
204
- artistmbid?: string;
205
- albummbid?: string;
206
- song_mbid?: string;
207
- artist_mbid?: string;
208
- album_mbid?: string;
209
- date?: number;
210
- client?: string;
211
- }): Promise<Success>;
212
- /**
213
- * Update a single album, artist, song from the tag data
214
- * @remarks MINIMUM_API_VERSION=400001
215
- * @param params.type Object type
216
- * @param params.id UID to find
217
- * @see {@link https://ampache.org/api/api-json-methods#update_from_tags}
218
- */
219
- updateFromTags(params: {
220
- type: "song" | "artist" | "album";
221
- id: UID;
222
- }): Promise<Success>;
223
- /**
224
- * Update artist information and fetch similar artists from last.fm
225
- * Make sure lastfm_API_key is set in your configuration file
226
- * ACCESS REQUIRED: 75 (Catalog Manager)
227
- * @remarks MINIMUM_API_VERSION=400001
228
- * @param params.id UID to find
229
- * @see {@link https://ampache.org/api/api-json-methods#update_artist_info}
230
- */
231
- updateArtistInfo(params: {
232
- id: UID;
233
- }): Promise<Success>;
234
- /**
235
- * Updates a single album, artist, song running the gather_art process.
236
- * Doesn't overwrite existing art by default.
237
- * ACCESS REQUIRED: 75 (Catalog Manager)
238
- * @remarks MINIMUM_API_VERSION=400001
239
- * @param params.id UID to update
240
- * @param params.type Object type
241
- * @param [params.overwrite]
242
- * @see {@link https://ampache.org/api/api-json-methods#update_art}
243
- */
244
- updateArt(params: {
245
- id: UID;
246
- type: "artist" | "album" | "song";
247
- overwrite?: BinaryBoolean;
248
- }): Promise<Success>;
249
- /**
250
- * Streams a given media file. Takes the file id in parameter with optional max bit rate, file format, time offset,
251
- * size and estimate content length option.
252
- * NOTE search and playlist will only stream a random object from the list.
253
- * @remarks MINIMUM_API_VERSION=400001
254
- * @param params.id UID to find
255
- * @param params.type Object type
256
- * @param [params.bitrate] Max bitrate for transcoding
257
- * @param [params.format] mp3, ogg, raw, etc. (raw returns the original format)
258
- * @param [params.offset] Time offset
259
- * @param [params.length] 0, 1 (estimate content length)
260
- * @param [params.stats] 0, 1 (if false disable stat recording when playing the object; default: 1)
261
- * @see {@link https://ampache.org/api/api-json-methods#stream}
262
- */
263
- stream(params: {
264
- id: UID;
265
- type: "song" | "podcast_episode" | "search" | "playlist";
266
- bitrate?: number;
267
- format?: string;
268
- offset?: number;
269
- length?: BinaryBoolean;
270
- stats?: BinaryBoolean;
271
- }): Promise<Blob>;
272
- /**
273
- * Downloads a given media file. set format=raw to download the full file
274
- * NOTE search and playlist will only download a random object from the list
275
- * @remarks MINIMUM_API_VERSION=400001
276
- * @param params.id UID to find
277
- * @param params.type Object type
278
- * @param [params.format] mp3, ogg, raw, etc. (raw returns the original format)
279
- * @param [params.bitrate] max bitrate for transcoding in bytes (e.g 192000=192Kb)
280
- * @param [params.stats] 0, 1 (if false disable stat recording when playing the object; default: 1)
281
- * @see {@link https://ampache.org/api/api-json-methods#download}
282
- */
283
- download(params: {
284
- id: UID;
285
- type: "song" | "podcast_episode" | "search" | "playlist";
286
- format?: string;
287
- bitrate?: number;
288
- stats?: BinaryBoolean;
289
- }): Promise<Blob>;
290
- /**
291
- * Get an art image file.
292
- * @remarks MINIMUM_API_VERSION=400001
293
- * @param params.id UID to find
294
- * @param params.type Object type
295
- * @param [params.size] width x height (e.g. '640x480')
296
- * @see {@link https://ampache.org/api/api-json-methods#get_art}
297
- */
298
- getArt(params: {
299
- id: UID;
300
- type: "song" | "artist" | "album" | "playlist" | "search" | "podcast";
301
- size?: string;
302
- }): Promise<Blob>;
303
- /**
304
- * This is for controlling localplay
305
- * @param params.command The command to send to the localplay controller
306
- * @param [params.oid] Object UID
307
- * @param [params.type] Object type
308
- * @param [params.clear] 0, 1 (Clear the current playlist before adding)
309
- * @remarks MINIMUM_API_VERSION=380001; CHANGED_IN_API_VERSION=5.0.0
310
- * @see {@link https://ampache.org/api/api-json-methods#localplay}
311
- */
312
- localplay(params: {
313
- command: "next" | "prev" | "stop" | "play" | "pause" | "add" | "volume_up" | "volume_down" | "volume_mute" | "delete_all" | "skip" | "status";
314
- oid?: number;
315
- type?: "song" | "video" | "podcast_episode" | "channel" | "broadcast" | "democratic" | "live_stream";
316
- clear?: BinaryBoolean;
317
- }): Promise<unknown>;
318
- /**
319
- * Get the list of songs in your localplay playlist
320
- * @remarks MINIMUM_API_VERSION=5.0.0
321
- * @see {@link https://ampache.org/api/api-json-methods#localplay_songs}
322
- */
323
- localplaySongs(): Promise<unknown>;
324
- /**
325
- * This is for controlling democratic play (Songs only). VOTE: +1 vote for the oid. DEVOTE: -1 vote for the oid.
326
- * PLAYLIST: Return an array of song items with an additional VOTE COUNT element.
327
- * PLAY: Returns the URL for playing democratic play.
328
- * @remarks MINIMUM_API_VERSION=380001
329
- * @param params.oid UID of song
330
- * @param params.method vote, devote, playlist, play
331
- * @see {@link https://ampache.org/api/api-json-methods#democratic}
332
- */
333
- democratic(params: {
334
- oid: UID;
335
- method: "vote" | "devote" | "playlist" | "play";
336
- }): Promise<unknown>;
337
- /**
338
- * Get what is currently being played by all users.
339
- * @remarks MINIMUM_API_VERSION=6.3.1
340
- * @see {@link https://ampache.org/api/api-json-methods#now_playing}
341
- */
342
- nowPlaying(): Promise<{
343
- now_playing: NowPlayingResponse[];
344
- }>;
345
- /**
346
- * Inform the server about the state of your client. (Song you are playing, Play/Pause state, etc.)
347
- * @remarks MINIMUM_API_VERSION=6.4.0
348
- * @param params.filter $object_id currently playing/stopping
349
- * @param [params.type] song, video, podcast_episode (Default: song)
350
- * @param [params.state] play, stop (Default: play)
351
- * @param [params.time] current play time in whole seconds (Default: 0)
352
- * @param [params.client] agent/client name
353
- * @see {@link https://ampache.org/api/api-json-methods#player}
354
- */
355
- player(params: {
356
- filter: UID;
357
- type?: "song" | "video" | "podcast_episode";
358
- state?: "play" | "stop";
359
- time?: number;
360
- client?: string;
361
- }): Promise<{
362
- now_playing: NowPlayingResponse[];
363
- }>;
364
- /**
365
- * Perform an advanced search given passed rules.
366
- * You'll want to consult the docs for this.
367
- * @remarks MINIMUM_API_VERSION=380001
368
- * @param params.operator and, or (whether to match one rule or all)
369
- * @param params.type Object type to return
370
- * @param params.rules An array of rules
371
- * @param [params.random] 0, 1 (random order of results; default to 0)
372
- * @param [params.offset]
373
- * @param [params.limit]
374
- * @see {@link https://ampache.org/api/api-json-methods#advanced_search}
375
- */
376
- advancedSearch(params: {
377
- operator: "and" | "or";
378
- type: "song" | "album" | "album_disk" | "artist" | "album_artist" | "song_artist" | "label" | "playlist" | "podcast" | "podcast_episode" | "genre" | "user" | "video";
379
- rules: Array<Array<string>>;
380
- random?: BinaryBoolean;
381
- } & Pagination): any;
382
- search: (params: {
383
- operator: "and" | "or";
384
- type: "song" | "album" | "album_disk" | "artist" | "album_artist" | "song_artist" | "label" | "playlist" | "podcast" | "podcast_episode" | "genre" | "user" | "video";
385
- rules: Array<Array<string>>;
386
- random?: BinaryBoolean;
387
- } & Pagination) => any;
388
- /**
389
- * Perform a search given passed rules and return matching objects in a group.
390
- * If the rules do not exist for the object type or would return the entire table they will not return objects
391
- * You'll want to consult the docs for this.
392
- * @remarks MINIMUM_API_VERSION=6.3.0
393
- * @param params.operator and, or (whether to match one rule or all)
394
- * @param params.rules An array of rules
395
- * @param [params.type] Object type to return (all, music, song_artist, album_artist, podcast, video; all by default)
396
- * @param [params.random] 0, 1 (random order of results; default to 0)
397
- * @param [params.offset]
398
- * @param [params.limit]
399
- * @see {@link https://ampache.org/api/api-json-methods#search_group}
400
- */
401
- searchGroup(params: {
402
- operator: "and" | "or";
403
- rules: Array<Array<string>>;
404
- type?: "all" | "music" | "song_artist" | "album_artist" | "podcast" | "video";
405
- random?: BinaryBoolean;
406
- } & Pagination): any;
407
- }
@@ -1,24 +0,0 @@
1
- import { SongResponse } from "../songs/types";
2
- import { AlbumResponse } from "../albums/types";
3
- import { ArtistResponse } from "../artists/types";
4
- import { PlaylistResponse } from "../playlists/types";
5
- import { PodcastResponse, PodcastEpisodeResponse } from "../podcasts/types";
6
- import { LiveStreamResponse } from "../live-streams/types";
7
- import { VideoResponse } from "../videos/types";
8
- import { UID } from "../base";
9
- import { UserSummary } from "../users/types";
10
- export type IndexType = SongResponse | AlbumResponse | ArtistResponse | PlaylistResponse | PodcastResponse | PodcastEpisodeResponse | LiveStreamResponse;
11
- export type StatsType = SongResponse | AlbumResponse | ArtistResponse | VideoResponse | PlaylistResponse | PodcastResponse | PodcastEpisodeResponse;
12
- export type IndexEntry = {
13
- id: UID;
14
- name: string;
15
- prefix: string;
16
- basename: string;
17
- };
18
- export type NowPlayingResponse = {
19
- id: UID;
20
- type: "song" | "podcast_episode" | "video";
21
- client: string;
22
- expire: number;
23
- user: UserSummary;
24
- };