tychat-contracts 1.0.62 → 1.0.64
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/appointments/appointment-status.dto.d.ts +1 -1
- package/dist/appointments/appointment-status.dto.d.ts.map +1 -1
- package/dist/appointments/appointment-status.dto.js +1 -0
- package/dist/appointments/appointment.dto.d.ts +3 -0
- package/dist/appointments/appointment.dto.d.ts.map +1 -1
- package/dist/appointments/create-appointment.dto.d.ts +3 -0
- package/dist/appointments/create-appointment.dto.d.ts.map +1 -1
- package/dist/appointments/create-appointment.dto.js +30 -0
- package/dist/connections/connections.dto.d.ts +53 -0
- package/dist/connections/connections.dto.d.ts.map +1 -0
- package/dist/connections/connections.dto.js +376 -0
- package/dist/connections/index.d.ts +2 -0
- package/dist/connections/index.d.ts.map +1 -0
- package/dist/connections/index.js +17 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +1 -1
- package/src/appointments/appointment-status.dto.ts +1 -0
- package/src/appointments/appointment.dto.ts +15 -0
- package/src/appointments/create-appointment.dto.ts +25 -0
- package/src/connections/connections.dto.ts +297 -0
- package/src/connections/index.ts +1 -0
- package/src/index.ts +1 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const APPOINTMENT_STATUSES: readonly ["pending", "processing", "sended", "finished"];
|
|
1
|
+
export declare const APPOINTMENT_STATUSES: readonly ["pending", "processing", "sended", "finished", "canceled"];
|
|
2
2
|
export type AppointmentStatusDto = (typeof APPOINTMENT_STATUSES)[number];
|
|
3
3
|
//# sourceMappingURL=appointment-status.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appointment-status.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment-status.dto.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"appointment-status.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment-status.dto.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,sEAMvB,CAAC;AACX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -6,6 +6,9 @@ export interface AppointmentDto {
|
|
|
6
6
|
date: string;
|
|
7
7
|
checkinCompleted: boolean;
|
|
8
8
|
checkoutCompleted: boolean;
|
|
9
|
+
exitTime?: string;
|
|
10
|
+
observation?: string;
|
|
11
|
+
cancellationReason?: string;
|
|
9
12
|
status: AppointmentStatusDto;
|
|
10
13
|
}
|
|
11
14
|
//# sourceMappingURL=appointment.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IAMX,SAAS,EAAE,MAAM,CAAC;IAKlB,MAAM,EAAE,MAAM,CAAC;IAKf,IAAI,EAAE,MAAM,CAAC;IAKb,gBAAgB,EAAE,OAAO,CAAC;IAK1B,iBAAiB,EAAE,OAAO,CAAC;IAK3B,MAAM,EAAE,oBAAoB,CAAC;CAC9B"}
|
|
1
|
+
{"version":3,"file":"appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/appointment.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IAMX,SAAS,EAAE,MAAM,CAAC;IAKlB,MAAM,EAAE,MAAM,CAAC;IAKf,IAAI,EAAE,MAAM,CAAC;IAKb,gBAAgB,EAAE,OAAO,CAAC;IAK1B,iBAAiB,EAAE,OAAO,CAAC;IAK3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAKlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAKrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAK5B,MAAM,EAAE,oBAAoB,CAAC;CAC9B"}
|
|
@@ -5,6 +5,9 @@ export declare class CreateAppointmentDto {
|
|
|
5
5
|
userId: string;
|
|
6
6
|
checkinCompleted?: boolean;
|
|
7
7
|
checkoutCompleted?: boolean;
|
|
8
|
+
exitTime?: string;
|
|
9
|
+
observation?: string;
|
|
10
|
+
cancellationReason?: string;
|
|
8
11
|
status?: AppointmentStatusDto;
|
|
9
12
|
}
|
|
10
13
|
//# sourceMappingURL=create-appointment.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/create-appointment.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-appointment.dto.d.ts","sourceRoot":"","sources":["../../src/appointments/create-appointment.dto.ts"],"names":[],"mappings":"AAUA,OAAO,EAAwB,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAItF,qBAAa,oBAAoB;IAO/B,SAAS,EAAE,MAAM,CAAC;IAOlB,IAAI,EAAE,MAAM,CAAC;IAQb,MAAM,EAAE,MAAM,CAAC;IASf,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAS3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAQ5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAQlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAQrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAS5B,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B"}
|
|
@@ -19,6 +19,9 @@ class CreateAppointmentDto {
|
|
|
19
19
|
userId;
|
|
20
20
|
checkinCompleted;
|
|
21
21
|
checkoutCompleted;
|
|
22
|
+
exitTime;
|
|
23
|
+
observation;
|
|
24
|
+
cancellationReason;
|
|
22
25
|
status;
|
|
23
26
|
}
|
|
24
27
|
exports.CreateAppointmentDto = CreateAppointmentDto;
|
|
@@ -68,6 +71,33 @@ __decorate([
|
|
|
68
71
|
(0, class_validator_1.IsBoolean)(),
|
|
69
72
|
__metadata("design:type", Boolean)
|
|
70
73
|
], CreateAppointmentDto.prototype, "checkoutCompleted", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
76
|
+
description: 'Horário de saída do atendimento (ISO 8601)',
|
|
77
|
+
example: '2026-03-15T14:45:00.000Z',
|
|
78
|
+
}),
|
|
79
|
+
(0, class_validator_1.IsOptional)(),
|
|
80
|
+
(0, class_validator_1.IsDateString)(),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], CreateAppointmentDto.prototype, "exitTime", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
85
|
+
description: 'Observação do agendamento',
|
|
86
|
+
example: 'Paciente solicitou prioridade no retorno.',
|
|
87
|
+
}),
|
|
88
|
+
(0, class_validator_1.IsOptional)(),
|
|
89
|
+
(0, class_validator_1.IsString)(),
|
|
90
|
+
__metadata("design:type", String)
|
|
91
|
+
], CreateAppointmentDto.prototype, "observation", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
94
|
+
description: 'Motivo do cancelamento',
|
|
95
|
+
example: 'Paciente não compareceu.',
|
|
96
|
+
}),
|
|
97
|
+
(0, class_validator_1.IsOptional)(),
|
|
98
|
+
(0, class_validator_1.IsString)(),
|
|
99
|
+
__metadata("design:type", String)
|
|
100
|
+
], CreateAppointmentDto.prototype, "cancellationReason", void 0);
|
|
71
101
|
__decorate([
|
|
72
102
|
(0, swagger_1.ApiPropertyOptional)({
|
|
73
103
|
description: 'Status do agendamento',
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare class CreateConnectionInstanceDto {
|
|
2
|
+
token?: string;
|
|
3
|
+
qrcode?: boolean;
|
|
4
|
+
number?: string;
|
|
5
|
+
rejectCall?: boolean;
|
|
6
|
+
msgCall?: string;
|
|
7
|
+
groupsIgnore?: boolean;
|
|
8
|
+
alwaysOnline?: boolean;
|
|
9
|
+
readMessages?: boolean;
|
|
10
|
+
readStatus?: boolean;
|
|
11
|
+
syncFullHistory?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare class ConnectionInstanceConnectQueryDto {
|
|
14
|
+
number?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class SetConnectionWebhookDto {
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
url: string;
|
|
19
|
+
webhookByEvents: boolean;
|
|
20
|
+
webhookBase64: boolean;
|
|
21
|
+
events: string[];
|
|
22
|
+
}
|
|
23
|
+
export declare class SendConnectionTextDto {
|
|
24
|
+
number: string;
|
|
25
|
+
text: string;
|
|
26
|
+
delay?: number;
|
|
27
|
+
linkPreview?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare class SendConnectionMediaDto {
|
|
30
|
+
number: string;
|
|
31
|
+
mediatype: string;
|
|
32
|
+
mimetype: string;
|
|
33
|
+
caption: string;
|
|
34
|
+
media: string;
|
|
35
|
+
fileName: string;
|
|
36
|
+
delay?: number;
|
|
37
|
+
}
|
|
38
|
+
export declare class SendConnectionWhatsAppAudioDto {
|
|
39
|
+
number: string;
|
|
40
|
+
audio: string;
|
|
41
|
+
delay?: number;
|
|
42
|
+
}
|
|
43
|
+
export declare class ConnectionMediaMessageKeyDto {
|
|
44
|
+
id: string;
|
|
45
|
+
}
|
|
46
|
+
export declare class ConnectionMediaMessageDto {
|
|
47
|
+
key: ConnectionMediaMessageKeyDto;
|
|
48
|
+
}
|
|
49
|
+
export declare class GetConnectionBase64Dto {
|
|
50
|
+
message: ConnectionMediaMessageDto;
|
|
51
|
+
convertToMp4: boolean;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=connections.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connections.dto.d.ts","sourceRoot":"","sources":["../../src/connections/connections.dto.ts"],"names":[],"mappings":"AAaA,qBAAa,2BAA2B;IAQtC,KAAK,CAAC,EAAE,MAAM,CAAC;IAQf,MAAM,CAAC,EAAE,OAAO,CAAC;IAQjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAQhB,UAAU,CAAC,EAAE,OAAO,CAAC;IAQrB,OAAO,CAAC,EAAE,MAAM,CAAC;IAQjB,YAAY,CAAC,EAAE,OAAO,CAAC;IAQvB,YAAY,CAAC,EAAE,OAAO,CAAC;IAQvB,YAAY,CAAC,EAAE,OAAO,CAAC;IAQvB,UAAU,CAAC,EAAE,OAAO,CAAC;IAQrB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,qBAAa,iCAAiC;IAO5C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,uBAAuB;IAMlC,OAAO,EAAG,OAAO,CAAC;IAQlB,GAAG,EAAG,MAAM,CAAC;IAOb,eAAe,EAAG,OAAO,CAAC;IAO1B,aAAa,EAAG,OAAO,CAAC;IASxB,MAAM,EAAG,MAAM,EAAE,CAAC;CACnB;AAED,qBAAa,qBAAqB;IAOhC,MAAM,EAAG,MAAM,CAAC;IAQhB,IAAI,EAAG,MAAM,CAAC;IASd,KAAK,CAAC,EAAE,MAAM,CAAC;IAQf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,qBAAa,sBAAsB;IAOjC,MAAM,EAAG,MAAM,CAAC;IAQhB,SAAS,EAAG,MAAM,CAAC;IAQnB,QAAQ,EAAG,MAAM,CAAC;IAQlB,OAAO,EAAG,MAAM,CAAC;IAQjB,KAAK,EAAG,MAAM,CAAC;IAQf,QAAQ,EAAG,MAAM,CAAC;IASlB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,8BAA8B;IAOzC,MAAM,EAAG,MAAM,CAAC;IAQhB,KAAK,EAAG,MAAM,CAAC;IASf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,4BAA4B;IAOvC,EAAE,EAAG,MAAM,CAAC;CACb;AAED,qBAAa,yBAAyB;IAIpC,GAAG,EAAG,4BAA4B,CAAC;CACpC;AAED,qBAAa,sBAAsB;IAIjC,OAAO,EAAG,yBAAyB,CAAC;IAOpC,YAAY,EAAG,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GetConnectionBase64Dto = exports.ConnectionMediaMessageDto = exports.ConnectionMediaMessageKeyDto = exports.SendConnectionWhatsAppAudioDto = exports.SendConnectionMediaDto = exports.SendConnectionTextDto = exports.SetConnectionWebhookDto = exports.ConnectionInstanceConnectQueryDto = exports.CreateConnectionInstanceDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const class_transformer_1 = require("class-transformer");
|
|
16
|
+
class CreateConnectionInstanceDto {
|
|
17
|
+
token;
|
|
18
|
+
qrcode;
|
|
19
|
+
number;
|
|
20
|
+
rejectCall;
|
|
21
|
+
msgCall;
|
|
22
|
+
groupsIgnore;
|
|
23
|
+
alwaysOnline;
|
|
24
|
+
readMessages;
|
|
25
|
+
readStatus;
|
|
26
|
+
syncFullHistory;
|
|
27
|
+
}
|
|
28
|
+
exports.CreateConnectionInstanceDto = CreateConnectionInstanceDto;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
31
|
+
description: 'Token da instância (se omitido, EvolutionAPI pode gerar dinamicamente)',
|
|
32
|
+
example: 'my-instance-token',
|
|
33
|
+
}),
|
|
34
|
+
(0, class_validator_1.IsOptional)(),
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], CreateConnectionInstanceDto.prototype, "token", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
40
|
+
description: 'Cria QR Code automaticamente após criar a instância',
|
|
41
|
+
example: true,
|
|
42
|
+
}),
|
|
43
|
+
(0, class_validator_1.IsOptional)(),
|
|
44
|
+
(0, class_validator_1.IsBoolean)(),
|
|
45
|
+
__metadata("design:type", Boolean)
|
|
46
|
+
], CreateConnectionInstanceDto.prototype, "qrcode", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
49
|
+
description: 'Número proprietário da instância com DDI (somente dígitos)',
|
|
50
|
+
example: '5511999999999',
|
|
51
|
+
}),
|
|
52
|
+
(0, class_validator_1.IsOptional)(),
|
|
53
|
+
(0, class_validator_1.IsString)(),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], CreateConnectionInstanceDto.prototype, "number", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
58
|
+
description: 'Rejeitar chamadas automaticamente',
|
|
59
|
+
example: true,
|
|
60
|
+
}),
|
|
61
|
+
(0, class_validator_1.IsOptional)(),
|
|
62
|
+
(0, class_validator_1.IsBoolean)(),
|
|
63
|
+
__metadata("design:type", Boolean)
|
|
64
|
+
], CreateConnectionInstanceDto.prototype, "rejectCall", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
67
|
+
description: 'Mensagem enviada ao rejeitar chamada automaticamente',
|
|
68
|
+
example: 'Nao atendemos chamadas por este canal.',
|
|
69
|
+
}),
|
|
70
|
+
(0, class_validator_1.IsOptional)(),
|
|
71
|
+
(0, class_validator_1.IsString)(),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], CreateConnectionInstanceDto.prototype, "msgCall", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
76
|
+
description: 'Ignorar mensagens de grupos',
|
|
77
|
+
example: false,
|
|
78
|
+
}),
|
|
79
|
+
(0, class_validator_1.IsOptional)(),
|
|
80
|
+
(0, class_validator_1.IsBoolean)(),
|
|
81
|
+
__metadata("design:type", Boolean)
|
|
82
|
+
], CreateConnectionInstanceDto.prototype, "groupsIgnore", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
85
|
+
description: 'Manter sessao sempre online',
|
|
86
|
+
example: true,
|
|
87
|
+
}),
|
|
88
|
+
(0, class_validator_1.IsOptional)(),
|
|
89
|
+
(0, class_validator_1.IsBoolean)(),
|
|
90
|
+
__metadata("design:type", Boolean)
|
|
91
|
+
], CreateConnectionInstanceDto.prototype, "alwaysOnline", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
94
|
+
description: 'Marcar mensagens recebidas como lidas',
|
|
95
|
+
example: true,
|
|
96
|
+
}),
|
|
97
|
+
(0, class_validator_1.IsOptional)(),
|
|
98
|
+
(0, class_validator_1.IsBoolean)(),
|
|
99
|
+
__metadata("design:type", Boolean)
|
|
100
|
+
], CreateConnectionInstanceDto.prototype, "readMessages", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
103
|
+
description: 'Exibir status de leitura das mensagens enviadas',
|
|
104
|
+
example: true,
|
|
105
|
+
}),
|
|
106
|
+
(0, class_validator_1.IsOptional)(),
|
|
107
|
+
(0, class_validator_1.IsBoolean)(),
|
|
108
|
+
__metadata("design:type", Boolean)
|
|
109
|
+
], CreateConnectionInstanceDto.prototype, "readStatus", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
112
|
+
description: 'Sincronizar historico completo do WhatsApp',
|
|
113
|
+
example: false,
|
|
114
|
+
}),
|
|
115
|
+
(0, class_validator_1.IsOptional)(),
|
|
116
|
+
(0, class_validator_1.IsBoolean)(),
|
|
117
|
+
__metadata("design:type", Boolean)
|
|
118
|
+
], CreateConnectionInstanceDto.prototype, "syncFullHistory", void 0);
|
|
119
|
+
class ConnectionInstanceConnectQueryDto {
|
|
120
|
+
number;
|
|
121
|
+
}
|
|
122
|
+
exports.ConnectionInstanceConnectQueryDto = ConnectionInstanceConnectQueryDto;
|
|
123
|
+
__decorate([
|
|
124
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
125
|
+
description: 'Numero com DDI para pareamento por codigo (opcional)',
|
|
126
|
+
example: '5511999999999',
|
|
127
|
+
}),
|
|
128
|
+
(0, class_validator_1.IsOptional)(),
|
|
129
|
+
(0, class_validator_1.IsString)(),
|
|
130
|
+
__metadata("design:type", String)
|
|
131
|
+
], ConnectionInstanceConnectQueryDto.prototype, "number", void 0);
|
|
132
|
+
class SetConnectionWebhookDto {
|
|
133
|
+
enabled;
|
|
134
|
+
url;
|
|
135
|
+
webhookByEvents;
|
|
136
|
+
webhookBase64;
|
|
137
|
+
events;
|
|
138
|
+
}
|
|
139
|
+
exports.SetConnectionWebhookDto = SetConnectionWebhookDto;
|
|
140
|
+
__decorate([
|
|
141
|
+
(0, swagger_1.ApiProperty)({
|
|
142
|
+
description: 'Habilita webhook da instancia',
|
|
143
|
+
example: true,
|
|
144
|
+
}),
|
|
145
|
+
(0, class_validator_1.IsBoolean)(),
|
|
146
|
+
__metadata("design:type", Boolean)
|
|
147
|
+
], SetConnectionWebhookDto.prototype, "enabled", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
(0, swagger_1.ApiProperty)({
|
|
150
|
+
description: 'URL que recebera eventos',
|
|
151
|
+
example: 'https://api.seusistema.com/webhooks/whatsapp',
|
|
152
|
+
}),
|
|
153
|
+
(0, class_validator_1.IsString)(),
|
|
154
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
155
|
+
__metadata("design:type", String)
|
|
156
|
+
], SetConnectionWebhookDto.prototype, "url", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
(0, swagger_1.ApiProperty)({
|
|
159
|
+
description: 'Webhook por eventos especificos',
|
|
160
|
+
example: true,
|
|
161
|
+
}),
|
|
162
|
+
(0, class_validator_1.IsBoolean)(),
|
|
163
|
+
__metadata("design:type", Boolean)
|
|
164
|
+
], SetConnectionWebhookDto.prototype, "webhookByEvents", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
(0, swagger_1.ApiProperty)({
|
|
167
|
+
description: 'Incluir arquivos em base64 quando disponivel',
|
|
168
|
+
example: false,
|
|
169
|
+
}),
|
|
170
|
+
(0, class_validator_1.IsBoolean)(),
|
|
171
|
+
__metadata("design:type", Boolean)
|
|
172
|
+
], SetConnectionWebhookDto.prototype, "webhookBase64", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
(0, swagger_1.ApiProperty)({
|
|
175
|
+
description: 'Eventos permitidos pela Evolution API',
|
|
176
|
+
example: ['CONNECTION_UPDATE', 'MESSAGES_UPSERT'],
|
|
177
|
+
type: [String],
|
|
178
|
+
}),
|
|
179
|
+
(0, class_validator_1.IsArray)(),
|
|
180
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
181
|
+
__metadata("design:type", Array)
|
|
182
|
+
], SetConnectionWebhookDto.prototype, "events", void 0);
|
|
183
|
+
class SendConnectionTextDto {
|
|
184
|
+
number;
|
|
185
|
+
text;
|
|
186
|
+
delay;
|
|
187
|
+
linkPreview;
|
|
188
|
+
}
|
|
189
|
+
exports.SendConnectionTextDto = SendConnectionTextDto;
|
|
190
|
+
__decorate([
|
|
191
|
+
(0, swagger_1.ApiProperty)({
|
|
192
|
+
description: 'Numero destino com DDI',
|
|
193
|
+
example: '5511999999999',
|
|
194
|
+
}),
|
|
195
|
+
(0, class_validator_1.IsString)(),
|
|
196
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
197
|
+
__metadata("design:type", String)
|
|
198
|
+
], SendConnectionTextDto.prototype, "number", void 0);
|
|
199
|
+
__decorate([
|
|
200
|
+
(0, swagger_1.ApiProperty)({
|
|
201
|
+
description: 'Texto da mensagem',
|
|
202
|
+
example: 'Ola! Tudo bem?',
|
|
203
|
+
}),
|
|
204
|
+
(0, class_validator_1.IsString)(),
|
|
205
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
206
|
+
__metadata("design:type", String)
|
|
207
|
+
], SendConnectionTextDto.prototype, "text", void 0);
|
|
208
|
+
__decorate([
|
|
209
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
210
|
+
description: 'Delay de presenca em ms antes do envio',
|
|
211
|
+
example: 1000,
|
|
212
|
+
}),
|
|
213
|
+
(0, class_validator_1.IsOptional)(),
|
|
214
|
+
(0, class_validator_1.IsInt)(),
|
|
215
|
+
(0, class_validator_1.Min)(0),
|
|
216
|
+
__metadata("design:type", Number)
|
|
217
|
+
], SendConnectionTextDto.prototype, "delay", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
220
|
+
description: 'Ativar preview de links',
|
|
221
|
+
example: true,
|
|
222
|
+
}),
|
|
223
|
+
(0, class_validator_1.IsOptional)(),
|
|
224
|
+
(0, class_validator_1.IsBoolean)(),
|
|
225
|
+
__metadata("design:type", Boolean)
|
|
226
|
+
], SendConnectionTextDto.prototype, "linkPreview", void 0);
|
|
227
|
+
class SendConnectionMediaDto {
|
|
228
|
+
number;
|
|
229
|
+
mediatype;
|
|
230
|
+
mimetype;
|
|
231
|
+
caption;
|
|
232
|
+
media;
|
|
233
|
+
fileName;
|
|
234
|
+
delay;
|
|
235
|
+
}
|
|
236
|
+
exports.SendConnectionMediaDto = SendConnectionMediaDto;
|
|
237
|
+
__decorate([
|
|
238
|
+
(0, swagger_1.ApiProperty)({
|
|
239
|
+
description: 'Numero destino com DDI',
|
|
240
|
+
example: '5511999999999',
|
|
241
|
+
}),
|
|
242
|
+
(0, class_validator_1.IsString)(),
|
|
243
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
244
|
+
__metadata("design:type", String)
|
|
245
|
+
], SendConnectionMediaDto.prototype, "number", void 0);
|
|
246
|
+
__decorate([
|
|
247
|
+
(0, swagger_1.ApiProperty)({
|
|
248
|
+
description: 'Tipo da midia',
|
|
249
|
+
example: 'image',
|
|
250
|
+
}),
|
|
251
|
+
(0, class_validator_1.IsString)(),
|
|
252
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
253
|
+
__metadata("design:type", String)
|
|
254
|
+
], SendConnectionMediaDto.prototype, "mediatype", void 0);
|
|
255
|
+
__decorate([
|
|
256
|
+
(0, swagger_1.ApiProperty)({
|
|
257
|
+
description: 'MIME type da midia',
|
|
258
|
+
example: 'image/png',
|
|
259
|
+
}),
|
|
260
|
+
(0, class_validator_1.IsString)(),
|
|
261
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
262
|
+
__metadata("design:type", String)
|
|
263
|
+
], SendConnectionMediaDto.prototype, "mimetype", void 0);
|
|
264
|
+
__decorate([
|
|
265
|
+
(0, swagger_1.ApiProperty)({
|
|
266
|
+
description: 'Legenda',
|
|
267
|
+
example: 'Imagem de teste',
|
|
268
|
+
}),
|
|
269
|
+
(0, class_validator_1.IsString)(),
|
|
270
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
271
|
+
__metadata("design:type", String)
|
|
272
|
+
], SendConnectionMediaDto.prototype, "caption", void 0);
|
|
273
|
+
__decorate([
|
|
274
|
+
(0, swagger_1.ApiProperty)({
|
|
275
|
+
description: 'URL publica da midia ou conteudo base64',
|
|
276
|
+
example: 'https://cdn.seusistema.com/media/example.png',
|
|
277
|
+
}),
|
|
278
|
+
(0, class_validator_1.IsString)(),
|
|
279
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
280
|
+
__metadata("design:type", String)
|
|
281
|
+
], SendConnectionMediaDto.prototype, "media", void 0);
|
|
282
|
+
__decorate([
|
|
283
|
+
(0, swagger_1.ApiProperty)({
|
|
284
|
+
description: 'Nome do arquivo',
|
|
285
|
+
example: 'example.png',
|
|
286
|
+
}),
|
|
287
|
+
(0, class_validator_1.IsString)(),
|
|
288
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
289
|
+
__metadata("design:type", String)
|
|
290
|
+
], SendConnectionMediaDto.prototype, "fileName", void 0);
|
|
291
|
+
__decorate([
|
|
292
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
293
|
+
description: 'Delay de presenca em ms antes do envio',
|
|
294
|
+
example: 1000,
|
|
295
|
+
}),
|
|
296
|
+
(0, class_validator_1.IsOptional)(),
|
|
297
|
+
(0, class_validator_1.IsInt)(),
|
|
298
|
+
(0, class_validator_1.Min)(0),
|
|
299
|
+
__metadata("design:type", Number)
|
|
300
|
+
], SendConnectionMediaDto.prototype, "delay", void 0);
|
|
301
|
+
class SendConnectionWhatsAppAudioDto {
|
|
302
|
+
number;
|
|
303
|
+
audio;
|
|
304
|
+
delay;
|
|
305
|
+
}
|
|
306
|
+
exports.SendConnectionWhatsAppAudioDto = SendConnectionWhatsAppAudioDto;
|
|
307
|
+
__decorate([
|
|
308
|
+
(0, swagger_1.ApiProperty)({
|
|
309
|
+
description: 'Numero destino com DDI',
|
|
310
|
+
example: '5511999999999',
|
|
311
|
+
}),
|
|
312
|
+
(0, class_validator_1.IsString)(),
|
|
313
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
314
|
+
__metadata("design:type", String)
|
|
315
|
+
], SendConnectionWhatsAppAudioDto.prototype, "number", void 0);
|
|
316
|
+
__decorate([
|
|
317
|
+
(0, swagger_1.ApiProperty)({
|
|
318
|
+
description: 'URL publica do audio ou conteudo base64',
|
|
319
|
+
example: 'https://cdn.seusistema.com/media/audio.ogg',
|
|
320
|
+
}),
|
|
321
|
+
(0, class_validator_1.IsString)(),
|
|
322
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
323
|
+
__metadata("design:type", String)
|
|
324
|
+
], SendConnectionWhatsAppAudioDto.prototype, "audio", void 0);
|
|
325
|
+
__decorate([
|
|
326
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
327
|
+
description: 'Delay de presenca em ms antes do envio',
|
|
328
|
+
example: 1000,
|
|
329
|
+
}),
|
|
330
|
+
(0, class_validator_1.IsOptional)(),
|
|
331
|
+
(0, class_validator_1.IsInt)(),
|
|
332
|
+
(0, class_validator_1.Min)(0),
|
|
333
|
+
__metadata("design:type", Number)
|
|
334
|
+
], SendConnectionWhatsAppAudioDto.prototype, "delay", void 0);
|
|
335
|
+
class ConnectionMediaMessageKeyDto {
|
|
336
|
+
id;
|
|
337
|
+
}
|
|
338
|
+
exports.ConnectionMediaMessageKeyDto = ConnectionMediaMessageKeyDto;
|
|
339
|
+
__decorate([
|
|
340
|
+
(0, swagger_1.ApiProperty)({
|
|
341
|
+
description: 'ID da mensagem de midia no WhatsApp',
|
|
342
|
+
example: 'BAE594145F4C59B4',
|
|
343
|
+
}),
|
|
344
|
+
(0, class_validator_1.IsString)(),
|
|
345
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
346
|
+
__metadata("design:type", String)
|
|
347
|
+
], ConnectionMediaMessageKeyDto.prototype, "id", void 0);
|
|
348
|
+
class ConnectionMediaMessageDto {
|
|
349
|
+
key;
|
|
350
|
+
}
|
|
351
|
+
exports.ConnectionMediaMessageDto = ConnectionMediaMessageDto;
|
|
352
|
+
__decorate([
|
|
353
|
+
(0, swagger_1.ApiProperty)({ type: ConnectionMediaMessageKeyDto }),
|
|
354
|
+
(0, class_validator_1.ValidateNested)(),
|
|
355
|
+
(0, class_transformer_1.Type)(() => ConnectionMediaMessageKeyDto),
|
|
356
|
+
__metadata("design:type", ConnectionMediaMessageKeyDto)
|
|
357
|
+
], ConnectionMediaMessageDto.prototype, "key", void 0);
|
|
358
|
+
class GetConnectionBase64Dto {
|
|
359
|
+
message;
|
|
360
|
+
convertToMp4;
|
|
361
|
+
}
|
|
362
|
+
exports.GetConnectionBase64Dto = GetConnectionBase64Dto;
|
|
363
|
+
__decorate([
|
|
364
|
+
(0, swagger_1.ApiProperty)({ type: ConnectionMediaMessageDto }),
|
|
365
|
+
(0, class_validator_1.ValidateNested)(),
|
|
366
|
+
(0, class_transformer_1.Type)(() => ConnectionMediaMessageDto),
|
|
367
|
+
__metadata("design:type", ConnectionMediaMessageDto)
|
|
368
|
+
], GetConnectionBase64Dto.prototype, "message", void 0);
|
|
369
|
+
__decorate([
|
|
370
|
+
(0, swagger_1.ApiProperty)({
|
|
371
|
+
description: 'Converter video para MP4 (valido para mensagens de video)',
|
|
372
|
+
example: false,
|
|
373
|
+
}),
|
|
374
|
+
(0, class_validator_1.IsBoolean)(),
|
|
375
|
+
__metadata("design:type", Boolean)
|
|
376
|
+
], GetConnectionBase64Dto.prototype, "convertToMp4", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connections/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./connections.dto"), exports);
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC;AACrB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -29,6 +29,21 @@ export interface AppointmentDto {
|
|
|
29
29
|
*/
|
|
30
30
|
checkoutCompleted: boolean;
|
|
31
31
|
/*
|
|
32
|
+
* Horário de saída do atendimento (ISO 8601)
|
|
33
|
+
* @example '2026-03-15T14:45:00.000Z'
|
|
34
|
+
*/
|
|
35
|
+
exitTime?: string;
|
|
36
|
+
/*
|
|
37
|
+
* Observação do agendamento
|
|
38
|
+
* @example 'Paciente solicitou prioridade no retorno.'
|
|
39
|
+
*/
|
|
40
|
+
observation?: string;
|
|
41
|
+
/*
|
|
42
|
+
* Motivo do cancelamento
|
|
43
|
+
* @example 'Paciente não compareceu.'
|
|
44
|
+
*/
|
|
45
|
+
cancellationReason?: string;
|
|
46
|
+
/*
|
|
32
47
|
* Status do agendamento
|
|
33
48
|
* @example 'pending'
|
|
34
49
|
*/
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
IsEnum,
|
|
6
6
|
IsNotEmpty,
|
|
7
7
|
IsOptional,
|
|
8
|
+
IsString,
|
|
8
9
|
IsUUID,
|
|
9
10
|
} from 'class-validator';
|
|
10
11
|
import { APPOINTMENT_STATUSES, AppointmentStatusDto } from './appointment-status.dto';
|
|
@@ -53,6 +54,30 @@ export class CreateAppointmentDto {
|
|
|
53
54
|
@IsBoolean()
|
|
54
55
|
checkoutCompleted?: boolean;
|
|
55
56
|
|
|
57
|
+
@ApiPropertyOptional({
|
|
58
|
+
description: 'Horário de saída do atendimento (ISO 8601)',
|
|
59
|
+
example: '2026-03-15T14:45:00.000Z',
|
|
60
|
+
})
|
|
61
|
+
@IsOptional()
|
|
62
|
+
@IsDateString()
|
|
63
|
+
exitTime?: string;
|
|
64
|
+
|
|
65
|
+
@ApiPropertyOptional({
|
|
66
|
+
description: 'Observação do agendamento',
|
|
67
|
+
example: 'Paciente solicitou prioridade no retorno.',
|
|
68
|
+
})
|
|
69
|
+
@IsOptional()
|
|
70
|
+
@IsString()
|
|
71
|
+
observation?: string;
|
|
72
|
+
|
|
73
|
+
@ApiPropertyOptional({
|
|
74
|
+
description: 'Motivo do cancelamento',
|
|
75
|
+
example: 'Paciente não compareceu.',
|
|
76
|
+
})
|
|
77
|
+
@IsOptional()
|
|
78
|
+
@IsString()
|
|
79
|
+
cancellationReason?: string;
|
|
80
|
+
|
|
56
81
|
@ApiPropertyOptional({
|
|
57
82
|
description: 'Status do agendamento',
|
|
58
83
|
enum: APPOINTMENT_STATUSES,
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import {
|
|
3
|
+
IsArray,
|
|
4
|
+
IsBoolean,
|
|
5
|
+
IsInt,
|
|
6
|
+
IsNotEmpty,
|
|
7
|
+
IsOptional,
|
|
8
|
+
IsString,
|
|
9
|
+
Min,
|
|
10
|
+
ValidateNested,
|
|
11
|
+
} from 'class-validator';
|
|
12
|
+
import { Type } from 'class-transformer';
|
|
13
|
+
|
|
14
|
+
export class CreateConnectionInstanceDto {
|
|
15
|
+
@ApiPropertyOptional({
|
|
16
|
+
description:
|
|
17
|
+
'Token da instância (se omitido, EvolutionAPI pode gerar dinamicamente)',
|
|
18
|
+
example: 'my-instance-token',
|
|
19
|
+
})
|
|
20
|
+
@IsOptional()
|
|
21
|
+
@IsString()
|
|
22
|
+
token?: string;
|
|
23
|
+
|
|
24
|
+
@ApiPropertyOptional({
|
|
25
|
+
description: 'Cria QR Code automaticamente após criar a instância',
|
|
26
|
+
example: true,
|
|
27
|
+
})
|
|
28
|
+
@IsOptional()
|
|
29
|
+
@IsBoolean()
|
|
30
|
+
qrcode?: boolean;
|
|
31
|
+
|
|
32
|
+
@ApiPropertyOptional({
|
|
33
|
+
description: 'Número proprietário da instância com DDI (somente dígitos)',
|
|
34
|
+
example: '5511999999999',
|
|
35
|
+
})
|
|
36
|
+
@IsOptional()
|
|
37
|
+
@IsString()
|
|
38
|
+
number?: string;
|
|
39
|
+
|
|
40
|
+
@ApiPropertyOptional({
|
|
41
|
+
description: 'Rejeitar chamadas automaticamente',
|
|
42
|
+
example: true,
|
|
43
|
+
})
|
|
44
|
+
@IsOptional()
|
|
45
|
+
@IsBoolean()
|
|
46
|
+
rejectCall?: boolean;
|
|
47
|
+
|
|
48
|
+
@ApiPropertyOptional({
|
|
49
|
+
description: 'Mensagem enviada ao rejeitar chamada automaticamente',
|
|
50
|
+
example: 'Nao atendemos chamadas por este canal.',
|
|
51
|
+
})
|
|
52
|
+
@IsOptional()
|
|
53
|
+
@IsString()
|
|
54
|
+
msgCall?: string;
|
|
55
|
+
|
|
56
|
+
@ApiPropertyOptional({
|
|
57
|
+
description: 'Ignorar mensagens de grupos',
|
|
58
|
+
example: false,
|
|
59
|
+
})
|
|
60
|
+
@IsOptional()
|
|
61
|
+
@IsBoolean()
|
|
62
|
+
groupsIgnore?: boolean;
|
|
63
|
+
|
|
64
|
+
@ApiPropertyOptional({
|
|
65
|
+
description: 'Manter sessao sempre online',
|
|
66
|
+
example: true,
|
|
67
|
+
})
|
|
68
|
+
@IsOptional()
|
|
69
|
+
@IsBoolean()
|
|
70
|
+
alwaysOnline?: boolean;
|
|
71
|
+
|
|
72
|
+
@ApiPropertyOptional({
|
|
73
|
+
description: 'Marcar mensagens recebidas como lidas',
|
|
74
|
+
example: true,
|
|
75
|
+
})
|
|
76
|
+
@IsOptional()
|
|
77
|
+
@IsBoolean()
|
|
78
|
+
readMessages?: boolean;
|
|
79
|
+
|
|
80
|
+
@ApiPropertyOptional({
|
|
81
|
+
description: 'Exibir status de leitura das mensagens enviadas',
|
|
82
|
+
example: true,
|
|
83
|
+
})
|
|
84
|
+
@IsOptional()
|
|
85
|
+
@IsBoolean()
|
|
86
|
+
readStatus?: boolean;
|
|
87
|
+
|
|
88
|
+
@ApiPropertyOptional({
|
|
89
|
+
description: 'Sincronizar historico completo do WhatsApp',
|
|
90
|
+
example: false,
|
|
91
|
+
})
|
|
92
|
+
@IsOptional()
|
|
93
|
+
@IsBoolean()
|
|
94
|
+
syncFullHistory?: boolean;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export class ConnectionInstanceConnectQueryDto {
|
|
98
|
+
@ApiPropertyOptional({
|
|
99
|
+
description: 'Numero com DDI para pareamento por codigo (opcional)',
|
|
100
|
+
example: '5511999999999',
|
|
101
|
+
})
|
|
102
|
+
@IsOptional()
|
|
103
|
+
@IsString()
|
|
104
|
+
number?: string;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export class SetConnectionWebhookDto {
|
|
108
|
+
@ApiProperty({
|
|
109
|
+
description: 'Habilita webhook da instancia',
|
|
110
|
+
example: true,
|
|
111
|
+
})
|
|
112
|
+
@IsBoolean()
|
|
113
|
+
enabled!: boolean;
|
|
114
|
+
|
|
115
|
+
@ApiProperty({
|
|
116
|
+
description: 'URL que recebera eventos',
|
|
117
|
+
example: 'https://api.seusistema.com/webhooks/whatsapp',
|
|
118
|
+
})
|
|
119
|
+
@IsString()
|
|
120
|
+
@IsNotEmpty()
|
|
121
|
+
url!: string;
|
|
122
|
+
|
|
123
|
+
@ApiProperty({
|
|
124
|
+
description: 'Webhook por eventos especificos',
|
|
125
|
+
example: true,
|
|
126
|
+
})
|
|
127
|
+
@IsBoolean()
|
|
128
|
+
webhookByEvents!: boolean;
|
|
129
|
+
|
|
130
|
+
@ApiProperty({
|
|
131
|
+
description: 'Incluir arquivos em base64 quando disponivel',
|
|
132
|
+
example: false,
|
|
133
|
+
})
|
|
134
|
+
@IsBoolean()
|
|
135
|
+
webhookBase64!: boolean;
|
|
136
|
+
|
|
137
|
+
@ApiProperty({
|
|
138
|
+
description: 'Eventos permitidos pela Evolution API',
|
|
139
|
+
example: ['CONNECTION_UPDATE', 'MESSAGES_UPSERT'],
|
|
140
|
+
type: [String],
|
|
141
|
+
})
|
|
142
|
+
@IsArray()
|
|
143
|
+
@IsString({ each: true })
|
|
144
|
+
events!: string[];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export class SendConnectionTextDto {
|
|
148
|
+
@ApiProperty({
|
|
149
|
+
description: 'Numero destino com DDI',
|
|
150
|
+
example: '5511999999999',
|
|
151
|
+
})
|
|
152
|
+
@IsString()
|
|
153
|
+
@IsNotEmpty()
|
|
154
|
+
number!: string;
|
|
155
|
+
|
|
156
|
+
@ApiProperty({
|
|
157
|
+
description: 'Texto da mensagem',
|
|
158
|
+
example: 'Ola! Tudo bem?',
|
|
159
|
+
})
|
|
160
|
+
@IsString()
|
|
161
|
+
@IsNotEmpty()
|
|
162
|
+
text!: string;
|
|
163
|
+
|
|
164
|
+
@ApiPropertyOptional({
|
|
165
|
+
description: 'Delay de presenca em ms antes do envio',
|
|
166
|
+
example: 1000,
|
|
167
|
+
})
|
|
168
|
+
@IsOptional()
|
|
169
|
+
@IsInt()
|
|
170
|
+
@Min(0)
|
|
171
|
+
delay?: number;
|
|
172
|
+
|
|
173
|
+
@ApiPropertyOptional({
|
|
174
|
+
description: 'Ativar preview de links',
|
|
175
|
+
example: true,
|
|
176
|
+
})
|
|
177
|
+
@IsOptional()
|
|
178
|
+
@IsBoolean()
|
|
179
|
+
linkPreview?: boolean;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export class SendConnectionMediaDto {
|
|
183
|
+
@ApiProperty({
|
|
184
|
+
description: 'Numero destino com DDI',
|
|
185
|
+
example: '5511999999999',
|
|
186
|
+
})
|
|
187
|
+
@IsString()
|
|
188
|
+
@IsNotEmpty()
|
|
189
|
+
number!: string;
|
|
190
|
+
|
|
191
|
+
@ApiProperty({
|
|
192
|
+
description: 'Tipo da midia',
|
|
193
|
+
example: 'image',
|
|
194
|
+
})
|
|
195
|
+
@IsString()
|
|
196
|
+
@IsNotEmpty()
|
|
197
|
+
mediatype!: string;
|
|
198
|
+
|
|
199
|
+
@ApiProperty({
|
|
200
|
+
description: 'MIME type da midia',
|
|
201
|
+
example: 'image/png',
|
|
202
|
+
})
|
|
203
|
+
@IsString()
|
|
204
|
+
@IsNotEmpty()
|
|
205
|
+
mimetype!: string;
|
|
206
|
+
|
|
207
|
+
@ApiProperty({
|
|
208
|
+
description: 'Legenda',
|
|
209
|
+
example: 'Imagem de teste',
|
|
210
|
+
})
|
|
211
|
+
@IsString()
|
|
212
|
+
@IsNotEmpty()
|
|
213
|
+
caption!: string;
|
|
214
|
+
|
|
215
|
+
@ApiProperty({
|
|
216
|
+
description: 'URL publica da midia ou conteudo base64',
|
|
217
|
+
example: 'https://cdn.seusistema.com/media/example.png',
|
|
218
|
+
})
|
|
219
|
+
@IsString()
|
|
220
|
+
@IsNotEmpty()
|
|
221
|
+
media!: string;
|
|
222
|
+
|
|
223
|
+
@ApiProperty({
|
|
224
|
+
description: 'Nome do arquivo',
|
|
225
|
+
example: 'example.png',
|
|
226
|
+
})
|
|
227
|
+
@IsString()
|
|
228
|
+
@IsNotEmpty()
|
|
229
|
+
fileName!: string;
|
|
230
|
+
|
|
231
|
+
@ApiPropertyOptional({
|
|
232
|
+
description: 'Delay de presenca em ms antes do envio',
|
|
233
|
+
example: 1000,
|
|
234
|
+
})
|
|
235
|
+
@IsOptional()
|
|
236
|
+
@IsInt()
|
|
237
|
+
@Min(0)
|
|
238
|
+
delay?: number;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export class SendConnectionWhatsAppAudioDto {
|
|
242
|
+
@ApiProperty({
|
|
243
|
+
description: 'Numero destino com DDI',
|
|
244
|
+
example: '5511999999999',
|
|
245
|
+
})
|
|
246
|
+
@IsString()
|
|
247
|
+
@IsNotEmpty()
|
|
248
|
+
number!: string;
|
|
249
|
+
|
|
250
|
+
@ApiProperty({
|
|
251
|
+
description: 'URL publica do audio ou conteudo base64',
|
|
252
|
+
example: 'https://cdn.seusistema.com/media/audio.ogg',
|
|
253
|
+
})
|
|
254
|
+
@IsString()
|
|
255
|
+
@IsNotEmpty()
|
|
256
|
+
audio!: string;
|
|
257
|
+
|
|
258
|
+
@ApiPropertyOptional({
|
|
259
|
+
description: 'Delay de presenca em ms antes do envio',
|
|
260
|
+
example: 1000,
|
|
261
|
+
})
|
|
262
|
+
@IsOptional()
|
|
263
|
+
@IsInt()
|
|
264
|
+
@Min(0)
|
|
265
|
+
delay?: number;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export class ConnectionMediaMessageKeyDto {
|
|
269
|
+
@ApiProperty({
|
|
270
|
+
description: 'ID da mensagem de midia no WhatsApp',
|
|
271
|
+
example: 'BAE594145F4C59B4',
|
|
272
|
+
})
|
|
273
|
+
@IsString()
|
|
274
|
+
@IsNotEmpty()
|
|
275
|
+
id!: string;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export class ConnectionMediaMessageDto {
|
|
279
|
+
@ApiProperty({ type: ConnectionMediaMessageKeyDto })
|
|
280
|
+
@ValidateNested()
|
|
281
|
+
@Type(() => ConnectionMediaMessageKeyDto)
|
|
282
|
+
key!: ConnectionMediaMessageKeyDto;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export class GetConnectionBase64Dto {
|
|
286
|
+
@ApiProperty({ type: ConnectionMediaMessageDto })
|
|
287
|
+
@ValidateNested()
|
|
288
|
+
@Type(() => ConnectionMediaMessageDto)
|
|
289
|
+
message!: ConnectionMediaMessageDto;
|
|
290
|
+
|
|
291
|
+
@ApiProperty({
|
|
292
|
+
description: 'Converter video para MP4 (valido para mensagens de video)',
|
|
293
|
+
example: false,
|
|
294
|
+
})
|
|
295
|
+
@IsBoolean()
|
|
296
|
+
convertToMp4!: boolean;
|
|
297
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './connections.dto';
|
package/src/index.ts
CHANGED