@aristid/leav-types 1.4.0 → 1.4.1-088d7367
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.
- package/apps/core/config/default.d.ts +32 -12
- package/apps/core/config/development.d.ts +0 -4
- package/apps/core/config/test.d.ts +43 -9
- package/apps/core/src/__tests__/e2e/api/e2eUtils.d.ts +9 -0
- package/apps/core/src/__tests__/e2e/api/export/export.test.d.ts +1 -0
- package/apps/core/src/__tests__/e2e/api/mailpitUtils.d.ts +21 -0
- package/apps/core/src/__tests__/e2e/api/permissions/extendedLibraryPermissions.test.d.ts +1 -0
- package/apps/core/src/__tests__/integration/infra/ramService.test.d.ts +1 -0
- package/apps/core/src/_types/config.d.ts +34 -7
- package/apps/core/src/_types/elasticSearch.d.ts +2 -0
- package/apps/core/src/_types/errors.d.ts +2 -0
- package/apps/core/src/_types/eventsManager.d.ts +9 -1
- package/apps/core/src/_types/forms.d.ts +2 -2
- package/apps/core/src/_types/notification.d.ts +51 -0
- package/apps/core/src/_types/userData.d.ts +10 -0
- package/apps/core/src/app/auth/authApp.d.ts +5 -3
- package/apps/core/src/app/core/index.d.ts +2 -0
- package/apps/core/src/app/core/logsCollectorApp.d.ts +9 -0
- package/apps/core/src/app/core/notificationApp.d.ts +10 -0
- package/apps/core/src/domain/export/exportDomain.d.ts +6 -1
- package/apps/core/src/domain/export/exportProfileDomain.d.ts +23 -0
- package/apps/core/src/domain/export/exportProfileDomain.spec.d.ts +1 -0
- package/apps/core/src/domain/export/index.d.ts +1 -0
- package/apps/core/src/domain/logsCollector/index.d.ts +1 -0
- package/apps/core/src/domain/logsCollector/logsCollectorDomain.d.ts +16 -0
- package/apps/core/src/domain/notification/channels/emailChannel.d.ts +12 -0
- package/apps/core/src/domain/notification/channels/webSocketChannel.d.ts +6 -0
- package/apps/core/src/domain/notification/index.d.ts +3 -0
- package/apps/core/src/domain/notification/notificationDomain.d.ts +12 -0
- package/apps/core/src/domain/permission/helpers/index.d.ts +1 -1
- package/apps/core/src/domain/permission/helpers/recordInCreationBypass.d.ts +8 -3
- package/apps/core/src/domain/permission/recordAttributePermissionDomain.d.ts +2 -2
- package/apps/core/src/domain/permission/recordPermissionDomain.d.ts +2 -2
- package/apps/core/src/domain/record/helpers/getAccessPermissionFilters.d.ts +6 -5
- package/apps/core/src/domain/record/recordDomain.d.ts +1 -0
- package/apps/core/src/domain/user/userDomain.d.ts +5 -2
- package/apps/core/src/domain/value/valueDomain.d.ts +3 -6
- package/apps/core/src/errors/CustomConfigError.d.ts +4 -0
- package/apps/core/src/infra/cache/cacheService.d.ts +4 -3
- package/apps/core/src/infra/cache/index.d.ts +1 -2
- package/apps/core/src/infra/cache/ramService.d.ts +1 -7
- package/apps/core/src/infra/cache/redis.d.ts +5 -1
- package/apps/core/src/infra/{elasticSearch/elasticSearchService.d.ts → elasticsearch/elasticsearchService.d.ts} +7 -6
- package/apps/core/src/infra/elasticsearch/index.d.ts +1 -0
- package/apps/core/src/infra/log/logRepo.d.ts +3 -3
- package/apps/core/src/infra/oidc/oidcClientService.d.ts +3 -3
- package/apps/core/src/infra/session/index.d.ts +1 -0
- package/apps/core/src/infra/session/sessionRepo.d.ts +8 -0
- package/apps/core/src/interface/index.d.ts +1 -0
- package/apps/core/src/interface/logsCollector.d.ts +9 -0
- package/libs/logger/src/LoggerCallStack.d.ts +14 -0
- package/libs/logger/src/catchErrorFormatter.d.ts +2 -0
- package/libs/logger/src/config.d.ts +32 -3
- package/libs/logger/src/locationInfoFormatter.d.ts +2 -0
- package/libs/logger/src/logger.d.ts +1 -1
- package/libs/message-broker/src/amqpService.d.ts +2 -2
- package/libs/message-broker/src/types/amqp.d.ts +1 -1
- package/package.json +2 -2
- package/apps/core/src/infra/elasticSearch/index.d.ts +0 -1
- /package/apps/core/src/infra/{elasticSearch/elasticSearchClient.d.ts → elasticsearch/elasticsearchClient.d.ts} +0 -0
|
@@ -3,6 +3,7 @@ export declare let coreMode: string;
|
|
|
3
3
|
export declare namespace server {
|
|
4
4
|
let host: string;
|
|
5
5
|
let port: number;
|
|
6
|
+
let keepAliveTimeout: number;
|
|
6
7
|
let publicUrl: string;
|
|
7
8
|
let basePath: string;
|
|
8
9
|
let allowIntrospection: boolean;
|
|
@@ -62,6 +63,13 @@ export declare namespace mailer {
|
|
|
62
63
|
export { port_1 as port };
|
|
63
64
|
let secure_1: boolean;
|
|
64
65
|
export { secure_1 as secure };
|
|
66
|
+
export let requireTLS: boolean;
|
|
67
|
+
export namespace from {
|
|
68
|
+
let name_1: string;
|
|
69
|
+
export { name_1 as name };
|
|
70
|
+
let email_2: string;
|
|
71
|
+
export { email_2 as email };
|
|
72
|
+
}
|
|
65
73
|
export namespace auth_1 {
|
|
66
74
|
export let user: string;
|
|
67
75
|
let password_1: string;
|
|
@@ -89,12 +97,6 @@ export declare namespace lang {
|
|
|
89
97
|
let _default: string;
|
|
90
98
|
export { _default as default };
|
|
91
99
|
}
|
|
92
|
-
export declare namespace logs {
|
|
93
|
-
let level: string;
|
|
94
|
-
let transport: string;
|
|
95
|
-
let destinationFile: string;
|
|
96
|
-
let useJsonFormat: boolean;
|
|
97
|
-
}
|
|
98
100
|
export declare namespace permissions {
|
|
99
101
|
let _default_1: boolean;
|
|
100
102
|
export { _default_1 as default };
|
|
@@ -120,7 +122,8 @@ export declare namespace redis {
|
|
|
120
122
|
export { host_2 as host };
|
|
121
123
|
let port_3: string;
|
|
122
124
|
export { port_3 as port };
|
|
123
|
-
export let
|
|
125
|
+
export let cacheDatabase: number;
|
|
126
|
+
export let sessionDatabase: number;
|
|
124
127
|
}
|
|
125
128
|
export declare namespace filesManager {
|
|
126
129
|
namespace queues {
|
|
@@ -166,8 +169,7 @@ export declare namespace eventsManager {
|
|
|
166
169
|
}
|
|
167
170
|
export { routingKeys_2 as routingKeys };
|
|
168
171
|
export namespace queues_2 {
|
|
169
|
-
let
|
|
170
|
-
export { pubsub_events_1 as pubsub_events };
|
|
172
|
+
let pubsub_events_prefix: string;
|
|
171
173
|
}
|
|
172
174
|
export { queues_2 as queues };
|
|
173
175
|
}
|
|
@@ -199,6 +201,19 @@ export declare namespace preview {
|
|
|
199
201
|
let directory_3: string;
|
|
200
202
|
export { directory_3 as directory };
|
|
201
203
|
}
|
|
204
|
+
export declare namespace notification {
|
|
205
|
+
let enable_3: boolean;
|
|
206
|
+
export { enable_3 as enable };
|
|
207
|
+
export namespace email_3 {
|
|
208
|
+
let enable_4: boolean;
|
|
209
|
+
export { enable_4 as enable };
|
|
210
|
+
}
|
|
211
|
+
export { email_3 as email };
|
|
212
|
+
export namespace webSocket {
|
|
213
|
+
let enable_5: boolean;
|
|
214
|
+
export { enable_5 as enable };
|
|
215
|
+
}
|
|
216
|
+
}
|
|
202
217
|
export declare namespace applications {
|
|
203
218
|
let rootFolder: string;
|
|
204
219
|
}
|
|
@@ -207,13 +222,18 @@ export declare namespace files {
|
|
|
207
222
|
let originalsPathPrefix: string;
|
|
208
223
|
}
|
|
209
224
|
export declare namespace dbProfiler {
|
|
210
|
-
let
|
|
211
|
-
export {
|
|
225
|
+
let enable_6: boolean;
|
|
226
|
+
export { enable_6 as enable };
|
|
212
227
|
}
|
|
213
|
-
export declare namespace
|
|
228
|
+
export declare namespace elasticsearch {
|
|
214
229
|
export let indexPrefix: string;
|
|
215
230
|
let url_2: string;
|
|
216
231
|
export { url_2 as url };
|
|
232
|
+
export let ilmPolicyName: string;
|
|
233
|
+
export let templateName: string;
|
|
234
|
+
}
|
|
235
|
+
export declare namespace logsCollector {
|
|
236
|
+
let queue: string;
|
|
217
237
|
}
|
|
218
238
|
export declare let pluginsPath: string | any[];
|
|
219
239
|
export { _export as export, _import as import };
|
|
@@ -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
|
|
39
|
+
export namespace queues_2 {
|
|
31
40
|
let events_1: string;
|
|
32
41
|
export { events_1 as events };
|
|
33
42
|
}
|
|
34
|
-
export {
|
|
43
|
+
export { queues_2 as queues };
|
|
35
44
|
}
|
|
36
45
|
export namespace tasksManager {
|
|
37
|
-
export
|
|
38
|
-
|
|
46
|
+
export let checkingInterval: number;
|
|
47
|
+
export namespace queues_3 {
|
|
48
|
+
let execOrders: string;
|
|
49
|
+
let cancelOrders: string;
|
|
39
50
|
}
|
|
40
|
-
export {
|
|
51
|
+
export { queues_3 as queues };
|
|
41
52
|
export namespace routingKeys_1 {
|
|
42
|
-
let
|
|
43
|
-
export {
|
|
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
|
|
85
|
+
let cacheDatabase: number;
|
|
86
|
+
let sessionDatabase: number;
|
|
53
87
|
}
|
|
54
88
|
export let pluginsPath: string[];
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import WebSocket from 'ws';
|
|
2
|
+
import { type Client as GraphqlWsClient } from 'graphql-ws';
|
|
1
3
|
import type FormData from 'form-data';
|
|
2
4
|
import { type ActionsListConfig } from '_types/actionsList';
|
|
3
5
|
import { type ITreeElement } from '_types/tree';
|
|
@@ -41,3 +43,10 @@ export declare function gqlSaveVersionProfile(profileId: string, label: string,
|
|
|
41
43
|
* Convert object to JSON, escaping quotes to be able to use it in a graphql query
|
|
42
44
|
**/
|
|
43
45
|
export declare function toCleanJSON(obj: {}): string;
|
|
46
|
+
export declare function makeWebSocketGraphQlCall(): Promise<GraphqlWsClient>;
|
|
47
|
+
export declare function waitGraphqlWebSocketMessage<T>(client: GraphqlWsClient, query: string, variables: Record<string, any>, acceptMessage: (msg: T) => boolean, { timeoutMs }: {
|
|
48
|
+
timeoutMs: any;
|
|
49
|
+
}): Promise<T>;
|
|
50
|
+
export declare function waitWebSocketMessage<T>(webSocket: WebSocket, acceptMessage: (msg: T) => boolean, { timeoutMs }: {
|
|
51
|
+
timeoutMs: any;
|
|
52
|
+
}): Promise<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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 {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type ILoggerConfig } from '@leav/logger';
|
|
2
1
|
import { type Options } from 'amqplib';
|
|
3
2
|
import { type IKeyValue } from './shared';
|
|
4
3
|
export interface IConfig {
|
|
@@ -10,7 +9,6 @@ export interface IConfig {
|
|
|
10
9
|
auth: IAuth;
|
|
11
10
|
mailer: IMailer;
|
|
12
11
|
lang: ILang;
|
|
13
|
-
logs: ILogs;
|
|
14
12
|
permissions: IPermissions;
|
|
15
13
|
amqp: IAmqp;
|
|
16
14
|
redis: IRedis;
|
|
@@ -18,6 +16,7 @@ export interface IConfig {
|
|
|
18
16
|
indexationManager: IIndexationManager;
|
|
19
17
|
tasksManager: ITasksManager;
|
|
20
18
|
eventsManager: IEventsManager;
|
|
19
|
+
notification: INotificationConfig;
|
|
21
20
|
debug?: boolean;
|
|
22
21
|
env?: string;
|
|
23
22
|
defaultUserId: string;
|
|
@@ -29,7 +28,8 @@ export interface IConfig {
|
|
|
29
28
|
files: IFilesConfig;
|
|
30
29
|
dbProfiler: IDbProfilerConfig;
|
|
31
30
|
instanceId: string;
|
|
32
|
-
|
|
31
|
+
elasticsearch: IElasticsearchConfig;
|
|
32
|
+
logsCollector: ILogsCollector;
|
|
33
33
|
pluginsPath: string[];
|
|
34
34
|
bugsnag: IBugsnag;
|
|
35
35
|
matomo: IMatomo;
|
|
@@ -41,11 +41,13 @@ export declare enum CoreMode {
|
|
|
41
41
|
INDEXATION_MANAGER = "indexationManager",
|
|
42
42
|
TASKS_MANAGER_MASTER = "tasksManager:master",
|
|
43
43
|
TASKS_MANAGER_WORKER = "tasksManager:worker",
|
|
44
|
+
LOGS_COLLECTOR = "logsCollector",
|
|
44
45
|
CLI = "cli"
|
|
45
46
|
}
|
|
46
47
|
export interface IServer {
|
|
47
48
|
host: string;
|
|
48
49
|
port: number;
|
|
50
|
+
keepAliveTimeout: number;
|
|
49
51
|
publicUrl: string;
|
|
50
52
|
basePath: string;
|
|
51
53
|
allowIntrospection: boolean;
|
|
@@ -96,7 +98,18 @@ export interface IAuth {
|
|
|
96
98
|
export interface IMailer {
|
|
97
99
|
host: string;
|
|
98
100
|
port: number;
|
|
101
|
+
/**
|
|
102
|
+
* If true, use SSL/TLS connection (usually port 465). If false, use STARTTLS (usually port 587)
|
|
103
|
+
*/
|
|
99
104
|
secure: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* If true, require TLS for the connection (STARTTLS). Only used if secure is false
|
|
107
|
+
*/
|
|
108
|
+
requireTLS: boolean;
|
|
109
|
+
from: {
|
|
110
|
+
name: string;
|
|
111
|
+
email: string;
|
|
112
|
+
};
|
|
100
113
|
auth: {
|
|
101
114
|
user: string;
|
|
102
115
|
password: string;
|
|
@@ -106,7 +119,6 @@ export interface ILang {
|
|
|
106
119
|
available: string[];
|
|
107
120
|
default: string;
|
|
108
121
|
}
|
|
109
|
-
export type ILogs = ILoggerConfig;
|
|
110
122
|
export interface IPermissions {
|
|
111
123
|
default: boolean;
|
|
112
124
|
enableCache: boolean;
|
|
@@ -120,7 +132,8 @@ export interface IAmqp {
|
|
|
120
132
|
export interface IRedis {
|
|
121
133
|
host: string;
|
|
122
134
|
port: number;
|
|
123
|
-
|
|
135
|
+
cacheDatabase: number;
|
|
136
|
+
sessionDatabase: number;
|
|
124
137
|
}
|
|
125
138
|
export interface IFilesManager {
|
|
126
139
|
queues: {
|
|
@@ -145,7 +158,7 @@ export interface IEventsManager {
|
|
|
145
158
|
pubsub_events: string;
|
|
146
159
|
};
|
|
147
160
|
queues: {
|
|
148
|
-
|
|
161
|
+
pubsub_events_prefix: string;
|
|
149
162
|
};
|
|
150
163
|
}
|
|
151
164
|
export interface IIndexationManager {
|
|
@@ -222,9 +235,20 @@ export interface IFilesConfig {
|
|
|
222
235
|
export interface IDbProfilerConfig {
|
|
223
236
|
enable: boolean;
|
|
224
237
|
}
|
|
225
|
-
export interface
|
|
238
|
+
export interface INotificationConfig {
|
|
239
|
+
enable: boolean;
|
|
240
|
+
email: {
|
|
241
|
+
enable: boolean;
|
|
242
|
+
};
|
|
243
|
+
webSocket: {
|
|
244
|
+
enable: boolean;
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
export interface IElasticsearchConfig {
|
|
226
248
|
indexPrefix: string;
|
|
227
249
|
url: string;
|
|
250
|
+
ilmPolicyName: string;
|
|
251
|
+
templateName: string;
|
|
228
252
|
}
|
|
229
253
|
export interface IBugsnag {
|
|
230
254
|
enable: boolean;
|
|
@@ -238,3 +262,6 @@ export interface IMatomo {
|
|
|
238
262
|
url?: string;
|
|
239
263
|
siteId?: string;
|
|
240
264
|
}
|
|
265
|
+
export interface ILogsCollector {
|
|
266
|
+
queue: string;
|
|
267
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
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 {
|
|
8
|
+
ATTRIBUTE_USED_BY_LIBRARY = "ATTRIBUTE_USED_BY_LIBRARY",
|
|
7
9
|
ATTRIBUTE_USED_IN_METADATA = "ATTRIBUTE_USED_IN_METADATA",
|
|
8
10
|
CANNOT_SAVE_METADATA = "CANNOT_SAVE_METADATA",
|
|
9
11
|
DUPLICATE_DIRECTORY_NAMES = "DUPLICATE_DIRECTORY_NAMES",
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
import { type INotificationContent } from './notification';
|
|
1
2
|
export declare enum TriggerNames {
|
|
2
3
|
APPLICATION_EVENT = "APPLICATION_EVENT",
|
|
3
4
|
UPLOAD_FILE = "UPLOAD_FILE",
|
|
4
5
|
INDEXATION = "INDEXATION",
|
|
5
6
|
TASK = "TASK",
|
|
6
7
|
TREE_EVENT = "TREE_EVENT",
|
|
7
|
-
RECORD_UPDATE = "RECORD_UPDATE"
|
|
8
|
+
RECORD_UPDATE = "RECORD_UPDATE",
|
|
9
|
+
NOTIFICATION = "NOTIFICATION"
|
|
10
|
+
}
|
|
11
|
+
export interface IPubSubNotificationData {
|
|
12
|
+
notification: INotificationContent & {
|
|
13
|
+
date: number;
|
|
14
|
+
};
|
|
15
|
+
recipientUserIds: string[];
|
|
8
16
|
}
|
|
@@ -22,8 +22,8 @@ export interface IRecordForm {
|
|
|
22
22
|
sidePanel: IFormSidePanel;
|
|
23
23
|
}
|
|
24
24
|
export declare enum FormElementTypes {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
FIELD = "field",
|
|
26
|
+
LAYOUT = "layout"
|
|
27
27
|
}
|
|
28
28
|
export type IFormStrict = Required<IForm>;
|
|
29
29
|
export interface IFormElementsDependency {
|
|
@@ -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
|
+
}
|
|
@@ -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';
|
|
@@ -15,6 +14,8 @@ import { type IncomingHttpHeaders } from 'http';
|
|
|
15
14
|
import { type IRecordRepo } from '../../infra/record/recordRepo';
|
|
16
15
|
import { type IGraphqlAppModule } from 'app/graphql/graphqlApp';
|
|
17
16
|
import { type IServerRouteAppModule } from 'interface/server';
|
|
17
|
+
import { type GetSystemQueryContext } from 'utils/helpers/getSystemQueryContext';
|
|
18
|
+
import { type ISessionRepo } from '../../infra/session/sessionRepo';
|
|
18
19
|
export interface IAuthApp extends IGraphqlAppModule, IServerRouteAppModule {
|
|
19
20
|
validateRequestToken(params: {
|
|
20
21
|
apiKey?: string;
|
|
@@ -29,11 +30,12 @@ export interface IAuthAppDeps {
|
|
|
29
30
|
'core.infra.record': IRecordRepo;
|
|
30
31
|
'core.domain.apiKey': IApiKeyDomain;
|
|
31
32
|
'core.domain.user': IUserDomain;
|
|
32
|
-
'core.infra.cache.cacheService': ICachesService;
|
|
33
33
|
'core.utils.logger': ILogger;
|
|
34
34
|
'core.infra.oidc.oidcClientService': IOIDCClientService;
|
|
35
35
|
'core.app.helpers.initQueryContext': InitQueryContextFunc;
|
|
36
36
|
'core.app.helpers.convertOIDCIdentifier': IConvertOIDCIdentifier;
|
|
37
|
+
'core.utils.getSystemQueryContext': GetSystemQueryContext;
|
|
37
38
|
config: IConfig;
|
|
39
|
+
'core.infra.session': ISessionRepo;
|
|
38
40
|
}
|
|
39
|
-
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.
|
|
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;
|
|
@@ -10,12 +10,14 @@ export { default as globalSettings } from './globalSettingsApp';
|
|
|
10
10
|
export { default as subscriptionsHelper } from './helpers/subscriptions';
|
|
11
11
|
export { default as import } from './importApp';
|
|
12
12
|
export { default as indexationManager } from './indexationManagerApp';
|
|
13
|
+
export { default as logsCollector } from './logsCollectorApp';
|
|
13
14
|
export { default as library } from './libraryApp/libraryApp';
|
|
14
15
|
export { default as log } from './logApp';
|
|
15
16
|
export { default as permission } from './permissionApp/permissionApp';
|
|
16
17
|
export { default as plugins } from './pluginsApp';
|
|
17
18
|
export { default as record } from './recordApp/recordApp';
|
|
18
19
|
export { default as tasksManager } from './tasksManagerApp';
|
|
20
|
+
export { default as notification } from './notificationApp';
|
|
19
21
|
export { default as tree } from './treeApp/treeApp';
|
|
20
22
|
export { default as userData } from './userDataApp';
|
|
21
23
|
export { default as value } from './valueApp';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ILogsCollectorDomain } from 'domain/logsCollector/logsCollectorDomain';
|
|
2
|
+
export interface ILogsCollectorApp {
|
|
3
|
+
init(): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
interface IDeps {
|
|
6
|
+
'core.domain.logsCollector': ILogsCollectorDomain;
|
|
7
|
+
}
|
|
8
|
+
export default function ({ 'core.domain.logsCollector': logsCollector }: IDeps): ILogsCollectorApp;
|
|
9
|
+
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 {};
|
|
@@ -11,8 +11,11 @@ import { type IQueryInfos } from '../../_types/queryInfos';
|
|
|
11
11
|
import { type IRecordFilterLight } from '../../_types/record';
|
|
12
12
|
import { type ITaskFuncParams } from '../../_types/tasksManager';
|
|
13
13
|
import { type IValidateHelper } from '../helpers/validate';
|
|
14
|
+
import { type INotificationDomain } from 'domain/notification/notificationDomain';
|
|
15
|
+
import { type IExportProfileDomain } from './exportProfileDomain';
|
|
14
16
|
export interface IExportParams {
|
|
15
17
|
library: string;
|
|
18
|
+
profile: string;
|
|
16
19
|
attributes: string[];
|
|
17
20
|
filters?: IRecordFilterLight[];
|
|
18
21
|
ctx: IQueryInfos;
|
|
@@ -39,8 +42,10 @@ export interface IExportDomainDeps {
|
|
|
39
42
|
'core.domain.helpers.validate': IValidateHelper;
|
|
40
43
|
'core.domain.helpers.updateTaskProgress': UpdateTaskProgress;
|
|
41
44
|
'core.domain.eventsManager': IEventsManagerDomain;
|
|
45
|
+
'core.domain.notification': INotificationDomain;
|
|
46
|
+
'core.domain.export.exportProfile': IExportProfileDomain;
|
|
42
47
|
'core.utils': IUtils;
|
|
43
48
|
translator: i18n;
|
|
44
49
|
config: Config.IConfig;
|
|
45
50
|
}
|
|
46
|
-
export default function ({ config, 'core.domain.record': recordDomain, 'core.domain.helpers.validate': validateHelper, 'core.domain.attribute': attributeDomain, 'core.domain.library': libraryDomain, 'core.domain.tasksManager': tasksManager, 'core.domain.helpers.updateTaskProgress': updateTaskProgress, 'core.domain.eventsManager': eventsManagerDomain, 'core.utils': utils, translator }: IExportDomainDeps): IExportDomain;
|
|
51
|
+
export default function ({ config, 'core.domain.record': recordDomain, 'core.domain.helpers.validate': validateHelper, 'core.domain.attribute': attributeDomain, 'core.domain.library': libraryDomain, 'core.domain.tasksManager': tasksManager, 'core.domain.helpers.updateTaskProgress': updateTaskProgress, 'core.domain.eventsManager': eventsManagerDomain, 'core.domain.notification': notificationDomain, 'core.domain.export.exportProfile': exportProfileDomain, 'core.utils': utils, translator }: IExportDomainDeps): IExportDomain;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ILibraryDomain } from '../library/libraryDomain';
|
|
2
|
+
import { type IQueryInfos } from '../../_types/queryInfos';
|
|
3
|
+
export interface IExportProfileConfig {
|
|
4
|
+
profileSelected: string;
|
|
5
|
+
profiles: Array<{
|
|
6
|
+
label: string;
|
|
7
|
+
columns: Array<{
|
|
8
|
+
columnLabel: string;
|
|
9
|
+
attribute: string;
|
|
10
|
+
}>;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
export interface IExportColumn {
|
|
14
|
+
columnLabel: string;
|
|
15
|
+
attribute: string;
|
|
16
|
+
}
|
|
17
|
+
export interface IExportProfileDomain {
|
|
18
|
+
getColumnsFromProfileConfig(profile: string, library: string, ctx: IQueryInfos): Promise<IExportColumn[]>;
|
|
19
|
+
}
|
|
20
|
+
export interface IExportProfileDomainDeps {
|
|
21
|
+
'core.domain.library': ILibraryDomain;
|
|
22
|
+
}
|
|
23
|
+
export default function ({ 'core.domain.library': libraryDomain }: IExportProfileDomainDeps): IExportProfileDomain;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './logsCollectorDomain';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type IAmqpService } from '@leav/message-broker';
|
|
2
|
+
import { type ILogger } from '@leav/logger';
|
|
3
|
+
import type * as Config from '_types/config';
|
|
4
|
+
import { type IIndexationService } from '../../infra/indexation/indexationService';
|
|
5
|
+
import { type IElasticsearchService } from '../../infra/elasticsearch/elasticsearchService';
|
|
6
|
+
export interface ILogsCollectorDomain {
|
|
7
|
+
init(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export interface ILogsCollectorDomainDeps {
|
|
10
|
+
config: Config.IConfig;
|
|
11
|
+
'core.infra.amqpService': IAmqpService;
|
|
12
|
+
'core.infra.indexation.indexationService': IIndexationService;
|
|
13
|
+
'core.utils.logger': ILogger;
|
|
14
|
+
'core.infra.elasticsearch.service': IElasticsearchService;
|
|
15
|
+
}
|
|
16
|
+
export default function ({ config, 'core.infra.amqpService': amqpService, 'core.infra.indexation.indexationService': indexationService, 'core.utils.logger': logger, 'core.infra.elasticsearch.service': esService }: ILogsCollectorDomainDeps): ILogsCollectorDomain;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type INotificationChannel } from '../../../_types/notification';
|
|
2
|
+
import { type IMailerService } from 'infra/mailer/mailerService';
|
|
3
|
+
import { type IUserDomain } from 'domain/user/userDomain';
|
|
4
|
+
import { type IGlobalSettingsDomain } from 'domain/globalSettings/globalSettingsDomain';
|
|
5
|
+
import { type IConfig } from '_types/config';
|
|
6
|
+
export interface INotificationByEmailChannelDeps {
|
|
7
|
+
config: IConfig;
|
|
8
|
+
'core.infra.mailer.mailerService': IMailerService;
|
|
9
|
+
'core.domain.globalSettings': IGlobalSettingsDomain;
|
|
10
|
+
'core.domain.user': IUserDomain;
|
|
11
|
+
}
|
|
12
|
+
export default function ({ config, 'core.infra.mailer.mailerService': mailerService, 'core.domain.globalSettings': globalSettingsDomain, 'core.domain.user': userDomain }: INotificationByEmailChannelDeps): INotificationChannel;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type INotificationChannel } from '../../../_types/notification';
|
|
2
|
+
import { type IEventsManagerDomain } from 'domain/eventsManager/eventsManagerDomain';
|
|
3
|
+
export interface INotificationByWebSocketChannelDeps {
|
|
4
|
+
'core.domain.eventsManager': IEventsManagerDomain;
|
|
5
|
+
}
|
|
6
|
+
export default function ({ 'core.domain.eventsManager': eventsManagerDomain }: INotificationByWebSocketChannelDeps): INotificationChannel;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type IConfig } from '_types/config';
|
|
2
|
+
import { type INotificationChannel, type ICreateNotification } from '_types/notification';
|
|
3
|
+
import { type IQueryInfos } from '_types/queryInfos';
|
|
4
|
+
export interface INotificationDomain {
|
|
5
|
+
createNotification(notification: ICreateNotification, ctx: IQueryInfos): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export interface INotificationDomainDeps {
|
|
8
|
+
'core.domain.notification.emailChannel': INotificationChannel;
|
|
9
|
+
'core.domain.notification.webSocketChannel': INotificationChannel;
|
|
10
|
+
config: IConfig;
|
|
11
|
+
}
|
|
12
|
+
export default function ({ 'core.domain.notification.emailChannel': emailChannel, 'core.domain.notification.webSocketChannel': webSocketChannel, config }: INotificationDomainDeps): INotificationDomain;
|
|
@@ -5,4 +5,4 @@ export { default as permissionsByActions } from './permissionsByActions';
|
|
|
5
5
|
export { default as reducePermissionsArray } from './reducePermissionsArray';
|
|
6
6
|
export { default as simplePermission } from './simplePermission';
|
|
7
7
|
export { default as treeBasedPermissions } from './treeBasedPermissions';
|
|
8
|
-
export { default as
|
|
8
|
+
export { default as recordInCreationBypass } from './recordInCreationBypass';
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { type IRecord } from '../../../_types/record';
|
|
2
2
|
import { type IQueryInfos } from '../../../_types/queryInfos';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { type IRecordRepo } from '../../../infra/record/recordRepo';
|
|
4
|
+
export interface IRecordInCreationBypassHelper {
|
|
5
|
+
recordInCreationBypass: (record: IRecord, ctx: IQueryInfos) => boolean;
|
|
6
|
+
recordInCreationBypassById: (libraryId: string, recordId: string, ctx: IQueryInfos) => Promise<boolean>;
|
|
5
7
|
}
|
|
6
|
-
export
|
|
8
|
+
export interface IRecordInCreationBypassHelperDeps {
|
|
9
|
+
'core.infra.record': IRecordRepo;
|
|
10
|
+
}
|
|
11
|
+
export default function ({ 'core.infra.record': recordRepo }: IRecordInCreationBypassHelperDeps): IRecordInCreationBypassHelper;
|
|
@@ -8,7 +8,7 @@ import { type IPermissionByUserGroupsHelper } from './helpers/permissionByUserGr
|
|
|
8
8
|
import { type ITreeBasedPermissionHelper } from './helpers/treeBasedPermissions';
|
|
9
9
|
import { type IGetRecordAttributeHeritedPermissionsParams as IGetRecordAttributeInheritedPermissionsParams } from './_types';
|
|
10
10
|
import { type IRecordRepo } from '../../infra/record/recordRepo';
|
|
11
|
-
import { type
|
|
11
|
+
import { type IRecordInCreationBypassHelper } from './helpers/recordInCreationBypass';
|
|
12
12
|
export interface IRecordAttributePermissionDomain {
|
|
13
13
|
getRecordAttributePermission(action: RecordAttributePermissionsActions, userGroupId: string, attributeId: string, recordLibrary: string, recordId: string, ctx: IQueryInfos): Promise<boolean>;
|
|
14
14
|
getInheritedRecordAttributePermission(params: IGetRecordAttributeInheritedPermissionsParams, ctx: IQueryInfos): Promise<boolean>;
|
|
@@ -18,7 +18,7 @@ export interface IRecordAttributePermissionDomainDeps {
|
|
|
18
18
|
'core.domain.permission.helpers.treeBasedPermissions': ITreeBasedPermissionHelper;
|
|
19
19
|
'core.domain.permission.helpers.permissionByUserGroups': IPermissionByUserGroupsHelper;
|
|
20
20
|
'core.domain.permission.helpers.defaultPermission': IDefaultPermissionHelper;
|
|
21
|
-
'core.domain.permission.helpers.
|
|
21
|
+
'core.domain.permission.helpers.recordInCreationBypass': IRecordInCreationBypassHelper;
|
|
22
22
|
'core.domain.attribute': IAttributeDomain;
|
|
23
23
|
'core.infra.value': IValueRepo;
|
|
24
24
|
'core.infra.record': IRecordRepo;
|
|
@@ -8,7 +8,7 @@ import { type ILibraryPermissionDomain } from './libraryPermissionDomain';
|
|
|
8
8
|
import { type IEstimateTreeValueRecordPermissionParams, type IGetInheritedRecordPermissionParams, type IGetRecordPermissionParams } from './_types';
|
|
9
9
|
import { type ITreeRepo } from '../../infra/tree/treeRepo';
|
|
10
10
|
import { type IRecordRepo } from '../../infra/record/recordRepo';
|
|
11
|
-
import { type
|
|
11
|
+
import { type IRecordInCreationBypassHelper } from './helpers/recordInCreationBypass';
|
|
12
12
|
export interface IRecordPermissionDomain {
|
|
13
13
|
getRecordPermission(params: IGetRecordPermissionParams): Promise<boolean>;
|
|
14
14
|
getInheritedRecordPermission(params: IGetInheritedRecordPermissionParams): Promise<boolean>;
|
|
@@ -19,7 +19,7 @@ export interface IRecordPermissionDomainDeps {
|
|
|
19
19
|
'core.domain.permission.helpers.treeBasedPermissions': ITreeBasedPermissionHelper;
|
|
20
20
|
'core.domain.permission.helpers.permissionByUserGroups': IPermissionByUserGroupsHelper;
|
|
21
21
|
'core.domain.permission.helpers.defaultPermission': IDefaultPermissionHelper;
|
|
22
|
-
'core.domain.permission.helpers.
|
|
22
|
+
'core.domain.permission.helpers.recordInCreationBypass': IRecordInCreationBypassHelper;
|
|
23
23
|
'core.domain.attribute': IAttributeDomain;
|
|
24
24
|
'core.domain.helpers.getCoreEntityById': GetCoreEntityByIdFunc;
|
|
25
25
|
'core.infra.value': IValueRepo;
|
|
@@ -11,14 +11,15 @@ interface IAccessPermissionFilterDeps {
|
|
|
11
11
|
'core.infra.permission': IPermissionRepo;
|
|
12
12
|
'core.domain.permission.helpers.defaultPermission': IDefaultPermissionHelper;
|
|
13
13
|
}
|
|
14
|
+
interface INodeIdsByPermissions {
|
|
15
|
+
true: Array<ITreeNode['id']>;
|
|
16
|
+
false: Array<ITreeNode['id']>;
|
|
17
|
+
}
|
|
14
18
|
export interface IGetAccessPermissionsValue {
|
|
15
19
|
treeId: string;
|
|
16
20
|
attribute: IAttribute;
|
|
17
|
-
permissions:
|
|
18
|
-
true: Array<ITreeNode['id']>;
|
|
19
|
-
false: Array<ITreeNode['id']>;
|
|
20
|
-
};
|
|
21
|
+
permissions: INodeIdsByPermissions;
|
|
21
22
|
}
|
|
22
|
-
export type IGetAccessPermissions = (groupsIds: string[][], library: string, deps: IAccessPermissionFilterDeps, ctx: IQueryInfos) => Promise<IGetAccessPermissionsValue[]>;
|
|
23
|
+
export type IGetAccessPermissions = (groupsIds: string[][], library: string, existingFiltersOnTreeIds: string[], deps: IAccessPermissionFilterDeps, ctx: IQueryInfos) => Promise<IGetAccessPermissionsValue[]>;
|
|
23
24
|
declare const getAccessPermissionsFilters: IGetAccessPermissions;
|
|
24
25
|
export default getAccessPermissionsFilters;
|
|
@@ -26,6 +26,7 @@ import { type DeleteRecordHelper } from './helpers/deleteRecord';
|
|
|
26
26
|
import { type CreateRecordHelper } from './helpers/createRecord';
|
|
27
27
|
import { type IElementAncestorsHelper } from 'domain/tree/helpers/elementAncestors';
|
|
28
28
|
import { type ILogger } from '@leav/logger';
|
|
29
|
+
export declare const ATTRIBUTE_ACTIVE = "active";
|
|
29
30
|
export interface IRecordDomain {
|
|
30
31
|
/**
|
|
31
32
|
* Create empty record
|
|
@@ -6,7 +6,8 @@ import { type IUserDataRepo } from 'infra/userData/userDataRepo';
|
|
|
6
6
|
import { type IUtils } from 'utils/utils';
|
|
7
7
|
import type * as Config from '_types/config';
|
|
8
8
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
9
|
-
import { type IUserData } from '_types/userData';
|
|
9
|
+
import { type IUserIdentity, type IUserData } from '_types/userData';
|
|
10
|
+
import { type IValueDomain } from 'domain/value/valueDomain';
|
|
10
11
|
interface ISaveUserDataParams {
|
|
11
12
|
key: string;
|
|
12
13
|
value: any;
|
|
@@ -15,12 +16,14 @@ interface ISaveUserDataParams {
|
|
|
15
16
|
ctx: IQueryInfos;
|
|
16
17
|
}
|
|
17
18
|
export interface IUserDomain {
|
|
19
|
+
getUserIdentity(userId: string, ctx: IQueryInfos): Promise<IUserIdentity>;
|
|
18
20
|
saveUserData(params: ISaveUserDataParams): Promise<IUserData>;
|
|
19
21
|
getUserData(keys: string[], global: boolean, ctx: IQueryInfos): Promise<IUserData>;
|
|
20
22
|
sendResetPasswordEmail(email: string, token: string, login: string, browser: string, os: string, lang: 'fr' | 'en', ctx: IQueryInfos): Promise<void>;
|
|
21
23
|
}
|
|
22
24
|
export interface IUserDomainDeps {
|
|
23
25
|
config: Config.IConfig;
|
|
26
|
+
'core.domain.value': IValueDomain;
|
|
24
27
|
'core.domain.permissions': IPermissionDomain;
|
|
25
28
|
'core.infra.userData': IUserDataRepo;
|
|
26
29
|
'core.domain.permission': IPermissionDomain;
|
|
@@ -32,5 +35,5 @@ export interface IUserDomainDeps {
|
|
|
32
35
|
export declare enum UserCoreDataKeys {
|
|
33
36
|
CONSULTED_APPS = "applications_consultation"
|
|
34
37
|
}
|
|
35
|
-
export default function ({ config, 'core.infra.userData': userDataRepo, 'core.domain.permission': permissionDomain, 'core.infra.mailer.mailerService': mailerService, 'core.domain.globalSettings': globalSettingsDomain, 'core.utils': utils, translator }: IUserDomainDeps): IUserDomain;
|
|
38
|
+
export default function ({ config, 'core.domain.value': valueDomain, 'core.infra.userData': userDataRepo, 'core.domain.permission': permissionDomain, 'core.infra.mailer.mailerService': mailerService, 'core.domain.globalSettings': globalSettingsDomain, 'core.utils': utils, translator }: IUserDomainDeps): IUserDomain;
|
|
36
39
|
export {};
|
|
@@ -24,6 +24,7 @@ import { type IDeleteValueParams, type IRunActionListParams } from './_types';
|
|
|
24
24
|
import { type DeleteRecordHelper } from 'domain/record/helpers/deleteRecord';
|
|
25
25
|
import { type CreateRecordHelper } from 'domain/record/helpers/createRecord';
|
|
26
26
|
import { type IfLibraryJoinLinkAttribute } from '../attribute/helpers/ifLibraryJoinLinkAttribute';
|
|
27
|
+
import { type IRecordInCreationBypassHelper } from '../permission/helpers/recordInCreationBypass';
|
|
27
28
|
export interface ISaveBatchValueError {
|
|
28
29
|
type: string;
|
|
29
30
|
message: string;
|
|
@@ -87,11 +88,6 @@ export interface IValueDomain {
|
|
|
87
88
|
ctx: IQueryInfos;
|
|
88
89
|
}): Promise<IValue>;
|
|
89
90
|
runActionsList(params: IRunActionListParams): Promise<IValue[]>;
|
|
90
|
-
runActionsListAndFormatOnValue({ library, value, ctx }: {
|
|
91
|
-
library: string;
|
|
92
|
-
value: IValue;
|
|
93
|
-
ctx: IQueryInfos;
|
|
94
|
-
}): Promise<IValue[]>;
|
|
95
91
|
}
|
|
96
92
|
export interface IValueDomainDeps {
|
|
97
93
|
config: Config.IConfig;
|
|
@@ -107,6 +103,7 @@ export interface IValueDomainDeps {
|
|
|
107
103
|
'core.domain.record.helpers.sendRecordUpdateEvent': SendRecordUpdateEventHelper;
|
|
108
104
|
'core.domain.record.helpers.createRecord': CreateRecordHelper;
|
|
109
105
|
'core.domain.record.helpers.deleteRecord': DeleteRecordHelper;
|
|
106
|
+
'core.domain.permission.helpers.recordInCreationBypass': IRecordInCreationBypassHelper;
|
|
110
107
|
'core.domain.attribute.helpers.ifLibraryJoinLinkAttribute': IfLibraryJoinLinkAttribute;
|
|
111
108
|
'core.domain.versionProfile': IVersionProfileDomain;
|
|
112
109
|
'core.infra.record': IRecordRepo;
|
|
@@ -116,5 +113,5 @@ export interface IValueDomainDeps {
|
|
|
116
113
|
'core.utils.logger': ILogger;
|
|
117
114
|
'core.domain.tree': ITreeDomain;
|
|
118
115
|
}
|
|
119
|
-
declare const valueDomain: ({ config, "core.domain.actionsList": actionsListDomain, "core.domain.attribute": attributeDomain, "core.domain.permission.recordAttribute": recordAttributePermissionDomain, "core.domain.permission.record": recordPermissionDomain, "core.domain.eventsManager": eventsManager, "core.domain.helpers.validate": validate, "core.domain.helpers.updateRecordLastModif": updateRecordLastModif, "core.domain.tree.helpers.elementAncestors": elementAncestors, "core.domain.tree.helpers.getDefaultElement": getDefaultElementHelper, "core.domain.record.helpers.sendRecordUpdateEvent": sendRecordUpdateEvent, "core.domain.record.helpers.createRecord": createRecordHelper, "core.domain.record.helpers.deleteRecord": deleteRecordHelper, "core.domain.attribute.helpers.ifLibraryJoinLinkAttribute": ifLibraryJoinLinkAttribute, "core.domain.versionProfile": versionProfileDomain, "core.infra.record": recordRepo, "core.infra.tree": treeRepo, "core.infra.value": valueRepo, "core.utils": utils, "core.utils.logger": logger }: IValueDomainDeps) => IValueDomain;
|
|
116
|
+
declare const valueDomain: ({ config, "core.domain.actionsList": actionsListDomain, "core.domain.attribute": attributeDomain, "core.domain.permission.recordAttribute": recordAttributePermissionDomain, "core.domain.permission.record": recordPermissionDomain, "core.domain.eventsManager": eventsManager, "core.domain.helpers.validate": validate, "core.domain.helpers.updateRecordLastModif": updateRecordLastModif, "core.domain.tree.helpers.elementAncestors": elementAncestors, "core.domain.tree.helpers.getDefaultElement": getDefaultElementHelper, "core.domain.record.helpers.sendRecordUpdateEvent": sendRecordUpdateEvent, "core.domain.record.helpers.createRecord": createRecordHelper, "core.domain.permission.helpers.recordInCreationBypass": recordInCreationBypassHelper, "core.domain.record.helpers.deleteRecord": deleteRecordHelper, "core.domain.attribute.helpers.ifLibraryJoinLinkAttribute": ifLibraryJoinLinkAttribute, "core.domain.versionProfile": versionProfileDomain, "core.infra.record": recordRepo, "core.infra.tree": treeRepo, "core.infra.value": valueRepo, "core.utils": utils, "core.utils.logger": logger }: IValueDomainDeps) => IValueDomain;
|
|
120
117
|
export default valueDomain;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
2
|
+
import { type IRedis } from './redis';
|
|
2
3
|
export interface IMemoizeParams<T> {
|
|
3
4
|
key: string;
|
|
4
5
|
func: () => Promise<T>;
|
|
@@ -21,13 +22,13 @@ export interface ICacheService {
|
|
|
21
22
|
deleteData(keys: string[], path?: string): Promise<void>;
|
|
22
23
|
deleteAll(path?: string): Promise<void>;
|
|
23
24
|
}
|
|
24
|
-
interface
|
|
25
|
-
'core.infra.
|
|
25
|
+
interface ICacheServiceDeps {
|
|
26
|
+
'core.infra.redis': IRedis;
|
|
26
27
|
'core.infra.cache.diskService': ICacheService;
|
|
27
28
|
}
|
|
28
29
|
export declare enum ECacheType {
|
|
29
30
|
DISK = "DISK",
|
|
30
31
|
RAM = "RAM"
|
|
31
32
|
}
|
|
32
|
-
export default function ({ 'core.infra.
|
|
33
|
+
export default function ({ 'core.infra.redis': redis, 'core.infra.cache.diskService': diskService }: ICacheServiceDeps): ICachesService;
|
|
33
34
|
export {};
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { type IConfig } from '_types/config';
|
|
2
1
|
import { type ICacheService } from './cacheService';
|
|
3
2
|
import { type RedisClientType } from './redis';
|
|
4
|
-
|
|
5
|
-
config?: IConfig;
|
|
6
|
-
'core.infra.redis'?: RedisClientType;
|
|
7
|
-
}
|
|
8
|
-
export default function ({ config, 'core.infra.redis': redis }: IDeps): ICacheService;
|
|
9
|
-
export {};
|
|
3
|
+
export default function (redisClient: RedisClientType): ICacheService;
|
|
@@ -4,5 +4,9 @@ interface IDeps {
|
|
|
4
4
|
config?: IConfig;
|
|
5
5
|
}
|
|
6
6
|
export type RedisClientType = ReturnType<typeof redis.createClient>;
|
|
7
|
-
export
|
|
7
|
+
export interface IRedis {
|
|
8
|
+
cache: RedisClientType;
|
|
9
|
+
session: RedisClientType;
|
|
10
|
+
}
|
|
11
|
+
export declare function initRedis({ config }: IDeps): Promise<IRedis>;
|
|
8
12
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Client, type estypes } from '@elastic/elasticsearch';
|
|
2
2
|
import { type IConfig } from '_types/config';
|
|
3
|
-
import { type
|
|
3
|
+
import { type Log } from '@leav/utils';
|
|
4
4
|
export interface IElasticsearchServiceSearchResponse<T> {
|
|
5
5
|
total: number;
|
|
6
6
|
hits: T[];
|
|
@@ -15,13 +15,14 @@ interface IElasticsearchServiceSearchParams {
|
|
|
15
15
|
};
|
|
16
16
|
query?: estypes.QueryDslQueryContainer;
|
|
17
17
|
}
|
|
18
|
-
export interface
|
|
18
|
+
export interface IElasticsearchService {
|
|
19
19
|
client: Client;
|
|
20
|
-
search: <T>(params: IElasticsearchServiceSearchParams
|
|
20
|
+
search: <T>(params: IElasticsearchServiceSearchParams) => Promise<IElasticsearchServiceSearchResponse<T>>;
|
|
21
|
+
writeData: (indexName: string, data: Log) => Promise<void>;
|
|
21
22
|
}
|
|
22
|
-
interface
|
|
23
|
-
'core.infra.
|
|
23
|
+
export interface IElasticsearchServiceDeps {
|
|
24
|
+
'core.infra.elasticsearch.client'?: Client;
|
|
24
25
|
config?: IConfig;
|
|
25
26
|
}
|
|
26
|
-
export default function ({ config }:
|
|
27
|
+
export default function ({ config }: IElasticsearchServiceDeps): IElasticsearchService;
|
|
27
28
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as service } from './elasticsearchService';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IElasticsearchService } from 'infra/elasticsearch/elasticsearchService';
|
|
2
2
|
import { type IConfig } from '_types/config';
|
|
3
3
|
import { type ILogFilters, type ILogPagination, type ILogResponse, type ILogSort } from '_types/log';
|
|
4
4
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
@@ -10,8 +10,8 @@ export interface ILogRepo {
|
|
|
10
10
|
}, ctx: IQueryInfos): Promise<ILogResponse>;
|
|
11
11
|
}
|
|
12
12
|
interface IDeps {
|
|
13
|
-
'core.infra.
|
|
13
|
+
'core.infra.elasticsearch.service'?: IElasticsearchService;
|
|
14
14
|
config?: IConfig;
|
|
15
15
|
}
|
|
16
|
-
export default function ({ 'core.infra.
|
|
16
|
+
export default function ({ 'core.infra.elasticsearch.service': esService, config }: IDeps): ILogRepo;
|
|
17
17
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type OidcClient } from './oidcClient';
|
|
2
2
|
import { TokenSet } from 'openid-client';
|
|
3
|
-
import { type ICachesService } from '../cache/cacheService';
|
|
4
3
|
import { type IConfig } from '../../_types/config';
|
|
4
|
+
import { type ISessionRepo } from '../session/sessionRepo';
|
|
5
5
|
export interface IOIDCClientService {
|
|
6
6
|
oidcClient?: OidcClient;
|
|
7
7
|
getTokensFromCodes: (params: {
|
|
@@ -30,8 +30,8 @@ export interface IOIDCClientService {
|
|
|
30
30
|
}
|
|
31
31
|
interface IDeps {
|
|
32
32
|
'core.infra.oidcClient'?: OidcClient;
|
|
33
|
-
'core.infra.cache.cacheService'?: ICachesService;
|
|
34
33
|
config?: IConfig;
|
|
34
|
+
'core.infra.session'?: ISessionRepo;
|
|
35
35
|
}
|
|
36
|
-
export default function ({ 'core.infra.oidcClient': oidcClient, 'core.infra.
|
|
36
|
+
export default function ({ 'core.infra.oidcClient': oidcClient, 'core.infra.session': sessionRepo, config }?: IDeps): IOIDCClientService;
|
|
37
37
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './sessionRepo';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ICacheService } from '../cache/cacheService';
|
|
2
|
+
import { type IRedis } from '../cache/redis';
|
|
3
|
+
export type ISessionRepo = ICacheService;
|
|
4
|
+
interface ISessionRepoDeps {
|
|
5
|
+
'core.infra.redis'?: IRedis;
|
|
6
|
+
}
|
|
7
|
+
export default function ({ 'core.infra.redis': redis }: ISessionRepoDeps): ISessionRepo;
|
|
8
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as cli } from './cli';
|
|
2
2
|
export { default as filesManager } from './filesManager';
|
|
3
3
|
export { default as indexationManager } from './indexationManager';
|
|
4
|
+
export { default as logsCollector } from './logsCollector';
|
|
4
5
|
export { default as tasksManager } from './tasksManager';
|
|
5
6
|
export { default as server } from './server';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ILogsCollectorApp } from 'app/core/logsCollectorApp';
|
|
2
|
+
export interface ILogsCollectorInterface {
|
|
3
|
+
init(): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
interface IDeps {
|
|
6
|
+
'core.app.core.logsCollector': ILogsCollectorApp;
|
|
7
|
+
}
|
|
8
|
+
export default function ({ 'core.app.core.logsCollector': logsCollector }: IDeps): ILogsCollectorInterface;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface ICallerInfo {
|
|
2
|
+
path: string;
|
|
3
|
+
line: string;
|
|
4
|
+
col: string;
|
|
5
|
+
}
|
|
6
|
+
export declare class LoggerCallStack {
|
|
7
|
+
private callerLineIndexInStack;
|
|
8
|
+
getCallStackTrace(): string | null;
|
|
9
|
+
getLocationInfo(): ICallerInfo | null;
|
|
10
|
+
private getStackLines;
|
|
11
|
+
private detectCallLineIndexInStack;
|
|
12
|
+
private callStackTraceLongEnough;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -3,7 +3,7 @@ export interface ILoggerConfig {
|
|
|
3
3
|
* Log level (error, warn, info, log, verbose, debug, silly)
|
|
4
4
|
* @default info
|
|
5
5
|
*/
|
|
6
|
-
level
|
|
6
|
+
level?: string;
|
|
7
7
|
/**
|
|
8
8
|
* If true, disable all logging
|
|
9
9
|
* Default: true if TS_JEST=1 (tests), false otherwise
|
|
@@ -18,7 +18,36 @@ export interface ILoggerConfig {
|
|
|
18
18
|
* Default: false (plain text)
|
|
19
19
|
*/
|
|
20
20
|
useJsonFormat?: boolean;
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* If true, add timestamp to each log line, ISO format
|
|
23
|
+
*/
|
|
24
|
+
addTimestamp?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* If true, add file and line number of the code that called the logger function (error, warn, info, debug, etc.)
|
|
27
|
+
*/
|
|
28
|
+
addLocationInfo?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Add those metadata to all logs
|
|
31
|
+
*/
|
|
32
|
+
additionalMeta?: {
|
|
33
|
+
/**
|
|
34
|
+
* any string to identify the application those logs came from
|
|
35
|
+
*/
|
|
36
|
+
app?: string;
|
|
37
|
+
/**
|
|
38
|
+
* any string to identify each client those logs came from
|
|
39
|
+
*/
|
|
40
|
+
client?: string;
|
|
41
|
+
/**
|
|
42
|
+
* environment, like production, development, test, integration
|
|
43
|
+
*/
|
|
44
|
+
env?: string;
|
|
45
|
+
/**
|
|
46
|
+
* application version, maybe semver format
|
|
47
|
+
*/
|
|
48
|
+
version?: string;
|
|
49
|
+
};
|
|
50
|
+
onErrorLog?: (message: string, meta: any, getCallStackTrace: () => string) => void;
|
|
22
51
|
}
|
|
23
52
|
export declare function envToBool(value: string, defaultValue?: boolean): boolean;
|
|
24
|
-
export declare const defaultLoggerConfig: ILoggerConfig
|
|
53
|
+
export declare const defaultLoggerConfig: ILoggerConfig & Required<Omit<ILoggerConfig, 'onErrorLog'>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import winston from 'winston';
|
|
2
2
|
import { type ILoggerConfig } from './config';
|
|
3
3
|
export type ILogger = Pick<typeof winston, 'error' | 'warn' | 'info' | 'log' | 'verbose' | 'debug' | 'silly'>;
|
|
4
4
|
export declare function configureLogger(config: ILoggerConfig): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as amqp from 'amqplib';
|
|
2
|
-
import { type IAmqp, type
|
|
2
|
+
import { type IAmqp, type OnMessageFunc } from './types/amqp';
|
|
3
3
|
export interface IAmqpService {
|
|
4
4
|
publisher: {
|
|
5
5
|
connection: amqp.ChannelModel;
|
|
@@ -10,7 +10,7 @@ export interface IAmqpService {
|
|
|
10
10
|
channel: amqp.ConfirmChannel;
|
|
11
11
|
};
|
|
12
12
|
publish(exchange: string, routingKey: string, msg: string, priority?: number): Promise<void>;
|
|
13
|
-
consume(queue: string, routingKey: string, onMessage:
|
|
13
|
+
consume(queue: string, routingKey: string, onMessage: OnMessageFunc, consumerTag?: string): Promise<amqp.Replies.Consume>;
|
|
14
14
|
close(): Promise<void>;
|
|
15
15
|
}
|
|
16
16
|
interface IDeps {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aristid/leav-types",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1-088d7367",
|
|
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.
|
|
17
|
+
"@leav/utils": "1.4.1",
|
|
18
18
|
"@types/amqplib": "0.10.7",
|
|
19
19
|
"@types/express": "5.0.0",
|
|
20
20
|
"@types/jest": "29.5.14",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as service } from './elasticSearchService';
|
|
File without changes
|