@botpress/webchat 2.2.12 → 2.2.14

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 (38) hide show
  1. package/.turbo/turbo-build.log +8 -10
  2. package/dist/adapters/{messaging-to-target.d.ts → adapters/messaging-to-target.d.ts} +20 -19
  3. package/dist/adapters/adapters/messaging-to-webchat.d.ts +5 -0
  4. package/dist/adapters/adapters/webchat-to-messaging.d.ts +223 -0
  5. package/dist/adapters/{webchat-to-target.d.ts → adapters/webchat-to-target.d.ts} +15 -14
  6. package/dist/adapters/index.d.ts +6 -3
  7. package/dist/adapters/messaging.d.ts +1455 -0
  8. package/dist/adapters/sdk.d.ts +472 -0
  9. package/dist/adapters/target.d.ts +2 -2
  10. package/dist/adapters/typings.d.ts +12 -0
  11. package/dist/adapters/webchat.d.ts +1171 -0
  12. package/dist/client/MessagingClient/client.d.ts +3 -3
  13. package/dist/client/PushpinClient/state-machine.d.ts +5 -5
  14. package/dist/components/Block.d.ts +1 -1
  15. package/dist/components/Composer/Composer.d.ts +0 -1
  16. package/dist/components/Container/Container.d.ts +0 -1
  17. package/dist/components/Fab/Fab.d.ts +0 -1
  18. package/dist/components/MessageList/MessageList.d.ts +1 -1
  19. package/dist/components/TypingIndicator/TypingIndicator.d.ts +1 -1
  20. package/dist/components/renderers/Audio/Audio.d.ts +0 -1
  21. package/dist/components/renderers/Carousel/Carousel.d.ts +0 -1
  22. package/dist/components/renderers/File/File.d.ts +0 -1
  23. package/dist/components/renderers/Image/Image.d.ts +0 -1
  24. package/dist/components/renderers/Location/Location.d.ts +0 -1
  25. package/dist/components/renderers/Video/Video.d.ts +0 -1
  26. package/dist/gen/signals/index.d.ts +30 -30
  27. package/dist/gen/signals/messageCreated.z.d.ts +30 -30
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.js +18305 -28071
  30. package/dist/index.umd.cjs +102 -178
  31. package/dist/providers/WebchatProvider.d.ts +0 -1
  32. package/dist/schemas/init.d.ts +14 -15
  33. package/dist/schemas/theme.d.ts +8 -8
  34. package/dist/stores/offlineStore.d.ts +1 -1
  35. package/dist/style.css +1 -1
  36. package/dist/styles/index.d.ts +1 -0
  37. package/dist/types/block-type.d.ts +1 -1
  38. package/package.json +1 -3
