import { F as Field } from './types-C3QFX0l6.cjs'; interface Request { body?: any; headers: Record; method?: string; url?: string; cookies?: Record; query?: Record; } interface User { id: string; email: string; role: string; tenantId?: string; [key: string]: any; } interface HookArgs { collection?: string; global?: string; data?: T; originalDoc?: T; doc?: T; req: Request; user?: User; operation: 'create' | 'read' | 'update' | 'delete'; tenantId?: string; field?: string; siblingData?: Record; value?: any; previousValue?: any; context?: Record; } type Hook = (args: HookArgs) => Promise | T | void; interface CollectionHooks { beforeValidate?: Hook[]; beforeChange?: Hook[]; afterChange?: Hook[]; beforeRead?: Hook[]; afterRead?: Hook[]; beforeDelete?: Hook[]; afterDelete?: Hook[]; beforeLogin?: Hook[]; afterLogin?: Hook[]; afterLogout?: Hook[]; afterRefresh?: Hook[]; afterForgotPassword?: Hook[]; } interface FieldHooks { beforeValidate?: Hook[]; beforeChange?: Hook[]; afterChange?: Hook[]; afterRead?: Hook[]; } interface GlobalHooks { beforeValidate?: Hook[]; beforeChange?: Hook[]; afterChange?: Hook[]; beforeRead?: Hook[]; afterRead?: Hook[]; } declare function runHooks(hooks: Hook[], args: HookArgs): Promise; declare function runFieldHooks(hooks: Hook[], args: HookArgs): Promise; interface PluginHooks { beforeInit?: Hook[]; afterInit?: Hook[]; beforeRegisterCollections?: Hook[]; afterRegisterCollections?: Hook[]; beforeRegisterGlobals?: Hook[]; afterRegisterGlobals?: Hook[]; beforeServerStart?: Hook[]; afterServerStart?: Hook[]; beforeServerStop?: Hook[]; afterServerStop?: Hook[]; } interface PluginCollectionExtension { slug: string; config: Partial; } interface PluginGlobalExtension { slug: string; config: Partial; } interface PluginFieldExtension { collectionSlug: string; field: Field; } interface PluginAPI { registry: { getCollection: (slug: string) => CollectionConfig | undefined; getCollections: () => CollectionConfig[]; getGlobal: (slug: string) => GlobalConfig | undefined; addCollection: (config: CollectionConfig) => void; addGlobal: (config: GlobalConfig) => void; extendCollection: (slug: string, extension: Partial) => void; extendGlobal: (slug: string, extension: Partial) => void; addField: (collectionSlug: string, field: Field, position?: number) => void; }; hooks: { register: (event: string, handler: Hook) => void; unregister: (event: string, handler: Hook) => void; }; config: { get: (key: string) => any; set: (key: string, value: any) => void; }; db: any; } declare abstract class KyroPlugin { name: string; displayName?: string; adminEntry?: string; version?: string; description?: string; hooks: PluginHooks; collections: Partial[]; globals: Partial[]; fields: PluginFieldExtension[]; extensions: { collections: PluginCollectionExtension[]; globals: PluginGlobalExtension[]; }; adminComponents: Record; adminStyles: string[]; serverMiddleware?: (app: any) => void; clientMiddleware?: (req: any) => any; constructor(name: string); init?(api: PluginAPI): Promise; beforeInit?(api: PluginAPI): Promise; afterInit?(api: PluginAPI): Promise; getCollections?(): Partial[]; getGlobals?(): Partial[]; getHooks?(): PluginHooks; } declare class PluginManager { private plugins; private hooks; register(plugin: KyroPlugin): void; unregister(name: string): void; get(name: string): KyroPlugin | undefined; getAll(): KyroPlugin[]; has(name: string): boolean; registerHook(event: string, handler: Hook): void; unregisterHook(event: string, handler: Hook): void; executeHook(event: string, args?: any): Promise; getAllCollections(): Partial[]; getAllGlobals(): Partial[]; getAllFields(): PluginFieldExtension[]; getAdminComponents(): Record; getAdminStyles(): string[]; } declare class SEOPlugin extends KyroPlugin { constructor(); } declare class WishlistPlugin extends KyroPlugin { constructor(); } declare const presetPlugins: { SEO: typeof SEOPlugin; Wishlist: typeof WishlistPlugin; }; interface WhereClause { [field: string]: any; } interface AccessArgs { req: Request; user?: User; data?: unknown; doc?: unknown; id?: string; tenantId?: string; context?: Record; } type AccessControl = boolean | ((args: AccessArgs) => Promise | boolean | WhereClause); interface CollectionAccess { create?: AccessControl; read?: AccessControl; update?: AccessControl; delete?: AccessControl; admin?: AccessControl; unlock?: AccessControl; readVersions?: AccessControl; } interface GlobalAccess { read?: AccessControl; update?: AccessControl; } interface FieldAccess { create?: AccessControl; read?: AccessControl; update?: AccessControl; } declare function evaluateAccess(access: AccessControl, args: AccessArgs): Promise; declare function mergeWhereClauses(...whereClauses: (WhereClause | boolean | undefined)[]): WhereClause; declare function getWhereClause(access: AccessControl, args: AccessArgs): Promise; interface TenantContext { tenantId: string; userId: string; role?: string; roles?: string[]; permissions?: string[]; isSuperAdmin?: boolean; } interface S3CompatibleConfig { bucket?: string; region?: string; accessKeyId?: string; secretAccessKey?: string; endpoint?: string; cdnUrl?: string; prefix?: string; } interface R2Config { accountId?: string; accessKeyId?: string; secretAccessKey?: string; bucket?: string; cdnUrl?: string; prefix?: string; publicDevUrl?: string; } interface GCSConfig { bucket?: string; projectId?: string; clientEmail?: string; privateKey?: string; cdnUrl?: string; prefix?: string; } interface BackblazeConfig { bucket?: string; accountId?: string; applicationKeyId?: string; applicationKey?: string; cdnUrl?: string; prefix?: string; } interface BunnyConfig { storageZone?: string; apiKey?: string; cdnUrl?: string; prefix?: string; } interface FTPConfig { host?: string; port?: number; user?: string; password?: string; secure?: boolean; baseUrl?: string; prefix?: string; } interface StorageConfig { type: string; s3: S3CompatibleConfig; r2: R2Config; gcs: GCSConfig; digitalocean: S3CompatibleConfig; backblaze: BackblazeConfig; wasabi: S3CompatibleConfig; bunny: BunnyConfig; ftp: FTPConfig; cloudinary: { cloudName?: string; apiKey?: string; apiSecret?: string; folder?: string; }; imgix: { domain?: string; signKey?: string; }; local: { uploadDir?: string; baseUrl?: string; }; } interface EmailConfig { provider?: string; host?: string; port?: number; secure?: boolean; user?: string; pass?: string; from?: string; fromName?: string; replyTo?: string; } declare class ConfigService { private db; private cache; private loaded; private static readonly SENSITIVE_KEYS; constructor(db: any); /** * Initialize the service by loading all settings from the database */ load(): Promise; private ensureSettingsTable; /** * Load settings from the _globals_storage-settings table (SQLite fallback) * Maps nested global structure to flat key-value cache */ private loadFromGlobals; /** * Get a settings value with environment fallback */ get(key: string, envKey?: string, defaultValue?: string): string | undefined; /** * Get storage configuration */ getStorageConfig(): StorageConfig; /** * Get email configuration */ getEmailConfig(): EmailConfig; /** * Mask sensitive values for display */ maskSensitive(key: string, value: string | undefined): string | undefined; /** * Update a setting in the database */ set(key: string, value: string, description?: string): Promise; } interface UploadOptions { folder?: string; filename?: string; mimeType?: string; metadata?: Record; } interface UploadedFile { id: string; filename: string; originalName: string; mimeType: string; size: number; url: string; thumbnailUrl?: string; width?: number; height?: number; folder?: string; provider: string; metadata?: Record; createdAt: string; } interface ImageTransforms { width?: number; height?: number; fit?: "clip" | "crop" | "fill" | "fillmax" | "scale" | "max" | "min"; format?: "webp" | "avif" | "jpeg" | "jpg" | "png" | "gif"; quality?: number; blur?: number; sharpen?: number; /** Crop region as percentages (0-100) of the original image */ cropX?: number; cropY?: number; cropWidth?: number; cropHeight?: number; } interface StorageProvider { name: string; displayName: string; supportsDynamicResize: boolean; upload(file: File, options?: UploadOptions): Promise; uploadFromUrl(url: string, options?: UploadOptions): Promise; delete(url: string): Promise; rename(oldUrl: string, newKey: string): Promise; getImageUrl(url: string, transforms?: ImageTransforms): string; generateThumbnail(file: UploadedFile, size: { width: number; height: number; }): Promise; list(prefix?: string): Promise; exists(url: string): Promise; createFolder?(folder: string): Promise; deleteFolder?(folder: string): Promise; } declare function resolveProvider(configService: ConfigService): Promise; interface AdminConfig { /** Field to display as the title/name of the document in list and relation dropdowns (e.g. "title", "name", "orderNumber") */ useAsTitle?: string; /** Array of field names to display as default table columns in the collection list view */ defaultColumns?: string[]; /** Hide this collection completely from the sidebar navigation */ hidden?: boolean; /** Subtitle or description shown under the collection header in the admin UI */ description?: string; /** Hide the quick API endpoint URL badge from the admin collection view */ hideAPIURL?: boolean; /** Sidebar navigation category section name (e.g. "Commerce", "Restaurant Menu", "Content") */ group?: string; /** Alias for `group`. Organizes collection under a specific sidebar group/folder */ folder?: string; /** Sub-folder for nested navigation grouping */ parentFolder?: string; /** Enable tree hierarchy view for nested hierarchical collections (e.g. parent/child pages) */ treeHierarchy?: boolean; /** Icon name from Lucide (e.g. "lucide:Utensils", "Utensils") or Heroicons (e.g. "hero:Sparkles", "hero-solid:Fire") */ icon?: string; /** Sort order index within its sidebar navigation group (lower numbers appear first) */ order?: number; /** Function returning live frontend preview URL with draft tokens */ preview?: (doc: Record, options: { req: unknown; token?: string; }) => string | Promise; /** Disable the duplicate document button */ disableDuplicate?: boolean; /** Disable the live preview split panel */ disablePreview?: boolean; /** Pagination settings for list view */ pagination?: { defaultLimit?: number; limits?: number[]; }; /** Form layout mode: "split" (with sidebar fields) or "single" column */ layout?: "split" | "single"; /** Custom smart view filters configured for this collection */ smartViews?: SmartViewConfig[]; } interface HierarchyConfig { parentField?: string; maxDepth?: number; slugPrefix?: boolean; } interface ProjectConfig { id: string; name: string; slug: string; description?: string; environment?: 'development' | 'staging' | 'production' | string; collections?: string[]; globals?: string[]; settings?: Record; } interface SmartViewConfig { id: string; name: string; icon?: string; color?: string; filter: Record; collections?: string[]; description?: string; } interface OrganizationConfig { id: string; name: string; slug: string; billingEmail?: string; projects?: ProjectConfig[]; roles?: Array<{ name: string; description?: string; permissions?: string[]; }>; } interface FieldOverrides { [fieldPath: string]: any; } interface CollectionOverrideConfig extends Partial { label?: string; singularLabel?: string; labelPlural?: string; labels?: { singular?: string; plural?: string; }; hidden?: boolean; timestamps?: boolean; versions?: { drafts?: boolean; maxPerDoc?: number; autosave?: boolean; }; seo?: boolean | Record; access?: CollectionAccess; hooks?: CollectionHooks; fields?: FieldOverrides; blocks?: Record | any[]; tabs?: Record | any[]; [key: string]: any; } interface GlobalOverrideConfig extends Partial { label?: string; hidden?: boolean; access?: GlobalAccess; hooks?: GlobalHooks; fields?: FieldOverrides; blocks?: Record | any[]; tabs?: Record | any[]; [key: string]: any; } interface UploadConfig { staticDir?: string; staticURL?: string; mimeTypes?: string[]; fileSize?: number; imageSizes?: ImageSize[]; crop?: boolean; focalPoint?: boolean; formatOptions?: { format: "webp" | "png" | "jpg" | "avif"; options?: Record; }; resizeOptions?: Record; adminThumbnail?: string; } interface ImageSize { name: string; width?: number; height?: number; crop?: string; position?: string; formatOptions?: { format: "webp" | "png" | "jpg" | "avif"; }; generateImageName?: (doc: any) => string; } interface VersionConfig { maxPerDoc?: number; drafts?: boolean; retainDeleted?: boolean; } type DocumentStatus = 'draft' | 'published' | 'archived'; interface AuthConfig { tokenExpiration?: number; verify?: boolean | { generateEmailHTML?: (args: any) => string; }; maxLoginAttempts?: number; lockTime?: number; cookies?: { secure?: boolean; sameSite?: "strict" | "lax" | "none"; domain?: string; }; forgotPassword?: { generateEmailHTML?: (args: any) => string; generateEmailSubject?: (args: any) => string; }; strategies?: Array<{ name: string; authenticate: (args: any) => Promise; }>; } interface CollectionConfig { slug: string; label?: string; labelPlural?: string; singularLabel?: string; admin?: AdminConfig; fields: Field[]; access?: CollectionAccess; hooks?: CollectionHooks; timestamps?: boolean; tenantScoped?: boolean; tenantField?: string; upload?: UploadConfig; versions?: VersionConfig; folder?: string; hierarchy?: HierarchyConfig; auth?: boolean | AuthConfig; graphQL?: { singularName?: string; pluralName?: string; }; indexes?: Array<{ fields: Record; options?: Record; }>; seo?: boolean | Record; custom?: Record; tabs?: Array<{ label: string; fields: Field[]; name?: string; }>; } interface GlobalConfig { slug: string; label?: string; folder?: string; admin?: AdminConfig; fields: Field[]; access?: GlobalAccess; hooks?: GlobalHooks; versions?: VersionConfig; graphQL?: { name?: string; }; typescript?: { interface?: string; }; custom?: Record; tabs?: Array<{ label: string; fields: Field[]; name?: string; }>; } interface FindArgs { collection: string; where?: Record; sort?: string; limit?: number; page?: number; depth?: number; tenantId?: string; select?: string[]; user?: any; context?: Record; overrideAccess?: boolean; /** If true, returns draft docs (admin view). If false/omitted, only published docs are returned (public API). */ draft?: boolean; } interface FindOneArgs { collection: string; where: Record; tenantId?: string; draft?: boolean; depth?: number; select?: string[]; } interface FindByIDArgs { collection: string; id: string; depth?: number; tenantId?: string; select?: string[]; user?: any; context?: Record; overrideAccess?: boolean; /** If true, returns document regardless of status (admin view). */ draft?: boolean; } interface CreateArgs { collection: string; data: Record; depth?: number; tenantId?: string; select?: string[]; user?: any; context?: Record; overrideAccess?: boolean; } interface UpdateArgs { collection: string; id: string; data: Record; depth?: number; tenantId?: string; select?: string[]; user?: any; context?: Record; overrideAccess?: boolean; } interface DeleteArgs { collection: string; id: string; tenantId?: string; user?: any; context?: Record; overrideAccess?: boolean; } interface FindResult { docs: T[]; totalDocs: number; limit: number; totalPages: number; page: number; pagingCounter: number; hasPrevPage: boolean; hasNextPage: boolean; prevPage: number | null; nextPage: number | null; } interface CreateResult { doc: T; errors?: Array<{ field: string; message: string; }>; } interface VersionRecord> { id: string; collection: string; documentId: string; version: number; status: DocumentStatus; data: T; createdBy?: string; createdAt: string; updatedAt: string; publishedAt?: string | null; changeDescription?: string; autosave?: boolean; } interface CreateVersionArgs> { collection: string; documentId: string; data: T; status: DocumentStatus; createdBy?: string; changeDescription?: string; tenantId?: string; /** When true, reuses a single version slot (find existing + update) */ autosave?: boolean; } interface FindVersionsArgs { collection: string; documentId: string; tenantId?: string; limit?: number; page?: number; sort?: string; } interface BaseAdapter { init(collections: CollectionConfig[], globals: GlobalConfig[]): Promise; find>(args: FindArgs): Promise>; findByID>(args: FindByIDArgs): Promise; create>(args: CreateArgs): Promise; update>(args: UpdateArgs): Promise; delete>(args: DeleteArgs): Promise; count(args: { collection: string; where?: Record; tenantId?: string; }): Promise; findOne(args: FindOneArgs): Promise; findVersions(args: FindVersionsArgs): Promise>; findVersionByID(args: { collection: string; versionId: string; tenantId?: string; }): Promise; createVersion>(args: CreateVersionArgs): Promise>; deleteVersions(args: { collection: string; documentId: string; keepLatest?: number; tenantId?: string; }): Promise; updateLatestVersion>(args: CreateVersionArgs): Promise>; migrate?(): Promise; rollback?(): Promise; connect(): Promise; disconnect(): Promise; transaction?(fn: (tx: any) => Promise): Promise; setTenantContext(context: TenantContext | undefined): void; getTenantContext(): TenantContext | undefined; } interface AdapterConfig { type: "drizzle" | "mongodb"; client: any; schema?: any; connectionOptions?: Record; } interface KyroConfig { collections?: CollectionConfig[]; globals?: GlobalConfig[]; projects?: ProjectConfig[]; organizations?: OrganizationConfig[]; adapter: BaseAdapter; storage?: StorageProvider; plugins?: KyroPlugin[]; auth?: boolean | { secret?: string; tokenExpiration?: number; cookie?: { secure?: boolean; sameSite?: "strict" | "lax" | "none"; domain?: string; }; checkSession?: boolean; }; authAdapter?: any; cors?: { origins?: string[]; credentials?: boolean; }; admin?: { meta?: { title?: string; description?: string; ogImage?: string; }; dateFormat?: string; avatar?: "default" | "gravatar"; disable?: boolean; indexRoute?: string; components?: Record; collectionOverrides?: Record; globalOverrides?: Record; smartViews?: SmartViewConfig[]; }; upload?: { limits?: { fileSize?: number; }; }; graphQL?: { maxComplexity?: number; disablePlayground?: boolean; }; typescript?: { outputFile?: string; }; localization?: { locales: string[]; defaultLocale: string; }; rateLimit?: { window?: number; max?: number; }; debug?: boolean; /** * Experimental features configuration. * Opt-in to features undergoing active development. */ experimental?: ExperimentalConfig; } /** * Experimental features configuration. * Features toggled here are active work-in-progress and subject to change across minor releases. */ interface ExperimentalConfig { /** Enable WebSocket real-time engine and multiplayer presence synchronization */ websockets?: boolean; /** Enable AI Assistant and LLM copilot integrations */ aiAssistant?: boolean; /** Enable vector embeddings and semantic search endpoints */ vectorSearch?: boolean; /** Enable dynamic design token compilation (/api/tokens.css) */ designTokens?: boolean; /** Enable live visual preview / island canvas */ visualCanvas?: boolean; } export { presetPlugins as $, type AccessArgs as A, type BaseAdapter as B, type CollectionConfig as C, type DeleteArgs as D, type EmailConfig as E, type FindArgs as F, type GlobalConfig as G, type HierarchyConfig as H, type ImageSize as I, type ProjectConfig as J, KyroPlugin as K, SEOPlugin as L, type SmartViewConfig as M, type UploadConfig as N, type OrganizationConfig as O, PluginManager as P, type VersionConfig as Q, type Request as R, type StorageConfig as S, type TenantContext as T, type UpdateArgs as U, type VersionRecord as V, type WhereClause as W, WishlistPlugin as X, evaluateAccess as Y, getWhereClause as Z, mergeWhereClauses as _, type StorageProvider as a, resolveProvider as a0, runFieldHooks as a1, runHooks as a2, type FindResult as b, type FindByIDArgs as c, type CreateArgs as d, type FindOneArgs as e, type FindVersionsArgs as f, type CreateVersionArgs as g, type KyroConfig as h, type User as i, type AccessControl as j, type AdapterConfig as k, type AdminConfig as l, type AuthConfig as m, type CollectionAccess as n, type CollectionHooks as o, ConfigService as p, type CreateResult as q, type ExperimentalConfig as r, type FieldAccess as s, type FieldHooks as t, type GlobalAccess as u, type GlobalHooks as v, type Hook as w, type HookArgs as x, type PluginAPI as y, type PluginHooks as z };