@abyss-project/spotlight 1.0.1 → 1.0.3

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,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.activateUserServiceAbyssAdmin = void 0;
4
4
  const __1 = require("..");
5
5
  const activateUserServiceAbyssAdmin = async (body) => {
6
- return (await __1.AbyssBankingCore.axios.post(`abyss/admin/user/activate-service`, body)).data;
6
+ return (await __1.AbyssSpotlightCore.axios.post(`abyss/admin/user/activate-service`, body)).data;
7
7
  };
8
8
  exports.activateUserServiceAbyssAdmin = activateUserServiceAbyssAdmin;
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.upMonitor = void 0;
4
4
  const __1 = require("..");
5
5
  const upMonitor = async () => {
6
- return (await __1.AbyssBankingCore.axios.get(`monitor/up`)).data;
6
+ return (await __1.AbyssSpotlightCore.axios.get(`monitor/up`)).data;
7
7
  };
8
8
  exports.upMonitor = upMonitor;
@@ -3,21 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateUserAdmin = exports.paginateUserAdmin = exports.resetApiKeyUserAdmin = exports.getUserAdmin = void 0;
4
4
  const __1 = require("..");
5
5
  const getUserAdmin = async (params) => {
6
- return (await __1.AbyssBankingCore.axios.get(`user/admin/${params.userId}`))
6
+ return (await __1.AbyssSpotlightCore.axios.get(`user/admin/${params.userId}`))
7
7
  .data;
8
8
  };
9
9
  exports.getUserAdmin = getUserAdmin;
10
10
  const resetApiKeyUserAdmin = async (params) => {
11
- return (await __1.AbyssBankingCore.axios.post(`user/admin/${params.userId}`)).data;
11
+ return (await __1.AbyssSpotlightCore.axios.post(`user/admin/${params.userId}`)).data;
12
12
  };
13
13
  exports.resetApiKeyUserAdmin = resetApiKeyUserAdmin;
