@fiado/type-kit 3.41.0 → 3.43.1
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/platformRbac/auth/dtos.test.ts +42 -0
- package/bin/benefitCenter/dtos/BackofficeLeafCreateRequest.d.ts +35 -0
- package/bin/benefitCenter/dtos/BackofficeLeafCreateRequest.js +95 -0
- package/bin/benefitCenter/dtos/BackofficeProductCreateItem.d.ts +33 -0
- package/bin/benefitCenter/dtos/BackofficeProductCreateItem.js +84 -0
- package/bin/benefitCenter/enums/ReferenceTypeEnum.d.ts +14 -0
- package/bin/benefitCenter/enums/ReferenceTypeEnum.js +18 -0
- package/bin/benefitCenter/index.d.ts +3 -0
- package/bin/benefitCenter/index.js +4 -0
- package/bin/platformRbac/auth/DefineNextChallengeRequest.d.ts +11 -0
- package/bin/platformRbac/auth/DefineNextChallengeRequest.js +44 -0
- package/bin/platformRbac/auth/DefineNextChallengeResponse.d.ts +6 -0
- package/bin/platformRbac/auth/DefineNextChallengeResponse.js +30 -0
- package/bin/platformRbac/auth/NewPasswordRequest.d.ts +4 -0
- package/bin/platformRbac/auth/NewPasswordRequest.js +25 -0
- package/bin/platformRbac/auth/PrepareChallengeRequest.d.ts +6 -0
- package/bin/platformRbac/auth/PrepareChallengeRequest.js +29 -0
- package/bin/platformRbac/auth/PrepareChallengeResponse.d.ts +4 -0
- package/bin/platformRbac/auth/PrepareChallengeResponse.js +24 -0
- package/bin/platformRbac/auth/ResetPasswordRequest.d.ts +5 -0
- package/bin/platformRbac/auth/ResetPasswordRequest.js +30 -0
- package/bin/platformRbac/auth/VerifyChallengeRequest.d.ts +7 -0
- package/bin/platformRbac/auth/VerifyChallengeRequest.js +33 -0
- package/bin/platformRbac/auth/VerifyChallengeResponse.d.ts +3 -0
- package/bin/platformRbac/auth/VerifyChallengeResponse.js +20 -0
- package/bin/platformRbac/enums/ChallengeNameEnum.d.ts +7 -0
- package/bin/platformRbac/enums/ChallengeNameEnum.js +11 -0
- package/bin/platformRbac/enums/MfaMethodEnum.d.ts +4 -0
- package/bin/platformRbac/enums/MfaMethodEnum.js +8 -0
- package/bin/platformRbac/index.d.ts +14 -0
- package/bin/platformRbac/index.js +30 -0
- package/bin/platformRbac/mfa/ChangeMfaMethodRequest.d.ts +5 -0
- package/bin/platformRbac/mfa/ChangeMfaMethodRequest.js +25 -0
- package/bin/platformRbac/mfa/EnrollTotpResponse.d.ts +5 -0
- package/bin/platformRbac/mfa/EnrollTotpResponse.js +28 -0
- package/bin/platformRbac/mfa/MfaStatusResponse.d.ts +6 -0
- package/bin/platformRbac/mfa/MfaStatusResponse.js +30 -0
- package/bin/platformRbac/mfa/VerifyTotpEnrollmentRequest.d.ts +3 -0
- package/bin/platformRbac/mfa/VerifyTotpEnrollmentRequest.js +21 -0
- package/package.json +1 -1
- package/src/benefitCenter/dtos/BackofficeLeafCreateRequest.ts +90 -0
- package/src/benefitCenter/dtos/BackofficeProductCreateItem.ts +77 -0
- package/src/benefitCenter/enums/ReferenceTypeEnum.ts +14 -0
- package/src/benefitCenter/index.ts +4 -0
- package/src/platformRbac/auth/DefineNextChallengeRequest.ts +25 -0
- package/src/platformRbac/auth/DefineNextChallengeResponse.ts +14 -0
- package/src/platformRbac/auth/NewPasswordRequest.ts +10 -0
- package/src/platformRbac/auth/PrepareChallengeRequest.ts +13 -0
- package/src/platformRbac/auth/PrepareChallengeResponse.ts +9 -0
- package/src/platformRbac/auth/ResetPasswordRequest.ts +14 -0
- package/src/platformRbac/auth/VerifyChallengeRequest.ts +16 -0
- package/src/platformRbac/auth/VerifyChallengeResponse.ts +6 -0
- package/src/platformRbac/enums/ChallengeNameEnum.ts +7 -0
- package/src/platformRbac/enums/MfaMethodEnum.ts +4 -0
- package/src/platformRbac/index.ts +17 -0
- package/src/platformRbac/mfa/ChangeMfaMethodRequest.ts +10 -0
- package/src/platformRbac/mfa/EnrollTotpResponse.ts +12 -0
- package/src/platformRbac/mfa/MfaStatusResponse.ts +14 -0
- package/src/platformRbac/mfa/VerifyTotpEnrollmentRequest.ts +7 -0
|
@@ -0,0 +1,20 @@
|
|
|
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.VerifyChallengeResponse = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class VerifyChallengeResponse {
|
|
15
|
+
}
|
|
16
|
+
exports.VerifyChallengeResponse = VerifyChallengeResponse;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsBoolean)(),
|
|
19
|
+
__metadata("design:type", Boolean)
|
|
20
|
+
], VerifyChallengeResponse.prototype, "answerCorrect", void 0);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChallengeNameEnum = void 0;
|
|
4
|
+
var ChallengeNameEnum;
|
|
5
|
+
(function (ChallengeNameEnum) {
|
|
6
|
+
ChallengeNameEnum["PASSWORD"] = "PASSWORD";
|
|
7
|
+
ChallengeNameEnum["EMAIL_OTP"] = "EMAIL_OTP";
|
|
8
|
+
ChallengeNameEnum["TOTP"] = "TOTP";
|
|
9
|
+
ChallengeNameEnum["NEW_PASSWORD_REQUIRED"] = "NEW_PASSWORD_REQUIRED";
|
|
10
|
+
ChallengeNameEnum["RESET_PASSWORD"] = "RESET_PASSWORD";
|
|
11
|
+
})(ChallengeNameEnum || (exports.ChallengeNameEnum = ChallengeNameEnum = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MfaMethodEnum = void 0;
|
|
4
|
+
var MfaMethodEnum;
|
|
5
|
+
(function (MfaMethodEnum) {
|
|
6
|
+
MfaMethodEnum["EMAIL_OTP"] = "EMAIL_OTP";
|
|
7
|
+
MfaMethodEnum["TOTP"] = "TOTP";
|
|
8
|
+
})(MfaMethodEnum || (exports.MfaMethodEnum = MfaMethodEnum = {}));
|
|
@@ -4,3 +4,17 @@ export { PermissionCategory } from './enums/PermissionCategory';
|
|
|
4
4
|
export type { AuthContext } from './dtos/AuthContext';
|
|
5
5
|
export type { RoleAssignmentInfo } from './dtos/RoleAssignmentInfo';
|
|
6
6
|
export type { PermissionMeta } from './dtos/PermissionMeta';
|
|
7
|
+
export * from './enums/MfaMethodEnum';
|
|
8
|
+
export * from './enums/ChallengeNameEnum';
|
|
9
|
+
export * from './auth/DefineNextChallengeRequest';
|
|
10
|
+
export * from './auth/DefineNextChallengeResponse';
|
|
11
|
+
export * from './auth/PrepareChallengeRequest';
|
|
12
|
+
export * from './auth/PrepareChallengeResponse';
|
|
13
|
+
export * from './auth/VerifyChallengeRequest';
|
|
14
|
+
export * from './auth/VerifyChallengeResponse';
|
|
15
|
+
export * from './auth/NewPasswordRequest';
|
|
16
|
+
export * from './auth/ResetPasswordRequest';
|
|
17
|
+
export * from './mfa/EnrollTotpResponse';
|
|
18
|
+
export * from './mfa/VerifyTotpEnrollmentRequest';
|
|
19
|
+
export * from './mfa/ChangeMfaMethodRequest';
|
|
20
|
+
export * from './mfa/MfaStatusResponse';
|
|
@@ -8,6 +8,20 @@
|
|
|
8
8
|
// En Fase 1.A los DTOs propios del rbac-business (CreateTenantRequest, AssignRoleRequest,
|
|
9
9
|
// EffectivePermissionsResponse, etc.) NO viven en este módulo todavía — se agregan en
|
|
10
10
|
// Fase 1.B cuando los managers que los consumen se implementen.
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
23
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
24
|
+
};
|
|
11
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
26
|
exports.PermissionCategory = exports.PermissionScope = exports.Permission = void 0;
|
|
13
27
|
var Permission_1 = require("./enums/Permission");
|
|
@@ -16,3 +30,19 @@ var PermissionScope_1 = require("./enums/PermissionScope");
|
|
|
16
30
|
Object.defineProperty(exports, "PermissionScope", { enumerable: true, get: function () { return PermissionScope_1.PermissionScope; } });
|
|
17
31
|
var PermissionCategory_1 = require("./enums/PermissionCategory");
|
|
18
32
|
Object.defineProperty(exports, "PermissionCategory", { enumerable: true, get: function () { return PermissionCategory_1.PermissionCategory; } });
|
|
33
|
+
// Fase 1 — Custom Auth Challenge (Email OTP + TOTP) + MFA self-service.
|
|
34
|
+
// Class values (no type-only) — los DTOs llevan decoradores class-validator y se hidratan con plainToInstance en runtime.
|
|
35
|
+
__exportStar(require("./enums/MfaMethodEnum"), exports);
|
|
36
|
+
__exportStar(require("./enums/ChallengeNameEnum"), exports);
|
|
37
|
+
__exportStar(require("./auth/DefineNextChallengeRequest"), exports);
|
|
38
|
+
__exportStar(require("./auth/DefineNextChallengeResponse"), exports);
|
|
39
|
+
__exportStar(require("./auth/PrepareChallengeRequest"), exports);
|
|
40
|
+
__exportStar(require("./auth/PrepareChallengeResponse"), exports);
|
|
41
|
+
__exportStar(require("./auth/VerifyChallengeRequest"), exports);
|
|
42
|
+
__exportStar(require("./auth/VerifyChallengeResponse"), exports);
|
|
43
|
+
__exportStar(require("./auth/NewPasswordRequest"), exports);
|
|
44
|
+
__exportStar(require("./auth/ResetPasswordRequest"), exports);
|
|
45
|
+
__exportStar(require("./mfa/EnrollTotpResponse"), exports);
|
|
46
|
+
__exportStar(require("./mfa/VerifyTotpEnrollmentRequest"), exports);
|
|
47
|
+
__exportStar(require("./mfa/ChangeMfaMethodRequest"), exports);
|
|
48
|
+
__exportStar(require("./mfa/MfaStatusResponse"), exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
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.ChangeMfaMethodRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const MfaMethodEnum_1 = require("../enums/MfaMethodEnum");
|
|
15
|
+
class ChangeMfaMethodRequest {
|
|
16
|
+
}
|
|
17
|
+
exports.ChangeMfaMethodRequest = ChangeMfaMethodRequest;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsEnum)(MfaMethodEnum_1.MfaMethodEnum),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], ChangeMfaMethodRequest.prototype, "newMethod", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], ChangeMfaMethodRequest.prototype, "verificationCode", void 0);
|
|
@@ -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.EnrollTotpResponse = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class EnrollTotpResponse {
|
|
15
|
+
}
|
|
16
|
+
exports.EnrollTotpResponse = EnrollTotpResponse;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], EnrollTotpResponse.prototype, "qrCodeDataUrl", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsString)(),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], EnrollTotpResponse.prototype, "secret", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsString)(),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], EnrollTotpResponse.prototype, "issuer", void 0);
|
|
@@ -0,0 +1,30 @@
|
|
|
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.MfaStatusResponse = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const MfaMethodEnum_1 = require("../enums/MfaMethodEnum");
|
|
15
|
+
class MfaStatusResponse {
|
|
16
|
+
}
|
|
17
|
+
exports.MfaStatusResponse = MfaStatusResponse;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsEnum)(MfaMethodEnum_1.MfaMethodEnum),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], MfaStatusResponse.prototype, "currentMethod", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsArray)(),
|
|
24
|
+
(0, class_validator_1.IsEnum)(MfaMethodEnum_1.MfaMethodEnum, { each: true }),
|
|
25
|
+
__metadata("design:type", Array)
|
|
26
|
+
], MfaStatusResponse.prototype, "availableMethods", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsNumber)(),
|
|
29
|
+
__metadata("design:type", Number)
|
|
30
|
+
], MfaStatusResponse.prototype, "recoveryCodesRemaining", void 0);
|
|
@@ -0,0 +1,21 @@
|
|
|
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.VerifyTotpEnrollmentRequest = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class VerifyTotpEnrollmentRequest {
|
|
15
|
+
}
|
|
16
|
+
exports.VerifyTotpEnrollmentRequest = VerifyTotpEnrollmentRequest;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
(0, class_validator_1.Length)(6, 6),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], VerifyTotpEnrollmentRequest.prototype, "totpCode", void 0);
|
package/package.json
CHANGED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ArrayNotEmpty,
|
|
3
|
+
IsArray,
|
|
4
|
+
IsBoolean,
|
|
5
|
+
IsEnum,
|
|
6
|
+
IsInt,
|
|
7
|
+
IsNotEmpty,
|
|
8
|
+
IsOptional,
|
|
9
|
+
IsString,
|
|
10
|
+
Min,
|
|
11
|
+
ValidateNested,
|
|
12
|
+
} from "class-validator";
|
|
13
|
+
import { Type } from "class-transformer";
|
|
14
|
+
import { Provider } from "../../provider/enums/Provider";
|
|
15
|
+
import { BackofficeProductCreateItem } from "./BackofficeProductCreateItem";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Body de POST /backoffice/leaves — alta manual de un servicio nuevo en el
|
|
19
|
+
* catálogo, en forma estándar. bmb rutea por `provider` al conector destino,
|
|
20
|
+
* que traduce a su forma nativa y persiste.
|
|
21
|
+
*
|
|
22
|
+
* `serviceId` (idServicio) y los `productId` vienen del Excel del proveedor
|
|
23
|
+
* (ids reales). Si el `serviceId` ya existe → 409 (no sobrescribe).
|
|
24
|
+
*/
|
|
25
|
+
export class BackofficeLeafCreateRequest {
|
|
26
|
+
/** Determina el conector destino (STP vs multicomm). */
|
|
27
|
+
@IsEnum(Provider)
|
|
28
|
+
provider!: Provider;
|
|
29
|
+
|
|
30
|
+
/** "ben-3" (recargas) | "ben-6" (pagos). */
|
|
31
|
+
@IsString()
|
|
32
|
+
@IsNotEmpty()
|
|
33
|
+
benefitId!: string;
|
|
34
|
+
|
|
35
|
+
/** idServicio real del proveedor (del Excel). */
|
|
36
|
+
@IsString()
|
|
37
|
+
@IsNotEmpty()
|
|
38
|
+
serviceId!: string;
|
|
39
|
+
|
|
40
|
+
@IsString()
|
|
41
|
+
@IsNotEmpty()
|
|
42
|
+
serviceName!: string;
|
|
43
|
+
|
|
44
|
+
@IsString()
|
|
45
|
+
@IsNotEmpty()
|
|
46
|
+
category!: string;
|
|
47
|
+
|
|
48
|
+
@IsString()
|
|
49
|
+
@IsNotEmpty()
|
|
50
|
+
subcategory!: string;
|
|
51
|
+
|
|
52
|
+
/** Código de moneda ISO (ej. "MXN", "USD"). */
|
|
53
|
+
@IsString()
|
|
54
|
+
@IsNotEmpty()
|
|
55
|
+
currency!: string;
|
|
56
|
+
|
|
57
|
+
/** Código ISO numérico del país destino (ej. "484"). */
|
|
58
|
+
@IsString()
|
|
59
|
+
@IsNotEmpty()
|
|
60
|
+
countryId!: string;
|
|
61
|
+
|
|
62
|
+
/** Logo del servicio (→ logoSrc). */
|
|
63
|
+
@IsOptional()
|
|
64
|
+
@IsString()
|
|
65
|
+
logo?: string;
|
|
66
|
+
|
|
67
|
+
/** Orden del servicio dentro de su subcategoría. Default 1. */
|
|
68
|
+
@IsOptional()
|
|
69
|
+
@IsInt()
|
|
70
|
+
@Min(0)
|
|
71
|
+
serviceOrder?: number;
|
|
72
|
+
|
|
73
|
+
/** Orden de la subcategoría. Default 1. */
|
|
74
|
+
@IsOptional()
|
|
75
|
+
@IsInt()
|
|
76
|
+
@Min(0)
|
|
77
|
+
subcategoryOrder?: number;
|
|
78
|
+
|
|
79
|
+
/** Habilitado en el catálogo público. Default true. */
|
|
80
|
+
@IsOptional()
|
|
81
|
+
@IsBoolean()
|
|
82
|
+
enabled?: boolean;
|
|
83
|
+
|
|
84
|
+
/** Productos del servicio (≥1). */
|
|
85
|
+
@IsArray()
|
|
86
|
+
@ArrayNotEmpty()
|
|
87
|
+
@ValidateNested({ each: true })
|
|
88
|
+
@Type(() => BackofficeProductCreateItem)
|
|
89
|
+
products!: BackofficeProductCreateItem[];
|
|
90
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IsBoolean,
|
|
3
|
+
IsEnum,
|
|
4
|
+
IsNotEmpty,
|
|
5
|
+
IsNumber,
|
|
6
|
+
IsOptional,
|
|
7
|
+
IsString,
|
|
8
|
+
Min,
|
|
9
|
+
} from "class-validator";
|
|
10
|
+
import { AmountTypeEnum } from "../../servicePayment/enums/AmountTypeEnum";
|
|
11
|
+
import { ReferenceTypeEnum } from "../enums/ReferenceTypeEnum";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Un producto que la jefa captura al crear un servicio manualmente. Forma
|
|
15
|
+
* estándar: el conector lo traduce a su `productoDTOList` nativo.
|
|
16
|
+
*
|
|
17
|
+
* `productId` es el id real del proveedor (viene en el Excel), igual que el
|
|
18
|
+
* `serviceId` del servicio.
|
|
19
|
+
*/
|
|
20
|
+
export class BackofficeProductCreateItem {
|
|
21
|
+
/** idProducto real del proveedor (del Excel). */
|
|
22
|
+
@IsString()
|
|
23
|
+
@IsNotEmpty()
|
|
24
|
+
productId!: string;
|
|
25
|
+
|
|
26
|
+
@IsString()
|
|
27
|
+
@IsNotEmpty()
|
|
28
|
+
productName!: string;
|
|
29
|
+
|
|
30
|
+
/** Precio del producto (0 para monto VARIABLE). */
|
|
31
|
+
@IsNumber()
|
|
32
|
+
@Min(0)
|
|
33
|
+
price!: number;
|
|
34
|
+
|
|
35
|
+
/** Comisión. Default 0 si se omite. */
|
|
36
|
+
@IsOptional()
|
|
37
|
+
@IsNumber()
|
|
38
|
+
@Min(0)
|
|
39
|
+
fee?: number;
|
|
40
|
+
|
|
41
|
+
@IsEnum(AmountTypeEnum)
|
|
42
|
+
amountType!: AmountTypeEnum;
|
|
43
|
+
|
|
44
|
+
/** Tipo de referencia (→ tipoReferencia nativo; define el input de la app). */
|
|
45
|
+
@IsEnum(ReferenceTypeEnum)
|
|
46
|
+
referenceType!: ReferenceTypeEnum;
|
|
47
|
+
|
|
48
|
+
/** Si la referencia lleva dígito verificador (→ hasDigitoVerificador). Default false. */
|
|
49
|
+
@IsOptional()
|
|
50
|
+
@IsBoolean()
|
|
51
|
+
hasCheckDigit?: boolean;
|
|
52
|
+
|
|
53
|
+
/** Si la referencia se verifica antes de pagar (→ verificateReference). Default false. */
|
|
54
|
+
@IsOptional()
|
|
55
|
+
@IsBoolean()
|
|
56
|
+
verifyReference?: boolean;
|
|
57
|
+
|
|
58
|
+
/** Texto de ayuda (→ legend). */
|
|
59
|
+
@IsOptional()
|
|
60
|
+
@IsString()
|
|
61
|
+
helpText?: string;
|
|
62
|
+
|
|
63
|
+
/** Imagen de ayuda / dónde escanear (→ refSrc). */
|
|
64
|
+
@IsOptional()
|
|
65
|
+
@IsString()
|
|
66
|
+
helpImage?: string;
|
|
67
|
+
|
|
68
|
+
/** Logo del producto (→ logoSrc). */
|
|
69
|
+
@IsOptional()
|
|
70
|
+
@IsString()
|
|
71
|
+
logo?: string;
|
|
72
|
+
|
|
73
|
+
/** Habilitado. Default true (ausencia = habilitado). */
|
|
74
|
+
@IsOptional()
|
|
75
|
+
@IsBoolean()
|
|
76
|
+
enabled?: boolean;
|
|
77
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipo de referencia que la app pide al usuario para un producto. Determina el
|
|
3
|
+
* input del `inputSchema` y mapea al `tipoReferencia` nativo del conector.
|
|
4
|
+
*
|
|
5
|
+
* Solo valores modernos (las altas manuales usan estos). Los códigos legacy de
|
|
6
|
+
* STP (`a`, `b`, `bc`, `c`) existen en datos viejos pero no se ofrecen al crear.
|
|
7
|
+
*/
|
|
8
|
+
export enum ReferenceTypeEnum {
|
|
9
|
+
PHONE = "PHONE",
|
|
10
|
+
CLIENT_NUMBER = "CLIENT_NUMBER",
|
|
11
|
+
BARCODE = "BARCODE",
|
|
12
|
+
REFERENCE_AND_BARCODE = "REFERENCE_AND_BARCODE",
|
|
13
|
+
PHONE_AND_REFERENCE = "PHONE_AND_REFERENCE",
|
|
14
|
+
}
|
|
@@ -79,6 +79,10 @@ export * from "./dtos/BackofficeLeafHelpImageUpdateRequest";
|
|
|
79
79
|
export * from "./dtos/BackofficeProductHelpImageUpdateRequest";
|
|
80
80
|
export * from "./dtos/BackofficeProductEnabledUpdateRequest";
|
|
81
81
|
export * from "./dtos/BackofficeInputLabelsUpdateRequest";
|
|
82
|
+
//Admin leaves iteration-4 v2: alta manual de servicio (create from scratch)
|
|
83
|
+
export * from "./enums/ReferenceTypeEnum";
|
|
84
|
+
export * from "./dtos/BackofficeProductCreateItem";
|
|
85
|
+
export * from "./dtos/BackofficeLeafCreateRequest";
|
|
82
86
|
//Banner assets upload (presigned PUT)
|
|
83
87
|
export * from "./dtos/BannerUploadUrlRequest";
|
|
84
88
|
export * from "./dtos/BannerUploadUrlResponse";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { Type } from 'class-transformer';
|
|
3
|
+
import { IsArray, IsBoolean, IsEnum, IsString, ValidateNested } from 'class-validator';
|
|
4
|
+
import { ChallengeNameEnum } from '../enums/ChallengeNameEnum';
|
|
5
|
+
|
|
6
|
+
export class ChallengeResultEntry {
|
|
7
|
+
@IsEnum(ChallengeNameEnum)
|
|
8
|
+
challengeName!: ChallengeNameEnum;
|
|
9
|
+
|
|
10
|
+
@IsBoolean()
|
|
11
|
+
challengeResult!: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class DefineNextChallengeRequest {
|
|
15
|
+
@IsString()
|
|
16
|
+
cognitoSub!: string;
|
|
17
|
+
|
|
18
|
+
@IsBoolean()
|
|
19
|
+
userNotFound!: boolean;
|
|
20
|
+
|
|
21
|
+
@IsArray()
|
|
22
|
+
@ValidateNested({ each: true })
|
|
23
|
+
@Type(() => ChallengeResultEntry)
|
|
24
|
+
session!: ChallengeResultEntry[];
|
|
25
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IsBoolean, IsEnum, IsOptional } from 'class-validator';
|
|
2
|
+
import { ChallengeNameEnum } from '../enums/ChallengeNameEnum';
|
|
3
|
+
|
|
4
|
+
export class DefineNextChallengeResponse {
|
|
5
|
+
@IsOptional()
|
|
6
|
+
@IsEnum(ChallengeNameEnum)
|
|
7
|
+
nextChallenge?: ChallengeNameEnum;
|
|
8
|
+
|
|
9
|
+
@IsBoolean()
|
|
10
|
+
issueTokens!: boolean;
|
|
11
|
+
|
|
12
|
+
@IsBoolean()
|
|
13
|
+
failAuthentication!: boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IsEmail, IsEnum, IsString } from 'class-validator';
|
|
2
|
+
import { ChallengeNameEnum } from '../enums/ChallengeNameEnum';
|
|
3
|
+
|
|
4
|
+
export class PrepareChallengeRequest {
|
|
5
|
+
@IsString()
|
|
6
|
+
cognitoSub!: string;
|
|
7
|
+
|
|
8
|
+
@IsEnum(ChallengeNameEnum)
|
|
9
|
+
challengeName!: ChallengeNameEnum;
|
|
10
|
+
|
|
11
|
+
@IsEmail()
|
|
12
|
+
email!: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IsEmail, IsString, Length, MinLength } from 'class-validator';
|
|
2
|
+
|
|
3
|
+
export class ResetPasswordRequest {
|
|
4
|
+
@IsEmail()
|
|
5
|
+
email!: string;
|
|
6
|
+
|
|
7
|
+
@IsString()
|
|
8
|
+
@Length(6, 6)
|
|
9
|
+
otpCode!: string;
|
|
10
|
+
|
|
11
|
+
@IsString()
|
|
12
|
+
@MinLength(8)
|
|
13
|
+
newPassword!: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IsEnum, IsObject, IsString } from 'class-validator';
|
|
2
|
+
import { ChallengeNameEnum } from '../enums/ChallengeNameEnum';
|
|
3
|
+
|
|
4
|
+
export class VerifyChallengeRequest {
|
|
5
|
+
@IsString()
|
|
6
|
+
cognitoSub!: string;
|
|
7
|
+
|
|
8
|
+
@IsEnum(ChallengeNameEnum)
|
|
9
|
+
challengeName!: ChallengeNameEnum;
|
|
10
|
+
|
|
11
|
+
@IsString()
|
|
12
|
+
challengeAnswer!: string;
|
|
13
|
+
|
|
14
|
+
@IsObject()
|
|
15
|
+
privateChallengeParameters!: Record<string, string>;
|
|
16
|
+
}
|
|
@@ -15,3 +15,20 @@ export { PermissionCategory } from './enums/PermissionCategory';
|
|
|
15
15
|
export type { AuthContext } from './dtos/AuthContext';
|
|
16
16
|
export type { RoleAssignmentInfo } from './dtos/RoleAssignmentInfo';
|
|
17
17
|
export type { PermissionMeta } from './dtos/PermissionMeta';
|
|
18
|
+
|
|
19
|
+
// Fase 1 — Custom Auth Challenge (Email OTP + TOTP) + MFA self-service.
|
|
20
|
+
// Class values (no type-only) — los DTOs llevan decoradores class-validator y se hidratan con plainToInstance en runtime.
|
|
21
|
+
export * from './enums/MfaMethodEnum';
|
|
22
|
+
export * from './enums/ChallengeNameEnum';
|
|
23
|
+
export * from './auth/DefineNextChallengeRequest';
|
|
24
|
+
export * from './auth/DefineNextChallengeResponse';
|
|
25
|
+
export * from './auth/PrepareChallengeRequest';
|
|
26
|
+
export * from './auth/PrepareChallengeResponse';
|
|
27
|
+
export * from './auth/VerifyChallengeRequest';
|
|
28
|
+
export * from './auth/VerifyChallengeResponse';
|
|
29
|
+
export * from './auth/NewPasswordRequest';
|
|
30
|
+
export * from './auth/ResetPasswordRequest';
|
|
31
|
+
export * from './mfa/EnrollTotpResponse';
|
|
32
|
+
export * from './mfa/VerifyTotpEnrollmentRequest';
|
|
33
|
+
export * from './mfa/ChangeMfaMethodRequest';
|
|
34
|
+
export * from './mfa/MfaStatusResponse';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IsArray, IsEnum, IsNumber } from 'class-validator';
|
|
2
|
+
import { MfaMethodEnum } from '../enums/MfaMethodEnum';
|
|
3
|
+
|
|
4
|
+
export class MfaStatusResponse {
|
|
5
|
+
@IsEnum(MfaMethodEnum)
|
|
6
|
+
currentMethod!: MfaMethodEnum;
|
|
7
|
+
|
|
8
|
+
@IsArray()
|
|
9
|
+
@IsEnum(MfaMethodEnum, { each: true })
|
|
10
|
+
availableMethods!: MfaMethodEnum[];
|
|
11
|
+
|
|
12
|
+
@IsNumber()
|
|
13
|
+
recoveryCodesRemaining!: number;
|
|
14
|
+
}
|