javascript-ampache 0.0.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.
Files changed (89) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +44 -0
  3. package/dist/albums/index.d.ts +62 -0
  4. package/dist/albums/types.d.ts +29 -0
  5. package/dist/artists/index.d.ts +64 -0
  6. package/dist/artists/types.d.ts +29 -0
  7. package/dist/auth/index.d.ts +47 -0
  8. package/dist/auth/types.d.ts +22 -0
  9. package/dist/base.d.ts +28 -0
  10. package/dist/bookmarks/index.d.ts +70 -0
  11. package/dist/bookmarks/types.d.ts +8 -0
  12. package/dist/catalogs/index.d.ts +51 -0
  13. package/dist/catalogs/types.d.ts +14 -0
  14. package/dist/genres/index.d.ts +30 -0
  15. package/dist/genres/types.d.ts +15 -0
  16. package/dist/index.d.ts +24 -0
  17. package/dist/index.js +2 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/index.m.js +2 -0
  20. package/dist/index.m.js.map +1 -0
  21. package/dist/index.modern.js +2 -0
  22. package/dist/index.modern.js.map +1 -0
  23. package/dist/index.umd.js +2 -0
  24. package/dist/index.umd.js.map +1 -0
  25. package/dist/labels/index.d.ts +32 -0
  26. package/dist/labels/types.d.ts +13 -0
  27. package/dist/licenses/index.d.ts +32 -0
  28. package/dist/licenses/types.d.ts +7 -0
  29. package/dist/live-streams/index.d.ts +32 -0
  30. package/dist/live-streams/types.d.ts +9 -0
  31. package/dist/playlists/index.d.ts +145 -0
  32. package/dist/playlists/types.d.ts +12 -0
  33. package/dist/podcasts/index.d.ts +125 -0
  34. package/dist/podcasts/types.d.ts +57 -0
  35. package/dist/preferences/index.d.ts +84 -0
  36. package/dist/preferences/types.d.ts +11 -0
  37. package/dist/shares/index.d.ts +69 -0
  38. package/dist/shares/types.d.ts +18 -0
  39. package/dist/shouts/index.d.ts +17 -0
  40. package/dist/shouts/types.d.ts +8 -0
  41. package/dist/songs/index.d.ts +140 -0
  42. package/dist/songs/types.d.ts +62 -0
  43. package/dist/system/index.d.ts +267 -0
  44. package/dist/system/types.d.ts +9 -0
  45. package/dist/users/index.d.ts +134 -0
  46. package/dist/users/types.d.ts +29 -0
  47. package/dist/utils.d.ts +2 -0
  48. package/dist/videos/index.d.ts +37 -0
  49. package/dist/videos/types.d.ts +27 -0
  50. package/package.json +40 -0
  51. package/src/albums/index.ts +80 -0
  52. package/src/albums/types.ts +31 -0
  53. package/src/artists/index.ts +82 -0
  54. package/src/artists/types.ts +31 -0
  55. package/src/auth/index.ts +91 -0
  56. package/src/auth/types.ts +22 -0
  57. package/src/base.ts +64 -0
  58. package/src/bookmarks/index.ts +94 -0
  59. package/src/bookmarks/types.ts +9 -0
  60. package/src/catalogs/index.ts +71 -0
  61. package/src/catalogs/types.ts +15 -0
  62. package/src/genres/index.ts +39 -0
  63. package/src/genres/types.ts +17 -0
  64. package/src/index.ts +26 -0
  65. package/src/labels/index.ts +42 -0
  66. package/src/labels/types.ts +14 -0
  67. package/src/licenses/index.ts +42 -0
  68. package/src/licenses/types.ts +8 -0
  69. package/src/live-streams/index.ts +42 -0
  70. package/src/live-streams/types.ts +10 -0
  71. package/src/playlists/index.ts +198 -0
  72. package/src/playlists/types.ts +13 -0
  73. package/src/podcasts/index.ts +174 -0
  74. package/src/podcasts/types.ts +60 -0
  75. package/src/preferences/index.ts +118 -0
  76. package/src/preferences/types.ts +12 -0
  77. package/src/shares/index.ts +94 -0
  78. package/src/shares/types.ts +19 -0
  79. package/src/shouts/index.ts +22 -0
  80. package/src/shouts/types.ts +9 -0
  81. package/src/songs/index.ts +191 -0
  82. package/src/songs/types.ts +64 -0
  83. package/src/system/index.ts +483 -0
  84. package/src/system/types.ts +11 -0
  85. package/src/users/index.ts +179 -0
  86. package/src/users/types.ts +32 -0
  87. package/src/utils.ts +25 -0
  88. package/src/videos/index.ts +53 -0
  89. package/src/videos/types.ts +29 -0
