@flow-scanner/lightning-flow-scanner-core 6.1.0 → 6.1.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.
Files changed (2) hide show
  1. package/README.md +22 -15
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  </a>
5
5
  </p>
6
6
 
7
- <p align="center"><i>UMD-compatible Flow metadata engine for Node.js & browsers—20+ rules to catch common issues.</i></p>
7
+ <p align="center"><i>UMD-compatible Flow metadata engine for Node.js & browsers—20+ rules to catch issues.</i></p>
8
8
 
9
9
  ---
10
10
 
@@ -143,7 +143,7 @@ It is recommended to set up configuration and define:
143
143
  }
144
144
  ```
145
145
 
146
- 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. To include rules currently that are currently in beta, set `betarules` to true. Below is a breakdown of the available attributes of rule configuration:
146
+ 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:
147
147
 
148
148
  ```json
149
149
  {
@@ -182,11 +182,11 @@ Some rules have additional attributes to configure, such as the expression, that
182
182
  "rules": {
183
183
  "APIVersion": {
184
184
  "severity": "error",
185
- "expression": "===58"
185
+ "expression": "===58" // comparison operator
186
186
  },
187
187
  "FlowName": {
188
188
  "severity": "note",
189
- "expression": "[A-Za-z0-9]"
189
+ "expression": "[A-Za-z0-9]" // regular expression
190
190
  }
191
191
  }
192
192
  }
@@ -231,7 +231,7 @@ New rules are introduced in Beta mode before being added to the default ruleset.
231
231
 
232
232
  ## Usage
233
233
 
234
- The Lightning Flow Scanner Core can be used as a dependency in Node.js and browser environments, or used as a standalone UMD module.
234
+ `lightning-flow-scanner-core` can be used as a dependency in Node.js and browser environments, or as a standalone UMD module.
235
235
 
236
236
  ### Examples
237
237
 
@@ -240,16 +240,23 @@ The Lightning Flow Scanner Core can be used as a dependency in Node.js and brows
240
240
  import { parse, scan } from "@flow-scanner/lightning-flow-scanner-core";
241
241
  parse("flows/*.xml").then(scan);
242
242
 
243
- // Apply fixes automatically
243
+ // Apply available patches
244
244
  import { parse, scan, fix } from "@flow-scanner/lightning-flow-scanner-core";
245
245
  parse("flows/*.xml").then(scan).then(fix);
246
246
 
247
247
  // Get SARIF output
248
248
  import { parse, scan, exportSarif } from "@flow-scanner/lightning-flow-scanner-core";
249
- parse("flows/*.xml")
250
- .then(scan)
251
- .then(exportSarif)
252
- .then((sarif) => save("results.sarif", sarif));
249
+ parse("flows/*.xml").then(scan).then(exportSarif); //.then((sarif) => save("results.sarif", sarif));
250
+
251
+ // Browser Usage (Tooling API)
252
+ const { Flow, scan } = window.lightningflowscanner;
253
+ const metadataRes = await conn.tooling.query(`SELECT Id, FullName, Metadata FROM Flow`);
254
+ const results = scan(
255
+ metadataRes.records.map((r) => ({
256
+ uri: `/services/data/v60.0/tooling/sobjects/Flow/${r.Id}`,
257
+ flow: new Flow(r.FullName, r.Metadata),
258
+ })) //, optionsForScan
259
+ );
253
260
  ```
254
261
 
255
262
  ### Functions
@@ -325,26 +332,26 @@ npm install @flow-scanner/lightning-flow-scanner-core
325
332
  ```
326
333
 
327
334
  5. Test as local dependency(Optional):
328
- To test changes to the core module in the VS Code extension or SF CLI plugin locally, run:
335
+ To test changes to the core module locally, run:
329
336
 
330
337
  ```bash
331
338
  npm run link
332
339
  ```
333
340
 
334
- b) Go to the dependent project (VSX or SF CLI) and use:
341
+ b) Go to the dependent project (e.g. VSX or CLI) and use:
335
342
 
336
343
  ```bash
337
344
  npm link @flow-scanner/lightning-flow-scanner-core
338
345
  ```
339
346
 
340
- Your local core module will now replace the installed dependency and update automatically on rebuild.
347
+ Your local module will now replace any installed version and update on rebuild.
341
348
 
342
349
  6. Create a standalone UMD Module(Optional):
343
350
 
344
351
  ```bash
345
- npm run vite:dist
352
+ npm run vite:dist
346
353
  ```
347
354
 
348
- The resulting file will be available in the `dist` directory as `lightning-flow-scanner-core.umd.js`.
355
+ The UMD module will be created at`dist/lightning-flow-scanner-core.umd.js`.
349
356
 
350
357
  ###### Want to help improve Lightning Flow Scanner? See our [Contributing Guidelines](https://github.com/Flow-Scanner/lightning-flow-scanner-core/blob/main/CONTRIBUTING.md).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@flow-scanner/lightning-flow-scanner-core",
3
3
  "description": "A lightweight, purpose-built engine for parsing and analyzing Salesforce Flow metadata in Node.js or browser environments. Scan, validate, and optimize Flow automations for security risks, best practices, governor limits, and performance bottlenecks.",
4
- "version": "6.1.0",
4
+ "version": "6.1.2",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "engines": {