@botonic/plugin-flow-builder
Version:
Use Flow Builder to show your contents
45 lines (44 loc) • 2.36 kB
TypeScript
import { Plugin, PluginPreRequest, ResolvedPlugins, Session } from '@botonic/core';
import { FlowBuilderApi } from './api';
import { FlowContent } from './content-fields';
import { HtNodeWithContent } from './content-fields/hubtype-fields';
import { AiAgentFunction, BotonicPluginFlowBuilderOptions, ContentFilter, FlowBuilderJSONVersion, InShadowingConfig, KnowledgeBaseFunction, PayloadParamsBase, RatingSubmittedInfo, TrackEventFunction } from './types';
import { SmartIntentsInferenceConfig } from './user-input/smart-intent';
export default class BotonicPluginFlowBuilder implements Plugin {
cmsApi: FlowBuilderApi;
private flow?;
private functions;
private currentRequest;
getAccessToken: (session: Session) => string;
trackEvent?: TrackEventFunction;
getKnowledgeBaseResponse?: KnowledgeBaseFunction;
getAiAgentResponse?: AiAgentFunction;
smartIntentsConfig: SmartIntentsInferenceConfig;
inShadowing: InShadowingConfig;
contentFilters: ContentFilter[];
jsonVersion: FlowBuilderJSONVersion;
apiUrl: string;
customRatingMessageEnabled: boolean;
constructor(options: BotonicPluginFlowBuilderOptions<ResolvedPlugins, any>);
resolveFlowUrl(request: PluginPreRequest): string;
pre(request: PluginPreRequest): Promise<void>;
private convertWhatsappAiAgentEmptyPayloads;
private updateRequestBeforeRoutes;
private removeSourceSuffix;
post(request: PluginPreRequest): void;
getContentsByContentID(contentID: string, prevContents?: FlowContent[]): Promise<FlowContent[]>;
getUUIDByContentID(contentID: string): string;
private getContentsById;
getStartContents(): Promise<FlowContent[]>;
getContentsByNode(node: HtNodeWithContent, prevContents?: FlowContent[]): Promise<FlowContent[]>;
getPayloadParams<T extends PayloadParamsBase>(payload: string): T;
getFlowName(flowId: string): string;
getRatingSubmittedInfo(payload: string): RatingSubmittedInfo;
}
export * from './action';
export { AGENT_RATING_PAYLOAD } from './constants';
export * from './content-fields';
export { HtBotActionNode } from './content-fields/hubtype-fields';
export { trackFlowContent } from './tracking';
export { BotonicPluginFlowBuilderOptions, ContentFilter, FlowBuilderJSONVersion, PayloadParamsBase, RatingSubmittedInfo, } from './types';
export * from './webview';