@botpress/webchat 1.2.0 → 1.3.1

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 (72) hide show
  1. package/dist/adapters/index.d.ts +4 -0
  2. package/dist/adapters/messaging-to-target.d.ts +151 -0
  3. package/dist/adapters/target.d.ts +77 -0
  4. package/dist/adapters/webchat-to-target.d.ts +126 -0
  5. package/dist/client/MessagingClient/client.d.ts +7 -4
  6. package/dist/client/PushpinClient/index.d.ts +4 -2
  7. package/dist/client/PushpinClient/inner-client/index.d.ts +2 -0
  8. package/dist/client/types.d.ts +4 -1
  9. package/dist/components/Avatar.d.ts +2 -3
  10. package/dist/components/Block.d.ts +3 -2
  11. package/dist/components/CloseWindow.d.ts +5 -0
  12. package/dist/components/Composer.d.ts +1 -1
  13. package/dist/components/renderers/Audio.d.ts +1 -1
  14. package/dist/components/renderers/Carousel.d.ts +1 -1
  15. package/dist/components/renderers/File.d.ts +1 -1
  16. package/dist/components/renderers/Image.d.ts +1 -1
  17. package/dist/components/renderers/Location.d.ts +1 -1
  18. package/dist/components/renderers/Video.d.ts +1 -1
  19. package/dist/contexts/WebchatContext.d.ts +3 -3
  20. package/dist/gen/client/api.d.ts +349 -31
  21. package/dist/gen/client/client.d.ts +21 -17
  22. package/dist/gen/client/errors.d.ts +9 -2
  23. package/dist/gen/models/index.d.ts +186 -23
  24. package/dist/gen/models/message.j.d.ts +107 -5
  25. package/dist/gen/models/message.t.d.ts +49 -0
  26. package/dist/gen/models/message.z.d.ts +79 -12
  27. package/dist/gen/models/user.j.d.ts +0 -3
  28. package/dist/gen/models/user.t.d.ts +0 -1
  29. package/dist/gen/models/user.z.d.ts +0 -3
  30. package/dist/gen/signals/index.d.ts +218 -23
  31. package/dist/gen/signals/messageCreatedSignal.j.d.ts +107 -5
  32. package/dist/gen/signals/messageCreatedSignal.t.d.ts +49 -0
  33. package/dist/gen/signals/messageCreatedSignal.z.d.ts +111 -18
  34. package/dist/get-client.d.ts +8 -0
  35. package/dist/hooks/useClient.d.ts +2 -2
  36. package/dist/hooks/useWebchatStore.d.ts +3 -0
  37. package/dist/index.d.ts +3 -4
  38. package/dist/index.js +33301 -40913
  39. package/dist/index.umd.cjs +96 -125
  40. package/dist/providers/WebchatProvider.d.ts +4 -3
  41. package/dist/schemas/configuration.d.ts +117 -0
  42. package/dist/schemas/index.d.ts +2 -0
  43. package/dist/schemas/init.d.ts +7650 -0
  44. package/dist/schemas/theme.d.ts +231 -232
  45. package/dist/types/block-type.d.ts +3 -6
  46. package/dist/types/configuration.d.ts +4 -16
  47. package/dist/types/index.d.ts +2 -0
  48. package/dist/types/init.d.ts +7 -0
  49. package/dist/types/theme.d.ts +7 -0
  50. package/dist/utils/index.d.ts +0 -2
  51. package/openapi.ts +40 -0
  52. package/package.json +15 -38
  53. package/dist/App.d.ts +0 -11
  54. package/dist/components/dev-tools/DevTools.d.ts +0 -1
  55. package/dist/components/dev-tools/configuration.d.ts +0 -2
  56. package/dist/components/dev-tools/helpers.d.ts +0 -5
  57. package/dist/main.d.ts +0 -0
  58. package/dist/options.d.ts +0 -11
  59. package/dist/themes/base.d.ts +0 -3
  60. package/dist/themes/baseColors.d.ts +0 -736
  61. package/dist/themes/dawn.d.ts +0 -4
  62. package/dist/themes/eggplant.d.ts +0 -4
  63. package/dist/themes/index.d.ts +0 -3
  64. package/dist/themes/prism.d.ts +0 -4
  65. package/dist/themes/themeBuilder.d.ts +0 -27
  66. package/dist/twind.config.d.ts +0 -9
  67. package/dist/twind.d.ts +0 -16
  68. package/dist/utils/mergeThemes.d.ts +0 -2
  69. package/dist/utils/withBaseTheme.d.ts +0 -384
  70. package/openapi/index.ts +0 -31
  71. package/openapi/package.json +0 -5
  72. package/openapi/readme.md +0 -1
