@midwayjs/upload 4.0.0-beta.7 → 4.0.0-beta.9
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/dist/configuration.js +2 -0
- package/dist/interface.d.ts +0 -1
- package/dist/middleware.d.ts +0 -2
- package/dist/middleware.js +14 -12
- package/dist/parse.d.ts +0 -3
- package/package.json +8 -8
package/dist/configuration.js
CHANGED
|
@@ -15,6 +15,8 @@ const DefaultConfig = require("./config/config.default");
|
|
|
15
15
|
const middleware_1 = require("./middleware");
|
|
16
16
|
const utils_1 = require("./utils");
|
|
17
17
|
let UploadConfiguration = class UploadConfiguration {
|
|
18
|
+
applicationManager;
|
|
19
|
+
uploadConfig;
|
|
18
20
|
async onReady() {
|
|
19
21
|
const { tmpdir, cleanTimeout } = this.uploadConfig;
|
|
20
22
|
if (tmpdir) {
|
package/dist/interface.d.ts
CHANGED
package/dist/middleware.d.ts
CHANGED
package/dist/middleware.js
CHANGED
|
@@ -21,18 +21,20 @@ const file_type_1 = require("file-type");
|
|
|
21
21
|
const utils_1 = require("./utils");
|
|
22
22
|
const { unlink, writeFile } = fs_1.promises;
|
|
23
23
|
let UploadMiddleware = class UploadMiddleware {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
uploadConfig;
|
|
25
|
+
logger;
|
|
26
|
+
/**
|
|
27
|
+
* cache global upload white list when uploadConfig.whitelist is set
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
30
|
+
uploadWhiteListMap = new Map();
|
|
31
|
+
/**
|
|
32
|
+
* cache global upload mime type white list when uploadConfig.mimeTypeWhiteList is set
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
35
|
+
uploadFileMimeTypeMap = new Map();
|
|
36
|
+
match;
|
|
37
|
+
ignore;
|
|
36
38
|
async init() {
|
|
37
39
|
if (this.uploadConfig.match) {
|
|
38
40
|
this.match = [].concat(this.uploadConfig.match || []);
|
package/dist/parse.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
/// <reference types="node" />
|
|
4
1
|
import { Readable } from 'stream';
|
|
5
2
|
import { UploadFileInfo, UploadOptions } from './interface';
|
|
6
3
|
export declare const parseMultipart: (body: any, boundary: string, uploadConfig: UploadOptions) => Promise<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/upload",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.9",
|
|
4
4
|
"description": "Midway Component for upload",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"raw-body": "2.5.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@midwayjs/core": "^4.0.0-beta.
|
|
30
|
-
"@midwayjs/express": "^4.0.0-beta.
|
|
31
|
-
"@midwayjs/faas": "^4.0.0-beta.
|
|
32
|
-
"@midwayjs/koa": "^4.0.0-beta.
|
|
33
|
-
"@midwayjs/mock": "^4.0.0-beta.
|
|
34
|
-
"@midwayjs/web": "^4.0.0-beta.
|
|
29
|
+
"@midwayjs/core": "^4.0.0-beta.9",
|
|
30
|
+
"@midwayjs/express": "^4.0.0-beta.9",
|
|
31
|
+
"@midwayjs/faas": "^4.0.0-beta.9",
|
|
32
|
+
"@midwayjs/koa": "^4.0.0-beta.9",
|
|
33
|
+
"@midwayjs/mock": "^4.0.0-beta.9",
|
|
34
|
+
"@midwayjs/web": "^4.0.0-beta.9"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "771e83974ef9f3d78c296e4ee0c8c68db44f6b31"
|
|
37
37
|
}
|