evo360-types 1.3.780 → 1.3.782
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-chat/waba-template/zod-schemas.d.ts +70 -0
- package/dist/apps/evo-chat/waba-template/zod-schemas.js +6 -2
- package/dist/apps/evo-chat/waba-template/zod-schemas.ts +6 -1
- package/dist/apps/evo-hub-ia/v1/zod-schemas.d.ts +4 -4
- package/dist/types/shared/template-profile.d.ts +23 -1
- package/dist/types/shared/template-profile.js +11 -0
- package/dist/types/shared/template-profile.ts +26 -1
- package/package.json +1 -1
|
@@ -1565,6 +1565,70 @@ export declare const zWabaTemplateCreateRequestSchema: z.ZodObject<{
|
|
|
1565
1565
|
* feat-327 — doc de `channels/{ch}/template_profiles/{name}__{language}`
|
|
1566
1566
|
* (leitura). A edição valida só os campos: `zTemplateProfileFieldsSchema`.
|
|
1567
1567
|
*/
|
|
1568
|
+
/** Corpo do PUT de perfil do HSM: os quatro campos + `enabled` (F1.1, D8). */
|
|
1569
|
+
export declare const zWabaTemplateProfileFieldsSchema: z.ZodObject<{
|
|
1570
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1571
|
+
mcp_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1572
|
+
mcp_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1573
|
+
tags: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
1574
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1575
|
+
category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1576
|
+
base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1577
|
+
} & {
|
|
1578
|
+
name: z.ZodString;
|
|
1579
|
+
hidden: z.ZodDefault<z.ZodBoolean>;
|
|
1580
|
+
}, "strip", z.ZodTypeAny, {
|
|
1581
|
+
name: string;
|
|
1582
|
+
hidden: boolean;
|
|
1583
|
+
base?: boolean | undefined;
|
|
1584
|
+
color?: string | undefined;
|
|
1585
|
+
category?: string | null | undefined;
|
|
1586
|
+
}, {
|
|
1587
|
+
name: string;
|
|
1588
|
+
base?: boolean | undefined;
|
|
1589
|
+
color?: string | undefined;
|
|
1590
|
+
category?: string | null | undefined;
|
|
1591
|
+
hidden?: boolean | undefined;
|
|
1592
|
+
}>, "many">, {
|
|
1593
|
+
name: string;
|
|
1594
|
+
hidden: boolean;
|
|
1595
|
+
base?: boolean | undefined;
|
|
1596
|
+
color?: string | undefined;
|
|
1597
|
+
category?: string | null | undefined;
|
|
1598
|
+
}[], {
|
|
1599
|
+
name: string;
|
|
1600
|
+
base?: boolean | undefined;
|
|
1601
|
+
color?: string | undefined;
|
|
1602
|
+
category?: string | null | undefined;
|
|
1603
|
+
hidden?: boolean | undefined;
|
|
1604
|
+
}[]>>>;
|
|
1605
|
+
} & {
|
|
1606
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1607
|
+
}, "strip", z.ZodTypeAny, {
|
|
1608
|
+
mcp_description?: string | null | undefined;
|
|
1609
|
+
mcp_enabled?: boolean | undefined;
|
|
1610
|
+
enabled?: boolean | undefined;
|
|
1611
|
+
description?: string | null | undefined;
|
|
1612
|
+
tags?: {
|
|
1613
|
+
name: string;
|
|
1614
|
+
hidden: boolean;
|
|
1615
|
+
base?: boolean | undefined;
|
|
1616
|
+
color?: string | undefined;
|
|
1617
|
+
category?: string | null | undefined;
|
|
1618
|
+
}[] | null | undefined;
|
|
1619
|
+
}, {
|
|
1620
|
+
mcp_description?: string | null | undefined;
|
|
1621
|
+
mcp_enabled?: boolean | undefined;
|
|
1622
|
+
enabled?: boolean | undefined;
|
|
1623
|
+
description?: string | null | undefined;
|
|
1624
|
+
tags?: {
|
|
1625
|
+
name: string;
|
|
1626
|
+
base?: boolean | undefined;
|
|
1627
|
+
color?: string | undefined;
|
|
1628
|
+
category?: string | null | undefined;
|
|
1629
|
+
hidden?: boolean | undefined;
|
|
1630
|
+
}[] | null | undefined;
|
|
1631
|
+
}>;
|
|
1568
1632
|
export declare const zWabaTemplateProfileSchema: z.ZodObject<{
|
|
1569
1633
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1570
1634
|
mcp_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -1601,6 +1665,8 @@ export declare const zWabaTemplateProfileSchema: z.ZodObject<{
|
|
|
1601
1665
|
category?: string | null | undefined;
|
|
1602
1666
|
hidden?: boolean | undefined;
|
|
1603
1667
|
}[]>>>;
|
|
1668
|
+
} & {
|
|
1669
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1604
1670
|
} & {
|
|
1605
1671
|
id: z.ZodString;
|
|
1606
1672
|
name: z.ZodString;
|
|
@@ -1653,6 +1719,8 @@ export declare const zWabaTemplateProfileSchema: z.ZodObject<{
|
|
|
1653
1719
|
category?: string | null | undefined;
|
|
1654
1720
|
hidden?: boolean | undefined;
|
|
1655
1721
|
}[]>>>;
|
|
1722
|
+
} & {
|
|
1723
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1656
1724
|
} & {
|
|
1657
1725
|
id: z.ZodString;
|
|
1658
1726
|
name: z.ZodString;
|
|
@@ -1705,6 +1773,8 @@ export declare const zWabaTemplateProfileSchema: z.ZodObject<{
|
|
|
1705
1773
|
category?: string | null | undefined;
|
|
1706
1774
|
hidden?: boolean | undefined;
|
|
1707
1775
|
}[]>>>;
|
|
1776
|
+
} & {
|
|
1777
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1708
1778
|
} & {
|
|
1709
1779
|
id: z.ZodString;
|
|
1710
1780
|
name: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zWabaTemplateProfileSchema = exports.zWabaTemplateCreateRequestSchema = exports.zWabaTemplateSchema = exports.zWabaTemplateDraftSourceSchema = exports.zWabaTemplateComponentSchema = exports.zWabaTemplateButtonSchema = void 0;
|
|
3
|
+
exports.zWabaTemplateProfileSchema = exports.zWabaTemplateProfileFieldsSchema = exports.zWabaTemplateCreateRequestSchema = exports.zWabaTemplateSchema = exports.zWabaTemplateDraftSourceSchema = exports.zWabaTemplateComponentSchema = exports.zWabaTemplateButtonSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const zod_schemas_1 = require("../../shared/zod-schemas");
|
|
6
6
|
exports.zWabaTemplateButtonSchema = zod_1.z.object({
|
|
@@ -59,7 +59,11 @@ exports.zWabaTemplateCreateRequestSchema = zod_1.z.object({
|
|
|
59
59
|
* feat-327 — doc de `channels/{ch}/template_profiles/{name}__{language}`
|
|
60
60
|
* (leitura). A edição valida só os campos: `zTemplateProfileFieldsSchema`.
|
|
61
61
|
*/
|
|
62
|
-
|
|
62
|
+
/** Corpo do PUT de perfil do HSM: os quatro campos + `enabled` (F1.1, D8). */
|
|
63
|
+
exports.zWabaTemplateProfileFieldsSchema = zod_schemas_1.zTemplateProfileFieldsSchema.extend({
|
|
64
|
+
enabled: zod_1.z.boolean().optional(),
|
|
65
|
+
});
|
|
66
|
+
exports.zWabaTemplateProfileSchema = exports.zWabaTemplateProfileFieldsSchema
|
|
63
67
|
.extend({
|
|
64
68
|
id: zod_1.z.string(),
|
|
65
69
|
name: zod_1.z.string(),
|
|
@@ -62,7 +62,12 @@ export const zWabaTemplateCreateRequestSchema = z.object({
|
|
|
62
62
|
* feat-327 — doc de `channels/{ch}/template_profiles/{name}__{language}`
|
|
63
63
|
* (leitura). A edição valida só os campos: `zTemplateProfileFieldsSchema`.
|
|
64
64
|
*/
|
|
65
|
-
|
|
65
|
+
/** Corpo do PUT de perfil do HSM: os quatro campos + `enabled` (F1.1, D8). */
|
|
66
|
+
export const zWabaTemplateProfileFieldsSchema = zTemplateProfileFieldsSchema.extend({
|
|
67
|
+
enabled: z.boolean().optional(),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export const zWabaTemplateProfileSchema = zWabaTemplateProfileFieldsSchema
|
|
66
71
|
.extend({
|
|
67
72
|
id: z.string(),
|
|
68
73
|
name: z.string(),
|
|
@@ -1756,6 +1756,7 @@ export declare const zHubiaVoiceReplySchema: z.ZodObject<{
|
|
|
1756
1756
|
instructions?: string | undefined;
|
|
1757
1757
|
speed?: number | undefined;
|
|
1758
1758
|
}, {
|
|
1759
|
+
enabled?: boolean | undefined;
|
|
1759
1760
|
provider?: "openai" | "elevenlabs" | undefined;
|
|
1760
1761
|
elevenlabs?: {
|
|
1761
1762
|
stability?: number | undefined;
|
|
@@ -1766,7 +1767,6 @@ export declare const zHubiaVoiceReplySchema: z.ZodObject<{
|
|
|
1766
1767
|
voice?: string | undefined;
|
|
1767
1768
|
instructions?: string | undefined;
|
|
1768
1769
|
speed?: number | undefined;
|
|
1769
|
-
enabled?: boolean | undefined;
|
|
1770
1770
|
}>;
|
|
1771
1771
|
export type IHubiaVoiceReply = z.infer<typeof zHubiaVoiceReplySchema>;
|
|
1772
1772
|
export declare const zHubiaResponseModeSchema: z.ZodEnum<["text", "audio"]>;
|
|
@@ -2680,6 +2680,7 @@ export declare const zAiBindingSchema: z.ZodObject<{
|
|
|
2680
2680
|
instructions?: string | undefined;
|
|
2681
2681
|
speed?: number | undefined;
|
|
2682
2682
|
}, {
|
|
2683
|
+
enabled?: boolean | undefined;
|
|
2683
2684
|
provider?: "openai" | "elevenlabs" | undefined;
|
|
2684
2685
|
elevenlabs?: {
|
|
2685
2686
|
stability?: number | undefined;
|
|
@@ -2690,7 +2691,6 @@ export declare const zAiBindingSchema: z.ZodObject<{
|
|
|
2690
2691
|
voice?: string | undefined;
|
|
2691
2692
|
instructions?: string | undefined;
|
|
2692
2693
|
speed?: number | undefined;
|
|
2693
|
-
enabled?: boolean | undefined;
|
|
2694
2694
|
}>>;
|
|
2695
2695
|
/** feat-309: análise de fotos e PDFs recebidos neste departamento. Ausente = ligado.
|
|
2696
2696
|
* Só roda com `default_mode` `ai_only` ou `hybrid_assist` (em `human_only`/`blocked`
|
|
@@ -3503,6 +3503,7 @@ export declare const zAiBindingSchema: z.ZodObject<{
|
|
|
3503
3503
|
instructions?: string | undefined;
|
|
3504
3504
|
speed?: number | undefined;
|
|
3505
3505
|
}, {
|
|
3506
|
+
enabled?: boolean | undefined;
|
|
3506
3507
|
provider?: "openai" | "elevenlabs" | undefined;
|
|
3507
3508
|
elevenlabs?: {
|
|
3508
3509
|
stability?: number | undefined;
|
|
@@ -3513,7 +3514,6 @@ export declare const zAiBindingSchema: z.ZodObject<{
|
|
|
3513
3514
|
voice?: string | undefined;
|
|
3514
3515
|
instructions?: string | undefined;
|
|
3515
3516
|
speed?: number | undefined;
|
|
3516
|
-
enabled?: boolean | undefined;
|
|
3517
3517
|
}>>;
|
|
3518
3518
|
/** feat-309: análise de fotos e PDFs recebidos neste departamento. Ausente = ligado.
|
|
3519
3519
|
* Só roda com `default_mode` `ai_only` ou `hybrid_assist` (em `human_only`/`blocked`
|
|
@@ -4326,6 +4326,7 @@ export declare const zAiBindingSchema: z.ZodObject<{
|
|
|
4326
4326
|
instructions?: string | undefined;
|
|
4327
4327
|
speed?: number | undefined;
|
|
4328
4328
|
}, {
|
|
4329
|
+
enabled?: boolean | undefined;
|
|
4329
4330
|
provider?: "openai" | "elevenlabs" | undefined;
|
|
4330
4331
|
elevenlabs?: {
|
|
4331
4332
|
stability?: number | undefined;
|
|
@@ -4336,7 +4337,6 @@ export declare const zAiBindingSchema: z.ZodObject<{
|
|
|
4336
4337
|
voice?: string | undefined;
|
|
4337
4338
|
instructions?: string | undefined;
|
|
4338
4339
|
speed?: number | undefined;
|
|
4339
|
-
enabled?: boolean | undefined;
|
|
4340
4340
|
}>>;
|
|
4341
4341
|
/** feat-309: análise de fotos e PDFs recebidos neste departamento. Ausente = ligado.
|
|
4342
4342
|
* Só roda com `default_mode` `ai_only` ou `hybrid_assist` (em `human_only`/`blocked`
|
|
@@ -32,10 +32,32 @@ export type ITemplateProfile = ITemplateProfileFields & ITemplateProfileAudit;
|
|
|
32
32
|
* `tenants/{t}/apps/evo-chat/channels/{ch}/template_profiles/{name}__{language}`
|
|
33
33
|
*/
|
|
34
34
|
export declare const TEMPLATE_PROFILES_COLLECTION = "template_profiles";
|
|
35
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Campos editáveis do perfil do HSM: os quatro comuns + `enabled` (F1.1, D8).
|
|
37
|
+
* Mesma nomenclatura do "Habilitado" do template de e-mail. Desativação LÓGICA,
|
|
38
|
+
* só nossa: `enabled === false` tira o template dos seletores (web-app, Nexus,
|
|
39
|
+
* app Professional); na Meta nada muda e quem já o tem configurado continua
|
|
40
|
+
* enviando (D9). Ausente = habilitado.
|
|
41
|
+
*/
|
|
42
|
+
export interface IWabaTemplateProfileFields extends ITemplateProfileFields {
|
|
43
|
+
enabled?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface IWabaTemplateProfile extends ITemplateProfile, IWabaTemplateProfileFields {
|
|
36
46
|
/** `{name}__{language}` — igual ao doc id. */
|
|
37
47
|
id: string;
|
|
38
48
|
name: string;
|
|
39
49
|
language: string;
|
|
40
50
|
created_at?: Date | null;
|
|
41
51
|
}
|
|
52
|
+
/** HSM aparece nos seletores? Sem perfil ou sem `enabled` = sim (D8). */
|
|
53
|
+
export declare function isWabaTemplateProfileEnabled(profile?: {
|
|
54
|
+
enabled?: boolean;
|
|
55
|
+
} | null): boolean;
|
|
56
|
+
/** Ordem dos seletores (D10): nome, depois idioma — sem diferenciar maiúsculas/acentos. */
|
|
57
|
+
export declare function compareTemplatesByName(a: {
|
|
58
|
+
name?: string | null;
|
|
59
|
+
language?: string | null;
|
|
60
|
+
}, b: {
|
|
61
|
+
name?: string | null;
|
|
62
|
+
language?: string | null;
|
|
63
|
+
}): number;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TEMPLATE_PROFILES_COLLECTION = exports.TEMPLATE_PROFILE_TAGS_MAX = exports.TEMPLATE_PROFILE_MCP_DESCRIPTION_MAX = exports.TEMPLATE_PROFILE_DESCRIPTION_MAX = void 0;
|
|
4
|
+
exports.isWabaTemplateProfileEnabled = isWabaTemplateProfileEnabled;
|
|
5
|
+
exports.compareTemplatesByName = compareTemplatesByName;
|
|
4
6
|
// ----- Perfil de template (descrição, orientação para IA, tags) — feat-327
|
|
5
7
|
//
|
|
6
8
|
// Os mesmos quatro campos valem para templates HSM (WABA) e de e-mail (D4):
|
|
@@ -23,3 +25,12 @@ exports.TEMPLATE_PROFILE_TAGS_MAX = 20;
|
|
|
23
25
|
* `tenants/{t}/apps/evo-chat/channels/{ch}/template_profiles/{name}__{language}`
|
|
24
26
|
*/
|
|
25
27
|
exports.TEMPLATE_PROFILES_COLLECTION = "template_profiles";
|
|
28
|
+
/** HSM aparece nos seletores? Sem perfil ou sem `enabled` = sim (D8). */
|
|
29
|
+
function isWabaTemplateProfileEnabled(profile) {
|
|
30
|
+
return profile?.enabled !== false;
|
|
31
|
+
}
|
|
32
|
+
/** Ordem dos seletores (D10): nome, depois idioma — sem diferenciar maiúsculas/acentos. */
|
|
33
|
+
function compareTemplatesByName(a, b) {
|
|
34
|
+
const byName = (a.name ?? "").localeCompare(b.name ?? "", "pt-BR", { sensitivity: "base" });
|
|
35
|
+
return byName !== 0 ? byName : (a.language ?? "").localeCompare(b.language ?? "", "pt-BR", { sensitivity: "base" });
|
|
36
|
+
}
|
|
@@ -48,10 +48,35 @@ export type ITemplateProfile = ITemplateProfileFields & ITemplateProfileAudit;
|
|
|
48
48
|
*/
|
|
49
49
|
export const TEMPLATE_PROFILES_COLLECTION = "template_profiles";
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Campos editáveis do perfil do HSM: os quatro comuns + `enabled` (F1.1, D8).
|
|
53
|
+
* Mesma nomenclatura do "Habilitado" do template de e-mail. Desativação LÓGICA,
|
|
54
|
+
* só nossa: `enabled === false` tira o template dos seletores (web-app, Nexus,
|
|
55
|
+
* app Professional); na Meta nada muda e quem já o tem configurado continua
|
|
56
|
+
* enviando (D9). Ausente = habilitado.
|
|
57
|
+
*/
|
|
58
|
+
export interface IWabaTemplateProfileFields extends ITemplateProfileFields {
|
|
59
|
+
enabled?: boolean;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface IWabaTemplateProfile extends ITemplateProfile, IWabaTemplateProfileFields {
|
|
52
63
|
/** `{name}__{language}` — igual ao doc id. */
|
|
53
64
|
id: string;
|
|
54
65
|
name: string;
|
|
55
66
|
language: string;
|
|
56
67
|
created_at?: Date | null;
|
|
57
68
|
}
|
|
69
|
+
|
|
70
|
+
/** HSM aparece nos seletores? Sem perfil ou sem `enabled` = sim (D8). */
|
|
71
|
+
export function isWabaTemplateProfileEnabled(profile?: { enabled?: boolean } | null): boolean {
|
|
72
|
+
return profile?.enabled !== false;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Ordem dos seletores (D10): nome, depois idioma — sem diferenciar maiúsculas/acentos. */
|
|
76
|
+
export function compareTemplatesByName(
|
|
77
|
+
a: { name?: string | null; language?: string | null },
|
|
78
|
+
b: { name?: string | null; language?: string | null },
|
|
79
|
+
): number {
|
|
80
|
+
const byName = (a.name ?? "").localeCompare(b.name ?? "", "pt-BR", { sensitivity: "base" });
|
|
81
|
+
return byName !== 0 ? byName : (a.language ?? "").localeCompare(b.language ?? "", "pt-BR", { sensitivity: "base" });
|
|
82
|
+
}
|