befly 3.15.23 → 3.15.25
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/befly.js +58 -14
- package/dist/befly.min.js +9 -9
- package/dist/index.js +44 -3
- package/dist/lib/logger.js +10 -10
- package/dist/sync/syncTable.js +6 -1
- package/package.json +2 -2
package/dist/befly.js
CHANGED
|
@@ -863,11 +863,11 @@ function configure(cfg) {
|
|
|
863
863
|
errorFileSink = null;
|
|
864
864
|
appConsoleSink = null;
|
|
865
865
|
sanitizeOptions = {
|
|
866
|
-
maxStringLen: normalizePositiveInt(config.maxStringLen,
|
|
867
|
-
maxArrayItems: normalizePositiveInt(config.maxArrayItems,
|
|
868
|
-
sanitizeDepth: normalizePositiveInt(config.sanitizeDepth,
|
|
869
|
-
sanitizeNodes: normalizePositiveInt(config.sanitizeNodes,
|
|
870
|
-
sanitizeObjectKeys: normalizePositiveInt(config.sanitizeObjectKeys,
|
|
866
|
+
maxStringLen: normalizePositiveInt(config.maxStringLen, 200, 20, 200000),
|
|
867
|
+
maxArrayItems: normalizePositiveInt(config.maxArrayItems, 500, 10, 5000),
|
|
868
|
+
sanitizeDepth: normalizePositiveInt(config.sanitizeDepth, 5, 1, 10),
|
|
869
|
+
sanitizeNodes: normalizePositiveInt(config.sanitizeNodes, 5000, 50, 20000),
|
|
870
|
+
sanitizeObjectKeys: normalizePositiveInt(config.sanitizeObjectKeys, 500, 10, 5000),
|
|
871
871
|
sensitiveKeyMatcher: buildSensitiveKeyMatcher({ builtinPatterns: BUILTIN_SENSITIVE_KEYS, userPatterns: config.excludeFields })
|
|
872
872
|
};
|
|
873
873
|
}
|
|
@@ -1097,11 +1097,11 @@ var init_logger = __esm(() => {
|
|
|
1097
1097
|
INITIAL_CWD = process.cwd();
|
|
1098
1098
|
BUILTIN_SENSITIVE_KEYS = ["*password*", "pass", "pwd", "*token*", "access_token", "refresh_token", "accessToken", "refreshToken", "authorization", "cookie", "set-cookie", "*secret*", "apiKey", "api_key", "privateKey", "private_key"];
|
|
1099
1099
|
sanitizeOptions = {
|
|
1100
|
-
maxStringLen:
|
|
1101
|
-
maxArrayItems:
|
|
1102
|
-
sanitizeDepth:
|
|
1103
|
-
sanitizeNodes:
|
|
1104
|
-
sanitizeObjectKeys:
|
|
1100
|
+
maxStringLen: 200,
|
|
1101
|
+
maxArrayItems: 500,
|
|
1102
|
+
sanitizeDepth: 5,
|
|
1103
|
+
sanitizeNodes: 5000,
|
|
1104
|
+
sanitizeObjectKeys: 500,
|
|
1105
1105
|
sensitiveKeyMatcher: buildSensitiveKeyMatcher({ builtinPatterns: BUILTIN_SENSITIVE_KEYS, userPatterns: [] })
|
|
1106
1106
|
};
|
|
1107
1107
|
HOSTNAME = (() => {
|
|
@@ -10874,7 +10874,12 @@ class SyncTable {
|
|
|
10874
10874
|
message: msgLines.join(`
|
|
10875
10875
|
`),
|
|
10876
10876
|
noLog: true,
|
|
10877
|
-
meta: {
|
|
10877
|
+
meta: {
|
|
10878
|
+
subsystem: "syncTable",
|
|
10879
|
+
operation: "precheck",
|
|
10880
|
+
incompatibleTypeChangeCount: incompatibleTypeChanges.length,
|
|
10881
|
+
incompatibleTypeChanges
|
|
10882
|
+
}
|
|
10878
10883
|
});
|
|
10879
10884
|
}
|
|
10880
10885
|
static truncateForLog(input, maxLen) {
|
|
@@ -16557,10 +16562,17 @@ class Befly {
|
|
|
16557
16562
|
let kind = "runtime";
|
|
16558
16563
|
let alreadyLogged = false;
|
|
16559
16564
|
let noLog = false;
|
|
16565
|
+
let incompatibleTypeChanges = null;
|
|
16566
|
+
let incompatibleTypeChangeCount = null;
|
|
16567
|
+
let incompatibleTypeChangeLines = null;
|
|
16560
16568
|
if (isCoreError(error)) {
|
|
16561
16569
|
kind = error.kind;
|
|
16562
16570
|
alreadyLogged = error.logged === true;
|
|
16563
16571
|
noLog = error.noLog === true;
|
|
16572
|
+
if (error.meta && typeof error.meta === "object") {
|
|
16573
|
+
incompatibleTypeChanges = error.meta["incompatibleTypeChanges"] ?? null;
|
|
16574
|
+
incompatibleTypeChangeCount = error.meta["incompatibleTypeChangeCount"] ?? null;
|
|
16575
|
+
}
|
|
16564
16576
|
} else {
|
|
16565
16577
|
const anyErr = error;
|
|
16566
16578
|
if (anyErr && anyErr.__syncTableLogged === true) {
|
|
@@ -16576,24 +16588,56 @@ class Befly {
|
|
|
16576
16588
|
noLog = true;
|
|
16577
16589
|
}
|
|
16578
16590
|
}
|
|
16591
|
+
{
|
|
16592
|
+
const lines = [];
|
|
16593
|
+
if (Array.isArray(incompatibleTypeChanges)) {
|
|
16594
|
+
for (const item of incompatibleTypeChanges) {
|
|
16595
|
+
if (!item || typeof item !== "object")
|
|
16596
|
+
continue;
|
|
16597
|
+
const rec = item;
|
|
16598
|
+
const tableName = rec["tableName"];
|
|
16599
|
+
const dbFieldName = rec["dbFieldName"];
|
|
16600
|
+
const currentType = rec["currentType"];
|
|
16601
|
+
const expectedType = rec["expectedType"];
|
|
16602
|
+
if (typeof tableName !== "string" || tableName.length === 0)
|
|
16603
|
+
continue;
|
|
16604
|
+
if (typeof dbFieldName !== "string" || dbFieldName.length === 0)
|
|
16605
|
+
continue;
|
|
16606
|
+
if (typeof currentType !== "string" || currentType.length === 0)
|
|
16607
|
+
continue;
|
|
16608
|
+
if (typeof expectedType !== "string" || expectedType.length === 0)
|
|
16609
|
+
continue;
|
|
16610
|
+
lines.push(`- ${tableName}.${dbFieldName}: ${currentType} -> ${expectedType}`);
|
|
16611
|
+
}
|
|
16612
|
+
}
|
|
16613
|
+
if (lines.length > 0) {
|
|
16614
|
+
incompatibleTypeChangeLines = lines;
|
|
16615
|
+
}
|
|
16616
|
+
}
|
|
16579
16617
|
if (alreadyLogged) {
|
|
16580
16618
|
Logger.error({
|
|
16581
16619
|
msg: "\u9879\u76EE\u542F\u52A8\u5931\u8D25\uFF08\u4E0B\u5C42\u5DF2\u8BB0\u5F55\uFF09",
|
|
16582
16620
|
errorKind: kind,
|
|
16583
|
-
errorMessage: errMessage
|
|
16621
|
+
errorMessage: errMessage,
|
|
16622
|
+
incompatibleTypeChangeCount,
|
|
16623
|
+
incompatibleTypeChangeLines
|
|
16584
16624
|
});
|
|
16585
16625
|
} else if (noLog) {
|
|
16586
16626
|
Logger.error({
|
|
16587
16627
|
msg: "\u9879\u76EE\u542F\u52A8\u5931\u8D25",
|
|
16588
16628
|
errorKind: kind,
|
|
16589
|
-
errorMessage: errMessage
|
|
16629
|
+
errorMessage: errMessage,
|
|
16630
|
+
incompatibleTypeChangeCount,
|
|
16631
|
+
incompatibleTypeChangeLines
|
|
16590
16632
|
});
|
|
16591
16633
|
} else {
|
|
16592
16634
|
Logger.error({
|
|
16593
16635
|
msg: "\u9879\u76EE\u542F\u52A8\u5931\u8D25",
|
|
16594
16636
|
errorKind: kind,
|
|
16595
16637
|
errorMessage: errMessage,
|
|
16596
|
-
err: error
|
|
16638
|
+
err: error,
|
|
16639
|
+
incompatibleTypeChangeCount,
|
|
16640
|
+
incompatibleTypeChangeLines
|
|
16597
16641
|
});
|
|
16598
16642
|
}
|
|
16599
16643
|
try {
|