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