@metarisc/metarisc-js 0.0.1-alpha.6 → 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 CHANGED
@@ -12,6 +12,9 @@ interface RequestConfig {
12
12
  }
13
13
  export interface MetariscConfig {
14
14
  metarisc_url?: string;
15
+ headers?: {
16
+ [name: string]: string | string[];
17
+ };
15
18
  }
16
19
  export declare class Core {
17
20
  private axios;
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/lib/metarisc.d.ts CHANGED
@@ -1,4 +1,18 @@
1
1
  import { Core, MetariscConfig } from "./core";
2
+ import { DossiersAPI } from "./api/DossiersAPI";
3
+ import { NotificationsAPI } from "./api/NotificationsAPI";
4
+ import { OrganisationAPI } from "./api/OrganisationAPI";
5
+ import { POIAPI } from "./api/POIAPI";
6
+ import { PingAPI } from "./api/PingAPI";
7
+ import { SupportAPI } from "./api/SupportAPI";
8
+ import { UtilisateursAPI } from "./api/UtilisateursAPI";
2
9
  export declare class Metarisc extends Core {
10
+ dossiers?: DossiersAPI;
11
+ notifications?: NotificationsAPI;
12
+ organisations?: OrganisationAPI;
13
+ poi?: POIAPI;
14
+ ping?: PingAPI;
15
+ support?: SupportAPI;
16
+ utilisateurs?: UtilisateursAPI;
3
17
  constructor(config: MetariscConfig);
4
18
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@metarisc/metarisc-js",
3
3
  "main": "lib/index.js",
4
4
  "types": "lib/index.d.ts",
5
- "version": "0.0.1-alpha.6",
5
+ "version": "0.0.1-alpha.8",
6
6
  "scripts": {
7
7
  "lint": "eslint . --ext .ts --fix",
8
8
  "compile": "tsc",
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
package/src/metarisc.ts CHANGED
@@ -15,6 +15,15 @@ import { SupportAPI } from "./api/SupportAPI";
15
15
  import { UtilisateursAPI } from "./api/UtilisateursAPI";
16
16
 
17
17
  export class Metarisc extends Core {
18
+
19
+ public dossiers ?: DossiersAPI;
20
+ public notifications ?: NotificationsAPI;
21
+ public organisations ?: OrganisationAPI;
22
+ public poi ?: POIAPI;
23
+ public ping ?: PingAPI;
24
+ public support ?: SupportAPI;
25
+ public utilisateurs ?: UtilisateursAPI;
26
+
18
27
  constructor(config: MetariscConfig) {
19
28
  super(config);
20
29