@botpress/webchat 1.1.1 → 1.2.0

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 (65) hide show
  1. package/dist/App.d.ts +4 -4
  2. package/dist/client/MessagingClient/client.d.ts +2 -16
  3. package/dist/client/{ChatClient → PushpinClient}/index.d.ts +4 -4
  4. package/dist/client/PushpinClient/inner-client/event-emitter.d.ts +10 -0
  5. package/dist/client/PushpinClient/inner-client/eventsource.d.ts +22 -0
  6. package/dist/client/PushpinClient/inner-client/index.d.ts +39 -0
  7. package/dist/client/PushpinClient/inner-client/signal-listener.d.ts +47 -0
  8. package/dist/client/{ChatClient → PushpinClient}/state-machine.d.ts +13 -13
  9. package/dist/client/index.d.ts +1 -1
  10. package/dist/client/types.d.ts +4 -1
  11. package/dist/components/Block.d.ts +1 -1
  12. package/dist/components/Composer.d.ts +1 -1
  13. package/dist/components/Header.d.ts +1 -1
  14. package/dist/components/LoadingIndicator.d.ts +1 -1
  15. package/dist/components/MessageList.d.ts +1 -1
  16. package/dist/components/Modal.d.ts +2 -2
  17. package/dist/components/RestartConversation.d.ts +1 -1
  18. package/dist/components/Webchat.d.ts +1 -1
  19. package/dist/components/dev-tools/DevTools.d.ts +1 -1
  20. package/dist/components/renderers/Button.d.ts +1 -1
  21. package/dist/components/renderers/Dropdown.d.ts +1 -1
  22. package/dist/components/renderers/Text.d.ts +1 -1
  23. package/dist/contexts/WebchatContext.d.ts +4 -4
  24. package/dist/gen/client/api.d.ts +1694 -0
  25. package/dist/gen/client/base.d.ts +54 -0
  26. package/dist/gen/client/client.d.ts +57 -0
  27. package/dist/gen/client/common.d.ts +65 -0
  28. package/dist/gen/client/configuration.d.ts +83 -0
  29. package/dist/gen/client/errors.d.ts +197 -0
  30. package/dist/gen/client/index.d.ts +13 -0
  31. package/dist/gen/models/conversation.j.d.ts +20 -0
  32. package/dist/gen/models/conversation.t.d.ts +10 -0
  33. package/dist/gen/models/conversation.z.d.ts +15 -0
  34. package/dist/gen/models/index.d.ts +851 -0
  35. package/dist/gen/models/message.j.d.ts +388 -0
  36. package/dist/gen/models/message.t.d.ts +73 -0
  37. package/dist/gen/models/message.z.d.ts +372 -0
  38. package/dist/gen/models/user.j.d.ts +29 -0
  39. package/dist/gen/models/user.t.d.ts +13 -0
  40. package/dist/gen/models/user.z.d.ts +24 -0
  41. package/dist/gen/signals/customSignal.j.d.ts +24 -0
  42. package/dist/gen/signals/customSignal.t.d.ts +13 -0
  43. package/dist/gen/signals/customSignal.z.d.ts +22 -0
  44. package/dist/gen/signals/index.d.ts +1054 -0
  45. package/dist/gen/signals/messageCreatedSignal.j.d.ts +399 -0
  46. package/dist/gen/signals/messageCreatedSignal.t.d.ts +76 -0
  47. package/dist/gen/signals/messageCreatedSignal.z.d.ts +515 -0
  48. package/dist/gen/signals/webchatConfigSignal.j.d.ts +24 -0
  49. package/dist/gen/signals/webchatConfigSignal.t.d.ts +13 -0
  50. package/dist/gen/signals/webchatConfigSignal.z.d.ts +22 -0
  51. package/dist/gen/signals/webchatVisibilitySignal.j.d.ts +24 -0
  52. package/dist/gen/signals/webchatVisibilitySignal.t.d.ts +11 -0
  53. package/dist/gen/signals/webchatVisibilitySignal.z.d.ts +22 -0
  54. package/dist/hooks/useClient.d.ts +3 -3
  55. package/dist/index.d.ts +1 -1
  56. package/dist/index.js +27937 -73852
  57. package/dist/index.umd.cjs +113 -154
  58. package/dist/options.d.ts +3 -3
  59. package/dist/providers/ModalProvider.d.ts +1 -1
  60. package/dist/providers/WebchatProvider.d.ts +3 -3
  61. package/openapi/index.ts +31 -0
  62. package/openapi/package.json +5 -0
  63. package/openapi/readme.md +1 -0
  64. package/package.json +10 -4
  65. package/dist/client/MessagingClient/adapters/Trigger.d.ts +0 -33
