@inploi/plugin-chatbot 3.2.4 → 3.2.6
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 +1 -1
- package/dist/chatbot.api.d.ts +30 -0
- package/dist/chatbot.constants.d.ts +8 -0
- package/dist/chatbot.d.ts +1 -0
- package/dist/chatbot.idb.d.ts +9 -0
- package/dist/chatbot.state.d.ts +90 -0
- package/dist/chatbot.utils.d.ts +160 -0
- package/dist/index-4a06c2aa.cjs +7904 -0
- package/dist/index-ba66a5e9.js +7905 -0
- package/dist/index.cdn.d.ts +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.dev.d.ts +6 -0
- package/dist/interpreter.d.ts +45 -0
- package/dist/interpreter.test.d.ts +1 -0
- package/dist/job-application-content-082cba34.js +2912 -0
- package/dist/job-application-content-bbb02124.cjs +2912 -0
- package/dist/plugin-chatbot.cjs +6 -0
- package/dist/plugin-chatbot.js +6 -0
- package/package.json +10 -7
- package/cdn/mockServiceWorker.js +0 -287
- package/dist/chatbot.js +0 -5928
- package/dist/index.js +0 -5
- package/dist/job-application-content.js +0 -2223
- package/dist/mockServiceWorker.js +0 -287
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { chatbotPlugin } from './chatbot';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { FlowNode } from '@inploi/core/flows';
|
|
2
|
+
import { AnalyticsService, ApiClient, Logger } from '@inploi/sdk';
|
|
3
|
+
import { ChatInput } from './ui/chat-input/chat-input';
|
|
4
|
+
import { ApplicationSubmission, ChatMessage, KeyToSubmissionMap } from './chatbot.state';
|
|
5
|
+
export declare const followNodes: ({ node, nodes, stopWhen, }: {
|
|
6
|
+
node: FlowNode;
|
|
7
|
+
nodes: FlowNode[];
|
|
8
|
+
stopWhen?: ((node: FlowNode) => boolean) | undefined;
|
|
9
|
+
}) => FlowNode | undefined;
|
|
10
|
+
export type ChatServiceSendParams = {
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
groupId?: string;
|
|
13
|
+
message: ChatMessage;
|
|
14
|
+
};
|
|
15
|
+
export type ChatService = {
|
|
16
|
+
send: (params: ChatServiceSendParams) => Promise<void>;
|
|
17
|
+
input: <TType extends ChatInput['type']>(params: {
|
|
18
|
+
input: Extract<ChatInput, {
|
|
19
|
+
type: TType;
|
|
20
|
+
}>;
|
|
21
|
+
signal?: AbortSignal;
|
|
22
|
+
}) => Promise<Extract<ApplicationSubmission, {
|
|
23
|
+
type: TType;
|
|
24
|
+
}>>;
|
|
25
|
+
};
|
|
26
|
+
type ChatbotInterpreterParams = {
|
|
27
|
+
apiClient: ApiClient;
|
|
28
|
+
analytics: AnalyticsService;
|
|
29
|
+
logger: Logger;
|
|
30
|
+
context: Record<string, unknown>;
|
|
31
|
+
flow: FlowNode[];
|
|
32
|
+
getSubmissions: () => KeyToSubmissionMap | undefined;
|
|
33
|
+
chatService: ChatService;
|
|
34
|
+
/** When interpreter starts */
|
|
35
|
+
beforeStart?: (firstNode: FlowNode) => Promise<void>;
|
|
36
|
+
/** When flow has no more nodes to interpret */
|
|
37
|
+
onFlowEnd?: (lastNode: FlowNode) => void;
|
|
38
|
+
/** When node is interpreted */
|
|
39
|
+
onInterpret?: (node: FlowNode, prevNode?: FlowNode) => void;
|
|
40
|
+
};
|
|
41
|
+
export declare const createFlowInterpreter: ({ flow, analytics, logger, context, apiClient, getSubmissions, chatService, onFlowEnd, onInterpret, }: ChatbotInterpreterParams) => {
|
|
42
|
+
interpret: (startFromNodeId?: string) => Promise<void>;
|
|
43
|
+
abort: () => void;
|
|
44
|
+
};
|
|
45
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|