koishi-plugin-warframe 0.0.5 → 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.
- package/lib/index.d.ts +110 -111
- package/lib/index.js +52 -169
- package/package.json +20 -5
package/lib/index.d.ts
CHANGED
|
@@ -1,111 +1,110 @@
|
|
|
1
|
-
import { IRegion } from 'warframe-public-export-plus';
|
|
2
|
-
import Puppeteer from 'koishi-plugin-puppeteer';
|
|
3
|
-
import Element from '@satorijs/element';
|
|
4
|
-
import { Element, Argv, Context, Schema } from 'koishi';
|
|
5
|
-
export const fetchAsyncText: (url: string, method?: string) => Promise<string | null>;
|
|
6
|
-
export const fetchAsyncData: <T>(url: string, method?: string) => Promise<T | null>;
|
|
7
|
-
export const fullWidthToHalfWidth: (str: string) => string;
|
|
8
|
-
export const transformListIntoDict: <T>(dict: T[], predict: (obj: T) => string[]) => {
|
|
9
|
-
[key: string]: T;
|
|
10
|
-
};
|
|
11
|
-
export const dictToKeyDict: <T>(dict: {
|
|
12
|
-
[key: string]: T;
|
|
13
|
-
}, predict: (obj: T) => string[]) => {
|
|
14
|
-
[key: string]: string;
|
|
15
|
-
};
|
|
16
|
-
export const toTimeStamp: (timeStr: string) => number;
|
|
17
|
-
/**
|
|
18
|
-
* 毫秒转「X小时X分钟X秒」格式(0单位不显示)
|
|
19
|
-
* @param {number} ms - 待转换的毫秒数(非负)
|
|
20
|
-
* @returns {string} 示例:3661000ms → "1小时1分钟1秒";61000ms → "1分钟1秒";500ms → "0秒"
|
|
21
|
-
*/
|
|
22
|
-
export const msToHumanReadable: (ms: number) => string;
|
|
23
|
-
export const getSolNodeKey: (name: string) => Promise<string>;
|
|
24
|
-
export const fissureTierName: {
|
|
25
|
-
1: string;
|
|
26
|
-
2: string;
|
|
27
|
-
3: string;
|
|
28
|
-
4: string;
|
|
29
|
-
5: string;
|
|
30
|
-
6: string;
|
|
31
|
-
7: string;
|
|
32
|
-
};
|
|
33
|
-
export const fissureTierNumToNumber: (a: number | string) => number;
|
|
34
|
-
export const regionToShort: (region: IRegion, dict: any) => {
|
|
35
|
-
name: any;
|
|
36
|
-
system: any;
|
|
37
|
-
type: any;
|
|
38
|
-
faction: any;
|
|
39
|
-
maxLevel: number;
|
|
40
|
-
minLevel: number;
|
|
41
|
-
};
|
|
42
|
-
export const getWFMItemList: () => Promise<WFMResponse<ItemShort[] | null>>;
|
|
43
|
-
export const getWFMOrderList: (itemId: string) => Promise<WFMResponse<OrderWithUser[] | null>>;
|
|
44
|
-
export const getWFMRivenItemList: () => Promise<WFMResponse<RivenItem[] | null>>;
|
|
45
|
-
export const getWFMRivenOrderList: (itemId: string) => Promise<WFMResponseV1<RivenOrder> | null>;
|
|
46
|
-
export const getWFMRivenAttributeList: () => Promise<WFMResponse<RivenAttribute[]> | null>;
|
|
47
|
-
export const getHtmlString: (body: string, title?: string) => string;
|
|
48
|
-
export const getHtmlImageBase64: (puppe: Puppeteer, html: string, type?: "png" | "jpeg" | "webp") => Promise<string>;
|
|
49
|
-
export const OutputImage: (imgBase64: string) => Element;
|
|
50
|
-
export const ItemOrderOutput: (item: ItemShort, orders: OrderWithUser[]) => Element;
|
|
51
|
-
export const RivenOrderOutput: (item: RivenItem, orders: RivenOrder[]) => Element;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
export const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
export const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
export const
|
|
78
|
-
export const
|
|
79
|
-
export const
|
|
80
|
-
export const
|
|
81
|
-
export const
|
|
82
|
-
export const
|
|
83
|
-
export const
|
|
84
|
-
export const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
export const
|
|
94
|
-
export const
|
|
95
|
-
export const
|
|
96
|
-
export const
|
|
97
|
-
export const
|
|
98
|
-
export const
|
|
99
|
-
export const
|
|
100
|
-
export const
|
|
101
|
-
export const
|
|
102
|
-
export const
|
|
103
|
-
export const
|
|
104
|
-
export const
|
|
105
|
-
export const
|
|
106
|
-
export
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
export
|
|
111
|
-
export function apply(ctx: Context): void;
|
|
1
|
+
import { IRegion } from 'warframe-public-export-plus';
|
|
2
|
+
import Puppeteer from 'koishi-plugin-puppeteer';
|
|
3
|
+
import Element from '@satorijs/element';
|
|
4
|
+
import { Element, Argv, Context, Schema } from 'koishi';
|
|
5
|
+
export const fetchAsyncText: (url: string, method?: string) => Promise<string | null>;
|
|
6
|
+
export const fetchAsyncData: <T>(url: string, method?: string) => Promise<T | null>;
|
|
7
|
+
export const fullWidthToHalfWidth: (str: string) => string;
|
|
8
|
+
export const transformListIntoDict: <T>(dict: T[], predict: (obj: T) => string[]) => {
|
|
9
|
+
[key: string]: T;
|
|
10
|
+
};
|
|
11
|
+
export const dictToKeyDict: <T>(dict: {
|
|
12
|
+
[key: string]: T;
|
|
13
|
+
}, predict: (obj: T) => string[]) => {
|
|
14
|
+
[key: string]: string;
|
|
15
|
+
};
|
|
16
|
+
export const toTimeStamp: (timeStr: string) => number;
|
|
17
|
+
/**
|
|
18
|
+
* 毫秒转「X小时X分钟X秒」格式(0单位不显示)
|
|
19
|
+
* @param {number} ms - 待转换的毫秒数(非负)
|
|
20
|
+
* @returns {string} 示例:3661000ms → "1小时1分钟1秒";61000ms → "1分钟1秒";500ms → "0秒"
|
|
21
|
+
*/
|
|
22
|
+
export const msToHumanReadable: (ms: number) => string;
|
|
23
|
+
export const getSolNodeKey: (name: string) => Promise<string>;
|
|
24
|
+
export const fissureTierName: {
|
|
25
|
+
1: string;
|
|
26
|
+
2: string;
|
|
27
|
+
3: string;
|
|
28
|
+
4: string;
|
|
29
|
+
5: string;
|
|
30
|
+
6: string;
|
|
31
|
+
7: string;
|
|
32
|
+
};
|
|
33
|
+
export const fissureTierNumToNumber: (a: number | string) => number;
|
|
34
|
+
export const regionToShort: (region: IRegion, dict: any) => {
|
|
35
|
+
name: any;
|
|
36
|
+
system: any;
|
|
37
|
+
type: any;
|
|
38
|
+
faction: any;
|
|
39
|
+
maxLevel: number;
|
|
40
|
+
minLevel: number;
|
|
41
|
+
};
|
|
42
|
+
export const getWFMItemList: () => Promise<WFMResponse<ItemShort[] | null>>;
|
|
43
|
+
export const getWFMOrderList: (itemId: string) => Promise<WFMResponse<OrderWithUser[] | null>>;
|
|
44
|
+
export const getWFMRivenItemList: () => Promise<WFMResponse<RivenItem[] | null>>;
|
|
45
|
+
export const getWFMRivenOrderList: (itemId: string) => Promise<WFMResponseV1<RivenOrder> | null>;
|
|
46
|
+
export const getWFMRivenAttributeList: () => Promise<WFMResponse<RivenAttribute[]> | null>;
|
|
47
|
+
export const getHtmlString: (body: string, title?: string) => string;
|
|
48
|
+
export const getHtmlImageBase64: (puppe: Puppeteer, html: string, type?: "png" | "jpeg" | "webp") => Promise<string>;
|
|
49
|
+
export const OutputImage: (imgBase64: string) => Element;
|
|
50
|
+
export const ItemOrderOutput: (item: ItemShort, orders: OrderWithUser[]) => Element;
|
|
51
|
+
export const RivenOrderOutput: (item: RivenItem, orders: RivenOrder[]) => Element;
|
|
52
|
+
let globalRivenAttributeList: RivenAttribute[];
|
|
53
|
+
export { globalRivenAttributeList };
|
|
54
|
+
export const wmOnReady: () => Promise<void>;
|
|
55
|
+
export const getItemOrders: (itemName: string) => Promise<{
|
|
56
|
+
item: ItemShort;
|
|
57
|
+
orders: OrderWithUser[];
|
|
58
|
+
}>;
|
|
59
|
+
export const generateItemOrderOutput: (puppe: Puppeteer, item: ItemShort, orders: OrderWithUser[]) => Promise<import("koishi").Element>;
|
|
60
|
+
export const getRivenOrders: (input: string) => Promise<{
|
|
61
|
+
item: RivenItem;
|
|
62
|
+
orders: RivenOrder[];
|
|
63
|
+
}>;
|
|
64
|
+
export const generateRivenOrderOutput: (puppe: Puppeteer, item: RivenItem, orders: RivenOrder[]) => Promise<import("koishi").Element>;
|
|
65
|
+
declare const _default: {
|
|
66
|
+
SolNode147: number;
|
|
67
|
+
SolNode149: number;
|
|
68
|
+
ClanNode22: number;
|
|
69
|
+
SolNode224: number;
|
|
70
|
+
SolNode130: number;
|
|
71
|
+
SolNode195: number;
|
|
72
|
+
SolNode42: number;
|
|
73
|
+
ClanNode24: number;
|
|
74
|
+
};
|
|
75
|
+
declare const arbys: string;
|
|
76
|
+
export const incarnonRewards: string[][];
|
|
77
|
+
export const warframeRewards: string[][];
|
|
78
|
+
export const ArbitrationTable: (arbi: Arbitration[]) => Element;
|
|
79
|
+
export const CircuitTable: (incarnons: string[], warframes: string[]) => Element;
|
|
80
|
+
export const FissureTable: (fissures: Fissure[], type: "fissure" | "sp-fissure" | "rj-fissure") => Element;
|
|
81
|
+
export const getWorldState: () => Promise<any>;
|
|
82
|
+
export const getArbitrations: (day?: number) => Arbitration[] | string;
|
|
83
|
+
export const generateArbitrationsOutput: (puppe: Puppeteer, arby: Arbitration[]) => Promise<import("koishi").Element>;
|
|
84
|
+
export const getCircuitWeek: () => {
|
|
85
|
+
incarnons: string[];
|
|
86
|
+
warframes: string[];
|
|
87
|
+
};
|
|
88
|
+
export const generateCircuitWeekOutput: (puppe: Puppeteer, data: {
|
|
89
|
+
incarnons: string[];
|
|
90
|
+
warframes: string[];
|
|
91
|
+
}) => Promise<import("koishi").Element>;
|
|
92
|
+
export const getFissures: () => Promise<Fissure[] | "内部错误,获取最新信息失败">;
|
|
93
|
+
export const getSteelPathFissures: () => Promise<Fissure[] | "内部错误,获取最新信息失败">;
|
|
94
|
+
export const getRailjackFissures: () => Promise<Fissure[] | "内部错误,获取最新信息失败">;
|
|
95
|
+
export const generateFissureOutput: (puppe: Puppeteer, fissures: Fissure[], type: "fissure" | "sp-fissure" | "rj-fissure") => Promise<import("koishi").Element>;
|
|
96
|
+
export const wmCommand: (action: Argv, input: string) => Promise<string | import("koishi").Element>;
|
|
97
|
+
export const wmrCommand: (action: Argv, input: string) => Promise<string | import("koishi").Element>;
|
|
98
|
+
export const aboutCommand: () => string;
|
|
99
|
+
export const arbitrationCommand: (action: Argv, input?: number) => string | Promise<import("koishi").Element>;
|
|
100
|
+
export const fissureCommand: (action: Argv) => Promise<import("koishi").Element | "内部错误,获取最新信息失败" | "内部错误">;
|
|
101
|
+
export const steelPathFissureCommand: (action: Argv) => Promise<import("koishi").Element | "内部错误,获取最新信息失败" | "内部错误">;
|
|
102
|
+
export const railjackFissureCommand: (action: Argv) => Promise<import("koishi").Element | "内部错误,获取最新信息失败" | "内部错误">;
|
|
103
|
+
export const circuitCommand: (action: Argv) => Promise<import("koishi").Element>;
|
|
104
|
+
export const onReadyHandler: () => void;
|
|
105
|
+
export const name = "warframe";
|
|
106
|
+
export interface Config {
|
|
107
|
+
developerMode: boolean;
|
|
108
|
+
}
|
|
109
|
+
export const Config: Schema<Config>;
|
|
110
|
+
export function apply(ctx: Context): void;
|
package/lib/index.js
CHANGED
|
@@ -28,13 +28,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
33
|
Config: () => Config,
|
|
34
34
|
apply: () => apply,
|
|
35
35
|
name: () => name
|
|
36
36
|
});
|
|
37
|
-
module.exports = __toCommonJS(
|
|
37
|
+
module.exports = __toCommonJS(index_exports);
|
|
38
38
|
var import_koishi = require("koishi");
|
|
39
39
|
|
|
40
40
|
// src/utils/common.ts
|
|
@@ -79,18 +79,6 @@ var fullWidthToHalfWidth = /* @__PURE__ */ __name((str) => {
|
|
|
79
79
|
return String.fromCharCode(char.charCodeAt(0) - 65248);
|
|
80
80
|
}).replace(/\u3000/g, " ");
|
|
81
81
|
}, "fullWidthToHalfWidth");
|
|
82
|
-
var transformListIntoDict = /* @__PURE__ */ __name((dict, predict) => {
|
|
83
|
-
const result = {};
|
|
84
|
-
for (const obj of dict) {
|
|
85
|
-
const keys = predict(obj);
|
|
86
|
-
for (const key of keys) {
|
|
87
|
-
if (typeof key === "string" && key.length > 0) {
|
|
88
|
-
result[key] = obj;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return result;
|
|
93
|
-
}, "transformListIntoDict");
|
|
94
82
|
var dictToKeyDict = /* @__PURE__ */ __name((dict, predict) => {
|
|
95
83
|
const result = {};
|
|
96
84
|
for (const obj in dict) {
|
|
@@ -492,7 +480,9 @@ var RivenOrderComponent = /* @__PURE__ */ __name((item, order) => {
|
|
|
492
480
|
] });
|
|
493
481
|
}, "RivenOrderComponent");
|
|
494
482
|
var RivenAttributeComponent = /* @__PURE__ */ __name((attr, index) => {
|
|
495
|
-
const attrInfo =
|
|
483
|
+
const attrInfo = globalRivenAttributeList.find(
|
|
484
|
+
(e) => e.slug == attr.url_name
|
|
485
|
+
);
|
|
496
486
|
const attrName = attrInfo.i18n["zh-hans"].name;
|
|
497
487
|
const attrValuePrefix = attrInfo.unit === "multiply" ? "x" : "";
|
|
498
488
|
const unitSuffixMap = {
|
|
@@ -533,46 +523,34 @@ var RivenAttributeComponent = /* @__PURE__ */ __name((attr, index) => {
|
|
|
533
523
|
}, "RivenAttributeComponent");
|
|
534
524
|
|
|
535
525
|
// src/services/wfm-service.ts
|
|
536
|
-
var globalItemDict = {};
|
|
537
526
|
var globalItemList = [];
|
|
538
|
-
var globalRivenItemDict = {};
|
|
539
527
|
var globalRivenItemList = [];
|
|
540
|
-
var
|
|
528
|
+
var globalRivenAttributeList = [];
|
|
541
529
|
var wmOnReady = /* @__PURE__ */ __name(async () => {
|
|
542
530
|
const data = await getWFMItemList();
|
|
543
531
|
if (!data) {
|
|
544
532
|
throw new Error("Failed to fetch items from Warframe Market API.");
|
|
545
533
|
}
|
|
534
|
+
globalItemList = data.data;
|
|
546
535
|
const rivenData = await getWFMRivenItemList();
|
|
547
536
|
if (!rivenData) {
|
|
548
537
|
throw new Error("Failed to fetch riven items from Warframe Market API.");
|
|
549
538
|
}
|
|
539
|
+
globalRivenItemList = rivenData.data;
|
|
550
540
|
const rivenAttributeData = await getWFMRivenAttributeList();
|
|
551
541
|
if (!rivenAttributeData) {
|
|
552
542
|
throw new Error(
|
|
553
543
|
"Failed to fetch riven attributes from Warframe Market API."
|
|
554
544
|
);
|
|
555
545
|
}
|
|
556
|
-
|
|
557
|
-
globalItemDict = transformListIntoDict(data.data, (i) => [
|
|
558
|
-
normalizeOrderName(i.i18n["en"].name),
|
|
559
|
-
normalizeOrderName(i.i18n["zh-hans"].name)
|
|
560
|
-
]);
|
|
561
|
-
globalRivenItemList = rivenData.data;
|
|
562
|
-
globalRivenItemDict = transformListIntoDict(
|
|
563
|
-
rivenData.data,
|
|
564
|
-
(i) => [
|
|
565
|
-
normalizeOrderName(i.i18n["en"].name),
|
|
566
|
-
normalizeOrderName(i.i18n["zh-hans"].name)
|
|
567
|
-
]
|
|
568
|
-
);
|
|
569
|
-
globalRivenAttributeDict = transformListIntoDict(
|
|
570
|
-
rivenAttributeData.data,
|
|
571
|
-
(a) => [a.slug]
|
|
572
|
-
);
|
|
546
|
+
globalRivenAttributeList = rivenAttributeData.data;
|
|
573
547
|
}, "wmOnReady");
|
|
574
548
|
var getItemOrders = /* @__PURE__ */ __name(async (itemName) => {
|
|
575
|
-
const targetItem =
|
|
549
|
+
const targetItem = globalItemList.find(
|
|
550
|
+
(item) => compareCNOrderName(itemName, item.i18n["zh-hans"].name)
|
|
551
|
+
) ?? globalItemList.find(
|
|
552
|
+
(item) => compareENOrderName(itemName, item.i18n["en"].name)
|
|
553
|
+
);
|
|
576
554
|
if (!targetItem) {
|
|
577
555
|
return null;
|
|
578
556
|
}
|
|
@@ -618,140 +596,45 @@ var generateRivenOrderOutput = /* @__PURE__ */ __name(async (puppe, item, orders
|
|
|
618
596
|
const imgBase64 = await getHtmlImageBase64(puppe, element.toString());
|
|
619
597
|
return OutputImage(imgBase64);
|
|
620
598
|
}, "generateRivenOrderOutput");
|
|
621
|
-
var
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
Rhino: ["犀牛", "牛", "铁甲犀牛"],
|
|
625
|
-
Mag: ["磁妹", "磁力"],
|
|
626
|
-
Loki: ["洛基"],
|
|
627
|
-
Excalibur: ["咖喱棒", "圣剑", "咖喱"],
|
|
628
|
-
Ember: ["火鸡"],
|
|
629
|
-
Ash: ["灰烬", "灰烬之刃"],
|
|
630
|
-
Nyx: ["脑溢血"],
|
|
631
|
-
Frost: ["冰男", "冰雪寒霜", "冰队", "冰"],
|
|
632
|
-
Saryn: ["毒妈", "毒"],
|
|
633
|
-
Banshee: ["女妖", "女高音"],
|
|
634
|
-
Vauban: ["工程"],
|
|
635
|
-
Nova: ["诺娃", "加速", "加速娃"],
|
|
636
|
-
Nekros: ["摸尸", "摸"],
|
|
637
|
-
Valkyr: ["瓦尔基里", "瓦喵", "瓦"],
|
|
638
|
-
Oberon: ["奶爸", "龙王", "奥伯龙"],
|
|
639
|
-
Zephyr: ["鸟姐", "鸟"],
|
|
640
|
-
Hydroid: ["水男"],
|
|
641
|
-
Mirage: ["小丑", "丑"],
|
|
642
|
-
Limbo: ["小明", "李明博", "明"],
|
|
643
|
-
Mesa: ["女枪"],
|
|
644
|
-
Chroma: ["龙甲", "龙"],
|
|
645
|
-
Equinox: ["阴阳", "双子"],
|
|
646
|
-
Atlas: ["土石魔像", "土"],
|
|
647
|
-
Wukong: ["猴子", "齐天大圣", "悟空", "猴"],
|
|
648
|
-
Ivara: ["弓妹", "弓"],
|
|
649
|
-
Nezha: ["哪吒", "三太子"],
|
|
650
|
-
Inaros: ["沙"],
|
|
651
|
-
Titania: ["蝶妹"],
|
|
652
|
-
Nidus: ["蛆甲", "蛆"],
|
|
653
|
-
Octavia: ["DJ", "音乐"],
|
|
654
|
-
Harrow: ["主教"],
|
|
655
|
-
Gara: ["玻璃"],
|
|
656
|
-
Khora: ["猫"],
|
|
657
|
-
Revenant: ["夜灵"],
|
|
658
|
-
Garuda: ["血妈", "血"],
|
|
659
|
-
Baruuk: ["武僧"],
|
|
660
|
-
Hildryn: ["母牛"],
|
|
661
|
-
Wisp: ["花"],
|
|
662
|
-
Gauss: ["高斯"],
|
|
663
|
-
Grendel: ["肥宅"],
|
|
664
|
-
Protea: ["茶", "茶妹"],
|
|
665
|
-
Xaku: ["骨"],
|
|
666
|
-
Lavos: ["炼金", "药水", "药水哥", "蛇"],
|
|
667
|
-
Sevagoth: ["鬼", "鲨鱼"],
|
|
668
|
-
Yareli: ["水妹"],
|
|
669
|
-
Caliban: ["卡利班"],
|
|
670
|
-
Gyre: ["电妹"],
|
|
671
|
-
Styanax: ["斯巴达"],
|
|
672
|
-
Voruna: ["狼", "狼妹"],
|
|
673
|
-
Citrine: ["水晶", "宝石"],
|
|
674
|
-
Kullervo: ["刀哥"],
|
|
675
|
-
Dagath: ["马", "赛马娘", "马娘"],
|
|
676
|
-
Qorvex: ["暖气片"],
|
|
677
|
-
Dante: ["但丁"],
|
|
678
|
-
Jade: ["翡翠", "天使"],
|
|
679
|
-
Koumei: [],
|
|
680
|
-
"Cyte-09": ["Cyte09", "老九", "9", "九"],
|
|
681
|
-
Temple: ["吉他"],
|
|
682
|
-
Nokko: ["蘑菇"]
|
|
683
|
-
};
|
|
684
|
-
var warframeAliasDict = ((aliasObject) => {
|
|
685
|
-
const transformedObject = {};
|
|
686
|
-
for (const [key, aliases] of Object.entries(aliasObject)) {
|
|
687
|
-
for (const alias of aliases) {
|
|
688
|
-
if (typeof alias === "string" && alias.length > 0) {
|
|
689
|
-
transformedObject[alias] = key;
|
|
690
|
-
const warframeNameWithSuffix = `${alias}甲`;
|
|
691
|
-
transformedObject[warframeNameWithSuffix] = key;
|
|
692
|
-
}
|
|
693
|
-
transformedObject[key] = key;
|
|
694
|
-
}
|
|
599
|
+
var compareCNOrderName = /* @__PURE__ */ __name((input, standard) => {
|
|
600
|
+
if (!input || !standard || typeof input !== "string" || typeof standard !== "string") {
|
|
601
|
+
return false;
|
|
695
602
|
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
const
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
/蓝图/g,
|
|
710
|
-
""
|
|
711
|
-
);
|
|
712
|
-
const normalizedStandardNoBlueprintSimplifiedPrime = normalizedStandardNoBlueprint.replace(/prime/g, "p");
|
|
713
|
-
const normalizedStandardNoNeu = normalizedStandardNoBlueprintSimplifiedPrime.replace(
|
|
714
|
-
/头部神经光元/g,
|
|
715
|
-
"头"
|
|
716
|
-
);
|
|
717
|
-
return normalizedInput === normalizedStandard || normalizedInput === normalizedStandardNoSet || normalizedInput === normalizedStandardNoSetSimplifiedPrime || normalizedInput === normalizedStandardNoBlueprintSimplifiedPrime || normalizedInput === normalizedStandardNoNeu;
|
|
718
|
-
}, "compareCNOrderName");
|
|
719
|
-
const compareENOrderName = /* @__PURE__ */ __name((input2, standard) => {
|
|
720
|
-
if (!input2 || !standard || typeof input2 !== "string" || typeof standard !== "string") {
|
|
721
|
-
return false;
|
|
722
|
-
}
|
|
723
|
-
const endWithSet = standard.toLowerCase().endsWith(" set");
|
|
724
|
-
const standardNoSet = endWithSet ? standard.slice(0, -4) : standard;
|
|
725
|
-
const endWithBlueprint = standard.toLocaleLowerCase().endsWith("blueprint");
|
|
726
|
-
const standardNoBlueprint = endWithBlueprint ? standard.slice(0, -10) : standard;
|
|
727
|
-
const standardSimplifiedPrime = standardNoSet.replace(/ Prime/g, "p");
|
|
728
|
-
const standardNoBlueprintSimplifiedPrime = standardNoBlueprint.replace(
|
|
729
|
-
/ Prime/g,
|
|
730
|
-
"p"
|
|
731
|
-
);
|
|
732
|
-
const normalizedInput = normalizeOrderName(input2);
|
|
733
|
-
const normalizedStandard = normalizeOrderName(standard);
|
|
734
|
-
if (!normalizedInput || !normalizedStandard) return false;
|
|
735
|
-
const normalizedStandardNoSet = normalizeOrderName(standardNoSet);
|
|
736
|
-
const normalizedStandardSimplifiedPrime = normalizeOrderName(
|
|
737
|
-
standardSimplifiedPrime
|
|
738
|
-
);
|
|
739
|
-
const normalizedStandardNoBlueprint = normalizeOrderName(
|
|
740
|
-
standardNoBlueprintSimplifiedPrime
|
|
741
|
-
);
|
|
742
|
-
return normalizedInput === normalizedStandard || normalizedInput === normalizedStandardNoSet || normalizedInput === normalizedStandardSimplifiedPrime || normalizedInput === normalizedStandardNoBlueprint;
|
|
743
|
-
}, "compareENOrderName");
|
|
744
|
-
const old = globalItemList.find(
|
|
745
|
-
(item) => compareCNOrderName(input, item.i18n["zh-hans"].name)
|
|
746
|
-
) ?? globalItemList.find(
|
|
747
|
-
(item) => compareENOrderName(input, item.i18n["en"].name)
|
|
748
|
-
);
|
|
749
|
-
const direct = globalItemList[normalizeOrderName(input)];
|
|
750
|
-
if (direct) {
|
|
751
|
-
return direct;
|
|
603
|
+
const normalizedInput = normalizeOrderName(input);
|
|
604
|
+
const normalizedStandard = normalizeOrderName(standard);
|
|
605
|
+
if (!normalizedInput || !normalizedStandard) return false;
|
|
606
|
+
const normalizedStandardNoSet = normalizedStandard.replace(/一套/g, "");
|
|
607
|
+
const normalizedStandardNoSetSimplifiedPrime = normalizedStandardNoSet.replace(/prime/g, "p");
|
|
608
|
+
const normalizedStandardNoBlueprint = normalizedStandard.replace(/蓝图/g, "");
|
|
609
|
+
const normalizedStandardNoBlueprintSimplifiedPrime = normalizedStandardNoBlueprint.replace(/prime/g, "p");
|
|
610
|
+
const normalizedStandardNoNeu = normalizedStandardNoBlueprintSimplifiedPrime.replace(/头部神经光元/g, "头");
|
|
611
|
+
return normalizedInput === normalizedStandard || normalizedInput === normalizedStandardNoSet || normalizedInput === normalizedStandardNoSetSimplifiedPrime || normalizedInput === normalizedStandardNoBlueprintSimplifiedPrime || normalizedInput === normalizedStandardNoNeu;
|
|
612
|
+
}, "compareCNOrderName");
|
|
613
|
+
var compareENOrderName = /* @__PURE__ */ __name((input, standard) => {
|
|
614
|
+
if (!input || !standard || typeof input !== "string" || typeof standard !== "string") {
|
|
615
|
+
return false;
|
|
752
616
|
}
|
|
753
|
-
|
|
754
|
-
|
|
617
|
+
const endWithSet = standard.toLowerCase().endsWith(" set");
|
|
618
|
+
const standardNoSet = endWithSet ? standard.slice(0, -4) : standard;
|
|
619
|
+
const endWithBlueprint = standard.toLocaleLowerCase().endsWith("blueprint");
|
|
620
|
+
const standardNoBlueprint = endWithBlueprint ? standard.slice(0, -10) : standard;
|
|
621
|
+
const standardSimplifiedPrime = standardNoSet.replace(/ Prime/g, "p");
|
|
622
|
+
const standardNoBlueprintSimplifiedPrime = standardNoBlueprint.replace(
|
|
623
|
+
/ Prime/g,
|
|
624
|
+
"p"
|
|
625
|
+
);
|
|
626
|
+
const normalizedInput = normalizeOrderName(input);
|
|
627
|
+
const normalizedStandard = normalizeOrderName(standard);
|
|
628
|
+
if (!normalizedInput || !normalizedStandard) return false;
|
|
629
|
+
const normalizedStandardNoSet = normalizeOrderName(standardNoSet);
|
|
630
|
+
const normalizedStandardSimplifiedPrime = normalizeOrderName(
|
|
631
|
+
standardSimplifiedPrime
|
|
632
|
+
);
|
|
633
|
+
const normalizedStandardNoBlueprint = normalizeOrderName(
|
|
634
|
+
standardNoBlueprintSimplifiedPrime
|
|
635
|
+
);
|
|
636
|
+
return normalizedInput === normalizedStandard || normalizedInput === normalizedStandardNoSet || normalizedInput === normalizedStandardSimplifiedPrime || normalizedInput === normalizedStandardNoBlueprint;
|
|
637
|
+
}, "compareENOrderName");
|
|
755
638
|
var compareRivenItemName = /* @__PURE__ */ __name((input, standard) => {
|
|
756
639
|
if (!input || !standard || typeof input !== "string" || typeof standard !== "string") {
|
|
757
640
|
return false;
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-warframe",
|
|
3
3
|
"description": "WFMToolkit",
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "
|
|
7
|
+
"build": "yakumo build",
|
|
8
|
+
"clean": "yakumo clean",
|
|
9
|
+
"dep": "yakumo upgrade",
|
|
10
|
+
"dtsc": "dtsc"
|
|
8
11
|
},
|
|
9
12
|
"author": "CloudeaSoft <cloudeasoft@qq.com>",
|
|
10
13
|
"repository": {
|
|
@@ -36,7 +39,7 @@
|
|
|
36
39
|
},
|
|
37
40
|
"peerDependencies": {
|
|
38
41
|
"@satorijs/element": "^3.1.8",
|
|
39
|
-
"koishi": "^4.18.
|
|
42
|
+
"koishi": "^4.18.9",
|
|
40
43
|
"koishi-plugin-puppeteer": "^3.9.0"
|
|
41
44
|
},
|
|
42
45
|
"peerDependenciesMeta": {
|
|
@@ -45,15 +48,27 @@
|
|
|
45
48
|
}
|
|
46
49
|
},
|
|
47
50
|
"devDependencies": {
|
|
51
|
+
"@koishijs/client": "^5.30.11",
|
|
48
52
|
"@koishijs/plugin-help": "^2.4.6",
|
|
49
53
|
"@satorijs/element": "^3.1.8",
|
|
50
|
-
"@types/node": "^24.10.
|
|
54
|
+
"@types/node": "^24.10.4",
|
|
51
55
|
"dtsc": "^3.1.0",
|
|
56
|
+
"esbuild": "^0.27.1",
|
|
52
57
|
"koishi": "^4.18.9",
|
|
53
58
|
"koishi-plugin-puppeteer": "^3.9.0",
|
|
54
|
-
"typescript": "^5.9.3"
|
|
59
|
+
"typescript": "^5.9.3",
|
|
60
|
+
"yakumo": "^1.0.0",
|
|
61
|
+
"yakumo-esbuild": "^1.0.0",
|
|
62
|
+
"yakumo-tsc": "^1.0.0"
|
|
55
63
|
},
|
|
56
64
|
"dependencies": {
|
|
65
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
66
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
67
|
+
"@semantic-release/git": "^10.0.1",
|
|
68
|
+
"@semantic-release/github": "^12.0.2",
|
|
69
|
+
"@semantic-release/npm": "^13.1.3",
|
|
70
|
+
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
71
|
+
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
57
72
|
"warframe-public-export-plus": "^0.5.96",
|
|
58
73
|
"warframe-worldstate-data": "^3.1.16",
|
|
59
74
|
"warframe-worldstate-parser": "^5.2.12"
|