@@ -4,13 +4,16 @@ declare const _default: z.ZodObject<{
4
4
  createdAt: z.ZodString;
5
5
  payload: z.ZodUnion<[z.ZodObject<{
6
6
  audioUrl: z.ZodString;
7
+ className: z.ZodOptional<z.ZodString>;
7
8
  type: z.ZodLiteral<"audio">;
8
9
  }, "strip", z.ZodTypeAny, {
9
10
  type: "audio";
10
11
  audioUrl: string;
12
+ className?: string | undefined;
11
13
  }, {
12
14
  type: "audio";
13
15
  audioUrl: string;
16
+ className?: string | undefined;
14
17
  }>, z.ZodObject<{
15
18
  title: z.ZodString;
16
19
  subtitle: z.ZodOptional<z.ZodString>;
@@ -29,9 +32,10 @@ declare const _default: z.ZodObject<{
29
32
  label: string;
30
33
  }>, "many">;
31
34
  type: z.ZodLiteral<"card">;
35
+ className: z.ZodOptional<z.ZodString>;
32
36
  }, "strip", z.ZodTypeAny, {
33
- type: "card";
34
37
  title: string;
38
+ type: "card";
35
39
  actions: {
36
40
  value: string;
37
41
  action: "url" | "postback" | "say";
@@ -39,9 +43,10 @@ declare const _default: z.ZodObject<{
39
43
  }[];
40
44
  subtitle?: string | undefined;
41
45
  imageUrl?: string | undefined;
46
+ className?: string | undefined;
42
47
  }, {
43
- type: "card";
44
48
  title: string;
49
+ type: "card";
45
50
  actions: {
46
51
  value: string;
47
52
  action: "url" | "postback" | "say";
@@ -49,6 +54,7 @@ declare const _default: z.ZodObject<{
49
54
  }[];
50
55
  subtitle?: string | undefined;
51
56
  imageUrl?: string | undefined;
57
+ className?: string | undefined;
52
58
  }>, z.ZodObject<{
53
59
  items: z.ZodArray<z.ZodObject<{
54
60
  title: z.ZodString;
@@ -67,6 +73,7 @@ declare const _default: z.ZodObject<{
67
73
  action: "url" | "postback" | "say";
68
74
  label: string;
69
75
  }>, "many">;
76
+ className: z.ZodOptional<z.ZodString>;
70
77
  }, "strip", z.ZodTypeAny, {
71
78
  title: string;
72
79
  actions: {
@@ -76,6 +83,7 @@ declare const _default: z.ZodObject<{
76
83
  }[];
77
84
  subtitle?: string | undefined;
78
85
  imageUrl?: string | undefined;
86
+ className?: string | undefined;
79
87
  }, {
80
88
  title: string;
81
89
  actions: {
@@ -85,7 +93,9 @@ declare const _default: z.ZodObject<{
85
93
  }[];
86
94
  subtitle?: string | undefined;
87
95
  imageUrl?: string | undefined;
96
+ className?: string | undefined;
88
97
  }>, "many">;
98
+ className: z.ZodOptional<z.ZodString>;
89
99
  type: z.ZodLiteral<"carousel">;
90
100
  }, "strip", z.ZodTypeAny, {
91
101
  type: "carousel";
@@ -98,7 +108,9 @@ declare const _default: z.ZodObject<{
98
108
  }[];
99
109
  subtitle?: string | undefined;
100
110
  imageUrl?: string | undefined;
111
+ className?: string | undefined;
101
112
  }[];
113
+ className?: string | undefined;
102
114
  }, {
103
115
  type: "carousel";
104
116
  items: {
@@ -110,7 +122,9 @@ declare const _default: z.ZodObject<{
110
122
  }[];
111
123
  subtitle?: string | undefined;
112
124
  imageUrl?: string | undefined;
125
+ className?: string | undefined;
113
126
  }[];
127
+ className?: string | undefined;
114
128
  }>, z.ZodObject<{
115
129
  text: z.ZodString;
116
130
  options: z.ZodArray<z.ZodObject<{
@@ -123,21 +137,27 @@ declare const _default: z.ZodObject<{
123
137
  value: string;
124
138
  label: string;
125
139
  }>, "many">;
140
+ className: z.ZodOptional<z.ZodString>;
126
141
  type: z.ZodLiteral<"choice">;
142
+ disableFreeText: z.ZodOptional<z.ZodBoolean>;
127
143
  }, "strip", z.ZodTypeAny, {
128
- type: "choice";
129
144
  options: {
130
145
  value: string;
131
146
  label: string;
132
147
  }[];
148
+ type: "choice";
133
149
  text: string;
150
+ className?: string | undefined;
151
+ disableFreeText?: boolean | undefined;
134
152
  }, {
135
- type: "choice";
136
153
  options: {
137
154
  value: string;
138
155
  label: string;
139
156
  }[];
157
+ type: "choice";
140
158
  text: string;
159
+ className?: string | undefined;
160
+ disableFreeText?: boolean | undefined;
141
161
  }>, z.ZodObject<{
142
162
  text: z.ZodString;
143
163
  options: z.ZodArray<z.ZodObject<{
@@ -150,47 +170,57 @@ declare const _default: z.ZodObject<{
150
170
  value: string;
151
171
  label: string;
152
172
  }>, "many">;
173
+ className: z.ZodOptional<z.ZodString>;
153
174
  type: z.ZodLiteral<"dropdown">;
154
175
  }, "strip", z.ZodTypeAny, {
155
- type: "dropdown";
156
176
  options: {
157
177
  value: string;
158
178
  label: string;
159
179
  }[];
180
+ type: "dropdown";
160
181
  text: string;
182
+ className?: string | undefined;
161
183
  }, {
162
- type: "dropdown";
163
184
  options: {
164
185
  value: string;
165
186
  label: string;
166
187
  }[];
188
+ type: "dropdown";
167
189
  text: string;
190
+ className?: string | undefined;
168
191
  }>, z.ZodObject<{
169
192
  fileUrl: z.ZodString;
170
193
  title: z.ZodOptional<z.ZodString>;
194
+ className: z.ZodOptional<z.ZodString>;
171
195
  type: z.ZodLiteral<"file">;
172
196
  }, "strip", z.ZodTypeAny, {
173
197
  type: "file";
174
198
  fileUrl: string;
175
199
  title?: string | undefined;
200
+ className?: string | undefined;
176
201
  }, {
177
202
  type: "file";
178
203
  fileUrl: string;
179
204
  title?: string | undefined;
205
+ className?: string | undefined;
180
206
  }>, z.ZodObject<{
181
207
  imageUrl: z.ZodString;
208
+ className: z.ZodOptional<z.ZodString>;
182
209
  type: z.ZodLiteral<"image">;
183
210
  }, "strip", z.ZodTypeAny, {
184
211
  type: "image";
185
212
  imageUrl: string;
213
+ className?: string | undefined;
186
214
  }, {
187
215
  type: "image";
188
216
  imageUrl: string;
217
+ className?: string | undefined;
189
218
  }>, z.ZodObject<{
190
219
  latitude: z.ZodNumber;
191
220
  longitude: z.ZodNumber;
192
221
  address: z.ZodOptional<z.ZodString>;
193
222
  title: z.ZodOptional<z.ZodString>;
223
+ className: z.ZodOptional<z.ZodString>;
194
224
  type: z.ZodLiteral<"location">;
195
225
  }, "strip", z.ZodTypeAny, {
196
226
  type: "location";
@@ -198,39 +228,50 @@ declare const _default: z.ZodObject<{
198
228
  longitude: number;
199
229
  address?: string | undefined;
200
230
  title?: string | undefined;
231
+ className?: string | undefined;
201
232
  }, {
202
233
  type: "location";
203
234
  latitude: number;
204
235
  longitude: number;
205
236
  address?: string | undefined;
206
237
  title?: string | undefined;
238
+ className?: string | undefined;
207
239
  }>, z.ZodObject<{
208
240
  markdown: z.ZodString;
241
+ className: z.ZodOptional<z.ZodString>;
209
242
  type: z.ZodLiteral<"markdown">;
210
243
  }, "strip", z.ZodTypeAny, {
211
244
  type: "markdown";
212
245
  markdown: string;
246
+ className?: string | undefined;
213
247
  }, {
214
248
  type: "markdown";
215
249
  markdown: string;
250
+ className?: string | undefined;
216
251
  }>, z.ZodObject<{
217
252
  text: z.ZodString;
253
+ className: z.ZodOptional<z.ZodString>;
218
254
  type: z.ZodLiteral<"text">;
219
255
  }, "strip", z.ZodTypeAny, {
220
256
  type: "text";
221
257
  text: string;
258
+ className?: string | undefined;
222
259
  }, {
223
260
  type: "text";
224
261
  text: string;
262
+ className?: string | undefined;
225
263
  }>, z.ZodObject<{
226
264
  videoUrl: z.ZodString;
265
+ className: z.ZodOptional<z.ZodString>;
227
266
  type: z.ZodLiteral<"video">;
228
267
  }, "strip", z.ZodTypeAny, {
229
268
  type: "video";
230
269
  videoUrl: string;
270
+ className?: string | undefined;
231
271
  }, {
232
272
  type: "video";
233
273
  videoUrl: string;
274
+ className?: string | undefined;
234
275
  }>]>;
235
276
  userId: z.ZodString;
236
277
  conversationId: z.ZodString;
@@ -238,9 +279,10 @@ declare const _default: z.ZodObject<{
238
279
  payload: {
239
280
  type: "audio";
240
281
  audioUrl: string;
282
+ className?: string | undefined;
241
283
  } | {
242
- type: "card";
243
284
  title: string;
285
+ type: "card";
244
286
  actions: {
245
287
  value: string;
246
288
  action: "url" | "postback" | "say";
@@ -248,6 +290,7 @@ declare const _default: z.ZodObject<{
248
290
  }[];
249
291
  subtitle?: string | undefined;
250
292
  imageUrl?: string | undefined;
293
+ className?: string | undefined;
251
294
  } | {
252
295
  type: "carousel";
253
296
  items: {
@@ -259,43 +302,54 @@ declare const _default: z.ZodObject<{
259
302
  }[];
260
303
  subtitle?: string | undefined;
261
304
  imageUrl?: string | undefined;
305
+ className?: string | undefined;
262
306
  }[];
307
+ className?: string | undefined;
263
308
  } | {
264
- type: "choice";
265
309
  options: {
266
310
  value: string;
267
311
  label: string;
268
312
  }[];
313
+ type: "choice";
269
314
  text: string;
315
+ className?: string | undefined;
316
+ disableFreeText?: boolean | undefined;
270
317
  } | {
271
- type: "dropdown";
272
318
  options: {
273
319
  value: string;
274
320
  label: string;
275
321
  }[];
322
+ type: "dropdown";
276
323
  text: string;
324
+ className?: string | undefined;
277
325
  } | {
278
326
  type: "file";
279
327
  fileUrl: string;
280
328
  title?: string | undefined;
329
+ className?: string | undefined;
281
330
  } | {
282
331
  type: "image";
283
332
  imageUrl: string;
333
+ className?: string | undefined;
284
334
  } | {
285
335
  type: "location";
286
336
  latitude: number;
287
337
  longitude: number;
288
338
  address?: string | undefined;
289
339
  title?: string | undefined;
340
+ className?: string | undefined;
290
341
  } | {
291
342
  type: "markdown";
292
343
  markdown: string;
344
+ className?: string | undefined;
293
345
  } | {
294
346
  type: "text";
295
347
  text: string;
348
+ className?: string | undefined;
296
349
  } | {
297
350
  type: "video";
298
351
  videoUrl: string;
352
+ className?: string | undefined;
299
353
  };
300
354
  id: string;
301
355
  userId: string;
@@ -305,9 +359,10 @@ declare const _default: z.ZodObject<{
305
359
  payload: {
306
360
  type: "audio";
307
361
  audioUrl: string;
362
+ className?: string | undefined;
308
363
  } | {
309
- type: "card";
310
364
  title: string;
365
+ type: "card";
311
366
  actions: {
312
367
  value: string;
313
368
  action: "url" | "postback" | "say";
@@ -315,6 +370,7 @@ declare const _default: z.ZodObject<{
315
370
  }[];
316
371
  subtitle?: string | undefined;
317
372
  imageUrl?: string | undefined;
373
+ className?: string | undefined;
318
374
  } | {
319
375
  type: "carousel";
320
376
  items: {
@@ -326,43 +382,54 @@ declare const _default: z.ZodObject<{
326
382
  }[];
327
383
  subtitle?: string | undefined;
328
384
  imageUrl?: string | undefined;
385
+ className?: string | undefined;
329
386
  }[];
387
+ className?: string | undefined;
330
388
  } | {
331
- type: "choice";
332
389
  options: {
333
390
  value: string;
334
391
  label: string;
335
392
  }[];
393
+ type: "choice";
336
394
  text: string;
395
+ className?: string | undefined;
396
+ disableFreeText?: boolean | undefined;
337
397
  } | {
338
- type: "dropdown";
339
398
  options: {
340
399
  value: string;
341
400
  label: string;
342
401
  }[];
402
+ type: "dropdown";
343
403
  text: string;
404
+ className?: string | undefined;
344
405
  } | {
345
406
  type: "file";
346
407
  fileUrl: string;
347
408
  title?: string | undefined;
409
+ className?: string | undefined;
348
410
  } | {
349
411
  type: "image";
350
412
  imageUrl: string;
413
+ className?: string | undefined;
351
414
  } | {
352
415
  type: "location";
353
416
  latitude: number;
354
417
  longitude: number;
355
418
  address?: string | undefined;
356
419
  title?: string | undefined;
420
+ className?: string | undefined;
357
421
  } | {
358
422
  type: "markdown";
359
423
  markdown: string;
424
+ className?: string | undefined;
360
425
  } | {
361
426
  type: "text";
362
427
  text: string;
428
+ className?: string | undefined;
363
429
  } | {
364
430
  type: "video";
365
431
  videoUrl: string;
432
+ className?: string | undefined;
366
433
  };
367
434
  id: string;
368
435
  userId: string;
@@ -7,9 +7,6 @@ declare const _default: {
7
7
  pictureUrl: {
8
8
  type: string;
9
9
  };
10
- profile: {
11
- type: string;
12
- };
13
10
  id: {
14
11
  type: string;
15
12
  };
@@ -6,7 +6,6 @@
6
6
  export interface User {
7
7
  name?: string;
8
8
  pictureUrl?: string;
9
- profile?: string;
10
9
  id: string;
11
10
  createdAt: string;
12
11
  updatedAt: string;
@@ -2,7 +2,6 @@ import { z } from "zod";
2
2
  declare const _default: z.ZodObject<{
3
3
  name: z.ZodOptional<z.ZodString>;
4
4
  pictureUrl: z.ZodOptional<z.ZodString>;
5
- profile: z.ZodOptional<z.ZodString>;
6
5
  id: z.ZodString;
7
6
  createdAt: z.ZodString;
8
7
  updatedAt: z.ZodString;
@@ -12,13 +11,11 @@ declare const _default: z.ZodObject<{
12
11
  updatedAt: string;
13
12
  name?: string | undefined;
14
13
  pictureUrl?: string | undefined;
15
- profile?: string | undefined;
16
14
  }, {
17
15
  id: string;
18
16
  createdAt: string;
19
17
  updatedAt: string;
20
18
  name?: string | undefined;
21
19
  pictureUrl?: string | undefined;
22
- profile?: string | undefined;
23
20
  }>;
24
21
  export default _default;