import type { IStringifyOptions } from 'qs' type Method = | 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK' export interface HTTPRequestConfig { method?: Method url?: string data?: Record | any headers?: any [key: string]: any } export interface HTTPResponse { data: T [key: string]: any } export type HTTPPromise = Promise> export interface WrappedResponse { data: T, [key: string]: any } export type QueryPromise = Promise> declare class StaticModel { /** * Create an instance of itself. */ static instance (this: M): InstanceType /** * Query */ /** * Configuration of HTTP Instance. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#config|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#configuring-the-request|Building the Query} */ static config (this: M, config: HTTPRequestConfig): InstanceType /** * Eager load relationships. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#include|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#including-relationships|Building the Query} */ static include (this: M, ...relationships: string[]): InstanceType /** * Eager load relationships. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#include|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#including-relationships|Building the Query} */ static include (this: M, relationships: string[]): InstanceType /** * Eager load relationships. * * Alias for the [include()]{@link include} method. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#include|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#including-relationships|Building the Query} */ static with (this: M, ...relationships: string[]): InstanceType /** * Eager load relationships. * * Alias for the [include()]{@link include} method. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#include|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#including-relationships|Building the Query} */ static with (this: M, relationships: string[]): InstanceType /** * Append attributes. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#append|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#appending-attributes|Building the Query} */ static append (this: M, ...attributes: string[]): InstanceType /** * Append attributes. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#append|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#appending-attributes|Building the Query} */ static append (this: M, attributes: string[]): InstanceType /** * Set the columns to be selected. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#select|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#selecting-fields|Building the Query} */ static select (this: M, ...columns: string[]): InstanceType /** * Set the columns to be selected. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#select|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#selecting-fields|Building the Query} */ static select (this: M, columns: string[]): InstanceType /** * Set the columns to be selected. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#select|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#selecting-fields|Building the Query} */ static select (this: M, columns: { [related: string]: string[] }): InstanceType /** * Add a basic where clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#where|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#evaluating-a-single-value|Building the Query} */ static where ( this: M, field: string | string[], value: string | number | boolean ): InstanceType /** * Add a basic where clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#where|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#evaluating-a-single-value|Building the Query} */ static where ( this: M, filter: Record ): InstanceType /** * Add a "where in" clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#wherein|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#evaluating-multiple-values|Building the Query} */ static whereIn ( this: M, field: string | string[], values: (string | number | boolean)[] ): InstanceType /** * Add a "where in" clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#wherein|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#evaluating-multiple-values|Building the Query} */ static whereIn ( this: M, filter: Record ): InstanceType /** * Add an "order by" clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#orderby|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#sorting|Building the Query} */ static orderBy (this: M, ...columns: string[]): InstanceType /** * Add an "order by" clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#orderby|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#sorting|Building the Query} */ static orderBy (this: M, columns: string[]): InstanceType /** * Set the current page. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#page|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#paginating|Building the Query} */ static page (this: M, number: number): InstanceType /** * Set the page limit. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#limit|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#paginating|Building the Query} */ static limit (this: M, number: number): InstanceType /** * Add custom parameters to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#params|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#applying-custom-parameters|Building the Query} */ static params (this: M, payload: Record): InstanceType /** * Add a conditional clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#when|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#conditional|Building the Query} */ static when (this: M, value: T, callback: (query: Builder, value: T) => any): InstanceType /** * Build custom endpoints. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#custom|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#calling-a-custom-resource|Building the Query} */ static custom (this: M, ...endpoint: (Model | string)[]): InstanceType /** * Results */ /** * Execute the query and get the first result. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#first|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#getting-the-first-record|Building the Query} */ static first (this: M): QueryPromise> /** * Execute the query and get the first result. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#first-1|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#getting-the-first-record|Building the Query} */ static $first (this: M): Promise> /** * Find a model by its primary key. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#find|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#finding-a-specific-record|Building the Query} */ static find (this: M, id: number | string): QueryPromise> /** * Find a model by its primary key. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#find-1|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#finding-a-specific-record|Building the Query} */ static $find (this: M, id: number | string): Promise> /** * Execute the query and get all results. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#get|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#retrieving-a-list-of-records|Building the Query} */ static get (this: M): QueryPromise[]> /** * Execute the query and get all results. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#get-1|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#retrieving-a-list-of-records|Building the Query} */ static $get (this: M): Promise[]> /** * Execute the query and get all results. * * Alias for the [get()]{@link get} method. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#get|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#retrieving-a-list-of-records|Building the Query} */ static all (this: M): QueryPromise[]> /** * Execute the query and get all results. * * Alias for the [$get()]{@link $get} method. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#get-1|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#retrieving-a-list-of-records|Building the Query} */ static $all (this: M): Promise[]> } export class Model extends StaticModel { /** * Instance of the HTTP client which is used to make requests. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/model-options#http|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/installation|Installation} */ static $http: any constructor (...args: any[]) /** * Settings */ /** * Instance of the HTTP client which is used to make requests. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/model-options#http|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/installation|Installation} */ get $http (): any /** * This method can be overridden in the model to configure * [object-to-formdata]{@link https://github.com/therealparmesh/object-to-formdata#usage|object-to-formdata}. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/model-options#http|API Reference} * @see {@link https://github.com/therealparmesh/object-to-formdata#usage|object-to-formdata} */ formData (): { indices: boolean, nullsAsUndefineds: boolean, booleansAsIntegers: boolean, allowEmptyArrays: boolean, } /** * Resource route of the model which is used to build the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/model-options#resource|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/configuration#creating-the-domain-models|Configuration} */ resource (): string /** * Primary key of the model which is used to build the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/model-options#primarykey|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/configuration#changing-the-primary-key|Configuration} */ primaryKey (): string /** * This method can be used to lazy load relationships of a model and apply model instances to them. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/model-options#hasmany|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/configuration#lazy-loading-relationships|Configuration} */ hasMany (model: T): InstanceType /** * This method can be implemented in the model to apply model instances to eager loaded relationships. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/model-options#relations|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/configuration#eager-loaded-relationships|Configuration} */ relations (): Record /** * Base URL which is used and prepended to make requests. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/model-options#baseurl|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/configuration#creating-a-base-model|Configuration} */ baseURL (): string /** * Request method which is used to make requests. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/model-options#request|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/configuration#creating-a-base-model|Configuration} */ request (config: HTTPRequestConfig): HTTPPromise /** * From resource. */ private _from (url: string): void /** * Helpers */ /** * Get the primary key of the model. */ private getPrimaryKey (): string | number /** * Determines whether the model has an ID. */ private hasId (): boolean /** * Determines whether the ID is valid. */ private isValidId (id: string | number): boolean /** * The model's endpoint. */ private endpoint (): string /** * This method can be overridden in the model to customize the name of the query parameters. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/model-options#parameternames|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/configuration#customizing-query-parameters|Configuration} */ protected parameterNames (): { include: string, filter: string, sort: string, fields: string, append: string, page: string, limit: string } /** * This method can be overridden in the model to configure `qs`. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/model-options#stringifyOptions|API Reference} * @see {@link https://github.com/ljharb/qs#stringifying|qs} */ protected stringifyOptions(): IStringifyOptions /** * Query */ /** * Configuration of HTTP Instance. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#config|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#configuring-the-request|Building the Query} */ config (config: HTTPRequestConfig): this /** * Eager load relationships. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#include|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#including-relationships|Building the Query} */ include (...relationships: string[]): this /** * Eager load relationships. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#include|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#including-relationships|Building the Query} */ include (relationships: string[]): this /** * Eager load relationships. * * Alias for the [include()]{@link include} method. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#include|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#including-relationships|Building the Query} */ with (...relationships: string[]): this /** * Eager load relationships. * * Alias for the [include()]{@link include} method. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#include|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#including-relationships|Building the Query} */ with (relationships: string[]): this /** * Append attributes. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#append|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#appending-attributes|Building the Query} */ append (...attributes: string[]): this /** * Append attributes. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#append|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#appending-attributes|Building the Query} */ append (attributes: string[]): this /** * Set the columns to be selected. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#select|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#selecting-fields|Building the Query} */ select (...columns: string[]): this /** * Set the columns to be selected. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#select|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#selecting-fields|Building the Query} */ select (columns: string[]): this /** * Set the columns to be selected. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#select|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#selecting-fields|Building the Query} */ select (columns: { [related: string]: string[] }): this /** * Add a basic where clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#where|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#evaluating-a-single-value|Building the Query} */ where (field: string | string[], value: string | number | boolean): this /** * Add a basic where clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#where|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#evaluating-a-single-value|Building the Query} */ where (filter: Record): this /** * Add a "where in" clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#wherein|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#evaluating-multiple-values|Building the Query} */ whereIn (field: string | string[], array: (string | number | boolean)[]): this /** * Add a "where in" clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#wherein|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#evaluating-multiple-values|Building the Query} */ whereIn (filter: Record): this /** * Add an "order by" clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#orderby|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#sorting|Building the Query} */ orderBy (...columns: string[]): this /** * Add an "order by" clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#orderby|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#sorting|Building the Query} */ orderBy (columns: string[]): this /** * Set the current page. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#page|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#paginating|Building the Query} */ page (number: number): this /** * Set the page limit. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#limit|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#paginating|Building the Query} */ limit (number: number): this /** * Add custom parameters to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#params|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#applying-custom-parameters|Building the Query} */ params (payload: Record): this /** * Add a conditional clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#when|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#conditional|Building the Query} */ when(value: T, callback: (query: Builder, value: T) => any): this /** * Build custom endpoints. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#custom|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#calling-a-custom-resource|Building the Query} */ custom (...endpoint: (Model | string)[]): this /** * Results */ /** * Execute the query and get the first result. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#first|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#getting-the-first-record|Building the Query} */ first (): QueryPromise /** * Execute the query and get the first result. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#first-1|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#getting-the-first-record|Building the Query} */ $first (): Promise /** * Find a model by its primary key. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#find|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#finding-a-specific-record|Building the Query} */ find (identifier: number | string): QueryPromise /** * Find a model by its primary key. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#find-1|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#finding-a-specific-record|Building the Query} */ $find (identifier: number | string): Promise /** * Execute the query and get all results. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#get|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#retrieving-a-list-of-records|Building the Query} */ get (): QueryPromise /** * Execute the query and get all results. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#get-1|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#retrieving-a-list-of-records|Building the Query} */ $get (): Promise /** * Execute the query and get all results. * * Alias for the [get()]{@link get} method. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#get|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#retrieving-a-list-of-records|Building the Query} */ all (): QueryPromise /** * Execute the query and get all results. * * Alias for the [$get()]{@link $get} method. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#get-1|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#retrieving-a-list-of-records|Building the Query} */ $all (): Promise /** * Common CRUD operations */ /** * Delete the model from the database. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/crud-operations#delete|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/performing-operations#deleting-a-model|Performing Operations} */ delete (): Promise /** * Save or update a model in the database, then return the instance. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/crud-operations#save|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/performing-operations#saving-a-model|Performing Operations} */ save (): Promise /** * Save a model in the database, then return the instance. */ private _create (): Promise /** * Update a model in the database, then return the instance. */ private _update (): Promise /** * Make a `PATCH` request to update a model in the database, then return the instance. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/crud-operations#patch|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/performing-operations#saving-a-model|Performing Operations} */ patch (): Promise /** * Relationship operations */ /** * Create a new related model. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/relationship-operations#for|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/performing-operations#creating-related-models|Performing Operations} */ for (...models: Model[]): this /** * Create a new related model. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/relationship-operations#attach|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/performing-operations#attaching-a-model|Performing Operations} */ attach (params: Record): Promise /** * Update a related model. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/relationship-operations#sync|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/performing-operations#syncing-a-model|Performing Operations} */ sync (params: Record): Promise } declare class Builder { /** * Query */ /** * Eager load relationships. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#include|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#including-relationships|Building the Query} */ include (...relationships: string[]): this /** * Eager load relationships. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#include|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#including-relationships|Building the Query} */ include (relationships: string[]): this /** * Eager load relationships. * * Alias for the [include()]{@link include} method. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#include|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#including-relationships|Building the Query} */ with (...relationships: string[]): this /** * Eager load relationships. * * Alias for the [include()]{@link include} method. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#include|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#including-relationships|Building the Query} */ with (relationships: string[]): this /** * Append attributes. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#append|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#appending-attributes|Building the Query} */ append (...attributes: string[]): this /** * Append attributes. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#append|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#appending-attributes|Building the Query} */ append (attributes: string[]): this /** * Set the columns to be selected. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#select|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#selecting-fields|Building the Query} */ select (...columns: string[]): this /** * Set the columns to be selected. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#select|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#selecting-fields|Building the Query} */ select (columns: string[]): this /** * Set the columns to be selected. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#select|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#selecting-fields|Building the Query} */ select (columns: { [related: string]: string[] }): this /** * Add a basic where clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#where|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#evaluating-a-single-value|Building the Query} */ where (field: string | string[], value: string | number | boolean): this /** * Add a basic where clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#where|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#evaluating-a-single-value|Building the Query} */ where (filter: Record): this /** * Add a "where in" clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#wherein|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#evaluating-multiple-values|Building the Query} */ whereIn (field: string | string[], array: (string | number | boolean)[]): this /** * Add a "where in" clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#wherein|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#evaluating-multiple-values|Building the Query} */ whereIn (filter: Record): this /** * Add an "order by" clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#orderby|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#sorting|Building the Query} */ orderBy (...columns: string[]): this /** * Add an "order by" clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#orderby|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#sorting|Building the Query} */ orderBy (columns: string[]): this /** * Set the current page. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#page|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#paginating|Building the Query} */ page (number: number): this /** * Set the page limit. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#limit|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#paginating|Building the Query} */ limit (number: number): this /** * Add custom parameters to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#params|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#applying-custom-parameters|Building the Query} */ params (payload: Record): this /** * Add a conditional clause to the query. * * @see {@link https://robsontenorio.github.io/vue-api-query/api/query-builder-methods#when|API Reference} * @see {@link https://robsontenorio.github.io/vue-api-query/building-the-query#conditional|Building the Query} */ when(value: T, callback: (query: this, value: T) => any): this /** * Return parsed query string. */ query(): string }