@xrystal/core 3.22.1 → 3.22.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Yusuf Yasir KAYGUSUZ",
3
3
  "name": "@xrystal/core",
4
- "version": "3.22.1",
4
+ "version": "3.22.2",
5
5
  "description": "Project core for xrystal",
6
6
  "publishConfig": {
7
7
  "access": "public",
@@ -1,10 +1,10 @@
1
- import { IService } from "../../utils";
2
- import ConfigsService from "../configs";
3
- export default class ClientsService implements IService<any> {
1
+ import { IProvide } from "../../utils";
2
+ import Configs from "../configs";
3
+ export default class Clients implements IProvide<any> {
4
4
  #private;
5
5
  private _instances;
6
- constructor({ configsService }: {
7
- configsService: ConfigsService;
6
+ constructor({ configs }: {
7
+ configs: Configs;
8
8
  });
9
9
  onInit(): Promise<void>;
10
10
  get instances(): Record<string, any>;
@@ -1,16 +1,16 @@
1
- import { BaseApiClient, CoreServiceEnum } from "../../utils";
2
- export default class ClientsService {
1
+ import { BaseApiClient, CoreClientsEnum } from "../../utils";
2
+ export default class Clients {
3
3
  _instances = {};
4
- #configsService;
5
- constructor({ configsService }) {
6
- this.#configsService = configsService;
4
+ #configs;
5
+ constructor({ configs }) {
6
+ this.#configs = configs;
7
7
  }
8
8
  async onInit() {
9
9
  const baseClient = new BaseApiClient({
10
- clientName: CoreServiceEnum.BASE_API_CLIENT,
11
- baseURL: this.#configsService.all.baseApiUri || ''
10
+ clientName: CoreClientsEnum.BASE_API_CLIENT,
11
+ baseURL: this.#configs.all.baseApiUri || ''
12
12
  });
13
- this._instances[CoreServiceEnum.BASE_API_CLIENT] = baseClient;
13
+ this._instances[CoreClientsEnum.BASE_API_CLIENT] = baseClient;
14
14
  }
15
15
  get instances() {
16
16
  return this._instances;
@@ -1,5 +1,5 @@
1
- import SystemService from '../system/index';
2
- import { IService, ModeEnum } from '../../utils';
1
+ import System from '../system/index';
2
+ import { IProvide, ModeEnum } from '../../utils';
3
3
  export interface IConfig {
4
4
  worker: boolean;
5
5
  mode: ModeEnum;
@@ -28,14 +28,14 @@ export interface IConfig {
28
28
  cwd: string;
29
29
  env: string;
30
30
  }
31
- export interface IConfigsService extends IConfig {
31
+ export interface IConfigs extends IConfig {
32
32
  }
33
- export default class ConfigsService implements IService<any> {
33
+ export default class Configs implements IProvide<any> {
34
34
  #private;
35
35
  readonly publicFolderName: string;
36
36
  readonly kafkaLogsTopic: string;
37
37
  constructor({ systemService }: {
38
- systemService: SystemService;
38
+ systemService: System;
39
39
  });
40
40
  onInit: ({}: {}) => Promise<void>;
41
41
  private initializeKafkaInfrastructure;
@@ -3,7 +3,7 @@ import { merge } from 'lodash';
3
3
  import { pathToFileURL } from 'node:url';
4
4
  import { Kafka, logLevel } from 'kafkajs';
5
5
  import { Constants } from '../../utils';
6
- export default class ConfigsService {
6
+ export default class Configs {
7
7
  publicFolderName = Constants.publicFolderName;
8
8
  kafkaLogsTopic = Constants.kafkaLogsTopic;
9
9
  #systemService;
@@ -45,7 +45,9 @@ export default class ConfigsService {
45
45
  systemLoggerLayer: process.env.SYSTEM_LOGGER_LAYER,
46
46
  isKafkaPassive: process.env.IS_KAFKA_PASSIVE === 'true' ? true : false,
47
47
  kafkaBrokers: process.env?.KAFKA_BROKERS,
48
- kafkaTopics: [],
48
+ kafkaTopics: [
49
+ this.kafkaLogsTopic,
50
+ ],
49
51
  kafkaLogsTopic: this.kafkaLogsTopic,
50
52
  baseApiUri: process.env.HTTPS === 'true' ? process.env.SYSTEM_HTTPS_BASE_API_URI : process.env.SYSTEM_BASE_API_URI,
51
53
  port: Number(process.env.PORT),
@@ -71,7 +73,6 @@ export default class ConfigsService {
71
73
  kafkaBrokers: process.env?.KAFKA_BROKERS,
72
74
  kafkaTopics: [
73
75
  ...new Set([
74
- Constants.kafkaLogsTopic,
75
76
  ...this.#config.kafkaTopics
76
77
  ])
77
78
  ],
@@ -1,7 +1,7 @@
1
1
  import { AsyncLocalStorage } from 'node:async_hooks';
2
- import LoggerService from '../logger';
3
- import SystemService from '../system';
4
- import { IService, ProtocolEnum } from '../../utils/index';
2
+ import Logger from '../logger';
3
+ import System from '../system';
4
+ import { IProvide, ProtocolEnum } from '../../utils/index';
5
5
  export declare const controllerContextStorage: AsyncLocalStorage<{
6
6
  protocol?: ProtocolEnum;
7
7
  ctx?: any;
@@ -26,9 +26,9 @@ export declare const getControllerCtx: () => {
26
26
  _isRaw?: boolean;
27
27
  };
28
28
  };
29
- export declare abstract class Controller {
30
- protected systemService: SystemService;
31
- protected loggerService: LoggerService;
29
+ export declare abstract class BaseController {
30
+ protected system: System;
31
+ protected logger: Logger;
32
32
  protected supportedProtocols: ProtocolEnum[];
33
33
  protected get protocol(): ProtocolEnum;
34
34
  protected get currentStore(): {
@@ -46,7 +46,7 @@ export declare abstract class Controller {
46
46
  protected get req(): CustomRequest;
47
47
  protected get res(): CustomResponse;
48
48
  }
49
- export declare abstract class ControllerService extends Controller implements IService<any> {
49
+ export default abstract class Controller extends BaseController implements IProvide<any> {
50
50
  constructor({}: {});
51
51
  onInit(): Promise<void>;
52
52
  schema({ checks, logic, response }: {
@@ -1,12 +1,12 @@
1
1
  import { AsyncLocalStorage } from 'node:async_hooks';
2
- import LoggerService from '../logger';
3
- import SystemService from '../system';
2
+ import Logger from '../logger';
3
+ import System from '../system';
4
4
  import { LoggerLayerEnum, ProtocolEnum, responseMessageHelper, ResponseSchema, x } from '../../utils/index';
5
5
  export const controllerContextStorage = new AsyncLocalStorage();
6
6
  export const getControllerCtx = () => controllerContextStorage.getStore();
7
- export class Controller {
8
- systemService = x.get(SystemService);
9
- loggerService = x.get(LoggerService);
7
+ export class BaseController {
8
+ system = x.get(System);
9
+ logger = x.get(Logger);
10
10
  supportedProtocols = [ProtocolEnum.HTTP, ProtocolEnum.WEBSOCKET];
11
11
  get protocol() {
12
12
  return this.currentStore?.protocol || ProtocolEnum.HTTP;
@@ -73,12 +73,12 @@ export class Controller {
73
73
  };
74
74
  }
75
75
  }
76
- export class ControllerService extends Controller {
76
+ export default class Controller extends BaseController {
77
77
  constructor({}) {
78
78
  super();
79
79
  }
80
80
  async onInit() {
81
- const protocols = this.systemService?.tmp?.configs?.loaders?.controller?.protocols;
81
+ const protocols = this.system?.tmp?.configs?.loaders?.controller?.protocols;
82
82
  this.supportedProtocols = Array.isArray(protocols) ? protocols : [protocols || ProtocolEnum.HTTP];
83
83
  }
84
84
  async schema({ checks, logic, response }) {
@@ -149,16 +149,15 @@ export class ControllerService extends Controller {
149
149
  }
150
150
  }
151
151
  const successCode = this.currentStore?.metadata?._code || 200;
152
- // Sıralama güncellendi: Code en alta alındı
153
152
  return currentRes.status(successCode).send(new ResponseSchema({
154
153
  status: true,
155
154
  message: finalMessage,
156
- payload: finalPayload,
155
+ ...(finalPayload && { payload: finalPayload }),
157
156
  code: successCode
158
157
  }).getResponse);
159
158
  }
160
159
  catch (error) {
161
- this.loggerService?.log(LoggerLayerEnum.ERROR, `Controller Error: ${error.message}`);
160
+ this.logger?.log(LoggerLayerEnum.ERROR, `Controller Error: ${error.message}`);
162
161
  return this.res.status(500).send(new ResponseSchema({
163
162
  status: false,
164
163
  message: error.message,
@@ -1,12 +1,12 @@
1
- import { IService } from '../../utils/index';
2
- import LoggerService from '../logger/index';
3
- export default class EventsService implements IService<any> {
1
+ import Logger from '../logger';
2
+ import { IProvide } from '../../utils/index';
3
+ export default class Events implements IProvide<any> {
4
4
  #private;
5
- constructor({ loggerService }: {
6
- loggerService: LoggerService;
5
+ constructor({ logger }: {
6
+ logger: Logger;
7
7
  });
8
8
  onInit: ({}: {
9
- logger: LoggerService;
9
+ logger: Logger;
10
10
  }) => any;
11
11
  private _globalLoader;
12
12
  private _DILoader;
@@ -1,8 +1,8 @@
1
1
  import { LoggerLayerEnum, x } from '../../utils/index';
2
- export default class EventsService {
3
- #loggerService;
4
- constructor({ loggerService }) {
5
- this.#loggerService = loggerService;
2
+ export default class Events {
3
+ #logger;
4
+ constructor({ logger }) {
5
+ this.#logger = logger;
6
6
  }
7
7
  onInit = ({}) => {
8
8
  this._globalLoader();
@@ -10,7 +10,7 @@ export default class EventsService {
10
10
  };
11
11
  _globalLoader = () => {
12
12
  process.on("uncaughtException", (error, origin) => {
13
- this.#loggerService.log({
13
+ this.#logger.log({
14
14
  level: LoggerLayerEnum.CRITICAL,
15
15
  message: `Uncaught Exception: ${error.message}`,
16
16
  payload: {
@@ -21,7 +21,7 @@ export default class EventsService {
21
21
  });
22
22
  process.on("unhandledRejection", (reason, promise) => {
23
23
  const error = reason instanceof Error ? reason : new Error(String(reason));
24
- this.#loggerService.log({
24
+ this.#logger.log({
25
25
  level: LoggerLayerEnum.CRITICAL,
26
26
  message: `Unhandled Rejection: ${error.message}`,
27
27
  payload: {
@@ -1,8 +1,9 @@
1
- import SystemService from "./system";
2
- import ConfigsService from "./configs";
3
- import LoggerService from "./logger";
4
- import EventsService from "./events";
5
- import LocalizationsService from "./localizations";
6
- import { ControllerService } from "./controller";
7
- import ClientsService from "./clients";
8
- export { SystemService, ConfigsService, LoggerService, EventsService, LocalizationsService, ControllerService, ClientsService };
1
+ import System from "./system";
2
+ import Configs from "./configs";
3
+ import Logger from "./logger";
4
+ import Events from "./events";
5
+ import Localizations from "./localizations";
6
+ import Controller from "./controller";
7
+ import Service from "./service";
8
+ import Clients from "./clients";
9
+ export { System, Configs, Logger, Events, Localizations, Controller, Service, Clients };
@@ -1,8 +1,9 @@
1
- import SystemService from "./system";
2
- import ConfigsService from "./configs";
3
- import LoggerService from "./logger";
4
- import EventsService from "./events";
5
- import LocalizationsService from "./localizations";
6
- import { ControllerService } from "./controller";
7
- import ClientsService from "./clients";
8
- export { SystemService, ConfigsService, LoggerService, EventsService, LocalizationsService, ControllerService, ClientsService };
1
+ import System from "./system";
2
+ import Configs from "./configs";
3
+ import Logger from "./logger";
4
+ import Events from "./events";
5
+ import Localizations from "./localizations";
6
+ import Controller from "./controller";
7
+ import Service from "./service";
8
+ import Clients from "./clients";
9
+ export { System, Configs, Logger, Events, Localizations, Controller, Service, Clients };
@@ -1,12 +1,12 @@
1
- import ConfigsService from "../configs";
2
- import { IService } from "../../utils";
3
- import SystemService from "../system";
4
- export default class LocalizationsService implements IService<any> {
1
+ import Configs from "../configs";
2
+ import System from "../system";
3
+ import { IProvide } from "../../utils";
4
+ export default class Localizations implements IProvide<any> {
5
5
  #private;
6
6
  _instance: any;
7
- constructor({ systemService, configsService, }: {
8
- systemService: SystemService;
9
- configsService: ConfigsService;
7
+ constructor({ system, configs, }: {
8
+ system: System;
9
+ configs: Configs;
10
10
  });
11
11
  onInit: ({}: {}) => any;
12
12
  i18next: ({ loadPath, fallbackLang, preloadLang, }: {
@@ -2,18 +2,18 @@ import path from "path";
2
2
  import i18next from "i18next";
3
3
  import Backend from 'i18next-fs-backend';
4
4
  import * as middleware from 'i18next-http-middleware';
5
- export default class LocalizationsService {
5
+ export default class Localizations {
6
6
  _instance = null;
7
- #systemService;
8
- #configsService;
9
- constructor({ systemService, configsService, }) {
10
- this.#systemService = systemService;
11
- this.#configsService = configsService;
7
+ #system;
8
+ #configs;
9
+ constructor({ system, configs, }) {
10
+ this.#system = system;
11
+ this.#configs = configs;
12
12
  }
13
13
  onInit = ({}) => {
14
- const localization = this.#systemService.tmp.configs.loaders.localization;
14
+ const localization = this.#system.tmp.configs.loaders.localization;
15
15
  this.i18next({
16
- loadPath: path.join(this.#systemService.tmp.configs.rootFolderPath, localization.loadPath),
16
+ loadPath: path.join(this.#system.tmp.configs.rootFolderPath, localization.loadPath),
17
17
  fallbackLang: localization.fallbackLang,
18
18
  preloadLang: localization.preloadLangs,
19
19
  });
@@ -1,10 +1,10 @@
1
1
  import winston from "winston";
2
2
  import "winston-daily-rotate-file";
3
3
  import { AsyncLocalStorage } from "node:async_hooks";
4
- import SystemService from "../system";
5
- import ConfigsService from "../configs";
4
+ import System from "../system";
5
+ import Configs from "../configs";
6
6
  import { LoggerLayerEnum } from '../../utils/models/enums/index';
7
- import { IService } from "../../utils";
7
+ import { IProvide } from "../../utils";
8
8
  export interface ICustomLogger extends winston.Logger {
9
9
  critical: winston.LeveledLogMethod;
10
10
  http: winston.LeveledLogMethod;
@@ -15,7 +15,7 @@ export interface ILog {
15
15
  payload?: any;
16
16
  code?: string | number;
17
17
  }
18
- export default class LoggerService implements IService<any> {
18
+ export default class Logger implements IProvide<any> {
19
19
  #private;
20
20
  static readonly storage: AsyncLocalStorage<Map<string, string>>;
21
21
  private serviceName;
@@ -23,9 +23,9 @@ export default class LoggerService implements IService<any> {
23
23
  private kafkaLogsTopic;
24
24
  private isKafkaReady;
25
25
  winston: ICustomLogger;
26
- constructor({ systemService, configsService }: {
27
- systemService: SystemService;
28
- configsService: ConfigsService;
26
+ constructor({ system, configs }: {
27
+ system: System;
28
+ configs: Configs;
29
29
  });
30
30
  onInit: () => Promise<void>;
31
31
  winstonLoader: ({ loadPath, loggerLevel }: {
@@ -31,31 +31,31 @@ const customColors = {
31
31
  http: "cyan",
32
32
  debug: "blue"
33
33
  };
34
- export default class LoggerService {
34
+ export default class Logger {
35
35
  static storage = new AsyncLocalStorage();
36
36
  serviceName = "";
37
37
  kafkaProducer = null;
38
38
  kafkaLogsTopic = "";
39
39
  isKafkaReady = false;
40
40
  winston;
41
- #systemService;
42
- #configsService;
43
- constructor({ systemService, configsService }) {
44
- this.#systemService = systemService;
45
- this.#configsService = configsService;
41
+ #system;
42
+ #configs;
43
+ constructor({ system, configs }) {
44
+ this.#system = system;
45
+ this.#configs = configs;
46
46
  }
47
47
  onInit = async () => {
48
- this.serviceName = this.#systemService?.tmp?.configs?.service;
49
- this.kafkaLogsTopic = this.#configsService?.all?.kafkaLogsTopic;
48
+ this.serviceName = this.#system?.tmp?.configs?.service;
49
+ this.kafkaLogsTopic = this.#configs?.all?.kafkaLogsTopic;
50
50
  winston.addColors(customColors);
51
51
  this.winston = winston.createLogger({
52
- level: this.#configsService?.all?.systemLoggerLayer || 'info',
52
+ level: this.#configs?.all?.systemLoggerLayer || 'info',
53
53
  levels: customLevels,
54
54
  format: this.getConsoleFormat(),
55
55
  transports: [new winston.transports.Console()]
56
56
  });
57
- const loggersConfigs = this.#systemService?.tmp?.configs?.loaders?.loggers;
58
- const { kafkaBrokers, isKafkaPassive } = this.#configsService.all;
57
+ const loggersConfigs = this.#system?.tmp?.configs?.loaders?.loggers;
58
+ const { kafkaBrokers, isKafkaPassive } = this.#configs.all;
59
59
  const brokers = kafkaBrokers ? String(kafkaBrokers).split(",").map((b) => b.trim()) : [];
60
60
  const isKafkaEnabled = isKafkaPassive === false && brokers.length > 0;
61
61
  if (isKafkaEnabled) {
@@ -79,7 +79,7 @@ export default class LoggerService {
79
79
  const logPath = loggersConfigs?.loadPath || "logs";
80
80
  const loggerLevel = loggersConfigs?.loggerLevel || "info";
81
81
  this.winstonLoader({
82
- loadPath: path.join(this.#configsService.all.rootFolderPath, logPath),
82
+ loadPath: path.join(this.#configs.all.rootFolderPath, logPath),
83
83
  loggerLevel: loggerLevel
84
84
  });
85
85
  };
@@ -125,7 +125,7 @@ export default class LoggerService {
125
125
  return value;
126
126
  };
127
127
  getTracingFormat = format((info) => {
128
- const store = LoggerService.storage.getStore();
128
+ const store = Logger.storage.getStore();
129
129
  if (store && store.has("correlationId")) {
130
130
  info.id = store.get("correlationId");
131
131
  }
@@ -145,7 +145,7 @@ export default class LoggerService {
145
145
  runWithId = (id, callback) => {
146
146
  const store = new Map();
147
147
  store.set("correlationId", id);
148
- return LoggerService.storage.run(store, callback);
148
+ return Logger.storage.run(store, callback);
149
149
  };
150
150
  async logToKafka(info) {
151
151
  if (!this.kafkaProducer || !this.isKafkaReady)
@@ -163,7 +163,7 @@ export default class LoggerService {
163
163
  code,
164
164
  timestamp: new Date().toISOString(),
165
165
  id: id || null,
166
- env: this.#configsService.all.env
166
+ env: this.#configs.all.env
167
167
  }, this.safeReplacer)
168
168
  }],
169
169
  acks: 1
@@ -0,0 +1,12 @@
1
+ import Logger from '../logger';
2
+ import System from '../system';
3
+ import { IProvide } from '../../utils';
4
+ export declare abstract class BaseService {
5
+ protected system: System;
6
+ protected logger: Logger;
7
+ constructor();
8
+ }
9
+ export default abstract class Service extends BaseService implements IProvide<any> {
10
+ constructor({}: {});
11
+ onInit(): Promise<void>;
12
+ }
@@ -0,0 +1,16 @@
1
+ import Logger from '../logger';
2
+ import System from '../system';
3
+ import { x } from '../../utils';
4
+ export class BaseService {
5
+ system = x.get(System);
6
+ logger = x.get(Logger);
7
+ constructor() {
8
+ }
9
+ }
10
+ export default class Service extends BaseService {
11
+ constructor({}) {
12
+ super();
13
+ }
14
+ async onInit() {
15
+ }
16
+ }
@@ -1,5 +1,5 @@
1
- import { IService } from "../../utils";
2
- export default class SystemService implements IService<any> {
1
+ import { IProvide } from "../../utils";
2
+ export default class System implements IProvide<any> {
3
3
  protected _core: Record<string, any>;
4
4
  protected _tmp: Record<string, any>;
5
5
  cwd: string;
@@ -1,4 +1,4 @@
1
- export default class SystemService {
1
+ export default class System {
2
2
  _core = {};
3
3
  _tmp = {};
4
4
  cwd = process.cwd();
@@ -1,5 +1,5 @@
1
1
  import path from 'path';
2
- import { SystemService, ConfigsService, LoggerService, EventsService, LocalizationsService, ClientsService, ControllerService } from '../loader';
2
+ import { System, Configs, Logger, Events, Localizations, Clients, Controller } from '../loader';
3
3
  import { Constants, getCore, x, } from '../utils';
4
4
  //
5
5
  export const core = getCore();
@@ -22,33 +22,33 @@ const coreLoader = async ({}) => {
22
22
  }))
23
23
  .initialize([
24
24
  {
25
- service: SystemService,
25
+ service: System,
26
26
  props: {
27
27
  core
28
28
  }
29
29
  },
30
30
  {
31
- service: ConfigsService,
31
+ service: Configs,
32
32
  props: {}
33
33
  },
34
34
  {
35
- service: LoggerService,
35
+ service: Logger,
36
36
  props: {}
37
37
  },
38
38
  {
39
- service: EventsService,
39
+ service: Events,
40
40
  props: {}
41
41
  },
42
42
  {
43
- service: LocalizationsService,
43
+ service: Localizations,
44
44
  props: {}
45
45
  },
46
46
  {
47
- service: ControllerService,
47
+ service: Controller,
48
48
  props: {}
49
49
  },
50
50
  {
51
- service: ClientsService,
51
+ service: Clients,
52
52
  props: {}
53
53
  },
54
54
  ]);
@@ -3,5 +3,5 @@ export declare abstract class ILifeCycle<T = any> {
3
3
  onAfterInit?(_context?: any): Promise<void> | void;
4
4
  onDispose?(_context?: any): Promise<void> | void;
5
5
  }
6
- export declare abstract class IService<T = any> extends ILifeCycle<T> {
6
+ export declare abstract class IProvide<T = any> extends ILifeCycle<T> {
7
7
  }
@@ -6,5 +6,5 @@ export class ILifeCycle {
6
6
  onDispose(_context) {
7
7
  }
8
8
  }
9
- export class IService extends ILifeCycle {
9
+ export class IProvide extends ILifeCycle {
10
10
  }
@@ -10,8 +10,8 @@ export declare class ClientStore {
10
10
  static set(clientName: string, data: Record<string, any>): void;
11
11
  }
12
12
  export declare abstract class Client {
13
- protected loggerService: any;
14
- protected configsService: any;
13
+ protected logger: any;
14
+ protected configs: any;
15
15
  clientName: string;
16
16
  protected baseURL: string;
17
17
  protected version: string | null;
@@ -1,6 +1,6 @@
1
1
  import { createHash, createHmac } from 'node:crypto';
2
2
  import soap from 'soap';
3
- import { ConfigsService, LoggerService } from '../../../loader';
3
+ import { Configs, Logger } from '../../../loader';
4
4
  import { LoggerLayerEnum, x } from '../../index';
5
5
  export class ClientStore {
6
6
  static _store = {};
@@ -10,13 +10,13 @@ export class ClientStore {
10
10
  }
11
11
  }
12
12
  export class Client {
13
- loggerService = x.get(LoggerService);
14
- configsService = x.get(ConfigsService);
13
+ logger = x.get(Logger);
14
+ configs = x.get(Configs);
15
15
  clientName;
16
16
  baseURL;
17
17
  version = null;
18
18
  timeout = 15000;
19
- debug = Number(this.configsService.all.debug) >= LoggerLayerEnum.DEBUG;
19
+ debug = Number(this.configs.all.debug) >= LoggerLayerEnum.DEBUG;
20
20
  authConfigs;
21
21
  breaker = {
22
22
  failures: 0,
@@ -88,13 +88,13 @@ export class BaseApiClient extends Client {
88
88
  const activeVersion = options.version !== undefined ? options.version : this.version;
89
89
  const ver = activeVersion ? `/${activeVersion.replace(/^\//, '')}` : '';
90
90
  const url = `${base}${ver}${path}`;
91
- const store = LoggerService.storage.getStore();
91
+ const store = Logger.storage.getStore();
92
92
  const correlationId = store?.get('correlationId');
93
93
  const headers = new Headers(options.headers || {});
94
94
  headers.set('Content-Type', 'application/json');
95
95
  if (correlationId)
96
96
  headers.set('x-correlation-id', correlationId);
97
- const systemSecret = this.configsService.all.internalSecret || process.env.INTERNAL_SECRET;
97
+ const systemSecret = this.configs.all.internalSecret || process.env.INTERNAL_SECRET;
98
98
  if (systemSecret) {
99
99
  const timestamp = Date.now().toString();
100
100
  const signature = createHmac('sha256', systemSecret)
@@ -116,7 +116,7 @@ export class BaseApiClient extends Client {
116
116
  headers: Object.fromEntries(headers.entries()),
117
117
  body: options.body
118
118
  };
119
- this.loggerService.winston.info(`${this.clientName} Request Details: ${JSON.stringify(logPayload, null, 2)}`);
119
+ this.logger.winston.info(`${this.clientName} Request Details: ${JSON.stringify(logPayload, null, 2)}`);
120
120
  }
121
121
  const controller = new AbortController();
122
122
  const timeoutId = setTimeout(() => controller.abort(), this.timeout);
@@ -189,7 +189,7 @@ export class SoapClient extends Client {
189
189
  return result[0];
190
190
  }
191
191
  catch (error) {
192
- this.loggerService.winston.error(`${this.clientName} SOAP Error: ${error.message}`);
192
+ this.logger.winston.error(`${this.clientName} SOAP Error: ${error.message}`);
193
193
  return null;
194
194
  }
195
195
  }
@@ -88,7 +88,7 @@ export declare enum TokensEnum {
88
88
  REFERENCE_TOKEN = "reference_token",
89
89
  PERSONAL_ACCESS_TOKEN = "personal_access_token"
90
90
  }
91
- export declare enum CoreServiceEnum {
91
+ export declare enum CoreClientsEnum {
92
92
  BASE_API_CLIENT = "base_client_name",
93
93
  SOAP_API_CLIENT = "soap_api_client"
94
94
  }
@@ -104,11 +104,11 @@ export var TokensEnum;
104
104
  TokensEnum["REFERENCE_TOKEN"] = "reference_token";
105
105
  TokensEnum["PERSONAL_ACCESS_TOKEN"] = "personal_access_token";
106
106
  })(TokensEnum || (TokensEnum = {}));
107
- export var CoreServiceEnum;
108
- (function (CoreServiceEnum) {
109
- CoreServiceEnum["BASE_API_CLIENT"] = "base_client_name";
110
- CoreServiceEnum["SOAP_API_CLIENT"] = "soap_api_client";
111
- })(CoreServiceEnum || (CoreServiceEnum = {}));
107
+ export var CoreClientsEnum;
108
+ (function (CoreClientsEnum) {
109
+ CoreClientsEnum["BASE_API_CLIENT"] = "base_client_name";
110
+ CoreClientsEnum["SOAP_API_CLIENT"] = "soap_api_client";
111
+ })(CoreClientsEnum || (CoreClientsEnum = {}));
112
112
  export var EndpointResourceEnum;
113
113
  (function (EndpointResourceEnum) {
114
114
  EndpointResourceEnum["EXAMPLE"] = "example";