Skip to content

Commit 9f0ff89

Browse files
committed
update core to v5.9.0
1 parent 9378988 commit 9f0ff89

File tree

5 files changed

+37
-10
lines changed

5 files changed

+37
-10
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<p align="center">
22
<a href="https://github.com/Flow-Scanner">
3-
<img src="https://raw.githubusercontent.com/Flow-Scanner/lightning-flow-scanner-core/main/media/bannerslim.png" style="width: 55%;" />
3+
<img src="https://raw.githubusercontent.com/Flow-Scanner/lightning-flow-scanner-core/main/media/bannerslim.png" style="width: 41%;" />
44
</a>
55
</p>
66
<p align="center">Scans for unsafe contexts, hardcoded IDs, and other issues to optimize your Flows.</p>
77

88
![Demo GIF](media/lfsaction.gif)
99

10-
_Additional information on the default rules can be found in the [Documentation](https://flow-scanner.github.io/lightning-flow-scanner-core/)._
10+
_[![GitHub Marketplace](https://img.shields.io/badge/GitHub%20Action-Lightning%20Flow%20Scanner-blue?logo=github)](https://github.com/marketplace/actions/run-flow-scanner) - For more information on the default rules and configurations available, please review the [Flow Scanner Documentation](https://flow-scanner.github.io/lightning-flow-scanner-core/)._
1111

1212
## Usage
1313

@@ -84,4 +84,4 @@ To debug the action locally you need to ensure you have `npm` and `act` installe
8484
2. Run act: Use the act command to run the workflow:
8585
`act workflow_dispatch --secret-file .secrets`
8686
87-
Want to help improve this project? See the [Contributing Guidelines](https://github.com/Flow-Scanner/lightning-flow-scanner-core/blob/main/CONTRIBUTING.md) to get started.
87+
If you'd like to help us enhance Flow Scanner, please consider having a look at the [Contributing Guidelines](https://github.com/Flow-Scanner/lightning-flow-scanner-core/blob/main/CONTRIBUTING.md).

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ runs:
1414
using: node16
1515
main: "dist/index.js"
1616
branding:
17-
icon: 'cloud-lightning'
18-
color: 'blue'
17+
icon: "shield"
18+
color: "blue"
1919
author: Ruben Halman

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67245,7 +67245,7 @@ Object.defineProperty(exports, "__esModule", ({value:true}));Object.defineProper
6724567245
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
6724667246

6724767247
"use strict";
67248-
Object.defineProperty(exports, "__esModule", ({value:true}));Object.defineProperty(exports, "MissingFaultPath", ({enumerable:true,get:function(){return MissingFaultPath}}));const _internals=/*#__PURE__*/_interop_require_wildcard(__nccwpck_require__(9684));const _AdvancedRule=__nccwpck_require__(104);function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interop_require_wildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={__proto__:null};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}let MissingFaultPath=class MissingFaultPath extends _AdvancedRule.AdvancedRule{execute(flow){var _flow_elements;const compiler=new _internals.Compiler;const results=[];const elementsWhereFaultPathIsApplicable=((_flow_elements=flow.elements)===null||_flow_elements===void 0?void 0:_flow_elements.filter(node=>{const proxyNode=node;const validSubtype=this.applicableElements.includes(proxyNode.subtype);return validSubtype})).map(e=>e.name);const isRecordBeforeSave=flow.start.triggerType==="RecordBeforeSave";const visitCallback=element=>{var _element_connectors;if(!(element===null||element===void 0?void 0:(_element_connectors=element.connectors)===null||_element_connectors===void 0?void 0:_element_connectors.find(connector=>connector.type==="faultConnector"))&&elementsWhereFaultPathIsApplicable.includes(element.name)){if(isRecordBeforeSave&&element.subtype==="recordUpdates"){return}if(!this.isPartOfFaultHandlingFlow(element,flow)){results.push(new _internals.ResultDetails(element))}}};compiler.traverseFlow(flow,flow.startReference,visitCallback);return new _internals.RuleResult(this,results)}suppress(scanResult,ruleConfiguration){const suppressedResults=[];const suppressionElementKey=this.suppressionElement;for(const resultDetails of scanResult.details){var _ruleConfiguration_suppressions;if("violation"in resultDetails&&"element"in resultDetails.violation&&typeof resultDetails.violation.element==="object"&&!Array.isArray(resultDetails.violation.element)&&suppressionElementKey in resultDetails.violation.element&&(ruleConfiguration===null||ruleConfiguration===void 0?void 0:(_ruleConfiguration_suppressions=ruleConfiguration.suppressions)===null||_ruleConfiguration_suppressions===void 0?void 0:_ruleConfiguration_suppressions.includes(resultDetails.violation.element[suppressionElementKey]))){continue}suppressedResults.push(resultDetails)}return new _internals.RuleResult(this,suppressedResults)}isPartOfFaultHandlingFlow(element,flow){var _flow_elements;const flowelements=(_flow_elements=flow.elements)===null||_flow_elements===void 0?void 0:_flow_elements.filter(el=>el instanceof _internals.FlowNode);for(const otherElement of flowelements){if(otherElement!==element){var _otherElement_connectors;if((_otherElement_connectors=otherElement.connectors)===null||_otherElement_connectors===void 0?void 0:_otherElement_connectors.find(connector=>connector.type==="faultConnector"&&connector.reference===element.name)){return true}}}return false}constructor(){super({autoFixable:false,description:"At times, a flow may fail to execute a configured operation as intended. By default, the flow displays an error message to the user and notifies the admin who created the flow via email. However, you can customize this behavior by incorporating a Fault Path.",docRefs:[{label:"Flow Best Practices",path:"https://help.salesforce.com/s/articleView?id=sf.flow_prep_bestpractices.htm&type=5"}],isConfigurable:false,label:"Missing Fault Path",name:"MissingFaultPath",supportedTypes:[..._internals.FlowType.backEndTypes,..._internals.FlowType.visualTypes],suppressionElement:"actionName"}),_define_property(this,"applicableElements",["recordLookups","recordDeletes","recordUpdates","recordCreates","waits","actionCalls"])}};
67248+
Object.defineProperty(exports, "__esModule", ({value:true}));Object.defineProperty(exports, "MissingFaultPath", ({enumerable:true,get:function(){return MissingFaultPath}}));const _internals=/*#__PURE__*/_interop_require_wildcard(__nccwpck_require__(9684));const _AdvancedRule=__nccwpck_require__(104);function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interop_require_wildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={__proto__:null};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}let MissingFaultPath=class MissingFaultPath extends _AdvancedRule.AdvancedRule{isValidSubtype(proxyNode){if(!this.applicableElements.includes(proxyNode.subtype)){return false}if(proxyNode.subtype==="waits"){var _proxyNode_element;const elementSubtype=(_proxyNode_element=proxyNode.element)===null||_proxyNode_element===void 0?void 0:_proxyNode_element["elementSubtype"];const excludedSubtypes=["WaitDuration","WaitDate"];return!excludedSubtypes.includes(elementSubtype)}return true}execute(flow){var _flow_elements;const compiler=new _internals.Compiler;const results=[];const elementsWhereFaultPathIsApplicable=((_flow_elements=flow.elements)===null||_flow_elements===void 0?void 0:_flow_elements.filter(node=>{const proxyNode=node;return this.isValidSubtype(proxyNode)})).map(e=>e.name);const isRecordBeforeSave=flow.start.triggerType==="RecordBeforeSave";const visitCallback=element=>{var _element_connectors;if(!(element===null||element===void 0?void 0:(_element_connectors=element.connectors)===null||_element_connectors===void 0?void 0:_element_connectors.find(connector=>connector.type==="faultConnector"))&&elementsWhereFaultPathIsApplicable.includes(element.name)){if(isRecordBeforeSave&&element.subtype==="recordUpdates"){return}if(!this.isPartOfFaultHandlingFlow(element,flow)){results.push(new _internals.ResultDetails(element))}}};compiler.traverseFlow(flow,flow.startReference,visitCallback);return new _internals.RuleResult(this,results)}suppress(scanResult,ruleConfiguration){const suppressedResults=[];const suppressionElementKey=this.suppressionElement;for(const resultDetails of scanResult.details){var _ruleConfiguration_suppressions;if("violation"in resultDetails&&"element"in resultDetails.violation&&typeof resultDetails.violation.element==="object"&&!Array.isArray(resultDetails.violation.element)&&suppressionElementKey in resultDetails.violation.element&&(ruleConfiguration===null||ruleConfiguration===void 0?void 0:(_ruleConfiguration_suppressions=ruleConfiguration.suppressions)===null||_ruleConfiguration_suppressions===void 0?void 0:_ruleConfiguration_suppressions.includes(resultDetails.violation.element[suppressionElementKey]))){continue}suppressedResults.push(resultDetails)}return new _internals.RuleResult(this,suppressedResults)}isPartOfFaultHandlingFlow(element,flow){var _flow_elements;const flowelements=(_flow_elements=flow.elements)===null||_flow_elements===void 0?void 0:_flow_elements.filter(el=>el instanceof _internals.FlowNode);for(const otherElement of flowelements){if(otherElement!==element){var _otherElement_connectors;if((_otherElement_connectors=otherElement.connectors)===null||_otherElement_connectors===void 0?void 0:_otherElement_connectors.find(connector=>connector.type==="faultConnector"&&connector.reference===element.name)){return true}}}return false}constructor(){super({autoFixable:false,description:"At times, a flow may fail to execute a configured operation as intended. By default, the flow displays an error message to the user and notifies the admin who created the flow via email. However, you can customize this behavior by incorporating a Fault Path.",docRefs:[{label:"Flow Best Practices",path:"https://help.salesforce.com/s/articleView?id=sf.flow_prep_bestpractices.htm&type=5"}],isConfigurable:false,label:"Missing Fault Path",name:"MissingFaultPath",supportedTypes:[..._internals.FlowType.backEndTypes,..._internals.FlowType.visualTypes],suppressionElement:"actionName"}),_define_property(this,"applicableElements",["recordLookups","recordDeletes","recordUpdates","recordCreates","waits","actionCalls"])}};
6724967249

6725067250
/***/ }),
6725167251

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,45 @@
11
{
2-
"name": "lightning-flow-scanner-ga",
2+
"name": "lightning-flow-scanner-action",
33
"version": "1.3.0",
44
"description": "A GitHub Action for automated static analysis and optimization of Flows in Pull Requests. Scans metadata for 20+ issues such as hardcoded IDs, unsafe contexts, inefficient SOQL/DML operations, recursion risks, and missing fault handling. ",
55
"main": "dist/index.js",
66
"scripts": {
77
"build": "ncc build src/action.js -o dist --source-map",
88
"test": "echo \"Error: no test specified\" && exit 1"
99
},
10-
"keywords": [],
1110
"license": "MIT",
1211
"dependencies": {
1312
"@actions/core": "^1.10.1",
1413
"@actions/github": "^6.0.0",
1514
"@vercel/ncc": "^0.38.1",
16-
"lightning-flow-scanner-core": "^5.8.0"
15+
"lightning-flow-scanner-core": "^5.9.0"
16+
},
17+
"keywords": [
18+
"salesforce",
19+
"flow",
20+
"salesforce-flow",
21+
"salesforce-flows",
22+
"salesforce-automation",
23+
"static-analysis",
24+
"sf",
25+
"flow-scanner",
26+
"salesforce-quality",
27+
"salesforce-security",
28+
"salesforce-devops",
29+
"salesforce-linting",
30+
"salesforce-admin",
31+
"salesforce-developer"
32+
],
33+
"repository": {
34+
"type": "git",
35+
"url": "git+https://github.com/Flow-Scanner/lightning-flow-scanner-action.git"
36+
},
37+
"bugs": {
38+
"url": "https://github.com/Flow-Scanner/lightning-flow-scanner-action/issues"
39+
},
40+
"homepage": "https://flow-scanner.github.io/lightning-flow-scanner-action",
41+
"author": {
42+
"name": "Ruben Halman",
43+
"url": "https://github.com/RubenHalman"
1744
}
1845
}

0 commit comments

Comments
 (0)