evo360-types 1.3.292 → 1.3.296

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.
Files changed (47) hide show
  1. package/dist/apps/evo-chat/channel/zod-schemas.d.ts +129 -0
  2. package/dist/apps/evo-chat/channel/zod-schemas.js +26 -0
  3. package/dist/apps/evo-chat/channel/zod-schemas.ts +25 -0
  4. package/dist/apps/evo-chat/contact/zod-schemas.d.ts +12 -0
  5. package/dist/apps/evo-chat/contact/zod-schemas.js +5 -0
  6. package/dist/apps/evo-chat/contact/zod-schemas.ts +5 -0
  7. package/dist/apps/evo-chat/thread/zod-schemas.d.ts +99 -0
  8. package/dist/apps/evo-chat/thread/zod-schemas.js +25 -0
  9. package/dist/apps/evo-chat/thread/zod-schemas.ts +24 -0
  10. package/dist/apps/evo-chat/thread-message/zod-schemas.d.ts +522 -0
  11. package/dist/apps/evo-chat/thread-message/zod-schemas.js +72 -0
  12. package/dist/apps/evo-chat/thread-message/zod-schemas.ts +74 -0
  13. package/dist/apps/evo-chat/ticket/zod-schemas.d.ts +202 -0
  14. package/dist/apps/evo-chat/ticket/zod-schemas.js +39 -0
  15. package/dist/apps/evo-chat/ticket/zod-schemas.ts +39 -0
  16. package/dist/apps/evo-crm/dic/zod-schemas.d.ts +3 -0
  17. package/dist/apps/evo-crm/dic/zod-schemas.js +1 -0
  18. package/dist/apps/evo-crm/dic/zod-schemas.ts +1 -0
  19. package/dist/apps/evo-notif-user/zod-schemas.d.ts +2 -2
  20. package/dist/index.d.ts +4 -0
  21. package/dist/index.js +4 -0
  22. package/dist/index.ts +4 -0
  23. package/dist/types/evo-chat/channel/index.d.ts +25 -0
  24. package/dist/types/evo-chat/channel/index.js +2 -0
  25. package/dist/types/evo-chat/channel/index.ts +36 -0
  26. package/dist/types/evo-chat/contact/index.d.ts +4 -0
  27. package/dist/types/evo-chat/contact/index.ts +7 -0
  28. package/dist/types/evo-chat/fb_collections.d.ts +4 -0
  29. package/dist/types/evo-chat/fb_collections.js +6 -1
  30. package/dist/types/evo-chat/fb_collections.ts +6 -0
  31. package/dist/types/evo-chat/index.d.ts +7 -0
  32. package/dist/types/evo-chat/index.js +7 -0
  33. package/dist/types/evo-chat/index.ts +7 -0
  34. package/dist/types/evo-chat/thread/index.d.ts +20 -0
  35. package/dist/types/evo-chat/thread/index.js +2 -0
  36. package/dist/types/evo-chat/thread/index.ts +35 -0
  37. package/dist/types/evo-chat/thread-message/index.d.ts +99 -0
  38. package/dist/types/evo-chat/thread-message/index.js +2 -0
  39. package/dist/types/evo-chat/thread-message/index.ts +130 -0
  40. package/dist/types/evo-chat/ticket/index.d.ts +35 -0
  41. package/dist/types/evo-chat/ticket/index.js +2 -0
  42. package/dist/types/evo-chat/ticket/index.ts +56 -0
  43. package/dist/types/evo-crm/dic/index.d.ts +1 -0
  44. package/dist/types/evo-crm/dic/index.ts +1 -0
  45. package/dist/types/evo-finops/common/billing.js +1 -1
  46. package/dist/types/evo-finops/common/billing.ts +1 -1
  47. package/package.json +1 -1
