@opencx/widget 3.0.63 → 3.0.65

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 (48) hide show
  1. package/README.md +12 -12
  2. package/dist/designs.cjs +18 -18
  3. package/dist/designs.cjs.map +1 -1
  4. package/dist/designs.js +596 -589
  5. package/dist/designs.js.map +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/react.cjs +1 -1
  8. package/dist/react.cjs.map +1 -1
  9. package/dist/react.js +2 -2
  10. package/dist/react.js.map +1 -1
  11. package/dist/src/designs/react/components/PoweredByOpen.d.ts +1 -1
  12. package/dist/src/designs/react/components/lib/MotionDiv.d.ts +1 -1
  13. package/dist/src/designs/react/components/lib/avatar.d.ts +2 -2
  14. package/dist/src/designs/react/components/lib/button.d.ts +1 -1
  15. package/dist/src/designs/react/components/lib/dialog.d.ts +2 -2
  16. package/dist/src/designs/react/components/lib/dropdown-menu.d.ts +2 -2
  17. package/dist/src/designs/react/components/lib/input.d.ts +2 -3
  18. package/dist/src/designs/react/components/lib/popover.d.ts +2 -2
  19. package/dist/src/designs/react/components/lib/switch.d.ts +2 -2
  20. package/dist/src/designs/react/components/lib/tooltip.d.ts +4 -4
  21. package/dist/src/designs/react/components/lib/wobble.d.ts +4 -4
  22. package/dist/src/designs/react/constants.d.ts +10 -4
  23. package/dist/src/designs/react/hooks/useWidgetContentHeight.d.ts +2 -2
  24. package/dist/src/designs/translation/translation.types.d.ts +1 -1
  25. package/dist/src/headless/core/__tests__/test-utils.d.ts +3 -3
  26. package/dist/src/headless/core/api/api-caller.d.ts +4 -4
  27. package/dist/src/headless/core/api/client.d.ts +4 -4
  28. package/dist/src/headless/core/api/schema.d.ts +60 -60
  29. package/dist/src/headless/core/context/router.ctx.d.ts +4 -4
  30. package/dist/src/headless/core/index.d.ts +1 -1
  31. package/dist/src/headless/core/types/messages.d.ts +8 -8
  32. package/dist/src/headless/core/types/schemas.d.ts +9 -9
  33. package/dist/src/headless/core/types/widget-config.d.ts +1 -6
  34. package/dist/src/headless/react/hooks/usePreludeData.d.ts +1 -1
  35. package/dist/src/headless/react/hooks/useUploadFiles.d.ts +1 -1
  36. package/dist/{useUploadFiles-rvVkyHN3.js → useUploadFiles-BLNdq94V.js} +3 -3
  37. package/dist/useUploadFiles-BLNdq94V.js.map +1 -0
  38. package/dist/{useUploadFiles-DJF7AYu6.cjs → useUploadFiles-Dl3_5Flm.cjs} +2 -2
  39. package/dist/useUploadFiles-Dl3_5Flm.cjs.map +1 -0
  40. package/dist/{widget.ctx-_0XFPUpq.js → widget.ctx-COUAUyWX.js} +2 -4
  41. package/dist/widget.ctx-COUAUyWX.js.map +1 -0
  42. package/dist/widget.ctx-DUaeXkNb.cjs.map +1 -1
  43. package/dist-embed/script.js +45 -45
  44. package/dist-embed/script.js.map +1 -1
  45. package/package.json +18 -10
  46. package/dist/useUploadFiles-DJF7AYu6.cjs.map +0 -1
  47. package/dist/useUploadFiles-rvVkyHN3.js.map +0 -1
  48. package/dist/widget.ctx-_0XFPUpq.js.map +0 -1
@@ -3,14 +3,14 @@
3
3
  * Do not make direct changes to the file.
4
4
  */
