@fiado/type-kit 3.192.0 → 3.193.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.
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Body del POST /internal/tenants/{tenantId}/users/../levels/{level}/entities (endpoint privado, VPC/ANONIMUS).
3
+ * `tenantId` y `level` viajan en el path (no acá). Crea una scope-entity genérica L1/L2/L3 en RBAC.
4
+ *
5
+ * Consumido por el espejo de jerarquía de SureKeep F1 (retailer→L1, zona→L2, tienda→L3) vía api-invoker.
6
+ * - `id` es BYOID (DEC-RBAC-027): el caller trae su propio id → creates idempotentes (PutItem overwrite).
7
+ * - `parentId` es obligatorio para L2/L3 (id del nivel superior); ausente en L1 (cuelga de TENANT). Lo valida el manager.
8
+ * - `createdBy` = cognitoSub del admin real (audit), propagado desde el evento de outbox.
9
+ */
10
+ export declare class CreateLevelEntityRequest {
11
+ displayName: string;
12
+ id?: string;
13
+ parentId?: string;
14
+ createdBy: string;
15
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CreateLevelEntityRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ /**
16
+ * Body del POST /internal/tenants/{tenantId}/users/../levels/{level}/entities (endpoint privado, VPC/ANONIMUS).
17
+ * `tenantId` y `level` viajan en el path (no acá). Crea una scope-entity genérica L1/L2/L3 en RBAC.
18
+ *
19
+ * Consumido por el espejo de jerarquía de SureKeep F1 (retailer→L1, zona→L2, tienda→L3) vía api-invoker.
20
+ * - `id` es BYOID (DEC-RBAC-027): el caller trae su propio id → creates idempotentes (PutItem overwrite).
21
+ * - `parentId` es obligatorio para L2/L3 (id del nivel superior); ausente en L1 (cuelga de TENANT). Lo valida el manager.
22
+ * - `createdBy` = cognitoSub del admin real (audit), propagado desde el evento de outbox.
23
+ */
24
+ class CreateLevelEntityRequest {
25
+ }
26
+ exports.CreateLevelEntityRequest = CreateLevelEntityRequest;
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
+ ], CreateLevelEntityRequest.prototype, "displayName", void 0);
33
+ __decorate([
34
+ (0, class_transformer_1.Expose)(),
35
+ (0, class_validator_1.IsOptional)(),
36
+ (0, class_validator_1.IsString)(),
37
+ (0, class_validator_1.IsNotEmpty)(),
38
+ __metadata("design:type", String)
39
+ ], CreateLevelEntityRequest.prototype, "id", void 0);
40
+ __decorate([
41
+ (0, class_transformer_1.Expose)(),
42
+ (0, class_validator_1.IsOptional)(),
43
+ (0, class_validator_1.IsString)(),
44
+ (0, class_validator_1.IsNotEmpty)(),
45
+ __metadata("design:type", String)
46
+ ], CreateLevelEntityRequest.prototype, "parentId", void 0);
47
+ __decorate([
48
+ (0, class_transformer_1.Expose)(),
49
+ (0, class_validator_1.IsString)(),
50
+ (0, class_validator_1.IsNotEmpty)(),
51
+ __metadata("design:type", String)
52
+ ], CreateLevelEntityRequest.prototype, "createdBy", void 0);
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Respuesta del POST create-level-entity (endpoint privado). Espejo público de la scope-entity creada
3
+ * (SharedLevelEntityRow del rbac-business). Interface plain → export type-only.
4
+ */
5
+ export interface CreateLevelEntityResponse {
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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,19 @@
1
+ import { PermissionScope } from '../enums/PermissionScope';
2
+ /**
3
+ * Body del POST /internal/tenants/{tenantId}/users (endpoint privado, VPC/ANONIMUS). `tenantId` viaja en el path.
4
+ * Provisiona Cognito + SharedUser + RoleAssignment (rol + scopeRef) en RBAC — reusa UserProvisioningService.
5
+ *
6
+ * Consumido por el alta de usuario orquestada de SureKeep F1 (retail-org → RBAC → RetailUser) vía api-invoker.
7
+ * - Usuario provisionado en estado INVITED (mitiga orphan si el paso siguiente en retail-org falla).
8
+ * - Idempotente por identidad Cognito.
9
+ * - `scope`/`scopeRef` = grant del rol (ej. LEVEL_3 + storeId para un vendedor de tienda).
10
+ * - `createdBy` = cognitoSub del admin real (audit + grantedBy del assignment).
11
+ */
12
+ export declare class CreateTenantUserRequest {
13
+ email: string;
14
+ displayName?: string;
15
+ roleId: string;
16
+ scope: PermissionScope;
17
+ scopeRef: string;
18
+ createdBy: string;
19
+ }
@@ -0,0 +1,63 @@
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.CreateTenantUserRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const PermissionScope_1 = require("../enums/PermissionScope");
16
+ /**
17
+ * Body del POST /internal/tenants/{tenantId}/users (endpoint privado, VPC/ANONIMUS). `tenantId` viaja en el path.
18
+ * Provisiona Cognito + SharedUser + RoleAssignment (rol + scopeRef) en RBAC — reusa UserProvisioningService.
19
+ *
20
+ * Consumido por el alta de usuario orquestada de SureKeep F1 (retail-org → RBAC → RetailUser) vía api-invoker.
21
+ * - Usuario provisionado en estado INVITED (mitiga orphan si el paso siguiente en retail-org falla).
22
+ * - Idempotente por identidad Cognito.
23
+ * - `scope`/`scopeRef` = grant del rol (ej. LEVEL_3 + storeId para un vendedor de tienda).
24
+ * - `createdBy` = cognitoSub del admin real (audit + grantedBy del assignment).
25
+ */
26
+ class CreateTenantUserRequest {
27
+ }
28
+ exports.CreateTenantUserRequest = CreateTenantUserRequest;
29
+ __decorate([
30
+ (0, class_transformer_1.Expose)(),
31
+ (0, class_validator_1.IsEmail)(),
32
+ __metadata("design:type", String)
33
+ ], CreateTenantUserRequest.prototype, "email", void 0);
34
+ __decorate([
35
+ (0, class_transformer_1.Expose)(),
36
+ (0, class_validator_1.IsOptional)(),
37
+ (0, class_validator_1.IsString)(),
38
+ (0, class_validator_1.IsNotEmpty)(),
39
+ __metadata("design:type", String)
40
+ ], CreateTenantUserRequest.prototype, "displayName", void 0);
41
+ __decorate([
42
+ (0, class_transformer_1.Expose)(),
43
+ (0, class_validator_1.IsString)(),
44
+ (0, class_validator_1.IsNotEmpty)(),
45
+ __metadata("design:type", String)
46
+ ], CreateTenantUserRequest.prototype, "roleId", void 0);
47
+ __decorate([
48
+ (0, class_transformer_1.Expose)(),
49
+ (0, class_validator_1.IsEnum)(PermissionScope_1.PermissionScope),
50
+ __metadata("design:type", String)
51
+ ], CreateTenantUserRequest.prototype, "scope", void 0);
52
+ __decorate([
53
+ (0, class_transformer_1.Expose)(),
54
+ (0, class_validator_1.IsString)(),
55
+ (0, class_validator_1.IsNotEmpty)(),
56
+ __metadata("design:type", String)
57
+ ], CreateTenantUserRequest.prototype, "scopeRef", void 0);
58
+ __decorate([
59
+ (0, class_transformer_1.Expose)(),
60
+ (0, class_validator_1.IsString)(),
61
+ (0, class_validator_1.IsNotEmpty)(),
62
+ __metadata("design:type", String)
63
+ ], CreateTenantUserRequest.prototype, "createdBy", void 0);
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Respuesta del POST create-tenant-user (endpoint privado). Devuelve el cognitoSub del usuario
3
+ * provisionado, que retail-org guarda en el RetailUser para el match F1↔RBAC. Interface plain → type-only.
4
+ */
5
+ export interface CreateTenantUserResponse {
6
+ cognitoSub: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -48,3 +48,7 @@ export type { RoleScopeRecompute, InconsistentAssignment, CascadeTenantFailure,
48
48
  export * from './dtos/SelfRegisterStartRequest';
49
49
  export * from './dtos/SelfRegisterVerifyOtpRequest';
50
50
  export * from './dtos/SelfRegisterCompleteRequest';
51
+ export * from './dtos/CreateLevelEntityRequest';
52
+ export type { CreateLevelEntityResponse } from './dtos/CreateLevelEntityResponse';
53
+ export * from './dtos/CreateTenantUserRequest';
54
+ export type { CreateTenantUserResponse } from './dtos/CreateTenantUserResponse';
@@ -99,3 +99,8 @@ __exportStar(require("./enums/PermissionKind"), exports);
99
99
  __exportStar(require("./dtos/SelfRegisterStartRequest"), exports);
100
100
  __exportStar(require("./dtos/SelfRegisterVerifyOtpRequest"), exports);
101
101
  __exportStar(require("./dtos/SelfRegisterCompleteRequest"), exports);
102
+ // Endpoints privados de espejo de jerarquía + alta de usuario (SureKeep F1, scope mirror).
103
+ // Request DTOs llevan decoradores class-validator → export de valor (se hidratan con plainToInstance);
104
+ // Response son interfaces plain → type-only. Consumidos por retail-org vía api-invoker (Publisher).
105
+ __exportStar(require("./dtos/CreateLevelEntityRequest"), exports);
106
+ __exportStar(require("./dtos/CreateTenantUserRequest"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.192.0",
3
+ "version": "3.193.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -0,0 +1,18 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
3
+
4
+ /**
5
+ * Body del POST /internal/tenants/{tenantId}/users/../levels/{level}/entities (endpoint privado, VPC/ANONIMUS).
6
+ * `tenantId` y `level` viajan en el path (no acá). Crea una scope-entity genérica L1/L2/L3 en RBAC.
7
+ *
8
+ * Consumido por el espejo de jerarquía de SureKeep F1 (retailer→L1, zona→L2, tienda→L3) vía api-invoker.
9
+ * - `id` es BYOID (DEC-RBAC-027): el caller trae su propio id → creates idempotentes (PutItem overwrite).
10
+ * - `parentId` es obligatorio para L2/L3 (id del nivel superior); ausente en L1 (cuelga de TENANT). Lo valida el manager.
11
+ * - `createdBy` = cognitoSub del admin real (audit), propagado desde el evento de outbox.
12
+ */
13
+ export class CreateLevelEntityRequest {
14
+ @Expose() @IsString() @IsNotEmpty() displayName!: string;
15
+ @Expose() @IsOptional() @IsString() @IsNotEmpty() id?: string;
16
+ @Expose() @IsOptional() @IsString() @IsNotEmpty() parentId?: string;
17
+ @Expose() @IsString() @IsNotEmpty() createdBy!: string;
18
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Respuesta del POST create-level-entity (endpoint privado). Espejo público de la scope-entity creada
3
+ * (SharedLevelEntityRow del rbac-business). Interface plain → export type-only.
4
+ */
5
+ export interface CreateLevelEntityResponse {
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,22 @@
1
+ import { Expose } from 'class-transformer';
2
+ import { IsEmail, IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator';
3
+ import { PermissionScope } from '../enums/PermissionScope';
4
+
5
+ /**
6
+ * Body del POST /internal/tenants/{tenantId}/users (endpoint privado, VPC/ANONIMUS). `tenantId` viaja en el path.
7
+ * Provisiona Cognito + SharedUser + RoleAssignment (rol + scopeRef) en RBAC — reusa UserProvisioningService.
8
+ *
9
+ * Consumido por el alta de usuario orquestada de SureKeep F1 (retail-org → RBAC → RetailUser) vía api-invoker.
10
+ * - Usuario provisionado en estado INVITED (mitiga orphan si el paso siguiente en retail-org falla).
11
+ * - Idempotente por identidad Cognito.
12
+ * - `scope`/`scopeRef` = grant del rol (ej. LEVEL_3 + storeId para un vendedor de tienda).
13
+ * - `createdBy` = cognitoSub del admin real (audit + grantedBy del assignment).
14
+ */
15
+ export class CreateTenantUserRequest {
16
+ @Expose() @IsEmail() email!: string;
17
+ @Expose() @IsOptional() @IsString() @IsNotEmpty() displayName?: string;
18
+ @Expose() @IsString() @IsNotEmpty() roleId!: string;
19
+ @Expose() @IsEnum(PermissionScope) scope!: PermissionScope;
20
+ @Expose() @IsString() @IsNotEmpty() scopeRef!: string;
21
+ @Expose() @IsString() @IsNotEmpty() createdBy!: string;
22
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Respuesta del POST create-tenant-user (endpoint privado). Devuelve el cognitoSub del usuario
3
+ * provisionado, que retail-org guarda en el RetailUser para el match F1↔RBAC. Interface plain → type-only.
4
+ */
5
+ export interface CreateTenantUserResponse {
6
+ cognitoSub: string;
7
+ }
@@ -123,3 +123,11 @@ export type {
123
123
  export * from './dtos/SelfRegisterStartRequest';
124
124
  export * from './dtos/SelfRegisterVerifyOtpRequest';
125
125
  export * from './dtos/SelfRegisterCompleteRequest';
126
+
127
+ // Endpoints privados de espejo de jerarquía + alta de usuario (SureKeep F1, scope mirror).
128
+ // Request DTOs llevan decoradores class-validator → export de valor (se hidratan con plainToInstance);
129
+ // Response son interfaces plain → type-only. Consumidos por retail-org vía api-invoker (Publisher).
130
+ export * from './dtos/CreateLevelEntityRequest';
131
+ export type { CreateLevelEntityResponse } from './dtos/CreateLevelEntityResponse';
132
+ export * from './dtos/CreateTenantUserRequest';
133
+ export type { CreateTenantUserResponse } from './dtos/CreateTenantUserResponse';