evo360-types 1.3.778 → 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.
@@ -1561,3 +1561,234 @@ 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
+ /** 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
+ }>;
1632
+ export declare const zWabaTemplateProfileSchema: z.ZodObject<{
1633
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1634
+ mcp_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1635
+ mcp_enabled: z.ZodOptional<z.ZodBoolean>;
1636
+ tags: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodArray<z.ZodObject<{
1637
+ color: z.ZodOptional<z.ZodString>;
1638
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1639
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1640
+ } & {
1641
+ name: z.ZodString;
1642
+ hidden: z.ZodDefault<z.ZodBoolean>;
1643
+ }, "strip", z.ZodTypeAny, {
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
+ }>, "many">, {
1656
+ name: string;
1657
+ hidden: boolean;
1658
+ base?: boolean | undefined;
1659
+ color?: string | undefined;
1660
+ category?: string | null | undefined;
1661
+ }[], {
1662
+ name: string;
1663
+ base?: boolean | undefined;
1664
+ color?: string | undefined;
1665
+ category?: string | null | undefined;
1666
+ hidden?: boolean | undefined;
1667
+ }[]>>>;
1668
+ } & {
1669
+ enabled: z.ZodOptional<z.ZodBoolean>;
1670
+ } & {
1671
+ id: z.ZodString;
1672
+ name: z.ZodString;
1673
+ language: z.ZodString;
1674
+ created_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1675
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1676
+ updated_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1677
+ user_id: z.ZodOptional<z.ZodString>;
1678
+ display_name: z.ZodOptional<z.ZodString>;
1679
+ }, "strip", z.ZodTypeAny, {
1680
+ display_name?: string | undefined;
1681
+ user_id?: string | undefined;
1682
+ }, {
1683
+ display_name?: string | undefined;
1684
+ user_id?: string | undefined;
1685
+ }>>>;
1686
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1687
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1688
+ mcp_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1689
+ mcp_enabled: z.ZodOptional<z.ZodBoolean>;
1690
+ tags: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodArray<z.ZodObject<{
1691
+ color: z.ZodOptional<z.ZodString>;
1692
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1693
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1694
+ } & {
1695
+ name: z.ZodString;
1696
+ hidden: z.ZodDefault<z.ZodBoolean>;
1697
+ }, "strip", z.ZodTypeAny, {
1698
+ name: string;
1699
+ hidden: boolean;
1700
+ base?: boolean | undefined;
1701
+ color?: string | undefined;
1702
+ category?: string | null | undefined;
1703
+ }, {
1704
+ name: string;
1705
+ base?: boolean | undefined;
1706
+ color?: string | undefined;
1707
+ category?: string | null | undefined;
1708
+ hidden?: boolean | undefined;
1709
+ }>, "many">, {
1710
+ name: string;
1711
+ hidden: boolean;
1712
+ base?: boolean | undefined;
1713
+ color?: string | undefined;
1714
+ category?: string | null | undefined;
1715
+ }[], {
1716
+ name: string;
1717
+ base?: boolean | undefined;
1718
+ color?: string | undefined;
1719
+ category?: string | null | undefined;
1720
+ hidden?: boolean | undefined;
1721
+ }[]>>>;
1722
+ } & {
1723
+ enabled: z.ZodOptional<z.ZodBoolean>;
1724
+ } & {
1725
+ id: z.ZodString;
1726
+ name: z.ZodString;
1727
+ language: z.ZodString;
1728
+ created_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1729
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1730
+ updated_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1731
+ user_id: z.ZodOptional<z.ZodString>;
1732
+ display_name: z.ZodOptional<z.ZodString>;
1733
+ }, "strip", z.ZodTypeAny, {
1734
+ display_name?: string | undefined;
1735
+ user_id?: string | undefined;
1736
+ }, {
1737
+ display_name?: string | undefined;
1738
+ user_id?: string | undefined;
1739
+ }>>>;
1740
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1741
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1742
+ mcp_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1743
+ mcp_enabled: z.ZodOptional<z.ZodBoolean>;
1744
+ tags: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodArray<z.ZodObject<{
1745
+ color: z.ZodOptional<z.ZodString>;
1746
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1747
+ base: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1748
+ } & {
1749
+ name: z.ZodString;
1750
+ hidden: z.ZodDefault<z.ZodBoolean>;
1751
+ }, "strip", z.ZodTypeAny, {
1752
+ name: string;
1753
+ hidden: boolean;
1754
+ base?: boolean | undefined;
1755
+ color?: string | undefined;
1756
+ category?: string | null | undefined;
1757
+ }, {
1758
+ name: string;
1759
+ base?: boolean | undefined;
1760
+ color?: string | undefined;
1761
+ category?: string | null | undefined;
1762
+ hidden?: boolean | undefined;
1763
+ }>, "many">, {
1764
+ name: string;
1765
+ hidden: boolean;
1766
+ base?: boolean | undefined;
1767
+ color?: string | undefined;
1768
+ category?: string | null | undefined;
1769
+ }[], {
1770
+ name: string;
1771
+ base?: boolean | undefined;
1772
+ color?: string | undefined;
1773
+ category?: string | null | undefined;
1774
+ hidden?: boolean | undefined;
1775
+ }[]>>>;
1776
+ } & {
1777
+ enabled: z.ZodOptional<z.ZodBoolean>;
1778
+ } & {
1779
+ id: z.ZodString;
1780
+ name: z.ZodString;
1781
+ language: z.ZodString;
1782
+ created_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1783
+ updated_at: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
1784
+ updated_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1785
+ user_id: z.ZodOptional<z.ZodString>;
1786
+ display_name: z.ZodOptional<z.ZodString>;
1787
+ }, "strip", z.ZodTypeAny, {
1788
+ display_name?: string | undefined;
1789
+ user_id?: string | undefined;
1790
+ }, {
1791
+ display_name?: string | undefined;
1792
+ user_id?: string | undefined;
1793
+ }>>>;
1794
+ }, 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.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({
@@ -55,3 +55,24 @@ 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
+ /** 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
67
+ .extend({
68
+ id: zod_1.z.string(),
69
+ name: zod_1.z.string(),
70
+ language: zod_1.z.string(),
71
+ created_at: zod_1.z.coerce.date().nullable().optional(),
72
+ updated_at: zod_1.z.coerce.date().nullable().optional(),
73
+ updated_by: zod_1.z
74
+ .object({ user_id: zod_1.z.string().optional(), display_name: zod_1.z.string().optional() })
75
+ .nullable()
76
+ .optional(),
77
+ })
78
+ .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,26 @@ 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
+ /** 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
71
+ .extend({
72
+ id: z.string(),
73
+ name: z.string(),
74
+ language: z.string(),
75
+ created_at: z.coerce.date().nullable().optional(),
76
+ updated_at: z.coerce.date().nullable().optional(),
77
+ updated_by: z
78
+ .object({ user_id: z.string().optional(), display_name: z.string().optional() })
79
+ .nullable()
80
+ .optional(),
81
+ })
82
+ .passthrough();
@@ -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`
@@ -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
- export interface IEmailTemplate extends IFireDoc {
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
- export interface IEmailTemplate extends IFireDoc {
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).
@@ -1,6 +1,7 @@
1
1
  export * from "./fb_collections";
2
2
  export * from "./external-links";
3
3
  export * from "./capture-data";
4
+ export * from "./template-profile";
4
5
  export interface FirestoreDocumentReference {
5
6
  id: string;
6
7
  path: string;
@@ -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";
@@ -1,6 +1,7 @@
1
1
  export * from "./fb_collections";
2
2
  export * from "./external-links";
3
3
  export * from "./capture-data";
4
+ export * from "./template-profile";
4
5
 
5
6
  // ----- FirestoreTypes
6
7
  // Definir o tipo unificado para DocumentReference
@@ -0,0 +1,63 @@
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
+ /**
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 {
46
+ /** `{name}__{language}` — igual ao doc id. */
47
+ id: string;
48
+ name: string;
49
+ language: string;
50
+ created_at?: Date | null;
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;
@@ -0,0 +1,36 @@
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
+ exports.isWabaTemplateProfileEnabled = isWabaTemplateProfileEnabled;
5
+ exports.compareTemplatesByName = compareTemplatesByName;
6
+ // ----- Perfil de template (descrição, orientação para IA, tags) — feat-327
7
+ //
8
+ // Os mesmos quatro campos valem para templates HSM (WABA) e de e-mail (D4):
9
+ // - e-mail: gravados no PRÓPRIO doc do template (`email_templates/{id}`);
10
+ // - HSM: o doc do template é espelho da Meta (id = meta_id, muda ao
11
+ // recriar/republicar), então vivem numa coleção irmã, chaveada por nome e
12
+ // idioma — ver `IWabaTemplateProfile` (D6).
13
+ //
14
+ // Nesta fase a HubIA NÃO lê nada disto (D1): `mcp_description`/`mcp_enabled`
15
+ // só são cadastrados, preparando uma feature futura.
16
+ /** Limite de `description` (descrição breve, interna). */
17
+ exports.TEMPLATE_PROFILE_DESCRIPTION_MAX = 280;
18
+ /** Limite de `mcp_description` (orientação para a IA). */
19
+ exports.TEMPLATE_PROFILE_MCP_DESCRIPTION_MAX = 2000;
20
+ /** Limite de tags por template. */
21
+ exports.TEMPLATE_PROFILE_TAGS_MAX = 20;
22
+ // ----- HSM (WABA)
23
+ /**
24
+ * Subcoleção sob o canal, irmã de `template_sms` / `template_assets`:
25
+ * `tenants/{t}/apps/evo-chat/channels/{ch}/template_profiles/{name}__{language}`
26
+ */
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
+ }
@@ -0,0 +1,82 @@
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
+ /**
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 {
63
+ /** `{name}__{language}` — igual ao doc id. */
64
+ id: string;
65
+ name: string;
66
+ language: string;
67
+ created_at?: Date | null;
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.778",
3
+ "version": "1.3.782",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",