@fiado/type-kit 3.626.0 → 3.627.0
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/_test_/unit/emailVerification/dtos/EmailSetTrustedRequest.test.ts +23 -0
- package/bin/emailVerification/dtos/EmailSetTrustedRequest.d.ts +2 -0
- package/bin/emailVerification/dtos/EmailSetTrustedRequest.js +6 -0
- package/package.json +1 -1
- package/src/emailVerification/dtos/EmailSetTrustedRequest.ts +6 -0
|
@@ -66,4 +66,27 @@ describe('EmailSetTrustedRequest', () => {
|
|
|
66
66
|
const errors = await validate(dto);
|
|
67
67
|
expect(errors.some(e => e.property === 'isPrincipal')).toBe(true);
|
|
68
68
|
});
|
|
69
|
+
|
|
70
|
+
it('acepta dedup en true', async () => {
|
|
71
|
+
const dto = plainToInstance(EmailSetTrustedRequest, { ...valid, dedup: true });
|
|
72
|
+
const errors = await validate(dto);
|
|
73
|
+
expect(errors).toEqual([]);
|
|
74
|
+
expect(dto.dedup).toBe(true);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('acepta la ausencia de dedup', async () => {
|
|
78
|
+
const dto = plainToInstance(EmailSetTrustedRequest, valid);
|
|
79
|
+
const errors = await validate(dto);
|
|
80
|
+
expect(errors).toEqual([]);
|
|
81
|
+
expect(dto.dedup).toBeUndefined();
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('falla si dedup no es booleano', async () => {
|
|
85
|
+
const dto = plainToInstance(EmailSetTrustedRequest, {
|
|
86
|
+
...valid,
|
|
87
|
+
dedup: 'si' as unknown as boolean,
|
|
88
|
+
});
|
|
89
|
+
const errors = await validate(dto);
|
|
90
|
+
expect(errors.some(e => e.property === 'dedup')).toBe(true);
|
|
91
|
+
});
|
|
69
92
|
});
|
|
@@ -9,4 +9,6 @@ export declare class EmailSetTrustedRequest {
|
|
|
9
9
|
type: EmailTypeEnum;
|
|
10
10
|
/** En true, el correo queda como principal del directorio. Sin el campo, no cambia el principal. */
|
|
11
11
|
isPrincipal?: boolean;
|
|
12
|
+
/** En true, rechaza el correo si otro directorio ya lo tiene verificado. Sin el campo, no lo revisa. */
|
|
13
|
+
dedup?: boolean;
|
|
12
14
|
}
|
|
@@ -41,3 +41,9 @@ __decorate([
|
|
|
41
41
|
(0, class_validator_1.IsBoolean)(),
|
|
42
42
|
__metadata("design:type", Boolean)
|
|
43
43
|
], EmailSetTrustedRequest.prototype, "isPrincipal", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, class_transformer_1.Expose)(),
|
|
46
|
+
(0, class_validator_1.IsOptional)(),
|
|
47
|
+
(0, class_validator_1.IsBoolean)(),
|
|
48
|
+
__metadata("design:type", Boolean)
|
|
49
|
+
], EmailSetTrustedRequest.prototype, "dedup", void 0);
|
package/package.json
CHANGED
|
@@ -24,4 +24,10 @@ export class EmailSetTrustedRequest {
|
|
|
24
24
|
@IsOptional()
|
|
25
25
|
@IsBoolean()
|
|
26
26
|
isPrincipal?: boolean;
|
|
27
|
+
|
|
28
|
+
/** En true, rechaza el correo si otro directorio ya lo tiene verificado. Sin el campo, no lo revisa. */
|
|
29
|
+
@Expose()
|
|
30
|
+
@IsOptional()
|
|
31
|
+
@IsBoolean()
|
|
32
|
+
dedup?: boolean;
|
|
27
33
|
}
|