@mongoosejs/studio 0.2.1 → 0.2.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.
package/eslint.config.js
CHANGED
package/frontend/public/app.js
CHANGED
|
@@ -301,9 +301,9 @@ function getAutocompleteContext(searchText, cursorPos) {
|
|
|
301
301
|
|
|
302
302
|
// Check if we're in a value context (after a colon)
|
|
303
303
|
// Match the last colon followed by optional whitespace and capture everything after
|
|
304
|
-
const valueMatch = before.match(/:\s*([^\s,\}\]:]*)$/);
|
|
304
|
+
const valueMatch = before.match(/:\s*(\{?\s*)([^\s,\}\]:]*)$/);
|
|
305
305
|
if (valueMatch) {
|
|
306
|
-
const token = valueMatch[
|
|
306
|
+
const token = valueMatch[2];
|
|
307
307
|
return {
|
|
308
308
|
token,
|
|
309
309
|
role: 'value',
|
|
@@ -378,9 +378,9 @@ function applySuggestion(searchText, cursorPos, suggestion) {
|
|
|
378
378
|
const after = searchText.slice(cursorPos);
|
|
379
379
|
|
|
380
380
|
// Check if we're in a value context
|
|
381
|
-
const valueMatch = before.match(/:\s*([^\s,\}\]:]*)$/);
|
|
381
|
+
const valueMatch = before.match(/:\s*(\{?\s*)([^\s,\}\]:]*)$/);
|
|
382
382
|
if (valueMatch) {
|
|
383
|
-
const token = valueMatch[
|
|
383
|
+
const token = valueMatch[2];
|
|
384
384
|
const start = cursorPos - token.length;
|
|
385
385
|
let replacement = suggestion;
|
|
386
386
|
let cursorOffset = replacement.length;
|
|
@@ -4456,18 +4456,21 @@ app.component('app-component', {
|
|
|
4456
4456
|
return;
|
|
4457
4457
|
}
|
|
4458
4458
|
|
|
4459
|
+
window.localStorage.setItem('_mongooseStudioAccessToken', accessToken._id);
|
|
4460
|
+
|
|
4459
4461
|
try {
|
|
4460
4462
|
const { nodeEnv } = await api.status();
|
|
4461
4463
|
this.nodeEnv = nodeEnv;
|
|
4462
4464
|
} catch (err) {
|
|
4463
4465
|
this.authError = 'Error connecting to Mongoose Studio API: ' + err.response?.data?.message ?? err.message;
|
|
4464
4466
|
this.status = 'loaded';
|
|
4467
|
+
window.localStorage.setItem('_mongooseStudioAccessToken', '');
|
|
4465
4468
|
return;
|
|
4466
4469
|
}
|
|
4467
4470
|
|
|
4468
4471
|
this.user = user;
|
|
4469
4472
|
this.roles = roles;
|
|
4470
|
-
|
|
4473
|
+
|
|
4471
4474
|
setTimeout(() => {
|
|
4472
4475
|
this.$router.replace(this.$router.currentRoute.value.path);
|
|
4473
4476
|
}, 0);
|
|
@@ -6293,12 +6296,21 @@ client.interceptors.request.use(req => {
|
|
|
6293
6296
|
return req;
|
|
6294
6297
|
});
|
|
6295
6298
|
|
|
6299
|
+
function sanitizedReturnUrl() {
|
|
6300
|
+
const url = new URL(window.location.href);
|
|
6301
|
+
if (url.hash && url.hash.includes('?')) {
|
|
6302
|
+
const [hashPath, hashSearch] = url.hash.split('?', 2);
|
|
6303
|
+
url.hash = hashPath;
|
|
6304
|
+
}
|
|
6305
|
+
return url.toString();
|
|
6306
|
+
}
|
|
6307
|
+
|
|
6296
6308
|
exports.githubLogin = function githubLogin() {
|
|
6297
|
-
return client.post('/githubLogin', { state:
|
|
6309
|
+
return client.post('/githubLogin', { state: sanitizedReturnUrl() }).then(res => res.data);
|
|
6298
6310
|
};
|
|
6299
6311
|
|
|
6300
6312
|
exports.googleLogin = function googleLogin() {
|
|
6301
|
-
return client.post('/googleLogin', { state:
|
|
6313
|
+
return client.post('/googleLogin', { state: sanitizedReturnUrl() }).then(res => res.data);
|
|
6302
6314
|
};
|
|
6303
6315
|
|
|
6304
6316
|
exports.getWorkspaceTeam = function getWorkspaceTeam() {
|
|
@@ -32234,7 +32246,7 @@ const compile = () => {
|
|
|
32234
32246
|
(module) {
|
|
32235
32247
|
|
|
32236
32248
|
"use strict";
|
|
32237
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@mongoosejs/studio","version":"0.2.
|
|
32249
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@mongoosejs/studio","version":"0.2.2","description":"A Mongoose-native MongoDB UI with schema-aware autocomplete, AI-assisted queries, and dashboards that understand your models - not just your data.","homepage":"https://mongoosestudio.app/","repository":{"type":"git","url":"https://github.com/mongoosejs/studio"},"license":"Apache-2.0","dependencies":{"@ai-sdk/anthropic":"2.x","@ai-sdk/google":"2.x","@ai-sdk/openai":"2.x","ai":"5.x","archetype":"0.13.1","csv-stringify":"6.3.0","ejson":"^2.2.3","extrovert":"^0.2.0","marked":"15.0.12","node-inspect-extracted":"3.x","tailwindcss":"3.4.0","vue":"3.x","vue-toastification":"^2.0.0-rc.5","webpack":"5.x"},"peerDependencies":{"mongoose":"7.x || 8.x || ^9.0.0"},"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":"9.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"}}');
|
|
32238
32250
|
|
|
32239
32251
|
/***/ }
|
|
32240
32252
|
|
|
@@ -82,9 +82,9 @@ function getAutocompleteContext(searchText, cursorPos) {
|
|
|
82
82
|
|
|
83
83
|
// Check if we're in a value context (after a colon)
|
|
84
84
|
// Match the last colon followed by optional whitespace and capture everything after
|
|
85
|
-
const valueMatch = before.match(/:\s*([^\s,\}\]:]*)$/);
|
|
85
|
+
const valueMatch = before.match(/:\s*(\{?\s*)([^\s,\}\]:]*)$/);
|
|
86
86
|
if (valueMatch) {
|
|
87
|
-
const token = valueMatch[
|
|
87
|
+
const token = valueMatch[2];
|
|
88
88
|
return {
|
|
89
89
|
token,
|
|
90
90
|
role: 'value',
|
|
@@ -159,9 +159,9 @@ function applySuggestion(searchText, cursorPos, suggestion) {
|
|
|
159
159
|
const after = searchText.slice(cursorPos);
|
|
160
160
|
|
|
161
161
|
// Check if we're in a value context
|
|
162
|
-
const valueMatch = before.match(/:\s*([^\s,\}\]:]*)$/);
|
|
162
|
+
const valueMatch = before.match(/:\s*(\{?\s*)([^\s,\}\]:]*)$/);
|
|
163
163
|
if (valueMatch) {
|
|
164
|
-
const token = valueMatch[
|
|
164
|
+
const token = valueMatch[2];
|
|
165
165
|
const start = cursorPos - token.length;
|
|
166
166
|
let replacement = suggestion;
|
|
167
167
|
let cursorOffset = replacement.length;
|
package/frontend/src/index.js
CHANGED
|
@@ -102,18 +102,21 @@ app.component('app-component', {
|
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
window.localStorage.setItem('_mongooseStudioAccessToken', accessToken._id);
|
|
106
|
+
|
|
105
107
|
try {
|
|
106
108
|
const { nodeEnv } = await api.status();
|
|
107
109
|
this.nodeEnv = nodeEnv;
|
|
108
110
|
} catch (err) {
|
|
109
111
|
this.authError = 'Error connecting to Mongoose Studio API: ' + err.response?.data?.message ?? err.message;
|
|
110
112
|
this.status = 'loaded';
|
|
113
|
+
window.localStorage.setItem('_mongooseStudioAccessToken', '');
|
|
111
114
|
return;
|
|
112
115
|
}
|
|
113
116
|
|
|
114
117
|
this.user = user;
|
|
115
118
|
this.roles = roles;
|
|
116
|
-
|
|
119
|
+
|
|
117
120
|
setTimeout(() => {
|
|
118
121
|
this.$router.replace(this.$router.currentRoute.value.path);
|
|
119
122
|
}, 0);
|
|
@@ -18,12 +18,21 @@ client.interceptors.request.use(req => {
|
|
|
18
18
|
return req;
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
+
function sanitizedReturnUrl() {
|
|
22
|
+
const url = new URL(window.location.href);
|
|
23
|
+
if (url.hash && url.hash.includes('?')) {
|
|
24
|
+
const [hashPath, hashSearch] = url.hash.split('?', 2);
|
|
25
|
+
url.hash = hashPath;
|
|
26
|
+
}
|
|
27
|
+
return url.toString();
|
|
28
|
+
}
|
|
29
|
+
|
|
21
30
|
exports.githubLogin = function githubLogin() {
|
|
22
|
-
return client.post('/githubLogin', { state:
|
|
31
|
+
return client.post('/githubLogin', { state: sanitizedReturnUrl() }).then(res => res.data);
|
|
23
32
|
};
|
|
24
33
|
|
|
25
34
|
exports.googleLogin = function googleLogin() {
|
|
26
|
-
return client.post('/googleLogin', { state:
|
|
35
|
+
return client.post('/googleLogin', { state: sanitizedReturnUrl() }).then(res => res.data);
|
|
27
36
|
};
|
|
28
37
|
|
|
29
38
|
exports.getWorkspaceTeam = function getWorkspaceTeam() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongoosejs/studio",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "A Mongoose-native MongoDB UI with schema-aware autocomplete, AI-assisted queries, and dashboards that understand your models - not just your data.",
|
|
5
5
|
"homepage": "https://mongoosestudio.app/",
|
|
6
6
|
"repository": {
|