fiberx-backend-toolkit 0.0.68 → 0.0.70
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.
|
@@ -332,15 +332,22 @@ class InputTransformerUtil {
|
|
|
332
332
|
if (!html) {
|
|
333
333
|
return html;
|
|
334
334
|
}
|
|
335
|
-
|
|
336
|
-
|
|
335
|
+
const preserved = [];
|
|
336
|
+
// Preserve sensitive blocks
|
|
337
|
+
html = html.replace(/<(pre|code|textarea)[^>]*>[\s\S]*?<\/\1>/gi, (match) => {
|
|
338
|
+
preserved.push(match);
|
|
339
|
+
return `___PRESERVE_${preserved.length - 1}___`;
|
|
340
|
+
});
|
|
341
|
+
html = html
|
|
337
342
|
.replace(/[\n\r\t]+/g, " ")
|
|
338
|
-
// Remove spaces between tags
|
|
339
343
|
.replace(/>\s+</g, "><")
|
|
340
|
-
// Collapse multiple spaces (but keep single space)
|
|
341
344
|
.replace(/\s{2,}/g, " ")
|
|
342
|
-
// Trim start and end
|
|
343
345
|
.trim();
|
|
346
|
+
// Restore preserved blocks
|
|
347
|
+
preserved.forEach((block, i) => {
|
|
348
|
+
html = html.replace(`___PRESERVE_${i}___`, block);
|
|
349
|
+
});
|
|
350
|
+
return html;
|
|
344
351
|
}
|
|
345
352
|
}
|
|
346
353
|
exports.default = InputTransformerUtil;
|
|
@@ -121,8 +121,8 @@ class TOTPServiceUtil {
|
|
|
121
121
|
}
|
|
122
122
|
generateAppSecret(member_email, custom_app_name = "") {
|
|
123
123
|
const app_name = this.env_manager.getEnvVar("APP_NAME", custom_app_name) ?? custom_app_name;
|
|
124
|
-
const name =
|
|
125
|
-
const issuer =
|
|
124
|
+
const name = member_email;
|
|
125
|
+
const issuer = input_validator_util_1.default.isProduction() ? `${app_name}:${member_email}` : `Dev ${app_name}:${member_email}`;
|
|
126
126
|
return this.generateSecret({ name, issuer });
|
|
127
127
|
}
|
|
128
128
|
// ===============================
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fiberx-backend-toolkit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.70",
|
|
4
4
|
"description": "A TypeScript backend toolkit providing shared domain logic, infrastructure helpers, and utilities for FiberX server-side applications and services.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./dist/index.js",
|