@riddledc/riddle-proof 0.7.19 → 0.7.20
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/{chunk-ZGSAXSBW.js → chunk-TPUR67H5.js} +9 -4
- package/dist/cli.cjs +9 -4
- package/dist/cli.js +1 -1
- package/dist/index.cjs +9 -4
- package/dist/index.js +1 -1
- package/dist/profile.cjs +9 -4
- package/dist/profile.js +1 -1
- package/package.json +1 -1
|
@@ -836,6 +836,11 @@ function setupTextMatches(sample, action) {
|
|
|
836
836
|
async function setupLocatorText(locator, index) {
|
|
837
837
|
return await locator.nth(index).textContent({ timeout: 1000 }).catch(() => "");
|
|
838
838
|
}
|
|
839
|
+
function compactSetupResultText(value) {
|
|
840
|
+
const text = String(value || "").replace(/\s+/g, " ").trim();
|
|
841
|
+
if (text.length <= 500) return text;
|
|
842
|
+
return text.slice(0, 500) + "... (" + text.length + " chars)";
|
|
843
|
+
}
|
|
839
844
|
async function setupLocatorVisible(locator, index) {
|
|
840
845
|
return await locator.nth(index).isVisible({ timeout: 1000 }).catch(() => false);
|
|
841
846
|
}
|
|
@@ -869,12 +874,12 @@ async function executeSetupAction(action, ordinal) {
|
|
|
869
874
|
const visible = await setupLocatorVisible(locator, index);
|
|
870
875
|
if (visible) {
|
|
871
876
|
targetIndex = index;
|
|
872
|
-
matchedText = text;
|
|
877
|
+
matchedText = compactSetupResultText(text);
|
|
873
878
|
break;
|
|
874
879
|
}
|
|
875
880
|
if (hiddenMatchIndex < 0) {
|
|
876
881
|
hiddenMatchIndex = index;
|
|
877
|
-
hiddenMatchedText = text;
|
|
882
|
+
hiddenMatchedText = compactSetupResultText(text);
|
|
878
883
|
}
|
|
879
884
|
}
|
|
880
885
|
}
|
|
@@ -895,12 +900,12 @@ async function executeSetupAction(action, ordinal) {
|
|
|
895
900
|
const text = await setupLocatorText(locator, index);
|
|
896
901
|
lastText = text || lastText;
|
|
897
902
|
if (setupTextMatches(text, action)) {
|
|
898
|
-
return { ...base, ok: true, text, target_index: index, timeout_ms: timeout };
|
|
903
|
+
return { ...base, ok: true, text: compactSetupResultText(text), target_index: index, timeout_ms: timeout };
|
|
899
904
|
}
|
|
900
905
|
}
|
|
901
906
|
await page.waitForTimeout(100);
|
|
902
907
|
}
|
|
903
|
-
return { ...base, reason: "text_not_found", text: lastText, timeout_ms: timeout };
|
|
908
|
+
return { ...base, reason: "text_not_found", text: compactSetupResultText(lastText), timeout_ms: timeout };
|
|
904
909
|
}
|
|
905
910
|
return { ...base, reason: "unsupported_action" };
|
|
906
911
|
} catch (error) {
|
package/dist/cli.cjs
CHANGED
|
@@ -7600,6 +7600,11 @@ function setupTextMatches(sample, action) {
|
|
|
7600
7600
|
async function setupLocatorText(locator, index) {
|
|
7601
7601
|
return await locator.nth(index).textContent({ timeout: 1000 }).catch(() => "");
|
|
7602
7602
|
}
|
|
7603
|
+
function compactSetupResultText(value) {
|
|
7604
|
+
const text = String(value || "").replace(/\s+/g, " ").trim();
|
|
7605
|
+
if (text.length <= 500) return text;
|
|
7606
|
+
return text.slice(0, 500) + "... (" + text.length + " chars)";
|
|
7607
|
+
}
|
|
7603
7608
|
async function setupLocatorVisible(locator, index) {
|
|
7604
7609
|
return await locator.nth(index).isVisible({ timeout: 1000 }).catch(() => false);
|
|
7605
7610
|
}
|
|
@@ -7633,12 +7638,12 @@ async function executeSetupAction(action, ordinal) {
|
|
|
7633
7638
|
const visible = await setupLocatorVisible(locator, index);
|
|
7634
7639
|
if (visible) {
|
|
7635
7640
|
targetIndex = index;
|
|
7636
|
-
matchedText = text;
|
|
7641
|
+
matchedText = compactSetupResultText(text);
|
|
7637
7642
|
break;
|
|
7638
7643
|
}
|
|
7639
7644
|
if (hiddenMatchIndex < 0) {
|
|
7640
7645
|
hiddenMatchIndex = index;
|
|
7641
|
-
hiddenMatchedText = text;
|
|
7646
|
+
hiddenMatchedText = compactSetupResultText(text);
|
|
7642
7647
|
}
|
|
7643
7648
|
}
|
|
7644
7649
|
}
|
|
@@ -7659,12 +7664,12 @@ async function executeSetupAction(action, ordinal) {
|
|
|
7659
7664
|
const text = await setupLocatorText(locator, index);
|
|
7660
7665
|
lastText = text || lastText;
|
|
7661
7666
|
if (setupTextMatches(text, action)) {
|
|
7662
|
-
return { ...base, ok: true, text, target_index: index, timeout_ms: timeout };
|
|
7667
|
+
return { ...base, ok: true, text: compactSetupResultText(text), target_index: index, timeout_ms: timeout };
|
|
7663
7668
|
}
|
|
7664
7669
|
}
|
|
7665
7670
|
await page.waitForTimeout(100);
|
|
7666
7671
|
}
|
|
7667
|
-
return { ...base, reason: "text_not_found", text: lastText, timeout_ms: timeout };
|
|
7672
|
+
return { ...base, reason: "text_not_found", text: compactSetupResultText(lastText), timeout_ms: timeout };
|
|
7668
7673
|
}
|
|
7669
7674
|
return { ...base, reason: "unsupported_action" };
|
|
7670
7675
|
} catch (error) {
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -9405,6 +9405,11 @@ function setupTextMatches(sample, action) {
|
|
|
9405
9405
|
async function setupLocatorText(locator, index) {
|
|
9406
9406
|
return await locator.nth(index).textContent({ timeout: 1000 }).catch(() => "");
|
|
9407
9407
|
}
|
|
9408
|
+
function compactSetupResultText(value) {
|
|
9409
|
+
const text = String(value || "").replace(/\s+/g, " ").trim();
|
|
9410
|
+
if (text.length <= 500) return text;
|
|
9411
|
+
return text.slice(0, 500) + "... (" + text.length + " chars)";
|
|
9412
|
+
}
|
|
9408
9413
|
async function setupLocatorVisible(locator, index) {
|
|
9409
9414
|
return await locator.nth(index).isVisible({ timeout: 1000 }).catch(() => false);
|
|
9410
9415
|
}
|
|
@@ -9438,12 +9443,12 @@ async function executeSetupAction(action, ordinal) {
|
|
|
9438
9443
|
const visible = await setupLocatorVisible(locator, index);
|
|
9439
9444
|
if (visible) {
|
|
9440
9445
|
targetIndex = index;
|
|
9441
|
-
matchedText = text;
|
|
9446
|
+
matchedText = compactSetupResultText(text);
|
|
9442
9447
|
break;
|
|
9443
9448
|
}
|
|
9444
9449
|
if (hiddenMatchIndex < 0) {
|
|
9445
9450
|
hiddenMatchIndex = index;
|
|
9446
|
-
hiddenMatchedText = text;
|
|
9451
|
+
hiddenMatchedText = compactSetupResultText(text);
|
|
9447
9452
|
}
|
|
9448
9453
|
}
|
|
9449
9454
|
}
|
|
@@ -9464,12 +9469,12 @@ async function executeSetupAction(action, ordinal) {
|
|
|
9464
9469
|
const text = await setupLocatorText(locator, index);
|
|
9465
9470
|
lastText = text || lastText;
|
|
9466
9471
|
if (setupTextMatches(text, action)) {
|
|
9467
|
-
return { ...base, ok: true, text, target_index: index, timeout_ms: timeout };
|
|
9472
|
+
return { ...base, ok: true, text: compactSetupResultText(text), target_index: index, timeout_ms: timeout };
|
|
9468
9473
|
}
|
|
9469
9474
|
}
|
|
9470
9475
|
await page.waitForTimeout(100);
|
|
9471
9476
|
}
|
|
9472
|
-
return { ...base, reason: "text_not_found", text: lastText, timeout_ms: timeout };
|
|
9477
|
+
return { ...base, reason: "text_not_found", text: compactSetupResultText(lastText), timeout_ms: timeout };
|
|
9473
9478
|
}
|
|
9474
9479
|
return { ...base, reason: "unsupported_action" };
|
|
9475
9480
|
} catch (error) {
|
package/dist/index.js
CHANGED
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
resolveRiddleProofProfileTimeoutSec,
|
|
59
59
|
slugifyRiddleProofProfileName,
|
|
60
60
|
summarizeRiddleProofProfileResult
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-TPUR67H5.js";
|
|
62
62
|
import {
|
|
63
63
|
DEFAULT_RIDDLE_API_BASE_URL,
|
|
64
64
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
package/dist/profile.cjs
CHANGED
|
@@ -879,6 +879,11 @@ function setupTextMatches(sample, action) {
|
|
|
879
879
|
async function setupLocatorText(locator, index) {
|
|
880
880
|
return await locator.nth(index).textContent({ timeout: 1000 }).catch(() => "");
|
|
881
881
|
}
|
|
882
|
+
function compactSetupResultText(value) {
|
|
883
|
+
const text = String(value || "").replace(/\s+/g, " ").trim();
|
|
884
|
+
if (text.length <= 500) return text;
|
|
885
|
+
return text.slice(0, 500) + "... (" + text.length + " chars)";
|
|
886
|
+
}
|
|
882
887
|
async function setupLocatorVisible(locator, index) {
|
|
883
888
|
return await locator.nth(index).isVisible({ timeout: 1000 }).catch(() => false);
|
|
884
889
|
}
|
|
@@ -912,12 +917,12 @@ async function executeSetupAction(action, ordinal) {
|
|
|
912
917
|
const visible = await setupLocatorVisible(locator, index);
|
|
913
918
|
if (visible) {
|
|
914
919
|
targetIndex = index;
|
|
915
|
-
matchedText = text;
|
|
920
|
+
matchedText = compactSetupResultText(text);
|
|
916
921
|
break;
|
|
917
922
|
}
|
|
918
923
|
if (hiddenMatchIndex < 0) {
|
|
919
924
|
hiddenMatchIndex = index;
|
|
920
|
-
hiddenMatchedText = text;
|
|
925
|
+
hiddenMatchedText = compactSetupResultText(text);
|
|
921
926
|
}
|
|
922
927
|
}
|
|
923
928
|
}
|
|
@@ -938,12 +943,12 @@ async function executeSetupAction(action, ordinal) {
|
|
|
938
943
|
const text = await setupLocatorText(locator, index);
|
|
939
944
|
lastText = text || lastText;
|
|
940
945
|
if (setupTextMatches(text, action)) {
|
|
941
|
-
return { ...base, ok: true, text, target_index: index, timeout_ms: timeout };
|
|
946
|
+
return { ...base, ok: true, text: compactSetupResultText(text), target_index: index, timeout_ms: timeout };
|
|
942
947
|
}
|
|
943
948
|
}
|
|
944
949
|
await page.waitForTimeout(100);
|
|
945
950
|
}
|
|
946
|
-
return { ...base, reason: "text_not_found", text: lastText, timeout_ms: timeout };
|
|
951
|
+
return { ...base, reason: "text_not_found", text: compactSetupResultText(lastText), timeout_ms: timeout };
|
|
947
952
|
}
|
|
948
953
|
return { ...base, reason: "unsupported_action" };
|
|
949
954
|
} catch (error) {
|
package/dist/profile.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
resolveRiddleProofProfileTimeoutSec,
|
|
20
20
|
slugifyRiddleProofProfileName,
|
|
21
21
|
summarizeRiddleProofProfileResult
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-TPUR67H5.js";
|
|
23
23
|
export {
|
|
24
24
|
RIDDLE_PROOF_PROFILE_CHECK_TYPES,
|
|
25
25
|
RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
|