wingbot 3.65.4 → 3.65.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.65.4",
3
+ "version": "3.65.5",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -78,11 +78,14 @@ class GenericTemplate extends ButtonTemplate {
78
78
  *
79
79
  * @param {string} action - Button action (can be absolute or relative)
80
80
  * @param {object} [data={}] - Action data
81
+ * @param {object} [setState] - SetState data
81
82
  * @returns {this}
82
83
  *
83
84
  * @memberOf GenericTemplate
84
85
  */
85
- setElementActionPostback (action, data = {}) {
86
+ setElementActionPostback (action, data = {}, setState = null) {
87
+ const hasSetState = setState && Object.keys(setState).length !== 0;
88
+
86
89
  Object.assign(this._element, {
87
90
  default_action: {
88
91
  type: 'postback',
@@ -91,7 +94,8 @@ class GenericTemplate extends ButtonTemplate {
91
94
  data: {
92
95
  _ca: this.context.currentAction,
93
96
  ...data
94
- }
97
+ },
98
+ ...(hasSetState ? { setState } : {})
95
99
  })
96
100
  }
97
101
  });
@@ -134,6 +138,7 @@ class GenericTemplate extends ButtonTemplate {
134
138
  return this;
135
139
  }
136
140
 
141
+ // @ts-ignore
137
142
  getTemplate () {
138
143
  this._attachAndClearButtons();
139
144
  const res = {