lightning-flow-scanner-core
Advanced tools
Comparing version 2.18.0 to 2.19.0
@@ -17,25 +17,30 @@ "use strict"; | ||
for (const flow of flows) { | ||
const ruleResults = []; | ||
for (const rule of selectedRules) { | ||
if (rule.supportedTypes.includes(flow.type[0])) { | ||
try { | ||
let config = undefined; | ||
if (rulesConfig) { | ||
const configKeys = Keys_1.keys(rulesConfig); | ||
let matchedKey = configKeys.find(element => element = rule.name); | ||
config = rulesConfig.get(matchedKey); | ||
config['severity']; | ||
try { | ||
const ruleResults = []; | ||
for (const rule of selectedRules) { | ||
if (rule.supportedTypes.includes(flow.type[0])) { | ||
try { | ||
let config = undefined; | ||
if (rulesConfig) { | ||
const configKeys = Keys_1.keys(rulesConfig); | ||
let matchedKey = configKeys.find(element => element = rule.name); | ||
config = rulesConfig.get(matchedKey); | ||
config['severity']; | ||
} | ||
const result = config && Object.keys(config).length > 0 ? rule.execute(flow, config) : rule.execute(flow); | ||
if (result.severity !== rule.severity) { | ||
result.severity = rule.severity; | ||
} | ||
ruleResults.push(result); | ||
} | ||
const result = config && Object.keys(config).length > 0 ? rule.execute(flow, config) : rule.execute(flow); | ||
if (result.severity !== rule.severity) { | ||
result.severity = rule.severity; | ||
catch (error) { | ||
throw new error("Something went wrong while executing " + rule.name + " in the Flow: '" + flow.name + "'"); | ||
} | ||
ruleResults.push(result); | ||
} | ||
catch (error) { | ||
throw new Error("Something went wrong while executing " + rule.name); | ||
} | ||
} | ||
flowResults.push(new ScanResult_1.ScanResult(flow, ruleResults)); | ||
} | ||
flowResults.push(new ScanResult_1.ScanResult(flow, ruleResults)); | ||
catch (error) { | ||
console.log(error.message); | ||
} | ||
} | ||
@@ -42,0 +47,0 @@ return flowResults; |
@@ -27,9 +27,18 @@ "use strict"; | ||
let nullCheckFound = false; | ||
let resultReference; | ||
let resultReferences = []; | ||
let t1 = getElement.element['storeOutputAutomatically']; | ||
let t2 = getElement.element['outputAssignments']; | ||
let t3 = getElement.element['outputReference']; | ||
if (getElement.element['storeOutputAutomatically']) { | ||
resultReference = [getElement.name]; | ||
resultReferences = [getElement.name]; | ||
} | ||
else { | ||
resultReference = getElement.element['outputReference']; | ||
else if (getElement.element['outputAssignments']) { | ||
const outputAssignments = getElement.element['outputAssignments']; | ||
for (const assignment of outputAssignments) { | ||
resultReferences.push(assignment.assignToReference); | ||
} | ||
} | ||
else if (getElement.element['outputReference'] && getElement.element['outputReference'].size > 0) { | ||
resultReferences = getElement.element['outputReference']; | ||
} | ||
for (const el of decisionElements) { | ||
@@ -44,3 +53,6 @@ const rules = el.element['rules']; | ||
let valueReference = condition.leftValueReference[0]; | ||
referenceFound = (valueReference == resultReference[0]); | ||
// todo loop over resultReference | ||
for (let ref of resultReferences) { | ||
referenceFound = ref.includes(valueReference); | ||
} | ||
} | ||
@@ -47,0 +59,0 @@ if (condition.operator && condition.operator.length > 0) { |
{ | ||
"name": "lightning-flow-scanner-core", | ||
"version": "2.18.0", | ||
"version": "2.19.0", | ||
"main": "out/**", | ||
@@ -5,0 +5,0 @@ "types": "out/index.d.ts", |
@@ -19,24 +19,30 @@ import { IRuleDefinition } from '../interfaces/IRuleDefinition'; | ||
for (const flow of flows) { | ||
const ruleResults: RuleResult[] = []; | ||
for (const rule of selectedRules) { | ||
if (rule.supportedTypes.includes(flow.type[0])) { | ||
try { | ||
let config = undefined; | ||
if (rulesConfig) { | ||
const configKeys = keys(rulesConfig); | ||
let matchedKey = configKeys.find(element => element = rule.name); | ||
config = rulesConfig.get(matchedKey); | ||
config['severity']; | ||
try{ | ||
const ruleResults: RuleResult[] = []; | ||
for (const rule of selectedRules) { | ||
if (rule.supportedTypes.includes(flow.type[0])) { | ||
try { | ||
let config = undefined; | ||
if (rulesConfig) { | ||
const configKeys = keys(rulesConfig); | ||
let matchedKey = configKeys.find(element => element = rule.name); | ||
config = rulesConfig.get(matchedKey); | ||
config['severity']; | ||
} | ||
const result = config && Object.keys(config).length > 0 ? rule.execute(flow, config) : rule.execute(flow); | ||
if (result.severity !== rule.severity) { | ||
result.severity = rule.severity; | ||
} | ||
ruleResults.push(result); | ||
} catch (error) { | ||
throw new error("Something went wrong while executing " + rule.name + " in the Flow: '" + flow.name + "'"); | ||
} | ||
const result = config && Object.keys(config).length > 0 ? rule.execute(flow, config) : rule.execute(flow); | ||
if (result.severity !== rule.severity) { | ||
result.severity = rule.severity; | ||
} | ||
ruleResults.push(result); | ||
} catch (error) { | ||
throw new Error("Something went wrong while executing " + rule.name); | ||
} | ||
} | ||
flowResults.push(new ScanResult(flow, ruleResults)); | ||
} | ||
flowResults.push(new ScanResult(flow, ruleResults)); | ||
catch (error) { | ||
console.log(error.message) | ||
} | ||
} | ||
@@ -43,0 +49,0 @@ |
@@ -32,7 +32,17 @@ import { IRuleDefinition } from '../interfaces/IRuleDefinition'; | ||
let nullCheckFound = false; | ||
let resultReference; | ||
let resultReferences = []; | ||
let t1 = getElement.element['storeOutputAutomatically']; | ||
let t2 = getElement.element['outputAssignments']; | ||
let t3 = getElement.element['outputReference']; | ||
if (getElement.element['storeOutputAutomatically']) { | ||
resultReference = [getElement.name]; | ||
} else { | ||
resultReference = getElement.element['outputReference']; | ||
resultReferences = [getElement.name]; | ||
} else if(getElement.element['outputAssignments']) { | ||
const outputAssignments = getElement.element['outputAssignments']; | ||
for (const assignment of outputAssignments) { | ||
resultReferences.push(assignment.assignToReference) | ||
} | ||
} else if(getElement.element['outputReference'] && getElement.element['outputReference'].size > 0){ | ||
resultReferences = getElement.element['outputReference']; | ||
} | ||
@@ -43,3 +53,2 @@ for (const el of decisionElements) { | ||
for (const condition of rule.conditions) { | ||
let referenceFound: boolean = false; | ||
@@ -50,3 +59,6 @@ let isNullOperator: boolean = false; | ||
let valueReference = condition.leftValueReference[0]; | ||
referenceFound = (valueReference == resultReference[0]); | ||
// todo loop over resultReference | ||
for(let ref of resultReferences){ | ||
referenceFound = ref.includes(valueReference); | ||
} | ||
} | ||
@@ -53,0 +65,0 @@ if (condition.operator && condition.operator.length > 0) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
882858
223
29878