evo360-types 1.3.311 → 1.3.316

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.
@@ -0,0 +1,52 @@
1
+ import { z } from "zod";
2
+ import { zFireDocSchema } from "../../shared/zod-schemas";
3
+
4
+ // ───────── Attendance Mode (how AI operates on this channel) ─────────
5
+
6
+ export const zHubiaAttendanceModeSchema = z.enum(["ai_auto", "ai_suggest", "disabled"]);
7
+ export type IHubiaAttendanceMode = z.infer<typeof zHubiaAttendanceModeSchema>;
8
+
9
+ // ───────── Channel Config (evo-hubia-v1 automation config per channel) ─────────
10
+
11
+ export const zHubiaV1ChannelConfigSchema = zFireDocSchema.extend({
12
+ evo_chat_channel_id: z.string(),
13
+ channel_name: z.string(),
14
+ active: z.boolean().default(false),
15
+ attendance_mode: zHubiaAttendanceModeSchema.default("ai_auto"),
16
+ debounce_seconds: z.number().default(20),
17
+ llm_model: z.string().default("claude-sonnet-4-20250514"),
18
+ llm_temperature: z.number().min(0).max(1).default(0.3),
19
+ llm_max_tokens: z.number().default(2048),
20
+ prompt_ids: z.array(z.string()).default([]),
21
+ toolkit_id: z.string().nullable().optional(),
22
+ max_rounds: z.number().default(5),
23
+ max_tool_calls: z.number().default(10),
24
+ execution_timeout_ms: z.number().default(30000),
25
+ capabilities: z.object({
26
+ can_schedule: z.boolean().default(false),
27
+ can_reschedule: z.boolean().default(false),
28
+ can_cancel: z.boolean().default(false),
29
+ can_handoff: z.boolean().default(true),
30
+ can_read_finops: z.boolean().default(false),
31
+ }),
32
+ timezone: z.string().default("America/Sao_Paulo"),
33
+ }).passthrough();
34
+
35
+ export type IHubiaV1ChannelConfig = z.infer<typeof zHubiaV1ChannelConfigSchema>;
36
+
37
+ // ───────── AI Binding (department → AI agent routing) ─────────
38
+
39
+ export const zAiBindingSchema = zFireDocSchema.extend({
40
+ agent_type: z.string(), // 'evo-hubia-v1', future: 'evo-hubia-v2', etc.
41
+ agent_config_id: z.string(), // ref to the agent's channel config doc
42
+ topic: z.string(), // PubSub topic for this agent: 'hubia-inbound-message'
43
+ active: z.boolean().default(true),
44
+ priority: z.number().default(1), // 1 = primary, 2 = fallback
45
+ }).passthrough();
46
+
47
+ export type IAiBinding = z.infer<typeof zAiBindingSchema>;
48
+
49
+ // ───────── Conversation State ─────────
50
+
51
+ export const zHubiaConversationModeSchema = z.enum(["ai_only", "hybrid_assist", "human_only", "blocked"]);
52
+ export type IHubiaConversationMode = z.infer<typeof zHubiaConversationModeSchema>;
@@ -245,6 +245,8 @@ export declare const zDepartmentSchema: z.ZodObject<{
245
245
  category?: string | null | undefined;
246
246
  color?: string | undefined;
247
247
  }>, "many">>>;
248
+ chat_enabled: z.ZodOptional<z.ZodBoolean>;
249
+ chat_color: z.ZodOptional<z.ZodString>;
248
250
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
249
251
  id: z.ZodString;
250
252
  ref: z.ZodAny;
@@ -280,6 +282,8 @@ export declare const zDepartmentSchema: z.ZodObject<{
280
282
  category?: string | null | undefined;
281
283
  color?: string | undefined;
282
284
  }>, "many">>>;
285
+ chat_enabled: z.ZodOptional<z.ZodBoolean>;
286
+ chat_color: z.ZodOptional<z.ZodString>;
283
287
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
284
288
  id: z.ZodString;
285
289
  ref: z.ZodAny;
@@ -315,6 +319,8 @@ export declare const zDepartmentSchema: z.ZodObject<{
315
319
  category?: string | null | undefined;
316
320
  color?: string | undefined;
317
321
  }>, "many">>>;
322
+ chat_enabled: z.ZodOptional<z.ZodBoolean>;
323
+ chat_color: z.ZodOptional<z.ZodString>;
318
324
  }, z.ZodTypeAny, "passthrough">>;
319
325
  export declare const zOfficeSchema: z.ZodObject<{
320
326
  id: z.ZodString;
@@ -86,6 +86,8 @@ exports.zDepartmentSchema = zod_schemas_1.zFireDocSchema // Extend from FireDocS
86
86
  parent_departmentRef: zod_1.z.any(),
87
87
  employee_counters: zod_1.z.any().optional(),
88
88
  tags: zod_1.z.array(zod_schemas_1.zTagSchema).nullable().optional(),
89
+ chat_enabled: zod_1.z.boolean().optional(),
90
+ chat_color: zod_1.z.string().optional(),
89
91
  })
