@tiledesk/tiledesk-tybot-connector 0.1.77 → 0.1.78
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,10 @@
|
|
|
5
5
|
available on:
|
|
6
6
|
▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
|
|
7
7
|
|
|
8
|
+
### 0.1.78
|
|
9
|
+
- web request assign to fix
|
|
10
|
+
- fix filter on messages: groups removed
|
|
11
|
+
|
|
8
12
|
### 0.1.77
|
|
9
13
|
- Refactored DirDeflectToHelpcenter. Added projectId option (to allow search from workspaces in different projects)
|
|
10
14
|
- increased MAX_STEPS for MAX ACTIONS EXEEDED error, from 20 to 200
|
|
@@ -490,11 +490,11 @@ class TiledeskChatbot {
|
|
|
490
490
|
await _tdcache.hset(parameter_key, parameter_name, parameter_value);
|
|
491
491
|
}
|
|
492
492
|
|
|
493
|
-
static async checkStep(_tdcache, requestId, max_steps) {
|
|
494
|
-
|
|
493
|
+
static async checkStep(_tdcache, requestId, max_steps, log) {
|
|
494
|
+
if (log) {console.log("CHECKING ON MAX_STEPS:", max_steps);}
|
|
495
495
|
let go_on = true; // continue
|
|
496
496
|
const parameter_key = TiledeskChatbot.requestCacheKey(requestId) + ":step";
|
|
497
|
-
|
|
497
|
+
if (log) {console.log("__parameter_key:", parameter_key);}
|
|
498
498
|
await _tdcache.incr(parameter_key);
|
|
499
499
|
// console.log("incr-ed");
|
|
500
500
|
let _current_step = await _tdcache.get(parameter_key);
|
|
@@ -505,8 +505,9 @@ class TiledeskChatbot {
|
|
|
505
505
|
// current_step += 1;
|
|
506
506
|
// await _tdcache.set(parameter_key, current_step); // increment step
|
|
507
507
|
// console.log("CURRENT-STEP:", current_step);
|
|
508
|
-
if (current_step > max_steps) {
|
|
509
|
-
|
|
508
|
+
if (current_step > max_steps) {
|
|
509
|
+
if (log) {console.log("max_steps limit just violated");}
|
|
510
|
+
if (log) {console.log("CURRENT-STEP > MAX_STEPS!", current_step);}
|
|
510
511
|
// await TiledeskChatbot.resetStep(_tdcache, requestId);
|
|
511
512
|
// go_on = 1; // stop execution, send error message
|
|
512
513
|
go_on = false
|
|
@@ -161,7 +161,8 @@ class TiledeskChatbotUtil {
|
|
|
161
161
|
const jsonCondition = commands[i].message["_tdJSONCondition"];
|
|
162
162
|
// console.log("jsonCondition:", jsonCondition);
|
|
163
163
|
if (jsonCondition) {
|
|
164
|
-
const expression = TiledeskExpression.JSONGroupsToExpression(jsonCondition.groups);
|
|
164
|
+
// const expression = TiledeskExpression.JSONGroupsToExpression(jsonCondition.groups);
|
|
165
|
+
const expression = TiledeskExpression.JSONGroupToExpression(jsonCondition);
|
|
165
166
|
// console.log("full json condition expression eval on command.message:", expression);
|
|
166
167
|
const conditionResult = new TiledeskExpression().evaluateStaticExpression(expression, variables);
|
|
167
168
|
console.log("conditionResult:", conditionResult);
|
package/package.json
CHANGED
|
@@ -144,14 +144,14 @@ class DirectivesChatbotPlug {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
async nextDirective(directives) {
|
|
147
|
-
|
|
147
|
+
if (this.log) {console.log("....nextDirective() checkStep():");}
|
|
148
148
|
const go_on = await TiledeskChatbot.checkStep(
|
|
149
|
-
this.context.tdcache, this.context.requestId, TiledeskChatbot.MAX_STEPS
|
|
149
|
+
this.context.tdcache, this.context.requestId, TiledeskChatbot.MAX_STEPS, this.log
|
|
150
150
|
);
|
|
151
151
|
// const current_step = await TiledeskChatbot.currentStep(this.context.tdcache, this.context.requestId);
|
|
152
|
-
// console.log("........nextDirective() currentStep:", current_step);
|
|
152
|
+
// if (this.log) {console.log("........nextDirective() currentStep:", current_step);}
|
|
153
153
|
if (go_on == false) {
|
|
154
|
-
|
|
154
|
+
if (this.log) {console.log("go_on == false! nextDirective() Stopped!");}
|
|
155
155
|
return this.errorMessage("Request error: anomaly detection. MAX ACTIONS exeeded.");
|
|
156
156
|
}
|
|
157
157
|
// else if (go_on == 2) {
|