koishi-plugin-warframe 1.1.2 → 1.2.1

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.
Files changed (3) hide show
  1. package/lib/index.d.ts +49 -15
  2. package/lib/index.js +1055 -64
  3. package/package.json +9 -2
package/lib/index.d.ts CHANGED
@@ -2,9 +2,11 @@ import { IRegion } from 'warframe-public-export-plus';
2
2
  import Puppeteer from 'koishi-plugin-puppeteer';
3
3
  import Element from '@satorijs/element';
4
4
  import { Element, Argv, Context, Schema } from 'koishi';
5
+ import WorldState from 'warframe-worldstate-parser';
5
6
  export const fetchAsyncText: (url: string, method?: string) => Promise<string | null>;
6
7
  export const fetchAsyncData: <T>(url: string, method?: string) => Promise<T | null>;
7
8
  export const fullWidthToHalfWidth: (str: string) => string;
9
+ export const removeSpace: (text: string) => string;
8
10
  export const listToDict: <T>(dict: T[], predict: (obj: T) => string[]) => {
9
11
  [key: string]: T;
10
12
  };
@@ -16,6 +18,8 @@ export const dictToKeyDict: <T>(dict: {
16
18
  }, predict: (obj: T) => string[]) => {
17
19
  [key: string]: string;
18
20
  };
21
+ export const pascalToSpaced: (str: string) => string;
22
+ export const toPascalCase: (str: string) => string;
19
23
  export const toTimeStamp: (timeStr: string) => number;
20
24
  /**
21
25
  * 毫秒转「X小时X分钟X秒」格式(0单位不显示)
@@ -24,6 +28,7 @@ export const toTimeStamp: (timeStr: string) => number;
24
28
  */
25
29
  export const msToHumanReadable: (ms: number) => string;
26
30
  export const getSolNodeKey: (name: string) => Promise<string>;
