@aristid/leav-types 1.4.1-f881b862 → 1.5.0-01ca96c4

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.
@@ -17,6 +17,7 @@ export declare class E2EGraphQLError extends Error {
17
17
  }
18
18
  export interface IMakeGraphQlCallOptions {
19
19
  user?: IE2EUser;
20
+ skipLogErrors?: boolean;
20
21
  }
21
22
  export declare function makeGraphQlCall(query: string | FormData, options?: IMakeGraphQlCallOptions): Promise<any>;
22
23
  export declare function importFileGraphQlCall(query: string, filePath: string, sheets?: any): Promise<any>;
@@ -35,6 +36,7 @@ export declare function gqlSaveAttribute(params: {
35
36
  linkedTree?: string;
36
37
  multipleValues?: boolean;
37
38
  reverseLink?: string;
39
+ unique?: boolean;
38
40
  actionsList?: ActionsListConfig;
39
41
  required?: boolean;
40
42
  }): Promise<any>;
@@ -16,3 +16,4 @@ export { default as validateFormatAction } from './validateFormatAction';
16
16
  export { default as validateRegexAction } from './validateRegexAction';
17
17
  export { default as validateURLAction } from './validateURLAction';
18
18
  export { default as toUppercaseAction } from './toUppercaseAction';
19
+ export { default as toLowercaseAction } from './toLowercaseAction';
@@ -0,0 +1,2 @@
1
+ import { type IActionsListFunction } from '../../_types/actionsList';
2
+ export default function (): IActionsListFunction;
@@ -1,6 +1,7 @@
1
1
  import { type AdminPermissionsActions, type ApplicationPermissionsActions, type AttributePermissionsActions, type IPermissionsTreeTarget, type ITreePermissionsConf, type LibraryPermissionsActions, type PermissionsActions, type PermissionTypes, type RecordAttributePermissionsActions, type RecordPermissionsActions, type TreeNodePermissionsActions, type TreePermissionsActions } from '_types/permissions';
2
2
  import { type IQueryInfos } from '_types/queryInfos';
3
3
  import { type TreePath } from '_types/tree';
4
+ import { type IGetDefaultPermissionParams } from './helpers/defaultPermission';
4
5
  export declare const PERMISSIONS_CACHE_HEADER = "permissions";
5
6
  export declare const PERMISSIONS_NULL_PLACEHOLDER = "__null__";
