Skip to main content

@auvious/common / ApiSearchResource

Class: ApiSearchResource

Api resource implementation for auvious' services. This instance should be used for saving & reading on a specific resource over HTTP.

Hierarchy​

Table of contents​

Constructors​

Properties​

Accessors​

Methods​

Constructors​

constructor​

• new ApiSearchResource(client, route, searchType, version?): ApiSearchResource

Parameters​

NameTypeDefault value
clientAuviousCommonundefined
routestringundefined
searchTypestringundefined
versionstring"1.0"

Returns​

ApiSearchResource

Overrides​

ApiResource.constructor

Properties​

_client​

• Protected _client: AuviousCommon

Inherited from​

ApiResource._client


_postman​

• Protected _postman: Postman

Inherited from​

ApiResource._postman


_route​

• Protected _route: string

Inherited from​

ApiResource._route


_searchType​

• Protected _searchType: string


_version​

• Protected _version: string

Inherited from​

ApiResource._version


log​

• Protected log: Logger

Inherited from​

ApiResource.log


SEARCH_ROUTE​

▪ Static Protected Readonly SEARCH_ROUTE: string = "/conference/feature/search"

Accessors​

parentClient​

• get parentClient(): AuviousCommon

Gets the parent client of the api resource.

Returns​

AuviousCommon

Inherited from​

ApiResource.parentClient


route​

• get route(): string

Gets the resource default route. This is what is this._appended on the server url, before any route parameters.

.eg an api resource of route '/api/user' will get from http://server.url/api/user

Returns​

string

Inherited from​

ApiResource.route


version​

• get version(): string

Gets the resource default version. This should be set in every request's X-REQUESTED-VERSION header.

Returns​

string

Inherited from​

ApiResource.version

Methods​

_apiCall​

▸ _apiCall<ResourceT>(ResourceTctor, method, config, retries?, initialDelay?, maxDelay?): Promise<ResourceT>

Type parameters​

NameType
ResourceTextends ApiResourceModel

Parameters​

NameTypeDefault value
ResourceTctor(args: any) => ResourceTundefined
methodstringundefined
configanyundefined
retriesnumber3
initialDelaynumber1000
maxDelaynumber8000

Returns​

Promise<ResourceT>

Inherited from​

ApiResource._apiCall


_appendReadHeaders​

▸ _appendReadHeaders(config): void

Parameters​

NameType
configany

Returns​

void

Inherited from​

ApiResource._appendReadHeaders


_appendWriteHeaders​

▸ _appendWriteHeaders(config): void

Parameters​

NameType
configany

Returns​

void

Inherited from​

ApiResource._appendWriteHeaders


create​

▸ create(data, config?): Promise<any>

Parameters​

NameType
dataany
configany

Returns​

Promise<any>

Inherited from​

ApiResource.create


createGeneric​

▸ createGeneric<ResourceT>(ResourceTctor, data, config?): Promise<ResourceT>

Type parameters​

NameType
ResourceTextends ApiResourceModel

Parameters​

NameType
ResourceTctor(args: any) => ResourceT
dataany
configany

Returns​

Promise<ResourceT>

Inherited from​

ApiResource.createGeneric


delete​

▸ delete(config?): Promise<any>

Parameters​

NameType
configany

Returns​

Promise<any>

Inherited from​

ApiResource.delete


deleteById​

▸ deleteById(id, config?): Promise<any>

Parameters​

NameType
idstring
configany

Returns​

Promise<any>

Inherited from​

ApiResource.deleteById


deleteByIdGeneric​

▸ deleteByIdGeneric<ResourceT>(ResourceTctor, id, config?): Promise<ResourceT>

Type parameters​

NameType
ResourceTextends ApiResourceModel

Parameters​

NameType
ResourceTctor(args: any) => ResourceT
idstring
configany

Returns​

Promise<ResourceT>

Inherited from​

ApiResource.deleteByIdGeneric


deleteGeneric​

▸ deleteGeneric<ResourceT>(ResourceTctor, config?): Promise<ResourceT>

Type parameters​

NameType
ResourceTextends ApiResourceModel

Parameters​

NameType
ResourceTctor(args: any) => ResourceT
configany

Returns​

Promise<ResourceT>

Inherited from​

ApiResource.deleteGeneric


get​

▸ get(config?): Promise<any>

Just GET the god-damn thing.

Parameters​

NameTypeDescription
configanyaxios compatible config

Returns​

Promise<any>

http response body

Inherited from​

ApiResource.get


getById​

▸ getById(id, config?): Promise<any>

Parameters​

NameType
idstring
configany

Returns​

Promise<any>

Inherited from​

ApiResource.getById


getByIdGeneric​

▸ getByIdGeneric<ResourceT>(ResourceTctor, id, config?): Promise<ResourceT>

Type parameters​

NameType
ResourceTextends ApiResourceModel

Parameters​

NameType
ResourceTctor(args: any) => ResourceT
idstring
configany

Returns​

Promise<ResourceT>

Inherited from​

ApiResource.getByIdGeneric


getGeneric​

▸ getGeneric<ResourceT>(ResourceTctor, config?): Promise<any>

Type parameters​

NameType
ResourceTextends ApiResourceModel

Parameters​

NameType
ResourceTctor(args: any) => ResourceT
configany

Returns​

Promise<any>

Inherited from​

ApiResource.getGeneric


getPaged​

▸ getPaged(page, size, config?): Promise<any>

Parameters​

NameType
pagenumber
sizenumber
configany

Returns​

Promise<any>

Inherited from​

ApiResource.getPaged


getPagedGeneric​

▸ getPagedGeneric<ResourceT>(ResourceTctor, page, size, config?): Promise<ResourceT>

Type parameters​

NameType
ResourceTextends ApiResourceModel

Parameters​

NameType
ResourceTctor(args: any) => ResourceT
pagenumber
sizenumber
configany

Returns​

Promise<ResourceT>

Inherited from​

ApiResource.getPagedGeneric


▸ search(searchText, page?, size?): Promise<IApiSearchResult>

Parameters​

NameTypeDefault value
searchTextstringundefined
pagenumber0
sizenumber20

Returns​

Promise<IApiSearchResult>


update​

▸ update(data, config?): Promise<any>

Parameters​

NameType
dataany
configany

Returns​

Promise<any>

Inherited from​

ApiResource.update


updateById​

▸ updateById(id, data, config?): Promise<any>

Parameters​

NameType
idstring
dataany
configany

Returns​

Promise<any>

Inherited from​

ApiResource.updateById


updateByIdGeneric​

▸ updateByIdGeneric<ResourceT>(ResourceTctor, id, data, config?): Promise<ResourceT>

Type parameters​

NameType
ResourceTextends ApiResourceModel

Parameters​

NameType
ResourceTctor(args: any) => ResourceT
idstring
dataany
configany

Returns​

Promise<ResourceT>

Inherited from​

ApiResource.updateByIdGeneric


updateGeneric​

▸ updateGeneric<ResourceT>(ResourceTctor, data, config?): Promise<ResourceT>

Type parameters​

NameType
ResourceTextends ApiResourceModel

Parameters​

NameType
ResourceTctor(args: any) => ResourceT
dataany
configany

Returns​

Promise<ResourceT>

Inherited from​

ApiResource.updateGeneric