@tiledesk/tiledesk-tybot-connector 0.2.116 → 0.2.117

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/CHANGELOG.md CHANGED
@@ -17,6 +17,9 @@ available on:
17
17
  - Added flowError on JSONCondition when result = null
18
18
  - Added fix on Filler -->
19
19
 
20
+ # v0.2.117 -> test
21
+ - block endpoint fixed with APIURL
22
+
20
23
  # v0.2.116 -> test
21
24
  - updates @tiledesk/tiledesk-client => v0.10.12
22
25
 
package/index.js CHANGED
@@ -591,7 +591,7 @@ router.post('/block/:project_id/:bot_id/:block_id', async (req, res) => {
591
591
  }, token: ".."
592
592
  }
593
593
  console.log("sendMessageToBot()...");
594
- sendMessageToBot(request, bot_id, async () => {
594
+ sendMessageToBot(process.env.TYBOT_ENDPOINT, request, bot_id, async () => {
595
595
  console.log("Async webhook message sent:\n", request);
596
596
  res.status(200).send({"success":true});
597
597
  return;
@@ -722,9 +722,12 @@ async function checkRequest(request_id, id_project) {
722
722
  * @param {string} botId. Tiledesk botId
723
723
  * @param {string} token. User token
724
724
  */
725
- function sendMessageToBot(message, botId, callback) {
725
+ function sendMessageToBot(TILEBOT_ENDPOINT, message, botId, callback) {
726
726
  // const jwt_token = this.fixToken(token);
727
- const url = `${process.env.TYBOT_ENDPOINT}/ext/${botId}`;
727
+ if (!TILEBOT_ENDPOINT) {
728
+ TILEBOT_ENDPOINT = `${APIURL}/modules/tilebot`
729
+ }
730
+ const url = `${TILEBOT_ENDPOINT}/ext/${botId}`;
728
731
  console.log("sendMessageToBot URL", url);
729
732
  const HTTPREQUEST = {
730
733
  url: url,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-tybot-connector",
3
- "version": "0.2.116",
3
+ "version": "0.2.117",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -104,8 +104,12 @@ class DirGptTask {
104
104
  TiledeskChatbotConst.REQ_TRANSCRIPT_KEY);
105
105
  if (this.log) { console.log("DirGptTask transcript string: ", transcript_string) }
106
106
 
107
- transcript = await TiledeskChatbotUtil.transcriptJSON(transcript_string);
108
- if (this.log) { console.log("DirGptTask transcript: ", transcript) }
107
+ if (transcript_string) {
108
+ transcript = await TiledeskChatbotUtil.transcriptJSON(transcript_string);
109
+ if (this.log) { console.log("DirGptTask transcript: ", transcript) }
110
+ } else {
111
+ if (this.log) { console.log("DirGptTask transcript_string is undefined. Skip JSON translation for chat history") }
112
+ }
109
113
  }
110
114
 
111
115