@injectivelabs/utils 1.0.14 → 1.0.15
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.
|
@@ -2,7 +2,7 @@ import { AxiosRequestConfig } from 'axios';
|
|
|
2
2
|
export default class HttpClient {
|
|
3
3
|
private readonly client;
|
|
4
4
|
private config;
|
|
5
|
-
constructor(endpoint: string);
|
|
5
|
+
constructor(endpoint: string, options?: Record<string, any>);
|
|
6
6
|
setConfig(config: AxiosRequestConfig): HttpClient;
|
|
7
7
|
get<T, P>(endpoint: string, params?: T): Promise<P>;
|
|
8
8
|
post<T, P>(endpoint: string, data?: T): Promise<P>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpClient.d.ts","sourceRoot":"","sources":["../../src/classes/HttpClient.ts"],"names":[],"mappings":"AAAA,OAAc,EAAiB,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAEhE,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IAEtC,OAAO,CAAC,MAAM,CAAyB;
|
|
1
|
+
{"version":3,"file":"HttpClient.d.ts","sourceRoot":"","sources":["../../src/classes/HttpClient.ts"],"names":[],"mappings":"AAAA,OAAc,EAAiB,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAEhE,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IAEtC,OAAO,CAAC,MAAM,CAAyB;gBAGrC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAI1B;IAUH,SAAS,CAAC,MAAM,EAAE,kBAAkB,GAAG,UAAU;IAMjD,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE,CAAW,GAAG,OAAO,CAAC,CAAC,CAAC;IAI5D,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,GAAE,CAAW,GAAG,OAAO,CAAC,CAAC,CAAC;IAI3D,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE,CAAW,GAAG,OAAO,CAAC,CAAC,CAAC;CAGhE"}
|
|
@@ -5,14 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const axios_1 = __importDefault(require("axios"));
|
|
7
7
|
class HttpClient {
|
|
8
|
-
constructor(endpoint
|
|
8
|
+
constructor(endpoint, options = {
|
|
9
|
+
headers: {
|
|
10
|
+
'Content-Type': 'application/json',
|
|
11
|
+
},
|
|
12
|
+
}) {
|
|
9
13
|
this.config = {};
|
|
10
|
-
this.client = axios_1.default.create({
|
|
11
|
-
baseURL: endpoint,
|
|
12
|
-
headers: {
|
|
13
|
-
'Content-Type': 'application/json',
|
|
14
|
-
},
|
|
15
|
-
});
|
|
14
|
+
this.client = axios_1.default.create(Object.assign({ baseURL: endpoint }, options));
|
|
16
15
|
this.config = {};
|
|
17
16
|
}
|
|
18
17
|
setConfig(config) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpClient.js","sourceRoot":"","sources":["../../src/classes/HttpClient.ts"],"names":[],"mappings":";;;;;AAAA,kDAAgE;AAEhE,MAAqB,UAAU;IAK7B,
|
|
1
|
+
{"version":3,"file":"HttpClient.js","sourceRoot":"","sources":["../../src/classes/HttpClient.ts"],"names":[],"mappings":";;;;;AAAA,kDAAgE;AAEhE,MAAqB,UAAU;IAK7B,YACE,QAAgB,EAChB,UAA+B;QAC7B,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;SACnC;KACF;QARK,WAAM,GAAuB,EAAE,CAAA;QAUrC,IAAI,CAAC,MAAM,GAAG,eAAK,CAAC,MAAM,iBACxB,OAAO,EAAE,QAAQ,IACd,OAAO,EACV,CAAA;QAEF,IAAI,CAAC,MAAM,GAAG,EAAE,CAAA;IAClB,CAAC;IAED,SAAS,CAAC,MAA0B;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QAEpB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,GAAG,CAAO,QAAgB,EAAE,SAAY,EAAO;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,kBAAI,MAAM,IAAK,IAAI,CAAC,MAAM,EAAG,CAAA;IAC9D,CAAC;IAED,IAAI,CAAO,QAAgB,EAAE,OAAU,EAAO;QAC5C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;IACtD,CAAC;IAED,MAAM,CAAO,QAAgB,EAAE,SAAY,EAAO;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,kBAAI,MAAM,IAAK,IAAI,CAAC,MAAM,EAAG,CAAA;IACjE,CAAC;CACF;AAtCD,6BAsCC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/utils",
|
|
3
3
|
"description": "List of utils and helper functions that can be reused throughout Injective's projects.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.15",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Bojan Angjelkoski",
|
|
7
7
|
"email": "bojan@injectivelabs.org"
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"snakecase-keys": "^5.1.2",
|
|
41
41
|
"store2": "^2.12.0"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "554b7c6e44ef563b46b82491cb4757575c51e6c9"
|
|
44
44
|
}
|