voxtelesys-flow 1.0.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +186 -0
  3. package/dist/index.js +26 -0
  4. package/package.json +21 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (C) 2023, Voxtelesys. <https://voxtelesys.com/>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do
10
+ so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,186 @@
1
+ # voxtelesys-flow
2
+
3
+ [![npm version](https://img.shields.io/npm/v/voxtelesys-flow)](https://www.npmjs.com/package/voxtelesys-flow)
4
+
5
+ ## Overview
6
+
7
+ The [VAST Flow Builder](https://voxtelesys.com/vast-flow) is a low/no-code user interface for building and managing communication flows.
8
+ The `voxtelesys-flow` library allows users to implement the VAST Flow Builder into their own front-end JavaScript applications.
9
+
10
+ ## Getting Started
11
+
12
+ ### Installation
13
+
14
+ To install this library in your application, run:
15
+
16
+ ```bash
17
+ npm i voxtelesys-flow
18
+ ```
19
+
20
+ ### Initialization
21
+
22
+ To initialize the VAST Flow Builder, create an empty HTML element to mount the Flow Builder into:
23
+
24
+ ```html
25
+ <div id="element-id"/>
26
+ ```
27
+
28
+ Then, mount the Flow Builder using the ID of the HTML element and the available [configuration options](#configuration):
29
+
30
+ ```js
31
+ import { FlowBuilder } from 'voxtelesys-flow'
32
+
33
+ await FlowBuilder.init('element-id', {
34
+ apiKey: '<API_KEY>',
35
+ flowGuid: '<FLOW_GUID>',
36
+ onBack: history.back,
37
+ companyName: 'Example Company',
38
+ companyLogo: 'http://example-company.com/logo',
39
+ styling: {
40
+ primaryColor: '#7ac142',
41
+ leftSidebarWidth: '400px',
42
+ defaultFontSize: '1rem'
43
+ }
44
+ })
45
+ ```
46
+
47
+ The default CSS styling for the VAST Flow Builder is bundled with the JavaScript and will be automatically loaded when the library is imported.
48
+
49
+ ### Configuration
50
+
51
+ #### Parameters
52
+
53
+ - `apiKey`
54
+
55
+ Required. An API key can be created or retrieved from the [API Keys](https://portal.voxtelesys.net/api-keys) page on the Customer Portal.
56
+
57
+ - `flowGuid`
58
+
59
+ Required. The GUID of the Flow that the user will be able to view and edit in the Flow Builder once it has been mounted. To view the Flows that belong to your account,
60
+ visit the [Flows](https://portal.voxtelesys.net/flow) page on the Customer Portal. Alternatively, you can retrieve a list of Flows using the `GET /flows` route on the Dashboard API, or create a new
61
+ Flow using the `POST /flows` route.
62
+
63
+ - `onBack`
64
+
65
+ Optional. A function that is executed when the back arrow in the Flow Builder is clicked. If `onBack` is omitted, then the back arrow will be hidden.
66
+
67
+ - `companyName`
68
+
69
+ Optional. The text to be displayed at the bottom of the Flow Builder canvas next to "Powered by Voxtelesys". The `companyName` parameter is used to co-brand the VAST Flow Builder by displaying your
70
+ company's name on the screen.
71
+
72
+ - `companyLogo`
73
+
74
+ Optional. The path or URL of an image to be displayed at the bottom of the Flow Builder canvas next to "Powered by Voxtelesys". The `companyLogo` parameter is used to co-brand the VAST Flow Builder by displaying your
75
+ company's logo on the screen.
76
+
77
+ - `styling`
78
+
79
+ Optional. An object with properties that override CSS styles in the Flow Builder.
80
+
81
+ The `styling` object can be used to customize the look and feel of the Flow Builder, such as its colors and font sizes. The properties available in `styling` are listed [below](#styling-overrides).
82
+
83
+ #### Styling Overrides
84
+
85
+ ##### Sizing
86
+ - leftSidebarWidth
87
+ - rightSidebarWidth
88
+ - backgroundOutlineWidth
89
+
90
+ ##### Font
91
+ - fontFamily
92
+ - titleFontSize
93
+ - headingFontSize
94
+ - subheadingFontSize
95
+ - defaultFontSize
96
+ - smallFontSize
97
+ - extraSmallFontSize
98
+ - companyFontSize
99
+ - transitionTime
100
+
101
+ ##### Base Colors
102
+ - whiteColor
103
+ - gray1Color
104
+ - gray2Color
105
+ - gray3Color
106
+ - gray4Color
107
+ - gray5Color
108
+ - gray6Color
109
+ - gray7Color
110
+ - gray8Color
111
+ - gray9Color
112
+ - gray10Color
113
+ - primaryColor
114
+ - secondaryColor
115
+ - tertiaryColor
116
+ - quaternaryColor
117
+ - focusColor
118
+ - deleteColor
119
+ - errorColor
120
+ - warningColor
121
+ - validColor
122
+ - successColor
123
+ - codeColor
124
+
125
+ ##### Alert Colors
126
+ - errorAlertTextColor
127
+ - errorAlertHighlightColor
128
+ - errorAlertBackgroundColor
129
+ - errorAlertShadowColor
130
+ - infoAlertTextColor
131
+ - infoAlertHighlightColor
132
+ - infoAlertBackgroundColor
133
+ - warningAlertTextColor
134
+ - warningAlertHighlightColor
135
+ - warningAlertBackgroundColor
136
+ - successAlertTextColor
137
+ - successAlertHighlightColor
138
+ - successAlertBackgroundColor
139
+ - successAlertBorderColor
140
+
141
+ ##### Hover Colors
142
+ - primaryHoverColor
143
+ - secondaryHoverColor
144
+ - tertiaryHoverColor
145
+ - quaternaryHoverColor
146
+ - deleteHoverColor
147
+ - grayHoverColor
148
+
149
+ ##### Highlight Colors
150
+ - primaryHighlightColor
151
+ - tertiaryHighlightColor
152
+ - grayHighlightColor
153
+
154
+ ##### Background Colors
155
+ - primaryBackgroundColor
156
+ - secondaryBackgroundColor
157
+ - tertiaryBackgroundColor
158
+ - quaternaryBackgroundColor
159
+ - errorBackgroundColor
160
+ - primaryBackgroundHoverColor
161
+ - secondaryBackgroundHoverColor
162
+ - tertiaryBackgroundHoverColor
163
+ - quaternaryBackgroundHoverColor
164
+
165
+ ##### Shadow Colors
166
+ - successShadowColor
167
+ - gray7ShadowColor
168
+ - validShadowColor
169
+ - focusShadowColor
170
+
171
+ ## Dashboard API
172
+
173
+ All HTTP requests from the VAST Flow Builder are directed to publicly-available routes on the Dashboard API using the API key provided.
174
+
175
+ In addition to the routes used directly by the VAST Flow Builder, the Dashboard API also provides the ability to:
176
+ - View and manage Flows and Flow Versions
177
+ - View and update telephone numbers (TNs)
178
+ - View and manage route profiles and route profile routes
179
+ - View and manage Voice API profiles
180
+ - Get trunk groups
181
+
182
+ See the Dashboard API [documentation](https://dashboardapi.voxtelesys.com/) for more details on the available routes.
183
+
184
+ ## Additional Resources
185
+
186
+ - [Flow Builder Tutorials](https://voxtelesys.com/learning-hub/tutorials?category=vast-flow-builder)
package/dist/index.js ADDED
@@ -0,0 +1,26 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ let module;
11
+ export class FlowBuilder {
12
+ /**
13
+ * Initializes the VAST Flow Builder SDK.
14
+ *
15
+ * @param elementId - The ID of the HTML element to render the Flow Builder in (required).
16
+ * @param options.apiToken - The API token for authentication (required).
17
+ */
18
+ static init(elementId, options) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ // @ts-ignore
21
+ if (!module)
22
+ module = yield import('https://dmfmrckmde2ek.cloudfront.net/vast-flow-builder-v3.0.2.js');
23
+ yield module.init(elementId, options);
24
+ });
25
+ }
26
+ }
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "voxtelesys-flow",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "scripts": {
9
+ "build": "tsc",
10
+ "install": "[ ! -d \"./dist\" ] && npm run build || true",
11
+ "postversion": "git push && git push --tags"
12
+ },
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "author": "Voxtelesys",
17
+ "license": "MIT",
18
+ "devDependencies": {
19
+ "typescript": "^5.6.3"
20
+ }
21
+ }