@fiado/type-kit 3.141.0 → 3.143.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_/unit/platformRbac/dtos/CreateTenantRequest.test.ts +8 -6
- package/_test_/unit/platformRbac/enums/__snapshots__/permissionBits.test.ts.snap +1 -73
- package/_test_/unit/platformRbac/tenantTypes.test.ts +5 -40
- package/bin/platformRbac/application/Application.d.ts +1 -1
- package/bin/platformRbac/dtos/CreateTenantRequest.d.ts +6 -5
- package/bin/platformRbac/dtos/CreateTenantRequest.js +2 -3
- package/bin/platformRbac/dtos/ResendOtpRequest.d.ts +22 -0
- package/bin/{walletFunding/dtos/CancelFundingRequest.js → platformRbac/dtos/ResendOtpRequest.js} +16 -13
- package/bin/platformRbac/dtos/ResendSelfRegisterOtpRequest.d.ts +11 -0
- package/bin/{cognitoBackofficeConnector/dtos/MfaPoolConfig.js → platformRbac/dtos/ResendSelfRegisterOtpRequest.js} +18 -18
- package/bin/platformRbac/enums/Permission.d.ts +0 -77
- package/bin/platformRbac/enums/Permission.js +8 -186
- package/bin/platformRbac/enums/PermissionCategory.d.ts +0 -7
- package/bin/platformRbac/enums/PermissionCategory.js +4 -9
- package/bin/platformRbac/tenantTypes.d.ts +18 -13
- package/bin/platformRbac/tenantTypes.js +20 -30
- package/package.json +1 -1
- package/src/platformRbac/application/Application.ts +2 -1
- package/src/platformRbac/dtos/CreateTenantRequest.ts +8 -6
- package/src/platformRbac/enums/Permission.ts +8 -191
- package/src/platformRbac/enums/PermissionCategory.ts +4 -9
- package/src/platformRbac/tenantTypes.ts +21 -32
- package/bin/cognitoBackofficeConnector/dtos/MfaPoolConfig.d.ts +0 -7
- package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.d.ts +0 -20
- package/bin/cognitoBackofficeConnector/dtos/PoolConfigResponse.js +0 -11
- package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.d.ts +0 -4
- package/bin/cognitoBackofficeConnector/dtos/PoolsListResponse.js +0 -6
- package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.d.ts +0 -17
- package/bin/cognitoBackofficeConnector/validators/MfaTypesRequiresOne.js +0 -39
- package/bin/rbac/enums/PoolKind.d.ts +0 -16
- package/bin/rbac/enums/PoolKind.js +0 -20
- package/bin/rbac/index.d.ts +0 -1
- package/bin/rbac/index.js +0 -17
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.d.ts +0 -5
- package/bin/walletFunding/dtos/CancelFundingReferenceRequest.js +0 -31
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.d.ts +0 -7
- package/bin/walletFunding/dtos/CancelFundingReferenceResponse.js +0 -6
- package/bin/walletFunding/dtos/CancelFundingRequest.d.ts +0 -11
- package/bin/walletFunding/dtos/CancelFundingResponse.d.ts +0 -14
- package/bin/walletFunding/dtos/CancelFundingResponse.js +0 -12
- package/bin/walletFunding/dtos/CancelWalletFundingRequest.d.ts +0 -3
- package/bin/walletFunding/dtos/CancelWalletFundingRequest.js +0 -21
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.d.ts +0 -7
- package/bin/walletFunding/dtos/CancelWalletFundingResponse.js +0 -6
|
@@ -107,112 +107,11 @@ var Permission;
|
|
|
107
107
|
// DEC-RBAC-038: gestión de scope-entities de nivel genérico — crear/editar/borrar entidades del nivel inferior; scope-bound.
|
|
108
108
|
Permission["TENANT_LEVEL_MANAGE"] = "tenant.level.manage";
|
|
109
109
|
// ====================================================
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
//
|
|
113
|
-
//
|
|
114
|
-
//
|
|
115
|
-
Permission["RETAIL_USER_CREATE"] = "retail.user.create";
|
|
116
|
-
Permission["RETAIL_USER_CREATE_LATERAL"] = "retail.user.create.lateral";
|
|
117
|
-
Permission["RETAIL_USER_READ"] = "retail.user.read";
|
|
118
|
-
Permission["RETAIL_USER_UPDATE"] = "retail.user.update";
|
|
119
|
-
Permission["RETAIL_USER_STATUS"] = "retail.user.status";
|
|
120
|
-
Permission["RETAIL_USER_DELETE"] = "retail.user.delete";
|
|
121
|
-
Permission["RETAIL_USER_PASSWORD_RESET"] = "retail.user.password.reset";
|
|
122
|
-
Permission["RETAIL_USER_MFA_RESET"] = "retail.user.mfa.reset";
|
|
123
|
-
Permission["RETAIL_PRODUCT_CREATE"] = "retail.product.create";
|
|
124
|
-
Permission["RETAIL_PRODUCT_LIST"] = "retail.product.list";
|
|
125
|
-
Permission["RETAIL_PRODUCT_VIEW"] = "retail.product.view";
|
|
126
|
-
Permission["RETAIL_PRODUCT_UPDATE"] = "retail.product.update";
|
|
127
|
-
Permission["RETAIL_PRODUCT_DELETE"] = "retail.product.delete";
|
|
128
|
-
/** @deprecated DEC-RBAC-061: se renombrará a 'retail.product.mdm.config' (naming con puntos). Migración de datos coordinada por backend pendiente; no usar en código nuevo. */
|
|
129
|
-
Permission["RETAIL_PRODUCT_MDM_CONFIG"] = "retail.product.mdm_config";
|
|
130
|
-
Permission["RETAIL_INVENTORY_LIST"] = "retail.inventory.list";
|
|
131
|
-
Permission["RETAIL_INVENTORY_VIEW"] = "retail.inventory.view";
|
|
132
|
-
Permission["RETAIL_INVENTORY_UPDATE"] = "retail.inventory.update";
|
|
133
|
-
Permission["RETAIL_SALE_CREATE"] = "retail.sale.create";
|
|
134
|
-
Permission["RETAIL_SALE_LIST"] = "retail.sale.list";
|
|
135
|
-
Permission["RETAIL_SALE_CANCEL"] = "retail.sale.cancel";
|
|
136
|
-
Permission["RETAIL_STORE_MANAGE"] = "retail.store.manage";
|
|
137
|
-
Permission["RETAIL_RETAILER_MANAGE"] = "retail.retailer.manage";
|
|
138
|
-
// ====================================================
|
|
139
|
-
// LEND — créditos + cobranza
|
|
140
|
-
// ====================================================
|
|
141
|
-
Permission["LEND_CREDIT_CREATE"] = "lend.credit.create";
|
|
142
|
-
Permission["LEND_CREDIT_LIST"] = "lend.credit.list";
|
|
143
|
-
Permission["LEND_CREDIT_VIEW"] = "lend.credit.view";
|
|
144
|
-
Permission["LEND_CREDIT_UPDATE"] = "lend.credit.update";
|
|
145
|
-
Permission["LEND_CREDIT_LIQUIDATE"] = "lend.credit.liquidate";
|
|
146
|
-
Permission["LEND_CREDIT_RESTRUCTURE"] = "lend.credit.restructure";
|
|
147
|
-
Permission["LEND_PAYMENT_APPLY"] = "lend.payment.apply";
|
|
148
|
-
Permission["LEND_PAYMENT_LIST"] = "lend.payment.list";
|
|
149
|
-
Permission["LEND_PAYMENT_REVERSE"] = "lend.payment.reverse";
|
|
150
|
-
Permission["LEND_INSTALLMENT_VIEW"] = "lend.installment.view";
|
|
151
|
-
// ====================================================
|
|
152
|
-
// MDM — device management (subset especializado de LEND)
|
|
153
|
-
// ====================================================
|
|
154
|
-
Permission["MDM_DEVICE_ENROLL"] = "mdm.device.enroll";
|
|
155
|
-
Permission["MDM_DEVICE_RELEASE"] = "mdm.device.release";
|
|
156
|
-
Permission["MDM_DEVICE_ARCHIVE"] = "mdm.device.archive";
|
|
157
|
-
Permission["MDM_DEVICE_DEACTIVATE"] = "mdm.device.deactivate";
|
|
158
|
-
Permission["MDM_DEVICE_LOCK_MANUAL"] = "mdm.device.lock.manual";
|
|
159
|
-
Permission["MDM_DEVICE_UNLOCK_MANUAL"] = "mdm.device.unlock.manual";
|
|
160
|
-
/** @deprecated DEC-RBAC-061: se renombrará a 'mdm.device.pin.unlock' (naming con puntos). Migración de datos coordinada por backend pendiente; no usar en código nuevo. */
|
|
161
|
-
Permission["MDM_DEVICE_PIN_UNLOCK"] = "mdm.device.pin_unlock";
|
|
162
|
-
/** @deprecated DEC-RBAC-061: se renombrará a 'mdm.device.extend.validity' (naming con puntos). Migración de datos coordinada por backend pendiente; no usar en código nuevo. */
|
|
163
|
-
Permission["MDM_DEVICE_EXTEND_VALIDITY"] = "mdm.device.extend_validity";
|
|
164
|
-
Permission["MDM_DEVICE_NOTIFY"] = "mdm.device.notify";
|
|
165
|
-
Permission["MDM_DEVICE_STATUS_VIEW"] = "mdm.device.status.view";
|
|
166
|
-
/** @deprecated DEC-RBAC-061: se renombrará a 'mdm.operation.log.view' (naming con puntos). Migración de datos coordinada por backend pendiente; no usar en código nuevo. */
|
|
167
|
-
Permission["MDM_OPERATION_LOG_VIEW"] = "mdm.operation_log.view";
|
|
168
|
-
Permission["MDM_TEST"] = "mdm.test";
|
|
169
|
-
// ====================================================
|
|
170
|
-
// PAY — futuro FiadoPay (placeholder, no usado en MVP)
|
|
171
|
-
// ====================================================
|
|
172
|
-
Permission["PAY_TRANSACTION_VIEW"] = "pay.transaction.view";
|
|
173
|
-
// ====================================================
|
|
174
|
-
// AGENTS — Fiado Agents (tenant type AGENTS, roles scope GROUP).
|
|
175
|
-
// Permisos de DOMINIO derivados de los endpoints/pantallas reales del webapp de agents
|
|
176
|
-
// (ver fiado-agents-webapp/docs/rbac/RBAC-agents.md §5.2). El aislamiento entre orgs lo da el
|
|
177
|
-
// scope GROUP del roleAssignment (scopeRef = Group_GT.id), no un permiso aparte.
|
|
178
|
-
// ====================================================
|
|
179
|
-
// Gate de ACCESO a la app web de Agents (gobernanza). Sin este permiso el usuario no
|
|
180
|
-
// entra a la app. Lo otorgan los 5 roles GROUP de agents (en su propio repo, no acá).
|
|
181
|
-
Permission["AGENTS_APP_ACCESS"] = "agents.app.access";
|
|
182
|
-
Permission["AGENTS_AGENT_LIST"] = "agents.agent.list";
|
|
183
|
-
Permission["AGENTS_AGENT_CREATE"] = "agents.agent.create";
|
|
184
|
-
/** @deprecated DEC-RBAC-061: se renombrará a 'agents.agent.create.bulk' (naming con puntos). Migración de datos coordinada por backend pendiente; no usar en código nuevo. */
|
|
185
|
-
Permission["AGENTS_AGENT_CREATE_BULK"] = "agents.agent.create_bulk";
|
|
186
|
-
Permission["AGENTS_AGENT_MOVE"] = "agents.agent.move";
|
|
187
|
-
Permission["AGENTS_AGENT_DELETE"] = "agents.agent.delete";
|
|
188
|
-
Permission["AGENTS_REFERRAL_VIEW"] = "agents.referral.view";
|
|
189
|
-
Permission["AGENTS_RANKING_VIEW"] = "agents.ranking.view";
|
|
190
|
-
Permission["AGENTS_PRODUCTION_VIEW"] = "agents.production.view";
|
|
191
|
-
Permission["AGENTS_PERSON_SEARCH"] = "agents.person.search";
|
|
192
|
-
Permission["AGENTS_PERSON_VIEW"] = "agents.person.view";
|
|
193
|
-
Permission["AGENTS_PERSON_UPDATE"] = "agents.person.update";
|
|
194
|
-
Permission["AGENTS_PERSON_CREATE"] = "agents.person.create";
|
|
195
|
-
Permission["AGENTS_DOCUMENT_VIEW"] = "agents.document.view";
|
|
196
|
-
Permission["AGENTS_DOCUMENT_UPLOAD"] = "agents.document.upload";
|
|
197
|
-
Permission["AGENTS_ADDRESS_VIEW"] = "agents.address.view";
|
|
198
|
-
Permission["AGENTS_ADDRESS_MANAGE"] = "agents.address.manage";
|
|
199
|
-
Permission["AGENTS_BENEFICIARY_VIEW"] = "agents.beneficiary.view";
|
|
200
|
-
Permission["AGENTS_BENEFICIARY_MANAGE"] = "agents.beneficiary.manage";
|
|
201
|
-
Permission["AGENTS_CARD_ISSUE"] = "agents.card.issue";
|
|
202
|
-
Permission["AGENTS_CHAT_VIEW"] = "agents.chat.view";
|
|
203
|
-
Permission["AGENTS_CHAT_SEND"] = "agents.chat.send";
|
|
204
|
-
Permission["AGENTS_NOTIFICATION_SEND"] = "agents.notification.send";
|
|
205
|
-
Permission["AGENTS_EXPORT_RUN"] = "agents.export.run";
|
|
206
|
-
Permission["AGENTS_CATALOG_VIEW"] = "agents.catalog.view";
|
|
207
|
-
// Gestión de grupos del tenant AGENTS (scope TENANT — el operador). Espejo de retail.retailer.manage.
|
|
208
|
-
Permission["AGENTS_GROUP_MANAGE"] = "agents.group.manage";
|
|
209
|
-
// Gestión de usuarios DENTRO de un grupo (scope GROUP — el group_owner/admin sobre su grupo; el
|
|
210
|
-
// operador la cubre por TENANT). Crea usuarios + asigna roles group_* acotado al groupId. DEC-102.
|
|
211
|
-
Permission["AGENTS_GROUP_USER_MANAGE"] = "agents.group.user.manage";
|
|
212
|
-
// ====================================================
|
|
213
|
-
// LEVEL{1,2,3} — primitivas RBAC genéricas por nivel (DEC-RBAC-063, ADITIVO)
|
|
214
|
-
// Permisos básicos auto-sembrables por nivel genérico (data-driven). Coexisten con los
|
|
215
|
-
// legacy retail.*/agents.* (categorías @deprecated), NO los reemplazan en la línea 3.x.
|
|
110
|
+
// LEVEL{1,2,3} — primitivas RBAC genéricas por nivel (DEC-RBAC-063)
|
|
111
|
+
// Permisos básicos auto-sembrables por nivel genérico (data-driven). Los permisos de
|
|
112
|
+
// DOMINIO (retail.*/lend.*/mdm.*/pay.*/agents.*) fueron purgados del catálogo (v4.0.0,
|
|
113
|
+
// BREAKING): el type-kit contiene SOLO el vocabulario del sistema RBAC; los permisos de
|
|
114
|
+
// dominio viven como data (catálogo por aplicación), no hardcodeados acá.
|
|
216
115
|
// ====================================================
|
|
217
116
|
Permission["LEVEL1_USER_CREATE"] = "level1.user.create";
|
|
218
117
|
Permission["LEVEL1_USER_READ"] = "level1.user.read";
|
|
@@ -308,87 +207,10 @@ exports.PERMISSION_BIT_ORDER = [
|
|
|
308
207
|
Permission.TENANT_SECURITY_POLICY_MANAGE,
|
|
309
208
|
Permission.TENANT_BRANDING_MANAGE,
|
|
310
209
|
Permission.TENANT_AUDIT_VIEW,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
Permission.RETAIL_USER_UPDATE,
|
|
315
|
-
Permission.RETAIL_USER_STATUS,
|
|
316
|
-
Permission.RETAIL_USER_DELETE,
|
|
317
|
-
Permission.RETAIL_USER_PASSWORD_RESET,
|
|
318
|
-
Permission.RETAIL_USER_MFA_RESET,
|
|
319
|
-
Permission.RETAIL_PRODUCT_CREATE,
|
|
320
|
-
Permission.RETAIL_PRODUCT_LIST,
|
|
321
|
-
Permission.RETAIL_PRODUCT_VIEW,
|
|
322
|
-
Permission.RETAIL_PRODUCT_UPDATE,
|
|
323
|
-
Permission.RETAIL_PRODUCT_DELETE,
|
|
324
|
-
Permission.RETAIL_PRODUCT_MDM_CONFIG,
|
|
325
|
-
Permission.RETAIL_INVENTORY_LIST,
|
|
326
|
-
Permission.RETAIL_INVENTORY_VIEW,
|
|
327
|
-
Permission.RETAIL_INVENTORY_UPDATE,
|
|
328
|
-
Permission.RETAIL_SALE_CREATE,
|
|
329
|
-
Permission.RETAIL_SALE_LIST,
|
|
330
|
-
Permission.RETAIL_SALE_CANCEL,
|
|
331
|
-
Permission.RETAIL_STORE_MANAGE,
|
|
332
|
-
Permission.RETAIL_RETAILER_MANAGE,
|
|
333
|
-
Permission.LEND_CREDIT_CREATE,
|
|
334
|
-
Permission.LEND_CREDIT_LIST,
|
|
335
|
-
Permission.LEND_CREDIT_VIEW,
|
|
336
|
-
Permission.LEND_CREDIT_UPDATE,
|
|
337
|
-
Permission.LEND_CREDIT_LIQUIDATE,
|
|
338
|
-
Permission.LEND_CREDIT_RESTRUCTURE,
|
|
339
|
-
Permission.LEND_PAYMENT_APPLY,
|
|
340
|
-
Permission.LEND_PAYMENT_LIST,
|
|
341
|
-
Permission.LEND_PAYMENT_REVERSE,
|
|
342
|
-
Permission.LEND_INSTALLMENT_VIEW,
|
|
343
|
-
Permission.MDM_DEVICE_ENROLL,
|
|
344
|
-
Permission.MDM_DEVICE_RELEASE,
|
|
345
|
-
Permission.MDM_DEVICE_ARCHIVE,
|
|
346
|
-
Permission.MDM_DEVICE_DEACTIVATE,
|
|
347
|
-
Permission.MDM_DEVICE_LOCK_MANUAL,
|
|
348
|
-
Permission.MDM_DEVICE_UNLOCK_MANUAL,
|
|
349
|
-
Permission.MDM_DEVICE_PIN_UNLOCK,
|
|
350
|
-
Permission.MDM_DEVICE_EXTEND_VALIDITY,
|
|
351
|
-
Permission.MDM_DEVICE_NOTIFY,
|
|
352
|
-
Permission.MDM_DEVICE_STATUS_VIEW,
|
|
353
|
-
Permission.MDM_OPERATION_LOG_VIEW,
|
|
354
|
-
Permission.MDM_TEST,
|
|
355
|
-
Permission.PAY_TRANSACTION_VIEW,
|
|
356
|
-
// AGENTS (append-only) — Fiado Agents domain perms.
|
|
357
|
-
Permission.AGENTS_AGENT_LIST,
|
|
358
|
-
Permission.AGENTS_AGENT_CREATE,
|
|
359
|
-
Permission.AGENTS_AGENT_CREATE_BULK,
|
|
360
|
-
Permission.AGENTS_AGENT_MOVE,
|
|
361
|
-
Permission.AGENTS_AGENT_DELETE,
|
|
362
|
-
Permission.AGENTS_REFERRAL_VIEW,
|
|
363
|
-
Permission.AGENTS_RANKING_VIEW,
|
|
364
|
-
Permission.AGENTS_PRODUCTION_VIEW,
|
|
365
|
-
Permission.AGENTS_PERSON_SEARCH,
|
|
366
|
-
Permission.AGENTS_PERSON_VIEW,
|
|
367
|
-
Permission.AGENTS_PERSON_UPDATE,
|
|
368
|
-
Permission.AGENTS_DOCUMENT_VIEW,
|
|
369
|
-
Permission.AGENTS_DOCUMENT_UPLOAD,
|
|
370
|
-
Permission.AGENTS_ADDRESS_VIEW,
|
|
371
|
-
Permission.AGENTS_ADDRESS_MANAGE,
|
|
372
|
-
Permission.AGENTS_BENEFICIARY_VIEW,
|
|
373
|
-
Permission.AGENTS_BENEFICIARY_MANAGE,
|
|
374
|
-
Permission.AGENTS_CARD_ISSUE,
|
|
375
|
-
Permission.AGENTS_CHAT_VIEW,
|
|
376
|
-
Permission.AGENTS_CHAT_SEND,
|
|
377
|
-
Permission.AGENTS_NOTIFICATION_SEND,
|
|
378
|
-
Permission.AGENTS_EXPORT_RUN,
|
|
379
|
-
Permission.AGENTS_CATALOG_VIEW,
|
|
380
|
-
Permission.AGENTS_GROUP_MANAGE,
|
|
381
|
-
Permission.AGENTS_GROUP_USER_MANAGE,
|
|
382
|
-
// Append-only: nuevo permiso agregado 2026-06-18 (DEC-A2-02). Va al FINAL para no correr los bits
|
|
383
|
-
// existentes (PERMS_VERSION cambia, pero los índices previos se conservan).
|
|
384
|
-
Permission.AGENTS_PERSON_CREATE,
|
|
385
|
-
// Append-only 2026-06-18 (DEC-RBAC-017): catálogo de campos personalizados por tenant. Al FINAL para
|
|
386
|
-
// no correr bits existentes. (El bitset está deprecado por token-flaco, pero el orden se mantiene
|
|
387
|
-
// sincronizado con el enum para que el test de bits no rompa.)
|
|
210
|
+
// Append-only 2026-06-18 (DEC-RBAC-017): catálogo de campos personalizados por tenant.
|
|
211
|
+
// (El bitset está deprecado por token-flaco, pero el orden se mantiene sincronizado con el
|
|
212
|
+
// enum para que el test de bits no rompa.)
|
|
388
213
|
Permission.PLATFORM_TENANT_USERFIELDS_MANAGE,
|
|
389
|
-
// Append-only 2026-06-21: gate de acceso a la app web de Agents (gobernanza). Al FINAL para no
|
|
390
|
-
// correr bits existentes (PERMS_VERSION cambia, pero los índices previos se conservan).
|
|
391
|
-
Permission.AGENTS_APP_ACCESS,
|
|
392
214
|
// Append-only 2026-06-19: lateral platform (platform_super_admin asigna roles scope PLATFORM).
|
|
393
215
|
// Al FINAL para no correr bits existentes (PERMS_VERSION cambia, índices previos se conservan).
|
|
394
216
|
Permission.PLATFORM_USER_CREATE_LATERAL,
|
|
@@ -6,14 +6,7 @@ export declare enum PermissionCategory {
|
|
|
6
6
|
RBAC = "rbac",
|
|
7
7
|
PLATFORM = "platform",
|
|
8
8
|
TENANT = "tenant",
|
|
9
|
-
/** @deprecated DEC-RBAC-062/063: se consolida en niveles genéricos (LEVEL_n) data-driven. Migración de tenants pendiente; no usar en código nuevo. */
|
|
10
|
-
RETAIL = "retail",
|
|
11
|
-
LEND = "lend",
|
|
12
|
-
MDM = "mdm",
|
|
13
9
|
AUDIT = "audit",
|
|
14
|
-
PAY = "pay",
|
|
15
|
-
/** @deprecated DEC-RBAC-062/063: se consolida en niveles genéricos (LEVEL_n) data-driven. Migración de tenants pendiente; no usar en código nuevo. */
|
|
16
|
-
AGENTS = "agents",
|
|
17
10
|
LEVEL1 = "level1",
|
|
18
11
|
LEVEL2 = "level2",
|
|
19
12
|
LEVEL3 = "level3"
|
|
@@ -10,16 +10,11 @@ var PermissionCategory;
|
|
|
10
10
|
PermissionCategory["RBAC"] = "rbac";
|
|
11
11
|
PermissionCategory["PLATFORM"] = "platform";
|
|
12
12
|
PermissionCategory["TENANT"] = "tenant";
|
|
13
|
-
/** @deprecated DEC-RBAC-062/063: se consolida en niveles genéricos (LEVEL_n) data-driven. Migración de tenants pendiente; no usar en código nuevo. */
|
|
14
|
-
PermissionCategory["RETAIL"] = "retail";
|
|
15
|
-
PermissionCategory["LEND"] = "lend";
|
|
16
|
-
PermissionCategory["MDM"] = "mdm";
|
|
17
13
|
PermissionCategory["AUDIT"] = "audit";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
//
|
|
22
|
-
// Coexisten con RETAIL/AGENTS (@deprecated), no los reemplazan en la línea 3.x.
|
|
14
|
+
// DEC-RBAC-063: categorías de las primitivas RBAC por nivel genérico.
|
|
15
|
+
// Las categorías de DOMINIO (retail/lend/mdm/pay/agents) fueron purgadas del catálogo
|
|
16
|
+
// (v4.0.0, BREAKING): el type-kit contiene SOLO el vocabulario del sistema RBAC; el dominio
|
|
17
|
+
// vive como data (catálogo por aplicación), no hardcodeado acá.
|
|
23
18
|
PermissionCategory["LEVEL1"] = "level1";
|
|
24
19
|
PermissionCategory["LEVEL2"] = "level2";
|
|
25
20
|
PermissionCategory["LEVEL3"] = "level3";
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { PermissionScope } from './enums/PermissionScope';
|
|
2
2
|
/**
|
|
3
|
-
* Tipos de tenant
|
|
4
|
-
* jerarquía de niveles DEBAJO de TENANT (data-driven). Hoy solo existe `retail`.
|
|
3
|
+
* Tipos de tenant de DOMINIO (retail/agents) — PURGADOS (v4.0.0, BREAKING).
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* El modelo de tipos de tenant de dominio se consolidó en niveles genéricos (LEVEL_1..n)
|
|
6
|
+
* data-driven (DEC-RBAC-062/063). El type-kit contiene SOLO el vocabulario del sistema RBAC;
|
|
7
|
+
* la jerarquía de niveles de cada aplicación vive como data (catálogo por aplicación,
|
|
8
|
+
* ver `LevelDef` en `application/Application`), no hardcodeada acá.
|
|
9
|
+
*
|
|
10
|
+
* El enum queda SIN miembros de dominio a propósito. La maquinaria genérica
|
|
11
|
+
* (`TENANT_TYPES`, `levelsOf`, `tableSuffixForLevel`, `scopeRankOrder`) se conserva para no
|
|
12
|
+
* romper a los consumidores (ej. `ScopeValidationService._rank` vía `scopeRankOrder`), pero
|
|
13
|
+
* ya no aporta niveles legacy: el orden queda definido por los niveles genéricos.
|
|
8
14
|
*/
|
|
9
15
|
export declare enum TenantType {
|
|
10
|
-
RETAIL = "retail",
|
|
11
|
-
AGENTS = "agents"
|
|
12
16
|
}
|
|
13
17
|
interface TenantTypeDef {
|
|
14
18
|
displayName: string;
|
|
@@ -17,17 +21,18 @@ interface TenantTypeDef {
|
|
|
17
21
|
/** Sufijo de tabla DDB por nivel (el prefix del tenant se antepone en runtime). */
|
|
18
22
|
tableSuffix: Partial<Record<PermissionScope, string>>;
|
|
19
23
|
}
|
|
20
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Registro de tipos de tenant de dominio — VACÍO tras la purga (v4.0.0). Las jerarquías de
|
|
26
|
+
* niveles se definen como data por aplicación (LEVEL_n), no acá.
|
|
27
|
+
*/
|
|
21
28
|
export declare const TENANT_TYPES: Record<TenantType, TenantTypeDef>;
|
|
22
|
-
/** @deprecated DEC-RBAC-062/063: se consolida en niveles genéricos (LEVEL_n) data-driven. Migración de tenants pendiente; no usar en código nuevo. */
|
|
23
29
|
export declare function levelsOf(type: TenantType): PermissionScope[];
|
|
24
|
-
/** @deprecated DEC-RBAC-062/063: se consolida en niveles genéricos (LEVEL_n) data-driven. Migración de tenants pendiente; no usar en código nuevo. */
|
|
25
30
|
export declare function tableSuffixForLevel(type: TenantType, level: PermissionScope): string | undefined;
|
|
26
31
|
/**
|
|
27
|
-
* Orden global de scopes para ORDENAR (ej. UI): PLATFORM, TENANT + niveles
|
|
28
|
-
* ⚠️ NO usar para COBERTURA de autorización: es un orden total que cruzaría ramas
|
|
29
|
-
*
|
|
30
|
-
*
|
|
32
|
+
* Orden global de scopes para ORDENAR (ej. UI): PLATFORM, TENANT + niveles genéricos.
|
|
33
|
+
* ⚠️ NO usar para COBERTURA de autorización: es un orden total que cruzaría ramas.
|
|
34
|
+
* La cobertura se decide con una relación explícita por niveles — ver `canAccess`/`scopeCovers`
|
|
35
|
+
* en @fiado/gateway-adapter (DEC-RBAC-010).
|
|
31
36
|
*/
|
|
32
37
|
export declare function scopeRankOrder(): PermissionScope[];
|
|
33
38
|
export {};
|
|
@@ -6,47 +6,37 @@ exports.tableSuffixForLevel = tableSuffixForLevel;
|
|
|
6
6
|
exports.scopeRankOrder = scopeRankOrder;
|
|
7
7
|
const PermissionScope_1 = require("./enums/PermissionScope");
|
|
8
8
|
/**
|
|
9
|
-
* Tipos de tenant
|
|
10
|
-
* jerarquía de niveles DEBAJO de TENANT (data-driven). Hoy solo existe `retail`.
|
|
9
|
+
* Tipos de tenant de DOMINIO (retail/agents) — PURGADOS (v4.0.0, BREAKING).
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* El modelo de tipos de tenant de dominio se consolidó en niveles genéricos (LEVEL_1..n)
|
|
12
|
+
* data-driven (DEC-RBAC-062/063). El type-kit contiene SOLO el vocabulario del sistema RBAC;
|
|
13
|
+
* la jerarquía de niveles de cada aplicación vive como data (catálogo por aplicación,
|
|
14
|
+
* ver `LevelDef` en `application/Application`), no hardcodeada acá.
|
|
15
|
+
*
|
|
16
|
+
* El enum queda SIN miembros de dominio a propósito. La maquinaria genérica
|
|
17
|
+
* (`TENANT_TYPES`, `levelsOf`, `tableSuffixForLevel`, `scopeRankOrder`) se conserva para no
|
|
18
|
+
* romper a los consumidores (ej. `ScopeValidationService._rank` vía `scopeRankOrder`), pero
|
|
19
|
+
* ya no aporta niveles legacy: el orden queda definido por los niveles genéricos.
|
|
14
20
|
*/
|
|
15
21
|
var TenantType;
|
|
16
22
|
(function (TenantType) {
|
|
17
|
-
TenantType["RETAIL"] = "retail";
|
|
18
|
-
TenantType["AGENTS"] = "agents";
|
|
19
23
|
})(TenantType || (exports.TenantType = TenantType = {}));
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
tableSuffix: {
|
|
26
|
-
[PermissionScope_1.PermissionScope.RETAILER]: 'SharedRetailer',
|
|
27
|
-
[PermissionScope_1.PermissionScope.STORE]: 'SharedStore',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
// Fiado Agents — un único nivel GROUP debajo de TENANT.
|
|
31
|
-
[TenantType.AGENTS]: {
|
|
32
|
-
displayName: 'Agents',
|
|
33
|
-
levels: [PermissionScope_1.PermissionScope.GROUP],
|
|
34
|
-
tableSuffix: { [PermissionScope_1.PermissionScope.GROUP]: 'SharedGroup' },
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
/** @deprecated DEC-RBAC-062/063: se consolida en niveles genéricos (LEVEL_n) data-driven. Migración de tenants pendiente; no usar en código nuevo. */
|
|
24
|
+
/**
|
|
25
|
+
* Registro de tipos de tenant de dominio — VACÍO tras la purga (v4.0.0). Las jerarquías de
|
|
26
|
+
* niveles se definen como data por aplicación (LEVEL_n), no acá.
|
|
27
|
+
*/
|
|
28
|
+
exports.TENANT_TYPES = {};
|
|
38
29
|
function levelsOf(type) {
|
|
39
30
|
return exports.TENANT_TYPES[type].levels;
|
|
40
31
|
}
|
|
41
|
-
/** @deprecated DEC-RBAC-062/063: se consolida en niveles genéricos (LEVEL_n) data-driven. Migración de tenants pendiente; no usar en código nuevo. */
|
|
42
32
|
function tableSuffixForLevel(type, level) {
|
|
43
33
|
return exports.TENANT_TYPES[type].tableSuffix[level];
|
|
44
34
|
}
|
|
45
35
|
/**
|
|
46
|
-
* Orden global de scopes para ORDENAR (ej. UI): PLATFORM, TENANT + niveles
|
|
47
|
-
* ⚠️ NO usar para COBERTURA de autorización: es un orden total que cruzaría ramas
|
|
48
|
-
*
|
|
49
|
-
*
|
|
36
|
+
* Orden global de scopes para ORDENAR (ej. UI): PLATFORM, TENANT + niveles genéricos.
|
|
37
|
+
* ⚠️ NO usar para COBERTURA de autorización: es un orden total que cruzaría ramas.
|
|
38
|
+
* La cobertura se decide con una relación explícita por niveles — ver `canAccess`/`scopeCovers`
|
|
39
|
+
* en @fiado/gateway-adapter (DEC-RBAC-010).
|
|
50
40
|
*/
|
|
51
41
|
function scopeRankOrder() {
|
|
52
42
|
const order = [PermissionScope_1.PermissionScope.PLATFORM, PermissionScope_1.PermissionScope.TENANT];
|
|
@@ -55,7 +45,7 @@ function scopeRankOrder() {
|
|
|
55
45
|
if (!order.includes(lvl))
|
|
56
46
|
order.push(lvl);
|
|
57
47
|
}
|
|
58
|
-
// DEC-RBAC-032: niveles genéricos al final del orden total (UI/ranking). Append-only
|
|
48
|
+
// DEC-RBAC-032: niveles genéricos al final del orden total (UI/ranking). Append-only.
|
|
59
49
|
for (const lvl of [PermissionScope_1.PermissionScope.LEVEL_1, PermissionScope_1.PermissionScope.LEVEL_2, PermissionScope_1.PermissionScope.LEVEL_3]) {
|
|
60
50
|
if (!order.includes(lvl))
|
|
61
51
|
order.push(lvl);
|
package/package.json
CHANGED
|
@@ -12,7 +12,8 @@ export interface LevelDef {
|
|
|
12
12
|
export interface ApplicationSecurityPolicyDefault {
|
|
13
13
|
// DEC-RBAC-045: 2FA master switch por tenant. Ausente ⇒ habilitado (secure-by-default).
|
|
14
14
|
mfaEnabled?: boolean;
|
|
15
|
-
|
|
15
|
+
// DEC-RBAC-085: 'SMS' se suma como 3er método de MFA tenant-controlado.
|
|
16
|
+
methodsAllowed?: Array<'TOTP' | 'EMAIL' | 'SMS'>;
|
|
16
17
|
// DEC-RBAC-051: purgados mfaRequired / defaultPreferred / sessionTimeoutMin (write-only sin enforcement).
|
|
17
18
|
// DEC-RBAC-052: passwordPolicy deja de ser per-tenant → política global por env vars (Cognito enforce).
|
|
18
19
|
}
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
ValidateNested,
|
|
12
12
|
} from 'class-validator';
|
|
13
13
|
import { TokenValidationMode } from '../enums/TokenValidationMode';
|
|
14
|
-
import { TenantType } from '../tenantTypes';
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* Punto inicial de la política 2FA elegido en el alta del tenant (DEC-RBAC-064). Para el CREATE
|
|
@@ -23,8 +22,9 @@ import { TenantType } from '../tenantTypes';
|
|
|
23
22
|
* (@ArrayNotEmpty); en el create es opcional.
|
|
24
23
|
*/
|
|
25
24
|
export class CreateTenantSecurityPolicy {
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
// DEC-RBAC-085: 'SMS' se suma como 3er método de MFA tenant-controlado.
|
|
26
|
+
@Expose() @IsOptional() @IsArray() @IsIn(['EMAIL', 'TOTP', 'SMS'], { each: true })
|
|
27
|
+
methodsAllowed?: ('EMAIL' | 'TOTP' | 'SMS')[];
|
|
28
28
|
|
|
29
29
|
@Expose() @IsOptional() @IsBoolean()
|
|
30
30
|
mfaEnabled?: boolean;
|
|
@@ -55,10 +55,12 @@ export class CreateTenantRequest {
|
|
|
55
55
|
// enforce Cognito (política nativa del pool), ya no es per-tenant en el create.
|
|
56
56
|
@Expose() @IsOptional() @IsEnum(TokenValidationMode) tokenValidationMode?: TokenValidationMode;
|
|
57
57
|
/**
|
|
58
|
-
* Tipo de tenant a crear.
|
|
59
|
-
* @deprecated DEC-RBAC-062/063:
|
|
58
|
+
* Tipo de tenant a crear (legacy). El alta se hace por `applicationId`.
|
|
59
|
+
* @deprecated DEC-RBAC-062/063: los tenant-types de dominio fueron purgados (v4.0.0, BREAKING).
|
|
60
|
+
* El alta se hace por `applicationId`; `tenantType` queda como string libre solo por back-compat
|
|
61
|
+
* del shape del body. No usar en código nuevo.
|
|
60
62
|
*/
|
|
61
|
-
@Expose() @IsOptional() @
|
|
63
|
+
@Expose() @IsOptional() @IsString() tenantType?: string;
|
|
62
64
|
/** DEC-RBAC-034: aplicación (plantilla) de la que se crea el tenant; opcional, fallback a tenantType (back-compat). */
|
|
63
65
|
@Expose() @IsOptional() @IsString() applicationId?: string;
|
|
64
66
|
/**
|