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
|
@@ -1,107 +1,104 @@
|
|
|
1
|
-
import qs from
|
|
2
|
-
import {
|
|
3
|
-
import { Base, BinaryBoolean, ExtendedPagination, Success, UID } from
|
|
4
|
-
|
|
5
|
-
export class LiveStreams 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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return this.request<Success>(query);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
1
|
+
import qs from "querystringify";
|
|
2
|
+
import { LiveStreamResponse, LiveStreamsResponse } from "./types";
|
|
3
|
+
import { Base, BinaryBoolean, ExtendedPagination, Success, UID } from "../base";
|
|
4
|
+
|
|
5
|
+
export class LiveStreams extends Base {
|
|
6
|
+
/**
|
|
7
|
+
* This returns live_streams based on the specified filter
|
|
8
|
+
* @remarks MINIMUM_API_VERSION=5.1.0
|
|
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.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
|
|
12
|
+
* @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
|
|
13
|
+
* @param [params.offset]
|
|
14
|
+
* @param [params.limit]
|
|
15
|
+
* @param [params.cond]
|
|
16
|
+
* @param [params.sort]
|
|
17
|
+
* @see {@link https://ampache.org/api/api-json-methods#live_streams}
|
|
18
|
+
*/
|
|
19
|
+
liveStreams(
|
|
20
|
+
params?: {
|
|
21
|
+
filter?: string;
|
|
22
|
+
exact?: BinaryBoolean;
|
|
23
|
+
add?: Date;
|
|
24
|
+
update?: Date;
|
|
25
|
+
} & ExtendedPagination,
|
|
26
|
+
) {
|
|
27
|
+
let query = "live_streams";
|
|
28
|
+
query += qs.stringify(params, "&");
|
|
29
|
+
return this.request<LiveStreamsResponse>(query);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* This returns a single live_stream
|
|
34
|
+
* @remarks MINIMUM_API_VERSION=5.1.0
|
|
35
|
+
* @param params.filter UID to find
|
|
36
|
+
* @see {@link https://ampache.org/api/api-json-methods#live_stream}
|
|
37
|
+
*/
|
|
38
|
+
liveStream(params: { filter: UID }) {
|
|
39
|
+
let query = "live_stream";
|
|
40
|
+
query += qs.stringify(params, "&");
|
|
41
|
+
return this.request<LiveStreamResponse>(query);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Create a live_stream (radio station) object.
|
|
46
|
+
* ACCESS REQUIRED: 50 (Content Manager)
|
|
47
|
+
* @remarks MINIMUM_API_VERSION=6.0.0
|
|
48
|
+
* @param params.name Stream title
|
|
49
|
+
* @param params.url URL of the http/s stream
|
|
50
|
+
* @param params.codec Stream codec
|
|
51
|
+
* @param params.catalog Catalog ID to associate with this stream
|
|
52
|
+
* @param [params.site_url] Homepage URL of the stream
|
|
53
|
+
* @see {@link https://ampache.org/api/api-json-methods#live_stream_create}
|
|
54
|
+
*/
|
|
55
|
+
liveStreamCreate(params: {
|
|
56
|
+
name: string;
|
|
57
|
+
url: string;
|
|
58
|
+
codec: "mp3" | "flac" | "ogg" | "vorbis" | "opus" | "aac" | "alac";
|
|
59
|
+
catalog: string;
|
|
60
|
+
site_url?: string;
|
|
61
|
+
}) {
|
|
62
|
+
let query = "live_stream_create";
|
|
63
|
+
query += qs.stringify(params, "&");
|
|
64
|
+
return this.request<LiveStreamResponse>(query);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Edit a live_stream (radio station) object.
|
|
69
|
+
* ACCESS REQUIRED: 50 (Content Manager)
|
|
70
|
+
* @remarks MINIMUM_API_VERSION=6.0.0
|
|
71
|
+
* @param params.filter Object to find
|
|
72
|
+
* @param [params.name] Stream title
|
|
73
|
+
* @param [params.url] URL of the http/s stream
|
|
74
|
+
* @param [params.codec] Stream codec
|
|
75
|
+
* @param [params.catalog] Catalog ID to associate with this stream
|
|
76
|
+
* @param [params.site_url] Homepage URL of the stream
|
|
77
|
+
* @see {@link https://ampache.org/api/api-json-methods#live_stream_edit}
|
|
78
|
+
*/
|
|
79
|
+
liveStreamEdit(params: {
|
|
80
|
+
filter: string;
|
|
81
|
+
name?: string;
|
|
82
|
+
url?: string;
|
|
83
|
+
codec?: "mp3" | "flac" | "ogg" | "vorbis" | "opus" | "aac" | "alac";
|
|
84
|
+
catalog?: string;
|
|
85
|
+
site_url?: string;
|
|
86
|
+
}) {
|
|
87
|
+
let query = "live_stream_edit";
|
|
88
|
+
query += qs.stringify(params, "&");
|
|
89
|
+
return this.request<LiveStreamResponse>(query);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Delete a live_stream (radio station) object (if it exists)
|
|
94
|
+
* ACCESS REQUIRED: 50 (Content Manager)
|
|
95
|
+
* @remarks MINIMUM_API_VERSION=6.0.0
|
|
96
|
+
* @param params.filter Object to find
|
|
97
|
+
* @see {@link https://ampache.org/api/api-json-methods#live_stream_delete}
|
|
98
|
+
*/
|
|
99
|
+
liveStreamDelete(params: { filter: string }) {
|
|
100
|
+
let query = "live_stream_delete";
|
|
101
|
+
query += qs.stringify(params, "&");
|
|
102
|
+
return this.request<Success>(query);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { UID } from "../base";
|
|
2
|
-
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
1
|
+
import { UID } from "../base";
|
|
2
|
+
|
|
3
|
+
export type LiveStreamResponse = {
|
|
4
|
+
id: UID;
|
|
5
|
+
name: string;
|
|
6
|
+
url: string;
|
|
7
|
+
codec: string;
|
|
8
|
+
catalog: UID;
|
|
9
|
+
site_url: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type LiveStreamsResponse = {
|
|
13
|
+
total_count: number;
|
|
14
|
+
md5: string;
|
|
15
|
+
live_stream: LiveStreamResponse[];
|
|
16
|
+
};
|