@mongoosejs/studio 0.0.24 → 0.0.26

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.
@@ -12,7 +12,7 @@ const GetDocumentsParams = new Archetype({
12
12
  limit: {
13
13
  $type: 'number',
14
14
  $required: true,
15
- $default: 50
15
+ $default: 20
16
16
  },
17
17
  skip: {
18
18
  $type: 'number',
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ const Backend = require('./');
4
+
5
+ module.exports = function next() {
6
+ const backend = Backend();
7
+
8
+ return async function(req, res) {
9
+ const actionName = params?.action;
10
+ if (typeof actionName !== 'string') {
11
+ throw new Error('No action specified');
12
+ }
13
+ const pieces = actionName.split('.').filter(p => p !== '__proto__' && p !== 'contructor');
14
+ let actionFn = backend;
15
+ for (const piece of pieces) {
16
+ if (actionFn == null) {
17
+ throw new Error(`Action ${actionName} not found`);
18
+ }
19
+ actionFn = actionFn[piece];
20
+ }
21
+ if (typeof actionFn !== 'function') {
22
+ throw new Error(`Action ${actionName} not found`);
23
+ }
24
+
25
+ return actionFn({ ...req.body });
26
+ }
27
+ }
package/frontend/index.js CHANGED
@@ -33,8 +33,6 @@ module.exports = function(apiUrl, isLambda, options) {
33
33
  childProcess.stdout.on('data', data => console.log('[TAILWIND]', data));
34
34
  childProcess.stderr.on('data', data => console.log('[TAILWIND]', data));
35
35
  } else {
36
- execSync('npm run tailwind');
37
-
38
36
  return new Promise((resolve, reject) => {
39
37
  compiler.run((err) => {
40
38
  if (err) {
@@ -1151,7 +1151,7 @@ const appendCSS = __webpack_require__(/*! ../appendCSS */ "./frontend/src/append
1151
1151
 
1152
1152
  appendCSS(__webpack_require__(/*! ./models.css */ "./frontend/src/models/models.css"));
1153
1153
 
1154
- const limit = 50;
1154
+ const limit = 20;
1155
1155
 
1156
1156
  module.exports = app => app.component('models', {
1157
1157
  template: template,
@@ -1,13 +1,17 @@
1
1
  'use strict';
2
2
 
3
3
  const template = require('./detail-array.html');
4
+ const util = require('util');
4
5
 
5
6
  module.exports = app => app.component('detail-array', {
6
7
  template: template,
7
8
  props: ['value'],
8
9
  computed: {
9
10
  displayValue() {
10
- return JSON.stringify(this.value, null, ' ').trim();
11
+ if (this.value == null) {
12
+ return this.value;
13
+ }
14
+ return util.inspect(this.value);
11
15
  }
12
16
  },
13
17
  mounted() {
@@ -18,7 +18,7 @@ const appendCSS = require('../appendCSS');
18
18
 
19
19
  appendCSS(require('./models.css'));
20
20
 
21
- const limit = 50;
21
+ const limit = 20;
22
22
 
23
23
  module.exports = app => app.component('models', {
24
24
  template: template,
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
3
4
  const webpack = require('webpack');
4
5
 
5
6
  module.exports = {
@@ -17,6 +18,9 @@ module.exports = {
17
18
  filename: '[name].js'
18
19
  },
19
20
  plugins: [
21
+ new NodePolyfillPlugin({
22
+ additionalAliases: ['process']
23
+ }),
20
24
  new webpack.DefinePlugin({
21
25
  config__baseURL: '\'/.netlify/functions/admin\''
22
26
  })
@@ -33,4 +37,4 @@ module.exports = {
33
37
  }
34
38
  ]
35
39
  }
36
- };
40
+ };
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@mongoosejs/studio",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "dependencies": {
5
5
  "archetype": "0.13.0",
6
6
  "csv-stringify": "6.3.0",
7
7
  "ejson": "^2.2.3",
8
8
  "extrovert": "0.0.24",
9
+ "node-polyfill-webpack-plugin": "4.x",
9
10
  "openai": "3.2.1",
10
11
  "vanillatoasts": "^1.6.0"
11
12
  },