@mongoosejs/studio 0.5.12 → 0.5.13
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/frontend/public/app.js +2900 -2619
- package/frontend/src/chat/chat-message/chat-message.js +5 -1
- package/frontend/src/detail-default/detail-default.html +0 -10
- package/frontend/src/detail-default/detail-default.js +29 -1061
- package/frontend/src/document-details/document-property/document-property.html +0 -11
- package/frontend/src/document-details/document-property/document-property.js +6 -14
- package/frontend/src/edit-geojson/edit-geojson.html +17 -0
- package/frontend/src/edit-geojson/edit-geojson.js +1104 -0
- package/local.js +1 -1
- package/package.json +1 -1
- package/seed/connect.js +4 -0
- package/seed/index.js +16 -0
- package/vercel.d.ts +46 -0
- package/vercel.js +3 -0
package/local.js
CHANGED
|
@@ -28,7 +28,7 @@ async function run() {
|
|
|
28
28
|
__build: true,
|
|
29
29
|
__watch: process.env.WATCH,
|
|
30
30
|
_mothershipUrl: 'http://localhost:7777/.netlify/functions',
|
|
31
|
-
apiKey: 'TACO',
|
|
31
|
+
// apiKey: 'TACO',
|
|
32
32
|
openAIAPIKey: process.env.OPENAI_API_KEY,
|
|
33
33
|
googleGeminiAPIKey: process.env.GEMINI_API_KEY
|
|
34
34
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mongoosejs/studio",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13",
|
|
4
4
|
"description": "AI-Powered Data Workspace for MongoDB: Turn your MongoDB data into dashboards, maps, and interactive workflows - powered by your Mongoose models and AI.",
|
|
5
5
|
"homepage": "https://mongoosestudio.app/",
|
|
6
6
|
"repository": {
|
package/seed/connect.js
CHANGED
|
@@ -10,6 +10,10 @@ module.exports = async function connect() {
|
|
|
10
10
|
mongoose.model('User', new mongoose.Schema({
|
|
11
11
|
name: String,
|
|
12
12
|
email: String,
|
|
13
|
+
location: new mongoose.Schema({
|
|
14
|
+
type: { type: String },
|
|
15
|
+
coordinates: [Number]
|
|
16
|
+
}),
|
|
13
17
|
role: String,
|
|
14
18
|
plan: String,
|
|
15
19
|
status: String,
|
package/seed/index.js
CHANGED
|
@@ -20,6 +20,10 @@ async function run() {
|
|
|
20
20
|
{
|
|
21
21
|
name: 'Ada Lovelace',
|
|
22
22
|
email: 'ada@example.com',
|
|
23
|
+
location: {
|
|
24
|
+
type: 'Point',
|
|
25
|
+
coordinates: [-0.1276, 51.5072]
|
|
26
|
+
},
|
|
23
27
|
role: 'admin',
|
|
24
28
|
plan: 'enterprise',
|
|
25
29
|
status: 'active',
|
|
@@ -36,6 +40,10 @@ async function run() {
|
|
|
36
40
|
{
|
|
37
41
|
name: 'Grace Hopper',
|
|
38
42
|
email: 'grace@example.com',
|
|
43
|
+
location: {
|
|
44
|
+
type: 'Point',
|
|
45
|
+
coordinates: [-74.006, 40.7128]
|
|
46
|
+
},
|
|
39
47
|
role: 'analyst',
|
|
40
48
|
plan: 'pro',
|
|
41
49
|
status: 'active',
|
|
@@ -52,6 +60,10 @@ async function run() {
|
|
|
52
60
|
{
|
|
53
61
|
name: 'Linus Torvalds',
|
|
54
62
|
email: 'linus@example.com',
|
|
63
|
+
location: {
|
|
64
|
+
type: 'Point',
|
|
65
|
+
coordinates: [24.9384, 60.1699]
|
|
66
|
+
},
|
|
55
67
|
role: 'editor',
|
|
56
68
|
plan: 'starter',
|
|
57
69
|
status: 'invited',
|
|
@@ -68,6 +80,10 @@ async function run() {
|
|
|
68
80
|
{
|
|
69
81
|
name: 'Margaret Hamilton',
|
|
70
82
|
email: 'margaret@example.com',
|
|
83
|
+
location: {
|
|
84
|
+
type: 'Point',
|
|
85
|
+
coordinates: [-71.1097, 42.3736]
|
|
86
|
+
},
|
|
71
87
|
role: 'viewer',
|
|
72
88
|
plan: 'pro',
|
|
73
89
|
status: 'inactive',
|
package/vercel.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
declare module '@mongoosejs/studio/vercel' {
|
|
2
|
+
import { Connection, Mongoose } from 'mongoose';
|
|
3
|
+
|
|
4
|
+
export interface VercelAPIRouteHandlerOptions {
|
|
5
|
+
/** Mongoose Studio Pro API key. When set, requests must be authorized. */
|
|
6
|
+
apiKey?: string;
|
|
7
|
+
/** Separate connection for Studio's own collections (dashboards, chat threads). */
|
|
8
|
+
studioConnection?: Connection;
|
|
9
|
+
/** Watch the connection for changes and stream them to the Studio frontend. */
|
|
10
|
+
changeStream?: boolean;
|
|
11
|
+
/** Chat model name, e.g. 'gpt-4o-mini' */
|
|
12
|
+
model?: string;
|
|
13
|
+
openAIAPIKey?: string;
|
|
14
|
+
anthropicAPIKey?: string;
|
|
15
|
+
googleGeminiAPIKey?: string;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Minimal request shape: satisfied by Next.js API routes (NextApiRequest),
|
|
21
|
+
* Express, and other Node server frameworks with query/body parsing.
|
|
22
|
+
*/
|
|
23
|
+
export interface VercelAPIRouteHandlerRequest {
|
|
24
|
+
query?: Record<string, any>;
|
|
25
|
+
body?: any;
|
|
26
|
+
params?: Record<string, any>;
|
|
27
|
+
headers: { authorization?: string | null; [key: string]: any };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Minimal response shape: satisfied by NextApiResponse and Express responses. */
|
|
31
|
+
export interface VercelAPIRouteHandlerResponse {
|
|
32
|
+
status(code: number): any;
|
|
33
|
+
json(body: any): any;
|
|
34
|
+
send(body: any): any;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Creates a Mongoose Studio API handler for Next.js Pages Router API routes
|
|
39
|
+
* (`pages/api/studio.js`) and other Vercel-style serverless functions.
|
|
40
|
+
* Pass `null` to use the default Mongoose global.
|
|
41
|
+
*/
|
|
42
|
+
export function vercelAPIRouteHandler(
|
|
43
|
+
conn?: Connection | Mongoose | null,
|
|
44
|
+
options?: VercelAPIRouteHandlerOptions
|
|
45
|
+
): (req: VercelAPIRouteHandlerRequest, res: VercelAPIRouteHandlerResponse) => Promise<any>;
|
|
46
|
+
}
|
package/vercel.js
ADDED