31
+ export const getMissionTypeKey: (name: string) => Promise<string>;
27
32
  export const fissureTierName: {
28
33
  1: string;
29
34
  2: string;
@@ -42,18 +47,42 @@ export const regionToShort: (region: IRegion, dict: any) => {
42
47
  maxLevel: number;
43
48
  minLevel: number;
44
49
  };
50
+ export const relicQualityToName: (quality: string) => RelicQuality;
51
+ /** transform relic quality to translation key, return original if not matched.
52
+ *
53
+ * eg. "VPQ_BRONZE" => "/Lotus/Language/Relics/VoidProjectionQuality_Bronze".
54
+ * @param quality directly provided from `IRelic.quality` expected to start with "VPQ_".
55
+ */
56
+ export const relicQualityToTransKey: (quality: string) => string;
57
+ /** transform relic era to translation key.
58
+ *
59
+ * eg. "Lith" => "/Lotus/Language/Relics/Era_LITH".
60
+ * @param era directly provided from `IRelic.era`.
61
+ */
62
+ export const relicEraToTransKey: (era: string) => string;
63
+ export const fixRelicRewardKey: (item: string) => string;
45
64
  export const getWFMItemList: () => Promise<WFMResponse<ItemShort[] | null>>;
46
65
  export const getWFMOrderList: (itemId: string) => Promise<WFMResponse<OrderWithUser[] | null>>;
47
66
  export const getWFMRivenItemList: () => Promise<WFMResponse<RivenItem[] | null>>;
48
- export const getWFMRivenOrderList: (itemId: string) => Promise<WFMResponseV1<RivenOrder> | null>;
67
+ export const getWFMRivenOrderList: (itemId: string) => Promise<WFMResponseV1<Auction<RivenOrder>> | null>;
49
68
  export const getWFMRivenAttributeList: () => Promise<WFMResponse<RivenAttribute[]> | null>;
69
+ export const getWFMDucatnator: () => Promise<WFMResponseV1<{
70
+ previous_day: Ducatnator[];
71
+ previous_hour: Ducatnator[];
72
+ }>>;
50
73
  export const getHtmlString: (body: string, title?: string) => string;
51
74
  export const getHtmlImageBase64: (puppe: Puppeteer, html: string, type?: "png" | "jpeg" | "webp") => Promise<string>;
52
75
  export const OutputImage: (imgBase64: string) => Element;
53
76
  export const ItemOrderOutput: (item: ItemShort, orders: OrderWithUser[]) => Element;
54
77
  export const RivenOrderOutput: (item: RivenItem, orders: RivenOrder[]) => Element;
78
+ export function createAsyncCache<T>(fetchFn: () => Promise<T>, ttlMs: number): {
79
+ get: () => Promise<T>;
80
+ };
55
81
  export let globalRivenAttributeDict: Record<string, RivenAttribute>;
56
82
  export const wmOnReady: () => Promise<void>;
83
+ export const setGlobalItem: (data: ItemShort[]) => void;
84
+ export const setGlobalRivenItem: (data: RivenItem[]) => void;
85
+ export const setGlobalRivenAttribute: (data: RivenAttribute[]) => void;
57
86
  export const getItemOrders: (input: string) => Promise<{
58
87
  item: ItemShort;
59
88
  orders: OrderWithUser[];
@@ -64,6 +93,7 @@ export const getRivenOrders: (input: string) => Promise<{
64
93
  orders: RivenOrder[];
65
94
  }>;
66
95
  export const generateRivenOrderOutput: (puppe: Puppeteer, item: RivenItem, orders: RivenOrder[]) => Promise<import("koishi").Element>;
96
+ export const loadRelicData: (relic: Relic) => Promise<OutputRelic>;
67
97
  export const inputToItem: (input: string) => ItemShort | undefined;
68
98
  declare const _default: {
69
99
  SolNode147: number;
@@ -81,9 +111,21 @@ export const warframeRewards: string[][];
81
111
  export const ArbitrationTable: (arbi: Arbitration[]) => Element;
82
112
  export const CircuitTable: (incarnons: string[], warframes: string[]) => Element;
83
113
  export const FissureTable: (fissures: Fissure[], type: "fissure" | "sp-fissure" | "rj-fissure") => Element;
84
- export const getWorldState: () => Promise<any>;
114
+ export const WeeklyTable: (archon: string, deepArchimedea: ArchiMedea, temporalArchimedea: ArchiMedea) => Promise<string>;
115
+ export const RelicComponent: (relic: OutputRelic) => Element;
116
+ export const getWorldState: () => Promise<WorldState>;
117
+ export const wfOnReady: () => Promise<void>;
118
+ export const getRelic: (input: string) => Promise<Relic | string>;
119
+ export const generateRelicOutput: (puppe: Puppeteer, relic: OutputRelic) => Promise<import("koishi").Element>;
85
120
  export const getArbitrations: (day?: number) => Arbitration[] | string;
86
121
  export const generateArbitrationsOutput: (puppe: Puppeteer, arby: Arbitration[]) => Promise<import("koishi").Element>;
122
+ export const getWeekly: () => Promise<"内部错误,获取最新信息失败" | {
123
+ archonHunt: string;
124
+ deepArchimedea: ArchiMedea;
125
+ temporalArchimedea: ArchiMedea;
126
+ }>;
127
+ export const generateWeeklyOutput: (puppe: Puppeteer, archon: string, deepArchimedea: ArchiMedea, temporalArchimedea: ArchiMedea) => Promise<string>;
128
+ export const getRegionTime: () => Promise<string>;
87
129
  export const getCircuitWeek: () => {
88
130
  incarnons: string[];
89
131
  warframes: string[];
@@ -98,24 +140,16 @@ export const getRailjackFissures: () => Promise<Fissure[] | "内部错误,获
98
140
  export const generateFissureOutput: (puppe: Puppeteer, fissures: Fissure[], type: "fissure" | "sp-fissure" | "rj-fissure") => Promise<import("koishi").Element>;
99
141
  export const wmCommand: (action: Argv, input: string) => Promise<string | import("koishi").Element>;
100
142
  export const wmrCommand: (action: Argv, input: string) => Promise<string | import("koishi").Element>;
101
- export const inputToItemTestCases: {
102
- a: string;
103
- b: string;
104
- }[];
105
- export const inputToItemTest: (input: string, predict: string | undefined) => {
106
- status: boolean;
107
- msg?: undefined;
108
- } | {
109
- status: boolean;
110
- msg: string;
111
- };
112
- export const aboutCommand: () => string;
143
+ export const aboutCommand: (action: Argv) => Promise<string>;
113
144
  export const arbitrationCommand: (action: Argv, input?: number) => string | Promise<import("koishi").Element>;
114
145
  export const fissureCommand: (action: Argv) => Promise<import("koishi").Element | "内部错误,获取最新信息失败" | "内部错误">;
115
146
  export const steelPathFissureCommand: (action: Argv) => Promise<import("koishi").Element | "内部错误,获取最新信息失败" | "内部错误">;
116
147
  export const railjackFissureCommand: (action: Argv) => Promise<import("koishi").Element | "内部错误,获取最新信息失败" | "内部错误">;
117
148
  export const circuitCommand: (action: Argv) => Promise<import("koishi").Element>;
118
- export const onReadyHandler: () => void;
149
+ export const environmentCommand: () => Promise<string>;
150
+ export const weeklyCommand: (action: Argv) => Promise<string>;
151
+ export const relicCommand: (action: Argv, input: string) => Promise<string | import("koishi").Element>;
152
+ export const onReadyHandler: () => Promise<void>;
119
153
  export const name = "warframe";
120
154
  export interface Config {
121
155
  developerMode: boolean;