@aristid/leav-types 1.4.1-b6138776 → 1.4.1-c4c43549

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 (139) hide show
  1. package/apps/core/config/default.d.ts +29 -9
  2. package/apps/core/config/development.d.ts +7 -0
  3. package/apps/core/config/test.d.ts +43 -9
  4. package/apps/core/src/__tests__/e2e/api/e2eUtils.d.ts +29 -3
  5. package/apps/core/src/__tests__/e2e/api/export/export.test.d.ts +1 -0
  6. package/apps/core/src/__tests__/e2e/api/import/import.test.d.ts +1 -0
  7. package/apps/core/src/__tests__/e2e/api/mailpitUtils.d.ts +21 -0
  8. package/apps/core/src/__tests__/integration/domain/taskManagerDomain.test.d.ts +1 -0
  9. package/apps/core/src/__tests__/integration/infra/integrationTestRepoUtils.d.ts +1 -1
  10. package/apps/core/src/__tests__/integration/integrationTestUtils.d.ts +7 -0
  11. package/apps/core/src/_types/config.d.ts +34 -2
  12. package/apps/core/src/_types/errors.d.ts +1 -1
  13. package/apps/core/src/_types/eventsManager.d.ts +13 -1
  14. package/apps/core/src/_types/notification.d.ts +51 -0
  15. package/apps/core/src/_types/userData.d.ts +10 -0
  16. package/apps/core/src/app/application/applicationApp.d.ts +1 -1
  17. package/apps/core/src/app/auth/authApp.d.ts +3 -3
  18. package/apps/core/src/app/core/apiKeyApp/apiKeyApp.d.ts +1 -1
  19. package/apps/core/src/app/core/coreApp.d.ts +1 -1
  20. package/apps/core/src/app/core/eventsManagerApp.d.ts +1 -1
  21. package/apps/core/src/app/core/filesManagerApp.d.ts +1 -1
  22. package/apps/core/src/app/core/formApp/formApp.d.ts +1 -1
  23. package/apps/core/src/app/core/globalSettingsApp.d.ts +1 -1
  24. package/apps/core/src/app/core/importApp.d.ts +1 -1
  25. package/apps/core/src/app/core/index.d.ts +1 -0
  26. package/apps/core/src/app/core/libraryApp/libraryApp.d.ts +1 -1
  27. package/apps/core/src/app/core/logApp.d.ts +1 -1
  28. package/apps/core/src/app/core/notificationApp.d.ts +10 -0
  29. package/apps/core/src/app/core/permissionApp/permissionApp.d.ts +1 -1
  30. package/apps/core/src/app/core/recordApp/_types.d.ts +1 -0
  31. package/apps/core/src/app/core/recordApp/recordApp.d.ts +1 -1
  32. package/apps/core/src/app/core/tasksManagerApp.d.ts +2 -2
  33. package/apps/core/src/app/core/treeApp/treeApp.d.ts +1 -1
  34. package/apps/core/src/app/core/valueApp.d.ts +1 -1
  35. package/apps/core/src/app/core/versionProfileApp/versionProfileApp.d.ts +1 -1
  36. package/apps/core/src/app/core/viewApp.d.ts +1 -1
  37. package/apps/core/src/app/endpoint/endpointApp.d.ts +1 -1
  38. package/apps/core/src/app/graphql/graphqlApp.d.ts +1 -1
  39. package/apps/core/src/domain/actions/excelCalculationAction.d.ts +6 -4
  40. package/apps/core/src/domain/actions/inheritanceCalculationAction.d.ts +1 -1
  41. package/apps/core/src/domain/apiKey/apiKeyDomain.d.ts +1 -1
  42. package/apps/core/src/domain/application/applicationDomain.d.ts +1 -1
  43. package/apps/core/src/domain/attribute/attributeDomain.d.ts +1 -1
  44. package/apps/core/src/domain/attribute/helpers/ifLibraryJoinLinkAttribute.d.ts +1 -1
  45. package/apps/core/src/domain/eventsManager/eventsManagerDomain.d.ts +1 -1
  46. package/apps/core/src/domain/export/exportDomain.d.ts +6 -2
  47. package/apps/core/src/domain/export/exportProfileDomain.d.ts +23 -0
  48. package/apps/core/src/domain/export/exportProfileDomain.spec.d.ts +1 -0
  49. package/apps/core/src/domain/export/index.d.ts +1 -0
  50. package/apps/core/src/domain/filesManager/filesManagerDomain.d.ts +1 -1
  51. package/apps/core/src/domain/filesManager/helpers/handlePreview.d.ts +1 -1
  52. package/apps/core/src/domain/filesManager/helpers/messagesHandler/messagesHandler.d.ts +1 -1
  53. package/apps/core/src/domain/form/formDomain.d.ts +1 -1
  54. package/apps/core/src/domain/form/helpers/mustIncludeElement.d.ts +1 -1
  55. package/apps/core/src/domain/globalSettings/globalSettingsDomain.d.ts +1 -1
  56. package/apps/core/src/domain/helpers/calculationsVariableFunctions/index.d.ts +1 -1
  57. package/apps/core/src/domain/helpers/getCoreEntityById.d.ts +1 -1
  58. package/apps/core/src/domain/helpers/updateRecordLastModif.d.ts +1 -1
  59. package/apps/core/src/domain/helpers/updateTaskProgress.d.ts +1 -1
  60. package/apps/core/src/domain/helpers/validate.d.ts +1 -1
  61. package/apps/core/src/domain/import/importDomain.d.ts +1 -1
  62. package/apps/core/src/domain/indexationManager/indexationManagerDomain.d.ts +1 -1
  63. package/apps/core/src/domain/library/helpers/deleteAssociatedValues.d.ts +1 -1
  64. package/apps/core/src/domain/library/helpers/runPreDelete.d.ts +1 -1
  65. package/apps/core/src/domain/library/libraryDomain.d.ts +1 -1
  66. package/apps/core/src/domain/log/logDomain.d.ts +1 -1
  67. package/apps/core/src/domain/logsCollector/logsCollectorDomain.d.ts +1 -1
  68. package/apps/core/src/domain/notification/channels/emailChannel.d.ts +12 -0
  69. package/apps/core/src/domain/notification/channels/webSocketChannel.d.ts +6 -0
  70. package/apps/core/src/domain/notification/index.d.ts +3 -0
  71. package/apps/core/src/domain/notification/notificationDomain.d.ts +12 -0
  72. package/apps/core/src/domain/permission/adminPermissionDomain.d.ts +1 -1
  73. package/apps/core/src/domain/permission/applicationPermissionDomain.d.ts +1 -1
  74. package/apps/core/src/domain/permission/helpers/getPermissionCachePatternKey.d.ts +1 -1
  75. package/apps/core/src/domain/permission/helpers/globalPermission.d.ts +1 -1
  76. package/apps/core/src/domain/permission/helpers/recordInCreationBypass.d.ts +1 -1
  77. package/apps/core/src/domain/permission/helpers/simplePermission.d.ts +1 -1
  78. package/apps/core/src/domain/permission/libraryPermissionDomain.d.ts +1 -1
  79. package/apps/core/src/domain/permission/permissionDomain.d.ts +2 -2
  80. package/apps/core/src/domain/permission/treeLibraryPermissionDomain.d.ts +1 -1
  81. package/apps/core/src/domain/permission/treePermissionDomain.d.ts +1 -1
  82. package/apps/core/src/domain/record/_types.d.ts +1 -0
  83. package/apps/core/src/domain/record/helpers/createRecord.d.ts +1 -1
  84. package/apps/core/src/domain/record/helpers/deleteRecord.d.ts +1 -1
  85. package/apps/core/src/domain/record/helpers/getAccessPermissionFilters.d.ts +7 -1
  86. package/apps/core/src/domain/record/recordDomain.d.ts +3 -3
  87. package/apps/core/src/domain/tasksManager/tasksManagerDomain.d.ts +2 -2
  88. package/apps/core/src/domain/tree/helpers/elementAncestors.d.ts +1 -1
  89. package/apps/core/src/domain/tree/helpers/getDefaultElement.d.ts +1 -1
  90. package/apps/core/src/domain/tree/treeDomain.d.ts +1 -1
  91. package/apps/core/src/domain/user/userDomain.d.ts +5 -2
  92. package/apps/core/src/domain/value/helpers/formatLogValue.d.ts +1 -1
  93. package/apps/core/src/domain/value/valueDomain.d.ts +3 -8
  94. package/apps/core/src/domain/versionProfile/versionProfileDomain.d.ts +1 -1
  95. package/apps/core/src/domain/view/viewDomain.d.ts +1 -1
  96. package/apps/core/src/infra/apiKey/apiKeyRepo.d.ts +1 -1
  97. package/apps/core/src/infra/application/applicationRepo.d.ts +1 -1
  98. package/apps/core/src/infra/attribute/attributeRepo.d.ts +1 -1
  99. package/apps/core/src/infra/attributeTypes/attributeAdvancedLinkRepo.d.ts +1 -1
  100. package/apps/core/src/infra/attributeTypes/attributeAdvancedRepo.d.ts +1 -1
  101. package/apps/core/src/infra/attributeTypes/attributeSimpleLinkRepo.d.ts +1 -1
  102. package/apps/core/src/infra/attributeTypes/attributeSimpleRepo.d.ts +1 -1
  103. package/apps/core/src/infra/attributeTypes/attributeTreeRepo.d.ts +1 -1
  104. package/apps/core/src/infra/attributeTypes/attributeTypesRepo.d.ts +10 -10
  105. package/apps/core/src/infra/cache/cacheService.d.ts +4 -3
  106. package/apps/core/src/infra/cache/index.d.ts +1 -2
  107. package/apps/core/src/infra/cache/ramService.d.ts +1 -7
  108. package/apps/core/src/infra/cache/redis.d.ts +5 -1
  109. package/apps/core/src/infra/db/dbUtils.d.ts +1 -1
  110. package/apps/core/src/infra/db/migrations/000-init/index.d.ts +1 -1
  111. package/apps/core/src/infra/db/migrations/002-previewsSettings.d.ts +1 -1
  112. package/apps/core/src/infra/db/migrations/003-filesMetadata.d.ts +1 -1
  113. package/apps/core/src/infra/db/migrations/007-updateHexColor.d.ts +1 -1
  114. package/apps/core/src/infra/filesManager/filesManagerRepo.d.ts +1 -1
  115. package/apps/core/src/infra/form/formRepo.d.ts +1 -1
  116. package/apps/core/src/infra/indexation/indexationService.d.ts +1 -1
  117. package/apps/core/src/infra/library/libraryRepo.d.ts +2 -2
  118. package/apps/core/src/infra/mailer/mailerService.d.ts +1 -1
  119. package/apps/core/src/infra/oidc/oidcClientService.d.ts +3 -3
  120. package/apps/core/src/infra/permission/permissionRepo.d.ts +3 -3
  121. package/apps/core/src/infra/record/helpers/getClassifyingFiltersVariableQueryPart.d.ts +1 -1
  122. package/apps/core/src/infra/record/helpers/getSearchVariableName.d.ts +1 -1
  123. package/apps/core/src/infra/record/helpers/getSearchVariablesQueryPart.d.ts +1 -1
  124. package/apps/core/src/infra/record/recordRepo.d.ts +3 -3
  125. package/apps/core/src/infra/session/index.d.ts +1 -0
  126. package/apps/core/src/infra/session/sessionRepo.d.ts +8 -0
  127. package/apps/core/src/infra/task/taskRepo.d.ts +1 -1
  128. package/apps/core/src/infra/tree/treeRepo.d.ts +1 -1
  129. package/apps/core/src/infra/value/valueRepo.d.ts +7 -7
  130. package/apps/core/src/infra/versionProfile/versionProfileRepo.d.ts +1 -1
  131. package/apps/core/src/infra/view/viewRepo.d.ts +1 -1
  132. package/apps/core/src/interface/helpers/handleGraphqlError.d.ts +1 -1
  133. package/apps/core/src/interface/server.d.ts +1 -1
  134. package/apps/core/src/interface/tasksManager.d.ts +1 -1
  135. package/apps/core/src/utils/helpers/getExcelData.d.ts +3 -0
  136. package/apps/core/src/utils/helpers/getFileDataBuffer.d.ts +2 -0
  137. package/libs/config-manager/src/envTo.d.ts +4 -0
  138. package/package.json +1 -1
  139. package/apps/core/src/__tests__/e2e/api/import/import.test-draft.d.ts +0 -0