14
14
  const paginateUserAdmin = async (query) => {
15
- return (await __1.AbyssBankingCore.axios.get(`user/admin/paginate`, {
15
+ return (await __1.AbyssSpotlightCore.axios.get(`user/admin/paginate`, {
16
16
  params: query,
17
17
  })).data;
18
18
  };
19
19
  exports.paginateUserAdmin = paginateUserAdmin;
20
20
  const updateUserAdmin = async (params, body) => {
21
- return (await __1.AbyssBankingCore.axios.put(`user/admin/${params.userId}`, body)).data;
21
+ return (await __1.AbyssSpotlightCore.axios.put(`user/admin/${params.userId}`, body)).data;
22
22
  };
23
23
  exports.updateUserAdmin = updateUserAdmin;
@@ -3,15 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resetApiKeyUser = exports.updateUser = exports.meUser = void 0;
4
4
  const __1 = require("..");
5
5
  const meUser = async () => {
6
- return (await __1.AbyssBankingCore.axios.get(`user/me`)).data;
6
+ return (await __1.AbyssSpotlightCore.axios.get(`user/me`)).data;
7
7
  };
8
8
  exports.meUser = meUser;
9
9
  const updateUser = async (body) => {
10
- return (await __1.AbyssBankingCore.axios.put(`user/me`, body)).data;
10
+ return (await __1.AbyssSpotlightCore.axios.put(`user/me`, body)).data;
11
11
  };
12
12
  exports.updateUser = updateUser;
13
13
  const resetApiKeyUser = async () => {
14
- return (await __1.AbyssBankingCore.axios.post(`user/me/reset-api-key`))
14
+ return (await __1.AbyssSpotlightCore.axios.post(`user/me/reset-api-key`))
15
15
  .data;
16
16
  };
17
17
  exports.resetApiKeyUser = resetApiKeyUser;
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { IAxiosRetryConfig } from 'axios-retry';
2
2
  export * from './types';
3
3
  export * from './utils';
4
4
  export * from './api';
5
- export declare const API_KEY_HEADER = "abyss-banking-api-key";
5
+ export declare const API_KEY_HEADER = "abyss-spotlight-api-key";
6
6
  export declare const ADMIN_TOKEN_HEADER = "abyss-admin-token";
7
7
  declare type CoreConfig = {
8
8
  token?: string;
@@ -10,7 +10,7 @@ declare type CoreConfig = {
10
10
  adminToken?: string;
11
11
  baseURL?: string;
12
12
  };
13
- export declare class AbyssBankingCore {
13
+ export declare class AbyssSpotlightCore {
14
14
  private static config;
15
15
  static axios: import("axios").AxiosInstance;
16
16
  static enableAxiosRetry(axiosRetryConfig?: IAxiosRetryConfig): void;
package/dist/index.js CHANGED
@@ -25,14 +25,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
25
25
  return (mod && mod.__esModule) ? mod : { "default": mod };
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.AbyssBankingCore = exports.ADMIN_TOKEN_HEADER = exports.API_KEY_HEADER = void 0;
28
+ exports.AbyssSpotlightCore = exports.ADMIN_TOKEN_HEADER = exports.API_KEY_HEADER = void 0;
29
29
  const axios_1 = __importDefault(require("axios"));
30
30
  const axios_retry_1 = __importStar(require("axios-retry"));
31
31
  __exportStar(require("./types"), exports);
32
32
  __exportStar(require("./utils"), exports);
33
33
  __exportStar(require("./api"), exports);
34
- const DEFAULT_BASE_URL = 'https://banking-api.abyss-project.fr/api/';
35
- exports.API_KEY_HEADER = 'abyss-banking-api-key';
34
+ const DEFAULT_BASE_URL = 'https://spotlight-api.abyss-project.fr/api/';
35
+ exports.API_KEY_HEADER = 'abyss-spotlight-api-key';
36
36
  exports.ADMIN_TOKEN_HEADER = 'abyss-admin-token';
37
37
  const NUMBER_RETRY_API = 10;
38
38
  const BASE_DELAY_BETWEEN_RETRY = 5000;
@@ -40,9 +40,9 @@ const RETRY_CODES = [
40
40
  502,
41
41
  503,
42
42
  ];
43
- class AbyssBankingCore {
43
+ class AbyssSpotlightCore {
44
44
  static enableAxiosRetry(axiosRetryConfig) {
45
- (0, axios_retry_1.default)(AbyssBankingCore.axios, {
45
+ (0, axios_retry_1.default)(AbyssSpotlightCore.axios, {
46
46
  retries: NUMBER_RETRY_API,
47
47
  retryDelay: (retryCount) => retryCount * BASE_DELAY_BETWEEN_RETRY,
48
48
  retryCondition: (error) => {
@@ -54,26 +54,26 @@ class AbyssBankingCore {
54
54
  });
55
55
  }
56
56
  static setConfig(config) {
57
- AbyssBankingCore.config = { ...AbyssBankingCore.config, ...config };
57
+ AbyssSpotlightCore.config = { ...AbyssSpotlightCore.config, ...config };
58
58
  if (config.baseURL) {
59
- AbyssBankingCore.axios.defaults.baseURL = config.baseURL;
59
+ AbyssSpotlightCore.axios.defaults.baseURL = config.baseURL;
60
60
  }
61
61
  if (config.token) {
62
- AbyssBankingCore.axios.defaults.headers.common.Authorization = `Bearer ${config.token}`;
62
+ AbyssSpotlightCore.axios.defaults.headers.common.Authorization = `Bearer ${config.token}`;
63
63
  }
64
64
  if (config.apiKey) {
65
- AbyssBankingCore.axios.defaults.headers.common[exports.API_KEY_HEADER] = `${config.apiKey}`;
65
+ AbyssSpotlightCore.axios.defaults.headers.common[exports.API_KEY_HEADER] = `${config.apiKey}`;
66
66
  }
67
67
  if (config.adminToken) {
68
- AbyssBankingCore.axios.defaults.headers.common[exports.ADMIN_TOKEN_HEADER] = `${config.adminToken}`;
68
+ AbyssSpotlightCore.axios.defaults.headers.common[exports.ADMIN_TOKEN_HEADER] = `${config.adminToken}`;
69
69
  }
70
70
  }
71
71
  static getConfig() {
72
- return AbyssBankingCore.config;
72
+ return AbyssSpotlightCore.config;
73
73
  }
74
74
  }
75
- exports.AbyssBankingCore = AbyssBankingCore;
76
- AbyssBankingCore.config = {
75
+ exports.AbyssSpotlightCore = AbyssSpotlightCore;
76
+ AbyssSpotlightCore.config = {
77
77
  token: '',
78
78
  apiKey: '',
79
79
  apiKeyApplication: '',
@@ -81,4 +81,4 @@ AbyssBankingCore.config = {
81
81
  adminToken: '',
82
82
  baseURL: DEFAULT_BASE_URL,
83
83
  };
84
- AbyssBankingCore.axios = axios_1.default.create({ baseURL: `` });
84
+ AbyssSpotlightCore.axios = axios_1.default.create({ baseURL: `` });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyss-project/spotlight",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Core package to interact with Abyss-Spotlight",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",