@inploi/plugin-chatbot 14.10.1 → 14.10.3
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 +5 -5
- package/dist/chatbot-body-4e7939a4.cjs +5 -0
- package/dist/{chatbot-body-d3fd468f.js → chatbot-body-cdaeae9e.js} +1737 -1473
- package/dist/chatbot.idb.d.ts +30 -1
- package/dist/{index-b8dab3ec.js → index-74999c44.js} +494 -482
- package/dist/index-beaf07e9.cjs +5 -0
- package/dist/md.test.d.ts +1 -0
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/package.json +2 -2
- package/dist/chatbot-body-b3e7212a.cjs +0 -5
- package/dist/index-4aad840b.cjs +0 -5
package/dist/chatbot.idb.d.ts
CHANGED
|
@@ -1,7 +1,34 @@
|
|
|
1
|
-
import { ApplicationRecovery, ChatInput, ChatMessage, KeyToSubmissionMap, SubmitCooldown } from '@inploi/flows/engine';
|
|
1
|
+
import { ApplicationRecovery, ChatInput, ChatMessage, KeyToSubmissionMap, SubmitCooldown, SubmitRedirect } from '@inploi/flows/engine';
|
|
2
|
+
import { DBSchema } from 'idb';
|
|
2
3
|
import { Flow } from './chatbot.api';
|
|
3
4
|
import { StartedFlow } from './chatbot.state';
|
|
4
5
|
|
|
6
|
+
interface ChatbotDb extends DBSchema {
|
|
7
|
+
state: {
|
|
8
|
+
key: string;
|
|
9
|
+
value: {
|
|
10
|
+
currentInput: ChatInput | null;
|
|
11
|
+
nodeHistory: string[];
|
|
12
|
+
startedWriteNodeIds?: string[];
|
|
13
|
+
failedAttemptAt?: Record<string, number>;
|
|
14
|
+
unconfirmedAttemptKeys?: string[];
|
|
15
|
+
submitCooldown?: SubmitCooldown;
|
|
16
|
+
submitRedirects?: Record<string, SubmitRedirect>;
|
|
17
|
+
applicationRecovery?: ApplicationRecovery;
|
|
18
|
+
flowSessionId: string;
|
|
19
|
+
isFinished: boolean;
|
|
20
|
+
hasInteracted?: boolean;
|
|
21
|
+
messages: (ChatMessage & {
|
|
22
|
+
groupId?: string;
|
|
23
|
+
})[];
|
|
24
|
+
sequence: number;
|
|
25
|
+
submissions: KeyToSubmissionMap;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
type StoredState = ChatbotDb['state']['value'];
|
|
30
|
+
/** IndexedDB stores a structured clone, so drop a link's click handler (FLOW_REDIRECT analytics): a function cannot be cloned. */
|
|
31
|
+
export declare const toStorable: (data: StoredState) => StoredState;
|
|
5
32
|
export declare const idb: {
|
|
6
33
|
getStateData: (flow: Flow, flowKeys: string[], context: Record<string, unknown>) => Promise<{
|
|
7
34
|
currentInput: ChatInput | null;
|
|
@@ -10,6 +37,7 @@ export declare const idb: {
|
|
|
10
37
|
failedAttemptAt?: Record<string, number>;
|
|
11
38
|
unconfirmedAttemptKeys?: string[];
|
|
12
39
|
submitCooldown?: SubmitCooldown;
|
|
40
|
+
submitRedirects?: Record<string, SubmitRedirect>;
|
|
13
41
|
applicationRecovery?: ApplicationRecovery;
|
|
14
42
|
flowSessionId: string;
|
|
15
43
|
isFinished: boolean;
|
|
@@ -23,3 +51,4 @@ export declare const idb: {
|
|
|
23
51
|
setStateData: (params: StartedFlow) => void;
|
|
24
52
|
flushStateData: () => Promise<unknown>;
|
|
25
53
|
};
|
|
54
|
+
export {};
|