radiobrowser-api-client 0.1.4 → 0.1.6
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/.github/workflows/codeql.yml +0 -2
- package/.github/workflows/eslint.yml +0 -2
- package/.github/workflows/tests.yml +0 -2
- package/dist/client.d.ts +29 -29
- package/dist/client.js +31 -31
- package/package.json +1 -1
- package/src/client.ts +31 -31
- package/tests/test.ts +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -22,13 +22,13 @@ export declare class RadioBrowserClient {
|
|
|
22
22
|
/**
|
|
23
23
|
* Fetches the list of available servers from the Radio Browser API.
|
|
24
24
|
* @param outputFormat - The output format for the list of servers (default is JSON)
|
|
25
|
-
* @see {@link https://
|
|
25
|
+
* @see {@link https://all.api.radio-browser.info/#Server_mirrors} for more information on the API endpoint
|
|
26
26
|
* @returns A promise that resolves to the list of servers
|
|
27
27
|
*/
|
|
28
28
|
fetchServers(outputFormat?: StationsListOutputFormat): Promise<string>;
|
|
29
29
|
/**
|
|
30
30
|
* Fetches and parses the list of available servers from the Radio Browser API.
|
|
31
|
-
* @see {@link https://
|
|
31
|
+
* @see {@link https://all.api.radio-browser.info/#Server_mirrors} for more information on the API endpoint
|
|
32
32
|
* @returns A promise that resolves to the list of servers
|
|
33
33
|
*/
|
|
34
34
|
getServers(): Promise<Server[]>;
|
|
@@ -41,7 +41,7 @@ export declare class RadioBrowserClient {
|
|
|
41
41
|
* Fetches stations from the Radio Browser API.
|
|
42
42
|
* @param params - The search parameters
|
|
43
43
|
* @param outputFormat - The output format for the list of stations (default is JSON)
|
|
44
|
-
* @see {@link https://
|
|
44
|
+
* @see {@link https://all.api.radio-browser.info/#Advanced_station_search} for more information on the API endpoint
|
|
45
45
|
* @returns A promise that resolves to the list of stations
|
|
46
46
|
*/
|
|
47
47
|
fetchStations(params: ISearchStation, outputFormat?: StationsListOutputFormat): Promise<string>;
|
|
@@ -55,7 +55,7 @@ export declare class RadioBrowserClient {
|
|
|
55
55
|
* Fetches stations from the Radio Browser API by given UUIDs.
|
|
56
56
|
* @param params - The search parameters
|
|
57
57
|
* @param outputFormat - The output format for the list of stations (default is JSON)
|
|
58
|
-
* @see {@link https://
|
|
58
|
+
* @see {@link https://all.api.radio-browser.info/#Search_radio_stations_by_uuid} for more information on the API endpoint
|
|
59
59
|
* @returns A promise that resolves to the list of stations by given UUIDs
|
|
60
60
|
*/
|
|
61
61
|
fetchStationsByUUIDs(params: {
|
|
@@ -64,7 +64,7 @@ export declare class RadioBrowserClient {
|
|
|
64
64
|
/**
|
|
65
65
|
* Fetches and parses stations from the Radio Browser API by given UUIDs.
|
|
66
66
|
* @param params - The search parameters
|
|
67
|
-
* @see {@link https://
|
|
67
|
+
* @see {@link https://all.api.radio-browser.info/#Search_radio_stations_by_uuid} for more information on the API endpoint
|
|
68
68
|
* @returns A promise that resolves to the list of stations by given UUIDs
|
|
69
69
|
*/
|
|
70
70
|
getStationsByUUIDs(params: {
|
|
@@ -75,7 +75,7 @@ export declare class RadioBrowserClient {
|
|
|
75
75
|
* @param params - The search parameters
|
|
76
76
|
* @param query - The search query
|
|
77
77
|
* @param outputFormat - The output format for the list of countires (default is JSON)
|
|
78
|
-
* @see {@link https://
|
|
78
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_countries} for more information on the API endpoint
|
|
79
79
|
* @returns A promise that resolves to the list of countires
|
|
80
80
|
*/
|
|
81
81
|
fetchCountries(params: ICountries, query?: string, outputFormat?: ListOutputFormat): Promise<string>;
|
|
@@ -83,7 +83,7 @@ export declare class RadioBrowserClient {
|
|
|
83
83
|
* Fetches and parses list of countries from the Radio Browser API.
|
|
84
84
|
* @param params - The search parameters
|
|
85
85
|
* @param query - The search query
|
|
86
|
-
* @see {@link https://
|
|
86
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_countries} for more information on the API endpoint
|
|
87
87
|
* @returns A promise that resolves to the list of countires
|
|
88
88
|
*/
|
|
89
89
|
getCountries(params: ICountries, query?: string): Promise<Country[]>;
|
|
@@ -92,7 +92,7 @@ export declare class RadioBrowserClient {
|
|
|
92
92
|
* @param params - The search parameters
|
|
93
93
|
* @param query - The search query
|
|
94
94
|
* @param outputFormat - The output format for the list of codecs (default is JSON)
|
|
95
|
-
* @see {@link https://
|
|
95
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_codecs} for more information on the API endpoint
|
|
96
96
|
* @returns A promise that resolves to the list of codecs
|
|
97
97
|
*/
|
|
98
98
|
fetchCodecs(params: ICodecs, query?: string, outputFormat?: ListOutputFormat): Promise<string>;
|
|
@@ -100,7 +100,7 @@ export declare class RadioBrowserClient {
|
|
|
100
100
|
* Fetches and parses codecs from the Radio Browser API.
|
|
101
101
|
* @param params - The search parameters
|
|
102
102
|
* @param query - The search query
|
|
103
|
-
* @see {@link https://
|
|
103
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_codecs} for more information on the API endpoint
|
|
104
104
|
* @returns A promise that resolves to the list of codecs
|
|
105
105
|
*/
|
|
106
106
|
getCodecs(params: ICodecs, query?: string): Promise<Codec[]>;
|
|
@@ -109,7 +109,7 @@ export declare class RadioBrowserClient {
|
|
|
109
109
|
* @param params - The search parameters
|
|
110
110
|
* @param query - The search query
|
|
111
111
|
* @param outputFormat - The output format for the list of states (default is JSON)
|
|
112
|
-
* @see {@link https://
|
|
112
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_states} for more information on the API endpoint
|
|
113
113
|
* @returns A promise that resolves to the list of states
|
|
114
114
|
*/
|
|
115
115
|
fetchStates(params: IStates, query?: string, outputFormat?: ListOutputFormat): Promise<string>;
|
|
@@ -117,7 +117,7 @@ export declare class RadioBrowserClient {
|
|
|
117
117
|
* Fetches and parses states from the Radio Browser API.
|
|
118
118
|
* @param params - The search parameters
|
|
119
119
|
* @param query - The search query
|
|
120
|
-
* @see {@link https://
|
|
120
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_states} for more information on the API endpoint
|
|
121
121
|
* @returns A promise that resolves to the list of states
|
|
122
122
|
*/
|
|
123
123
|
getStates(params: IStates, query?: string): Promise<State[]>;
|
|
@@ -126,7 +126,7 @@ export declare class RadioBrowserClient {
|
|
|
126
126
|
* @param params - The search parameters
|
|
127
127
|
* @param query - The search query
|
|
128
128
|
* @param outputFormat - The output format for the list of languages (default is JSON)
|
|
129
|
-
* @see {@link https://
|
|
129
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_languages} for more information on the API endpoint
|
|
130
130
|
* @returns A promise that resolves to the list of languages
|
|
131
131
|
*/
|
|
132
132
|
fetchLanguages(params: ILanguages, query?: string, outputFormat?: ListOutputFormat): Promise<string>;
|
|
@@ -134,7 +134,7 @@ export declare class RadioBrowserClient {
|
|
|
134
134
|
* Fetches and parses languages from the Radio Browser API.
|
|
135
135
|
* @param params - The search parameters
|
|
136
136
|
* @param query - The search query
|
|
137
|
-
* @see {@link https://
|
|
137
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_languages} for more information on the API endpoint
|
|
138
138
|
* @returns A promise that resolves to the list of languages
|
|
139
139
|
*/
|
|
140
140
|
getLanguages(params: ILanguages, query?: string): Promise<Language[]>;
|
|
@@ -143,7 +143,7 @@ export declare class RadioBrowserClient {
|
|
|
143
143
|
* @param params - The search parameters
|
|
144
144
|
* @param query - The search query
|
|
145
145
|
* @param outputFormat - The output format for the list of tags (default is JSON)
|
|
146
|
-
* @see {@link https://
|
|
146
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_tags} for more information on the API endpoint
|
|
147
147
|
* @returns A promise that resolves to the list of tags
|
|
148
148
|
*/
|
|
149
149
|
fetchTags(params: ITags, query?: string, outputFormat?: ListOutputFormat): Promise<string>;
|
|
@@ -151,7 +151,7 @@ export declare class RadioBrowserClient {
|
|
|
151
151
|
* Fetches and parses tags from the Radio Browser API.
|
|
152
152
|
* @param params - The search parameters
|
|
153
153
|
* @param query - The search query
|
|
154
|
-
* @see {@link https://
|
|
154
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_tags} for more information on the API endpoint
|
|
155
155
|
* @returns A promise that resolves to the list of tags
|
|
156
156
|
*/
|
|
157
157
|
getTags(params: ITags, query?: string): Promise<Tag[]>;
|
|
@@ -159,14 +159,14 @@ export declare class RadioBrowserClient {
|
|
|
159
159
|
* Fetches station checks from the Radio Browser API.
|
|
160
160
|
* @param params - The search parameters
|
|
161
161
|
* @param outputFormat - The output format for the list of station checks (default is JSON)
|
|
162
|
-
* @see {@link https://
|
|
162
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_check_results} for more information on the API endpoint
|
|
163
163
|
* @returns A promise that resolves to the list of station checks
|
|
164
164
|
*/
|
|
165
165
|
fetchStationChecks(params: IStationChecks, outputFormat?: ListOutputFormat): Promise<string>;
|
|
166
166
|
/**
|
|
167
167
|
* Fetches and parses station checks from the Radio Browser API.
|
|
168
168
|
* @param params - The search parameters
|
|
169
|
-
* @see {@link https://
|
|
169
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_check_results} for more information on the API endpoint
|
|
170
170
|
* @returns A promise that resolves to the list of station checks
|
|
171
171
|
*/
|
|
172
172
|
getStationChecks(params: IStationChecks): Promise<StationCheck[]>;
|
|
@@ -174,14 +174,14 @@ export declare class RadioBrowserClient {
|
|
|
174
174
|
* Fetches station clicks from the Radio Browser API.
|
|
175
175
|
* @param params - The search parameters
|
|
176
176
|
* @param outputFormat - The output format for the list of station clicks (default is JSON)
|
|
177
|
-
* @see {@link https://
|
|
177
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_clicks} for more information on the API endpoint
|
|
178
178
|
* @returns A promise that resolves to the list of station clicks
|
|
179
179
|
*/
|
|
180
180
|
fetchStationClicks(params: IStationClicks, outputFormat?: ListOutputFormat): Promise<string>;
|
|
181
181
|
/**
|
|
182
182
|
* Fetches and parses station clicks from the Radio Browser API.
|
|
183
183
|
* @param params - The search parameters
|
|
184
|
-
* @see {@link https://
|
|
184
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_clicks} for more information on the API endpoint
|
|
185
185
|
* @returns A promise that resolves to the list of station clicks
|
|
186
186
|
*/
|
|
187
187
|
getStationClicks(params: IStationClicks): Promise<StationClick[]>;
|
|
@@ -189,7 +189,7 @@ export declare class RadioBrowserClient {
|
|
|
189
189
|
* Fetches station check steps from the Radio Browser API.
|
|
190
190
|
* @param params - The search parameters
|
|
191
191
|
* @param outputFormat - The output format for the list of station check steps (default is JSON)
|
|
192
|
-
* @see {@link https://
|
|
192
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_check_steps} for more information on the API endpoint
|
|
193
193
|
* @returns A promise that resolves to the list of station check steps
|
|
194
194
|
*/
|
|
195
195
|
fetchStationCheckSteps(params: IStationCheckSteps, outputFormat?: ListOutputFormat): Promise<string>;
|
|
@@ -197,7 +197,7 @@ export declare class RadioBrowserClient {
|
|
|
197
197
|
* Fetches and parses station check steps from the Radio Browser API.
|
|
198
198
|
* @param params - The search parameters
|
|
199
199
|
* @param outputFormat - The output format for the list of station check steps (default is JSON)
|
|
200
|
-
* @see {@link https://
|
|
200
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_check_steps} for more information on the API endpoint
|
|
201
201
|
* @returns A promise that resolves to the list of station check steps
|
|
202
202
|
*/
|
|
203
203
|
getStationCheckSteps(params: IStationCheckSteps): Promise<StationCheckStep[]>;
|
|
@@ -205,52 +205,52 @@ export declare class RadioBrowserClient {
|
|
|
205
205
|
* Fetches old versions of station from the Radio Browser API.
|
|
206
206
|
* @param params - The search parameters
|
|
207
207
|
* @param outputFormat - The output format for the list of station old versions (default is JSON)
|
|
208
|
-
* @see {@link https://
|
|
208
|
+
* @see {@link https://all.api.radio-browser.info/#Old_versions_of_stations} for more information on the API endpoint
|
|
209
209
|
* @returns A promise that resolves to the list of station old versions
|
|
210
210
|
*/
|
|
211
211
|
fetchStationOldVersion(params: IStationOldVersion, stationUUID?: string, outputFormat?: ListOutputFormat): Promise<string>;
|
|
212
212
|
/**
|
|
213
213
|
* Fetches and parses old versions of station from the Radio Browser API.
|
|
214
214
|
* @param params - The search parameters
|
|
215
|
-
* @see {@link https://
|
|
215
|
+
* @see {@link https://all.api.radio-browser.info/#Old_versions_of_stations} for more information on the API endpoint
|
|
216
216
|
* @returns A promise that resolves to the list of station old versions
|
|
217
217
|
*/
|
|
218
218
|
getStationOldVersion(params: IStationOldVersion, stationUUID?: string): Promise<StationOldVersion[]>;
|
|
219
219
|
/**
|
|
220
220
|
* Fetches server stats from the Radio Browser API.
|
|
221
221
|
* @param outputFormat - The output format for the server stats (default is JSON)
|
|
222
|
-
* @see {@link https://
|
|
222
|
+
* @see {@link https://all.api.radio-browser.info/#Server_stats} for more information on the API endpoint
|
|
223
223
|
* @returns A promise that resolves to the server stats
|
|
224
224
|
*/
|
|
225
225
|
fetchServerStats(outputFormat?: ObjectOutputFromat): Promise<string>;
|
|
226
226
|
/**
|
|
227
227
|
* Fetches and parses server stats from the Radio Browser API.
|
|
228
|
-
* @see {@link https://
|
|
228
|
+
* @see {@link https://all.api.radio-browser.info/#Server_stats} for more information on the API endpoint
|
|
229
229
|
* @returns A promise that resolves to the server stats
|
|
230
230
|
*/
|
|
231
231
|
getServerStats(): Promise<ServerStats>;
|
|
232
232
|
/**
|
|
233
233
|
* Fetches server config from the Radio Browser API.
|
|
234
234
|
* @param outputFormat - The output format for the server config (default is JSON)
|
|
235
|
-
* @see {@link https://
|
|
235
|
+
* @see {@link https://all.api.radio-browser.info/#Server_config} for more information on the API endpoint
|
|
236
236
|
* @returns A promise that resolves to the server config
|
|
237
237
|
*/
|
|
238
238
|
fetchServerConfig(outputFormat?: ObjectOutputFromat): Promise<string>;
|
|
239
239
|
/**
|
|
240
240
|
* Fetches server config from the Radio Browser API.
|
|
241
|
-
* @see {@link https://
|
|
241
|
+
* @see {@link https://all.api.radio-browser.info/#Server_config} for more information on the API endpoint
|
|
242
242
|
* @returns A promise that resolves to the server config
|
|
243
243
|
*/
|
|
244
244
|
getServerConfig(): Promise<ServerConfig>;
|
|
245
245
|
/**
|
|
246
246
|
* Votes for the station by given UUID.
|
|
247
|
-
* @see {@link https://
|
|
247
|
+
* @see {@link https://all.api.radio-browser.info/#Vote_for_station} for more information on the API endpoint
|
|
248
248
|
* @param stationUUID - The UUID of the station to vote for
|
|
249
249
|
*/
|
|
250
250
|
voteForStation(stationUUID: string): Promise<void>;
|
|
251
251
|
/**
|
|
252
252
|
* Logs a click for the station by given UUID.
|
|
253
|
-
* @see {@link https://
|
|
253
|
+
* @see {@link https://all.api.radio-browser.info/#Count_station_click} for more information on the API endpoint
|
|
254
254
|
* @param stationUUID - The UUID of the station for which the click is logged
|
|
255
255
|
*/
|
|
256
256
|
click(stationUUID: string): Promise<void>;
|
package/dist/client.js
CHANGED
|
@@ -22,7 +22,7 @@ class RadioBrowserClient {
|
|
|
22
22
|
headers: { 'User-Agent': `${appName}/${appVersion}` },
|
|
23
23
|
transformResponse: [(data) => data],
|
|
24
24
|
});
|
|
25
|
-
(0, axios_retry_1.default)(this.axios, { retries: 3, retryDelay: (retryCount) => retryCount *
|
|
25
|
+
(0, axios_retry_1.default)(this.axios, { retries: 3, retryDelay: (retryCount) => retryCount * 1000 });
|
|
26
26
|
this.jsonSerializer = new typescript_json_serializer_1.JsonSerializer();
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
@@ -52,16 +52,16 @@ class RadioBrowserClient {
|
|
|
52
52
|
/**
|
|
53
53
|
* Fetches the list of available servers from the Radio Browser API.
|
|
54
54
|
* @param outputFormat - The output format for the list of servers (default is JSON)
|
|
55
|
-
* @see {@link https://
|
|
55
|
+
* @see {@link https://all.api.radio-browser.info/#Server_mirrors} for more information on the API endpoint
|
|
56
56
|
* @returns A promise that resolves to the list of servers
|
|
57
57
|
*/
|
|
58
58
|
async fetchServers(outputFormat = 'json') {
|
|
59
|
-
const { data } = await this.sendRequest('servers', outputFormat, {}, !this.axios.defaults.baseURL ? 'https://
|
|
59
|
+
const { data } = await this.sendRequest('servers', outputFormat, {}, !this.axios.defaults.baseURL ? 'https://all.api.radio-browser.info' : undefined);
|
|
60
60
|
return data;
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* Fetches and parses the list of available servers from the Radio Browser API.
|
|
64
|
-
* @see {@link https://
|
|
64
|
+
* @see {@link https://all.api.radio-browser.info/#Server_mirrors} for more information on the API endpoint
|
|
65
65
|
* @returns A promise that resolves to the list of servers
|
|
66
66
|
*/
|
|
67
67
|
async getServers() {
|
|
@@ -79,7 +79,7 @@ class RadioBrowserClient {
|
|
|
79
79
|
* Fetches stations from the Radio Browser API.
|
|
80
80
|
* @param params - The search parameters
|
|
81
81
|
* @param outputFormat - The output format for the list of stations (default is JSON)
|
|
82
|
-
* @see {@link https://
|
|
82
|
+
* @see {@link https://all.api.radio-browser.info/#Advanced_station_search} for more information on the API endpoint
|
|
83
83
|
* @returns A promise that resolves to the list of stations
|
|
84
84
|
*/
|
|
85
85
|
async fetchStations(params, outputFormat = 'json') {
|
|
@@ -99,7 +99,7 @@ class RadioBrowserClient {
|
|
|
99
99
|
* Fetches stations from the Radio Browser API by given UUIDs.
|
|
100
100
|
* @param params - The search parameters
|
|
101
101
|
* @param outputFormat - The output format for the list of stations (default is JSON)
|
|
102
|
-
* @see {@link https://
|
|
102
|
+
* @see {@link https://all.api.radio-browser.info/#Search_radio_stations_by_uuid} for more information on the API endpoint
|
|
103
103
|
* @returns A promise that resolves to the list of stations by given UUIDs
|
|
104
104
|
*/
|
|
105
105
|
async fetchStationsByUUIDs(params, outputFormat = 'json') {
|
|
@@ -109,7 +109,7 @@ class RadioBrowserClient {
|
|
|
109
109
|
/**
|
|
110
110
|
* Fetches and parses stations from the Radio Browser API by given UUIDs.
|
|
111
111
|
* @param params - The search parameters
|
|
112
|
-
* @see {@link https://
|
|
112
|
+
* @see {@link https://all.api.radio-browser.info/#Search_radio_stations_by_uuid} for more information on the API endpoint
|
|
113
113
|
* @returns A promise that resolves to the list of stations by given UUIDs
|
|
114
114
|
*/
|
|
115
115
|
async getStationsByUUIDs(params) {
|
|
@@ -121,7 +121,7 @@ class RadioBrowserClient {
|
|
|
121
121
|
* @param params - The search parameters
|
|
122
122
|
* @param query - The search query
|
|
123
123
|
* @param outputFormat - The output format for the list of countires (default is JSON)
|
|
124
|
-
* @see {@link https://
|
|
124
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_countries} for more information on the API endpoint
|
|
125
125
|
* @returns A promise that resolves to the list of countires
|
|
126
126
|
*/
|
|
127
127
|
async fetchCountries(params, query = '', outputFormat = 'json') {
|
|
@@ -132,7 +132,7 @@ class RadioBrowserClient {
|
|
|
132
132
|
* Fetches and parses list of countries from the Radio Browser API.
|
|
133
133
|
* @param params - The search parameters
|
|
134
134
|
* @param query - The search query
|
|
135
|
-
* @see {@link https://
|
|
135
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_countries} for more information on the API endpoint
|
|
136
136
|
* @returns A promise that resolves to the list of countires
|
|
137
137
|
*/
|
|
138
138
|
async getCountries(params, query = '') {
|
|
@@ -144,7 +144,7 @@ class RadioBrowserClient {
|
|
|
144
144
|
* @param params - The search parameters
|
|
145
145
|
* @param query - The search query
|
|
146
146
|
* @param outputFormat - The output format for the list of codecs (default is JSON)
|
|
147
|
-
* @see {@link https://
|
|
147
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_codecs} for more information on the API endpoint
|
|
148
148
|
* @returns A promise that resolves to the list of codecs
|
|
149
149
|
*/
|
|
150
150
|
async fetchCodecs(params, query = '', outputFormat = 'json') {
|
|
@@ -155,7 +155,7 @@ class RadioBrowserClient {
|
|
|
155
155
|
* Fetches and parses codecs from the Radio Browser API.
|
|
156
156
|
* @param params - The search parameters
|
|
157
157
|
* @param query - The search query
|
|
158
|
-
* @see {@link https://
|
|
158
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_codecs} for more information on the API endpoint
|
|
159
159
|
* @returns A promise that resolves to the list of codecs
|
|
160
160
|
*/
|
|
161
161
|
async getCodecs(params, query = '') {
|
|
@@ -167,7 +167,7 @@ class RadioBrowserClient {
|
|
|
167
167
|
* @param params - The search parameters
|
|
168
168
|
* @param query - The search query
|
|
169
169
|
* @param outputFormat - The output format for the list of states (default is JSON)
|
|
170
|
-
* @see {@link https://
|
|
170
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_states} for more information on the API endpoint
|
|
171
171
|
* @returns A promise that resolves to the list of states
|
|
172
172
|
*/
|
|
173
173
|
async fetchStates(params, query = '', outputFormat = 'json') {
|
|
@@ -178,7 +178,7 @@ class RadioBrowserClient {
|
|
|
178
178
|
* Fetches and parses states from the Radio Browser API.
|
|
179
179
|
* @param params - The search parameters
|
|
180
180
|
* @param query - The search query
|
|
181
|
-
* @see {@link https://
|
|
181
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_states} for more information on the API endpoint
|
|
182
182
|
* @returns A promise that resolves to the list of states
|
|
183
183
|
*/
|
|
184
184
|
async getStates(params, query = '') {
|
|
@@ -190,7 +190,7 @@ class RadioBrowserClient {
|
|
|
190
190
|
* @param params - The search parameters
|
|
191
191
|
* @param query - The search query
|
|
192
192
|
* @param outputFormat - The output format for the list of languages (default is JSON)
|
|
193
|
-
* @see {@link https://
|
|
193
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_languages} for more information on the API endpoint
|
|
194
194
|
* @returns A promise that resolves to the list of languages
|
|
195
195
|
*/
|
|
196
196
|
async fetchLanguages(params, query = '', outputFormat = 'json') {
|
|
@@ -201,7 +201,7 @@ class RadioBrowserClient {
|
|
|
201
201
|
* Fetches and parses languages from the Radio Browser API.
|
|
202
202
|
* @param params - The search parameters
|
|
203
203
|
* @param query - The search query
|
|
204
|
-
* @see {@link https://
|
|
204
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_languages} for more information on the API endpoint
|
|
205
205
|
* @returns A promise that resolves to the list of languages
|
|
206
206
|
*/
|
|
207
207
|
async getLanguages(params, query = '') {
|
|
@@ -213,7 +213,7 @@ class RadioBrowserClient {
|
|
|
213
213
|
* @param params - The search parameters
|
|
214
214
|
* @param query - The search query
|
|
215
215
|
* @param outputFormat - The output format for the list of tags (default is JSON)
|
|
216
|
-
* @see {@link https://
|
|
216
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_tags} for more information on the API endpoint
|
|
217
217
|
* @returns A promise that resolves to the list of tags
|
|
218
218
|
*/
|
|
219
219
|
async fetchTags(params, query = '', outputFormat = 'json') {
|
|
@@ -224,7 +224,7 @@ class RadioBrowserClient {
|
|
|
224
224
|
* Fetches and parses tags from the Radio Browser API.
|
|
225
225
|
* @param params - The search parameters
|
|
226
226
|
* @param query - The search query
|
|
227
|
-
* @see {@link https://
|
|
227
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_tags} for more information on the API endpoint
|
|
228
228
|
* @returns A promise that resolves to the list of tags
|
|
229
229
|
*/
|
|
230
230
|
async getTags(params, query = '') {
|
|
@@ -235,7 +235,7 @@ class RadioBrowserClient {
|
|
|
235
235
|
* Fetches station checks from the Radio Browser API.
|
|
236
236
|
* @param params - The search parameters
|
|
237
237
|
* @param outputFormat - The output format for the list of station checks (default is JSON)
|
|
238
|
-
* @see {@link https://
|
|
238
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_check_results} for more information on the API endpoint
|
|
239
239
|
* @returns A promise that resolves to the list of station checks
|
|
240
240
|
*/
|
|
241
241
|
async fetchStationChecks(params, outputFormat = 'json') {
|
|
@@ -245,7 +245,7 @@ class RadioBrowserClient {
|
|
|
245
245
|
/**
|
|
246
246
|
* Fetches and parses station checks from the Radio Browser API.
|
|
247
247
|
* @param params - The search parameters
|
|
248
|
-
* @see {@link https://
|
|
248
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_check_results} for more information on the API endpoint
|
|
249
249
|
* @returns A promise that resolves to the list of station checks
|
|
250
250
|
*/
|
|
251
251
|
async getStationChecks(params) {
|
|
@@ -256,7 +256,7 @@ class RadioBrowserClient {
|
|
|
256
256
|
* Fetches station clicks from the Radio Browser API.
|
|
257
257
|
* @param params - The search parameters
|
|
258
258
|
* @param outputFormat - The output format for the list of station clicks (default is JSON)
|
|
259
|
-
* @see {@link https://
|
|
259
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_clicks} for more information on the API endpoint
|
|
260
260
|
* @returns A promise that resolves to the list of station clicks
|
|
261
261
|
*/
|
|
262
262
|
async fetchStationClicks(params, outputFormat = 'json') {
|
|
@@ -266,7 +266,7 @@ class RadioBrowserClient {
|
|
|
266
266
|
/**
|
|
267
267
|
* Fetches and parses station clicks from the Radio Browser API.
|
|
268
268
|
* @param params - The search parameters
|
|
269
|
-
* @see {@link https://
|
|
269
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_clicks} for more information on the API endpoint
|
|
270
270
|
* @returns A promise that resolves to the list of station clicks
|
|
271
271
|
*/
|
|
272
272
|
async getStationClicks(params) {
|
|
@@ -277,7 +277,7 @@ class RadioBrowserClient {
|
|
|
277
277
|
* Fetches station check steps from the Radio Browser API.
|
|
278
278
|
* @param params - The search parameters
|
|
279
279
|
* @param outputFormat - The output format for the list of station check steps (default is JSON)
|
|
280
|
-
* @see {@link https://
|
|
280
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_check_steps} for more information on the API endpoint
|
|
281
281
|
* @returns A promise that resolves to the list of station check steps
|
|
282
282
|
*/
|
|
283
283
|
async fetchStationCheckSteps(params, outputFormat = 'json') {
|
|
@@ -288,7 +288,7 @@ class RadioBrowserClient {
|
|
|
288
288
|
* Fetches and parses station check steps from the Radio Browser API.
|
|
289
289
|
* @param params - The search parameters
|
|
290
290
|
* @param outputFormat - The output format for the list of station check steps (default is JSON)
|
|
291
|
-
* @see {@link https://
|
|
291
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_check_steps} for more information on the API endpoint
|
|
292
292
|
* @returns A promise that resolves to the list of station check steps
|
|
293
293
|
*/
|
|
294
294
|
async getStationCheckSteps(params) {
|
|
@@ -299,7 +299,7 @@ class RadioBrowserClient {
|
|
|
299
299
|
* Fetches old versions of station from the Radio Browser API.
|
|
300
300
|
* @param params - The search parameters
|
|
301
301
|
* @param outputFormat - The output format for the list of station old versions (default is JSON)
|
|
302
|
-
* @see {@link https://
|
|
302
|
+
* @see {@link https://all.api.radio-browser.info/#Old_versions_of_stations} for more information on the API endpoint
|
|
303
303
|
* @returns A promise that resolves to the list of station old versions
|
|
304
304
|
*/
|
|
305
305
|
async fetchStationOldVersion(params, stationUUID = '', outputFormat = 'json') {
|
|
@@ -309,7 +309,7 @@ class RadioBrowserClient {
|
|
|
309
309
|
/**
|
|
310
310
|
* Fetches and parses old versions of station from the Radio Browser API.
|
|
311
311
|
* @param params - The search parameters
|
|
312
|
-
* @see {@link https://
|
|
312
|
+
* @see {@link https://all.api.radio-browser.info/#Old_versions_of_stations} for more information on the API endpoint
|
|
313
313
|
* @returns A promise that resolves to the list of station old versions
|
|
314
314
|
*/
|
|
315
315
|
async getStationOldVersion(params, stationUUID = '') {
|
|
@@ -319,7 +319,7 @@ class RadioBrowserClient {
|
|
|
319
319
|
/**
|
|
320
320
|
* Fetches server stats from the Radio Browser API.
|
|
321
321
|
* @param outputFormat - The output format for the server stats (default is JSON)
|
|
322
|
-
* @see {@link https://
|
|
322
|
+
* @see {@link https://all.api.radio-browser.info/#Server_stats} for more information on the API endpoint
|
|
323
323
|
* @returns A promise that resolves to the server stats
|
|
324
324
|
*/
|
|
325
325
|
async fetchServerStats(outputFormat = 'json') {
|
|
@@ -328,7 +328,7 @@ class RadioBrowserClient {
|
|
|
328
328
|
}
|
|
329
329
|
/**
|
|
330
330
|
* Fetches and parses server stats from the Radio Browser API.
|
|
331
|
-
* @see {@link https://
|
|
331
|
+
* @see {@link https://all.api.radio-browser.info/#Server_stats} for more information on the API endpoint
|
|
332
332
|
* @returns A promise that resolves to the server stats
|
|
333
333
|
*/
|
|
334
334
|
async getServerStats() {
|
|
@@ -338,7 +338,7 @@ class RadioBrowserClient {
|
|
|
338
338
|
/**
|
|
339
339
|
* Fetches server config from the Radio Browser API.
|
|
340
340
|
* @param outputFormat - The output format for the server config (default is JSON)
|
|
341
|
-
* @see {@link https://
|
|
341
|
+
* @see {@link https://all.api.radio-browser.info/#Server_config} for more information on the API endpoint
|
|
342
342
|
* @returns A promise that resolves to the server config
|
|
343
343
|
*/
|
|
344
344
|
async fetchServerConfig(outputFormat = 'json') {
|
|
@@ -347,7 +347,7 @@ class RadioBrowserClient {
|
|
|
347
347
|
}
|
|
348
348
|
/**
|
|
349
349
|
* Fetches server config from the Radio Browser API.
|
|
350
|
-
* @see {@link https://
|
|
350
|
+
* @see {@link https://all.api.radio-browser.info/#Server_config} for more information on the API endpoint
|
|
351
351
|
* @returns A promise that resolves to the server config
|
|
352
352
|
*/
|
|
353
353
|
async getServerConfig() {
|
|
@@ -356,7 +356,7 @@ class RadioBrowserClient {
|
|
|
356
356
|
}
|
|
357
357
|
/**
|
|
358
358
|
* Votes for the station by given UUID.
|
|
359
|
-
* @see {@link https://
|
|
359
|
+
* @see {@link https://all.api.radio-browser.info/#Vote_for_station} for more information on the API endpoint
|
|
360
360
|
* @param stationUUID - The UUID of the station to vote for
|
|
361
361
|
*/
|
|
362
362
|
async voteForStation(stationUUID) {
|
|
@@ -364,7 +364,7 @@ class RadioBrowserClient {
|
|
|
364
364
|
}
|
|
365
365
|
/**
|
|
366
366
|
* Logs a click for the station by given UUID.
|
|
367
|
-
* @see {@link https://
|
|
367
|
+
* @see {@link https://all.api.radio-browser.info/#Count_station_click} for more information on the API endpoint
|
|
368
368
|
* @param stationUUID - The UUID of the station for which the click is logged
|
|
369
369
|
*/
|
|
370
370
|
async click(stationUUID) {
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -44,7 +44,7 @@ export class RadioBrowserClient {
|
|
|
44
44
|
headers: { 'User-Agent': `${appName}/${appVersion}` },
|
|
45
45
|
transformResponse: [(data) => data],
|
|
46
46
|
});
|
|
47
|
-
axiosRetry(this.axios, { retries: 3, retryDelay: (retryCount) => retryCount *
|
|
47
|
+
axiosRetry(this.axios, { retries: 3, retryDelay: (retryCount) => retryCount * 1000 });
|
|
48
48
|
this.jsonSerializer = new JsonSerializer();
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -76,7 +76,7 @@ export class RadioBrowserClient {
|
|
|
76
76
|
/**
|
|
77
77
|
* Fetches the list of available servers from the Radio Browser API.
|
|
78
78
|
* @param outputFormat - The output format for the list of servers (default is JSON)
|
|
79
|
-
* @see {@link https://
|
|
79
|
+
* @see {@link https://all.api.radio-browser.info/#Server_mirrors} for more information on the API endpoint
|
|
80
80
|
* @returns A promise that resolves to the list of servers
|
|
81
81
|
*/
|
|
82
82
|
public async fetchServers(outputFormat: StationsListOutputFormat = 'json'): Promise<string> {
|
|
@@ -84,14 +84,14 @@ export class RadioBrowserClient {
|
|
|
84
84
|
'servers',
|
|
85
85
|
outputFormat,
|
|
86
86
|
{},
|
|
87
|
-
!this.axios.defaults.baseURL ? 'https://
|
|
87
|
+
!this.axios.defaults.baseURL ? 'https://all.api.radio-browser.info' : undefined,
|
|
88
88
|
);
|
|
89
89
|
return data;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* Fetches and parses the list of available servers from the Radio Browser API.
|
|
94
|
-
* @see {@link https://
|
|
94
|
+
* @see {@link https://all.api.radio-browser.info/#Server_mirrors} for more information on the API endpoint
|
|
95
95
|
* @returns A promise that resolves to the list of servers
|
|
96
96
|
*/
|
|
97
97
|
public async getServers(): Promise<Server[]> {
|
|
@@ -111,7 +111,7 @@ export class RadioBrowserClient {
|
|
|
111
111
|
* Fetches stations from the Radio Browser API.
|
|
112
112
|
* @param params - The search parameters
|
|
113
113
|
* @param outputFormat - The output format for the list of stations (default is JSON)
|
|
114
|
-
* @see {@link https://
|
|
114
|
+
* @see {@link https://all.api.radio-browser.info/#Advanced_station_search} for more information on the API endpoint
|
|
115
115
|
* @returns A promise that resolves to the list of stations
|
|
116
116
|
*/
|
|
117
117
|
public async fetchStations(params: ISearchStation, outputFormat: StationsListOutputFormat = 'json'): Promise<string> {
|
|
@@ -133,7 +133,7 @@ export class RadioBrowserClient {
|
|
|
133
133
|
* Fetches stations from the Radio Browser API by given UUIDs.
|
|
134
134
|
* @param params - The search parameters
|
|
135
135
|
* @param outputFormat - The output format for the list of stations (default is JSON)
|
|
136
|
-
* @see {@link https://
|
|
136
|
+
* @see {@link https://all.api.radio-browser.info/#Search_radio_stations_by_uuid} for more information on the API endpoint
|
|
137
137
|
* @returns A promise that resolves to the list of stations by given UUIDs
|
|
138
138
|
*/
|
|
139
139
|
public async fetchStationsByUUIDs(params: { stationUUIDs: string[] }, outputFormat: StationsListOutputFormat = 'json'): Promise<string> {
|
|
@@ -144,7 +144,7 @@ export class RadioBrowserClient {
|
|
|
144
144
|
/**
|
|
145
145
|
* Fetches and parses stations from the Radio Browser API by given UUIDs.
|
|
146
146
|
* @param params - The search parameters
|
|
147
|
-
* @see {@link https://
|
|
147
|
+
* @see {@link https://all.api.radio-browser.info/#Search_radio_stations_by_uuid} for more information on the API endpoint
|
|
148
148
|
* @returns A promise that resolves to the list of stations by given UUIDs
|
|
149
149
|
*/
|
|
150
150
|
public async getStationsByUUIDs(params: { stationUUIDs: string[] }): Promise<Station[]> {
|
|
@@ -157,7 +157,7 @@ export class RadioBrowserClient {
|
|
|
157
157
|
* @param params - The search parameters
|
|
158
158
|
* @param query - The search query
|
|
159
159
|
* @param outputFormat - The output format for the list of countires (default is JSON)
|
|
160
|
-
* @see {@link https://
|
|
160
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_countries} for more information on the API endpoint
|
|
161
161
|
* @returns A promise that resolves to the list of countires
|
|
162
162
|
*/
|
|
163
163
|
public async fetchCountries(params: ICountries, query: string = '', outputFormat: ListOutputFormat = 'json'): Promise<string> {
|
|
@@ -169,7 +169,7 @@ export class RadioBrowserClient {
|
|
|
169
169
|
* Fetches and parses list of countries from the Radio Browser API.
|
|
170
170
|
* @param params - The search parameters
|
|
171
171
|
* @param query - The search query
|
|
172
|
-
* @see {@link https://
|
|
172
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_countries} for more information on the API endpoint
|
|
173
173
|
* @returns A promise that resolves to the list of countires
|
|
174
174
|
*/
|
|
175
175
|
public async getCountries(params: ICountries, query: string = ''): Promise<Country[]> {
|
|
@@ -182,7 +182,7 @@ export class RadioBrowserClient {
|
|
|
182
182
|
* @param params - The search parameters
|
|
183
183
|
* @param query - The search query
|
|
184
184
|
* @param outputFormat - The output format for the list of codecs (default is JSON)
|
|
185
|
-
* @see {@link https://
|
|
185
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_codecs} for more information on the API endpoint
|
|
186
186
|
* @returns A promise that resolves to the list of codecs
|
|
187
187
|
*/
|
|
188
188
|
public async fetchCodecs(params: ICodecs, query: string = '', outputFormat: ListOutputFormat = 'json'): Promise<string> {
|
|
@@ -194,7 +194,7 @@ export class RadioBrowserClient {
|
|
|
194
194
|
* Fetches and parses codecs from the Radio Browser API.
|
|
195
195
|
* @param params - The search parameters
|
|
196
196
|
* @param query - The search query
|
|
197
|
-
* @see {@link https://
|
|
197
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_codecs} for more information on the API endpoint
|
|
198
198
|
* @returns A promise that resolves to the list of codecs
|
|
199
199
|
*/
|
|
200
200
|
public async getCodecs(params: ICodecs, query: string = ''): Promise<Codec[]> {
|
|
@@ -207,7 +207,7 @@ export class RadioBrowserClient {
|
|
|
207
207
|
* @param params - The search parameters
|
|
208
208
|
* @param query - The search query
|
|
209
209
|
* @param outputFormat - The output format for the list of states (default is JSON)
|
|
210
|
-
* @see {@link https://
|
|
210
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_states} for more information on the API endpoint
|
|
211
211
|
* @returns A promise that resolves to the list of states
|
|
212
212
|
*/
|
|
213
213
|
public async fetchStates(params: IStates, query: string = '', outputFormat: ListOutputFormat = 'json'): Promise<string> {
|
|
@@ -219,7 +219,7 @@ export class RadioBrowserClient {
|
|
|
219
219
|
* Fetches and parses states from the Radio Browser API.
|
|
220
220
|
* @param params - The search parameters
|
|
221
221
|
* @param query - The search query
|
|
222
|
-
* @see {@link https://
|
|
222
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_states} for more information on the API endpoint
|
|
223
223
|
* @returns A promise that resolves to the list of states
|
|
224
224
|
*/
|
|
225
225
|
public async getStates(params: IStates, query: string = ''): Promise<State[]> {
|
|
@@ -232,7 +232,7 @@ export class RadioBrowserClient {
|
|
|
232
232
|
* @param params - The search parameters
|
|
233
233
|
* @param query - The search query
|
|
234
234
|
* @param outputFormat - The output format for the list of languages (default is JSON)
|
|
235
|
-
* @see {@link https://
|
|
235
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_languages} for more information on the API endpoint
|
|
236
236
|
* @returns A promise that resolves to the list of languages
|
|
237
237
|
*/
|
|
238
238
|
public async fetchLanguages(params: ILanguages, query: string = '', outputFormat: ListOutputFormat = 'json'): Promise<string> {
|
|
@@ -244,7 +244,7 @@ export class RadioBrowserClient {
|
|
|
244
244
|
* Fetches and parses languages from the Radio Browser API.
|
|
245
245
|
* @param params - The search parameters
|
|
246
246
|
* @param query - The search query
|
|
247
|
-
* @see {@link https://
|
|
247
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_languages} for more information on the API endpoint
|
|
248
248
|
* @returns A promise that resolves to the list of languages
|
|
249
249
|
*/
|
|
250
250
|
public async getLanguages(params: ILanguages, query: string = ''): Promise<Language[]> {
|
|
@@ -257,7 +257,7 @@ export class RadioBrowserClient {
|
|
|
257
257
|
* @param params - The search parameters
|
|
258
258
|
* @param query - The search query
|
|
259
259
|
* @param outputFormat - The output format for the list of tags (default is JSON)
|
|
260
|
-
* @see {@link https://
|
|
260
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_tags} for more information on the API endpoint
|
|
261
261
|
* @returns A promise that resolves to the list of tags
|
|
262
262
|
*/
|
|
263
263
|
public async fetchTags(params: ITags, query: string = '', outputFormat: ListOutputFormat = 'json'): Promise<string> {
|
|
@@ -269,7 +269,7 @@ export class RadioBrowserClient {
|
|
|
269
269
|
* Fetches and parses tags from the Radio Browser API.
|
|
270
270
|
* @param params - The search parameters
|
|
271
271
|
* @param query - The search query
|
|
272
|
-
* @see {@link https://
|
|
272
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_tags} for more information on the API endpoint
|
|
273
273
|
* @returns A promise that resolves to the list of tags
|
|
274
274
|
*/
|
|
275
275
|
public async getTags(params: ITags, query: string = ''): Promise<Tag[]> {
|
|
@@ -281,7 +281,7 @@ export class RadioBrowserClient {
|
|
|
281
281
|
* Fetches station checks from the Radio Browser API.
|
|
282
282
|
* @param params - The search parameters
|
|
283
283
|
* @param outputFormat - The output format for the list of station checks (default is JSON)
|
|
284
|
-
* @see {@link https://
|
|
284
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_check_results} for more information on the API endpoint
|
|
285
285
|
* @returns A promise that resolves to the list of station checks
|
|
286
286
|
*/
|
|
287
287
|
public async fetchStationChecks(params: IStationChecks, outputFormat: ListOutputFormat = 'json'): Promise<string> {
|
|
@@ -292,7 +292,7 @@ export class RadioBrowserClient {
|
|
|
292
292
|
/**
|
|
293
293
|
* Fetches and parses station checks from the Radio Browser API.
|
|
294
294
|
* @param params - The search parameters
|
|
295
|
-
* @see {@link https://
|
|
295
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_check_results} for more information on the API endpoint
|
|
296
296
|
* @returns A promise that resolves to the list of station checks
|
|
297
297
|
*/
|
|
298
298
|
public async getStationChecks(params: IStationChecks): Promise<StationCheck[]> {
|
|
@@ -304,7 +304,7 @@ export class RadioBrowserClient {
|
|
|
304
304
|
* Fetches station clicks from the Radio Browser API.
|
|
305
305
|
* @param params - The search parameters
|
|
306
306
|
* @param outputFormat - The output format for the list of station clicks (default is JSON)
|
|
307
|
-
* @see {@link https://
|
|
307
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_clicks} for more information on the API endpoint
|
|
308
308
|
* @returns A promise that resolves to the list of station clicks
|
|
309
309
|
*/
|
|
310
310
|
public async fetchStationClicks(params: IStationClicks, outputFormat: ListOutputFormat = 'json'): Promise<string> {
|
|
@@ -315,7 +315,7 @@ export class RadioBrowserClient {
|
|
|
315
315
|
/**
|
|
316
316
|
* Fetches and parses station clicks from the Radio Browser API.
|
|
317
317
|
* @param params - The search parameters
|
|
318
|
-
* @see {@link https://
|
|
318
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_clicks} for more information on the API endpoint
|
|
319
319
|
* @returns A promise that resolves to the list of station clicks
|
|
320
320
|
*/
|
|
321
321
|
public async getStationClicks(params: IStationClicks): Promise<StationClick[]> {
|
|
@@ -327,7 +327,7 @@ export class RadioBrowserClient {
|
|
|
327
327
|
* Fetches station check steps from the Radio Browser API.
|
|
328
328
|
* @param params - The search parameters
|
|
329
329
|
* @param outputFormat - The output format for the list of station check steps (default is JSON)
|
|
330
|
-
* @see {@link https://
|
|
330
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_check_steps} for more information on the API endpoint
|
|
331
331
|
* @returns A promise that resolves to the list of station check steps
|
|
332
332
|
*/
|
|
333
333
|
public async fetchStationCheckSteps(params: IStationCheckSteps, outputFormat: ListOutputFormat = 'json'): Promise<string> {
|
|
@@ -339,7 +339,7 @@ export class RadioBrowserClient {
|
|
|
339
339
|
* Fetches and parses station check steps from the Radio Browser API.
|
|
340
340
|
* @param params - The search parameters
|
|
341
341
|
* @param outputFormat - The output format for the list of station check steps (default is JSON)
|
|
342
|
-
* @see {@link https://
|
|
342
|
+
* @see {@link https://all.api.radio-browser.info/#List_of_station_check_steps} for more information on the API endpoint
|
|
343
343
|
* @returns A promise that resolves to the list of station check steps
|
|
344
344
|
*/
|
|
345
345
|
public async getStationCheckSteps(params: IStationCheckSteps): Promise<StationCheckStep[]> {
|
|
@@ -351,7 +351,7 @@ export class RadioBrowserClient {
|
|
|
351
351
|
* Fetches old versions of station from the Radio Browser API.
|
|
352
352
|
* @param params - The search parameters
|
|
353
353
|
* @param outputFormat - The output format for the list of station old versions (default is JSON)
|
|
354
|
-
* @see {@link https://
|
|
354
|
+
* @see {@link https://all.api.radio-browser.info/#Old_versions_of_stations} for more information on the API endpoint
|
|
355
355
|
* @returns A promise that resolves to the list of station old versions
|
|
356
356
|
*/
|
|
357
357
|
public async fetchStationOldVersion(
|
|
@@ -370,7 +370,7 @@ export class RadioBrowserClient {
|
|
|
370
370
|
/**
|
|
371
371
|
* Fetches and parses old versions of station from the Radio Browser API.
|
|
372
372
|
* @param params - The search parameters
|
|
373
|
-
* @see {@link https://
|
|
373
|
+
* @see {@link https://all.api.radio-browser.info/#Old_versions_of_stations} for more information on the API endpoint
|
|
374
374
|
* @returns A promise that resolves to the list of station old versions
|
|
375
375
|
*/
|
|
376
376
|
public async getStationOldVersion(params: IStationOldVersion, stationUUID: string = ''): Promise<StationOldVersion[]> {
|
|
@@ -381,7 +381,7 @@ export class RadioBrowserClient {
|
|
|
381
381
|
/**
|
|
382
382
|
* Fetches server stats from the Radio Browser API.
|
|
383
383
|
* @param outputFormat - The output format for the server stats (default is JSON)
|
|
384
|
-
* @see {@link https://
|
|
384
|
+
* @see {@link https://all.api.radio-browser.info/#Server_stats} for more information on the API endpoint
|
|
385
385
|
* @returns A promise that resolves to the server stats
|
|
386
386
|
*/
|
|
387
387
|
public async fetchServerStats(outputFormat: ObjectOutputFromat = 'json'): Promise<string> {
|
|
@@ -391,7 +391,7 @@ export class RadioBrowserClient {
|
|
|
391
391
|
|
|
392
392
|
/**
|
|
393
393
|
* Fetches and parses server stats from the Radio Browser API.
|
|
394
|
-
* @see {@link https://
|
|
394
|
+
* @see {@link https://all.api.radio-browser.info/#Server_stats} for more information on the API endpoint
|
|
395
395
|
* @returns A promise that resolves to the server stats
|
|
396
396
|
*/
|
|
397
397
|
public async getServerStats(): Promise<ServerStats> {
|
|
@@ -402,7 +402,7 @@ export class RadioBrowserClient {
|
|
|
402
402
|
/**
|
|
403
403
|
* Fetches server config from the Radio Browser API.
|
|
404
404
|
* @param outputFormat - The output format for the server config (default is JSON)
|
|
405
|
-
* @see {@link https://
|
|
405
|
+
* @see {@link https://all.api.radio-browser.info/#Server_config} for more information on the API endpoint
|
|
406
406
|
* @returns A promise that resolves to the server config
|
|
407
407
|
*/
|
|
408
408
|
public async fetchServerConfig(outputFormat: ObjectOutputFromat = 'json'): Promise<string> {
|
|
@@ -412,7 +412,7 @@ export class RadioBrowserClient {
|
|
|
412
412
|
|
|
413
413
|
/**
|
|
414
414
|
* Fetches server config from the Radio Browser API.
|
|
415
|
-
* @see {@link https://
|
|
415
|
+
* @see {@link https://all.api.radio-browser.info/#Server_config} for more information on the API endpoint
|
|
416
416
|
* @returns A promise that resolves to the server config
|
|
417
417
|
*/
|
|
418
418
|
public async getServerConfig(): Promise<ServerConfig> {
|
|
@@ -422,7 +422,7 @@ export class RadioBrowserClient {
|
|
|
422
422
|
|
|
423
423
|
/**
|
|
424
424
|
* Votes for the station by given UUID.
|
|
425
|
-
* @see {@link https://
|
|
425
|
+
* @see {@link https://all.api.radio-browser.info/#Vote_for_station} for more information on the API endpoint
|
|
426
426
|
* @param stationUUID - The UUID of the station to vote for
|
|
427
427
|
*/
|
|
428
428
|
public async voteForStation(stationUUID: string): Promise<void> {
|
|
@@ -431,7 +431,7 @@ export class RadioBrowserClient {
|
|
|
431
431
|
|
|
432
432
|
/**
|
|
433
433
|
* Logs a click for the station by given UUID.
|
|
434
|
-
* @see {@link https://
|
|
434
|
+
* @see {@link https://all.api.radio-browser.info/#Count_station_click} for more information on the API endpoint
|
|
435
435
|
* @param stationUUID - The UUID of the station for which the click is logged
|
|
436
436
|
*/
|
|
437
437
|
public async click(stationUUID: string): Promise<void> {
|
package/tests/test.ts
CHANGED
|
@@ -36,7 +36,7 @@ describe('main test', () => {
|
|
|
36
36
|
let client: RadioBrowserClient;
|
|
37
37
|
|
|
38
38
|
beforeEach(() => {
|
|
39
|
-
nock('https://
|
|
39
|
+
nock('https://all.api.radio-browser.info').get('/json/servers').reply(200, JsonServers);
|
|
40
40
|
nock('https://fk1.api.radio-browser.info')
|
|
41
41
|
.get('/json/stations/search?order=clickcount&reverse=true&limit=2')
|
|
42
42
|
.reply(200, JsonStationsSearch)
|