javascript-ampache 1.1.10 → 2.0.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.
Files changed (108) hide show
  1. package/README.md +16 -6
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.m.js +1 -1
  5. package/dist/index.m.js.map +1 -1
  6. package/dist/index.modern.mjs +1 -1
  7. package/dist/index.modern.mjs.map +1 -1
  8. package/dist/index.umd.js +1 -1
  9. package/dist/index.umd.js.map +1 -1
  10. package/package.json +8 -7
  11. package/src/albums.js +106 -0
  12. package/src/artists.js +105 -0
  13. package/src/auth.js +142 -0
  14. package/src/base.js +145 -0
  15. package/src/bookmarks.js +106 -0
  16. package/src/catalogs.js +133 -0
  17. package/src/genres.js +57 -0
  18. package/src/index.js +30 -0
  19. package/src/labels.js +53 -0
  20. package/src/licenses.js +47 -0
  21. package/src/live-streams.js +97 -0
  22. package/src/playlists.js +241 -0
  23. package/src/podcasts.js +230 -0
  24. package/src/preferences.js +114 -0
  25. package/src/shares.js +99 -0
  26. package/src/shouts.js +24 -0
  27. package/src/songs.js +273 -0
  28. package/src/system.js +510 -0
  29. package/src/users.js +224 -0
  30. package/src/{utils.ts → utils.js} +16 -16
  31. package/src/videos.js +84 -0
  32. package/dist/albums/index.d.ts +0 -64
  33. package/dist/albums/types.d.ts +0 -37
  34. package/dist/artists/index.d.ts +0 -64
  35. package/dist/artists/types.d.ts +0 -35
  36. package/dist/auth/index.d.ts +0 -56
  37. package/dist/auth/types.d.ts +0 -32
  38. package/dist/base.d.ts +0 -47
  39. package/dist/bookmarks/index.d.ts +0 -91
  40. package/dist/bookmarks/types.d.ts +0 -13
  41. package/dist/catalogs/index.d.ts +0 -87
  42. package/dist/catalogs/types.d.ts +0 -19
  43. package/dist/genres/index.d.ts +0 -28
  44. package/dist/genres/types.d.ts +0 -22
  45. package/dist/index.d.ts +0 -24
  46. package/dist/labels/index.d.ts +0 -32
  47. package/dist/labels/types.d.ts +0 -18
  48. package/dist/licenses/index.d.ts +0 -32
  49. package/dist/licenses/types.d.ts +0 -12
  50. package/dist/live-streams/index.d.ts +0 -80
  51. package/dist/live-streams/types.d.ts +0 -14
  52. package/dist/playlists/index.d.ts +0 -204
  53. package/dist/playlists/types.d.ts +0 -26
  54. package/dist/podcasts/index.d.ts +0 -121
  55. package/dist/podcasts/types.d.ts +0 -79
  56. package/dist/preferences/index.d.ts +0 -80
  57. package/dist/preferences/types.d.ts +0 -18
  58. package/dist/shares/index.d.ts +0 -69
  59. package/dist/shares/types.d.ts +0 -23
  60. package/dist/shouts/index.d.ts +0 -17
  61. package/dist/shouts/types.d.ts +0 -10
  62. package/dist/songs/index.d.ts +0 -143
  63. package/dist/songs/types.d.ts +0 -73
  64. package/dist/system/index.d.ts +0 -407
  65. package/dist/system/types.d.ts +0 -24
  66. package/dist/users/index.d.ts +0 -190
  67. package/dist/users/types.d.ts +0 -34
  68. package/dist/utils.d.ts +0 -4
  69. package/dist/videos/index.d.ts +0 -33
  70. package/dist/videos/types.d.ts +0 -38
  71. package/src/albums/index.ts +0 -88
  72. package/src/albums/types.ts +0 -40
  73. package/src/artists/index.ts +0 -88
  74. package/src/artists/types.ts +0 -38
  75. package/src/auth/index.ts +0 -118
  76. package/src/auth/types.ts +0 -32
  77. package/src/base.ts +0 -133
  78. package/src/bookmarks/index.ts +0 -116
  79. package/src/bookmarks/types.ts +0 -15
  80. package/src/catalogs/index.ts +0 -130
  81. package/src/catalogs/types.ts +0 -27
  82. package/src/genres/index.ts +0 -39
  83. package/src/genres/types.ts +0 -25
  84. package/src/index.ts +0 -63
  85. package/src/labels/index.ts +0 -43
  86. package/src/labels/types.ts +0 -20
  87. package/src/licenses/index.ts +0 -43
  88. package/src/licenses/types.ts +0 -14
  89. package/src/live-streams/index.ts +0 -104
  90. package/src/live-streams/types.ts +0 -16
  91. package/src/playlists/index.ts +0 -280
  92. package/src/playlists/types.ts +0 -29
  93. package/src/podcasts/index.ts +0 -174
  94. package/src/podcasts/types.ts +0 -85
  95. package/src/preferences/index.ts +0 -114
  96. package/src/preferences/types.ts +0 -20
  97. package/src/shares/index.ts +0 -100
  98. package/src/shares/types.ts +0 -25
  99. package/src/shouts/index.ts +0 -18
  100. package/src/shouts/types.ts +0 -11
  101. package/src/songs/index.ts +0 -221
  102. package/src/songs/types.ts +0 -77
  103. package/src/system/index.ts +0 -845
  104. package/src/system/types.ts +0 -42
  105. package/src/users/index.ts +0 -227
  106. package/src/users/types.ts +0 -38
  107. package/src/videos/index.ts +0 -49
  108. package/src/videos/types.ts +0 -42
@@ -1,14 +0,0 @@
1
- import { UID } from "../base";
2
-
3
- export type LicenseResponse = {
4
- id: UID;
5
- name: string;
6
- description: string;
7
- external_link: string;
8
- };
9
-
10
- export type LicensesResponse = {
11
- total_count: number;
12
- md5: string;
13
- license: LicenseResponse[];
14
- };
@@ -1,104 +0,0 @@
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,16 +0,0 @@
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
- };
@@ -1,280 +0,0 @@
1
- import qs from "querystringify";
2
- import { HashResponse, PlaylistResponse, PlaylistsResponse } from "./types";
3
- import { SongsResponse } from "../songs/types";
4
- import {
5
- Base,
6
- BinaryBoolean,
7
- ExtendedPagination,
8
- Pagination,
9
- Success,
10
- UID,
11
- } from "../base";
12
-
13
- export class Playlists extends Base {
14
- /**
15
- * This returns playlists based on the specified filter
16
- * @remarks MINIMUM_API_VERSION=380001
17
- * @param [params.filter] Filter results to match this string
18
- * @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
19
- * @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
20
- * @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
21
- * @param [params.hide_search] 0, 1 (if true do not include searches/smartlists in the result)
22
- * @param [params.show_dupes] 0, 1 (if true ignore 'api_hide_dupe_searches' setting)
23
- * @param [params.include] 0, 1 (if true include the objects in the playlist)
24
- * @param [params.offset]
25
- * @param [params.limit]
26
- * @param [params.cond]
27
- * @param [params.sort]
28
- * @see {@link https://ampache.org/api/api-json-methods#playlists}
29
- */
30
- playlists(
31
- params?: {
32
- filter?: string;
33
- exact?: BinaryBoolean;
34
- add?: Date;
35
- update?: Date;
36
- hide_search?: BinaryBoolean;
37
- show_dupes?: BinaryBoolean;
38
- include?: BinaryBoolean;
39
- } & ExtendedPagination,
40
- ) {
41
- let query = "playlists";
42
- query += qs.stringify(params, "&");
43
- return this.request<PlaylistsResponse>(query);
44
- }
45
-
46
- /**
47
- * This returns smartlists based on the specified filter. NOTE: Filtered from Playlists() so pagination is invalid.
48
- * @remarks MINIMUM_API_VERSION=380001
49
- * @param [params.filter] Filter results to match this string
50
- * @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
51
- * @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
52
- * @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
53
- * @param [params.show_dupes] 0, 1 (if true ignore 'api_hide_dupe_searches' setting)
54
- * @see {@link https://ampache.org/api/api-json-methods#playlists}
55
- */
56
- smartlists(params?: {
57
- filter?: string;
58
- exact?: BinaryBoolean;
59
- add?: Date;
60
- update?: Date;
61
- show_dupes?: BinaryBoolean;
62
- }) {
63
- let query = "playlists";
64
- query += qs.stringify(params, "&");
65
- return this.request<PlaylistsResponse>(query).then((response) => {
66
- // filter out regular playlists
67
- if (Array.isArray(response.playlist)) {
68
- response.playlist = response.playlist.filter((item) =>
69
- item.id.toString().startsWith("smart_"),
70
- );
71
- }
72
- return response;
73
- });
74
- }
75
-
76
- /**
77
- * This returns a single playlist
78
- * @remarks MINIMUM_API_VERSION=380001
79
- * @param params.filter UID to find
80
- * @see {@link https://ampache.org/api/api-json-methods#playlist}
81
- */
82
- playlist(params: { filter: UID }) {
83
- let query = "playlist";
84
- query += qs.stringify(params, "&");
85
- return this.request<PlaylistResponse>(query);
86
- }
87
-
88
- /**
89
- * This returns a user's playlists based on the specified filter
90
- * @remarks MINIMUM_API_VERSION=6.3.0
91
- * @param [params.filter] Filter results to match this string
92
- * @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
93
- * @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
94
- * @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
95
- * @param [params.offset]
96
- * @param [params.limit]
97
- * @param [params.cond]
98
- * @param [params.sort]
99
- * @see {@link https://ampache.org/api/api-json-methods#user_playlists}
100
- */
101
- userPlaylists(
102
- params?: {
103
- filter?: string;
104
- exact?: BinaryBoolean;
105
- add?: Date;
106
- update?: Date;
107
- } & ExtendedPagination,
108
- ) {
109
- let query = "user_playlists";
110
- query += qs.stringify(params, "&");
111
- return this.request<PlaylistsResponse>(query);
112
- }
113
-
114
- /**
115
- * This returns a user's smartlists based on the specified filter
116
- * @remarks MINIMUM_API_VERSION=6.3.0
117
- * @param [params.filter] Filter results to match this string
118
- * @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
119
- * @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
120
- * @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
121
- * @param [params.offset]
122
- * @param [params.limit]
123
- * @param [params.cond]
124
- * @param [params.sort]
125
- * @see {@link https://ampache.org/api/api-json-methods#user_smartlists}
126
- */
127
- userSmartlists(
128
- params?: {
129
- filter?: string;
130
- exact?: BinaryBoolean;
131
- add?: Date;
132
- update?: Date;
133
- } & ExtendedPagination,
134
- ) {
135
- let query = "user_smartlists";
136
- query += qs.stringify(params, "&");
137
- return this.request<PlaylistsResponse>(query);
138
- }
139
-
140
- /**
141
- * This creates a new playlist and returns it
142
- * @remarks MINIMUM_API_VERSION=380001
143
- * @param params.name Playlist name
144
- * @param [params.type] public, private (Playlist type)
145
- * @see {@link https://ampache.org/api/api-json-methods#playlist_create}
146
- */
147
- playlistCreate(params: { name: string; type?: "public" | "private" }) {
148
- let query = "playlist_create";
149
- query += qs.stringify(params, "&");
150
- return this.request<PlaylistResponse>(query);
151
- }
152
-
153
- /**
154
- * This adds an item to a playlist
155
- * @remarks MINIMUM_API_VERSION=6.3.0
156
- * @param params.filter UID of Playlist
157
- * @param params.id UID of the object to add to playlist
158
- * @param params.type 'song', 'album', 'artist', 'playlist'
159
- * @see {@link https://ampache.org/api/api-json-methods#playlist_add}
160
- */
161
- playlistAdd(params: {
162
- filter: UID;
163
- id: UID;
164
- type: "song" | "album" | "artist" | "playlist";
165
- }) {
166
- let query = "playlist_add";
167
- query += qs.stringify(params, "&");
168
- return this.request<Success>(query);
169
- }
170
-
171
- /**
172
- * This modifies name and type of the playlist.
173
- * NOTE items and tracks must be sent together and be of equal length.
174
- * @remarks MINIMUM_API_VERSION=400001
175
- * @param params.filter UID to find
176
- * @param [params.name] Playlist name
177
- * @param [params.type] public, private (Playlist type)
178
- * @param [params.owner] Change playlist owner to the user id (-1 = System playlist)
179
- * @param [params.items] comma-separated song_id's (replaces existing items with a new id)
180
- * @param [params.tracks] comma-separated playlisttrack numbers matched to 'items' in order
181
- * @see {@link https://ampache.org/api/api-json-methods#playlist_edit}
182
- */
183
- playlistEdit(params: {
184
- filter: UID;
185
- name?: string;
186
- type?: "public" | "private";
187
- owner?: string;
188
- items?: string;
189
- tracks?: string;
190
- }) {
191
- let query = "playlist_edit";
192
- query += qs.stringify(params, "&");
193
- return this.request<Success>(query);
194
- }
195
-
196
- /**
197
- * This deletes a playlist
198
- * @remarks MINIMUM_API_VERSION=380001
199
- * @param params.filter UID of playlist to delete
200
- * @see {@link https://ampache.org/api/api-json-methods#playlist_delete}
201
- */
202
- playlistDelete(params: { filter: UID }) {
203
- let query = "playlist_delete";
204
- query += qs.stringify(params, "&");
205
- return this.request<Success>(query);
206
- }
207
-
208
- /**
209
- * This adds a song to a playlist
210
- * @remarks MINIMUM_API_VERSION=380001; CHANGED_IN_API_VERSION=400003
211
- * @param params.filter UID of Playlist
212
- * @param params.song UID of song to add to playlist
213
- * @param [params.check] 0, 1 Whether to check and ignore duplicates (default = 0)
214
- * @see {@link https://ampache.org/api/api-json-methods#playlist_add_song}
215
- * @deprecated Being removed in 7.0.0. Use `playlist_add` instead.
216
- */
217
- playlistAddSong(params: { filter: UID; song: UID; check?: BinaryBoolean }) {
218
- let query = "playlist_add_song";
219
- query += qs.stringify(params, "&");
220
- return this.request<Success>(query);
221
- }
222
-
223
- /**
224
- * This remove a song from a playlist
225
- * @remarks MINIMUM_API_VERSION=380001; CHANGED_IN_API_VERSION=400001
226
- * @param params.filter UID of Playlist
227
- * @param [params.song] UID of song to remove from playlist
228
- * @param [params.track] Track number to remove from playlist
229
- * @see {@link https://ampache.org/api/api-json-methods#playlist_remove_song}
230
- */
231
- playlistRemoveSong(params: { filter: UID; song?: UID; track?: number }) {
232
- let query = "playlist_remove_song";
233
- query += qs.stringify(params, "&");
234
- return this.request<Success>(query);
235
- }
236
-
237
- /**
238
- * Get a list of song JSON, indexes or id's based on some simple search criteria
239
- * @remarks MINIMUM_API_VERSION=400001; CHANGED_IN_API_VERSION=400002; 'recent' will search for tracks played after 'Popular Threshold' days; 'forgotten' will search for tracks played before 'Popular Threshold' days; 'unplayed' added in 400002 for searching unplayed tracks
240
- * @param [params.mode] (default = 'random')
241
- * @param [params.filter] string LIKE matched to song title
242
- * @param [params.album] UID of album
243
- * @param [params.artist] UID of artist
244
- * @param [params.flag] 0, 1 (get flagged songs only. default = 0)
245
- * @param [params.format] song, index, id (default = 'song')
246
- * @param [params.offset]
247
- * @param [params.limit]
248
- * @see {@link https://ampache.org/api/api-json-methods#playlist_generate}
249
- */
250
- playlistGenerate(
251
- params?: {
252
- mode?: "recent" | "forgotten" | "unplayed" | "random";
253
- filter?: string;
254
- album?: number;
255
- artist?: number;
256
- flag?: BinaryBoolean;
257
- format?: "song" | "index" | "id";
258
- } & Pagination,
259
- ) {
260
- let query = "playlist_generate";
261
- query += qs.stringify(params, "&");
262
- return this.request<SongsResponse>(query);
263
- }
264
-
265
- /**
266
- * This returns the md5 hash for the songs in a playlist
267
- * @remarks MINIMUM_API_VERSION=6.6.0
268
- * @param params.filter string UID of Playlist
269
- * @see {@link https://ampache.org/api/api-json-methods#playlist_hash}
270
- */
271
- playlistHash(
272
- params: {
273
- filter: UID;
274
- },
275
- ) {
276
- let query = "playlist_hash";
277
- query += qs.stringify(params, "&");
278
- return this.request<HashResponse>(query);
279
- }
280
- }
@@ -1,29 +0,0 @@
1
- import { UID } from "../base";
2
- import { UserSummary } from "../users/types"
3
-
4
- export type PlaylistResponse = {
5
- id: UID;
6
- name: string;
7
- owner: string;
8
- items: number;
9
- type: "public" | "private";
10
- art: string;
11
- has_art: boolean;
12
- flag: boolean;
13
- rating: number | null;
14
- averagerating: number | null;
15
- user: UserSummary;
16
- has_access: boolean;
17
- has_collaborate: boolean;
18
- last_update: number;
19
- };
20
-
21
- export type PlaylistsResponse = {
22
- total_count: number;
23
- md5: string;
24
- playlist: PlaylistResponse[];
25
- };
26
-
27
- export type HashResponse = {
28
- md5: string;
29
- };
@@ -1,174 +0,0 @@
1
- import qs from "querystringify";
2
- import {
3
- PodcastResponse,
4
- PodcastsResponse,
5
- PodcastEpisodeResponse,
6
- PodcastEpisodesResponse,
7
- DeletedPodcastEpisodeResponse,
8
- DeletedPodcastEpisodesResponse,
9
- } from "./types";
10
- import { Base, ExtendedPagination, Pagination, Success, UID } from "../base";
11
-
12
- export class Podcasts extends Base {
13
- /**
14
- * Get information about podcasts
15
- * @remarks MINIMUM_API_VERSION=420000
16
- * @param [params.filter] Value is Alpha Match for returned results, may be more than one letter/number
17
- * @param [params.include] episodes (include podcast_episodes in the response)
18
- * @param [params.offset]
19
- * @param [params.limit]
20
- * @param [params.cond]
21
- * @param [params.sort]
22
- * @see {@link https://ampache.org/api/api-json-methods#podcasts}
23
- */
24
- podcasts(
25
- params?: {
26
- filter?: string;
27
- include?: "episodes";
28
- } & ExtendedPagination,
29
- ) {
30
- let query = "podcasts";
31
- query += qs.stringify(params, "&");
32
- return this.request<PodcastsResponse>(query);
33
- }
34
-
35
- /**
36
- * Get information about podcasts
37
- * @remarks MINIMUM_API_VERSION=420000
38
- * @param params.filter UID to find
39
- * @param [params.include] episodes (include podcast_episodes in the response)
40
- * @param [params.offset]
41
- * @param [params.limit]
42
- * @see {@link https://ampache.org/api/api-json-methods#podcast}
43
- */
44
- podcast(
45
- params?: {
46
- filter: UID;
47
- include?: "episodes";
48
- } & Pagination,
49
- ) {
50
- let query = "podcast";
51
- query += qs.stringify(params, "&");
52
- return this.request<PodcastResponse>(query);
53
- }
54
-
55
- /**
56
- * Create a podcast that can be used by anyone to stream media.
57
- * @remarks MINIMUM_API_VERSION=420000
58
- * @param params.url RSS url for podcast
59
- * @param params.catalog UID of podcast catalog
60
- * @see {@link https://ampache.org/api/api-json-methods#podcast_create}
61
- */
62
- podcastCreate(params: { url: string; catalog: UID }) {
63
- let query = "podcast_create";
64
- query += qs.stringify(params, "&");
65
- return this.request<PodcastResponse>(query);
66
- }
67
-
68
- /**
69
- * Update the description and/or expiration date for an existing podcast.
70
- * @remarks MINIMUM_API_VERSION=420000
71
- * @param params.filter UID to find
72
- * @param [params.feed] RSS url for podcast
73
- * @param [params.title] Podcast title
74
- * @param [params.website] Source website URL
75
- * @param [params.description] Podcast description
76
- * @param [params.generator] Podcast generator
77
- * @param [params.copyright] Podcast copyright
78
- * @see {@link https://ampache.org/api/api-json-methods#podcast_edit}
79
- */
80
- podcastEdit(params: {
81
- filter: UID;
82
- feed?: string;
83
- title?: string;
84
- website?: string;
85
- description?: string;
86
- generator?: string;
87
- copyright?: string;
88
- }) {
89
- let query = "podcast_edit";
90
- query += qs.stringify(params, "&");
91
- return this.request<Success>(query);
92
- }
93
-
94
- /**
95
- * Delete an existing podcast
96
- * @remarks MINIMUM_API_VERSION=420000
97
- * @param params.filter UID of podcast to delete
98
- * @see {@link https://ampache.org/api/api-json-methods#podcast_delete}
99
- */
100
- podcastDelete(params: { filter: UID }) {
101
- let query = "podcast_delete";
102
- query += qs.stringify(params, "&");
103
- return this.request<Success>(query);
104
- }
105
-
106
- /**
107
- * This returns the episodes for a podcast
108
- * @remarks MINIMUM_API_VERSION=420000
109
- * @param params.filter UID of podcast
110
- * @param [params.offset]
111
- * @param [params.limit]
112
- * @param [params.cond]
113
- * @param [params.sort]
114
- * @see {@link https://ampache.org/api/api-json-methods#podcast_episodes}
115
- */
116
- podcastEpisodes(
117
- params: {
118
- filter: UID;
119
- } & ExtendedPagination,
120
- ) {
121
- let query = "podcast_episodes";
122
- query += qs.stringify(params, "&");
123
- return this.request<PodcastEpisodesResponse>(query);
124
- }
125
-
126
- /**
127
- * Get the podcast_episode from a UID
128
- * @remarks MINIMUM_API_VERSION=420000
129
- * @param params.filter UID of podcast
130
- * @see {@link https://ampache.org/api/api-json-methods#podcast_episode}
131
- */
132
- podcastEpisode(params: { filter: UID }) {
133
- let query = "podcast_episode";
134
- query += qs.stringify(params, "&");
135
- return this.request<PodcastEpisodeResponse>(query);
136
- }
137
-
138
- /**
139
- * Delete an existing podcast_episode
140
- * @remarks MINIMUM_API_VERSION=420000
141
- * @param params.filter UID of podcast episode to delete
142
- * @see {@link https://ampache.org/api/api-json-methods#podcast_episode_delete}
143
- */
144
- podcastEpisodeDelete(params: { filter: UID }) {
145
- let query = "podcast_episode_delete";
146
- query += qs.stringify(params, "&");
147
- return this.request<Success>(query);
148
- }
149
-
150
- /**
151
- * Sync and download new podcast episodes
152
- * ACCESS REQUIRED: 50 (Content Manager)
153
- * @remarks MINIMUM_API_VERSION=420000
154
- * @param params.id UID of podcast
155
- * @see {@link https://ampache.org/api/api-json-methods#update_podcast}
156
- */
157
- updatePodcast(params: { id: UID }) {
158
- let query = "update_podcast";
159
- query += qs.stringify(params, "&");
160
- return this.request<Success>(query);
161
- }
162
-
163
- /**
164
- * This returns the episodes for a podcast that have been deleted
165
- * @param [params.offset]
166
- * @param [params.limit]
167
- * @see {@link https://ampache.org/api/api-json-methods#deleted_podcast_episodes}
168
- */
169
- deletedPodcastEpisodes(params?: {} & Pagination) {
170
- let query = "deleted_podcast_episodes";
171
- query += qs.stringify(params, "&");
172
- return this.request<DeletedPodcastEpisodesResponse>(query);
173
- }
174
- }