@webuildbots/webuildbots-sdk 11.6.1 → 11.8.0

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.
Files changed (52) hide show
  1. package/lib/builder/block/basic-bb.js +2 -0
  2. package/lib/builder/block/complex-bb.js +2 -0
  3. package/lib/builder/block/dev-switch-bb.js +2 -0
  4. package/lib/builder/block/email-form-table-bb.js +2 -0
  5. package/lib/builder/block/function-bb.js +2 -0
  6. package/lib/builder/block/gallery-bb.js +2 -0
  7. package/lib/builder/block/image-bb.js +2 -0
  8. package/lib/builder/block/kb-bb.js +2 -0
  9. package/lib/builder/block/logic-bb.js +2 -0
  10. package/lib/builder/block/media-bb.js +2 -0
  11. package/lib/builder/block/select-bb.js +2 -0
  12. package/lib/builder/block/temporary-bb.js +2 -0
  13. package/lib/builder/block/text-bb.js +2 -0
  14. package/lib/builder/block/unset-form-bb.js +2 -0
  15. package/lib/builder/block/video-bb.js +2 -0
  16. package/lib/builder/choice/block-cb.js +3 -3
  17. package/lib/builder/choice/choice-builder.js +1 -1
  18. package/lib/builder/choice/defined-cb.js +2 -0
  19. package/lib/builder/choice/extension-cb.js +25 -11
  20. package/lib/builder/choice/form-cb.js +2 -0
  21. package/lib/builder/choice/location-cb.js +3 -3
  22. package/lib/builder/choice/phone-cb.js +3 -3
  23. package/lib/builder/choice/url-cb.js +3 -3
  24. package/lib/builder/defined-ib.js +2 -0
  25. package/lib/builder/item-builder.js +10 -8
  26. package/lib/const/action-types-enums.js +1 -1
  27. package/lib/const/alexa-enums.js +1 -1
  28. package/lib/const/audit-types.js +1 -1
  29. package/lib/const/block-enums.js +9 -9
  30. package/lib/const/common-blocks-enums.js +1 -1
  31. package/lib/const/jovo-enums.js +1 -1
  32. package/lib/const/languages-enums.js +1 -1
  33. package/lib/const/media-use-case-enums.js +1 -1
  34. package/lib/const/messenger-enums.js +1 -1
  35. package/lib/const/text-overflow-enums.js +1 -1
  36. package/lib/const/twilio-enums.js +1 -1
  37. package/lib/const/user-statuses-enums.js +1 -1
  38. package/lib/helpers/helpers-types.d.ts +1 -1
  39. package/lib/helpers/helpers-types.js +1 -1
  40. package/lib/interfaces/webhook.d.ts +0 -1
  41. package/lib/interfaces/webhook.js +1 -1
  42. package/lib/services/AIService.js +7 -7
  43. package/lib/services/ApiService.js +11 -10
  44. package/lib/services/AuditService.js +3 -3
  45. package/lib/services/EntityService.js +3 -3
  46. package/lib/services/IntentService.js +3 -3
  47. package/lib/services/ResponseService.js +24 -24
  48. package/lib/util/form-data-builder.js +38 -22
  49. package/lib/util/utils.js +5 -5
  50. package/lib/util/webhook-client.d.ts +1 -1
  51. package/lib/util/webhook-client.js +6 -6
  52. package/package.json +8 -7
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -21,13 +23,11 @@ var choice_builder_1 = __importDefault(require("./choice-builder"));
21
23
  var BlockCB = /** @class */ (function (_super) {
22
24
  __extends(BlockCB, _super);
23
25
  function BlockCB(blockId, session, profile, functionArgs) {
24
- var _this = this;
25
26
  var action = {
26
27
  type: action_types_enums_1.ActionTypes.BLOCK,
27
28
  value: blockId
28
29
  };
29
- _this = _super.call(this, action, session, profile, functionArgs) || this;
30
- return _this;
30
+ return _super.call(this, action, session, profile, functionArgs) || this;
31
31
  }
32
32
  BlockCB.prototype.args = function (args) {
33
33
  this.choice.functionArgs = args;
@@ -47,7 +47,7 @@ var ChoiceBuilder = /** @class */ (function () {
47
47
  throw new Error('This block requires a title, you need to call setTitle(..) or addTitle(..) with a truthy value for the title');
48
48
  }
49
49
  // Clone here so we an use the same builder twice
50
- return helpers_types_1.clone(this.choice);
50
+ return (0, helpers_types_1.clone)(this.choice);
51
51
  };
52
52
  return ChoiceBuilder;
53
53
  }());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -14,7 +16,11 @@ var __extends = (this && this.__extends) || (function () {
14
16
  })();
15
17
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
18
  if (k2 === undefined) k2 = k;
17
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
18
24
  }) : (function(o, m, k, k2) {
19
25
  if (k2 === undefined) k2 = k;
20
26
  o[k2] = m[k];
@@ -24,13 +30,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
24
30
  }) : function(o, v) {
25
31
  o["default"] = v;
26
32
  });
