返回提交历史
Modified
package-lock.json
+6
-0
Modified
package.json
+1
-0
Modified
src/controllers/custom/getItemListsController.ts
+10
-2
Modified
src/services/itemDataService.ts
+5
-0
XFEstudio/SpaceNinjaServer
fix(webui): not listing melee arcanes (#265)
fd794509
代码差异
4 个文件
+22
-2
@@ -13,6 +13,7 @@
13
13
"express": "^5.0.0-beta.3",
14
14
"mongoose": "^8.1.1",
15
15
"warframe-items": "^1.1261.19",
16
"warframe-public-export-plus": "^0.1.0",
16
17
"warframe-riven-info": "^0.1.0",
17
18
"winston": "^3.11.0",
18
19
"winston-daily-rotate-file": "^4.7.1"
@@ -3893,6 +3894,11 @@
3893
3894
"warframe-worldstate-data": "^2"
3894
3895
}
3895
3896
},
3897
"node_modules/warframe-public-export-plus": {
3898
"version": "0.1.0",
3899
"resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.1.0.tgz",
3900
"integrity": "sha512-a76Be2pwPjKrin67zMux5L9U6zt9bhEtyy723tM2czGGcOZYWp1XdCZY684q3zPytWS0SmEia0C/h/4EiadBnQ=="
3901
},
3896
3902
"node_modules/warframe-riven-info": {
3897
3903
"version": "0.1.0",
3898
3904
"resolved": "https://registry.npmjs.org/warframe-riven-info/-/warframe-riven-info-0.1.0.tgz",
@@ -17,6 +17,7 @@
17
17
"express": "^5.0.0-beta.3",
18
18
"mongoose": "^8.1.1",
19
19
"warframe-items": "^1.1261.19",
20
"warframe-public-export-plus": "^0.1.0",
20
21
"warframe-riven-info": "^0.1.0",
21
22
"winston": "^3.11.0",
22
23
"winston-daily-rotate-file": "^4.7.1"
@@ -1,6 +1,7 @@
1
1
import { RequestHandler } from "express";
2
import { MinItem, warframes, weapons, items } from "@/src/services/itemDataService";
2
import { MinItem, warframes, weapons, items, getEnglishString } from "@/src/services/itemDataService";
3
3
import badItems from "@/static/json/exclude-mods.json";
4
import ExportArcanes from "@/node_modules/warframe-public-export-plus/ExportArcanes.json";
4
5
5
6
interface ListedItem {
6
7
uniqueName: string;
@@ -19,13 +20,20 @@ function reduceItems(items: MinItem[]): ListedItem[] {
19
20
}
20
21
21
22
const getItemListsController: RequestHandler = (_req, res) => {
23
const mods = reduceItems(items.filter(item => item.category == "Mods"));
24
for (const arcane of ExportArcanes) {
25
mods.push({
26
uniqueName: arcane.uniqueName,
27
name: getEnglishString(arcane.name)
28
});
29
}
22
30
res.json({
23
31
warframes: reduceItems(warframes),
24
32
weapons: reduceItems(weapons.filter(item => item.productCategory != "OperatorAmps")),
25
33
miscitems: reduceItems(
26
34
items.filter(item => item.category == "Misc" || item.category == "Resources" || item.category == "Fish")
27
35
),
28
mods: reduceItems(items.filter(item => item.category == "Mods" || item.category == "Arcanes")),
36
mods,
29
37
badItems
30
38
});
31
39
};
@@ -2,6 +2,7 @@ import { getIndexAfter } from "@/src/helpers/stringHelpers";
2
2
import { logger } from "@/src/utils/logger";
3
3
import Items, { Buildable, Category, MinimalItem, Warframe, Weapon } from "warframe-items";
4
4
import badItems from "@/static/json/exclude-mods.json";
5
import dict_en from "@/node_modules/warframe-public-export-plus/dict.en.json";
5
6
6
7
export type MinWarframe = Omit<Warframe, "patchlogs">;
7
8
export type MinWeapon = Omit<Weapon, "patchlogs">;
@@ -129,3 +130,7 @@ export const getItemByName = (name: string) => {
129
130
const item = items.find(item => item.name === name);
130
131
return item;
131
132
};
133
134
export const getEnglishString = (key: string) => {
135
return dict_en[key as keyof typeof dict_en] ?? key;
136
};