@tiledesk/tiledesk-tybot-connector 0.2.145 → 0.2.146
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,12 @@ available on:
|
|
|
17
17
|
- Added flowError on JSONCondition when result = null
|
|
18
18
|
- Added fix on Filler -->
|
|
19
19
|
|
|
20
|
+
# v0.2.146
|
|
21
|
+
- bug-fixed: message.attributes["flowAttributes"]
|
|
22
|
+
|
|
23
|
+
# v0.2.146-rc1
|
|
24
|
+
- bug-fixed: message.attributes["flowAttributes"] added only if value size is <= 1kb
|
|
25
|
+
|
|
20
26
|
# v0.2.145
|
|
21
27
|
- added: TILEBOT_ENDPOINT env variable to startApp method
|
|
22
28
|
|
package/package.json
CHANGED
|
@@ -121,11 +121,19 @@ class DirReply {
|
|
|
121
121
|
message.attributes.intentName = this.context.reply.attributes.intent_info.intent_name;
|
|
122
122
|
}
|
|
123
123
|
// userFlowAttributes
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
let userFlowAttributes = TiledeskChatbotUtil.userFlowAttributes(requestAttributes);
|
|
125
|
+
if (this.log) { console.log("userFlowAttributes:", userFlowAttributes); }
|
|
126
|
+
if (userFlowAttributes) {
|
|
127
|
+
message.attributes["flowAttributes"] = {};
|
|
128
|
+
for (const [key, value] of Object.entries(userFlowAttributes)) {
|
|
129
|
+
try {
|
|
130
|
+
if(typeof value === 'string' && value.length <= 1000){
|
|
131
|
+
message.attributes["flowAttributes"][key] = value;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
catch(err) {
|
|
135
|
+
console.error("An error occurred while JSON.parse(). Parsed value:" + value + " in allParametersStatic(). Error:", err);
|
|
136
|
+
}
|
|
129
137
|
}
|
|
130
138
|
}
|
|
131
139
|
}
|
|
@@ -255,11 +255,19 @@ class DirReplyV2 {
|
|
|
255
255
|
message.attributes.intentName = this.context.reply.attributes.intent_info.intent_name;
|
|
256
256
|
}
|
|
257
257
|
// userFlowAttributes
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
258
|
+
let userFlowAttributes = TiledeskChatbotUtil.userFlowAttributes(requestAttributes);
|
|
259
|
+
if (this.log) { console.log("userFlowAttributes:", userFlowAttributes); }
|
|
260
|
+
if (userFlowAttributes) {
|
|
261
|
+
message.attributes["flowAttributes"] = {};
|
|
262
|
+
for (const [key, value] of Object.entries(userFlowAttributes)) {
|
|
263
|
+
try {
|
|
264
|
+
if(typeof value === 'string' && value.length <= 1000){
|
|
265
|
+
message.attributes["flowAttributes"][key] = value;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
catch(err) {
|
|
269
|
+
console.error("An error occurred while JSON.parse(). Parsed value:" + value + " in allParametersStatic(). Error:", err);
|
|
270
|
+
}
|
|
263
271
|
}
|
|
264
272
|
}
|
|
265
273
|
|