/**
 * Common utilities for routes
 * Contains reusable functions that are duplicated across multiple route files
 */
/**
 * Middleware to check if a model/collection exists
 * Used in: items.route.ts, reports.route.ts
 */
export declare const modelExistsMiddleware: (req: any, res: any, next: any) => any;
/**
 * Throws APIError if user is not authenticated
 * Used in: notification.route.ts (4 times)
 */
export declare function requireAuth(req: any): void;
/**
 * Check if a collection has a tenant_Id field (supports tenant isolation)
 */
export declare function collectionHasTenantField(collection: string): boolean;
/**
 * Invalidate auth cache for a specific role or all roles
 * Used in: permission.route.ts
 */
export declare function invalidateAuthCache(roleId?: string): Promise<void>;
/**
 * Invalidate cached user-role assignment for a specific user
 * Called when baasix_UserRole is created, updated, or deleted
 */
export declare function invalidateUserRoleCache(userId: string, tenantId?: string): Promise<void>;
/**
 * Invalidate cache for a collection
 * Used in: permission.route.ts
 */
export declare function invalidateCollectionCache(collection: string): Promise<void>;
/**
 * Invalidate settings cache for a tenant or global
 * Used in: items.route.ts
 * @param corsInvalidator - Function to invalidate CORS cache (from app.ts)
 */
export declare function invalidateSettingsCache(item: any, corsInvalidator?: () => void): Promise<void>;
/**
 * Invalidate settings cache after import (always invalidates all)
 * Used in: items.route.ts (import-csv and import-json)
 */
export declare function invalidateSettingsCacheAfterImport(): Promise<void>;
//# sourceMappingURL=common.d.ts.map