Skip to main content

Interface: RequestHandlerOptions

Options for a RequestHandler

Hierarchy

Properties

rejectIfNotValid

Optional rejectIfNotValid: boolean

Set this false to use res.ok property.

Defined in

types/lib.ts:63


connections

Optional connections: number

The max number of clients to create. null if no limit. Default null.

Defined in

types/lib.ts:66


pipelining

Optional pipelining: number

The amount of concurrent requests to be sent over the single TCP/TLS connection according to RFC7230. Default: 1

Defined in

types/lib.ts:69


onError

Optional onError: (args: { path: string ; status: number ; body: unknown }) => unknown

Type declaration

▸ (args): unknown

Parameters
NameType
argsObject
args.pathstring
args.statusnumber
args.bodyunknown
Returns

unknown

Defined in

types/lib.ts:71


keys

Optional keys: string[]

Keys from Clash of Clans API developer site.

Inherited from

ClientOptions.keys

Defined in

types/lib.ts:14


baseURL

Optional baseURL: string

Base URL of the Clash of Clans API.

Inherited from

ClientOptions.baseURL

Defined in

types/lib.ts:17


retryLimit

Optional retryLimit: number

How many times to retry on 5XX errors.

Inherited from

ClientOptions.retryLimit

Defined in

types/lib.ts:22


cache

Optional cache: boolean | Store<any>

Whether enable or disable internal caching.

Example

const client = new Client({ cache: true });

Inherited from

ClientOptions.cache

Defined in

types/lib.ts:31


restRequestTimeout

Optional restRequestTimeout: number

Time to wait before cancelling a REST request, in milliseconds.

Inherited from

ClientOptions.restRequestTimeout

Defined in

types/lib.ts:34


throttler

Optional throttler: null | QueueThrottler | BatchThrottler

Throttler class which handles rate-limit

Example

const client = new Client({ throttler: new QueueThrottler(1000 / 10) });

Example

const client = new Client({ throttler: new BatchThrottler(30) });

Inherited from

ClientOptions.throttler

Defined in

types/lib.ts:47