@aristid/leav-types 1.4.1-86f093d7 → 1.4.1-94f48449
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 +18 -3
- package/apps/core/config/test.d.ts +44 -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/_types/config.d.ts +19 -1
- package/apps/core/src/_types/eventsManager.d.ts +9 -1
- 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 +3 -3
- package/apps/core/src/app/core/index.d.ts +1 -0
- package/apps/core/src/app/core/notificationApp.d.ts +10 -0
- package/apps/core/src/domain/export/exportDomain.d.ts +3 -1
- 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/user/userDomain.d.ts +5 -2
- 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/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/package.json +1 -1
|
@@ -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 };
|
|
@@ -121,7 +122,8 @@ export declare namespace redis {
|
|
|
121
122
|
export { host_2 as host };
|
|
122
123
|
let port_3: string;
|
|
123
124
|
export { port_3 as port };
|
|
124
|
-
export let
|
|
125
|
+
export let cacheDatabase: number;
|
|
126
|
+
export let sessionDatabase: number;
|
|
125
127
|
}
|
|
126
128
|
export declare namespace filesManager {
|
|
127
129
|
namespace queues {
|
|
@@ -200,6 +202,19 @@ export declare namespace preview {
|
|
|
200
202
|
let directory_3: string;
|
|
201
203
|
export { directory_3 as directory };
|
|
202
204
|
}
|
|
205
|
+
export declare namespace notification {
|
|
206
|
+
let enable_3: boolean;
|
|
207
|
+
export { enable_3 as enable };
|
|
208
|
+
export namespace email_3 {
|
|
209
|
+
let enable_4: boolean;
|
|
210
|
+
export { enable_4 as enable };
|
|
211
|
+
}
|
|
212
|
+
export { email_3 as email };
|
|
213
|
+
export namespace webSocket {
|
|
214
|
+
let enable_5: boolean;
|
|
215
|
+
export { enable_5 as enable };
|
|
216
|
+
}
|
|
217
|
+
}
|
|
203
218
|
export declare namespace applications {
|
|
204
219
|
let rootFolder: string;
|
|
205
220
|
}
|
|
@@ -208,8 +223,8 @@ export declare namespace files {
|
|
|
208
223
|
let originalsPathPrefix: string;
|
|
209
224
|
}
|
|
210
225
|
export declare namespace dbProfiler {
|
|
211
|
-
let
|
|
212
|
-
export {
|
|
226
|
+
let enable_6: boolean;
|
|
227
|
+
export { enable_6 as enable };
|
|
213
228
|
}
|
|
214
229
|
export declare namespace elasticsearch {
|
|
215
230
|
export let indexPrefix: string;
|
|
@@ -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,64 @@ 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_1: string;
|
|
35
|
+
export { pubsub_events_1 as pubsub_events };
|
|
27
36
|
}
|
|
37
|
+
export { queues_1 as queues };
|
|
28
38
|
}
|
|
29
39
|
export namespace indexationManager {
|
|
30
|
-
export namespace
|
|
40
|
+
export namespace queues_2 {
|
|
31
41
|
let events_1: string;
|
|
32
42
|
export { events_1 as events };
|
|
33
43
|
}
|
|
34
|
-
export {
|
|
44
|
+
export { queues_2 as queues };
|
|
35
45
|
}
|
|
36
46
|
export namespace tasksManager {
|
|
37
|
-
export
|
|
38
|
-
|
|
47
|
+
export let checkingInterval: number;
|
|
48
|
+
export namespace queues_3 {
|
|
49
|
+
let execOrders: string;
|
|
50
|
+
let cancelOrders: string;
|
|
39
51
|
}
|
|
40
|
-
export {
|
|
52
|
+
export { queues_3 as queues };
|
|
41
53
|
export namespace routingKeys_1 {
|
|
42
|
-
let
|
|
43
|
-
export {
|
|
54
|
+
let execOrders_1: string;
|
|
55
|
+
export { execOrders_1 as execOrders };
|
|
56
|
+
let cancelOrders_1: string;
|
|
57
|
+
export { cancelOrders_1 as cancelOrders };
|
|
44
58
|
}
|
|
45
59
|
export { routingKeys_1 as routingKeys };
|
|
46
60
|
}
|
|
47
61
|
export namespace logs {
|
|
48
62
|
let transport: string;
|
|
49
63
|
}
|
|
64
|
+
export namespace notification {
|
|
65
|
+
export let enable: boolean;
|
|
66
|
+
export namespace email_2 {
|
|
67
|
+
let enable_1: boolean;
|
|
68
|
+
export { enable_1 as enable };
|
|
69
|
+
}
|
|
70
|
+
export { email_2 as email };
|
|
71
|
+
export namespace webSocket {
|
|
72
|
+
let enable_2: boolean;
|
|
73
|
+
export { enable_2 as enable };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export namespace mailer {
|
|
77
|
+
namespace from {
|
|
78
|
+
let name_1: string;
|
|
79
|
+
export { name_1 as name };
|
|
80
|
+
let email_3: string;
|
|
81
|
+
export { email_3 as email };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
50
84
|
export let debug: boolean;
|
|
51
85
|
export namespace redis {
|
|
52
|
-
let
|
|
86
|
+
let cacheDatabase: number;
|
|
87
|
+
let sessionDatabase: number;
|
|
53
88
|
}
|
|
54
89
|
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 {};
|
|
@@ -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;
|
|
@@ -97,7 +98,14 @@ export interface IAuth {
|
|
|
97
98
|
export interface IMailer {
|
|
98
99
|
host: string;
|
|
99
100
|
port: number;
|
|
101
|
+
/**
|
|
102
|
+
* If true, use SSL/TLS connection (usually port 465). If false, use STARTTLS (usually port 587)
|
|
103
|
+
*/
|
|
100
104
|
secure: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* If true, require TLS for the connection (STARTTLS). Only used if secure is false
|
|
107
|
+
*/
|
|
108
|
+
requireTLS: boolean;
|
|
101
109
|
from: {
|
|
102
110
|
name: string;
|
|
103
111
|
email: string;
|
|
@@ -124,7 +132,8 @@ export interface IAmqp {
|
|
|
124
132
|
export interface IRedis {
|
|
125
133
|
host: string;
|
|
126
134
|
port: number;
|
|
127
|
-
|
|
135
|
+
cacheDatabase: number;
|
|
136
|
+
sessionDatabase: number;
|
|
128
137
|
}
|
|
129
138
|
export interface IFilesManager {
|
|
130
139
|
queues: {
|
|
@@ -226,6 +235,15 @@ export interface IFilesConfig {
|
|
|
226
235
|
export interface IDbProfilerConfig {
|
|
227
236
|
enable: boolean;
|
|
228
237
|
}
|
|
238
|
+
export interface INotificationConfig {
|
|
239
|
+
enable: boolean;
|
|
240
|
+
email: {
|
|
241
|
+
enable: boolean;
|
|
242
|
+
};
|
|
243
|
+
webSocket: {
|
|
244
|
+
enable: boolean;
|
|
245
|
+
};
|
|
246
|
+
}
|
|
229
247
|
export interface IElasticsearchConfig {
|
|
230
248
|
indexPrefix: string;
|
|
231
249
|
url: string;
|
|
@@ -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
|
}
|
|
@@ -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';
|
|
@@ -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.
|
|
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;
|
|
@@ -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';
|
|
@@ -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,6 +11,7 @@ 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';
|
|
14
15
|
export interface IExportParams {
|
|
15
16
|
library: string;
|
|
16
17
|
attributes: string[];
|
|
@@ -39,8 +40,9 @@ export interface IExportDomainDeps {
|
|
|
39
40
|
'core.domain.helpers.validate': IValidateHelper;
|
|
40
41
|
'core.domain.helpers.updateTaskProgress': UpdateTaskProgress;
|
|
41
42
|
'core.domain.eventsManager': IEventsManagerDomain;
|
|
43
|
+
'core.domain.notification': INotificationDomain;
|
|
42
44
|
'core.utils': IUtils;
|
|
43
45
|
translator: i18n;
|
|
44
46
|
config: Config.IConfig;
|
|
45
47
|
}
|
|
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;
|
|
48
|
+
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.utils': utils, translator }: IExportDomainDeps): IExportDomain;
|
|
@@ -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;
|
|
@@ -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 {};
|
|
@@ -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
1
|
import { type ICacheService } from './cacheService';
|
|
2
2
|
import { type RedisClientType } from './redis';
|
|
3
|
-
|
|
4
|
-
interface IDeps {
|
|
5
|
-
config?: IConfig;
|
|
6
|
-
'core.infra.redis'?: RedisClientType;
|
|
7
|
-
}
|
|
8
|
-
export default function ({ 'core.infra.redis': redis, config }: 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,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 {};
|