@@ -0,0 +1,1171 @@
1
+ import * as types from './typings';
2
+ import { z } from 'zod';
3
+ export declare const audioSchema: z.ZodObject<{
4
+ audioUrl: z.ZodString;
5
+ type: z.ZodLiteral<"audio">;
6
+ className: z.ZodOptional<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ type: "audio";
9
+ audioUrl: string;
10
+ className?: string | undefined;
11
+ }, {
12
+ type: "audio";
13
+ audioUrl: string;
14
+ className?: string | undefined;
15
+ }>;
16
+ export declare const cardSchema: z.ZodObject<{
17
+ title: z.ZodString;
18
+ actions: z.ZodArray<z.ZodObject<{
19
+ action: z.ZodEnum<["postback", "url", "say"]>;
20
+ label: z.ZodString;
21
+ value: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ value: string;
24
+ action: "postback" | "url" | "say";
25
+ label: string;
26
+ }, {
27
+ value: string;
28
+ action: "postback" | "url" | "say";
29
+ label: string;
30
+ }>, "many">;
31
+ className: z.ZodOptional<z.ZodString>;
32
+ type: z.ZodLiteral<"card">;
33
+ subtitle: z.ZodOptional<z.ZodString>;
34
+ imageUrl: z.ZodOptional<z.ZodString>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ type: "card";
37
+ title: string;
38
+ actions: {
39
+ value: string;
40
+ action: "postback" | "url" | "say";
41
+ label: string;
42
+ }[];
43
+ className?: string | undefined;
44
+ subtitle?: string | undefined;
45
+ imageUrl?: string | undefined;
46
+ }, {
47
+ type: "card";
48
+ title: string;
49
+ actions: {
50
+ value: string;
51
+ action: "postback" | "url" | "say";
52
+ label: string;
53
+ }[];
54
+ className?: string | undefined;
55
+ subtitle?: string | undefined;
56
+ imageUrl?: string | undefined;
57
+ }>;
58
+ export declare const carouselSchema: z.ZodObject<{
59
+ type: z.ZodLiteral<"carousel">;
60
+ className: z.ZodOptional<z.ZodString>;
61
+ items: z.ZodArray<z.ZodObject<Omit<{
62
+ title: 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: "postback" | "url" | "say";
70
+ label: string;
71
+ }, {
72
+ value: string;
73
+ action: "postback" | "url" | "say";
74
+ label: string;
75
+ }>, "many">;
76
+ className: z.ZodOptional<z.ZodString>;
77
+ type: z.ZodLiteral<"card">;
78
+ subtitle: z.ZodOptional<z.ZodString>;
79
+ imageUrl: z.ZodOptional<z.ZodString>;
80
+ }, "type">, "strip", z.ZodTypeAny, {
81
+ title: string;
82
+ actions: {
83
+ value: string;
84
+ action: "postback" | "url" | "say";
85
+ label: string;
86
+ }[];
87
+ imageUrl?: string | undefined;
88
+ subtitle?: string | undefined;
89
+ className?: string | undefined;
90
+ }, {
91
+ title: string;
92
+ actions: {
93
+ value: string;
94
+ action: "postback" | "url" | "say";
95
+ label: string;
96
+ }[];
97
+ imageUrl?: string | undefined;
98
+ subtitle?: string | undefined;
99
+ className?: string | undefined;
100
+ }>, "many">;
101
+ }, "strip", z.ZodTypeAny, {
102
+ type: "carousel";
103
+ items: {
104
+ title: string;
105
+ actions: {
106
+ value: string;
107
+ action: "postback" | "url" | "say";
108
+ label: string;
109
+ }[];
110
+ imageUrl?: string | undefined;
111
+ subtitle?: string | undefined;
112
+ className?: string | undefined;
113
+ }[];
114
+ className?: string | undefined;
115
+ }, {
116
+ type: "carousel";
117
+ items: {
118
+ title: string;
119
+ actions: {
120
+ value: string;
121
+ action: "postback" | "url" | "say";
122
+ label: string;
123
+ }[];
124
+ imageUrl?: string | undefined;
125
+ subtitle?: string | undefined;
126
+ className?: string | undefined;
127
+ }[];
128
+ className?: string | undefined;
129
+ }>;
130
+ export declare const choiceSchema: z.ZodObject<{
131
+ options: z.ZodArray<z.ZodObject<{
132
+ label: z.ZodString;
133
+ value: z.ZodString;
134
+ }, "strip", z.ZodTypeAny, {
135
+ value: string;
136
+ label: string;
137
+ }, {
138
+ value: string;
139
+ label: string;
140
+ }>, "many">;
141
+ type: z.ZodLiteral<"choice">;
142
+ disableFreeText: z.ZodOptional<z.ZodBoolean>;
143
+ className: z.ZodOptional<z.ZodString>;
144
+ text: z.ZodString;
145
+ }, "strip", z.ZodTypeAny, {
146
+ type: "choice";
147
+ text: string;
148
+ options: {
149
+ value: string;
150
+ label: string;
151
+ }[];
152
+ disableFreeText?: boolean | undefined;
153
+ className?: string | undefined;
154
+ }, {
155
+ type: "choice";
156
+ text: string;
157
+ options: {
158
+ value: string;
159
+ label: string;
160
+ }[];
161
+ disableFreeText?: boolean | undefined;
162
+ className?: string | undefined;
163
+ }>;
164
+ export declare const dropdownSchema: z.ZodObject<{
165
+ options: z.ZodArray<z.ZodObject<{
166
+ label: z.ZodString;
167
+ value: z.ZodString;
168
+ }, "strip", z.ZodTypeAny, {
169
+ value: string;
170
+ label: string;
171
+ }, {
172
+ value: string;
173
+ label: string;
174
+ }>, "many">;
175
+ type: z.ZodLiteral<"dropdown">;
176
+ className: z.ZodOptional<z.ZodString>;
177
+ text: z.ZodString;
178
+ }, "strip", z.ZodTypeAny, {
179
+ type: "dropdown";
180
+ text: string;
181
+ options: {
182
+ value: string;
183
+ label: string;
184
+ }[];
185
+ className?: string | undefined;
186
+ }, {
187
+ type: "dropdown";
188
+ text: string;
189
+ options: {
190
+ value: string;
191
+ label: string;
192
+ }[];
193
+ className?: string | undefined;
194
+ }>;
195
+ export declare const fileSchema: z.ZodObject<{
196
+ fileUrl: z.ZodString;
197
+ title: z.ZodOptional<z.ZodString>;
198
+ type: z.ZodLiteral<"file">;
199
+ className: z.ZodOptional<z.ZodString>;
200
+ }, "strip", z.ZodTypeAny, {
201
+ type: "file";
202
+ fileUrl: string;
203
+ title?: string | undefined;
204
+ className?: string | undefined;
205
+ }, {
206
+ type: "file";
207
+ fileUrl: string;
208
+ title?: string | undefined;
209
+ className?: string | undefined;
210
+ }>;
211
+ export declare const imageSchema: z.ZodObject<{
212
+ imageUrl: z.ZodString;
213
+ type: z.ZodLiteral<"image">;
214
+ className: z.ZodOptional<z.ZodString>;
215
+ }, "strip", z.ZodTypeAny, {
216
+ type: "image";
217
+ imageUrl: string;
218
+ className?: string | undefined;
219
+ }, {
220
+ type: "image";
221
+ imageUrl: string;
222
+ className?: string | undefined;
223
+ }>;
224
+ export declare const locationSchema: z.ZodObject<{
225
+ title: z.ZodOptional<z.ZodString>;
226
+ latitude: z.ZodNumber;
227
+ longitude: z.ZodNumber;
228
+ address: z.ZodOptional<z.ZodString>;
229
+ type: z.ZodLiteral<"location">;
230
+ className: z.ZodOptional<z.ZodString>;
231
+ }, "strip", z.ZodTypeAny, {
232
+ type: "location";
233
+ latitude: number;
234
+ longitude: number;
235
+ title?: string | undefined;
236
+ address?: string | undefined;
237
+ className?: string | undefined;
238
+ }, {
239
+ type: "location";
240
+ latitude: number;
241
+ longitude: number;
242
+ title?: string | undefined;
243
+ address?: string | undefined;
244
+ className?: string | undefined;
245
+ }>;
246
+ export declare const markdownSchema: z.ZodObject<{
247
+ markdown: z.ZodString;
248
+ type: z.ZodLiteral<"markdown">;
249
+ className: z.ZodOptional<z.ZodString>;
250
+ }, "strip", z.ZodTypeAny, {
251
+ type: "markdown";
252
+ markdown: string;
253
+ className?: string | undefined;
254
+ }, {
255
+ type: "markdown";
256
+ markdown: string;
257
+ className?: string | undefined;
258
+ }>;
259
+ export declare const textSchema: z.ZodObject<{
260
+ text: z.ZodString;
261
+ type: z.ZodLiteral<"text">;
262
+ className: z.ZodOptional<z.ZodString>;
263
+ }, "strip", z.ZodTypeAny, {
264
+ type: "text";
265
+ text: string;
266
+ className?: string | undefined;
267
+ }, {
268
+ type: "text";
269
+ text: string;
270
+ className?: string | undefined;
271
+ }>;
272
+ export declare const videoSchema: z.ZodObject<{
273
+ videoUrl: z.ZodString;
274
+ type: z.ZodLiteral<"video">;
275
+ className: z.ZodOptional<z.ZodString>;
276
+ }, "strip", z.ZodTypeAny, {
277
+ type: "video";
278
+ videoUrl: string;
279
+ className?: string | undefined;
280
+ }, {
281
+ type: "video";
282
+ videoUrl: string;
283
+ className?: string | undefined;
284
+ }>;
285
+ export declare const messageSchema: z.ZodUnion<[z.ZodObject<{
286
+ audioUrl: z.ZodString;
287
+ type: z.ZodLiteral<"audio">;
288
+ className: z.ZodOptional<z.ZodString>;
289
+ }, "strip", z.ZodTypeAny, {
290
+ type: "audio";
291
+ audioUrl: string;
292
+ className?: string | undefined;
293
+ }, {
294
+ type: "audio";
295
+ audioUrl: string;
296
+ className?: string | undefined;
297
+ }>, z.ZodObject<{
298
+ title: z.ZodString;
299
+ actions: z.ZodArray<z.ZodObject<{
300
+ action: z.ZodEnum<["postback", "url", "say"]>;
301
+ label: z.ZodString;
302
+ value: z.ZodString;
303
+ }, "strip", z.ZodTypeAny, {
304
+ value: string;
305
+ action: "postback" | "url" | "say";
306
+ label: string;
307
+ }, {
308
+ value: string;
309
+ action: "postback" | "url" | "say";
310
+ label: string;
311
+ }>, "many">;
312
+ className: z.ZodOptional<z.ZodString>;
313
+ type: z.ZodLiteral<"card">;
314
+ subtitle: z.ZodOptional<z.ZodString>;
315
+ imageUrl: z.ZodOptional<z.ZodString>;
316
+ }, "strip", z.ZodTypeAny, {
317
+ type: "card";
318
+ title: string;
319
+ actions: {
320
+ value: string;
321
+ action: "postback" | "url" | "say";
322
+ label: string;
323
+ }[];
324
+ className?: string | undefined;
325
+ subtitle?: string | undefined;
326
+ imageUrl?: string | undefined;
327
+ }, {
328
+ type: "card";
329
+ title: string;
330
+ actions: {
331
+ value: string;
332
+ action: "postback" | "url" | "say";
333
+ label: string;
334
+ }[];
335
+ className?: string | undefined;
336
+ subtitle?: string | undefined;
337
+ imageUrl?: string | undefined;
338
+ }>, z.ZodObject<{
339
+ type: z.ZodLiteral<"carousel">;
340
+ className: z.ZodOptional<z.ZodString>;
341
+ items: z.ZodArray<z.ZodObject<Omit<{
342
+ title: z.ZodString;
343
+ actions: z.ZodArray<z.ZodObject<{
344
+ action: z.ZodEnum<["postback", "url", "say"]>;
345
+ label: z.ZodString;
346
+ value: z.ZodString;
347
+ }, "strip", z.ZodTypeAny, {
348
+ value: string;
349
+ action: "postback" | "url" | "say";
350
+ label: string;
351
+ }, {
352
+ value: string;
353
+ action: "postback" | "url" | "say";
354
+ label: string;
355
+ }>, "many">;
356
+ className: z.ZodOptional<z.ZodString>;
357
+ type: z.ZodLiteral<"card">;
358
+ subtitle: z.ZodOptional<z.ZodString>;
359
+ imageUrl: z.ZodOptional<z.ZodString>;
360
+ }, "type">, "strip", z.ZodTypeAny, {
361
+ title: string;
362
+ actions: {
363
+ value: string;
364
+ action: "postback" | "url" | "say";
365
+ label: string;
366
+ }[];
367
+ imageUrl?: string | undefined;
368
+ subtitle?: string | undefined;
369
+ className?: string | undefined;
370
+ }, {
371
+ title: string;
372
+ actions: {
373
+ value: string;
374
+ action: "postback" | "url" | "say";
375
+ label: string;
376
+ }[];
377
+ imageUrl?: string | undefined;
378
+ subtitle?: string | undefined;
379
+ className?: string | undefined;
380
+ }>, "many">;
381
+ }, "strip", z.ZodTypeAny, {
382
+ type: "carousel";
383
+ items: {
384
+ title: string;
385
+ actions: {
386
+ value: string;
387
+ action: "postback" | "url" | "say";
388
+ label: string;
389
+ }[];
390
+ imageUrl?: string | undefined;
391
+ subtitle?: string | undefined;
392
+ className?: string | undefined;
393
+ }[];
394
+ className?: string | undefined;
395
+ }, {
396
+ type: "carousel";
397
+ items: {
398
+ title: string;
399
+ actions: {
400
+ value: string;
401
+ action: "postback" | "url" | "say";
402
+ label: string;
403
+ }[];
404
+ imageUrl?: string | undefined;
405
+ subtitle?: string | undefined;
406
+ className?: string | undefined;
407
+ }[];
408
+ className?: string | undefined;
409
+ }>, z.ZodObject<{
410
+ options: z.ZodArray<z.ZodObject<{
411
+ label: z.ZodString;
412
+ value: z.ZodString;
413
+ }, "strip", z.ZodTypeAny, {
414
+ value: string;
415
+ label: string;
416
+ }, {
417
+ value: string;
418
+ label: string;
419
+ }>, "many">;
420
+ type: z.ZodLiteral<"choice">;
421
+ disableFreeText: z.ZodOptional<z.ZodBoolean>;
422
+ className: z.ZodOptional<z.ZodString>;
423
+ text: z.ZodString;
424
+ }, "strip", z.ZodTypeAny, {
425
+ type: "choice";
426
+ text: string;
427
+ options: {
428
+ value: string;
429
+ label: string;
430
+ }[];
431
+ disableFreeText?: boolean | undefined;
432
+ className?: string | undefined;
433
+ }, {
434
+ type: "choice";
435
+ text: string;
436
+ options: {
437
+ value: string;
438
+ label: string;
439
+ }[];
440
+ disableFreeText?: boolean | undefined;
441
+ className?: string | undefined;
442
+ }>, z.ZodObject<{
443
+ options: z.ZodArray<z.ZodObject<{
444
+ label: z.ZodString;
445
+ value: z.ZodString;
446
+ }, "strip", z.ZodTypeAny, {
447
+ value: string;
448
+ label: string;
449
+ }, {
450
+ value: string;
451
+ label: string;
452
+ }>, "many">;
453
+ type: z.ZodLiteral<"dropdown">;
454
+ className: z.ZodOptional<z.ZodString>;
455
+ text: z.ZodString;
456
+ }, "strip", z.ZodTypeAny, {
457
+ type: "dropdown";
458
+ text: string;
459
+ options: {
460
+ value: string;
461
+ label: string;
462
+ }[];
463
+ className?: string | undefined;
464
+ }, {
465
+ type: "dropdown";
466
+ text: string;
467
+ options: {
468
+ value: string;
469
+ label: string;
470
+ }[];
471
+ className?: string | undefined;
472
+ }>, z.ZodObject<{
473
+ fileUrl: z.ZodString;
474
+ title: z.ZodOptional<z.ZodString>;
475
+ type: z.ZodLiteral<"file">;
476
+ className: z.ZodOptional<z.ZodString>;
477
+ }, "strip", z.ZodTypeAny, {
478
+ type: "file";
479
+ fileUrl: string;
480
+ title?: string | undefined;
481
+ className?: string | undefined;
482
+ }, {
483
+ type: "file";
484
+ fileUrl: string;
485
+ title?: string | undefined;
486
+ className?: string | undefined;
487
+ }>, z.ZodObject<{
488
+ imageUrl: z.ZodString;
489
+ type: z.ZodLiteral<"image">;
490
+ className: z.ZodOptional<z.ZodString>;
491
+ }, "strip", z.ZodTypeAny, {
492
+ type: "image";
493
+ imageUrl: string;
494
+ className?: string | undefined;
495
+ }, {
496
+ type: "image";
497
+ imageUrl: string;
498
+ className?: string | undefined;
499
+ }>, z.ZodObject<{
500
+ title: z.ZodOptional<z.ZodString>;
501
+ latitude: z.ZodNumber;
502
+ longitude: z.ZodNumber;
503
+ address: z.ZodOptional<z.ZodString>;
504
+ type: z.ZodLiteral<"location">;
505
+ className: z.ZodOptional<z.ZodString>;
506
+ }, "strip", z.ZodTypeAny, {
507
+ type: "location";
508
+ latitude: number;
509
+ longitude: number;
510
+ title?: string | undefined;
511
+ address?: string | undefined;
512
+ className?: string | undefined;
513
+ }, {
514
+ type: "location";
515
+ latitude: number;
516
+ longitude: number;
517
+ title?: string | undefined;
518
+ address?: string | undefined;
519
+ className?: string | undefined;
520
+ }>, z.ZodObject<{
521
+ markdown: z.ZodString;
522
+ type: z.ZodLiteral<"markdown">;
523
+ className: z.ZodOptional<z.ZodString>;
524
+ }, "strip", z.ZodTypeAny, {
525
+ type: "markdown";
526
+ markdown: string;
527
+ className?: string | undefined;
528
+ }, {
529
+ type: "markdown";
530
+ markdown: string;
531
+ className?: string | undefined;
532
+ }>, z.ZodObject<{
533
+ text: z.ZodString;
534
+ type: z.ZodLiteral<"text">;
535
+ className: z.ZodOptional<z.ZodString>;
536
+ }, "strip", z.ZodTypeAny, {
537
+ type: "text";
538
+ text: string;
539
+ className?: string | undefined;
540
+ }, {
541
+ type: "text";
542
+ text: string;
543
+ className?: string | undefined;
544
+ }>, z.ZodObject<{
545
+ videoUrl: z.ZodString;
546
+ type: z.ZodLiteral<"video">;
547
+ className: z.ZodOptional<z.ZodString>;
548
+ }, "strip", z.ZodTypeAny, {
549
+ type: "video";
550
+ videoUrl: string;
551
+ className?: string | undefined;
552
+ }, {
553
+ type: "video";
554
+ videoUrl: string;
555
+ className?: string | undefined;
556
+ }>]>;
557
+ export type Message = z.infer<typeof messageSchema>;
558
+ /**
559
+ * ###############
560
+ * ### Signals ###
561
+ * ###############
562
+ */
563
+ export declare const webchatVisibilitySchema: z.ZodObject<{
564
+ type: z.ZodLiteral<"webchat_visibility">;
565
+ data: z.ZodObject<{
566
+ visibility: z.ZodUnion<[z.ZodLiteral<"show">, z.ZodLiteral<"hide">, z.ZodLiteral<"toggle">]>;
567
+ }, "strip", z.ZodTypeAny, {
568
+ visibility: "show" | "hide" | "toggle";
569
+ }, {
570
+ visibility: "show" | "hide" | "toggle";
571
+ }>;
572
+ }, "strip", z.ZodTypeAny, {
573
+ type: "webchat_visibility";
574
+ data: {
575
+ visibility: "show" | "hide" | "toggle";
576
+ };
577
+ }, {
578
+ type: "webchat_visibility";
579
+ data: {
580
+ visibility: "show" | "hide" | "toggle";
581
+ };
582
+ }>;
583
+ export declare const webchatConfigSchema: z.ZodObject<{
584
+ type: z.ZodLiteral<"webchat_config">;
585
+ data: z.ZodObject<{
586
+ config: z.ZodRecord<z.ZodString, z.ZodAny>;
587
+ }, "strip", z.ZodTypeAny, {
588
+ config: Record<string, any>;
589
+ }, {
590
+ config: Record<string, any>;
591
+ }>;
592
+ }, "strip", z.ZodTypeAny, {
593
+ type: "webchat_config";
594
+ data: {
595
+ config: Record<string, any>;
596
+ };
597
+ }, {
598
+ type: "webchat_config";
599
+ data: {
600
+ config: Record<string, any>;
601
+ };
602
+ }>;
603
+ export declare const customSchema: z.ZodObject<{
604
+ type: z.ZodLiteral<"custom">;
605
+ data: z.ZodObject<{
606
+ event: z.ZodRecord<z.ZodString, z.ZodAny>;
607
+ }, "strip", z.ZodTypeAny, {
608
+ event: Record<string, any>;
609
+ }, {
610
+ event: Record<string, any>;
611
+ }>;
612
+ }, "strip", z.ZodTypeAny, {
613
+ type: "custom";
614
+ data: {
615
+ event: Record<string, any>;
616
+ };
617
+ }, {
618
+ type: "custom";
619
+ data: {
620
+ event: Record<string, any>;
621
+ };
622
+ }>;
623
+ export declare const triggerSchema: z.ZodUnion<[z.ZodObject<{
624
+ type: z.ZodLiteral<"webchat_visibility">;
625
+ data: z.ZodObject<{
626
+ visibility: z.ZodUnion<[z.ZodLiteral<"show">, z.ZodLiteral<"hide">, z.ZodLiteral<"toggle">]>;
627
+ }, "strip", z.ZodTypeAny, {
628
+ visibility: "show" | "hide" | "toggle";
629
+ }, {
630
+ visibility: "show" | "hide" | "toggle";
631
+ }>;
632
+ }, "strip", z.ZodTypeAny, {
633
+ type: "webchat_visibility";
634
+ data: {
635
+ visibility: "show" | "hide" | "toggle";
636
+ };
637
+ }, {
638
+ type: "webchat_visibility";
639
+ data: {
640
+ visibility: "show" | "hide" | "toggle";
641
+ };
642
+ }>, z.ZodObject<{
643
+ type: z.ZodLiteral<"webchat_config">;
644
+ data: z.ZodObject<{
645
+ config: z.ZodRecord<z.ZodString, z.ZodAny>;
646
+ }, "strip", z.ZodTypeAny, {
647
+ config: Record<string, any>;
648
+ }, {
649
+ config: Record<string, any>;
650
+ }>;
651
+ }, "strip", z.ZodTypeAny, {
652
+ type: "webchat_config";
653
+ data: {
654
+ config: Record<string, any>;
655
+ };
656
+ }, {
657
+ type: "webchat_config";
658
+ data: {
659
+ config: Record<string, any>;
660
+ };
661
+ }>, z.ZodObject<{
662
+ type: z.ZodLiteral<"custom">;
663
+ data: z.ZodObject<{
664
+ event: z.ZodRecord<z.ZodString, z.ZodAny>;
665
+ }, "strip", z.ZodTypeAny, {
666
+ event: Record<string, any>;
667
+ }, {
668
+ event: Record<string, any>;
669
+ }>;
670
+ }, "strip", z.ZodTypeAny, {
671
+ type: "custom";
672
+ data: {
673
+ event: Record<string, any>;
674
+ };
675
+ }, {
676
+ type: "custom";
677
+ data: {
678
+ event: Record<string, any>;
679
+ };
680
+ }>]>;
681
+ export type Trigger = z.infer<typeof triggerSchema>;
682
+ export declare const triggerSignalSchema: z.ZodUnion<[z.ZodObject<{
683
+ type: z.ZodLiteral<"webchat_visibility">;
684
+ data: z.ZodObject<{
685
+ visibility: z.ZodUnion<[z.ZodLiteral<"show">, z.ZodLiteral<"hide">, z.ZodLiteral<"toggle">]>;
686
+ }, "strip", z.ZodTypeAny, {
687
+ visibility: "show" | "hide" | "toggle";
688
+ }, {
689
+ visibility: "show" | "hide" | "toggle";
690
+ }>;
691
+ }, "strip", z.ZodTypeAny, {
692
+ type: "webchat_visibility";
693
+ data: {
694
+ visibility: "show" | "hide" | "toggle";
695
+ };
696
+ }, {
697
+ type: "webchat_visibility";
698
+ data: {
699
+ visibility: "show" | "hide" | "toggle";
700
+ };
701
+ }>, z.ZodObject<{
702
+ type: z.ZodLiteral<"webchat_config">;
703
+ data: z.ZodObject<{
704
+ config: z.ZodRecord<z.ZodString, z.ZodAny>;
705
+ }, "strip", z.ZodTypeAny, {
706
+ config: Record<string, any>;
707
+ }, {
708
+ config: Record<string, any>;
709
+ }>;
710
+ }, "strip", z.ZodTypeAny, {
711
+ type: "webchat_config";
712
+ data: {
713
+ config: Record<string, any>;
714
+ };
715
+ }, {
716
+ type: "webchat_config";
717
+ data: {
718
+ config: Record<string, any>;
719
+ };
720
+ }>, z.ZodObject<{
721
+ type: z.ZodLiteral<"custom">;
722
+ data: z.ZodObject<{
723
+ event: z.ZodRecord<z.ZodString, z.ZodAny>;
724
+ }, "strip", z.ZodTypeAny, {
725
+ event: Record<string, any>;
726
+ }, {
727
+ event: Record<string, any>;
728
+ }>;
729
+ }, "strip", z.ZodTypeAny, {
730
+ type: "custom";
731
+ data: {
732
+ event: Record<string, any>;
733
+ };
734
+ }, {
735
+ type: "custom";
736
+ data: {
737
+ event: Record<string, any>;
738
+ };
739
+ }>]>;
740
+ export declare const messageCreatedSchema: z.ZodObject<{
741
+ type: z.ZodLiteral<"message_created">;
742
+ data: z.ZodUnion<[z.ZodObject<{
743
+ audioUrl: z.ZodString;
744
+ type: z.ZodLiteral<"audio">;
745
+ className: z.ZodOptional<z.ZodString>;
746
+ }, "strip", z.ZodTypeAny, {
747
+ type: "audio";
748
+ audioUrl: string;
749
+ className?: string | undefined;
750
+ }, {
751
+ type: "audio";
752
+ audioUrl: string;
753
+ className?: string | undefined;
754
+ }>, z.ZodObject<{
755
+ title: z.ZodString;
756
+ actions: z.ZodArray<z.ZodObject<{
757
+ action: z.ZodEnum<["postback", "url", "say"]>;
758
+ label: z.ZodString;
759
+ value: z.ZodString;
760
+ }, "strip", z.ZodTypeAny, {
761
+ value: string;
762
+ action: "postback" | "url" | "say";
763
+ label: string;
764
+ }, {
765
+ value: string;
766
+ action: "postback" | "url" | "say";
767
+ label: string;
768
+ }>, "many">;
769
+ className: z.ZodOptional<z.ZodString>;
770
+ type: z.ZodLiteral<"card">;
771
+ subtitle: z.ZodOptional<z.ZodString>;
772
+ imageUrl: z.ZodOptional<z.ZodString>;
773
+ }, "strip", z.ZodTypeAny, {
774
+ type: "card";
775
+ title: string;
776
+ actions: {
777
+ value: string;
778
+ action: "postback" | "url" | "say";
779
+ label: string;
780
+ }[];
781
+ className?: string | undefined;
782
+ subtitle?: string | undefined;
783
+ imageUrl?: string | undefined;
784
+ }, {
785
+ type: "card";
786
+ title: string;
787
+ actions: {
788
+ value: string;
789
+ action: "postback" | "url" | "say";
790
+ label: string;
791
+ }[];
792
+ className?: string | undefined;
793
+ subtitle?: string | undefined;
794
+ imageUrl?: string | undefined;
795
+ }>, z.ZodObject<{
796
+ type: z.ZodLiteral<"carousel">;
797
+ className: z.ZodOptional<z.ZodString>;
798
+ items: z.ZodArray<z.ZodObject<Omit<{
799
+ title: z.ZodString;
800
+ actions: z.ZodArray<z.ZodObject<{
801
+ action: z.ZodEnum<["postback", "url", "say"]>;
802
+ label: z.ZodString;
803
+ value: z.ZodString;
804
+ }, "strip", z.ZodTypeAny, {
805
+ value: string;
806
+ action: "postback" | "url" | "say";
807
+ label: string;
808
+ }, {
809
+ value: string;
810
+ action: "postback" | "url" | "say";
811
+ label: string;
812
+ }>, "many">;
813
+ className: z.ZodOptional<z.ZodString>;
814
+ type: z.ZodLiteral<"card">;
815
+ subtitle: z.ZodOptional<z.ZodString>;
816
+ imageUrl: z.ZodOptional<z.ZodString>;
817
+ }, "type">, "strip", z.ZodTypeAny, {
818
+ title: string;
819
+ actions: {
820
+ value: string;
821
+ action: "postback" | "url" | "say";
822
+ label: string;
823
+ }[];
824
+ imageUrl?: string | undefined;
825
+ subtitle?: string | undefined;
826
+ className?: string | undefined;
827
+ }, {
828
+ title: string;
829
+ actions: {
830
+ value: string;
831
+ action: "postback" | "url" | "say";
832
+ label: string;
833
+ }[];
834
+ imageUrl?: string | undefined;
835
+ subtitle?: string | undefined;
836
+ className?: string | undefined;
837
+ }>, "many">;
838
+ }, "strip", z.ZodTypeAny, {
839
+ type: "carousel";
840
+ items: {
841
+ title: string;
842
+ actions: {
843
+ value: string;
844
+ action: "postback" | "url" | "say";
845
+ label: string;
846
+ }[];
847
+ imageUrl?: string | undefined;
848
+ subtitle?: string | undefined;
849
+ className?: string | undefined;
850
+ }[];
851
+ className?: string | undefined;
852
+ }, {
853
+ type: "carousel";
854
+ items: {
855
+ title: string;
856
+ actions: {
857
+ value: string;
858
+ action: "postback" | "url" | "say";
859
+ label: string;
860
+ }[];
861
+ imageUrl?: string | undefined;
862
+ subtitle?: string | undefined;
863
+ className?: string | undefined;
864
+ }[];
865
+ className?: string | undefined;
866
+ }>, z.ZodObject<{
867
+ options: z.ZodArray<z.ZodObject<{
868
+ label: z.ZodString;
869
+ value: z.ZodString;
870
+ }, "strip", z.ZodTypeAny, {
871
+ value: string;
872
+ label: string;
873
+ }, {
874
+ value: string;
875
+ label: string;
876
+ }>, "many">;
877
+ type: z.ZodLiteral<"choice">;
878
+ disableFreeText: z.ZodOptional<z.ZodBoolean>;
879
+ className: z.ZodOptional<z.ZodString>;
880
+ text: z.ZodString;
881
+ }, "strip", z.ZodTypeAny, {
882
+ type: "choice";
883
+ text: string;
884
+ options: {
885
+ value: string;
886
+ label: string;
887
+ }[];
888
+ disableFreeText?: boolean | undefined;
889
+ className?: string | undefined;
890
+ }, {
891
+ type: "choice";
892
+ text: string;
893
+ options: {
894
+ value: string;
895
+ label: string;
896
+ }[];
897
+ disableFreeText?: boolean | undefined;
898
+ className?: string | undefined;
899
+ }>, z.ZodObject<{
900
+ options: z.ZodArray<z.ZodObject<{
901
+ label: z.ZodString;
902
+ value: z.ZodString;
903
+ }, "strip", z.ZodTypeAny, {
904
+ value: string;
905
+ label: string;
906
+ }, {
907
+ value: string;
908
+ label: string;
909
+ }>, "many">;
910
+ type: z.ZodLiteral<"dropdown">;
911
+ className: z.ZodOptional<z.ZodString>;
912
+ text: z.ZodString;
913
+ }, "strip", z.ZodTypeAny, {
914
+ type: "dropdown";
915
+ text: string;
916
+ options: {
917
+ value: string;
918
+ label: string;
919
+ }[];
920
+ className?: string | undefined;
921
+ }, {
922
+ type: "dropdown";
923
+ text: string;
924
+ options: {
925
+ value: string;
926
+ label: string;
927
+ }[];
928
+ className?: string | undefined;
929
+ }>, z.ZodObject<{
930
+ fileUrl: z.ZodString;
931
+ title: z.ZodOptional<z.ZodString>;
932
+ type: z.ZodLiteral<"file">;
933
+ className: z.ZodOptional<z.ZodString>;
934
+ }, "strip", z.ZodTypeAny, {
935
+ type: "file";
936
+ fileUrl: string;
937
+ title?: string | undefined;
938
+ className?: string | undefined;
939
+ }, {
940
+ type: "file";
941
+ fileUrl: string;
942
+ title?: string | undefined;
943
+ className?: string | undefined;
944
+ }>, z.ZodObject<{
945
+ imageUrl: z.ZodString;
946
+ type: z.ZodLiteral<"image">;
947
+ className: z.ZodOptional<z.ZodString>;
948
+ }, "strip", z.ZodTypeAny, {
949
+ type: "image";
950
+ imageUrl: string;
951
+ className?: string | undefined;
952
+ }, {
953
+ type: "image";
954
+ imageUrl: string;
955
+ className?: string | undefined;
956
+ }>, z.ZodObject<{
957
+ title: z.ZodOptional<z.ZodString>;
958
+ latitude: z.ZodNumber;
959
+ longitude: z.ZodNumber;
960
+ address: z.ZodOptional<z.ZodString>;
961
+ type: z.ZodLiteral<"location">;
962
+ className: z.ZodOptional<z.ZodString>;
963
+ }, "strip", z.ZodTypeAny, {
964
+ type: "location";
965
+ latitude: number;
966
+ longitude: number;
967
+ title?: string | undefined;
968
+ address?: string | undefined;
969
+ className?: string | undefined;
970
+ }, {
971
+ type: "location";
972
+ latitude: number;
973
+ longitude: number;
974
+ title?: string | undefined;
975
+ address?: string | undefined;
976
+ className?: string | undefined;
977
+ }>, z.ZodObject<{
978
+ markdown: z.ZodString;
979
+ type: z.ZodLiteral<"markdown">;
980
+ className: z.ZodOptional<z.ZodString>;
981
+ }, "strip", z.ZodTypeAny, {
982
+ type: "markdown";
983
+ markdown: string;
984
+ className?: string | undefined;
985
+ }, {
986
+ type: "markdown";
987
+ markdown: string;
988
+ className?: string | undefined;
989
+ }>, z.ZodObject<{
990
+ text: z.ZodString;
991
+ type: z.ZodLiteral<"text">;
992
+ className: z.ZodOptional<z.ZodString>;
993
+ }, "strip", z.ZodTypeAny, {
994
+ type: "text";
995
+ text: string;
996
+ className?: string | undefined;
997
+ }, {
998
+ type: "text";
999
+ text: string;
1000
+ className?: string | undefined;
1001
+ }>, z.ZodObject<{
1002
+ videoUrl: z.ZodString;
1003
+ type: z.ZodLiteral<"video">;
1004
+ className: z.ZodOptional<z.ZodString>;
1005
+ }, "strip", z.ZodTypeAny, {
1006
+ type: "video";
1007
+ videoUrl: string;
1008
+ className?: string | undefined;
1009
+ }, {
1010
+ type: "video";
1011
+ videoUrl: string;
1012
+ className?: string | undefined;
1013
+ }>]>;
1014
+ }, "strip", z.ZodTypeAny, {
1015
+ type: "message_created";
1016
+ data: {
1017
+ type: "audio";
1018
+ audioUrl: string;
1019
+ className?: string | undefined;
1020
+ } | {
1021
+ type: "card";
1022
+ title: string;
1023
+ actions: {
1024
+ value: string;
1025
+ action: "postback" | "url" | "say";
1026
+ label: string;
1027
+ }[];
1028
+ className?: string | undefined;
1029
+ subtitle?: string | undefined;
1030
+ imageUrl?: string | undefined;
1031
+ } | {
1032
+ type: "carousel";
1033
+ items: {
1034
+ title: string;
1035
+ actions: {
1036
+ value: string;
1037
+ action: "postback" | "url" | "say";
1038
+ label: string;
1039
+ }[];
1040
+ imageUrl?: string | undefined;
1041
+ subtitle?: string | undefined;
1042
+ className?: string | undefined;
1043
+ }[];
1044
+ className?: string | undefined;
1045
+ } | {
1046
+ type: "choice";
1047
+ text: string;
1048
+ options: {
1049
+ value: string;
1050
+ label: string;
1051
+ }[];
1052
+ disableFreeText?: boolean | undefined;
1053
+ className?: string | undefined;
1054
+ } | {
1055
+ type: "dropdown";
1056
+ text: string;
1057
+ options: {
1058
+ value: string;
1059
+ label: string;
1060
+ }[];
1061
+ className?: string | undefined;
1062
+ } | {
1063
+ type: "file";
1064
+ fileUrl: string;
1065
+ title?: string | undefined;
1066
+ className?: string | undefined;
1067
+ } | {
1068
+ type: "image";
1069
+ imageUrl: string;
1070
+ className?: string | undefined;
1071
+ } | {
1072
+ type: "location";
1073
+ latitude: number;
1074
+ longitude: number;
1075
+ title?: string | undefined;
1076
+ address?: string | undefined;
1077
+ className?: string | undefined;
1078
+ } | {
1079
+ type: "markdown";
1080
+ markdown: string;
1081
+ className?: string | undefined;
1082
+ } | {
1083
+ type: "text";
1084
+ text: string;
1085
+ className?: string | undefined;
1086
+ } | {
1087
+ type: "video";
1088
+ videoUrl: string;
1089
+ className?: string | undefined;
1090
+ };
1091
+ }, {
1092
+ type: "message_created";
1093
+ data: {
1094
+ type: "audio";
1095
+ audioUrl: string;
1096
+ className?: string | undefined;
1097
+ } | {
1098
+ type: "card";
1099
+ title: string;
1100
+ actions: {
1101
+ value: string;
1102
+ action: "postback" | "url" | "say";
1103
+ label: string;
1104
+ }[];
1105
+ className?: string | undefined;
1106
+ subtitle?: string | undefined;
1107
+ imageUrl?: string | undefined;
1108
+ } | {
1109
+ type: "carousel";
1110
+ items: {
1111
+ title: string;
1112
+ actions: {
1113
+ value: string;
1114
+ action: "postback" | "url" | "say";
1115
+ label: string;
1116
+ }[];
1117
+ imageUrl?: string | undefined;
1118
+ subtitle?: string | undefined;
1119
+ className?: string | undefined;
1120
+ }[];
1121
+ className?: string | undefined;
1122
+ } | {
1123
+ type: "choice";
1124
+ text: string;
1125
+ options: {
1126
+ value: string;
1127
+ label: string;
1128
+ }[];
1129
+ disableFreeText?: boolean | undefined;
1130
+ className?: string | undefined;
1131
+ } | {
1132
+ type: "dropdown";
1133
+ text: string;
1134
+ options: {
1135
+ value: string;
1136
+ label: string;
1137
+ }[];
1138
+ className?: string | undefined;
1139
+ } | {
1140
+ type: "file";
1141
+ fileUrl: string;
1142
+ title?: string | undefined;
1143
+ className?: string | undefined;
1144
+ } | {
1145
+ type: "image";
1146
+ imageUrl: string;
1147
+ className?: string | undefined;
1148
+ } | {
1149
+ type: "location";
1150
+ latitude: number;
1151
+ longitude: number;
1152
+ title?: string | undefined;
1153
+ address?: string | undefined;
1154
+ className?: string | undefined;
1155
+ } | {
1156
+ type: "markdown";
1157
+ markdown: string;
1158
+ className?: string | undefined;
1159
+ } | {
1160
+ type: "text";
1161
+ text: string;
1162
+ className?: string | undefined;
1163
+ } | {
1164
+ type: "video";
1165
+ videoUrl: string;
1166
+ className?: string | undefined;
1167
+ };
1168
+ }>;
1169
+ export type Signal = z.infer<typeof triggerSignalSchema> | z.infer<typeof messageCreatedSchema>;
1170
+ export type Messages = types.MessagesOf<Message>;
1171
+ export type Triggers = types.MessagesOf<Trigger>;