@tiledesk/tiledesk-tybot-connector 0.2.139 → 0.2.140

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.140
21
+ - Bug-fix: block hidden message for non-dev conversation
22
+
20
23
  # v0.2.139
21
24
  - Added ReplaceBotV3 action
22
25
  - Updated Redis to 4.7.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-tybot-connector",
3
- "version": "0.2.139",
3
+ "version": "0.2.140",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -26,17 +26,17 @@ class DirMessage {
26
26
  this.token = context.token;
27
27
  this.log = this.context.log;
28
28
  this.supportRequest = this.context.supportRequest
29
- this.hMessage = false
30
29
  }
31
30
 
32
31
  execute(directive, callback) {
33
32
  let action;
34
33
  if (directive.action) {
35
- if (this.log) {console.log("got action:", JSON.stringify(action));}
36
34
  action = directive.action;
35
+ if (this.log) {console.log("got action:", JSON.stringify(action));}
37
36
  if (!action.attributes) {
38
37
  action.attributes = {}
39
38
  }
39
+
40
40
  // action.message.attributes.directives = false;
41
41
  // action.message.attributes.splits = false;
42
42
  // action.message.attributes.markbot = false;
@@ -58,25 +58,26 @@ class DirMessage {
58
58
  // }
59
59
  // console.log("final message action:", JSON.stringify(action));
60
60
  }
61
- else if (directive.parameter) {
62
- let text = directive.parameter.trim();
63
- action = {
64
- text: text,
65
- attributes: {
66
- directives: false,
67
- splits: true,
68
- markbot: true,
69
- fillParams: true
70
- }
71
- }
72
- if (directive.name === Directives.HMESSAGE) {
73
- action.attributes.subtype = "info";
74
- this.hMessage = true;
75
- }
76
- // if (directive.name === Directives.HMESSAGE) {
77
- // action.sender = "tiledesk";
78
- // }
79
- }
61
+ // DEPRECATED
62
+ // else if (directive.parameter) {
63
+ // let text = directive.parameter.trim();
64
+ // action = {
65
+ // text: text,
66
+ // attributes: {
67
+ // directives: false,
68
+ // splits: true,
69
+ // markbot: true,
70
+ // fillParams: true
71
+ // }
72
+ // }
73
+ // if (directive.name === Directives.HMESSAGE) {
74
+ // action.attributes.subtype = "info";
75
+ // this.hMessage = true;
76
+ // }
77
+ // // if (directive.name === Directives.HMESSAGE) {
78
+ // // action.sender = "tiledesk";
79
+ // // }
80
+ // }
80
81
  else {
81
82
  console.error("Incorrect directive:", directive);
82
83
  callback();
@@ -97,7 +98,7 @@ class DirMessage {
97
98
  const message = action;
98
99
  if (this.log) {console.log("Message to extEndpoint:", JSON.stringify(message))};
99
100
 
100
- if(this.hMessage && this.supportRequest && !this.supportRequest.draft){
101
+ if(this.supportRequest && !this.supportRequest.draft){
101
102
  callback();
102
103
  return;
103
104
  }
@@ -2,7 +2,7 @@ class Directives {
2
2
  static AGENT = 'agent';
3
3
  static CLOSE = 'close';
4
4
  static DEPARTMENT = 'department';
5
- static MESSAGE = 'message';
5
+ static MESSAGE = 'message'; // DEPRECATED
6
6
  static HMESSAGE = 'hmessage';
7
7
  static INTENT = 'intent';
8
8
  static REMOVE_CURRENT_BOT = "removecurrentbot";