Skip to content

Class: ApiService ​

Defined in: index.ts:28

Extends ​

Constructors ​

Constructor ​

ts
new ApiService(): ApiService;

Defined in: index.ts:53

Returns ​

ApiService

Overrides ​

RESTClient.constructor

Properties ​

PropertyModifierTypeDefined in
activitypublicActivityEndpointindex.ts:49
adminpublicAdminEndpointindex.ts:38
authpublicAuthEndpointindex.ts:30
badgespublicBadgeEndpointindex.ts:47
botspublicBotEndpointindex.ts:50
calendarpublicCalendarEndpointindex.ts:51
channelpublicChannelEndpointindex.ts:32
emojipublicEmojiEndpointindex.ts:37
friendspublicFriendsEndpointindex.ts:35
gifspublicGifEndpointindex.ts:45
instancepublicInstanceEndpointindex.ts:29
livepublicLiveEndpointindex.ts:40
mediapublicMediaEndpointindex.ts:36
messagepublicMessageEndpointindex.ts:33
moderationpublicModerationEndpointindex.ts:43
notificationspublicNotificationEndpointindex.ts:44
peerpublicPeerEndpointindex.ts:42
readpublicReadEndpointindex.ts:41
rolepublicRoleEndpointindex.ts:39
searchpublicSearchEndpointindex.ts:46
serverpublicServerEndpointindex.ts:31
soundboardpublicSoundboardEndpointindex.ts:48
userpublicUserEndpointindex.ts:34

Methods ​

clearToken() ​

ts
clearToken(): void;

Defined in: client.ts:56

clear authentication token

Returns ​

void

Inherited from ​

RESTClient.clearToken


delete() ​

ts
delete<T>(url, config?): Promise<T>;

Defined in: client.ts:109

generic delete request

Type Parameters ​

Type ParameterDefault type
Tany

Parameters ​

ParameterType
urlstring
config?AxiosRequestConfig<any, any>

Returns ​

Promise<T>

Inherited from ​

RESTClient.delete


get() ​

ts
get<T>(url, config?): Promise<T>;

Defined in: client.ts:77

generic get request

Type Parameters ​

Type ParameterDefault type
Tany

Parameters ​

ParameterType
urlstring
config?AxiosRequestConfig<any, any>

Returns ​

Promise<T>

Inherited from ​

RESTClient.get


getBaseURL() ​

ts
getBaseURL(): string;

Defined in: client.ts:70

get current base url

Returns ​

string

Inherited from ​

RESTClient.getBaseURL


patch() ​

ts
patch<T>(
   url, 
   data?, 
   config?
): Promise<T>;

Defined in: client.ts:101

generic patch request

Type Parameters ​

Type ParameterDefault type
Tany

Parameters ​

ParameterType
urlstring
data?any
config?AxiosRequestConfig<any, any>

Returns ​

Promise<T>

Inherited from ​

RESTClient.patch


post() ​

ts
post<T>(
   url, 
   data?, 
   config?
): Promise<T>;

Defined in: client.ts:85

generic post request

Type Parameters ​

Type ParameterDefault type
Tany

Parameters ​

ParameterType
urlstring
data?any
config?AxiosRequestConfig<any, any>

Returns ​

Promise<T>

Inherited from ​

RESTClient.post


put() ​

ts
put<T>(
   url, 
   data?, 
   config?
): Promise<T>;

Defined in: client.ts:93

generic put request

Type Parameters ​

Type ParameterDefault type
Tany

Parameters ​

ParameterType
urlstring
data?any
config?AxiosRequestConfig<any, any>

Returns ​

Promise<T>

Inherited from ​

RESTClient.put


setBaseURL() ​

ts
setBaseURL(baseURL): void;

Defined in: client.ts:63

set base url for api requests (for dynamic server configuration)

Parameters ​

ParameterType
baseURLstring

Returns ​

void

Inherited from ​

RESTClient.setBaseURL


setClientKind() ​

ts
setClientKind(kind): void;

Defined in: client.ts:48

say which of Refract's apps is making the requests. Only the mobile app says anything: the instance takes a request that doesn't for the desktop kind, which a browser is too.

Parameters ​

ParameterType
kindIClientKind

Returns ​

void

Inherited from ​

RESTClient.setClientKind


setToken() ​

ts
setToken(token): void;

Defined in: client.ts:39

set authentication token for subsequent requests

Parameters ​

ParameterType
tokenstring | null

Returns ​

void

Inherited from ​

RESTClient.setToken

Released under the GNU Affero General Public License v3.0.