@@ -63,6 +63,7 @@ export declare namespace mailer {
63
63
  export { port_1 as port };
64
64
  let secure_1: boolean;
65
65
  export { secure_1 as secure };
66
+ export let requireTLS: boolean;
66
67
  export namespace from {
67
68
  let name_1: string;
68
69
  export { name_1 as name };
@@ -76,6 +77,12 @@ export declare namespace mailer {
76
77
  }
77
78
  export { auth_1 as auth };
78
79
  }
80
+ export declare namespace actions {
81
+ namespace excel {
82
+ let useNewHyperformula: boolean;
83
+ let debug: boolean;
84
+ }
85
+ }
79
86
  export declare namespace bugsnag {
80
87
  let enable_1: boolean;
81
88
  export { enable_1 as enable };
@@ -92,7 +99,7 @@ export declare namespace matomo {
92
99
  export let siteId: string;
93
100
  }
94
101
  export declare namespace lang {
95
- export let available: string | string[];
102
+ export let available: string[];
96
103
  let _default: string;
97
104
  export { _default as default };
98
105
  }
@@ -121,7 +128,8 @@ export declare namespace redis {
121
128
  export { host_2 as host };
122
129
  let port_3: string;
123
130
  export { port_3 as port };
124
- export let database: number;
131
+ export let cacheDatabase: number;
132
+ export let sessionDatabase: number;
125
133
  }
126
134
  export declare namespace filesManager {
127
135
  namespace queues {
@@ -167,8 +175,7 @@ export declare namespace eventsManager {
167
175
  }
168
176
  export { routingKeys_2 as routingKeys };
169
177
  export namespace queues_2 {
170
- let pubsub_events_1: string;
171
- export { pubsub_events_1 as pubsub_events };
178
+ let pubsub_events_prefix: string;
172
179
  }
173
180
  export { queues_2 as queues };
174
181
  }
@@ -179,7 +186,7 @@ export declare namespace indexationManager {
179
186
  }
180
187
  export { queues_3 as queues };
181
188
  }
182
- export declare let debug: boolean;
189
+ declare let debug_1: boolean;
183
190
  export declare let defaultUserId: string;
184
191
  export declare namespace _export {
185
192
  let directory_1: string;
@@ -200,6 +207,19 @@ export declare namespace preview {
200
207
  let directory_3: string;
201
208
  export { directory_3 as directory };
202
209
  }
210
+ export declare namespace notification {
211
+ let enable_3: boolean;
212
+ export { enable_3 as enable };
213
+ export namespace email_3 {
214
+ let enable_4: boolean;
215
+ export { enable_4 as enable };
216
+ }
217
+ export { email_3 as email };
218
+ export namespace webSocket {
219
+ let enable_5: boolean;
220
+ export { enable_5 as enable };
221
+ }
222
+ }
203
223
  export declare namespace applications {
204
224
  let rootFolder: string;
205
225
  }
@@ -208,8 +228,8 @@ export declare namespace files {
208
228
  let originalsPathPrefix: string;
209
229
  }
210
230
  export declare namespace dbProfiler {
211
- let enable_3: boolean;
212
- export { enable_3 as enable };
231
+ let enable_6: boolean;
232
+ export { enable_6 as enable };
213
233
  }
214
234
  export declare namespace elasticsearch {
215
235
  export let indexPrefix: string;
@@ -221,5 +241,5 @@ export declare namespace elasticsearch {
221
241
  export declare namespace logsCollector {
222
242
  let queue: string;
223
243
  }
224
- export declare let pluginsPath: string | any[];
225
- export { _export as export, _import as import };
244
+ export declare let pluginsPath: string[];
245
+ export { debug_1 as debug, _export as export, _import as import };
@@ -14,3 +14,10 @@ export namespace dbProfiler {
14
14
  export namespace bugsnag {
15
15
  let releaseStage: string;
16
16
  }
17
+ export namespace actions {
18
+ namespace excel {
19
+ export let useNewHyperformula: boolean;
20
+ let debug_1: boolean;
21
+ export { debug_1 as debug };
22
+ }
23
+ }
@@ -6,6 +6,10 @@ export namespace server {
6
6
  let password: string;
7
7
  let email: string;
8
8
  }
9
+ namespace systemUser {
10
+ let email_1: string;
11
+ export { email_1 as email };
12
+ }
9
13
  let allowIntrospection: boolean;
10
14
  }
11
15
  export namespace db {
@@ -22,33 +26,63 @@ export namespace filesManager {
22
26
  }
23
27
  }
24
28
  export namespace eventsManager {
25
- namespace routingKeys {
29
+ export namespace routingKeys {
26
30
  let data_events: string;
31
+ let pubsub_events: string;
32
+ }
33
+ export namespace queues_1 {
34
+ let pubsub_events_prefix: string;
27
35
  }
36
+ export { queues_1 as queues };
28
37
  }
29
38
  export namespace indexationManager {
30
- export namespace queues_1 {
39
+ export namespace queues_2 {
31
40
  let events_1: string;
32
41
  export { events_1 as events };
33
42
  }
34
- export { queues_1 as queues };
43
+ export { queues_2 as queues };
35
44
  }
36
45
  export namespace tasksManager {
37
- export namespace queues_2 {
38
- let orders: string;
46
+ export let checkingInterval: number;
47
+ export namespace queues_3 {
48
+ let execOrders: string;
49
+ let cancelOrders: string;
39
50
  }
40
- export { queues_2 as queues };
51
+ export { queues_3 as queues };
41
52
  export namespace routingKeys_1 {
42
- let orders_1: string;
43
- export { orders_1 as orders };
53
+ let execOrders_1: string;
54
+ export { execOrders_1 as execOrders };
55
+ let cancelOrders_1: string;
56
+ export { cancelOrders_1 as cancelOrders };
44
57
  }
45
58
  export { routingKeys_1 as routingKeys };
46
59
  }
47
60
  export namespace logs {
48
61
  let transport: string;
49
62
  }
63
+ export namespace notification {
64
+ export let enable: boolean;
65
+ export namespace email_2 {
66
+ let enable_1: boolean;
67
+ export { enable_1 as enable };
68
+ }
69
+ export { email_2 as email };
70
+ export namespace webSocket {
71
+ let enable_2: boolean;
72
+ export { enable_2 as enable };
73
+ }
74
+ }
75
+ export namespace mailer {
76
+ namespace from {
77
+ let name_1: string;
78
+ export { name_1 as name };
79
+ let email_3: string;
80
+ export { email_3 as email };
81
+ }
82
+ }
50
83
  export let debug: boolean;
51
84
  export namespace redis {
52
- let database: number;
85
+ let cacheDatabase: number;
86
+ let sessionDatabase: number;
53
87
  }
54
88
  export let pluginsPath: string[];
@@ -1,10 +1,26 @@
1
- import type FormData from 'form-data';
1
+ import WebSocket from 'ws';
2
+ import { type Client as GraphqlWsClient } from 'graphql-ws';
3
+ import { type AxiosResponse } from 'axios';
4
+ import FormData from 'form-data';
2
5
  import { type ActionsListConfig } from '_types/actionsList';
3
6
  import { type ITreeElement } from '_types/tree';
4
7
  import { AttributeFormats, type AttributeTypes, type IAttributeVersionsConf, type IEmbeddedAttribute } from '../../../_types/attribute';
8
+ interface IE2EUser {
9
+ getAuthToken: () => Promise<string>;
10
+ }
11
+ export declare const e2eAdminUser: () => IE2EUser;
12
+ export declare const e2eGuestUser: () => Promise<IE2EUser>;
5
13
  export declare function getGraphQLUrl(): Promise<string>;
6
- export declare function makeGraphQlCall(query: string | FormData, throwOnErrors?: boolean): Promise<any>;
7
- export declare function gqlSaveLibrary(id: string, label: string, additionalAttributes?: string[]): Promise<any>;
14
+ export declare class E2EGraphQLError extends Error {
15
+ readonly response: AxiosResponse;
16
+ constructor(message: string, response: AxiosResponse);
17
+ }
18
+ export interface IMakeGraphQlCallOptions {
19
+ user?: IE2EUser;
20
+ }
21
+ export declare function makeGraphQlCall(query: string | FormData, options?: IMakeGraphQlCallOptions): Promise<any>;
22
+ export declare function importFileGraphQlCall(query: string, filePath: string, sheets?: any): Promise<any>;
23
+ export declare function gqlSaveLibrary(id: string, label: string, additionalAttributes?: string[], settings?: string): Promise<any>;
8
24
  export declare function gqlSaveApplication(id: string, label: string, endpoint: string): Promise<any>;
9
25
  export declare function gqlSaveAttribute(params: {
10
26
  id: string;
@@ -41,3 +57,13 @@ export declare function gqlSaveVersionProfile(profileId: string, label: string,
41
57
  * Convert object to JSON, escaping quotes to be able to use it in a graphql query
42
58
  **/
43
59
  export declare function toCleanJSON(obj: {}): string;
60
+ export declare function makeWebSocketGraphQlCall(options?: {
61
+ user: IE2EUser;
62
+ }): Promise<GraphqlWsClient>;
63
+ export declare function waitGraphqlWebSocketMessage<T>(client: GraphqlWsClient, query: string, variables: Record<string, any>, acceptMessage: (msg: T) => boolean, { timeoutMs }: {
64
+ timeoutMs: any;
65
+ }): Promise<T>;
66
+ export declare function waitWebSocketMessage<T>(webSocket: WebSocket, acceptMessage: (msg: T) => boolean, { timeoutMs }: {
67
+ timeoutMs: any;
68
+ }): Promise<T>;
69
+ export {};
@@ -0,0 +1,21 @@
1
+ interface IMailpitMsgLight {
2
+ From: {
3
+ Name: string;
4
+ Address: string;
5
+ };
6
+ ID: string;
7
+ MessageID: string;
8
+ Read: boolean;
9
+ Size: number;
10
+ Subject: string;
11
+ To: Array<{
12
+ Name: string;
13
+ Address: string;
14
+ }>;
15
+ }
16
+ interface IMailpitMsgFull extends IMailpitMsgLight {
17
+ HTML: string;
18
+ Text: string;
19
+ }
20
+ export declare function waitMailpitMessage(acceptMessage: (msg: IMailpitMsgLight) => boolean): Promise<IMailpitMsgFull>;
21
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { type ILibraryRepo } from 'infra/library/libraryRepo';
2
2
  import { type IRecordRepo } from 'infra/record/recordRepo';
3
3
  import { type ITreeRepo } from 'infra/tree/treeRepo';
4
- export declare const getCoreDep: <T>(path: any) => T;
5
4
  export declare const getLibraryRepo: () => ILibraryRepo;
6
5
  export declare const getRecordRepo: () => IRecordRepo;
7
6
  export declare const getTreeRepo: () => ITreeRepo;
7
+ export * from '../integrationTestUtils';
@@ -0,0 +1,7 @@
1
+ import { type AwilixContainer } from 'awilix';
2
+ export interface IGlobalThis {
3
+ coreContainer: AwilixContainer;
4
+ taskManagerMasterTimer: NodeJS.Timeout;
5
+ }
6
+ export declare const getCoreContainer: () => AwilixContainer;
7
+ export declare const getCoreDep: <T>(path: any) => T;
@@ -16,6 +16,7 @@ export interface IConfig {
16
16
  indexationManager: IIndexationManager;
17
17
  tasksManager: ITasksManager;
18
18
  eventsManager: IEventsManager;
19
+ notification: INotificationConfig;
19
20
  debug?: boolean;
20
21
  env?: string;
21
22
  defaultUserId: string;
@@ -24,6 +25,7 @@ export interface IConfig {
24
25
  plugins: IKeyValue<IKeyValue<any>>;
25
26
  preview: IPreview;
26
27
  applications: IApplicationsConfig;
28
+ actions: IActions;
27
29
  files: IFilesConfig;
28
30
  dbProfiler: IDbProfilerConfig;
29
31
  instanceId: string;
@@ -61,6 +63,19 @@ export interface IServer {
61
63
  email: string;
62
64
  };
63
65
  }
66
+ export interface IActions {
67
+ excel: {
68
+ /**
69
+ * Replace deprecated hot-formula-parser npm module by new hyperformula npm module
70
+ * Formulas should be compatible
71
+ */
72
+ useNewHyperformula: boolean;
73
+ /**
74
+ * Add debug log for each calculation with formula and result or error
75
+ */
76
+ debug: boolean;
77
+ };
78
+ }
64
79
  export interface IDb {
65
80
  url: string;
66
81
  name: string;
@@ -97,7 +112,14 @@ export interface IAuth {
97
112
  export interface IMailer {
98
113
  host: string;
99
114
  port: number;
115
+ /**
116
+ * If true, use SSL/TLS connection (usually port 465). If false, use STARTTLS (usually port 587)
117
+ */
100
118
  secure: boolean;
119
+ /**
120
+ * If true, require TLS for the connection (STARTTLS). Only used if secure is false
121
+ */
122
+ requireTLS: boolean;
101
123
  from: {
102
124
  name: string;
103
125
  email: string;
@@ -124,7 +146,8 @@ export interface IAmqp {
124
146
  export interface IRedis {
125
147
  host: string;
126
148
  port: number;
127
- database: number;
149
+ cacheDatabase: number;
150
+ sessionDatabase: number;
128
151
  }
129
152
  export interface IFilesManager {
130
153
  queues: {
@@ -149,7 +172,7 @@ export interface IEventsManager {
149
172
  pubsub_events: string;
150
173
  };
151
174
  queues: {
152
- pubsub_events: string;
175
+ pubsub_events_prefix: string;
153
176
  };
154
177
  }
155
178
  export interface IIndexationManager {
@@ -226,6 +249,15 @@ export interface IFilesConfig {
226
249
  export interface IDbProfilerConfig {
227
250
  enable: boolean;
228
251
  }
252
+ export interface INotificationConfig {
253
+ enable: boolean;
254
+ email: {
255
+ enable: boolean;
256
+ };
257
+ webSocket: {
258
+ enable: boolean;
259
+ };
260
+ }
229
261
  export interface IElasticsearchConfig {
230
262
  indexPrefix: string;
231
263
  url: string;
@@ -1,6 +1,7 @@
1
1
  export declare enum ErrorTypes {
2
2
  VALIDATION_ERROR = "VALIDATION_ERROR",
3
3
  PERMISSION_ERROR = "PERMISSION_ERROR",
4
+ CUSTOM_CONFIG_ERROR = "CUSTOM_CONFIG_ERROR",
4
5
  INTERNAL_ERROR = "INTERNAL_ERROR"
5
6
  }
6
7
  export declare enum Errors {
@@ -16,7 +17,6 @@ export declare enum Errors {
16
17
  ENCRYPT_ERROR = "ENCRYPT_ERROR",
17
18
  ERROR = "ERROR",
18
19
  EXCEL_CALCULATION_ERROR = "EXCEL_CALCULATION_ERROR",
19
- FILE_ERROR = "FILE_ERROR",
20
20
  FILE_NOT_FOUND = "FILE_NOT_FOUND",
21
21
  FORBIDDEN_FILES = "FORBIDDEN_FILES",
22
22
  FORBIDDEN_ID = "FORBIDDEN_ID",
@@ -1,8 +1,20 @@
1
+ import { type INotificationContent } from './notification';
2
+ import { type ITask } from './tasksManager';
1
3
  export declare enum TriggerNames {
2
4
  APPLICATION_EVENT = "APPLICATION_EVENT",
3
5
  UPLOAD_FILE = "UPLOAD_FILE",
4
6
  INDEXATION = "INDEXATION",
5
7
  TASK = "TASK",
6
8
  TREE_EVENT = "TREE_EVENT",
7
- RECORD_UPDATE = "RECORD_UPDATE"
9
+ RECORD_UPDATE = "RECORD_UPDATE",
10
+ NOTIFICATION = "NOTIFICATION"
11
+ }
12
+ export interface IPubSubNotificationData {
13
+ notification: INotificationContent & {
14
+ date: number;
15
+ };
16
+ recipientUserIds: string[];
17
+ }
18
+ export interface IPubSubTaskData {
19
+ task: ITask;
8
20
  }
@@ -0,0 +1,51 @@
1
+ import { type IQueryInfos } from './queryInfos';
2
+ export interface INotification {
3
+ /**
4
+ * Timestamp of the notification creation in milliseconds since epoch
5
+ */
6
+ date: number;
7
+ /**
8
+ * User ID of the notification recipient
9
+ */
10
+ recipientUserId: string;
11
+ content: INotificationContent;
12
+ }
13
+ export interface INotificationContent {
14
+ level: 'info' | 'warning';
15
+ title: string;
16
+ message: string;
17
+ relatedEntities?: Array<{
18
+ url: string;
19
+ label: string;
20
+ }>;
21
+ attachments?: Array<{
22
+ url: string;
23
+ label: string;
24
+ }>;
25
+ }
26
+ export interface ICreateNotification {
27
+ emitterUserId: string;
28
+ /**
29
+ * Recipients of the notification, need at least one userId or groupId
30
+ */
31
+ recipients: {
32
+ userIds: string[];
33
+ /**
34
+ * No implementation yet
35
+ */
36
+ groupIds: string[];
37
+ };
38
+ /**
39
+ * Priority of the notification, may change which channel is used to send it (no yet implemented)
40
+ */
41
+ priority: 'urgent' | 'normal';
42
+ content: INotificationContent;
43
+ }
44
+ export declare enum NotificationChannels {
45
+ EMAIL = "email",
46
+ WEB_SOCKET = "web_socket"
47
+ }
48
+ export interface INotificationChannel {
49
+ type: NotificationChannels;
50
+ sendNotifications(notifications: INotification[], ctx: IQueryInfos): Promise<void>;
51
+ }
@@ -2,3 +2,13 @@ export interface IUserData {
2
2
  global: boolean;
3
3
  data: any;
4
4
  }
5
+ /**
6
+ * Same idea as IRecordIdentity but for users
7
+ */
8
+ export interface IUserIdentity {
9
+ id: string;
10
+ /**
11
+ * @throw if user have no email
12
+ */
13
+ getEmail: () => Promise<string>;
14
+ }
@@ -28,4 +28,4 @@ export interface IApplicationAppDeps {
28
28
  'core.utils': IUtils;
29
29
  config: IConfig;
30
30
  }
31
- export default function ({ 'core.app.graphql': graphqlApp, 'core.app.auth': authApp, 'core.app.helpers.initQueryContext': initQueryContext, 'core.app.helpers.validateRequestToken': validateRequestToken, 'core.app.core.subscriptionsHelper': subscriptionsHelper, 'core.domain.application': applicationDomain, 'core.domain.permission': permissionDomain, 'core.domain.record': recordDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.domain.globalSettings': globalSettings, 'core.utils.logger': logger, 'core.utils': utils, config }: IApplicationAppDeps): IApplicationApp;
31
+ export default function ({ 'core.app.graphql': graphqlApp, 'core.app.auth': authApp, 'core.app.helpers.initQueryContext': initQueryContext, 'core.app.helpers.validateRequestToken': validateRequestToken, 'core.app.core.subscriptionsHelper': subscriptionsHelper, 'core.domain.application': applicationDomain, 'core.domain.permission': permissionDomain, 'core.domain.record': recordDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.domain.globalSettings': globalSettings, 'core.utils.logger': logger, 'core.utils': utils, config, }: IApplicationAppDeps): IApplicationApp;
@@ -4,7 +4,6 @@ import { type IUserDomain } from 'domain/user/userDomain';
4
4
  import { type IValueDomain } from 'domain/value/valueDomain';
5
5
  import { type Response } from 'express';
6
6
  import { type IConfig } from '_types/config';
7
- import { type ICachesService } from '../../infra/cache/cacheService';
8
7
  import { type ITokenUserData } from '../../_types/auth';
9
8
  import { type IRequestWithContext } from '../../_types/express';
10
9
  import { type ILogger } from '@leav/logger';
@@ -16,6 +15,7 @@ import { type IRecordRepo } from '../../infra/record/recordRepo';
16
15
  import { type IGraphqlAppModule } from 'app/graphql/graphqlApp';
17
16
  import { type IServerRouteAppModule } from 'interface/server';
18
17
  import { type GetSystemQueryContext } from 'utils/helpers/getSystemQueryContext';
18
+ import { type ISessionRepo } from '../../infra/session/sessionRepo';
19
19
  export interface IAuthApp extends IGraphqlAppModule, IServerRouteAppModule {
20
20
  validateRequestToken(params: {
21
21
  apiKey?: string;
@@ -30,12 +30,12 @@ export interface IAuthAppDeps {
30
30
  'core.infra.record': IRecordRepo;
31
31
  'core.domain.apiKey': IApiKeyDomain;
32
32
  'core.domain.user': IUserDomain;
33
- 'core.infra.cache.cacheService': ICachesService;
34
33
  'core.utils.logger': ILogger;
35
34
  'core.infra.oidc.oidcClientService': IOIDCClientService;
36
35
  'core.app.helpers.initQueryContext': InitQueryContextFunc;
37
36
  'core.app.helpers.convertOIDCIdentifier': IConvertOIDCIdentifier;
38
37
  'core.utils.getSystemQueryContext': GetSystemQueryContext;
39
38
  config: IConfig;
39
+ 'core.infra.session': ISessionRepo;
40
40
  }
41
- export default function ({ 'core.domain.value': valueDomain, 'core.domain.record': recordDomain, 'core.infra.record': recordRepo, 'core.domain.apiKey': apiKeyDomain, 'core.domain.user': userDomain, 'core.utils.logger': logger, 'core.infra.cache.cacheService': cacheService, 'core.infra.oidc.oidcClientService': oidcClientService, 'core.app.helpers.initQueryContext': initQueryContext, 'core.app.helpers.convertOIDCIdentifier': convertOIDCIdentifier, 'core.utils.getSystemQueryContext': getSystemQueryContext, config }: IAuthAppDeps): IAuthApp;
41
+ export default function ({ 'core.domain.value': valueDomain, 'core.domain.record': recordDomain, 'core.infra.record': recordRepo, 'core.domain.apiKey': apiKeyDomain, 'core.domain.user': userDomain, 'core.utils.logger': logger, 'core.infra.oidc.oidcClientService': oidcClientService, 'core.app.helpers.initQueryContext': initQueryContext, 'core.app.helpers.convertOIDCIdentifier': convertOIDCIdentifier, 'core.utils.getSystemQueryContext': getSystemQueryContext, 'core.infra.session': sessionRepo, config, }: IAuthAppDeps): IAuthApp;
@@ -6,5 +6,5 @@ interface IDeps {
6
6
  'core.domain.apiKey': IApiKeyDomain;
7
7
  'core.domain.record': IRecordDomain;
8
8
  }
9
- export default function ({ 'core.domain.apiKey': apiKeyDomain, 'core.domain.record': recordDomain }: IDeps): ICoreVersionProfileApp;
9
+ export default function ({ 'core.domain.apiKey': apiKeyDomain, 'core.domain.record': recordDomain, }: IDeps): ICoreVersionProfileApp;
10
10
  export {};
@@ -19,4 +19,4 @@ export interface ICoreAppDeps {
19
19
  config: any;
20
20
  translator: i18n;
21
21
  }
22
- export default function ({ 'core.domain.core': coreDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.app.graphql.customScalars.systemTranslation': systemTranslation, 'core.app.graphql.customScalars.dateTime': DateTime, 'core.app.graphql.customScalars.any': Any, config, translator }: ICoreAppDeps): ICoreApp;
22
+ export default function ({ 'core.domain.core': coreDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.app.graphql.customScalars.systemTranslation': systemTranslation, 'core.app.graphql.customScalars.dateTime': DateTime, 'core.app.graphql.customScalars.any': Any, config, translator, }: ICoreAppDeps): ICoreApp;
@@ -8,5 +8,5 @@ interface IDeps {
8
8
  'core.app.helpers.initQueryContext': InitQueryContextFunc;
9
9
  config: IConfig;
10
10
  }
11
- export default function ({ 'core.app.helpers.initQueryContext': initQueryContext, 'core.domain.eventsManager': eventsManagerDomain, config }: IDeps): IEventsManagerApp;
11
+ export default function ({ 'core.app.helpers.initQueryContext': initQueryContext, 'core.domain.eventsManager': eventsManagerDomain, config, }: IDeps): IEventsManagerApp;
12
12
  export {};
@@ -15,5 +15,5 @@ interface IDeps {
15
15
  'core.domain.eventsManager': IEventsManagerDomain;
16
16
  config: IConfig;
17
17
  }
18
- export default function ({ 'core.app.helpers.initQueryContext': initQueryContext, 'core.app.helpers.validateRequestToken': validateRequestToken, 'core.domain.filesManager': filesManagerDomain, 'core.domain.eventsManager': eventsManager, config }: IDeps): IFilesManagerApp;
18
+ export default function ({ 'core.app.helpers.initQueryContext': initQueryContext, 'core.app.helpers.validateRequestToken': validateRequestToken, 'core.domain.filesManager': filesManagerDomain, 'core.domain.eventsManager': eventsManager, config, }: IDeps): IFilesManagerApp;
19
19
  export {};
@@ -15,7 +15,7 @@ interface IDeps {
15
15
  'core.domain.attribute.helpers.ifLibraryJoinLinkAttribute': IfLibraryJoinLinkAttribute;
16
16
  'core.utils': IUtils;
17
17
  }
18
- export default function ({ 'core.domain.attribute': attributeDomain, 'core.domain.form': formDomain, 'core.domain.library': libraryDomain, 'core.app.helpers.convertVersionFromGqlFormat': convertVersionFromGqlFormat, 'core.domain.attribute.helpers.ifLibraryJoinLinkAttribute': ifLibraryJoinLinkAttribute, 'core.utils': utils }: IDeps): {
18
+ export default function ({ 'core.domain.attribute': attributeDomain, 'core.domain.form': formDomain, 'core.domain.library': libraryDomain, 'core.app.helpers.convertVersionFromGqlFormat': convertVersionFromGqlFormat, 'core.domain.attribute.helpers.ifLibraryJoinLinkAttribute': ifLibraryJoinLinkAttribute, 'core.utils': utils, }: IDeps): {
19
19
  getGraphQLSchema(): Promise<IAppGraphQLSchema>;
20
20
  };
21
21
  export {};
@@ -16,5 +16,5 @@ interface IDeps {
16
16
  'core.utils': IUtils;
17
17
  config: IConfig;
18
18
  }
19
- export default function ({ 'core.app.helpers.initQueryContext': initQueryContext, 'core.domain.globalSettings': globalSettingsDomain, 'core.domain.record': recordDomain, 'core.utils.logger': logger, 'core.utils': utils, config }: IDeps): ICoreApp;
19
+ export default function ({ 'core.app.helpers.initQueryContext': initQueryContext, 'core.domain.globalSettings': globalSettingsDomain, 'core.domain.record': recordDomain, 'core.utils.logger': logger, 'core.utils': utils, config, }: IDeps): ICoreApp;
20
20
  export {};
@@ -15,5 +15,5 @@ interface IDeps {
15
15
  config: Config.IConfig;
16
16
  'core.utils.getSystemQueryContext': GetSystemQueryContext;
17
17
  }
18
- export default function ({ 'core.domain.import': importDomain, 'core.domain.helpers.storeUploadFile': storeUploadFile, 'core.utils': utils, 'core.utils.getSystemQueryContext': getSystemQueryContext, config }: IDeps): ICoreImportApp;
18
+ export default function ({ 'core.domain.import': importDomain, 'core.domain.helpers.storeUploadFile': storeUploadFile, 'core.utils': utils, 'core.utils.getSystemQueryContext': getSystemQueryContext, config, }: IDeps): ICoreImportApp;
19
19
  export {};
@@ -17,6 +17,7 @@ export { default as permission } from './permissionApp/permissionApp';
17
17
  export { default as plugins } from './pluginsApp';
18
18
  export { default as record } from './recordApp/recordApp';
19
19
  export { default as tasksManager } from './tasksManagerApp';
20
+ export { default as notification } from './notificationApp';
20
21
  export { default as tree } from './treeApp/treeApp';
21
22
  export { default as userData } from './userDataApp';
22
23
  export { default as value } from './valueApp';
@@ -17,5 +17,5 @@ interface IDeps {
17
17
  'core.app.graphql'?: IGraphqlApp;
18
18
  'core.app.core'?: ICoreApp;
19
19
  }
20
- export default function ({ 'core.domain.library': libraryDomain, 'core.domain.record': recordDomain, 'core.domain.attribute': attributeDomain, 'core.domain.tree': treeDomain, 'core.domain.view': viewDomain, 'core.domain.permission': permissionDomain, 'core.app.graphql': graphqlApp, 'core.app.core': coreApp }?: IDeps): ICoreLibraryApp;
20
+ export default function ({ 'core.domain.library': libraryDomain, 'core.domain.record': recordDomain, 'core.domain.attribute': attributeDomain, 'core.domain.tree': treeDomain, 'core.domain.view': viewDomain, 'core.domain.permission': permissionDomain, 'core.app.graphql': graphqlApp, 'core.app.core': coreApp, }?: IDeps): ICoreLibraryApp;
21
21
  export {};
@@ -19,5 +19,5 @@ interface IDeps {
19
19
  'core.domain.versionProfile': IVersionProfileDomain;
20
20
  'core.domain.application': IApplicationDomain;
21
21
  }
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;
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;
23
23
  export {};
@@ -0,0 +1,10 @@
1
+ import { type IGraphqlAppModule } from 'app/graphql/graphqlApp';
2
+ import { type IEventsManagerDomain } from 'domain/eventsManager/eventsManagerDomain';
3
+ import { type IUtils } from 'utils/utils';
4
+ export type INotificationApp = IGraphqlAppModule;
5
+ interface IDeps {
6
+ 'core.utils'?: IUtils;
7
+ 'core.domain.eventsManager'?: IEventsManagerDomain;
8
+ }
9
+ export default function ({ 'core.domain.eventsManager': eventsManager }: IDeps): INotificationApp;
10
+ export {};
@@ -13,5 +13,5 @@ interface IDeps {
13
13
  'core.domain.permission'?: IPermissionDomain;
14
14
  'core.domain.attribute'?: IAttributeDomain;
15
15
  }
16
- export default function ({ 'core.domain.permission': permissionDomain, 'core.domain.attribute': attributeDomain }?: IDeps): ICorePermissionApp;
16
+ export default function ({ 'core.domain.permission': permissionDomain, 'core.domain.attribute': attributeDomain, }?: IDeps): ICorePermissionApp;
17
17
  export {};
@@ -33,4 +33,5 @@ export interface IRecordsQueryVariables {
33
33
  pagination?: IRecordsQueryPagination;
34
34
  retrieveInactive?: boolean;
35
35
  searchQuery?: string;
36
+ ignoreAccessRecordByDefaultPermission?: boolean;
36
37
  }
@@ -23,5 +23,5 @@ interface IDeps {
23
23
  'core.app.helpers.convertVersionFromGqlFormat': ConvertVersionFromGqlFormatFunc;
24
24
  'core.app.core.subscriptionsHelper': ICoreSubscriptionsHelpersApp;
25
25
  }
26
- export default function ({ 'core.domain.record': recordDomain, 'core.domain.tree': treeDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.domain.permission': permissionDomain, 'core.domain.library': libraryDomain, 'core.domain.attribute': attributeDomain, 'core.utils': utils, 'core.app.graphql': graphqlApp, 'core.app.core.indexationManager': indexationManagerApp, 'core.app.helpers.convertVersionFromGqlFormat': convertVersionFromGqlFormat, 'core.app.core.subscriptionsHelper': subscriptionsHelper }: IDeps): ICoreRecordApp;
26
+ export default function ({ 'core.domain.record': recordDomain, 'core.domain.tree': treeDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.domain.permission': permissionDomain, 'core.domain.library': libraryDomain, 'core.domain.attribute': attributeDomain, 'core.utils': utils, 'core.app.graphql': graphqlApp, 'core.app.core.indexationManager': indexationManagerApp, 'core.app.helpers.convertVersionFromGqlFormat': convertVersionFromGqlFormat, 'core.app.core.subscriptionsHelper': subscriptionsHelper, }: IDeps): ICoreRecordApp;
27
27
  export {};