ApiSearchResource
@auvious/common / Exports / ApiSearchResource
Class: ApiSearchResource
Api resource implementation for auvious' services. This instance should be used for saving & reading on a specific resource over HTTP.
Hierarchy
↳
ApiSearchResource
Table of contents
Constructors
Properties
Accessors
Methods
- _apiCall
- _appendReadHeaders
- _appendWriteHeaders
- create
- createGeneric
- delete
- deleteById
- deleteByIdGeneric
- deleteGeneric
- get
- getById
- getByIdGeneric
- getGeneric
- getPaged
- getPagedGeneric
- search
- update
- updateById
- updateByIdGeneric
- updateGeneric
Constructors
constructor
• new ApiSearchResource(client, route, searchType, version?)
Parameters
| Name | Type | Default value |
|---|---|---|
client | AuviousCommon | undefined |
route | string | undefined |
searchType | string | undefined |
version | string | "1.0" |
Overrides
Properties
_client
• Protected _client: AuviousCommon
Inherited from
_postman
• Protected _postman: Postman
Inherited from
_route
• Protected _route: string
Inherited from
_searchType
• Protected _searchType: string
_version
• Protected _version: string
Inherited from
log
• Protected log: Logger
Inherited from
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
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
▸ Protected _apiCall<ResourceT>(ResourceTctor, method, config, retries?, initialDelay?): Promise<ResourceT>
Type parameters
| Name | Type |
|---|---|
ResourceT | extends ApiResourceModel<ResourceT> |
Parameters
| Name | Type | Default value |
|---|---|---|
ResourceTctor | (args: any) => ResourceT | undefined |
method | string | undefined |
config | any | undefined |
retries | number | 3 |
initialDelay | number | 500 |
Returns
Promise<ResourceT>
Inherited from
_appendReadHeaders
▸ Protected _appendReadHeaders(config): void
Parameters
| Name | Type |
|---|---|
config | any |
Returns
void
Inherited from
ApiResource._appendReadHeaders
_appendWriteHeaders
▸ Protected _appendWriteHeaders(config): void
Parameters
| Name | Type |
|---|---|
config | any |
Returns
void
Inherited from
ApiResource._appendWriteHeaders
create
▸ create(data, config?): Promise<any>
Parameters
| Name | Type |
|---|---|
data | any |
config | any |
Returns
Promise<any>
Inherited from
createGeneric
▸ createGeneric<ResourceT>(ResourceTctor, data, config?): Promise<ResourceT>
Type parameters
| Name | Type |
|---|---|
ResourceT | extends ApiResourceModel<ResourceT> |
Parameters
| Name | Type |
|---|---|
ResourceTctor | (args: any) => ResourceT |
data | any |
config | any |
Returns
Promise<ResourceT>
Inherited from
delete
▸ delete(config?): Promise<any>
Parameters
| Name | Type |
|---|---|
config | any |
Returns
Promise<any>
Inherited from
deleteById
▸ deleteById(id, config?): Promise<any>
Parameters
| Name | Type |
|---|---|
id | string |
config | any |
Returns
Promise<any>
Inherited from
deleteByIdGeneric
▸ deleteByIdGeneric<ResourceT>(ResourceTctor, id, config?): Promise<ResourceT>
Type parameters
| Name | Type |
|---|---|
ResourceT | extends ApiResourceModel<ResourceT> |
Parameters
| Name | Type |
|---|---|
ResourceTctor | (args: any) => ResourceT |
id | string |
config | any |
Returns
Promise<ResourceT>
Inherited from
deleteGeneric
▸ deleteGeneric<ResourceT>(ResourceTctor, config?): Promise<ResourceT>
Type parameters
| Name | Type |
|---|---|
ResourceT | extends ApiResourceModel<ResourceT> |
Parameters
| Name | Type |
|---|---|
ResourceTctor | (args: any) => ResourceT |
config | any |
Returns
Promise<ResourceT>
Inherited from
get
▸ get(config?): Promise<any>
Just GET the god-damn thing.
Parameters
| Name | Type | Description |
|---|---|---|
config | any | axios compatible config |
Returns
Promise<any>
http response body
Inherited from
getById
▸ getById(id, config?): Promise<any>
Parameters
| Name | Type |
|---|---|
id | string |
config | any |
Returns
Promise<any>
Inherited from
getByIdGeneric
▸ getByIdGeneric<ResourceT>(ResourceTctor, id, config?): Promise<ResourceT>
Type parameters
| Name | Type |
|---|---|
ResourceT | extends ApiResourceModel<ResourceT> |
Parameters
| Name | Type |
|---|---|
ResourceTctor | (args: any) => ResourceT |
id | string |
config | any |
Returns
Promise<ResourceT>
Inherited from
getGeneric
▸ getGeneric<ResourceT>(ResourceTctor, config?): Promise<any>
Type parameters
| Name | Type |
|---|---|
ResourceT | extends ApiResourceModel<ResourceT> |
Parameters
| Name | Type |
|---|---|
ResourceTctor | (args: any) => ResourceT |
config | any |
Returns
Promise<any>
Inherited from
getPaged
▸ getPaged(page, size, config?): Promise<any>
Parameters
| Name | Type |
|---|---|
page | number |
size | number |
config | any |
Returns
Promise<any>
Inherited from
getPagedGeneric
▸ getPagedGeneric<ResourceT>(ResourceTctor, page, size, config?): Promise<ResourceT>
Type parameters
| Name | Type |
|---|---|
ResourceT | extends ApiResourceModel<ResourceT> |
Parameters
| Name | Type |
|---|---|
ResourceTctor | (args: any) => ResourceT |
page | number |
size | number |
config | any |
Returns
Promise<ResourceT>
Inherited from
search
▸ search(searchText, page?, size?): Promise<IApiSearchResult>
Parameters
| Name | Type | Default value |
|---|---|---|
searchText | string | undefined |
page | number | 0 |
size | number | 20 |
Returns
Promise<IApiSearchResult>
update
▸ update(data, config?): Promise<any>
Parameters
| Name | Type |
|---|---|
data | any |
config | any |
Returns
Promise<any>
Inherited from
updateById
▸ updateById(id, data, config?): Promise<any>
Parameters
| Name | Type |
|---|---|
id | string |
data | any |
config | any |
Returns
Promise<any>
Inherited from
updateByIdGeneric
▸ updateByIdGeneric<ResourceT>(ResourceTctor, id, data, config?): Promise<ResourceT>
Type parameters
| Name | Type |
|---|---|
ResourceT | extends ApiResourceModel<ResourceT> |
Parameters
| Name | Type |
|---|---|
ResourceTctor | (args: any) => ResourceT |
id | string |
data | any |
config | any |
Returns
Promise<ResourceT>
Inherited from
updateGeneric
▸ updateGeneric<ResourceT>(ResourceTctor, data, config?): Promise<ResourceT>
Type parameters
| Name | Type |
|---|---|
ResourceT | extends ApiResourceModel<ResourceT> |
Parameters
| Name | Type |
|---|---|
ResourceTctor | (args: any) => ResourceT |
data | any |
config | any |
Returns
Promise<ResourceT>