gitea/services
logikonline 9094d8b503 feat(api): add v2 API with AI-friendly features (Phase 2)
This introduces a new v2 API at /api/v2/ with features designed for
AI agents and automation tools while maintaining full backward
compatibility with the existing v1 API.

New features:
- Structured error codes (70+ machine-readable codes) for precise
  error handling by automated tools
- Scalar API documentation at /api/v2/docs (modern replacement for
  Swagger UI)
- Batch operations for bulk file and repository fetching
- NDJSON streaming endpoints for files, commits, and issues
- AI context endpoints providing rich repository summaries,
  navigation hints, and issue context

Files added:
- modules/errors/codes.go - Error code definitions and catalog
- modules/errors/api_error.go - Rich API error response builder
- routers/api/v2/api.go - v2 router with auth middleware
- routers/api/v2/docs.go - Scalar docs and OpenAPI spec
- routers/api/v2/batch.go - Batch file/repo operations
- routers/api/v2/streaming.go - NDJSON streaming endpoints
- routers/api/v2/ai_context.go - AI context endpoints
- routers/api/v2/misc.go - Version and user endpoints

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 11:41:10 -05:00
..
actions Fix actions schedule update issue (#35767) 2025-10-29 16:04:40 +00:00
agit Use git model to detect whether branch exist instead of gitrepo method (#35459) 2025-10-25 10:08:25 -07:00
asymkey Add an option to automatically verify SSH keys from LDAP (#35927) 2025-12-27 12:33:08 +00:00
attachment feat(api): add Phase 1 API enhancements for reliability and tracing 2026-01-09 11:14:18 -05:00
auth Add an option to automatically verify SSH keys from LDAP (#35927) 2025-12-27 12:33:08 +00:00
automerge Remove unnecessary function parameter (#35765) 2025-10-31 21:56:08 -07:00
automergequeue Fix various trivial problems (#35714) 2025-10-21 13:19:29 +08:00
context feat(api): add v2 API with AI-friendly features (Phase 2) 2026-01-09 11:41:10 -05:00
contexttest Fix session gob (#35128) 2025-07-20 01:49:36 +00:00
convert Move commit related functions to gitrepo package (#35600) 2025-12-05 00:20:23 +00:00
cron feat(api): add chunked upload support for large release attachments 2026-01-08 08:58:56 -05:00
doctor Some small refactors (#36163) 2025-12-15 11:55:44 -08:00
externalaccount Refactor OpenIDConnect to support SSH/FullName sync (#34978) 2025-07-10 18:35:59 +00:00
feed Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
forms Add an option to automatically verify SSH keys from LDAP (#35927) 2025-12-27 12:33:08 +00:00
git improve the compare page (#36261) 2026-01-01 10:32:19 -08:00
gitdiff Add git.DIFF_RENAME_SIMILARITY_THRESHOLD option (#36164) 2025-12-17 10:02:32 +00:00
indexer Update issue indexer after merging a PR (#30715) 2024-05-08 14:45:15 +00:00
issue Limit reading bytes instead of ReadAll (#35928) 2025-11-12 19:44:49 +08:00
lfs Use the requested host for LFS links (#36242) 2025-12-26 04:48:20 +00:00
mailer mailer: pass request context to generateAdditionalHeadersForIssue (#36274) 2026-01-01 04:28:25 +00:00
markup Update chroma to v2.21.0 (#36171) 2025-12-17 01:07:44 +00:00
migrations Some refactor for repo path (#36251) 2025-12-29 18:49:54 +00:00
mirror Move some functions to gitrepo package to reduce RepoPath reference directly (#36126) 2025-12-12 01:15:40 +01:00
notify Don't send trigger for a pending review's comment create/update/delete (#34928) 2025-07-03 10:35:45 +08:00
oauth2_provider Make OAuth2 issuer configurable (#35915) 2025-11-10 23:45:01 +08:00
org Use db.WithTx/WithTx2 instead of TxContext when possible (#35428) 2025-09-10 03:15:01 +00:00
packages feat(debian): use explicit, stronger defaults for newly generated repo signing keys (#36236) 2026-01-01 02:36:14 +00:00
projects Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
pull Refactor compare router param parse (#36105) 2025-12-25 17:51:30 -08:00
release Automatic generation of release notes (#35977) 2025-12-17 02:01:19 +00:00
repository Some refactor for repo path (#36251) 2025-12-29 18:49:54 +00:00
secrets Fix various bugs (#35684) 2025-10-19 00:37:50 +08:00
task Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
uinotification Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
user Fix edit user email bug in API (#36068) 2025-12-04 09:05:13 +01:00
versioned_migration Remove wrong "git.DefaultContext" (#35364) 2025-08-27 16:31:21 +00:00
webhook Bump golangci-lint to 2.7.2, enable modernize stringsbuilder (#36180) 2025-12-17 20:50:53 +00:00
webtheme Support blue yellow colorblind theme (#35910) 2025-11-11 18:21:15 +00:00
wiki Use gitRepo as parameter instead of repopath when invoking sign functions (#36162) 2025-12-17 21:55:08 +00:00