@breezil/hypixel-parsers 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +235 -0
  3. package/dist/arcade.d.ts +560 -0
  4. package/dist/arcade.d.ts.map +1 -0
  5. package/dist/arcade.js +619 -0
  6. package/dist/arcade.js.map +1 -0
  7. package/dist/arenabrawl.d.ts +56 -0
  8. package/dist/arenabrawl.d.ts.map +1 -0
  9. package/dist/arenabrawl.js +107 -0
  10. package/dist/arenabrawl.js.map +1 -0
  11. package/dist/bedwars.d.ts +747 -0
  12. package/dist/bedwars.d.ts.map +1 -0
  13. package/dist/bedwars.js +844 -0
  14. package/dist/bedwars.js.map +1 -0
  15. package/dist/blitz.d.ts +105 -0
  16. package/dist/blitz.d.ts.map +1 -0
  17. package/dist/blitz.js +259 -0
  18. package/dist/blitz.js.map +1 -0
  19. package/dist/buildbattle.d.ts +54 -0
  20. package/dist/buildbattle.d.ts.map +1 -0
  21. package/dist/buildbattle.js +92 -0
  22. package/dist/buildbattle.js.map +1 -0
  23. package/dist/common.d.ts +11 -0
  24. package/dist/common.d.ts.map +1 -0
  25. package/dist/common.js +34 -0
  26. package/dist/common.js.map +1 -0
  27. package/dist/copsandcrims.d.ts +201 -0
  28. package/dist/copsandcrims.d.ts.map +1 -0
  29. package/dist/copsandcrims.js +269 -0
  30. package/dist/copsandcrims.js.map +1 -0
  31. package/dist/duels.d.ts +358 -0
  32. package/dist/duels.d.ts.map +1 -0
  33. package/dist/duels.js +570 -0
  34. package/dist/duels.js.map +1 -0
  35. package/dist/guild.d.ts +49 -0
  36. package/dist/guild.d.ts.map +1 -0
  37. package/dist/guild.js +95 -0
  38. package/dist/guild.js.map +1 -0
  39. package/dist/housing.d.ts +16 -0
  40. package/dist/housing.d.ts.map +1 -0
  41. package/dist/housing.js +34 -0
  42. package/dist/housing.js.map +1 -0
  43. package/dist/index.d.ts +50 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +66 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/megawalls.d.ts +363 -0
  48. package/dist/megawalls.d.ts.map +1 -0
  49. package/dist/megawalls.js +684 -0
  50. package/dist/megawalls.js.map +1 -0
  51. package/dist/murdermystery.d.ts +293 -0
  52. package/dist/murdermystery.d.ts.map +1 -0
  53. package/dist/murdermystery.js +349 -0
  54. package/dist/murdermystery.js.map +1 -0
  55. package/dist/nbt.d.ts +37 -0
  56. package/dist/nbt.d.ts.map +1 -0
  57. package/dist/nbt.js +133 -0
  58. package/dist/nbt.js.map +1 -0
  59. package/dist/paintball.d.ts +52 -0
  60. package/dist/paintball.d.ts.map +1 -0
  61. package/dist/paintball.js +79 -0
  62. package/dist/paintball.js.map +1 -0
  63. package/dist/pit.d.ts +181 -0
  64. package/dist/pit.d.ts.map +1 -0
  65. package/dist/pit.js +262 -0
  66. package/dist/pit.js.map +1 -0
  67. package/dist/player.d.ts +338 -0
  68. package/dist/player.d.ts.map +1 -0
  69. package/dist/player.js +521 -0
  70. package/dist/player.js.map +1 -0
  71. package/dist/quakecraft.d.ts +75 -0
  72. package/dist/quakecraft.d.ts.map +1 -0
  73. package/dist/quakecraft.js +99 -0
  74. package/dist/quakecraft.js.map +1 -0
  75. package/dist/recentgames.d.ts +10 -0
  76. package/dist/recentgames.d.ts.map +1 -0
  77. package/dist/recentgames.js +27 -0
  78. package/dist/recentgames.js.map +1 -0
  79. package/dist/resources-achievements.d.ts +29 -0
  80. package/dist/resources-achievements.d.ts.map +1 -0
  81. package/dist/resources-achievements.js +67 -0
  82. package/dist/resources-achievements.js.map +1 -0
  83. package/dist/resources-challenges.d.ts +12 -0
  84. package/dist/resources-challenges.d.ts.map +1 -0
  85. package/dist/resources-challenges.js +36 -0
  86. package/dist/resources-challenges.js.map +1 -0
  87. package/dist/resources-games.d.ts +10 -0
  88. package/dist/resources-games.d.ts.map +1 -0
  89. package/dist/resources-games.js +28 -0
  90. package/dist/resources-games.js.map +1 -0
  91. package/dist/resources-guild-achievements.d.ts +23 -0
  92. package/dist/resources-guild-achievements.d.ts.map +1 -0
  93. package/dist/resources-guild-achievements.js +56 -0
  94. package/dist/resources-guild-achievements.js.map +1 -0
  95. package/dist/resources-quests.d.ts +23 -0
  96. package/dist/resources-quests.d.ts.map +1 -0
  97. package/dist/resources-quests.js +53 -0
  98. package/dist/resources-quests.js.map +1 -0
  99. package/dist/resources-vanity.d.ts +19 -0
  100. package/dist/resources-vanity.d.ts.map +1 -0
  101. package/dist/resources-vanity.js +33 -0
  102. package/dist/resources-vanity.js.map +1 -0
  103. package/dist/skyblock-auctions.d.ts +50 -0
  104. package/dist/skyblock-auctions.d.ts.map +1 -0
  105. package/dist/skyblock-auctions.js +90 -0
  106. package/dist/skyblock-auctions.js.map +1 -0
  107. package/dist/skyblock-bazaar.d.ts +25 -0
  108. package/dist/skyblock-bazaar.d.ts.map +1 -0
  109. package/dist/skyblock-bazaar.js +54 -0
  110. package/dist/skyblock-bazaar.js.map +1 -0
  111. package/dist/skyblock-bingo.d.ts +8 -0
  112. package/dist/skyblock-bingo.d.ts.map +1 -0
  113. package/dist/skyblock-bingo.js +19 -0
  114. package/dist/skyblock-bingo.js.map +1 -0
  115. package/dist/skyblock-items.d.ts +150 -0
  116. package/dist/skyblock-items.d.ts.map +1 -0
  117. package/dist/skyblock-items.js +247 -0
  118. package/dist/skyblock-items.js.map +1 -0
  119. package/dist/skyblock-misc.d.ts +91 -0
  120. package/dist/skyblock-misc.d.ts.map +1 -0
  121. package/dist/skyblock-misc.js +159 -0
  122. package/dist/skyblock-misc.js.map +1 -0
  123. package/dist/skyblock-museum.d.ts +24 -0
  124. package/dist/skyblock-museum.d.ts.map +1 -0
  125. package/dist/skyblock-museum.js +51 -0
  126. package/dist/skyblock-museum.js.map +1 -0
  127. package/dist/skyblock-news.d.ts +12 -0
  128. package/dist/skyblock-news.d.ts.map +1 -0
  129. package/dist/skyblock-news.js +25 -0
  130. package/dist/skyblock-news.js.map +1 -0
  131. package/dist/skyblock-resources.d.ts +94 -0
  132. package/dist/skyblock-resources.d.ts.map +1 -0
  133. package/dist/skyblock-resources.js +175 -0
  134. package/dist/skyblock-resources.js.map +1 -0
  135. package/dist/skyblock.d.ts +972 -0
  136. package/dist/skyblock.d.ts.map +1 -0
  137. package/dist/skyblock.js +1371 -0
  138. package/dist/skyblock.js.map +1 -0
  139. package/dist/skywars.d.ts +319 -0
  140. package/dist/skywars.d.ts.map +1 -0
  141. package/dist/skywars.js +611 -0
  142. package/dist/skywars.js.map +1 -0
  143. package/dist/smashheroes.d.ts +126 -0
  144. package/dist/smashheroes.d.ts.map +1 -0
  145. package/dist/smashheroes.js +206 -0
  146. package/dist/smashheroes.js.map +1 -0
  147. package/dist/static.d.ts +42 -0
  148. package/dist/static.d.ts.map +1 -0
  149. package/dist/static.js +106 -0
  150. package/dist/static.js.map +1 -0
  151. package/dist/status.d.ts +9 -0
  152. package/dist/status.d.ts.map +1 -0
  153. package/dist/status.js +18 -0
  154. package/dist/status.js.map +1 -0
  155. package/dist/tntgames.d.ts +189 -0
  156. package/dist/tntgames.d.ts.map +1 -0
  157. package/dist/tntgames.js +283 -0
  158. package/dist/tntgames.js.map +1 -0
  159. package/dist/turbokartracers.d.ts +85 -0
  160. package/dist/turbokartracers.d.ts.map +1 -0
  161. package/dist/turbokartracers.js +165 -0
  162. package/dist/turbokartracers.js.map +1 -0
  163. package/dist/uhc.d.ts +55 -0
  164. package/dist/uhc.d.ts.map +1 -0
  165. package/dist/uhc.js +94 -0
  166. package/dist/uhc.js.map +1 -0
  167. package/dist/vampirez.d.ts +75 -0
  168. package/dist/vampirez.d.ts.map +1 -0
  169. package/dist/vampirez.js +104 -0
  170. package/dist/vampirez.js.map +1 -0
  171. package/dist/walls.d.ts +96 -0
  172. package/dist/walls.d.ts.map +1 -0
  173. package/dist/walls.js +122 -0
  174. package/dist/walls.js.map +1 -0
  175. package/dist/warlords.d.ts +229 -0
  176. package/dist/warlords.d.ts.map +1 -0
  177. package/dist/warlords.js +309 -0
  178. package/dist/warlords.js.map +1 -0
  179. package/package.json +55 -0
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseQuakecraft = parseQuakecraft;
4
+ const common_1 = require("./common");
5
+ function parseMode(quake, suffix) {
6
+ return {
7
+ wins: (0, common_1.num)(quake, `wins${suffix}`),
8
+ kills: (0, common_1.num)(quake, `kills${suffix}`),
9
+ deaths: (0, common_1.num)(quake, `deaths${suffix}`),
10
+ killstreaks: (0, common_1.num)(quake, `killstreaks${suffix}`),
11
+ distanceTravelled: (0, common_1.num)(quake, `distance_travelled${suffix}`),
12
+ shotsFired: (0, common_1.num)(quake, `shots_fired${suffix}`),
13
+ headshots: (0, common_1.num)(quake, `headshots${suffix}`),
14
+ killsSinceUpdateFeb2017: (0, common_1.num)(quake, `kills_since_update_feb_2017${suffix}`),
15
+ };
16
+ }
17
+ function parseCosmetics(quake) {
18
+ return {
19
+ killSound: (0, common_1.str)(quake, "killsound"),
20
+ barrel: (0, common_1.str)(quake, "barrel"),
21
+ case: (0, common_1.str)(quake, "case"),
22
+ muzzle: (0, common_1.str)(quake, "muzzle"),
23
+ sight: (0, common_1.str)(quake, "sight"),
24
+ trigger: (0, common_1.str)(quake, "trigger"),
25
+ beam: (0, common_1.str)(quake, "beam"),
26
+ armor: (0, common_1.str)(quake, "armor"),
27
+ hat: (0, common_1.str)(quake, "hat"),
28
+ boots: (0, common_1.str)(quake, "boots"),
29
+ leggings: (0, common_1.str)(quake, "leggings"),
30
+ compass: (0, common_1.str)(quake, "null"),
31
+ killPrefixColor: (0, common_1.str)(quake, "selectedKillPrefix"),
32
+ };
33
+ }
34
+ function parseSettings(quake) {
35
+ return {
36
+ instantRespawn: (0, common_1.bool)(quake, "instantRespawn"),
37
+ showPrefix: (0, common_1.bool)(quake, "showKillPrefix"),
38
+ showDashCooldown: (0, common_1.bool)(quake, "showDashCooldown"),
39
+ enableSound: (0, common_1.bool)(quake, "enable_sound"),
40
+ compassSelected: (0, common_1.bool)(quake, "compass_selected"),
41
+ alternativeGunCooldownIndicator: (0, common_1.bool)(quake, "alternative_gun_cooldown_indicator"),
42
+ dashCooldown: (0, common_1.str)(quake, "dash_cooldown"),
43
+ dashPower: (0, common_1.str)(quake, "dash_power"),
44
+ messageCoin: (0, common_1.bool)(quake, "messageCoin"),
45
+ messageCoinMessages: (0, common_1.bool)(quake, "messageCoin Messages"),
46
+ messageKillstreaks: (0, common_1.bool)(quake, "messageKillstreaks"),
47
+ messageMultiKills: (0, common_1.bool)(quake, "messageMulti-kills"),
48
+ messageOthersKillsDeaths: (0, common_1.bool)(quake, "messageOthers' Kills/deaths"),
49
+ messagePowerupCollections: (0, common_1.bool)(quake, "messagePowerup Collections"),
50
+ messageYourDeaths: (0, common_1.bool)(quake, "messageYour Deaths"),
51
+ messageYourKills: (0, common_1.bool)(quake, "messageYour Kills"),
52
+ };
53
+ }
54
+ function parseMapVotes(quake) {
55
+ return {
56
+ ascended: (0, common_1.num)(quake, "votes_Ascended"),
57
+ belmorn: (0, common_1.num)(quake, "votes_Belmorn"),
58
+ coldWar: (0, common_1.num)(quake, "votes_Cold_War"),
59
+ faarah: (0, common_1.num)(quake, "votes_Faarah"),
60
+ reactor: (0, common_1.num)(quake, "votes_Reactor"),
61
+ town: (0, common_1.num)(quake, "votes_Town"),
62
+ };
63
+ }
64
+ function parsePackages(quake) {
65
+ const value = quake.packages;
66
+ return Array.isArray(value)
67
+ ? value.filter((entry) => typeof entry === "string")
68
+ : [];
69
+ }
70
+ /** Parses a player's Quakecraft stats (`stats.Quake`) into a typed object. */
71
+ function parseQuakecraft(stats) {
72
+ const raw = stats.Quake;
73
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
74
+ return null;
75
+ }
76
+ const quake = raw;
77
+ return {
78
+ coins: (0, common_1.num)(quake, "coins"),
79
+ highestKillstreak: (0, common_1.num)(quake, "highest_killstreak"),
80
+ killsDeathmatch: (0, common_1.num)(quake, "kills_dm"),
81
+ killsDeathmatchTeams: (0, common_1.num)(quake, "kills_dm_teams"),
82
+ killsTimeAttack: (0, common_1.num)(quake, "kills_timeattack"),
83
+ killsTourneyUnknown: (0, common_1.num)(quake, "kills_tourney_unknown"),
84
+ monthlyKillsA: (0, common_1.num)(quake, "monthly_kills_a"),
85
+ monthlyKillsB: (0, common_1.num)(quake, "monthly_kills_b"),
86
+ weeklyKillsA: (0, common_1.num)(quake, "weekly_kills_a"),
87
+ weeklyKillsB: (0, common_1.num)(quake, "weekly_kills_b"),
88
+ lastTourneyAd: (0, common_1.date)(quake, "lastTourneyAd"),
89
+ packages: parsePackages(quake),
90
+ solo: parseMode(quake, ""),
91
+ teams: parseMode(quake, "_teams"),
92
+ soloTourney: parseMode(quake, "_solo_tourney"),
93
+ tourneyQuakeSolo2: parseMode(quake, "_tourney_quake_solo2_1"),
94
+ mapVotes: parseMapVotes(quake),
95
+ cosmetics: parseCosmetics(quake),
96
+ settings: parseSettings(quake),
97
+ };
98
+ }
99
+ //# sourceMappingURL=quakecraft.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quakecraft.js","sourceRoot":"","sources":["../src/quakecraft.ts"],"names":[],"mappings":";;AA4JA,0CA6BC;AAzLD,qCAAgD;AA+EhD,SAAS,SAAS,CAChB,KAA8B,EAC9B,MAAc;IAEd,OAAO;QACL,IAAI,EAAE,IAAA,YAAG,EAAC,KAAK,EAAE,OAAO,MAAM,EAAE,CAAC;QACjC,KAAK,EAAE,IAAA,YAAG,EAAC,KAAK,EAAE,QAAQ,MAAM,EAAE,CAAC;QACnC,MAAM,EAAE,IAAA,YAAG,EAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;QACrC,WAAW,EAAE,IAAA,YAAG,EAAC,KAAK,EAAE,cAAc,MAAM,EAAE,CAAC;QAC/C,iBAAiB,EAAE,IAAA,YAAG,EAAC,KAAK,EAAE,qBAAqB,MAAM,EAAE,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B,CAAC;QAC5C,YAAY,EAAE,IAAA,YAAG,EAAC,KAAK,EAAE,gBAAgB,CAAC;QAC1C,YAAY,EAAE,IAAA,YAAG,EAAC,KAAK,EAAE,gBAAgB,CAAC;QAC1C,aAAa,EAAE,IAAA,aAAI,EAAC,KAAK,EAAE,eAAe,CAAC;QAC3C,QAAQ,EAAE,aAAa,CAAC,KAAK,CAAC;QAC9B,IAAI,EAAE,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC;QAC1B,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC;QACjC,WAAW,EAAE,SAAS,CAAC,KAAK,EAAE,eAAe,CAAC;QAC9C,iBAAiB,EAAE,SAAS,CAAC,KAAK,EAAE,wBAAwB,CAAC;QAC7D,QAAQ,EAAE,aAAa,CAAC,KAAK,CAAC;QAC9B,SAAS,EAAE,cAAc,CAAC,KAAK,CAAC;QAChC,QAAQ,EAAE,aAAa,CAAC,KAAK,CAAC;KAC/B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ export interface RecentGame {
2
+ readonly gameType: string;
3
+ readonly mode: string | null;
4
+ readonly map: string | null;
5
+ readonly startedAt: Date | null;
6
+ readonly endedAt: Date | null;
7
+ }
8
+ /** Parses a player's recent games (`/recentgames`) into a typed object. */
9
+ export declare function parseRecentGames(games: unknown[]): RecentGame[];
10
+ //# sourceMappingURL=recentgames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recentgames.d.ts","sourceRoot":"","sources":["../src/recentgames.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;CAC/B;AAcD,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,CAS/D"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseRecentGames = parseRecentGames;
4
+ const common_1 = require("./common");
5
+ function parseRecentGame(raw) {
6
+ const mode = (0, common_1.str)(raw, "mode");
7
+ const map = (0, common_1.str)(raw, "map");
8
+ return {
9
+ gameType: (0, common_1.str)(raw, "gameType"),
10
+ mode: mode === "" ? null : mode,
11
+ map: map === "" ? null : map,
12
+ startedAt: (0, common_1.date)(raw, "date"),
13
+ endedAt: (0, common_1.date)(raw, "ended"),
14
+ };
15
+ }
16
+ /** Parses a player's recent games (`/recentgames`) into a typed object. */
17
+ function parseRecentGames(games) {
18
+ const result = [];
19
+ for (const entry of games) {
20
+ if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
21
+ continue;
22
+ }
23
+ result.push(parseRecentGame(entry));
24
+ }
25
+ return result;
26
+ }
27
+ //# sourceMappingURL=recentgames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recentgames.js","sourceRoot":"","sources":["../src/recentgames.ts"],"names":[],"mappings":";;AAuBA,4CASC;AAhCD,qCAAqC;AAUrC,SAAS,eAAe,CAAC,GAA4B;IACnD,MAAM,IAAI,GAAG,IAAA,YAAG,EAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC9B,MAAM,GAAG,GAAG,IAAA,YAAG,EAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC5B,OAAO;QACL,QAAQ,EAAE,IAAA,YAAG,EAAC,GAAG,EAAE,UAAU,CAAC;QAC9B,IAAI,EAAE,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;QAC/B,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG;QAC5B,SAAS,EAAE,IAAA,aAAI,EAAC,GAAG,EAAE,MAAM,CAAC;QAC5B,OAAO,EAAE,IAAA,aAAI,EAAC,GAAG,EAAE,OAAO,CAAC;KAC5B,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,SAAgB,gBAAgB,CAAC,KAAgB;IAC/C,MAAM,MAAM,GAAiB,EAAE,CAAC;IAChC,KAAK,MAAM,KAAK,IAAI,KAAK,EAAE,CAAC;QAC1B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACxE,SAAS;QACX,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,KAAgC,CAAC,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,29 @@
1
+ export interface AchievementTier {
2
+ readonly tier: number;
3
+ readonly points: number;
4
+ readonly amount: number;
5
+ }
6
+ export interface AchievementOneTime {
7
+ readonly name: string;
8
+ readonly description: string;
9
+ readonly secret: boolean;
10
+ readonly legacy: boolean;
11
+ readonly points: number;
12
+ readonly gamePercentUnlocked: number;
13
+ readonly globalPercentUnlocked: number;
14
+ }
15
+ export interface AchievementTiered {
16
+ readonly name: string;
17
+ readonly description: string;
18
+ readonly legacy: boolean;
19
+ readonly tiers: readonly AchievementTier[];
20
+ }
21
+ export interface AchievementsGame {
22
+ readonly totalPoints: number;
23
+ readonly totalLegacyPoints: number;
24
+ readonly oneTime: Record<string, AchievementOneTime>;
25
+ readonly tiered: Record<string, AchievementTiered>;
26
+ }
27
+ /** Parses the achievement registry (`/resources/achievements`) into a typed object. */
28
+ export declare function parseAchievements(achievements: Record<string, unknown>): Record<string, AchievementsGame>;
29
+ //# sourceMappingURL=resources-achievements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-achievements.d.ts","sourceRoot":"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esModule", { value: true });
3
+ exports.parseAchievements = parseAchievements;
4
+ const common_1 = require("./common");
5
+ function toRecord(value) {
6
+ return typeof value === "object" && value !== null && !Array.isArray(value)
7
+ ? value
8
+ : {};
9
+ }
10
+ function toArray(value) {
11
+ return Array.isArray(value) ? value : [];
12
+ }
13
+ function parseOneTime(value) {
14
+ const raw = toRecord(value);
15
+ return {
16
+ name: (0, common_1.str)(raw, "name"),
17
+ description: (0, common_1.str)(raw, "description"),
18
+ secret: (0, common_1.bool)(raw, "secret"),
19
+ legacy: (0, common_1.bool)(raw, "legacy"),
20
+ points: (0, common_1.num)(raw, "points"),
21
+ gamePercentUnlocked: (0, common_1.num)(raw, "gamePercentUnlocked"),
22
+ globalPercentUnlocked: (0, common_1.num)(raw, "globalPercentUnlocked"),
23
+ };
24
+ }
25
+ function parseTier(value) {
26
+ const raw = toRecord(value);
27
+ return {
28
+ tier: (0, common_1.num)(raw, "tier"),
29
+ points: (0, common_1.num)(raw, "points"),
30
+ amount: (0, common_1.num)(raw, "amount"),
31
+ };
32
+ }
33
+ function parseTiered(value) {
34
+ const raw = toRecord(value);
35
+ return {
36
+ name: (0, common_1.str)(raw, "name"),
37
+ description: (0, common_1.str)(raw, "description"),
38
+ legacy: (0, common_1.bool)(raw, "legacy"),
39
+ tiers: toArray(raw.tiers).map(parseTier),
40
+ };
41
+ }
42
+ function parseGame(value) {
43
+ const raw = toRecord(value);
44
+ const oneTime = {};
45
+ for (const [key, achievement] of Object.entries((0, common_1.obj)(raw, "one_time"))) {
46
+ oneTime[key] = parseOneTime(achievement);
47
+ }
48
+ const tiered = {};
49
+ for (const [key, achievement] of Object.entries((0, common_1.obj)(raw, "tiered"))) {
50
+ tiered[key] = parseTiered(achievement);
51
+ }
52
+ return {
53
+ totalPoints: (0, common_1.num)(raw, "total_points"),
54
+ totalLegacyPoints: (0, common_1.num)(raw, "total_legacy_points"),
55
+ oneTime,
56
+ tiered,
57
+ };
58
+ }
59
+ /** Parses the achievement registry (`/resources/achievements`) into a typed object. */
60
+ function parseAchievements(achievements) {
61
+ const result = {};
62
+ for (const [game, value] of Object.entries(achievements)) {
63
+ result[game] = parseGame(value);
64
+ }
65
+ return result;
66
+ }
67
+ //# sourceMappingURL=resources-achievements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-achievements.js","sourceRoot":"","sources":["../src/resources-achievements.ts"],"names":[],"mappings":";;AA6FA,8CAQC;AArGD,qCAA+C;AAgC/C,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzE,CAAC,CAAE,KAAiC;QACpC,CAAC,CAAC,EAAE,CAAC;AACT,CAAC;AAED,SAAS,OAAO,CAAC,KAAc;IAC7B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3C,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5B,OAAO;QACL,IAAI,EAAE,IAAA,YAAG,EAAC,GAAG,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,IAAA,YAAG,EAAC,GAAG,EAAE,aAAa,CAAC;QACpC,MAAM,EAAE,IAAA,aAAI,EAAC,GAAG,EAAE,QAAQ,CAAC;QAC3B,MAAM,EAAE,IAAA,aAAI,EAAC,GAAG,EAAE,QAAQ,CAAC;QAC3B,MAAM,EAAE,IAAA,YAAG,EAAC,GAAG,EAAE,QAAQ,CAAC;QAC1B,mBAAmB,EAAE,IAAA,YAAG,EAAC,GAAG,EAAE,qBAAqB,CAAC;QACpD,qBAAqB,EAAE,IAAA,YAAG,EAAC,GAAG,EAAE,uBAAuB,CAAC;KACzD,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,MAAM,G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C;IACzC,CAAC;IACD,OAAO;QACL,WAAW,EAAE,IAAA,YAAG,EAAC,GAAG,EAAE,cAAc,CAAC;QACrC,iBAAiB,EAAE,IAAA,YAAG,EAAC,GAAG,EAAE,qBAAqB,CAAC;QAClD,OAAO;QACP,MAAM;KACP,CAAC;AACJ,CAAC;AAED,uFAAuF;AACvF,SAAgB,iBAAiB,CAC/B,YAAqC;IAErC,MAAM,MAAM,GAAqC,EAAE,CAAC;IACpD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACzD,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,12 @@
1
+ export interface ResourceChallengeReward {
2
+ readonly type: string;
3
+ readonly amount: number;
4
+ }
5
+ export interface ResourceChallenge {
6
+ readonly id: string;
7
+ readonly name: string;
8
+ readonly rewards: readonly ResourceChallengeReward[];
9
+ }
10
+ /** Parses the challenge registry (`/resources/challenges`) into a typed object. */
11
+ export declare function parseChallenges(challenges: Record<string, unknown>): Record<string, readonly ResourceChallenge[]>;
12
+ //# sourceMappingURL=resources-challenges.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-challenges.d.ts","sourceRoot":"","sources":["../src/resources-challenges.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,uBAAuB,EAAE,CAAC;CACtD;AA6BD,mFAAmF;AACnF,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,MAAM,CAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,CAAC,CAM9C"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseChallenges = parseChallenges;
4
+ const common_1 = require("./common");
5
+ function asRecord(value) {
6
+ return typeof value === "object" && value !== null && !Array.isArray(value)
7
+ ? value
8
+ : {};
9
+ }
10
+ function asArray(value) {
11
+ return Array.isArray(value) ? value : [];
12
+ }
13
+ function parseReward(value) {
14
+ const reward = asRecord(value);
15
+ return {
16
+ type: (0, common_1.str)(reward, "type"),
17
+ amount: (0, common_1.num)(reward, "amount"),
18
+ };
19
+ }
20
+ function parseChallenge(value) {
21
+ const challenge = asRecord(value);
22
+ return {
23
+ id: (0, common_1.str)(challenge, "id"),
24
+ name: (0, common_1.str)(challenge, "name"),
25
+ rewards: asArray(challenge.rewards).map(parseReward),
26
+ };
27
+ }
28
+ /** Parses the challenge registry (`/resources/challenges`) into a typed object. */
29
+ function parseChallenges(challenges) {
30
+ const result = {};
31
+ for (const [game, value] of Object.entries(asRecord(challenges))) {
32
+ result[game] = asArray(value).map(parseChallenge);
33
+ }
34
+ return result;
35
+ }
36
+ //# sourceMappingURL=resources-challenges.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-challenges.js","sourceRoot":"","sources":["../src/resources-challenges.ts"],"names":[],"mappings":";;AAyCA,0CAQC;AAjDD,qCAAoC;AAapC,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzE,CAAC,CAAE,KAAiC;QACpC,CAAC,CAAC,EAAE,CAAC;AACT,CAAC;AAED,SAAS,OAAO,CAAC,KAAc;IAC7B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3C,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/B,OAAO;QACL,IAAI,EAAE,IAAA,YAAG,EAAC,MAAM,EAAE,MAAM,CAAC;QACzB,MAAM,EAAE,IAAA,YAAG,EAAC,MAAM,EAAE,QAAQ,CAAC;KAC9B,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IACpC,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClC,OAAO;QACL,EAAE,EAAE,IAAA,YAAG,EAAC,SAAS,EAAE,IAAI,CAAC;QACxB,IAAI,EAAE,IAAA,YAAG,EAAC,SAAS,EAAE,MAAM,CAAC;QAC5B,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC;KACrD,CAAC;AACJ,CAAC;AAED,mFAAmF;AACnF,SAAgB,eAAe,CAC7B,UAAmC;IAEnC,MAAM,MAAM,GAAiD,EAAE,CAAC;IAChE,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QACjE,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,10 @@
1
+ export interface GameDefinition {
2
+ readonly id: number;
3
+ readonly name: string;
4
+ readonly databaseName: string;
5
+ readonly legacy: boolean;
6
+ readonly modeNames: Readonly<Record<string, string>>;
7
+ }
8
+ /** Parses the game registry (`/resources/games`) into a typed object. */
9
+ export declare function parseGames(games: Record<string, unknown>): Readonly<Record<string, GameDefinition>>;
10
+ //# sourceMappingURL=resources-games.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-games.d.ts","sourceRoot":"","sources":["../src/resources-games.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACtD;AAaD,yEAAyE;AACzE,wBAAgB,UAAU,CACxB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAa1C"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseGames = parseGames;
4
+ const common_1 = require("./common");
5
+ function parseModeNames(game) {
6
+ const modes = (0, common_1.obj)(game, "modeNames");
7
+ const out = {};
8
+ for (const key of Object.keys(modes)) {
9
+ out[key] = (0, common_1.str)(modes, key);
10
+ }
11
+ return out;
12
+ }
13
+ /** Parses the game registry (`/resources/games`) into a typed object. */
14
+ function parseGames(games) {
15
+ const out = {};
16
+ for (const key of Object.keys(games)) {
17
+ const game = (0, common_1.obj)(games, key);
18
+ out[key] = {
19
+ id: (0, common_1.num)(game, "id"),
20
+ name: (0, common_1.str)(game, "name"),
21
+ databaseName: (0, common_1.str)(game, "databaseName"),
22
+ legacy: (0, common_1.bool)(game, "legacy"),
23
+ modeNames: parseModeNames(game),
24
+ };
25
+ }
26
+ return out;
27
+ }
28
+ //# sourceMappingURL=resources-games.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-games.js","sourceRoot":"","sources":["../src/resources-games.ts"],"names":[],"mappings":";;AAsBA,gCAeC;AArCD,qCAA+C;AAU/C,SAAS,cAAc,CACrB,IAA6B;IAE7B,MAAM,KAAK,GAAG,IAAA,YAAG,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACrC,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAA,YAAG,EAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,yEAAyE;AACzE,SAAgB,UAAU,CACxB,KAA8B;IAE9B,MAAM,GAAG,GAAmC,EAAE,CAAC;IAC/C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,IAAA,YAAG,EAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC7B,GAAG,CAAC,GAAG,CAAC,GAAG;YACT,EAAE,EAAE,IAAA,YAAG,EAAC,IAAI,EAAE,IAAI,CAAC;YACnB,IAAI,EAAE,IAAA,YAAG,EAAC,IAAI,EAAE,MAAM,CAAC;YACvB,YAAY,EAAE,IAAA,YAAG,EAAC,IAAI,EAAE,cAAc,CAAC;YACvC,MAAM,EAAE,IAAA,aAAI,EAAC,IAAI,EAAE,QAAQ,CAAC;YAC5B,SAAS,EAAE,cAAc,CAAC,IAAI,CAAC;SAChC,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,23 @@
1
+ export interface GuildAchievementTier {
2
+ readonly tier: number;
3
+ readonly amount: number;
4
+ }
5
+ export interface GuildOneTimeAchievement {
6
+ readonly name: string;
7
+ readonly description: string;
8
+ readonly points: number;
9
+ }
10
+ export interface GuildTieredAchievement {
11
+ readonly name: string;
12
+ readonly description: string;
13
+ readonly tiers: readonly GuildAchievementTier[];
14
+ }
15
+ export interface GuildAchievements {
16
+ readonly success: boolean;
17
+ readonly lastUpdated: Date | null;
18
+ readonly oneTime: Record<string, GuildOneTimeAchievement>;
19
+ readonly tiered: Record<string, GuildTieredAchievement>;
20
+ }
21
+ /** Parses the guild achievement registry (`/resources/guilds/achievements`) into a typed object. */
22
+ export declare function parseGuildAchievements(raw: Record<string, unknown>): GuildAchievements | null;
23
+ //# sourceMappingURL=resources-guild-achievements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-guild-achievements.d.ts","sourceRoot":"","sources":["../src/resources-guild-achievements.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACjD;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;IAC1D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;CACzD;AAsCD,oGAAoG;AACpG,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3B,iBAAiB,GAAG,IAAI,CAkB1B"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseGuildAchievements = parseGuildAchievements;
4
+ const common_1 = require("./common");
5
+ function toRecord(value) {
6
+ return typeof value === "object" && value !== null && !Array.isArray(value)
7
+ ? value
8
+ : {};
9
+ }
10
+ function toArray(value) {
11
+ return Array.isArray(value) ? value : [];
12
+ }
13
+ function parseTier(value) {
14
+ const raw = toRecord(value);
15
+ return {
16
+ tier: (0, common_1.num)(raw, "tier"),
17
+ amount: (0, common_1.num)(raw, "amount"),
18
+ };
19
+ }
20
+ function parseOneTime(value) {
21
+ const raw = toRecord(value);
22
+ return {
23
+ name: (0, common_1.str)(raw, "name"),
24
+ description: (0, common_1.str)(raw, "description"),
25
+ points: (0, common_1.num)(raw, "points"),
26
+ };
27
+ }
28
+ function parseTiered(value) {
29
+ const raw = toRecord(value);
30
+ return {
31
+ name: (0, common_1.str)(raw, "name"),
32
+ description: (0, common_1.str)(raw, "description"),
33
+ tiers: toArray(raw.tiers).map(parseTier),
34
+ };
35
+ }
36
+ /** Parses the guild achievement registry (`/resources/guilds/achievements`) into a typed object. */
37
+ function parseGuildAchievements(raw) {
38
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
39
+ return null;
40
+ }
41
+ const oneTime = {};
42
+ for (const [key, value] of Object.entries((0, common_1.obj)(raw, "one_time"))) {
43
+ oneTime[key] = parseOneTime(value);
44
+ }
45
+ const tiered = {};
46
+ for (const [key, value] of Object.entries((0, common_1.obj)(raw, "tiered"))) {
47
+ tiered[key] = parseTiered(value);
48
+ }
49
+ return {
50
+ success: (0, common_1.bool)(raw, "success"),
51
+ lastUpdated: (0, common_1.date)(raw, "lastUpdated"),
52
+ oneTime,
53
+ tiered,
54
+ };
55
+ }
56
+ //# sourceMappingURL=resources-guild-achievements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-guild-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,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC;KACzC,CAAC;AACJ,CAAC;AAED,oGAAoG;AACpG,SAAgB,sBAAsB,CACpC,GAA4B;IAE5B,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,OAAO,GAA4C,EAAE,CAAC;IAC5D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAA,YAAG,EAAC,GAAG,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC;QAChE,OAAO,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IACD,MAAM,MAAM,GAA2C,EAAE,CAAC;IAC1D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAA,YAAG,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC;QAC9D,MAAM,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IACD,OAAO;QACL,OAAO,EAAE,IAAA,aAAI,EAAC,GAAG,EAAE,SAAS,CAAC;QAC7B,WAAW,EAAE,IAAA,aAAI,EAAC,GAAG,EAAE,aAAa,CAAC;QACrC,OAAO;QACP,MAAM;KACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,23 @@
1
+ export interface ResourceQuestReward {
2
+ readonly type: string;
3
+ readonly amount: number;
4
+ }
5
+ export interface ResourceQuestObjective {
6
+ readonly id: string;
7
+ readonly type: string;
8
+ readonly integer: number;
9
+ }
10
+ export interface ResourceQuestRequirement {
11
+ readonly type: string;
12
+ }
13
+ export interface ResourceQuest {
14
+ readonly id: string;
15
+ readonly name: string;
16
+ readonly description: string;
17
+ readonly rewards: readonly ResourceQuestReward[];
18
+ readonly objectives: readonly ResourceQuestObjective[];
19
+ readonly requirements: readonly ResourceQuestRequirement[];
20
+ }
21
+ /** Parses the quest registry (`/resources/quests`) into a typed object. */
22
+ export declare function parseQuests(quests: Record<string, unknown>): Record<string, ResourceQuest[]>;
23
+ //# sourceMappingURL=resources-quests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-quests.d.ts","sourceRoot":"","sources":["../src/resources-quests.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACjD,QAAQ,CAAC,UAAU,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACvD,QAAQ,CAAC,YAAY,EAAE,SAAS,wBAAwB,EAAE,CAAC;CAC5D;AAgDD,2EAA2E;AAC3E,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,CAMjC"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseQuests = parseQuests;
4
+ const common_1 = require("./common");
5
+ function toRecord(value) {
6
+ return typeof value === "object" && value !== null && !Array.isArray(value)
7
+ ? value
8
+ : {};
9
+ }
10
+ function toArray(value) {
11
+ return Array.isArray(value) ? value : [];
12
+ }
13
+ function parseReward(value) {
14
+ const reward = toRecord(value);
15
+ return {
16
+ type: (0, common_1.str)(reward, "type"),
17
+ amount: (0, common_1.num)(reward, "amount"),
18
+ };
19
+ }
20
+ function parseObjective(value) {
21
+ const objective = toRecord(value);
22
+ return {
23
+ id: (0, common_1.str)(objective, "id"),
24
+ type: (0, common_1.str)(objective, "type"),
25
+ integer: (0, common_1.num)(objective, "integer"),
26
+ };
27
+ }
28
+ function parseRequirement(value) {
29
+ const requirement = toRecord(value);
30
+ return {
31
+ type: (0, common_1.str)(requirement, "type"),
32
+ };
33
+ }
34
+ function parseQuest(value) {
35
+ const quest = toRecord(value);
36
+ return {
37
+ id: (0, common_1.str)(quest, "id"),
38
+ name: (0, common_1.str)(quest, "name"),
39
+ description: (0, common_1.str)(quest, "description"),
40
+ rewards: toArray(quest.rewards).map(parseReward),
41
+ objectives: toArray(quest.objectives).map(parseObjective),
42
+ requirements: toArray(quest.requirements).map(parseRequirement),
43
+ };
44
+ }
45
+ /** Parses the quest registry (`/resources/quests`) into a typed object. */
46
+ function parseQuests(quests) {
47
+ const result = {};
48
+ for (const [game, value] of Object.entries(quests)) {
49
+ result[game] = toArray(value).map(parseQuest);
50
+ }
51
+ return result;
52
+ }
53
+ //# sourceMappingURL=resources-quests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-quests.js","sourceRoot":"","sources":["../src/resources-quests.ts"],"names":[],"mappings":";;AAyEA,kCAQC;AAjFD,qCAAoC;AA0BpC,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACzE,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,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC;QAChD,UAAU,EAAE,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC;QACzD,YAAY,EAAE,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC;KAChE,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,SAAgB,WAAW,CACzB,MAA+B;IAE/B,MAAM,MAAM,GAAoC,EAAE,CAAC;IACnD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACnD,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,19 @@
1
+ export interface VanityItem {
2
+ readonly key: string;
3
+ readonly name: string;
4
+ readonly rarity: string;
5
+ readonly package: string;
6
+ }
7
+ export interface VanityRarity {
8
+ readonly name: string;
9
+ readonly color: string;
10
+ }
11
+ export interface VanityResource {
12
+ readonly types: readonly VanityItem[];
13
+ readonly rarities: readonly VanityRarity[];
14
+ }
15
+ /** Parses the vanity pet registry (`/resources/vanity/pets`) into a typed object. */
16
+ export declare function parseVanityPets(data: Record<string, unknown>): VanityResource;
17
+ /** Parses the vanity companion registry (`/resources/vanity/companions`) into a typed object. */
18
+ export declare function parseVanityCompanions(data: Record<string, unknown>): VanityResource;
19
+ //# sourceMappingURL=resources-vanity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-vanity.d.ts","sourceRoot":"","sources":["../src/resources-vanity.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;CAC5C;AAuBD,qFAAqF;AACrF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,cAAc,CAE7E;AAED,iGAAiG;AACjG,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,cAAc,CAEhB"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseVanityPets = parseVanityPets;
4
+ exports.parseVanityCompanions = parseVanityCompanions;
5
+ const common_1 = require("./common");
6
+ function isObject(value) {
7
+ return typeof value === "object" && value !== null && !Array.isArray(value);
8
+ }
9
+ function parseVanity(data) {
10
+ const types = Array.isArray(data.types) ? data.types : [];
11
+ const rarities = Array.isArray(data.rarities) ? data.rarities : [];
12
+ return {
13
+ types: types.filter(isObject).map((item) => ({
14
+ key: (0, common_1.str)(item, "key"),
15
+ name: (0, common_1.str)(item, "name"),
16
+ rarity: (0, common_1.str)(item, "rarity"),
17
+ package: (0, common_1.str)(item, "package"),
18
+ })),
19
+ rarities: rarities.filter(isObject).map((rarity) => ({
20
+ name: (0, common_1.str)(rarity, "name"),
21
+ color: (0, common_1.str)(rarity, "color"),
22
+ })),
23
+ };
24
+ }
25
+ /** Parses the vanity pet registry (`/resources/vanity/pets`) into a typed object. */
26
+ function parseVanityPets(data) {
27
+ return parseVanity(data);
28
+ }
29
+ /** Parses the vanity companion registry (`/resources/vanity/companions`) into a typed object. */
30
+ function parseVanityCompanions(data) {
31
+ return parseVanity(data);
32
+ }
33
+ //# sourceMappingURL=resources-vanity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-vanity.js","sourceRoot":"","sources":["../src/resources-vanity.ts"],"names":[],"mappings":";;AAyCA,0CAEC;AAGD,sDAIC;AAlDD,qCAA+B;AAmB/B,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,WAAW,CAAC,IAA6B;IAChD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1D,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IACnE,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC3C,GAAG,EAAE,IAAA,YAAG,EAAC,IAAI,EAAE,KAAK,CAAC;YACrB,IAAI,EAAE,IAAA,YAAG,EAAC,IAAI,EAAE,MAAM,CAAC;YACvB,MAAM,EAAE,IAAA,YAAG,EAAC,IAAI,EAAE,QAAQ,CAAC;YAC3B,OAAO,EAAE,IAAA,YAAG,EAAC,IAAI,EAAE,SAAS,CAAC;SAC9B,CAAC,CAAC;QACH,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,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