@@ -0,0 +1,99 @@
1
+ import { IFireDoc } from "../../shared";
2
+ export type EvoChatMessageType = 'text' | 'image' | 'audio' | 'video' | 'document' | 'sticker' | 'location' | 'contacts' | 'interactive' | 'reaction' | 'template' | 'system';
3
+ export type MessageDirection = 'in' | 'out';
4
+ export interface IMessageStatus {
5
+ sent_at?: Date;
6
+ delivered_at?: Date;
7
+ read_at?: Date;
8
+ failed_at?: Date;
9
+ error_code?: string;
10
+ error_message?: string;
11
+ }
12
+ export interface IMessageMedia {
13
+ gcs_uri?: string;
14
+ url?: string;
15
+ mime_type?: string;
16
+ sha256?: string;
17
+ size_bytes?: number;
18
+ filename?: string;
19
+ caption?: string;
20
+ meta_media_id?: string;
21
+ }
22
+ export interface IMessageLocation {
23
+ latitude: number;
24
+ longitude: number;
25
+ name?: string;
26
+ address?: string;
27
+ }
28
+ export interface IMessageInteractive {
29
+ type: 'button_reply' | 'list_reply';
30
+ button_reply?: {
31
+ id: string;
32
+ title: string;
33
+ };
34
+ list_reply?: {
35
+ id: string;
36
+ title: string;
37
+ description?: string;
38
+ };
39
+ }
40
+ export interface IMessageReaction {
41
+ message_id: string;
42
+ emoji: string;
43
+ }
44
+ export interface IMessageContext {
45
+ message_id: string;
46
+ from?: string;
47
+ }
48
+ export interface IMessageCreatedBy {
49
+ type: 'human' | 'automation' | 'system';
50
+ user_id?: string;
51
+ workflow_id?: string;
52
+ }
53
+ export interface IMessagePricing {
54
+ category?: 'service' | 'utility' | 'authentication' | 'marketing';
55
+ billable?: boolean;
56
+ }
57
+ export interface IThreadMessage extends IFireDoc {
58
+ model_ver: number;
59
+ thread_id: string;
60
+ ticket_id: string;
61
+ direction: MessageDirection;
62
+ type: EvoChatMessageType | string;
63
+ channel_id: string;
64
+ channel_type: string;
65
+ provider: string;
66
+ body?: {
67
+ text?: string;
68
+ };
69
+ media?: IMessageMedia;
70
+ location?: IMessageLocation;
71
+ contacts_payload?: Array<{
72
+ name: {
73
+ formatted_name: string;
74
+ first_name?: string;
75
+ last_name?: string;
76
+ };
77
+ phones?: Array<{
78
+ phone: string;
79
+ type?: string;
80
+ }>;
81
+ }>;
82
+ interactive?: IMessageInteractive;
83
+ reaction?: IMessageReaction;
84
+ template?: {
85
+ name: string;
86
+ language: string;
87
+ components?: unknown[];
88
+ };
89
+ context?: IMessageContext;
90
+ provider_message_id?: string;
91
+ status?: IMessageStatus;
92
+ reactions?: Record<string, {
93
+ emoji: string;
94
+ reacted_at: Date;
95
+ }>;
96
+ created_by?: IMessageCreatedBy;
97
+ pricing?: IMessagePricing;
98
+ [key: string]: unknown;
99
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,130 @@
1
+ import { IFireDoc } from "../../shared";
2
+
3
+ // ── Message type/direction enums ──
4
+
5
+ export type EvoChatMessageType =
6
+ | 'text' | 'image' | 'audio' | 'video'
7
+ | 'document' | 'sticker' | 'location'
8
+ | 'contacts' | 'interactive' | 'reaction'
9
+ | 'template' | 'system';
10
+
11
+ export type MessageDirection = 'in' | 'out';
12
+
13
+ // ── Message status (outbound) ──
14
+
15
+ export interface IMessageStatus {
16
+ sent_at?: Date;
17
+ delivered_at?: Date;
18
+ read_at?: Date;
19
+ failed_at?: Date;
20
+ error_code?: string;
21
+ error_message?: string;
22
+ }
23
+
24
+ // ── Message media ──
25
+
26
+ export interface IMessageMedia {
27
+ gcs_uri?: string;
28
+ url?: string;
29
+ mime_type?: string;
30
+ sha256?: string;
31
+ size_bytes?: number;
32
+ filename?: string;
33
+ caption?: string;
34
+ meta_media_id?: string;
35
+ }
36
+
37
+ // ── Message location ──
38
+
39
+ export interface IMessageLocation {
40
+ latitude: number;
41
+ longitude: number;
42
+ name?: string;
43
+ address?: string;
44
+ }
45
+
46
+ // ── Message interactive ──
47
+
48
+ export interface IMessageInteractive {
49
+ type: 'button_reply' | 'list_reply';
50
+ button_reply?: { id: string; title: string };
51
+ list_reply?: { id: string; title: string; description?: string };
52
+ }
53
+
54
+ // ── Message reaction ──
55
+
56
+ export interface IMessageReaction {
57
+ message_id: string;
58
+ emoji: string;
59
+ }
60
+
61
+ // ── Message context (reply/quote) ──
62
+
63
+ export interface IMessageContext {
64
+ message_id: string;
65
+ from?: string;
66
+ }
67
+
68
+ // ── Message creator ──
69
+
70
+ export interface IMessageCreatedBy {
71
+ type: 'human' | 'automation' | 'system';
72
+ user_id?: string;
73
+ workflow_id?: string;
74
+ }
75
+
76
+ // ── Message pricing ──
77
+
78
+ export interface IMessagePricing {
79
+ category?: 'service' | 'utility' | 'authentication' | 'marketing';
80
+ billable?: boolean;
81
+ }
82
+
83
+ // ── Thread Message (evo-chat v3) ──
84
+
85
+ export interface IThreadMessage extends IFireDoc {
86
+ model_ver: number;
87
+ thread_id: string;
88
+ ticket_id: string;
89
+ direction: MessageDirection;
90
+ type: EvoChatMessageType | string;
91
+
92
+ // Channel origin (omnichannel)
93
+ channel_id: string;
94
+ channel_type: string;
95
+ provider: string;
96
+
97
+ // Content
98
+ body?: { text?: string };
99
+ media?: IMessageMedia;
100
+ location?: IMessageLocation;
101
+ contacts_payload?: Array<{
102
+ name: { formatted_name: string; first_name?: string; last_name?: string };
103
+ phones?: Array<{ phone: string; type?: string }>;
104
+ }>;
105
+ interactive?: IMessageInteractive;
106
+ reaction?: IMessageReaction;
107
+ template?: {
108
+ name: string;
109
+ language: string;
110
+ components?: unknown[];
111
+ };
112
+ context?: IMessageContext;
113
+
114
+ // Provider reference
115
+ provider_message_id?: string;
116
+
117
+ // Outbound status
118
+ status?: IMessageStatus;
119
+
120
+ // Received reactions
121
+ reactions?: Record<string, { emoji: string; reacted_at: Date }>;
122
+
123
+ // Creator
124
+ created_by?: IMessageCreatedBy;
125
+
126
+ // Pricing
127
+ pricing?: IMessagePricing;
128
+
129
+ [key: string]: unknown;
130
+ }
@@ -0,0 +1,35 @@
1
+ import { IFireDoc } from "../../shared";
2
+ export type TicketStatus = 'open' | 'closed';
3
+ export interface ITicketClose {
4
+ base: string;
5
+ label: string;
6
+ notes?: string;
7
+ closed_by_user_id: string;
8
+ closed_at: Date;
9
+ }
10
+ export interface ITicketCreatedBy {
11
+ type: 'human' | 'automation' | 'system';
12
+ user_id?: string;
13
+ workflow_id?: string;
14
+ }
15
+ export interface ITicket extends IFireDoc {
16
+ model_ver: number;
17
+ contact_id: string;
18
+ thread_id: string;
19
+ lead_id?: string | null;
20
+ department_id: string;
21
+ status: TicketStatus;
22
+ channel_ids: string[];
23
+ close?: ITicketClose;
24
+ system_status?: 'normal' | 'moved';
25
+ quality_indicator?: number | string;
26
+ message_count?: number;
27
+ last_message_id?: string;
28
+ last_message_at?: Date;
29
+ last_inbound_at?: Date;
30
+ last_message_preview?: string;
31
+ last_message_channel_id?: string;
32
+ assigned_user_id?: string | null;
33
+ created_by?: ITicketCreatedBy;
34
+ [key: string]: unknown;
35
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,56 @@
1
+ import { IFireDoc } from "../../shared";
2
+
3
+ // ── Ticket status ──
4
+
5
+ export type TicketStatus = 'open' | 'closed';
6
+
7
+ // ── Ticket close info ──
8
+
9
+ export interface ITicketClose {
10
+ base: string;
11
+ label: string;
12
+ notes?: string;
13
+ closed_by_user_id: string;
14
+ closed_at: Date;
15
+ }
16
+
17
+ // ── Ticket creator ──
18
+
19
+ export interface ITicketCreatedBy {
20
+ type: 'human' | 'automation' | 'system';
21
+ user_id?: string;
22
+ workflow_id?: string;
23
+ }
24
+
25
+ // ── Ticket (evo-chat v3) ──
26
+
27
+ export interface ITicket extends IFireDoc {
28
+ model_ver: number;
29
+ contact_id: string;
30
+ thread_id: string;
31
+ lead_id?: string | null;
32
+ department_id: string;
33
+ status: TicketStatus;
34
+
35
+ // Channels active during this ticket
36
+ channel_ids: string[];
37
+
38
+ close?: ITicketClose;
39
+
40
+ system_status?: 'normal' | 'moved';
41
+ quality_indicator?: number | string;
42
+ message_count?: number;
43
+
44
+ // Last message snapshot
45
+ last_message_id?: string;
46
+ last_message_at?: Date;
47
+ last_inbound_at?: Date;
48
+ last_message_preview?: string;
49
+ last_message_channel_id?: string;
50
+
51
+ assigned_user_id?: string | null;
52
+
53
+ created_by?: ITicketCreatedBy;
54
+
55
+ [key: string]: unknown;
56
+ }
@@ -57,5 +57,6 @@ export interface IQualification extends IFireDoc {
57
57
  name: string;
58
58
  funnelLevel: QualificationFunnelLevel;
59
59
  hide?: boolean;
60
+ funnelHide?: boolean;
60
61
  [key: string]: unknown;
61
62
  }
@@ -97,5 +97,6 @@ export interface IQualification extends IFireDoc {
97
97
  name: string;
98
98
  funnelLevel: QualificationFunnelLevel;
99
99
  hide?: boolean;
100
+ funnelHide?: boolean;
100
101
  [key: string]: unknown; // index signature
101
102
  }
@@ -6,6 +6,6 @@ exports.NEX_FINOPS_BILLING_STATUS_TRANSITIONS = {
6
6
  draft: ['issued', 'canceled'],
7
7
  issued: ['paid', 'overdue', 'canceled'],
8
8
  overdue: ['paid'],
9
- paid: [],
9
+ paid: ['issued'],
10
10
  canceled: [],
11
11
  };
@@ -107,6 +107,6 @@ export const NEX_FINOPS_BILLING_STATUS_TRANSITIONS: Record<NexFinopsBillingStatu
107
107
  draft: ['issued', 'canceled'],
108
108
  issued: ['paid', 'overdue', 'canceled'],
109
109
  overdue: ['paid'],
110
- paid: [],
110
+ paid: ['issued'],
111
111
  canceled: [],
112
112
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.292",
3
+ "version": "1.3.296",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",