@mongoosejs/studio 0.0.91 → 0.0.93
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,7 +21,7 @@ const ExecuteScriptParams = new Archetype({
|
|
|
21
21
|
}).compile('ExecuteScriptParams');
|
|
22
22
|
|
|
23
23
|
module.exports = ({ db, studioConnection }) => async function executeScript(params) {
|
|
24
|
-
const { userId, chatMessageId, script } = new ExecuteScriptParams(params);
|
|
24
|
+
const { userId, chatMessageId, script, roles } = new ExecuteScriptParams(params);
|
|
25
25
|
const ChatMessage = studioConnection.model('__Studio_ChatMessage');
|
|
26
26
|
|
|
27
27
|
await authorize('ChatMessage.executeScript', roles);
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const Archetype = require('archetype');
|
|
3
4
|
const authorize = require('../../authorize');
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const GetDashboardParams = new Archetype({
|
|
7
|
+
roles: {
|
|
8
|
+
$type: ['string']
|
|
9
|
+
}
|
|
10
|
+
}).compile('GetDashboardParams');
|
|
11
|
+
|
|
12
|
+
module.exports = ({ db }) => async function getDashboards(params) {
|
|
6
13
|
const Dashboard = db.model('__Studio_Dashboard');
|
|
14
|
+
const { roles } = new GetDashboardParams(params);
|
|
7
15
|
|
|
8
16
|
await authorize('Dashboard.getDashboards', roles);
|
|
9
17
|
|
package/express.js
CHANGED
|
@@ -63,9 +63,10 @@ module.exports = async function(apiUrl, conn, options) {
|
|
|
63
63
|
if (!user || !roles) {
|
|
64
64
|
throw new Error('Not authorized');
|
|
65
65
|
}
|
|
66
|
-
req.
|
|
67
|
-
req.
|
|
68
|
-
req.
|
|
66
|
+
req._internals = req._internals || {};
|
|
67
|
+
req._internals.authorization = authorization;
|
|
68
|
+
req._internals.initiatedById = user._id;
|
|
69
|
+
req._internals.roles = roles;
|
|
69
70
|
|
|
70
71
|
next();
|
|
71
72
|
})
|
|
@@ -20,16 +20,21 @@ module.exports = app => app.component('edit-dashboard', {
|
|
|
20
20
|
},
|
|
21
21
|
async updateCode() {
|
|
22
22
|
this.status = 'loading';
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
try {
|
|
24
|
+
const { doc, result, error } = await api.Dashboard.updateDashboard({
|
|
25
|
+
dashboardId: this.dashboardId,
|
|
26
|
+
code: this.editor.getValue(),
|
|
27
|
+
title: this.title,
|
|
28
|
+
description: this.description
|
|
29
|
+
});
|
|
30
|
+
this.$emit('update', { doc, result, error });
|
|
31
|
+
this.editor.setValue(doc.code);
|
|
32
|
+
this.closeEditor();
|
|
33
|
+
} catch (err) {
|
|
34
|
+
this.$emit('update', { error: { message: err.message } });
|
|
35
|
+
} finally {
|
|
36
|
+
this.status = 'loaded';
|
|
37
|
+
}
|
|
33
38
|
}
|
|
34
39
|
},
|
|
35
40
|
mounted: async function() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongoosejs/studio",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.93",
|
|
4
4
|
"description": "A sleek, powerful MongoDB UI with built-in dashboarding and auth, seamlessly integrated with your Express, Vercel, or Netlify app.",
|
|
5
5
|
"homepage": "https://studio.mongoosejs.io/",
|
|
6
6
|
"repository": {
|