@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,388 @@
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
+ type: {
20
+ type: string;
21
+ const: string;
22
+ };
23
+ title?: undefined;
24
+ subtitle?: undefined;
25
+ imageUrl?: undefined;
26
+ actions?: undefined;
27
+ items?: undefined;
28
+ text?: undefined;
29
+ options?: undefined;
30
+ fileUrl?: undefined;
31
+ latitude?: undefined;
32
+ longitude?: undefined;
33
+ address?: undefined;
34
+ markdown?: undefined;
35
+ videoUrl?: undefined;
36
+ };
37
+ required: string[];
38
+ additionalProperties: boolean;
39
+ } | {
40
+ type: string;
41
+ properties: {
42
+ title: {
43
+ type: string;
44
+ minLength: number;
45
+ };
46
+ subtitle: {
47
+ type: string;
48
+ minLength: number;
49
+ };
50
+ imageUrl: {
51
+ type: string;
52
+ minLength: number;
53
+ };
54
+ actions: {
55
+ type: string;
56
+ items: {
57
+ type: string;
58
+ properties: {
59
+ action: {
60
+ type: string;
61
+ enum: string[];
62
+ };
63
+ label: {
64
+ type: string;
65
+ minLength: number;
66
+ };
67
+ value: {
68
+ type: string;
69
+ minLength: number;
70
+ };
71
+ };
72
+ required: string[];
73
+ additionalProperties: boolean;
74
+ };
75
+ };
76
+ type: {
77
+ type: string;
78
+ const: string;
79
+ };
80
+ audioUrl?: undefined;
81
+ items?: undefined;
82
+ text?: undefined;
83
+ options?: undefined;
84
+ fileUrl?: undefined;
85
+ latitude?: undefined;
86
+ longitude?: undefined;
87
+ address?: undefined;
88
+ markdown?: undefined;
89
+ videoUrl?: undefined;
90
+ };
91
+ required: string[];
92
+ additionalProperties: boolean;
93
+ } | {
94
+ type: string;
95
+ properties: {
96
+ items: {
97
+ type: string;
98
+ items: {
99
+ type: string;
100
+ properties: {
101
+ title: {
102
+ type: string;
103
+ minLength: number;
104
+ };
105
+ subtitle: {
106
+ type: string;
107
+ minLength: number;
108
+ };
109
+ imageUrl: {
110
+ type: string;
111
+ minLength: number;
112
+ };
113
+ actions: {
114
+ type: string;
115
+ items: {
116
+ type: string;
117
+ properties: {
118
+ action: {
119
+ type: string;
120
+ enum: string[];
121
+ };
122
+ label: {
123
+ type: string;
124
+ minLength: number;
125
+ };
126
+ value: {
127
+ type: string;
128
+ minLength: number;
129
+ };
130
+ };
131
+ required: string[];
132
+ additionalProperties: boolean;
133
+ };
134
+ };
135
+ };
136
+ required: string[];
137
+ additionalProperties: boolean;
138
+ };
139
+ };
140
+ type: {
141
+ type: string;
142
+ const: string;
143
+ };
144
+ audioUrl?: undefined;
145
+ title?: undefined;
146
+ subtitle?: undefined;
147
+ imageUrl?: undefined;
148
+ actions?: undefined;
149
+ text?: undefined;
150
+ options?: undefined;
151
+ fileUrl?: undefined;
152
+ latitude?: undefined;
153
+ longitude?: undefined;
154
+ address?: undefined;
155
+ markdown?: undefined;
156
+ videoUrl?: undefined;
157
+ };
158
+ required: string[];
159
+ additionalProperties: boolean;
160
+ } | {
161
+ type: string;
162
+ properties: {
163
+ text: {
164
+ type: string;
165
+ minLength: number;
166
+ };
167
+ options: {
168
+ type: string;
169
+ items: {
170
+ type: string;
171
+ properties: {
172
+ label: {
173
+ type: string;
174
+ minLength: number;
175
+ };
176
+ value: {
177
+ type: string;
178
+ minLength: number;
179
+ };
180
+ };
181
+ required: string[];
182
+ additionalProperties: boolean;
183
+ };
184
+ };
185
+ type: {
186
+ type: string;
187
+ const: string;
188
+ };
189
+ audioUrl?: undefined;
190
+ title?: undefined;
191
+ subtitle?: undefined;
192
+ imageUrl?: undefined;
193
+ actions?: undefined;
194
+ items?: undefined;
195
+ fileUrl?: undefined;
196
+ latitude?: undefined;
197
+ longitude?: undefined;
198
+ address?: undefined;
199
+ markdown?: undefined;
200
+ videoUrl?: undefined;
201
+ };
202
+ required: string[];
203
+ additionalProperties: boolean;
204
+ } | {
205
+ type: string;
206
+ properties: {
207
+ fileUrl: {
208
+ type: string;
209
+ minLength: number;
210
+ };
211
+ title: {
212
+ type: string;
213
+ minLength: number;
214
+ };
215
+ type: {
216
+ type: string;
217
+ const: string;
218
+ };
219
+ audioUrl?: undefined;
220
+ subtitle?: undefined;
221
+ imageUrl?: undefined;
222
+ actions?: undefined;
223
+ items?: undefined;
224
+ text?: undefined;
225
+ options?: 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
+ imageUrl: {
238
+ type: string;
239
+ minLength: number;
240
+ };
241
+ type: {
242
+ type: string;
243
+ const: string;
244
+ };
245
+ audioUrl?: undefined;
246
+ title?: undefined;
247
+ subtitle?: undefined;
248
+ actions?: undefined;
249
+ items?: undefined;
250
+ text?: undefined;
251
+ options?: undefined;
252
+ fileUrl?: undefined;
253
+ latitude?: undefined;
254
+ longitude?: undefined;
255
+ address?: undefined;
256
+ markdown?: undefined;
257
+ videoUrl?: undefined;
258
+ };
259
+ required: string[];
260
+ additionalProperties: boolean;
261
+ } | {
262
+ type: string;
263
+ properties: {
264
+ latitude: {
265
+ type: string;
266
+ };
267
+ longitude: {
268
+ type: string;
269
+ };
270
+ address: {
271
+ type: string;
272
+ };
273
+ title: {
274
+ type: string;
275
+ minLength?: undefined;
276
+ };
277
+ type: {
278
+ type: string;
279
+ const: string;
280
+ };
281
+ audioUrl?: undefined;
282
+ subtitle?: undefined;
283
+ imageUrl?: undefined;
284
+ actions?: undefined;
285
+ items?: undefined;
286
+ text?: undefined;
287
+ options?: undefined;
288
+ fileUrl?: undefined;
289
+ markdown?: undefined;
290
+ videoUrl?: undefined;
291
+ };
292
+ required: string[];
293
+ additionalProperties: boolean;
294
+ } | {
295
+ type: string;
296
+ properties: {
297
+ markdown: {
298
+ type: string;
299
+ minLength: number;
300
+ };
301
+ type: {
302
+ type: string;
303
+ const: string;
304
+ };
305
+ audioUrl?: undefined;
306
+ title?: undefined;
307
+ subtitle?: undefined;
308
+ imageUrl?: undefined;
309
+ actions?: undefined;
310
+ items?: undefined;
311
+ text?: undefined;
312
+ options?: undefined;
313
+ fileUrl?: undefined;
314
+ latitude?: undefined;
315
+ longitude?: undefined;
316
+ address?: undefined;
317
+ videoUrl?: undefined;
318
+ };
319
+ required: string[];
320
+ additionalProperties: boolean;
321
+ } | {
322
+ type: string;
323
+ properties: {
324
+ text: {
325
+ type: string;
326
+ minLength: number;
327
+ };
328
+ type: {
329
+ type: string;
330
+ const: string;
331
+ };
332
+ audioUrl?: undefined;
333
+ title?: undefined;
334
+ subtitle?: undefined;
335
+ imageUrl?: undefined;
336
+ actions?: undefined;
337
+ items?: undefined;
338
+ options?: undefined;
339
+ fileUrl?: undefined;
340
+ latitude?: undefined;
341
+ longitude?: undefined;
342
+ address?: undefined;
343
+ markdown?: undefined;
344
+ videoUrl?: undefined;
345
+ };
346
+ required: string[];
347
+ additionalProperties: boolean;
348
+ } | {
349
+ type: string;
350
+ properties: {
351
+ videoUrl: {
352
+ type: string;
353
+ minLength: number;
354
+ };
355
+ type: {
356
+ type: string;
357
+ const: string;
358
+ };
359
+ audioUrl?: undefined;
360
+ title?: undefined;
361
+ subtitle?: undefined;
362
+ imageUrl?: undefined;
363
+ actions?: undefined;
364
+ items?: undefined;
365
+ text?: undefined;
366
+ options?: undefined;
367
+ fileUrl?: undefined;
368
+ latitude?: undefined;
369
+ longitude?: undefined;
370
+ address?: undefined;
371
+ markdown?: undefined;
372
+ };
373
+ required: string[];
374
+ additionalProperties: boolean;
375
+ })[];
376
+ };
377
+ userId: {
378
+ type: string;
379
+ };
380
+ conversationId: {
381
+ type: string;
382
+ };
383
+ };
384
+ required: string[];
385
+ additionalProperties: boolean;
386
+ $schema: string;
387
+ };
388
+ export default _default;
@@ -0,0 +1,73 @@
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
+ type: "audio";
12
+ } | {
13
+ title: string;
14
+ subtitle?: string;
15
+ imageUrl?: string;
16
+ actions: {
17
+ action: "postback" | "url" | "say";
18
+ label: string;
19
+ value: string;
20
+ }[];
21
+ type: "card";
22
+ } | {
23
+ items: {
24
+ title: string;
25
+ subtitle?: string;
26
+ imageUrl?: string;
27
+ actions: {
28
+ action: "postback" | "url" | "say";
29
+ label: string;
30
+ value: string;
31
+ }[];
32
+ }[];
33
+ type: "carousel";
34
+ } | {
35
+ text: string;
36
+ options: {
37
+ label: string;
38
+ value: string;
39
+ }[];
40
+ type: "choice";
41
+ } | {
42
+ text: string;
43
+ options: {
44
+ label: string;
45
+ value: string;
46
+ }[];
47
+ type: "dropdown";
48
+ } | {
49
+ fileUrl: string;
50
+ title?: string;
51
+ type: "file";
52
+ } | {
53
+ imageUrl: string;
54
+ type: "image";
55
+ } | {
56
+ latitude: number;
57
+ longitude: number;
58
+ address?: string;
59
+ title?: string;
60
+ type: "location";
61
+ } | {
62
+ markdown: string;
63
+ type: "markdown";
64
+ } | {
65
+ text: string;
66
+ type: "text";
67
+ } | {
68
+ videoUrl: string;
69
+ type: "video";
70
+ };
71
+ userId: string;
72
+ conversationId: string;
73
+ }