@nocobase/plugin-client 0.7.6-alpha.2 → 0.8.0-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.
- package/lib/server.d.ts +0 -1
- package/lib/server.js +25 -10
- package/package.json +4 -4
package/lib/server.d.ts
CHANGED
package/lib/server.js
CHANGED
|
@@ -97,6 +97,8 @@ class ClientPlugin extends _server().Plugin {
|
|
|
97
97
|
|
|
98
98
|
_this2.app.acl.allow('app', 'getInfo');
|
|
99
99
|
|
|
100
|
+
_this2.app.acl.allow('app', 'getPlugins');
|
|
101
|
+
|
|
100
102
|
_this2.app.acl.allow('plugins', 'getPinned', 'loggedIn');
|
|
101
103
|
|
|
102
104
|
_this2.app.resource({
|
|
@@ -139,6 +141,27 @@ class ClientPlugin extends _server().Plugin {
|
|
|
139
141
|
};
|
|
140
142
|
yield next();
|
|
141
143
|
})();
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
getPlugins(ctx, next) {
|
|
147
|
+
return _asyncToGenerator(function* () {
|
|
148
|
+
const pm = ctx.db.getRepository('applicationPlugins');
|
|
149
|
+
const items = yield pm.find({
|
|
150
|
+
filter: {
|
|
151
|
+
enabled: true
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
ctx.body = items.filter(item => {
|
|
155
|
+
try {
|
|
156
|
+
require.resolve(`@nocobase/plugin-${item.name}/client`);
|
|
157
|
+
|
|
158
|
+
return true;
|
|
159
|
+
} catch (error) {}
|
|
160
|
+
|
|
161
|
+
return false;
|
|
162
|
+
}).map(item => item.name);
|
|
163
|
+
yield next();
|
|
164
|
+
})();
|
|
142
165
|
}
|
|
143
166
|
|
|
144
167
|
}
|
|
@@ -151,11 +174,7 @@ class ClientPlugin extends _server().Plugin {
|
|
|
151
174
|
getPinned(ctx, next) {
|
|
152
175
|
return _asyncToGenerator(function* () {
|
|
153
176
|
ctx.body = [{
|
|
154
|
-
component: '
|
|
155
|
-
pin: true
|
|
156
|
-
}, {
|
|
157
|
-
component: 'CollectionManagerShortcut',
|
|
158
|
-
pin: true
|
|
177
|
+
component: 'CollectionManagerShortcut'
|
|
159
178
|
}, {
|
|
160
179
|
component: 'ACLShortcut'
|
|
161
180
|
}, {
|
|
@@ -181,7 +200,7 @@ class ClientPlugin extends _server().Plugin {
|
|
|
181
200
|
}
|
|
182
201
|
|
|
183
202
|
if (process.env.APP_ENV !== 'production' && root) {
|
|
184
|
-
_this2.app.middleware.unshift( /*#__PURE__*/function () {
|
|
203
|
+
_this2.app.middleware.nodes.unshift( /*#__PURE__*/function () {
|
|
185
204
|
var _ref4 = _asyncToGenerator(function* (ctx, next) {
|
|
186
205
|
if (ctx.path.startsWith(_this2.app.resourcer.options.prefix)) {
|
|
187
206
|
return next();
|
|
@@ -204,10 +223,6 @@ class ClientPlugin extends _server().Plugin {
|
|
|
204
223
|
})();
|
|
205
224
|
}
|
|
206
225
|
|
|
207
|
-
getName() {
|
|
208
|
-
return this.getPackageName(__dirname);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
226
|
}
|
|
212
227
|
|
|
213
228
|
exports.ClientPlugin = ClientPlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0-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.
|
|
13
|
+
"@nocobase/server": "0.8.0-alpha.4"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@nocobase/test": "0.
|
|
16
|
+
"@nocobase/test": "0.8.0-alpha.4"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "433f068ce4479a53f51d3ceac3f22b710e7bb13e"
|
|
19
19
|
}
|