warframe-worldstate-parser 5.3.8 → 5.3.10

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.
@@ -44,7 +44,7 @@ const determineLocation = (i18n, raw, isVault) => {
44
44
  locationWRot
45
45
  };
46
46
  };
47
- const getBountyRewards = async (i18n, raw, isVault) => {
47
+ const getBountyRewards = async (i18n, raw, isVault, logger = console) => {
48
48
  let location;
49
49
  let locationWRot;
50
50
  if (i18n.endsWith("PlagueStarTableRewards")) {
@@ -52,7 +52,10 @@ const getBountyRewards = async (i18n, raw, isVault) => {
52
52
  locationWRot = "Earth/Cetus (Level 15 - 25 Plague Star), Rot A";
53
53
  }
54
54
  if (!location || !locationWRot) ({location, locationWRot} = determineLocation(i18n, raw, isVault));
55
- const pool = (await fetchProxy(`${apiBase}/drops/search/${encodeURIComponent(location)}?grouped_by=location`).then((res) => res.json()).catch(() => {}))?.[locationWRot];
55
+ const pool = (await fetchProxy(`${apiBase}/drops/search/${encodeURIComponent(location)}?grouped_by=location`).then((res) => res.json()).catch((error) => {
56
+ const errorMessage = error instanceof Error ? error.message : String(error);
57
+ logger?.debug(`Failed to fetch bounty rewards for ${location}: ${errorMessage}`);
58
+ }))?.[locationWRot];
56
59
  if (!pool) return ["Pattern Mismatch. Results inaccurate."];
57
60
  const results = pool.rewards;
58
61
  if (results) return Array.from(new Set(results));
@@ -114,7 +117,7 @@ var SyndicateJob = class SyndicateJob extends WorldStateObject {
114
117
  */
115
118
  static async build(data, expiry, deps) {
116
119
  const job = new SyndicateJob(data, expiry, deps);
117
- const rewards = await getBountyRewards(data.rewards, data, data.isVault);
120
+ const rewards = await getBountyRewards(data.rewards, data, data.isVault, deps.logger);
118
121
  if (typeof rewards[0] === "string") job.rewardPool = rewards;
119
122
  else {
120
123
  job.rewardPoolDrops = rewards.map((reward) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "warframe-worldstate-parser",
3
- "version": "5.3.8",
3
+ "version": "5.3.10",
4
4
  "description": "An Open parser for Warframe's Worldstate in Javascript",
5
5
  "keywords": [
6
6
  "warframe-worldstate",