Commit Graph

8 Commits

Author SHA1 Message Date
Oleg Proskurin c185ea3ff4 feat: add Phase 1 foundation for API v2.0
Implement foundational components for Banatie API v2.0 with dual alias system,
flows support, and comprehensive type safety.

**Type Definitions:**
- Add models.ts with database types (Generation, Image, Flow, etc.)
- Add requests.ts with all v2 API request types
- Add responses.ts with standardized response types and converters
- Support for pagination, filters, and complex relations

**Constants:**
- Define technical aliases (@last, @first, @upload)
- Define reserved aliases and validation patterns
- Add rate limits for master/project keys (2-bucket system)
- Add pagination, image, generation, and flow limits
- Comprehensive error messages and codes

**Validators:**
- aliasValidator: Format validation, reserved alias checking
- paginationValidator: Bounds checking with normalization
- queryValidator: UUID, aspect ratio, focal point, date range validation

**Helpers:**
- paginationBuilder: Standardized pagination response construction
- hashHelper: SHA-256 utilities for caching and file deduplication
- queryHelper: Reusable WHERE clause builders with soft delete support

**Core Services:**
- AliasService: 3-tier alias resolution (technical → flow → project)
  - Technical alias computation (@last, @first, @upload)
  - Flow-scoped alias lookup from JSONB
  - Project-scoped alias lookup with uniqueness
  - Conflict detection and validation
  - Batch resolution support

**Dependencies:**
- Add drizzle-orm to api-service for direct ORM usage

All Phase 1 code is type-safe with zero TypeScript errors.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 21:53:50 +07:00
Oleg Proskurin dd48d4e1a1 feat: update setup 2025-10-12 21:12:58 +07:00
Oleg Proskurin df6596d53c chore: prettier 2025-10-09 23:16:42 +07:00
Oleg Proskurin 620a2a9caa chore: update the model 2025-10-06 23:41:26 +07:00
Oleg Proskurin bdf2c80782 feat: stored under org/project path 2025-10-05 17:36:01 +07:00
Oleg Proskurin e2cfd6e27f fix: service config 2025-10-05 16:50:09 +07:00
Oleg Proskurin 298898f79d feat: implement apikey auth 2025-10-01 00:14:14 +07:00
Oleg Proskurin babcbe29db feat: move to monorepo 2025-09-29 21:58:43 +07:00