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