chat-platform 2.1.0 → 2.1.3
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/chat-platform.js +4 -2
- package/package.json +1 -3
- package/providers/memory.js +8 -0
package/chat-platform.js
CHANGED
|
@@ -747,7 +747,8 @@ const ChatExpress = function(options) {
|
|
|
747
747
|
label: !_.isEmpty(config.label) ? config.label : name,
|
|
748
748
|
description: config.description,
|
|
749
749
|
default: config.default,
|
|
750
|
-
options: config.options
|
|
750
|
+
options: config.options,
|
|
751
|
+
suggestions: config.suggestions
|
|
751
752
|
});
|
|
752
753
|
return this;
|
|
753
754
|
},
|
|
@@ -1253,7 +1254,8 @@ ChatExpress.registerParam = function(name, type, config = {}) {
|
|
|
1253
1254
|
label: !_.isEmpty(config.label) ? config.label : name,
|
|
1254
1255
|
description: config.description,
|
|
1255
1256
|
default: config.default,
|
|
1256
|
-
options: config.options
|
|
1257
|
+
options: config.options,
|
|
1258
|
+
suggestions: config.suggestions
|
|
1257
1259
|
});
|
|
1258
1260
|
return this;
|
|
1259
1261
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chat-platform",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "Universal Chat Platform",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
"cli-color": "^1.4.0",
|
|
15
15
|
"cli-table": "^0.3.1",
|
|
16
16
|
"moment": "^2.24.0",
|
|
17
|
-
"np": "^5.0.2",
|
|
18
|
-
"npm": "^6.9.0",
|
|
19
17
|
"prettyjson": "^1.2.1",
|
|
20
18
|
"request": "^2.88.0",
|
|
21
19
|
"sequelize": "^5.21.6",
|
package/providers/memory.js
CHANGED
|
@@ -137,6 +137,14 @@ function MemoryFactory() {
|
|
|
137
137
|
}
|
|
138
138
|
return new MemoryStore(userId, { ...statics });
|
|
139
139
|
};
|
|
140
|
+
// this is only to be used in testing to simplify the testing scenarios
|
|
141
|
+
// there's no really need for an async func here
|
|
142
|
+
this.getOrCreateContextSync = function(userId, statics) {
|
|
143
|
+
if (isEmpty(userId)) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
return new MemoryStore(userId, { ...statics });
|
|
147
|
+
};
|
|
140
148
|
|
|
141
149
|
this.mergeUserId = async function(fromUserId, toUserId) {
|
|
142
150
|
const destination = _storeChatIds[toUserId];
|