@aristid/leav-types 1.4.0 → 1.4.1-0a2c336f
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 +42 -16
- package/apps/core/config/development.d.ts +7 -4
- package/apps/core/config/test.d.ts +43 -9
- package/apps/core/src/__tests__/e2e/api/e2eUtils.d.ts +27 -2
- package/apps/core/src/__tests__/e2e/api/export/export.test.d.ts +1 -0
- package/apps/core/src/__tests__/e2e/api/mailpitUtils.d.ts +21 -0
- package/apps/core/src/__tests__/e2e/api/permissions/extendedLibraryPermissions.test.d.ts +1 -0
- package/apps/core/src/__tests__/integration/domain/taskManagerDomain.test.d.ts +1 -0
- package/apps/core/src/__tests__/integration/infra/integrationTestRepoUtils.d.ts +1 -1
- package/apps/core/src/__tests__/integration/infra/ramService.test.d.ts +1 -0
- package/apps/core/src/__tests__/integration/integrationTestUtils.d.ts +7 -0
- package/apps/core/src/_types/config.d.ts +48 -7
- package/apps/core/src/_types/elasticSearch.d.ts +2 -0
- package/apps/core/src/_types/errors.d.ts +2 -1
- package/apps/core/src/_types/eventsManager.d.ts +9 -1
- package/apps/core/src/_types/forms.d.ts +2 -2
- package/apps/core/src/_types/notification.d.ts +51 -0
- package/apps/core/src/_types/userData.d.ts +10 -0
- package/apps/core/src/app/auth/authApp.d.ts +5 -3
- package/apps/core/src/app/core/index.d.ts +2 -0
- package/apps/core/src/app/core/logsCollectorApp.d.ts +9 -0
- package/apps/core/src/app/core/notificationApp.d.ts +10 -0
- package/apps/core/src/app/core/tasksManagerApp.d.ts +1 -1
- package/apps/core/src/domain/actions/excelCalculationAction.d.ts +6 -4
- package/apps/core/src/domain/export/exportDomain.d.ts +6 -2
- package/apps/core/src/domain/export/exportProfileDomain.d.ts +23 -0
- package/apps/core/src/domain/export/exportProfileDomain.spec.d.ts +1 -0
- package/apps/core/src/domain/export/index.d.ts +1 -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/domain/notification/channels/emailChannel.d.ts +12 -0
- package/apps/core/src/domain/notification/channels/webSocketChannel.d.ts +6 -0
- package/apps/core/src/domain/notification/index.d.ts +3 -0
- package/apps/core/src/domain/notification/notificationDomain.d.ts +12 -0
- package/apps/core/src/domain/permission/helpers/index.d.ts +1 -1
- package/apps/core/src/domain/permission/helpers/recordInCreationBypass.d.ts +8 -3
- package/apps/core/src/domain/permission/recordAttributePermissionDomain.d.ts +2 -2
- package/apps/core/src/domain/permission/recordPermissionDomain.d.ts +2 -2
- package/apps/core/src/domain/record/helpers/getAccessPermissionFilters.d.ts +6 -5
- package/apps/core/src/domain/record/recordDomain.d.ts +1 -0
- package/apps/core/src/domain/tasksManager/tasksManagerDomain.d.ts +1 -1
- package/apps/core/src/domain/user/userDomain.d.ts +5 -2
- package/apps/core/src/domain/value/valueDomain.d.ts +3 -6
- package/apps/core/src/infra/cache/cacheService.d.ts +4 -3
- package/apps/core/src/infra/cache/index.d.ts +1 -2
- package/apps/core/src/infra/cache/ramService.d.ts +1 -7
- package/apps/core/src/infra/cache/redis.d.ts +5 -1
- package/apps/core/src/infra/{elasticSearch/elasticSearchService.d.ts → elasticsearch/elasticsearchService.d.ts} +7 -6
- package/apps/core/src/infra/elasticsearch/index.d.ts +1 -0
- package/apps/core/src/infra/log/logRepo.d.ts +3 -3
- package/apps/core/src/infra/oidc/oidcClientService.d.ts +3 -3
- package/apps/core/src/infra/session/index.d.ts +1 -0
- package/apps/core/src/infra/session/sessionRepo.d.ts +8 -0
- package/apps/core/src/interface/index.d.ts +1 -0
- package/apps/core/src/interface/logsCollector.d.ts +9 -0
- package/apps/core/src/interface/tasksManager.d.ts +1 -1
- package/apps/core/src/utils/helpers/getExcelData.d.ts +3 -0
- package/apps/core/src/utils/helpers/getFileDataBuffer.d.ts +2 -0
- package/libs/config-manager/src/envTo.d.ts +4 -0
- package/libs/logger/src/LoggerCallStack.d.ts +14 -0
- package/libs/logger/src/catchErrorFormatter.d.ts +2 -0
- package/libs/logger/src/config.d.ts +32 -3
- package/libs/logger/src/locationInfoFormatter.d.ts +2 -0
- package/libs/logger/src/logger.d.ts +1 -1
- package/libs/message-broker/src/amqpService.d.ts +2 -2
- package/libs/message-broker/src/types/amqp.d.ts +1 -1
- package/package.json +2 -2
- package/apps/core/src/infra/elasticSearch/index.d.ts +0 -1
- /package/apps/core/src/infra/{elasticSearch/elasticSearchClient.d.ts → elasticsearch/elasticsearchClient.d.ts} +0 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { type ILogger } from '@leav/logger';
|
|
1
2
|
import { type ICalculationVariable } from 'domain/helpers/calculationVariable';
|
|
2
|
-
import { type IUtils } from 'utils/utils';
|
|
3
3
|
import { type IActionsListFunction } from '../../_types/actionsList';
|
|
4
|
+
import { type IConfig } from '_types/config';
|
|
4
5
|
interface IDeps {
|
|
5
|
-
'core.domain.helpers.calculationVariable'
|
|
6
|
-
|
|
6
|
+
'core.domain.helpers.calculationVariable': ICalculationVariable;
|
|
7
|
+
config: IConfig;
|
|
8
|
+
'core.utils.logger': ILogger;
|
|
7
9
|
}
|
|
8
|
-
export default function ({ 'core.domain.helpers.calculationVariable': calculationVariable }
|
|
10
|
+
export default function ({ 'core.domain.helpers.calculationVariable': calculationVariable, 'core.utils.logger': logger, config }: IDeps): IActionsListFunction<{
|
|
9
11
|
Formula: true;
|
|
10
12
|
Description: true;
|
|
11
13
|
}>;
|
|
@@ -11,9 +11,11 @@ import { type IQueryInfos } from '../../_types/queryInfos';
|
|
|
11
11
|
import { type IRecordFilterLight } from '../../_types/record';
|
|
12
12
|
import { type ITaskFuncParams } from '../../_types/tasksManager';
|
|
13
13
|
import { type IValidateHelper } from '../helpers/validate';
|
|
14
|
+
import { type INotificationDomain } from 'domain/notification/notificationDomain';
|
|
15
|
+
import { type IExportProfileDomain } from './exportProfileDomain';
|
|
14
16
|
export interface IExportParams {
|
|
15
17
|
library: string;
|
|
16
|
-
|
|
18
|
+
profile: string;
|
|
17
19
|
filters?: IRecordFilterLight[];
|
|
18
20
|
ctx: IQueryInfos;
|
|
19
21
|
}
|
|
@@ -39,8 +41,10 @@ export interface IExportDomainDeps {
|
|
|
39
41
|
'core.domain.helpers.validate': IValidateHelper;
|
|
40
42
|
'core.domain.helpers.updateTaskProgress': UpdateTaskProgress;
|
|
41
43
|
'core.domain.eventsManager': IEventsManagerDomain;
|
|
44
|
+
'core.domain.notification': INotificationDomain;
|
|
45
|
+
'core.domain.export.exportProfile': IExportProfileDomain;
|
|
42
46
|
'core.utils': IUtils;
|
|
43
47
|
translator: i18n;
|
|
44
48
|
config: Config.IConfig;
|
|
45
49
|
}
|
|
46
|
-
export default function ({ config, 'core.domain.record': recordDomain, 'core.domain.helpers.validate': validateHelper, 'core.domain.attribute': attributeDomain, 'core.domain.library': libraryDomain, 'core.domain.tasksManager': tasksManager, 'core.domain.helpers.updateTaskProgress': updateTaskProgress, 'core.domain.eventsManager': eventsManagerDomain, 'core.utils': utils, translator }: IExportDomainDeps): IExportDomain;
|
|
50
|
+
export default function ({ config, 'core.domain.record': recordDomain, 'core.domain.helpers.validate': validateHelper, 'core.domain.attribute': attributeDomain, 'core.domain.library': libraryDomain, 'core.domain.tasksManager': tasksManager, 'core.domain.helpers.updateTaskProgress': updateTaskProgress, 'core.domain.eventsManager': eventsManagerDomain, 'core.domain.notification': notificationDomain, 'core.domain.export.exportProfile': exportProfileDomain, 'core.utils': utils, translator }: IExportDomainDeps): IExportDomain;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ILibraryDomain } from '../library/libraryDomain';
|
|
2
|
+
import { type IQueryInfos } from '../../_types/queryInfos';
|
|
3
|
+
export interface IExportProfileConfig {
|
|
4
|
+
defaultProfile: string;
|
|
5
|
+
profiles: Array<{
|
|
6
|
+
label: string;
|
|
7
|
+
columns: Array<{
|
|
8
|
+
columnLabel: string;
|
|
9
|
+
attribute: string;
|
|
10
|
+
}>;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
export interface IExportColumn {
|
|
14
|
+
columnLabel: string;
|
|
15
|
+
attribute: string;
|
|
16
|
+
}
|
|
17
|
+
export interface IExportProfileDomain {
|
|
18
|
+
getColumnsFromProfileConfig(profile: string | undefined, library: string, ctx: IQueryInfos): Promise<IExportColumn[]>;
|
|
19
|
+
}
|
|
20
|
+
export interface IExportProfileDomainDeps {
|
|
21
|
+
'core.domain.library': ILibraryDomain;
|
|
22
|
+
}
|
|
23
|
+
export default function ({ 'core.domain.library': libraryDomain }: IExportProfileDomainDeps): IExportProfileDomain;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type INotificationChannel } from '../../../_types/notification';
|
|
2
|
+
import { type IMailerService } from 'infra/mailer/mailerService';
|
|
3
|
+
import { type IUserDomain } from 'domain/user/userDomain';
|
|
4
|
+
import { type IGlobalSettingsDomain } from 'domain/globalSettings/globalSettingsDomain';
|
|
5
|
+
import { type IConfig } from '_types/config';
|
|
6
|
+
export interface INotificationByEmailChannelDeps {
|
|
7
|
+
config: IConfig;
|
|
8
|
+
'core.infra.mailer.mailerService': IMailerService;
|
|
9
|
+
'core.domain.globalSettings': IGlobalSettingsDomain;
|
|
10
|
+
'core.domain.user': IUserDomain;
|
|
11
|
+
}
|
|
12
|
+
export default function ({ config, 'core.infra.mailer.mailerService': mailerService, 'core.domain.globalSettings': globalSettingsDomain, 'core.domain.user': userDomain }: INotificationByEmailChannelDeps): INotificationChannel;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type INotificationChannel } from '../../../_types/notification';
|
|
2
|
+
import { type IEventsManagerDomain } from 'domain/eventsManager/eventsManagerDomain';
|
|
3
|
+
export interface INotificationByWebSocketChannelDeps {
|
|
4
|
+
'core.domain.eventsManager': IEventsManagerDomain;
|
|
5
|
+
}
|
|
6
|
+
export default function ({ 'core.domain.eventsManager': eventsManagerDomain }: INotificationByWebSocketChannelDeps): INotificationChannel;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type IConfig } from '_types/config';
|
|
2
|
+
import { type INotificationChannel, type ICreateNotification } from '_types/notification';
|
|
3
|
+
import { type IQueryInfos } from '_types/queryInfos';
|
|
4
|
+
export interface INotificationDomain {
|
|
5
|
+
createNotification(notification: ICreateNotification, ctx: IQueryInfos): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export interface INotificationDomainDeps {
|
|
8
|
+
'core.domain.notification.emailChannel': INotificationChannel;
|
|
9
|
+
'core.domain.notification.webSocketChannel': INotificationChannel;
|
|
10
|
+
config: IConfig;
|
|
11
|
+
}
|
|
12
|
+
export default function ({ 'core.domain.notification.emailChannel': emailChannel, 'core.domain.notification.webSocketChannel': webSocketChannel, config }: INotificationDomainDeps): INotificationDomain;
|
|
@@ -5,4 +5,4 @@ export { default as permissionsByActions } from './permissionsByActions';
|
|
|
5
5
|
export { default as reducePermissionsArray } from './reducePermissionsArray';
|
|
6
6
|
export { default as simplePermission } from './simplePermission';
|
|
7
7
|
export { default as treeBasedPermissions } from './treeBasedPermissions';
|
|
8
|
-
export { default as
|
|
8
|
+
export { default as recordInCreationBypass } from './recordInCreationBypass';
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { type IRecord } from '../../../_types/record';
|
|
2
2
|
import { type IQueryInfos } from '../../../_types/queryInfos';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { type IRecordRepo } from '../../../infra/record/recordRepo';
|
|
4
|
+
export interface IRecordInCreationBypassHelper {
|
|
5
|
+
recordInCreationBypass: (record: IRecord, ctx: IQueryInfos) => boolean;
|
|
6
|
+
recordInCreationBypassById: (libraryId: string, recordId: string, ctx: IQueryInfos) => Promise<boolean>;
|
|
5
7
|
}
|
|
6
|
-
export
|
|
8
|
+
export interface IRecordInCreationBypassHelperDeps {
|
|
9
|
+
'core.infra.record': IRecordRepo;
|
|
10
|
+
}
|
|
11
|
+
export default function ({ 'core.infra.record': recordRepo }: IRecordInCreationBypassHelperDeps): IRecordInCreationBypassHelper;
|
|
@@ -8,7 +8,7 @@ import { type IPermissionByUserGroupsHelper } from './helpers/permissionByUserGr
|
|
|
8
8
|
import { type ITreeBasedPermissionHelper } from './helpers/treeBasedPermissions';
|
|
9
9
|
import { type IGetRecordAttributeHeritedPermissionsParams as IGetRecordAttributeInheritedPermissionsParams } from './_types';
|
|
10
10
|
import { type IRecordRepo } from '../../infra/record/recordRepo';
|
|
11
|
-
import { type
|
|
11
|
+
import { type IRecordInCreationBypassHelper } from './helpers/recordInCreationBypass';
|
|
12
12
|
export interface IRecordAttributePermissionDomain {
|
|
13
13
|
getRecordAttributePermission(action: RecordAttributePermissionsActions, userGroupId: string, attributeId: string, recordLibrary: string, recordId: string, ctx: IQueryInfos): Promise<boolean>;
|
|
14
14
|
getInheritedRecordAttributePermission(params: IGetRecordAttributeInheritedPermissionsParams, ctx: IQueryInfos): Promise<boolean>;
|
|
@@ -18,7 +18,7 @@ export interface IRecordAttributePermissionDomainDeps {
|
|
|
18
18
|
'core.domain.permission.helpers.treeBasedPermissions': ITreeBasedPermissionHelper;
|
|
19
19
|
'core.domain.permission.helpers.permissionByUserGroups': IPermissionByUserGroupsHelper;
|
|
20
20
|
'core.domain.permission.helpers.defaultPermission': IDefaultPermissionHelper;
|
|
21
|
-
'core.domain.permission.helpers.
|
|
21
|
+
'core.domain.permission.helpers.recordInCreationBypass': IRecordInCreationBypassHelper;
|
|
22
22
|
'core.domain.attribute': IAttributeDomain;
|
|
23
23
|
'core.infra.value': IValueRepo;
|
|
24
24
|
'core.infra.record': IRecordRepo;
|
|
@@ -8,7 +8,7 @@ import { type ILibraryPermissionDomain } from './libraryPermissionDomain';
|
|
|
8
8
|
import { type IEstimateTreeValueRecordPermissionParams, type IGetInheritedRecordPermissionParams, type IGetRecordPermissionParams } from './_types';
|
|
9
9
|
import { type ITreeRepo } from '../../infra/tree/treeRepo';
|
|
10
10
|
import { type IRecordRepo } from '../../infra/record/recordRepo';
|
|
11
|
-
import { type
|
|
11
|
+
import { type IRecordInCreationBypassHelper } from './helpers/recordInCreationBypass';
|
|
12
12
|
export interface IRecordPermissionDomain {
|
|
13
13
|
getRecordPermission(params: IGetRecordPermissionParams): Promise<boolean>;
|
|
14
14
|
getInheritedRecordPermission(params: IGetInheritedRecordPermissionParams): Promise<boolean>;
|
|
@@ -19,7 +19,7 @@ export interface IRecordPermissionDomainDeps {
|
|
|
19
19
|
'core.domain.permission.helpers.treeBasedPermissions': ITreeBasedPermissionHelper;
|
|
20
20
|
'core.domain.permission.helpers.permissionByUserGroups': IPermissionByUserGroupsHelper;
|
|
21
21
|
'core.domain.permission.helpers.defaultPermission': IDefaultPermissionHelper;
|
|
22
|
-
'core.domain.permission.helpers.
|
|
22
|
+
'core.domain.permission.helpers.recordInCreationBypass': IRecordInCreationBypassHelper;
|
|
23
23
|
'core.domain.attribute': IAttributeDomain;
|
|
24
24
|
'core.domain.helpers.getCoreEntityById': GetCoreEntityByIdFunc;
|
|
25
25
|
'core.infra.value': IValueRepo;
|
|
@@ -11,14 +11,15 @@ interface IAccessPermissionFilterDeps {
|
|
|
11
11
|
'core.infra.permission': IPermissionRepo;
|
|
12
12
|
'core.domain.permission.helpers.defaultPermission': IDefaultPermissionHelper;
|
|
13
13
|
}
|
|
14
|
+
interface INodeIdsByPermissions {
|
|
15
|
+
true: Array<ITreeNode['id']>;
|
|
16
|
+
false: Array<ITreeNode['id']>;
|
|
17
|
+
}
|
|
14
18
|
export interface IGetAccessPermissionsValue {
|
|
15
19
|
treeId: string;
|
|
16
20
|
attribute: IAttribute;
|
|
17
|
-
permissions:
|
|
18
|
-
true: Array<ITreeNode['id']>;
|
|
19
|
-
false: Array<ITreeNode['id']>;
|
|
20
|
-
};
|
|
21
|
+
permissions: INodeIdsByPermissions;
|
|
21
22
|
}
|
|
22
|
-
export type IGetAccessPermissions = (groupsIds: string[][], library: string, deps: IAccessPermissionFilterDeps, ctx: IQueryInfos) => Promise<IGetAccessPermissionsValue[]>;
|
|
23
|
+
export type IGetAccessPermissions = (groupsIds: string[][], library: string, existingFiltersOnTreeIds: string[], deps: IAccessPermissionFilterDeps, ctx: IQueryInfos) => Promise<IGetAccessPermissionsValue[]>;
|
|
23
24
|
declare const getAccessPermissionsFilters: IGetAccessPermissions;
|
|
24
25
|
export default getAccessPermissionsFilters;
|
|
@@ -26,6 +26,7 @@ import { type DeleteRecordHelper } from './helpers/deleteRecord';
|
|
|
26
26
|
import { type CreateRecordHelper } from './helpers/createRecord';
|
|
27
27
|
import { type IElementAncestorsHelper } from 'domain/tree/helpers/elementAncestors';
|
|
28
28
|
import { type ILogger } from '@leav/logger';
|
|
29
|
+
export declare const ATTRIBUTE_ACTIVE = "active";
|
|
29
30
|
export interface IRecordDomain {
|
|
30
31
|
/**
|
|
31
32
|
* Create empty record
|
|
@@ -38,7 +38,7 @@ interface IGetTasksParams extends IGetCoreEntitiesParams {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
export interface ITasksManagerDomain {
|
|
41
|
-
initMaster(): Promise<NodeJS.
|
|
41
|
+
initMaster(): Promise<NodeJS.Timeout>;
|
|
42
42
|
initWorker(): Promise<void>;
|
|
43
43
|
getTasks({ params, ctx }: {
|
|
44
44
|
params: IGetTasksParams;
|
|
@@ -6,7 +6,8 @@ import { type IUserDataRepo } from 'infra/userData/userDataRepo';
|
|
|
6
6
|
import { type IUtils } from 'utils/utils';
|
|
7
7
|
import type * as Config from '_types/config';
|
|
8
8
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
9
|
-
import { type IUserData } from '_types/userData';
|
|
9
|
+
import { type IUserIdentity, type IUserData } from '_types/userData';
|
|
10
|
+
import { type IValueDomain } from 'domain/value/valueDomain';
|
|
10
11
|
interface ISaveUserDataParams {
|
|
11
12
|
key: string;
|
|
12
13
|
value: any;
|
|
@@ -15,12 +16,14 @@ interface ISaveUserDataParams {
|
|
|
15
16
|
ctx: IQueryInfos;
|
|
16
17
|
}
|
|
17
18
|
export interface IUserDomain {
|
|
19
|
+
getUserIdentity(userId: string, ctx: IQueryInfos): Promise<IUserIdentity>;
|
|
18
20
|
saveUserData(params: ISaveUserDataParams): Promise<IUserData>;
|
|
19
21
|
getUserData(keys: string[], global: boolean, ctx: IQueryInfos): Promise<IUserData>;
|
|
20
22
|
sendResetPasswordEmail(email: string, token: string, login: string, browser: string, os: string, lang: 'fr' | 'en', ctx: IQueryInfos): Promise<void>;
|
|
21
23
|
}
|
|
22
24
|
export interface IUserDomainDeps {
|
|
23
25
|
config: Config.IConfig;
|
|
26
|
+
'core.domain.value': IValueDomain;
|
|
24
27
|
'core.domain.permissions': IPermissionDomain;
|
|
25
28
|
'core.infra.userData': IUserDataRepo;
|
|
26
29
|
'core.domain.permission': IPermissionDomain;
|
|
@@ -32,5 +35,5 @@ export interface IUserDomainDeps {
|
|
|
32
35
|
export declare enum UserCoreDataKeys {
|
|
33
36
|
CONSULTED_APPS = "applications_consultation"
|
|
34
37
|
}
|
|
35
|
-
export default function ({ config, 'core.infra.userData': userDataRepo, 'core.domain.permission': permissionDomain, 'core.infra.mailer.mailerService': mailerService, 'core.domain.globalSettings': globalSettingsDomain, 'core.utils': utils, translator }: IUserDomainDeps): IUserDomain;
|
|
38
|
+
export default function ({ config, 'core.domain.value': valueDomain, 'core.infra.userData': userDataRepo, 'core.domain.permission': permissionDomain, 'core.infra.mailer.mailerService': mailerService, 'core.domain.globalSettings': globalSettingsDomain, 'core.utils': utils, translator }: IUserDomainDeps): IUserDomain;
|
|
36
39
|
export {};
|
|
@@ -24,6 +24,7 @@ import { type IDeleteValueParams, type IRunActionListParams } from './_types';
|
|
|
24
24
|
import { type DeleteRecordHelper } from 'domain/record/helpers/deleteRecord';
|
|
25
25
|
import { type CreateRecordHelper } from 'domain/record/helpers/createRecord';
|
|
26
26
|
import { type IfLibraryJoinLinkAttribute } from '../attribute/helpers/ifLibraryJoinLinkAttribute';
|
|
27
|
+
import { type IRecordInCreationBypassHelper } from '../permission/helpers/recordInCreationBypass';
|
|
27
28
|
export interface ISaveBatchValueError {
|
|
28
29
|
type: string;
|
|
29
30
|
message: string;
|
|
@@ -87,11 +88,6 @@ export interface IValueDomain {
|
|
|
87
88
|
ctx: IQueryInfos;
|
|
88
89
|
}): Promise<IValue>;
|
|
89
90
|
runActionsList(params: IRunActionListParams): Promise<IValue[]>;
|
|
90
|
-
runActionsListAndFormatOnValue({ library, value, ctx }: {
|
|
91
|
-
library: string;
|
|
92
|
-
value: IValue;
|
|
93
|
-
ctx: IQueryInfos;
|
|
94
|
-
}): Promise<IValue[]>;
|
|
95
91
|
}
|
|
96
92
|
export interface IValueDomainDeps {
|
|
97
93
|
config: Config.IConfig;
|
|
@@ -107,6 +103,7 @@ export interface IValueDomainDeps {
|
|
|
107
103
|
'core.domain.record.helpers.sendRecordUpdateEvent': SendRecordUpdateEventHelper;
|
|
108
104
|
'core.domain.record.helpers.createRecord': CreateRecordHelper;
|
|
109
105
|
'core.domain.record.helpers.deleteRecord': DeleteRecordHelper;
|
|
106
|
+
'core.domain.permission.helpers.recordInCreationBypass': IRecordInCreationBypassHelper;
|
|
110
107
|
'core.domain.attribute.helpers.ifLibraryJoinLinkAttribute': IfLibraryJoinLinkAttribute;
|
|
111
108
|
'core.domain.versionProfile': IVersionProfileDomain;
|
|
112
109
|
'core.infra.record': IRecordRepo;
|
|
@@ -116,5 +113,5 @@ export interface IValueDomainDeps {
|
|
|
116
113
|
'core.utils.logger': ILogger;
|
|
117
114
|
'core.domain.tree': ITreeDomain;
|
|
118
115
|
}
|
|
119
|
-
declare const valueDomain: ({ config, "core.domain.actionsList": actionsListDomain, "core.domain.attribute": attributeDomain, "core.domain.permission.recordAttribute": recordAttributePermissionDomain, "core.domain.permission.record": recordPermissionDomain, "core.domain.eventsManager": eventsManager, "core.domain.helpers.validate": validate, "core.domain.helpers.updateRecordLastModif": updateRecordLastModif, "core.domain.tree.helpers.elementAncestors": elementAncestors, "core.domain.tree.helpers.getDefaultElement": getDefaultElementHelper, "core.domain.record.helpers.sendRecordUpdateEvent": sendRecordUpdateEvent, "core.domain.record.helpers.createRecord": createRecordHelper, "core.domain.record.helpers.deleteRecord": deleteRecordHelper, "core.domain.attribute.helpers.ifLibraryJoinLinkAttribute": ifLibraryJoinLinkAttribute, "core.domain.versionProfile": versionProfileDomain, "core.infra.record": recordRepo, "core.infra.tree": treeRepo, "core.infra.value": valueRepo, "core.utils": utils, "core.utils.logger": logger }: IValueDomainDeps) => IValueDomain;
|
|
116
|
+
declare const valueDomain: ({ config, "core.domain.actionsList": actionsListDomain, "core.domain.attribute": attributeDomain, "core.domain.permission.recordAttribute": recordAttributePermissionDomain, "core.domain.permission.record": recordPermissionDomain, "core.domain.eventsManager": eventsManager, "core.domain.helpers.validate": validate, "core.domain.helpers.updateRecordLastModif": updateRecordLastModif, "core.domain.tree.helpers.elementAncestors": elementAncestors, "core.domain.tree.helpers.getDefaultElement": getDefaultElementHelper, "core.domain.record.helpers.sendRecordUpdateEvent": sendRecordUpdateEvent, "core.domain.record.helpers.createRecord": createRecordHelper, "core.domain.permission.helpers.recordInCreationBypass": recordInCreationBypassHelper, "core.domain.record.helpers.deleteRecord": deleteRecordHelper, "core.domain.attribute.helpers.ifLibraryJoinLinkAttribute": ifLibraryJoinLinkAttribute, "core.domain.versionProfile": versionProfileDomain, "core.infra.record": recordRepo, "core.infra.tree": treeRepo, "core.infra.value": valueRepo, "core.utils": utils, "core.utils.logger": logger }: IValueDomainDeps) => IValueDomain;
|
|
120
117
|
export default valueDomain;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
2
|
+
import { type IRedis } from './redis';
|
|
2
3
|
export interface IMemoizeParams<T> {
|
|
3
4
|
key: string;
|
|
4
5
|
func: () => Promise<T>;
|
|
@@ -21,13 +22,13 @@ export interface ICacheService {
|
|
|
21
22
|
deleteData(keys: string[], path?: string): Promise<void>;
|
|
22
23
|
deleteAll(path?: string): Promise<void>;
|
|
23
24
|
}
|
|
24
|
-
interface
|
|
25
|
-
'core.infra.
|
|
25
|
+
interface ICacheServiceDeps {
|
|
26
|
+
'core.infra.redis': IRedis;
|
|
26
27
|
'core.infra.cache.diskService': ICacheService;
|
|
27
28
|
}
|
|
28
29
|
export declare enum ECacheType {
|
|
29
30
|
DISK = "DISK",
|
|
30
31
|
RAM = "RAM"
|
|
31
32
|
}
|
|
32
|
-
export default function ({ 'core.infra.
|
|
33
|
+
export default function ({ 'core.infra.redis': redis, 'core.infra.cache.diskService': diskService }: ICacheServiceDeps): ICachesService;
|
|
33
34
|
export {};
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { type IConfig } from '_types/config';
|
|
2
1
|
import { type ICacheService } from './cacheService';
|
|
3
2
|
import { type RedisClientType } from './redis';
|
|
4
|
-
|
|
5
|
-
config?: IConfig;
|
|
6
|
-
'core.infra.redis'?: RedisClientType;
|
|
7
|
-
}
|
|
8
|
-
export default function ({ config, 'core.infra.redis': redis }: IDeps): ICacheService;
|
|
9
|
-
export {};
|
|
3
|
+
export default function (redisClient: RedisClientType): ICacheService;
|
|
@@ -4,5 +4,9 @@ interface IDeps {
|
|
|
4
4
|
config?: IConfig;
|
|
5
5
|
}
|
|
6
6
|
export type RedisClientType = ReturnType<typeof redis.createClient>;
|
|
7
|
-
export
|
|
7
|
+
export interface IRedis {
|
|
8
|
+
cache: RedisClientType;
|
|
9
|
+
session: RedisClientType;
|
|
10
|
+
}
|
|
11
|
+
export declare function initRedis({ config }: IDeps): Promise<IRedis>;
|
|
8
12
|
export {};
|
|
@@ -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[];
|
|
@@ -15,13 +15,14 @@ interface IElasticsearchServiceSearchParams {
|
|
|
15
15
|
};
|
|
16
16
|
query?: estypes.QueryDslQueryContainer;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
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
|
-
'core.infra.
|
|
23
|
+
export interface IElasticsearchServiceDeps {
|
|
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 {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as service } from './elasticsearchService';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IElasticsearchService } from 'infra/elasticsearch/elasticsearchService';
|
|
2
2
|
import { type IConfig } from '_types/config';
|
|
3
3
|
import { type ILogFilters, type ILogPagination, type ILogResponse, type ILogSort } from '_types/log';
|
|
4
4
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
@@ -10,8 +10,8 @@ export interface ILogRepo {
|
|
|
10
10
|
}, ctx: IQueryInfos): Promise<ILogResponse>;
|
|
11
11
|
}
|
|
12
12
|
interface IDeps {
|
|
13
|
-
'core.infra.
|
|
13
|
+
'core.infra.elasticsearch.service'?: IElasticsearchService;
|
|
14
14
|
config?: IConfig;
|
|
15
15
|
}
|
|
16
|
-
export default function ({ 'core.infra.
|
|
16
|
+
export default function ({ 'core.infra.elasticsearch.service': esService, config }: IDeps): ILogRepo;
|
|
17
17
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type OidcClient } from './oidcClient';
|
|
2
2
|
import { TokenSet } from 'openid-client';
|
|
3
|
-
import { type ICachesService } from '../cache/cacheService';
|
|
4
3
|
import { type IConfig } from '../../_types/config';
|
|
4
|
+
import { type ISessionRepo } from '../session/sessionRepo';
|
|
5
5
|
export interface IOIDCClientService {
|
|
6
6
|
oidcClient?: OidcClient;
|
|
7
7
|
getTokensFromCodes: (params: {
|
|
@@ -30,8 +30,8 @@ export interface IOIDCClientService {
|
|
|
30
30
|
}
|
|
31
31
|
interface IDeps {
|
|
32
32
|
'core.infra.oidcClient'?: OidcClient;
|
|
33
|
-
'core.infra.cache.cacheService'?: ICachesService;
|
|
34
33
|
config?: IConfig;
|
|
34
|
+
'core.infra.session'?: ISessionRepo;
|
|
35
35
|
}
|
|
36
|
-
export default function ({ 'core.infra.oidcClient': oidcClient, 'core.infra.
|
|
36
|
+
export default function ({ 'core.infra.oidcClient': oidcClient, 'core.infra.session': sessionRepo, config }?: IDeps): IOIDCClientService;
|
|
37
37
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './sessionRepo';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ICacheService } from '../cache/cacheService';
|
|
2
|
+
import { type IRedis } from '../cache/redis';
|
|
3
|
+
export type ISessionRepo = ICacheService;
|
|
4
|
+
interface ISessionRepoDeps {
|
|
5
|
+
'core.infra.redis'?: IRedis;
|
|
6
|
+
}
|
|
7
|
+
export default function ({ 'core.infra.redis': redis }: ISessionRepoDeps): ISessionRepo;
|
|
8
|
+
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 {};
|
|
@@ -6,3 +6,7 @@ export declare function envToBool(value: string, defaultValue?: boolean): boolea
|
|
|
6
6
|
* To convert process.env string to number
|
|
7
7
|
*/
|
|
8
8
|
export declare function envToNumber(value: string, defaultValue?: number): number;
|
|
9
|
+
/**
|
|
10
|
+
* To convert process.env string to string array
|
|
11
|
+
*/
|
|
12
|
+
export declare function envToStringArray(value: string, separator?: string, defaultValue?: string[]): string[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface ICallerInfo {
|
|
2
|
+
path: string;
|
|
3
|
+
line: string;
|
|
4
|
+
col: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class LoggerCallStack {
|
|
7
|
+
private callerLineIndexInStack;
|
|
8
|
+
getCallStackTrace(): string | null;
|
|
9
|
+
getLocationInfo(): ICallerInfo | null;
|
|
10
|
+
private getStackLines;
|
|
11
|
+
private detectCallLineIndexInStack;
|
|
12
|
+
private callStackTraceLongEnough;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -3,7 +3,7 @@ export interface ILoggerConfig {
|
|
|
3
3
|
* Log level (error, warn, info, log, verbose, debug, silly)
|
|
4
4
|
* @default info
|
|
5
5
|
*/
|
|
6
|
-
level
|
|
6
|
+
level?: string;
|
|
7
7
|
/**
|
|
8
8
|
* If true, disable all logging
|
|
9
9
|
* Default: true if TS_JEST=1 (tests), false otherwise
|
|
@@ -18,7 +18,36 @@ export interface ILoggerConfig {
|
|
|
18
18
|
* Default: false (plain text)
|
|
19
19
|
*/
|
|
20
20
|
useJsonFormat?: boolean;
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* If true, add timestamp to each log line, ISO format
|
|
23
|
+
*/
|
|
24
|
+
addTimestamp?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* If true, add file and line number of the code that called the logger function (error, warn, info, debug, etc.)
|
|
27
|
+
*/
|
|
28
|
+
addLocationInfo?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Add those metadata to all logs
|
|
31
|
+
*/
|
|
32
|
+
additionalMeta?: {
|
|
33
|
+
/**
|
|
34
|
+
* any string to identify the application those logs came from
|
|
35
|
+
*/
|
|
36
|
+
app?: string;
|
|
37
|
+
/**
|
|
38
|
+
* any string to identify each client those logs came from
|
|
39
|
+
*/
|
|
40
|
+
client?: string;
|
|
41
|
+
/**
|
|
42
|
+
* environment, like production, development, test, integration
|
|
43
|
+
*/
|
|
44
|
+
env?: string;
|
|
45
|
+
/**
|
|
46
|
+
* application version, maybe semver format
|
|
47
|
+
*/
|
|
48
|
+
version?: string;
|
|
49
|
+
};
|
|
50
|
+
onErrorLog?: (message: string, meta: any, getCallStackTrace: () => string) => void;
|
|
22
51
|
}
|
|
23
52
|
export declare function envToBool(value: string, defaultValue?: boolean): boolean;
|
|
24
|
-
export declare const defaultLoggerConfig: ILoggerConfig
|
|
53
|
+
export declare const defaultLoggerConfig: ILoggerConfig & Required<Omit<ILoggerConfig, 'onErrorLog'>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import winston from 'winston';
|
|
2
2
|
import { type ILoggerConfig } from './config';
|
|
3
3
|
export type ILogger = Pick<typeof winston, 'error' | 'warn' | 'info' | 'log' | 'verbose' | 'debug' | 'silly'>;
|
|
4
4
|
export declare function configureLogger(config: ILoggerConfig): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as amqp from 'amqplib';
|
|
2
|
-
import { type IAmqp, type
|
|
2
|
+
import { type IAmqp, type OnMessageFunc } from './types/amqp';
|
|
3
3
|
export interface IAmqpService {
|
|
4
4
|
publisher: {
|
|
5
5
|
connection: amqp.ChannelModel;
|
|
@@ -10,7 +10,7 @@ export interface IAmqpService {
|
|
|
10
10
|
channel: amqp.ConfirmChannel;
|
|
11
11
|
};
|
|
12
12
|
publish(exchange: string, routingKey: string, msg: string, priority?: number): Promise<void>;
|
|
13
|
-
consume(queue: string, routingKey: string, onMessage:
|
|
13
|
+
consume(queue: string, routingKey: string, onMessage: OnMessageFunc, consumerTag?: string): Promise<amqp.Replies.Consume>;
|
|
14
14
|
close(): Promise<void>;
|
|
15
15
|
}
|
|
16
16
|
interface IDeps {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aristid/leav-types",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1-0a2c336f",
|
|
4
4
|
"description": "Shared Leav types",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"tscheck": "",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"license": "LGPL3",
|
|
15
15
|
"repository": "https://github.com/leav-solutions/leav-engine",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@leav/utils": "1.4.
|
|
17
|
+
"@leav/utils": "1.4.1",
|
|
18
18
|
"@types/amqplib": "0.10.7",
|
|
19
19
|
"@types/express": "5.0.0",
|
|
20
20
|
"@types/jest": "29.5.14",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as service } from './elasticSearchService';
|