evo360-types 1.3.656 → 1.3.662
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-csq/zod-schemas.d.ts +40 -40
- package/dist/apps/evo-modules/zod-schemas.d.ts +446 -0
- package/dist/apps/evo-modules/zod-schemas.js +143 -0
- package/dist/apps/evo-modules/zod-schemas.ts +153 -0
- package/dist/apps/evo-task/zod-schemas.d.ts +201 -4
- package/dist/apps/evo-task/zod-schemas.js +22 -2
- package/dist/apps/evo-task/zod-schemas.ts +23 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.ts +2 -0
- package/dist/types/evo-modules/activation.d.ts +46 -0
- package/dist/types/evo-modules/activation.js +131 -0
- package/dist/types/evo-modules/activation.ts +150 -0
- package/dist/types/evo-modules/catalog.d.ts +28 -0
- package/dist/types/evo-modules/catalog.js +130 -0
- package/dist/types/evo-modules/catalog.ts +131 -0
- package/dist/types/evo-modules/index.d.ts +227 -0
- package/dist/types/evo-modules/index.js +75 -0
- package/dist/types/evo-modules/index.ts +329 -0
- package/dist/types/evo-task/index.d.ts +14 -0
- package/dist/types/evo-task/index.js +3 -0
- package/dist/types/evo-task/index.ts +25 -0
- package/dist/types/evo-task-runner/index.d.ts +2 -1
- package/dist/types/evo-task-runner/index.ts +5 -1
- package/dist/types/evo-telemedicine/fb_collections.js +1 -1
- package/dist/types/evo-telemedicine/fb_collections.ts +1 -1
- package/dist/types/evo-telemedicine/index.d.ts +8 -12
- package/dist/types/evo-telemedicine/index.ts +8 -12
- package/dist/types/evo-tenant/index.ts +3 -1
- package/fixtures/tenant-modules/is-module-active.parity.json +364 -0
- package/package.json +7 -4
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { zFireDocSchema, zFirestoreDateSchema } from "../shared/zod-schemas";
|
|
3
|
+
import { getModuleDefinition } from "../../types/evo-modules/catalog";
|
|
4
|
+
|
|
5
|
+
// ======================================================
|
|
6
|
+
// evo-modules (feat-263) — zod schemas
|
|
7
|
+
//
|
|
8
|
+
// Espelham `ModuleAction`, `ModuleStepKind`, `ModuleStepStatus` e os shapes de
|
|
9
|
+
// `types/evo-modules/index.ts`. As listas são à mão: manter os dois lados
|
|
10
|
+
// sincronizados (o teste do catálogo confere).
|
|
11
|
+
// ======================================================
|
|
12
|
+
|
|
13
|
+
export const zModuleActionSchema = z.enum(["enable", "disable", "trial", "override"]);
|
|
14
|
+
|
|
15
|
+
export const zModuleStepKindSchema = z.enum([
|
|
16
|
+
"entitlement",
|
|
17
|
+
"rbac_group",
|
|
18
|
+
"rbac_recompute",
|
|
19
|
+
"contract_allowance",
|
|
20
|
+
"contract_check",
|
|
21
|
+
"rollout_check",
|
|
22
|
+
]);
|
|
23
|
+
|
|
24
|
+
export const zModuleStepStatusSchema = z.enum([
|
|
25
|
+
"pending",
|
|
26
|
+
"noop",
|
|
27
|
+
"change",
|
|
28
|
+
"done",
|
|
29
|
+
"failed",
|
|
30
|
+
"blocked",
|
|
31
|
+
"skipped",
|
|
32
|
+
]);
|
|
33
|
+
|
|
34
|
+
export const zModuleRunModeSchema = z.enum(["plan", "apply"]);
|
|
35
|
+
|
|
36
|
+
export const zModuleRunStatusSchema = z.enum([
|
|
37
|
+
"planned",
|
|
38
|
+
"running",
|
|
39
|
+
"done",
|
|
40
|
+
"failed",
|
|
41
|
+
"blocked",
|
|
42
|
+
"superseded",
|
|
43
|
+
]);
|
|
44
|
+
|
|
45
|
+
export const zModuleChangeParamsSchema = z.object({
|
|
46
|
+
expires_at: zFirestoreDateSchema.nullable().optional(),
|
|
47
|
+
override_until: zFirestoreDateSchema.nullable().optional(),
|
|
48
|
+
allow_without_contract: z.boolean().optional(),
|
|
49
|
+
purge_rbac: z.boolean().optional(),
|
|
50
|
+
suspend: z.boolean().optional(),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const zModuleKeyInCatalog = z
|
|
54
|
+
.string()
|
|
55
|
+
.min(1)
|
|
56
|
+
.refine((k) => getModuleDefinition(k) !== null, { message: "module is not in PLATFORM_MODULE_CATALOG" });
|
|
57
|
+
|
|
58
|
+
/** Body de `nex_tenants-planModuleChange` (e entrada do runner). */
|
|
59
|
+
export const zModuleChangeRequestSchema = z
|
|
60
|
+
.object({
|
|
61
|
+
tenant: z.string().trim().min(1).max(255),
|
|
62
|
+
module: zModuleKeyInCatalog,
|
|
63
|
+
action: zModuleActionSchema,
|
|
64
|
+
params: zModuleChangeParamsSchema.optional().default({}),
|
|
65
|
+
reason: z.string().trim().min(3).max(1000),
|
|
66
|
+
})
|
|
67
|
+
.superRefine((req, ctx) => {
|
|
68
|
+
const now = Date.now();
|
|
69
|
+
if (req.action === "trial") {
|
|
70
|
+
const exp = req.params.expires_at;
|
|
71
|
+
if (!exp) {
|
|
72
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["params", "expires_at"], message: "trial requires params.expires_at" });
|
|
73
|
+
} else if (exp.getTime() <= now) {
|
|
74
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["params", "expires_at"], message: "params.expires_at must be in the future" });
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (req.action === "override") {
|
|
78
|
+
const until = req.params.override_until;
|
|
79
|
+
if (!until) {
|
|
80
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["params", "override_until"], message: "override requires params.override_until" });
|
|
81
|
+
} else if (until.getTime() <= now) {
|
|
82
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["params", "override_until"], message: "params.override_until must be in the future" });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
/** Body de `nex_tenants-applyModuleChange`: exatamente um de `plan_run_id` / `resume_run_id`. */
|
|
88
|
+
export const zModuleApplyRequestSchema = z
|
|
89
|
+
.object({
|
|
90
|
+
tenant: z.string().trim().min(1).max(255),
|
|
91
|
+
plan_run_id: z.string().trim().min(1).optional(),
|
|
92
|
+
resume_run_id: z.string().trim().min(1).optional(),
|
|
93
|
+
params: z.object({ allow_without_contract: z.boolean().optional() }).optional(),
|
|
94
|
+
})
|
|
95
|
+
.superRefine((req, ctx) => {
|
|
96
|
+
const n = (req.plan_run_id ? 1 : 0) + (req.resume_run_id ? 1 : 0);
|
|
97
|
+
if (n !== 1) {
|
|
98
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: ["plan_run_id"], message: "exactly one of plan_run_id / resume_run_id is required" });
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
/** Body de `nex_tenants-getModuleOverview`. */
|
|
103
|
+
export const zModuleOverviewRequestSchema = z.object({
|
|
104
|
+
tenant: z.string().trim().min(1).max(255),
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
export const zModuleProvisioningStepSchema = z.object({
|
|
108
|
+
kind: zModuleStepKindSchema,
|
|
109
|
+
status: zModuleStepStatusSchema,
|
|
110
|
+
summary: z.string(),
|
|
111
|
+
before: z.unknown().optional(),
|
|
112
|
+
after: z.unknown().optional(),
|
|
113
|
+
error: z.string().nullable().optional(),
|
|
114
|
+
started_at: zFirestoreDateSchema.nullable().optional(),
|
|
115
|
+
finished_at: zFirestoreDateSchema.nullable().optional(),
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export const zModuleRunActorSchema = z.object({
|
|
119
|
+
type: z.enum(["user", "system", "script"]),
|
|
120
|
+
id: z.string().optional(),
|
|
121
|
+
login_id: z.string().optional(),
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
export const zModuleProvisioningRunSchema = zFireDocSchema
|
|
125
|
+
.extend({
|
|
126
|
+
tenant: z.string().min(1),
|
|
127
|
+
module: z.string().min(1),
|
|
128
|
+
action: zModuleActionSchema,
|
|
129
|
+
mode: zModuleRunModeSchema,
|
|
130
|
+
status: zModuleRunStatusSchema,
|
|
131
|
+
params: zModuleChangeParamsSchema,
|
|
132
|
+
plan_hash: z.string(),
|
|
133
|
+
types_version: z.string(),
|
|
134
|
+
steps: z.array(zModuleProvisioningStepSchema),
|
|
135
|
+
actor: zModuleRunActorSchema,
|
|
136
|
+
reason: z.string(),
|
|
137
|
+
resumed_from: z.string().nullable().optional(),
|
|
138
|
+
plan_run_id: z.string().nullable().optional(),
|
|
139
|
+
error: z.string().nullable().optional(),
|
|
140
|
+
finished_at: zFirestoreDateSchema.nullable().optional(),
|
|
141
|
+
created_at: zFirestoreDateSchema.nullable().optional(),
|
|
142
|
+
updated_at: zFirestoreDateSchema.nullable().optional(),
|
|
143
|
+
})
|
|
144
|
+
.passthrough();
|
|
145
|
+
|
|
146
|
+
export const zModuleRolloutDocSchema = z
|
|
147
|
+
.object({
|
|
148
|
+
flags: z.record(z.string(), z.boolean()).default({}),
|
|
149
|
+
emergency_kill: z.boolean().default(false),
|
|
150
|
+
updated_at: zFirestoreDateSchema.nullable().optional(),
|
|
151
|
+
updated_by: z.string().optional(),
|
|
152
|
+
})
|
|
153
|
+
.passthrough();
|
|
@@ -10,7 +10,36 @@ export declare const zTaskDedupScopeSchema: z.ZodEnum<["per_recipient", "per_rec
|
|
|
10
10
|
export declare const zTaskDedupWindowSchema: z.ZodEnum<["same_day", "n_hours", "custom"]>;
|
|
11
11
|
export declare const zExternalObjectTypeSchema: z.ZodEnum<["crm_lead", "med_patient", "med_professional", "med_appointment", "chat_contact", "evo_task", "campaign", "nex_billing", "nex_contract", "nex_customer", "teleconsultation"]>;
|
|
12
12
|
export declare const zTaskExternalObjectTypeSchema: z.ZodEnum<["crm_lead", "med_patient", "med_professional", "med_appointment", "chat_contact", "evo_task", "campaign", "nex_billing", "nex_contract", "nex_customer", "teleconsultation"]>;
|
|
13
|
-
export declare const zTaskExecutionStatusSchema: z.ZodEnum<["success", "error", "retry"]>;
|
|
13
|
+
export declare const zTaskExecutionStatusSchema: z.ZodEnum<["success", "error", "retry", "suppressed"]>;
|
|
14
|
+
export declare const zTaskOutcomeClassSchema: z.ZodEnum<["legitimate", "defect"]>;
|
|
15
|
+
export declare const zTaskOutcomeSchema: z.ZodObject<{
|
|
16
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
17
|
+
reason: z.ZodString;
|
|
18
|
+
label: z.ZodString;
|
|
19
|
+
message: z.ZodString;
|
|
20
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
21
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
22
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
23
|
+
at: z.ZodDate;
|
|
24
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
25
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
26
|
+
reason: z.ZodString;
|
|
27
|
+
label: z.ZodString;
|
|
28
|
+
message: z.ZodString;
|
|
29
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
30
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
31
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
32
|
+
at: z.ZodDate;
|
|
33
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
34
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
35
|
+
reason: z.ZodString;
|
|
36
|
+
label: z.ZodString;
|
|
37
|
+
message: z.ZodString;
|
|
38
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
39
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
40
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
41
|
+
at: z.ZodDate;
|
|
42
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
14
43
|
export declare const zExternalOwnerSystemSchema: z.ZodEnum<["nexus"]>;
|
|
15
44
|
export declare const zExternalLinkKindSchema: z.ZodEnum<["identity", "representation"]>;
|
|
16
45
|
export declare const zExternalLinkStatusSchema: z.ZodEnum<["suggested", "confirmed", "rejected"]>;
|
|
@@ -1106,6 +1135,34 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
1106
1135
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1107
1136
|
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
1108
1137
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
1138
|
+
outcome: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1139
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
1140
|
+
reason: z.ZodString;
|
|
1141
|
+
label: z.ZodString;
|
|
1142
|
+
message: z.ZodString;
|
|
1143
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
1144
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
1145
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1146
|
+
at: z.ZodDate;
|
|
1147
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1148
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
1149
|
+
reason: z.ZodString;
|
|
1150
|
+
label: z.ZodString;
|
|
1151
|
+
message: z.ZodString;
|
|
1152
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
1153
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
1154
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1155
|
+
at: z.ZodDate;
|
|
1156
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1157
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
1158
|
+
reason: z.ZodString;
|
|
1159
|
+
label: z.ZodString;
|
|
1160
|
+
message: z.ZodString;
|
|
1161
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
1162
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
1163
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1164
|
+
at: z.ZodDate;
|
|
1165
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
1109
1166
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1110
1167
|
id: z.ZodString;
|
|
1111
1168
|
ref: z.ZodAny;
|
|
@@ -1619,6 +1676,34 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
1619
1676
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1620
1677
|
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
1621
1678
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
1679
|
+
outcome: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1680
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
1681
|
+
reason: z.ZodString;
|
|
1682
|
+
label: z.ZodString;
|
|
1683
|
+
message: z.ZodString;
|
|
1684
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
1685
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
1686
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1687
|
+
at: z.ZodDate;
|
|
1688
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1689
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
1690
|
+
reason: z.ZodString;
|
|
1691
|
+
label: z.ZodString;
|
|
1692
|
+
message: z.ZodString;
|
|
1693
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
1694
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
1695
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1696
|
+
at: z.ZodDate;
|
|
1697
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1698
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
1699
|
+
reason: z.ZodString;
|
|
1700
|
+
label: z.ZodString;
|
|
1701
|
+
message: z.ZodString;
|
|
1702
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
1703
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
1704
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1705
|
+
at: z.ZodDate;
|
|
1706
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
1622
1707
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1623
1708
|
id: z.ZodString;
|
|
1624
1709
|
ref: z.ZodAny;
|
|
@@ -2132,6 +2217,34 @@ export declare const zTaskSchema: z.ZodObject<{
|
|
|
2132
2217
|
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
2133
2218
|
idempotency_key: z.ZodOptional<z.ZodString>;
|
|
2134
2219
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
2220
|
+
outcome: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
2221
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
2222
|
+
reason: z.ZodString;
|
|
2223
|
+
label: z.ZodString;
|
|
2224
|
+
message: z.ZodString;
|
|
2225
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
2226
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
2227
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2228
|
+
at: z.ZodDate;
|
|
2229
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2230
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
2231
|
+
reason: z.ZodString;
|
|
2232
|
+
label: z.ZodString;
|
|
2233
|
+
message: z.ZodString;
|
|
2234
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
2235
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
2236
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2237
|
+
at: z.ZodDate;
|
|
2238
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2239
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
2240
|
+
reason: z.ZodString;
|
|
2241
|
+
label: z.ZodString;
|
|
2242
|
+
message: z.ZodString;
|
|
2243
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
2244
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
2245
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2246
|
+
at: z.ZodDate;
|
|
2247
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
2135
2248
|
}, z.ZodTypeAny, "passthrough">>;
|
|
2136
2249
|
export declare const zTaskCommentAuthorSchema: z.ZodObject<{
|
|
2137
2250
|
name: z.ZodString;
|
|
@@ -2248,7 +2361,7 @@ export declare const zTaskExecutionSchema: z.ZodObject<{
|
|
|
2248
2361
|
taskId: z.ZodString;
|
|
2249
2362
|
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "appointment_confirmation", "appointment_post_consultation", "evo-integrations.sync-run", "lead_form_capture", "campaign.materialize", "campaign.dispatch_batch", "telemedicine_join_reminder", "appointment_invoice"]>;
|
|
2250
2363
|
kind: z.ZodString;
|
|
2251
|
-
status: z.ZodEnum<["success", "error", "retry"]>;
|
|
2364
|
+
status: z.ZodEnum<["success", "error", "retry", "suppressed"]>;
|
|
2252
2365
|
attempt: z.ZodNumber;
|
|
2253
2366
|
started_at: z.ZodDate;
|
|
2254
2367
|
completed_at: z.ZodOptional<z.ZodDate>;
|
|
@@ -2266,6 +2379,34 @@ export declare const zTaskExecutionSchema: z.ZodObject<{
|
|
|
2266
2379
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
2267
2380
|
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2268
2381
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
2382
|
+
outcome: z.ZodOptional<z.ZodObject<{
|
|
2383
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
2384
|
+
reason: z.ZodString;
|
|
2385
|
+
label: z.ZodString;
|
|
2386
|
+
message: z.ZodString;
|
|
2387
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
2388
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
2389
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2390
|
+
at: z.ZodDate;
|
|
2391
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2392
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
2393
|
+
reason: z.ZodString;
|
|
2394
|
+
label: z.ZodString;
|
|
2395
|
+
message: z.ZodString;
|
|
2396
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
2397
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
2398
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2399
|
+
at: z.ZodDate;
|
|
2400
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2401
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
2402
|
+
reason: z.ZodString;
|
|
2403
|
+
label: z.ZodString;
|
|
2404
|
+
message: z.ZodString;
|
|
2405
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
2406
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
2407
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2408
|
+
at: z.ZodDate;
|
|
2409
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
2269
2410
|
provider: z.ZodOptional<z.ZodObject<{
|
|
2270
2411
|
name: z.ZodOptional<z.ZodString>;
|
|
2271
2412
|
message_id: z.ZodOptional<z.ZodString>;
|
|
@@ -2288,7 +2429,7 @@ export declare const zTaskExecutionSchema: z.ZodObject<{
|
|
|
2288
2429
|
taskId: z.ZodString;
|
|
2289
2430
|
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "appointment_confirmation", "appointment_post_consultation", "evo-integrations.sync-run", "lead_form_capture", "campaign.materialize", "campaign.dispatch_batch", "telemedicine_join_reminder", "appointment_invoice"]>;
|
|
2290
2431
|
kind: z.ZodString;
|
|
2291
|
-
status: z.ZodEnum<["success", "error", "retry"]>;
|
|
2432
|
+
status: z.ZodEnum<["success", "error", "retry", "suppressed"]>;
|
|
2292
2433
|
attempt: z.ZodNumber;
|
|
2293
2434
|
started_at: z.ZodDate;
|
|
2294
2435
|
completed_at: z.ZodOptional<z.ZodDate>;
|
|
@@ -2306,6 +2447,34 @@ export declare const zTaskExecutionSchema: z.ZodObject<{
|
|
|
2306
2447
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
2307
2448
|
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2308
2449
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
2450
|
+
outcome: z.ZodOptional<z.ZodObject<{
|
|
2451
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
2452
|
+
reason: z.ZodString;
|
|
2453
|
+
label: z.ZodString;
|
|
2454
|
+
message: z.ZodString;
|
|
2455
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
2456
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
2457
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2458
|
+
at: z.ZodDate;
|
|
2459
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2460
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
2461
|
+
reason: z.ZodString;
|
|
2462
|
+
label: z.ZodString;
|
|
2463
|
+
message: z.ZodString;
|
|
2464
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
2465
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
2466
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2467
|
+
at: z.ZodDate;
|
|
2468
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2469
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
2470
|
+
reason: z.ZodString;
|
|
2471
|
+
label: z.ZodString;
|
|
2472
|
+
message: z.ZodString;
|
|
2473
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
2474
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
2475
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2476
|
+
at: z.ZodDate;
|
|
2477
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
2309
2478
|
provider: z.ZodOptional<z.ZodObject<{
|
|
2310
2479
|
name: z.ZodOptional<z.ZodString>;
|
|
2311
2480
|
message_id: z.ZodOptional<z.ZodString>;
|
|
@@ -2328,7 +2497,7 @@ export declare const zTaskExecutionSchema: z.ZodObject<{
|
|
|
2328
2497
|
taskId: z.ZodString;
|
|
2329
2498
|
handler: z.ZodEnum<["notifications", "ai_agent", "invoices", "webhook", "custom", "lead_reactivation", "appointment_action", "appointment_reminder", "appointment_confirmation", "appointment_post_consultation", "evo-integrations.sync-run", "lead_form_capture", "campaign.materialize", "campaign.dispatch_batch", "telemedicine_join_reminder", "appointment_invoice"]>;
|
|
2330
2499
|
kind: z.ZodString;
|
|
2331
|
-
status: z.ZodEnum<["success", "error", "retry"]>;
|
|
2500
|
+
status: z.ZodEnum<["success", "error", "retry", "suppressed"]>;
|
|
2332
2501
|
attempt: z.ZodNumber;
|
|
2333
2502
|
started_at: z.ZodDate;
|
|
2334
2503
|
completed_at: z.ZodOptional<z.ZodDate>;
|
|
@@ -2346,6 +2515,34 @@ export declare const zTaskExecutionSchema: z.ZodObject<{
|
|
|
2346
2515
|
code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
2347
2516
|
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2348
2517
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
2518
|
+
outcome: z.ZodOptional<z.ZodObject<{
|
|
2519
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
2520
|
+
reason: z.ZodString;
|
|
2521
|
+
label: z.ZodString;
|
|
2522
|
+
message: z.ZodString;
|
|
2523
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
2524
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
2525
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2526
|
+
at: z.ZodDate;
|
|
2527
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
2528
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
2529
|
+
reason: z.ZodString;
|
|
2530
|
+
label: z.ZodString;
|
|
2531
|
+
message: z.ZodString;
|
|
2532
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
2533
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
2534
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2535
|
+
at: z.ZodDate;
|
|
2536
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
2537
|
+
class: z.ZodEnum<["legitimate", "defect"]>;
|
|
2538
|
+
reason: z.ZodString;
|
|
2539
|
+
label: z.ZodString;
|
|
2540
|
+
message: z.ZodString;
|
|
2541
|
+
action_hint: z.ZodOptional<z.ZodString>;
|
|
2542
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
2543
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2544
|
+
at: z.ZodDate;
|
|
2545
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
2349
2546
|
provider: z.ZodOptional<z.ZodObject<{
|
|
2350
2547
|
name: z.ZodOptional<z.ZodString>;
|
|
2351
2548
|
message_id: z.ZodOptional<z.ZodString>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zTaskLogSchema = exports.zTaskExecutionSchema = exports.zTaskExecutionProviderSchema = exports.zTaskExecutionErrorSchema = exports.zTaskCommentSchema = exports.zTaskCommentAuthorSchema = exports.zTaskSchema = exports.zTaskCreatorSchema = exports.zTaskOnFailureSchema = exports.zTaskAutoSpecSchema = exports.zTaskDedupSchema = exports.zTaskRetryPolicySchema = exports.zTaskRunnerStateSchema = exports.zTaskLockSchema = exports.zTaskUserAssigneeSchema = exports.zTaskScheduleSchema = exports.zTaskExternalLinkSchema = exports.zExternalLinkSchema = exports.zExternalLinkRelationSchema = exports.zLinkRelationRoleSchema = exports.zLinkRelationPairSchema = exports.zExternalLinkSourceSchema = exports.zExternalLinkStatusSchema = exports.zExternalLinkKindSchema = exports.zExternalOwnerSystemSchema = exports.zTaskExecutionStatusSchema = exports.zTaskExternalObjectTypeSchema = exports.zExternalObjectTypeSchema = exports.zTaskDedupWindowSchema = exports.zTaskDedupScopeSchema = exports.zTaskRetryStrategySchema = exports.zTaskAutoHandlerSchema = exports.zTaskModeSchema = exports.zTaskSourceSchema = exports.zTaskPrioritySchema = exports.zTaskStatusSchema = exports.zTaskActionSchema = void 0;
|
|
3
|
+
exports.zTaskLogSchema = exports.zTaskExecutionSchema = exports.zTaskExecutionProviderSchema = exports.zTaskExecutionErrorSchema = exports.zTaskCommentSchema = exports.zTaskCommentAuthorSchema = exports.zTaskSchema = exports.zTaskCreatorSchema = exports.zTaskOnFailureSchema = exports.zTaskAutoSpecSchema = exports.zTaskDedupSchema = exports.zTaskRetryPolicySchema = exports.zTaskRunnerStateSchema = exports.zTaskLockSchema = exports.zTaskUserAssigneeSchema = exports.zTaskScheduleSchema = exports.zTaskExternalLinkSchema = exports.zExternalLinkSchema = exports.zExternalLinkRelationSchema = exports.zLinkRelationRoleSchema = exports.zLinkRelationPairSchema = exports.zExternalLinkSourceSchema = exports.zExternalLinkStatusSchema = exports.zExternalLinkKindSchema = exports.zExternalOwnerSystemSchema = exports.zTaskOutcomeSchema = exports.zTaskOutcomeClassSchema = exports.zTaskExecutionStatusSchema = exports.zTaskExternalObjectTypeSchema = exports.zExternalObjectTypeSchema = exports.zTaskDedupWindowSchema = exports.zTaskDedupScopeSchema = exports.zTaskRetryStrategySchema = exports.zTaskAutoHandlerSchema = exports.zTaskModeSchema = exports.zTaskSourceSchema = exports.zTaskPrioritySchema = exports.zTaskStatusSchema = exports.zTaskActionSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const zod_schemas_1 = require("../shared/zod-schemas");
|
|
6
6
|
exports.zTaskActionSchema = zod_1.z.enum([
|
|
@@ -105,7 +105,25 @@ exports.zExternalObjectTypeSchema = zod_1.z.enum([
|
|
|
105
105
|
]);
|
|
106
106
|
// Backward compatibility alias
|
|
107
107
|
exports.zTaskExternalObjectTypeSchema = exports.zExternalObjectTypeSchema;
|
|
108
|
-
exports.zTaskExecutionStatusSchema = zod_1.z.enum([
|
|
108
|
+
exports.zTaskExecutionStatusSchema = zod_1.z.enum([
|
|
109
|
+
"success",
|
|
110
|
+
"error",
|
|
111
|
+
"retry",
|
|
112
|
+
"suppressed",
|
|
113
|
+
]);
|
|
114
|
+
exports.zTaskOutcomeClassSchema = zod_1.z.enum(["legitimate", "defect"]);
|
|
115
|
+
exports.zTaskOutcomeSchema = zod_1.z
|
|
116
|
+
.object({
|
|
117
|
+
class: exports.zTaskOutcomeClassSchema,
|
|
118
|
+
reason: zod_1.z.string(),
|
|
119
|
+
label: zod_1.z.string(),
|
|
120
|
+
message: zod_1.z.string(),
|
|
121
|
+
action_hint: zod_1.z.string().optional(),
|
|
122
|
+
scope: zod_1.z.string().optional(),
|
|
123
|
+
details: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
124
|
+
at: zod_1.z.coerce.date(),
|
|
125
|
+
})
|
|
126
|
+
.passthrough();
|
|
109
127
|
// Schema para IExternalLink (promoted to shared, renamed from Task-specific)
|
|
110
128
|
exports.zExternalOwnerSystemSchema = zod_1.z.enum(["nexus"]);
|
|
111
129
|
// feat-193 — contrato do vínculo lead/paciente (espelha os enums de
|
|
@@ -319,6 +337,7 @@ exports.zTaskSchema = zod_schemas_1.zFireDocSchema
|
|
|
319
337
|
on_failure: exports.zTaskOnFailureSchema.optional(), // for auto tasks
|
|
320
338
|
runner_state: exports.zTaskRunnerStateSchema.optional(), // for auto tasks (maintained by Task Runner)
|
|
321
339
|
auto: exports.zTaskAutoSpecSchema.optional(), // for auto tasks (required when mode=auto)
|
|
340
|
+
outcome: exports.zTaskOutcomeSchema.nullable().optional(), // for auto tasks (suppressed | failed by defect)
|
|
322
341
|
})
|
|
323
342
|
.passthrough();
|
|
324
343
|
// Schema para ITaskComment
|
|
@@ -360,6 +379,7 @@ exports.zTaskExecutionSchema = zod_schemas_1.zFireDocSchema
|
|
|
360
379
|
completed_at: zod_1.z.coerce.date().optional(),
|
|
361
380
|
result: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
362
381
|
error: exports.zTaskExecutionErrorSchema.optional(),
|
|
382
|
+
outcome: exports.zTaskOutcomeSchema.optional(),
|
|
363
383
|
provider: exports.zTaskExecutionProviderSchema.optional(),
|
|
364
384
|
})
|
|
365
385
|
.passthrough();
|
|
@@ -114,7 +114,27 @@ export const zExternalObjectTypeSchema = z.enum([
|
|
|
114
114
|
// Backward compatibility alias
|
|
115
115
|
export const zTaskExternalObjectTypeSchema = zExternalObjectTypeSchema;
|
|
116
116
|
|
|
117
|
-
export const zTaskExecutionStatusSchema = z.enum([
|
|
117
|
+
export const zTaskExecutionStatusSchema = z.enum([
|
|
118
|
+
"success",
|
|
119
|
+
"error",
|
|
120
|
+
"retry",
|
|
121
|
+
"suppressed",
|
|
122
|
+
]);
|
|
123
|
+
|
|
124
|
+
export const zTaskOutcomeClassSchema = z.enum(["legitimate", "defect"]);
|
|
125
|
+
|
|
126
|
+
export const zTaskOutcomeSchema = z
|
|
127
|
+
.object({
|
|
128
|
+
class: zTaskOutcomeClassSchema,
|
|
129
|
+
reason: z.string(),
|
|
130
|
+
label: z.string(),
|
|
131
|
+
message: z.string(),
|
|
132
|
+
action_hint: z.string().optional(),
|
|
133
|
+
scope: z.string().optional(),
|
|
134
|
+
details: z.record(z.unknown()).optional(),
|
|
135
|
+
at: z.coerce.date(),
|
|
136
|
+
})
|
|
137
|
+
.passthrough();
|
|
118
138
|
|
|
119
139
|
// Schema para IExternalLink (promoted to shared, renamed from Task-specific)
|
|
120
140
|
export const zExternalOwnerSystemSchema = z.enum(["nexus"]);
|
|
@@ -352,6 +372,7 @@ export const zTaskSchema = zFireDocSchema
|
|
|
352
372
|
on_failure: zTaskOnFailureSchema.optional(), // for auto tasks
|
|
353
373
|
runner_state: zTaskRunnerStateSchema.optional(), // for auto tasks (maintained by Task Runner)
|
|
354
374
|
auto: zTaskAutoSpecSchema.optional(), // for auto tasks (required when mode=auto)
|
|
375
|
+
outcome: zTaskOutcomeSchema.nullable().optional(), // for auto tasks (suppressed | failed by defect)
|
|
355
376
|
})
|
|
356
377
|
.passthrough();
|
|
357
378
|
|
|
@@ -398,6 +419,7 @@ export const zTaskExecutionSchema = zFireDocSchema
|
|
|
398
419
|
completed_at: z.coerce.date().optional(),
|
|
399
420
|
result: z.record(z.unknown()).optional(),
|
|
400
421
|
error: zTaskExecutionErrorSchema.optional(),
|
|
422
|
+
outcome: zTaskOutcomeSchema.optional(),
|
|
401
423
|
provider: zTaskExecutionProviderSchema.optional(),
|
|
402
424
|
})
|
|
403
425
|
.passthrough();
|
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export * from "./types/evo-csq";
|
|
|
36
36
|
export * from "./types/evo-mcp";
|
|
37
37
|
export * from "./types/evo-reports";
|
|
38
38
|
export * from "./types/evo-telemedicine";
|
|
39
|
+
export * from "./types/evo-modules";
|
|
39
40
|
export * from "./apps/shared/zod-schemas";
|
|
40
41
|
export * from "./apps/evo-core/zod-schemas";
|
|
41
42
|
export * from "./apps/evo-tenant/zod-schemas";
|
|
@@ -78,3 +79,4 @@ export * from "./apps/evo-task-runner/zod-schemas";
|
|
|
78
79
|
export * from "./apps/hub-automation/zod-schemas";
|
|
79
80
|
export * from "./apps/evo-integrations/zod-schemas";
|
|
80
81
|
export * from "./apps/evo-telemedicine/zod-schemas";
|
|
82
|
+
export * from "./apps/evo-modules/zod-schemas";
|
package/dist/index.js
CHANGED
|
@@ -53,6 +53,7 @@ __exportStar(require("./types/evo-csq"), exports);
|
|
|
53
53
|
__exportStar(require("./types/evo-mcp"), exports);
|
|
54
54
|
__exportStar(require("./types/evo-reports"), exports);
|
|
55
55
|
__exportStar(require("./types/evo-telemedicine"), exports);
|
|
56
|
+
__exportStar(require("./types/evo-modules"), exports);
|
|
56
57
|
// zod schemas
|
|
57
58
|
__exportStar(require("./apps/shared/zod-schemas"), exports);
|
|
58
59
|
__exportStar(require("./apps/evo-core/zod-schemas"), exports);
|
|
@@ -96,3 +97,4 @@ __exportStar(require("./apps/evo-task-runner/zod-schemas"), exports);
|
|
|
96
97
|
__exportStar(require("./apps/hub-automation/zod-schemas"), exports);
|
|
97
98
|
__exportStar(require("./apps/evo-integrations/zod-schemas"), exports);
|
|
98
99
|
__exportStar(require("./apps/evo-telemedicine/zod-schemas"), exports);
|
|
100
|
+
__exportStar(require("./apps/evo-modules/zod-schemas"), exports);
|
package/dist/index.ts
CHANGED
|
@@ -37,6 +37,7 @@ export * from "./types/evo-csq";
|
|
|
37
37
|
export * from "./types/evo-mcp";
|
|
38
38
|
export * from "./types/evo-reports";
|
|
39
39
|
export * from "./types/evo-telemedicine";
|
|
40
|
+
export * from "./types/evo-modules";
|
|
40
41
|
|
|
41
42
|
// zod schemas
|
|
42
43
|
export * from "./apps/shared/zod-schemas";
|
|
@@ -81,3 +82,4 @@ export * from "./apps/evo-task-runner/zod-schemas";
|
|
|
81
82
|
export * from "./apps/hub-automation/zod-schemas";
|
|
82
83
|
export * from "./apps/evo-integrations/zod-schemas";
|
|
83
84
|
export * from "./apps/evo-telemedicine/zod-schemas";
|
|
85
|
+
export * from "./apps/evo-modules/zod-schemas";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ITenantModuleEntitlement } from "../evo-tenant";
|
|
2
|
+
/**
|
|
3
|
+
* Normaliza qualquer forma de data que chega às superfícies: `Date`, Firestore
|
|
4
|
+
* `Timestamp` (`toDate()`), Timestamp serializado (`{_seconds}` / `{seconds}`),
|
|
5
|
+
* ISO string e epoch em ms. Inválido ⇒ `null` (equivale a "sem data").
|
|
6
|
+
*/
|
|
7
|
+
export declare function moduleDateToMillis(value: unknown): number | null;
|
|
8
|
+
/**
|
|
9
|
+
* Decide se o entitlement autoriza um uso NOVO do módulo. Função pura e ÚNICA:
|
|
10
|
+
* backend (`Core.Tenant.isModuleActive`), web-app e Nexus usam esta; o Flutter
|
|
11
|
+
* espelha e prova pela fixture `fixtures/tenant-modules/is-module-active.parity.json`.
|
|
12
|
+
*
|
|
13
|
+
* Ordem das cláusulas (importa):
|
|
14
|
+
* 1. `override_until` futuro COM `override_by` libera (D6: exceção operacional
|
|
15
|
+
* temporária e auditada) — mesmo suspenso/cancelado/vencido;
|
|
16
|
+
* 2. `enabled !== true` bloqueia;
|
|
17
|
+
* 3. `suspended`/`cancelled` bloqueiam;
|
|
18
|
+
* 4. `effective_at` no futuro bloqueia;
|
|
19
|
+
* 5. `expires_at` no passado (ou agora) bloqueia, para QUALQUER status;
|
|
20
|
+
* 6. só `active` e `trial` liberam.
|
|
21
|
+
*
|
|
22
|
+
* Não tem parâmetro de papel: super admin não ignora entitlement (D6).
|
|
23
|
+
*/
|
|
24
|
+
export declare function isModuleActive(entitlement: ITenantModuleEntitlement | null | undefined, now?: Date): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Capability ausente, não-booleana (`"true"`, `1`) ou `false` equivale a `false`.
|
|
27
|
+
* Não implica módulo ativo: o gate de UI equivalente ao backend é
|
|
28
|
+
* `isModuleActive(e) && hasModuleCapability(e, cap)`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function hasModuleCapability(entitlement: ITenantModuleEntitlement | null | undefined, capability: string): boolean;
|
|
31
|
+
export interface IModuleContractMismatch {
|
|
32
|
+
module: string;
|
|
33
|
+
metric: string;
|
|
34
|
+
kind: "active_without_allowance" | "allowance_without_module";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Divergências entre franquias do contrato (`allowances`) e módulos do tenant,
|
|
38
|
+
* pelas `allowance_metrics` do catálogo. Só informa (a tela de contrato mostra);
|
|
39
|
+
* nada sincroniza sozinho (Q1).
|
|
40
|
+
*
|
|
41
|
+
* - `active_without_allowance`: módulo ativo e nenhuma métrica dele no contrato
|
|
42
|
+
* (consumo invisível ao alerta e ao portal);
|
|
43
|
+
* - `allowance_without_module`: contrato tem franquia de uma métrica do módulo e
|
|
44
|
+
* o módulo não está ativo.
|
|
45
|
+
*/
|
|
46
|
+
export declare function moduleContractMismatches(allowances: Record<string, unknown> | null | undefined, modules: Record<string, ITenantModuleEntitlement> | null | undefined, now?: Date): IModuleContractMismatch[];
|