radiobrowser-api-client 0.1.1 → 0.1.3
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/dist/client.js +5 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +17 -0
- package/package.json +2 -1
- package/src/client.ts +3 -1
- package/src/index.ts +3 -0
package/dist/client.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.RadioBrowserClient = void 0;
|
|
4
7
|
const axios_1 = require("axios");
|
|
5
8
|
const data_1 = require("./types/data");
|
|
6
9
|
const queries_1 = require("./types/queries");
|
|
7
10
|
const typescript_json_serializer_1 = require("typescript-json-serializer");
|
|
11
|
+
const axios_retry_1 = __importDefault(require("axios-retry"));
|
|
8
12
|
class RadioBrowserClient {
|
|
9
13
|
axios;
|
|
10
14
|
jsonSerializer;
|
|
@@ -17,6 +21,7 @@ class RadioBrowserClient {
|
|
|
17
21
|
this.axios = new axios_1.Axios({
|
|
18
22
|
headers: { 'User-Agent': `${appName}/${appVersion}` },
|
|
19
23
|
});
|
|
24
|
+
(0, axios_retry_1.default)(this.axios, { retries: 3, retryDelay: (retryCount) => retryCount * 100 });
|
|
20
25
|
this.jsonSerializer = new typescript_json_serializer_1.JsonSerializer();
|
|
21
26
|
}
|
|
22
27
|
/**
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.RadioBrowserClient = void 0;
|
|
4
18
|
var client_1 = require("./client");
|
|
5
19
|
Object.defineProperty(exports, "RadioBrowserClient", { enumerable: true, get: function () { return client_1.RadioBrowserClient; } });
|
|
20
|
+
__exportStar(require("./types/data"), exports);
|
|
21
|
+
__exportStar(require("./types/formats"), exports);
|
|
22
|
+
__exportStar(require("./types/queries"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "radiobrowser-api-client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Client for Radio Browser API",
|
|
5
5
|
"homepage": "https://github.com/marioneq4958/radiobrowser-api-client",
|
|
6
6
|
"bugs": {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
26
26
|
"@typescript-eslint/parser": "^7.4.0",
|
|
27
27
|
"axios": "^1.6.8",
|
|
28
|
+
"axios-retry": "^4.1.0",
|
|
28
29
|
"eslint": "^8.57.0",
|
|
29
30
|
"eslint-config-prettier": "^9.1.0",
|
|
30
31
|
"eslint-plugin-prettier": "^5.1.3",
|
package/src/client.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Axios } from 'axios';
|
|
1
|
+
import { Axios, AxiosInstance } from 'axios';
|
|
2
2
|
import {
|
|
3
3
|
Codec,
|
|
4
4
|
Country,
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
} from './types/queries';
|
|
29
29
|
import { ListOutputFormat, ObjectOutputFromat, StationsListOutputFormat } from './types/formats';
|
|
30
30
|
import { JsonSerializer } from 'typescript-json-serializer';
|
|
31
|
+
import axiosRetry from 'axios-retry';
|
|
31
32
|
|
|
32
33
|
export class RadioBrowserClient {
|
|
33
34
|
private readonly axios: Axios;
|
|
@@ -42,6 +43,7 @@ export class RadioBrowserClient {
|
|
|
42
43
|
this.axios = new Axios({
|
|
43
44
|
headers: { 'User-Agent': `${appName}/${appVersion}` },
|
|
44
45
|
});
|
|
46
|
+
axiosRetry(this.axios as AxiosInstance, { retries: 3, retryDelay: (retryCount) => retryCount * 100 });
|
|
45
47
|
this.jsonSerializer = new JsonSerializer();
|
|
46
48
|
}
|
|
47
49
|
|
package/src/index.ts
CHANGED