@apipass/common 0.0.25-alpha.0 → 0.0.27-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 @@
1
+ export declare const PlainBody: (...dataOrPipes: any[]) => ParameterDecorator;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PlainBody = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const rawBody = require("raw-body");
15
+ exports.PlainBody = (0, common_1.createParamDecorator)((_, context) => __awaiter(void 0, void 0, void 0, function* () {
16
+ const req = context.switchToHttp().getRequest();
17
+ if (!req.readable) {
18
+ throw new common_1.BadRequestException('Invalid body');
19
+ }
20
+ return (yield rawBody(req)).toString('utf8').trim();
21
+ }));
22
+ //# sourceMappingURL=plain-body.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plain-body.decorator.js","sourceRoot":"","sources":["../../src/decorator/plain-body.decorator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2F;AAC3F,oCAAoC;AAEvB,QAAA,SAAS,GAAG,IAAA,6BAAoB,EAAC,CAAO,CAAC,EAAE,OAAyB,EAAE,EAAE;IACjF,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAA6B,CAAC;IAC3E,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE;QAAE,MAAM,IAAI,4BAAmB,CAAC,cAAc,CAAC,CAAC;KAAE;IACrE,OAAO,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;AACxD,CAAC,CAAA,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { RequestMethod } from "@nestjs/common";
2
+ export declare function Sse(method?: RequestMethod, path?: string): MethodDecorator;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Sse = void 0;
4
+ const constants_1 = require("@nestjs/common/constants");
5
+ const common_1 = require("@nestjs/common");
6
+ function Sse(method, path) {
7
+ return (target, key, descriptor) => {
8
+ path = path && path.length ? path : '/';
9
+ method = method ? method : common_1.RequestMethod.GET;
10
+ Reflect.defineMetadata(constants_1.PATH_METADATA, path, descriptor.value);
11
+ Reflect.defineMetadata(constants_1.METHOD_METADATA, method, descriptor.value);
12
+ Reflect.defineMetadata(constants_1.SSE_METADATA, true, descriptor.value);
13
+ return descriptor;
14
+ };
15
+ }
16
+ exports.Sse = Sse;
17
+ //# sourceMappingURL=sse.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sse.decorator.js","sourceRoot":"","sources":["../../src/decorator/sse.decorator.ts"],"names":[],"mappings":";;;AAAA,wDAAsF;AACtF,2CAA6C;AAE7C,SAAgB,GAAG,CAAC,MAAsB,EAAE,IAAa;IACrD,OAAO,CACH,MAAc,EACd,GAAoB,EACpB,UAAwC,EAC1C,EAAE;QACA,IAAI,GAAG,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;QACxC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,sBAAa,CAAC,GAAG,CAAC;QAE7C,OAAO,CAAC,cAAc,CAAC,yBAAa,EAAE,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QAC9D,OAAO,CAAC,cAAc,CAClB,2BAAe,EACf,MAAM,EACN,UAAU,CAAC,KAAK,CACnB,CAAC;QACF,OAAO,CAAC,cAAc,CAAC,wBAAY,EAAE,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QAC7D,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC;AAlBD,kBAkBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apipass/common",
3
- "version": "0.0.25-alpha.0",
3
+ "version": "0.0.27-alpha.0",
4
4
  "description": "> TODO: description",
5
5
  "author": "Nathan Lemos <nathan@apipass.com.br>",
6
6
  "license": "ISC",
@@ -19,14 +19,16 @@
19
19
  "tsc": "tsc"
20
20
  },
21
21
  "dependencies": {
22
- "@nestjs/common": "9.2.1",
22
+ "@nestjs/common": "8.2.5",
23
23
  "class-transformer": "0.5.1",
24
24
  "class-validator": "0.13.2",
25
+ "express": "^4.18.2",
25
26
  "lodash": "4.17.21",
27
+ "raw-body": "^2.5.2",
26
28
  "tunnel-ssh": "4.1.6"
27
29
  },
28
30
  "devDependencies": {
29
31
  "@types/lodash": "^4.14.191"
30
32
  },
31
- "gitHead": "c27d4274eab59368182bd1317cc9c552e4793ef4"
33
+ "gitHead": "21d2ff1294c720dd3ec3be62d2c0a93fe4599d0d"
32
34
  }