@fiado/type-kit 3.37.0 → 3.39.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_/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.test.ts +77 -0
- package/_test_/unit/cognitoBackofficeConnector/validators/NoTenantIdInCustomAttrs.test.ts +43 -0
- package/bin/benefitCenter/dtos/BackofficeInputLabelsUpdateRequest.d.ts +12 -0
- package/bin/benefitCenter/dtos/BackofficeInputLabelsUpdateRequest.js +29 -0
- package/bin/benefitCenter/dtos/BackofficeLeafHelpImageUpdateRequest.d.ts +9 -0
- package/bin/benefitCenter/dtos/BackofficeLeafHelpImageUpdateRequest.js +26 -0
- package/bin/benefitCenter/dtos/BackofficeProductEnabledUpdateRequest.d.ts +9 -0
- package/bin/benefitCenter/dtos/BackofficeProductEnabledUpdateRequest.js +26 -0
- package/bin/benefitCenter/dtos/BackofficeProductHelpImageUpdateRequest.d.ts +9 -0
- package/bin/benefitCenter/dtos/BackofficeProductHelpImageUpdateRequest.js +26 -0
- package/bin/benefitCenter/dtos/BackofficeSubcategoryLogoUpdateRequest.d.ts +10 -0
- package/bin/benefitCenter/dtos/BackofficeSubcategoryLogoUpdateRequest.js +27 -0
- package/bin/benefitCenter/dtos/LeafAssetUploadUrlRequest.d.ts +14 -0
- package/bin/benefitCenter/dtos/LeafAssetUploadUrlRequest.js +36 -0
- package/bin/benefitCenter/dtos/LeafAssetUploadUrlResponse.d.ts +13 -0
- package/bin/benefitCenter/dtos/LeafAssetUploadUrlResponse.js +12 -0
- package/bin/benefitCenter/dtos/ProductItem.d.ts +12 -0
- package/bin/benefitCenter/enums/LeafAssetKindEnum.d.ts +12 -0
- package/bin/benefitCenter/enums/LeafAssetKindEnum.js +16 -0
- package/bin/benefitCenter/index.d.ts +8 -0
- package/bin/benefitCenter/index.js +9 -0
- package/bin/cognitoBackofficeConnector/dtos/AppClientConfig.d.ts +19 -0
- package/bin/cognitoBackofficeConnector/dtos/AppClientConfig.js +74 -0
- package/bin/cognitoBackofficeConnector/dtos/AuthEventResponse.d.ts +8 -0
- package/bin/cognitoBackofficeConnector/dtos/AuthEventResponse.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/AuthEventsRequest.d.ts +5 -0
- package/bin/cognitoBackofficeConnector/dtos/AuthEventsRequest.js +37 -0
- package/bin/cognitoBackofficeConnector/dtos/AuthTokensResponse.d.ts +12 -0
- package/bin/cognitoBackofficeConnector/dtos/AuthTokensResponse.js +11 -0
- package/bin/cognitoBackofficeConnector/dtos/ChangePasswordRequest.d.ts +6 -0
- package/bin/cognitoBackofficeConnector/dtos/ChangePasswordRequest.js +41 -0
- package/bin/cognitoBackofficeConnector/dtos/ConfirmForgotPasswordRequest.d.ts +8 -0
- package/bin/cognitoBackofficeConnector/dtos/ConfirmForgotPasswordRequest.js +53 -0
- package/bin/cognitoBackofficeConnector/dtos/CreatePoolRequest.d.ts +19 -0
- package/bin/cognitoBackofficeConnector/dtos/CreatePoolRequest.js +63 -0
- package/bin/cognitoBackofficeConnector/dtos/CreatePoolResponse.d.ts +13 -0
- package/bin/cognitoBackofficeConnector/dtos/CreatePoolResponse.js +13 -0
- package/bin/cognitoBackofficeConnector/dtos/CreateUserRequest.d.ts +9 -0
- package/bin/cognitoBackofficeConnector/dtos/CreateUserRequest.js +57 -0
- package/bin/cognitoBackofficeConnector/dtos/CreateUserResponse.d.ts +10 -0
- package/bin/cognitoBackofficeConnector/dtos/CreateUserResponse.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/CustomAttributeSpec.d.ts +9 -0
- package/bin/cognitoBackofficeConnector/dtos/CustomAttributeSpec.js +38 -0
- package/bin/cognitoBackofficeConnector/dtos/DeletePoolRequest.d.ts +13 -0
- package/bin/cognitoBackofficeConnector/dtos/DeletePoolRequest.js +36 -0
- package/bin/cognitoBackofficeConnector/dtos/DeleteUserRequest.d.ts +4 -0
- package/bin/cognitoBackofficeConnector/dtos/DeleteUserRequest.js +29 -0
- package/bin/cognitoBackofficeConnector/dtos/ForgotPasswordRequest.d.ts +6 -0
- package/bin/cognitoBackofficeConnector/dtos/ForgotPasswordRequest.js +41 -0
- package/bin/cognitoBackofficeConnector/dtos/HealthcheckResponse.d.ts +12 -0
- package/bin/cognitoBackofficeConnector/dtos/HealthcheckResponse.js +13 -0
- package/bin/cognitoBackofficeConnector/dtos/InitiateAuthRequest.d.ts +8 -0
- package/bin/cognitoBackofficeConnector/dtos/InitiateAuthRequest.js +53 -0
- package/bin/cognitoBackofficeConnector/dtos/InitiateAuthResponse.d.ts +16 -0
- package/bin/cognitoBackofficeConnector/dtos/InitiateAuthResponse.js +14 -0
- package/bin/cognitoBackofficeConnector/dtos/MfaPoolConfig.d.ts +7 -0
- package/bin/cognitoBackofficeConnector/dtos/MfaPoolConfig.js +31 -0
- package/bin/cognitoBackofficeConnector/dtos/MfaResetRequest.d.ts +4 -0
- package/bin/cognitoBackofficeConnector/dtos/MfaResetRequest.js +29 -0
- package/bin/cognitoBackofficeConnector/dtos/MfaVerifyResponse.d.ts +8 -0
- package/bin/cognitoBackofficeConnector/dtos/MfaVerifyResponse.js +11 -0
- package/bin/cognitoBackofficeConnector/dtos/PasswordPolicyConfig.d.ts +8 -0
- package/bin/cognitoBackofficeConnector/dtos/PasswordPolicyConfig.js +51 -0
- package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.d.ts +20 -0
- package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.js +11 -0
- package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.d.ts +4 -0
- package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/RefreshTokensRequest.d.ts +6 -0
- package/bin/cognitoBackofficeConnector/dtos/RefreshTokensRequest.js +41 -0
- package/bin/cognitoBackofficeConnector/dtos/RefreshTokensResponse.d.ts +4 -0
- package/bin/cognitoBackofficeConnector/dtos/RefreshTokensResponse.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/ResendConfirmationRequest.d.ts +6 -0
- package/bin/cognitoBackofficeConnector/dtos/ResendConfirmationRequest.js +41 -0
- package/bin/cognitoBackofficeConnector/dtos/ResendInvitationRequest.d.ts +4 -0
- package/bin/cognitoBackofficeConnector/dtos/ResendInvitationRequest.js +29 -0
- package/bin/cognitoBackofficeConnector/dtos/RespondToChallengeRequest.d.ts +9 -0
- package/bin/cognitoBackofficeConnector/dtos/RespondToChallengeRequest.js +52 -0
- package/bin/cognitoBackofficeConnector/dtos/RespondToChallengeResponse.d.ts +13 -0
- package/bin/cognitoBackofficeConnector/dtos/RespondToChallengeResponse.js +11 -0
- package/bin/cognitoBackofficeConnector/dtos/SetMfaPreferenceRequest.d.ts +8 -0
- package/bin/cognitoBackofficeConnector/dtos/SetMfaPreferenceRequest.js +51 -0
- package/bin/cognitoBackofficeConnector/dtos/TotpBeginRequest.d.ts +5 -0
- package/bin/cognitoBackofficeConnector/dtos/TotpBeginRequest.js +35 -0
- package/bin/cognitoBackofficeConnector/dtos/TotpBeginResponse.d.ts +4 -0
- package/bin/cognitoBackofficeConnector/dtos/TotpBeginResponse.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/TotpVerifyRequest.d.ts +6 -0
- package/bin/cognitoBackofficeConnector/dtos/TotpVerifyRequest.js +41 -0
- package/bin/cognitoBackofficeConnector/dtos/UpdateEmailRequest.d.ts +5 -0
- package/bin/cognitoBackofficeConnector/dtos/UpdateEmailRequest.js +34 -0
- package/bin/cognitoBackofficeConnector/dtos/UpdateProfileRequest.d.ts +12 -0
- package/bin/cognitoBackofficeConnector/dtos/UpdateProfileRequest.js +47 -0
- package/bin/cognitoBackofficeConnector/dtos/UpdateUserAttributesRequest.d.ts +7 -0
- package/bin/cognitoBackofficeConnector/dtos/UpdateUserAttributesRequest.js +49 -0
- package/bin/cognitoBackofficeConnector/dtos/UserActionRequest.d.ts +9 -0
- package/bin/cognitoBackofficeConnector/dtos/UserActionRequest.js +34 -0
- package/bin/cognitoBackofficeConnector/dtos/UserDetailResponse.d.ts +13 -0
- package/bin/cognitoBackofficeConnector/dtos/UserDetailResponse.js +6 -0
- package/bin/cognitoBackofficeConnector/dtos/VerifyEmailRequest.d.ts +5 -0
- package/bin/cognitoBackofficeConnector/dtos/VerifyEmailRequest.js +35 -0
- package/bin/cognitoBackofficeConnector/enums/CognitoChallengeType.d.ts +26 -0
- package/bin/cognitoBackofficeConnector/enums/CognitoChallengeType.js +30 -0
- package/bin/cognitoBackofficeConnector/enums/CognitoUserStatus.d.ts +29 -0
- package/bin/cognitoBackofficeConnector/enums/CognitoUserStatus.js +33 -0
- package/bin/cognitoBackofficeConnector/index.d.ts +50 -0
- package/bin/cognitoBackofficeConnector/index.js +66 -0
- package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.d.ts +17 -0
- package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.js +39 -0
- package/bin/cognitoBackofficeConnector/validators/NoTenantIdInCustomAttrs.d.ts +27 -0
- package/bin/cognitoBackofficeConnector/validators/NoTenantIdInCustomAttrs.js +48 -0
- package/bin/index.d.ts +3 -0
- package/bin/index.js +9 -1
- package/bin/platformRbac/dtos/AuthContext.d.ts +21 -0
- package/bin/platformRbac/dtos/AuthContext.js +2 -0
- package/bin/platformRbac/dtos/PermissionMeta.d.ts +19 -0
- package/bin/platformRbac/dtos/PermissionMeta.js +2 -0
- package/bin/platformRbac/dtos/RoleAssignmentInfo.d.ts +11 -0
- package/bin/platformRbac/dtos/RoleAssignmentInfo.js +2 -0
- package/bin/platformRbac/enums/Permission.d.ts +93 -0
- package/bin/platformRbac/enums/Permission.js +118 -0
- package/bin/platformRbac/enums/PermissionCategory.d.ts +14 -0
- package/bin/platformRbac/enums/PermissionCategory.js +18 -0
- package/bin/platformRbac/enums/PermissionScope.d.ts +10 -0
- package/bin/platformRbac/enums/PermissionScope.js +14 -0
- package/bin/platformRbac/index.d.ts +6 -0
- package/bin/platformRbac/index.js +18 -0
- package/bin/rbac/enums/PoolKind.d.ts +16 -0
- package/bin/rbac/enums/PoolKind.js +20 -0
- package/bin/rbac/index.d.ts +1 -0
- package/bin/rbac/index.js +17 -0
- package/jest.config.js +8 -0
- package/package.json +5 -1
- package/src/benefitCenter/dtos/BackofficeInputLabelsUpdateRequest.ts +16 -0
- package/src/benefitCenter/dtos/BackofficeLeafHelpImageUpdateRequest.ts +13 -0
- package/src/benefitCenter/dtos/BackofficeProductEnabledUpdateRequest.ts +12 -0
- package/src/benefitCenter/dtos/BackofficeProductHelpImageUpdateRequest.ts +13 -0
- package/src/benefitCenter/dtos/BackofficeSubcategoryLogoUpdateRequest.ts +14 -0
- package/src/benefitCenter/dtos/LeafAssetUploadUrlRequest.ts +23 -0
- package/src/benefitCenter/dtos/LeafAssetUploadUrlResponse.ts +13 -0
- package/src/benefitCenter/dtos/ProductItem.ts +14 -0
- package/src/benefitCenter/enums/LeafAssetKindEnum.ts +12 -0
- package/src/benefitCenter/index.ts +9 -0
- package/src/cognitoBackofficeConnector/dtos/AppClientConfig.ts +22 -0
- package/src/cognitoBackofficeConnector/dtos/AuthEventResponse.ts +8 -0
- package/src/cognitoBackofficeConnector/dtos/AuthEventsRequest.ts +8 -0
- package/src/cognitoBackofficeConnector/dtos/AuthTokensResponse.ts +12 -0
- package/src/cognitoBackofficeConnector/dtos/ChangePasswordRequest.ts +9 -0
- package/src/cognitoBackofficeConnector/dtos/ConfirmForgotPasswordRequest.ts +11 -0
- package/src/cognitoBackofficeConnector/dtos/CreatePoolRequest.ts +30 -0
- package/src/cognitoBackofficeConnector/dtos/CreatePoolResponse.ts +13 -0
- package/src/cognitoBackofficeConnector/dtos/CreateUserRequest.ts +12 -0
- package/src/cognitoBackofficeConnector/dtos/CreateUserResponse.ts +11 -0
- package/src/cognitoBackofficeConnector/dtos/CustomAttributeSpec.ts +12 -0
- package/src/cognitoBackofficeConnector/dtos/DeletePoolRequest.ts +16 -0
- package/src/cognitoBackofficeConnector/dtos/DeleteUserRequest.ts +7 -0
- package/src/cognitoBackofficeConnector/dtos/ForgotPasswordRequest.ts +9 -0
- package/src/cognitoBackofficeConnector/dtos/HealthcheckResponse.ts +12 -0
- package/src/cognitoBackofficeConnector/dtos/InitiateAuthRequest.ts +11 -0
- package/src/cognitoBackofficeConnector/dtos/InitiateAuthResponse.ts +17 -0
- package/src/cognitoBackofficeConnector/dtos/MfaPoolConfig.ts +16 -0
- package/src/cognitoBackofficeConnector/dtos/MfaResetRequest.ts +7 -0
- package/src/cognitoBackofficeConnector/dtos/MfaVerifyResponse.ts +8 -0
- package/src/cognitoBackofficeConnector/dtos/PasswordPolicyConfig.ts +11 -0
- package/src/cognitoBackofficeConnector/dtos/RefreshTokensRequest.ts +9 -0
- package/src/cognitoBackofficeConnector/dtos/RefreshTokensResponse.ts +5 -0
- package/src/cognitoBackofficeConnector/dtos/ResendConfirmationRequest.ts +9 -0
- package/src/cognitoBackofficeConnector/dtos/ResendInvitationRequest.ts +7 -0
- package/src/cognitoBackofficeConnector/dtos/RespondToChallengeRequest.ts +12 -0
- package/src/cognitoBackofficeConnector/dtos/RespondToChallengeResponse.ts +14 -0
- package/src/cognitoBackofficeConnector/dtos/SetMfaPreferenceRequest.ts +12 -0
- package/src/cognitoBackofficeConnector/dtos/TotpBeginRequest.ts +8 -0
- package/src/cognitoBackofficeConnector/dtos/TotpBeginResponse.ts +4 -0
- package/src/cognitoBackofficeConnector/dtos/TotpVerifyRequest.ts +9 -0
- package/src/cognitoBackofficeConnector/dtos/UpdateEmailRequest.ts +8 -0
- package/src/cognitoBackofficeConnector/dtos/UpdateProfileRequest.ts +15 -0
- package/src/cognitoBackofficeConnector/dtos/UpdateUserAttributesRequest.ts +12 -0
- package/src/cognitoBackofficeConnector/dtos/UserActionRequest.ts +12 -0
- package/src/cognitoBackofficeConnector/dtos/UserDetailResponse.ts +14 -0
- package/src/cognitoBackofficeConnector/dtos/VerifyEmailRequest.ts +8 -0
- package/src/cognitoBackofficeConnector/enums/CognitoChallengeType.ts +26 -0
- package/src/cognitoBackofficeConnector/enums/CognitoUserStatus.ts +29 -0
- package/src/cognitoBackofficeConnector/index.ts +50 -0
- package/src/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.ts +29 -0
- package/src/cognitoBackofficeConnector/validators/NoTenantIdInCustomAttrs.ts +36 -0
- package/src/index.ts +8 -0
- package/src/platformRbac/dtos/AuthContext.ts +22 -0
- package/src/platformRbac/dtos/PermissionMeta.ts +20 -0
- package/src/platformRbac/dtos/RoleAssignmentInfo.ts +12 -0
- package/src/platformRbac/enums/Permission.ts +120 -0
- package/src/platformRbac/enums/PermissionCategory.ts +14 -0
- package/src/platformRbac/enums/PermissionScope.ts +10 -0
- package/src/platformRbac/index.ts +17 -0
- package/src/rbac/enums/PoolKind.ts +16 -0
- package/src/rbac/index.ts +1 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ValidatorConstraintInterface, ValidationArguments } from 'class-validator';
|
|
2
|
+
/**
|
|
3
|
+
* Bloquea que el cliente del backoffice envíe `tenantId` dentro del map
|
|
4
|
+
* `customAttributes` al actualizar atributos de un usuario Cognito (decisión D3
|
|
5
|
+
* del spec del proyecto `cognito-backoffice-connector`).
|
|
6
|
+
*
|
|
7
|
+
* Razón: el `tenantId` se determina por el pool donde vive el usuario y por
|
|
8
|
+
* el rol del caller — permitir overridearlo desde `customAttributes` habilitaría
|
|
9
|
+
* "tenant reassignment" por la puerta de atrás (escalación de privilegios
|
|
10
|
+
* cross-tenant).
|
|
11
|
+
*
|
|
12
|
+
* Acepta:
|
|
13
|
+
* - `undefined` / `null` (el campo es opcional).
|
|
14
|
+
* - Objeto vacío `{}`.
|
|
15
|
+
* - Cualquier objeto que NO contenga la key `tenantId`.
|
|
16
|
+
*
|
|
17
|
+
* Rechaza:
|
|
18
|
+
* - Objetos con la key `tenantId` presente (con cualquier valor).
|
|
19
|
+
* - Valores que no son objeto (string, number, array, etc.).
|
|
20
|
+
*
|
|
21
|
+
* Uso en DTOs: `@Validate(NoTenantIdInCustomAttrs)` sobre el campo
|
|
22
|
+
* `customAttributes`.
|
|
23
|
+
*/
|
|
24
|
+
export declare class NoTenantIdInCustomAttrs implements ValidatorConstraintInterface {
|
|
25
|
+
validate(value: unknown, _args: ValidationArguments): boolean;
|
|
26
|
+
defaultMessage(args: ValidationArguments): string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.NoTenantIdInCustomAttrs = void 0;
|
|
10
|
+
const class_validator_1 = require("class-validator");
|
|
11
|
+
/**
|
|
12
|
+
* Bloquea que el cliente del backoffice envíe `tenantId` dentro del map
|
|
13
|
+
* `customAttributes` al actualizar atributos de un usuario Cognito (decisión D3
|
|
14
|
+
* del spec del proyecto `cognito-backoffice-connector`).
|
|
15
|
+
*
|
|
16
|
+
* Razón: el `tenantId` se determina por el pool donde vive el usuario y por
|
|
17
|
+
* el rol del caller — permitir overridearlo desde `customAttributes` habilitaría
|
|
18
|
+
* "tenant reassignment" por la puerta de atrás (escalación de privilegios
|
|
19
|
+
* cross-tenant).
|
|
20
|
+
*
|
|
21
|
+
* Acepta:
|
|
22
|
+
* - `undefined` / `null` (el campo es opcional).
|
|
23
|
+
* - Objeto vacío `{}`.
|
|
24
|
+
* - Cualquier objeto que NO contenga la key `tenantId`.
|
|
25
|
+
*
|
|
26
|
+
* Rechaza:
|
|
27
|
+
* - Objetos con la key `tenantId` presente (con cualquier valor).
|
|
28
|
+
* - Valores que no son objeto (string, number, array, etc.).
|
|
29
|
+
*
|
|
30
|
+
* Uso en DTOs: `@Validate(NoTenantIdInCustomAttrs)` sobre el campo
|
|
31
|
+
* `customAttributes`.
|
|
32
|
+
*/
|
|
33
|
+
let NoTenantIdInCustomAttrs = class NoTenantIdInCustomAttrs {
|
|
34
|
+
validate(value, _args) {
|
|
35
|
+
if (value === undefined || value === null)
|
|
36
|
+
return true;
|
|
37
|
+
if (typeof value !== 'object' || Array.isArray(value))
|
|
38
|
+
return false;
|
|
39
|
+
return !Object.prototype.hasOwnProperty.call(value, 'tenantId');
|
|
40
|
+
}
|
|
41
|
+
defaultMessage(args) {
|
|
42
|
+
return `${args.property} must not contain a 'tenantId' key — tenant reassignment via customAttributes is forbidden`;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.NoTenantIdInCustomAttrs = NoTenantIdInCustomAttrs;
|
|
46
|
+
exports.NoTenantIdInCustomAttrs = NoTenantIdInCustomAttrs = __decorate([
|
|
47
|
+
(0, class_validator_1.ValidatorConstraint)({ name: 'NoTenantIdInCustomAttrs', async: false })
|
|
48
|
+
], NoTenantIdInCustomAttrs);
|
package/bin/index.d.ts
CHANGED
|
@@ -73,5 +73,8 @@ export * as CirculoCredito from './circuloCredito';
|
|
|
73
73
|
export * as MilestoneBusiness from './milestone-business';
|
|
74
74
|
export * as Mdm from './mdm';
|
|
75
75
|
export * as MessagesConnector from './messagesConnector';
|
|
76
|
+
export * as CognitoBackofficeConnector from './cognitoBackofficeConnector';
|
|
77
|
+
export * as Rbac from './rbac';
|
|
78
|
+
export * as PlatformRbac from './platformRbac';
|
|
76
79
|
export * as Remittance from './remittance';
|
|
77
80
|
export * from './messaging';
|
package/bin/index.js
CHANGED
|
@@ -37,7 +37,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.Pricelist = exports.Company = exports.Services = exports.AccountIssuanceBusiness = exports.AppSelectionData = exports.Device = exports.Observations = exports.IssuanceBusiness = exports.Blacklist = exports.CentralPayments = exports.Helpdesk = exports.FiadoApiResponse = exports.Auth = exports.LegalDocumentsBusiness = exports.Role = exports.STPAccount = exports.RiskProfile = exports.FraudPreventionEngine = exports.BBVARst = exports.Stp = exports.BenefitCenter = exports.BankAccount = exports.P2pContact = exports.CreditContract = exports.Contract = exports.ProductCatalog = exports.ContactInfo = exports.Transaction = exports.TransactionProcessor = exports.GenericMessage = exports.EventBridgeMessage = exports.SessionActivity = exports.NotificationMessages = exports.ServicePayment = exports.Header = exports.Identity = exports.Group = exports.File = exports.ExchangeRate = exports.Directory = exports.Currency = exports.Country = exports.Card = exports.Authentication = exports.App = exports.Address = exports.Beneficiary = exports.Activity = exports.Account = exports.Crypto = void 0;
|
|
40
|
-
exports.Remittance = exports.MessagesConnector = exports.Mdm = exports.MilestoneBusiness = exports.CirculoCredito = exports.CreditStatements = exports.Sentry = exports.AiEngine = exports.Funnel = exports.TeamsConnector = exports.PlatformErrorEvents = exports.CustomerFile = exports.CreditBackoffice = exports.CreditDashboard = exports.CreditEngine = exports.Credit = exports.ComissionBusiness = exports.ReferralBusiness = exports.ZendeskMessaging = exports.NotificationWS = exports.Event = exports.PayrollBusiness = exports.Cnbv = exports.DirectorySetting = exports.InvoiceCollector = exports.Collector = void 0;
|
|
40
|
+
exports.Remittance = exports.PlatformRbac = exports.Rbac = exports.CognitoBackofficeConnector = exports.MessagesConnector = exports.Mdm = exports.MilestoneBusiness = exports.CirculoCredito = exports.CreditStatements = exports.Sentry = exports.AiEngine = exports.Funnel = exports.TeamsConnector = exports.PlatformErrorEvents = exports.CustomerFile = exports.CreditBackoffice = exports.CreditDashboard = exports.CreditEngine = exports.Credit = exports.ComissionBusiness = exports.ReferralBusiness = exports.ZendeskMessaging = exports.NotificationWS = exports.Event = exports.PayrollBusiness = exports.Cnbv = exports.DirectorySetting = exports.InvoiceCollector = exports.Collector = void 0;
|
|
41
41
|
exports.Crypto = __importStar(require("./crypto"));
|
|
42
42
|
exports.Account = __importStar(require("./account"));
|
|
43
43
|
exports.Activity = __importStar(require("./activity"));
|
|
@@ -113,5 +113,13 @@ exports.CirculoCredito = __importStar(require("./circuloCredito"));
|
|
|
113
113
|
exports.MilestoneBusiness = __importStar(require("./milestone-business"));
|
|
114
114
|
exports.Mdm = __importStar(require("./mdm"));
|
|
115
115
|
exports.MessagesConnector = __importStar(require("./messagesConnector"));
|
|
116
|
+
exports.CognitoBackofficeConnector = __importStar(require("./cognitoBackofficeConnector"));
|
|
117
|
+
exports.Rbac = __importStar(require("./rbac"));
|
|
118
|
+
// PlatformRbac: módulo del lambda platform-rbac-business (Fase 0 SureKeep).
|
|
119
|
+
// Contiene Permission enum + AuthContext + RoleAssignmentInfo + PermissionScope +
|
|
120
|
+
// PermissionCategory + PermissionMeta + (futuro Fase 1.B) DTOs propios del rbac-business.
|
|
121
|
+
// Coexiste con `Rbac` oficial cuando yhonhansen publique componente 01.
|
|
122
|
+
// Cleanup del `Rbac` viejo planeado en bloque 13 post-gate (TD-RBAC en platform-rbac-business).
|
|
123
|
+
exports.PlatformRbac = __importStar(require("./platformRbac"));
|
|
116
124
|
exports.Remittance = __importStar(require("./remittance"));
|
|
117
125
|
__exportStar(require("./messaging"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Permission } from '../enums/Permission';
|
|
2
|
+
import type { RoleAssignmentInfo } from './RoleAssignmentInfo';
|
|
3
|
+
/**
|
|
4
|
+
* Shape DESERIALIZADO del authorizer context.
|
|
5
|
+
* El authorizer Lambda (componente 07) lo construye + serializa; el helper
|
|
6
|
+
* `extractTenantContext` lo deserializa para los handlers business.
|
|
7
|
+
*
|
|
8
|
+
* En API Gateway authorizer.context todos los valores son strings:
|
|
9
|
+
* - `permissions` viaja como CSV (`"a.b.c,d.e.f,..."`).
|
|
10
|
+
* - `roleAssignments` viaja como JSON string.
|
|
11
|
+
* Este interface es la forma ya parseada.
|
|
12
|
+
*/
|
|
13
|
+
export interface AuthContext {
|
|
14
|
+
cognitoSub: string;
|
|
15
|
+
tenantId: string;
|
|
16
|
+
email: string;
|
|
17
|
+
roleAssignments: RoleAssignmentInfo[];
|
|
18
|
+
permissions: Permission[];
|
|
19
|
+
resolvedAt: string;
|
|
20
|
+
issuer?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Permission } from '../enums/Permission';
|
|
2
|
+
import type { PermissionScope } from '../enums/PermissionScope';
|
|
3
|
+
import type { PermissionCategory } from '../enums/PermissionCategory';
|
|
4
|
+
/**
|
|
5
|
+
* Metadata enriquecida de una permission del catálogo.
|
|
6
|
+
* Usado para:
|
|
7
|
+
* - Sync del enum a DDB `PlatformPermission_GT` al deploy.
|
|
8
|
+
* - UI del módulo rbac-admin: selector de permissions agrupado.
|
|
9
|
+
* - Reporting / docs.
|
|
10
|
+
*/
|
|
11
|
+
export interface PermissionMeta {
|
|
12
|
+
permissionKey: Permission;
|
|
13
|
+
displayName: string;
|
|
14
|
+
description: string;
|
|
15
|
+
category: PermissionCategory;
|
|
16
|
+
scope: PermissionScope;
|
|
17
|
+
platforms: string[];
|
|
18
|
+
isDeprecated?: boolean;
|
|
19
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PermissionScope } from '../enums/PermissionScope';
|
|
2
|
+
/**
|
|
3
|
+
* Una asignación de role a un user con scope específico.
|
|
4
|
+
* Shape que el authorizer Lambda (componente 07) serializa como JSON string
|
|
5
|
+
* dentro del API Gateway authorizer context.
|
|
6
|
+
*/
|
|
7
|
+
export interface RoleAssignmentInfo {
|
|
8
|
+
roleId: string;
|
|
9
|
+
scope: PermissionScope;
|
|
10
|
+
scopeRef: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catálogo universal de permisos del sistema RBAC Fiado.
|
|
3
|
+
*
|
|
4
|
+
* Origen: componente 01 de Fase 0 SureKeep (spec maestro):
|
|
5
|
+
* surekeep/docs/5_fases/00_fase0_cognito_rbac_users_mfa/componentes/01_typekit-rbac-additions.md
|
|
6
|
+
*
|
|
7
|
+
* Copy-paste literal de los 78 valores del spec (DEC-003).
|
|
8
|
+
* Convención: `<category>.<resource>.<action>` (snake_case en action si multi-palabra).
|
|
9
|
+
* Cualquier cambio aquí requiere PR + bump minor + redeploy de consumers.
|
|
10
|
+
*
|
|
11
|
+
* Coexiste con módulo `rbac/` oficial cuando yhonhansen publique componente 01 — TD-RBAC-002.
|
|
12
|
+
*/
|
|
13
|
+
export declare enum Permission {
|
|
14
|
+
RBAC_CATALOG_MANAGE = "rbac.catalog.manage",
|
|
15
|
+
PLATFORM_TENANT_CREATE = "platform.tenant.create",
|
|
16
|
+
PLATFORM_TENANT_LIST = "platform.tenant.list",
|
|
17
|
+
PLATFORM_TENANT_VIEW = "platform.tenant.view",
|
|
18
|
+
PLATFORM_TENANT_UPDATE = "platform.tenant.update",
|
|
19
|
+
PLATFORM_TENANT_SUSPEND = "platform.tenant.suspend",
|
|
20
|
+
PLATFORM_TENANT_ACTIVATE = "platform.tenant.activate",
|
|
21
|
+
PLATFORM_TENANT_ADMIN_REPLACE = "platform.tenant.admin.replace",
|
|
22
|
+
PLATFORM_COGNITO_POOL_MANAGE = "platform.cognito.pool.manage",
|
|
23
|
+
PLATFORM_COGNITO_POOL_LIST = "platform.cognito.pool.list",
|
|
24
|
+
PLATFORM_USER_CREATE = "platform.user.create",
|
|
25
|
+
PLATFORM_USER_LIST = "platform.user.list",
|
|
26
|
+
PLATFORM_USER_VIEW = "platform.user.view",
|
|
27
|
+
PLATFORM_USER_UPDATE = "platform.user.update",
|
|
28
|
+
PLATFORM_USER_DISABLE = "platform.user.disable",
|
|
29
|
+
PLATFORM_USER_ENABLE = "platform.user.enable",
|
|
30
|
+
PLATFORM_USER_DELETE = "platform.user.delete",
|
|
31
|
+
PLATFORM_ROLE_CREATE = "platform.role.create",
|
|
32
|
+
PLATFORM_ROLE_LIST = "platform.role.list",
|
|
33
|
+
PLATFORM_ROLE_UPDATE = "platform.role.update",
|
|
34
|
+
PLATFORM_ROLE_DELETE = "platform.role.delete",
|
|
35
|
+
PLATFORM_AUDIT_VIEW = "platform.audit.view",
|
|
36
|
+
TENANT_USER_CREATE = "tenant.user.create",
|
|
37
|
+
TENANT_USER_LIST = "tenant.user.list",
|
|
38
|
+
TENANT_USER_VIEW = "tenant.user.view",
|
|
39
|
+
TENANT_USER_UPDATE = "tenant.user.update",
|
|
40
|
+
TENANT_USER_DISABLE = "tenant.user.disable",
|
|
41
|
+
TENANT_USER_ENABLE = "tenant.user.enable",
|
|
42
|
+
TENANT_USER_DELETE = "tenant.user.delete",
|
|
43
|
+
TENANT_USER_MFA_RESET = "tenant.user.mfa.reset",
|
|
44
|
+
TENANT_USER_PASSWORD_RESET = "tenant.user.password.reset",
|
|
45
|
+
TENANT_ROLE_CREATE = "tenant.role.create",
|
|
46
|
+
TENANT_ROLE_LIST = "tenant.role.list",
|
|
47
|
+
TENANT_ROLE_UPDATE = "tenant.role.update",
|
|
48
|
+
TENANT_ROLE_DELETE = "tenant.role.delete",
|
|
49
|
+
TENANT_ROLE_VIEW = "tenant.role.view",
|
|
50
|
+
TENANT_ROLE_ASSIGN = "tenant.role.assign",
|
|
51
|
+
TENANT_ROLE_REVOKE = "tenant.role.revoke",
|
|
52
|
+
TENANT_SECURITY_POLICY_VIEW = "tenant.security.policy.view",
|
|
53
|
+
TENANT_SECURITY_POLICY_MANAGE = "tenant.security.policy.manage",
|
|
54
|
+
TENANT_BRANDING_MANAGE = "tenant.branding.manage",
|
|
55
|
+
TENANT_AUDIT_VIEW = "tenant.audit.view",
|
|
56
|
+
RETAIL_PRODUCT_CREATE = "retail.product.create",
|
|
57
|
+
RETAIL_PRODUCT_LIST = "retail.product.list",
|
|
58
|
+
RETAIL_PRODUCT_VIEW = "retail.product.view",
|
|
59
|
+
RETAIL_PRODUCT_UPDATE = "retail.product.update",
|
|
60
|
+
RETAIL_PRODUCT_DELETE = "retail.product.delete",
|
|
61
|
+
RETAIL_PRODUCT_MDM_CONFIG = "retail.product.mdm_config",
|
|
62
|
+
RETAIL_INVENTORY_LIST = "retail.inventory.list",
|
|
63
|
+
RETAIL_INVENTORY_VIEW = "retail.inventory.view",
|
|
64
|
+
RETAIL_INVENTORY_UPDATE = "retail.inventory.update",
|
|
65
|
+
RETAIL_SALE_CREATE = "retail.sale.create",
|
|
66
|
+
RETAIL_SALE_LIST = "retail.sale.list",
|
|
67
|
+
RETAIL_SALE_CANCEL = "retail.sale.cancel",
|
|
68
|
+
RETAIL_STORE_MANAGE = "retail.store.manage",
|
|
69
|
+
RETAIL_RETAILER_MANAGE = "retail.retailer.manage",
|
|
70
|
+
LEND_CREDIT_CREATE = "lend.credit.create",
|
|
71
|
+
LEND_CREDIT_LIST = "lend.credit.list",
|
|
72
|
+
LEND_CREDIT_VIEW = "lend.credit.view",
|
|
73
|
+
LEND_CREDIT_UPDATE = "lend.credit.update",
|
|
74
|
+
LEND_CREDIT_LIQUIDATE = "lend.credit.liquidate",
|
|
75
|
+
LEND_CREDIT_RESTRUCTURE = "lend.credit.restructure",
|
|
76
|
+
LEND_PAYMENT_APPLY = "lend.payment.apply",
|
|
77
|
+
LEND_PAYMENT_LIST = "lend.payment.list",
|
|
78
|
+
LEND_PAYMENT_REVERSE = "lend.payment.reverse",
|
|
79
|
+
LEND_INSTALLMENT_VIEW = "lend.installment.view",
|
|
80
|
+
MDM_DEVICE_ENROLL = "mdm.device.enroll",
|
|
81
|
+
MDM_DEVICE_RELEASE = "mdm.device.release",
|
|
82
|
+
MDM_DEVICE_ARCHIVE = "mdm.device.archive",
|
|
83
|
+
MDM_DEVICE_DEACTIVATE = "mdm.device.deactivate",
|
|
84
|
+
MDM_DEVICE_LOCK_MANUAL = "mdm.device.lock.manual",
|
|
85
|
+
MDM_DEVICE_UNLOCK_MANUAL = "mdm.device.unlock.manual",
|
|
86
|
+
MDM_DEVICE_PIN_UNLOCK = "mdm.device.pin_unlock",
|
|
87
|
+
MDM_DEVICE_EXTEND_VALIDITY = "mdm.device.extend_validity",
|
|
88
|
+
MDM_DEVICE_NOTIFY = "mdm.device.notify",
|
|
89
|
+
MDM_DEVICE_STATUS_VIEW = "mdm.device.status.view",
|
|
90
|
+
MDM_OPERATION_LOG_VIEW = "mdm.operation_log.view",
|
|
91
|
+
MDM_TEST = "mdm.test",
|
|
92
|
+
PAY_TRANSACTION_VIEW = "pay.transaction.view"
|
|
93
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Permission = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Catálogo universal de permisos del sistema RBAC Fiado.
|
|
6
|
+
*
|
|
7
|
+
* Origen: componente 01 de Fase 0 SureKeep (spec maestro):
|
|
8
|
+
* surekeep/docs/5_fases/00_fase0_cognito_rbac_users_mfa/componentes/01_typekit-rbac-additions.md
|
|
9
|
+
*
|
|
10
|
+
* Copy-paste literal de los 78 valores del spec (DEC-003).
|
|
11
|
+
* Convención: `<category>.<resource>.<action>` (snake_case en action si multi-palabra).
|
|
12
|
+
* Cualquier cambio aquí requiere PR + bump minor + redeploy de consumers.
|
|
13
|
+
*
|
|
14
|
+
* Coexiste con módulo `rbac/` oficial cuando yhonhansen publique componente 01 — TD-RBAC-002.
|
|
15
|
+
*/
|
|
16
|
+
var Permission;
|
|
17
|
+
(function (Permission) {
|
|
18
|
+
// ====================================================
|
|
19
|
+
// RBAC — gestión genérica del propio sistema RBAC
|
|
20
|
+
// ====================================================
|
|
21
|
+
Permission["RBAC_CATALOG_MANAGE"] = "rbac.catalog.manage";
|
|
22
|
+
// ====================================================
|
|
23
|
+
// PLATFORM — operaciones a nivel meta-plataforma (Fiado equipo)
|
|
24
|
+
// ====================================================
|
|
25
|
+
Permission["PLATFORM_TENANT_CREATE"] = "platform.tenant.create";
|
|
26
|
+
Permission["PLATFORM_TENANT_LIST"] = "platform.tenant.list";
|
|
27
|
+
Permission["PLATFORM_TENANT_VIEW"] = "platform.tenant.view";
|
|
28
|
+
Permission["PLATFORM_TENANT_UPDATE"] = "platform.tenant.update";
|
|
29
|
+
Permission["PLATFORM_TENANT_SUSPEND"] = "platform.tenant.suspend";
|
|
30
|
+
Permission["PLATFORM_TENANT_ACTIVATE"] = "platform.tenant.activate";
|
|
31
|
+
Permission["PLATFORM_TENANT_ADMIN_REPLACE"] = "platform.tenant.admin.replace";
|
|
32
|
+
Permission["PLATFORM_COGNITO_POOL_MANAGE"] = "platform.cognito.pool.manage";
|
|
33
|
+
Permission["PLATFORM_COGNITO_POOL_LIST"] = "platform.cognito.pool.list";
|
|
34
|
+
Permission["PLATFORM_USER_CREATE"] = "platform.user.create";
|
|
35
|
+
Permission["PLATFORM_USER_LIST"] = "platform.user.list";
|
|
36
|
+
Permission["PLATFORM_USER_VIEW"] = "platform.user.view";
|
|
37
|
+
Permission["PLATFORM_USER_UPDATE"] = "platform.user.update";
|
|
38
|
+
Permission["PLATFORM_USER_DISABLE"] = "platform.user.disable";
|
|
39
|
+
Permission["PLATFORM_USER_ENABLE"] = "platform.user.enable";
|
|
40
|
+
Permission["PLATFORM_USER_DELETE"] = "platform.user.delete";
|
|
41
|
+
Permission["PLATFORM_ROLE_CREATE"] = "platform.role.create";
|
|
42
|
+
Permission["PLATFORM_ROLE_LIST"] = "platform.role.list";
|
|
43
|
+
Permission["PLATFORM_ROLE_UPDATE"] = "platform.role.update";
|
|
44
|
+
Permission["PLATFORM_ROLE_DELETE"] = "platform.role.delete";
|
|
45
|
+
Permission["PLATFORM_AUDIT_VIEW"] = "platform.audit.view";
|
|
46
|
+
// ====================================================
|
|
47
|
+
// TENANT — operaciones dentro del silo de un tenant
|
|
48
|
+
// ====================================================
|
|
49
|
+
Permission["TENANT_USER_CREATE"] = "tenant.user.create";
|
|
50
|
+
Permission["TENANT_USER_LIST"] = "tenant.user.list";
|
|
51
|
+
Permission["TENANT_USER_VIEW"] = "tenant.user.view";
|
|
52
|
+
Permission["TENANT_USER_UPDATE"] = "tenant.user.update";
|
|
53
|
+
Permission["TENANT_USER_DISABLE"] = "tenant.user.disable";
|
|
54
|
+
Permission["TENANT_USER_ENABLE"] = "tenant.user.enable";
|
|
55
|
+
Permission["TENANT_USER_DELETE"] = "tenant.user.delete";
|
|
56
|
+
Permission["TENANT_USER_MFA_RESET"] = "tenant.user.mfa.reset";
|
|
57
|
+
Permission["TENANT_USER_PASSWORD_RESET"] = "tenant.user.password.reset";
|
|
58
|
+
Permission["TENANT_ROLE_CREATE"] = "tenant.role.create";
|
|
59
|
+
Permission["TENANT_ROLE_LIST"] = "tenant.role.list";
|
|
60
|
+
Permission["TENANT_ROLE_UPDATE"] = "tenant.role.update";
|
|
61
|
+
Permission["TENANT_ROLE_DELETE"] = "tenant.role.delete";
|
|
62
|
+
Permission["TENANT_ROLE_VIEW"] = "tenant.role.view";
|
|
63
|
+
Permission["TENANT_ROLE_ASSIGN"] = "tenant.role.assign";
|
|
64
|
+
Permission["TENANT_ROLE_REVOKE"] = "tenant.role.revoke";
|
|
65
|
+
Permission["TENANT_SECURITY_POLICY_VIEW"] = "tenant.security.policy.view";
|
|
66
|
+
Permission["TENANT_SECURITY_POLICY_MANAGE"] = "tenant.security.policy.manage";
|
|
67
|
+
Permission["TENANT_BRANDING_MANAGE"] = "tenant.branding.manage";
|
|
68
|
+
Permission["TENANT_AUDIT_VIEW"] = "tenant.audit.view";
|
|
69
|
+
// ====================================================
|
|
70
|
+
// RETAIL — catálogo + inventario + ventas
|
|
71
|
+
// ====================================================
|
|
72
|
+
Permission["RETAIL_PRODUCT_CREATE"] = "retail.product.create";
|
|
73
|
+
Permission["RETAIL_PRODUCT_LIST"] = "retail.product.list";
|
|
74
|
+
Permission["RETAIL_PRODUCT_VIEW"] = "retail.product.view";
|
|
75
|
+
Permission["RETAIL_PRODUCT_UPDATE"] = "retail.product.update";
|
|
76
|
+
Permission["RETAIL_PRODUCT_DELETE"] = "retail.product.delete";
|
|
77
|
+
Permission["RETAIL_PRODUCT_MDM_CONFIG"] = "retail.product.mdm_config";
|
|
78
|
+
Permission["RETAIL_INVENTORY_LIST"] = "retail.inventory.list";
|
|
79
|
+
Permission["RETAIL_INVENTORY_VIEW"] = "retail.inventory.view";
|
|
80
|
+
Permission["RETAIL_INVENTORY_UPDATE"] = "retail.inventory.update";
|
|
81
|
+
Permission["RETAIL_SALE_CREATE"] = "retail.sale.create";
|
|
82
|
+
Permission["RETAIL_SALE_LIST"] = "retail.sale.list";
|
|
83
|
+
Permission["RETAIL_SALE_CANCEL"] = "retail.sale.cancel";
|
|
84
|
+
Permission["RETAIL_STORE_MANAGE"] = "retail.store.manage";
|
|
85
|
+
Permission["RETAIL_RETAILER_MANAGE"] = "retail.retailer.manage";
|
|
86
|
+
// ====================================================
|
|
87
|
+
// LEND — créditos + cobranza
|
|
88
|
+
// ====================================================
|
|
89
|
+
Permission["LEND_CREDIT_CREATE"] = "lend.credit.create";
|
|
90
|
+
Permission["LEND_CREDIT_LIST"] = "lend.credit.list";
|
|
91
|
+
Permission["LEND_CREDIT_VIEW"] = "lend.credit.view";
|
|
92
|
+
Permission["LEND_CREDIT_UPDATE"] = "lend.credit.update";
|
|
93
|
+
Permission["LEND_CREDIT_LIQUIDATE"] = "lend.credit.liquidate";
|
|
94
|
+
Permission["LEND_CREDIT_RESTRUCTURE"] = "lend.credit.restructure";
|
|
95
|
+
Permission["LEND_PAYMENT_APPLY"] = "lend.payment.apply";
|
|
96
|
+
Permission["LEND_PAYMENT_LIST"] = "lend.payment.list";
|
|
97
|
+
Permission["LEND_PAYMENT_REVERSE"] = "lend.payment.reverse";
|
|
98
|
+
Permission["LEND_INSTALLMENT_VIEW"] = "lend.installment.view";
|
|
99
|
+
// ====================================================
|
|
100
|
+
// MDM — device management (subset especializado de LEND)
|
|
101
|
+
// ====================================================
|
|
102
|
+
Permission["MDM_DEVICE_ENROLL"] = "mdm.device.enroll";
|
|
103
|
+
Permission["MDM_DEVICE_RELEASE"] = "mdm.device.release";
|
|
104
|
+
Permission["MDM_DEVICE_ARCHIVE"] = "mdm.device.archive";
|
|
105
|
+
Permission["MDM_DEVICE_DEACTIVATE"] = "mdm.device.deactivate";
|
|
106
|
+
Permission["MDM_DEVICE_LOCK_MANUAL"] = "mdm.device.lock.manual";
|
|
107
|
+
Permission["MDM_DEVICE_UNLOCK_MANUAL"] = "mdm.device.unlock.manual";
|
|
108
|
+
Permission["MDM_DEVICE_PIN_UNLOCK"] = "mdm.device.pin_unlock";
|
|
109
|
+
Permission["MDM_DEVICE_EXTEND_VALIDITY"] = "mdm.device.extend_validity";
|
|
110
|
+
Permission["MDM_DEVICE_NOTIFY"] = "mdm.device.notify";
|
|
111
|
+
Permission["MDM_DEVICE_STATUS_VIEW"] = "mdm.device.status.view";
|
|
112
|
+
Permission["MDM_OPERATION_LOG_VIEW"] = "mdm.operation_log.view";
|
|
113
|
+
Permission["MDM_TEST"] = "mdm.test";
|
|
114
|
+
// ====================================================
|
|
115
|
+
// PAY — futuro FiadoPay (placeholder, no usado en MVP)
|
|
116
|
+
// ====================================================
|
|
117
|
+
Permission["PAY_TRANSACTION_VIEW"] = "pay.transaction.view";
|
|
118
|
+
})(Permission || (exports.Permission = Permission = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Categorías del catálogo de permissions (componente 01).
|
|
3
|
+
* TD-RBAC-005: `AUDIT` category sin permissions `audit.*` asociadas — drift consciente.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum PermissionCategory {
|
|
6
|
+
RBAC = "rbac",
|
|
7
|
+
PLATFORM = "platform",
|
|
8
|
+
TENANT = "tenant",
|
|
9
|
+
RETAIL = "retail",
|
|
10
|
+
LEND = "lend",
|
|
11
|
+
MDM = "mdm",
|
|
12
|
+
AUDIT = "audit",
|
|
13
|
+
PAY = "pay"
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PermissionCategory = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Categorías del catálogo de permissions (componente 01).
|
|
6
|
+
* TD-RBAC-005: `AUDIT` category sin permissions `audit.*` asociadas — drift consciente.
|
|
7
|
+
*/
|
|
8
|
+
var PermissionCategory;
|
|
9
|
+
(function (PermissionCategory) {
|
|
10
|
+
PermissionCategory["RBAC"] = "rbac";
|
|
11
|
+
PermissionCategory["PLATFORM"] = "platform";
|
|
12
|
+
PermissionCategory["TENANT"] = "tenant";
|
|
13
|
+
PermissionCategory["RETAIL"] = "retail";
|
|
14
|
+
PermissionCategory["LEND"] = "lend";
|
|
15
|
+
PermissionCategory["MDM"] = "mdm";
|
|
16
|
+
PermissionCategory["AUDIT"] = "audit";
|
|
17
|
+
PermissionCategory["PAY"] = "pay";
|
|
18
|
+
})(PermissionCategory || (exports.PermissionCategory = PermissionCategory = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PermissionScope = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Jerarquía: PLATFORM > TENANT > RETAILER > STORE.
|
|
6
|
+
* Componente 01 spec — copia exacta.
|
|
7
|
+
*/
|
|
8
|
+
var PermissionScope;
|
|
9
|
+
(function (PermissionScope) {
|
|
10
|
+
PermissionScope["PLATFORM"] = "PLATFORM";
|
|
11
|
+
PermissionScope["TENANT"] = "TENANT";
|
|
12
|
+
PermissionScope["RETAILER"] = "RETAILER";
|
|
13
|
+
PermissionScope["STORE"] = "STORE";
|
|
14
|
+
})(PermissionScope || (exports.PermissionScope = PermissionScope = {}));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Permission } from './enums/Permission';
|
|
2
|
+
export { PermissionScope } from './enums/PermissionScope';
|
|
3
|
+
export { PermissionCategory } from './enums/PermissionCategory';
|
|
4
|
+
export type { AuthContext } from './dtos/AuthContext';
|
|
5
|
+
export type { RoleAssignmentInfo } from './dtos/RoleAssignmentInfo';
|
|
6
|
+
export type { PermissionMeta } from './dtos/PermissionMeta';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// platformRbac — módulo del lambda platform-rbac-business (Fase 0 SureKeep).
|
|
3
|
+
//
|
|
4
|
+
// Coexiste con `Rbac` oficial cuando yhonhansen publique componente 01 — TD-RBAC-002
|
|
5
|
+
// del platform-rbac-business documenta la migración futura de los 4 símbolos cross-cutting
|
|
6
|
+
// (Permission, PermissionScope, AuthContext, RoleAssignmentInfo) de aquí a `rbac/`.
|
|
7
|
+
//
|
|
8
|
+
// En Fase 1.A los DTOs propios del rbac-business (CreateTenantRequest, AssignRoleRequest,
|
|
9
|
+
// EffectivePermissionsResponse, etc.) NO viven en este módulo todavía — se agregan en
|
|
10
|
+
// Fase 1.B cuando los managers que los consumen se implementen.
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PermissionCategory = exports.PermissionScope = exports.Permission = void 0;
|
|
13
|
+
var Permission_1 = require("./enums/Permission");
|
|
14
|
+
Object.defineProperty(exports, "Permission", { enumerable: true, get: function () { return Permission_1.Permission; } });
|
|
15
|
+
var PermissionScope_1 = require("./enums/PermissionScope");
|
|
16
|
+
Object.defineProperty(exports, "PermissionScope", { enumerable: true, get: function () { return PermissionScope_1.PermissionScope; } });
|
|
17
|
+
var PermissionCategory_1 = require("./enums/PermissionCategory");
|
|
18
|
+
Object.defineProperty(exports, "PermissionCategory", { enumerable: true, get: function () { return PermissionCategory_1.PermissionCategory; } });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tipo de User Pool de Cognito desde la perspectiva del modelo RBAC Fiado.
|
|
3
|
+
*
|
|
4
|
+
* Origen: spec del proyecto `cognito-backoffice-connector` (Fase 0, componente 01
|
|
5
|
+
* documento `docs/superpowers/specs/2026-05-26-cognito-connector-decisiones-pendientes-design.md`).
|
|
6
|
+
*
|
|
7
|
+
* Decisión (TD-003): el proyecto converge en estos 2 valores. El documento componente 03
|
|
8
|
+
* lista 3 valores (incluyendo una variante adicional) pero queda como outlier — la
|
|
9
|
+
* decisión vigente en los 6 docs restantes y en el plan de implementación es 2 valores:
|
|
10
|
+
* - BACKOFFICE_PLATFORM — pool del backoffice de plataforma (cross-tenant)
|
|
11
|
+
* - BACKOFFICE_TENANT — pool por tenant (multi-tenant isolation)
|
|
12
|
+
*/
|
|
13
|
+
export declare enum PoolKind {
|
|
14
|
+
BACKOFFICE_PLATFORM = "BACKOFFICE_PLATFORM",
|
|
15
|
+
BACKOFFICE_TENANT = "BACKOFFICE_TENANT"
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PoolKind = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Tipo de User Pool de Cognito desde la perspectiva del modelo RBAC Fiado.
|
|
6
|
+
*
|
|
7
|
+
* Origen: spec del proyecto `cognito-backoffice-connector` (Fase 0, componente 01
|
|
8
|
+
* documento `docs/superpowers/specs/2026-05-26-cognito-connector-decisiones-pendientes-design.md`).
|
|
9
|
+
*
|
|
10
|
+
* Decisión (TD-003): el proyecto converge en estos 2 valores. El documento componente 03
|
|
11
|
+
* lista 3 valores (incluyendo una variante adicional) pero queda como outlier — la
|
|
12
|
+
* decisión vigente en los 6 docs restantes y en el plan de implementación es 2 valores:
|
|
13
|
+
* - BACKOFFICE_PLATFORM — pool del backoffice de plataforma (cross-tenant)
|
|
14
|
+
* - BACKOFFICE_TENANT — pool por tenant (multi-tenant isolation)
|
|
15
|
+
*/
|
|
16
|
+
var PoolKind;
|
|
17
|
+
(function (PoolKind) {
|
|
18
|
+
PoolKind["BACKOFFICE_PLATFORM"] = "BACKOFFICE_PLATFORM";
|
|
19
|
+
PoolKind["BACKOFFICE_TENANT"] = "BACKOFFICE_TENANT";
|
|
20
|
+
})(PoolKind || (exports.PoolKind = PoolKind = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './enums/PoolKind';
|
|
@@ -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("./enums/PoolKind"), exports);
|
package/jest.config.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiado/type-kit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.39.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"types": "bin/index.d.ts",
|
|
@@ -13,8 +13,12 @@
|
|
|
13
13
|
"author": "Fiado Inc",
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"devDependencies": {
|
|
16
|
+
"@types/jest": "^30.0.0",
|
|
16
17
|
"@types/node": "^20.11.20",
|
|
17
18
|
"install": "^0.13.0",
|
|
19
|
+
"jest": "^30.4.2",
|
|
20
|
+
"reflect-metadata": "^0.2.2",
|
|
21
|
+
"ts-jest": "^29.4.11",
|
|
18
22
|
"typescript": "^5.3.3"
|
|
19
23
|
},
|
|
20
24
|
"dependencies": {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IsNotEmpty, IsObject } from "class-validator";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Body de PUT /backoffice/leaves/{leafId}/input-labels.
|
|
5
|
+
*
|
|
6
|
+
* Override de los `label` del inputSchema, keyed por `key` de campo
|
|
7
|
+
* (ej. `{ "phoneNumber": "Tu número Telcel" }`). El conector guarda el map y
|
|
8
|
+
* lo aplica al construir el schema; los campos sin override mantienen el label
|
|
9
|
+
* generado.
|
|
10
|
+
*/
|
|
11
|
+
export class BackofficeInputLabelsUpdateRequest {
|
|
12
|
+
/** Map fieldKey → label. Los valores deben ser strings. */
|
|
13
|
+
@IsObject()
|
|
14
|
+
@IsNotEmpty()
|
|
15
|
+
labels!: Record<string, string>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IsNotEmpty, IsString } from "class-validator";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Body de PUT /backoffice/leaves/{leafId}/help-image.
|
|
5
|
+
*
|
|
6
|
+
* Asigna la imagen de ayuda (`refSrc`) a TODOS los productos del servicio.
|
|
7
|
+
*/
|
|
8
|
+
export class BackofficeLeafHelpImageUpdateRequest {
|
|
9
|
+
/** URL pública de la imagen de ayuda (CloudFront) ya subida. */
|
|
10
|
+
@IsString()
|
|
11
|
+
@IsNotEmpty()
|
|
12
|
+
helpImage!: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IsBoolean } from "class-validator";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Body de PUT /backoffice/leaves/{leafId}/products/{productId}/enabled.
|
|
5
|
+
*
|
|
6
|
+
* Habilita/deshabilita UN producto. Un producto con `enabled=false` se oculta
|
|
7
|
+
* del catálogo público (la ausencia del campo = habilitado).
|
|
8
|
+
*/
|
|
9
|
+
export class BackofficeProductEnabledUpdateRequest {
|
|
10
|
+
@IsBoolean()
|
|
11
|
+
enabled!: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IsNotEmpty, IsString } from "class-validator";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Body de PUT /backoffice/leaves/{leafId}/products/{productId}/help-image.
|
|
5
|
+
*
|
|
6
|
+
* Asigna la imagen de ayuda (`refSrc`) a UN producto específico del servicio.
|
|
7
|
+
*/
|
|
8
|
+
export class BackofficeProductHelpImageUpdateRequest {
|
|
9
|
+
/** URL pública de la imagen de ayuda (CloudFront) ya subida. */
|
|
10
|
+
@IsString()
|
|
11
|
+
@IsNotEmpty()
|
|
12
|
+
helpImage!: string;
|
|
13
|
+
}
|