wingbot 3.28.0 → 3.29.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.
- package/package.json +2 -2
- package/src/resolvers/media.js +10 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wingbot",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.29.0",
|
|
4
4
|
"description": "Enterprise Messaging Bot Conversation Engine",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -71,4 +71,4 @@
|
|
|
71
71
|
"request": "^2.88.0",
|
|
72
72
|
"request-promise-native": "^1.0.7"
|
|
73
73
|
}
|
|
74
|
-
}
|
|
74
|
+
}
|
package/src/resolvers/media.js
CHANGED
|
@@ -4,9 +4,12 @@
|
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
6
|
const Router = require('../Router');
|
|
7
|
+
const getCondition = require('../utils/getCondition');
|
|
7
8
|
const { stateData, cachedTranslatedCompilator } = require('./utils');
|
|
8
9
|
|
|
9
|
-
function media (params,
|
|
10
|
+
function media (params,
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
{ isLastIndex } = {}) {
|
|
10
13
|
const { type, url } = params;
|
|
11
14
|
|
|
12
15
|
const urlString = url || '';
|
|
@@ -19,7 +22,13 @@ function media (params, { isLastIndex }) {
|
|
|
19
22
|
throw new Error(`Unsupported media type: ${type}`);
|
|
20
23
|
}
|
|
21
24
|
|
|
25
|
+
const condition = getCondition(params, 'Media condition');
|
|
26
|
+
|
|
22
27
|
return (req, res) => {
|
|
28
|
+
if (condition && !condition(req, res)) {
|
|
29
|
+
return ret;
|
|
30
|
+
}
|
|
31
|
+
|
|
23
32
|
const data = stateData(req, res);
|
|
24
33
|
const sendUrl = urlTemplate(data);
|
|
25
34
|
|