tychat-contracts 1.0.40 → 1.0.43
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/auth/login.dto.d.ts +1 -1
- package/dist/auth/login.dto.d.ts.map +1 -1
- package/dist/auth/login.dto.js +5 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/patients/create-patient.dto.d.ts +4 -0
- package/dist/patients/create-patient.dto.d.ts.map +1 -1
- package/dist/patients/create-patient.dto.js +48 -0
- package/dist/procedures/create-procedure.dto.d.ts +5 -0
- package/dist/procedures/create-procedure.dto.d.ts.map +1 -1
- package/dist/procedures/create-procedure.dto.js +57 -0
- package/dist/storage/delete-object.dto.d.ts +4 -0
- package/dist/storage/delete-object.dto.d.ts.map +1 -0
- package/dist/storage/delete-object.dto.js +28 -0
- package/dist/storage/exists-query.dto.d.ts +4 -0
- package/dist/storage/exists-query.dto.d.ts.map +1 -0
- package/dist/storage/exists-query.dto.js +28 -0
- package/dist/storage/index.d.ts +6 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +21 -0
- package/dist/storage/presign-download-query.dto.d.ts +5 -0
- package/dist/storage/presign-download-query.dto.d.ts.map +1 -0
- package/dist/storage/presign-download-query.dto.js +42 -0
- package/dist/storage/presign-upload.dto.d.ts +6 -0
- package/dist/storage/presign-upload.dto.d.ts.map +1 -0
- package/dist/storage/presign-upload.dto.js +52 -0
- package/dist/storage/presigned-url-response.dto.d.ts +8 -0
- package/dist/storage/presigned-url-response.dto.d.ts.map +1 -0
- package/dist/storage/presigned-url-response.dto.js +41 -0
- package/dist/users/create-user.dto.d.ts +1 -1
- package/dist/users/create-user.dto.d.ts.map +1 -1
- package/dist/users/create-user.dto.js +6 -5
- package/package.json +1 -1
- package/src/auth/login.dto.ts +5 -4
- package/src/index.ts +1 -0
- package/src/patients/create-patient.dto.ts +41 -0
- package/src/procedures/create-procedure.dto.ts +48 -0
- package/src/storage/delete-object.dto.ts +13 -0
- package/src/storage/exists-query.dto.ts +13 -0
- package/src/storage/index.ts +5 -0
- package/src/storage/presign-download-query.dto.ts +25 -0
- package/src/storage/presign-upload.dto.ts +33 -0
- package/src/storage/presigned-url-response.dto.ts +18 -0
- package/src/users/create-user.dto.ts +6 -4
- package/tychat-contracts-1.0.43.tgz +0 -0
package/dist/auth/login.dto.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.dto.d.ts","sourceRoot":"","sources":["../../src/auth/login.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,QAAQ;
|
|
1
|
+
{"version":3,"file":"login.dto.d.ts","sourceRoot":"","sources":["../../src/auth/login.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,QAAQ;IAKnB,KAAK,EAAE,MAAM,CAAC;IAKd,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
package/dist/auth/login.dto.js
CHANGED
|
@@ -13,16 +13,17 @@ exports.LoginDto = void 0;
|
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
class LoginDto {
|
|
16
|
-
|
|
16
|
+
email;
|
|
17
17
|
password;
|
|
18
18
|
}
|
|
19
19
|
exports.LoginDto = LoginDto;
|
|
20
20
|
__decorate([
|
|
21
|
-
(0, swagger_1.ApiProperty)({ description: '
|
|
21
|
+
(0, swagger_1.ApiProperty)({ description: 'E-mail do usuário', example: 'usuario@empresa.com' }),
|
|
22
|
+
(0, class_validator_1.IsEmail)({}, { message: 'email deve ser um e-mail válido' }),
|
|
22
23
|
(0, class_validator_1.IsString)(),
|
|
23
|
-
(0, class_validator_1.MinLength)(1, { message: '
|
|
24
|
+
(0, class_validator_1.MinLength)(1, { message: 'email não pode ser vazio' }),
|
|
24
25
|
__metadata("design:type", String)
|
|
25
|
-
], LoginDto.prototype, "
|
|
26
|
+
], LoginDto.prototype, "email", void 0);
|
|
26
27
|
__decorate([
|
|
27
28
|
(0, swagger_1.ApiProperty)({ description: 'Senha do usuário', example: 'senha123' }),
|
|
28
29
|
(0, class_validator_1.IsString)(),
|
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"}
|
|
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"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,10 @@ export declare class CreatePatientDto {
|
|
|
2
2
|
name: string;
|
|
3
3
|
cpf: string;
|
|
4
4
|
birthDate: string;
|
|
5
|
+
email?: string | null;
|
|
6
|
+
phone?: string | null;
|
|
7
|
+
gender?: string | null;
|
|
8
|
+
address?: string | null;
|
|
5
9
|
hasDisability: boolean;
|
|
6
10
|
disabilityDescription?: string | null;
|
|
7
11
|
initialObservation?: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-patient.dto.d.ts","sourceRoot":"","sources":["../../src/patients/create-patient.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-patient.dto.d.ts","sourceRoot":"","sources":["../../src/patients/create-patient.dto.ts"],"names":[],"mappings":"AAaA,qBAAa,gBAAgB;IAS3B,IAAI,EAAE,MAAM,CAAC;IAUb,GAAG,EAAE,MAAM,CAAC;IAOZ,SAAS,EAAE,MAAM,CAAC;IAUlB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAUtB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAUtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAUvB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAOxB,aAAa,EAAE,OAAO,CAAC;IAWvB,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAUtC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAYnC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B"}
|
|
@@ -17,6 +17,10 @@ class CreatePatientDto {
|
|
|
17
17
|
name;
|
|
18
18
|
cpf;
|
|
19
19
|
birthDate;
|
|
20
|
+
email;
|
|
21
|
+
phone;
|
|
22
|
+
gender;
|
|
23
|
+
address;
|
|
20
24
|
hasDisability;
|
|
21
25
|
disabilityDescription;
|
|
22
26
|
initialObservation;
|
|
@@ -53,6 +57,50 @@ __decorate([
|
|
|
53
57
|
(0, class_validator_1.IsDateString)(),
|
|
54
58
|
__metadata("design:type", String)
|
|
55
59
|
], CreatePatientDto.prototype, "birthDate", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
62
|
+
description: 'E-mail do paciente',
|
|
63
|
+
example: 'joao.silva@email.com',
|
|
64
|
+
maxLength: 255,
|
|
65
|
+
}),
|
|
66
|
+
(0, class_validator_1.IsOptional)(),
|
|
67
|
+
(0, class_validator_1.IsEmail)({}, { message: 'email deve ser um e-mail válido' }),
|
|
68
|
+
(0, class_validator_1.MaxLength)(255),
|
|
69
|
+
__metadata("design:type", Object)
|
|
70
|
+
], CreatePatientDto.prototype, "email", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
73
|
+
description: 'Telefone de contato do paciente',
|
|
74
|
+
example: '+55 11 99999-9999',
|
|
75
|
+
maxLength: 30,
|
|
76
|
+
}),
|
|
77
|
+
(0, class_validator_1.IsString)(),
|
|
78
|
+
(0, class_validator_1.IsOptional)(),
|
|
79
|
+
(0, class_validator_1.MaxLength)(30),
|
|
80
|
+
__metadata("design:type", Object)
|
|
81
|
+
], CreatePatientDto.prototype, "phone", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
84
|
+
description: 'Gênero do paciente',
|
|
85
|
+
example: 'masculino',
|
|
86
|
+
maxLength: 50,
|
|
87
|
+
}),
|
|
88
|
+
(0, class_validator_1.IsString)(),
|
|
89
|
+
(0, class_validator_1.IsOptional)(),
|
|
90
|
+
(0, class_validator_1.MaxLength)(50),
|
|
91
|
+
__metadata("design:type", Object)
|
|
92
|
+
], CreatePatientDto.prototype, "gender", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
95
|
+
description: 'Endereço completo do paciente',
|
|
96
|
+
example: 'Rua Exemplo, 123 - São Paulo/SP',
|
|
97
|
+
maxLength: 500,
|
|
98
|
+
}),
|
|
99
|
+
(0, class_validator_1.IsString)(),
|
|
100
|
+
(0, class_validator_1.IsOptional)(),
|
|
101
|
+
(0, class_validator_1.MaxLength)(500),
|
|
102
|
+
__metadata("design:type", Object)
|
|
103
|
+
], CreatePatientDto.prototype, "address", void 0);
|
|
56
104
|
__decorate([
|
|
57
105
|
(0, swagger_1.ApiProperty)({
|
|
58
106
|
description: 'Indica se o paciente possui alguma deficiência',
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
export declare class CreateProcedureDto {
|
|
2
2
|
name: string;
|
|
3
|
+
category?: string | null;
|
|
4
|
+
description?: string | null;
|
|
5
|
+
blockTime?: number | null;
|
|
6
|
+
defaultValue?: number | null;
|
|
7
|
+
returnDays?: number | null;
|
|
3
8
|
value: number;
|
|
4
9
|
duration: number;
|
|
5
10
|
side_effects?: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-procedure.dto.d.ts","sourceRoot":"","sources":["../../src/procedures/create-procedure.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-procedure.dto.d.ts","sourceRoot":"","sources":["../../src/procedures/create-procedure.dto.ts"],"names":[],"mappings":"AAYA,qBAAa,kBAAkB;IAS7B,IAAI,EAAE,MAAM,CAAC;IAUb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAUzB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAS5B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAS1B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAS7B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ3B,KAAK,EAAE,MAAM,CAAC;IAQd,QAAQ,EAAE,MAAM,CAAC;IAUjB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ7B,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -14,6 +14,11 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
class CreateProcedureDto {
|
|
16
16
|
name;
|
|
17
|
+
category;
|
|
18
|
+
description;
|
|
19
|
+
blockTime;
|
|
20
|
+
defaultValue;
|
|
21
|
+
returnDays;
|
|
17
22
|
value;
|
|
18
23
|
duration;
|
|
19
24
|
side_effects;
|
|
@@ -31,6 +36,58 @@ __decorate([
|
|
|
31
36
|
(0, class_validator_1.MaxLength)(255),
|
|
32
37
|
__metadata("design:type", String)
|
|
33
38
|
], CreateProcedureDto.prototype, "name", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
41
|
+
description: 'Categoria do procedimento',
|
|
42
|
+
example: 'Consulta',
|
|
43
|
+
maxLength: 100,
|
|
44
|
+
}),
|
|
45
|
+
(0, class_validator_1.IsString)(),
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
(0, class_validator_1.MaxLength)(100),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], CreateProcedureDto.prototype, "category", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
52
|
+
description: 'Descrição detalhada do procedimento',
|
|
53
|
+
example: 'Consulta clínica com anamnese e avaliação geral',
|
|
54
|
+
maxLength: 5000,
|
|
55
|
+
}),
|
|
56
|
+
(0, class_validator_1.IsString)(),
|
|
57
|
+
(0, class_validator_1.IsOptional)(),
|
|
58
|
+
(0, class_validator_1.MaxLength)(5000),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], CreateProcedureDto.prototype, "description", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
63
|
+
description: 'Tempo de bloqueio da agenda em minutos',
|
|
64
|
+
example: 30,
|
|
65
|
+
}),
|
|
66
|
+
(0, class_validator_1.IsInt)(),
|
|
67
|
+
(0, class_validator_1.IsOptional)(),
|
|
68
|
+
(0, class_validator_1.Min)(1),
|
|
69
|
+
__metadata("design:type", Object)
|
|
70
|
+
], CreateProcedureDto.prototype, "blockTime", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
73
|
+
description: 'Valor padrão sugerido para o procedimento',
|
|
74
|
+
example: 150.5,
|
|
75
|
+
}),
|
|
76
|
+
(0, class_validator_1.IsNumber)({ maxDecimalPlaces: 2 }),
|
|
77
|
+
(0, class_validator_1.IsOptional)(),
|
|
78
|
+
(0, class_validator_1.Min)(0),
|
|
79
|
+
__metadata("design:type", Object)
|
|
80
|
+
], CreateProcedureDto.prototype, "defaultValue", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
83
|
+
description: 'Quantidade de dias sugerida para retorno',
|
|
84
|
+
example: 30,
|
|
85
|
+
}),
|
|
86
|
+
(0, class_validator_1.IsInt)(),
|
|
87
|
+
(0, class_validator_1.IsOptional)(),
|
|
88
|
+
(0, class_validator_1.Min)(0),
|
|
89
|
+
__metadata("design:type", Object)
|
|
90
|
+
], CreateProcedureDto.prototype, "returnDays", void 0);
|
|
34
91
|
__decorate([
|
|
35
92
|
(0, swagger_1.ApiProperty)({
|
|
36
93
|
description: 'Valor monetário do procedimento',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-object.dto.d.ts","sourceRoot":"","sources":["../../src/storage/delete-object.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,eAAe;IAQ1B,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.DeleteObjectDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class DeleteObjectDto {
|
|
16
|
+
key;
|
|
17
|
+
}
|
|
18
|
+
exports.DeleteObjectDto = DeleteObjectDto;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, swagger_1.ApiProperty)({
|
|
21
|
+
description: 'Object key (path) inside the bucket to delete',
|
|
22
|
+
example: 'tenants/acme/uploads/photo.jpg',
|
|
23
|
+
}),
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
26
|
+
(0, class_validator_1.MaxLength)(1024),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], DeleteObjectDto.prototype, "key", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exists-query.dto.d.ts","sourceRoot":"","sources":["../../src/storage/exists-query.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,cAAc;IAQzB,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.ExistsQueryDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class ExistsQueryDto {
|
|
16
|
+
key;
|
|
17
|
+
}
|
|
18
|
+
exports.ExistsQueryDto = ExistsQueryDto;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, swagger_1.ApiProperty)({
|
|
21
|
+
description: 'Object key (path) inside the bucket',
|
|
22
|
+
example: 'tenants/acme/uploads/photo.jpg',
|
|
23
|
+
}),
|
|
24
|
+
(0, class_validator_1.IsString)(),
|
|
25
|
+
(0, class_validator_1.MinLength)(1),
|
|
26
|
+
(0, class_validator_1.MaxLength)(1024),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], ExistsQueryDto.prototype, "key", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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("./presign-upload.dto"), exports);
|
|
18
|
+
__exportStar(require("./presign-download-query.dto"), exports);
|
|
19
|
+
__exportStar(require("./delete-object.dto"), exports);
|
|
20
|
+
__exportStar(require("./presigned-url-response.dto"), exports);
|
|
21
|
+
__exportStar(require("./exists-query.dto"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presign-download-query.dto.d.ts","sourceRoot":"","sources":["../../src/storage/presign-download-query.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,uBAAuB;IAQlC,GAAG,EAAE,MAAM,CAAC;IAYZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
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.PresignDownloadQueryDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class PresignDownloadQueryDto {
|
|
16
|
+
key;
|
|
17
|
+
expiresInSeconds;
|
|
18
|
+
}
|
|
19
|
+
exports.PresignDownloadQueryDto = PresignDownloadQueryDto;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, swagger_1.ApiProperty)({
|
|
22
|
+
description: 'Object key (path) inside the bucket',
|
|
23
|
+
example: 'tenants/acme/uploads/photo.jpg',
|
|
24
|
+
}),
|
|
25
|
+
(0, class_validator_1.IsString)(),
|
|
26
|
+
(0, class_validator_1.MinLength)(1),
|
|
27
|
+
(0, class_validator_1.MaxLength)(1024),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], PresignDownloadQueryDto.prototype, "key", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
32
|
+
description: 'Presigned URL lifetime in seconds (default from server config)',
|
|
33
|
+
example: 900,
|
|
34
|
+
minimum: 60,
|
|
35
|
+
maximum: 604800,
|
|
36
|
+
}),
|
|
37
|
+
(0, class_validator_1.IsOptional)(),
|
|
38
|
+
(0, class_validator_1.IsInt)(),
|
|
39
|
+
(0, class_validator_1.Min)(60),
|
|
40
|
+
(0, class_validator_1.Max)(604800),
|
|
41
|
+
__metadata("design:type", Number)
|
|
42
|
+
], PresignDownloadQueryDto.prototype, "expiresInSeconds", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presign-upload.dto.d.ts","sourceRoot":"","sources":["../../src/storage/presign-upload.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,gBAAgB;IAQ3B,GAAG,EAAE,MAAM,CAAC;IAQZ,WAAW,EAAE,MAAM,CAAC;IAYpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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.PresignUploadDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
class PresignUploadDto {
|
|
16
|
+
key;
|
|
17
|
+
contentType;
|
|
18
|
+
expiresInSeconds;
|
|
19
|
+
}
|
|
20
|
+
exports.PresignUploadDto = PresignUploadDto;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, swagger_1.ApiProperty)({
|
|
23
|
+
description: 'Object key (path) inside the bucket, e.g. tenants/acme/uploads/photo.jpg',
|
|
24
|
+
example: 'tenants/acme/uploads/photo.jpg',
|
|
25
|
+
}),
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
27
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
28
|
+
(0, class_validator_1.MaxLength)(1024),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], PresignUploadDto.prototype, "key", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, swagger_1.ApiProperty)({
|
|
33
|
+
description: 'MIME type the client will send with the PUT request',
|
|
34
|
+
example: 'image/jpeg',
|
|
35
|
+
}),
|
|
36
|
+
(0, class_validator_1.IsString)(),
|
|
37
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], PresignUploadDto.prototype, "contentType", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
42
|
+
description: 'Presigned URL lifetime in seconds (default from server config)',
|
|
43
|
+
example: 900,
|
|
44
|
+
minimum: 60,
|
|
45
|
+
maximum: 604800,
|
|
46
|
+
}),
|
|
47
|
+
(0, class_validator_1.IsOptional)(),
|
|
48
|
+
(0, class_validator_1.IsInt)(),
|
|
49
|
+
(0, class_validator_1.Min)(60),
|
|
50
|
+
(0, class_validator_1.Max)(604800),
|
|
51
|
+
__metadata("design:type", Number)
|
|
52
|
+
], PresignUploadDto.prototype, "expiresInSeconds", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presigned-url-response.dto.d.ts","sourceRoot":"","sources":["../../src/storage/presigned-url-response.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,uBAAuB;IAElC,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;IAGtB,GAAG,EAAE,MAAM,CAAC;IAGZ,GAAG,EAAE,MAAM,CAAC;IAGZ,SAAS,EAAE,MAAM,CAAC;IAGlB,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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.PresignedUrlResponseDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
class PresignedUrlResponseDto {
|
|
15
|
+
method;
|
|
16
|
+
url;
|
|
17
|
+
key;
|
|
18
|
+
expiresAt;
|
|
19
|
+
expiresInSeconds;
|
|
20
|
+
}
|
|
21
|
+
exports.PresignedUrlResponseDto = PresignedUrlResponseDto;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, swagger_1.ApiProperty)({ description: 'HTTP method to use with the presigned URL', example: 'PUT' }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], PresignedUrlResponseDto.prototype, "method", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, swagger_1.ApiProperty)({ description: 'Presigned URL' }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], PresignedUrlResponseDto.prototype, "url", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, swagger_1.ApiProperty)({ description: 'Object key in the bucket' }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], PresignedUrlResponseDto.prototype, "key", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, swagger_1.ApiProperty)({ description: 'Unix timestamp (ms) when the URL expires' }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], PresignedUrlResponseDto.prototype, "expiresAt", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, swagger_1.ApiProperty)({ description: 'Lifetime used for signing, in seconds' }),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], PresignedUrlResponseDto.prototype, "expiresInSeconds", void 0);
|
|
@@ -6,7 +6,7 @@ export declare const CREATABLE_USER_ROLES: readonly ["attendant", "health_profes
|
|
|
6
6
|
export type CreatableUserRole = (typeof CREATABLE_USER_ROLES)[number];
|
|
7
7
|
export declare class CreateUserDto {
|
|
8
8
|
name: string;
|
|
9
|
-
|
|
9
|
+
email: string;
|
|
10
10
|
password: string;
|
|
11
11
|
role: CreatableUserRole;
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-user.dto.d.ts","sourceRoot":"","sources":["../../src/users/create-user.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-user.dto.d.ts","sourceRoot":"","sources":["../../src/users/create-user.dto.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,+CAAgD,CAAC;AAClF,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,qBAAa,aAAa;IASxB,IAAI,EAAE,MAAM,CAAC;IAWb,KAAK,EAAE,MAAM,CAAC;IAUd,QAAQ,EAAE,MAAM,CAAC;IAWjB,IAAI,EAAE,iBAAiB,CAAC;CACzB"}
|
|
@@ -19,7 +19,7 @@ const class_validator_1 = require("class-validator");
|
|
|
19
19
|
exports.CREATABLE_USER_ROLES = ['attendant', 'health_professional'];
|
|
20
20
|
class CreateUserDto {
|
|
21
21
|
name;
|
|
22
|
-
|
|
22
|
+
email;
|
|
23
23
|
password;
|
|
24
24
|
role;
|
|
25
25
|
}
|
|
@@ -37,15 +37,16 @@ __decorate([
|
|
|
37
37
|
], CreateUserDto.prototype, "name", void 0);
|
|
38
38
|
__decorate([
|
|
39
39
|
(0, swagger_1.ApiProperty)({
|
|
40
|
-
description: '
|
|
41
|
-
example: 'maria.silva',
|
|
40
|
+
description: 'E-mail do usuário (único no tenant)',
|
|
41
|
+
example: 'maria.silva@empresa.com',
|
|
42
42
|
maxLength: 255,
|
|
43
43
|
}),
|
|
44
|
+
(0, class_validator_1.IsEmail)({}, { message: 'email deve ser um e-mail válido' }),
|
|
44
45
|
(0, class_validator_1.IsString)(),
|
|
45
|
-
(0, class_validator_1.MinLength)(1, { message: '
|
|
46
|
+
(0, class_validator_1.MinLength)(1, { message: 'email não pode ser vazio' }),
|
|
46
47
|
(0, class_validator_1.MaxLength)(255),
|
|
47
48
|
__metadata("design:type", String)
|
|
48
|
-
], CreateUserDto.prototype, "
|
|
49
|
+
], CreateUserDto.prototype, "email", void 0);
|
|
49
50
|
__decorate([
|
|
50
51
|
(0, swagger_1.ApiProperty)({
|
|
51
52
|
description: 'Senha (será hasheada com bcrypt)',
|
package/package.json
CHANGED
package/src/auth/login.dto.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
-
import { IsString, MinLength } from 'class-validator';
|
|
2
|
+
import { IsEmail, IsString, MinLength } from 'class-validator';
|
|
3
3
|
|
|
4
4
|
export class LoginDto {
|
|
5
|
-
@ApiProperty({ description: '
|
|
5
|
+
@ApiProperty({ description: 'E-mail do usuário', example: 'usuario@empresa.com' })
|
|
6
|
+
@IsEmail({}, { message: 'email deve ser um e-mail válido' })
|
|
6
7
|
@IsString()
|
|
7
|
-
@MinLength(1, { message: '
|
|
8
|
-
|
|
8
|
+
@MinLength(1, { message: 'email não pode ser vazio' })
|
|
9
|
+
email: string;
|
|
9
10
|
|
|
10
11
|
@ApiProperty({ description: 'Senha do usuário', example: 'senha123' })
|
|
11
12
|
@IsString()
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
2
2
|
import {
|
|
3
3
|
IsBoolean,
|
|
4
4
|
IsDateString,
|
|
5
|
+
IsEmail,
|
|
5
6
|
IsNotEmpty,
|
|
6
7
|
IsOptional,
|
|
7
8
|
IsString,
|
|
@@ -38,6 +39,46 @@ export class CreatePatientDto {
|
|
|
38
39
|
@IsDateString()
|
|
39
40
|
birthDate: string;
|
|
40
41
|
|
|
42
|
+
@ApiPropertyOptional({
|
|
43
|
+
description: 'E-mail do paciente',
|
|
44
|
+
example: 'joao.silva@email.com',
|
|
45
|
+
maxLength: 255,
|
|
46
|
+
})
|
|
47
|
+
@IsOptional()
|
|
48
|
+
@IsEmail({}, { message: 'email deve ser um e-mail válido' })
|
|
49
|
+
@MaxLength(255)
|
|
50
|
+
email?: string | null;
|
|
51
|
+
|
|
52
|
+
@ApiPropertyOptional({
|
|
53
|
+
description: 'Telefone de contato do paciente',
|
|
54
|
+
example: '+55 11 99999-9999',
|
|
55
|
+
maxLength: 30,
|
|
56
|
+
})
|
|
57
|
+
@IsString()
|
|
58
|
+
@IsOptional()
|
|
59
|
+
@MaxLength(30)
|
|
60
|
+
phone?: string | null;
|
|
61
|
+
|
|
62
|
+
@ApiPropertyOptional({
|
|
63
|
+
description: 'Gênero do paciente',
|
|
64
|
+
example: 'masculino',
|
|
65
|
+
maxLength: 50,
|
|
66
|
+
})
|
|
67
|
+
@IsString()
|
|
68
|
+
@IsOptional()
|
|
69
|
+
@MaxLength(50)
|
|
70
|
+
gender?: string | null;
|
|
71
|
+
|
|
72
|
+
@ApiPropertyOptional({
|
|
73
|
+
description: 'Endereço completo do paciente',
|
|
74
|
+
example: 'Rua Exemplo, 123 - São Paulo/SP',
|
|
75
|
+
maxLength: 500,
|
|
76
|
+
})
|
|
77
|
+
@IsString()
|
|
78
|
+
@IsOptional()
|
|
79
|
+
@MaxLength(500)
|
|
80
|
+
address?: string | null;
|
|
81
|
+
|
|
41
82
|
@ApiProperty({
|
|
42
83
|
description: 'Indica se o paciente possui alguma deficiência',
|
|
43
84
|
example: true,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
2
|
import {
|
|
3
|
+
IsInt,
|
|
3
4
|
IsNotEmpty,
|
|
4
5
|
IsNumber,
|
|
5
6
|
IsOptional,
|
|
@@ -20,6 +21,53 @@ export class CreateProcedureDto {
|
|
|
20
21
|
@MaxLength(255)
|
|
21
22
|
name: string;
|
|
22
23
|
|
|
24
|
+
@ApiPropertyOptional({
|
|
25
|
+
description: 'Categoria do procedimento',
|
|
26
|
+
example: 'Consulta',
|
|
27
|
+
maxLength: 100,
|
|
28
|
+
})
|
|
29
|
+
@IsString()
|
|
30
|
+
@IsOptional()
|
|
31
|
+
@MaxLength(100)
|
|
32
|
+
category?: string | null;
|
|
33
|
+
|
|
34
|
+
@ApiPropertyOptional({
|
|
35
|
+
description: 'Descrição detalhada do procedimento',
|
|
36
|
+
example: 'Consulta clínica com anamnese e avaliação geral',
|
|
37
|
+
maxLength: 5000,
|
|
38
|
+
})
|
|
39
|
+
@IsString()
|
|
40
|
+
@IsOptional()
|
|
41
|
+
@MaxLength(5000)
|
|
42
|
+
description?: string | null;
|
|
43
|
+
|
|
44
|
+
@ApiPropertyOptional({
|
|
45
|
+
description: 'Tempo de bloqueio da agenda em minutos',
|
|
46
|
+
example: 30,
|
|
47
|
+
})
|
|
48
|
+
@IsInt()
|
|
49
|
+
@IsOptional()
|
|
50
|
+
@Min(1)
|
|
51
|
+
blockTime?: number | null;
|
|
52
|
+
|
|
53
|
+
@ApiPropertyOptional({
|
|
54
|
+
description: 'Valor padrão sugerido para o procedimento',
|
|
55
|
+
example: 150.5,
|
|
56
|
+
})
|
|
57
|
+
@IsNumber({ maxDecimalPlaces: 2 })
|
|
58
|
+
@IsOptional()
|
|
59
|
+
@Min(0)
|
|
60
|
+
defaultValue?: number | null;
|
|
61
|
+
|
|
62
|
+
@ApiPropertyOptional({
|
|
63
|
+
description: 'Quantidade de dias sugerida para retorno',
|
|
64
|
+
example: 30,
|
|
65
|
+
})
|
|
66
|
+
@IsInt()
|
|
67
|
+
@IsOptional()
|
|
68
|
+
@Min(0)
|
|
69
|
+
returnDays?: number | null;
|
|
70
|
+
|
|
23
71
|
@ApiProperty({
|
|
24
72
|
description: 'Valor monetário do procedimento',
|
|
25
73
|
example: 150.5,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { IsNotEmpty, IsString, MaxLength } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
export class DeleteObjectDto {
|
|
5
|
+
@ApiProperty({
|
|
6
|
+
description: 'Object key (path) inside the bucket to delete',
|
|
7
|
+
example: 'tenants/acme/uploads/photo.jpg',
|
|
8
|
+
})
|
|
9
|
+
@IsString()
|
|
10
|
+
@IsNotEmpty()
|
|
11
|
+
@MaxLength(1024)
|
|
12
|
+
key: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { IsString, MaxLength, MinLength } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
export class ExistsQueryDto {
|
|
5
|
+
@ApiProperty({
|
|
6
|
+
description: 'Object key (path) inside the bucket',
|
|
7
|
+
example: 'tenants/acme/uploads/photo.jpg',
|
|
8
|
+
})
|
|
9
|
+
@IsString()
|
|
10
|
+
@MinLength(1)
|
|
11
|
+
@MaxLength(1024)
|
|
12
|
+
key: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import { IsInt, IsOptional, IsString, Max, MaxLength, Min, MinLength } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
export class PresignDownloadQueryDto {
|
|
5
|
+
@ApiProperty({
|
|
6
|
+
description: 'Object key (path) inside the bucket',
|
|
7
|
+
example: 'tenants/acme/uploads/photo.jpg',
|
|
8
|
+
})
|
|
9
|
+
@IsString()
|
|
10
|
+
@MinLength(1)
|
|
11
|
+
@MaxLength(1024)
|
|
12
|
+
key: string;
|
|
13
|
+
|
|
14
|
+
@ApiPropertyOptional({
|
|
15
|
+
description: 'Presigned URL lifetime in seconds (default from server config)',
|
|
16
|
+
example: 900,
|
|
17
|
+
minimum: 60,
|
|
18
|
+
maximum: 604800,
|
|
19
|
+
})
|
|
20
|
+
@IsOptional()
|
|
21
|
+
@IsInt()
|
|
22
|
+
@Min(60)
|
|
23
|
+
@Max(604800)
|
|
24
|
+
expiresInSeconds?: number;
|
|
25
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
2
|
+
import { IsInt, IsNotEmpty, IsOptional, IsString, Max, MaxLength, Min } from 'class-validator';
|
|
3
|
+
|
|
4
|
+
export class PresignUploadDto {
|
|
5
|
+
@ApiProperty({
|
|
6
|
+
description: 'Object key (path) inside the bucket, e.g. tenants/acme/uploads/photo.jpg',
|
|
7
|
+
example: 'tenants/acme/uploads/photo.jpg',
|
|
8
|
+
})
|
|
9
|
+
@IsString()
|
|
10
|
+
@IsNotEmpty()
|
|
11
|
+
@MaxLength(1024)
|
|
12
|
+
key: string;
|
|
13
|
+
|
|
14
|
+
@ApiProperty({
|
|
15
|
+
description: 'MIME type the client will send with the PUT request',
|
|
16
|
+
example: 'image/jpeg',
|
|
17
|
+
})
|
|
18
|
+
@IsString()
|
|
19
|
+
@IsNotEmpty()
|
|
20
|
+
contentType: string;
|
|
21
|
+
|
|
22
|
+
@ApiPropertyOptional({
|
|
23
|
+
description: 'Presigned URL lifetime in seconds (default from server config)',
|
|
24
|
+
example: 900,
|
|
25
|
+
minimum: 60,
|
|
26
|
+
maximum: 604800,
|
|
27
|
+
})
|
|
28
|
+
@IsOptional()
|
|
29
|
+
@IsInt()
|
|
30
|
+
@Min(60)
|
|
31
|
+
@Max(604800)
|
|
32
|
+
expiresInSeconds?: number;
|
|
33
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
|
|
3
|
+
export class PresignedUrlResponseDto {
|
|
4
|
+
@ApiProperty({ description: 'HTTP method to use with the presigned URL', example: 'PUT' })
|
|
5
|
+
method: 'PUT' | 'GET';
|
|
6
|
+
|
|
7
|
+
@ApiProperty({ description: 'Presigned URL' })
|
|
8
|
+
url: string;
|
|
9
|
+
|
|
10
|
+
@ApiProperty({ description: 'Object key in the bucket' })
|
|
11
|
+
key: string;
|
|
12
|
+
|
|
13
|
+
@ApiProperty({ description: 'Unix timestamp (ms) when the URL expires' })
|
|
14
|
+
expiresAt: number;
|
|
15
|
+
|
|
16
|
+
@ApiProperty({ description: 'Lifetime used for signing, in seconds' })
|
|
17
|
+
expiresInSeconds: number;
|
|
18
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiProperty } from '@nestjs/swagger';
|
|
2
2
|
import {
|
|
3
|
+
IsEmail,
|
|
3
4
|
IsString,
|
|
4
5
|
IsIn,
|
|
5
6
|
MinLength,
|
|
@@ -25,14 +26,15 @@ export class CreateUserDto {
|
|
|
25
26
|
name: string;
|
|
26
27
|
|
|
27
28
|
@ApiProperty({
|
|
28
|
-
description: '
|
|
29
|
-
example: 'maria.silva',
|
|
29
|
+
description: 'E-mail do usuário (único no tenant)',
|
|
30
|
+
example: 'maria.silva@empresa.com',
|
|
30
31
|
maxLength: 255,
|
|
31
32
|
})
|
|
33
|
+
@IsEmail({}, { message: 'email deve ser um e-mail válido' })
|
|
32
34
|
@IsString()
|
|
33
|
-
@MinLength(1, { message: '
|
|
35
|
+
@MinLength(1, { message: 'email não pode ser vazio' })
|
|
34
36
|
@MaxLength(255)
|
|
35
|
-
|
|
37
|
+
email: string;
|
|
36
38
|
|
|
37
39
|
@ApiProperty({
|
|
38
40
|
description: 'Senha (será hasheada com bcrypt)',
|
|
Binary file
|