@aristid/leav-types 1.4.0-0d67062f → 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.
- package/apps/core/config/default.d.ts +5 -0
- package/apps/core/src/_types/config.d.ts +7 -0
- package/apps/core/src/_types/elasticSearch.d.ts +2 -0
- package/apps/core/src/app/core/index.d.ts +1 -0
- package/apps/core/src/app/core/logsCollectorApp.d.ts +9 -0
- package/apps/core/src/domain/logsCollector/index.d.ts +1 -0
- package/apps/core/src/domain/logsCollector/logsCollectorDomain.d.ts +16 -0
- package/apps/core/src/infra/elasticSearch/elasticSearchService.d.ts +5 -4
- package/apps/core/src/interface/index.d.ts +1 -0
- package/apps/core/src/interface/logsCollector.d.ts +9 -0
- package/package.json +1 -1
|
@@ -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
|
+
}
|
|
@@ -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
|
|
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
|
|
20
|
+
search: <T>(params: IElasticsearchServiceSearchParams) => Promise<IElasticsearchServiceSearchResponse<T>>;
|
|
21
|
+
writeData: (indexName: string, data: Log) => Promise<void>;
|
|
21
22
|
}
|
|
22
|
-
interface
|
|
23
|
+
export interface IElasticSearchServiceDeps {
|
|
23
24
|
'core.infra.elasticSearch.client'?: Client;
|
|
24
25
|
config?: IConfig;
|
|
25
26
|
}
|
|
26
|
-
export default function ({ config }:
|
|
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 {};
|