@@ -0,0 +1,372 @@
1
+ import { z } from "zod";
2
+ declare const _default: z.ZodObject<{
3
+ id: z.ZodString;
4
+ createdAt: z.ZodString;
5
+ payload: z.ZodUnion<[z.ZodObject<{
6
+ audioUrl: z.ZodString;
7
+ type: z.ZodLiteral<"audio">;
8
+ }, "strip", z.ZodTypeAny, {
9
+ type: "audio";
10
+ audioUrl: string;
11
+ }, {
12
+ type: "audio";
13
+ audioUrl: string;
14
+ }>, z.ZodObject<{
15
+ title: z.ZodString;
16
+ subtitle: z.ZodOptional<z.ZodString>;
17
+ imageUrl: z.ZodOptional<z.ZodString>;
18
+ actions: z.ZodArray<z.ZodObject<{
19
+ action: z.ZodEnum<["postback", "url", "say"]>;
20
+ label: z.ZodString;
21
+ value: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ value: string;
24
+ action: "url" | "postback" | "say";
25
+ label: string;
26
+ }, {
27
+ value: string;
28
+ action: "url" | "postback" | "say";
29
+ label: string;
30
+ }>, "many">;
31
+ type: z.ZodLiteral<"card">;
32
+ }, "strip", z.ZodTypeAny, {
33
+ type: "card";
34
+ title: string;
35
+ actions: {
36
+ value: string;
37
+ action: "url" | "postback" | "say";
38
+ label: string;
39
+ }[];
40
+ subtitle?: string | undefined;
41
+ imageUrl?: string | undefined;
42
+ }, {
43
+ type: "card";
44
+ title: string;
45
+ actions: {
46
+ value: string;
47
+ action: "url" | "postback" | "say";
48
+ label: string;
49
+ }[];
50
+ subtitle?: string | undefined;
51
+ imageUrl?: string | undefined;
52
+ }>, z.ZodObject<{
53
+ items: z.ZodArray<z.ZodObject<{
54
+ title: z.ZodString;
55
+ subtitle: z.ZodOptional<z.ZodString>;
56
+ imageUrl: z.ZodOptional<z.ZodString>;
57
+ actions: z.ZodArray<z.ZodObject<{
58
+ action: z.ZodEnum<["postback", "url", "say"]>;
59
+ label: z.ZodString;
60
+ value: z.ZodString;
61
+ }, "strip", z.ZodTypeAny, {
62
+ value: string;
63
+ action: "url" | "postback" | "say";
64
+ label: string;
65
+ }, {
66
+ value: string;
67
+ action: "url" | "postback" | "say";
68
+ label: string;
69
+ }>, "many">;
70
+ }, "strip", z.ZodTypeAny, {
71
+ title: string;
72
+ actions: {
73
+ value: string;
74
+ action: "url" | "postback" | "say";
75
+ label: string;
76
+ }[];
77
+ subtitle?: string | undefined;
78
+ imageUrl?: string | undefined;
79
+ }, {
80
+ title: string;
81
+ actions: {
82
+ value: string;
83
+ action: "url" | "postback" | "say";
84
+ label: string;
85
+ }[];
86
+ subtitle?: string | undefined;
87
+ imageUrl?: string | undefined;
88
+ }>, "many">;
89
+ type: z.ZodLiteral<"carousel">;
90
+ }, "strip", z.ZodTypeAny, {
91
+ type: "carousel";
92
+ items: {
93
+ title: string;
94
+ actions: {
95
+ value: string;
96
+ action: "url" | "postback" | "say";
97
+ label: string;
98
+ }[];
99
+ subtitle?: string | undefined;
100
+ imageUrl?: string | undefined;
101
+ }[];
102
+ }, {
103
+ type: "carousel";
104
+ items: {
105
+ title: string;
106
+ actions: {
107
+ value: string;
108
+ action: "url" | "postback" | "say";
109
+ label: string;
110
+ }[];
111
+ subtitle?: string | undefined;
112
+ imageUrl?: string | undefined;
113
+ }[];
114
+ }>, z.ZodObject<{
115
+ text: z.ZodString;
116
+ options: z.ZodArray<z.ZodObject<{
117
+ label: z.ZodString;
118
+ value: z.ZodString;
119
+ }, "strip", z.ZodTypeAny, {
120
+ value: string;
121
+ label: string;
122
+ }, {
123
+ value: string;
124
+ label: string;
125
+ }>, "many">;
126
+ type: z.ZodLiteral<"choice">;
127
+ }, "strip", z.ZodTypeAny, {
128
+ type: "choice";
129
+ options: {
130
+ value: string;
131
+ label: string;
132
+ }[];
133
+ text: string;
134
+ }, {
135
+ type: "choice";
136
+ options: {
137
+ value: string;
138
+ label: string;
139
+ }[];
140
+ text: string;
141
+ }>, z.ZodObject<{
142
+ text: z.ZodString;
143
+ options: z.ZodArray<z.ZodObject<{
144
+ label: z.ZodString;
145
+ value: z.ZodString;
146
+ }, "strip", z.ZodTypeAny, {
147
+ value: string;
148
+ label: string;
149
+ }, {
150
+ value: string;
151
+ label: string;
152
+ }>, "many">;
153
+ type: z.ZodLiteral<"dropdown">;
154
+ }, "strip", z.ZodTypeAny, {
155
+ type: "dropdown";
156
+ options: {
157
+ value: string;
158
+ label: string;
159
+ }[];
160
+ text: string;
161
+ }, {
162
+ type: "dropdown";
163
+ options: {
164
+ value: string;
165
+ label: string;
166
+ }[];
167
+ text: string;
168
+ }>, z.ZodObject<{
169
+ fileUrl: z.ZodString;
170
+ title: z.ZodOptional<z.ZodString>;
171
+ type: z.ZodLiteral<"file">;
172
+ }, "strip", z.ZodTypeAny, {
173
+ type: "file";
174
+ fileUrl: string;
175
+ title?: string | undefined;
176
+ }, {
177
+ type: "file";
178
+ fileUrl: string;
179
+ title?: string | undefined;
180
+ }>, z.ZodObject<{
181
+ imageUrl: z.ZodString;
182
+ type: z.ZodLiteral<"image">;
183
+ }, "strip", z.ZodTypeAny, {
184
+ type: "image";
185
+ imageUrl: string;
186
+ }, {
187
+ type: "image";
188
+ imageUrl: string;
189
+ }>, z.ZodObject<{
190
+ latitude: z.ZodNumber;
191
+ longitude: z.ZodNumber;
192
+ address: z.ZodOptional<z.ZodString>;
193
+ title: z.ZodOptional<z.ZodString>;
194
+ type: z.ZodLiteral<"location">;
195
+ }, "strip", z.ZodTypeAny, {
196
+ type: "location";
197
+ latitude: number;
198
+ longitude: number;
199
+ address?: string | undefined;
200
+ title?: string | undefined;
201
+ }, {
202
+ type: "location";
203
+ latitude: number;
204
+ longitude: number;
205
+ address?: string | undefined;
206
+ title?: string | undefined;
207
+ }>, z.ZodObject<{
208
+ markdown: z.ZodString;
209
+ type: z.ZodLiteral<"markdown">;
210
+ }, "strip", z.ZodTypeAny, {
211
+ type: "markdown";
212
+ markdown: string;
213
+ }, {
214
+ type: "markdown";
215
+ markdown: string;
216
+ }>, z.ZodObject<{
217
+ text: z.ZodString;
218
+ type: z.ZodLiteral<"text">;
219
+ }, "strip", z.ZodTypeAny, {
220
+ type: "text";
221
+ text: string;
222
+ }, {
223
+ type: "text";
224
+ text: string;
225
+ }>, z.ZodObject<{
226
+ videoUrl: z.ZodString;
227
+ type: z.ZodLiteral<"video">;
228
+ }, "strip", z.ZodTypeAny, {
229
+ type: "video";
230
+ videoUrl: string;
231
+ }, {
232
+ type: "video";
233
+ videoUrl: string;
234
+ }>]>;
235
+ userId: z.ZodString;
236
+ conversationId: z.ZodString;
237
+ }, "strip", z.ZodTypeAny, {
238
+ payload: {
239
+ type: "audio";
240
+ audioUrl: string;
241
+ } | {
242
+ type: "card";
243
+ title: string;
244
+ actions: {
245
+ value: string;
246
+ action: "url" | "postback" | "say";
247
+ label: string;
248
+ }[];
249
+ subtitle?: string | undefined;
250
+ imageUrl?: string | undefined;
251
+ } | {
252
+ type: "carousel";
253
+ items: {
254
+ title: string;
255
+ actions: {
256
+ value: string;
257
+ action: "url" | "postback" | "say";
258
+ label: string;
259
+ }[];
260
+ subtitle?: string | undefined;
261
+ imageUrl?: string | undefined;
262
+ }[];
263
+ } | {
264
+ type: "choice";
265
+ options: {
266
+ value: string;
267
+ label: string;
268
+ }[];
269
+ text: string;
270
+ } | {
271
+ type: "dropdown";
272
+ options: {
273
+ value: string;
274
+ label: string;
275
+ }[];
276
+ text: string;
277
+ } | {
278
+ type: "file";
279
+ fileUrl: string;
280
+ title?: string | undefined;
281
+ } | {
282
+ type: "image";
283
+ imageUrl: string;
284
+ } | {
285
+ type: "location";
286
+ latitude: number;
287
+ longitude: number;
288
+ address?: string | undefined;
289
+ title?: string | undefined;
290
+ } | {
291
+ type: "markdown";
292
+ markdown: string;
293
+ } | {
294
+ type: "text";
295
+ text: string;
296
+ } | {
297
+ type: "video";
298
+ videoUrl: string;
299
+ };
300
+ id: string;
301
+ userId: string;
302
+ conversationId: string;
303
+ createdAt: string;
304
+ }, {
305
+ payload: {
306
+ type: "audio";
307
+ audioUrl: string;
308
+ } | {
309
+ type: "card";
310
+ title: string;
311
+ actions: {
312
+ value: string;
313
+ action: "url" | "postback" | "say";
314
+ label: string;
315
+ }[];
316
+ subtitle?: string | undefined;
317
+ imageUrl?: string | undefined;
318
+ } | {
319
+ type: "carousel";
320
+ items: {
321
+ title: string;
322
+ actions: {
323
+ value: string;
324
+ action: "url" | "postback" | "say";
325
+ label: string;
326
+ }[];
327
+ subtitle?: string | undefined;
328
+ imageUrl?: string | undefined;
329
+ }[];
330
+ } | {
331
+ type: "choice";
332
+ options: {
333
+ value: string;
334
+ label: string;
335
+ }[];
336
+ text: string;
337
+ } | {
338
+ type: "dropdown";
339
+ options: {
340
+ value: string;
341
+ label: string;
342
+ }[];
343
+ text: string;
344
+ } | {
345
+ type: "file";
346
+ fileUrl: string;
347
+ title?: string | undefined;
348
+ } | {
349
+ type: "image";
350
+ imageUrl: string;
351
+ } | {
352
+ type: "location";
353
+ latitude: number;
354
+ longitude: number;
355
+ address?: string | undefined;
356
+ title?: string | undefined;
357
+ } | {
358
+ type: "markdown";
359
+ markdown: string;
360
+ } | {
361
+ type: "text";
362
+ text: string;
363
+ } | {
364
+ type: "video";
365
+ videoUrl: string;
366
+ };
367
+ id: string;
368
+ userId: string;
369
+ conversationId: string;
370
+ createdAt: string;
371
+ }>;
372
+ export default _default;
@@ -0,0 +1,29 @@
1
+ declare const _default: {
2
+ type: string;
3
+ properties: {
4
+ name: {
5
+ type: string;
6
+ };
7
+ pictureUrl: {
8
+ type: string;
9
+ };
10
+ profile: {
11
+ type: string;
12
+ };
13
+ id: {
14
+ type: string;
15
+ };
16
+ createdAt: {
17
+ type: string;
18
+ format: string;
19
+ };
20
+ updatedAt: {
21
+ type: string;
22
+ format: string;
23
+ };
24
+ };
25
+ required: string[];
26
+ additionalProperties: boolean;
27
+ $schema: string;
28
+ };
29
+ export default _default;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ export interface User {
7
+ name?: string;
8
+ pictureUrl?: string;
9
+ profile?: string;
10
+ id: string;
11
+ createdAt: string;
12
+ updatedAt: string;
13
+ }
@@ -0,0 +1,24 @@
1
+ import { z } from "zod";
2
+ declare const _default: z.ZodObject<{
3
+ name: z.ZodOptional<z.ZodString>;
4
+ pictureUrl: z.ZodOptional<z.ZodString>;
5
+ profile: z.ZodOptional<z.ZodString>;
6
+ id: z.ZodString;
7
+ createdAt: z.ZodString;
8
+ updatedAt: z.ZodString;
9
+ }, "strip", z.ZodTypeAny, {
10
+ id: string;
11
+ createdAt: string;
12
+ updatedAt: string;
13
+ name?: string | undefined;
14
+ pictureUrl?: string | undefined;
15
+ profile?: string | undefined;
16
+ }, {
17
+ id: string;
18
+ createdAt: string;
19
+ updatedAt: string;
20
+ name?: string | undefined;
21
+ pictureUrl?: string | undefined;
22
+ profile?: string | undefined;
23
+ }>;
24
+ export default _default;
@@ -0,0 +1,24 @@
1
+ declare const _default: {
2
+ type: string;
3
+ properties: {
4
+ type: {
5
+ type: string;
6
+ const: string;
7
+ };
8
+ data: {
9
+ type: string;
10
+ properties: {
11
+ event: {
12
+ type: string;
13
+ additionalProperties: {};
14
+ };
15
+ };
16
+ required: string[];
17
+ additionalProperties: boolean;
18
+ };
19
+ };
20
+ required: string[];
21
+ additionalProperties: boolean;
22
+ $schema: string;
23
+ };
24
+ export default _default;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ export interface CustomSignal {
7
+ type: "custom";
8
+ data: {
9
+ event: {
10
+ [k: string]: any;
11
+ };
12
+ };
13
+ }
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+ declare const _default: z.ZodObject<{
3
+ type: z.ZodLiteral<"custom">;
4
+ data: z.ZodObject<{
5
+ event: z.ZodRecord<z.ZodString, z.ZodAny>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ event: Record<string, any>;
8
+ }, {
9
+ event: Record<string, any>;
10
+ }>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ type: "custom";
13
+ data: {
14
+ event: Record<string, any>;
15
+ };
16
+ }, {
17
+ type: "custom";
18
+ data: {
19
+ event: Record<string, any>;
20
+ };
21
+ }>;
22
+ export default _default;