{"id":43944665,"url":"https://github.com/composable-delivery/busbar-sf-types","last_synced_at":"2026-02-07T02:35:48.274Z","repository":{"id":335528729,"uuid":"1146073393","full_name":"composable-delivery/busbar-sf-types","owner":"composable-delivery","description":"A collection of Rust structs generated from @salesforce/types and grouped with features for selective inclusion","archived":false,"fork":false,"pushed_at":"2026-01-31T08:36:55.000Z","size":168234,"stargazers_count":0,"open_issues_count":15,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-31T10:42:02.510Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/composable-delivery.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-30T15:34:46.000Z","updated_at":"2026-01-31T08:34:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/composable-delivery/busbar-sf-types","commit_stats":null,"previous_names":["composable-delivery/busbar-sf-types"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/composable-delivery/busbar-sf-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composable-delivery%2Fbusbar-sf-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composable-delivery%2Fbusbar-sf-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composable-delivery%2Fbusbar-sf-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composable-delivery%2Fbusbar-sf-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/composable-delivery","download_url":"https://codeload.github.com/composable-delivery/busbar-sf-types/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/composable-delivery%2Fbusbar-sf-types/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29184978,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T00:44:15.062Z","status":"online","status_checked_at":"2026-02-07T02:00:07.217Z","response_time":63,"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":[],"created_at":"2026-02-07T02:35:48.213Z","updated_at":"2026-02-07T02:35:48.268Z","avatar_url":"https://github.com/composable-delivery.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# busbar-sf-types\n\nModular, feature-flagged Rust types for Salesforce metadata, **automatically generated** from [`@salesforce/types`](https://www.npmjs.com/package/@salesforce/types).\n\nThis is a **fully codegen-built crate**—no manual type definitions. All Rust types are automatically generated from Salesforce metadata definitions via the [`@salesforce/types`](https://github.com/forcedotcom/wsdl) npm package.\n\n📊 **[Explore the interactive type dependency graph →](https://composable-delivery.github.io/busbar-sf-types/)**\n\n## About Generated Types\n\nThis repository contains:\n- **Generated types** in `crates/sf-types/src/metadata/` (derived from Salesforce metadata)\n- **Codegen tooling** in `sf-typegen/` (Rust tool that performs the generation)\n\nEvery version of this crate corresponds to a version of `@salesforce/types`. The crate version is aligned with the npm package version:\n- `@salesforce/types@1.0.0` → crate `1.0.0`\n- `@salesforce/types@1.1.0` → crate `1.1.0`  \n- `@salesforce/types@1.1.0` (codegen fix) → crate `1.1.1`\n\nSee [ATTRIBUTION.md](ATTRIBUTION.md) for licensing and attribution requirements.\n\n## Reproducibility\n\nThe generated nature of this crate is explicit and reproducible:\n\n```bash\n# To regenerate from scratch:\nnpm install  # Fetches @salesforce/types\nbash scripts/generate.sh\n# Output in crates/sf-types/src/ will exactly match what's committed\n```\n\n## Components\n\nThis workspace consists of two main crates:\n\n1. **`busbar-sf-types`**: The library crate containing auto-generated Rust structs and enums\n2. **`sf-typegen`**: The codegen toolchain that parses `@salesforce/types` and produces modular Rust code\n\n---\n\n## busbar-sf-types Library\n\nThe core library provides Rust types generated from Salesforce's [`@salesforce/types`](https://github.com/forcedotcom/wsdl) metadata definitions.\n\n### Features\n\nTypes are organized by domain, allowing you to include only what you need to keep compile times fast.\n\n#### Core Features\n\n| Feature | Description | ~Types |\n|---------|-------------|--------|\n| `common` | Core enums used across types (default) | 45 |\n| `settings` | Org settings for scratch org definitions | 261 |\n| `full` | All types (enables everything) | 2680+ |\n\n#### Popular Domain Features\n\n| Feature | Description |\n|---------|-------------|\n| `objects` | Custom objects, fields, schema types |\n| `permissions` | Permission sets, profiles, sharing rules |\n| `flows` | Flow definitions and process automation |\n| `apex` | Apex classes, triggers, components |\n| `lwc` | Lightning Web Components and Aura |\n| `ai` | AI/ML, Einstein, Prompt Templates |\n| `datacloud` | Data Cloud, CDP, Data Sources |\n| `servicecloud` | Service Cloud, Cases, Knowledge |\n\n*(See `crates/sf-types/Cargo.toml` for the full list of 80+ supported categories)*\n\n### Usage\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dependencies]\n# For org settings only (minimal footprint, ~5s compile)\nsf-generated-types = { git = \"https://github.com/kantext-dev/busbar-sf-types\", features = [\"settings\"] }\n\n# For deployment operations (~20s compile)\nsf-generated-types = { git = \"https://github.com/kantext-dev/busbar-sf-types\", features = [\"deployments\"] }\n\n# For JSON Schema support\nsf-generated-types = { git = \"https://github.com/kantext-dev/busbar-sf-types\", features = [\"full\", \"schemars\"] }\n```\n\n#### Example Code\n\n```rust\nuse sf_generated_types::{ApexSettings, SecuritySettings, FieldType};\nuse sf_generated_types::metadata::ai::Prompt;\n\nfn main() {\n    let settings = ApexSettings {\n        enable_compile_on_deploy: Some(true),\n        enable_debug_logs_during_deployment: Some(true),\n        ..Default::default()\n    };\n    \n    // Core enum\n    let field_type = FieldType::Text;\n    \n    // Domain-specific type\n    let prompt = Prompt {\n        master_label: \"My Prompt\".to_string(),\n        ..Default::default()\n    };\n}\n```\n\n## JSON Schemas\n\nThis crate supports generating JSON Schemas for Salesforce metadata types via the `schemars` feature.\n\n### Generating Schemas\n\nYou can run the included schema generator to produce JSON schema files for types like `CustomObject`, `PermissionSet`, etc.:\n\n```bash\ncargo run -p sf-generated-types --bin schema-gen --features \"full schemars\" -- schemas/\n```\n\nThis will output files like `schemas/CustomObject.json` and `schemas/SecuritySettings.json`.\n\n---\n\n## Generating Types\n\nThe types are generated using the `sf-typegen` crate included in this repository.\n\n### Prerequisites\n\n- Rust toolchain (1.91.0 or later)\n- Node.js and npm (for `@salesforce/types`)\n\n### How to Regenerate\n\n```bash\nbash scripts/generate.sh\n```\n\nThis command will:\n1. Fetch the latest `metadata.ts` from `@salesforce/types` npm package\n2. Parse the TypeScript AST using oxc parser\n3. **Build a type dependency graph** to analyze relationships between types\n4. **Perform graph-based categorization** to automatically assign types to modules\n5. Apply **manual documentation overlays** (descriptions for key types)\n6. Apply categorization rules defined in `sf-typegen/src/categories.rs`\n7. Generate modular Rust files in `crates/sf-types/src/metadata/`\n8. Export type graph to `assets/type-graph.json` and `assets/type-graph.dot`\n9. **Copy type graph to `docs/type-graph.json` for GitHub Pages deployment**\n\n### Type Dependency Graph\n\nThe generator now includes a sophisticated type dependency graph that:\n\n- **Analyzes** TypeScript AST to build a directed graph of type relationships\n- **Categorizes** types automatically based on their dependencies\n- **Detects** shared types used by multiple categories (assigned to \"common\" module)\n- **Exports** to JSON and DOT formats for analysis and visualization\n\nThe graph contains:\n- **2682 nodes** (types from Salesforce metadata)\n- **4906 edges** (dependency relationships)\n- **267 shared types** automatically identified and moved to common module\n\nSee [`assets/README.md`](assets/README.md) for detailed information on using the type graph.\n\n#### Interactive Type Explorer\n\nExplore the type dependency graph interactively in your browser:\n\n**🔗 [Launch Salesforce Types Explorer](https://composable-delivery.github.io/busbar-sf-types/)**\n\nThe interactive explorer is built with **React**, **reagraph** (WebGL graph visualization), and **reablocks** and provides:\n- 🔍 **Search** - Find types by name across 2600+ types with real-time results\n- 📊 **Category Browsing** - Browse types organized into 80+ categories\n- 🎯 **Interactive Graph** - Click nodes in the WebGL-rendered dependency graph to navigate\n  - **Overview mode** - Shows top 20 categories by type count\n  - **Type-specific mode** - Displays dependencies for the selected type\n- 🎨 **Relationship Types** - Filter and visualize different edge types:\n  - **Contains** - Type A has a field of Type B\n  - **Extends** - Type A extends/inherits from Type B  \n  - **Generic** - Type A is a generic instantiation of Type B\n- 📑 **Tabbed Interface** - Switch between type Details and JSON Schema views\n- 📈 **Statistics** - View graph metrics and category distributions\n- 🎨 **Color-coded** - Types colored by category for easy identification\n\n**Developing the Site:**\n\n```bash\n# Install dependencies\nnpm install\n\n# Start development server\nnpm run dev\n\n# Build for production\nnpm run build\n```\n\nSee [SITE_README.md](SITE_README.md) for detailed information about the site architecture.\n\n**Testing the Graph Viewer:**\n\nThe graph viewer includes comprehensive Playwright tests to ensure reliability:\n\n```bash\n# Run tests\nnpm test\n\n# Run tests in UI mode (interactive)\nnpm run test:ui\n\n# Debug tests\nnpm run test:debug\n```\n\nTests cover:\n- Initial page load and overview graph display\n- Type selection and dependency visualization\n- Search functionality\n- Category browsing\n- Relationship filtering (Contains/Extends/Generic)\n- Navigation between related types\n\nTo visualize the graph locally with Graphviz:\n```bash\ndot -Tpng assets/type-graph.dot -o type-graph.png\n```\n\n### Memory Requirements\n\n**Note:** Building with `--all-features` requires \u003e8GB of memory and may fail in memory-constrained environments (CI runners, devcontainers). This is due to the large number of feature flags (80+).\n\nFor development and CI, we recommend:\n- Use specific feature subsets: `cargo build --features \"objects,flows,apex\"`\n- Or use default features: `cargo build` (includes common types only)\n- Full feature compilation works on machines with 16GB+ RAM\n\n### Documentation Overlays\n\nSince the source `@salesforce/types` definitions do not include comments, we support a manual overlay system to inject documentation into the generated Rust code (and resulting JSON schemas).\n\nThese are defined in `sf-typegen/src/bin/generate_from_typescript.rs` in the `apply_overlays()` function.\n\n## License\n\nLicensed under either of Apache License, Version 2.0 or MIT license at your option.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomposable-delivery%2Fbusbar-sf-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomposable-delivery%2Fbusbar-sf-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomposable-delivery%2Fbusbar-sf-types/lists"}