@opencx/widget 2.5.1 → 2.6.1
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/api-BwKgAJ6p.cjs +2 -0
- package/dist/api-BwKgAJ6p.cjs.map +1 -0
- package/dist/api-DRZ9vPwy.js +1360 -0
- package/dist/api-DRZ9vPwy.js.map +1 -0
- package/dist/basic.cjs +85 -85
- package/dist/basic.cjs.map +1 -1
- package/dist/basic.js +13350 -12831
- package/dist/basic.js.map +1 -1
- package/dist/core/client/api.d.ts +368 -40
- package/dist/core/client/chat.d.ts +55 -12
- package/dist/core/client/config.d.ts +13 -3
- package/dist/core/client/contact.d.ts +3 -13
- package/dist/core/errors/index.d.ts +6 -0
- package/dist/core/platform/audio.d.ts +38 -0
- package/dist/core/platform/index.d.ts +6 -2
- package/dist/core/platform/storage.d.ts +8 -2
- package/dist/core/sdk/index.d.ts +11 -0
- package/dist/core/tests/platform/logger.test.d.ts +1 -0
- package/dist/core/tests/platform/storage.test.d.ts +1 -0
- package/dist/core/tests/test-utils.d.ts +2 -0
- package/dist/core/tests/types/pub-sub.test.d.ts +1 -0
- package/dist/core/types/helpers.d.ts +5 -2
- package/dist/core/types/index.d.ts +6 -6
- package/dist/core/types/messages.d.ts +20 -9
- package/dist/core/types/pub-sub.d.ts +1 -0
- package/dist/core/types/schemas-v2.d.ts +10 -710
- package/dist/index-B5YLfjom.cjs +18 -0
- package/dist/index-B5YLfjom.cjs.map +1 -0
- package/dist/index-EZN9_jan.js +1219 -0
- package/dist/index-EZN9_jan.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -874
- package/dist/index.js.map +1 -1
- package/dist/react-web/core-integration/ChatProvider.d.ts +101 -0
- package/dist/react-web/core-integration/components.d.ts +11 -0
- package/dist/react-web/core-integration/hooks/useChatMessages.d.ts +64 -0
- package/dist/react-web/core-integration/hooks/useChatSession.d.ts +77 -0
- package/dist/react-web/core-integration/hooks/useConfig.d.ts +1 -0
- package/dist/react-web/core-integration/hooks/useContact.d.ts +11 -0
- package/dist/react-web/core-integration/hooks/useLocale.d.ts +4 -0
- package/dist/react-web/core-integration/hooks/usePreludeData.d.ts +36 -0
- package/dist/react-web/core-integration/hooks/usePubsub.d.ts +2 -0
- package/dist/react-web/{hooks → core-integration/hooks}/useUploadFiles.d.ts +2 -2
- package/dist/react-web/{hooks → core-integration/hooks}/useVote.d.ts +2 -2
- package/dist/react-web/core-integration/hooks.d.ts +9 -0
- package/dist/react-web/core-integration/index.d.ts +2 -0
- package/dist/react-web/index.d.ts +4 -10
- package/dist/react-web/types/components.d.ts +6 -3
- package/dist/react-web/types/index.d.ts +3 -2
- package/dist/react-web/types/options.d.ts +4 -30
- package/dist/react.cjs +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +10 -46
- package/dist/react.js.map +1 -1
- package/dist/src/@components/BotOrAgentMessageGroup.d.ts +1 -2
- package/dist/src/@components/BotOrAgentMessageWrapper.d.ts +2 -2
- package/dist/src/@components/ChatEvent.component.d.ts +3 -3
- package/dist/src/@components/Text.component.d.ts +1 -1
- package/dist/src/components/button.d.ts +1 -1
- package/dist/src/components/dialog.d.ts +9 -9
- package/dist/src/designs/basic/index.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist-embed/script.js +119 -124
- package/dist-embed/script.js.map +1 -1
- package/package.json +8 -4
- package/dist/core/types/schemas.d.ts +0 -543
- package/dist/core/utils/create-fetch.d.ts +0 -24
- package/dist/core/utils/genId.d.ts +0 -2
- package/dist/core/utils/history-to-widget-messages.d.ts +0 -4
- package/dist/genUuid-BkZtn1k9.cjs +0 -2
- package/dist/genUuid-BkZtn1k9.cjs.map +0 -1
- package/dist/genUuid-CDpI3ugS.js +0 -136
- package/dist/genUuid-CDpI3ugS.js.map +0 -1
- package/dist/index-1bY4_hBw.cjs +0 -18
- package/dist/index-1bY4_hBw.cjs.map +0 -1
- package/dist/index-D84Xc70r.js +0 -2609
- package/dist/index-D84Xc70r.js.map +0 -1
- package/dist/package.json.d.ts +0 -157
- package/dist/react-web/Root.d.ts +0 -6
- package/dist/react-web/hooks/index.d.ts +0 -6
- package/dist/react-web/hooks/use-sound.d.ts +0 -13
- package/dist/react-web/hooks/useAbstractChat.d.ts +0 -157
- package/dist/react-web/hooks/useAxiosInstance.d.ts +0 -190
- package/dist/react-web/hooks/useSyncState.d.ts +0 -4
- package/dist/react-web/hooks/useTimeoutState.d.ts +0 -3
- package/dist/react-web/providers/ChatProvider.d.ts +0 -143
- package/dist/react-web/providers/ConfigDataProvider.d.ts +0 -62
- package/dist/react-web/providers/ContactProvider.d.ts +0 -58
- package/dist/react-web/providers/LocalesProvider.d.ts +0 -11
- package/dist/react-web/providers/componentRegistry.d.ts +0 -13
- package/dist/react-web/providers/use-widget-sfx.d.ts +0 -7
- package/dist/react-web/providers/usePreludeData.d.ts +0 -2
- package/dist/react-web/utils/debug.d.ts +0 -2
- package/dist/react-web/utils/getters.d.ts +0 -24
- package/dist/react-web/utils/index.d.ts +0 -1
- package/dist/src/hooks/useShouldCollectData.d.ts +0 -3
- /package/dist/core/{utils/genId.test.d.ts → tests/client/integration-perisitance.test.d.ts} +0 -0
- /package/dist/{react-web/hooks/use-sound.test.d.ts → core/tests/client/integration.test.d.ts} +0 -0
- /package/dist/{react-web/hooks/use-sync-state.test.d.ts → core/tests/platform/audio.test.d.ts} +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/ar.locale.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/de.locale.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/en.locale.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/fr.locale.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/helper.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/index.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/nl.locale.d.ts +0 -0
- /package/dist/react-web/{locales → core-integration/locales}/pt.locale.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opencx/widget",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.6.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"react-hot-toast": "^2.4.1",
|
|
38
38
|
"tinycolor2": "^1.6.0",
|
|
39
39
|
"uuid": "^11.0.4",
|
|
40
|
+
"whatwg-fetch": "^3.6.20",
|
|
40
41
|
"zod": "^3.23.8"
|
|
41
42
|
},
|
|
42
43
|
"overrides": {
|
|
@@ -116,6 +117,8 @@
|
|
|
116
117
|
"class-variance-authority": "^0.7.0",
|
|
117
118
|
"jsdom": "^25.0.1",
|
|
118
119
|
"mutative": "^1.0.11",
|
|
120
|
+
"openapi-fetch": "^0.13.4",
|
|
121
|
+
"openapi-typescript": "^7.5.2",
|
|
119
122
|
"postcss": "^8.4.41",
|
|
120
123
|
"postcss-prefix-selector": "^1.16.1",
|
|
121
124
|
"react": "^18.3.1",
|
|
@@ -138,17 +141,18 @@
|
|
|
138
141
|
"scripts": {
|
|
139
142
|
"clean": "rm -rf ./dist ./dist-embed",
|
|
140
143
|
"clean:dist": "rm -rf ./dist ./dist-embed",
|
|
141
|
-
"build:lib": "vite build",
|
|
142
144
|
"dev": "vite -c vite.config.ts",
|
|
145
|
+
"build:lib": "vite build",
|
|
143
146
|
"build:embed": "vite build -c vite.embed.config.ts",
|
|
147
|
+
"gen:sdk": "npx openapi-typescript http://localhost:8080/widget-api-yaml -o ./core/sdk/schema.d.ts",
|
|
144
148
|
"test": "vitest run",
|
|
145
|
-
"batman": "pnpm build:lib && pnpm build:embed",
|
|
146
149
|
"test:watch": "vitest --watch",
|
|
147
150
|
"cs": "changeset",
|
|
148
151
|
"csv": "changeset version",
|
|
149
152
|
"csp": "changeset publish",
|
|
150
153
|
"type-check": "tsc --noEmit",
|
|
151
154
|
"lint": "biome lint --fix",
|
|
152
|
-
"format": "biome format --fix"
|
|
155
|
+
"format": "biome format --fix",
|
|
156
|
+
"batman": "pnpm build:lib && pnpm build:embed"
|
|
153
157
|
}
|
|
154
158
|
}
|
|
@@ -1,543 +0,0 @@
|
|
|
1
|
-
import { default as z } from 'zod';
|
|
2
|
-
import { chatAttachmentSchema } from './schemas-v2';
|
|
3
|
-
export declare enum SessionStatus {
|
|
4
|
-
OPEN = 0,
|
|
5
|
-
CLOSED_RESOLVED = 1,
|
|
6
|
-
CLOSED_UNRESOLVED = 2
|
|
7
|
-
}
|
|
8
|
-
export declare enum SessionChannel {
|
|
9
|
-
WEB = "web",
|
|
10
|
-
WEB_VOICE = "web_voice",
|
|
11
|
-
PHONE_VOICE = "phone_voice",
|
|
12
|
-
EMAIL = "email",
|
|
13
|
-
SMS = "sms",
|
|
14
|
-
WHATSAPP = "whatsapp",
|
|
15
|
-
API = "api"
|
|
16
|
-
}
|
|
17
|
-
export declare enum AIClosureType {
|
|
18
|
-
resolved = "resolved",
|
|
19
|
-
assumed_resolved = "assumed_resolved",
|
|
20
|
-
handed_off = "handed_off"
|
|
21
|
-
}
|
|
22
|
-
export declare enum SentimentEnum {
|
|
23
|
-
happy = "happy",
|
|
24
|
-
neutral = "neutral",
|
|
25
|
-
angry = "angry"
|
|
26
|
-
}
|
|
27
|
-
export declare enum MessageTypeEnum {
|
|
28
|
-
MESSAGE = "message",
|
|
29
|
-
HANDOFF = "handoff",
|
|
30
|
-
HANDOFF_TO_ZENDESK = "handoff_to_zendesk",
|
|
31
|
-
AGENT_MESSAGE = "agent_message",
|
|
32
|
-
AGENT_JOINED = "agent_joined",
|
|
33
|
-
AGENT_TOOK_SESSION_FROM_AI = "agent_took_session_from_ai",
|
|
34
|
-
AI_DECIDED_TO_RESOLVE_THE_ISSUE = "ai_decided_to_resolve_the_issue",
|
|
35
|
-
EMAIL_DRAFT_MESSAGE = "email_draft_message",
|
|
36
|
-
FOLLOWUP = "followup"
|
|
37
|
-
}
|
|
38
|
-
export declare const chatSessionSchema: z.ZodObject<{
|
|
39
|
-
id: z.ZodString;
|
|
40
|
-
ai_closure_type: z.ZodNullable<z.ZodNativeEnum<typeof AIClosureType>>;
|
|
41
|
-
assignee_id: z.ZodNullable<z.ZodNumber>;
|
|
42
|
-
channel: z.ZodNativeEnum<typeof SessionChannel>;
|
|
43
|
-
summary: z.ZodNullable<z.ZodString>;
|
|
44
|
-
status: z.ZodNativeEnum<typeof SessionStatus>;
|
|
45
|
-
language: z.ZodNullable<z.ZodString>;
|
|
46
|
-
last_message: z.ZodNullable<z.ZodString>;
|
|
47
|
-
last_message_at: z.ZodNullable<z.ZodDate>;
|
|
48
|
-
assignee: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
49
|
-
name: z.ZodString;
|
|
50
|
-
email: z.ZodString;
|
|
51
|
-
avatar_url: z.ZodOptional<z.ZodString>;
|
|
52
|
-
}, "strip", z.ZodTypeAny, {
|
|
53
|
-
name: string;
|
|
54
|
-
email: string;
|
|
55
|
-
avatar_url?: string | undefined;
|
|
56
|
-
}, {
|
|
57
|
-
name: string;
|
|
58
|
-
email: string;
|
|
59
|
-
avatar_url?: string | undefined;
|
|
60
|
-
}>>>;
|
|
61
|
-
sentiment: z.ZodNullable<z.ZodNativeEnum<typeof SentimentEnum>>;
|
|
62
|
-
}, "strip", z.ZodTypeAny, {
|
|
63
|
-
status: SessionStatus;
|
|
64
|
-
id: string;
|
|
65
|
-
channel: SessionChannel;
|
|
66
|
-
language: string | null;
|
|
67
|
-
ai_closure_type: AIClosureType | null;
|
|
68
|
-
assignee_id: number | null;
|
|
69
|
-
summary: string | null;
|
|
70
|
-
last_message: string | null;
|
|
71
|
-
last_message_at: Date | null;
|
|
72
|
-
sentiment: SentimentEnum | null;
|
|
73
|
-
assignee?: {
|
|
74
|
-
name: string;
|
|
75
|
-
email: string;
|
|
76
|
-
avatar_url?: string | undefined;
|
|
77
|
-
} | null | undefined;
|
|
78
|
-
}, {
|
|
79
|
-
status: SessionStatus;
|
|
80
|
-
id: string;
|
|
81
|
-
channel: SessionChannel;
|
|
82
|
-
language: string | null;
|
|
83
|
-
ai_closure_type: AIClosureType | null;
|
|
84
|
-
assignee_id: number | null;
|
|
85
|
-
summary: string | null;
|
|
86
|
-
last_message: string | null;
|
|
87
|
-
last_message_at: Date | null;
|
|
88
|
-
sentiment: SentimentEnum | null;
|
|
89
|
-
assignee?: {
|
|
90
|
-
name: string;
|
|
91
|
-
email: string;
|
|
92
|
-
avatar_url?: string | undefined;
|
|
93
|
-
} | null | undefined;
|
|
94
|
-
}>;
|
|
95
|
-
export declare const chatHistoryMessageSchema: z.ZodObject<{
|
|
96
|
-
publicId: z.ZodString;
|
|
97
|
-
message: z.ZodNullable<z.ZodString>;
|
|
98
|
-
type: z.ZodNullable<z.ZodString>;
|
|
99
|
-
agent_avatar: z.ZodNullable<z.ZodString>;
|
|
100
|
-
agent_id: z.ZodNullable<z.ZodNumber>;
|
|
101
|
-
agent_name: z.ZodNullable<z.ZodString>;
|
|
102
|
-
created_at: z.ZodString;
|
|
103
|
-
from_user: z.ZodNullable<z.ZodBoolean>;
|
|
104
|
-
handoff_happened_during_office_hours: z.ZodNullable<z.ZodBoolean>;
|
|
105
|
-
session_id: z.ZodString;
|
|
106
|
-
updated_at: z.ZodNullable<z.ZodString>;
|
|
107
|
-
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
108
|
-
id: z.ZodString;
|
|
109
|
-
name: z.ZodString;
|
|
110
|
-
size: z.ZodNumber;
|
|
111
|
-
type: z.ZodString;
|
|
112
|
-
url: z.ZodString;
|
|
113
|
-
}, "strip", z.ZodTypeAny, {
|
|
114
|
-
type: string;
|
|
115
|
-
id: string;
|
|
116
|
-
name: string;
|
|
117
|
-
size: number;
|
|
118
|
-
url: string;
|
|
119
|
-
}, {
|
|
120
|
-
type: string;
|
|
121
|
-
id: string;
|
|
122
|
-
name: string;
|
|
123
|
-
size: number;
|
|
124
|
-
url: string;
|
|
125
|
-
}>, "many">>;
|
|
126
|
-
}, "strip", z.ZodTypeAny, {
|
|
127
|
-
message: string | null;
|
|
128
|
-
type: string | null;
|
|
129
|
-
publicId: string;
|
|
130
|
-
session_id: string;
|
|
131
|
-
agent_avatar: string | null;
|
|
132
|
-
agent_id: number | null;
|
|
133
|
-
agent_name: string | null;
|
|
134
|
-
created_at: string;
|
|
135
|
-
from_user: boolean | null;
|
|
136
|
-
handoff_happened_during_office_hours: boolean | null;
|
|
137
|
-
updated_at: string | null;
|
|
138
|
-
attachments?: {
|
|
139
|
-
type: string;
|
|
140
|
-
id: string;
|
|
141
|
-
name: string;
|
|
142
|
-
size: number;
|
|
143
|
-
url: string;
|
|
144
|
-
}[] | undefined;
|
|
145
|
-
}, {
|
|
146
|
-
message: string | null;
|
|
147
|
-
type: string | null;
|
|
148
|
-
publicId: string;
|
|
149
|
-
session_id: string;
|
|
150
|
-
agent_avatar: string | null;
|
|
151
|
-
agent_id: number | null;
|
|
152
|
-
agent_name: string | null;
|
|
153
|
-
created_at: string;
|
|
154
|
-
from_user: boolean | null;
|
|
155
|
-
handoff_happened_during_office_hours: boolean | null;
|
|
156
|
-
updated_at: string | null;
|
|
157
|
-
attachments?: {
|
|
158
|
-
type: string;
|
|
159
|
-
id: string;
|
|
160
|
-
name: string;
|
|
161
|
-
size: number;
|
|
162
|
-
url: string;
|
|
163
|
-
}[] | undefined;
|
|
164
|
-
}>;
|
|
165
|
-
declare const agentSchema: z.ZodObject<{
|
|
166
|
-
name: z.ZodString;
|
|
167
|
-
is_ai: z.ZodBoolean;
|
|
168
|
-
profile_picture: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
169
|
-
id: z.ZodNullable<z.ZodString>;
|
|
170
|
-
}, "strip", z.ZodTypeAny, {
|
|
171
|
-
id: string | null;
|
|
172
|
-
name: string;
|
|
173
|
-
is_ai: boolean;
|
|
174
|
-
profile_picture?: string | null | undefined;
|
|
175
|
-
}, {
|
|
176
|
-
id: string | null;
|
|
177
|
-
name: string;
|
|
178
|
-
is_ai: boolean;
|
|
179
|
-
profile_picture?: string | null | undefined;
|
|
180
|
-
}>;
|
|
181
|
-
export declare const structuredSocketMessageSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
182
|
-
type: z.ZodLiteral<"message">;
|
|
183
|
-
value: z.ZodString;
|
|
184
|
-
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
185
|
-
id: z.ZodString;
|
|
186
|
-
name: z.ZodString;
|
|
187
|
-
size: z.ZodNumber;
|
|
188
|
-
type: z.ZodString;
|
|
189
|
-
url: z.ZodString;
|
|
190
|
-
}, "strip", z.ZodTypeAny, {
|
|
191
|
-
type: string;
|
|
192
|
-
id: string;
|
|
193
|
-
name: string;
|
|
194
|
-
size: number;
|
|
195
|
-
url: string;
|
|
196
|
-
}, {
|
|
197
|
-
type: string;
|
|
198
|
-
id: string;
|
|
199
|
-
name: string;
|
|
200
|
-
size: number;
|
|
201
|
-
url: string;
|
|
202
|
-
}>, "many">>;
|
|
203
|
-
is_stream_chunk: z.ZodOptional<z.ZodBoolean>;
|
|
204
|
-
server_session_id: z.ZodString;
|
|
205
|
-
client_message_id: z.ZodOptional<z.ZodString>;
|
|
206
|
-
server_message_id: z.ZodString;
|
|
207
|
-
}, "strip", z.ZodTypeAny, {
|
|
208
|
-
type: "message";
|
|
209
|
-
value: string;
|
|
210
|
-
server_session_id: string;
|
|
211
|
-
server_message_id: string;
|
|
212
|
-
attachments?: {
|
|
213
|
-
type: string;
|
|
214
|
-
id: string;
|
|
215
|
-
name: string;
|
|
216
|
-
size: number;
|
|
217
|
-
url: string;
|
|
218
|
-
}[] | undefined;
|
|
219
|
-
is_stream_chunk?: boolean | undefined;
|
|
220
|
-
client_message_id?: string | undefined;
|
|
221
|
-
}, {
|
|
222
|
-
type: "message";
|
|
223
|
-
value: string;
|
|
224
|
-
server_session_id: string;
|
|
225
|
-
server_message_id: string;
|
|
226
|
-
attachments?: {
|
|
227
|
-
type: string;
|
|
228
|
-
id: string;
|
|
229
|
-
name: string;
|
|
230
|
-
size: number;
|
|
231
|
-
url: string;
|
|
232
|
-
}[] | undefined;
|
|
233
|
-
is_stream_chunk?: boolean | undefined;
|
|
234
|
-
client_message_id?: string | undefined;
|
|
235
|
-
}>, z.ZodObject<{
|
|
236
|
-
type: z.ZodLiteral<"info">;
|
|
237
|
-
value: z.ZodString;
|
|
238
|
-
}, "strip", z.ZodTypeAny, {
|
|
239
|
-
type: "info";
|
|
240
|
-
value: string;
|
|
241
|
-
}, {
|
|
242
|
-
type: "info";
|
|
243
|
-
value: string;
|
|
244
|
-
}>, z.ZodObject<{
|
|
245
|
-
type: z.ZodLiteral<"ui">;
|
|
246
|
-
value: z.ZodObject<{
|
|
247
|
-
type: z.ZodString;
|
|
248
|
-
request_response: z.ZodAny;
|
|
249
|
-
name: z.ZodString;
|
|
250
|
-
content: z.ZodString;
|
|
251
|
-
message_id: z.ZodOptional<z.ZodString>;
|
|
252
|
-
}, "strip", z.ZodTypeAny, {
|
|
253
|
-
type: string;
|
|
254
|
-
name: string;
|
|
255
|
-
content: string;
|
|
256
|
-
request_response?: any;
|
|
257
|
-
message_id?: string | undefined;
|
|
258
|
-
}, {
|
|
259
|
-
type: string;
|
|
260
|
-
name: string;
|
|
261
|
-
content: string;
|
|
262
|
-
request_response?: any;
|
|
263
|
-
message_id?: string | undefined;
|
|
264
|
-
}>;
|
|
265
|
-
client_message_id: z.ZodOptional<z.ZodString>;
|
|
266
|
-
server_session_id: z.ZodString;
|
|
267
|
-
}, "strip", z.ZodTypeAny, {
|
|
268
|
-
type: "ui";
|
|
269
|
-
value: {
|
|
270
|
-
type: string;
|
|
271
|
-
name: string;
|
|
272
|
-
content: string;
|
|
273
|
-
request_response?: any;
|
|
274
|
-
message_id?: string | undefined;
|
|
275
|
-
};
|
|
276
|
-
server_session_id: string;
|
|
277
|
-
client_message_id?: string | undefined;
|
|
278
|
-
}, {
|
|
279
|
-
type: "ui";
|
|
280
|
-
value: {
|
|
281
|
-
type: string;
|
|
282
|
-
name: string;
|
|
283
|
-
content: string;
|
|
284
|
-
request_response?: any;
|
|
285
|
-
message_id?: string | undefined;
|
|
286
|
-
};
|
|
287
|
-
server_session_id: string;
|
|
288
|
-
client_message_id?: string | undefined;
|
|
289
|
-
}>, z.ZodObject<{
|
|
290
|
-
type: z.ZodLiteral<"chat_event">;
|
|
291
|
-
value: z.ZodObject<{
|
|
292
|
-
event: z.ZodNativeEnum<typeof MessageTypeEnum>;
|
|
293
|
-
message: z.ZodString;
|
|
294
|
-
}, "strip", z.ZodTypeAny, {
|
|
295
|
-
message: string;
|
|
296
|
-
event: MessageTypeEnum;
|
|
297
|
-
}, {
|
|
298
|
-
message: string;
|
|
299
|
-
event: MessageTypeEnum;
|
|
300
|
-
}>;
|
|
301
|
-
}, "strip", z.ZodTypeAny, {
|
|
302
|
-
type: "chat_event";
|
|
303
|
-
value: {
|
|
304
|
-
message: string;
|
|
305
|
-
event: MessageTypeEnum;
|
|
306
|
-
};
|
|
307
|
-
}, {
|
|
308
|
-
type: "chat_event";
|
|
309
|
-
value: {
|
|
310
|
-
message: string;
|
|
311
|
-
event: MessageTypeEnum;
|
|
312
|
-
};
|
|
313
|
-
}>, z.ZodObject<{
|
|
314
|
-
type: z.ZodLiteral<"options">;
|
|
315
|
-
value: z.ZodObject<{
|
|
316
|
-
options: z.ZodArray<z.ZodString, "many">;
|
|
317
|
-
}, "strip", z.ZodTypeAny, {
|
|
318
|
-
options: string[];
|
|
319
|
-
}, {
|
|
320
|
-
options: string[];
|
|
321
|
-
}>;
|
|
322
|
-
server_session_id: z.ZodString;
|
|
323
|
-
}, "strip", z.ZodTypeAny, {
|
|
324
|
-
type: "options";
|
|
325
|
-
value: {
|
|
326
|
-
options: string[];
|
|
327
|
-
};
|
|
328
|
-
server_session_id: string;
|
|
329
|
-
}, {
|
|
330
|
-
type: "options";
|
|
331
|
-
value: {
|
|
332
|
-
options: string[];
|
|
333
|
-
};
|
|
334
|
-
server_session_id: string;
|
|
335
|
-
}>, z.ZodObject<{
|
|
336
|
-
type: z.ZodLiteral<"session_update">;
|
|
337
|
-
value: z.ZodObject<{
|
|
338
|
-
session: z.ZodObject<{
|
|
339
|
-
id: z.ZodString;
|
|
340
|
-
ai_closure_type: z.ZodNullable<z.ZodNativeEnum<typeof AIClosureType>>;
|
|
341
|
-
assignee_id: z.ZodNullable<z.ZodNumber>;
|
|
342
|
-
channel: z.ZodNativeEnum<typeof SessionChannel>;
|
|
343
|
-
summary: z.ZodNullable<z.ZodString>;
|
|
344
|
-
status: z.ZodNativeEnum<typeof SessionStatus>;
|
|
345
|
-
language: z.ZodNullable<z.ZodString>;
|
|
346
|
-
last_message: z.ZodNullable<z.ZodString>;
|
|
347
|
-
last_message_at: z.ZodNullable<z.ZodDate>;
|
|
348
|
-
assignee: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
349
|
-
name: z.ZodString;
|
|
350
|
-
email: z.ZodString;
|
|
351
|
-
avatar_url: z.ZodOptional<z.ZodString>;
|
|
352
|
-
}, "strip", z.ZodTypeAny, {
|
|
353
|
-
name: string;
|
|
354
|
-
email: string;
|
|
355
|
-
avatar_url?: string | undefined;
|
|
356
|
-
}, {
|
|
357
|
-
name: string;
|
|
358
|
-
email: string;
|
|
359
|
-
avatar_url?: string | undefined;
|
|
360
|
-
}>>>;
|
|
361
|
-
sentiment: z.ZodNullable<z.ZodNativeEnum<typeof SentimentEnum>>;
|
|
362
|
-
}, "strip", z.ZodTypeAny, {
|
|
363
|
-
status: SessionStatus;
|
|
364
|
-
id: string;
|
|
365
|
-
channel: SessionChannel;
|
|
366
|
-
language: string | null;
|
|
367
|
-
ai_closure_type: AIClosureType | null;
|
|
368
|
-
assignee_id: number | null;
|
|
369
|
-
summary: string | null;
|
|
370
|
-
last_message: string | null;
|
|
371
|
-
last_message_at: Date | null;
|
|
372
|
-
sentiment: SentimentEnum | null;
|
|
373
|
-
assignee?: {
|
|
374
|
-
name: string;
|
|
375
|
-
email: string;
|
|
376
|
-
avatar_url?: string | undefined;
|
|
377
|
-
} | null | undefined;
|
|
378
|
-
}, {
|
|
379
|
-
status: SessionStatus;
|
|
380
|
-
id: string;
|
|
381
|
-
channel: SessionChannel;
|
|
382
|
-
language: string | null;
|
|
383
|
-
ai_closure_type: AIClosureType | null;
|
|
384
|
-
assignee_id: number | null;
|
|
385
|
-
summary: string | null;
|
|
386
|
-
last_message: string | null;
|
|
387
|
-
last_message_at: Date | null;
|
|
388
|
-
sentiment: SentimentEnum | null;
|
|
389
|
-
assignee?: {
|
|
390
|
-
name: string;
|
|
391
|
-
email: string;
|
|
392
|
-
avatar_url?: string | undefined;
|
|
393
|
-
} | null | undefined;
|
|
394
|
-
}>;
|
|
395
|
-
}, "strip", z.ZodTypeAny, {
|
|
396
|
-
session: {
|
|
397
|
-
status: SessionStatus;
|
|
398
|
-
id: string;
|
|
399
|
-
channel: SessionChannel;
|
|
400
|
-
language: string | null;
|
|
401
|
-
ai_closure_type: AIClosureType | null;
|
|
402
|
-
assignee_id: number | null;
|
|
403
|
-
summary: string | null;
|
|
404
|
-
last_message: string | null;
|
|
405
|
-
last_message_at: Date | null;
|
|
406
|
-
sentiment: SentimentEnum | null;
|
|
407
|
-
assignee?: {
|
|
408
|
-
name: string;
|
|
409
|
-
email: string;
|
|
410
|
-
avatar_url?: string | undefined;
|
|
411
|
-
} | null | undefined;
|
|
412
|
-
};
|
|
413
|
-
}, {
|
|
414
|
-
session: {
|
|
415
|
-
status: SessionStatus;
|
|
416
|
-
id: string;
|
|
417
|
-
channel: SessionChannel;
|
|
418
|
-
language: string | null;
|
|
419
|
-
ai_closure_type: AIClosureType | null;
|
|
420
|
-
assignee_id: number | null;
|
|
421
|
-
summary: string | null;
|
|
422
|
-
last_message: string | null;
|
|
423
|
-
last_message_at: Date | null;
|
|
424
|
-
sentiment: SentimentEnum | null;
|
|
425
|
-
assignee?: {
|
|
426
|
-
name: string;
|
|
427
|
-
email: string;
|
|
428
|
-
avatar_url?: string | undefined;
|
|
429
|
-
} | null | undefined;
|
|
430
|
-
};
|
|
431
|
-
}>;
|
|
432
|
-
server_session_id: z.ZodString;
|
|
433
|
-
}, "strip", z.ZodTypeAny, {
|
|
434
|
-
type: "session_update";
|
|
435
|
-
value: {
|
|
436
|
-
session: {
|
|
437
|
-
status: SessionStatus;
|
|
438
|
-
id: string;
|
|
439
|
-
channel: SessionChannel;
|
|
440
|
-
language: string | null;
|
|
441
|
-
ai_closure_type: AIClosureType | null;
|
|
442
|
-
assignee_id: number | null;
|
|
443
|
-
summary: string | null;
|
|
444
|
-
last_message: string | null;
|
|
445
|
-
last_message_at: Date | null;
|
|
446
|
-
sentiment: SentimentEnum | null;
|
|
447
|
-
assignee?: {
|
|
448
|
-
name: string;
|
|
449
|
-
email: string;
|
|
450
|
-
avatar_url?: string | undefined;
|
|
451
|
-
} | null | undefined;
|
|
452
|
-
};
|
|
453
|
-
};
|
|
454
|
-
server_session_id: string;
|
|
455
|
-
}, {
|
|
456
|
-
type: "session_update";
|
|
457
|
-
value: {
|
|
458
|
-
session: {
|
|
459
|
-
status: SessionStatus;
|
|
460
|
-
id: string;
|
|
461
|
-
channel: SessionChannel;
|
|
462
|
-
language: string | null;
|
|
463
|
-
ai_closure_type: AIClosureType | null;
|
|
464
|
-
assignee_id: number | null;
|
|
465
|
-
summary: string | null;
|
|
466
|
-
last_message: string | null;
|
|
467
|
-
last_message_at: Date | null;
|
|
468
|
-
sentiment: SentimentEnum | null;
|
|
469
|
-
assignee?: {
|
|
470
|
-
name: string;
|
|
471
|
-
email: string;
|
|
472
|
-
avatar_url?: string | undefined;
|
|
473
|
-
} | null | undefined;
|
|
474
|
-
};
|
|
475
|
-
};
|
|
476
|
-
server_session_id: string;
|
|
477
|
-
}>]>, z.ZodObject<{
|
|
478
|
-
timestamp: z.ZodString;
|
|
479
|
-
agent: z.ZodObject<{
|
|
480
|
-
name: z.ZodString;
|
|
481
|
-
is_ai: z.ZodBoolean;
|
|
482
|
-
profile_picture: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
483
|
-
id: z.ZodNullable<z.ZodString>;
|
|
484
|
-
}, "strip", z.ZodTypeAny, {
|
|
485
|
-
id: string | null;
|
|
486
|
-
name: string;
|
|
487
|
-
is_ai: boolean;
|
|
488
|
-
profile_picture?: string | null | undefined;
|
|
489
|
-
}, {
|
|
490
|
-
id: string | null;
|
|
491
|
-
name: string;
|
|
492
|
-
is_ai: boolean;
|
|
493
|
-
profile_picture?: string | null | undefined;
|
|
494
|
-
}>;
|
|
495
|
-
}, "strip", z.ZodTypeAny, {
|
|
496
|
-
agent: {
|
|
497
|
-
id: string | null;
|
|
498
|
-
name: string;
|
|
499
|
-
is_ai: boolean;
|
|
500
|
-
profile_picture?: string | null | undefined;
|
|
501
|
-
};
|
|
502
|
-
timestamp: string;
|
|
503
|
-
}, {
|
|
504
|
-
agent: {
|
|
505
|
-
id: string | null;
|
|
506
|
-
name: string;
|
|
507
|
-
is_ai: boolean;
|
|
508
|
-
profile_picture?: string | null | undefined;
|
|
509
|
-
};
|
|
510
|
-
timestamp: string;
|
|
511
|
-
}>>;
|
|
512
|
-
export declare const consumerSchema: z.ZodObject<{
|
|
513
|
-
id: z.ZodString;
|
|
514
|
-
name: z.ZodNullable<z.ZodString>;
|
|
515
|
-
created_at: z.ZodString;
|
|
516
|
-
avatar_url: z.ZodNullable<z.ZodString>;
|
|
517
|
-
email: z.ZodNullable<z.ZodString>;
|
|
518
|
-
}, "strip", z.ZodTypeAny, {
|
|
519
|
-
id: string;
|
|
520
|
-
name: string | null;
|
|
521
|
-
email: string | null;
|
|
522
|
-
avatar_url: string | null;
|
|
523
|
-
created_at: string;
|
|
524
|
-
}, {
|
|
525
|
-
id: string;
|
|
526
|
-
name: string | null;
|
|
527
|
-
email: string | null;
|
|
528
|
-
avatar_url: string | null;
|
|
529
|
-
created_at: string;
|
|
530
|
-
}>;
|
|
531
|
-
type AgentType = z.infer<typeof agentSchema>;
|
|
532
|
-
type ConsumerType = z.infer<typeof consumerSchema>;
|
|
533
|
-
type ChatSessionType = z.infer<typeof chatSessionSchema>;
|
|
534
|
-
type ChatSessionWithStatus = ChatSessionType & {
|
|
535
|
-
isSessionClosed: boolean;
|
|
536
|
-
isAssignedToAi: boolean;
|
|
537
|
-
isAssignedToHuman: boolean;
|
|
538
|
-
isPendingHuman: boolean;
|
|
539
|
-
};
|
|
540
|
-
type StructuredSocketMessageType = z.infer<typeof structuredSocketMessageSchema>;
|
|
541
|
-
type ChatHistoryMessageType = z.infer<typeof chatHistoryMessageSchema>;
|
|
542
|
-
type ChatAttachmentType = z.infer<typeof chatAttachmentSchema>;
|
|
543
|
-
export type { AgentType, ConsumerType, ChatSessionType, StructuredSocketMessageType, ChatHistoryMessageType, ChatAttachmentType, ChatSessionWithStatus, };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
type RequestInterceptor = (config: RequestConfig) => RequestConfig | Promise<RequestConfig>;
|
|
2
|
-
type ResponseInterceptor = (response: Response) => Response | Promise<Response>;
|
|
3
|
-
type ErrorInterceptor = (error: any) => any;
|
|
4
|
-
interface RequestConfig extends RequestInit {
|
|
5
|
-
baseURL?: string;
|
|
6
|
-
headers?: HeadersInit;
|
|
7
|
-
params?: Record<string, string>;
|
|
8
|
-
}
|
|
9
|
-
export interface CustomFetch {
|
|
10
|
-
(url: string, config?: RequestConfig): Promise<Response>;
|
|
11
|
-
interceptors: {
|
|
12
|
-
request: {
|
|
13
|
-
use: (interceptor: RequestInterceptor) => number;
|
|
14
|
-
eject: (id: number) => void;
|
|
15
|
-
};
|
|
16
|
-
response: {
|
|
17
|
-
use: (interceptor: ResponseInterceptor, errorInterceptor?: ErrorInterceptor) => number;
|
|
18
|
-
eject: (id: number) => void;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export declare function createFetch(defaultConfig?: RequestConfig): CustomFetch;
|
|
23
|
-
export declare function handleJsonResponse<T>(response: Response): Promise<T>;
|
|
24
|
-
export {};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const n=require("zod"),i=require("uuid"),o=n.z.object({from:n.z.string(),to:n.z.string()}),s=n.z.object({monday:o.optional(),tuesday:o.optional(),wednesday:o.optional(),thursday:o.optional(),friday:o.optional(),saturday:o.optional(),sunday:o.optional(),Everyday:o.optional(),WeekDays:o.optional()});n.z.object({initialQuestions:n.z.array(n.z.string()),aiEnabled:n.z.boolean(),officeHours:s,officeHoursTimezone:n.z.string().nullable(),organizationName:n.z.string()});const e=n.z.object({id:n.z.string(),name:n.z.string(),size:n.z.number(),type:n.z.string(),url:n.z.string()});var a=(t=>(t.MESSAGE="message",t.HANDOFF="handoff",t.HANDOFF_TO_ZENDESK="handoff_to_zendesk",t.AGENT_MESSAGE="agent_message",t.AGENT_JOINED="agent_joined",t.AGENT_COMMENT="agent_comment",t.AGENT_TOOK_SESSION_FROM_AI="agent_took_session_from_ai",t.AGENT_REOPENED_SESSION="agent_reopened_session",t.AI_DECIDED_TO_RESOLVE_THE_ISSUE="ai_decided_to_resolve_the_issue",t.EMAIL_DRAFT_MESSAGE="email_draft_message",t.FOLLOWUP="followup",t.AI_ASSUMED_THE_SESSION_RESOLVED="ai_assumed_the_session_resolved",t.CONTACT_RESOLVED_THE_SESSION="user_confirmed_the_session_resolved",t))(a||{});n.z.object({publicId:n.z.string(),type:n.z.nativeEnum(a),sender:n.z.object({kind:n.z.enum(["user","agent","ai","none","unknown"]),name:n.z.string().optional().nullable(),avatar:n.z.string().optional().nullable()}),content:n.z.object({text:n.z.string().optional().nullable()}),sentAt:n.z.string().optional().nullable(),actionCalls:n.z.array(n.z.object({actionName:n.z.string(),args:n.z.record(n.z.string(),n.z.unknown()),result:n.z.record(n.z.string(),n.z.unknown()).optional().nullable()})).optional().nullable(),attachments:n.z.array(e).optional().nullable()});n.z.object({id:n.z.string().uuid(),createdAt:n.z.date(),updatedAt:n.z.date(),isHandedOff:n.z.boolean(),isOpened:n.z.boolean(),assignee:n.z.object({kind:n.z.enum(["human","ai","none","unknown"]),name:n.z.string().nullable()}),channel:n.z.string()});n.z.object({content:n.z.string(),session_id:n.z.string(),headers:n.z.record(n.z.string(),n.z.string()).optional().nullable(),bot_token:n.z.string(),query_params:n.z.record(n.z.string(),n.z.string()).optional().nullable(),user:n.z.object({email:n.z.string().optional(),name:n.z.string().optional(),phone:n.z.string().optional(),avatar:n.z.string().optional(),customData:n.z.record(n.z.string(),n.z.string()).optional()}).optional().nullable(),language:n.z.string().optional().nullable(),attachments:n.z.array(e).optional().nullable()});n.z.discriminatedUnion("success",[n.z.object({success:n.z.literal(!0),code:n.z.union([n.z.string(),n.z.literal("session_assigned_to_human_agent")]).optional(),options:n.z.object({type:n.z.literal("options"),value:n.z.array(n.z.string())}).optional(),autopilotResponse:n.z.object({type:n.z.literal("text"),value:n.z.object({error:n.z.boolean(),content:n.z.string()}),id:n.z.string().optional()}).optional(),uiResponse:n.z.object({type:n.z.literal("ui"),value:n.z.object({type:n.z.literal("ui_component"),request_response:n.z.unknown(),name:n.z.string(),content:n.z.string().optional()})}).optional(),sessionIsHandedOff:n.z.boolean().optional()}),n.z.object({success:n.z.literal(!1),error:n.z.object({code:n.z.string().optional(),message:n.z.string().optional()})})]);n.z.object({action:n.z.enum(["upvote","downvote"]),sessionId:n.z.string(),messagePublicId:n.z.string()});n.z.object({messagePublicId:n.z.string().nullable(),success:n.z.boolean()});function l(){return i.v4()}exports.MessageTypeEnum=a;exports.chatAttachmentSchema=e;exports.genUuid=l;
|
|
2
|
-
//# sourceMappingURL=genUuid-BkZtn1k9.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"genUuid-BkZtn1k9.cjs","sources":["../core/types/schemas-v2.ts","../core/utils/genUuid.ts"],"sourcesContent":["import { z } from \"zod\";\n\nconst DayOfficeHoursSchema = z.object({\n from: z.string(),\n to: z.string(),\n})\n\nconst officeHoursSchema = z.object({\n monday: DayOfficeHoursSchema.optional(),\n tuesday: DayOfficeHoursSchema.optional(),\n wednesday: DayOfficeHoursSchema.optional(),\n thursday: DayOfficeHoursSchema.optional(),\n friday: DayOfficeHoursSchema.optional(),\n saturday: DayOfficeHoursSchema.optional(),\n sunday: DayOfficeHoursSchema.optional(),\n Everyday: DayOfficeHoursSchema.optional(),\n WeekDays: DayOfficeHoursSchema.optional(),\n});\n\nconst widgetPreludeSchema = z.object({\n initialQuestions: z.array(z.string()),\n aiEnabled: z.boolean(),\n officeHours: officeHoursSchema,\n officeHoursTimezone: z.string().nullable(),\n organizationName: z.string(),\n})\n\nexport const chatAttachmentSchema = z.object({\n id: z.string(),\n name: z.string(),\n size: z.number(),\n type: z.string(),\n url: z.string(),\n});\n\nexport enum MessageTypeEnum {\n MESSAGE = 'message',\n HANDOFF = 'handoff',\n HANDOFF_TO_ZENDESK = 'handoff_to_zendesk',\n AGENT_MESSAGE = 'agent_message',\n AGENT_JOINED = 'agent_joined',\n AGENT_COMMENT = 'agent_comment',\n AGENT_TOOK_SESSION_FROM_AI = 'agent_took_session_from_ai',\n AGENT_REOPENED_SESSION = 'agent_reopened_session',\n AI_DECIDED_TO_RESOLVE_THE_ISSUE = 'ai_decided_to_resolve_the_issue',\n EMAIL_DRAFT_MESSAGE = 'email_draft_message',\n FOLLOWUP = 'followup',\n AI_ASSUMED_THE_SESSION_RESOLVED = 'ai_assumed_the_session_resolved',\n CONTACT_RESOLVED_THE_SESSION = 'user_confirmed_the_session_resolved',\n}\n\nconst widgetHistorySchema = z.object({\n publicId: z.string(),\n type: z.nativeEnum(MessageTypeEnum),\n sender: z.object({\n kind: z.enum(['user', 'agent', 'ai', 'none', 'unknown']),\n name: z.string().optional().nullable(),\n avatar: z.string().optional().nullable(),\n }),\n content: z.object({\n text: z.string().optional().nullable(),\n }),\n sentAt: z.string().optional().nullable(),\n actionCalls: z\n .array(\n z.object({\n actionName: z.string(),\n args: z.record(z.string(), z.unknown()),\n result: z.record(z.string(), z.unknown()).optional().nullable(),\n }),\n )\n .optional()\n .nullable(),\n attachments: z.array(chatAttachmentSchema).optional().nullable(),\n})\n\nconst widgetSessionSchema = z.object({\n id: z.string().uuid(),\n createdAt: z.date(),\n updatedAt: z.date(),\n isHandedOff: z.boolean(),\n isOpened: z.boolean(),\n assignee: z.object({\n kind: z.enum(['human', 'ai', 'none', 'unknown']),\n name: z.string().nullable(),\n }),\n channel: z.string(),\n})\n\nconst httpChatInputDto = z.object({\n content: z.string(),\n session_id: z.string(),\n headers: z.record(z.string(), z.string()).optional().nullable(),\n bot_token: z.string(),\n query_params: z.record(z.string(), z.string()).optional().nullable(),\n user: z\n .object({\n email: z.string().optional(),\n name: z.string().optional(),\n phone: z.string().optional(),\n avatar: z.string().optional(),\n customData: z.record(z.string(), z.string()).optional(),\n })\n .optional()\n .nullable(),\n language: z.string().optional().nullable(),\n attachments: z.array(chatAttachmentSchema).optional().nullable(),\n})\n\nconst handleContactMessageOutputSchema = z.discriminatedUnion(\n 'success',\n [\n z.object({\n success: z.literal(true),\n code: z.union([z.string(), z.literal(\"session_assigned_to_human_agent\")]).optional(),\n options: z\n .object({\n type: z.literal('options'),\n value: z.array(z.string()),\n })\n .optional(),\n autopilotResponse: z\n .object({\n type: z.literal('text'),\n value: z.object({\n error: z.boolean(),\n content: z.string(),\n }),\n id: z.string().optional(),\n })\n .optional(),\n uiResponse: z\n .object({\n type: z.literal('ui'),\n value: z.object({\n type: z.literal('ui_component'),\n request_response: z.unknown(),\n name: z.string(),\n content: z.string().optional(),\n }),\n })\n .optional(),\n sessionIsHandedOff: z.boolean().optional(),\n }),\n z.object({\n success: z.literal(false),\n error: z.object({\n code: z.string().optional(),\n message: z.string().optional(),\n }),\n }),\n ],\n);\n\nconst widgetVoteSchema = z.object({\n action: z.enum(['upvote', 'downvote']),\n sessionId: z.string(),\n messagePublicId: z.string(),\n});\n\nconst widgetVoteResponseSchema = z.object({\n messagePublicId: z.string().nullable(),\n success: z.boolean(),\n});\n\nexport type WidgetVoteResponseSchema = z.infer<typeof widgetVoteResponseSchema>;\nexport type HandleContactMessageOutputSchema = z.infer<typeof handleContactMessageOutputSchema>;\nexport type HttpChatInputSchema = z.infer<typeof httpChatInputDto>;\nexport type WidgetSessionSchema = z.infer<typeof widgetSessionSchema>;\nexport type WidgetHistorySchema = z.infer<typeof widgetHistorySchema>;\nexport type WidgetPreludeSchema = z.infer<typeof widgetPreludeSchema>;\nexport type WidgetVoteSchema = z.infer<typeof widgetVoteSchema>;\nexport type ChatAttachmentType = z.infer<typeof chatAttachmentSchema>;\n","import { v4 as uuidv4 } from \"uuid\";\n\nexport function genUuid() {\n return uuidv4();\n}\n"],"names":["DayOfficeHoursSchema","z","officeHoursSchema","chatAttachmentSchema","MessageTypeEnum","genUuid","uuidv4"],"mappings":"sDAEMA,EAAuBC,IAAE,OAAO,CAClC,KAAMA,IAAE,OAAO,EACf,GAAIA,IAAE,OAAO,CACjB,CAAC,EAEKC,EAAoBD,IAAE,OAAO,CAC/B,OAAQD,EAAqB,SAAS,EACtC,QAASA,EAAqB,SAAS,EACvC,UAAWA,EAAqB,SAAS,EACzC,SAAUA,EAAqB,SAAS,EACxC,OAAQA,EAAqB,SAAS,EACtC,SAAUA,EAAqB,SAAS,EACxC,OAAQA,EAAqB,SAAS,EACtC,SAAUA,EAAqB,SAAS,EACxC,SAAUA,EAAqB,SAAS,CAC5C,CAAC,EAE2BC,IAAE,OAAO,CACjC,iBAAkBA,EAAAA,EAAE,MAAMA,EAAA,EAAE,QAAQ,EACpC,UAAWA,IAAE,QAAQ,EACrB,YAAaC,EACb,oBAAqBD,EAAA,EAAE,OAAO,EAAE,SAAS,EACzC,iBAAkBA,IAAE,OAAO,CAC/B,CAAC,EAEY,MAAAE,EAAuBF,IAAE,OAAO,CACzC,GAAIA,IAAE,OAAO,EACb,KAAMA,IAAE,OAAO,EACf,KAAMA,IAAE,OAAO,EACf,KAAMA,IAAE,OAAO,EACf,IAAKA,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