@aristid/leav-types 0.0.7-eab60f2 → 0.0.7-eb1f2373

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.
Files changed (104) hide show
  1. package/apps/core/config/default.d.ts +4 -1
  2. package/apps/core/config/test.d.ts +1 -0
  3. package/apps/core/src/__tests__/e2e/api/joinLibraries/joinLibraries.test.d.ts +1 -0
  4. package/apps/core/src/__tests__/mockers/amqp.d.ts +8 -0
  5. package/apps/core/src/__tests__/mockers/logger.d.ts +7 -0
  6. package/apps/core/src/__tests__/mocks/actionsList.d.ts +6 -0
  7. package/apps/core/src/__tests__/mocks/attribute.d.ts +6 -2
  8. package/apps/core/src/__tests__/mocks/cache.d.ts +4 -0
  9. package/apps/core/src/__tests__/mocks/view.d.ts +1 -0
  10. package/apps/core/src/_constants/attributes.d.ts +1 -0
  11. package/apps/core/src/_constants/globalSettings.d.ts +1 -0
  12. package/apps/core/src/_types/actionsList.d.ts +2 -1
  13. package/apps/core/src/_types/attribute.d.ts +10 -2
  14. package/apps/core/src/_types/config.d.ts +5 -1
  15. package/apps/core/src/_types/dbProfiler.d.ts +13 -0
  16. package/apps/core/src/_types/errors.d.ts +3 -1
  17. package/apps/core/src/_types/forms.d.ts +10 -0
  18. package/apps/core/src/_types/globalSettings.d.ts +3 -0
  19. package/apps/core/src/_types/library.d.ts +5 -1
  20. package/apps/core/src/_types/queryInfos.d.ts +1 -1
  21. package/apps/core/src/_types/tree.d.ts +1 -0
  22. package/apps/core/src/_types/value.d.ts +64 -3
  23. package/apps/core/src/_types/views.d.ts +38 -43
  24. package/apps/core/src/app/application/applicationApp.d.ts +6 -8
  25. package/apps/core/src/app/auth/authApp.d.ts +7 -6
  26. package/apps/core/src/app/core/actionListApp.d.ts +2 -4
  27. package/apps/core/src/app/core/apiKeyApp/apiKeyApp.d.ts +2 -4
  28. package/apps/core/src/app/core/attributeApp/attributeApp.d.ts +2 -5
  29. package/apps/core/src/app/core/coreApp.d.ts +2 -4
  30. package/apps/core/src/app/core/exportApp.d.ts +2 -4
  31. package/apps/core/src/app/core/filesManagerApp.d.ts +3 -5
  32. package/apps/core/src/app/core/formApp/formApp.d.ts +6 -5
  33. package/apps/core/src/app/core/globalSettingsApp.d.ts +3 -6
  34. package/apps/core/src/app/core/importApp.d.ts +2 -4
  35. package/apps/core/src/app/core/libraryApp/libraryApp.d.ts +2 -5
  36. package/apps/core/src/app/core/logApp.d.ts +2 -4
  37. package/apps/core/src/app/core/permissionApp/permissionApp.d.ts +2 -4
  38. package/apps/core/src/app/core/pluginsApp.d.ts +2 -3
  39. package/apps/core/src/app/core/recordApp/recordApp.d.ts +2 -5
  40. package/apps/core/src/app/core/tasksManagerApp.d.ts +2 -3
  41. package/apps/core/src/app/core/treeApp/treeApp.d.ts +5 -6
  42. package/apps/core/src/app/core/userDataApp.d.ts +2 -4
  43. package/apps/core/src/app/core/valueApp.d.ts +2 -4
  44. package/apps/core/src/app/core/versionProfileApp/versionProfileApp.d.ts +2 -4
  45. package/apps/core/src/app/core/viewApp.d.ts +5 -5
  46. package/apps/core/src/app/endpoint/endpointApp.d.ts +3 -8
  47. package/apps/core/src/app/graphql/graphqlApp.d.ts +4 -0
  48. package/apps/core/src/domain/attribute/attributeDomain.d.ts +2 -0
  49. package/apps/core/src/domain/attribute/helpers/ifLibraryJoinLinkAttribute.d.ts +11 -0
  50. package/apps/core/src/domain/attribute/helpers/ifLibraryJoinLinkAttribute.spec.d.ts +1 -0
  51. package/apps/core/src/domain/attribute/helpers/index.d.ts +1 -0
  52. package/apps/core/src/domain/export/exportDomain.d.ts +8 -2
  53. package/apps/core/src/domain/filesManager/helpers/handleFileSystemEvent/handleMoveEvent.d.ts +1 -1
  54. package/apps/core/src/domain/globalSettings/globalSettingsDomain.d.ts +5 -1
  55. package/apps/core/src/domain/helpers/calculationVariable/index.d.ts +2 -1
  56. package/apps/core/src/domain/import/importDomain.d.ts +1 -1
  57. package/apps/core/src/domain/indexationManager/indexationManagerDomain.d.ts +1 -1
  58. package/apps/core/src/domain/permission/_types.d.ts +9 -9
  59. package/apps/core/src/domain/permission/helpers/globalPermission.d.ts +1 -1
  60. package/apps/core/src/domain/permission/helpers/permissionByUserGroups.d.ts +22 -4
  61. package/apps/core/src/domain/permission/helpers/reducePermissionsArray.d.ts +1 -1
  62. package/apps/core/src/domain/permission/recordPermissionDomain.d.ts +4 -1
  63. package/apps/core/src/domain/record/_types.d.ts +4 -3
  64. package/apps/core/src/domain/record/helpers/createRecord.d.ts +21 -0
  65. package/apps/core/src/domain/record/helpers/deleteRecord.d.ts +19 -0
  66. package/apps/core/src/domain/record/helpers/getAccessPermissionFilters.d.ts +24 -0
  67. package/apps/core/src/domain/record/helpers/index.d.ts +3 -0
  68. package/apps/core/src/domain/record/recordDomain.d.ts +26 -3
  69. package/apps/core/src/domain/value/helpers/{canSaveValue.d.ts → canSaveRecordValue.d.ts} +3 -3
  70. package/apps/core/src/domain/value/helpers/isEmptyValue.d.ts +5 -0
  71. package/apps/core/src/domain/value/helpers/prepareValue.d.ts +3 -3
  72. package/apps/core/src/domain/value/helpers/saveOneValue.d.ts +2 -2
  73. package/apps/core/src/domain/value/helpers/validateValue.d.ts +4 -4
  74. package/apps/core/src/domain/value/valueDomain.d.ts +11 -4
  75. package/apps/core/src/domain/view/viewDomain.d.ts +1 -0
  76. package/apps/core/src/errors/ApplicationError.d.ts +1 -1
  77. package/apps/core/src/errors/LeavError.d.ts +9 -3
  78. package/apps/core/src/infra/attributeTypes/attributeAdvancedLinkRepo.d.ts +5 -2
  79. package/apps/core/src/infra/attributeTypes/attributeAdvancedRepo.d.ts +3 -1
  80. package/apps/core/src/infra/attributeTypes/attributeSimpleLinkRepo.d.ts +5 -2
  81. package/apps/core/src/infra/attributeTypes/attributeSimpleRepo.d.ts +3 -1
  82. package/apps/core/src/infra/attributeTypes/attributeTreeRepo.d.ts +3 -1
  83. package/apps/core/src/infra/attributeTypes/attributeTypesRepo.d.ts +29 -23
  84. package/apps/core/src/infra/attributeTypes/helpers/getConditionPart.d.ts +1 -1
  85. package/apps/core/src/infra/db/dbUtils.d.ts +1 -3
  86. package/apps/core/src/infra/db/migrations/005-viewSortToArray.d.ts +7 -0
  87. package/apps/core/src/infra/db/migrations/006-addRequiredAttributeProperty.d.ts +11 -0
  88. package/apps/core/src/infra/db/migrations/007-updateHexColor.d.ts +9 -0
  89. package/apps/core/src/infra/db/migrations/008-addSkeletonApp.d.ts +7 -0
  90. package/apps/core/src/infra/db/migrations/009-addDisplayMultiLinkOptAttributeProperty.d.ts +11 -0
  91. package/apps/core/src/infra/db/migrations/010-formSidePanel.d.ts +8 -0
  92. package/apps/core/src/infra/db/migrations/011-moveSkeletonApptoAppStudio.d.ts +7 -0
  93. package/apps/core/src/infra/oidc/oidcClientService.d.ts +3 -1
  94. package/apps/core/src/infra/permission/permissionRepo.d.ts +9 -1
  95. package/apps/core/src/infra/record/helpers/getSearchVariableName.d.ts +1 -1
  96. package/apps/core/src/infra/record/recordRepo.d.ts +2 -0
  97. package/apps/core/src/infra/tree/treeRepo.d.ts +1 -1
  98. package/apps/core/src/infra/value/valueRepo.d.ts +10 -5
  99. package/apps/core/src/infra/view/_types.d.ts +1 -0
  100. package/apps/core/src/interface/server.d.ts +7 -0
  101. package/apps/core/src/pluginsLoader.d.ts +1 -1
  102. package/apps/core/src/utils/utils.d.ts +1 -0
  103. package/libs/utils/src/types/forms.d.ts +7 -1
  104. package/package.json +11 -3
