UNPKG

studiocms

Version:

Astro Native CMS for AstroDB. Built from the ground up by the Astro community.

80 lines (79 loc) 2.66 kB
import type { AstroIntegrationMiddleware, InjectedRoute } from 'astro'; import { Effect } from '../effect.js'; import { StudioCMSRouteConfig } from './utils.js'; export * from './types.js'; export * from './utils.js'; /** * Setup routes for the StudioCMS setup process. * * These routes handle both the frontend setup pages and the backend * API endpoints required during the setup. * * Enabled when dbStartPage is true. */ export declare const setupRoutes: InjectedRoute[]; /** * Routes to be injected when there is no database start page. * * These routes include SDK API endpoints and the renderer service. */ export declare const noDbSetupRoutes: InjectedRoute[]; /** * REST API routes for StudioCMS. * * These routes cover folders, pages, settings, users, and public access. */ export declare const restRoutes: InjectedRoute[]; /** * OAuth Enabled Routes * * Injected when oAuthEnabled is true. */ export declare const oAuthEnabledRoutes: InjectedRoute[]; /** * Username and Password API Routes * * Injected when usernameAndPasswordAPI is true. */ export declare const usernameAndPasswordAPIRoutes: InjectedRoute[]; /** * User Registration Enabled Routes * * Injected when userRegistrationEnabled is true. */ export declare const userRegistrationEnabledRoutes: (dashboardRoute: (path: string) => string) => InjectedRoute[]; /** * Dashboard Enabled Routes * * Injected when dashboardEnabled is true. */ export declare const dashboardEnabledRoutes: (dashboardRoute: (path: string) => string) => InjectedRoute[]; /** * Dashboard API Enabled Routes * * Injected when dashboardAPIEnabled is true. */ export declare const dashboardAPIEnabledRoutes: (dashboardRoute: (path: string) => string) => InjectedRoute[]; /** * 404 Error Page Route * * Injected when shouldInject404Route is true. */ export declare const error404Route: InjectedRoute; /** * Generate middleware based on the database start page configuration. * * @param dbStartPage - Indicates if the database start page is enabled. * @returns An array of Astro integration middleware configurations. */ export declare const middleware: (dbStartPage: boolean) => AstroIntegrationMiddleware[]; /** * Effect to get the Astro project routes and middleware for StudioCMS. * * This effect processes the provided `RouteConfig` and derives the * appropriate routes and middleware to be injected into Astro. * * @returns An effect that resolves to an object containing the routes * and middleware to be injected. */ export declare const getAstroProject: Effect.Effect<import("./types.js").InjectedRoutesWithMiddleware, never, StudioCMSRouteConfig>;