clashofclans.js 3.3.11-dev.dbb454c → 3.3.13-dev.a96b9d2

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.
@@ -30,7 +30,7 @@ class PollingClient extends Client_1.Client {
30
30
  };
31
31
  this.inMaintenance = Boolean(false);
32
32
  this._maintenanceStartTime = null;
33
- if (options?.pollingInterval && !isNaN(options.pollingInterval)) {
33
+ if (options?.pollingInterval && typeof options.pollingInterval !== 'number') {
34
34
  throw new Error('The property "pollingInterval" must be a type of number.');
35
35
  }
36
36
  this._pollingInterval = Math.max(options?.pollingInterval ?? 1000, 1000);
package/dist/index.mjs CHANGED
@@ -62,6 +62,8 @@ export const SuperTroops = mod.SuperTroops;
62
62
  export const Troop = mod.Troop;
63
63
  export const Unit = mod.Unit;
64
64
  export const UnrankedLeagueData = mod.UnrankedLeagueData;
65
+ export const UnrankedLeagueId = mod.UnrankedLeagueId;
66
+ export const UnrankedWarLeagueId = mod.UnrankedWarLeagueId;
65
67
  export const Util = mod.Util;
66
68
  export const WarClan = mod.WarClan;
67
69
  export const WarLeagues = mod.WarLeagues;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { EventEmitter } from 'node:events';
3
- import { APIBuilderBaseLeague, APIBuilderBaseLeagueList, APICapitalLeague, APICapitalLeagueList, APICapitalRaidSeasons, APIClan, APIClanBuilderBaseRankingList, APIClanCapitalRankingList, APIClanList, APIClanMemberList, APIClanRankingList, APIClanWar, APIClanWarLeagueGroup, APIClanWarLog, APIGoldPassSeason, APILabelList, APILeague, APILeagueList, APILeagueSeasonList, APILocation, APILocationList, APIPlayer, APIPlayerBuilderBaseRankingList, APIPlayerRankingList, APIPlayerSeasonRankingList, APIVerifyToken, APIWarLeague, APIWarLeagueList, ClanSearchOptions, LoginOptions, OverrideOptions, RESTOptions, SearchOptions } from '../types';
3
+ import { APIBuilderBaseLeague, APIBuilderBaseLeagueList, APICapitalLeague, APICapitalLeagueList, APICapitalRaidSeasons, APIClan, APIClanBuilderBaseRankingList, APIClanCapitalRankingList, APIClanList, APIClanMemberList, APIClanRankingList, APIClanWar, APIClanWarLeagueGroup, APIClanWarLogList, APIGoldPassSeason, APILabelList, APILeague, APILeagueList, APILeagueSeasonList, APILocation, APILocationList, APIPlayer, APIPlayerBuilderBaseRankingList, APIPlayerRankingList, APIPlayerSeasonRankingList, APIVerifyToken, APIWarLeague, APIWarLeagueList, ClanSearchOptions, LoginOptions, OverrideOptions, RESTOptions, SearchOptions } from '../types';
4
4
  import { RestEvents } from '../util/Constants';
5
5
  import { Util } from '../util/Util';
6
6
  import { RequestHandler } from './RequestHandler';
@@ -59,7 +59,7 @@ export declare class RESTManager extends EventEmitter {
59
59
  /** Get list of clan members. */
60
60
  getClanMembers(clanTag: string, options?: SearchOptions): Promise<import("../types").Result<APIClanMemberList>>;
61
61
  /** Get clan war log. */
62
- getClanWarLog(clanTag: string, options?: SearchOptions): Promise<import("../types").Result<APIClanWarLog>>;
62
+ getClanWarLog(clanTag: string, options?: SearchOptions): Promise<import("../types").Result<APIClanWarLogList>>;
63
63
  /** Get info about currently running war in the clan. */
64
64
  getCurrentWar(clanTag: string, options?: OverrideOptions): Promise<import("../types").Result<APIClanWar>>;
65
65
  /** Get info about clan war league. */
@@ -18,7 +18,6 @@ export declare class CapitalRaidSeasonMember {
18
18
  }
19
19
  /** Represents a Capital Raid Season. */
20
20
  export declare class CapitalRaidSeason {
21
- private readonly client;
22
21
  /** The state of the raid season. */
23
22
  state: 'ongoing' | 'ended';
24
23
  /** The start time of the raid season. */
@@ -43,6 +42,7 @@ export declare class CapitalRaidSeason {
43
42
  attackLog: APICapitalRaidSeasonAttackLog[];
44
43
  /** The defense log of the raid season. */
45
44
  defenseLog: APICapitalRaidSeasonDefenseLog[];
45
+ private readonly client;
46
46
  constructor(client: Client, data: APICapitalRaidSeason);
47
47
  /** Get {@link Player} info for every Player in the clan. */
48
48
  fetchMembers(options?: OverrideOptions): Promise<Player[]>;
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.CapitalRaidSeason = exports.CapitalRaidSeasonMember = void 0;
10
+ const Decorators_1 = require("../util/Decorators");
4
11
  const Util_1 = require("../util/Util");
5
12
  class CapitalRaidSeasonMember {
6
13
  constructor(data) {
@@ -38,3 +45,6 @@ class CapitalRaidSeason {
38
45
  }
39
46
  }
40
47
  exports.CapitalRaidSeason = CapitalRaidSeason;
48
+ __decorate([
49
+ (0, Decorators_1.Enumerable)(false)
50
+ ], CapitalRaidSeason.prototype, "client", void 0);
@@ -7,7 +7,6 @@ import { Location } from './Location';
7
7
  import type { Player } from './Player';
8
8
  /** Represents a Clan. */
9
9
  export declare class Clan {
10
- client: Client;
11
10
  /** Name of the clan. */
12
11
  name: string;
13
12
  /** Tag of the clan. */
@@ -37,7 +36,7 @@ export declare class Clan {
37
36
  /** The minimum hall level required to apply to this clan. */
38
37
  requiredTownHallLevel: number | null;
39
38
  /** The frequency for when this clan goes to war. */
40
- warFrequency: 'always' | 'moreThanOncePerWeek' | 'oncePerWeek' | 'lessThanOncePerWeek' | 'never' | 'unknown';
39
+ warFrequency?: 'always' | 'moreThanOncePerWeek' | 'oncePerWeek' | 'lessThanOncePerWeek' | 'never' | 'unknown';
41
40
  /** The clan's current war winning streak. */
42
41
  warWinStreak: number;
43
42
  /** The number of wars the clan has won. */
@@ -65,6 +64,7 @@ export declare class Clan {
65
64
  * - This property returns empty array for {@link Client.getClans} method.
66
65
  */
67
66
  members: ClanMember[];
67
+ private readonly client;
68
68
  constructor(client: Client, data: APIClan);
69
69
  /** Get {@link Player} info for every Player in the clan. */
70
70
  fetchMembers(options?: OverrideOptions): Promise<Player[]>;
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.Clan = void 0;
10
+ const Decorators_1 = require("../util/Decorators");
4
11
  const Badge_1 = require("./Badge");
5
12
  const ClanCapital_1 = require("./ClanCapital");
6
13
  const ClanMember_1 = require("./ClanMember");
@@ -50,3 +57,6 @@ class Clan {
50
57
  }
51
58
  }
52
59
  exports.Clan = Clan;
60
+ __decorate([
61
+ (0, Decorators_1.Enumerable)(false)
62
+ ], Clan.prototype, "client", void 0);
@@ -2,7 +2,6 @@ import { Client } from '../client/Client';
2
2
  import { APIClanMember, APILeague, APIPlayerHouse, OverrideOptions } from '../types';
3
3
  import { League } from './League';
4
4
  export declare class ClanMember {
5
- client: Client;
6
5
  /** The member's name. */
7
6
  name: string;
8
7
  /** The member's tag. */
@@ -31,6 +30,7 @@ export declare class ClanMember {
31
30
  received: number;
32
31
  /** The member's player house details. */
33
32
  playerHouse?: APIPlayerHouse | null;
33
+ private readonly client;
34
34
  constructor(client: Client, data: APIClanMember);
35
35
  /** Whether this clan member is in the clan. */
36
36
  get isMember(): boolean;
@@ -1,7 +1,14 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.ClanMember = void 0;
4
10
  const Constants_1 = require("../util/Constants");
11
+ const Decorators_1 = require("../util/Decorators");
5
12
  const League_1 = require("./League");
6
13
  class ClanMember {
7
14
  constructor(client, data) {
@@ -45,3 +52,6 @@ class ClanMember {
45
52
  }
46
53
  }
47
54
  exports.ClanMember = ClanMember;
55
+ __decorate([
56
+ (0, Decorators_1.Enumerable)(false)
57
+ ], ClanMember.prototype, "client", void 0);
@@ -109,7 +109,6 @@ export declare class WarClan {
109
109
  * :::
110
110
  */
111
111
  export declare class ClanWar {
112
- client: Client;
113
112
  /**
114
113
  * The clan's current war state.
115
114
  *
@@ -132,6 +131,7 @@ export declare class ClanWar {
132
131
  opponent: WarClan;
133
132
  /** The war's unique tag. This is `null` unless this is a CWL. */
134
133
  warTag: string | null;
134
+ private readonly client;
135
135
  constructor(client: Client, data: APIClanWar, extra: {
136
136
  clanTag?: string;
137
137
  warTag?: string;
@@ -1,7 +1,14 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.ClanWar = exports.WarClan = exports.ClanWarMember = exports.ClanWarAttack = void 0;
4
10
  const Constants_1 = require("../util/Constants");
11
+ const Decorators_1 = require("../util/Decorators");
5
12
  const Helper_1 = require("../util/Helper");
6
13
  const Badge_1 = require("./Badge");
7
14
  /** Represents a Clash of Clans War Attack. */
@@ -147,7 +154,7 @@ exports.WarClan = WarClan;
147
154
  */
148
155
  class ClanWar {
149
156
  constructor(client, data, extra) {
150
- Object.defineProperty(this, 'client', { value: client });
157
+ this.client = client;
151
158
  this.state = data.state;
152
159
  if (this.state !== 'notInWar') {
153
160
  this.teamSize = data.teamSize;
@@ -242,3 +249,6 @@ class ClanWar {
242
249
  }
243
250
  }
244
251
  exports.ClanWar = ClanWar;
252
+ __decorate([
253
+ (0, Decorators_1.Enumerable)(false)
254
+ ], ClanWar.prototype, "client", void 0);
@@ -17,7 +17,6 @@ export declare class ClanWarLeagueClanMember {
17
17
  }
18
18
  /** Represents a Clan of CWL Group. */
19
19
  export declare class ClanWarLeagueClan {
20
- private readonly client;
21
20
  /** The clan's name. */
22
21
  name: string;
23
22
  /** The clan's tag. */
@@ -28,6 +27,7 @@ export declare class ClanWarLeagueClan {
28
27
  badge: Badge;
29
28
  /** An array of members that are in the CWL group. */
30
29
  members: ClanWarLeagueClanMember[];
30
+ private readonly client;
31
31
  constructor(client: Client, data: APIClanWarLeagueClan);
32
32
  /** Get {@link Player} info for every members that are in the CWL group. */
33
33
  fetchMembers(options?: OverrideOptions): Promise<Player[]>;
@@ -44,7 +44,6 @@ export declare class ClanWarLeagueRound {
44
44
  }
45
45
  /** Represents a CWL Group. */
46
46
  export declare class ClanWarLeagueGroup {
47
- private readonly client;
48
47
  /** The CWL group's current war state. */
49
48
  state: 'preparation' | 'inWar' | 'ended' | 'notInWar';
50
49
  /** Season Id of this CWL group. */
@@ -53,6 +52,7 @@ export declare class ClanWarLeagueGroup {
53
52
  clans: ClanWarLeagueClan[];
54
53
  /** An array containing all war tags for each round. */
55
54
  rounds: ClanWarLeagueRound[];
55
+ private readonly client;
56
56
  constructor(client: Client, data: APIClanWarLeagueGroup);
57
57
  /** Whether the clan is not in CWL group. */
58
58
  get isNotInWar(): boolean;
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.ClanWarLeagueGroup = exports.ClanWarLeagueRound = exports.ClanWarLeagueClan = exports.ClanWarLeagueClanMember = void 0;
10
+ const Decorators_1 = require("../util/Decorators");
4
11
  const Badge_1 = require("./Badge");
5
12
  /** Represents a Clan War League member. */
6
13
  class ClanWarLeagueClanMember {
@@ -37,6 +44,9 @@ class ClanWarLeagueClan {
37
44
  }
38
45
  }
39
46
  exports.ClanWarLeagueClan = ClanWarLeagueClan;
47
+ __decorate([
48
+ (0, Decorators_1.Enumerable)(false)
49
+ ], ClanWarLeagueClan.prototype, "client", void 0);
40
50
  /** Represents a Round of CWL Group. */
41
51
  class ClanWarLeagueRound {
42
52
  constructor(data, round) {
@@ -102,3 +112,6 @@ class ClanWarLeagueGroup {
102
112
  }
103
113
  }
104
114
  exports.ClanWarLeagueGroup = ClanWarLeagueGroup;
115
+ __decorate([
116
+ (0, Decorators_1.Enumerable)(false)
117
+ ], ClanWarLeagueGroup.prototype, "client", void 0);
@@ -1,5 +1,5 @@
1
1
  import { Client } from '../client/Client';
2
- import { APIClanWarLogEntry, APIWarLogClan } from '../types';
2
+ import { APIClanWarLog, APIWarLogClan } from '../types';
3
3
  import { Badge } from './Badge';
4
4
  /**
5
5
  * Represents War Log Clan.
@@ -35,7 +35,6 @@ export declare class WarLogClan {
35
35
  get shareLink(): string | null;
36
36
  }
37
37
  export declare class ClanWarLog {
38
- client: Client;
39
38
  /** The result of the war. */
40
39
  result: 'win' | 'lose' | 'tie' | null;
41
40
  /** The Date that battle day ends at. */
@@ -48,7 +47,8 @@ export declare class ClanWarLog {
48
47
  clan: WarLogClan;
49
48
  /** The opposition clan. */
50
49
  opponent: WarLogClan;
51
- constructor(client: Client, data: APIClanWarLogEntry);
50
+ private readonly client;
51
+ constructor(client: Client, data: APIClanWarLog);
52
52
  /** Returns either `friendly`, `cwl` or `normal`. */
53
53
  get type(): "friendly" | "cwl" | "normal";
54
54
  /** Whether this is a friendly war. */
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.ClanWarLog = exports.WarLogClan = void 0;
10
+ const Decorators_1 = require("../util/Decorators");
4
11
  const Util_1 = require("../util/Util");
5
12
  const Badge_1 = require("./Badge");
6
13
  /**
@@ -58,3 +65,6 @@ class ClanWarLog {
58
65
  }
59
66
  }
60
67
  exports.ClanWarLog = ClanWarLog;
68
+ __decorate([
69
+ (0, Decorators_1.Enumerable)(false)
70
+ ], ClanWarLog.prototype, "client", void 0);
@@ -8,7 +8,6 @@ import { PlayerClan } from './PlayerClan';
8
8
  import { Hero, HeroEquipment, Spell, Troop } from './Unit';
9
9
  /** Represents a Clash of Clans Player. */
10
10
  export declare class Player {
11
- client: Client;
12
11
  /** The player's name. */
13
12
  name: string;
14
13
  /** The player's tag. */
@@ -65,6 +64,7 @@ export declare class Player {
65
64
  heroEquipment: HeroEquipment[];
66
65
  /** The player's clan capital house details. */
67
66
  playerHouse?: APIPlayerHouse | null;
67
+ private readonly client;
68
68
  constructor(client: Client, data: APIPlayer);
69
69
  /** Whether this clan member is in the clan. */
70
70
  get inClan(): boolean;
@@ -1,7 +1,14 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.Player = void 0;
4
10
  const Constants_1 = require("../util/Constants");
11
+ const Decorators_1 = require("../util/Decorators");
5
12
  const Achievement_1 = require("./Achievement");
6
13
  const Label_1 = require("./Label");
7
14
  const League_1 = require("./League");
@@ -104,3 +111,6 @@ class Player {
104
111
  }
105
112
  }
106
113
  exports.Player = Player;
114
+ __decorate([
115
+ (0, Decorators_1.Enumerable)(false)
116
+ ], Player.prototype, "client", void 0);
@@ -3,7 +3,6 @@ import { APIPlayerClan, OverrideOptions } from '../types';
3
3
  import { Badge } from './Badge';
4
4
  /** Represents a Player's clan. */
5
5
  export declare class PlayerClan {
6
- private readonly _client;
7
6
  /** Name of the clan. */
8
7
  name: string;
9
8
  /** Tag of the clan. */
@@ -16,7 +15,8 @@ export declare class PlayerClan {
16
15
  level: number | null;
17
16
  /** Badge of this clan. */
18
17
  badge: Badge;
19
- constructor(_client: Client, data: APIPlayerClan);
18
+ private readonly client;
19
+ constructor(client: Client, data: APIPlayerClan);
20
20
  /** Fetch detailed clan info for the player's clan. */
21
21
  fetch(options?: OverrideOptions): Promise<import("./Clan").Clan>;
22
22
  /** Get clan's formatted link to open clan in-game. */
@@ -1,11 +1,18 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
2
8
  Object.defineProperty(exports, "__esModule", { value: true });
3
9
  exports.PlayerClan = void 0;
10
+ const Decorators_1 = require("../util/Decorators");
4
11
  const Badge_1 = require("./Badge");
5
12
  /** Represents a Player's clan. */
6
13
  class PlayerClan {
7
- constructor(_client, data) {
8
- this._client = _client;
14
+ constructor(client, data) {
15
+ this.client = client;
9
16
  this.name = data.name;
10
17
  this.tag = data.tag;
11
18
  this.level = data.clanLevel ?? null; // eslint-disable-line
@@ -13,7 +20,7 @@ class PlayerClan {
13
20
  }
14
21
  /** Fetch detailed clan info for the player's clan. */
15
22
  fetch(options) {
16
- return this._client.getClan(this.tag, options);
23
+ return this.client.getClan(this.tag, options);
17
24
  }
18
25
  /** Get clan's formatted link to open clan in-game. */
19
26
  get shareLink() {
@@ -21,3 +28,6 @@ class PlayerClan {
21
28
  }
22
29
  }
23
30
  exports.PlayerClan = PlayerClan;
31
+ __decorate([
32
+ (0, Decorators_1.Enumerable)(false)
33
+ ], PlayerClan.prototype, "client", void 0);
@@ -47,7 +47,7 @@ export interface APIClan {
47
47
  requiredTrophies: number;
48
48
  requiredTownhallLevel?: number;
49
49
  requiredBuilderBaseTrophies?: number;
50
- warFrequency: 'always' | 'moreThanOncePerWeek' | 'oncePerWeek' | 'lessThanOncePerWeek' | 'never' | 'unknown';
50
+ warFrequency?: 'always' | 'moreThanOncePerWeek' | 'oncePerWeek' | 'lessThanOncePerWeek' | 'never' | 'unknown';
51
51
  warWinStreak: number;
52
52
  warWins: number;
53
53
  warTies?: number;
@@ -103,6 +103,7 @@ export interface APIClanWar {
103
103
  teamSize: number;
104
104
  startTime: string;
105
105
  preparationStartTime: string;
106
+ battleModifier?: 'none' | 'hardMode';
106
107
  endTime: string;
107
108
  clan: APIWarClan;
108
109
  opponent: APIWarClan;
@@ -146,17 +147,18 @@ export interface APIWarLogClan {
146
147
  destructionPercentage: number;
147
148
  expEarned?: number;
148
149
  }
149
- export interface APIClanWarLogEntry {
150
- result: 'win' | 'lose' | 'tie' | null;
150
+ export interface APIClanWarLog {
151
+ result?: 'win' | 'lose' | 'tie' | null;
151
152
  endTime: string;
153
+ battleModifier?: 'none' | 'hardMode';
152
154
  teamSize: number;
153
155
  attacksPerMember?: number;
154
156
  clan: APIWarLogClan;
155
157
  opponent: APIWarLogClan;
156
158
  }
157
159
  /** /clans/{clanTag}/warlog */
158
- export interface APIClanWarLog {
159
- items: APIClanWarLogEntry[];
160
+ export interface APIClanWarLogList {
161
+ items: APIClanWarLog[];
160
162
  paging: APIPaging;
161
163
  }
162
164
  /** /clans/{clanTag}/currentwar/leaguegroup */
@@ -19,7 +19,9 @@ export declare const UnrankedLeagueData: {
19
19
  tiny: string;
20
20
  };
21
21
  };
22
+ export declare const UnrankedLeagueId = 29000000;
22
23
  export declare const LegendLeagueId = 29000022;
24
+ export declare const UnrankedWarLeagueId = 48000000;
23
25
  export declare const Leagues: number[];
24
26
  export declare const WarLeagues: number[];
25
27
  export declare const FriendlyWarPreparationTimes: readonly [number, number, number, number, number, number, number, number, number, number, number, number];
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.RawData = exports.CWLRounds = exports.RestEvents = exports.ClientEvents = exports.PollingEvents = exports.FriendlyWarPreparationTimes = exports.WarLeagues = exports.Leagues = exports.LegendLeagueId = exports.UnrankedLeagueData = exports.HeroPets = exports.Heroes = exports.BuilderTroops = exports.Spells = exports.DarkElixirSpells = exports.ElixirSpells = exports.SuperTroops = exports.SiegeMachines = exports.HomeTroops = exports.DarkElixirTroops = exports.ElixirTroops = exports.DevSiteAPIBaseURL = exports.APIBaseURL = void 0;
6
+ exports.RawData = exports.CWLRounds = exports.RestEvents = exports.ClientEvents = exports.PollingEvents = exports.FriendlyWarPreparationTimes = exports.WarLeagues = exports.Leagues = exports.UnrankedWarLeagueId = exports.LegendLeagueId = exports.UnrankedLeagueId = exports.UnrankedLeagueData = exports.HeroPets = exports.Heroes = exports.BuilderTroops = exports.Spells = exports.DarkElixirSpells = exports.ElixirSpells = exports.SuperTroops = exports.SiegeMachines = exports.HomeTroops = exports.DarkElixirTroops = exports.ElixirTroops = exports.DevSiteAPIBaseURL = exports.APIBaseURL = void 0;
7
7
  const raw_json_1 = __importDefault(require("../util/raw.json"));
8
8
  exports.APIBaseURL = 'https://api.clashofclans.com/v1';
9
9
  exports.DevSiteAPIBaseURL = 'https://developer.clashofclans.com/api';
@@ -114,7 +114,9 @@ exports.UnrankedLeagueData = {
114
114
  tiny: 'https://api-assets.clashofclans.com/leagues/36/e--YMyIexEQQhE4imLoJcwhYn6Uy8KqlgyY3_kFV6t4.png'
115
115
  }
116
116
  };
117
+ exports.UnrankedLeagueId = 29000000;
117
118
  exports.LegendLeagueId = 29000022;
119
+ exports.UnrankedWarLeagueId = 48000000;
118
120
  exports.Leagues = [
119
121
  29000000,
120
122
  29000001,
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Decorator that sets the enumerable property of a class field to the desired value.
3
+ * @param value Whether the property should be enumerable or not
4
+ */
5
+ export declare function Enumerable(value: boolean): (target: unknown, key: string) => void;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Enumerable = void 0;
4
+ /**
5
+ * Decorator that sets the enumerable property of a class field to the desired value.
6
+ * @param value Whether the property should be enumerable or not
7
+ */
8
+ function Enumerable(value) {
9
+ return (target, key) => {
10
+ Reflect.defineProperty(target, key, {
11
+ enumerable: value,
12
+ set(val) {
13
+ Reflect.defineProperty(this, key, {
14
+ configurable: true,
15
+ enumerable: value,
16
+ value: val,
17
+ writable: true
18
+ });
19
+ }
20
+ });
21
+ };
22
+ }
23
+ exports.Enumerable = Enumerable;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clashofclans.js",
3
- "version": "3.3.11-dev.dbb454c",
3
+ "version": "3.3.13-dev.a96b9d2",
4
4
  "description": "JavaScript library for interacting with the Clash of Clans API",
5
5
  "author": "https://clashofclans.js.org",
6
6
  "license": "MIT",