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.
Files changed (86) hide show
  1. package/README.md +50 -47
  2. package/dist/albums/index.d.ts +7 -13
  3. package/dist/albums/types.d.ts +9 -4
  4. package/dist/artists/index.d.ts +8 -14
  5. package/dist/artists/types.d.ts +10 -5
  6. package/dist/auth/index.d.ts +1 -1
  7. package/dist/base.d.ts +5 -0
  8. package/dist/bookmarks/index.d.ts +20 -21
  9. package/dist/bookmarks/types.d.ts +7 -2
  10. package/dist/catalogs/index.d.ts +9 -11
  11. package/dist/catalogs/types.d.ts +8 -3
  12. package/dist/genres/index.d.ts +4 -6
  13. package/dist/genres/types.d.ts +6 -1
  14. package/dist/index.d.ts +19 -19
  15. package/dist/index.js +1 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.m.js +1 -1
  18. package/dist/index.m.js.map +1 -1
  19. package/dist/index.modern.mjs +1 -1
  20. package/dist/index.modern.mjs.map +1 -1
  21. package/dist/index.umd.js +1 -1
  22. package/dist/index.umd.js.map +1 -1
  23. package/dist/labels/index.d.ts +4 -6
  24. package/dist/labels/types.d.ts +6 -1
  25. package/dist/licenses/index.d.ts +4 -6
  26. package/dist/licenses/types.d.ts +6 -1
  27. package/dist/live-streams/index.d.ts +8 -10
  28. package/dist/live-streams/types.d.ts +6 -1
  29. package/dist/playlists/index.d.ts +15 -25
  30. package/dist/playlists/types.d.ts +7 -2
  31. package/dist/podcasts/index.d.ts +10 -16
  32. package/dist/podcasts/types.d.ts +20 -5
  33. package/dist/preferences/index.d.ts +8 -16
  34. package/dist/preferences/types.d.ts +6 -1
  35. package/dist/shares/index.d.ts +7 -9
  36. package/dist/shares/types.d.ts +6 -1
  37. package/dist/shouts/index.d.ts +4 -4
  38. package/dist/shouts/types.d.ts +1 -1
  39. package/dist/songs/index.d.ts +12 -28
  40. package/dist/songs/types.d.ts +12 -2
  41. package/dist/system/index.d.ts +24 -24
  42. package/dist/system/types.d.ts +9 -9
  43. package/dist/users/index.d.ts +10 -10
  44. package/dist/users/types.d.ts +7 -2
  45. package/dist/videos/index.d.ts +5 -9
  46. package/dist/videos/types.d.ts +12 -2
  47. package/package.json +38 -38
  48. package/src/albums/index.ts +86 -86
  49. package/src/albums/types.ts +38 -32
  50. package/src/artists/index.ts +88 -88
  51. package/src/artists/types.ts +38 -32
  52. package/src/auth/index.ts +103 -103
  53. package/src/auth/types.ts +25 -25
  54. package/src/base.ts +134 -119
  55. package/src/bookmarks/index.ts +116 -122
  56. package/src/bookmarks/types.ts +15 -9
  57. package/src/catalogs/index.ts +130 -119
  58. package/src/catalogs/types.ts +27 -15
  59. package/src/genres/index.ts +39 -40
  60. package/src/genres/types.ts +23 -17
  61. package/src/index.ts +63 -26
  62. package/src/labels/index.ts +43 -44
  63. package/src/labels/types.ts +20 -14
  64. package/src/licenses/index.ts +43 -44
  65. package/src/licenses/types.ts +14 -8
  66. package/src/live-streams/index.ts +104 -107
  67. package/src/live-streams/types.ts +16 -10
  68. package/src/playlists/index.ts +262 -269
  69. package/src/playlists/types.ts +20 -14
  70. package/src/podcasts/index.ts +174 -177
  71. package/src/podcasts/types.ts +85 -67
  72. package/src/preferences/index.ts +114 -116
  73. package/src/preferences/types.ts +18 -12
  74. package/src/shares/index.ts +100 -96
  75. package/src/shares/types.ts +25 -19
  76. package/src/shouts/index.ts +18 -22
  77. package/src/shouts/types.ts +9 -9
  78. package/src/songs/index.ts +208 -203
  79. package/src/songs/types.ts +77 -65
  80. package/src/system/index.ts +689 -572
  81. package/src/system/types.ts +33 -19
  82. package/src/users/index.ts +227 -245
  83. package/src/users/types.ts +38 -32
  84. package/src/utils.ts +25 -25
  85. package/src/videos/index.ts +49 -53
  86. 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 'javascript-ampache';
