wingbot 3.73.14 → 3.73.15
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.73.
|
|
3
|
+
"version": "3.73.15",
|
|
4
4
|
"description": "Enterprise Messaging Bot Conversation Engine",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -71,4 +71,4 @@
|
|
|
71
71
|
"axios": "^1.6.4",
|
|
72
72
|
"handlebars": "^4.0.0"
|
|
73
73
|
}
|
|
74
|
-
}
|
|
74
|
+
}
|
package/src/BotAppSender.js
CHANGED
|
@@ -181,10 +181,17 @@ class BotAppSender extends ReturnSender {
|
|
|
181
181
|
|
|
182
182
|
headers.set('Authorization', token);
|
|
183
183
|
|
|
184
|
-
const
|
|
184
|
+
const res = await this._fetch(`${this._apiUrl}/${this._pageId}`, {
|
|
185
185
|
headers, body: formData, agent, method: 'POST'
|
|
186
|
-
})
|
|
187
|
-
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
const responseText = await res.text();
|
|
189
|
+
let response;
|
|
190
|
+
try {
|
|
191
|
+
response = JSON.parse(responseText);
|
|
192
|
+
} catch (e) {
|
|
193
|
+
throw new Error(`[${res.status}] Invalid JSON response: ${responseText}`);
|
|
194
|
+
}
|
|
188
195
|
|
|
189
196
|
return response;
|
|
190
197
|
}
|
|
@@ -212,10 +219,17 @@ class BotAppSender extends ReturnSender {
|
|
|
212
219
|
headers.set('Authorization', token);
|
|
213
220
|
headers.set('Content-Type', 'application/json');
|
|
214
221
|
|
|
215
|
-
const
|
|
222
|
+
const res = await this._fetch(this._apiUrl, {
|
|
216
223
|
headers, body, agent, method: 'POST'
|
|
217
|
-
})
|
|
218
|
-
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
const responseText = await res.text();
|
|
227
|
+
let response;
|
|
228
|
+
try {
|
|
229
|
+
response = JSON.parse(responseText);
|
|
230
|
+
} catch (e) {
|
|
231
|
+
throw new Error(`[${res.status}] Invalid JSON response: ${responseText}`);
|
|
232
|
+
}
|
|
219
233
|
|
|
220
234
|
const { request, errors = null } = response;
|
|
221
235
|
|
|
@@ -272,7 +272,14 @@ class OrchestratorClient {
|
|
|
272
272
|
|
|
273
273
|
const response = await this._fetch(this._apiUrl, { headers, body, method: 'POST' });
|
|
274
274
|
|
|
275
|
-
const
|
|
275
|
+
const responseText = await response.text();
|
|
276
|
+
let responseJson;
|
|
277
|
+
try {
|
|
278
|
+
responseJson = JSON.parse(responseText);
|
|
279
|
+
} catch (e) {
|
|
280
|
+
throw new Error(`[${response.status}] Invalid JSON response: ${responseText}`);
|
|
281
|
+
}
|
|
282
|
+
|
|
276
283
|
const { errors = null } = responseJson;
|
|
277
284
|
|
|
278
285
|
if (errors) {
|