Skip to content

Commit

Permalink
updated whatsapp connector version
Browse files Browse the repository at this point in the history
fix GRAPH_URL error
  • Loading branch information
Giovanni Troisi committed Feb 7, 2023
1 parent da2cdd8 commit 0dffd83
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 63 deletions.
142 changes: 101 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@tiledesk/tiledesk-kaleyra-proxy": "^0.1.6",
"@tiledesk/tiledesk-rasa-connector": "^1.0.10",
"@tiledesk/tiledesk-tybot-connector": "^0.1.55",
"@tiledesk/tiledesk-whatsapp-connector": "^0.1.19",
"@tiledesk/tiledesk-whatsapp-connector": "^0.1.24",
"amqplib": "^0.5.5",
"app-root-path": "^3.0.0",
"bcrypt-nodejs": "0.0.3",
Expand Down
26 changes: 15 additions & 11 deletions pubmodules/kaleyra/listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,21 @@ class Listener {
winston.debug("kaleyra config databaseUri: " + config.databaseUri);
}

kaleyra.startApp({
MONGODB_URL: config.databaseUri,
API_URL: apiUrl,
BASE_URL: apiUrl + "/modules/kaleyra",
APPS_API_URL: apiUrl + "/modules/apps",
KALEYRA_API_URL: process.env.KALEYRA_API_URL,
API_KEY: process.env.API_KEY,
log: process.env.KALEYRA_LOG
}, () => {
winston.info("Tiledesk Kaleyra proxy server succesfully started.");
})
if (!process.env.KALEYRA_API_URL || !process.env.API_KEY) {
winston.info("Skip Kaleyra startApp")
} else {
kaleyra.startApp({
MONGODB_URL: config.databaseUri,
API_URL: apiUrl,
BASE_URL: apiUrl + "/modules/kaleyra",
APPS_API_URL: apiUrl + "/modules/apps",
KALEYRA_API_URL: process.env.KALEYRA_API_URL,
API_KEY: process.env.API_KEY,
log: process.env.KALEYRA_LOG
}, () => {
winston.info("Tiledesk Kaleyra proxy server succesfully started.");
})
}
}
}

Expand Down
24 changes: 14 additions & 10 deletions pubmodules/whatsapp/listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@ class Listener {
winston.debug("whatsapp config databaseUri: " + config.databaseUri);
}

whatsapp.startApp({
MONGODB_URL: config.databaseUri,
API_URL: apiUrl,
GRAPH_URL: process.env.META_GRAPH_URL || config.graphUrl,
BASE_URL: apiUrl + "/modules/whatsapp",
APPS_API_URL: apiUrl + "/modules/apps",
log: process.env.WHATSAPP_LOG
}, () => {
winston.info("Tiledesk WhatsApp Connector proxy server succesfully started.");
})
if (!process.env.GRAPH_URL || !config.graphUrl) {
winston.info("Skip WhatsApp startApp")
} else {
whatsapp.startApp({
MONGODB_URL: config.databaseUri,
API_URL: apiUrl,
GRAPH_URL: process.env.META_GRAPH_URL || config.graphUrl,
BASE_URL: apiUrl + "/modules/whatsapp",
APPS_API_URL: apiUrl + "/modules/apps",
log: process.env.WHATSAPP_LOG
}, () => {
winston.info("Tiledesk WhatsApp Connector proxy server succesfully started.");
})
}

}
}
Expand Down

0 comments on commit 0dffd83

Please sign in to comment.