@riocrypto/common-server 1.0.1771 → 1.0.1772
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.
|
@@ -12,8 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.requireMinAdminRole = void 0;
|
|
13
13
|
const common_1 = require("@riocrypto/common");
|
|
14
14
|
const adminRoleOrder = [
|
|
15
|
-
common_1.AdminAuthRole.
|
|
16
|
-
common_1.AdminAuthRole.
|
|
15
|
+
common_1.AdminAuthRole.ViewOnly,
|
|
16
|
+
common_1.AdminAuthRole.CreateAndModify,
|
|
17
17
|
common_1.AdminAuthRole.SuperAdmin,
|
|
18
18
|
];
|
|
19
19
|
const requireMinAdminRole = (req, res, next, minRole) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -12,8 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.requireMinRole = void 0;
|
|
13
13
|
const common_1 = require("@riocrypto/common");
|
|
14
14
|
const authRoleOrder = [
|
|
15
|
-
common_1.AuthRole.
|
|
16
|
-
common_1.AuthRole.
|
|
15
|
+
common_1.AuthRole.ViewOnly,
|
|
16
|
+
common_1.AuthRole.CreateAndModify,
|
|
17
17
|
common_1.AuthRole.Owner,
|
|
18
18
|
];
|
|
19
19
|
const requireMinRole = (req, res, next, minRole) => __awaiter(void 0, void 0, void 0, function* () {
|
package/build/services/logger.js
CHANGED
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const common_1 = require("@riocrypto/common");
|
|
12
13
|
const winston_1 = require("winston");
|
|
13
14
|
class LoggerService {
|
|
14
15
|
constructor() {
|
|
@@ -85,32 +86,27 @@ class LoggerService {
|
|
|
85
86
|
}
|
|
86
87
|
initLogger() {
|
|
87
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
// format.prettyPrint()
|
|
110
|
-
// ),
|
|
111
|
-
// transports: [new transports.Console()],
|
|
112
|
-
// });
|
|
113
|
-
// }
|
|
89
|
+
if (process.env.RIO_ENV === common_1.RioEnv.Production) {
|
|
90
|
+
const { getWinsonTransport } = yield require("@hyperdx/node-opentelemetry");
|
|
91
|
+
this.logger = (0, winston_1.createLogger)({
|
|
92
|
+
level: "info",
|
|
93
|
+
format: winston_1.format.combine(winston_1.format.timestamp(), this.maskSensitiveData(), winston_1.format.json(), winston_1.format.prettyPrint()),
|
|
94
|
+
transports: [
|
|
95
|
+
new winston_1.transports.Console(),
|
|
96
|
+
getWinsonTransport("info", {
|
|
97
|
+
apiKey: process.env.HYPERDX_API_KEY,
|
|
98
|
+
service: process.env.OTEL_SERVICE_NAME,
|
|
99
|
+
}),
|
|
100
|
+
],
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
this.logger = (0, winston_1.createLogger)({
|
|
105
|
+
level: "error",
|
|
106
|
+
format: winston_1.format.combine(winston_1.format.timestamp(), this.maskSensitiveData(), winston_1.format.json(), winston_1.format.metadata(), winston_1.format.prettyPrint()),
|
|
107
|
+
transports: [new winston_1.transports.Console()],
|
|
108
|
+
});
|
|
109
|
+
}
|
|
114
110
|
});
|
|
115
111
|
}
|
|
116
112
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1772",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@google-cloud/secret-manager": "^5.3.0",
|
|
27
27
|
"@google-cloud/storage": "^6.9.5",
|
|
28
28
|
"@hyperdx/node-opentelemetry": "^0.4.2",
|
|
29
|
-
"@riocrypto/common": "^1.0.
|
|
29
|
+
"@riocrypto/common": "^1.0.1558",
|
|
30
30
|
"@types/express": "^4.17.13",
|
|
31
31
|
"axios": "^1.6.0",
|
|
32
32
|
"crypto-js": "^4.2.0",
|