@factorypure/client-helpers 1.1.12 → 1.1.14
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/index.js +23 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -527,15 +527,20 @@ export class FilterEngine {
|
|
|
527
527
|
globalScrapeOptions,
|
|
528
528
|
};
|
|
529
529
|
const filterResults = this.evaluateResult(context);
|
|
530
|
-
|
|
530
|
+
// Merge with existing filter_results from batch processing (duplicates, search exclusions, etc.)
|
|
531
|
+
const existingFilterResults = result.filter_results || [];
|
|
532
|
+
const allFilterResults = [...existingFilterResults, ...filterResults];
|
|
533
|
+
const visibilityState = this.calculateVisibility(allFilterResults);
|
|
531
534
|
// Populate new fields
|
|
532
|
-
result.filter_results =
|
|
535
|
+
result.filter_results = allFilterResults;
|
|
533
536
|
result.visibility_state = visibilityState;
|
|
534
537
|
// Maintain backward compatibility with old fields
|
|
535
|
-
result.hide_reasons =
|
|
538
|
+
result.hide_reasons = allFilterResults
|
|
536
539
|
.filter((fr) => fr.severity === FilterSeverity.BLOCK || fr.severity === FilterSeverity.WARNING)
|
|
537
540
|
.map((fr) => fr.message);
|
|
538
|
-
result.hide_override_reasons =
|
|
541
|
+
result.hide_override_reasons = allFilterResults
|
|
542
|
+
.filter((fr) => fr.metadata?.isOverride)
|
|
543
|
+
.map((fr) => fr.message);
|
|
539
544
|
result.ignore_result = visibilityState === VisibilityState.HIDDEN;
|
|
540
545
|
return result;
|
|
541
546
|
});
|
|
@@ -580,8 +585,20 @@ export class FilterEngine {
|
|
|
580
585
|
if (overridableBlocks.length > 0) {
|
|
581
586
|
return VisibilityState.HIDDEN;
|
|
582
587
|
}
|
|
583
|
-
//
|
|
584
|
-
|
|
588
|
+
// Check for warnings that haven't been overridden
|
|
589
|
+
const nonOverriddenWarnings = warningResults.filter((wr) => {
|
|
590
|
+
const rule = this.registry.getRule(wr.ruleId);
|
|
591
|
+
if (!rule || !rule.canBeOverridden)
|
|
592
|
+
return true;
|
|
593
|
+
// Check if any override can override this warning
|
|
594
|
+
const canBeOverridden = overrideResults.some((or) => {
|
|
595
|
+
const overrideRule = this.registry.getRule(or.ruleId);
|
|
596
|
+
return overrideRule && rule.overridableBy.includes(overrideRule.id);
|
|
597
|
+
});
|
|
598
|
+
return !canBeOverridden; // Still a warning if no override present
|
|
599
|
+
});
|
|
600
|
+
// If we have non-overridden warnings, show with warnings
|
|
601
|
+
if (nonOverriddenWarnings.length > 0) {
|
|
585
602
|
return VisibilityState.VISIBLE_WITH_WARNINGS;
|
|
586
603
|
}
|
|
587
604
|
return VisibilityState.VISIBLE;
|