javascript-ampache 1.1.0 → 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 (47) hide show
  1. package/dist/albums/index.d.ts +7 -13
  2. package/dist/albums/types.d.ts +9 -4
  3. package/dist/artists/index.d.ts +8 -14
  4. package/dist/artists/types.d.ts +10 -5
  5. package/dist/auth/index.d.ts +1 -1
  6. package/dist/bookmarks/index.d.ts +20 -21
  7. package/dist/bookmarks/types.d.ts +7 -2
  8. package/dist/catalogs/index.d.ts +9 -11
  9. package/dist/catalogs/types.d.ts +8 -3
  10. package/dist/genres/index.d.ts +4 -6
  11. package/dist/genres/types.d.ts +6 -1
  12. package/dist/index.d.ts +19 -19
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.m.js +1 -1
  16. package/dist/index.m.js.map +1 -1
  17. package/dist/index.modern.mjs +1 -1
  18. package/dist/index.modern.mjs.map +1 -1
  19. package/dist/index.umd.js +1 -1
  20. package/dist/index.umd.js.map +1 -1
  21. package/dist/labels/index.d.ts +4 -6
  22. package/dist/labels/types.d.ts +6 -1
  23. package/dist/licenses/index.d.ts +4 -6
  24. package/dist/licenses/types.d.ts +6 -1
  25. package/dist/live-streams/index.d.ts +8 -10
  26. package/dist/live-streams/types.d.ts +6 -1
  27. package/dist/playlists/index.d.ts +15 -25
  28. package/dist/playlists/types.d.ts +7 -2
  29. package/dist/podcasts/index.d.ts +10 -16
  30. package/dist/podcasts/types.d.ts +20 -5
  31. package/dist/preferences/index.d.ts +8 -16
  32. package/dist/preferences/types.d.ts +6 -1
  33. package/dist/shares/index.d.ts +7 -9
  34. package/dist/shares/types.d.ts +6 -1
  35. package/dist/shouts/index.d.ts +4 -4
  36. package/dist/shouts/types.d.ts +1 -1
  37. package/dist/songs/index.d.ts +12 -28
  38. package/dist/songs/types.d.ts +12 -2
  39. package/dist/system/index.d.ts +24 -24
  40. package/dist/system/types.d.ts +9 -9
  41. package/dist/users/index.d.ts +10 -10
  42. package/dist/users/types.d.ts +7 -2
  43. package/dist/videos/index.d.ts +5 -9
  44. package/dist/videos/types.d.ts +12 -2
  45. package/package.json +1 -1
  46. package/src/bookmarks/index.ts +2 -1
  47. package/src/playlists/index.ts +1 -3
@@ -1,5 +1,5 @@
1
- import { Song, DeletedSong } from './types';
2
- import { Base, BinaryBoolean, ExtendedPagination, Pagination, Success, UID } from '../base';
1
+ import { SongResponse, SongsResponse, DeletedSongsResponse } from "./types";
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
@@ -19,9 +19,7 @@ export declare class Songs extends Base {
19
19
  exact?: BinaryBoolean;
20
20
  add?: Date;
21
21
  update?: Date;
22
- } & ExtendedPagination): Promise<Song[] | {
23
- song: Song[];
24
- }>;
22
+ } & ExtendedPagination): Promise<SongsResponse>;
25
23
  /**
26
24
  * Returns a single song
27
25
  * @remarks MINIMUM_API_VERSION=380001
@@ -30,7 +28,7 @@ export declare class Songs extends Base {
30
28
  */
