@nomalism-com/types 1.3.34 → 1.3.36
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 +843 -789
- package/dist/main.d.ts +6 -2
- package/dist/modules/document/order/interfaces.d.ts +9 -0
- package/dist/modules/integration/emailTemplate/interfaces.d.ts +7 -0
- package/dist/modules/integration/emailTemplate/route.schema.d.ts +2 -0
- package/dist/modules/llm/llm/interfaces.d.ts +9 -0
- package/dist/modules/llm/llm/route.schema.d.ts +2 -0
- package/dist/modules/stock/chat/interfaces.d.ts +10 -21
- package/dist/modules/stock/chat/route.schema.d.ts +2 -0
- package/dist/modules/stock/googleCalendar/interface.d.ts +8 -0
- package/dist/modules/supply/documentHeader/interfaces.d.ts +3 -0
- package/dist/modules/supply/documentHeaderSubscriber/interface.d.ts +19 -0
- package/dist/modules/supply/documentHeaderSubscriber/route.schema.d.ts +2 -0
- package/dist/modules/supply/documentHeaderSurvey/interfaces.d.ts +16 -0
- package/dist/modules/supply/documentHeaderSurvey/route.schema.d.ts +3 -0
- package/dist/modules/supply/documentLine/interfaces.d.ts +11 -24
- package/dist/modules/supply/documentLine/route.schema.d.ts +0 -1
- package/dist/modules/supply/documentLineAssoc/interfaces.d.ts +1 -18
- package/dist/modules/supply/documentLineMT/interface.d.ts +0 -1
- package/dist/modules/supply/documentLineRM/interface.d.ts +0 -1
- package/dist/modules/supply/externalDocumentHeader/interface.d.ts +3 -16
- package/dist/modules/supply/externalDocumentHeader/route.schema.d.ts +0 -3
- package/dist/modules/ui/portal/interface.d.ts +25 -14
- package/dist/modules/ui/portal/route.schema.d.ts +0 -1
- package/dist/modules/ui/sideMenu/interface.d.ts +1 -0
- package/dist/modules/user/chatSubscribers/interfaces.d.ts +13 -15
- package/dist/modules/user/chatSubscribers/route.schema.d.ts +2 -1
- package/dist/modules/user/language/interface.d.ts +3 -0
- package/dist/modules/user/persona/interface.d.ts +6 -0
- package/dist/modules/user/persona/route.schema.d.ts +1 -0
- package/dist/modules/user/providers/interface.d.ts +1 -1
- package/dist/modules/user/sessions/interface.d.ts +1 -0
- package/dist/modules/view/errorLog/interfaces.d.ts +4 -0
- package/dist/shared/entities/stock.d.ts +66 -11
- package/dist/shared/entities/user.d.ts +4 -3
- package/dist/shared/interface.d.ts +24 -14
- package/package.json +8 -8
- package/dist/modules/supply/documentLineAssoc/route.schema.d.ts +0 -3
|
@@ -71,7 +71,7 @@ export interface IUpdateRequest {
|
|
|
71
71
|
export interface IFindByNumberRequest {
|
|
72
72
|
number: number;
|
|
73
73
|
}
|
|
74
|
-
export interface IFindByNumberResponse extends Pick<DocumentHeader, 'owner_id' | 'owner_name' | 'billing_persona_id' | 'billing_persona_name' | 'billing_persona_nif' | 'billing_persona_email' | 'billing_persona_telephone' | 'billing_persona_address_street' | 'billing_persona_address_postal_code' | 'billing_persona_address_locality' | 'billing_persona_address_country_id' | 'billing_persona_address_country_name' | 'reason_for_exemption_id' | 'reason_for_exemption' | 'delivery_persona_id' | 'delivery_persona_name' | 'delivery_persona_email' | 'delivery_persona_telephone' | 'delivery_persona_address_street' | 'delivery_persona_address_postal_code' | 'delivery_persona_address_locality' | 'delivery_persona_address_country_id' | 'delivery_persona_address_country_name' | 'delivery_method_id' | 'delivery_method' | 'vehicle_id' | 'vehicle' | 'payment_method_id' | 'payment_method' | 'maturity_date_id' | 'maturity_date'> {
|
|
74
|
+
export interface IFindByNumberResponse extends Pick<DocumentHeader, 'owner_id' | 'owner_name' | 'billing_persona_id' | 'billing_persona_name' | 'billing_persona_nif' | 'billing_persona_email' | 'billing_persona_telephone' | 'billing_persona_address_street' | 'billing_persona_address_postal_code' | 'billing_persona_address_locality' | 'billing_persona_address_country_id' | 'billing_persona_address_country_name' | 'reason_for_exemption_id' | 'reason_for_exemption' | 'delivery_persona_id' | 'delivery_persona_name' | 'delivery_persona_email' | 'delivery_persona_telephone' | 'delivery_persona_address_street' | 'delivery_persona_address_postal_code' | 'delivery_persona_address_locality' | 'delivery_persona_address_country_id' | 'delivery_persona_address_country_name' | 'delivery_method_id' | 'delivery_method' | 'vehicle_id' | 'vehicle' | 'payment_method_id' | 'payment_method' | 'maturity_date_id' | 'maturity_date' | 'maturity_date_days'> {
|
|
75
75
|
default_discount: number;
|
|
76
76
|
}
|
|
77
77
|
export interface IRepository {
|
|
@@ -20,11 +20,15 @@ export interface ICreateRequest {
|
|
|
20
20
|
stack?: string;
|
|
21
21
|
};
|
|
22
22
|
request?: {
|
|
23
|
+
url: string;
|
|
23
24
|
body?: unknown;
|
|
24
25
|
query?: unknown;
|
|
25
26
|
params?: unknown;
|
|
26
27
|
};
|
|
27
28
|
}
|
|
29
|
+
export interface IController {
|
|
30
|
+
create(data: ICreateRequest): Promise<void>;
|
|
31
|
+
}
|
|
28
32
|
export interface IRepository {
|
|
29
33
|
create(data: ICreateRequest): Promise<void>;
|
|
30
34
|
}
|
|
@@ -39,6 +39,7 @@ export type Chat = {
|
|
|
39
39
|
client_read: boolean;
|
|
40
40
|
is_customer: boolean;
|
|
41
41
|
deleted: boolean;
|
|
42
|
+
lang: string | null;
|
|
42
43
|
created_by: string;
|
|
43
44
|
updated_by: string;
|
|
44
45
|
created_at: Date;
|
|
@@ -109,6 +110,7 @@ export type ProductPrices = {
|
|
|
109
110
|
origin_id: string | null;
|
|
110
111
|
created_by: string;
|
|
111
112
|
updated_by: string;
|
|
113
|
+
margin: number | null;
|
|
112
114
|
};
|
|
113
115
|
/**
|
|
114
116
|
* Model ProductImage
|
|
@@ -277,6 +279,7 @@ export type DocumentHeader = {
|
|
|
277
279
|
owner_id: string;
|
|
278
280
|
owner_number: number;
|
|
279
281
|
owner_name: string | null;
|
|
282
|
+
owner_ref_document: string | null;
|
|
280
283
|
account_code: string | null;
|
|
281
284
|
billing_persona_id: string | null;
|
|
282
285
|
billing_persona_nif: string | null;
|
|
@@ -342,6 +345,8 @@ export type DocumentHeader = {
|
|
|
342
345
|
updated_at: Date;
|
|
343
346
|
created_by: string;
|
|
344
347
|
updated_by: string;
|
|
348
|
+
document_label: string;
|
|
349
|
+
name: string;
|
|
345
350
|
};
|
|
346
351
|
/**
|
|
347
352
|
* Model DocumentHeaderHistory
|
|
@@ -396,6 +401,19 @@ export type DocumentLine = {
|
|
|
396
401
|
updated_at: Date;
|
|
397
402
|
created_by: string;
|
|
398
403
|
updated_by: string;
|
|
404
|
+
client_unit_total_without_tax: number;
|
|
405
|
+
client_unit_total_without_discount: number;
|
|
406
|
+
client_unit_total: number;
|
|
407
|
+
client_unit_total_discount: number;
|
|
408
|
+
client_unit_total_tax: number;
|
|
409
|
+
client_total_without_tax: number;
|
|
410
|
+
client_total_without_discount: number;
|
|
411
|
+
client_total: number;
|
|
412
|
+
client_total_discount: number;
|
|
413
|
+
client_total_tax: number;
|
|
414
|
+
group_header: boolean;
|
|
415
|
+
product_margin: number | null;
|
|
416
|
+
virtual_index: number;
|
|
399
417
|
};
|
|
400
418
|
/**
|
|
401
419
|
* Model DocumentLineAssoc
|
|
@@ -905,16 +923,6 @@ export type DocumentLineBaseVirtuals = {
|
|
|
905
923
|
*/
|
|
906
924
|
export type DocumentLineVirtuals = {
|
|
907
925
|
document_line_id: string;
|
|
908
|
-
client_unit_total_without_tax: number;
|
|
909
|
-
client_unit_total_without_discount: number;
|
|
910
|
-
client_unit_total: number;
|
|
911
|
-
client_unit_total_discount: number;
|
|
912
|
-
client_unit_total_tax: number;
|
|
913
|
-
client_total_without_tax: number;
|
|
914
|
-
client_total_without_discount: number;
|
|
915
|
-
client_total: number;
|
|
916
|
-
client_total_discount: number;
|
|
917
|
-
client_total_tax: number;
|
|
918
926
|
provider_unit_total_without_tax: number;
|
|
919
927
|
provider_unit_total_without_discount: number;
|
|
920
928
|
provider_unit_total: number;
|
|
@@ -931,7 +939,6 @@ export type DocumentLineVirtuals = {
|
|
|
931
939
|
phc_closed: boolean;
|
|
932
940
|
closed: boolean;
|
|
933
941
|
provider_closed: boolean;
|
|
934
|
-
group_header: boolean;
|
|
935
942
|
waiting_for_bulk_order: boolean;
|
|
936
943
|
waiting_for_order: boolean;
|
|
937
944
|
stock_in: boolean;
|
|
@@ -1054,3 +1061,51 @@ export type ConferirEncomenda = {
|
|
|
1054
1061
|
created_at: Date;
|
|
1055
1062
|
created_by: string;
|
|
1056
1063
|
};
|
|
1064
|
+
/**
|
|
1065
|
+
* Model DocumentHeaderSurvey
|
|
1066
|
+
*
|
|
1067
|
+
*/
|
|
1068
|
+
export type DocumentHeaderSurvey = {
|
|
1069
|
+
id: string;
|
|
1070
|
+
owner_id: string;
|
|
1071
|
+
persona_id: string;
|
|
1072
|
+
persona_name: string;
|
|
1073
|
+
persona_email: string;
|
|
1074
|
+
document_header_id: string;
|
|
1075
|
+
document_number: number;
|
|
1076
|
+
sent: Date | null;
|
|
1077
|
+
data: unknown | null;
|
|
1078
|
+
};
|
|
1079
|
+
/**
|
|
1080
|
+
* Model DocumentHeaderSubscriber
|
|
1081
|
+
*
|
|
1082
|
+
*/
|
|
1083
|
+
export type DocumentHeaderSubscriber = {
|
|
1084
|
+
id: string;
|
|
1085
|
+
document_header_id: string;
|
|
1086
|
+
store_operator_id: string;
|
|
1087
|
+
created_at: Date;
|
|
1088
|
+
created_by: string;
|
|
1089
|
+
updated_at: Date;
|
|
1090
|
+
updated_by: string;
|
|
1091
|
+
};
|
|
1092
|
+
/**
|
|
1093
|
+
* Model GoogleCalendar
|
|
1094
|
+
*
|
|
1095
|
+
*/
|
|
1096
|
+
export type GoogleCalendar = {
|
|
1097
|
+
id: string;
|
|
1098
|
+
created_at: Date;
|
|
1099
|
+
calendar_id: string;
|
|
1100
|
+
event_id: string | null;
|
|
1101
|
+
summary: string;
|
|
1102
|
+
initial_date: Date;
|
|
1103
|
+
status: 'confirmed' | 'tentative' | 'cancelled';
|
|
1104
|
+
ready_for_action: boolean;
|
|
1105
|
+
document_type: 'RM' | 'MT' | null;
|
|
1106
|
+
document_number: string | null;
|
|
1107
|
+
document_line_id: string | null;
|
|
1108
|
+
action: string | null;
|
|
1109
|
+
done: Date | null;
|
|
1110
|
+
error: string | null;
|
|
1111
|
+
};
|
|
@@ -143,11 +143,11 @@ export type Country = {
|
|
|
143
143
|
export type Language = {
|
|
144
144
|
id: string;
|
|
145
145
|
name: string;
|
|
146
|
+
native_name: string;
|
|
147
|
+
iso_code: string;
|
|
148
|
+
short_list: boolean;
|
|
146
149
|
created_at: Date;
|
|
147
150
|
updated_at: Date;
|
|
148
|
-
created_by: string;
|
|
149
|
-
updated_by: string;
|
|
150
|
-
origin_id: string | null;
|
|
151
151
|
};
|
|
152
152
|
/**
|
|
153
153
|
* Model Clients
|
|
@@ -471,6 +471,7 @@ export type Persona = {
|
|
|
471
471
|
locality: string | null;
|
|
472
472
|
country_id: string | null;
|
|
473
473
|
reason_for_exemption_id: string | null;
|
|
474
|
+
language_id: string | null;
|
|
474
475
|
provider_id: string | null;
|
|
475
476
|
client_id: string | null;
|
|
476
477
|
commissioner_id: string | null;
|
|
@@ -7,10 +7,11 @@ import type { IScheduleType } from '../modules/supply/schedule/interface';
|
|
|
7
7
|
import type { IWarningType } from '../modules/supply/documentHeader/interfaces';
|
|
8
8
|
import type { IChat, IEmail, IEncomenda, IMultimedia, IMultimediaSummary, IPostgresBackup, IPrint, IProjectInfo, IProposta, IServiceLogs, IServiceStatus, IStock, ITask } from '../modules/view/adminPanel/interfaces';
|
|
9
9
|
import type * as ErrorLog from '../modules/view/errorLog/interfaces';
|
|
10
|
-
import type * as ChatSubscriber from '../modules/user/chatSubscribers/interfaces';
|
|
11
10
|
import type { File } from './entities/stock';
|
|
12
11
|
import type { ProjectInfo } from './entities/integration';
|
|
13
12
|
import type { IAttachment } from '../modules/supply/externalDocumentHeader/interface';
|
|
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';
|
|
@@ -120,10 +121,10 @@ export declare const findByOwnerIdQuery: joi.ObjectSchema<any>;
|
|
|
120
121
|
export declare const idParam: joi.ObjectSchema<any>;
|
|
121
122
|
export declare const idNumberParam: joi.ObjectSchema<any>;
|
|
122
123
|
export declare const findMinifiedReponse: joi.ArraySchema<{
|
|
123
|
-
name: unknown;
|
|
124
124
|
id: unknown;
|
|
125
|
-
|
|
125
|
+
name: unknown;
|
|
126
126
|
multimedia_id: unknown;
|
|
127
|
+
group: unknown;
|
|
127
128
|
}[]>;
|
|
128
129
|
export declare const joiValidateStamps: IRouteResponseWithoutStamps<WithTimestampsOriginID>;
|
|
129
130
|
export declare const IUserSendEmailDocumentTemplateEnum: {
|
|
@@ -133,18 +134,15 @@ export declare const IUserSendEmailDocumentTemplateEnum: {
|
|
|
133
134
|
export type IUserSendEmailDocumentTemplate = (typeof IUserSendEmailDocumentTemplateEnum)[keyof typeof IUserSendEmailDocumentTemplateEnum];
|
|
134
135
|
export declare const IUserSendEmailDocumentTemplateTypes: string[];
|
|
135
136
|
export declare enum IBrokerTopic {
|
|
136
|
-
create = "create",
|
|
137
|
-
update = "update",
|
|
138
|
-
delete = "delete",
|
|
139
137
|
tickets_change = "tickets_change",
|
|
140
138
|
user_send_email_password = "user_send_email_password",
|
|
141
|
-
user_send_email_document = "user_send_email_document",
|
|
142
139
|
grant_access = "grant_access",
|
|
143
140
|
remove_access = "remove_access",
|
|
144
141
|
google_sheet_set_permissions = "google_sheet_set_permissions",
|
|
145
142
|
google_sheet_update = "google_sheet_update",
|
|
146
143
|
google_sheet_import = "google_sheet_import",
|
|
147
144
|
import_master_artigos = "import_master_artigos",
|
|
145
|
+
user_send_email_document = "user_send_email_document",
|
|
148
146
|
undo_provider_order_schedule_email = "undo_provider_order_schedule_email",
|
|
149
147
|
provider_order_schedule_email = "provider_order_schedule_email",
|
|
150
148
|
client_notice_schedule_email = "client_notice_schedule_email",
|
|
@@ -154,6 +152,8 @@ export declare enum IBrokerTopic {
|
|
|
154
152
|
espera_devolver_catalogo_email = "espera_devolver_catalogo_email",
|
|
155
153
|
verification_email = "verification_email",
|
|
156
154
|
dispatch_chat_message = "dispatch_chat_message",
|
|
155
|
+
persona_lang_change = "persona_lang_change",
|
|
156
|
+
translate_chat_message = "translate_chat_message",
|
|
157
157
|
perform_task = "perform_task",
|
|
158
158
|
create_site_proposal = "create_site_proposal",
|
|
159
159
|
push_notification = "push_notification",
|
|
@@ -177,12 +177,10 @@ export declare enum IBrokerTopic {
|
|
|
177
177
|
googlesheet_stock_log = "googlesheet_stock_log",
|
|
178
178
|
googlesheet_encomenda_log = "googlesheet_encomenda_log",
|
|
179
179
|
log_google_api_request = "log_google_api_request",
|
|
180
|
-
send_espera_info_cliente_messages = "send_espera_info_cliente_messages"
|
|
180
|
+
send_espera_info_cliente_messages = "send_espera_info_cliente_messages",
|
|
181
|
+
send_email_client_survey = "send_email_client_survey"
|
|
181
182
|
}
|
|
182
183
|
export type IBrokerTopicPayload = {
|
|
183
|
-
[IBrokerTopic.create]: Record<string, unknown>;
|
|
184
|
-
[IBrokerTopic.update]: Record<string, unknown>;
|
|
185
|
-
[IBrokerTopic.delete]: Record<string, unknown>;
|
|
186
184
|
[IBrokerTopic.google_sheet_import]: {
|
|
187
185
|
google_sheet_import_id: string;
|
|
188
186
|
google_sheet_id: string;
|
|
@@ -277,14 +275,13 @@ export type IBrokerTopicPayload = {
|
|
|
277
275
|
email: string;
|
|
278
276
|
name: string | null;
|
|
279
277
|
subject: string;
|
|
280
|
-
message: string;
|
|
281
278
|
};
|
|
282
279
|
[IBrokerTopic.retry_errored_emails]: Record<string, never>;
|
|
283
280
|
[IBrokerTopic.send_errored_emails_summary]: {
|
|
284
281
|
warningErrors: string[];
|
|
285
282
|
};
|
|
286
283
|
[IBrokerTopic.dispatch_chat_message]: {
|
|
287
|
-
to: [Pick<
|
|
284
|
+
to: [Pick<Persona, 'email' | 'name' | 'telephone'>];
|
|
288
285
|
reply_url: string;
|
|
289
286
|
owner_id: string;
|
|
290
287
|
document_header_id: string | null;
|
|
@@ -293,6 +290,7 @@ export type IBrokerTopicPayload = {
|
|
|
293
290
|
email_subject?: string;
|
|
294
291
|
created_by: string;
|
|
295
292
|
};
|
|
293
|
+
[IBrokerTopic.translate_chat_message]: ITranslateRequest;
|
|
296
294
|
[IBrokerTopic.create_site_proposal]: ProjectInfo;
|
|
297
295
|
[IBrokerTopic.verification_email]: {
|
|
298
296
|
email: string;
|
|
@@ -359,7 +357,19 @@ export type IBrokerTopicPayload = {
|
|
|
359
357
|
email: string;
|
|
360
358
|
name: string | null;
|
|
361
359
|
subject: string;
|
|
362
|
-
|
|
360
|
+
documents_text: string;
|
|
361
|
+
username: string;
|
|
362
|
+
};
|
|
363
|
+
[IBrokerTopic.send_email_client_survey]: {
|
|
364
|
+
persona_id: string;
|
|
365
|
+
document_header_id: string;
|
|
366
|
+
document_number: number;
|
|
367
|
+
persona_name: string;
|
|
368
|
+
persona_email: string;
|
|
369
|
+
};
|
|
370
|
+
[IBrokerTopic.persona_lang_change]: {
|
|
371
|
+
chat_document_header_id: string;
|
|
372
|
+
language_id: string;
|
|
363
373
|
};
|
|
364
374
|
};
|
|
365
375
|
export interface IBrokerMessage<T extends IBrokerTopic = IBrokerTopic> {
|
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.36",
|
|
5
5
|
"author": "Nomalism <it.nomalism@gmail.com> (https://nomalism.com/)",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"type": "module",
|
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
"prepack": "npm run lint && npm run build"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"joi": "^18.
|
|
26
|
+
"joi": "^18.1.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@swc/core": "^1.15.
|
|
30
|
-
"@types/node": "^24.
|
|
31
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
32
|
-
"@typescript-eslint/parser": "^8.
|
|
33
|
-
"eslint": "^9.39.
|
|
29
|
+
"@swc/core": "^1.15.26",
|
|
30
|
+
"@types/node": "^24.12.2",
|
|
31
|
+
"@typescript-eslint/eslint-plugin": "^8.58.2",
|
|
32
|
+
"@typescript-eslint/parser": "^8.58.2",
|
|
33
|
+
"eslint": "^9.39.4",
|
|
34
34
|
"eslint-config-prettier": "^10.1.8",
|
|
35
35
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
36
36
|
"eslint-plugin-prettier": "^5.5.5",
|
|
37
|
-
"prettier": "^3.8.
|
|
37
|
+
"prettier": "^3.8.3",
|
|
38
38
|
"tsup": "^8.5.1"
|
|
39
39
|
},
|
|
40
40
|
"repository": {
|