@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.
Files changed (108) hide show
  1. package/dist/api-BwKgAJ6p.cjs +2 -0
  2. package/dist/api-BwKgAJ6p.cjs.map +1 -0
  3. package/dist/api-DRZ9vPwy.js +1360 -0
  4. package/dist/api-DRZ9vPwy.js.map +1 -0
  5. package/dist/basic.cjs +85 -85
  6. package/dist/basic.cjs.map +1 -1
  7. package/dist/basic.js +13350 -12831
  8. package/dist/basic.js.map +1 -1
  9. package/dist/core/client/api.d.ts +368 -40
  10. package/dist/core/client/chat.d.ts +55 -12
  11. package/dist/core/client/config.d.ts +13 -3
  12. package/dist/core/client/contact.d.ts +3 -13
  13. package/dist/core/errors/index.d.ts +6 -0
  14. package/dist/core/platform/audio.d.ts +38 -0
  15. package/dist/core/platform/index.d.ts +6 -2
  16. package/dist/core/platform/storage.d.ts +8 -2
  17. package/dist/core/sdk/index.d.ts +11 -0
  18. package/dist/core/tests/platform/logger.test.d.ts +1 -0
  19. package/dist/core/tests/platform/storage.test.d.ts +1 -0
  20. package/dist/core/tests/test-utils.d.ts +2 -0
  21. package/dist/core/tests/types/pub-sub.test.d.ts +1 -0
  22. package/dist/core/types/helpers.d.ts +5 -2
  23. package/dist/core/types/index.d.ts +6 -6
  24. package/dist/core/types/messages.d.ts +20 -9
  25. package/dist/core/types/pub-sub.d.ts +1 -0
  26. package/dist/core/types/schemas-v2.d.ts +10 -710
  27. package/dist/index-B5YLfjom.cjs +18 -0
  28. package/dist/index-B5YLfjom.cjs.map +1 -0
  29. package/dist/index-EZN9_jan.js +1219 -0
  30. package/dist/index-EZN9_jan.js.map +1 -0
  31. package/dist/index.cjs +1 -1
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.js +22 -874
  34. package/dist/index.js.map +1 -1
  35. package/dist/react-web/core-integration/ChatProvider.d.ts +101 -0
  36. package/dist/react-web/core-integration/components.d.ts +11 -0
  37. package/dist/react-web/core-integration/hooks/useChatMessages.d.ts +64 -0
  38. package/dist/react-web/core-integration/hooks/useChatSession.d.ts +77 -0
  39. package/dist/react-web/core-integration/hooks/useConfig.d.ts +1 -0
  40. package/dist/react-web/core-integration/hooks/useContact.d.ts +11 -0
  41. package/dist/react-web/core-integration/hooks/useLocale.d.ts +4 -0
  42. package/dist/react-web/core-integration/hooks/usePreludeData.d.ts +36 -0
  43. package/dist/react-web/core-integration/hooks/usePubsub.d.ts +2 -0
  44. package/dist/react-web/{hooks → core-integration/hooks}/useUploadFiles.d.ts +2 -2
  45. package/dist/react-web/{hooks → core-integration/hooks}/useVote.d.ts +2 -2
  46. package/dist/react-web/core-integration/hooks.d.ts +9 -0
  47. package/dist/react-web/core-integration/index.d.ts +2 -0
  48. package/dist/react-web/index.d.ts +4 -10
  49. package/dist/react-web/types/components.d.ts +6 -3
  50. package/dist/react-web/types/index.d.ts +3 -2
  51. package/dist/react-web/types/options.d.ts +4 -30
  52. package/dist/react.cjs +1 -1
  53. package/dist/react.cjs.map +1 -1
  54. package/dist/react.js +10 -46
  55. package/dist/react.js.map +1 -1
  56. package/dist/src/@components/BotOrAgentMessageGroup.d.ts +1 -2
  57. package/dist/src/@components/BotOrAgentMessageWrapper.d.ts +2 -2
  58. package/dist/src/@components/ChatEvent.component.d.ts +3 -3
  59. package/dist/src/@components/Text.component.d.ts +1 -1
  60. package/dist/src/components/button.d.ts +1 -1
  61. package/dist/src/components/dialog.d.ts +9 -9
  62. package/dist/src/designs/basic/index.d.ts +1 -1
  63. package/dist/style.css +1 -1
  64. package/dist-embed/script.js +119 -124
  65. package/dist-embed/script.js.map +1 -1
  66. package/package.json +8 -4
  67. package/dist/core/types/schemas.d.ts +0 -543
  68. package/dist/core/utils/create-fetch.d.ts +0 -24
  69. package/dist/core/utils/genId.d.ts +0 -2
  70. package/dist/core/utils/history-to-widget-messages.d.ts +0 -4
  71. package/dist/genUuid-BkZtn1k9.cjs +0 -2
  72. package/dist/genUuid-BkZtn1k9.cjs.map +0 -1
  73. package/dist/genUuid-CDpI3ugS.js +0 -136
  74. package/dist/genUuid-CDpI3ugS.js.map +0 -1
  75. package/dist/index-1bY4_hBw.cjs +0 -18
  76. package/dist/index-1bY4_hBw.cjs.map +0 -1
  77. package/dist/index-D84Xc70r.js +0 -2609
  78. package/dist/index-D84Xc70r.js.map +0 -1
  79. package/dist/package.json.d.ts +0 -157
  80. package/dist/react-web/Root.d.ts +0 -6
  81. package/dist/react-web/hooks/index.d.ts +0 -6
  82. package/dist/react-web/hooks/use-sound.d.ts +0 -13
  83. package/dist/react-web/hooks/useAbstractChat.d.ts +0 -157
  84. package/dist/react-web/hooks/useAxiosInstance.d.ts +0 -190
  85. package/dist/react-web/hooks/useSyncState.d.ts +0 -4
  86. package/dist/react-web/hooks/useTimeoutState.d.ts +0 -3
  87. package/dist/react-web/providers/ChatProvider.d.ts +0 -143
  88. package/dist/react-web/providers/ConfigDataProvider.d.ts +0 -62
  89. package/dist/react-web/providers/ContactProvider.d.ts +0 -58
  90. package/dist/react-web/providers/LocalesProvider.d.ts +0 -11
  91. package/dist/react-web/providers/componentRegistry.d.ts +0 -13
  92. package/dist/react-web/providers/use-widget-sfx.d.ts +0 -7
  93. package/dist/react-web/providers/usePreludeData.d.ts +0 -2
  94. package/dist/react-web/utils/debug.d.ts +0 -2
  95. package/dist/react-web/utils/getters.d.ts +0 -24
  96. package/dist/react-web/utils/index.d.ts +0 -1
  97. package/dist/src/hooks/useShouldCollectData.d.ts +0 -3
  98. /package/dist/core/{utils/genId.test.d.ts → tests/client/integration-perisitance.test.d.ts} +0 -0
  99. /package/dist/{react-web/hooks/use-sound.test.d.ts → core/tests/client/integration.test.d.ts} +0 -0
  100. /package/dist/{react-web/hooks/use-sync-state.test.d.ts → core/tests/platform/audio.test.d.ts} +0 -0
  101. /package/dist/react-web/{locales → core-integration/locales}/ar.locale.d.ts +0 -0
  102. /package/dist/react-web/{locales → core-integration/locales}/de.locale.d.ts +0 -0
  103. /package/dist/react-web/{locales → core-integration/locales}/en.locale.d.ts +0 -0
  104. /package/dist/react-web/{locales → core-integration/locales}/fr.locale.d.ts +0 -0
  105. /package/dist/react-web/{locales → core-integration/locales}/helper.d.ts +0 -0
  106. /package/dist/react-web/{locales → core-integration/locales}/index.d.ts +0 -0
  107. /package/dist/react-web/{locales → core-integration/locales}/nl.locale.d.ts +0 -0
  108. /package/dist/react-web/{locales → core-integration/locales}/pt.locale.d.ts +0 -0
