Files
harmony/opnsense-codegen/Cargo.toml
Jean-Gabriel Gill-Couture ea5bf305b5 feat: add PHP controller parser and typed API client codegen
Add two new codegen modules:
- controller_parser: extracts module, controller path, model binding,
  and CRUD actions from OPNsense PHP API controller files using regex
- api_codegen: generates typed Rust API client wrappers from ControllerIR

Generated typed API clients for 6 controllers:
- DNatController → DNatApi (search, get, add, set, del, toggle)
- FilterBaseController → FilterBaseApi (apply, revert, savepoint)
- VlanSettingsController → VlanSettingsApi (CRUD + reconfigure)
- LaggSettingsController → LaggSettingsApi (CRUD + reconfigure)
- VipSettingsController → VipSettingsApi (CRUD + reconfigure)
- Dnsmasq SettingsController → SettingsApi (host/domain CRUD)

These typed APIs eliminate the need for manual json!() construction
and string-based URL paths in opnsense-config modules.
2026-04-06 11:21:46 -04:00

26 lines
500 B
TOML

[package]
name = "opnsense-codegen"
edition = "2024"
version.workspace = true
readme.workspace = true
license.workspace = true
[[bin]]
name = "opnsense-codegen"
path = "src/main.rs"
[dependencies]
serde.workspace = true
serde_json.workspace = true
clap.workspace = true
thiserror.workspace = true
log.workspace = true
env_logger.workspace = true
quick-xml = { version = "0.37", features = ["serialize"] }
heck = "0.5"
regex = "1"
toml = "0.8"
[dev-dependencies]
pretty_assertions.workspace = true