Class

RequestManager

Constructor

new RequestManager(options: Partial<RestOptions>)
ParamTypeDescription
optionsPartial<RestOptions>

Properties

baseUrl: string (readonly)
options: RestOptions (readonly)
rateLimiter: RateLimitManager (readonly)
routeHashCache: Map<string, string> (readonly)
token: string | null

Methods

buildBody(options: RequestOptions): string | FormData | undefined
ParamTypeDescription
optionsRequestOptions
buildHeaders(options: RequestOptions, body: string | FormData | undefined, route: string): Record<string, string>
ParamTypeDescription
optionsRequestOptions
bodystring | FormData | undefined
routestring
getRouteHash(method: string, route: string): string

Hash route for rate limiting while preserving Fluxer's major resource parameter.

ParamTypeDescription
methodstring
routestring
getToken(): string | null
parseError(response: Response, method: string, route: string): Promise<FluxerAPIError | HTTPError>
ParamTypeDescription
responseResponse
methodstring
routestring
parseSuccess(response: Response): Promise<unknown>
ParamTypeDescription
responseResponse
request(method: string, route: string, options: RequestOptions): Promise<>
ParamTypeDescription
methodstring
routestring
optionsRequestOptions
resolveRetries(method: string, routeKey: string): number
ParamTypeDescription
methodstring
routeKeystring
setToken(token: string | null): void
ParamTypeDescription
tokenstring | null