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
@@ -1,5 +1,5 @@
1
- import { Label } from './types';
2
- import { Base, BinaryBoolean, ExtendedPagination, UID } from '../base';
1
+ import { LabelResponse, LabelsResponse } from "./types";
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
@@ -19,9 +19,7 @@ export declare class Labels extends Base {
19
19
  exact?: BinaryBoolean;
20
20
  add?: Date;
21
21
  update?: Date;
22
- } & ExtendedPagination): Promise<Label[] | {
23
- label: Label[];
24
- }>;
22
+ } & ExtendedPagination): Promise<LabelsResponse>;
25
23
  /**
26
24
  * This returns a single label
27
25
  * @remarks MINIMUM_API_VERSION=420000
@@ -30,5 +28,5 @@ export declare class Labels extends Base {
30
28
  */
31
29
  label(params: {
32
30
  filter: UID;
33
- }): Promise<Label>;
31
+ }): Promise<LabelResponse>;
34
32
  }
@@ -1,5 +1,5 @@
1
1
  import { UID } from "../base";
2
- export type Label = {
2
+ export type LabelResponse = {
3
3
  id: UID;
4
4
  name: string;
5
5
  artists: number;
@@ -11,3 +11,8 @@ export type Label = {
11
11
  website: string | null;
12
12
  user: UID;
13
13
  };
14
+ export type LabelsResponse = {
15
+ total_count: number;
16
+ md5: string;
17
+ label: LabelResponse[];
18
+ };
@@ -1,5 +1,5 @@
1
- import { License } from './types';
2
- import { Base, BinaryBoolean, ExtendedPagination, UID } from '../base';
1
+ import { LicenseResponse, LicensesResponse } from "./types";
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
@@ -19,9 +19,7 @@ export declare class Licenses extends Base {
19
19
  exact?: BinaryBoolean;
20
20
  add?: Date;
21
21
  update?: Date;
22
- } & ExtendedPagination): Promise<License[] | {
23
- license: License[];
24
- }>;
22
+ } & ExtendedPagination): Promise<LicensesResponse>;
25
23
  /**
26
24
  * This returns a single license
27
25
  * @remarks MINIMUM_API_VERSION=420000
@@ -30,5 +28,5 @@ export declare class Licenses extends Base {
30
28
  */
31
29
  license(params: {
32
30
  filter: UID;
33
- }): Promise<License>;
31
+ }): Promise<LicenseResponse>;
34
32
  }
@@ -1,7 +1,12 @@
1
1
  import { UID } from "../base";
2
- export type License = {
2
+ export type LicenseResponse = {
3
3
  id: UID;
4
4
  name: string;
5
5
  description: string;
6
6
  external_link: string;
7
7
  };
8
+ export type LicensesResponse = {
9
+ total_count: number;
10
+ md5: string;
11
+ license: LicenseResponse[];
12
+ };
@@ -1,5 +1,5 @@
1
- import { LiveStream } from './types';
2
- import { Base, BinaryBoolean, ExtendedPagination, Success, UID } from '../base';
1
+ import { LiveStreamResponse, LiveStreamsResponse } from "./types";
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
@@ -19,9 +19,7 @@ export declare class LiveStreams extends Base {
19
19
  exact?: BinaryBoolean;
20
20
  add?: Date;
21
21
  update?: Date;
22
- } & ExtendedPagination): Promise<LiveStream[] | {
23
- live_stream: LiveStream[];
24
- }>;
22
+ } & ExtendedPagination): Promise<LiveStreamsResponse>;
25
23
  /**
26
24
  * This returns a single live_stream
27
25
  * @remarks MINIMUM_API_VERSION=5.1.0
@@ -30,7 +28,7 @@ export declare class LiveStreams extends Base {
30
28
  */
