@aristid/leav-types 1.4.1-2f11b92f → 1.4.1-2fb74f9e
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 +30 -9
- package/apps/core/config/development.d.ts +7 -0
- package/apps/core/config/test.d.ts +43 -9
- package/apps/core/src/__tests__/e2e/api/e2eUtils.d.ts +31 -3
- package/apps/core/src/__tests__/e2e/api/export/export.test.d.ts +1 -0
- package/apps/core/src/__tests__/e2e/api/import/import.test.d.ts +1 -0
- package/apps/core/src/__tests__/e2e/api/mailpitUtils.d.ts +21 -0
- package/apps/core/src/__tests__/integration/domain/tasksManagerDomain.test.d.ts +1 -0
- package/apps/core/src/__tests__/integration/infra/integrationTestRepoUtils.d.ts +1 -1
- package/apps/core/src/__tests__/integration/integrationTestUtils.d.ts +7 -0
- package/apps/core/src/_constants/attributes.d.ts +2 -1
- package/apps/core/src/_types/config.d.ts +35 -2
- package/apps/core/src/_types/errors.d.ts +1 -1
- package/apps/core/src/_types/eventsManager.d.ts +13 -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/application/applicationApp.d.ts +1 -1
- package/apps/core/src/app/auth/authApp.d.ts +3 -3
- package/apps/core/src/app/core/apiKeyApp/apiKeyApp.d.ts +1 -1
- package/apps/core/src/app/core/coreApp.d.ts +1 -1
- package/apps/core/src/app/core/eventsManagerApp.d.ts +1 -1
- package/apps/core/src/app/core/filesManagerApp.d.ts +1 -1
- package/apps/core/src/app/core/formApp/formApp.d.ts +1 -1
- package/apps/core/src/app/core/globalSettingsApp.d.ts +1 -1
- package/apps/core/src/app/core/importApp.d.ts +1 -1
- package/apps/core/src/app/core/index.d.ts +1 -0
- package/apps/core/src/app/core/libraryApp/libraryApp.d.ts +1 -1
- package/apps/core/src/app/core/logApp.d.ts +1 -1
- package/apps/core/src/app/core/notificationApp.d.ts +10 -0
- package/apps/core/src/app/core/permissionApp/permissionApp.d.ts +1 -1
- package/apps/core/src/app/core/recordApp/_types.d.ts +1 -0
- package/apps/core/src/app/core/recordApp/recordApp.d.ts +1 -1
- package/apps/core/src/app/core/tasksManagerApp.d.ts +2 -2
- package/apps/core/src/app/core/treeApp/treeApp.d.ts +1 -1
- package/apps/core/src/app/core/valueApp.d.ts +1 -1
- package/apps/core/src/app/core/versionProfileApp/versionProfileApp.d.ts +1 -1
- package/apps/core/src/app/core/viewApp.d.ts +1 -1
- package/apps/core/src/app/endpoint/endpointApp.d.ts +1 -1
- package/apps/core/src/app/graphql/graphqlApp.d.ts +1 -1
- package/apps/core/src/domain/actions/excelCalculationAction.d.ts +6 -4
- package/apps/core/src/domain/actions/index.d.ts +1 -0
- package/apps/core/src/domain/actions/inheritanceCalculationAction.d.ts +1 -1
- package/apps/core/src/domain/actions/toLowercaseAction.d.ts +2 -0
- package/apps/core/src/domain/actions/toLowercaseAction.spec.d.ts +1 -0
- package/apps/core/src/domain/apiKey/apiKeyDomain.d.ts +1 -1
- package/apps/core/src/domain/application/applicationDomain.d.ts +1 -1
- package/apps/core/src/domain/attribute/attributeDomain.d.ts +1 -1
- package/apps/core/src/domain/attribute/helpers/ifLibraryJoinLinkAttribute.d.ts +1 -1
- package/apps/core/src/domain/eventsManager/eventsManagerDomain.d.ts +1 -1
- 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/filesManager/filesManagerDomain.d.ts +1 -1
- package/apps/core/src/domain/filesManager/helpers/handlePreview.d.ts +1 -1
- package/apps/core/src/domain/filesManager/helpers/messagesHandler/messagesHandler.d.ts +1 -1
- package/apps/core/src/domain/form/formDomain.d.ts +1 -1
- package/apps/core/src/domain/form/helpers/mustIncludeElement.d.ts +1 -1
- package/apps/core/src/domain/globalSettings/globalSettingsDomain.d.ts +1 -1
- package/apps/core/src/domain/helpers/calculationsVariableFunctions/index.d.ts +1 -1
- package/apps/core/src/domain/helpers/getCoreEntityById.d.ts +1 -1
- package/apps/core/src/domain/helpers/updateRecordLastModif.d.ts +1 -1
- package/apps/core/src/domain/helpers/updateTaskProgress.d.ts +1 -1
- package/apps/core/src/domain/helpers/validate.d.ts +1 -1
- package/apps/core/src/domain/import/importDomain.d.ts +1 -1
- package/apps/core/src/domain/indexationManager/indexationManagerDomain.d.ts +1 -1
- package/apps/core/src/domain/library/helpers/deleteAssociatedValues.d.ts +1 -1
- package/apps/core/src/domain/library/helpers/runPreDelete.d.ts +1 -1
- package/apps/core/src/domain/library/libraryDomain.d.ts +1 -1
- package/apps/core/src/domain/log/logDomain.d.ts +1 -1
- package/apps/core/src/domain/logsCollector/logsCollectorDomain.d.ts +1 -1
- 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/_types.d.ts +8 -19
- package/apps/core/src/domain/permission/adminPermissionDomain.d.ts +1 -1
- package/apps/core/src/domain/permission/applicationPermissionDomain.d.ts +1 -1
- package/apps/core/src/domain/permission/helpers/defaultPermission.d.ts +6 -1
- package/apps/core/src/domain/permission/helpers/getPermissionCachePatternKey.d.ts +1 -1
- package/apps/core/src/domain/permission/helpers/globalPermission.d.ts +4 -10
- package/apps/core/src/domain/permission/helpers/permissionByUserGroups.d.ts +2 -1
- package/apps/core/src/domain/permission/helpers/recordInCreationBypass.d.ts +1 -1
- package/apps/core/src/domain/permission/helpers/simplePermission.d.ts +1 -1
- package/apps/core/src/domain/permission/libraryPermissionDomain.d.ts +1 -1
- package/apps/core/src/domain/permission/permissionDomain.d.ts +2 -2
- package/apps/core/src/domain/permission/treeLibraryPermissionDomain.d.ts +1 -1
- package/apps/core/src/domain/permission/treePermissionDomain.d.ts +1 -1
- package/apps/core/src/domain/record/_types.d.ts +1 -0
- package/apps/core/src/domain/record/helpers/createRecord.d.ts +1 -1
- package/apps/core/src/domain/record/helpers/deleteRecord.d.ts +1 -1
- package/apps/core/src/domain/record/helpers/getAccessPermissionFilters.d.ts +7 -1
- package/apps/core/src/domain/record/recordDomain.d.ts +3 -3
- package/apps/core/src/domain/tasksManager/tasksManagerDomain.d.ts +2 -2
- package/apps/core/src/domain/tree/helpers/elementAncestors.d.ts +1 -1
- package/apps/core/src/domain/tree/helpers/getDefaultElement.d.ts +1 -1
- package/apps/core/src/domain/tree/treeDomain.d.ts +1 -1
- package/apps/core/src/domain/user/userDomain.d.ts +5 -2
- package/apps/core/src/domain/value/helpers/formatLogValue.d.ts +1 -1
- package/apps/core/src/domain/value/valueDomain.d.ts +3 -8
- package/apps/core/src/domain/versionProfile/versionProfileDomain.d.ts +1 -1
- package/apps/core/src/domain/view/viewDomain.d.ts +1 -1
- package/apps/core/src/errors/LeavError.d.ts +1 -1
- package/apps/core/src/infra/apiKey/apiKeyRepo.d.ts +1 -1
- package/apps/core/src/infra/application/applicationRepo.d.ts +1 -1
- package/apps/core/src/infra/attribute/attributeRepo.d.ts +1 -1
- package/apps/core/src/infra/attributeTypes/attributeAdvancedLinkRepo.d.ts +1 -1
- package/apps/core/src/infra/attributeTypes/attributeAdvancedRepo.d.ts +1 -1
- package/apps/core/src/infra/attributeTypes/attributeSimpleLinkRepo.d.ts +1 -1
- package/apps/core/src/infra/attributeTypes/attributeSimpleRepo.d.ts +1 -1
- package/apps/core/src/infra/attributeTypes/attributeTreeRepo.d.ts +1 -1
- package/apps/core/src/infra/attributeTypes/attributeTypesRepo.d.ts +10 -10
- 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/db/dbUtils.d.ts +1 -1
- package/apps/core/src/infra/db/helpers/libraryUtils.d.ts +38 -0
- package/apps/core/src/infra/db/migrations/000-init/index.d.ts +1 -1
- package/apps/core/src/infra/db/migrations/000-init/systemLibraries.d.ts +1 -8
- package/apps/core/src/infra/db/migrations/002-previewsSettings.d.ts +1 -1
- package/apps/core/src/infra/db/migrations/003-filesMetadata.d.ts +1 -1
- package/apps/core/src/infra/db/migrations/007-updateHexColor.d.ts +1 -1
- package/apps/core/src/infra/db/migrations/013-threads/comments.d.ts +4 -0
- package/apps/core/src/infra/db/migrations/013-threads/constants.d.ts +10 -0
- package/apps/core/src/infra/db/migrations/013-threads/index.d.ts +11 -0
- package/apps/core/src/infra/db/migrations/013-threads/statuses.d.ts +5 -0
- package/apps/core/src/infra/db/migrations/013-threads/threads.d.ts +4 -0
- package/apps/core/src/infra/filesManager/filesManagerRepo.d.ts +1 -1
- package/apps/core/src/infra/form/formRepo.d.ts +1 -1
- package/apps/core/src/infra/indexation/indexationService.d.ts +1 -1
- package/apps/core/src/infra/library/libraryRepo.d.ts +2 -2
- package/apps/core/src/infra/mailer/mailerService.d.ts +1 -1
- package/apps/core/src/infra/oidc/oidcClientService.d.ts +3 -3
- package/apps/core/src/infra/permission/permissionRepo.d.ts +3 -3
- package/apps/core/src/infra/record/helpers/getClassifyingFiltersVariableQueryPart.d.ts +1 -1
- package/apps/core/src/infra/record/helpers/getSearchVariableName.d.ts +1 -1
- package/apps/core/src/infra/record/helpers/getSearchVariablesQueryPart.d.ts +1 -1
- package/apps/core/src/infra/record/recordRepo.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/infra/task/taskRepo.d.ts +1 -1
- package/apps/core/src/infra/tree/treeRepo.d.ts +1 -1
- package/apps/core/src/infra/value/valueRepo.d.ts +7 -7
- package/apps/core/src/infra/versionProfile/versionProfileRepo.d.ts +1 -1
- package/apps/core/src/infra/view/viewRepo.d.ts +1 -1
- package/apps/core/src/interface/helpers/handleGraphqlError.d.ts +1 -1
- package/apps/core/src/interface/plugins/apolloTracerPlugin.d.ts +5 -0
- package/apps/core/src/interface/server.d.ts +1 -1
- 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/logger.d.ts +21 -2
- package/libs/message-broker/src/amqpService.d.ts +2 -2
- package/libs/message-broker/src/types/amqp.d.ts +1 -1
- package/package.json +1 -1
- package/apps/core/src/__tests__/e2e/api/import/import.test-draft.d.ts +0 -0
|
@@ -3,25 +3,19 @@ import { type PermissionsActions, type PermissionTypes } from '../../../_types/p
|
|
|
3
3
|
import { type IDefaultPermissionHelper } from './defaultPermission';
|
|
4
4
|
import { type IPermissionByUserGroupsHelper } from './permissionByUserGroups';
|
|
5
5
|
import { type IElementAncestorsHelper } from 'domain/tree/helpers/elementAncestors';
|
|
6
|
+
import { type GetDefaultGlobalPermission } from '../_types';
|
|
6
7
|
interface IGetGlobalPermissionParams {
|
|
7
8
|
type: PermissionTypes;
|
|
8
9
|
applyTo?: string;
|
|
9
10
|
action: PermissionsActions;
|
|
10
|
-
|
|
11
|
+
getDefaultGlobalPermission?: GetDefaultGlobalPermission;
|
|
11
12
|
}
|
|
12
13
|
interface IGetInheritedGlobalPermissionParams {
|
|
13
14
|
type: PermissionTypes;
|
|
14
15
|
applyTo?: string;
|
|
15
16
|
userGroupNodeId: string | null;
|
|
16
17
|
action: PermissionsActions;
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
interface IGetDefaultGlobalPermissionParams {
|
|
20
|
-
type?: PermissionTypes;
|
|
21
|
-
applyTo?: string;
|
|
22
|
-
userId?: string;
|
|
23
|
-
action?: PermissionsActions;
|
|
24
|
-
ctx: IQueryInfos;
|
|
18
|
+
getDefaultGlobalPermission?: GetDefaultGlobalPermission;
|
|
25
19
|
}
|
|
26
20
|
export interface IGlobalPermissionHelper {
|
|
27
21
|
getGlobalPermission(params: IGetGlobalPermissionParams, ctx: IQueryInfos): Promise<boolean>;
|
|
@@ -32,5 +26,5 @@ export interface IGlobalPermissionDeps {
|
|
|
32
26
|
'core.domain.permission.helpers.defaultPermission': IDefaultPermissionHelper;
|
|
33
27
|
'core.domain.tree.helpers.elementAncestors': IElementAncestorsHelper;
|
|
34
28
|
}
|
|
35
|
-
export default function ({ 'core.domain.permission.helpers.permissionByUserGroups': permByUserGroupsHelper, 'core.domain.permission.helpers.defaultPermission': defaultPermHelper, 'core.domain.tree.helpers.elementAncestors': elementAncestorsHelper }: IGlobalPermissionDeps): IGlobalPermissionHelper;
|
|
29
|
+
export default function ({ 'core.domain.permission.helpers.permissionByUserGroups': permByUserGroupsHelper, 'core.domain.permission.helpers.defaultPermission': defaultPermHelper, 'core.domain.tree.helpers.elementAncestors': elementAncestorsHelper, }: IGlobalPermissionDeps): IGlobalPermissionHelper;
|
|
36
30
|
export {};
|
|
@@ -6,6 +6,7 @@ import { type PermissionsActions, type PermissionTypes } from '../../../_types/p
|
|
|
6
6
|
import { type IQueryInfos } from '../../../_types/queryInfos';
|
|
7
7
|
import { type ICachesService } from '../../../infra/cache/cacheService';
|
|
8
8
|
import { type IConfig } from '_types/config';
|
|
9
|
+
import { type GetDefaultGlobalPermission } from '../_types';
|
|
9
10
|
export interface IPermissionByUserGroupsHelperDeps {
|
|
10
11
|
'core.domain.permission.helpers.simplePermission': ISimplePermissionHelper;
|
|
11
12
|
'core.domain.permission.helpers.reducePermissionsArray': IReducePermissionsArrayHelper;
|
|
@@ -22,7 +23,7 @@ interface IGetPermissionByUserGroupsParams {
|
|
|
22
23
|
tree: string;
|
|
23
24
|
path: TreePath;
|
|
24
25
|
};
|
|
25
|
-
|
|
26
|
+
getDefaultGlobalPermission?: GetDefaultGlobalPermission;
|
|
26
27
|
ctx: IQueryInfos;
|
|
27
28
|
}
|
|
28
29
|
export interface IPermissionByUserGroupsHelper {
|
|
@@ -8,4 +8,4 @@ export interface IRecordInCreationBypassHelper {
|
|
|
8
8
|
export interface IRecordInCreationBypassHelperDeps {
|
|
9
9
|
'core.infra.record': IRecordRepo;
|
|
10
10
|
}
|
|
11
|
-
export default function ({ 'core.infra.record': recordRepo }: IRecordInCreationBypassHelperDeps): IRecordInCreationBypassHelper;
|
|
11
|
+
export default function ({ 'core.infra.record': recordRepo, }: IRecordInCreationBypassHelperDeps): IRecordInCreationBypassHelper;
|
|
@@ -6,5 +6,5 @@ interface IDeps {
|
|
|
6
6
|
export interface ISimplePermissionHelper {
|
|
7
7
|
getSimplePermission: (params: IGetSimplePermissionsParams) => Promise<boolean | null>;
|
|
8
8
|
}
|
|
9
|
-
export default function ({ 'core.domain.permission.helpers.permissionsByActions': permsByActionsHelper }: IDeps): ISimplePermissionHelper;
|
|
9
|
+
export default function ({ 'core.domain.permission.helpers.permissionsByActions': permsByActionsHelper, }: IDeps): ISimplePermissionHelper;
|
|
10
10
|
export {};
|
|
@@ -7,5 +7,5 @@ export interface ILibraryPermissionDomain {
|
|
|
7
7
|
interface IDeps {
|
|
8
8
|
'core.domain.permission.helpers.globalPermission': IGlobalPermissionHelper;
|
|
9
9
|
}
|
|
10
|
-
export default function ({ 'core.domain.permission.helpers.globalPermission': globalPermHelper }: IDeps): ILibraryPermissionDomain;
|
|
10
|
+
export default function ({ 'core.domain.permission.helpers.globalPermission': globalPermHelper, }: IDeps): ILibraryPermissionDomain;
|
|
11
11
|
export {};
|
|
@@ -17,11 +17,11 @@ import { type ITreePermissionDomain } from './treePermissionDomain';
|
|
|
17
17
|
import { type IGetActionsByTypeParams, type IGetInheritedPermissionsParams, type IGetPermissionsByActionsParams, type IIsAllowedParams, type PermByActionsRes } from './_types';
|
|
18
18
|
export interface IPermissionDomain {
|
|
19
19
|
savePermission(permData: IPermission, ctx: IQueryInfos): Promise<IPermission>;
|
|
20
|
-
getPermissionsByActions({ type, applyTo, actions, usersGroupNodeId, permissionTreeTarget, ctx }: IGetPermissionsByActionsParams): Promise<PermByActionsRes>;
|
|
20
|
+
getPermissionsByActions({ type, applyTo, actions, usersGroupNodeId, permissionTreeTarget, ctx, }: IGetPermissionsByActionsParams): Promise<PermByActionsRes>;
|
|
21
21
|
/**
|
|
22
22
|
* Retrieve herited permission: ignore permission defined on given element, force retrieval of herited permission
|
|
23
23
|
*/
|
|
24
|
-
getInheritedPermissions({ type, applyTo, action, userGroupId, permissionTreeTarget, ctx }: IGetInheritedPermissionsParams): Promise<boolean>;
|
|
24
|
+
getInheritedPermissions({ type, applyTo, action, userGroupId, permissionTreeTarget, ctx, }: IGetInheritedPermissionsParams): Promise<boolean>;
|
|
25
25
|
isAllowed({ type, action, userId, applyTo, target, ctx }: IIsAllowedParams): Promise<boolean>;
|
|
26
26
|
getActionsByType(params: IGetActionsByTypeParams): ILabeledPermissionsAction[];
|
|
27
27
|
registerActions(type: PermissionTypes, actions: string[], applyOn?: string[]): void;
|
|
@@ -7,5 +7,5 @@ export interface ITreeLibraryPermissionDomain {
|
|
|
7
7
|
interface IDeps {
|
|
8
8
|
'core.domain.permission.helpers.globalPermission': IGlobalPermissionHelper;
|
|
9
9
|
}
|
|
10
|
-
export default function ({ 'core.domain.permission.helpers.globalPermission': globalPermHelper }: IDeps): ITreeLibraryPermissionDomain;
|
|
10
|
+
export default function ({ 'core.domain.permission.helpers.globalPermission': globalPermHelper, }: IDeps): ITreeLibraryPermissionDomain;
|
|
11
11
|
export {};
|
|
@@ -7,5 +7,5 @@ export interface ITreePermissionDomain {
|
|
|
7
7
|
interface IDeps {
|
|
8
8
|
'core.domain.permission.helpers.globalPermission': IGlobalPermissionHelper;
|
|
9
9
|
}
|
|
10
|
-
export default function ({ 'core.domain.permission.helpers.globalPermission': globalPermHelper }: IDeps): ITreePermissionDomain;
|
|
10
|
+
export default function ({ 'core.domain.permission.helpers.globalPermission': globalPermHelper, }: IDeps): ITreePermissionDomain;
|
|
11
11
|
export {};
|
|
@@ -15,5 +15,5 @@ interface IDeps {
|
|
|
15
15
|
'core.domain.permission.library': ILibraryPermissionDomain;
|
|
16
16
|
'core.infra.record': IRecordRepo;
|
|
17
17
|
}
|
|
18
|
-
export default function ({ 'core.domain.eventsManager': eventsManager, 'core.domain.permission.library': libraryPermissionDomain, 'core.infra.record': recordRepo }: IDeps): CreateRecordHelper;
|
|
18
|
+
export default function ({ 'core.domain.eventsManager': eventsManager, 'core.domain.permission.library': libraryPermissionDomain, 'core.infra.record': recordRepo, }: IDeps): CreateRecordHelper;
|
|
19
19
|
export {};
|
|
@@ -15,5 +15,5 @@ interface IDeps {
|
|
|
15
15
|
'core.infra.tree': ITreeRepo;
|
|
16
16
|
'core.infra.value': IValueRepo;
|
|
17
17
|
}
|
|
18
|
-
export default function ({ 'core.domain.eventsManager': eventsManager, 'core.domain.helpers.validate': validateHelper, 'core.domain.permission.record': recordPermissionDomain, 'core.infra.record': recordRepo, 'core.infra.tree': treeRepo, 'core.infra.value': valueRepo }: IDeps): DeleteRecordHelper;
|
|
18
|
+
export default function ({ 'core.domain.eventsManager': eventsManager, 'core.domain.helpers.validate': validateHelper, 'core.domain.permission.record': recordPermissionDomain, 'core.infra.record': recordRepo, 'core.infra.tree': treeRepo, 'core.infra.value': valueRepo, }: IDeps): DeleteRecordHelper;
|
|
19
19
|
export {};
|
|
@@ -20,6 +20,12 @@ export interface IGetAccessPermissionsValue {
|
|
|
20
20
|
attribute: IAttribute;
|
|
21
21
|
permissions: INodeIdsByPermissions;
|
|
22
22
|
}
|
|
23
|
-
export type IGetAccessPermissions = (
|
|
23
|
+
export type IGetAccessPermissions = (params: {
|
|
24
|
+
groupsIds: string[][];
|
|
25
|
+
library: string;
|
|
26
|
+
existingFiltersOnTreeIds: string[];
|
|
27
|
+
deps: IAccessPermissionFilterDeps;
|
|
28
|
+
ignoreAccessRecordByDefaultPermission?: boolean;
|
|
29
|
+
}, ctx: IQueryInfos) => Promise<IGetAccessPermissionsValue[]>;
|
|
24
30
|
declare const getAccessPermissionsFilters: IGetAccessPermissions;
|
|
25
31
|
export default getAccessPermissionsFilters;
|
|
@@ -53,7 +53,7 @@ export interface IRecordDomain {
|
|
|
53
53
|
* Update record
|
|
54
54
|
* Must be used to update metadata (modified_at, ...) only
|
|
55
55
|
*/
|
|
56
|
-
updateRecord({ library, recordData, ctx }: {
|
|
56
|
+
updateRecord({ library, recordData, ctx, }: {
|
|
57
57
|
library: string;
|
|
58
58
|
recordData: IRecord;
|
|
59
59
|
ctx: IQueryInfos;
|
|
@@ -84,7 +84,7 @@ export interface IRecordDomain {
|
|
|
84
84
|
* @param params.options
|
|
85
85
|
* @param params.ctx
|
|
86
86
|
*/
|
|
87
|
-
getRecordFieldValue({ library, record, attributeId, options, ctx }: {
|
|
87
|
+
getRecordFieldValue({ library, record, attributeId, options, ctx, }: {
|
|
88
88
|
library: string;
|
|
89
89
|
record: IRecord;
|
|
90
90
|
attributeId: string;
|
|
@@ -141,4 +141,4 @@ export interface IRecordDomainDeps {
|
|
|
141
141
|
'core.utils': IUtils;
|
|
142
142
|
translator: i18n;
|
|
143
143
|
}
|
|
144
|
-
export default function ({ config, 'core.infra.record': recordRepo, 'core.domain.attribute': attributeDomain, 'core.domain.value': valueDomain, 'core.domain.permission.record': recordPermissionDomain, 'core.domain.permission.library': libraryPermissionDomain, 'core.domain.permission.recordAttribute': recordAttributePermissionDomain, 'core.domain.permission.helpers.defaultPermission': defaultPermHelper, 'core.domain.helpers.getCoreEntityById': getCoreEntityById, 'core.domain.helpers.validate': validateHelper, 'core.domain.record.helpers.createRecord': createRecordHelper, 'core.domain.record.helpers.deleteRecord': deleteRecordHelper, 'core.domain.record.helpers.sendRecordUpdateEvent': sendRecordUpdateEvent, 'core.infra.library': libraryRepo, 'core.infra.tree': treeRepo, 'core.domain.tree.helpers.elementAncestors': elementAncestorsHelper, 'core.infra.form': formRepo, 'core.infra.permission': permissionRepo, 'core.domain.eventsManager': eventsManager, 'core.infra.cache.cacheService': cacheService, 'core.utils.logger': logger, 'core.utils': utils, translator }: IRecordDomainDeps): IRecordDomain;
|
|
144
|
+
export default function ({ config, 'core.infra.record': recordRepo, 'core.domain.attribute': attributeDomain, 'core.domain.value': valueDomain, 'core.domain.permission.record': recordPermissionDomain, 'core.domain.permission.library': libraryPermissionDomain, 'core.domain.permission.recordAttribute': recordAttributePermissionDomain, 'core.domain.permission.helpers.defaultPermission': defaultPermHelper, 'core.domain.helpers.getCoreEntityById': getCoreEntityById, 'core.domain.helpers.validate': validateHelper, 'core.domain.record.helpers.createRecord': createRecordHelper, 'core.domain.record.helpers.deleteRecord': deleteRecordHelper, 'core.domain.record.helpers.sendRecordUpdateEvent': sendRecordUpdateEvent, 'core.infra.library': libraryRepo, 'core.infra.tree': treeRepo, 'core.domain.tree.helpers.elementAncestors': elementAncestorsHelper, 'core.infra.form': formRepo, 'core.infra.permission': permissionRepo, 'core.domain.eventsManager': eventsManager, 'core.infra.cache.cacheService': cacheService, 'core.utils.logger': logger, 'core.utils': utils, translator, }: IRecordDomainDeps): IRecordDomain;
|
|
@@ -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;
|
|
@@ -66,5 +66,5 @@ export interface ITasksManagerDomainDeps {
|
|
|
66
66
|
'core.utils': IUtils;
|
|
67
67
|
'core.utils.getSystemQueryContext': GetSystemQueryContext;
|
|
68
68
|
}
|
|
69
|
-
export default function ({ config, 'core.infra.amqpService': amqpService, 'core.infra.task': taskRepo, 'core.depsManager': depsManager, 'core.domain.eventsManager': eventsManager, 'core.utils.logger': logger, 'core.utils': utils, 'core.utils.getSystemQueryContext': getSystemQueryContext }: ITasksManagerDomainDeps): ITasksManagerDomain;
|
|
69
|
+
export default function ({ config, 'core.infra.amqpService': amqpService, 'core.infra.task': taskRepo, 'core.depsManager': depsManager, 'core.domain.eventsManager': eventsManager, 'core.utils.logger': logger, 'core.utils': utils, 'core.utils.getSystemQueryContext': getSystemQueryContext, }: ITasksManagerDomainDeps): ITasksManagerDomain;
|
|
70
70
|
export {};
|
|
@@ -12,5 +12,5 @@ export interface IElementAncestorsHelper {
|
|
|
12
12
|
ctx: any;
|
|
13
13
|
}) => Promise<void>;
|
|
14
14
|
}
|
|
15
|
-
export default function ({ 'core.infra.tree': treeRepo, 'core.infra.cache.cacheService': cacheService }: IDeps): IElementAncestorsHelper;
|
|
15
|
+
export default function ({ 'core.infra.tree': treeRepo, 'core.infra.cache.cacheService': cacheService, }: IDeps): IElementAncestorsHelper;
|
|
16
16
|
export {};
|
|
@@ -18,5 +18,5 @@ export interface IGetDefaultElementHelper {
|
|
|
18
18
|
ctx: any;
|
|
19
19
|
}) => Promise<void>;
|
|
20
20
|
}
|
|
21
|
-
export default function ({ 'core.infra.tree': treeRepo, 'core.infra.cache.cacheService': cacheService, 'core.utils': utils }: IDeps): IGetDefaultElementHelper;
|
|
21
|
+
export default function ({ 'core.infra.tree': treeRepo, 'core.infra.cache.cacheService': cacheService, 'core.utils': utils, }: IDeps): IGetDefaultElementHelper;
|
|
22
22
|
export {};
|
|
@@ -156,4 +156,4 @@ export interface ITreeDomainDeps {
|
|
|
156
156
|
'core.utils': IUtils;
|
|
157
157
|
'core.infra.cache.cacheService': ICachesService;
|
|
158
158
|
}
|
|
159
|
-
export default function ({ 'core.domain.record': recordDomain, 'core.domain.attribute': attributeDomain, 'core.domain.permission.admin': adminPermissionDomain, 'core.domain.permission.tree': treePermissionDomain, 'core.domain.permission.treeNode': treeNodePermissionDomain, 'core.domain.tree.helpers.treeDataValidation': treeDataValidationHelper, 'core.domain.helpers.getCoreEntityById': getCoreEntityById, 'core.domain.tree.helpers.elementAncestors': elementAncestorsHelper, 'core.domain.tree.helpers.handleRemovedLibraries': handleRemovedLibraries, 'core.domain.tree.helpers.getDefaultElement': getDefaultElementHelper, 'core.domain.eventsManager': eventsManagerDomain, 'core.infra.library': libraryRepo, 'core.infra.tree': treeRepo, 'core.infra.versionProfile': versionProfileRepo, 'core.utils': utils, 'core.infra.cache.cacheService': cacheService }: ITreeDomainDeps): ITreeDomain;
|
|
159
|
+
export default function ({ 'core.domain.record': recordDomain, 'core.domain.attribute': attributeDomain, 'core.domain.permission.admin': adminPermissionDomain, 'core.domain.permission.tree': treePermissionDomain, 'core.domain.permission.treeNode': treeNodePermissionDomain, 'core.domain.tree.helpers.treeDataValidation': treeDataValidationHelper, 'core.domain.helpers.getCoreEntityById': getCoreEntityById, 'core.domain.tree.helpers.elementAncestors': elementAncestorsHelper, 'core.domain.tree.helpers.handleRemovedLibraries': handleRemovedLibraries, 'core.domain.tree.helpers.getDefaultElement': getDefaultElementHelper, 'core.domain.eventsManager': eventsManagerDomain, 'core.infra.library': libraryRepo, 'core.infra.tree': treeRepo, 'core.infra.versionProfile': versionProfileRepo, 'core.utils': utils, 'core.infra.cache.cacheService': cacheService, }: ITreeDomainDeps): ITreeDomain;
|
|
@@ -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 {};
|
|
@@ -19,5 +19,5 @@ interface IDeps {
|
|
|
19
19
|
'core.utils.logger': ILogger;
|
|
20
20
|
translator: i18n;
|
|
21
21
|
}
|
|
22
|
-
export default function ({ 'core.domain.actionsList': actionsListDomain, 'core.domain.record': recordDomain, 'core.domain.attribute': attributeDomain, 'core.domain.tree': treeDomain, 'core.utils.logger': logger, translator }: IDeps): IFormatLogValueHelper;
|
|
22
|
+
export default function ({ 'core.domain.actionsList': actionsListDomain, 'core.domain.record': recordDomain, 'core.domain.attribute': attributeDomain, 'core.domain.tree': treeDomain, 'core.utils.logger': logger, translator, }: IDeps): IFormatLogValueHelper;
|
|
23
23
|
export {};
|
|
@@ -47,7 +47,7 @@ export interface IValueDomain {
|
|
|
47
47
|
* @param params.options
|
|
48
48
|
* @param params.ctx
|
|
49
49
|
*/
|
|
50
|
-
getValues({ library, recordId, attribute, options, ctx }: {
|
|
50
|
+
getValues({ library, recordId, attribute, options, ctx, }: {
|
|
51
51
|
library: string;
|
|
52
52
|
recordId: string;
|
|
53
53
|
attribute: string;
|
|
@@ -58,7 +58,7 @@ export interface IValueDomain {
|
|
|
58
58
|
* Save value takes one value as parameter, apply all actions that can return multiple values and return them
|
|
59
59
|
* @example [inheritance, calculation, etc].
|
|
60
60
|
*/
|
|
61
|
-
saveValue({ library, recordId, attribute, value, ctx }: {
|
|
61
|
+
saveValue({ library, recordId, attribute, value, ctx, }: {
|
|
62
62
|
library: string;
|
|
63
63
|
recordId: string;
|
|
64
64
|
attribute: string;
|
|
@@ -88,11 +88,6 @@ export interface IValueDomain {
|
|
|
88
88
|
ctx: IQueryInfos;
|
|
89
89
|
}): Promise<IValue>;
|
|
90
90
|
runActionsList(params: IRunActionListParams): Promise<IValue[]>;
|
|
91
|
-
runActionsListAndFormatOnValue({ library, value, ctx }: {
|
|
92
|
-
library: string;
|
|
93
|
-
value: IValue;
|
|
94
|
-
ctx: IQueryInfos;
|
|
95
|
-
}): Promise<IValue[]>;
|
|
96
91
|
}
|
|
97
92
|
export interface IValueDomainDeps {
|
|
98
93
|
config: Config.IConfig;
|
|
@@ -118,5 +113,5 @@ export interface IValueDomainDeps {
|
|
|
118
113
|
'core.utils.logger': ILogger;
|
|
119
114
|
'core.domain.tree': ITreeDomain;
|
|
120
115
|
}
|
|
121
|
-
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;
|
|
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;
|
|
122
117
|
export default valueDomain;
|
|
@@ -42,4 +42,4 @@ export interface IVersionProfileDomainDeps {
|
|
|
42
42
|
'core.infra.cache.cacheService': ICachesService;
|
|
43
43
|
'core.utils': IUtils;
|
|
44
44
|
}
|
|
45
|
-
export default function ({ 'core.domain.permission.admin': adminPermissionDomain, 'core.domain.helpers.getCoreEntityById': getCoreEntityById, 'core.domain.eventsManager': eventsManagerDomain, 'core.infra.versionProfile': versionProfileRepo, 'core.infra.tree': treeRepo, 'core.infra.attribute': attributeRepo, 'core.infra.cache.cacheService': cacheService, 'core.utils': utils }: IVersionProfileDomainDeps): IVersionProfileDomain;
|
|
45
|
+
export default function ({ 'core.domain.permission.admin': adminPermissionDomain, 'core.domain.helpers.getCoreEntityById': getCoreEntityById, 'core.domain.eventsManager': eventsManagerDomain, 'core.infra.versionProfile': versionProfileRepo, 'core.infra.tree': treeRepo, 'core.infra.attribute': attributeRepo, 'core.infra.cache.cacheService': cacheService, 'core.utils': utils, }: IVersionProfileDomainDeps): IVersionProfileDomain;
|
|
@@ -17,4 +17,4 @@ export interface IViewDomainDeps {
|
|
|
17
17
|
'core.infra.view': IViewRepo;
|
|
18
18
|
'core.utils': IUtils;
|
|
19
19
|
}
|
|
20
|
-
export default function ({ 'core.domain.helpers.validate': validationHelper, 'core.domain.tree': treeDomain, 'core.infra.view': viewRepo, 'core.utils': utils }: IViewDomainDeps): IViewDomain;
|
|
20
|
+
export default function ({ 'core.domain.helpers.validate': validationHelper, 'core.domain.tree': treeDomain, 'core.infra.view': viewRepo, 'core.utils': utils, }: IViewDomainDeps): IViewDomain;
|
|
@@ -16,7 +16,7 @@ export default class LeavError<T, E = ErrorTypes> extends Error {
|
|
|
16
16
|
record?: ILeavErrorRecord;
|
|
17
17
|
/**
|
|
18
18
|
* Use this ID to identify the error in logs or for debugging purposes.
|
|
19
|
-
* It is generated using uuid
|
|
19
|
+
* It is generated using uuid v4, which includes a timestamp and a unique identifier.
|
|
20
20
|
* This allows for tracking the error across different systems and logs.
|
|
21
21
|
*/
|
|
22
22
|
errorId: string;
|
|
@@ -26,4 +26,4 @@ export interface IApiKeyRepoDeps {
|
|
|
26
26
|
'core.infra.db.dbUtils': IDbUtils;
|
|
27
27
|
'core.infra.db.dbService': IDbService;
|
|
28
28
|
}
|
|
29
|
-
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils }: IApiKeyRepoDeps): IApiKeyRepo;
|
|
29
|
+
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, }: IApiKeyRepoDeps): IApiKeyRepo;
|
|
@@ -34,5 +34,5 @@ interface IDeps {
|
|
|
34
34
|
'core.utils.logger'?: ILogger;
|
|
35
35
|
config?: IConfig;
|
|
36
36
|
}
|
|
37
|
-
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.utils.logger': logger, config }?: IDeps): IApplicationRepo;
|
|
37
|
+
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.utils.logger': logger, config, }?: IDeps): IApplicationRepo;
|
|
38
38
|
export {};
|
|
@@ -52,5 +52,5 @@ interface IDeps {
|
|
|
52
52
|
export interface IAttributeForRepo extends IAttribute {
|
|
53
53
|
multiple_values: boolean;
|
|
54
54
|
}
|
|
55
|
-
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.value': valueRepo, 'core.utils': utils }?: IDeps): IAttributeRepo;
|
|
55
|
+
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.value': valueRepo, 'core.utils': utils, }?: IDeps): IAttributeRepo;
|
|
56
56
|
export {};
|
|
@@ -15,5 +15,5 @@ interface IDeps {
|
|
|
15
15
|
'core.infra.record.helpers.filterTypes'?: IFilterTypesHelper;
|
|
16
16
|
'core.utils'?: IUtils;
|
|
17
17
|
}
|
|
18
|
-
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes.attributeSimpleLink': attributeSimpleLinkRepo, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypes, 'core.utils': utils }?: IDeps): IAttributeAdvancedLinkRepo;
|
|
18
|
+
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes.attributeSimpleLink': attributeSimpleLinkRepo, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypes, 'core.utils': utils, }?: IDeps): IAttributeAdvancedLinkRepo;
|
|
19
19
|
export {};
|
|
@@ -11,4 +11,4 @@ export interface IAttributeAdvancedRepoDeps {
|
|
|
11
11
|
'core.infra.record.helpers.filterTypes': IFilterTypesHelper;
|
|
12
12
|
}
|
|
13
13
|
export type IAttributeAdvancedRepo = IAttributeTypeRepo<AttributeTypes.ADVANCED>;
|
|
14
|
-
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypesHelper }: IAttributeAdvancedRepoDeps): IAttributeAdvancedRepo;
|
|
14
|
+
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypesHelper, }: IAttributeAdvancedRepoDeps): IAttributeAdvancedRepo;
|
|
@@ -13,5 +13,5 @@ interface IDeps {
|
|
|
13
13
|
'core.infra.record.helpers.filterTypes'?: IFilterTypesHelper;
|
|
14
14
|
}
|
|
15
15
|
export type IAttributeSimpleLinkRepo = IAttributeTypeRepo<AttributeTypes.SIMPLE_LINK>;
|
|
16
|
-
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes.attributeSimple': attributeSimpleRepo, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypesHelper }?: IDeps): IAttributeSimpleLinkRepo;
|
|
16
|
+
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes.attributeSimple': attributeSimpleRepo, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypesHelper, }?: IDeps): IAttributeSimpleLinkRepo;
|
|
17
17
|
export {};
|
|
@@ -9,5 +9,5 @@ interface IDeps {
|
|
|
9
9
|
'core.infra.record.helpers.filterTypes'?: IFilterTypesHelper;
|
|
10
10
|
}
|
|
11
11
|
export type IAttributeSimpleRepo = IAttributeTypeRepo<AttributeTypes.SIMPLE>;
|
|
12
|
-
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypesHelper }?: IDeps): IAttributeSimpleRepo;
|
|
12
|
+
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypesHelper, }?: IDeps): IAttributeSimpleRepo;
|
|
13
13
|
export {};
|
|
@@ -13,5 +13,5 @@ interface IDeps {
|
|
|
13
13
|
'core.utils'?: IUtils;
|
|
14
14
|
}
|
|
15
15
|
export type IAttributeTreeRepo = IAttributeTypeRepo<AttributeTypes.TREE>;
|
|
16
|
-
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypes, 'core.utils': utils }?: IDeps): IAttributeTreeRepo;
|
|
16
|
+
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.filterTypes': filterTypes, 'core.utils': utils, }?: IDeps): IAttributeTreeRepo;
|
|
17
17
|
export {};
|
|
@@ -25,7 +25,7 @@ export type GetConditionPartFunc = (valueIdentifier: string | AqlLiteral) => Gen
|
|
|
25
25
|
* Define interface used for all attribute type specific files
|
|
26
26
|
*/
|
|
27
27
|
export interface IAttributeTypeRepo<AttributeType extends AttributeTypes = AttributeTypes, Value = IValueByAttributeType[AttributeType]> {
|
|
28
|
-
createValue({ library, recordId, attribute, value, ctx }: {
|
|
28
|
+
createValue({ library, recordId, attribute, value, ctx, }: {
|
|
29
29
|
library: string;
|
|
30
30
|
recordId: string;
|
|
31
31
|
attribute: IAttributeWithRevLink;
|
|
@@ -35,7 +35,7 @@ export interface IAttributeTypeRepo<AttributeType extends AttributeTypes = Attri
|
|
|
35
35
|
/**
|
|
36
36
|
* Update an existing value. Field "id" is expected on the value
|
|
37
37
|
*/
|
|
38
|
-
updateValue({ library, recordId, attribute, value, ctx }: {
|
|
38
|
+
updateValue({ library, recordId, attribute, value, ctx, }: {
|
|
39
39
|
library: string;
|
|
40
40
|
recordId: string;
|
|
41
41
|
attribute: IAttributeWithRevLink;
|
|
@@ -45,7 +45,7 @@ export interface IAttributeTypeRepo<AttributeType extends AttributeTypes = Attri
|
|
|
45
45
|
/**
|
|
46
46
|
* Delete an existing value. Field "id" is expected on the value
|
|
47
47
|
*/
|
|
48
|
-
deleteValue({ library, recordId, attribute, value, ctx }: {
|
|
48
|
+
deleteValue({ library, recordId, attribute, value, ctx, }: {
|
|
49
49
|
library: string;
|
|
50
50
|
recordId: string;
|
|
51
51
|
attribute: IAttributeWithRevLink;
|
|
@@ -55,7 +55,7 @@ export interface IAttributeTypeRepo<AttributeType extends AttributeTypes = Attri
|
|
|
55
55
|
/**
|
|
56
56
|
* Check if a value is unique
|
|
57
57
|
*/
|
|
58
|
-
isValueUsed?({ library, excludedRecordId, attribute, value, ctx }: {
|
|
58
|
+
isValueUsed?({ library, excludedRecordId, attribute, value, ctx, }: {
|
|
59
59
|
library: string;
|
|
60
60
|
excludedRecordId?: string;
|
|
61
61
|
attribute: IAttribute;
|
|
@@ -67,7 +67,7 @@ export interface IAttributeTypeRepo<AttributeType extends AttributeTypes = Attri
|
|
|
67
67
|
*
|
|
68
68
|
* @return Array<{}> Return an empty array if no value found
|
|
69
69
|
*/
|
|
70
|
-
getValues({ library, recordId, attribute, forceGetAllValues, options, ctx }: {
|
|
70
|
+
getValues({ library, recordId, attribute, forceGetAllValues, options, ctx, }: {
|
|
71
71
|
library: string;
|
|
72
72
|
recordId: string;
|
|
73
73
|
attribute: IAttributeWithRevLink;
|
|
@@ -80,7 +80,7 @@ export interface IAttributeTypeRepo<AttributeType extends AttributeTypes = Attri
|
|
|
80
80
|
*
|
|
81
81
|
* @return Array<{}> Return an empty array if no value found for each record
|
|
82
82
|
*/
|
|
83
|
-
getValuesBatch({ library, attribute, recordIds, options, ctx }: {
|
|
83
|
+
getValuesBatch({ library, attribute, recordIds, options, ctx, }: {
|
|
84
84
|
library: string;
|
|
85
85
|
attribute: IAttributeWithRevLink;
|
|
86
86
|
recordIds: string[];
|
|
@@ -92,7 +92,7 @@ export interface IAttributeTypeRepo<AttributeType extends AttributeTypes = Attri
|
|
|
92
92
|
*
|
|
93
93
|
* @return Array<{}> Return an empty array if no value found
|
|
94
94
|
*/
|
|
95
|
-
getReverseValues?({ advancedLinkAttr, ctx }: {
|
|
95
|
+
getReverseValues?({ advancedLinkAttr, ctx, }: {
|
|
96
96
|
advancedLinkAttr: IAttributeWithRevLink;
|
|
97
97
|
value: string;
|
|
98
98
|
forceGetAllValues: boolean;
|
|
@@ -103,7 +103,7 @@ export interface IAttributeTypeRepo<AttributeType extends AttributeTypes = Attri
|
|
|
103
103
|
*
|
|
104
104
|
* @return Array<{}> Return an empty array if no value found for each record
|
|
105
105
|
*/
|
|
106
|
-
getReverseValuesBatch?({ advancedLinkAttr, ctx }: {
|
|
106
|
+
getReverseValuesBatch?({ advancedLinkAttr, ctx, }: {
|
|
107
107
|
advancedLinkAttr: IAttributeWithRevLink;
|
|
108
108
|
values: string[];
|
|
109
109
|
forceGetAllValues: boolean;
|
|
@@ -114,7 +114,7 @@ export interface IAttributeTypeRepo<AttributeType extends AttributeTypes = Attri
|
|
|
114
114
|
*
|
|
115
115
|
* @return {} Return null if no value found
|
|
116
116
|
*/
|
|
117
|
-
getValueById?({ library, recordId, attribute, valueId, ctx }: {
|
|
117
|
+
getValueById?({ library, recordId, attribute, valueId, ctx, }: {
|
|
118
118
|
library: string;
|
|
119
119
|
recordId: string;
|
|
120
120
|
attribute: IAttribute;
|
|
@@ -154,5 +154,5 @@ interface IDeps {
|
|
|
154
154
|
'core.infra.attributeTypes.attributeAdvancedLink'?: IAttributeAdvancedLinkRepo;
|
|
155
155
|
'core.infra.attributeTypes.attributeTree'?: IAttributeTreeRepo;
|
|
156
156
|
}
|
|
157
|
-
export default function ({ 'core.infra.attributeTypes.attributeSimple': attributeSimpleRepo, 'core.infra.attributeTypes.attributeSimpleLink': attributeSimpleLinkRepo, 'core.infra.attributeTypes.attributeAdvanced': attributeAdvancedRepo, 'core.infra.attributeTypes.attributeAdvancedLink': attributeAdvancedLinkRepo, 'core.infra.attributeTypes.attributeTree': attributeTreeRepo }?: IDeps): IAttributeTypesRepo;
|
|
157
|
+
export default function ({ 'core.infra.attributeTypes.attributeSimple': attributeSimpleRepo, 'core.infra.attributeTypes.attributeSimpleLink': attributeSimpleLinkRepo, 'core.infra.attributeTypes.attributeAdvanced': attributeAdvancedRepo, 'core.infra.attributeTypes.attributeAdvancedLink': attributeAdvancedLinkRepo, 'core.infra.attributeTypes.attributeTree': attributeTreeRepo, }?: IDeps): IAttributeTypesRepo;
|
|
158
158
|
export {};
|
|
@@ -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
1
|
import { type ICacheService } from './cacheService';
|
|
2
2
|
import { type RedisClientType } from './redis';
|
|
3
|
-
|
|
4
|
-
interface IDeps {
|
|
5
|
-
config?: IConfig;
|
|
6
|
-
'core.infra.redis'?: RedisClientType;
|
|
7
|
-
}
|
|
8
|
-
export default function ({ 'core.infra.redis': redis, config }: 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 {};
|
|
@@ -36,5 +36,5 @@ interface IDeps {
|
|
|
36
36
|
config?: IConfig;
|
|
37
37
|
'core.utils.getSystemQueryContext'?: GetSystemQueryContext;
|
|
38
38
|
}
|
|
39
|
-
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.cache.cacheService': cacheService, 'core.utils.logger': logger, config, 'core.utils.getSystemQueryContext': getSystemQueryContext }?: IDeps): IDbUtils;
|
|
39
|
+
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.cache.cacheService': cacheService, 'core.utils.logger': logger, config, 'core.utils.getSystemQueryContext': getSystemQueryContext, }?: IDeps): IDbUtils;
|
|
40
40
|
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ILibraryRepo } from '../../library/libraryRepo';
|
|
2
|
+
import { type IDbService } from '../dbService';
|
|
3
|
+
import { type IQueryInfos } from '../../../_types/queryInfos';
|
|
4
|
+
import { type IAttributeForRepo, type IAttributeRepo } from '../../attribute/attributeRepo';
|
|
5
|
+
import { type ITree } from '../../../_types/tree';
|
|
6
|
+
import { type Override } from '@leav/utils';
|
|
7
|
+
import { type ILibraryDbEvent } from '../../../_types/library';
|
|
8
|
+
export type MigrationLibraryToCreate = Override<ILibraryDbEvent, {
|
|
9
|
+
attributes: string[];
|
|
10
|
+
fullTextAttributes: string[];
|
|
11
|
+
}> & {
|
|
12
|
+
_key: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const commonAttributeData: {
|
|
15
|
+
system: boolean;
|
|
16
|
+
required: boolean;
|
|
17
|
+
multiple_values: boolean;
|
|
18
|
+
versions_conf: {
|
|
19
|
+
versionable: boolean;
|
|
20
|
+
};
|
|
21
|
+
readonly: boolean;
|
|
22
|
+
actions_list: {
|
|
23
|
+
getValue: any[];
|
|
24
|
+
saveValue: {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
is_system: boolean;
|
|
28
|
+
}[];
|
|
29
|
+
deleteValue: any[];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export declare const createLibraries: (libraries: MigrationLibraryToCreate[], dbService: IDbService, libraryRepo: ILibraryRepo, ctx: IQueryInfos) => Promise<void>;
|
|
33
|
+
export declare const createAttributes: (attributes: IAttributeForRepo[], attributeRepo: IAttributeRepo, ctx: IQueryInfos) => Promise<void>;
|
|
34
|
+
export declare const linkLibraryAttributes: (attributeRepo: IAttributeRepo, libraryRepo: ILibraryRepo, libraryId: string, attributes: IAttributeForRepo[], ctx: IQueryInfos) => Promise<void>;
|
|
35
|
+
export type MigrationTreeToCreate = ITree & {
|
|
36
|
+
_key: string;
|
|
37
|
+
};
|
|
38
|
+
export declare const createTrees: (trees: MigrationTreeToCreate[], dbService: IDbService, ctx: IQueryInfos) => Promise<void>;
|
|
@@ -13,5 +13,5 @@ interface IDeps {
|
|
|
13
13
|
translator?: i18n;
|
|
14
14
|
config?: IConfig;
|
|
15
15
|
}
|
|
16
|
-
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.library': libraryRepo, 'core.infra.attribute': attributeRepo, 'core.infra.permission': permissionRepo, translator, config }?: IDeps): IMigration;
|
|
16
|
+
export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.library': libraryRepo, 'core.infra.attribute': attributeRepo, 'core.infra.permission': permissionRepo, translator, config, }?: IDeps): IMigration;
|
|
17
17
|
export {};
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type ILibrary } from '../../../../_types/library';
|
|
3
|
-
export type MigrationLibraryToCreate = Override<ILibrary, {
|
|
4
|
-
attributes: string[];
|
|
5
|
-
fullTextAttributes: string[];
|
|
6
|
-
}> & {
|
|
7
|
-
_key: string;
|
|
8
|
-
};
|
|
1
|
+
import { type MigrationLibraryToCreate } from '../../helpers/libraryUtils';
|
|
9
2
|
export declare const systemLibraries: MigrationLibraryToCreate[];
|