@botpress/webchat 2.2.13 → 2.2.14

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 (36) hide show
  1. package/.turbo/turbo-build.log +8 -10
  2. package/dist/adapters/{messaging-to-target.d.ts → adapters/messaging-to-target.d.ts} +20 -19
  3. package/dist/adapters/adapters/messaging-to-webchat.d.ts +5 -0
  4. package/dist/adapters/adapters/webchat-to-messaging.d.ts +223 -0
  5. package/dist/adapters/{webchat-to-target.d.ts → adapters/webchat-to-target.d.ts} +15 -14
  6. package/dist/adapters/index.d.ts +6 -3
  7. package/dist/adapters/messaging.d.ts +1455 -0
  8. package/dist/adapters/sdk.d.ts +472 -0
  9. package/dist/adapters/target.d.ts +2 -2
  10. package/dist/adapters/typings.d.ts +12 -0
  11. package/dist/adapters/webchat.d.ts +1171 -0
  12. package/dist/client/MessagingClient/client.d.ts +3 -3
  13. package/dist/client/PushpinClient/state-machine.d.ts +5 -5
  14. package/dist/components/Block.d.ts +1 -1
  15. package/dist/components/Composer/Composer.d.ts +0 -1
  16. package/dist/components/Container/Container.d.ts +0 -1
  17. package/dist/components/Fab/Fab.d.ts +0 -1
  18. package/dist/components/MessageList/MessageList.d.ts +1 -1
  19. package/dist/components/TypingIndicator/TypingIndicator.d.ts +1 -1
  20. package/dist/components/renderers/Audio/Audio.d.ts +0 -1
  21. package/dist/components/renderers/Carousel/Carousel.d.ts +0 -1
  22. package/dist/components/renderers/File/File.d.ts +0 -1
  23. package/dist/components/renderers/Image/Image.d.ts +0 -1
  24. package/dist/components/renderers/Location/Location.d.ts +0 -1
  25. package/dist/components/renderers/Video/Video.d.ts +0 -1
  26. package/dist/gen/signals/index.d.ts +30 -30
  27. package/dist/gen/signals/messageCreated.z.d.ts +30 -30
  28. package/dist/index.js +18305 -28072
  29. package/dist/index.umd.cjs +102 -178
  30. package/dist/providers/WebchatProvider.d.ts +0 -1
  31. package/dist/schemas/init.d.ts +14 -15
  32. package/dist/schemas/theme.d.ts +8 -8
  33. package/dist/stores/offlineStore.d.ts +1 -1
  34. package/dist/style.css +1 -1
  35. package/dist/types/block-type.d.ts +1 -1
  36. package/package.json +1 -3
@@ -1,5 +1,5 @@
1
1
 
2
- > @botpress/webchat@2.2.13 build /home/runner/work/echo/echo/packages/webchat-frontend
2
+ > @botpress/webchat@2.2.14 build /home/runner/work/echo/echo/packages/webchat-frontend
3
3
  > vite build
4
4
 
5
5
  vite v4.4.11 building for production...
@@ -9,18 +9,16 @@ transforming...
9
9
  | ^
10
10
  2 | @import './theme.css';
11
11
  3 | @import '../components/index.css'
12
- [plugin:vite:resolve] Module "node:http" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/node_modules/.pnpm/@botpress+sdk@0.11.6_react@18.2.0/node_modules/@botpress/sdk/dist/index.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
13
- [plugin:vite:resolve] Module "util" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/node_modules/.pnpm/@botpress+sdk@0.11.6_react@18.2.0/node_modules/@botpress/sdk/dist/index.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
14
12
  [plugin:vite:resolve] Module "crypto" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/packages/webchat-frontend/src/gen/client/errors.ts". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
15
- ✓ 3197 modules transformed.
13
+ ✓ 3138 modules transformed.
16
14
  rendering chunks...
17
15
  
18
16
  [vite:dts] Start generate declaration files...
19
17
  computing gzip size...
20
- [vite:dts] Declaration files built in 17296ms.
18
+ dist/style.css  28.90 kB gzip: 5.59 kB
19
+ dist/index.js 1,030.86 kB │ gzip: 271.52 kB
20
+ [vite:dts] Declaration files built in 15182ms.
21
21
  
