@flow-scanner/lightning-flow-scanner-core 6.17.1 → 6.17.2
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 +642 -0
- package/package.json +9 -58
- package/.husky/pre-commit +0 -1
- package/.husky/pre-push +0 -1
- package/.prettierignore +0 -5
- package/.swcrc +0 -26
- package/.turbo/turbo-build.log +0 -17
- package/.turbo/turbo-test.log +0 -144
- package/.turbo/turbo-vite$colon$dist.log +0 -21
- package/coverage/coverage-final.json +0 -63
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -236
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov-report/src/index.html +0 -116
- package/coverage/lcov-report/src/index.ts.html +0 -238
- package/coverage/lcov-report/src/main/adapters/RegexAdapter.ts.html +0 -118
- package/coverage/lcov-report/src/main/adapters/index.html +0 -116
- package/coverage/lcov-report/src/main/config/NodeIcons.ts.html +0 -376
- package/coverage/lcov-report/src/main/config/RuleRegistry.ts.html +0 -646
- package/coverage/lcov-report/src/main/config/VariableIcons.ts.html +0 -253
- package/coverage/lcov-report/src/main/config/index.html +0 -146
- package/coverage/lcov-report/src/main/enums/MetaType.ts.html +0 -100
- package/coverage/lcov-report/src/main/enums/MetadataType.ts.html +0 -103
- package/coverage/lcov-report/src/main/enums/MetadataTypes.ts.html +0 -100
- package/coverage/lcov-report/src/main/enums/index.html +0 -116
- package/coverage/lcov-report/src/main/interfaces/IRulesConfig.ts.html +0 -133
- package/coverage/lcov-report/src/main/interfaces/index.html +0 -116
- package/coverage/lcov-report/src/main/internals/index.html +0 -116
- package/coverage/lcov-report/src/main/internals/internals.ts.html +0 -190
- package/coverage/lcov-report/src/main/libs/BuildFlow.ts.html +0 -127
- package/coverage/lcov-report/src/main/libs/Compiler.ts.html +0 -241
- package/coverage/lcov-report/src/main/libs/ConvertFlowNodes.ts.html +0 -97
- package/coverage/lcov-report/src/main/libs/DynamicRule.ts.html +0 -118
- package/coverage/lcov-report/src/main/libs/ExportDetails.ts.html +0 -256
- package/coverage/lcov-report/src/main/libs/ExportDiagram.ts.html +0 -331
- package/coverage/lcov-report/src/main/libs/ExportSarif.ts.html +0 -358
- package/coverage/lcov-report/src/main/libs/FixFlows.ts.html +0 -265
- package/coverage/lcov-report/src/main/libs/GenerateMarkdown.ts.html +0 -331
- package/coverage/lcov-report/src/main/libs/GetRuleDefinitions.ts.html +0 -274
- package/coverage/lcov-report/src/main/libs/ParseFlows.ts.html +0 -184
- package/coverage/lcov-report/src/main/libs/RuleDocumentation.ts.html +0 -190
- package/coverage/lcov-report/src/main/libs/ScanFlows.ts.html +0 -508
- package/coverage/lcov-report/src/main/libs/exportAsDetails.ts.html +0 -160
- package/coverage/lcov-report/src/main/libs/exportAsSarif.ts.html +0 -346
- package/coverage/lcov-report/src/main/libs/index.html +0 -251
- package/coverage/lcov-report/src/main/models/FlatViolation.ts.html +0 -106
- package/coverage/lcov-report/src/main/models/Flow.ts.html +0 -1057
- package/coverage/lcov-report/src/main/models/FlowAttribute.ts.html +0 -115
- package/coverage/lcov-report/src/main/models/FlowElement.ts.html +0 -133
- package/coverage/lcov-report/src/main/models/FlowElementConnector.ts.html +0 -169
- package/coverage/lcov-report/src/main/models/FlowGraph.ts.html +0 -1672
- package/coverage/lcov-report/src/main/models/FlowMetadata.ts.html +0 -106
- package/coverage/lcov-report/src/main/models/FlowNode.ts.html +0 -1252
- package/coverage/lcov-report/src/main/models/FlowResource.ts.html +0 -106
- package/coverage/lcov-report/src/main/models/FlowType.ts.html +0 -244
- package/coverage/lcov-report/src/main/models/FlowVariable.ts.html +0 -553
- package/coverage/lcov-report/src/main/models/LoopRuleCommon.ts.html +0 -235
- package/coverage/lcov-report/src/main/models/ParsedFlow.ts.html +0 -121
- package/coverage/lcov-report/src/main/models/RuleCommon.ts.html +0 -442
- package/coverage/lcov-report/src/main/models/RuleResult.ts.html +0 -172
- package/coverage/lcov-report/src/main/models/ScanResult.ts.html +0 -121
- package/coverage/lcov-report/src/main/models/Violation.ts.html +0 -316
- package/coverage/lcov-report/src/main/models/index.html +0 -341
- package/coverage/lcov-report/src/main/rules/APIVersion.ts.html +0 -361
- package/coverage/lcov-report/src/main/rules/ActionCallsInLoop.ts.html +0 -157
- package/coverage/lcov-report/src/main/rules/AutoLayout.ts.html +0 -220
- package/coverage/lcov-report/src/main/rules/CopyAPIName.ts.html +0 -175
- package/coverage/lcov-report/src/main/rules/CyclomaticComplexity.ts.html +0 -292
- package/coverage/lcov-report/src/main/rules/DMLStatementInLoop.ts.html +0 -163
- package/coverage/lcov-report/src/main/rules/DuplicateDMLOperation.ts.html +0 -334
- package/coverage/lcov-report/src/main/rules/FlowDescription.ts.html +0 -184
- package/coverage/lcov-report/src/main/rules/FlowName.ts.html +0 -229
- package/coverage/lcov-report/src/main/rules/GetRecordAllFields.ts.html +0 -280
- package/coverage/lcov-report/src/main/rules/HardcodedId.ts.html +0 -238
- package/coverage/lcov-report/src/main/rules/HardcodedSecret.ts.html +0 -238
- package/coverage/lcov-report/src/main/rules/HardcodedUrl.ts.html +0 -247
- package/coverage/lcov-report/src/main/rules/InactiveFlow.ts.html +0 -184
- package/coverage/lcov-report/src/main/rules/MissingFaultPath.ts.html +0 -397
- package/coverage/lcov-report/src/main/rules/MissingFilterRecordTrigger.ts.html +0 -229
- package/coverage/lcov-report/src/main/rules/MissingMetadataDescription.ts.html +0 -211
- package/coverage/lcov-report/src/main/rules/MissingNullHandler.ts.html +0 -460
- package/coverage/lcov-report/src/main/rules/MissingRecordTriggerFilter.ts.html +0 -235
- package/coverage/lcov-report/src/main/rules/ProcessBuilder.ts.html +0 -190
- package/coverage/lcov-report/src/main/rules/RecordIdAsString.ts.html +0 -274
- package/coverage/lcov-report/src/main/rules/RecursiveAfterUpdate.ts.html +0 -364
- package/coverage/lcov-report/src/main/rules/SOQLQueryInLoop.ts.html +0 -160
- package/coverage/lcov-report/src/main/rules/SameRecordFieldUpdates.ts.html +0 -283
- package/coverage/lcov-report/src/main/rules/TransformInsteadOfLoop.ts.html +0 -250
- package/coverage/lcov-report/src/main/rules/TriggerOrder.ts.html +0 -238
- package/coverage/lcov-report/src/main/rules/UnconnectedElement.ts.html +0 -178
- package/coverage/lcov-report/src/main/rules/UnsafeRunningContext.ts.html +0 -226
- package/coverage/lcov-report/src/main/rules/UnusedVariable.ts.html +0 -283
- package/coverage/lcov-report/src/main/rules/index.html +0 -521
- package/coverage/lcov-report/src/main/store/DefaultRuleStore.ts.html +0 -265
- package/coverage/lcov-report/src/main/store/RuleRegistry.ts.html +0 -118
- package/coverage/lcov-report/src/main/store/index.html +0 -116
- package/coverage/lcov.info +0 -6261
- package/eslint.config.mjs +0 -36
- package/jest.config.cjs +0 -32
- package/jest.env-setup.js +0 -101
- package/lint-staged.config.mjs +0 -8
- package/prettier.config.mjs +0 -5
- package/src/index.ts +0 -52
- package/src/main/config/NodeIcons.ts +0 -98
- package/src/main/config/RegexAdapter.ts +0 -98
- package/src/main/config/RuleRegistry.ts +0 -188
- package/src/main/config/VariableIcons.ts +0 -57
- package/src/main/enums/MetadataTypes.ts +0 -6
- package/src/main/interfaces/IExceptions.ts +0 -6
- package/src/main/interfaces/IRuleConfig.ts +0 -6
- package/src/main/interfaces/IRuleDefinition.ts +0 -15
- package/src/main/interfaces/IRuleOptions.ts +0 -5
- package/src/main/interfaces/IRulesConfig.ts +0 -17
- package/src/main/internals/internals.ts +0 -35
- package/src/main/libs/BuildFlow.ts +0 -14
- package/src/main/libs/Compiler.ts +0 -53
- package/src/main/libs/ExportDetails.ts +0 -58
- package/src/main/libs/ExportDiagram.ts +0 -83
- package/src/main/libs/ExportSarif.ts +0 -92
- package/src/main/libs/FixFlows.ts +0 -61
- package/src/main/libs/GetRuleDefinitions.ts +0 -64
- package/src/main/libs/ParseFlows.ts +0 -34
- package/src/main/libs/RuleDocumentation.ts +0 -35
- package/src/main/libs/ScanFlows.ts +0 -142
- package/src/main/models/FlatViolation.ts +0 -16
- package/src/main/models/Flow.ts +0 -325
- package/src/main/models/FlowAttribute.ts +0 -11
- package/src/main/models/FlowElement.ts +0 -16
- package/src/main/models/FlowElementConnector.ts +0 -28
- package/src/main/models/FlowGraph.ts +0 -530
- package/src/main/models/FlowMetadata.ts +0 -8
- package/src/main/models/FlowNode.ts +0 -390
- package/src/main/models/FlowResource.ts +0 -8
- package/src/main/models/FlowType.ts +0 -53
- package/src/main/models/FlowVariable.ts +0 -157
- package/src/main/models/LoopRuleCommon.ts +0 -51
- package/src/main/models/ParsedFlow.ts +0 -13
- package/src/main/models/RuleCommon.ts +0 -120
- package/src/main/models/RuleInfo.ts +0 -54
- package/src/main/models/RuleResult.ts +0 -29
- package/src/main/models/ScanResult.ts +0 -12
- package/src/main/models/Violation.ts +0 -78
- package/src/main/rules/APIVersion.ts +0 -93
- package/src/main/rules/ActionCallsInLoop.ts +0 -25
- package/src/main/rules/AutoLayout.ts +0 -46
- package/src/main/rules/CopyAPIName.ts +0 -31
- package/src/main/rules/CyclomaticComplexity.ts +0 -70
- package/src/main/rules/DMLStatementInLoop.ts +0 -26
- package/src/main/rules/DuplicateDMLOperation.ts +0 -83
- package/src/main/rules/FlowDescription.ts +0 -34
- package/src/main/rules/FlowName.ts +0 -49
- package/src/main/rules/GetRecordAllFields.ts +0 -65
- package/src/main/rules/HardcodedId.ts +0 -51
- package/src/main/rules/HardcodedSecret.ts +0 -51
- package/src/main/rules/HardcodedUrl.ts +0 -54
- package/src/main/rules/InactiveFlow.ts +0 -33
- package/src/main/rules/MissingFaultPath.ts +0 -105
- package/src/main/rules/MissingMetadataDescription.ts +0 -42
- package/src/main/rules/MissingNullHandler.ts +0 -126
- package/src/main/rules/MissingRecordTriggerFilter.ts +0 -51
- package/src/main/rules/ProcessBuilder.ts +0 -35
- package/src/main/rules/RecordIdAsString.ts +0 -64
- package/src/main/rules/RecursiveAfterUpdate.ts +0 -94
- package/src/main/rules/SOQLQueryInLoop.ts +0 -26
- package/src/main/rules/SameRecordFieldUpdates.ts +0 -66
- package/src/main/rules/TransformInsteadOfLoop.ts +0 -56
- package/src/main/rules/TriggerOrder.ts +0 -51
- package/src/main/rules/UnconnectedElement.ts +0 -32
- package/src/main/rules/UnsafeRunningContext.ts +0 -47
- package/src/main/rules/UnusedVariable.ts +0 -66
- package/stryker.config.mjs +0 -23
- package/tests/APIVersion.test.ts +0 -87
- package/tests/AutoLayout.test.ts +0 -41
- package/tests/Config.test.ts +0 -122
- package/tests/ConfigBetaMode.test.ts +0 -26
- package/tests/CopyAPIName.test.ts +0 -45
- package/tests/CyclomaticComplexity.test.ts +0 -125
- package/tests/DMLStatementInLoop.test.ts +0 -32
- package/tests/DuplicateDMLOperation.test.ts +0 -43
- package/tests/EnabledFalse.test.ts +0 -63
- package/tests/Exceptions.test.ts +0 -815
- package/tests/ExportSarif.test.ts +0 -62
- package/tests/FlowDescription.test.ts +0 -44
- package/tests/FlowDocumentation.test.ts +0 -74
- package/tests/FlowName.test.ts +0 -61
- package/tests/GetRecordElementAllFields.test.ts +0 -182
- package/tests/HardcodedId.test.ts +0 -16
- package/tests/HardcodedSecret.test.ts +0 -32
- package/tests/HardcodedUrl.test.ts +0 -253
- package/tests/InactiveFlow.test.ts +0 -103
- package/tests/MissingFaultPath.test.ts +0 -52
- package/tests/MissingMetadataDescription.test.ts +0 -25
- package/tests/MissingNullHandler.test.ts +0 -45
- package/tests/MissingRecordTriggerFilter.test.ts +0 -54
- package/tests/RecordIdAsString.test.ts +0 -60
- package/tests/RecursiveAfterUpdate.test.ts +0 -183
- package/tests/SOQLQueryInLoop.test.ts +0 -33
- package/tests/SameRecordFieldUpdates.test.ts +0 -205
- package/tests/SanityTest.test.ts +0 -15
- package/tests/TransformInsteadOfLoop.test.ts +0 -33
- package/tests/TriggerOrder.test.ts +0 -112
- package/tests/UnconnectedElement.test.ts +0 -76
- package/tests/UnsafeRunningContext.test.ts +0 -46
- package/tests/UnusedVariable.test.ts +0 -59
- package/tests/UnusedVariableExceptions.test.ts +0 -87
- package/tests/jsonfiles/MissingFaultPath_BeforeSave_Bypass.json +0 -128
- package/tests/jsonfiles/MissingFaultPath_WaitConditions.json +0 -102
- package/tests/jsonfiles/MissingFaultPath_WaitDate.json +0 -88
- package/tests/jsonfiles/MissingFaultPath_WaitDuration.json +0 -90
- package/tests/models/Flow.test.ts +0 -107
- package/tests/models/LoopRuleCommon.test.ts +0 -246
- package/tests/models/RuleCommon.test.ts +0 -41
- package/tsconfig.json +0 -28
- package/tsconfig.types.json +0 -26
- package/types/index.d.ts +0 -27
- package/types/index.d.ts.map +0 -1
- package/types/main/adapters/RegexAdapter.d.ts +0 -33
- package/types/main/adapters/RegexAdapter.d.ts.map +0 -1
- package/types/main/config/NodeIcons.d.ts +0 -25
- package/types/main/config/NodeIcons.d.ts.map +0 -1
- package/types/main/config/RegexAdapter.d.ts +0 -33
- package/types/main/config/RegexAdapter.d.ts.map +0 -1
- package/types/main/config/RuleRegistry.d.ts +0 -23
- package/types/main/config/RuleRegistry.d.ts.map +0 -1
- package/types/main/config/VariableIcons.d.ts +0 -26
- package/types/main/config/VariableIcons.d.ts.map +0 -1
- package/types/main/enums/MetadataTypes.d.ts +0 -7
- package/types/main/enums/MetadataTypes.d.ts.map +0 -1
- package/types/main/interfaces/IExceptions.d.ts +0 -6
- package/types/main/interfaces/IExceptions.d.ts.map +0 -1
- package/types/main/interfaces/IRuleConfig.d.ts +0 -7
- package/types/main/interfaces/IRuleConfig.d.ts.map +0 -1
- package/types/main/interfaces/IRuleDefinition.d.ts +0 -18
- package/types/main/interfaces/IRuleDefinition.d.ts.map +0 -1
- package/types/main/interfaces/IRuleOptions.d.ts +0 -5
- package/types/main/interfaces/IRuleOptions.d.ts.map +0 -1
- package/types/main/interfaces/IRulesConfig.d.ts +0 -16
- package/types/main/interfaces/IRulesConfig.d.ts.map +0 -1
- package/types/main/internals/internals.d.ts +0 -19
- package/types/main/internals/internals.d.ts.map +0 -1
- package/types/main/libs/BuildFlow.d.ts +0 -2
- package/types/main/libs/BuildFlow.d.ts.map +0 -1
- package/types/main/libs/Compiler.d.ts +0 -8
- package/types/main/libs/Compiler.d.ts.map +0 -1
- package/types/main/libs/ConvertFlowNodes.d.ts +0 -2
- package/types/main/libs/ConvertFlowNodes.d.ts.map +0 -1
- package/types/main/libs/DynamicRule.d.ts +0 -5
- package/types/main/libs/DynamicRule.d.ts.map +0 -1
- package/types/main/libs/ExportDetails.d.ts +0 -4
- package/types/main/libs/ExportDetails.d.ts.map +0 -1
- package/types/main/libs/ExportDiagram.d.ts +0 -42
- package/types/main/libs/ExportDiagram.d.ts.map +0 -1
- package/types/main/libs/ExportSarif.d.ts +0 -3
- package/types/main/libs/ExportSarif.d.ts.map +0 -1
- package/types/main/libs/FixFlows.d.ts +0 -4
- package/types/main/libs/FixFlows.d.ts.map +0 -1
- package/types/main/libs/GetRuleDefinitions.d.ts +0 -5
- package/types/main/libs/GetRuleDefinitions.d.ts.map +0 -1
- package/types/main/libs/ParseFlows.d.ts +0 -3
- package/types/main/libs/ParseFlows.d.ts.map +0 -1
- package/types/main/libs/RuleDocumentation.d.ts +0 -21
- package/types/main/libs/RuleDocumentation.d.ts.map +0 -1
- package/types/main/libs/ScanFlows.d.ts +0 -5
- package/types/main/libs/ScanFlows.d.ts.map +0 -1
- package/types/main/libs/exportAsDetails.d.ts +0 -4
- package/types/main/libs/exportAsDetails.d.ts.map +0 -1
- package/types/main/libs/exportAsSarif.d.ts +0 -3
- package/types/main/libs/exportAsSarif.d.ts.map +0 -1
- package/types/main/models/FlatViolation.d.ts +0 -16
- package/types/main/models/FlatViolation.d.ts.map +0 -1
- package/types/main/models/Flow.d.ts +0 -70
- package/types/main/models/Flow.d.ts.map +0 -1
- package/types/main/models/FlowAttribute.d.ts +0 -6
- package/types/main/models/FlowAttribute.d.ts.map +0 -1
- package/types/main/models/FlowElement.d.ts +0 -11
- package/types/main/models/FlowElement.d.ts.map +0 -1
- package/types/main/models/FlowElementConnector.d.ts +0 -16
- package/types/main/models/FlowElementConnector.d.ts.map +0 -1
- package/types/main/models/FlowGraph.d.ts +0 -86
- package/types/main/models/FlowGraph.d.ts.map +0 -1
- package/types/main/models/FlowMetadata.d.ts +0 -5
- package/types/main/models/FlowMetadata.d.ts.map +0 -1
- package/types/main/models/FlowNode.d.ts +0 -66
- package/types/main/models/FlowNode.d.ts.map +0 -1
- package/types/main/models/FlowResource.d.ts +0 -5
- package/types/main/models/FlowResource.d.ts.map +0 -1
- package/types/main/models/FlowType.d.ts +0 -24
- package/types/main/models/FlowType.d.ts.map +0 -1
- package/types/main/models/FlowVariable.d.ts +0 -64
- package/types/main/models/FlowVariable.d.ts.map +0 -1
- package/types/main/models/LoopRuleCommon.d.ts +0 -15
- package/types/main/models/LoopRuleCommon.d.ts.map +0 -1
- package/types/main/models/ParsedFlow.d.ts +0 -8
- package/types/main/models/ParsedFlow.d.ts.map +0 -1
- package/types/main/models/RuleCommon.d.ts +0 -58
- package/types/main/models/RuleCommon.d.ts.map +0 -1
- package/types/main/models/RuleInfo.d.ts +0 -50
- package/types/main/models/RuleInfo.d.ts.map +0 -1
- package/types/main/models/RuleResult.d.ts +0 -15
- package/types/main/models/RuleResult.d.ts.map +0 -1
- package/types/main/models/ScanResult.d.ts +0 -8
- package/types/main/models/ScanResult.d.ts.map +0 -1
- package/types/main/models/Violation.d.ts +0 -12
- package/types/main/models/Violation.d.ts.map +0 -1
- package/types/main/rules/APIVersion.d.ts +0 -10
- package/types/main/rules/APIVersion.d.ts.map +0 -1
- package/types/main/rules/ActionCallsInLoop.d.ts +0 -7
- package/types/main/rules/ActionCallsInLoop.d.ts.map +0 -1
- package/types/main/rules/AutoLayout.d.ts +0 -8
- package/types/main/rules/AutoLayout.d.ts.map +0 -1
- package/types/main/rules/CopyAPIName.d.ts +0 -8
- package/types/main/rules/CopyAPIName.d.ts.map +0 -1
- package/types/main/rules/CyclomaticComplexity.d.ts +0 -12
- package/types/main/rules/CyclomaticComplexity.d.ts.map +0 -1
- package/types/main/rules/DMLStatementInLoop.d.ts +0 -7
- package/types/main/rules/DMLStatementInLoop.d.ts.map +0 -1
- package/types/main/rules/DuplicateDMLOperation.d.ts +0 -9
- package/types/main/rules/DuplicateDMLOperation.d.ts.map +0 -1
- package/types/main/rules/FlowDescription.d.ts +0 -8
- package/types/main/rules/FlowDescription.d.ts.map +0 -1
- package/types/main/rules/FlowName.d.ts +0 -16
- package/types/main/rules/FlowName.d.ts.map +0 -1
- package/types/main/rules/GetRecordAllFields.d.ts +0 -8
- package/types/main/rules/GetRecordAllFields.d.ts.map +0 -1
- package/types/main/rules/HardcodedId.d.ts +0 -14
- package/types/main/rules/HardcodedId.d.ts.map +0 -1
- package/types/main/rules/HardcodedSecret.d.ts +0 -14
- package/types/main/rules/HardcodedSecret.d.ts.map +0 -1
- package/types/main/rules/HardcodedUrl.d.ts +0 -14
- package/types/main/rules/HardcodedUrl.d.ts.map +0 -1
- package/types/main/rules/InactiveFlow.d.ts +0 -8
- package/types/main/rules/InactiveFlow.d.ts.map +0 -1
- package/types/main/rules/MissingFaultPath.d.ts +0 -15
- package/types/main/rules/MissingFaultPath.d.ts.map +0 -1
- package/types/main/rules/MissingFilterRecordTrigger.d.ts +0 -8
- package/types/main/rules/MissingFilterRecordTrigger.d.ts.map +0 -1
- package/types/main/rules/MissingMetadataDescription.d.ts +0 -8
- package/types/main/rules/MissingMetadataDescription.d.ts.map +0 -1
- package/types/main/rules/MissingNullHandler.d.ts +0 -8
- package/types/main/rules/MissingNullHandler.d.ts.map +0 -1
- package/types/main/rules/MissingRecordTriggerFilter.d.ts +0 -8
- package/types/main/rules/MissingRecordTriggerFilter.d.ts.map +0 -1
- package/types/main/rules/ProcessBuilder.d.ts +0 -8
- package/types/main/rules/ProcessBuilder.d.ts.map +0 -1
- package/types/main/rules/RecordIdAsString.d.ts +0 -8
- package/types/main/rules/RecordIdAsString.d.ts.map +0 -1
- package/types/main/rules/RecursiveAfterUpdate.d.ts +0 -9
- package/types/main/rules/RecursiveAfterUpdate.d.ts.map +0 -1
- package/types/main/rules/SOQLQueryInLoop.d.ts +0 -7
- package/types/main/rules/SOQLQueryInLoop.d.ts.map +0 -1
- package/types/main/rules/SameRecordFieldUpdates.d.ts +0 -9
- package/types/main/rules/SameRecordFieldUpdates.d.ts.map +0 -1
- package/types/main/rules/TransformInsteadOfLoop.d.ts +0 -8
- package/types/main/rules/TransformInsteadOfLoop.d.ts.map +0 -1
- package/types/main/rules/TriggerOrder.d.ts +0 -8
- package/types/main/rules/TriggerOrder.d.ts.map +0 -1
- package/types/main/rules/UnconnectedElement.d.ts +0 -8
- package/types/main/rules/UnconnectedElement.d.ts.map +0 -1
- package/types/main/rules/UnsafeRunningContext.d.ts +0 -8
- package/types/main/rules/UnsafeRunningContext.d.ts.map +0 -1
- package/types/main/rules/UnusedVariable.d.ts +0 -8
- package/types/main/rules/UnusedVariable.d.ts.map +0 -1
- package/types/main/store/DefaultRuleStore.d.ts +0 -3
- package/types/main/store/DefaultRuleStore.d.ts.map +0 -1
- package/types/main/store/RuleRegistry.d.ts +0 -23
- package/types/main/store/RuleRegistry.d.ts.map +0 -1
- package/vite.config.ts +0 -33
- /package/{out/index.d.ts → index.d.ts} +0 -0
- /package/{out/index.js → index.js} +0 -0
- /package/{out/main → main}/config/NodeIcons.d.ts +0 -0
- /package/{out/main → main}/config/NodeIcons.js +0 -0
- /package/{out/main → main}/config/RegexAdapter.d.ts +0 -0
- /package/{out/main → main}/config/RegexAdapter.js +0 -0
- /package/{out/main → main}/config/RuleRegistry.d.ts +0 -0
- /package/{out/main → main}/config/RuleRegistry.js +0 -0
- /package/{out/main → main}/config/VariableIcons.d.ts +0 -0
- /package/{out/main → main}/config/VariableIcons.js +0 -0
- /package/{out/main → main}/enums/MetadataTypes.d.ts +0 -0
- /package/{out/main → main}/enums/MetadataTypes.js +0 -0
- /package/{out/main → main}/interfaces/IExceptions.d.ts +0 -0
- /package/{out/main → main}/interfaces/IExceptions.js +0 -0
- /package/{out/main → main}/interfaces/IRuleConfig.d.ts +0 -0
- /package/{out/main → main}/interfaces/IRuleConfig.js +0 -0
- /package/{out/main → main}/interfaces/IRuleDefinition.d.ts +0 -0
- /package/{out/main → main}/interfaces/IRuleDefinition.js +0 -0
- /package/{out/main → main}/interfaces/IRuleOptions.d.ts +0 -0
- /package/{out/main → main}/interfaces/IRuleOptions.js +0 -0
- /package/{out/main → main}/interfaces/IRulesConfig.d.ts +0 -0
- /package/{out/main → main}/interfaces/IRulesConfig.js +0 -0
- /package/{out/main → main}/internals/internals.d.ts +0 -0
- /package/{out/main → main}/internals/internals.js +0 -0
- /package/{out/main → main}/libs/BuildFlow.d.ts +0 -0
- /package/{out/main → main}/libs/BuildFlow.js +0 -0
- /package/{out/main → main}/libs/Compiler.d.ts +0 -0
- /package/{out/main → main}/libs/Compiler.js +0 -0
- /package/{out/main → main}/libs/ExportDetails.d.ts +0 -0
- /package/{out/main → main}/libs/ExportDetails.js +0 -0
- /package/{out/main → main}/libs/ExportDiagram.d.ts +0 -0
- /package/{out/main → main}/libs/ExportDiagram.js +0 -0
- /package/{out/main → main}/libs/ExportSarif.d.ts +0 -0
- /package/{out/main → main}/libs/ExportSarif.js +0 -0
- /package/{out/main → main}/libs/FixFlows.d.ts +0 -0
- /package/{out/main → main}/libs/FixFlows.js +0 -0
- /package/{out/main → main}/libs/GetRuleDefinitions.d.ts +0 -0
- /package/{out/main → main}/libs/GetRuleDefinitions.js +0 -0
- /package/{out/main → main}/libs/ParseFlows.d.ts +0 -0
- /package/{out/main → main}/libs/ParseFlows.js +0 -0
- /package/{out/main → main}/libs/RuleDocumentation.d.ts +0 -0
- /package/{out/main → main}/libs/RuleDocumentation.js +0 -0
- /package/{out/main → main}/libs/ScanFlows.d.ts +0 -0
- /package/{out/main → main}/libs/ScanFlows.js +0 -0
- /package/{out/main → main}/models/FlatViolation.d.ts +0 -0
- /package/{out/main → main}/models/FlatViolation.js +0 -0
- /package/{out/main → main}/models/Flow.d.ts +0 -0
- /package/{out/main → main}/models/Flow.js +0 -0
- /package/{out/main → main}/models/FlowAttribute.d.ts +0 -0
- /package/{out/main → main}/models/FlowAttribute.js +0 -0
- /package/{out/main → main}/models/FlowElement.d.ts +0 -0
- /package/{out/main → main}/models/FlowElement.js +0 -0
- /package/{out/main → main}/models/FlowElementConnector.d.ts +0 -0
- /package/{out/main → main}/models/FlowElementConnector.js +0 -0
- /package/{out/main → main}/models/FlowGraph.d.ts +0 -0
- /package/{out/main → main}/models/FlowGraph.js +0 -0
- /package/{out/main → main}/models/FlowMetadata.d.ts +0 -0
- /package/{out/main → main}/models/FlowMetadata.js +0 -0
- /package/{out/main → main}/models/FlowNode.d.ts +0 -0
- /package/{out/main → main}/models/FlowNode.js +0 -0
- /package/{out/main → main}/models/FlowResource.d.ts +0 -0
- /package/{out/main → main}/models/FlowResource.js +0 -0
- /package/{out/main → main}/models/FlowType.d.ts +0 -0
- /package/{out/main → main}/models/FlowType.js +0 -0
- /package/{out/main → main}/models/FlowVariable.d.ts +0 -0
- /package/{out/main → main}/models/FlowVariable.js +0 -0
- /package/{out/main → main}/models/LoopRuleCommon.d.ts +0 -0
- /package/{out/main → main}/models/LoopRuleCommon.js +0 -0
- /package/{out/main → main}/models/ParsedFlow.d.ts +0 -0
- /package/{out/main → main}/models/ParsedFlow.js +0 -0
- /package/{out/main → main}/models/RuleCommon.d.ts +0 -0
- /package/{out/main → main}/models/RuleCommon.js +0 -0
- /package/{out/main → main}/models/RuleInfo.d.ts +0 -0
- /package/{out/main → main}/models/RuleInfo.js +0 -0
- /package/{out/main → main}/models/RuleResult.d.ts +0 -0
- /package/{out/main → main}/models/RuleResult.js +0 -0
- /package/{out/main → main}/models/ScanResult.d.ts +0 -0
- /package/{out/main → main}/models/ScanResult.js +0 -0
- /package/{out/main → main}/models/Violation.d.ts +0 -0
- /package/{out/main → main}/models/Violation.js +0 -0
- /package/{out/main → main}/rules/APIVersion.d.ts +0 -0
- /package/{out/main → main}/rules/APIVersion.js +0 -0
- /package/{out/main → main}/rules/ActionCallsInLoop.d.ts +0 -0
- /package/{out/main → main}/rules/ActionCallsInLoop.js +0 -0
- /package/{out/main → main}/rules/AutoLayout.d.ts +0 -0
- /package/{out/main → main}/rules/AutoLayout.js +0 -0
- /package/{out/main → main}/rules/CopyAPIName.d.ts +0 -0
- /package/{out/main → main}/rules/CopyAPIName.js +0 -0
- /package/{out/main → main}/rules/CyclomaticComplexity.d.ts +0 -0
- /package/{out/main → main}/rules/CyclomaticComplexity.js +0 -0
- /package/{out/main → main}/rules/DMLStatementInLoop.d.ts +0 -0
- /package/{out/main → main}/rules/DMLStatementInLoop.js +0 -0
- /package/{out/main → main}/rules/DuplicateDMLOperation.d.ts +0 -0
- /package/{out/main → main}/rules/DuplicateDMLOperation.js +0 -0
- /package/{out/main → main}/rules/FlowDescription.d.ts +0 -0
- /package/{out/main → main}/rules/FlowDescription.js +0 -0
- /package/{out/main → main}/rules/FlowName.d.ts +0 -0
- /package/{out/main → main}/rules/FlowName.js +0 -0
- /package/{out/main → main}/rules/GetRecordAllFields.d.ts +0 -0
- /package/{out/main → main}/rules/GetRecordAllFields.js +0 -0
- /package/{out/main → main}/rules/HardcodedId.d.ts +0 -0
- /package/{out/main → main}/rules/HardcodedId.js +0 -0
- /package/{out/main → main}/rules/HardcodedSecret.d.ts +0 -0
- /package/{out/main → main}/rules/HardcodedSecret.js +0 -0
- /package/{out/main → main}/rules/HardcodedUrl.d.ts +0 -0
- /package/{out/main → main}/rules/HardcodedUrl.js +0 -0
- /package/{out/main → main}/rules/InactiveFlow.d.ts +0 -0
- /package/{out/main → main}/rules/InactiveFlow.js +0 -0
- /package/{out/main → main}/rules/MissingFaultPath.d.ts +0 -0
- /package/{out/main → main}/rules/MissingFaultPath.js +0 -0
- /package/{out/main → main}/rules/MissingMetadataDescription.d.ts +0 -0
- /package/{out/main → main}/rules/MissingMetadataDescription.js +0 -0
- /package/{out/main → main}/rules/MissingNullHandler.d.ts +0 -0
- /package/{out/main → main}/rules/MissingNullHandler.js +0 -0
- /package/{out/main → main}/rules/MissingRecordTriggerFilter.d.ts +0 -0
- /package/{out/main → main}/rules/MissingRecordTriggerFilter.js +0 -0
- /package/{out/main → main}/rules/ProcessBuilder.d.ts +0 -0
- /package/{out/main → main}/rules/ProcessBuilder.js +0 -0
- /package/{out/main → main}/rules/RecordIdAsString.d.ts +0 -0
- /package/{out/main → main}/rules/RecordIdAsString.js +0 -0
- /package/{out/main → main}/rules/RecursiveAfterUpdate.d.ts +0 -0
- /package/{out/main → main}/rules/RecursiveAfterUpdate.js +0 -0
- /package/{out/main → main}/rules/SOQLQueryInLoop.d.ts +0 -0
- /package/{out/main → main}/rules/SOQLQueryInLoop.js +0 -0
- /package/{out/main → main}/rules/SameRecordFieldUpdates.d.ts +0 -0
- /package/{out/main → main}/rules/SameRecordFieldUpdates.js +0 -0
- /package/{out/main → main}/rules/TransformInsteadOfLoop.d.ts +0 -0
- /package/{out/main → main}/rules/TransformInsteadOfLoop.js +0 -0
- /package/{out/main → main}/rules/TriggerOrder.d.ts +0 -0
- /package/{out/main → main}/rules/TriggerOrder.js +0 -0
- /package/{out/main → main}/rules/UnconnectedElement.d.ts +0 -0
- /package/{out/main → main}/rules/UnconnectedElement.js +0 -0
- /package/{out/main → main}/rules/UnsafeRunningContext.d.ts +0 -0
- /package/{out/main → main}/rules/UnsafeRunningContext.js +0 -0
- /package/{out/main → main}/rules/UnusedVariable.d.ts +0 -0
- /package/{out/main → main}/rules/UnusedVariable.js +0 -0
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import * as core from "../internals/internals";
|
|
2
|
-
import { RuleCommon } from "../models/RuleCommon";
|
|
3
|
-
import { IRuleDefinition } from "../interfaces/IRuleDefinition";
|
|
4
|
-
|
|
5
|
-
export class FlowDescription extends RuleCommon implements IRuleDefinition {
|
|
6
|
-
constructor() {
|
|
7
|
-
super({
|
|
8
|
-
ruleId: "missing-flow-description",
|
|
9
|
-
category: "layout",
|
|
10
|
-
description: "Flow descriptions are essential for documentation and maintainability. Include a description for each Flow, explaining its purpose and where it's used.",
|
|
11
|
-
summary: "Flow descriptions improve documentation and maintainability",
|
|
12
|
-
docRefs: [],
|
|
13
|
-
label: "Missing Flow Description",
|
|
14
|
-
name: "FlowDescription",
|
|
15
|
-
supportedTypes: [...core.FlowType.backEndTypes, ...core.FlowType.visualTypes],
|
|
16
|
-
}, { severity: "error" });
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
protected check(
|
|
20
|
-
flow: core.Flow,
|
|
21
|
-
_options: object | undefined,
|
|
22
|
-
_suppressions: Set<string>
|
|
23
|
-
): core.Violation[] {
|
|
24
|
-
if (flow.xmldata?.description) {
|
|
25
|
-
return [];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return [
|
|
29
|
-
new core.Violation(
|
|
30
|
-
new core.FlowAttribute("undefined", "description", "!==null")
|
|
31
|
-
)
|
|
32
|
-
];
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import * as core from "../internals/internals";
|
|
2
|
-
import { RuleCommon } from "../models/RuleCommon";
|
|
3
|
-
import { IRuleDefinition } from "../interfaces/IRuleDefinition";
|
|
4
|
-
import { NamingConvention } from "@flow-scanner/regex-scanner";
|
|
5
|
-
import { toMetadataFile, toViolations } from "../config/RegexAdapter";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Flow naming convention rule.
|
|
9
|
-
* This is a wrapper around the regex-scanner's NamingConvention rule,
|
|
10
|
-
* maintaining backward compatibility with the core scanner interface.
|
|
11
|
-
*/
|
|
12
|
-
export class FlowName extends RuleCommon implements IRuleDefinition {
|
|
13
|
-
private regexRule = new NamingConvention();
|
|
14
|
-
|
|
15
|
-
constructor() {
|
|
16
|
-
super({
|
|
17
|
-
ruleId: "invalid-naming-convention",
|
|
18
|
-
category: "layout",
|
|
19
|
-
description: "Using clear and consistent Flow names improves readability, discoverability, and maintainability. A good naming convention helps team members quickly understand a Flow's purpose—for example, including a domain and brief description like Service_OrderFulfillment. Adopt a naming pattern that aligns with your organization's standards.",
|
|
20
|
-
summary: "Consistent naming improves Flow discoverability and maintainability",
|
|
21
|
-
docRefs: [
|
|
22
|
-
{
|
|
23
|
-
label: "Naming your Flows is more critical than ever. By Stephen Church",
|
|
24
|
-
path: "https://www.linkedin.com/posts/stephen-n-church_naming-your-flows-this-is-more-critical-activity-7099733198175158274-1sPx",
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
label: "Flow Naming Convention",
|
|
28
|
-
name: "FlowName",
|
|
29
|
-
supportedTypes: core.FlowType.allTypes(),
|
|
30
|
-
}, { severity: "error" });
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
protected check(
|
|
34
|
-
flow: core.Flow,
|
|
35
|
-
options: { expression?: string } | undefined,
|
|
36
|
-
_suppressions: Set<string>
|
|
37
|
-
): core.Violation[] {
|
|
38
|
-
// Convert Flow to MetadataFile for regex-scanner
|
|
39
|
-
const metadataFile = toMetadataFile(flow);
|
|
40
|
-
|
|
41
|
-
// Execute regex rule
|
|
42
|
-
const regexViolations = this.regexRule.execute(metadataFile, {
|
|
43
|
-
expression: options?.expression,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// Convert back to core Violations
|
|
47
|
-
return toViolations(regexViolations);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import * as core from "../internals/internals";
|
|
2
|
-
import { RuleCommon } from "../models/RuleCommon";
|
|
3
|
-
import { IRuleDefinition } from "../interfaces/IRuleDefinition";
|
|
4
|
-
|
|
5
|
-
export class GetRecordAllFields extends RuleCommon implements IRuleDefinition {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(
|
|
8
|
-
{
|
|
9
|
-
ruleId: "get-record-all-fields",
|
|
10
|
-
category: "suggestion",
|
|
11
|
-
description: "Avoid using Get Records to retrieve all fields unless necessary. This improves performance, reduces processing time, and limits exposure of unnecessary data.",
|
|
12
|
-
summary: "Retrieving all fields harms performance and security",
|
|
13
|
-
docRefs: [
|
|
14
|
-
{
|
|
15
|
-
label: "Get Records Stores All Fields",
|
|
16
|
-
path: "https://developer.salesforce.com/docs/atlas.en-us.salesforce_large_data_volumes_bp.meta/salesforce_large_data_volumes_bp/ldv_deployments_best_practices_soql_and_sosl.htm",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
label: "Indexes | Best Practices",
|
|
20
|
-
path: "https://developer.salesforce.com/docs/atlas.en-us.salesforce_large_data_volumes_bp.meta/salesforce_large_data_volumes_bp/ldv_deployments_infrastructure_indexes.htm",
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
label: "Get Record All Fields",
|
|
24
|
-
name: "GetRecordAllFields",
|
|
25
|
-
supportedTypes: core.FlowType.allTypes(),
|
|
26
|
-
},
|
|
27
|
-
{ severity: "warning" }
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
protected check(
|
|
32
|
-
flow: core.Flow,
|
|
33
|
-
_options: object | undefined,
|
|
34
|
-
_suppressions: Set<string>
|
|
35
|
-
): core.Violation[] {
|
|
36
|
-
const lookupNodes = flow.elements?.filter(
|
|
37
|
-
(e) => e.subtype === "recordLookups"
|
|
38
|
-
) ?? [];
|
|
39
|
-
|
|
40
|
-
const violations = lookupNodes
|
|
41
|
-
.filter((node) => {
|
|
42
|
-
const el = (node as core.FlowNode).element as core.FlowElement;
|
|
43
|
-
|
|
44
|
-
const storeAllFields =
|
|
45
|
-
typeof el === "object" &&
|
|
46
|
-
"storeOutputAutomatically" in el &&
|
|
47
|
-
el.storeOutputAutomatically;
|
|
48
|
-
|
|
49
|
-
// Handle both single field (string) and multiple fields (array)
|
|
50
|
-
const queriedFields = (el as any).queriedFields;
|
|
51
|
-
const hasQueriedFields =
|
|
52
|
-
queriedFields &&
|
|
53
|
-
(
|
|
54
|
-
(Array.isArray(queriedFields) && queriedFields.length > 0) ||
|
|
55
|
-
typeof queriedFields === "string"
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
return storeAllFields && !hasQueriedFields;
|
|
59
|
-
})
|
|
60
|
-
.map((node) => new core.Violation(node));
|
|
61
|
-
|
|
62
|
-
return violations;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as core from "../internals/internals";
|
|
2
|
-
import { RuleCommon } from "../models/RuleCommon";
|
|
3
|
-
import { IRuleDefinition } from "../interfaces/IRuleDefinition";
|
|
4
|
-
import { HardcodedId as RegexHardcodedId } from "@flow-scanner/regex-scanner";
|
|
5
|
-
import { toMetadataFile, toViolations } from "../config/RegexAdapter";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Hardcoded Salesforce ID detection rule.
|
|
9
|
-
* This is a wrapper around the regex-scanner's HardcodedId rule,
|
|
10
|
-
* maintaining backward compatibility with the core scanner interface.
|
|
11
|
-
*/
|
|
12
|
-
export class HardcodedId extends RuleCommon implements IRuleDefinition {
|
|
13
|
-
private regexRule = new RegexHardcodedId();
|
|
14
|
-
|
|
15
|
-
constructor() {
|
|
16
|
-
super({
|
|
17
|
-
ruleId: "hardcoded-id",
|
|
18
|
-
name: "HardcodedId",
|
|
19
|
-
category: "problem",
|
|
20
|
-
label: "Hardcoded Salesforce Id",
|
|
21
|
-
description: "Avoid hard-coding record IDs, as they are unique to a specific org and will not work in other environments. Instead, store IDs in variables—such as merge-field URL parameters or a **Get Records** element—to make the Flow portable, maintainable, and flexible.",
|
|
22
|
-
summary: "Hardcoded IDs break portability across environments",
|
|
23
|
-
supportedTypes: core.FlowType.allTypes(),
|
|
24
|
-
docRefs: [
|
|
25
|
-
{
|
|
26
|
-
label: "Flow Best Practices",
|
|
27
|
-
path: "https://help.salesforce.com/s/articleView?id=sf.flow_prep_bestpractices.htm&type=5",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
label: "Don't hard code Record Type IDs in Flow. By Stephen Church.",
|
|
31
|
-
path: "https://www.linkedin.com/feed/update/urn:li:activity:6947530300012826624/",
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
}, { severity: "error" });
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
protected check(
|
|
38
|
-
flow: core.Flow,
|
|
39
|
-
_options: object | undefined,
|
|
40
|
-
_suppressions: Set<string>
|
|
41
|
-
): core.Violation[] {
|
|
42
|
-
// Convert Flow to MetadataFile for regex-scanner
|
|
43
|
-
const metadataFile = toMetadataFile(flow);
|
|
44
|
-
|
|
45
|
-
// Execute regex rule
|
|
46
|
-
const regexViolations = this.regexRule.execute(metadataFile);
|
|
47
|
-
|
|
48
|
-
// Convert back to core Violations
|
|
49
|
-
return toViolations(regexViolations);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as core from "../internals/internals";
|
|
2
|
-
import { RuleCommon } from "../models/RuleCommon";
|
|
3
|
-
import { IRuleDefinition } from "../interfaces/IRuleDefinition";
|
|
4
|
-
import { HardcodedSecret as RegexHardcodedSecret } from "@flow-scanner/regex-scanner";
|
|
5
|
-
import { toMetadataFile, toViolations } from "../config/RegexAdapter";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Hardcoded secrets detection rule.
|
|
9
|
-
* This is a wrapper around the regex-scanner's HardcodedSecret rule,
|
|
10
|
-
* maintaining backward compatibility with the core scanner interface.
|
|
11
|
-
*/
|
|
12
|
-
export class HardcodedSecret extends RuleCommon implements IRuleDefinition {
|
|
13
|
-
private regexRule = new RegexHardcodedSecret();
|
|
14
|
-
|
|
15
|
-
constructor() {
|
|
16
|
-
super({
|
|
17
|
-
ruleId: "hardcoded-secret",
|
|
18
|
-
name: "HardcodedSecret",
|
|
19
|
-
category: "problem",
|
|
20
|
-
label: "Hardcoded Secret",
|
|
21
|
-
description: "Avoid hardcoding secrets, API keys, tokens, or credentials in Flows. These should be stored securely in Named Credentials, Custom Settings, Custom Metadata, or external secret management systems.",
|
|
22
|
-
summary: "Hardcoded secrets pose security risks",
|
|
23
|
-
supportedTypes: core.FlowType.allTypes(),
|
|
24
|
-
docRefs: [
|
|
25
|
-
{
|
|
26
|
-
label: "Salesforce Named Credentials",
|
|
27
|
-
path: "https://help.salesforce.com/s/articleView?id=sf.named_credentials_about.htm",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
label: "OWASP Secrets Management Cheat Sheet",
|
|
31
|
-
path: "https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html",
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
}, { severity: "error" });
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
protected check(
|
|
38
|
-
flow: core.Flow,
|
|
39
|
-
_options: object | undefined,
|
|
40
|
-
_suppressions: Set<string>
|
|
41
|
-
): core.Violation[] {
|
|
42
|
-
// Convert Flow to MetadataFile for regex-scanner
|
|
43
|
-
const metadataFile = toMetadataFile(flow);
|
|
44
|
-
|
|
45
|
-
// Execute regex rule
|
|
46
|
-
const regexViolations = this.regexRule.execute(metadataFile);
|
|
47
|
-
|
|
48
|
-
// Convert back to core Violations
|
|
49
|
-
return toViolations(regexViolations);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Flow, FlowType, Violation } from "../internals/internals";
|
|
2
|
-
import { RuleCommon } from "../models/RuleCommon";
|
|
3
|
-
import { IRuleDefinition } from "../interfaces/IRuleDefinition";
|
|
4
|
-
import { HardcodedUrl as RegexHardcodedUrl } from "@flow-scanner/regex-scanner";
|
|
5
|
-
import { toMetadataFile, toViolations } from "../config/RegexAdapter";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Hardcoded Salesforce URL detection rule.
|
|
9
|
-
* This is a wrapper around the regex-scanner's HardcodedUrl rule,
|
|
10
|
-
* maintaining backward compatibility with the core scanner interface.
|
|
11
|
-
*/
|
|
12
|
-
export class HardcodedUrl extends RuleCommon implements IRuleDefinition {
|
|
13
|
-
private regexRule = new RegexHardcodedUrl();
|
|
14
|
-
|
|
15
|
-
constructor() {
|
|
16
|
-
super(
|
|
17
|
-
{
|
|
18
|
-
ruleId: "hardcoded-url",
|
|
19
|
-
category: "problem",
|
|
20
|
-
description: "Avoid hard-coding URLs, as they may change between environments or over time. Instead, store URLs in variables or custom settings to make the Flow adaptable, maintainable, and environment-independent.",
|
|
21
|
-
summary: "Hardcoded URLs break across different environments",
|
|
22
|
-
docRefs: [
|
|
23
|
-
{
|
|
24
|
-
label: "The Ultimate Guide to Salesforce Flow Best Practices",
|
|
25
|
-
path: "https://admin.salesforce.com/blog/2021/the-ultimate-guide-to-flow-best-practices-and-standards",
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
label: "Why You Should Avoid Hard Coding and Three Alternative Solutions",
|
|
29
|
-
path: "https://admin.salesforce.com/blog/2021/why-you-should-avoid-hard-coding-and-three-alternative-solutions",
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
label: "Hardcoded Salesforce Url",
|
|
33
|
-
name: "HardcodedUrl",
|
|
34
|
-
supportedTypes: FlowType.allTypes(),
|
|
35
|
-
},
|
|
36
|
-
{ severity: "error" }
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
protected check(
|
|
41
|
-
flow: Flow,
|
|
42
|
-
_options: object | undefined,
|
|
43
|
-
_suppressions: Set<string>
|
|
44
|
-
): Violation[] {
|
|
45
|
-
// Convert Flow to MetadataFile for regex-scanner
|
|
46
|
-
const metadataFile = toMetadataFile(flow);
|
|
47
|
-
|
|
48
|
-
// Execute regex rule
|
|
49
|
-
const regexViolations = this.regexRule.execute(metadataFile);
|
|
50
|
-
|
|
51
|
-
// Convert back to core Violations
|
|
52
|
-
return toViolations(regexViolations);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as core from "../internals/internals";
|
|
2
|
-
import { RuleCommon } from "../models/RuleCommon";
|
|
3
|
-
import { IRuleDefinition } from "../interfaces/IRuleDefinition";
|
|
4
|
-
|
|
5
|
-
export class InactiveFlow extends RuleCommon implements IRuleDefinition {
|
|
6
|
-
constructor() {
|
|
7
|
-
super({
|
|
8
|
-
ruleId: "inactive-flow",
|
|
9
|
-
category: "suggestion",
|
|
10
|
-
name: "InactiveFlow",
|
|
11
|
-
label: "Inactive Flow",
|
|
12
|
-
description: "Inactive Flows should be deleted or archived to reduce risk. Even when inactive, they can cause unintended record changes during testing or be activated as subflows. Keeping only active, relevant Flows improves safety and maintainability.",
|
|
13
|
-
summary: "Inactive Flows should be deleted or archived",
|
|
14
|
-
supportedTypes: core.FlowType.allTypes(),
|
|
15
|
-
docRefs: [],
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
protected check(
|
|
20
|
-
flow: core.Flow,
|
|
21
|
-
_options: object | undefined,
|
|
22
|
-
_suppressions: Set<string>
|
|
23
|
-
): core.Violation[] {
|
|
24
|
-
if (flow.status !== "Active") {
|
|
25
|
-
return [
|
|
26
|
-
new core.Violation(
|
|
27
|
-
new core.FlowAttribute(flow.status, "status", "!= Active")
|
|
28
|
-
),
|
|
29
|
-
];
|
|
30
|
-
}
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import * as core from "../internals/internals";
|
|
2
|
-
import { RuleCommon } from "../models/RuleCommon";
|
|
3
|
-
import { IRuleDefinition } from "../interfaces/IRuleDefinition";
|
|
4
|
-
|
|
5
|
-
export class MissingFaultPath extends RuleCommon implements IRuleDefinition {
|
|
6
|
-
protected applicableElements: string[] = [
|
|
7
|
-
"recordLookups",
|
|
8
|
-
"recordDeletes",
|
|
9
|
-
"recordUpdates",
|
|
10
|
-
"recordCreates",
|
|
11
|
-
"waits",
|
|
12
|
-
"actionCalls",
|
|
13
|
-
"apexPluginCalls",
|
|
14
|
-
];
|
|
15
|
-
|
|
16
|
-
constructor() {
|
|
17
|
-
super({
|
|
18
|
-
ruleId: "missing-fault-path",
|
|
19
|
-
category: "problem",
|
|
20
|
-
description: "Elements that can fail should include a Fault Path to handle errors gracefully. Without it, failures show generic errors to users. Fault Paths improve reliability and user experience.",
|
|
21
|
-
summary: "Fault Paths enable graceful error handling",
|
|
22
|
-
docRefs: [
|
|
23
|
-
{
|
|
24
|
-
label: "Flow Best Practices",
|
|
25
|
-
path: "https://help.salesforce.com/s/articleView?id=sf.flow_prep_bestpractices.htm&type=5",
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
label: "Missing Fault Path",
|
|
29
|
-
name: "MissingFaultPath",
|
|
30
|
-
supportedTypes: [...core.FlowType.backEndTypes, ...core.FlowType.visualTypes],
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
private isValidSubtype(proxyNode: core.FlowNode): boolean {
|
|
35
|
-
if (!this.applicableElements.includes(proxyNode.subtype)) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Exclude specific wait element subtypes that don't need fault paths
|
|
40
|
-
if (proxyNode.subtype === "waits") {
|
|
41
|
-
const elementSubtype: string = (proxyNode.element as Record<string, unknown>)?.["elementSubtype"] as string;
|
|
42
|
-
const excludedSubtypes: string[] = ["WaitDuration", "WaitDate"];
|
|
43
|
-
return !excludedSubtypes.includes(elementSubtype);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
protected check(
|
|
50
|
-
flow: core.Flow,
|
|
51
|
-
_options: object | undefined,
|
|
52
|
-
suppressions: Set<string>
|
|
53
|
-
): core.Violation[] {
|
|
54
|
-
const results: core.Violation[] = [];
|
|
55
|
-
|
|
56
|
-
const elementsWhereFaultPathIsApplicable = (
|
|
57
|
-
flow.elements.filter((node) => {
|
|
58
|
-
const proxyNode = node as unknown as core.FlowNode;
|
|
59
|
-
return this.isValidSubtype(proxyNode);
|
|
60
|
-
}) as core.FlowNode[]
|
|
61
|
-
).map((e) => e.name);
|
|
62
|
-
|
|
63
|
-
// Check if this is a RecordBeforeSave flow
|
|
64
|
-
const isRecordBeforeSave = this.isRecordBeforeSaveFlow(flow);
|
|
65
|
-
|
|
66
|
-
const visitCallback = (element: core.FlowNode) => {
|
|
67
|
-
if (
|
|
68
|
-
!element?.connectors?.find((connector) => connector.type === "faultConnector") &&
|
|
69
|
-
elementsWhereFaultPathIsApplicable.includes(element.name)
|
|
70
|
-
) {
|
|
71
|
-
// Skip record updates in before-save flows (they're safe by design)
|
|
72
|
-
if (isRecordBeforeSave && element.subtype === "recordUpdates") {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (!this.isPartOfFaultHandlingFlow(element, flow)) {
|
|
77
|
-
if (!suppressions.has(element.name)) {
|
|
78
|
-
results.push(new core.Violation(element));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
flow.graph?.forEachReachable(visitCallback);
|
|
85
|
-
|
|
86
|
-
return results;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Determine if this is a RecordBeforeSave flow.
|
|
91
|
-
*/
|
|
92
|
-
private isRecordBeforeSaveFlow(flow: core.Flow): boolean {
|
|
93
|
-
if (flow.startNode?.element) {
|
|
94
|
-
const triggerType = (flow.startNode.element as Record<string, unknown>)?.["triggerType"];
|
|
95
|
-
if (triggerType === "RecordBeforeSave") {
|
|
96
|
-
return true;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
private isPartOfFaultHandlingFlow(element: core.FlowNode, flow: core.Flow): boolean {
|
|
103
|
-
return flow.graph?.isPartOfFaultHandling(element.name) || false;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { IRuleDefinition } from "../interfaces/IRuleDefinition";
|
|
2
|
-
import * as core from "../internals/internals";
|
|
3
|
-
import { RuleCommon } from "../models/RuleCommon";
|
|
4
|
-
|
|
5
|
-
export class MissingMetadataDescription extends RuleCommon implements IRuleDefinition {
|
|
6
|
-
constructor() {
|
|
7
|
-
super({
|
|
8
|
-
ruleId: "missing-metadata-description",
|
|
9
|
-
category: "layout",
|
|
10
|
-
description: "Elements and metadata without a description reduce clarity and maintainability. Adding descriptions improves readability and makes your automation easier to understand.",
|
|
11
|
-
summary: "Element descriptions improve clarity and maintainability",
|
|
12
|
-
docRefs: [],
|
|
13
|
-
label: "Missing Metadata Description",
|
|
14
|
-
name: "MissingMetadataDescription",
|
|
15
|
-
supportedTypes: core.FlowType.allTypes(),
|
|
16
|
-
}, { severity: "warning" });
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
protected check(
|
|
20
|
-
flow: core.Flow,
|
|
21
|
-
_options: object | undefined,
|
|
22
|
-
_suppression: Set<string>
|
|
23
|
-
): core.Violation[] {
|
|
24
|
-
const violations: core.Violation[] = [];
|
|
25
|
-
|
|
26
|
-
flow.elements
|
|
27
|
-
.filter((elem) => {
|
|
28
|
-
if (
|
|
29
|
-
elem.metaType !== "attribute" &&
|
|
30
|
-
!elem.element["description"] &&
|
|
31
|
-
elem.subtype !== "start"
|
|
32
|
-
) {
|
|
33
|
-
return elem;
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
.forEach((elem) => {
|
|
37
|
-
return violations.push(new core.Violation(elem));
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
return violations;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import * as core from "../internals/internals";
|
|
2
|
-
import { RuleCommon } from "../models/RuleCommon";
|
|
3
|
-
import { IRuleDefinition } from "../interfaces/IRuleDefinition";
|
|
4
|
-
export class MissingNullHandler extends RuleCommon implements IRuleDefinition {
|
|
5
|
-
constructor() {
|
|
6
|
-
super({
|
|
7
|
-
ruleId: "missing-null-handler",
|
|
8
|
-
category: "problem",
|
|
9
|
-
description: "Get Records operations return null when no data is found. Without handling these null values, Flows can fail or produce unintended results. Adding a null check improves reliability and ensures the Flow behaves as expected.",
|
|
10
|
-
summary: "Null checks prevent failures from missing records",
|
|
11
|
-
docRefs: [],
|
|
12
|
-
label: "Missing Null Handler",
|
|
13
|
-
name: "MissingNullHandler",
|
|
14
|
-
supportedTypes: [...core.FlowType.backEndTypes, ...core.FlowType.visualTypes],
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
protected check(
|
|
19
|
-
flow: core.Flow,
|
|
20
|
-
_options: object | undefined,
|
|
21
|
-
suppressions: Set<string>
|
|
22
|
-
): core.Violation[] {
|
|
23
|
-
const getOperations = ["recordLookups"];
|
|
24
|
-
const getOperationElements: core.FlowNode[] = flow.elements.filter(
|
|
25
|
-
(node) => node.metaType === "node" && getOperations.includes(node.subtype)
|
|
26
|
-
) as core.FlowNode[];
|
|
27
|
-
|
|
28
|
-
const decisionElements: core.FlowNode[] = flow.elements.filter(
|
|
29
|
-
(node) => node.metaType === "node" && node.subtype === "decisions"
|
|
30
|
-
) as core.FlowNode[];
|
|
31
|
-
|
|
32
|
-
const violations: core.FlowNode[] = [];
|
|
33
|
-
|
|
34
|
-
for (const getElement of getOperationElements) {
|
|
35
|
-
if (suppressions.has(getElement.name)) continue;
|
|
36
|
-
|
|
37
|
-
const elementName = getElement.name;
|
|
38
|
-
const assignNulls = String(getElement.element["assignNullValuesIfNoRecordsFound"]).toLowerCase() === "true";
|
|
39
|
-
|
|
40
|
-
const hasFaultConnector =
|
|
41
|
-
!!getElement.element["faultConnector"] ||
|
|
42
|
-
getElement.connectors?.some((c) => c.type === "faultConnector");
|
|
43
|
-
|
|
44
|
-
// Only skip if NOT assigning nulls AND has fault connector
|
|
45
|
-
// (because fault will catch the "no records" error)
|
|
46
|
-
if (!assignNulls && hasFaultConnector) {
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const resultReferences: string[] = [];
|
|
51
|
-
if (getElement.element["storeOutputAutomatically"]) {
|
|
52
|
-
resultReferences.push(elementName);
|
|
53
|
-
} else if (getElement.element["outputReference"]) {
|
|
54
|
-
resultReferences.push(getElement.element["outputReference"] as string);
|
|
55
|
-
} else if (getElement.element["outputAssignments"]) {
|
|
56
|
-
const assignments = getElement.element["outputAssignments"] as any[];
|
|
57
|
-
for (const a of assignments) {
|
|
58
|
-
resultReferences.push(a.assignToReference);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const resultIsUsed = flow.elements.some((el) => {
|
|
63
|
-
if (el.name === getElement.name) return false;
|
|
64
|
-
const json = JSON.stringify(el.element);
|
|
65
|
-
return resultReferences.some(
|
|
66
|
-
(ref) => json.includes(`"${ref}"`) || json.includes(`"${ref}.`)
|
|
67
|
-
);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
if (!resultIsUsed) continue;
|
|
71
|
-
|
|
72
|
-
// If assignNullValuesIfNoRecordsFound is TRUE, we need a null check decision
|
|
73
|
-
if (!assignNulls) {
|
|
74
|
-
// If FALSE and no fault connector, that's also a problem
|
|
75
|
-
// (already handled above)
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
let nullCheckFound = false;
|
|
80
|
-
for (const decision of decisionElements) {
|
|
81
|
-
let rules = decision.element["rules"];
|
|
82
|
-
if (!Array.isArray(rules)) rules = [rules];
|
|
83
|
-
|
|
84
|
-
for (const rule of rules) {
|
|
85
|
-
let conditions = rule.conditions;
|
|
86
|
-
if (!Array.isArray(conditions)) conditions = [conditions];
|
|
87
|
-
|
|
88
|
-
for (const condition of conditions) {
|
|
89
|
-
let referenceFound = false;
|
|
90
|
-
let isNullOperator = false;
|
|
91
|
-
let checksFalse = false;
|
|
92
|
-
|
|
93
|
-
if (condition.leftValueReference) {
|
|
94
|
-
const ref = condition.leftValueReference as string;
|
|
95
|
-
if (resultReferences.some((r) => ref.startsWith(r))) {
|
|
96
|
-
referenceFound = true;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
if (condition.operator === "IsNull") {
|
|
101
|
-
isNullOperator = true;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const rightBool = condition.rightValue?.booleanValue;
|
|
105
|
-
if (rightBool != null && String(rightBool).toLowerCase() === "false") {
|
|
106
|
-
checksFalse = true;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (referenceFound && isNullOperator && checksFalse) {
|
|
110
|
-
nullCheckFound = true;
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (nullCheckFound) break;
|
|
115
|
-
}
|
|
116
|
-
if (nullCheckFound) break;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if (!nullCheckFound) {
|
|
120
|
-
violations.push(getElement);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return violations.map((det) => new core.Violation(det));
|
|
125
|
-
}
|
|
126
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import * as core from "../internals/internals";
|
|
2
|
-
import { RuleCommon } from "../models/RuleCommon";
|
|
3
|
-
import { IRuleDefinition } from "../interfaces/IRuleDefinition";
|
|
4
|
-
|
|
5
|
-
export class MissingRecordTriggerFilter extends RuleCommon implements IRuleDefinition {
|
|
6
|
-
constructor() {
|
|
7
|
-
super({
|
|
8
|
-
ruleId: "missing-record-trigger-filter",
|
|
9
|
-
category: "suggestion",
|
|
10
|
-
name: "MissingRecordTriggerFilter",
|
|
11
|
-
label: "Missing Filter Record Trigger",
|
|
12
|
-
description: "Record-triggered Flows without filters on changed fields or entry conditions execute on every record change. Adding filters ensures the Flow runs only when needed, improving performance.",
|
|
13
|
-
summary: "Filters ensure Flows run only when needed",
|
|
14
|
-
supportedTypes: [core.FlowType.autolaunchedType],
|
|
15
|
-
docRefs: [],
|
|
16
|
-
}, { severity: "warning" });
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
protected check(
|
|
20
|
-
flow: core.Flow,
|
|
21
|
-
_options: object | undefined,
|
|
22
|
-
_suppressions: Set<string>
|
|
23
|
-
): core.Violation[] {
|
|
24
|
-
const violations: core.Violation[] = [];
|
|
25
|
-
// Check if this is a record-triggered flow
|
|
26
|
-
const triggerType = this.getStartProperty(flow, 'triggerType');
|
|
27
|
-
// Only check flows with record trigger types
|
|
28
|
-
if (!triggerType || !["RecordAfterSave", "RecordBeforeSave"].includes(triggerType)) {
|
|
29
|
-
return violations;
|
|
30
|
-
}
|
|
31
|
-
// Check if the flow has filters or entry conditions at the flow level
|
|
32
|
-
const filters = this.getStartProperty(flow, 'filters');
|
|
33
|
-
|
|
34
|
-
const hasFilters = !!filters;
|
|
35
|
-
const scheduledPaths = flow.xmldata?.start?.scheduledPaths;
|
|
36
|
-
const hasScheduledPaths = !!scheduledPaths;
|
|
37
|
-
// If no filters or scheduled paths (which have their own conditions), flag as violation
|
|
38
|
-
if (!hasFilters && !hasScheduledPaths) {
|
|
39
|
-
violations.push(
|
|
40
|
-
new core.Violation(
|
|
41
|
-
new core.FlowAttribute(
|
|
42
|
-
triggerType,
|
|
43
|
-
"triggerType",
|
|
44
|
-
"autolaunched && triggerType"
|
|
45
|
-
)
|
|
46
|
-
)
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
return violations;
|
|
50
|
-
}
|
|
51
|
-
}
|