@tiledesk/tiledesk-tybot-connector 0.2.117 → 0.2.119

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,16 @@ available on:
17
17
  - Added flowError on JSONCondition when result = null
18
18
  - Added fix on Filler -->
19
19
 
20
+ # v0.2.120 -> test
21
+ - removed check in go() - it is already in execute() - on SetAttributeV2: if (!action) {...}
22
+
23
+ # v0.2.119 -> test
24
+ - fixed: addParameter("payload", message) => addParameter("payload", message.attributes.payload)
25
+ - JSONCondition: added in constructor => this.chatbot = context.chatbot;
26
+
27
+ # v0.2.118 -> test
28
+ - added payload to attributes: await chatbot.addParameter("payload", message);
29
+
20
30
  # v0.2.117 -> test
21
31
  - block endpoint fixed with APIURL
22
32
 
@@ -714,6 +714,7 @@ class TiledeskChatbotUtil {
714
714
  // console.log("Adding from message.attributes:", key, "->", value);
715
715
  await chatbot.addParameter(key, value);
716
716
  }
717
+ await chatbot.addParameter("payload", message.attributes.payload);
717
718
  }
718
719
  catch(err) {
719
720
  console.error("Error importing message payload in request variables:", err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-tybot-connector",
3
- "version": "0.2.117",
3
+ "version": "0.2.119",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,6 +9,7 @@ class DirJSONCondition {
9
9
  throw new Error('context object is mandatory.');
10
10
  }
11
11
  this.context = context;
12
+ this.chatbot = context.chatbot;
12
13
  // let context = {
13
14
  // projectId: projectId,
14
15
  // token: token,
@@ -137,7 +137,7 @@ class DirReply {
137
137
  if (err) {
138
138
  console.error("Error sending reply:", err);
139
139
  }
140
- if (this.log) {console.log("Reply message sent", cleanMessage);}
140
+ if (this.log) {console.log("Reply message sent:", JSON.stringify(cleanMessage));}
141
141
  const delay = TiledeskChatbotUtil.totalMessageWait(cleanMessage);
142
142
  // console.log("got total delay:", delay)
143
143
  if (delay > 0 && delay <= 30000) { // prevent long delays
@@ -97,11 +97,11 @@ class DirSetAttributeV2 {
97
97
 
98
98
  async go(action, callback) {
99
99
  if (this.log) {console.log("(DirSetAttribute) action before filling:", JSON.stringify(action));}
100
- if (!action) {
101
- if (this.log) {console.log("(SetAttributeV2) Error 'action' is missing");}
102
- callback();
103
- return;
104
- }
100
+ // if (!action) {
101
+ // if (this.log) {console.log("(SetAttributeV2) Error 'action' is missing");}
102
+ // callback();
103
+ // return;
104
+ // }
105
105
  if (action && !action.operation) {
106
106
  if (this.log) {console.log("(SetAttributeV2) Error operation is mandatory");}
107
107
  callback();