2024-05-04 14:44:23 +02:00
|
|
|
import { RequestHandler } from "express";
|
2024-12-23 14:37:21 +01:00
|
|
|
import { getDict, getItemName, getString } from "@/src/services/itemDataService";
|
2024-06-20 21:22:01 +02:00
|
|
|
import {
|
|
|
|
ExportArcanes,
|
2025-01-20 12:19:32 +01:00
|
|
|
ExportAvionics,
|
2025-04-16 03:11:21 +02:00
|
|
|
ExportCustoms,
|
2025-03-09 11:15:45 -07:00
|
|
|
ExportDrones,
|
2024-06-20 21:22:01 +02:00
|
|
|
ExportGear,
|
2025-04-03 10:40:22 -07:00
|
|
|
ExportKeys,
|
2025-01-20 18:29:25 +01:00
|
|
|
ExportMisc,
|
2025-03-11 07:56:18 -07:00
|
|
|
ExportRailjackWeapons,
|
2024-12-23 14:37:21 +01:00
|
|
|
ExportRecipes,
|
2025-03-02 04:21:59 -08:00
|
|
|
ExportRelics,
|
2024-06-20 21:22:01 +02:00
|
|
|
ExportResources,
|
2025-01-19 15:03:34 +01:00
|
|
|
ExportSentinels,
|
2025-02-08 22:22:22 -08:00
|
|
|
ExportSyndicates,
|
2024-06-22 03:01:37 +02:00
|
|
|
ExportUpgrades,
|
2024-06-20 21:22:01 +02:00
|
|
|
ExportWarframes,
|
2025-03-02 04:21:59 -08:00
|
|
|
ExportWeapons,
|
|
|
|
TRelicQuality
|
2024-06-20 21:22:01 +02:00
|
|
|
} from "warframe-public-export-plus";
|
2024-06-30 13:13:26 +02:00
|
|
|
import archonCrystalUpgrades from "@/static/fixed_responses/webuiArchonCrystalUpgrades.json";
|
2024-05-04 14:44:23 +02:00
|
|
|
|
|
|
|
interface ListedItem {
|
|
|
|
uniqueName: string;
|
|
|
|
name: string;
|
2024-06-01 12:57:27 +02:00
|
|
|
fusionLimit?: number;
|
2025-01-19 15:03:34 +01:00
|
|
|
exalted?: string[];
|
2025-02-27 18:00:37 -08:00
|
|
|
badReason?: "starter" | "frivolous" | "notraw";
|
2025-03-30 05:10:24 -07:00
|
|
|
partType?: string;
|
2025-04-03 10:40:22 -07:00
|
|
|
chainLength?: number;
|
2025-04-22 10:00:10 -07:00
|
|
|
parazon?: boolean;
|
2024-05-04 14:44:23 +02:00
|
|
|
}
|
|
|
|
|
2025-03-02 04:21:59 -08:00
|
|
|
const relicQualitySuffixes: Record<TRelicQuality, string> = {
|
|
|
|
VPQ_BRONZE: "",
|
|
|
|
VPQ_SILVER: " [Flawless]",
|
|
|
|
VPQ_GOLD: " [Radiant]",
|
|
|
|
VPQ_PLATINUM: " [Exceptional]"
|
|
|
|
};
|
|
|
|
|
2025-01-19 12:29:32 +01:00
|
|
|
const getItemListsController: RequestHandler = (req, response) => {
|
2024-12-22 20:38:50 +01:00
|
|
|
const lang = getDict(typeof req.query.lang == "string" ? req.query.lang : "en");
|
2025-01-19 12:29:32 +01:00
|
|
|
const res: Record<string, ListedItem[]> = {};
|
2025-01-20 12:21:50 +01:00
|
|
|
res.Suits = [];
|
2025-01-19 12:29:32 +01:00
|
|
|
res.LongGuns = [];
|
|
|
|
res.Melee = [];
|
2025-01-19 15:03:34 +01:00
|
|
|
res.ModularParts = [];
|
|
|
|
res.Pistols = [];
|
|
|
|
res.Sentinels = [];
|
|
|
|
res.SentinelWeapons = [];
|
|
|
|
res.SpaceGuns = [];
|
|
|
|
res.SpaceMelee = [];
|
|
|
|
res.SpaceSuits = [];
|
2025-01-20 12:21:50 +01:00
|
|
|
res.MechSuits = [];
|
2025-01-19 12:29:32 +01:00
|
|
|
res.miscitems = [];
|
2025-02-08 22:22:22 -08:00
|
|
|
res.Syndicates = [];
|
2025-03-30 05:10:24 -07:00
|
|
|
res.OperatorAmps = [];
|
2025-04-03 10:40:22 -07:00
|
|
|
res.QuestKeys = [];
|
2025-04-21 10:42:48 -07:00
|
|
|
res.KubrowPets = [];
|
2025-04-24 00:42:33 +02:00
|
|
|
res.MoaPets = [];
|
2025-01-19 15:03:34 +01:00
|
|
|
for (const [uniqueName, item] of Object.entries(ExportWarframes)) {
|
2025-02-24 20:56:34 -08:00
|
|
|
res[item.productCategory].push({
|
|
|
|
uniqueName,
|
|
|
|
name: getString(item.name, lang),
|
|
|
|
exalted: item.exalted
|
|
|
|
});
|
2025-01-19 15:03:34 +01:00
|
|
|
}
|
|
|
|
for (const [uniqueName, item] of Object.entries(ExportSentinels)) {
|
2025-04-21 10:42:48 -07:00
|
|
|
if (item.productCategory != "SpecialItems") {
|
2025-01-19 15:03:34 +01:00
|
|
|
res[item.productCategory].push({
|
|
|
|
uniqueName,
|
2025-04-22 10:00:58 -07:00
|
|
|
name: getString(item.name, lang),
|
|
|
|
exalted: item.exalted
|
2025-01-19 15:03:34 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
2024-06-18 23:10:26 +02:00
|
|
|
for (const [uniqueName, item] of Object.entries(ExportWeapons)) {
|
2025-03-30 08:12:31 -07:00
|
|
|
if (item.partType) {
|
2025-04-21 10:42:48 -07:00
|
|
|
if (!uniqueName.startsWith("/Lotus/Types/Items/Deimos/")) {
|
|
|
|
res.ModularParts.push({
|
|
|
|
uniqueName,
|
|
|
|
name: getString(item.name, lang),
|
|
|
|
partType: item.partType
|
|
|
|
});
|
|
|
|
}
|
2025-01-19 15:03:34 +01:00
|
|
|
if (uniqueName.split("/")[5] != "SentTrainingAmplifier") {
|
|
|
|
res.miscitems.push({
|
2025-03-09 11:15:45 -07:00
|
|
|
uniqueName: uniqueName,
|
2025-01-19 15:03:34 +01:00
|
|
|
name: getString(item.name, lang)
|
|
|
|
});
|
|
|
|
}
|
|
|
|
} else if (item.totalDamage !== 0) {
|
2025-01-19 12:29:32 +01:00
|
|
|
if (
|
|
|
|
item.productCategory == "LongGuns" ||
|
|
|
|
item.productCategory == "Pistols" ||
|
2025-01-19 15:03:34 +01:00
|
|
|
item.productCategory == "Melee" ||
|
|
|
|
item.productCategory == "SpaceGuns" ||
|
|
|
|
item.productCategory == "SpaceMelee" ||
|
2025-03-30 05:10:24 -07:00
|
|
|
item.productCategory == "SentinelWeapons" ||
|
|
|
|
item.productCategory == "OperatorAmps"
|
2025-01-19 12:29:32 +01:00
|
|
|
) {
|
|
|
|
res[item.productCategory].push({
|
2024-06-18 23:10:26 +02:00
|
|
|
uniqueName,
|
2024-12-22 20:38:50 +01:00
|
|
|
name: getString(item.name, lang)
|
2024-06-18 23:10:26 +02:00
|
|
|
});
|
|
|
|
}
|
2025-01-19 12:29:32 +01:00
|
|
|
} else if (!item.excludeFromCodex) {
|
|
|
|
res.miscitems.push({
|
2025-03-09 11:15:45 -07:00
|
|
|
uniqueName: uniqueName,
|
2025-01-19 12:29:32 +01:00
|
|
|
name: getString(item.name, lang)
|
|
|
|
});
|
2024-06-18 23:10:26 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
for (const [uniqueName, item] of Object.entries(ExportResources)) {
|
2025-01-05 02:43:22 +01:00
|
|
|
let name = getString(item.name, lang);
|
|
|
|
if ("dissectionParts" in item) {
|
|
|
|
name = getString("/Lotus/Language/Fish/FishDisplayName", lang).split("|FISH_NAME|").join(name);
|
2025-04-23 11:38:04 -07:00
|
|
|
if (item.syndicateTag == "CetusSyndicate") {
|
|
|
|
if (uniqueName.indexOf("Large") != -1) {
|
|
|
|
name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeLargeAbbrev", lang));
|
|
|
|
} else if (uniqueName.indexOf("Medium") != -1) {
|
|
|
|
name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeMediumAbbrev", lang));
|
|
|
|
} else {
|
|
|
|
name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeSmallAbbrev", lang));
|
|
|
|
}
|
2025-01-05 02:43:22 +01:00
|
|
|
} else {
|
2025-04-23 11:38:04 -07:00
|
|
|
if (uniqueName.indexOf("Large") != -1) {
|
|
|
|
name = name
|
|
|
|
.split("|FISH_SIZE|")
|
|
|
|
.join(getString("/Lotus/Language/SolarisVenus/RobofishAgeCategoryElderAbbrev", lang));
|
|
|
|
} else if (uniqueName.indexOf("Medium") != -1) {
|
|
|
|
name = name
|
|
|
|
.split("|FISH_SIZE|")
|
|
|
|
.join(getString("/Lotus/Language/SolarisVenus/RobofishAgeCategoryMatureAbbrev", lang));
|
|
|
|
} else {
|
|
|
|
name = name
|
|
|
|
.split("|FISH_SIZE|")
|
|
|
|
.join(getString("/Lotus/Language/SolarisVenus/RobofishAgeCategoryYoungAbbrev", lang));
|
|
|
|
}
|
2025-01-05 02:43:22 +01:00
|
|
|
}
|
|
|
|
}
|
2025-03-21 00:48:50 +01:00
|
|
|
if (
|
2025-04-02 09:52:24 -07:00
|
|
|
name &&
|
2025-03-21 00:48:50 +01:00
|
|
|
uniqueName.substr(0, 30) != "/Lotus/Types/Game/Projections/" &&
|
|
|
|
uniqueName != "/Lotus/Types/Gameplay/EntratiLab/Resources/EntratiLanthornBundle"
|
|
|
|
) {
|
2025-03-02 04:21:59 -08:00
|
|
|
res.miscitems.push({
|
2025-03-09 11:15:45 -07:00
|
|
|
uniqueName: uniqueName,
|
2025-03-02 04:21:59 -08:00
|
|
|
name: name
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (const [uniqueName, item] of Object.entries(ExportRelics)) {
|
2025-01-19 12:29:32 +01:00
|
|
|
res.miscitems.push({
|
2025-03-09 11:15:45 -07:00
|
|
|
uniqueName: uniqueName,
|
2025-03-02 04:21:59 -08:00
|
|
|
name:
|
|
|
|
getString("/Lotus/Language/Relics/VoidProjectionName", lang)
|
|
|
|
.split("|ERA|")
|
|
|
|
.join(item.era)
|
|
|
|
.split("|CATEGORY|")
|
|
|
|
.join(item.category) + relicQualitySuffixes[item.quality]
|
2024-06-20 21:22:01 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
for (const [uniqueName, item] of Object.entries(ExportGear)) {
|
2025-01-19 12:29:32 +01:00
|
|
|
res.miscitems.push({
|
2025-03-09 11:15:45 -07:00
|
|
|
uniqueName: uniqueName,
|
2024-12-22 20:38:50 +01:00
|
|
|
name: getString(item.name, lang)
|
2024-06-18 23:10:26 +02:00
|
|
|
});
|
|
|
|
}
|
2024-12-23 14:37:21 +01:00
|
|
|
const recipeNameTemplate = getString("/Lotus/Language/Items/BlueprintAndItem", lang);
|
|
|
|
for (const [uniqueName, item] of Object.entries(ExportRecipes)) {
|
2024-12-31 01:40:32 +01:00
|
|
|
if (!item.hidden) {
|
2024-12-23 14:37:21 +01:00
|
|
|
const resultName = getItemName(item.resultType);
|
|
|
|
if (resultName) {
|
2025-04-07 05:55:33 -07:00
|
|
|
let itemName = getString(resultName, lang);
|
|
|
|
if (item.num > 1) itemName = `${itemName} X ${item.num}`;
|
2025-01-19 12:29:32 +01:00
|
|
|
res.miscitems.push({
|
2025-03-09 11:15:45 -07:00
|
|
|
uniqueName: uniqueName,
|
2025-04-07 05:55:33 -07:00
|
|
|
name: recipeNameTemplate.replace("|ITEM|", itemName)
|
2024-12-23 14:37:21 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2025-03-09 11:15:45 -07:00
|
|
|
for (const [uniqueName, item] of Object.entries(ExportDrones)) {
|
|
|
|
res.miscitems.push({
|
|
|
|
uniqueName: uniqueName,
|
|
|
|
name: getString(item.name, lang)
|
|
|
|
});
|
|
|
|
}
|
2025-03-11 07:56:18 -07:00
|
|
|
for (const [uniqueName, item] of Object.entries(ExportRailjackWeapons)) {
|
|
|
|
res.miscitems.push({
|
|
|
|
uniqueName: uniqueName,
|
|
|
|
name: getString(item.name, lang)
|
2025-04-16 03:11:21 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
for (const [uniqueName, item] of Object.entries(ExportCustoms)) {
|
|
|
|
res.miscitems.push({
|
|
|
|
uniqueName: uniqueName,
|
|
|
|
name: getString(item.name, lang)
|
2025-03-11 07:56:18 -07:00
|
|
|
});
|
|
|
|
}
|
2024-06-18 23:10:26 +02:00
|
|
|
|
2025-01-19 12:29:32 +01:00
|
|
|
res.mods = [];
|
2024-06-22 03:01:37 +02:00
|
|
|
for (const [uniqueName, upgrade] of Object.entries(ExportUpgrades)) {
|
2025-02-27 18:00:37 -08:00
|
|
|
const mod: ListedItem = {
|
2024-06-22 23:25:17 +02:00
|
|
|
uniqueName,
|
2024-12-22 20:38:50 +01:00
|
|
|
name: getString(upgrade.name, lang),
|
2024-06-22 23:25:17 +02:00
|
|
|
fusionLimit: upgrade.fusionLimit
|
2025-02-27 18:00:37 -08:00
|
|
|
};
|
|
|
|
if (upgrade.isStarter) {
|
|
|
|
mod.badReason = "starter";
|
|
|
|
} else if (upgrade.isFrivolous) {
|
|
|
|
mod.badReason = "frivolous";
|
|
|
|
} else if (upgrade.upgradeEntries) {
|
|
|
|
mod.badReason = "notraw";
|
2024-06-22 03:01:37 +02:00
|
|
|
}
|
2025-04-22 10:00:10 -07:00
|
|
|
if (upgrade.type == "PARAZON") {
|
|
|
|
mod.parazon = true;
|
|
|
|
}
|
2025-02-27 18:00:37 -08:00
|
|
|
res.mods.push(mod);
|
2024-06-22 03:01:37 +02:00
|
|
|
}
|
2025-01-20 12:19:32 +01:00
|
|
|
for (const [uniqueName, upgrade] of Object.entries(ExportAvionics)) {
|
|
|
|
res.mods.push({
|
|
|
|
uniqueName,
|
|
|
|
name: getString(upgrade.name, lang),
|
|
|
|
fusionLimit: upgrade.fusionLimit
|
|
|
|
});
|
|
|
|
}
|
2024-06-22 23:25:17 +02:00
|
|
|
for (const [uniqueName, arcane] of Object.entries(ExportArcanes)) {
|
2025-03-17 10:06:25 -07:00
|
|
|
if (uniqueName.substring(0, 18) != "/Lotus/Types/Game/") {
|
|
|
|
const mod: ListedItem = {
|
|
|
|
uniqueName,
|
|
|
|
name: getString(arcane.name, lang)
|
|
|
|
};
|
|
|
|
if (arcane.isFrivolous) {
|
|
|
|
mod.badReason = "frivolous";
|
|
|
|
}
|
|
|
|
res.mods.push(mod);
|
2024-07-14 23:52:42 +02:00
|
|
|
}
|
2024-06-22 23:25:17 +02:00
|
|
|
}
|
2025-02-08 22:22:22 -08:00
|
|
|
for (const [uniqueName, syndicate] of Object.entries(ExportSyndicates)) {
|
|
|
|
res.Syndicates.push({
|
|
|
|
uniqueName,
|
|
|
|
name: getString(syndicate.name, lang)
|
|
|
|
});
|
|
|
|
}
|
2025-04-03 10:40:22 -07:00
|
|
|
for (const [uniqueName, key] of Object.entries(ExportKeys)) {
|
|
|
|
if (key.chainStages) {
|
|
|
|
res.QuestKeys.push({
|
|
|
|
uniqueName,
|
|
|
|
name: getString(key.name || "", lang),
|
|
|
|
chainLength: key.chainStages.length
|
|
|
|
});
|
2025-04-07 05:29:44 -07:00
|
|
|
} else if (key.name) {
|
|
|
|
res.miscitems.push({
|
|
|
|
uniqueName,
|
|
|
|
name: getString(key.name, lang)
|
|
|
|
});
|
2025-04-03 10:40:22 -07:00
|
|
|
}
|
|
|
|
}
|
2024-06-22 03:01:37 +02:00
|
|
|
|
2025-01-19 12:29:32 +01:00
|
|
|
response.json({
|
|
|
|
archonCrystalUpgrades,
|
2025-01-20 18:29:25 +01:00
|
|
|
uniqueLevelCaps: ExportMisc.uniqueLevelCaps,
|
2025-01-19 12:29:32 +01:00
|
|
|
...res
|
2024-05-04 14:44:23 +02:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export { getItemListsController };
|