@botpress/webchat 1.1.1 → 1.3.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 (99) hide show
  1. package/dist/client/MessagingClient/client.d.ts +8 -19
  2. package/dist/client/{ChatClient → PushpinClient}/index.d.ts +7 -5
  3. package/dist/client/PushpinClient/inner-client/event-emitter.d.ts +10 -0
  4. package/dist/client/PushpinClient/inner-client/eventsource.d.ts +22 -0
  5. package/dist/client/PushpinClient/inner-client/index.d.ts +41 -0
  6. package/dist/client/PushpinClient/inner-client/signal-listener.d.ts +47 -0
  7. package/dist/client/{ChatClient → PushpinClient}/state-machine.d.ts +13 -13
  8. package/dist/client/index.d.ts +1 -1
  9. package/dist/client/types.d.ts +8 -2
  10. package/dist/components/Avatar.d.ts +2 -3
  11. package/dist/components/Block.d.ts +3 -2
  12. package/dist/components/CloseWindow.d.ts +5 -0
  13. package/dist/components/Composer.d.ts +2 -2
  14. package/dist/components/Header.d.ts +1 -1
  15. package/dist/components/LoadingIndicator.d.ts +1 -1
  16. package/dist/components/MessageList.d.ts +1 -1
  17. package/dist/components/Modal.d.ts +2 -2
  18. package/dist/components/RestartConversation.d.ts +1 -1
  19. package/dist/components/Webchat.d.ts +1 -1
  20. package/dist/components/renderers/Audio.d.ts +1 -1
  21. package/dist/components/renderers/Button.d.ts +1 -1
  22. package/dist/components/renderers/Carousel.d.ts +1 -1
  23. package/dist/components/renderers/Dropdown.d.ts +1 -1
  24. package/dist/components/renderers/File.d.ts +1 -1
  25. package/dist/components/renderers/Image.d.ts +1 -1
  26. package/dist/components/renderers/Location.d.ts +1 -1
  27. package/dist/components/renderers/Text.d.ts +1 -1
  28. package/dist/components/renderers/Video.d.ts +1 -1
  29. package/dist/contexts/WebchatContext.d.ts +6 -6
  30. package/dist/gen/client/api.d.ts +2012 -0
  31. package/dist/gen/client/base.d.ts +54 -0
  32. package/dist/gen/client/client.d.ts +61 -0
  33. package/dist/gen/client/common.d.ts +65 -0
  34. package/dist/gen/client/configuration.d.ts +83 -0
  35. package/dist/gen/client/errors.d.ts +204 -0
  36. package/dist/gen/client/index.d.ts +13 -0
  37. package/dist/gen/models/conversation.j.d.ts +20 -0
  38. package/dist/gen/models/conversation.t.d.ts +10 -0
  39. package/dist/gen/models/conversation.z.d.ts +15 -0
  40. package/dist/gen/models/index.d.ts +1014 -0
  41. package/dist/gen/models/message.j.d.ts +490 -0
  42. package/dist/gen/models/message.t.d.ts +122 -0
  43. package/dist/gen/models/message.z.d.ts +439 -0
  44. package/dist/gen/models/user.j.d.ts +26 -0
  45. package/dist/gen/models/user.t.d.ts +12 -0
  46. package/dist/gen/models/user.z.d.ts +21 -0
  47. package/dist/gen/signals/customSignal.j.d.ts +24 -0
  48. package/dist/gen/signals/customSignal.t.d.ts +13 -0
  49. package/dist/gen/signals/customSignal.z.d.ts +22 -0
  50. package/dist/gen/signals/index.d.ts +1249 -0
  51. package/dist/gen/signals/messageCreatedSignal.j.d.ts +501 -0
  52. package/dist/gen/signals/messageCreatedSignal.t.d.ts +125 -0
  53. package/dist/gen/signals/messageCreatedSignal.z.d.ts +608 -0
  54. package/dist/gen/signals/webchatConfigSignal.j.d.ts +24 -0
  55. package/dist/gen/signals/webchatConfigSignal.t.d.ts +13 -0
  56. package/dist/gen/signals/webchatConfigSignal.z.d.ts +22 -0
  57. package/dist/gen/signals/webchatVisibilitySignal.j.d.ts +24 -0
  58. package/dist/gen/signals/webchatVisibilitySignal.t.d.ts +11 -0
  59. package/dist/gen/signals/webchatVisibilitySignal.z.d.ts +22 -0
  60. package/dist/get-client.d.ts +8 -0
  61. package/dist/hooks/useClient.d.ts +3 -3
  62. package/dist/hooks/useWebchatStore.d.ts +3 -0
  63. package/dist/index.d.ts +3 -4
  64. package/dist/index.js +31976 -85703
  65. package/dist/index.umd.cjs +117 -187
  66. package/dist/providers/ModalProvider.d.ts +1 -1
  67. package/dist/providers/WebchatProvider.d.ts +6 -5
  68. package/dist/schemas/configuration.d.ts +117 -0
  69. package/dist/schemas/index.d.ts +2 -0
  70. package/dist/schemas/init.d.ts +3844 -0
  71. package/dist/schemas/theme.d.ts +231 -232
  72. package/dist/types/block-type.d.ts +3 -6
  73. package/dist/types/configuration.d.ts +4 -16
  74. package/dist/types/index.d.ts +2 -0
  75. package/dist/types/init.d.ts +6 -0
  76. package/dist/types/theme.d.ts +7 -0
  77. package/dist/utils/index.d.ts +0 -2
  78. package/openapi/index.ts +31 -0
  79. package/openapi/package.json +5 -0
  80. package/openapi/readme.md +1 -0
  81. package/package.json +18 -38
  82. package/dist/App.d.ts +0 -11
  83. package/dist/client/MessagingClient/adapters/Trigger.d.ts +0 -33
  84. package/dist/components/dev-tools/DevTools.d.ts +0 -1
  85. package/dist/components/dev-tools/configuration.d.ts +0 -2
  86. package/dist/components/dev-tools/helpers.d.ts +0 -5
  87. package/dist/main.d.ts +0 -0
  88. package/dist/options.d.ts +0 -11
  89. package/dist/themes/base.d.ts +0 -3
  90. package/dist/themes/baseColors.d.ts +0 -736
  91. package/dist/themes/dawn.d.ts +0 -4
  92. package/dist/themes/eggplant.d.ts +0 -4
  93. package/dist/themes/index.d.ts +0 -3
  94. package/dist/themes/prism.d.ts +0 -4
  95. package/dist/themes/themeBuilder.d.ts +0 -27
  96. package/dist/twind.config.d.ts +0 -9
  97. package/dist/twind.d.ts +0 -16
  98. package/dist/utils/mergeThemes.d.ts +0 -2
  99. package/dist/utils/withBaseTheme.d.ts +0 -384
