@nocobase/plugin-client 0.8.0-alpha.9 → 0.8.1-alpha.4

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.
Files changed (2) hide show
  1. package/lib/server.js +13 -3
  2. package/package.json +4 -4
package/lib/server.js CHANGED
@@ -101,6 +101,8 @@ class ClientPlugin extends _server().Plugin {
101
101
 
102
102
  _this2.app.acl.allow('plugins', 'getPinned', 'loggedIn');
103
103
 
104
+ const dialect = _this2.app.db.sequelize.getDialect();
105
+
104
106
  _this2.app.resource({
105
107
  name: 'app',
106
108
  actions: {
@@ -117,6 +119,9 @@ class ClientPlugin extends _server().Plugin {
117
119
  }
118
120
 
119
121
  ctx.body = {
122
+ database: {
123
+ dialect
124
+ },
120
125
  version: yield ctx.app.version.get(),
121
126
  lang
122
127
  };
@@ -153,7 +158,9 @@ class ClientPlugin extends _server().Plugin {
153
158
  });
154
159
  ctx.body = items.filter(item => {
155
160
  try {
156
- require.resolve(`@nocobase/plugin-${item.name}/client`);
161
+ const packageName = _server().PluginManager.getPackageName(item.name);
162
+
163
+ require.resolve(`${packageName}/client`);
157
164
 
158
165
  return true;
159
166
  } catch (error) {}
@@ -200,7 +207,7 @@ class ClientPlugin extends _server().Plugin {
200
207
  }
201
208
 
202
209
  if (process.env.APP_ENV !== 'production' && root) {
203
- _this2.app.middleware.nodes.unshift( /*#__PURE__*/function () {
210
+ _this2.app.use( /*#__PURE__*/function () {
204
211
  var _ref4 = _asyncToGenerator(function* (ctx, next) {
205
212
  if (ctx.path.startsWith(_this2.app.resourcer.options.prefix)) {
206
213
  return next();
@@ -218,7 +225,10 @@ class ClientPlugin extends _server().Plugin {
218
225
  return function (_x3, _x4) {
219
226
  return _ref4.apply(this, arguments);
220
227
  };
221
- }());
228
+ }(), {
229
+ tag: 'clientStatic',
230
+ before: 'cors'
231
+ });
222
232
  }
223
233
  })();
224
234
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-client",
3
- "version": "0.8.0-alpha.9",
3
+ "version": "0.8.1-alpha.4",
4
4
  "main": "lib/index.js",
5
5
  "license": "Apache-2.0",
6
6
  "licenses": [
@@ -10,10 +10,10 @@
10
10
  }
11
11
  ],
12
12
  "dependencies": {
13
- "@nocobase/server": "0.8.0-alpha.9"
13
+ "@nocobase/server": "0.8.1-alpha.4"
14
14
  },
15
15
  "devDependencies": {
16
- "@nocobase/test": "0.8.0-alpha.9"
16
+ "@nocobase/test": "0.8.1-alpha.4"
17
17
  },
18
- "gitHead": "6afe02d59bb22df0f96a7605c9001dcc17a30d6a"
18
+ "gitHead": "22ccdf7bd7fcbd16aeefd5250db237a4bd1ccff1"
19
19
  }