@nomalism-com/types 1.3.25 → 1.3.28
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/dist/index.js +539 -525
- package/dist/modules/integration/emailTemplate/interfaces.d.ts +1 -4
- package/dist/modules/stock/chat/interfaces.d.ts +14 -23
- package/dist/modules/stock/file/interface.d.ts +2 -2
- package/dist/modules/stock/gmails/interface.d.ts +0 -2
- package/dist/modules/supply/documentHeader/interfaces.d.ts +3 -0
- package/dist/modules/supply/documentHeader/route.schema.d.ts +1 -0
- package/dist/modules/ui/portal/interface.d.ts +1 -1
- package/dist/modules/user/chatSubscribers/interfaces.d.ts +4 -7
- package/dist/modules/user/clients/interface.d.ts +0 -2
- package/dist/modules/user/commissioner/interface.d.ts +0 -2
- package/dist/modules/user/persona/interface.d.ts +0 -5
- package/dist/modules/user/providers/interface.d.ts +0 -2
- package/dist/shared/entities/integration.d.ts +3 -2
- package/dist/shared/entities/stock.d.ts +3 -4
- package/dist/shared/entities/user.d.ts +1 -7
- package/package.json +4 -4
|
@@ -14,15 +14,12 @@ export interface ICreateAttachments {
|
|
|
14
14
|
}
|
|
15
15
|
export interface ICreateRequest {
|
|
16
16
|
name: string;
|
|
17
|
-
to: string;
|
|
18
|
-
subject: string;
|
|
19
17
|
body: string;
|
|
20
18
|
attachments: ICreateAttachments[];
|
|
19
|
+
key: string;
|
|
21
20
|
}
|
|
22
21
|
export interface IUpdateRequest {
|
|
23
22
|
name?: string;
|
|
24
|
-
to?: string;
|
|
25
|
-
subject?: string;
|
|
26
23
|
body?: string;
|
|
27
24
|
}
|
|
28
25
|
export interface ISendRequest {
|
|
@@ -5,12 +5,6 @@ export type Entity = Chat;
|
|
|
5
5
|
export declare const Route = "chat";
|
|
6
6
|
export declare const UpperName = "Chat";
|
|
7
7
|
export declare const LowerName: string;
|
|
8
|
-
export declare const ChatTypeEnum: {
|
|
9
|
-
por_proposta: 'por_proposta';
|
|
10
|
-
global: 'global';
|
|
11
|
-
};
|
|
12
|
-
export type IChatType = (typeof ChatTypeEnum)[keyof typeof ChatTypeEnum];
|
|
13
|
-
export declare const chatTypes: string[];
|
|
14
8
|
export interface IChatBalloon {
|
|
15
9
|
chat?: Pick<Entity, 'message'> & {
|
|
16
10
|
id?: string;
|
|
@@ -28,14 +22,13 @@ export interface IChatBalloon {
|
|
|
28
22
|
ghost?: boolean;
|
|
29
23
|
}
|
|
30
24
|
export type IReport = Pick<Entity, 'email_processed' | 'email_delivered' | 'email_opened' | 'email_clicked'>;
|
|
31
|
-
export interface
|
|
32
|
-
last_group_report?: IReport;
|
|
33
|
-
owner_id: string;
|
|
25
|
+
export interface IFindActiveByOwnerIdResponse {
|
|
34
26
|
chat: IChatBalloon[];
|
|
27
|
+
last_group_report?: IReport;
|
|
35
28
|
}
|
|
36
29
|
export interface IPublicFindBySubscriberId {
|
|
37
30
|
owner_id: string;
|
|
38
|
-
|
|
31
|
+
chat_document_header_id: string;
|
|
39
32
|
chat: IChatBalloon[];
|
|
40
33
|
persona: ChatSubscriber.IFindChatSubscriberPersona;
|
|
41
34
|
store_operator_name: string;
|
|
@@ -43,22 +36,20 @@ export interface IPublicFindBySubscriberId {
|
|
|
43
36
|
}
|
|
44
37
|
export interface IPublicClientWebAppFindActiveByOwnerIdResponse {
|
|
45
38
|
owner_id: string;
|
|
46
|
-
chat_type: IChatType;
|
|
47
39
|
user_type: 'client' | 'provider';
|
|
48
40
|
chat: IChatBalloon[];
|
|
49
41
|
personas: ChatSubscriber.IFindChatSubscriberPersona[];
|
|
50
|
-
store_operator_name
|
|
51
|
-
document_total
|
|
42
|
+
store_operator_name: string;
|
|
43
|
+
document_total: number;
|
|
52
44
|
}
|
|
53
45
|
export interface ICreateRequest {
|
|
54
|
-
|
|
55
|
-
document_header_id: string;
|
|
46
|
+
chat_document_header_id: string;
|
|
56
47
|
message: string;
|
|
57
48
|
username: string;
|
|
58
49
|
is_customer: boolean;
|
|
59
50
|
}
|
|
60
51
|
export interface IUpdateRequest {
|
|
61
|
-
|
|
52
|
+
chat_document_header_id?: string;
|
|
62
53
|
message?: string;
|
|
63
54
|
email_processed?: boolean;
|
|
64
55
|
email_delivered?: boolean;
|
|
@@ -69,19 +60,19 @@ export interface IUpdateRequest {
|
|
|
69
60
|
username?: string;
|
|
70
61
|
}
|
|
71
62
|
export interface IMarkAllClientReadUnreadRequest {
|
|
72
|
-
|
|
63
|
+
chat_document_header_id: string;
|
|
73
64
|
client_read: boolean;
|
|
74
65
|
}
|
|
75
66
|
export interface IRepository {
|
|
76
|
-
findActiveByOwnerId(params: IShared.
|
|
77
|
-
clientWebAppFindActiveByOwnerId(params: IShared.
|
|
78
|
-
findActiveBySubscriberId(params: IShared.
|
|
79
|
-
resendLast(params: IShared.
|
|
67
|
+
findActiveByOwnerId(params: IShared.IFindByIdRequest): Promise<IFindActiveByOwnerIdResponse>;
|
|
68
|
+
clientWebAppFindActiveByOwnerId(params: IShared.IFindByIdRequest): Promise<IPublicClientWebAppFindActiveByOwnerIdResponse>;
|
|
69
|
+
findActiveBySubscriberId(params: IShared.IFindByIdRequest): Promise<IPublicFindBySubscriberId>;
|
|
70
|
+
resendLast(params: IShared.IFindByIdRequest): Promise<void>;
|
|
80
71
|
create(data: ICreateRequest): Promise<Chat>;
|
|
81
72
|
update(selector: IShared.IFindByIdRequest, data: IUpdateRequest): Promise<void>;
|
|
82
73
|
deleteOne(selector: IShared.IFindByIdRequest): Promise<void>;
|
|
83
|
-
markAllAsRead(params: IShared.
|
|
84
|
-
markAllAsUnread(params: IShared.
|
|
74
|
+
markAllAsRead(params: IShared.IFindByIdRequest): Promise<void>;
|
|
75
|
+
markAllAsUnread(params: IShared.IFindByIdRequest): Promise<void>;
|
|
85
76
|
publicMarkAllClientReadUnread(params: IMarkAllClientReadUnreadRequest): Promise<void>;
|
|
86
77
|
}
|
|
87
78
|
export type IController = IShared.IEntityWithUserToken<IRepository>;
|
|
@@ -12,7 +12,7 @@ export interface IFindByOwnerRequest {
|
|
|
12
12
|
export interface ICreateRequest {
|
|
13
13
|
title: string;
|
|
14
14
|
owner_id: string;
|
|
15
|
-
|
|
15
|
+
chat_document_header_id: string | null;
|
|
16
16
|
multimedia_id: string;
|
|
17
17
|
filename: string;
|
|
18
18
|
is_customer?: boolean;
|
|
@@ -21,7 +21,7 @@ export interface ICreateRequest {
|
|
|
21
21
|
username: string;
|
|
22
22
|
}
|
|
23
23
|
export interface IUpdateRequest {
|
|
24
|
-
|
|
24
|
+
chat_document_header_id?: string;
|
|
25
25
|
filename?: string;
|
|
26
26
|
}
|
|
27
27
|
export interface IRepository {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as IShared from '../../../shared/interface';
|
|
2
2
|
import { Gmails } from '../../../shared/entities/stock';
|
|
3
|
-
import { IChatType } from '../chat/interfaces';
|
|
4
3
|
export type Entity = Gmails;
|
|
5
4
|
export declare const Route = "gmail";
|
|
6
5
|
export declare const UpperName = "Gmail";
|
|
@@ -18,7 +17,6 @@ export interface IGmailsResponse {
|
|
|
18
17
|
proposals: number[];
|
|
19
18
|
done: Date | null;
|
|
20
19
|
chat_persona_name: string | null;
|
|
21
|
-
chat_type: IChatType | null;
|
|
22
20
|
text_to_chat: string | null;
|
|
23
21
|
proposal_url: string | null;
|
|
24
22
|
gmail_attachments: unknown[] | null;
|
|
@@ -58,6 +58,7 @@ export interface ICreateRequest {
|
|
|
58
58
|
pdf_link?: string | null;
|
|
59
59
|
google_sheet_id?: string | null;
|
|
60
60
|
sent?: boolean;
|
|
61
|
+
chat_document_header_id?: string;
|
|
61
62
|
owner_id: string;
|
|
62
63
|
owner_number: number;
|
|
63
64
|
owner_name: string;
|
|
@@ -135,6 +136,7 @@ export interface IUpdateRequest {
|
|
|
135
136
|
google_sheet_id?: string | null;
|
|
136
137
|
pdf_link?: string | null;
|
|
137
138
|
sent?: boolean;
|
|
139
|
+
chat_document_header_id?: string;
|
|
138
140
|
owner_id?: string;
|
|
139
141
|
owner_number?: number;
|
|
140
142
|
owner_name?: string;
|
|
@@ -199,6 +201,7 @@ export interface ITransferOwnershipRequest {
|
|
|
199
201
|
client_id: string;
|
|
200
202
|
}
|
|
201
203
|
export interface IFindResponse {
|
|
204
|
+
chat_document_header_id: string;
|
|
202
205
|
document_header_id: string;
|
|
203
206
|
document_label: string;
|
|
204
207
|
total: number;
|
|
@@ -12,3 +12,4 @@ export declare const sendClientNotificationBody: joi.ObjectSchema<any>;
|
|
|
12
12
|
export declare const findByTypeQuery: joi.ObjectSchema<any>;
|
|
13
13
|
export declare const documentPdfQuery: joi.ObjectSchema<any>;
|
|
14
14
|
export declare const documentLineQuery: joi.ObjectSchema<IShared.IRouteRequest<IDocumentListRequest>>;
|
|
15
|
+
export declare const createSiteProposalBody: joi.ObjectSchema<import("../../../shared/entities/integration").ProjectInfo>;
|
|
@@ -8,7 +8,7 @@ export interface IPublicFindByOwnerIdRequest {
|
|
|
8
8
|
include_closed?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export interface IPublicFindByOwnerIdResponse {
|
|
11
|
-
|
|
11
|
+
chat_document_header_id: string;
|
|
12
12
|
label: string;
|
|
13
13
|
emission_date: Date;
|
|
14
14
|
pdf_link: string;
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import { ChatSubscriber, Persona } from './../../../shared/entities/user';
|
|
2
2
|
import * as IShared from '../../../shared/interface';
|
|
3
|
-
import { IChatType } from '../../stock/chat/interfaces';
|
|
4
3
|
export type Entity = ChatSubscriber;
|
|
5
4
|
export declare const Route = "chat_subscriber";
|
|
6
5
|
export declare const UpperName = "ChatSubscriber";
|
|
7
6
|
export declare const LowerName: string;
|
|
8
7
|
export interface ICreateOrUpdateRequest {
|
|
9
|
-
|
|
10
|
-
document_header_id: string;
|
|
8
|
+
chat_document_header_id: string;
|
|
11
9
|
personas_ids: string[];
|
|
12
10
|
}
|
|
13
11
|
export interface IFindRequest {
|
|
14
12
|
owner_id: string;
|
|
15
|
-
|
|
13
|
+
chat_document_header_id: string;
|
|
16
14
|
}
|
|
17
|
-
export type IFindByOwnerResponse = Pick<Persona, 'external' | 'name' | 'email' | 'telephone'> & Pick<ChatSubscriber, 'id' | 'persona_id' | '
|
|
15
|
+
export type IFindByOwnerResponse = Pick<Persona, 'external' | 'name' | 'email' | 'telephone'> & Pick<ChatSubscriber, 'id' | 'persona_id' | 'chat_document_header_id'>;
|
|
18
16
|
export interface IFindByIdResponse extends IFindByOwnerResponse {
|
|
19
17
|
subscriptions: {
|
|
20
18
|
id: string;
|
|
21
|
-
|
|
19
|
+
chat_document_header_id: string;
|
|
22
20
|
}[];
|
|
23
21
|
}
|
|
24
22
|
export interface IFindChatSubscriberPersona extends Pick<Persona, 'id' | 'external' | 'name' | 'email' | 'telephone'> {
|
|
@@ -26,7 +24,6 @@ export interface IFindChatSubscriberPersona extends Pick<Persona, 'id' | 'extern
|
|
|
26
24
|
}
|
|
27
25
|
export interface IFindChatSubscriberResponse {
|
|
28
26
|
personas: IFindChatSubscriberPersona[];
|
|
29
|
-
chat_type: IChatType;
|
|
30
27
|
}
|
|
31
28
|
export interface IRepository {
|
|
32
29
|
createOrUpdate(data: ICreateOrUpdateRequest): Promise<string>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as IShared from '../../../shared/interface';
|
|
2
2
|
import { Clients, Users, Country, ReasonForExemption, ClientType, SegmentsArea, Language, Vehicles, DeliveryMethods, MaturityDates, PaymentMethods, Persona } from '../../../shared/entities/user';
|
|
3
|
-
import type { IChatType } from '../../stock/chat/interfaces';
|
|
4
3
|
export type Entity = Clients;
|
|
5
4
|
export declare const Route = "client";
|
|
6
5
|
export declare const UpperName = "Clients";
|
|
@@ -54,7 +53,6 @@ export interface ICreateRequest {
|
|
|
54
53
|
default_vehicle_id?: string | null;
|
|
55
54
|
}
|
|
56
55
|
export interface IUpdateRequest {
|
|
57
|
-
chat_type?: IChatType;
|
|
58
56
|
nif?: string | null;
|
|
59
57
|
country_id?: string | null;
|
|
60
58
|
language_id?: string | null;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as IShared from '../../../shared/interface';
|
|
2
2
|
import { type Commissioner, type Users, type Country, type Language, type PaymentMethods, type DeliveryMethods, type MaturityDates, type Vehicles, type Persona, type ReasonForExemption } from '../../../shared/entities/user';
|
|
3
|
-
import type { IChatType } from '../../stock/chat/interfaces';
|
|
4
3
|
export type Entity = Commissioner;
|
|
5
4
|
export declare const Route = "commissioner";
|
|
6
5
|
export declare const UpperName = "Commissioner";
|
|
@@ -39,7 +38,6 @@ export interface ICreateRequest {
|
|
|
39
38
|
default_vehicle_id?: string | null;
|
|
40
39
|
}
|
|
41
40
|
export interface IUpdateRequest {
|
|
42
|
-
chat_type?: IChatType;
|
|
43
41
|
default_percentage?: number;
|
|
44
42
|
main_persona_id?: string;
|
|
45
43
|
contact_persona_id?: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type * as IShared from '../../../shared/interface';
|
|
2
2
|
import type { Persona, Country, ReasonForExemption } from '../../../shared/entities/user';
|
|
3
|
-
import type { IChatType } from '../../stock/chat/interfaces';
|
|
4
3
|
export type Entity = Persona;
|
|
5
4
|
export declare const Route = "persona";
|
|
6
5
|
export declare const UpperName = "Persona";
|
|
@@ -85,17 +84,14 @@ export interface IFindByEmailResponse {
|
|
|
85
84
|
client?: {
|
|
86
85
|
id: string;
|
|
87
86
|
name: string;
|
|
88
|
-
chat_type: IChatType;
|
|
89
87
|
} | null;
|
|
90
88
|
provider?: {
|
|
91
89
|
id: string;
|
|
92
90
|
name: string;
|
|
93
|
-
chat_type: IChatType;
|
|
94
91
|
} | null;
|
|
95
92
|
commissioner?: {
|
|
96
93
|
id: string;
|
|
97
94
|
name: string;
|
|
98
|
-
chat_type: IChatType;
|
|
99
95
|
} | null;
|
|
100
96
|
}
|
|
101
97
|
export interface IFindClientOrProviderRequest {
|
|
@@ -118,7 +114,6 @@ export interface IFindForGmailRequest {
|
|
|
118
114
|
}
|
|
119
115
|
export interface IFindForGmailResponse {
|
|
120
116
|
chat_persona_name: string;
|
|
121
|
-
chat_type: IChatType;
|
|
122
117
|
}
|
|
123
118
|
export interface IRepository {
|
|
124
119
|
findById(selector: IShared.IFindByIdRequest): Promise<IEntityExtended | null>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as IShared from '../../../shared/interface';
|
|
2
2
|
import { Providers, Users, Country, ReasonForExemption, Language, ProviderType, PaymentMethods, MaturityDates, DeliveryMethods, Vehicles, Persona } from '../../../shared/entities/user';
|
|
3
|
-
import type { IChatType } from '../../stock/chat/interfaces';
|
|
4
3
|
import type { DocumentHeader } from '../../../shared/entities/stock';
|
|
5
4
|
export type Entity = Providers;
|
|
6
5
|
export declare const Route = "provider";
|
|
@@ -53,7 +52,6 @@ export interface ICreateRequest {
|
|
|
53
52
|
personas?: ICreateMainPersona[];
|
|
54
53
|
}
|
|
55
54
|
export interface IUpdateRequest {
|
|
56
|
-
chat_type?: IChatType;
|
|
57
55
|
manufacturer?: boolean;
|
|
58
56
|
inactive?: boolean;
|
|
59
57
|
default_discount?: number;
|
|
@@ -95,9 +95,10 @@ export type EmailLog = {
|
|
|
95
95
|
export type EmailTemplate = {
|
|
96
96
|
id: string;
|
|
97
97
|
name: string;
|
|
98
|
-
to: string;
|
|
99
|
-
subject: string;
|
|
100
98
|
body: string;
|
|
99
|
+
key: string;
|
|
100
|
+
rapid: boolean;
|
|
101
|
+
variables: unknown;
|
|
101
102
|
created_by: string;
|
|
102
103
|
updated_by: string;
|
|
103
104
|
created_at: Date;
|
|
@@ -29,8 +29,7 @@ export type AccountCode = {
|
|
|
29
29
|
*/
|
|
30
30
|
export type Chat = {
|
|
31
31
|
id: string;
|
|
32
|
-
|
|
33
|
-
document_header_id: string;
|
|
32
|
+
chat_document_header_id: string;
|
|
34
33
|
message: string;
|
|
35
34
|
email_processed: boolean;
|
|
36
35
|
email_delivered: boolean;
|
|
@@ -272,6 +271,7 @@ export type DocumentHeader = {
|
|
|
272
271
|
google_sheet_id: string | null;
|
|
273
272
|
emission_date: Date;
|
|
274
273
|
source_billing: string;
|
|
274
|
+
chat_document_header_id: string;
|
|
275
275
|
owner_id: string;
|
|
276
276
|
owner_number: number;
|
|
277
277
|
owner_name: string | null;
|
|
@@ -727,7 +727,7 @@ export type File = {
|
|
|
727
727
|
id: string;
|
|
728
728
|
title: string;
|
|
729
729
|
owner_id: string;
|
|
730
|
-
|
|
730
|
+
chat_document_header_id: string | null;
|
|
731
731
|
multimedia_id: string;
|
|
732
732
|
filename: string;
|
|
733
733
|
is_customer: boolean;
|
|
@@ -1029,7 +1029,6 @@ export type Gmails = {
|
|
|
1029
1029
|
owner_id: string | null;
|
|
1030
1030
|
document_header_id: string | null;
|
|
1031
1031
|
chat_persona_name: string | null;
|
|
1032
|
-
chat_type: string | null;
|
|
1033
1032
|
action: string | null;
|
|
1034
1033
|
text_to_chat: string | null;
|
|
1035
1034
|
done: Date | null;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IPaymentMethodsSaftCodeEnum } from '../../modules/user/paymentMethods/interfaces';
|
|
2
|
-
import type { IChatType } from '../../modules/stock/chat/interfaces';
|
|
3
2
|
/**
|
|
4
3
|
* Model Users
|
|
5
4
|
*
|
|
@@ -87,7 +86,6 @@ export type UserPermissions = {
|
|
|
87
86
|
*/
|
|
88
87
|
export type Providers = {
|
|
89
88
|
id: string;
|
|
90
|
-
chat_type: IChatType;
|
|
91
89
|
user_id: string;
|
|
92
90
|
main_persona_id: string;
|
|
93
91
|
contact_persona_id: string;
|
|
@@ -157,7 +155,6 @@ export type Language = {
|
|
|
157
155
|
export type Clients = {
|
|
158
156
|
id: string;
|
|
159
157
|
user_id: string;
|
|
160
|
-
chat_type: IChatType;
|
|
161
158
|
main_persona_id: string;
|
|
162
159
|
contact_persona_id: string;
|
|
163
160
|
number: number;
|
|
@@ -247,7 +244,6 @@ export type Shippings = {
|
|
|
247
244
|
export type Commissioner = {
|
|
248
245
|
id: string;
|
|
249
246
|
user_id: string;
|
|
250
|
-
chat_type: IChatType;
|
|
251
247
|
main_persona_id: string;
|
|
252
248
|
contact_persona_id: string;
|
|
253
249
|
number: number;
|
|
@@ -324,7 +320,6 @@ export type ReasonForExemption = {
|
|
|
324
320
|
export type StoreOperator = {
|
|
325
321
|
id: string;
|
|
326
322
|
user_id: string;
|
|
327
|
-
chat_type: IChatType;
|
|
328
323
|
user_position_id: string | null;
|
|
329
324
|
number: number;
|
|
330
325
|
internal_email: string | null;
|
|
@@ -503,8 +498,7 @@ export type Theme = {
|
|
|
503
498
|
export type ChatSubscriber = {
|
|
504
499
|
id: string;
|
|
505
500
|
persona_id: string;
|
|
506
|
-
|
|
507
|
-
document_header_id: string;
|
|
501
|
+
chat_document_header_id: string;
|
|
508
502
|
created_at: Date;
|
|
509
503
|
updated_at: Date;
|
|
510
504
|
created_by: 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": "1.3.
|
|
4
|
+
"version": "1.3.28",
|
|
5
5
|
"author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@swc/core": "^1.15.11",
|
|
30
|
-
"@types/node": "^24.10.
|
|
31
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
32
|
-
"@typescript-eslint/parser": "^8.
|
|
30
|
+
"@types/node": "^24.10.13",
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^8.55.0",
|
|
32
|
+
"@typescript-eslint/parser": "^8.55.0",
|
|
33
33
|
"eslint": "^9.39.2",
|
|
34
34
|
"eslint-config-prettier": "^10.1.8",
|
|
35
35
|
"eslint-import-resolver-typescript": "^4.4.4",
|