@asapjs/router 0.1.7 → 0.1.8
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/utils/wrapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/utils/wrapper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAG1D,aAAK,QAAQ,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEnH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE;IACjD,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,CAAC,EAAE,CAAC,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAClC,KAAK,EAAE,CAAC,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAClC,IAAI,EAAE,CAAC,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACjC,KAAK,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC/B,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,QAAQ,CAsCrF"}
|
package/dist/utils/wrapper.js
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -9,6 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
32
|
});
|
|
10
33
|
};
|
|
11
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
const Sentry = __importStar(require("@sentry/node"));
|
|
12
36
|
const core_1 = require("@asapjs/core");
|
|
13
37
|
function Wrapper(cb) {
|
|
14
38
|
return function _Wrapper(req, res, next) {
|
|
@@ -26,11 +50,17 @@ function Wrapper(cb) {
|
|
|
26
50
|
res.status(200).json(output);
|
|
27
51
|
}
|
|
28
52
|
catch (err) {
|
|
29
|
-
console.log(err);
|
|
30
53
|
core_1.logger.error('[SERVER ERROR]', err);
|
|
31
54
|
if (err.status === 500 || err.status === undefined) {
|
|
32
55
|
const status = 500;
|
|
33
56
|
const message = '알 수 없는 오류가 발생했습니다.';
|
|
57
|
+
if ((0, core_1.getConfig)().sentry !== undefined) {
|
|
58
|
+
const eventId = Sentry.captureException(err);
|
|
59
|
+
res.status(status).json({
|
|
60
|
+
eventId,
|
|
61
|
+
message,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
34
64
|
return res.status(status).json({
|
|
35
65
|
status,
|
|
36
66
|
message,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../src/utils/wrapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../src/utils/wrapper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AAEvC,uCAAiD;AAajD,SAAwB,OAAO,CAAC,EAA2C;IACzE,OAAO,SAAe,QAAQ,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB;;YAC5E,IAAI;gBACF,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;gBACtB,MAAM,IAAI,GAAgB;oBACxB,GAAG;oBACH,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,IAAI,EAAE,GAAG,CAAC,MAAM;oBAChB,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,IAAI;iBACL,CAAC;gBACF,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC;gBAC9B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aAC9B;YAAC,OAAO,GAAG,EAAE;gBACZ,aAAM,CAAC,KAAK,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;gBACpC,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS,EAAE;oBAClD,MAAM,MAAM,GAAG,GAAG,CAAC;oBACnB,MAAM,OAAO,GAAG,oBAAoB,CAAC;oBAErC,IAAK,IAAA,gBAAS,GAAU,CAAC,MAAM,KAAK,SAAS,EAAE;wBAC7C,MAAM,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;wBAC7C,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;4BACtB,OAAO;4BACP,OAAO;yBACR,CAAC,CAAC;qBACJ;oBAED,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;wBAC7B,MAAM;wBACN,OAAO;qBACR,CAAC,CAAC;iBACJ;gBACD,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC;oBACjC,MAAM,EAAE,GAAG,CAAC,MAAM;oBAClB,OAAO,EAAE,GAAG,CAAC,OAAO;iBACrB,CAAC,CAAC;aACJ;QACH,CAAC;KAAA,CAAC;AACJ,CAAC;AAtCD,0BAsCC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asapjs/router",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
+
"@sentry/node": "^6.19.7",
|
|
13
14
|
"body-parser": "^1.19.2",
|
|
14
15
|
"cors": "^2.8.5",
|
|
15
16
|
"express": "^4.17.3",
|