koishi-plugin-warframe 1.2.1 → 1.2.2
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/README.md +5 -3
- package/lib/index.d.ts +26 -19
- package/lib/index.js +338 -366
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,14 +8,16 @@ Toolkit for warframe. **(In development)**
|
|
|
8
8
|
|
|
9
9
|
| Command Name | Default Alias | Description |
|
|
10
10
|
| ------------------------ | ---------------------- | ------------------------------------------------------------------------------------------- |
|
|
11
|
-
| wmi
|
|
12
|
-
| wmr
|
|
11
|
+
| wmi [name:string] | | Warframe market orders. |
|
|
12
|
+
| wmr [name:string] | | Warframe market orders. |
|
|
13
13
|
| arbitration [day:number] | arbi, 仲裁, 仲裁表 | High-value arbitration schedule. The arg decide how long in days to display, defaults to 3. |
|
|
14
14
|
| fissure | 裂缝, 裂隙 | Current fissures. |
|
|
15
15
|
| spfissure | 钢铁裂缝, 钢铁裂隙 | Current steelpath fissures. |
|
|
16
16
|
| rjfissure | 九重天裂缝, 九重天裂隙 | Current railjack fissures. |
|
|
17
17
|
| circuit | 灵化, 灵化之源 | Weekly rewards of circuit, both warframe parts and incarnons. |
|
|
18
|
-
|
|
|
18
|
+
| relic [name:string] | 遗物, 核桃 | Relic rewards with corresponding data, including wfm medium price and ducats value. |
|
|
19
|
+
| weekly | 周常 | Weekly mission info (archon hunt, deep archimedea, temporal archimedea) |
|
|
20
|
+
| environment | env, 地球, 福尔图娜 | Region environment (time) |
|
|
19
21
|
|
|
20
22
|
## Install
|
|
21
23
|
|
package/lib/index.d.ts
CHANGED
|
@@ -3,10 +3,29 @@ import Puppeteer from 'koishi-plugin-puppeteer';
|
|
|
3
3
|
import Element from '@satorijs/element';
|
|
4
4
|
import { Element, Argv, Context, Schema } from 'koishi';
|
|
5
5
|
import WorldState from 'warframe-worldstate-parser';
|
|
6
|
+
export const toTimeStamp: (timeStr: string) => number;
|
|
7
|
+
/**
|
|
8
|
+
* 毫秒转「X小时X分钟X秒」格式(0单位不显示)
|
|
9
|
+
* @param {number} ms - 待转换的毫秒数(非负)
|
|
10
|
+
* @returns {string} 示例:3661000ms → "1小时1分钟1秒";61000ms → "1分钟1秒";500ms → "0秒"
|
|
11
|
+
*/
|
|
12
|
+
export const msToHumanReadable: (ms: number) => string;
|
|
13
|
+
/**
|
|
14
|
+
* Creates an async cache with a time-to-live (TTL).
|
|
15
|
+
* @param fetchFn Function to fetch fresh data.
|
|
16
|
+
* @param ttlMs Time-to-live in milliseconds.
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
export function createAsyncCache<T>(fetchFn: () => Promise<T>, ttlMs: number): {
|
|
20
|
+
get: () => Promise<T>;
|
|
21
|
+
};
|
|
22
|
+
export const normalizeName: (text: string) => string;
|
|
23
|
+
export const fullWidthToHalfWidth: (text: string) => string;
|
|
24
|
+
export const removeSpace: (text: string) => string;
|
|
25
|
+
export const pascalToSpaced: (text: string) => string;
|
|
26
|
+
export const toPascalCase: (text: string) => string;
|
|
6
27
|
export const fetchAsyncText: (url: string, method?: string) => Promise<string | null>;
|
|
7
28
|
export const fetchAsyncData: <T>(url: string, method?: string) => Promise<T | null>;
|
|
8
|
-
export const fullWidthToHalfWidth: (str: string) => string;
|
|
9
|
-
export const removeSpace: (text: string) => string;
|
|
10
29
|
export const listToDict: <T>(dict: T[], predict: (obj: T) => string[]) => {
|
|
11
30
|
[key: string]: T;
|
|
12
31
|
};
|
|
@@ -18,15 +37,6 @@ export const dictToKeyDict: <T>(dict: {
|
|
|
18
37
|
}, predict: (obj: T) => string[]) => {
|
|
19
38
|
[key: string]: string;
|
|
20
39
|
};
|
|
21
|
-
export const pascalToSpaced: (str: string) => string;
|
|
22
|
-
export const toPascalCase: (str: string) => string;
|
|
23
|
-
export const toTimeStamp: (timeStr: string) => number;
|
|
24
|
-
/**
|
|
25
|
-
* 毫秒转「X小时X分钟X秒」格式(0单位不显示)
|
|
26
|
-
* @param {number} ms - 待转换的毫秒数(非负)
|
|
27
|
-
* @returns {string} 示例:3661000ms → "1小时1分钟1秒";61000ms → "1分钟1秒";500ms → "0秒"
|
|
28
|
-
*/
|
|
29
|
-
export const msToHumanReadable: (ms: number) => string;
|
|
30
40
|
export const getSolNodeKey: (name: string) => Promise<string>;
|
|
31
41
|
export const getMissionTypeKey: (name: string) => Promise<string>;
|
|
32
42
|
export const fissureTierName: {
|
|
@@ -75,9 +85,6 @@ export const getHtmlImageBase64: (puppe: Puppeteer, html: string, type?: "png" |
|
|
|
75
85
|
export const OutputImage: (imgBase64: string) => Element;
|
|
76
86
|
export const ItemOrderOutput: (item: ItemShort, orders: OrderWithUser[]) => Element;
|
|
77
87
|
export const RivenOrderOutput: (item: RivenItem, orders: RivenOrder[]) => Element;
|
|
78
|
-
export function createAsyncCache<T>(fetchFn: () => Promise<T>, ttlMs: number): {
|
|
79
|
-
get: () => Promise<T>;
|
|
80
|
-
};
|
|
81
88
|
export let globalRivenAttributeDict: Record<string, RivenAttribute>;
|
|
82
89
|
export const wmOnReady: () => Promise<void>;
|
|
83
90
|
export const setGlobalItem: (data: ItemShort[]) => void;
|
|
@@ -93,8 +100,8 @@ export const getRivenOrders: (input: string) => Promise<{
|
|
|
93
100
|
orders: RivenOrder[];
|
|
94
101
|
}>;
|
|
95
102
|
export const generateRivenOrderOutput: (puppe: Puppeteer, item: RivenItem, orders: RivenOrder[]) => Promise<import("koishi").Element>;
|
|
96
|
-
export const
|
|
97
|
-
export const
|
|
103
|
+
export const applyRelicData: (relic: Relic) => Promise<OutputRelic>;
|
|
104
|
+
export const stringToWFMItem: (input: string) => ItemShort | undefined;
|
|
98
105
|
declare const _default: {
|
|
99
106
|
SolNode147: number;
|
|
100
107
|
SolNode149: number;
|
|
@@ -134,9 +141,9 @@ export const generateCircuitWeekOutput: (puppe: Puppeteer, data: {
|
|
|
134
141
|
incarnons: string[];
|
|
135
142
|
warframes: string[];
|
|
136
143
|
}) => Promise<import("koishi").Element>;
|
|
137
|
-
export const getFissures: () => Promise<
|
|
138
|
-
export const getSteelPathFissures: () => Promise<
|
|
139
|
-
export const getRailjackFissures: () => Promise<
|
|
144
|
+
export const getFissures: () => Promise<any[] | "内部错误,获取最新信息失败">;
|
|
145
|
+
export const getSteelPathFissures: () => Promise<any[] | "内部错误,获取最新信息失败">;
|
|
146
|
+
export const getRailjackFissures: () => Promise<any[] | "内部错误,获取最新信息失败">;
|
|
140
147
|
export const generateFissureOutput: (puppe: Puppeteer, fissures: Fissure[], type: "fissure" | "sp-fissure" | "rj-fissure") => Promise<import("koishi").Element>;
|
|
141
148
|
export const wmCommand: (action: Argv, input: string) => Promise<string | import("koishi").Element>;
|
|
142
149
|
export const wmrCommand: (action: Argv, input: string) => Promise<string | import("koishi").Element>;
|
package/lib/index.js
CHANGED
|
@@ -37,7 +37,62 @@ __export(index_exports, {
|
|
|
37
37
|
module.exports = __toCommonJS(index_exports);
|
|
38
38
|
var import_koishi = require("koishi");
|
|
39
39
|
|
|
40
|
-
// src/utils/
|
|
40
|
+
// src/utils/time.ts
|
|
41
|
+
var toTimeStamp = /* @__PURE__ */ __name((timeStr) => {
|
|
42
|
+
return new Date(timeStr).getTime();
|
|
43
|
+
}, "toTimeStamp");
|
|
44
|
+
var msToHumanReadable = /* @__PURE__ */ __name((ms) => {
|
|
45
|
+
const totalMs = Math.max(Number(ms) || 0, 0);
|
|
46
|
+
const totalSeconds = Math.floor(totalMs / 1e3);
|
|
47
|
+
const hours = Math.floor(totalSeconds / 3600);
|
|
48
|
+
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
49
|
+
const seconds = totalSeconds % 60;
|
|
50
|
+
const parts = [];
|
|
51
|
+
if (hours > 0) parts.push(`${hours}小时`);
|
|
52
|
+
if (minutes > 0) parts.push(`${minutes}分钟`);
|
|
53
|
+
parts.push(`${seconds}秒`);
|
|
54
|
+
return parts.join("");
|
|
55
|
+
}, "msToHumanReadable");
|
|
56
|
+
|
|
57
|
+
// src/utils/cache.ts
|
|
58
|
+
function createAsyncCache(fetchFn, ttlMs) {
|
|
59
|
+
let cache = null;
|
|
60
|
+
let lastUpdatedAt = 0;
|
|
61
|
+
let inFlight = null;
|
|
62
|
+
async function get() {
|
|
63
|
+
const now = Date.now();
|
|
64
|
+
if (cache && now - lastUpdatedAt < ttlMs) {
|
|
65
|
+
return cache;
|
|
66
|
+
}
|
|
67
|
+
if (inFlight) {
|
|
68
|
+
return inFlight;
|
|
69
|
+
}
|
|
70
|
+
inFlight = (async () => {
|
|
71
|
+
try {
|
|
72
|
+
const result = await fetchFn();
|
|
73
|
+
cache = result;
|
|
74
|
+
lastUpdatedAt = Date.now();
|
|
75
|
+
return cache;
|
|
76
|
+
} finally {
|
|
77
|
+
inFlight = null;
|
|
78
|
+
}
|
|
79
|
+
})();
|
|
80
|
+
return inFlight;
|
|
81
|
+
}
|
|
82
|
+
__name(get, "get");
|
|
83
|
+
return { get };
|
|
84
|
+
}
|
|
85
|
+
__name(createAsyncCache, "createAsyncCache");
|
|
86
|
+
|
|
87
|
+
// src/utils/text.ts
|
|
88
|
+
var normalizeName = /* @__PURE__ */ __name((text) => fullWidthToHalfWidth(text).toLowerCase().replace(/[·'\-+()【】\[\]{},。!?;:_]/g, "").replace(/\s+/g, ""), "normalizeName");
|
|
89
|
+
var fullWidthToHalfWidth = /* @__PURE__ */ __name((text) => text.replace(/[\uFF01-\uFF5E]/g, (char) => {
|
|
90
|
+
return String.fromCharCode(char.charCodeAt(0) - 65248);
|
|
91
|
+
}).replace(/\u3000/g, " "), "fullWidthToHalfWidth");
|
|
92
|
+
var removeSpace = /* @__PURE__ */ __name((text) => text.replace(/\s/g, ""), "removeSpace");
|
|
93
|
+
var pascalToSpaced = /* @__PURE__ */ __name((text) => text.replace(/([A-Z])/g, " $1").trim(), "pascalToSpaced");
|
|
94
|
+
|
|
95
|
+
// src/utils/http.ts
|
|
41
96
|
var fetchAsyncText = /* @__PURE__ */ __name(async (url, method = "GET") => {
|
|
42
97
|
const response = await fetch(url, {
|
|
43
98
|
method,
|
|
@@ -74,12 +129,8 @@ var fetchAsyncData = /* @__PURE__ */ __name(async (url, method = "GET") => {
|
|
|
74
129
|
return null;
|
|
75
130
|
}
|
|
76
131
|
}, "fetchAsyncData");
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return String.fromCharCode(char.charCodeAt(0) - 65248);
|
|
80
|
-
}).replace(/\u3000/g, " ");
|
|
81
|
-
}, "fullWidthToHalfWidth");
|
|
82
|
-
var removeSpace = /* @__PURE__ */ __name((text) => text.replace(/\s/g, ""), "removeSpace");
|
|
132
|
+
|
|
133
|
+
// src/utils/collection.ts
|
|
83
134
|
var listToDict = /* @__PURE__ */ __name((dict, predict) => {
|
|
84
135
|
const result = {};
|
|
85
136
|
for (const obj of dict) {
|
|
@@ -104,26 +155,6 @@ var dictToKeyDict = /* @__PURE__ */ __name((dict, predict) => {
|
|
|
104
155
|
}
|
|
105
156
|
return result;
|
|
106
157
|
}, "dictToKeyDict");
|
|
107
|
-
var pascalToSpaced = /* @__PURE__ */ __name((str) => {
|
|
108
|
-
return str.replace(/([A-Z])/g, " $1").trim();
|
|
109
|
-
}, "pascalToSpaced");
|
|
110
|
-
|
|
111
|
-
// src/utils/time.ts
|
|
112
|
-
var toTimeStamp = /* @__PURE__ */ __name((timeStr) => {
|
|
113
|
-
return new Date(timeStr).getTime();
|
|
114
|
-
}, "toTimeStamp");
|
|
115
|
-
var msToHumanReadable = /* @__PURE__ */ __name((ms) => {
|
|
116
|
-
const totalMs = Math.max(Number(ms) || 0, 0);
|
|
117
|
-
const totalSeconds = Math.floor(totalMs / 1e3);
|
|
118
|
-
const hours = Math.floor(totalSeconds / 3600);
|
|
119
|
-
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
120
|
-
const seconds = totalSeconds % 60;
|
|
121
|
-
const parts = [];
|
|
122
|
-
if (hours > 0) parts.push(`${hours}小时`);
|
|
123
|
-
if (minutes > 0) parts.push(`${minutes}分钟`);
|
|
124
|
-
parts.push(`${seconds}秒`);
|
|
125
|
-
return parts.join("");
|
|
126
|
-
}, "msToHumanReadable");
|
|
127
158
|
|
|
128
159
|
// src/utils/wfcd-adapter.ts
|
|
129
160
|
var solNodesEnDict = null;
|
|
@@ -569,38 +600,16 @@ var RivenAttributeComponent = /* @__PURE__ */ __name((attr, index) => {
|
|
|
569
600
|
|
|
570
601
|
// src/services/wfm-service.ts
|
|
571
602
|
var import_warframe_public_export_plus2 = require("warframe-public-export-plus");
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
let inFlight = null;
|
|
578
|
-
async function get() {
|
|
579
|
-
const now = Date.now();
|
|
580
|
-
if (cache && now - lastUpdated < ttlMs) {
|
|
581
|
-
return cache;
|
|
603
|
+
var globalDucatnatorIDDict = createAsyncCache(
|
|
604
|
+
async () => {
|
|
605
|
+
const data = await getWFMDucatnator();
|
|
606
|
+
if (!data || !data.payload) {
|
|
607
|
+
return void 0;
|
|
582
608
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
try {
|
|
588
|
-
const result = await fetchFn();
|
|
589
|
-
cache = result;
|
|
590
|
-
lastUpdated = Date.now();
|
|
591
|
-
return cache;
|
|
592
|
-
} finally {
|
|
593
|
-
inFlight = null;
|
|
594
|
-
}
|
|
595
|
-
})();
|
|
596
|
-
return inFlight;
|
|
597
|
-
}
|
|
598
|
-
__name(get, "get");
|
|
599
|
-
return { get };
|
|
600
|
-
}
|
|
601
|
-
__name(createAsyncCache, "createAsyncCache");
|
|
602
|
-
|
|
603
|
-
// src/services/wfm-service.ts
|
|
609
|
+
return listToDict(data.payload.previous_hour, (d) => [d.item]);
|
|
610
|
+
},
|
|
611
|
+
36e5
|
|
612
|
+
);
|
|
604
613
|
var globalItemList = [];
|
|
605
614
|
var globalRivenItemList = [];
|
|
606
615
|
var globalRivenAttributeList = [];
|
|
@@ -609,6 +618,100 @@ var globalRivenItemDict = {};
|
|
|
609
618
|
var globalRivenAttributeDict = {};
|
|
610
619
|
var globalItemNameToSlugDict = {};
|
|
611
620
|
var globalItemGameRefDict = {};
|
|
621
|
+
var warframeAlias = {
|
|
622
|
+
Volt: ["电", "电男", "伏特"],
|
|
623
|
+
Trinity: ["奶妈", "奶"],
|
|
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
|
+
transformedObject[key] = key;
|
|
688
|
+
for (const alias of aliases) {
|
|
689
|
+
if (typeof alias === "string" && alias.length > 0) {
|
|
690
|
+
transformedObject[alias] = key;
|
|
691
|
+
const warframeNameWithSuffix = `${alias}甲`;
|
|
692
|
+
transformedObject[warframeNameWithSuffix] = key;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
return transformedObject;
|
|
697
|
+
})(warframeAlias);
|
|
698
|
+
var setSuffix = "一套";
|
|
699
|
+
var bpSuffix = "蓝图";
|
|
700
|
+
var primeSuffix = "prime";
|
|
701
|
+
var warframePartSuffix = ["系统", "头部神经光元", "机体"];
|
|
702
|
+
var weaponPartSuffix = [
|
|
703
|
+
"枪管",
|
|
704
|
+
"枪托",
|
|
705
|
+
"枪机",
|
|
706
|
+
"弓弦",
|
|
707
|
+
"上弓臂",
|
|
708
|
+
"下弓臂",
|
|
709
|
+
"刀刃",
|
|
710
|
+
"握柄",
|
|
711
|
+
"拳套",
|
|
712
|
+
"圆盘",
|
|
713
|
+
"连接器"
|
|
714
|
+
];
|
|
612
715
|
var wmOnReady = /* @__PURE__ */ __name(async () => {
|
|
613
716
|
const data = await getWFMItemList();
|
|
614
717
|
if (!data) {
|
|
@@ -635,10 +738,10 @@ var setGlobalItem = /* @__PURE__ */ __name((data) => {
|
|
|
635
738
|
const result = {};
|
|
636
739
|
for (const item of list) {
|
|
637
740
|
if (item.i18n["zh-hans"]?.name) {
|
|
638
|
-
result[
|
|
741
|
+
result[normalizeName(item.i18n["zh-hans"].name)] = item.slug;
|
|
639
742
|
}
|
|
640
743
|
if (item.i18n["en"]?.name) {
|
|
641
|
-
result[
|
|
744
|
+
result[normalizeName(item.i18n["en"].name)] = item.slug;
|
|
642
745
|
}
|
|
643
746
|
}
|
|
644
747
|
return result;
|
|
@@ -655,7 +758,7 @@ var setGlobalRivenAttribute = /* @__PURE__ */ __name((data) => {
|
|
|
655
758
|
}, "setGlobalRivenAttribute");
|
|
656
759
|
var getItemOrders = /* @__PURE__ */ __name(async (input) => {
|
|
657
760
|
if (!input) return null;
|
|
658
|
-
input =
|
|
761
|
+
input = normalizeName(input);
|
|
659
762
|
const isFullLevel = /^满级|满级$/.test(input);
|
|
660
763
|
if (isFullLevel) {
|
|
661
764
|
if (input.match(/^满级/)) {
|
|
@@ -664,7 +767,7 @@ var getItemOrders = /* @__PURE__ */ __name(async (input) => {
|
|
|
664
767
|
input = input.slice(0, input.length - 2);
|
|
665
768
|
}
|
|
666
769
|
}
|
|
667
|
-
const targetItem =
|
|
770
|
+
const targetItem = stringToWFMItem(input);
|
|
668
771
|
if (!targetItem) {
|
|
669
772
|
return null;
|
|
670
773
|
}
|
|
@@ -710,7 +813,7 @@ var generateRivenOrderOutput = /* @__PURE__ */ __name(async (puppe, item, orders
|
|
|
710
813
|
const imgBase64 = await getHtmlImageBase64(puppe, element.toString());
|
|
711
814
|
return OutputImage(imgBase64);
|
|
712
815
|
}, "generateRivenOrderOutput");
|
|
713
|
-
var
|
|
816
|
+
var applyRelicData = /* @__PURE__ */ __name(async (relic) => {
|
|
714
817
|
const tier = import_warframe_public_export_plus2.dict_zh[relic.tierKey] ?? relic.tier;
|
|
715
818
|
const wfmDict = await globalDucatnatorIDDict.get();
|
|
716
819
|
const loadedItems = relic.items.map((element) => {
|
|
@@ -728,7 +831,7 @@ var loadRelicData = /* @__PURE__ */ __name(async (relic) => {
|
|
|
728
831
|
ducats: 0
|
|
729
832
|
};
|
|
730
833
|
}
|
|
731
|
-
const platinum = wfmDict ? wfmDict[item.id]?.
|
|
834
|
+
const platinum = wfmDict ? wfmDict[item.id]?.median : void 0;
|
|
732
835
|
return {
|
|
733
836
|
...element,
|
|
734
837
|
name: item.i18n["zh-hans"].name,
|
|
@@ -741,161 +844,9 @@ var loadRelicData = /* @__PURE__ */ __name(async (relic) => {
|
|
|
741
844
|
num: relic.num,
|
|
742
845
|
items: loadedItems
|
|
743
846
|
};
|
|
744
|
-
}, "
|
|
745
|
-
var
|
|
746
|
-
|
|
747
|
-
Trinity: ["奶妈", "奶"],
|
|
748
|
-
Rhino: ["犀牛", "牛", "铁甲犀牛"],
|
|
749
|
-
Mag: ["磁妹", "磁力"],
|
|
750
|
-
Loki: ["洛基"],
|
|
751
|
-
Excalibur: ["咖喱棒", "圣剑", "咖喱"],
|
|
752
|
-
Ember: ["火鸡"],
|
|
753
|
-
Ash: ["灰烬", "灰烬之刃"],
|
|
754
|
-
Nyx: ["脑溢血"],
|
|
755
|
-
Frost: ["冰男", "冰雪寒霜", "冰队", "冰"],
|
|
756
|
-
Saryn: ["毒妈", "毒"],
|
|
757
|
-
Banshee: ["女妖", "女高音"],
|
|
758
|
-
Vauban: ["工程"],
|
|
759
|
-
Nova: ["诺娃", "加速", "加速娃"],
|
|
760
|
-
Nekros: ["摸尸", "摸"],
|
|
761
|
-
Valkyr: ["瓦尔基里", "瓦喵", "瓦"],
|
|
762
|
-
Oberon: ["奶爸", "龙王", "奥伯龙"],
|
|
763
|
-
Zephyr: ["鸟姐", "鸟"],
|
|
764
|
-
Hydroid: ["水男"],
|
|
765
|
-
Mirage: ["小丑", "丑"],
|
|
766
|
-
Limbo: ["小明", "李明博", "明"],
|
|
767
|
-
Mesa: ["女枪"],
|
|
768
|
-
Chroma: ["龙甲", "龙"],
|
|
769
|
-
Equinox: ["阴阳", "双子"],
|
|
770
|
-
Atlas: ["土石魔像", "土"],
|
|
771
|
-
Wukong: ["猴子", "齐天大圣", "悟空", "猴"],
|
|
772
|
-
Ivara: ["弓妹", "弓"],
|
|
773
|
-
Nezha: ["哪吒", "三太子"],
|
|
774
|
-
Inaros: ["沙"],
|
|
775
|
-
Titania: ["蝶妹"],
|
|
776
|
-
Nidus: ["蛆甲", "蛆"],
|
|
777
|
-
Octavia: ["DJ", "音乐"],
|
|
778
|
-
Harrow: ["主教"],
|
|
779
|
-
Gara: ["玻璃"],
|
|
780
|
-
Khora: ["猫"],
|
|
781
|
-
Revenant: ["夜灵"],
|
|
782
|
-
Garuda: ["血妈", "血"],
|
|
783
|
-
Baruuk: ["武僧"],
|
|
784
|
-
Hildryn: ["母牛"],
|
|
785
|
-
Wisp: ["花"],
|
|
786
|
-
Gauss: ["高斯"],
|
|
787
|
-
Grendel: ["肥宅"],
|
|
788
|
-
Protea: ["茶", "茶妹"],
|
|
789
|
-
Xaku: ["骨"],
|
|
790
|
-
Lavos: ["炼金", "药水", "药水哥", "蛇"],
|
|
791
|
-
Sevagoth: ["鬼", "鲨鱼"],
|
|
792
|
-
Yareli: ["水妹"],
|
|
793
|
-
Caliban: ["卡利班"],
|
|
794
|
-
Gyre: ["电妹"],
|
|
795
|
-
Styanax: ["斯巴达"],
|
|
796
|
-
Voruna: ["狼", "狼妹"],
|
|
797
|
-
Citrine: ["水晶", "宝石"],
|
|
798
|
-
Kullervo: ["刀哥"],
|
|
799
|
-
Dagath: ["马", "赛马娘", "马娘"],
|
|
800
|
-
Qorvex: ["暖气片"],
|
|
801
|
-
Dante: ["但丁"],
|
|
802
|
-
Jade: ["翡翠", "天使"],
|
|
803
|
-
Koumei: [],
|
|
804
|
-
"Cyte-09": ["Cyte09", "老九", "9", "九"],
|
|
805
|
-
Temple: ["吉他"],
|
|
806
|
-
Nokko: ["蘑菇"]
|
|
807
|
-
};
|
|
808
|
-
var warframeAliasDict = ((aliasObject) => {
|
|
809
|
-
const transformedObject = {};
|
|
810
|
-
for (const [key, aliases] of Object.entries(aliasObject)) {
|
|
811
|
-
for (const alias of aliases) {
|
|
812
|
-
if (typeof alias === "string" && alias.length > 0) {
|
|
813
|
-
transformedObject[alias] = key;
|
|
814
|
-
const warframeNameWithSuffix = `${alias}甲`;
|
|
815
|
-
transformedObject[warframeNameWithSuffix] = key;
|
|
816
|
-
}
|
|
817
|
-
transformedObject[key] = key;
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
return transformedObject;
|
|
821
|
-
})(warframeAlias);
|
|
822
|
-
var setSuffix = "一套";
|
|
823
|
-
var bpSuffix = "蓝图";
|
|
824
|
-
var primeSuffix = "prime";
|
|
825
|
-
var warframePartSuffix = ["系统", "头部神经光元", "机体"];
|
|
826
|
-
var weaponPartSuffix = [
|
|
827
|
-
"枪管",
|
|
828
|
-
"枪托",
|
|
829
|
-
"枪机",
|
|
830
|
-
"弓弦",
|
|
831
|
-
"上弓臂",
|
|
832
|
-
"下弓臂",
|
|
833
|
-
"刀刃",
|
|
834
|
-
"握柄",
|
|
835
|
-
"拳套",
|
|
836
|
-
"圆盘",
|
|
837
|
-
"连接器"
|
|
838
|
-
];
|
|
839
|
-
var removeNameSuffix = /* @__PURE__ */ __name((input) => {
|
|
840
|
-
let hasBPSuffix = false;
|
|
841
|
-
if (input.endsWith(bpSuffix)) {
|
|
842
|
-
input = input.replace(new RegExp(`${bpSuffix}$`), "");
|
|
843
|
-
hasBPSuffix = true;
|
|
844
|
-
}
|
|
845
|
-
if (input.endsWith(setSuffix)) {
|
|
846
|
-
input = input.replace(new RegExp(`${setSuffix}$`), "");
|
|
847
|
-
}
|
|
848
|
-
if (input.endsWith(bpSuffix)) {
|
|
849
|
-
input = input.replace(new RegExp(`${bpSuffix}$`), "");
|
|
850
|
-
hasBPSuffix = true;
|
|
851
|
-
}
|
|
852
|
-
const suffix = warframePartSuffix.find((value) => input.endsWith(value)) ?? weaponPartSuffix.find((value) => input.endsWith(value)) ?? (input.endsWith("头") ? "头部神经光元" : void 0) ?? (hasBPSuffix ? bpSuffix : void 0) ?? "";
|
|
853
|
-
if (suffix) {
|
|
854
|
-
input = input.endsWith("头") ? input.replace(/头$/, "") : input;
|
|
855
|
-
const pure = input.replace(new RegExp(`${suffix}$`), "");
|
|
856
|
-
return {
|
|
857
|
-
pure,
|
|
858
|
-
suffix
|
|
859
|
-
};
|
|
860
|
-
} else {
|
|
861
|
-
return {
|
|
862
|
-
pure: input,
|
|
863
|
-
suffix
|
|
864
|
-
};
|
|
865
|
-
}
|
|
866
|
-
}, "removeNameSuffix");
|
|
867
|
-
var shortHandProcess = /* @__PURE__ */ __name((input) => {
|
|
868
|
-
const { pure: inputNoSuffix, suffix } = removeNameSuffix(input);
|
|
869
|
-
if (inputNoSuffix === input) {
|
|
870
|
-
const fixSet = input + setSuffix;
|
|
871
|
-
const fixSetRes = globalItemNameToSlugDict[fixSet];
|
|
872
|
-
if (fixSetRes) return globalItemDict[fixSetRes];
|
|
873
|
-
const fixPrime = input.endsWith(primeSuffix) ? input : input.endsWith("p") ? input.slice(0, input.length - 1) + primeSuffix : input + primeSuffix;
|
|
874
|
-
const fixPrimeRes = globalItemNameToSlugDict[fixPrime];
|
|
875
|
-
if (fixPrimeRes) return globalItemDict[fixPrimeRes];
|
|
876
|
-
const fixPrimeSet = fixPrime + setSuffix;
|
|
877
|
-
const fixPrimeSetRes = globalItemNameToSlugDict[fixPrimeSet];
|
|
878
|
-
if (fixPrimeSetRes) return globalItemDict[fixPrimeSetRes];
|
|
879
|
-
const fixBP = input + bpSuffix;
|
|
880
|
-
const fixBPRes = globalItemNameToSlugDict[fixBP];
|
|
881
|
-
if (fixBPRes) return globalItemDict[fixBPRes];
|
|
882
|
-
const fixPrimeBP = fixPrime + bpSuffix;
|
|
883
|
-
const fixPrimeBPRes = globalItemNameToSlugDict[fixPrimeBP];
|
|
884
|
-
if (fixPrimeBPRes) return globalItemDict[fixPrimeBPRes];
|
|
885
|
-
} else {
|
|
886
|
-
const fixBP = inputNoSuffix + suffix + bpSuffix;
|
|
887
|
-
const fixBPRes = globalItemNameToSlugDict[fixBP];
|
|
888
|
-
if (fixBPRes) return globalItemDict[fixBPRes];
|
|
889
|
-
const fixPrime = inputNoSuffix.endsWith(primeSuffix) ? inputNoSuffix : inputNoSuffix.endsWith("p") ? inputNoSuffix.slice(0, inputNoSuffix.length - 1) + primeSuffix : inputNoSuffix + primeSuffix;
|
|
890
|
-
const fixPrimeRes = globalItemNameToSlugDict[fixPrime + suffix];
|
|
891
|
-
if (fixPrimeRes) return globalItemDict[fixPrimeRes];
|
|
892
|
-
const fixPrimeBP = fixPrime + suffix + bpSuffix;
|
|
893
|
-
const fixPrimeBPRes = globalItemNameToSlugDict[fixPrimeBP];
|
|
894
|
-
if (fixPrimeBPRes) return globalItemDict[fixPrimeBPRes];
|
|
895
|
-
}
|
|
896
|
-
}, "shortHandProcess");
|
|
897
|
-
var inputToItem = /* @__PURE__ */ __name((input) => {
|
|
898
|
-
input = normalizeOrderName(input);
|
|
847
|
+
}, "applyRelicData");
|
|
848
|
+
var stringToWFMItem = /* @__PURE__ */ __name((input) => {
|
|
849
|
+
input = normalizeName(input);
|
|
899
850
|
const slug = globalItemNameToSlugDict[input];
|
|
900
851
|
if (slug) return globalItemDict[slug];
|
|
901
852
|
const normalShortHandRes = shortHandProcess(input);
|
|
@@ -905,7 +856,7 @@ var inputToItem = /* @__PURE__ */ __name((input) => {
|
|
|
905
856
|
const mappedAliasHasEndP = warframeAliasDict[aliasHasEndP];
|
|
906
857
|
if (mappedAliasHasEndP) {
|
|
907
858
|
const aliasHasEndPRes = shortHandProcess(
|
|
908
|
-
|
|
859
|
+
normalizeName(mappedAliasHasEndP) + primeSuffix + suffix
|
|
909
860
|
);
|
|
910
861
|
if (aliasHasEndPRes) return aliasHasEndPRes;
|
|
911
862
|
}
|
|
@@ -914,7 +865,7 @@ var inputToItem = /* @__PURE__ */ __name((input) => {
|
|
|
914
865
|
const mappedAliasNoEndP = warframeAliasDict[aliasNoEndP];
|
|
915
866
|
if (mappedAliasNoEndP) {
|
|
916
867
|
const aliasNoEndPRes = shortHandProcess(
|
|
917
|
-
|
|
868
|
+
normalizeName(mappedAliasNoEndP) + primeSuffix + suffix
|
|
918
869
|
);
|
|
919
870
|
if (aliasNoEndPRes) return aliasNoEndPRes;
|
|
920
871
|
}
|
|
@@ -923,8 +874,8 @@ var inputToItem = /* @__PURE__ */ __name((input) => {
|
|
|
923
874
|
if (!input2 || !standard || typeof input2 !== "string" || typeof standard !== "string") {
|
|
924
875
|
return false;
|
|
925
876
|
}
|
|
926
|
-
const normalizedInput =
|
|
927
|
-
const normalizedStandard =
|
|
877
|
+
const normalizedInput = normalizeName(input2);
|
|
878
|
+
const normalizedStandard = normalizeName(standard);
|
|
928
879
|
if (!normalizedInput || !normalizedStandard) return false;
|
|
929
880
|
const normalizedStandardNoSet = normalizedStandard.replace(/一套/g, "");
|
|
930
881
|
const normalizedStandardNoSetSimplifiedPrime = normalizedStandardNoSet.replace(/prime/g, "p");
|
|
@@ -952,14 +903,14 @@ var inputToItem = /* @__PURE__ */ __name((input) => {
|
|
|
952
903
|
/ Prime/g,
|
|
953
904
|
"p"
|
|
954
905
|
);
|
|
955
|
-
const normalizedInput =
|
|
956
|
-
const normalizedStandard =
|
|
906
|
+
const normalizedInput = normalizeName(input2);
|
|
907
|
+
const normalizedStandard = normalizeName(standard);
|
|
957
908
|
if (!normalizedInput || !normalizedStandard) return false;
|
|
958
|
-
const normalizedStandardNoSet =
|
|
959
|
-
const normalizedStandardSimplifiedPrime =
|
|
909
|
+
const normalizedStandardNoSet = normalizeName(standardNoSet);
|
|
910
|
+
const normalizedStandardSimplifiedPrime = normalizeName(
|
|
960
911
|
standardSimplifiedPrime
|
|
961
912
|
);
|
|
962
|
-
const normalizedStandardNoBlueprint =
|
|
913
|
+
const normalizedStandardNoBlueprint = normalizeName(
|
|
963
914
|
standardNoBlueprintSimplifiedPrime
|
|
964
915
|
);
|
|
965
916
|
return normalizedInput === normalizedStandard || normalizedInput === normalizedStandardNoSet || normalizedInput === normalizedStandardSimplifiedPrime || normalizedInput === normalizedStandardNoBlueprint;
|
|
@@ -969,30 +920,74 @@ var inputToItem = /* @__PURE__ */ __name((input) => {
|
|
|
969
920
|
) ?? globalItemList.find(
|
|
970
921
|
(item) => compareENOrderName(input, item.i18n["en"].name)
|
|
971
922
|
);
|
|
972
|
-
}, "
|
|
923
|
+
}, "stringToWFMItem");
|
|
924
|
+
var removeNameSuffix = /* @__PURE__ */ __name((input) => {
|
|
925
|
+
let hasBPSuffix = false;
|
|
926
|
+
if (input.endsWith(bpSuffix)) {
|
|
927
|
+
input = input.replace(new RegExp(`${bpSuffix}$`), "");
|
|
928
|
+
hasBPSuffix = true;
|
|
929
|
+
}
|
|
930
|
+
if (input.endsWith(setSuffix)) {
|
|
931
|
+
input = input.replace(new RegExp(`${setSuffix}$`), "");
|
|
932
|
+
}
|
|
933
|
+
if (input.endsWith(bpSuffix)) {
|
|
934
|
+
input = input.replace(new RegExp(`${bpSuffix}$`), "");
|
|
935
|
+
hasBPSuffix = true;
|
|
936
|
+
}
|
|
937
|
+
const suffix = warframePartSuffix.find((value) => input.endsWith(value)) ?? weaponPartSuffix.find((value) => input.endsWith(value)) ?? (input.endsWith("头") ? "头部神经光元" : void 0) ?? (hasBPSuffix ? bpSuffix : void 0) ?? "";
|
|
938
|
+
if (suffix) {
|
|
939
|
+
input = input.endsWith("头") ? input.replace(/头$/, "") : input;
|
|
940
|
+
const pure = input.replace(new RegExp(`${suffix}$`), "");
|
|
941
|
+
return {
|
|
942
|
+
pure,
|
|
943
|
+
suffix
|
|
944
|
+
};
|
|
945
|
+
} else {
|
|
946
|
+
return {
|
|
947
|
+
pure: input,
|
|
948
|
+
suffix
|
|
949
|
+
};
|
|
950
|
+
}
|
|
951
|
+
}, "removeNameSuffix");
|
|
952
|
+
var shortHandProcess = /* @__PURE__ */ __name((input) => {
|
|
953
|
+
const { pure: inputNoSuffix, suffix } = removeNameSuffix(input);
|
|
954
|
+
if (inputNoSuffix === input) {
|
|
955
|
+
const fixSet = input + setSuffix;
|
|
956
|
+
const fixSetRes = globalItemNameToSlugDict[fixSet];
|
|
957
|
+
if (fixSetRes) return globalItemDict[fixSetRes];
|
|
958
|
+
const fixPrime = input.endsWith(primeSuffix) ? input : input.endsWith("p") ? input.slice(0, input.length - 1) + primeSuffix : input + primeSuffix;
|
|
959
|
+
const fixPrimeRes = globalItemNameToSlugDict[fixPrime];
|
|
960
|
+
if (fixPrimeRes) return globalItemDict[fixPrimeRes];
|
|
961
|
+
const fixPrimeSet = fixPrime + setSuffix;
|
|
962
|
+
const fixPrimeSetRes = globalItemNameToSlugDict[fixPrimeSet];
|
|
963
|
+
if (fixPrimeSetRes) return globalItemDict[fixPrimeSetRes];
|
|
964
|
+
const fixBP = input + bpSuffix;
|
|
965
|
+
const fixBPRes = globalItemNameToSlugDict[fixBP];
|
|
966
|
+
if (fixBPRes) return globalItemDict[fixBPRes];
|
|
967
|
+
const fixPrimeBP = fixPrime + bpSuffix;
|
|
968
|
+
const fixPrimeBPRes = globalItemNameToSlugDict[fixPrimeBP];
|
|
969
|
+
if (fixPrimeBPRes) return globalItemDict[fixPrimeBPRes];
|
|
970
|
+
} else {
|
|
971
|
+
const fixBP = inputNoSuffix + suffix + bpSuffix;
|
|
972
|
+
const fixBPRes = globalItemNameToSlugDict[fixBP];
|
|
973
|
+
if (fixBPRes) return globalItemDict[fixBPRes];
|
|
974
|
+
const fixPrime = inputNoSuffix.endsWith(primeSuffix) ? inputNoSuffix : inputNoSuffix.endsWith("p") ? inputNoSuffix.slice(0, inputNoSuffix.length - 1) + primeSuffix : inputNoSuffix + primeSuffix;
|
|
975
|
+
const fixPrimeRes = globalItemNameToSlugDict[fixPrime + suffix];
|
|
976
|
+
if (fixPrimeRes) return globalItemDict[fixPrimeRes];
|
|
977
|
+
const fixPrimeBP = fixPrime + suffix + bpSuffix;
|
|
978
|
+
const fixPrimeBPRes = globalItemNameToSlugDict[fixPrimeBP];
|
|
979
|
+
if (fixPrimeBPRes) return globalItemDict[fixPrimeBPRes];
|
|
980
|
+
}
|
|
981
|
+
}, "shortHandProcess");
|
|
973
982
|
var compareRivenItemName = /* @__PURE__ */ __name((input, standard) => {
|
|
974
983
|
if (!input || !standard || typeof input !== "string" || typeof standard !== "string") {
|
|
975
984
|
return false;
|
|
976
985
|
}
|
|
977
|
-
const normalizedInput =
|
|
978
|
-
const normalizedStandard =
|
|
986
|
+
const normalizedInput = normalizeName(input);
|
|
987
|
+
const normalizedStandard = normalizeName(standard);
|
|
979
988
|
if (!normalizedInput || !normalizedStandard) return false;
|
|
980
989
|
return normalizedInput === normalizedStandard;
|
|
981
990
|
}, "compareRivenItemName");
|
|
982
|
-
var normalizeOrderName = /* @__PURE__ */ __name((str) => {
|
|
983
|
-
const normalize = /* @__PURE__ */ __name((str2) => {
|
|
984
|
-
return fullWidthToHalfWidth(str2).toLowerCase().replace(/[·'\-+()【】\[\]{},。!?;:_]/g, "").replace(/\s+/g, "");
|
|
985
|
-
}, "normalize");
|
|
986
|
-
return normalize(str);
|
|
987
|
-
}, "normalizeOrderName");
|
|
988
|
-
var updateDucatnator = /* @__PURE__ */ __name(async () => {
|
|
989
|
-
const data = await getWFMDucatnator();
|
|
990
|
-
if (!data || !data.payload) {
|
|
991
|
-
return void 0;
|
|
992
|
-
}
|
|
993
|
-
return listToDict(data.payload.previous_hour, (d) => [d.item]);
|
|
994
|
-
}, "updateDucatnator");
|
|
995
|
-
var globalDucatnatorIDDict = createAsyncCache(updateDucatnator, 36e5);
|
|
996
991
|
|
|
997
992
|
// src/services/wf-service.ts
|
|
998
993
|
var import_warframe_public_export_plus3 = require("warframe-public-export-plus");
|
|
@@ -45715,7 +45710,7 @@ var CircuitTable = /* @__PURE__ */ __name((incarnons, warframes) => {
|
|
|
45715
45710
|
)
|
|
45716
45711
|
] });
|
|
45717
45712
|
}, "CircuitTable");
|
|
45718
|
-
var FissureTable = /* @__PURE__ */ __name((
|
|
45713
|
+
var FissureTable = /* @__PURE__ */ __name((fissures, type) => {
|
|
45719
45714
|
const titles = {
|
|
45720
45715
|
fissure: "虚空裂缝",
|
|
45721
45716
|
"sp-fissure": "虚空裂缝 (钢铁之路)",
|
|
@@ -45731,7 +45726,7 @@ var FissureTable = /* @__PURE__ */ __name((fissures2, type) => {
|
|
|
45731
45726
|
];
|
|
45732
45727
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { style: "display:flex;flex-direction:column;align-items:center;", children: [
|
|
45733
45728
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h1", { style: "font-size: 50px;", children: titles[type] }),
|
|
45734
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { style: "font-size: 30px;margin-top:30px;", children:
|
|
45729
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { style: "font-size: 30px;margin-top:30px;", children: fissures.filter((f) => f.expiry - Date.now() > 0).map((f) => {
|
|
45735
45730
|
let timeLeft = f.expiry - Date.now();
|
|
45736
45731
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("li", { style: "margin-top: 10px;", children: [
|
|
45737
45732
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: `color:${colors[f.tierNum - 1]};`, children: `${f.tier}(T${f.tierNum})` }),
|
|
@@ -45888,7 +45883,7 @@ var RelicComponent = /* @__PURE__ */ __name((relic) => {
|
|
|
45888
45883
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
45889
45884
|
color: #000000;
|
|
45890
45885
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
45891
|
-
max-width:
|
|
45886
|
+
max-width: 500px;
|
|
45892
45887
|
min-width: 320px;`,
|
|
45893
45888
|
children: [
|
|
45894
45889
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
@@ -46011,44 +46006,95 @@ var arbitrationSchedule = arbys_default.split("\n").map((line) => line.split(","
|
|
|
46011
46006
|
node: arr[1]
|
|
46012
46007
|
};
|
|
46013
46008
|
});
|
|
46014
|
-
var
|
|
46015
|
-
|
|
46016
|
-
|
|
46017
|
-
|
|
46018
|
-
|
|
46019
|
-
|
|
46009
|
+
var globalWorldState = createAsyncCache(async () => {
|
|
46010
|
+
const worldState = await getWorldState();
|
|
46011
|
+
const fissures = [];
|
|
46012
|
+
const rjFissures = [];
|
|
46013
|
+
const spFissures = [];
|
|
46014
|
+
for (const fissure of worldState.fissures) {
|
|
46015
|
+
const nodeKey = await getSolNodeKey(fissure.nodeKey);
|
|
46016
|
+
const obj = {
|
|
46017
|
+
category: fissure.isStorm ? "rj-fissures" : fissure.isHard ? "sp-fissures" : "fissures",
|
|
46018
|
+
hard: fissure.isHard,
|
|
46019
|
+
activation: fissure.activation.getTime(),
|
|
46020
|
+
expiry: fissure.expiry.getTime(),
|
|
46021
|
+
node: regionToShort(import_warframe_public_export_plus3.ExportRegions[nodeKey], import_warframe_public_export_plus3.dict_zh),
|
|
46022
|
+
tier: import_warframe_public_export_plus3.dict_zh[fissureTierName[fissure.tierNum]],
|
|
46023
|
+
tierNum: fissureTierNumToNumber(fissure.tierNum)
|
|
46024
|
+
};
|
|
46025
|
+
if (fissure.isStorm) {
|
|
46026
|
+
rjFissures.push(obj);
|
|
46027
|
+
} else if (fissure.isHard) {
|
|
46028
|
+
spFissures.push(obj);
|
|
46029
|
+
} else {
|
|
46030
|
+
fissures.push(obj);
|
|
46031
|
+
}
|
|
46032
|
+
}
|
|
46033
|
+
fissures.sort((a, b) => a.tierNum - b.tierNum);
|
|
46034
|
+
spFissures.sort((a, b) => a.tierNum - b.tierNum);
|
|
46035
|
+
rjFissures.sort((a, b) => a.tierNum - b.tierNum);
|
|
46036
|
+
return { raw: worldState, fissures, spFissures, rjFissures };
|
|
46037
|
+
}, 12e4);
|
|
46038
|
+
var loadRelics = /* @__PURE__ */ __name(() => {
|
|
46039
|
+
const result = {};
|
|
46040
|
+
for (const key in import_warframe_public_export_plus3.ExportRelics) {
|
|
46041
|
+
const exportRelic = import_warframe_public_export_plus3.ExportRelics[key];
|
|
46042
|
+
const exportRewards = import_warframe_public_export_plus3.ExportRewards[exportRelic.rewardManifest];
|
|
46043
|
+
const era = "/Lotus/Language/Relics/Era_" + exportRelic.era.toUpperCase();
|
|
46044
|
+
const relicKey = normalizeName(exportRelic.era + exportRelic.category);
|
|
46045
|
+
const rewards = (exportRewards[0] ?? []).map((r) => {
|
|
46046
|
+
const item = fixRelicRewardKey(r.type);
|
|
46047
|
+
return {
|
|
46048
|
+
name: item,
|
|
46049
|
+
rarity: r.rarity,
|
|
46050
|
+
quantity: r.itemCount
|
|
46051
|
+
};
|
|
46052
|
+
});
|
|
46053
|
+
const relic = {
|
|
46054
|
+
tier: exportRelic.era,
|
|
46055
|
+
tierKey: era,
|
|
46056
|
+
num: exportRelic.category,
|
|
46057
|
+
items: rewards
|
|
46058
|
+
};
|
|
46059
|
+
result[relicKey] = relic;
|
|
46060
|
+
}
|
|
46061
|
+
relics = result;
|
|
46062
|
+
}, "loadRelics");
|
|
46020
46063
|
var relics = null;
|
|
46064
|
+
var tierListForMatch = [
|
|
46065
|
+
"古纪",
|
|
46066
|
+
"前纪",
|
|
46067
|
+
"中纪",
|
|
46068
|
+
"后纪",
|
|
46069
|
+
"安魂",
|
|
46070
|
+
"先锋",
|
|
46071
|
+
"Lith",
|
|
46072
|
+
"Meso",
|
|
46073
|
+
"Neo",
|
|
46074
|
+
"Axi",
|
|
46075
|
+
"Requiem",
|
|
46076
|
+
"Vanguard"
|
|
46077
|
+
].map((t) => normalizeName(t));
|
|
46021
46078
|
var wfOnReady = /* @__PURE__ */ __name(async () => {
|
|
46022
46079
|
loadRelics();
|
|
46023
46080
|
}, "wfOnReady");
|
|
46024
46081
|
var getRelic = /* @__PURE__ */ __name(async (input) => {
|
|
46082
|
+
if (!input) {
|
|
46083
|
+
return "请提供正确的遗物名称";
|
|
46084
|
+
}
|
|
46085
|
+
input = normalizeName(input);
|
|
46086
|
+
if (!input) {
|
|
46087
|
+
return "请提供正确的遗物名称";
|
|
46088
|
+
}
|
|
46025
46089
|
if (!relics) {
|
|
46026
46090
|
return "遗物数据未加载完成,请稍后再试";
|
|
46027
46091
|
}
|
|
46028
|
-
|
|
46029
|
-
const tierList = [
|
|
46030
|
-
"古纪",
|
|
46031
|
-
"前纪",
|
|
46032
|
-
"中纪",
|
|
46033
|
-
"后纪",
|
|
46034
|
-
"安魂",
|
|
46035
|
-
"先锋",
|
|
46036
|
-
"Lith",
|
|
46037
|
-
"Meso",
|
|
46038
|
-
"Neo",
|
|
46039
|
-
"Axi",
|
|
46040
|
-
"Requiem",
|
|
46041
|
-
"Vanguard"
|
|
46042
|
-
];
|
|
46043
|
-
const tier = tierList.find((t) => input.startsWith(t));
|
|
46092
|
+
const tier = tierListForMatch.find((t) => input.startsWith(t));
|
|
46044
46093
|
if (!tier) {
|
|
46045
46094
|
return "请提供正确的遗物名称";
|
|
46046
46095
|
}
|
|
46047
|
-
let category = input.replace(new RegExp(`^${tier}`), "");
|
|
46048
|
-
|
|
46049
|
-
category = category.replace(/遗物$|Relic$/, "");
|
|
46050
|
-
}
|
|
46051
|
-
const tierMap = {
|
|
46096
|
+
let category = input.replace(new RegExp(`^${tier}`), "").replace(/遗物$|relic$/, "");
|
|
46097
|
+
const zhTierMap = {
|
|
46052
46098
|
古纪: "Lith",
|
|
46053
46099
|
前纪: "Meso",
|
|
46054
46100
|
中纪: "Neo",
|
|
@@ -46056,8 +46102,8 @@ var getRelic = /* @__PURE__ */ __name(async (input) => {
|
|
|
46056
46102
|
安魂: "Requiem",
|
|
46057
46103
|
先锋: "Vanguard"
|
|
46058
46104
|
};
|
|
46059
|
-
const
|
|
46060
|
-
const key =
|
|
46105
|
+
const enTier = zhTierMap[tier] ?? tier;
|
|
46106
|
+
const key = normalizeName(enTier + category);
|
|
46061
46107
|
return relics[key] ?? "未找到对应遗物信息";
|
|
46062
46108
|
}, "getRelic");
|
|
46063
46109
|
var generateRelicOutput = /* @__PURE__ */ __name(async (puppe, relic) => {
|
|
@@ -46105,7 +46151,8 @@ var generateArbitrationsOutput = /* @__PURE__ */ __name(async (puppe, arby) => {
|
|
|
46105
46151
|
return OutputImage(imgBase64);
|
|
46106
46152
|
}, "generateArbitrationsOutput");
|
|
46107
46153
|
var getWeekly = /* @__PURE__ */ __name(async () => {
|
|
46108
|
-
|
|
46154
|
+
const { raw: worldState } = await globalWorldState.get();
|
|
46155
|
+
if (!worldState) {
|
|
46109
46156
|
return "内部错误,获取最新信息失败";
|
|
46110
46157
|
}
|
|
46111
46158
|
const archon = import_warframe_public_export_plus3.dict_zh["/Lotus/Language/Narmer/" + removeSpace(worldState.archonHunt.boss)];
|
|
@@ -46194,7 +46241,8 @@ var generateWeeklyOutput = /* @__PURE__ */ __name(async (puppe, archon, deepArch
|
|
|
46194
46241
|
return element;
|
|
46195
46242
|
}, "generateWeeklyOutput");
|
|
46196
46243
|
var getRegionTime = /* @__PURE__ */ __name(async () => {
|
|
46197
|
-
|
|
46244
|
+
const { raw: worldState } = await globalWorldState.get();
|
|
46245
|
+
if (!worldState) {
|
|
46198
46246
|
return "内部错误,获取最新信息失败";
|
|
46199
46247
|
}
|
|
46200
46248
|
const cetusDay = worldState.cetusCycle.isDay ? "白天" : "黑夜";
|
|
@@ -46241,92 +46289,22 @@ var generateCircuitWeekOutput = /* @__PURE__ */ __name(async (puppe, data) => {
|
|
|
46241
46289
|
return OutputImage(imgBase64);
|
|
46242
46290
|
}, "generateCircuitWeekOutput");
|
|
46243
46291
|
var getFissures = /* @__PURE__ */ __name(async () => {
|
|
46244
|
-
|
|
46245
|
-
|
|
46246
|
-
}
|
|
46247
|
-
return fissures;
|
|
46292
|
+
const { fissures } = await globalWorldState.get();
|
|
46293
|
+
return fissures ?? "内部错误,获取最新信息失败";
|
|
46248
46294
|
}, "getFissures");
|
|
46249
46295
|
var getSteelPathFissures = /* @__PURE__ */ __name(async () => {
|
|
46250
|
-
|
|
46251
|
-
|
|
46252
|
-
}
|
|
46253
|
-
return spFissures;
|
|
46296
|
+
const { spFissures } = await globalWorldState.get();
|
|
46297
|
+
return spFissures ?? "内部错误,获取最新信息失败";
|
|
46254
46298
|
}, "getSteelPathFissures");
|
|
46255
46299
|
var getRailjackFissures = /* @__PURE__ */ __name(async () => {
|
|
46256
|
-
|
|
46257
|
-
|
|
46258
|
-
}
|
|
46259
|
-
return rjFissures;
|
|
46300
|
+
const { rjFissures } = await globalWorldState.get();
|
|
46301
|
+
return rjFissures ?? "内部错误,获取最新信息失败";
|
|
46260
46302
|
}, "getRailjackFissures");
|
|
46261
|
-
var generateFissureOutput = /* @__PURE__ */ __name(async (puppe,
|
|
46262
|
-
const element = FissureTable(
|
|
46303
|
+
var generateFissureOutput = /* @__PURE__ */ __name(async (puppe, fissures, type) => {
|
|
46304
|
+
const element = FissureTable(fissures, type);
|
|
46263
46305
|
const imgBase64 = await getHtmlImageBase64(puppe, element.toString());
|
|
46264
46306
|
return OutputImage(imgBase64);
|
|
46265
46307
|
}, "generateFissureOutput");
|
|
46266
|
-
var updateWorldState = /* @__PURE__ */ __name(async () => {
|
|
46267
|
-
if (worldstateUpdating) return true;
|
|
46268
|
-
if (worldState && worldStateLastUpdatedAt && Date.now() - worldStateLastUpdatedAt.getTime() < 12e4)
|
|
46269
|
-
return true;
|
|
46270
|
-
try {
|
|
46271
|
-
worldState = await getWorldState();
|
|
46272
|
-
worldStateLastUpdatedAt = /* @__PURE__ */ new Date();
|
|
46273
|
-
worldstateUpdating = true;
|
|
46274
|
-
fissures = [];
|
|
46275
|
-
rjFissures = [];
|
|
46276
|
-
spFissures = [];
|
|
46277
|
-
for (const fissure of worldState.fissures) {
|
|
46278
|
-
const nodeKey = await getSolNodeKey(fissure.nodeKey);
|
|
46279
|
-
const obj = {
|
|
46280
|
-
category: fissure.isStorm ? "rj-fissures" : fissure.isHard ? "sp-fissures" : "fissures",
|
|
46281
|
-
hard: fissure.isHard,
|
|
46282
|
-
activation: fissure.activation.getTime(),
|
|
46283
|
-
expiry: fissure.expiry.getTime(),
|
|
46284
|
-
node: regionToShort(import_warframe_public_export_plus3.ExportRegions[nodeKey], import_warframe_public_export_plus3.dict_zh),
|
|
46285
|
-
tier: import_warframe_public_export_plus3.dict_zh[fissureTierName[fissure.tierNum]],
|
|
46286
|
-
tierNum: fissureTierNumToNumber(fissure.tierNum)
|
|
46287
|
-
};
|
|
46288
|
-
if (fissure.isStorm) {
|
|
46289
|
-
rjFissures.push(obj);
|
|
46290
|
-
} else if (fissure.isHard) {
|
|
46291
|
-
spFissures.push(obj);
|
|
46292
|
-
} else {
|
|
46293
|
-
fissures.push(obj);
|
|
46294
|
-
}
|
|
46295
|
-
}
|
|
46296
|
-
fissures.sort((a, b) => a.tierNum - b.tierNum);
|
|
46297
|
-
spFissures.sort((a, b) => a.tierNum - b.tierNum);
|
|
46298
|
-
rjFissures.sort((a, b) => a.tierNum - b.tierNum);
|
|
46299
|
-
} catch {
|
|
46300
|
-
} finally {
|
|
46301
|
-
worldstateUpdating = false;
|
|
46302
|
-
return worldState && worldStateLastUpdatedAt && Date.now() - worldStateLastUpdatedAt.getTime() < 12e4;
|
|
46303
|
-
}
|
|
46304
|
-
}, "updateWorldState");
|
|
46305
|
-
var loadRelics = /* @__PURE__ */ __name(() => {
|
|
46306
|
-
const result = {};
|
|
46307
|
-
for (const key in import_warframe_public_export_plus3.ExportRelics) {
|
|
46308
|
-
const exportRelic = import_warframe_public_export_plus3.ExportRelics[key];
|
|
46309
|
-
const exportRewards = import_warframe_public_export_plus3.ExportRewards[exportRelic.rewardManifest];
|
|
46310
|
-
const era = "/Lotus/Language/Relics/Era_" + exportRelic.era.toUpperCase();
|
|
46311
|
-
const relicKey = exportRelic.era + exportRelic.category;
|
|
46312
|
-
const rewards = (exportRewards[0] ?? []).map((r) => {
|
|
46313
|
-
const item = fixRelicRewardKey(r.type);
|
|
46314
|
-
return {
|
|
46315
|
-
name: item,
|
|
46316
|
-
rarity: r.rarity,
|
|
46317
|
-
quantity: r.itemCount
|
|
46318
|
-
};
|
|
46319
|
-
});
|
|
46320
|
-
const relic = {
|
|
46321
|
-
tier: exportRelic.era,
|
|
46322
|
-
tierKey: era,
|
|
46323
|
-
num: exportRelic.category,
|
|
46324
|
-
items: rewards
|
|
46325
|
-
};
|
|
46326
|
-
result[relicKey] = relic;
|
|
46327
|
-
}
|
|
46328
|
-
relics = result;
|
|
46329
|
-
}, "loadRelics");
|
|
46330
46308
|
|
|
46331
46309
|
// src/commands/wfm/wm.ts
|
|
46332
46310
|
var wmCommand = /* @__PURE__ */ __name(async (action, input) => {
|
|
@@ -46354,16 +46332,11 @@ var wmrCommand = /* @__PURE__ */ __name(async (action, input) => {
|
|
|
46354
46332
|
);
|
|
46355
46333
|
}, "wmrCommand");
|
|
46356
46334
|
|
|
46357
|
-
// src/commands/about.ts
|
|
46358
|
-
var aboutCommand = /* @__PURE__ */ __name(async (action) => {
|
|
46359
|
-
return "Authored by CloudeaSoft.";
|
|
46360
|
-
}, "aboutCommand");
|
|
46361
|
-
|
|
46362
46335
|
// src/commands/wf/arbitration.ts
|
|
46363
46336
|
var arbitrationCommand = /* @__PURE__ */ __name((action, input) => {
|
|
46364
46337
|
const result = getArbitrations(input);
|
|
46365
46338
|
if (!result) {
|
|
46366
|
-
return "
|
|
46339
|
+
return "获取失败, 请稍后再试";
|
|
46367
46340
|
}
|
|
46368
46341
|
if (typeof result === "string") {
|
|
46369
46342
|
return result;
|
|
@@ -46446,7 +46419,7 @@ var relicCommand = /* @__PURE__ */ __name(async (action, input) => {
|
|
|
46446
46419
|
if (typeof result === "string") {
|
|
46447
46420
|
return result;
|
|
46448
46421
|
}
|
|
46449
|
-
const relic = await
|
|
46422
|
+
const relic = await applyRelicData(result);
|
|
46450
46423
|
return await generateRelicOutput(action.session.app.puppeteer, relic);
|
|
46451
46424
|
}, "relicCommand");
|
|
46452
46425
|
|
|
@@ -46506,10 +46479,9 @@ var setupCommands = /* @__PURE__ */ __name((ctx) => {
|
|
|
46506
46479
|
ctx.command("circuit", "本周回廊战甲及灵化之源").alias("灵化之源").alias("灵化").action(circuitCommand);
|
|
46507
46480
|
ctx.command("lichc", "c系玄骸武器", { hidden: true }).action(inDevelopment);
|
|
46508
46481
|
ctx.command("lichi", "i系玄骸武器", { hidden: true }).action(inDevelopment);
|
|
46509
|
-
ctx.command("about", "关于").action(aboutCommand);
|
|
46510
46482
|
}, "setupCommands");
|
|
46511
46483
|
var inDevelopment = /* @__PURE__ */ __name(() => {
|
|
46512
|
-
return "
|
|
46484
|
+
return "功能暂未开放";
|
|
46513
46485
|
}, "inDevelopment");
|
|
46514
46486
|
// Annotate the CommonJS export names for ESM import in node:
|
|
46515
46487
|
0 && (module.exports = {
|