@mongoosejs/studio 0.0.92 → 0.0.94
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);
|
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
|
})
|
package/frontend/public/app.js
CHANGED
|
@@ -1013,16 +1013,21 @@ module.exports = app => app.component('edit-dashboard', {
|
|
|
1013
1013
|
},
|
|
1014
1014
|
async updateCode() {
|
|
1015
1015
|
this.status = 'loading';
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1016
|
+
try {
|
|
1017
|
+
const { doc, result, error } = await api.Dashboard.updateDashboard({
|
|
1018
|
+
dashboardId: this.dashboardId,
|
|
1019
|
+
code: this.editor.getValue(),
|
|
1020
|
+
title: this.title,
|
|
1021
|
+
description: this.description
|
|
1022
|
+
});
|
|
1023
|
+
this.$emit('update', { doc, result, error });
|
|
1024
|
+
this.editor.setValue(doc.code);
|
|
1025
|
+
this.closeEditor();
|
|
1026
|
+
} catch (err) {
|
|
1027
|
+
this.$emit('update', { error: { message: err.message } });
|
|
1028
|
+
} finally {
|
|
1029
|
+
this.status = 'loaded';
|
|
1030
|
+
}
|
|
1026
1031
|
}
|
|
1027
1032
|
},
|
|
1028
1033
|
mounted: async function() {
|
|
@@ -1809,7 +1814,9 @@ app.component('app-component', {
|
|
|
1809
1814
|
window.state = this;
|
|
1810
1815
|
|
|
1811
1816
|
if (mothership.hasAPIKey) {
|
|
1812
|
-
const
|
|
1817
|
+
const hash = window.location.hash.replace(/^#?\/?\??/, '') || '';
|
|
1818
|
+
const hashQuery = hash.split('?')[1] || '';
|
|
1819
|
+
const hashParams = new URLSearchParams(hashQuery);
|
|
1813
1820
|
if (hashParams.has('code')) {
|
|
1814
1821
|
const code = hashParams.get('code');
|
|
1815
1822
|
const provider = hashParams.get('provider');
|
|
@@ -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/frontend/src/index.js
CHANGED
|
@@ -67,7 +67,9 @@ app.component('app-component', {
|
|
|
67
67
|
window.state = this;
|
|
68
68
|
|
|
69
69
|
if (mothership.hasAPIKey) {
|
|
70
|
-
const
|
|
70
|
+
const hash = window.location.hash.replace(/^#?\/?\??/, '') || '';
|
|
71
|
+
const hashQuery = hash.split('?')[1] || '';
|
|
72
|
+
const hashParams = new URLSearchParams(hashQuery);
|
|
71
73
|
if (hashParams.has('code')) {
|
|
72
74
|
const code = hashParams.get('code');
|
|
73
75
|
const provider = hashParams.get('provider');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongoosejs/studio",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.94",
|
|
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": {
|