@botpress/webchat 2.3.1 → 2.3.2

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 (37) hide show
  1. package/.eslintrc.js +11 -0
  2. package/.turbo/turbo-build.log +16 -15
  3. package/dist/adapters/index.d.ts +1 -6
  4. package/dist/adapters/target.d.ts +1 -6
  5. package/dist/adapters/typings.d.ts +1 -6
  6. package/dist/adapters/webchat-to-target.d.ts +8 -0
  7. package/dist/adapters/webchat.d.ts +3 -1986
  8. package/dist/client/state-machine.d.ts +1 -1
  9. package/dist/client/types.d.ts +1 -0
  10. package/dist/components/MessageList/MessageList.d.ts +1 -1
  11. package/dist/components/renderers/Audio/Audio.d.ts +1 -0
  12. package/dist/components/renderers/Carousel/Carousel.d.ts +1 -0
  13. package/dist/components/renderers/File/File.d.ts +1 -0
  14. package/dist/components/renderers/Image/Image.d.ts +1 -0
  15. package/dist/components/renderers/Location/Location.d.ts +1 -0
  16. package/dist/components/renderers/Video/Video.d.ts +1 -0
  17. package/dist/gen/signals/index.d.ts +34 -34
  18. package/dist/gen/signals/messageCreated.z.d.ts +34 -34
  19. package/dist/index.js +67478 -25250
  20. package/dist/index.umd.cjs +172 -127
  21. package/dist/schemas/init.d.ts +14 -14
  22. package/dist/schemas/theme.d.ts +8 -8
  23. package/dist/stores/offlineStore.d.ts +1 -1
  24. package/dist/stores/webchatStore.d.ts +2 -2
  25. package/dist/types/block-type.d.ts +2 -0
  26. package/package.json +21 -22
  27. package/dist/adapters/adapters/messaging-to-target.d.ts +0 -184
  28. package/dist/adapters/adapters/messaging-to-webchat.d.ts +0 -5
  29. package/dist/adapters/adapters/webchat-to-messaging.d.ts +0 -223
  30. package/dist/adapters/adapters/webchat-to-target.d.ts +0 -197
  31. package/dist/adapters/messaging.d.ts +0 -1455
  32. package/dist/adapters/sdk.d.ts +0 -472
  33. package/dist/client/inner-client/event-emitter.d.ts +0 -10
  34. package/dist/client/inner-client/eventsource.d.ts +0 -22
  35. package/dist/client/inner-client/index.d.ts +0 -42
  36. package/dist/client/inner-client/signal-listener.d.ts +0 -47
  37. package/openapi.ts +0 -35
@@ -1,4 +1,4 @@
1
- import { Client } from './inner-client';
1
+ import { Client } from '@bpinternal/webchat-http-client';
2
2
  export type SignalEmitter = Awaited<ReturnType<Client['listenConversation']>>;
3
3
  export type DisconnectedState = {};
4
4
  export type UserCreatingState = DisconnectedState & {};
@@ -16,6 +16,7 @@ export type Message = {
16
16
  sentOn: Date;
17
17
  disableInput?: boolean;
18
18
  payload: BlockObject;
19
+ metadata?: Record<string, any>;
19
20
  };
20
21
  export type WebchatEvents = {
21
22
  conversation: string | undefined;
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps, FC } from 'react';
2
- import { StyleOptions } from '../../contexts/index.ts';
2
+ import { StyleOptions } from '../../contexts';
3
3
  type MessageListProps = {
4
4
  scrollDownButton?: {
5
5
  text?: string;
@@ -1,3 +1,4 @@
1
1
  export declare const Audio: import("react").ForwardRefExoticComponent<import("../../../adapters/target").AudioMessage & Partial<Pick<import("../../..").MessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
2
2
  messageId: string;
3
+ metadata?: Record<string, any>;
3
4
  }> & import("react").RefAttributes<HTMLAudioElement>>;
@@ -1,3 +1,4 @@
1
1
  export declare const Carousel: import("react").ForwardRefExoticComponent<import("../../../adapters/target").CarouselMessage & Partial<Pick<import("../../..").MessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
2
2
  messageId: string;
3
+ metadata?: Record<string, any>;
3
4
  }> & import("react").RefAttributes<HTMLDivElement>>;
