@armi-wave/common 1.20.0 → 1.22.0

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,6 +6,6 @@ export default class RequestValidationError extends CustomError {
6
6
  constructor(errors: ValidationError[]);
7
7
  serializeErrors(): {
8
8
  message: any;
9
- field: string;
9
+ field: any;
10
10
  }[];
11
11
  }
package/build/index.d.ts CHANGED
@@ -15,4 +15,4 @@ export * from './middlewares/error-handler';
15
15
  export * from './middlewares/require-auth';
16
16
  export * from './middlewares/validate-request';
17
17
  export { minioClient, ensureBucketExists } from './utils/minioClient';
18
- export * from './utils/multerConfig';
18
+ export { upload } from './utils/multerConfig';
package/build/index.js CHANGED
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.ensureBucketExists = exports.minioClient = exports.RequestValidationError = exports.NotFoundError = exports.NotAuthorizedError = exports.CustomError = exports.DatabaseConnectionError = exports.BadRequestError = exports.Reply = exports.Comment = exports.Post = exports.User = void 0;
20
+ exports.upload = exports.ensureBucketExists = exports.minioClient = exports.RequestValidationError = exports.NotFoundError = exports.NotAuthorizedError = exports.CustomError = exports.DatabaseConnectionError = exports.BadRequestError = exports.Reply = exports.Comment = exports.Post = exports.User = void 0;
21
21
  const User_1 = __importDefault(require("./models/User"));
22
22
  exports.User = User_1.default;
23
23
  const Post_1 = __importDefault(require("./models/Post"));
@@ -45,4 +45,5 @@ __exportStar(require("./middlewares/validate-request"), exports);
45
45
  var minioClient_1 = require("./utils/minioClient");
46
46
  Object.defineProperty(exports, "minioClient", { enumerable: true, get: function () { return minioClient_1.minioClient; } });
47
47
  Object.defineProperty(exports, "ensureBucketExists", { enumerable: true, get: function () { return minioClient_1.ensureBucketExists; } });
48
- __exportStar(require("./utils/multerConfig"), exports);
48
+ var multerConfig_1 = require("./utils/multerConfig");
49
+ Object.defineProperty(exports, "upload", { enumerable: true, get: function () { return multerConfig_1.upload; } });
@@ -14,5 +14,5 @@ declare global {
14
14
  }
15
15
  }
16
16
  }
17
- export declare const currentUser: (req: Request, res: Response, next: NextFunction) => void;
17
+ export declare const currentUser: (req: Request, res: Response, next: NextFunction) => any;
18
18
  export {};
@@ -1,2 +1,2 @@
1
1
  import { Request, Response, NextFunction } from 'express';
2
- export declare const errorHandler: (err: Error, req: Request, res: Response, next: NextFunction) => Response<any, Record<string, any>> | undefined;
2
+ export declare const errorHandler: (err: Error, req: Request, res: Response, next: NextFunction) => any;
@@ -6,8 +6,9 @@ interface UserAttributes {
6
6
  username: string;
7
7
  password: string;
8
8
  name: string;
9
- accountType: AccountType;
10
9
  surname: string;
10
+ profilePicUr?: string;
11
+ accountType: AccountType;
11
12
  followers?: number;
12
13
  following?: number;
13
14
  postsNr?: number;
@@ -39,8 +40,9 @@ interface UserDocument extends mongoose.Document {
39
40
  username: string;
40
41
  password: string;
41
42
  name: string;
42
- accountType: AccountType;
43
43
  surname: string;
44
+ profilePicUrl: string;
45
+ accountType: AccountType;
44
46
  followers: number;
45
47
  following: number;
46
48
  postsNr: number;
@@ -20,8 +20,9 @@ const userSchema = new mongoose_1.default.Schema({
20
20
  username: { type: String, required: true, unique: true },
21
21
  password: { type: String, required: true },
22
22
  name: { type: String, required: true },
23
- accountType: { type: String, required: true },
24
23
  surname: { type: String, required: true },
24
+ profilePicUrl: { type: String, required: false },
25
+ accountType: { type: String, required: true },
25
26
  followers: { type: Number, required: false, default: 0 },
26
27
  following: { type: Number, required: false, default: 0 },
27
28
  postsNr: { type: Number, required: false, default: 0 },
@@ -1,4 +1,3 @@
1
- import { Client } from 'minio';
2
- declare const minioClient: Client;
1
+ declare const minioClient: any;
3
2
  declare const ensureBucketExists: (bucketName: string) => Promise<void>;
4
3
  export { minioClient, ensureBucketExists };
@@ -1,3 +1,2 @@
1
- import multer from 'multer';
2
- declare const upload: multer.Multer;
3
- export default upload;
1
+ declare const upload: any;
2
+ export { upload };
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.upload = void 0;
6
7
  const multer_1 = __importDefault(require("multer"));
7
8
  // Use memory storage to avoid saving files locally
8
9
  const storage = multer_1.default.memoryStorage();
@@ -20,4 +21,4 @@ const upload = (0, multer_1.default)({
20
21
  }
21
22
  },
22
23
  });
23
- exports.default = upload;
24
+ exports.upload = upload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@armi-wave/common",
3
- "version": "1.20.0",
3
+ "version": "1.22.0",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",