/** * Collection Schema API Route Handlers for Next.js * * These route handlers can be re-exported in your Next.js application to provide * collection schema management endpoints at /api/collections/schema. * * Services are auto-initialized on first request using environment variables: * - DB_DIALECT: Database dialect ("postgresql" | "mysql" | "sqlite") * - DATABASE_URL: Database connection string * * @example * ```typescript * // In your Next.js app: app/api/collections/schema/route.ts * export { GET, POST } from 'nextly/api/collections-schema'; * ``` * * @module api/collections-schema */ /** * @experimental D63 `admin.nav` filter seam. Lets plugins transform the * collection list that feeds the admin sidebar (hide/reorder/relabel). */ declare function applyAdminNavFilter(items: T[], userId: string): Promise; /** * GET handler for listing collections with pagination and filters. * * Returns only collections the caller has read permission for; super-admins * see everything. Anonymous callers get 401. * * Query Parameters: * - source: Filter by source type ("code" | "ui" | "built-in") * - search: Search query for slug and labels * - limit: Maximum results (default: 50) * - offset: Number of results to skip (default: 0) * * Response Codes: * - 200 OK: Collections list retrieved successfully * - 401 Unauthorized: Authentication required * - 500 Internal Server Error: Failed to fetch collections * * @example * ```bash * curl "http://localhost:3000/api/collections/schema?source=ui&limit=10" * # => {"items":[...],"meta":{"total":5,"page":1,"limit":10,"totalPages":1,"hasNext":false,"hasPrev":false}} * ``` */ declare const GET: (request: Request) => Promise; /** * POST handler for creating a new UI collection. * * Requires super-admin or `manage-settings` permission. Creates a new * collection with `source="ui"` and `locked=false`. * * Response Codes: * - 201 Created: Collection created successfully * - 400 Bad Request: Invalid input * - 401 Unauthorized: Authentication required * - 403 Forbidden: Caller lacks permission to create collections * - 409 Conflict: Collection with slug already exists * - 500 Internal Server Error: Creation failed */ declare const POST: (request: Request) => Promise; export { GET, POST, applyAdminNavFilter };