import { Id, Paginated, Query } from '@feathersjs/feathers'; import { AdapterParams, AdapterServiceOptions, InternalServiceMethods, PaginationOptions } from './declarations'; export declare const VALIDATED: unique symbol; /** * An abstract base class that a database adapter can extend from to implement the * `__find`, `__get`, `__update`, `__patch` and `__remove` methods. */ export declare abstract class AdapterBase, ServiceParams extends AdapterParams = AdapterParams, Options extends AdapterServiceOptions = AdapterServiceOptions, IdType = Id> implements InternalServiceMethods { options: Options; constructor(options: Options); get id(): string; get events(): string[]; /** * Check if this adapter allows multiple updates for a method. * @param method The method name to check. * @param params The service call params. * @returns Wether or not multiple updates are allowed. */ allowsMulti(method: string, params?: ServiceParams): boolean | string[]; /** * Returns the combined options for a service call. Options will be merged * with `this.options` and `params.adapter` for dynamic overrides. * * @param params The parameters for the service method call * @returns The actual options for this call */ getOptions(params: ServiceParams): Options; /** * Returns a sanitized version of `params.query`, converting filter values * (like $limit and $skip) into the expected type. Will throw an error if * a `$` prefixed filter or operator value that is not allowed in `filters` * or `operators` is encountered. * * @param params The service call parameter. * @returns A new object containing the sanitized query. */ sanitizeQuery(params?: ServiceParams): Promise; /** * Retrieve all resources from this service. * Does not sanitize the query and should only be used on the server. * * @param _params - Service call parameters {@link ServiceParams} */ abstract _find(_params?: ServiceParams & { paginate?: PaginationOptions; }): Promise>; abstract _find(_params?: ServiceParams & { paginate: false; }): Promise; abstract _find(params?: ServiceParams): Promise>; /** * Retrieve a single resource matching the given ID, skipping any service-level hooks. * Does not sanitize the query and should only be used on the server. * * @param id - ID of the resource to locate * @param params - Service call parameters {@link ServiceParams} * @see {@link HookLessServiceMethods} * @see {@link https://docs.feathersjs.com/api/services.html#get-id-params|Feathers API Documentation: .get(id, params)} */ abstract _get(id: IdType, params?: ServiceParams): Promise; /** * Create a new resource for this service, skipping any service-level hooks. * Does not check if multiple updates are allowed and should only be used on the server. * * @param data - Data to insert into this service. * @param params - Service call parameters {@link ServiceParams} * @see {@link HookLessServiceMethods} * @see {@link https://docs.feathersjs.com/api/services.html#create-data-params|Feathers API Documentation: .create(data, params)} */ abstract _create(data: Data, params?: ServiceParams): Promise; abstract _create(data: Data[], params?: ServiceParams): Promise; abstract _create(data: Data | Data[], params?: ServiceParams): Promise; /** * Completely replace the resource identified by id, skipping any service-level hooks. * Does not sanitize the query and should only be used on the server. * * @param id - ID of the resource to be updated * @param data - Data to be put in place of the current resource. * @param params - Service call parameters {@link ServiceParams} * @see {@link HookLessServiceMethods} * @see {@link https://docs.feathersjs.com/api/services.html#update-id-data-params|Feathers API Documentation: .update(id, data, params)} */ abstract _update(id: IdType, data: Data, params?: ServiceParams): Promise; /** * Merge any resources matching the given ID with the given data, skipping any service-level hooks. * Does not sanitize the query and should only be used on the server. * * @param id - ID of the resource to be patched * @param data - Data to merge with the current resource. * @param params - Service call parameters {@link ServiceParams} * @see {@link HookLessServiceMethods} * @see {@link https://docs.feathersjs.com/api/services.html#patch-id-data-params|Feathers API Documentation: .patch(id, data, params)} */ abstract _patch(id: null, data: PatchData, params?: ServiceParams): Promise; abstract _patch(id: IdType, data: PatchData, params?: ServiceParams): Promise; abstract _patch(id: IdType | null, data: PatchData, params?: ServiceParams): Promise; /** * Remove resources matching the given ID from the this service, skipping any service-level hooks. * Does not sanitize query and should only be used on the server. * * @param id - ID of the resource to be removed * @param params - Service call parameters {@link ServiceParams} * @see {@link HookLessServiceMethods} * @see {@link https://docs.feathersjs.com/api/services.html#remove-id-params|Feathers API Documentation: .remove(id, params)} */ abstract _remove(id: null, params?: ServiceParams): Promise; abstract _remove(id: IdType, params?: ServiceParams): Promise; abstract _remove(id: IdType | null, params?: ServiceParams): Promise; }