{"_id":"@flow-scanner/regex-scanner","_rev":"3-c948d0b60f3476e13cd80b990d1aafa8","name":"@flow-scanner/regex-scanner","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@flow-scanner/regex-scanner","version":"1.0.0","keywords":["regex","scanner","salesforce","metadata","linter","static-analysis"],"author":{"url":"https://github.com/RubenHalman","name":"Ruben Halman"},"license":"MIT","_id":"@flow-scanner/regex-scanner@1.0.0","maintainers":[{"name":"flow_scanner","email":"npm@lightningflowscanner.org"},{"name":"rhalman","email":"halmanrf@gmail.com"}],"homepage":"https://github.com/Flow-Scanner/lightning-flow-scanner#readme","bugs":{"url":"https://github.com/Flow-Scanner/lightning-flow-scanner/issues"},"dist":{"shasum":"8499375269a4c8a1f715ade34c61884062aa975b","tarball":"https://registry.npmjs.org/@flow-scanner/regex-scanner/-/regex-scanner-1.0.0.tgz","fileCount":23,"integrity":"sha512-e92/Lerg2rdJEIpBTNkv4ZUSi7mUyHLvf2Bv/QtE98fnzQUf+yXfme7AZ5OtunHhOWoYOnhYYQ2l+SdO85GhOw==","signatures":[{"sig":"MEUCIFbtPwtzyIIzidLM1sibxDJoGnzWefJyjdYrP3Rj2+kdAiEAtJzsDRmehUVNe6QXEzdwszUm92TTblaOD8n6hxvVQ4Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47202},"main":"index.js","types":"index.d.ts","engines":{"node":"^18 || ^20 || ^22 || ^23"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.js"}},"gitHead":"c5f8806b0c2278f87034433b8d96c03326dde344","_npmUser":{"name":"rhalman","email":"halmanrf@gmail.com"},"repository":{"url":"git+https://github.com/Flow-Scanner/lightning-flow-scanner.git","type":"git","directory":"packages/regex-scanner"},"_npmVersion":"10.8.2","description":"Generic regex-based scanning engine.","directories":{},"_nodeVersion":"20.19.6","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/regex-scanner_1.0.0_1768400119620_0.5017887940736419","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@flow-scanner/regex-scanner","version":"1.1.0","keywords":["regex","scanner","salesforce","metadata","linter","static-analysis"],"author":{"url":"https://github.com/RubenHalman","name":"Ruben Halman"},"license":"MIT","_id":"@flow-scanner/regex-scanner@1.1.0","maintainers":[{"name":"flow_scanner","email":"npm@lightningflowscanner.org"},{"name":"rhalman","email":"halmanrf@gmail.com"}],"homepage":"https://github.com/Flow-Scanner/lightning-flow-scanner#readme","bugs":{"url":"https://github.com/Flow-Scanner/lightning-flow-scanner/issues"},"dist":{"shasum":"28cc83f48115500db66be3b92059bc5a2c823e89","tarball":"https://registry.npmjs.org/@flow-scanner/regex-scanner/-/regex-scanner-1.1.0.tgz","fileCount":25,"integrity":"sha512-EXJR3w3eTh1VFVt16Onvv7l9Ab2r52fGQleiU2SzhxP1LUjamEZm/FaQcwX7jtWOaZAruEZAtPzJpXgzUrXhHg==","signatures":[{"sig":"MEYCIQC0fCF9B8uj5SYUdiM93xx3UYyz2uxV9m+DUqciVOjiMAIhANP7rScWkjrNERz9lrV3KOg6JCR98n0KWasXQmotqZW8","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49372},"main":"index.js","types":"index.d.ts","engines":{"node":"^18 || ^20 || ^22 || ^23"},"exports":{".":{"types":"./index.d.ts","import":"./index.js","require":"./index.js"}},"gitHead":"0cbba07fa62c7e5ffa86336e587ec0602f360b26","_npmUser":{"name":"rhalman","email":"halmanrf@gmail.com"},"repository":{"url":"git+https://github.com/Flow-Scanner/lightning-flow-scanner.git","type":"git","directory":"packages/regex-scanner"},"_npmVersion":"10.8.2","description":"Generic regex-based scanning engine.","directories":{},"_nodeVersion":"20.19.6","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/regex-scanner_1.1.0_1770048354770_0.635056664063508","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@flow-scanner/regex-scanner","description":"Generic regex-based scanning engine.","version":"1.1.1","main":"index.js","exports":{".":{"import":"./index.js","require":"./index.js","types":"./index.d.ts"}},"engines":{"node":"^18 || ^20 || ^22 || ^23 || ^24"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Flow-Scanner/lightning-flow-scanner.git","directory":"packages/regex-scanner"},"author":{"name":"Ruben Halman","url":"https://github.com/RubenHalman"},"keywords":["regex","scanner","salesforce","metadata","linter","static-analysis"],"types":"index.d.ts","_id":"@flow-scanner/regex-scanner@1.1.1","gitHead":"dfdc9c5b2dbdfeb10a166da948c122a1c1b0bbfd","bugs":{"url":"https://github.com/Flow-Scanner/lightning-flow-scanner/issues"},"homepage":"https://github.com/Flow-Scanner/lightning-flow-scanner#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-BjYtV5nHj2+1FGBDVRFISwR9h2jOk1EW+DAomMWyS9zS4jQitxwJylGYUn/AptQ11g4PUyKXZPQdPzkcnPNC3Q==","shasum":"9845039aa07e600a2c6848ac20c551a8c4a9553e","tarball":"https://registry.npmjs.org/@flow-scanner/regex-scanner/-/regex-scanner-1.1.1.tgz","fileCount":25,"unpackedSize":49454,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDDmOoBkbmJCGoBpLdV0yCBCrQdARKqVtTSkPMAHs4yvQIgVxGLRBkcua1pGP9vadL0SclFH92t9Swgle1v+wb84mw="}]},"_npmUser":{"name":"flow_scanner","email":"npm@lightningflowscanner.org"},"directories":{},"maintainers":[{"name":"flow_scanner","email":"npm@lightningflowscanner.org"},{"name":"rhalman","email":"halmanrf@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/regex-scanner_1.1.1_1775389914069_0.34756649881169444"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-14T14:15:19.511Z","modified":"2026-04-05T11:51:54.333Z","1.0.0":"2026-01-14T14:15:19.752Z","1.1.0":"2026-02-02T16:05:54.913Z","1.1.1":"2026-04-05T11:51:54.216Z"},"bugs":{"url":"https://github.com/Flow-Scanner/lightning-flow-scanner/issues"},"author":{"name":"Ruben Halman","url":"https://github.com/RubenHalman"},"license":"MIT","homepage":"https://github.com/Flow-Scanner/lightning-flow-scanner#readme","keywords":["regex","scanner","salesforce","metadata","linter","static-analysis"],"repository":{"type":"git","url":"git+https://github.com/Flow-Scanner/lightning-flow-scanner.git","directory":"packages/regex-scanner"},"description":"Generic regex-based scanning engine.","maintainers":[{"name":"flow_scanner","email":"npm@lightningflowscanner.org"},{"name":"rhalman","email":"halmanrf@gmail.com"}],"readme":"# @flow-scanner/regex-scanner\n\nA generic regex-based scanning engine for metadata files. This package provides a lightweight, extensible framework for detecting patterns in metadata content.\n\n## Installation\n\n```bash\nnpm install @flow-scanner/regex-scanner\n```\n\n## Usage\n\n```typescript\nimport { scanRegex, MetadataFile } from \"@flow-scanner/regex-scanner\";\n\nconst file: MetadataFile = {\n  name: \"My_Flow\",\n  fileName: \"My_Flow.flow-meta.xml\",\n  metadataType: \"Flow\",\n  content: \"<Flow>...</Flow>\",\n};\n\n// Works with any Salesforce metadata type\nconst prompt: MetadataFile = {\n  name: \"My_Prompt\",\n  fileName: \"My_Prompt.aiPromptTemplate-meta.xml\",\n  metadataType: \"AiPromptTemplate\",\n  content: \"<AiPromptTemplate>...</AiPromptTemplate>\",\n};\n\nconst violations = scanRegex([file]);\n```\n\n## Built-in Rules\n\nAll built-in rules apply to any metadata type by default.\n\n| Rule ID | Description |\n|---------|-------------|\n| `naming-convention` | Validates file names match a configurable pattern |\n| `hardcoded-id` | Detects hardcoded Salesforce record IDs (15/18 char) |\n| `hardcoded-url` | Detects hardcoded force.com URLs |\n| `hardcoded-secret` | Detects API keys, tokens, and credentials |\n\n## Configuration\n\n```typescript\nimport { scanRegex, RegexScanConfig } from \"@flow-scanner/regex-scanner\";\n\nconst config: RegexScanConfig = {\n  rules: {\n    \"naming-convention\": {\n      enabled: true,\n      expression: \"[A-Z][a-z]+_[A-Z][a-z]+\", // Custom pattern\n      severity: \"warning\",\n    },\n    \"hardcoded-id\": {\n      enabled: false, // Disable this rule\n    },\n  },\n};\n\nconst violations = scanRegex(files, config);\n```\n\n## Creating Custom Rules\n\nExtend the `RegexRule` base class:\n\n```typescript\nimport { RegexRule, MetadataFile, RegexViolation } from \"@flow-scanner/regex-scanner\";\n\nexport class MyCustomRule extends RegexRule {\n  constructor() {\n    super({\n      ruleId: \"my-custom-rule\",\n      name: \"MyCustomRule\",\n      label: \"My Custom Rule\",\n      description: \"Detects something specific\",\n      summary: \"Short summary\",\n      severity: \"warning\",\n      supportedTypes: [\"*\"], // or specific types like [\"Flow\", \"ApexClass\"]\n      isConfigurable: false,\n    });\n  }\n\n  protected check(file: MetadataFile): RegexViolation[] {\n    const violations: RegexViolation[] = [];\n    // Your regex logic here\n    return violations;\n  }\n}\n```\n\n## API\n\n### Functions\n\n- `scanRegex(files, config?)` - Scan multiple files, returns violations\n- `scanFile(file, config?)` - Scan a single file\n- `getRegexRuleIds()` - Get all available rule IDs\n- `hasRegexRule(id)` - Check if a rule exists\n\n### Models\n\n- `MetadataFile` - Input file representation\n- `RegexViolation` - Output violation with location info\n- `RegexScanConfig` - Configuration for scan behavior\n- `RegexRule` - Base class for rules","readmeFilename":"README.md"}