@peopl-health/nexus 4.0.0 → 4.0.2
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.
|
@@ -21,10 +21,10 @@ const messageSchema = new mongoose.Schema({
|
|
|
21
21
|
nombre_whatsapp: { type: String, default: null },
|
|
22
22
|
timestamp: { type: String, required: true, default: Date.now },
|
|
23
23
|
message_id: { type: String, default: null},
|
|
24
|
-
interactive_type: {
|
|
25
|
-
type: String,
|
|
26
|
-
enum: ['button', 'list', 'flow', 'quick_reply'],
|
|
27
|
-
default: null
|
|
24
|
+
interactive_type: {
|
|
25
|
+
type: String,
|
|
26
|
+
enum: [null, 'button', 'list', 'flow', 'quick_reply'],
|
|
27
|
+
default: null
|
|
28
28
|
},
|
|
29
29
|
interactive_data: { type: Object, default: null },
|
|
30
30
|
group_id: { type: String, default: null },
|
|
@@ -54,10 +54,10 @@ const messageSchema = new mongoose.Schema({
|
|
|
54
54
|
contentType: { type: String, default: null },
|
|
55
55
|
bucketName: { type: String, default: null },
|
|
56
56
|
key: { type: String, default: null },
|
|
57
|
-
mediaType: {
|
|
58
|
-
type: String,
|
|
59
|
-
enum: ['image', 'video', 'audio', 'document', 'sticker', 'other'],
|
|
60
|
-
default: null
|
|
57
|
+
mediaType: {
|
|
58
|
+
type: String,
|
|
59
|
+
enum: [null, 'image', 'video', 'audio', 'document', 'sticker', 'other'],
|
|
60
|
+
default: null
|
|
61
61
|
},
|
|
62
62
|
fileName: { type: String, default: null },
|
|
63
63
|
fileSize: { type: Number, default: null },
|
package/lib/routes/index.js
CHANGED
|
@@ -34,7 +34,6 @@ const conversationRouteDefinitions = {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
const mediaRouteDefinitions = {
|
|
37
|
-
'GET /:key(*)': 'getMediaController',
|
|
38
37
|
'POST /upload': 'handleFileUpload'
|
|
39
38
|
};
|
|
40
39
|
|
|
@@ -214,7 +213,12 @@ const builtInControllers = {
|
|
|
214
213
|
const setupDefaultRoutes = (app) => {
|
|
215
214
|
app.use('/api/assistant', createRouter(assistantRouteDefinitions, builtInControllers));
|
|
216
215
|
app.use('/api/conversation', createRouter(conversationRouteDefinitions, builtInControllers));
|
|
217
|
-
|
|
216
|
+
const mediaRouter = createRouter(mediaRouteDefinitions, builtInControllers);
|
|
217
|
+
mediaRouter.get(/^\/(.+)/, (req, res, next) => {
|
|
218
|
+
req.params.key = req.params[0];
|
|
219
|
+
return builtInControllers.getMediaController(req, res, next);
|
|
220
|
+
});
|
|
221
|
+
app.use('/api/media', mediaRouter);
|
|
218
222
|
app.use('/api/message', createRouter(messageRouteDefinitions, builtInControllers));
|
|
219
223
|
app.use('/api/patient', createRouter(patientRouteDefinitions, builtInControllers));
|
|
220
224
|
app.use('/api/preset', createRouter(presetRouteDefinitions, builtInControllers));
|