27
- var __importStar = (this && this.__importStar) || function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
33
+ var __importStar = (this && this.__importStar) || (function () {
34
+ var ownKeys = function(o) {
35
+ ownKeys = Object.getOwnPropertyNames || function (o) {
36
+ var ar = [];
37
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
38
+ return ar;
39
+ };
40
+ return ownKeys(o);
41
+ };
42
+ return function (mod) {
43
+ if (mod && mod.__esModule) return mod;
44
+ var result = {};
45
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
46
+ __setModuleDefault(result, mod);
47
+ return result;
48
+ };
49
+ })();
34
50
  var __importDefault = (this && this.__importDefault) || function (mod) {
35
51
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
52
  };
@@ -46,7 +62,6 @@ var ExtensionCB = /** @class */ (function (_super) {
46
62
  __extends(ExtensionCB, _super);
47
63
  function ExtensionCB(url, webviewHeightRatio, user, onSuccessBlockId, onCancelBlockId, fallbackUrl, session, profile) {
48
64
  if (onCancelBlockId === void 0) { onCancelBlockId = common_blocks_enums_1.CommonBlocks.MENU; }
49
- var _this = this;
50
65
  var expireTokens = function () {
51
66
  var tokens = user.session.apiTokens || [];
52
67
  user.session.apiTokens = tokens.filter(function (t) {
@@ -75,8 +90,7 @@ var ExtensionCB = /** @class */ (function (_super) {
75
90
  type: action_types_enums_1.ActionTypes.EXTENSION,
76
91
  value: { url: parsedUrl.toString(), webviewHeightRatio: webviewHeightRatio, fallbackUrl: fallbackUrl }
77
92
  };
78
- _this = _super.call(this, action, session, profile) || this;
79
- return _this;
93
+ return _super.call(this, action, session, profile) || this;
80
94
  }
81
95
  return ExtensionCB;
82
96
  }(choice_builder_1.default));
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -21,12 +23,10 @@ var choice_builder_1 = __importDefault(require("./choice-builder"));
21
23
  var LocationCB = /** @class */ (function (_super) {
22
24
  __extends(LocationCB, _super);
23
25
  function LocationCB(session, profile) {
24
- var _this = this;
25
26
  var action = {
26
27
  type: action_types_enums_1.ActionTypes.LOCATION
27
28
  };
28
- _this = _super.call(this, action, session, profile) || this;
29
- return _this;
29
+ return _super.call(this, action, session, profile) || this;
30
30
  }
31
31
  return LocationCB;
32
32
  }(choice_builder_1.default));
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -21,13 +23,11 @@ var choice_builder_1 = __importDefault(require("./choice-builder"));
21
23
  var PhoneCB = /** @class */ (function (_super) {
22
24
  __extends(PhoneCB, _super);
23
25
  function PhoneCB(phoneNumber, session, profile) {
24
- var _this = this;
25
26
  var action = {
26
27
  type: action_types_enums_1.ActionTypes.PHONE,
27
28
  value: phoneNumber
28
29
  };
29
- _this = _super.call(this, action, session, profile) || this;
30
- return _this;
30
+ return _super.call(this, action, session, profile) || this;
31
31
  }
32
32
  return PhoneCB;
33
33
  }(choice_builder_1.default));
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -21,13 +23,11 @@ var choice_builder_1 = __importDefault(require("./choice-builder"));
21
23
  var UrlCB = /** @class */ (function (_super) {
22
24
  __extends(UrlCB, _super);
23
25
  function UrlCB(session, profile) {
24
- var _this = this;
25
26
  var action = {
26
27
  type: action_types_enums_1.ActionTypes.URL,
27
28
  value: {}
28
29
  };
29
- _this = _super.call(this, action, session, profile) || this;
30
- return _this;
30
+ return _super.call(this, action, session, profile) || this;
31
31
  }
32
32
  UrlCB.prototype.addUrl = function (lang, url) {
33
33
  this.choice.action.value[lang] = url;
@@ -7,6 +7,8 @@ var __extends = (this && this.__extends) || (function () {
7
7
  return extendStatics(d, b);
8
8
  };
9
9
  return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10
12
  extendStatics(d, b);
11
13
  function __() { this.constructor = d; }
12
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
- var __spreadArrays = (this && this.__spreadArrays) || function () {
3
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
4
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
5
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
6
- r[k] = a[j];
7
- return r;
2
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
+ if (ar || !(i in from)) {
5
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
+ ar[i] = from[i];
7
+ }
8
+ }
9
+ return to.concat(ar || Array.prototype.slice.call(from));
8
10
  };
9
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
10
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -65,12 +67,12 @@ var ItemBuilder = /** @class */ (function () {
65
67
  };
66
68
  ItemBuilder.prototype.hasChoice = function (cb) {
67
69
  var myChoice = cb.build();
68
- var choices = __spreadArrays(this.item.choices);
70
+ var choices = __spreadArray([], this.item.choices, true);
69
71
  var defaultChoice = this.item.defaultChoice;
70
72
  if (defaultChoice) {
71
73
  choices.push(defaultChoice);
72
74
  }
73
- return choices.some(function (choice) { return deep_equal_1.default(choice, myChoice); });
75
+ return choices.some(function (choice) { return (0, deep_equal_1.default)(choice, myChoice); });
74
76
  };
75
77
  return ItemBuilder;
76
78
  }());
@@ -8,4 +8,4 @@ var ActionTypes;
8
8
  ActionTypes["LOCATION"] = "location";
9
9
  ActionTypes["BLOCK"] = "block";
10
10
  ActionTypes["EXTENSION"] = "extension";
11
- })(ActionTypes = exports.ActionTypes || (exports.ActionTypes = {}));
11
+ })(ActionTypes || (exports.ActionTypes = ActionTypes = {}));
@@ -5,4 +5,4 @@ var AlexaUserInfo;
5
5
  (function (AlexaUserInfo) {
6
6
  AlexaUserInfo["FULL_DEVICE_ADDRESS"] = "full-device-address";
7
7
  AlexaUserInfo["MOBILE_NUMBER"] = "mobile-number";
8
- })(AlexaUserInfo = exports.AlexaUserInfo || (exports.AlexaUserInfo = {}));
8
+ })(AlexaUserInfo || (exports.AlexaUserInfo = AlexaUserInfo = {}));
@@ -27,4 +27,4 @@ var AuditTypes;
27
27
  AuditTypes["DELETE_ENTITY_MAPPING"] = "DELETE_ENTITY_MAPPING";
