evo360-types 1.3.778 → 1.3.780
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 +161 -0
- package/dist/apps/evo-chat/waba-template/zod-schemas.js +18 -1
- package/dist/apps/evo-chat/waba-template/zod-schemas.ts +19 -1
- package/dist/apps/evo-tenant/zod-schemas.d.ts +2 -2
- package/dist/apps/shared/zod-schemas.d.ts +88 -0
- package/dist/apps/shared/zod-schemas.js +36 -1
- package/dist/apps/shared/zod-schemas.ts +42 -0
- package/dist/types/evo-notifications/index.d.ts +6 -2
- package/dist/types/evo-notifications/index.ts +6 -2
- package/dist/types/shared/index.d.ts +1 -0
- package/dist/types/shared/index.js +1 -0
- package/dist/types/shared/index.ts +1 -0
- package/dist/types/shared/template-profile.d.ts +41 -0
- package/dist/types/shared/template-profile.js +25 -0
- package/dist/types/shared/template-profile.ts +57 -0
- package/package.json +1 -1
|
@@ -1561,3 +1561,164 @@ export declare const zWabaTemplateCreateRequestSchema: z.ZodObject<{
|
|
|
1561
1561
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
1562
1562
|
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
1563
1563
|
}, z.ZodTypeAny, "passthrough">>;
|
|
1564
|
+
/**
|
|
1565
|
+
* feat-327 — doc de `channels/{ch}/template_profiles/{name}__{language}`
|
|
1566
|
+
* (leitura). A edição valida só os campos: `zTemplateProfileFieldsSchema`.
|
|
1567
|
+
*/
|
|
1568
|
+
export declare const zWabaTemplateProfileSchema: z.ZodObject<{
|
|
1569
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1570
|
+
mcp_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1571
|
+
mcp_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1572
|
+
tags: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
1573
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1574
|
+
category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1575
|
+
base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1576
|
+
} & {
|
|
1577
|
+
name: z.ZodString;
|
|
1578
|
+
hidden: z.ZodDefault<z.ZodBoolean>;
|
|
1579
|
+
}, "strip", z.ZodTypeAny, {
|
|
1580
|
+
name: string;
|
|
1581
|
+
hidden: boolean;
|
|
1582
|
+
base?: boolean | undefined;
|
|
1583
|
+
color?: string | undefined;
|
|
1584
|
+
category?: string | null | undefined;
|
|
1585
|
+
}, {
|
|
1586
|
+
name: string;
|
|
1587
|
+
base?: boolean | undefined;
|
|
1588
|
+
color?: string | undefined;
|
|
1589
|
+
category?: string | null | undefined;
|
|
1590
|
+
hidden?: boolean | undefined;
|
|
1591
|
+
}>, "many">, {
|
|
1592
|
+
name: string;
|
|
1593
|
+
hidden: boolean;
|
|
1594
|
+
base?: boolean | undefined;
|
|
1595
|
+
color?: string | undefined;
|
|
1596
|
+
category?: string | null | undefined;
|
|
1597
|
+
}[], {
|
|
1598
|
+
name: string;
|
|
1599
|
+
base?: boolean | undefined;
|
|
1600
|
+
color?: string | undefined;
|
|
1601
|
+
category?: string | null | undefined;
|
|
1602
|
+
hidden?: boolean | undefined;
|
|
1603
|
+
}[]>>>;
|
|
1604
|
+
} & {
|
|
1605
|
+
id: z.ZodString;
|
|
1606
|
+
name: z.ZodString;
|
|
1607
|
+
language: z.ZodString;
|
|
1608
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1609
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1610
|
+
updated_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1611
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
1612
|
+
display_name: z.ZodOptional<z.ZodString>;
|
|
1613
|
+
}, "strip", z.ZodTypeAny, {
|
|
1614
|
+
display_name?: string | undefined;
|
|
1615
|
+
user_id?: string | undefined;
|
|
1616
|
+
}, {
|
|
1617
|
+
display_name?: string | undefined;
|
|
1618
|
+
user_id?: string | undefined;
|
|
1619
|
+
}>>>;
|
|
1620
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1621
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1622
|
+
mcp_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1623
|
+
mcp_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1624
|
+
tags: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
1625
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1626
|
+
category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1627
|
+
base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1628
|
+
} & {
|
|
1629
|
+
name: z.ZodString;
|
|
1630
|
+
hidden: z.ZodDefault<z.ZodBoolean>;
|
|
1631
|
+
}, "strip", z.ZodTypeAny, {
|
|
1632
|
+
name: string;
|
|
1633
|
+
hidden: boolean;
|
|
1634
|
+
base?: boolean | undefined;
|
|
1635
|
+
color?: string | undefined;
|
|
1636
|
+
category?: string | null | undefined;
|
|
1637
|
+
}, {
|
|
1638
|
+
name: string;
|
|
1639
|
+
base?: boolean | undefined;
|
|
1640
|
+
color?: string | undefined;
|
|
1641
|
+
category?: string | null | undefined;
|
|
1642
|
+
hidden?: boolean | undefined;
|
|
1643
|
+
}>, "many">, {
|
|
1644
|
+
name: string;
|
|
1645
|
+
hidden: boolean;
|
|
1646
|
+
base?: boolean | undefined;
|
|
1647
|
+
color?: string | undefined;
|
|
1648
|
+
category?: string | null | undefined;
|
|
1649
|
+
}[], {
|
|
1650
|
+
name: string;
|
|
1651
|
+
base?: boolean | undefined;
|
|
1652
|
+
color?: string | undefined;
|
|
1653
|
+
category?: string | null | undefined;
|
|
1654
|
+
hidden?: boolean | undefined;
|
|
1655
|
+
}[]>>>;
|
|
1656
|
+
} & {
|
|
1657
|
+
id: z.ZodString;
|
|
1658
|
+
name: z.ZodString;
|
|
1659
|
+
language: z.ZodString;
|
|
1660
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1661
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1662
|
+
updated_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1663
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
1664
|
+
display_name: z.ZodOptional<z.ZodString>;
|
|
1665
|
+
}, "strip", z.ZodTypeAny, {
|
|
1666
|
+
display_name?: string | undefined;
|
|
1667
|
+
user_id?: string | undefined;
|
|
1668
|
+
}, {
|
|
1669
|
+
display_name?: string | undefined;
|
|
1670
|
+
user_id?: string | undefined;
|
|
1671
|
+
}>>>;
|
|
1672
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1673
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1674
|
+
mcp_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1675
|
+
mcp_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
1676
|
+
tags: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
1677
|
+
color: z.ZodOptional<z.ZodString>;
|
|
1678
|
+
category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1679
|
+
base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1680
|
+
} & {
|
|
1681
|
+
name: z.ZodString;
|
|
1682
|
+
hidden: z.ZodDefault<z.ZodBoolean>;
|
|
1683
|
+
}, "strip", z.ZodTypeAny, {
|
|
1684
|
+
name: string;
|
|
1685
|
+
hidden: boolean;
|
|
1686
|
+
base?: boolean | undefined;
|
|
1687
|
+
color?: string | undefined;
|
|
1688
|
+
category?: string | null | undefined;
|
|
1689
|
+
}, {
|
|
1690
|
+
name: string;
|
|
1691
|
+
base?: boolean | undefined;
|
|
1692
|
+
color?: string | undefined;
|
|
1693
|
+
category?: string | null | undefined;
|
|
1694
|
+
hidden?: boolean | undefined;
|
|
1695
|
+
}>, "many">, {
|
|
1696
|
+
name: string;
|
|
1697
|
+
hidden: boolean;
|
|
1698
|
+
base?: boolean | undefined;
|
|
1699
|
+
color?: string | undefined;
|
|
1700
|
+
category?: string | null | undefined;
|
|
1701
|
+
}[], {
|
|
1702
|
+
name: string;
|
|
1703
|
+
base?: boolean | undefined;
|
|
1704
|
+
color?: string | undefined;
|
|
1705
|
+
category?: string | null | undefined;
|
|
1706
|
+
hidden?: boolean | undefined;
|
|
1707
|
+
}[]>>>;
|
|
1708
|
+
} & {
|
|
1709
|
+
id: z.ZodString;
|
|
1710
|
+
name: z.ZodString;
|
|
1711
|
+
language: z.ZodString;
|
|
1712
|
+
created_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1713
|
+
updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
1714
|
+
updated_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
1715
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
1716
|
+
display_name: z.ZodOptional<z.ZodString>;
|
|
1717
|
+
}, "strip", z.ZodTypeAny, {
|
|
1718
|
+
display_name?: string | undefined;
|
|
1719
|
+
user_id?: string | undefined;
|
|
1720
|
+
}, {
|
|
1721
|
+
display_name?: string | undefined;
|
|
1722
|
+
user_id?: string | undefined;
|
|
1723
|
+
}>>>;
|
|
1724
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zWabaTemplateCreateRequestSchema = exports.zWabaTemplateSchema = exports.zWabaTemplateDraftSourceSchema = exports.zWabaTemplateComponentSchema = exports.zWabaTemplateButtonSchema = void 0;
|
|
3
|
+
exports.zWabaTemplateProfileSchema = 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({
|
|
@@ -55,3 +55,20 @@ exports.zWabaTemplateCreateRequestSchema = zod_1.z.object({
|
|
|
55
55
|
parameter_format: zod_1.z.enum(['NAMED', 'POSITIONAL']).optional(),
|
|
56
56
|
components: zod_1.z.array(exports.zWabaTemplateComponentSchema).min(1),
|
|
57
57
|
}).passthrough();
|
|
58
|
+
/**
|
|
59
|
+
* feat-327 — doc de `channels/{ch}/template_profiles/{name}__{language}`
|
|
60
|
+
* (leitura). A edição valida só os campos: `zTemplateProfileFieldsSchema`.
|
|
61
|
+
*/
|
|
62
|
+
exports.zWabaTemplateProfileSchema = zod_schemas_1.zTemplateProfileFieldsSchema
|
|
63
|
+
.extend({
|
|
64
|
+
id: zod_1.z.string(),
|
|
65
|
+
name: zod_1.z.string(),
|
|
66
|
+
language: zod_1.z.string(),
|
|
67
|
+
created_at: zod_1.z.coerce.date().nullable().optional(),
|
|
68
|
+
updated_at: zod_1.z.coerce.date().nullable().optional(),
|
|
69
|
+
updated_by: zod_1.z
|
|
70
|
+
.object({ user_id: zod_1.z.string().optional(), display_name: zod_1.z.string().optional() })
|
|
71
|
+
.nullable()
|
|
72
|
+
.optional(),
|
|
73
|
+
})
|
|
74
|
+
.passthrough();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { zFireDocSchema } from '../../shared/zod-schemas';
|
|
2
|
+
import { zFireDocSchema, zTemplateProfileFieldsSchema } from '../../shared/zod-schemas';
|
|
3
3
|
|
|
4
4
|
export const zWabaTemplateButtonSchema = z.object({
|
|
5
5
|
type: z.enum(['QUICK_REPLY', 'URL', 'PHONE_NUMBER']),
|
|
@@ -57,3 +57,21 @@ export const zWabaTemplateCreateRequestSchema = z.object({
|
|
|
57
57
|
parameter_format: z.enum(['NAMED', 'POSITIONAL']).optional(),
|
|
58
58
|
components: z.array(zWabaTemplateComponentSchema).min(1),
|
|
59
59
|
}).passthrough();
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* feat-327 — doc de `channels/{ch}/template_profiles/{name}__{language}`
|
|
63
|
+
* (leitura). A edição valida só os campos: `zTemplateProfileFieldsSchema`.
|
|
64
|
+
*/
|
|
65
|
+
export const zWabaTemplateProfileSchema = zTemplateProfileFieldsSchema
|
|
66
|
+
.extend({
|
|
67
|
+
id: z.string(),
|
|
68
|
+
name: z.string(),
|
|
69
|
+
language: z.string(),
|
|
70
|
+
created_at: z.coerce.date().nullable().optional(),
|
|
71
|
+
updated_at: z.coerce.date().nullable().optional(),
|
|
72
|
+
updated_by: z
|
|
73
|
+
.object({ user_id: z.string().optional(), display_name: z.string().optional() })
|
|
74
|
+
.nullable()
|
|
75
|
+
.optional(),
|
|
76
|
+
})
|
|
77
|
+
.passthrough();
|
|
@@ -110,11 +110,11 @@ export declare const zTenantSchema: z.ZodObject<{
|
|
|
110
110
|
created_at?: Date | null | undefined;
|
|
111
111
|
updated_at?: Date | null | undefined;
|
|
112
112
|
deleted_at?: Date | null | undefined;
|
|
113
|
+
language?: "ptBR" | "en" | undefined;
|
|
113
114
|
base_tenant?: string | null | undefined;
|
|
114
115
|
hidden?: boolean | undefined;
|
|
115
116
|
readonly?: boolean | undefined;
|
|
116
117
|
date_format?: string | undefined;
|
|
117
|
-
language?: "ptBR" | "en" | undefined;
|
|
118
118
|
timezone?: string | undefined;
|
|
119
119
|
modules?: Record<string, z.objectOutputType<{
|
|
120
120
|
status: z.ZodEnum<["active", "trial", "suspended", "cancelled"]>;
|
|
@@ -143,11 +143,11 @@ export declare const zTenantSchema: z.ZodObject<{
|
|
|
143
143
|
model_ver?: number | undefined;
|
|
144
144
|
updated_at?: Date | null | undefined;
|
|
145
145
|
deleted_at?: Date | null | undefined;
|
|
146
|
+
language?: "ptBR" | "en" | undefined;
|
|
146
147
|
base_tenant?: string | null | undefined;
|
|
147
148
|
hidden?: boolean | undefined;
|
|
148
149
|
readonly?: boolean | undefined;
|
|
149
150
|
date_format?: string | undefined;
|
|
150
|
-
language?: "ptBR" | "en" | undefined;
|
|
151
151
|
timezone?: string | undefined;
|
|
152
152
|
modules?: Record<string, z.objectInputType<{
|
|
153
153
|
status: z.ZodEnum<["active", "trial", "suspended", "cancelled"]>;
|
|
@@ -211,3 +211,91 @@ export declare const zCaptureDataFieldSchema: z.ZodObject<{
|
|
|
211
211
|
export declare const zCaptureDataValueSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
212
212
|
/** Mapa `capture_data` gravado na entidade. */
|
|
213
213
|
export declare const zCaptureDataMapSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
214
|
+
/**
|
|
215
|
+
* Tag de template: o mesmo `ITag`, em texto livre (sem dicionário, D3). `hidden`
|
|
216
|
+
* vira opcional na entrada (default false) porque não há catálogo a esconder.
|
|
217
|
+
*/
|
|
218
|
+
export declare const zTemplateProfileTagSchema: z.ZodObject<{
|
|
219
|
+
color: z.ZodOptional<z.ZodString>;
|
|
220
|
+
category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
221
|
+
base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
222
|
+
} & {
|
|
223
|
+
name: z.ZodString;
|
|
224
|
+
hidden: z.ZodDefault<z.ZodBoolean>;
|
|
225
|
+
}, "strip", z.ZodTypeAny, {
|
|
226
|
+
name: string;
|
|
227
|
+
hidden: boolean;
|
|
228
|
+
base?: boolean | undefined;
|
|
229
|
+
color?: string | undefined;
|
|
230
|
+
category?: string | null | undefined;
|
|
231
|
+
}, {
|
|
232
|
+
name: string;
|
|
233
|
+
base?: boolean | undefined;
|
|
234
|
+
color?: string | undefined;
|
|
235
|
+
category?: string | null | undefined;
|
|
236
|
+
hidden?: boolean | undefined;
|
|
237
|
+
}>;
|
|
238
|
+
/**
|
|
239
|
+
* Os quatro campos editáveis, comuns a HSM e e-mail. Use `.strict()` ao validar
|
|
240
|
+
* o corpo de uma rota de edição. Tags repetidas (mesmo nome, sem diferenciar
|
|
241
|
+
* maiúsculas) são recusadas.
|
|
242
|
+
*/
|
|
243
|
+
export declare const zTemplateProfileFieldsSchema: z.ZodObject<{
|
|
244
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
245
|
+
mcp_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
246
|
+
mcp_enabled: z.ZodOptional<z.ZodBoolean>;
|
|
247
|
+
tags: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
248
|
+
color: z.ZodOptional<z.ZodString>;
|
|
249
|
+
category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
250
|
+
base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
251
|
+
} & {
|
|
252
|
+
name: z.ZodString;
|
|
253
|
+
hidden: z.ZodDefault<z.ZodBoolean>;
|
|
254
|
+
}, "strip", z.ZodTypeAny, {
|
|
255
|
+
name: string;
|
|
256
|
+
hidden: boolean;
|
|
257
|
+
base?: boolean | undefined;
|
|
258
|
+
color?: string | undefined;
|
|
259
|
+
category?: string | null | undefined;
|
|
260
|
+
}, {
|
|
261
|
+
name: string;
|
|
262
|
+
base?: boolean | undefined;
|
|
263
|
+
color?: string | undefined;
|
|
264
|
+
category?: string | null | undefined;
|
|
265
|
+
hidden?: boolean | undefined;
|
|
266
|
+
}>, "many">, {
|
|
267
|
+
name: string;
|
|
268
|
+
hidden: boolean;
|
|
269
|
+
base?: boolean | undefined;
|
|
270
|
+
color?: string | undefined;
|
|
271
|
+
category?: string | null | undefined;
|
|
272
|
+
}[], {
|
|
273
|
+
name: string;
|
|
274
|
+
base?: boolean | undefined;
|
|
275
|
+
color?: string | undefined;
|
|
276
|
+
category?: string | null | undefined;
|
|
277
|
+
hidden?: boolean | undefined;
|
|
278
|
+
}[]>>>;
|
|
279
|
+
}, "strip", z.ZodTypeAny, {
|
|
280
|
+
mcp_description?: string | null | undefined;
|
|
281
|
+
mcp_enabled?: boolean | undefined;
|
|
282
|
+
description?: string | null | undefined;
|
|
283
|
+
tags?: {
|
|
284
|
+
name: string;
|
|
285
|
+
hidden: boolean;
|
|
286
|
+
base?: boolean | undefined;
|
|
287
|
+
color?: string | undefined;
|
|
288
|
+
category?: string | null | undefined;
|
|
289
|
+
}[] | null | undefined;
|
|
290
|
+
}, {
|
|
291
|
+
mcp_description?: string | null | undefined;
|
|
292
|
+
mcp_enabled?: boolean | undefined;
|
|
293
|
+
description?: string | null | undefined;
|
|
294
|
+
tags?: {
|
|
295
|
+
name: string;
|
|
296
|
+
base?: boolean | undefined;
|
|
297
|
+
color?: string | undefined;
|
|
298
|
+
category?: string | null | undefined;
|
|
299
|
+
hidden?: boolean | undefined;
|
|
300
|
+
}[] | null | undefined;
|
|
301
|
+
}>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zCaptureDataMapSchema = exports.zCaptureDataValueSchema = exports.zCaptureDataFieldSchema = exports.zCaptureDataFieldOptionSchema = exports.zCaptureDataFieldTypeSchema = exports.zContactSchema = exports.zAddressSchema = exports.zTagSchema = exports.zFireDocSchema = exports.zFirestoreDateSchema = exports.zEvoAppSchema = void 0;
|
|
3
|
+
exports.zTemplateProfileFieldsSchema = exports.zTemplateProfileTagSchema = exports.zCaptureDataMapSchema = exports.zCaptureDataValueSchema = exports.zCaptureDataFieldSchema = exports.zCaptureDataFieldOptionSchema = exports.zCaptureDataFieldTypeSchema = exports.zContactSchema = exports.zAddressSchema = exports.zTagSchema = exports.zFireDocSchema = exports.zFirestoreDateSchema = exports.zEvoAppSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const template_profile_1 = require("../../types/shared/template-profile");
|
|
5
6
|
// Enum for activity read status
|
|
6
7
|
exports.zEvoAppSchema = zod_1.z.enum([
|
|
7
8
|
"evo-activity",
|
|
@@ -136,3 +137,37 @@ exports.zCaptureDataValueSchema = zod_1.z.union([
|
|
|
136
137
|
]);
|
|
137
138
|
/** Mapa `capture_data` gravado na entidade. */
|
|
138
139
|
exports.zCaptureDataMapSchema = zod_1.z.record(exports.zCaptureDataValueSchema);
|
|
140
|
+
// ----- Perfil de template (HSM e e-mail) — feat-327
|
|
141
|
+
/**
|
|
142
|
+
* Tag de template: o mesmo `ITag`, em texto livre (sem dicionário, D3). `hidden`
|
|
143
|
+
* vira opcional na entrada (default false) porque não há catálogo a esconder.
|
|
144
|
+
*/
|
|
145
|
+
exports.zTemplateProfileTagSchema = exports.zTagSchema.extend({
|
|
146
|
+
name: zod_1.z.string().trim().min(2).max(50),
|
|
147
|
+
hidden: zod_1.z.boolean().default(false),
|
|
148
|
+
});
|
|
149
|
+
/**
|
|
150
|
+
* Os quatro campos editáveis, comuns a HSM e e-mail. Use `.strict()` ao validar
|
|
151
|
+
* o corpo de uma rota de edição. Tags repetidas (mesmo nome, sem diferenciar
|
|
152
|
+
* maiúsculas) são recusadas.
|
|
153
|
+
*/
|
|
154
|
+
exports.zTemplateProfileFieldsSchema = zod_1.z.object({
|
|
155
|
+
description: zod_1.z.string().trim().max(template_profile_1.TEMPLATE_PROFILE_DESCRIPTION_MAX).nullable().optional(),
|
|
156
|
+
mcp_description: zod_1.z.string().trim().max(template_profile_1.TEMPLATE_PROFILE_MCP_DESCRIPTION_MAX).nullable().optional(),
|
|
157
|
+
mcp_enabled: zod_1.z.boolean().optional(),
|
|
158
|
+
tags: zod_1.z
|
|
159
|
+
.array(exports.zTemplateProfileTagSchema)
|
|
160
|
+
.max(template_profile_1.TEMPLATE_PROFILE_TAGS_MAX)
|
|
161
|
+
.superRefine((tags, ctx) => {
|
|
162
|
+
const seen = new Set();
|
|
163
|
+
tags.forEach((tag, i) => {
|
|
164
|
+
const key = tag.name.toLowerCase();
|
|
165
|
+
if (seen.has(key)) {
|
|
166
|
+
ctx.addIssue({ code: zod_1.z.ZodIssueCode.custom, path: [i, "name"], message: `Tag repetida: ${tag.name}` });
|
|
167
|
+
}
|
|
168
|
+
seen.add(key);
|
|
169
|
+
});
|
|
170
|
+
})
|
|
171
|
+
.nullable()
|
|
172
|
+
.optional(),
|
|
173
|
+
});
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import {
|
|
3
|
+
TEMPLATE_PROFILE_DESCRIPTION_MAX,
|
|
4
|
+
TEMPLATE_PROFILE_MCP_DESCRIPTION_MAX,
|
|
5
|
+
TEMPLATE_PROFILE_TAGS_MAX,
|
|
6
|
+
} from "../../types/shared/template-profile";
|
|
2
7
|
|
|
3
8
|
// Enum for activity read status
|
|
4
9
|
export const zEvoAppSchema = z.enum([
|
|
@@ -162,3 +167,40 @@ export const zCaptureDataValueSchema = z.union([
|
|
|
162
167
|
|
|
163
168
|
/** Mapa `capture_data` gravado na entidade. */
|
|
164
169
|
export const zCaptureDataMapSchema = z.record(zCaptureDataValueSchema);
|
|
170
|
+
|
|
171
|
+
// ----- Perfil de template (HSM e e-mail) — feat-327
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Tag de template: o mesmo `ITag`, em texto livre (sem dicionário, D3). `hidden`
|
|
175
|
+
* vira opcional na entrada (default false) porque não há catálogo a esconder.
|
|
176
|
+
*/
|
|
177
|
+
export const zTemplateProfileTagSchema = zTagSchema.extend({
|
|
178
|
+
name: z.string().trim().min(2).max(50),
|
|
179
|
+
hidden: z.boolean().default(false),
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Os quatro campos editáveis, comuns a HSM e e-mail. Use `.strict()` ao validar
|
|
184
|
+
* o corpo de uma rota de edição. Tags repetidas (mesmo nome, sem diferenciar
|
|
185
|
+
* maiúsculas) são recusadas.
|
|
186
|
+
*/
|
|
187
|
+
export const zTemplateProfileFieldsSchema = z.object({
|
|
188
|
+
description: z.string().trim().max(TEMPLATE_PROFILE_DESCRIPTION_MAX).nullable().optional(),
|
|
189
|
+
mcp_description: z.string().trim().max(TEMPLATE_PROFILE_MCP_DESCRIPTION_MAX).nullable().optional(),
|
|
190
|
+
mcp_enabled: z.boolean().optional(),
|
|
191
|
+
tags: z
|
|
192
|
+
.array(zTemplateProfileTagSchema)
|
|
193
|
+
.max(TEMPLATE_PROFILE_TAGS_MAX)
|
|
194
|
+
.superRefine((tags, ctx) => {
|
|
195
|
+
const seen = new Set<string>();
|
|
196
|
+
tags.forEach((tag, i) => {
|
|
197
|
+
const key = tag.name.toLowerCase();
|
|
198
|
+
if (seen.has(key)) {
|
|
199
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, path: [i, "name"], message: `Tag repetida: ${tag.name}` });
|
|
200
|
+
}
|
|
201
|
+
seen.add(key);
|
|
202
|
+
});
|
|
203
|
+
})
|
|
204
|
+
.nullable()
|
|
205
|
+
.optional(),
|
|
206
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FirestoreDocumentReference, IFireDoc, IExternalLink } from "../shared";
|
|
1
|
+
import type { FirestoreDocumentReference, IFireDoc, IExternalLink, ITemplateProfileFields } from "../shared";
|
|
2
2
|
export * from "./fb_collections";
|
|
3
3
|
export declare const EvoNotificationsPermissions: {
|
|
4
4
|
readonly MessagesList: "evo_notifications_messages_list";
|
|
@@ -316,7 +316,11 @@ export type IEmailChannelConfig = IEmailChannelConfigBase & ({
|
|
|
316
316
|
provider: "amazon-ses";
|
|
317
317
|
smtp?: never;
|
|
318
318
|
});
|
|
319
|
-
|
|
319
|
+
/**
|
|
320
|
+
* feat-327: `description`, `mcp_description`, `mcp_enabled` (default false) e
|
|
321
|
+
* `tags` vêm de `ITemplateProfileFields`, gravados no próprio doc.
|
|
322
|
+
*/
|
|
323
|
+
export interface IEmailTemplate extends IFireDoc, ITemplateProfileFields {
|
|
320
324
|
/**
|
|
321
325
|
* Chave usada no payload de envio (template.template_id).
|
|
322
326
|
* Indexada para lookup eficiente: where('template_id', '==', value).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FirestoreDocumentReference, IFireDoc, IExternalLink } from "../shared";
|
|
1
|
+
import type { FirestoreDocumentReference, IFireDoc, IExternalLink, ITemplateProfileFields } from "../shared";
|
|
2
2
|
|
|
3
3
|
export * from "./fb_collections";
|
|
4
4
|
|
|
@@ -483,7 +483,11 @@ export type IEmailChannelConfig = IEmailChannelConfigBase & (
|
|
|
483
483
|
// Path: /tenants/{tenant}/apps/evo-notifications/email_channels/{channelId}/email_templates/{templateId}
|
|
484
484
|
// ======================================================
|
|
485
485
|
|
|
486
|
-
|
|
486
|
+
/**
|
|
487
|
+
* feat-327: `description`, `mcp_description`, `mcp_enabled` (default false) e
|
|
488
|
+
* `tags` vêm de `ITemplateProfileFields`, gravados no próprio doc.
|
|
489
|
+
*/
|
|
490
|
+
export interface IEmailTemplate extends IFireDoc, ITemplateProfileFields {
|
|
487
491
|
/**
|
|
488
492
|
* Chave usada no payload de envio (template.template_id).
|
|
489
493
|
* Indexada para lookup eficiente: where('template_id', '==', value).
|
|
@@ -18,6 +18,7 @@ exports.IEvoApp = void 0;
|
|
|
18
18
|
__exportStar(require("./fb_collections"), exports);
|
|
19
19
|
__exportStar(require("./external-links"), exports);
|
|
20
20
|
__exportStar(require("./capture-data"), exports);
|
|
21
|
+
__exportStar(require("./template-profile"), exports);
|
|
21
22
|
var IEvoApp;
|
|
22
23
|
(function (IEvoApp) {
|
|
23
24
|
IEvoApp["EvoActivity"] = "evo-activity";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ITag } from "./index";
|
|
2
|
+
/** Limite de `description` (descrição breve, interna). */
|
|
3
|
+
export declare const TEMPLATE_PROFILE_DESCRIPTION_MAX = 280;
|
|
4
|
+
/** Limite de `mcp_description` (orientação para a IA). */
|
|
5
|
+
export declare const TEMPLATE_PROFILE_MCP_DESCRIPTION_MAX = 2000;
|
|
6
|
+
/** Limite de tags por template. */
|
|
7
|
+
export declare const TEMPLATE_PROFILE_TAGS_MAX = 20;
|
|
8
|
+
/** Os quatro campos editáveis — comuns a HSM e e-mail. */
|
|
9
|
+
export interface ITemplateProfileFields {
|
|
10
|
+
/** Descrição breve interna (≤280). Aparece na 2ª linha dos seletores. */
|
|
11
|
+
description?: string | null;
|
|
12
|
+
/** Orientação para a IA (≤2000). Sem efeito nesta fase (D1). */
|
|
13
|
+
mcp_description?: string | null;
|
|
14
|
+
/**
|
|
15
|
+
* "Disponível para a HubIA". Ausente = **false** (D7) — diferente do padrão
|
|
16
|
+
* `true` dos dicionários: liberar template para a IA tem custo (HSM).
|
|
17
|
+
*/
|
|
18
|
+
mcp_enabled?: boolean;
|
|
19
|
+
/** Texto livre com cor, sem dicionário (D3). */
|
|
20
|
+
tags?: ITag[] | null;
|
|
21
|
+
}
|
|
22
|
+
export interface ITemplateProfileAudit {
|
|
23
|
+
updated_at?: Date | null;
|
|
24
|
+
updated_by?: {
|
|
25
|
+
user_id?: string;
|
|
26
|
+
display_name?: string;
|
|
27
|
+
} | null;
|
|
28
|
+
}
|
|
29
|
+
export type ITemplateProfile = ITemplateProfileFields & ITemplateProfileAudit;
|
|
30
|
+
/**
|
|
31
|
+
* Subcoleção sob o canal, irmã de `template_sms` / `template_assets`:
|
|
32
|
+
* `tenants/{t}/apps/evo-chat/channels/{ch}/template_profiles/{name}__{language}`
|
|
33
|
+
*/
|
|
34
|
+
export declare const TEMPLATE_PROFILES_COLLECTION = "template_profiles";
|
|
35
|
+
export interface IWabaTemplateProfile extends ITemplateProfile {
|
|
36
|
+
/** `{name}__{language}` — igual ao doc id. */
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
language: string;
|
|
40
|
+
created_at?: Date | null;
|
|
41
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TEMPLATE_PROFILES_COLLECTION = exports.TEMPLATE_PROFILE_TAGS_MAX = exports.TEMPLATE_PROFILE_MCP_DESCRIPTION_MAX = exports.TEMPLATE_PROFILE_DESCRIPTION_MAX = void 0;
|
|
4
|
+
// ----- Perfil de template (descrição, orientação para IA, tags) — feat-327
|
|
5
|
+
//
|
|
6
|
+
// Os mesmos quatro campos valem para templates HSM (WABA) e de e-mail (D4):
|
|
7
|
+
// - e-mail: gravados no PRÓPRIO doc do template (`email_templates/{id}`);
|
|
8
|
+
// - HSM: o doc do template é espelho da Meta (id = meta_id, muda ao
|
|
9
|
+
// recriar/republicar), então vivem numa coleção irmã, chaveada por nome e
|
|
10
|
+
// idioma — ver `IWabaTemplateProfile` (D6).
|
|
11
|
+
//
|
|
12
|
+
// Nesta fase a HubIA NÃO lê nada disto (D1): `mcp_description`/`mcp_enabled`
|
|
13
|
+
// só são cadastrados, preparando uma feature futura.
|
|
14
|
+
/** Limite de `description` (descrição breve, interna). */
|
|
15
|
+
exports.TEMPLATE_PROFILE_DESCRIPTION_MAX = 280;
|
|
16
|
+
/** Limite de `mcp_description` (orientação para a IA). */
|
|
17
|
+
exports.TEMPLATE_PROFILE_MCP_DESCRIPTION_MAX = 2000;
|
|
18
|
+
/** Limite de tags por template. */
|
|
19
|
+
exports.TEMPLATE_PROFILE_TAGS_MAX = 20;
|
|
20
|
+
// ----- HSM (WABA)
|
|
21
|
+
/**
|
|
22
|
+
* Subcoleção sob o canal, irmã de `template_sms` / `template_assets`:
|
|
23
|
+
* `tenants/{t}/apps/evo-chat/channels/{ch}/template_profiles/{name}__{language}`
|
|
24
|
+
*/
|
|
25
|
+
exports.TEMPLATE_PROFILES_COLLECTION = "template_profiles";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ITag } from "./index";
|
|
2
|
+
|
|
3
|
+
// ----- Perfil de template (descrição, orientação para IA, tags) — feat-327
|
|
4
|
+
//
|
|
5
|
+
// Os mesmos quatro campos valem para templates HSM (WABA) e de e-mail (D4):
|
|
6
|
+
// - e-mail: gravados no PRÓPRIO doc do template (`email_templates/{id}`);
|
|
7
|
+
// - HSM: o doc do template é espelho da Meta (id = meta_id, muda ao
|
|
8
|
+
// recriar/republicar), então vivem numa coleção irmã, chaveada por nome e
|
|
9
|
+
// idioma — ver `IWabaTemplateProfile` (D6).
|
|
10
|
+
//
|
|
11
|
+
// Nesta fase a HubIA NÃO lê nada disto (D1): `mcp_description`/`mcp_enabled`
|
|
12
|
+
// só são cadastrados, preparando uma feature futura.
|
|
13
|
+
|
|
14
|
+
/** Limite de `description` (descrição breve, interna). */
|
|
15
|
+
export const TEMPLATE_PROFILE_DESCRIPTION_MAX = 280;
|
|
16
|
+
/** Limite de `mcp_description` (orientação para a IA). */
|
|
17
|
+
export const TEMPLATE_PROFILE_MCP_DESCRIPTION_MAX = 2000;
|
|
18
|
+
/** Limite de tags por template. */
|
|
19
|
+
export const TEMPLATE_PROFILE_TAGS_MAX = 20;
|
|
20
|
+
|
|
21
|
+
/** Os quatro campos editáveis — comuns a HSM e e-mail. */
|
|
22
|
+
export interface ITemplateProfileFields {
|
|
23
|
+
/** Descrição breve interna (≤280). Aparece na 2ª linha dos seletores. */
|
|
24
|
+
description?: string | null;
|
|
25
|
+
/** Orientação para a IA (≤2000). Sem efeito nesta fase (D1). */
|
|
26
|
+
mcp_description?: string | null;
|
|
27
|
+
/**
|
|
28
|
+
* "Disponível para a HubIA". Ausente = **false** (D7) — diferente do padrão
|
|
29
|
+
* `true` dos dicionários: liberar template para a IA tem custo (HSM).
|
|
30
|
+
*/
|
|
31
|
+
mcp_enabled?: boolean;
|
|
32
|
+
/** Texto livre com cor, sem dicionário (D3). */
|
|
33
|
+
tags?: ITag[] | null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ITemplateProfileAudit {
|
|
37
|
+
updated_at?: Date | null;
|
|
38
|
+
updated_by?: { user_id?: string; display_name?: string } | null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type ITemplateProfile = ITemplateProfileFields & ITemplateProfileAudit;
|
|
42
|
+
|
|
43
|
+
// ----- HSM (WABA)
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Subcoleção sob o canal, irmã de `template_sms` / `template_assets`:
|
|
47
|
+
* `tenants/{t}/apps/evo-chat/channels/{ch}/template_profiles/{name}__{language}`
|
|
48
|
+
*/
|
|
49
|
+
export const TEMPLATE_PROFILES_COLLECTION = "template_profiles";
|
|
50
|
+
|
|
51
|
+
export interface IWabaTemplateProfile extends ITemplateProfile {
|
|
52
|
+
/** `{name}__{language}` — igual ao doc id. */
|
|
53
|
+
id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
language: string;
|
|
56
|
+
created_at?: Date | null;
|
|
57
|
+
}
|