radiobrowser-api-client 0.1.3 → 0.1.4

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 CHANGED
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.RadioBrowserClient = void 0;
7
- const axios_1 = require("axios");
7
+ const axios_1 = __importDefault(require("axios"));
8
8
  const data_1 = require("./types/data");
9
9
  const queries_1 = require("./types/queries");
10
10
  const typescript_json_serializer_1 = require("typescript-json-serializer");
@@ -18,8 +18,9 @@ class RadioBrowserClient {
18
18
  * @param appVersion - Version of your application
19
19
  */
20
20
  constructor(appName, appVersion) {
21
- this.axios = new axios_1.Axios({
21
+ this.axios = axios_1.default.create({
22
22
  headers: { 'User-Agent': `${appName}/${appVersion}` },
23
+ transformResponse: [(data) => data],
23
24
  });
24
25
  (0, axios_retry_1.default)(this.axios, { retries: 3, retryDelay: (retryCount) => retryCount * 100 });
25
26
  this.jsonSerializer = new typescript_json_serializer_1.JsonSerializer();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "radiobrowser-api-client",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Client for Radio Browser API",
5
5
  "homepage": "https://github.com/marioneq4958/radiobrowser-api-client",
6
6
  "bugs": {
package/src/client.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Axios, AxiosInstance } from 'axios';
1
+ import axios, { AxiosInstance } from 'axios';
2
2
  import {
3
3
  Codec,
4
4
  Country,
@@ -31,7 +31,7 @@ import { JsonSerializer } from 'typescript-json-serializer';
31
31
  import axiosRetry from 'axios-retry';
32
32
 
33
33
  export class RadioBrowserClient {
34
- private readonly axios: Axios;
34
+ private readonly axios: AxiosInstance;
35
35
  private readonly jsonSerializer: JsonSerializer;
36
36
 
37
37
  /**
@@ -40,10 +40,11 @@ export class RadioBrowserClient {
40
40
  * @param appVersion - Version of your application
41
41
  */
42
42
  constructor(appName: string, appVersion: string) {
43
- this.axios = new Axios({
43
+ this.axios = axios.create({
44
44
  headers: { 'User-Agent': `${appName}/${appVersion}` },
45
+ transformResponse: [(data) => data],
45
46
  });
46
- axiosRetry(this.axios as AxiosInstance, { retries: 3, retryDelay: (retryCount) => retryCount * 100 });
47
+ axiosRetry(this.axios, { retries: 3, retryDelay: (retryCount) => retryCount * 100 });
47
48
  this.jsonSerializer = new JsonSerializer();
48
49
  }
49
50