31
29
  song(params: {
32
30
  filter: UID;
33
- }): Promise<Song>;
31
+ }): Promise<SongResponse>;
34
32
  /**
35
33
  * Songs of the specified artist
36
34
  * @remarks MINIMUM_API_VERSION=380001
@@ -45,9 +43,7 @@ export declare class Songs extends Base {
45
43
  artistSongs(params: {
46
44
  filter: UID;
47
45
  top50?: BinaryBoolean;
48
- } & ExtendedPagination): Promise<Song[] | {
49
- song: Song[];
50
- }>;
46
+ } & ExtendedPagination): Promise<SongsResponse>;
51
47
  /**
52
48
  * Songs of the specified album
53
49
  * @remarks MINIMUM_API_VERSION=380001
@@ -60,9 +56,7 @@ export declare class Songs extends Base {
60
56
  */
61
57
  albumSongs(params: {
62
58
  filter: UID;
63
- } & ExtendedPagination): Promise<Song[] | {
64
- song: Song[];
65
- }>;
59
+ } & ExtendedPagination): Promise<SongsResponse>;
66
60
  /**
67
61
  * Songs of the specified genre
68
62
  * @remarks MINIMUM_API_VERSION=380001
@@ -75,9 +69,7 @@ export declare class Songs extends Base {
75
69
  */
76
70
  genreSongs(params: {
77
71
  filter: UID;
78
- } & ExtendedPagination): Promise<Song[] | {
79
- song: Song[];
80
- }>;
72
+ } & ExtendedPagination): Promise<SongsResponse>;
81
73
  /**
82
74
  * This returns the songs for a playlist
83
75
  * @remarks MINIMUM_API_VERSION=380001
@@ -90,9 +82,7 @@ export declare class Songs extends Base {
90
82
  playlistSongs(params: {
91
83
  filter: UID;
92
84
  random?: BinaryBoolean;
93
- } & Pagination): Promise<Song[] | {
94
- song: Song[];
95
- }>;
85
+ } & Pagination): Promise<SongsResponse>;
96
86
  /**
97
87
  * This returns the songs for a license
98
88
  * @remarks MINIMUM_API_VERSION=420000
@@ -105,9 +95,7 @@ export declare class Songs extends Base {
105
95
  */
106
96
  licenseSongs(params: {
107
97
  filter: UID;
108
- } & ExtendedPagination): Promise<Song[] | {
109
- song: Song[];
110
- }>;
98
+ } & ExtendedPagination): Promise<SongsResponse>;
111
99
  /**
112
100
  * Delete an existing song. (if you are allowed to)
113
101
  * @remarks MINIMUM_API_VERSION=5.0.0
@@ -125,7 +113,7 @@ export declare class Songs extends Base {
125
113
  */
126
114
  urlToSong(params: {
127
115
  url: string;
128
- }): Promise<Song>;
116
+ }): Promise<SongResponse>;
129
117
  /**
130
118
  * This searches the songs and returns... songs
131
119
  * @remarks MINIMUM_API_VERSION=380001
@@ -136,9 +124,7 @@ export declare class Songs extends Base {
136
124
  */
137
125
  searchSongs(params: {
138
126
  filter: string;
139
- } & Pagination): Promise<Song[] | {
140
- song: Song[];
141
- }>;
127
+ } & Pagination): Promise<SongsResponse>;
142
128
  /**
143
129
  * Returns songs that have been deleted from the server
144
130
  * @remarks MINIMUM_API_VERSION=500000
@@ -146,7 +132,5 @@ export declare class Songs extends Base {
146
132
  * @param [params.limit]
147
133
  * @see {@link https://ampache.org/api/api-json-methods#deleted_songs}
148
134
  */
149
- deletedSongs(params?: {} & Pagination): Promise<DeletedSong[] | {
150
- deleted_song: DeletedSong[];
151
- }>;
135
+ deletedSongs(params?: {} & Pagination): Promise<DeletedSongsResponse>;
152
136
  }
@@ -2,7 +2,7 @@ import { ArtistSummary } from "../artists/types";
2
2
  import { GenreSummary } from "../genres/types";
3
3
  import { UID } from "../base";
4
4
  import { AlbumSummary } from "../albums/types";
