@fiado/type-kit 3.454.0 → 3.455.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.
Files changed (81) hide show
  1. package/_test_/unit/platformRbac/dtos/levelEntityAdminDtos.test.ts +60 -0
  2. package/_test_/unit/platformRbac/dtos/tenantRoleAdminDtos.test.ts +64 -0
  3. package/_test_/unit/platformRbac/dtos/tenantUserAdminDtos.test.ts +128 -0
  4. package/bin/platformRbac/dtos/AssignTenantRoleRequest.d.ts +13 -0
  5. package/bin/platformRbac/dtos/AssignTenantRoleRequest.js +57 -0
  6. package/bin/platformRbac/dtos/AssignTenantRoleResponse.d.ts +4 -0
  7. package/bin/platformRbac/dtos/AssignTenantRoleResponse.js +2 -0
  8. package/bin/platformRbac/dtos/CreateTenantUserResponse.d.ts +8 -0
  9. package/bin/platformRbac/dtos/DeleteLevelEntityRequest.d.ts +4 -0
  10. package/bin/platformRbac/dtos/DeleteLevelEntityRequest.js +24 -0
  11. package/bin/platformRbac/dtos/DeleteLevelEntityResponse.d.ts +4 -0
  12. package/bin/platformRbac/dtos/DeleteLevelEntityResponse.js +2 -0
  13. package/bin/platformRbac/dtos/DeleteTenantUserRequest.d.ts +4 -0
  14. package/bin/platformRbac/dtos/DeleteTenantUserRequest.js +24 -0
  15. package/bin/platformRbac/dtos/DisableTenantUserRequest.d.ts +7 -0
  16. package/bin/platformRbac/dtos/DisableTenantUserRequest.js +27 -0
  17. package/bin/platformRbac/dtos/EnableTenantUserRequest.d.ts +7 -0
  18. package/bin/platformRbac/dtos/EnableTenantUserRequest.js +27 -0
  19. package/bin/platformRbac/dtos/GetTenantUserResponse.d.ts +10 -0
  20. package/bin/platformRbac/dtos/GetTenantUserResponse.js +2 -0
  21. package/bin/platformRbac/dtos/LevelEntityResponse.d.ts +14 -0
  22. package/bin/platformRbac/dtos/LevelEntityResponse.js +2 -0
  23. package/bin/platformRbac/dtos/ListLevelEntitiesResponse.d.ts +8 -0
  24. package/bin/platformRbac/dtos/ListLevelEntitiesResponse.js +2 -0
  25. package/bin/platformRbac/dtos/ListTenantRolesResponse.d.ts +5 -0
  26. package/bin/platformRbac/dtos/ListTenantRolesResponse.js +2 -0
  27. package/bin/platformRbac/dtos/ListTenantUsersResponse.d.ts +8 -0
  28. package/bin/platformRbac/dtos/ListTenantUsersResponse.js +2 -0
  29. package/bin/platformRbac/dtos/ResetTenantUserMfaRequest.d.ts +7 -0
  30. package/bin/platformRbac/dtos/ResetTenantUserMfaRequest.js +27 -0
  31. package/bin/platformRbac/dtos/ResetTenantUserPasswordRequest.d.ts +7 -0
  32. package/bin/platformRbac/dtos/ResetTenantUserPasswordRequest.js +27 -0
  33. package/bin/platformRbac/dtos/ResetTenantUserPasswordResponse.d.ts +7 -0
  34. package/bin/platformRbac/dtos/ResetTenantUserPasswordResponse.js +2 -0
  35. package/bin/platformRbac/dtos/RevokeTenantRoleRequest.d.ts +5 -0
  36. package/bin/platformRbac/dtos/RevokeTenantRoleRequest.js +32 -0
  37. package/bin/platformRbac/dtos/RevokeTenantRoleResponse.d.ts +4 -0
  38. package/bin/platformRbac/dtos/RevokeTenantRoleResponse.js +2 -0
  39. package/bin/platformRbac/dtos/TenantRoleResponse.d.ts +20 -0
  40. package/bin/platformRbac/dtos/TenantRoleResponse.js +2 -0
  41. package/bin/platformRbac/dtos/TenantUserAckResponse.d.ts +7 -0
  42. package/bin/platformRbac/dtos/TenantUserAckResponse.js +2 -0
  43. package/bin/platformRbac/dtos/TenantUserAssignmentResponse.d.ts +14 -0
  44. package/bin/platformRbac/dtos/TenantUserAssignmentResponse.js +2 -0
  45. package/bin/platformRbac/dtos/TenantUserListItemResponse.d.ts +9 -0
  46. package/bin/platformRbac/dtos/TenantUserListItemResponse.js +2 -0
  47. package/bin/platformRbac/dtos/TenantUserResponse.d.ts +29 -0
  48. package/bin/platformRbac/dtos/TenantUserResponse.js +2 -0
  49. package/bin/platformRbac/dtos/UpdateLevelEntityRequest.d.ts +8 -0
  50. package/bin/platformRbac/dtos/UpdateLevelEntityRequest.js +35 -0
  51. package/bin/platformRbac/dtos/UpdateTenantUserRequest.d.ts +8 -0
  52. package/bin/platformRbac/dtos/UpdateTenantUserRequest.js +35 -0
  53. package/bin/platformRbac/index.d.ts +25 -1
  54. package/bin/platformRbac/index.js +11 -1
  55. package/package.json +1 -1
  56. package/src/platformRbac/dtos/AssignTenantRoleRequest.ts +16 -0
  57. package/src/platformRbac/dtos/AssignTenantRoleResponse.ts +4 -0
  58. package/src/platformRbac/dtos/CreateTenantUserResponse.ts +13 -0
  59. package/src/platformRbac/dtos/DeleteLevelEntityRequest.ts +7 -0
  60. package/src/platformRbac/dtos/DeleteLevelEntityResponse.ts +4 -0
  61. package/src/platformRbac/dtos/DeleteTenantUserRequest.ts +7 -0
  62. package/src/platformRbac/dtos/DisableTenantUserRequest.ts +10 -0
  63. package/src/platformRbac/dtos/EnableTenantUserRequest.ts +10 -0
  64. package/src/platformRbac/dtos/GetTenantUserResponse.ts +11 -0
  65. package/src/platformRbac/dtos/LevelEntityResponse.ts +14 -0
  66. package/src/platformRbac/dtos/ListLevelEntitiesResponse.ts +9 -0
  67. package/src/platformRbac/dtos/ListTenantRolesResponse.ts +6 -0
  68. package/src/platformRbac/dtos/ListTenantUsersResponse.ts +9 -0
  69. package/src/platformRbac/dtos/ResetTenantUserMfaRequest.ts +10 -0
  70. package/src/platformRbac/dtos/ResetTenantUserPasswordRequest.ts +10 -0
  71. package/src/platformRbac/dtos/ResetTenantUserPasswordResponse.ts +7 -0
  72. package/src/platformRbac/dtos/RevokeTenantRoleRequest.ts +10 -0
  73. package/src/platformRbac/dtos/RevokeTenantRoleResponse.ts +4 -0
  74. package/src/platformRbac/dtos/TenantRoleResponse.ts +21 -0
  75. package/src/platformRbac/dtos/TenantUserAckResponse.ts +7 -0
  76. package/src/platformRbac/dtos/TenantUserAssignmentResponse.ts +17 -0
  77. package/src/platformRbac/dtos/TenantUserListItemResponse.ts +10 -0
  78. package/src/platformRbac/dtos/TenantUserResponse.ts +30 -0
  79. package/src/platformRbac/dtos/UpdateLevelEntityRequest.ts +11 -0
  80. package/src/platformRbac/dtos/UpdateTenantUserRequest.ts +11 -0
  81. package/src/platformRbac/index.ts +30 -2
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Respuesta del reset de contraseña. Viene en claro porque no se manda correo: el operador se la
3
+ * comparte al agente por el canal que tenga a mano.
4
+ */
5
+ export interface ResetTenantUserPasswordResponse {
6
+ temporaryPassword: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ /** Body del POST que revoca una asignación de rol. El `assignmentId` viaja en el path. */
2
+ export declare class RevokeTenantRoleRequest {
3
+ cognitoSub: string;
4
+ actedBy: string;
5
+ }
@@ -0,0 +1,32 @@
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.RevokeTenantRoleRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ /** Body del POST que revoca una asignación de rol. El `assignmentId` viaja en el path. */
16
+ // Sin `cognitoSub` el endpoint no revoca nada: la clave de la tabla de asignaciones es
17
+ // cognitoSub + assignmentId.
18
+ class RevokeTenantRoleRequest {
19
+ }
20
+ exports.RevokeTenantRoleRequest = RevokeTenantRoleRequest;
21
+ __decorate([
22
+ (0, class_transformer_1.Expose)(),
23
+ (0, class_validator_1.IsString)(),
24
+ (0, class_validator_1.IsNotEmpty)(),
25
+ __metadata("design:type", String)
26
+ ], RevokeTenantRoleRequest.prototype, "cognitoSub", void 0);
27
+ __decorate([
28
+ (0, class_transformer_1.Expose)(),
29
+ (0, class_validator_1.IsString)(),
30
+ (0, class_validator_1.IsNotEmpty)(),
31
+ __metadata("design:type", String)
32
+ ], RevokeTenantRoleRequest.prototype, "actedBy", void 0);
@@ -0,0 +1,4 @@
1
+ /** Respuesta de la revocación de una asignación. */
2
+ export interface RevokeTenantRoleResponse {
3
+ status: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,20 @@
1
+ import type { Permission } from '../enums/Permission';
2
+ import type { PermissionScope } from '../enums/PermissionScope';
3
+ /**
4
+ * Proyección pública de un rol del tenant (SharedRole del RBAC), con su catálogo de permisos y el
5
+ * scope al que se puede asignar.
6
+ */
7
+ export interface TenantRoleResponse {
8
+ roleId: string;
9
+ displayName: string;
10
+ description?: string;
11
+ permissions: Permission[];
12
+ isSystem: boolean;
13
+ scope: PermissionScope;
14
+ createdAt: number;
15
+ updatedAt: number;
16
+ createdBy?: string;
17
+ updatedBy?: string;
18
+ deletedAt?: number;
19
+ deletedBy?: string;
20
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Acuse simple que comparten suspender, reactivar, resetear el MFA y borrar un usuario — es
3
+ * exactamente lo que devuelven hoy sus gemelos con sesión.
4
+ */
5
+ export interface TenantUserAckResponse {
6
+ ok: boolean;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import type { PermissionScope } from '../enums/PermissionScope';
2
+ /**
3
+ * Una asignación de rol vigente de un usuario, enriquecida con los nombres legibles del rol y del
4
+ * grupo al que apunta.
5
+ */
6
+ export interface TenantUserAssignmentResponse {
7
+ assignmentId: string;
8
+ roleId: string;
9
+ roleName: string;
10
+ scope: PermissionScope;
11
+ scopeRef: string;
12
+ scopeRefName: string;
13
+ scopeRefParentName?: string;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import type { PermissionScope } from '../enums/PermissionScope';
2
+ import type { TenantUserResponse } from './TenantUserResponse';
3
+ /** Un usuario en el listado, con los nombres de sus roles y el scope más alto que alcanza. */
4
+ export interface TenantUserListItemResponse extends TenantUserResponse {
5
+ /** Nombres legibles del rol, no sus ids. */
6
+ roles: string[];
7
+ topScope?: PermissionScope;
8
+ topScopeRef?: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,29 @@
1
+ /** Estados posibles de un usuario del tenant en el RBAC. */
2
+ export type TenantUserStatusValue = 'INVITED' | 'ACTIVE' | 'SUSPENDED' | 'LOCKED' | 'OFFBOARDED' | 'DELETED';
3
+ /** Origen del alta del usuario en el RBAC. */
4
+ export type TenantUserSourceValue = 'cognito_trigger' | 'admin_create' | 'self_register';
5
+ /**
6
+ * Proyección pública de un usuario del tenant (SharedUser del RBAC), con sus campos personalizados
7
+ * y las marcas de su última sesión y su último sync desde Cognito.
8
+ */
9
+ export interface TenantUserResponse {
10
+ cognitoSub: string;
11
+ email?: string;
12
+ displayName: string;
13
+ phone?: string;
14
+ tenantId: string;
15
+ status: TenantUserStatusValue;
16
+ userPoolId?: string;
17
+ retailerId?: string;
18
+ storeIds?: string[];
19
+ source?: TenantUserSourceValue;
20
+ createdAt: number;
21
+ updatedAt: number;
22
+ createdBy?: string;
23
+ updatedBy?: string;
24
+ lastLoginAt?: number;
25
+ lastSyncedFromCognito?: number;
26
+ customFields?: {
27
+ [key: string]: string;
28
+ };
29
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Body del PUT que renombra un grupo. `tenantId`, `level` y el id del grupo viajan en el path.
3
+ * `actedBy` es el cognitoSub de quien accionó en el backoffice — es lo único que queda en la auditoría.
4
+ */
5
+ export declare class UpdateLevelEntityRequest {
6
+ displayName?: string;
7
+ actedBy: string;
8
+ }
@@ -0,0 +1,35 @@
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.UpdateLevelEntityRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ /**
16
+ * Body del PUT que renombra un grupo. `tenantId`, `level` y el id del grupo viajan en el path.
17
+ * `actedBy` es el cognitoSub de quien accionó en el backoffice — es lo único que queda en la auditoría.
18
+ */
19
+ class UpdateLevelEntityRequest {
20
+ }
21
+ exports.UpdateLevelEntityRequest = UpdateLevelEntityRequest;
22
+ __decorate([
23
+ (0, class_transformer_1.Expose)(),
24
+ (0, class_validator_1.IsOptional)(),
25
+ (0, class_validator_1.IsString)(),
26
+ (0, class_validator_1.IsNotEmpty)(),
27
+ (0, class_validator_1.MaxLength)(120),
28
+ __metadata("design:type", String)
29
+ ], UpdateLevelEntityRequest.prototype, "displayName", void 0);
30
+ __decorate([
31
+ (0, class_transformer_1.Expose)(),
32
+ (0, class_validator_1.IsString)(),
33
+ (0, class_validator_1.IsNotEmpty)(),
34
+ __metadata("design:type", String)
35
+ ], UpdateLevelEntityRequest.prototype, "actedBy", void 0);
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Body del PUT que renombra a un usuario. El correo es inmutable en el rbac y el grupo se mueve
3
+ * reasignando el rol, así que aquí no viaja ninguno de los dos.
4
+ */
5
+ export declare class UpdateTenantUserRequest {
6
+ displayName?: string;
7
+ actedBy: string;
8
+ }
@@ -0,0 +1,35 @@
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.UpdateTenantUserRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ /**
16
+ * Body del PUT que renombra a un usuario. El correo es inmutable en el rbac y el grupo se mueve
17
+ * reasignando el rol, así que aquí no viaja ninguno de los dos.
18
+ */
19
+ class UpdateTenantUserRequest {
20
+ }
21
+ exports.UpdateTenantUserRequest = UpdateTenantUserRequest;
22
+ __decorate([
23
+ (0, class_transformer_1.Expose)(),
24
+ (0, class_validator_1.IsOptional)(),
25
+ (0, class_validator_1.IsString)(),
26
+ (0, class_validator_1.IsNotEmpty)(),
27
+ (0, class_validator_1.MaxLength)(120),
28
+ __metadata("design:type", String)
29
+ ], UpdateTenantUserRequest.prototype, "displayName", void 0);
30
+ __decorate([
31
+ (0, class_transformer_1.Expose)(),
32
+ (0, class_validator_1.IsString)(),
33
+ (0, class_validator_1.IsNotEmpty)(),
34
+ __metadata("design:type", String)
35
+ ], UpdateTenantUserRequest.prototype, "actedBy", void 0);
@@ -54,9 +54,33 @@ export * from './dtos/SelfRegisterCompleteRequest';
54
54
  export * from './dtos/CreateLevelEntityRequest';
55
55
  export type { CreateLevelEntityResponse } from './dtos/CreateLevelEntityResponse';
56
56
  export * from './dtos/CreateTenantUserRequest';
57
- export type { CreateTenantUserResponse } from './dtos/CreateTenantUserResponse';
57
+ export type { CreateTenantUserResponse, TenantUserOutcomeValue } from './dtos/CreateTenantUserResponse';
58
58
  export * from './dtos/CreateIntegrationRequest';
59
59
  export * from './dtos/UpdateIntegrationRequest';
60
60
  export type { IntegrationResponse, IntegrationStatusValue } from './dtos/IntegrationResponse';
61
61
  export type { IntegrationKeyResponse, IntegrationKeyStatusValue, IssueIntegrationKeyResponse, } from './dtos/IntegrationKeyResponse';
62
62
  export type { IntegrationWhoamiResponse } from './dtos/IntegrationWhoamiResponse';
63
+ export type { LevelEntityResponse } from './dtos/LevelEntityResponse';
64
+ export type { TenantUserResponse, TenantUserStatusValue, TenantUserSourceValue } from './dtos/TenantUserResponse';
65
+ export type { TenantUserAssignmentResponse } from './dtos/TenantUserAssignmentResponse';
66
+ export type { TenantRoleResponse } from './dtos/TenantRoleResponse';
67
+ export type { ListLevelEntitiesResponse } from './dtos/ListLevelEntitiesResponse';
68
+ export * from './dtos/UpdateLevelEntityRequest';
69
+ export * from './dtos/DeleteLevelEntityRequest';
70
+ export type { DeleteLevelEntityResponse } from './dtos/DeleteLevelEntityResponse';
71
+ export type { ListTenantUsersResponse } from './dtos/ListTenantUsersResponse';
72
+ export type { TenantUserListItemResponse } from './dtos/TenantUserListItemResponse';
73
+ export type { GetTenantUserResponse } from './dtos/GetTenantUserResponse';
74
+ export * from './dtos/UpdateTenantUserRequest';
75
+ export * from './dtos/DeleteTenantUserRequest';
76
+ export * from './dtos/DisableTenantUserRequest';
77
+ export * from './dtos/EnableTenantUserRequest';
78
+ export * from './dtos/ResetTenantUserPasswordRequest';
79
+ export type { ResetTenantUserPasswordResponse } from './dtos/ResetTenantUserPasswordResponse';
80
+ export * from './dtos/ResetTenantUserMfaRequest';
81
+ export type { TenantUserAckResponse } from './dtos/TenantUserAckResponse';
82
+ export type { ListTenantRolesResponse } from './dtos/ListTenantRolesResponse';
83
+ export * from './dtos/AssignTenantRoleRequest';
84
+ export type { AssignTenantRoleResponse } from './dtos/AssignTenantRoleResponse';
85
+ export * from './dtos/RevokeTenantRoleRequest';
86
+ export type { RevokeTenantRoleResponse } from './dtos/RevokeTenantRoleResponse';
@@ -6,7 +6,7 @@
6
6
  // (Permission, PermissionScope, AuthContext, RoleAssignmentInfo) de aquí a `rbac/`.
7
7
  //
8
8
  // Los DTOs propios del rbac-business se van agregando a medida que los flujos los necesitan.
9
- // EffectivePermissionsResponse ya vive acá (lo consume jwt-inyector vía /internal/effective-permissions).
9
+ // EffectivePermissionsResponse ya vive aquí (lo consume jwt-inyector vía /internal/effective-permissions).
10
10
  // Otros DTOs aún pendientes se sumarán cuando los managers que los consumen se implementen.
11
11
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
12
  if (k2 === undefined) k2 = k;
@@ -115,3 +115,13 @@ __exportStar(require("./dtos/CreateTenantUserRequest"), exports);
115
115
  // Los requests van como clase (class-validator); las responses como tipo.
116
116
  __exportStar(require("./dtos/CreateIntegrationRequest"), exports);
117
117
  __exportStar(require("./dtos/UpdateIntegrationRequest"), exports);
118
+ __exportStar(require("./dtos/UpdateLevelEntityRequest"), exports);
119
+ __exportStar(require("./dtos/DeleteLevelEntityRequest"), exports);
120
+ __exportStar(require("./dtos/UpdateTenantUserRequest"), exports);
121
+ __exportStar(require("./dtos/DeleteTenantUserRequest"), exports);
122
+ __exportStar(require("./dtos/DisableTenantUserRequest"), exports);
123
+ __exportStar(require("./dtos/EnableTenantUserRequest"), exports);
124
+ __exportStar(require("./dtos/ResetTenantUserPasswordRequest"), exports);
125
+ __exportStar(require("./dtos/ResetTenantUserMfaRequest"), exports);
126
+ __exportStar(require("./dtos/AssignTenantRoleRequest"), exports);
127
+ __exportStar(require("./dtos/RevokeTenantRoleRequest"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.454.0",
3
+ "version": "3.455.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -0,0 +1,16 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsEnum, IsNotEmpty, IsNumber, IsOptional, IsString } from 'class-validator';
3
+ import { PermissionScope } from '../enums/PermissionScope';
4
+
5
+ /**
6
+ * Body del POST que asigna un rol a un usuario en un scope. Un rol y un solo `scopeRef` por
7
+ * llamada; `expiresAt` en epoch ms deja la asignación temporal.
8
+ */
9
+ export class AssignTenantRoleRequest {
10
+ @Expose() @IsString() @IsNotEmpty() cognitoSub!: string;
11
+ @Expose() @IsString() @IsNotEmpty() roleId!: string;
12
+ @Expose() @IsEnum(PermissionScope) scope!: PermissionScope;
13
+ @Expose() @IsString() @IsNotEmpty() scopeRef!: string;
14
+ @Expose() @IsOptional() @IsNumber() expiresAt?: number;
15
+ @Expose() @IsString() @IsNotEmpty() actedBy!: string;
16
+ }
@@ -0,0 +1,4 @@
1
+ /** Respuesta del alta de una asignación: el `assignmentId` con el que después se revoca. */
2
+ export interface AssignTenantRoleResponse {
3
+ assignmentId: string;
4
+ }
@@ -1,7 +1,20 @@
1
+ import type { TenantUserStatusValue } from './TenantUserResponse';
2
+
3
+ /** Desenlace del alta: si el correo ya tenía usuario se lo adopta en vez de crear otro. */
4
+ export type TenantUserOutcomeValue = 'CREATED' | 'ADOPTED';
5
+
1
6
  /**
2
7
  * Respuesta del POST create-tenant-user (endpoint privado). Devuelve el cognitoSub del usuario
3
8
  * provisionado, que retail-org guarda en el RetailUser para el match F1↔RBAC. Interface plain → type-only.
4
9
  */
5
10
  export interface CreateTenantUserResponse {
6
11
  cognitoSub: string;
12
+ // DEC-RBAC-079: ausente en un tenant phone-primary sin identificador secundario.
13
+ email?: string;
14
+ status: TenantUserStatusValue;
15
+ // Solo viene en un alta nueva: a un usuario adoptado no se le pisa la contraseña que ya está usando.
16
+ // El operador muestra la credencial si y solo si este campo llegó; `outcome` explica por qué no llegó.
17
+ temporaryPassword?: string;
18
+ rolesAssigned: string[];
19
+ outcome: TenantUserOutcomeValue;
7
20
  }
@@ -0,0 +1,7 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsString } from 'class-validator';
3
+
4
+ /** Body del DELETE de un grupo. `tenantId`, `level` y el id del grupo viajan en el path. */
5
+ export class DeleteLevelEntityRequest {
6
+ @Expose() @IsString() @IsNotEmpty() actedBy!: string;
7
+ }
@@ -0,0 +1,4 @@
1
+ /** Respuesta del DELETE de un grupo. */
2
+ export interface DeleteLevelEntityResponse {
3
+ deleted: boolean;
4
+ }
@@ -0,0 +1,7 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsString } from 'class-validator';
3
+
4
+ /** Body del DELETE de un usuario. `tenantId` y `cognitoSub` viajan en el path. */
5
+ export class DeleteTenantUserRequest {
6
+ @Expose() @IsString() @IsNotEmpty() actedBy!: string;
7
+ }
@@ -0,0 +1,10 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsString } from 'class-validator';
3
+
4
+ /**
5
+ * Body del endpoint que suspende a un usuario. `actedBy` es el cognitoSub de quien accionó en el
6
+ * backoffice — es lo único que queda en la auditoría.
7
+ */
8
+ export class DisableTenantUserRequest {
9
+ @Expose() @IsString() @IsNotEmpty() actedBy!: string;
10
+ }
@@ -0,0 +1,10 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsString } from 'class-validator';
3
+
4
+ /**
5
+ * Body del endpoint que reactiva a un usuario suspendido. `actedBy` es el cognitoSub de quien
6
+ * accionó en el backoffice — es lo único que queda en la auditoría.
7
+ */
8
+ export class EnableTenantUserRequest {
9
+ @Expose() @IsString() @IsNotEmpty() actedBy!: string;
10
+ }
@@ -0,0 +1,11 @@
1
+ import type { TenantUserAssignmentResponse } from './TenantUserAssignmentResponse';
2
+ import type { TenantUserResponse } from './TenantUserResponse';
3
+
4
+ /**
5
+ * Respuesta del detalle de un usuario: además de sus datos, trae los nombres de sus roles y sus
6
+ * asignaciones vigentes con el `assignmentId` de cada una.
7
+ */
8
+ export interface GetTenantUserResponse extends TenantUserResponse {
9
+ roles: string[];
10
+ roleAssignments: TenantUserAssignmentResponse[];
11
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Proyección pública de una entidad de nivel (grupo) del RBAC: la devuelven el listado, el detalle
3
+ * y la actualización de grupos. Convive con CreateLevelEntityResponse, que ya es contrato publicado.
4
+ */
5
+ export interface LevelEntityResponse {
6
+ id: string;
7
+ displayName: string;
8
+ parentId?: string;
9
+ level: string;
10
+ createdAt: number;
11
+ updatedAt: number;
12
+ createdBy?: string;
13
+ updatedBy?: string;
14
+ }
@@ -0,0 +1,9 @@
1
+ import type { LevelEntityResponse } from './LevelEntityResponse';
2
+
3
+ /**
4
+ * Respuesta del listado de grupos de un nivel. El GET acepta `parentId` opcional en la query para
5
+ * traer solo los hijos de un grupo.
6
+ */
7
+ export interface ListLevelEntitiesResponse {
8
+ items: LevelEntityResponse[];
9
+ }
@@ -0,0 +1,6 @@
1
+ import type { TenantRoleResponse } from './TenantRoleResponse';
2
+
3
+ /** Respuesta del listado de roles del tenant, para armar el selector de asignación. */
4
+ export interface ListTenantRolesResponse {
5
+ items: TenantRoleResponse[];
6
+ }
@@ -0,0 +1,9 @@
1
+ import type { TenantUserListItemResponse } from './TenantUserListItemResponse';
2
+
3
+ /**
4
+ * Respuesta del listado de usuarios del tenant. El GET acepta `email` opcional en la query para
5
+ * encontrar una cuenta que ya existía y adoptarla.
6
+ */
7
+ export interface ListTenantUsersResponse {
8
+ items: TenantUserListItemResponse[];
9
+ }
@@ -0,0 +1,10 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsString } from 'class-validator';
3
+
4
+ /**
5
+ * Body del endpoint que resetea el MFA de un usuario. `actedBy` es el cognitoSub de quien accionó
6
+ * en el backoffice — es lo único que queda en la auditoría.
7
+ */
8
+ export class ResetTenantUserMfaRequest {
9
+ @Expose() @IsString() @IsNotEmpty() actedBy!: string;
10
+ }
@@ -0,0 +1,10 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsString } from 'class-validator';
3
+
4
+ /**
5
+ * Body del endpoint que resetea la contraseña de un usuario. `actedBy` es el cognitoSub de quien
6
+ * accionó en el backoffice — es lo único que queda en la auditoría.
7
+ */
8
+ export class ResetTenantUserPasswordRequest {
9
+ @Expose() @IsString() @IsNotEmpty() actedBy!: string;
10
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Respuesta del reset de contraseña. Viene en claro porque no se manda correo: el operador se la
3
+ * comparte al agente por el canal que tenga a mano.
4
+ */
5
+ export interface ResetTenantUserPasswordResponse {
6
+ temporaryPassword: string;
7
+ }
@@ -0,0 +1,10 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsString } from 'class-validator';
3
+
4
+ /** Body del POST que revoca una asignación de rol. El `assignmentId` viaja en el path. */
5
+ // Sin `cognitoSub` el endpoint no revoca nada: la clave de la tabla de asignaciones es
6
+ // cognitoSub + assignmentId.
7
+ export class RevokeTenantRoleRequest {
8
+ @Expose() @IsString() @IsNotEmpty() cognitoSub!: string;
9
+ @Expose() @IsString() @IsNotEmpty() actedBy!: string;
10
+ }
@@ -0,0 +1,4 @@
1
+ /** Respuesta de la revocación de una asignación. */
2
+ export interface RevokeTenantRoleResponse {
3
+ status: string;
4
+ }
@@ -0,0 +1,21 @@
1
+ import type { Permission } from '../enums/Permission';
2
+ import type { PermissionScope } from '../enums/PermissionScope';
3
+
4
+ /**
5
+ * Proyección pública de un rol del tenant (SharedRole del RBAC), con su catálogo de permisos y el
6
+ * scope al que se puede asignar.
7
+ */
8
+ export interface TenantRoleResponse {
9
+ roleId: string;
10
+ displayName: string;
11
+ description?: string;
12
+ permissions: Permission[];
13
+ isSystem: boolean;
14
+ scope: PermissionScope;
15
+ createdAt: number;
16
+ updatedAt: number;
17
+ createdBy?: string;
18
+ updatedBy?: string;
19
+ deletedAt?: number;
20
+ deletedBy?: string;
21
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Acuse simple que comparten suspender, reactivar, resetear el MFA y borrar un usuario — es
3
+ * exactamente lo que devuelven hoy sus gemelos con sesión.
4
+ */
5
+ export interface TenantUserAckResponse {
6
+ ok: boolean;
7
+ }
@@ -0,0 +1,17 @@
1
+ import type { PermissionScope } from '../enums/PermissionScope';
2
+
3
+ /**
4
+ * Una asignación de rol vigente de un usuario, enriquecida con los nombres legibles del rol y del
5
+ * grupo al que apunta.
6
+ */
7
+ // `assignmentId` es lo que necesitas para revocar: el endpoint de revoke lo recibe en el path,
8
+ // junto con el `cognitoSub` en el cuerpo.
9
+ export interface TenantUserAssignmentResponse {
10
+ assignmentId: string;
11
+ roleId: string;
12
+ roleName: string;
13
+ scope: PermissionScope;
14
+ scopeRef: string;
15
+ scopeRefName: string;
16
+ scopeRefParentName?: string;
17
+ }
@@ -0,0 +1,10 @@
1
+ import type { PermissionScope } from '../enums/PermissionScope';
2
+ import type { TenantUserResponse } from './TenantUserResponse';
3
+
4
+ /** Un usuario en el listado, con los nombres de sus roles y el scope más alto que alcanza. */
5
+ export interface TenantUserListItemResponse extends TenantUserResponse {
6
+ /** Nombres legibles del rol, no sus ids. */
7
+ roles: string[];
8
+ topScope?: PermissionScope;
9
+ topScopeRef?: string;
10
+ }
@@ -0,0 +1,30 @@
1
+ /** Estados posibles de un usuario del tenant en el RBAC. */
2
+ export type TenantUserStatusValue = 'INVITED' | 'ACTIVE' | 'SUSPENDED' | 'LOCKED' | 'OFFBOARDED' | 'DELETED';
3
+
4
+ /** Origen del alta del usuario en el RBAC. */
5
+ export type TenantUserSourceValue = 'cognito_trigger' | 'admin_create' | 'self_register';
6
+
7
+ /**
8
+ * Proyección pública de un usuario del tenant (SharedUser del RBAC), con sus campos personalizados
9
+ * y las marcas de su última sesión y su último sync desde Cognito.
10
+ */
11
+ export interface TenantUserResponse {
12
+ cognitoSub: string;
13
+ // DEC-RBAC-079: ausente en un tenant phone-primary sin identificador secundario.
14
+ email?: string;
15
+ displayName: string;
16
+ phone?: string;
17
+ tenantId: string;
18
+ status: TenantUserStatusValue;
19
+ userPoolId?: string;
20
+ retailerId?: string;
21
+ storeIds?: string[];
22
+ source?: TenantUserSourceValue;
23
+ createdAt: number;
24
+ updatedAt: number;
25
+ createdBy?: string;
26
+ updatedBy?: string;
27
+ lastLoginAt?: number;
28
+ lastSyncedFromCognito?: number;
29
+ customFields?: { [key: string]: string };
30
+ }