@aristid/leav-types 1.6.0-8858e835 → 1.6.0-95bcf843
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/src/__tests__/e2e/api/_fixtures/fakeplugin/index.d.ts +5 -1
- package/apps/core/src/__tests__/e2e/api/e2eUtils.d.ts +1 -0
- package/apps/core/src/__tests__/e2e/api/taskUtils.d.ts +4 -0
- package/apps/core/src/_types/actionsList.d.ts +2 -0
- package/apps/core/src/app/core/permissionApp/_types.d.ts +2 -1
- package/apps/core/src/domain/attribute/helpers/attributeALHelper.d.ts +2 -1
- package/apps/core/src/domain/permission/_types.d.ts +1 -0
- package/apps/core/src/domain/permission/attributeDependentValuesPermissionDomain.d.ts +9 -1
- package/apps/core/src/domain/permission/permissionDomain.d.ts +1 -1
- package/apps/core/src/domain/value/helpers/postDeleteValue.d.ts +28 -0
- package/apps/core/src/domain/value/helpers/postSaveValue.d.ts +28 -0
- package/apps/core/src/infra/db/helpers/libraryUtils.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { type i18n } from 'i18next';
|
|
2
2
|
import { type IPluginInitModule } from '_types/plugin';
|
|
3
|
+
import { type IValueRepo } from '../../../../../infra/value/valueRepo';
|
|
4
|
+
import { type IAttributeDomain } from '../../../../../domain/attribute/attributeDomain';
|
|
3
5
|
interface IDeps {
|
|
4
6
|
translator: i18n;
|
|
7
|
+
'core.infra.value': IValueRepo;
|
|
8
|
+
'core.domain.attribute': IAttributeDomain;
|
|
5
9
|
}
|
|
6
|
-
export default function ({ translator }: IDeps): IPluginInitModule;
|
|
10
|
+
export default function ({ translator, 'core.infra.value': valueRepo, 'core.domain.attribute': attributeDomain, }: IDeps): IPluginInitModule;
|
|
7
11
|
export {};
|
|
@@ -65,6 +65,7 @@ export declare function gqlCreateRecord(library: string): Promise<string>;
|
|
|
65
65
|
* @return Node ID
|
|
66
66
|
*/
|
|
67
67
|
export declare function gqlAddElemToTree(treeId: string, element: ITreeElement, parent?: string | null, order?: number): Promise<string>;
|
|
68
|
+
export declare function gqlGetValue(libraryId: string, recordId: string, attributeId: string): Promise<any>;
|
|
68
69
|
export declare function gqlSaveValue(attributeId: string, libraryId: string, recordId: string, value: string | number): Promise<void>;
|
|
69
70
|
export declare function gqlSaveVersionProfile(profileId: string, label: string, trees: string[]): Promise<void>;
|
|
70
71
|
/**
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ITask, TaskStatus } from '../../../_types/tasksManager';
|
|
2
|
+
export declare function getTask(taskId: string): Promise<ITask>;
|
|
3
|
+
export declare function waitForTaskCompletion(id: string, timeout?: number, interval?: number): Promise<ITask>;
|
|
4
|
+
export declare function waitForTaskCompletedWithStatus(taskId: string, expectedStatus: TaskStatus.DONE | TaskStatus.FAILED): Promise<ITask>;
|
|
@@ -5,7 +5,9 @@ import { type IValue } from './value';
|
|
|
5
5
|
import { type Errors } from './errors';
|
|
6
6
|
export declare enum ActionsListEvents {
|
|
7
7
|
SAVE_VALUE = "saveValue",
|
|
8
|
+
POST_SAVE_VALUE = "postSaveValue",
|
|
8
9
|
DELETE_VALUE = "deleteValue",
|
|
10
|
+
POST_DELETE_VALUE = "postDeleteValue",
|
|
9
11
|
GET_VALUE = "getValue"
|
|
10
12
|
}
|
|
11
13
|
export declare enum ActionsListIOTypes {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { type IPermissionsTreeTarget, type PermissionsActions, type PermissionTypes } from '_types/permissions';
|
|
1
|
+
import { type IPermissionsDependenciesTreeTarget, type IPermissionsTreeTarget, type PermissionsActions, type PermissionTypes } from '_types/permissions';
|
|
2
2
|
export interface IInheritedPermissionsQueryParams {
|
|
3
3
|
type: PermissionTypes;
|
|
4
4
|
applyTo: string;
|
|
5
5
|
actions: PermissionsActions[];
|
|
6
6
|
userGroupNodeId: string;
|
|
7
7
|
permissionTreeTarget: IPermissionsTreeTarget;
|
|
8
|
+
dependenciesTreeTargets: IPermissionsDependenciesTreeTarget[];
|
|
8
9
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type IUtils } from 'utils/utils';
|
|
2
2
|
import { type ActionsListConfig } from '../../../_types/actionsList';
|
|
3
3
|
import { type IAttribute, type IOAllowedTypes } from '../../../_types/attribute';
|
|
4
|
-
|
|
4
|
+
declare const getAllowedInputTypes: (attribute: IAttribute) => IOAllowedTypes;
|
|
5
|
+
export default getAllowedInputTypes;
|
|
5
6
|
export declare const getAllowedOutputTypes: (attribute: IAttribute) => IOAllowedTypes;
|
|
6
7
|
export declare const getActionsListToSave: (attrDataToSave: IAttribute, existingAttrData: IAttribute, newAttr: boolean, utils: IUtils) => ActionsListConfig;
|
|
@@ -123,6 +123,7 @@ export interface IGetInheritedPermissionsParams {
|
|
|
123
123
|
action: PermissionsActions;
|
|
124
124
|
userGroupId: string;
|
|
125
125
|
permissionTreeTarget?: IPermissionsTreeTarget;
|
|
126
|
+
dependenciesTreeTargets?: IPermissionsDependenciesTreeTarget[];
|
|
126
127
|
ctx: IQueryInfos;
|
|
127
128
|
}
|
|
128
129
|
export interface IIsAllowedParams {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
2
2
|
import { type IValueRepo } from 'infra/value/valueRepo';
|
|
3
|
-
import { type AttributeDependentValuesPermissionsActions } from '../../_types/permissions';
|
|
3
|
+
import { type AttributeDependentValuesPermissionsActions, type IPermissionsDependenciesTreeTarget, type IPermissionsTreeTarget } from '../../_types/permissions';
|
|
4
4
|
import { type IAttributeDomain } from '../attribute/attributeDomain';
|
|
5
5
|
import { type IPermissionByUserGroupsHelper } from './helpers/permissionByUserGroups';
|
|
6
6
|
import { type IElementAncestorsHelper } from 'domain/tree/helpers/elementAncestors';
|
|
@@ -15,6 +15,14 @@ export interface IAttributeDependentValuesPermissionDomain {
|
|
|
15
15
|
valueNodeId: string;
|
|
16
16
|
ctx: IQueryInfos;
|
|
17
17
|
}): Promise<boolean>;
|
|
18
|
+
getInheritedAttributeDependentValuesPermission(params: {
|
|
19
|
+
action: AttributeDependentValuesPermissionsActions;
|
|
20
|
+
attributeId: string;
|
|
21
|
+
userGroupId: string;
|
|
22
|
+
permissionTreeTarget: IPermissionsTreeTarget;
|
|
23
|
+
dependenciesTreeTargets: IPermissionsDependenciesTreeTarget[];
|
|
24
|
+
ctx: IQueryInfos;
|
|
25
|
+
}): Promise<boolean>;
|
|
18
26
|
}
|
|
19
27
|
export interface IRecordAttributePermissionDomainDeps {
|
|
20
28
|
'core.domain.permission.helpers.permissionByUserGroups': IPermissionByUserGroupsHelper;
|
|
@@ -23,7 +23,7 @@ export interface IPermissionDomain {
|
|
|
23
23
|
/**
|
|
24
24
|
* Retrieve herited permission: ignore permission defined on given element, force retrieval of herited permission
|
|
25
25
|
*/
|
|
26
|
-
getInheritedPermissions({ type, applyTo, action, userGroupId, permissionTreeTarget, ctx, }: IGetInheritedPermissionsParams): Promise<boolean>;
|
|
26
|
+
getInheritedPermissions({ type, applyTo, action, userGroupId, permissionTreeTarget, dependenciesTreeTargets, ctx, }: IGetInheritedPermissionsParams): Promise<boolean>;
|
|
27
27
|
isAllowed({ type, action, applyTo, target, ctx }: IIsAllowedParams): Promise<boolean>;
|
|
28
28
|
getActionsByType(params: IGetActionsByTypeParams): Promise<ILabeledPermissionsAction[]>;
|
|
29
29
|
registerActions(type: PermissionTypes, actions: string[], applyOn?: string[]): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type IActionsListDomain } from 'domain/actionsList/actionsListDomain';
|
|
2
|
+
import { type IAttributeDomain } from 'domain/attribute/attributeDomain';
|
|
3
|
+
import { type IUtils } from 'utils/utils';
|
|
4
|
+
import { type IAttribute } from '_types/attribute';
|
|
5
|
+
import { type IQueryInfos } from '_types/queryInfos';
|
|
6
|
+
import { type IValue } from '_types/value';
|
|
7
|
+
/**
|
|
8
|
+
* Parameters for post-delete value processing.
|
|
9
|
+
*/
|
|
10
|
+
interface IPostDeleteValueParams {
|
|
11
|
+
libraryId: string;
|
|
12
|
+
recordId: string;
|
|
13
|
+
attribute: IAttribute;
|
|
14
|
+
value: IValue;
|
|
15
|
+
ctx: IQueryInfos;
|
|
16
|
+
deps: {
|
|
17
|
+
actionsListDomain: IActionsListDomain;
|
|
18
|
+
attributeDomain: IAttributeDomain;
|
|
19
|
+
utils: IUtils;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Executes post-delete action lists on deleted value
|
|
24
|
+
* Action lists can perform side effects
|
|
25
|
+
* Unlike pre-delete value actions, this runs AFTER the value is persisted to the database.
|
|
26
|
+
*/
|
|
27
|
+
declare const postDeleteValue: (params: IPostDeleteValueParams) => Promise<void>;
|
|
28
|
+
export default postDeleteValue;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type IActionsListDomain } from 'domain/actionsList/actionsListDomain';
|
|
2
|
+
import { type IAttributeDomain } from 'domain/attribute/attributeDomain';
|
|
3
|
+
import { type IUtils } from 'utils/utils';
|
|
4
|
+
import { type IAttribute } from '_types/attribute';
|
|
5
|
+
import { type IQueryInfos } from '_types/queryInfos';
|
|
6
|
+
import { type IValue } from '_types/value';
|
|
7
|
+
/**
|
|
8
|
+
* Parameters for post-save value processing.
|
|
9
|
+
*/
|
|
10
|
+
interface IPostSaveValueParams {
|
|
11
|
+
libraryId: string;
|
|
12
|
+
recordId: string;
|
|
13
|
+
attribute: IAttribute;
|
|
14
|
+
value: IValue;
|
|
15
|
+
ctx: IQueryInfos;
|
|
16
|
+
deps: {
|
|
17
|
+
actionsListDomain: IActionsListDomain;
|
|
18
|
+
attributeDomain: IAttributeDomain;
|
|
19
|
+
utils: IUtils;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Executes post-save action lists on saved value
|
|
24
|
+
* Action lists can perform side effects
|
|
25
|
+
* Unlike pre-save value actions, this runs AFTER the value is persisted to the database.
|
|
26
|
+
*/
|
|
27
|
+
declare const postSaveValue: (params: IPostSaveValueParams) => Promise<void>;
|
|
28
|
+
export default postSaveValue;
|
|
@@ -26,7 +26,9 @@ export declare const commonAttributeData: {
|
|
|
26
26
|
name: string;
|
|
27
27
|
is_system: boolean;
|
|
28
28
|
}[];
|
|
29
|
+
postSaveValue: any[];
|
|
29
30
|
deleteValue: any[];
|
|
31
|
+
postDeleteValue: any[];
|
|
30
32
|
};
|
|
31
33
|
};
|
|
32
34
|
export declare const createLibraries: (libraries: MigrationLibraryToCreate[], dbService: IDbService, libraryRepo: ILibraryRepo, ctx: IQueryInfos) => Promise<void>;
|