@metarisc/metarisc-js 0.0.1-alpha.7 → 0.0.1-alpha.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.
- package/lib/core.d.ts +3 -0
- package/lib/core.js +2 -1
- package/package.json +1 -1
- package/src/core.ts +3 -1
package/lib/core.d.ts
CHANGED
package/lib/core.js
CHANGED
|
@@ -9,7 +9,8 @@ const axios_retry_1 = __importDefault(require("axios-retry"));
|
|
|
9
9
|
class Core {
|
|
10
10
|
constructor(config) {
|
|
11
11
|
this.axios = axios_1.default.create({
|
|
12
|
-
baseURL: config.metarisc_url ?? 'https://api.metarisc.fr/'
|
|
12
|
+
baseURL: config.metarisc_url ?? 'https://api.metarisc.fr/',
|
|
13
|
+
headers: config.headers ?? {}
|
|
13
14
|
});
|
|
14
15
|
// Axios interceptor : Retry strategy
|
|
15
16
|
(0, axios_retry_1.default)(this.axios, {
|
package/package.json
CHANGED
package/src/core.ts
CHANGED
|
@@ -11,6 +11,7 @@ interface RequestConfig {
|
|
|
11
11
|
|
|
12
12
|
export interface MetariscConfig {
|
|
13
13
|
metarisc_url ?: string;
|
|
14
|
+
headers ?: {[name: string]: string | string[]}
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export class Core
|
|
@@ -20,7 +21,8 @@ export class Core
|
|
|
20
21
|
constructor(config : MetariscConfig)
|
|
21
22
|
{
|
|
22
23
|
this.axios = axios.create({
|
|
23
|
-
baseURL: config.metarisc_url ?? 'https://api.metarisc.fr/'
|
|
24
|
+
baseURL: config.metarisc_url ?? 'https://api.metarisc.fr/',
|
|
25
|
+
headers: config.headers ?? {}
|
|
24
26
|
});
|
|
25
27
|
|
|
26
28
|
// Axios interceptor : Retry strategy
|