Class
RequestManager
Constructor
new RequestManager
(options: Partial<RestOptions>)| Param | Type | Description |
|---|---|---|
| options | Partial<RestOptions> |
Properties
baseUrl
: string (readonly)options
: RestOptions (readonly)rateLimiter
: RateLimitManager (readonly)routeHashCache
: Map<string, string> (readonly)token
: string | nullMethods
buildBody
(options: RequestOptions): string | FormData | undefined| Param | Type | Description |
|---|---|---|
| options | RequestOptions |
buildHeaders
(options: RequestOptions, body: string | FormData | undefined): Record<string, string>| Param | Type | Description |
|---|---|---|
| options | RequestOptions | |
| body | string | FormData | undefined |
getRouteHash
(route: string): stringHash route for rate limit bucket (path without snowflake ids). LRU via Map insertion order.
| Param | Type | Description |
|---|---|---|
| route | string |
getToken
(): string | nullparseError
(response: Response, method: string, route: string): Promise<FluxerAPIError | HTTPError>| Param | Type | Description |
|---|---|---|
| response | Response | |
| method | string | |
| route | string |
parseSuccess
(response: Response): Promise<unknown>| Param | Type | Description |
|---|---|---|
| response | Response |
request
(method: string, route: string, options: RequestOptions): Promise<>| Param | Type | Description |
|---|---|---|
| method | string | |
| route | string | |
| options | RequestOptions |
setToken
(token: string | null): void| Param | Type | Description |
|---|---|---|
| token | string | null |