evo360-types 1.3.804 → 1.3.807
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-modules/zod-schemas.d.ts +28 -9
- package/dist/apps/evo-modules/zod-schemas.js +28 -1
- package/dist/apps/evo-modules/zod-schemas.ts +26 -1
- package/dist/types/evo-finops/common/routine-allowance.d.ts +1 -1
- package/dist/types/evo-finops/common/routine-allowance.ts +1 -1
- package/dist/types/evo-modules/index.d.ts +11 -1
- package/dist/types/evo-modules/index.js +1 -0
- package/dist/types/evo-modules/index.ts +11 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const zModuleActionSchema: z.ZodEnum<["enable", "disable", "trial", "override"]>;
|
|
2
|
+
export declare const zModuleActionSchema: z.ZodEnum<["enable", "disable", "trial", "override", "configure"]>;
|
|
3
3
|
export declare const zModuleStepKindSchema: z.ZodEnum<["entitlement", "rbac_group", "rbac_recompute", "contract_allowance", "contract_check", "rollout_check"]>;
|
|
4
4
|
export declare const zModuleStepStatusSchema: z.ZodEnum<["pending", "noop", "change", "done", "failed", "blocked", "skipped"]>;
|
|
5
5
|
export declare const zModuleRunModeSchema: z.ZodEnum<["plan", "apply"]>;
|
|
@@ -10,13 +10,16 @@ export declare const zModuleChangeParamsSchema: z.ZodObject<{
|
|
|
10
10
|
allow_without_contract: z.ZodOptional<z.ZodBoolean>;
|
|
11
11
|
purge_rbac: z.ZodOptional<z.ZodBoolean>;
|
|
12
12
|
suspend: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
capabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodNumber, z.ZodString]>>>;
|
|
13
14
|
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
capabilities?: Record<string, string | number | boolean> | undefined;
|
|
14
16
|
expires_at?: Date | null | undefined;
|
|
15
17
|
allow_without_contract?: boolean | undefined;
|
|
16
18
|
override_until?: Date | null | undefined;
|
|
17
19
|
purge_rbac?: boolean | undefined;
|
|
18
20
|
suspend?: boolean | undefined;
|
|
19
21
|
}, {
|
|
22
|
+
capabilities?: Record<string, string | number | boolean> | undefined;
|
|
20
23
|
expires_at?: unknown;
|
|
21
24
|
allow_without_contract?: boolean | undefined;
|
|
22
25
|
override_until?: unknown;
|
|
@@ -27,20 +30,23 @@ export declare const zModuleChangeParamsSchema: z.ZodObject<{
|
|
|
27
30
|
export declare const zModuleChangeRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
28
31
|
tenant: z.ZodString;
|
|
29
32
|
module: z.ZodEffects<z.ZodString, string, string>;
|
|
30
|
-
action: z.ZodEnum<["enable", "disable", "trial", "override"]>;
|
|
33
|
+
action: z.ZodEnum<["enable", "disable", "trial", "override", "configure"]>;
|
|
31
34
|
params: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
32
35
|
expires_at: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodDate, Date, unknown>>>;
|
|
33
36
|
override_until: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodDate, Date, unknown>>>;
|
|
34
37
|
allow_without_contract: z.ZodOptional<z.ZodBoolean>;
|
|
35
38
|
purge_rbac: z.ZodOptional<z.ZodBoolean>;
|
|
36
39
|
suspend: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
capabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodNumber, z.ZodString]>>>;
|
|
37
41
|
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
capabilities?: Record<string, string | number | boolean> | undefined;
|
|
38
43
|
expires_at?: Date | null | undefined;
|
|
39
44
|
allow_without_contract?: boolean | undefined;
|
|
40
45
|
override_until?: Date | null | undefined;
|
|
41
46
|
purge_rbac?: boolean | undefined;
|
|
42
47
|
suspend?: boolean | undefined;
|
|
43
48
|
}, {
|
|
49
|
+
capabilities?: Record<string, string | number | boolean> | undefined;
|
|
44
50
|
expires_at?: unknown;
|
|
45
51
|
allow_without_contract?: boolean | undefined;
|
|
46
52
|
override_until?: unknown;
|
|
@@ -51,6 +57,7 @@ export declare const zModuleChangeRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
51
57
|
}, "strip", z.ZodTypeAny, {
|
|
52
58
|
tenant: string;
|
|
53
59
|
params: {
|
|
60
|
+
capabilities?: Record<string, string | number | boolean> | undefined;
|
|
54
61
|
expires_at?: Date | null | undefined;
|
|
55
62
|
allow_without_contract?: boolean | undefined;
|
|
56
63
|
override_until?: Date | null | undefined;
|
|
@@ -58,14 +65,15 @@ export declare const zModuleChangeRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
58
65
|
suspend?: boolean | undefined;
|
|
59
66
|
};
|
|
60
67
|
reason: string;
|
|
61
|
-
action: "trial" | "enable" | "disable" | "override";
|
|
68
|
+
action: "trial" | "enable" | "disable" | "override" | "configure";
|
|
62
69
|
module: string;
|
|
63
70
|
}, {
|
|
64
71
|
tenant: string;
|
|
65
72
|
reason: string;
|
|
66
|
-
action: "trial" | "enable" | "disable" | "override";
|
|
73
|
+
action: "trial" | "enable" | "disable" | "override" | "configure";
|
|
67
74
|
module: string;
|
|
68
75
|
params?: {
|
|
76
|
+
capabilities?: Record<string, string | number | boolean> | undefined;
|
|
69
77
|
expires_at?: unknown;
|
|
70
78
|
allow_without_contract?: boolean | undefined;
|
|
71
79
|
override_until?: unknown;
|
|
@@ -75,6 +83,7 @@ export declare const zModuleChangeRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
75
83
|
}>, {
|
|
76
84
|
tenant: string;
|
|
77
85
|
params: {
|
|
86
|
+
capabilities?: Record<string, string | number | boolean> | undefined;
|
|
78
87
|
expires_at?: Date | null | undefined;
|
|
79
88
|
allow_without_contract?: boolean | undefined;
|
|
80
89
|
override_until?: Date | null | undefined;
|
|
@@ -82,14 +91,15 @@ export declare const zModuleChangeRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
82
91
|
suspend?: boolean | undefined;
|
|
83
92
|
};
|
|
84
93
|
reason: string;
|
|
85
|
-
action: "trial" | "enable" | "disable" | "override";
|
|
94
|
+
action: "trial" | "enable" | "disable" | "override" | "configure";
|
|
86
95
|
module: string;
|
|
87
96
|
}, {
|
|
88
97
|
tenant: string;
|
|
89
98
|
reason: string;
|
|
90
|
-
action: "trial" | "enable" | "disable" | "override";
|
|
99
|
+
action: "trial" | "enable" | "disable" | "override" | "configure";
|
|
91
100
|
module: string;
|
|
92
101
|
params?: {
|
|
102
|
+
capabilities?: Record<string, string | number | boolean> | undefined;
|
|
93
103
|
expires_at?: unknown;
|
|
94
104
|
allow_without_contract?: boolean | undefined;
|
|
95
105
|
override_until?: unknown;
|
|
@@ -195,7 +205,7 @@ export declare const zModuleProvisioningRunSchema: z.ZodObject<{
|
|
|
195
205
|
} & {
|
|
196
206
|
tenant: z.ZodString;
|
|
197
207
|
module: z.ZodString;
|
|
198
|
-
action: z.ZodEnum<["enable", "disable", "trial", "override"]>;
|
|
208
|
+
action: z.ZodEnum<["enable", "disable", "trial", "override", "configure"]>;
|
|
199
209
|
mode: z.ZodEnum<["plan", "apply"]>;
|
|
200
210
|
status: z.ZodEnum<["planned", "running", "done", "failed", "blocked", "superseded"]>;
|
|
201
211
|
params: z.ZodObject<{
|
|
@@ -204,13 +214,16 @@ export declare const zModuleProvisioningRunSchema: z.ZodObject<{
|
|
|
204
214
|
allow_without_contract: z.ZodOptional<z.ZodBoolean>;
|
|
205
215
|
purge_rbac: z.ZodOptional<z.ZodBoolean>;
|
|
206
216
|
suspend: z.ZodOptional<z.ZodBoolean>;
|
|
217
|
+
capabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodNumber, z.ZodString]>>>;
|
|
207
218
|
}, "strip", z.ZodTypeAny, {
|
|
219
|
+
capabilities?: Record<string, string | number | boolean> | undefined;
|
|
208
220
|
expires_at?: Date | null | undefined;
|
|
209
221
|
allow_without_contract?: boolean | undefined;
|
|
210
222
|
override_until?: Date | null | undefined;
|
|
211
223
|
purge_rbac?: boolean | undefined;
|
|
212
224
|
suspend?: boolean | undefined;
|
|
213
225
|
}, {
|
|
226
|
+
capabilities?: Record<string, string | number | boolean> | undefined;
|
|
214
227
|
expires_at?: unknown;
|
|
215
228
|
allow_without_contract?: boolean | undefined;
|
|
216
229
|
override_until?: unknown;
|
|
@@ -275,7 +288,7 @@ export declare const zModuleProvisioningRunSchema: z.ZodObject<{
|
|
|
275
288
|
} & {
|
|
276
289
|
tenant: z.ZodString;
|
|
277
290
|
module: z.ZodString;
|
|
278
|
-
action: z.ZodEnum<["enable", "disable", "trial", "override"]>;
|
|
291
|
+
action: z.ZodEnum<["enable", "disable", "trial", "override", "configure"]>;
|
|
279
292
|
mode: z.ZodEnum<["plan", "apply"]>;
|
|
280
293
|
status: z.ZodEnum<["planned", "running", "done", "failed", "blocked", "superseded"]>;
|
|
281
294
|
params: z.ZodObject<{
|
|
@@ -284,13 +297,16 @@ export declare const zModuleProvisioningRunSchema: z.ZodObject<{
|
|
|
284
297
|
allow_without_contract: z.ZodOptional<z.ZodBoolean>;
|
|
285
298
|
purge_rbac: z.ZodOptional<z.ZodBoolean>;
|
|
286
299
|
suspend: z.ZodOptional<z.ZodBoolean>;
|
|
300
|
+
capabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodNumber, z.ZodString]>>>;
|
|
287
301
|
}, "strip", z.ZodTypeAny, {
|
|
302
|
+
capabilities?: Record<string, string | number | boolean> | undefined;
|
|
288
303
|
expires_at?: Date | null | undefined;
|
|
289
304
|
allow_without_contract?: boolean | undefined;
|
|
290
305
|
override_until?: Date | null | undefined;
|
|
291
306
|
purge_rbac?: boolean | undefined;
|
|
292
307
|
suspend?: boolean | undefined;
|
|
293
308
|
}, {
|
|
309
|
+
capabilities?: Record<string, string | number | boolean> | undefined;
|
|
294
310
|
expires_at?: unknown;
|
|
295
311
|
allow_without_contract?: boolean | undefined;
|
|
296
312
|
override_until?: unknown;
|
|
@@ -355,7 +371,7 @@ export declare const zModuleProvisioningRunSchema: z.ZodObject<{
|
|
|
355
371
|
} & {
|
|
356
372
|
tenant: z.ZodString;
|
|
357
373
|
module: z.ZodString;
|
|
358
|
-
action: z.ZodEnum<["enable", "disable", "trial", "override"]>;
|
|
374
|
+
action: z.ZodEnum<["enable", "disable", "trial", "override", "configure"]>;
|
|
359
375
|
mode: z.ZodEnum<["plan", "apply"]>;
|
|
360
376
|
status: z.ZodEnum<["planned", "running", "done", "failed", "blocked", "superseded"]>;
|
|
361
377
|
params: z.ZodObject<{
|
|
@@ -364,13 +380,16 @@ export declare const zModuleProvisioningRunSchema: z.ZodObject<{
|
|
|
364
380
|
allow_without_contract: z.ZodOptional<z.ZodBoolean>;
|
|
365
381
|
purge_rbac: z.ZodOptional<z.ZodBoolean>;
|
|
366
382
|
suspend: z.ZodOptional<z.ZodBoolean>;
|
|
383
|
+
capabilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodNumber, z.ZodString]>>>;
|
|
367
384
|
}, "strip", z.ZodTypeAny, {
|
|
385
|
+
capabilities?: Record<string, string | number | boolean> | undefined;
|
|
368
386
|
expires_at?: Date | null | undefined;
|
|
369
387
|
allow_without_contract?: boolean | undefined;
|
|
370
388
|
override_until?: Date | null | undefined;
|
|
371
389
|
purge_rbac?: boolean | undefined;
|
|
372
390
|
suspend?: boolean | undefined;
|
|
373
391
|
}, {
|
|
392
|
+
capabilities?: Record<string, string | number | boolean> | undefined;
|
|
374
393
|
expires_at?: unknown;
|
|
375
394
|
allow_without_contract?: boolean | undefined;
|
|
376
395
|
override_until?: unknown;
|
|
@@ -11,7 +11,7 @@ const catalog_1 = require("../../types/evo-modules/catalog");
|
|
|
11
11
|
// `types/evo-modules/index.ts`. As listas são à mão: manter os dois lados
|
|
12
12
|
// sincronizados (o teste do catálogo confere).
|
|
13
13
|
// ======================================================
|
|
14
|
-
exports.zModuleActionSchema = zod_1.z.enum(["enable", "disable", "trial", "override"]);
|
|
14
|
+
exports.zModuleActionSchema = zod_1.z.enum(["enable", "disable", "trial", "override", "configure"]);
|
|
15
15
|
exports.zModuleStepKindSchema = zod_1.z.enum([
|
|
16
16
|
"entitlement",
|
|
17
17
|
"rbac_group",
|
|
@@ -44,6 +44,7 @@ exports.zModuleChangeParamsSchema = zod_1.z.object({
|
|
|
44
44
|
allow_without_contract: zod_1.z.boolean().optional(),
|
|
45
45
|
purge_rbac: zod_1.z.boolean().optional(),
|
|
46
46
|
suspend: zod_1.z.boolean().optional(),
|
|
47
|
+
capabilities: zod_1.z.record(zod_1.z.union([zod_1.z.boolean(), zod_1.z.number(), zod_1.z.string()])).optional(),
|
|
47
48
|
});
|
|
48
49
|
const zModuleKeyInCatalog = zod_1.z
|
|
49
50
|
.string()
|
|
@@ -78,6 +79,32 @@ exports.zModuleChangeRequestSchema = zod_1.z
|
|
|
78
79
|
ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["params", "override_until"], message: "params.override_until must be in the future" });
|
|
79
80
|
}
|
|
80
81
|
}
|
|
82
|
+
if (req.action === "configure") {
|
|
83
|
+
const caps = req.params.capabilities;
|
|
84
|
+
const keys = caps ? Object.keys(caps) : [];
|
|
85
|
+
if (!caps || keys.length === 0) {
|
|
86
|
+
ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["params", "capabilities"], message: "configure requires at least one capability" });
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const def = (0, catalog_1.getModuleDefinition)(req.module);
|
|
90
|
+
if (!def)
|
|
91
|
+
return; // `module` já falhou no refine do catálogo
|
|
92
|
+
for (let i = 0; i < keys.length; i++) {
|
|
93
|
+
const key = keys[i];
|
|
94
|
+
const known = def.capabilities[key];
|
|
95
|
+
if (!known) {
|
|
96
|
+
ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["params", "capabilities", key], message: `capability '${key}' is not in the catalog of '${def.key}'` });
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
const value = caps[key];
|
|
100
|
+
if (typeof value !== typeof known.default) {
|
|
101
|
+
ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["params", "capabilities", key], message: `capability '${key}' must be ${typeof known.default}` });
|
|
102
|
+
}
|
|
103
|
+
else if (typeof value === "number" && (!isFinite(value) || value < 0 || Math.floor(value) !== value)) {
|
|
104
|
+
ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: ["params", "capabilities", key], message: `capability '${key}' must be a non-negative integer` });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
81
108
|
});
|
|
82
109
|
/** Body de `nex_tenants-applyModuleChange`: exatamente um de `plan_run_id` / `resume_run_id`. */
|
|
83
110
|
exports.zModuleApplyRequestSchema = zod_1.z
|
|
@@ -10,7 +10,7 @@ import { getModuleDefinition } from "../../types/evo-modules/catalog";
|
|
|
10
10
|
// sincronizados (o teste do catálogo confere).
|
|
11
11
|
// ======================================================
|
|
12
12
|
|
|
13
|
-
export const zModuleActionSchema = z.enum(["enable", "disable", "trial", "override"]);
|
|
13
|
+
export const zModuleActionSchema = z.enum(["enable", "disable", "trial", "override", "configure"]);
|
|
14
14
|
|
|
15
15
|
export const zModuleStepKindSchema = z.enum([
|
|
16
16
|
"entitlement",
|
|
@@ -48,6 +48,7 @@ export const zModuleChangeParamsSchema = z.object({
|
|
|
48
48
|
allow_without_contract: z.boolean().optional(),
|
|
49
49
|
purge_rbac: z.boolean().optional(),
|
|
50
50
|
suspend: z.boolean().optional(),
|
|
51
|
+
capabilities: z.record(z.union([z.boolean(), z.number(), z.string()])).optional(),
|
|
51
52
|
});
|
|
52
53
|
|
|
53
54
|
const zModuleKeyInCatalog = z
|
|
@@ -82,6 +83,30 @@ export const zModuleChangeRequestSchema = z
|
|
|
82
83
|
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["params", "override_until"], message: "params.override_until must be in the future" });
|
|
83
84
|
}
|
|
84
85
|
}
|
|
86
|
+
if (req.action === "configure") {
|
|
87
|
+
const caps = req.params.capabilities;
|
|
88
|
+
const keys = caps ? Object.keys(caps) : [];
|
|
89
|
+
if (!caps || keys.length === 0) {
|
|
90
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["params", "capabilities"], message: "configure requires at least one capability" });
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const def = getModuleDefinition(req.module);
|
|
94
|
+
if (!def) return; // `module` já falhou no refine do catálogo
|
|
95
|
+
for (let i = 0; i < keys.length; i++) {
|
|
96
|
+
const key = keys[i];
|
|
97
|
+
const known = def.capabilities[key];
|
|
98
|
+
if (!known) {
|
|
99
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["params", "capabilities", key], message: `capability '${key}' is not in the catalog of '${def.key}'` });
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const value = caps[key];
|
|
103
|
+
if (typeof value !== typeof known.default) {
|
|
104
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["params", "capabilities", key], message: `capability '${key}' must be ${typeof known.default}` });
|
|
105
|
+
} else if (typeof value === "number" && (!isFinite(value) || value < 0 || Math.floor(value) !== value)) {
|
|
106
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["params", "capabilities", key], message: `capability '${key}' must be a non-negative integer` });
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
85
110
|
});
|
|
86
111
|
|
|
87
112
|
/** Body de `nex_tenants-applyModuleChange`: exatamente um de `plan_run_id` / `resume_run_id`. */
|
|
@@ -29,7 +29,7 @@ export interface IRoutineAllowanceCheck {
|
|
|
29
29
|
adding: number;
|
|
30
30
|
/** `active_now + adding`. */
|
|
31
31
|
active_after: number;
|
|
32
|
-
/** `applies && active_after > included`: a tela mostra o aviso. */
|
|
32
|
+
/** `applies && adding > 0 && active_after > included`: a tela mostra o aviso. */
|
|
33
33
|
exceeds: boolean;
|
|
34
34
|
/** Quanto a ativação acrescenta à cobrança deste mês (pode ser 0 se o pico já estava acima). */
|
|
35
35
|
extra_this_month: number;
|
|
@@ -30,7 +30,7 @@ export interface IRoutineAllowanceCheck {
|
|
|
30
30
|
adding: number;
|
|
31
31
|
/** `active_now + adding`. */
|
|
32
32
|
active_after: number;
|
|
33
|
-
/** `applies && active_after > included`: a tela mostra o aviso. */
|
|
33
|
+
/** `applies && adding > 0 && active_after > included`: a tela mostra o aviso. */
|
|
34
34
|
exceeds: boolean;
|
|
35
35
|
/** Quanto a ativação acrescenta à cobrança deste mês (pode ser 0 se o pico já estava acima). */
|
|
36
36
|
extra_this_month: number;
|
|
@@ -11,12 +11,17 @@ export declare const MODULES_ROLLOUT_PLATFORM_PATH = "platform/evo-modules/rollo
|
|
|
11
11
|
export declare const MODULES_LOCK_TTL_MS: number;
|
|
12
12
|
/** Regex da chave de módulo (`tenants/{t}.modules[key]`). */
|
|
13
13
|
export declare const MODULE_KEY_PATTERN: RegExp;
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* `configure` (F4): muda capabilities de um módulo JÁ ativo (`params.capabilities`),
|
|
16
|
+
* sem tocar status, contrato, RBAC nem rollout. Só o passo `entitlement`.
|
|
17
|
+
*/
|
|
18
|
+
export type ModuleAction = "enable" | "disable" | "trial" | "override" | "configure";
|
|
15
19
|
export declare const ModuleActionEnum: {
|
|
16
20
|
readonly Enable: "enable";
|
|
17
21
|
readonly Disable: "disable";
|
|
18
22
|
readonly Trial: "trial";
|
|
19
23
|
readonly Override: "override";
|
|
24
|
+
readonly Configure: "configure";
|
|
20
25
|
};
|
|
21
26
|
export type ModuleStepKind = "entitlement" | "rbac_group" | "rbac_recompute" | "contract_allowance" | "contract_check" | "rollout_check";
|
|
22
27
|
export declare const ModuleStepKindEnum: {
|
|
@@ -102,6 +107,11 @@ export interface IModuleChangeParams {
|
|
|
102
107
|
purge_rbac?: boolean;
|
|
103
108
|
/** `disable`: grava `suspended` em vez de `cancelled`. */
|
|
104
109
|
suspend?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* `configure`: obrigatório. Capabilities a gravar (merge raso sobre as atuais);
|
|
112
|
+
* só chaves do catálogo do módulo, com o mesmo tipo do `default`.
|
|
113
|
+
*/
|
|
114
|
+
capabilities?: Record<string, boolean | number | string>;
|
|
105
115
|
}
|
|
106
116
|
export interface IModuleRunActor extends IEntitlementAuditActor {
|
|
107
117
|
login_id?: string;
|
|
@@ -49,12 +49,17 @@ export const MODULES_LOCK_TTL_MS = 10 * 60 * 1000;
|
|
|
49
49
|
/** Regex da chave de módulo (`tenants/{t}.modules[key]`). */
|
|
50
50
|
export const MODULE_KEY_PATTERN = /^[a-z][a-z0-9_]{1,40}$/;
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
/**
|
|
53
|
+
* `configure` (F4): muda capabilities de um módulo JÁ ativo (`params.capabilities`),
|
|
54
|
+
* sem tocar status, contrato, RBAC nem rollout. Só o passo `entitlement`.
|
|
55
|
+
*/
|
|
56
|
+
export type ModuleAction = "enable" | "disable" | "trial" | "override" | "configure";
|
|
53
57
|
export const ModuleActionEnum = {
|
|
54
58
|
Enable: "enable",
|
|
55
59
|
Disable: "disable",
|
|
56
60
|
Trial: "trial",
|
|
57
61
|
Override: "override",
|
|
62
|
+
Configure: "configure",
|
|
58
63
|
} as const;
|
|
59
64
|
|
|
60
65
|
export type ModuleStepKind =
|
|
@@ -173,6 +178,11 @@ export interface IModuleChangeParams {
|
|
|
173
178
|
purge_rbac?: boolean;
|
|
174
179
|
/** `disable`: grava `suspended` em vez de `cancelled`. */
|
|
175
180
|
suspend?: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* `configure`: obrigatório. Capabilities a gravar (merge raso sobre as atuais);
|
|
183
|
+
* só chaves do catálogo do módulo, com o mesmo tipo do `default`.
|
|
184
|
+
*/
|
|
185
|
+
capabilities?: Record<string, boolean | number | string>;
|
|
176
186
|
}
|
|
177
187
|
|
|
178
188
|
export interface IModuleRunActor extends IEntitlementAuditActor {
|