@midwayjs/upload 4.0.0-beta.6 → 4.0.0-beta.8

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.
@@ -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) {
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { Readable } from 'stream';
3
2
  import { IgnoreMatcher, IMidwayContext } from '@midwayjs/core';
4
3
  export type UploadMode = 'stream' | 'file';
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { IMiddleware, ILogger, IgnoreMatcher } from '@midwayjs/core';
4
2
  import { UploadOptions } from '.';
5
3
  export declare class UploadMiddleware implements IMiddleware<any, any> {
@@ -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
- constructor() {
25
- /**
26
- * cache global upload white list when uploadConfig.whitelist is set
27
- * @private
28
- */
29
- this.uploadWhiteListMap = new Map();
30
- /**
31
- * cache global upload mime type white list when uploadConfig.mimeTypeWhiteList is set
32
- * @private
33
- */
34
- this.uploadFileMimeTypeMap = new Map();
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.6",
3
+ "version": "4.0.0-beta.8",
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.6",
30
- "@midwayjs/express": "^4.0.0-beta.6",
31
- "@midwayjs/faas": "^4.0.0-beta.6",
32
- "@midwayjs/koa": "^4.0.0-beta.6",
33
- "@midwayjs/mock": "^4.0.0-beta.6",
34
- "@midwayjs/web": "^4.0.0-beta.6"
29
+ "@midwayjs/core": "^4.0.0-beta.8",
30
+ "@midwayjs/express": "^4.0.0-beta.8",
31
+ "@midwayjs/faas": "^4.0.0-beta.8",
32
+ "@midwayjs/koa": "^4.0.0-beta.8",
33
+ "@midwayjs/mock": "^4.0.0-beta.8",
34
+ "@midwayjs/web": "^4.0.0-beta.8"
35
35
  },
36
- "gitHead": "a02425777d044ec502d050993bc256dc26d5b586"
36
+ "gitHead": "355e55949fdd132b0bdcb4830222a0a027e92ded"
37
37
  }