@duvdu-v1/duvdu 1.0.54 → 1.1.1

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.
@@ -1,3 +1,3 @@
1
1
  /// <reference types="qs" />
2
2
  /// <reference types="express" />
3
- export declare const uploadProjectMedia: () => import("express").RequestHandler<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
3
+ export declare const uploadProjectMedia: (folder: string) => import("express").RequestHandler<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>;
@@ -8,10 +8,9 @@ const crypto_1 = __importDefault(require("crypto"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const multer_1 = __importDefault(require("multer"));
10
10
  const bad_request_error_1 = require("../errors/bad-request-error");
11
- const folders_1 = require("../types/folders");
12
- const uploadProjectMedia = () => (0, multer_1.default)({
11
+ const uploadProjectMedia = (folder) => (0, multer_1.default)({
13
12
  storage: multer_1.default.diskStorage({
14
- destination: path_1.default.join(__dirname, `../../../../../media/${folders_1.FOLDERS.portfolio_post}`),
13
+ destination: path_1.default.join(__dirname, `../../../../../media/${folder}`),
15
14
  filename(req, file, callback) {
16
15
  callback(null, `${Date.now()}_${crypto_1.default.randomBytes(6).toString('hex')}.${file.originalname.split('.').at(-1)}`);
17
16
  },
@@ -1,3 +1,6 @@
1
+ /// <reference types="express-serve-static-core" />
2
+ /// <reference types="multer" />
3
+ /// <reference types="express-session" />
1
4
  export declare const Files: {
2
5
  saveFiles: (folder: string, ...files: (Express.Multer.File | undefined)[]) => void;
3
6
  removeFiles: (...filePaths: (string | undefined)[]) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duvdu-v1/duvdu",
3
- "version": "1.0.54",
3
+ "version": "1.1.1",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [
@@ -9,6 +9,7 @@
9
9
  "scripts": {
10
10
  "clean": "rimraf ./build",
11
11
  "build": "npm run clean && tsc",
12
+ "fix:build": "mv ./build/common/src/* ./build && rm -rf ./build/auth ./build/portfolio-post ./build/common",
12
13
  "pub": "git add . && git commit -m \"updates\" && npm version patch && npm run build && npm publish",
13
14
  "lint": "eslint .",
14
15
  "lint:fix": "eslint --fix .",