@botonic/plugin-flow-builder 0.25.0-alpha.0 → 0.25.0-alpha.2
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/index.js +2 -1
- package/lib/cjs/action/index.js.map +1 -1
- package/lib/cjs/content-fields/flow-button.js +3 -4
- package/lib/cjs/content-fields/flow-button.js.map +1 -1
- package/lib/cjs/content-fields/flow-carousel.js +2 -3
- package/lib/cjs/content-fields/flow-carousel.js.map +1 -1
- package/lib/cjs/content-fields/flow-element.js +2 -7
- package/lib/cjs/content-fields/flow-element.js.map +1 -1
- package/lib/cjs/content-fields/flow-handoff.js +2 -3
- package/lib/cjs/content-fields/flow-handoff.js.map +1 -1
- package/lib/cjs/content-fields/flow-image.js +2 -3
- package/lib/cjs/content-fields/flow-image.js.map +1 -1
- package/lib/cjs/content-fields/flow-text.js +2 -5
- package/lib/cjs/content-fields/flow-text.js.map +1 -1
- package/lib/cjs/content-fields/flow-video.js +2 -3
- package/lib/cjs/content-fields/flow-video.js.map +1 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +2 -3
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
- package/lib/esm/action/index.js +28 -19
- package/lib/esm/action/index.js.map +1 -1
- package/lib/esm/action/intent.js +8 -4
- package/lib/esm/action/intent.js.map +1 -1
- package/lib/esm/action/keyword.js +7 -3
- package/lib/esm/action/keyword.js.map +1 -1
- package/lib/esm/action/knowledge-bases.js +14 -10
- package/lib/esm/action/knowledge-bases.js.map +1 -1
- package/lib/esm/action/tracking.js +9 -5
- package/lib/esm/action/tracking.js.map +1 -1
- package/lib/esm/action/user-input.js +9 -5
- package/lib/esm/action/user-input.js.map +1 -1
- package/lib/esm/api.js +25 -16
- package/lib/esm/api.js.map +1 -1
- package/lib/esm/constants.js +6 -3
- package/lib/esm/constants.js.map +1 -1
- package/lib/esm/content-fields/content-fields-base.js +9 -7
- package/lib/esm/content-fields/content-fields-base.js.map +1 -1
- package/lib/esm/content-fields/flow-button.js +19 -18
- package/lib/esm/content-fields/flow-button.js.map +1 -1
- package/lib/esm/content-fields/flow-carousel.js +13 -12
- package/lib/esm/content-fields/flow-carousel.js.map +1 -1
- package/lib/esm/content-fields/flow-element.js +16 -19
- package/lib/esm/content-fields/flow-element.js.map +1 -1
- package/lib/esm/content-fields/flow-handoff.js +21 -14
- package/lib/esm/content-fields/flow-handoff.js.map +1 -1
- package/lib/esm/content-fields/flow-image.js +11 -10
- package/lib/esm/content-fields/flow-image.js.map +1 -1
- package/lib/esm/content-fields/flow-text.js +20 -22
- package/lib/esm/content-fields/flow-text.js.map +1 -1
- package/lib/esm/content-fields/flow-video.js +11 -10
- package/lib/esm/content-fields/flow-video.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/bot-action.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/button.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/carousel.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/common.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/fallback.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/function.js +5 -2
- package/lib/esm/content-fields/hubtype-fields/function.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/handoff.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/image.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/index.js +21 -18
- package/lib/esm/content-fields/hubtype-fields/index.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/intent.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/keyword.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/node-types.js +9 -6
- package/lib/esm/content-fields/hubtype-fields/node-types.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/nodes.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/payload.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/text.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/url.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/video.js +2 -1
- package/lib/esm/content-fields/hubtype-fields/whatsapp-button-list.js +2 -1
- package/lib/esm/content-fields/index.js +21 -10
- package/lib/esm/content-fields/index.js.map +1 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +12 -11
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +10 -9
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +15 -14
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
- package/lib/esm/functions/conditional-provider.js +5 -1
- package/lib/esm/functions/conditional-provider.js.map +1 -1
- package/lib/esm/functions/conditional-queue-status.js +10 -4
- package/lib/esm/functions/conditional-queue-status.js.map +1 -1
- package/lib/esm/functions/index.js +8 -5
- package/lib/esm/functions/index.js.map +1 -1
- package/lib/esm/helpers.js +5 -1
- package/lib/esm/helpers.js.map +1 -1
- package/lib/esm/index.js +48 -35
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/types.js +5 -2
- package/lib/esm/types.js.map +1 -1
- package/lib/esm/utils.js +8 -4
- package/lib/esm/utils.js.map +1 -1
- package/package.json +3 -3
package/lib/cjs/action/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowBuilderMultichannelAction = exports.FlowBuilderAction = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
6
|
const react_1 = require("@botonic/react");
|
|
6
7
|
const react_2 = tslib_1.__importDefault(require("react"));
|
|
7
8
|
const content_fields_1 = require("../content-fields");
|
|
@@ -29,7 +30,7 @@ exports.FlowBuilderAction = FlowBuilderAction;
|
|
|
29
30
|
class FlowBuilderMultichannelAction extends FlowBuilderAction {
|
|
30
31
|
render() {
|
|
31
32
|
const { contents } = this.props;
|
|
32
|
-
return (
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Multichannel, { text: { buttonsAsText: false }, children: contents.map(content => content.toBotonic(content.id)) }));
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
exports.FlowBuilderMultichannelAction = FlowBuilderMultichannelAction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/action/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/action/index.tsx"],"names":[],"mappings":";;;;;AAAA,0CAA4E;AAC5E,0DAAyB;AAGzB,sDAA4D;AAE5D,wCAAiD;AACjD,uDAA+D;AAC/D,yCAAkD;AAMlD,MAAa,iBAAkB,SAAQ,eAAK,CAAC,SAAiC;IAC5E,MAAM,CAAC,WAAW,GAAG,sBAAc,CAAA;IAEnC,MAAM,CAAC,KAAK,CAAC,WAAW,CACtB,OAAsB;QAEtB,MAAM,iBAAiB,GAAG,IAAA,8BAAoB,EAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAC/D,MAAM,MAAM,GAAG,iBAAiB,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAE3D,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAEzE,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC,iBAAiB,CACxD,UAAU,EACV,MAAM,CACP,CAAA;QAED,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAClC,OAAO,CAAC,EAAE,CAAC,OAAO,YAAY,4BAAW,CAC3B,CAAA;QAChB,IAAI,cAAc;YAAE,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,OAAO,EAAE,oBAAS,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;QACtD,OAAO,UAAU,CAAA;KAClB;IACD,OAAO,MAAM,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAC/C,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,MAAsB,EAAE,OAAsB;IAC3E,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,qBAAqB,KAAK,SAAS,EAAE;QACxE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,GAAG;YAChC,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU;YAClC,qBAAqB,EAAE,IAAI;SAC5B,CAAA;KACF;IAED,MAAM,iBAAiB,GAAG,MAAM,IAAA,6CAA2B,EAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5E,IAAI,iBAAiB,EAAE;QACrB,OAAO,iBAAiB,CAAA;KACzB;IAED,MAAM,qBAAqB,GACzB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAA;IACzD,MAAM,YAAY,GAAG,MAAM,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAA;IAClE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAqB,GAAG,CAAC,qBAAqB,CAAA;IAE9E,MAAM,IAAA,qBAAU,EAAC,OAAO,EAAE,oBAAS,CAAC,QAAQ,CAAC,CAAA;IAC7C,OAAO,YAAY,CAAA;AACrB,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowButton = void 0;
|
|
4
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("@botonic/react");
|
|
6
|
-
const react_2 = tslib_1.__importDefault(require("react"));
|
|
7
6
|
const constants_1 = require("../constants");
|
|
8
7
|
const content_fields_base_1 = require("./content-fields-base");
|
|
9
8
|
const hubtype_fields_1 = require("./hubtype-fields");
|
|
@@ -38,9 +37,9 @@ class FlowButton extends content_fields_base_1.ContentFieldsBase {
|
|
|
38
37
|
}
|
|
39
38
|
renderButton(buttonIndex, buttonStyle) {
|
|
40
39
|
if (buttonStyle === hubtype_fields_1.HtButtonStyle.QUICK_REPLY) {
|
|
41
|
-
return (
|
|
40
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Reply, { payload: this.getButtonPayload(buttonIndex), children: this.text }, this.id));
|
|
42
41
|
}
|
|
43
|
-
return (
|
|
42
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Button, { url: this.url, payload: this.getButtonPayload(buttonIndex), children: this.text }, this.id));
|
|
44
43
|
}
|
|
45
44
|
getButtonPayload(buttonIndex) {
|
|
46
45
|
return this.payload
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-button.js","sourceRoot":"","sources":["../../../src/content-fields/flow-button.tsx"],"names":[],"mappings":";;;;AAAA,0CAA8C;
|
|
1
|
+
{"version":3,"file":"flow-button.js","sourceRoot":"","sources":["../../../src/content-fields/flow-button.tsx"],"names":[],"mappings":";;;;AAAA,0CAA8C;AAI9C,4CAAoD;AACpD,+DAAyD;AACzD,qDAKyB;AAEzB,MAAa,UAAW,SAAQ,uCAAiB;IACxC,IAAI,GAAG,EAAE,CAAA;IACT,GAAG,CAAS;IACZ,OAAO,CAAS;IAEvB,MAAM,CAAC,cAAc,CACnB,SAAmB,EACnB,MAAc,EACd,MAAsB;QAEtB,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;QACtD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;QAE9C,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAC9C,SAAS,CAA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CACT,CAAA;SACF;QACD,OAAO,CACL,uBAAC,cAAM,IAEL,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,YAE1C,IAAI,CAAC,IAAI,IAJL,IAAI,CAAC,EAAE,CAKL,CACV,CAAA;IACH,CAAC;IAEO,gBAAgB,CAAC,WAAmB;QAC1C,OAAO,IAAI,CAAC,OAAO;YACjB,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,GAAG,iCAAqB,GAAG,WAAW,EAAE;YACzD,CAAC,CAAC,SAAS,CAAA;IACf,CAAC;CACF;AAhED,gCAgEC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowCarousel = void 0;
|
|
4
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("@botonic/react");
|
|
6
|
-
const react_2 = tslib_1.__importDefault(require("react"));
|
|
7
6
|
const content_fields_base_1 = require("./content-fields-base");
|
|
8
7
|
const flow_element_1 = require("./flow-element");
|
|
9
8
|
class FlowCarousel extends content_fields_base_1.ContentFieldsBase {
|
|
@@ -16,7 +15,7 @@ class FlowCarousel extends content_fields_base_1.ContentFieldsBase {
|
|
|
16
15
|
return newCarousel;
|
|
17
16
|
}
|
|
18
17
|
toBotonic(id) {
|
|
19
|
-
return (
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Carousel, { children: this.elements.map(element => element.toBotonic(id)) }, id));
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
21
|
exports.FlowCarousel = FlowCarousel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-carousel.js","sourceRoot":"","sources":["../../../src/content-fields/flow-carousel.tsx"],"names":[],"mappings":";;;;AAAA,0CAAyC;
|
|
1
|
+
{"version":3,"file":"flow-carousel.js","sourceRoot":"","sources":["../../../src/content-fields/flow-carousel.tsx"],"names":[],"mappings":";;;;AAAA,0CAAyC;AAIzC,+DAAyD;AACzD,iDAA4C;AAG5C,MAAa,YAAa,SAAQ,uCAAiB;IAC1C,IAAI,GAAG,EAAE,CAAA;IACT,QAAQ,GAAkB,EAAE,CAAA;IAEnC,MAAM,CAAC,cAAc,CACnB,SAAyB,EACzB,MAAc,EACd,MAAsB;QAEtB,MAAM,WAAW,GAAG,IAAI,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAClD,WAAW,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;QACjC,WAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAC9D,0BAAW,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CACpD,CAAA;QACD,OAAO,WAAW,CAAA;IACpB,CAAC;IAED,SAAS,CAAC,EAAU;QAClB,OAAO,CACL,uBAAC,gBAAQ,cACN,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,IADvC,EAAE,CAEN,CACZ,CAAA;IACH,CAAC;CACF;AAxBD,oCAwBC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowElement = void 0;
|
|
4
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("@botonic/react");
|
|
6
|
-
const react_2 = tslib_1.__importDefault(require("react"));
|
|
7
6
|
const content_fields_base_1 = require("./content-fields-base");
|
|
8
7
|
const flow_button_1 = require("./flow-button");
|
|
9
8
|
class FlowElement extends content_fields_base_1.ContentFieldsBase {
|
|
@@ -21,11 +20,7 @@ class FlowElement extends content_fields_base_1.ContentFieldsBase {
|
|
|
21
20
|
return newElement;
|
|
22
21
|
}
|
|
23
22
|
toBotonic(parentId) {
|
|
24
|
-
return (
|
|
25
|
-
react_2.default.createElement(react_1.Pic, { src: this.image }),
|
|
26
|
-
react_2.default.createElement(react_1.Title, null, this.title),
|
|
27
|
-
react_2.default.createElement(react_1.Subtitle, null, this.subtitle),
|
|
28
|
-
this.button?.renderButton(0)));
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Element, { children: [(0, jsx_runtime_1.jsx)(react_1.Pic, { src: this.image }), (0, jsx_runtime_1.jsx)(react_1.Title, { children: this.title }), (0, jsx_runtime_1.jsx)(react_1.Subtitle, { children: this.subtitle }), this.button?.renderButton(0)] }, `${parentId}-${this.id}`));
|
|
29
24
|
}
|
|
30
25
|
}
|
|
31
26
|
exports.FlowElement = FlowElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-element.js","sourceRoot":"","sources":["../../../src/content-fields/flow-element.tsx"],"names":[],"mappings":";;;;AAAA,0CAA8D;
|
|
1
|
+
{"version":3,"file":"flow-element.js","sourceRoot":"","sources":["../../../src/content-fields/flow-element.tsx"],"names":[],"mappings":";;;;AAAA,0CAA8D;AAI9D,+DAAyD;AACzD,+CAA0C;AAG1C,MAAa,WAAY,SAAQ,uCAAiB;IACzC,KAAK,GAAG,EAAE,CAAA;IACV,QAAQ,GAAG,EAAE,CAAA;IACb,MAAM,CAAwB;IAC9B,KAAK,GAAG,EAAE,CAAA;IACV,MAAM,GAAG,KAAK,CAAA;IAErB,MAAM,CAAC,cAAc,CACnB,SAA4B,EAC5B,MAAc,EACd,MAAsB;QAEtB,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAChD,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAA;QAChE,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAA;QACtE,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAA;QACjE,UAAU,CAAC,MAAM,GAAG,wBAAU,CAAC,cAAc,CAC3C,SAAS,CAAC,MAAM,EAChB,MAAM,EACN,MAAM,CACP,CAAA;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;IAED,SAAS,CAAC,QAAgB;QACxB,OAAO,CACL,wBAAC,eAAO,eACN,uBAAC,WAAG,IAAC,GAAG,EAAE,IAAI,CAAC,KAAK,GAAI,EACxB,uBAAC,aAAK,cAAE,IAAI,CAAC,KAAK,GAAS,EAC3B,uBAAC,gBAAQ,cAAE,IAAI,CAAC,QAAQ,GAAY,EACnC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,KAJjB,GAAG,QAAQ,IAAI,IAAI,CAAC,EAAE,EAAE,CAK5B,CACX,CAAA;IACH,CAAC;CACF;AAlCD,kCAkCC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowHandoff = void 0;
|
|
4
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const core_1 = require("@botonic/core");
|
|
6
6
|
const react_1 = require("@botonic/react");
|
|
7
|
-
const react_2 = tslib_1.__importDefault(require("react"));
|
|
8
7
|
const tracking_1 = require("../action/tracking");
|
|
9
8
|
const conditional_queue_status_1 = require("../functions/conditional-queue-status");
|
|
10
9
|
const content_fields_base_1 = require("./content-fields-base");
|
|
@@ -53,7 +52,7 @@ class FlowHandoff extends content_fields_base_1.ContentFieldsBase {
|
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
toBotonic() {
|
|
56
|
-
return
|
|
55
|
+
return (0, jsx_runtime_1.jsx)(react_1.WebchatSettings, { enableUserInput: true });
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
58
|
exports.FlowHandoff = FlowHandoff;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-handoff.js","sourceRoot":"","sources":["../../../src/content-fields/flow-handoff.tsx"],"names":[],"mappings":";;;;AAAA,wCAA8C;AAC9C,0CAA+D;
|
|
1
|
+
{"version":3,"file":"flow-handoff.js","sourceRoot":"","sources":["../../../src/content-fields/flow-handoff.tsx"],"names":[],"mappings":";;;;AAAA,wCAA8C;AAC9C,0CAA+D;AAG/D,iDAA0D;AAE1D,oFAA4E;AAC5E,+DAAyD;AAGzD,MAAa,WAAY,SAAQ,uCAAiB;IACzC,IAAI,CAAQ;IACZ,KAAK,CAAgB;IACrB,eAAe,CAAS;IACxB,iBAAiB,CAAS;IAEjC,MAAM,CAAC,cAAc,CACnB,UAAyB,EACzB,MAAc,EACd,MAAsB;QAEtB,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;QACjD,UAAU,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;QACjC,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAC1E,UAAU,CAAC,eAAe,GAAG,IAAI,CAAC,kBAAkB,CAClD,UAAU,EACV,MAAM,EACN,MAAM,CACP,CAAA;QACD,UAAU,CAAC,iBAAiB,GAAG,UAAU,CAAC,OAAO,CAAC,eAAe,CAAA;QAEjE,OAAO,UAAU,CAAA;IACnB,CAAC;IAEO,MAAM,CAAC,kBAAkB,CAC/B,UAAyB,EACzB,MAAc,EACd,MAAsB;QAEtB,IAAI,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE;YACzB,OAAO,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;SAC5C;QAED,cAAc;QACd,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,CAAA;IACnD,CAAC;CACF;AAtED,kCAsEC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowImage = void 0;
|
|
4
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("@botonic/react");
|
|
6
|
-
const react_2 = tslib_1.__importDefault(require("react"));
|
|
7
6
|
const content_fields_base_1 = require("./content-fields-base");
|
|
8
7
|
class FlowImage extends content_fields_base_1.ContentFieldsBase {
|
|
9
8
|
src = '';
|
|
@@ -15,7 +14,7 @@ class FlowImage extends content_fields_base_1.ContentFieldsBase {
|
|
|
15
14
|
return newImage;
|
|
16
15
|
}
|
|
17
16
|
toBotonic(id) {
|
|
18
|
-
return
|
|
17
|
+
return (0, jsx_runtime_1.jsx)(react_1.Image, { src: this.src }, id);
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
exports.FlowImage = FlowImage;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-image.js","sourceRoot":"","sources":["../../../src/content-fields/flow-image.tsx"],"names":[],"mappings":";;;;AAAA,0CAAsC;
|
|
1
|
+
{"version":3,"file":"flow-image.js","sourceRoot":"","sources":["../../../src/content-fields/flow-image.tsx"],"names":[],"mappings":";;;;AAAA,0CAAsC;AAGtC,+DAAyD;AAGzD,MAAa,SAAU,SAAQ,uCAAiB;IACvC,GAAG,GAAG,EAAE,CAAA;IACR,IAAI,GAAG,EAAE,CAAA;IAEhB,MAAM,CAAC,cAAc,CAAC,SAAsB,EAAE,MAAc;QAC1D,MAAM,QAAQ,GAAG,IAAI,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAC5C,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;QAC9B,QAAQ,CAAC,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QACrE,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,SAAS,CAAC,EAAU;QAClB,OAAO,uBAAC,aAAK,IAAU,GAAG,EAAE,IAAI,CAAC,GAAG,IAAjB,EAAE,CAAmB,CAAA;IAC1C,CAAC;CACF;AAdD,8BAcC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowText = void 0;
|
|
4
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("@botonic/react");
|
|
6
|
-
const react_2 = tslib_1.__importDefault(require("react"));
|
|
7
6
|
const constants_1 = require("../constants");
|
|
8
7
|
const content_fields_base_1 = require("./content-fields-base");
|
|
9
8
|
const flow_button_1 = require("./flow-button");
|
|
@@ -34,9 +33,7 @@ class FlowText extends content_fields_base_1.ContentFieldsBase {
|
|
|
34
33
|
return replacedText;
|
|
35
34
|
}
|
|
36
35
|
toBotonic(id) {
|
|
37
|
-
return (
|
|
38
|
-
this.text,
|
|
39
|
-
this.buttons.map((button, buttonIndex) => button.renderButton(buttonIndex, this.buttonStyle))));
|
|
36
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Text, { children: [this.text, this.buttons.map((button, buttonIndex) => button.renderButton(buttonIndex, this.buttonStyle))] }, id));
|
|
40
37
|
}
|
|
41
38
|
}
|
|
42
39
|
exports.FlowText = FlowText;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-text.js","sourceRoot":"","sources":["../../../src/content-fields/flow-text.tsx"],"names":[],"mappings":";;;;AAAA,0CAAqC;
|
|
1
|
+
{"version":3,"file":"flow-text.js","sourceRoot":"","sources":["../../../src/content-fields/flow-text.tsx"],"names":[],"mappings":";;;;AAAA,0CAAqC;AAIrC,4CAA6C;AAC7C,+DAAyD;AACzD,+CAA0C;AAC1C,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AAC,QAAQ,CAAC,IAAI,KAAK,CAAA;gBAC1C,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;YACnD,CAAC,CAAC,CAAA;SACH;QAED,OAAO,YAAY,CAAA;IACrB,CAAC;IAED,SAAS,CAAC,EAAU;QAClB,OAAO,CACL,wBAAC,YAAI,eACF,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE,CACxC,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CACnD,KAJQ,EAAE,CAKN,CACR,CAAA;IACH,CAAC;CACF;AApDD,4BAoDC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowVideo = void 0;
|
|
4
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("@botonic/react");
|
|
6
|
-
const react_2 = tslib_1.__importDefault(require("react"));
|
|
7
6
|
const content_fields_base_1 = require("./content-fields-base");
|
|
8
7
|
class FlowVideo extends content_fields_base_1.ContentFieldsBase {
|
|
9
8
|
src = '';
|
|
@@ -15,7 +14,7 @@ class FlowVideo extends content_fields_base_1.ContentFieldsBase {
|
|
|
15
14
|
return newVideo;
|
|
16
15
|
}
|
|
17
16
|
toBotonic(id) {
|
|
18
|
-
return
|
|
17
|
+
return (0, jsx_runtime_1.jsx)(react_1.Video, { src: this.src }, id);
|
|
19
18
|
}
|
|
20
19
|
}
|
|
21
20
|
exports.FlowVideo = FlowVideo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-video.js","sourceRoot":"","sources":["../../../src/content-fields/flow-video.tsx"],"names":[],"mappings":";;;;AAAA,0CAAsC;
|
|
1
|
+
{"version":3,"file":"flow-video.js","sourceRoot":"","sources":["../../../src/content-fields/flow-video.tsx"],"names":[],"mappings":";;;;AAAA,0CAAsC;AAGtC,+DAAyD;AAGzD,MAAa,SAAU,SAAQ,uCAAiB;IACvC,GAAG,GAAG,EAAE,CAAA;IACR,IAAI,GAAG,EAAE,CAAA;IAEhB,MAAM,CAAC,cAAc,CAAC,SAAsB,EAAE,MAAc;QAC1D,MAAM,QAAQ,GAAG,IAAI,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAC5C,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;QAC9B,QAAQ,CAAC,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QACrE,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,SAAS,CAAC,EAAU;QAClB,OAAO,uBAAC,aAAK,IAAU,GAAG,EAAE,IAAI,CAAC,GAAG,IAAjB,EAAE,CAAmB,CAAA;IAC1C,CAAC;CACF;AAdD,8BAcC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowWhatsappButtonList = void 0;
|
|
4
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("@botonic/react");
|
|
6
|
-
const react_2 = tslib_1.__importDefault(require("react"));
|
|
7
6
|
const content_fields_base_1 = require("./../content-fields-base");
|
|
8
7
|
const flow_whatsapp_button_list_section_1 = require("./flow-whatsapp-button-list-section");
|
|
9
8
|
class FlowWhatsappButtonList extends content_fields_base_1.ContentFieldsBase {
|
|
@@ -20,7 +19,7 @@ class FlowWhatsappButtonList extends content_fields_base_1.ContentFieldsBase {
|
|
|
20
19
|
return newWhatsappButtonList;
|
|
21
20
|
}
|
|
22
21
|
toBotonic(id) {
|
|
23
|
-
return (
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(react_1.WhatsappButtonList, { body: this.text, button: this.listButtonText, sections: this.sections.map((section, sectionIndex) => section.toBotonic(sectionIndex)) }, id));
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
25
|
exports.FlowWhatsappButtonList = FlowWhatsappButtonList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-whatsapp-button-list.js","sourceRoot":"","sources":["../../../../src/content-fields/whatsapp-button-list/flow-whatsapp-button-list.tsx"],"names":[],"mappings":";;;;AAAA,0CAAmD;
|
|
1
|
+
{"version":3,"file":"flow-whatsapp-button-list.js","sourceRoot":"","sources":["../../../../src/content-fields/whatsapp-button-list/flow-whatsapp-button-list.tsx"],"names":[],"mappings":";;;;AAAA,0CAAmD;AAInD,kEAA4D;AAC5D,2FAAmF;AAEnF,MAAa,sBAAuB,SAAQ,uCAAiB;IACpD,IAAI,GAAG,EAAE,CAAA;IACT,IAAI,GAAG,EAAE,CAAA;IACT,cAAc,GAAG,EAAE,CAAA;IACnB,QAAQ,GAAoC,EAAE,CAAA;IAErD,MAAM,CAAC,cAAc,CACnB,SAAmC,EACnC,MAAc;QAEd,MAAM,qBAAqB,GAAG,IAAI,sBAAsB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QACtE,qBAAqB,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;QAC3C,qBAAqB,CAAC,IAAI,GAAG,IAAI,CAAC,eAAe,CAC/C,MAAM,EACN,SAAS,CAAC,OAAO,CAAC,IAAI,CACvB,CAAA;QACD,qBAAqB,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CACzD,MAAM,EACN,SAAS,CAAC,OAAO,CAAC,WAAW,CAC9B,CAAA;QACD,qBAAqB,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CACxE,iEAA6B,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAC9D,CAAA;QACD,OAAO,qBAAqB,CAAA;IAC9B,CAAC;IAED,SAAS,CAAC,EAAU;QAClB,OAAO,CACL,uBAAC,0BAAkB,IAEjB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,MAAM,EAAE,IAAI,CAAC,cAAc,EAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,CACpD,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAChC,IALI,EAAE,CAMa,CACvB,CAAA;IACH,CAAC;CACF;AAtCD,wDAsCC"}
|
package/lib/esm/action/index.js
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowBuilderMultichannelAction = exports.FlowBuilderAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("@botonic/react");
|
|
7
|
+
const react_2 = tslib_1.__importDefault(require("react"));
|
|
8
|
+
const content_fields_1 = require("../content-fields");
|
|
9
|
+
const helpers_1 = require("../helpers");
|
|
10
|
+
const knowledge_bases_1 = require("./knowledge-bases");
|
|
11
|
+
const tracking_1 = require("./tracking");
|
|
12
|
+
class FlowBuilderAction extends react_2.default.Component {
|
|
13
|
+
static contextType = react_1.RequestContext;
|
|
8
14
|
static async botonicInit(request) {
|
|
9
|
-
const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
|
|
15
|
+
const flowBuilderPlugin = (0, helpers_1.getFlowBuilderPlugin)(request.plugins);
|
|
10
16
|
const locale = flowBuilderPlugin.getLocale(request.session);
|
|
11
17
|
const targetNode = await getTargetNode(flowBuilderPlugin.cmsApi, request);
|
|
12
18
|
const contents = await flowBuilderPlugin.getContentsByNode(targetNode, locale);
|
|
13
|
-
const handoffContent = contents.find(content => content instanceof FlowHandoff);
|
|
19
|
+
const handoffContent = contents.find(content => content instanceof content_fields_1.FlowHandoff);
|
|
14
20
|
if (handoffContent)
|
|
15
21
|
await handoffContent.doHandoff(request);
|
|
16
22
|
return { contents };
|
|
@@ -20,17 +26,18 @@ export class FlowBuilderAction extends React.Component {
|
|
|
20
26
|
return contents.map(content => content.toBotonic(content.id));
|
|
21
27
|
}
|
|
22
28
|
}
|
|
23
|
-
FlowBuilderAction
|
|
24
|
-
|
|
29
|
+
exports.FlowBuilderAction = FlowBuilderAction;
|
|
30
|
+
class FlowBuilderMultichannelAction extends FlowBuilderAction {
|
|
25
31
|
render() {
|
|
26
32
|
const { contents } = this.props;
|
|
27
|
-
return (
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Multichannel, { text: { buttonsAsText: false }, children: contents.map(content => content.toBotonic(content.id)) }));
|
|
28
34
|
}
|
|
29
35
|
}
|
|
36
|
+
exports.FlowBuilderMultichannelAction = FlowBuilderMultichannelAction;
|
|
30
37
|
async function getTargetNode(cmsApi, request) {
|
|
31
38
|
if (request.session.is_first_interaction) {
|
|
32
39
|
const startNode = cmsApi.getStartNode();
|
|
33
|
-
await trackEvent(request, EventName.botStart);
|
|
40
|
+
await (0, tracking_1.trackEvent)(request, tracking_1.EventName.botStart);
|
|
34
41
|
return startNode;
|
|
35
42
|
}
|
|
36
43
|
const contentId = request.input.payload;
|
|
@@ -41,24 +48,26 @@ async function getTargetNode(cmsApi, request) {
|
|
|
41
48
|
const eventArgs = {
|
|
42
49
|
faq_name: targetNode.code,
|
|
43
50
|
};
|
|
44
|
-
await trackEvent(request, EventName.botFaq, eventArgs);
|
|
51
|
+
await (0, tracking_1.trackEvent)(request, tracking_1.EventName.botFaq, eventArgs);
|
|
45
52
|
return targetNode;
|
|
46
53
|
}
|
|
47
54
|
return await getFallbackNode(cmsApi, request);
|
|
48
55
|
}
|
|
49
56
|
async function getFallbackNode(cmsApi, request) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
if (request.session.user.extra_data?.isFirstFallbackOption === undefined) {
|
|
58
|
+
request.session.user.extra_data = {
|
|
59
|
+
...request.session.user.extra_data,
|
|
60
|
+
isFirstFallbackOption: true,
|
|
61
|
+
};
|
|
53
62
|
}
|
|
54
|
-
const knowledgeBaseNode = await createNodeFromKnowledgeBase(cmsApi, request);
|
|
63
|
+
const knowledgeBaseNode = await (0, knowledge_bases_1.createNodeFromKnowledgeBase)(cmsApi, request);
|
|
55
64
|
if (knowledgeBaseNode) {
|
|
56
65
|
return knowledgeBaseNode;
|
|
57
66
|
}
|
|
58
67
|
const isFirstFallbackOption = !!request.session.user.extra_data.isFirstFallbackOption;
|
|
59
68
|
const fallbackNode = cmsApi.getFallbackNode(isFirstFallbackOption);
|
|
60
69
|
request.session.user.extra_data.isFirstFallbackOption = !isFirstFallbackOption;
|
|
61
|
-
await trackEvent(request, EventName.fallback);
|
|
70
|
+
await (0, tracking_1.trackEvent)(request, tracking_1.EventName.fallback);
|
|
62
71
|
return fallbackNode;
|
|
63
72
|
}
|
|
64
73
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/action/index.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/action/index.tsx"],"names":[],"mappings":";;;;;AAAA,0CAA4E;AAC5E,0DAAyB;AAGzB,sDAA4D;AAE5D,wCAAiD;AACjD,uDAA+D;AAC/D,yCAAkD;AAMlD,MAAa,iBAAkB,SAAQ,eAAK,CAAC,SAAiC;IAC5E,MAAM,CAAC,WAAW,GAAG,sBAAc,CAAA;IAEnC,MAAM,CAAC,KAAK,CAAC,WAAW,CACtB,OAAsB;QAEtB,MAAM,iBAAiB,GAAG,IAAA,8BAAoB,EAAC,OAAO,CAAC,OAAO,CAAC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AqB,CAAA;IAE9E,MAAM,IAAA,qBAAU,EAAC,OAAO,EAAE,oBAAS,CAAC,QAAQ,CAAC,CAAA;IAC7C,OAAO,YAAY,CAAA;AACrB,CAAC"}
|
package/lib/esm/action/intent.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIntentNodeByInput = void 0;
|
|
4
|
+
const tracking_1 = require("./tracking");
|
|
5
|
+
async function getIntentNodeByInput(cmsApi, locale, request) {
|
|
3
6
|
const intentNode = cmsApi.getIntentNode(request.input, locale);
|
|
4
7
|
const eventArgs = {
|
|
5
8
|
intent: request.input.intent,
|
|
@@ -8,14 +11,15 @@ export async function getIntentNodeByInput(cmsApi, locale, request) {
|
|
|
8
11
|
};
|
|
9
12
|
if (request.input.confidence && request.input.intent && intentNode) {
|
|
10
13
|
if (isIntentValid(intentNode, request, cmsApi)) {
|
|
11
|
-
await trackEvent(request, EventName.botAiModel, eventArgs);
|
|
14
|
+
await (0, tracking_1.trackEvent)(request, tracking_1.EventName.botAiModel, eventArgs);
|
|
12
15
|
return intentNode;
|
|
13
16
|
}
|
|
14
17
|
eventArgs.confidence_successful = false;
|
|
15
|
-
await trackEvent(request, EventName.botAiModel, eventArgs);
|
|
18
|
+
await (0, tracking_1.trackEvent)(request, tracking_1.EventName.botAiModel, eventArgs);
|
|
16
19
|
}
|
|
17
20
|
return undefined;
|
|
18
21
|
}
|
|
22
|
+
exports.getIntentNodeByInput = getIntentNodeByInput;
|
|
19
23
|
function isIntentValid(intentNode, request, cmsApi) {
|
|
20
24
|
return (request.input.confidence &&
|
|
21
25
|
cmsApi.hasMetConfidenceThreshold(intentNode, request.input.confidence));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent.js","sourceRoot":"","sources":["../../../src/action/intent.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"intent.js","sourceRoot":"","sources":["../../../src/action/intent.ts"],"names":[],"mappings":";;;AAIA,yCAAkD;AAE3C,KAAK,UAAU,oBAAoB,CACxC,MAAsB,EACtB,MAAc,EACd,OAAsB;IAEtB,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;IAC9D,MAAM,SAAS,GAAG;QAChB,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,MAAgB;QACtC,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,UAAoB;QAC9C,qBAAqB,EAAE,IAAI;KAC5B,CAAA;IACD,IAAI,OAAO,CAAC,KAAK,CAAC,UAAU,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,IAAI,UAAU,EAAE;QAClE,IAAI,aAAa,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE;YAC9C,MAAM,IAAA,qBAAU,EAAC,OAAO,EAAE,oBAAS,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;YAC1D,OAAO,UAAU,CAAA;SAClB;QAED,SAAS,CAAC,qBAAqB,GAAG,KAAK,CAAA;QACvC,MAAM,IAAA,qBAAU,EAAC,OAAO,EAAE,oBAAS,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;KAC3D;IAED,OAAO,SAAS,CAAA;AAClB,CAAC;AAtBD,oDAsBC;AAED,SAAS,aAAa,CACpB,UAAwB,EACxB,OAAsB,EACtB,MAAsB;IAEtB,OAAO,CACL,OAAO,CAAC,KAAK,CAAC,UAAU;QACxB,MAAM,CAAC,yBAAyB,CAAC,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CACvE,CAAA;AACH,CAAC"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getKeywordNodeByInput = void 0;
|
|
4
|
+
const tracking_1 = require("./tracking");
|
|
5
|
+
async function getKeywordNodeByInput(cmsApi, locale, request, userInput) {
|
|
3
6
|
const keywordNode = cmsApi.getNodeByKeyword(userInput, locale);
|
|
4
7
|
if (!keywordNode) {
|
|
5
8
|
return undefined;
|
|
@@ -7,7 +10,8 @@ export async function getKeywordNodeByInput(cmsApi, locale, request, userInput)
|
|
|
7
10
|
const eventArgs = {
|
|
8
11
|
confidence_successful: true,
|
|
9
12
|
};
|
|
10
|
-
await trackEvent(request, EventName.botKeywordsModel, eventArgs);
|
|
13
|
+
await (0, tracking_1.trackEvent)(request, tracking_1.EventName.botKeywordsModel, eventArgs);
|
|
11
14
|
return keywordNode;
|
|
12
15
|
}
|
|
16
|
+
exports.getKeywordNodeByInput = getKeywordNodeByInput;
|
|
13
17
|
//# sourceMappingURL=keyword.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyword.js","sourceRoot":"","sources":["../../../src/action/keyword.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"keyword.js","sourceRoot":"","sources":["../../../src/action/keyword.ts"],"names":[],"mappings":";;;AAIA,yCAAkD;AAE3C,KAAK,UAAU,qBAAqB,CACzC,MAAsB,EACtB,MAAc,EACd,OAAsB,EACtB,SAAiB;IAEjB,MAAM,WAAW,GAAG,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;IAC9D,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,SAAS,CAAA;KACjB;IACD,MAAM,SAAS,GAAG;QAChB,qBAAqB,EAAE,IAAI;KAC5B,CAAA;IACD,MAAM,IAAA,qBAAU,EAAC,OAAO,EAAE,oBAAS,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAA;IAChE,OAAO,WAAW,CAAA;AACpB,CAAC;AAfD,sDAeC"}
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createNodeFromKnowledgeBase = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
const hubtype_fields_1 = require("../content-fields/hubtype-fields");
|
|
6
|
+
const helpers_1 = require("../helpers");
|
|
7
|
+
const tracking_1 = require("./tracking");
|
|
8
|
+
async function createNodeFromKnowledgeBase(cmsApi, request) {
|
|
9
|
+
const flowBuilderPlugin = (0, helpers_1.getFlowBuilderPlugin)(request.plugins);
|
|
7
10
|
const locale = flowBuilderPlugin.getLocale(request.session);
|
|
8
11
|
const knowledgeBaseConfig = cmsApi.getKnowledgeBaseConfig();
|
|
9
12
|
if (flowBuilderPlugin.getKnowledgeBaseResponse &&
|
|
10
|
-
|
|
13
|
+
knowledgeBaseConfig?.isActive) {
|
|
11
14
|
try {
|
|
12
15
|
const knowledgeBaseResponse = await flowBuilderPlugin.getKnowledgeBaseResponse(request);
|
|
13
16
|
if (knowledgeBaseResponse.hasKnowledge) {
|
|
14
|
-
await trackEvent(request, EventName.botAiKnowledgeBase, {
|
|
17
|
+
await (0, tracking_1.trackEvent)(request, tracking_1.EventName.botAiKnowledgeBase, {
|
|
15
18
|
answer: knowledgeBaseResponse.answer,
|
|
16
19
|
knowledge_source_ids: knowledgeBaseResponse.sources.map(source => source.knowledgeSourceId),
|
|
17
20
|
});
|
|
18
21
|
const knowledgeBaseNode = {
|
|
19
|
-
type: HtNodeWithContentType.TEXT,
|
|
22
|
+
type: hubtype_fields_1.HtNodeWithContentType.TEXT,
|
|
20
23
|
content: {
|
|
21
24
|
text: [
|
|
22
25
|
{
|
|
@@ -27,7 +30,7 @@ export async function createNodeFromKnowledgeBase(cmsApi, request) {
|
|
|
27
30
|
buttons_style: undefined,
|
|
28
31
|
buttons: [],
|
|
29
32
|
},
|
|
30
|
-
id: randomUUID(),
|
|
33
|
+
id: (0, crypto_1.randomUUID)(),
|
|
31
34
|
code: 'knowledge-response',
|
|
32
35
|
meta: {
|
|
33
36
|
x: 0,
|
|
@@ -45,4 +48,5 @@ export async function createNodeFromKnowledgeBase(cmsApi, request) {
|
|
|
45
48
|
}
|
|
46
49
|
return undefined;
|
|
47
50
|
}
|
|
51
|
+
exports.createNodeFromKnowledgeBase = createNodeFromKnowledgeBase;
|
|
48
52
|
//# sourceMappingURL=knowledge-bases.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge-bases.js","sourceRoot":"","sources":["../../../src/action/knowledge-bases.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"knowledge-bases.js","sourceRoot":"","sources":["../../../src/action/knowledge-bases.ts"],"names":[],"mappings":";;;AAEA,mCAAmC;AAGnC,qEAIyC;AACzC,wCAAiD;AACjD,yCAAkD;AAE3C,KAAK,UAAU,2BAA2B,CAC/C,MAAsB,EACtB,OAAsB;IAEtB,MAAM,iBAAiB,GAAG,IAAA,8BAAoB,EAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC/D,MAAM,MAAM,GAAG,iBAAiB,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC3D,MAAM,mBAAmB,GAAG,MAAM,CAAC,sBAAsB,EAAE,CAAA;IAE3D,IACE,iBAAiB,CAAC,wBAAwB;QAC1C,mBAAmB,EAAE,QAAQ,EAC7B;QACA,IAAI;YACF,MAAM,qBAAqB,GACzB,MAAM,iBAAiB,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAA;YAE3D,IAAI,qBAAqB,CAAC,YAAY,EAAE;gBACtC,MAAM,IAAA,qBAAU,EAAC,OAAO,EAAE,oBAAS,CAAC,kBAAkB,EAAE;oBACtD,MAAM,EAAE,qBAAqB,CAAC,MAAM;oBACpC,oBAAoB,EAAE,qBAAqB,CAAC,OAAO,CAAC,GAAG,CACrD,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,iBAAiB,CACnC;iBACF,CAAC,CAAA;gBAEF,MAAM,iBAAiB,GAAe;oBACpC,IAAI,EAAE,sCAAqB,CAAC,IAAI;oBAChC,OAAO,EAAE;wBACP,IAAI,EAAE;4BACJ;gCACE,OAAO,EAAE,qBAAqB,CAAC,MAAM;gCACrC,MAAM;6BACP;yBACF;wBACD,aAAa,EAAE,SAAS;wBACxB,OAAO,EAAE,EAAE;qBACZ;oBACD,EAAE,EAAE,IAAA,mBAAU,GAAE;oBAChB,IAAI,EAAE,oBAAoB;oBAC1B,IAAI,EAAE;wBACJ,CAAC,EAAE,CAAC;wBACJ,CAAC,EAAE,CAAC;qBACL;oBACD,SAAS,EAAE,mBAAmB,CAAC,QAAQ;iBACxC,CAAA;gBACD,OAAO,iBAAiB,CAAA;aACzB;SACF;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,oCAAoC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAA;YACxD,OAAO,SAAS,CAAA;SACjB;KACF;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AApDD,kEAoDC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventName = exports.trackEvent = void 0;
|
|
4
|
+
const helpers_1 = require("../helpers");
|
|
5
|
+
async function trackEvent(request, eventName, args) {
|
|
6
|
+
const flowBuilderPlugin = (0, helpers_1.getFlowBuilderPlugin)(request.plugins);
|
|
4
7
|
if (flowBuilderPlugin.trackEvent) {
|
|
5
8
|
await flowBuilderPlugin.trackEvent(request, eventName, args);
|
|
6
9
|
}
|
|
7
10
|
return;
|
|
8
11
|
}
|
|
9
|
-
|
|
12
|
+
exports.trackEvent = trackEvent;
|
|
13
|
+
var EventName;
|
|
10
14
|
(function (EventName) {
|
|
11
15
|
EventName["botAgentRating"] = "bot_agent_rating";
|
|
12
16
|
EventName["botChannelRating"] = "bot_channel_rating";
|
|
@@ -22,5 +26,5 @@ export var EventName;
|
|
|
22
26
|
EventName["handoffOption"] = "handoff_option";
|
|
23
27
|
EventName["handoffSuccess"] = "handoff_success";
|
|
24
28
|
EventName["handoffFail"] = "handoff_fail";
|
|
25
|
-
})(EventName || (EventName = {}));
|
|
29
|
+
})(EventName = exports.EventName || (exports.EventName = {}));
|
|
26
30
|
//# sourceMappingURL=tracking.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracking.js","sourceRoot":"","sources":["../../../src/action/tracking.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"tracking.js","sourceRoot":"","sources":["../../../src/action/tracking.ts"],"names":[],"mappings":";;;AAEA,wCAAiD;AAE1C,KAAK,UAAU,UAAU,CAC9B,OAAsB,EACtB,SAAoB,EACpB,IAA0B;IAE1B,MAAM,iBAAiB,GAAG,IAAA,8BAAoB,EAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC/D,IAAI,iBAAiB,CAAC,UAAU,EAAE;QAChC,MAAM,iBAAiB,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,CAAA;KAC7D;IACD,OAAM;AACR,CAAC;AAVD,gCAUC;AAED,IAAY,SAeX;AAfD,WAAY,SAAS;IACnB,gDAAmC,CAAA;IACnC,oDAAuC,CAAA;IACvC,4CAA+B,CAAA;IAC/B,qCAAwB,CAAA;IACxB,+BAAkB,CAAA;IAClB,mCAAsB,CAAA;IACtB,iCAAoB,CAAA;IACpB,wCAA2B,CAAA;IAC3B,yDAA4C,CAAA;IAC5C,oDAAuC,CAAA;IACvC,kCAAqB,CAAA;IACrB,6CAAgC,CAAA;IAChC,+CAAkC,CAAA;IAClC,yCAA4B,CAAA;AAC9B,CAAC,EAfW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAepB"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNodeByUserInput = void 0;
|
|
4
|
+
const intent_1 = require("./intent");
|
|
5
|
+
const keyword_1 = require("./keyword");
|
|
6
|
+
async function getNodeByUserInput(cmsApi, locale, request) {
|
|
4
7
|
if (request.input.data) {
|
|
5
|
-
const intentNode = await getIntentNodeByInput(cmsApi, locale, request);
|
|
8
|
+
const intentNode = await (0, intent_1.getIntentNodeByInput)(cmsApi, locale, request);
|
|
6
9
|
if (intentNode)
|
|
7
10
|
return intentNode;
|
|
8
|
-
const keywordNode = await getKeywordNodeByInput(cmsApi, locale, request, request.input.data);
|
|
11
|
+
const keywordNode = await (0, keyword_1.getKeywordNodeByInput)(cmsApi, locale, request, request.input.data);
|
|
9
12
|
if (keywordNode)
|
|
10
13
|
return keywordNode;
|
|
11
14
|
}
|
|
12
15
|
return undefined;
|
|
13
16
|
}
|
|
17
|
+
exports.getNodeByUserInput = getNodeByUserInput;
|
|
14
18
|
//# sourceMappingURL=user-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-input.js","sourceRoot":"","sources":["../../../src/action/user-input.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"user-input.js","sourceRoot":"","sources":["../../../src/action/user-input.ts"],"names":[],"mappings":";;;AAIA,qCAA+C;AAC/C,uCAAiD;AAE1C,KAAK,UAAU,kBAAkB,CACtC,MAAsB,EACtB,MAAc,EACd,OAAsB;IAEtB,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE;QACtB,MAAM,UAAU,GAAG,MAAM,IAAA,6BAAoB,EAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;QACtE,IAAI,UAAU;YAAE,OAAO,UAAU,CAAA;QAEjC,MAAM,WAAW,GAAG,MAAM,IAAA,+BAAqB,EAC7C,MAAM,EACN,MAAM,EACN,OAAO,EACP,OAAO,CAAC,KAAK,CAAC,IAAI,CACnB,CAAA;QACD,IAAI,WAAW;YAAE,OAAO,WAAW,CAAA;KACpC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAlBD,gDAkBC"}
|