28
28
  AuditTypes["CREATE_INTENT_MAPPING"] = "CREATE_INTENT_MAPPING";
29
29
  AuditTypes["DELETE_INTENT_MAPPING"] = "DELETE_INTENT_MAPPING";
30
- })(AuditTypes = exports.AuditTypes || (exports.AuditTypes = {}));
30
+ })(AuditTypes || (exports.AuditTypes = AuditTypes = {}));
@@ -6,7 +6,7 @@ var CommonGroups;
6
6
  CommonGroups["DEFAULT"] = "default";
7
7
  CommonGroups["BUILT_AT_RUNTIME"] = "built-at-runtime";
8
8
  CommonGroups["FALLBACK_KNOWLS_BUILT_AT_RUNTIME"] = "fallback-knowls-built-at-run-time";
9
- })(CommonGroups = exports.CommonGroups || (exports.CommonGroups = {}));
9
+ })(CommonGroups || (exports.CommonGroups = CommonGroups = {}));
10
10
  var BlockTypes;
11
11
  (function (BlockTypes) {
12
12
  BlockTypes["TEXT"] = "text";
@@ -22,41 +22,41 @@ var BlockTypes;
22
22
  BlockTypes["MEDIA"] = "media";
23
23
  BlockTypes["KNOWLEDGE_BASE"] = "kb";
24
24
  BlockTypes["TEMPORARY"] = "temporary";
25
- })(BlockTypes = exports.BlockTypes || (exports.BlockTypes = {}));
25
+ })(BlockTypes || (exports.BlockTypes = BlockTypes = {}));
26
26
  var ChoiceTypes;
27
27
  (function (ChoiceTypes) {
28
28
  ChoiceTypes["QREPLY"] = "qreply";
29
29
  ChoiceTypes["QUESTION"] = "question";
30
- })(ChoiceTypes = exports.ChoiceTypes || (exports.ChoiceTypes = {}));
30
+ })(ChoiceTypes || (exports.ChoiceTypes = ChoiceTypes = {}));
31
31
  var ComplexBlockTypes;
32
32
  (function (ComplexBlockTypes) {
33
33
  ComplexBlockTypes["LIST"] = "list";
34
34
  ComplexBlockTypes["GENERIC"] = "generic";
35
- })(ComplexBlockTypes = exports.ComplexBlockTypes || (exports.ComplexBlockTypes = {}));
35
+ })(ComplexBlockTypes || (exports.ComplexBlockTypes = ComplexBlockTypes = {}));
36
36
  var TopElementStyles;
37
37
  (function (TopElementStyles) {
38
38
  TopElementStyles["LARGE"] = "large";
39
39
  TopElementStyles["COMPACT"] = "compact";
40
- })(TopElementStyles = exports.TopElementStyles || (exports.TopElementStyles = {}));
40
+ })(TopElementStyles || (exports.TopElementStyles = TopElementStyles = {}));
41
41
  var MessengerWebviewHeightRatios;
42
42
  (function (MessengerWebviewHeightRatios) {
43
43
  MessengerWebviewHeightRatios["COMPACT"] = "compact";
44
44
  MessengerWebviewHeightRatios["TALL"] = "tall";
45
45
  MessengerWebviewHeightRatios["FULL"] = "full";
46
- })(MessengerWebviewHeightRatios = exports.MessengerWebviewHeightRatios || (exports.MessengerWebviewHeightRatios = {}));
46
+ })(MessengerWebviewHeightRatios || (exports.MessengerWebviewHeightRatios = MessengerWebviewHeightRatios = {}));
47
47
  var ImageAspectRatios;
48
48
  (function (ImageAspectRatios) {
49
49
  ImageAspectRatios["HORIZONTAL"] = "horizontal";
50
50
  ImageAspectRatios["SQUARE"] = "square";
51
- })(ImageAspectRatios = exports.ImageAspectRatios || (exports.ImageAspectRatios = {}));
51
+ })(ImageAspectRatios || (exports.ImageAspectRatios = ImageAspectRatios = {}));
52
52
  var VoiceAction;