22
- dist/style.css  28.94 kB │ gzip: 5.59 kB
23
- dist/index.js 1,429.90 kB │ gzip: 358.37 kB
24
- dist/style.css  28.94 kB gzip: 5.59 kB
25
- dist/index.umd.cjs 1,000.99 kB │ gzip: 301.38 kB
26
- ✓ built in 29.38s
22
+ dist/style.css  28.90 kB │ gzip: 5.59 kB
23
+ dist/index.umd.cjs 703.28 kB │ gzip: 224.97 kB
24
+ ✓ built in 25.32s
@@ -1,13 +1,14 @@
1
- import * as adapters from 'webchat-adapters';
2
- import * as target from './target';
1
+ import * as messaging from '../messaging';
2
+ import * as target from '../target';
3
+ import * as types from '../typings';
3
4
  type WithBubble<T extends target.Message> = target.BubbleOf<T>;
4
- export type MessagingToTargetAdapters = adapters.Adapter<adapters.messaging.Messages, target.AdaptersOutput>;
5
+ export type MessagingToTargetAdapters = types.Adapter<messaging.Messages, target.AdaptersOutput>;
5
6
  export declare const audioAdapter: ({ type, audio }: {
6
7
  type: "audio";
7
8
  audio: string;
8
9
  className?: string | undefined;
9
- title?: string | undefined;
10
10
  avatarUrl?: string | undefined;
11
+ title?: string | undefined;
11
12
  }) => {
12
13
  payload: {
13
14
  type: "audio";
@@ -18,8 +19,8 @@ export declare const cardAdapter: (card: {
18
19
  type: "card";
19
20
  title: string;
20
21
  actions: ({
21
- title: string;
22
22
  text: string;
23
+ title: string;
23
24
  action: "Say something";
24
25
  } | {
25
26
  title: string;
@@ -31,9 +32,9 @@ export declare const cardAdapter: (card: {
31
32
  payload: string;
32
33
  })[];
33
34
  className?: string | undefined;
35
+ avatarUrl?: string | undefined;
34
36
  subtitle?: string | undefined;
35
37
  image?: string | undefined;
36
- avatarUrl?: string | undefined;
37
38
  }) => {
38
39
  payload: WithBubble<target.ColumnMessage>;
39
40
  };
@@ -43,8 +44,8 @@ export declare const carouselAdapter: ({ items }: {
43
44
  type: "card";
44
45
  title: string;
45
46
  actions: ({
46
- title: string;
47
47
  text: string;
48
+ title: string;
48
49
  action: "Say something";
49
50
  } | {
50
51
  title: string;
@@ -56,9 +57,9 @@ export declare const carouselAdapter: ({ items }: {
56
57
  payload: string;
57
58
  })[];
58
59
  className?: string | undefined;
60
+ avatarUrl?: string | undefined;
59
61
  subtitle?: string | undefined;
60
62
  image?: string | undefined;
61
- avatarUrl?: string | undefined;
62
63
  }[];
63
64
  className?: string | undefined;
64
65
  avatarUrl?: string | undefined;
@@ -76,8 +77,8 @@ export declare const choiceAdapter: (x: {
76
77
  title: string;
77
78
  }[];
78
79
  className?: string | undefined;
79
- disableFreeText?: boolean | undefined;
80
80
  avatarUrl?: string | undefined;
81
+ disableFreeText?: boolean | undefined;
81
82
  }) => {
82
83
  disableInput: boolean | undefined;
83
84
  payload: target.Message;
@@ -88,17 +89,17 @@ export declare const dropdownAdapter: (x: {
88
89
  value: string;
89
90
  label: string;
90
91
  }[];
91
- message?: string | undefined;
92
92
  className?: string | undefined;
93
- text?: string | undefined;
94
- markdown?: boolean | undefined;
95
93
  avatarUrl?: string | undefined;
94
+ message?: string | undefined;
96
95
  allowCreation?: boolean | undefined;
97
96
  placeholderText?: string | undefined;
98
97
  allowMultiple?: boolean | undefined;
99
98
  buttonText?: string | undefined;
100
99
  width?: number | undefined;
101
100
  displayInKeyboard?: boolean | undefined;
101
+ markdown?: boolean | undefined;
102
+ text?: string | undefined;
102
103
  }) => {
103
104
  disableInput: true;
104
105
  payload: WithBubble<target.ColumnMessage>;
@@ -107,14 +108,14 @@ export declare const fileAdapter: ({ file, ...props }: {
107
108
  type: "file";
108
109
  file: string;
109
110
  className?: string | undefined;
110
- title?: string | undefined;
111
111
  avatarUrl?: string | undefined;
112
+ title?: string | undefined;
112
113
  }) => {
113
114
  payload: {
114
115
  type: "file";
115
116
  className?: string | undefined;
116
- title?: string | undefined;
117
117
  avatarUrl?: string | undefined;
118
+ title?: string | undefined;
118
119
  url: string;
119
120
  };
120
121
  };
@@ -134,9 +135,9 @@ export declare const locationAdapter: ({ type, latitude, longitude, title, addre
134
135
  latitude: number;
135
136
  longitude: number;
136
137
  className?: string | undefined;
137
- title?: string | undefined;
138
- address?: string | undefined;
139
138
  avatarUrl?: string | undefined;
139
+ address?: string | undefined;
140
+ title?: string | undefined;
140
141
  }) => {
141
142
  payload: {
142
143
  type: "location";
@@ -159,8 +160,8 @@ export declare const textAdapter: ({ type, text }: {
159
160
  type: "text";
160
161
  text: string;
161
162
  className?: string | undefined;
162
- markdown?: boolean | undefined;
163
163
  avatarUrl?: string | undefined;
164
+ markdown?: boolean | undefined;
164
165
  }) => {
165
166
  payload: WithBubble<{
166
167
  type: "text";
@@ -171,13 +172,13 @@ export declare const videoAdapter: ({ type, video }: {
171
172
  type: "video";
172
173
  video: string;
173
174
  className?: string | undefined;
174
- title?: string | undefined;
175
175
  avatarUrl?: string | undefined;
176
+ title?: string | undefined;
176
177
  }) => {
177
178
  payload: {
178
179
  type: "video";
179
180
  url: string;
180
181
  };
181
182
  };
182
- export declare const messageAdapter: (message: adapters.messaging.Message) => target.AdapterOutput;
183
+ export declare const messageAdapter: (message: messaging.Message) => target.AdapterOutput;
183
184
  export {};
@@ -0,0 +1,5 @@
1
+ import * as webchat from '../webchat';
2
+ import * as messaging from '../messaging';
3
+ import * as types from '../typings';
4
+ export type MessagingToWebChatMessageAdapters = types.Adapter<messaging.Messages, webchat.Messages>;
5
+ export declare const messageAdapter: (message: messaging.Message) => webchat.Message;
@@ -0,0 +1,223 @@
1
+ import * as webchat from '../webchat';
2
+ import * as messaging from '../messaging';
3
+ import * as types from '../typings';
4
+ export type WebChatToMessagingMessageAdapters = types.Adapter<webchat.Messages, messaging.Messages>;
5
+ export type WebChatToMessagingTriggerAdapters = types.Adapter<webchat.Triggers, messaging.Triggers>;
6
+ export declare const audioAdapter: (x: {
7
+ type: "audio";
8
+ audioUrl: string;
9
+ className?: string | undefined;
10
+ }) => {
11
+ type: "audio";
12
+ audio: string;
13
+ audioUrl: string;
14
+ className?: string | undefined;
15
+ };
16
+ export declare const cardAdapter: (x: {
17
+ type: "card";
18
+ title: string;
19
+ actions: {
20
+ value: string;
21
+ action: "postback" | "url" | "say";
22
+ label: string;
23
+ }[];
24
+ className?: string | undefined;
25
+ subtitle?: string | undefined;
26
+ imageUrl?: string | undefined;
27
+ }) => {
28
+ type: "card";
29
+ title: string;
30
+ actions: ({
31
+ text: string;
32
+ title: string;
33
+ action: "Say something";
34
+ } | {
35
+ title: string;
36
+ action: "Open URL";
37
+ url: string;
38
+ } | {
39
+ title: string;
40
+ action: "Postback";
41
+ payload: string;
42
+ })[];
43
+ className?: string | undefined;
44
+ avatarUrl?: string | undefined;
45
+ subtitle?: string | undefined;
46
+ image?: string | undefined;
47
+ };
48
+ export declare const carouselAdapter: (x: {
49
+ type: "carousel";
50
+ items: {
51
+ title: string;
52
+ actions: {
53
+ value: string;
54
+ action: "postback" | "url" | "say";
55
+ label: string;
56
+ }[];
57
+ imageUrl?: string | undefined;
58
+ subtitle?: string | undefined;
59
+ className?: string | undefined;
60
+ }[];
61
+ className?: string | undefined;
62
+ }) => {
63
+ type: "carousel";
64
+ items: {
65
+ type: "card";
66
+ title: string;
67
+ actions: ({
68
+ text: string;
69
+ title: string;
70
+ action: "Say something";
71
+ } | {
72
+ title: string;
73
+ action: "Open URL";
74
+ url: string;
75
+ } | {
76
+ title: string;
77
+ action: "Postback";
78
+ payload: string;
79
+ })[];
80
+ className?: string | undefined;
81
+ avatarUrl?: string | undefined;
82
+ subtitle?: string | undefined;
83
+ image?: string | undefined;
84
+ }[];
85
+ className?: string | undefined;
86
+ };
87
+ export declare const choiceAdapter: (x: {
88
+ type: "choice";
89
+ text: string;
90
+ options: {
91
+ value: string;
92
+ label: string;
93
+ }[];
94
+ disableFreeText?: boolean | undefined;
95
+ className?: string | undefined;
96
+ }) => {
97
+ type: "single-choice";
98
+ text: string;
99
+ choices: {
100
+ title: string;
101
+ value: string;
102
+ }[];
103
+ disableFreeText: boolean | undefined;
104
+ options: {
105
+ value: string;
106
+ label: string;
107
+ }[];
108
+ className?: string | undefined;
109
+ };
110
+ export declare const dropdownAdapter: (x: {
111
+ type: "dropdown";
112
+ text: string;
113
+ options: {
114
+ value: string;
115
+ label: string;
116
+ }[];
117
+ className?: string | undefined;
118
+ }) => {
119
+ type: "dropdown";
120
+ message: string;
121
+ options: {
122
+ label: string;
123
+ value: string;
124
+ }[];
125
+ text: string;
126
+ className?: string | undefined;
127
+ };
128
+ export declare const fileAdapter: (x: {
129
+ type: "file";
130
+ fileUrl: string;
131
+ title?: string | undefined;
132
+ className?: string | undefined;
133
+ }) => {
134
+ type: "file";
135
+ file: string;
136
+ title: string | undefined;
137
+ fileUrl: string;
138
+ className?: string | undefined;
139
+ };
140
+ export declare const imageAdapter: (x: {
141
+ type: "image";
142
+ imageUrl: string;
143
+ className?: string | undefined;
144
+ }) => {
145
+ type: "image";
146
+ image: string;
147
+ imageUrl: string;
148
+ className?: string | undefined;
149
+ };
150
+ export declare const locationAdapter: (x: {
151
+ type: "location";
152
+ latitude: number;
153
+ longitude: number;
154
+ title?: string | undefined;
155
+ address?: string | undefined;
156
+ className?: string | undefined;
157
+ }) => {
158
+ type: "location";
159
+ latitude: number;
160
+ longitude: number;
161
+ title?: string | undefined;
162
+ address?: string | undefined;
163
+ className?: string | undefined;
164
+ };
165
+ export declare const markdownAdapter: (x: {
166
+ type: "markdown";
167
+ markdown: string;
168
+ className?: string | undefined;
169
+ }) => {
170
+ type: "text";
171
+ text: string;
172
+ markdown: true;
173
+ className?: string | undefined;
174
+ };
175
+ export declare const textAdapter: (x: {
176
+ type: "text";
177
+ text: string;
178
+ className?: string | undefined;
179
+ }) => {
180
+ type: "text";
181
+ text: string;
182
+ markdown: true;
183
+ className?: string | undefined;
184
+ };
185
+ export declare const videoAdapter: (x: {
186
+ type: "video";
187
+ videoUrl: string;
188
+ className?: string | undefined;
189
+ }) => {
190
+ type: "video";
191
+ video: string;
192
+ videoUrl: string;
193
+ className?: string | undefined;
194
+ };
195
+ export declare const messageAdapter: (message: webchat.Message) => messaging.Message;
196
+ export declare const webchatVisibilityAdapter: (x: {
197
+ type: "webchat_visibility";
198
+ data: {
199
+ visibility: "show" | "hide" | "toggle";
200
+ };
201
+ }) => {
202
+ type: "webchat-visibility";
203
+ visibility: "show" | "hide" | "toggle";
204
+ };
205
+ export declare const webchatConfigAdapter: (x: {
206
+ type: "webchat_config";
207
+ data: {
208
+ config: Record<string, any>;
209
+ };
210
+ }) => {
211
+ type: "webchat-config";
212
+ config: Record<string, any>;
213
+ };
214
+ export declare const customAdapter: (x: {
215
+ type: "custom";
216
+ data: {
217
+ event: Record<string, any>;
218
+ };
219
+ }) => {
220
+ type: "custom-event";
221
+ event: Record<string, any>;
222
+ };
223
+ export declare const triggerAdapter: (trigger: webchat.Trigger) => messaging.Trigger;
@@ -1,6 +1,7 @@
1
- import * as adapters from 'webchat-adapters';
2
- import * as target from './target';
3
- export type WebchatToTargetAdapters = adapters.Adapter<adapters.webchat.Messages, target.AdaptersOutput>;
1
+ import * as target from '../target';
2
+ import * as webchat from '../webchat';
3
+ import * as types from '../typings';
4
+ export type WebchatToTargetAdapters = types.Adapter<webchat.Messages, target.AdaptersOutput>;
4
5
  export declare const audioAdapter: (webchatMessage: {
5
6
  type: "audio";
6
7
  audioUrl: string;
@@ -16,7 +17,7 @@ export declare const cardAdapter: (webchatMessage: {
16
17
  title: string;
17
18
  actions: {
18
19
  value: string;
19
- action: "url" | "postback" | "say";
20
+ action: "postback" | "url" | "say";
20
21
  label: string;
21
22
  }[];
22
23
  className?: string | undefined;
@@ -33,12 +34,12 @@ export declare const carouselAdapter: (webchatMessage: {
33
34
  title: string;
34
35
  actions: {
35
36
  value: string;
36
- action: "url" | "postback" | "say";
37
+ action: "postback" | "url" | "say";
37
38
  label: string;
38
39
  }[];
39
- className?: string | undefined;
40
- subtitle?: string | undefined;
41
40
  imageUrl?: string | undefined;
41
+ subtitle?: string | undefined;
42
+ className?: string | undefined;
42
43
  }[];
43
44
  className?: string | undefined;
44
45
  }) => {
@@ -49,24 +50,24 @@ export declare const carouselAdapter: (webchatMessage: {
49
50
  };
50
51
  export declare const choiceAdapter: (webchatMessage: {
51
52
  type: "choice";
53
+ text: string;
52
54
  options: {
53
55
  value: string;
54
56
  label: string;
55
57
  }[];
56
- text: string;
57
- className?: string | undefined;
58
58
  disableFreeText?: boolean | undefined;
59
+ className?: string | undefined;
59
60
  }) => {
60
61
  disableInput: boolean | undefined;
61
62
  payload: target.Message;
62
63
  };
63
64
  export declare const dropdownAdapter: (webchatMessage: {
64
65
  type: "dropdown";
66
+ text: string;
65
67
  options: {
66
68
  value: string;
67
69
  label: string;
68
70
  }[];
69
- text: string;
70
71
  className?: string | undefined;
71
72
  }) => {
72
73
  disableInput: true;
@@ -77,14 +78,14 @@ export declare const dropdownAdapter: (webchatMessage: {
77
78
  export declare const fileAdapter: (webchatMessage: {
78
79
  type: "file";
79
80
  fileUrl: string;
80
- className?: string | undefined;
81
81
  title?: string | undefined;
82
+ className?: string | undefined;
82
83
  }) => {
83
84
  payload: {
84
85
  type: "file";
85
86
  className?: string | undefined;
86
- title?: string | undefined;
87
87
  avatarUrl?: string | undefined;
88
+ title?: string | undefined;
88
89
  url: string;
89
90
  };
90
91
  };
@@ -102,9 +103,9 @@ export declare const locationAdapter: (webchatMessage: {
102
103
  type: "location";
103
104
  latitude: number;
104
105
  longitude: number;
105
- className?: string | undefined;
106
106
  title?: string | undefined;
107
107
  address?: string | undefined;
108
+ className?: string | undefined;
108
109
  }) => {
109
110
  payload: {
110
111
  type: "location";
@@ -147,4 +148,4 @@ export declare const videoAdapter: (webchatMessage: {
147
148
  url: string;
148
149
  };
149
150
  };
150
- export declare const messageAdapter: (message: adapters.webchat.Message) => target.AdapterOutput;
151
+ export declare const messageAdapter: (message: webchat.Message) => target.AdapterOutput;
@@ -1,4 +1,7 @@
1
- export * from 'webchat-adapters';
1
+ export * as webchat from './webchat';
2
+ export * as messaging from './messaging';
2
3
  export * as target from './target';
3
- export * as messagingToTarget from './messaging-to-target';
4
- export * as webchatToTarget from './webchat-to-target';
4
+ export * as messagingToTarget from './adapters/messaging-to-target';
5
+ export * as messagingToWebChat from './adapters/messaging-to-webchat';
6
+ export * as webchatToMessaging from './adapters/webchat-to-messaging';
7
+ export * as webchatToTarget from './adapters/webchat-to-target';