mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-23 03:26:42 +02:00
feat(memoro/server): add Zod validation, consistent ApiResult responses, and pagination
- Zod schemas for all 30+ API endpoints with proper input validation
- Consistent `{ success: true/false, ... }` response wrapper on every endpoint
- Pagination (limit/offset) on spaces, space memos, bots, and recordings list endpoints
- Validation helper (validateBody/validateQuery) for clean route handlers
- Fix rate-limiter return type in both memoro and shared-hono
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3c47997598
commit
304c1e8b7c
14 changed files with 923 additions and 795 deletions
|
|
@ -40,7 +40,7 @@ setInterval(() => {
|
|||
export function rateLimitMiddleware(options: RateLimitOptions = {}) {
|
||||
const { max = 100, windowMs = 60_000, keyFn } = options;
|
||||
|
||||
return async (c: Context, next: Next) => {
|
||||
return async (c: Context, next: Next): Promise<void | Response> => {
|
||||
const key = keyFn
|
||||
? keyFn(c)
|
||||
: c.req.header('x-forwarded-for')?.split(',')[0]?.trim() ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue