Files
OSIT-AE-API-FastAPI/export_all_interfaces.py
Scott Idem 802c75bad9 V3: Standardize Primary AE Objects and Synchronize Search Whitelists.
- Synchronized searchable_fields (V3 whitelists) across all Primary and Active AE objects (Identity, People, Events, Journals, Posts, Archives, Business).
- Standardized Pydantic models for core objects to include the 10 common fields (id, id_random, enable, hide, priority, sort, group, notes, created_on, updated_on).
- Fixed field aliases and uncommented valid database columns in User_Base and Organization_Base.
- Pruned non-existent fields from searchable lists in legacy or config-specific definitions (account_cfg, user_role, log_client_viewing).
- Added system discovery and validation tools:
    - ae_object_info.py: AE object status and metadata browser.
    - export_all_interfaces.py: E2E TypeScript interface generator.
    - Verification scripts for searchable field consistency.
- Updated Jan 8 milestone progress and platform roadmap in GEMINI.md.
2026-01-08 12:24:34 -05:00

56 lines
1.7 KiB
Python
Executable File

#!/usr/bin/env python3
import json
import os
import subprocess
# Paths
API_VENV = "/home/scott/OSIT_dev/aether_api_fastapi/environment/bin/python3"
SCHEMA_SCRIPT = "/home/scott/agents_sync/scripts/schema_sync.py"
OUTPUT_FILE = "/home/scott/agents_sync/technical/aether_interfaces.ts"
def main():
print(f"Starting E2E Schema Sync...")
# Run schema_sync.py without arguments to get JSON
try:
result = subprocess.run(
[API_VENV, SCHEMA_SCRIPT],
capture_output=True,
text=True,
check=True
)
full_schema = json.loads(result.stdout)
except Exception as e:
print(f"Error getting schema JSON: {e}")
print(f"Stdout: {result.stdout if 'result' in locals() else 'N/A'}")
print(f"Stderr: {result.stderr if 'result' in locals() else 'N/A'}")
return
ts_content = [
"/**",
" * Aether Unified Type Definitions",
" * Generated by backend_fastapi agent",
" */",
""
]
for obj_type, data in full_schema.items():
interface_name = data['interface_name']
ts_content.append(f"export interface {interface_name} {{")
for f in data['fields']:
opt = "?" if f['optional'] else ""
ts_content.append(f" {f['name']}{opt}: {f['type']};")
ts_content.append("}")
ts_content.append("")
# Ensure output dir exists
os.makedirs(os.path.dirname(OUTPUT_FILE), exist_ok=True)
with open(OUTPUT_FILE, "w") as f:
f.write("\n".join(ts_content))
print(f"Successfully exported {len(full_schema)} interfaces to {OUTPUT_FILE}")
if __name__ == "__main__":
main()