@furkanogutcu/nest-common 1.0.1 → 1.0.2

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.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # NestJS Common
1
+ # nest-common
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@furkanogutcu/nest-common.svg)](https://www.npmjs.com/package/@furkanogutcu/nest-common)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -1,4 +1,8 @@
1
1
  import { AppException } from './app.exception';
2
+ import { ExceptionCode } from './reference/exception-code.reference';
2
3
  export declare class AppTooManyRequestException extends AppException {
3
- constructor();
4
+ constructor({ message, code, }?: {
5
+ message?: string;
6
+ code?: ExceptionCode;
7
+ });
4
8
  }
@@ -5,10 +5,10 @@ const common_1 = require("@nestjs/common");
5
5
  const app_exception_1 = require("./app.exception");
6
6
  const exception_code_reference_1 = require("./reference/exception-code.reference");
7
7
  class AppTooManyRequestException extends app_exception_1.AppException {
8
- constructor() {
8
+ constructor({ message = 'You have exceeded the number of allowed requests. Please try again later.', code, } = {}) {
9
9
  super({
10
- message: 'You have exceeded the number of allowed requests. Please try again later.',
11
- code: exception_code_reference_1.ExceptionCode.RateLimit,
10
+ message,
11
+ code: code || exception_code_reference_1.ExceptionCode.RateLimit,
12
12
  httpCode: common_1.HttpStatus.TOO_MANY_REQUESTS,
13
13
  });
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"too-many-request.exception.js","sourceRoot":"","sources":["../../src/exceptions/too-many-request.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAC/C,mFAAqE;AAErE,MAAa,0BAA2B,SAAQ,4BAAY;IAC1D;QACE,KAAK,CAAC;YACJ,OAAO,EAAE,2EAA2E;YACpF,IAAI,EAAE,wCAAa,CAAC,SAAS;YAC7B,QAAQ,EAAE,mBAAU,CAAC,iBAAiB;SACvC,CAAC,CAAC;IACL,CAAC;CACF;AARD,gEAQC"}
1
+ {"version":3,"file":"too-many-request.exception.js","sourceRoot":"","sources":["../../src/exceptions/too-many-request.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA4C;AAE5C,mDAA+C;AAC/C,mFAAqE;AAErE,MAAa,0BAA2B,SAAQ,4BAAY;IAC1D,YAAY,EACV,OAAO,GAAG,2EAA2E,EACrF,IAAI,MAC0C,EAAE;QAChD,KAAK,CAAC;YACJ,OAAO;YACP,IAAI,EAAE,IAAI,IAAI,wCAAa,CAAC,SAAS;YACrC,QAAQ,EAAE,mBAAU,CAAC,iBAAiB;SACvC,CAAC,CAAC;IACL,CAAC;CACF;AAXD,gEAWC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@furkanogutcu/nest-common",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Package of common structures for NestJS.",
5
5
  "author": "Furkan Ogutcu",
6
6
  "license": "MIT",