@tiledesk/tiledesk-tybot-connector 0.2.44 → 0.2.45

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,8 +5,11 @@
5
5
  available on:
6
6
  ▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
7
7
 
8
+ # v0.2.45
9
+ - Fix: JSON.stringify. Removed String(#1) convertion
10
+
8
11
  # v0.2.44
9
- - Fix attributes not showing in button.value
12
+ - Fix: attributes not showing in button.value
10
13
 
11
14
  # v0.2.43
12
15
  - DirCode: tiledeskVars renamed in "context"
@@ -216,7 +216,7 @@ class TiledeskExpression {
216
216
  },
217
217
  "JSONstringify": {
218
218
  name: "JSONstringify",
219
- applyPattern: "JSON.stringify(String(#1))"
219
+ applyPattern: "JSON.stringify(#1)"
220
220
  }
221
221
  }
222
222
 
@@ -261,9 +261,10 @@ class TiledeskExpression {
261
261
  if(!operands) {
262
262
  return null;
263
263
  }
264
-
264
+ // console.log("operands are:", JSON.stringify(operands))
265
265
  let expression = operands[0].isVariable ? TiledeskExpression.variableOperand(operands[0].value) : TiledeskExpression.quotedString(operands[0].value);
266
266
  expression = operands[0].function ? TiledeskExpression.applyFunctionToOperand(expression, operands[0].function) : expression;
267
+ // console.log("expression is:", expression)
267
268
 
268
269
  if (operands.length === 1) {
269
270
  return expression;
@@ -273,7 +274,12 @@ class TiledeskExpression {
273
274
  const applyPattern = operator.applyPattern;
274
275
  let operand = operands[i + 1].isVariable ? TiledeskExpression.variableOperand(operands[i + 1].value) : TiledeskExpression.quotedString(operands[i + 1].value);
275
276
  operand = operands[i + 1].function ? TiledeskExpression.applyFunctionToOperand(operand, operands[i + 1].function) : operand;
277
+ console.log("1. expression is:", expression)
278
+ console.log("operand is:", operand)
279
+
276
280
  expression = applyPattern.replace("#1", expression).replace("#2", operand);
281
+ console.log("2. expression is:", expression)
282
+
277
283
  }
278
284
  return expression;
279
285
  }
@@ -285,6 +291,8 @@ class TiledeskExpression {
285
291
  const operator = TiledeskExpression.OPERATORS[function_name];
286
292
  const applyPattern = operator.applyPattern;
287
293
  expression += applyPattern.replace("#1", operand);
294
+ // console.log("operand is:", operand);
295
+ // console.log("expression is:", expression);
288
296
  return expression;
289
297
  }
290
298
 
@@ -364,10 +372,9 @@ class TiledeskExpression {
364
372
  }
365
373
 
366
374
  // console.log("operand1_s, operand2_s:",operand1_s, operand2_s);
367
- const expression =
368
- applyPattern
369
- .replace("#1", operand1_s)
370
- .replace("#2", operand2_s);
375
+ const expression = applyPattern.replace("#1", operand1_s).replace("#2", operand2_s);
376
+ // console.log("operand1_s is:", operand1_s);
377
+ // console.log("operand2_s is:", operand2_s);
371
378
  // console.log("expression is:", expression);
372
379
  return expression;
373
380
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-tybot-connector",
3
- "version": "0.2.44",
3
+ "version": "0.2.45",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {