@wfcd/relics 2.0.28 → 2.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,235 @@
1
+ ## [2.0.30](https://github.com/WFCD/warframe-relic-data/compare/v2.0.29...v2.0.30) (2026-08-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **sec:** bump brace-expansion ([#415](https://github.com/WFCD/warframe-relic-data/issues/415)) ([7b2ef5e](https://github.com/WFCD/warframe-relic-data/commit/7b2ef5e839c00d591e5e0b63a397d98ba8aae4f6))
7
+
8
+ ## [2.0.29](https://github.com/WFCD/warframe-relic-data/compare/v2.0.28...v2.0.29) (2026-02-23)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * pkg contents all dist ([#370](https://github.com/WFCD/warframe-relic-data/issues/370)) ([2217f4b](https://github.com/WFCD/warframe-relic-data/commit/2217f4b72b919d8cd9e57b88d9e7c4093d0cf550))
14
+
15
+ ## [2.0.28](https://github.com/WFCD/warframe-relic-data/compare/v2.0.27...v2.0.28) (2026-02-23)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **#367:** add .toLowerCase to prevent silent misses ([#369](https://github.com/WFCD/warframe-relic-data/issues/369)) ([3505aad](https://github.com/WFCD/warframe-relic-data/commit/3505aada799265b157542db46a9a18bcd300f2aa)), closes [#367](https://github.com/WFCD/warframe-relic-data/issues/367)
21
+
22
+ ## [2.0.27](https://github.com/WFCD/warframe-relic-data/compare/v2.0.26...v2.0.27) (2026-02-22)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * split configs, update to tsdown ([#368](https://github.com/WFCD/warframe-relic-data/issues/368)) ([ddf07bb](https://github.com/WFCD/warframe-relic-data/commit/ddf07bbb7b50d94b79307b7685324c7b7ca26ac4))
28
+
29
+ ## [2.0.26](https://github.com/WFCD/warframe-relic-data/compare/v2.0.25...v2.0.26) (2026-02-22)
30
+
31
+
32
+ ### Bug Fixes
33
+
34
+ * **#361:** migrate to wfm v2 api ([#366](https://github.com/WFCD/warframe-relic-data/issues/366)) ([bf694b8](https://github.com/WFCD/warframe-relic-data/commit/bf694b859af1f18d6c0573681a8c05f4371ad5f8)), closes [#361](https://github.com/WFCD/warframe-relic-data/issues/361)
35
+
36
+ ## [2.0.25](https://github.com/WFCD/warframe-relic-data/compare/v2.0.24...v2.0.25) (2025-12-13)
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * bump warframe-patchlogs from 2.127.0 to 2.148.0 ([#356](https://github.com/WFCD/warframe-relic-data/issues/356)) ([1b1b71c](https://github.com/WFCD/warframe-relic-data/commit/1b1b71c1fa442182559cd54206d30581d33d724b))
42
+
43
+ ## [2.0.24](https://github.com/WFCD/warframe-relic-data/compare/v2.0.23...v2.0.24) (2025-11-29)
44
+
45
+
46
+ ### Bug Fixes
47
+
48
+ * bump warframe-patchlogs from 2.88.0 to 2.88.2 ([#353](https://github.com/WFCD/warframe-relic-data/issues/353)) ([8e1396a](https://github.com/WFCD/warframe-relic-data/commit/8e1396a854095e791c5fe1d3d90072beba44b61e))
49
+
50
+ ## [2.0.23](https://github.com/WFCD/warframe-relic-data/compare/v2.0.22...v2.0.23) (2025-10-25)
51
+
52
+
53
+ ### Bug Fixes
54
+
55
+ * bump warframe-patchlogs from 2.81.0 to 2.86.0 ([#343](https://github.com/WFCD/warframe-relic-data/issues/343)) ([78c6387](https://github.com/WFCD/warframe-relic-data/commit/78c6387cd423273bd90e9c251170e2cf55d21310))
56
+
57
+ ## [2.0.22](https://github.com/WFCD/warframe-relic-data/compare/v2.0.21...v2.0.22) (2025-10-14)
58
+
59
+
60
+ ### Bug Fixes
61
+
62
+ * provenance & oidc ([#337](https://github.com/WFCD/warframe-relic-data/issues/337)) ([031e3b3](https://github.com/WFCD/warframe-relic-data/commit/031e3b319f7662f5c83121b6ec18e67fca268b51))
63
+
64
+ ## [2.0.21](https://github.com/WFCD/warframe-relic-data/compare/v2.0.20...v2.0.21) (2025-03-01)
65
+
66
+
67
+ ### Bug Fixes
68
+
69
+ * bump warframe-patchlogs from 2.61.0 to 2.71.0 ([#294](https://github.com/WFCD/warframe-relic-data/issues/294)) ([b4e2cf9](https://github.com/WFCD/warframe-relic-data/commit/b4e2cf9d1f43470b08629a4ff612bb41493c0a8f))
70
+
71
+ ## [2.0.20](https://github.com/WFCD/warframe-relic-data/compare/v2.0.19...v2.0.20) (2024-12-22)
72
+
73
+
74
+ ### Bug Fixes
75
+
76
+ * bump warframe-patchlogs from 2.52.0 to 2.55.0 ([#279](https://github.com/WFCD/warframe-relic-data/issues/279)) ([0689dc7](https://github.com/WFCD/warframe-relic-data/commit/0689dc7321aad0dd2389853b490430192976607c))
77
+
78
+ ## [2.0.19](https://github.com/WFCD/warframe-relic-data/compare/v2.0.18...v2.0.19) (2024-12-15)
79
+
80
+
81
+ ### Bug Fixes
82
+
83
+ * bump warframe-patchlogs from 2.51.0 to 2.52.0 ([#278](https://github.com/WFCD/warframe-relic-data/issues/278)) ([5a5a40c](https://github.com/WFCD/warframe-relic-data/commit/5a5a40ce80d35cb060102514badee366bda849e2))
84
+
85
+ ## [2.0.18](https://github.com/WFCD/warframe-relic-data/compare/v2.0.17...v2.0.18) (2024-10-19)
86
+
87
+
88
+ ### Bug Fixes
89
+
90
+ * bump warframe-patchlogs from 2.46.0 to 2.48.0 ([#260](https://github.com/WFCD/warframe-relic-data/issues/260)) ([4a44d46](https://github.com/WFCD/warframe-relic-data/commit/4a44d466023269aaa89cf2b9442913aabaf37d66))
91
+
92
+ ## [2.0.17](https://github.com/WFCD/warframe-relic-data/compare/v2.0.16...v2.0.17) (2024-10-15)
93
+
94
+
95
+ ### Bug Fixes
96
+
97
+ * bump warframe-patchlogs from 2.44.0 to 2.46.0 ([#256](https://github.com/WFCD/warframe-relic-data/issues/256)) ([7d97baf](https://github.com/WFCD/warframe-relic-data/commit/7d97baf50f771d76480904a03f0763a3a6ddfda4))
98
+
99
+ ## [2.0.16](https://github.com/WFCD/warframe-relic-data/compare/v2.0.15...v2.0.16) (2024-10-08)
100
+
101
+
102
+ ### Bug Fixes
103
+
104
+ * bump warframe-patchlogs from 2.41.0 to 2.44.0 ([#255](https://github.com/WFCD/warframe-relic-data/issues/255)) ([0ac9a2f](https://github.com/WFCD/warframe-relic-data/commit/0ac9a2f42043921acc4aaa269ba400505ef1cdb3))
105
+
106
+ ## [2.0.15](https://github.com/WFCD/warframe-relic-data/compare/v2.0.14...v2.0.15) (2024-08-24)
107
+
108
+
109
+ ### Bug Fixes
110
+
111
+ * bump warframe-patchlogs from 2.31.0 to 2.34.0 ([#241](https://github.com/WFCD/warframe-relic-data/issues/241)) ([889c218](https://github.com/WFCD/warframe-relic-data/commit/889c21848b4f3698329fb764841a7c1329393e46))
112
+
113
+ ## [2.0.14](https://github.com/WFCD/warframe-relic-data/compare/v2.0.13...v2.0.14) (2024-07-27)
114
+
115
+
116
+ ### Bug Fixes
117
+
118
+ * bump warframe-patchlogs from 2.27.0 to 2.31.0 ([#231](https://github.com/WFCD/warframe-relic-data/issues/231)) ([7e562b4](https://github.com/WFCD/warframe-relic-data/commit/7e562b42df5bf4522bd157cb0a2b989c89d90ed5))
119
+
120
+ ## [2.0.13](https://github.com/WFCD/warframe-relic-data/compare/v2.0.12...v2.0.13) (2024-06-30)
121
+
122
+
123
+ ### Bug Fixes
124
+
125
+ * **patchlogs:** Bump 2.26.0 to 2.27.0 ([#223](https://github.com/WFCD/warframe-relic-data/issues/223)) ([45ad0c6](https://github.com/WFCD/warframe-relic-data/commit/45ad0c693ec19fda26ae5279d382dbe986331c7a))
126
+
127
+ ## [2.0.12](https://github.com/WFCD/warframe-relic-data/compare/v2.0.11...v2.0.12) (2024-05-12)
128
+
129
+
130
+ ### Bug Fixes
131
+
132
+ * bump warframe-patchlogs from 2.16.0 to 2.17.0 ([#210](https://github.com/WFCD/warframe-relic-data/issues/210)) ([cb98746](https://github.com/WFCD/warframe-relic-data/commit/cb987465f5b48fbf9a359bcff3f6a50716f57c74))
133
+
134
+ ## [2.0.11](https://github.com/WFCD/warframe-relic-data/compare/v2.0.10...v2.0.11) (2024-05-04)
135
+
136
+
137
+ ### Bug Fixes
138
+
139
+ * **patchlogs:** bump warframe-patchlogs from 2.14.0 to 2.16.0 ([#207](https://github.com/WFCD/warframe-relic-data/issues/207)) ([03f0e92](https://github.com/WFCD/warframe-relic-data/commit/03f0e920d716912f8e3619aa04efc608e4605489))
140
+
141
+ ## [2.0.10](https://github.com/WFCD/warframe-relic-data/compare/v2.0.9...v2.0.10) (2024-02-18)
142
+
143
+
144
+ ### Bug Fixes
145
+
146
+ * **ci:** clean up peerdeps invoke ([1f48164](https://github.com/WFCD/warframe-relic-data/commit/1f48164342287b54d3babb21fef3ed41af31c519))
147
+
148
+ ## [2.0.9](https://github.com/WFCD/warframe-relic-data/compare/v2.0.8...v2.0.9) (2024-02-18)
149
+
150
+
151
+ ### Bug Fixes
152
+
153
+ * remove install-peerdeps from dev deps ([5a9af27](https://github.com/WFCD/warframe-relic-data/commit/5a9af27fdb0db96c5bcaf560e7c01ea8d8b5c442))
154
+
155
+ ## [2.0.8](https://github.com/WFCD/warframe-relic-data/compare/v2.0.7...v2.0.8) (2023-12-26)
156
+
157
+
158
+ ### Bug Fixes
159
+
160
+ * **patchlogs:** Bump 1.858.0 to 1.868.0 ([#163](https://github.com/WFCD/warframe-relic-data/issues/163)) ([cb3c3fa](https://github.com/WFCD/warframe-relic-data/commit/cb3c3fafd24495f5d3191d9b520467b423e740d1))
161
+
162
+ ## [2.0.7](https://github.com/WFCD/warframe-relic-data/compare/v2.0.6...v2.0.7) (2023-10-21)
163
+
164
+
165
+ ### Bug Fixes
166
+
167
+ * **patchlogs:** Bump 1.849.0 to 1.854.0 ([#141](https://github.com/WFCD/warframe-relic-data/issues/141)) ([eb98a32](https://github.com/WFCD/warframe-relic-data/commit/eb98a327a886e95ad7a207879cdd275cc39ae605))
168
+
169
+ ## [2.0.6](https://github.com/WFCD/warframe-relic-data/compare/v2.0.5...v2.0.6) (2023-09-17)
170
+
171
+
172
+ ### Bug Fixes
173
+
174
+ * **patchlogs:** Bump from 1.842.0 to 1.847.0 ([#127](https://github.com/WFCD/warframe-relic-data/issues/127)) ([e5f2cda](https://github.com/WFCD/warframe-relic-data/commit/e5f2cdadefd177459f347f55ed7b7bcbc9611c8d))
175
+
176
+ ## [2.0.5](https://github.com/WFCD/warframe-relic-data/compare/v2.0.4...v2.0.5) (2023-08-23)
177
+
178
+
179
+ ### Bug Fixes
180
+
181
+ * Bump warframe-patchlogs from 1.837.0 to 1.842.0 ([#114](https://github.com/WFCD/warframe-relic-data/issues/114)) ([2d47b39](https://github.com/WFCD/warframe-relic-data/commit/2d47b39e1bd890dd264db0c99f18a21a68f10c6a))
182
+
183
+ ## [2.0.4](https://github.com/WFCD/warframe-relic-data/compare/v2.0.3...v2.0.4) (2023-06-26)
184
+
185
+
186
+ ### Bug Fixes
187
+
188
+ * Bump warframe-patchlogs from 1.830.0 to 1.834.0 ([#95](https://github.com/WFCD/warframe-relic-data/issues/95)) ([65099d1](https://github.com/WFCD/warframe-relic-data/commit/65099d18734f6c5857e68fb132bb721f237faf84))
189
+
190
+ ## [2.0.3](https://github.com/WFCD/warframe-relic-data/compare/v2.0.2...v2.0.3) (2023-06-03)
191
+
192
+
193
+ ### Bug Fixes
194
+
195
+ * **patchlogs:** Bump warframe-patchlogs from 1.820.0 to 1.830.0 ([#92](https://github.com/WFCD/warframe-relic-data/issues/92)) ([016bd04](https://github.com/WFCD/warframe-relic-data/commit/016bd04db9b2536660df6b4f1760b001e3885422))
196
+
197
+ ## [2.0.2](https://github.com/WFCD/warframe-relic-data/compare/v2.0.1...v2.0.2) (2023-04-29)
198
+
199
+
200
+ ### Bug Fixes
201
+
202
+ * **patchlogs:** Bump warframe-patchlogs from 1.817.0 to 1.820.0 ([#80](https://github.com/WFCD/warframe-relic-data/issues/80)) ([0251d93](https://github.com/WFCD/warframe-relic-data/commit/0251d93b481c0b5633228b8daf6367a9aba149f4))
203
+
204
+ ## [2.0.1](https://github.com/WFCD/warframe-relic-data/compare/v2.0.0...v2.0.1) (2023-03-09)
205
+
206
+
207
+ ### Bug Fixes
208
+
209
+ * **patchlogs:** Bump warframe-patchlogs from 1.795.0 to 1.813.0 ([#63](https://github.com/WFCD/warframe-relic-data/issues/63)) ([aeac5e3](https://github.com/WFCD/warframe-relic-data/commit/aeac5e306cdff1359feb84affa92e936c7da72b2))
210
+
211
+ # [2.0.0](https://github.com/WFCD/warframe-relic-data/compare/v1.0.1...v2.0.0) (2022-10-28)
212
+
213
+
214
+ ### Features
215
+
216
+ * **build:** use the tsup to build the project ([#26](https://github.com/WFCD/warframe-relic-data/issues/26)) ([2f41119](https://github.com/WFCD/warframe-relic-data/commit/2f411194f16e237bd5f55dc582c389c34c86d0fd))
217
+
218
+
219
+ ### BREAKING CHANGES
220
+
221
+ * **build:** bundle files with tsup
222
+
223
+ ## [1.0.1](https://github.com/WFCD/warframe-relic-data/compare/v1.0.0...v1.0.1) (2022-10-12)
224
+
225
+
226
+ ### Performance Improvements
227
+
228
+ * Remove unused 'vaultDate' property ([#17](https://github.com/WFCD/warframe-relic-data/issues/17)) ([5b4d646](https://github.com/WFCD/warframe-relic-data/commit/5b4d646e5dfdc4367b10a008f1ecb045af285088))
229
+
230
+ # 1.0.0 (2022-09-28)
231
+
232
+
233
+ ### Features
234
+
235
+ * logger with level support ([14a81ee](https://github.com/WFCD/warframe-relic-data/commit/14a81eeea0fc8144ef76ec960c8d5e17762211b7))
package/dist/Build.cjs ADDED
@@ -0,0 +1,20 @@
1
+ const require_VersionManager = require("./VersionManager-ZP_iui8x.cjs");
2
+ //#region src/Build.ts
3
+ /**
4
+ * Entrypoint for the build process.
5
+ */
6
+ async function run() {
7
+ const generator = new require_VersionManager.Generator();
8
+ const versionManager = new require_VersionManager.VersionManager();
9
+ const date = Date.now();
10
+ require_VersionManager.Logger_default.log(`Starting build ${date}`);
11
+ if (await versionManager.updateNeeded()) {
12
+ require_VersionManager.Logger_default.log("Found update, starting generation");
13
+ await generator.generate();
14
+ await generator.writeData();
15
+ await versionManager.writeVersion(date);
16
+ } else require_VersionManager.Logger_default.log("No updates found !");
17
+ require_VersionManager.Logger_default.log("Build finished.");
18
+ }
19
+ run().catch(require_VersionManager.Logger_default.error.bind(require_VersionManager.Logger_default));
20
+ //#endregion
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
package/dist/Build.mjs ADDED
@@ -0,0 +1,22 @@
1
+ import "./rolldown-runtime-C0LytTxp.mjs";
2
+ import { n as Generator, r as Logger_default, t as VersionManager } from "./VersionManager-W7wuuPML.mjs";
3
+ //#region src/Build.ts
4
+ /**
5
+ * Entrypoint for the build process.
6
+ */
7
+ async function run() {
8
+ const generator = new Generator();
9
+ const versionManager = new VersionManager();
10
+ const date = Date.now();
11
+ Logger_default.log(`Starting build ${date}`);
12
+ if (await versionManager.updateNeeded()) {
13
+ Logger_default.log("Found update, starting generation");
14
+ await generator.generate();
15
+ await generator.writeData();
16
+ await versionManager.writeVersion(date);
17
+ } else Logger_default.log("No updates found !");
18
+ Logger_default.log("Build finished.");
19
+ }
20
+ run().catch(Logger_default.error.bind(Logger_default));
21
+ //#endregion
22
+ export {};
@@ -0,0 +1,267 @@
1
+ import "./rolldown-runtime-C0LytTxp.mjs";
2
+ import fs from "node:fs/promises";
3
+ import path from "node:path";
4
+ import fetch from "node-fetch";
5
+ import * as console from "node:console";
6
+ //#region src/Config.ts
7
+ const Config = {
8
+ warframeRelicDropUrl: "https://drops.warframestat.us/data/relics.json",
9
+ warframeMarketItemUrl: "https://api.warframe.market/v2/items",
10
+ warframeItemsUrl: "https://api.warframestat.us/items/search/Relics?by=category",
11
+ warframeRelicDropInfoUrl: "https://drops.warframestat.us/data/info.json",
12
+ warframePatchlogsUrl: "https://raw.githubusercontent.com/WFCD/warframe-patchlogs/master/data/patchlogs.json"
13
+ };
14
+ //#endregion
15
+ //#region src/Logger.ts
16
+ const fromString = (logLevelIsh) => {
17
+ switch (logLevelIsh === null || logLevelIsh === void 0 ? void 0 : logLevelIsh.toLowerCase()) {
18
+ case "fatal": return -1;
19
+ case "error":
20
+ case "bad": return 0;
21
+ case "info":
22
+ case "log": return 1;
23
+ case "debug": return 2;
24
+ default: return -1;
25
+ }
26
+ };
27
+ var Logger = class {
28
+ logLevel = fromString(process.env.LOG_LEVEL || "fatal");
29
+ log(message) {
30
+ if (this.logLevel >= 1) console.log(message);
31
+ }
32
+ error(message) {
33
+ if (this.logLevel >= 0) console.error(message);
34
+ }
35
+ debug(message) {
36
+ if (this.logLevel === 2) console.debug(message);
37
+ }
38
+ fatal(message) {
39
+ if (this.logLevel >= -1) {
40
+ console.error(`FATAL: ${message}`);
41
+ throw new Error(message);
42
+ }
43
+ }
44
+ };
45
+ var Logger_default = new Logger();
46
+ //#endregion
47
+ //#region src/Generator.ts
48
+ var Generator = class {
49
+ relicsRaw;
50
+ wfcdItems;
51
+ wfmItems;
52
+ relics;
53
+ constructor() {
54
+ this.relics = [];
55
+ }
56
+ /**
57
+ * Main function to fetch and generate the relic data
58
+ * @returns {Promise<Array<TitaniaRelic>>} The Relics data array
59
+ */
60
+ async generate() {
61
+ Logger_default.log("Starting Generation");
62
+ await this.fetchRawData();
63
+ this.filterWFCDRelics();
64
+ this.generateTitaniaRelics();
65
+ return this.relics;
66
+ }
67
+ /**
68
+ * Fetches all required data from WFCD and WFM.
69
+ */
70
+ async fetchRawData() {
71
+ var _await$relicRequest$j;
72
+ const relicRequest = await fetch(Config.warframeRelicDropUrl);
73
+ if (!relicRequest.ok) {
74
+ Logger_default.error("Failed to fetch Warframe relics from WFCD!");
75
+ return;
76
+ }
77
+ this.relicsRaw = (_await$relicRequest$j = await relicRequest.json()) === null || _await$relicRequest$j === void 0 ? void 0 : _await$relicRequest$j.relics;
78
+ const wfmRequest = await fetch(Config.warframeMarketItemUrl);
79
+ if (!wfmRequest.ok) {
80
+ Logger_default.error("Failed to fetch items from WFM!");
81
+ return;
82
+ }
83
+ this.wfmItems = await wfmRequest.json();
84
+ const wfcdItemRequest = await fetch(Config.warframeItemsUrl);
85
+ if (!wfcdItemRequest.ok) {
86
+ Logger_default.error("Failed to fetch items from WFCD! ");
87
+ return;
88
+ }
89
+ this.wfcdItems = await wfcdItemRequest.json();
90
+ }
91
+ /**
92
+ * Generates the relic data
93
+ * uses WFCD/warframe-drop-data to check what relics exist,
94
+ * and adds information from WFCD/warframe-items and WFM
95
+ */
96
+ generateTitaniaRelics() {
97
+ if (typeof this.relicsRaw === "undefined" || typeof this.wfmItems === "undefined") {
98
+ Logger_default.log("Failed to load relics/item data");
99
+ return;
100
+ }
101
+ const { length } = this.relicsRaw;
102
+ for (let i = 0; i < length; i += 1) {
103
+ const rawRelic = this.relicsRaw[i];
104
+ Logger_default.debug(`[${i + 1}/${length}] ${rawRelic.tier} ${rawRelic.relicName}`);
105
+ const relic = this.generateTitaniaRelic(rawRelic);
106
+ this.relics.push(relic);
107
+ }
108
+ Logger_default.debug(`Finished parsing ${this.relics.length} relics`);
109
+ }
110
+ /**
111
+ * Writes the fully generated data to disk.
112
+ * @param {string} dataDir Directory to store the relic data in. Default: ../data/
113
+ * @param {string} fileName Filename base ex: "Relics" becomes "Relics.json" and "Relics.min.json". Default: "Relics"
114
+ * @param {boolean} generateMin True if a minified json should be generated too. Default: true
115
+ */
116
+ async writeData(dataDir, fileName, generateMin = true) {
117
+ const DataDir = dataDir ?? path.join(__dirname, "..", "data");
118
+ const RelicPath = fileName ? path.join(DataDir, `${fileName}.json`) : path.join(DataDir, "Relics.json");
119
+ await fs.writeFile(RelicPath, JSON.stringify(this.relics, void 0, 4));
120
+ if (generateMin) {
121
+ const RelicMinPath = fileName ? path.join(DataDir, `${fileName}.min.json`) : path.join(DataDir, "Relics.min.json");
122
+ await fs.writeFile(RelicMinPath, JSON.stringify(this.relics));
123
+ }
124
+ }
125
+ /**
126
+ * Generates a single relic from all available data
127
+ * @param {WFCDRelic} rawRelic relic to pull Titania data from
128
+ * @returns {TitaniaRelicReward}
129
+ */
130
+ generateTitaniaRelic(rawRelic) {
131
+ var _this$wfcdItems2;
132
+ var _this$wfmItems2;
133
+ const name = `${rawRelic.tier} ${rawRelic.relicName}`;
134
+ const rewards = rawRelic.rewards.map((rawReward) => {
135
+ var _this$wfmItems;
136
+ var _this$wfcdItems;
137
+ const { chance } = rawReward;
138
+ const { rarity } = rawReward;
139
+ const wfmInfo = (_this$wfmItems = this.wfmItems) === null || _this$wfmItems === void 0 ? void 0 : _this$wfmItems.data.find((x) => {
140
+ return x.i18n.en.name.toLowerCase() === rawReward.itemName.toLowerCase();
141
+ });
142
+ const isSpecial = [
143
+ "Forma",
144
+ "Kuva",
145
+ "Exilus",
146
+ "Riven"
147
+ ].find((x) => rawReward.itemName.toLowerCase().includes(x.toLowerCase()));
148
+ if (!(wfmInfo || isSpecial)) Logger_default.debug(`Failed to find wfm item for ${rawReward.itemName}`);
149
+ const item = {
150
+ name: rawReward.itemName,
151
+ uniqueName: ((_this$wfcdItems = this.wfcdItems) === null || _this$wfcdItems === void 0 || (_this$wfcdItems = _this$wfcdItems.find((x) => x.name.toLowerCase() === `${name.trim()} Intact`.toLowerCase())) === null || _this$wfcdItems === void 0 ? void 0 : _this$wfcdItems.uniqueName) || "",
152
+ warframeMarket: void 0
153
+ };
154
+ if (wfmInfo) item.warframeMarket = {
155
+ id: wfmInfo.id,
156
+ urlName: wfmInfo.slug
157
+ };
158
+ return {
159
+ rarity,
160
+ chance,
161
+ item
162
+ };
163
+ });
164
+ let drops = [];
165
+ const wfcdItem = (_this$wfcdItems2 = this.wfcdItems) === null || _this$wfcdItems2 === void 0 ? void 0 : _this$wfcdItems2.find((x) => x.name.toLowerCase() === `${name.trim()} Intact`.toLowerCase());
166
+ if (!wfcdItem) Logger_default.error(`Failed to get WFCD item for relic: ${name}`);
167
+ if (wfcdItem && wfcdItem.drops) drops = wfcdItem.drops.map((rawDrop) => {
168
+ return {
169
+ rarity: rawDrop.rarity,
170
+ chance: rawDrop.chance,
171
+ location: rawDrop.location
172
+ };
173
+ });
174
+ const wfm = (_this$wfmItems2 = this.wfmItems) === null || _this$wfmItems2 === void 0 ? void 0 : _this$wfmItems2.data.find((x) => {
175
+ return x.i18n.en.name.toLowerCase() === `${name.trim()} Relic`.toLowerCase();
176
+ });
177
+ if (!wfm) Logger_default.error(`Failed to get relic item from wfm: ${name}`);
178
+ return {
179
+ name,
180
+ rewards,
181
+ locations: drops,
182
+ uniqueName: (wfcdItem === null || wfcdItem === void 0 ? void 0 : wfcdItem.uniqueName) || "",
183
+ vaultInfo: { vaulted: drops.length === 0 },
184
+ ...(wfm === null || wfm === void 0 ? void 0 : wfm.id) && (wfm === null || wfm === void 0 ? void 0 : wfm.slug) && { warframeMarket: {
185
+ id: wfm === null || wfm === void 0 ? void 0 : wfm.id,
186
+ urlName: wfm === null || wfm === void 0 ? void 0 : wfm.slug
187
+ } }
188
+ };
189
+ }
190
+ /**
191
+ * Filters WFCD's relic data to only include Intact variants, since we just need the base.
192
+ */
193
+ filterWFCDRelics() {
194
+ var _this$relicsRaw;
195
+ var _this$relicsRaw2;
196
+ var _this$relicsRaw3;
197
+ const before = ((_this$relicsRaw = this.relicsRaw) === null || _this$relicsRaw === void 0 ? void 0 : _this$relicsRaw.length) || 0;
198
+ this.relicsRaw = (_this$relicsRaw2 = this.relicsRaw) === null || _this$relicsRaw2 === void 0 ? void 0 : _this$relicsRaw2.filter((x) => x.state === "Intact");
199
+ Logger_default.log(`Filtered relics to intact variants. Before: ${before} After: ${((_this$relicsRaw3 = this.relicsRaw) === null || _this$relicsRaw3 === void 0 ? void 0 : _this$relicsRaw3.length) || 0}`);
200
+ }
201
+ };
202
+ //#endregion
203
+ //#region src/VersionManager.ts
204
+ var VersionManager = class {
205
+ versionPath;
206
+ versionRawPath;
207
+ hashPath;
208
+ /**
209
+ * Creates a new VersionManager instance.
210
+ * @param {string} dataDir Folder to write version information to.
211
+ * @constructor
212
+ */
213
+ constructor(dataDir) {
214
+ const DataDir = dataDir ?? path.join(__dirname, "..", "data");
215
+ this.versionPath = path.join(DataDir, "version.json");
216
+ this.versionRawPath = path.join(DataDir, "version.txt");
217
+ this.hashPath = path.join(DataDir, "hash.json");
218
+ }
219
+ /**
220
+ * Checks if the current data needs an update
221
+ */
222
+ async updateNeeded() {
223
+ const infoReq = await fetch(Config.warframeRelicDropInfoUrl);
224
+ if (!infoReq.ok) Logger_default.fatal("Failed to fetch version info!");
225
+ const info = await infoReq.json();
226
+ try {
227
+ await fs.access(this.hashPath);
228
+ return JSON.parse(await fs.readFile(this.hashPath, "utf-8")).hash !== info.hash;
229
+ } catch (ex) {
230
+ return true;
231
+ }
232
+ }
233
+ /**
234
+ * Writes both game and drop version metadata
235
+ * @param {number} timestamp Timestamp the build was started at
236
+ */
237
+ async writeVersion(timestamp) {
238
+ const patchLogsReq = await fetch(Config.warframePatchlogsUrl);
239
+ if (!patchLogsReq.ok) {
240
+ Logger_default.error("Failed to fetch patchlogs");
241
+ return;
242
+ }
243
+ const patchlogs = await patchLogsReq.json();
244
+ const version = patchlogs[0].name.replace(/ \+ /g, "--").replace(/[^0-9\-.]/g, "").trim();
245
+ const hashReq = await fetch(Config.warframeRelicDropInfoUrl);
246
+ if (!hashReq.ok) {
247
+ Logger_default.error("Failed to fetch hashInfo");
248
+ return;
249
+ }
250
+ const hashInfo = await hashReq.json();
251
+ const versionInfo = {
252
+ version,
253
+ title: patchlogs[0].name
254
+ };
255
+ const hashFile = {
256
+ hash: hashInfo.hash,
257
+ deUpdated: hashInfo.modified,
258
+ timestamp
259
+ };
260
+ await fs.writeFile(this.hashPath, JSON.stringify(hashFile, void 0, 2), "utf-8");
261
+ await fs.writeFile(this.versionPath, JSON.stringify(versionInfo, void 0, 2), "utf-8");
262
+ await fs.writeFile(this.versionRawPath, version, "utf-8");
263
+ Logger_default.debug("Finished writing version info");
264
+ }
265
+ };
266
+ //#endregion
267
+ export { Generator as n, Logger_default as r, VersionManager as t };