glitch-javascript-sdk 0.4.7 → 0.4.8

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.
@@ -3,7 +3,6 @@ import Config from '../config/Config';
3
3
  import Route from '../routes/interface';
4
4
  import Response from './Response';
5
5
  declare class Requests {
6
- private static axiosInstance;
7
6
  private static config;
8
7
  private static baseUrl;
9
8
  private static authToken;
package/dist/index.d.ts CHANGED
@@ -1674,7 +1674,6 @@ interface Route {
1674
1674
  }
1675
1675
 
1676
1676
  declare class Requests {
1677
- private static axiosInstance;
1678
1677
  private static config;
1679
1678
  private static baseUrl;
1680
1679
  private static authToken;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,11 +1,10 @@
1
- import axios, { AxiosInstance, AxiosPromise } from 'axios';
1
+ import axios, { AxiosPromise } from 'axios';
2
2
  import Config from '../config/Config';
3
3
  import HTTP_METHODS from '../constants/HttpMethods';
4
4
  import Route from '../routes/interface';
5
5
  import Response from './Response';
6
6
 
7
7
  class Requests {
8
- private static axiosInstance: AxiosInstance;
9
8
  private static config: Config;
10
9
  private static baseUrl = "";
11
10
  private static authToken = "";
@@ -13,18 +12,10 @@ class Requests {
13
12
 
14
13
  constructor(config: Config) {
15
14
  Requests.config = config;
16
- Requests.axiosInstance = axios.create({
17
- baseURL: Requests.baseUrl,
18
- headers: { 'Content-Type': 'application/json' },
19
- });
20
15
  }
21
16
 
22
17
  public static setBaseUrl(url: string) {
23
18
  Requests.baseUrl = url;
24
-
25
- if(Requests.axiosInstance && Requests.axiosInstance.defaults) {
26
- Requests.axiosInstance.defaults.baseURL = url;
27
- }
28
19
  }
29
20
 
30
21
  public static setAuthToken(token: string) {
@@ -59,7 +50,7 @@ class Requests {
59
50
 
60
51
  const validUri = uri.replace(/\/\//g, '/');
61
52
 
62
- const axiosPromise = Requests.axiosInstance({
53
+ const axiosPromise = axios({
63
54
  method,
64
55
  url: uri,
65
56
  data: fileData || data,