@@ -1,710 +1,10 @@
1
- import { z } from 'zod';
2
- declare const widgetPreludeSchema: z.ZodObject<{
3
- initialQuestions: z.ZodArray<z.ZodString, "many">;
4
- aiEnabled: z.ZodBoolean;
5
- officeHours: z.ZodObject<{
6
- monday: z.ZodOptional<z.ZodObject<{
7
- from: z.ZodString;
8
- to: z.ZodString;
9
- }, "strip", z.ZodTypeAny, {
10
- from: string;
11
- to: string;
12
- }, {
13
- from: string;
14
- to: string;
15
- }>>;
16
- tuesday: z.ZodOptional<z.ZodObject<{
17
- from: z.ZodString;
18
- to: z.ZodString;
19
- }, "strip", z.ZodTypeAny, {
20
- from: string;
21
- to: string;
22
- }, {
23
- from: string;
24
- to: string;
25
- }>>;
26
- wednesday: z.ZodOptional<z.ZodObject<{
27
- from: z.ZodString;
28
- to: z.ZodString;
29
- }, "strip", z.ZodTypeAny, {
30
- from: string;
31
- to: string;
32
- }, {
33
- from: string;
34
- to: string;
35
- }>>;
36
- thursday: z.ZodOptional<z.ZodObject<{
37
- from: z.ZodString;
38
- to: z.ZodString;
39
- }, "strip", z.ZodTypeAny, {
40
- from: string;
41
- to: string;
42
- }, {
43
- from: string;
44
- to: string;
45
- }>>;
46
- friday: z.ZodOptional<z.ZodObject<{
47
- from: z.ZodString;
48
- to: z.ZodString;
49
- }, "strip", z.ZodTypeAny, {
50
- from: string;
51
- to: string;
52
- }, {
53
- from: string;
54
- to: string;
55
- }>>;
56
- saturday: z.ZodOptional<z.ZodObject<{
57
- from: z.ZodString;
58
- to: z.ZodString;
59
- }, "strip", z.ZodTypeAny, {
60
- from: string;
61
- to: string;
62
- }, {
63
- from: string;
64
- to: string;
65
- }>>;
66
- sunday: z.ZodOptional<z.ZodObject<{
67
- from: z.ZodString;
68
- to: z.ZodString;
69
- }, "strip", z.ZodTypeAny, {
70
- from: string;
71
- to: string;
72
- }, {
73
- from: string;
74
- to: string;
75
- }>>;
76
- Everyday: z.ZodOptional<z.ZodObject<{
77
- from: z.ZodString;
78
- to: z.ZodString;
79
- }, "strip", z.ZodTypeAny, {
80
- from: string;
81
- to: string;
82
- }, {
83
- from: string;
84
- to: string;
85
- }>>;
86
- WeekDays: z.ZodOptional<z.ZodObject<{
87
- from: z.ZodString;
88
- to: z.ZodString;
89
- }, "strip", z.ZodTypeAny, {
90
- from: string;
91
- to: string;
92
- }, {
93
- from: string;
94
- to: string;
95
- }>>;
96
- }, "strip", z.ZodTypeAny, {
97
- monday?: {
98
- from: string;
99
- to: string;
100
- } | undefined;
101
- tuesday?: {
102
- from: string;
103
- to: string;
104
- } | undefined;
105
- wednesday?: {
106
- from: string;
107
- to: string;
108
- } | undefined;
109
- thursday?: {
110
- from: string;
111
- to: string;
112
- } | undefined;
113
- friday?: {
114
- from: string;
115
- to: string;
116
- } | undefined;
117
- saturday?: {
118
- from: string;
119
- to: string;
120
- } | undefined;
121
- sunday?: {
122
- from: string;
123
- to: string;
124
- } | undefined;
125
- Everyday?: {
126
- from: string;
127
- to: string;
128
- } | undefined;
129
- WeekDays?: {
130
- from: string;
131
- to: string;
132
- } | undefined;
133
- }, {
134
- monday?: {
135
- from: string;
136
- to: string;
137
- } | undefined;
138
- tuesday?: {
139
- from: string;
140
- to: string;
141
- } | undefined;
142
- wednesday?: {
143
- from: string;
144
- to: string;
145
- } | undefined;
146
- thursday?: {
147
- from: string;
148
- to: string;
149
- } | undefined;
150
- friday?: {
151
- from: string;
152
- to: string;
153
- } | undefined;
154
- saturday?: {
155
- from: string;
156
- to: string;
157
- } | undefined;
158
- sunday?: {
159
- from: string;
160
- to: string;
161
- } | undefined;
162
- Everyday?: {
163
- from: string;
164
- to: string;
165
- } | undefined;
166
- WeekDays?: {
167
- from: string;
168
- to: string;
169
- } | undefined;
170
- }>;
171
- officeHoursTimezone: z.ZodNullable<z.ZodString>;
172
- organizationName: z.ZodString;
173
- }, "strip", z.ZodTypeAny, {
174
- initialQuestions: string[];
175
- aiEnabled: boolean;
176
- officeHours: {
177
- monday?: {
178
- from: string;
179
- to: string;
180
- } | undefined;
181
- tuesday?: {
182
- from: string;
183
- to: string;
184
- } | undefined;
185
- wednesday?: {
186
- from: string;
187
- to: string;
188
- } | undefined;
189
- thursday?: {
190
- from: string;
191
- to: string;
192
- } | undefined;
193
- friday?: {
194
- from: string;
195
- to: string;
196
- } | undefined;
197
- saturday?: {
198
- from: string;
199
- to: string;
200
- } | undefined;
201
- sunday?: {
202
- from: string;
203
- to: string;
204
- } | undefined;
205
- Everyday?: {
206
- from: string;
207
- to: string;
208
- } | undefined;
209
- WeekDays?: {
210
- from: string;
211
- to: string;
212
- } | undefined;
213
- };
214
- officeHoursTimezone: string | null;
215
- organizationName: string;
216
- }, {
217
- initialQuestions: string[];
218
- aiEnabled: boolean;
219
- officeHours: {
220
- monday?: {
221
- from: string;
222
- to: string;
223
- } | undefined;
224
- tuesday?: {
225
- from: string;
226
- to: string;
227
- } | undefined;
228
- wednesday?: {
229
- from: string;
230
- to: string;
231
- } | undefined;
232
- thursday?: {
233
- from: string;
234
- to: string;
235
- } | undefined;
236
- friday?: {
237
- from: string;
238
- to: string;
239
- } | undefined;
240
- saturday?: {
241
- from: string;
242
- to: string;
243
- } | undefined;
244
- sunday?: {
245
- from: string;
246
- to: string;
247
- } | undefined;
248
- Everyday?: {
249
- from: string;
250
- to: string;
251
- } | undefined;
252
- WeekDays?: {
253
- from: string;
254
- to: string;
255
- } | undefined;
256
- };
257
- officeHoursTimezone: string | null;
258
- organizationName: string;
259
- }>;
260
- export declare const chatAttachmentSchema: z.ZodObject<{
261
- id: z.ZodString;
262
- name: z.ZodString;
263
- size: z.ZodNumber;
264
- type: z.ZodString;
265
- url: z.ZodString;
266
- }, "strip", z.ZodTypeAny, {
267
- type: string;
268
- id: string;
269
- name: string;
270
- size: number;
271
- url: string;
272
- }, {
273
- type: string;
274
- id: string;
275
- name: string;
276
- size: number;
277
- url: string;
278
- }>;
279
- export declare enum MessageTypeEnum {
280
- MESSAGE = "message",
281
- HANDOFF = "handoff",
282
- HANDOFF_TO_ZENDESK = "handoff_to_zendesk",
283
- AGENT_MESSAGE = "agent_message",
284
- AGENT_JOINED = "agent_joined",
285
- AGENT_COMMENT = "agent_comment",
286
- AGENT_TOOK_SESSION_FROM_AI = "agent_took_session_from_ai",
287
- AGENT_REOPENED_SESSION = "agent_reopened_session",
288
- AI_DECIDED_TO_RESOLVE_THE_ISSUE = "ai_decided_to_resolve_the_issue",
289
- EMAIL_DRAFT_MESSAGE = "email_draft_message",
290
- FOLLOWUP = "followup",
291
- AI_ASSUMED_THE_SESSION_RESOLVED = "ai_assumed_the_session_resolved",
292
- CONTACT_RESOLVED_THE_SESSION = "user_confirmed_the_session_resolved"
293
- }
294
- declare const widgetHistorySchema: z.ZodObject<{
295
- publicId: z.ZodString;
296
- type: z.ZodNativeEnum<typeof MessageTypeEnum>;
297
- sender: z.ZodObject<{
298
- kind: z.ZodEnum<["user", "agent", "ai", "none", "unknown"]>;
299
- name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
300
- avatar: z.ZodNullable<z.ZodOptional<z.ZodString>>;
301
- }, "strip", z.ZodTypeAny, {
302
- kind: "unknown" | "user" | "agent" | "ai" | "none";
303
- name?: string | null | undefined;
304
- avatar?: string | null | undefined;
305
- }, {
306
- kind: "unknown" | "user" | "agent" | "ai" | "none";
307
- name?: string | null | undefined;
308
- avatar?: string | null | undefined;
309
- }>;
310
- content: z.ZodObject<{
311
- text: z.ZodNullable<z.ZodOptional<z.ZodString>>;
312
- }, "strip", z.ZodTypeAny, {
313
- text?: string | null | undefined;
314
- }, {
315
- text?: string | null | undefined;
316
- }>;
317
- sentAt: z.ZodNullable<z.ZodOptional<z.ZodString>>;
318
- actionCalls: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
319
- actionName: z.ZodString;
320
- args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
321
- result: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
322
- }, "strip", z.ZodTypeAny, {
323
- actionName: string;
324
- args: Record<string, unknown>;
325
- result?: Record<string, unknown> | null | undefined;
326
- }, {
327
- actionName: string;
328
- args: Record<string, unknown>;
329
- result?: Record<string, unknown> | null | undefined;
330
- }>, "many">>>;
331
- attachments: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
332
- id: z.ZodString;
333
- name: z.ZodString;
334
- size: z.ZodNumber;
335
- type: z.ZodString;
336
- url: z.ZodString;
337
- }, "strip", z.ZodTypeAny, {
338
- type: string;
339
- id: string;
340
- name: string;
341
- size: number;
342
- url: string;
343
- }, {
344
- type: string;
345
- id: string;
346
- name: string;
347
- size: number;
348
- url: string;
349
- }>, "many">>>;
350
- }, "strip", z.ZodTypeAny, {
351
- type: MessageTypeEnum;
352
- publicId: string;
353
- sender: {
354
- kind: "unknown" | "user" | "agent" | "ai" | "none";
355
- name?: string | null | undefined;
356
- avatar?: string | null | undefined;
357
- };
358
- content: {
359
- text?: string | null | undefined;
360
- };
361
- sentAt?: string | null | undefined;
362
- actionCalls?: {
363
- actionName: string;
364
- args: Record<string, unknown>;
365
- result?: Record<string, unknown> | null | undefined;
366
- }[] | null | undefined;
367
- attachments?: {
368
- type: string;
369
- id: string;
370
- name: string;
371
- size: number;
372
- url: string;
373
- }[] | null | undefined;
374
- }, {
375
- type: MessageTypeEnum;
376
- publicId: string;
377
- sender: {
378
- kind: "unknown" | "user" | "agent" | "ai" | "none";
379
- name?: string | null | undefined;
380
- avatar?: string | null | undefined;
381
- };
382
- content: {
383
- text?: string | null | undefined;
384
- };
385
- sentAt?: string | null | undefined;
386
- actionCalls?: {
387
- actionName: string;
388
- args: Record<string, unknown>;
389
- result?: Record<string, unknown> | null | undefined;
390
- }[] | null | undefined;
391
- attachments?: {
392
- type: string;
393
- id: string;
394
- name: string;
395
- size: number;
396
- url: string;
397
- }[] | null | undefined;
398
- }>;
399
- declare const widgetSessionSchema: z.ZodObject<{
400
- id: z.ZodString;
401
- createdAt: z.ZodDate;
402
- updatedAt: z.ZodDate;
403
- isHandedOff: z.ZodBoolean;
404
- isOpened: z.ZodBoolean;
405
- assignee: z.ZodObject<{
406
- kind: z.ZodEnum<["human", "ai", "none", "unknown"]>;
407
- name: z.ZodNullable<z.ZodString>;
408
- }, "strip", z.ZodTypeAny, {
409
- name: string | null;
410
- kind: "unknown" | "ai" | "none" | "human";
411
- }, {
412
- name: string | null;
413
- kind: "unknown" | "ai" | "none" | "human";
414
- }>;
415
- channel: z.ZodString;
416
- }, "strip", z.ZodTypeAny, {
417
- id: string;
418
- createdAt: Date;
419
- updatedAt: Date;
420
- isHandedOff: boolean;
421
- isOpened: boolean;
422
- assignee: {
423
- name: string | null;
424
- kind: "unknown" | "ai" | "none" | "human";
425
- };
426
- channel: string;
427
- }, {
428
- id: string;
429
- createdAt: Date;
430
- updatedAt: Date;
431
- isHandedOff: boolean;
432
- isOpened: boolean;
433
- assignee: {
434
- name: string | null;
435
- kind: "unknown" | "ai" | "none" | "human";
436
- };
437
- channel: string;
438
- }>;
439
- declare const httpChatInputDto: z.ZodObject<{
440
- content: z.ZodString;
441
- session_id: z.ZodString;
442
- headers: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
443
- bot_token: z.ZodString;
444
- query_params: z.ZodNullable<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
445
- user: z.ZodNullable<z.ZodOptional<z.ZodObject<{
446
- email: z.ZodOptional<z.ZodString>;
447
- name: z.ZodOptional<z.ZodString>;
448
- phone: z.ZodOptional<z.ZodString>;
449
- avatar: z.ZodOptional<z.ZodString>;
450
- customData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
451
- }, "strip", z.ZodTypeAny, {
452
- name?: string | undefined;
453
- avatar?: string | undefined;
454
- email?: string | undefined;
455
- phone?: string | undefined;
456
- customData?: Record<string, string> | undefined;
457
- }, {
458
- name?: string | undefined;
459
- avatar?: string | undefined;
460
- email?: string | undefined;
461
- phone?: string | undefined;
462
- customData?: Record<string, string> | undefined;
463
- }>>>;
464
- language: z.ZodNullable<z.ZodOptional<z.ZodString>>;
465
- attachments: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
466
- id: z.ZodString;
467
- name: z.ZodString;
468
- size: z.ZodNumber;
469
- type: z.ZodString;
470
- url: z.ZodString;
471
- }, "strip", z.ZodTypeAny, {
472
- type: string;
473
- id: string;
474
- name: string;
475
- size: number;
476
- url: string;
477
- }, {
478
- type: string;
479
- id: string;
480
- name: string;
481
- size: number;
482
- url: string;
483
- }>, "many">>>;
484
- }, "strip", z.ZodTypeAny, {
485
- content: string;
486
- session_id: string;
487
- bot_token: string;
488
- user?: {
489
- name?: string | undefined;
490
- avatar?: string | undefined;
491
- email?: string | undefined;
492
- phone?: string | undefined;
493
- customData?: Record<string, string> | undefined;
494
- } | null | undefined;
495
- attachments?: {
496
- type: string;
497
- id: string;
498
- name: string;
499
- size: number;
500
- url: string;
501
- }[] | null | undefined;
502
- headers?: Record<string, string> | null | undefined;
503
- query_params?: Record<string, string> | null | undefined;
504
- language?: string | null | undefined;
505
- }, {
506
- content: string;
507
- session_id: string;
508
- bot_token: string;
509
- user?: {
510
- name?: string | undefined;
511
- avatar?: string | undefined;
512
- email?: string | undefined;
513
- phone?: string | undefined;
514
- customData?: Record<string, string> | undefined;
515
- } | null | undefined;
516
- attachments?: {
517
- type: string;
518
- id: string;
519
- name: string;
520
- size: number;
521
- url: string;
522
- }[] | null | undefined;
523
- headers?: Record<string, string> | null | undefined;
524
- query_params?: Record<string, string> | null | undefined;
525
- language?: string | null | undefined;
526
- }>;
527
- declare const handleContactMessageOutputSchema: z.ZodDiscriminatedUnion<"success", [z.ZodObject<{
528
- success: z.ZodLiteral<true>;
529
- code: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"session_assigned_to_human_agent">]>>;
530
- options: z.ZodOptional<z.ZodObject<{
531
- type: z.ZodLiteral<"options">;
532
- value: z.ZodArray<z.ZodString, "many">;
533
- }, "strip", z.ZodTypeAny, {
534
- type: "options";
535
- value: string[];
536
- }, {
537
- type: "options";
538
- value: string[];
539
- }>>;
540
- autopilotResponse: z.ZodOptional<z.ZodObject<{
541
- type: z.ZodLiteral<"text">;
542
- value: z.ZodObject<{
543
- error: z.ZodBoolean;
544
- content: z.ZodString;
545
- }, "strip", z.ZodTypeAny, {
546
- content: string;
547
- error: boolean;
548
- }, {
549
- content: string;
550
- error: boolean;
551
- }>;
552
- id: z.ZodOptional<z.ZodString>;
553
- }, "strip", z.ZodTypeAny, {
554
- type: "text";
555
- value: {
556
- content: string;
557
- error: boolean;
558
- };
559
- id?: string | undefined;
560
- }, {
561
- type: "text";
562
- value: {
563
- content: string;
564
- error: boolean;
565
- };
566
- id?: string | undefined;
567
- }>>;
568
- uiResponse: z.ZodOptional<z.ZodObject<{
569
- type: z.ZodLiteral<"ui">;
570
- value: z.ZodObject<{
571
- type: z.ZodLiteral<"ui_component">;
572
- request_response: z.ZodUnknown;
573
- name: z.ZodString;
574
- content: z.ZodOptional<z.ZodString>;
575
- }, "strip", z.ZodTypeAny, {
576
- type: "ui_component";
577
- name: string;
578
- content?: string | undefined;
579
- request_response?: unknown;
580
- }, {
581
- type: "ui_component";
582
- name: string;
583
- content?: string | undefined;
584
- request_response?: unknown;
585
- }>;
586
- }, "strip", z.ZodTypeAny, {
587
- type: "ui";
588
- value: {
589
- type: "ui_component";
590
- name: string;
591
- content?: string | undefined;
592
- request_response?: unknown;
593
- };
594
- }, {
595
- type: "ui";
596
- value: {
597
- type: "ui_component";
598
- name: string;
599
- content?: string | undefined;
600
- request_response?: unknown;
601
- };
602
- }>>;
603
- sessionIsHandedOff: z.ZodOptional<z.ZodBoolean>;
604
- }, "strip", z.ZodTypeAny, {
605
- success: true;
606
- code?: string | undefined;
607
- options?: {
608
- type: "options";
609
- value: string[];
610
- } | undefined;
611
- autopilotResponse?: {
612
- type: "text";
613
- value: {
614
- content: string;
615
- error: boolean;
616
- };
617
- id?: string | undefined;
618
- } | undefined;
619
- uiResponse?: {
620
- type: "ui";
621
- value: {
622
- type: "ui_component";
623
- name: string;
624
- content?: string | undefined;
625
- request_response?: unknown;
626
- };
627
- } | undefined;
628
- sessionIsHandedOff?: boolean | undefined;
629
- }, {
630
- success: true;
631
- code?: string | undefined;
632
- options?: {
633
- type: "options";
634
- value: string[];
635
- } | undefined;
636
- autopilotResponse?: {
637
- type: "text";
638
- value: {
639
- content: string;
640
- error: boolean;
641
- };
642
- id?: string | undefined;
643
- } | undefined;
644
- uiResponse?: {
645
- type: "ui";
646
- value: {
647
- type: "ui_component";
648
- name: string;
649
- content?: string | undefined;
650
- request_response?: unknown;
651
- };
652
- } | undefined;
653
- sessionIsHandedOff?: boolean | undefined;
654
- }>, z.ZodObject<{
655
- success: z.ZodLiteral<false>;
656
- error: z.ZodObject<{
657
- code: z.ZodOptional<z.ZodString>;
658
- message: z.ZodOptional<z.ZodString>;
659
- }, "strip", z.ZodTypeAny, {
660
- code?: string | undefined;
661
- message?: string | undefined;
662
- }, {
663
- code?: string | undefined;
664
- message?: string | undefined;
665
- }>;
666
- }, "strip", z.ZodTypeAny, {
667
- success: false;
668
- error: {
669
- code?: string | undefined;
670
- message?: string | undefined;
671
- };
672
- }, {
673
- success: false;
674
- error: {
675
- code?: string | undefined;
676
- message?: string | undefined;
677
- };
678
- }>]>;
679
- declare const widgetVoteSchema: z.ZodObject<{
680
- action: z.ZodEnum<["upvote", "downvote"]>;
681
- sessionId: z.ZodString;
682
- messagePublicId: z.ZodString;
683
- }, "strip", z.ZodTypeAny, {
684
- action: "upvote" | "downvote";
685
- sessionId: string;
686
- messagePublicId: string;
687
- }, {
688
- action: "upvote" | "downvote";
689
- sessionId: string;
690
- messagePublicId: string;
691
- }>;
692
- declare const widgetVoteResponseSchema: z.ZodObject<{
693
- messagePublicId: z.ZodNullable<z.ZodString>;
694
- success: z.ZodBoolean;
695
- }, "strip", z.ZodTypeAny, {
696
- success: boolean;
697
- messagePublicId: string | null;
698
- }, {
699
- success: boolean;
700
- messagePublicId: string | null;
701
- }>;
702
- export type WidgetVoteResponseSchema = z.infer<typeof widgetVoteResponseSchema>;
703
- export type HandleContactMessageOutputSchema = z.infer<typeof handleContactMessageOutputSchema>;
704
- export type HttpChatInputSchema = z.infer<typeof httpChatInputDto>;
705
- export type WidgetSessionSchema = z.infer<typeof widgetSessionSchema>;
706
- export type WidgetHistorySchema = z.infer<typeof widgetHistorySchema>;
707
- export type WidgetPreludeSchema = z.infer<typeof widgetPreludeSchema>;
708
- export type WidgetVoteSchema = z.infer<typeof widgetVoteSchema>;
709
- export type ChatAttachmentType = z.infer<typeof chatAttachmentSchema>;
710
- export {};
1
+ import { Dto } from '../sdk';
2
+ export type WidgetVoteResponseDto = Dto['WidgetVoteResponseDto'];
3
+ export type HandleContactMessageOutputSchema = Dto['HandleContactMessageOutputDto'];
4
+ export type SendChatDto = Dto['HttpChatInputDto'];
5
+ export type WidgetSessionDto = Dto['WidgetSessionDto'];
6
+ export type WidgetHistoryDto = Dto['WidgetHistoryDto'];
7
+ export type WidgetPreludeDto = Dto['WidgetPreludeDto'];
8
+ export type WidgetVoteDto = Dto['WidgetVoteDto'];
9
+ export type ChatAttachmentType = NonNullable<Dto['WidgetHistoryDto']['attachments']>[number];
10
+ export type MessageTypeU = Dto['WidgetHistoryDto']['type'];