53
53
  (function (VoiceAction) {
54
54
  VoiceAction["ASK"] = "ask";
55
55
  VoiceAction["TELL"] = "tell";
56
- })(VoiceAction = exports.VoiceAction || (exports.VoiceAction = {}));
56
+ })(VoiceAction || (exports.VoiceAction = VoiceAction = {}));
57
57
  var FunctionTypes;
58
58
  (function (FunctionTypes) {
59
59
  FunctionTypes["EMAIL_FORM_AS_TABLE"] = "email-form-as-table";
60
60
  FunctionTypes["UNSET_FORM"] = "unset-form";
61
61
  FunctionTypes["LOGIC_BLOCK"] = "logic-block";
62
- })(FunctionTypes = exports.FunctionTypes || (exports.FunctionTypes = {}));
62
+ })(FunctionTypes || (exports.FunctionTypes = FunctionTypes = {}));
@@ -46,4 +46,4 @@ var CommonBlocks;
46
46
  CommonBlocks["ASK_PHONE_NUMBER"] = "ask-phone-number";
47
47
  CommonBlocks["FORM_VALIDATION_FAILED"] = "form-validation-failed";
48
48
  CommonBlocks["FORM_FIELD_FAILURE_LIMIT_EXCEEDED"] = "form-field-failure-limit-exceeded";
49
- })(CommonBlocks = exports.CommonBlocks || (exports.CommonBlocks = {}));
49
+ })(CommonBlocks || (exports.CommonBlocks = CommonBlocks = {}));
@@ -4,4 +4,4 @@ exports.JovoStates = void 0;
4
4
  var JovoStates;
5
5
  (function (JovoStates) {
6
6
  JovoStates["YES_NO_STATE"] = "YesNoState";
7
- })(JovoStates = exports.JovoStates || (exports.JovoStates = {}));
7
+ })(JovoStates || (exports.JovoStates = JovoStates = {}));
@@ -138,4 +138,4 @@ var Languages;
138
138
  Languages["YIDDISH"] = "yi";
139
139
  Languages["YORUBA"] = "yo";
140
140
  Languages["ZULU"] = "zu";
141
- })(Languages = exports.Languages || (exports.Languages = {}));
141
+ })(Languages || (exports.Languages = Languages = {}));
@@ -10,4 +10,4 @@ var MediaUseCase;
10
10
  MediaUseCase["AGENT_AVATAR"] = "agent-avatar";
11
11
  MediaUseCase["CLIENT_MEDIA"] = "client-media";
12
12
  MediaUseCase["SELFIE"] = "selfie";
13
- })(MediaUseCase = exports.MediaUseCase || (exports.MediaUseCase = {}));
13
+ })(MediaUseCase || (exports.MediaUseCase = MediaUseCase = {}));
@@ -4,4 +4,4 @@ exports.MessengerMessageTags = void 0;
4
4
  var MessengerMessageTags;
5
5
  (function (MessengerMessageTags) {
6
6
  MessengerMessageTags["ACCOUNT_UPDATE"] = "ACCOUNT_UPDATE";
7
- })(MessengerMessageTags = exports.MessengerMessageTags || (exports.MessengerMessageTags = {}));
7
+ })(MessengerMessageTags || (exports.MessengerMessageTags = MessengerMessageTags = {}));
@@ -5,4 +5,4 @@ var TextOverflow;
5
5
  (function (TextOverflow) {
6
6
  TextOverflow["SPLIT"] = "split";
7
7
  TextOverflow["TRUNCATE"] = "truncate";
8
- })(TextOverflow = exports.TextOverflow || (exports.TextOverflow = {}));
8
+ })(TextOverflow || (exports.TextOverflow = TextOverflow = {}));
@@ -7,4 +7,4 @@ var TwilioVerb;
7
7
  TwilioVerb["RECORD"] = "record";
8
8
  TwilioVerb["HANG_UP"] = "hang-up";
9
9
  TwilioVerb["PAUSE"] = "pause";
10
- })(TwilioVerb = exports.TwilioVerb || (exports.TwilioVerb = {}));
10
+ })(TwilioVerb || (exports.TwilioVerb = TwilioVerb = {}));
@@ -5,4 +5,4 @@ var UserStatuses;
5
5
  (function (UserStatuses) {
6
6
  UserStatuses["ACTIVE"] = "active";
7
7
  UserStatuses["INTERVENTION"] = "intervention";
8
- })(UserStatuses = exports.UserStatuses || (exports.UserStatuses = {}));
8
+ })(UserStatuses || (exports.UserStatuses = UserStatuses = {}));
@@ -1,4 +1,4 @@
1
- export declare type DeepPartial<T> = {
1
+ export type DeepPartial<T> = {
2
2
  [P in keyof T]?: T[P] extends Array<infer U> ? Array<DeepPartial<U>> : T[P] extends ReadonlyArray<infer V> ? ReadonlyArray<DeepPartial<V>> : DeepPartial<T[P]>;
3
3
  };
4
4
  export declare const clone: (obj: any) => any;
@@ -11,6 +11,6 @@ var dateReviver = function (key, value) {
11
11
  return value;
12
12
  };
13
13
  var clone = function (obj) {
14
- return flatted_1.parse(flatted_1.stringify(obj), dateReviver);
14
+ return (0, flatted_1.parse)((0, flatted_1.stringify)(obj), dateReviver);
15
15
  };
16
16
  exports.clone = clone;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import Block from './block';
3
2
  import User from './user';
4
3
  import WBBEvent from './wbb-event';
@@ -5,4 +5,4 @@ var ResponseUnitType;
5
5
  (function (ResponseUnitType) {
6
6
  ResponseUnitType["BLOCK"] = "block";
7
7
  ResponseUnitType["BLOCK_POINTER"] = "block-pointer";
8
- })(ResponseUnitType = exports.ResponseUnitType || (exports.ResponseUnitType = {}));
8
+ })(ResponseUnitType || (exports.ResponseUnitType = ResponseUnitType = {}));
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -71,11 +71,11 @@ var AIService = /** @class */ (function () {
71
71
  });