5
- export type Song = {
5
+ export type SongResponse = {
6
6
  id: UID;
7
7
  title: string;
8
8
  name: string;
@@ -48,7 +48,12 @@ export type Song = {
48
48
  r128_album_gain: number | null;
49
49
  r128_track_gain: number | null;
50
50
  };
51
- export type DeletedSong = {
51
+ export type SongsResponse = {
52
+ total_count: number;
53
+ md5: string;
54
+ song: SongResponse[];
55
+ };
56
+ export type DeletedSongResponse = {
52
57
  id: UID;
53
58
  addition_time: number;
54
59
  delete_time: number;
@@ -61,3 +66,8 @@ export type DeletedSong = {
61
66
  album: UID;
62
67
  artist: UID;
63
68
  };
69
+ export type DeletedSongsResponse = {
70
+ total_count: number;
71
+ md5: string;
72
+ deleted_song: DeletedSongResponse[];
73
+ };
@@ -1,4 +1,4 @@
1
- import { Base, BinaryBoolean, ExtendedPagination, 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
  /**
@@ -24,13 +24,13 @@ export declare class System extends Base {
24
24
  * @deprecated Being removed in 7.0.0. Use `list` instead.
25
25
  */
26
26
  getIndexes(params: {
27
- type: 'song' | 'album' | 'artist' | 'album_artist' | 'playlist' | 'podcast' | 'podcast_episode' | 'live_stream';
27
+ type: "song" | "album" | "artist" | "album_artist" | "playlist" | "podcast" | "podcast_episode" | "live_stream";
28
28
  filter?: string;
29
29
  add?: Date;
30
30
  update?: Date;
31
31
  include?: BinaryBoolean;
32
32
  hide_search?: BinaryBoolean;
33
- } & ExtendedPagination): Promise<any>;
33
+ } & ExtendedPagination): any;
34
34
  /**
35
35
  * This takes a named array of objects and returning `id`, `name`, `prefix` and `basename`
36
36
  * @remarks MINIMUM_API_VERSION=6.0.0
@@ -46,7 +46,7 @@ export declare class System extends Base {
46
46
  * @see {@link https://ampache.org/api/api-json-methods#list}
47
47
  */
48
48
  list(params: {
49
- type: 'song' | 'album' | 'artist' | 'album_artist' | 'playlist' | 'podcast' | 'podcast_episode' | 'live_stream';
49
+ type: "song" | "album" | "artist" | "album_artist" | "playlist" | "podcast" | "podcast_episode" | "live_stream";
50
50
  filter?: string;
51
51
  add?: Date;
52
52
  update?: Date;
@@ -71,7 +71,7 @@ export declare class System extends Base {
71
71
  * @see {@link https://ampache.org/api/api-json-methods#index}
72
72
  */
73
73
  index(params: {
74
- type: 'catalog' | 'song' | 'album' | 'artist' | 'album_artist' | 'song_artist' | 'playlist' | 'podcast' | 'podcast_episode' | 'share' | 'video' | 'live_stream';
74
+ type: "catalog" | "song" | "album" | "artist" | "album_artist" | "song_artist" | "playlist" | "podcast" | "podcast_episode" | "share" | "video" | "live_stream";
75
75
  filter?: string;
76
76
  exact?: BinaryBoolean;
77
77
  add?: Date;
@@ -98,7 +98,7 @@ export declare class System extends Base {
98
98
  */
99
99
  browse(params: {
100
100
  filter?: UID;
101
- type?: 'root' | 'catalog' | 'artist' | 'album' | 'podcast';
101
+ type?: "root" | "catalog" | "artist" | "album" | "podcast";
102
102
  catalog?: number;
103
103
  add?: Date;
104
104
  update?: Date;
@@ -115,9 +115,9 @@ export declare class System extends Base {
115
115
  * @see {@link https://ampache.org/api/api-json-methods#get_similar}
116
116
  */
117
117
  getSimilar(params: {
118
- type: 'song' | 'artist';
118
+ type: "song" | "artist";
119
119
  filter: UID;
120
- } & Pagination): Promise<any>;
120
+ } & Pagination): any;
121
121
  /**
122
122
  * Get some items based on some simple search types and filters. (Random by default)
123
123
  * @remarks MINIMUM_API_VERSION=380001; CHANGED_IN_API_VERSION=400001
@@ -130,11 +130,11 @@ export declare class System extends Base {
130
130
  * @see {@link https://ampache.org/api/api-json-methods#stats}
131
131
  */
132
132
  stats(params: {
133
- type: 'song' | 'album' | 'artist' | 'video' | 'playlist' | 'podcast' | 'podcast_episode';
134
- filter?: 'newest' | 'highest' | 'frequent' | 'recent' | 'forgotten' | 'flagged' | 'random';
133
+ type: "song" | "album" | "artist" | "video" | "playlist" | "podcast" | "podcast_episode";
134
+ filter?: "newest" | "highest" | "frequent" | "recent" | "forgotten" | "flagged" | "random";
135
135
  user_id?: number;
136
136
  username?: string;
137
- } & Pagination): Promise<any>;
137
+ } & Pagination): any;
138
138
  /**
139
139
  * This rates a library item
140
140
  * @remarks MINIMUM_API_VERSION=380001
@@ -144,7 +144,7 @@ export declare class System extends Base {
144
144
  * @see {@link https://ampache.org/api/api-json-methods#rate}
145
145
  */
146
146
  rate(params: {
147
- type: 'song' | 'album' | 'artist' | 'playlist' | 'podcast' | 'podcast_episode' | 'video' | 'tvshow' | 'tvshow_season';
147
+ type: "song" | "album" | "artist" | "playlist" | "podcast" | "podcast_episode" | "video" | "tvshow" | "tvshow_season";
148
148
  id: UID;
149
149
  rating: 0 | 1 | 2 | 3 | 4 | 5;
150
150
  }): Promise<Success>;
@@ -157,7 +157,7 @@ export declare class System extends Base {
157
157
  * @see {@link https://ampache.org/api/api-json-methods#flag}
158
158
  */
159
159
  flag(params: {
160
- type: 'song' | 'album' | 'artist' | 'playlist' | 'podcast' | 'podcast_episode' | 'video' | 'tvshow' | 'tvshow_season';
160
+ type: "song" | "album" | "artist" | "playlist" | "podcast" | "podcast_episode" | "video" | "tvshow" | "tvshow_season";
161
161
  id: UID;
162
162
  flag: BinaryBoolean;
163
163
  }): Promise<Success>;
@@ -215,7 +215,7 @@ export declare class System extends Base {
215
215
  * @see {@link https://ampache.org/api/api-json-methods#update_from_tags}
216
216
  */
217
217
  updateFromTags(params: {
218
- type: 'song' | 'artist' | 'album';
218
+ type: "song" | "artist" | "album";
219
219
  id: UID;
220
220
  }): Promise<Success>;
221
221
  /**
@@ -241,7 +241,7 @@ export declare class System extends Base {
241
241
  */
242
242
  updateArt(params: {
243
243
  id: UID;
244
- type: 'artist' | 'album' | 'song';
244
+ type: "artist" | "album" | "song";
245
245
  overwrite?: BinaryBoolean;
246
246
  }): Promise<Success>;
247
247
  /**
@@ -259,7 +259,7 @@ export declare class System extends Base {
259
259
  */
260
260
  stream(params: {
261
261
  id: UID;
262
- type: 'song' | 'podcast_episode' | 'search' | 'playlist';
262
+ type: "song" | "podcast_episode" | "search" | "playlist";
263
263
  bitrate?: number;
264
264
  format?: string;
265
265
  offset?: number;
@@ -276,7 +276,7 @@ export declare class System extends Base {
276
276
  */
277
277
  download(params: {
278
278
  id: UID;
279
- type: 'song' | 'podcast_episode' | 'search' | 'playlist';
279
+ type: "song" | "podcast_episode" | "search" | "playlist";
280
280
  format?: string;
281
281
  }): Promise<Blob>;
282
282
  /**
@@ -288,7 +288,7 @@ export declare class System extends Base {
288
288
  */
289
289
  getArt(params: {
290
290
  id: UID;
291
- type: 'song' | 'artist' | 'album' | 'playlist' | 'search' | 'podcast';
291
+ type: "song" | "artist" | "album" | "playlist" | "search" | "podcast";
292
292
  }): Promise<Blob>;
293
293
  /**
294
294
  * This is for controlling localplay
@@ -300,9 +300,9 @@ export declare class System extends Base {
300
300
  * @see {@link https://ampache.org/api/api-json-methods#localplay}
301
301
  */
302
302
  localplay(params: {
303
- command: 'next' | 'prev' | 'stop' | 'play' | 'pause' | 'add' | 'volume_up' | 'volume_down' | 'volume_mute' | 'delete_all' | 'skip' | 'status';
303
+ command: "next" | "prev" | "stop" | "play" | "pause" | "add" | "volume_up" | "volume_down" | "volume_mute" | "delete_all" | "skip" | "status";
304
304
  oid?: number;
305
- type?: 'song' | 'video' | 'podcast_episode' | 'channel' | 'broadcast' | 'democratic' | 'live_stream';
305
+ type?: "song" | "video" | "podcast_episode" | "channel" | "broadcast" | "democratic" | "live_stream";
306
306
  clear?: BinaryBoolean;
307
307
  }): Promise<unknown>;
308
308
  /**
@@ -322,7 +322,7 @@ export declare class System extends Base {
322
322
  */
323
323
  democratic(params: {
324
324
  oid: UID;
325
- method: 'vote' | 'devote' | 'playlist' | 'play';
325
+ method: "vote" | "devote" | "playlist" | "play";
326
326
  }): Promise<unknown>;
327
327
  /**
328
328
  * Perform an advanced search given passed rules.
@@ -337,9 +337,9 @@ export declare class System extends Base {
337
337
  * @see {@link https://ampache.org/api/api-json-methods#advanced_search}
338
338
  */
339
339
  advancedSearch(params: {
340
- operator: 'and' | 'or';
341
- type: 'song' | 'album' | 'album_disk' | 'artist' | 'album_artist' | 'song_artist' | 'label' | 'playlist' | 'podcast' | 'podcast_episode' | 'genre' | 'user' | 'video';
340
+ operator: "and" | "or";
341
+ type: "song" | "album" | "album_disk" | "artist" | "album_artist" | "song_artist" | "label" | "playlist" | "podcast" | "podcast_episode" | "genre" | "user" | "video";
342
342
  rules: Array<Array<string>>;
343
343
  random?: BinaryBoolean;
344
- } & Pagination): Promise<any>;
344
+ } & Pagination): any;
345
345
  }
@@ -1,13 +1,13 @@
1
- import { Song } from "../songs/types";
2
- import { Album } from "../albums/types";
3
- import { Artist } from "../artists/types";
4
- import { Playlist } from "../playlists/types";
5
- import { Podcast, PodcastEpisode } from "../podcasts/types";
6
- import { LiveStream } from "../live-streams/types";
7
- import { Video } from "../videos/types";
1
+ import { SongResponse } from "../songs/types";
2
+ import { AlbumResponse } from "../albums/types";
3
+ import { ArtistResponse } from "../artists/types";
4
+ import { PlaylistResponse } from "../playlists/types";
5
+ import { PodcastResponse, PodcastEpisodeResponse } from "../podcasts/types";
6
+ import { LiveStreamResponse } from "../live-streams/types";
7
+ import { VideoResponse } from "../videos/types";
8
8
  import { UID } from "../base";
9
- export type IndexType = Song | Album | Artist | Playlist | Podcast | PodcastEpisode | LiveStream;
10
- export type StatsType = Song | Album | Artist | Video | Playlist | Podcast | PodcastEpisode;
9
+ export type IndexType = SongResponse | AlbumResponse | ArtistResponse | PlaylistResponse | PodcastResponse | PodcastEpisodeResponse | LiveStreamResponse;
10
+ export type StatsType = SongResponse | AlbumResponse | ArtistResponse | VideoResponse | PlaylistResponse | PodcastResponse | PodcastEpisodeResponse;
11
11
  export type IndexEntry = {
12
12
  id: UID;
13
13
  name: string;
@@ -1,12 +1,12 @@
1
- import { User, UserSummary, Activity } from './types';
2
- import { Base, BinaryBoolean, ExtendedPagination, Success } from '../base';
1
+ import { UserResponse, UserSummary, ActivityResponse } from "./types";
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
6
6
  * @remarks MINIMUM_API_VERSION=5.0.0
7
7
  * @see {@link https://ampache.org/api/api-json-methods#users}
8
8
  */
9
- users(): Promise<UserSummary[] | {
9
+ users(): Promise<{
10
10
  user: UserSummary[];
11
11
  }>;
12
12
  /**
@@ -17,7 +17,7 @@ export declare class Users extends Base {
17
17
  */
18
18
  user(params?: {
19
19
  username?: string;
20
- }): Promise<User>;
20
+ }): Promise<UserResponse>;
21
21
  /**
22
22
  * Create a new user
23
23
  * ACCESS REQUIRED: 100 (Admin)
@@ -138,7 +138,7 @@ export declare class Users extends Base {
138
138
  */
139
139
  followers(params: {
140
140
  username: string;
141
- } & ExtendedPagination): Promise<UserSummary[] | {
141
+ } & ExtendedPagination): Promise<{
142
142
  user: UserSummary[];
143
143
  }>;
144
144
  /**
@@ -148,7 +148,7 @@ export declare class Users extends Base {
148
148
  */
149
149
  following(params: {
150
150
  username: string;
151
- }): Promise<UserSummary[] | {
151
+ }): Promise<{
152
152
  user: UserSummary[];
153
153
  }>;
154
154
  /**
@@ -171,8 +171,8 @@ export declare class Users extends Base {
171
171
  username: string;
172
172
  limit?: number;
173
173
  since?: number;
174
- }): Promise<Activity[] | {
175
- activity: Activity[];
174
+ }): Promise<{
175
+ activity: ActivityResponse[];
176
176
  }>;
177
177
  /**
178
178
  * This get current user friends timeline
@@ -184,7 +184,7 @@ export declare class Users extends Base {
184
184
  friendsTimeline(params?: {
185
185
  limit?: number;
186
186
  since?: number;
187
- }): Promise<Activity[] | {
188
- activity: Activity[];
187
+ }): Promise<{
188
+ activity: ActivityResponse[];
189
189
  }>;
190
190
  }
@@ -3,7 +3,7 @@ export type UserSummary = {
3
3
  id: UID;
4
4
  username: string;
5
5
  };
6
- export type User = {
6
+ export type UserResponse = {
7
7
  id: UID;
8
8
  username: string;
9
9
  auth: string;
@@ -19,7 +19,12 @@ export type User = {
19
19
  state: string | null;
20
20
  city: string | null;
21
21
  };
22
- export type Activity = {
22
+ export type UsersResponse = {
23
+ total_count: number;
24
+ md5: string;
25
+ user: UserResponse[];
26
+ };
27
+ export type ActivityResponse = {
23
28
  id: UID;
24
29
  date: number;
25
30
  object_type: string;
@@ -1,5 +1,5 @@
1
- import { Video, DeletedVideo } from './types';
2
- import { Base, BinaryBoolean, Pagination, UID } from '../base';
1
+ import { VideoResponse, VideosResponse, DeletedVideosResponse } from "./types";
2
+ import { Base, BinaryBoolean, Pagination, UID } from "../base";
3
3
  export declare class Videos extends Base {
4
4
  /**
5
5
  * Get videos
@@ -13,9 +13,7 @@ export declare class Videos extends Base {
13
13
  videos(params?: {
14
14
  filter?: string;
15
15
  exact?: BinaryBoolean;
16
- } & Pagination): Promise<Video[] | {
17
- video: Video[];
18
- }>;
16
+ } & Pagination): Promise<VideosResponse>;
19
17
  /**
20
18
  * This returns a single video
21
19
  * @remarks MINIMUM_API_VERSION=380001
@@ -24,14 +22,12 @@ export declare class Videos extends Base {
24
22
  */
25
23
  video(params: {
26
24
  filter: UID;
27
- }): Promise<Video>;
25
+ }): Promise<VideoResponse>;
28
26
  /**
29
27
  * This returns video objects that have been deleted
30
28
  * @param [params.offset]
31
29
  * @param [params.limit]
32
30
  * @see {@link https://ampache.org/api/api-json-methods#deleted_videos}
33
31
  */
34
- deletedVideos(params?: {} & Pagination): Promise<DeletedVideo[] | {
35
- deleted_video: DeletedVideo[];
36
- }>;
32
+ deletedVideos(params?: {} & Pagination): Promise<DeletedVideosResponse>;
37
33
  }
@@ -1,6 +1,6 @@
1
1
  import { UID } from "../base";
2
2
  import { GenreSummary } from "../genres/types";
3
- export type Video = {
3
+ export type VideoResponse = {
4
4
  id: UID;
5
5
  title: string;
6
6
  mime: string;
@@ -16,7 +16,12 @@ export type Video = {
16
16
  averagerating: number | null;
17
17
  playcount: number;
18
18
  };
19
- export type DeletedVideo = {
19
+ export type VideosResponse = {
20
+ total_count: number;
21
+ md5: string;
22
+ video: VideoResponse[];
23
+ };
24
+ export type DeletedVideoResponse = {
20
25
  id: UID;
21
26
  addition_time: number;
22
27
  delete_time: number;
@@ -26,3 +31,8 @@ export type DeletedVideo = {
26
31
  total_count: number;
27
32
  total_skip: number;
28
33
  };
34
+ export type DeletedVideosResponse = {
35
+ total_count: number;
36
+ md5: string;
37
+ deleted_video: DeletedVideoResponse[];
38
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "javascript-ampache",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A JS library for the Ampache API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.m.js",
@@ -30,7 +30,7 @@ export class Bookmarks extends Base {
30
30
  }
31
31
 
32
32
  /**
33
- * Get the bookmark from its object_id and object_type.
33
+ * Get the bookmark/s from its object_id and object_type.
34
34
  * @remarks MINIMUM_API_VERSION=5.0.0
35
35
  * @param params.filter UID to find
36
36
  * @param params.type Object type
@@ -41,6 +41,7 @@ export class Bookmarks extends Base {
41
41
  filter: UID;
42
42
  type: "song" | "video" | "podcast_episode";
43
43
  include?: BinaryBoolean;
44
+ all?: BinaryBoolean;
44
45
  }) {
45
46
  let query = "get_bookmark";
46
47
  query += qs.stringify(params, "&");
@@ -60,17 +60,15 @@ export class Playlists extends Base {
60
60
  }) {
61
61
  let query = "playlists";
62
62
  query += qs.stringify(params, "&");
63
- let data = this.request<PlaylistsResponse>(query).then((response) => {
63
+ return this.request<PlaylistsResponse>(query).then((response) => {
64
64
  // filter out regular playlists
65
65
  if (Array.isArray(response.playlist)) {
66
66
  response.playlist = response.playlist.filter((item) =>
67
67
  item.id.toString().startsWith("smart_"),
68
68
  );
69
69
  }
70
-
71
70
  return response;
72
71
  });
73
- return data;
74
72
  }
75
73
 
76
74
  /**