Skip to main content

ApiUserResource

@auvious/common / Exports / ApiUserResource

Class: ApiUserResource

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 ApiUserResource(client, version?)

Parameters

NameTypeDefault value
clientAuviousCommonundefined
versionstring"1.0"

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


_version

Protected _version: string

Inherited from

ApiResource._version


log

Protected log: Logger

Inherited from

ApiResource.log


USER_ROUTE

Static Private Readonly USER_ROUTE: string = "/security/user"

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

Protected _apiCall<ResourceT>(ResourceTctor, method, config): Promise<ResourceT>

Type parameters

NameType
ResourceTextends ApiResourceModel<ResourceT>

Parameters

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

Returns

Promise<ResourceT>

Inherited from

ApiResource._apiCall


_appendReadHeaders

Protected _appendReadHeaders(config): void

Parameters

NameType
configany

Returns

void

Inherited from

ApiResource._appendReadHeaders


_appendWriteHeaders

Protected _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<ResourceT>

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<ResourceT>

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<ResourceT>

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<ResourceT>

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<ResourceT>

Parameters

NameType
ResourceTctor(args: any) => ResourceT
configany

Returns

Promise<any>

Inherited from

ApiResource.getGeneric


getMe

getMe(): Promise<IUser>

Returns

Promise<IUser>


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<ResourceT>

Parameters

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

Returns

Promise<ResourceT>

Inherited from

ApiResource.getPagedGeneric


getUserById

getUserById(userId): Promise<IUser>

Parameters

NameType
userIdstring

Returns

Promise<IUser>


getUserOrganizations

getUserOrganizations(clientId, username, password): Promise<IUser[]>

Parameters

NameType
clientIdstring
usernamestring
passwordstring

Returns

Promise<IUser[]>


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<ResourceT>

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<ResourceT>

Parameters

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

Returns

Promise<ResourceT>

Inherited from

ApiResource.updateGeneric