class REST
extends
AsyncEventEmitter<RestEventsMap>export declare class REST extends AsyncEventEmitter<RestEventsMap>
Represents the class that manages handlers for endpoints
Dispatcher | null agent :
The Agent for all requests performed by this manager.
readonlyCDN cdn :
number globalRemaining :
The number of requests remaining in the global bucket
number globalReset :
The timestamp at which the global bucket resets
readonlyCollection<string, IHandler> handlers :
Request handlers created from the bucket hash and the major parameters
readonlyCollection<string, HashData> hashes :
API bucket hashes that are cached from provided routes
readonlyRESTOptions options :
clearHandlerSweepervoid () :
Stops the request handler sweeping interval
clearHashSweepervoid () :
Stops the hash sweeping interval
deletefullRoute: RouteLikeoptions?: RequestData) : Promise<unknown> (
Runs a delete request from the api
getfullRoute: RouteLikeoptions?: RequestData) : Promise<unknown> (
Runs a get request from the api
patchfullRoute: RouteLikeoptions?: RequestData) : Promise<unknown> (
Runs a patch request from the api
postfullRoute: RouteLikeoptions?: RequestData) : Promise<unknown> (
Runs a post request from the api
putfullRoute: RouteLikeoptions?: RequestData) : Promise<unknown> (
Runs a put request from the api
queueRequestrequest: InternalRequest) : Promise<ResponseLike> (
Queues a request to be sent
Returns: The response from the api request
requestoptions: InternalRequest) : Promise<unknown> (
Runs a request from the api
setAgentagent: Dispatcher) : this (
Sets the default agent to use for requests performed by this manager
setTokentoken: string) : this (
Sets the authorization token that should be used for requests