@inploi/plugin-chatbot 3.28.7 → 3.30.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/cdn/index.js +13 -13
- package/cdn/style.css +1 -1
- package/dist/chatbot-body-59b9e18a.js +3951 -0
- package/dist/chatbot-body-7ee64297.cjs +1 -0
- package/dist/chatbot.api.d.ts +231 -11
- package/dist/chatbot.state.d.ts +8 -1
- package/dist/chatbot.utils.d.ts +24 -2
- package/dist/components/chat-input/chat-input.address.d.ts +1 -1
- package/dist/components/chat-input/chat-input.d.ts +5 -1
- package/dist/components/chat-input/chat-input.phone-number.d.ts +8 -4
- package/dist/components/chat-input/input-style.d.ts +3 -0
- package/dist/index-13d4c822.js +4682 -0
- package/dist/index-d064cfc7.cjs +45 -0
- package/dist/interpreter.d.ts +2 -1
- package/dist/mocks/flows.mocks.d.ts +1 -1
- package/dist/plugin-chatbot.cjs +1 -5
- package/dist/plugin-chatbot.js +2 -2
- package/dist/style.css +1 -1769
- package/package.json +4 -5
- package/dist/chatbot-body-a8a1e4f3.js +0 -4886
- package/dist/chatbot-body-ea9d97f5.cjs +0 -4886
- package/dist/index-12c8b547.js +0 -5872
- package/dist/index-ab7e5077.cjs +0 -5871
package/dist/chatbot.api.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ export declare const FlowSchema: import("valibot").ObjectSchema<{
|
|
|
83
83
|
key: string;
|
|
84
84
|
question: string;
|
|
85
85
|
optional: boolean;
|
|
86
|
-
format: "text" | "
|
|
86
|
+
format: "text" | "phone" | "url" | "email";
|
|
87
87
|
placeholder?: string | undefined;
|
|
88
88
|
maxChars?: number | undefined;
|
|
89
89
|
minChars?: number | undefined;
|
|
@@ -106,6 +106,20 @@ export declare const FlowSchema: import("valibot").ObjectSchema<{
|
|
|
106
106
|
id: string;
|
|
107
107
|
isHead?: boolean | undefined;
|
|
108
108
|
nextId?: string | undefined;
|
|
109
|
+
} | {
|
|
110
|
+
data: {
|
|
111
|
+
key: string;
|
|
112
|
+
question: string;
|
|
113
|
+
optional: boolean;
|
|
114
|
+
placeholder: string;
|
|
115
|
+
maxChars: number;
|
|
116
|
+
minChars: number;
|
|
117
|
+
defaultCountryCode: string;
|
|
118
|
+
};
|
|
119
|
+
type: "question-phone";
|
|
120
|
+
id: string;
|
|
121
|
+
isHead?: boolean | undefined;
|
|
122
|
+
nextId?: string | undefined;
|
|
109
123
|
} | {
|
|
110
124
|
data: {
|
|
111
125
|
options: {
|
|
@@ -216,6 +230,12 @@ export declare const FlowSchema: import("valibot").ObjectSchema<{
|
|
|
216
230
|
id: string;
|
|
217
231
|
isHead?: boolean | undefined;
|
|
218
232
|
nextId?: string | undefined;
|
|
233
|
+
} | {
|
|
234
|
+
data: {};
|
|
235
|
+
type: "feedback";
|
|
236
|
+
id: string;
|
|
237
|
+
isHead?: boolean | undefined;
|
|
238
|
+
nextId?: string | undefined;
|
|
219
239
|
}>, ({
|
|
220
240
|
data: {
|
|
221
241
|
text: string;
|
|
@@ -288,7 +308,7 @@ export declare const FlowSchema: import("valibot").ObjectSchema<{
|
|
|
288
308
|
key: string;
|
|
289
309
|
question: string;
|
|
290
310
|
optional: boolean;
|
|
291
|
-
format: "text" | "
|
|
311
|
+
format: "text" | "phone" | "url" | "email";
|
|
292
312
|
placeholder?: string | undefined;
|
|
293
313
|
maxChars?: number | undefined;
|
|
294
314
|
minChars?: number | undefined;
|
|
@@ -311,6 +331,20 @@ export declare const FlowSchema: import("valibot").ObjectSchema<{
|
|
|
311
331
|
id: string;
|
|
312
332
|
isHead?: boolean | undefined;
|
|
313
333
|
nextId?: string | undefined;
|
|
334
|
+
} | {
|
|
335
|
+
data: {
|
|
336
|
+
key: string;
|
|
337
|
+
question: string;
|
|
338
|
+
optional: boolean;
|
|
339
|
+
placeholder: string;
|
|
340
|
+
maxChars: number;
|
|
341
|
+
minChars: number;
|
|
342
|
+
defaultCountryCode: string;
|
|
343
|
+
};
|
|
344
|
+
type: "question-phone";
|
|
345
|
+
id: string;
|
|
346
|
+
isHead?: boolean | undefined;
|
|
347
|
+
nextId?: string | undefined;
|
|
314
348
|
} | {
|
|
315
349
|
data: {
|
|
316
350
|
options: {
|
|
@@ -421,6 +455,12 @@ export declare const FlowSchema: import("valibot").ObjectSchema<{
|
|
|
421
455
|
id: string;
|
|
422
456
|
isHead?: boolean | undefined;
|
|
423
457
|
nextId?: string | undefined;
|
|
458
|
+
} | {
|
|
459
|
+
data: {};
|
|
460
|
+
type: "feedback";
|
|
461
|
+
id: string;
|
|
462
|
+
isHead?: boolean | undefined;
|
|
463
|
+
nextId?: string | undefined;
|
|
424
464
|
})[]>;
|
|
425
465
|
context_schema: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").RecordSchema<import("valibot").StringSchema<string>, import("valibot").ObjectSchema<{
|
|
426
466
|
required: import("valibot").BooleanSchema<boolean>;
|
|
@@ -520,7 +560,7 @@ export declare const FlowSchema: import("valibot").ObjectSchema<{
|
|
|
520
560
|
key: string;
|
|
521
561
|
question: string;
|
|
522
562
|
optional: boolean;
|
|
523
|
-
format: "text" | "
|
|
563
|
+
format: "text" | "phone" | "url" | "email";
|
|
524
564
|
placeholder?: string | undefined;
|
|
525
565
|
maxChars?: number | undefined;
|
|
526
566
|
minChars?: number | undefined;
|
|
@@ -543,6 +583,20 @@ export declare const FlowSchema: import("valibot").ObjectSchema<{
|
|
|
543
583
|
id: string;
|
|
544
584
|
isHead?: boolean | undefined;
|
|
545
585
|
nextId?: string | undefined;
|
|
586
|
+
} | {
|
|
587
|
+
data: {
|
|
588
|
+
key: string;
|
|
589
|
+
question: string;
|
|
590
|
+
optional: boolean;
|
|
591
|
+
placeholder: string;
|
|
592
|
+
maxChars: number;
|
|
593
|
+
minChars: number;
|
|
594
|
+
defaultCountryCode: string;
|
|
595
|
+
};
|
|
596
|
+
type: "question-phone";
|
|
597
|
+
id: string;
|
|
598
|
+
isHead?: boolean | undefined;
|
|
599
|
+
nextId?: string | undefined;
|
|
546
600
|
} | {
|
|
547
601
|
data: {
|
|
548
602
|
options: {
|
|
@@ -653,6 +707,12 @@ export declare const FlowSchema: import("valibot").ObjectSchema<{
|
|
|
653
707
|
id: string;
|
|
654
708
|
isHead?: boolean | undefined;
|
|
655
709
|
nextId?: string | undefined;
|
|
710
|
+
} | {
|
|
711
|
+
data: {};
|
|
712
|
+
type: "feedback";
|
|
713
|
+
id: string;
|
|
714
|
+
isHead?: boolean | undefined;
|
|
715
|
+
nextId?: string | undefined;
|
|
656
716
|
})[];
|
|
657
717
|
context_schema?: {
|
|
658
718
|
[x: string]: {
|
|
@@ -739,7 +799,7 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
739
799
|
key: string;
|
|
740
800
|
question: string;
|
|
741
801
|
optional: boolean;
|
|
742
|
-
format: "text" | "
|
|
802
|
+
format: "text" | "phone" | "url" | "email";
|
|
743
803
|
placeholder?: string | undefined;
|
|
744
804
|
maxChars?: number | undefined;
|
|
745
805
|
minChars?: number | undefined;
|
|
@@ -762,6 +822,20 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
762
822
|
id: string;
|
|
763
823
|
isHead?: boolean | undefined;
|
|
764
824
|
nextId?: string | undefined;
|
|
825
|
+
} | {
|
|
826
|
+
data: {
|
|
827
|
+
key: string;
|
|
828
|
+
question: string;
|
|
829
|
+
optional: boolean;
|
|
830
|
+
placeholder: string;
|
|
831
|
+
maxChars: number;
|
|
832
|
+
minChars: number;
|
|
833
|
+
defaultCountryCode: string;
|
|
834
|
+
};
|
|
835
|
+
type: "question-phone";
|
|
836
|
+
id: string;
|
|
837
|
+
isHead?: boolean | undefined;
|
|
838
|
+
nextId?: string | undefined;
|
|
765
839
|
} | {
|
|
766
840
|
data: {
|
|
767
841
|
options: {
|
|
@@ -872,6 +946,12 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
872
946
|
id: string;
|
|
873
947
|
isHead?: boolean | undefined;
|
|
874
948
|
nextId?: string | undefined;
|
|
949
|
+
} | {
|
|
950
|
+
data: {};
|
|
951
|
+
type: "feedback";
|
|
952
|
+
id: string;
|
|
953
|
+
isHead?: boolean | undefined;
|
|
954
|
+
nextId?: string | undefined;
|
|
875
955
|
}>, ({
|
|
876
956
|
data: {
|
|
877
957
|
text: string;
|
|
@@ -944,7 +1024,7 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
944
1024
|
key: string;
|
|
945
1025
|
question: string;
|
|
946
1026
|
optional: boolean;
|
|
947
|
-
format: "text" | "
|
|
1027
|
+
format: "text" | "phone" | "url" | "email";
|
|
948
1028
|
placeholder?: string | undefined;
|
|
949
1029
|
maxChars?: number | undefined;
|
|
950
1030
|
minChars?: number | undefined;
|
|
@@ -967,6 +1047,20 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
967
1047
|
id: string;
|
|
968
1048
|
isHead?: boolean | undefined;
|
|
969
1049
|
nextId?: string | undefined;
|
|
1050
|
+
} | {
|
|
1051
|
+
data: {
|
|
1052
|
+
key: string;
|
|
1053
|
+
question: string;
|
|
1054
|
+
optional: boolean;
|
|
1055
|
+
placeholder: string;
|
|
1056
|
+
maxChars: number;
|
|
1057
|
+
minChars: number;
|
|
1058
|
+
defaultCountryCode: string;
|
|
1059
|
+
};
|
|
1060
|
+
type: "question-phone";
|
|
1061
|
+
id: string;
|
|
1062
|
+
isHead?: boolean | undefined;
|
|
1063
|
+
nextId?: string | undefined;
|
|
970
1064
|
} | {
|
|
971
1065
|
data: {
|
|
972
1066
|
options: {
|
|
@@ -1077,6 +1171,12 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1077
1171
|
id: string;
|
|
1078
1172
|
isHead?: boolean | undefined;
|
|
1079
1173
|
nextId?: string | undefined;
|
|
1174
|
+
} | {
|
|
1175
|
+
data: {};
|
|
1176
|
+
type: "feedback";
|
|
1177
|
+
id: string;
|
|
1178
|
+
isHead?: boolean | undefined;
|
|
1179
|
+
nextId?: string | undefined;
|
|
1080
1180
|
})[]>;
|
|
1081
1181
|
context_schema: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").RecordSchema<import("valibot").StringSchema<string>, import("valibot").ObjectSchema<{
|
|
1082
1182
|
required: import("valibot").BooleanSchema<boolean>;
|
|
@@ -1176,7 +1276,7 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1176
1276
|
key: string;
|
|
1177
1277
|
question: string;
|
|
1178
1278
|
optional: boolean;
|
|
1179
|
-
format: "text" | "
|
|
1279
|
+
format: "text" | "phone" | "url" | "email";
|
|
1180
1280
|
placeholder?: string | undefined;
|
|
1181
1281
|
maxChars?: number | undefined;
|
|
1182
1282
|
minChars?: number | undefined;
|
|
@@ -1199,6 +1299,20 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1199
1299
|
id: string;
|
|
1200
1300
|
isHead?: boolean | undefined;
|
|
1201
1301
|
nextId?: string | undefined;
|
|
1302
|
+
} | {
|
|
1303
|
+
data: {
|
|
1304
|
+
key: string;
|
|
1305
|
+
question: string;
|
|
1306
|
+
optional: boolean;
|
|
1307
|
+
placeholder: string;
|
|
1308
|
+
maxChars: number;
|
|
1309
|
+
minChars: number;
|
|
1310
|
+
defaultCountryCode: string;
|
|
1311
|
+
};
|
|
1312
|
+
type: "question-phone";
|
|
1313
|
+
id: string;
|
|
1314
|
+
isHead?: boolean | undefined;
|
|
1315
|
+
nextId?: string | undefined;
|
|
1202
1316
|
} | {
|
|
1203
1317
|
data: {
|
|
1204
1318
|
options: {
|
|
@@ -1309,6 +1423,12 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1309
1423
|
id: string;
|
|
1310
1424
|
isHead?: boolean | undefined;
|
|
1311
1425
|
nextId?: string | undefined;
|
|
1426
|
+
} | {
|
|
1427
|
+
data: {};
|
|
1428
|
+
type: "feedback";
|
|
1429
|
+
id: string;
|
|
1430
|
+
isHead?: boolean | undefined;
|
|
1431
|
+
nextId?: string | undefined;
|
|
1312
1432
|
})[];
|
|
1313
1433
|
context_schema?: {
|
|
1314
1434
|
[x: string]: {
|
|
@@ -1394,7 +1514,7 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1394
1514
|
key: string;
|
|
1395
1515
|
question: string;
|
|
1396
1516
|
optional: boolean;
|
|
1397
|
-
format: "text" | "
|
|
1517
|
+
format: "text" | "phone" | "url" | "email";
|
|
1398
1518
|
placeholder?: string | undefined;
|
|
1399
1519
|
maxChars?: number | undefined;
|
|
1400
1520
|
minChars?: number | undefined;
|
|
@@ -1417,6 +1537,20 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1417
1537
|
id: string;
|
|
1418
1538
|
isHead?: boolean | undefined;
|
|
1419
1539
|
nextId?: string | undefined;
|
|
1540
|
+
} | {
|
|
1541
|
+
data: {
|
|
1542
|
+
key: string;
|
|
1543
|
+
question: string;
|
|
1544
|
+
optional: boolean;
|
|
1545
|
+
placeholder: string;
|
|
1546
|
+
maxChars: number;
|
|
1547
|
+
minChars: number;
|
|
1548
|
+
defaultCountryCode: string;
|
|
1549
|
+
};
|
|
1550
|
+
type: "question-phone";
|
|
1551
|
+
id: string;
|
|
1552
|
+
isHead?: boolean | undefined;
|
|
1553
|
+
nextId?: string | undefined;
|
|
1420
1554
|
} | {
|
|
1421
1555
|
data: {
|
|
1422
1556
|
options: {
|
|
@@ -1527,6 +1661,12 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1527
1661
|
id: string;
|
|
1528
1662
|
isHead?: boolean | undefined;
|
|
1529
1663
|
nextId?: string | undefined;
|
|
1664
|
+
} | {
|
|
1665
|
+
data: {};
|
|
1666
|
+
type: "feedback";
|
|
1667
|
+
id: string;
|
|
1668
|
+
isHead?: boolean | undefined;
|
|
1669
|
+
nextId?: string | undefined;
|
|
1530
1670
|
})[];
|
|
1531
1671
|
context_schema?: {
|
|
1532
1672
|
[x: string]: {
|
|
@@ -1618,7 +1758,7 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1618
1758
|
key: string;
|
|
1619
1759
|
question: string;
|
|
1620
1760
|
optional: boolean;
|
|
1621
|
-
format: "text" | "
|
|
1761
|
+
format: "text" | "phone" | "url" | "email";
|
|
1622
1762
|
placeholder?: string | undefined;
|
|
1623
1763
|
maxChars?: number | undefined;
|
|
1624
1764
|
minChars?: number | undefined;
|
|
@@ -1641,6 +1781,20 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1641
1781
|
id: string;
|
|
1642
1782
|
isHead?: boolean | undefined;
|
|
1643
1783
|
nextId?: string | undefined;
|
|
1784
|
+
} | {
|
|
1785
|
+
data: {
|
|
1786
|
+
key: string;
|
|
1787
|
+
question: string;
|
|
1788
|
+
optional: boolean;
|
|
1789
|
+
placeholder: string;
|
|
1790
|
+
maxChars: number;
|
|
1791
|
+
minChars: number;
|
|
1792
|
+
defaultCountryCode: string;
|
|
1793
|
+
};
|
|
1794
|
+
type: "question-phone";
|
|
1795
|
+
id: string;
|
|
1796
|
+
isHead?: boolean | undefined;
|
|
1797
|
+
nextId?: string | undefined;
|
|
1644
1798
|
} | {
|
|
1645
1799
|
data: {
|
|
1646
1800
|
options: {
|
|
@@ -1751,6 +1905,12 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1751
1905
|
id: string;
|
|
1752
1906
|
isHead?: boolean | undefined;
|
|
1753
1907
|
nextId?: string | undefined;
|
|
1908
|
+
} | {
|
|
1909
|
+
data: {};
|
|
1910
|
+
type: "feedback";
|
|
1911
|
+
id: string;
|
|
1912
|
+
isHead?: boolean | undefined;
|
|
1913
|
+
nextId?: string | undefined;
|
|
1754
1914
|
}>, ({
|
|
1755
1915
|
data: {
|
|
1756
1916
|
text: string;
|
|
@@ -1823,7 +1983,7 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1823
1983
|
key: string;
|
|
1824
1984
|
question: string;
|
|
1825
1985
|
optional: boolean;
|
|
1826
|
-
format: "text" | "
|
|
1986
|
+
format: "text" | "phone" | "url" | "email";
|
|
1827
1987
|
placeholder?: string | undefined;
|
|
1828
1988
|
maxChars?: number | undefined;
|
|
1829
1989
|
minChars?: number | undefined;
|
|
@@ -1846,6 +2006,20 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1846
2006
|
id: string;
|
|
1847
2007
|
isHead?: boolean | undefined;
|
|
1848
2008
|
nextId?: string | undefined;
|
|
2009
|
+
} | {
|
|
2010
|
+
data: {
|
|
2011
|
+
key: string;
|
|
2012
|
+
question: string;
|
|
2013
|
+
optional: boolean;
|
|
2014
|
+
placeholder: string;
|
|
2015
|
+
maxChars: number;
|
|
2016
|
+
minChars: number;
|
|
2017
|
+
defaultCountryCode: string;
|
|
2018
|
+
};
|
|
2019
|
+
type: "question-phone";
|
|
2020
|
+
id: string;
|
|
2021
|
+
isHead?: boolean | undefined;
|
|
2022
|
+
nextId?: string | undefined;
|
|
1849
2023
|
} | {
|
|
1850
2024
|
data: {
|
|
1851
2025
|
options: {
|
|
@@ -1956,6 +2130,12 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1956
2130
|
id: string;
|
|
1957
2131
|
isHead?: boolean | undefined;
|
|
1958
2132
|
nextId?: string | undefined;
|
|
2133
|
+
} | {
|
|
2134
|
+
data: {};
|
|
2135
|
+
type: "feedback";
|
|
2136
|
+
id: string;
|
|
2137
|
+
isHead?: boolean | undefined;
|
|
2138
|
+
nextId?: string | undefined;
|
|
1959
2139
|
})[]>;
|
|
1960
2140
|
context_schema: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").RecordSchema<import("valibot").StringSchema<string>, import("valibot").ObjectSchema<{
|
|
1961
2141
|
required: import("valibot").BooleanSchema<boolean>;
|
|
@@ -2055,7 +2235,7 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
2055
2235
|
key: string;
|
|
2056
2236
|
question: string;
|
|
2057
2237
|
optional: boolean;
|
|
2058
|
-
format: "text" | "
|
|
2238
|
+
format: "text" | "phone" | "url" | "email";
|
|
2059
2239
|
placeholder?: string | undefined;
|
|
2060
2240
|
maxChars?: number | undefined;
|
|
2061
2241
|
minChars?: number | undefined;
|
|
@@ -2078,6 +2258,20 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
2078
2258
|
id: string;
|
|
2079
2259
|
isHead?: boolean | undefined;
|
|
2080
2260
|
nextId?: string | undefined;
|
|
2261
|
+
} | {
|
|
2262
|
+
data: {
|
|
2263
|
+
key: string;
|
|
2264
|
+
question: string;
|
|
2265
|
+
optional: boolean;
|
|
2266
|
+
placeholder: string;
|
|
2267
|
+
maxChars: number;
|
|
2268
|
+
minChars: number;
|
|
2269
|
+
defaultCountryCode: string;
|
|
2270
|
+
};
|
|
2271
|
+
type: "question-phone";
|
|
2272
|
+
id: string;
|
|
2273
|
+
isHead?: boolean | undefined;
|
|
2274
|
+
nextId?: string | undefined;
|
|
2081
2275
|
} | {
|
|
2082
2276
|
data: {
|
|
2083
2277
|
options: {
|
|
@@ -2188,6 +2382,12 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
2188
2382
|
id: string;
|
|
2189
2383
|
isHead?: boolean | undefined;
|
|
2190
2384
|
nextId?: string | undefined;
|
|
2385
|
+
} | {
|
|
2386
|
+
data: {};
|
|
2387
|
+
type: "feedback";
|
|
2388
|
+
id: string;
|
|
2389
|
+
isHead?: boolean | undefined;
|
|
2390
|
+
nextId?: string | undefined;
|
|
2191
2391
|
})[];
|
|
2192
2392
|
context_schema?: {
|
|
2193
2393
|
[x: string]: {
|
|
@@ -2280,7 +2480,7 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
2280
2480
|
key: string;
|
|
2281
2481
|
question: string;
|
|
2282
2482
|
optional: boolean;
|
|
2283
|
-
format: "text" | "
|
|
2483
|
+
format: "text" | "phone" | "url" | "email";
|
|
2284
2484
|
placeholder?: string | undefined;
|
|
2285
2485
|
maxChars?: number | undefined;
|
|
2286
2486
|
minChars?: number | undefined;
|
|
@@ -2303,6 +2503,20 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
2303
2503
|
id: string;
|
|
2304
2504
|
isHead?: boolean | undefined;
|
|
2305
2505
|
nextId?: string | undefined;
|
|
2506
|
+
} | {
|
|
2507
|
+
data: {
|
|
2508
|
+
key: string;
|
|
2509
|
+
question: string;
|
|
2510
|
+
optional: boolean;
|
|
2511
|
+
placeholder: string;
|
|
2512
|
+
maxChars: number;
|
|
2513
|
+
minChars: number;
|
|
2514
|
+
defaultCountryCode: string;
|
|
2515
|
+
};
|
|
2516
|
+
type: "question-phone";
|
|
2517
|
+
id: string;
|
|
2518
|
+
isHead?: boolean | undefined;
|
|
2519
|
+
nextId?: string | undefined;
|
|
2306
2520
|
} | {
|
|
2307
2521
|
data: {
|
|
2308
2522
|
options: {
|
|
@@ -2413,6 +2627,12 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
2413
2627
|
id: string;
|
|
2414
2628
|
isHead?: boolean | undefined;
|
|
2415
2629
|
nextId?: string | undefined;
|
|
2630
|
+
} | {
|
|
2631
|
+
data: {};
|
|
2632
|
+
type: "feedback";
|
|
2633
|
+
id: string;
|
|
2634
|
+
isHead?: boolean | undefined;
|
|
2635
|
+
nextId?: string | undefined;
|
|
2416
2636
|
})[];
|
|
2417
2637
|
context_schema?: {
|
|
2418
2638
|
[x: string]: {
|
package/dist/chatbot.state.d.ts
CHANGED
|
@@ -104,6 +104,13 @@ export type FlowSubmissionNumber = {
|
|
|
104
104
|
value: number;
|
|
105
105
|
type: 'number';
|
|
106
106
|
};
|
|
107
|
+
export type FlowSubmissionPhone = {
|
|
108
|
+
value: {
|
|
109
|
+
countryCode: string;
|
|
110
|
+
phoneNumber: string;
|
|
111
|
+
};
|
|
112
|
+
type: 'phone';
|
|
113
|
+
};
|
|
107
114
|
export type FlowSubmissionEnum = {
|
|
108
115
|
value: string[];
|
|
109
116
|
type: 'enum';
|
|
@@ -112,7 +119,7 @@ export type FlowSubmissionIntegration = {
|
|
|
112
119
|
value: unknown;
|
|
113
120
|
type: 'integration';
|
|
114
121
|
};
|
|
115
|
-
export type FlowSubmission = FlowSubmissionString | FlowSubmissionBoolean | FlowSubmissionNumber | FlowSubmissionEnum | FlowSubmissionAddress | FlowSubmissionFile | FlowSubmissionIntegration;
|
|
122
|
+
export type FlowSubmission = FlowSubmissionString | FlowSubmissionBoolean | FlowSubmissionNumber | FlowSubmissionPhone | FlowSubmissionEnum | FlowSubmissionAddress | FlowSubmissionFile | FlowSubmissionIntegration;
|
|
116
123
|
export type KeyToSubmissionMap = {
|
|
117
124
|
[key: string]: FlowSubmission;
|
|
118
125
|
};
|
package/dist/chatbot.utils.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ export declare const getHeadOrThrow: (nodes: FlowNode[]) => {
|
|
|
74
74
|
key: string;
|
|
75
75
|
question: string;
|
|
76
76
|
optional: boolean;
|
|
77
|
-
format: "text" | "
|
|
77
|
+
format: "text" | "phone" | "url" | "email";
|
|
78
78
|
placeholder?: string | undefined;
|
|
79
79
|
maxChars?: number | undefined;
|
|
80
80
|
minChars?: number | undefined;
|
|
@@ -97,6 +97,20 @@ export declare const getHeadOrThrow: (nodes: FlowNode[]) => {
|
|
|
97
97
|
id: string;
|
|
98
98
|
isHead?: boolean | undefined;
|
|
99
99
|
nextId?: string | undefined;
|
|
100
|
+
} | {
|
|
101
|
+
data: {
|
|
102
|
+
key: string;
|
|
103
|
+
question: string;
|
|
104
|
+
optional: boolean;
|
|
105
|
+
placeholder: string;
|
|
106
|
+
maxChars: number;
|
|
107
|
+
minChars: number;
|
|
108
|
+
defaultCountryCode: string;
|
|
109
|
+
};
|
|
110
|
+
type: "question-phone";
|
|
111
|
+
id: string;
|
|
112
|
+
isHead?: boolean | undefined;
|
|
113
|
+
nextId?: string | undefined;
|
|
100
114
|
} | {
|
|
101
115
|
data: {
|
|
102
116
|
options: {
|
|
@@ -207,14 +221,22 @@ export declare const getHeadOrThrow: (nodes: FlowNode[]) => {
|
|
|
207
221
|
id: string;
|
|
208
222
|
isHead?: boolean | undefined;
|
|
209
223
|
nextId?: string | undefined;
|
|
224
|
+
} | {
|
|
225
|
+
data: {};
|
|
226
|
+
type: "feedback";
|
|
227
|
+
id: string;
|
|
228
|
+
isHead?: boolean | undefined;
|
|
229
|
+
nextId?: string | undefined;
|
|
210
230
|
};
|
|
211
231
|
export declare const getFlowSubmissionsPayload: (submissions: KeyToSubmissionMap) => Record<string, unknown>;
|
|
212
|
-
export declare const isSubmissionOfType: <T extends "string" | "number" | "boolean" | "enum" | "address" | "file" | "integration">(type: T) => (submission?: FlowSubmission) => submission is Extract<import("./chatbot.state").FlowSubmissionString, {
|
|
232
|
+
export declare const isSubmissionOfType: <T extends "string" | "number" | "boolean" | "enum" | "phone" | "address" | "file" | "integration">(type: T) => (submission?: FlowSubmission) => submission is Extract<import("./chatbot.state").FlowSubmissionString, {
|
|
213
233
|
type: T;
|
|
214
234
|
}> | Extract<import("./chatbot.state").FlowSubmissionBoolean, {
|
|
215
235
|
type: T;
|
|
216
236
|
}> | Extract<import("./chatbot.state").FlowSubmissionNumber, {
|
|
217
237
|
type: T;
|
|
238
|
+
}> | Extract<import("./chatbot.state").FlowSubmissionPhone, {
|
|
239
|
+
type: T;
|
|
218
240
|
}> | Extract<import("./chatbot.state").FlowSubmissionEnum, {
|
|
219
241
|
type: T;
|
|
220
242
|
}> | Extract<import("./chatbot.state").FlowSubmissionAddress, {
|
|
@@ -13,4 +13,4 @@ export type AddressInputPayload = {
|
|
|
13
13
|
};
|
|
14
14
|
submission: FlowSubmissionAddress | null;
|
|
15
15
|
};
|
|
16
|
-
export declare const ChatInputAddress: ({ input, onSubmitSuccess }: ChatInputProps<AddressInputPayload>) => JSX.Element;
|
|
16
|
+
export declare const ChatInputAddress: ({ input, onSubmitSuccess, logger }: ChatInputProps<AddressInputPayload>) => JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Logger } from '@inploi/sdk';
|
|
1
2
|
import { DistributivePick } from '../../chatbot.utils';
|
|
2
3
|
import { FlowSubmission } from '../../chatbot.state';
|
|
3
4
|
import { AddressInputPayload } from './chat-input.address';
|
|
@@ -12,7 +13,10 @@ export type SubmitSuccessFn = (submission: FlowSubmission | null) => void;
|
|
|
12
13
|
export type ChatInputProps<T extends ChatbotInput> = {
|
|
13
14
|
onSubmitSuccess: (value: T['submission']) => void;
|
|
14
15
|
input: Omit<T, 'submission'>;
|
|
16
|
+
logger: Logger;
|
|
15
17
|
};
|
|
16
18
|
export type ChatbotInput = TextPayload | NumberPayload | MultipleChoicePayload | BooleanChoicePayload | FilePayload | SubmitPayload | AddressInputPayload | PhonePayload;
|
|
17
19
|
export type ChatInput = DistributivePick<ChatbotInput, 'type' | 'config' | 'key'>;
|
|
18
|
-
export declare const ChatInput: (
|
|
20
|
+
export declare const ChatInput: ({ logger }: {
|
|
21
|
+
logger: Logger;
|
|
22
|
+
}) => import("preact").JSX.Element;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import { FlowSubmissionString } from '../../chatbot.state';
|
|
2
|
-
import { ChatInputProps } from './chat-input';
|
|
1
|
+
import { FlowSubmissionPhone, FlowSubmissionString } from '../../chatbot.state';
|
|
2
|
+
import type { ChatInputProps } from './chat-input';
|
|
3
3
|
export type PhonePayload = {
|
|
4
4
|
type: 'phone';
|
|
5
5
|
key: string | undefined;
|
|
6
6
|
config: {
|
|
7
7
|
optional: boolean;
|
|
8
|
+
submissionFormat: 'phone' | 'text';
|
|
8
9
|
placeholder?: string;
|
|
9
|
-
defaultValue
|
|
10
|
+
defaultValue: {
|
|
11
|
+
countryCode?: string;
|
|
12
|
+
phoneNumber?: string;
|
|
13
|
+
};
|
|
10
14
|
minChars?: number;
|
|
11
15
|
maxChars?: number;
|
|
12
16
|
};
|
|
13
|
-
submission: FlowSubmissionString | null;
|
|
17
|
+
submission: FlowSubmissionPhone | FlowSubmissionString | null;
|
|
14
18
|
};
|
|
15
19
|
export declare const ChatInputPhoneNumber: ({ input, onSubmitSuccess }: ChatInputProps<PhonePayload>) => import("preact").JSX.Element;
|