@tiledesk/tiledesk-whatsapp-connector 0.1.15 → 0.1.16
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/index.js +36 -27
- package/package.json +1 -1
- package/template/configure.html +6 -1
- package/template/css/style.css +26 -0
- package/template/detail.html +7 -0
- package/tmp/media-1wy7l3.jpeg +0 -0
- package/tmp/media-1wy8f7.mp4 +0 -0
- package/tmp/media-1wy8mz.jpeg +0 -0
- package/tmp/media-1wyb62.jpeg +0 -0
- package/tmp/media-1wyb7k.mp4 +0 -0
- package/tmp/media-1wyb98.pdf +0 -0
- package/tmp/media-1wybp7.pdf +0 -0
- package/tmp/media-1y8xpl.jpeg +0 -0
- package/tmp/media-1y8xpv.jpeg +0 -0
- package/tmp/media-1y8xqd.jpeg +0 -0
- package/tmp/media-1y8xr4.jpeg +0 -0
- package/tmp/media-1y8xty.jpeg +0 -0
- package/tmp/media-1y8xvp.jpeg +0 -0
- package/tmp/media-1y8xx5.jpeg +0 -0
- package/tmp/media-1y8y0g.jpeg +0 -0
- package/tmp/media-1y8y4x.jpeg +0 -0
- package/tmp/media-1y8y5k.jpeg +0 -0
- package/tmp/media-1y8ya4.jpeg +0 -0
- package/tmp/media-1y8ya7.jpeg +0 -0
- package/tmp/media-1y8yek.jpeg +0 -0
- package/tmp/media-1y8yfg.jpeg +0 -0
- package/tmp/media-1y8ygr.jpeg +0 -0
- package/tmp/media-1y8yh4.jpeg +0 -0
- package/tmp/media-1y8yi1.jpeg +0 -0
- package/tmp/media-1y8yid.jpeg +0 -0
- package/tmp/media-1y8yks.jpeg +0 -0
- package/tmp/media-1y8ym4.mp4 +0 -0
- package/tmp/media-1y8yqe.jpeg +0 -0
- package/tmp/media-1y8yuv.jpeg +0 -0
- package/tmp/media-1y8yv9.jpeg +0 -0
- package/tmp/media-1y8yy2.jpeg +0 -0
package/index.js
CHANGED
|
@@ -7,6 +7,7 @@ const appRoot = require('app-root-path');
|
|
|
7
7
|
const handlebars = require('handlebars');
|
|
8
8
|
const fs = require('fs');
|
|
9
9
|
const path = require('path');
|
|
10
|
+
const pjson = require('./package.json');
|
|
10
11
|
|
|
11
12
|
// tiledesk clients
|
|
12
13
|
const { TiledeskClient } = require('@tiledesk/tiledesk-client');
|
|
@@ -57,6 +58,7 @@ router.get('/detail', async (req, res) => {
|
|
|
57
58
|
|
|
58
59
|
var template = handlebars.compile(html);
|
|
59
60
|
var replacements = {
|
|
61
|
+
app_version: pjson.version,
|
|
60
62
|
project_id: projectId,
|
|
61
63
|
token: token,
|
|
62
64
|
app_id: app_id,
|
|
@@ -102,6 +104,7 @@ router.post('/install', async (req, res) => {
|
|
|
102
104
|
|
|
103
105
|
var template = handlebars.compile(html);
|
|
104
106
|
var replacements = {
|
|
107
|
+
app_version: pjson.version,
|
|
105
108
|
project_id: project_id,
|
|
106
109
|
token: token,
|
|
107
110
|
app_id: app_id,
|
|
@@ -142,6 +145,7 @@ router.post('/uninstall', async (req, res) => {
|
|
|
142
145
|
|
|
143
146
|
var template = handlebars.compile(html);
|
|
144
147
|
var replacements = {
|
|
148
|
+
app_version: pjson.version,
|
|
145
149
|
project_id: project_id,
|
|
146
150
|
token: token,
|
|
147
151
|
app_id: app_id,
|
|
@@ -189,6 +193,7 @@ router.get('/configure', async (req, res) => {
|
|
|
189
193
|
|
|
190
194
|
var template = handlebars.compile(html);
|
|
191
195
|
var replacements = {
|
|
196
|
+
app_version: pjson.version,
|
|
192
197
|
project_id: projectId,
|
|
193
198
|
token: token,
|
|
194
199
|
proxy_url: proxy_url,
|
|
@@ -214,6 +219,7 @@ router.get('/configure', async (req, res) => {
|
|
|
214
219
|
|
|
215
220
|
var template = handlebars.compile(html);
|
|
216
221
|
var replacements = {
|
|
222
|
+
app_version: pjson.version,
|
|
217
223
|
project_id: projectId,
|
|
218
224
|
token: token,
|
|
219
225
|
proxy_url: proxy_url,
|
|
@@ -258,6 +264,7 @@ router.post('/update', async (req, res) => {
|
|
|
258
264
|
|
|
259
265
|
var template = handlebars.compile(html);
|
|
260
266
|
var replacements = {
|
|
267
|
+
app_version: pjson.version,
|
|
261
268
|
project_id: projectId,
|
|
262
269
|
token: token,
|
|
263
270
|
proxy_url: proxy_url,
|
|
@@ -316,6 +323,7 @@ router.post('/update', async (req, res) => {
|
|
|
316
323
|
|
|
317
324
|
var template = handlebars.compile(html);
|
|
318
325
|
var replacements = {
|
|
326
|
+
app_version: pjson.version,
|
|
319
327
|
project_id: projectId,
|
|
320
328
|
token: token,
|
|
321
329
|
proxy_url: proxy_url,
|
|
@@ -373,6 +381,7 @@ router.post('/disconnect', async (req, res) => {
|
|
|
373
381
|
|
|
374
382
|
var template = handlebars.compile(html);
|
|
375
383
|
var replacements = {
|
|
384
|
+
app_version: pjson.version,
|
|
376
385
|
project_id: projectId,
|
|
377
386
|
token: token,
|
|
378
387
|
proxy_url: proxy_url,
|
|
@@ -683,36 +692,36 @@ function startApp(settings, callback) {
|
|
|
683
692
|
console.log("GRAPH_URL: ", GRAPH_URL);
|
|
684
693
|
}
|
|
685
694
|
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
695
|
+
if (!settings.APPS_API_URL) {
|
|
696
|
+
throw new Error("settings.APPS_API_URL is mandatory");
|
|
697
|
+
} else {
|
|
698
|
+
APPS_API_URL = settings.APPS_API_URL;
|
|
699
|
+
console.log("APPS_API_URL: ", APPS_API_URL);
|
|
700
|
+
}
|
|
692
701
|
|
|
693
|
-
|
|
694
|
-
|
|
702
|
+
if (settings.log) {
|
|
703
|
+
log = settings.log;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
db.connect(settings.MONGODB_URL, () => {
|
|
707
|
+
console.log("KVBaseMongo successfully connected.");
|
|
708
|
+
if (callback) {
|
|
709
|
+
callback();
|
|
695
710
|
}
|
|
711
|
+
})
|
|
712
|
+
}
|
|
696
713
|
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
714
|
+
function readHTMLFile(templateName, callback) {
|
|
715
|
+
console.log("Reading file: ", templateName)
|
|
716
|
+
fs.readFile(__dirname + '/template' + templateName, { encoding: 'utf-8' },
|
|
717
|
+
function(err, html) {
|
|
718
|
+
if (err) {
|
|
719
|
+
throw err;
|
|
720
|
+
//callback(err);
|
|
721
|
+
} else {
|
|
722
|
+
callback(null, html)
|
|
701
723
|
}
|
|
702
724
|
})
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
function readHTMLFile(templateName, callback) {
|
|
706
|
-
console.log("Reading file: ", templateName)
|
|
707
|
-
fs.readFile(__dirname + '/template' + templateName, { encoding: 'utf-8' },
|
|
708
|
-
function(err, html) {
|
|
709
|
-
if (err) {
|
|
710
|
-
throw err;
|
|
711
|
-
//callback(err);
|
|
712
|
-
} else {
|
|
713
|
-
callback(null, html)
|
|
714
|
-
}
|
|
715
|
-
})
|
|
716
|
-
}
|
|
725
|
+
}
|
|
717
726
|
|
|
718
|
-
|
|
727
|
+
module.exports = { router: router, startApp: startApp };
|
package/package.json
CHANGED
package/template/configure.html
CHANGED
|
@@ -45,7 +45,12 @@
|
|
|
45
45
|
<div>
|
|
46
46
|
|
|
47
47
|
<h1 style="margin-top: 0px; margin-bottom: 2px; min-width: 500px;">WhatsApp Business</h1>
|
|
48
|
-
<
|
|
48
|
+
<div style="display: flex; flex-direction: row; align-items: flex-end;">
|
|
49
|
+
<h7 style="color: rgb(140, 140, 140); margin-right: 10px;">by Tiledesk</h7>
|
|
50
|
+
<div class="version">
|
|
51
|
+
<a class="npm-link" href="https://www.npmjs.com/package/@tiledesk/tiledesk-whatsapp-connector" target="_blank">{{ app_version }}</a>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
49
54
|
|
|
50
55
|
{{#if wab_token}}
|
|
51
56
|
<div style="margin-top: 20px;">
|
package/template/css/style.css
CHANGED
|
@@ -4,6 +4,32 @@
|
|
|
4
4
|
display: inline-block;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
.version {
|
|
8
|
+
background-color: #9b9b9b;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
padding: 0px 10px;
|
|
11
|
+
border-radius: 10px;
|
|
12
|
+
width: 59px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.version:hover {
|
|
16
|
+
/*background-color: #4187e4;*/
|
|
17
|
+
background-color: #3773c2;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
padding: 0px 10px;
|
|
20
|
+
border-radius: 10px;
|
|
21
|
+
width: 59px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.npm-link {
|
|
25
|
+
color: white !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.npm-link:hover {
|
|
29
|
+
color: white;
|
|
30
|
+
text-decoration: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
7
33
|
/* Tooltip text */
|
|
8
34
|
.custom-tooltip .custom-tooltiptext {
|
|
9
35
|
visibility: hidden;
|
package/template/detail.html
CHANGED
|
@@ -161,6 +161,13 @@
|
|
|
161
161
|
|
|
162
162
|
<p style="font-size: 18px;"><b>What's new?</b></p>
|
|
163
163
|
|
|
164
|
+
<div style="width: 100%; display: flex; flex-direction: row; justify-content: space-between; margin-bottom: 5px;">
|
|
165
|
+
<div>
|
|
166
|
+
<p style="margin-bottom: 0px;">Graphics improvements</p>
|
|
167
|
+
</div>
|
|
168
|
+
<p style="font-size: 12px; color: #676767">Version <b>0.1.16</b></p>
|
|
169
|
+
</div>
|
|
170
|
+
|
|
164
171
|
<div style="width: 100%; display: flex; flex-direction: row; justify-content: space-between; margin-bottom: 5px;">
|
|
165
172
|
<div>
|
|
166
173
|
<p style="margin-bottom: 0px;">Add support for pdf from Tiledesk</p>
|
package/tmp/media-1wy7l3.jpeg
DELETED
|
Binary file
|
package/tmp/media-1wy8f7.mp4
DELETED
|
Binary file
|
package/tmp/media-1wy8mz.jpeg
DELETED
|
Binary file
|
package/tmp/media-1wyb62.jpeg
DELETED
|
Binary file
|
package/tmp/media-1wyb7k.mp4
DELETED
|
Binary file
|
package/tmp/media-1wyb98.pdf
DELETED
|
Binary file
|
package/tmp/media-1wybp7.pdf
DELETED
|
Binary file
|
package/tmp/media-1y8xpl.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8xpv.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8xqd.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8xr4.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8xty.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8xvp.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8xx5.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8y0g.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8y4x.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8y5k.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8ya4.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8ya7.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8yek.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8yfg.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8ygr.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8yh4.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8yi1.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8yid.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8yks.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8ym4.mp4
DELETED
|
Binary file
|
package/tmp/media-1y8yqe.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8yuv.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8yv9.jpeg
DELETED
|
Binary file
|
package/tmp/media-1y8yy2.jpeg
DELETED
|
Binary file
|