@@ -0,0 +1,11 @@
1
+ import { type i18n } from 'i18next';
2
+ import { type IDbService } from '../dbService';
3
+ import { type IConfig } from '../../../_types/config';
4
+ import { type IMigration } from '../../../_types/migration';
5
+ interface IDeps {
6
+ 'core.infra.db.dbService'?: IDbService;
7
+ translator?: i18n;
8
+ config?: IConfig;
9
+ }
10
+ export default function ({ 'core.infra.db.dbService': dbService }?: IDeps): IMigration;
11
+ export {};
@@ -0,0 +1,8 @@
1
+ import { IMigration } from '_types/migration';
2
+ import { IFormRepo } from 'infra/form/formRepo';
3
+ interface IDeps {
4
+ 'core.infra.form'?: IFormRepo;
5
+ config?: any;
6
+ }
7
+ export default function ({ 'core.infra.form': formRepo }?: IDeps): IMigration;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type IDbService } from '../dbService';
2
+ import { type IMigration } from '../../../_types/migration';
3
+ interface IDeps {
4
+ 'core.infra.db.dbService'?: IDbService;
5
+ }
6
+ export default function ({ 'core.infra.db.dbService': dbService }?: IDeps): IMigration;
7
+ export {};
@@ -12,7 +12,9 @@ export interface IOIDCClientService {
12
12
  redirectUri: string;
13
13
  queryId: string;
14
14
  }) => Promise<string>;
