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/dist/songs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Base, BinaryBoolean, ExtendedPagination, Pagination, Success, UID } from
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
150
|
-
deleted_song: DeletedSong[];
|
|
151
|
-
}>;
|
|
135
|
+
deletedSongs(params?: {} & Pagination): Promise<DeletedSongsResponse>;
|
|
152
136
|
}
|
package/dist/songs/types.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
+
};
|
package/dist/system/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Base, BinaryBoolean, ExtendedPagination, Pagination, Success, UID } from
|
|
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:
|
|
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):
|
|
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:
|
|
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:
|
|
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?:
|
|
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:
|
|
118
|
+
type: "song" | "artist";
|
|
119
119
|
filter: UID;
|
|
120
|
-
} & Pagination):
|
|
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:
|
|
134
|
-
filter?:
|
|
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):
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
303
|
+
command: "next" | "prev" | "stop" | "play" | "pause" | "add" | "volume_up" | "volume_down" | "volume_mute" | "delete_all" | "skip" | "status";
|
|
304
304
|
oid?: number;
|
|
305
|
-
type?:
|
|
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:
|
|
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:
|
|
341
|
-
type:
|
|
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):
|
|
344
|
+
} & Pagination): any;
|
|
345
345
|
}
|
package/dist/system/types.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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 =
|
|
10
|
-
export type StatsType =
|
|
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;
|
package/dist/users/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Base, BinaryBoolean, ExtendedPagination, Success } from
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
175
|
-
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<
|
|
188
|
-
activity:
|
|
187
|
+
}): Promise<{
|
|
188
|
+
activity: ActivityResponse[];
|
|
189
189
|
}>;
|
|
190
190
|
}
|
package/dist/users/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type UserSummary = {
|
|
|
3
3
|
id: UID;
|
|
4
4
|
username: string;
|
|
5
5
|
};
|
|
6
|
-
export type
|
|
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
|
|
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;
|
package/dist/videos/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Base, BinaryBoolean, Pagination, UID } from
|
|
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<
|
|
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<
|
|
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<
|
|
35
|
-
deleted_video: DeletedVideo[];
|
|
36
|
-
}>;
|
|
32
|
+
deletedVideos(params?: {} & Pagination): Promise<DeletedVideosResponse>;
|
|
37
33
|
}
|
package/dist/videos/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UID } from "../base";
|
|
2
2
|
import { GenreSummary } from "../genres/types";
|
|
3
|
-
export type
|
|
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
|
|
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,38 +1,38 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "javascript-ampache",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "A JS library for the Ampache API",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.m.js",
|
|
7
|
-
"umd:main": "dist/index.umd.js",
|
|
8
|
-
"source": "src/index.ts",
|
|
9
|
-
"repository": "github:mitchray/javascript-ampache",
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "rimraf dist && microbundle --tsconfig tsconfig.json",
|
|
12
|
-
"dev": "microbundle watch --tsconfig tsconfig.json",
|
|
13
|
-
"test": "jest"
|
|
14
|
-
},
|
|
15
|
-
"devDependencies": {
|
|
16
|
-
"@types/jest": "^25.2.3",
|
|
17
|
-
"isomorphic-unfetch": "^3.1.0",
|
|
18
|
-
"jest": "^29.3.1",
|
|
19
|
-
"jssha": "^3.3.0",
|
|
20
|
-
"microbundle": "^0.15.1",
|
|
21
|
-
"nock": "^13.0.0",
|
|
22
|
-
"querystringify": "2.2.0",
|
|
23
|
-
"rimraf": "^5.0.0"
|
|
24
|
-
},
|
|
25
|
-
"keywords": [
|
|
26
|
-
"ampache",
|
|
27
|
-
"javascript",
|
|
28
|
-
"typescript",
|
|
29
|
-
"api",
|
|
30
|
-
"js"
|
|
31
|
-
],
|
|
32
|
-
"author": "mitchray (https://github.com/mitchray)",
|
|
33
|
-
"license": "GPL-3.0-only",
|
|
34
|
-
"files": [
|
|
35
|
-
"src",
|
|
36
|
-
"dist"
|
|
37
|
-
]
|
|
38
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "javascript-ampache",
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "A JS library for the Ampache API",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.m.js",
|
|
7
|
+
"umd:main": "dist/index.umd.js",
|
|
8
|
+
"source": "src/index.ts",
|
|
9
|
+
"repository": "github:mitchray/javascript-ampache",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "rimraf dist && microbundle --tsconfig tsconfig.json",
|
|
12
|
+
"dev": "microbundle watch --tsconfig tsconfig.json",
|
|
13
|
+
"test": "jest"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/jest": "^25.2.3",
|
|
17
|
+
"isomorphic-unfetch": "^3.1.0",
|
|
18
|
+
"jest": "^29.3.1",
|
|
19
|
+
"jssha": "^3.3.0",
|
|
20
|
+
"microbundle": "^0.15.1",
|
|
21
|
+
"nock": "^13.0.0",
|
|
22
|
+
"querystringify": "2.2.0",
|
|
23
|
+
"rimraf": "^5.0.0"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"ampache",
|
|
27
|
+
"javascript",
|
|
28
|
+
"typescript",
|
|
29
|
+
"api",
|
|
30
|
+
"js"
|
|
31
|
+
],
|
|
32
|
+
"author": "mitchray (https://github.com/mitchray)",
|
|
33
|
+
"license": "GPL-3.0-only",
|
|
34
|
+
"files": [
|
|
35
|
+
"src",
|
|
36
|
+
"dist"
|
|
37
|
+
]
|
|
38
|
+
}
|