@@ -0,0 +1,490 @@
1
+ declare const _default: {
2
+ type: string;
3
+ properties: {
4
+ id: {
5
+ type: string;
6
+ };
7
+ createdAt: {
8
+ type: string;
9
+ format: string;
10
+ };
11
+ payload: {
12
+ anyOf: ({
13
+ type: string;
14
+ properties: {
15
+ audioUrl: {
16
+ type: string;
17
+ minLength: number;
18
+ };
19
+ className: {
20
+ type: string;
21
+ description: string;
22
+ };
23
+ type: {
24
+ type: string;
25
+ const: string;
26
+ };
27
+ title?: undefined;
28
+ subtitle?: undefined;
29
+ imageUrl?: undefined;
30
+ actions?: undefined;
31
+ items?: undefined;
32
+ text?: undefined;
33
+ options?: undefined;
34
+ disableFreeText?: undefined;
35
+ fileUrl?: undefined;
36
+ latitude?: undefined;
37
+ longitude?: undefined;
38
+ address?: undefined;
39
+ markdown?: undefined;
40
+ videoUrl?: undefined;
41
+ };
42
+ required: string[];
43
+ additionalProperties: boolean;
44
+ } | {
45
+ type: string;
46
+ properties: {
47
+ title: {
48
+ type: string;
49
+ minLength: number;
50
+ };
51
+ subtitle: {
52
+ type: string;
53
+ };
54
+ imageUrl: {
55
+ type: string;
56
+ minLength?: undefined;
57
+ };
58
+ actions: {
59
+ type: string;
60
+ items: {
61
+ type: string;
62
+ properties: {
63
+ action: {
64
+ type: string;
65
+ enum: string[];
66
+ };
67
+ label: {
68
+ type: string;
69
+ minLength: number;
70
+ };
71
+ value: {
72
+ type: string;
73
+ minLength: number;
74
+ };
75
+ };
76
+ required: string[];
77
+ additionalProperties: boolean;
78
+ };
79
+ };
80
+ type: {
81
+ type: string;
82
+ const: string;
83
+ };
84
+ className: {
85
+ type: string;
86
+ description: string;
87
+ };
88
+ audioUrl?: undefined;
89
+ items?: undefined;
90
+ text?: undefined;
91
+ options?: undefined;
92
+ disableFreeText?: undefined;
93
+ fileUrl?: undefined;
94
+ latitude?: undefined;
95
+ longitude?: undefined;
96
+ address?: undefined;
97
+ markdown?: undefined;
98
+ videoUrl?: undefined;
99
+ };
100
+ required: string[];
101
+ additionalProperties: boolean;
102
+ } | {
103
+ type: string;
104
+ properties: {
105
+ items: {
106
+ type: string;
107
+ items: {
108
+ type: string;
109
+ properties: {
110
+ title: {
111
+ type: string;
112
+ minLength: number;
113
+ };
114
+ subtitle: {
115
+ type: string;
116
+ };
117
+ imageUrl: {
118
+ type: string;
119
+ };
120
+ actions: {
121
+ type: string;
122
+ items: {
123
+ type: string;
124
+ properties: {
125
+ action: {
126
+ type: string;
127
+ enum: string[];
128
+ };
129
+ label: {
130
+ type: string;
131
+ minLength: number;
132
+ };
133
+ value: {
134
+ type: string;
135
+ minLength: number;
136
+ };
137
+ };
138
+ required: string[];
139
+ additionalProperties: boolean;
140
+ };
141
+ };
142
+ className: {
143
+ type: string;
144
+ description: string;
145
+ };
146
+ };
147
+ required: string[];
148
+ additionalProperties: boolean;
149
+ };
150
+ };
151
+ className: {
152
+ type: string;
153
+ description: string;
154
+ };
155
+ type: {
156
+ type: string;
157
+ const: string;
158
+ };
159
+ audioUrl?: undefined;
160
+ title?: undefined;
161
+ subtitle?: undefined;
162
+ imageUrl?: undefined;
163
+ actions?: undefined;
164
+ text?: undefined;
165
+ options?: undefined;
166
+ disableFreeText?: undefined;
167
+ fileUrl?: undefined;
168
+ latitude?: undefined;
169
+ longitude?: undefined;
170
+ address?: undefined;
171
+ markdown?: undefined;
172
+ videoUrl?: undefined;
173
+ };
174
+ required: string[];
175
+ additionalProperties: boolean;
176
+ } | {
177
+ type: string;
178
+ properties: {
179
+ text: {
180
+ type: string;
181
+ minLength?: undefined;
182
+ };
183
+ options: {
184
+ type: string;
185
+ items: {
186
+ type: string;
187
+ properties: {
188
+ label: {
189
+ type: string;
190
+ minLength: number;
191
+ };
192
+ value: {
193
+ type: string;
194
+ minLength: number;
195
+ };
196
+ };
197
+ required: string[];
198
+ additionalProperties: boolean;
199
+ };
200
+ };
201
+ className: {
202
+ type: string;
203
+ description: string;
204
+ };
205
+ type: {
206
+ type: string;
207
+ const: string;
208
+ };
209
+ disableFreeText: {
210
+ type: string;
211
+ };
212
+ audioUrl?: undefined;
213
+ title?: undefined;
214
+ subtitle?: undefined;
215
+ imageUrl?: undefined;
216
+ actions?: undefined;
217
+ items?: undefined;
218
+ fileUrl?: undefined;
219
+ latitude?: undefined;
220
+ longitude?: undefined;
221
+ address?: undefined;
222
+ markdown?: undefined;
223
+ videoUrl?: undefined;
224
+ };
225
+ required: string[];
226
+ additionalProperties: boolean;
227
+ } | {
228
+ type: string;
229
+ properties: {
230
+ text: {
231
+ type: string;
232
+ minLength?: undefined;
233
+ };
234
+ options: {
235
+ type: string;
236
+ items: {
237
+ type: string;
238
+ properties: {
239
+ label: {
240
+ type: string;
241
+ minLength: number;
242
+ };
243
+ value: {
244
+ type: string;
245
+ minLength: number;
246
+ };
247
+ };
248
+ required: string[];
249
+ additionalProperties: boolean;
250
+ };
251
+ };
252
+ className: {
253
+ type: string;
254
+ description: string;
255
+ };
256
+ type: {
257
+ type: string;
258
+ const: string;
259
+ };
260
+ audioUrl?: undefined;
261
+ title?: undefined;
262
+ subtitle?: undefined;
263
+ imageUrl?: undefined;
264
+ actions?: undefined;
265
+ items?: undefined;
266
+ disableFreeText?: undefined;
267
+ fileUrl?: undefined;
268
+ latitude?: undefined;
269
+ longitude?: undefined;
270
+ address?: undefined;
271
+ markdown?: undefined;
272
+ videoUrl?: undefined;
273
+ };
274
+ required: string[];
275
+ additionalProperties: boolean;
276
+ } | {
277
+ type: string;
278
+ properties: {
279
+ fileUrl: {
280
+ type: string;
281
+ minLength: number;
282
+ };
283
+ title: {
284
+ type: string;
285
+ minLength: number;
286
+ };
287
+ className: {
288
+ type: string;
289
+ description: string;
290
+ };
291
+ type: {
292
+ type: string;
293
+ const: string;
294
+ };
295
+ audioUrl?: undefined;
296
+ subtitle?: undefined;
297
+ imageUrl?: undefined;
298
+ actions?: undefined;
299
+ items?: undefined;
300
+ text?: undefined;
301
+ options?: undefined;
302
+ disableFreeText?: undefined;
303
+ latitude?: undefined;
304
+ longitude?: undefined;
305
+ address?: undefined;
306
+ markdown?: undefined;
307
+ videoUrl?: undefined;
308
+ };
309
+ required: string[];
310
+ additionalProperties: boolean;
311
+ } | {
312
+ type: string;
313
+ properties: {
314
+ imageUrl: {
315
+ type: string;
316
+ minLength: number;
317
+ };
318
+ className: {
319
+ type: string;
320
+ description: string;
321
+ };
322
+ type: {
323
+ type: string;
324
+ const: string;
325
+ };
326
+ audioUrl?: undefined;
327
+ title?: undefined;
328
+ subtitle?: undefined;
329
+ actions?: undefined;
330
+ items?: undefined;
331
+ text?: undefined;
332
+ options?: undefined;
333
+ disableFreeText?: undefined;
334
+ fileUrl?: undefined;
335
+ latitude?: undefined;
336
+ longitude?: undefined;
337
+ address?: undefined;
338
+ markdown?: undefined;
339
+ videoUrl?: undefined;
340
+ };
341
+ required: string[];
342
+ additionalProperties: boolean;
343
+ } | {
344
+ type: string;
345
+ properties: {
346
+ latitude: {
347
+ type: string;
348
+ };
349
+ longitude: {
350
+ type: string;
351
+ };
352
+ address: {
353
+ type: string;
354
+ };
355
+ title: {
356
+ type: string;
357
+ minLength?: undefined;
358
+ };
359
+ className: {
360
+ type: string;
361
+ description: string;
362
+ };
363
+ type: {
364
+ type: string;
365
+ const: string;
366
+ };
367
+ audioUrl?: undefined;
368
+ subtitle?: undefined;
369
+ imageUrl?: undefined;
370
+ actions?: undefined;
371
+ items?: undefined;
372
+ text?: undefined;
373
+ options?: undefined;
374
+ disableFreeText?: undefined;
375
+ fileUrl?: undefined;
376
+ markdown?: undefined;
377
+ videoUrl?: undefined;
378
+ };
379
+ required: string[];
380
+ additionalProperties: boolean;
381
+ } | {
382
+ type: string;
383
+ properties: {
384
+ markdown: {
385
+ type: string;
386
+ minLength: number;
387
+ };
388
+ className: {
389
+ type: string;
390
+ description: string;
391
+ };
392
+ type: {
393
+ type: string;
394
+ const: string;
395
+ };
396
+ audioUrl?: undefined;
397
+ title?: undefined;
398
+ subtitle?: undefined;
399
+ imageUrl?: undefined;
400
+ actions?: undefined;
401
+ items?: undefined;
402
+ text?: undefined;
403
+ options?: undefined;
404
+ disableFreeText?: undefined;
405
+ fileUrl?: undefined;
406
+ latitude?: undefined;
407
+ longitude?: undefined;
408
+ address?: undefined;
409
+ videoUrl?: undefined;
410
+ };
411
+ required: string[];
412
+ additionalProperties: boolean;
413
+ } | {
414
+ type: string;
415
+ properties: {
416
+ text: {
417
+ type: string;
418
+ minLength: number;
419
+ };
420
+ className: {
421
+ type: string;
422
+ description: string;
423
+ };
424
+ type: {
425
+ type: string;
426
+ const: string;
427
+ };
428
+ audioUrl?: undefined;
429
+ title?: undefined;
430
+ subtitle?: undefined;
431
+ imageUrl?: undefined;
432
+ actions?: undefined;
433
+ items?: undefined;
434
+ options?: undefined;
435
+ disableFreeText?: undefined;
436
+ fileUrl?: undefined;
437
+ latitude?: undefined;
438
+ longitude?: undefined;
439
+ address?: undefined;
440
+ markdown?: undefined;
441
+ videoUrl?: undefined;
442
+ };
443
+ required: string[];
444
+ additionalProperties: boolean;
445
+ } | {
446
+ type: string;
447
+ properties: {
448
+ videoUrl: {
449
+ type: string;
450
+ minLength: number;
451
+ };
452
+ className: {
453
+ type: string;
454
+ description: string;
455
+ };
456
+ type: {
457
+ type: string;
458
+ const: string;
459
+ };
460
+ audioUrl?: undefined;
461
+ title?: undefined;
462
+ subtitle?: undefined;
463
+ imageUrl?: undefined;
464
+ actions?: undefined;
465
+ items?: undefined;
466
+ text?: undefined;
467
+ options?: undefined;
468
+ disableFreeText?: undefined;
469
+ fileUrl?: undefined;
470
+ latitude?: undefined;
471
+ longitude?: undefined;
472
+ address?: undefined;
473
+ markdown?: undefined;
474
+ };
475
+ required: string[];
476
+ additionalProperties: boolean;
477
+ })[];
478
+ };
479
+ userId: {
480
+ type: string;
481
+ };
482
+ conversationId: {
483
+ type: string;
484
+ };
485
+ };
486
+ required: string[];
487
+ additionalProperties: boolean;
488
+ $schema: string;
489
+ };
490
+ export default _default;
@@ -0,0 +1,122 @@
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 Message {
7
+ id: string;
8
+ createdAt: string;
9
+ payload: {
10
+ audioUrl: string;
11
+ /**
12
+ * CSS className to apply to the message
13
+ */
14
+ className?: string;
15
+ type: "audio";
16
+ } | {
17
+ title: string;
18
+ subtitle?: string;
19
+ imageUrl?: string;
20
+ actions: {
21
+ action: "postback" | "url" | "say";
22
+ label: string;
23
+ value: string;
24
+ }[];
25
+ type: "card";
26
+ /**
27
+ * CSS className to apply to the message
28
+ */
29
+ className?: string;
30
+ } | {
31
+ items: {
32
+ title: string;
33
+ subtitle?: string;
34
+ imageUrl?: string;
35
+ actions: {
36
+ action: "postback" | "url" | "say";
37
+ label: string;
38
+ value: string;
39
+ }[];
40
+ /**
41
+ * CSS className to apply to the message
42
+ */
43
+ className?: string;
44
+ }[];
45
+ /**
46
+ * CSS className to apply to the message
47
+ */
48
+ className?: string;
49
+ type: "carousel";
50
+ } | {
51
+ text: string;
52
+ options: {
53
+ label: string;
54
+ value: string;
55
+ }[];
56
+ /**
57
+ * CSS className to apply to the message
58
+ */
59
+ className?: string;
60
+ type: "choice";
61
+ disableFreeText?: boolean;
62
+ } | {
63
+ text: string;
64
+ options: {
65
+ label: string;
66
+ value: string;
67
+ }[];
68
+ /**
69
+ * CSS className to apply to the message
70
+ */
71
+ className?: string;
72
+ type: "dropdown";
73
+ } | {
74
+ fileUrl: string;
75
+ title?: string;
76
+ /**
77
+ * CSS className to apply to the message
78
+ */
79
+ className?: string;
80
+ type: "file";
81
+ } | {
82
+ imageUrl: string;
83
+ /**
84
+ * CSS className to apply to the message
85
+ */
86
+ className?: string;
87
+ type: "image";
88
+ } | {
89
+ latitude: number;
90
+ longitude: number;
91
+ address?: string;
92
+ title?: string;
93
+ /**
94
+ * CSS className to apply to the message
95
+ */
96
+ className?: string;
97
+ type: "location";
98
+ } | {
99
+ markdown: string;
100
+ /**
101
+ * CSS className to apply to the message
102
+ */
103
+ className?: string;
104
+ type: "markdown";
105
+ } | {
106
+ text: string;
107
+ /**
108
+ * CSS className to apply to the message
109
+ */
110
+ className?: string;
111
+ type: "text";
112
+ } | {
113
+ videoUrl: string;
114
+ /**
115
+ * CSS className to apply to the message
116
+ */
117
+ className?: string;
118
+ type: "video";
119
+ };
120
+ userId: string;
121
+ conversationId: string;
122
+ }