31
29
  liveStream(params: {
32
30
  filter: UID;
33
- }): Promise<LiveStream>;
31
+ }): Promise<LiveStreamResponse>;
34
32
  /**
35
33
  * Create a live_stream (radio station) object.
36
34
  * ACCESS REQUIRED: 50 (Content Manager)
@@ -45,10 +43,10 @@ export declare class LiveStreams extends Base {
45
43
  liveStreamCreate(params: {
46
44
  name: string;
47
45
  url: string;
48
- codec: 'mp3' | 'flac' | 'ogg' | 'vorbis' | 'opus' | 'aac' | 'alac';
46
+ codec: "mp3" | "flac" | "ogg" | "vorbis" | "opus" | "aac" | "alac";
49
47
  catalog: string;
50
48
  site_url?: string;
51
- }): Promise<LiveStream>;
49
+ }): Promise<LiveStreamResponse>;
52
50
  /**
53
51
  * Edit a live_stream (radio station) object.
54
52
  * ACCESS REQUIRED: 50 (Content Manager)
@@ -65,10 +63,10 @@ export declare class LiveStreams extends Base {
65
63
  filter: string;
66
64
  name?: string;
67
65
  url?: string;
68
- codec?: 'mp3' | 'flac' | 'ogg' | 'vorbis' | 'opus' | 'aac' | 'alac';
66
+ codec?: "mp3" | "flac" | "ogg" | "vorbis" | "opus" | "aac" | "alac";
69
67
  catalog?: string;
70
68
  site_url?: string;
71
- }): Promise<LiveStream>;
69
+ }): Promise<LiveStreamResponse>;
72
70
  /**
73
71
  * Delete a live_stream (radio station) object (if it exists)
74
72
  * ACCESS REQUIRED: 50 (Content Manager)
@@ -1,5 +1,5 @@
1
1
  import { UID } from "../base";
2
- export type LiveStream = {
2
+ export type LiveStreamResponse = {
3
3
  id: UID;
4
4
  name: string;
5
5
  url: string;
@@ -7,3 +7,8 @@ export type LiveStream = {
7
7
  catalog: UID;
8
8
  site_url: string;
9
9
  };
10
+ export type LiveStreamsResponse = {
11
+ total_count: number;
12
+ md5: string;
13
+ live_stream: LiveStreamResponse[];
14
+ };
@@ -1,6 +1,6 @@
1
- import { Playlist } from './types';
2
- import { Song } from "../songs/types";
3
- import { Base, BinaryBoolean, ExtendedPagination, Pagination, Success, UID } from '../base';
1
+ import { PlaylistResponse, PlaylistsResponse } from "./types";
2
+ import { SongsResponse } from "../songs/types";
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
@@ -24,9 +24,7 @@ export declare class Playlists extends Base {
24
24
  update?: Date;
25
25
  hide_search?: BinaryBoolean;
26
26
  show_dupes?: BinaryBoolean;
27
- } & ExtendedPagination): Promise<Playlist[] | {
28
- playlist: Playlist[];
29
- }>;
27
+ } & ExtendedPagination): Promise<PlaylistsResponse>;
30
28
  /**
31
29
  * This returns smartlists based on the specified filter. NOTE: Filtered from Playlists() so pagination is invalid.
32
30
  * @remarks MINIMUM_API_VERSION=380001
@@ -43,9 +41,7 @@ export declare class Playlists extends Base {
43
41
  add?: Date;
44
42
  update?: Date;
45
43
  show_dupes?: BinaryBoolean;
46
- }): Promise<Playlist[] | {
47
- playlist: Playlist[];
48
- }>;
44
+ }): Promise<PlaylistsResponse>;
49
45
  /**
50
46
  * This returns a single playlist
51
47
  * @remarks MINIMUM_API_VERSION=380001
@@ -54,7 +50,7 @@ export declare class Playlists extends Base {
54
50
  */
