@nomalism-com/types 0.43.73 → 0.43.75

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.
@@ -32,12 +32,19 @@ export interface ISendRequest {
32
32
  html: string;
33
33
  attachments: IEmailAttachment[];
34
34
  }
35
+ export interface EmailPreviewRequest {
36
+ body: string;
37
+ }
38
+ export interface EmailPreviewResponse {
39
+ html: string;
40
+ }
35
41
  export interface IRepository {
36
42
  find(): Promise<IEntityExtended[]>;
37
43
  create(data: ICreateRequest): Promise<string>;
38
44
  update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
39
45
  deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
40
46
  send(data: ISendRequest): Promise<void>;
47
+ preview(selector: IShared.IFindByIdRequest, data: EmailPreviewRequest): Promise<EmailPreviewResponse>;
41
48
  }
42
49
  export type IController = IShared.IEntityWithUserToken<IRepository>;
43
50
  export type IApi = IRepository;
@@ -47,6 +47,11 @@ export interface IMarkAllClientReadUnreadRequest {
47
47
  chat_document_header_id: string;
48
48
  client_read: boolean;
49
49
  }
50
+ export interface ITranslateRequest {
51
+ chat_id: string;
52
+ target_language_id: string;
53
+ message: string;
54
+ }
50
55
  export interface IRepository {
51
56
  findByOwnerId(params: IShared.IFindByIdRequest): Promise<IFindActiveByOwnerIdResponse>;
52
57
  create(data: ICreateRequest): Promise<Chat>;
@@ -56,5 +61,6 @@ export interface IRepository {
56
61
  markAllAsUnread(params: IShared.IFindByIdRequest): Promise<void>;
57
62
  publicMarkAllClientReadUnread(params: IMarkAllClientReadUnreadRequest): Promise<void>;
58
63
  resendLast(params: IShared.IFindByIdRequest): Promise<void>;
64
+ translate(data: ITranslateRequest): Promise<string>;
59
65
  }
60
66
  export type IController = IShared.IEntityWithUserToken<IRepository>;
@@ -11,6 +11,7 @@ import type { File } from './entities/stock';
11
11
  import type { ProjectInfo } from './entities/integration';
12
12
  import type { IAttachment } from '../modules/supply/externalDocumentHeader/interface';
13
13
  import type { Persona } from './entities/user';
14
+ import type { ITranslateRequest } from '../modules/stock/chat/interfaces';
14
15
  export { messages };
15
16
  type CreatedAt = 'created_at';
16
17
  type UpdatedAt = 'updated_at';
@@ -295,11 +296,7 @@ export type IBrokerTopicPayload = {
295
296
  email_subject?: string;
296
297
  created_by: string;
297
298
  };
298
- [IBrokerTopic.translate_chat_message]: {
299
- chat_id: string;
300
- target_language_id: string;
301
- message: string;
302
- };
299
+ [IBrokerTopic.translate_chat_message]: ITranslateRequest;
303
300
  [IBrokerTopic.create_site_proposal]: ProjectInfo;
304
301
  [IBrokerTopic.verification_email]: {
305
302
  email: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nomalism-com/types",
3
3
  "description": "A nomalism package with all necessary types and validations for developing APIs",
4
- "version": "0.43.73",
4
+ "version": "0.43.75",
5
5
  "author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",