@tiledesk/tiledesk-voice-twilio-connector 0.1.27 → 0.2.0-rc3
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/LICENSE +179 -0
- package/README.md +44 -0
- package/index.js +7 -1529
- package/package.json +23 -22
- package/src/app.js +146 -0
- package/src/config/index.js +32 -0
- package/src/controllers/VoiceController.js +488 -0
- package/src/controllers/VoiceController.original.js +811 -0
- package/src/middlewares/httpLogger.js +31 -0
- package/src/models/KeyValueStore.js +78 -0
- package/src/routes/manageApp.js +298 -0
- package/src/routes/voice.js +22 -0
- package/src/services/AiService.js +219 -0
- package/src/services/AiService.sdk.js +367 -0
- package/src/services/IntegrationService.js +74 -0
- package/src/services/MessageService.js +133 -0
- package/src/services/README_SDK.md +107 -0
- package/src/services/SessionService.js +143 -0
- package/src/services/SpeechService.js +134 -0
- package/src/services/TiledeskMessageBuilder.js +135 -0
- package/src/services/TwilioService.js +122 -0
- package/src/services/UploadService.js +78 -0
- package/src/services/channels/TiledeskChannel.js +269 -0
- package/{tiledesk → src/services/channels}/VoiceChannel.js +17 -56
- package/src/services/clients/TiledeskSubscriptionClient.js +78 -0
- package/src/services/index.js +45 -0
- package/src/services/translators/TiledeskTwilioTranslator.js +509 -0
- package/{tiledesk/TiledeskTwilioTranslator.js → src/services/translators/TiledeskTwilioTranslator.original.js} +119 -202
- package/src/utils/fileUtils.js +24 -0
- package/src/utils/logger.js +32 -0
- package/{tiledesk → src/utils}/utils-message.js +6 -21
- package/logs/app.log +0 -3082
- package/routes/manageApp.js +0 -419
- package/tiledesk/KVBaseMongo.js +0 -101
- package/tiledesk/TiledeskChannel.js +0 -363
- package/tiledesk/TiledeskSubscriptionClient.js +0 -135
- package/tiledesk/fileUtils.js +0 -55
- package/tiledesk/services/AiService.js +0 -230
- package/tiledesk/services/IntegrationService.js +0 -81
- package/tiledesk/services/UploadService.js +0 -88
- /package/{winston.js → src/config/logger.js} +0 -0
- /package/{tiledesk → src}/services/voiceEventEmitter.js +0 -0
- /package/{template → src/template}/configure.html +0 -0
- /package/{template → src/template}/css/configure.css +0 -0
- /package/{template → src/template}/css/error.css +0 -0
- /package/{template → src/template}/css/style.css +0 -0
- /package/{template → src/template}/error.html +0 -0
- /package/{tiledesk → src/utils}/constants.js +0 -0
- /package/{tiledesk → src/utils}/errors.js +0 -0
- /package/{tiledesk → src/utils}/utils.js +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
The LICENSE file for any project gives credit to the creator/author of the
|
|
2
|
+
project, copyright information for the project, and the legal terms under
|
|
3
|
+
which it's being shared. In other words, this is us using an MIT license to
|
|
4
|
+
say "we wrote this and you can do whatever you want with it."
|
|
5
|
+
|
|
6
|
+
******************************************************************************
|
|
7
|
+
~glitch-hello-node
|
|
8
|
+
******************************************************************************
|
|
9
|
+
MIT License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2021, Glitch, Inc.
|
|
12
|
+
|
|
13
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
14
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
15
|
+
in the Software without restriction, including without limitation the rights
|
|
16
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
17
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
18
|
+
furnished to do so, subject to the following conditions:
|
|
19
|
+
|
|
20
|
+
The above copyright notice and this permission notice shall be included in all
|
|
21
|
+
copies or substantial portions of the Software.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
26
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
27
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
28
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
29
|
+
SOFTWARE.
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
******************************************************************************
|
|
35
|
+
|
|
36
|
+
THIRD-PARTY SOFTWARE
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
1. fastify: Fastify is a web framework focused on developer experience.
|
|
40
|
+
2. fastify/static: Plugin for serving static files as fast as possible.
|
|
41
|
+
3. handlebars.js: Minimal templating on steroids
|
|
42
|
+
4. fastify/view: Templates rendering plugin support for Fastify.
|
|
43
|
+
5. HK Grotesk: The font we're using.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
******************************************************************************
|
|
47
|
+
1. fastify (also applies to fastify-formbody)
|
|
48
|
+
URL: https://www.fastify.io/
|
|
49
|
+
https://github.com/fastify/fastify
|
|
50
|
+
******************************************************************************
|
|
51
|
+
MIT License
|
|
52
|
+
|
|
53
|
+
Copyright (c) 2016-2020 The Fastify Team
|
|
54
|
+
|
|
55
|
+
The Fastify team members are listed at https://github.com/fastify/fastify#team
|
|
56
|
+
and in the README file.
|
|
57
|
+
|
|
58
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
59
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
60
|
+
in the Software without restriction, including without limitation the rights
|
|
61
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
62
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
63
|
+
furnished to do so, subject to the following conditions:
|
|
64
|
+
|
|
65
|
+
The above copyright notice and this permission notice shall be included in all
|
|
66
|
+
copies or substantial portions of the Software.
|
|
67
|
+
|
|
68
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
69
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
70
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
71
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
72
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
73
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
74
|
+
SOFTWARE.
|
|
75
|
+
******************************************************************************
|
|
76
|
+
END, fastify
|
|
77
|
+
******************************************************************************
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
******************************************************************************
|
|
81
|
+
2. fastify/static
|
|
82
|
+
URL: https://github.com/fastify/fastify-static
|
|
83
|
+
******************************************************************************
|
|
84
|
+
MIT License
|
|
85
|
+
|
|
86
|
+
Copyright (c) 2017-2018 Fastify
|
|
87
|
+
|
|
88
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
89
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
90
|
+
in the Software without restriction, including without limitation the rights
|
|
91
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
92
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
93
|
+
furnished to do so, subject to the following conditions:
|
|
94
|
+
|
|
95
|
+
The above copyright notice and this permission notice shall be included in all
|
|
96
|
+
copies or substantial portions of the Software.
|
|
97
|
+
|
|
98
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
99
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
100
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
101
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
102
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
103
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
104
|
+
SOFTWARE.
|
|
105
|
+
******************************************************************************
|
|
106
|
+
END, fastify/static
|
|
107
|
+
******************************************************************************
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
******************************************************************************
|
|
111
|
+
3. handlebars.js
|
|
112
|
+
URL: https://handlebarsjs.com/
|
|
113
|
+
https://github.com/handlebars-lang/handlebars.js
|
|
114
|
+
******************************************************************************
|
|
115
|
+
Copyright (C) 2011-2019 by Yehuda Katz
|
|
116
|
+
|
|
117
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
118
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
119
|
+
in the Software without restriction, including without limitation the rights
|
|
120
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
121
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
122
|
+
furnished to do so, subject to the following conditions:
|
|
123
|
+
|
|
124
|
+
The above copyright notice and this permission notice shall be included in
|
|
125
|
+
all copies or substantial portions of the Software.
|
|
126
|
+
|
|
127
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
128
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
129
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
130
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
131
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
132
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
133
|
+
THE SOFTWARE.
|
|
134
|
+
******************************************************************************
|
|
135
|
+
END, fastify-static
|
|
136
|
+
******************************************************************************
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
******************************************************************************
|
|
140
|
+
4. fastify/view
|
|
141
|
+
URL: https://github.com/fastify/point-of-view
|
|
142
|
+
******************************************************************************
|
|
143
|
+
MIT License
|
|
144
|
+
|
|
145
|
+
Copyright (c) 2017 Fastify
|
|
146
|
+
|
|
147
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
148
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
149
|
+
in the Software without restriction, including without limitation the rights
|
|
150
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
151
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
152
|
+
furnished to do so, subject to the following conditions:
|
|
153
|
+
|
|
154
|
+
The above copyright notice and this permission notice shall be included in all
|
|
155
|
+
copies or substantial portions of the Software.
|
|
156
|
+
|
|
157
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
158
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
159
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
160
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
161
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
162
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
163
|
+
SOFTWARE.
|
|
164
|
+
******************************************************************************
|
|
165
|
+
END, fastify/view
|
|
166
|
+
******************************************************************************
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
******************************************************************************
|
|
170
|
+
5. HK Grotesk
|
|
171
|
+
URL: https://hanken.co/products/hk-grotesk
|
|
172
|
+
******************************************************************************
|
|
173
|
+
HK Grotesk was designed by Hanken Design Co. It is shared using a SIL OFL
|
|
174
|
+
license. Full license text can be found at:
|
|
175
|
+
|
|
176
|
+
https://hanken.co/pages/web-fonts-eula
|
|
177
|
+
******************************************************************************
|
|
178
|
+
END, HK Grotesk
|
|
179
|
+
******************************************************************************
|
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Hello Node!
|
|
2
|
+
|
|
3
|
+
This project includes a Node.js server script and a web page that connects to it. The front-end page presents a form the visitor can use to submit a color name, sending the submitted value to the back-end API running on the server. The server returns info to the page that allows it to update the display with the chosen color. 🎨
|
|
4
|
+
|
|
5
|
+
[Node.js](https://nodejs.org/en/about/) is a popular runtime that lets you run server-side JavaScript. This project uses the [Fastify](https://www.fastify.io/) framework and explores basic templating with [Handlebars](https://handlebarsjs.com/).
|
|
6
|
+
|
|
7
|
+
_Last updated: 14 August 2023_
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
You'll get best use out of this project if you're familiar with basic JavaScript. If you've written JavaScript for client-side web pages this is a little different because it uses server-side JS, but the syntax is the same!
|
|
12
|
+
|
|
13
|
+
## What's in this project?
|
|
14
|
+
|
|
15
|
+
← `README.md`: That’s this file, where you can tell people what your cool website does and how you built it.
|
|
16
|
+
|
|
17
|
+
← `public/style.css`: The styling rules for the pages in your site.
|
|
18
|
+
|
|
19
|
+
← `server.js`: The **Node.js** server script for your new site. The JavaScript defines the endpoints in the site back-end, one to return the homepage and one to update with the submitted color. Each one sends data to a Handlebars template which builds these parameter values into the web page the visitor sees.
|
|
20
|
+
|
|
21
|
+
← `package.json`: The NPM packages for your project's dependencies.
|
|
22
|
+
|
|
23
|
+
← `src/`: This folder holds the site template along with some basic data files.
|
|
24
|
+
|
|
25
|
+
← `src/pages/index.hbs`: This is the main page template for your site. The template receives parameters from the server script, which it includes in the page HTML. The page sends the user submitted color value in the body of a request, or as a query parameter to choose a random color.
|
|
26
|
+
|
|
27
|
+
← `src/colors.json`: A collection of CSS color names. We use this in the server script to pick a random color, and to match searches against color names.
|
|
28
|
+
|
|
29
|
+
← `src/seo.json`: When you're ready to share your new site or add a custom domain, change SEO/meta settings in here.
|
|
30
|
+
|
|
31
|
+
## Try this next 🏗️
|
|
32
|
+
|
|
33
|
+
Take a look in `TODO.md` for next steps you can try out in your new site!
|
|
34
|
+
|
|
35
|
+
___Want a minimal version of this project to build your own Node.js app? Check out [Blank Node](https://glitch.com/edit/#!/remix/glitch-blank-node)!___
|
|
36
|
+
|
|
37
|
+

|
|
38
|
+
|
|
39
|
+
## You built this with Glitch!
|
|
40
|
+
|
|
41
|
+
[Glitch](https://glitch.com) is a friendly community where millions of people come together to build web apps and websites.
|
|
42
|
+
|
|
43
|
+
- Need more help? [Check out our Help Center](https://help.glitch.com/) for answers to any common questions.
|
|
44
|
+
- Ready to make it official? [Become a paid Glitch member](https://glitch.com/pricing) to boost your app with private sharing, more storage and memory, domains and more.
|