@fiado/type-kit 3.78.0 → 3.80.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.
@@ -1,6 +1,6 @@
1
1
  // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
2
 
3
- exports[`PERMISSION_BIT_ORDER PERMS_VERSION es número estable 1`] = `4037934643`;
3
+ exports[`PERMISSION_BIT_ORDER PERMS_VERSION es número estable 1`] = `1113835415`;
4
4
 
5
5
  exports[`PERMISSION_BIT_ORDER append-only: snapshot del ORDEN COMPLETO (rompe ante cualquier reorden/inserción) 1`] = `
6
6
  [
@@ -94,5 +94,28 @@ exports[`PERMISSION_BIT_ORDER append-only: snapshot del ORDEN COMPLETO (rompe an
94
94
  "mdm.operation_log.view",
95
95
  "mdm.test",
96
96
  "pay.transaction.view",
97
+ "agents.agent.list",
98
+ "agents.agent.create",
99
+ "agents.agent.create_bulk",
100
+ "agents.agent.move",
101
+ "agents.agent.delete",
102
+ "agents.referral.view",
103
+ "agents.ranking.view",
104
+ "agents.production.view",
105
+ "agents.person.search",
106
+ "agents.person.view",
107
+ "agents.person.update",
108
+ "agents.document.view",
109
+ "agents.document.upload",
110
+ "agents.address.view",
111
+ "agents.address.manage",
112
+ "agents.beneficiary.view",
113
+ "agents.beneficiary.manage",
114
+ "agents.card.issue",
115
+ "agents.chat.view",
116
+ "agents.chat.send",
117
+ "agents.notification.send",
118
+ "agents.export.run",
119
+ "agents.catalog.view",
97
120
  ]
