@aristid/leav-types 1.10.0 → 1.11.0

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.
@@ -32,6 +32,25 @@ export declare namespace dataLoaders {
32
32
  namespace getValues {
33
33
  let enableCache: boolean;
34
34
  let useBatch: boolean;
35
+ let maxBatchSize: number;
36
+ }
37
+ }
38
+ namespace recordRepo {
39
+ namespace getRecord {
40
+ let maxBatchSize_1: number;
41
+ export { maxBatchSize_1 as maxBatchSize };
42
+ }
43
+ }
44
+ namespace treeRepo {
45
+ namespace getRecordByNodeId {
46
+ let maxBatchSize_2: number;
47
+ export { maxBatchSize_2 as maxBatchSize };
48
+ }
49
+ }
50
+ namespace cacheService {
51
+ namespace ramCache {
52
+ let maxBatchSize_3: number;
53
+ export { maxBatchSize_3 as maxBatchSize };
35
54
  }
36
55
  }
37
56
  }
@@ -84,7 +103,6 @@ export declare namespace mailer {
84
103
  }
85
104
  export declare namespace actions {
86
105
  namespace excel {
87
- let useNewHyperformula: boolean;
88
106
  let debug: boolean;
89
107
  }
90
108
  }
@@ -134,8 +152,6 @@ export declare namespace permissions {
134
152
  }
135
153
  let enableCache_1: boolean;
136
154
  export { enableCache_1 as enableCache };
137
- export let enableAccessRecordByDefaultBackendFilter: boolean;
138
- export let enableAttributeDependentValuesPermissions: boolean;
139
155
  }
