@aristid/leav-types 1.6.0-c9256047 → 1.6.0-cc2c0b43
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/src/__tests__/e2e/api/e2eUtils.d.ts +1 -1
- package/apps/core/src/__tests__/e2e/api/mailpitUtils.d.ts +9 -2
- package/apps/core/src/__tests__/e2e/api/notificationUtils.d.ts +5 -0
- package/apps/core/src/__tests__/e2e/api/task/taskSubscription.test.d.ts +1 -0
- package/apps/core/src/_constants/notifications.d.ts +1 -0
- package/apps/core/src/_types/notification.d.ts +5 -0
- package/apps/core/src/app/core/tasksManagerApp.d.ts +3 -1
- package/apps/core/src/infra/mailer/mailerService.d.ts +2 -1
- package/package.json +1 -1
|
@@ -78,7 +78,7 @@ export declare function makeWebSocketGraphQlCall(options?: {
|
|
|
78
78
|
export declare function waitGraphqlWebSocketMessage<T>(client: GraphqlWsClient, query: string, variables: Record<string, any>, acceptMessage: (msg: T) => boolean, { timeoutMs }: {
|
|
79
79
|
timeoutMs: any;
|
|
80
80
|
}): Promise<T>;
|
|
81
|
-
export declare function waitWebSocketMessage<T>(webSocket: WebSocket, acceptMessage: (msg: T) => boolean
|
|
81
|
+
export declare function waitWebSocketMessage<T>(webSocket: WebSocket, acceptMessage: (msg: T) => Promise<boolean>, { timeoutMs }: {
|
|
82
82
|
timeoutMs: any;
|
|
83
83
|
}): Promise<T>;
|
|
84
84
|
export {};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
interface IMailpitMsgHeaders {
|
|
2
|
+
[key: string]: string[];
|
|
3
|
+
}
|
|
1
4
|
interface IMailpitMsgLight {
|
|
2
5
|
From: {
|
|
3
6
|
Name: string;
|
|
@@ -13,7 +16,10 @@ interface IMailpitMsgLight {
|
|
|
13
16
|
Address: string;
|
|
14
17
|
}>;
|
|
15
18
|
}
|
|
16
|
-
interface
|
|
19
|
+
interface IMailpitMsgLightWithHeaders extends IMailpitMsgLight {
|
|
20
|
+
Headers: IMailpitMsgHeaders;
|
|
21
|
+
}
|
|
22
|
+
export interface IMailpitMsgFull extends IMailpitMsgLight {
|
|
17
23
|
HTML: string;
|
|
18
24
|
Text: string;
|
|
19
25
|
}
|
|
@@ -22,7 +28,8 @@ interface IMailpitSearchResult {
|
|
|
22
28
|
total: number;
|
|
23
29
|
unread: number;
|
|
24
30
|
}
|
|
25
|
-
export declare function waitMailpitMessage(acceptMessage: (msg:
|
|
31
|
+
export declare function waitMailpitMessage(acceptMessage: (msg: IMailpitMsgLightWithHeaders) => boolean): Promise<IMailpitMsgFull>;
|
|
32
|
+
export declare function getMailpitMessageHeaders(messageId: string): Promise<IMailpitMsgHeaders>;
|
|
26
33
|
export declare function getMailpitMessage(messageId: string): Promise<IMailpitMsgFull>;
|
|
27
34
|
export declare function deleteMailpitMessagesBySearch(search: string): Promise<void>;
|
|
28
35
|
export declare function searchMailpitMessages(search: string): Promise<IMailpitSearchResult>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type IPubSubNotificationData } from '_types/eventsManager';
|
|
2
|
+
import { type Client as GraphqlWsClient } from 'graphql-ws';
|
|
3
|
+
import { type IMailpitMsgFull } from './mailpitUtils';
|
|
4
|
+
export declare const waitWebSocketNotification: (graphqlClient: GraphqlWsClient, taskId: string) => Promise<Pick<IPubSubNotificationData, "notification">>;
|
|
5
|
+
export declare const waitEmailNotification: (taskId: string) => Promise<IMailpitMsgFull>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const NOTIFICATION_EMAIL_TASK_ID_HEADER = "X-Task-Id";
|
|
@@ -22,6 +22,11 @@ export interface INotificationContent {
|
|
|
22
22
|
url: string;
|
|
23
23
|
label: string;
|
|
24
24
|
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Optional task ID associated with the notification
|
|
27
|
+
* For email, will be added as a custom header (X-Task-Id)
|
|
28
|
+
*/
|
|
29
|
+
taskId?: string;
|
|
25
30
|
}
|
|
26
31
|
export interface ICreateNotification {
|
|
27
32
|
emitterUserId: string;
|
|
@@ -7,6 +7,7 @@ import { type IPaginationParams, type ISortParams } from '_types/list';
|
|
|
7
7
|
import { type ITasksManagerDomain } from '../../domain/tasksManager/tasksManagerDomain';
|
|
8
8
|
import { TaskStatus } from '../../_types/tasksManager';
|
|
9
9
|
import { type IGraphqlAppModule } from 'app/graphql/graphqlApp';
|
|
10
|
+
import { type IAdminPermissionDomain } from 'domain/permission/adminPermissionDomain';
|
|
10
11
|
export interface ITasksManagerApp extends IGraphqlAppModule {
|
|
11
12
|
initMaster(): Promise<NodeJS.Timeout>;
|
|
12
13
|
initWorker(): Promise<void>;
|
|
@@ -18,6 +19,7 @@ interface IDeps {
|
|
|
18
19
|
'core.utils'?: IUtils;
|
|
19
20
|
'core.domain.record'?: IRecordDomain;
|
|
20
21
|
'core.domain.eventsManager'?: IEventsManagerDomain;
|
|
22
|
+
'core.domain.permission.admin'?: IAdminPermissionDomain;
|
|
21
23
|
}
|
|
22
24
|
export interface IGetTasksArgs {
|
|
23
25
|
filters?: ICoreEntityFilterOptions & {
|
|
@@ -28,5 +30,5 @@ export interface IGetTasksArgs {
|
|
|
28
30
|
pagination?: IPaginationParams;
|
|
29
31
|
sort?: ISortParams;
|
|
30
32
|
}
|
|
31
|
-
export default function ({ 'core.domain.record': recordDomain, 'core.domain.tasksManager': tasksManagerDomain, 'core.domain.eventsManager': eventsManager, }: IDeps): ITasksManagerApp;
|
|
33
|
+
export default function ({ 'core.domain.record': recordDomain, 'core.domain.tasksManager': tasksManagerDomain, 'core.domain.eventsManager': eventsManager, 'core.domain.permission.admin': adminPermissionDomain, }: IDeps): ITasksManagerApp;
|
|
32
34
|
export {};
|
|
@@ -4,7 +4,7 @@ import { type IConfig } from '_types/config';
|
|
|
4
4
|
import { type IQueryInfos } from '_types/queryInfos';
|
|
5
5
|
export interface IMailerService {
|
|
6
6
|
mailer?: nodemailer.Transporter;
|
|
7
|
-
sendEmail?: ({ to, subject, text, html, attachments }: ISendMailParams, ctx: IQueryInfos) => Promise<void>;
|
|
7
|
+
sendEmail?: ({ to, subject, text, html, attachments, headers }: ISendMailParams, ctx: IQueryInfos) => Promise<void>;
|
|
8
8
|
}
|
|
9
9
|
interface IDeps {
|
|
10
10
|
config: IConfig;
|
|
@@ -21,6 +21,7 @@ interface ISendMailParams {
|
|
|
21
21
|
content?: string | Buffer;
|
|
22
22
|
path?: string;
|
|
23
23
|
}>;
|
|
24
|
+
headers?: Record<string, string>;
|
|
24
25
|
}
|
|
25
26
|
export default function ({ config, 'core.domain.globalSettings': globalSettingsDomain, 'core.infra.mailer': mailer, }: IDeps): IMailerService;
|
|
26
27
|
export {};
|