@maioradv/nestjs-core 1.9.4 → 1.9.6

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.
@@ -8,16 +8,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
12
  exports.S3Service = void 0;
16
13
  const common_1 = require("@nestjs/common");
17
14
  const config_1 = require("@nestjs/config");
18
15
  const client_s3_1 = require("@aws-sdk/client-s3");
19
16
  const crypto_1 = require("crypto");
20
- const image_size_1 = __importDefault(require("image-size"));
17
+ const image_size_1 = require("image-size");
21
18
  let S3Service = class S3Service {
22
19
  constructor(config) {
23
20
  this.config = config;
@@ -47,7 +44,7 @@ let S3Service = class S3Service {
47
44
  Body: file.buffer,
48
45
  ContentType: file.mimetype
49
46
  }));
50
- const size = (0, image_size_1.default)(file.buffer);
47
+ const size = (0, image_size_1.imageSize)(file.buffer);
51
48
  const checksum = (0, crypto_1.createHash)('md5').update(file.buffer).digest("base64");
52
49
  return {
53
50
  src: `${this.sdkConfigs.baseUrl}/${this.sdkConfigs.folder}/${fileName}`,
@@ -1,5 +1,5 @@
1
1
  export declare const DEFAULT_MAX_IMAGE_SIZE = 10;
2
- export declare const DEFAULT_MIMETYPES_SUPPORT = ".(webp|avif|png|gif|jpeg|jpg)";
2
+ export declare const DEFAULT_MIMETYPES_SUPPORT: RegExp;
3
3
  export type ImagePipeValidatorOptions = {
4
4
  maxSize?: number;
5
5
  mimeTypes?: ('webp' | 'avif' | 'png' | 'gif' | 'jpeg' | 'jpg')[];
@@ -4,9 +4,9 @@ exports.ImagePipeValidator = exports.DEFAULT_MIMETYPES_SUPPORT = exports.DEFAULT
4
4
  const common_1 = require("@nestjs/common");
5
5
  exports.DEFAULT_MAX_IMAGE_SIZE = 10;
6
6
  //heic uploaded as application/octet-stream
7
- exports.DEFAULT_MIMETYPES_SUPPORT = '.(webp|avif|png|gif|jpeg|jpg)';
7
+ exports.DEFAULT_MIMETYPES_SUPPORT = /^image\/(webp|avif|png|gif|jpeg|jpg)$/;
8
8
  const ImagePipeValidator = (options) => new common_1.ParseFilePipeBuilder()
9
- .addFileTypeValidator({ fileType: options?.mimeTypes ? `.(${options.mimeTypes.join('|')})` : exports.DEFAULT_MIMETYPES_SUPPORT })
9
+ .addFileTypeValidator({ fileType: options?.mimeTypes ? new RegExp(`^image\\/(${options.mimeTypes.join("|")})$`) : exports.DEFAULT_MIMETYPES_SUPPORT })
10
10
  .addMaxSizeValidator({ maxSize: (options?.maxSize ?? exports.DEFAULT_MAX_IMAGE_SIZE) * 1e6 })
11
11
  .build({ errorHttpStatusCode: common_1.HttpStatus.UNPROCESSABLE_ENTITY });
12
12
  exports.ImagePipeValidator = ImagePipeValidator;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maioradv/nestjs-core",
3
- "version": "1.9.4",
3
+ "version": "1.9.6",
4
4
  "description": "NestJS helpers by MaiorADV",
5
5
  "repository": "https://github.com/maioradv/nestjs-core.git",
6
6
  "author": "Maior ADV Srl",
@@ -17,57 +17,55 @@
17
17
  "publish:npm": "npm publish --access public"
18
18
  },
19
19
  "dependencies": {
20
- "@aws-sdk/client-s3": "^3.608.0",
21
- "@maioradv/accounts-lib": "^1.2.4",
22
- "@nestjs/cache-manager": "^3.0.0",
23
- "@nestjs/common": "^11.0.4",
24
- "@nestjs/config": "^4.0.0",
25
- "@nestjs/graphql": "^13.0.2",
26
- "@nestjs/platform-express": "^11.0.4",
27
- "@nestjs/swagger": "^11.0.2",
28
- "@nestjs/throttler": "^6.3.0",
20
+ "@aws-sdk/client-s3": "^3.810.0",
21
+ "@maioradv/accounts-lib": "^1.3.0",
22
+ "@nestjs/cache-manager": "^3.0.1",
23
+ "@nestjs/common": "^11.1.1",
24
+ "@nestjs/config": "^4.0.2",
25
+ "@nestjs/graphql": "^13.1.0",
26
+ "@nestjs/platform-express": "^11.1.1",
27
+ "@nestjs/swagger": "^11.2.0",
28
+ "@nestjs/throttler": "^6.4.0",
29
29
  "@sentry/nestjs": "^9.19.0",
30
- "@sentry/profiling-node": "^9.19.0",
31
- "bcrypt": "^5.1.1",
30
+ "bcrypt": "^6.0.0",
32
31
  "class-transformer": "^0.5.1",
33
- "class-validator": "^0.14.1",
32
+ "class-validator": "^0.14.2",
34
33
  "handlebars": "^4.7.8",
35
- "image-size": "^1.1.1",
34
+ "image-size": "^2.0.2",
36
35
  "nest-winston": "^1.10.2",
37
- "nodemailer": "^6.9.14",
36
+ "nodemailer": "^7.0.3",
38
37
  "request-ip": "^3.3.0",
39
- "sharp": "^0.33.5",
38
+ "sharp": "^0.34.1",
40
39
  "winston": "^3.17.0",
41
40
  "winston-daily-rotate-file": "^5.0.0"
42
41
  },
43
42
  "devDependencies": {
44
43
  "@types/multer": "^1.4.12",
45
- "@types/node": "^22.10.7",
46
- "@types/nodemailer": "^6.4.15",
44
+ "@types/node": "^22.15.18",
45
+ "@types/nodemailer": "^6.4.17",
47
46
  "@types/request-ip": "^0.0.41",
48
47
  "ts-node": "^10.9.2",
49
- "typescript": "^5.7.3"
48
+ "typescript": "^5.8.3"
50
49
  },
51
50
  "peerDependencies": {
52
- "@aws-sdk/client-s3": "^3.608.0",
53
- "@maioradv/accounts-lib": "^1.2.4",
54
- "@nestjs/cache-manager": "^3.0.0",
55
- "@nestjs/common": "^11.0.4",
56
- "@nestjs/config": "^4.0.0",
57
- "@nestjs/graphql": "^13.0.2",
58
- "@nestjs/platform-express": "^11.0.4",
59
- "@nestjs/swagger": "^11.0.2",
60
- "@nestjs/throttler": "^6.3.0",
51
+ "@aws-sdk/client-s3": "^3.810.0",
52
+ "@maioradv/accounts-lib": "^1.3.0",
53
+ "@nestjs/cache-manager": "^3.0.1",
54
+ "@nestjs/common": "^11.1.1",
55
+ "@nestjs/config": "^4.0.2",
56
+ "@nestjs/graphql": "^13.1.0",
57
+ "@nestjs/platform-express": "^11.1.1",
58
+ "@nestjs/swagger": "^11.2.0",
59
+ "@nestjs/throttler": "^6.4.0",
61
60
  "@sentry/nestjs": "^9.19.0",
62
- "@sentry/profiling-node": "^9.19.0",
63
- "bcrypt": "^5.1.1",
61
+ "bcrypt": "^6.0.0",
64
62
  "class-transformer": "^0.5.1",
65
- "class-validator": "^0.14.1",
63
+ "class-validator": "^0.14.2",
66
64
  "handlebars": "^4.7.8",
67
- "image-size": "^1.1.1",
65
+ "image-size": "^2.0.2",
68
66
  "nest-winston": "^1.10.2",
69
- "nodemailer": "^6.9.14",
70
- "sharp": "^0.33.5",
67
+ "nodemailer": "^7.0.3",
68
+ "sharp": "^0.34.1",
71
69
  "winston": "^3.17.0",
72
70
  "winston-daily-rotate-file": "^5.0.0"
73
71
  },