clashofclans.js 2.3.0-dev.b07e37b → 2.4.0-dev.cedc2ac

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,6 +2,19 @@
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.4.0 (2021-12-28)
6
+
7
+ ### Features
8
+
9
+ - `ClanWar#getClanWarLeagueGroup`, `ClanWar#isCWL` and `ClanWar#isFriendly` are now available. ([#87](https://github.com/clashperk/clashofclans.js/pull/87))
10
+ - `RESTOptions#rejectIfNotValid` added to perform `res.ok` operations over `RESTManager` methods. [Know more?](https://clashofclans.js.org/guide/access-raw-data#easy-access) ([#87](https://github.com/clashperk/clashofclans.js/pull/87))
11
+ - `Icon#fileName` and `Icon#sizes` are now available in `Icon` class. ([#87](https://github.com/clashperk/clashofclans.js/pull/87))
12
+ - `Badge#fileName` and `Badge#sizes` are now available in `Badge` class. ([#87](https://github.com/clashperk/clashofclans.js/pull/87))
13
+
14
+ ### Deprecations
15
+
16
+ - `ClanWarMember#previousBestOpponentAttack` has been deprecated. Use `ClanWarAttack#previousBestAttack` instead. ([#87](https://github.com/clashperk/clashofclans.js/pull/87))
17
+
5
18
  ## 2.3.0 (2021-12-17)
6
19
 
7
20
  ### Features
package/LICENSE CHANGED
@@ -1,7 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020 - 2021 csuvajit
4
- Copyright (c) 2020 - 2021 TheLearneer
3
+ Copyright (c) 2020 - 2021 ClashPerk
5
4
 
6
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { ClanSearchOptions, SearchOptions, ClientOptions, InitOptions, OverrideOptions } from '../rest/RequestHandler';
2
+ import { ClanSearchOptions, SearchOptions, ClientOptions, LoginOptions, OverrideOptions } from '../types';
3
3
  import { EVENTS, CWL_ROUNDS } from '../util/Constants';
4
4
  import { RESTManager } from '../rest/RESTManager';
5
5
  import { EventManager } from './EventManager';
@@ -31,7 +31,7 @@ export declare class Client extends EventEmitter {
31
31
  * client.login({ email: 'developer@email.com', password: '***' });
32
32
  * ```
33
33
  */
34
- login(options: InitOptions): Promise<string[]>;
34
+ login(options: LoginOptions): Promise<string[]>;
35
35
  /** Set Clash of Clans API keys. */
36
36
  setKeys(keys: string[]): this;
37
37
  /** Search all clans by name and/or filtering the results using various criteria. */
@@ -1,56 +1,56 @@
1
- import { RequestHandler, SearchOptions, ClanSearchOptions, RESTOptions, OverrideOptions } from './RequestHandler';
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';
1
+ import { RequestHandler } from './RequestHandler';
2
+ import { APIClan, APIClanList, APIClanMemberList, APIClanRankingList, APIClanVersusRankingList, APIClanWar, APIClanWarLeagueGroup, APIClanWarLog, APIGoldPassSeason, APILabelList, APILeague, APILeagueList, APILeagueSeasonList, APILocation, APILocationList, APIPlayer, APIPlayerRankingList, APIPlayerSeasonRankingList, APIPlayerVersusRankingList, APIVerifyToken, APIWarLeague, APIWarLeagueList, SearchOptions, ClanSearchOptions, RESTOptions, OverrideOptions } from '../types';
3
3
  /** Represents a REST Manager of the client. */
4
4
  export declare class RESTManager {
5
5
  /** Request Handler for the RESTManager. */
6
6
  readonly handler: RequestHandler;
7
7
  constructor(options?: RESTOptions);
8
8
  /** Search all clans by name and/or filtering the results using various criteria. */
9
- getClans(query: ClanSearchOptions, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APIClanList>>;
9
+ getClans(query: ClanSearchOptions, options?: OverrideOptions): Promise<import("../types").Response<APIClanList>>;
10
10
  /** Get info about a clan. */
11
- getClan(clanTag: string, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APIClan>>;
11
+ getClan(clanTag: string, options?: OverrideOptions): Promise<import("../types").Response<APIClan>>;
12
12
  /** Get list of clan members. */
13
- getClanMembers(clanTag: string, options?: SearchOptions): Promise<import("./RequestHandler").Response<APIClanMemberList>>;
13
+ getClanMembers(clanTag: string, options?: SearchOptions): Promise<import("../types").Response<APIClanMemberList>>;
14
14
  /** Get clan war log. */
15
- getClanWarLog(clanTag: string, options?: SearchOptions): Promise<import("./RequestHandler").Response<APIClanWarLog>>;
15
+ getClanWarLog(clanTag: string, options?: SearchOptions): Promise<import("../types").Response<APIClanWarLog>>;
16
16
  /** Get info about currently running war in the clan. */
17
- getCurrentWar(clanTag: string, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APIClanWar>>;
17
+ getCurrentWar(clanTag: string, options?: OverrideOptions): Promise<import("../types").Response<APIClanWar>>;
18
18
  /** Get info about clan war league. */
19
- getClanWarLeagueGroup(clanTag: string, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APIClanWarLeagueGroup>>;
19
+ getClanWarLeagueGroup(clanTag: string, options?: OverrideOptions): Promise<import("../types").Response<APIClanWarLeagueGroup>>;
20
20
  /** Get info about a CWL round by WarTag. */
21
- getClanWarLeagueRound(warTag: string, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APIClanWar>>;
21
+ getClanWarLeagueRound(warTag: string, options?: OverrideOptions): Promise<import("../types").Response<APIClanWar>>;
22
22
  /** Get info about a player by tag. */
23
- getPlayer(playerTag: string, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APIPlayer>>;
23
+ getPlayer(playerTag: string, options?: OverrideOptions): Promise<import("../types").Response<APIPlayer>>;
24
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>>;
25
+ verifyPlayerToken(playerTag: string, token: string, options?: OverrideOptions): Promise<import("../types").Response<APIVerifyToken>>;
26
26
  /** Get list of Leagues. */
27
- getLeagues(options?: SearchOptions): Promise<import("./RequestHandler").Response<APILeagueList>>;
27
+ getLeagues(options?: SearchOptions): Promise<import("../types").Response<APILeagueList>>;
28
28
  /** Get a League info. */
29
- getLeague(leagueId: string | number, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APILeague>>;
29
+ getLeague(leagueId: string | number, options?: OverrideOptions): Promise<import("../types").Response<APILeague>>;
30
30
  /** Get Legend League season Ids. */
31
- getLeagueSeasons(leagueId: number, options?: SearchOptions): Promise<import("./RequestHandler").Response<APILeagueSeasonList>>;
31
+ getLeagueSeasons(leagueId: number, options?: SearchOptions): Promise<import("../types").Response<APILeagueSeasonList>>;
32
32
  /** Get Legend League season rankings by season Id. */
33
- getSeasonRankings(leagueId: number, seasonId: string, options?: SearchOptions): Promise<import("./RequestHandler").Response<APIPlayerSeasonRankingList>>;
33
+ getSeasonRankings(leagueId: number, seasonId: string, options?: SearchOptions): Promise<import("../types").Response<APIPlayerSeasonRankingList>>;
34
34
  /** Get list of Clan War Leagues. */
35
- getWarLeagues(options?: SearchOptions): Promise<import("./RequestHandler").Response<APIWarLeagueList>>;
35
+ getWarLeagues(options?: SearchOptions): Promise<import("../types").Response<APIWarLeagueList>>;
36
36
  /** Get info about a Clan War League. */
37
- getWarLeague(leagueId: number, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APIWarLeague>>;
37
+ getWarLeague(leagueId: number, options?: OverrideOptions): Promise<import("../types").Response<APIWarLeague>>;
38
38
  /** Get list of Locations. */
39
- getLocations(options?: SearchOptions): Promise<import("./RequestHandler").Response<APILocationList>>;
39
+ getLocations(options?: SearchOptions): Promise<import("../types").Response<APILocationList>>;
40
40
  /** Get info about a Location. */
41
- getLocation(locationId: number, options?: OverrideOptions): Promise<import("./RequestHandler").Response<APILocation>>;
41
+ getLocation(locationId: number, options?: OverrideOptions): Promise<import("../types").Response<APILocation>>;
42
42
  /** Get clan rankings for a specific location. */
43
- getClanRanks(locationId: number | string, options?: SearchOptions): Promise<import("./RequestHandler").Response<APIClanRankingList>>;
43
+ getClanRanks(locationId: number | string, options?: SearchOptions): Promise<import("../types").Response<APIClanRankingList>>;
44
44
  /** Get player rankings for a specific location. */
45
- getPlayerRanks(locationId: number | string, options?: SearchOptions): Promise<import("./RequestHandler").Response<APIPlayerRankingList>>;
45
+ getPlayerRanks(locationId: number | string, options?: SearchOptions): Promise<import("../types").Response<APIPlayerRankingList>>;
46
46
  /** Get clan versus rankings for a specific location. */
47
- getVersusClanRanks(locationId: number | string, options?: SearchOptions): Promise<import("./RequestHandler").Response<APIClanVersusRankingList>>;
47
+ getVersusClanRanks(locationId: number | string, options?: SearchOptions): Promise<import("../types").Response<APIClanVersusRankingList>>;
48
48
  /** Get player versus rankings for a specific location. */
49
- getVersusPlayerRanks(locationId: number | string, options?: SearchOptions): Promise<import("./RequestHandler").Response<APIPlayerVersusRankingList>>;
49
+ getVersusPlayerRanks(locationId: number | string, options?: SearchOptions): Promise<import("../types").Response<APIPlayerVersusRankingList>>;
50
50
  /** Get list of clan labels. */
51
- getClanLabels(options?: SearchOptions): Promise<import("./RequestHandler").Response<APILabelList>>;
51
+ getClanLabels(options?: SearchOptions): Promise<import("../types").Response<APILabelList>>;
52
52
  /** Get list of player labels. */
53
- getPlayerLabels(options?: SearchOptions): Promise<import("./RequestHandler").Response<APILabelList>>;
53
+ getPlayerLabels(options?: SearchOptions): Promise<import("../types").Response<APILabelList>>;
54
54
  /** Get info about gold pass season. */
55
- getGoldPassSeason(options?: OverrideOptions): Promise<import("./RequestHandler").Response<APIGoldPassSeason>>;
55
+ getGoldPassSeason(options?: OverrideOptions): Promise<import("../types").Response<APIGoldPassSeason>>;
56
56
  }
@@ -1,5 +1,4 @@
1
- import { QueueThrottler, BatchThrottler } from './Throttler';
2
- import Keyv from 'keyv';
1
+ import { RESTOptions, Response, RequestOptions, LoginOptions } from '../types';
3
2
  /** Represents a Request Handler. */
4
3
  export declare class RequestHandler {
5
4
  #private;
@@ -21,7 +20,7 @@ export declare class RequestHandler {
21
20
  setKeys(keys: string[]): this;
22
21
  request<T>(path: string, options?: RequestOptions): Promise<Response<T>>;
23
22
  private exec;
24
- init(options: InitOptions): Promise<string[]>;
23
+ init(options: LoginOptions): Promise<string[]>;
25
24
  private reValidateKeys;
26
25
  private login;
27
26
  private getKeys;
@@ -29,142 +28,3 @@ export declare class RequestHandler {
29
28
  private createKey;
30
29
  private getIp;
31
30
  }
32
- /** Options for a Client. */
33
- export interface ClientOptions {
34
- /** Keys from Clash of Clans API developer site. */
35
- keys?: string[];
36
- /** Base URL of the Clash of Clans API. */
37
- baseURL?: string;
38
- /**
39
- * How many times to retry on 5XX errors.
40
- */
41
- retryLimit?: number;
42
- /**
43
- * Whether enable or disable internal caching.
44
- * @example
45
- * ```ts
46
- * const client = new Client({ cache: true });
47
- * ```
48
- */
49
- cache?: boolean | Keyv;
50
- /** Time to wait before cancelling a REST request, in milliseconds. */
51
- restRequestTimeout?: number;
52
- /**
53
- * Throttler class which handles rate-limit
54
- * @example
55
- * ```ts
56
- * const client = new Client({ throttler: new QueueThrottler(1000 / 10) });
57
- * ```
58
- * @example
59
- * ```ts
60
- * const client = new Client({ throttler: new BatchThrottler(30) });
61
- * ```
62
- */
63
- throttler?: QueueThrottler | BatchThrottler;
64
- }
65
- /** Options for a RESTManager. */
66
- export interface RESTOptions extends ClientOptions {
67
- /** Set this `false` to use `res.ok` property. */
68
- rejectIfNotValid?: boolean;
69
- }
70
- /** Search options for request. */
71
- export interface SearchOptions extends OverrideOptions {
72
- /** Limit the number of items returned in the response. */
73
- limit?: number;
74
- /**
75
- * Return only items that occur after this marker.
76
- * Before marker can be found from the response, inside the 'paging' property.
77
- * Note that only after or before can be specified for a request, not both.
78
- */
79
- after?: string;
80
- /**
81
- * Return only items that occur before this marker.
82
- * Before marker can be found from the response, inside the 'paging' property.
83
- * Note that only after or before can be specified for a request, not both.
84
- */
85
- before?: string;
86
- }
87
- /** Override options for a request. */
88
- export interface OverrideOptions {
89
- /** Whether to cache this response. */
90
- cache?: boolean;
91
- /** Whether to skip the cache check and request the API. */
92
- force?: boolean;
93
- /** How many times to retry on 5XX errors. */
94
- retryLimit?: string;
95
- /** Whether to ignore throttlers. */
96
- ignoreRateLimit?: boolean;
97
- /** Time to wait before cancelling a REST request, in milliseconds. */
98
- restRequestTimeout?: number;
99
- }
100
- export interface RequestOptions extends OverrideOptions {
101
- /** The request body. */
102
- body?: string;
103
- /** The request method. */
104
- method?: string;
105
- }
106
- export interface Response<T> {
107
- /** Whether the response is ok. */
108
- ok: boolean;
109
- /** The response body. */
110
- data: T;
111
- /** Path of the request for this response. */
112
- path: string;
113
- /** HTTP status code of this response. */
114
- status: number;
115
- /** The maxAge of this response. */
116
- maxAge: number;
117
- }
118
- /**
119
- * Clan search options for a request.
120
- *
121
- * ::info
122
- * If name is used as part of search query, it needs to be at least three characters long.
123
- * Name search parameter is interpreted as wild card search, so it may appear anywhere in the clan name.
124
- * :::
125
- */
126
- export interface ClanSearchOptions {
127
- /** Search clans by name. */
128
- name?: string;
129
- /** Filter by minimum number of clan members. */
130
- minMembers?: number;
131
- /** Filter by maximum number of clan members. */
132
- maxMembers?: number;
133
- /** Filter by minimum amount of clan points. */
134
- minClanPoints?: number;
135
- /** Filter by minimum clan level. */
136
- minClanLevel?: number;
137
- /** Filter by clan war frequency. */
138
- warFrequency?: string;
139
- /** Filter by clan location identifier. For list of available locations, refer to getLocations operation. */
140
- locationId?: string;
141
- /** Comma separated list of label IDs to use for filtering results. */
142
- labelIds?: string;
143
- /** Limit the number of items returned in the response. */
144
- limit?: number;
145
- /**
146
- * Return only items that occur after this marker.
147
- * Before marker can be found from the response, inside the 'paging' property.
148
- * Note that only after or before can be specified for a request, not both.
149
- */
150
- after?: string;
151
- /**
152
- * Return only items that occur before this marker.
153
- * Before marker can be found from the response, inside the 'paging' property.
154
- * Note that only after or before can be specified for a request, not both.
155
- */
156
- before?: string;
157
- }
158
- /** Login options for a client. */
159
- export interface InitOptions {
160
- /** Developer site email address. */
161
- email: string;
162
- /** Developer site password. */
163
- password: string;
164
- /** Name of API key(s). */
165
- keyName?: string;
166
- /** Number of allowed API keys. */
167
- keyCount?: number;
168
- /** Description of API key(s). */
169
- keyDescription?: string;
170
- }
@@ -1,11 +1,10 @@
1
- import { OverrideOptions } from '../rest/RequestHandler';
1
+ import { APIClan, OverrideOptions } from '../types';
2
2
  import { ChatLanguage } from './ChatLanguage';
3
3
  import { ClanMember } from './ClanMember';
4
4
  import { Client } from '../client/Client';
5
5
  import { WarLeague } from './WarLeague';
6
6
  import type { Player } from './Player';
7
7
  import { Location } from './Location';
8
- import { APIClan } from '../types';
9
8
  import { Label } from './Label';
10
9
  import { Badge } from './Badge';
11
10
  /** Represents a Clan. */
@@ -1,6 +1,5 @@
1
- import { OverrideOptions } from '../rest/RequestHandler';
1
+ import { APIClanMember, OverrideOptions } from '../types';
2
2
  import { Client } from '../client/Client';
3
- import { APIClanMember } from '../types';
4
3
  import { League } from './League';
5
4
  export declare class ClanMember {
6
5
  client: Client;
@@ -1,5 +1,4 @@
1
- import { APIClanWarLeagueClan, APIClanWarLeagueClanMember, APIClanWarLeagueGroup, APIClanWarLeagueRound } from '../types';
2
- import { OverrideOptions } from '../rest/RequestHandler';
1
+ import { APIClanWarLeagueClan, APIClanWarLeagueClanMember, APIClanWarLeagueGroup, APIClanWarLeagueRound, OverrideOptions } from '../types';
3
2
  import { Client } from '../client/Client';
4
3
  import { ClanWar } from './ClanWar';
5
4
  import { Player } from './Player';
@@ -4,10 +4,8 @@ import { Badge } from './Badge';
4
4
  /**
5
5
  * Represents War Log Clan.
6
6
  *
7
- * :::caution
8
7
  * If this is called via {@link ClanWarLog.opponent}, then {@link WarLogClan.attackCount} and {@link WarLogClan.expEarned} will be `null`.
9
8
  * For CWL entries {@link WarLogClan.name} and {@link WarLogClan.tag} are `null`.
10
- * :::
11
9
  */
12
10
  export declare class WarLogClan {
13
11
  /** The clan's name. This property is `null` CWL entries. */
@@ -6,10 +6,8 @@ const Badge_1 = require("./Badge");
6
6
  /**
7
7
  * Represents War Log Clan.
8
8
  *
9
- * :::caution
10
9
  * If this is called via {@link ClanWarLog.opponent}, then {@link WarLogClan.attackCount} and {@link WarLogClan.expEarned} will be `null`.
11
10
  * For CWL entries {@link WarLogClan.name} and {@link WarLogClan.tag} are `null`.
12
- * :::
13
11
  */
14
12
  class WarLogClan {
15
13
  constructor(data) {
@@ -1,10 +1,9 @@
1
- import { OverrideOptions } from '../rest/RequestHandler';
1
+ import { APIPlayer, OverrideOptions } from '../types';
2
2
  import { LegendStatistics } from './LegendStatistics';
3
3
  import { Achievement } from './Achievement';
4
4
  import { Hero, Spell, Troop } from './Unit';
5
5
  import { PlayerClan } from './PlayerClan';
6
6
  import { Client } from '../client/Client';
7
- import { APIPlayer } from '../types';
8
7
  import { League } from './League';
9
8
  import { Label } from './Label';
10
9
  /** Represents a Clash of Clans Player. */
@@ -1,6 +1,5 @@
1
- import { OverrideOptions } from '../rest/RequestHandler';
1
+ import { OverrideOptions, APIPlayerClan } from '../types';
2
2
  import { Client } from '../client/Client';
3
- import { APIPlayerClan } from '../types';
4
3
  import { Badge } from './Badge';
5
4
  /** Represents a Player's clan. */
6
5
  export declare class PlayerClan {
@@ -0,0 +1,351 @@
1
+ export interface APIPaging {
2
+ cursors?: APICursors;
3
+ }
4
+ export interface APICursors {
5
+ after?: string;
6
+ before?: string;
7
+ }
8
+ export interface APIIcon {
9
+ small: string;
10
+ /** Tiny Icon is not available for Labels. */
11
+ tiny?: string;
12
+ /** Medium Icon is not available for Unranked Icon. */
13
+ medium?: string;
14
+ }
15
+ export interface APIBadge {
16
+ small: string;
17
+ large: string;
18
+ medium: string;
19
+ }
20
+ export interface APISeason {
21
+ id: string;
22
+ rank: number;
23
+ trophies: number;
24
+ }
25
+ /** /clans?name={name}&limit={limit} */
26
+ export interface APIClanList {
27
+ items: Omit<APIClan, 'memberList'>[];
28
+ paging: APIPaging;
29
+ }
30
+ export interface APIChatLanguage {
31
+ name: string;
32
+ id: number;
33
+ languageCode: string;
34
+ }
35
+ /** /clans/{clanTag} */
36
+ export interface APIClan {
37
+ tag: string;
38
+ name: string;
39
+ type: 'open' | 'inviteOnly' | 'closed';
40
+ description: string;
41
+ location?: APILocation;
42
+ chatLanguage?: APIChatLanguage;
43
+ badgeUrls: APIBadge;
44
+ clanLevel: number;
45
+ clanPoints: number;
46
+ clanVersusPoints: number;
47
+ requiredTrophies: number;
48
+ requiredTownhallLevel?: number;
49
+ warFrequency: 'always' | 'moreThanOncePerWeek' | 'oncePerWeek' | 'lessThanOncePerWeek' | 'never' | 'unknown';
50
+ warWinStreak: number;
51
+ warWins: number;
52
+ warTies?: number;
53
+ warLosses?: number;
54
+ isWarLogPublic: boolean;
55
+ warLeague?: APIWarLeague;
56
+ members: number;
57
+ labels: APILabel[];
58
+ memberList: APIClanMember[];
59
+ }
60
+ export interface APIClanMember {
61
+ name: string;
62
+ tag: string;
63
+ role: 'member' | 'admin' | 'coLeader' | 'leader';
64
+ expLevel: number;
65
+ league: APILeague;
66
+ trophies: number;
67
+ versusTrophies?: number;
68
+ clanRank: number;
69
+ previousClanRank: number;
70
+ donations: number;
71
+ donationsReceived: number;
72
+ }
73
+ /** /clans/{clanTag}/members */
74
+ export interface APIClanMemberList {
75
+ items: APIClanMember[];
76
+ paging: APIPaging;
77
+ }
78
+ /** /clans/{clanTag}/currentwar and /clanwarleagues/wars/{warTag} */
79
+ export interface APIClanWar {
80
+ state: 'notInWar' | 'preparation' | 'inWar' | 'warEnded';
81
+ teamSize: number;
82
+ startTime: string;
83
+ preparationStartTime: string;
84
+ endTime: string;
85
+ clan: APIWarClan;
86
+ opponent: APIWarClan;
87
+ /** This property is not available for CWL */
88
+ attacksPerMember?: number;
89
+ }
90
+ export interface APIWarClan {
91
+ tag: string;
92
+ name: string;
93
+ badgeUrls: APIBadge;
94
+ clanLevel: number;
95
+ attacks: number;
96
+ stars: number;
97
+ destructionPercentage: number;
98
+ members: APIClanWarMember[];
99
+ }
100
+ export interface APIClanWarMember {
101
+ tag: string;
102
+ name: string;
103
+ mapPosition: number;
104
+ townhallLevel: number;
105
+ opponentAttacks: number;
106
+ bestOpponentAttack?: APIClanWarAttack;
107
+ attacks?: APIClanWarAttack[];
108
+ }
109
+ export interface APIClanWarAttack {
110
+ order: number;
111
+ attackerTag: string;
112
+ defenderTag: string;
113
+ stars: number;
114
+ duration: number;
115
+ destructionPercentage: number;
116
+ }
117
+ export interface APIWarLogClan {
118
+ tag?: string;
119
+ name?: string;
120
+ badgeUrls: APIBadge;
121
+ clanLevel: number;
122
+ attacks?: number;
123
+ stars: number;
124
+ destructionPercentage: number;
125
+ expEarned?: number;
126
+ }
127
+ export interface APIClanWarLogEntry {
128
+ result: 'win' | 'lose' | 'tie' | null;
129
+ endTime: string;
130
+ teamSize: number;
131
+ attacksPerMember?: number;
132
+ clan: APIWarLogClan;
133
+ opponent: APIWarLogClan;
134
+ }
135
+ /** /clans/{clanTag}/warlog */
136
+ export interface APIClanWarLog {
137
+ items: APIClanWarLogEntry[];
138
+ paging: APIPaging;
139
+ }
140
+ /** /clans/{clanTag}/currentwar/leaguegroup */
141
+ export interface APIClanWarLeagueGroup {
142
+ state: 'preparation' | 'inWar' | 'warEnded';
143
+ season: string;
144
+ clans: APIClanWarLeagueClan[];
145
+ rounds: APIClanWarLeagueRound[];
146
+ }
147
+ export interface APIClanWarLeagueClan {
148
+ name: string;
149
+ tag: string;
150
+ clanLevel: number;
151
+ badgeUrls: APIBadge;
152
+ members: APIClanWarLeagueClanMember[];
153
+ }
154
+ export interface APIClanWarLeagueClanMember {
155
+ name: string;
156
+ tag: string;
157
+ townHallLevel: number;
158
+ }
159
+ export interface APIClanWarLeagueRound {
160
+ warTags: string[];
161
+ }
162
+ /** /players/{playerTag} */
163
+ export interface APIPlayer {
164
+ name: string;
165
+ tag: string;
166
+ townHallLevel: number;
167
+ townHallWeaponLevel?: number;
168
+ expLevel: number;
169
+ trophies: number;
170
+ bestTrophies: number;
171
+ warStars: number;
172
+ attackWins: number;
173
+ defenseWins: number;
174
+ builderHallLevel?: number;
175
+ versusTrophies?: number;
176
+ bestVersusTrophies?: number;
177
+ versusBattleWins?: number;
178
+ donations: number;
179
+ donationsReceived: number;
180
+ role?: string;
181
+ warPreference?: 'in' | 'out';
182
+ clan?: APIPlayerClan;
183
+ league?: APILeague;
184
+ legendStatistics?: APILegendStatistics;
185
+ achievements: APIPlayerAchievement[];
186
+ troops: APIPlayerItem[];
187
+ heroes: APIPlayerItem[];
188
+ spells: APIPlayerItem[];
189
+ labels: APILabel[];
190
+ }
191
+ export interface APILegendStatistics {
192
+ previousSeason?: APISeason;
193
+ previousVersusSeason?: APISeason;
194
+ bestVersusSeason?: APISeason;
195
+ currentSeason?: APISeason;
196
+ bestSeason?: APISeason;
197
+ legendTrophies: number;
198
+ }
199
+ export interface APIPlayerClan {
200
+ tag: string;
201
+ name: string;
202
+ clanLevel: number;
203
+ badgeUrls: APIBadge;
204
+ }
205
+ export interface APIPlayerAchievement {
206
+ name: string;
207
+ stars: number;
208
+ value: number;
209
+ target: number;
210
+ info: string;
211
+ completionInfo: string | null;
212
+ village: 'home' | 'builderBase';
213
+ }
214
+ export interface APIPlayerItem {
215
+ name: string;
216
+ level: number;
217
+ maxLevel: number;
218
+ superTroopIsActive?: boolean;
219
+ village: 'home' | 'builderBase';
220
+ }
221
+ /** /players/{playerTag}/verifytoken */
222
+ export interface APIVerifyToken {
223
+ tag: string;
224
+ token: string;
225
+ status: 'ok' | 'invalid';
226
+ }
227
+ /** /locations */
228
+ export interface APILocationList {
229
+ items: APILocation[];
230
+ paging: APIPaging;
231
+ }
232
+ /** /locations/{locationId} */
233
+ export interface APILocation {
234
+ localizedName?: string;
235
+ id: number;
236
+ name: string;
237
+ isCountry: boolean;
238
+ countryCode?: string;
239
+ }
240
+ /** /locations/{locationId}/rankings/clans */
241
+ export interface APIClanRankingList {
242
+ items: APIClanRanking[];
243
+ paging: APIPaging;
244
+ }
245
+ export interface APIClanRanking {
246
+ clanLevel: number;
247
+ clanPoints: number;
248
+ location: APILocation;
249
+ members: number;
250
+ tag: string;
251
+ name: string;
252
+ rank: number;
253
+ previousRank: number;
254
+ badgeUrls: APIBadge;
255
+ }
256
+ /** /locations/{locationId}/rankings/players */
257
+ export interface APIPlayerRankingList {
258
+ items: APIPlayerRanking[];
259
+ paging: APIPaging;
260
+ }
261
+ export interface APIPlayerRanking {
262
+ tag: string;
263
+ name: string;
264
+ expLevel: number;
265
+ trophies: number;
266
+ attackWins: number;
267
+ defenseWins: number;
268
+ rank: number;
269
+ previousRank: number;
270
+ clan?: Omit<APIPlayerClan, 'clanLevel'>;
271
+ league: APILeague;
272
+ }
273
+ /** /locations/{locationId}/rankings/clans-versus */
274
+ export interface APIClanVersusRankingList {
275
+ items: APIClanVersusRanking[];
276
+ paging: APIPaging;
277
+ }
278
+ export interface APIClanVersusRanking {
279
+ clanLevel: number;
280
+ location: APILocation;
281
+ members: number;
282
+ tag: string;
283
+ name: string;
284
+ rank: number;
285
+ previousRank: number;
286
+ badgeUrls: APIBadge;
287
+ clanVersusPoints: number;
288
+ }
289
+ /** /locations/{locationId}/rankings/players-versus */
290
+ export interface APIPlayerVersusRankingList {
291
+ items: APIPlayerVersusRanking[];
292
+ paging: APIPaging;
293
+ }
294
+ export interface APIPlayerVersusRanking {
295
+ tag: string;
296
+ name: string;
297
+ expLevel: number;
298
+ versusTrophies: number;
299
+ versusBattleWins: number;
300
+ rank: number;
301
+ previousRank: number;
302
+ clan?: APIPlayerClan;
303
+ }
304
+ /** /leagues */
305
+ export interface APILeagueList {
306
+ items: APILeague[];
307
+ paging: APIPaging;
308
+ }
309
+ /** /leagues/{leagueId} */
310
+ export interface APILeague {
311
+ id: number;
312
+ name: string;
313
+ iconUrls: APIIcon;
314
+ }
315
+ /** /leagues/{leagueId}/seasons/{seasonId} */
316
+ export interface APIPlayerSeasonRankingList {
317
+ items: Omit<APIPlayerRanking, 'league'>[];
318
+ paging: APIPaging;
319
+ }
320
+ /** /leagues/{leagueId}/seasons */
321
+ export interface APILeagueSeasonList {
322
+ items: {
323
+ id: string;
324
+ }[];
325
+ paging: APIPaging;
326
+ }
327
+ /** /warleagues */
328
+ export interface APIWarLeagueList {
329
+ items: APIWarLeague[];
330
+ paging: APIPaging;
331
+ }
332
+ /** /warleagues/{leagueId} */
333
+ export interface APIWarLeague {
334
+ id: number;
335
+ name: string;
336
+ }
337
+ export interface APILabel {
338
+ id: number;
339
+ name: string;
340
+ iconUrls: APIIcon;
341
+ }
342
+ /** /labels/clans and /labels/players */
343
+ export interface APILabelList {
344
+ items: APILabel[];
345
+ paging: APIPaging;
346
+ }
347
+ /** /goldpass/seasons/current */
348
+ export interface APIGoldPassSeason {
349
+ startTime: string;
350
+ endTime: string;
351
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,351 +1,2 @@
1
- export interface APIPaging {
2
- cursors?: APICursors;
3
- }
4
- export interface APICursors {
5
- after?: string;
6
- before?: string;
7
- }
8
- export interface APIIcon {
9
- small: string;
10
- /** Tiny Icon is not available for Labels. */
11
- tiny?: string;
12
- /** Medium Icon is not available for Unranked Icon. */
13
- medium?: string;
14
- }
15
- export interface APIBadge {
16
- small: string;
17
- large: string;
18
- medium: string;
19
- }
20
- export interface APISeason {
21
- id: string;
22
- rank: number;
23
- trophies: number;
24
- }
25
- /** /clans?name={name}&limit={limit} */
26
- export interface APIClanList {
27
- items: Omit<APIClan, 'memberList'>[];
28
- paging: APIPaging;
29
- }
30
- export interface APIChatLanguage {
31
- name: string;
32
- id: number;
33
- languageCode: string;
34
- }
35
- /** /clans/{clanTag} */
36
- export interface APIClan {
37
- tag: string;
38
- name: string;
39
- type: 'open' | 'inviteOnly' | 'closed';
40
- description: string;
41
- location?: APILocation;
42
- chatLanguage?: APIChatLanguage;
43
- badgeUrls: APIBadge;
44
- clanLevel: number;
45
- clanPoints: number;
46
- clanVersusPoints: number;
47
- requiredTrophies: number;
48
- requiredTownhallLevel?: number;
49
- warFrequency: 'always' | 'moreThanOncePerWeek' | 'oncePerWeek' | 'lessThanOncePerWeek' | 'never' | 'unknown';
50
- warWinStreak: number;
51
- warWins: number;
52
- warTies?: number;
53
- warLosses?: number;
54
- isWarLogPublic: boolean;
55
- warLeague?: APIWarLeague;
56
- members: number;
57
- labels: APILabel[];
58
- memberList: APIClanMember[];
59
- }
60
- export interface APIClanMember {
61
- name: string;
62
- tag: string;
63
- role: 'member' | 'admin' | 'coLeader' | 'leader';
64
- expLevel: number;
65
- league: APILeague;
66
- trophies: number;
67
- versusTrophies?: number;
68
- clanRank: number;
69
- previousClanRank: number;
70
- donations: number;
71
- donationsReceived: number;
72
- }
73
- /** /clans/{clanTag}/members */
74
- export interface APIClanMemberList {
75
- items: APIClanMember[];
76
- paging: APIPaging;
77
- }
78
- /** /clans/{clanTag}/currentwar and /clanwarleagues/wars/{warTag} */
79
- export interface APIClanWar {
80
- state: 'notInWar' | 'preparation' | 'inWar' | 'warEnded';
81
- teamSize: number;
82
- startTime: string;
83
- preparationStartTime: string;
84
- endTime: string;
85
- clan: APIWarClan;
86
- opponent: APIWarClan;
87
- /** This property is not available for CWL */
88
- attacksPerMember?: number;
89
- }
90
- export interface APIWarClan {
91
- tag: string;
92
- name: string;
93
- badgeUrls: APIBadge;
94
- clanLevel: number;
95
- attacks: number;
96
- stars: number;
97
- destructionPercentage: number;
98
- members: APIClanWarMember[];
99
- }
100
- export interface APIClanWarMember {
101
- tag: string;
102
- name: string;
103
- mapPosition: number;
104
- townhallLevel: number;
105
- opponentAttacks: number;
106
- bestOpponentAttack?: APIClanWarAttack;
107
- attacks?: APIClanWarAttack[];
108
- }
109
- export interface APIClanWarAttack {
110
- order: number;
111
- attackerTag: string;
112
- defenderTag: string;
113
- stars: number;
114
- duration: number;
115
- destructionPercentage: number;
116
- }
117
- export interface APIWarLogClan {
118
- tag?: string;
119
- name?: string;
120
- badgeUrls: APIBadge;
121
- clanLevel: number;
122
- attacks?: number;
123
- stars: number;
124
- destructionPercentage: number;
125
- expEarned?: number;
126
- }
127
- export interface APIClanWarLogEntry {
128
- result: 'win' | 'lose' | 'tie' | null;
129
- endTime: string;
130
- teamSize: number;
131
- attacksPerMember?: number;
132
- clan: APIWarLogClan;
133
- opponent: APIWarLogClan;
134
- }
135
- /** /clans/{clanTag}/warlog */
136
- export interface APIClanWarLog {
137
- items: APIClanWarLogEntry[];
138
- paging: APIPaging;
139
- }
140
- /** /clans/{clanTag}/currentwar/leaguegroup */
141
- export interface APIClanWarLeagueGroup {
142
- state: 'preparation' | 'inWar' | 'warEnded';
143
- season: string;
144
- clans: APIClanWarLeagueClan[];
145
- rounds: APIClanWarLeagueRound[];
146
- }
147
- export interface APIClanWarLeagueClan {
148
- name: string;
149
- tag: string;
150
- clanLevel: number;
151
- badgeUrls: APIBadge;
152
- members: APIClanWarLeagueClanMember[];
153
- }
154
- export interface APIClanWarLeagueClanMember {
155
- name: string;
156
- tag: string;
157
- townHallLevel: number;
158
- }
159
- export interface APIClanWarLeagueRound {
160
- warTags: string[];
161
- }
162
- /** /players/{playerTag} */
163
- export interface APIPlayer {
164
- name: string;
165
- tag: string;
166
- townHallLevel: number;
167
- townHallWeaponLevel?: number;
168
- expLevel: number;
169
- trophies: number;
170
- bestTrophies: number;
171
- warStars: number;
172
- attackWins: number;
173
- defenseWins: number;
174
- builderHallLevel?: number;
175
- versusTrophies?: number;
176
- bestVersusTrophies?: number;
177
- versusBattleWins?: number;
178
- donations: number;
179
- donationsReceived: number;
180
- role?: string;
181
- warPreference?: 'in' | 'out';
182
- clan?: APIPlayerClan;
183
- league?: APILeague;
184
- legendStatistics?: APILegendStatistics;
185
- achievements: APIPlayerAchievement[];
186
- troops: APIPlayerItem[];
187
- heroes: APIPlayerItem[];
188
- spells: APIPlayerItem[];
189
- labels: APILabel[];
190
- }
191
- export interface APILegendStatistics {
192
- previousSeason?: APISeason;
193
- previousVersusSeason?: APISeason;
194
- bestVersusSeason?: APISeason;
195
- currentSeason?: APISeason;
196
- bestSeason?: APISeason;
197
- legendTrophies: number;
198
- }
199
- export interface APIPlayerClan {
200
- tag: string;
201
- name: string;
202
- clanLevel: number;
203
- badgeUrls: APIBadge;
204
- }
205
- export interface APIPlayerAchievement {
206
- name: string;
207
- stars: number;
208
- value: number;
209
- target: number;
210
- info: string;
211
- completionInfo: string | null;
212
- village: 'home' | 'builderBase';
213
- }
214
- export interface APIPlayerItem {
215
- name: string;
216
- level: number;
217
- maxLevel: number;
218
- superTroopIsActive?: boolean;
219
- village: 'home' | 'builderBase';
220
- }
221
- /** /players/{playerTag}/verifytoken */
222
- export interface APIVerifyToken {
223
- tag: string;
224
- token: string;
225
- status: 'ok' | 'invalid';
226
- }
227
- /** /locations */
228
- export interface APILocationList {
229
- items: APILocation[];
230
- paging: APIPaging;
231
- }
232
- /** /locations/{locationId} */
233
- export interface APILocation {
234
- localizedName?: string;
235
- id: number;
236
- name: string;
237
- isCountry: boolean;
238
- countryCode?: string;
239
- }
240
- /** /locations/{locationId}/rankings/clans */
241
- export interface APIClanRankingList {
242
- items: APIClanRanking[];
243
- paging: APIPaging;
244
- }
245
- export interface APIClanRanking {
246
- clanLevel: number;
247
- clanPoints: number;
248
- location: APILocation;
249
- members: number;
250
- tag: string;
251
- name: string;
252
- rank: number;
253
- previousRank: number;
254
- badgeUrls: APIBadge;
255
- }
256
- /** /locations/{locationId}/rankings/players */
257
- export interface APIPlayerRankingList {
258
- items: APIPlayerRanking[];
259
- paging: APIPaging;
260
- }
261
- export interface APIPlayerRanking {
262
- tag: string;
263
- name: string;
264
- expLevel: number;
265
- trophies: number;
266
- attackWins: number;
267
- defenseWins: number;
268
- rank: number;
269
- previousRank: number;
270
- clan?: Omit<APIPlayerClan, 'clanLevel'>;
271
- league: APILeague;
272
- }
273
- /** /locations/{locationId}/rankings/clans-versus */
274
- export interface APIClanVersusRankingList {
275
- items: APIClanVersusRanking[];
276
- paging: APIPaging;
277
- }
278
- export interface APIClanVersusRanking {
279
- clanLevel: number;
280
- location: APILocation;
281
- members: number;
282
- tag: string;
283
- name: string;
284
- rank: number;
285
- previousRank: number;
286
- badgeUrls: APIBadge;
287
- clanVersusPoints: number;
288
- }
289
- /** /locations/{locationId}/rankings/players-versus */
290
- export interface APIPlayerVersusRankingList {
291
- items: APIPlayerVersusRanking[];
292
- paging: APIPaging;
293
- }
294
- export interface APIPlayerVersusRanking {
295
- tag: string;
296
- name: string;
297
- expLevel: number;
298
- versusTrophies: number;
299
- versusBattleWins: number;
300
- rank: number;
301
- previousRank: number;
302
- clan?: APIPlayerClan;
303
- }
304
- /** /leagues */
305
- export interface APILeagueList {
306
- items: APILeague[];
307
- paging: APIPaging;
308
- }
309
- /** /leagues/{leagueId} */
310
- export interface APILeague {
311
- id: number;
312
- name: string;
313
- iconUrls: APIIcon;
314
- }
315
- /** /leagues/{leagueId}/seasons/{seasonId} */
316
- export interface APIPlayerSeasonRankingList {
317
- items: Omit<APIPlayerRanking, 'league'>[];
318
- paging: APIPaging;
319
- }
320
- /** /leagues/{leagueId}/seasons */
321
- export interface APILeagueSeasonList {
322
- items: {
323
- id: string;
324
- }[];
325
- paging: APIPaging;
326
- }
327
- /** /warleagues */
328
- export interface APIWarLeagueList {
329
- items: APIWarLeague[];
330
- paging: APIPaging;
331
- }
332
- /** /warleagues/{leagueId} */
333
- export interface APIWarLeague {
334
- id: number;
335
- name: string;
336
- }
337
- export interface APILabel {
338
- id: number;
339
- name: string;
340
- iconUrls: APIIcon;
341
- }
342
- /** /labels/clans and /labels/players */
343
- export interface APILabelList {
344
- items: APILabel[];
345
- paging: APIPaging;
346
- }
347
- /** /goldpass/seasons/current */
348
- export interface APIGoldPassSeason {
349
- startTime: string;
350
- endTime: string;
351
- }
1
+ export * from './api';
2
+ export * from './lib';
@@ -1,2 +1,14 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
2
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./api"), exports);
14
+ __exportStar(require("./lib"), exports);
@@ -0,0 +1,139 @@
1
+ import { QueueThrottler, BatchThrottler } from '../rest/Throttler';
2
+ import Keyv from 'keyv';
3
+ /** Options for a Client. */
4
+ export interface ClientOptions {
5
+ /** Keys from Clash of Clans API developer site. */
6
+ keys?: string[];
7
+ /** Base URL of the Clash of Clans API. */
8
+ baseURL?: string;
9
+ /**
10
+ * How many times to retry on 5XX errors.
11
+ */
12
+ retryLimit?: number;
13
+ /**
14
+ * Whether enable or disable internal caching.
15
+ * @example
16
+ * ```ts
17
+ * const client = new Client({ cache: true });
18
+ * ```
19
+ */
20
+ cache?: boolean | Keyv;
21
+ /** Time to wait before cancelling a REST request, in milliseconds. */
22
+ restRequestTimeout?: number;
23
+ /**
24
+ * Throttler class which handles rate-limit
25
+ * @example
26
+ * ```ts
27
+ * const client = new Client({ throttler: new QueueThrottler(1000 / 10) });
28
+ * ```
29
+ * @example
30
+ * ```ts
31
+ * const client = new Client({ throttler: new BatchThrottler(30) });
32
+ * ```
33
+ */
34
+ throttler?: QueueThrottler | BatchThrottler;
35
+ }
36
+ /** Options for a RESTManager. */
37
+ export interface RESTOptions extends ClientOptions {
38
+ /** Set this `false` to use `res.ok` property. */
39
+ rejectIfNotValid?: boolean;
40
+ }
41
+ /** Search options for request. */
42
+ export interface SearchOptions extends OverrideOptions {
43
+ /** Limit the number of items returned in the response. */
44
+ limit?: number;
45
+ /**
46
+ * Return only items that occur after this marker.
47
+ * Before marker can be found from the response, inside the 'paging' property.
48
+ * Note that only after or before can be specified for a request, not both.
49
+ */
50
+ after?: string;
51
+ /**
52
+ * Return only items that occur before this marker.
53
+ * Before marker can be found from the response, inside the 'paging' property.
54
+ * Note that only after or before can be specified for a request, not both.
55
+ */
56
+ before?: string;
57
+ }
58
+ /** Override options for a request. */
59
+ export interface OverrideOptions {
60
+ /** Whether to cache this response. */
61
+ cache?: boolean;
62
+ /** Whether to skip the cache check and request the API. */
63
+ force?: boolean;
64
+ /** How many times to retry on 5XX errors. */
65
+ retryLimit?: string;
66
+ /** Whether to ignore throttlers. */
67
+ ignoreRateLimit?: boolean;
68
+ /** Time to wait before cancelling a REST request, in milliseconds. */
69
+ restRequestTimeout?: number;
70
+ }
71
+ export interface RequestOptions extends OverrideOptions {
72
+ /** The request body. */
73
+ body?: string;
74
+ /** The request method. */
75
+ method?: string;
76
+ }
77
+ export interface Response<T> {
78
+ /** Whether the response is ok. */
79
+ ok: boolean;
80
+ /** The response body. */
81
+ data: T;
82
+ /** Path of the request for this response. */
83
+ path: string;
84
+ /** HTTP status code of this response. */
85
+ status: number;
86
+ /** The maxAge of this response. */
87
+ maxAge: number;
88
+ }
89
+ /**
90
+ * Clan search options for a request.
91
+ *
92
+ * If name is used as part of search query, it needs to be at least three characters long.
93
+ * Name search parameter is interpreted as wild card search, so it may appear anywhere in the clan name.
94
+ */
95
+ export interface ClanSearchOptions {
96
+ /** Search clans by name. */
97
+ name?: string;
98
+ /** Filter by minimum number of clan members. */
99
+ minMembers?: number;
100
+ /** Filter by maximum number of clan members. */
101
+ maxMembers?: number;
102
+ /** Filter by minimum amount of clan points. */
103
+ minClanPoints?: number;
104
+ /** Filter by minimum clan level. */
105
+ minClanLevel?: number;
106
+ /** Filter by clan war frequency. */
107
+ warFrequency?: string;
108
+ /** Filter by clan location identifier. For list of available locations, refer to getLocations operation. */
109
+ locationId?: string;
110
+ /** Comma separated list of label IDs to use for filtering results. */
111
+ labelIds?: string;
112
+ /** Limit the number of items returned in the response. */
113
+ limit?: number;
114
+ /**
115
+ * Return only items that occur after this marker.
116
+ * Before marker can be found from the response, inside the 'paging' property.
117
+ * Note that only after or before can be specified for a request, not both.
118
+ */
119
+ after?: string;
120
+ /**
121
+ * Return only items that occur before this marker.
122
+ * Before marker can be found from the response, inside the 'paging' property.
123
+ * Note that only after or before can be specified for a request, not both.
124
+ */
125
+ before?: string;
126
+ }
127
+ /** Login options for a client. */
128
+ export interface LoginOptions {
129
+ /** Developer site email address. */
130
+ email: string;
131
+ /** Developer site password. */
132
+ password: string;
133
+ /** Name of API key(s). */
134
+ keyName?: string;
135
+ /** Number of allowed API keys. */
136
+ keyCount?: number;
137
+ /** Description of API key(s). */
138
+ keyDescription?: string;
139
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clashofclans.js",
3
- "version": "2.3.0-dev.b07e37b",
3
+ "version": "2.4.0-dev.cedc2ac",
4
4
  "description": "JavaScript library for interacting with the Clash of Clans API",
5
5
  "author": "SUVAJIT <suvajit.me@gmail.com>",
6
6
  "license": "MIT",