@wfcd/profile-parser 1.3.0 → 1.4.0
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 +2 -0
- package/package.json +1 -1
- package/src/LoadOutItem.js +15 -5
- package/src/Profile.js +2 -1
- package/src/Race.js +1 -1
- package/types/LoadOutItem.d.ts +6 -1
- package/types/Profile.d.ts +3 -2
package/README.md
CHANGED
|
@@ -27,3 +27,5 @@ const user = new ProfileParser(await profileData.text());
|
|
|
27
27
|
|
|
28
28
|
console.log(user.profile.displayName);
|
|
29
29
|
```
|
|
30
|
+
|
|
31
|
+
If this data is stale, you can check the `Cache-Control` header of the response from DE's server to see how long to wait for retry, and you could have the above retry after that amount of time. However, this may cause _significant_ delay if the data is not saved/hydrated in a fully asynchronous or event-based timeframe.
|
package/package.json
CHANGED
package/src/LoadOutItem.js
CHANGED
|
@@ -46,11 +46,15 @@ export default class LoadOutItem {
|
|
|
46
46
|
if (weapon.ItemName) {
|
|
47
47
|
const [, nemesis] = weapon.ItemName.split('|');
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
if (nemesis !== undefined) {
|
|
50
|
+
/**
|
|
51
|
+
* The name of the Lich, Sister, or Technocyte
|
|
52
|
+
* @type {String}
|
|
53
|
+
*/
|
|
54
|
+
this.nemesis = toTitleCase(nemesis);
|
|
55
|
+
} else {
|
|
56
|
+
this.name = weapon.ItemName;
|
|
57
|
+
}
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
/**
|
|
@@ -124,6 +128,12 @@ export default class LoadOutItem {
|
|
|
124
128
|
*/
|
|
125
129
|
if (weapon.sigcol) this.sigilColor = colors.mapColors(weapon.sigcol.toString(16));
|
|
126
130
|
|
|
131
|
+
/**
|
|
132
|
+
* Whether prime details are enabled or not
|
|
133
|
+
* @type {boolean}
|
|
134
|
+
*/
|
|
135
|
+
this.enablePrime = weapon.ugly ?? false;
|
|
136
|
+
|
|
127
137
|
/**
|
|
128
138
|
* Attachment colors applied to item if they exist
|
|
129
139
|
* @type {module:"warframe-items".ColorMap | undefined}
|
package/src/Profile.js
CHANGED
|
@@ -142,7 +142,7 @@ export default class Profile {
|
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
144
|
* List of completed missions and their completions
|
|
145
|
-
* @type {
|
|
145
|
+
* @type {Mission}
|
|
146
146
|
*/
|
|
147
147
|
this.missions = profile.Missions.map((m) => new Mission(m, locale));
|
|
148
148
|
|
|
@@ -172,6 +172,7 @@ export default class Profile {
|
|
|
172
172
|
holdfasts: profile.DailyAffiliationZariman,
|
|
173
173
|
kahl: profile.DailyAffiliationKahl,
|
|
174
174
|
cavia: profile.DailyAffiliationCavia,
|
|
175
|
+
hex: profile.DailyAffiliationHex,
|
|
175
176
|
};
|
|
176
177
|
|
|
177
178
|
/**
|
package/src/Race.js
CHANGED
|
@@ -28,6 +28,6 @@ export default class Race {
|
|
|
28
28
|
* @returns {Race[]} An array of races formatted in a more consumable way.
|
|
29
29
|
*/
|
|
30
30
|
static fromRaceObject(races) {
|
|
31
|
-
return Object.entries(races).map(([type, { highScore }]) => new Race(type, highScore));
|
|
31
|
+
return Object.entries(races ?? []).map(([type, { highScore }]) => new Race(type, highScore));
|
|
32
32
|
}
|
|
33
33
|
}
|
package/types/LoadOutItem.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export default class LoadOutItem {
|
|
|
30
30
|
*/
|
|
31
31
|
item: any;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* The name of the Lich, Sister, or Technocyte
|
|
34
34
|
* @type {String}
|
|
35
35
|
*/
|
|
36
36
|
nemesis: string;
|
|
@@ -79,6 +79,11 @@ export default class LoadOutItem {
|
|
|
79
79
|
customizationSlotPurchases: number;
|
|
80
80
|
primaryColor: any;
|
|
81
81
|
sigilColor: any;
|
|
82
|
+
/**
|
|
83
|
+
* Whether prime details are enabled or not
|
|
84
|
+
* @type {boolean}
|
|
85
|
+
*/
|
|
86
|
+
enablePrime: boolean;
|
|
82
87
|
attachmentsColor: any;
|
|
83
88
|
syandanaColor: any;
|
|
84
89
|
infestationDate: any;
|
package/types/Profile.d.ts
CHANGED
|
@@ -104,9 +104,9 @@ export default class Profile {
|
|
|
104
104
|
migratedToConsole: bool;
|
|
105
105
|
/**
|
|
106
106
|
* List of completed missions and their completions
|
|
107
|
-
* @type {
|
|
107
|
+
* @type {Mission}
|
|
108
108
|
*/
|
|
109
|
-
missions:
|
|
109
|
+
missions: Mission;
|
|
110
110
|
/**
|
|
111
111
|
* Player standing and title across all syndicates
|
|
112
112
|
* @type {Array<Syndicate>}
|
|
@@ -153,5 +153,6 @@ import LoadOutPreset from './LoadOutPreset.js';
|
|
|
153
153
|
import LoadOutInventory from './LoadOutInventory.js';
|
|
154
154
|
import Intrinsics from './Intrinsics.js';
|
|
155
155
|
import ChallengeProgress from './ChallengeProgress.js';
|
|
156
|
+
import Mission from './Mission.js';
|
|
156
157
|
import Syndicate from './Syndicate.js';
|
|
157
158
|
import OperatorLoadOuts from './OperatorLoadOuts.js';
|