evo360-types 1.3.709 → 1.3.713
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/dist/apps/evo-core/nexus-claims.d.ts +12 -0
- package/dist/apps/evo-core/nexus-claims.js +42 -0
- package/dist/apps/evo-core/nexus-claims.ts +41 -0
- package/dist/apps/evo-core/zod-schemas.d.ts +30 -0
- package/dist/apps/evo-core/zod-schemas.js +2 -0
- package/dist/apps/evo-core/zod-schemas.ts +2 -0
- package/dist/apps/evo-csq/zod-schemas.d.ts +705 -0
- package/dist/apps/evo-csq/zod-schemas.js +73 -2
- package/dist/apps/evo-csq/zod-schemas.ts +87 -0
- package/dist/apps/evo-notifications/zod-schemas.d.ts +170 -10
- package/dist/apps/evo-notifications/zod-schemas.js +56 -3
- package/dist/apps/evo-notifications/zod-schemas.ts +59 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.ts +1 -0
- package/dist/types/evo-core/index.d.ts +3 -0
- package/dist/types/evo-core/index.ts +3 -0
- package/dist/types/evo-csq/index.d.ts +69 -0
- package/dist/types/evo-csq/index.js +5 -1
- package/dist/types/evo-csq/index.ts +76 -0
- package/dist/types/evo-notifications/index.d.ts +26 -2
- package/dist/types/evo-notifications/index.ts +28 -2
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Claims de CSQ reconhecidas pelo MCP do Nexus (`nexus_modules.<path>`). */
|
|
2
|
+
export declare const NEX_MCP_CSQ_CLAIMS: readonly ["chat.csq", "chat.csq_admin"];
|
|
3
|
+
export type NexMcpCsqClaim = (typeof NEX_MCP_CSQ_CLAIMS)[number];
|
|
4
|
+
/**
|
|
5
|
+
* `true` só quando o dot-path dentro de `nexus_modules` vale exatamente `true`.
|
|
6
|
+
* `finance: true` (booleano legado) NÃO satisfaz `finance.customers`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function hasNexusModuleClaim(modules: unknown, path: string): boolean;
|
|
9
|
+
/** `nexus_modules.finance` objeto com ALGUM subitem `true` (booleano legado não conta). */
|
|
10
|
+
export declare function hasAnyFinanceModule(modules: unknown): boolean;
|
|
11
|
+
/** Porta do MCP do Nexus: algum `finance.*` ou alguma claim de CSQ. Admin é decidido por quem chama. */
|
|
12
|
+
export declare function hasAnyNexMcpModule(modules: unknown): boolean;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// feat-280 — regra única de porta do MCP do Nexus. O hm_auth (recurso
|
|
3
|
+
// `nex_mcp`) e o nex-mcp (middleware + registro de tools) precisam da MESMA
|
|
4
|
+
// resposta para "este login entra?"; por isso mora aqui e não em cada lado.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NEX_MCP_CSQ_CLAIMS = void 0;
|
|
7
|
+
exports.hasNexusModuleClaim = hasNexusModuleClaim;
|
|
8
|
+
exports.hasAnyFinanceModule = hasAnyFinanceModule;
|
|
9
|
+
exports.hasAnyNexMcpModule = hasAnyNexMcpModule;
|
|
10
|
+
/** Claims de CSQ reconhecidas pelo MCP do Nexus (`nexus_modules.<path>`). */
|
|
11
|
+
exports.NEX_MCP_CSQ_CLAIMS = ["chat.csq", "chat.csq_admin"];
|
|
12
|
+
/**
|
|
13
|
+
* `true` só quando o dot-path dentro de `nexus_modules` vale exatamente `true`.
|
|
14
|
+
* `finance: true` (booleano legado) NÃO satisfaz `finance.customers`.
|
|
15
|
+
*/
|
|
16
|
+
function hasNexusModuleClaim(modules, path) {
|
|
17
|
+
if (!path)
|
|
18
|
+
return false;
|
|
19
|
+
let value = modules;
|
|
20
|
+
for (const part of path.split(".")) {
|
|
21
|
+
if (value == null || typeof value !== "object")
|
|
22
|
+
return false;
|
|
23
|
+
value = value[part];
|
|
24
|
+
}
|
|
25
|
+
return value === true;
|
|
26
|
+
}
|
|
27
|
+
/** `nexus_modules.finance` objeto com ALGUM subitem `true` (booleano legado não conta). */
|
|
28
|
+
function hasAnyFinanceModule(modules) {
|
|
29
|
+
const finance = modules && typeof modules === "object"
|
|
30
|
+
? modules.finance
|
|
31
|
+
: null;
|
|
32
|
+
if (!finance || typeof finance !== "object")
|
|
33
|
+
return false;
|
|
34
|
+
const f = finance;
|
|
35
|
+
// lib es6: sem Object.values.
|
|
36
|
+
return Object.keys(f).some((k) => f[k] === true);
|
|
37
|
+
}
|
|
38
|
+
/** Porta do MCP do Nexus: algum `finance.*` ou alguma claim de CSQ. Admin é decidido por quem chama. */
|
|
39
|
+
function hasAnyNexMcpModule(modules) {
|
|
40
|
+
return (hasAnyFinanceModule(modules) ||
|
|
41
|
+
exports.NEX_MCP_CSQ_CLAIMS.some((c) => hasNexusModuleClaim(modules, c)));
|
|
42
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// feat-280 — regra única de porta do MCP do Nexus. O hm_auth (recurso
|
|
2
|
+
// `nex_mcp`) e o nex-mcp (middleware + registro de tools) precisam da MESMA
|
|
3
|
+
// resposta para "este login entra?"; por isso mora aqui e não em cada lado.
|
|
4
|
+
|
|
5
|
+
/** Claims de CSQ reconhecidas pelo MCP do Nexus (`nexus_modules.<path>`). */
|
|
6
|
+
export const NEX_MCP_CSQ_CLAIMS = ["chat.csq", "chat.csq_admin"] as const;
|
|
7
|
+
export type NexMcpCsqClaim = (typeof NEX_MCP_CSQ_CLAIMS)[number];
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* `true` só quando o dot-path dentro de `nexus_modules` vale exatamente `true`.
|
|
11
|
+
* `finance: true` (booleano legado) NÃO satisfaz `finance.customers`.
|
|
12
|
+
*/
|
|
13
|
+
export function hasNexusModuleClaim(modules: unknown, path: string): boolean {
|
|
14
|
+
if (!path) return false;
|
|
15
|
+
let value: unknown = modules;
|
|
16
|
+
for (const part of path.split(".")) {
|
|
17
|
+
if (value == null || typeof value !== "object") return false;
|
|
18
|
+
value = (value as Record<string, unknown>)[part];
|
|
19
|
+
}
|
|
20
|
+
return value === true;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** `nexus_modules.finance` objeto com ALGUM subitem `true` (booleano legado não conta). */
|
|
24
|
+
export function hasAnyFinanceModule(modules: unknown): boolean {
|
|
25
|
+
const finance =
|
|
26
|
+
modules && typeof modules === "object"
|
|
27
|
+
? (modules as Record<string, unknown>).finance
|
|
28
|
+
: null;
|
|
29
|
+
if (!finance || typeof finance !== "object") return false;
|
|
30
|
+
const f = finance as Record<string, unknown>;
|
|
31
|
+
// lib es6: sem Object.values.
|
|
32
|
+
return Object.keys(f).some((k) => f[k] === true);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Porta do MCP do Nexus: algum `finance.*` ou alguma claim de CSQ. Admin é decidido por quem chama. */
|
|
36
|
+
export function hasAnyNexMcpModule(modules: unknown): boolean {
|
|
37
|
+
return (
|
|
38
|
+
hasAnyFinanceModule(modules) ||
|
|
39
|
+
NEX_MCP_CSQ_CLAIMS.some((c) => hasNexusModuleClaim(modules, c))
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -236,14 +236,18 @@ export declare const zNexusModuleChatPermissionsSchema: z.ZodObject<{
|
|
|
236
236
|
supervision: z.ZodOptional<z.ZodBoolean>;
|
|
237
237
|
/** Supervisão 2.0 (CSQ). Gate da fila e do laudo do evo-csq no Nexus. */
|
|
238
238
|
csq: z.ZodOptional<z.ZodBoolean>;
|
|
239
|
+
/** feat-280: administração do CSQ (config de plataforma, reavaliação). */
|
|
240
|
+
csq_admin: z.ZodOptional<z.ZodBoolean>;
|
|
239
241
|
}, "strip", z.ZodTypeAny, {
|
|
240
242
|
csq?: boolean | undefined;
|
|
241
243
|
management?: boolean | undefined;
|
|
242
244
|
supervision?: boolean | undefined;
|
|
245
|
+
csq_admin?: boolean | undefined;
|
|
243
246
|
}, {
|
|
244
247
|
csq?: boolean | undefined;
|
|
245
248
|
management?: boolean | undefined;
|
|
246
249
|
supervision?: boolean | undefined;
|
|
250
|
+
csq_admin?: boolean | undefined;
|
|
247
251
|
}>;
|
|
248
252
|
/**
|
|
249
253
|
* Schema for INexusModuleFinancePermissions
|
|
@@ -281,14 +285,18 @@ export declare const zNexusModulesSchema: z.ZodObject<{
|
|
|
281
285
|
supervision: z.ZodOptional<z.ZodBoolean>;
|
|
282
286
|
/** Supervisão 2.0 (CSQ). Gate da fila e do laudo do evo-csq no Nexus. */
|
|
283
287
|
csq: z.ZodOptional<z.ZodBoolean>;
|
|
288
|
+
/** feat-280: administração do CSQ (config de plataforma, reavaliação). */
|
|
289
|
+
csq_admin: z.ZodOptional<z.ZodBoolean>;
|
|
284
290
|
}, "strip", z.ZodTypeAny, {
|
|
285
291
|
csq?: boolean | undefined;
|
|
286
292
|
management?: boolean | undefined;
|
|
287
293
|
supervision?: boolean | undefined;
|
|
294
|
+
csq_admin?: boolean | undefined;
|
|
288
295
|
}, {
|
|
289
296
|
csq?: boolean | undefined;
|
|
290
297
|
management?: boolean | undefined;
|
|
291
298
|
supervision?: boolean | undefined;
|
|
299
|
+
csq_admin?: boolean | undefined;
|
|
292
300
|
}>, z.ZodBoolean]>>;
|
|
293
301
|
tenants: z.ZodOptional<z.ZodBoolean>;
|
|
294
302
|
finance: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
@@ -320,14 +328,18 @@ export declare const zNexusModulesSchema: z.ZodObject<{
|
|
|
320
328
|
supervision: z.ZodOptional<z.ZodBoolean>;
|
|
321
329
|
/** Supervisão 2.0 (CSQ). Gate da fila e do laudo do evo-csq no Nexus. */
|
|
322
330
|
csq: z.ZodOptional<z.ZodBoolean>;
|
|
331
|
+
/** feat-280: administração do CSQ (config de plataforma, reavaliação). */
|
|
332
|
+
csq_admin: z.ZodOptional<z.ZodBoolean>;
|
|
323
333
|
}, "strip", z.ZodTypeAny, {
|
|
324
334
|
csq?: boolean | undefined;
|
|
325
335
|
management?: boolean | undefined;
|
|
326
336
|
supervision?: boolean | undefined;
|
|
337
|
+
csq_admin?: boolean | undefined;
|
|
327
338
|
}, {
|
|
328
339
|
csq?: boolean | undefined;
|
|
329
340
|
management?: boolean | undefined;
|
|
330
341
|
supervision?: boolean | undefined;
|
|
342
|
+
csq_admin?: boolean | undefined;
|
|
331
343
|
}>, z.ZodBoolean]>>;
|
|
332
344
|
tenants: z.ZodOptional<z.ZodBoolean>;
|
|
333
345
|
finance: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
@@ -359,14 +371,18 @@ export declare const zNexusModulesSchema: z.ZodObject<{
|
|
|
359
371
|
supervision: z.ZodOptional<z.ZodBoolean>;
|
|
360
372
|
/** Supervisão 2.0 (CSQ). Gate da fila e do laudo do evo-csq no Nexus. */
|
|
361
373
|
csq: z.ZodOptional<z.ZodBoolean>;
|
|
374
|
+
/** feat-280: administração do CSQ (config de plataforma, reavaliação). */
|
|
375
|
+
csq_admin: z.ZodOptional<z.ZodBoolean>;
|
|
362
376
|
}, "strip", z.ZodTypeAny, {
|
|
363
377
|
csq?: boolean | undefined;
|
|
364
378
|
management?: boolean | undefined;
|
|
365
379
|
supervision?: boolean | undefined;
|
|
380
|
+
csq_admin?: boolean | undefined;
|
|
366
381
|
}, {
|
|
367
382
|
csq?: boolean | undefined;
|
|
368
383
|
management?: boolean | undefined;
|
|
369
384
|
supervision?: boolean | undefined;
|
|
385
|
+
csq_admin?: boolean | undefined;
|
|
370
386
|
}>, z.ZodBoolean]>>;
|
|
371
387
|
tenants: z.ZodOptional<z.ZodBoolean>;
|
|
372
388
|
finance: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
@@ -404,14 +420,18 @@ export declare const zNexusClaimsSchema: z.ZodObject<{
|
|
|
404
420
|
supervision: z.ZodOptional<z.ZodBoolean>;
|
|
405
421
|
/** Supervisão 2.0 (CSQ). Gate da fila e do laudo do evo-csq no Nexus. */
|
|
406
422
|
csq: z.ZodOptional<z.ZodBoolean>;
|
|
423
|
+
/** feat-280: administração do CSQ (config de plataforma, reavaliação). */
|
|
424
|
+
csq_admin: z.ZodOptional<z.ZodBoolean>;
|
|
407
425
|
}, "strip", z.ZodTypeAny, {
|
|
408
426
|
csq?: boolean | undefined;
|
|
409
427
|
management?: boolean | undefined;
|
|
410
428
|
supervision?: boolean | undefined;
|
|
429
|
+
csq_admin?: boolean | undefined;
|
|
411
430
|
}, {
|
|
412
431
|
csq?: boolean | undefined;
|
|
413
432
|
management?: boolean | undefined;
|
|
414
433
|
supervision?: boolean | undefined;
|
|
434
|
+
csq_admin?: boolean | undefined;
|
|
415
435
|
}>, z.ZodBoolean]>>;
|
|
416
436
|
tenants: z.ZodOptional<z.ZodBoolean>;
|
|
417
437
|
finance: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
@@ -443,14 +463,18 @@ export declare const zNexusClaimsSchema: z.ZodObject<{
|
|
|
443
463
|
supervision: z.ZodOptional<z.ZodBoolean>;
|
|
444
464
|
/** Supervisão 2.0 (CSQ). Gate da fila e do laudo do evo-csq no Nexus. */
|
|
445
465
|
csq: z.ZodOptional<z.ZodBoolean>;
|
|
466
|
+
/** feat-280: administração do CSQ (config de plataforma, reavaliação). */
|
|
467
|
+
csq_admin: z.ZodOptional<z.ZodBoolean>;
|
|
446
468
|
}, "strip", z.ZodTypeAny, {
|
|
447
469
|
csq?: boolean | undefined;
|
|
448
470
|
management?: boolean | undefined;
|
|
449
471
|
supervision?: boolean | undefined;
|
|
472
|
+
csq_admin?: boolean | undefined;
|
|
450
473
|
}, {
|
|
451
474
|
csq?: boolean | undefined;
|
|
452
475
|
management?: boolean | undefined;
|
|
453
476
|
supervision?: boolean | undefined;
|
|
477
|
+
csq_admin?: boolean | undefined;
|
|
454
478
|
}>, z.ZodBoolean]>>;
|
|
455
479
|
tenants: z.ZodOptional<z.ZodBoolean>;
|
|
456
480
|
finance: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
@@ -482,14 +506,18 @@ export declare const zNexusClaimsSchema: z.ZodObject<{
|
|
|
482
506
|
supervision: z.ZodOptional<z.ZodBoolean>;
|
|
483
507
|
/** Supervisão 2.0 (CSQ). Gate da fila e do laudo do evo-csq no Nexus. */
|
|
484
508
|
csq: z.ZodOptional<z.ZodBoolean>;
|
|
509
|
+
/** feat-280: administração do CSQ (config de plataforma, reavaliação). */
|
|
510
|
+
csq_admin: z.ZodOptional<z.ZodBoolean>;
|
|
485
511
|
}, "strip", z.ZodTypeAny, {
|
|
486
512
|
csq?: boolean | undefined;
|
|
487
513
|
management?: boolean | undefined;
|
|
488
514
|
supervision?: boolean | undefined;
|
|
515
|
+
csq_admin?: boolean | undefined;
|
|
489
516
|
}, {
|
|
490
517
|
csq?: boolean | undefined;
|
|
491
518
|
management?: boolean | undefined;
|
|
492
519
|
supervision?: boolean | undefined;
|
|
520
|
+
csq_admin?: boolean | undefined;
|
|
493
521
|
}>, z.ZodBoolean]>>;
|
|
494
522
|
tenants: z.ZodOptional<z.ZodBoolean>;
|
|
495
523
|
finance: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
@@ -524,6 +552,7 @@ export declare const zNexusClaimsSchema: z.ZodObject<{
|
|
|
524
552
|
csq?: boolean | undefined;
|
|
525
553
|
management?: boolean | undefined;
|
|
526
554
|
supervision?: boolean | undefined;
|
|
555
|
+
csq_admin?: boolean | undefined;
|
|
527
556
|
} | undefined;
|
|
528
557
|
finance?: boolean | {
|
|
529
558
|
reports?: boolean | undefined;
|
|
@@ -546,6 +575,7 @@ export declare const zNexusClaimsSchema: z.ZodObject<{
|
|
|
546
575
|
csq?: boolean | undefined;
|
|
547
576
|
management?: boolean | undefined;
|
|
548
577
|
supervision?: boolean | undefined;
|
|
578
|
+
csq_admin?: boolean | undefined;
|
|
549
579
|
} | undefined;
|
|
550
580
|
finance?: boolean | {
|
|
551
581
|
reports?: boolean | undefined;
|
|
@@ -100,6 +100,8 @@ exports.zNexusModuleChatPermissionsSchema = zod_1.z.object({
|
|
|
100
100
|
supervision: zod_1.z.boolean().optional(),
|
|
101
101
|
/** Supervisão 2.0 (CSQ). Gate da fila e do laudo do evo-csq no Nexus. */
|
|
102
102
|
csq: zod_1.z.boolean().optional(),
|
|
103
|
+
/** feat-280: administração do CSQ (config de plataforma, reavaliação). */
|
|
104
|
+
csq_admin: zod_1.z.boolean().optional(),
|
|
103
105
|
});
|
|
104
106
|
/**
|
|
105
107
|
* Schema for INexusModuleFinancePermissions
|
|
@@ -110,6 +110,8 @@ export const zNexusModuleChatPermissionsSchema = z.object({
|
|
|
110
110
|
supervision: z.boolean().optional(),
|
|
111
111
|
/** Supervisão 2.0 (CSQ). Gate da fila e do laudo do evo-csq no Nexus. */
|
|
112
112
|
csq: z.boolean().optional(),
|
|
113
|
+
/** feat-280: administração do CSQ (config de plataforma, reavaliação). */
|
|
114
|
+
csq_admin: z.boolean().optional(),
|
|
113
115
|
});
|
|
114
116
|
|
|
115
117
|
/**
|