55
51
  playlist(params: {
56
52
  filter: UID;
57
- }): Promise<Playlist>;
53
+ }): Promise<PlaylistResponse>;
58
54
  /**
59
55
  * This returns a user's playlists based on the specified filter
60
56
  * @remarks MINIMUM_API_VERSION=6.3.0
@@ -73,9 +69,7 @@ export declare class Playlists extends Base {
73
69
  exact?: BinaryBoolean;
74
70
  add?: Date;
75
71
  update?: Date;
76
- } & ExtendedPagination): Promise<Playlist[] | {
77
- playlist: Playlist[];
78
- }>;
72
+ } & ExtendedPagination): Promise<PlaylistsResponse>;
79
73
  /**
80
74
  * This returns a user's smartlists based on the specified filter
81
75
  * @remarks MINIMUM_API_VERSION=6.3.0
@@ -94,9 +88,7 @@ export declare class Playlists extends Base {
94
88
  exact?: BinaryBoolean;
95
89
  add?: Date;
96
90
  update?: Date;
97
- } & ExtendedPagination): Promise<Playlist[] | {
98
- playlist: Playlist[];
99
- }>;
91
+ } & ExtendedPagination): Promise<PlaylistsResponse>;
100
92
  /**
101
93
  * This creates a new playlist and returns it
102
94
  * @remarks MINIMUM_API_VERSION=380001
@@ -106,8 +98,8 @@ export declare class Playlists extends Base {
106
98
  */
107
99
  playlistCreate(params: {
108
100
  name: string;
109
- type?: 'public' | 'private';
110
- }): Promise<Playlist>;
101
+ type?: "public" | "private";
102
+ }): Promise<PlaylistResponse>;
111
103
  /**
112
104
  * This adds an item to a playlist
113
105
  * @remarks MINIMUM_API_VERSION=6.3.0
@@ -119,7 +111,7 @@ export declare class Playlists extends Base {
119
111
  playlistAdd(params: {
120
112
  filter: UID;
121
113
  id: UID;
122
- type: 'song' | 'album' | 'artist' | 'playlist';
114
+ type: "song" | "album" | "artist" | "playlist";
123
115
  }): Promise<Success>;
124
116
  /**
125
117
  * This modifies name and type of the playlist.
@@ -136,7 +128,7 @@ export declare class Playlists extends Base {
136
128
  playlistEdit(params: {
137
129
  filter: UID;
138
130
  name?: string;
139
- type?: 'public' | 'private';
131
+ type?: "public" | "private";
140
132
  owner?: string;
141
133
  items?: string;
142
134
  tracks?: string;
@@ -191,13 +183,11 @@ export declare class Playlists extends Base {
191
183
  * @see {@link https://ampache.org/api/api-json-methods#playlist_generate}
192
184
  */
193
185
  playlistGenerate(params?: {
194
- mode?: 'recent' | 'forgotten' | 'unplayed' | 'random';
186
+ mode?: "recent" | "forgotten" | "unplayed" | "random";
195
187
  filter?: string;
196
188
  album?: number;
197
189
  artist?: number;
198
190
  flag?: BinaryBoolean;
199
- format?: 'song' | 'index' | 'id';
200
- } & Pagination): Promise<Song[] | {
201
- song: Song[];
202
- }>;
191
+ format?: "song" | "index" | "id";
192
+ } & Pagination): Promise<SongsResponse>;
203
193
  }
@@ -1,13 +1,18 @@
1
1
  import { UID } from "../base";
2
- export type Playlist = {
2
+ export type PlaylistResponse = {
3
3
  id: UID;
4
4
  name: string;
5
5
  owner: string;
6
6
  items: number;
7
- type: 'public' | 'private';
7
+ type: "public" | "private";
8
8
  art: string;
9
9
  has_art: boolean;
10
10
  flag: boolean;
11
11
  rating: number | null;
12
12
  averagerating: number | null;
13
13
  };
14
+ export type PlaylistsResponse = {
15
+ total_count: number;
16
+ md5: string;
17
+ playlist: PlaylistResponse[];
18
+ };
@@ -1,5 +1,5 @@
1
- import { Podcast, PodcastEpisode, DeletedPodcastEpisode } from './types';
2
- import { Base, ExtendedPagination, Pagination, Success, UID } from '../base';
1
+ import { PodcastResponse, PodcastsResponse, PodcastEpisodeResponse, PodcastEpisodesResponse, DeletedPodcastEpisodesResponse } from "./types";
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
@@ -14,10 +14,8 @@ export declare class Podcasts extends Base {
14
14
  */
15
15
  podcasts(params?: {
16
16
  filter?: string;
17
- include?: 'episodes';
18
- } & ExtendedPagination): Promise<Podcast[] | {
19
- podcast: Podcast[];
20
- }>;
17
+ include?: "episodes";
18
+ } & ExtendedPagination): Promise<PodcastsResponse>;
21
19
  /**
22
20
  * Get information about podcasts
23
21
  * @remarks MINIMUM_API_VERSION=420000
@@ -29,8 +27,8 @@ export declare class Podcasts extends Base {
29
27
  */
