@backstage/backend-app-api 0.7.4 → 0.7.5
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/CHANGELOG.md +6 -0
- package/alpha/package.json +1 -1
- package/dist/index.cjs.js +11 -19
- package/dist/index.cjs.js.map +1 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
package/alpha/package.json
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -20,6 +20,7 @@ var minimatch = require('minimatch');
|
|
|
20
20
|
var errors = require('@backstage/errors');
|
|
21
21
|
var crypto = require('crypto');
|
|
22
22
|
var winston = require('winston');
|
|
23
|
+
var tripleBeam = require('triple-beam');
|
|
23
24
|
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
24
25
|
var alpha = require('@backstage/backend-plugin-api/alpha');
|
|
25
26
|
var luxon = require('luxon');
|
|
@@ -844,8 +845,8 @@ const _WinstonLogger = class _WinstonLogger {
|
|
|
844
845
|
let logger = winston.createLogger({
|
|
845
846
|
level: process.env.LOG_LEVEL || options.level || "info",
|
|
846
847
|
format: winston.format.combine(
|
|
847
|
-
|
|
848
|
-
|
|
848
|
+
(_a = options.format) != null ? _a : defaultFormatter,
|
|
849
|
+
redacter.format
|
|
849
850
|
),
|
|
850
851
|
transports: (_b = options.transports) != null ? _b : new winston.transports.Console()
|
|
851
852
|
});
|
|
@@ -860,24 +861,15 @@ const _WinstonLogger = class _WinstonLogger {
|
|
|
860
861
|
static redacter() {
|
|
861
862
|
const redactionSet = /* @__PURE__ */ new Set();
|
|
862
863
|
let redactionPattern = void 0;
|
|
863
|
-
const replace = (obj) => {
|
|
864
|
-
var _a;
|
|
865
|
-
for (const key in obj) {
|
|
866
|
-
if (Object.hasOwn(obj, key)) {
|
|
867
|
-
if (typeof obj[key] === "object") {
|
|
868
|
-
obj[key] = replace(obj[key]);
|
|
869
|
-
} else if (typeof obj[key] === "string") {
|
|
870
|
-
try {
|
|
871
|
-
obj[key] = (_a = obj[key]) == null ? void 0 : _a.replace(redactionPattern, "[REDACTED]");
|
|
872
|
-
} catch {
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
return obj;
|
|
878
|
-
};
|
|
879
864
|
return {
|
|
880
|
-
format: winston.format(
|
|
865
|
+
format: winston.format((obj) => {
|
|
866
|
+
var _a, _b;
|
|
867
|
+
if (!redactionPattern || !obj) {
|
|
868
|
+
return obj;
|
|
869
|
+
}
|
|
870
|
+
obj[tripleBeam.MESSAGE] = (_b = (_a = obj[tripleBeam.MESSAGE]) == null ? void 0 : _a.replace) == null ? void 0 : _b.call(_a, redactionPattern, "[REDACTED]");
|
|
871
|
+
return obj;
|
|
872
|
+
})(),
|
|
881
873
|
add(newRedactions) {
|
|
882
874
|
let added = 0;
|
|
883
875
|
for (const redactionToTrim of newRedactions) {
|