@wfcd/relics 2.0.27 → 2.0.29
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 +228 -0
- package/dist/Build.cjs +22 -0
- package/dist/Build.d.cts +1 -0
- package/dist/Build.d.mts +1 -0
- package/dist/Build.mjs +24 -0
- package/dist/VersionManager-CGY3TWJF.mjs +279 -0
- package/dist/VersionManager-DkHKfTUL.cjs +336 -0
- package/dist/chunk-Dco9itRc.mjs +9 -0
- package/dist/index.cjs +5 -0
- package/dist/index.d.cts +248 -0
- package/dist/index.d.mts +249 -0
- package/dist/index.mjs +1 -1
- package/package.json +7 -9
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __name = (target, value) => __defProp(target, "name", {
|
|
5
|
+
value,
|
|
6
|
+
configurable: true
|
|
7
|
+
});
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
+
key = keys[i];
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
17
|
+
__defProp(to, key, {
|
|
18
|
+
get: ((k) => from[k]).bind(null, key),
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
27
|
+
value: mod,
|
|
28
|
+
enumerable: true
|
|
29
|
+
}) : target, mod));
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
let node_fs_promises = require("node:fs/promises");
|
|
33
|
+
node_fs_promises = __toESM(node_fs_promises);
|
|
34
|
+
let node_path = require("node:path");
|
|
35
|
+
node_path = __toESM(node_path);
|
|
36
|
+
let node_fetch = require("node-fetch");
|
|
37
|
+
node_fetch = __toESM(node_fetch);
|
|
38
|
+
let node_console = require("node:console");
|
|
39
|
+
node_console = __toESM(node_console);
|
|
40
|
+
|
|
41
|
+
//#region src/Config.ts
|
|
42
|
+
const Config = {
|
|
43
|
+
warframeRelicDropUrl: "https://drops.warframestat.us/data/relics.json",
|
|
44
|
+
warframeMarketItemUrl: "https://api.warframe.market/v2/items",
|
|
45
|
+
warframeItemsUrl: "https://api.warframestat.us/items/search/Relics?by=category",
|
|
46
|
+
warframeRelicDropInfoUrl: "https://drops.warframestat.us/data/info.json",
|
|
47
|
+
warframePatchlogsUrl: "https://raw.githubusercontent.com/WFCD/warframe-patchlogs/master/data/patchlogs.json"
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/Logger.ts
|
|
52
|
+
var LogLevel = /* @__PURE__ */ function(LogLevel) {
|
|
53
|
+
LogLevel[LogLevel["FATAL"] = -1] = "FATAL";
|
|
54
|
+
LogLevel[LogLevel["ERROR"] = 0] = "ERROR";
|
|
55
|
+
LogLevel[LogLevel["LOG"] = 1] = "LOG";
|
|
56
|
+
LogLevel[LogLevel["DEBUG"] = 2] = "DEBUG";
|
|
57
|
+
return LogLevel;
|
|
58
|
+
}(LogLevel || {});
|
|
59
|
+
const fromString = (logLevelIsh) => {
|
|
60
|
+
switch (logLevelIsh === null || logLevelIsh === void 0 ? void 0 : logLevelIsh.toLowerCase()) {
|
|
61
|
+
case "fatal": return LogLevel.FATAL;
|
|
62
|
+
case "error":
|
|
63
|
+
case "bad": return LogLevel.ERROR;
|
|
64
|
+
case "info":
|
|
65
|
+
case "log": return LogLevel.LOG;
|
|
66
|
+
case "debug": return LogLevel.DEBUG;
|
|
67
|
+
default: return LogLevel.FATAL;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var Logger = class {
|
|
71
|
+
logLevel = fromString(process.env.LOG_LEVEL || "fatal");
|
|
72
|
+
log(message) {
|
|
73
|
+
if (this.logLevel >= LogLevel.LOG) node_console.log(message);
|
|
74
|
+
}
|
|
75
|
+
error(message) {
|
|
76
|
+
if (this.logLevel >= LogLevel.ERROR) node_console.error(message);
|
|
77
|
+
}
|
|
78
|
+
debug(message) {
|
|
79
|
+
if (this.logLevel === LogLevel.DEBUG) node_console.debug(message);
|
|
80
|
+
}
|
|
81
|
+
fatal(message) {
|
|
82
|
+
if (this.logLevel >= LogLevel.FATAL) {
|
|
83
|
+
node_console.error(`FATAL: ${message}`);
|
|
84
|
+
throw new Error(message);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
var Logger_default = new Logger();
|
|
89
|
+
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/Generator.ts
|
|
92
|
+
var Generator = class {
|
|
93
|
+
relicsRaw;
|
|
94
|
+
wfcdItems;
|
|
95
|
+
wfmItems;
|
|
96
|
+
relics;
|
|
97
|
+
constructor() {
|
|
98
|
+
this.relics = [];
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Main function to fetch and generate the relic data
|
|
102
|
+
* @returns {Promise<Array<TitaniaRelic>>} The Relics data array
|
|
103
|
+
*/
|
|
104
|
+
async generate() {
|
|
105
|
+
Logger_default.log("Starting Generation");
|
|
106
|
+
await this.fetchRawData();
|
|
107
|
+
this.filterWFCDRelics();
|
|
108
|
+
this.generateTitaniaRelics();
|
|
109
|
+
return this.relics;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Fetches all required data from WFCD and WFM.
|
|
113
|
+
*/
|
|
114
|
+
async fetchRawData() {
|
|
115
|
+
var _await$relicRequest$j;
|
|
116
|
+
const relicRequest = await (0, node_fetch.default)(Config.warframeRelicDropUrl);
|
|
117
|
+
if (!relicRequest.ok) {
|
|
118
|
+
Logger_default.error("Failed to fetch Warframe relics from WFCD!");
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this.relicsRaw = (_await$relicRequest$j = await relicRequest.json()) === null || _await$relicRequest$j === void 0 ? void 0 : _await$relicRequest$j.relics;
|
|
122
|
+
const wfmRequest = await (0, node_fetch.default)(Config.warframeMarketItemUrl);
|
|
123
|
+
if (!wfmRequest.ok) {
|
|
124
|
+
Logger_default.error("Failed to fetch items from WFM!");
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
this.wfmItems = await wfmRequest.json();
|
|
128
|
+
const wfcdItemRequest = await (0, node_fetch.default)(Config.warframeItemsUrl);
|
|
129
|
+
if (!wfcdItemRequest.ok) {
|
|
130
|
+
Logger_default.error("Failed to fetch items from WFCD! ");
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
this.wfcdItems = await wfcdItemRequest.json();
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Generates the relic data
|
|
137
|
+
* uses WFCD/warframe-drop-data to check what relics exist,
|
|
138
|
+
* and adds information from WFCD/warframe-items and WFM
|
|
139
|
+
*/
|
|
140
|
+
generateTitaniaRelics() {
|
|
141
|
+
if (typeof this.relicsRaw === "undefined" || typeof this.wfmItems === "undefined") {
|
|
142
|
+
Logger_default.log("Failed to load relics/item data");
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const { length } = this.relicsRaw;
|
|
146
|
+
for (let i = 0; i < length; i += 1) {
|
|
147
|
+
const rawRelic = this.relicsRaw[i];
|
|
148
|
+
Logger_default.debug(`[${i + 1}/${length}] ${rawRelic.tier} ${rawRelic.relicName}`);
|
|
149
|
+
const relic = this.generateTitaniaRelic(rawRelic);
|
|
150
|
+
this.relics.push(relic);
|
|
151
|
+
}
|
|
152
|
+
Logger_default.debug(`Finished parsing ${this.relics.length} relics`);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Writes the fully generated data to disk.
|
|
156
|
+
* @param {string} dataDir Directory to store the relic data in. Default: ../data/
|
|
157
|
+
* @param {string} fileName Filename base ex: "Relics" becomes "Relics.json" and "Relics.min.json". Default: "Relics"
|
|
158
|
+
* @param {boolean} generateMin True if a minified json should be generated too. Default: true
|
|
159
|
+
*/
|
|
160
|
+
async writeData(dataDir, fileName, generateMin = true) {
|
|
161
|
+
const DataDir = dataDir ?? node_path.default.join(__dirname, "..", "data");
|
|
162
|
+
const RelicPath = fileName ? node_path.default.join(DataDir, `${fileName}.json`) : node_path.default.join(DataDir, "Relics.json");
|
|
163
|
+
await node_fs_promises.default.writeFile(RelicPath, JSON.stringify(this.relics, void 0, 4));
|
|
164
|
+
if (generateMin) {
|
|
165
|
+
const RelicMinPath = fileName ? node_path.default.join(DataDir, `${fileName}.min.json`) : node_path.default.join(DataDir, "Relics.min.json");
|
|
166
|
+
await node_fs_promises.default.writeFile(RelicMinPath, JSON.stringify(this.relics));
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Generates a single relic from all available data
|
|
171
|
+
* @param {WFCDRelic} rawRelic relic to pull Titania data from
|
|
172
|
+
* @returns {TitaniaRelicReward}
|
|
173
|
+
*/
|
|
174
|
+
generateTitaniaRelic(rawRelic) {
|
|
175
|
+
var _this$wfcdItems2;
|
|
176
|
+
var _this$wfmItems2;
|
|
177
|
+
const name = `${rawRelic.tier} ${rawRelic.relicName}`;
|
|
178
|
+
const rewards = rawRelic.rewards.map((rawReward) => {
|
|
179
|
+
var _this$wfmItems;
|
|
180
|
+
var _this$wfcdItems;
|
|
181
|
+
const { chance } = rawReward;
|
|
182
|
+
const { rarity } = rawReward;
|
|
183
|
+
const wfmInfo = (_this$wfmItems = this.wfmItems) === null || _this$wfmItems === void 0 ? void 0 : _this$wfmItems.data.find((x) => {
|
|
184
|
+
return x.i18n.en.name.toLowerCase() === rawReward.itemName.toLowerCase();
|
|
185
|
+
});
|
|
186
|
+
const isSpecial = [
|
|
187
|
+
"Forma",
|
|
188
|
+
"Kuva",
|
|
189
|
+
"Exilus",
|
|
190
|
+
"Riven"
|
|
191
|
+
].find((x) => rawReward.itemName.toLowerCase().includes(x.toLowerCase()));
|
|
192
|
+
if (!(wfmInfo || isSpecial)) Logger_default.debug(`Failed to find wfm item for ${rawReward.itemName}`);
|
|
193
|
+
const item = {
|
|
194
|
+
name: rawReward.itemName,
|
|
195
|
+
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) || "",
|
|
196
|
+
warframeMarket: void 0
|
|
197
|
+
};
|
|
198
|
+
if (wfmInfo) item.warframeMarket = {
|
|
199
|
+
id: wfmInfo.id,
|
|
200
|
+
urlName: wfmInfo.slug
|
|
201
|
+
};
|
|
202
|
+
return {
|
|
203
|
+
rarity,
|
|
204
|
+
chance,
|
|
205
|
+
item
|
|
206
|
+
};
|
|
207
|
+
});
|
|
208
|
+
let drops = [];
|
|
209
|
+
const wfcdItem = (_this$wfcdItems2 = this.wfcdItems) === null || _this$wfcdItems2 === void 0 ? void 0 : _this$wfcdItems2.find((x) => x.name.toLowerCase() === `${name.trim()} Intact`.toLowerCase());
|
|
210
|
+
if (!wfcdItem) Logger_default.error(`Failed to get WFCD item for relic: ${name}`);
|
|
211
|
+
if (wfcdItem && wfcdItem.drops) drops = wfcdItem.drops.map((rawDrop) => {
|
|
212
|
+
return {
|
|
213
|
+
rarity: rawDrop.rarity,
|
|
214
|
+
chance: rawDrop.chance,
|
|
215
|
+
location: rawDrop.location
|
|
216
|
+
};
|
|
217
|
+
});
|
|
218
|
+
const wfm = (_this$wfmItems2 = this.wfmItems) === null || _this$wfmItems2 === void 0 ? void 0 : _this$wfmItems2.data.find((x) => {
|
|
219
|
+
return x.i18n.en.name.toLowerCase() === `${name.trim()} Relic`.toLowerCase();
|
|
220
|
+
});
|
|
221
|
+
if (!wfm) Logger_default.error(`Failed to get relic item from wfm: ${name}`);
|
|
222
|
+
return {
|
|
223
|
+
name,
|
|
224
|
+
rewards,
|
|
225
|
+
locations: drops,
|
|
226
|
+
uniqueName: (wfcdItem === null || wfcdItem === void 0 ? void 0 : wfcdItem.uniqueName) || "",
|
|
227
|
+
vaultInfo: { vaulted: drops.length === 0 },
|
|
228
|
+
...(wfm === null || wfm === void 0 ? void 0 : wfm.id) && (wfm === null || wfm === void 0 ? void 0 : wfm.slug) && { warframeMarket: {
|
|
229
|
+
id: wfm === null || wfm === void 0 ? void 0 : wfm.id,
|
|
230
|
+
urlName: wfm === null || wfm === void 0 ? void 0 : wfm.slug
|
|
231
|
+
} }
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Filters WFCD's relic data to only include Intact variants, since we just need the base.
|
|
236
|
+
*/
|
|
237
|
+
filterWFCDRelics() {
|
|
238
|
+
var _this$relicsRaw;
|
|
239
|
+
var _this$relicsRaw2;
|
|
240
|
+
var _this$relicsRaw3;
|
|
241
|
+
const before = ((_this$relicsRaw = this.relicsRaw) === null || _this$relicsRaw === void 0 ? void 0 : _this$relicsRaw.length) || 0;
|
|
242
|
+
this.relicsRaw = (_this$relicsRaw2 = this.relicsRaw) === null || _this$relicsRaw2 === void 0 ? void 0 : _this$relicsRaw2.filter((x) => x.state === "Intact");
|
|
243
|
+
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}`);
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
//#endregion
|
|
248
|
+
//#region src/VersionManager.ts
|
|
249
|
+
var VersionManager = class {
|
|
250
|
+
versionPath;
|
|
251
|
+
versionRawPath;
|
|
252
|
+
hashPath;
|
|
253
|
+
/**
|
|
254
|
+
* Creates a new VersionManager instance.
|
|
255
|
+
* @param {string} dataDir Folder to write version information to.
|
|
256
|
+
* @constructor
|
|
257
|
+
*/
|
|
258
|
+
constructor(dataDir) {
|
|
259
|
+
const DataDir = dataDir ?? node_path.default.join(__dirname, "..", "data");
|
|
260
|
+
this.versionPath = node_path.default.join(DataDir, "version.json");
|
|
261
|
+
this.versionRawPath = node_path.default.join(DataDir, "version.txt");
|
|
262
|
+
this.hashPath = node_path.default.join(DataDir, "hash.json");
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Checks if the current data needs an update
|
|
266
|
+
*/
|
|
267
|
+
async updateNeeded() {
|
|
268
|
+
const infoReq = await (0, node_fetch.default)(Config.warframeRelicDropInfoUrl);
|
|
269
|
+
if (!infoReq.ok) Logger_default.fatal("Failed to fetch version info!");
|
|
270
|
+
const info = await infoReq.json();
|
|
271
|
+
try {
|
|
272
|
+
await node_fs_promises.default.access(this.hashPath);
|
|
273
|
+
return JSON.parse(await node_fs_promises.default.readFile(this.hashPath, "utf-8")).hash !== info.hash;
|
|
274
|
+
} catch (ex) {
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Writes both game and drop version metadata
|
|
280
|
+
* @param {number} timestamp Timestamp the build was started at
|
|
281
|
+
*/
|
|
282
|
+
async writeVersion(timestamp) {
|
|
283
|
+
const patchLogsReq = await (0, node_fetch.default)(Config.warframePatchlogsUrl);
|
|
284
|
+
if (!patchLogsReq.ok) {
|
|
285
|
+
Logger_default.error("Failed to fetch patchlogs");
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
const patchlogs = await patchLogsReq.json();
|
|
289
|
+
const version = patchlogs[0].name.replace(/ \+ /g, "--").replace(/[^0-9\-.]/g, "").trim();
|
|
290
|
+
const hashReq = await (0, node_fetch.default)(Config.warframeRelicDropInfoUrl);
|
|
291
|
+
if (!hashReq.ok) {
|
|
292
|
+
Logger_default.error("Failed to fetch hashInfo");
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
const hashInfo = await hashReq.json();
|
|
296
|
+
const versionInfo = {
|
|
297
|
+
version,
|
|
298
|
+
title: patchlogs[0].name
|
|
299
|
+
};
|
|
300
|
+
const hashFile = {
|
|
301
|
+
hash: hashInfo.hash,
|
|
302
|
+
deUpdated: hashInfo.modified,
|
|
303
|
+
timestamp
|
|
304
|
+
};
|
|
305
|
+
await node_fs_promises.default.writeFile(this.hashPath, JSON.stringify(hashFile, void 0, 2), "utf-8");
|
|
306
|
+
await node_fs_promises.default.writeFile(this.versionPath, JSON.stringify(versionInfo, void 0, 2), "utf-8");
|
|
307
|
+
await node_fs_promises.default.writeFile(this.versionRawPath, version, "utf-8");
|
|
308
|
+
Logger_default.debug("Finished writing version info");
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
//#endregion
|
|
313
|
+
Object.defineProperty(exports, 'Generator', {
|
|
314
|
+
enumerable: true,
|
|
315
|
+
get: function () {
|
|
316
|
+
return Generator;
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
Object.defineProperty(exports, 'Logger_default', {
|
|
320
|
+
enumerable: true,
|
|
321
|
+
get: function () {
|
|
322
|
+
return Logger_default;
|
|
323
|
+
}
|
|
324
|
+
});
|
|
325
|
+
Object.defineProperty(exports, 'VersionManager', {
|
|
326
|
+
enumerable: true,
|
|
327
|
+
get: function () {
|
|
328
|
+
return VersionManager;
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
Object.defineProperty(exports, '__name', {
|
|
332
|
+
enumerable: true,
|
|
333
|
+
get: function () {
|
|
334
|
+
return __name;
|
|
335
|
+
}
|
|
336
|
+
});
|
package/dist/index.cjs
ADDED
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
//#endregion
|
|
2
|
+
//#region src/Types.d.ts
|
|
3
|
+
interface WarframeMarketRoot {
|
|
4
|
+
data: Array<WarframeMarketItem>;
|
|
5
|
+
}
|
|
6
|
+
interface WarframeMarketItem {
|
|
7
|
+
/**
|
|
8
|
+
* WFM Item ID
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
/**
|
|
12
|
+
* Url name for querying WFM
|
|
13
|
+
*/
|
|
14
|
+
slug: string;
|
|
15
|
+
/**
|
|
16
|
+
* WFM language object
|
|
17
|
+
*/
|
|
18
|
+
i18n: {
|
|
19
|
+
/**
|
|
20
|
+
* English language object
|
|
21
|
+
*/
|
|
22
|
+
en: {
|
|
23
|
+
/**
|
|
24
|
+
* Item Name
|
|
25
|
+
*/
|
|
26
|
+
name: string;
|
|
27
|
+
/**
|
|
28
|
+
* Thumbnail URL relative to wfm api base
|
|
29
|
+
*/
|
|
30
|
+
thumb: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
interface WFCDRelic {
|
|
35
|
+
/**
|
|
36
|
+
* Relic Tier (Axi, Neo, etc.)
|
|
37
|
+
*/
|
|
38
|
+
tier: string;
|
|
39
|
+
/**
|
|
40
|
+
* Relic Name (A1, A10, etc.)
|
|
41
|
+
*/
|
|
42
|
+
relicName: string;
|
|
43
|
+
/**
|
|
44
|
+
* Relic Refinement state
|
|
45
|
+
*/
|
|
46
|
+
state: 'Intact' | 'Exceptional' | 'Flawless' | 'Radiant';
|
|
47
|
+
/**
|
|
48
|
+
* Relic Rewards
|
|
49
|
+
*/
|
|
50
|
+
rewards: Array<WFCDRelicReward>;
|
|
51
|
+
/**
|
|
52
|
+
* Internal WFCD id
|
|
53
|
+
*/
|
|
54
|
+
_id: string;
|
|
55
|
+
}
|
|
56
|
+
interface WFCDRelicReward {
|
|
57
|
+
/**
|
|
58
|
+
* Dropped Item name
|
|
59
|
+
*/
|
|
60
|
+
itemName: string;
|
|
61
|
+
/**
|
|
62
|
+
* Dropchance Rarity (Uncommon/Rare ?)
|
|
63
|
+
*/
|
|
64
|
+
rarity: 'Uncommon' | 'Rare';
|
|
65
|
+
/**
|
|
66
|
+
* Actual Dropchance in %
|
|
67
|
+
*/
|
|
68
|
+
chance: number;
|
|
69
|
+
/**
|
|
70
|
+
* Internal ID
|
|
71
|
+
*/
|
|
72
|
+
_id: string;
|
|
73
|
+
}
|
|
74
|
+
interface WFCDItem {
|
|
75
|
+
/**
|
|
76
|
+
* Item Name
|
|
77
|
+
*/
|
|
78
|
+
name: string;
|
|
79
|
+
/** Unique identifying name */
|
|
80
|
+
uniqueName: string;
|
|
81
|
+
/**
|
|
82
|
+
* Item Drop Location
|
|
83
|
+
*/
|
|
84
|
+
drops?: Array<WFCDItemDropLocation>;
|
|
85
|
+
}
|
|
86
|
+
interface WFCDItemDropLocation {
|
|
87
|
+
/**
|
|
88
|
+
* Dropchance in %
|
|
89
|
+
*/
|
|
90
|
+
chance: number;
|
|
91
|
+
/**
|
|
92
|
+
* Mission location
|
|
93
|
+
*/
|
|
94
|
+
location: string;
|
|
95
|
+
/**
|
|
96
|
+
* Drop rarity
|
|
97
|
+
*/
|
|
98
|
+
rarity: string;
|
|
99
|
+
/**
|
|
100
|
+
* Relic Type
|
|
101
|
+
*/
|
|
102
|
+
type: string;
|
|
103
|
+
}
|
|
104
|
+
interface TitaniaRelic {
|
|
105
|
+
/**
|
|
106
|
+
* Relic Combined Name (Ex: Axi A1)
|
|
107
|
+
*/
|
|
108
|
+
name: string;
|
|
109
|
+
/**
|
|
110
|
+
* Relic Rewards when opened
|
|
111
|
+
*/
|
|
112
|
+
rewards: Array<TitaniaRelicReward>;
|
|
113
|
+
/**
|
|
114
|
+
* Drop Locations for the relics
|
|
115
|
+
*/
|
|
116
|
+
locations: Array<TitaniaRelicLocation>;
|
|
117
|
+
/**
|
|
118
|
+
* Warframe Market Information
|
|
119
|
+
* undefined for untradable
|
|
120
|
+
*/
|
|
121
|
+
warframeMarket?: TitaniaWFMInfo;
|
|
122
|
+
/**
|
|
123
|
+
* Relic Vault Information
|
|
124
|
+
*/
|
|
125
|
+
vaultInfo: TitaniaRelicVaultedInfo;
|
|
126
|
+
/** unique name for corresponding warframe-items Item */
|
|
127
|
+
uniqueName: string;
|
|
128
|
+
}
|
|
129
|
+
interface TitaniaRelicReward {
|
|
130
|
+
/**
|
|
131
|
+
* Relic Rarity (Uncommon,Rare ?)
|
|
132
|
+
*/
|
|
133
|
+
rarity: 'Uncommon' | 'Rare';
|
|
134
|
+
/**
|
|
135
|
+
* Reward Drop Chance in %
|
|
136
|
+
*/
|
|
137
|
+
chance: number;
|
|
138
|
+
/**
|
|
139
|
+
* Item Information
|
|
140
|
+
*/
|
|
141
|
+
item: TitaniaRelicRewardItem;
|
|
142
|
+
}
|
|
143
|
+
interface TitaniaRelicRewardItem {
|
|
144
|
+
/**
|
|
145
|
+
* Item Name
|
|
146
|
+
*/
|
|
147
|
+
name: string;
|
|
148
|
+
/** unique name for corresponding warframe-items Item */
|
|
149
|
+
uniqueName: string;
|
|
150
|
+
/**
|
|
151
|
+
* WarframeMarket Info
|
|
152
|
+
*/
|
|
153
|
+
warframeMarket?: TitaniaWFMInfo;
|
|
154
|
+
}
|
|
155
|
+
type Rarity = 'Uncommon' | 'Rare' | 'Legendary' | 'Common';
|
|
156
|
+
interface TitaniaRelicLocation {
|
|
157
|
+
/** Location Info $planet-$node (Ex: Eris - Phalan) */
|
|
158
|
+
location: string;
|
|
159
|
+
/**
|
|
160
|
+
* Rarity (Uncommon, Rare ?)
|
|
161
|
+
*/
|
|
162
|
+
rarity: Rarity;
|
|
163
|
+
/**
|
|
164
|
+
* Dropchance in %
|
|
165
|
+
*/
|
|
166
|
+
chance: number;
|
|
167
|
+
}
|
|
168
|
+
interface TitaniaWFMInfo {
|
|
169
|
+
/**
|
|
170
|
+
* Warframe Market ID
|
|
171
|
+
*/
|
|
172
|
+
id: string;
|
|
173
|
+
/**
|
|
174
|
+
* Warframe market URL parameter
|
|
175
|
+
*/
|
|
176
|
+
urlName: string;
|
|
177
|
+
}
|
|
178
|
+
interface TitaniaRelicVaultedInfo {
|
|
179
|
+
/**
|
|
180
|
+
* If the relic is vaulted
|
|
181
|
+
*/
|
|
182
|
+
vaulted: boolean;
|
|
183
|
+
}
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/Generator.d.ts
|
|
186
|
+
declare class Generator {
|
|
187
|
+
relicsRaw: Array<WFCDRelic> | undefined;
|
|
188
|
+
wfcdItems: Array<WFCDItem> | undefined;
|
|
189
|
+
wfmItems: WarframeMarketRoot | undefined;
|
|
190
|
+
relics: Array<TitaniaRelic>;
|
|
191
|
+
constructor();
|
|
192
|
+
/**
|
|
193
|
+
* Main function to fetch and generate the relic data
|
|
194
|
+
* @returns {Promise<Array<TitaniaRelic>>} The Relics data array
|
|
195
|
+
*/
|
|
196
|
+
generate(): Promise<Array<TitaniaRelic>>;
|
|
197
|
+
/**
|
|
198
|
+
* Fetches all required data from WFCD and WFM.
|
|
199
|
+
*/
|
|
200
|
+
fetchRawData(): Promise<void>;
|
|
201
|
+
/**
|
|
202
|
+
* Generates the relic data
|
|
203
|
+
* uses WFCD/warframe-drop-data to check what relics exist,
|
|
204
|
+
* and adds information from WFCD/warframe-items and WFM
|
|
205
|
+
*/
|
|
206
|
+
generateTitaniaRelics(): void;
|
|
207
|
+
/**
|
|
208
|
+
* Writes the fully generated data to disk.
|
|
209
|
+
* @param {string} dataDir Directory to store the relic data in. Default: ../data/
|
|
210
|
+
* @param {string} fileName Filename base ex: "Relics" becomes "Relics.json" and "Relics.min.json". Default: "Relics"
|
|
211
|
+
* @param {boolean} generateMin True if a minified json should be generated too. Default: true
|
|
212
|
+
*/
|
|
213
|
+
writeData(dataDir?: string, fileName?: string, generateMin?: boolean): Promise<void>;
|
|
214
|
+
/**
|
|
215
|
+
* Generates a single relic from all available data
|
|
216
|
+
* @param {WFCDRelic} rawRelic relic to pull Titania data from
|
|
217
|
+
* @returns {TitaniaRelicReward}
|
|
218
|
+
*/
|
|
219
|
+
private generateTitaniaRelic;
|
|
220
|
+
/**
|
|
221
|
+
* Filters WFCD's relic data to only include Intact variants, since we just need the base.
|
|
222
|
+
*/
|
|
223
|
+
private filterWFCDRelics;
|
|
224
|
+
}
|
|
225
|
+
//#endregion
|
|
226
|
+
//#region src/VersionManager.d.ts
|
|
227
|
+
declare class VersionManager {
|
|
228
|
+
versionPath: string;
|
|
229
|
+
versionRawPath: string;
|
|
230
|
+
hashPath: string;
|
|
231
|
+
/**
|
|
232
|
+
* Creates a new VersionManager instance.
|
|
233
|
+
* @param {string} dataDir Folder to write version information to.
|
|
234
|
+
* @constructor
|
|
235
|
+
*/
|
|
236
|
+
constructor(dataDir?: string);
|
|
237
|
+
/**
|
|
238
|
+
* Checks if the current data needs an update
|
|
239
|
+
*/
|
|
240
|
+
updateNeeded(): Promise<boolean>;
|
|
241
|
+
/**
|
|
242
|
+
* Writes both game and drop version metadata
|
|
243
|
+
* @param {number} timestamp Timestamp the build was started at
|
|
244
|
+
*/
|
|
245
|
+
writeVersion(timestamp: number): Promise<void>;
|
|
246
|
+
}
|
|
247
|
+
//#endregion
|
|
248
|
+
export { Generator, Rarity, TitaniaRelic, TitaniaRelicLocation, TitaniaRelicReward, TitaniaRelicRewardItem, TitaniaRelicVaultedInfo, TitaniaWFMInfo, VersionManager, WFCDItem, WFCDItemDropLocation, WFCDRelic, WFCDRelicReward, WarframeMarketItem, WarframeMarketRoot };
|