@flow-scanner/lightning-flow-scanner-core 6.16.2 → 6.17.1
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/.husky/pre-commit +1 -0
- package/.husky/pre-push +1 -0
- package/.prettierignore +5 -0
- package/.swcrc +26 -0
- package/.turbo/turbo-build.log +17 -0
- package/.turbo/turbo-test.log +144 -0
- package/.turbo/turbo-vite$colon$dist.log +21 -0
- package/coverage/coverage-final.json +63 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +236 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/src/index.html +116 -0
- package/coverage/lcov-report/src/index.ts.html +238 -0
- package/coverage/lcov-report/src/main/adapters/RegexAdapter.ts.html +118 -0
- package/coverage/lcov-report/src/main/adapters/index.html +116 -0
- package/coverage/lcov-report/src/main/config/NodeIcons.ts.html +376 -0
- package/coverage/lcov-report/src/main/config/RuleRegistry.ts.html +646 -0
- package/coverage/lcov-report/src/main/config/VariableIcons.ts.html +253 -0
- package/coverage/lcov-report/src/main/config/index.html +146 -0
- package/coverage/lcov-report/src/main/enums/MetaType.ts.html +100 -0
- package/coverage/lcov-report/src/main/enums/MetadataType.ts.html +103 -0
- package/coverage/lcov-report/src/main/enums/MetadataTypes.ts.html +100 -0
- package/coverage/lcov-report/src/main/enums/index.html +116 -0
- package/coverage/lcov-report/src/main/interfaces/IRulesConfig.ts.html +133 -0
- package/coverage/lcov-report/src/main/interfaces/index.html +116 -0
- package/coverage/lcov-report/src/main/internals/index.html +116 -0
- package/coverage/lcov-report/src/main/internals/internals.ts.html +190 -0
- package/coverage/lcov-report/src/main/libs/BuildFlow.ts.html +127 -0
- package/coverage/lcov-report/src/main/libs/Compiler.ts.html +241 -0
- package/coverage/lcov-report/src/main/libs/ConvertFlowNodes.ts.html +97 -0
- package/coverage/lcov-report/src/main/libs/DynamicRule.ts.html +118 -0
- package/coverage/lcov-report/src/main/libs/ExportDetails.ts.html +256 -0
- package/coverage/lcov-report/src/main/libs/ExportDiagram.ts.html +331 -0
- package/coverage/lcov-report/src/main/libs/ExportSarif.ts.html +358 -0
- package/coverage/lcov-report/src/main/libs/FixFlows.ts.html +265 -0
- package/coverage/lcov-report/src/main/libs/GenerateMarkdown.ts.html +331 -0
- package/coverage/lcov-report/src/main/libs/GetRuleDefinitions.ts.html +274 -0
- package/coverage/lcov-report/src/main/libs/ParseFlows.ts.html +184 -0
- package/coverage/lcov-report/src/main/libs/RuleDocumentation.ts.html +190 -0
- package/coverage/lcov-report/src/main/libs/ScanFlows.ts.html +508 -0
- package/coverage/lcov-report/src/main/libs/exportAsDetails.ts.html +160 -0
- package/coverage/lcov-report/src/main/libs/exportAsSarif.ts.html +346 -0
- package/coverage/lcov-report/src/main/libs/index.html +251 -0
- package/coverage/lcov-report/src/main/models/FlatViolation.ts.html +106 -0
- package/coverage/lcov-report/src/main/models/Flow.ts.html +1057 -0
- package/coverage/lcov-report/src/main/models/FlowAttribute.ts.html +115 -0
- package/coverage/lcov-report/src/main/models/FlowElement.ts.html +133 -0
- package/coverage/lcov-report/src/main/models/FlowElementConnector.ts.html +169 -0
- package/coverage/lcov-report/src/main/models/FlowGraph.ts.html +1672 -0
- package/coverage/lcov-report/src/main/models/FlowMetadata.ts.html +106 -0
- package/coverage/lcov-report/src/main/models/FlowNode.ts.html +1252 -0
- package/coverage/lcov-report/src/main/models/FlowResource.ts.html +106 -0
- package/coverage/lcov-report/src/main/models/FlowType.ts.html +244 -0
- package/coverage/lcov-report/src/main/models/FlowVariable.ts.html +553 -0
- package/coverage/lcov-report/src/main/models/LoopRuleCommon.ts.html +235 -0
- package/coverage/lcov-report/src/main/models/ParsedFlow.ts.html +121 -0
- package/coverage/lcov-report/src/main/models/RuleCommon.ts.html +442 -0
- package/coverage/lcov-report/src/main/models/RuleResult.ts.html +172 -0
- package/coverage/lcov-report/src/main/models/ScanResult.ts.html +121 -0
- package/coverage/lcov-report/src/main/models/Violation.ts.html +316 -0
- package/coverage/lcov-report/src/main/models/index.html +341 -0
- package/coverage/lcov-report/src/main/rules/APIVersion.ts.html +361 -0
- package/coverage/lcov-report/src/main/rules/ActionCallsInLoop.ts.html +157 -0
- package/coverage/lcov-report/src/main/rules/AutoLayout.ts.html +220 -0
- package/coverage/lcov-report/src/main/rules/CopyAPIName.ts.html +175 -0
- package/coverage/lcov-report/src/main/rules/CyclomaticComplexity.ts.html +292 -0
- package/coverage/lcov-report/src/main/rules/DMLStatementInLoop.ts.html +163 -0
- package/coverage/lcov-report/src/main/rules/DuplicateDMLOperation.ts.html +334 -0
- package/coverage/lcov-report/src/main/rules/FlowDescription.ts.html +184 -0
- package/coverage/lcov-report/src/main/rules/FlowName.ts.html +229 -0
- package/coverage/lcov-report/src/main/rules/GetRecordAllFields.ts.html +280 -0
- package/coverage/lcov-report/src/main/rules/HardcodedId.ts.html +238 -0
- package/coverage/lcov-report/src/main/rules/HardcodedSecret.ts.html +238 -0
- package/coverage/lcov-report/src/main/rules/HardcodedUrl.ts.html +247 -0
- package/coverage/lcov-report/src/main/rules/InactiveFlow.ts.html +184 -0
- package/coverage/lcov-report/src/main/rules/MissingFaultPath.ts.html +397 -0
- package/coverage/lcov-report/src/main/rules/MissingFilterRecordTrigger.ts.html +229 -0
- package/coverage/lcov-report/src/main/rules/MissingMetadataDescription.ts.html +211 -0
- package/coverage/lcov-report/src/main/rules/MissingNullHandler.ts.html +460 -0
- package/coverage/lcov-report/src/main/rules/MissingRecordTriggerFilter.ts.html +235 -0
- package/coverage/lcov-report/src/main/rules/ProcessBuilder.ts.html +190 -0
- package/coverage/lcov-report/src/main/rules/RecordIdAsString.ts.html +274 -0
- package/coverage/lcov-report/src/main/rules/RecursiveAfterUpdate.ts.html +364 -0
- package/coverage/lcov-report/src/main/rules/SOQLQueryInLoop.ts.html +160 -0
- package/coverage/lcov-report/src/main/rules/SameRecordFieldUpdates.ts.html +283 -0
- package/coverage/lcov-report/src/main/rules/TransformInsteadOfLoop.ts.html +250 -0
- package/coverage/lcov-report/src/main/rules/TriggerOrder.ts.html +238 -0
- package/coverage/lcov-report/src/main/rules/UnconnectedElement.ts.html +178 -0
- package/coverage/lcov-report/src/main/rules/UnsafeRunningContext.ts.html +226 -0
- package/coverage/lcov-report/src/main/rules/UnusedVariable.ts.html +283 -0
- package/coverage/lcov-report/src/main/rules/index.html +521 -0
- package/coverage/lcov-report/src/main/store/DefaultRuleStore.ts.html +265 -0
- package/coverage/lcov-report/src/main/store/RuleRegistry.ts.html +118 -0
- package/coverage/lcov-report/src/main/store/index.html +116 -0
- package/coverage/lcov.info +6261 -0
- package/eslint.config.mjs +36 -0
- package/jest.config.cjs +32 -0
- package/jest.env-setup.js +101 -0
- package/lint-staged.config.mjs +8 -0
- package/out/main/config/RegexAdapter.d.ts +32 -0
- package/out/main/config/RegexAdapter.js +86 -0
- package/{main → out/main}/config/RuleRegistry.js +2 -0
- package/out/main/rules/FlowName.d.ts +15 -0
- package/{main → out/main}/rules/FlowName.js +24 -11
- package/out/main/rules/HardcodedId.d.ts +13 -0
- package/{main → out/main}/rules/HardcodedId.js +23 -4
- package/out/main/rules/HardcodedSecret.d.ts +13 -0
- package/out/main/rules/HardcodedSecret.js +101 -0
- package/{main → out/main}/rules/HardcodedUrl.d.ts +6 -0
- package/{main → out/main}/rules/HardcodedUrl.js +23 -5
- package/package.json +58 -8
- package/prettier.config.mjs +5 -0
- package/src/index.ts +52 -0
- package/src/main/config/NodeIcons.ts +98 -0
- package/src/main/config/RegexAdapter.ts +98 -0
- package/src/main/config/RuleRegistry.ts +188 -0
- package/src/main/config/VariableIcons.ts +57 -0
- package/src/main/enums/MetadataTypes.ts +6 -0
- package/src/main/interfaces/IExceptions.ts +6 -0
- package/src/main/interfaces/IRuleConfig.ts +6 -0
- package/src/main/interfaces/IRuleDefinition.ts +15 -0
- package/src/main/interfaces/IRuleOptions.ts +5 -0
- package/src/main/interfaces/IRulesConfig.ts +17 -0
- package/src/main/internals/internals.ts +35 -0
- package/src/main/libs/BuildFlow.ts +14 -0
- package/src/main/libs/Compiler.ts +53 -0
- package/src/main/libs/ExportDetails.ts +58 -0
- package/src/main/libs/ExportDiagram.ts +83 -0
- package/src/main/libs/ExportSarif.ts +92 -0
- package/src/main/libs/FixFlows.ts +61 -0
- package/src/main/libs/GetRuleDefinitions.ts +64 -0
- package/src/main/libs/ParseFlows.ts +34 -0
- package/src/main/libs/RuleDocumentation.ts +35 -0
- package/src/main/libs/ScanFlows.ts +142 -0
- package/src/main/models/FlatViolation.ts +16 -0
- package/src/main/models/Flow.ts +325 -0
- package/src/main/models/FlowAttribute.ts +11 -0
- package/src/main/models/FlowElement.ts +16 -0
- package/src/main/models/FlowElementConnector.ts +28 -0
- package/src/main/models/FlowGraph.ts +530 -0
- package/src/main/models/FlowMetadata.ts +8 -0
- package/src/main/models/FlowNode.ts +390 -0
- package/src/main/models/FlowResource.ts +8 -0
- package/src/main/models/FlowType.ts +53 -0
- package/src/main/models/FlowVariable.ts +157 -0
- package/src/main/models/LoopRuleCommon.ts +51 -0
- package/src/main/models/ParsedFlow.ts +13 -0
- package/src/main/models/RuleCommon.ts +120 -0
- package/src/main/models/RuleInfo.ts +54 -0
- package/src/main/models/RuleResult.ts +29 -0
- package/src/main/models/ScanResult.ts +12 -0
- package/src/main/models/Violation.ts +78 -0
- package/src/main/rules/APIVersion.ts +93 -0
- package/src/main/rules/ActionCallsInLoop.ts +25 -0
- package/src/main/rules/AutoLayout.ts +46 -0
- package/src/main/rules/CopyAPIName.ts +31 -0
- package/src/main/rules/CyclomaticComplexity.ts +70 -0
- package/src/main/rules/DMLStatementInLoop.ts +26 -0
- package/src/main/rules/DuplicateDMLOperation.ts +83 -0
- package/src/main/rules/FlowDescription.ts +34 -0
- package/src/main/rules/FlowName.ts +49 -0
- package/src/main/rules/GetRecordAllFields.ts +65 -0
- package/src/main/rules/HardcodedId.ts +51 -0
- package/src/main/rules/HardcodedSecret.ts +51 -0
- package/src/main/rules/HardcodedUrl.ts +54 -0
- package/src/main/rules/InactiveFlow.ts +33 -0
- package/src/main/rules/MissingFaultPath.ts +105 -0
- package/src/main/rules/MissingMetadataDescription.ts +42 -0
- package/src/main/rules/MissingNullHandler.ts +126 -0
- package/src/main/rules/MissingRecordTriggerFilter.ts +51 -0
- package/src/main/rules/ProcessBuilder.ts +35 -0
- package/src/main/rules/RecordIdAsString.ts +64 -0
- package/src/main/rules/RecursiveAfterUpdate.ts +94 -0
- package/src/main/rules/SOQLQueryInLoop.ts +26 -0
- package/src/main/rules/SameRecordFieldUpdates.ts +66 -0
- package/src/main/rules/TransformInsteadOfLoop.ts +56 -0
- package/src/main/rules/TriggerOrder.ts +51 -0
- package/src/main/rules/UnconnectedElement.ts +32 -0
- package/src/main/rules/UnsafeRunningContext.ts +47 -0
- package/src/main/rules/UnusedVariable.ts +66 -0
- package/stryker.config.mjs +23 -0
- package/tests/APIVersion.test.ts +87 -0
- package/tests/AutoLayout.test.ts +41 -0
- package/tests/Config.test.ts +122 -0
- package/tests/ConfigBetaMode.test.ts +26 -0
- package/tests/CopyAPIName.test.ts +45 -0
- package/tests/CyclomaticComplexity.test.ts +125 -0
- package/tests/DMLStatementInLoop.test.ts +32 -0
- package/tests/DuplicateDMLOperation.test.ts +43 -0
- package/tests/EnabledFalse.test.ts +63 -0
- package/tests/Exceptions.test.ts +815 -0
- package/tests/ExportSarif.test.ts +62 -0
- package/tests/FlowDescription.test.ts +44 -0
- package/tests/FlowDocumentation.test.ts +74 -0
- package/tests/FlowName.test.ts +61 -0
- package/tests/GetRecordElementAllFields.test.ts +182 -0
- package/tests/HardcodedId.test.ts +16 -0
- package/tests/HardcodedSecret.test.ts +32 -0
- package/tests/HardcodedUrl.test.ts +253 -0
- package/tests/InactiveFlow.test.ts +103 -0
- package/tests/MissingFaultPath.test.ts +52 -0
- package/tests/MissingMetadataDescription.test.ts +25 -0
- package/tests/MissingNullHandler.test.ts +45 -0
- package/tests/MissingRecordTriggerFilter.test.ts +54 -0
- package/tests/RecordIdAsString.test.ts +60 -0
- package/tests/RecursiveAfterUpdate.test.ts +183 -0
- package/tests/SOQLQueryInLoop.test.ts +33 -0
- package/tests/SameRecordFieldUpdates.test.ts +205 -0
- package/tests/SanityTest.test.ts +15 -0
- package/tests/TransformInsteadOfLoop.test.ts +33 -0
- package/tests/TriggerOrder.test.ts +112 -0
- package/tests/UnconnectedElement.test.ts +76 -0
- package/tests/UnsafeRunningContext.test.ts +46 -0
- package/tests/UnusedVariable.test.ts +59 -0
- package/tests/UnusedVariableExceptions.test.ts +87 -0
- package/tests/jsonfiles/MissingFaultPath_BeforeSave_Bypass.json +128 -0
- package/tests/jsonfiles/MissingFaultPath_WaitConditions.json +102 -0
- package/tests/jsonfiles/MissingFaultPath_WaitDate.json +88 -0
- package/tests/jsonfiles/MissingFaultPath_WaitDuration.json +90 -0
- package/tests/models/Flow.test.ts +107 -0
- package/tests/models/LoopRuleCommon.test.ts +246 -0
- package/tests/models/RuleCommon.test.ts +41 -0
- package/tsconfig.json +28 -0
- package/tsconfig.types.json +26 -0
- package/types/index.d.ts +27 -0
- package/types/index.d.ts.map +1 -0
- package/types/main/adapters/RegexAdapter.d.ts +33 -0
- package/types/main/adapters/RegexAdapter.d.ts.map +1 -0
- package/types/main/config/NodeIcons.d.ts +25 -0
- package/types/main/config/NodeIcons.d.ts.map +1 -0
- package/types/main/config/RegexAdapter.d.ts +33 -0
- package/types/main/config/RegexAdapter.d.ts.map +1 -0
- package/types/main/config/RuleRegistry.d.ts +23 -0
- package/types/main/config/RuleRegistry.d.ts.map +1 -0
- package/types/main/config/VariableIcons.d.ts +26 -0
- package/types/main/config/VariableIcons.d.ts.map +1 -0
- package/types/main/enums/MetadataTypes.d.ts +7 -0
- package/types/main/enums/MetadataTypes.d.ts.map +1 -0
- package/types/main/interfaces/IExceptions.d.ts +6 -0
- package/types/main/interfaces/IExceptions.d.ts.map +1 -0
- package/types/main/interfaces/IRuleConfig.d.ts +7 -0
- package/types/main/interfaces/IRuleConfig.d.ts.map +1 -0
- package/types/main/interfaces/IRuleDefinition.d.ts +18 -0
- package/types/main/interfaces/IRuleDefinition.d.ts.map +1 -0
- package/types/main/interfaces/IRuleOptions.d.ts +5 -0
- package/types/main/interfaces/IRuleOptions.d.ts.map +1 -0
- package/types/main/interfaces/IRulesConfig.d.ts +16 -0
- package/types/main/interfaces/IRulesConfig.d.ts.map +1 -0
- package/types/main/internals/internals.d.ts +19 -0
- package/types/main/internals/internals.d.ts.map +1 -0
- package/types/main/libs/BuildFlow.d.ts +2 -0
- package/types/main/libs/BuildFlow.d.ts.map +1 -0
- package/types/main/libs/Compiler.d.ts +8 -0
- package/types/main/libs/Compiler.d.ts.map +1 -0
- package/types/main/libs/ConvertFlowNodes.d.ts +2 -0
- package/types/main/libs/ConvertFlowNodes.d.ts.map +1 -0
- package/types/main/libs/DynamicRule.d.ts +5 -0
- package/types/main/libs/DynamicRule.d.ts.map +1 -0
- package/types/main/libs/ExportDetails.d.ts +4 -0
- package/types/main/libs/ExportDetails.d.ts.map +1 -0
- package/types/main/libs/ExportDiagram.d.ts +42 -0
- package/types/main/libs/ExportDiagram.d.ts.map +1 -0
- package/types/main/libs/ExportSarif.d.ts +3 -0
- package/types/main/libs/ExportSarif.d.ts.map +1 -0
- package/types/main/libs/FixFlows.d.ts +4 -0
- package/types/main/libs/FixFlows.d.ts.map +1 -0
- package/types/main/libs/GetRuleDefinitions.d.ts +5 -0
- package/types/main/libs/GetRuleDefinitions.d.ts.map +1 -0
- package/types/main/libs/ParseFlows.d.ts +3 -0
- package/types/main/libs/ParseFlows.d.ts.map +1 -0
- package/types/main/libs/RuleDocumentation.d.ts +21 -0
- package/types/main/libs/RuleDocumentation.d.ts.map +1 -0
- package/types/main/libs/ScanFlows.d.ts +5 -0
- package/types/main/libs/ScanFlows.d.ts.map +1 -0
- package/types/main/libs/exportAsDetails.d.ts +4 -0
- package/types/main/libs/exportAsDetails.d.ts.map +1 -0
- package/types/main/libs/exportAsSarif.d.ts +3 -0
- package/types/main/libs/exportAsSarif.d.ts.map +1 -0
- package/types/main/models/FlatViolation.d.ts +16 -0
- package/types/main/models/FlatViolation.d.ts.map +1 -0
- package/types/main/models/Flow.d.ts +70 -0
- package/types/main/models/Flow.d.ts.map +1 -0
- package/types/main/models/FlowAttribute.d.ts +6 -0
- package/types/main/models/FlowAttribute.d.ts.map +1 -0
- package/types/main/models/FlowElement.d.ts +11 -0
- package/types/main/models/FlowElement.d.ts.map +1 -0
- package/types/main/models/FlowElementConnector.d.ts +16 -0
- package/types/main/models/FlowElementConnector.d.ts.map +1 -0
- package/types/main/models/FlowGraph.d.ts +86 -0
- package/types/main/models/FlowGraph.d.ts.map +1 -0
- package/types/main/models/FlowMetadata.d.ts +5 -0
- package/types/main/models/FlowMetadata.d.ts.map +1 -0
- package/types/main/models/FlowNode.d.ts +66 -0
- package/types/main/models/FlowNode.d.ts.map +1 -0
- package/types/main/models/FlowResource.d.ts +5 -0
- package/types/main/models/FlowResource.d.ts.map +1 -0
- package/types/main/models/FlowType.d.ts +24 -0
- package/types/main/models/FlowType.d.ts.map +1 -0
- package/types/main/models/FlowVariable.d.ts +64 -0
- package/types/main/models/FlowVariable.d.ts.map +1 -0
- package/types/main/models/LoopRuleCommon.d.ts +15 -0
- package/types/main/models/LoopRuleCommon.d.ts.map +1 -0
- package/types/main/models/ParsedFlow.d.ts +8 -0
- package/types/main/models/ParsedFlow.d.ts.map +1 -0
- package/types/main/models/RuleCommon.d.ts +58 -0
- package/types/main/models/RuleCommon.d.ts.map +1 -0
- package/types/main/models/RuleInfo.d.ts +50 -0
- package/types/main/models/RuleInfo.d.ts.map +1 -0
- package/types/main/models/RuleResult.d.ts +15 -0
- package/types/main/models/RuleResult.d.ts.map +1 -0
- package/types/main/models/ScanResult.d.ts +8 -0
- package/types/main/models/ScanResult.d.ts.map +1 -0
- package/types/main/models/Violation.d.ts +12 -0
- package/types/main/models/Violation.d.ts.map +1 -0
- package/{main/rules/FlowName.d.ts → types/main/rules/APIVersion.d.ts} +2 -1
- package/types/main/rules/APIVersion.d.ts.map +1 -0
- package/types/main/rules/ActionCallsInLoop.d.ts +7 -0
- package/types/main/rules/ActionCallsInLoop.d.ts.map +1 -0
- package/types/main/rules/AutoLayout.d.ts +8 -0
- package/types/main/rules/AutoLayout.d.ts.map +1 -0
- package/types/main/rules/CopyAPIName.d.ts +8 -0
- package/types/main/rules/CopyAPIName.d.ts.map +1 -0
- package/types/main/rules/CyclomaticComplexity.d.ts +12 -0
- package/types/main/rules/CyclomaticComplexity.d.ts.map +1 -0
- package/types/main/rules/DMLStatementInLoop.d.ts +7 -0
- package/types/main/rules/DMLStatementInLoop.d.ts.map +1 -0
- package/types/main/rules/DuplicateDMLOperation.d.ts +9 -0
- package/types/main/rules/DuplicateDMLOperation.d.ts.map +1 -0
- package/{main/rules/HardcodedId.d.ts → types/main/rules/FlowDescription.d.ts} +2 -1
- package/types/main/rules/FlowDescription.d.ts.map +1 -0
- package/types/main/rules/FlowName.d.ts +16 -0
- package/types/main/rules/FlowName.d.ts.map +1 -0
- package/types/main/rules/GetRecordAllFields.d.ts +8 -0
- package/types/main/rules/GetRecordAllFields.d.ts.map +1 -0
- package/types/main/rules/HardcodedId.d.ts +14 -0
- package/types/main/rules/HardcodedId.d.ts.map +1 -0
- package/types/main/rules/HardcodedSecret.d.ts +14 -0
- package/types/main/rules/HardcodedSecret.d.ts.map +1 -0
- package/types/main/rules/HardcodedUrl.d.ts +14 -0
- package/types/main/rules/HardcodedUrl.d.ts.map +1 -0
- package/types/main/rules/InactiveFlow.d.ts +8 -0
- package/types/main/rules/InactiveFlow.d.ts.map +1 -0
- package/types/main/rules/MissingFaultPath.d.ts +15 -0
- package/types/main/rules/MissingFaultPath.d.ts.map +1 -0
- package/types/main/rules/MissingFilterRecordTrigger.d.ts +8 -0
- package/types/main/rules/MissingFilterRecordTrigger.d.ts.map +1 -0
- package/types/main/rules/MissingMetadataDescription.d.ts +8 -0
- package/types/main/rules/MissingMetadataDescription.d.ts.map +1 -0
- package/types/main/rules/MissingNullHandler.d.ts +8 -0
- package/types/main/rules/MissingNullHandler.d.ts.map +1 -0
- package/types/main/rules/MissingRecordTriggerFilter.d.ts +8 -0
- package/types/main/rules/MissingRecordTriggerFilter.d.ts.map +1 -0
- package/types/main/rules/ProcessBuilder.d.ts +8 -0
- package/types/main/rules/ProcessBuilder.d.ts.map +1 -0
- package/types/main/rules/RecordIdAsString.d.ts +8 -0
- package/types/main/rules/RecordIdAsString.d.ts.map +1 -0
- package/types/main/rules/RecursiveAfterUpdate.d.ts +9 -0
- package/types/main/rules/RecursiveAfterUpdate.d.ts.map +1 -0
- package/types/main/rules/SOQLQueryInLoop.d.ts +7 -0
- package/types/main/rules/SOQLQueryInLoop.d.ts.map +1 -0
- package/types/main/rules/SameRecordFieldUpdates.d.ts +9 -0
- package/types/main/rules/SameRecordFieldUpdates.d.ts.map +1 -0
- package/types/main/rules/TransformInsteadOfLoop.d.ts +8 -0
- package/types/main/rules/TransformInsteadOfLoop.d.ts.map +1 -0
- package/types/main/rules/TriggerOrder.d.ts +8 -0
- package/types/main/rules/TriggerOrder.d.ts.map +1 -0
- package/types/main/rules/UnconnectedElement.d.ts +8 -0
- package/types/main/rules/UnconnectedElement.d.ts.map +1 -0
- package/types/main/rules/UnsafeRunningContext.d.ts +8 -0
- package/types/main/rules/UnsafeRunningContext.d.ts.map +1 -0
- package/types/main/rules/UnusedVariable.d.ts +8 -0
- package/types/main/rules/UnusedVariable.d.ts.map +1 -0
- package/types/main/store/DefaultRuleStore.d.ts +3 -0
- package/types/main/store/DefaultRuleStore.d.ts.map +1 -0
- package/types/main/store/RuleRegistry.d.ts +23 -0
- package/types/main/store/RuleRegistry.d.ts.map +1 -0
- package/vite.config.ts +33 -0
- package/README.md +0 -635
- /package/{index.d.ts → out/index.d.ts} +0 -0
- /package/{index.js → out/index.js} +0 -0
- /package/{main → out/main}/config/NodeIcons.d.ts +0 -0
- /package/{main → out/main}/config/NodeIcons.js +0 -0
- /package/{main → out/main}/config/RuleRegistry.d.ts +0 -0
- /package/{main → out/main}/config/VariableIcons.d.ts +0 -0
- /package/{main → out/main}/config/VariableIcons.js +0 -0
- /package/{main → out/main}/enums/MetadataTypes.d.ts +0 -0
- /package/{main → out/main}/enums/MetadataTypes.js +0 -0
- /package/{main → out/main}/interfaces/IExceptions.d.ts +0 -0
- /package/{main → out/main}/interfaces/IExceptions.js +0 -0
- /package/{main → out/main}/interfaces/IRuleConfig.d.ts +0 -0
- /package/{main → out/main}/interfaces/IRuleConfig.js +0 -0
- /package/{main → out/main}/interfaces/IRuleDefinition.d.ts +0 -0
- /package/{main → out/main}/interfaces/IRuleDefinition.js +0 -0
- /package/{main → out/main}/interfaces/IRuleOptions.d.ts +0 -0
- /package/{main → out/main}/interfaces/IRuleOptions.js +0 -0
- /package/{main → out/main}/interfaces/IRulesConfig.d.ts +0 -0
- /package/{main → out/main}/interfaces/IRulesConfig.js +0 -0
- /package/{main → out/main}/internals/internals.d.ts +0 -0
- /package/{main → out/main}/internals/internals.js +0 -0
- /package/{main → out/main}/libs/BuildFlow.d.ts +0 -0
- /package/{main → out/main}/libs/BuildFlow.js +0 -0
- /package/{main → out/main}/libs/Compiler.d.ts +0 -0
- /package/{main → out/main}/libs/Compiler.js +0 -0
- /package/{main → out/main}/libs/ExportDetails.d.ts +0 -0
- /package/{main → out/main}/libs/ExportDetails.js +0 -0
- /package/{main → out/main}/libs/ExportDiagram.d.ts +0 -0
- /package/{main → out/main}/libs/ExportDiagram.js +0 -0
- /package/{main → out/main}/libs/ExportSarif.d.ts +0 -0
- /package/{main → out/main}/libs/ExportSarif.js +0 -0
- /package/{main → out/main}/libs/FixFlows.d.ts +0 -0
- /package/{main → out/main}/libs/FixFlows.js +0 -0
- /package/{main → out/main}/libs/GetRuleDefinitions.d.ts +0 -0
- /package/{main → out/main}/libs/GetRuleDefinitions.js +0 -0
- /package/{main → out/main}/libs/ParseFlows.d.ts +0 -0
- /package/{main → out/main}/libs/ParseFlows.js +0 -0
- /package/{main → out/main}/libs/RuleDocumentation.d.ts +0 -0
- /package/{main → out/main}/libs/RuleDocumentation.js +0 -0
- /package/{main → out/main}/libs/ScanFlows.d.ts +0 -0
- /package/{main → out/main}/libs/ScanFlows.js +0 -0
- /package/{main → out/main}/models/FlatViolation.d.ts +0 -0
- /package/{main → out/main}/models/FlatViolation.js +0 -0
- /package/{main → out/main}/models/Flow.d.ts +0 -0
- /package/{main → out/main}/models/Flow.js +0 -0
- /package/{main → out/main}/models/FlowAttribute.d.ts +0 -0
- /package/{main → out/main}/models/FlowAttribute.js +0 -0
- /package/{main → out/main}/models/FlowElement.d.ts +0 -0
- /package/{main → out/main}/models/FlowElement.js +0 -0
- /package/{main → out/main}/models/FlowElementConnector.d.ts +0 -0
- /package/{main → out/main}/models/FlowElementConnector.js +0 -0
- /package/{main → out/main}/models/FlowGraph.d.ts +0 -0
- /package/{main → out/main}/models/FlowGraph.js +0 -0
- /package/{main → out/main}/models/FlowMetadata.d.ts +0 -0
- /package/{main → out/main}/models/FlowMetadata.js +0 -0
- /package/{main → out/main}/models/FlowNode.d.ts +0 -0
- /package/{main → out/main}/models/FlowNode.js +0 -0
- /package/{main → out/main}/models/FlowResource.d.ts +0 -0
- /package/{main → out/main}/models/FlowResource.js +0 -0
- /package/{main → out/main}/models/FlowType.d.ts +0 -0
- /package/{main → out/main}/models/FlowType.js +0 -0
- /package/{main → out/main}/models/FlowVariable.d.ts +0 -0
- /package/{main → out/main}/models/FlowVariable.js +0 -0
- /package/{main → out/main}/models/LoopRuleCommon.d.ts +0 -0
- /package/{main → out/main}/models/LoopRuleCommon.js +0 -0
- /package/{main → out/main}/models/ParsedFlow.d.ts +0 -0
- /package/{main → out/main}/models/ParsedFlow.js +0 -0
- /package/{main → out/main}/models/RuleCommon.d.ts +0 -0
- /package/{main → out/main}/models/RuleCommon.js +0 -0
- /package/{main → out/main}/models/RuleInfo.d.ts +0 -0
- /package/{main → out/main}/models/RuleInfo.js +0 -0
- /package/{main → out/main}/models/RuleResult.d.ts +0 -0
- /package/{main → out/main}/models/RuleResult.js +0 -0
- /package/{main → out/main}/models/ScanResult.d.ts +0 -0
- /package/{main → out/main}/models/ScanResult.js +0 -0
- /package/{main → out/main}/models/Violation.d.ts +0 -0
- /package/{main → out/main}/models/Violation.js +0 -0
- /package/{main → out/main}/rules/APIVersion.d.ts +0 -0
- /package/{main → out/main}/rules/APIVersion.js +0 -0
- /package/{main → out/main}/rules/ActionCallsInLoop.d.ts +0 -0
- /package/{main → out/main}/rules/ActionCallsInLoop.js +0 -0
- /package/{main → out/main}/rules/AutoLayout.d.ts +0 -0
- /package/{main → out/main}/rules/AutoLayout.js +0 -0
- /package/{main → out/main}/rules/CopyAPIName.d.ts +0 -0
- /package/{main → out/main}/rules/CopyAPIName.js +0 -0
- /package/{main → out/main}/rules/CyclomaticComplexity.d.ts +0 -0
- /package/{main → out/main}/rules/CyclomaticComplexity.js +0 -0
- /package/{main → out/main}/rules/DMLStatementInLoop.d.ts +0 -0
- /package/{main → out/main}/rules/DMLStatementInLoop.js +0 -0
- /package/{main → out/main}/rules/DuplicateDMLOperation.d.ts +0 -0
- /package/{main → out/main}/rules/DuplicateDMLOperation.js +0 -0
- /package/{main → out/main}/rules/FlowDescription.d.ts +0 -0
- /package/{main → out/main}/rules/FlowDescription.js +0 -0
- /package/{main → out/main}/rules/GetRecordAllFields.d.ts +0 -0
- /package/{main → out/main}/rules/GetRecordAllFields.js +0 -0
- /package/{main → out/main}/rules/InactiveFlow.d.ts +0 -0
- /package/{main → out/main}/rules/InactiveFlow.js +0 -0
- /package/{main → out/main}/rules/MissingFaultPath.d.ts +0 -0
- /package/{main → out/main}/rules/MissingFaultPath.js +0 -0
- /package/{main → out/main}/rules/MissingMetadataDescription.d.ts +0 -0
- /package/{main → out/main}/rules/MissingMetadataDescription.js +0 -0
- /package/{main → out/main}/rules/MissingNullHandler.d.ts +0 -0
- /package/{main → out/main}/rules/MissingNullHandler.js +0 -0
- /package/{main → out/main}/rules/MissingRecordTriggerFilter.d.ts +0 -0
- /package/{main → out/main}/rules/MissingRecordTriggerFilter.js +0 -0
- /package/{main → out/main}/rules/ProcessBuilder.d.ts +0 -0
- /package/{main → out/main}/rules/ProcessBuilder.js +0 -0
- /package/{main → out/main}/rules/RecordIdAsString.d.ts +0 -0
- /package/{main → out/main}/rules/RecordIdAsString.js +0 -0
- /package/{main → out/main}/rules/RecursiveAfterUpdate.d.ts +0 -0
- /package/{main → out/main}/rules/RecursiveAfterUpdate.js +0 -0
- /package/{main → out/main}/rules/SOQLQueryInLoop.d.ts +0 -0
- /package/{main → out/main}/rules/SOQLQueryInLoop.js +0 -0
- /package/{main → out/main}/rules/SameRecordFieldUpdates.d.ts +0 -0
- /package/{main → out/main}/rules/SameRecordFieldUpdates.js +0 -0
- /package/{main → out/main}/rules/TransformInsteadOfLoop.d.ts +0 -0
- /package/{main → out/main}/rules/TransformInsteadOfLoop.js +0 -0
- /package/{main → out/main}/rules/TriggerOrder.d.ts +0 -0
- /package/{main → out/main}/rules/TriggerOrder.js +0 -0
- /package/{main → out/main}/rules/UnconnectedElement.d.ts +0 -0
- /package/{main → out/main}/rules/UnconnectedElement.js +0 -0
- /package/{main → out/main}/rules/UnsafeRunningContext.d.ts +0 -0
- /package/{main → out/main}/rules/UnsafeRunningContext.js +0 -0
- /package/{main → out/main}/rules/UnusedVariable.d.ts +0 -0
- /package/{main → out/main}/rules/UnusedVariable.js +0 -0
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flow-scanner/lightning-flow-scanner-core",
|
|
3
3
|
"description": "A lightweight engine for Flow metadata in Node.js, and browser environments. Assess and enhance Salesforce Flow automations for best practices, security, governor limits, and performance issues.",
|
|
4
|
-
"version": "6.
|
|
5
|
-
"main": "index.js",
|
|
4
|
+
"version": "6.17.1",
|
|
5
|
+
"main": "out/index.js",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
8
|
+
"types": "./out/index.d.ts",
|
|
9
|
+
"import": "./out/index.js",
|
|
10
|
+
"require": "./out/index.js",
|
|
11
|
+
"default": "./out/index.js"
|
|
11
12
|
}
|
|
12
13
|
},
|
|
13
14
|
"engines": {
|
|
@@ -20,7 +21,35 @@
|
|
|
20
21
|
"directory": "packages/core"
|
|
21
22
|
},
|
|
22
23
|
"dependencies": {
|
|
23
|
-
"fast-xml-parser": "^5.3.0"
|
|
24
|
+
"fast-xml-parser": "^5.3.0",
|
|
25
|
+
"@flow-scanner/regex-scanner": "1.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@jest/types": "30.0.1",
|
|
29
|
+
"@swc-node/jest": "1.9.1",
|
|
30
|
+
"@swc/cli": "0.7.7",
|
|
31
|
+
"@swc/core": "1.13.5",
|
|
32
|
+
"@swc/helpers": "0.5.17",
|
|
33
|
+
"@types/jest": "29.5.14",
|
|
34
|
+
"@types/node": "22.15.30",
|
|
35
|
+
"@types/semantic-release": "20.0.6",
|
|
36
|
+
"cross-env": "^10.1.0",
|
|
37
|
+
"eslint": "9.30.0",
|
|
38
|
+
"eslint-plugin-de-morgan": "1.3.0",
|
|
39
|
+
"eslint-plugin-github": "6.0.0",
|
|
40
|
+
"eslint-plugin-jest": "29.0.1",
|
|
41
|
+
"eslint-plugin-perfectionist": "4.15.0",
|
|
42
|
+
"eslint-plugin-sonarjs": "3.0.4",
|
|
43
|
+
"husky": "9.1.7",
|
|
44
|
+
"jest": "30.0.3",
|
|
45
|
+
"lint-staged": "^16.1.2",
|
|
46
|
+
"prettier": "3.6.2",
|
|
47
|
+
"rimraf": "^6.1.0",
|
|
48
|
+
"ts-node": "10.9.2",
|
|
49
|
+
"typescript": "5.8.3",
|
|
50
|
+
"typescript-eslint": "8.35.0",
|
|
51
|
+
"vite": "6.4.1",
|
|
52
|
+
"vite-plugin-node-polyfills": "0.23.0"
|
|
24
53
|
},
|
|
25
54
|
"homepage": "https://flow-scanner.github.io/lightning-flow-scanner/",
|
|
26
55
|
"author": {
|
|
@@ -39,5 +68,26 @@
|
|
|
39
68
|
"security-scanner",
|
|
40
69
|
"static-analysis"
|
|
41
70
|
],
|
|
42
|
-
"
|
|
43
|
-
|
|
71
|
+
"scripts": {
|
|
72
|
+
"clean": "rimraf out dist",
|
|
73
|
+
"build:js": "swc src --out-dir out --copy-files --strip-leading-paths --config-file .swcrc",
|
|
74
|
+
"build:types": "tsc -p tsconfig.types.json --declaration --emitDeclarationOnly --outDir out",
|
|
75
|
+
"prepare:publish": "node ../../.github/scripts/prepare-publish.js",
|
|
76
|
+
"copy:root-files:dist": "node -e \"['../../LICENSE.md'].forEach(f => { const n = f.split('/').pop(); if (require('fs').existsSync(f)) require('fs').copyFileSync(f, 'dist/'+n) })\"",
|
|
77
|
+
"____main____": "__DEVELOPER COMMANDS__",
|
|
78
|
+
"build": "npm run clean && npm run build:js && npm run build:types",
|
|
79
|
+
"test": "npm run test:umd",
|
|
80
|
+
"test:node": "jest",
|
|
81
|
+
"test:umd": "npm run build:js && vite build && npm run copy:root-files:dist && cross-env UMD_PATH=dist/lightning-flow-scanner-core.umd.js jest",
|
|
82
|
+
"link": "npm run build && npm link ./out",
|
|
83
|
+
"____pack____": "PACKAGING COMMANDS__",
|
|
84
|
+
"swc:sim:pack": "npm run build",
|
|
85
|
+
"vite:dist": "npm run build:js && vite build && npm run copy:root-files:dist",
|
|
86
|
+
"stryker": "npm i -g @stryker-mutator/core @stryker-mutator/jest-runner && stryker run",
|
|
87
|
+
"version:patch": "pnpm version patch --no-git-tag-version",
|
|
88
|
+
"version:minor": "pnpm version minor --no-git-tag-version",
|
|
89
|
+
"version:major": "pnpm version major --no-git-tag-version",
|
|
90
|
+
"publish:npm": "npm run build && npm run prepare:publish && cd out && npm publish",
|
|
91
|
+
"tag": "node ../../scripts/publish-core-tag.js"
|
|
92
|
+
}
|
|
93
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Updated exports in index.ts
|
|
2
|
+
import type { IRuleDefinition } from "./main/interfaces/IRuleDefinition";
|
|
3
|
+
import type { IRulesConfig } from "./main/interfaces/IRulesConfig";
|
|
4
|
+
import type { FlatViolation } from "./main/models/FlatViolation";
|
|
5
|
+
import { Compiler } from "./main/libs/Compiler";
|
|
6
|
+
import { exportDetails } from "./main/libs/ExportDetails";
|
|
7
|
+
import { exportSarif } from "./main/libs/ExportSarif";
|
|
8
|
+
import { fix } from "./main/libs/FixFlows";
|
|
9
|
+
import { getRules } from "./main/libs/GetRuleDefinitions";
|
|
10
|
+
import { parse } from "./main/libs/ParseFlows";
|
|
11
|
+
import { scan } from "./main/libs/ScanFlows";
|
|
12
|
+
import { Flow } from "./main/models/Flow";
|
|
13
|
+
import { FlowAttribute } from "./main/models/FlowAttribute";
|
|
14
|
+
import { FlowElement } from "./main/models/FlowElement";
|
|
15
|
+
import { FlowNode } from "./main/models/FlowNode";
|
|
16
|
+
import { FlowResource } from "./main/models/FlowResource";
|
|
17
|
+
import { FlowType } from "./main/models/FlowType";
|
|
18
|
+
import { FlowVariable } from "./main/models/FlowVariable";
|
|
19
|
+
import { ParsedFlow } from "./main/models/ParsedFlow";
|
|
20
|
+
import { RuleResult } from "./main/models/RuleResult";
|
|
21
|
+
import { ScanResult } from "./main/models/ScanResult";
|
|
22
|
+
import { Violation } from "./main/models/Violation";
|
|
23
|
+
import { DEFAULT_ICONS, ASCII_ICONS, type NodeIconConfig } from "./main/config/NodeIcons";
|
|
24
|
+
import { DEFAULT_VARIABLE_ICONS, ASCII_VARIABLE_ICONS, type VariableIconConfig } from "./main/config/VariableIcons";
|
|
25
|
+
import { exportDiagram, type DiagramOptions } from "./main/libs/ExportDiagram";
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
Compiler,
|
|
29
|
+
exportDetails,
|
|
30
|
+
exportDiagram,
|
|
31
|
+
exportSarif,
|
|
32
|
+
fix,
|
|
33
|
+
Flow,
|
|
34
|
+
FlowAttribute,
|
|
35
|
+
FlowElement,
|
|
36
|
+
FlowNode,
|
|
37
|
+
FlowResource,
|
|
38
|
+
FlowType,
|
|
39
|
+
FlowVariable,
|
|
40
|
+
getRules,
|
|
41
|
+
parse,
|
|
42
|
+
ParsedFlow,
|
|
43
|
+
Violation,
|
|
44
|
+
RuleResult,
|
|
45
|
+
scan,
|
|
46
|
+
ScanResult,
|
|
47
|
+
DEFAULT_ICONS,
|
|
48
|
+
ASCII_ICONS,
|
|
49
|
+
DEFAULT_VARIABLE_ICONS,
|
|
50
|
+
ASCII_VARIABLE_ICONS,
|
|
51
|
+
};
|
|
52
|
+
export type { FlatViolation, IRuleDefinition, IRulesConfig, NodeIconConfig, DiagramOptions, VariableIconConfig };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon configuration for flow node types.
|
|
3
|
+
* Emoji are safe in UTF-8 encoded source files and will work in all modern builds.
|
|
4
|
+
* If you need ASCII fallback, use FlowNode.setIconConfig(ASCII_ICONS)
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export interface NodeIconConfig {
|
|
8
|
+
[nodeType: string]: {
|
|
9
|
+
[subtype: string]: string;
|
|
10
|
+
} | { default: string };
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Default icons using emoji (recommended for modern environments)
|
|
15
|
+
*/
|
|
16
|
+
export const DEFAULT_ICONS: NodeIconConfig = {
|
|
17
|
+
actionCalls: {
|
|
18
|
+
apex: '\u2699\uFE0F', // GEAR (with emoji presentation)
|
|
19
|
+
emailAlert: '\uD83D\uDCE7', // E-MAIL
|
|
20
|
+
emailSimple: '\uD83D\uDCE7', // E-MAIL
|
|
21
|
+
submit: '\u26A1', // HIGH VOLTAGE
|
|
22
|
+
default: '\u26A1' // HIGH VOLTAGE
|
|
23
|
+
},
|
|
24
|
+
assignments: {
|
|
25
|
+
default: '\uD83D\uDFF0' // 🟰 HEAVY EQUALS SIGN
|
|
26
|
+
},
|
|
27
|
+
collectionProcessors: {
|
|
28
|
+
FilterCollectionProcessor: '\uD83D\uDD3D', // DOWN BUTTON
|
|
29
|
+
SortCollectionProcessor: '\uD83D\uDD03', // CLOCKWISE ARROWS
|
|
30
|
+
default: '\uD83D\uDCE6' // PACKAGE
|
|
31
|
+
},
|
|
32
|
+
customErrors: {
|
|
33
|
+
default: '\uD83D\uDEAB' // PROHIBITED
|
|
34
|
+
},
|
|
35
|
+
decisions: {
|
|
36
|
+
default: '\uD83D\uDD00' // TWISTED ARROWS
|
|
37
|
+
},
|
|
38
|
+
loops: {
|
|
39
|
+
default: '\uD83D\uDD01' // REPEAT BUTTON
|
|
40
|
+
},
|
|
41
|
+
recordCreates: {
|
|
42
|
+
default: '\u2795' // PLUS
|
|
43
|
+
},
|
|
44
|
+
recordDeletes: {
|
|
45
|
+
default: '\uD83D\uDDD1\uFE0F' // WASTEBASKET
|
|
46
|
+
},
|
|
47
|
+
recordLookups: {
|
|
48
|
+
default: '\uD83D\uDD0D' // MAGNIFYING GLASS
|
|
49
|
+
},
|
|
50
|
+
recordUpdates: {
|
|
51
|
+
default: '\uD83D\uDEE0\uFE0F' // HAMMER AND WRENCH
|
|
52
|
+
},
|
|
53
|
+
screens: {
|
|
54
|
+
default: '\uD83D\uDCBB' // LAPTOP
|
|
55
|
+
},
|
|
56
|
+
subflows: {
|
|
57
|
+
default: '\uD83D\uDD17' // LINK
|
|
58
|
+
},
|
|
59
|
+
transforms: {
|
|
60
|
+
default: '\u267B\uFE0F'
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* ASCII fallback icons (for environments without emoji support)
|
|
66
|
+
*/
|
|
67
|
+
export const ASCII_ICONS: NodeIconConfig = {
|
|
68
|
+
actionCalls: {
|
|
69
|
+
apex: '[A]',
|
|
70
|
+
emailAlert: '[E]',
|
|
71
|
+
emailSimple: '[E]',
|
|
72
|
+
submit: '[!]',
|
|
73
|
+
default: '[!]'
|
|
74
|
+
},
|
|
75
|
+
assignments: { default: '[=]' },
|
|
76
|
+
collectionProcessors: {
|
|
77
|
+
FilterCollectionProcessor: '[F]',
|
|
78
|
+
SortCollectionProcessor: '[S]',
|
|
79
|
+
default: '[C]'
|
|
80
|
+
},
|
|
81
|
+
customErrors: { default: '[X]' },
|
|
82
|
+
decisions: { default: '[?]' },
|
|
83
|
+
loops: { default: '[L]' },
|
|
84
|
+
recordCreates: { default: '[+]' },
|
|
85
|
+
recordDeletes: { default: '[-]' },
|
|
86
|
+
recordLookups: { default: '[S]' },
|
|
87
|
+
recordUpdates: { default: '[U]' },
|
|
88
|
+
screens: { default: '[#]' },
|
|
89
|
+
subflows: { default: '[>]' },
|
|
90
|
+
transforms: { default: '[T]' },
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Get default icon config (can be overridden at runtime)
|
|
95
|
+
*/
|
|
96
|
+
export function getDefaultIconConfig(): NodeIconConfig {
|
|
97
|
+
return DEFAULT_ICONS;
|
|
98
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapter functions to convert between core models (Flow, Violation)
|
|
3
|
+
* and regex-scanner models (MetadataFile, RegexViolation).
|
|
4
|
+
*
|
|
5
|
+
* This allows core rules to delegate to regex-scanner while maintaining
|
|
6
|
+
* backward compatibility with existing consumers.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type {
|
|
10
|
+
MetadataFile,
|
|
11
|
+
MetadataElement,
|
|
12
|
+
RegexViolation,
|
|
13
|
+
} from "@flow-scanner/regex-scanner";
|
|
14
|
+
|
|
15
|
+
import { Flow } from "../models/Flow";
|
|
16
|
+
import { FlowAttribute } from "../models/FlowAttribute";
|
|
17
|
+
import { FlowElement } from "../models/FlowElement";
|
|
18
|
+
import { Violation } from "../models/Violation";
|
|
19
|
+
import { MetaType } from "../enums/MetadataTypes";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Convert a Flow object to a MetadataFile for regex-scanner.
|
|
23
|
+
*/
|
|
24
|
+
export function toMetadataFile(flow: Flow): MetadataFile {
|
|
25
|
+
// Handle case where toXMLString may not exist (e.g., in tests with partial Flow objects)
|
|
26
|
+
let content = "";
|
|
27
|
+
if (typeof flow.toXMLString === "function") {
|
|
28
|
+
content = flow.toXMLString();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
name: flow.name,
|
|
33
|
+
fileName: flow.uri
|
|
34
|
+
? flow.uri.split(/[\\/]/).pop() ?? `${flow.name}.flow-meta.xml`
|
|
35
|
+
: `${flow.name}.flow-meta.xml`,
|
|
36
|
+
filePath: flow.fsPath,
|
|
37
|
+
metadataType: "Flow",
|
|
38
|
+
content,
|
|
39
|
+
elements: toMetadataElements(flow),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Convert Flow elements to MetadataElements for element-level scanning.
|
|
45
|
+
*/
|
|
46
|
+
export function toMetadataElements(flow: Flow): MetadataElement[] {
|
|
47
|
+
if (!flow.elements || flow.elements.length === 0) {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return flow.elements.map((element) => ({
|
|
52
|
+
name: element.name,
|
|
53
|
+
type: element.subtype,
|
|
54
|
+
content: element.element ?? element,
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Convert a RegexViolation to a core Violation.
|
|
60
|
+
* Creates the appropriate FlowElement subclass based on metaType.
|
|
61
|
+
*/
|
|
62
|
+
export function toViolation(rv: RegexViolation): Violation {
|
|
63
|
+
// Create a FlowAttribute to represent the violation
|
|
64
|
+
// This is the simplest approach that works for all regex rules
|
|
65
|
+
const flowElement = new FlowAttribute(
|
|
66
|
+
rv.name,
|
|
67
|
+
rv.type,
|
|
68
|
+
rv.expression ?? rv.matchedText
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const violation = new Violation(flowElement);
|
|
72
|
+
|
|
73
|
+
// Override line/column from regex violation
|
|
74
|
+
violation.lineNumber = rv.lineNumber;
|
|
75
|
+
violation.columnNumber = rv.columnNumber;
|
|
76
|
+
|
|
77
|
+
return violation;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Convert a core FlowElement to a regex-scanner MetadataElement.
|
|
82
|
+
*/
|
|
83
|
+
export function flowElementToMetadataElement(
|
|
84
|
+
element: FlowElement
|
|
85
|
+
): MetadataElement {
|
|
86
|
+
return {
|
|
87
|
+
name: element.name,
|
|
88
|
+
type: element.subtype,
|
|
89
|
+
content: element.element ?? element,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Convert multiple RegexViolations to core Violations.
|
|
95
|
+
*/
|
|
96
|
+
export function toViolations(violations: RegexViolation[]): Violation[] {
|
|
97
|
+
return violations.map(toViolation);
|
|
98
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { IRuleDefinition } from "../interfaces/IRuleDefinition";
|
|
2
|
+
import { IRuleConfig } from "../interfaces/IRuleConfig";
|
|
3
|
+
import { IRulesConfig } from "../interfaces/IRulesConfig";
|
|
4
|
+
// Import all rules
|
|
5
|
+
import { ActionCallsInLoop } from "../rules/ActionCallsInLoop";
|
|
6
|
+
import { APIVersion } from "../rules/APIVersion";
|
|
7
|
+
import { AutoLayout } from "../rules/AutoLayout";
|
|
8
|
+
import { CopyAPIName } from "../rules/CopyAPIName";
|
|
9
|
+
import { CyclomaticComplexity } from "../rules/CyclomaticComplexity";
|
|
10
|
+
import { DMLStatementInLoop } from "../rules/DMLStatementInLoop";
|
|
11
|
+
import { DuplicateDMLOperation } from "../rules/DuplicateDMLOperation";
|
|
12
|
+
import { FlowDescription } from "../rules/FlowDescription";
|
|
13
|
+
import { FlowName } from "../rules/FlowName";
|
|
14
|
+
import { GetRecordAllFields } from "../rules/GetRecordAllFields";
|
|
15
|
+
import { HardcodedId } from "../rules/HardcodedId";
|
|
16
|
+
import { HardcodedUrl } from "../rules/HardcodedUrl";
|
|
17
|
+
import { HardcodedSecret } from "../rules/HardcodedSecret";
|
|
18
|
+
import { InactiveFlow } from "../rules/InactiveFlow";
|
|
19
|
+
import { MissingFaultPath } from "../rules/MissingFaultPath";
|
|
20
|
+
import { MissingNullHandler } from "../rules/MissingNullHandler";
|
|
21
|
+
import { ProcessBuilder } from "../rules/ProcessBuilder";
|
|
22
|
+
import { RecursiveAfterUpdate } from "../rules/RecursiveAfterUpdate";
|
|
23
|
+
import { SameRecordFieldUpdates } from "../rules/SameRecordFieldUpdates";
|
|
24
|
+
import { SOQLQueryInLoop } from "../rules/SOQLQueryInLoop";
|
|
25
|
+
import { TriggerOrder } from "../rules/TriggerOrder";
|
|
26
|
+
import { UnconnectedElement } from "../rules/UnconnectedElement";
|
|
27
|
+
import { UnsafeRunningContext } from "../rules/UnsafeRunningContext";
|
|
28
|
+
import { UnusedVariable } from "../rules/UnusedVariable";
|
|
29
|
+
import { MissingMetadataDescription } from "../rules/MissingMetadataDescription";
|
|
30
|
+
import { MissingRecordTriggerFilter } from "../rules/MissingRecordTriggerFilter";
|
|
31
|
+
import { TransformInsteadOfLoop } from "../rules/TransformInsteadOfLoop";
|
|
32
|
+
import { RecordIdAsString } from "../rules/RecordIdAsString";
|
|
33
|
+
|
|
34
|
+
type RuleConstructor = new () => IRuleDefinition;
|
|
35
|
+
|
|
36
|
+
interface RuleRegistryEntry {
|
|
37
|
+
ruleId: string;
|
|
38
|
+
ruleClass: RuleConstructor;
|
|
39
|
+
legacyName: string;
|
|
40
|
+
isBeta: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
class RuleRegistry {
|
|
44
|
+
private rules: Map<string, RuleRegistryEntry> = new Map();
|
|
45
|
+
private legacyNameMap: Map<string, string> = new Map();
|
|
46
|
+
|
|
47
|
+
register(
|
|
48
|
+
ruleId: string,
|
|
49
|
+
ruleClass: RuleConstructor,
|
|
50
|
+
legacyName: string,
|
|
51
|
+
isBeta: boolean = false
|
|
52
|
+
): void {
|
|
53
|
+
const entry: RuleRegistryEntry = {
|
|
54
|
+
ruleId,
|
|
55
|
+
ruleClass,
|
|
56
|
+
legacyName,
|
|
57
|
+
isBeta,
|
|
58
|
+
};
|
|
59
|
+
this.rules.set(ruleId, entry);
|
|
60
|
+
this.legacyNameMap.set(legacyName, ruleId);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
get(idOrLegacyName: string): RuleRegistryEntry | undefined {
|
|
64
|
+
let entry = this.rules.get(idOrLegacyName);
|
|
65
|
+
if (!entry) {
|
|
66
|
+
const ruleId = this.legacyNameMap.get(idOrLegacyName);
|
|
67
|
+
if (ruleId) {
|
|
68
|
+
entry = this.rules.get(ruleId);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return entry;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
getAllRuleIds(includeBeta: boolean = false): string[] {
|
|
75
|
+
return Array.from(this.rules.values())
|
|
76
|
+
.filter(entry => includeBeta || !entry.isBeta)
|
|
77
|
+
.map(entry => entry.ruleId);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
has(idOrLegacyName: string): boolean {
|
|
81
|
+
return this.get(idOrLegacyName) !== undefined;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
createInstance(idOrLegacyName: string): IRuleDefinition {
|
|
85
|
+
const entry = this.get(idOrLegacyName);
|
|
86
|
+
if (!entry) {
|
|
87
|
+
throw new Error(`Rule not found: ${idOrLegacyName}`);
|
|
88
|
+
}
|
|
89
|
+
return new entry.ruleClass();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
getRules(
|
|
93
|
+
ruleConfig?: Map<string, unknown>,
|
|
94
|
+
options?: IRulesConfig
|
|
95
|
+
): IRuleDefinition[] {
|
|
96
|
+
const includeBeta = options?.betaMode === true || options?.betamode === true;
|
|
97
|
+
const rulesMode = options?.ruleMode || "merged";
|
|
98
|
+
const selectedRules: IRuleDefinition[] = [];
|
|
99
|
+
|
|
100
|
+
if (rulesMode === "isolated" && ruleConfig && ruleConfig.size > 0) {
|
|
101
|
+
for (const key of ruleConfig.keys()) {
|
|
102
|
+
const entry = this.get(key);
|
|
103
|
+
if (!entry) continue;
|
|
104
|
+
|
|
105
|
+
const config = ruleConfig.get(key) as IRuleConfig | undefined;
|
|
106
|
+
if (config?.enabled === false) continue;
|
|
107
|
+
|
|
108
|
+
const rule = this.createInstance(entry.ruleId);
|
|
109
|
+
if (config?.severity) {
|
|
110
|
+
rule.severity = config.severity;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
selectedRules.push(rule);
|
|
114
|
+
}
|
|
115
|
+
return selectedRules;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const allRuleIds = this.getAllRuleIds(includeBeta);
|
|
119
|
+
|
|
120
|
+
for (const ruleId of allRuleIds) {
|
|
121
|
+
const rule = this.createInstance(ruleId);
|
|
122
|
+
|
|
123
|
+
const config = (
|
|
124
|
+
ruleConfig?.get(rule.ruleId) ??
|
|
125
|
+
ruleConfig?.get(rule.name)
|
|
126
|
+
) as IRuleConfig | undefined;
|
|
127
|
+
|
|
128
|
+
if (config?.enabled === false) continue;
|
|
129
|
+
if (config?.severity) {
|
|
130
|
+
rule.severity = config.severity;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
selectedRules.push(rule);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return selectedRules;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
getRulesByNames(ruleNames?: string[], options?: IRulesConfig): IRuleDefinition[] {
|
|
140
|
+
if (!ruleNames || ruleNames.length === 0) {
|
|
141
|
+
return this.getRules(undefined, options);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const config = new Map<string, IRuleConfig>();
|
|
145
|
+
for (const identifier of ruleNames) {
|
|
146
|
+
const entry = this.get(identifier);
|
|
147
|
+
if (entry) {
|
|
148
|
+
config.set(entry.ruleId, { enabled: true });
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return this.getRules(config, { ...options, ruleMode: "isolated" });
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const registry = new RuleRegistry();
|
|
157
|
+
|
|
158
|
+
registry.register("action-call-in-loop", ActionCallsInLoop, "ActionCallsInLoop");
|
|
159
|
+
registry.register("invalid-api-version", APIVersion, "APIVersion");
|
|
160
|
+
registry.register("missing-auto-layout", AutoLayout, "AutoLayout");
|
|
161
|
+
registry.register("unclear-api-naming", CopyAPIName, "CopyAPIName");
|
|
162
|
+
registry.register("excessive-cyclomatic-complexity", CyclomaticComplexity, "CyclomaticComplexity");
|
|
163
|
+
registry.register("dml-in-loop", DMLStatementInLoop, "DMLStatementInLoop");
|
|
164
|
+
registry.register("duplicate-dml", DuplicateDMLOperation, "DuplicateDMLOperation");
|
|
165
|
+
registry.register("missing-flow-description", FlowDescription, "FlowDescription");
|
|
166
|
+
registry.register("invalid-naming-convention", FlowName, "FlowName");
|
|
167
|
+
registry.register("get-record-all-fields", GetRecordAllFields, "GetRecordAllFields");
|
|
168
|
+
registry.register("hardcoded-id", HardcodedId, "HardcodedId");
|
|
169
|
+
registry.register("hardcoded-url", HardcodedUrl, "HardcodedUrl");
|
|
170
|
+
registry.register("inactive-flow", InactiveFlow, "InactiveFlow");
|
|
171
|
+
registry.register("missing-fault-path", MissingFaultPath, "MissingFaultPath");
|
|
172
|
+
registry.register("missing-null-handler", MissingNullHandler, "MissingNullHandler");
|
|
173
|
+
registry.register("process-builder-usage", ProcessBuilder, "ProcessBuilder");
|
|
174
|
+
registry.register("recursive-record-update", RecursiveAfterUpdate, "RecursiveAfterUpdate");
|
|
175
|
+
registry.register("same-record-field-updates", SameRecordFieldUpdates, "SameRecordFieldUpdates");
|
|
176
|
+
registry.register("soql-in-loop", SOQLQueryInLoop, "SOQLQueryInLoop");
|
|
177
|
+
registry.register("unspecified-trigger-order", TriggerOrder, "TriggerOrder");
|
|
178
|
+
registry.register("unreachable-element", UnconnectedElement, "UnconnectedElement");
|
|
179
|
+
registry.register("unsafe-running-context", UnsafeRunningContext, "UnsafeRunningContext");
|
|
180
|
+
registry.register("unused-variable", UnusedVariable, "UnusedVariable");
|
|
181
|
+
|
|
182
|
+
registry.register("missing-metadata-description", MissingMetadataDescription, "MissingMetadataDescription", true);
|
|
183
|
+
registry.register("missing-record-trigger-filter", MissingRecordTriggerFilter, "MissingFilterRecordTrigger", true);
|
|
184
|
+
registry.register("transform-instead-of-loop", TransformInsteadOfLoop, "TransformInsteadOfLoop", true);
|
|
185
|
+
registry.register("record-id-as-string", RecordIdAsString, "RecordIdAsString", true);
|
|
186
|
+
registry.register("hardcoded-secret", HardcodedSecret, "HardcodedSecret", true);
|
|
187
|
+
|
|
188
|
+
export const ruleRegistry = registry;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon configuration for flow variable types.
|
|
3
|
+
* Includes icons for variable subtypes and boolean states.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface VariableIconConfig {
|
|
7
|
+
// Variable subtype icons
|
|
8
|
+
subtypes: {
|
|
9
|
+
[subtype: string]: string;
|
|
10
|
+
};
|
|
11
|
+
// Boolean state icons (for isCollection, isInput, isOutput)
|
|
12
|
+
boolean: {
|
|
13
|
+
true: string;
|
|
14
|
+
false: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Default icons using emoji (recommended for modern environments)
|
|
20
|
+
*/
|
|
21
|
+
export const DEFAULT_VARIABLE_ICONS: VariableIconConfig = {
|
|
22
|
+
subtypes: {
|
|
23
|
+
variables: '\uD83D\uDCCA', // BAR CHART (data/variable)
|
|
24
|
+
constants: '\uD83D\uDD12', // LOCK (constant/immutable)
|
|
25
|
+
formulas: '\uD83E\uDDEE', // ABACUS (calculation)
|
|
26
|
+
choices: '\uD83D\uDCCB', // CLIPBOARD (picklist/choices)
|
|
27
|
+
dynamicChoiceSets: '\uD83D\uDD04', // ARROWS (dynamic)
|
|
28
|
+
},
|
|
29
|
+
boolean: {
|
|
30
|
+
true: '\u2705', // CHECK MARK
|
|
31
|
+
false: '\u2B1C', // WHITE SQUARE
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* ASCII fallback icons (for environments without emoji support)
|
|
37
|
+
*/
|
|
38
|
+
export const ASCII_VARIABLE_ICONS: VariableIconConfig = {
|
|
39
|
+
subtypes: {
|
|
40
|
+
variables: '[V]',
|
|
41
|
+
constants: '[C]',
|
|
42
|
+
formulas: '[F]',
|
|
43
|
+
choices: '[CH]',
|
|
44
|
+
dynamicChoiceSets: '[D]',
|
|
45
|
+
},
|
|
46
|
+
boolean: {
|
|
47
|
+
true: '[X]',
|
|
48
|
+
false: '[ ]',
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Get default variable icon config
|
|
54
|
+
*/
|
|
55
|
+
export function getDefaultVariableIconConfig(): VariableIconConfig {
|
|
56
|
+
return DEFAULT_VARIABLE_ICONS;
|
|
57
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Flow, RuleResult } from "../internals/internals";
|
|
2
|
+
|
|
3
|
+
export interface IRuleDefinition {
|
|
4
|
+
ruleId: string;
|
|
5
|
+
description: string;
|
|
6
|
+
summary: string; // Short summary (5-10 words) shown when no custom message
|
|
7
|
+
docRefs: Array<{ label: string; path: string }>;
|
|
8
|
+
execute(flow: Flow, options?: object, suppressions?: string[]): RuleResult;
|
|
9
|
+
isConfigurable: boolean;
|
|
10
|
+
label: string;
|
|
11
|
+
name: string;
|
|
12
|
+
severity?: string;
|
|
13
|
+
supportedTypes: string[];
|
|
14
|
+
uri?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IExceptions } from "./IExceptions";
|
|
2
|
+
import { IRuleOptions } from "./IRuleOptions";
|
|
3
|
+
|
|
4
|
+
export enum DetailLevel {
|
|
5
|
+
ENRICHED = 'enriched',
|
|
6
|
+
SIMPLE = 'simple'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface IRulesConfig {
|
|
10
|
+
betaMode?: boolean; // Toggles beta rules; defaults to false
|
|
11
|
+
betamode?: boolean; // Use betaMode instead; to be removed
|
|
12
|
+
detailLevel?: 'enriched' | 'simple' | DetailLevel;
|
|
13
|
+
exceptions?: IExceptions;
|
|
14
|
+
rules?: IRuleOptions;
|
|
15
|
+
ruleMode?: "merged" | "isolated"; // Defaults to "merged"
|
|
16
|
+
ignoreFlows?: string[]; // Flow API names to exclude from scanning
|
|
17
|
+
}
|