@tiledesk/tiledesk-whatsapp-connector 0.1.63 → 0.1.65
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 +32 -19
- package/logs/app.log +568 -0
- package/package.json +1 -1
- package/routes/api.js +2 -1
- package/template/detail.html +7 -24
- package/template/detail_BACKUP_360.html +278 -0
- package/template/detail_BACKUP_640.html +278 -0
- package/template/detail_BASE_360.html +271 -0
- package/template/detail_BASE_640.html +271 -0
- package/template/detail_LOCAL_360.html +278 -0
- package/template/detail_LOCAL_640.html +278 -0
- package/template/detail_REMOTE_360.html +254 -0
- package/template/detail_REMOTE_640.html +254 -0
- package/tiledesk/KVBaseMongo.js +9 -0
package/index.js
CHANGED
|
@@ -742,6 +742,11 @@ router.post("/tiledesk", async (req, res) => {
|
|
|
742
742
|
return res.sendStatus(200);
|
|
743
743
|
}
|
|
744
744
|
|
|
745
|
+
if (attributes && attributes.subtype === "private") {
|
|
746
|
+
winston.verbose("(wab) Skip subtype (private)");
|
|
747
|
+
return res.sendStatus(200);
|
|
748
|
+
}
|
|
749
|
+
|
|
745
750
|
if (attributes && attributes.subtype === "info/support") {
|
|
746
751
|
winston.verbose("(wab) Skip subtype: " + attributes.subtype);
|
|
747
752
|
return res.sendStatus(200);
|
|
@@ -1612,29 +1617,37 @@ async function startApp(settings, callback) {
|
|
|
1612
1617
|
winston.info("(wab) JOB_TOPIC_EXCHANGE is present");
|
|
1613
1618
|
}
|
|
1614
1619
|
|
|
1615
|
-
|
|
1616
|
-
if (
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
+
// For test only
|
|
1621
|
+
if (settings.LOG_MONGODB_URL) {
|
|
1622
|
+
/**
|
|
1623
|
+
* Connect with a different Database
|
|
1624
|
+
*/
|
|
1625
|
+
// mongoose
|
|
1626
|
+
// .connect(settings.LOG_MONGODB_URL)
|
|
1627
|
+
// .then(() => {
|
|
1628
|
+
// winston.info("Mongoose DB Connected");
|
|
1629
|
+
// })
|
|
1630
|
+
// .catch((err) => {
|
|
1631
|
+
// winston.error("(Mongoose) Unable to connect with MongoDB ", err);
|
|
1632
|
+
// });
|
|
1620
1633
|
}
|
|
1621
1634
|
|
|
1622
|
-
|
|
1623
|
-
.
|
|
1624
|
-
|
|
1625
|
-
|
|
1635
|
+
if (settings.dbconnection) {
|
|
1636
|
+
db.reuseConnection(settings.dbconnection, () => {
|
|
1637
|
+
winston.info("(wab) KVBaseMongo reused exsisting db connection");
|
|
1638
|
+
if (callback) {
|
|
1639
|
+
callback(null);
|
|
1640
|
+
}
|
|
1626
1641
|
})
|
|
1627
|
-
|
|
1628
|
-
|
|
1642
|
+
} else {
|
|
1643
|
+
db.connect(settings.MONGODB_URL, () => {
|
|
1644
|
+
winston.info("(wab) KVBaseMongo successfully connected.");
|
|
1645
|
+
|
|
1646
|
+
if (callback) {
|
|
1647
|
+
callback(null);
|
|
1648
|
+
}
|
|
1629
1649
|
});
|
|
1630
|
-
|
|
1631
|
-
db.connect(settings.MONGODB_URL, () => {
|
|
1632
|
-
winston.info("(wab) KVBaseMongo successfully connected.");
|
|
1633
|
-
|
|
1634
|
-
if (callback) {
|
|
1635
|
-
callback(null);
|
|
1636
|
-
}
|
|
1637
|
-
});
|
|
1650
|
+
}
|
|
1638
1651
|
|
|
1639
1652
|
api.startRoute(
|
|
1640
1653
|
{
|