@botonic/plugin-flow-builder 0.56.0-alpha.1 → 0.56.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/ai-agent-from-user-input.js +6 -0
- package/lib/cjs/action/ai-agent-from-user-input.js.map +1 -1
- package/lib/cjs/action/first-interaction.js +5 -0
- package/lib/cjs/action/first-interaction.js.map +1 -1
- package/lib/cjs/content-fields/flow-do-nothing.d.ts +9 -0
- package/lib/cjs/content-fields/flow-do-nothing.js +27 -0
- package/lib/cjs/content-fields/flow-do-nothing.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/do-nothing.d.ts +6 -0
- package/lib/cjs/content-fields/hubtype-fields/do-nothing.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/do-nothing.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/index.d.ts +1 -0
- package/lib/cjs/content-fields/hubtype-fields/index.js +1 -0
- package/lib/cjs/content-fields/hubtype-fields/index.js.map +1 -1
- package/lib/cjs/content-fields/hubtype-fields/node-types.d.ts +2 -1
- package/lib/cjs/content-fields/hubtype-fields/node-types.js +1 -0
- package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +1 -1
- package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +2 -1
- 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/flow-factory.js +2 -0
- package/lib/cjs/flow-factory.js.map +1 -1
- package/lib/esm/action/ai-agent-from-user-input.js +6 -0
- package/lib/esm/action/ai-agent-from-user-input.js.map +1 -1
- package/lib/esm/action/first-interaction.js +5 -0
- package/lib/esm/action/first-interaction.js.map +1 -1
- package/lib/esm/content-fields/flow-do-nothing.d.ts +9 -0
- package/lib/esm/content-fields/flow-do-nothing.js +27 -0
- package/lib/esm/content-fields/flow-do-nothing.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/do-nothing.d.ts +6 -0
- package/lib/esm/content-fields/hubtype-fields/do-nothing.js +3 -0
- package/lib/esm/content-fields/hubtype-fields/do-nothing.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/index.d.ts +1 -0
- package/lib/esm/content-fields/hubtype-fields/index.js +1 -0
- package/lib/esm/content-fields/hubtype-fields/index.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +2 -1
- package/lib/esm/content-fields/hubtype-fields/node-types.js +1 -0
- package/lib/esm/content-fields/hubtype-fields/node-types.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +2 -1
- package/lib/esm/content-fields/index.d.ts +3 -2
- package/lib/esm/content-fields/index.js +3 -1
- package/lib/esm/content-fields/index.js.map +1 -1
- package/lib/esm/flow-factory.js +2 -0
- package/lib/esm/flow-factory.js.map +1 -1
- package/package.json +2 -2
- package/src/action/ai-agent-from-user-input.ts +7 -0
- package/src/action/first-interaction.ts +6 -0
- package/src/content-fields/flow-do-nothing.tsx +29 -0
- package/src/content-fields/hubtype-fields/do-nothing.ts +7 -0
- package/src/content-fields/hubtype-fields/index.ts +1 -0
- package/src/content-fields/hubtype-fields/node-types.ts +1 -0
- package/src/content-fields/hubtype-fields/nodes.ts +2 -0
- package/src/content-fields/index.ts +3 -0
- package/src/flow-factory.ts +4 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getContentsByAiAgentFromUserInput = getContentsByAiAgentFromUserInput;
|
|
4
|
+
const core_1 = require("@botonic/core");
|
|
4
5
|
const ai_agent_1 = require("../utils/ai-agent");
|
|
5
6
|
async function getContentsByAiAgentFromUserInput({ cmsApi, flowBuilderPlugin, request, }) {
|
|
6
7
|
const startNodeAiAgentFlow = cmsApi.getStartNodeAiAgentFlow();
|
|
@@ -27,6 +28,11 @@ async function getContentsByAiAgentFromUserInput({ cmsApi, flowBuilderPlugin, re
|
|
|
27
28
|
return [];
|
|
28
29
|
}
|
|
29
30
|
}
|
|
31
|
+
request.input.nluResolution = {
|
|
32
|
+
type: core_1.NluType.AiAgent,
|
|
33
|
+
matchedValue: 'ai-agent-from-user-input',
|
|
34
|
+
payload: undefined,
|
|
35
|
+
};
|
|
30
36
|
return contents;
|
|
31
37
|
}
|
|
32
38
|
//# sourceMappingURL=ai-agent-from-user-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-agent-from-user-input.js","sourceRoot":"","sources":["../../../src/action/ai-agent-from-user-input.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ai-agent-from-user-input.js","sourceRoot":"","sources":["../../../src/action/ai-agent-from-user-input.ts"],"names":[],"mappings":";;AAKA,8EAmDC;AAxDD,wCAAuC;AAEvC,gDAAwD;AAGjD,KAAK,UAAU,iCAAiC,CAAC,EACtD,MAAM,EACN,iBAAiB,EACjB,OAAO,GACY;IACnB,MAAM,oBAAoB,GAAG,MAAM,CAAC,uBAAuB,EAAE,CAAA;IAC7D,MAAM,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAA;IAClD,IAAI,CAAC,oBAAoB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC/C,OAAO,EAAE,CAAA;IACX,CAAC;IAED,MAAM,QAAQ,GACZ,MAAM,iBAAiB,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAA;IAEjE,MAAM,aAAa,GAAG,IAAA,+BAAoB,EAAC,QAAQ,CAAC,CAAA;IAEpD,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,EAAE,CAAA;IACX,CAAC;IAED,IAAI,sBAAsB,IAAI,aAAa,EAAE,CAAC;QAC5C,MAAM,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,GAAG,aAAa,CAAA;QAC3E,MAAM,eAAe,GAAG,MAAM,oBAAoB,CAAC,sBAAsB,CACvE,OAAO,EACP,2BAA2B,CAC5B,CAAA;QAED,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,IAAI,EAAE,CAAC;YAC7C,OAAO,EAAE,CAAA;QACX,CAAC;IACH,CAAC;IAED,IAAI,sBAAsB,IAAI,aAAa,EAAE,CAAC;QAC5C,MAAM,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,GAAG,aAAa,CAAA;QAC3E,MAAM,eAAe,GAAG,MAAM,oBAAoB,CAAC,sBAAsB,CACvE,OAAO,EACP,2BAA2B,CAC5B,CAAA;QAED,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,IAAI,EAAE,CAAC;YAC7C,OAAO,EAAE,CAAA;QACX,CAAC;IACH,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG;QAC5B,IAAI,EAAE,cAAO,CAAC,OAAO;QACrB,YAAY,EAAE,0BAA0B;QACxC,OAAO,EAAE,SAAS;KACnB,CAAA;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getContentsByFirstInteraction = getContentsByFirstInteraction;
|
|
4
|
+
const core_1 = require("@botonic/core");
|
|
4
5
|
const constants_1 = require("../constants");
|
|
5
6
|
const content_fields_1 = require("../content-fields");
|
|
6
7
|
const input_1 = require("../utils/input");
|
|
@@ -35,6 +36,10 @@ async function getContentsByFirstInteraction(context) {
|
|
|
35
36
|
}
|
|
36
37
|
if (request.input.nluResolution || (0, input_1.inputHasTextOrTranscript)(request.input)) {
|
|
37
38
|
const contentsByUserInput = await getContentsByUserInput(context);
|
|
39
|
+
if (request.input.nluResolution?.type === core_1.NluType.AiAgent) {
|
|
40
|
+
const startContents = await flowBuilderPlugin.getStartContents();
|
|
41
|
+
return [...startContents, ...contentsByUserInput];
|
|
42
|
+
}
|
|
38
43
|
return [...firstInteractionContents, ...contentsByUserInput];
|
|
39
44
|
}
|
|
40
45
|
return firstInteractionContents;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"first-interaction.js","sourceRoot":"","sources":["../../../src/action/first-interaction.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"first-interaction.js","sourceRoot":"","sources":["../../../src/action/first-interaction.ts"],"names":[],"mappings":";;AAeA,sEAgDC;AA/DD,wCAAuC;AAEvC,4CAA6C;AAC7C,sDAK0B;AAE1B,0CAAyD;AACzD,yEAA8E;AAE9E,uCAAgD;AAEzC,KAAK,UAAU,6BAA6B,CACjD,OAA2B;IAE3B,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;IAEzD;;;;;;OAMG;IACH,MAAM,wBAAwB,GAAG,MAAM,iBAAiB,CAAC,gBAAgB,EAAE,CAAA;IAE3E,IAAI,SAAS,EAAE,CAAC;QACd,IAAI,CAAC;YACH,MAAM,mBAAmB,GACvB,MAAM,iBAAiB,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAA;YAE3D,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACnC,OAAO,mBAAmB,CAAA;YAC5B,CAAC;QACH,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,OAAO,CAAC,IAAI,CACV,iBAAiB,SAAS,uDAAuD,CAClF,CAAA;QACH,CAAC;IACH,CAAC;IAED,qEAAqE;IACrE,8EAA8E;IAC9E,8CAA8C;IAC9C,IAAI,mCAAmC,CAAC,wBAAwB,CAAC,EAAE,CAAC;QAClE,OAAO,wBAAwB,CAAA;IACjC,CAAC;IAED,IAAI,OAAO,CAAC,KAAK,CAAC,aAAa,IAAI,IAAA,gCAAwB,EAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3E,MAAM,mBAAmB,GAAG,MAAM,sBAAsB,CAAC,OAAO,CAAC,CAAA;QAEjE,IAAI,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,KA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,IAAI,kBAAkB,EAAE,CAAC;YACvB,OAAO,EAAE,CAAA;QACX,CAAC;QAED,IAAI,2BAA2B,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3C,OAAO,2BAA2B,CAAA;QACpC,CAAC;IACH,CAAC;IAED,IAAI,CAAC,iBAAiB,CAAC,gCAAgC,EAAE,CAAC;QACxD,MAAM,iBAAiB,GAAG,MAAM,IAAA,4DAAiC,EAAC,OAAO,CAAC,CAAA;QAC1E,OAAO,iBAAiB,CAAA;IAC1B,CAAC;IAED,OAAO,EAAE,CAAA;AACX,CAAC;AAED,SAAS,sBAAsB,CAAC,MAAsB;IACpD,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAChD,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,0BAAc,CACrC,EAAE,aAAa,CAAA;IAEhB,OAAO,mBAAmB,CAAA;AAC5B,CAAC;AAED,KAAK,UAAU,qBAAqB,CAClC,iBAA2C,EAC3C,2BAA0C;IAE1C,MAAM,aAAa,GAAG,MAAM,iBAAiB,CAAC,gBAAgB,EAAE,CAAA;IAChE,MAAM,UAAU,GAAG,IAAI,GAAG,CACxB,2BAA2B,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CACvD,CAAA;IACD,MAAM,kBAAkB,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CACtD,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAC3B,CAAA;IAED,OAAO,kBAAkB,CAAA;AAC3B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BotContext } from '@botonic/core';
|
|
2
|
+
import { ContentFieldsBase } from './content-fields-base';
|
|
3
|
+
import type { HtDoNothingNode } from './hubtype-fields';
|
|
4
|
+
export declare class FlowDoNothing extends ContentFieldsBase {
|
|
5
|
+
static fromHubtypeCMS(cmsDoNothing: HtDoNothingNode): FlowDoNothing;
|
|
6
|
+
trackFlow(botContext: BotContext): Promise<void>;
|
|
7
|
+
processContent(botContext: BotContext): Promise<void>;
|
|
8
|
+
toBotonic(): JSX.Element;
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowDoNothing = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const tracking_1 = require("../tracking");
|
|
6
|
+
const content_fields_base_1 = require("./content-fields-base");
|
|
7
|
+
class FlowDoNothing extends content_fields_base_1.ContentFieldsBase {
|
|
8
|
+
static fromHubtypeCMS(cmsDoNothing) {
|
|
9
|
+
const newDoNothing = new FlowDoNothing(cmsDoNothing.id);
|
|
10
|
+
newDoNothing.code = cmsDoNothing.code;
|
|
11
|
+
newDoNothing.followUp = cmsDoNothing.follow_up;
|
|
12
|
+
return newDoNothing;
|
|
13
|
+
}
|
|
14
|
+
async trackFlow(botContext) {
|
|
15
|
+
await (0, tracking_1.trackOneContent)(botContext, this);
|
|
16
|
+
}
|
|
17
|
+
async processContent(botContext) {
|
|
18
|
+
await this.filterContent(botContext, this);
|
|
19
|
+
await this.trackFlow(botContext);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
toBotonic() {
|
|
23
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.FlowDoNothing = FlowDoNothing;
|
|
27
|
+
//# sourceMappingURL=flow-do-nothing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-do-nothing.js","sourceRoot":"","sources":["../../../src/content-fields/flow-do-nothing.tsx"],"names":[],"mappings":";;;;AAEA,0CAA6C;AAC7C,+DAAyD;AAGzD,MAAa,aAAc,SAAQ,uCAAiB;IAClD,MAAM,CAAC,cAAc,CAAC,YAA6B;QACjD,MAAM,YAAY,GAAG,IAAI,aAAa,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;QACvD,YAAY,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAA;QACrC,YAAY,CAAC,QAAQ,GAAG,YAAY,CAAC,SAAS,CAAA;QAE9C,OAAO,YAAY,CAAA;IACrB,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,UAAsB;QACpC,MAAM,IAAA,0BAAe,EAAC,UAAU,EAAE,IAAI,CAAC,CAAA;IACzC,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,UAAsB;QACzC,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;QAC1C,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;QAChC,OAAM;IACR,CAAC;IAED,SAAS;QACP,OAAO,kDAAK,CAAA;IACd,CAAC;CACF;AAtBD,sCAsBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"do-nothing.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/do-nothing.ts"],"names":[],"mappings":""}
|
|
@@ -9,6 +9,7 @@ tslib_1.__exportStar(require("./capture-user-input"), exports);
|
|
|
9
9
|
tslib_1.__exportStar(require("./carousel"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./common"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./custom-conditional-v2"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./do-nothing"), exports);
|
|
12
13
|
tslib_1.__exportStar(require("./fallback"), exports);
|
|
13
14
|
tslib_1.__exportStar(require("./function"), exports);
|
|
14
15
|
tslib_1.__exportStar(require("./go-to-flow"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0B;AAC1B,4DAAiC;AACjC,uDAA4B;AAC5B,mDAAwB;AACxB,+DAAoC;AACpC,qDAA0B;AAC1B,mDAAwB;AACxB,kEAAuC;AACvC,qDAA0B;AAC1B,qDAA0B;AAC1B,uDAA4B;AAC5B,oDAAyB;AACzB,kDAAuB;AACvB,oDAAyB;AACzB,uDAA4B;AAC5B,kDAAuB;AACvB,oDAAyB;AACzB,mDAAwB;AACxB,yDAA8B;AAC9B,iDAAsB;AACtB,gDAAqB;AACrB,kDAAuB;AACvB,oDAAyB;AACzB,iEAAsC;AACtC,oEAAyC;AACzC,0EAA+C;AAC/C,8DAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0B;AAC1B,4DAAiC;AACjC,uDAA4B;AAC5B,mDAAwB;AACxB,+DAAoC;AACpC,qDAA0B;AAC1B,mDAAwB;AACxB,kEAAuC;AACvC,uDAA4B;AAC5B,qDAA0B;AAC1B,qDAA0B;AAC1B,uDAA4B;AAC5B,oDAAyB;AACzB,kDAAuB;AACvB,oDAAyB;AACzB,uDAA4B;AAC5B,kDAAuB;AACvB,oDAAyB;AACzB,mDAAwB;AACxB,yDAA8B;AAC9B,iDAAsB;AACtB,gDAAqB;AACrB,kDAAuB;AACvB,oDAAyB;AACzB,iEAAsC;AACtC,oEAAyC;AACzC,0EAA+C;AAC/C,8DAAmC"}
|
|
@@ -19,7 +19,8 @@ export declare enum HtNodeWithContentType {
|
|
|
19
19
|
WEBVIEW = "webview",
|
|
20
20
|
GO_TO_FLOW = "go-to-flow",
|
|
21
21
|
CAPTURE_USER_INPUT = "capture-user-input",
|
|
22
|
-
CUSTOM_CONDITION = "custom-condition"
|
|
22
|
+
CUSTOM_CONDITION = "custom-condition",
|
|
23
|
+
DO_NOTHING = "do-nothing"
|
|
23
24
|
}
|
|
24
25
|
export declare enum HtNodeWithoutContentType {
|
|
25
26
|
URL = "url",
|
|
@@ -24,6 +24,7 @@ var HtNodeWithContentType;
|
|
|
24
24
|
HtNodeWithContentType["GO_TO_FLOW"] = "go-to-flow";
|
|
25
25
|
HtNodeWithContentType["CAPTURE_USER_INPUT"] = "capture-user-input";
|
|
26
26
|
HtNodeWithContentType["CUSTOM_CONDITION"] = "custom-condition";
|
|
27
|
+
HtNodeWithContentType["DO_NOTHING"] = "do-nothing";
|
|
27
28
|
})(HtNodeWithContentType || (exports.HtNodeWithContentType = HtNodeWithContentType = {}));
|
|
28
29
|
var HtNodeWithoutContentType;
|
|
29
30
|
(function (HtNodeWithoutContentType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-types.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/node-types.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"node-types.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/node-types.ts"],"names":[],"mappings":";;;AAAA,IAAY,qBAuBX;AAvBD,WAAY,qBAAqB;IAC/B,8CAAqB,CAAA;IACrB,4CAAmB,CAAA;IACnB,wCAAe,CAAA;IACf,sCAAa,CAAA;IACb,4CAAmB,CAAA;IACnB,sDAA6B,CAAA;IAC7B,8CAAqB,CAAA;IACrB,8CAAqB,CAAA;IACrB,wCAAe,CAAA;IACf,sEAA6C,CAAA;IAC7C,4EAAmD,CAAA;IACnD,wFAA+D,CAAA;IAC/D,gEAAuC,CAAA;IACvC,kDAAyB,CAAA;IACzB,8CAAqB,CAAA;IACrB,4DAAmC,CAAA;IACnC,0CAAiB,CAAA;IACjB,4CAAmB,CAAA;IACnB,kDAAyB,CAAA;IACzB,kEAAyC,CAAA;IACzC,8DAAqC,CAAA;IACrC,kDAAyB,CAAA;AAC3B,CAAC,EAvBW,qBAAqB,qCAArB,qBAAqB,QAuBhC;AAED,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,uCAAW,CAAA;IACX,+CAAmB,CAAA;AACrB,CAAC,EAHW,wBAAwB,wCAAxB,wBAAwB,QAGnC;AAED,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,kCAAiB,CAAA;IACjB,4CAA2B,CAAA;AAC7B,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB"}
|
|
@@ -4,6 +4,7 @@ import type { HtBotActionNode } from './bot-action';
|
|
|
4
4
|
import type { HtCaptureUserInputNode } from './capture-user-input';
|
|
5
5
|
import type { HtCarouselNode } from './carousel';
|
|
6
6
|
import type { HtCustomConditionalV2Node } from './custom-conditional-v2';
|
|
7
|
+
import type { HtDoNothingNode } from './do-nothing';
|
|
7
8
|
import type { HtFallbackNode } from './fallback';
|
|
8
9
|
import type { HtFunctionNode } from './function';
|
|
9
10
|
import type { HtGoToFlow } from './go-to-flow';
|
|
@@ -21,6 +22,6 @@ import type { HtWhatsappButtonListNode } from './whatsapp-button-list';
|
|
|
21
22
|
import type { HtWhatsappCTAUrlButtonNode } from './whatsapp-cta-url-button';
|
|
22
23
|
import type { HtWhatsappRequestContactInfoNode } from './whatsapp-request-contact-info';
|
|
23
24
|
import type { HtWhatsappTemplateNode } from './whatsapp-template';
|
|
24
|
-
export type HtNodeWithContent = HtTextNode | HtImageNode | HtVideoNode | HtCarouselNode | HtHandoffNode | HtKeywordNode | HtFunctionNode | HtFallbackNode | HtWhatsappButtonListNode | HtWhatsappCTAUrlButtonNode | HtWhatsappRequestContactInfoNode | HtSmartIntentNode | HtBotActionNode | HtAiAgentNode | HtAiAgentRouterNode | HtRatingNode | HtWebviewNode | HtGoToFlow | HtWhatsappTemplateNode | HtCaptureUserInputNode | HtCustomConditionalV2Node;
|
|
25
|
+
export type HtNodeWithContent = HtTextNode | HtImageNode | HtVideoNode | HtCarouselNode | HtHandoffNode | HtKeywordNode | HtFunctionNode | HtFallbackNode | HtWhatsappButtonListNode | HtWhatsappCTAUrlButtonNode | HtWhatsappRequestContactInfoNode | HtSmartIntentNode | HtBotActionNode | HtAiAgentNode | HtAiAgentRouterNode | HtRatingNode | HtWebviewNode | HtGoToFlow | HtWhatsappTemplateNode | HtCaptureUserInputNode | HtCustomConditionalV2Node | HtDoNothingNode;
|
|
25
26
|
export type HtNodeWithoutContent = HtUrlNode | HtPayloadNode;
|
|
26
27
|
export type HtNodeComponent = HtNodeWithContent | HtNodeWithoutContent;
|
|
@@ -7,6 +7,7 @@ import { FlowCarousel } from './flow-carousel';
|
|
|
7
7
|
import { FlowChannelConditional } from './flow-channel-conditional';
|
|
8
8
|
import { FlowCountryConditional } from './flow-country-conditional';
|
|
9
9
|
import { FlowCustomConditional } from './flow-custom-conditional';
|
|
10
|
+
import { FlowDoNothing } from './flow-do-nothing';
|
|
10
11
|
import { FlowGoToFlow } from './flow-go-to-flow';
|
|
11
12
|
import { FlowHandoff } from './flow-handoff';
|
|
12
13
|
import { FlowImage } from './flow-image';
|
|
@@ -21,5 +22,5 @@ import { FlowWhatsappButtonList, FlowWhatsappButtonListRow, FlowWhatsappButtonLi
|
|
|
21
22
|
export { ContentFieldsBase } from './content-fields-base';
|
|
22
23
|
export { FlowButton } from './flow-button';
|
|
23
24
|
export { FlowElement } from './flow-element';
|
|
24
|
-
export { FlowAiAgent, FlowAiAgentRouter, FlowBotAction, FlowCaptureUserInput, FlowCarousel, FlowChannelConditional, FlowCountryConditional, FlowCustomConditional, FlowCustomConditionalV2, FlowGoToFlow, FlowHandoff, FlowImage, FlowQueueStatusConditional, FlowRating, FlowText, FlowVideo, FlowWhatsappButtonList, FlowWhatsappButtonListRow, FlowWhatsappButtonListSection, FlowWhatsappCtaUrlButtonNode, FlowWhatsappRequestContactInfoNode, FlowWhatsappTemplate, };
|
|
25
|
-
export type FlowContent = FlowCarousel | FlowImage | FlowText | FlowVideo | FlowWhatsappButtonList | FlowWhatsappCtaUrlButtonNode | FlowWhatsappRequestContactInfoNode | FlowWhatsappTemplate | FlowHandoff | FlowBotAction | FlowAiAgent | FlowRating | FlowCountryConditional | FlowChannelConditional | FlowQueueStatusConditional | FlowCustomConditional | FlowGoToFlow | FlowCaptureUserInput | FlowAiAgentRouter | FlowCustomConditionalV2;
|
|
25
|
+
export { FlowAiAgent, FlowAiAgentRouter, FlowBotAction, FlowCaptureUserInput, FlowCarousel, FlowChannelConditional, FlowCountryConditional, FlowCustomConditional, FlowCustomConditionalV2, FlowDoNothing, FlowGoToFlow, FlowHandoff, FlowImage, FlowQueueStatusConditional, FlowRating, FlowText, FlowVideo, FlowWhatsappButtonList, FlowWhatsappButtonListRow, FlowWhatsappButtonListSection, FlowWhatsappCtaUrlButtonNode, FlowWhatsappRequestContactInfoNode, FlowWhatsappTemplate, };
|
|
26
|
+
export type FlowContent = FlowCarousel | FlowImage | FlowText | FlowVideo | FlowWhatsappButtonList | FlowWhatsappCtaUrlButtonNode | FlowWhatsappRequestContactInfoNode | FlowWhatsappTemplate | FlowHandoff | FlowBotAction | FlowAiAgent | FlowRating | FlowCountryConditional | FlowChannelConditional | FlowQueueStatusConditional | FlowCustomConditional | FlowGoToFlow | FlowCaptureUserInput | FlowAiAgentRouter | FlowCustomConditionalV2 | FlowDoNothing;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FlowWhatsappTemplate = exports.FlowWhatsappRequestContactInfoNode = exports.FlowWhatsappCtaUrlButtonNode = exports.FlowWhatsappButtonListSection = exports.FlowWhatsappButtonListRow = exports.FlowWhatsappButtonList = exports.FlowVideo = exports.FlowText = exports.FlowRating = exports.FlowQueueStatusConditional = exports.FlowImage = exports.FlowHandoff = exports.FlowGoToFlow = exports.FlowCustomConditionalV2 = exports.FlowCustomConditional = exports.FlowCountryConditional = exports.FlowChannelConditional = exports.FlowCarousel = exports.FlowCaptureUserInput = exports.FlowBotAction = exports.FlowAiAgentRouter = exports.FlowAiAgent = exports.FlowElement = exports.FlowButton = exports.ContentFieldsBase = void 0;
|
|
3
|
+
exports.FlowWhatsappTemplate = exports.FlowWhatsappRequestContactInfoNode = exports.FlowWhatsappCtaUrlButtonNode = exports.FlowWhatsappButtonListSection = exports.FlowWhatsappButtonListRow = exports.FlowWhatsappButtonList = exports.FlowVideo = exports.FlowText = exports.FlowRating = exports.FlowQueueStatusConditional = exports.FlowImage = exports.FlowHandoff = exports.FlowGoToFlow = exports.FlowDoNothing = exports.FlowCustomConditionalV2 = exports.FlowCustomConditional = exports.FlowCountryConditional = exports.FlowChannelConditional = exports.FlowCarousel = exports.FlowCaptureUserInput = exports.FlowBotAction = exports.FlowAiAgentRouter = exports.FlowAiAgent = exports.FlowElement = exports.FlowButton = exports.ContentFieldsBase = void 0;
|
|
4
4
|
const flow_custom_condition_v2_1 = require("./custom-conditional/flow-custom-condition-v2");
|
|
5
5
|
Object.defineProperty(exports, "FlowCustomConditionalV2", { enumerable: true, get: function () { return flow_custom_condition_v2_1.FlowCustomConditionalV2; } });
|
|
6
6
|
const flow_ai_agent_1 = require("./flow-ai-agent");
|
|
@@ -19,6 +19,8 @@ const flow_country_conditional_1 = require("./flow-country-conditional");
|
|
|
19
19
|
Object.defineProperty(exports, "FlowCountryConditional", { enumerable: true, get: function () { return flow_country_conditional_1.FlowCountryConditional; } });
|
|
20
20
|
const flow_custom_conditional_1 = require("./flow-custom-conditional");
|
|
21
21
|
Object.defineProperty(exports, "FlowCustomConditional", { enumerable: true, get: function () { return flow_custom_conditional_1.FlowCustomConditional; } });
|
|
22
|
+
const flow_do_nothing_1 = require("./flow-do-nothing");
|
|
23
|
+
Object.defineProperty(exports, "FlowDoNothing", { enumerable: true, get: function () { return flow_do_nothing_1.FlowDoNothing; } });
|
|
22
24
|
const flow_go_to_flow_1 = require("./flow-go-to-flow");
|
|
23
25
|
Object.defineProperty(exports, "FlowGoToFlow", { enumerable: true, get: function () { return flow_go_to_flow_1.FlowGoToFlow; } });
|
|
24
26
|
const flow_handoff_1 = require("./flow-handoff");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content-fields/index.ts"],"names":[],"mappings":";;;AAAA,4FAAu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AAA,UAAU,OAAA;AACnB,+CAA4C;AAAnC,2GAAA,WAAW,OAAA"}
|
package/lib/cjs/flow-factory.js
CHANGED
|
@@ -46,6 +46,8 @@ class FlowFactory {
|
|
|
46
46
|
return flow_capture_user_input_1.FlowCaptureUserInput.fromHubtypeCMS(hubtypeContent);
|
|
47
47
|
case hubtype_fields_1.HtNodeWithContentType.CUSTOM_CONDITION:
|
|
48
48
|
return content_fields_1.FlowCustomConditionalV2.fromHubtypeCMS(hubtypeContent, this.botContext);
|
|
49
|
+
case hubtype_fields_1.HtNodeWithContentType.DO_NOTHING:
|
|
50
|
+
return content_fields_1.FlowDoNothing.fromHubtypeCMS(hubtypeContent);
|
|
49
51
|
default:
|
|
50
52
|
return undefined;
|
|
51
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-factory.js","sourceRoot":"","sources":["../../src/flow-factory.ts"],"names":[],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"flow-factory.js","sourceRoot":"","sources":["../../src/flow-factory.ts"],"names":[],"mappings":";;;AAGA,qDAsByB;AACzB,sFAA+E;AAC/E,oEAIwC;AAExC,MAAa,WAAW;IAKtB,YAAY,UAAsB,EAAE,MAAsB,EAAE,MAAc;QACxE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,cAA+B;QAE/B,QAAQ,cAAc,CAAC,IAAI,EAAE,CAAC;YAC5B,KAAK,sCAAqB,CAAC,IAAI;gBAC7B,OAAO,yBAAQ,CAAC,cAAc,CAC5B,cAAc,EACd,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,UAAU,CAChB,CAAA;YACH,KAAK,sCAAqB,CAAC,KAAK;gBAC9B,OAAO,0BAAS,CAAC,cAAc,CAAC,cAAc,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d,IAAI,CAAC,UAAU,CAChB,CAAA;YACH;gBACE,OAAO,SAAS,CAAA;QACpB,CAAC;IACH,CAAC;CACF;AA5HD,kCA4HC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getContentsByAiAgentFromUserInput = getContentsByAiAgentFromUserInput;
|
|
4
|
+
const core_1 = require("@botonic/core");
|
|
4
5
|
const ai_agent_1 = require("../utils/ai-agent");
|
|
5
6
|
async function getContentsByAiAgentFromUserInput({ cmsApi, flowBuilderPlugin, request, }) {
|
|
6
7
|
const startNodeAiAgentFlow = cmsApi.getStartNodeAiAgentFlow();
|
|
@@ -27,6 +28,11 @@ async function getContentsByAiAgentFromUserInput({ cmsApi, flowBuilderPlugin, re
|
|
|
27
28
|
return [];
|
|
28
29
|
}
|
|
29
30
|
}
|
|
31
|
+
request.input.nluResolution = {
|
|
32
|
+
type: core_1.NluType.AiAgent,
|
|
33
|
+
matchedValue: 'ai-agent-from-user-input',
|
|
34
|
+
payload: undefined,
|
|
35
|
+
};
|
|
30
36
|
return contents;
|
|
31
37
|
}
|
|
32
38
|
//# sourceMappingURL=ai-agent-from-user-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-agent-from-user-input.js","sourceRoot":"","sources":["../../../src/action/ai-agent-from-user-input.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"ai-agent-from-user-input.js","sourceRoot":"","sources":["../../../src/action/ai-agent-from-user-input.ts"],"names":[],"mappings":";;AAKA,8EAmDC;AAxDD,wCAAuC;AAEvC,gDAAwD;AAGjD,KAAK,UAAU,iCAAiC,CAAC,EACtD,MAAM,EACN,iBAAiB,EACjB,OAAO,GACY;IACnB,MAAM,oBAAoB,GAAG,MAAM,CAAC,uBAAuB,EAAE,CAAA;IAC7D,MAAM,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAA;I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stInteraction;
|
|
4
|
+
const core_1 = require("@botonic/core");
|
|
4
5
|
const constants_1 = require("../constants");
|
|
5
6
|
const content_fields_1 = require("../content-fields");
|
|
6
7
|
const input_1 = require("../utils/input");
|
|
@@ -35,6 +36,10 @@ async function getContentsByFirstInteraction(context) {
|
|
|
35
36
|
}
|
|
36
37
|
if (request.input.nluResolution || (0, input_1.inputHasTextOrTranscript)(request.input)) {
|
|
37
38
|
const contentsByUserInput = await getContentsByUserInput(context);
|
|
39
|
+
if (request.input.nluResolution?.type === core_1.NluType.AiAgent) {
|
|
40
|
+
const startContents = await flowBuilderPlugin.getStartContents();
|
|
41
|
+
return [...startContents, ...contentsByUserInput];
|
|
42
|
+
}
|
|
38
43
|
return [...firstInteractionContents, ...contentsByUserInput];
|
|
39
44
|
}
|
|
40
45
|
return firstInteractionContents;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"first-interaction.js","sourceRoot":"","sources":["../../../src/action/first-interaction.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"first-interaction.js","sourceRoot":"","sources":["../../../src/action/first-interaction.ts"],"names":[],"mappings":";;AAeA,sEAgDC;AA/DD,wCAAuC;AAEvC,4CAA6C;AAC7C,sDAK0B;AAE1B,0CAAyD;AACzD,yEAA8E;AAE9E,uCAAgD;AAEzC,KAAK,UAAU,6BAA6B,CACjD,OAA2B;IAE3B,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;IAEzD;;;;;;OAMG;IACH,MAAM,wBAAwB,GAAG,MAAM,iBAAiB,CAAC,gBAAgB,EAAE,CAAA;IAE3E,IAAI,SAAS,EAAE,CAAC;QACd,IAAI,CAAC;YACH,MAAM,mBAAmB,GACvB,MAAM,iBAAiB,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAA;YAE3D,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACnC,OAAO,mBAAmB,CAAA;YA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,GAAG,IAAI,GAAG,CACxB,2BAA2B,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CACvD,CAAA;IACD,MAAM,kBAAkB,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CACtD,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAC3B,CAAA;IAED,OAAO,kBAAkB,CAAA;AAC3B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BotContext } from '@botonic/core';
|
|
2
|
+
import { ContentFieldsBase } from './content-fields-base';
|
|
3
|
+
import type { HtDoNothingNode } from './hubtype-fields';
|
|
4
|
+
export declare class FlowDoNothing extends ContentFieldsBase {
|
|
5
|
+
static fromHubtypeCMS(cmsDoNothing: HtDoNothingNode): FlowDoNothing;
|
|
6
|
+
trackFlow(botContext: BotContext): Promise<void>;
|
|
7
|
+
processContent(botContext: BotContext): Promise<void>;
|
|
8
|
+
toBotonic(): JSX.Element;
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowDoNothing = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const tracking_1 = require("../tracking");
|
|
6
|
+
const content_fields_base_1 = require("./content-fields-base");
|
|
7
|
+
class FlowDoNothing extends content_fields_base_1.ContentFieldsBase {
|
|
8
|
+
static fromHubtypeCMS(cmsDoNothing) {
|
|
9
|
+
const newDoNothing = new FlowDoNothing(cmsDoNothing.id);
|
|
10
|
+
newDoNothing.code = cmsDoNothing.code;
|
|
11
|
+
newDoNothing.followUp = cmsDoNothing.follow_up;
|
|
12
|
+
return newDoNothing;
|
|
13
|
+
}
|
|
14
|
+
async trackFlow(botContext) {
|
|
15
|
+
await (0, tracking_1.trackOneContent)(botContext, this);
|
|
16
|
+
}
|
|
17
|
+
async processContent(botContext) {
|
|
18
|
+
await this.filterContent(botContext, this);
|
|
19
|
+
await this.trackFlow(botContext);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
toBotonic() {
|
|
23
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.FlowDoNothing = FlowDoNothing;
|
|
27
|
+
//# sourceMappingURL=flow-do-nothing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-do-nothing.js","sourceRoot":"","sources":["../../../src/content-fields/flow-do-nothing.tsx"],"names":[],"mappings":";;;;AAEA,0CAA6C;AAC7C,+DAAyD;AAGzD,MAAa,aAAc,SAAQ,uCAAiB;IAClD,MAAM,CAAC,cAAc,CAAC,YAA6B;QACjD,MAAM,YAAY,GAAG,IAAI,aAAa,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;QACvD,YAAY,CAAC,IAAI,GAAG,YAAY,CAAC,IAAI,CAAA;QACrC,YAAY,CAAC,QAAQ,GAAG,YAAY,CAAC,SAAS,CAAA;QAE9C,OAAO,YAAY,CAAA;IACrB,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,UAAsB;QACpC,MAAM,IAAA,0BAAe,EAAC,UAAU,EAAE,IAAI,CAAC,CAAA;IACzC,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,UAAsB;QACzC,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;QAC1C,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;QAChC,OAAM;IACR,CAAC;IAED,SAAS;QACP,OAAO,kDAAK,CAAA;IACd,CAAC;CACF;AAtBD,sCAsBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"do-nothing.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/do-nothing.ts"],"names":[],"mappings":""}
|
|
@@ -9,6 +9,7 @@ tslib_1.__exportStar(require("./capture-user-input"), exports);
|
|
|
9
9
|
tslib_1.__exportStar(require("./carousel"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./common"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./custom-conditional-v2"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./do-nothing"), exports);
|
|
12
13
|
tslib_1.__exportStar(require("./fallback"), exports);
|
|
13
14
|
tslib_1.__exportStar(require("./function"), exports);
|
|
14
15
|
tslib_1.__exportStar(require("./go-to-flow"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0B;AAC1B,4DAAiC;AACjC,uDAA4B;AAC5B,mDAAwB;AACxB,+DAAoC;AACpC,qDAA0B;AAC1B,mDAAwB;AACxB,kEAAuC;AACvC,qDAA0B;AAC1B,qDAA0B;AAC1B,uDAA4B;AAC5B,oDAAyB;AACzB,kDAAuB;AACvB,oDAAyB;AACzB,uDAA4B;AAC5B,kDAAuB;AACvB,oDAAyB;AACzB,mDAAwB;AACxB,yDAA8B;AAC9B,iDAAsB;AACtB,gDAAqB;AACrB,kDAAuB;AACvB,oDAAyB;AACzB,iEAAsC;AACtC,oEAAyC;AACzC,0EAA+C;AAC/C,8DAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/index.ts"],"names":[],"mappings":";;;AAAA,qDAA0B;AAC1B,4DAAiC;AACjC,uDAA4B;AAC5B,mDAAwB;AACxB,+DAAoC;AACpC,qDAA0B;AAC1B,mDAAwB;AACxB,kEAAuC;AACvC,uDAA4B;AAC5B,qDAA0B;AAC1B,qDAA0B;AAC1B,uDAA4B;AAC5B,oDAAyB;AACzB,kDAAuB;AACvB,oDAAyB;AACzB,uDAA4B;AAC5B,kDAAuB;AACvB,oDAAyB;AACzB,mDAAwB;AACxB,yDAA8B;AAC9B,iDAAsB;AACtB,gDAAqB;AACrB,kDAAuB;AACvB,oDAAyB;AACzB,iEAAsC;AACtC,oEAAyC;AACzC,0EAA+C;AAC/C,8DAAmC"}
|
|
@@ -19,7 +19,8 @@ export declare enum HtNodeWithContentType {
|
|
|
19
19
|
WEBVIEW = "webview",
|
|
20
20
|
GO_TO_FLOW = "go-to-flow",
|
|
21
21
|
CAPTURE_USER_INPUT = "capture-user-input",
|
|
22
|
-
CUSTOM_CONDITION = "custom-condition"
|
|
22
|
+
CUSTOM_CONDITION = "custom-condition",
|
|
23
|
+
DO_NOTHING = "do-nothing"
|
|
23
24
|
}
|
|
24
25
|
export declare enum HtNodeWithoutContentType {
|
|
25
26
|
URL = "url",
|
|
@@ -24,6 +24,7 @@ var HtNodeWithContentType;
|
|
|
24
24
|
HtNodeWithContentType["GO_TO_FLOW"] = "go-to-flow";
|
|
25
25
|
HtNodeWithContentType["CAPTURE_USER_INPUT"] = "capture-user-input";
|
|
26
26
|
HtNodeWithContentType["CUSTOM_CONDITION"] = "custom-condition";
|
|
27
|
+
HtNodeWithContentType["DO_NOTHING"] = "do-nothing";
|
|
27
28
|
})(HtNodeWithContentType || (exports.HtNodeWithContentType = HtNodeWithContentType = {}));
|
|
28
29
|
var HtNodeWithoutContentType;
|
|
29
30
|
(function (HtNodeWithoutContentType) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-types.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/node-types.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"node-types.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/node-types.ts"],"names":[],"mappings":";;;AAAA,IAAY,qBAuBX;AAvBD,WAAY,qBAAqB;IAC/B,8CAAqB,CAAA;IACrB,4CAAmB,CAAA;IACnB,wCAAe,CAAA;IACf,sCAAa,CAAA;IACb,4CAAmB,CAAA;IACnB,sDAA6B,CAAA;IAC7B,8CAAqB,CAAA;IACrB,8CAAqB,CAAA;IACrB,wCAAe,CAAA;IACf,sEAA6C,CAAA;IAC7C,4EAAmD,CAAA;IACnD,wFAA+D,CAAA;IAC/D,gEAAuC,CAAA;IACvC,kDAAyB,CAAA;IACzB,8CAAqB,CAAA;IACrB,4DAAmC,CAAA;IACnC,0CAAiB,CAAA;IACjB,4CAAmB,CAAA;IACnB,kDAAyB,CAAA;IACzB,kEAAyC,CAAA;IACzC,8DAAqC,CAAA;IACrC,kDAAyB,CAAA;AAC3B,CAAC,EAvBW,qBAAqB,qCAArB,qBAAqB,QAuBhC;AAED,IAAY,wBAGX;AAHD,WAAY,wBAAwB;IAClC,uCAAW,CAAA;IACX,+CAAmB,CAAA;AACrB,CAAC,EAHW,wBAAwB,wCAAxB,wBAAwB,QAGnC;AAED,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,kCAAiB,CAAA;IACjB,4CAA2B,CAAA;AAC7B,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB"}
|
|
@@ -4,6 +4,7 @@ import type { HtBotActionNode } from './bot-action';
|
|
|
4
4
|
import type { HtCaptureUserInputNode } from './capture-user-input';
|
|
5
5
|
import type { HtCarouselNode } from './carousel';
|
|
6
6
|
import type { HtCustomConditionalV2Node } from './custom-conditional-v2';
|
|
7
|
+
import type { HtDoNothingNode } from './do-nothing';
|
|
7
8
|
import type { HtFallbackNode } from './fallback';
|
|
8
9
|
import type { HtFunctionNode } from './function';
|
|
9
10
|
import type { HtGoToFlow } from './go-to-flow';
|
|
@@ -21,6 +22,6 @@ import type { HtWhatsappButtonListNode } from './whatsapp-button-list';
|
|
|
21
22
|
import type { HtWhatsappCTAUrlButtonNode } from './whatsapp-cta-url-button';
|
|
22
23
|
import type { HtWhatsappRequestContactInfoNode } from './whatsapp-request-contact-info';
|
|
23
24
|
import type { HtWhatsappTemplateNode } from './whatsapp-template';
|
|
24
|
-
export type HtNodeWithContent = HtTextNode | HtImageNode | HtVideoNode | HtCarouselNode | HtHandoffNode | HtKeywordNode | HtFunctionNode | HtFallbackNode | HtWhatsappButtonListNode | HtWhatsappCTAUrlButtonNode | HtWhatsappRequestContactInfoNode | HtSmartIntentNode | HtBotActionNode | HtAiAgentNode | HtAiAgentRouterNode | HtRatingNode | HtWebviewNode | HtGoToFlow | HtWhatsappTemplateNode | HtCaptureUserInputNode | HtCustomConditionalV2Node;
|
|
25
|
+
export type HtNodeWithContent = HtTextNode | HtImageNode | HtVideoNode | HtCarouselNode | HtHandoffNode | HtKeywordNode | HtFunctionNode | HtFallbackNode | HtWhatsappButtonListNode | HtWhatsappCTAUrlButtonNode | HtWhatsappRequestContactInfoNode | HtSmartIntentNode | HtBotActionNode | HtAiAgentNode | HtAiAgentRouterNode | HtRatingNode | HtWebviewNode | HtGoToFlow | HtWhatsappTemplateNode | HtCaptureUserInputNode | HtCustomConditionalV2Node | HtDoNothingNode;
|
|
25
26
|
export type HtNodeWithoutContent = HtUrlNode | HtPayloadNode;
|
|
26
27
|
export type HtNodeComponent = HtNodeWithContent | HtNodeWithoutContent;
|
|
@@ -7,6 +7,7 @@ import { FlowCarousel } from './flow-carousel';
|
|
|
7
7
|
import { FlowChannelConditional } from './flow-channel-conditional';
|
|
8
8
|
import { FlowCountryConditional } from './flow-country-conditional';
|
|
9
9
|
import { FlowCustomConditional } from './flow-custom-conditional';
|
|
10
|
+
import { FlowDoNothing } from './flow-do-nothing';
|
|
10
11
|
import { FlowGoToFlow } from './flow-go-to-flow';
|
|
11
12
|
import { FlowHandoff } from './flow-handoff';
|
|
12
13
|
import { FlowImage } from './flow-image';
|
|
@@ -21,5 +22,5 @@ import { FlowWhatsappButtonList, FlowWhatsappButtonListRow, FlowWhatsappButtonLi
|
|
|
21
22
|
export { ContentFieldsBase } from './content-fields-base';
|
|
22
23
|
export { FlowButton } from './flow-button';
|
|
23
24
|
export { FlowElement } from './flow-element';
|
|
24
|
-
export { FlowAiAgent, FlowAiAgentRouter, FlowBotAction, FlowCaptureUserInput, FlowCarousel, FlowChannelConditional, FlowCountryConditional, FlowCustomConditional, FlowCustomConditionalV2, FlowGoToFlow, FlowHandoff, FlowImage, FlowQueueStatusConditional, FlowRating, FlowText, FlowVideo, FlowWhatsappButtonList, FlowWhatsappButtonListRow, FlowWhatsappButtonListSection, FlowWhatsappCtaUrlButtonNode, FlowWhatsappRequestContactInfoNode, FlowWhatsappTemplate, };
|
|
25
|
-
export type FlowContent = FlowCarousel | FlowImage | FlowText | FlowVideo | FlowWhatsappButtonList | FlowWhatsappCtaUrlButtonNode | FlowWhatsappRequestContactInfoNode | FlowWhatsappTemplate | FlowHandoff | FlowBotAction | FlowAiAgent | FlowRating | FlowCountryConditional | FlowChannelConditional | FlowQueueStatusConditional | FlowCustomConditional | FlowGoToFlow | FlowCaptureUserInput | FlowAiAgentRouter | FlowCustomConditionalV2;
|
|
25
|
+
export { FlowAiAgent, FlowAiAgentRouter, FlowBotAction, FlowCaptureUserInput, FlowCarousel, FlowChannelConditional, FlowCountryConditional, FlowCustomConditional, FlowCustomConditionalV2, FlowDoNothing, FlowGoToFlow, FlowHandoff, FlowImage, FlowQueueStatusConditional, FlowRating, FlowText, FlowVideo, FlowWhatsappButtonList, FlowWhatsappButtonListRow, FlowWhatsappButtonListSection, FlowWhatsappCtaUrlButtonNode, FlowWhatsappRequestContactInfoNode, FlowWhatsappTemplate, };
|
|
26
|
+
export type FlowContent = FlowCarousel | FlowImage | FlowText | FlowVideo | FlowWhatsappButtonList | FlowWhatsappCtaUrlButtonNode | FlowWhatsappRequestContactInfoNode | FlowWhatsappTemplate | FlowHandoff | FlowBotAction | FlowAiAgent | FlowRating | FlowCountryConditional | FlowChannelConditional | FlowQueueStatusConditional | FlowCustomConditional | FlowGoToFlow | FlowCaptureUserInput | FlowAiAgentRouter | FlowCustomConditionalV2 | FlowDoNothing;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FlowWhatsappTemplate = exports.FlowWhatsappRequestContactInfoNode = exports.FlowWhatsappCtaUrlButtonNode = exports.FlowWhatsappButtonListSection = exports.FlowWhatsappButtonListRow = exports.FlowWhatsappButtonList = exports.FlowVideo = exports.FlowText = exports.FlowRating = exports.FlowQueueStatusConditional = exports.FlowImage = exports.FlowHandoff = exports.FlowGoToFlow = exports.FlowCustomConditionalV2 = exports.FlowCustomConditional = exports.FlowCountryConditional = exports.FlowChannelConditional = exports.FlowCarousel = exports.FlowCaptureUserInput = exports.FlowBotAction = exports.FlowAiAgentRouter = exports.FlowAiAgent = exports.FlowElement = exports.FlowButton = exports.ContentFieldsBase = void 0;
|
|
3
|
+
exports.FlowWhatsappTemplate = exports.FlowWhatsappRequestContactInfoNode = exports.FlowWhatsappCtaUrlButtonNode = exports.FlowWhatsappButtonListSection = exports.FlowWhatsappButtonListRow = exports.FlowWhatsappButtonList = exports.FlowVideo = exports.FlowText = exports.FlowRating = exports.FlowQueueStatusConditional = exports.FlowImage = exports.FlowHandoff = exports.FlowGoToFlow = exports.FlowDoNothing = exports.FlowCustomConditionalV2 = exports.FlowCustomConditional = exports.FlowCountryConditional = exports.FlowChannelConditional = exports.FlowCarousel = exports.FlowCaptureUserInput = exports.FlowBotAction = exports.FlowAiAgentRouter = exports.FlowAiAgent = exports.FlowElement = exports.FlowButton = exports.ContentFieldsBase = void 0;
|
|
4
4
|
const flow_custom_condition_v2_1 = require("./custom-conditional/flow-custom-condition-v2");
|
|
5
5
|
Object.defineProperty(exports, "FlowCustomConditionalV2", { enumerable: true, get: function () { return flow_custom_condition_v2_1.FlowCustomConditionalV2; } });
|
|
6
6
|
const flow_ai_agent_1 = require("./flow-ai-agent");
|
|
@@ -19,6 +19,8 @@ const flow_country_conditional_1 = require("./flow-country-conditional");
|
|
|
19
19
|
Object.defineProperty(exports, "FlowCountryConditional", { enumerable: true, get: function () { return flow_country_conditional_1.FlowCountryConditional; } });
|
|
20
20
|
const flow_custom_conditional_1 = require("./flow-custom-conditional");
|
|
21
21
|
Object.defineProperty(exports, "FlowCustomConditional", { enumerable: true, get: function () { return flow_custom_conditional_1.FlowCustomConditional; } });
|
|
22
|
+
const flow_do_nothing_1 = require("./flow-do-nothing");
|
|
23
|
+
Object.defineProperty(exports, "FlowDoNothing", { enumerable: true, get: function () { return flow_do_nothing_1.FlowDoNothing; } });
|
|
22
24
|
const flow_go_to_flow_1 = require("./flow-go-to-flow");
|
|
23
25
|
Object.defineProperty(exports, "FlowGoToFlow", { enumerable: true, get: function () { return flow_go_to_flow_1.FlowGoToFlow; } });
|
|
24
26
|
const flow_handoff_1 = require("./flow-handoff");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content-fields/index.ts"],"names":[],"mappings":";;;AAAA,4FAAuF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content-fields/index.ts"],"names":[],"mappings":";;;AAAA,4FAAuF;AAsCrF,wGAtCO,kDAAuB,OAsCP;AArCzB,mDAA6C;AA6B3C,4FA7BO,2BAAW,OA6BP;AA5Bb,iEAA0D;AA6BxD,kGA7BO,wCAAiB,OA6BP;AA5BnB,uDAAiD;AA6B/C,8FA7BO,+BAAa,OA6BP;AA5Bf,uEAAgE;AA6B9D,qGA7BO,8CAAoB,OA6BP;AA5BtB,mDAA8C;AA6B5C,6FA7BO,4BAAY,OA6BP;AA5Bd,yEAAmE;AA6BjE,uGA7BO,iDAAsB,OA6BP;AA5BxB,yEAAmE;AA6BjE,uGA7BO,iDAAsB,OA6BP;AA5BxB,uEAAiE;AA6B/D,sGA7BO,+CAAqB,OA6BP;AA5BvB,uDAAiD;AA8B/C,8FA9BO,+BAAa,OA8BP;AA7Bf,uDAAgD;AA8B9C,6FA9BO,8BAAY,OA8BP;AA7Bd,iDAA4C;AA8B1C,4FA9BO,0BAAW,OA8BP;AA7Bb,6CAAwC;AA8BtC,0FA9BO,sBAAS,OA8BP;AA7BX,mFAA4E;AA8B1E,2GA9BO,0DAA0B,OA8BP;AA7B5B,+CAA0C;AA8BxC,2FA9BO,wBAAU,OA8BP;AA7BZ,2CAAsC;AA8BpC,yFA9BO,oBAAQ,OA8BP;AA7BV,6CAAwC;AA8BtC,0FA9BO,sBAAS,OA8BP;AA7BX,iFAA6E;AAiC3E,6GAjCO,2DAA4B,OAiCP;AAhC9B,6FAAyF;AAiCvF,mHAjCO,uEAAkC,OAiCP;AAhCpC,qEAA+D;AAiC7D,qGAjCO,6CAAoB,OAiCP;AAhCtB,iEAI+B;AAuB7B,uGA1BA,6CAAsB,OA0BA;AACtB,0GA1BA,gDAAyB,OA0BA;AACzB,8GA1BA,oDAA6B,OA0BA;AAvB/B,6DAAyD;AAAhD,wHAAA,iBAAiB,OAAA;AAC1B,6CAA0C;AAAjC,yGAAA,UAAU,OAAA;AACnB,+CAA4C;AAAnC,2GAAA,WAAW,OAAA"}
|
package/lib/esm/flow-factory.js
CHANGED
|
@@ -46,6 +46,8 @@ class FlowFactory {
|
|
|
46
46
|
return flow_capture_user_input_1.FlowCaptureUserInput.fromHubtypeCMS(hubtypeContent);
|
|
47
47
|
case hubtype_fields_1.HtNodeWithContentType.CUSTOM_CONDITION:
|
|
48
48
|
return content_fields_1.FlowCustomConditionalV2.fromHubtypeCMS(hubtypeContent, this.botContext);
|
|
49
|
+
case hubtype_fields_1.HtNodeWithContentType.DO_NOTHING:
|
|
50
|
+
return content_fields_1.FlowDoNothing.fromHubtypeCMS(hubtypeContent);
|
|
49
51
|
default:
|
|
50
52
|
return undefined;
|
|
51
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-factory.js","sourceRoot":"","sources":["../../src/flow-factory.ts"],"names":[],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"flow-factory.js","sourceRoot":"","sources":["../../src/flow-factory.ts"],"names":[],"mappings":";;;AAGA,qDAsByB;AACzB,sFAA+E;AAC/E,oEAIwC;AAExC,MAAa,WAAW;IAKtB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AAS,CAAA;QACpB,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,0BAA0B,CACtC,cAA8B;QAE9B,QAAQ,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACtC,KAAK,eAAe;gBAClB,OAAO,uCAAsB,CAAC,cAAc,CAC1C,cAAc,EACd,IAAI,CAAC,UAAU,CAChB,CAAA;YACH,KAAK,kBAAkB;gBACrB,OAAO,uCAAsB,CAAC,cAAc,CAC1C,cAAc,EACd,IAAI,CAAC,UAAU,CAChB,CAAA;YACH,KAAK,oBAAoB;gBACvB,OAAO,2CAA0B,CAAC,cAAc,CAC9C,cAAc,EACd,IAAI,CAAC,MAAM,CACZ,CAAA;YACH,KAAK,oBAAoB;gBACvB,OAAO,sCAAqB,CAAC,cAAc,CACzC,cAAc,EACd,IAAI,CAAC,UAAU,CAChB,CAAA;YACH;gBACE,OAAO,SAAS,CAAA;QACpB,CAAC;IACH,CAAC;CACF;AA5HD,kCA4HC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botonic/plugin-flow-builder",
|
|
3
|
-
"version": "0.56.0
|
|
3
|
+
"version": "0.56.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",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"format": "biome format --write src/ tests/"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@botonic/react": "0.56.0
|
|
18
|
+
"@botonic/react": "^0.56.0",
|
|
19
19
|
"axios": "^1.18.1",
|
|
20
20
|
"uuid": "^10.0.0"
|
|
21
21
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NluType } from '@botonic/core'
|
|
1
2
|
import type { FlowContent } from '../content-fields/index'
|
|
2
3
|
import { splitAiAgentContents } from '../utils/ai-agent'
|
|
3
4
|
import type { FlowBuilderContext } from './context'
|
|
@@ -46,5 +47,11 @@ export async function getContentsByAiAgentFromUserInput({
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
|
|
50
|
+
request.input.nluResolution = {
|
|
51
|
+
type: NluType.AiAgent,
|
|
52
|
+
matchedValue: 'ai-agent-from-user-input',
|
|
53
|
+
payload: undefined,
|
|
54
|
+
}
|
|
55
|
+
|
|
49
56
|
return contents
|
|
50
57
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NluType } from '@botonic/core'
|
|
1
2
|
import type { FlowBuilderApi } from '../api'
|
|
2
3
|
import { MAIN_FLOW_NAME } from '../constants'
|
|
3
4
|
import {
|
|
@@ -51,6 +52,11 @@ export async function getContentsByFirstInteraction(
|
|
|
51
52
|
if (request.input.nluResolution || inputHasTextOrTranscript(request.input)) {
|
|
52
53
|
const contentsByUserInput = await getContentsByUserInput(context)
|
|
53
54
|
|
|
55
|
+
if (request.input.nluResolution?.type === NluType.AiAgent) {
|
|
56
|
+
const startContents = await flowBuilderPlugin.getStartContents()
|
|
57
|
+
return [...startContents, ...contentsByUserInput]
|
|
58
|
+
}
|
|
59
|
+
|
|
54
60
|
return [...firstInteractionContents, ...contentsByUserInput]
|
|
55
61
|
}
|
|
56
62
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { BotContext } from '@botonic/core'
|
|
2
|
+
|
|
3
|
+
import { trackOneContent } from '../tracking'
|
|
4
|
+
import { ContentFieldsBase } from './content-fields-base'
|
|
5
|
+
import type { HtDoNothingNode } from './hubtype-fields'
|
|
6
|
+
|
|
7
|
+
export class FlowDoNothing extends ContentFieldsBase {
|
|
8
|
+
static fromHubtypeCMS(cmsDoNothing: HtDoNothingNode): FlowDoNothing {
|
|
9
|
+
const newDoNothing = new FlowDoNothing(cmsDoNothing.id)
|
|
10
|
+
newDoNothing.code = cmsDoNothing.code
|
|
11
|
+
newDoNothing.followUp = cmsDoNothing.follow_up
|
|
12
|
+
|
|
13
|
+
return newDoNothing
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async trackFlow(botContext: BotContext): Promise<void> {
|
|
17
|
+
await trackOneContent(botContext, this)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async processContent(botContext: BotContext): Promise<void> {
|
|
21
|
+
await this.filterContent(botContext, this)
|
|
22
|
+
await this.trackFlow(botContext)
|
|
23
|
+
return
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
toBotonic(): JSX.Element {
|
|
27
|
+
return <></>
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -4,6 +4,7 @@ import type { HtBotActionNode } from './bot-action'
|
|
|
4
4
|
import type { HtCaptureUserInputNode } from './capture-user-input'
|
|
5
5
|
import type { HtCarouselNode } from './carousel'
|
|
6
6
|
import type { HtCustomConditionalV2Node } from './custom-conditional-v2'
|
|
7
|
+
import type { HtDoNothingNode } from './do-nothing'
|
|
7
8
|
// import { HtChannelConditionalNode } from './channel-conditional'
|
|
8
9
|
// import { HtCountryConditionalNode } from './country-conditional'
|
|
9
10
|
// import { HtCustomConditionalNode } from './custom-conditional'
|
|
@@ -48,6 +49,7 @@ export type HtNodeWithContent =
|
|
|
48
49
|
| HtWhatsappTemplateNode
|
|
49
50
|
| HtCaptureUserInputNode
|
|
50
51
|
| HtCustomConditionalV2Node
|
|
52
|
+
| HtDoNothingNode
|
|
51
53
|
// | HtChannelConditionalNode
|
|
52
54
|
// | HtCountryConditionalNode
|
|
53
55
|
// | HtCustomConditionalNode
|
|
@@ -7,6 +7,7 @@ import { FlowCarousel } from './flow-carousel'
|
|
|
7
7
|
import { FlowChannelConditional } from './flow-channel-conditional'
|
|
8
8
|
import { FlowCountryConditional } from './flow-country-conditional'
|
|
9
9
|
import { FlowCustomConditional } from './flow-custom-conditional'
|
|
10
|
+
import { FlowDoNothing } from './flow-do-nothing'
|
|
10
11
|
import { FlowGoToFlow } from './flow-go-to-flow'
|
|
11
12
|
import { FlowHandoff } from './flow-handoff'
|
|
12
13
|
import { FlowImage } from './flow-image'
|
|
@@ -36,6 +37,7 @@ export {
|
|
|
36
37
|
FlowCountryConditional,
|
|
37
38
|
FlowCustomConditional,
|
|
38
39
|
FlowCustomConditionalV2,
|
|
40
|
+
FlowDoNothing,
|
|
39
41
|
FlowGoToFlow,
|
|
40
42
|
FlowHandoff,
|
|
41
43
|
FlowImage,
|
|
@@ -72,3 +74,4 @@ export type FlowContent =
|
|
|
72
74
|
| FlowCaptureUserInput
|
|
73
75
|
| FlowAiAgentRouter
|
|
74
76
|
| FlowCustomConditionalV2
|
|
77
|
+
| FlowDoNothing
|
package/src/flow-factory.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
FlowCountryConditional,
|
|
12
12
|
FlowCustomConditional,
|
|
13
13
|
FlowCustomConditionalV2,
|
|
14
|
+
FlowDoNothing,
|
|
14
15
|
FlowGoToFlow,
|
|
15
16
|
FlowHandoff,
|
|
16
17
|
FlowImage,
|
|
@@ -118,6 +119,9 @@ export class FlowFactory {
|
|
|
118
119
|
this.botContext
|
|
119
120
|
)
|
|
120
121
|
|
|
122
|
+
case HtNodeWithContentType.DO_NOTHING:
|
|
123
|
+
return FlowDoNothing.fromHubtypeCMS(hubtypeContent)
|
|
124
|
+
|
|
121
125
|
default:
|
|
122
126
|
return undefined
|
|
123
127
|
}
|