@@ -0,0 +1,12 @@
1
+ import { UID } from "../base";
2
+ export type Playlist = {
3
+ id: UID;
4
+ name: string;
5
+ owner: string;
6
+ items: number;
7
+ type: 'public' | 'private';
8
+ art: string;
9
+ flag: boolean;
10
+ rating: number | null;
11
+ averagerating: number | null;
12
+ };
@@ -0,0 +1,125 @@
1
+ import { Podcast, PodcastEpisode, DeletedPodcastEpisode } from './types';
2
+ import { Base, 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
+ * @see {@link https://ampache.org/api/api-json-methods#podcasts}
12
+ */
13
+ podcasts(params?: {
14
+ filter?: string;
15
+ include?: 'episodes';
16
+ } & Pagination): Promise<Podcast[] | {
17
+ podcast: Podcast[];
18
+ }>;
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<Podcast[] | {
32
+ podcast: Podcast[];
33
+ }>;
34
+ /**
35
+ * Create a podcast that can be used by anyone to stream media.
36
+ * @remarks MINIMUM_API_VERSION=420000
37
+ * @param params.url RSS url for podcast
38
+ * @param params.catalog UID of podcast catalog
39
+ * @see {@link https://ampache.org/api/api-json-methods#podcast_create}
40
+ */
41
+ podcastCreate(params: {
42
+ url: string;
43
+ catalog: UID;
44
+ }): Promise<Podcast>;
45
+ /**
46
+ * Update the description and/or expiration date for an existing podcast.
47
+ * @remarks MINIMUM_API_VERSION=420000
48
+ * @param params.filter UID to find
49
+ * @param [params.feed] RSS url for podcast
50
+ * @param [params.title] Podcast title
51
+ * @param [params.website] Source website URL
52
+ * @param [params.description] Podcast description
53
+ * @param [params.generator] Podcast generator
54
+ * @param [params.copyright] Podcast copyright
55
+ * @see {@link https://ampache.org/api/api-json-methods#podcast_edit}
56
+ */
57
+ podcastEdit(params: {
58
+ filter: UID;
59
+ feed?: string;
60
+ title?: string;
61
+ website?: string;
62
+ description?: string;
63
+ generator?: string;
64
+ copyright?: string;
65
+ }): Promise<Success>;
66
+ /**
67
+ * Delete an existing podcast
68
+ * @remarks MINIMUM_API_VERSION=420000
69
+ * @param params.filter UID of podcast to delete
70
+ * @see {@link https://ampache.org/api/api-json-methods#podcast_delete}
71
+ */
72
+ podcastDelete(params: {
73
+ filter: UID;
74
+ }): Promise<Success>;
75
+ /**
76
+ * This returns the episodes for a podcast
77
+ * @remarks MINIMUM_API_VERSION=420000
78
+ * @param params.filter UID of podcast
79
+ * @param [params.offset]
80
+ * @param [params.limit]
81
+ * @see {@link https://ampache.org/api/api-json-methods#podcast_episodes}
82
+ */
83
+ podcastEpisodes(params: {
84
+ filter: UID;
85
+ } & Pagination): Promise<PodcastEpisode[] | {
86
+ podcast_episode: PodcastEpisode[];
87
+ }>;
88
+ /**
89
+ * Get the podcast_episode from a UID
90
+ * @remarks MINIMUM_API_VERSION=420000
91
+ * @param params.filter UID of podcast
92
+ * @see {@link https://ampache.org/api/api-json-methods#podcast_episode}
93
+ */
94
+ podcastEpisode(params: {
95
+ filter: UID;
96
+ }): Promise<PodcastEpisode>;
97
+ /**
98
+ * Delete an existing podcast_episode
99
+ * @remarks MINIMUM_API_VERSION=420000
100
+ * @param params.filter UID of podcast episode to delete
101
+ * @see {@link https://ampache.org/api/api-json-methods#podcast_episode_delete}
102
+ */
103
+ podcastEpisodeDelete(params: {
104
+ filter: UID;
105
+ }): Promise<Success>;
106
+ /**
107
+ * Sync and download new podcast episodes
108
+ * ACCESS REQUIRED: 50 (Content Manager)
109
+ * @remarks MINIMUM_API_VERSION=420000
110
+ * @param params.id UID of podcast
111
+ * @see {@link https://ampache.org/api/api-json-methods#update_podcast}
112
+ */
113
+ updatePodcast(params: {
114
+ id: UID;
115
+ }): Promise<Success>;
116
+ /**
117
+ * This returns the episodes for a podcast that have been deleted
118
+ * @param [params.offset]
119
+ * @param [params.limit]
120
+ * @see {@link https://ampache.org/api/api-json-methods#deleted_podcast_episodes}
121
+ */
122
+ deletedPodcastEpisodes(params?: {} & Pagination): Promise<DeletedPodcastEpisode[] | {
123
+ deleted_podcast_episode: DeletedPodcastEpisode[];
124
+ }>;
125
+ }
@@ -0,0 +1,57 @@
1
+ import { UID } from "../base";
2
+ export type Podcast = {
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
+ flag: boolean;
16
+ rating: number | null;
17
+ averaterating: number | null;
18
+ podcast_episode: PodcastEpisode[];
19
+ };
20
+ export type PodcastEpisode = {
21
+ id: UID;
22
+ title: string;
23
+ name: string;
24
+ description: string;
25
+ category: string;
26
+ author: string;
27
+ author_full: string;
28
+ website: string;
29
+ pubdate: string;
30
+ state: 'completed' | 'pending';
31
+ filelength: string;
32
+ filesize: string;
33
+ filename: string;
34
+ mime: string;
35
+ time: number;
36
+ size: number;
37
+ public_url: string;
38
+ url: string;
39
+ catalog: UID;
40
+ art: string;
41
+ flag: boolean;
42
+ rating: number | null;
43
+ averagerating: number | null;
44
+ playcount: number;
45
+ played: string;
46
+ };
47
+ export type DeletedPodcastEpisode = {
48
+ id: UID;
49
+ addition_time: number;
50
+ delete_time: number;
51
+ title: string;
52
+ file: string;
53
+ catalog: UID;
54
+ total_count: number;
55
+ total_skip: number;
56
+ podcast: UID;
57
+ };
@@ -0,0 +1,84 @@
1
+ import { Base, BinaryBoolean, Success } from '../base';
2
+ import { Preference } 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<Preference[] | {
11
+ preference: Preference[];
12
+ }>;
13
+ /**
14
+ * Get your system preference by name
15
+ * ACCESS REQUIRED: 100 (Admin)
16
+ * @remarks MINIMUM_API_VERSION=5.0.0
17
+ * @param params.systemPreference Preference name e.g ('notify_email', 'ajax_load')
18
+ * @see {@link https://ampache.org/api/api-json-methods#system_preference}
19
+ */
20
+ systemPreference(params: {
21
+ filter: string;
22
+ }): Promise<any>;
23
+ /**
24
+ * Get your user preferences
25
+ * @remarks MINIMUM_API_VERSION=5.0.0
26
+ * @see {@link https://ampache.org/api/api-json-methods#user_preferences}
27
+ */
28
+ userPreferences(): Promise<Preference[] | {
29
+ preference: Preference[];
30
+ }>;
31
+ /**
32
+ * Get your user preference by name
33
+ * @remarks MINIMUM_API_VERSION=5.0.0
34
+ * @param params.filter Preference name e.g ('notify_email', 'ajax_load')
35
+ * @see {@link https://ampache.org/api/api-json-methods#user_preference}
36
+ */
37
+ userPreference(params: {
38
+ filter: string;
39
+ }): Promise<any>;
40
+ /**
41
+ * Add a new preference to your server
42
+ * ACCESS REQUIRED: 100 (Admin)
43
+ * @param params.filter Preference name e.g ('notify_email', 'ajax_load')
44
+ * @param params.type boolean, integer, string, special
45
+ * @param params.default string or integer default value
46
+ * @param params.category Category type
47
+ * @param [params.description]
48
+ * @param [params.subcategory]
49
+ * @param [params.level] access level required to change the value (default 100)
50
+ * @see {@link https://ampache.org/api/api-json-methods#preference_create}
51
+ */
52
+ preferenceCreate(params: {
53
+ filter: string;
54
+ type: 'boolean' | 'integer' | 'string' | 'special';
55
+ default: string | number;
56
+ category: 'interface' | 'internal' | 'options' | 'playlist' | 'plugins' | 'streaming' | 'system';
57
+ description?: string;
58
+ subcategory?: string;
59
+ level?: number;
60
+ }): Promise<Success>;
61
+ /**
62
+ * Edit a preference value and apply to all users if allowed
63
+ * ACCESS REQUIRED: 100 (Admin)
64
+ * @remarks MINIMUM_API_VERSION=5.0.0
65
+ * @param params.filter Preference name e.g ('notify_email', 'ajax_load')
66
+ * @param params.value (string/integer) Preference value
67
+ * @param [params.all] 0, 1 apply to all users
68
+ * @see {@link https://ampache.org/api/api-json-methods#preference_edit}
69
+ */
70
+ preferenceEdit(params: {
71
+ filter: string;
72
+ value: string | number;
73
+ all?: BinaryBoolean;
74
+ }): Promise<Success>;
75
+ /**
76
+ * Delete a non-system preference by name
77
+ * ACCESS REQUIRED: 100 (Admin)
78
+ * @param params.filter Preference name e.g ('notify_email', 'ajax_load')
79
+ * @see {@link https://ampache.org/api/api-json-methods#preference_delete}
80
+ */
81
+ preferenceDelete(params: {
82
+ filter: string;
83
+ }): Promise<Success>;
84
+ }
@@ -0,0 +1,11 @@
1
+ import { UID } from "../base";
2
+ export type Preference = {
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
+ };
@@ -0,0 +1,69 @@
1
+ import { Share } from './types';
2
+ import { Base, BinaryBoolean, Pagination, 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
+ * @see {@link https://ampache.org/api/api-json-methods#shares}
12
+ */
13
+ shares(params?: {
14
+ filter?: string;
15
+ exact?: BinaryBoolean;
16
+ } & Pagination): Promise<Share[] | {
17
+ share: Share[];
18
+ }>;
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<Share>;
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')
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';
40
+ description?: string;
41
+ expires?: number;
42
+ }): Promise<Share>;
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
+ }
@@ -0,0 +1,18 @@
1
+ import { UID } from "../base";
2
+ export type Share = {
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
+ };
@@ -0,0 +1,17 @@
1
+ import { Shout } 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<Shout[] | {
15
+ shout: Shout[];
16
+ }>;
17
+ }
@@ -0,0 +1,8 @@
1
+ import { UID } from "../base";
2
+ import { UserSummary } from "../users/types";
3
+ export type Shout = {
4
+ id: UID;
5
+ date: number;
6
+ text: string;
7
+ user: UserSummary;
8
+ };
@@ -0,0 +1,140 @@
1
+ import { Song, DeletedSong } from './types';
2
+ import { Base, BinaryBoolean, Pagination, Success, UID } from '../base';
3
+ export declare class Songs extends Base {
4
+ /**
5
+ * Returns songs based on the specified filter
6
+ * @remarks MINIMUM_API_VERSION=380001
7
+ * @param [params.filter] Filter results to match this string
8
+ * @param [params.exact] 0, 1 (if true filter is exact = rather than fuzzy LIKE)
9
+ * @param [params.add] ISO 8601 Date Format (2020-09-16) Find objects with an 'add' date newer than the specified date
10
+ * @param [params.update] ISO 8601 Date Format (2020-09-16) Find objects with an 'update' time newer than the specified date
11
+ * @param [params.offset]
12
+ * @param [params.limit]
13
+ * @see {@link https://ampache.org/api/api-json-methods#songs}
14
+ */
15
+ songs(params?: {
16
+ filter?: string;
17
+ exact?: BinaryBoolean;
18
+ add?: Date;
19
+ update?: Date;
20
+ } & Pagination): Promise<Song[] | {
21
+ song: Song[];
22
+ }>;
23
+ /**
24
+ * Returns a single song
25
+ * @remarks MINIMUM_API_VERSION=380001
26
+ * @param params.filter UID to find
27
+ * @see {@link https://ampache.org/api/api-json-methods#song}
28
+ */
29
+ song(params: {
30
+ filter: UID;
31
+ }): Promise<Song>;
32
+ /**
33
+ * Songs of the specified artist
34
+ * @remarks MINIMUM_API_VERSION=380001
35
+ * @param params.filter UID to find
36
+ * @param [params.top50] 0, 1 (if true filter to the artist top 50)
37
+ * @param [params.offset]
38
+ * @param [params.limit]
39
+ * @see {@link https://ampache.org/api/api-json-methods#artist_songs}
40
+ */
41
+ artistSongs(params: {
42
+ filter: UID;
43
+ top50?: BinaryBoolean;
44
+ } & Pagination): Promise<Song[] | {
45
+ song: Song[];
46
+ }>;
47
+ /**
48
+ * Songs of the specified album
49
+ * @remarks MINIMUM_API_VERSION=380001
50
+ * @param params.filter UID to find
51
+ * @param [params.offset]
52
+ * @param [params.limit]
53
+ * @see {@link https://ampache.org/api/api-json-methods#album_songs}
54
+ */
55
+ albumSongs(params: {
56
+ filter: UID;
57
+ } & Pagination): Promise<Song[] | {
58
+ song: Song[];
59
+ }>;
60
+ /**
61
+ * Songs of the specified genre
62
+ * @remarks MINIMUM_API_VERSION=380001
63
+ * @param params.filter UID to find
64
+ * @param [params.offset]
65
+ * @param [params.limit]
66
+ * @see {@link https://ampache.org/api/api-json-methods#genre_songs}
67
+ */
68
+ genreSongs(params: {
69
+ filter: UID;
70
+ } & Pagination): Promise<Song[] | {
71
+ song: Song[];
72
+ }>;
73
+ /**
74
+ * This returns the songs for a playlist
75
+ * @remarks MINIMUM_API_VERSION=380001
76
+ * @param params.filter UID to find
77
+ * @param [params.offset]
78
+ * @param [params.limit]
79
+ * @see {@link https://ampache.org/api/api-json-methods#playlist_songs}
80
+ */
81
+ playlistSongs(params: {
82
+ filter: UID;
83
+ } & Pagination): Promise<Song[] | {
84
+ song: Song[];
85
+ }>;
86
+ /**
87
+ * This returns the songs for a license
88
+ * @remarks MINIMUM_API_VERSION=420000
89
+ * @param params.filter UID to find
90
+ * @param [params.offset]
91
+ * @param [params.limit]
92
+ * @see {@link https://ampache.org/api/api-json-methods#license_songs}
93
+ */
94
+ licenseSongs(params: {
95
+ filter: UID;
96
+ } & Pagination): Promise<Song[] | {
97
+ song: Song[];
98
+ }>;
99
+ /**
100
+ * Delete an existing song. (if you are allowed to)
101
+ * @remarks MINIMUM_API_VERSION=5.0.0
102
+ * @param params.filter UID of song to delete
103
+ * @see {@link https://ampache.org/api/api-json-methods#song_delete}
104
+ */
105
+ songDelete(params: {
106
+ filter: UID;
107
+ }): Promise<Success>;
108
+ /**
109
+ * This takes a URL and returns the song object in question
110
+ * @remarks MINIMUM_API_VERSION=380001
111
+ * @param params.url Full Ampache URL from server
112
+ * @see {@link https://ampache.org/api/api-json-methods#url_to_song}
113
+ */
114
+ urlToSong(params: {
115
+ url: string;
116
+ }): Promise<Song>;
117
+ /**
118
+ * This searches the songs and returns... songs
119
+ * @remarks MINIMUM_API_VERSION=380001
120
+ * @param params.filter Filter results to match this string
121
+ * @param [params.offset]
122
+ * @param [params.limit]
123
+ * @see {@link https://ampache.org/api/api-json-methods#search_songs}
124
+ */
125
+ searchSongs(params: {
126
+ filter: string;
127
+ } & Pagination): Promise<Song[] | {
128
+ song: Song[];
129
+ }>;
130
+ /**
131
+ * Returns songs that have been deleted from the server
132
+ * @remarks MINIMUM_API_VERSION=500000
133
+ * @param [params.offset]
134
+ * @param [params.limit]
135
+ * @see {@link https://ampache.org/api/api-json-methods#deleted_songs}
136
+ */
137
+ deletedSongs(params?: {} & Pagination): Promise<DeletedSong[] | {
138
+ deleted_song: DeletedSong[];
139
+ }>;
140
+ }
@@ -0,0 +1,62 @@
1
+ import { ArtistSummary } from "../artists/types";
2
+ import { GenreSummary } from "../genres/types";
3
+ import { UID } from "../base";
4
+ import { AlbumSummary } from "../albums/types";
5
+ export type Song = {
6
+ id: UID;
7
+ title: string;
8
+ name: string;
9
+ artist: ArtistSummary;
10
+ album: AlbumSummary;
11
+ albumartist: ArtistSummary;
12
+ disk: number;
13
+ track: number;
14
+ filename: string;
15
+ genre: GenreSummary[];
16
+ playlisttrack: number;
17
+ time: number;
18
+ year: number | string;
19
+ format: string;
20
+ stream_format: string;
21
+ rate: number;
22
+ mode: string;
23
+ mime: string;
24
+ stream_mime: string;
25
+ url: string;
26
+ size: number;
27
+ mbid: string | null;
28
+ album_mbid: string | null;
29
+ artist_mbid: string | null;
30
+ art: string;
31
+ flag: boolean;
32
+ rating: number | null;
33
+ averagerating: number | null;
34
+ playcount: number;
35
+ catalog: number;
36
+ composer: string;
37
+ channels: number | null;
38
+ comment: string;
39
+ license: string | null;
40
+ publisher: string;
41
+ language: string;
42
+ lyrics: string;
43
+ replaygain_album_gain: number | null;
44
+ replaygain_album_peak: number | null;
45
+ replaygain_track_gain: number | null;
46
+ replaygain_track_peak: number | null;
47
+ r128_album_gain: number | null;
48
+ r128_track_gain: number | null;
49
+ };
50
+ export type DeletedSong = {
51
+ id: UID;
52
+ addition_time: number;
53
+ delete_time: number;
54
+ update_time: number;
55
+ title: string;
56
+ file: string;
57
+ catalog: UID;
58
+ total_count: number;
59
+ total_skip: number;
60
+ album: UID;
61
+ artist: UID;
62
+ };