/// /// /// import { Getter, Provider } from '@loopback/core'; import { DataObject, Entity, Filter, FilterExcludingWhere, Where } from '@loopback/repository'; import { Request } from '@loopback/rest'; import { CrudRestService, CrudRestServiceModifier, IRestResolver, ModelConstructor, RestRelationConfig } from '../services'; export declare class RestServiceModifier implements Provider> { private readonly resolverGetter; private readonly _validateToken; private readonly req?; private readonly token; private resolvers; constructor(resolverGetter: Getter[]>, _validateToken: (context: RestServiceModifier, token?: string) => string, req?: Request> | undefined); value(): Promise<(service: CrudRestService, model: ModelConstructor, config: RestRelationConfig[]) => { create: (data: DataObject, token?: string | undefined) => Promise; findById: (id: string, filter?: FilterExcludingWhere | undefined, token?: string | undefined) => Promise; find: (filter?: Filter | undefined, token?: string | undefined, inclusionConfig?: RestRelationConfig | undefined) => Promise; count: (where?: Where | undefined, token?: string | undefined) => Promise; updateById: (id: string, data: DataObject, token?: string | undefined) => Promise; deleteById: (id: string, token?: string | undefined) => Promise; update: (data: DataObject, where?: Where | undefined, token?: string | undefined) => Promise; replaceById: (id: string, data: DataObject, token?: string | undefined) => Promise; delete: (where?: Where | undefined, token?: string | undefined) => Promise; }>; create(service: CrudRestService, data: DataObject, token?: string): Promise; findById(service: CrudRestService, model: ModelConstructor, config: RestRelationConfig[], id: string, filter?: FilterExcludingWhere, token?: string): Promise; find(service: CrudRestService, model: ModelConstructor, config: RestRelationConfig[], filter?: Filter, token?: string, inclusionConfig?: RestRelationConfig): Promise; count(service: CrudRestService, where?: Where, token?: string): Promise; updateById(service: CrudRestService, id: string, data: DataObject, token?: string): Promise; deleteById(service: CrudRestService, id: string, token?: string): Promise; delete(service: CrudRestService, where?: Where, token?: string): Promise; update(service: CrudRestService, data: DataObject, where?: Where, token?: string): Promise; replaceById(service: CrudRestService, id: string, data: DataObject, token?: string): Promise; /** * It takes a filter and a list of relations, and returns a list of relations that are REST relations, * and a map of scopes for those relations * @param {RestRelationConfig[]} configs - RestRelationConfig[] * @param [filter] - The filter object that was passed to the find method. * @returns An object with two properties: restRelations and scopeMap. */ private _relationsFromFilter; private _updateFilter; private _extraFilters; /** * It takes a list of relations, a list of results, and a token, and returns a list of results with the * relations resolved * @param {RestRelationConfig[]} relations - RestRelationConfig[] * @param scopeMap - Map> * @param model - The model class that we are querying * @param {T[]} results - The results of the query. * @param {string} token - The access token of the current user. */ private _resolveRelations; private _configsHaveRelations; }