@fiado/type-kit 3.79.0 → 3.81.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
  `;
@@ -14,6 +14,7 @@ export declare class ComplaintResponse {
14
14
  deadlineAt: string;
15
15
  dictamenAt?: string | null;
16
16
  dictamenBy?: string | null;
17
+ dictamenNotes?: string | null;
17
18
  createdAt?: string;
18
19
  }
19
20
  /** Respuesta del create — ids para enlazar denuncia ↔ alerta. */
@@ -59,6 +59,10 @@ __decorate([
59
59
  (0, class_transformer_1.Expose)(),
60
60
  __metadata("design:type", String)
61
61
  ], ComplaintResponse.prototype, "dictamenBy", void 0);
62
+ __decorate([
63
+ (0, class_transformer_1.Expose)(),
64
+ __metadata("design:type", String)
65
+ ], ComplaintResponse.prototype, "dictamenNotes", void 0);
62
66
  __decorate([
63
67
  (0, class_transformer_1.Expose)(),
64
68
  __metadata("design:type", String)
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Request del hook de dictamen (`POST /complaints/{complaintId}/status`, BO-19b).
3
+ * Sincroniza el estado de la denuncia tras el dictamen del OC.
4
+ * `status` solo acepta los estados de cierre (`OPEN` no es válido como entrada).
5
+ */
6
+ export declare class UpdateComplaintStatusRequest {
7
+ status: string;
8
+ dictamenBy: string;
9
+ dictamenNotes?: string;
10
+ }
@@ -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.UpdateComplaintStatusRequest = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const ComplaintStatus_1 = require("../enums/ComplaintStatus");
16
+ /**
17
+ * Request del hook de dictamen (`POST /complaints/{complaintId}/status`, BO-19b).
18
+ * Sincroniza el estado de la denuncia tras el dictamen del OC.
19
+ * `status` solo acepta los estados de cierre (`OPEN` no es válido como entrada).
20
+ */
21
+ class UpdateComplaintStatusRequest {
22
+ }
23
+ exports.UpdateComplaintStatusRequest = UpdateComplaintStatusRequest;
24
+ __decorate([
25
+ (0, class_transformer_1.Expose)(),
26
+ (0, class_validator_1.IsString)(),
27
+ (0, class_validator_1.IsIn)([ComplaintStatus_1.ComplaintStatus.CLOSE_JUSTIFIED, ComplaintStatus_1.ComplaintStatus.CLOSE_RULED], {
28
+ message: "status debe ser CLOSE_JUSTIFIED o CLOSE_RULED",
29
+ }),
30
+ __metadata("design:type", String)
31
+ ], UpdateComplaintStatusRequest.prototype, "status", void 0);
32
+ __decorate([
33
+ (0, class_transformer_1.Expose)(),
34
+ (0, class_validator_1.IsString)(),
35
+ (0, class_validator_1.IsNotEmpty)(),
36
+ __metadata("design:type", String)
37
+ ], UpdateComplaintStatusRequest.prototype, "dictamenBy", void 0);
38
+ __decorate([
39
+ (0, class_transformer_1.Expose)(),
40
+ (0, class_validator_1.IsOptional)(),
41
+ (0, class_validator_1.IsString)(),
42
+ (0, class_validator_1.MaxLength)(1000),
43
+ __metadata("design:type", String)
44
+ ], UpdateComplaintStatusRequest.prototype, "dictamenNotes", void 0);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Estados del ciclo de vida de una denuncia (`Complaints_GT`, BO-19/BO-19b).
3
+ * `OPEN` al crearse; pasa a `CLOSE_*` cuando el OC dictamina (hook BO-19b).
4
+ */
5
+ export declare enum ComplaintStatus {
6
+ OPEN = "OPEN",
7
+ CLOSE_JUSTIFIED = "CLOSE_JUSTIFIED",
8
+ CLOSE_RULED = "CLOSE_RULED"
9
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ComplaintStatus = void 0;
4
+ /**
5
+ * Estados del ciclo de vida de una denuncia (`Complaints_GT`, BO-19/BO-19b).
6
+ * `OPEN` al crearse; pasa a `CLOSE_*` cuando el OC dictamina (hook BO-19b).
7
+ */
8
+ var ComplaintStatus;
9
+ (function (ComplaintStatus) {
10
+ ComplaintStatus["OPEN"] = "OPEN";
11
+ ComplaintStatus["CLOSE_JUSTIFIED"] = "CLOSE_JUSTIFIED";
12
+ ComplaintStatus["CLOSE_RULED"] = "CLOSE_RULED";
13
+ })(ComplaintStatus || (exports.ComplaintStatus = ComplaintStatus = {}));
@@ -1,2 +1,4 @@
1
1
  export * from './dtos/CreateComplaintRequest';
2
2
  export * from './dtos/ComplaintResponse';
3
+ export * from './dtos/UpdateComplaintStatusRequest';
4
+ export * from './enums/ComplaintStatus';
@@ -14,5 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ //dtos
17
18
  __exportStar(require("./dtos/CreateComplaintRequest"), exports);
18
19
  __exportStar(require("./dtos/ComplaintResponse"), exports);
20
+ __exportStar(require("./dtos/UpdateComplaintStatusRequest"), exports);
21
+ //enums
22
+ __exportStar(require("./enums/ComplaintStatus"), exports);
@@ -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 = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "3.79.0",
3
+ "version": "3.81.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -16,6 +16,7 @@ export class ComplaintResponse {
16
16
  @Expose() deadlineAt!: string;
17
17
  @Expose() dictamenAt?: string | null;
18
18
  @Expose() dictamenBy?: string | null;
19
+ @Expose() dictamenNotes?: string | null;
19
20
  @Expose() createdAt?: string;
20
21
  }
21
22
 
@@ -0,0 +1,29 @@
1
+ import { Expose } from "class-transformer";
2
+ import { IsIn, IsNotEmpty, IsOptional, IsString, MaxLength } from "class-validator";
3
+ import { ComplaintStatus } from "../enums/ComplaintStatus";
4
+
5
+ /**
6
+ * Request del hook de dictamen (`POST /complaints/{complaintId}/status`, BO-19b).
7
+ * Sincroniza el estado de la denuncia tras el dictamen del OC.
8
+ * `status` solo acepta los estados de cierre (`OPEN` no es válido como entrada).
9
+ */
10
+ export class UpdateComplaintStatusRequest {
11
+
12
+ @Expose()
13
+ @IsString()
14
+ @IsIn([ComplaintStatus.CLOSE_JUSTIFIED, ComplaintStatus.CLOSE_RULED], {
15
+ message: "status debe ser CLOSE_JUSTIFIED o CLOSE_RULED",
16
+ })
17
+ status!: string;
18
+
19
+ @Expose()
20
+ @IsString()
21
+ @IsNotEmpty()
22
+ dictamenBy!: string; // email del operador que dictamina
23
+
24
+ @Expose()
25
+ @IsOptional()
26
+ @IsString()
27
+ @MaxLength(1000)
28
+ dictamenNotes?: string;
29
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Estados del ciclo de vida de una denuncia (`Complaints_GT`, BO-19/BO-19b).
3
+ * `OPEN` al crearse; pasa a `CLOSE_*` cuando el OC dictamina (hook BO-19b).
4
+ */
5
+ export enum ComplaintStatus {
6
+ OPEN = "OPEN",
7
+ CLOSE_JUSTIFIED = "CLOSE_JUSTIFIED",
8
+ CLOSE_RULED = "CLOSE_RULED",
9
+ }
@@ -1,2 +1,7 @@
1
+ //dtos
1
2
  export * from './dtos/CreateComplaintRequest';
2
3
  export * from './dtos/ComplaintResponse';
4
+ export * from './dtos/UpdateComplaintStatusRequest';
5
+
6
+ //enums
7
+ export * from './enums/ComplaintStatus';
@@ -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
  }