@botonic/plugin-flow-builder 0.29.0 → 0.30.0-alpha.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/lib/cjs/action/first-interaction.js +0 -4
- package/lib/cjs/action/first-interaction.js.map +1 -1
- package/lib/cjs/action/index.d.ts +2 -1
- package/lib/cjs/action/index.js +10 -4
- package/lib/cjs/action/index.js.map +1 -1
- package/lib/cjs/action/payload.d.ts +1 -1
- package/lib/cjs/action/payload.js +6 -4
- package/lib/cjs/action/payload.js.map +1 -1
- package/lib/cjs/api.js +0 -3
- package/lib/cjs/api.js.map +1 -1
- package/lib/cjs/content-fields/flow-bot-action.d.ts +11 -0
- package/lib/cjs/content-fields/flow-bot-action.js +22 -0
- package/lib/cjs/content-fields/flow-bot-action.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/bot-action.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/node-types.d.ts +3 -3
- package/lib/cjs/content-fields/hubtype-fields/node-types.js +1 -1
- package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +1 -1
- package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +2 -2
- package/lib/cjs/content-fields/index.d.ts +3 -2
- package/lib/cjs/content-fields/index.js +3 -1
- package/lib/cjs/content-fields/index.js.map +1 -1
- package/lib/cjs/index.d.ts +0 -2
- package/lib/cjs/index.js +6 -8
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/action/first-interaction.js +1 -5
- package/lib/esm/action/first-interaction.js.map +1 -1
- package/lib/esm/action/index.d.ts +2 -1
- package/lib/esm/action/index.js +10 -4
- package/lib/esm/action/index.js.map +1 -1
- package/lib/esm/action/payload.d.ts +1 -1
- package/lib/esm/action/payload.js +6 -4
- package/lib/esm/action/payload.js.map +1 -1
- package/lib/esm/api.js +1 -4
- package/lib/esm/api.js.map +1 -1
- package/lib/esm/content-fields/flow-bot-action.d.ts +11 -0
- package/lib/esm/content-fields/flow-bot-action.js +18 -0
- package/lib/esm/content-fields/flow-bot-action.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/bot-action.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +3 -3
- package/lib/esm/content-fields/hubtype-fields/node-types.js +1 -1
- package/lib/esm/content-fields/hubtype-fields/node-types.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +2 -2
- package/lib/esm/content-fields/index.d.ts +3 -2
- package/lib/esm/content-fields/index.js +2 -1
- package/lib/esm/content-fields/index.js.map +1 -1
- package/lib/esm/index.d.ts +0 -2
- package/lib/esm/index.js +8 -10
- package/lib/esm/index.js.map +1 -1
- package/package.json +2 -2
- package/src/action/first-interaction.ts +1 -7
- package/src/action/index.tsx +19 -4
- package/src/action/payload.ts +5 -3
- package/src/api.ts +1 -9
- package/src/content-fields/flow-bot-action.tsx +31 -0
- package/src/content-fields/hubtype-fields/bot-action.ts +2 -2
- package/src/content-fields/hubtype-fields/node-types.ts +1 -1
- package/src/content-fields/hubtype-fields/nodes.ts +2 -5
- package/src/content-fields/index.ts +3 -0
- package/src/index.ts +11 -16
package/lib/esm/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,EAUL,qBAAqB,EACrB,wBAAwB,GAEzB,MAAM,iCAAiC,CAAA;AAIxC,MAAM,OAAO,cAAc;IAKzB,gBAAuB,CAAC;IAExB,MAAM,CAAO,MAAM,CAAC,OAA8B;;;YAChD,MAAM,MAAM,GAAG,IAAI,cAAc,EAA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AAK,MAAM,CAAC,EAAE;YAC/D,OAAO,MAAM,CAAA;SACd;QACD,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;QACrC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,KAAK,QAAQ,CAAC,EAAE;YACjE,OAAO,CAAC,GAAG,CAAC,WAAW,MAAM,yBAAyB,QAAQ,EAAE,CAAC,CAAA;YACjE,OAAO,QAAQ,CAAA;SAChB;QACD,MAAM,IAAI,KAAK,CACb,WAAW,MAAM,2BAA2B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAChE,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ActionRequest } from '@botonic/react';
|
|
2
|
+
import { FlowBuilderApi } from '../api';
|
|
3
|
+
import { ContentFieldsBase } from './content-fields-base';
|
|
4
|
+
import { HtBotActionNode } from './hubtype-fields';
|
|
5
|
+
export declare class FlowBotAction extends ContentFieldsBase {
|
|
6
|
+
code: string;
|
|
7
|
+
payload: string;
|
|
8
|
+
static fromHubtypeCMS(cmsBotAction: HtBotActionNode, _locale: string, cmsApi: FlowBuilderApi): FlowBotAction;
|
|
9
|
+
doBotAction(request: ActionRequest): void;
|
|
10
|
+
toBotonic(): JSX.Element;
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { BotonicAction } from '@botonic/core';
|
|
3
|
+
import { ContentFieldsBase } from './content-fields-base';
|
|
4
|
+
export class FlowBotAction extends ContentFieldsBase {
|
|
5
|
+
static fromHubtypeCMS(cmsBotAction, _locale, cmsApi) {
|
|
6
|
+
const newBotAction = new FlowBotAction(cmsBotAction.id);
|
|
7
|
+
newBotAction.code = cmsBotAction.code;
|
|
8
|
+
newBotAction.payload = cmsApi.createPayloadWithParams(cmsBotAction);
|
|
9
|
+
return newBotAction;
|
|
10
|
+
}
|
|
11
|
+
doBotAction(request) {
|
|
12
|
+
request.session._botonic_action = `${BotonicAction.Redirect}:${this.payload}`;
|
|
13
|
+
}
|
|
14
|
+
toBotonic() {
|
|
15
|
+
return _jsx(_Fragment, {});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=flow-bot-action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-bot-action.js","sourceRoot":"","sources":["../../../src/content-fields/flow-bot-action.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAI7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAGzD,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAIlD,MAAM,CAAC,cAAc,CACnB,YAA6B,EAC7B,OAAe,EACf,MAAsB;QAEtB,MAAM,YAAY,GAAG,IAAI,aAAa,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;QACvD,YAAY,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAA;QACrC,YAAY,CAAC,OAAO,GAAG,MAAM,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAA;QAEnE,OAAO,YAAY,CAAA;IACrB,CAAC;IAED,WAAW,CAAC,OAAsB;QAChC,OAAO,CAAC,OAAO,CAAC,eAAe,GAAG,GAAG,aAAa,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE,CAAA;IAC/E,CAAC;IAED,SAAS;QACP,OAAO,mBAAK,CAAA;IACd,CAAC;CACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { HtBaseNode } from './common';
|
|
2
|
-
import {
|
|
2
|
+
import { HtNodeWithContentType } from './node-types';
|
|
3
3
|
export interface HtBotActionNode extends HtBaseNode {
|
|
4
4
|
id: string;
|
|
5
|
-
type:
|
|
5
|
+
type: HtNodeWithContentType.BOT_ACTION;
|
|
6
6
|
content: {
|
|
7
7
|
payload_id: string;
|
|
8
8
|
payload_params?: string;
|
|
@@ -11,13 +11,13 @@ export declare enum HtNodeWithContentType {
|
|
|
11
11
|
VIDEO = "video",
|
|
12
12
|
WHATSAPP_BUTTON_LIST = "whatsapp-button-list",
|
|
13
13
|
WHATSAPP_CTA_URL_BUTTON = "whatsapp-cta-url-button",
|
|
14
|
-
KNOWLEDGE_BASE = "knowledge-base"
|
|
14
|
+
KNOWLEDGE_BASE = "knowledge-base",
|
|
15
|
+
BOT_ACTION = "bot-action"
|
|
15
16
|
}
|
|
16
17
|
export declare enum HtNodeWithoutContentType {
|
|
17
18
|
URL = "url",
|
|
18
19
|
PAYLOAD = "payload",
|
|
19
|
-
GO_TO_FLOW = "go-to-flow"
|
|
20
|
-
BOT_ACTION = "bot-action"
|
|
20
|
+
GO_TO_FLOW = "go-to-flow"
|
|
21
21
|
}
|
|
22
22
|
export declare enum HtButtonStyle {
|
|
23
23
|
BUTTON = "button",
|
|
@@ -13,13 +13,13 @@ export var HtNodeWithContentType;
|
|
|
13
13
|
HtNodeWithContentType["WHATSAPP_BUTTON_LIST"] = "whatsapp-button-list";
|
|
14
14
|
HtNodeWithContentType["WHATSAPP_CTA_URL_BUTTON"] = "whatsapp-cta-url-button";
|
|
15
15
|
HtNodeWithContentType["KNOWLEDGE_BASE"] = "knowledge-base";
|
|
16
|
+
HtNodeWithContentType["BOT_ACTION"] = "bot-action";
|
|
16
17
|
})(HtNodeWithContentType || (HtNodeWithContentType = {}));
|
|
17
18
|
export var HtNodeWithoutContentType;
|
|
18
19
|
(function (HtNodeWithoutContentType) {
|
|
19
20
|
HtNodeWithoutContentType["URL"] = "url";
|
|
20
21
|
HtNodeWithoutContentType["PAYLOAD"] = "payload";
|
|
21
22
|
HtNodeWithoutContentType["GO_TO_FLOW"] = "go-to-flow";
|
|
22
|
-
HtNodeWithoutContentType["BOT_ACTION"] = "bot-action";
|
|
23
23
|
})(HtNodeWithoutContentType || (HtNodeWithoutContentType = {}));
|
|
24
24
|
export var HtButtonStyle;
|
|
25
25
|
(function (HtButtonStyle) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-types.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/node-types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"node-types.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/node-types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,qBAeX;AAfD,WAAY,qBAAqB;IAC/B,8CAAqB,CAAA;IACrB,4CAAmB,CAAA;IACnB,wCAAe,CAAA;IACf,sCAAa,CAAA;IACb,4CAAmB,CAAA;IACnB,0CAAiB,CAAA;IACjB,sDAA6B,CAAA;IAC7B,8CAAqB,CAAA;IACrB,8CAAqB,CAAA;IACrB,wCAAe,CAAA;IACf,sEAA6C,CAAA;IAC7C,4EAAmD,CAAA;IACnD,0DAAiC,CAAA;IACjC,kDAAyB,CAAA;AAC3B,CAAC,EAfW,qBAAqB,KAArB,qBAAqB,QAehC;AAED,MAAM,CAAN,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,uCAAW,CAAA;IACX,+CAAmB,CAAA;IACnB,qDAAyB,CAAA;AAC3B,CAAC,EAJW,wBAAwB,KAAxB,wBAAwB,QAInC;AAED,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,kCAAiB,CAAA;IACjB,4CAA2B,CAAA;AAC7B,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB"}
|
|
@@ -15,6 +15,6 @@ import { HtUrlNode } from './url';
|
|
|
15
15
|
import { HtVideoNode } from './video';
|
|
16
16
|
import { HtWhatsappButtonListNode } from './whatsapp-button-list';
|
|
17
17
|
import { HtWhatsappCTAUrlButtonNode } from './whatsapp-cta-url-button';
|
|
18
|
-
export type HtNodeWithContent = HtTextNode | HtImageNode | HtVideoNode | HtCarouselNode | HtHandoffNode | HtKeywordNode | HtIntentNode | HtFunctionNode | HtFallbackNode | HtWhatsappButtonListNode | HtWhatsappCTAUrlButtonNode | HtSmartIntentNode | HtKnowledgeBaseNode;
|
|
19
|
-
export type HtNodeWithoutContent = HtUrlNode | HtPayloadNode | HtGoToFlow
|
|
18
|
+
export type HtNodeWithContent = HtTextNode | HtImageNode | HtVideoNode | HtCarouselNode | HtHandoffNode | HtKeywordNode | HtIntentNode | HtFunctionNode | HtFallbackNode | HtWhatsappButtonListNode | HtWhatsappCTAUrlButtonNode | HtSmartIntentNode | HtKnowledgeBaseNode | HtBotActionNode;
|
|
19
|
+
export type HtNodeWithoutContent = HtUrlNode | HtPayloadNode | HtGoToFlow;
|
|
20
20
|
export type HtNodeComponent = HtNodeWithContent | HtNodeWithoutContent;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FlowBotAction } from './flow-bot-action';
|
|
1
2
|
import { FlowCarousel } from './flow-carousel';
|
|
2
3
|
import { FlowHandoff } from './flow-handoff';
|
|
3
4
|
import { FlowImage } from './flow-image';
|
|
@@ -9,7 +10,7 @@ import { FlowWhatsappButtonList } from './whatsapp-button-list/flow-whatsapp-but
|
|
|
9
10
|
export { ContentFieldsBase } from './content-fields-base';
|
|
10
11
|
export { FlowButton } from './flow-button';
|
|
11
12
|
export { FlowElement } from './flow-element';
|
|
12
|
-
export { FlowCarousel, FlowImage, FlowKnowledgeBase, FlowText, FlowVideo, FlowWhatsappButtonList, };
|
|
13
|
+
export { FlowBotAction, FlowCarousel, FlowImage, FlowKnowledgeBase, FlowText, FlowVideo, FlowWhatsappButtonList, };
|
|
13
14
|
export { FlowHandoff } from './flow-handoff';
|
|
14
15
|
export { FlowWhatsappCtaUrlButtonNode } from './flow-whatsapp-cta-url-button';
|
|
15
|
-
export type FlowContent = FlowCarousel | FlowImage | FlowText | FlowVideo | FlowWhatsappButtonList | FlowWhatsappCtaUrlButtonNode | FlowHandoff | FlowKnowledgeBase;
|
|
16
|
+
export type FlowContent = FlowCarousel | FlowImage | FlowText | FlowVideo | FlowWhatsappButtonList | FlowWhatsappCtaUrlButtonNode | FlowHandoff | FlowKnowledgeBase | FlowBotAction;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FlowBotAction } from './flow-bot-action';
|
|
1
2
|
import { FlowCarousel } from './flow-carousel';
|
|
2
3
|
import { FlowImage } from './flow-image';
|
|
3
4
|
import { FlowKnowledgeBase } from './flow-knowledge-base';
|
|
@@ -7,7 +8,7 @@ import { FlowWhatsappButtonList } from './whatsapp-button-list/flow-whatsapp-but
|
|
|
7
8
|
export { ContentFieldsBase } from './content-fields-base';
|
|
8
9
|
export { FlowButton } from './flow-button';
|
|
9
10
|
export { FlowElement } from './flow-element';
|
|
10
|
-
export { FlowCarousel, FlowImage, FlowKnowledgeBase, FlowText, FlowVideo, FlowWhatsappButtonList, };
|
|
11
|
+
export { FlowBotAction, FlowCarousel, FlowImage, FlowKnowledgeBase, FlowText, FlowVideo, FlowWhatsappButtonList, };
|
|
11
12
|
export { FlowHandoff } from './flow-handoff';
|
|
12
13
|
export { FlowWhatsappCtaUrlButtonNode } from './flow-whatsapp-cta-url-button';
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content-fields/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAA;AAEzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EACL,YAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,sBAAsB,GACvB,CAAA;AACD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content-fields/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAA;AAEzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EACL,aAAa,EACb,YAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,sBAAsB,GACvB,CAAA;AACD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA"}
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { SmartIntentsInferenceConfig } from './user-input/smart-intent';
|
|
|
7
7
|
export default class BotonicPluginFlowBuilder implements Plugin {
|
|
8
8
|
readonly options: BotonicPluginFlowBuilderOptions;
|
|
9
9
|
cmsApi: FlowBuilderApi;
|
|
10
|
-
private flowUrl;
|
|
11
10
|
private flow?;
|
|
12
11
|
private functions;
|
|
13
12
|
private currentRequest;
|
|
@@ -23,7 +22,6 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
23
22
|
pre(request: PluginPreRequest): Promise<void>;
|
|
24
23
|
private updateRequestBeforeRoutes;
|
|
25
24
|
private removeSourceSufix;
|
|
26
|
-
replaceBotActionPayload(payload: string): string;
|
|
27
25
|
getContentsByContentID(contentID: string, locale: string, prevContents?: FlowContent[]): Promise<FlowContent[]>;
|
|
28
26
|
getUUIDByContentID(contentID: string): string;
|
|
29
27
|
private getContentsById;
|
package/lib/esm/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import { v4 as uuid } from 'uuid';
|
|
3
3
|
import { FlowBuilderApi } from './api';
|
|
4
|
-
import {
|
|
5
|
-
import { FlowCarousel, FlowHandoff, FlowImage, FlowKnowledgeBase, FlowText, FlowVideo, FlowWhatsappButtonList, FlowWhatsappCtaUrlButtonNode, } from './content-fields';
|
|
4
|
+
import { FLOW_BUILDER_API_URL_PROD, SEPARATOR, SOURCE_INFO_SEPARATOR, } from './constants';
|
|
5
|
+
import { FlowBotAction, FlowCarousel, FlowHandoff, FlowImage, FlowKnowledgeBase, FlowText, FlowVideo, FlowWhatsappButtonList, FlowWhatsappCtaUrlButtonNode, } from './content-fields';
|
|
6
6
|
import { HtNodeWithContentType, } from './content-fields/hubtype-fields';
|
|
7
7
|
import { DEFAULT_FUNCTIONS } from './functions';
|
|
8
8
|
import { FlowBuilderJSONVersion, } from './types';
|
|
@@ -52,19 +52,11 @@ export default class BotonicPluginFlowBuilder {
|
|
|
52
52
|
updateRequestBeforeRoutes(request) {
|
|
53
53
|
if (request.input.payload) {
|
|
54
54
|
request.input.payload = this.removeSourceSufix(request.input.payload);
|
|
55
|
-
if (request.input.payload.startsWith(BOT_ACTION_PAYLOAD_PREFIX)) {
|
|
56
|
-
request.input.payload = this.replaceBotActionPayload(request.input.payload);
|
|
57
|
-
}
|
|
58
55
|
}
|
|
59
56
|
}
|
|
60
57
|
removeSourceSufix(payload) {
|
|
61
58
|
return payload.split(SOURCE_INFO_SEPARATOR)[0];
|
|
62
59
|
}
|
|
63
|
-
replaceBotActionPayload(payload) {
|
|
64
|
-
const botActionId = payload.split(SEPARATOR)[1];
|
|
65
|
-
const botActionNode = this.cmsApi.getNodeById(botActionId);
|
|
66
|
-
return this.cmsApi.createPayloadWithParams(botActionNode);
|
|
67
|
-
}
|
|
68
60
|
getContentsByContentID(contentID, locale, prevContents) {
|
|
69
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
62
|
const node = this.cmsApi.getNodeByContentID(contentID);
|
|
@@ -101,6 +93,10 @@ export default class BotonicPluginFlowBuilder {
|
|
|
101
93
|
if (content) {
|
|
102
94
|
contents.push(content);
|
|
103
95
|
}
|
|
96
|
+
// If node is BOT_ACTION not add more contents to render, next nodes render after execute action
|
|
97
|
+
if (node.type === HtNodeWithContentType.BOT_ACTION) {
|
|
98
|
+
return contents;
|
|
99
|
+
}
|
|
104
100
|
// TODO: prevent infinite recursive calls
|
|
105
101
|
if (node.follow_up) {
|
|
106
102
|
return this.getContentsById(node.follow_up.id, resolvedLocale, contents);
|
|
@@ -126,6 +122,8 @@ export default class BotonicPluginFlowBuilder {
|
|
|
126
122
|
return FlowHandoff.fromHubtypeCMS(hubtypeContent, locale, this.cmsApi);
|
|
127
123
|
case HtNodeWithContentType.KNOWLEDGE_BASE:
|
|
128
124
|
return FlowKnowledgeBase.fromHubtypeCMS(hubtypeContent);
|
|
125
|
+
case HtNodeWithContentType.BOT_ACTION:
|
|
126
|
+
return FlowBotAction.fromHubtypeCMS(hubtypeContent, locale, this.cmsApi);
|
|
129
127
|
default:
|
|
130
128
|
return undefined;
|
|
131
129
|
}
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAA;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EACL,yBAAyB,EACzB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAA;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EACL,yBAAyB,EACzB,SAAS,EACT,qBAAqB,GACtB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,aAAa,EACb,YAAY,EAEZ,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAOL,qBAAqB,GACtB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAEL,sBAAsB,GAIvB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEjD,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACjE,MAAM,CAAC,OAAO,OAAO,wBAAwB;IAe3C,YAAqB,OAAwC;QAAxC,YAAO,GAAP,OAAO,CAAiC;QAC3D,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,yBAAyB,CAAA;QACzD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,sBAAsB,CAAC,MAAM,CAAA;QACvE,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;QACxB,IAA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ACD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,CAAA;QACzB,CAAC;KAAA;IAEO,oBAAoB,CAC1B,IAA2B,EAC3B,MAAc;QAEd,IAAI,eAAe,GAAyB,EAAE,CAAA;QAC9C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACtB,IAAI,QAAQ,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE;gBAC5C,eAAe,GAAG,CAAC,GAAG,eAAe,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAA;aACtD;YACD,IAAI,MAAM,IAAI,GAAG,EAAE;gBACjB,eAAe,GAAG,CAAC,GAAG,eAAe,EAAE,GAAG,CAAC,CAAA;aAC5C;SACF;QAED,OAAO,eAAe,CAAA;IACxB,CAAC;IAED,gBAAgB,CAA8B,OAAe;QAC3D,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAA;QACrE,OAAO,aAAa,CAAA;IACtB,CAAC;IAED,WAAW,CAAC,MAAc;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IACxC,CAAC;CACF;AAED,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AACvD,cAAc,kBAAkB,CAAA;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EAEL,sBAAsB,GAEvB,MAAM,SAAS,CAAA;AAChB,cAAc,WAAW,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botonic/plugin-flow-builder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0-alpha.0",
|
|
4
4
|
"main": "./lib/cjs/index.js",
|
|
5
5
|
"module": "./lib/esm/index.js",
|
|
6
6
|
"description": "Use Flow Builder to show your contents",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"lint_core": "../../node_modules/.bin/eslint_d --cache --quiet 'src/**/*.ts*'"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@botonic/react": "
|
|
17
|
+
"@botonic/react": "0.30.0-alpha.0",
|
|
18
18
|
"axios": "^1.7.2",
|
|
19
19
|
"uuid": "^9.0.1"
|
|
20
20
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FlowBuilderApi } from '../api'
|
|
2
|
-
import {
|
|
2
|
+
import { MAIN_FLOW_NAME } from '../constants'
|
|
3
3
|
import { FlowContent } from '../content-fields'
|
|
4
4
|
import BotonicPluginFlowBuilder from '../index'
|
|
5
5
|
import { getNodeByUserInput } from '../user-input'
|
|
@@ -51,12 +51,6 @@ async function getContentsByUserInput({
|
|
|
51
51
|
return []
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
if (request.input.payload?.startsWith(BOT_ACTION_PAYLOAD_PREFIX)) {
|
|
55
|
-
request.input.payload = flowBuilderPlugin.replaceBotActionPayload(
|
|
56
|
-
request.input.payload
|
|
57
|
-
)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
54
|
const contentsByKeywordsOrIntents = await getContentsByPayload({
|
|
61
55
|
cmsApi,
|
|
62
56
|
flowBuilderPlugin,
|
package/src/action/index.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import React from 'react'
|
|
|
3
3
|
|
|
4
4
|
import { FlowBuilderApi } from '../api'
|
|
5
5
|
import { FlowContent, FlowHandoff } from '../content-fields'
|
|
6
|
+
import { FlowBotAction } from '../content-fields/flow-bot-action'
|
|
6
7
|
import { getFlowBuilderPlugin } from '../helpers'
|
|
7
8
|
import BotonicPluginFlowBuilder from '../index'
|
|
8
9
|
import { trackFlowContent } from '../tracking'
|
|
@@ -20,9 +21,10 @@ export class FlowBuilderAction extends React.Component<FlowBuilderActionProps> {
|
|
|
20
21
|
static contextType = RequestContext
|
|
21
22
|
|
|
22
23
|
static async botonicInit(
|
|
23
|
-
request: ActionRequest
|
|
24
|
+
request: ActionRequest,
|
|
25
|
+
contentID?: string
|
|
24
26
|
): Promise<FlowBuilderActionProps> {
|
|
25
|
-
const contents = await getContents(request)
|
|
27
|
+
const contents = await getContents(request, contentID)
|
|
26
28
|
await trackFlowContent(request, contents)
|
|
27
29
|
|
|
28
30
|
const handoffContent = contents.find(
|
|
@@ -31,6 +33,14 @@ export class FlowBuilderAction extends React.Component<FlowBuilderActionProps> {
|
|
|
31
33
|
if (handoffContent) {
|
|
32
34
|
await handoffContent.doHandoff(request)
|
|
33
35
|
}
|
|
36
|
+
|
|
37
|
+
const botActionContent = contents.find(
|
|
38
|
+
content => content instanceof FlowBotAction
|
|
39
|
+
) as FlowBotAction
|
|
40
|
+
if (botActionContent) {
|
|
41
|
+
botActionContent.doBotAction(request)
|
|
42
|
+
}
|
|
43
|
+
|
|
34
44
|
return { contents }
|
|
35
45
|
}
|
|
36
46
|
|
|
@@ -53,7 +63,10 @@ export class FlowBuilderMultichannelAction extends FlowBuilderAction {
|
|
|
53
63
|
}
|
|
54
64
|
}
|
|
55
65
|
|
|
56
|
-
async function getContents(
|
|
66
|
+
async function getContents(
|
|
67
|
+
request: ActionRequest,
|
|
68
|
+
contentID?: string
|
|
69
|
+
): Promise<FlowContent[]> {
|
|
57
70
|
const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)
|
|
58
71
|
const cmsApi = flowBuilderPlugin.cmsApi
|
|
59
72
|
const locale = flowBuilderPlugin.getLocale(request.session)
|
|
@@ -63,13 +76,14 @@ async function getContents(request: ActionRequest): Promise<FlowContent[]> {
|
|
|
63
76
|
flowBuilderPlugin,
|
|
64
77
|
request,
|
|
65
78
|
resolvedLocale,
|
|
79
|
+
contentID,
|
|
66
80
|
}
|
|
67
81
|
|
|
68
82
|
if (request.session.is_first_interaction) {
|
|
69
83
|
return await getContentsByFirstInteraction(context)
|
|
70
84
|
}
|
|
71
85
|
|
|
72
|
-
if (request.input.payload) {
|
|
86
|
+
if (request.input.payload || contentID) {
|
|
73
87
|
return await getContentsByPayload(context)
|
|
74
88
|
}
|
|
75
89
|
|
|
@@ -88,4 +102,5 @@ export interface FlowBuilderContext {
|
|
|
88
102
|
flowBuilderPlugin: BotonicPluginFlowBuilder
|
|
89
103
|
request: ActionRequest
|
|
90
104
|
resolvedLocale: string
|
|
105
|
+
contentID?: string
|
|
91
106
|
}
|
package/src/action/payload.ts
CHANGED
|
@@ -7,10 +7,12 @@ export async function getContentsByPayload({
|
|
|
7
7
|
flowBuilderPlugin,
|
|
8
8
|
request,
|
|
9
9
|
resolvedLocale,
|
|
10
|
+
contentID,
|
|
10
11
|
}: FlowBuilderContext): Promise<FlowContent[]> {
|
|
11
|
-
const
|
|
12
|
-
? cmsApi.
|
|
13
|
-
:
|
|
12
|
+
const id = contentID
|
|
13
|
+
? cmsApi.getNodeByContentID(contentID)?.id
|
|
14
|
+
: request.input.payload
|
|
15
|
+
const targetNode = id ? cmsApi.getNodeById<HtNodeWithContent>(id) : undefined
|
|
14
16
|
|
|
15
17
|
if (targetNode) {
|
|
16
18
|
return await flowBuilderPlugin.getContentsByNode(targetNode, resolvedLocale)
|
package/src/api.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { Input, PluginPreRequest } from '@botonic/core'
|
|
2
2
|
import axios from 'axios'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
BOT_ACTION_PAYLOAD_PREFIX,
|
|
6
|
-
KNOWLEDGE_BASE_FLOW_NAME,
|
|
7
|
-
SEPARATOR,
|
|
8
|
-
} from './constants'
|
|
4
|
+
import { KNOWLEDGE_BASE_FLOW_NAME, SEPARATOR } from './constants'
|
|
9
5
|
import {
|
|
10
6
|
HtBotActionNode,
|
|
11
7
|
HtFallbackNode,
|
|
@@ -165,10 +161,6 @@ export class FlowBuilderApi {
|
|
|
165
161
|
return undefined
|
|
166
162
|
}
|
|
167
163
|
|
|
168
|
-
if (target.type === HtNodeWithoutContentType.BOT_ACTION) {
|
|
169
|
-
return `${BOT_ACTION_PAYLOAD_PREFIX}${target.id}`
|
|
170
|
-
}
|
|
171
|
-
|
|
172
164
|
return target.id
|
|
173
165
|
}
|
|
174
166
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BotonicAction } from '@botonic/core'
|
|
2
|
+
import { ActionRequest } from '@botonic/react'
|
|
3
|
+
|
|
4
|
+
import { FlowBuilderApi } from '../api'
|
|
5
|
+
import { ContentFieldsBase } from './content-fields-base'
|
|
6
|
+
import { HtBotActionNode } from './hubtype-fields'
|
|
7
|
+
|
|
8
|
+
export class FlowBotAction extends ContentFieldsBase {
|
|
9
|
+
public code: string
|
|
10
|
+
public payload: string
|
|
11
|
+
|
|
12
|
+
static fromHubtypeCMS(
|
|
13
|
+
cmsBotAction: HtBotActionNode,
|
|
14
|
+
_locale: string,
|
|
15
|
+
cmsApi: FlowBuilderApi
|
|
16
|
+
): FlowBotAction {
|
|
17
|
+
const newBotAction = new FlowBotAction(cmsBotAction.id)
|
|
18
|
+
newBotAction.code = cmsBotAction.code
|
|
19
|
+
newBotAction.payload = cmsApi.createPayloadWithParams(cmsBotAction)
|
|
20
|
+
|
|
21
|
+
return newBotAction
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
doBotAction(request: ActionRequest): void {
|
|
25
|
+
request.session._botonic_action = `${BotonicAction.Redirect}:${this.payload}`
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
toBotonic(): JSX.Element {
|
|
29
|
+
return <></>
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { HtBaseNode } from './common'
|
|
2
|
-
import {
|
|
2
|
+
import { HtNodeWithContentType } from './node-types'
|
|
3
3
|
|
|
4
4
|
export interface HtBotActionNode extends HtBaseNode {
|
|
5
5
|
id: string
|
|
6
|
-
type:
|
|
6
|
+
type: HtNodeWithContentType.BOT_ACTION
|
|
7
7
|
content: {
|
|
8
8
|
payload_id: string
|
|
9
9
|
payload_params?: string
|
|
@@ -12,13 +12,13 @@ export enum HtNodeWithContentType {
|
|
|
12
12
|
WHATSAPP_BUTTON_LIST = 'whatsapp-button-list',
|
|
13
13
|
WHATSAPP_CTA_URL_BUTTON = 'whatsapp-cta-url-button',
|
|
14
14
|
KNOWLEDGE_BASE = 'knowledge-base',
|
|
15
|
+
BOT_ACTION = 'bot-action',
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export enum HtNodeWithoutContentType {
|
|
18
19
|
URL = 'url',
|
|
19
20
|
PAYLOAD = 'payload',
|
|
20
21
|
GO_TO_FLOW = 'go-to-flow',
|
|
21
|
-
BOT_ACTION = 'bot-action',
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export enum HtButtonStyle {
|
|
@@ -30,11 +30,8 @@ export type HtNodeWithContent =
|
|
|
30
30
|
| HtWhatsappCTAUrlButtonNode
|
|
31
31
|
| HtSmartIntentNode
|
|
32
32
|
| HtKnowledgeBaseNode
|
|
33
|
-
|
|
34
|
-
export type HtNodeWithoutContent =
|
|
35
|
-
| HtUrlNode
|
|
36
|
-
| HtPayloadNode
|
|
37
|
-
| HtGoToFlow
|
|
38
33
|
| HtBotActionNode
|
|
39
34
|
|
|
35
|
+
export type HtNodeWithoutContent = HtUrlNode | HtPayloadNode | HtGoToFlow
|
|
36
|
+
|
|
40
37
|
export type HtNodeComponent = HtNodeWithContent | HtNodeWithoutContent
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FlowBotAction } from './flow-bot-action'
|
|
1
2
|
import { FlowCarousel } from './flow-carousel'
|
|
2
3
|
import { FlowHandoff } from './flow-handoff'
|
|
3
4
|
import { FlowImage } from './flow-image'
|
|
@@ -11,6 +12,7 @@ export { ContentFieldsBase } from './content-fields-base'
|
|
|
11
12
|
export { FlowButton } from './flow-button'
|
|
12
13
|
export { FlowElement } from './flow-element'
|
|
13
14
|
export {
|
|
15
|
+
FlowBotAction,
|
|
14
16
|
FlowCarousel,
|
|
15
17
|
FlowImage,
|
|
16
18
|
FlowKnowledgeBase,
|
|
@@ -30,3 +32,4 @@ export type FlowContent =
|
|
|
30
32
|
| FlowWhatsappCtaUrlButtonNode
|
|
31
33
|
| FlowHandoff
|
|
32
34
|
| FlowKnowledgeBase
|
|
35
|
+
| FlowBotAction
|
package/src/index.ts
CHANGED
|
@@ -4,12 +4,12 @@ import { v4 as uuid } from 'uuid'
|
|
|
4
4
|
|
|
5
5
|
import { FlowBuilderApi } from './api'
|
|
6
6
|
import {
|
|
7
|
-
BOT_ACTION_PAYLOAD_PREFIX,
|
|
8
7
|
FLOW_BUILDER_API_URL_PROD,
|
|
9
8
|
SEPARATOR,
|
|
10
9
|
SOURCE_INFO_SEPARATOR,
|
|
11
10
|
} from './constants'
|
|
12
11
|
import {
|
|
12
|
+
FlowBotAction,
|
|
13
13
|
FlowCarousel,
|
|
14
14
|
FlowContent,
|
|
15
15
|
FlowHandoff,
|
|
@@ -21,7 +21,6 @@ import {
|
|
|
21
21
|
FlowWhatsappCtaUrlButtonNode,
|
|
22
22
|
} from './content-fields'
|
|
23
23
|
import {
|
|
24
|
-
HtBotActionNode,
|
|
25
24
|
HtFlowBuilderData,
|
|
26
25
|
HtFunctionArgument,
|
|
27
26
|
HtFunctionArguments,
|
|
@@ -43,7 +42,6 @@ import { SmartIntentsInferenceConfig } from './user-input/smart-intent'
|
|
|
43
42
|
import { inputHasTextData, resolveGetAccessToken } from './utils'
|
|
44
43
|
export default class BotonicPluginFlowBuilder implements Plugin {
|
|
45
44
|
public cmsApi: FlowBuilderApi
|
|
46
|
-
private flowUrl: string
|
|
47
45
|
private flow?: HtFlowBuilderData
|
|
48
46
|
private functions: Record<any, any>
|
|
49
47
|
private currentRequest: PluginPreRequest
|
|
@@ -112,12 +110,6 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
112
110
|
private updateRequestBeforeRoutes(request: PluginPreRequest) {
|
|
113
111
|
if (request.input.payload) {
|
|
114
112
|
request.input.payload = this.removeSourceSufix(request.input.payload)
|
|
115
|
-
|
|
116
|
-
if (request.input.payload.startsWith(BOT_ACTION_PAYLOAD_PREFIX)) {
|
|
117
|
-
request.input.payload = this.replaceBotActionPayload(
|
|
118
|
-
request.input.payload
|
|
119
|
-
)
|
|
120
|
-
}
|
|
121
113
|
}
|
|
122
114
|
}
|
|
123
115
|
|
|
@@ -125,12 +117,6 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
125
117
|
return payload.split(SOURCE_INFO_SEPARATOR)[0]
|
|
126
118
|
}
|
|
127
119
|
|
|
128
|
-
public replaceBotActionPayload(payload: string): string {
|
|
129
|
-
const botActionId = payload.split(SEPARATOR)[1]
|
|
130
|
-
const botActionNode = this.cmsApi.getNodeById<HtBotActionNode>(botActionId)
|
|
131
|
-
return this.cmsApi.createPayloadWithParams(botActionNode)
|
|
132
|
-
}
|
|
133
|
-
|
|
134
120
|
async getContentsByContentID(
|
|
135
121
|
contentID: string,
|
|
136
122
|
locale: string,
|
|
@@ -178,8 +164,13 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
178
164
|
if (content) {
|
|
179
165
|
contents.push(content)
|
|
180
166
|
}
|
|
181
|
-
// TODO: prevent infinite recursive calls
|
|
182
167
|
|
|
168
|
+
// If node is BOT_ACTION not add more contents to render, next nodes render after execute action
|
|
169
|
+
if (node.type === HtNodeWithContentType.BOT_ACTION) {
|
|
170
|
+
return contents
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// TODO: prevent infinite recursive calls
|
|
183
174
|
if (node.follow_up) {
|
|
184
175
|
return this.getContentsById(node.follow_up.id, resolvedLocale, contents)
|
|
185
176
|
}
|
|
@@ -217,6 +208,10 @@ export default class BotonicPluginFlowBuilder implements Plugin {
|
|
|
217
208
|
|
|
218
209
|
case HtNodeWithContentType.KNOWLEDGE_BASE:
|
|
219
210
|
return FlowKnowledgeBase.fromHubtypeCMS(hubtypeContent)
|
|
211
|
+
|
|
212
|
+
case HtNodeWithContentType.BOT_ACTION:
|
|
213
|
+
return FlowBotAction.fromHubtypeCMS(hubtypeContent, locale, this.cmsApi)
|
|
214
|
+
|
|
220
215
|
default:
|
|
221
216
|
return undefined
|
|
222
217
|
}
|