@@ -1,3 +1,4 @@
1
1
  export declare const File: import("react").ForwardRefExoticComponent<import("../../../adapters/target").FileMessage & Partial<Pick<import("../../..").MessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
2
2
  messageId: string;
3
+ metadata?: Record<string, any>;
3
4
  }> & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -1,3 +1,4 @@
1
1
  export declare const Image: import("react").ForwardRefExoticComponent<import("../../../adapters/target").ImageMessage & Partial<Pick<import("../../..").MessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
2
2
  messageId: string;
3
+ metadata?: Record<string, any>;
3
4
  }> & import("react").RefAttributes<HTMLImageElement>>;
@@ -1,3 +1,4 @@
1
1
  export declare const Location: import("react").ForwardRefExoticComponent<import("../../../adapters/target").LocationMessage & Partial<Pick<import("../../..").MessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
2
2
  messageId: string;
3
+ metadata?: Record<string, any>;
3
4
  }> & import("react").RefAttributes<HTMLAnchorElement>>;
@@ -1,3 +1,4 @@
1
1
  export declare const Video: import("react").ForwardRefExoticComponent<import("../../../adapters/target").VideoMessage & Partial<Pick<import("../../..").MessageObject<import("../../../adapters/target").Message>, "direction" | "timestamp" | "sender"> & {
2
2
  messageId: string;
3
+ metadata?: Record<string, any>;
3
4
  }> & import("react").RefAttributes<HTMLVideoElement>>;
@@ -29,22 +29,22 @@ export declare const zod: {
29
29
  label: import("zod").ZodString;
30
30
  value: import("zod").ZodString;
31
31
  }, "strip", import("zod").ZodTypeAny, {
32
- value: string;
33
32
  action: "postback" | "url" | "say";
34
33
  label: string;
35
- }, {
36
34
  value: string;
35
+ }, {
37
36
  action: "postback" | "url" | "say";
38
37
  label: string;
38
+ value: string;
39
39
  }>, "many">;
40
40
  type: import("zod").ZodLiteral<"card">;
