CODEX_ADK/FRONTEND/scripts/update_api_client.sh
jean-philippe 3fae2fcbe1 Initial commit: CODEX_ADK (Svrnty Console) MVP v1.0.0
This is the initial commit for the CODEX_ADK project, a full-stack AI agent
management platform featuring:

BACKEND (ASP.NET Core 8.0):
- CQRS architecture with 6 commands and 7 queries
- 16 API endpoints (all working and tested)
- PostgreSQL database with 5 entities
- AES-256 encryption for API keys
- FluentValidation on all commands
- Rate limiting and CORS configured
- OpenAPI/Swagger documentation
- Docker Compose setup (PostgreSQL + Ollama)

FRONTEND (Flutter 3.x):
- Dark theme with Svrnty branding
- Collapsible sidebar navigation
- CQRS API client with Result<T> error handling
- Type-safe endpoints from OpenAPI schema
- Multi-platform support (Web, iOS, Android, macOS, Linux, Windows)

DOCUMENTATION:
- Comprehensive API reference
- Architecture documentation
- Development guidelines for Claude Code
- API integration guides
- context-claude.md project overview

Status: Backend ready (Grade A-), Frontend integration pending

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 18:32:38 -04:00

63 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
# Update API Client from OpenAPI Specification
#
# This script regenerates Dart API client code from the OpenAPI contract.
# Run this after the backend team updates docs/openapi.json
set -e # Exit on error
echo "🔄 Updating API Client from OpenAPI Specification..."
echo ""
# Check if api-schema.json exists
if [ ! -f "api-schema.json" ]; then
echo "❌ Error: api-schema.json not found"
echo ""
echo "Please copy the OpenAPI spec from backend:"
echo " cp ../backend/docs/openapi.json ./api-schema.json"
echo ""
exit 1
fi
# Show schema info
SCHEMA_SIZE=$(wc -c < api-schema.json | tr -d ' ')
echo "📄 OpenAPI Schema: api-schema.json (${SCHEMA_SIZE} bytes)"
echo ""
# Check if backend CHANGELOG exists and show recent changes
if [ -f "../backend/docs/CHANGELOG.md" ]; then
echo "📋 Recent Backend Changes:"
echo "────────────────────────────"
head -n 20 ../backend/docs/CHANGELOG.md | grep -v "^#" | grep -v "^$" || echo "No recent changes"
echo "────────────────────────────"
echo ""
fi
# Run build_runner to generate code
echo "🏗️ Running code generation..."
echo ""
flutter pub run build_runner build --delete-conflicting-outputs
if [ $? -eq 0 ]; then
echo ""
echo "✅ API client updated successfully!"
echo ""
echo "Next steps:"
echo " 1. Review generated types in lib/api/generated/"
echo " 2. Update endpoint extensions if needed"
echo " 3. Run tests: flutter test"
echo " 4. Commit changes: git add . && git commit -m 'chore: Update API client'"
echo ""
else
echo ""
echo "❌ Code generation failed"
echo ""
echo "Troubleshooting:"
echo " 1. Check api-schema.json is valid OpenAPI 3.x"
echo " 2. Run: flutter clean && flutter pub get"
echo " 3. Check build errors above"
echo ""
exit 1
fi