@burdenoff/ui-engine 2026.1127.2 → 2026.1127.3
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/README.md +33 -3
- package/dist/capture.js +3 -2
- package/dist/dom-runtime/actions.d.ts +65 -0
- package/dist/dom-runtime/iife.d.ts +1 -0
- package/dist/dom-runtime/index.d.ts +7 -0
- package/dist/dom-runtime/runtime.d.ts +79 -0
- package/dist/dom-runtime.d.ts +2 -0
- package/dist/dom-runtime.iife.js +1 -0
- package/dist/dom-runtime.js +535 -0
- package/dist/{index-n5amgh31.js → index-2kgsgn1c.js} +1 -1
- package/dist/{index-phd8yhyg.js → index-bnvmt4wf.js} +7 -5
- package/dist/{index-c6pmt2rg.js → index-cs6acyjn.js} +6 -59
- package/dist/index-mgztm37r.js +57 -0
- package/dist/index-q1b0j9yr.js +1349 -0
- package/dist/{index-tqffkt91.js → index-zwrxw3zp.js} +5 -3
- package/dist/index.js +8 -6
- package/dist/recording.js +1 -1
- package/dist/replay.js +2 -2
- package/dist/script.js +2 -2
- package/dist/target/aria.d.ts +31 -0
- package/dist/target/dom.d.ts +35 -0
- package/dist/target/index.d.ts +13 -0
- package/dist/target/markers.d.ts +18 -0
- package/dist/target/methods.d.ts +52 -0
- package/dist/target/resolve.d.ts +46 -0
- package/dist/target/snapshot.d.ts +57 -0
- package/dist/target/text.d.ts +23 -0
- package/dist/target/types.d.ts +88 -0
- package/dist/target.d.ts +2 -0
- package/dist/target.js +92 -0
- package/dist/testing/fixtures/ambiguous.d.ts +7 -0
- package/dist/testing/fixtures/iframe.d.ts +6 -0
- package/dist/testing/fixtures/index.d.ts +26 -0
- package/dist/testing/fixtures/invoices-v2.d.ts +8 -0
- package/dist/testing/fixtures/invoices-v3.d.ts +7 -0
- package/dist/testing/fixtures/invoices.d.ts +6 -0
- package/dist/testing/fixtures/login.d.ts +6 -0
- package/dist/testing/fixtures/shadow.d.ts +7 -0
- package/dist/testing/index.d.ts +6 -0
- package/dist/testing/mount.d.ts +18 -0
- package/dist/testing.d.ts +2 -0
- package/dist/testing.js +324 -0
- package/package.json +21 -5
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// src/redact-credentials.ts
|
|
2
|
+
var REDACTED2 = "[REDACTED]";
|
|
3
|
+
var CREDENTIAL_PATTERNS = [
|
|
4
|
+
/\b(?:Bearer|Basic)\s+[^\s"'`,;)\]}]+/gi,
|
|
5
|
+
/\b(?:sk|pk|rk|xai)-[^\s"'`,;)\]}]+/gi,
|
|
6
|
+
/\b(?:gsk|hf|ghp|gho|ghs|ghu|glpat)_[^\s"'`,;)\]}]+/gi,
|
|
7
|
+
/\bAIza[\w-]{10,}/g,
|
|
8
|
+
/\b(?:AKIA|ASIA)[0-9A-Z]{12,}/g
|
|
9
|
+
];
|
|
10
|
+
var SEPARATORS = /([\s"'`,;:=()[\]{}]+)/;
|
|
11
|
+
var SECRET_KEY = /^(?:api[_-]?key|access[_-]?key|secret|secret[_-]?key|client[_-]?secret|token|password)$/i;
|
|
12
|
+
function isMaskedFragment(word) {
|
|
13
|
+
const ellipsis = word.indexOf("…");
|
|
14
|
+
return word.includes("***") || ellipsis !== -1 && ellipsis < word.length - 1;
|
|
15
|
+
}
|
|
16
|
+
function redactWords(text) {
|
|
17
|
+
const parts = text.split(SEPARATORS);
|
|
18
|
+
for (let index = 0;index < parts.length; index += 2) {
|
|
19
|
+
const word = parts[index] ?? "";
|
|
20
|
+
if (word && word !== REDACTED2 && isMaskedFragment(word))
|
|
21
|
+
parts[index] = REDACTED2;
|
|
22
|
+
const separator = parts[index + 1] ?? "";
|
|
23
|
+
const next = parts[index + 2];
|
|
24
|
+
if (next && SECRET_KEY.test(word) && /[:=]/.test(separator))
|
|
25
|
+
parts[index + 2] = REDACTED2;
|
|
26
|
+
}
|
|
27
|
+
return parts.join("");
|
|
28
|
+
}
|
|
29
|
+
function redactCredentials2(text) {
|
|
30
|
+
if (!text)
|
|
31
|
+
return text;
|
|
32
|
+
let redacted = text;
|
|
33
|
+
for (const pattern of CREDENTIAL_PATTERNS) {
|
|
34
|
+
redacted = redacted.replace(pattern, REDACTED2);
|
|
35
|
+
}
|
|
36
|
+
redacted = redactWords(redacted);
|
|
37
|
+
return redacted.replace(/(?:\[REDACTED\]){2,}/g, REDACTED2);
|
|
38
|
+
}
|
|
39
|
+
var MARKER_PROBE = "";
|
|
40
|
+
function containsCredential(text) {
|
|
41
|
+
if (!text)
|
|
42
|
+
return false;
|
|
43
|
+
const probe = text.replaceAll(REDACTED2, MARKER_PROBE);
|
|
44
|
+
return redactCredentials2(probe).replaceAll(MARKER_PROBE, REDACTED2) !== text;
|
|
45
|
+
}
|
|
46
|
+
function decodeUriText(text) {
|
|
47
|
+
try {
|
|
48
|
+
return decodeURIComponent(text.replaceAll("+", " "));
|
|
49
|
+
} catch {
|
|
50
|
+
return text;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function containsCredentialInUrl(text) {
|
|
54
|
+
return containsCredential(decodeUriText(text).replace(/[/?&#]/g, " "));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { REDACTED2, redactCredentials2, containsCredential, decodeUriText, containsCredentialInUrl };
|