6
7
  export interface IPermissionTarget {
@@ -50,12 +51,13 @@ export interface IGetTreePermissionParams {
50
51
  userId: string;
51
52
  ctx: IQueryInfos;
52
53
  }
54
+ export type GetDefaultTreeLibraryPermission = (params: IGetDefaultPermissionParams) => boolean | null;
53
55
  export interface IGetTreeLibraryPermissionParams {
54
56
  action: TreeNodePermissionsActions;
55
57
  treeId: string;
56
58
  libraryId: string;
57
59
  userId: string;
58
- getDefaultPermission?: (params?: IGetDefaultTreeLibraryPermissionParams) => Promise<boolean> | boolean;
60
+ getDefaultTreeLibraryPermission?: GetDefaultTreeLibraryPermission;
59
61
  ctx: IQueryInfos;
60
62
  }
61
63
  export interface IGetApplicationPermissionParams {
@@ -64,13 +66,14 @@ export interface IGetApplicationPermissionParams {
64
66
  userId: string;
65
67
  ctx: IQueryInfos;
66
68
  }
67
- export interface IGetDefaultTreeLibraryPermissionParams {
69
+ export interface IGetDefaultGlobalPermissionParams extends IGetDefaultPermissionParams {
68
70
  type?: PermissionTypes;
69
71
  applyTo?: string;
70
72
  userId?: string;
73
+ userGroups?: TreePath[];
71
74
  action?: PermissionsActions;
72
- ctx: IQueryInfos;
73
75
  }
76
+ export type GetDefaultGlobalPermission = (params: IGetDefaultGlobalPermissionParams) => Promise<boolean> | boolean;
74
77
  export interface IGetTreeNodePermissionParams {
75
78
  action: TreeNodePermissionsActions;
76
79
  userId: string;
@@ -105,19 +108,11 @@ export interface IGetInheritedApplicationPermissionParams {
105
108
  userGroupId: string;
106
109
  ctx: IQueryInfos;
107
110
  }
108
- export interface IGetDefaultInheritedTreeLibraryPermissionParams {
109
- type?: PermissionTypes;
110
- applyTo?: string;
111
- userId?: string;
112
- action?: PermissionsActions;
113
- ctx: IQueryInfos;
114
- }
115
111
  export interface IGetInheritedTreeLibraryPermissionParams {
116
112
  action: TreeNodePermissionsActions;
117
113
  treeId: string;
118
114
  libraryId: string;
119
115
  userGroupId: string;
120
- getDefaultPermission?: (params?: IGetDefaultInheritedTreeLibraryPermissionParams) => boolean | null;
121
116
  ctx: IQueryInfos;
122
117
  }
123
118
  export interface IGetAttributePermissionParams {
@@ -159,12 +154,6 @@ export interface IGetRecordAttributeHeritedPermissionsParams {
159
154
  permTree: string;
160
155
  permTreeNode: string;
161
156
  }
162
- export interface IGetDefaultPermissionParams {
163
- action?: any;
164
- applyTo?: string;
165
- userId?: string;
166
- userGroups?: TreePath[];
167
- }
168
157
  export interface IGetTreeBasedPermissionParams {
169
158
  type: PermissionTypes;
170
159
  action: PermissionsActions;
@@ -174,7 +163,7 @@ export interface IGetTreeBasedPermissionParams {
174
163
  [treeAttributeId: string]: string[];
175
164
  };
176
165
  permissions_conf: ITreePermissionsConf;
177
- getDefaultPermission: (params: IGetDefaultPermissionParams) => Promise<boolean> | boolean;
166
+ getDefaultPermission: GetDefaultGlobalPermission;
178
167
  }
179
168
  export interface IGetInheritedTreeBasedPermissionParams {
180
169
  type: PermissionTypes;
@@ -182,7 +171,7 @@ export interface IGetInheritedTreeBasedPermissionParams {
182
171
  userGroupId: string;
183
172
  applyTo: string;
184
173
  permissionTreeTarget: IPermissionsTreeTarget;
185
- getDefaultPermission: (params: IGetDefaultPermissionParams) => Promise<boolean> | boolean;
174
+ getDefaultPermission: GetDefaultGlobalPermission;
186
175
  }
187
176
  export interface IGetRecordPermissionParams {
188
177
  action: RecordPermissionsActions;
@@ -1,9 +1,14 @@
1
1
  import { type IConfig } from '_types/config';
2
+ import { type IQueryInfos } from '_types/queryInfos';
2
3
  interface IDeps {
3
4
  config: IConfig;
4
5
  }
6
+ export interface IGetDefaultPermissionParams {
7
+ ctx: IQueryInfos;
8
+ }
9
+ export type GetDefaultPermission = ({ ctx }: IGetDefaultPermissionParams) => boolean;
5
10
  export interface IDefaultPermissionHelper {
6
- getDefaultPermission: () => boolean;
11
+ getDefaultPermission: GetDefaultPermission;
7
12
  }
8
13
  export default function ({ config }: IDeps): IDefaultPermissionHelper;
9
14
  export {};
@@ -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
- getDefaultPermission?: (params?: IGetDefaultGlobalPermissionParams) => Promise<boolean> | boolean;
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
- getDefaultPermission?: (params?: IGetDefaultGlobalPermissionParams) => boolean;
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>;
@@ -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
- getDefaultPermission?: () => Promise<boolean> | boolean;
26
+ getDefaultGlobalPermission?: GetDefaultGlobalPermission;
26
27
  ctx: IQueryInfos;
27
28
  }
28
29
  export interface IPermissionByUserGroupsHelper {
@@ -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 v1, which includes a timestamp and a unique identifier.
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;
@@ -1,10 +1,10 @@
1
- import { type ILibraryRepo } from 'infra/library/libraryRepo';
1
+ import { type ILibraryRepo } from '../../library/libraryRepo';
2
2
  import { type IDbService } from '../dbService';
3
- import { type IQueryInfos } from '_types/queryInfos';
4
- import { type IAttributeForRepo, type IAttributeRepo } from 'infra/attribute/attributeRepo';
5
- import { type ITree } from '_types/tree';
3
+ import { type IQueryInfos } from '../../../_types/queryInfos';
4
+ import { type IAttributeForRepo, type IAttributeRepo } from '../../attribute/attributeRepo';
5
+ import { type ITree } from '../../../_types/tree';
6
6
  import { type Override } from '@leav/utils';
7
- import { type ILibraryDbEvent } from '_types/library';
7
+ import { type ILibraryDbEvent } from '../../../_types/library';
8
8
  export type MigrationLibraryToCreate = Override<ILibraryDbEvent, {
9
9
  attributes: string[];
10
10
  fullTextAttributes: string[];
@@ -1,4 +1,4 @@
1
1
  import { type MigrationLibraryToCreate } from '../../helpers/libraryUtils';
2
- import { type IAttributeForRepo } from 'infra/attribute/attributeRepo';
2
+ import { type IAttributeForRepo } from '../../../attribute/attributeRepo';
3
3
  export declare const commentAttributes: IAttributeForRepo[];
4
4
  export declare const commentLibrary: MigrationLibraryToCreate;
@@ -1,4 +1,4 @@
1
- import { type IMigration } from '_types/migration';
1
+ import { type IMigration } from '../../../../_types/migration';
2
2
  import { type IDbService } from '../../dbService';
3
3
  import { type ILibraryRepo } from '../../../library/libraryRepo';
4
4
  import { type IAttributeRepo } from '../../../attribute/attributeRepo';
@@ -1,5 +1,5 @@
1
1
  import { type MigrationLibraryToCreate, type MigrationTreeToCreate } from '../../helpers/libraryUtils';
2
- import { type IAttributeForRepo } from 'infra/attribute/attributeRepo';
2
+ import { type IAttributeForRepo } from '../../../attribute/attributeRepo';
3
3
  export declare const statusesAttributes: IAttributeForRepo[];
4
4
  export declare const statusesLibrary: MigrationLibraryToCreate;
5
5
  export declare const threadStatusTree: MigrationTreeToCreate;
@@ -1,4 +1,4 @@
1
1
  import { type MigrationLibraryToCreate } from '../../helpers/libraryUtils';
2
- import { type IAttributeForRepo } from 'infra/attribute/attributeRepo';
2
+ import { type IAttributeForRepo } from '../../../attribute/attributeRepo';
3
3
  export declare const threadsAttributes: IAttributeForRepo[];
4
4
  export declare const threadLibrary: MigrationLibraryToCreate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aristid/leav-types",
3
- "version": "1.4.1-f881b862",
3
+ "version": "1.5.0-01ca96c4",
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.1",
17
+ "@leav/utils": "1.5.0",
18
18
  "@types/amqplib": "0.10.7",
19
19
  "@types/express": "5.0.0",
20
20
  "@types/jest": "29.5.14",