@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.
- package/dist/App.d.ts +4 -4
- package/dist/client/MessagingClient/client.d.ts +2 -16
- package/dist/client/{ChatClient → PushpinClient}/index.d.ts +4 -4
- package/dist/client/PushpinClient/inner-client/event-emitter.d.ts +10 -0
- package/dist/client/PushpinClient/inner-client/eventsource.d.ts +22 -0
- package/dist/client/PushpinClient/inner-client/index.d.ts +39 -0
- package/dist/client/PushpinClient/inner-client/signal-listener.d.ts +47 -0
- package/dist/client/{ChatClient → PushpinClient}/state-machine.d.ts +13 -13
- package/dist/client/index.d.ts +1 -1
- package/dist/client/types.d.ts +4 -1
- package/dist/components/Block.d.ts +1 -1
- package/dist/components/Composer.d.ts +1 -1
- package/dist/components/Header.d.ts +1 -1
- package/dist/components/LoadingIndicator.d.ts +1 -1
- package/dist/components/MessageList.d.ts +1 -1
- package/dist/components/Modal.d.ts +2 -2
- package/dist/components/RestartConversation.d.ts +1 -1
- package/dist/components/Webchat.d.ts +1 -1
- package/dist/components/dev-tools/DevTools.d.ts +1 -1
- package/dist/components/renderers/Button.d.ts +1 -1
- package/dist/components/renderers/Dropdown.d.ts +1 -1
- package/dist/components/renderers/Text.d.ts +1 -1
- package/dist/contexts/WebchatContext.d.ts +4 -4
- package/dist/gen/client/api.d.ts +1694 -0
- package/dist/gen/client/base.d.ts +54 -0
- package/dist/gen/client/client.d.ts +57 -0
- package/dist/gen/client/common.d.ts +65 -0
- package/dist/gen/client/configuration.d.ts +83 -0
- package/dist/gen/client/errors.d.ts +197 -0
- package/dist/gen/client/index.d.ts +13 -0
- package/dist/gen/models/conversation.j.d.ts +20 -0
- package/dist/gen/models/conversation.t.d.ts +10 -0
- package/dist/gen/models/conversation.z.d.ts +15 -0
- package/dist/gen/models/index.d.ts +851 -0
- package/dist/gen/models/message.j.d.ts +388 -0
- package/dist/gen/models/message.t.d.ts +73 -0
- package/dist/gen/models/message.z.d.ts +372 -0
- package/dist/gen/models/user.j.d.ts +29 -0
- package/dist/gen/models/user.t.d.ts +13 -0
- package/dist/gen/models/user.z.d.ts +24 -0
- package/dist/gen/signals/customSignal.j.d.ts +24 -0
- package/dist/gen/signals/customSignal.t.d.ts +13 -0
- package/dist/gen/signals/customSignal.z.d.ts +22 -0
- package/dist/gen/signals/index.d.ts +1054 -0
- package/dist/gen/signals/messageCreatedSignal.j.d.ts +399 -0
- package/dist/gen/signals/messageCreatedSignal.t.d.ts +76 -0
- package/dist/gen/signals/messageCreatedSignal.z.d.ts +515 -0
- package/dist/gen/signals/webchatConfigSignal.j.d.ts +24 -0
- package/dist/gen/signals/webchatConfigSignal.t.d.ts +13 -0
- package/dist/gen/signals/webchatConfigSignal.z.d.ts +22 -0
- package/dist/gen/signals/webchatVisibilitySignal.j.d.ts +24 -0
- package/dist/gen/signals/webchatVisibilitySignal.t.d.ts +11 -0
- package/dist/gen/signals/webchatVisibilitySignal.z.d.ts +22 -0
- package/dist/hooks/useClient.d.ts +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +27937 -73852
- package/dist/index.umd.cjs +113 -154
- package/dist/options.d.ts +3 -3
- package/dist/providers/ModalProvider.d.ts +1 -1
- package/dist/providers/WebchatProvider.d.ts +3 -3
- package/openapi/index.ts +31 -0
- package/openapi/package.json +5 -0
- package/openapi/readme.md +1 -0
- package/package.json +10 -4
- package/dist/client/MessagingClient/adapters/Trigger.d.ts +0 -33
|
@@ -0,0 +1,515 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const _default: z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"message_created">;
|
|
4
|
+
data: z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
createdAt: z.ZodString;
|
|
7
|
+
payload: z.ZodUnion<[z.ZodObject<{
|
|
8
|
+
audioUrl: z.ZodString;
|
|
9
|
+
type: z.ZodLiteral<"audio">;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
type: "audio";
|
|
12
|
+
audioUrl: string;
|
|
13
|
+
}, {
|
|
14
|
+
type: "audio";
|
|
15
|
+
audioUrl: string;
|
|
16
|
+
}>, z.ZodObject<{
|
|
17
|
+
title: z.ZodString;
|
|
18
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
19
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
20
|
+
actions: z.ZodArray<z.ZodObject<{
|
|
21
|
+
action: z.ZodEnum<["postback", "url", "say"]>;
|
|
22
|
+
label: z.ZodString;
|
|
23
|
+
value: z.ZodString;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
value: string;
|
|
26
|
+
action: "url" | "postback" | "say";
|
|
27
|
+
label: string;
|
|
28
|
+
}, {
|
|
29
|
+
value: string;
|
|
30
|
+
action: "url" | "postback" | "say";
|
|
31
|
+
label: string;
|
|
32
|
+
}>, "many">;
|
|
33
|
+
type: z.ZodLiteral<"card">;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
type: "card";
|
|
36
|
+
title: string;
|
|
37
|
+
actions: {
|
|
38
|
+
value: string;
|
|
39
|
+
action: "url" | "postback" | "say";
|
|
40
|
+
label: string;
|
|
41
|
+
}[];
|
|
42
|
+
subtitle?: string | undefined;
|
|
43
|
+
imageUrl?: string | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
type: "card";
|
|
46
|
+
title: string;
|
|
47
|
+
actions: {
|
|
48
|
+
value: string;
|
|
49
|
+
action: "url" | "postback" | "say";
|
|
50
|
+
label: string;
|
|
51
|
+
}[];
|
|
52
|
+
subtitle?: string | undefined;
|
|
53
|
+
imageUrl?: string | undefined;
|
|
54
|
+
}>, z.ZodObject<{
|
|
55
|
+
items: z.ZodArray<z.ZodObject<{
|
|
56
|
+
title: z.ZodString;
|
|
57
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
58
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
59
|
+
actions: z.ZodArray<z.ZodObject<{
|
|
60
|
+
action: z.ZodEnum<["postback", "url", "say"]>;
|
|
61
|
+
label: z.ZodString;
|
|
62
|
+
value: z.ZodString;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
value: string;
|
|
65
|
+
action: "url" | "postback" | "say";
|
|
66
|
+
label: string;
|
|
67
|
+
}, {
|
|
68
|
+
value: string;
|
|
69
|
+
action: "url" | "postback" | "say";
|
|
70
|
+
label: string;
|
|
71
|
+
}>, "many">;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
title: string;
|
|
74
|
+
actions: {
|
|
75
|
+
value: string;
|
|
76
|
+
action: "url" | "postback" | "say";
|
|
77
|
+
label: string;
|
|
78
|
+
}[];
|
|
79
|
+
subtitle?: string | undefined;
|
|
80
|
+
imageUrl?: string | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
title: string;
|
|
83
|
+
actions: {
|
|
84
|
+
value: string;
|
|
85
|
+
action: "url" | "postback" | "say";
|
|
86
|
+
label: string;
|
|
87
|
+
}[];
|
|
88
|
+
subtitle?: string | undefined;
|
|
89
|
+
imageUrl?: string | undefined;
|
|
90
|
+
}>, "many">;
|
|
91
|
+
type: z.ZodLiteral<"carousel">;
|
|
92
|
+
}, "strip", z.ZodTypeAny, {
|
|
93
|
+
type: "carousel";
|
|
94
|
+
items: {
|
|
95
|
+
title: string;
|
|
96
|
+
actions: {
|
|
97
|
+
value: string;
|
|
98
|
+
action: "url" | "postback" | "say";
|
|
99
|
+
label: string;
|
|
100
|
+
}[];
|
|
101
|
+
subtitle?: string | undefined;
|
|
102
|
+
imageUrl?: string | undefined;
|
|
103
|
+
}[];
|
|
104
|
+
}, {
|
|
105
|
+
type: "carousel";
|
|
106
|
+
items: {
|
|
107
|
+
title: string;
|
|
108
|
+
actions: {
|
|
109
|
+
value: string;
|
|
110
|
+
action: "url" | "postback" | "say";
|
|
111
|
+
label: string;
|
|
112
|
+
}[];
|
|
113
|
+
subtitle?: string | undefined;
|
|
114
|
+
imageUrl?: string | undefined;
|
|
115
|
+
}[];
|
|
116
|
+
}>, z.ZodObject<{
|
|
117
|
+
text: z.ZodString;
|
|
118
|
+
options: z.ZodArray<z.ZodObject<{
|
|
119
|
+
label: z.ZodString;
|
|
120
|
+
value: z.ZodString;
|
|
121
|
+
}, "strip", z.ZodTypeAny, {
|
|
122
|
+
value: string;
|
|
123
|
+
label: string;
|
|
124
|
+
}, {
|
|
125
|
+
value: string;
|
|
126
|
+
label: string;
|
|
127
|
+
}>, "many">;
|
|
128
|
+
type: z.ZodLiteral<"choice">;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
type: "choice";
|
|
131
|
+
options: {
|
|
132
|
+
value: string;
|
|
133
|
+
label: string;
|
|
134
|
+
}[];
|
|
135
|
+
text: string;
|
|
136
|
+
}, {
|
|
137
|
+
type: "choice";
|
|
138
|
+
options: {
|
|
139
|
+
value: string;
|
|
140
|
+
label: string;
|
|
141
|
+
}[];
|
|
142
|
+
text: string;
|
|
143
|
+
}>, z.ZodObject<{
|
|
144
|
+
text: z.ZodString;
|
|
145
|
+
options: z.ZodArray<z.ZodObject<{
|
|
146
|
+
label: z.ZodString;
|
|
147
|
+
value: z.ZodString;
|
|
148
|
+
}, "strip", z.ZodTypeAny, {
|
|
149
|
+
value: string;
|
|
150
|
+
label: string;
|
|
151
|
+
}, {
|
|
152
|
+
value: string;
|
|
153
|
+
label: string;
|
|
154
|
+
}>, "many">;
|
|
155
|
+
type: z.ZodLiteral<"dropdown">;
|
|
156
|
+
}, "strip", z.ZodTypeAny, {
|
|
157
|
+
type: "dropdown";
|
|
158
|
+
options: {
|
|
159
|
+
value: string;
|
|
160
|
+
label: string;
|
|
161
|
+
}[];
|
|
162
|
+
text: string;
|
|
163
|
+
}, {
|
|
164
|
+
type: "dropdown";
|
|
165
|
+
options: {
|
|
166
|
+
value: string;
|
|
167
|
+
label: string;
|
|
168
|
+
}[];
|
|
169
|
+
text: string;
|
|
170
|
+
}>, z.ZodObject<{
|
|
171
|
+
fileUrl: z.ZodString;
|
|
172
|
+
title: z.ZodOptional<z.ZodString>;
|
|
173
|
+
type: z.ZodLiteral<"file">;
|
|
174
|
+
}, "strip", z.ZodTypeAny, {
|
|
175
|
+
type: "file";
|
|
176
|
+
fileUrl: string;
|
|
177
|
+
title?: string | undefined;
|
|
178
|
+
}, {
|
|
179
|
+
type: "file";
|
|
180
|
+
fileUrl: string;
|
|
181
|
+
title?: string | undefined;
|
|
182
|
+
}>, z.ZodObject<{
|
|
183
|
+
imageUrl: z.ZodString;
|
|
184
|
+
type: z.ZodLiteral<"image">;
|
|
185
|
+
}, "strip", z.ZodTypeAny, {
|
|
186
|
+
type: "image";
|
|
187
|
+
imageUrl: string;
|
|
188
|
+
}, {
|
|
189
|
+
type: "image";
|
|
190
|
+
imageUrl: string;
|
|
191
|
+
}>, z.ZodObject<{
|
|
192
|
+
latitude: z.ZodNumber;
|
|
193
|
+
longitude: z.ZodNumber;
|
|
194
|
+
address: z.ZodOptional<z.ZodString>;
|
|
195
|
+
title: z.ZodOptional<z.ZodString>;
|
|
196
|
+
type: z.ZodLiteral<"location">;
|
|
197
|
+
}, "strip", z.ZodTypeAny, {
|
|
198
|
+
type: "location";
|
|
199
|
+
latitude: number;
|
|
200
|
+
longitude: number;
|
|
201
|
+
address?: string | undefined;
|
|
202
|
+
title?: string | undefined;
|
|
203
|
+
}, {
|
|
204
|
+
type: "location";
|
|
205
|
+
latitude: number;
|
|
206
|
+
longitude: number;
|
|
207
|
+
address?: string | undefined;
|
|
208
|
+
title?: string | undefined;
|
|
209
|
+
}>, z.ZodObject<{
|
|
210
|
+
markdown: z.ZodString;
|
|
211
|
+
type: z.ZodLiteral<"markdown">;
|
|
212
|
+
}, "strip", z.ZodTypeAny, {
|
|
213
|
+
type: "markdown";
|
|
214
|
+
markdown: string;
|
|
215
|
+
}, {
|
|
216
|
+
type: "markdown";
|
|
217
|
+
markdown: string;
|
|
218
|
+
}>, z.ZodObject<{
|
|
219
|
+
text: z.ZodString;
|
|
220
|
+
type: z.ZodLiteral<"text">;
|
|
221
|
+
}, "strip", z.ZodTypeAny, {
|
|
222
|
+
type: "text";
|
|
223
|
+
text: string;
|
|
224
|
+
}, {
|
|
225
|
+
type: "text";
|
|
226
|
+
text: string;
|
|
227
|
+
}>, z.ZodObject<{
|
|
228
|
+
videoUrl: z.ZodString;
|
|
229
|
+
type: z.ZodLiteral<"video">;
|
|
230
|
+
}, "strip", z.ZodTypeAny, {
|
|
231
|
+
type: "video";
|
|
232
|
+
videoUrl: string;
|
|
233
|
+
}, {
|
|
234
|
+
type: "video";
|
|
235
|
+
videoUrl: string;
|
|
236
|
+
}>]>;
|
|
237
|
+
userId: z.ZodString;
|
|
238
|
+
conversationId: z.ZodString;
|
|
239
|
+
}, "strip", z.ZodTypeAny, {
|
|
240
|
+
payload: {
|
|
241
|
+
type: "audio";
|
|
242
|
+
audioUrl: string;
|
|
243
|
+
} | {
|
|
244
|
+
type: "card";
|
|
245
|
+
title: string;
|
|
246
|
+
actions: {
|
|
247
|
+
value: string;
|
|
248
|
+
action: "url" | "postback" | "say";
|
|
249
|
+
label: string;
|
|
250
|
+
}[];
|
|
251
|
+
subtitle?: string | undefined;
|
|
252
|
+
imageUrl?: string | undefined;
|
|
253
|
+
} | {
|
|
254
|
+
type: "carousel";
|
|
255
|
+
items: {
|
|
256
|
+
title: string;
|
|
257
|
+
actions: {
|
|
258
|
+
value: string;
|
|
259
|
+
action: "url" | "postback" | "say";
|
|
260
|
+
label: string;
|
|
261
|
+
}[];
|
|
262
|
+
subtitle?: string | undefined;
|
|
263
|
+
imageUrl?: string | undefined;
|
|
264
|
+
}[];
|
|
265
|
+
} | {
|
|
266
|
+
type: "choice";
|
|
267
|
+
options: {
|
|
268
|
+
value: string;
|
|
269
|
+
label: string;
|
|
270
|
+
}[];
|
|
271
|
+
text: string;
|
|
272
|
+
} | {
|
|
273
|
+
type: "dropdown";
|
|
274
|
+
options: {
|
|
275
|
+
value: string;
|
|
276
|
+
label: string;
|
|
277
|
+
}[];
|
|
278
|
+
text: string;
|
|
279
|
+
} | {
|
|
280
|
+
type: "file";
|
|
281
|
+
fileUrl: string;
|
|
282
|
+
title?: string | undefined;
|
|
283
|
+
} | {
|
|
284
|
+
type: "image";
|
|
285
|
+
imageUrl: string;
|
|
286
|
+
} | {
|
|
287
|
+
type: "location";
|
|
288
|
+
latitude: number;
|
|
289
|
+
longitude: number;
|
|
290
|
+
address?: string | undefined;
|
|
291
|
+
title?: string | undefined;
|
|
292
|
+
} | {
|
|
293
|
+
type: "markdown";
|
|
294
|
+
markdown: string;
|
|
295
|
+
} | {
|
|
296
|
+
type: "text";
|
|
297
|
+
text: string;
|
|
298
|
+
} | {
|
|
299
|
+
type: "video";
|
|
300
|
+
videoUrl: string;
|
|
301
|
+
};
|
|
302
|
+
id: string;
|
|
303
|
+
userId: string;
|
|
304
|
+
conversationId: string;
|
|
305
|
+
createdAt: string;
|
|
306
|
+
}, {
|
|
307
|
+
payload: {
|
|
308
|
+
type: "audio";
|
|
309
|
+
audioUrl: string;
|
|
310
|
+
} | {
|
|
311
|
+
type: "card";
|
|
312
|
+
title: string;
|
|
313
|
+
actions: {
|
|
314
|
+
value: string;
|
|
315
|
+
action: "url" | "postback" | "say";
|
|
316
|
+
label: string;
|
|
317
|
+
}[];
|
|
318
|
+
subtitle?: string | undefined;
|
|
319
|
+
imageUrl?: string | undefined;
|
|
320
|
+
} | {
|
|
321
|
+
type: "carousel";
|
|
322
|
+
items: {
|
|
323
|
+
title: string;
|
|
324
|
+
actions: {
|
|
325
|
+
value: string;
|
|
326
|
+
action: "url" | "postback" | "say";
|
|
327
|
+
label: string;
|
|
328
|
+
}[];
|
|
329
|
+
subtitle?: string | undefined;
|
|
330
|
+
imageUrl?: string | undefined;
|
|
331
|
+
}[];
|
|
332
|
+
} | {
|
|
333
|
+
type: "choice";
|
|
334
|
+
options: {
|
|
335
|
+
value: string;
|
|
336
|
+
label: string;
|
|
337
|
+
}[];
|
|
338
|
+
text: string;
|
|
339
|
+
} | {
|
|
340
|
+
type: "dropdown";
|
|
341
|
+
options: {
|
|
342
|
+
value: string;
|
|
343
|
+
label: string;
|
|
344
|
+
}[];
|
|
345
|
+
text: string;
|
|
346
|
+
} | {
|
|
347
|
+
type: "file";
|
|
348
|
+
fileUrl: string;
|
|
349
|
+
title?: string | undefined;
|
|
350
|
+
} | {
|
|
351
|
+
type: "image";
|
|
352
|
+
imageUrl: string;
|
|
353
|
+
} | {
|
|
354
|
+
type: "location";
|
|
355
|
+
latitude: number;
|
|
356
|
+
longitude: number;
|
|
357
|
+
address?: string | undefined;
|
|
358
|
+
title?: string | undefined;
|
|
359
|
+
} | {
|
|
360
|
+
type: "markdown";
|
|
361
|
+
markdown: string;
|
|
362
|
+
} | {
|
|
363
|
+
type: "text";
|
|
364
|
+
text: string;
|
|
365
|
+
} | {
|
|
366
|
+
type: "video";
|
|
367
|
+
videoUrl: string;
|
|
368
|
+
};
|
|
369
|
+
id: string;
|
|
370
|
+
userId: string;
|
|
371
|
+
conversationId: string;
|
|
372
|
+
createdAt: string;
|
|
373
|
+
}>;
|
|
374
|
+
}, "strip", z.ZodTypeAny, {
|
|
375
|
+
type: "message_created";
|
|
376
|
+
data: {
|
|
377
|
+
payload: {
|
|
378
|
+
type: "audio";
|
|
379
|
+
audioUrl: string;
|
|
380
|
+
} | {
|
|
381
|
+
type: "card";
|
|
382
|
+
title: string;
|
|
383
|
+
actions: {
|
|
384
|
+
value: string;
|
|
385
|
+
action: "url" | "postback" | "say";
|
|
386
|
+
label: string;
|
|
387
|
+
}[];
|
|
388
|
+
subtitle?: string | undefined;
|
|
389
|
+
imageUrl?: string | undefined;
|
|
390
|
+
} | {
|
|
391
|
+
type: "carousel";
|
|
392
|
+
items: {
|
|
393
|
+
title: string;
|
|
394
|
+
actions: {
|
|
395
|
+
value: string;
|
|
396
|
+
action: "url" | "postback" | "say";
|
|
397
|
+
label: string;
|
|
398
|
+
}[];
|
|
399
|
+
subtitle?: string | undefined;
|
|
400
|
+
imageUrl?: string | undefined;
|
|
401
|
+
}[];
|
|
402
|
+
} | {
|
|
403
|
+
type: "choice";
|
|
404
|
+
options: {
|
|
405
|
+
value: string;
|
|
406
|
+
label: string;
|
|
407
|
+
}[];
|
|
408
|
+
text: string;
|
|
409
|
+
} | {
|
|
410
|
+
type: "dropdown";
|
|
411
|
+
options: {
|
|
412
|
+
value: string;
|
|
413
|
+
label: string;
|
|
414
|
+
}[];
|
|
415
|
+
text: string;
|
|
416
|
+
} | {
|
|
417
|
+
type: "file";
|
|
418
|
+
fileUrl: string;
|
|
419
|
+
title?: string | undefined;
|
|
420
|
+
} | {
|
|
421
|
+
type: "image";
|
|
422
|
+
imageUrl: string;
|
|
423
|
+
} | {
|
|
424
|
+
type: "location";
|
|
425
|
+
latitude: number;
|
|
426
|
+
longitude: number;
|
|
427
|
+
address?: string | undefined;
|
|
428
|
+
title?: string | undefined;
|
|
429
|
+
} | {
|
|
430
|
+
type: "markdown";
|
|
431
|
+
markdown: string;
|
|
432
|
+
} | {
|
|
433
|
+
type: "text";
|
|
434
|
+
text: string;
|
|
435
|
+
} | {
|
|
436
|
+
type: "video";
|
|
437
|
+
videoUrl: string;
|
|
438
|
+
};
|
|
439
|
+
id: string;
|
|
440
|
+
userId: string;
|
|
441
|
+
conversationId: string;
|
|
442
|
+
createdAt: string;
|
|
443
|
+
};
|
|
444
|
+
}, {
|
|
445
|
+
type: "message_created";
|
|
446
|
+
data: {
|
|
447
|
+
payload: {
|
|
448
|
+
type: "audio";
|
|
449
|
+
audioUrl: string;
|
|
450
|
+
} | {
|
|
451
|
+
type: "card";
|
|
452
|
+
title: string;
|
|
453
|
+
actions: {
|
|
454
|
+
value: string;
|
|
455
|
+
action: "url" | "postback" | "say";
|
|
456
|
+
label: string;
|
|
457
|
+
}[];
|
|
458
|
+
subtitle?: string | undefined;
|
|
459
|
+
imageUrl?: string | undefined;
|
|
460
|
+
} | {
|
|
461
|
+
type: "carousel";
|
|
462
|
+
items: {
|
|
463
|
+
title: string;
|
|
464
|
+
actions: {
|
|
465
|
+
value: string;
|
|
466
|
+
action: "url" | "postback" | "say";
|
|
467
|
+
label: string;
|
|
468
|
+
}[];
|
|
469
|
+
subtitle?: string | undefined;
|
|
470
|
+
imageUrl?: string | undefined;
|
|
471
|
+
}[];
|
|
472
|
+
} | {
|
|
473
|
+
type: "choice";
|
|
474
|
+
options: {
|
|
475
|
+
value: string;
|
|
476
|
+
label: string;
|
|
477
|
+
}[];
|
|
478
|
+
text: string;
|
|
479
|
+
} | {
|
|
480
|
+
type: "dropdown";
|
|
481
|
+
options: {
|
|
482
|
+
value: string;
|
|
483
|
+
label: string;
|
|
484
|
+
}[];
|
|
485
|
+
text: string;
|
|
486
|
+
} | {
|
|
487
|
+
type: "file";
|
|
488
|
+
fileUrl: string;
|
|
489
|
+
title?: string | undefined;
|
|
490
|
+
} | {
|
|
491
|
+
type: "image";
|
|
492
|
+
imageUrl: string;
|
|
493
|
+
} | {
|
|
494
|
+
type: "location";
|
|
495
|
+
latitude: number;
|
|
496
|
+
longitude: number;
|
|
497
|
+
address?: string | undefined;
|
|
498
|
+
title?: string | undefined;
|
|
499
|
+
} | {
|
|
500
|
+
type: "markdown";
|
|
501
|
+
markdown: string;
|
|
502
|
+
} | {
|
|
503
|
+
type: "text";
|
|
504
|
+
text: string;
|
|
505
|
+
} | {
|
|
506
|
+
type: "video";
|
|
507
|
+
videoUrl: string;
|
|
508
|
+
};
|
|
509
|
+
id: string;
|
|
510
|
+
userId: string;
|
|
511
|
+
conversationId: string;
|
|
512
|
+
createdAt: string;
|
|
513
|
+
};
|
|
514
|
+
}>;
|
|
515
|
+
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
|
+
config: {
|
|
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 WebchatConfigSignal {
|
|
7
|
+
type: "webchat_config";
|
|
8
|
+
data: {
|
|
9
|
+
config: {
|
|
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<"webchat_config">;
|
|
4
|
+
data: z.ZodObject<{
|
|
5
|
+
config: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
config: Record<string, any>;
|
|
8
|
+
}, {
|
|
9
|
+
config: Record<string, any>;
|
|
10
|
+
}>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
type: "webchat_config";
|
|
13
|
+
data: {
|
|
14
|
+
config: Record<string, any>;
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
type: "webchat_config";
|
|
18
|
+
data: {
|
|
19
|
+
config: Record<string, any>;
|
|
20
|
+
};
|
|
21
|
+
}>;
|
|
22
|
+
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
|
+
visibility: {
|
|
12
|
+
type: string;
|
|
13
|
+
enum: string[];
|
|
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,11 @@
|
|
|
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 WebchatVisibilitySignal {
|
|
7
|
+
type: "webchat_visibility";
|
|
8
|
+
data: {
|
|
9
|
+
visibility: "show" | "hide" | "toggle";
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const _default: z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"webchat_visibility">;
|
|
4
|
+
data: z.ZodObject<{
|
|
5
|
+
visibility: z.ZodEnum<["show", "hide", "toggle"]>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
visibility: "show" | "hide" | "toggle";
|
|
8
|
+
}, {
|
|
9
|
+
visibility: "show" | "hide" | "toggle";
|
|
10
|
+
}>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
type: "webchat_visibility";
|
|
13
|
+
data: {
|
|
14
|
+
visibility: "show" | "hide" | "toggle";
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
type: "webchat_visibility";
|
|
18
|
+
data: {
|
|
19
|
+
visibility: "show" | "hide" | "toggle";
|
|
20
|
+
};
|
|
21
|
+
}>;
|
|
22
|
+
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { MessagingClient,
|
|
1
|
+
import { MessagingClient, WebchatClient } from '../client';
|
|
2
2
|
type UseClientOptions = {
|
|
3
|
-
mode: 'messaging' | '
|
|
3
|
+
mode: 'messaging' | 'pushpin';
|
|
4
4
|
clientId: string;
|
|
5
5
|
apiUrl: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const useClient: ({ clientId, apiUrl, mode }: UseClientOptions) =>
|
|
7
|
+
export declare const useClient: ({ clientId, apiUrl, mode }: UseClientOptions) => WebchatClient | MessagingClient | undefined;
|
|
8
8
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export * from './components';
|
|
|
2
2
|
export * from './providers';
|
|
3
3
|
export * from './types';
|
|
4
4
|
export * from './themes';
|
|
5
|
-
export { MessagingClient as
|
|
5
|
+
export { MessagingClient, PushpinClient, type WebchatClient as WebChatClient } from './client';
|
|
6
6
|
export { useWebchatContext } from './contexts';
|
|
7
7
|
export { mergeThemes } from './utils';
|
|
8
8
|
export { useClient } from './hooks';
|