@midwayjs/busboy 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.
@@ -16,6 +16,8 @@ const constants_1 = require("./constants");
16
16
  const path_1 = require("path");
17
17
  const os_1 = require("os");
18
18
  let BusboyConfiguration = class BusboyConfiguration {
19
+ uploadConfig;
20
+ logger;
19
21
  async onReady() {
20
22
  const { tmpdir, cleanTimeout, mode } = this.uploadConfig;
21
23
  if (mode === 'file' && 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
  import { BusboyConfig } from 'busboy';
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { IMiddleware, ILogger, IgnoreMatcher, IMidwayApplication } from '@midwayjs/core';
4
2
  import { UploadOptions, UploadMode } from './interface';
5
3
  import { BusboyConfig } from 'busboy';
@@ -22,18 +22,20 @@ const busboy = require("busboy");
22
22
  const constants_1 = require("./constants");
23
23
  const { unlink, writeFile } = fs_1.promises;
24
24
  let UploadMiddleware = class UploadMiddleware {
25
- constructor() {
26
- /**
27
- * cache global upload white list when uploadConfig.whitelist is set
28
- * @private
29
- */
30
- this.uploadWhiteListMap = new Map();
31
- /**
32
- * cache global upload mime type white list when uploadConfig.mimeTypeWhiteList is set
33
- * @private
34
- */
35
- this.uploadFileMimeTypeMap = new Map();
36
- }
25
+ uploadConfig;
26
+ logger;
27
+ /**
28
+ * cache global upload white list when uploadConfig.whitelist is set
29
+ * @private
30
+ */
31
+ uploadWhiteListMap = new Map();
32
+ /**
33
+ * cache global upload mime type white list when uploadConfig.mimeTypeWhiteList is set
34
+ * @private
35
+ */
36
+ uploadFileMimeTypeMap = new Map();
37
+ match;
38
+ ignore;
37
39
  async init() {
38
40
  if (this.uploadConfig.match) {
39
41
  this.match = [].concat(this.uploadConfig.match || []);
package/dist/parse.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import { UploadOptions } from './interface';
4
2
  export declare const parseMultipart: (body: any, boundary: string, uploadConfig: UploadOptions) => Promise<{
5
3
  files: any[];
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { Readable } from 'stream';
3
2
  export declare const autoRemoveUploadTmpFile: (tmpDir: string, cleanTimeout: number) => Promise<void>;
4
3
  export declare const stopAutoRemoveUploadTmpFile: () => Promise<void>;
package/dist/utils.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.streamToAsyncIterator = exports.formatExt = exports.ensureDir = exports.checkExists = exports.stopAutoRemoveUploadTmpFile = exports.autoRemoveUploadTmpFile = void 0;
3
+ exports.formatExt = exports.ensureDir = exports.checkExists = exports.stopAutoRemoveUploadTmpFile = exports.autoRemoveUploadTmpFile = void 0;
4
+ exports.streamToAsyncIterator = streamToAsyncIterator;
4
5
  const fs_1 = require("fs");
5
6
  const path_1 = require("path");
6
7
  const { readdir, access, stat, unlink, mkdir } = fs_1.promises;
@@ -93,5 +94,4 @@ async function* streamToAsyncIterator(stream) {
93
94
  yield chunk;
94
95
  }
95
96
  }
96
- exports.streamToAsyncIterator = streamToAsyncIterator;
97
97
  //# sourceMappingURL=utils.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/busboy",
3
- "version": "4.0.0-beta.7",
3
+ "version": "4.0.0-beta.9",
4
4
  "description": "Midway Component for Busboy (multipart form data parser)",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",
@@ -27,14 +27,17 @@
27
27
  "file-type": "16.5.4"
28
28
  },
29
29
  "devDependencies": {
30
- "@midwayjs/core": "^4.0.0-beta.7",
31
- "@midwayjs/express": "^4.0.0-beta.7",
32
- "@midwayjs/faas": "^4.0.0-beta.7",
33
- "@midwayjs/fc-starter": "^4.0.0-beta.7",
34
- "@midwayjs/koa": "^4.0.0-beta.7",
35
- "@midwayjs/mock": "^4.0.0-beta.7",
36
- "@midwayjs/web": "^4.0.0-beta.7",
37
- "fs-extra": "11.2.0"
30
+ "@midwayjs/core": "^4.0.0-beta.9",
31
+ "@midwayjs/express": "^4.0.0-beta.9",
32
+ "@midwayjs/faas": "^4.0.0-beta.9",
33
+ "@midwayjs/fc-starter": "^4.0.0-beta.9",
34
+ "@midwayjs/koa": "^4.0.0-beta.9",
35
+ "@midwayjs/mock": "^4.0.0-beta.9",
36
+ "@midwayjs/validation": "^4.0.0-beta.9",
37
+ "@midwayjs/validation-zod": "^4.0.0-beta.9",
38
+ "@midwayjs/web": "^4.0.0-beta.9",
39
+ "fs-extra": "11.3.2",
40
+ "zod": "3.25.76"
38
41
  },
39
- "gitHead": "6a221788112b4d998b3958e0a275579f42816c59"
42
+ "gitHead": "771e83974ef9f3d78c296e4ee0c8c68db44f6b31"
40
43
  }