javascript-ampache 1.0.9 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -47
- package/dist/albums/index.d.ts +7 -13
- package/dist/albums/types.d.ts +9 -4
- package/dist/artists/index.d.ts +8 -14
- package/dist/artists/types.d.ts +10 -5
- package/dist/auth/index.d.ts +1 -1
- package/dist/base.d.ts +5 -0
- package/dist/bookmarks/index.d.ts +20 -21
- package/dist/bookmarks/types.d.ts +7 -2
- package/dist/catalogs/index.d.ts +9 -11
- package/dist/catalogs/types.d.ts +8 -3
- package/dist/genres/index.d.ts +4 -6
- package/dist/genres/types.d.ts +6 -1
- package/dist/index.d.ts +19 -19
- 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 -6
- package/dist/labels/types.d.ts +6 -1
- package/dist/licenses/index.d.ts +4 -6
- package/dist/licenses/types.d.ts +6 -1
- package/dist/live-streams/index.d.ts +8 -10
- package/dist/live-streams/types.d.ts +6 -1
- package/dist/playlists/index.d.ts +15 -25
- package/dist/playlists/types.d.ts +7 -2
- package/dist/podcasts/index.d.ts +10 -16
- package/dist/podcasts/types.d.ts +20 -5
- package/dist/preferences/index.d.ts +8 -16
- package/dist/preferences/types.d.ts +6 -1
- package/dist/shares/index.d.ts +7 -9
- package/dist/shares/types.d.ts +6 -1
- package/dist/shouts/index.d.ts +4 -4
- package/dist/shouts/types.d.ts +1 -1
- package/dist/songs/index.d.ts +12 -28
- package/dist/songs/types.d.ts +12 -2
- package/dist/system/index.d.ts +24 -24
- package/dist/system/types.d.ts +9 -9
- package/dist/users/index.d.ts +10 -10
- package/dist/users/types.d.ts +7 -2
- package/dist/videos/index.d.ts +5 -9
- package/dist/videos/types.d.ts +12 -2
- package/package.json +38 -38
- package/src/albums/index.ts +86 -86
- package/src/albums/types.ts +38 -32
- package/src/artists/index.ts +88 -88
- package/src/artists/types.ts +38 -32
- package/src/auth/index.ts +103 -103
- package/src/auth/types.ts +25 -25
- package/src/base.ts +134 -119
- package/src/bookmarks/index.ts +116 -122
- package/src/bookmarks/types.ts +15 -9
- package/src/catalogs/index.ts +130 -119
- package/src/catalogs/types.ts +27 -15
- package/src/genres/index.ts +39 -40
- package/src/genres/types.ts +23 -17
- package/src/index.ts +63 -26
- package/src/labels/index.ts +43 -44
- package/src/labels/types.ts +20 -14
- package/src/licenses/index.ts +43 -44
- package/src/licenses/types.ts +14 -8
- package/src/live-streams/index.ts +104 -107
- package/src/live-streams/types.ts +16 -10
- package/src/playlists/index.ts +262 -269
- package/src/playlists/types.ts +20 -14
- package/src/podcasts/index.ts +174 -177
- package/src/podcasts/types.ts +85 -67
- package/src/preferences/index.ts +114 -116
- package/src/preferences/types.ts +18 -12
- package/src/shares/index.ts +100 -96
- package/src/shares/types.ts +25 -19
- package/src/shouts/index.ts +18 -22
- package/src/shouts/types.ts +9 -9
- package/src/songs/index.ts +208 -203
- package/src/songs/types.ts +77 -65
- package/src/system/index.ts +689 -572
- package/src/system/types.ts +33 -19
- package/src/users/index.ts +227 -245
- package/src/users/types.ts +38 -32
- package/src/utils.ts +25 -25
- package/src/videos/index.ts +49 -53
- package/src/videos/types.ts +42 -30
package/README.md
CHANGED
|
@@ -1,47 +1,50 @@
|
|
|
1
|
-
# javascript-ampache
|
|
2
|
-
|
|
3
|
-
A JS client for the Ampache API written in Typescript.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install javascript-ampache
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
Import `javascript-ampache` module in your project and initialize it with the URL to your server e.g. http://music.com.au
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
import AmpacheAPI from
|
|
17
|
-
|
|
18
|
-
const API = new AmpacheAPI({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
# javascript-ampache
|
|
2
|
+
|
|
3
|
+
A JS client for the Ampache API written in Typescript.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install javascript-ampache
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Import `javascript-ampache` module in your project and initialize it with the URL to your server e.g. http://music.com.au
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import AmpacheAPI from "javascript-ampache";
|
|
17
|
+
|
|
18
|
+
const API = new AmpacheAPI({
|
|
19
|
+
url: "http://pathToYourAmpacheServer",
|
|
20
|
+
sessionKey: yourSessionAuthKey,
|
|
21
|
+
}); // debug: true - will log the final GET to console
|
|
22
|
+
|
|
23
|
+
// either set the session key at time of instantiation or set/update with:
|
|
24
|
+
API.setSessionKey(yourSessionAuthKey);
|
|
25
|
+
|
|
26
|
+
let allUsers = API.users();
|
|
27
|
+
|
|
28
|
+
let thisAlbum = API.album({ filter: 123 });
|
|
29
|
+
|
|
30
|
+
let results = API.advancedSearch({
|
|
31
|
+
type: "album",
|
|
32
|
+
operator: "and",
|
|
33
|
+
random: 1,
|
|
34
|
+
limit: 20,
|
|
35
|
+
rules: [
|
|
36
|
+
["title", 0, "monkey"], // Title contains 'monkey'
|
|
37
|
+
["myrating", 2, 4], // Rating is 4 stars
|
|
38
|
+
],
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Build
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm run build
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Special thanks
|
|
49
|
+
|
|
50
|
+
https://lyamkin.com/blog/how-to-build-api-client-library-in-js/ & https://github.com/ilyamkin/dev-to-js
|
package/dist/albums/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Base, BinaryBoolean, ExtendedPagination, UID } from
|
|
1
|
+
import { AlbumResponse, AlbumsResponse } from "./types";
|
|
2
|
+
import { Base, BinaryBoolean, ExtendedPagination, UID } from "../base";
|
|
3
3
|
export declare class Albums extends Base {
|
|
4
4
|
/**
|
|
5
5
|
* This returns albums based on the provided search filters
|
|
@@ -21,9 +21,7 @@ export declare class Albums extends Base {
|
|
|
21
21
|
add?: Date;
|
|
22
22
|
update?: Date;
|
|
23
23
|
include?: "albums" | "songs";
|
|
24
|
-
} & ExtendedPagination): Promise<
|
|
25
|
-
album: Album[];
|
|
26
|
-
}>;
|
|
24
|
+
} & ExtendedPagination): Promise<AlbumsResponse>;
|
|
27
25
|
/**
|
|
28
26
|
* This returns a single album based on the UID provided
|
|
29
27
|
* @remarks MINIMUM_API_VERSION=380001
|
|
@@ -33,8 +31,8 @@ export declare class Albums extends Base {
|
|
|
33
31
|
*/
|
|
34
32
|
album(params: {
|
|
35
33
|
filter: UID;
|
|
36
|
-
include?:
|
|
37
|
-
}): Promise<
|
|
34
|
+
include?: "songs";
|
|
35
|
+
}): Promise<AlbumResponse>;
|
|
38
36
|
/**
|
|
39
37
|
* This returns the albums of an artist
|
|
40
38
|
* @remarks MINIMUM_API_VERSION=380001
|
|
@@ -47,9 +45,7 @@ export declare class Albums extends Base {
|
|
|
47
45
|
*/
|
|
48
46
|
artistAlbums(params: {
|
|
49
47
|
filter: UID;
|
|
50
|
-
} & ExtendedPagination): Promise<
|
|
51
|
-
album: Album[];
|
|
52
|
-
}>;
|
|
48
|
+
} & ExtendedPagination): Promise<AlbumsResponse>;
|
|
53
49
|
/**
|
|
54
50
|
* This returns the albums associated with the genre in question
|
|
55
51
|
* @remarks MINIMUM_API_VERSION=380001
|
|
@@ -62,7 +58,5 @@ export declare class Albums extends Base {
|
|
|
62
58
|
*/
|
|
63
59
|
genreAlbums(params?: {
|
|
64
60
|
filter: UID;
|
|
65
|
-
} & ExtendedPagination): Promise<
|
|
66
|
-
album: Album[];
|
|
67
|
-
}>;
|
|
61
|
+
} & ExtendedPagination): Promise<AlbumsResponse>;
|
|
68
62
|
}
|
package/dist/albums/types.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { UID } from
|
|
1
|
+
import { UID } from "../base";
|
|
2
2
|
import { GenreSummary } from "../genres/types";
|
|
3
3
|
import { ArtistSummary } from "../artists/types";
|
|
4
|
-
import {
|
|
4
|
+
import { SongResponse } from "../songs/types";
|
|
5
5
|
export type AlbumSummary = {
|
|
6
6
|
id: UID;
|
|
7
7
|
name: string;
|
|
8
8
|
prefix: string | null;
|
|
9
9
|
basename: string;
|
|
10
10
|
};
|
|
11
|
-
export type
|
|
11
|
+
export type AlbumResponse = {
|
|
12
12
|
id: UID;
|
|
13
13
|
name: string;
|
|
14
14
|
prefix: string | null;
|
|
@@ -16,7 +16,7 @@ export type Album = {
|
|
|
16
16
|
artist: ArtistSummary;
|
|
17
17
|
time: number;
|
|
18
18
|
year: number | string;
|
|
19
|
-
tracks?:
|
|
19
|
+
tracks?: SongResponse[];
|
|
20
20
|
songcount: number;
|
|
21
21
|
disccount: number;
|
|
22
22
|
type: string | null;
|
|
@@ -28,3 +28,8 @@ export type Album = {
|
|
|
28
28
|
averagerating: number | null;
|
|
29
29
|
mbid: string | null;
|
|
30
30
|
};
|
|
31
|
+
export type AlbumsResponse = {
|
|
32
|
+
total_count: number;
|
|
33
|
+
md5: string;
|
|
34
|
+
album: AlbumResponse[];
|
|
35
|
+
};
|
package/dist/artists/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Base, BinaryBoolean, ExtendedPagination, UID } from
|
|
1
|
+
import { ArtistResponse, ArtistsResponse } from "./types";
|
|
2
|
+
import { Base, BinaryBoolean, ExtendedPagination, UID } from "../base";
|
|
3
3
|
export declare class Artists extends Base {
|
|
4
4
|
/**
|
|
5
5
|
* This takes a collection of inputs and returns artist objects
|
|
@@ -21,11 +21,9 @@ export declare class Artists extends Base {
|
|
|
21
21
|
exact?: BinaryBoolean;
|
|
22
22
|
add?: Date;
|
|
23
23
|
update?: Date;
|
|
24
|
-
include?:
|
|
24
|
+
include?: "albums" | "songs";
|
|
25
25
|
album_artist?: BinaryBoolean;
|
|
26
|
-
} & ExtendedPagination): Promise<
|
|
27
|
-
artist: Artist[];
|
|
28
|
-
}>;
|
|
26
|
+
} & ExtendedPagination): Promise<ArtistsResponse>;
|
|
29
27
|
/**
|
|
30
28
|
* This returns a single artist based on the UID of said artist
|
|
31
29
|
* @remarks MINIMUM_API_VERSION=380001
|
|
@@ -35,8 +33,8 @@ export declare class Artists extends Base {
|
|
|
35
33
|
*/
|
|
36
34
|
artist(params: {
|
|
37
35
|
filter: UID;
|
|
38
|
-
include?:
|
|
39
|
-
}): Promise<
|
|
36
|
+
include?: "albums" | "songs";
|
|
37
|
+
}): Promise<ArtistResponse>;
|
|
40
38
|
/**
|
|
41
39
|
* This returns the artists associated with the genre in question as defined by the UID
|
|
42
40
|
* @remarks MINIMUM_API_VERSION=380001
|
|
@@ -49,9 +47,7 @@ export declare class Artists extends Base {
|
|
|
49
47
|
*/
|
|
50
48
|
genreArtists(params: {
|
|
51
49
|
filter: UID;
|
|
52
|
-
} & ExtendedPagination): Promise<
|
|
53
|
-
artist: Artist[];
|
|
54
|
-
}>;
|
|
50
|
+
} & ExtendedPagination): Promise<ArtistsResponse>;
|
|
55
51
|
/**
|
|
56
52
|
* This returns the artists associated with the label in question as defined by the UID
|
|
57
53
|
* @remarks MINIMUM_API_VERSION=420000
|
|
@@ -64,7 +60,5 @@ export declare class Artists extends Base {
|
|
|
64
60
|
*/
|
|
65
61
|
labelArtists(params: {
|
|
66
62
|
filter: UID;
|
|
67
|
-
} & ExtendedPagination): Promise<
|
|
68
|
-
artist: Artist[];
|
|
69
|
-
}>;
|
|
63
|
+
} & ExtendedPagination): Promise<ArtistsResponse>;
|
|
70
64
|
}
|
package/dist/artists/types.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AlbumResponse } from "../albums/types";
|
|
2
2
|
import { Song } from "../songs/types";
|
|
3
|
-
import {
|
|
3
|
+
import { GenreResponse } from "../genres/types";
|
|
4
4
|
export type ArtistSummary = {
|
|
5
5
|
id: string;
|
|
6
6
|
name: string;
|
|
7
7
|
prefix: string | null;
|
|
8
8
|
basename: string;
|
|
9
9
|
};
|
|
10
|
-
export type
|
|
10
|
+
export type ArtistResponse = {
|
|
11
11
|
id: string;
|
|
12
12
|
name: string;
|
|
13
13
|
prefix: string | null;
|
|
14
14
|
basename: string;
|
|
15
|
-
albums:
|
|
15
|
+
albums: AlbumResponse[];
|
|
16
16
|
albumcount: number;
|
|
17
17
|
songs: Song[];
|
|
18
18
|
songcount: number;
|
|
19
|
-
genre:
|
|
19
|
+
genre: GenreResponse[];
|
|
20
20
|
art: string;
|
|
21
21
|
has_art: boolean;
|
|
22
22
|
flag: boolean;
|
|
@@ -28,3 +28,8 @@ export type Artist = {
|
|
|
28
28
|
yearformed: number;
|
|
29
29
|
placeformed: string;
|
|
30
30
|
};
|
|
31
|
+
export type ArtistsResponse = {
|
|
32
|
+
total_count: number;
|
|
33
|
+
md5: string;
|
|
34
|
+
artist: ArtistResponse[];
|
|
35
|
+
};
|
package/dist/auth/index.d.ts
CHANGED
package/dist/base.d.ts
CHANGED
|
@@ -35,6 +35,11 @@ export declare abstract class Base {
|
|
|
35
35
|
protected request<T>(endpoint: string): Promise<T>;
|
|
36
36
|
protected binary<T>(endpoint: string): Promise<Blob>;
|
|
37
37
|
setSessionKey(sessionKey: string): void;
|
|
38
|
+
/**
|
|
39
|
+
* Construct and return a URL
|
|
40
|
+
* @param endpoint
|
|
41
|
+
* @param [params]
|
|
42
|
+
*/
|
|
38
43
|
rawURL(endpoint: string, params?: {}): string;
|
|
39
44
|
}
|
|
40
45
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Base, BinaryBoolean, Success, UID } from
|
|
1
|
+
import { BookmarkResponse, BookmarksResponse } from "./types";
|
|
2
|
+
import { Base, BinaryBoolean, Success, UID } from "../base";
|
|
3
3
|
export declare class Bookmarks extends Base {
|
|
4
4
|
/**
|
|
5
5
|
* Get a single bookmark by bookmark_id
|
|
@@ -11,7 +11,7 @@ export declare class Bookmarks extends Base {
|
|
|
11
11
|
bookmark(params: {
|
|
12
12
|
filter: UID;
|
|
13
13
|
include?: BinaryBoolean;
|
|
14
|
-
}): Promise<
|
|
14
|
+
}): Promise<BookmarkResponse>;
|
|
15
15
|
/**
|
|
16
16
|
* Get information about bookmarked media this user is allowed to manage
|
|
17
17
|
* @remarks MINIMUM_API_VERSION=5.0.0
|
|
@@ -22,11 +22,9 @@ export declare class Bookmarks extends Base {
|
|
|
22
22
|
bookmarks(params: {
|
|
23
23
|
client?: string;
|
|
24
24
|
include?: BinaryBoolean;
|
|
25
|
-
}): Promise<
|
|
26
|
-
bookmark: Bookmark[];
|
|
27
|
-
}>;
|
|
25
|
+
}): Promise<BookmarksResponse>;
|
|
28
26
|
/**
|
|
29
|
-
* Get the bookmark from its object_id and object_type.
|
|
27
|
+
* Get the bookmark/s from its object_id and object_type.
|
|
30
28
|
* @remarks MINIMUM_API_VERSION=5.0.0
|
|
31
29
|
* @param params.filter UID to find
|
|
32
30
|
* @param params.type Object type
|
|
@@ -35,9 +33,10 @@ export declare class Bookmarks extends Base {
|
|
|
35
33
|
*/
|
|
36
34
|
getBookmark(params: {
|
|
37
35
|
filter: UID;
|
|
38
|
-
type:
|
|
36
|
+
type: "song" | "video" | "podcast_episode";
|
|
39
37
|
include?: BinaryBoolean;
|
|
40
|
-
|
|
38
|
+
all?: BinaryBoolean;
|
|
39
|
+
}): Promise<BookmarkResponse>;
|
|
41
40
|
/**
|
|
42
41
|
* Create a placeholder for the current media that you can return to later.
|
|
43
42
|
* @remarks MINIMUM_API_VERSION=5.0.0
|
|
@@ -51,12 +50,12 @@ export declare class Bookmarks extends Base {
|
|
|
51
50
|
*/
|
|
52
51
|
bookmarkCreate(params: {
|
|
53
52
|
filter: UID;
|
|
54
|
-
type:
|
|
53
|
+
type: "song" | "video" | "podcast_episode";
|
|
55
54
|
position: number;
|
|
56
55
|
client?: string;
|
|
57
56
|
date?: number;
|
|
58
57
|
include?: BinaryBoolean;
|
|
59
|
-
}): Promise<
|
|
58
|
+
}): Promise<BookmarkResponse>;
|
|
60
59
|
/**
|
|
61
60
|
* Edit a placeholder for the current media that you can return to later.
|
|
62
61
|
* @remarks MINIMUM_API_VERSION=5.0.0
|
|
@@ -70,23 +69,23 @@ export declare class Bookmarks extends Base {
|
|
|
70
69
|
*/
|
|
71
70
|
bookmarkEdit(params: {
|
|
72
71
|
filter: UID;
|
|
73
|
-
type:
|
|
72
|
+
type: "song" | "video" | "podcast_episode";
|
|
74
73
|
position: number;
|
|
75
74
|
client?: string;
|
|
76
75
|
date?: number;
|
|
77
76
|
include?: BinaryBoolean;
|
|
78
|
-
}): Promise<
|
|
77
|
+
}): Promise<BookmarkResponse>;
|
|
79
78
|
/**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
* Delete an existing bookmark. (if it exists)
|
|
80
|
+
* @remarks MINIMUM_API_VERSION=5.0.0
|
|
81
|
+
* @param params.filter UID to find
|
|
82
|
+
* @param params.type Object type
|
|
83
|
+
* @param [params.client] Agent string. (Default: 'AmpacheAPI')
|
|
84
|
+
@see {@link https://ampache.org/api/api-json-methods#bookmark_delete}
|
|
85
|
+
*/
|
|
87
86
|
bookmarkDelete(params: {
|
|
88
87
|
filter: UID;
|
|
89
|
-
type:
|
|
88
|
+
type: "song" | "video" | "podcast_episode";
|
|
90
89
|
client?: string;
|
|
91
90
|
}): Promise<Success>;
|
|
92
91
|
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { UID } from "../base";
|
|
2
|
-
export type
|
|
2
|
+
export type BookmarkResponse = {
|
|
3
3
|
id: UID;
|
|
4
|
-
type:
|
|
4
|
+
type: "song" | "video" | "podcast_episode";
|
|
5
5
|
position: number;
|
|
6
6
|
client?: string;
|
|
7
7
|
date?: number;
|
|
8
8
|
};
|
|
9
|
+
export type BookmarksResponse = {
|
|
10
|
+
total_count: number;
|
|
11
|
+
md5: string;
|
|
12
|
+
bookmark: BookmarkResponse[];
|
|
13
|
+
};
|
package/dist/catalogs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Base, ExtendedPagination, Success, UID } from
|
|
1
|
+
import { CatalogResponse, CatalogsResponse } from "./types";
|
|
2
|
+
import { Base, ExtendedPagination, Success, UID } from "../base";
|
|
3
3
|
export declare class Catalogs extends Base {
|
|
4
4
|
/**
|
|
5
5
|
* This searches the catalogs and returns... catalogs
|
|
@@ -12,10 +12,8 @@ export declare class Catalogs extends Base {
|
|
|
12
12
|
* @see {@link https://ampache.org/api/api-json-methods#catalogs}
|
|
13
13
|
*/
|
|
14
14
|
catalogs(params?: {
|
|
15
|
-
filter?:
|
|
16
|
-
} & ExtendedPagination): Promise<
|
|
17
|
-
catalog: Catalog[];
|
|
18
|
-
}>;
|
|
15
|
+
filter?: "music" | "clip" | "tvshow" | "movie" | "personal_video" | "podcast";
|
|
16
|
+
} & ExtendedPagination): Promise<CatalogsResponse>;
|
|
19
17
|
/**
|
|
20
18
|
* Return catalog by UID
|
|
21
19
|
* @remarks MINIMUM_API_VERSION=420000
|
|
@@ -24,7 +22,7 @@ export declare class Catalogs extends Base {
|
|
|
24
22
|
*/
|
|
25
23
|
catalog(params: {
|
|
26
24
|
filter: UID;
|
|
27
|
-
}): Promise<
|
|
25
|
+
}): Promise<CatalogResponse>;
|
|
28
26
|
/**
|
|
29
27
|
* Kick off a catalog update or clean for the selected catalog
|
|
30
28
|
* ACCESS REQUIRED: 75 (Catalog Manager)
|
|
@@ -34,7 +32,7 @@ export declare class Catalogs extends Base {
|
|
|
34
32
|
* @see {@link https://ampache.org/api/api-json-methods#catalog_action}
|
|
35
33
|
*/
|
|
36
34
|
catalogAction(params: {
|
|
37
|
-
task:
|
|
35
|
+
task: "add_to_catalog" | "clean_catalog";
|
|
38
36
|
catalog: UID;
|
|
39
37
|
}): Promise<Success>;
|
|
40
38
|
/**
|
|
@@ -69,13 +67,13 @@ export declare class Catalogs extends Base {
|
|
|
69
67
|
catalogAdd(params: {
|
|
70
68
|
name: string;
|
|
71
69
|
path: string;
|
|
72
|
-
type?:
|
|
73
|
-
media_type?:
|
|
70
|
+
type?: "local" | "beets" | "remote" | "subsonic" | "seafile" | "beetsremote";
|
|
71
|
+
media_type?: "music" | "podcast" | "clip" | "tvshow" | "movie" | "personal_video";
|
|
74
72
|
file_pattern?: string;
|
|
75
73
|
folder_pattern?: string;
|
|
76
74
|
username?: string;
|
|
77
75
|
password?: string;
|
|
78
|
-
}): Promise<
|
|
76
|
+
}): Promise<CatalogResponse>;
|
|
79
77
|
/**
|
|
80
78
|
* Delete an existing catalog. (if it exists)
|
|
81
79
|
* ACCESS REQUIRED: 75 (Catalog Manager)
|
package/dist/catalogs/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { UID } from "../base";
|
|
2
|
-
export type
|
|
2
|
+
export type CatalogResponse = {
|
|
3
3
|
id: UID;
|
|
4
4
|
name: string;
|
|
5
|
-
type:
|
|
6
|
-
gather_types:
|
|
5
|
+
type: "local" | "remote";
|
|
6
|
+
gather_types: "podcast" | "clip" | "tvshow" | "movie" | "personal_video" | "music";
|
|
7
7
|
enabled: boolean;
|
|
8
8
|
last_add: number;
|
|
9
9
|
last_clean: number;
|
|
@@ -12,3 +12,8 @@ export type Catalog = {
|
|
|
12
12
|
rename_pattern: string;
|
|
13
13
|
sort_pattern: string;
|
|
14
14
|
};
|
|
15
|
+
export type CatalogsResponse = {
|
|
16
|
+
total_count: number;
|
|
17
|
+
md5: string;
|
|
18
|
+
catalog: CatalogResponse[];
|
|
19
|
+
};
|
package/dist/genres/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Base, BinaryBoolean, ExtendedPagination, UID } from
|
|
1
|
+
import { GenreResponse, GenresResponse } from "./types";
|
|
2
|
+
import { Base, BinaryBoolean, ExtendedPagination, UID } from "../base";
|
|
3
3
|
export declare class Genres extends Base {
|
|
4
4
|
/**
|
|
5
5
|
* This returns the genres (Tags) based on the specified filter
|
|
@@ -15,9 +15,7 @@ export declare class Genres extends Base {
|
|
|
15
15
|
genres(params?: {
|
|
16
16
|
filter?: string;
|
|
17
17
|
exact?: BinaryBoolean;
|
|
18
|
-
} & ExtendedPagination): Promise<
|
|
19
|
-
genre: Genre[];
|
|
20
|
-
}>;
|
|
18
|
+
} & ExtendedPagination): Promise<GenresResponse>;
|
|
21
19
|
/**
|
|
22
20
|
* This returns a single genre based on UID
|
|
23
21
|
* @remarks MINIMUM_API_VERSION=380001
|
|
@@ -26,5 +24,5 @@ export declare class Genres extends Base {
|
|
|
26
24
|
*/
|
|
27
25
|
genre(params: {
|
|
28
26
|
filter: UID;
|
|
29
|
-
}): Promise<
|
|
27
|
+
}): Promise<GenreResponse>;
|
|
30
28
|
}
|
package/dist/genres/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type GenreSummary = {
|
|
|
3
3
|
id: UID;
|
|
4
4
|
name: string;
|
|
5
5
|
};
|
|
6
|
-
export type
|
|
6
|
+
export type GenreResponse = {
|
|
7
7
|
id: UID;
|
|
8
8
|
name: string;
|
|
9
9
|
albums: number;
|
|
@@ -13,3 +13,8 @@ export type Genre = {
|
|
|
13
13
|
playlists: number;
|
|
14
14
|
live_streams: number;
|
|
15
15
|
};
|
|
16
|
+
export type GenresResponse = {
|
|
17
|
+
total_count: number;
|
|
18
|
+
md5: string;
|
|
19
|
+
genre: GenreResponse[];
|
|
20
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Albums } from
|
|
2
|
-
import { Artists } from
|
|
3
|
-
import { Auth } from
|
|
4
|
-
import { Bookmarks } from
|
|
5
|
-
import { Catalogs } from
|
|
6
|
-
import { Genres } from
|
|
7
|
-
import { Labels } from
|
|
8
|
-
import { Licenses } from
|
|
9
|
-
import { LiveStreams } from
|
|
10
|
-
import { Playlists } from
|
|
11
|
-
import { Podcasts } from
|
|
12
|
-
import { Preferences } from
|
|
13
|
-
import { Shares } from
|
|
14
|
-
import { Shouts } from
|
|
15
|
-
import { Songs } from
|
|
16
|
-
import { System } from
|
|
17
|
-
import { Users } from
|
|
18
|
-
import { Videos } from
|
|
19
|
-
import { Base } from
|
|
1
|
+
import { Albums } from "./albums";
|
|
2
|
+
import { Artists } from "./artists";
|
|
3
|
+
import { Auth } from "./auth";
|
|
4
|
+
import { Bookmarks } from "./bookmarks";
|
|
5
|
+
import { Catalogs } from "./catalogs";
|
|
6
|
+
import { Genres } from "./genres";
|
|
7
|
+
import { Labels } from "./labels";
|
|
8
|
+
import { Licenses } from "./licenses";
|
|
9
|
+
import { LiveStreams } from "./live-streams";
|
|
10
|
+
import { Playlists } from "./playlists";
|
|
11
|
+
import { Podcasts } from "./podcasts";
|
|
12
|
+
import { Preferences } from "./preferences";
|
|
13
|
+
import { Shares } from "./shares";
|
|
14
|
+
import { Shouts } from "./shouts";
|
|
15
|
+
import { Songs } from "./songs";
|
|
16
|
+
import { System } from "./system";
|
|
17
|
+
import { Users } from "./users";
|
|
18
|
+
import { Videos } from "./videos";
|
|
19
|
+
import { Base } from "./base";
|
|
20
20
|
declare class AmpacheAPI extends Base {
|
|
21
21
|
}
|
|
22
22
|
interface AmpacheAPI extends Albums, Artists, Auth, Bookmarks, Catalogs, Genres, Labels, Licenses, LiveStreams, Playlists, Podcasts, Preferences, Shares, Shouts, Songs, System, Users, Videos {
|