@botonic/plugin-flow-builder 0.21.3 → 0.21.5
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/README.md +108 -0
- package/lib/cjs/action.d.ts +1 -1
- package/lib/cjs/action.js +2 -2
- package/lib/cjs/action.js.map +1 -1
- package/lib/cjs/content-fields/flow-button.d.ts +1 -0
- package/lib/cjs/content-fields/flow-carousel.d.ts +1 -0
- package/lib/cjs/content-fields/flow-image.d.ts +1 -0
- package/lib/cjs/content-fields/flow-text.d.ts +1 -0
- package/lib/cjs/content-fields/flow-video.d.ts +1 -0
- package/lib/cjs/content-fields/types.d.ts +1 -1
- package/lib/cjs/flow-builder-models.d.ts +2 -2
- package/lib/cjs/functions/conditional-queue-status.js +1 -1
- package/lib/cjs/functions/conditional-queue-status.js.map +1 -1
- package/lib/cjs/handoff.js +1 -1
- package/lib/cjs/handoff.js.map +1 -1
- package/lib/cjs/helpers.js +2 -2
- package/lib/cjs/helpers.js.map +1 -1
- package/lib/cjs/index.js +3 -3
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/action.d.ts +1 -1
- package/lib/esm/content-fields/flow-button.d.ts +1 -0
- package/lib/esm/content-fields/flow-carousel.d.ts +1 -0
- package/lib/esm/content-fields/flow-image.d.ts +1 -0
- package/lib/esm/content-fields/flow-text.d.ts +1 -0
- package/lib/esm/content-fields/flow-video.d.ts +1 -0
- package/lib/esm/content-fields/types.d.ts +1 -1
- package/lib/esm/flow-builder-models.d.ts +2 -2
- package/lib/esm/helpers.js +2 -2
- package/lib/esm/helpers.js.map +1 -1
- package/package.json +1 -1
- package/src/helpers.ts +2 -2
package/README.md
CHANGED
|
@@ -1 +1,109 @@
|
|
|
1
1
|
# Botonic Plugin Flow Builder
|
|
2
|
+
## What Does This Plugin Do?
|
|
3
|
+
|
|
4
|
+
Botonic Plugin Flow Builder is one of the **[available](https://github.com/hubtype/botonic/tree/master/packages)** plugins for Botonic.
|
|
5
|
+
|
|
6
|
+
Flow Builder is a no-code, drag-and-drop chatbot builder that makes the process of creating and editing chatbot journeys faster and more intuitive.
|
|
7
|
+
From [Hubtype](https://www.hubtype.com/) we offer a suite of tools and features that let you build, test and deploy both automated and agent-based journeys at scale. This plugin allows you to connect to our Flow Builder.
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<img alt="Flow Builder" title="flow-builder" src="https://i.ibb.co/ySRjD4M/Pasted-image-20230426161548.png" width="550">
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- Support for a wide variety of content types, including buttons, text, carousels, images, videos, and more.
|
|
16
|
+
|
|
17
|
+
- Custom functions to allow dynamic bot behavior, as for example checking the queue status or determine the channel (Whatsapp, Webchat, ...) from which the user is writing.
|
|
18
|
+
|
|
19
|
+
- Seamless transfer to a human agent.
|
|
20
|
+
|
|
21
|
+
- Artificial intelligence-based detection of keywords and user intent.
|
|
22
|
+
|
|
23
|
+
### Advantages
|
|
24
|
+
|
|
25
|
+
* **Ease of use**: Flow builders are designed to be user-friendly and intuitive, allowing even non-technical users to create and edit chatbot flows with ease.
|
|
26
|
+
|
|
27
|
+
* **Time-saving**: With a flow builder, you can quickly create and edit chatbot flows using drag-and-drop functionality, saving you time and effort compared to manually coding each interaction.
|
|
28
|
+
|
|
29
|
+
* **Visual representation**: Flow builders provide a visual representation of your chatbot flow, allowing you to easily see the overall structure and make adjustments as needed.
|
|
30
|
+
|
|
31
|
+
* **Flexibility**: Flow builders offer a range of customization options, allowing you to create chatbot flows tailored to your specific needs and use cases.
|
|
32
|
+
|
|
33
|
+
## Setup
|
|
34
|
+
### Create an account at Hubtype
|
|
35
|
+
|
|
36
|
+
1. Create an account at https://www.hubtype.com.
|
|
37
|
+
|
|
38
|
+
2. Once you have deployed your bots, in the [Bots](https://app.hubtype.com/bots) section you can access the flow builder by clicking on any of your bots and in the button that says:
|
|
39
|
+
|
|
40
|
+
<p align="center">
|
|
41
|
+
<img alt="Flow Builder button" title="flow-builder-button" src="https://i.ibb.co/ZJ2fMQN/Pasted-image-20230427115219.png" width="250">
|
|
42
|
+
</p>
|
|
43
|
+
|
|
44
|
+
### Install the Plugin
|
|
45
|
+
|
|
46
|
+
1. Install the plugin in your bot's project by running:
|
|
47
|
+
```bash
|
|
48
|
+
npm install @botonic/plugin-flow-builder
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Use
|
|
52
|
+
### Configuring the bot
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
1. Add the following code to your `plugins.js` file:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import * as hubtypeFlowBuilder from '@botonic/plugin-flow-builder'
|
|
60
|
+
|
|
61
|
+
const flowBuilderOptions = {
|
|
62
|
+
flowUrl: 'HUBTYPE_FLOW_BUILDER_URL',
|
|
63
|
+
getAccessToken: () => 'HUBTYPE_FLOW_BUILDER_ACCESS_TOKEN',
|
|
64
|
+
getLocale: () => 'YOUR_LOCALE',
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const plugins = [
|
|
68
|
+
{
|
|
69
|
+
id: 'hubtypeFlowBuilder',
|
|
70
|
+
resolve: hubtypeFlowBuilder,
|
|
71
|
+
options: flowBuilderOptions,
|
|
72
|
+
},
|
|
73
|
+
]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
By doing this, we are passing configuration parameters to the bot. This way we can pass parameters to the Plugin from outside. This gives us more flexibility when configuring the plugin.
|
|
77
|
+
|
|
78
|
+
Below are the parameters that we can pass to the plugin:
|
|
79
|
+
|
|
80
|
+
- `flowUrl`: This is the URL where the Flow is located. The bot will automatically collect this URL, so in most cases, we don't have to pass it. It is used in cases where the Flow URL is in a testing environment.
|
|
81
|
+
|
|
82
|
+
- `flow`: In some situations, we may want to test a flow locally instead of using the Flow Builder service. To do this, we can define the flow and its corresponding tree of nodes in a JSON file and pass it to our plugin through this variable. By doing so, we can run and test our flow locally without relying on the external service.
|
|
83
|
+
|
|
84
|
+
- `customFunctions`: We are able to pass custom functions to the plugin by defining them in our code and then passing them as parameters. This allows us to extend the functionality of the plugin beyond its default capabilities and execute custom logic that is tailored to our specific needs. We can add custom functions in the frontend of the Flow Builder and pass them to the plugin through this variable.
|
|
85
|
+
|
|
86
|
+
- `getLocale`: We can pass an array of locales to the plugin to specify which language our bot will use.
|
|
87
|
+
|
|
88
|
+
- `getAccessToken`: When our bot is deployed in Hubtype, the plugin will automatically retrieve the access token. However, when testing our bot locally, we need to pass the access token as a variable.
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
2. Modify the `routes.ts` file, where routes map user inputs to actions which are in fact React Components:
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
import { Input, Session } from '@botonic/core'
|
|
95
|
+
import FlowBuilderAction from '@botonic/plugin-flow-builder/lib/esm/action'
|
|
96
|
+
|
|
97
|
+
type RouteRequest = { input: Input; session: Session }
|
|
98
|
+
export function routes(request: RouteRequest) {
|
|
99
|
+
return [
|
|
100
|
+
{
|
|
101
|
+
path: 'hubtype-flow-builder',
|
|
102
|
+
type: /.*/,
|
|
103
|
+
payload: /.*/,
|
|
104
|
+
action: FlowBuilderAction,
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
For personalized behavior, create an action in your bot. For other cases, let the plugin handle all actions.
|
package/lib/cjs/action.d.ts
CHANGED
package/lib/cjs/action.js
CHANGED
|
@@ -9,7 +9,7 @@ const helpers_1 = require("./helpers");
|
|
|
9
9
|
let alternateFallbackMessage = false;
|
|
10
10
|
class FlowBuilderAction extends react_2.default.Component {
|
|
11
11
|
static async botonicInit(request) {
|
|
12
|
-
const flowBuilderPlugin =
|
|
12
|
+
const flowBuilderPlugin = helpers_1.getFlowBuilderPlugin(request.plugins);
|
|
13
13
|
const locale = flowBuilderPlugin.getLocale(request.session);
|
|
14
14
|
const payload = request.input.payload;
|
|
15
15
|
let targetContentId = payload;
|
|
@@ -30,7 +30,7 @@ class FlowBuilderAction extends react_2.default.Component {
|
|
|
30
30
|
}
|
|
31
31
|
const { contents, handoffNode } = await flowBuilderPlugin.getContents(targetContentId, locale);
|
|
32
32
|
if (handoffNode)
|
|
33
|
-
await
|
|
33
|
+
await handoff_1.doHandoff(request, locale, handoffNode);
|
|
34
34
|
return { contents, handoffNode };
|
|
35
35
|
}
|
|
36
36
|
render() {
|
package/lib/cjs/action.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../src/action.tsx"],"names":[],"mappings":";;;;AAAA,0CAA8D;AAC9D,0DAAyB;AAGzB,uCAAqC;AACrC,uCAAgD;AAOhD,IAAI,wBAAwB,GAAG,KAAK,CAAA;AACpC,MAAa,iBAAkB,SAAQ,eAAK,CAAC,SAAiC;IAG5E,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAAsB;QAC7C,MAAM,iBAAiB,GAAG,
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../src/action.tsx"],"names":[],"mappings":";;;;AAAA,0CAA8D;AAC9D,0DAAyB;AAGzB,uCAAqC;AACrC,uCAAgD;AAOhD,IAAI,wBAAwB,GAAG,KAAK,CAAA;AACpC,MAAa,iBAAkB,SAAQ,eAAK,CAAC,SAAiC;IAG5E,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAAsB;QAC7C,MAAM,iBAAiB,GAAG,8BAAoB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAC/D,MAAM,MAAM,GAAG,iBAAiB,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAA;QACrC,IAAI,eAAe,GAAuB,OAAO,CAAA;QACjD,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,oBAAoB,EAAE;YACpD,eAAe,GAAG,MAAM,iBAAiB,CAAC,UAAU,EAAE,CAAA;SACvD;QACD,IAAI,CAAC,OAAO,EAAE;YACZ,MAAM,aAAa,GAAG,MAAM,iBAAiB,CAAC,kBAAkB,CAC9D,OAAO,CAAC,KAAK,EACb,MAAM,CACP,CAAA;YACD,IAAI,aAAa;gBAAE,eAAe,GAAG,aAAa,CAAA;YAClD,MAAM,cAAc,GAAG,MAAM,iBAAiB,CAAC,mBAAmB,CAChE,OAAO,CAAC,KAAK,EACb,MAAM,CACP,CAAA;YACD,IAAI,cAAc;gBAAE,eAAe,GAAG,cAAc,CAAA;SACrD;QACD,IAAI,CAAC,eAAe,EAAE;YACpB,eAAe,GAAG,MAAM,iBAAiB,CAAC,aAAa,CACrD,wBAAwB,CACzB,CAAA;YACD,wBAAwB,GAAG,CAAC,wBAAwB,CAAA;SACrD;QAED,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,MAAM,iBAAiB,CAAC,WAAW,CACnE,eAAe,EACf,MAAM,CACP,CAAA;QAED,IAAI,WAAW;YAAE,MAAM,mBAAS,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,CAAA;QAE9D,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAA;IAClC,CAAC;IAED,MAAM;QACJ,aAAa;QACb,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAC5C,OAAO,QAAS,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAA;IAChE,CAAC;;AA5CH,8CA6CC;AA5CQ,6BAAW,GAAG,sBAAc,CAAA"}
|
|
@@ -2,4 +2,4 @@ import { FlowCarousel } from './flow-carousel';
|
|
|
2
2
|
import { FlowImage } from './flow-image';
|
|
3
3
|
import { FlowText } from './flow-text';
|
|
4
4
|
import { FlowVideo } from './flow-video';
|
|
5
|
-
export type FlowContent = FlowText | FlowImage | FlowCarousel | FlowVideo;
|
|
5
|
+
export declare type FlowContent = FlowText | FlowImage | FlowCarousel | FlowVideo;
|
|
@@ -150,7 +150,7 @@ export interface PayloadNode extends BaseNode {
|
|
|
150
150
|
type: NodeType.PAYLOAD;
|
|
151
151
|
content: PayloadNodeContent;
|
|
152
152
|
}
|
|
153
|
-
export type ArgumentType = number | string | Record<any, any>;
|
|
153
|
+
export declare type ArgumentType = number | string | Record<any, any>;
|
|
154
154
|
export interface FunctionNodeArgument {
|
|
155
155
|
type: ArgumentType;
|
|
156
156
|
name: string;
|
|
@@ -193,4 +193,4 @@ export interface VideoNode extends Node {
|
|
|
193
193
|
type: NodeType.VIDEO;
|
|
194
194
|
content: VideoNodeContent;
|
|
195
195
|
}
|
|
196
|
-
export type NodeComponent = TextNode | ImageNode | CarouselNode | HandoffNode | KeywordNode | IntentNode | UrlNode | StartNode | PayloadNode | FunctionNode | FallbackNode | VideoNode;
|
|
196
|
+
export declare type NodeComponent = TextNode | ImageNode | CarouselNode | HandoffNode | KeywordNode | IntentNode | UrlNode | StartNode | PayloadNode | FunctionNode | FallbackNode | VideoNode;
|
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
6
6
|
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
7
7
|
const utils_1 = require("../utils");
|
|
8
|
-
const _HUBTYPE_API_URL_ =
|
|
8
|
+
const _HUBTYPE_API_URL_ = utils_1.getWebpackEnvVar(
|
|
9
9
|
// @ts-ignore
|
|
10
10
|
typeof HUBTYPE_API_URL !== 'undefined' && HUBTYPE_API_URL, 'HUBTYPE_API_URL', 'https://api.hubtype.com');
|
|
11
11
|
async function conditionalQueueStatus({ queue_id, }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditional-queue-status.js","sourceRoot":"","sources":["../../../src/functions/conditional-queue-status.ts"],"names":[],"mappings":";;;;AAAA,yDAAyD;AACzD,0DAAyB;AAEzB,oCAA2C;AAE3C,MAAM,iBAAiB,GAAG,
|
|
1
|
+
{"version":3,"file":"conditional-queue-status.js","sourceRoot":"","sources":["../../../src/functions/conditional-queue-status.ts"],"names":[],"mappings":";;;;AAAA,yDAAyD;AACzD,0DAAyB;AAEzB,oCAA2C;AAE3C,MAAM,iBAAiB,GAAG,wBAAgB;AACxC,aAAa;AACb,OAAO,eAAe,KAAK,WAAW,IAAI,eAAe,EACzD,iBAAiB,EACjB,yBAAyB,CAC1B,CAAA;AAEM,KAAK,UAAU,sBAAsB,CAAC,EAC3C,QAAQ,GAGT;IACC,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAC9B,GAAG,iBAAiB,cAAc,QAAQ,gBAAgB;IAC1D,2CAA2C;IAC3C;QACE,MAAM,EAAE;YACN,oBAAoB,EAAE,IAAI;YAC1B,mBAAmB,EAAE,KAAK;YAC1B,sBAAsB,EAAE,KAAK;SAC9B;KACF,CACF,CAAA;IACD,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAA;IAC3C,OAAO,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAA;AACxC,CAAC;AAlBD,wDAkBC"}
|
package/lib/cjs/handoff.js
CHANGED
|
@@ -5,7 +5,7 @@ const core_1 = require("@botonic/core");
|
|
|
5
5
|
const helpers_1 = require("./helpers");
|
|
6
6
|
async function doHandoff(request, locale, handoffNode) {
|
|
7
7
|
var _a;
|
|
8
|
-
const flowBuilderPlugin =
|
|
8
|
+
const flowBuilderPlugin = helpers_1.getFlowBuilderPlugin(request.plugins);
|
|
9
9
|
const handoffTargetNode = await flowBuilderPlugin.getHandoffContent((_a = handoffNode.target) === null || _a === void 0 ? void 0 : _a.id);
|
|
10
10
|
// @ts-ignore
|
|
11
11
|
const handOffBuilder = new core_1.HandOffBuilder(request.session); // handOffBuilder.withQueue(handoffNode.content.queue)
|
package/lib/cjs/handoff.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handoff.js","sourceRoot":"","sources":["../../src/handoff.ts"],"names":[],"mappings":";;;AAAA,wCAA8C;AAI9C,uCAAgD;AAEzC,KAAK,UAAU,SAAS,CAC7B,OAAsB,EACtB,MAAc,EACd,WAAwB;;IAExB,MAAM,iBAAiB,GAAG,
|
|
1
|
+
{"version":3,"file":"handoff.js","sourceRoot":"","sources":["../../src/handoff.ts"],"names":[],"mappings":";;;AAAA,wCAA8C;AAI9C,uCAAgD;AAEzC,KAAK,UAAU,SAAS,CAC7B,OAAsB,EACtB,MAAc,EACd,WAAwB;;IAExB,MAAM,iBAAiB,GAAG,8BAAoB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC/D,MAAM,iBAAiB,GAAG,MAAM,iBAAiB,CAAC,iBAAiB,CACjE,MAAA,WAAW,CAAC,MAAM,0CAAE,EAAE,CACvB,CAAA;IACD,aAAa;IACb,MAAM,cAAc,GAAG,IAAI,qBAAc,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA,CAAC,sDAAsD;IACjH,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,CAAA;IAC/C,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAA;IAC/D,IAAI,UAAU;QAAE,cAAc,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;IACvD,yCAAyC;IACzC,0BAA0B;IAC1B,kCAAkC;IAClC,4EAA4E;IAC5E,IAAI;IAEJ,4BAA4B;IAC5B,gDAAgD;IAChD,IAAI;IAEJ,kCAAkC;IAClC,4DAA4D;IAC5D,IAAI;IAEJ,cAAc,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAA;IACxD,MAAM,cAAc,CAAC,OAAO,EAAE,CAAA;AAChC,CAAC;AA9BD,8BA8BC"}
|
package/lib/cjs/helpers.js
CHANGED
|
@@ -5,7 +5,7 @@ const FLOW_BUILDER_PLUGIN_NAME = 'BotonicPluginFlowBuilder';
|
|
|
5
5
|
function getFlowBuilderPlugin(plugins) {
|
|
6
6
|
const flowBuilderPlugin = Object.values(plugins).find(
|
|
7
7
|
// @ts-ignore
|
|
8
|
-
plugin => plugin.name
|
|
8
|
+
plugin => plugin.name.includes(FLOW_BUILDER_PLUGIN_NAME));
|
|
9
9
|
if (!flowBuilderPlugin)
|
|
10
10
|
throw new Error(`You must include '@botonic/plugin-flow-builder' in your plugins file.`);
|
|
11
11
|
return flowBuilderPlugin;
|
|
@@ -15,7 +15,7 @@ async function updateButtonUrls(hubtypeContent, contentKey, getContentFn) {
|
|
|
15
15
|
if (hubtypeContent.content[contentKey]) {
|
|
16
16
|
for (const i in hubtypeContent.content[contentKey]) {
|
|
17
17
|
const button = hubtypeContent.content[contentKey][i].button;
|
|
18
|
-
if (button.url) {
|
|
18
|
+
if (button === null || button === void 0 ? void 0 : button.url) {
|
|
19
19
|
for (const j in button.url) {
|
|
20
20
|
button.url[j] = Object.assign(Object.assign({}, button.url[j]), (await getContentFn(button.url[j].id)));
|
|
21
21
|
}
|
package/lib/cjs/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,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,
|
|
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;AAEM,KAAK,UAAU,gBAAgB,CACpC,cAAmB,EACnB,UAAkB,EAClB,YAAiB;IAEjB,IAAI,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QACtC,KAAK,MAAM,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YAClD,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;YAC3D,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,EAAE;gBACf,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE;oBAC1B,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,mCACR,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,GACb,CAAC,MAAM,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAC1C,CAAA;iBACF;aACF;SACF;KACF;AACH,CAAC;AAlBD,4CAkBC"}
|
package/lib/cjs/index.js
CHANGED
|
@@ -12,7 +12,7 @@ class BotonicPluginFlowBuilder {
|
|
|
12
12
|
constructor(options) {
|
|
13
13
|
this.options = options;
|
|
14
14
|
this.getLocale = options.getLocale;
|
|
15
|
-
this.getAccessToken =
|
|
15
|
+
this.getAccessToken = utils_1.resolveGetAccessToken(options);
|
|
16
16
|
this.flowUrl = options.flowUrl;
|
|
17
17
|
if (options.flow)
|
|
18
18
|
this.flow = options.flow;
|
|
@@ -81,8 +81,8 @@ class BotonicPluginFlowBuilder {
|
|
|
81
81
|
const hubtypeContent = await this.getContent(id);
|
|
82
82
|
const isHandoff = hubtypeContent.type === flow_builder_models_1.NodeType.HANDOFF;
|
|
83
83
|
// TODO: Create function to populate these buttons
|
|
84
|
-
await
|
|
85
|
-
await
|
|
84
|
+
await helpers_1.updateButtonUrls(hubtypeContent, 'elements', this.getContent);
|
|
85
|
+
await helpers_1.updateButtonUrls(hubtypeContent, 'buttons', this.getContent);
|
|
86
86
|
const content = await this.getFlowContent(hubtypeContent, locale);
|
|
87
87
|
if (hubtypeContent.type === flow_builder_models_1.NodeType.FUNCTION) {
|
|
88
88
|
const targetId = await this.callFunction(hubtypeContent, locale);
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAOA,0DAAyB;AAEzB,qDAMyB;AACzB,+DAU8B;AAC9B,2CAA+C;AAE/C,mCAA+C;AAC/C,uCAA4C;AAE5C,MAAqB,wBAAwB;IAQ3C,YAAqB,OAAwC;QAAxC,YAAO,GAAP,OAAO,CAAiC;QAC3D,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAA;QAClC,IAAI,CAAC,cAAc,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAOA,0DAAyB;AAEzB,qDAMyB;AACzB,+DAU8B;AAC9B,2CAA+C;AAE/C,mCAA+C;AAC/C,uCAA4C;AAE5C,MAAqB,wBAAwB;IAQ3C,YAAqB,OAAwC;QAAxC,YAAO,GAAP,OAAO,CAAiC;QAC3D,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAA;QAClC,IAAI,CAAC,cAAc,GAAG,6BAAqB,CAAC,OAAO,CAAC,CAAA;QACpD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC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ACD,0CAA0C;QAC1C,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CACrD,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,cAAc,CACjC,CAAA;QACD,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAI,KAAK,CACb,wDAAwD,cAAc,EAAE,CACzE,CAAA;SACF;QACD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,CAAA;IACzB,CAAC;CACF;AAnOD,2CAmOC;AAED,mCAA4C;AAAnC,2GAAA,iBAAiB,OAAA"}
|
package/lib/esm/action.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import { FlowCarousel } from './flow-carousel';
|
|
|
2
2
|
import { FlowImage } from './flow-image';
|
|
3
3
|
import { FlowText } from './flow-text';
|
|
4
4
|
import { FlowVideo } from './flow-video';
|
|
5
|
-
export type FlowContent = FlowText | FlowImage | FlowCarousel | FlowVideo;
|
|
5
|
+
export declare type FlowContent = FlowText | FlowImage | FlowCarousel | FlowVideo;
|
|
@@ -150,7 +150,7 @@ export interface PayloadNode extends BaseNode {
|
|
|
150
150
|
type: NodeType.PAYLOAD;
|
|
151
151
|
content: PayloadNodeContent;
|
|
152
152
|
}
|
|
153
|
-
export type ArgumentType = number | string | Record<any, any>;
|
|
153
|
+
export declare type ArgumentType = number | string | Record<any, any>;
|
|
154
154
|
export interface FunctionNodeArgument {
|
|
155
155
|
type: ArgumentType;
|
|
156
156
|
name: string;
|
|
@@ -193,4 +193,4 @@ export interface VideoNode extends Node {
|
|
|
193
193
|
type: NodeType.VIDEO;
|
|
194
194
|
content: VideoNodeContent;
|
|
195
195
|
}
|
|
196
|
-
export type NodeComponent = TextNode | ImageNode | CarouselNode | HandoffNode | KeywordNode | IntentNode | UrlNode | StartNode | PayloadNode | FunctionNode | FallbackNode | VideoNode;
|
|
196
|
+
export declare type NodeComponent = TextNode | ImageNode | CarouselNode | HandoffNode | KeywordNode | IntentNode | UrlNode | StartNode | PayloadNode | FunctionNode | FallbackNode | VideoNode;
|
package/lib/esm/helpers.js
CHANGED
|
@@ -2,7 +2,7 @@ const FLOW_BUILDER_PLUGIN_NAME = 'BotonicPluginFlowBuilder';
|
|
|
2
2
|
export function getFlowBuilderPlugin(plugins) {
|
|
3
3
|
const flowBuilderPlugin = Object.values(plugins).find(
|
|
4
4
|
// @ts-ignore
|
|
5
|
-
plugin => plugin.name
|
|
5
|
+
plugin => plugin.name.includes(FLOW_BUILDER_PLUGIN_NAME));
|
|
6
6
|
if (!flowBuilderPlugin)
|
|
7
7
|
throw new Error(`You must include '@botonic/plugin-flow-builder' in your plugins file.`);
|
|
8
8
|
return flowBuilderPlugin;
|
|
@@ -11,7 +11,7 @@ export async function updateButtonUrls(hubtypeContent, contentKey, getContentFn)
|
|
|
11
11
|
if (hubtypeContent.content[contentKey]) {
|
|
12
12
|
for (const i in hubtypeContent.content[contentKey]) {
|
|
13
13
|
const button = hubtypeContent.content[contentKey][i].button;
|
|
14
|
-
if (button.url) {
|
|
14
|
+
if (button === null || button === void 0 ? void 0 : button.url) {
|
|
15
15
|
for (const j in button.url) {
|
|
16
16
|
button.url[j] = Object.assign(Object.assign({}, button.url[j]), (await getContentFn(button.url[j].id)));
|
|
17
17
|
}
|
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,MAAM,UAAU,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,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAIA,MAAM,wBAAwB,GAAG,0BAA0B,CAAA;AAE3D,MAAM,UAAU,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;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,cAAmB,EACnB,UAAkB,EAClB,YAAiB;IAEjB,IAAI,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QACtC,KAAK,MAAM,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YAClD,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;YAC3D,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,EAAE;gBACf,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,GAAG,EAAE;oBAC1B,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,mCACR,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,GACb,CAAC,MAAM,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAC1C,CAAA;iBACF;aACF;SACF;KACF;AACH,CAAC"}
|
package/package.json
CHANGED
package/src/helpers.ts
CHANGED
|
@@ -9,7 +9,7 @@ export function getFlowBuilderPlugin(plugins: {
|
|
|
9
9
|
}): BotonicPluginFlowBuilder {
|
|
10
10
|
const flowBuilderPlugin = Object.values(plugins).find(
|
|
11
11
|
// @ts-ignore
|
|
12
|
-
plugin => plugin.name
|
|
12
|
+
plugin => plugin.name.includes(FLOW_BUILDER_PLUGIN_NAME)
|
|
13
13
|
) as BotonicPluginFlowBuilder
|
|
14
14
|
if (!flowBuilderPlugin)
|
|
15
15
|
throw new Error(
|
|
@@ -26,7 +26,7 @@ export async function updateButtonUrls(
|
|
|
26
26
|
if (hubtypeContent.content[contentKey]) {
|
|
27
27
|
for (const i in hubtypeContent.content[contentKey]) {
|
|
28
28
|
const button = hubtypeContent.content[contentKey][i].button
|
|
29
|
-
if (button
|
|
29
|
+
if (button?.url) {
|
|
30
30
|
for (const j in button.url) {
|
|
31
31
|
button.url[j] = {
|
|
32
32
|
...button.url[j],
|