@tiledesk/tiledesk-whatsapp-connector 0.1.29 → 0.1.31
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 +21 -8
- package/package.json +1 -1
- package/template/detail.html +27 -11
package/index.js
CHANGED
|
@@ -900,14 +900,22 @@ router.post("/newtest", async (req, res) => {
|
|
|
900
900
|
let short_uid = uuidv4().substring(0, 8)
|
|
901
901
|
let key = "bottest:" + short_uid;
|
|
902
902
|
|
|
903
|
+
if (!redis_client) {
|
|
904
|
+
return res.status(500).send({ message: "Test it out on Whatsapp not available. Redis not ready."})
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
//console.log("redis_client: ", redis_client)
|
|
908
|
+
|
|
903
909
|
await redis_client.set(key, JSON.stringify(info));
|
|
904
910
|
//const value = await redis_client.get(key)
|
|
905
911
|
//console.log("get --> value: ", value)
|
|
906
912
|
redis_client.get(key, (err, value) => {
|
|
907
913
|
if (err) {
|
|
908
914
|
console.log("get err: ", err)
|
|
915
|
+
return res.status(500).send({success: "false", message: "No info found on redis"});
|
|
909
916
|
} else {
|
|
910
917
|
console.log("get value: ", value)
|
|
918
|
+
return res.status(200).send({short_uid: short_uid});
|
|
911
919
|
}
|
|
912
920
|
})
|
|
913
921
|
/*
|
|
@@ -916,7 +924,7 @@ router.post("/newtest", async (req, res) => {
|
|
|
916
924
|
path: '.nodell',
|
|
917
925
|
});
|
|
918
926
|
*/
|
|
919
|
-
res.status(200).send({short_uid: short_uid});
|
|
927
|
+
//res.status(200).send({short_uid: short_uid});
|
|
920
928
|
})
|
|
921
929
|
|
|
922
930
|
router.post("/testitout/:project_id", async (req, res) => {
|
|
@@ -1025,6 +1033,16 @@ async function startApp(settings, callback) {
|
|
|
1025
1033
|
console.log("(whatsapp) APPS_API_URL: ", APPS_API_URL);
|
|
1026
1034
|
}
|
|
1027
1035
|
|
|
1036
|
+
if (settings.REDIS_HOST && settings.REDIS_PORT) {
|
|
1037
|
+
REDIS_HOST = settings.REDIS_HOST;
|
|
1038
|
+
REDIS_PORT = settings.REDIS_PORT;
|
|
1039
|
+
REDIS_PASSWORD = settings.REDIS_PASSWORD;
|
|
1040
|
+
connectRedis();
|
|
1041
|
+
} else {
|
|
1042
|
+
console.log("(whatsapp) Missing redis parameters --> Test it out on WhatsApp disabled");
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
/*
|
|
1028
1046
|
if (settings.REDIS_HOST && settings.REDIS_PORT && settings.REDIS_PASSWORD) {
|
|
1029
1047
|
REDIS_HOST = settings.REDIS_HOST;
|
|
1030
1048
|
REDIS_PORT = settings.REDIS_PORT;
|
|
@@ -1033,17 +1051,12 @@ async function startApp(settings, callback) {
|
|
|
1033
1051
|
} else {
|
|
1034
1052
|
console.log("(whatsapp) Missing redis parameters --> Test it out on WhatsApp disabled");
|
|
1035
1053
|
}
|
|
1054
|
+
*/
|
|
1036
1055
|
|
|
1037
1056
|
if (settings.log) {
|
|
1038
1057
|
log = settings.log;
|
|
1039
1058
|
}
|
|
1040
1059
|
|
|
1041
|
-
redis_client = redis.createClient({
|
|
1042
|
-
host: REDIS_HOST,
|
|
1043
|
-
port: REDIS_PORT,
|
|
1044
|
-
password: REDIS_PASSWORD
|
|
1045
|
-
});
|
|
1046
|
-
|
|
1047
1060
|
db.connect(settings.MONGODB_URL, () => {
|
|
1048
1061
|
console.log("(whatsapp) KVBaseMongo successfully connected.");
|
|
1049
1062
|
|
|
@@ -1057,7 +1070,7 @@ function connectRedis() {
|
|
|
1057
1070
|
redis_client = redis.createClient({
|
|
1058
1071
|
host: REDIS_HOST,
|
|
1059
1072
|
port: REDIS_PORT,
|
|
1060
|
-
password: REDIS_PASSWORD
|
|
1073
|
+
password: REDIS_PASSWORD
|
|
1061
1074
|
});
|
|
1062
1075
|
|
|
1063
1076
|
redis_client.on('error', err => {
|
package/package.json
CHANGED
package/template/detail.html
CHANGED
|
@@ -54,6 +54,9 @@
|
|
|
54
54
|
<div style="display: flex; flex-direction: row; justify-content: space-between; margin-left: 40px; width: 100%;">
|
|
55
55
|
<div>
|
|
56
56
|
<p style="font-size: 26px; font-weight: 500; margin-bottom: 0px;">WhatsApp Business</p>
|
|
57
|
+
<p style="color: #676767; font-size: 16px; margin-bottom: 5px;">Connect your WhatsApp number with Tiledesk</p>
|
|
58
|
+
<a style="font-size: 18px;" href="https://tiledesk.com/" target="_blank">Tiledesk</a>
|
|
59
|
+
<p style="font-size: 15px; color: #676767; font-style: italic; margin-bottom: 0px; margin-top: 20px;">Free</p>
|
|
57
60
|
</div>
|
|
58
61
|
|
|
59
62
|
<div style="display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end;">
|
|
@@ -129,10 +132,17 @@
|
|
|
129
132
|
<div class="scrollmenu">
|
|
130
133
|
|
|
131
134
|
<img src="https://user-images.githubusercontent.com/45603238/195042381-995ff805-359d-4d97-af67-f86f937c175a.jpg" class="screenshot" />
|
|
135
|
+
|
|
136
|
+
<img src="https://user-images.githubusercontent.com/45603238/195042391-6560424b-6a20-48ef-a5b3-981f9cbda5db.jpg" class="screenshot" />
|
|
137
|
+
|
|
138
|
+
<img src=" https://user-images.githubusercontent.com/45603238/195042354-e8ce2b8b-4a82-45b6-8ac1-c1d1bcf77e40.jpg" class="screenshot"/>
|
|
139
|
+
|
|
140
|
+
<img src="https://user-images.githubusercontent.com/45603238/196982373-6b17cf76-6608-45bf-86da-551c14c46e0f.png" class="screenshot" />
|
|
132
141
|
|
|
133
142
|
</div>
|
|
134
143
|
|
|
135
144
|
<hr style="margin-top: 20px; margin-bottom: 20px">
|
|
145
|
+
|
|
136
146
|
<div>
|
|
137
147
|
<h7>Receive Whatsapp conversations in your Tiledesk dashboard. Seamlessly Chat with your targeted audience on Whatsapp right from the Tiledesk dashboard.</h7>
|
|
138
148
|
|
|
@@ -152,11 +162,14 @@
|
|
|
152
162
|
</ul>
|
|
153
163
|
|
|
154
164
|
<div style="padding: 20px; background-color: aliceblue; border-radius: 8px;">
|
|
155
|
-
|
|
165
|
+
<div style="display: flex; flex-direction: row; align-items: baseline;">
|
|
156
166
|
<div>
|
|
157
167
|
<img src="https://freeiconshop.com/wp-content/uploads/edd/arrow-flat.png" width="20px" height="auto" style="margin-right: 10px;">
|
|
158
168
|
</div>
|
|
159
|
-
|
|
169
|
+
<div>
|
|
170
|
+
<a href="https://gethelp.tiledesk.com/articles/connect-tiledesk-with-whatsapp-business/" target="_blank">Connect Tiledesk with WhatsApp Business</a>
|
|
171
|
+
<p style="color: grey; margin-bottom: 0px;">A small but very useful guide on how to connect your WhatsApp Business number with Tiledesk</p>
|
|
172
|
+
</div>
|
|
160
173
|
</div>
|
|
161
174
|
|
|
162
175
|
<hr style="margin-top: 10px; margin-bottom: 10px;">
|
|
@@ -165,8 +178,11 @@
|
|
|
165
178
|
<div>
|
|
166
179
|
<img src="https://freeiconshop.com/wp-content/uploads/edd/arrow-flat.png" width="20px" height="auto" style="margin-right: 10px;">
|
|
167
180
|
</div>
|
|
181
|
+
<div>
|
|
182
|
+
<a href="https://gethelp.tiledesk.com/articles/configure-a-whatsapp-business-account/" target="_blank">Configure a WhatsApp Business account</a>
|
|
183
|
+
<p style="color: grey; margin-bottom: 0px;">Not sure how to set up a business account? Take a look here.</p>
|
|
184
|
+
</div>
|
|
168
185
|
</div>
|
|
169
|
-
</div>
|
|
170
186
|
</div>
|
|
171
187
|
|
|
172
188
|
|
|
@@ -174,33 +190,33 @@
|
|
|
174
190
|
|
|
175
191
|
<p style="font-size: 18px;"><b>What's new?</b></p>
|
|
176
192
|
|
|
177
|
-
|
|
193
|
+
<div style="width: 100%; display: flex; flex-direction: row; justify-content: space-between; margin-bottom: 15px;">
|
|
178
194
|
<div>
|
|
179
|
-
<p style="margin-bottom: 0px">
|
|
195
|
+
<p style="margin-bottom: 0px">Bug Fixes</p>
|
|
180
196
|
<p style="margin-bottom: 0px">Minor improvements</p>
|
|
181
197
|
<!--<p>Bug fixes and performance improvements</p>-->
|
|
182
198
|
</div>
|
|
183
|
-
<p style="font-size: 12px; color: #676767; margin-bottom: 0px;">Version <b>0.1.
|
|
199
|
+
<p style="font-size: 12px; color: #676767; margin-bottom: 0px;">Version <b>0.1.31</b></p>
|
|
184
200
|
</div>
|
|
185
201
|
|
|
186
202
|
<div style="width: 100%; display: flex; flex-direction: row; justify-content: space-between; margin-bottom: 15px;">
|
|
187
203
|
<div>
|
|
188
|
-
<p style="margin-bottom: 0px">
|
|
204
|
+
<p style="margin-bottom: 0px">Added support for Test-it-out</p>
|
|
205
|
+
<p style="margin-bottom: 0px">Minor improvements</p>
|
|
189
206
|
<!--<p>Bug fixes and performance improvements</p>-->
|
|
190
207
|
</div>
|
|
191
|
-
<p style="font-size: 12px; color: #676767; margin-bottom: 0px;">Version <b>0.1.
|
|
208
|
+
<p style="font-size: 12px; color: #676767; margin-bottom: 0px;">Version <b>0.1.24</b></p>
|
|
192
209
|
</div>
|
|
193
210
|
|
|
194
211
|
<div style="width: 100%; display: flex; flex-direction: row; justify-content: space-between; margin-bottom: 15px;">
|
|
195
212
|
<div>
|
|
196
|
-
<p style="margin-bottom: 0px;">New User Interface!</p>
|
|
197
|
-
<p style="margin-bottom: 0px">Added support for tdImage</p>
|
|
198
213
|
<p style="margin-bottom: 0px">Bug Fixes</p>
|
|
199
214
|
<!--<p>Bug fixes and performance improvements</p>-->
|
|
200
215
|
</div>
|
|
201
|
-
<p style="font-size: 12px; color: #676767; margin-bottom: 0px;">Version <b>0.1.
|
|
216
|
+
<p style="font-size: 12px; color: #676767; margin-bottom: 0px;">Version <b>0.1.23</b></p>
|
|
202
217
|
</div>
|
|
203
218
|
|
|
219
|
+
|
|
204
220
|
<hr style="margin-top: 50px; margin-bottom: 20px">
|
|
205
221
|
|
|
206
222
|
</body>
|