@nocobase/plugin-file-manager 0.11.1-alpha.3 → 0.11.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.
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.createMiddleware = createMiddleware;
7
7
  exports.destroyMiddleware = destroyMiddleware;
8
- function _multer() {
9
- const data = _interopRequireDefault(require("@koa/multer"));
10
- _multer = function _multer() {
8
+ function _utils() {
9
+ const data = require("@nocobase/utils");
10
+ _utils = function _utils() {
11
11
  return data;
12
12
  };
13
13
  return data;
@@ -99,7 +99,7 @@ function _multipart() {
99
99
  },
100
100
  storage: storageConfig.make(storage)
101
101
  };
102
- const upload = (0, _multer().default)(multerOptions).single(_constants.FILE_FIELD_NAME);
102
+ const upload = (0, _utils().koaMulter)(multerOptions).single(_constants.FILE_FIELD_NAME);
103
103
  try {
104
104
  // NOTE: empty next and invoke after success
105
105
  yield upload(ctx, () => {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-file-manager",
3
- "version": "0.11.1-alpha.3",
3
+ "version": "0.11.1-alpha.4",
4
4
  "displayName": "file manager",
5
5
  "displayName.zh-CN": "文件管理",
6
6
  "description": "file management plugin.",
@@ -37,16 +37,16 @@
37
37
  "@formily/core": "2.2.26",
38
38
  "@formily/react": "2.2.26",
39
39
  "@formily/shared": "2.2.26",
40
- "@nocobase/actions": "0.11.1-alpha.3",
41
- "@nocobase/client": "0.11.1-alpha.3",
42
- "@nocobase/database": "0.11.1-alpha.3",
43
- "@nocobase/server": "0.11.1-alpha.3",
44
- "@nocobase/test": "0.11.1-alpha.3",
45
- "@nocobase/utils": "0.11.1-alpha.3",
40
+ "@nocobase/actions": "0.11.1-alpha.4",
41
+ "@nocobase/client": "0.11.1-alpha.4",
42
+ "@nocobase/database": "0.11.1-alpha.4",
43
+ "@nocobase/server": "0.11.1-alpha.4",
44
+ "@nocobase/test": "0.11.1-alpha.4",
45
+ "@nocobase/utils": "0.11.1-alpha.4",
46
46
  "antd": "^5.6.4",
47
47
  "react": "^18.2.0",
48
48
  "react-i18next": "^11.15.1",
49
49
  "supertest": "^6.1.6"
50
50
  },
51
- "gitHead": "5ed3bd7d5b16bd38d268961b34875d5cd45799ef"
51
+ "gitHead": "d9b5bde913013f1057e1aab49587eb0ad3dcb06e"
52
52
  }
@@ -1,5 +1,5 @@
1
- import multer from '@koa/multer';
2
- import actions, { Context, Next } from '@nocobase/actions';
1
+ import { Context, Next } from '@nocobase/actions';
2
+ import { koaMulter as multer } from '@nocobase/utils';
3
3
  import path from 'path';
4
4
 
5
5
  import { DEFAULT_MAX_FILE_SIZE, FILE_FIELD_NAME, LIMIT_FILES } from '../constants';