90
92
  .passthrough();
91
93
  exports.zOfficeSchema = zod_schemas_1.zFireDocSchema // Extend from FireDocSchema
@@ -88,6 +88,8 @@ export const zDepartmentSchema = zFireDocSchema // Extend from FireDocSchema
88
88
  parent_departmentRef: z.any(),
89
89
  employee_counters: z.any().optional(),
90
90
  tags: z.array(zTagSchema).nullable().optional(),
91
+ chat_enabled: z.boolean().optional(),
92
+ chat_color: z.string().optional(),
91
93
  })
92
94
  .passthrough();
93
95
 
package/dist/index.d.ts CHANGED
@@ -38,7 +38,9 @@ export * from "./apps/evo-chat/thread-message/zod-schemas";
38
38
  export * from "./apps/evo-chat/ticket/zod-schemas";
39
39
  export * from "./apps/evo-chat/inbox/zod-schemas";
40
40
  export * from "./apps/evo-chat/waba-template/zod-schemas";
41
+ export * from "./apps/evo-chat/quick-reply/zod-schemas";
41
42
  export * from "./apps/evo-hub-ia/channel/zod-schemas";
43
+ export * from "./apps/evo-hub-ia/v1/zod-schemas";
42
44
  export * from "./apps/evo-med/calendar/zod-schemas";
43
45
  export * from "./apps/evo-med/appointment/zod-schemas";
44
46
  export * from "./apps/evo-med/dic/zod-schemas";
package/dist/index.js CHANGED
@@ -56,7 +56,9 @@ __exportStar(require("./apps/evo-chat/thread-message/zod-schemas"), exports);
56
56
  __exportStar(require("./apps/evo-chat/ticket/zod-schemas"), exports);
57
57
  __exportStar(require("./apps/evo-chat/inbox/zod-schemas"), exports);
58
58
  __exportStar(require("./apps/evo-chat/waba-template/zod-schemas"), exports);
59
+ __exportStar(require("./apps/evo-chat/quick-reply/zod-schemas"), exports);
59
60
  __exportStar(require("./apps/evo-hub-ia/channel/zod-schemas"), exports);
61
+ __exportStar(require("./apps/evo-hub-ia/v1/zod-schemas"), exports);
60
62
  __exportStar(require("./apps/evo-med/calendar/zod-schemas"), exports);
61
63
  __exportStar(require("./apps/evo-med/appointment/zod-schemas"), exports);
62
64
  __exportStar(require("./apps/evo-med/dic/zod-schemas"), exports);
package/dist/index.ts CHANGED
@@ -41,7 +41,9 @@ export * from "./apps/evo-chat/thread-message/zod-schemas";
41
41
  export * from "./apps/evo-chat/ticket/zod-schemas";
42
42
  export * from "./apps/evo-chat/inbox/zod-schemas";
43
43
  export * from "./apps/evo-chat/waba-template/zod-schemas";
44
+ export * from "./apps/evo-chat/quick-reply/zod-schemas";
44
45
  export * from "./apps/evo-hub-ia/channel/zod-schemas";
46
+ export * from "./apps/evo-hub-ia/v1/zod-schemas";
45
47
  export * from "./apps/evo-med/calendar/zod-schemas";
46
48
  export * from "./apps/evo-med/appointment/zod-schemas";
47
49
  export * from "./apps/evo-med/dic/zod-schemas";
@@ -10,4 +10,5 @@ export declare const TICKETS_COLLECTION = "tickets";
10
10
  export declare const INBOXES_COLLECTION = "inboxes";
11
11
  export declare const HubWabaCollections: {
12
12
  readonly TEMPLATES: "waba-templates";
13
+ readonly QUICK_REPLIES: "quick-replies";
13
14
  };
@@ -20,4 +20,5 @@ exports.INBOXES_COLLECTION = "inboxes";
20
20
  // hub-waba template subcollection (under channels)
21
21
  exports.HubWabaCollections = {
22
22
  TEMPLATES: 'waba-templates',
23
+ QUICK_REPLIES: 'quick-replies',
23
24
  };
@@ -23,4 +23,5 @@ export const INBOXES_COLLECTION = "inboxes";
23
23
  // hub-waba template subcollection (under channels)
24
24
  export const HubWabaCollections = {
25
25
  TEMPLATES: 'waba-templates',
26
+ QUICK_REPLIES: 'quick-replies',
26
27
  } as const;
@@ -8,6 +8,7 @@ export * from "./thread-message";
8
8
  export * from "./ticket";
9
9
  export * from "./inbox";
10
10
  export * from "./waba-template";