41
41
  }, "strip", import("zod").ZodTypeAny, {
42
42
  type: "card";
43
43
  title: string;
44
44
  actions: {
45
- value: string;
46
45
  action: "postback" | "url" | "say";
47
46
  label: string;
47
+ value: string;
48
48
  }[];
49
49
  subtitle?: string | undefined;
50
50
  imageUrl?: string | undefined;
@@ -52,9 +52,9 @@ export declare const zod: {
52
52
  type: "card";
53
53
  title: string;
54
54
  actions: {
55
- value: string;
56
55
  action: "postback" | "url" | "say";
57
56
  label: string;
57
+ value: string;
58
58
  }[];
59
59
  subtitle?: string | undefined;
60
60
  imageUrl?: string | undefined;
@@ -68,29 +68,29 @@ export declare const zod: {
68
68
  label: import("zod").ZodString;
69
69
  value: import("zod").ZodString;
70
70
  }, "strip", import("zod").ZodTypeAny, {
71
- value: string;
72
71
  action: "postback" | "url" | "say";
73
72
  label: string;
74
- }, {
75
73
  value: string;
74
+ }, {
76
75
  action: "postback" | "url" | "say";
77
76
  label: string;
77
+ value: string;
78
78
  }>, "many">;
79
79
  }, "strip", import("zod").ZodTypeAny, {
80
80
  title: string;
81
81
  actions: {
82
- value: string;
83
82
  action: "postback" | "url" | "say";
84
83
  label: string;
84
+ value: string;
85
85
  }[];
86
86
  subtitle?: string | undefined;
87
87
  imageUrl?: string | undefined;
88
88
  }, {
89
89
  title: string;
90
90
  actions: {
91
- value: string;
92
91
  action: "postback" | "url" | "say";
93
92
  label: string;
93
+ value: string;
94
94
  }[];
95
95
  subtitle?: string | undefined;
96
96
  imageUrl?: string | undefined;
@@ -101,9 +101,9 @@ export declare const zod: {
101
101
  items: {
102
102
  title: string;
103
103
  actions: {
104
- value: string;
105
104
  action: "postback" | "url" | "say";
106
105
  label: string;
106
+ value: string;
107
107
  }[];
108
108
  subtitle?: string | undefined;
109
109
  imageUrl?: string | undefined;
@@ -113,9 +113,9 @@ export declare const zod: {
113
113
  items: {
114
114
  title: string;
115
115
  actions: {
116
- value: string;
117
116
  action: "postback" | "url" | "say";
118
117
  label: string;
118
+ value: string;
119
119
  }[];
120
120
  subtitle?: string | undefined;
121
121
  imageUrl?: string | undefined;
@@ -126,11 +126,11 @@ export declare const zod: {
126
126
  label: import("zod").ZodString;
127
127
  value: import("zod").ZodString;
128
128
  }, "strip", import("zod").ZodTypeAny, {
129
- value: string;
130
129
  label: string;
131
- }, {
132
130
  value: string;
131
+ }, {
133
132
  label: string;
133
+ value: string;
134
134
  }>, "many">;
135
135
  type: import("zod").ZodLiteral<"choice">;
136
136
  disableFreeText: import("zod").ZodOptional<import("zod").ZodBoolean>;
@@ -138,16 +138,16 @@ export declare const zod: {
138
138
  type: "choice";
139
139
  text: string;
140
140
  options: {
141
- value: string;
142
141
  label: string;
142
+ value: string;
143
143
  }[];
144
144
  disableFreeText?: boolean | undefined;
145
145
  }, {
146
146
  type: "choice";
147
147
  text: string;
148
148
  options: {
149
- value: string;
150
149
  label: string;
150
+ value: string;
151
151
  }[];
152
152
  disableFreeText?: boolean | undefined;
153
153
  }>, import("zod").ZodObject<{
@@ -156,26 +156,26 @@ export declare const zod: {
156
156
  label: import("zod").ZodString;
157
157
  value: import("zod").ZodString;
158
158
  }, "strip", import("zod").ZodTypeAny, {
159
- value: string;
160
159
  label: string;
161
- }, {
162
160
  value: string;
161
+ }, {
163
162
  label: string;
163
+ value: string;
164
164
  }>, "many">;
165
165
  type: import("zod").ZodLiteral<"dropdown">;
166
166
  }, "strip", import("zod").ZodTypeAny, {
167
167
  type: "dropdown";
168
168
  text: string;
169
169
  options: {
170
- value: string;
171
170
  label: string;
171
+ value: string;
172
172
  }[];
173
173
  }, {
174
174
  type: "dropdown";
175
175
  text: string;
176
176
  options: {
177
- value: string;
178
177
  label: string;
178
+ value: string;
179
179
  }[];
180
180
  }>, import("zod").ZodObject<{
181
181
  fileUrl: import("zod").ZodString;
@@ -494,9 +494,9 @@ export declare const zod: {
494
494
  type: "card";
495
495
  title: string;
496
496
  actions: {
497
- value: string;
498
497
  action: "postback" | "url" | "say";
499
498
  label: string;
499
+ value: string;
500
500
  }[];
501
501
  subtitle?: string | undefined;
502
502
  imageUrl?: string | undefined;
@@ -505,9 +505,9 @@ export declare const zod: {
505
505
  items: {
506
506
  title: string;
507
507
  actions: {
508
- value: string;
509
508
  action: "postback" | "url" | "say";
510
509
  label: string;
510
+ value: string;
511
511
  }[];
512
512
  subtitle?: string | undefined;
513
513
  imageUrl?: string | undefined;
@@ -516,16 +516,16 @@ export declare const zod: {
516
516
  type: "choice";
517
517
  text: string;
518
518
  options: {
519
- value: string;
520
519
  label: string;
520
+ value: string;
521
521
  }[];
522
522
  disableFreeText?: boolean | undefined;
523
523
  } | {
524
524
  type: "dropdown";
525
525
  text: string;
526
526
  options: {
527
- value: string;
528
527
  label: string;
528
+ value: string;
529
529
  }[];
530
530
  } | {
531
531
  type: "file";
@@ -604,9 +604,9 @@ export declare const zod: {
604
604
  type: "card";
605
605
  title: string;
606
606
  actions: {
607
- value: string;
608
607
  action: "postback" | "url" | "say";
609
608
  label: string;
609
+ value: string;
610
610
  }[];
611
611
  subtitle?: string | undefined;
612
612
  imageUrl?: string | undefined;
@@ -615,9 +615,9 @@ export declare const zod: {
615
615
  items: {
616
616
  title: string;
617
617
  actions: {
618
- value: string;
619
618
  action: "postback" | "url" | "say";
620
619
  label: string;
620
+ value: string;
621
621
  }[];
622
622
  subtitle?: string | undefined;
623
623
  imageUrl?: string | undefined;
@@ -626,16 +626,16 @@ export declare const zod: {
626
626
  type: "choice";
627
627
  text: string;
628
628
  options: {
629
- value: string;
630
629
  label: string;
630
+ value: string;
631
631
  }[];
632
632
  disableFreeText?: boolean | undefined;
633
633
  } | {
634
634
  type: "dropdown";
635
635
  text: string;
636
636
  options: {
637
- value: string;
638
637
  label: string;
638
+ value: string;
639
639
  }[];
640
640
  } | {
641
641
  type: "file";
@@ -717,9 +717,9 @@ export declare const zod: {
717
717
  type: "card";
718
718
  title: string;
719
719
  actions: {
720
- value: string;
721
720
  action: "postback" | "url" | "say";
722
721
  label: string;
722
+ value: string;
723
723
  }[];
724
724
  subtitle?: string | undefined;
725
725
  imageUrl?: string | undefined;
@@ -728,9 +728,9 @@ export declare const zod: {
728
728
  items: {
729
729
  title: string;
730
730
  actions: {
731
- value: string;
732
731
  action: "postback" | "url" | "say";
733
732
  label: string;
733
+ value: string;
734
734
  }[];
735
735
  subtitle?: string | undefined;
736
736
  imageUrl?: string | undefined;
@@ -739,16 +739,16 @@ export declare const zod: {
739
739
  type: "choice";
740
740
  text: string;
741
741
  options: {
742
- value: string;
743
742
  label: string;
743
+ value: string;
744
744
  }[];
745
745
  disableFreeText?: boolean | undefined;
746
746
  } | {
747
747
  type: "dropdown";
748
748
  text: string;
749
749
  options: {
750
- value: string;
751
750
  label: string;
751
+ value: string;
752
752
  }[];
753
753
  } | {
754
754
  type: "file";
@@ -830,9 +830,9 @@ export declare const zod: {
830
830
  type: "card";
831
831
  title: string;
832
832
  actions: {
833
- value: string;
834
833
  action: "postback" | "url" | "say";
835
834
  label: string;
835
+ value: string;
836
836
  }[];
837
837
  subtitle?: string | undefined;
838
838
  imageUrl?: string | undefined;
@@ -841,9 +841,9 @@ export declare const zod: {
841
841
  items: {
842
842
  title: string;
843
843
  actions: {
844
- value: string;
845
844
  action: "postback" | "url" | "say";
846
845
  label: string;
846
+ value: string;
847
847
  }[];
848
848
  subtitle?: string | undefined;
849
849
  imageUrl?: string | undefined;
@@ -852,16 +852,16 @@ export declare const zod: {
852
852
  type: "choice";
853
853
  text: string;
854
854
  options: {
855
- value: string;
856
855
  label: string;
856
+ value: string;
857
857
  }[];
858
858
  disableFreeText?: boolean | undefined;
859
859
  } | {
860
860
  type: "dropdown";
861
861
  text: string;
862
862
  options: {
863
- value: string;
864
863
  label: string;
864
+ value: string;
865
865
  }[];
866
866
  } | {
867
867
  type: "file";