@aristid/leav-types 1.6.0-3d4e4455 → 1.6.0-40764e8c

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.
@@ -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
  /**
@@ -1,3 +1,4 @@
1
- import { type ITask } from '../../../_types/tasksManager';
1
+ import { type ITask, TaskStatus } from '../../../_types/tasksManager';
2
2
  export declare function getTask(taskId: string): Promise<ITask>;
3
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,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
- export declare const getAllowedInputTypes: (attribute: IAttribute) => IOAllowedTypes;
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;
@@ -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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aristid/leav-types",
3
- "version": "1.6.0-3d4e4455",
3
+ "version": "1.6.0-40764e8c",
4
4
  "description": "Shared Leav types",
5
5
  "scripts": {
6
6
  "tscheck": "",