clashofclans.js 3.1.3-dev.33beb68 → 3.1.3-dev.aa3a114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -36,8 +36,8 @@ class RequestHandler extends node_events_1.EventEmitter {
|
|
|
36
36
|
else
|
|
37
37
|
this.cached = options?.cache === true ? new Store_1.CacheStore() : null;
|
|
38
38
|
this.dispatcher = new undici_1.Pool(new URL(this.baseURL).origin, {
|
|
39
|
-
connections:
|
|
40
|
-
pipelining:
|
|
39
|
+
connections: options?.connections ?? null,
|
|
40
|
+
pipelining: options?.pipelining ?? 1
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
get _keys() {
|
|
@@ -46,7 +46,7 @@ export declare class ClanWarLeagueRound {
|
|
|
46
46
|
export declare class ClanWarLeagueGroup {
|
|
47
47
|
private readonly client;
|
|
48
48
|
/** The CWL group's current war state. */
|
|
49
|
-
state: 'preparation' | 'inWar' | 'ended';
|
|
49
|
+
state: 'preparation' | 'inWar' | 'ended' | 'notInWar';
|
|
50
50
|
/** Season Id of this CWL group. */
|
|
51
51
|
season: string;
|
|
52
52
|
/** Returns all participating clans. */
|
|
@@ -54,6 +54,8 @@ export declare class ClanWarLeagueGroup {
|
|
|
54
54
|
/** An array containing all war tags for each round. */
|
|
55
55
|
rounds: ClanWarLeagueRound[];
|
|
56
56
|
constructor(client: Client, data: APIClanWarLeagueGroup);
|
|
57
|
+
/** Whether the clan is not in CWL group. */
|
|
58
|
+
get isNotInWar(): boolean;
|
|
57
59
|
/** Total number of rounds for this CWL. */
|
|
58
60
|
get totalRounds(): number;
|
|
59
61
|
/**
|
|
@@ -49,11 +49,16 @@ exports.ClanWarLeagueRound = ClanWarLeagueRound;
|
|
|
49
49
|
class ClanWarLeagueGroup {
|
|
50
50
|
constructor(client, data) {
|
|
51
51
|
this.client = client;
|
|
52
|
-
// @ts-expect-error
|
|
53
52
|
this.state = data.state;
|
|
54
|
-
this.
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
if (this.state !== 'notInWar') {
|
|
54
|
+
this.season = data.season;
|
|
55
|
+
this.clans = data.clans.map((clan) => new ClanWarLeagueClan(client, clan));
|
|
56
|
+
this.rounds = data.rounds.map((round, i) => new ClanWarLeagueRound(round, i));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/** Whether the clan is not in CWL group. */
|
|
60
|
+
get isNotInWar() {
|
|
61
|
+
return this.state === 'notInWar';
|
|
57
62
|
}
|
|
58
63
|
/** Total number of rounds for this CWL. */
|
|
59
64
|
get totalRounds() {
|
package/dist/types/lib.d.ts
CHANGED
|
@@ -50,6 +50,10 @@ export interface PollingClientOptions extends ClientOptions {
|
|
|
50
50
|
export interface RequestHandlerOptions extends ClientOptions {
|
|
51
51
|
/** Set this `false` to use `res.ok` property. */
|
|
52
52
|
rejectIfNotValid?: boolean;
|
|
53
|
+
/** The max number of clients to create. null if no limit. Default null. */
|
|
54
|
+
connections?: number;
|
|
55
|
+
/** The amount of concurrent requests to be sent over the single TCP/TLS connection according to RFC7230. Default: 1 */
|
|
56
|
+
pipelining?: number;
|
|
53
57
|
}
|
|
54
58
|
/** Search options for request. */
|
|
55
59
|
export interface SearchOptions extends OverrideOptions {
|
package/package.json
CHANGED