File

api/api.service.ts

Index

Properties
Methods

Constructor

constructor(client: FetchClient)
Parameters :
Name Type Optional
client FetchClient No

Methods

addInterceptor
addInterceptor(interceptor: HttpInterceptor, id?: string)

Allows to intercept requests performed via the FetchClient requests.

Parameters :
Name Type Optional Description
interceptor HttpInterceptor No

The interceptor to be added.

id string Yes

An optional unique identifier for the interceptor. The chain of interceptors is ordered by this id. And it can be used to remove the interceptor later on.

Returns : string

The id of the interceptor (same as provided id if one was provided, otherwise an id will be generated).

excludePermissionCall
excludePermissionCall()

Can be added to a pipe to exclude any permission call. Permission calls are PUT request with only an id in it, to verify if the user has access to this managed object.

The operator to be added to a pipe.

hasInterceptor
hasInterceptor(id: string)

Checks if an interceptor with a given id exists.

Parameters :
Name Type Optional Description
id string No

The id of the interceptor.

Returns : boolean
  • Returns true if an interceptor with the given id exists, otherwise false.
hookRequest
hookRequest(hookFilter: (call: ApiCall) => void)

Allows to hook into the requests performed by the FetchClient. This is meant to be used to react on the requests, not for manipulation of the requests.

Parameters :
Name Type Optional Description
hookFilter function No

A filter function to filter for specific requests.

Returns : any

An Observable of the filtered requests.

hookResponse
hookResponse(hookFilter: (call: ApiCall) => void)

Allows to hook into the responses received by the FetchClient. This is meant to be used to react on the responses, not for manipulation of the responses.

Parameters :
Name Type Optional Description
hookFilter function No

A filter function to filter for specific responses.

Returns : any

An Observable of the filtered responses.

onFinish
onFinish(call: ApiCall)
Parameters :
Name Type Optional
call ApiCall No
Returns : void
onStart
onStart(call: ApiCall)
Parameters :
Name Type Optional
call ApiCall No
Returns : void
removeInterceptor
removeInterceptor(id: string)

Allows to remove a previously added interceptor by it's id.

Parameters :
Name Type Optional Description
id string No

The id of the interceptor that should be removed.

Returns : boolean

true if an interceptor existed and has been removed, or false if id does not exist.

resolveData
resolveData(call: ApiCall)
Type parameters :
  • T
Parameters :
Name Type Optional
call ApiCall No
Returns : Promise<literal type>

Properties

calls
Type : Observable<ApiCall>

results matching ""

    No results matching ""