@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
package/package.json
CHANGED
|
@@ -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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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.
|
|
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";
|