javascript-ampache 1.2.0 → 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.
- package/README.md +16 -6
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.m.js +1 -1
- package/dist/index.m.js.map +1 -1
- package/dist/index.modern.mjs +1 -1
- package/dist/index.modern.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +8 -7
- package/src/albums.js +106 -0
- package/src/artists.js +105 -0
- package/src/auth.js +142 -0
- package/src/base.js +145 -0
- package/src/bookmarks.js +106 -0
- package/src/catalogs.js +133 -0
- package/src/genres.js +57 -0
- package/src/index.js +30 -0
- package/src/labels.js +53 -0
- package/src/licenses.js +47 -0
- package/src/live-streams.js +97 -0
- package/src/playlists.js +241 -0
- package/src/podcasts.js +230 -0
- package/src/preferences.js +114 -0
- package/src/shares.js +99 -0
- package/src/shouts.js +24 -0
- package/src/songs.js +273 -0
- package/src/system.js +510 -0
- package/src/users.js +224 -0
- package/src/{utils.ts → utils.js} +16 -16
- package/src/videos.js +84 -0
- package/dist/albums/index.d.ts +0 -64
- package/dist/albums/types.d.ts +0 -37
- package/dist/artists/index.d.ts +0 -64
- package/dist/artists/types.d.ts +0 -35
- package/dist/auth/index.d.ts +0 -56
- package/dist/auth/types.d.ts +0 -32
- package/dist/base.d.ts +0 -47
- package/dist/bookmarks/index.d.ts +0 -91
- package/dist/bookmarks/types.d.ts +0 -13
- package/dist/catalogs/index.d.ts +0 -87
- package/dist/catalogs/types.d.ts +0 -19
- package/dist/genres/index.d.ts +0 -28
- package/dist/genres/types.d.ts +0 -22
- package/dist/index.d.ts +0 -24
- package/dist/labels/index.d.ts +0 -32
- package/dist/labels/types.d.ts +0 -18
- package/dist/licenses/index.d.ts +0 -32
- package/dist/licenses/types.d.ts +0 -12
- package/dist/live-streams/index.d.ts +0 -80
- package/dist/live-streams/types.d.ts +0 -14
- package/dist/playlists/index.d.ts +0 -208
- package/dist/playlists/types.d.ts +0 -26
- package/dist/podcasts/index.d.ts +0 -121
- package/dist/podcasts/types.d.ts +0 -79
- package/dist/preferences/index.d.ts +0 -80
- package/dist/preferences/types.d.ts +0 -18
- package/dist/shares/index.d.ts +0 -69
- package/dist/shares/types.d.ts +0 -23
- package/dist/shouts/index.d.ts +0 -17
- package/dist/shouts/types.d.ts +0 -10
- package/dist/songs/index.d.ts +0 -146
- package/dist/songs/types.d.ts +0 -73
- package/dist/system/index.d.ts +0 -419
- package/dist/system/types.d.ts +0 -31
- package/dist/users/index.d.ts +0 -190
- package/dist/users/types.d.ts +0 -34
- package/dist/utils.d.ts +0 -4
- package/dist/videos/index.d.ts +0 -33
- package/dist/videos/types.d.ts +0 -38
- package/src/albums/index.ts +0 -88
- package/src/albums/types.ts +0 -40
- package/src/artists/index.ts +0 -88
- package/src/artists/types.ts +0 -38
- package/src/auth/index.ts +0 -118
- package/src/auth/types.ts +0 -32
- package/src/base.ts +0 -133
- package/src/bookmarks/index.ts +0 -116
- package/src/bookmarks/types.ts +0 -15
- package/src/catalogs/index.ts +0 -130
- package/src/catalogs/types.ts +0 -27
- package/src/genres/index.ts +0 -39
- package/src/genres/types.ts +0 -25
- package/src/index.ts +0 -63
- package/src/labels/index.ts +0 -43
- package/src/labels/types.ts +0 -20
- package/src/licenses/index.ts +0 -43
- package/src/licenses/types.ts +0 -14
- package/src/live-streams/index.ts +0 -104
- package/src/live-streams/types.ts +0 -16
- package/src/playlists/index.ts +0 -284
- package/src/playlists/types.ts +0 -29
- package/src/podcasts/index.ts +0 -174
- package/src/podcasts/types.ts +0 -85
- package/src/preferences/index.ts +0 -114
- package/src/preferences/types.ts +0 -20
- package/src/shares/index.ts +0 -100
- package/src/shares/types.ts +0 -25
- package/src/shouts/index.ts +0 -18
- package/src/shouts/types.ts +0 -11
- package/src/songs/index.ts +0 -221
- package/src/songs/types.ts +0 -77
- package/src/system/index.ts +0 -860
- package/src/system/types.ts +0 -50
- package/src/users/index.ts +0 -227
- package/src/users/types.ts +0 -38
- package/src/videos/index.ts +0 -49
- package/src/videos/types.ts +0 -42
package/dist/songs/index.d.ts
DELETED
|
@@ -1,146 +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=6.7.0
|
|
112
|
-
* @param params.filter UID of song to fetch
|
|
113
|
-
* @see {@link https://ampache.org/api/api-json-methods#song_tags}
|
|
114
|
-
*/
|
|
115
|
-
songTags(params: {
|
|
116
|
-
filter: UID;
|
|
117
|
-
}): Promise<unknown>;
|
|
118
|
-
/**
|
|
119
|
-
* This takes a URL and returns the song object in question
|
|
120
|
-
* @remarks MINIMUM_API_VERSION=380001
|
|
121
|
-
* @param params.url Full Ampache URL from server
|
|
122
|
-
* @see {@link https://ampache.org/api/api-json-methods#url_to_song}
|
|
123
|
-
*/
|
|
124
|
-
urlToSong(params: {
|
|
125
|
-
url: string;
|
|
126
|
-
}): Promise<SongResponse>;
|
|
127
|
-
/**
|
|
128
|
-
* This searches the songs and returns... songs
|
|
129
|
-
* @remarks MINIMUM_API_VERSION=380001
|
|
130
|
-
* @param params.filter Filter results to match this string
|
|
131
|
-
* @param [params.offset]
|
|
132
|
-
* @param [params.limit]
|
|
133
|
-
* @see {@link https://ampache.org/api/api-json-methods#search_songs}
|
|
134
|
-
*/
|
|
135
|
-
searchSongs(params: {
|
|
136
|
-
filter: string;
|
|
137
|
-
} & Pagination): Promise<SongsResponse>;
|
|
138
|
-
/**
|
|
139
|
-
* Returns songs that have been deleted from the server
|
|
140
|
-
* @remarks MINIMUM_API_VERSION=500000
|
|
141
|
-
* @param [params.offset]
|
|
142
|
-
* @param [params.limit]
|
|
143
|
-
* @see {@link https://ampache.org/api/api-json-methods#deleted_songs}
|
|
144
|
-
*/
|
|
145
|
-
deletedSongs(params?: {} & Pagination): Promise<DeletedSongsResponse>;
|
|
146
|
-
}
|
package/dist/songs/types.d.ts
DELETED
|
@@ -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
|
-
};
|
package/dist/system/index.d.ts
DELETED
|
@@ -1,419 +0,0 @@
|
|
|
1
|
-
import { Base, BinaryBoolean, ExtendedPagination, Pagination, Success, UID } from "../base";
|
|
2
|
-
import { IndexEntry, NowPlayingResponse, RuleResponse } 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
|
-
cond?: string;
|
|
106
|
-
} & ExtendedPagination): Promise<{
|
|
107
|
-
browse: IndexEntry[];
|
|
108
|
-
}>;
|
|
109
|
-
/**
|
|
110
|
-
* Return similar artist IDs or similar song IDs compared to the input filter
|
|
111
|
-
* @remarks MINIMUM_API_VERSION=420000
|
|
112
|
-
* @param params.type type of object to check against
|
|
113
|
-
* @param params.filter UID to find
|
|
114
|
-
* @param [params.offset]
|
|
115
|
-
* @param [params.limit]
|
|
116
|
-
* @see {@link https://ampache.org/api/api-json-methods#get_similar}
|
|
117
|
-
*/
|
|
118
|
-
getSimilar(params: {
|
|
119
|
-
type: "song" | "artist";
|
|
120
|
-
filter: UID;
|
|
121
|
-
} & Pagination): any;
|
|
122
|
-
/**
|
|
123
|
-
* Get some items based on some simple search types and filters. (Random by default)
|
|
124
|
-
* @remarks MINIMUM_API_VERSION=380001; CHANGED_IN_API_VERSION=400001
|
|
125
|
-
* @param params.type Object type
|
|
126
|
-
* @param [params.filter] newest, highest, frequent, recent, forgotten, flagged, random
|
|
127
|
-
* @param [params.user_id] Filter results to a certain user by UID
|
|
128
|
-
* @param [params.username] Filter results to a certain user by username
|
|
129
|
-
* @param [params.offset]
|
|
130
|
-
* @param [params.limit]
|
|
131
|
-
* @see {@link https://ampache.org/api/api-json-methods#stats}
|
|
132
|
-
*/
|
|
133
|
-
stats(params: {
|
|
134
|
-
type: "song" | "album" | "artist" | "video" | "playlist" | "podcast" | "podcast_episode";
|
|
135
|
-
filter?: "newest" | "highest" | "frequent" | "recent" | "forgotten" | "flagged" | "random";
|
|
136
|
-
user_id?: number;
|
|
137
|
-
username?: string;
|
|
138
|
-
} & Pagination): any;
|
|
139
|
-
/**
|
|
140
|
-
* This rates a library item
|
|
141
|
-
* @remarks MINIMUM_API_VERSION=380001
|
|
142
|
-
* @param params.type Object type
|
|
143
|
-
* @param params.id UID to find
|
|
144
|
-
* @param params.rating Rating to apply
|
|
145
|
-
* @see {@link https://ampache.org/api/api-json-methods#rate}
|
|
146
|
-
*/
|
|
147
|
-
rate(params: {
|
|
148
|
-
type: "song" | "album" | "artist" | "playlist" | "podcast" | "podcast_episode" | "video" | "tvshow" | "tvshow_season";
|
|
149
|
-
id: UID;
|
|
150
|
-
rating: 0 | 1 | 2 | 3 | 4 | 5;
|
|
151
|
-
}): Promise<Success>;
|
|
152
|
-
/**
|
|
153
|
-
* This flags a library item as a favorite
|
|
154
|
-
* @remarks MINIMUM_API_VERSION=400001
|
|
155
|
-
* @param params.type Object type
|
|
156
|
-
* @param params.id UID to find
|
|
157
|
-
* @param params.flag 0, 1
|
|
158
|
-
* @param [params.date] UNIXTIME
|
|
159
|
-
* @see {@link https://ampache.org/api/api-json-methods#flag}
|
|
160
|
-
*/
|
|
161
|
-
flag(params: {
|
|
162
|
-
type: "song" | "album" | "artist" | "playlist" | "podcast" | "podcast_episode" | "video" | "tvshow" | "tvshow_season";
|
|
163
|
-
id: UID;
|
|
164
|
-
flag: BinaryBoolean;
|
|
165
|
-
date?: number;
|
|
166
|
-
}): Promise<Success>;
|
|
167
|
-
/**
|
|
168
|
-
* 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.
|
|
169
|
-
* If you don't supply a user id (optional) then just fall back to you.
|
|
170
|
-
* ACCESS REQUIRED: 100 (Admin) permission to change another user's play history
|
|
171
|
-
* @remarks MINIMUM_API_VERSION=400001
|
|
172
|
-
* @param params.id UID of song
|
|
173
|
-
* @param [params.user] UID of user
|
|
174
|
-
* @param [params.client] Client string
|
|
175
|
-
* @param [params.date] UNIXTIME
|
|
176
|
-
* @see {@link https://ampache.org/api/api-json-methods#record_play}
|
|
177
|
-
*/
|
|
178
|
-
recordPlay(params: {
|
|
179
|
-
id: UID;
|
|
180
|
-
user?: UID;
|
|
181
|
-
client?: string;
|
|
182
|
-
date?: number;
|
|
183
|
-
}): Promise<Success>;
|
|
184
|
-
/**
|
|
185
|
-
* Search for a song using text info and then record a play if found. This allows other sources to record play history to ampache
|
|
186
|
-
* @remarks MINIMUM_API_VERSION=400001
|
|
187
|
-
* @param params.song HTML encoded string
|
|
188
|
-
* @param params.artist HTML encoded string
|
|
189
|
-
* @param params.album HTML encoded string
|
|
190
|
-
* @param [params.songmbid] Song MBID
|
|
191
|
-
* @param [params.artistmbid] Artist MBID
|
|
192
|
-
* @param [params.albummbid] Album MBID
|
|
193
|
-
* @param [params.song_mbid] Alias of songmbid
|
|
194
|
-
* @param [params.artist_mbid] Alias of artistmbid
|
|
195
|
-
* @param [params.album_mbid] Alias of albummbid
|
|
196
|
-
* @param [params.date] UNIXTIME
|
|
197
|
-
* @param [params.client] Client string
|
|
198
|
-
* @see {@link https://ampache.org/api/api-json-methods#scrobble}
|
|
199
|
-
*/
|
|
200
|
-
scrobble(params: {
|
|
201
|
-
song: string;
|
|
202
|
-
artist: string;
|
|
203
|
-
album: string;
|
|
204
|
-
songmbid?: string;
|
|
205
|
-
artistmbid?: string;
|
|
206
|
-
albummbid?: string;
|
|
207
|
-
song_mbid?: string;
|
|
208
|
-
artist_mbid?: string;
|
|
209
|
-
album_mbid?: string;
|
|
210
|
-
date?: number;
|
|
211
|
-
client?: string;
|
|
212
|
-
}): Promise<Success>;
|
|
213
|
-
/**
|
|
214
|
-
* Update a single album, artist, song from the tag data
|
|
215
|
-
* @remarks MINIMUM_API_VERSION=400001
|
|
216
|
-
* @param params.type Object type
|
|
217
|
-
* @param params.id UID to find
|
|
218
|
-
* @see {@link https://ampache.org/api/api-json-methods#update_from_tags}
|
|
219
|
-
*/
|
|
220
|
-
updateFromTags(params: {
|
|
221
|
-
type: "song" | "artist" | "album";
|
|
222
|
-
id: UID;
|
|
223
|
-
}): Promise<Success>;
|
|
224
|
-
/**
|
|
225
|
-
* Update artist information and fetch similar artists from last.fm
|
|
226
|
-
* Make sure lastfm_API_key is set in your configuration file
|
|
227
|
-
* ACCESS REQUIRED: 75 (Catalog Manager)
|
|
228
|
-
* @remarks MINIMUM_API_VERSION=400001
|
|
229
|
-
* @param params.id UID to find
|
|
230
|
-
* @see {@link https://ampache.org/api/api-json-methods#update_artist_info}
|
|
231
|
-
*/
|
|
232
|
-
updateArtistInfo(params: {
|
|
233
|
-
id: UID;
|
|
234
|
-
}): Promise<Success>;
|
|
235
|
-
/**
|
|
236
|
-
* Updates a single album, artist, song running the gather_art process.
|
|
237
|
-
* Doesn't overwrite existing art by default.
|
|
238
|
-
* ACCESS REQUIRED: 75 (Catalog Manager)
|
|
239
|
-
* @remarks MINIMUM_API_VERSION=400001
|
|
240
|
-
* @param params.id UID to update
|
|
241
|
-
* @param params.type Object type
|
|
242
|
-
* @param [params.overwrite]
|
|
243
|
-
* @see {@link https://ampache.org/api/api-json-methods#update_art}
|
|
244
|
-
*/
|
|
245
|
-
updateArt(params: {
|
|
246
|
-
id: UID;
|
|
247
|
-
type: "artist" | "album" | "song";
|
|
248
|
-
overwrite?: BinaryBoolean;
|
|
249
|
-
}): Promise<Success>;
|
|
250
|
-
/**
|
|
251
|
-
* Streams a given media file. Takes the file id in parameter with optional max bit rate, file format, time offset,
|
|
252
|
-
* size and estimate content length option.
|
|
253
|
-
* NOTE search and playlist will only stream a random object from the list.
|
|
254
|
-
* @remarks MINIMUM_API_VERSION=400001
|
|
255
|
-
* @param params.id UID to find
|
|
256
|
-
* @param params.type Object type
|
|
257
|
-
* @param [params.bitrate] Max bitrate for transcoding
|
|
258
|
-
* @param [params.format] mp3, ogg, raw, etc. (raw returns the original format)
|
|
259
|
-
* @param [params.offset] Time offset
|
|
260
|
-
* @param [params.length] 0, 1 (estimate content length)
|
|
261
|
-
* @param [params.stats] 0, 1 (if false disable stat recording when playing the object; default: 1)
|
|
262
|
-
* @see {@link https://ampache.org/api/api-json-methods#stream}
|
|
263
|
-
*/
|
|
264
|
-
stream(params: {
|
|
265
|
-
id: UID;
|
|
266
|
-
type: "song" | "podcast_episode" | "search" | "playlist";
|
|
267
|
-
bitrate?: number;
|
|
268
|
-
format?: string;
|
|
269
|
-
offset?: number;
|
|
270
|
-
length?: BinaryBoolean;
|
|
271
|
-
stats?: BinaryBoolean;
|
|
272
|
-
}): Promise<Blob>;
|
|
273
|
-
/**
|
|
274
|
-
* Downloads a given media file. set format=raw to download the full file
|
|
275
|
-
* NOTE search and playlist will only download a random object from the list
|
|
276
|
-
* @remarks MINIMUM_API_VERSION=400001
|
|
277
|
-
* @param params.id UID to find
|
|
278
|
-
* @param params.type Object type
|
|
279
|
-
* @param [params.format] mp3, ogg, raw, etc. (raw returns the original format)
|
|
280
|
-
* @param [params.bitrate] max bitrate for transcoding in bytes (e.g 192000=192Kb)
|
|
281
|
-
* @param [params.stats] 0, 1 (if false disable stat recording when playing the object; default: 1)
|
|
282
|
-
* @see {@link https://ampache.org/api/api-json-methods#download}
|
|
283
|
-
*/
|
|
284
|
-
download(params: {
|
|
285
|
-
id: UID;
|
|
286
|
-
type: "song" | "podcast_episode" | "search" | "playlist";
|
|
287
|
-
format?: string;
|
|
288
|
-
bitrate?: number;
|
|
289
|
-
stats?: BinaryBoolean;
|
|
290
|
-
}): Promise<Blob>;
|
|
291
|
-
/**
|
|
292
|
-
* Get an art image file.
|
|
293
|
-
* @remarks MINIMUM_API_VERSION=400001
|
|
294
|
-
* @param params.id UID to find
|
|
295
|
-
* @param params.type Object type
|
|
296
|
-
* @param [params.size] width x height (e.g. '640x480')
|
|
297
|
-
* @see {@link https://ampache.org/api/api-json-methods#get_art}
|
|
298
|
-
*/
|
|
299
|
-
getArt(params: {
|
|
300
|
-
id: UID;
|
|
301
|
-
type: "song" | "artist" | "album" | "playlist" | "search" | "podcast";
|
|
302
|
-
size?: string;
|
|
303
|
-
}): Promise<Blob>;
|
|
304
|
-
/**
|
|
305
|
-
* This is for controlling localplay
|
|
306
|
-
* @param params.command The command to send to the localplay controller
|
|
307
|
-
* @param [params.oid] Object UID
|
|
308
|
-
* @param [params.type] Object type
|
|
309
|
-
* @param [params.clear] 0, 1 (Clear the current playlist before adding)
|
|
310
|
-
* @remarks MINIMUM_API_VERSION=380001; CHANGED_IN_API_VERSION=5.0.0
|
|
311
|
-
* @see {@link https://ampache.org/api/api-json-methods#localplay}
|
|
312
|
-
*/
|
|
313
|
-
localplay(params: {
|
|
314
|
-
command: "next" | "prev" | "stop" | "play" | "pause" | "add" | "volume_up" | "volume_down" | "volume_mute" | "delete_all" | "skip" | "status";
|
|
315
|
-
oid?: number;
|
|
316
|
-
type?: "song" | "video" | "podcast_episode" | "channel" | "broadcast" | "democratic" | "live_stream";
|
|
317
|
-
clear?: BinaryBoolean;
|
|
318
|
-
}): Promise<unknown>;
|
|
319
|
-
/**
|
|
320
|
-
* Get the list of songs in your localplay playlist
|
|
321
|
-
* @remarks MINIMUM_API_VERSION=5.0.0
|
|
322
|
-
* @see {@link https://ampache.org/api/api-json-methods#localplay_songs}
|
|
323
|
-
*/
|
|
324
|
-
localplaySongs(): Promise<unknown>;
|
|
325
|
-
/**
|
|
326
|
-
* This is for controlling democratic play (Songs only). VOTE: +1 vote for the oid. DEVOTE: -1 vote for the oid.
|
|
327
|
-
* PLAYLIST: Return an array of song items with an additional VOTE COUNT element.
|
|
328
|
-
* PLAY: Returns the URL for playing democratic play.
|
|
329
|
-
* @remarks MINIMUM_API_VERSION=380001
|
|
330
|
-
* @param params.oid UID of song
|
|
331
|
-
* @param params.method vote, devote, playlist, play
|
|
332
|
-
* @see {@link https://ampache.org/api/api-json-methods#democratic}
|
|
333
|
-
*/
|
|
334
|
-
democratic(params: {
|
|
335
|
-
oid: UID;
|
|
336
|
-
method: "vote" | "devote" | "playlist" | "play";
|
|
337
|
-
}): Promise<unknown>;
|
|
338
|
-
/**
|
|
339
|
-
* Get what is currently being played by all users.
|
|
340
|
-
* @remarks MINIMUM_API_VERSION=6.3.1
|
|
341
|
-
* @see {@link https://ampache.org/api/api-json-methods#now_playing}
|
|
342
|
-
*/
|
|
343
|
-
nowPlaying(): Promise<{
|
|
344
|
-
now_playing: NowPlayingResponse[];
|
|
345
|
-
}>;
|
|
346
|
-
/**
|
|
347
|
-
* Inform the server about the state of your client. (Song you are playing, Play/Pause state, etc.)
|
|
348
|
-
* @remarks MINIMUM_API_VERSION=6.4.0
|
|
349
|
-
* @param params.filter $object_id currently playing/stopping
|
|
350
|
-
* @param [params.type] song, video, podcast_episode (Default: song)
|
|
351
|
-
* @param [params.state] play, stop (Default: play)
|
|
352
|
-
* @param [params.time] current play time in whole seconds (Default: 0)
|
|
353
|
-
* @param [params.client] agent/client name
|
|
354
|
-
* @see {@link https://ampache.org/api/api-json-methods#player}
|
|
355
|
-
*/
|
|
356
|
-
player(params: {
|
|
357
|
-
filter: UID;
|
|
358
|
-
type?: "song" | "video" | "podcast_episode";
|
|
359
|
-
state?: "play" | "stop";
|
|
360
|
-
time?: number;
|
|
361
|
-
client?: string;
|
|
362
|
-
}): Promise<{
|
|
363
|
-
now_playing: NowPlayingResponse[];
|
|
364
|
-
}>;
|
|
365
|
-
/**
|
|
366
|
-
* Print a list of valid search rules for your search type
|
|
367
|
-
* @remarks MINIMUM_API_VERSION=6.8.0
|
|
368
|
-
* @param params.filter Object type
|
|
369
|
-
* @see {@link https://ampache.org/api/api-json-methods#search_rules}
|
|
370
|
-
*/
|
|
371
|
-
searchRules(params: {
|
|
372
|
-
filter: "song" | "album" | "song_artist" | "album_artist" | "artist" | "label" | "playlist" | "podcast" | "podcast_episode" | "genre" | "user" | "video";
|
|
373
|
-
}): Promise<{
|
|
374
|
-
rule: RuleResponse[];
|
|
375
|
-
}>;
|
|
376
|
-
/**
|
|
377
|
-
* Perform an advanced search given passed rules.
|
|
378
|
-
* You'll want to consult the docs for this.
|
|
379
|
-
* @remarks MINIMUM_API_VERSION=380001
|
|
380
|
-
* @param params.operator and, or (whether to match one rule or all)
|
|
381
|
-
* @param params.type Object type to return
|
|
382
|
-
* @param params.rules An array of rules
|
|
383
|
-
* @param [params.random] 0, 1 (random order of results; default to 0)
|
|
384
|
-
* @param [params.offset]
|
|
385
|
-
* @param [params.limit]
|
|
386
|
-
* @see {@link https://ampache.org/api/api-json-methods#advanced_search}
|
|
387
|
-
*/
|
|
388
|
-
advancedSearch(params: {
|
|
389
|
-
operator: "and" | "or";
|
|
390
|
-
type: "song" | "album" | "album_disk" | "artist" | "album_artist" | "song_artist" | "label" | "playlist" | "podcast" | "podcast_episode" | "genre" | "user" | "video";
|
|
391
|
-
rules: Array<Array<string>>;
|
|
392
|
-
random?: BinaryBoolean;
|
|
393
|
-
} & Pagination): any;
|
|
394
|
-
search: (params: {
|
|
395
|
-
operator: "and" | "or";
|
|
396
|
-
type: "song" | "album" | "album_disk" | "artist" | "album_artist" | "song_artist" | "label" | "playlist" | "podcast" | "podcast_episode" | "genre" | "user" | "video";
|
|
397
|
-
rules: Array<Array<string>>;
|
|
398
|
-
random?: BinaryBoolean;
|
|
399
|
-
} & Pagination) => any;
|
|
400
|
-
/**
|
|
401
|
-
* Perform a search given passed rules and return matching objects in a group.
|
|
402
|
-
* If the rules do not exist for the object type or would return the entire table they will not return objects
|
|
403
|
-
* You'll want to consult the docs for this.
|
|
404
|
-
* @remarks MINIMUM_API_VERSION=6.3.0
|
|
405
|
-
* @param params.operator and, or (whether to match one rule or all)
|
|
406
|
-
* @param params.rules An array of rules
|
|
407
|
-
* @param [params.type] Object type to return (all, music, song_artist, album_artist, podcast, video; all by default)
|
|
408
|
-
* @param [params.random] 0, 1 (random order of results; default to 0)
|
|
409
|
-
* @param [params.offset]
|
|
410
|
-
* @param [params.limit]
|
|
411
|
-
* @see {@link https://ampache.org/api/api-json-methods#search_group}
|
|
412
|
-
*/
|
|
413
|
-
searchGroup(params: {
|
|
414
|
-
operator: "and" | "or";
|
|
415
|
-
rules: Array<Array<string>>;
|
|
416
|
-
type?: "all" | "music" | "song_artist" | "album_artist" | "podcast" | "video";
|
|
417
|
-
random?: BinaryBoolean;
|
|
418
|
-
} & Pagination): any;
|
|
419
|
-
}
|
package/dist/system/types.d.ts
DELETED
|
@@ -1,31 +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
|
-
};
|
|
25
|
-
export type RuleResponse = {
|
|
26
|
-
name: string;
|
|
27
|
-
label: string;
|
|
28
|
-
type: string;
|
|
29
|
-
title: string;
|
|
30
|
-
widget: string[];
|
|
31
|
-
};
|