@xrystal/core 3.20.4 → 3.20.7

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.20.4",
4
+ "version": "3.20.7",
5
5
  "description": "Project core for xrystal",
6
6
  "publishConfig": {
7
7
  "access": "public",
@@ -1,6 +1,6 @@
1
- import { ILifeCycle } from "../../utils";
1
+ import { IService } from "../../utils";
2
2
  import ConfigsService from "../configs";
3
- export default class ClientsService implements ILifeCycle<any> {
3
+ export default class ClientsService implements IService<any> {
4
4
  #private;
5
5
  private _instances;
6
6
  constructor({ configsService }: {
@@ -1,5 +1,5 @@
1
1
  import SystemService from '../system/index';
2
- import { ILifeCycle, ModeEnum } from '../../utils';
2
+ import { IService, ModeEnum } from '../../utils';
3
3
  export interface IConfig {
4
4
  worker: boolean;
5
5
  mode: ModeEnum;
@@ -19,7 +19,7 @@ export interface IConfig {
19
19
  systemLoggerLayer: string;
20
20
  isKafkaPassive: boolean;
21
21
  kafkaBrokers: string;
22
- kafkaTopics: string;
22
+ kafkaTopics: string[];
23
23
  kafkaLogsTopic: string;
24
24
  baseApiUri: string;
25
25
  port: number;
@@ -30,7 +30,7 @@ export interface IConfig {
30
30
  }
31
31
  export interface IConfigsService extends IConfig {
32
32
  }
33
- export default class ConfigsService implements ILifeCycle<any> {
33
+ export default class ConfigsService implements IService<any> {
34
34
  #private;
35
35
  readonly publicFolderName: string;
36
36
  readonly kafkaLogsTopic: string;
@@ -44,7 +44,7 @@ export default class ConfigsService {
44
44
  systemLoggerLayer: process.env.SYSTEM_LOGGER_LAYER,
45
45
  isKafkaPassive: process.env.IS_KAFKA_PASSIVE === 'true' ? true : false,
46
46
  kafkaBrokers: process.env?.KAFKA_BROKERS,
47
- kafkaTopics: process.env?.KAFKA_TOPICS,
47
+ kafkaTopics: [],
48
48
  kafkaLogsTopic: this.kafkaLogsTopic,
49
49
  baseApiUri: process.env.HTTPS === 'true' ? process.env.SYSTEM_HTTPS_BASE_API_URI : process.env.SYSTEM_BASE_API_URI,
50
50
  port: Number(process.env.PORT),
@@ -1,5 +1,5 @@
1
1
  import { AsyncLocalStorage } from 'node:async_hooks';
2
- import { ILifeCycle, ProtocolEnum } from '../../utils/index';
2
+ import { IService, ProtocolEnum } from '../../utils/index';
3
3
  import LoggerService from '../logger';
4
4
  import SystemService from '../system';
5
5
  export declare const controllerContextStorage: AsyncLocalStorage<{
@@ -63,7 +63,7 @@ declare abstract class Controller {
63
63
  protected get req(): CustomRequest;
64
64
  protected get res(): CustomResponse;
65
65
  }
66
- export declare abstract class ControllerService extends Controller implements ILifeCycle<any> {
66
+ export declare abstract class ControllerService extends Controller implements IService<any> {
67
67
  protected systemService: SystemService;
68
68
  constructor({ systemService }: {
69
69
  systemService: SystemService;
@@ -1,6 +1,6 @@
1
- import { ILifeCycle } from '../../utils/index';
1
+ import { IService } from '../../utils/index';
2
2
  import LoggerService from '../logger/index';
3
- export default class EventsService implements ILifeCycle<any> {
3
+ export default class EventsService implements IService<any> {
4
4
  #private;
5
5
  constructor({ loggerService }: {
6
6
  loggerService: LoggerService;
@@ -1,7 +1,7 @@
1
1
  import ConfigsService from "../configs";
2
- import { ILifeCycle } from "../../utils";
2
+ import { IService } from "../../utils";
3
3
  import SystemService from "../system";
4
- export default class LocalizationsService implements ILifeCycle<any> {
4
+ export default class LocalizationsService implements IService<any> {
5
5
  #private;
6
6
  _instance: any;
7
7
  constructor({ systemService, configsService, }: {
@@ -2,7 +2,7 @@ import winston from "winston";
2
2
  import "winston-daily-rotate-file";
3
3
  import { AsyncLocalStorage } from "node:async_hooks";
4
4
  import ConfigsService from "../configs";
5
- import { LoggerLayerEnum, ILifeCycle } from "../../utils";
5
+ import { LoggerLayerEnum, IService } from "../../utils";
6
6
  import SystemService from "../system";
7
7
  export interface ICustomLogger extends winston.Logger {
8
8
  critical: winston.LeveledLogMethod;
@@ -14,7 +14,7 @@ export interface ILog {
14
14
  payload?: any;
15
15
  code?: string | number;
16
16
  }
17
- export default class LoggerService implements ILifeCycle<any> {
17
+ export default class LoggerService implements IService<any> {
18
18
  #private;
19
19
  static readonly storage: AsyncLocalStorage<Map<string, string>>;
20
20
  private serviceName;
@@ -1,5 +1,5 @@
1
- import { ILifeCycle } from "../../utils";
2
- export default class SystemService implements ILifeCycle<any> {
1
+ import { IService } from "../../utils";
2
+ export default class SystemService implements IService<any> {
3
3
  protected _core: Record<string, any>;
4
4
  protected _tmp: Record<string, any>;
5
5
  cwd: string;
@@ -2,3 +2,5 @@ export declare abstract class ILifeCycle<T = any> {
2
2
  load(props?: T | {}): Promise<void>;
3
3
  dispose?(_context?: any): Promise<void> | void;
4
4
  }
5
+ export declare abstract class IService<T = any> extends ILifeCycle<T> {
6
+ }
@@ -4,3 +4,5 @@ export class ILifeCycle {
4
4
  dispose(_context) {
5
5
  }
6
6
  }
7
+ export class IService extends ILifeCycle {
8
+ }