/** * Entity API Client * * Centralized API client for entity CRUD operations */ export interface EntityData { id?: string; [key: string]: unknown; } export interface EntityListParams { page?: number; limit?: number; userId?: string; filters?: Record; includeMeta?: boolean; } export interface EntityListResponse { success: true; data: EntityData[]; info: { timestamp: string; page: number; limit: number; total: number; totalPages: number; hasNextPage: boolean; hasPrevPage: boolean; }; } export interface EntityStats { total: number; recentCount: number; growth: number; status?: { [key: string]: number; }; } export interface BulkOperation { id: string; name: string; description: string; icon?: string; requiresConfirmation?: boolean; } export interface DashboardEntityResponse { success: true; data: EntityData[]; stats: EntityStats; availableOperations: BulkOperation[]; info: { timestamp: string; entityType: string; hasOverride: boolean; }; } /** * Generic entity API client */ export declare class EntityApiClient { private baseUrl; constructor(baseUrl?: string); /** * Get endpoint path from entity configuration using slug * This ensures consistent URLs across routes, endpoints, and navigation */ private getEndpointPath; /** * Get list of entities */ list(entityType: string, params?: EntityListParams): Promise; /** * Get single entity by ID */ get(entityType: string, id: string, includeMeta?: boolean): Promise; /** * Create new entity */ create(entityType: string, data: EntityData, extraHeaders?: Record): Promise; /** * Update entity */ update(entityType: string, id: string, data: Partial): Promise; /** * Delete entity */ delete(entityType: string, id: string): Promise<{ deleted: boolean; id: string; }>; /** * Get dashboard data with stats and bulk operations * Optimized for dashboard views with additional metadata */ getDashboardData(entityType: string, params?: EntityListParams): Promise; /** * Get entity statistics for dashboard metrics */ getEntityStats(entityType: string): Promise; /** * Calculate basic stats from entity list (fallback) */ private calculateBasicStats; /** * Get available bulk operations for entity */ getBulkOperations(entityType: string): Promise; /** * Execute bulk operation on multiple entities */ executeBulkOperation(entityType: string, operationId: string, entityIds: string[], params?: Record): Promise<{ success: boolean; processed: number; errors: string[]; }>; /** * Get entity activity/audit log for dashboard */ getEntityActivity(entityType: string, limit?: number): Promise[]>; /** * Duplicate an entity — fetches the original, strips identity fields, and creates a copy */ duplicate(entityType: string, id: string): Promise; /** * Detect if entity has custom override (client-side detection) */ private detectEntityOverride; } export declare const entityApi: EntityApiClient; export declare const createEntityData: (entityType: string, data: EntityData) => Promise; export declare const updateEntityData: (entityType: string, id: string, data: Partial) => Promise; export declare const deleteEntityData: (entityType: string, id: string) => Promise<{ deleted: boolean; id: string; }>; export declare const getEntityData: (entityType: string, id: string, includeMeta?: boolean) => Promise; export declare const listEntityData: (entityType: string, params?: EntityListParams) => Promise; export declare const duplicateEntityData: (entityType: string, id: string) => Promise; /** * Get child entities for a parent entity * Example: Get order items for an order */ export declare const getEntityChildren: (parentEntityType: string, parentId: string, childEntityName: string, params?: EntityListParams) => Promise; /** * Fetch wrapper that automatically includes team context headers * Used by theme components to make API calls with team isolation * * @param url - The URL to fetch (can be relative like '/api/v1/activities') * @param options - Standard fetch options * @returns Promise - The fetch response * * @example * const response = await fetchWithTeam('/api/v1/activities') * const data = await response.json() */ export declare function fetchWithTeam(url: string, options?: RequestInit): Promise; //# sourceMappingURL=entities.d.ts.map