@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
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HtArgumentType = void 0;
|
|
4
|
+
var HtArgumentType;
|
|
2
5
|
(function (HtArgumentType) {
|
|
3
6
|
HtArgumentType["NUMBER"] = "number";
|
|
4
7
|
HtArgumentType["STRING"] = "string";
|
|
5
8
|
HtArgumentType["JSON"] = "json";
|
|
6
|
-
})(HtArgumentType || (HtArgumentType = {}));
|
|
9
|
+
})(HtArgumentType = exports.HtArgumentType || (exports.HtArgumentType = {}));
|
|
7
10
|
//# sourceMappingURL=function.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/function.ts"],"names":[],"mappings":"AAGA,
|
|
1
|
+
{"version":3,"file":"function.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/function.ts"],"names":[],"mappings":";;;AAGA,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB"}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./bot-action"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./button"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./carousel"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./common"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./fallback"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./function"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./go-to-flow"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./handoff"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./image"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./intent"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./keyword"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./node-types"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./nodes"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./payload"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./text"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./url"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./video"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./whatsapp-button-list"), exports);
|
|
19
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,mDAAwB;AACxB,qDAA0B;AAC1B,mDAAwB;AACxB,qDAA0B;AAC1B,qDAA0B;AAC1B,uDAA4B;AAC5B,oDAAyB;AACzB,kDAAuB;AACvB,mDAAwB;AACxB,oDAAyB;AACzB,uDAA4B;AAC5B,kDAAuB;AACvB,oDAAyB;AACzB,iDAAsB;AACtB,gDAAqB;AACrB,kDAAuB;AACvB,iEAAsC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HtButtonStyle = exports.HtNodeWithoutContentType = exports.HtNodeWithContentType = void 0;
|
|
4
|
+
var HtNodeWithContentType;
|
|
2
5
|
(function (HtNodeWithContentType) {
|
|
3
6
|
HtNodeWithContentType["CAROUSEL"] = "carousel";
|
|
4
7
|
HtNodeWithContentType["HANDOFF"] = "handoff";
|
|
@@ -10,17 +13,17 @@ export var HtNodeWithContentType;
|
|
|
10
13
|
HtNodeWithContentType["FALLBACK"] = "fallback";
|
|
11
14
|
HtNodeWithContentType["VIDEO"] = "video";
|
|
12
15
|
HtNodeWithContentType["WHATSAPP_BUTTON_LIST"] = "whatsapp-button-list";
|
|
13
|
-
})(HtNodeWithContentType || (HtNodeWithContentType = {}));
|
|
14
|
-
|
|
16
|
+
})(HtNodeWithContentType = exports.HtNodeWithContentType || (exports.HtNodeWithContentType = {}));
|
|
17
|
+
var HtNodeWithoutContentType;
|
|
15
18
|
(function (HtNodeWithoutContentType) {
|
|
16
19
|
HtNodeWithoutContentType["URL"] = "url";
|
|
17
20
|
HtNodeWithoutContentType["PAYLOAD"] = "payload";
|
|
18
21
|
HtNodeWithoutContentType["GO_TO_FLOW"] = "go-to-flow";
|
|
19
22
|
HtNodeWithoutContentType["BOT_ACTION"] = "bot-action";
|
|
20
|
-
})(HtNodeWithoutContentType || (HtNodeWithoutContentType = {}));
|
|
21
|
-
|
|
23
|
+
})(HtNodeWithoutContentType = exports.HtNodeWithoutContentType || (exports.HtNodeWithoutContentType = {}));
|
|
24
|
+
var HtButtonStyle;
|
|
22
25
|
(function (HtButtonStyle) {
|
|
23
26
|
HtButtonStyle["BUTTON"] = "button";
|
|
24
27
|
HtButtonStyle["QUICK_REPLY"] = "quick-reply";
|
|
25
|
-
})(HtButtonStyle || (HtButtonStyle = {}));
|
|
28
|
+
})(HtButtonStyle = exports.HtButtonStyle || (exports.HtButtonStyle = {}));
|
|
26
29
|
//# sourceMappingURL=node-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-types.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/node-types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"node-types.js","sourceRoot":"","sources":["../../../../src/content-fields/hubtype-fields/node-types.ts"],"names":[],"mappings":";;;AAAA,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAC/B,8CAAqB,CAAA;IACrB,4CAAmB,CAAA;IACnB,wCAAe,CAAA;IACf,sCAAa,CAAA;IACb,4CAAmB,CAAA;IACnB,0CAAiB,CAAA;IACjB,8CAAqB,CAAA;IACrB,8CAAqB,CAAA;IACrB,wCAAe,CAAA;IACf,sEAA6C,CAAA;AAC/C,CAAC,EAXW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAWhC;AAED,IAAY,wBAKX;AALD,WAAY,wBAAwB;IAClC,uCAAW,CAAA;IACX,+CAAmB,CAAA;IACnB,qDAAyB,CAAA;IACzB,qDAAyB,CAAA;AAC3B,CAAC,EALW,wBAAwB,GAAxB,gCAAwB,KAAxB,gCAAwB,QAKnC;AAED,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,kCAAiB,CAAA;IACjB,4CAA2B,CAAA;AAC7B,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB"}
|
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowHandoff = exports.FlowWhatsappButtonList = exports.FlowVideo = exports.FlowText = exports.FlowImage = exports.FlowCarousel = exports.FlowElement = exports.FlowButton = exports.ContentFieldsBase = void 0;
|
|
4
|
+
const flow_carousel_1 = require("./flow-carousel");
|
|
5
|
+
Object.defineProperty(exports, "FlowCarousel", { enumerable: true, get: function () { return flow_carousel_1.FlowCarousel; } });
|
|
6
|
+
const flow_image_1 = require("./flow-image");
|
|
7
|
+
Object.defineProperty(exports, "FlowImage", { enumerable: true, get: function () { return flow_image_1.FlowImage; } });
|
|
8
|
+
const flow_text_1 = require("./flow-text");
|
|
9
|
+
Object.defineProperty(exports, "FlowText", { enumerable: true, get: function () { return flow_text_1.FlowText; } });
|
|
10
|
+
const flow_video_1 = require("./flow-video");
|
|
11
|
+
Object.defineProperty(exports, "FlowVideo", { enumerable: true, get: function () { return flow_video_1.FlowVideo; } });
|
|
12
|
+
const flow_whatsapp_button_list_1 = require("./whatsapp-button-list/flow-whatsapp-button-list");
|
|
13
|
+
Object.defineProperty(exports, "FlowWhatsappButtonList", { enumerable: true, get: function () { return flow_whatsapp_button_list_1.FlowWhatsappButtonList; } });
|
|
14
|
+
var content_fields_base_1 = require("./content-fields-base");
|
|
15
|
+
Object.defineProperty(exports, "ContentFieldsBase", { enumerable: true, get: function () { return content_fields_base_1.ContentFieldsBase; } });
|
|
16
|
+
var flow_button_1 = require("./flow-button");
|
|
17
|
+
Object.defineProperty(exports, "FlowButton", { enumerable: true, get: function () { return flow_button_1.FlowButton; } });
|
|
18
|
+
var flow_element_1 = require("./flow-element");
|
|
19
|
+
Object.defineProperty(exports, "FlowElement", { enumerable: true, get: function () { return flow_element_1.FlowElement; } });
|
|
20
|
+
var flow_handoff_1 = require("./flow-handoff");
|
|
21
|
+
Object.defineProperty(exports, "FlowHandoff", { enumerable: true, get: function () { return flow_handoff_1.FlowHandoff; } });
|
|
11
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content-fields/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content-fields/index.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAUrC,6FAVA,4BAAY,OAUA;AARrB,6CAAwC;AAQjB,0FARd,sBAAS,OAQc;AAPhC,2CAAsC;AAOJ,yFAPzB,oBAAQ,OAOyB;AAN1C,6CAAwC;AAMI,0FANnC,sBAAS,OAMmC;AALrD,gGAAyF;AAKlC,uGAL9C,kDAAsB,OAK8C;AAH7E,6DAAyD;AAAhD,wHAAA,iBAAiB,OAAA;AAC1B,6CAA0C;AAAjC,yGAAA,UAAU,OAAA;AACnB,+CAA4C;AAAnC,2GAAA,WAAW,OAAA;AAEpB,+CAA4C;AAAnC,2GAAA,WAAW,OAAA"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowWhatsappButtonListRow = void 0;
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
|
+
const content_fields_base_1 = require("../content-fields-base");
|
|
6
|
+
class FlowWhatsappButtonListRow extends content_fields_base_1.ContentFieldsBase {
|
|
7
|
+
title = '';
|
|
8
|
+
description = '';
|
|
9
|
+
targetId;
|
|
9
10
|
static fromHubtypeCMS(component, locale) {
|
|
10
|
-
var _a;
|
|
11
11
|
const newRow = new FlowWhatsappButtonListRow(component.id);
|
|
12
12
|
newRow.title = this.getTextByLocale(locale, component.text);
|
|
13
13
|
newRow.description = this.getTextByLocale(locale, component.description);
|
|
14
|
-
newRow.targetId =
|
|
14
|
+
newRow.targetId = component.target?.id;
|
|
15
15
|
return newRow;
|
|
16
16
|
}
|
|
17
17
|
toBotonic(rowIndex, sectionIndex) {
|
|
@@ -26,7 +26,8 @@ export class FlowWhatsappButtonListRow extends ContentFieldsBase {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
getRowId(rowIndex, sectionIndex) {
|
|
29
|
-
return `${this.targetId}${SOURCE_INFO_SEPARATOR}${sectionIndex}.${rowIndex}`;
|
|
29
|
+
return `${this.targetId}${constants_1.SOURCE_INFO_SEPARATOR}${sectionIndex}.${rowIndex}`;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
+
exports.FlowWhatsappButtonListRow = FlowWhatsappButtonListRow;
|
|
32
33
|
//# sourceMappingURL=flow-whatsapp-button-list-row.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-whatsapp-button-list-row.js","sourceRoot":"","sources":["../../../../src/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.tsx"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"flow-whatsapp-button-list-row.js","sourceRoot":"","sources":["../../../../src/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.tsx"],"names":[],"mappings":";;;AAEA,+CAAuD;AACvD,gEAA0D;AAG1D,MAAa,yBAA0B,SAAQ,uCAAiB;IACvD,KAAK,GAAG,EAAE,CAAA;IACV,WAAW,GAAG,EAAE,CAAA;IAChB,QAAQ,CAAS;IAExB,MAAM,CAAC,cAAc,CACnB,SAAkC,EAClC,MAAc;QAEd,MAAM,MAAM,GAAG,IAAI,yBAAyB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAC1D,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,CAAA;QAC3D,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,CAAA;QACxE,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,MAAM,EAAE,EAAE,CAAA;QACtC,OAAO,MAAM,CAAA;IACf,CAAC;IAED,SAAS,CACP,QAAgB,EAChB,YAAoB;QAEpB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,OAAO,CAAC,KAAK,CAAC,oBAAoB,IAAI,CAAC,KAAK,iBAAiB,CAAC,CAAA;YAC9D,OAAO,SAAS,CAAA;SACjB;QACD,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;YACzC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAA;IACH,CAAC;IAEO,QAAQ,CAAC,QAAgB,EAAE,YAAoB;QACrD,OAAO,GAAG,IAAI,CAAC,QAAQ,GAAG,iCAAqB,GAAG,YAAY,IAAI,QAAQ,EAAE,CAAA;IAC9E,CAAC;CACF;AAlCD,8DAkCC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowWhatsappButtonListSection = void 0;
|
|
4
|
+
const content_fields_base_1 = require("./../content-fields-base");
|
|
5
|
+
const flow_whatsapp_button_list_row_1 = require("./flow-whatsapp-button-list-row");
|
|
6
|
+
class FlowWhatsappButtonListSection extends content_fields_base_1.ContentFieldsBase {
|
|
7
|
+
title = '';
|
|
8
|
+
rows = [];
|
|
9
9
|
static fromHubtypeCMS(component, locale) {
|
|
10
10
|
const newButton = new FlowWhatsappButtonListSection(component.id);
|
|
11
11
|
newButton.title = this.getTextByLocale(locale, component.title);
|
|
12
|
-
newButton.rows = component.rows.map(row => FlowWhatsappButtonListRow.fromHubtypeCMS(row, locale));
|
|
12
|
+
newButton.rows = component.rows.map(row => flow_whatsapp_button_list_row_1.FlowWhatsappButtonListRow.fromHubtypeCMS(row, locale));
|
|
13
13
|
return newButton;
|
|
14
14
|
}
|
|
15
15
|
toBotonic(sectionIndex) {
|
|
@@ -22,4 +22,5 @@ export class FlowWhatsappButtonListSection extends ContentFieldsBase {
|
|
|
22
22
|
return { title: this.title, rows };
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
+
exports.FlowWhatsappButtonListSection = FlowWhatsappButtonListSection;
|
|
25
26
|
//# sourceMappingURL=flow-whatsapp-button-list-section.js.map
|
package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-whatsapp-button-list-section.js","sourceRoot":"","sources":["../../../../src/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.tsx"],"names":[],"mappings":"AAMA,
|
|
1
|
+
{"version":3,"file":"flow-whatsapp-button-list-section.js","sourceRoot":"","sources":["../../../../src/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.tsx"],"names":[],"mappings":";;;AAMA,kEAA4D;AAC5D,mFAA2E;AAE3E,MAAa,6BAA8B,SAAQ,uCAAiB;IAC3D,KAAK,GAAG,EAAE,CAAA;IACV,IAAI,GAAgC,EAAE,CAAA;IAE7C,MAAM,CAAC,cAAc,CACnB,SAAsC,EACtC,MAAc;QAEd,MAAM,SAAS,GAAG,IAAI,6BAA6B,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QACjE,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC,CAAA;QAC/D,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CACxC,yDAAyB,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CACtD,CAAA;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,SAAS,CAAC,YAAoB;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAC3B,CAAC,GAAiC,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE;YACnD,MAAM,UAAU,GAAG,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;YACxD,IAAI,UAAU;gBAAE,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;YACpC,OAAO,GAAG,CAAA;QACZ,CAAC,EACD,EAAE,CACH,CAAA;QAED,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,CAAA;IACpC,CAAC;CACF;AA5BD,sEA4BC"}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowWhatsappButtonList = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("@botonic/react");
|
|
6
|
+
const content_fields_base_1 = require("./../content-fields-base");
|
|
7
|
+
const flow_whatsapp_button_list_section_1 = require("./flow-whatsapp-button-list-section");
|
|
8
|
+
class FlowWhatsappButtonList extends content_fields_base_1.ContentFieldsBase {
|
|
9
|
+
code = '';
|
|
10
|
+
text = '';
|
|
11
|
+
listButtonText = '';
|
|
12
|
+
sections = [];
|
|
13
13
|
static fromHubtypeCMS(component, locale) {
|
|
14
14
|
const newWhatsappButtonList = new FlowWhatsappButtonList(component.id);
|
|
15
15
|
newWhatsappButtonList.code = component.code;
|
|
16
16
|
newWhatsappButtonList.text = this.getTextByLocale(locale, component.content.text);
|
|
17
17
|
newWhatsappButtonList.listButtonText = this.getTextByLocale(locale, component.content.button_text);
|
|
18
|
-
newWhatsappButtonList.sections = component.content.sections.map(section => FlowWhatsappButtonListSection.fromHubtypeCMS(section, locale));
|
|
18
|
+
newWhatsappButtonList.sections = component.content.sections.map(section => flow_whatsapp_button_list_section_1.FlowWhatsappButtonListSection.fromHubtypeCMS(section, locale));
|
|
19
19
|
return newWhatsappButtonList;
|
|
20
20
|
}
|
|
21
21
|
toBotonic(id) {
|
|
22
|
-
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));
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
+
exports.FlowWhatsappButtonList = FlowWhatsappButtonList;
|
|
25
26
|
//# sourceMappingURL=flow-whatsapp-button-list.js.map
|
|
@@ -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,
|
|
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"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.conditionalProvider = void 0;
|
|
4
|
+
function conditionalProvider({ request, results, }) {
|
|
2
5
|
const provider = request.session.user.provider;
|
|
3
6
|
if (results.includes(provider))
|
|
4
7
|
return provider;
|
|
5
8
|
return 'default';
|
|
6
9
|
}
|
|
10
|
+
exports.conditionalProvider = conditionalProvider;
|
|
7
11
|
//# sourceMappingURL=conditional-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditional-provider.js","sourceRoot":"","sources":["../../../src/functions/conditional-provider.ts"],"names":[],"mappings":"AAOA,
|
|
1
|
+
{"version":3,"file":"conditional-provider.js","sourceRoot":"","sources":["../../../src/functions/conditional-provider.ts"],"names":[],"mappings":";;;AAOA,SAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,OAAO,GACiB;IACxB,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAA;IAC9C,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAA;IAC/C,OAAO,SAAS,CAAA;AAClB,CAAC;AAPD,kDAOC"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getQueueAvailability = exports.conditionalQueueStatus = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
2
6
|
const HUBTYPE_API_URL = process.env.HUBTYPE_API_URL || 'https://api.hubtype.com';
|
|
3
|
-
|
|
7
|
+
async function conditionalQueueStatus({ queue_id, }) {
|
|
4
8
|
const data = await getQueueAvailability(queue_id);
|
|
5
9
|
const isAvailable = data.available;
|
|
6
10
|
return isAvailable ? 'open' : 'closed';
|
|
7
11
|
}
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
exports.conditionalQueueStatus = conditionalQueueStatus;
|
|
13
|
+
async function getQueueAvailability(queueId) {
|
|
14
|
+
const response = await axios_1.default.get(`${HUBTYPE_API_URL}/public/v1/queues/${queueId}/availability/`,
|
|
10
15
|
// TODO: Make it configurable in the future
|
|
11
16
|
{
|
|
12
17
|
params: {
|
|
@@ -17,4 +22,5 @@ export async function getQueueAvailability(queueId) {
|
|
|
17
22
|
});
|
|
18
23
|
return response.data;
|
|
19
24
|
}
|
|
25
|
+
exports.getQueueAvailability = getQueueAvailability;
|
|
20
26
|
//# sourceMappingURL=conditional-queue-status.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditional-queue-status.js","sourceRoot":"","sources":["../../../src/functions/conditional-queue-status.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"conditional-queue-status.js","sourceRoot":"","sources":["../../../src/functions/conditional-queue-status.ts"],"names":[],"mappings":";;;;AACA,0DAAyB;AAEzB,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,yBAAyB,CAAA;AAQzE,KAAK,UAAU,sBAAsB,CAAC,EAC3C,QAAQ,GACmB;IAC3B,MAAM,IAAI,GAAG,MAAM,oBAAoB,CAAC,QAAQ,CAAC,CAAA;IACjD,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAA;IAClC,OAAO,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAA;AACxC,CAAC;AAND,wDAMC;AAWM,KAAK,UAAU,oBAAoB,CACxC,OAAe;IAEf,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAC9B,GAAG,eAAe,qBAAqB,OAAO,gBAAgB;IAC9D,2CAA2C;IAC3C;QACE,MAAM,EAAE;YACN,oBAAoB,EAAE,IAAI;YAC1B,mBAAmB,EAAE,KAAK;YAC1B,sBAAsB,EAAE,KAAK;SAC9B;KACF,CACF,CAAA;IACD,OAAO,QAAQ,CAAC,IAAI,CAAA;AACtB,CAAC;AAfD,oDAeC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_FUNCTIONS = void 0;
|
|
4
|
+
const conditional_provider_1 = require("./conditional-provider");
|
|
5
|
+
const conditional_queue_status_1 = require("./conditional-queue-status");
|
|
6
|
+
exports.DEFAULT_FUNCTIONS = {
|
|
4
7
|
// TODO: Rename api action name
|
|
5
|
-
'check-queue-status': conditionalQueueStatus,
|
|
6
|
-
'get-channel-type': conditionalProvider,
|
|
8
|
+
'check-queue-status': conditional_queue_status_1.conditionalQueueStatus,
|
|
9
|
+
'get-channel-type': conditional_provider_1.conditionalProvider,
|
|
7
10
|
};
|
|
8
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/functions/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/functions/index.ts"],"names":[],"mappings":";;;AAAA,iEAA4D;AAC5D,yEAAmE;AAEtD,QAAA,iBAAiB,GAAG;IAC/B,+BAA+B;IAC/B,oBAAoB,EAAE,iDAAsB;IAC5C,kBAAkB,EAAE,0CAAmB;CACxC,CAAA"}
|
package/lib/esm/helpers.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFlowBuilderPlugin = void 0;
|
|
1
4
|
const FLOW_BUILDER_PLUGIN_NAME = 'BotonicPluginFlowBuilder';
|
|
2
|
-
|
|
5
|
+
function getFlowBuilderPlugin(plugins) {
|
|
3
6
|
const flowBuilderPlugin = Object.values(plugins).find(
|
|
4
7
|
// @ts-ignore
|
|
5
8
|
plugin => plugin.name.includes(FLOW_BUILDER_PLUGIN_NAME));
|
|
@@ -7,4 +10,5 @@ export function getFlowBuilderPlugin(plugins) {
|
|
|
7
10
|
throw new Error(`You must include '@botonic/plugin-flow-builder' in your plugins file.`);
|
|
8
11
|
return flowBuilderPlugin;
|
|
9
12
|
}
|
|
13
|
+
exports.getFlowBuilderPlugin = getFlowBuilderPlugin;
|
|
10
14
|
//# sourceMappingURL=helpers.js.map
|
package/lib/esm/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAIA,MAAM,wBAAwB,GAAG,0BAA0B,CAAA;AAE3D,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":";;;AAIA,MAAM,wBAAwB,GAAG,0BAA0B,CAAA;AAE3D,SAAgB,oBAAoB,CAAC,OAEpC;IACC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI;IACnD,aAAa;IACb,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAC7B,CAAA;IAC7B,IAAI,CAAC,iBAAiB;QACpB,MAAM,IAAI,KAAK,CACb,uEAAuE,CACxE,CAAA;IACH,OAAO,iBAAiB,CAAA;AAC1B,CAAC;AAZD,oDAYC"}
|