javascript-ampache 1.0.9 → 1.1.0
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/base.d.ts +5 -0
- package/dist/index.js.map +1 -1
- package/dist/index.m.js.map +1 -1
- package/dist/index.modern.mjs.map +1 -1
- package/dist/index.umd.js.map +1 -1
- 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 +115 -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 +264 -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/src/videos/index.ts
CHANGED
|
@@ -1,53 +1,49 @@
|
|
|
1
|
-
import qs from
|
|
2
|
-
import {
|
|
3
|
-
import { Base, BinaryBoolean, Pagination, UID } from
|
|
4
|
-
|
|
5
|
-
export class Videos extends Base {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
let data = await this.request<{deleted_video: DeletedVideo[]}>(query);
|
|
51
|
-
return (data.deleted_video) ? data.deleted_video : data;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
1
|
+
import qs from "querystringify";
|
|
2
|
+
import { VideoResponse, VideosResponse, DeletedVideosResponse } from "./types";
|
|
3
|
+
import { Base, BinaryBoolean, Pagination, UID } from "../base";
|
|
4
|
+
|
|
5
|
+
export class Videos extends Base {
|
|
6
|
+
/**
|
|
7
|
+
* Get videos
|
|
8
|
+
* @remarks MINIMUM_API_VERSION=380001
|
|
9
|
+
* @param [params.filter] Filter results to match this string
|
|
10
|
+
* @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
|
|
11
|
+
* @param [params.offset]
|
|
12
|
+
* @param [params.limit]
|
|
13
|
+
* @see {@link https://ampache.org/api/api-json-methods#videos}
|
|
14
|
+
*/
|
|
15
|
+
videos(
|
|
16
|
+
params?: {
|
|
17
|
+
filter?: string;
|
|
18
|
+
exact?: BinaryBoolean;
|
|
19
|
+
} & Pagination,
|
|
20
|
+
) {
|
|
21
|
+
let query = "videos";
|
|
22
|
+
query += qs.stringify(params, "&");
|
|
23
|
+
return this.request<VideosResponse>(query);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* This returns a single video
|
|
28
|
+
* @remarks MINIMUM_API_VERSION=380001
|
|
29
|
+
* @param params.filter UID to find
|
|
30
|
+
* @see {@link https://ampache.org/api/api-json-methods#video}
|
|
31
|
+
*/
|
|
32
|
+
video(params: { filter: UID }) {
|
|
33
|
+
let query = "video";
|
|
34
|
+
query += qs.stringify(params, "&");
|
|
35
|
+
return this.request<VideoResponse>(query);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* This returns video objects that have been deleted
|
|
40
|
+
* @param [params.offset]
|
|
41
|
+
* @param [params.limit]
|
|
42
|
+
* @see {@link https://ampache.org/api/api-json-methods#deleted_videos}
|
|
43
|
+
*/
|
|
44
|
+
deletedVideos(params?: {} & Pagination) {
|
|
45
|
+
let query = "deleted_videos";
|
|
46
|
+
query += qs.stringify(params, "&");
|
|
47
|
+
return this.request<DeletedVideosResponse>(query);
|
|
48
|
+
}
|
|
49
|
+
}
|
package/src/videos/types.ts
CHANGED
|
@@ -1,30 +1,42 @@
|
|
|
1
|
-
import { UID } from "../base";
|
|
2
|
-
import { GenreSummary } from "../genres/types";
|
|
3
|
-
|
|
4
|
-
export type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export type
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
import { UID } from "../base";
|
|
2
|
+
import { GenreSummary } from "../genres/types";
|
|
3
|
+
|
|
4
|
+
export type VideoResponse = {
|
|
5
|
+
id: UID;
|
|
6
|
+
title: string;
|
|
7
|
+
mime: string;
|
|
8
|
+
resolution: string;
|
|
9
|
+
size: number;
|
|
10
|
+
genre: GenreSummary[];
|
|
11
|
+
time: number;
|
|
12
|
+
url: string;
|
|
13
|
+
art: string;
|
|
14
|
+
has_art: boolean;
|
|
15
|
+
flag: boolean;
|
|
16
|
+
rating: number | null;
|
|
17
|
+
averagerating: number | null;
|
|
18
|
+
playcount: number;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type VideosResponse = {
|
|
22
|
+
total_count: number;
|
|
23
|
+
md5: string;
|
|
24
|
+
video: VideoResponse[];
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type DeletedVideoResponse = {
|
|
28
|
+
id: UID;
|
|
29
|
+
addition_time: number;
|
|
30
|
+
delete_time: number;
|
|
31
|
+
title: string;
|
|
32
|
+
file: string;
|
|
33
|
+
catalog: UID;
|
|
34
|
+
total_count: number;
|
|
35
|
+
total_skip: number;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type DeletedVideosResponse = {
|
|
39
|
+
total_count: number;
|
|
40
|
+
md5: string;
|
|
41
|
+
deleted_video: DeletedVideoResponse[];
|
|
42
|
+
};
|