@gustavo-valsechi/node 1.0.26 → 1.0.28
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/dist/index.js +5 -8
- package/dist/index.mjs +5 -8
- package/dist/src/router/index.js +5 -8
- package/dist/src/router/index.mjs +5 -8
- package/dist/src/server/index.js +5 -8
- package/dist/src/server/index.mjs +5 -8
- package/dist/src/tools/index.js +5 -8
- package/dist/src/tools/index.mjs +5 -8
- package/package.json +5 -3
package/dist/index.js
CHANGED
|
@@ -86,15 +86,12 @@ var import_utils = __toESM(require("@gustavo-valsechi/utils"));
|
|
|
86
86
|
var responseWrapper = async (res, promise) => {
|
|
87
87
|
return promise.then(async (data) => {
|
|
88
88
|
res.status(200).send(await import_utils.default.cryptor.encrypt(data));
|
|
89
|
-
}).catch((
|
|
89
|
+
}).catch((error) => {
|
|
90
90
|
var _a;
|
|
91
|
-
const status =
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
code: err.code,
|
|
96
|
-
response: ((_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data) || err.message
|
|
97
|
-
});
|
|
91
|
+
const status = error.statusCode || 500;
|
|
92
|
+
let response = ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) || (error == null ? void 0 : error.message) || error;
|
|
93
|
+
console.error("\u{1F534} Request error", (error == null ? void 0 : error.response) || response);
|
|
94
|
+
return res.status(status).send({ statusCode: status, code: error.code, response });
|
|
98
95
|
});
|
|
99
96
|
};
|
|
100
97
|
|
package/dist/index.mjs
CHANGED
|
@@ -45,15 +45,12 @@ import Utils from "@gustavo-valsechi/utils";
|
|
|
45
45
|
var responseWrapper = async (res, promise) => {
|
|
46
46
|
return promise.then(async (data) => {
|
|
47
47
|
res.status(200).send(await Utils.cryptor.encrypt(data));
|
|
48
|
-
}).catch((
|
|
48
|
+
}).catch((error) => {
|
|
49
49
|
var _a;
|
|
50
|
-
const status =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
code: err.code,
|
|
55
|
-
response: ((_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data) || err.message
|
|
56
|
-
});
|
|
50
|
+
const status = error.statusCode || 500;
|
|
51
|
+
let response = ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) || (error == null ? void 0 : error.message) || error;
|
|
52
|
+
console.error("\u{1F534} Request error", (error == null ? void 0 : error.response) || response);
|
|
53
|
+
return res.status(status).send({ statusCode: status, code: error.code, response });
|
|
57
54
|
});
|
|
58
55
|
};
|
|
59
56
|
|
package/dist/src/router/index.js
CHANGED
|
@@ -40,15 +40,12 @@ var import_utils = __toESM(require("@gustavo-valsechi/utils"));
|
|
|
40
40
|
var responseWrapper = async (res, promise) => {
|
|
41
41
|
return promise.then(async (data) => {
|
|
42
42
|
res.status(200).send(await import_utils.default.cryptor.encrypt(data));
|
|
43
|
-
}).catch((
|
|
43
|
+
}).catch((error) => {
|
|
44
44
|
var _a;
|
|
45
|
-
const status =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
code: err.code,
|
|
50
|
-
response: ((_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data) || err.message
|
|
51
|
-
});
|
|
45
|
+
const status = error.statusCode || 500;
|
|
46
|
+
let response = ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) || (error == null ? void 0 : error.message) || error;
|
|
47
|
+
console.error("\u{1F534} Request error", (error == null ? void 0 : error.response) || response);
|
|
48
|
+
return res.status(status).send({ statusCode: status, code: error.code, response });
|
|
52
49
|
});
|
|
53
50
|
};
|
|
54
51
|
|
|
@@ -3,15 +3,12 @@ import Utils from "@gustavo-valsechi/utils";
|
|
|
3
3
|
var responseWrapper = async (res, promise) => {
|
|
4
4
|
return promise.then(async (data) => {
|
|
5
5
|
res.status(200).send(await Utils.cryptor.encrypt(data));
|
|
6
|
-
}).catch((
|
|
6
|
+
}).catch((error) => {
|
|
7
7
|
var _a;
|
|
8
|
-
const status =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
code: err.code,
|
|
13
|
-
response: ((_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data) || err.message
|
|
14
|
-
});
|
|
8
|
+
const status = error.statusCode || 500;
|
|
9
|
+
let response = ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) || (error == null ? void 0 : error.message) || error;
|
|
10
|
+
console.error("\u{1F534} Request error", (error == null ? void 0 : error.response) || response);
|
|
11
|
+
return res.status(status).send({ statusCode: status, code: error.code, response });
|
|
15
12
|
});
|
|
16
13
|
};
|
|
17
14
|
|
package/dist/src/server/index.js
CHANGED
|
@@ -41,15 +41,12 @@ var import_utils = __toESM(require("@gustavo-valsechi/utils"));
|
|
|
41
41
|
var responseWrapper = async (res, promise) => {
|
|
42
42
|
return promise.then(async (data) => {
|
|
43
43
|
res.status(200).send(await import_utils.default.cryptor.encrypt(data));
|
|
44
|
-
}).catch((
|
|
44
|
+
}).catch((error) => {
|
|
45
45
|
var _a;
|
|
46
|
-
const status =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
code: err.code,
|
|
51
|
-
response: ((_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data) || err.message
|
|
52
|
-
});
|
|
46
|
+
const status = error.statusCode || 500;
|
|
47
|
+
let response = ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) || (error == null ? void 0 : error.message) || error;
|
|
48
|
+
console.error("\u{1F534} Request error", (error == null ? void 0 : error.response) || response);
|
|
49
|
+
return res.status(status).send({ statusCode: status, code: error.code, response });
|
|
53
50
|
});
|
|
54
51
|
};
|
|
55
52
|
|
|
@@ -6,15 +6,12 @@ import Utils from "@gustavo-valsechi/utils";
|
|
|
6
6
|
var responseWrapper = async (res, promise) => {
|
|
7
7
|
return promise.then(async (data) => {
|
|
8
8
|
res.status(200).send(await Utils.cryptor.encrypt(data));
|
|
9
|
-
}).catch((
|
|
9
|
+
}).catch((error) => {
|
|
10
10
|
var _a;
|
|
11
|
-
const status =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
code: err.code,
|
|
16
|
-
response: ((_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data) || err.message
|
|
17
|
-
});
|
|
11
|
+
const status = error.statusCode || 500;
|
|
12
|
+
let response = ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) || (error == null ? void 0 : error.message) || error;
|
|
13
|
+
console.error("\u{1F534} Request error", (error == null ? void 0 : error.response) || response);
|
|
14
|
+
return res.status(status).send({ statusCode: status, code: error.code, response });
|
|
18
15
|
});
|
|
19
16
|
};
|
|
20
17
|
|
package/dist/src/tools/index.js
CHANGED
|
@@ -45,15 +45,12 @@ var import_utils = __toESM(require("@gustavo-valsechi/utils"));
|
|
|
45
45
|
var responseWrapper = async (res, promise) => {
|
|
46
46
|
return promise.then(async (data) => {
|
|
47
47
|
res.status(200).send(await import_utils.default.cryptor.encrypt(data));
|
|
48
|
-
}).catch((
|
|
48
|
+
}).catch((error) => {
|
|
49
49
|
var _a;
|
|
50
|
-
const status =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
code: err.code,
|
|
55
|
-
response: ((_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data) || err.message
|
|
56
|
-
});
|
|
50
|
+
const status = error.statusCode || 500;
|
|
51
|
+
let response = ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) || (error == null ? void 0 : error.message) || error;
|
|
52
|
+
console.error("\u{1F534} Request error", (error == null ? void 0 : error.response) || response);
|
|
53
|
+
return res.status(status).send({ statusCode: status, code: error.code, response });
|
|
57
54
|
});
|
|
58
55
|
};
|
|
59
56
|
|
package/dist/src/tools/index.mjs
CHANGED
|
@@ -10,15 +10,12 @@ import Utils from "@gustavo-valsechi/utils";
|
|
|
10
10
|
var responseWrapper = async (res, promise) => {
|
|
11
11
|
return promise.then(async (data) => {
|
|
12
12
|
res.status(200).send(await Utils.cryptor.encrypt(data));
|
|
13
|
-
}).catch((
|
|
13
|
+
}).catch((error) => {
|
|
14
14
|
var _a;
|
|
15
|
-
const status =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
code: err.code,
|
|
20
|
-
response: ((_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data) || err.message
|
|
21
|
-
});
|
|
15
|
+
const status = error.statusCode || 500;
|
|
16
|
+
let response = ((_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) || (error == null ? void 0 : error.message) || error;
|
|
17
|
+
console.error("\u{1F534} Request error", (error == null ? void 0 : error.response) || response);
|
|
18
|
+
return res.status(status).send({ statusCode: status, code: error.code, response });
|
|
22
19
|
});
|
|
23
20
|
};
|
|
24
21
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gustavo-valsechi/node",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"fastify": "5.6.2",
|
|
19
19
|
"fastify-plugin": "5.1.0",
|
|
20
20
|
"pg": "8.11.5",
|
|
21
|
-
"typeorm": "0.3.26"
|
|
21
|
+
"typeorm": "0.3.26",
|
|
22
|
+
"zod": "4.3.6"
|
|
22
23
|
},
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"@fastify/cors": "11.2.0",
|
|
@@ -44,7 +45,8 @@
|
|
|
44
45
|
"tsup": "8.5.0",
|
|
45
46
|
"typeorm": "0.3.26",
|
|
46
47
|
"typescript": "5.4.5",
|
|
47
|
-
"vitest": "3.0.5"
|
|
48
|
+
"vitest": "3.0.5",
|
|
49
|
+
"zod": "4.3.6"
|
|
48
50
|
},
|
|
49
51
|
"publishConfig": {
|
|
50
52
|
"access": "public"
|