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