@bbki.ng/backend 0.3.21 → 0.4.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/.dev.vars.example +2 -0
- package/CHANGELOG.md +10 -0
- package/data/coc-wiki-guide.json +42 -0
- package/eslint.config.js +12 -1
- package/package.json +6 -3
- package/src/config/app.config.ts +1 -0
- package/src/controllers/coc-master/chat.controller.ts +107 -0
- package/src/controllers/coc-master/tools/get-clan-info.tool.ts +27 -0
- package/src/controllers/coc-master/tools/get-current-war.tool.ts +30 -0
- package/src/controllers/coc-master/tools/get-development-guide.tool.ts +22 -0
- package/src/controllers/coc-master/tools/get-player-info.tool.ts +34 -0
- package/src/controllers/coc-master/tools/index.ts +4 -0
- package/src/controllers/coc-master/wiki-sync.controller.ts +46 -0
- package/src/controllers/streaming/list.controller.ts +3 -3
- package/src/index.ts +2 -0
- package/src/routes/coc-master.routes.ts +11 -0
- package/src/routes/comment.routes.ts +1 -0
- package/src/services/coc.service.ts +65 -0
- package/src/services/cocWiki.service.ts +172 -0
- package/src/services/cocWikiDataImporter.service.ts +261 -0
- package/src/types/coc.ts +579 -0
- package/src/types/index.ts +2 -0
- package/test-schema.ts +6 -0
- package/worker-configuration.d.ts +1 -0
package/src/types/coc.ts
ADDED
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clash of Clans API Type Definitions
|
|
3
|
+
* Derived from the official Swagger 2.0 specification.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export type JsonLocalizedName = Record<string, string>;
|
|
7
|
+
|
|
8
|
+
export type ImageUrls = Record<string, string>;
|
|
9
|
+
|
|
10
|
+
export type Long = string;
|
|
11
|
+
|
|
12
|
+
export type Role = 'NOT_MEMBER' | 'MEMBER' | 'LEADER' | 'ADMIN' | 'COLEADER';
|
|
13
|
+
|
|
14
|
+
export type WarFrequency =
|
|
15
|
+
| 'UNKNOWN'
|
|
16
|
+
| 'ALWAYS'
|
|
17
|
+
| 'MORE_THAN_ONCE_PER_WEEK'
|
|
18
|
+
| 'ONCE_PER_WEEK'
|
|
19
|
+
| 'LESS_THAN_ONCE_PER_WEEK'
|
|
20
|
+
| 'NEVER'
|
|
21
|
+
| 'ANY';
|
|
22
|
+
|
|
23
|
+
export type ClanType = 'OPEN' | 'INVITE_ONLY' | 'CLOSED';
|
|
24
|
+
|
|
25
|
+
export type WarState =
|
|
26
|
+
| 'CLAN_NOT_FOUND'
|
|
27
|
+
| 'ACCESS_DENIED'
|
|
28
|
+
| 'NOT_IN_WAR'
|
|
29
|
+
| 'IN_MATCHMAKING'
|
|
30
|
+
| 'ENTER_WAR'
|
|
31
|
+
| 'MATCHED'
|
|
32
|
+
| 'PREPARATION'
|
|
33
|
+
| 'WAR'
|
|
34
|
+
| 'IN_WAR'
|
|
35
|
+
| 'ENDED';
|
|
36
|
+
|
|
37
|
+
export type BattleModifier = 'NONE' | 'HARD_MODE';
|
|
38
|
+
|
|
39
|
+
export type WarResult = 'LOSE' | 'WIN' | 'TIE';
|
|
40
|
+
|
|
41
|
+
export type Village = 'HOME_VILLAGE' | 'BUILDER_BASE' | 'CLAN_CAPITAL';
|
|
42
|
+
|
|
43
|
+
export type PlayerHouseElementType = 'GROUND' | 'ROOF' | 'FOOT' | 'DECO';
|
|
44
|
+
|
|
45
|
+
export type BattleType = 'HOME_VILLAGE' | 'RANKED' | 'LEGEND';
|
|
46
|
+
|
|
47
|
+
// ─── League & Ranking ───────────────────────────────────────────
|
|
48
|
+
|
|
49
|
+
export type League = {
|
|
50
|
+
name?: JsonLocalizedName;
|
|
51
|
+
id?: number;
|
|
52
|
+
iconUrls?: ImageUrls;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type LeagueTier = {
|
|
56
|
+
name?: JsonLocalizedName;
|
|
57
|
+
id?: number;
|
|
58
|
+
iconUrls?: ImageUrls;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type BuilderBaseLeague = {
|
|
62
|
+
name?: JsonLocalizedName;
|
|
63
|
+
id?: number;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type WarLeague = {
|
|
67
|
+
name?: JsonLocalizedName;
|
|
68
|
+
id?: number;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export type CapitalLeague = {
|
|
72
|
+
name?: JsonLocalizedName;
|
|
73
|
+
id?: number;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type LeagueSeason = {
|
|
77
|
+
id?: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type LegendLeagueTournamentSeasonResult = {
|
|
81
|
+
trophies?: number;
|
|
82
|
+
id?: string;
|
|
83
|
+
rank?: number;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export type LeagueSeasonResult = {
|
|
87
|
+
leagueSeasonId?: Long;
|
|
88
|
+
leagueTrophies?: number;
|
|
89
|
+
leagueTierId?: number;
|
|
90
|
+
placement?: number;
|
|
91
|
+
attackWins?: number;
|
|
92
|
+
attackLosses?: number;
|
|
93
|
+
attackStars?: number;
|
|
94
|
+
defenseWins?: number;
|
|
95
|
+
defenseLosses?: number;
|
|
96
|
+
defenseStars?: number;
|
|
97
|
+
maxBattles?: number;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export type LeagueGroup = {
|
|
101
|
+
members?: LeagueGroupMember[];
|
|
102
|
+
attackLogs?: LeagueBattleLogEntry[];
|
|
103
|
+
defenseLogs?: LeagueBattleLogEntry[];
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export type LeagueGroupMember = {
|
|
107
|
+
playerTag?: string;
|
|
108
|
+
playerName?: string;
|
|
109
|
+
clanTag?: string;
|
|
110
|
+
clanName?: string;
|
|
111
|
+
leagueTrophies?: number;
|
|
112
|
+
attackWinCount?: number;
|
|
113
|
+
attackLoseCount?: number;
|
|
114
|
+
defenseWinCount?: number;
|
|
115
|
+
defenseLoseCount?: number;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export type LeagueBattleLogEntry = {
|
|
119
|
+
opponentPlayerTag?: string;
|
|
120
|
+
opponentName?: string;
|
|
121
|
+
stars?: number;
|
|
122
|
+
destructionPercentage?: number;
|
|
123
|
+
trophies?: number;
|
|
124
|
+
creationTime?: string;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
// ─── Location ────────────────────────────────────────────────────
|
|
128
|
+
|
|
129
|
+
export type Location = {
|
|
130
|
+
localizedName?: string;
|
|
131
|
+
id?: number;
|
|
132
|
+
name?: string;
|
|
133
|
+
isCountry?: boolean;
|
|
134
|
+
countryCode?: string;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// ─── Label ───────────────────────────────────────────────────────
|
|
138
|
+
|
|
139
|
+
export type Label = {
|
|
140
|
+
name?: JsonLocalizedName;
|
|
141
|
+
id?: number;
|
|
142
|
+
iconUrls?: ImageUrls;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// ─── Language ────────────────────────────────────────────────────
|
|
146
|
+
|
|
147
|
+
export type Language = {
|
|
148
|
+
name?: string;
|
|
149
|
+
id?: number;
|
|
150
|
+
languageCode?: string;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
// ─── Player House ────────────────────────────────────────────────
|
|
154
|
+
|
|
155
|
+
export type PlayerHouseElement = {
|
|
156
|
+
id?: number;
|
|
157
|
+
type?: PlayerHouseElementType;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export type PlayerHouse = {
|
|
161
|
+
elements?: PlayerHouseElement[];
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
// ─── Player Item Level (Troops, Heroes, Spells, Equipment) ───────
|
|
165
|
+
|
|
166
|
+
export type PlayerItemLevel = {
|
|
167
|
+
level?: number;
|
|
168
|
+
name?: JsonLocalizedName;
|
|
169
|
+
maxLevel?: number;
|
|
170
|
+
village?: Village;
|
|
171
|
+
superTroopIsActive?: boolean;
|
|
172
|
+
equipment?: PlayerItemLevel[];
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
// ─── Player Achievement ──────────────────────────────────────────
|
|
176
|
+
|
|
177
|
+
export type PlayerAchievementProgress = {
|
|
178
|
+
stars?: number;
|
|
179
|
+
value?: number;
|
|
180
|
+
name?: JsonLocalizedName;
|
|
181
|
+
target?: number;
|
|
182
|
+
info?: JsonLocalizedName;
|
|
183
|
+
completionInfo?: JsonLocalizedName;
|
|
184
|
+
village?: Village;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// ─── Player Legend Statistics ────────────────────────────────────
|
|
188
|
+
|
|
189
|
+
export type PlayerLegendStatistics = {
|
|
190
|
+
previousSeason?: LegendLeagueTournamentSeasonResult;
|
|
191
|
+
previousBuilderBaseSeason?: LegendLeagueTournamentSeasonResult;
|
|
192
|
+
bestBuilderBaseSeason?: LegendLeagueTournamentSeasonResult;
|
|
193
|
+
legendTrophies?: number;
|
|
194
|
+
currentSeason?: LegendLeagueTournamentSeasonResult;
|
|
195
|
+
bestSeason?: LegendLeagueTournamentSeasonResult;
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
// ─── Player Clan ─────────────────────────────────────────────────
|
|
199
|
+
|
|
200
|
+
export type PlayerClan = {
|
|
201
|
+
tag?: string;
|
|
202
|
+
clanLevel?: number;
|
|
203
|
+
name?: string;
|
|
204
|
+
badgeUrls?: ImageUrls;
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// ─── Player ──────────────────────────────────────────────────────
|
|
208
|
+
|
|
209
|
+
export type Player = {
|
|
210
|
+
clan?: PlayerClan;
|
|
211
|
+
league?: League;
|
|
212
|
+
leagueTier?: LeagueTier;
|
|
213
|
+
builderBaseLeague?: BuilderBaseLeague;
|
|
214
|
+
role?: Role;
|
|
215
|
+
warPreference?: 'OUT' | 'IN';
|
|
216
|
+
attackWins?: number;
|
|
217
|
+
defenseWins?: number;
|
|
218
|
+
townHallLevel?: number;
|
|
219
|
+
townHallWeaponLevel?: number;
|
|
220
|
+
legendStatistics?: PlayerLegendStatistics;
|
|
221
|
+
troops?: PlayerItemLevel[];
|
|
222
|
+
heroes?: PlayerItemLevel[];
|
|
223
|
+
heroEquipment?: PlayerItemLevel[];
|
|
224
|
+
spells?: PlayerItemLevel[];
|
|
225
|
+
labels?: Label[];
|
|
226
|
+
tag?: string;
|
|
227
|
+
name?: string;
|
|
228
|
+
expLevel?: number;
|
|
229
|
+
trophies?: number;
|
|
230
|
+
bestTrophies?: number;
|
|
231
|
+
donations?: number;
|
|
232
|
+
donationsReceived?: number;
|
|
233
|
+
builderHallLevel?: number;
|
|
234
|
+
builderBaseTrophies?: number;
|
|
235
|
+
bestBuilderBaseTrophies?: number;
|
|
236
|
+
warStars?: number;
|
|
237
|
+
achievements?: PlayerAchievementProgress[];
|
|
238
|
+
clanCapitalContributions?: number;
|
|
239
|
+
playerHouse?: PlayerHouse;
|
|
240
|
+
currentLeagueGroupTag?: string;
|
|
241
|
+
currentLeagueSeasonId?: Long;
|
|
242
|
+
previousLeagueGroupTag?: string;
|
|
243
|
+
previousLeagueSeasonId?: Long;
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
// ─── Clan Capital ────────────────────────────────────────────────
|
|
247
|
+
|
|
248
|
+
export type ClanDistrictData = {
|
|
249
|
+
name?: JsonLocalizedName;
|
|
250
|
+
id?: number;
|
|
251
|
+
districtHallLevel?: number;
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
export type ClanCapital = {
|
|
255
|
+
capitalHallLevel?: number;
|
|
256
|
+
districts?: ClanDistrictData[];
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
// ─── Clan Member ─────────────────────────────────────────────────
|
|
260
|
+
|
|
261
|
+
export type ClanMember = {
|
|
262
|
+
league?: League;
|
|
263
|
+
leagueTier?: LeagueTier;
|
|
264
|
+
builderBaseLeague?: BuilderBaseLeague;
|
|
265
|
+
tag?: string;
|
|
266
|
+
name?: string;
|
|
267
|
+
role?: Role;
|
|
268
|
+
townHallLevel?: number;
|
|
269
|
+
expLevel?: number;
|
|
270
|
+
clanRank?: number;
|
|
271
|
+
previousClanRank?: number;
|
|
272
|
+
donations?: number;
|
|
273
|
+
donationsReceived?: number;
|
|
274
|
+
trophies?: number;
|
|
275
|
+
builderBaseTrophies?: number;
|
|
276
|
+
playerHouse?: PlayerHouse;
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
// ─── Clan War Attack ─────────────────────────────────────────────
|
|
280
|
+
|
|
281
|
+
export type ClanWarAttack = {
|
|
282
|
+
order?: number;
|
|
283
|
+
attackerTag?: string;
|
|
284
|
+
defenderTag?: string;
|
|
285
|
+
stars?: number;
|
|
286
|
+
destructionPercentage?: number;
|
|
287
|
+
duration?: number;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
// ─── Clan War Member ─────────────────────────────────────────────
|
|
291
|
+
|
|
292
|
+
export type ClanWarMember = {
|
|
293
|
+
tag?: string;
|
|
294
|
+
name?: string;
|
|
295
|
+
mapPosition?: number;
|
|
296
|
+
townhallLevel?: number;
|
|
297
|
+
opponentAttacks?: number;
|
|
298
|
+
bestOpponentAttack?: ClanWarAttack;
|
|
299
|
+
attacks?: ClanWarAttack[];
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
// ─── War Clan ────────────────────────────────────────────────────
|
|
303
|
+
|
|
304
|
+
export type WarClan = {
|
|
305
|
+
destructionPercentage?: number;
|
|
306
|
+
tag?: string;
|
|
307
|
+
name?: string;
|
|
308
|
+
badgeUrls?: ImageUrls;
|
|
309
|
+
clanLevel?: number;
|
|
310
|
+
attacks?: number;
|
|
311
|
+
stars?: number;
|
|
312
|
+
expEarned?: number;
|
|
313
|
+
members?: ClanWarMember[];
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
// ─── Clan War ────────────────────────────────────────────────────
|
|
317
|
+
|
|
318
|
+
export type ClanWar = {
|
|
319
|
+
clan?: WarClan;
|
|
320
|
+
teamSize?: number;
|
|
321
|
+
attacksPerMember?: number;
|
|
322
|
+
battleModifier?: BattleModifier;
|
|
323
|
+
opponent?: WarClan;
|
|
324
|
+
startTime?: string;
|
|
325
|
+
state?: WarState;
|
|
326
|
+
endTime?: string;
|
|
327
|
+
preparationStartTime?: string;
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
// ─── Clan War Log ────────────────────────────────────────────────
|
|
331
|
+
|
|
332
|
+
export type ClanWarLogEntry = {
|
|
333
|
+
clan?: WarClan;
|
|
334
|
+
teamSize?: number;
|
|
335
|
+
attacksPerMember?: number;
|
|
336
|
+
battleModifier?: BattleModifier;
|
|
337
|
+
opponent?: WarClan;
|
|
338
|
+
endTime?: string;
|
|
339
|
+
result?: WarResult;
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
export type ClanWarLog = ClanWarLogEntry[];
|
|
343
|
+
|
|
344
|
+
// ─── Clan ────────────────────────────────────────────────────────
|
|
345
|
+
|
|
346
|
+
export type Clan = {
|
|
347
|
+
memberList?: ClanMember[];
|
|
348
|
+
warLeague?: WarLeague;
|
|
349
|
+
capitalLeague?: CapitalLeague;
|
|
350
|
+
tag?: string;
|
|
351
|
+
isFamilyFriendly?: boolean;
|
|
352
|
+
isWarLogPublic?: boolean;
|
|
353
|
+
warFrequency?: WarFrequency;
|
|
354
|
+
clanLevel?: number;
|
|
355
|
+
warWinStreak?: number;
|
|
356
|
+
warWins?: number;
|
|
357
|
+
warTies?: number;
|
|
358
|
+
warLosses?: number;
|
|
359
|
+
clanPoints?: number;
|
|
360
|
+
chatLanguage?: Language;
|
|
361
|
+
clanBuilderBasePoints?: number;
|
|
362
|
+
clanCapitalPoints?: number;
|
|
363
|
+
requiredTrophies?: number;
|
|
364
|
+
requiredBuilderBaseTrophies?: number;
|
|
365
|
+
requiredTownhallLevel?: number;
|
|
366
|
+
labels?: Label[];
|
|
367
|
+
name?: string;
|
|
368
|
+
location?: Location;
|
|
369
|
+
type?: ClanType;
|
|
370
|
+
members?: number;
|
|
371
|
+
description?: string;
|
|
372
|
+
clanCapital?: ClanCapital;
|
|
373
|
+
badgeUrls?: ImageUrls;
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
// ─── Capital Raid Season ─────────────────────────────────────────
|
|
377
|
+
|
|
378
|
+
export type ClanCapitalRaidSeasonAttacker = {
|
|
379
|
+
tag?: string;
|
|
380
|
+
name?: string;
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
export type ClanCapitalRaidSeasonAttack = {
|
|
384
|
+
attacker?: ClanCapitalRaidSeasonAttacker;
|
|
385
|
+
destructionPercent?: number;
|
|
386
|
+
stars?: number;
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
export type ClanCapitalRaidSeasonDistrict = {
|
|
390
|
+
stars?: number;
|
|
391
|
+
name?: JsonLocalizedName;
|
|
392
|
+
id?: number;
|
|
393
|
+
destructionPercent?: number;
|
|
394
|
+
attackCount?: number;
|
|
395
|
+
totalLooted?: number;
|
|
396
|
+
attacks?: ClanCapitalRaidSeasonAttack[];
|
|
397
|
+
districtHallLevel?: number;
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
export type ClanCapitalRaidSeasonClanInfo = {
|
|
401
|
+
tag?: string;
|
|
402
|
+
name?: string;
|
|
403
|
+
level?: number;
|
|
404
|
+
badgeUrls?: ImageUrls;
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
export type ClanCapitalRaidSeasonAttackLogEntry = {
|
|
408
|
+
defender?: ClanCapitalRaidSeasonClanInfo;
|
|
409
|
+
attackCount?: number;
|
|
410
|
+
districtCount?: number;
|
|
411
|
+
districtsDestroyed?: number;
|
|
412
|
+
districts?: ClanCapitalRaidSeasonDistrict[];
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
export type ClanCapitalRaidSeasonDefenseLogEntry = {
|
|
416
|
+
attacker?: ClanCapitalRaidSeasonClanInfo;
|
|
417
|
+
attackCount?: number;
|
|
418
|
+
districtCount?: number;
|
|
419
|
+
districtsDestroyed?: number;
|
|
420
|
+
districts?: ClanCapitalRaidSeasonDistrict[];
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
export type ClanCapitalRaidSeasonMember = {
|
|
424
|
+
tag?: string;
|
|
425
|
+
name?: string;
|
|
426
|
+
attacks?: number;
|
|
427
|
+
attackLimit?: number;
|
|
428
|
+
bonusAttackLimit?: number;
|
|
429
|
+
capitalResourcesLooted?: number;
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
export type ClanCapitalRaidSeason = {
|
|
433
|
+
attackLog?: ClanCapitalRaidSeasonAttackLogEntry[];
|
|
434
|
+
defenseLog?: ClanCapitalRaidSeasonDefenseLogEntry[];
|
|
435
|
+
state?: string;
|
|
436
|
+
startTime?: string;
|
|
437
|
+
endTime?: string;
|
|
438
|
+
capitalTotalLoot?: number;
|
|
439
|
+
raidsCompleted?: number;
|
|
440
|
+
totalAttacks?: number;
|
|
441
|
+
enemyDistrictsDestroyed?: number;
|
|
442
|
+
offensiveReward?: number;
|
|
443
|
+
defensiveReward?: number;
|
|
444
|
+
members?: ClanCapitalRaidSeasonMember[];
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
export type ClanCapitalRaidSeasons = ClanCapitalRaidSeason[];
|
|
448
|
+
|
|
449
|
+
// ─── Rankings ────────────────────────────────────────────────────
|
|
450
|
+
|
|
451
|
+
export type PlayerRankingClan = {
|
|
452
|
+
tag?: string;
|
|
453
|
+
name?: string;
|
|
454
|
+
badgeUrls?: ImageUrls;
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
export type PlayerRanking = {
|
|
458
|
+
clan?: PlayerRankingClan;
|
|
459
|
+
league?: League;
|
|
460
|
+
leagueTier?: LeagueTier;
|
|
461
|
+
attackWins?: number;
|
|
462
|
+
defenseWins?: number;
|
|
463
|
+
tag?: string;
|
|
464
|
+
name?: string;
|
|
465
|
+
expLevel?: number;
|
|
466
|
+
rank?: number;
|
|
467
|
+
previousRank?: number;
|
|
468
|
+
trophies?: number;
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
export type PlayerBuilderBaseRanking = {
|
|
472
|
+
clan?: PlayerRankingClan;
|
|
473
|
+
builderBaseLeague?: BuilderBaseLeague;
|
|
474
|
+
tag?: string;
|
|
475
|
+
name?: string;
|
|
476
|
+
expLevel?: number;
|
|
477
|
+
rank?: number;
|
|
478
|
+
previousRank?: number;
|
|
479
|
+
builderBaseTrophies?: number;
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
export type ClanRanking = {
|
|
483
|
+
clanLevel?: number;
|
|
484
|
+
clanPoints?: number;
|
|
485
|
+
location?: Location;
|
|
486
|
+
members?: number;
|
|
487
|
+
tag?: string;
|
|
488
|
+
name?: string;
|
|
489
|
+
rank?: number;
|
|
490
|
+
previousRank?: number;
|
|
491
|
+
badgeUrls?: ImageUrls;
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
export type ClanBuilderBaseRanking = {
|
|
495
|
+
clanPoints?: number;
|
|
496
|
+
clanBuilderBasePoints?: number;
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
export type ClanCapitalRanking = {
|
|
500
|
+
clanPoints?: number;
|
|
501
|
+
clanCapitalPoints?: number;
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
// ─── Battle Log ──────────────────────────────────────────────────
|
|
505
|
+
|
|
506
|
+
export type Resource = {
|
|
507
|
+
name?: string;
|
|
508
|
+
amount?: Long;
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
export type BattleLogEntry = {
|
|
512
|
+
battleType?: BattleType;
|
|
513
|
+
attack?: boolean;
|
|
514
|
+
armyShareCode?: string;
|
|
515
|
+
opponentPlayerTag?: string;
|
|
516
|
+
stars?: number;
|
|
517
|
+
destructionPercentage?: number;
|
|
518
|
+
lootedResources?: Resource[];
|
|
519
|
+
extraLootedResources?: Resource[];
|
|
520
|
+
availableLoot?: Resource[];
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
export type BattleLogEntryList = BattleLogEntry[];
|
|
524
|
+
|
|
525
|
+
// ─── War League Group ────────────────────────────────────────────
|
|
526
|
+
|
|
527
|
+
export type ClanWarLeagueClanMember = {
|
|
528
|
+
tag?: string;
|
|
529
|
+
townHallLevel?: number;
|
|
530
|
+
name?: string;
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
export type ClanWarLeagueClan = {
|
|
534
|
+
tag?: string;
|
|
535
|
+
clanLevel?: number;
|
|
536
|
+
name?: string;
|
|
537
|
+
members?: ClanWarLeagueClanMember[];
|
|
538
|
+
badgeUrls?: ImageUrls;
|
|
539
|
+
};
|
|
540
|
+
|
|
541
|
+
export type ClanWarLeagueRound = {
|
|
542
|
+
warTags?: string[];
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
export type ClanWarLeagueGroup = {
|
|
546
|
+
tag?: string;
|
|
547
|
+
state?: 'GROUP_NOT_FOUND' | 'NOT_IN_WAR' | 'PREPARATION' | 'WAR' | 'ENDED';
|
|
548
|
+
season?: string;
|
|
549
|
+
clans?: ClanWarLeagueClan[];
|
|
550
|
+
rounds?: ClanWarLeagueRound[];
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
// ─── Token Verification ──────────────────────────────────────────
|
|
554
|
+
|
|
555
|
+
export type VerifyTokenRequest = {
|
|
556
|
+
token?: string;
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
export type VerifyTokenResponse = {
|
|
560
|
+
tag?: string;
|
|
561
|
+
token?: string;
|
|
562
|
+
status?: string;
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
// ─── Gold Pass ───────────────────────────────────────────────────
|
|
566
|
+
|
|
567
|
+
export type GoldPassSeason = {
|
|
568
|
+
startTime?: string;
|
|
569
|
+
endTime?: string;
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
// ─── Client Error ────────────────────────────────────────────────
|
|
573
|
+
|
|
574
|
+
export type ClientError = {
|
|
575
|
+
reason?: string;
|
|
576
|
+
message?: string;
|
|
577
|
+
type?: string;
|
|
578
|
+
detail?: unknown;
|
|
579
|
+
};
|
package/src/types/index.ts
CHANGED
package/test-schema.ts
ADDED