Skip to main content

Query

Query class is used to construct a query that can be passed to the server to get objects or regions

Implements

  • QueryInterface

Index

Constructors

constructor

  • new Query(options?: QueryInterface): Query
  • Parameters

    • optionaloptions: QueryInterface

    Returns Query

Properties

optionalfilterout

filterout?: {}

Type declaration

  • [key string]: string | number

optionalfilters

filters?: { regions?: { region_ids: string[]; table_name: string } }

Type declaration

  • [key string]: any
  • optionalregions?: { region_ids: string[]; table_name: string }
    • region_ids: string[]
    • table_name: string

optionallastpage

lastpage?: boolean

optionalpage

page?: number

optionalperpage

perpage?: number

optionalsearch

search?: string

optionalsearchFallback

searchFallback?: boolean

optionalsearchField

searchField?: string

optionalsort

sort?: { field: string; order: string }[]

optionalsortBy

sortBy?: string

optionalsortDir

sortDir?: string

optionalwithSchema

withSchema?: boolean

Methods

clearFilters

  • clearFilters(): void
  • Returns void

get

  • get(): { filterout: {}; filters: { regions?: { region_ids: string[]; table_name: string } }; lastpage: boolean; page: number; perpage: number; search: string; searchFallback: boolean; searchField: string; sort: { field: string; order: string }[] }
  • Returns { filterout: {}; filters: { regions?: { region_ids: string[]; table_name: string } }; lastpage: boolean; page: number; perpage: number; search: string; searchFallback: boolean; searchField: string; sort: { field: string; order: string }[] }

    • filterout: {}
      • [key string]: string | number
    • filters: { regions?: { region_ids: string[]; table_name: string } }
      • [key string]: any
      • optionalregions?: { region_ids: string[]; table_name: string }
        • region_ids: string[]
        • table_name: string
    • lastpage: boolean
    • page: number
    • perpage: number
    • search: string
    • searchFallback: boolean
    • searchField: string
    • sort: { field: string; order: string }[]

hasFilters

  • hasFilters(): boolean
  • Returns boolean

removeFilter

  • removeFilter(fieldName: string): void
  • Parameters

    • fieldName: string

    Returns void

requestSchema

  • requestSchema(requestSchema: boolean): void
  • Parameters

    • requestSchema: boolean

    Returns void

resetFilters

  • resetFilters(fields?: {}): void
  • Parameters

    • optionalfields: {}

    Returns void

setFields

  • setFields(fields: any): void
  • Parameters

    • fields: any

    Returns void

setFilterField

  • setFilterField(field: string, value: string | number): void
  • Parameters

    • field: string
    • value: string | number

    Returns void

setFilterOut

  • setFilterOut(fields: {}): void
  • Parameters

    • fields: {}

    Returns void

setFilters

  • setFilters(fields: {}): void
  • Parameters

    • fields: {}

    Returns void

setSearch

  • setSearch(search: string): void
  • Parameters

    • search: string

    Returns void

update

  • update(query: QueryInterface): void
  • Parameters

    • query: QueryInterface

    Returns void