5
5
  export interface paths {
6
- "/backend/widget/v2/config": {
6
+ '/backend/widget/v2/config': {
7
7
  parameters: {
8
8
  query?: never;
9
9
  header?: never;
10
10
  path?: never;
11
11
  cookie?: never;
12
12
  };
13
- get: operations["getWidgetConfig"];
13
+ get: operations['getWidgetConfig'];
14
14
  put?: never;
15
15
  post?: never;
16
16
  delete?: never;
@@ -19,14 +19,14 @@ export interface paths {
19
19
  patch?: never;
20
20
  trace?: never;
21
21
  };
22
- "/backend/widget/v2/prelude": {
22
+ '/backend/widget/v2/prelude': {
23
23
  parameters: {
24
24
  query?: never;
25
25
  header?: never;
26
26
  path?: never;
27
27
  cookie?: never;
28
28
  };
29
- get: operations["widgetPrelude"];
29
+ get: operations['widgetPrelude'];
30
30
  put?: never;
31
31
  post?: never;
32
32
  delete?: never;
@@ -35,14 +35,14 @@ export interface paths {
35
35
  patch?: never;
36
36
  trace?: never;
37
37
  };
38
- "/backend/widget/v2/sessions": {
38
+ '/backend/widget/v2/sessions': {
39
39
  parameters: {
40
40
  query?: never;
41
41
  header?: never;
42
42
  path?: never;
43
43
  cookie?: never;
44
44
  };
45
- get: operations["getSessions"];
45
+ get: operations['getSessions'];
46
46
  put?: never;
47
47
  post?: never;
48
48
  delete?: never;
@@ -51,14 +51,14 @@ export interface paths {
51
51
  patch?: never;
52
52
  trace?: never;
53
53
  };
54
- "/backend/widget/v2/session/history/{sessionId}": {
54
+ '/backend/widget/v2/session/history/{sessionId}': {
55
55
  parameters: {
56
56
  query?: never;
57
57
  header?: never;
58
58
  path?: never;
59
59
  cookie?: never;
60
60
  };
61
- get: operations["getSessionHistory"];
61
+ get: operations['getSessionHistory'];
62
62
  put?: never;
63
63
  post?: never;
64
64
  delete?: never;
@@ -67,14 +67,14 @@ export interface paths {
67
67
  patch?: never;
68
68
  trace?: never;
69
69
  };
70
- "/backend/widget/v2/poll/{sessionId}": {
70
+ '/backend/widget/v2/poll/{sessionId}': {
71
71
  parameters: {
72
72
  query?: never;
73
73
  header?: never;
74
74
  path?: never;
75
75
  cookie?: never;
76
76
  };
77
- get: operations["pollSessionAndHistory"];
77
+ get: operations['pollSessionAndHistory'];
78
78
  put?: never;
79
79
  post?: never;
80
80
  delete?: never;
@@ -83,7 +83,7 @@ export interface paths {
83
83
  patch?: never;
84
84
  trace?: never;
85
85
  };
86
- "/backend/widget/v2/create-session": {
86
+ '/backend/widget/v2/create-session': {
87
87
  parameters: {
88
88
  query?: never;
89
89
  header?: never;
@@ -92,14 +92,14 @@ export interface paths {
92
92
  };
93
93
  get?: never;
94
94
  put?: never;
95
- post: operations["createChatSession"];
95
+ post: operations['createChatSession'];
96
96
  delete?: never;
97
97
  options?: never;
98
98
  head?: never;
99
99
  patch?: never;
100
100
  trace?: never;
101
101
  };
102
- "/backend/widget/v2/chat/send": {
102
+ '/backend/widget/v2/chat/send': {
103
103
  parameters: {
104
104
  query?: never;
105
105
  header?: never;
@@ -108,14 +108,14 @@ export interface paths {
108
108
  };
109
109
  get?: never;
110
110
  put?: never;
111
- post: operations["chatSend"];
111
+ post: operations['chatSend'];
112
112
  delete?: never;
113
113
  options?: never;
114
114
  head?: never;
115
115
  patch?: never;
116
116
  trace?: never;
117
117
  };
118
- "/backend/widget/v2/upload": {
118
+ '/backend/widget/v2/upload': {
119
119
  parameters: {
120
120
  query?: never;
121
121
  header?: never;
@@ -124,14 +124,14 @@ export interface paths {
124
124
  };
125
125
  get?: never;
126
126
  put?: never;
127
- post: operations["uploadFile"];
127
+ post: operations['uploadFile'];
128
128
  delete?: never;
129
129
  options?: never;
130
130
  head?: never;
131
131
  patch?: never;
132
132
  trace?: never;
133
133
  };
134
- "/backend/widget/v2/chat/vote": {
134
+ '/backend/widget/v2/chat/vote': {
135
135
  parameters: {
136
136
  query?: never;
137
137
  header?: never;
@@ -140,14 +140,14 @@ export interface paths {
140
140
  };
141
141
  get?: never;
142
142
  put?: never;
143
- post: operations["voteMessage"];
143
+ post: operations['voteMessage'];
144
144
  delete?: never;
145
145
  options?: never;
146
146
  head?: never;
147
147
  patch?: never;
148
148
  trace?: never;
149
149
  };
150
- "/backend/widget/v2/contact/create-unverified": {
150
+ '/backend/widget/v2/contact/create-unverified': {
151
151
  parameters: {
152
152
  query?: never;
153
153
  header?: never;
@@ -156,7 +156,7 @@ export interface paths {
156
156
  };
157
157
  get?: never;
158
158
  put?: never;
159
- post: operations["createUnverifiedContact"];
159
+ post: operations['createUnverifiedContact'];
160
160
  delete?: never;
161
161
  options?: never;
162
162
  head?: never;
@@ -186,10 +186,10 @@ export interface components {
186
186
  HandleContactMessageOutputDto: {
187
187
  /** @enum {boolean} */
188
188
  success: true;
189
- code?: string | "session_assigned_to_human_agent";
189
+ code?: string | 'session_assigned_to_human_agent';
190
190
  autopilotResponse?: {
191
191
  /** @enum {string} */
192
- type: "text";
192
+ type: 'text';
193
193
  value: {
194
194
  error: boolean;
195
195
  content: string;
@@ -199,10 +199,10 @@ export interface components {
199
199
  };
200
200
  uiResponse?: {
201
201
  /** @enum {string} */
202
- type: "ui";
202
+ type: 'ui';
203
203
  value: {
204
204
  /** @enum {string} */
205
- type: "ui_component";
205
+ type: 'ui_component';
206
206
  request_response?: unknown;
207
207
  name: string;
208
208
  content?: string;
@@ -229,7 +229,7 @@ export interface components {
229
229
  isOpened: boolean;
230
230
  assignee: {
231
231
  /** @enum {string} */
232
- kind: "human" | "ai" | "none" | "unknown";
232
+ kind: 'human' | 'ai' | 'none' | 'unknown';
233
233
  name: string | null;
234
234
  avatarUrl: string | null;
235
235
  };
@@ -279,13 +279,13 @@ export interface components {
279
279
  WidgetHistoryDto: {
280
280
  publicId: string;
281
281
  /** @enum {string} */
282
- type: "message" | "handoff" | "handoff_to_zendesk" | "agent_message" | "agent_joined" | "agent_comment" | "agent_took_session_from_ai" | "agent_reopened_session" | "ai_decided_to_resolve_the_issue" | "email_draft_message" | "followup" | "ai_assumed_the_session_resolved" | "user_confirmed_the_session_resolved" | "system_message";
282
+ type: 'message' | 'handoff' | 'handoff_to_zendesk' | 'agent_message' | 'agent_joined' | 'agent_comment' | 'agent_took_session_from_ai' | 'agent_reopened_session' | 'ai_decided_to_resolve_the_issue' | 'email_draft_message' | 'followup' | 'ai_assumed_the_session_resolved' | 'user_confirmed_the_session_resolved' | 'system_message';
283
283
  content: {
284
284
  text?: string | null;
285
285
  };
286
286
  sender: {
287
287
  /** @enum {string} */
288
- kind: "user" | "agent" | "ai" | "none" | "unknown";
288
+ kind: 'user' | 'agent' | 'ai' | 'none' | 'unknown';
289
289
  name?: string | null;
290
290
  avatar?: string | null;
291
291
  };
@@ -358,7 +358,7 @@ export interface components {
358
358
  isOpened: boolean;
359
359
  assignee: {
360
360
  /** @enum {string} */
361
- kind: "human" | "ai" | "none" | "unknown";
361
+ kind: 'human' | 'ai' | 'none' | 'unknown';
362
362
  name: string | null;
363
363
  avatarUrl: string | null;
364
364
  };
@@ -369,13 +369,13 @@ export interface components {
369
369
  history: {
370
370
  publicId: string;
371
371
  /** @enum {string} */
372
- type: "message" | "handoff" | "handoff_to_zendesk" | "agent_message" | "agent_joined" | "agent_comment" | "agent_took_session_from_ai" | "agent_reopened_session" | "ai_decided_to_resolve_the_issue" | "email_draft_message" | "followup" | "ai_assumed_the_session_resolved" | "user_confirmed_the_session_resolved" | "system_message";
372
+ type: 'message' | 'handoff' | 'handoff_to_zendesk' | 'agent_message' | 'agent_joined' | 'agent_comment' | 'agent_took_session_from_ai' | 'agent_reopened_session' | 'ai_decided_to_resolve_the_issue' | 'email_draft_message' | 'followup' | 'ai_assumed_the_session_resolved' | 'user_confirmed_the_session_resolved' | 'system_message';
373
373
  content: {
374
374
  text?: string | null;
375
375
  };
376
376
  sender: {
377
377
  /** @enum {string} */
378
- kind: "user" | "agent" | "ai" | "none" | "unknown";
378
+ kind: 'user' | 'agent' | 'ai' | 'none' | 'unknown';
379
379
  name?: string | null;
380
380
  avatar?: string | null;
381
381
  };
@@ -404,7 +404,7 @@ export interface components {
404
404
  isOpened: boolean;
405
405
  assignee: {
406
406
  /** @enum {string} */
407
- kind: "human" | "ai" | "none" | "unknown";
407
+ kind: 'human' | 'ai' | 'none' | 'unknown';
408
408
  name: string | null;
409
409
  avatarUrl: string | null;
410
410
  };
@@ -414,7 +414,7 @@ export interface components {
414
414
  };
415
415
  WidgetVoteDto: {
416
416
  /** @enum {string} */
417
- action: "upvote" | "downvote";
417
+ action: 'upvote' | 'downvote';
418
418
  sessionId: string;
419
419
  messagePublicId: string;
420
420
  };
@@ -440,7 +440,7 @@ export interface operations {
440
440
  parameters: {
441
441
  query?: never;
442
442
  header: {
443
- "X-Bot-Token": string;
443
+ 'X-Bot-Token': string;
444
444
  };
445
445
  path?: never;
446
446
  cookie?: never;
@@ -452,7 +452,7 @@ export interface operations {
452
452
  [name: string]: unknown;
453
453
  };
454
454
  content: {
455
- "application/json": components["schemas"]["WidgetConfigDto"];
455
+ 'application/json': components['schemas']['WidgetConfigDto'];
456
456
  };
457
457
  };
458
458
  /** @description Internal Server Error */
@@ -461,7 +461,7 @@ export interface operations {
461
461
  [name: string]: unknown;
462
462
  };
463
463
  content: {
464
- "application/json": components["schemas"]["ErrorDto"];
464
+ 'application/json': components['schemas']['ErrorDto'];
465
465
  };
466
466
  };
467
467
  };
@@ -470,7 +470,7 @@ export interface operations {
470
470
  parameters: {
471
471
  query?: never;
472
472
  header: {
473
- "X-Bot-Token": string;
473
+ 'X-Bot-Token': string;
474
474
  };
475
475
  path?: never;
476
476
  cookie?: never;
@@ -482,7 +482,7 @@ export interface operations {
482
482
  [name: string]: unknown;
483
483
  };
484
484
  content: {
485
- "application/json": components["schemas"]["WidgetPreludeDto"];
485
+ 'application/json': components['schemas']['WidgetPreludeDto'];
486
486
  };
487
487
  };
488
488
  /** @description Internal Server Error */
@@ -491,7 +491,7 @@ export interface operations {
491
491
  [name: string]: unknown;
492
492
  };
493
493
  content: {
494
- "application/json": components["schemas"]["ErrorDto"];
494
+ 'application/json': components['schemas']['ErrorDto'];
495
495
  };
496
496
  };
497
497
  };
@@ -515,7 +515,7 @@ export interface operations {
515
515
  [name: string]: unknown;
516
516
  };
517
517
  content: {
518
- "application/json": components["schemas"]["PaginatedWidgetSessionsDto"];
518
+ 'application/json': components['schemas']['PaginatedWidgetSessionsDto'];
519
519
  };
520
520
  };
521
521
  /** @description Internal Server Error */
@@ -524,7 +524,7 @@ export interface operations {
524
524
  [name: string]: unknown;
525
525
  };
526
526
  content: {
527
- "application/json": components["schemas"]["ErrorDto"];
527
+ 'application/json': components['schemas']['ErrorDto'];
528
528
  };
529
529
  };
530
530
  };
@@ -548,7 +548,7 @@ export interface operations {
548
548
  [name: string]: unknown;
549
549
  };
550
550
  content: {
551
- "application/json": components["schemas"]["WidgetHistoryDto"][];
551
+ 'application/json': components['schemas']['WidgetHistoryDto'][];
552
552
  };
553
553
  };
554
554
  /** @description Internal Server Error */
@@ -557,7 +557,7 @@ export interface operations {
557
557
  [name: string]: unknown;
558
558
  };
559
559
  content: {
560
- "application/json": components["schemas"]["ErrorDto"];
560
+ 'application/json': components['schemas']['ErrorDto'];
561
561
  };
562
562
  };
563
563
  };
@@ -581,7 +581,7 @@ export interface operations {
581
581
  [name: string]: unknown;
582
582
  };
583
583
  content: {
584
- "application/json": components["schemas"]["WidgetSessionAndHistoryDto"];
584
+ 'application/json': components['schemas']['WidgetSessionAndHistoryDto'];
585
585
  };
586
586
  };
587
587
  /** @description Internal Server Error */
@@ -590,7 +590,7 @@ export interface operations {
590
590
  [name: string]: unknown;
591
591
  };
592
592
  content: {
593
- "application/json": components["schemas"]["ErrorDto"];
593
+ 'application/json': components['schemas']['ErrorDto'];
594
594
  };
595
595
  };
596
596
  };
@@ -604,7 +604,7 @@ export interface operations {
604
604
  };
605
605
  requestBody: {
606
606
  content: {
607
- "application/json": components["schemas"]["CreateWidgetSessionDto"];
607
+ 'application/json': components['schemas']['CreateWidgetSessionDto'];
608
608
  };
609
609
  };
610
610
  responses: {
@@ -613,7 +613,7 @@ export interface operations {
613
613
  [name: string]: unknown;
614
614
  };
615
615
  content: {
616
- "application/json": components["schemas"]["WidgetSessionDto"];
616
+ 'application/json': components['schemas']['WidgetSessionDto'];
617
617
  };
618
618
  };
619
619
  /** @description Internal Server Error */
@@ -622,7 +622,7 @@ export interface operations {
622
622
  [name: string]: unknown;
623
623
  };
624
624
  content: {
625
- "application/json": components["schemas"]["ErrorDto"];
625
+ 'application/json': components['schemas']['ErrorDto'];
626
626
  };
627
627
  };
628
628
  };
@@ -636,7 +636,7 @@ export interface operations {
636
636
  };
637
637
  requestBody: {
638
638
  content: {
639
- "application/json": components["schemas"]["SendWidgetMessageDto"];
639
+ 'application/json': components['schemas']['SendWidgetMessageDto'];
640
640
  };
641
641
  };
642
642
  responses: {
@@ -645,7 +645,7 @@ export interface operations {
645
645
  [name: string]: unknown;
646
646
  };
647
647
  content: {
648
- "application/json": components["schemas"]["HandleContactMessageOutputDto"];
648
+ 'application/json': components['schemas']['HandleContactMessageOutputDto'];
649
649
  };
650
650
  };
651
651
  /** @description Internal Server Error */
@@ -654,7 +654,7 @@ export interface operations {
654
654
  [name: string]: unknown;
655
655
  };
656
656
  content: {
657
- "application/json": components["schemas"]["ErrorDto"];
657
+ 'application/json': components['schemas']['ErrorDto'];
658
658
  };
659
659
  };
660
660
  };
@@ -669,7 +669,7 @@ export interface operations {
669
669
  /** @description The file to upload */
670
670
  requestBody: {
671
671
  content: {
672
- "multipart/form-data": components["schemas"]["FileUploadDto"];
672
+ 'multipart/form-data': components['schemas']['FileUploadDto'];
673
673
  };
674
674
  };
675
675
  responses: {
@@ -678,7 +678,7 @@ export interface operations {
678
678
  [name: string]: unknown;
679
679
  };
680
680
  content: {
681
- "application/json": components["schemas"]["UploadWidgetFileResponseDto"];
681
+ 'application/json': components['schemas']['UploadWidgetFileResponseDto'];
682
682
  };
683
683
  };
684
684
  /** @description Internal Server Error */
@@ -687,7 +687,7 @@ export interface operations {
687
687
  [name: string]: unknown;
688
688
  };
689
689
  content: {
690
- "application/json": components["schemas"]["ErrorDto"];
690
+ 'application/json': components['schemas']['ErrorDto'];
691
691
  };
692
692
  };
693
693
  };
@@ -701,7 +701,7 @@ export interface operations {
701
701
  };
702
702
  requestBody: {
703
703
  content: {
704
- "application/json": components["schemas"]["WidgetVoteDto"];
704
+ 'application/json': components['schemas']['WidgetVoteDto'];
705
705
  };
706
706
  };
707
707
  responses: {
@@ -710,7 +710,7 @@ export interface operations {
710
710
  [name: string]: unknown;
711
711
  };
712
712
  content: {
713
- "application/json": components["schemas"]["WidgetVoteResponseDto"];
713
+ 'application/json': components['schemas']['WidgetVoteResponseDto'];
714
714
  };
715
715
  };
716
716
  /** @description Internal Server Error */
@@ -719,7 +719,7 @@ export interface operations {
719
719
  [name: string]: unknown;
720
720
  };
721
721
  content: {
722
- "application/json": components["schemas"]["ErrorDto"];
722
+ 'application/json': components['schemas']['ErrorDto'];
723
723
  };
724
724
  };
725
725
  };
@@ -728,14 +728,14 @@ export interface operations {
728
728
  parameters: {
729
729
  query?: never;
730
730
  header: {
731
- "x-bot-token": string;
731
+ 'x-bot-token': string;
732
732
  };
733
733
  path?: never;
734
734
  cookie?: never;
735
735
  };
736
736
  requestBody: {
737
737
  content: {
738
- "application/json": components["schemas"]["CreateUnverifiedContactDto"];
738
+ 'application/json': components['schemas']['CreateUnverifiedContactDto'];
739
739
  };
740
740
  };
741
741
  responses: {
@@ -744,7 +744,7 @@ export interface operations {
744
744
  [name: string]: unknown;
745
745
  };
746
746
  content: {
747
- "application/json": components["schemas"]["WidgetContactTokenResponseDto"];
747
+ 'application/json': components['schemas']['WidgetContactTokenResponseDto'];
748
748
  };
749
749
  };
750
750
  /** @description Internal Server Error */
@@ -753,7 +753,7 @@ export interface operations {
753
753
  [name: string]: unknown;
754
754
  };
755
755
  content: {
756
- "application/json": components["schemas"]["ErrorDto"];
756
+ 'application/json': components['schemas']['ErrorDto'];
757
757
  };
758
758
  };
759
759
  };
@@ -4,11 +4,11 @@ import { ContactCtx } from './contact.ctx';
4
4
  import { SessionCtx } from './session.ctx';
5
5
  import { WidgetCtx } from './widget.ctx';
6
6
  type RouterState = {
7
- screen: /** A welcome screen to collect user data. Useful in public non-logged-in environments */ "welcome"
7
+ screen: /** A welcome screen to collect user data. Useful in public non-logged-in environments */ 'welcome'
8
8
  /** Show a list of the user's previous sessions */
9
- | "sessions"
9
+ | 'sessions'
10
10
  /** Self-explanatory */
11
- | "chat";
11
+ | 'chat';
12
12
  };
13
13
  export declare class RouterCtx {
14
14
  state: PrimitiveState<RouterState>;
@@ -20,7 +20,7 @@ export declare class RouterCtx {
20
20
  config: WidgetConfig;
21
21
  contactCtx: ContactCtx;
22
22
  sessionCtx: SessionCtx;
23
- resetChat: WidgetCtx["resetChat"];
23
+ resetChat: WidgetCtx['resetChat'];
24
24
  });
25
25
  private registerRoutingListener;
26
26
  toSessionsScreen: () => void;
@@ -1,5 +1,5 @@
1
1
  export type { AgentOrBotType } from './types/agent-or-bot';
2
- export type { SafeExtract, StringOrLiteral, } from './types/helpers';
2
+ export type { SafeExtract, StringOrLiteral } from './types/helpers';
3
3
  export type { WidgetComponentKey, UserMessageType, AgentMessageType, BotMessageType, MessageType, } from './types/messages';
4
4
  export type { MessageAttachmentType, MessageDto, PreludeDto, SendMessageDto, SendMessageOutputDto, SessionDto, VoteInputDto, VoteOutputDto, ActionCallDto, } from './types/schemas';
5
5
  export type { WidgetConfig } from './types/widget-config';
@@ -1,10 +1,10 @@
1
1
  import { MessageAttachmentType, MessageDto } from './schemas';
2
2
  import { SafeExtract, StringOrLiteral } from './helpers';
3
3
  import { AgentOrBotType } from './agent-or-bot';
4
- export type WidgetComponentKey = StringOrLiteral<"bot_message" | "agent_message" | "loading" | "fallback">;
4
+ export type WidgetComponentKey = StringOrLiteral<'bot_message' | 'agent_message' | 'loading' | 'fallback'>;
5
5
  export type UserMessageType = {
6
6
  id: string;
7
- type: "FROM_USER";
7
+ type: 'FROM_USER';
8
8
  content: string;
9
9
  deliveredAt: string | null;
10
10
  attachments?: MessageAttachmentType[] | null;
@@ -19,14 +19,14 @@ export type UserMessageType = {
19
19
  };
20
20
  export type BotMessageType<TActionData = unknown> = {
21
21
  id: string;
22
- type: "FROM_BOT";
22
+ type: 'FROM_BOT';
23
23
  /**
24
24
  * The type is a bot_message literal string or other strings that correspond to the UI responses from AI action calls
25
25
  */
26
- component: StringOrLiteral<SafeExtract<WidgetComponentKey, "bot_message">>;
26
+ component: StringOrLiteral<SafeExtract<WidgetComponentKey, 'bot_message'>>;
27
27
  data: {
28
28
  message: string;
29
- variant?: "default" | "error";
29
+ variant?: 'default' | 'error';
30
30
  action?: {
31
31
  name: string;
32
32
  data: TActionData;
@@ -39,11 +39,11 @@ export type BotMessageType<TActionData = unknown> = {
39
39
  };
40
40
  export type AgentMessageType = {
41
41
  id: string;
42
- type: "FROM_AGENT";
43
- component: SafeExtract<WidgetComponentKey, "agent_message">;
42
+ type: 'FROM_AGENT';
43
+ component: SafeExtract<WidgetComponentKey, 'agent_message'>;
44
44
  data: {
45
45
  message: string;
46
- variant?: "default" | "error";
46
+ variant?: 'default' | 'error';
47
47
  action?: undefined;
48
48
  };
49
49
  timestamp?: string;
@@ -1,10 +1,10 @@
1
1
  import { Dto } from '../api/client';
2
- export type VoteInputDto = Dto["WidgetVoteDto"];
3
- export type VoteOutputDto = Dto["WidgetVoteResponseDto"];
4
- export type SendMessageDto = Dto["SendWidgetMessageDto"];
5
- export type SendMessageOutputDto = Dto["HandleContactMessageOutputDto"];
6
- export type SessionDto = Dto["WidgetSessionDto"];
7
- export type MessageDto = Dto["WidgetHistoryDto"];
8
- export type PreludeDto = Dto["WidgetPreludeDto"];
9
- export type MessageAttachmentType = NonNullable<Dto["WidgetHistoryDto"]["attachments"]>[number];
10
- export type ActionCallDto = NonNullable<Dto["WidgetHistoryDto"]["actionCalls"]>[number];
2
+ export type VoteInputDto = Dto['WidgetVoteDto'];
3
+ export type VoteOutputDto = Dto['WidgetVoteResponseDto'];
4
+ export type SendMessageDto = Dto['SendWidgetMessageDto'];
5
+ export type SendMessageOutputDto = Dto['HandleContactMessageOutputDto'];
6
+ export type SessionDto = Dto['WidgetSessionDto'];
7
+ export type MessageDto = Dto['WidgetHistoryDto'];
8
+ export type PreludeDto = Dto['WidgetPreludeDto'];
9
+ export type MessageAttachmentType = NonNullable<Dto['WidgetHistoryDto']['attachments']>[number];
10
+ export type ActionCallDto = NonNullable<Dto['WidgetHistoryDto']['actionCalls']>[number];
@@ -34,7 +34,7 @@ export interface WidgetConfig {
34
34
  /**
35
35
  * A name and an avatar for the bot.
36
36
  */
37
- bot?: Pick<AgentOrBotType, "name" | "avatar">;
37
+ bot?: Pick<AgentOrBotType, 'name' | 'avatar'>;
38
38
  theme?: {
39
39
  primaryColor?: string;
40
40
  };
@@ -116,11 +116,6 @@ export interface WidgetConfig {
116
116
  * Useful if you want to send data regarding the current page the user is viewing.
117
117
  */
118
118
  context?: Record<string, unknown>;
119
- /**
120
- * Turn on to see the debug info attached to the AI responses.
121
- * @default false
122
- */
123
- debug?: boolean;
124
119
  /**
125
120
  * An apiUrl to override production backend.
126
121
  * This is for us to test the widget locally, you don't need to play with this option 😊.
@@ -29,7 +29,7 @@ declare function usePreludeData(): import('swr').SWRResponse<import('openapi-fet
29
29
  }, {
30
30
  params: {
31
31
  header: {
32
- "X-Bot-Token": string;
32
+ 'X-Bot-Token': string;
33
33
  };
34
34
  };
35
35
  }, `${string}/${string}`>, any, {
@@ -1,5 +1,5 @@
1
1
  interface FileWithProgress {
2
- status: "pending" | "uploading" | "success" | "error";
2
+ status: 'pending' | 'uploading' | 'success' | 'error';
3
3
  id: string;
4
4
  file: File;
5
5
  fileUrl?: string;