Commit Graph

19 Commits

Author SHA1 Message Date
Oleg Proskurin a1c47a37f0 docs: update admin documentation with IP rate limiting and scope error codes
Update admin.md to reflect Phase 3 Part 3 implementation changes:

**Rate Limiting Section:**
- Split into two subsections: API Key Rate Limiting and IP-Based Rate Limiting
- API Key Rate Limiting: Expanded affected endpoints list to include scope management
- IP-Based Rate Limiting: New section documenting 10/hour limit for live URLs
  - Separate from API key limits
  - Only cache MISS counts toward limit
  - Supports X-Forwarded-For header
  - In-memory store with automatic cleanup

**Error Codes Section:**
- Reorganized into categorized tables for better clarity
- Added HTTP 409 (Conflict) status code
- Added Authentication Error Codes table
- Added Rate Limiting Error Codes table with both API key and IP limits
- Added Live Scope Error Codes table:
  - SCOPE_INVALID_FORMAT (400)
  - SCOPE_ALREADY_EXISTS (409)
  - SCOPE_NOT_FOUND (404)
  - IMAGE_NOT_IN_SCOPE (400)

**Documentation Improvements:**
- All error responses include standard format
- Rate limit errors include Retry-After header
- Scope endpoints require project key authentication
- Comprehensive notes for each section

All documentation now accurately reflects current API v1 implementation.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 23:45:17 +07:00
Oleg Proskurin 647f66db7a feat: phase 1 - parameter renames, auto-detection, and flowId logic
**Parameter Renames (Section 1.1):**
- Rename `assignAlias` → `alias` in CreateGenerationRequest
- Rename `assignFlowAlias` → `flowAlias` (changed from Record<string, string> to string)
- Rename `flowAliases` → `flowAlias` in UploadImageRequest
- Update all route handlers and service methods to use new names
- Simplify flowAlias logic to assign single alias string to output image

**Reference Image Auto-Detection (Section 1.2):**
- Add `extractAliasesFromPrompt()` function with regex pattern: /(?:^|\s)(@[\w-]+)/g
- Make `referenceImages` parameter optional
- Auto-detect aliases from prompt text and merge with manual references
- Manual references have priority (listed first), then auto-detected
- Remove duplicates while preserving order
- Invalid aliases are silently skipped (validated with isValidAliasFormat)

**FlowId Response Logic (Section 10.1):**
- If `flowId: undefined` (not provided) → generate new UUID, return in response
- If `flowId: null` (explicitly null) → keep null, don't generate
- If `flowId: "uuid"` (specific value) → use provided value
- Eager flow creation when `flowAlias` is provided (create flow immediately in DB)

**Generation Modification Endpoint (Section 9):**
- Add `PUT /api/v1/generations/:id` endpoint
- Modifiable fields: prompt, aspectRatio, flowId, meta
- Non-generative params (flowId, meta) → update DB only
- Generative params (prompt, aspectRatio) → update DB + trigger regeneration
- FlowId management: null to detach, UUID to attach/change (with eager creation)
- Regeneration updates existing image (same ID, same MinIO path)

**Type Definitions:**
- Update CreateGenerationParams interface with new parameter names
- Add UpdateGenerationRequest interface
- Add extractAliasesFromPrompt export to validators index

**Documentation:**
- Update REST API examples with new parameter names

**Technical Notes:**
- All Phase 1 changes are backward compatible at the data layer
- TypeScript strict mode passes (no new errors introduced)
- Pre-existing TypeScript errors in middleware and other routes remain unchanged

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 01:20:49 +07:00
Oleg Proskurin ed3931a2bd feat: update refactor requirements 2025-11-17 00:46:44 +07:00
Oleg Proskurin 2656b208c5 feat: testing references 2025-11-17 00:23:51 +07:00
Oleg Proskurin a38c2dd954 doc: update rest examples 2025-11-16 18:17:18 +07:00
Oleg Proskurin 213a378532 doc: update the documentation 2025-11-16 17:44:24 +07:00
Oleg Proskurin 3cbb366a9d chore: update docs 2025-10-12 22:19:10 +07:00
Oleg Proskurin dd48d4e1a1 feat: update setup 2025-10-12 21:12:58 +07:00
Oleg Proskurin 237443194f feat: add file upload endpoint 2025-10-11 00:08:51 +07:00
Oleg Proskurin 83303f8890 feat: remove unused endpoints 2025-10-09 23:48:25 +07:00
Oleg Proskurin 7c31644824 feat: add meta tags 2025-10-08 00:03:08 +07:00
Oleg Proskurin 847145c385 feat: update API 2025-10-07 22:28:27 +07:00
Oleg Proskurin 36e5b910e9 feat: apply enchancements 2025-10-06 00:00:42 +07:00
Oleg Proskurin 35df8a031d fix: add apikeys 2025-10-01 21:29:10 +07:00
Oleg Proskurin c2b161d71c docs: update 2025-10-01 00:23:55 +07:00
Oleg Proskurin 0b6bb5662c fix: file access 2025-09-28 23:15:24 +07:00
Oleg Proskurin 1c6dfc4f8b feat: add text endpoint 2025-09-26 22:44:05 +07:00
Oleg Proskurin d55eba8817 feat: upd docs 2025-09-23 23:55:36 +07:00
Oleg Proskurin 7b6844d1f7 add promt enchancement 2025-09-23 00:00:52 +07:00