@tiledesk/tiledesk-tybot-connector 0.1.29 → 0.1.30

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
@@ -5,6 +5,9 @@
5
5
  available on:
6
6
  ▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
7
7
 
8
+ ### 0.1.30 - online
9
+ - Fixed wrong bot_answer["_raw_message"]
10
+
8
11
  ### 0.1.29 - online
9
12
  - Added process.exit(1) in tybot-route.startApp when no Redis connection is available to facilitate Cluster start
10
13
  - Debug console.log() removed.
package/index.js CHANGED
@@ -189,6 +189,8 @@ router.post('/ext/:projectId/requests/:requestId/messages', async (req, res) =>
189
189
  if (log) {console.log("request...", request);}
190
190
  let directivesPlug = new DirectivesChatbotPlug({supportRequest: request, TILEDESK_API_ENDPOINT: APIURL, TILEBOT_ENDPOINT:process.env.TYBOT_ENDPOINT, token: token, log: log, HELP_CENTER_API_ENDPOINT: process.env.HELP_CENTER_API_ENDPOINT, cache: tdcache});
191
191
  // PIPELINE-EXT
192
+ if (log) {console.log("answer to process:", JSON.stringify(answer));}
193
+ const original_answer_text = answer.text;
192
194
  const bot_answer = await ExtUtil.execPipelineExt(request, answer, directivesPlug, tdcache, log);
193
195
  // console.log("bot_answer", bot_answer)
194
196
  //const bot_answer = answer;
@@ -215,7 +217,9 @@ router.post('/ext/:projectId/requests/:requestId/messages', async (req, res) =>
215
217
  // triggeredByMessageId: '6392e5e8408e0000437aa383'
216
218
  // }
217
219
  if (bot_answer) {
218
- bot_answer["_raw_message"] = answer.text;
220
+ if (log) {console.log("adding to bot_answer original_answer_text:", JSON.stringify(original_answer_text));}
221
+ bot_answer["_raw_message"] = original_answer_text;
222
+ if (log) {console.log("bot_answer", JSON.stringify(bot_answer));}
219
223
  tdclient.sendSupportMessage(requestId, bot_answer, (err, response) => {
220
224
  if (err) {
221
225
  console.error("Error sending message", err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-tybot-connector",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {