{"id":27304217,"url":"https://github.com/damecek/sf-flow-parser","last_synced_at":"2026-05-16T08:06:17.121Z","repository":{"id":287166365,"uuid":"963820975","full_name":"Damecek/sf-flow-parser","owner":"Damecek","description":"A TypeScript library for parsing and manipulating Salesforce Flow XML files in Deno","archived":false,"fork":false,"pushed_at":"2025-04-10T09:49:43.000Z","size":512,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-26T01:45:08.016Z","etag":null,"topics":["deno","flow","salesforce","salesforce-flow","salesforce-flows","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Damecek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-10T09:01:28.000Z","updated_at":"2025-04-10T09:49:47.000Z","dependencies_parsed_at":"2025-04-10T10:42:32.791Z","dependency_job_id":"4c9f94ca-a4e9-4c34-acc8-999de0167b15","html_url":"https://github.com/Damecek/sf-flow-parser","commit_stats":null,"previous_names":["damecek/sf-flow-parser"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Damecek/sf-flow-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Damecek%2Fsf-flow-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Damecek%2Fsf-flow-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Damecek%2Fsf-flow-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Damecek%2Fsf-flow-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Damecek","download_url":"https://codeload.github.com/Damecek/sf-flow-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Damecek%2Fsf-flow-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273060141,"owners_count":25038593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deno","flow","salesforce","salesforce-flow","salesforce-flows","typescript","typescript-library"],"created_at":"2025-04-12T03:23:10.457Z","updated_at":"2026-05-16T08:06:17.095Z","avatar_url":"https://github.com/Damecek.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/sf-flow-parser-logo.png\" alt=\"Deno Flow Parser Logo\" width=\"300px\"/\u003e\n\u003c/p\u003e\n\n# Deno Flow Parser\n\nA TypeScript library for parsing, manipulating, and serializing Salesforce Flow XML files in Deno.\n\n## Features\n\n- Parse Salesforce Flow XML files into TypeScript objects\n- Manipulate Flow objects with a clean, type-safe API\n- Serialize Flow objects back to XML\n- Find and modify Flow nodes and their connections\n- Sort Flow arrays by name for consistent output\n- Comprehensive type definitions for Flow objects\n\n## Installation\n\n### From JSR\n\n```bash\n# Add to your dependencies\ndeno add @damecek/sf-flow-parser\n\n# Or import directly in your code\nimport { parse, stringify } from \"jsr:@damecek/sf-flow-parser\";\n```\n\n### From GitHub\n\n```typescript\nimport {parse, stringify} from \"https://raw.githubusercontent.com/damecek/sf-flow-parser/main/src/main.ts\";\n```\n\n### From Local Clone\n\n```bash\n# Clone the repository\ngit clone https://github.com/damecek/sf-flow-parser.git\ncd sf-flow-parser\n\n# Import in your code\nimport { parse, stringify } from \"./src/main.ts\";\n```\n\n## Usage\n\n### Basic Usage\n\n```typescript\nimport {parseFromFile, stringifyToFile} from \"@damecek/sf-flow-parser\";\n\n// Parse a Flow XML file\nconst flow = parseFromFile(\"path/to/flow.xml\");\n\n// Modify the Flow object\nflow.label = \"Modified Flow\";\n\n// Write the modified Flow back to a file\nstringifyToFile(flow, \"path/to/modified-flow.xml\");\n```\n\n### Finding and Modifying Flow Nodes\n\n```typescript\nimport {\n    parseFromFile,\n    stringifyToFile,\n    findFlowNodeByName,\n    findParentFlowNodes,\n    getConnectors\n} from \"@damecek/sf-flow-parser\";\n\n// Parse a Flow XML file\nconst flow = parseFromFile(\"path/to/flow.xml\");\n\n// Find a specific node\nconst node = findFlowNodeByName(flow, \"MyDecision\");\nif (node) {\n    // Modify the node\n    node.label = \"Updated Decision\";\n}\n\n// Find all parent nodes that connect to a specific node\nconst parents = findParentFlowNodes(flow, \"TargetNode\");\nparents.forEach(parent =\u003e {\n    console.log(`Parent node: ${parent.name}`);\n\n    // Get all connectors from the parent node\n    const connectors = getConnectors(parent);\n    connectors.forEach(connector =\u003e {\n        console.log(`Connector target: ${connector.targetReference}`);\n    });\n});\n\n// Write the modified Flow back to a file\nstringifyToFile(flow, \"path/to/modified-flow.xml\");\n```\n\n## API Reference\n\n### Core Functions\n\n- `parse(xml: string): Flow` - Parse XML string into a Flow object\n- `parseFromFile(path: string): Flow` - Parse Flow from XML file\n- `stringify(flow: Flow): string` - Convert Flow object to XML string\n- `stringifyToFile(flow: Flow, path: string): void` - Write Flow object to XML file\n\n### Node Operations\n\n- `findFlowNodeByName(flow: Flow, name: string): FlowNode | undefined` - Find a Flow node by name\n- `findParentFlowNodes(flow: Flow, childName: string): FlowNode[]` - Find all parent nodes that connect to a child node\n- `getConnectors(node: BaseFlowNodeWithConnector): FlowConnector[]` - Get all connectors from a Flow node\n- `getFlowNodes(flow: Flow): FlowNode[]` - Get all nodes from a Flow object\n- `reparentNode(flow: Flow, sourceNodeName: string, targetNodeName: string): void` - Change all parent node connections\n  from one node to another\n\n### Helper Functions\n\n- `ensureArray(obj: Record\u003cstring, any\u003e, propertyName: string): void` - Ensure a property is always an array\n- `ensureArrayProperties(flow: Flow): void` - Ensure all Flow array properties are arrays\n- `processNestedArrays(obj: Record\u003cstring, any\u003e): void` - Process nested arrays in Flow objects\n- `sortByName\u003cT\u003e(arr: T[]): T[]` - Sort an array of objects by name\n- `sortFlowArrays(flow: Flow): Flow` - Sort all array properties in a Flow object by name\n\n## Development\n\n### Prerequisites\n\n- [Deno](https://deno.land/) v1.37.0 or higher\n\n### Setup\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/damecek/sf-flow-parser.git\n   cd sf-flow-parser\n   ```\n\n### Running Tests\n\n```bash\n# Run all tests\ndeno task test\n\n# Run tests with coverage\ndeno task test:coverage\n\n# Run specific test file\ndeno task test src/test/flow.test.ts\n```\n\n### Building\n\nThis is a Deno module, so no build step is required. The code can be imported directly.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n### Guidelines\n\n1. Make sure all tests pass before submitting a PR\n2. Add tests for new features\n3. Update documentation for any changes\n4. Follow the existing code style\n5. Run `deno fmt` before committing to ensure consistent formatting\n\n### Development Workflow\n\n1. Fork the repository\n2. Create a new branch for your feature\n3. Make your changes\n4. Add or update tests\n5. Run tests to ensure they pass\n6. Run `deno fmt` to format your code\n7. Submit a pull request\n\n## Examples\n\nCheck out the [examples](./examples) directory for more usage examples:\n\n- [Basic Usage](./examples/basic-usage.ts) - Simple example of parsing and modifying a Flow\n- [Add Decision Node](./examples/add-decision-node.ts) - Advanced example showing how to add a new decision node to a\n  Flow\n\nRun examples with:\n\n```bash\ndeno run --allow-read --allow-write examples/basic-usage.ts path/to/flow.xml\n```\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamecek%2Fsf-flow-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdamecek%2Fsf-flow-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamecek%2Fsf-flow-parser/lists"}