@mongoosejs/studio 0.0.53 → 0.0.55

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.
@@ -7,6 +7,8 @@ module.exports = function netlify(options) {
7
7
  const backend = Backend();
8
8
  const mothershipUrl = options?._mothershipUrl || 'https://mongoose-js.netlify.app/.netlify/functions';
9
9
 
10
+ let workspace = null;
11
+
10
12
  return toNetlifyFunction(async function wrappedNetlifyFunction(params) {
11
13
  const actionName = params?.action;
12
14
  const authorization = params?.authorization;
@@ -15,7 +17,27 @@ module.exports = function netlify(options) {
15
17
  throw new Error('Not authorized');
16
18
  }
17
19
 
18
- const { user, roles } = await fetch(`${mothershipUrl}/me`, params)
20
+ if (workspace == null) {
21
+ ({ workspace } = await fetch(`${mothershipUrl}/getWorkspace`, {
22
+ method: 'POST',
23
+ body: JSON.stringify({ apiKey: options.apiKey }),
24
+ headers: {
25
+ 'Authorization': `Bearer ${options.apiKey}`,
26
+ 'Content-Type': 'application/json'
27
+ }
28
+ })
29
+ .then(response => {
30
+ if (response.status < 200 || response.status >= 400) {
31
+ return response.json().then(data => {
32
+ throw new Error(`Mongoose Studio API Key Error ${response.status}: ${require('util').inspect(data)}`);
33
+ });
34
+ }
35
+ return response;
36
+ })
37
+ .then(res => res.json()));
38
+ }
39
+
40
+ const { user, roles } = await fetch(`${mothershipUrl}/me`, { ...params, workspaceId: workspace._id })
19
41
  .then(response => {
20
42
  if (response.status < 200 || response.status >= 400) {
21
43
  return response.json().then(data => {
@@ -280,7 +280,8 @@ module.exports = app => app.component('create-document', {
280
280
  this.$refs.codeEditor.value = this.documentData;
281
281
  this.editor = CodeMirror.fromTextArea(this.$refs.codeEditor, {
282
282
  mode: 'javascript',
283
- lineNumbers: true
283
+ lineNumbers: true,
284
+ smartIndent: false
284
285
  });
285
286
  },
286
287
  })
@@ -55,7 +55,8 @@ module.exports = app => app.component('create-document', {
55
55
  this.$refs.codeEditor.value = this.documentData;
56
56
  this.editor = CodeMirror.fromTextArea(this.$refs.codeEditor, {
57
57
  mode: 'javascript',
58
- lineNumbers: true
58
+ lineNumbers: true,
59
+ smartIndent: false
59
60
  });
60
61
  },
61
62
  })
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@mongoosejs/studio",
3
- "version": "0.0.53",
3
+ "version": "0.0.55",
4
4
  "dependencies": {
5
5
  "archetype": "0.13.1",
6
6
  "csv-stringify": "6.3.0",
7
7
  "ejson": "^2.2.3",
8
- "extrovert": "0.0.25",
8
+ "extrovert": "0.0.26",
9
9
  "node-inspect-extracted": "3.x",
10
10
  "tailwindcss": "3.4.0",
11
11
  "vanillatoasts": "^1.6.0",