@inploi/plugin-chatbot 3.11.0 → 3.12.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 +12 -12
- package/dist/{job-application-content-3cc77e28.js → chatbot-body-04c70e40.js} +341 -265
- package/dist/{job-application-content-69860abf.cjs → chatbot-body-a6d50df4.cjs} +352 -276
- package/dist/chatbot.api.d.ts +2441 -13
- package/dist/chatbot.d.ts +25 -5
- package/dist/chatbot.idb.d.ts +15 -7
- package/dist/chatbot.utils.d.ts +9 -6
- package/dist/{index-356e7fb6.cjs → index-413f4efe.cjs} +2175 -1999
- package/dist/{index-5333c591.js → index-ec980c39.js} +2194 -2018
- package/dist/index.dev.d.ts +1 -0
- package/dist/interpreter.d.ts +5 -2
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +2 -2
- package/package.json +8 -6
- package/dist/chatbot.state.d.ts +0 -94
package/dist/chatbot.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Flow } from './chatbot.api';
|
|
1
2
|
import { ChatbotDomManager } from './chatbot.dom';
|
|
2
3
|
type RemoveInternal<T extends object> = {
|
|
3
4
|
[P in keyof T as string extends P ? never : P extends `_${string}` ? never : P]: T[P];
|
|
@@ -5,6 +6,18 @@ type RemoveInternal<T extends object> = {
|
|
|
5
6
|
export type ChatbotPlugin = typeof chatbotPlugin;
|
|
6
7
|
export type ChatbotPluginParams = RemoveInternal<Parameters<ChatbotPlugin>[0]>;
|
|
7
8
|
export type Chatbot = ReturnType<ReturnType<ChatbotPlugin>>;
|
|
9
|
+
export type OpenChatbotParams = {
|
|
10
|
+
flow: Flow;
|
|
11
|
+
/** Specify the cache keys for restoring this flow from local state.
|
|
12
|
+
* This will be appended to the flow id and version passed to `flow` property.
|
|
13
|
+
* @example [job.id] if you want the flows to be unique per job.
|
|
14
|
+
*/
|
|
15
|
+
flowKeys: string[];
|
|
16
|
+
/** Context to be forwarded to analytics or used by nodes internally. */
|
|
17
|
+
context: Record<string, unknown>;
|
|
18
|
+
/** Title to display in the status bar */
|
|
19
|
+
title: string;
|
|
20
|
+
};
|
|
8
21
|
export declare const chatbotPlugin: ({ _internal_domManager: dom, theme, }: {
|
|
9
22
|
theme: {
|
|
10
23
|
/** Rotation for the hue. Between 0 and 360. */
|
|
@@ -22,11 +35,18 @@ export declare const chatbotPlugin: ({ _internal_domManager: dom, theme, }: {
|
|
|
22
35
|
logger: import("@inploi/sdk").Logger;
|
|
23
36
|
analytics: import("@inploi/sdk").AnalyticsService;
|
|
24
37
|
}) => {
|
|
25
|
-
/** Optionally eagerly renders the interface ahead of
|
|
38
|
+
/** Optionally eagerly renders the interface ahead of needing the chatbot. */
|
|
26
39
|
prepare: () => Promise<void>;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
40
|
+
/** Fetches a flow by job ID.
|
|
41
|
+
* @param jobId - The job ID to fetch the flow for. This is the job ID according to the **ATS**, and not the inploi job ID.
|
|
42
|
+
*/
|
|
43
|
+
fetchFlowByJobId: (jobId: string) => Promise<OpenChatbotParams>;
|
|
44
|
+
fetchFlowById: (flowId: string) => Promise<OpenChatbotParams>;
|
|
45
|
+
open: (params: OpenChatbotParams | Promise<OpenChatbotParams>) => Promise<void>;
|
|
46
|
+
/** @deprecated - Please use `open` instead. */
|
|
47
|
+
startApplication: never;
|
|
48
|
+
/** @deprecated - Please use `close` instead */
|
|
49
|
+
closeApplication: never;
|
|
50
|
+
close: () => Promise<void>;
|
|
31
51
|
};
|
|
32
52
|
export {};
|
package/dist/chatbot.idb.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Flow } from './chatbot.api';
|
|
2
|
+
import { ChatMessage, KeyToSubmissionMap, StartedFlow } from './chatbot.state';
|
|
3
|
+
import { ChatInput } from './components/chat-input/chat-input';
|
|
3
4
|
export declare const idb: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
getStateData: (flow: Flow, flowKeys: string[]) => Promise<{
|
|
6
|
+
currentInput: ChatInput | null;
|
|
7
|
+
nodeHistory: string[];
|
|
8
|
+
flowSessionId: string;
|
|
9
|
+
isFinished: boolean;
|
|
10
|
+
messages: (ChatMessage & {
|
|
11
|
+
groupId?: string;
|
|
12
|
+
})[];
|
|
13
|
+
sequence: number;
|
|
14
|
+
submissions: KeyToSubmissionMap;
|
|
15
|
+
} | undefined>;
|
|
16
|
+
setStateData: (params: StartedFlow) => Promise<string | undefined>;
|
|
9
17
|
};
|
package/dist/chatbot.utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FlowNode } from '@inploi/core/flows';
|
|
2
|
-
import {
|
|
2
|
+
import { FlowSubmission, KeyToSubmissionMap } from './chatbot.state';
|
|
3
3
|
export type DistributivePick<T, K extends keyof T> = T extends unknown ? Pick<T, K> : never;
|
|
4
4
|
export declare const kbToReadableSize: (kb: number) => string;
|
|
5
5
|
export declare const getHeadOrThrow: (nodes: FlowNode[]) => {
|
|
@@ -159,17 +159,20 @@ export declare const getHeadOrThrow: (nodes: FlowNode[]) => {
|
|
|
159
159
|
isHead?: boolean | undefined;
|
|
160
160
|
nextId?: string | undefined;
|
|
161
161
|
};
|
|
162
|
-
export declare const
|
|
163
|
-
export declare const isSubmissionOfType: <T extends "boolean" | "text" | "multiple-choice" | "file">(type: T) => (submission?:
|
|
162
|
+
export declare const getFlowSubmissionsPayload: (submissions: KeyToSubmissionMap) => Record<string, string | string[] | import("./components/chat-input/chat-input.file").FileToUpload[] | null>;
|
|
163
|
+
export declare const isSubmissionOfType: <T extends "boolean" | "text" | "multiple-choice" | "file" | "submit">(type: T) => (submission?: FlowSubmission) => submission is Extract<Pick<import("./components/chat-input/chat-input.text").TextPayload, "type" | "value">, {
|
|
164
164
|
type: T;
|
|
165
|
-
}> | Extract<Pick<import("./components/chat-input/chat-input.multiple-choice").MultipleChoicePayload, "
|
|
165
|
+
}> | Extract<Pick<import("./components/chat-input/chat-input.multiple-choice").MultipleChoicePayload, "type" | "value">, {
|
|
166
166
|
type: T;
|
|
167
|
-
}> | Extract<Pick<import("./components/chat-input/chat-input.boolean").BooleanChoicePayload, "
|
|
167
|
+
}> | Extract<Pick<import("./components/chat-input/chat-input.boolean").BooleanChoicePayload, "type" | "value">, {
|
|
168
168
|
type: T;
|
|
169
|
-
}> | Extract<Pick<import("./components/chat-input/chat-input.file").FilePayload, "
|
|
169
|
+
}> | Extract<Pick<import("./components/chat-input/chat-input.file").FilePayload, "type" | "value">, {
|
|
170
|
+
type: T;
|
|
171
|
+
}> | Extract<Pick<import("./components/chat-input/chat-input.submit").SubmitPayload, "type" | "value">, {
|
|
170
172
|
type: T;
|
|
171
173
|
}>;
|
|
172
174
|
export declare function gzip(string: string): string | Promise<string>;
|
|
173
175
|
export declare class AbortedError extends Error {
|
|
174
176
|
constructor();
|
|
175
177
|
}
|
|
178
|
+
export declare function debounce<TFn extends (...params: any[]) => void>(func: TFn, timeout?: number): TFn;
|