@tiledesk/tiledesk-whatsapp-connector 0.1.8 → 0.1.9
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 +2 -1
- package/package.json +1 -1
- package/template/configure.html +26 -6
- package/template/css/style.css +46 -0
package/index.js
CHANGED
|
@@ -12,7 +12,7 @@ const bodyParser = require("body-parser");
|
|
|
12
12
|
const appRoot = require('app-root-path');
|
|
13
13
|
const handlebars = require('handlebars');
|
|
14
14
|
const fs = require('fs');
|
|
15
|
-
|
|
15
|
+
const path = require('path');
|
|
16
16
|
//const FormData = require('form-data');
|
|
17
17
|
|
|
18
18
|
// tiledesk clients
|
|
@@ -28,6 +28,7 @@ const kvbase_collection = 'kvstore';
|
|
|
28
28
|
|
|
29
29
|
router.use(bodyParser.json());
|
|
30
30
|
router.use(bodyParser.urlencoded({ extended: true }));
|
|
31
|
+
router.use(express.static(path.join(__dirname, 'template')));
|
|
31
32
|
|
|
32
33
|
//const TOKEN = process.env.WHATSAPP_TOKEN; // From FB DevX getting started page
|
|
33
34
|
//const VERIFY_TOKEN = process.env.VERIFY_TOKEN; // Arbitrary, used with webhook configuration in FB DevX
|
package/package.json
CHANGED
package/template/configure.html
CHANGED
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"
|
|
24
24
|
integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous">
|
|
25
25
|
</script>
|
|
26
|
+
|
|
27
|
+
<link rel="stylesheet" href="./css/style.css">
|
|
26
28
|
|
|
27
29
|
</head>
|
|
28
30
|
|
|
@@ -43,7 +45,7 @@
|
|
|
43
45
|
<div>
|
|
44
46
|
|
|
45
47
|
<h1 style="margin-top: 0px; margin-bottom: 2px; min-width: 500px;">WhatsApp Business</h1>
|
|
46
|
-
<h7 style="color: rgb(140, 140, 140);">by Tiledesk (v. 0.1.
|
|
48
|
+
<h7 style="color: rgb(140, 140, 140);">by Tiledesk (v. 0.1.9)</h7>
|
|
47
49
|
|
|
48
50
|
{{#if wab_token}}
|
|
49
51
|
<div style="margin-top: 20px;">
|
|
@@ -94,9 +96,14 @@
|
|
|
94
96
|
<form action="./update" method="post">
|
|
95
97
|
|
|
96
98
|
<div class="form-group" style="width: 490px;">
|
|
97
|
-
<label
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
<label for="proxy_url">Webhook Endpoint
|
|
100
|
+
<span style="margin-left: 10px;">
|
|
101
|
+
<i class="fa fa-question-circle custom-tooltip" style="color: #337ab7;">
|
|
102
|
+
<span class="custom-tooltiptext">This is the endpoint to be reached by WhatsApp. Copy it to the Facebook Developer console in "Callback URL" in Whatsapp Configuration. See documention for more info.</span>
|
|
103
|
+
</i>
|
|
104
|
+
</span>
|
|
105
|
+
</label>
|
|
106
|
+
<!--<p style="margin-bottom: 5px; font-size: 12px; color: #a7a7a7;">Copy this URL in the Facebook Developer Dashboad. See documentation for more info.</p> -->
|
|
100
107
|
<div style="display: flex; flex-direction: row; justify-content: space-between">
|
|
101
108
|
<div style="width: 400px;">
|
|
102
109
|
<input type="text" readonly class="form-control" name="proxy_url" id="proxy_url"
|
|
@@ -117,13 +124,26 @@
|
|
|
117
124
|
</div>
|
|
118
125
|
|
|
119
126
|
<div class="form-group" style="width: 400px;">
|
|
120
|
-
<label for="wab_token">Whatsapp Token
|
|
127
|
+
<label for="wab_token">Whatsapp Token
|
|
128
|
+
<span style="margin-left: 10px;">
|
|
129
|
+
<i class="fa fa-question-circle custom-tooltip" style="color: #337ab7;">
|
|
130
|
+
<span class="custom-tooltiptext">Paste it the permanent WhatsApp Business token. See documention for more info.</span>
|
|
131
|
+
</i>
|
|
132
|
+
</span>
|
|
133
|
+
</label>
|
|
121
134
|
<input type="text" class="form-control" name="wab_token" value="{{ wab_token }}"
|
|
122
135
|
placeholder="Enter the Whatsapp Token">
|
|
123
136
|
</div>
|
|
124
137
|
|
|
125
138
|
<div class="form-group" style="width: 400px;">
|
|
126
|
-
<label for="verify_token">Verify Token
|
|
139
|
+
<label for="verify_token">Verify Token
|
|
140
|
+
<span style="margin-left: 10px;">
|
|
141
|
+
<i class="fa fa-question-circle custom-tooltip" style="color: #337ab7;">
|
|
142
|
+
<span class="custom-tooltiptext">This is a verification token of your choice. Copy it to the Facebook Developer console in "Verify Token" in Whatsapp Configuration.
|
|
143
|
+
See documention for more info.</span>
|
|
144
|
+
</i>
|
|
145
|
+
</span>
|
|
146
|
+
</label>
|
|
127
147
|
<input type="password" class="form-control" name="verify_token" value="{{ verify_token }}"
|
|
128
148
|
placeholder="Enter your Verify Token">
|
|
129
149
|
</div>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/* Tooltip container */
|
|
2
|
+
.custom-tooltip {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: inline-block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* Tooltip text */
|
|
8
|
+
.custom-tooltip .custom-tooltiptext {
|
|
9
|
+
visibility: hidden;
|
|
10
|
+
width: 260px;
|
|
11
|
+
background-color: #6e6f70;
|
|
12
|
+
font-size: 13px;
|
|
13
|
+
color: #fff;
|
|
14
|
+
text-align: center;
|
|
15
|
+
padding: 8px 8px;
|
|
16
|
+
border-radius: 6px;
|
|
17
|
+
|
|
18
|
+
/* Position the tooltip text */
|
|
19
|
+
position: absolute;
|
|
20
|
+
z-index: 1;
|
|
21
|
+
bottom: 125%;
|
|
22
|
+
left: 50%;
|
|
23
|
+
margin-left: -130px;
|
|
24
|
+
|
|
25
|
+
/* Fade in tooltip */
|
|
26
|
+
opacity: 0;
|
|
27
|
+
transition: opacity 0.3s;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Tooltip arrow */
|
|
31
|
+
.custom-tooltip .custom-tooltiptext::after {
|
|
32
|
+
content: "";
|
|
33
|
+
position: absolute;
|
|
34
|
+
top: 100%;
|
|
35
|
+
left: 50%;
|
|
36
|
+
margin-left: -5px;
|
|
37
|
+
border-width: 5px;
|
|
38
|
+
border-style: solid;
|
|
39
|
+
border-color: #555 transparent transparent transparent;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Show the tooltip text when you mouse over the tooltip container */
|
|
43
|
+
.custom-tooltip:hover .custom-tooltiptext {
|
|
44
|
+
visibility: visible;
|
|
45
|
+
opacity: 1;
|
|
46
|
+
}
|