98
121
  `;
@@ -118,7 +118,30 @@ export declare enum Permission {
118
118
  MDM_DEVICE_STATUS_VIEW = "mdm.device.status.view",
119
119
  MDM_OPERATION_LOG_VIEW = "mdm.operation_log.view",
120
120
  MDM_TEST = "mdm.test",
121
- PAY_TRANSACTION_VIEW = "pay.transaction.view"
121
+ PAY_TRANSACTION_VIEW = "pay.transaction.view",
122
+ AGENTS_AGENT_LIST = "agents.agent.list",
123
+ AGENTS_AGENT_CREATE = "agents.agent.create",
124
+ AGENTS_AGENT_CREATE_BULK = "agents.agent.create_bulk",
125
+ AGENTS_AGENT_MOVE = "agents.agent.move",
126
+ AGENTS_AGENT_DELETE = "agents.agent.delete",
127
+ AGENTS_REFERRAL_VIEW = "agents.referral.view",
128
+ AGENTS_RANKING_VIEW = "agents.ranking.view",
129
+ AGENTS_PRODUCTION_VIEW = "agents.production.view",
130
+ AGENTS_PERSON_SEARCH = "agents.person.search",
131
+ AGENTS_PERSON_VIEW = "agents.person.view",
132
+ AGENTS_PERSON_UPDATE = "agents.person.update",
133
+ AGENTS_DOCUMENT_VIEW = "agents.document.view",
134
+ AGENTS_DOCUMENT_UPLOAD = "agents.document.upload",
135
+ AGENTS_ADDRESS_VIEW = "agents.address.view",
136
+ AGENTS_ADDRESS_MANAGE = "agents.address.manage",
137
+ AGENTS_BENEFICIARY_VIEW = "agents.beneficiary.view",
138
+ AGENTS_BENEFICIARY_MANAGE = "agents.beneficiary.manage",
139
+ AGENTS_CARD_ISSUE = "agents.card.issue",
140
+ AGENTS_CHAT_VIEW = "agents.chat.view",
141
+ AGENTS_CHAT_SEND = "agents.chat.send",
142
+ AGENTS_NOTIFICATION_SEND = "agents.notification.send",
143
+ AGENTS_EXPORT_RUN = "agents.export.run",
144
+ AGENTS_CATALOG_VIEW = "agents.catalog.view"
122
145
  }
123
146
  /**
124
147
  * Orden CANÓNICO y APPEND-ONLY de los permisos para el bitset del token.
@@ -154,6 +154,35 @@ var Permission;
154
154
  // PAY — futuro FiadoPay (placeholder, no usado en MVP)
155
155
  // ====================================================
156
156
  Permission["PAY_TRANSACTION_VIEW"] = "pay.transaction.view";
157
+ // ====================================================
158
+ // AGENTS — Fiado Agents (tenant type AGENTS, roles scope GROUP).
159
+ // Permisos de DOMINIO derivados de los endpoints/pantallas reales del webapp de agents
160
+ // (ver fiado-agents-webapp/docs/rbac/RBAC-agents.md §5.2). El aislamiento entre orgs lo da el
161
+ // scope GROUP del roleAssignment (scopeRef = Group_GT.id), no un permiso aparte.
162
+ // ====================================================
163
+ Permission["AGENTS_AGENT_LIST"] = "agents.agent.list";
164
+ Permission["AGENTS_AGENT_CREATE"] = "agents.agent.create";
165
+ Permission["AGENTS_AGENT_CREATE_BULK"] = "agents.agent.create_bulk";
166
+ Permission["AGENTS_AGENT_MOVE"] = "agents.agent.move";
167
+ Permission["AGENTS_AGENT_DELETE"] = "agents.agent.delete";
168
+ Permission["AGENTS_REFERRAL_VIEW"] = "agents.referral.view";
169
+ Permission["AGENTS_RANKING_VIEW"] = "agents.ranking.view";
170
+ Permission["AGENTS_PRODUCTION_VIEW"] = "agents.production.view";
171
+ Permission["AGENTS_PERSON_SEARCH"] = "agents.person.search";
172
+ Permission["AGENTS_PERSON_VIEW"] = "agents.person.view";
173
+ Permission["AGENTS_PERSON_UPDATE"] = "agents.person.update";
174
+ Permission["AGENTS_DOCUMENT_VIEW"] = "agents.document.view";
175
+ Permission["AGENTS_DOCUMENT_UPLOAD"] = "agents.document.upload";
176
+ Permission["AGENTS_ADDRESS_VIEW"] = "agents.address.view";
177
+ Permission["AGENTS_ADDRESS_MANAGE"] = "agents.address.manage";
178
+ Permission["AGENTS_BENEFICIARY_VIEW"] = "agents.beneficiary.view";
179
+ Permission["AGENTS_BENEFICIARY_MANAGE"] = "agents.beneficiary.manage";
180
+ Permission["AGENTS_CARD_ISSUE"] = "agents.card.issue";
181
+ Permission["AGENTS_CHAT_VIEW"] = "agents.chat.view";
182
+ Permission["AGENTS_CHAT_SEND"] = "agents.chat.send";
183
+ Permission["AGENTS_NOTIFICATION_SEND"] = "agents.notification.send";
184
+ Permission["AGENTS_EXPORT_RUN"] = "agents.export.run";
185
+ Permission["AGENTS_CATALOG_VIEW"] = "agents.catalog.view";
157
186
  })(Permission || (exports.Permission = Permission = {}));
158
187
  /**
159
188
  * Orden CANÓNICO y APPEND-ONLY de los permisos para el bitset del token.
@@ -257,6 +286,30 @@ exports.PERMISSION_BIT_ORDER = [
257
286
  Permission.MDM_OPERATION_LOG_VIEW,
258
287
  Permission.MDM_TEST,
259
288
  Permission.PAY_TRANSACTION_VIEW,
289
+ // AGENTS (append-only) — Fiado Agents domain perms.
290
+ Permission.AGENTS_AGENT_LIST,
291
+ Permission.AGENTS_AGENT_CREATE,
292
+ Permission.AGENTS_AGENT_CREATE_BULK,
293
+ Permission.AGENTS_AGENT_MOVE,
294
+ Permission.AGENTS_AGENT_DELETE,
295
+ Permission.AGENTS_REFERRAL_VIEW,
296
+ Permission.AGENTS_RANKING_VIEW,
297
+ Permission.AGENTS_PRODUCTION_VIEW,
298
+ Permission.AGENTS_PERSON_SEARCH,
299
+ Permission.AGENTS_PERSON_VIEW,
300
+ Permission.AGENTS_PERSON_UPDATE,
301
+ Permission.AGENTS_DOCUMENT_VIEW,
302
+ Permission.AGENTS_DOCUMENT_UPLOAD,
303
+ Permission.AGENTS_ADDRESS_VIEW,
304
+ Permission.AGENTS_ADDRESS_MANAGE,
305
+ Permission.AGENTS_BENEFICIARY_VIEW,
306
+ Permission.AGENTS_BENEFICIARY_MANAGE,
307
+ Permission.AGENTS_CARD_ISSUE,
308
+ Permission.AGENTS_CHAT_VIEW,
309
+ Permission.AGENTS_CHAT_SEND,
310
+ Permission.AGENTS_NOTIFICATION_SEND,
311
+ Permission.AGENTS_EXPORT_RUN,
312
+ Permission.AGENTS_CATALOG_VIEW,
260
313
  ];
261
314
  function djb2(input) {
262
315
  let h = 5381;
@@ -10,5 +10,6 @@ export declare enum PermissionCategory {
10
10
  LEND = "lend",
11
11
  MDM = "mdm",
12
12
  AUDIT = "audit",
13
- PAY = "pay"
13
+ PAY = "pay",
14
+ AGENTS = "agents"
14
15
  }
@@ -15,4 +15,5 @@ var PermissionCategory;
15
15
  PermissionCategory["MDM"] = "mdm";
16
16
  PermissionCategory["AUDIT"] = "audit";
17
17
  PermissionCategory["PAY"] = "pay";
18
+ PermissionCategory["AGENTS"] = "agents";
18
19
  })(PermissionCategory || (exports.PermissionCategory = PermissionCategory = {}));
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Request de `POST /risk/backoffice/profiles/{directoryId}/notes` (BO-03 §3.3).
3
+ *
4
+ * Nota de revisión humana del OC sobre el perfil. Cualquier nota cuenta como
5
+ * revisión y reinicia el sello `lastReviewedAt`/`lastReviewedBy` del perfil
6
+ * (Manual de Cumplimiento sec. 8.25 / Art. 24 — re-evaluación cíclica).
7
+ * No se distingue "Revisión OK" de "Nota libre".
8
+ */
9
+ export declare class CreateProfileNoteRequest {
10
+ email: string;
11
+ comment: string;
12
+ attachmentKeys?: string[];
13
+ }
@@ -0,0 +1,44 @@
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.CreateProfileNoteRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ /**
16
+ * Request de `POST /risk/backoffice/profiles/{directoryId}/notes` (BO-03 §3.3).
17
+ *
18
+ * Nota de revisión humana del OC sobre el perfil. Cualquier nota cuenta como
19
+ * revisión y reinicia el sello `lastReviewedAt`/`lastReviewedBy` del perfil
20
+ * (Manual de Cumplimiento sec. 8.25 / Art. 24 — re-evaluación cíclica).
21
+ * No se distingue "Revisión OK" de "Nota libre".
22
+ */
23
+ class CreateProfileNoteRequest {
24
+ }
25
+ exports.CreateProfileNoteRequest = CreateProfileNoteRequest;
26
+ __decorate([
27
+ (0, class_transformer_1.Expose)(),
28
+ (0, class_validator_1.IsEmail)({}, { message: "email debe ser un correo válido" }),
29
+ __metadata("design:type", String)
30
+ ], CreateProfileNoteRequest.prototype, "email", void 0);
31
+ __decorate([
32
+ (0, class_transformer_1.Expose)(),
33
+ (0, class_validator_1.IsString)(),
34
+ (0, class_validator_1.MinLength)(10),
35
+ (0, class_validator_1.MaxLength)(2000),
36
+ __metadata("design:type", String)
37
+ ], CreateProfileNoteRequest.prototype, "comment", void 0);
38
+ __decorate([
39
+ (0, class_transformer_1.Expose)(),
40
+ (0, class_validator_1.IsOptional)(),
41
+ (0, class_validator_1.IsArray)(),
42
+ (0, class_validator_1.IsString)({ each: true }),
43
+ __metadata("design:type", Array)
44
+ ], CreateProfileNoteRequest.prototype, "attachmentKeys", void 0);
@@ -40,3 +40,4 @@ export * from './dtos/private/SetDeclaredIncomeResponse';
40
40
  export * from './dtos/private/CreateClientFinancialHistoryRequest';
41
41
  export * from './dtos/private/ClientFinancialHistoryResponse';
42
42
  export * from './dtos/private/ListClientFinancialHistoryResponse';
43
+ export * from './dtos/private/CreateProfileNoteRequest';
@@ -58,3 +58,4 @@ __exportStar(require("./dtos/private/SetDeclaredIncomeResponse"), exports);
58
58
  __exportStar(require("./dtos/private/CreateClientFinancialHistoryRequest"), exports);
59
59
  __exportStar(require("./dtos/private/ClientFinancialHistoryResponse"), exports);
60
60
  __exportStar(require("./dtos/private/ListClientFinancialHistoryResponse"), exports);
61
+ __exportStar(require("./dtos/private/CreateProfileNoteRequest"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.78.0",
3
+ "version": "3.80.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -154,6 +154,36 @@ export enum Permission {
154
154
  // PAY — futuro FiadoPay (placeholder, no usado en MVP)
155
155
  // ====================================================
156
156
  PAY_TRANSACTION_VIEW = 'pay.transaction.view',
157
+
158
+ // ====================================================
159
+ // AGENTS — Fiado Agents (tenant type AGENTS, roles scope GROUP).
160
+ // Permisos de DOMINIO derivados de los endpoints/pantallas reales del webapp de agents
161
+ // (ver fiado-agents-webapp/docs/rbac/RBAC-agents.md §5.2). El aislamiento entre orgs lo da el
162
+ // scope GROUP del roleAssignment (scopeRef = Group_GT.id), no un permiso aparte.
163
+ // ====================================================
164
+ AGENTS_AGENT_LIST = 'agents.agent.list',
165
+ AGENTS_AGENT_CREATE = 'agents.agent.create',
166
+ AGENTS_AGENT_CREATE_BULK = 'agents.agent.create_bulk',
167
+ AGENTS_AGENT_MOVE = 'agents.agent.move',
168
+ AGENTS_AGENT_DELETE = 'agents.agent.delete',
169
+ AGENTS_REFERRAL_VIEW = 'agents.referral.view',
170
+ AGENTS_RANKING_VIEW = 'agents.ranking.view',
171
+ AGENTS_PRODUCTION_VIEW = 'agents.production.view',
172
+ AGENTS_PERSON_SEARCH = 'agents.person.search',
173
+ AGENTS_PERSON_VIEW = 'agents.person.view',
174
+ AGENTS_PERSON_UPDATE = 'agents.person.update',
175
+ AGENTS_DOCUMENT_VIEW = 'agents.document.view',
176
+ AGENTS_DOCUMENT_UPLOAD = 'agents.document.upload',
177
+ AGENTS_ADDRESS_VIEW = 'agents.address.view',
178
+ AGENTS_ADDRESS_MANAGE = 'agents.address.manage',
179
+ AGENTS_BENEFICIARY_VIEW = 'agents.beneficiary.view',
180
+ AGENTS_BENEFICIARY_MANAGE = 'agents.beneficiary.manage',
181
+ AGENTS_CARD_ISSUE = 'agents.card.issue',
182
+ AGENTS_CHAT_VIEW = 'agents.chat.view',
183
+ AGENTS_CHAT_SEND = 'agents.chat.send',
184
+ AGENTS_NOTIFICATION_SEND = 'agents.notification.send',
185
+ AGENTS_EXPORT_RUN = 'agents.export.run',
186
+ AGENTS_CATALOG_VIEW = 'agents.catalog.view',
157
187
  }
158
188
 
159
189
  /**
@@ -258,6 +288,30 @@ export const PERMISSION_BIT_ORDER: readonly Permission[] = [
258
288
  Permission.MDM_OPERATION_LOG_VIEW,
259
289
  Permission.MDM_TEST,
260
290
  Permission.PAY_TRANSACTION_VIEW,
291
+ // AGENTS (append-only) — Fiado Agents domain perms.
292
+ Permission.AGENTS_AGENT_LIST,
293
+ Permission.AGENTS_AGENT_CREATE,
294
+ Permission.AGENTS_AGENT_CREATE_BULK,
295
+ Permission.AGENTS_AGENT_MOVE,
296
+ Permission.AGENTS_AGENT_DELETE,
297
+ Permission.AGENTS_REFERRAL_VIEW,
298
+ Permission.AGENTS_RANKING_VIEW,
299
+ Permission.AGENTS_PRODUCTION_VIEW,
300
+ Permission.AGENTS_PERSON_SEARCH,
301
+ Permission.AGENTS_PERSON_VIEW,
302
+ Permission.AGENTS_PERSON_UPDATE,
303
+ Permission.AGENTS_DOCUMENT_VIEW,
304
+ Permission.AGENTS_DOCUMENT_UPLOAD,
305
+ Permission.AGENTS_ADDRESS_VIEW,
306
+ Permission.AGENTS_ADDRESS_MANAGE,
307
+ Permission.AGENTS_BENEFICIARY_VIEW,
308
+ Permission.AGENTS_BENEFICIARY_MANAGE,
309
+ Permission.AGENTS_CARD_ISSUE,
310
+ Permission.AGENTS_CHAT_VIEW,
311
+ Permission.AGENTS_CHAT_SEND,
312
+ Permission.AGENTS_NOTIFICATION_SEND,
313
+ Permission.AGENTS_EXPORT_RUN,
314
+ Permission.AGENTS_CATALOG_VIEW,
261
315
  ] as const;
262
316
 
263
317
  function djb2(input: string): number {
@@ -11,4 +11,5 @@ export enum PermissionCategory {
11
11
  MDM = 'mdm',
12
12
  AUDIT = 'audit',
13
13
  PAY = 'pay',
14
+ AGENTS = 'agents',
14
15
  }
@@ -0,0 +1,32 @@
1
+ import { Expose } from "class-transformer";
2
+ import { IsArray, IsEmail, IsOptional, IsString, MaxLength, MinLength } from "class-validator";
3
+
4
+ /**
5
+ * Request de `POST /risk/backoffice/profiles/{directoryId}/notes` (BO-03 §3.3).
6
+ *
7
+ * Nota de revisión humana del OC sobre el perfil. Cualquier nota cuenta como
8
+ * revisión y reinicia el sello `lastReviewedAt`/`lastReviewedBy` del perfil
9
+ * (Manual de Cumplimiento sec. 8.25 / Art. 24 — re-evaluación cíclica).
10
+ * No se distingue "Revisión OK" de "Nota libre".
11
+ */
12
+ export class CreateProfileNoteRequest {
13
+
14
+ // Email del OC que registra la nota → se persiste como autor + lastReviewedBy.
15
+ @Expose()
16
+ @IsEmail({}, { message: "email debe ser un correo válido" })
17
+ email!: string;
18
+
19
+ // Texto de la nota. Entre 10 y 2000 caracteres.
20
+ @Expose()
21
+ @IsString()
22
+ @MinLength(10)
23
+ @MaxLength(2000)
24
+ comment!: string;
25
+
26
+ // Claves S3 de adjuntos opcionales (PDF/imagen). El Dashboard firma y sube.
27
+ @Expose()
28
+ @IsOptional()
29
+ @IsArray()
30
+ @IsString({ each: true })
31
+ attachmentKeys?: string[];
32
+ }
@@ -45,4 +45,5 @@ export * from './dtos/private/SetDeclaredIncomeResponse';
45
45
  export * from './dtos/private/CreateClientFinancialHistoryRequest';
46
46
  export * from './dtos/private/ClientFinancialHistoryResponse';
47
47
  export * from './dtos/private/ListClientFinancialHistoryResponse';
48
+ export * from './dtos/private/CreateProfileNoteRequest';
48
49