clashofclans.js 2.8.0-dev.53b06d3 → 2.8.0-dev.d94685e
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/dist/struct/Clan.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { Player } from './Player';
|
|
|
7
7
|
import { Location } from './Location';
|
|
8
8
|
import { Label } from './Label';
|
|
9
9
|
import { Badge } from './Badge';
|
|
10
|
+
import { ClanCapital } from './ClanCapital';
|
|
10
11
|
/** Represents a Clan. */
|
|
11
12
|
export declare class Clan {
|
|
12
13
|
client: Client;
|
|
@@ -54,6 +55,8 @@ export declare class Clan {
|
|
|
54
55
|
memberCount: number;
|
|
55
56
|
/** An array of {@link Label} that the clan has. */
|
|
56
57
|
labels: Label[];
|
|
58
|
+
/** The clan's Clan Capital information */
|
|
59
|
+
clanCapital: ClanCapital | null;
|
|
57
60
|
/**
|
|
58
61
|
* List of clan members.
|
|
59
62
|
* - This property returns empty array for {@link Client.getClans} method.
|
package/dist/struct/Clan.js
CHANGED
|
@@ -7,6 +7,7 @@ const WarLeague_1 = require("./WarLeague");
|
|
|
7
7
|
const Location_1 = require("./Location");
|
|
8
8
|
const Label_1 = require("./Label");
|
|
9
9
|
const Badge_1 = require("./Badge");
|
|
10
|
+
const ClanCapital_1 = require("./ClanCapital");
|
|
10
11
|
/** Represents a Clan. */
|
|
11
12
|
class Clan {
|
|
12
13
|
constructor(client, data) {
|
|
@@ -33,6 +34,7 @@ class Clan {
|
|
|
33
34
|
this.warLeague = data.warLeague ? new WarLeague_1.WarLeague(data.warLeague) : null;
|
|
34
35
|
this.memberCount = data.members;
|
|
35
36
|
this.labels = data.labels.map((label) => new Label_1.Label(label));
|
|
37
|
+
this.clanCapital = Object.keys(data.clanCapital).length > 0 ? new ClanCapital_1.ClanCapital(data.clanCapital) : null;
|
|
36
38
|
this.members = data.memberList?.map((mem) => new ClanMember_1.ClanMember(this.client, mem)) ?? []; // eslint-disable-line
|
|
37
39
|
}
|
|
38
40
|
/** Get {@link Player} info for every Player in the clan. */
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { APIClanCapital } from '../types';
|
|
2
|
+
export declare class ClanCapital {
|
|
3
|
+
/** The clan capital hall level */
|
|
4
|
+
capitalHallLevel: number | null;
|
|
5
|
+
/** The clan capital districts */
|
|
6
|
+
districts: {
|
|
7
|
+
id: number;
|
|
8
|
+
name: string;
|
|
9
|
+
districtHallLevel: number;
|
|
10
|
+
}[] | null;
|
|
11
|
+
constructor(data: APIClanCapital);
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClanCapital = void 0;
|
|
4
|
+
class ClanCapital {
|
|
5
|
+
constructor(data) {
|
|
6
|
+
this.capitalHallLevel = data.capitalHallLevel ?? null;
|
|
7
|
+
this.districts = data.districts ? data.districts : null;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.ClanCapital = ClanCapital;
|
package/dist/struct/Player.d.ts
CHANGED
|
@@ -41,6 +41,8 @@ export declare class Player {
|
|
|
41
41
|
donations: number;
|
|
42
42
|
/** The player's donation received count for this season. */
|
|
43
43
|
received: number;
|
|
44
|
+
/** The player's total Clan Capital contribution */
|
|
45
|
+
clanCapitalContributions: number;
|
|
44
46
|
/** The player's role in the clan or `null` if not in a clan. */
|
|
45
47
|
role: 'member' | 'elder' | 'coLeader' | 'leader' | null;
|
|
46
48
|
/** Whether the player has selected that they are opted in. This will be `null` if the player is not in a clan. */
|
package/dist/struct/Player.js
CHANGED
|
@@ -28,6 +28,7 @@ class Player {
|
|
|
28
28
|
this.versusBattleWins = data.versusBattleWins ?? null;
|
|
29
29
|
this.donations = data.donations;
|
|
30
30
|
this.received = data.donationsReceived;
|
|
31
|
+
this.clanCapitalContributions = data.clanCapitalContributions;
|
|
31
32
|
// @ts-expect-error
|
|
32
33
|
this.role = data.role?.replace('admin', 'elder') ?? null;
|
|
33
34
|
this.warOptedIn = data.warPreference ? data.warPreference === 'in' : null;
|
package/dist/types/api.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ export interface APIClan {
|
|
|
57
57
|
members: number;
|
|
58
58
|
labels: APILabel[];
|
|
59
59
|
memberList: APIClanMember[];
|
|
60
|
+
clanCapital: APIClanCapital;
|
|
60
61
|
}
|
|
61
62
|
export interface APIClanMember {
|
|
62
63
|
name: string;
|
|
@@ -71,6 +72,14 @@ export interface APIClanMember {
|
|
|
71
72
|
donations: number;
|
|
72
73
|
donationsReceived: number;
|
|
73
74
|
}
|
|
75
|
+
export interface APIClanCapital {
|
|
76
|
+
capitalHallLevel?: number;
|
|
77
|
+
districts?: {
|
|
78
|
+
id: number;
|
|
79
|
+
name: string;
|
|
80
|
+
districtHallLevel: number;
|
|
81
|
+
}[];
|
|
82
|
+
}
|
|
74
83
|
/** /clans/{clanTag}/members */
|
|
75
84
|
export interface APIClanMemberList {
|
|
76
85
|
items: APIClanMember[];
|
|
@@ -179,6 +188,7 @@ export interface APIPlayer {
|
|
|
179
188
|
versusBattleWinCount?: number;
|
|
180
189
|
donations: number;
|
|
181
190
|
donationsReceived: number;
|
|
191
|
+
clanCapitalContributions: number;
|
|
182
192
|
role?: string;
|
|
183
193
|
warPreference?: 'in' | 'out';
|
|
184
194
|
clan?: APIPlayerClan;
|
package/package.json
CHANGED