140
156
  export declare namespace amqp {
141
157
  namespace connOpt {
@@ -14,8 +14,3 @@ export namespace dbProfiler {
14
14
  export namespace bugsnag {
15
15
  let releaseStage: string;
16
16
  }
17
- export namespace actions {
18
- namespace excel {
19
- let useNewHyperformula: boolean;
20
- }
21
- }
@@ -68,11 +68,6 @@ export interface IServer {
68
68
  }
69
69
  export interface IActions {
70
70
  excel: {
71
- /**
72
- * Replace deprecated hot-formula-parser npm module by new hyperformula npm module
73
- * Formulas should be compatible
74
- */
75
- useNewHyperformula: boolean;
76
71
  /**
77
72
  * Add debug log for each calculation with formula and result or error
78
73
  */
@@ -171,8 +166,6 @@ export interface IPermissions {
171
166
  everybody: IPermissionsByTypesAndActions;
172
167
  adminGroup: IPermissionsByTypesAndActions;
173
168
  enableCache: boolean;
174
- enableAccessRecordByDefaultBackendFilter: boolean;
175
- enableAttributeDependentValuesPermissions: boolean;
176
169
  }
177
170
  export interface IAmqp {
178
171
  connOpt: Options.Connect;
@@ -246,6 +239,14 @@ export interface IImport {
246
239
  */
247
240
  delayTaskExecMs: number;
248
241
  }
242
+ interface ICommonDataLoaderConfig {
243
+ /**
244
+ * Split batch in multiple batch if number of keys to load is superior to this value.
245
+ * Too low value can cause performance issue, to many arangodb or redis requeste, too high value can cause memory, performance and availability issue.
246
+ * Adjust according to your use case and data size
247
+ */
248
+ maxBatchSize?: number;
249
+ }
249
250
  /**
250
251
  * Data loaders configuration for performances
251
252
  */
@@ -267,7 +268,16 @@ export interface IDataLoaders {
267
268
  * Temporary, to be removed in future
268
269
  */
269
270
  useBatch: boolean;
270
- };
271
+ } & ICommonDataLoaderConfig;
272
+ };
273
+ recordRepo: {
274
+ getRecord: ICommonDataLoaderConfig;
275
+ };
276
+ treeRepo: {
277
+ getRecordByNodeId: ICommonDataLoaderConfig;
278
+ };
279
+ cacheService: {
280
+ ramCache: ICommonDataLoaderConfig;
271
281
  };
272
282
  }
273
283
  export interface IDiskCache {
@@ -26,6 +26,7 @@ export declare enum Errors {
26
26
  FORBIDDEN_ID = "FORBIDDEN_ID",
27
27
  FORBIDDEN_KEY = "FORBIDDEN_KEY",
28
28
  FORMAT_ERROR = "FORMAT_ERROR",
29
+ IMMUTABLE_CORE_SYSTEM_ATTRIBUTE = "IMMUTABLE_CORE_SYSTEM_ATTRIBUTE",
29
30
  INVALID_ACTION_TYPE = "INVALID_ACTION_TYPE",
30
31
  INVALID_ATTRIBUTE_TYPE = "INVALID_ATTRIBUTE_TYPE",
31
32
  INVALID_ATTRIBUTE_FILTER_FORMAT = "INVALID_ATTRIBUTE_FILTER_FORMAT",
@@ -68,7 +69,6 @@ export declare enum Errors {
68
69
  PREVIEWS_SETTINGS_DUPLICATE_NAMES = "PREVIEWS_SETTINGS_DUPLICATE_NAMES",
69
70
  PREVIEWS_SETTINGS_NOT_ALLOWED = "PREVIEWS_SETTINGS_NOT_ALLOWED",
70
71
  PROTECTED_ENDPOINT = "PROTECTED_ENDPOINT",
71
- READONLY_ATTRIBUTE = "READONLY_ATTRIBUTE",
72
72
  RECORD_ACTIVATION_FAILED = "RECORD_ACTIVATION_FAILED",
73
73
  RECORD_NOT_FOUND_FOR_IMPORT_MATCH = "RECORD_NOT_FOUND_FOR_IMPORT_MATCH",
74
74
  REQUIRED_ATTRIBUTE = "REQUIRED_ATTRIBUTE",
@@ -40,6 +40,10 @@ export interface IElement {
40
40
  matches: IMatch[];
41
41
  mode: ImportMode;
42
42
  data: IData[];
43
+ excelMapping?: {
44
+ sheet: number;
45
+ line: number;
46
+ };
43
47
  }
44
48
  export interface ITree {
45
49
  library: string;
@@ -8,6 +8,9 @@ import { type IVersionProfileDomain } from 'domain/versionProfile/versionProfile
8
8
  import { type IAppModule } from '_types/shared';
9
9
  import { type IGraphqlAppModule } from 'app/graphql/graphqlApp';
10
10
  import { type IFormatLogValueHelper } from 'domain/value/helpers/formatLogValue';
11
+ import { type i18n } from 'i18next';
12
+ import { type IRecordDomain } from 'domain/record/recordDomain';
13
+ import { type IConfig } from '_types/config';
11
14
  export type ICoreLogApp = IAppModule & IGraphqlAppModule;
12
15
  interface IDeps {
13
16
  'core.domain.log': ILogDomain;
@@ -18,6 +21,9 @@ interface IDeps {
18
21
  'core.domain.value.helpers.formatLogValue': IFormatLogValueHelper;
19
22
  'core.domain.versionProfile': IVersionProfileDomain;
20
23
  'core.domain.application': IApplicationDomain;
24
+ 'core.domain.record': IRecordDomain;
25
+ translator: i18n;
26
+ config: IConfig;
21
27
  }
22
- export default function ({ 'core.domain.log': logDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.domain.library': libraryDomain, 'core.domain.attribute': attributeDomain, 'core.domain.tree': treeDomain, 'core.domain.value.helpers.formatLogValue': formatLogValue, 'core.domain.versionProfile': versionProfileDomain, 'core.domain.application': applicationDomain, }: IDeps): ICoreLogApp;
28
+ export default function ({ 'core.domain.log': logDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.domain.library': libraryDomain, 'core.domain.attribute': attributeDomain, 'core.domain.tree': treeDomain, 'core.domain.value.helpers.formatLogValue': formatLogValue, 'core.domain.versionProfile': versionProfileDomain, 'core.domain.application': applicationDomain, 'core.domain.record': recordDomain, translator, config, }: IDeps): ICoreLogApp;
23
29
  export {};
@@ -34,5 +34,4 @@ export interface IRecordsQueryVariables {
34
34
  pagination?: IRecordsQueryPagination;
35
35
  retrieveInactive?: boolean;
36
36
  searchQuery?: string;
37
- ignoreAccessRecordByDefaultPermission?: boolean;
38
37
  }
@@ -37,8 +37,8 @@ export interface IImportExcelParams {
37
37
  }
38
38
  interface IImportDataParams {
39
39
  filename: string;
40
+ fromExcel?: boolean;
40
41
  ctx: IQueryInfos;
41
- excelMapping?: IExcelMapping;
42
42
  }
43
43
  interface IImportConfigParams {
44
44
  filepath: string;
@@ -52,12 +52,6 @@ export interface IImportDomain {
52
52
  importData(params: IImportDataParams, task?: ITaskFuncParams): Promise<string>;
53
53
  importExcel({ filename, sheets, startAt }: IImportExcelParams, ctx: IQueryInfos): Promise<string>;
54
54
  }
55
- interface IExcelMapping {
56
- [elementIndex: number]: {
57
- sheet: number;
58
- line: number;
59
- };
60
- }
61
55
  export interface IImportDomainDeps {
62
56
  'core.domain.library': ILibraryDomain;
63
57
  'core.domain.record': IRecordDomain;
@@ -4,7 +4,6 @@ import { type AttributeDependentValuesPermissionsActions, type IPermissionsDepen
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';
7
- import { type IConfig } from '_types/config';
8
7
  export interface IAttributeDependentValuesPermissionDomain {
9
8
  getAttributeDependentValuesPermission(params: {
10
9
  action: AttributeDependentValuesPermissionsActions;
@@ -41,6 +40,5 @@ export interface IRecordAttributePermissionDomainDeps {
41
40
  'core.domain.attribute': IAttributeDomain;
42
41
  'core.domain.tree.helpers.elementAncestors': IElementAncestorsHelper;
43
42
  'core.infra.value': IValueRepo;
44
- config: IConfig;
45
43
  }
46
44
  export default function (deps: IRecordAttributePermissionDomainDeps): IAttributeDependentValuesPermissionDomain;
@@ -13,7 +13,6 @@ export interface IFindRecordParams {
13
13
  retrieveInactive?: boolean;
14
14
  fulltextSearch?: string;
15
15
  ignorePermissions?: boolean;
16
- ignoreAccessRecordByDefaultPermission?: boolean;
17
16
  }
18
17
  export interface ICreateRecordParams {
19
18
  library: string;
@@ -24,6 +23,7 @@ export interface ICreateRecordParams {
24
23
  }
25
24
  export interface ICreateRecordValueError {
26
25
  attribute: string;
26
+ library?: string;
27
27
  type: ErrorTypes | Errors;
28
28
  message: string;
29
29
  input?: any;
@@ -13,7 +13,6 @@ import { type ITreeRepo } from '../../../infra/tree/treeRepo';
13
13
  import { type GetCoreEntityByIdFunc } from '../../helpers/getCoreEntityById';
14
14
  import { type IElementAncestorsHelper } from '../../tree/helpers/elementAncestors';
15
15
  import { type IDefaultPermissionHelper } from '../../permission/helpers/defaultPermission';
16
- import { type IConfig } from '_types/config';
17
16
  /**
18
17
  * Search records
19
18
  * Filters to apply on records selection
@@ -35,6 +34,5 @@ export interface IFindRecordsHelperDeps {
35
34
  'core.domain.tree.helpers.elementAncestors': IElementAncestorsHelper;
36
35
  'core.domain.permission.helpers.defaultPermission': IDefaultPermissionHelper;
37
36
  'core.infra.permission': IPermissionRepo;
38
- config: IConfig;
39
37
  }
40
- export default function ({ 'core.domain.helpers.validate': validateHelper, 'core.domain.attribute': attributeDomain, 'core.domain.permission.helpers.defaultPermission': defaultPermHelper, 'core.infra.library': libraryRepo, 'core.domain.permission.library': libraryPermissionDomain, 'core.infra.record': recordRepo, 'core.domain.helpers.getCoreEntityById': getCoreEntityById, 'core.infra.tree': treeRepo, 'core.domain.tree.helpers.elementAncestors': elementAncestorsHelper, 'core.infra.permission': permissionRepo, 'core.utils': utils, config, }: IFindRecordsHelperDeps): FindRecordsHelper;
38
+ export default function ({ 'core.domain.helpers.validate': validateHelper, 'core.domain.attribute': attributeDomain, 'core.domain.permission.helpers.defaultPermission': defaultPermHelper, 'core.infra.library': libraryRepo, 'core.domain.permission.library': libraryPermissionDomain, 'core.infra.record': recordRepo, 'core.domain.helpers.getCoreEntityById': getCoreEntityById, 'core.infra.tree': treeRepo, 'core.domain.tree.helpers.elementAncestors': elementAncestorsHelper, 'core.infra.permission': permissionRepo, 'core.utils': utils, }: IFindRecordsHelperDeps): FindRecordsHelper;
@@ -23,9 +23,7 @@ export interface IGetAccessPermissionsValue {
23
23
  export type IGetAccessPermissions = (params: {
24
24
  groupsIds: string[][];
25
25
  library: string;
26
- existingFiltersOnTreeIds: string[];
27
26
  deps: IAccessPermissionFilterDeps;
28
- ignoreAccessRecordByDefaultPermission?: boolean;
29
27
  }, ctx: IQueryInfos) => Promise<IGetAccessPermissionsValue[]>;
30
28
  declare const getAccessPermissionsFilters: IGetAccessPermissions;
31
29
  export default getAccessPermissionsFilters;
@@ -8,7 +8,6 @@ export interface IDeleteValueParams {
8
8
  recordId: string;
9
9
  attribute: string;
10
10
  value?: IValue;
11
- skipReadonly?: boolean;
12
11
  skipActions?: boolean;
13
12
  ctx: IQueryInfos;
14
13
  }
@@ -26,5 +26,8 @@ interface ICanSaveRecordValueParams {
26
26
  config: IConfig;
27
27
  };
28
28
  }
29
+ export declare const IMMUTABLE_CORE_SYSTEM_FILES_ATTRIBUTE_IDS: string[];
30
+ export declare const IMMUTABLE_CORE_SYSTEM_COMMON_ATTRIBUTE_IDS: string[];
31
+ export declare const IMMUTABLE_CORE_SYSTEM_ATTRIBUTE_IDS: string[];
29
32
  declare const _default: (params: ICanSaveRecordValueParams) => Promise<ICanSaveRecordValueRes>;
30
33
  export default _default;
@@ -65,7 +65,6 @@ export interface IValueDomain {
65
65
  recordId: string;
66
66
  attribute: string;
67
67
  value: ISaveValue;
68
- skipReadonly?: boolean;
69
68
  ctx: IQueryInfos;
70
69
  }): Promise<IValue[]>;
71
70
  /**
@@ -81,7 +80,6 @@ export interface IValueDomain {
81
80
  ctx: IQueryInfos;
82
81
  keepEmpty?: boolean;
83
82
  skipPermission?: boolean;
84
- skipReadonly?: boolean;
85
83
  }): Promise<ISaveBatchValueResult>;
86
84
  deleteValue(params: IDeleteValueParams): Promise<IValue[]>;
87
85
  formatValue(params: {
@@ -1,4 +1,5 @@
1
1
  import { type IQueryInfos } from '_types/queryInfos';
2
+ import { type IConfig } from '_types/config';
2
3
  import { type IRedis } from './redis';
3
4
  export interface IMemoizeParams<T> {
4
5
  key: string;
@@ -25,10 +26,11 @@ export interface ICacheService {
25
26
  interface ICacheServiceDeps {
26
27
  'core.infra.redis': IRedis;
27
28
  'core.infra.cache.diskService': ICacheService;
29
+ config: IConfig;
28
30
  }
29
31
  export declare enum ECacheType {
30
32
  DISK = "DISK",
31
33
  RAM = "RAM"
32
34
  }
33
- export default function ({ 'core.infra.redis': redis, 'core.infra.cache.diskService': diskService, }: ICacheServiceDeps): ICachesService;
35
+ export default function ({ 'core.infra.redis': redis, 'core.infra.cache.diskService': diskService, config, }: ICacheServiceDeps): ICachesService;
34
36
  export {};
@@ -2,6 +2,7 @@ import { type GeneratedAqlQuery } from 'arangojs/aql';
2
2
  import { type GetConditionPart } from 'infra/attributeTypes/helpers/getConditionPart';
3
3
  import { type GetSearchQuery } from 'infra/indexation/helpers/getSearchQuery';
4
4
  import { type IQueryInfos } from '_types/queryInfos';
5
+ import { type IConfig } from '_types/config';
5
6
  import { type ICursorPaginationParams, type IListWithCursor, type IPaginationParams } from '../../_types/list';
6
7
  import { type IRecord, type IRecordFilterOption, type IRecordSort } from '../../_types/record';
7
8
  import { type IAttributeRepo } from '../attribute/attributeRepo';
@@ -66,5 +67,6 @@ export interface IRecordRepoDeps {
66
67
  'core.infra.record.helpers.getSearchVariableName': GetSearchVariableName;
67
68
  'core.infra.record.helpers.filterTypes': IFilterTypesHelper;
68
69
  'core.infra.indexation.helpers.getSearchQuery': GetSearchQuery;
70
+ config?: IConfig;
69
71
  }
70
- export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes': attributeTypesRepo, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.getSearchVariablesQueryPart': getSearchVariablesQueryPart, 'core.infra.record.helpers.getSearchVariableName': getSearchVariableName, 'core.infra.record.helpers.filterTypes': filterTypesHelper, 'core.infra.indexation.helpers.getSearchQuery': getSearchQuery, 'core.infra.attribute': attributeRepo, }: IRecordRepoDeps): IRecordRepo;
72
+ export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, 'core.infra.attributeTypes': attributeTypesRepo, 'core.infra.attributeTypes.helpers.getConditionPart': getConditionPart, 'core.infra.record.helpers.getSearchVariablesQueryPart': getSearchVariablesQueryPart, 'core.infra.record.helpers.getSearchVariableName': getSearchVariableName, 'core.infra.record.helpers.filterTypes': filterTypesHelper, 'core.infra.indexation.helpers.getSearchQuery': getSearchQuery, 'core.infra.attribute': attributeRepo, config, }: IRecordRepoDeps): IRecordRepo;
@@ -1,6 +1,7 @@
1
1
  import { type IList, type IPaginationParams } from '_types/list';
2
2
  import { type IQueryInfos } from '_types/queryInfos';
3
3
  import { type IRecord } from '_types/record';
4
+ import { type IConfig } from '_types/config';
4
5
  import { type IGetCoreTreesParams, type ITree, type ITreeElement, type ITreeNode, type ITreeNodeLight, type TreePath } from '_types/tree';
5
6
  import { type IDbService } from '../db/dbService';
6
7
  import { type IDbUtils } from '../db/dbUtils';
@@ -165,5 +166,6 @@ export declare const TO_RECORD_PROP_NAME = "toRecord";
165
166
  export interface ITreeRepoDeps {
166
167
  'core.infra.db.dbService': IDbService;
167
168
  'core.infra.db.dbUtils': IDbUtils;
169
+ config: IConfig;
168
170
  }
169
- export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, }: ITreeRepoDeps): ITreeRepo;
171
+ export default function ({ 'core.infra.db.dbService': dbService, 'core.infra.db.dbUtils': dbUtils, config, }: ITreeRepoDeps): ITreeRepo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aristid/leav-types",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
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.10.0",
17
+ "@leav/utils": "1.11.0",
18
18
  "@types/amqplib": "0.10.8",
19
19
  "@types/express": "5.0.6",
20
20
  "@types/jest": "29.5.14",