@tiledesk/tiledesk-whatsapp-connector 0.1.7 → 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 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
- //const Path = require('path');
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-whatsapp-connector",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Tiledesk Whatsapp connector",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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
 
@@ -42,8 +44,8 @@
42
44
 
43
45
  <div>
44
46
 
45
- <h1 style="margin-top: 0px; margin-bottom: 2px; min-width: 500px;">WhatsApp Business (Test)</h1>
46
- <h7 style="color: rgb(140, 140, 140);">by Tiledesk (v. 0.1.7)</h7>
47
+ <h1 style="margin-top: 0px; margin-bottom: 2px; min-width: 500px;">WhatsApp Business</h1>
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;">
@@ -80,12 +82,13 @@
80
82
  </div>
81
83
 
82
84
  <div style="margin-top: 10px;">
83
- <a href="https://gethelp.tiledesk.com/" target="_blank">View documentation</a>
85
+ <a href="https://gethelp.tiledesk.com/categories/whatsapp-business/" target="_blank">View documentation</a>
84
86
  </div>
85
-
87
+
86
88
 
87
89
  <hr>
88
90
 
91
+
89
92
  <div>
90
93
  <h4>Your Configuration</h4>
91
94
 
@@ -93,9 +96,14 @@
93
96
  <form action="./update" method="post">
94
97
 
95
98
  <div class="form-group" style="width: 490px;">
96
- <label style="margin-bottom: 0px;" for="proxy_url">Webhook Endpoint
97
- <a href="https://gethelp.tiledesk.com/" target="_blank"><span style="margin-left: 10px;"><i class="fa fa-question-circle" style="color: #337ab7;"></i></span></a></label>
98
- <p style="margin-bottom: 5px; font-size: 12px; color: #a7a7a7;">Copy this URL in the Facebook Developer Dashboad. See documentation for more info.</p>
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> -->
99
107
  <div style="display: flex; flex-direction: row; justify-content: space-between">
100
108
  <div style="width: 400px;">
101
109
  <input type="text" readonly class="form-control" name="proxy_url" id="proxy_url"
@@ -116,13 +124,26 @@
116
124
  </div>
117
125
 
118
126
  <div class="form-group" style="width: 400px;">
119
- <label for="wab_token">Whatsapp Token</label>
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>
120
134
  <input type="text" class="form-control" name="wab_token" value="{{ wab_token }}"
121
135
  placeholder="Enter the Whatsapp Token">
122
136
  </div>
123
137
 
124
138
  <div class="form-group" style="width: 400px;">
125
- <label for="verify_token">Verify Token</label>
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>
126
147
  <input type="password" class="form-control" name="verify_token" value="{{ verify_token }}"
127
148
  placeholder="Enter your Verify Token">
128
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
+ }