@apipass/common 0.0.20-alpha.0 → 0.0.21-alpha.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.
@@ -0,0 +1,4 @@
1
+ import { ValidationPipe } from '@nestjs/common';
2
+ export declare class APIPASSValidationPipe extends ValidationPipe {
3
+ constructor();
4
+ }
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ClassValidatorPipe = void 0;
3
+ exports.APIPASSValidationPipe = void 0;
4
4
  const common_1 = require("@nestjs/common");
5
5
  const _ = require("lodash");
6
- class ClassValidatorPipe {
7
- static getValidationPipe() {
8
- return new common_1.ValidationPipe({ transform: true, exceptionFactory: (errors) => {
6
+ class APIPASSValidationPipe extends common_1.ValidationPipe {
7
+ constructor() {
8
+ super({
9
+ transform: true,
10
+ exceptionFactory: (errors) => {
9
11
  const exceptions = [];
10
12
  errors.forEach(error => {
11
13
  for (const key of Object.keys(error.constraints)) {
@@ -16,8 +18,9 @@ class ClassValidatorPipe {
16
18
  }
17
19
  });
18
20
  return new common_1.BadRequestException(exceptions);
19
- } });
21
+ }
22
+ });
20
23
  }
21
24
  }
22
- exports.ClassValidatorPipe = ClassValidatorPipe;
23
- //# sourceMappingURL=class-validator.pipe.js.map
25
+ exports.APIPASSValidationPipe = APIPASSValidationPipe;
26
+ //# sourceMappingURL=apipass-validation-pipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apipass-validation-pipe.js","sourceRoot":"","sources":["../../src/class-validator/apipass-validation-pipe.ts"],"names":[],"mappings":";;;AAAA,2CAAqE;AACrE,4BAA2B;AAE3B,MAAa,qBAAsB,SAAQ,uBAAc;IACvD;QACE,KAAK,CAAC;YACJ,SAAS,EAAE,IAAI;YACf,gBAAgB,EAAE,CAAC,MAAa,EAAE,EAAE;gBAClC,MAAM,UAAU,GAAQ,EAAE,CAAC;gBAC3B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;oBACrB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;wBAChD,UAAU,CAAC,IAAI,CAAC;4BACd,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE;4BACpC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;yBAChC,CAAC,CAAA;qBACH;gBACH,CAAC,CAAC,CAAC;gBACH,OAAO,IAAI,4BAAmB,CAAC,UAAU,CAAC,CAAC;YAC7C,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAlBD,sDAkBC"}
package/lib/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './environment/environment';
2
2
  export * from './either/either';
3
- export * from './class-validator/class-validator.pipe';
3
+ export * from './class-validator/apipass-validation-pipe';
package/lib/index.js CHANGED
@@ -16,5 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./environment/environment"), exports);
18
18
  __exportStar(require("./either/either"), exports);
19
- __exportStar(require("./class-validator/class-validator.pipe"), exports);
19
+ __exportStar(require("./class-validator/apipass-validation-pipe"), exports);
20
20
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,kDAAgC;AAChC,yEAAuD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,kDAAgC;AAChC,4EAA0D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apipass/common",
3
- "version": "0.0.20-alpha.0",
3
+ "version": "0.0.21-alpha.0",
4
4
  "description": "> TODO: description",
5
5
  "author": "Nathan Lemos <nathan@apipass.com.br>",
6
6
  "license": "ISC",
@@ -27,5 +27,5 @@
27
27
  "@types/lodash": "^4.14.191",
28
28
  "tunnel-ssh": "4.1.6"
29
29
  },
30
- "gitHead": "c4c075c8fdd09dbac48fcc55c2b787f9a0db2445"
30
+ "gitHead": "b2cc2d89eec334b30d56b69edf8bcd9ad2d5737b"
31
31
  }
@@ -1,4 +0,0 @@
1
- import { ValidationPipe } from '@nestjs/common';
2
- export declare class ClassValidatorPipe {
3
- static getValidationPipe(): ValidationPipe;
4
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"class-validator.pipe.js","sourceRoot":"","sources":["../../src/class-validator/class-validator.pipe.ts"],"names":[],"mappings":";;;AAAA,2CAAqE;AACrE,4BAA2B;AAE3B,MAAa,kBAAkB;IAEpB,MAAM,CAAC,iBAAiB;QAC3B,OAAO,IAAI,uBAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,MAAa,EAAE,EAAE;gBAC7E,MAAM,UAAU,GAAQ,EAAE,CAAC;gBAC3B,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;oBACrB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;wBAChD,UAAU,CAAC,IAAI,CAAC;4BACd,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE;4BACpC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC;yBAChC,CAAC,CAAA;qBACH;gBACH,CAAC,CAAC,CAAC;gBACH,OAAO,IAAI,4BAAmB,CAAC,UAAU,CAAC,CAAC;YAC7C,CAAC,EAAC,CACH,CAAA;IACL,CAAC;CAEJ;AAlBD,gDAkBC"}