@aristid/leav-types 1.6.0-a54099d3 → 1.6.0-b6b4e8fc

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.
@@ -11,7 +11,7 @@ export interface IGlobalThis {
11
11
  nonAdminUser: IE2EUserParams;
12
12
  nonAdminGroupId: string;
13
13
  }
14
- interface IE2EUser {
14
+ export interface IE2EUser {
15
15
  userId: string;
16
16
  getAuthToken: () => Promise<string>;
17
17
  }
@@ -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, { timeoutMs }: {
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 IMailpitMsgFull extends IMailpitMsgLight {
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: IMailpitMsgLight) => boolean): Promise<IMailpitMsgFull>;
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 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 IGraphqlAppModule, type IGraphqlApp } from '../../graphql/graphqlA
7
7
  import { type ICoreApp } from '../coreApp';
8
8
  import { type ICoreSubscriptionsHelpersApp } from '../helpers/subscriptions';
9
9
  import { type IRecordPermissionDomain } from '../../../domain/permission/recordPermissionDomain';
10
+ import { type IAttributeDependentValuesPermissionDomain } from 'domain/permission/attributeDependentValuesPermissionDomain';
10
11
  export type ITreeAttributeApp = IGraphqlAppModule;
11
12
  interface IDeps {
12
13
  'core.domain.tree': ITreeDomain;
@@ -18,6 +19,7 @@ interface IDeps {
18
19
  'core.app.core.subscriptionsHelper': ICoreSubscriptionsHelpersApp;
19
20
  'core.domain.library': ILibraryDomain;
20
21
  'core.domain.permission.record': IRecordPermissionDomain;
22
+ 'core.domain.permission.attributeDependentValues': IAttributeDependentValuesPermissionDomain;
21
23
  }
22
- export default function ({ 'core.domain.tree': treeDomain, 'core.domain.attribute': attributeDomain, 'core.domain.permission': permissionDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.app.core': coreApp, 'core.app.graphql': graphqlApp, 'core.app.core.subscriptionsHelper': subscriptionsHelper, 'core.domain.library': libraryDomain, 'core.domain.permission.record': recordPermissionDomain, }: IDeps): ITreeAttributeApp;
24
+ export default function ({ 'core.domain.tree': treeDomain, 'core.domain.attribute': attributeDomain, 'core.domain.permission': permissionDomain, 'core.domain.eventsManager': eventsManagerDomain, 'core.app.core': coreApp, 'core.app.graphql': graphqlApp, 'core.app.core.subscriptionsHelper': subscriptionsHelper, 'core.domain.library': libraryDomain, 'core.domain.permission.record': recordPermissionDomain, 'core.domain.permission.attributeDependentValues': attributeDependentValuesPermissionDomain, }: IDeps): ITreeAttributeApp;
23
25
  export {};
@@ -1,6 +1,5 @@
1
1
  import { type IRecordDomain } from 'domain/record/recordDomain';
2
2
  import { type IUtils } from 'utils/utils';
3
- import { type ILogger } from '@leav/logger';
4
3
  import { type IQueryInfos } from '_types/queryInfos';
5
4
  import { type IValue, type IValueVersion } from '_types/value';
6
5
  import { type IFormElement } from '../../../_types/forms';
@@ -12,7 +11,6 @@ export declare const getElementValues: (params: {
12
11
  deps: {
13
12
  "core.domain.record"?: IRecordDomain;
14
13
  "core.utils"?: IUtils;
15
- "core.utils.logger"?: ILogger;
16
14
  };
17
15
  ctx: IQueryInfos;
18
16
  }) => Promise<{
@@ -1,6 +1,7 @@
1
1
  import { type IAmqpService } from '@leav/message-broker';
2
2
  import { type AwilixContainer } from 'awilix';
3
3
  import { type IEventsManagerDomain } from 'domain/eventsManager/eventsManagerDomain';
4
+ import { type IAdminPermissionDomain } from 'domain/permission/adminPermissionDomain';
4
5
  import { type IUtils } from 'utils/utils';
5
6
  import { type ILogger } from '@leav/logger';
6
7
  import type * as Config from '_types/config';
@@ -62,9 +63,10 @@ export interface ITasksManagerDomainDeps {
62
63
  'core.infra.task': ITaskRepo;
63
64
  'core.depsManager': AwilixContainer;
64
65
  'core.domain.eventsManager': IEventsManagerDomain;
66
+ 'core.domain.permission.admin': IAdminPermissionDomain;
65
67
  'core.utils.logger': ILogger;
66
68
  'core.utils': IUtils;
67
69
  'core.utils.getSystemQueryContext': GetSystemQueryContext;
68
70
  }
69
- export default function ({ config, 'core.infra.amqpService': amqpService, 'core.infra.task': taskRepo, 'core.depsManager': depsManager, 'core.domain.eventsManager': eventsManager, 'core.utils.logger': logger, 'core.utils': utils, 'core.utils.getSystemQueryContext': getSystemQueryContext, }: ITasksManagerDomainDeps): ITasksManagerDomain;
71
+ export default function ({ config, 'core.infra.amqpService': amqpService, 'core.infra.task': taskRepo, 'core.depsManager': depsManager, 'core.domain.eventsManager': eventsManager, 'core.domain.permission.admin': adminPermissionDomain, 'core.utils.logger': logger, 'core.utils': utils, 'core.utils.getSystemQueryContext': getSystemQueryContext, }: ITasksManagerDomainDeps): ITasksManagerDomain;
70
72
  export {};
@@ -8,6 +8,7 @@ export interface IDeleteValueParams {
8
8
  recordId: string;
9
9
  attribute: string;
10
10
  value?: IValue;
11
+ skipReadonly?: boolean;
11
12
  ctx: IQueryInfos;
12
13
  }
13
14
  export interface IRunActionListParams {
@@ -65,6 +65,7 @@ export interface IValueDomain {
65
65
  recordId: string;
66
66
  attribute: string;
67
67
  value: ISaveValue;
68
+ skipReadonly?: boolean;
68
69
  ctx: IQueryInfos;
69
70
  }): Promise<IValue[]>;
70
71
  /**
@@ -80,6 +81,7 @@ export interface IValueDomain {
80
81
  ctx: IQueryInfos;
81
82
  keepEmpty?: boolean;
82
83
  skipPermission?: boolean;
84
+ skipReadonly?: boolean;
83
85
  }): Promise<ISaveBatchValueResult>;
84
86
  deleteValue(params: IDeleteValueParams): Promise<IValue[]>;
85
87
  formatValue(params: {
@@ -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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aristid/leav-types",
3
- "version": "1.6.0-a54099d3",
3
+ "version": "1.6.0-b6b4e8fc",
4
4
  "description": "Shared Leav types",
5
5
  "scripts": {
6
6
  "tscheck": "",