30
28
  podcast(params?: {
31
29
  filter: UID;
32
- include?: 'episodes';
33
- } & Pagination): Promise<Podcast>;
30
+ include?: "episodes";
31
+ } & Pagination): Promise<PodcastResponse>;
34
32
  /**
35
33
  * Create a podcast that can be used by anyone to stream media.
36
34
  * @remarks MINIMUM_API_VERSION=420000
@@ -41,7 +39,7 @@ export declare class Podcasts extends Base {
41
39
  podcastCreate(params: {
42
40
  url: string;
43
41
  catalog: UID;
44
- }): Promise<Podcast>;
42
+ }): Promise<PodcastResponse>;
45
43
  /**
46
44
  * Update the description and/or expiration date for an existing podcast.
47
45
  * @remarks MINIMUM_API_VERSION=420000
@@ -84,9 +82,7 @@ export declare class Podcasts extends Base {
84
82
  */
85
83
  podcastEpisodes(params: {
86
84
  filter: UID;
87
- } & ExtendedPagination): Promise<PodcastEpisode[] | {
88
- podcast_episode: PodcastEpisode[];
89
- }>;
85
+ } & ExtendedPagination): Promise<PodcastEpisodesResponse>;
90
86
  /**
91
87
  * Get the podcast_episode from a UID
92
88
  * @remarks MINIMUM_API_VERSION=420000
@@ -95,7 +91,7 @@ export declare class Podcasts extends Base {
95
91
  */
96
92
  podcastEpisode(params: {
97
93
  filter: UID;
98
- }): Promise<PodcastEpisode>;
94
+ }): Promise<PodcastEpisodeResponse>;
99
95
  /**
100
96
  * Delete an existing podcast_episode
101
97
  * @remarks MINIMUM_API_VERSION=420000
@@ -121,7 +117,5 @@ export declare class Podcasts extends Base {
121
117
  * @param [params.limit]
122
118
  * @see {@link https://ampache.org/api/api-json-methods#deleted_podcast_episodes}
123
119
  */
124
- deletedPodcastEpisodes(params?: {} & Pagination): Promise<DeletedPodcastEpisode[] | {
125
- deleted_podcast_episode: DeletedPodcastEpisode[];
126
- }>;
120
+ deletedPodcastEpisodes(params?: {} & Pagination): Promise<DeletedPodcastEpisodesResponse>;
127
121
  }
@@ -1,5 +1,5 @@
1
1
  import { UID } from "../base";
