clashofclans.js 2.0.0-dev.dedb83d → 2.0.0

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.
package/CHANGELOG.md CHANGED
@@ -2,15 +2,16 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ## 2.0.0
5
+ ## 2.0.0 (2021-11-26)
6
6
 
7
7
  This new version is a complete TypeScript rewrite to convert everything from plain (literal JSON) objects to class (constructor) objects and support a lot more features.
8
8
 
9
9
  ### Features
10
10
 
11
- - EventManager and Custom Events ([#37](https://github.com/clashperk/clashofclans.js/issues/37)) ([5027ae6](https://github.com/clashperk/clashofclans.js/commit/5027ae663a8e07175e17384c7e5706f4a1a7afb4)) ([984451d](https://github.com/clashperk/clashofclans.js/commit/30ea3240c11866008d0dae514468c0fdbb34ffd0))
12
- - Internal Caching Options ([#53](https://github.com/clashperk/clashofclans.js/issues/53))
13
- - Email Password Login ([#31](https://github.com/clashperk/clashofclans.js/issues/31)) ([4153cd3](https://github.com/clashperk/clashofclans.js/commit/4153cd37ea0e1c71550b9e892105b84d5a407e23))
14
11
  - API Date Parser and Request Retries ([#26](https://github.com/clashperk/clashofclans.js/issues/26)) ([94585f3](https://github.com/clashperk/clashofclans.js/commit/94585f3a84a7175b2d07872f9eb9e42372b95e12))
15
- - Override Request Options ([#36](https://github.com/clashperk/clashofclans.js/issues/36)) ([42d7fdd](https://github.com/clashperk/clashofclans.js/commit/42d7fdd36262cc46f23b731f8cffb9daea19d3b0))
12
+ - EventManager and Custom Events ([#37](https://github.com/clashperk/clashofclans.js/issues/37)) ([5027ae6](https://github.com/clashperk/clashofclans.js/commit/5027ae663a8e07175e17384c7e5706f4a1a7afb4))
13
+ - Email Password Login ([#31](https://github.com/clashperk/clashofclans.js/issues/31)) ([4153cd3](https://github.com/clashperk/clashofclans.js/commit/4153cd37ea0e1c71550b9e892105b84d5a407e23))
16
14
  - QueueThrottler and BatchThrottler ([#34](https://github.com/clashperk/clashofclans.js/issues/34)) ([3a8f051](https://github.com/clashperk/clashofclans.js/commit/3a8f051552e93b98f89bc7d524acdecddf242718))
15
+ - Override Request Options ([#36](https://github.com/clashperk/clashofclans.js/issues/36)) ([42d7fdd](https://github.com/clashperk/clashofclans.js/commit/42d7fdd36262cc46f23b731f8cffb9daea19d3b0))
16
+ - Internal Caching Options ([#53](https://github.com/clashperk/clashofclans.js/issues/53)) ([984451d](https://github.com/clashperk/clashofclans.js/commit/30ea3240c11866008d0dae514468c0fdbb34ffd0))
17
+ - Raw Data for Player Units ([#65](https://github.com/clashperk/clashofclans.js/pull/65)) ([aa1696](https://github.com/clashperk/clashofclans.js/commit/aa1696243d96d4fed0250b4282c60522a6482343))
package/README.md CHANGED
@@ -39,12 +39,13 @@ const client = new Client();
39
39
  ```js
40
40
  const { Client, BatchThrottler } = require('clashofclans.js');
41
41
  const client = new Client({
42
+ cache: true,
42
43
  retryLimit: 1,
43
- restRequestTimeout: 3000,
44
- throttler: new BatchThrottler(30)
44
+ restRequestTimeout: 5000,
45
+ throttler: new BatchThrottler(20)
45
46
  });
46
47
 
47
- client.events.addClans(['#8P2QG08P']);
48
+ client.events.addClans(['#8QU8J9LP', '#8P2QG08P']);
48
49
  client.events.setClanEvent({
49
50
  name: 'clanDescriptionChange',
50
51
  filter: (oldClan, newClan) => {
@@ -21,6 +21,8 @@ export declare class Client extends EventEmitter {
21
21
  constructor(options?: ClientOptions);
22
22
  /** Contains various general-purpose utility methods. */
23
23
  get util(): typeof Util;
24
+ /** Whether the API is in maintenance break. */
25
+ get inMaintenance(): boolean;
24
26
  /**
25
27
  * Initialize the client to create keys.
26
28
  * @example
@@ -76,7 +78,7 @@ export declare class Client extends EventEmitter {
76
78
  private _getClanWars;
77
79
  /** Get information about clan war league. */
78
80
  getClanWarLeagueGroup(clanTag: string, options?: OverrideOptions): Promise<ClanWarLeagueGroup>;
79
- /** Get information about CWL round by WarTag. */
81
+ /** Get info about a CWL round by WarTag. */
80
82
  getClanWarLeagueRound(warTag: string | {
81
83
  warTag: string;
82
84
  clanTag?: string;
@@ -99,9 +101,9 @@ export declare class Client extends EventEmitter {
99
101
  getClanRanks(locationId: number | 'global', options?: SearchOptions): Promise<RankedClan[]>;
100
102
  /** Get player rankings for a specific location. */
101
103
  getPlayerRanks(locationId: number | 'global', options?: SearchOptions): Promise<RankedPlayer[]>;
102
- /** Get clan versus rankings for a specific location */
104
+ /** Get clan versus rankings for a specific location. */
103
105
  getVersusClanRanks(locationId: number | 'global', options?: SearchOptions): Promise<RankedClan[]>;
104
- /** Get player versus rankings for a specific location */
106
+ /** Get player versus rankings for a specific location. */
105
107
  getVersusPlayerRanks(locationId: number | 'global', options?: SearchOptions): Promise<RankedPlayer[]>;
106
108
  /** Get list of clan labels. */
107
109
  getClanLabels(options?: SearchOptions): Promise<Label[]>;
@@ -25,6 +25,11 @@ class Client extends events_1.EventEmitter {
25
25
  get util() {
26
26
  return Util_1.Util;
27
27
  }
28
+ /** Whether the API is in maintenance break. */
29
+ get inMaintenance() {
30
+ // @ts-expect-error
31
+ return this.events._inMaintenance;
32
+ }
28
33
  /**
29
34
  * Initialize the client to create keys.
30
35
  * @example
@@ -88,7 +93,7 @@ class Client extends events_1.EventEmitter {
88
93
  }
89
94
  catch (e) {
90
95
  if (e instanceof HTTPError_1.HTTPError && [200, 403].includes(e.status)) {
91
- return this.getLeagueWar({ clanTag: args.clanTag, round: args.round });
96
+ return this.getLeagueWar({ clanTag: args.clanTag, round: args.round }, options);
92
97
  }
93
98
  throw e;
94
99
  }
@@ -117,7 +122,7 @@ class Client extends events_1.EventEmitter {
117
122
  .map((round) => round.warTags)
118
123
  .flat()
119
124
  .reverse();
120
- const wars = await this.util.allSettled(warTags.map((warTag) => this.getClanWarLeagueRound({ warTag, clanTag: args.clanTag }, { ignoreRateLimit: true })));
125
+ const wars = await this.util.allSettled(warTags.map((warTag) => this.getClanWarLeagueRound({ warTag, clanTag: args.clanTag }, { ...options, ignoreRateLimit: true })));
121
126
  if (args.round && args.round in Constants_1.CWL_ROUNDS) {
122
127
  return wars.find((war) => war.state === state) ?? null;
123
128
  }
@@ -126,7 +131,7 @@ class Client extends events_1.EventEmitter {
126
131
  async _getCurrentLeagueWars(clanTag, options) {
127
132
  const data = await this.getClanWarLeagueGroup(clanTag, options);
128
133
  // @ts-expect-error
129
- return data._getCurrentWars(clanTag);
134
+ return data._getCurrentWars(clanTag, options);
130
135
  }
131
136
  async _getClanWars(clanTag, options) {
132
137
  const date = new Date().getUTCDate();
@@ -134,11 +139,11 @@ class Client extends events_1.EventEmitter {
134
139
  return [await this.getClanWar(clanTag, options)];
135
140
  }
136
141
  try {
137
- return this._getCurrentLeagueWars(clanTag);
142
+ return this._getCurrentLeagueWars(clanTag, options);
138
143
  }
139
144
  catch (e) {
140
145
  if (e instanceof HTTPError_1.HTTPError && [404].includes(e.status)) {
141
- return [await this.getClanWar(clanTag)];
146
+ return [await this.getClanWar(clanTag, options)];
142
147
  }
143
148
  throw e;
144
149
  }
@@ -148,7 +153,7 @@ class Client extends events_1.EventEmitter {
148
153
  const { data } = await this.rest.getClanWarLeagueGroup(clanTag, options);
149
154
  return new struct_1.ClanWarLeagueGroup(this, data);
150
155
  }
151
- /** Get information about CWL round by WarTag. */
156
+ /** Get info about a CWL round by WarTag. */
152
157
  async getClanWarLeagueRound(warTag, options) {
153
158
  const args = typeof warTag === 'string' ? { warTag } : { warTag: warTag.warTag, clanTag: warTag.clanTag };
154
159
  const { data, maxAge, status, path } = await this.rest.getClanWarLeagueRound(args.warTag, options);
@@ -164,7 +169,7 @@ class Client extends events_1.EventEmitter {
164
169
  }
165
170
  /** Verify Player API token that can be found from the Game settings. */
166
171
  async verifyPlayerToken(playerTag, token, options) {
167
- const { data } = await this.rest.postPlayerToken(playerTag, token, options);
172
+ const { data } = await this.rest.verifyPlayerToken(playerTag, token, options);
168
173
  return data.status === 'ok';
169
174
  }
170
175
  /** Get list of Leagues. */
@@ -203,12 +208,12 @@ class Client extends events_1.EventEmitter {
203
208
  const { data } = await this.rest.getPlayerRanks(locationId, options);
204
209
  return data.items.map((entry) => new struct_1.RankedPlayer(this, entry));
205
210
  }
206
- /** Get clan versus rankings for a specific location */
211
+ /** Get clan versus rankings for a specific location. */
207
212
  async getVersusClanRanks(locationId, options) {
208
213
  const { data } = await this.rest.getVersusClanRanks(locationId, options);
209
214
  return data.items.map((entry) => new struct_1.RankedClan(entry));
210
215
  }
211
- /** Get player versus rankings for a specific location */
216
+ /** Get player versus rankings for a specific location. */
212
217
  async getVersusPlayerRanks(locationId, options) {
213
218
  const { data } = await this.rest.getVersusPlayerRanks(locationId, options);
214
219
  return data.items.map((entry) => new struct_1.RankedPlayer(this, entry));
@@ -15,18 +15,18 @@ export declare class EventManager {
15
15
  constructor(client: Client);
16
16
  /** Initialize the Event Manager to start pulling. */
17
17
  init(): Promise<string[]>;
18
- /** Add a clan tag to clan events. */
19
- addClans(...tags: string[]): this;
20
- /** Delete a clan tag from clan events. */
21
- deleteClans(...tags: string[]): this;
22
- /** Add a player tag for player events. */
23
- addPlayers(...tags: string[]): this;
24
- /** Delete a player tag from player events. */
25
- deletePlayers(...tags: string[]): this;
26
- /** Add a clan tag for war events. */
27
- addWars(...tags: string[]): this;
28
- /** Delete a clan tag from war events. */
29
- deleteWars(...tags: string[]): this;
18
+ /** Add clan tags to clan events. */
19
+ addClans(tags: string[] | string): this;
20
+ /** Delete clan tags from clan events. */
21
+ deleteClans(tags: string[] | string): this;
22
+ /** Add player tags for player events. */
23
+ addPlayers(tags: string[] | string): this;
24
+ /** Delete player tags from player events. */
25
+ deletePlayers(tags: string[] | string): this;
26
+ /** Add clan tags for war events. */
27
+ addWars(tags: string[] | string): this;
28
+ /** Delete clan tags from war events. */
29
+ deleteWars(tags: string[] | string): this;
30
30
  /**
31
31
  * Set your own custom clan event.
32
32
  *
@@ -31,45 +31,52 @@ class EventManager {
31
31
  this.warUpdateHandler();
32
32
  return Promise.resolve(this.client.eventNames());
33
33
  }
34
- /** Add a clan tag to clan events. */
35
- addClans(...tags) {
36
- for (const tag of tags) {
34
+ /** Add clan tags to clan events. */
35
+ addClans(tags) {
36
+ for (const tag of Array.isArray(tags) ? tags : [tags]) {
37
37
  this._clanTags.add(this.client.util.parseTag(tag));
38
38
  }
39
39
  return this;
40
40
  }
41
- /** Delete a clan tag from clan events. */
42
- deleteClans(...tags) {
43
- for (const tag of tags) {
44
- this._warTags.delete(this.client.util.parseTag(tag));
41
+ /** Delete clan tags from clan events. */
42
+ deleteClans(tags) {
43
+ for (const tag of Array.isArray(tags) ? tags : [tags]) {
44
+ const key = this.client.util.parseTag(tag);
45
+ this._clans.delete(key);
46
+ this._clanTags.delete(key);
45
47
  }
46
48
  return this;
47
49
  }
48
- /** Add a player tag for player events. */
49
- addPlayers(...tags) {
50
- for (const tag of tags) {
50
+ /** Add player tags for player events. */
51
+ addPlayers(tags) {
52
+ for (const tag of Array.isArray(tags) ? tags : [tags]) {
51
53
  this._playerTags.add(this.client.util.parseTag(tag));
52
54
  }
53
55
  return this;
54
56
  }
55
- /** Delete a player tag from player events. */
56
- deletePlayers(...tags) {
57
- for (const tag of tags) {
58
- this._warTags.delete(this.client.util.parseTag(tag));
57
+ /** Delete player tags from player events. */
58
+ deletePlayers(tags) {
59
+ for (const tag of Array.isArray(tags) ? tags : [tags]) {
60
+ const key = this.client.util.parseTag(tag);
61
+ this._players.delete(key);
62
+ this._playerTags.delete(key);
59
63
  }
60
64
  return this;
61
65
  }
62
- /** Add a clan tag for war events. */
63
- addWars(...tags) {
64
- for (const tag of tags) {
66
+ /** Add clan tags for war events. */
67
+ addWars(tags) {
68
+ for (const tag of Array.isArray(tags) ? tags : [tags]) {
65
69
  this._warTags.add(this.client.util.parseTag(tag));
66
70
  }
67
71
  return this;
68
72
  }
69
- /** Delete a clan tag from war events. */
70
- deleteWars(...tags) {
71
- for (const tag of tags) {
72
- this._warTags.delete(this.client.util.parseTag(tag));
73
+ /** Delete clan tags from war events. */
74
+ deleteWars(tags) {
75
+ for (const tag of Array.isArray(tags) ? tags : [tags]) {
76
+ const key = this.client.util.parseTag(tag);
77
+ this._wars.delete(`${key}:${1}`);
78
+ this._wars.delete(`${key}:${2}`);
79
+ this._warTags.delete(key);
73
80
  }
74
81
  return this;
75
82
  }
@@ -100,6 +107,10 @@ class EventManager {
100
107
  * @returns
101
108
  */
102
109
  setClanEvent(event) {
110
+ if (!event.name)
111
+ throw new Error('Event name is required.');
112
+ if (typeof event.filter !== 'function')
113
+ throw new Error('Filter function is required.');
103
114
  this._events.clans.push(event);
104
115
  return this;
105
116
  }
@@ -109,6 +120,10 @@ class EventManager {
109
120
  * In order to emit the custom event, you must have this filter function that returns a boolean.
110
121
  */
111
122
  setWarEvent(event) {
123
+ if (!event.name)
124
+ throw new Error('Event name is required.');
125
+ if (typeof event.filter !== 'function')
126
+ throw new Error('Filter function is required.');
112
127
  this._events.wars.push(event);
113
128
  return this;
114
129
  }
@@ -118,6 +133,10 @@ class EventManager {
118
133
  * In order to emit the custom event, you must have this filter function that returns a boolean.
119
134
  */
120
135
  setPlayerEvent(event) {
136
+ if (!event.name)
137
+ throw new Error('Event name is required.');
138
+ if (typeof event.filter !== 'function')
139
+ throw new Error('Filter function is required.');
121
140
  this._events.players.push(event);
122
141
  return this;
123
142
  }
@@ -127,7 +146,7 @@ class EventManager {
127
146
  const res = await this.client.rest.getClans({ maxMembers: Math.floor(Math.random() * 40) + 10, limit: 1 });
128
147
  if (res.status === 200 && this._inMaintenance) {
129
148
  this._inMaintenance = Boolean(false);
130
- const duration = this._maintenanceStartTime.getTime() - Date.now();
149
+ const duration = Date.now() - this._maintenanceStartTime.getTime();
131
150
  this._maintenanceStartTime = null;
132
151
  this.client.emit(Constants_1.EVENTS.MAINTENANCE_END, duration);
133
152
  }
@@ -157,21 +176,21 @@ class EventManager {
157
176
  for (const tag of this._clanTags)
158
177
  await this.runClanUpdate(tag);
159
178
  this.client.emit(Constants_1.EVENTS.CLAN_LOOP_END);
160
- setTimeout(this.clanUpdateHandler.bind(this), 10000);
179
+ setTimeout(this.clanUpdateHandler.bind(this), 10000).unref();
161
180
  }
162
181
  async playerUpdateHandler() {
163
182
  this.client.emit(Constants_1.EVENTS.PLAYER_LOOP_START);
164
183
  for (const tag of this._playerTags)
165
184
  await this.runPlayerUpdate(tag);
166
185
  this.client.emit(Constants_1.EVENTS.PLAYER_LOOP_END);
167
- setTimeout(this.playerUpdateHandler.bind(this), 10000);
186
+ setTimeout(this.playerUpdateHandler.bind(this), 10000).unref();
168
187
  }
169
188
  async warUpdateHandler() {
170
189
  this.client.emit(Constants_1.EVENTS.WAR_LOOP_START);
171
190
  for (const tag of this._warTags)
172
191
  await this.runWarUpdate(tag);
173
192
  this.client.emit(Constants_1.EVENTS.WAR_LOOP_END);
174
- setTimeout(this.warUpdateHandler.bind(this), 10000);
193
+ setTimeout(this.warUpdateHandler.bind(this), 10000).unref();
175
194
  }
176
195
  async runClanUpdate(tag) {
177
196
  if (this._inMaintenance)
@@ -222,8 +241,8 @@ class EventManager {
222
241
  const clanWars = await this.client._getClanWars(tag).catch(() => null);
223
242
  if (!clanWars?.length)
224
243
  return null;
225
- clanWars.forEach(async (war, state) => {
226
- const key = `${tag}:${state}`;
244
+ clanWars.forEach(async (war, index) => {
245
+ const key = `${tag}:${index}`;
227
246
  const cached = this._wars.get(key);
228
247
  if (!cached)
229
248
  return this._wars.set(key, war);
@@ -238,7 +257,7 @@ class EventManager {
238
257
  }
239
258
  }
240
259
  // check for war end
241
- if (state === 1 && cached.warTag !== war.warTag) {
260
+ if (index === 1 && cached.warTag !== war.warTag) {
242
261
  const data = await this.client.getLeagueWar({ clanTag: tag, round: 'PREVIOUS_ROUND' }).catch(() => null);
243
262
  if (data && data.warTag === cached.warTag) {
244
263
  for (const { name, filter } of this._events.wars) {
@@ -1,6 +1,4 @@
1
- /**
2
- * Represents an HTTP Error.
3
- */
1
+ /** Represents an HTTP Error. */
4
2
  export declare class HTTPError extends Error {
5
3
  /** The message of this error. */
6
4
  message: string;
@@ -19,9 +19,7 @@ const reasons = {
19
19
  404: 'notFound',
20
20
  504: 'requestAborted'
21
21
  };
22
- /**
23
- * Represents an HTTP Error.
24
- */
22
+ /** Represents an HTTP Error. */
25
23
  class HTTPError extends Error {
26
24
  constructor(error, status, path, maxAge, method) {
27
25
  super();
@@ -2,150 +2,55 @@ import { RequestHandler, SearchOptions, ClanSearchOptions, ClientOptions, Overri
2
2
  import { APIClan, APIClanList, APIClanMemberList, APIClanRankingList, APIClanVersusRankingList, APIClanWar, APIClanWarLeagueGroup, APIClanWarLog, APIGoldPassSeason, APILabelList, APILeague, APILeagueList, APILeagueSeasonList, APILocation, APILocationList, APIPlayer, APIPlayerRankingList, APIPlayerSeasonRankingList, APIPlayerVersusRankingList, APIVerifyToken, APIWarLeague, APIWarLeagueList } from '../types';
3
3
  /** Represents a REST Manager of the client. */
4
4
  export declare class RESTManager {
5
+ /** Request Handler for the RESTManager. */
5
6
  readonly handler: RequestHandler;
6
7
  constructor(options?: ClientOptions);
7
- getClans(options: ClanSearchOptions): Promise<{
8
- data: APIClanList;
9
- maxAge: number;
10
- status: number;
11
- path: string;
12
- }>;
13
- getClan(clanTag: string, options?: OverrideOptions): Promise<{
14
- data: APIClan;
15
- maxAge: number;
16
- status: number;
17
- path: string;
18
- }>;
19
- getClanMembers(clanTag: string, options?: SearchOptions): Promise<{
20
- data: APIClanMemberList;
21
- maxAge: number;
22
- status: number;
23
- path: string;
24
- }>;
25
- getClanWarLog(clanTag: string, options?: SearchOptions): Promise<{
26
- data: APIClanWarLog;
27
- maxAge: number;
28
- status: number;
29
- path: string;
30
- }>;
31
- getCurrentWar(clanTag: string, options?: OverrideOptions): Promise<{
32
- data: APIClanWar;
33
- maxAge: number;
34
- status: number;
35
- path: string;
36
- }>;
37
- getClanWarLeagueGroup(clanTag: string, options?: OverrideOptions): Promise<{
38
- data: APIClanWarLeagueGroup;
39
- maxAge: number;
40
- status: number;
41
- path: string;
42
- }>;
43
- getClanWarLeagueRound(warTag: string, options?: OverrideOptions): Promise<{
44
- data: APIClanWar;
45
- maxAge: number;
46
- status: number;
47
- path: string;
48
- }>;
49
- getPlayer(playerTag: string, options?: OverrideOptions): Promise<{
50
- data: APIPlayer;
51
- maxAge: number;
52
- status: number;
53
- path: string;
54
- }>;
55
- postPlayerToken(playerTag: string, token: string, options?: OverrideOptions): Promise<{
56
- data: APIVerifyToken;
57
- maxAge: number;
58
- status: number;
59
- path: string;
60
- }>;
61
- getLeagues(options?: SearchOptions): Promise<{
62
- data: APILeagueList;
63
- maxAge: number;
64
- status: number;
65
- path: string;
66
- }>;
67
- getLeague(leagueId: string | number, options?: OverrideOptions): Promise<{
68
- data: APILeague;
69
- maxAge: number;
70
- status: number;
71
- path: string;
72
- }>;
73
- getLeagueSeasons(leagueId: number, options?: SearchOptions): Promise<{
74
- data: APILeagueSeasonList;
75
- maxAge: number;
76
- status: number;
77
- path: string;
78
- }>;
79
- getSeasonRankings(leagueId: number, seasonId: string, options?: SearchOptions): Promise<{
80
- data: APIPlayerSeasonRankingList;
81
- maxAge: number;
82
- status: number;
83
- path: string;
84
- }>;
85
- getWarLeagues(options?: SearchOptions): Promise<{
86
- data: APIWarLeagueList;
87
- maxAge: number;
88
- status: number;
89
- path: string;
90
- }>;
91
- getWarLeague(leagueId: number, options?: OverrideOptions): Promise<{
92
- data: APIWarLeague;
93
- maxAge: number;
94
- status: number;
95
- path: string;
96
- }>;
97
- getLocations(options?: SearchOptions): Promise<{
98
- data: APILocationList;
99
- maxAge: number;
100
- status: number;
101
- path: string;
102
- }>;
103
- getLocation(locationId: number, options?: OverrideOptions): Promise<{
104
- data: APILocation;
105
- maxAge: number;
106
- status: number;
107
- path: string;
108
- }>;
109
- getClanRanks(locationId: number | string, options?: SearchOptions): Promise<{
110
- data: APIClanRankingList;
111
- maxAge: number;
112
- status: number;
113
- path: string;
114
- }>;
115
- getPlayerRanks(locationId: number | string, options?: SearchOptions): Promise<{
116
- data: APIPlayerRankingList;
117
- maxAge: number;
118
- status: number;
119
- path: string;
120
- }>;
121
- getVersusClanRanks(locationId: number | string, options?: SearchOptions): Promise<{
122
- data: APIClanVersusRankingList;
123
- maxAge: number;
124
- status: number;
125
- path: string;
126
- }>;
127
- getVersusPlayerRanks(locationId: number | string, options?: SearchOptions): Promise<{
128
- data: APIPlayerVersusRankingList;
129
- maxAge: number;
130
- status: number;
131
- path: string;
132
- }>;
133
- getClanLabels(options?: SearchOptions): Promise<{
134
- data: APILabelList;
135
- maxAge: number;
136
- status: number;
137
- path: string;
138
- }>;
139
- getPlayerLabels(options?: SearchOptions): Promise<{
140
- data: APILabelList;
141
- maxAge: number;
142
- status: number;
143
- path: string;
144
- }>;
145
- getGoldPassSeason(options?: OverrideOptions): Promise<{
146
- data: APIGoldPassSeason;
147
- maxAge: number;
148
- status: number;
149
- path: string;
150
- }>;
8
+ /** Search all clans by name and/or filtering the results using various criteria. */
9
+ getClans(options: ClanSearchOptions): Promise<import("./RequestHandler").Response<APIClanList>>;
10
+ /** Get information about a clan. */
11
+ getClan(clanTag: string, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APIClan>>;
12
+ /** Get list of clan members. */
13
+ getClanMembers(clanTag: string, options?: SearchOptions): Promise<import("./RequestHandler").Response<APIClanMemberList>>;
14
+ /** Get clan war log. */
15
+ getClanWarLog(clanTag: string, options?: SearchOptions): Promise<import("./RequestHandler").Response<APIClanWarLog>>;
16
+ /** Get info about currently running war in the clan. */
17
+ getCurrentWar(clanTag: string, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APIClanWar>>;
18
+ /** Get information about clan war league. */
19
+ getClanWarLeagueGroup(clanTag: string, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APIClanWarLeagueGroup>>;
20
+ /** Get info about a CWL round by WarTag. */
21
+ getClanWarLeagueRound(warTag: string, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APIClanWar>>;
22
+ /** Get information about a player by tag. */
23
+ getPlayer(playerTag: string, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APIPlayer>>;
24
+ /** Verify Player API token that can be found from the Game settings. */
25
+ verifyPlayerToken(playerTag: string, token: string, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APIVerifyToken>>;
26
+ /** Get list of Leagues. */
27
+ getLeagues(options?: SearchOptions): Promise<import("./RequestHandler").Response<APILeagueList>>;
28
+ /** Get a League info. */
29
+ getLeague(leagueId: string | number, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APILeague>>;
30
+ /** Get Legend League season Ids. */
31
+ getLeagueSeasons(leagueId: number, options?: SearchOptions): Promise<import("./RequestHandler").Response<APILeagueSeasonList>>;
32
+ /** Get Legend League season rankings by season Id. */
33
+ getSeasonRankings(leagueId: number, seasonId: string, options?: SearchOptions): Promise<import("./RequestHandler").Response<APIPlayerSeasonRankingList>>;
34
+ /** Get list of Clan War Leagues. */
35
+ getWarLeagues(options?: SearchOptions): Promise<import("./RequestHandler").Response<APIWarLeagueList>>;
36
+ /** Get info about a Clan War League. */
37
+ getWarLeague(leagueId: number, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APIWarLeague>>;
38
+ /** Get list of Locations. */
39
+ getLocations(options?: SearchOptions): Promise<import("./RequestHandler").Response<APILocationList>>;
40
+ /** Get info about a Location. */
41
+ getLocation(locationId: number, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APILocation>>;
42
+ /** Get clan rankings for a specific location. */
43
+ getClanRanks(locationId: number | string, options?: SearchOptions): Promise<import("./RequestHandler").Response<APIClanRankingList>>;
44
+ /** Get player rankings for a specific location. */
45
+ getPlayerRanks(locationId: number | string, options?: SearchOptions): Promise<import("./RequestHandler").Response<APIPlayerRankingList>>;
46
+ /** Get clan versus rankings for a specific location. */
47
+ getVersusClanRanks(locationId: number | string, options?: SearchOptions): Promise<import("./RequestHandler").Response<APIClanVersusRankingList>>;
48
+ /** Get player versus rankings for a specific location. */
49
+ getVersusPlayerRanks(locationId: number | string, options?: SearchOptions): Promise<import("./RequestHandler").Response<APIPlayerVersusRankingList>>;
50
+ /** Get list of clan labels. */
51
+ getClanLabels(options?: SearchOptions): Promise<import("./RequestHandler").Response<APILabelList>>;
52
+ /** Get list of player labels. */
53
+ getPlayerLabels(options?: SearchOptions): Promise<import("./RequestHandler").Response<APILabelList>>;
54
+ /** Get info about gold pass season. */
55
+ getGoldPassSeason(options?: OverrideOptions): Promise<import("./RequestHandler").Response<APIGoldPassSeason>>;
151
56
  }