@flow-scanner/lightning-flow-scanner-core 6.6.4 → 6.6.5
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/CONTRIBUTING.md +31 -0
- package/README.md +426 -0
- package/SECURITY.md +54 -0
- package/package.json +7 -57
- package/.husky/pre-commit +0 -1
- package/.husky/pre-push +0 -1
- package/.prettierignore +0 -5
- package/.swcrc +0 -26
- 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/out/assets/media/banner.png +0 -0
- package/prettier.config.mjs +0 -5
- package/src/index.ts +0 -44
- package/src/main/interfaces/IExceptions.ts +0 -6
- package/src/main/interfaces/IRuleConfig.ts +0 -3
- package/src/main/interfaces/IRuleDefinition.ts +0 -12
- package/src/main/interfaces/IRuleOptions.ts +0 -5
- package/src/main/interfaces/IRulesConfig.ts +0 -15
- package/src/main/internals/internals.ts +0 -35
- package/src/main/libs/BuildFlow.ts +0 -11
- package/src/main/libs/Compiler.ts +0 -69
- package/src/main/libs/ConvertFlowNodes.ts +0 -4
- package/src/main/libs/DynamicRule.ts +0 -11
- package/src/main/libs/FixFlows.ts +0 -61
- package/src/main/libs/GetRuleDefinitions.ts +0 -65
- package/src/main/libs/ParseFlows.ts +0 -34
- package/src/main/libs/ScanFlows.ts +0 -112
- package/src/main/libs/exportAsDetails.ts +0 -26
- package/src/main/libs/exportAsSarif.ts +0 -88
- package/src/main/models/FlatViolation.ts +0 -8
- package/src/main/models/Flow.ts +0 -214
- package/src/main/models/FlowAttribute.ts +0 -12
- package/src/main/models/FlowElement.ts +0 -15
- package/src/main/models/FlowElementConnector.ts +0 -28
- package/src/main/models/FlowMetadata.ts +0 -7
- package/src/main/models/FlowNode.ts +0 -171
- package/src/main/models/FlowResource.ts +0 -10
- package/src/main/models/FlowType.ts +0 -52
- package/src/main/models/FlowVariable.ts +0 -12
- package/src/main/models/LoopRuleCommon.ts +0 -55
- package/src/main/models/ParsedFlow.ts +0 -15
- package/src/main/models/RuleCommon.ts +0 -68
- package/src/main/models/RuleInfo.ts +0 -43
- package/src/main/models/RuleResult.ts +0 -25
- package/src/main/models/ScanResult.ts +0 -12
- package/src/main/models/Violation.ts +0 -78
- package/src/main/rules/APIVersion.ts +0 -59
- package/src/main/rules/ActionCallsInLoop.ts +0 -24
- package/src/main/rules/AutoLayout.ts +0 -44
- package/src/main/rules/CopyAPIName.ts +0 -29
- package/src/main/rules/CyclomaticComplexity.ts +0 -67
- package/src/main/rules/DMLStatementInLoop.ts +0 -24
- package/src/main/rules/DuplicateDMLOperation.ts +0 -114
- package/src/main/rules/FlowDescription.ts +0 -32
- package/src/main/rules/FlowName.ts +0 -40
- package/src/main/rules/GetRecordAllFields.ts +0 -59
- package/src/main/rules/HardcodedId.ts +0 -37
- package/src/main/rules/HardcodedUrl.ts +0 -42
- package/src/main/rules/InactiveFlow.ts +0 -31
- package/src/main/rules/MissingFaultPath.ts +0 -89
- package/src/main/rules/MissingMetadataDescription.ts +0 -39
- package/src/main/rules/MissingNullHandler.ts +0 -95
- package/src/main/rules/ProcessBuilder.ts +0 -33
- package/src/main/rules/RecursiveAfterUpdate.ts +0 -88
- package/src/main/rules/SOQLQueryInLoop.ts +0 -24
- package/src/main/rules/SameRecordFieldUpdates.ts +0 -64
- package/src/main/rules/TriggerOrder.ts +0 -44
- package/src/main/rules/UnconnectedElement.ts +0 -48
- package/src/main/rules/UnsafeRunningContext.ts +0 -44
- package/src/main/rules/UnusedVariable.ts +0 -64
- package/src/main/store/DefaultRuleStore.ts +0 -54
- package/stryker.config.mjs +0 -23
- package/tests/APIVersion.test.ts +0 -83
- package/tests/AutoLayout.test.ts +0 -39
- package/tests/Config.test.ts +0 -119
- package/tests/ConfigBetaMode.test.ts +0 -26
- package/tests/CopyAPIName.test.ts +0 -43
- package/tests/CyclomaticComplexity.test.ts +0 -123
- package/tests/DMLStatementInLoop.test.ts +0 -31
- package/tests/DuplicateDMLOperation.test.ts +0 -41
- package/tests/Exceptions.test.ts +0 -813
- package/tests/ExportSarif.test.ts +0 -61
- package/tests/FlowDescription.test.ts +0 -42
- package/tests/FlowName.test.ts +0 -62
- package/tests/GetRecordElementAllFields.test.ts +0 -180
- package/tests/HardcodedId.test.ts +0 -16
- package/tests/HardcodedUrl.test.ts +0 -252
- package/tests/InactiveFlow.test.ts +0 -99
- package/tests/MissingFaultPath.test.ts +0 -50
- package/tests/MissingMetadataDescription.test.ts +0 -24
- package/tests/MissingNullHandler.test.ts +0 -43
- package/tests/No_Missing_Null_Handler.test.ts +0 -30
- package/tests/RecursiveAfterUpdate.test.ts +0 -160
- package/tests/SOQLQueryInLoop.test.ts +0 -32
- package/tests/SameRecordFieldUpdates.test.ts +0 -241
- package/tests/SanityTest.test.ts +0 -15
- package/tests/TriggerOrder.test.ts +0 -92
- package/tests/UnconnectedElement.test.ts +0 -74
- package/tests/UnsafeRunningContext.test.ts +0 -46
- package/tests/UnusedVariable.test.ts +0 -56
- 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 -253
- package/tests/models/RuleCommon.test.ts +0 -47
- package/tsconfig.json +0 -19
- package/tsconfig.tsbuildinfo +0 -1
- package/tsconfig.types.json +0 -25
- package/vite.config.ts +0 -28
- /package/{out/index.d.ts → index.d.ts} +0 -0
- /package/{out/index.js → index.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/ConvertFlowNodes.d.ts +0 -0
- /package/{out/main → main}/libs/ConvertFlowNodes.js +0 -0
- /package/{out/main → main}/libs/DynamicRule.d.ts +0 -0
- /package/{out/main → main}/libs/DynamicRule.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/ScanFlows.d.ts +0 -0
- /package/{out/main → main}/libs/ScanFlows.js +0 -0
- /package/{out/main → main}/libs/exportAsDetails.d.ts +0 -0
- /package/{out/main → main}/libs/exportAsDetails.js +0 -0
- /package/{out/main → main}/libs/exportAsSarif.d.ts +0 -0
- /package/{out/main → main}/libs/exportAsSarif.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/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/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/ProcessBuilder.d.ts +0 -0
- /package/{out/main → main}/rules/ProcessBuilder.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/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
- /package/{out/main → main}/store/DefaultRuleStore.d.ts +0 -0
- /package/{out/main → main}/store/DefaultRuleStore.js +0 -0
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
## Contributing Guidelines
|
|
2
|
+
|
|
3
|
+
Since 20201, the _Lightning Flow Scanner_ has grown from its roots as VS Code tool to empower Salesforce Developers across six free and open-source platforms—from developer tools to native Salesforce App—delivering a unified experience for robust static analysis of Flows. Our dedicated community has shared their expertise to deepen understanding of Flow optimization. Your support can amplify our impact. Here’s how you can contribute:
|
|
4
|
+
|
|
5
|
+
- ⭐ Star or follow the project.
|
|
6
|
+
- 📢 Share our work with your network.
|
|
7
|
+
- 💬 Share feedback to help us improve.
|
|
8
|
+
- 💻 Contribute code by submitting pull requests.
|
|
9
|
+
- 🤝 [Join as a member](https://register.lightningflowscanner.org/) to connect.
|
|
10
|
+
|
|
11
|
+
### I have a Question/Feedback
|
|
12
|
+
|
|
13
|
+
For general questions, ideas, or seeking input on topics that might (or might not) turn into issues, we recommend to use our [Discussions](https://github.com/orgs/Flow-Scanner/discussions) forum. This is best for open-ended conversations, brainstorming, and gathering community input before creating a feature request.
|
|
14
|
+
|
|
15
|
+
If it's more specific like a bug or a new feature—use [GitHub Issues](https://github.com/features/issues) instead. Before creating a new issue, please take a moment to search the existing [Issues](https://github.com/Flow-Scanner/lightning-flow-scanner/issues) to prevent duplicates. If you find something relevant, adding an upvote helps us understand demand and prioritize better. We've prepared a few templates to guide you through the process of issue reporting:
|
|
16
|
+
|
|
17
|
+
###### Core Engine - For issues or requests related to the core functionality of the scanner, use the following links to submit your request:
|
|
18
|
+
|
|
19
|
+
- [Report Issue](https://github.com/Flow-Scanner/lightning-flow-scanner/issues/new?template=bug_report.md): Report a bug or issue.
|
|
20
|
+
- [Rule Request](https://github.com/Flow-Scanner/lightning-flow-scanner/issues/new?template=rule-request.md): Submit a request for a new rule.
|
|
21
|
+
- [Features/Other](https://github.com/Flow-Scanner/lightning-flow-scanner/issues/new): Suggest a new feature or enhancement.
|
|
22
|
+
|
|
23
|
+
###### Platforms - For issues or requests related to specific platforms, use the appropriate link below:
|
|
24
|
+
|
|
25
|
+
- [CLI Plugin](https://github.com/Flow-Scanner/lightning-flow-scanner/issues)
|
|
26
|
+
- [Copado Plugin](https://github.com/Flow-Scanner/lightning-flow-scanner-copado/issues)
|
|
27
|
+
- [GitHub Action](https://github.com/Flow-Scanner/lightning-flow-scanner/issues)
|
|
28
|
+
- [Salesforce App](https://github.com/Flow-Scanner/lightning-flow-scanner-app/issues)
|
|
29
|
+
- [VS Code/Code Builder](https://github.com/Flow-Scanner/lightning-flow-scanner/issues)
|
|
30
|
+
|
|
31
|
+
###### Thank you
|
package/README.md
ADDED
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/LICENSE.md">
|
|
3
|
+
<img src="https://img.shields.io/github/license/Flow-Scanner/lightning-flow-scanner?style=flat-square" alt="License">
|
|
4
|
+
</a>
|
|
5
|
+
<a href="https://github.com/Flow-Scanner/lightning-flow-scanner/graphs/contributors">
|
|
6
|
+
<img src="https://img.shields.io/github/contributors/Flow-Scanner/lightning-flow-scanner.svg?style=flat-square" alt="Contributors">
|
|
7
|
+
</a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/@flow-scanner/lightning-flow-scanner-core">
|
|
9
|
+
<img src="https://img.shields.io/npm/v/@flow-scanner/lightning-flow-scanner-core?label=core&style=flat-square" alt="Core version">
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/lightning-flow-scanner">
|
|
12
|
+
<img src="https://img.shields.io/npm/v/lightning-flow-scanner?label=cli&style=flat-square" alt="CLI version">
|
|
13
|
+
</a>
|
|
14
|
+
<a href="https://open-vsx.org/extension/ForceConfigControl/lightning-flow-scanner-vsx">
|
|
15
|
+
<img src="https://img.shields.io/open-vsx/v/ForceConfigControl/lightning-flow-scanner-vsx?label=Open%20VSX&style=flat-square" alt="Open VSX">
|
|
16
|
+
</a>
|
|
17
|
+
<a href="https://github.com/Flow-Scanner/lightning-flow-scanner/stargazers">
|
|
18
|
+
<img src="https://img.shields.io/github/stars/Flow-Scanner/lightning-flow-scanner?style=flat-square" alt="GitHub stars">
|
|
19
|
+
</a>
|
|
20
|
+
<a href="https://www.npmjs.com/package/lightning-flow-scanner-core">
|
|
21
|
+
<img src="https://img.shields.io/badge/downloads-510k%2B-success?style=flat-square" alt="Total Downloads">
|
|
22
|
+
</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<p align="center">
|
|
26
|
+
<a href="https://github.com/Flow-Scanner">
|
|
27
|
+
<img src="https://raw.githubusercontent.com/Flow-Scanner/Lightning-Flow-Scanner/main/assets/media/banner.png" alt="Lightning Flow Scanner" width="43%" />
|
|
28
|
+
</a>
|
|
29
|
+
</p>
|
|
30
|
+
|
|
31
|
+
<p align="center"><i>Detect unsafe contexts, queries in loops, hardcoded IDs, and more to optimize Salesforce Flows</i></p>
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Table of contens
|
|
36
|
+
|
|
37
|
+
- **[Default Rules](#default-rules)**
|
|
38
|
+
- **[Configuration](#configuration)**
|
|
39
|
+
- [Defining Severity Levels](#defining-severity-levels)
|
|
40
|
+
- [Configuring Expressions](#configuring-expressions)
|
|
41
|
+
- [Specifying Exceptions](#specifying-exceptions)
|
|
42
|
+
- [Include Beta Rules](#include-beta-rules)
|
|
43
|
+
- **[Installation](#installation)**
|
|
44
|
+
- [Distributions](#distributions)
|
|
45
|
+
- [CICD Templates](#cicd-templates)
|
|
46
|
+
- **[Quick Start](#quick-start)**
|
|
47
|
+
- **[Development](#development)**
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Default Rules
|
|
52
|
+
|
|
53
|
+
<p>📌<strong>Tip:</strong> To link directly to a specific rule, use the full GitHub anchor link format. Example:</p>
|
|
54
|
+
<p><em><a href="https://github.com/Flow-Scanner/lightning-flow-scanner#unsafe-running-context">https://github.com/Flow-Scanner/lightning-flow-scanner#unsafe-running-context</a></em></p>
|
|
55
|
+
|
|
56
|
+
> Want to code a new rule? → See [How to Write a Rule](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/docs/write-a-rule.md)
|
|
57
|
+
|
|
58
|
+
### Action Calls In Loop
|
|
59
|
+
|
|
60
|
+
_[ActionCallsInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/ActionCallsInLoop.ts)_ - To prevent exceeding Apex governor limits, it is advisable to consolidate and bulkify your apex calls, utilizing a single action call containing a collection variable at the end of the loop.
|
|
61
|
+
|
|
62
|
+
### Outdated API Version
|
|
63
|
+
|
|
64
|
+
_[APIVersion](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/APIVersion.ts)_ - Introducing newer API components may lead to unexpected issues with older versions of Flows, as they might not align with the underlying mechanics. Starting from API version 50.0, the **Api Version** attribute has been readily available on the Flow Object. To ensure smooth operation and reduce discrepancies between API versions, it is strongly advised to regularly update and maintain them.
|
|
65
|
+
|
|
66
|
+
### Auto Layout
|
|
67
|
+
|
|
68
|
+
_[AutoLayout](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/AutoLayout.ts)_ - With Canvas Mode set to Auto‑Layout, elements are spaced, connected, and aligned automatically, keeping your Flow neatly organized—saving you time.
|
|
69
|
+
|
|
70
|
+
### Copy API Name
|
|
71
|
+
|
|
72
|
+
_[CopyAPIName](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/CopyAPIName.ts)_ - Maintaining multiple elements with a similar name, like `Copy_X_Of_Element`, can diminish the overall readability of your Flow. When copying and pasting these elements, remember to update the API name of the newly created copy.
|
|
73
|
+
|
|
74
|
+
### Cyclomatic Complexity
|
|
75
|
+
|
|
76
|
+
_[CyclomaticComplexity](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/CyclomaticComplexity.ts)_ - The number of loops and decision rules, plus the number of decisions. Use a combination of 1) subflows and 2) breaking flows into multiple concise trigger‑ordered flows to reduce cyclomatic complexity within a single flow, ensuring maintainability and simplicity.
|
|
77
|
+
|
|
78
|
+
### DML Statement In A Loop
|
|
79
|
+
|
|
80
|
+
_[DMLStatementInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/DMLStatementInLoop.ts)_ - To prevent exceeding Apex governor limits, consolidate all your database operations—record creation, updates, or deletions—at the conclusion of the flow.
|
|
81
|
+
|
|
82
|
+
### Duplicate DML Operation
|
|
83
|
+
|
|
84
|
+
_[DuplicateDMLOperation](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/DuplicateDMLOperation.ts)_ - When a flow executes database changes or actions between two screens, prevent users from navigating backward between screens; otherwise, duplicate database operations may be performed.
|
|
85
|
+
|
|
86
|
+
### Flow Naming Convention
|
|
87
|
+
|
|
88
|
+
_[FlowName](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/FlowName.ts)_ - The readability of a flow is paramount. Establishing a naming convention significantly enhances findability, searchability, and overall consistency. Include at least a domain and a brief description of the flow’s actions, for example `Service_OrderFulfillment`.
|
|
89
|
+
|
|
90
|
+
### Get Record All Fields
|
|
91
|
+
|
|
92
|
+
_[GetRecordAllFields](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/GetRecordAllFields.ts)_ - Following the principle of least privilege (PoLP), avoid using **Get Records** with “Automatically store all fields” unless necessary.
|
|
93
|
+
|
|
94
|
+
### Hardcoded Id
|
|
95
|
+
|
|
96
|
+
_[HardcodedId](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedId.ts)_ - Avoid hard‑coding IDs because they are org specific. Instead, pass them into variables at the start of the flow—via merge‑field URL parameters or a **Get Records** element.
|
|
97
|
+
|
|
98
|
+
### Hardcoded Url
|
|
99
|
+
|
|
100
|
+
_[HardcodedUrl](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/HardcodedUrl.ts)_ - Avoid hard‑coding URLs because they are environment specific. Use an `$API` formula (preferred) or environment‑specific sources like custom labels, metadata, or settings.
|
|
101
|
+
|
|
102
|
+
### Inactive Flow
|
|
103
|
+
|
|
104
|
+
_[InactiveFlow](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/InactiveFlow.ts)_ - Like cleaning out your closet: deleting unused flows is essential. Inactive flows can still cause trouble—such as accidentally deleting records during testing, or being activated as subflows.
|
|
105
|
+
|
|
106
|
+
### Missing Fault Path
|
|
107
|
+
|
|
108
|
+
_[MissingFaultPath](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingFaultPath.ts)_ - A flow may fail to execute an operation as intended. By default, the flow displays an error to the user and emails the creator. Customize this behavior by incorporating a Fault Path.
|
|
109
|
+
|
|
110
|
+
### Missing Flow Description
|
|
111
|
+
|
|
112
|
+
_[FlowDescription](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/FlowDescription.ts)_ - Descriptions play a vital role in documentation. We highly recommend including details about where flows are used and their intended purpose.
|
|
113
|
+
|
|
114
|
+
### Missing Metadata Description
|
|
115
|
+
|
|
116
|
+
_[MissingMetadataDescription](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingMetadataDescription.ts)_ – Flags Flow elements (Get Records, Assignments, Decisions, Actions, etc.) and metadata components (Variables, Formulas, Constants, Text Templates) that lack a description. Adding concise descriptions greatly improves readability, maintainability, and helps AI tools understand your automation intent.
|
|
117
|
+
|
|
118
|
+
### Missing Null Handler
|
|
119
|
+
|
|
120
|
+
_[MissingNullHandler](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/MissingNullHandler.ts)_ - When a **Get Records** operation finds no data, it returns `null`. Validate data by using a Decision element to check for a non‑null result.
|
|
121
|
+
|
|
122
|
+
### Process Builder
|
|
123
|
+
|
|
124
|
+
_[ProcessBuilder](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/ProcessBuilder.ts)_ - Salesforce is transitioning away from Workflow Rules and Process Builder in favor of Flow. Begin migrating your organization’s automation to Flow.
|
|
125
|
+
|
|
126
|
+
### Recursive After Update
|
|
127
|
+
|
|
128
|
+
_[RecursiveAfterUpdate](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/RecursiveAfterUpdate.ts)_ - After‑update flows are meant for modifying **other** records. Using them on the same record can cause recursion. Consider **before‑save** flows for same‑record updates.
|
|
129
|
+
|
|
130
|
+
### Same Record Field Updates
|
|
131
|
+
|
|
132
|
+
_[SameRecordFieldUpdates](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/SameRecordFieldUpdates.ts)_ - Similar to triggers, **before‑save** contexts can update the same record via `$Record` without invoking DML.
|
|
133
|
+
|
|
134
|
+
### SOQL Query In A Loop
|
|
135
|
+
|
|
136
|
+
_[SOQLQueryInLoop](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/SOQLQueryInLoop.ts)_ - To prevent exceeding Apex governor limits, consolidate all SOQL queries at the end of the flow.
|
|
137
|
+
|
|
138
|
+
### Trigger Order
|
|
139
|
+
|
|
140
|
+
_[TriggerOrder](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/TriggerOrder.ts)_ - Guarantee your flow execution order with the **Trigger Order** property introduced in Spring ’22.
|
|
141
|
+
|
|
142
|
+
### Unconnected Element
|
|
143
|
+
|
|
144
|
+
_[UnconnectedElement](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnconnectedElement.ts)_ - Avoid unconnected elements that are not used by the flow to keep flows efficient and maintainable.
|
|
145
|
+
|
|
146
|
+
### Unsafe Running Context
|
|
147
|
+
|
|
148
|
+
_[UnsafeRunningContext](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnsafeRunningContext.ts)_ - This flow is configured to run in **System Mode without Sharing**, granting all users permission to view and edit all data. This can lead to unsafe data access.
|
|
149
|
+
|
|
150
|
+
### Unused Variable
|
|
151
|
+
|
|
152
|
+
_[UnusedVariable](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/core/src/main/rules/UnusedVariable.ts)_ - To maintain efficiency and manageability, avoid including variables that are never referenced.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Configuration
|
|
157
|
+
|
|
158
|
+
It is recommend to configure and define:
|
|
159
|
+
|
|
160
|
+
- The rules to be executed.
|
|
161
|
+
- The severity of violating any specific rule.
|
|
162
|
+
- Rule properties such as REGEX expressions.
|
|
163
|
+
- Any known exceptions that should be ignored during scanning.
|
|
164
|
+
|
|
165
|
+
```json
|
|
166
|
+
{
|
|
167
|
+
"rules": {
|
|
168
|
+
// Your rules here
|
|
169
|
+
},
|
|
170
|
+
"exceptions": {
|
|
171
|
+
// Your exceptions here
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Most Lightning Flow Scanner distributions automatically resolve configurations from `.flow-scanner.yml`, `.flow-scanner.json`, or `package.json` → `flowScanner`.
|
|
177
|
+
|
|
178
|
+
Using the rules section of your configurations, you can specify the list of rules to be run. Furthermore, you can define the severity and configure expressions of rules. Below is a breakdown of the available attributes of rule configuration:
|
|
179
|
+
|
|
180
|
+
```json
|
|
181
|
+
{
|
|
182
|
+
"rules": {
|
|
183
|
+
"<RuleName>": {
|
|
184
|
+
"severity": "<Severity>",
|
|
185
|
+
"expression": "<Expression>"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Defining Severity Levels
|
|
192
|
+
|
|
193
|
+
When the severity is not provided it will be `warning` by default. Other available values for severity are `error` and `note`. Define the severity per rule as shown below:
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"rules": {
|
|
198
|
+
"FlowDescription": {
|
|
199
|
+
"severity": "error"
|
|
200
|
+
},
|
|
201
|
+
"UnusedVariable": {
|
|
202
|
+
"severity": "note"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Configuring Expressions
|
|
209
|
+
|
|
210
|
+
Some rules have additional attributes to configure, such as the expression, that will overwrite default values. These can be configured in the same way as severity as shown in the following example.
|
|
211
|
+
|
|
212
|
+
```json
|
|
213
|
+
{
|
|
214
|
+
"rules": {
|
|
215
|
+
"APIVersion": {
|
|
216
|
+
"severity": "error",
|
|
217
|
+
"expression": "===58" // comparison operator
|
|
218
|
+
},
|
|
219
|
+
"FlowName": {
|
|
220
|
+
"severity": "note",
|
|
221
|
+
"expression": "[A-Za-z0-9]" // regular expression
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Specifying Exceptions
|
|
228
|
+
|
|
229
|
+
Specifying exceptions allows you to exclude specific scenarios from rule enforcement. Exceptions can be specified at the flow, rule, or result level to provide fine-grained control. Below is a breakdown of the available attributes of exception configuration:
|
|
230
|
+
|
|
231
|
+
```json
|
|
232
|
+
{
|
|
233
|
+
"exceptions": {
|
|
234
|
+
"<FlowName>": {
|
|
235
|
+
"<RuleName>": [
|
|
236
|
+
// Suppress a specific result:
|
|
237
|
+
"<ResultName>",
|
|
238
|
+
// Suppress ALL results of rule:
|
|
239
|
+
"*",
|
|
240
|
+
...
|
|
241
|
+
]
|
|
242
|
+
},
|
|
243
|
+
...
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
_Example_
|
|
249
|
+
|
|
250
|
+
```json
|
|
251
|
+
{
|
|
252
|
+
"exceptions": {
|
|
253
|
+
"MyFlow": {
|
|
254
|
+
"MissingNullHandler": ["*"],
|
|
255
|
+
"HardcodedId": ["Old_Lookup_1"]
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Include Beta Rules
|
|
262
|
+
|
|
263
|
+
New rules are introduced in Beta mode before being added to the default ruleset. To include current Beta rules, enable the optional betamode parameter in your configuration:
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"betaMode": true
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## Installation
|
|
273
|
+
|
|
274
|
+
### Distributions
|
|
275
|
+
|
|
276
|
+
| Distribution | Best for | Install / Use |
|
|
277
|
+
|----------------------------------------------------------------|-----------------------------------------------|---------------------------------------------------------------------------------------------------------|
|
|
278
|
+
| **[Salesforce CLI Plugin](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/cli/README.md)** | Local development, scratch orgs, CI/CD | `sf plugins install lightning-flow-scanner` |
|
|
279
|
+
| **[VS Code Extension](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/vsx/README.md)** | Real-time scanning inside VS Code | `code --install-extension ForceConfigControl.lightning-flow-scanner-vsx` |
|
|
280
|
+
| **[Salesforce App (Managed Package)](https://github.com/Flow-Scanner/lightning-flow-scanner-app)** | Run scans directly inside a Salesforce org | `sf package install --package 04tgK0000007M73QAE` |
|
|
281
|
+
| **[Core Library](https://github.com/Flow-Scanner/lightning-flow-scanner/tree/main/packages/core)** (Node.js + Browser) | Custom tools, scripts, extensions, web apps | `npm install -g @flow-scanner/lightning-flow-scanner-core` |
|
|
282
|
+
|
|
283
|
+
**Privacy:** Zero user data collected. All processing is client-side. → See our [Security Policy](https://github.com/Flow-Scanner/lightning-flow-scanner?tab=security-ov-file).
|
|
284
|
+
|
|
285
|
+
### CICD Templates
|
|
286
|
+
Ready-to-use CI/CD templates and a **native GitHub Action**.
|
|
287
|
+
|
|
288
|
+
| Platform | Template Type | Link |
|
|
289
|
+
|----------------|-----------------------------------|------|
|
|
290
|
+
| Azure DevOps | Full Project Scan | [`azure-pipelines-flow-FullScan.yml`](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/docs/examples/azure-devops/azure-pipelines-flow-FullScan.yml) |
|
|
291
|
+
| Azure DevOps | Change-Based Scan | [`azure-pipelines-flow-changedFiles.yml`](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/docs/examples/azure-devops/azure-pipelines-flow-changedFiles.yml) |
|
|
292
|
+
| **[GitHub Action](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/packages/action/README.md)** | Native PR checks | [GitHub Marketplace](https://github.com/marketplace/actions/run-flow-scanner) |
|
|
293
|
+
| **[Copado Plugin](https://github.com/Flow-Scanner/lightning-flow-scanner-copado)** | Copado CI/CD pipelines | [Copado Marketplace](https://success.copado.com/s/listing-detail?language=en_US&recordId=a54P7000003G3gBIAS) |
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
GitHub Action Snippet:
|
|
297
|
+
```yaml
|
|
298
|
+
- name: Lightning Flow Scan
|
|
299
|
+
id: flowscanner
|
|
300
|
+
uses: Flow-Scanner/lightning-flow-scanner@main
|
|
301
|
+
|
|
302
|
+
- name: Upload SARIF to Code Scanning
|
|
303
|
+
uses: github/codeql-action/upload-sarif@v3
|
|
304
|
+
with:
|
|
305
|
+
sarif_file: ${{ steps.flowscanner.outputs.sarifPath }}
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
To see the full example, see [`scan-flows.yml`](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/docs/examples/github-action/scan-flows.yml).
|
|
309
|
+
|
|
310
|
+
## Quick Start
|
|
311
|
+
|
|
312
|
+
### Salesforce CLI Plugin
|
|
313
|
+
|
|
314
|
+
Use `lightning-flow-scanner` in the Salesforce CLI:
|
|
315
|
+
|
|
316
|
+
```bash
|
|
317
|
+
sf flow:scan
|
|
318
|
+
sf flow:fix -d src/force-app
|
|
319
|
+
sf flow:scan --sarif > report.sarif
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### VS Code Extension
|
|
323
|
+
Use our side bar or the **Command Palette** and type `flowscanner` to see all available commands:
|
|
324
|
+
|
|
325
|
+
* `Configure Flow Scanner` - Set up rules in `.flow-scanner.yml`
|
|
326
|
+
* `Scan Flows` - Analyze a directory or selected flow files
|
|
327
|
+
* `Fix Flows` - Automatically apply available fixes
|
|
328
|
+
* `Flow Scanner Documentation` - Open the rules reference guide
|
|
329
|
+
|
|
330
|
+
### Core Module
|
|
331
|
+
Use `lightning-flow-scanner-core` as a Node.js/browser dependency:
|
|
332
|
+
|
|
333
|
+
```js
|
|
334
|
+
// Basic
|
|
335
|
+
import { parse, scan } from "@flow-scanner/lightning-flow-scanner-core";
|
|
336
|
+
parse("flows/*.xml").then(scan);
|
|
337
|
+
|
|
338
|
+
// Get SARIF output
|
|
339
|
+
import { parse, scan, exportSarif } from "@flow-scanner/lightning-flow-scanner-core";
|
|
340
|
+
parse("flows/*.xml").then(scan).then(exportSarif);
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
## Development
|
|
344
|
+
|
|
345
|
+
> This project optionally uses [Volta](https://volta.sh) to guarantee the exact same Node.js and tool versions for every contributor. Install Volta with:
|
|
346
|
+
>
|
|
347
|
+
> MacOs/Linux:
|
|
348
|
+
> ```sh
|
|
349
|
+
> curl https://get.volta.sh | bash
|
|
350
|
+
> ```
|
|
351
|
+
> Windows:
|
|
352
|
+
> ```sh
|
|
353
|
+
> winget install Volta.Volta
|
|
354
|
+
> ```
|
|
355
|
+
> Volta will automatically install and lock the tool versions defined in `package.json`.
|
|
356
|
+
|
|
357
|
+
1. Clone the repository
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
git clone https://github.com/Flow-Scanner/lightning-flow-scanner.git
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
2. Install dependencies:
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
pnpm install
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
3. Compile:
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
pnpm run build
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
To compile just the core package::
|
|
376
|
+
```bash
|
|
377
|
+
pnpm build:core
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
4. Run tests:
|
|
381
|
+
|
|
382
|
+
```bash
|
|
383
|
+
pnpm test
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
Or to test a new version of the core:
|
|
387
|
+
```bash
|
|
388
|
+
pnpm test:core
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
5. Linking the core module locally(Optional):
|
|
392
|
+
|
|
393
|
+
To link the module, run:
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
pnpm link --global @flow-scanner/lightning-flow-scanner-core
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
You can now do Ad-Hoc Testing with node:
|
|
400
|
+
|
|
401
|
+
```bash
|
|
402
|
+
node -i -e "import('@flow-scanner/lightning-flow-scanner-core').then(m => { Object.assign(global, m.default ? m.default : m); console.log('✅ Core loaded! Try: await parse(...), scan(...), etc.'); })"
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
Or test in a dependent project:
|
|
406
|
+
|
|
407
|
+
```bash
|
|
408
|
+
npm link @flow-scanner/lightning-flow-scanner-core
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
6. Deploy Demo Flows (Optional):
|
|
412
|
+
|
|
413
|
+
```bash
|
|
414
|
+
cd assets/example-flows && sf project deploy start
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
Navigate to the [Demo Readme](https://github.com/Flow-Scanner/lightning-flow-scanner/blob/main/assets/example-flows\README.md) for full details
|
|
418
|
+
|
|
419
|
+
7. Create a standalone UMD Module(Optional):
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
pnpm dist
|
|
423
|
+
```
|
|
424
|
+
This creates UMD at `dist/lightning-flow-scanner-core.umd.js`.
|
|
425
|
+
|
|
426
|
+
<p><strong>Want to help improve Lightning Flow Scanner? See our <a href="https://github.com/Flow-Scanner/lightning-flow-scanner?tab=contributing-ov-file">Contributing Guidelines</a></strong></p>
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Security Policy for Lightning Flow Scanner
|
|
2
|
+
|
|
3
|
+
## Security Practices
|
|
4
|
+
|
|
5
|
+
- Code is open-source and peer-reviewed by the community.
|
|
6
|
+
- Vulnerabilities can be reported privately via [GitHub vulnerability reporting](https://github.com/Flow-Scanner/lightning-flow-scanner/security).
|
|
7
|
+
- All changes are scanned with [Snyk](https://github.com/snyk/cli) prior to publication.
|
|
8
|
+
- Releases are published to npm using **GitHub Actions Trusted Publishing (OIDC)**.
|
|
9
|
+
- Tags (`v*`) trigger automated `npm publish`, providing a full audit trail.
|
|
10
|
+
|
|
11
|
+
## Data Handling
|
|
12
|
+
|
|
13
|
+
This tool collects zero user data. No credentials, PII, payment info, health data, or user content is ever stored, transmitted, or shared. All analysis runs 100% client-side with no network calls to external services.
|
|
14
|
+
|
|
15
|
+
We temporarily use metadata (e.g., Flow metadata, timestamps) in-memory only for real-time functionality during your session. This data is never stored, logged, or transmitted and is discarded immediately when the session ends.
|
|
16
|
+
|
|
17
|
+
## Dependencies
|
|
18
|
+
|
|
19
|
+
We actively track and maintain an up-to-date inventory of all third-party dependencies to ensure security and compatibility. Our dependencies include:
|
|
20
|
+
|
|
21
|
+
### Core
|
|
22
|
+
|
|
23
|
+
| Package | License | Purpose |
|
|
24
|
+
| ----------------- | --------------------------------------------------------------------------------- | ---------------------------------------------- |
|
|
25
|
+
| `fast-xml-parser` | [MIT](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/LICENSE) | Validate XML, Parse XML and Build XML rapidly. |
|
|
26
|
+
|
|
27
|
+
### CLI
|
|
28
|
+
|
|
29
|
+
| Package | License | Purpose |
|
|
30
|
+
| ----------------------------------- | ------- | ------- |
|
|
31
|
+
| `@oclif/core` | [MIT](https://github.com/oclif/oclif/blob/main/LICENSE) | CLI framework core utilities |
|
|
32
|
+
| `@salesforce/core` | [BSD-3-Clause](https://github.com/salesforce/core/blob/main/LICENSE) | Salesforce core library for CLI plugins |
|
|
33
|
+
| `@salesforce/sf-plugins-core` | [BSD-3-Clause](https://github.com/salesforce/sf-plugins-core/blob/main/LICENSE) | Base library for Salesforce CLI plugins |
|
|
34
|
+
| `chalk` | [MIT](https://github.com/chalk/chalk/blob/main/license) | Terminal string styling (colors) |
|
|
35
|
+
| `cosmiconfig` | [MIT](https://github.com/davidtheclark/cosmiconfig/blob/main/LICENSE) | Config file loader for JavaScript/Node |
|
|
36
|
+
| `glob` | [MIT](https://github.com/isaacs/node-glob/blob/master/LICENSE) | File pattern matching |
|
|
37
|
+
|
|
38
|
+
### Action
|
|
39
|
+
|
|
40
|
+
| Package | License | Purpose |
|
|
41
|
+
| ------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------- |
|
|
42
|
+
| `@actions/core` | [MIT](https://github.com/actions/toolkit/blob/main/packages/core/LICENSE) | Toolkit for developing GitHub Actions |
|
|
43
|
+
| `@actions/github` | [MIT](https://github.com/actions/toolkit/blob/main/packages/github/LICENSE) | Interact with the GitHub API in Actions |
|
|
44
|
+
| `cosmiconfig` | [MIT](https://github.com/davidtheclark/cosmiconfig/blob/main/LICENSE) | Config file loader for JavaScript/Node |
|
|
45
|
+
|
|
46
|
+
### VSX
|
|
47
|
+
|
|
48
|
+
| Package | License | Purpose` |
|
|
49
|
+
| ------------------------------- | ------------------------------------------------------------------------------------ | ---------------------------------------------- |
|
|
50
|
+
| `convert-array-to-csv` | [MIT](https://github.com/zemirco/convert-array-to-csv/blob/master/LICENSE) | Converts JavaScript arrays into CSV format |
|
|
51
|
+
| `tabulator-tables` | [MIT](https://github.com/olifolkerd/tabulator/blob/master/LICENSE) | Interactive tables and data grids for web apps |
|
|
52
|
+
| `uuid` | [MIT](https://github.com/uuidjs/uuid/blob/main/LICENSE.md) | Generates RFC-compliant UUIDs |
|
|
53
|
+
| `cosmiconfig` | [MIT](https://github.com/davidtheclark/cosmiconfig/blob/main/LICENSE) | Config file loader for JavaScript/Node |
|
|
54
|
+
| `glob` | [MIT](https://github.com/isaacs/node-glob/blob/master/LICENSE) | File pattern matching |
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
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.6.
|
|
5
|
-
"main": "
|
|
4
|
+
"version": "6.6.5",
|
|
5
|
+
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"default": "./out/index.js"
|
|
8
|
+
"import": "./index.js",
|
|
9
|
+
"require": "./index.js",
|
|
10
|
+
"types": "./index.d.ts"
|
|
12
11
|
}
|
|
13
12
|
},
|
|
14
13
|
"engines": {
|
|
@@ -23,33 +22,6 @@
|
|
|
23
22
|
"dependencies": {
|
|
24
23
|
"fast-xml-parser": "^5.3.0"
|
|
25
24
|
},
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"@jest/types": "30.0.1",
|
|
28
|
-
"@swc-node/jest": "1.9.1",
|
|
29
|
-
"@swc/cli": "0.7.7",
|
|
30
|
-
"@swc/core": "1.13.5",
|
|
31
|
-
"@swc/helpers": "0.5.17",
|
|
32
|
-
"@types/jest": "29.5.14",
|
|
33
|
-
"@types/node": "22.15.30",
|
|
34
|
-
"@types/semantic-release": "20.0.6",
|
|
35
|
-
"cross-env": "^10.1.0",
|
|
36
|
-
"eslint": "9.30.0",
|
|
37
|
-
"eslint-plugin-de-morgan": "1.3.0",
|
|
38
|
-
"eslint-plugin-github": "6.0.0",
|
|
39
|
-
"eslint-plugin-jest": "29.0.1",
|
|
40
|
-
"eslint-plugin-perfectionist": "4.15.0",
|
|
41
|
-
"eslint-plugin-sonarjs": "3.0.4",
|
|
42
|
-
"husky": "9.1.7",
|
|
43
|
-
"jest": "30.0.3",
|
|
44
|
-
"lint-staged": "^16.1.2",
|
|
45
|
-
"prettier": "3.6.2",
|
|
46
|
-
"rimraf": "^6.1.0",
|
|
47
|
-
"ts-node": "10.9.2",
|
|
48
|
-
"typescript": "5.8.3",
|
|
49
|
-
"typescript-eslint": "8.35.0",
|
|
50
|
-
"vite": "6.4.1",
|
|
51
|
-
"vite-plugin-node-polyfills": "0.23.0"
|
|
52
|
-
},
|
|
53
25
|
"homepage": "https://dev.lightningflowscanner.org",
|
|
54
26
|
"author": {
|
|
55
27
|
"name": "Ruben Halman",
|
|
@@ -67,27 +39,5 @@
|
|
|
67
39
|
"security-scanner",
|
|
68
40
|
"static-analysis"
|
|
69
41
|
],
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
"build:js": "swc src --out-dir out --copy-files --strip-leading-paths --config-file .swcrc",
|
|
73
|
-
"build:types": "tsc -p tsconfig.types.json --declaration --emitDeclarationOnly --outDir out",
|
|
74
|
-
"copy:media": "node -e \"require('fs').cpSync('assets/media','out/assets/media',{recursive:true,force:true}) || require('fs').mkdirSync('out/assets/media',{recursive:true})\"",
|
|
75
|
-
"prepare:publish": "node ../../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 && npm run copy:media",
|
|
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": "npm version patch",
|
|
88
|
-
"version:minor": "npm version minor",
|
|
89
|
-
"version:major": "npm version major",
|
|
90
|
-
"publish:npm": "npm run build && npm run prepare:publish && cd out && npm publish",
|
|
91
|
-
"publish:tag": "node ../../scripts/publish-tag.js ."
|
|
92
|
-
}
|
|
93
|
-
}
|
|
42
|
+
"types": "index.d.ts"
|
|
43
|
+
}
|
package/.husky/pre-commit
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
npm run precommit
|
package/.husky/pre-push
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
npm run prepush
|
package/.prettierignore
DELETED
package/.swcrc
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://swc.rs/schema.json",
|
|
3
|
-
"sourceMaps": false,
|
|
4
|
-
"module": {
|
|
5
|
-
"type": "commonjs",
|
|
6
|
-
"strictMode": true,
|
|
7
|
-
"noInterop": false,
|
|
8
|
-
"resolveFully": true
|
|
9
|
-
},
|
|
10
|
-
"jsc": {
|
|
11
|
-
"externalHelpers": false,
|
|
12
|
-
"target": "es2015",
|
|
13
|
-
"parser": {
|
|
14
|
-
"syntax": "typescript",
|
|
15
|
-
"tsx": true,
|
|
16
|
-
"decorators": true,
|
|
17
|
-
"dynamicImport": true
|
|
18
|
-
},
|
|
19
|
-
"transform": {
|
|
20
|
-
"legacyDecorator": true,
|
|
21
|
-
"decoratorMetadata": false
|
|
22
|
-
},
|
|
23
|
-
"keepClassNames": true
|
|
24
|
-
},
|
|
25
|
-
"minify": false // Disable for now; re-enable post-debug if needed for smaller JS
|
|
26
|
-
}
|