2
- export type Podcast = {
2
+ export type PodcastResponse = {
3
3
  id: UID;
4
4
  name: string;
5
5
  description: string;
@@ -16,9 +16,14 @@ export type Podcast = {
16
16
  flag: boolean;
17
17
  rating: number | null;
18
18
  averaterating: number | null;
19
- podcast_episode: PodcastEpisode[];
19
+ podcast_episode: PodcastEpisodeResponse[];
20
20
  };
21
- export type PodcastEpisode = {
21
+ export type PodcastsResponse = {
22
+ total_count: number;
23
+ md5: string;
24
+ podcast: PodcastResponse[];
25
+ };
26
+ export type PodcastEpisodeResponse = {
22
27
  id: UID;
23
28
  title: string;
24
29
  name: string;
@@ -28,7 +33,7 @@ export type PodcastEpisode = {
28
33
  author_full: string;
29
34
  website: string;
30
35
  pubdate: string;
31
- state: 'completed' | 'pending';
36
+ state: "completed" | "pending";
32
37
  filelength: string;
33
38
  filesize: string;
34
39
  filename: string;
@@ -51,7 +56,12 @@ export type PodcastEpisode = {
51
56
  playcount: number;
52
57
  played: number;
53
58
  };
54
- export type DeletedPodcastEpisode = {
59
+ export type PodcastEpisodesResponse = {
60
+ total_count: number;
61
+ md5: string;
62
+ podcast_episode: PodcastEpisodeResponse[];
63
+ };
64
+ export type DeletedPodcastEpisodeResponse = {
55
65
  id: UID;
56
66
  addition_time: number;
57
67
  delete_time: number;
@@ -62,3 +72,8 @@ export type DeletedPodcastEpisode = {
62
72
  total_skip: number;
63
73
  podcast: UID;
64
74
  };
75
+ export type DeletedPodcastEpisodesResponse = {
76
+ total_count: number;
77
+ md5: string;
78
+ deleted_podcast_episode: DeletedPodcastEpisodeResponse[];
79
+ };
@@ -1,5 +1,5 @@
1
- import { Base, BinaryBoolean, Success } from '../base';
2
- import { Preference } from "./types";
1
+ import { Base, BinaryBoolean, Success } from "../base";
2
+ import { PreferenceResponse, PreferencesResponse } from "./types";
3
3
  export declare class Preferences extends Base {
4
4
  /**
5
5
  * Get your server preferences
@@ -7,9 +7,7 @@ export declare class Preferences extends Base {
7
7
  * @remarks MINIMUM_API_VERSION=5.0.0
8
8
  * @see {@link https://ampache.org/api/api-json-methods#system_preferences}
9
9
  */
10
- systemPreferences(): Promise<Preference[] | {
11
- preference: Preference[];
12
- }>;
10
+ systemPreferences(): Promise<PreferencesResponse>;
13
11
  /**
14
12
  * Get your system preference by name
15
13
  * ACCESS REQUIRED: 100 (Admin)
@@ -19,17 +17,13 @@ export declare class Preferences extends Base {
19
17
  */
20
18
  systemPreference(params: {
21
19
  filter: string;
22
- }): Promise<{
23
- preference: Preference;
24
- }>;
20
+ }): Promise<PreferenceResponse>;
25
21
  /**
26
22
  * Get your user preferences
27
23
  * @remarks MINIMUM_API_VERSION=5.0.0
28
24
  * @see {@link https://ampache.org/api/api-json-methods#user_preferences}
29
25
  */
30
- userPreferences(): Promise<Preference[] | {
31
- preference: Preference[];
32
- }>;
26
+ userPreferences(): Promise<PreferencesResponse>;
33
27
  /**
34
28
  * Get your user preference by name
35
29
  * @remarks MINIMUM_API_VERSION=5.0.0
@@ -38,9 +32,7 @@ export declare class Preferences extends Base {
38
32
  */
39
33
  userPreference(params: {
40
34
  filter: string;
41
- }): Promise<{
42
- preference: Preference;
43
- }>;
35
+ }): Promise<PreferenceResponse>;
44
36
  /**
45
37
  * Add a new preference to your server
46
38
  * ACCESS REQUIRED: 100 (Admin)
@@ -55,9 +47,9 @@ export declare class Preferences extends Base {
55
47
  */
56
48
  preferenceCreate(params: {
57
49
  filter: string;
58
- type: 'boolean' | 'integer' | 'string' | 'special';
50
+ type: "boolean" | "integer" | "string" | "special";
59
51
  default: string | number;
60
- category: 'interface' | 'internal' | 'options' | 'playlist' | 'plugins' | 'streaming';
52
+ category: "interface" | "internal" | "options" | "playlist" | "plugins" | "streaming";
61
53
  description?: string;
62
54
  subcategory?: string;
63
55
  level?: number;
@@ -1,5 +1,5 @@
1
1
  import { UID } from "../base";
2
- export type Preference = {
2
+ export type PreferenceResponse = {
3
3
  id: UID;
4
4
  name: string;
5
5
  level: string;
@@ -9,3 +9,8 @@ export type Preference = {
9
9
  category: string;
10
10
  subcategory: string | null;
11
11
  };
12
+ export type PreferencesResponse = {
13
+ total_count: number;
14
+ md5: string;
15
+ preference: PreferenceResponse[];
16
+ };
@@ -1,5 +1,5 @@
1
- import { Share } from './types';
2
- import { Base, BinaryBoolean, ExtendedPagination, Success, UID } from '../base';
1
+ import { ShareResponse, SharesResponse } from "./types";
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
@@ -15,9 +15,7 @@ export declare class Shares extends Base {
15
15
  shares(params?: {
16
16
  filter?: string;
17
17
  exact?: BinaryBoolean;
18
- } & ExtendedPagination): Promise<Share[] | {
19
- share: Share[];
20
- }>;
18
+ } & ExtendedPagination): Promise<SharesResponse>;
21
19
  /**
22
20
  * Return a share from UID
23
21
  * @remarks MINIMUM_API_VERSION=420000
@@ -26,22 +24,22 @@ export declare class Shares extends Base {
26
24
  */
27
25
  share(params: {
28
26
  filter: UID;
29
- }): Promise<Share>;
27
+ }): Promise<ShareResponse>;
30
28
  /**
31
29
  * Create a public url that can be used by anyone to stream media.
32
30
  * @remarks MINIMUM_API_VERSION=420000
33
31
  * @param params.filter UID of object you are sharing
34
- * @param params.type ('song', 'album', 'artist')
32
+ * @param params.type ('song', 'album', 'artist', 'playlist', 'podcast', 'podcast_episode', 'video')
35
33
  * @param [params.description] description (will be filled for you if empty)
36
34
  * @param [params.expires] days to keep active
37
35
  * @see {@link https://ampache.org/api/api-json-methods#share_create}
38
36
  */
39
37
  shareCreate(params: {
40
38
  filter: UID;
41
- type: 'song' | 'album' | 'artist' | 'playlist' | 'podcast' | 'podcast_episode' | 'video';
39
+ type: "song" | "album" | "artist" | "playlist" | "podcast" | "podcast_episode" | "video";
42
40
  description?: string;
43
41
  expires?: number;
44
- }): Promise<Share>;
42
+ }): Promise<ShareResponse>;
45
43
  /**
46
44
  * Update the description and/or expiration date for an existing share
47
45
  * @remarks MINIMUM_API_VERSION=420000
@@ -1,5 +1,5 @@
1
1
  import { UID } from "../base";
2
- export type Share = {
2
+ export type ShareResponse = {
3
3
  id: UID;
4
4
  name: string;
5
5
  owner: string;
@@ -16,3 +16,8 @@ export type Share = {
16
16
  public_url: string;
17
17
  description: string;
18
18
  };
19
+ export type SharesResponse = {
20
+ total_count: number;
21
+ md5: string;
22
+ share: ShareResponse[];
23
+ };
@@ -1,5 +1,5 @@
1
- import { Shout } from './types';
2
- import { Base } from '../base';
1
+ import { ShoutResponse } from "./types";
2
+ import { Base } from "../base";
3
3
  export declare class Shouts extends Base {
4
4
  /**
5
5
  * This gets the latest posted shouts
@@ -11,7 +11,7 @@ export declare class Shouts extends Base {
11
11
  last_shouts(params?: {
12
12
  username?: string;
13
13
  limit?: number;
14
- }): Promise<Shout[] | {
15
- shout: Shout[];
14
+ }): Promise<{
15
+ shout: ShoutResponse[];
16
16
  }>;
17
17
  }
@@ -1,6 +1,6 @@
1
1
  import { UID } from "../base";
2
2
  import { UserSummary } from "../users/types";
3
- export type Shout = {
3
+ export type ShoutResponse = {
4
4
  id: UID;
5
5
  date: number;
6
6
  text: string;