37 lines
2.2 KiB
Text
37 lines
2.2 KiB
Text
|
|
# API catalog export
|
||
|
|
#
|
||
|
|
# Generates per-service api-catalog-*.json from #[onto_api] registered routes.
|
||
|
|
# Run after any handler annotation is added or changed.
|
||
|
|
# Commit alongside the annotation changes — they are paired artifacts.
|
||
|
|
|
||
|
|
PLATFORM_MANIFEST := "platform/Cargo.toml"
|
||
|
|
|
||
|
|
# Export #[onto_api] routes for all platform services
|
||
|
|
[doc("Export #[onto_api] routes for all platform services to api-catalog-*.json")]
|
||
|
|
export-api-catalog: export-api-catalog-orchestrator export-api-catalog-control-center export-api-catalog-extension-registry export-api-catalog-ai-service
|
||
|
|
@echo "all platform API catalogs exported"
|
||
|
|
|
||
|
|
# Export orchestrator routes
|
||
|
|
[doc("Export orchestrator #[onto_api] routes to api-catalog-orchestrator.json")]
|
||
|
|
export-api-catalog-orchestrator:
|
||
|
|
cargo run --manifest-path {{PLATFORM_MANIFEST}} -p orchestrator --no-default-features --features "core,audit,compliance,platform,ssh,workflow,testing,http-api" -- --dump-api-catalog > api-catalog-orchestrator.json
|
||
|
|
@echo "orchestrator: $(cat api-catalog-orchestrator.json | jq length) routes"
|
||
|
|
|
||
|
|
# Export control-center routes
|
||
|
|
[doc("Export control-center #[onto_api] routes to api-catalog-control-center.json")]
|
||
|
|
export-api-catalog-control-center:
|
||
|
|
cargo run --manifest-path {{PLATFORM_MANIFEST}} -p control-center --no-default-features --features "core,kms,audit,mfa,compliance,experimental" -- --dump-api-catalog > api-catalog-control-center.json
|
||
|
|
@echo "control-center: $(cat api-catalog-control-center.json | jq length) routes"
|
||
|
|
|
||
|
|
# Export extension-registry routes
|
||
|
|
[doc("Export extension-registry #[onto_api] routes to api-catalog-extension-registry.json")]
|
||
|
|
export-api-catalog-extension-registry:
|
||
|
|
cargo run --manifest-path {{PLATFORM_MANIFEST}} -p extension-registry --no-default-features -- --dump-api-catalog > api-catalog-extension-registry.json
|
||
|
|
@echo "extension-registry: $(cat api-catalog-extension-registry.json | jq length) routes"
|
||
|
|
|
||
|
|
# Export ai-service routes
|
||
|
|
[doc("Export ai-service #[onto_api] routes to api-catalog-ai-service.json")]
|
||
|
|
export-api-catalog-ai-service:
|
||
|
|
cargo run --manifest-path {{PLATFORM_MANIFEST}} -p ai-service --no-default-features -- --dump-api-catalog > api-catalog-ai-service.json
|
||
|
|
@echo "ai-service: $(cat api-catalog-ai-service.json | jq length) routes"
|