72
72
  });
73
73
  };
74
- AIService.prototype.generateUtterances = function (utterances, numAlternatives, modelName) {
75
- if (numAlternatives === void 0) { numAlternatives = 10; }
76
- if (modelName === void 0) { modelName = this.GPT3_MODEL_NAME; }
77
- return __awaiter(this, void 0, void 0, function () {
74
+ AIService.prototype.generateUtterances = function (utterances_1) {
75
+ return __awaiter(this, arguments, void 0, function (utterances, numAlternatives, modelName) {
78
76
  var emptyArray, res, options, e_2;
77
+ if (numAlternatives === void 0) { numAlternatives = 10; }
78
+ if (modelName === void 0) { modelName = this.GPT3_MODEL_NAME; }
79
79
  return __generator(this, function (_a) {
80
80
  switch (_a.label) {
81
81
  case 0:
@@ -20,12 +20,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -53,25 +53,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
53
53
  var axios_1 = __importDefault(require("axios"));
54
54
  var ApiService = /** @class */ (function () {
55
55
  function ApiService(sdkToken, rootURL) {
56
- if (rootURL === void 0) { rootURL = 'https://backend.logicdialog.ai'; }
56
+ if (rootURL === void 0) { rootURL = 'https://backend-portal.logicdialog.ai'; }
57
57
  this.sdkToken = sdkToken;
58
58
  this.sdkToken = sdkToken;
59
59
  this.baseURL = rootURL;
60
60
  }
61
61
  ApiService.prototype.hitApi = function (endpoint, client, options) {
62
- var _a, _b;
63
62
  return __awaiter(this, void 0, void 0, function () {
64
63
  var headers, response, data, error_1, errorMessage;
65
- var _c;
64
+ var _a;
65
+ var _b, _c;
66
66
  return __generator(this, function (_d) {
67
67
  switch (_d.label) {
68
68
  case 0:
69
69
  _d.trys.push([0, 2, , 3]);
70
- headers = __assign((_c = { Authorization: 'Bearer ' + this.sdkToken, Accept: 'application/json', 'wbb-client': client, 'Access-Control-Allow-Origin': '*', origin: new URL(this.baseURL).origin }, _c['Content-Type'] = 'text/plain', _c), options.headers);
71
- return [4 /*yield*/, axios_1.default(__assign(__assign({}, options), { url: this.baseURL + "/" + endpoint, headers: headers }))];
70
+ headers = __assign((_a = { Authorization: 'Bearer ' + this.sdkToken, Accept: 'application/json', 'wbb-client': client, 'Access-Control-Allow-Origin': '*', origin: new URL(this.baseURL).origin }, _a['Content-Type'] = 'text/plain', _a), options.headers);
71
+ return [4 /*yield*/, (0, axios_1.default)(__assign(__assign({}, options), { url: "".concat(this.baseURL, "/").concat(endpoint), headers: headers }))];
72
72
  case 1:
73
73
  response = _d.sent();
74
- data = ((_a = response.data) === null || _a === void 0 ? void 0 : _a.data) || response.data;
74
+ data = ((_b = response.data) === null || _b === void 0 ? void 0 : _b.data) || response.data;
75
75
  return [2 /*return*/, {
76
76
  status: { httpCode: response.status, statusText: response.statusText },
77
77
  data: data,
@@ -80,7 +80,8 @@ var ApiService = /** @class */ (function () {
80
80
  case 2:
81
81
  error_1 = _d.sent();
82
82
  errorMessage = error_1.response
83
- ? (_b = error_1.response.data) === null || _b === void 0 ? void 0 : _b.error : error_1.message;
83
+ ? (_c = error_1.response.data) === null || _c === void 0 ? void 0 : _c.error
84
+ : error_1.message;
84
85
  return [2 /*return*/, {
85
86
  status: {
86
87
  httpCode: error_1.response.status,
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -20,12 +20,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -86,9 +86,9 @@ var ResponseService = /** @class */ (function () {
86
86
  return block;
87
87
  };
88
88
  ResponseService.prototype.createResponse = function (content, module, description, type, name, group, formFieldCallbackArgs, next, functionObj) {
89
- var _a;
90
89
  return __awaiter(this, void 0, void 0, function () {
91
- var block, builder, formatedBody, blockValues, payload, _b, res, options, e_1;
90
+ var block, builder, formatedBody, blockValues, payload, _a, res, options, e_1;
91
+ var _b;
92
92
  return __generator(this, function (_c) {
93
93
  switch (_c.label) {
94
94
  case 0:
@@ -107,27 +107,27 @@ var ResponseService = /** @class */ (function () {
107
107
  group: group,
108
108
  next: next
109
109
  };
110
- builder = form_data_builder_1.FormDataBuilder();
110
+ builder = (0, form_data_builder_1.FormDataBuilder)();
111
111
  formatedBody = __assign(__assign({}, block), { content: block.content ? block.content : {}, name: block.name ? block.name : __1.BlockBuilder.DEFAULT_NAME, group: block.group ? block.group : __1.BlockBuilder.DEFAULT_GROUP });
112
112
  blockValues = block.function
113
113
  ? this.formatBlockValues(formatedBody)
114
114
  : formatedBody;
115
- if (!((_a = block.content) === null || _a === void 0 ? void 0 : _a.items)) return [3 /*break*/, 2];
115
+ if (!((_b = block.content) === null || _b === void 0 ? void 0 : _b.items)) return [3 /*break*/, 2];
116
116
  return [4 /*yield*/, builder.buildItems(blockValues)];
117
117
  case 1:
118
- _b = _c.sent();
118
+ _a = _c.sent();
119
119
  return [3 /*break*/, 4];
120
120
  case 2: return [4 /*yield*/, builder.buildBlock(blockValues)];
121
121
  case 3:
122
- _b = _c.sent();
122
+ _a = _c.sent();
123
123
  _c.label = 4;
124
124
  case 4:
125
- payload = _b;
125
+ payload = _a;
126
126
  options = {
127
127
  method: 'POST',
128
128
  data: payload,
129
129
  headers: {
130
- 'content-type': "multipart/form-data; boundary=" + payload.getBoundary()
130
+ 'content-type': "multipart/form-data; boundary=".concat(payload.getBoundary())
131
131
  }
132
132
  };
133
133
  _c.label = 5;
@@ -146,36 +146,36 @@ var ResponseService = /** @class */ (function () {
146
146
  });
147
147
  };
148
148
  ResponseService.prototype.updateResponse = function (blockId, body) {
149
- var _a;
150
149
  return __awaiter(this, void 0, void 0, function () {
151
- var oldResponse, builder, content, formatedBody, blockValues, payload, _b, res, options, e_2;
150
+ var oldResponse, builder, content, formatedBody, blockValues, payload, _a, res, options, e_2;
151
+ var _b;
152
152
  return __generator(this, function (_c) {
153
153
  switch (_c.label) {
154
154
  case 0: return [4 /*yield*/, this.getResponse(blockId)];
155
155
  case 1:
156
156
  oldResponse = _c.sent();
157
- builder = form_data_builder_1.FormDataBuilder();
157
+ builder = (0, form_data_builder_1.FormDataBuilder)();
158
158
  content = body.content ? body.content : {};
159
159
  formatedBody = __assign(__assign({}, body), { _id: blockId, created: body.created || oldResponse[0].created, version: body.version || oldResponse[0].version, type: body.type || oldResponse[0].type, content: content });
160
160
  blockValues = body.function
161
161
  ? this.formatBlockValues(formatedBody)
162
162
  : formatedBody;
163
- if (!((_a = body.content) === null || _a === void 0 ? void 0 : _a.items)) return [3 /*break*/, 3];
163
+ if (!((_b = body.content) === null || _b === void 0 ? void 0 : _b.items)) return [3 /*break*/, 3];
164
164
  return [4 /*yield*/, builder.buildItems(blockValues)];
165
165
  case 2:
166
- _b = _c.sent();
166
+ _a = _c.sent();
167
167
  return [3 /*break*/, 5];
168
168
  case 3: return [4 /*yield*/, builder.buildBlock(blockValues)];
169
169
  case 4:
170
- _b = _c.sent();
170
+ _a = _c.sent();
171
171
  _c.label = 5;
172
172
  case 5:
173
- payload = _b;
173
+ payload = _a;
174
174
  options = {
175
175
  method: 'PUT',
176
176
  data: payload,
177
177
  headers: {
178
- 'content-type': "multipart/form-data; boundary=" + payload.getBoundary()
178
+ 'content-type': "multipart/form-data; boundary=".concat(payload.getBoundary())
179
179
  }
180
180
  };
181
181
  _c.label = 6;
@@ -217,12 +217,12 @@ var ResponseService = /** @class */ (function () {
217
217
  });
218
218
  });
219
219
  };
220
- ResponseService.prototype.getResponses = function (searchText, types, groups) {
221
- if (searchText === void 0) { searchText = ''; }
222
- if (types === void 0) { types = []; }
223
- if (groups === void 0) { groups = []; }
224
- return __awaiter(this, void 0, void 0, function () {
220
+ ResponseService.prototype.getResponses = function () {
221
+ return __awaiter(this, arguments, void 0, function (searchText, types, groups) {
225
222
  var res, options, e_4;
223
+ if (searchText === void 0) { searchText = ''; }
224
+ if (types === void 0) { types = []; }
225
+ if (groups === void 0) { groups = []; }
226
226
  return __generator(this, function (_a) {
227
227
  switch (_a.label) {
228
228
  case 0:
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -35,6 +35,15 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
36
  }
37
37
  };
38
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
39
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
40
+ if (ar || !(i in from)) {
41
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
42
+ ar[i] = from[i];
43
+ }
44
+ }
45
+ return to.concat(ar || Array.prototype.slice.call(from));
46
+ };
38
47
  var __importDefault = (this && this.__importDefault) || function (mod) {
39
48
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
49
  };
@@ -81,9 +90,13 @@ var FormDataBuilder = function () {
81
90
  }
82
91
  });
83
92
  }); };
84
- var buildSingleImageForm = function (obj, shouldUpdateAvatar) {
85
- if (shouldUpdateAvatar === void 0) { shouldUpdateAvatar = true; }
86
- return __awaiter(void 0, void 0, void 0, function () {
93
+ var buildSingleImageForm = function (obj_1) {
94
+ var args_1 = [];
95
+ for (var _i = 1; _i < arguments.length; _i++) {
96
+ args_1[_i - 1] = arguments[_i];
97
+ }
98
+ return __awaiter(void 0, __spreadArray([obj_1], args_1, true), void 0, function (obj, shouldUpdateAvatar) {
99
+ if (shouldUpdateAvatar === void 0) { shouldUpdateAvatar = true; }
87
100
  return __generator(this, function (_a) {
88
101
  switch (_a.label) {
89
102
  case 0:
@@ -94,7 +107,7 @@ var FormDataBuilder = function () {
94
107
  _a.label = 2;
95
108
  case 2:
96
109
  delete obj.imageBlob;
97
- formData.append('body', json_stringify_safe_1.default(obj));
110
+ formData.append('body', (0, json_stringify_safe_1.default)(obj));
98
111
  return [2 /*return*/, formData];
99
112
  }
100
113
  });
@@ -125,7 +138,7 @@ var FormDataBuilder = function () {
125
138
  delete settings.company.logoImageBlob;
126
139
  _a.label = 6;
127
140
  case 6:
128
- formData.append('body', json_stringify_safe_1.default(settings));
141
+ formData.append('body', (0, json_stringify_safe_1.default)(settings));
129
142
  return [2 /*return*/, formData];
130
143
  }
131
144
  });
@@ -139,36 +152,39 @@ var FormDataBuilder = function () {
139
152
  return [4 /*yield*/, appendBlob('mediaFile', content)];
140
153
  case 1:
141
154
  _a.sent();
142
- formData.append('body', json_stringify_safe_1.default(blk));
155
+ formData.append('body', (0, json_stringify_safe_1.default)(blk));
143
156
  return [2 /*return*/, formData];
144
157
  }
145
158
  });
146
159
  }); };
147
160
  var buildItems = function (blk) { return __awaiter(void 0, void 0, void 0, function () {
148
- var content, _a, _b, _i, i, item;
149
- return __generator(this, function (_c) {
150
- switch (_c.label) {
161
+ var content, _a, _b, _c, _i, i, item;
162
+ return __generator(this, function (_d) {
163
+ switch (_d.label) {
151
164
  case 0:
152
165
  content = blk.content;
153
- _a = [];
154
- for (_b in content.items)
155
- _a.push(_b);
166
+ _a = content.items;
167
+ _b = [];
168
+ for (_c in _a)
169
+ _b.push(_c);
156
170
  _i = 0;
157
- _c.label = 1;
171
+ _d.label = 1;
158
172
  case 1:
159
- if (!(_i < _a.length)) return [3 /*break*/, 4];
160
- i = _a[_i];
173
+ if (!(_i < _b.length)) return [3 /*break*/, 4];
174
+ _c = _b[_i];
175
+ if (!(_c in _a)) return [3 /*break*/, 3];
176
+ i = _c;
161
177
  if (!content.items.hasOwnProperty(i)) return [3 /*break*/, 3];
162
178
  item = content.items[i];
163
- return [4 /*yield*/, appendBlob("uploadItemMedia" + i, item)];
179
+ return [4 /*yield*/, appendBlob("uploadItemMedia".concat(i), item)];
164
180
  case 2:
165
- _c.sent();
166
- _c.label = 3;
181
+ _d.sent();
182
+ _d.label = 3;
167
183
  case 3:
168
184
  _i++;
169
185
  return [3 /*break*/, 1];
170
186
  case 4:
171
- formData.append('body', json_stringify_safe_1.default(blk));
187
+ formData.append('body', (0, json_stringify_safe_1.default)(blk));
172
188
  return [2 /*return*/, formData];
173
189
  }
174
190
  });
package/lib/util/utils.js CHANGED
@@ -8,10 +8,10 @@ var Utils = /** @class */ (function () {
8
8
  Utils.parseDate = function (formValue, languageCode, checkInputDate) {
9
9
  sugar_1.Date.setLocale('en-GB');
10
10
  var formats = [
11
- '{weekday}? {dd}th of {month} {yy|yyyy}?',
12
- '{weekday}? {dd}rd of {month} {yy|yyyy}?',
13
- '{weekday}? {dd}st of {month} {yy|yyyy}?',
14
- '{weekday}? {dd}nd of {month} {yy|yyyy}?',
11
+ '{weekday}? {dd}th of {month} {yy|yyyy}?', // 15th of september 2005
12
+ '{weekday}? {dd}rd of {month} {yy|yyyy}?', // 23rd of september 2024
13
+ '{weekday}? {dd}st of {month} {yy|yyyy}?', // 23rd of september 2024
14
+ '{weekday}? {dd}nd of {month} {yy|yyyy}?', // 23rd of september 2024
15
15
  '{weekday}? {dd}th {month} {yy|yyyy}?',
16
16
  '{weekday}? {dd}rd {month} {yy|yyyy}?',
17
17
  '{weekday}? {dd}st {month} {yy|yyyy}?',
@@ -20,7 +20,7 @@ var Utils = /** @class */ (function () {
20
20
  '{weekday}? {month} {dd}rd {yy|yyyy}?',
21
21
  '{weekday}? {month} {dd}st {yy|yyyy}?',
22
22
  '{weekday}? {month} {dd}nd {yy|yyyy}?',
23
- '{dd} {MM} {yy}',
23
+ '{dd} {MM} {yy|yyyy}',
24
24
  "{dd}st of the {MM}st {yy|yyyy}?",
25
25
  "{dd}nd of the {MM}st {yy|yyyy}?",
26
26
  "{dd}rd of the {MM}st {yy|yyyy}?",
@@ -4,7 +4,7 @@ interface WebhookResponse {
4
4
  status: number;
5
5
  body: WebhookResponseBody | string;
6
6
  }
7
- export declare type WebhookHandler = (webhookReq: WebhookRequest, respBuilder: ResponseBuilder) => Promise<void>;
7
+ export type WebhookHandler = (webhookReq: WebhookRequest, respBuilder: ResponseBuilder) => Promise<void>;
8
8
  export declare class WebhookClient {
9
9
  private secret?;
10
10
  private handlerMap;
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -53,7 +53,7 @@ var WebhookClient = /** @class */ (function () {
53
53
  }
54
54
  WebhookClient.prototype.addHandler = function (handlerName, handler) {
55
55
  if (this.handlerMap[handlerName]) {
56
- throw Error("\"" + handlerName + "\" has already been added");
56
+ throw Error("\"".concat(handlerName, "\" has already been added"));
57
57
  }
58
58
  this.handlerMap[handlerName] = handler;
59
59
  return this;
@@ -83,7 +83,7 @@ var WebhookClient = /** @class */ (function () {
83
83
  if (!handler) {
84
84
  return [2 /*return*/, {
85
85
  status: http_status_codes_1.StatusCodes.NOT_FOUND,
86
- body: "No handler for " + handlerName
86
+ body: "No handler for ".concat(handlerName)
87
87
  }];
88
88
  }
89
89
  _a.label = 1;
@@ -115,7 +115,7 @@ var WebhookClient = /** @class */ (function () {
115
115
  }
116
116
  var bodyMd5Hash = jsonwebtoken_1.default.verify(token, this.secret).bodyMd5Hash;
117
117
  // Make sure the requestId's match
118
- if (bodyMd5Hash !== md5_1.default(body)) {
118
+ if (bodyMd5Hash !== (0, md5_1.default)(body)) {
119
119
  throw Error('bodyMd5Hash does not match');
120
120
  }
121
121
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webuildbots/webuildbots-sdk",
3
- "version": "11.6.1",
3
+ "version": "11.8.0",
4
4
  "description": "webuildbots sdk",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -45,21 +45,22 @@
45
45
  "eslint-config-prettier": "^6.12.0",
46
46
  "eslint-plugin-prettier": "^3.1.4",
47
47
  "husky": "^4.3.0",
48
- "jest": "^26.5.2",
49
- "jest-extended": "^0.11.5",
48
+ "jest": "^30.2.0",
49
+ "jest-extended": "^7.0.0",
50
50
  "prettier": "^2.1.2",
51
- "ts-jest": "^26.4.1",
52
- "typescript": "^4.0.3"
51
+ "ts-jest": "^29.4.6",
52
+ "typescript": "^5.9.3"
53
53
  },
54
54
  "dependencies": {
55
55
  "@types/json-logic-js": "^1.2.1",
56
- "axios": "0.25.0",
56
+ "axios": "1.13.2",
57
57
  "bson-objectid": "^1.3.1",
58
58
  "deep-equal": "^2.0.4",
59
59
  "flatted": "^3.1.0",
60
60
  "form-data": "^3.0.1",
61
61
  "http-status-codes": "^2.1.4",
62
- "jsonwebtoken": "^8.5.1",
62
+ "json-stringify-safe": "^5.0.1",
63
+ "jsonwebtoken": "^9.0.3",
63
64
  "md5": "^2.3.0",
64
65
  "moment": "^2.29.3",
65
66
  "sugar": "^2.0.6",