import { ArkosRequest } from "../../types"; export interface OperationHooks { beforeQuery?: (req: ArkosRequest) => void | Promise; afterQuery?: (queryData: { where: any; queryOptions: any; }, req: ArkosRequest) => void | Promise; beforeService?: (args: any[], req: ArkosRequest) => any[] | Promise; afterService?: (data: any, req: ArkosRequest) => any | Promise; beforeResponse?: (responseData: any, req: ArkosRequest) => any | Promise; } /** * The `BaseController` class provides standardized RESTful API endpoints * for any Prisma model based on its name. It supports automatic integration * with Prisma services and dynamic middleware hooks for extending behaviors. * * This controller includes: * - `createOne` / `createMany` * - `findOne` / `findMany` * - `updateOne` / `updateMany` * - `deleteOne` / `deleteMany` * * It handles: * - Prisma query options * - APIFeatures: filtering, sorting, pagination, field limiting * - Middleware hooks: `afterCreateOne`, `afterUpdateMany`, etc. * * @class BaseController * * @param {string} modelName - The Prisma model name this controller handles. * * @see {@link https://www.arkosjs.com/docs/reference/base-controller} *-- * **See about how Arkos handles routers** * @see {@link https://www.arkosjs.com/docs/core-concepts/routing/setup} */ export declare class BaseController { /** * Service instance to handle business logic operations * @private */ private service; /** * Name of the model this controller handles * @private */ private modelName; /** * Model-specific interceptors loaded from model modules * @private */ private interceptors; /** * Creates a new BaseController instance * @param {string} modelName - The name of the model for which this controller will handle operations */ constructor(modelName: string); private executeOperation; /** * Sets response data for both legacy (req.responseData) and modern (res.locals) support */ private setResponseData; /** * Builds service method arguments based on operation configuration */ private buildServiceArgs; /** * Default error handler for operations */ private defaultErrorHandler; /** * Default response builder for operations */ private defaultResponseBuilder; /** * Creates a single resource */ createOne: any; /** * Creates multiple resources in a single operation */ createMany: any; /** * Retrieves multiple resources with filtering, sorting, pagination, and field selection */ findMany: any; /** * Retrieves a single resource by its identifier */ findOne: any; /** * Updates a single resource by its identifier */ updateOne: any; /** * Updates multiple resources that match specified criteria */ updateMany: any; /** * Updates multiple resources with different data in a single transaction */ batchUpdate: any; /** * Deletes a single resource by its identifier */ deleteOne: any; /** * Deletes multiple resources that match specified criteria */ deleteMany: any; /** * Deletes multiple resources with different filters in a single transaction */ batchDelete: any; } /** * Returns a list of all available resource endpoints based on the application's models * * Will soon be removed * * @param {ArkosRequest} req - Express request object * @param {ArkosResponse} res - Express response object * @param {ArkosNextFunction} next - Express next function * @returns {Promise} */ export declare const getAvailableResources: any;