@tiledesk/tiledesk-tybot-connector 0.2.44 → 0.2.46

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,14 @@
5
5
  available on:
6
6
  ▶️ https://www.npmjs.com/package/@tiledesk/tiledesk-tybot-connector
7
7
 
8
+ # v0.2.46
9
+ - added isNull isUndefined conditions
10
+
11
+ # v0.2.45
12
+ - Fix: JSON.stringify. Removed String(#1) convertion
13
+
8
14
  # v0.2.44
9
- - Fix attributes not showing in button.value
15
+ - Fix: attributes not showing in button.value
10
16
 
11
17
  # v0.2.43
12
18
  - DirCode: tiledeskVars renamed in "context"
@@ -145,6 +145,14 @@ class TiledeskExpression {
145
145
  name: "isEmpty",
146
146
  applyPattern: "#1 === \"\""
147
147
  },
148
+ "isNull": {
149
+ name: "isNull",
150
+ applyPattern: "#1 === null"
151
+ },
152
+ "isUndefined": {
153
+ name: "isUndefined",
154
+ applyPattern: "#1 === undefined"
155
+ },
148
156
  "matches": {
149
157
  name: "matches",
150
158
  applyPattern: "#1.match(String(#2)) ? true : false"
@@ -216,7 +224,7 @@ class TiledeskExpression {
216
224
  },
217
225
  "JSONstringify": {
218
226
  name: "JSONstringify",
219
- applyPattern: "JSON.stringify(String(#1))"
227
+ applyPattern: "JSON.stringify(#1)"
220
228
  }
221
229
  }
222
230
 
@@ -261,9 +269,10 @@ class TiledeskExpression {
261
269
  if(!operands) {
262
270
  return null;
263
271
  }
264
-
272
+ // console.log("operands are:", JSON.stringify(operands))
265
273
  let expression = operands[0].isVariable ? TiledeskExpression.variableOperand(operands[0].value) : TiledeskExpression.quotedString(operands[0].value);
266
274
  expression = operands[0].function ? TiledeskExpression.applyFunctionToOperand(expression, operands[0].function) : expression;
275
+ // console.log("expression is:", expression)
267
276
 
268
277
  if (operands.length === 1) {
269
278
  return expression;
@@ -273,7 +282,12 @@ class TiledeskExpression {
273
282
  const applyPattern = operator.applyPattern;
274
283
  let operand = operands[i + 1].isVariable ? TiledeskExpression.variableOperand(operands[i + 1].value) : TiledeskExpression.quotedString(operands[i + 1].value);
275
284
  operand = operands[i + 1].function ? TiledeskExpression.applyFunctionToOperand(operand, operands[i + 1].function) : operand;
285
+ console.log("1. expression is:", expression)
286
+ console.log("operand is:", operand)
287
+
276
288
  expression = applyPattern.replace("#1", expression).replace("#2", operand);
289
+ console.log("2. expression is:", expression)
290
+
277
291
  }
278
292
  return expression;
279
293
  }
@@ -285,6 +299,8 @@ class TiledeskExpression {
285
299
  const operator = TiledeskExpression.OPERATORS[function_name];
286
300
  const applyPattern = operator.applyPattern;
287
301
  expression += applyPattern.replace("#1", operand);
302
+ // console.log("operand is:", operand);
303
+ // console.log("expression is:", expression);
288
304
  return expression;
289
305
  }
290
306
 
@@ -364,10 +380,9 @@ class TiledeskExpression {
364
380
  }
365
381
 
366
382
  // 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);
383
+ const expression = applyPattern.replace("#1", operand1_s).replace("#2", operand2_s);
384
+ // console.log("operand1_s is:", operand1_s);
385
+ // console.log("operand2_s is:", operand2_s);
371
386
  // console.log("expression is:", expression);
372
387
  return expression;
373
388
  }
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.46",
4
4
  "description": "Tiledesk Tybot connector",
5
5
  "main": "index.js",
6
6
  "scripts": {