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,204 +0,0 @@
1
- import { HashResponse, PlaylistResponse, PlaylistsResponse } from "./types";
2
- import { SongsResponse } from "../songs/types";
3
- import { Base, BinaryBoolean, ExtendedPagination, Pagination, Success, UID } from "../base";
4
- export declare class Playlists extends Base {
5
- /**
6
- * This returns playlists based on the specified filter
7
- * @remarks MINIMUM_API_VERSION=380001
8
- * @param [params.filter] Filter results to match this string
9
- * @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
10
- * @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
11
- * @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
12
- * @param [params.hide_search] 0, 1 (if true do not include searches/smartlists in the result)
13
- * @param [params.show_dupes] 0, 1 (if true ignore 'api_hide_dupe_searches' setting)
14
- * @param [params.include] 0, 1 (if true include the objects in the playlist)
15
- * @param [params.offset]
16
- * @param [params.limit]
17
- * @param [params.cond]
18
- * @param [params.sort]
19
- * @see {@link https://ampache.org/api/api-json-methods#playlists}
20
- */
21
- playlists(params?: {
22
- filter?: string;
23
- exact?: BinaryBoolean;
24
- add?: Date;
25
- update?: Date;
26
- hide_search?: BinaryBoolean;
27
- show_dupes?: BinaryBoolean;
28
- include?: BinaryBoolean;
29
- } & ExtendedPagination): Promise<PlaylistsResponse>;
30
- /**
31
- * This returns smartlists based on the specified filter. NOTE: Filtered from Playlists() so pagination is invalid.
32
- * @remarks MINIMUM_API_VERSION=380001
33
- * @param [params.filter] Filter results to match this string
34
- * @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
35
- * @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
36
- * @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
37
- * @param [params.show_dupes] 0, 1 (if true ignore 'api_hide_dupe_searches' setting)
38
- * @see {@link https://ampache.org/api/api-json-methods#playlists}
39
- */
40
- smartlists(params?: {
41
- filter?: string;
42
- exact?: BinaryBoolean;
43
- add?: Date;
44
- update?: Date;
45
- show_dupes?: BinaryBoolean;
46
- }): Promise<PlaylistsResponse>;
47
- /**
48
- * This returns a single playlist
49
- * @remarks MINIMUM_API_VERSION=380001
50
- * @param params.filter UID to find
51
- * @see {@link https://ampache.org/api/api-json-methods#playlist}
52
- */
53
- playlist(params: {
54
- filter: UID;
55
- }): Promise<PlaylistResponse>;
56
- /**
57
- * This returns a user's playlists based on the specified filter
58
- * @remarks MINIMUM_API_VERSION=6.3.0
59
- * @param [params.filter] Filter results to match this string
60
- * @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
61
- * @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
62
- * @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
63
- * @param [params.offset]
64
- * @param [params.limit]
65
- * @param [params.cond]
66
- * @param [params.sort]
67
- * @see {@link https://ampache.org/api/api-json-methods#user_playlists}
68
- */
69
- userPlaylists(params?: {
70
- filter?: string;
71
- exact?: BinaryBoolean;
72
- add?: Date;
73
- update?: Date;
74
- } & ExtendedPagination): Promise<PlaylistsResponse>;
75
- /**
76
- * This returns a user's smartlists based on the specified filter
77
- * @remarks MINIMUM_API_VERSION=6.3.0
78
- * @param [params.filter] Filter results to match this string
79
- * @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
80
- * @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
81
- * @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
82
- * @param [params.offset]
83
- * @param [params.limit]
84
- * @param [params.cond]
85
- * @param [params.sort]
86
- * @see {@link https://ampache.org/api/api-json-methods#user_smartlists}
87
- */
88
- userSmartlists(params?: {
89
- filter?: string;
90
- exact?: BinaryBoolean;
91
- add?: Date;
92
- update?: Date;
93
- } & ExtendedPagination): Promise<PlaylistsResponse>;
94
- /**
95
- * This creates a new playlist and returns it
96
- * @remarks MINIMUM_API_VERSION=380001
97
- * @param params.name Playlist name
98
- * @param [params.type] public, private (Playlist type)
99
- * @see {@link https://ampache.org/api/api-json-methods#playlist_create}
100
- */
101
- playlistCreate(params: {
102
- name: string;
103
- type?: "public" | "private";
104
- }): Promise<PlaylistResponse>;
105
- /**
106
- * This adds an item to a playlist
107
- * @remarks MINIMUM_API_VERSION=6.3.0
108
- * @param params.filter UID of Playlist
109
- * @param params.id UID of the object to add to playlist
110
- * @param params.type 'song', 'album', 'artist', 'playlist'
111
- * @see {@link https://ampache.org/api/api-json-methods#playlist_add}
112
- */
113
- playlistAdd(params: {
114
- filter: UID;
115
- id: UID;
116
- type: "song" | "album" | "artist" | "playlist";
117
- }): Promise<Success>;
118
- /**
119
- * This modifies name and type of the playlist.
120
- * NOTE items and tracks must be sent together and be of equal length.
121
- * @remarks MINIMUM_API_VERSION=400001
122
- * @param params.filter UID to find
123
- * @param [params.name] Playlist name
124
- * @param [params.type] public, private (Playlist type)
125
- * @param [params.owner] Change playlist owner to the user id (-1 = System playlist)
126
- * @param [params.items] comma-separated song_id's (replaces existing items with a new id)
127
- * @param [params.tracks] comma-separated playlisttrack numbers matched to 'items' in order
128
- * @see {@link https://ampache.org/api/api-json-methods#playlist_edit}
129
- */
130
- playlistEdit(params: {
131
- filter: UID;
132
- name?: string;
133
- type?: "public" | "private";
134
- owner?: string;
135
- items?: string;
136
- tracks?: string;
137
- }): Promise<Success>;
138
- /**
139
- * This deletes a playlist
140
- * @remarks MINIMUM_API_VERSION=380001
141
- * @param params.filter UID of playlist to delete
142
- * @see {@link https://ampache.org/api/api-json-methods#playlist_delete}
143
- */
144
- playlistDelete(params: {
145
- filter: UID;
146
- }): Promise<Success>;
147
- /**
148
- * This adds a song to a playlist
149
- * @remarks MINIMUM_API_VERSION=380001; CHANGED_IN_API_VERSION=400003
150
- * @param params.filter UID of Playlist
151
- * @param params.song UID of song to add to playlist
152
- * @param [params.check] 0, 1 Whether to check and ignore duplicates (default = 0)
153
- * @see {@link https://ampache.org/api/api-json-methods#playlist_add_song}
154
- * @deprecated Being removed in 7.0.0. Use `playlist_add` instead.
155
- */
156
- playlistAddSong(params: {
157
- filter: UID;
158
- song: UID;
159
- check?: BinaryBoolean;
160
- }): Promise<Success>;
161
- /**
162
- * This remove a song from a playlist
163
- * @remarks MINIMUM_API_VERSION=380001; CHANGED_IN_API_VERSION=400001
164
- * @param params.filter UID of Playlist
165
- * @param [params.song] UID of song to remove from playlist
166
- * @param [params.track] Track number to remove from playlist
167
- * @see {@link https://ampache.org/api/api-json-methods#playlist_remove_song}
168
- */
169
- playlistRemoveSong(params: {
170
- filter: UID;
171
- song?: UID;
172
- track?: number;
173
- }): Promise<Success>;
174
- /**
175
- * Get a list of song JSON, indexes or id's based on some simple search criteria
176
- * @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
177
- * @param [params.mode] (default = 'random')
178
- * @param [params.filter] string LIKE matched to song title
179
- * @param [params.album] UID of album
180
- * @param [params.artist] UID of artist
181
- * @param [params.flag] 0, 1 (get flagged songs only. default = 0)
182
- * @param [params.format] song, index, id (default = 'song')
183
- * @param [params.offset]
184
- * @param [params.limit]
185
- * @see {@link https://ampache.org/api/api-json-methods#playlist_generate}
186
- */
187
- playlistGenerate(params?: {
188
- mode?: "recent" | "forgotten" | "unplayed" | "random";
189
- filter?: string;
190
- album?: number;
191
- artist?: number;
192
- flag?: BinaryBoolean;
193
- format?: "song" | "index" | "id";
194
- } & Pagination): Promise<SongsResponse>;
195
- /**
196
- * This returns the md5 hash for the songs in a playlist
197
- * @remarks MINIMUM_API_VERSION=6.6.0
198
- * @param params.filter string UID of Playlist
199
- * @see {@link https://ampache.org/api/api-json-methods#playlist_hash}
200
- */
201
- playlistHash(params: {
202
- filter: UID;
203
- }): Promise<HashResponse>;
204
- }
@@ -1,26 +0,0 @@
1
- import { UID } from "../base";
2
- import { UserSummary } from "../users/types";
3
- export type PlaylistResponse = {
4
- id: UID;
5
- name: string;
6
- owner: string;
7
- items: number;
8
- type: "public" | "private";
9
- art: string;
10
- has_art: boolean;
11
- flag: boolean;
12
- rating: number | null;
13
- averagerating: number | null;
14
- user: UserSummary;
15
- has_access: boolean;
16
- has_collaborate: boolean;
17
- last_update: number;
18
- };
19
- export type PlaylistsResponse = {
20
- total_count: number;
21
- md5: string;
22
- playlist: PlaylistResponse[];
23
- };
24
- export type HashResponse = {
25
- md5: string;
26
- };
@@ -1,121 +0,0 @@
1
- import { PodcastResponse, PodcastsResponse, PodcastEpisodeResponse, PodcastEpisodesResponse, DeletedPodcastEpisodesResponse } from "./types";
2
- import { Base, ExtendedPagination, Pagination, Success, UID } from "../base";
3
- export declare class Podcasts extends Base {
4
- /**
5
- * Get information about podcasts
6
- * @remarks MINIMUM_API_VERSION=420000
7
- * @param [params.filter] Value is Alpha Match for returned results, may be more than one letter/number
8
- * @param [params.include] episodes (include podcast_episodes in the response)
9
- * @param [params.offset]
10
- * @param [params.limit]
11
- * @param [params.cond]
12
- * @param [params.sort]
13
- * @see {@link https://ampache.org/api/api-json-methods#podcasts}
14
- */
15
- podcasts(params?: {
16
- filter?: string;
17
- include?: "episodes";
18
- } & ExtendedPagination): Promise<PodcastsResponse>;
19
- /**
20
- * Get information about podcasts
21
- * @remarks MINIMUM_API_VERSION=420000
22
- * @param params.filter UID to find
23
- * @param [params.include] episodes (include podcast_episodes in the response)
24
- * @param [params.offset]
25
- * @param [params.limit]
26
- * @see {@link https://ampache.org/api/api-json-methods#podcast}
27
- */
28
- podcast(params?: {
29
- filter: UID;
30
- include?: "episodes";
31
- } & Pagination): Promise<PodcastResponse>;
32
- /**
33
- * Create a podcast that can be used by anyone to stream media.
34
- * @remarks MINIMUM_API_VERSION=420000
35
- * @param params.url RSS url for podcast
36
- * @param params.catalog UID of podcast catalog
37
- * @see {@link https://ampache.org/api/api-json-methods#podcast_create}
38
- */
39
- podcastCreate(params: {
40
- url: string;
41
- catalog: UID;
42
- }): Promise<PodcastResponse>;
43
- /**
44
- * Update the description and/or expiration date for an existing podcast.
45
- * @remarks MINIMUM_API_VERSION=420000
46
- * @param params.filter UID to find
47
- * @param [params.feed] RSS url for podcast
48
- * @param [params.title] Podcast title
49
- * @param [params.website] Source website URL
50
- * @param [params.description] Podcast description
51
- * @param [params.generator] Podcast generator
52
- * @param [params.copyright] Podcast copyright
53
- * @see {@link https://ampache.org/api/api-json-methods#podcast_edit}
54
- */
55
- podcastEdit(params: {
56
- filter: UID;
57
- feed?: string;
58
- title?: string;
59
- website?: string;
60
- description?: string;
61
- generator?: string;
62
- copyright?: string;
63
- }): Promise<Success>;
64
- /**
65
- * Delete an existing podcast
66
- * @remarks MINIMUM_API_VERSION=420000
67
- * @param params.filter UID of podcast to delete
68
- * @see {@link https://ampache.org/api/api-json-methods#podcast_delete}
69
- */
70
- podcastDelete(params: {
71
- filter: UID;
72
- }): Promise<Success>;
73
- /**
74
- * This returns the episodes for a podcast
75
- * @remarks MINIMUM_API_VERSION=420000
76
- * @param params.filter UID of podcast
77
- * @param [params.offset]
78
- * @param [params.limit]
79
- * @param [params.cond]
80
- * @param [params.sort]
81
- * @see {@link https://ampache.org/api/api-json-methods#podcast_episodes}
82
- */
83
- podcastEpisodes(params: {
84
- filter: UID;
85
- } & ExtendedPagination): Promise<PodcastEpisodesResponse>;
86
- /**
87
- * Get the podcast_episode from a UID
88
- * @remarks MINIMUM_API_VERSION=420000
89
- * @param params.filter UID of podcast
90
- * @see {@link https://ampache.org/api/api-json-methods#podcast_episode}
91
- */
92
- podcastEpisode(params: {
93
- filter: UID;
94
- }): Promise<PodcastEpisodeResponse>;
95
- /**
96
- * Delete an existing podcast_episode
97
- * @remarks MINIMUM_API_VERSION=420000
98
- * @param params.filter UID of podcast episode to delete
99
- * @see {@link https://ampache.org/api/api-json-methods#podcast_episode_delete}
100
- */
101
- podcastEpisodeDelete(params: {
102
- filter: UID;
103
- }): Promise<Success>;
104
- /**
105
- * Sync and download new podcast episodes
106
- * ACCESS REQUIRED: 50 (Content Manager)
107
- * @remarks MINIMUM_API_VERSION=420000
108
- * @param params.id UID of podcast
109
- * @see {@link https://ampache.org/api/api-json-methods#update_podcast}
110
- */
111
- updatePodcast(params: {
112
- id: UID;
113
- }): Promise<Success>;
114
- /**
115
- * This returns the episodes for a podcast that have been deleted
116
- * @param [params.offset]
117
- * @param [params.limit]
118
- * @see {@link https://ampache.org/api/api-json-methods#deleted_podcast_episodes}
119
- */
120
- deletedPodcastEpisodes(params?: {} & Pagination): Promise<DeletedPodcastEpisodesResponse>;
121
- }
@@ -1,79 +0,0 @@
1
- import { UID } from "../base";
2
- export type PodcastResponse = {
3
- id: UID;
4
- name: string;
5
- description: string;
6
- language: string;
7
- copyright: string;
8
- feed_url: string;
9
- generator: string;
10
- website: string;
11
- build_date: string;
12
- sync_date: string;
13
- public_url: string;
14
- art: string;
15
- has_art: boolean;
16
- flag: boolean;
17
- rating: number | null;
18
- averaterating: number | null;
19
- podcast_episode: PodcastEpisodeResponse[];
20
- };
21
- export type PodcastsResponse = {
22
- total_count: number;
23
- md5: string;
24
- podcast: PodcastResponse[];
25
- };
26
- export type PodcastEpisodeResponse = {
27
- id: UID;
28
- title: string;
29
- name: string;
30
- description: string;
31
- category: string;
32
- author: string;
33
- author_full: string;
34
- website: string;
35
- pubdate: string;
36
- state: "completed" | "pending";
37
- filelength: string;
38
- filesize: string;
39
- filename: string;
40
- mime: string;
41
- time: number;
42
- size: number;
43
- bitrate: number;
44
- stream_bitrate: number;
45
- rate: number;
46
- mode: number | null;
47
- channels: number | null;
48
- public_url: string;
49
- url: string;
50
- catalog: UID;
51
- art: string;
52
- has_art: boolean;
53
- flag: boolean;
54
- rating: number | null;
55
- averagerating: number | null;
56
- playcount: number;
57
- played: number;
58
- };
59
- export type PodcastEpisodesResponse = {
60
- total_count: number;
61
- md5: string;
62
- podcast_episode: PodcastEpisodeResponse[];
63
- };
64
- export type DeletedPodcastEpisodeResponse = {
65
- id: UID;
66
- addition_time: number;
67
- delete_time: number;
68
- title: string;
69
- file: string;
70
- catalog: UID;
71
- total_count: number;
72
- total_skip: number;
73
- podcast: UID;
74
- };
75
- export type DeletedPodcastEpisodesResponse = {
76
- total_count: number;
77
- md5: string;
78
- deleted_podcast_episode: DeletedPodcastEpisodeResponse[];
79
- };
@@ -1,80 +0,0 @@
1
- import { Base, BinaryBoolean, Success } from "../base";
2
- import { PreferenceResponse, PreferencesResponse } from "./types";
3
- export declare class Preferences extends Base {
4
- /**
5
- * Get your server preferences
6
- * ACCESS REQUIRED: 100 (Admin)
7
- * @remarks MINIMUM_API_VERSION=5.0.0
8
- * @see {@link https://ampache.org/api/api-json-methods#system_preferences}
9
- */
10
- systemPreferences(): Promise<PreferencesResponse>;
11
- /**
12
- * Get your system preference by name
13
- * ACCESS REQUIRED: 100 (Admin)
14
- * @remarks MINIMUM_API_VERSION=5.0.0
15
- * @param params.systemPreference Preference name e.g ('notify_email', 'ajax_load')
16
- * @see {@link https://ampache.org/api/api-json-methods#system_preference}
17
- */
18
- systemPreference(params: {
19
- filter: string;
20
- }): Promise<PreferenceResponse>;
21
- /**
22
- * Get your user preferences
23
- * @remarks MINIMUM_API_VERSION=5.0.0
24
- * @see {@link https://ampache.org/api/api-json-methods#user_preferences}
25
- */
26
- userPreferences(): Promise<PreferencesResponse>;
27
- /**
28
- * Get your user preference by name
29
- * @remarks MINIMUM_API_VERSION=5.0.0
30
- * @param params.filter Preference name e.g ('notify_email', 'ajax_load')
31
- * @see {@link https://ampache.org/api/api-json-methods#user_preference}
32
- */
33
- userPreference(params: {
34
- filter: string;
35
- }): Promise<PreferenceResponse>;
36
- /**
37
- * Add a new preference to your server
38
- * ACCESS REQUIRED: 100 (Admin)
39
- * @param params.filter Preference name e.g ('notify_email', 'ajax_load')
40
- * @param params.type boolean, integer, string, special
41
- * @param params.default string or integer default value
42
- * @param params.category Category type
43
- * @param [params.description]
44
- * @param [params.subcategory]
45
- * @param [params.level] access level required to change the value (default 100)
46
- * @see {@link https://ampache.org/api/api-json-methods#preference_create}
47
- */
48
- preferenceCreate(params: {
49
- filter: string;
50
- type: "boolean" | "integer" | "string" | "special";
51
- default: string | number;
52
- category: "interface" | "internal" | "options" | "playlist" | "plugins" | "streaming";
53
- description?: string;
54
- subcategory?: string;
55
- level?: number;
56
- }): Promise<Success>;
57
- /**
58
- * Edit a preference value and apply to all users if allowed
59
- * ACCESS REQUIRED: 100 (Admin)
60
- * @remarks MINIMUM_API_VERSION=5.0.0
61
- * @param params.filter Preference name e.g ('notify_email', 'ajax_load')
62
- * @param params.value (string/integer) Preference value
63
- * @param [params.all] 0, 1 apply to all users
64
- * @see {@link https://ampache.org/api/api-json-methods#preference_edit}
65
- */
66
- preferenceEdit(params: {
67
- filter: string;
68
- value: string | number;
69
- all?: BinaryBoolean;
70
- }): Promise<Success>;
71
- /**
72
- * Delete a non-system preference by name
73
- * ACCESS REQUIRED: 100 (Admin)
74
- * @param params.filter Preference name e.g ('notify_email', 'ajax_load')
75
- * @see {@link https://ampache.org/api/api-json-methods#preference_delete}
76
- */
77
- preferenceDelete(params: {
78
- filter: string;
79
- }): Promise<Success>;
80
- }
@@ -1,18 +0,0 @@
1
- import { UID } from "../base";
2
- export type PreferenceResponse = {
3
- id: UID;
4
- name: string;
5
- level: string;
6
- description: string;
7
- value: string;
8
- type: string;
9
- category: string;
10
- subcategory: string | null;
11
- has_access: boolean;
12
- values?: string;
13
- };
14
- export type PreferencesResponse = {
15
- total_count: number;
16
- md5: string;
17
- preference: PreferenceResponse[];
18
- };
@@ -1,69 +0,0 @@
1
- import { ShareResponse, SharesResponse } from "./types";
2
- import { Base, BinaryBoolean, ExtendedPagination, Success, UID } from "../base";
3
- export declare class Shares extends Base {
4
- /**
5
- * This searches the shares and returns... shares
6
- * @remarks MINIMUM_API_VERSION=420000
7
- * @param [params.filter] UID to find
8
- * @param [params.exact] 0, 1 boolean to match the exact filter string
9
- * @param [params.offset]
10
- * @param [params.limit]
11
- * @param [params.cond]
12
- * @param [params.sort]
13
- * @see {@link https://ampache.org/api/api-json-methods#shares}
14
- */
15
- shares(params?: {
16
- filter?: string;
17
- exact?: BinaryBoolean;
18
- } & ExtendedPagination): Promise<SharesResponse>;
19
- /**
20
- * Return a share from UID
21
- * @remarks MINIMUM_API_VERSION=420000
22
- * @param params.filter UID to find
23
- * @see {@link https://ampache.org/api/api-json-methods#share}
24
- */
25
- share(params: {
26
- filter: UID;
27
- }): Promise<ShareResponse>;
28
- /**
29
- * Create a public url that can be used by anyone to stream media.
30
- * @remarks MINIMUM_API_VERSION=420000
31
- * @param params.filter UID of object you are sharing
32
- * @param params.type ('song', 'album', 'artist', 'playlist', 'podcast', 'podcast_episode', 'video')
33
- * @param [params.description] description (will be filled for you if empty)
34
- * @param [params.expires] days to keep active
35
- * @see {@link https://ampache.org/api/api-json-methods#share_create}
36
- */
37
- shareCreate(params: {
38
- filter: UID;
39
- type: "song" | "album" | "artist" | "playlist" | "podcast" | "podcast_episode" | "video";
40
- description?: string;
41
- expires?: number;
42
- }): Promise<ShareResponse>;
43
- /**
44
- * Update the description and/or expiration date for an existing share
45
- * @remarks MINIMUM_API_VERSION=420000
46
- * @param params.filter UID to find
47
- * @param [params.stream] 0, 1
48
- * @param [params.download] 0, 1
49
- * @param [params.expires] days to keep active
50
- * @param [params.description] description
51
- * @see {@link https://ampache.org/api/api-json-methods#share_edit}
52
- */
53
- shareEdit(params: {
54
- filter: UID;
55
- stream?: BinaryBoolean;
56
- download?: BinaryBoolean;
57
- expires?: number;
58
- description?: string;
59
- }): Promise<Success>;
60
- /**
61
- * Delete an existing share.
62
- * @remarks MINIMUM_API_VERSION=420000
63
- * @param params.filter UID of share to delete
64
- * @see {@link https://ampache.org/api/api-json-methods#share_delete}
65
- */
66
- shareDelete(params: {
67
- filter: UID;
68
- }): Promise<Success>;
69
- }
@@ -1,23 +0,0 @@
1
- import { UID } from "../base";
2
- export type ShareResponse = {
3
- id: UID;
4
- name: string;
5
- owner: string;
6
- allow_stream: boolean;
7
- allow_download: boolean;
8
- creation_date: number;
9
- lastvisit_date: number;
10
- object_type: string;
11
- object_id: UID;
12
- expire_days: number;
13
- max_counter: number;
14
- counter: number;
15
- secret: string;
16
- public_url: string;
17
- description: string;
18
- };
19
- export type SharesResponse = {
20
- total_count: number;
21
- md5: string;
22
- share: ShareResponse[];
23
- };
@@ -1,17 +0,0 @@
1
- import { ShoutResponse } from "./types";
2
- import { Base } from "../base";
3
- export declare class Shouts extends Base {
4
- /**
5
- * This gets the latest posted shouts
6
- * @remarks MINIMUM_API_VERSION=380001
7
- * @param [params.username] Username to find
8
- * @param [params.limit] Maximum number of results to return
9
- * @see {@link https://ampache.org/api/api-json-methods#last_shouts}
10
- */
11
- last_shouts(params?: {
12
- username?: string;
13
- limit?: number;
14
- }): Promise<{
15
- shout: ShoutResponse[];
16
- }>;
17
- }
@@ -1,10 +0,0 @@
1
- import { UID } from "../base";
2
- import { UserSummary } from "../users/types";
3
- export type ShoutResponse = {
4
- id: UID;
5
- date: number;
6
- text: string;
7
- user: UserSummary;
8
- object_type: "song" | "album" | "artist" | "playlist";
9
- object_id: UID;
10
- };