@inploi/plugin-chatbot 3.18.1 → 3.20.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 +11 -11
- package/dist/{chatbot-body-67894fdd.js → chatbot-body-e6cc92c4.js} +177 -543
- package/dist/{chatbot-body-c8efca55.cjs → chatbot-body-f16e9411.cjs} +178 -544
- package/dist/chatbot.api.d.ts +132 -7
- package/dist/conditions.d.ts +4 -1
- package/dist/{index-18edb2f5.js → index-41fa1f9a.js} +613 -31
- package/dist/{index-89588fad.cjs → index-701e3473.cjs} +584 -2
- package/dist/interpolation.d.ts +2 -0
- package/dist/interpolation.test.d.ts +1 -0
- package/dist/interpreter.d.ts +9 -1
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +2 -2
- package/package.json +5 -5
package/dist/chatbot.api.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { FlowNode } from '@inploi/core/flows';
|
|
2
|
-
import { AnySchema } from 'valibot';
|
|
3
|
-
export type Flow = {
|
|
4
|
-
id: string;
|
|
5
|
-
version: number;
|
|
6
|
-
build: number;
|
|
7
|
-
nodes: FlowNode[];
|
|
8
|
-
};
|
|
2
|
+
import { AnySchema, Output } from 'valibot';
|
|
9
3
|
export type FlowPayload = {
|
|
10
4
|
flow: {
|
|
11
5
|
id: string;
|
|
@@ -340,6 +334,28 @@ export declare const FlowSchema: import("valibot").ObjectSchema<{
|
|
|
340
334
|
isHead?: boolean | undefined;
|
|
341
335
|
nextId?: string | undefined;
|
|
342
336
|
})[]>;
|
|
337
|
+
context_schema: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").RecordSchema<import("valibot").StringSchema<string>, import("valibot").ObjectSchema<{
|
|
338
|
+
required: import("valibot").BooleanSchema<boolean>;
|
|
339
|
+
type: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"string", "string">, import("valibot").LiteralSchema<"number", "number">], "string" | "number">;
|
|
340
|
+
}, undefined, {
|
|
341
|
+
required: boolean;
|
|
342
|
+
type: "string" | "number";
|
|
343
|
+
}>, {
|
|
344
|
+
[x: string]: {
|
|
345
|
+
required: boolean;
|
|
346
|
+
type: "string" | "number";
|
|
347
|
+
};
|
|
348
|
+
}>, undefined, {
|
|
349
|
+
[x: string]: {
|
|
350
|
+
required: boolean;
|
|
351
|
+
type: "string" | "number";
|
|
352
|
+
};
|
|
353
|
+
} | null>, undefined, {
|
|
354
|
+
[x: string]: {
|
|
355
|
+
required: boolean;
|
|
356
|
+
type: "string" | "number";
|
|
357
|
+
};
|
|
358
|
+
} | null | undefined>;
|
|
343
359
|
}, undefined, {
|
|
344
360
|
id: string;
|
|
345
361
|
version: number;
|
|
@@ -506,7 +522,14 @@ export declare const FlowSchema: import("valibot").ObjectSchema<{
|
|
|
506
522
|
isHead?: boolean | undefined;
|
|
507
523
|
nextId?: string | undefined;
|
|
508
524
|
})[];
|
|
525
|
+
context_schema?: {
|
|
526
|
+
[x: string]: {
|
|
527
|
+
required: boolean;
|
|
528
|
+
type: "string" | "number";
|
|
529
|
+
};
|
|
530
|
+
} | null | undefined;
|
|
509
531
|
}>;
|
|
532
|
+
export type Flow = Output<typeof FlowSchema>;
|
|
510
533
|
export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
511
534
|
flow: import("valibot").ObjectSchema<{
|
|
512
535
|
id: import("valibot").StringSchema<string>;
|
|
@@ -835,6 +858,28 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
835
858
|
isHead?: boolean | undefined;
|
|
836
859
|
nextId?: string | undefined;
|
|
837
860
|
})[]>;
|
|
861
|
+
context_schema: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").RecordSchema<import("valibot").StringSchema<string>, import("valibot").ObjectSchema<{
|
|
862
|
+
required: import("valibot").BooleanSchema<boolean>;
|
|
863
|
+
type: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"string", "string">, import("valibot").LiteralSchema<"number", "number">], "string" | "number">;
|
|
864
|
+
}, undefined, {
|
|
865
|
+
required: boolean;
|
|
866
|
+
type: "string" | "number";
|
|
867
|
+
}>, {
|
|
868
|
+
[x: string]: {
|
|
869
|
+
required: boolean;
|
|
870
|
+
type: "string" | "number";
|
|
871
|
+
};
|
|
872
|
+
}>, undefined, {
|
|
873
|
+
[x: string]: {
|
|
874
|
+
required: boolean;
|
|
875
|
+
type: "string" | "number";
|
|
876
|
+
};
|
|
877
|
+
} | null>, undefined, {
|
|
878
|
+
[x: string]: {
|
|
879
|
+
required: boolean;
|
|
880
|
+
type: "string" | "number";
|
|
881
|
+
};
|
|
882
|
+
} | null | undefined>;
|
|
838
883
|
}, undefined, {
|
|
839
884
|
id: string;
|
|
840
885
|
version: number;
|
|
@@ -1001,6 +1046,12 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1001
1046
|
isHead?: boolean | undefined;
|
|
1002
1047
|
nextId?: string | undefined;
|
|
1003
1048
|
})[];
|
|
1049
|
+
context_schema?: {
|
|
1050
|
+
[x: string]: {
|
|
1051
|
+
required: boolean;
|
|
1052
|
+
type: "string" | "number";
|
|
1053
|
+
};
|
|
1054
|
+
} | null | undefined;
|
|
1004
1055
|
}>;
|
|
1005
1056
|
}, undefined, {
|
|
1006
1057
|
flow: {
|
|
@@ -1169,6 +1220,12 @@ export declare const FlowByIdPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1169
1220
|
isHead?: boolean | undefined;
|
|
1170
1221
|
nextId?: string | undefined;
|
|
1171
1222
|
})[];
|
|
1223
|
+
context_schema?: {
|
|
1224
|
+
[x: string]: {
|
|
1225
|
+
required: boolean;
|
|
1226
|
+
type: "string" | "number";
|
|
1227
|
+
};
|
|
1228
|
+
} | null | undefined;
|
|
1172
1229
|
};
|
|
1173
1230
|
}>;
|
|
1174
1231
|
export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
@@ -1504,6 +1561,28 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1504
1561
|
isHead?: boolean | undefined;
|
|
1505
1562
|
nextId?: string | undefined;
|
|
1506
1563
|
})[]>;
|
|
1564
|
+
context_schema: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").RecordSchema<import("valibot").StringSchema<string>, import("valibot").ObjectSchema<{
|
|
1565
|
+
required: import("valibot").BooleanSchema<boolean>;
|
|
1566
|
+
type: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"string", "string">, import("valibot").LiteralSchema<"number", "number">], "string" | "number">;
|
|
1567
|
+
}, undefined, {
|
|
1568
|
+
required: boolean;
|
|
1569
|
+
type: "string" | "number";
|
|
1570
|
+
}>, {
|
|
1571
|
+
[x: string]: {
|
|
1572
|
+
required: boolean;
|
|
1573
|
+
type: "string" | "number";
|
|
1574
|
+
};
|
|
1575
|
+
}>, undefined, {
|
|
1576
|
+
[x: string]: {
|
|
1577
|
+
required: boolean;
|
|
1578
|
+
type: "string" | "number";
|
|
1579
|
+
};
|
|
1580
|
+
} | null>, undefined, {
|
|
1581
|
+
[x: string]: {
|
|
1582
|
+
required: boolean;
|
|
1583
|
+
type: "string" | "number";
|
|
1584
|
+
};
|
|
1585
|
+
} | null | undefined>;
|
|
1507
1586
|
}, undefined, {
|
|
1508
1587
|
id: string;
|
|
1509
1588
|
version: number;
|
|
@@ -1670,6 +1749,12 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1670
1749
|
isHead?: boolean | undefined;
|
|
1671
1750
|
nextId?: string | undefined;
|
|
1672
1751
|
})[];
|
|
1752
|
+
context_schema?: {
|
|
1753
|
+
[x: string]: {
|
|
1754
|
+
required: boolean;
|
|
1755
|
+
type: "string" | "number";
|
|
1756
|
+
};
|
|
1757
|
+
} | null | undefined;
|
|
1673
1758
|
}>;
|
|
1674
1759
|
job: import("valibot").ObjectSchema<{
|
|
1675
1760
|
id: import("valibot").StringSchema<string>;
|
|
@@ -1845,6 +1930,12 @@ export declare const FlowByJobPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
1845
1930
|
isHead?: boolean | undefined;
|
|
1846
1931
|
nextId?: string | undefined;
|
|
1847
1932
|
})[];
|
|
1933
|
+
context_schema?: {
|
|
1934
|
+
[x: string]: {
|
|
1935
|
+
required: boolean;
|
|
1936
|
+
type: "string" | "number";
|
|
1937
|
+
};
|
|
1938
|
+
} | null | undefined;
|
|
1848
1939
|
};
|
|
1849
1940
|
company: {
|
|
1850
1941
|
name: string;
|
|
@@ -2182,6 +2273,28 @@ export declare const StartFlowSchema: import("valibot").ObjectSchema<{
|
|
|
2182
2273
|
isHead?: boolean | undefined;
|
|
2183
2274
|
nextId?: string | undefined;
|
|
2184
2275
|
})[]>;
|
|
2276
|
+
context_schema: import("valibot").OptionalSchema<import("valibot").NullableSchema<import("valibot").RecordSchema<import("valibot").StringSchema<string>, import("valibot").ObjectSchema<{
|
|
2277
|
+
required: import("valibot").BooleanSchema<boolean>;
|
|
2278
|
+
type: import("valibot").UnionSchema<[import("valibot").LiteralSchema<"string", "string">, import("valibot").LiteralSchema<"number", "number">], "string" | "number">;
|
|
2279
|
+
}, undefined, {
|
|
2280
|
+
required: boolean;
|
|
2281
|
+
type: "string" | "number";
|
|
2282
|
+
}>, {
|
|
2283
|
+
[x: string]: {
|
|
2284
|
+
required: boolean;
|
|
2285
|
+
type: "string" | "number";
|
|
2286
|
+
};
|
|
2287
|
+
}>, undefined, {
|
|
2288
|
+
[x: string]: {
|
|
2289
|
+
required: boolean;
|
|
2290
|
+
type: "string" | "number";
|
|
2291
|
+
};
|
|
2292
|
+
} | null>, undefined, {
|
|
2293
|
+
[x: string]: {
|
|
2294
|
+
required: boolean;
|
|
2295
|
+
type: "string" | "number";
|
|
2296
|
+
};
|
|
2297
|
+
} | null | undefined>;
|
|
2185
2298
|
}, undefined, {
|
|
2186
2299
|
id: string;
|
|
2187
2300
|
version: number;
|
|
@@ -2348,6 +2461,12 @@ export declare const StartFlowSchema: import("valibot").ObjectSchema<{
|
|
|
2348
2461
|
isHead?: boolean | undefined;
|
|
2349
2462
|
nextId?: string | undefined;
|
|
2350
2463
|
})[];
|
|
2464
|
+
context_schema?: {
|
|
2465
|
+
[x: string]: {
|
|
2466
|
+
required: boolean;
|
|
2467
|
+
type: "string" | "number";
|
|
2468
|
+
};
|
|
2469
|
+
} | null | undefined;
|
|
2351
2470
|
}>;
|
|
2352
2471
|
title: import("valibot").StringSchema<string>;
|
|
2353
2472
|
flowKeys: import("valibot").ArraySchema<import("valibot").StringSchema<string>, string[]>;
|
|
@@ -2521,6 +2640,12 @@ export declare const StartFlowSchema: import("valibot").ObjectSchema<{
|
|
|
2521
2640
|
isHead?: boolean | undefined;
|
|
2522
2641
|
nextId?: string | undefined;
|
|
2523
2642
|
})[];
|
|
2643
|
+
context_schema?: {
|
|
2644
|
+
[x: string]: {
|
|
2645
|
+
required: boolean;
|
|
2646
|
+
type: "string" | "number";
|
|
2647
|
+
};
|
|
2648
|
+
} | null | undefined;
|
|
2524
2649
|
};
|
|
2525
2650
|
title: string;
|
|
2526
2651
|
flowKeys: string[];
|
package/dist/conditions.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { IfBlockNode } from '@inploi/core/flows';
|
|
2
2
|
import { KeyToSubmissionMap } from './chatbot.state';
|
|
3
|
-
export declare const isIfBlockConditionMet: (ifBlock: IfBlockNode, submissions
|
|
3
|
+
export declare const isIfBlockConditionMet: (ifBlock: IfBlockNode, { context, submissions }: {
|
|
4
|
+
submissions?: KeyToSubmissionMap;
|
|
5
|
+
context: Record<string, unknown>;
|
|
6
|
+
}) => boolean;
|