@wfcd/relics 2.0.24 → 2.0.26

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/dist/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  interface WarframeMarketRoot {
2
- payload: {
3
- items: Array<WarframeMarketItem>;
4
- };
2
+ data: Array<WarframeMarketItem>;
5
3
  }
6
4
  interface WarframeMarketItem {
7
5
  /**
@@ -11,15 +9,25 @@ interface WarframeMarketItem {
11
9
  /**
12
10
  * Url name for querying WFM
13
11
  */
14
- url_name: string;
15
- /**
16
- * Thumbnail URL relative to wfm api base
17
- */
18
- thumb: string;
19
- /**
20
- * Item Name
21
- */
22
- item_name: string;
12
+ slug: string;
13
+ /**
14
+ * WFM language object
15
+ */
16
+ i18n: {
17
+ /**
18
+ * English language object
19
+ */
20
+ en: {
21
+ /**
22
+ * Item Name
23
+ */
24
+ name: string;
25
+ /**
26
+ * Thumbnail URL relative to wfm api base
27
+ */
28
+ thumb: string;
29
+ };
30
+ };
23
31
  }
24
32
  interface WFCDRelic {
25
33
  /**
package/dist/index.js CHANGED
@@ -44,7 +44,7 @@ var import_node_fetch = __toESM(require("node-fetch"));
44
44
  // src/Config.ts
45
45
  var Config = {
46
46
  warframeRelicDropUrl: "https://drops.warframestat.us/data/relics.json",
47
- warframeMarketItemUrl: "https://api.warframe.market/v1/items",
47
+ warframeMarketItemUrl: "https://api.warframe.market/v2/items",
48
48
  warframeItemsUrl: "https://api.warframestat.us/items/search/Relics?by=category",
49
49
  warframeRelicDropInfoUrl: "https://drops.warframestat.us/data/info.json",
50
50
  warframePatchlogsUrl: "https://raw.githubusercontent.com/WFCD/warframe-patchlogs/master/data/patchlogs.json"
@@ -160,7 +160,7 @@ var _Generator = class _Generator {
160
160
  * @param {string} fileName Filename base ex: "Relics" becomes "Relics.json" and "Relics.min.json". Default: "Relics"
161
161
  * @param {boolean} generateMin True if a minified json should be generated too. Default: true
162
162
  */
163
- async writeData(dataDir, fileName, generateMin) {
163
+ async writeData(dataDir, fileName, generateMin = true) {
164
164
  const DataDir = dataDir ?? import_node_path.default.join(__dirname, "..", "data");
165
165
  const RelicPath = fileName ? import_node_path.default.join(DataDir, `${fileName}.json`) : import_node_path.default.join(DataDir, "Relics.json");
166
166
  await import_promises.default.writeFile(RelicPath, JSON.stringify(this.relics, void 0, 4));
@@ -181,7 +181,7 @@ var _Generator = class _Generator {
181
181
  var _a2, _b2, _c;
182
182
  const { chance } = rawReward;
183
183
  const { rarity } = rawReward;
184
- const wfmInfo = (_a2 = this.wfmItems) == null ? void 0 : _a2.payload.items.find((x) => x.item_name === rawReward.itemName);
184
+ const wfmInfo = (_a2 = this.wfmItems) == null ? void 0 : _a2.data.find((x) => x.i18n.en.name === rawReward.itemName);
185
185
  const isSpecial = ["Forma", "Kuva", "Exilus", "Riven"].find(
186
186
  (x) => (
187
187
  // eslint-disable-next-line @typescript-eslint/comma-dangle
@@ -197,7 +197,7 @@ var _Generator = class _Generator {
197
197
  warframeMarket: void 0
198
198
  };
199
199
  if (wfmInfo) {
200
- item.warframeMarket = { id: wfmInfo.id, urlName: wfmInfo.url_name };
200
+ item.warframeMarket = { id: wfmInfo.id, urlName: wfmInfo.slug };
201
201
  }
202
202
  return { rarity, chance, item };
203
203
  });
@@ -211,7 +211,7 @@ var _Generator = class _Generator {
211
211
  return { rarity: rawDrop.rarity, chance: rawDrop.chance, location: rawDrop.location };
212
212
  });
213
213
  }
214
- const wfm = (_b = this.wfmItems) == null ? void 0 : _b.payload.items.find((x) => x.item_name === `${name.trim()} Relic`);
214
+ const wfm = (_b = this.wfmItems) == null ? void 0 : _b.data.find((x) => x.i18n.en.name === `${name.trim()} Relic`);
215
215
  if (!wfm) {
216
216
  Logger_default.error(`Failed to get relic item from wfm: ${name}`);
217
217
  }
@@ -221,7 +221,7 @@ var _Generator = class _Generator {
221
221
  locations: drops,
222
222
  uniqueName: (wfcdItem == null ? void 0 : wfcdItem.uniqueName) || "",
223
223
  vaultInfo: { vaulted: drops.length === 0 },
224
- ...(wfm == null ? void 0 : wfm.id) && (wfm == null ? void 0 : wfm.url_name) && { warframeMarket: { id: wfm == null ? void 0 : wfm.id, urlName: wfm == null ? void 0 : wfm.url_name } }
224
+ ...(wfm == null ? void 0 : wfm.id) && (wfm == null ? void 0 : wfm.slug) && { warframeMarket: { id: wfm == null ? void 0 : wfm.id, urlName: wfm == null ? void 0 : wfm.slug } }
225
225
  };
226
226
  }
227
227
  /**
package/dist/index.mjs CHANGED
@@ -9,7 +9,7 @@ import fetch from "node-fetch";
9
9
  // src/Config.ts
10
10
  var Config = {
11
11
  warframeRelicDropUrl: "https://drops.warframestat.us/data/relics.json",
12
- warframeMarketItemUrl: "https://api.warframe.market/v1/items",
12
+ warframeMarketItemUrl: "https://api.warframe.market/v2/items",
13
13
  warframeItemsUrl: "https://api.warframestat.us/items/search/Relics?by=category",
14
14
  warframeRelicDropInfoUrl: "https://drops.warframestat.us/data/info.json",
15
15
  warframePatchlogsUrl: "https://raw.githubusercontent.com/WFCD/warframe-patchlogs/master/data/patchlogs.json"
@@ -125,7 +125,7 @@ var _Generator = class _Generator {
125
125
  * @param {string} fileName Filename base ex: "Relics" becomes "Relics.json" and "Relics.min.json". Default: "Relics"
126
126
  * @param {boolean} generateMin True if a minified json should be generated too. Default: true
127
127
  */
128
- async writeData(dataDir, fileName, generateMin) {
128
+ async writeData(dataDir, fileName, generateMin = true) {
129
129
  const DataDir = dataDir ?? path.join(__dirname, "..", "data");
130
130
  const RelicPath = fileName ? path.join(DataDir, `${fileName}.json`) : path.join(DataDir, "Relics.json");
131
131
  await fs.writeFile(RelicPath, JSON.stringify(this.relics, void 0, 4));
@@ -146,7 +146,7 @@ var _Generator = class _Generator {
146
146
  var _a2, _b2, _c;
147
147
  const { chance } = rawReward;
148
148
  const { rarity } = rawReward;
149
- const wfmInfo = (_a2 = this.wfmItems) == null ? void 0 : _a2.payload.items.find((x) => x.item_name === rawReward.itemName);
149
+ const wfmInfo = (_a2 = this.wfmItems) == null ? void 0 : _a2.data.find((x) => x.i18n.en.name === rawReward.itemName);
150
150
  const isSpecial = ["Forma", "Kuva", "Exilus", "Riven"].find(
151
151
  (x) => (
152
152
  // eslint-disable-next-line @typescript-eslint/comma-dangle
@@ -162,7 +162,7 @@ var _Generator = class _Generator {
162
162
  warframeMarket: void 0
163
163
  };
164
164
  if (wfmInfo) {
165
- item.warframeMarket = { id: wfmInfo.id, urlName: wfmInfo.url_name };
165
+ item.warframeMarket = { id: wfmInfo.id, urlName: wfmInfo.slug };
166
166
  }
167
167
  return { rarity, chance, item };
168
168
  });
@@ -176,7 +176,7 @@ var _Generator = class _Generator {
176
176
  return { rarity: rawDrop.rarity, chance: rawDrop.chance, location: rawDrop.location };
177
177
  });
178
178
  }
179
- const wfm = (_b = this.wfmItems) == null ? void 0 : _b.payload.items.find((x) => x.item_name === `${name.trim()} Relic`);
179
+ const wfm = (_b = this.wfmItems) == null ? void 0 : _b.data.find((x) => x.i18n.en.name === `${name.trim()} Relic`);
180
180
  if (!wfm) {
181
181
  Logger_default.error(`Failed to get relic item from wfm: ${name}`);
182
182
  }
@@ -186,7 +186,7 @@ var _Generator = class _Generator {
186
186
  locations: drops,
187
187
  uniqueName: (wfcdItem == null ? void 0 : wfcdItem.uniqueName) || "",
188
188
  vaultInfo: { vaulted: drops.length === 0 },
189
- ...(wfm == null ? void 0 : wfm.id) && (wfm == null ? void 0 : wfm.url_name) && { warframeMarket: { id: wfm == null ? void 0 : wfm.id, urlName: wfm == null ? void 0 : wfm.url_name } }
189
+ ...(wfm == null ? void 0 : wfm.id) && (wfm == null ? void 0 : wfm.slug) && { warframeMarket: { id: wfm == null ? void 0 : wfm.id, urlName: wfm == null ? void 0 : wfm.slug } }
190
190
  };
191
191
  }
192
192
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wfcd/relics",
3
- "version": "2.0.24",
3
+ "version": "2.0.26",
4
4
  "description": "Relic Data for Warframe",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -38,7 +38,7 @@
38
38
  "devDependencies": {
39
39
  "@types/chai": "^4.3.3",
40
40
  "@types/mocha": "^10.0.0",
41
- "@types/node": "^24.0.1",
41
+ "@types/node": "^25.0.1",
42
42
  "@types/node-fetch": "^2.6.2",
43
43
  "@wfcd/eslint-config": "^1.2.0",
44
44
  "chai": "^4.3.6",