@mongoosejs/studio 0.0.113 → 0.0.115
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.
|
@@ -22,6 +22,7 @@ const ExecuteScriptParams = new Archetype({
|
|
|
22
22
|
|
|
23
23
|
module.exports = ({ db, studioConnection }) => async function executeScript(params) {
|
|
24
24
|
const { initiatedById, chatMessageId, script, roles } = new ExecuteScriptParams(params);
|
|
25
|
+
const ChatThread = studioConnection.model('__Studio_ChatThread');
|
|
25
26
|
const ChatMessage = studioConnection.model('__Studio_ChatMessage');
|
|
26
27
|
|
|
27
28
|
await authorize('ChatMessage.executeScript', roles);
|
|
@@ -30,8 +31,9 @@ module.exports = ({ db, studioConnection }) => async function executeScript(para
|
|
|
30
31
|
if (!chatMessage) {
|
|
31
32
|
throw new Error('Chat message not found');
|
|
32
33
|
}
|
|
34
|
+
const chatThread = await ChatThread.findById(chatMessage.chatThreadId).orFail();
|
|
33
35
|
|
|
34
|
-
if (initiatedById &&
|
|
36
|
+
if (initiatedById && chatThread.userId?.toString() !== initiatedById.toString()) {
|
|
35
37
|
throw new Error('Unauthorized');
|
|
36
38
|
}
|
|
37
39
|
|
package/backend/netlify.js
CHANGED
package/frontend/public/app.js
CHANGED
|
@@ -14837,7 +14837,7 @@ var bson = /*#__PURE__*/Object.freeze({
|
|
|
14837
14837
|
/***/ ((module) => {
|
|
14838
14838
|
|
|
14839
14839
|
"use strict";
|
|
14840
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@mongoosejs/studio","version":"0.0.
|
|
14840
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@mongoosejs/studio","version":"0.0.114","description":"A sleek, powerful MongoDB UI with built-in dashboarding and auth, seamlessly integrated with your Express, Vercel, or Netlify app.","homepage":"https://studio.mongoosejs.io/","repository":{"type":"git","url":"https://github.com/mongoosejs/studio"},"dependencies":{"archetype":"0.13.1","csv-stringify":"6.3.0","ejson":"^2.2.3","extrovert":"0.0.26","marked":"15.0.12","node-inspect-extracted":"3.x","tailwindcss":"3.4.0","vanillatoasts":"^1.6.0","vue":"3.x","webpack":"5.x"},"peerDependencies":{"bson":"^5.5.1 || 6.x","express":"4.x","mongoose":"7.x || 8.x"},"devDependencies":{"@masteringjs/eslint-config":"0.1.1","axios":"1.2.2","dedent":"^1.6.0","eslint":"9.30.0","express":"4.x","mocha":"10.2.0","mongoose":"8.x"},"scripts":{"lint":"eslint .","tailwind":"tailwindcss -o ./frontend/public/tw.css","tailwind:watch":"tailwindcss -o ./frontend/public/tw.css --watch","test":"mocha test/*.test.js"}}');
|
|
14841
14841
|
|
|
14842
14842
|
/***/ })
|
|
14843
14843
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongoosejs/studio",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.115",
|
|
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": {
|