11
+ export * from "./quick-reply";
11
12
  export declare const EvoChatPermissions: {
12
13
  readonly Read: "evo_chat_read";
13
14
  readonly Write: "evo_chat_write";
@@ -25,6 +25,7 @@ __exportStar(require("./thread-message"), exports);
25
25
  __exportStar(require("./ticket"), exports);
26
26
  __exportStar(require("./inbox"), exports);
27
27
  __exportStar(require("./waba-template"), exports);
28
+ __exportStar(require("./quick-reply"), exports);
28
29
  // Permissões para o evo-chat
29
30
  exports.EvoChatPermissions = {
30
31
  Read: "evo_chat_read",
@@ -8,6 +8,7 @@ export * from "./thread-message";
8
8
  export * from "./ticket";
9
9
  export * from "./inbox";
10
10
  export * from "./waba-template";
11
+ export * from "./quick-reply";
11
12
 
12
13
  // Permissões para o evo-chat
13
14
  export const EvoChatPermissions = {
@@ -0,0 +1,43 @@
1
+ import { IFireDoc } from '../../shared';
2
+ export type QuickReplyType = 'text' | 'image' | 'audio' | 'video' | 'document' | 'location' | 'contacts';
3
+ export type QuickReplyStatus = 'active' | 'paused';
4
+ export interface IQuickReplyMedia {
5
+ gcs_uri: string;
6
+ mime_type: string;
7
+ filename?: string;
8
+ caption?: string;
9
+ }
10
+ export interface IQuickReplyLocation {
11
+ latitude: number;
12
+ longitude: number;
13
+ name?: string;
14
+ address?: string;
15
+ }
16
+ export interface IQuickReplyContact {
17
+ name: {
18
+ formatted_name: string;
19
+ first_name?: string;
20
+ last_name?: string;
21
+ };
22
+ phones?: Array<{
23
+ phone: string;
24
+ type?: string;
25
+ }>;
26
+ }
27
+ export interface IQuickReply extends IFireDoc {
28
+ model_ver: number;
29
+ title: string;
30
+ shortcut?: string;
31
+ type: QuickReplyType;
32
+ body?: {
33
+ text: string;
34
+ };
35
+ media?: IQuickReplyMedia;
36
+ location?: IQuickReplyLocation;
37
+ contacts_payload?: IQuickReplyContact[];
38
+ department_ids: string[] | 'all';
39
+ status: QuickReplyStatus;
40
+ usage_count?: number;
41
+ last_used_at?: Date | null;
42
+ created_by?: string;
43
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,49 @@
1
+ import { IFireDoc } from '../../shared';
2
+
3
+ export type QuickReplyType = 'text' | 'image' | 'audio' | 'video' | 'document' | 'location' | 'contacts';
4
+ export type QuickReplyStatus = 'active' | 'paused';
5
+
6
+ export interface IQuickReplyMedia {
7
+ gcs_uri: string;
8
+ mime_type: string;
9
+ filename?: string;
10
+ caption?: string;
11
+ }
12
+
13
+ export interface IQuickReplyLocation {
14
+ latitude: number;
15
+ longitude: number;
16
+ name?: string;
17
+ address?: string;
18
+ }
19
+
20
+ export interface IQuickReplyContact {
21
+ name: { formatted_name: string; first_name?: string; last_name?: string };
22
+ phones?: Array<{ phone: string; type?: string }>;
23
+ }
24
+
25
+ export interface IQuickReply extends IFireDoc {
26
+ model_ver: number;
27
+
28
+ // Identificacao
29
+ title: string;
30
+ shortcut?: string;
31
+
32
+ // Conteudo
33
+ type: QuickReplyType;
34
+ body?: { text: string };
35
+ media?: IQuickReplyMedia;
36
+ location?: IQuickReplyLocation;
37
+ contacts_payload?: IQuickReplyContact[];
38
+
39
+ // Disponibilidade por departamento
40
+ department_ids: string[] | 'all';
41
+
42
+ // Status
43
+ status: QuickReplyStatus;
44
+
45
+ // Metadata
46
+ usage_count?: number;
47
+ last_used_at?: Date | null;
48
+ created_by?: string;
49
+ }
@@ -119,6 +119,10 @@ export interface IDepartment extends IFireDoc {
119
119
  parent_departmentRef?: FirestoreDocumentReference | null;
120
120
  readonly employee_counters?: IEmployeeCounters;
121
121
  tags?: ITag[] | null;
122
+ /** Must be explicitly true for the department to receive chat transfers and be used as channel default. */
123
+ chat_enabled?: boolean;
124
+ /** Color for UI rendering in hub-omni (e.g., '#4CAF50'). */
125
+ chat_color?: string;
122
126
  }
123
127
  export interface IOffice extends IFireDoc {
124
128
  code: string;
@@ -183,6 +183,11 @@ export interface IDepartment extends IFireDoc {
183
183
  parent_departmentRef?: FirestoreDocumentReference | null;
184
184
  readonly employee_counters?: IEmployeeCounters;
185
185
  tags?: ITag[] | null;
186
+
187
+ /** Must be explicitly true for the department to receive chat transfers and be used as channel default. */
188
+ chat_enabled?: boolean;
189
+ /** Color for UI rendering in hub-omni (e.g., '#4CAF50'). */
190
+ chat_color?: string;
186
191
  }
187
192
 
188
193
  export interface IOffice extends IFireDoc {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.311",
3
+ "version": "1.3.316",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",