@duvdu-v1/duvdu 1.1.215 → 1.1.216

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.
@@ -6,5 +6,11 @@ interface UploadOptions {
6
6
  maxSize?: number;
7
7
  fileFilter?(req: Request, file: Express.Multer.File, callback: multer.FileFilterCallback): void;
8
8
  }
9
- export declare const globalUploadMiddleware: (folder: string, options?: UploadOptions) => import("express").RequestHandler<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
9
+ export declare const globalUploadMiddleware: (folder: string, options?: UploadOptions) => {
10
+ single: (fieldName: string) => import("express").RequestHandler<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
11
+ array: (fieldName: string, maxCount?: number | undefined) => import("express").RequestHandler<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
12
+ fields: (fields: readonly multer.Field[]) => import("express").RequestHandler<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
13
+ none: () => import("express").RequestHandler<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
14
+ any: () => import("express").RequestHandler<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
15
+ };
10
16
  export {};
@@ -23,7 +23,7 @@ const globalUploadMiddleware = (folder, options) => {
23
23
  // Call original memory storage handler
24
24
  storage._handleFile(req, file, cb);
25
25
  };
26
- return (0, multer_1.default)({
26
+ const upload = (0, multer_1.default)({
27
27
  storage: customStorage,
28
28
  limits: {
29
29
  fileSize: (options === null || options === void 0 ? void 0 : options.maxSize) || 3 * 1024 * 1024 // 3MB default
@@ -51,6 +51,13 @@ const globalUploadMiddleware = (folder, options) => {
51
51
  }, 'en'));
52
52
  }
53
53
  },
54
- }).any();
54
+ });
55
+ return {
56
+ single: upload.single.bind(upload),
57
+ array: upload.array.bind(upload),
58
+ fields: upload.fields.bind(upload),
59
+ none: upload.none.bind(upload),
60
+ any: upload.any.bind(upload)
61
+ };
55
62
  };
56
63
  exports.globalUploadMiddleware = globalUploadMiddleware;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duvdu-v1/duvdu",
3
- "version": "1.1.215",
3
+ "version": "1.1.216",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [