@wfcd/relics 2.0.28 → 2.0.29

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.
@@ -0,0 +1,249 @@
1
+ import { t as __name } from "./chunk-Dco9itRc.mjs";
2
+
3
+ //#region src/Types.d.ts
4
+ interface WarframeMarketRoot {
5
+ data: Array<WarframeMarketItem>;
6
+ }
7
+ interface WarframeMarketItem {
8
+ /**
9
+ * WFM Item ID
10
+ */
11
+ id: string;
12
+ /**
13
+ * Url name for querying WFM
14
+ */
15
+ slug: string;
16
+ /**
17
+ * WFM language object
18
+ */
19
+ i18n: {
20
+ /**
21
+ * English language object
22
+ */
23
+ en: {
24
+ /**
25
+ * Item Name
26
+ */
27
+ name: string;
28
+ /**
29
+ * Thumbnail URL relative to wfm api base
30
+ */
31
+ thumb: string;
32
+ };
33
+ };
34
+ }
35
+ interface WFCDRelic {
36
+ /**
37
+ * Relic Tier (Axi, Neo, etc.)
38
+ */
39
+ tier: string;
40
+ /**
41
+ * Relic Name (A1, A10, etc.)
42
+ */
43
+ relicName: string;
44
+ /**
45
+ * Relic Refinement state
46
+ */
47
+ state: 'Intact' | 'Exceptional' | 'Flawless' | 'Radiant';
48
+ /**
49
+ * Relic Rewards
50
+ */
51
+ rewards: Array<WFCDRelicReward>;
52
+ /**
53
+ * Internal WFCD id
54
+ */
55
+ _id: string;
56
+ }
57
+ interface WFCDRelicReward {
58
+ /**
59
+ * Dropped Item name
60
+ */
61
+ itemName: string;
62
+ /**
63
+ * Dropchance Rarity (Uncommon/Rare ?)
64
+ */
65
+ rarity: 'Uncommon' | 'Rare';
66
+ /**
67
+ * Actual Dropchance in %
68
+ */
69
+ chance: number;
70
+ /**
71
+ * Internal ID
72
+ */
73
+ _id: string;
74
+ }
75
+ interface WFCDItem {
76
+ /**
77
+ * Item Name
78
+ */
79
+ name: string;
80
+ /** Unique identifying name */
81
+ uniqueName: string;
82
+ /**
83
+ * Item Drop Location
84
+ */
85
+ drops?: Array<WFCDItemDropLocation>;
86
+ }
87
+ interface WFCDItemDropLocation {
88
+ /**
89
+ * Dropchance in %
90
+ */
91
+ chance: number;
92
+ /**
93
+ * Mission location
94
+ */
95
+ location: string;
96
+ /**
97
+ * Drop rarity
98
+ */
99
+ rarity: string;
100
+ /**
101
+ * Relic Type
102
+ */
103
+ type: string;
104
+ }
105
+ interface TitaniaRelic {
106
+ /**
107
+ * Relic Combined Name (Ex: Axi A1)
108
+ */
109
+ name: string;
110
+ /**
111
+ * Relic Rewards when opened
112
+ */
113
+ rewards: Array<TitaniaRelicReward>;
114
+ /**
115
+ * Drop Locations for the relics
116
+ */
117
+ locations: Array<TitaniaRelicLocation>;
118
+ /**
119
+ * Warframe Market Information
120
+ * undefined for untradable
121
+ */
122
+ warframeMarket?: TitaniaWFMInfo;
123
+ /**
124
+ * Relic Vault Information
125
+ */
126
+ vaultInfo: TitaniaRelicVaultedInfo;
127
+ /** unique name for corresponding warframe-items Item */
128
+ uniqueName: string;
129
+ }
130
+ interface TitaniaRelicReward {
131
+ /**
132
+ * Relic Rarity (Uncommon,Rare ?)
133
+ */
134
+ rarity: 'Uncommon' | 'Rare';
135
+ /**
136
+ * Reward Drop Chance in %
137
+ */
138
+ chance: number;
139
+ /**
140
+ * Item Information
141
+ */
142
+ item: TitaniaRelicRewardItem;
143
+ }
144
+ interface TitaniaRelicRewardItem {
145
+ /**
146
+ * Item Name
147
+ */
148
+ name: string;
149
+ /** unique name for corresponding warframe-items Item */
150
+ uniqueName: string;
151
+ /**
152
+ * WarframeMarket Info
153
+ */
154
+ warframeMarket?: TitaniaWFMInfo;
155
+ }
156
+ type Rarity = 'Uncommon' | 'Rare' | 'Legendary' | 'Common';
157
+ interface TitaniaRelicLocation {
158
+ /** Location Info $planet-$node (Ex: Eris - Phalan) */
159
+ location: string;
160
+ /**
161
+ * Rarity (Uncommon, Rare ?)
162
+ */
163
+ rarity: Rarity;
164
+ /**
165
+ * Dropchance in %
166
+ */
167
+ chance: number;
168
+ }
169
+ interface TitaniaWFMInfo {
170
+ /**
171
+ * Warframe Market ID
172
+ */
173
+ id: string;
174
+ /**
175
+ * Warframe market URL parameter
176
+ */
177
+ urlName: string;
178
+ }
179
+ interface TitaniaRelicVaultedInfo {
180
+ /**
181
+ * If the relic is vaulted
182
+ */
183
+ vaulted: boolean;
184
+ }
185
+ //#endregion
186
+ //#region src/Generator.d.ts
187
+ declare class Generator {
188
+ relicsRaw: Array<WFCDRelic> | undefined;
189
+ wfcdItems: Array<WFCDItem> | undefined;
190
+ wfmItems: WarframeMarketRoot | undefined;
191
+ relics: Array<TitaniaRelic>;
192
+ constructor();
193
+ /**
194
+ * Main function to fetch and generate the relic data
195
+ * @returns {Promise<Array<TitaniaRelic>>} The Relics data array
196
+ */
197
+ generate(): Promise<Array<TitaniaRelic>>;
198
+ /**
199
+ * Fetches all required data from WFCD and WFM.
200
+ */
201
+ fetchRawData(): Promise<void>;
202
+ /**
203
+ * Generates the relic data
204
+ * uses WFCD/warframe-drop-data to check what relics exist,
205
+ * and adds information from WFCD/warframe-items and WFM
206
+ */
207
+ generateTitaniaRelics(): void;
208
+ /**
209
+ * Writes the fully generated data to disk.
210
+ * @param {string} dataDir Directory to store the relic data in. Default: ../data/
211
+ * @param {string} fileName Filename base ex: "Relics" becomes "Relics.json" and "Relics.min.json". Default: "Relics"
212
+ * @param {boolean} generateMin True if a minified json should be generated too. Default: true
213
+ */
214
+ writeData(dataDir?: string, fileName?: string, generateMin?: boolean): Promise<void>;
215
+ /**
216
+ * Generates a single relic from all available data
217
+ * @param {WFCDRelic} rawRelic relic to pull Titania data from
218
+ * @returns {TitaniaRelicReward}
219
+ */
220
+ private generateTitaniaRelic;
221
+ /**
222
+ * Filters WFCD's relic data to only include Intact variants, since we just need the base.
223
+ */
224
+ private filterWFCDRelics;
225
+ }
226
+ //#endregion
227
+ //#region src/VersionManager.d.ts
228
+ declare class VersionManager {
229
+ versionPath: string;
230
+ versionRawPath: string;
231
+ hashPath: string;
232
+ /**
233
+ * Creates a new VersionManager instance.
234
+ * @param {string} dataDir Folder to write version information to.
235
+ * @constructor
236
+ */
237
+ constructor(dataDir?: string);
238
+ /**
239
+ * Checks if the current data needs an update
240
+ */
241
+ updateNeeded(): Promise<boolean>;
242
+ /**
243
+ * Writes both game and drop version metadata
244
+ * @param {number} timestamp Timestamp the build was started at
245
+ */
246
+ writeVersion(timestamp: number): Promise<void>;
247
+ }
248
+ //#endregion
249
+ export { Generator, Rarity, TitaniaRelic, TitaniaRelicLocation, TitaniaRelicReward, TitaniaRelicRewardItem, TitaniaRelicVaultedInfo, TitaniaWFMInfo, VersionManager, WFCDItem, WFCDItemDropLocation, WFCDRelic, WFCDRelicReward, WarframeMarketItem, WarframeMarketRoot };
package/package.json CHANGED
@@ -1,16 +1,14 @@
1
1
  {
2
2
  "name": "@wfcd/relics",
3
- "version": "2.0.28",
3
+ "version": "2.0.29",
4
4
  "description": "Relic Data for Warframe",
5
- "main": "dist/index.js",
6
- "files": [
7
- "dist/index.d.ts",
8
- "dist/index.mjs",
9
- "dist/index.js"
10
- ],
5
+ "main": "dist/index.cjs",
11
6
  "exports": {
12
- "import": "./dist/index.mjs",
13
- "require": "./dist/index.js"
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.mjs",
10
+ "require": "./dist/index.cjs"
11
+ }
14
12
  },
15
13
  "types": "dist/index.d.ts",
16
14
  "scripts": {
package/tsconfig.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "commonjs",
5
+ "rootDir": "./src",
6
+ "moduleResolution": "node",
7
+ "types": ["warframe-patchlogs", "mocha", "chai"],
8
+ "declaration": true,
9
+ "sourceMap": true,
10
+ "outDir": "./dist",
11
+ "esModuleInterop": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "strict": true,
14
+ "skipLibCheck": true
15
+ }
16
+ }