@tiledesk/tiledesk-tybot-connector 0.2.71 → 0.2.73

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,12 @@
5
5
  available on:
6
6
  ▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
7
7
 
8
+ # v0.2.73 - debug
9
+ - Fix. static getMachine with check on bot not null
10
+
11
+ # v0.2.72
12
+ - Fix. userParams not in /reserved...
13
+
8
14
  # v0.2.71
9
15
  - Fix. DirReplyV2 "NoInput" bug. Refactored with the introduction of "timeout_id", an ID specific for each noInput timeout: this.chatbot.addParameter(TiledeskChatbotConst.USER_INPUT, timeout_id)
10
16
 
package/index.js CHANGED
@@ -37,6 +37,7 @@ router.post('/ext/:botid', async (req, res) => {
37
37
  console.log("Removed req.body.payload.request.snapshot field");
38
38
  }
39
39
  if (log) {console.log("REQUEST BODY:", JSON.stringify(req.body));}
40
+ console.log("REQUEST BODY:", JSON.stringify(req.body));
40
41
 
41
42
  const botId = req.params.botid;
42
43
  if (log) {console.log(" :", botId);}
@@ -414,7 +415,7 @@ router.get('/ext/reserved/parameters/requests/:requestid', async (req, res) => {
414
415
  // }
415
416
  // }
416
417
  // }
417
- TiledeskChatbotUtil.userFlowAttributes(parameters);
418
+ const userParams = TiledeskChatbotUtil.userFlowAttributes(parameters);
418
419
  res.send(userParams);
419
420
  }
420
421
  });
@@ -5,17 +5,20 @@ class IntentsMachineFactory {
5
5
 
6
6
  static getMachine(bot, botId, projectId, log) {
7
7
  let machine;
8
- if (bot.intentsEngine === "tiledesk-ai") {
8
+ if (bot && bot.intentsEngine === "tiledesk-ai") {
9
9
  console.log("bot.intentsEngine is tiledesk-ai");
10
10
  machine = new TiledeskIntentsMachine(
11
11
  {
12
12
  botId: botId
13
13
  });
14
14
  }
15
- else {
15
+ else if (bot) {
16
16
  if (log) {console.log("Setting MongodbIntentsMachine with bot:", JSON.stringify(bot));}
17
17
  machine = new MongodbIntentsMachine({projectId: projectId, language: bot.language, log});
18
18
  }
19
+ else {
20
+ console.error("bot is null for:", botId, "on projectId:", projectId);
21
+ }
19
22
  return machine;
20
23
  }
21
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-tybot-connector",
3
- "version": "0.2.71",
3
+ "version": "0.2.73",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {