@aristid/leav-types 1.4.0-05e57576 → 1.4.0-8e2fe968

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.
@@ -214,6 +214,11 @@ export declare namespace elasticSearch {
214
214
  export let indexPrefix: string;
215
215
  let url_2: string;
216
216
  export { url_2 as url };
217
+ export let ilmPolicyName: string;
218
+ export let templateName: string;
219
+ }
220
+ export declare namespace logsCollector {
221
+ let queue: string;
217
222
  }
218
223
  export declare let pluginsPath: string | any[];
219
224
  export { _export as export, _import as import };
@@ -30,6 +30,7 @@ export interface IConfig {
30
30
  dbProfiler: IDbProfilerConfig;
31
31
  instanceId: string;
32
32
  elasticSearch: IElasticSearchConfig;
33
+ logsCollector: ILogsCollector;
33
34
  pluginsPath: string[];
34
35
  bugsnag: IBugsnag;
35
36
  matomo: IMatomo;
@@ -41,6 +42,7 @@ export declare enum CoreMode {
41
42
  INDEXATION_MANAGER = "indexationManager",
42
43
  TASKS_MANAGER_MASTER = "tasksManager:master",
43
44
  TASKS_MANAGER_WORKER = "tasksManager:worker",
45
+ LOGS_COLLECTOR = "logsCollector",
44
46
  CLI = "cli"
45
47
  }
46
48
  export interface IServer {
@@ -225,6 +227,8 @@ export interface IDbProfilerConfig {
225
227
  export interface IElasticSearchConfig {
226
228
  indexPrefix: string;
227
229
  url: string;
230
+ ilmPolicyName: string;
231
+ templateName: string;
228
232
  }
229
233
  export interface IBugsnag {
230
234
  enable: boolean;
@@ -238,3 +242,6 @@ export interface IMatomo {
238
242
  url?: string;
239
243
  siteId?: string;
240
244
  }
245
+ export interface ILogsCollector {
246
+ queue: string;
247
+ }
@@ -0,0 +1,2 @@
1
+ import { type IDbEvent, type IDbPayload } from '@leav/utils';
2
+ export type WritableMessage = Omit<IDbEvent, 'payload' | 'emitter'> & IDbPayload;
@@ -10,6 +10,7 @@ export { default as globalSettings } from './globalSettingsApp';
10
10
  export { default as subscriptionsHelper } from './helpers/subscriptions';
11
11
  export { default as import } from './importApp';
12
12
  export { default as indexationManager } from './indexationManagerApp';
13
+ export { default as logsCollector } from './logsCollectorApp';
13
14
  export { default as library } from './libraryApp/libraryApp';
14
15
  export { default as log } from './logApp';
15
16
  export { default as permission } from './permissionApp/permissionApp';
@@ -0,0 +1,9 @@
1
+ import { type ILogsCollectorDomain } from 'domain/logsCollector/logsCollectorDomain';
2
+ export interface ILogsCollectorApp {
3
+ init(): Promise<void>;
4
+ }
5
+ interface IDeps {
6
+ 'core.domain.logsCollector': ILogsCollectorDomain;
7
+ }
8
+ export default function ({ 'core.domain.logsCollector': logsCollector }: IDeps): ILogsCollectorApp;
9
+ export {};
@@ -0,0 +1 @@
1
+ export { default } from './logsCollectorDomain';
@@ -0,0 +1,16 @@
1
+ import { type IAmqpService } from '@leav/message-broker';
2
+ import { type ILogger } from '@leav/logger';
3
+ import type * as Config from '_types/config';
4
+ import { type IIndexationService } from '../../infra/indexation/indexationService';
5
+ import { type IElasticSearchService } from '../../infra/elasticSearch/elasticSearchService';
6
+ export interface ILogsCollectorDomain {
7
+ init(): Promise<void>;
8
+ }
9
+ export interface ILogsCollectorDomainDeps {
10
+ config: Config.IConfig;
11
+ 'core.infra.amqpService': IAmqpService;
12
+ 'core.infra.indexation.indexationService': IIndexationService;
13
+ 'core.utils.logger': ILogger;
14
+ 'core.infra.elasticSearch.service': IElasticSearchService;
15
+ }
16
+ export default function ({ config, 'core.infra.amqpService': amqpService, 'core.infra.indexation.indexationService': indexationService, 'core.utils.logger': logger, 'core.infra.elasticSearch.service': esService }: ILogsCollectorDomainDeps): ILogsCollectorDomain;
@@ -1,6 +1,6 @@
1
1
  import { Client, type estypes } from '@elastic/elasticsearch';
2
2
  import { type IConfig } from '_types/config';
3
- import { type IQueryInfos } from '_types/queryInfos';
3
+ import { type Log } from '@leav/utils';
4
4
  export interface IElasticsearchServiceSearchResponse<T> {
5
5
  total: number;
6
6
  hits: T[];
@@ -17,11 +17,12 @@ interface IElasticsearchServiceSearchParams {
17
17
  }
18
18
  export interface IElasticSearchService {
19
19
  client: Client;
20
- search: <T>(params: IElasticsearchServiceSearchParams, ctx: IQueryInfos) => Promise<IElasticsearchServiceSearchResponse<T>>;
20
+ search: <T>(params: IElasticsearchServiceSearchParams) => Promise<IElasticsearchServiceSearchResponse<T>>;
21
+ writeData: (indexName: string, data: Log) => Promise<void>;
21
22
  }
22
- interface IDeps {
23
+ export interface IElasticSearchServiceDeps {
23
24
  'core.infra.elasticSearch.client'?: Client;
24
25
  config?: IConfig;
25
26
  }
26
- export default function ({ config }: IDeps): IElasticSearchService;
27
+ export default function ({ config }: IElasticSearchServiceDeps): IElasticSearchService;
27
28
  export {};
@@ -1,5 +1,6 @@
1
1
  export { default as cli } from './cli';
2
2
  export { default as filesManager } from './filesManager';
3
3
  export { default as indexationManager } from './indexationManager';
4
+ export { default as logsCollector } from './logsCollector';
4
5
  export { default as tasksManager } from './tasksManager';
5
6
  export { default as server } from './server';
@@ -0,0 +1,9 @@
1
+ import { type ILogsCollectorApp } from 'app/core/logsCollectorApp';
2
+ export interface ILogsCollectorInterface {
3
+ init(): Promise<void>;
4
+ }
5
+ interface IDeps {
6
+ 'core.app.core.logsCollector': ILogsCollectorApp;
7
+ }
8
+ export default function ({ 'core.app.core.logsCollector': logsCollector }: IDeps): ILogsCollectorInterface;
9
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aristid/leav-types",
3
- "version": "1.4.0-05e57576",
3
+ "version": "1.4.0-8e2fe968",
4
4
  "description": "Shared Leav types",
5
5
  "scripts": {
6
6
  "tscheck": "",