@botonic/plugin-flow-builder 0.41.1-alpha.3 → 0.42.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/action/index.d.ts +1 -0
- package/lib/cjs/action/index.js +9 -3
- package/lib/cjs/action/index.js.map +1 -1
- package/lib/cjs/api.js +1 -10
- package/lib/cjs/api.js.map +1 -1
- package/lib/cjs/content-fields/content-fields-base.d.ts +5 -1
- package/lib/cjs/content-fields/content-fields-base.js.map +1 -1
- package/lib/cjs/content-fields/flow-ai-agent.d.ts +2 -2
- package/lib/cjs/content-fields/flow-ai-agent.js +23 -7
- package/lib/cjs/content-fields/flow-ai-agent.js.map +1 -1
- package/lib/cjs/content-fields/flow-bot-action.d.ts +2 -1
- package/lib/cjs/content-fields/flow-bot-action.js +20 -1
- package/lib/cjs/content-fields/flow-bot-action.js.map +1 -1
- package/lib/cjs/content-fields/flow-button.d.ts +2 -1
- package/lib/cjs/content-fields/flow-button.js +7 -0
- package/lib/cjs/content-fields/flow-button.js.map +1 -1
- package/lib/cjs/content-fields/flow-carousel.d.ts +2 -4
- package/lib/cjs/content-fields/flow-carousel.js +8 -50
- package/lib/cjs/content-fields/flow-carousel.js.map +1 -1
- package/lib/cjs/content-fields/flow-channel-conditional.d.ts +14 -0
- package/lib/cjs/content-fields/flow-channel-conditional.js +55 -0
- package/lib/cjs/content-fields/flow-channel-conditional.js.map +1 -0
- package/lib/cjs/content-fields/flow-country-conditional.d.ts +13 -0
- package/lib/cjs/content-fields/flow-country-conditional.js +57 -0
- package/lib/cjs/content-fields/flow-country-conditional.js.map +1 -0
- package/lib/cjs/content-fields/flow-custom-conditional.d.ts +15 -0
- package/lib/cjs/content-fields/flow-custom-conditional.js +77 -0
- package/lib/cjs/content-fields/flow-custom-conditional.js.map +1 -0
- package/lib/cjs/content-fields/flow-element.d.ts +2 -0
- package/lib/cjs/content-fields/flow-element.js +8 -1
- package/lib/cjs/content-fields/flow-element.js.map +1 -1
- package/lib/cjs/content-fields/flow-go-to-flow.d.ts +13 -0
- package/lib/cjs/content-fields/flow-go-to-flow.js +47 -0
- package/lib/cjs/content-fields/flow-go-to-flow.js.map +1 -0
- package/lib/cjs/content-fields/flow-handoff.d.ts +1 -1
- package/lib/cjs/content-fields/flow-handoff.js +7 -0
- package/lib/cjs/content-fields/flow-handoff.js.map +1 -1
- package/lib/cjs/content-fields/flow-image.d.ts +2 -1
- package/lib/cjs/content-fields/flow-image.js +8 -1
- package/lib/cjs/content-fields/flow-image.js.map +1 -1
- package/lib/cjs/content-fields/flow-knowledge-base.d.ts +1 -1
- package/lib/cjs/content-fields/flow-knowledge-base.js +10 -1
- package/lib/cjs/content-fields/flow-knowledge-base.js.map +1 -1
- package/lib/cjs/content-fields/flow-queue-status-conditional.d.ts +30 -0
- package/lib/cjs/content-fields/flow-queue-status-conditional.js +99 -0
- package/lib/cjs/content-fields/flow-queue-status-conditional.js.map +1 -0
- package/lib/cjs/content-fields/flow-rating.d.ts +1 -1
- package/lib/cjs/content-fields/flow-rating.js +8 -1
- package/lib/cjs/content-fields/flow-rating.js.map +1 -1
- package/lib/cjs/content-fields/flow-text.d.ts +1 -3
- package/lib/cjs/content-fields/flow-text.js +7 -16
- package/lib/cjs/content-fields/flow-text.js.map +1 -1
- package/lib/cjs/content-fields/flow-video.d.ts +2 -1
- package/lib/cjs/content-fields/flow-video.js +8 -1
- package/lib/cjs/content-fields/flow-video.js.map +1 -1
- package/lib/cjs/content-fields/flow-webview.d.ts +2 -1
- package/lib/cjs/content-fields/flow-webview.js +8 -1
- package/lib/cjs/content-fields/flow-webview.js.map +1 -1
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.d.ts +1 -1
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js +8 -1
- package/lib/cjs/content-fields/flow-whatsapp-cta-url-button.js.map +1 -1
- package/lib/cjs/content-fields/hubtype-fields/channel-conditional.d.ts +10 -0
- package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.d.ts +10 -0
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/country-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.d.ts +11 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
- package/lib/cjs/content-fields/hubtype-fields/go-to-flow.d.ts +4 -3
- package/lib/cjs/content-fields/hubtype-fields/node-types.d.ts +3 -3
- package/lib/cjs/content-fields/hubtype-fields/node-types.js +1 -1
- package/lib/cjs/content-fields/hubtype-fields/node-types.js.map +1 -1
- package/lib/cjs/content-fields/hubtype-fields/nodes.d.ts +2 -2
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.d.ts +25 -0
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js +3 -0
- package/lib/cjs/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
- package/lib/cjs/content-fields/index.d.ts +7 -2
- package/lib/cjs/content-fields/index.js +11 -1
- package/lib/cjs/content-fields/index.js.map +1 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +2 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +7 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js.map +1 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.d.ts +2 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +7 -0
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js.map +1 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.d.ts +1 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +8 -1
- package/lib/cjs/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
- package/lib/cjs/flow-factory.d.ts +12 -0
- package/lib/cjs/flow-factory.js +65 -0
- package/lib/cjs/flow-factory.js.map +1 -0
- package/lib/cjs/functions/index.d.ts +11 -10
- package/lib/cjs/functions/index.js +49 -12
- package/lib/cjs/functions/index.js.map +1 -1
- package/lib/cjs/index.d.ts +0 -3
- package/lib/cjs/index.js +13 -66
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/services/hubtype-queues-api.d.ts +14 -0
- package/lib/cjs/services/hubtype-queues-api.js +28 -0
- package/lib/cjs/services/hubtype-queues-api.js.map +1 -0
- package/lib/cjs/tracking.d.ts +3 -0
- package/lib/cjs/tracking.js +29 -15
- package/lib/cjs/tracking.js.map +1 -1
- package/lib/esm/action/index.d.ts +1 -0
- package/lib/esm/action/index.js +9 -3
- package/lib/esm/action/index.js.map +1 -1
- package/lib/esm/api.js +2 -11
- package/lib/esm/api.js.map +1 -1
- package/lib/esm/content-fields/content-fields-base.d.ts +5 -1
- package/lib/esm/content-fields/content-fields-base.js.map +1 -1
- package/lib/esm/content-fields/flow-ai-agent.d.ts +2 -2
- package/lib/esm/content-fields/flow-ai-agent.js +24 -8
- package/lib/esm/content-fields/flow-ai-agent.js.map +1 -1
- package/lib/esm/content-fields/flow-bot-action.d.ts +2 -1
- package/lib/esm/content-fields/flow-bot-action.js +21 -2
- package/lib/esm/content-fields/flow-bot-action.js.map +1 -1
- package/lib/esm/content-fields/flow-button.d.ts +2 -1
- package/lib/esm/content-fields/flow-button.js +7 -0
- package/lib/esm/content-fields/flow-button.js.map +1 -1
- package/lib/esm/content-fields/flow-carousel.d.ts +2 -4
- package/lib/esm/content-fields/flow-carousel.js +9 -51
- package/lib/esm/content-fields/flow-carousel.js.map +1 -1
- package/lib/esm/content-fields/flow-channel-conditional.d.ts +14 -0
- package/lib/esm/content-fields/flow-channel-conditional.js +51 -0
- package/lib/esm/content-fields/flow-channel-conditional.js.map +1 -0
- package/lib/esm/content-fields/flow-country-conditional.d.ts +13 -0
- package/lib/esm/content-fields/flow-country-conditional.js +53 -0
- package/lib/esm/content-fields/flow-country-conditional.js.map +1 -0
- package/lib/esm/content-fields/flow-custom-conditional.d.ts +15 -0
- package/lib/esm/content-fields/flow-custom-conditional.js +73 -0
- package/lib/esm/content-fields/flow-custom-conditional.js.map +1 -0
- package/lib/esm/content-fields/flow-element.d.ts +2 -0
- package/lib/esm/content-fields/flow-element.js +8 -1
- package/lib/esm/content-fields/flow-element.js.map +1 -1
- package/lib/esm/content-fields/flow-go-to-flow.d.ts +13 -0
- package/lib/esm/content-fields/flow-go-to-flow.js +43 -0
- package/lib/esm/content-fields/flow-go-to-flow.js.map +1 -0
- package/lib/esm/content-fields/flow-handoff.d.ts +1 -1
- package/lib/esm/content-fields/flow-handoff.js +7 -0
- package/lib/esm/content-fields/flow-handoff.js.map +1 -1
- package/lib/esm/content-fields/flow-image.d.ts +2 -1
- package/lib/esm/content-fields/flow-image.js +8 -1
- package/lib/esm/content-fields/flow-image.js.map +1 -1
- package/lib/esm/content-fields/flow-knowledge-base.d.ts +1 -1
- package/lib/esm/content-fields/flow-knowledge-base.js +10 -1
- package/lib/esm/content-fields/flow-knowledge-base.js.map +1 -1
- package/lib/esm/content-fields/flow-queue-status-conditional.d.ts +30 -0
- package/lib/esm/content-fields/flow-queue-status-conditional.js +95 -0
- package/lib/esm/content-fields/flow-queue-status-conditional.js.map +1 -0
- package/lib/esm/content-fields/flow-rating.d.ts +1 -1
- package/lib/esm/content-fields/flow-rating.js +8 -1
- package/lib/esm/content-fields/flow-rating.js.map +1 -1
- package/lib/esm/content-fields/flow-text.d.ts +1 -3
- package/lib/esm/content-fields/flow-text.js +9 -18
- package/lib/esm/content-fields/flow-text.js.map +1 -1
- package/lib/esm/content-fields/flow-video.d.ts +2 -1
- package/lib/esm/content-fields/flow-video.js +8 -1
- package/lib/esm/content-fields/flow-video.js.map +1 -1
- package/lib/esm/content-fields/flow-webview.d.ts +2 -1
- package/lib/esm/content-fields/flow-webview.js +8 -1
- package/lib/esm/content-fields/flow-webview.js.map +1 -1
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.d.ts +1 -1
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js +8 -1
- package/lib/esm/content-fields/flow-whatsapp-cta-url-button.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.d.ts +10 -0
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.js +2 -0
- package/lib/esm/content-fields/hubtype-fields/channel-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/country-conditional.d.ts +10 -0
- package/lib/esm/content-fields/hubtype-fields/country-conditional.js +2 -0
- package/lib/esm/content-fields/hubtype-fields/country-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.d.ts +11 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.js +2 -0
- package/lib/esm/content-fields/hubtype-fields/custom-conditional.js.map +1 -0
- package/lib/esm/content-fields/hubtype-fields/go-to-flow.d.ts +4 -3
- package/lib/esm/content-fields/hubtype-fields/node-types.d.ts +3 -3
- package/lib/esm/content-fields/hubtype-fields/node-types.js +1 -1
- package/lib/esm/content-fields/hubtype-fields/node-types.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/nodes.d.ts +2 -2
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.d.ts +25 -0
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js +2 -0
- package/lib/esm/content-fields/hubtype-fields/queue-status-conditional.js.map +1 -0
- package/lib/esm/content-fields/index.d.ts +7 -2
- package/lib/esm/content-fields/index.js +6 -1
- package/lib/esm/content-fields/index.js.map +1 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.d.ts +2 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.js +7 -0
- 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.d.ts +2 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.js +7 -0
- 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.d.ts +1 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js +8 -1
- package/lib/esm/content-fields/whatsapp-button-list/flow-whatsapp-button-list.js.map +1 -1
- package/lib/esm/flow-factory.d.ts +12 -0
- package/lib/esm/flow-factory.js +61 -0
- package/lib/esm/flow-factory.js.map +1 -0
- package/lib/esm/functions/index.d.ts +11 -10
- package/lib/esm/functions/index.js +46 -11
- package/lib/esm/functions/index.js.map +1 -1
- package/lib/esm/index.d.ts +0 -3
- package/lib/esm/index.js +14 -67
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/services/hubtype-queues-api.d.ts +14 -0
- package/lib/esm/services/hubtype-queues-api.js +24 -0
- package/lib/esm/services/hubtype-queues-api.js.map +1 -0
- package/lib/esm/tracking.d.ts +3 -0
- package/lib/esm/tracking.js +27 -14
- package/lib/esm/tracking.js.map +1 -1
- package/package.json +2 -2
- package/src/action/index.tsx +11 -3
- package/src/api.ts +3 -11
- package/src/content-fields/content-fields-base.ts +8 -0
- package/src/content-fields/flow-ai-agent.tsx +41 -8
- package/src/content-fields/flow-bot-action.tsx +22 -2
- package/src/content-fields/flow-button.tsx +6 -1
- package/src/content-fields/flow-carousel.tsx +7 -109
- package/src/content-fields/flow-channel-conditional.tsx +65 -0
- package/src/content-fields/flow-country-conditional.tsx +67 -0
- package/src/content-fields/flow-custom-conditional.tsx +98 -0
- package/src/content-fields/flow-element.tsx +7 -2
- package/src/content-fields/flow-go-to-flow.tsx +51 -0
- package/src/content-fields/flow-handoff.tsx +7 -1
- package/src/content-fields/flow-image.tsx +8 -2
- package/src/content-fields/flow-knowledge-base.tsx +9 -1
- package/src/content-fields/flow-queue-status-conditional.tsx +130 -0
- package/src/content-fields/flow-rating.tsx +6 -1
- package/src/content-fields/flow-text.tsx +6 -32
- package/src/content-fields/flow-video.tsx +8 -2
- package/src/content-fields/flow-webview.tsx +9 -1
- package/src/content-fields/flow-whatsapp-cta-url-button.tsx +7 -1
- package/src/content-fields/hubtype-fields/channel-conditional.ts +11 -0
- package/src/content-fields/hubtype-fields/country-conditional.ts +11 -0
- package/src/content-fields/hubtype-fields/custom-conditional.ts +12 -0
- package/src/content-fields/hubtype-fields/go-to-flow.ts +4 -3
- package/src/content-fields/hubtype-fields/node-types.ts +1 -1
- package/src/content-fields/hubtype-fields/nodes.ts +10 -1
- package/src/content-fields/hubtype-fields/queue-status-conditional.ts +53 -0
- package/src/content-fields/index.ts +15 -0
- package/src/content-fields/whatsapp-button-list/flow-whatsapp-button-list-row.tsx +7 -1
- package/src/content-fields/whatsapp-button-list/flow-whatsapp-button-list-section.tsx +6 -0
- package/src/content-fields/whatsapp-button-list/flow-whatsapp-button-list.tsx +7 -1
- package/src/flow-factory.ts +126 -0
- package/src/functions/index.ts +77 -11
- package/src/index.ts +24 -120
- package/src/{functions/conditional-queue-status.ts → services/hubtype-queues-api.ts} +7 -41
- package/src/tracking.ts +35 -12
- package/lib/cjs/functions/conditional-bot-variable.d.ts +0 -8
- package/lib/cjs/functions/conditional-bot-variable.js +0 -11
- package/lib/cjs/functions/conditional-bot-variable.js.map +0 -1
- package/lib/cjs/functions/conditional-country.d.ts +0 -7
- package/lib/cjs/functions/conditional-country.js +0 -9
- package/lib/cjs/functions/conditional-country.js.map +0 -1
- package/lib/cjs/functions/conditional-provider.d.ts +0 -7
- package/lib/cjs/functions/conditional-provider.js +0 -9
- package/lib/cjs/functions/conditional-provider.js.map +0 -1
- package/lib/cjs/functions/conditional-queue-status.d.ts +0 -29
- package/lib/cjs/functions/conditional-queue-status.js +0 -51
- package/lib/cjs/functions/conditional-queue-status.js.map +0 -1
- package/lib/esm/functions/conditional-bot-variable.d.ts +0 -8
- package/lib/esm/functions/conditional-bot-variable.js +0 -7
- package/lib/esm/functions/conditional-bot-variable.js.map +0 -1
- package/lib/esm/functions/conditional-country.d.ts +0 -7
- package/lib/esm/functions/conditional-country.js +0 -5
- package/lib/esm/functions/conditional-country.js.map +0 -1
- package/lib/esm/functions/conditional-provider.d.ts +0 -7
- package/lib/esm/functions/conditional-provider.js +0 -5
- package/lib/esm/functions/conditional-provider.js.map +0 -1
- package/lib/esm/functions/conditional-queue-status.d.ts +0 -29
- package/lib/esm/functions/conditional-queue-status.js +0 -45
- package/lib/esm/functions/conditional-queue-status.js.map +0 -1
- package/src/functions/conditional-bot-variable.ts +0 -18
- package/src/functions/conditional-country.ts +0 -14
- package/src/functions/conditional-provider.ts +0 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-country-conditional.js","sourceRoot":"","sources":["../../../src/content-fields/flow-country-conditional.tsx"],"names":[],"mappings":";;;;;AAAA,wCAAoE;AAIpE,0CAGoB;AACpB,+DAAyD;AAIzD,MAAa,sBAAuB,SAAQ,uCAAiB;IAA7D;;QACS,kBAAa,GAAuB,EAAE,CAAA;QACtC,sBAAiB,GAAsB,SAAS,CAAA;IAoDzD,CAAC;IAlDC,MAAM,CAAC,cAAc,CACnB,SAAmC,EACnC,OAAsB;QAEtB,MAAM,qBAAqB,GAAG,IAAI,sBAAsB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QACtE,qBAAqB,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;QAC3C,qBAAqB,CAAC,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,cAAc,CAAA;QACtE,qBAAqB,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAA;QAEnD,OAAO,qBAAqB,CAAA;IAC9B,CAAC;IAED,oBAAoB,CAAC,OAAsB;QACzC,MAAM,OAAO,GAAG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AAA;;KAC7C;IAED,SAAS;QACP,OAAO,kDAAK,CAAA;IACd,CAAC;CACF;AAtDD,wDAsDC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ActionRequest } from '@botonic/react';
|
|
2
|
+
import { ContentFieldsBase } from './content-fields-base';
|
|
3
|
+
import { HtCustomConditionalNode } from './hubtype-fields/custom-conditional';
|
|
4
|
+
import { HtFunctionArguments, HtFunctionResult } from './hubtype-fields/function';
|
|
5
|
+
export declare class FlowCustomConditional extends ContentFieldsBase {
|
|
6
|
+
arguments: HtFunctionArguments[];
|
|
7
|
+
resultMapping: HtFunctionResult[];
|
|
8
|
+
conditionalResult?: HtFunctionResult;
|
|
9
|
+
customResult: string;
|
|
10
|
+
variableFormat: string;
|
|
11
|
+
static fromHubtypeCMS(component: HtCustomConditionalNode, request: ActionRequest): FlowCustomConditional;
|
|
12
|
+
setConditionalResult(request: ActionRequest): void;
|
|
13
|
+
trackFlow(request: ActionRequest): Promise<void>;
|
|
14
|
+
toBotonic(): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowCustomConditional = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const core_1 = require("@botonic/core");
|
|
7
|
+
const tracking_1 = require("../tracking");
|
|
8
|
+
const utils_1 = require("../utils");
|
|
9
|
+
const content_fields_base_1 = require("./content-fields-base");
|
|
10
|
+
class FlowCustomConditional extends content_fields_base_1.ContentFieldsBase {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.arguments = [];
|
|
14
|
+
this.conditionalResult = undefined;
|
|
15
|
+
this.customResult = '';
|
|
16
|
+
this.variableFormat = '';
|
|
17
|
+
}
|
|
18
|
+
static fromHubtypeCMS(component, request) {
|
|
19
|
+
const newCustomConditional = new FlowCustomConditional(component.id);
|
|
20
|
+
newCustomConditional.code = component.code;
|
|
21
|
+
newCustomConditional.arguments = component.content.arguments;
|
|
22
|
+
newCustomConditional.resultMapping = component.content.result_mapping;
|
|
23
|
+
newCustomConditional.setConditionalResult(request);
|
|
24
|
+
newCustomConditional.variableFormat = component.content.arguments[0].type;
|
|
25
|
+
return newCustomConditional;
|
|
26
|
+
}
|
|
27
|
+
setConditionalResult(request) {
|
|
28
|
+
const functionArgument = this.arguments.find(arg => {
|
|
29
|
+
if ('name' in arg) {
|
|
30
|
+
return arg.name === 'keyPath';
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
});
|
|
34
|
+
let keyPath = '';
|
|
35
|
+
if (functionArgument && 'value' in functionArgument) {
|
|
36
|
+
keyPath = functionArgument.value;
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
throw new Error(`Key path not found for node ${this.code}`);
|
|
40
|
+
}
|
|
41
|
+
const botVariable = (0, utils_1.getValueFromKeyPath)(request, keyPath);
|
|
42
|
+
const conditionalResult = this.resultMapping.find(rMap => rMap.result === botVariable) ||
|
|
43
|
+
this.resultMapping.find(rMap => rMap.result === 'default');
|
|
44
|
+
if (!conditionalResult) {
|
|
45
|
+
throw new Error(`No conditional result found for node ${this.code} with key path: ${keyPath}`);
|
|
46
|
+
}
|
|
47
|
+
this.conditionalResult = conditionalResult;
|
|
48
|
+
this.customResult = conditionalResult.result;
|
|
49
|
+
this.followUp = conditionalResult.target;
|
|
50
|
+
}
|
|
51
|
+
trackFlow(request) {
|
|
52
|
+
var _a;
|
|
53
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = (0, tracking_1.getCommonFlowContentEventArgsForContentId)(request, this.id);
|
|
55
|
+
if (!((_a = this.conditionalResult) === null || _a === void 0 ? void 0 : _a.result)) {
|
|
56
|
+
console.warn(`Tracking event for node ${this.code} but no conditional result found`);
|
|
57
|
+
}
|
|
58
|
+
const eventCustomConditional = {
|
|
59
|
+
action: core_1.EventAction.ConditionalCustom,
|
|
60
|
+
flowThreadId,
|
|
61
|
+
flowId,
|
|
62
|
+
flowName,
|
|
63
|
+
flowNodeId,
|
|
64
|
+
flowNodeContentId,
|
|
65
|
+
conditionalVariable: this.customResult,
|
|
66
|
+
variableFormat: this.variableFormat,
|
|
67
|
+
};
|
|
68
|
+
const { action } = eventCustomConditional, eventArgs = tslib_1.__rest(eventCustomConditional, ["action"]);
|
|
69
|
+
yield (0, tracking_1.trackEvent)(request, action, eventArgs);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
toBotonic() {
|
|
73
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.FlowCustomConditional = FlowCustomConditional;
|
|
77
|
+
//# sourceMappingURL=flow-custom-conditional.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-custom-conditional.js","sourceRoot":"","sources":["../../../src/content-fields/flow-custom-conditional.tsx"],"names":[],"mappings":";;;;;AAAA,wCAAmE;AAInE,0CAGoB;AACpB,oCAA8C;AAC9C,+DAAyD;AAQzD,MAAa,qBAAsB,SAAQ,uCAAiB;IAA5D;;QACS,cAAS,GAA0B,EAAE,CAAA;QAErC,sBAAiB,GAAsB,SAAS,CAAA;QAChD,iBAAY,GAAW,EAAE,CAAA;QACzB,mBAAc,GAAW,EAAE,CAAA;IA2EpC,CAAC;IAzEC,MAAM,CAAC,cAAc,CACnB,SAAkC,EAClC,OAAsB;QAEtB,MAAM,oBAAoB,GAAG,IAAI,qBAAqB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QACpE,oBAAoB,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAA;QAC1C,oBAAoB,CAAC,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,SAAS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CAAC,YAAY,GAAG,iBAAiB,CAAC,MAAM,CAAA;QAC5C,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC,MAAM,CAAA;IAC1C,CAAC;IAEK,SAAS,CAAC,OAAsB;;;YACpC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAAiB,EAAE,GACrE,IAAA,oDAAyC,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAA;YAC7D,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,iBAAiB,0CAAE,MAAM,CAAA,EAAE;gBACnC,OAAO,CAAC,IAAI,CACV,2BAA2B,IAAI,CAAC,IAAI,kCAAkC,CACvE,CAAA;aACF;YACD,MAAM,sBAAsB,GAA2B;gBACrD,MAAM,EAAE,kBAAW,CAAC,iBAAiB;gBACrC,YAAY;gBACZ,MAAM;gBACN,QAAQ;gBACR,UAAU;gBACV,iBAAiB;gBACjB,mBAAmB,EAAE,IAAI,CAAC,YAAY;gBACtC,cAAc,EAAE,IAAI,CAAC,cAAc;aACpC,CAAA;YACD,MAAM,EAAE,MAAM,KAAmB,sBAAsB,EAApC,SAAS,kBAAK,sBAAsB,EAAjD,UAAwB,CAAyB,CAAA;YACvD,MAAM,IAAA,qBAAU,EAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA;;KAC7C;IAED,SAAS;QACP,OAAO,kDAAK,CAAA;IACd,CAAC;CACF;AAhFD,sDAgFC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Button } from '@botonic/core';
|
|
3
|
+
import { ActionRequest } from '@botonic/react';
|
|
3
4
|
import { FlowBuilderApi } from '../api';
|
|
4
5
|
import { ContentFieldsBase } from './content-fields-base';
|
|
5
6
|
import { FlowButton } from './flow-button';
|
|
@@ -17,5 +18,6 @@ export declare class FlowElement extends ContentFieldsBase {
|
|
|
17
18
|
image: string;
|
|
18
19
|
button: Button;
|
|
19
20
|
}): FlowElement;
|
|
21
|
+
trackFlow(_request: ActionRequest): Promise<void>;
|
|
20
22
|
toBotonic(parentId: string): JSX.Element;
|
|
21
23
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowElement = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
6
|
const react_1 = require("@botonic/react");
|
|
6
7
|
const content_fields_base_1 = require("./content-fields-base");
|
|
@@ -27,12 +28,18 @@ class FlowElement extends content_fields_base_1.ContentFieldsBase {
|
|
|
27
28
|
newElement.subtitle = element.subtitle;
|
|
28
29
|
newElement.image = element.image;
|
|
29
30
|
newElement.button = flow_button_1.FlowButton.fromAIAgent({
|
|
30
|
-
id:
|
|
31
|
+
id: '',
|
|
31
32
|
text: element.button.text,
|
|
32
33
|
url: element.button.url,
|
|
33
34
|
});
|
|
34
35
|
return newElement;
|
|
35
36
|
}
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
38
|
+
trackFlow(_request) {
|
|
39
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
// TODO: Not apply for this content, because it is a child of the FlowCarousel content
|
|
41
|
+
});
|
|
42
|
+
}
|
|
36
43
|
toBotonic(parentId) {
|
|
37
44
|
var _a;
|
|
38
45
|
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 }), (_a = this.button) === null || _a === void 0 ? void 0 : _a.renderButton(0)] }, `${parentId}-${this.id}`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-element.js","sourceRoot":"","sources":["../../../src/content-fields/flow-element.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flow-element.js","sourceRoot":"","sources":["../../../src/content-fields/flow-element.tsx"],"names":[],"mappings":";;;;;AACA,0CAA6E;AAG7E,+DAAyD;AACzD,+CAA0C;AAG1C,MAAa,WAAY,SAAQ,uCAAiB;IAAlD;;QACS,UAAK,GAAG,EAAE,CAAA;QACV,aAAQ,GAAG,EAAE,CAAA;QAEb,UAAK,GAAG,EAAE,CAAA;QACV,WAAM,GAAG,KAAK,CAAA;IAuDvB,CAAC;IArDC,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,MAAM,CAAC,WAAW,CAChB,EAAU,EACV,OAKC;QAED,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,EAAE,CAAC,CAAA;QACtC,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,UAAU,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;QACtC,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,UAAU,CAAC,MAAM,GAAG,wBAAU,CAAC,WAAW,CAAC;YACzC,EAAE,EAAE,EAAE;YACN,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI;YACzB,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG;SACxB,CAAC,CAAA;QACF,OAAO,UAAU,CAAA;IACnB,CAAC;IAED,6DAA6D;IACvD,SAAS,CAAC,QAAuB;;YACrC,sFAAsF;QACxF,CAAC;KAAA;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,MAAA,IAAI,CAAC,MAAM,0CAAE,YAAY,CAAC,CAAC,CAAC,KAJjB,GAAG,QAAQ,IAAI,IAAI,CAAC,EAAE,EAAE,CAK5B,CACX,CAAA;IACH,CAAC;CACF;AA5DD,kCA4DC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ActionRequest } from '@botonic/react';
|
|
3
|
+
import { FlowBuilderApi } from '../api';
|
|
4
|
+
import { ContentFieldsBase } from './content-fields-base';
|
|
5
|
+
import { HtGoToFlow } from './hubtype-fields';
|
|
6
|
+
export declare class FlowGoToFlow extends ContentFieldsBase {
|
|
7
|
+
flowTargetId: string;
|
|
8
|
+
flowTargetName: string;
|
|
9
|
+
targetId: string;
|
|
10
|
+
static fromHubtypeCMS(component: HtGoToFlow, cmsApi: FlowBuilderApi): FlowGoToFlow;
|
|
11
|
+
trackFlow(request: ActionRequest): Promise<void>;
|
|
12
|
+
toBotonic(): JSX.Element;
|
|
13
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowGoToFlow = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const core_1 = require("@botonic/core");
|
|
7
|
+
const tracking_1 = require("../tracking");
|
|
8
|
+
const content_fields_base_1 = require("./content-fields-base");
|
|
9
|
+
class FlowGoToFlow extends content_fields_base_1.ContentFieldsBase {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.flowTargetId = '';
|
|
13
|
+
this.flowTargetName = '';
|
|
14
|
+
this.targetId = '';
|
|
15
|
+
}
|
|
16
|
+
static fromHubtypeCMS(component, cmsApi) {
|
|
17
|
+
const newGoToFlow = new FlowGoToFlow(component.id);
|
|
18
|
+
newGoToFlow.flowTargetId = component.content.flow_id;
|
|
19
|
+
const targetId = cmsApi.getNodeByFlowId(component.content.flow_id).id;
|
|
20
|
+
newGoToFlow.targetId = targetId;
|
|
21
|
+
newGoToFlow.flowTargetName = cmsApi.getFlowName(component.content.flow_id);
|
|
22
|
+
newGoToFlow.followUp = cmsApi.getNodeById(targetId);
|
|
23
|
+
return newGoToFlow;
|
|
24
|
+
}
|
|
25
|
+
trackFlow(request) {
|
|
26
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = (0, tracking_1.getCommonFlowContentEventArgsForContentId)(request, this.id);
|
|
28
|
+
const eventGoToFlow = {
|
|
29
|
+
action: core_1.EventAction.RedirectFlow,
|
|
30
|
+
flowThreadId,
|
|
31
|
+
flowId,
|
|
32
|
+
flowName,
|
|
33
|
+
flowNodeId,
|
|
34
|
+
flowNodeContentId,
|
|
35
|
+
flowTargetId: this.flowTargetId,
|
|
36
|
+
flowTargetName: this.flowTargetName,
|
|
37
|
+
};
|
|
38
|
+
const { action } = eventGoToFlow, eventArgs = tslib_1.__rest(eventGoToFlow, ["action"]);
|
|
39
|
+
yield (0, tracking_1.trackEvent)(request, action, eventArgs);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
toBotonic() {
|
|
43
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.FlowGoToFlow = FlowGoToFlow;
|
|
47
|
+
//# sourceMappingURL=flow-go-to-flow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-go-to-flow.js","sourceRoot":"","sources":["../../../src/content-fields/flow-go-to-flow.tsx"],"names":[],"mappings":";;;;;AAAA,wCAA8D;AAI9D,0CAGoB;AACpB,+DAAyD;AAGzD,MAAa,YAAa,SAAQ,uCAAiB;IAAnD;;QACS,iBAAY,GAAW,EAAE,CAAA;QACzB,mBAAc,GAAW,EAAE,CAAA;QAC3B,aAAQ,GAAW,EAAE,CAAA;IAoC9B,CAAC;IAlCC,MAAM,CAAC,cAAc,CACnB,SAAqB,EACrB,MAAsB;QAEtB,MAAM,WAAW,GAAG,IAAI,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QAClD,WAAW,CAAC,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,OAAO,CAAA;QACpD,MAAM,QAAQ,GAAG,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,CAAA;QACrE,WAAW,CAAC,QAAQ,GAAG,QAAQ,CAAA;QAC/B,WAAW,CAAC,cAAc,GAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAC1E,WAAW,CAAC,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAoB,QAAQ,CAAC,CAAA;QAEtE,OAAO,WAAW,CAAA;IACpB,CAAC;IAEK,SAAS,CAAC,OAAsB;;YACpC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAAiB,EAAE,GACrE,IAAA,oDAAyC,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAA;YAC7D,MAAM,aAAa,GAAsB;gBACvC,MAAM,EAAE,kBAAW,CAAC,YAAY;gBAChC,YAAY;gBACZ,MAAM;gBACN,QAAQ;gBACR,UAAU;gBACV,iBAAiB;gBACjB,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,cAAc,EAAE,IAAI,CAAC,cAAc;aACpC,CAAA;YACD,MAAM,EAAE,MAAM,KAAmB,aAAa,EAA3B,SAAS,kBAAK,aAAa,EAAxC,UAAwB,CAAgB,CAAA;YAC9C,MAAM,IAAA,qBAAU,EAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA;QAC9C,CAAC;KAAA;IAED,SAAS;QACP,OAAO,kDAAK,CAAA;IACd,CAAC;CACF;AAvCD,oCAuCC"}
|
|
@@ -4,7 +4,6 @@ import { FlowBuilderApi } from '../api';
|
|
|
4
4
|
import { ContentFieldsBase } from './content-fields-base';
|
|
5
5
|
import { HtHandoffNode, HtQueueLocale } from './hubtype-fields';
|
|
6
6
|
export declare class FlowHandoff extends ContentFieldsBase {
|
|
7
|
-
code: string;
|
|
8
7
|
queue?: HtQueueLocale;
|
|
9
8
|
onFinishPayload?: string;
|
|
10
9
|
handoffAutoAssign: boolean;
|
|
@@ -13,5 +12,6 @@ export declare class FlowHandoff extends ContentFieldsBase {
|
|
|
13
12
|
static fromHubtypeCMS(cmsHandoff: HtHandoffNode, locale: string, cmsApi: FlowBuilderApi): FlowHandoff;
|
|
14
13
|
private static getOnFinishPayload;
|
|
15
14
|
doHandoff(request: ActionRequest): Promise<void>;
|
|
15
|
+
trackFlow(_request: ActionRequest): Promise<void>;
|
|
16
16
|
toBotonic(id: string, request: ActionRequest): JSX.Element;
|
|
17
17
|
}
|
|
@@ -16,6 +16,7 @@ class FlowHandoff extends content_fields_base_1.ContentFieldsBase {
|
|
|
16
16
|
newHandoff.handoffAutoAssign = cmsHandoff.content.has_auto_assign;
|
|
17
17
|
newHandoff.hasQueuePositionChangedNotificationsEnabled =
|
|
18
18
|
cmsHandoff.content.has_queue_position_changed_notifications_enabled;
|
|
19
|
+
newHandoff.followUp = cmsHandoff.follow_up;
|
|
19
20
|
return newHandoff;
|
|
20
21
|
}
|
|
21
22
|
static getOnFinishPayload(cmsHandoff, cmsApi) {
|
|
@@ -54,6 +55,12 @@ class FlowHandoff extends content_fields_base_1.ContentFieldsBase {
|
|
|
54
55
|
}
|
|
55
56
|
});
|
|
56
57
|
}
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
59
|
+
trackFlow(_request) {
|
|
60
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
// TODO: Not apply for this content because backend track handoff success event
|
|
62
|
+
});
|
|
63
|
+
}
|
|
57
64
|
toBotonic(id, request) {
|
|
58
65
|
return (0, core_1.isDev)(request.session) || (0, core_1.isWebchat)(request.session) ? ((0, jsx_runtime_1.jsx)(react_1.WebchatSettings, { enableUserInput: true }, id)) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {}));
|
|
59
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-handoff.js","sourceRoot":"","sources":["../../../src/content-fields/flow-handoff.tsx"],"names":[],"mappings":";;;;;AAAA,wCAA+E;AAC/E,0CAA+D;AAG/D,0CAAuE;AACvE,+DAAyD;AAGzD,MAAa,WAAY,SAAQ,uCAAiB;
|
|
1
|
+
{"version":3,"file":"flow-handoff.js","sourceRoot":"","sources":["../../../src/content-fields/flow-handoff.tsx"],"names":[],"mappings":";;;;;AAAA,wCAA+E;AAC/E,0CAA+D;AAG/D,0CAAuE;AACvE,+DAAyD;AAGzD,MAAa,WAAY,SAAQ,uCAAiB;IAOhD,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,CAA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vC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,iBAAiB,EAAE,GACvD,IAAA,oDAAyC,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAA;gBAE7D,cAAc,CAAC,YAAY,CAAC;oBAC1B,MAAM;oBACN,QAAQ;oBACR,UAAU;oBACV,iBAAiB;iBAClB,CAAC,CAAA;gBAEF,cAAc,CAAC,aAAa,CAAC;oBAC3B,QAAQ;iBACT,CAAC,CAAA;gBAEF,MAAM,cAAc,CAAC,OAAO,EAAE,CAAA;aAC/B;QACH,CAAC;KAAA;IAED,6DAA6D;IACvD,SAAS,CAAC,QAAuB;;YACrC,+EAA+E;QACjF,CAAC;KAAA;IAED,SAAS,CAAC,EAAU,EAAE,OAAsB;QAC1C,OAAO,IAAA,YAAK,EAAC,OAAO,CAAC,OAAO,CAAC,IAAI,IAAA,gBAAS,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAC5D,uBAAC,uBAAe,IAAU,eAAe,EAAE,IAAI,IAAzB,EAAE,CAA2B,CACpD,CAAC,CAAC,CAAC,CACF,kDAAK,CACN,CAAA;IACH,CAAC;CACF;AApFD,kCAoFC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ActionRequest } from '@botonic/react';
|
|
2
3
|
import { ContentFieldsBase } from './content-fields-base';
|
|
3
4
|
import { HtImageNode } from './hubtype-fields';
|
|
4
5
|
export declare class FlowImage extends ContentFieldsBase {
|
|
5
6
|
src: string;
|
|
6
|
-
code: string;
|
|
7
7
|
static fromHubtypeCMS(component: HtImageNode, locale: string): FlowImage;
|
|
8
|
+
trackFlow(request: ActionRequest): Promise<void>;
|
|
8
9
|
toBotonic(id: string): JSX.Element;
|
|
9
10
|
}
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowImage = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
6
|
const react_1 = require("@botonic/react");
|
|
7
|
+
const tracking_1 = require("../tracking");
|
|
6
8
|
const content_fields_base_1 = require("./content-fields-base");
|
|
7
9
|
class FlowImage extends content_fields_base_1.ContentFieldsBase {
|
|
8
10
|
constructor() {
|
|
9
11
|
super(...arguments);
|
|
10
12
|
this.src = '';
|
|
11
|
-
this.code = '';
|
|
12
13
|
}
|
|
13
14
|
static fromHubtypeCMS(component, locale) {
|
|
14
15
|
const newImage = new FlowImage(component.id);
|
|
15
16
|
newImage.code = component.code;
|
|
16
17
|
newImage.src = this.getAssetByLocale(locale, component.content.image);
|
|
18
|
+
newImage.followUp = component.follow_up;
|
|
17
19
|
return newImage;
|
|
18
20
|
}
|
|
21
|
+
trackFlow(request) {
|
|
22
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
yield (0, tracking_1.trackOneContent)(request, this);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
19
26
|
toBotonic(id) {
|
|
20
27
|
return (0, jsx_runtime_1.jsx)(react_1.Image, { src: this.src }, id);
|
|
21
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-image.js","sourceRoot":"","sources":["../../../src/content-fields/flow-image.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flow-image.js","sourceRoot":"","sources":["../../../src/content-fields/flow-image.tsx"],"names":[],"mappings":";;;;;AAAA,0CAAqD;AAGrD,0CAA6C;AAC7C,+DAAyD;AAGzD,MAAa,SAAU,SAAQ,uCAAiB;IAAhD;;QACS,QAAG,GAAG,EAAE,CAAA;IAkBjB,CAAC;IAhBC,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,QAAQ,CAAC,QAAQ,GAAG,SAAS,CAAC,SAAS,CAAA;QAEvC,OAAO,QAAQ,CAAA;IACjB,CAAC;IAEK,SAAS,CAAC,OAAsB;;YACpC,MAAM,IAAA,0BAAe,EAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QACtC,CAAC;KAAA;IAED,SAAS,CAAC,EAAU;QAClB,OAAO,uBAAC,aAAK,IAAU,GAAG,EAAE,IAAI,CAAC,GAAG,IAAjB,EAAE,CAAmB,CAAA;IAC1C,CAAC;CACF;AAnBD,8BAmBC"}
|
|
@@ -4,7 +4,6 @@ import { ContentFieldsBase } from './content-fields-base';
|
|
|
4
4
|
import { HtKnowledgeBaseNode } from './hubtype-fields';
|
|
5
5
|
export declare const DISABLED_MEMORY_LENGTH = 1;
|
|
6
6
|
export declare class FlowKnowledgeBase extends ContentFieldsBase {
|
|
7
|
-
code: string;
|
|
8
7
|
feedbackEnabled: boolean;
|
|
9
8
|
sources: string[];
|
|
10
9
|
text: string;
|
|
@@ -17,5 +16,6 @@ export declare class FlowKnowledgeBase extends ContentFieldsBase {
|
|
|
17
16
|
hasMemory: boolean;
|
|
18
17
|
memoryLength: number;
|
|
19
18
|
static fromHubtypeCMS(component: HtKnowledgeBaseNode): FlowKnowledgeBase;
|
|
19
|
+
trackFlow(_request: ActionRequest): Promise<void>;
|
|
20
20
|
toBotonic(id: string, request: ActionRequest): JSX.Element;
|
|
21
21
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowKnowledgeBase = exports.DISABLED_MEMORY_LENGTH = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
6
|
const react_1 = require("@botonic/react");
|
|
6
7
|
const content_fields_base_1 = require("./content-fields-base");
|
|
@@ -8,7 +9,6 @@ exports.DISABLED_MEMORY_LENGTH = 1;
|
|
|
8
9
|
class FlowKnowledgeBase extends content_fields_base_1.ContentFieldsBase {
|
|
9
10
|
constructor() {
|
|
10
11
|
super(...arguments);
|
|
11
|
-
this.code = '';
|
|
12
12
|
this.feedbackEnabled = false;
|
|
13
13
|
this.sources = [];
|
|
14
14
|
this.text = '';
|
|
@@ -23,8 +23,17 @@ class FlowKnowledgeBase extends content_fields_base_1.ContentFieldsBase {
|
|
|
23
23
|
newKnowledgeBase.hasMemory = component.content.has_memory || false;
|
|
24
24
|
newKnowledgeBase.memoryLength =
|
|
25
25
|
component.content.memory_length || exports.DISABLED_MEMORY_LENGTH;
|
|
26
|
+
newKnowledgeBase.followUp = component.follow_up;
|
|
26
27
|
return newKnowledgeBase;
|
|
27
28
|
}
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
|
+
trackFlow(_request) {
|
|
31
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
// TODO: Review how we can track here the knowledge base event here.
|
|
33
|
+
// We should store event args in an attribute of FlowKnowledgeBase
|
|
34
|
+
// when knowledge base is resolved inside the flow builder action
|
|
35
|
+
});
|
|
36
|
+
}
|
|
28
37
|
toBotonic(id, request) {
|
|
29
38
|
return ((0, jsx_runtime_1.jsx)(react_1.Text, Object.assign({ feedbackEnabled: this.feedbackEnabled, inferenceId: this.inferenceId, botInteractionId: request.input.bot_interaction_id }, { children: this.text }), id));
|
|
30
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-knowledge-base.js","sourceRoot":"","sources":["../../../src/content-fields/flow-knowledge-base.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flow-knowledge-base.js","sourceRoot":"","sources":["../../../src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kBAAkB,gBAEjD,IAAI,CAAC,IAAI,KALL,EAAE,CAMF,CACR,CAAA;IACH,CAAC;CACF;AA3CD,8CA2CC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ActionRequest } from '@botonic/react';
|
|
3
|
+
import { ContentFieldsBase } from './content-fields-base';
|
|
4
|
+
import { HtFunctionArguments, HtFunctionResult } from './hubtype-fields/function';
|
|
5
|
+
import { HtQueueStatusConditionalNode, HtQueueStatusConditionalResultMapping } from './hubtype-fields/queue-status-conditional';
|
|
6
|
+
declare enum QueueStatusResult {
|
|
7
|
+
OPEN = "open",
|
|
8
|
+
CLOSED = "closed",
|
|
9
|
+
OPEN_WITHOUT_AGENTS = "open-without-agents"
|
|
10
|
+
}
|
|
11
|
+
type ConditionalQueueStatusArgs = {
|
|
12
|
+
queueId: string;
|
|
13
|
+
queueName: string;
|
|
14
|
+
checkAvailableAgents: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare class FlowQueueStatusConditional extends ContentFieldsBase {
|
|
17
|
+
arguments: HtFunctionArguments[];
|
|
18
|
+
resultMapping: HtQueueStatusConditionalResultMapping;
|
|
19
|
+
conditionalResult?: HtFunctionResult;
|
|
20
|
+
queueId: string;
|
|
21
|
+
queueName: string;
|
|
22
|
+
isQueueOpen: boolean;
|
|
23
|
+
isAvailableAgent: boolean;
|
|
24
|
+
static fromHubtypeCMS(component: HtQueueStatusConditionalNode, locale: string): Promise<FlowQueueStatusConditional>;
|
|
25
|
+
setConditionalResult(locale: string): Promise<void>;
|
|
26
|
+
conditionalQueueStatus({ queueId, checkAvailableAgents, queueName, }: ConditionalQueueStatusArgs): Promise<QueueStatusResult>;
|
|
27
|
+
trackFlow(request: ActionRequest): Promise<void>;
|
|
28
|
+
toBotonic(): JSX.Element;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowQueueStatusConditional = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const core_1 = require("@botonic/core");
|
|
7
|
+
const functions_1 = require("../functions");
|
|
8
|
+
const hubtype_queues_api_1 = require("../services/hubtype-queues-api");
|
|
9
|
+
const tracking_1 = require("../tracking");
|
|
10
|
+
const content_fields_base_1 = require("./content-fields-base");
|
|
11
|
+
var QueueStatusResult;
|
|
12
|
+
(function (QueueStatusResult) {
|
|
13
|
+
QueueStatusResult["OPEN"] = "open";
|
|
14
|
+
QueueStatusResult["CLOSED"] = "closed";
|
|
15
|
+
QueueStatusResult["OPEN_WITHOUT_AGENTS"] = "open-without-agents";
|
|
16
|
+
})(QueueStatusResult || (QueueStatusResult = {}));
|
|
17
|
+
class FlowQueueStatusConditional extends content_fields_base_1.ContentFieldsBase {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.arguments = [];
|
|
21
|
+
this.queueId = '';
|
|
22
|
+
this.queueName = '';
|
|
23
|
+
this.isQueueOpen = false;
|
|
24
|
+
this.isAvailableAgent = false;
|
|
25
|
+
}
|
|
26
|
+
static fromHubtypeCMS(component, locale) {
|
|
27
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const newChannelConditional = new FlowQueueStatusConditional(component.id);
|
|
29
|
+
newChannelConditional.code = component.code;
|
|
30
|
+
newChannelConditional.arguments = component.content.arguments;
|
|
31
|
+
newChannelConditional.resultMapping = component.content
|
|
32
|
+
.result_mapping;
|
|
33
|
+
yield newChannelConditional.setConditionalResult(locale);
|
|
34
|
+
return newChannelConditional;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
setConditionalResult(locale) {
|
|
38
|
+
var _a, _b, _c;
|
|
39
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const args = (0, functions_1.getArgumentsByLocale)(this.arguments, locale);
|
|
41
|
+
const queueId = ((_a = args.find(arg => arg.name === 'queue_id')) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
42
|
+
const queueName = ((_b = args.find(arg => arg.name === 'queue_name')) === null || _b === void 0 ? void 0 : _b.value) || '';
|
|
43
|
+
const checkAvailableAgents = ((_c = args.find(arg => arg.name === 'check_available_agents')) === null || _c === void 0 ? void 0 : _c.value) || false;
|
|
44
|
+
const queueStatus = yield this.conditionalQueueStatus({
|
|
45
|
+
queueId,
|
|
46
|
+
queueName,
|
|
47
|
+
checkAvailableAgents,
|
|
48
|
+
});
|
|
49
|
+
const conditionalResult = this.resultMapping.find(rMap => rMap.result === queueStatus);
|
|
50
|
+
if (!conditionalResult) {
|
|
51
|
+
throw new Error(`No conditional result found for node ${this.code} with queue: ${queueName}`);
|
|
52
|
+
}
|
|
53
|
+
this.conditionalResult = conditionalResult;
|
|
54
|
+
this.followUp = conditionalResult.target;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
conditionalQueueStatus({ queueId, checkAvailableAgents, queueName, }) {
|
|
58
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
const queuesApi = new hubtype_queues_api_1.HubtypeQueuesApi(queueId, checkAvailableAgents);
|
|
60
|
+
const data = yield queuesApi.getAvailability();
|
|
61
|
+
this.queueId = queueId;
|
|
62
|
+
this.queueName = queueName;
|
|
63
|
+
this.isQueueOpen = data.open;
|
|
64
|
+
this.isAvailableAgent = data.available_agents > 0;
|
|
65
|
+
if (checkAvailableAgents && data.open && data.available_agents === 0) {
|
|
66
|
+
return QueueStatusResult.OPEN_WITHOUT_AGENTS;
|
|
67
|
+
}
|
|
68
|
+
return data.open ? QueueStatusResult.OPEN : QueueStatusResult.CLOSED;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
trackFlow(request) {
|
|
72
|
+
var _a;
|
|
73
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
const { flowThreadId, flowId, flowName, flowNodeId, flowNodeContentId } = (0, tracking_1.getCommonFlowContentEventArgsForContentId)(request, this.id);
|
|
75
|
+
if (!((_a = this.conditionalResult) === null || _a === void 0 ? void 0 : _a.result)) {
|
|
76
|
+
console.warn(`Tracking event for node ${this.code} but no conditional result found`);
|
|
77
|
+
}
|
|
78
|
+
const eventQueueStatusConditional = {
|
|
79
|
+
action: core_1.EventAction.ConditionalQueueStatus,
|
|
80
|
+
flowThreadId,
|
|
81
|
+
flowId,
|
|
82
|
+
flowName,
|
|
83
|
+
flowNodeId,
|
|
84
|
+
flowNodeContentId,
|
|
85
|
+
queueId: this.queueId,
|
|
86
|
+
queueName: this.queueName,
|
|
87
|
+
isQueueOpen: this.isQueueOpen,
|
|
88
|
+
isAvailableAgent: this.isAvailableAgent,
|
|
89
|
+
};
|
|
90
|
+
const { action } = eventQueueStatusConditional, eventArgs = tslib_1.__rest(eventQueueStatusConditional, ["action"]);
|
|
91
|
+
yield (0, tracking_1.trackEvent)(request, action, eventArgs);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
toBotonic() {
|
|
95
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.FlowQueueStatusConditional = FlowQueueStatusConditional;
|
|
99
|
+
//# sourceMappingURL=flow-queue-status-conditional.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-queue-status-conditional.js","sourceRoot":"","sources":["../../../src/content-fields/flow-queue-status-conditional.tsx"],"names":[],"mappings":";;;;;AAAA,wCAAwE;AAIxE,4CAAmD;AACnD,uEAAiE;AACjE,0CAGoB;AACpB,+DAAyD;AAUzD,IAAK,iBAIJ;AAJD,WAAK,iBAAiB;IACpB,kCAAa,CAAA;IACb,sCAAiB,CAAA;IACjB,gEAA2C,CAAA;AAC7C,CAAC,EAJI,iBAAiB,KAAjB,iBAAiB,QAIrB;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AAE,QAAQ,EAAE,UAAU,EAAE,iBAAiB,EAAE,GACrE,IAAA,oDAAyC,EAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAA;YAC7D,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,iBAAiB,0CAAE,MAAM,CAAA,EAAE;gBACnC,OAAO,CAAC,IAAI,CACV,2BAA2B,IAAI,CAAC,IAAI,kCAAkC,CACvE,CAAA;aACF;YACD,MAAM,2BAA2B,GAAgC;gBAC/D,MAAM,EAAE,kBAAW,CAAC,sBAAsB;gBAC1C,YAAY;gBACZ,MAAM;gBACN,QAAQ;gBACR,UAAU;gBACV,iBAAiB;gBACjB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;aACxC,CAAA;YACD,MAAM,EAAE,MAAM,KAAmB,2BAA2B,EAAzC,SAAS,kBAAK,2BAA2B,EAAtD,UAAwB,CAA8B,CAAA;YAC5D,MAAM,IAAA,qBAAU,EAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAA;;KAC7C;IAED,SAAS;QACP,OAAO,kDAAK,CAAA;IACd,CAAC;CACF;AAjGD,gEAiGC"}
|
|
@@ -4,12 +4,12 @@ import { ContentFieldsBase } from './content-fields-base';
|
|
|
4
4
|
import { FlowButton } from './flow-button';
|
|
5
5
|
import { HtRatingNode, RatingType } from './hubtype-fields';
|
|
6
6
|
export declare class FlowRating extends ContentFieldsBase {
|
|
7
|
-
code: string;
|
|
8
7
|
text: string;
|
|
9
8
|
sendButtonText: string;
|
|
10
9
|
ratingType: RatingType;
|
|
11
10
|
buttons: FlowButton[];
|
|
12
11
|
openListButtonText: string;
|
|
13
12
|
static fromHubtypeCMS(cmsText: HtRatingNode, locale: string): FlowRating;
|
|
13
|
+
trackFlow(request: ActionRequest): Promise<void>;
|
|
14
14
|
toBotonic(id: string, request: ActionRequest): JSX.Element;
|
|
15
15
|
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowRating = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
6
|
const core_1 = require("@botonic/core");
|
|
6
7
|
const react_1 = require("@botonic/react");
|
|
7
8
|
const helpers_1 = require("../helpers");
|
|
9
|
+
const tracking_1 = require("../tracking");
|
|
8
10
|
const content_fields_base_1 = require("./content-fields-base");
|
|
9
11
|
const flow_button_1 = require("./flow-button");
|
|
10
12
|
const hubtype_fields_1 = require("./hubtype-fields");
|
|
11
13
|
class FlowRating extends content_fields_base_1.ContentFieldsBase {
|
|
12
14
|
constructor() {
|
|
13
15
|
super(...arguments);
|
|
14
|
-
this.code = '';
|
|
15
16
|
this.text = '';
|
|
16
17
|
this.sendButtonText = '';
|
|
17
18
|
this.ratingType = hubtype_fields_1.RatingType.Stars;
|
|
@@ -26,8 +27,14 @@ class FlowRating extends content_fields_base_1.ContentFieldsBase {
|
|
|
26
27
|
newRating.ratingType = cmsText.content.rating_type;
|
|
27
28
|
newRating.buttons = cmsText.content.buttons.map(button => flow_button_1.FlowButton.fromRating(button));
|
|
28
29
|
newRating.openListButtonText = this.getTextByLocale(locale, cmsText.content.open_list_button_text);
|
|
30
|
+
newRating.followUp = cmsText.follow_up;
|
|
29
31
|
return newRating;
|
|
30
32
|
}
|
|
33
|
+
trackFlow(request) {
|
|
34
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
yield (0, tracking_1.trackOneContent)(request, this);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
31
38
|
toBotonic(id, request) {
|
|
32
39
|
const flowBuilderPlugin = (0, helpers_1.getFlowBuilderPlugin)(request.plugins);
|
|
33
40
|
const customRatingMessageEnabled = flowBuilderPlugin.customRatingMessageEnabled;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow-rating.js","sourceRoot":"","sources":["../../../src/content-fields/flow-rating.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flow-rating.js","sourceRoot":"","sources":["../../../src/content-fields/flow-rating.tsx"],"names":[],"mappings":";;;;;AAAA,wCAA4D;AAC5D,0CAKuB;AAEvB,wCAAiD;AACjD,0CAA6C;AAC7C,+DAAyD;AACzD,+CAA0C;AAC1C,qDAA2D;AAE3D,MAAa,UAAW,SAAQ,uCAAiB;IAAjD;;QACS,SAAI,GAAG,EAAE,CAAA;QACT,mBAAc,GAAG,EAAE,CAAA;QACnB,eAAU,GAAG,2BAAU,CAAC,KAAK,CAAA;QAC7B,YAAO,GAAiB,EAAE,CAAA;QAC1B,uBAAkB,GAAG,EAAE,CAAA;IA8EhC,CAAC;IA5EC,MAAM,CAAC,cAAc,CAAC,OAAqB,EAAE,MAAc;QACzD,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAC5C,SAAS,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;QAC7B,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACnE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAC7C,MAAM,EACN,OAAO,CAAC,OAAO,CAAC,gBAAgB,CACjC,CAAA;QACD,SAAS,CAAC,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAA;QAClD,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CACvD,wBAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAC9B,CAAA;QACD,SAAS,CAAC,kBAAkB,GAAG,IAAI,CAAC,eAAe,CACjD,MAAM,EAC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AI,CAAC,IAAI,EACtB,UAAU,EAAE,IAAI,CAAC,cAAc,EAC/B,UAAU,EAAE,IAAI,CAAC,UAAU,GAC3B,CACH,CAAA;SACF;QAED,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,CAAC,CACjC,KAJQ,EAAE,CAKN,CACR,CAAA;IACH,CAAC;CACF;AAnFD,gCAmFC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TextMessage, TextWithButtonsMessage } from '@botonic/core';
|
|
3
2
|
import { ActionRequest } from '@botonic/react';
|
|
4
3
|
import { FlowBuilderApi } from '../api';
|
|
5
4
|
import { ContentFieldsBase } from './content-fields-base';
|
|
@@ -7,12 +6,11 @@ import { FlowButton } from './flow-button';
|
|
|
7
6
|
import { HtButtonStyle, HtTextNode } from './hubtype-fields';
|
|
8
7
|
export declare class FlowText extends ContentFieldsBase {
|
|
9
8
|
text: string;
|
|
10
|
-
code: string;
|
|
11
9
|
buttons: FlowButton[];
|
|
12
10
|
buttonStyle: HtButtonStyle;
|
|
13
11
|
static fromHubtypeCMS(cmsText: HtTextNode, locale: string, cmsApi: FlowBuilderApi): FlowText;
|
|
14
12
|
static replaceVariables(text: string, request: ActionRequest): string;
|
|
15
13
|
private static isValidType;
|
|
16
|
-
|
|
14
|
+
trackFlow(request: ActionRequest): Promise<void>;
|
|
17
15
|
toBotonic(id: string, request: ActionRequest): JSX.Element;
|
|
18
16
|
}
|