15
- getLogoutUrl: () => string;
15
+ getLogoutUrl: (params: {
16
+ userId: string | null;
17
+ }) => Promise<string>;
16
18
  saveOIDCTokens: (params: {
17
19
  userId: string;
18
20
  tokens: TokenSet;
@@ -1,5 +1,5 @@
1
1
  import { IQueryInfos } from '_types/queryInfos';
2
- import { IPermission, IPermissionsTreeTarget, PermissionTypes } from '../../_types/permissions';
2
+ import { IPermission, IPermissionsTreeTarget, PermissionsActions, PermissionTypes } from '../../_types/permissions';
3
3
  import { IDbService } from '../db/dbService';
4
4
  import { IDbUtils } from '../db/dbUtils';
5
5
  export interface IPermissionRepo {
@@ -14,6 +14,14 @@ export interface IPermissionRepo {
14
14
  permissionTreeTarget?: IPermissionsTreeTarget;
15
15
  ctx: IQueryInfos;
16
16
  }): Promise<IPermission | null>;
17
+ getAllPermissionsForTree({ type, applyTo, actionKey, treeId, groupsIds, ctx }: {
18
+ type: PermissionTypes;
19
+ applyTo: string;
20
+ actionKey: PermissionsActions;
21
+ treeId: string;
22
+ groupsIds: string[];
23
+ ctx: IQueryInfos;
24
+ }): Promise<IPermission[]>;
17
25
  }
18
26
  export declare const PERM_COLLECTION_NAME = "core_permissions";
19
27
  export declare const USERS_GROUP_ATTRIBUTE_NAME = "user_groups";
@@ -3,6 +3,6 @@ import { IFilterTypesHelper } from './filterTypes';
3
3
  interface IDeps {
4
4
  'core.infra.record.helpers.filterTypes'?: IFilterTypesHelper;
5
5
  }
6
- export type GetSearchVariableName = (filter: IRecordFilterOption) => string;
6
+ export type GetSearchVariableName = (filter: IRecordFilterOption) => string | undefined;
7
7
  export default function ({ 'core.infra.record.helpers.filterTypes': filterTypesHelper }: IDeps): GetSearchVariableName;
8
8
  export {};
@@ -11,6 +11,7 @@ import { IDbUtils } from '../db/dbUtils';
11
11
  import { IFilterTypesHelper } from './helpers/filterTypes';
12
12
  import { GetSearchVariableName } from './helpers/getSearchVariableName';
13
13
  import { GetSearchVariablesQueryPart } from './helpers/getSearchVariablesQueryPart';
14
+ import { IGetAccessPermissionsValue } from 'domain/record/helpers/getAccessPermissionFilters';
14
15
  export interface IFindRequestResult {
15
16
  initialVars: GeneratedAqlQuery[];
16
17
  queryPart: GeneratedAqlQuery;
@@ -44,6 +45,7 @@ export interface IRecordRepo {
44
45
  retrieveInactive?: boolean;
45
46
  fulltextSearch?: string;
46
47
  ctx: IQueryInfos;
48
+ accessPermissionFilters?: IGetAccessPermissionsValue[];
47
49
  }): Promise<IListWithCursor<IRecord>>;
48
50
  }