17
-
18
- const API = new AmpacheAPI({ url: 'http://pathToYourAmpacheServer', sessionKey: yourSessionAuthKey }); // debug: true - will log the final GET to console
19
-
20
- // either set the session key at time of instantiation or set/update with:
21
- API.setSessionKey(yourSessionAuthKey);
22
-
23
- let allUsers = API.users();
24
-
25
- let thisAlbum = API.album({ filter: 123 });
26
-
27
- let results = API.advancedSearch({
28
- type: "album",
29
- operator: "and",
30
- random: 1,
31
- limit: 20,
32
- rules: [
33
- ['title', 0, 'monkey'], // Title contains 'monkey'
34
- ['myrating', 2, 4] // Rating is 4 stars
35
- ]
36
- });
37
- ```
38
-
39
- ## Build
40
- ```bash
41
- npm run build
42
- ```
43
-
44
- ### Special thanks
45
- https://lyamkin.com/blog/how-to-build-api-client-library-in-js/ & https://github.com/ilyamkin/dev-to-js
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
@@ -1,5 +1,5 @@
1
- import { Album } from './types';
2
- import { Base, BinaryBoolean, ExtendedPagination, UID } from '../base';
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<Album[] | {
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?: 'songs';
37
- }): Promise<Album>;
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<Album[] | {
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<Album[] | {
66
- album: Album[];
67
- }>;
61
+ } & ExtendedPagination): Promise<AlbumsResponse>;
68
62
  }
@@ -1,14 +1,14 @@
1
- import { UID } from '../base';
1
+ import { UID } from "../base";
2
2
  import { GenreSummary } from "../genres/types";
3
3
  import { ArtistSummary } from "../artists/types";
4
- import { Song } from "../songs/types";
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 Album = {
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?: Song[];
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
+ };
@@ -1,5 +1,5 @@
1
- import { Artist } from './types';
2
- import { Base, BinaryBoolean, ExtendedPagination, UID } from '../base';
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?: 'albums' | 'songs';
24
+ include?: "albums" | "songs";
25
25
  album_artist?: BinaryBoolean;
26
- } & ExtendedPagination): Promise<Artist[] | {
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?: 'albums' | 'songs';
39
- }): Promise<Artist>;
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<Artist[] | {
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<Artist[] | {
68
- artist: Artist[];
69
- }>;
63
+ } & ExtendedPagination): Promise<ArtistsResponse>;
70
64
  }
@@ -1,22 +1,22 @@
1
- import { Album } from "../albums/types";
1
+ import { AlbumResponse } from "../albums/types";
2
2
  import { Song } from "../songs/types";
3
- import { Genre } from "../genres/types";
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 Artist = {
10
+ export type ArtistResponse = {
11
11
  id: string;
12
12
  name: string;
13
13
  prefix: string | null;
14
14
  basename: string;
15
- albums: Album[];
15
+ albums: AlbumResponse[];
16
16
  albumcount: number;
17
17
  songs: Song[];
18
18
  songcount: number;
19
- genre: 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
+ };
@@ -1,5 +1,5 @@
1
1
  import { Base, Success } from "../base";
2
- import { AuthResponse } from './types';
2
+ import { AuthResponse } from "./types";
3
3
  export declare class Auth extends Base {
4
4
  /**
5
5
  * Handles verifying a new handshake
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 { Bookmark } from './types';
2
- import { Base, BinaryBoolean, Success, UID } from '../base';
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<Bookmark>;
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<Bookmark[] | {
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: 'song' | 'video' | 'podcast_episode';
36
+ type: "song" | "video" | "podcast_episode";
39
37
  include?: BinaryBoolean;
40
- }): Promise<Bookmark>;
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: 'song' | 'video' | 'podcast_episode';
53
+ type: "song" | "video" | "podcast_episode";
55
54
  position: number;
56
55
  client?: string;
57
56
  date?: number;
58
57
  include?: BinaryBoolean;
59
- }): Promise<Bookmark>;
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: 'song' | 'video' | 'podcast_episode';
72
+ type: "song" | "video" | "podcast_episode";
74
73
  position: number;
75
74
  client?: string;
76
75
  date?: number;
77
76
  include?: BinaryBoolean;
78
- }): Promise<Bookmark>;
77
+ }): Promise<BookmarkResponse>;
79
78
  /**
80
- * Delete an existing bookmark. (if it exists)
81
- * @remarks MINIMUM_API_VERSION=5.0.0
82
- * @param params.filter UID to find
83
- * @param params.type Object type
84
- * @param [params.client] Agent string. (Default: 'AmpacheAPI')
85
- @see {@link https://ampache.org/api/api-json-methods#bookmark_delete}
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: 'song' | 'video' | 'podcast_episode';
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 Bookmark = {
2
+ export type BookmarkResponse = {
3
3
  id: UID;
4
- type: 'song' | 'video' | 'podcast_episode';
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
+ };
@@ -1,5 +1,5 @@
1
- import { Catalog } from './types';
2
- import { Base, ExtendedPagination, Success, UID } from '../base';
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?: 'music' | 'clip' | 'tvshow' | 'movie' | 'personal_video' | 'podcast';
16
- } & ExtendedPagination): Promise<Catalog[] | {
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<Catalog>;
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: 'add_to_catalog' | 'clean_catalog';
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?: 'local' | 'beets' | 'remote' | 'subsonic' | 'seafile' | 'beetsremote';
73
- media_type?: 'music' | 'podcast' | 'clip' | 'tvshow' | 'movie' | 'personal_video';
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<Catalog>;
76
+ }): Promise<CatalogResponse>;
79
77
  /**
80
78
  * Delete an existing catalog. (if it exists)
81
79
  * ACCESS REQUIRED: 75 (Catalog Manager)
@@ -1,9 +1,9 @@
1
1
  import { UID } from "../base";
2
- export type Catalog = {
2
+ export type CatalogResponse = {
3
3
  id: UID;
4
4
  name: string;
5
- type: 'local' | 'remote';
6
- gather_types: 'podcast' | 'clip' | 'tvshow' | 'movie' | 'personal_video' | 'music';
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
+ };
@@ -1,5 +1,5 @@
1
- import { Genre } from './types';
2
- import { Base, BinaryBoolean, ExtendedPagination, UID } from '../base';
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<Genre[] | {
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<Genre>;
27
+ }): Promise<GenreResponse>;
30
28
  }
@@ -3,7 +3,7 @@ export type GenreSummary = {
3
3
  id: UID;
4
4
  name: string;
5
5
  };
6
- export type Genre = {
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 './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';
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 {