javascript-ampache 1.0.6 → 1.0.8
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/albums/index.d.ts +10 -4
- package/dist/artists/index.d.ts +10 -4
- package/dist/base.d.ts +10 -0
- package/dist/bookmarks/index.d.ts +1 -1
- package/dist/catalogs/index.d.ts +6 -2
- package/dist/genres/index.d.ts +4 -2
- 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/dist/labels/index.d.ts +4 -2
- package/dist/licenses/index.d.ts +4 -2
- package/dist/live-streams/index.d.ts +4 -2
- package/dist/playlists/index.d.ts +11 -5
- package/dist/podcasts/index.d.ts +7 -3
- package/dist/shares/index.d.ts +4 -2
- package/dist/songs/index.d.ts +16 -6
- package/dist/system/index.d.ts +15 -7
- package/dist/users/index.d.ts +6 -2
- package/package.json +6 -6
- package/src/albums/index.ts +10 -4
- package/src/artists/index.ts +10 -4
- package/src/base.ts +13 -2
- package/src/bookmarks/index.ts +1 -1
- package/src/catalogs/index.ts +6 -2
- package/src/genres/index.ts +4 -2
- package/src/labels/index.ts +4 -2
- package/src/licenses/index.ts +4 -2
- package/src/live-streams/index.ts +4 -2
- package/src/playlists/index.ts +11 -5
- package/src/podcasts/index.ts +7 -3
- package/src/shares/index.ts +4 -2
- package/src/songs/index.ts +16 -6
- package/src/system/index.ts +15 -7
- package/src/users/index.ts +6 -2
package/dist/labels/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Label } from './types';
|
|
2
|
-
import { Base, BinaryBoolean,
|
|
2
|
+
import { Base, BinaryBoolean, ExtendedPagination, UID } from '../base';
|
|
3
3
|
export declare class Labels extends Base {
|
|
4
4
|
/**
|
|
5
5
|
* This returns labels based on the specified filter
|
|
@@ -10,6 +10,8 @@ export declare class Labels extends Base {
|
|
|
10
10
|
* @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
|
|
11
11
|
* @param [params.offset]
|
|
12
12
|
* @param [params.limit]
|
|
13
|
+
* @param [params.cond]
|
|
14
|
+
* @param [params.sort]
|
|
13
15
|
* @see {@link https://ampache.org/api/api-json-methods#labels}
|
|
14
16
|
*/
|
|
15
17
|
labels(params?: {
|
|
@@ -17,7 +19,7 @@ export declare class Labels extends Base {
|
|
|
17
19
|
exact?: BinaryBoolean;
|
|
18
20
|
add?: Date;
|
|
19
21
|
update?: Date;
|
|
20
|
-
} &
|
|
22
|
+
} & ExtendedPagination): Promise<Label[] | {
|
|
21
23
|
label: Label[];
|
|
22
24
|
}>;
|
|
23
25
|
/**
|
package/dist/licenses/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { License } from './types';
|
|
2
|
-
import { Base, BinaryBoolean,
|
|
2
|
+
import { Base, BinaryBoolean, ExtendedPagination, UID } from '../base';
|
|
3
3
|
export declare class Licenses extends Base {
|
|
4
4
|
/**
|
|
5
5
|
* This returns licenses based on the specified filter
|
|
@@ -10,6 +10,8 @@ export declare class Licenses extends Base {
|
|
|
10
10
|
* @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
|
|
11
11
|
* @param [params.offset]
|
|
12
12
|
* @param [params.limit]
|
|
13
|
+
* @param [params.cond]
|
|
14
|
+
* @param [params.sort]
|
|
13
15
|
* @see {@link https://ampache.org/api/api-json-methods#licenses}
|
|
14
16
|
*/
|
|
15
17
|
licenses(params?: {
|
|
@@ -17,7 +19,7 @@ export declare class Licenses extends Base {
|
|
|
17
19
|
exact?: BinaryBoolean;
|
|
18
20
|
add?: Date;
|
|
19
21
|
update?: Date;
|
|
20
|
-
} &
|
|
22
|
+
} & ExtendedPagination): Promise<License[] | {
|
|
21
23
|
license: License[];
|
|
22
24
|
}>;
|
|
23
25
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LiveStream } from './types';
|
|
2
|
-
import { Base, BinaryBoolean,
|
|
2
|
+
import { Base, BinaryBoolean, ExtendedPagination, Success, UID } from '../base';
|
|
3
3
|
export declare class LiveStreams extends Base {
|
|
4
4
|
/**
|
|
5
5
|
* This returns live_streams based on the specified filter
|
|
@@ -10,6 +10,8 @@ export declare class LiveStreams extends Base {
|
|
|
10
10
|
* @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
|
|
11
11
|
* @param [params.offset]
|
|
12
12
|
* @param [params.limit]
|
|
13
|
+
* @param [params.cond]
|
|
14
|
+
* @param [params.sort]
|
|
13
15
|
* @see {@link https://ampache.org/api/api-json-methods#live_streams}
|
|
14
16
|
*/
|
|
15
17
|
liveStreams(params?: {
|
|
@@ -17,7 +19,7 @@ export declare class LiveStreams extends Base {
|
|
|
17
19
|
exact?: BinaryBoolean;
|
|
18
20
|
add?: Date;
|
|
19
21
|
update?: Date;
|
|
20
|
-
} &
|
|
22
|
+
} & ExtendedPagination): Promise<LiveStream[] | {
|
|
21
23
|
live_stream: LiveStream[];
|
|
22
24
|
}>;
|
|
23
25
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Playlist } from './types';
|
|
2
2
|
import { Song } from "../songs/types";
|
|
3
|
-
import { Base, BinaryBoolean, Pagination, Success, UID } from '../base';
|
|
3
|
+
import { Base, BinaryBoolean, ExtendedPagination, Pagination, Success, UID } from '../base';
|
|
4
4
|
export declare class Playlists extends Base {
|
|
5
5
|
/**
|
|
6
6
|
* This returns playlists based on the specified filter
|
|
@@ -13,6 +13,8 @@ export declare class Playlists extends Base {
|
|
|
13
13
|
* @param [params.show_dupes] 0, 1 (if true ignore 'api_hide_dupe_searches' setting)
|
|
14
14
|
* @param [params.offset]
|
|
15
15
|
* @param [params.limit]
|
|
16
|
+
* @param [params.cond]
|
|
17
|
+
* @param [params.sort]
|
|
16
18
|
* @see {@link https://ampache.org/api/api-json-methods#playlists}
|
|
17
19
|
*/
|
|
18
20
|
playlists(params?: {
|
|
@@ -22,7 +24,7 @@ export declare class Playlists extends Base {
|
|
|
22
24
|
update?: Date;
|
|
23
25
|
hide_search?: BinaryBoolean;
|
|
24
26
|
show_dupes?: BinaryBoolean;
|
|
25
|
-
} &
|
|
27
|
+
} & ExtendedPagination): Promise<Playlist[] | {
|
|
26
28
|
playlist: Playlist[];
|
|
27
29
|
}>;
|
|
28
30
|
/**
|
|
@@ -62,6 +64,8 @@ export declare class Playlists extends Base {
|
|
|
62
64
|
* @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
|
|
63
65
|
* @param [params.offset]
|
|
64
66
|
* @param [params.limit]
|
|
67
|
+
* @param [params.cond]
|
|
68
|
+
* @param [params.sort]
|
|
65
69
|
* @see {@link https://ampache.org/api/api-json-methods#user_playlists}
|
|
66
70
|
*/
|
|
67
71
|
userPlaylists(params?: {
|
|
@@ -69,7 +73,7 @@ export declare class Playlists extends Base {
|
|
|
69
73
|
exact?: BinaryBoolean;
|
|
70
74
|
add?: Date;
|
|
71
75
|
update?: Date;
|
|
72
|
-
} &
|
|
76
|
+
} & ExtendedPagination): Promise<Playlist[] | {
|
|
73
77
|
playlist: Playlist[];
|
|
74
78
|
}>;
|
|
75
79
|
/**
|
|
@@ -81,6 +85,8 @@ export declare class Playlists extends Base {
|
|
|
81
85
|
* @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
|
|
82
86
|
* @param [params.offset]
|
|
83
87
|
* @param [params.limit]
|
|
88
|
+
* @param [params.cond]
|
|
89
|
+
* @param [params.sort]
|
|
84
90
|
* @see {@link https://ampache.org/api/api-json-methods#user_smartlists}
|
|
85
91
|
*/
|
|
86
92
|
userSmartlists(params?: {
|
|
@@ -88,7 +94,7 @@ export declare class Playlists extends Base {
|
|
|
88
94
|
exact?: BinaryBoolean;
|
|
89
95
|
add?: Date;
|
|
90
96
|
update?: Date;
|
|
91
|
-
} &
|
|
97
|
+
} & ExtendedPagination): Promise<Playlist[] | {
|
|
92
98
|
playlist: Playlist[];
|
|
93
99
|
}>;
|
|
94
100
|
/**
|
|
@@ -116,7 +122,7 @@ export declare class Playlists extends Base {
|
|
|
116
122
|
type: 'song' | 'album' | 'artist' | 'playlist';
|
|
117
123
|
}): Promise<Success>;
|
|
118
124
|
/**
|
|
119
|
-
* This modifies name and type of
|
|
125
|
+
* This modifies name and type of the playlist.
|
|
120
126
|
* NOTE items and tracks must be sent together and be of equal length.
|
|
121
127
|
* @remarks MINIMUM_API_VERSION=400001
|
|
122
128
|
* @param params.filter UID to find
|
package/dist/podcasts/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Podcast, PodcastEpisode, DeletedPodcastEpisode } from './types';
|
|
2
|
-
import { Base, Pagination, Success, UID } from '../base';
|
|
2
|
+
import { Base, ExtendedPagination, Pagination, Success, UID } from '../base';
|
|
3
3
|
export declare class Podcasts extends Base {
|
|
4
4
|
/**
|
|
5
5
|
* Get information about podcasts
|
|
@@ -8,12 +8,14 @@ export declare class Podcasts extends Base {
|
|
|
8
8
|
* @param [params.include] episodes (include podcast_episodes in the response)
|
|
9
9
|
* @param [params.offset]
|
|
10
10
|
* @param [params.limit]
|
|
11
|
+
* @param [params.cond]
|
|
12
|
+
* @param [params.sort]
|
|
11
13
|
* @see {@link https://ampache.org/api/api-json-methods#podcasts}
|
|
12
14
|
*/
|
|
13
15
|
podcasts(params?: {
|
|
14
16
|
filter?: string;
|
|
15
17
|
include?: 'episodes';
|
|
16
|
-
} &
|
|
18
|
+
} & ExtendedPagination): Promise<Podcast[] | {
|
|
17
19
|
podcast: Podcast[];
|
|
18
20
|
}>;
|
|
19
21
|
/**
|
|
@@ -76,11 +78,13 @@ export declare class Podcasts extends Base {
|
|
|
76
78
|
* @param params.filter UID of podcast
|
|
77
79
|
* @param [params.offset]
|
|
78
80
|
* @param [params.limit]
|
|
81
|
+
* @param [params.cond]
|
|
82
|
+
* @param [params.sort]
|
|
79
83
|
* @see {@link https://ampache.org/api/api-json-methods#podcast_episodes}
|
|
80
84
|
*/
|
|
81
85
|
podcastEpisodes(params: {
|
|
82
86
|
filter: UID;
|
|
83
|
-
} &
|
|
87
|
+
} & ExtendedPagination): Promise<PodcastEpisode[] | {
|
|
84
88
|
podcast_episode: PodcastEpisode[];
|
|
85
89
|
}>;
|
|
86
90
|
/**
|
package/dist/shares/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Share } from './types';
|
|
2
|
-
import { Base, BinaryBoolean,
|
|
2
|
+
import { Base, BinaryBoolean, ExtendedPagination, Success, UID } from '../base';
|
|
3
3
|
export declare class Shares extends Base {
|
|
4
4
|
/**
|
|
5
5
|
* This searches the shares and returns... shares
|
|
@@ -8,12 +8,14 @@ export declare class Shares extends Base {
|
|
|
8
8
|
* @param [params.exact] 0, 1 boolean to match the exact filter string
|
|
9
9
|
* @param [params.offset]
|
|
10
10
|
* @param [params.limit]
|
|
11
|
+
* @param [params.cond]
|
|
12
|
+
* @param [params.sort]
|
|
11
13
|
* @see {@link https://ampache.org/api/api-json-methods#shares}
|
|
12
14
|
*/
|
|
13
15
|
shares(params?: {
|
|
14
16
|
filter?: string;
|
|
15
17
|
exact?: BinaryBoolean;
|
|
16
|
-
} &
|
|
18
|
+
} & ExtendedPagination): Promise<Share[] | {
|
|
17
19
|
share: Share[];
|
|
18
20
|
}>;
|
|
19
21
|
/**
|
package/dist/songs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Song, DeletedSong } from './types';
|
|
2
|
-
import { Base, BinaryBoolean, Pagination, Success, UID } from '../base';
|
|
2
|
+
import { Base, BinaryBoolean, ExtendedPagination, Pagination, Success, UID } from '../base';
|
|
3
3
|
export declare class Songs extends Base {
|
|
4
4
|
/**
|
|
5
5
|
* Returns songs based on the specified filter
|
|
@@ -10,6 +10,8 @@ export declare class Songs extends Base {
|
|
|
10
10
|
* @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
|
|
11
11
|
* @param [params.offset]
|
|
12
12
|
* @param [params.limit]
|
|
13
|
+
* @param [params.cond]
|
|
14
|
+
* @param [params.sort]
|
|
13
15
|
* @see {@link https://ampache.org/api/api-json-methods#songs}
|
|
14
16
|
*/
|
|
15
17
|
songs(params?: {
|
|
@@ -17,7 +19,7 @@ export declare class Songs extends Base {
|
|
|
17
19
|
exact?: BinaryBoolean;
|
|
18
20
|
add?: Date;
|
|
19
21
|
update?: Date;
|
|
20
|
-
} &
|
|
22
|
+
} & ExtendedPagination): Promise<Song[] | {
|
|
21
23
|
song: Song[];
|
|
22
24
|
}>;
|
|
23
25
|
/**
|
|
@@ -36,12 +38,14 @@ export declare class Songs extends Base {
|
|
|
36
38
|
* @param [params.top50] 0, 1 (if true filter to the artist top 50)
|
|
37
39
|
* @param [params.offset]
|
|
38
40
|
* @param [params.limit]
|
|
41
|
+
* @param [params.cond]
|
|
42
|
+
* @param [params.sort]
|
|
39
43
|
* @see {@link https://ampache.org/api/api-json-methods#artist_songs}
|
|
40
44
|
*/
|
|
41
45
|
artistSongs(params: {
|
|
42
46
|
filter: UID;
|
|
43
47
|
top50?: BinaryBoolean;
|
|
44
|
-
} &
|
|
48
|
+
} & ExtendedPagination): Promise<Song[] | {
|
|
45
49
|
song: Song[];
|
|
46
50
|
}>;
|
|
47
51
|
/**
|
|
@@ -50,11 +54,13 @@ export declare class Songs extends Base {
|
|
|
50
54
|
* @param params.filter UID to find
|
|
51
55
|
* @param [params.offset]
|
|
52
56
|
* @param [params.limit]
|
|
57
|
+
* @param [params.cond]
|
|
58
|
+
* @param [params.sort]
|
|
53
59
|
* @see {@link https://ampache.org/api/api-json-methods#album_songs}
|
|
54
60
|
*/
|
|
55
61
|
albumSongs(params: {
|
|
56
62
|
filter: UID;
|
|
57
|
-
} &
|
|
63
|
+
} & ExtendedPagination): Promise<Song[] | {
|
|
58
64
|
song: Song[];
|
|
59
65
|
}>;
|
|
60
66
|
/**
|
|
@@ -63,11 +69,13 @@ export declare class Songs extends Base {
|
|
|
63
69
|
* @param params.filter UID to find
|
|
64
70
|
* @param [params.offset]
|
|
65
71
|
* @param [params.limit]
|
|
72
|
+
* @param [params.cond]
|
|
73
|
+
* @param [params.sort]
|
|
66
74
|
* @see {@link https://ampache.org/api/api-json-methods#genre_songs}
|
|
67
75
|
*/
|
|
68
76
|
genreSongs(params: {
|
|
69
77
|
filter: UID;
|
|
70
|
-
} &
|
|
78
|
+
} & ExtendedPagination): Promise<Song[] | {
|
|
71
79
|
song: Song[];
|
|
72
80
|
}>;
|
|
73
81
|
/**
|
|
@@ -91,11 +99,13 @@ export declare class Songs extends Base {
|
|
|
91
99
|
* @param params.filter UID to find
|
|
92
100
|
* @param [params.offset]
|
|
93
101
|
* @param [params.limit]
|
|
102
|
+
* @param [params.cond]
|
|
103
|
+
* @param [params.sort]
|
|
94
104
|
* @see {@link https://ampache.org/api/api-json-methods#license_songs}
|
|
95
105
|
*/
|
|
96
106
|
licenseSongs(params: {
|
|
97
107
|
filter: UID;
|
|
98
|
-
} &
|
|
108
|
+
} & ExtendedPagination): Promise<Song[] | {
|
|
99
109
|
song: Song[];
|
|
100
110
|
}>;
|
|
101
111
|
/**
|
package/dist/system/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Base, BinaryBoolean, Pagination, Success, UID } from '../base';
|
|
1
|
+
import { Base, BinaryBoolean, ExtendedPagination, Pagination, Success, UID } from '../base';
|
|
2
2
|
import { IndexEntry } from "./types";
|
|
3
3
|
export declare class System extends Base {
|
|
4
4
|
/**
|
|
@@ -18,6 +18,8 @@ export declare class System extends Base {
|
|
|
18
18
|
* @param [params.hide_search] 0, 1 (if true do not include searches/smartlists in the result)
|
|
19
19
|
* @param [params.offset]
|
|
20
20
|
* @param [params.limit]
|
|
21
|
+
* @param [params.cond]
|
|
22
|
+
* @param [params.sort]
|
|
21
23
|
* @see {@link https://ampache.org/api/api-json-methods#get_indexes}
|
|
22
24
|
* @deprecated Being removed in 7.0.0. Use `list` instead.
|
|
23
25
|
*/
|
|
@@ -28,7 +30,7 @@ export declare class System extends Base {
|
|
|
28
30
|
update?: Date;
|
|
29
31
|
include?: BinaryBoolean;
|
|
30
32
|
hide_search?: BinaryBoolean;
|
|
31
|
-
} &
|
|
33
|
+
} & ExtendedPagination): Promise<any>;
|
|
32
34
|
/**
|
|
33
35
|
* This takes a named array of objects and returning `id`, `name`, `prefix` and `basename`
|
|
34
36
|
* @remarks MINIMUM_API_VERSION=6.0.0
|
|
@@ -39,6 +41,8 @@ export declare class System extends Base {
|
|
|
39
41
|
* @param [params.hide_search] 0, 1 (if true do not include searches/smartlists in the result)
|
|
40
42
|
* @param [params.offset]
|
|
41
43
|
* @param [params.limit]
|
|
44
|
+
* @param [params.cond]
|
|
45
|
+
* @param [params.sort]
|
|
42
46
|
* @see {@link https://ampache.org/api/api-json-methods#list}
|
|
43
47
|
*/
|
|
44
48
|
list(params: {
|
|
@@ -47,7 +51,7 @@ export declare class System extends Base {
|
|
|
47
51
|
add?: Date;
|
|
48
52
|
update?: Date;
|
|
49
53
|
hide_search?: BinaryBoolean;
|
|
50
|
-
} &
|
|
54
|
+
} & ExtendedPagination): Promise<{
|
|
51
55
|
list: IndexEntry[];
|
|
52
56
|
}>;
|
|
53
57
|
/**
|
|
@@ -62,6 +66,8 @@ export declare class System extends Base {
|
|
|
62
66
|
* @param [params.hide_search] 0, 1 (if true do not include searches/smartlists in the result)
|
|
63
67
|
* @param [params.offset]
|
|
64
68
|
* @param [params.limit]
|
|
69
|
+
* @param [params.cond]
|
|
70
|
+
* @param [params.sort]
|
|
65
71
|
* @see {@link https://ampache.org/api/api-json-methods#index}
|
|
66
72
|
*/
|
|
67
73
|
index(params: {
|
|
@@ -72,7 +78,7 @@ export declare class System extends Base {
|
|
|
72
78
|
update?: Date;
|
|
73
79
|
include?: BinaryBoolean;
|
|
74
80
|
hide_search?: BinaryBoolean;
|
|
75
|
-
} &
|
|
81
|
+
} & ExtendedPagination): Promise<{
|
|
76
82
|
index: [];
|
|
77
83
|
}>;
|
|
78
84
|
/**
|
|
@@ -86,6 +92,8 @@ export declare class System extends Base {
|
|
|
86
92
|
* @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
|
|
87
93
|
* @param [params.offset]
|
|
88
94
|
* @param [params.limit]
|
|
95
|
+
* @param [params.cond]
|
|
96
|
+
* @param [params.sort]
|
|
89
97
|
* @see {@link https://ampache.org/api/api-json-methods#browse}
|
|
90
98
|
*/
|
|
91
99
|
browse(params: {
|
|
@@ -94,7 +102,7 @@ export declare class System extends Base {
|
|
|
94
102
|
catalog?: number;
|
|
95
103
|
add?: Date;
|
|
96
104
|
update?: Date;
|
|
97
|
-
} &
|
|
105
|
+
} & ExtendedPagination): Promise<{
|
|
98
106
|
browse: IndexEntry[];
|
|
99
107
|
}>;
|
|
100
108
|
/**
|
|
@@ -244,7 +252,7 @@ export declare class System extends Base {
|
|
|
244
252
|
* @param params.id UID to find
|
|
245
253
|
* @param params.type Object type
|
|
246
254
|
* @param [params.bitrate] Max bitrate for transcoding
|
|
247
|
-
* @param [params.format] mp3, ogg, raw, etc (raw returns the original format)
|
|
255
|
+
* @param [params.format] mp3, ogg, raw, etc. (raw returns the original format)
|
|
248
256
|
* @param [params.offset] Time offset
|
|
249
257
|
* @param [params.length] 0, 1 (estimate content length)
|
|
250
258
|
* @see {@link https://ampache.org/api/api-json-methods#stream}
|
|
@@ -263,7 +271,7 @@ export declare class System extends Base {
|
|
|
263
271
|
* @remarks MINIMUM_API_VERSION=400001
|
|
264
272
|
* @param params.id UID to find
|
|
265
273
|
* @param params.type Object type
|
|
266
|
-
* @param [params.format] mp3, ogg, raw, etc (raw returns the original format)
|
|
274
|
+
* @param [params.format] mp3, ogg, raw, etc. (raw returns the original format)
|
|
267
275
|
* @see {@link https://ampache.org/api/api-json-methods#download}
|
|
268
276
|
*/
|
|
269
277
|
download(params: {
|
package/dist/users/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { User, UserSummary, Activity } from './types';
|
|
2
|
-
import { Base, BinaryBoolean, Success } from '../base';
|
|
2
|
+
import { Base, BinaryBoolean, ExtendedPagination, Success } from '../base';
|
|
3
3
|
export declare class Users extends Base {
|
|
4
4
|
/**
|
|
5
5
|
* Get ids and usernames for your site
|
|
@@ -130,11 +130,15 @@ export declare class Users extends Base {
|
|
|
130
130
|
* This gets the followers for the requested username
|
|
131
131
|
* @remarks MINIMUM_API_VERSION=380001
|
|
132
132
|
* @param params.username UID to find
|
|
133
|
+
* @param [params.offset]
|
|
134
|
+
* @param [params.limit]
|
|
135
|
+
* @param [params.cond]
|
|
136
|
+
* @param [params.sort]
|
|
133
137
|
* @see {@link https://ampache.org/api/api-json-methods#followers}
|
|
134
138
|
*/
|
|
135
139
|
followers(params: {
|
|
136
140
|
username: string;
|
|
137
|
-
}): Promise<UserSummary[] | {
|
|
141
|
+
} & ExtendedPagination): Promise<UserSummary[] | {
|
|
138
142
|
user: UserSummary[];
|
|
139
143
|
}>;
|
|
140
144
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "javascript-ampache",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "A JS library for the Ampache API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.m.js",
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
"test": "jest"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@types/jest": "^25.2.
|
|
16
|
+
"@types/jest": "^25.2.3",
|
|
17
|
+
"isomorphic-unfetch": "^3.1.0",
|
|
17
18
|
"jest": "^29.3.1",
|
|
19
|
+
"jssha": "^3.3.0",
|
|
18
20
|
"microbundle": "^0.15.1",
|
|
19
21
|
"nock": "^13.0.0",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"jssha": "^3.3.0",
|
|
23
|
-
"querystringify": "2.2.0"
|
|
22
|
+
"querystringify": "2.2.0",
|
|
23
|
+
"rimraf": "^5.0.0"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [
|
|
26
26
|
"ampache",
|
package/src/albums/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import qs from 'querystringify';
|
|
2
2
|
import { Album } from './types';
|
|
3
|
-
import { Base, BinaryBoolean,
|
|
3
|
+
import { Base, BinaryBoolean, ExtendedPagination, UID } from '../base';
|
|
4
4
|
|
|
5
5
|
export class Albums extends Base {
|
|
6
6
|
/**
|
|
@@ -13,6 +13,8 @@ export class Albums extends Base {
|
|
|
13
13
|
* @param [params.include] albums, songs (include child objects in the response)
|
|
14
14
|
* @param [params.offset]
|
|
15
15
|
* @param [params.limit]
|
|
16
|
+
* @param [params.cond]
|
|
17
|
+
* @param [params.sort]
|
|
16
18
|
* @see {@link https://ampache.org/api/api-json-methods#albums}
|
|
17
19
|
*/
|
|
18
20
|
async albums (params?: {
|
|
@@ -21,7 +23,7 @@ export class Albums extends Base {
|
|
|
21
23
|
add?: Date,
|
|
22
24
|
update?: Date,
|
|
23
25
|
include?: "albums" | "songs",
|
|
24
|
-
} &
|
|
26
|
+
} & ExtendedPagination) {
|
|
25
27
|
let query = 'albums';
|
|
26
28
|
query += qs.stringify(params, '&');
|
|
27
29
|
let data = await this.request<{album: Album[]}>(query);
|
|
@@ -50,11 +52,13 @@ export class Albums extends Base {
|
|
|
50
52
|
* @param params.filter UID to find
|
|
51
53
|
* @param [params.offset]
|
|
52
54
|
* @param [params.limit]
|
|
55
|
+
* @param [params.cond]
|
|
56
|
+
* @param [params.sort]
|
|
53
57
|
* @see {@link https://ampache.org/api/api-json-methods#artist_albums}
|
|
54
58
|
*/
|
|
55
59
|
async artistAlbums (params: {
|
|
56
60
|
filter: UID
|
|
57
|
-
} &
|
|
61
|
+
} & ExtendedPagination) {
|
|
58
62
|
let query = 'artist_albums';
|
|
59
63
|
query += qs.stringify(params, '&');
|
|
60
64
|
let data = await this.request<{album: Album[]}>(query);
|
|
@@ -67,11 +71,13 @@ export class Albums extends Base {
|
|
|
67
71
|
* @param params.filter UID to find
|
|
68
72
|
* @param [params.offset]
|
|
69
73
|
* @param [params.limit]
|
|
74
|
+
* @param [params.cond]
|
|
75
|
+
* @param [params.sort]
|
|
70
76
|
* @see {@link https://ampache.org/api/api-json-methods#genre_albums}
|
|
71
77
|
*/
|
|
72
78
|
async genreAlbums (params?: {
|
|
73
79
|
filter: UID
|
|
74
|
-
} &
|
|
80
|
+
} & ExtendedPagination) {
|
|
75
81
|
let query = 'genre_albums';
|
|
76
82
|
query += qs.stringify(params, '&');
|
|
77
83
|
let data = await this.request<{album: Album[]}>(query);
|
package/src/artists/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import qs from 'querystringify';
|
|
2
2
|
import { Artist } from './types';
|
|
3
|
-
import { Base, BinaryBoolean,
|
|
3
|
+
import { Base, BinaryBoolean, ExtendedPagination, UID } from '../base';
|
|
4
4
|
|
|
5
5
|
export class Artists extends Base {
|
|
6
6
|
/**
|
|
@@ -14,6 +14,8 @@ export class Artists extends Base {
|
|
|
14
14
|
* @param [params.album_artist] 0, 1 (if true filter for album artists only)
|
|
15
15
|
* @param [params.offset]
|
|
16
16
|
* @param [params.limit]
|
|
17
|
+
* @param [params.cond]
|
|
18
|
+
* @param [params.sort]
|
|
17
19
|
* @see {@link https://ampache.org/api/api-json-methods#artists}
|
|
18
20
|
*/
|
|
19
21
|
async artists (params?: {
|
|
@@ -23,7 +25,7 @@ export class Artists extends Base {
|
|
|
23
25
|
update?: Date,
|
|
24
26
|
include?: 'albums' | 'songs',
|
|
25
27
|
album_artist?: BinaryBoolean,
|
|
26
|
-
} &
|
|
28
|
+
} & ExtendedPagination) {
|
|
27
29
|
let query = 'artists';
|
|
28
30
|
query += qs.stringify(params, '&');
|
|
29
31
|
let data = await this.request<{artist: Artist[]}>(query);
|
|
@@ -52,11 +54,13 @@ export class Artists extends Base {
|
|
|
52
54
|
* @param params.filter UID to find
|
|
53
55
|
* @param [params.offset]
|
|
54
56
|
* @param [params.limit]
|
|
57
|
+
* @param [params.cond]
|
|
58
|
+
* @param [params.sort]
|
|
55
59
|
* @see {@link https://ampache.org/api/api-json-methods#genre_artists}
|
|
56
60
|
*/
|
|
57
61
|
async genreArtists (params: {
|
|
58
62
|
filter: UID
|
|
59
|
-
} &
|
|
63
|
+
} & ExtendedPagination) {
|
|
60
64
|
let query = 'genre_artists';
|
|
61
65
|
query += qs.stringify(params, '&');
|
|
62
66
|
let data = await this.request<{artist: Artist[]}>(query);
|
|
@@ -69,11 +73,13 @@ export class Artists extends Base {
|
|
|
69
73
|
* @param params.filter UID of find
|
|
70
74
|
* @param [params.offset]
|
|
71
75
|
* @param [params.limit]
|
|
76
|
+
* @param [params.cond]
|
|
77
|
+
* @param [params.sort]
|
|
72
78
|
* @see {@link https://ampache.org/api/api-json-methods#label_artists}
|
|
73
79
|
*/
|
|
74
80
|
async labelArtists (params: {
|
|
75
81
|
filter: UID
|
|
76
|
-
} &
|
|
82
|
+
} & ExtendedPagination) {
|
|
77
83
|
let query = 'label_artists';
|
|
78
84
|
query += qs.stringify(params, '&');
|
|
79
85
|
let data = await this.request<{artist: Artist[]}>(query);
|
package/src/base.ts
CHANGED
|
@@ -19,6 +19,17 @@ export type Pagination = {
|
|
|
19
19
|
limit?: number,
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* @param [offset] Return results starting from this index position
|
|
24
|
+
* @param [limit] Maximum number of results to return
|
|
25
|
+
* @param [cond] Apply additional filters to the browse using ; separated comma string pairs (e.g. 'filter1,value1;filter2,value2')
|
|
26
|
+
* @param [sort] Sort name or comma-separated key pair. (e.g. 'name,order') Default order 'ASC' (e.g. 'name,ASC' == 'name')
|
|
27
|
+
*/
|
|
28
|
+
export type ExtendedPagination = Pagination & {
|
|
29
|
+
cond?: string,
|
|
30
|
+
sort?: string,
|
|
31
|
+
}
|
|
32
|
+
|
|
22
33
|
export type BinaryBoolean = 0 | 1;
|
|
23
34
|
|
|
24
35
|
export type UID = string | number;
|
|
@@ -40,7 +51,7 @@ export abstract class Base {
|
|
|
40
51
|
|
|
41
52
|
if (this.debug) {
|
|
42
53
|
console.debug(
|
|
43
|
-
"javascript-ampache query URL %c" + url,
|
|
54
|
+
"javascript-ampache query URL %c" + url + "&auth=" + this.sessionKey,
|
|
44
55
|
"color: black; font-style: italic; background-color: orange;padding: 2px"
|
|
45
56
|
);
|
|
46
57
|
}
|
|
@@ -63,7 +74,7 @@ export abstract class Base {
|
|
|
63
74
|
|
|
64
75
|
if (this.debug) {
|
|
65
76
|
console.debug(
|
|
66
|
-
"javascript-ampache query URL %c" + url,
|
|
77
|
+
"javascript-ampache query URL %c" + url + "&auth=" + this.sessionKey,
|
|
67
78
|
"color: black; font-style: italic; background-color: orange;padding: 2px"
|
|
68
79
|
);
|
|
69
80
|
}
|
package/src/bookmarks/index.ts
CHANGED
|
@@ -37,7 +37,7 @@ export class Bookmarks extends Base {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* Get the bookmark from
|
|
40
|
+
* Get the bookmark from its object_id and object_type.
|
|
41
41
|
* @remarks MINIMUM_API_VERSION=5.0.0
|
|
42
42
|
* @param params.filter UID to find
|
|
43
43
|
* @param params.type Object type
|
package/src/catalogs/index.ts
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import qs from 'querystringify';
|
|
2
2
|
import { Catalog } from './types';
|
|
3
|
-
import {
|
|
3
|
+
import {Base, ExtendedPagination, Success, UID} from '../base';
|
|
4
4
|
|
|
5
5
|
export class Catalogs extends Base {
|
|
6
6
|
/**
|
|
7
7
|
* This searches the catalogs and returns... catalogs
|
|
8
8
|
* @remarks MINIMUM_API_VERSION=420000
|
|
9
9
|
* @param [params.filter] Catalog type
|
|
10
|
+
* @param [params.offset]
|
|
11
|
+
* @param [params.limit]
|
|
12
|
+
* @param [params.cond]
|
|
13
|
+
* @param [params.sort]
|
|
10
14
|
* @see {@link https://ampache.org/api/api-json-methods#catalogs}
|
|
11
15
|
*/
|
|
12
16
|
async catalogs (params?: {
|
|
13
17
|
filter?: 'music' | 'clip' | 'tvshow' | 'movie' | 'personal_video' | 'podcast',
|
|
14
|
-
}) {
|
|
18
|
+
} & ExtendedPagination) {
|
|
15
19
|
let query = 'catalogs';
|
|
16
20
|
query += qs.stringify(params, '&');
|
|
17
21
|
let data = await this.request<{catalog: Catalog[]}>(query);
|
package/src/genres/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import qs from 'querystringify';
|
|
2
2
|
import { Genre } from './types';
|
|
3
|
-
import { Base, BinaryBoolean,
|
|
3
|
+
import { Base, BinaryBoolean, ExtendedPagination, UID } from '../base';
|
|
4
4
|
|
|
5
5
|
export class Genres extends Base {
|
|
6
6
|
/**
|
|
@@ -10,12 +10,14 @@ export class Genres extends Base {
|
|
|
10
10
|
* @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
|
|
11
11
|
* @param [params.offset]
|
|
12
12
|
* @param [params.limit]
|
|
13
|
+
* @param [params.cond]
|
|
14
|
+
* @param [params.sort]
|
|
13
15
|
* @see {@link https://ampache.org/api/api-json-methods#genres}
|
|
14
16
|
*/
|
|
15
17
|
async genres (params?: {
|
|
16
18
|
filter?: string,
|
|
17
19
|
exact?: BinaryBoolean,
|
|
18
|
-
} &
|
|
20
|
+
} & ExtendedPagination) {
|
|
19
21
|
let query = 'genres';
|
|
20
22
|
query += qs.stringify(params, '&');
|
|
21
23
|
let data = await this.request<{genre: Genre[]}>(query);
|
package/src/labels/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import qs from 'querystringify';
|
|
2
2
|
import { Label } from './types';
|
|
3
|
-
import { Base, BinaryBoolean,
|
|
3
|
+
import { Base, BinaryBoolean, ExtendedPagination, UID } from '../base';
|
|
4
4
|
|
|
5
5
|
export class Labels extends Base {
|
|
6
6
|
/**
|
|
@@ -12,6 +12,8 @@ export class Labels extends Base {
|
|
|
12
12
|
* @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
|
|
13
13
|
* @param [params.offset]
|
|
14
14
|
* @param [params.limit]
|
|
15
|
+
* @param [params.cond]
|
|
16
|
+
* @param [params.sort]
|
|
15
17
|
* @see {@link https://ampache.org/api/api-json-methods#labels}
|
|
16
18
|
*/
|
|
17
19
|
async labels (params?: {
|
|
@@ -19,7 +21,7 @@ export class Labels extends Base {
|
|
|
19
21
|
exact?: BinaryBoolean,
|
|
20
22
|
add?: Date,
|
|
21
23
|
update?: Date,
|
|
22
|
-
} &
|
|
24
|
+
} & ExtendedPagination) {
|
|
23
25
|
let query = 'labels';
|
|
24
26
|
query += qs.stringify(params, '&');
|
|
25
27
|
let data = await this.request<{label: Label[]}>(query);
|