49
51
  export interface IRecordRepoDeps {
@@ -115,7 +115,7 @@ export interface ITreeRepo {
115
115
  ctx: IQueryInfos;
116
116
  }): Promise<IList<ITreeNode>>;
117
117
  /**
118
- * Return all ancestors of an element, including element itself, but excluding tree root
118
+ * Return all ancestors of an element, from root to element, but excluding tree root
119
119
  *
120
120
  * @param treeId
121
121
  * @param element
@@ -1,16 +1,17 @@
1
1
  import { IDbService } from 'infra/db/dbService';
2
2
  import { IAttribute } from '_types/attribute';
3
3
  import { IQueryInfos } from '_types/queryInfos';
4
- import { IValue, IValuesOptions } from '_types/value';
4
+ import { ISaveValue, IValue, IValuesOptions } from '_types/value';
5
5
  import { IAttributeTypesRepo, IAttributeWithRevLink } from '../attributeTypes/attributeTypesRepo';
6
6
  export declare const VALUES_LINKS_COLLECTION = "core_edge_values_links";
7
7
  export declare const VALUES_COLLECTION = "core_values";
8
+ export declare const EMPTY_VALUE = "__empty_value__";
8
9
  export interface IValueRepo {
9
10
  createValue({ library, recordId, attribute, value, ctx }: {
10
11
  library: string;
11
12
  recordId: string;
12
13
  attribute: IAttributeWithRevLink;
13
- value: IValue;
14
+ value: ISaveValue;
14
15
  ctx: IQueryInfos;
15
16
  }): Promise<IValue>;
16
17
  /**
@@ -20,7 +21,7 @@ export interface IValueRepo {
20
21
  library: string;
21
22
  recordId: string;
22
23
  attribute: IAttributeWithRevLink;
23
- value: IValue;
24
+ value: ISaveValue;
24
25
  ctx: IQueryInfos;
25
26
  }): Promise<IValue>;
26
27
  /**
@@ -33,9 +34,13 @@ export interface IValueRepo {
33
34
  value: IValue;
34
35
  ctx: IQueryInfos;
35
36
  }): Promise<IValue>;
36
- isValueUnique({ library, recordId, attribute, value, ctx }: {
37
+ /**
38
+ * Check if a value is unique expeted for the given record
39
+ * if recordId is null, it will check for the whole library
40
+ */
41
+ isValueUsed({ library, excludedRecordId, attribute, value, ctx }: {
37
42
  library: string;
38
- recordId: string;
43
+ excludedRecordId?: string;
39
44
  attribute: IAttribute;
40
45
  value: IValue;
41
46
  ctx: IQueryInfos;
@@ -3,6 +3,7 @@ import { IDbUtils } from 'infra/db/dbUtils';
3
3
  import { IList } from '_types/list';
4
4
  import { IGetCoreEntitiesParams } from '_types/shared';
5
5
  import { IQueryInfos } from '../../_types/queryInfos';
6
+ import { IView } from '_types/views';
6
7
  export declare const VIEWS_COLLECTION_NAME = "core_views";
7
8
  export interface IViewRepo {
8
9
  createView(view: IView, ctx: IQueryInfos): Promise<IView>;
@@ -3,6 +3,7 @@ import { IAuthApp } from 'app/auth/authApp';
3
3
  import { ICoreApp } from 'app/core/coreApp';
4
4
  import { IGraphqlApp } from 'app/graphql/graphqlApp';
5
5
  import { AwilixContainer } from 'awilix';
6
+ import { Express } from 'express';
6
7
  import { IUtils } from 'utils/utils';
7
8
  import * as winston from 'winston';
8
9
  import { IConfig } from '_types/config';
@@ -13,6 +14,12 @@ export interface IServer {
13
14
  init(): Promise<void>;
14
15
  initConsumers(): Promise<void>;
15
16
  }
17
+ export interface IServerRouteAppModule {
18
+ /**
19
+ * @param app Express instance, can be used to extend the app
20
+ */
21
+ registerRoute(app: Express): void;
22
+ }
16
23
  interface IDeps {
17
24
  config?: IConfig;
18
25
  'core.interface.helpers.handleGraphqlError'?: HandleGraphqlErrorFunc;
@@ -1,2 +1,2 @@
1
1
  import { AwilixContainer } from 'awilix';
2
- export declare const initPlugins: (folder: string | null, depsManager: AwilixContainer) => Promise<void>;
2
+ export declare const initPlugins: (pluginsPath: string[], depsManager: AwilixContainer) => Promise<void>;
@@ -79,6 +79,7 @@ export interface IUtils {
79
79
  getFullApplicationEndpoint(endpoint?: string): string;
80
80
  getCoreEntityCacheKey(entityType: string, entityId: string): string;
81
81
  getRecordsCacheKey(libraryId: string, recordId: string): string;
82
+ getGlobalSettingsCacheKey(): string;
82
83
  generateExplicitValidationError<T>(field: keyof T, message: ErrorFieldDetailMessage, lang?: string): ValidationError<T>;
83
84
  deleteFile(path: string): Promise<void>;
84
85
  getUnixTime(): number;
@@ -4,7 +4,8 @@ export declare enum FormUIElementTypes {
4
4
  FIELDS_CONTAINER = "fields_container",
5
5
  TAB_FIELDS_CONTAINER = "tab_fields_container",
6
6
  TEXT_BLOCK = "text_block",
7
- TABS = "tabs"
7
+ TABS = "tabs",
8
+ FRAME = "frame"
8
9
  }
9
10
  export declare enum FormFieldTypes {
10
11
  TEXT_INPUT = "input_field",
@@ -41,6 +42,10 @@ export interface IFormTabsSettings {
41
42
  export interface IFormTextBlockSettings {
42
43
  content?: string;
43
44
  }
45
+ export interface IFormFrameSettings {
46
+ url: string;
47
+ height?: string;
48
+ }
44
49
  export interface IFormDateFieldSettings extends ICommonFieldsSettings {
45
50
  withTime: boolean;
46
51
  }
@@ -50,5 +55,6 @@ export interface IFormLinkFieldSettings extends ICommonFieldsSettings {
50
55
  label: Record<string, string>;
51
56
  }>;
52
57
  displayRecordIdentity: boolean;
58
+ tagDisplayMode: boolean;
53
59
  }
54
60
  export declare const FORM_ROOT_CONTAINER_ID = "__root";
package/package.json CHANGED
@@ -1,20 +1,28 @@
1
1
  {
2
2
  "name": "@aristid/leav-types",
3
- "version": "0.0.7-eab60f2",
3
+ "version": "0.0.7-eb1f2373",
4
4
  "description": "Shared Leav types",
5
5
  "scripts": {
6
6
  "tscheck": "",
7
7
  "test:ci": "",
8
8
  "test:commit": "",
9
- "publish-types": "npm publish --access public"
9
+ "publish-types": "npm publish --access public",
10
+ "generate": "yarn workspace core build-types && mv ../../apps/core/dist-types/* . && rmdir ../../apps/core/dist-types",
11
+ "get-version": "jq -r '.version' package.json",
12
+ "set-version": "jq --arg v $1 '.version = $v' package.json > package.tmp.json && mv package.tmp.json package.json"
10
13
  },
11
14
  "license": "LGPL3",
12
15
  "repository": "https://github.com/leav-solutions/leav-engine",
13
16
  "dependencies": {
14
17
  "@leav/utils": "0.0.3",
18
+ "@types/amqplib": "^0",
15
19
  "@types/express": "5.0.0",
16
20
  "@types/jest": "29.5.14",
21
+ "amqplib": "0.10.5",
17
22
  "arangojs": "8.1.0",
18
- "jest": "29.7.0"
23
+ "awilix": "12.0.4",
24
+ "i18next": "24.2.0",
25
+ "jest": "29.7.0",
26
+ "winston": "2.4.6"
19
27
  }
20
28
  }