@wfcd/profile-parser 2.0.0 → 2.0.2
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/Ability-D1F1s_19.js +25 -0
- package/dist/Ability-DzKgEG5R.d.ts +19 -0
- package/dist/Ability.d.ts +2 -0
- package/dist/Ability.js +3 -0
- package/dist/ArchonCrystal.d.ts +23 -0
- package/dist/ArchonCrystal.js +29 -0
- package/dist/ChallengeProgress-B8Kv32oi.d.ts +20 -0
- package/dist/ChallengeProgress-DKKtijWw.js +26 -0
- package/dist/ChallengeProgress.d.ts +2 -0
- package/dist/ChallengeProgress.js +3 -0
- package/dist/Enemy-BqxhFdkB.js +44 -0
- package/{src/Enemy.ts → dist/Enemy-toy1Spyi.d.ts} +6 -17
- package/dist/Enemy.d.ts +2 -0
- package/dist/Enemy.js +3 -0
- package/dist/Intrinsics-CqFOpLxp.js +67 -0
- package/{src/Intrinsics.ts → dist/Intrinsics-azrsOZJd.d.ts} +6 -37
- package/dist/Intrinsics.d.ts +2 -0
- package/dist/Intrinsics.js +3 -0
- package/dist/ItemConfig-7as-gjPG.d.ts +51 -0
- package/dist/ItemConfig-uU36aJFJ.js +50 -0
- package/dist/ItemConfig.d.ts +4 -0
- package/dist/ItemConfig.js +5 -0
- package/{src/LoadOutInventory.ts → dist/LoadOutInventory-BsPRtXfG.d.ts} +10 -26
- package/dist/LoadOutInventory-CPVZJ_W5.js +52 -0
- package/dist/LoadOutInventory.d.ts +8 -0
- package/dist/LoadOutInventory.js +9 -0
- package/dist/LoadOutItem-B_6G9dXC.js +127 -0
- package/dist/LoadOutItem-BlRFZMNd.d.ts +120 -0
- package/dist/LoadOutItem.d.ts +6 -0
- package/dist/LoadOutItem.js +7 -0
- package/{src/LoadOutPreset.ts → dist/LoadOutPreset-BshJF0LH.d.ts} +11 -50
- package/dist/LoadOutPreset-CMbZo-II.js +83 -0
- package/dist/LoadOutPreset.d.ts +2 -0
- package/dist/LoadOutPreset.js +4 -0
- package/{src/Mission.ts → dist/Mission-BZgLMluh.d.ts} +7 -29
- package/dist/Mission-D2n1i5R2.js +55 -0
- package/dist/Mission.d.ts +2 -0
- package/dist/Mission.js +3 -0
- package/dist/OperatorLoadOuts-B8bEy2dp.js +76 -0
- package/dist/OperatorLoadOuts-Dk2uMwby.d.ts +75 -0
- package/dist/OperatorLoadOuts.d.ts +4 -0
- package/dist/OperatorLoadOuts.js +5 -0
- package/dist/Polarity--RYq3iwF.js +28 -0
- package/dist/Polarity-DDWqEVm2.d.ts +26 -0
- package/dist/Polarity.d.ts +2 -0
- package/dist/Polarity.js +3 -0
- package/dist/Profile-WWZ2BDf0.js +193 -0
- package/{src/Profile.ts → dist/Profile-rva_Xss5.d.ts} +27 -123
- package/dist/Profile.d.ts +15 -0
- package/dist/Profile.js +16 -0
- package/dist/ProfileParser.d.ts +71 -0
- package/dist/ProfileParser.js +71 -0
- package/{src/Pvp.ts → dist/Pvp-Cb1KNKvw.d.ts} +6 -13
- package/dist/Pvp-hyzYfVBB.js +36 -0
- package/dist/Pvp.d.ts +2 -0
- package/dist/Pvp.js +3 -0
- package/dist/Race-5Q0StEkE.js +35 -0
- package/{src/Race.ts → dist/Race-DCxzjMpC.d.ts} +9 -13
- package/dist/Race.d.ts +2 -0
- package/dist/Race.js +3 -0
- package/{src/Scan.ts → dist/Scan-BWfZiLoW.d.ts} +6 -9
- package/dist/Scan-Dlrv6viG.js +27 -0
- package/dist/Scan.d.ts +2 -0
- package/dist/Scan.js +3 -0
- package/dist/Skin-BbUkegH1.d.ts +28 -0
- package/dist/Skin-D6v6jC9U.js +36 -0
- package/dist/Skin.d.ts +2 -0
- package/dist/Skin.js +4 -0
- package/dist/Stats-Bm1bpQe5.js +305 -0
- package/{src/Stats.ts → dist/Stats-DtkR2w1A.d.ts} +22 -201
- package/dist/Stats.d.ts +9 -0
- package/dist/Stats.js +10 -0
- package/dist/Syndicate-CjUKKAsk.js +33 -0
- package/{src/Syndicate.ts → dist/Syndicate-FSUt1PP5.d.ts} +7 -13
- package/dist/Syndicate.d.ts +2 -0
- package/dist/Syndicate.js +3 -0
- package/dist/Utils-C3kZCO6a.js +60 -0
- package/dist/Utils-C7BZqK4e.d.ts +37 -0
- package/dist/Utils.d.ts +2 -0
- package/dist/Utils.js +3 -0
- package/dist/Weapon-4KlXEHQF.js +64 -0
- package/dist/Weapon-DAJp-nbn.d.ts +32 -0
- package/dist/Weapon.d.ts +2 -0
- package/dist/Weapon.js +3 -0
- package/dist/XpInfo-CXC3I0NQ.js +35 -0
- package/{src/XpInfo.ts → dist/XpInfo-ChJ_lJaH.d.ts} +7 -14
- package/dist/XpInfo.d.ts +2 -0
- package/dist/XpInfo.js +4 -0
- package/package.json +5 -5
- package/src/Ability.ts +0 -29
- package/src/ArchonCrystal.ts +0 -33
- package/src/ChallengeProgress.ts +0 -30
- package/src/ItemConfig.ts +0 -71
- package/src/LoadOutItem.ts +0 -194
- package/src/OperatorLoadOuts.ts +0 -108
- package/src/Polarity.ts +0 -31
- package/src/ProfileParser.ts +0 -66
- package/src/Skin.ts +0 -41
- package/src/Utils.ts +0 -85
- package/src/Weapon.ts +0 -79
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//#region src/Weapon.ts
|
|
2
|
+
/**
|
|
3
|
+
* Represents a player's used weapon stats
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
var Weapon = class {
|
|
7
|
+
uniqueName;
|
|
8
|
+
xp;
|
|
9
|
+
equipTime;
|
|
10
|
+
headShots;
|
|
11
|
+
hits;
|
|
12
|
+
assists;
|
|
13
|
+
kills;
|
|
14
|
+
fired;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param weapon The weapon stats being parsed
|
|
18
|
+
*/
|
|
19
|
+
constructor(weapon) {
|
|
20
|
+
/**
|
|
21
|
+
* Weapon unique name
|
|
22
|
+
* @type {String}
|
|
23
|
+
*/
|
|
24
|
+
this.uniqueName = weapon.type;
|
|
25
|
+
/**
|
|
26
|
+
* Earned XP with weapon
|
|
27
|
+
* @type {number}
|
|
28
|
+
*/
|
|
29
|
+
this.xp = weapon.xp;
|
|
30
|
+
/**
|
|
31
|
+
* Time using this weapon
|
|
32
|
+
* @type {number}
|
|
33
|
+
*/
|
|
34
|
+
this.equipTime = weapon.equipTime;
|
|
35
|
+
/**
|
|
36
|
+
* Headshots using this weapon
|
|
37
|
+
* @type {number}
|
|
38
|
+
*/
|
|
39
|
+
this.headShots = weapon.headShots;
|
|
40
|
+
/**
|
|
41
|
+
* Hits using weapon
|
|
42
|
+
* @type {number}
|
|
43
|
+
*/
|
|
44
|
+
this.hits = weapon.hits;
|
|
45
|
+
/**
|
|
46
|
+
* Assists using weapon
|
|
47
|
+
* @type {number}
|
|
48
|
+
*/
|
|
49
|
+
this.assists = weapon.assists;
|
|
50
|
+
/**
|
|
51
|
+
* Kills with weapon
|
|
52
|
+
* @type {number}
|
|
53
|
+
*/
|
|
54
|
+
this.kills = weapon.kills;
|
|
55
|
+
/**
|
|
56
|
+
* Shots fired
|
|
57
|
+
* @type {number}
|
|
58
|
+
*/
|
|
59
|
+
this.fired = weapon.fired;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
export { Weapon };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region src/Weapon.d.ts
|
|
2
|
+
interface RawWeapon {
|
|
3
|
+
type: string;
|
|
4
|
+
xp: number;
|
|
5
|
+
equipTime: number;
|
|
6
|
+
headShots: number;
|
|
7
|
+
hits: number;
|
|
8
|
+
assists: number;
|
|
9
|
+
kills: number;
|
|
10
|
+
fired: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Represents a player's used weapon stats
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
declare class Weapon {
|
|
17
|
+
uniqueName: string;
|
|
18
|
+
xp: number;
|
|
19
|
+
equipTime: number;
|
|
20
|
+
headShots: number;
|
|
21
|
+
hits: number;
|
|
22
|
+
assists: number;
|
|
23
|
+
kills: number;
|
|
24
|
+
fired: number;
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
* @param weapon The weapon stats being parsed
|
|
28
|
+
*/
|
|
29
|
+
constructor(weapon: RawWeapon);
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { RawWeapon, Weapon };
|
package/dist/Weapon.d.ts
ADDED
package/dist/Weapon.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { find } from "./Utils-C3kZCO6a.js";
|
|
2
|
+
|
|
3
|
+
//#region src/XpInfo.ts
|
|
4
|
+
/**
|
|
5
|
+
* An item that has contributed to a player's mastery rank
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
var XpInfo = class {
|
|
9
|
+
/**
|
|
10
|
+
* Unique name
|
|
11
|
+
*/
|
|
12
|
+
uniqueName;
|
|
13
|
+
/**
|
|
14
|
+
* XP earned
|
|
15
|
+
*/
|
|
16
|
+
xp;
|
|
17
|
+
/**
|
|
18
|
+
* The item corrosponding to the unique name.
|
|
19
|
+
*/
|
|
20
|
+
item;
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @param info The info for a given ranked item
|
|
24
|
+
* @param locale langauge to return item in
|
|
25
|
+
* @param withItem Whether or not to include items
|
|
26
|
+
*/
|
|
27
|
+
constructor(info, locale = "en", withItem = false) {
|
|
28
|
+
this.uniqueName = info.ItemType;
|
|
29
|
+
this.xp = info.XP;
|
|
30
|
+
if (withItem) this.item = find(info.ItemType, locale);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { XpInfo };
|
|
@@ -1,41 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { find } from './Utils';
|
|
1
|
+
import { Item } from "@wfcd/items";
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
//#region src/XpInfo.d.ts
|
|
4
|
+
interface RawXpItem {
|
|
5
5
|
ItemType: string;
|
|
6
6
|
XP: number;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
8
|
/**
|
|
10
9
|
* An item that has contributed to a player's mastery rank
|
|
11
10
|
* @module
|
|
12
11
|
*/
|
|
13
|
-
|
|
12
|
+
declare class XpInfo {
|
|
14
13
|
/**
|
|
15
14
|
* Unique name
|
|
16
15
|
*/
|
|
17
16
|
uniqueName: string;
|
|
18
|
-
|
|
19
17
|
/**
|
|
20
18
|
* XP earned
|
|
21
19
|
*/
|
|
22
20
|
xp: number;
|
|
23
|
-
|
|
24
21
|
/**
|
|
25
22
|
* The item corrosponding to the unique name.
|
|
26
23
|
*/
|
|
27
24
|
item?: Item;
|
|
28
|
-
|
|
29
25
|
/**
|
|
30
26
|
*
|
|
31
27
|
* @param info The info for a given ranked item
|
|
32
28
|
* @param locale langauge to return item in
|
|
33
29
|
* @param withItem Whether or not to include items
|
|
34
30
|
*/
|
|
35
|
-
constructor(info: RawXpItem, locale
|
|
36
|
-
this.uniqueName = info.ItemType;
|
|
37
|
-
this.xp = info.XP;
|
|
38
|
-
|
|
39
|
-
if (withItem) this.item = find(info.ItemType, locale);
|
|
40
|
-
}
|
|
31
|
+
constructor(info: RawXpItem, locale?: string, withItem?: boolean);
|
|
41
32
|
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { RawXpItem, XpInfo };
|
package/dist/XpInfo.d.ts
ADDED
package/dist/XpInfo.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wfcd/profile-parser",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Parser for Digital Extreme's profile data",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -23,25 +23,25 @@
|
|
|
23
23
|
},
|
|
24
24
|
"public": true,
|
|
25
25
|
"files": [
|
|
26
|
-
"
|
|
26
|
+
"dist",
|
|
27
27
|
"LICENSE",
|
|
28
28
|
"README.md",
|
|
29
29
|
"types"
|
|
30
30
|
],
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@biomejs/biome": "2.
|
|
32
|
+
"@biomejs/biome": "2.2.2",
|
|
33
33
|
"@types/chai": "^5.2.2",
|
|
34
34
|
"@types/mocha": "^10.0.10",
|
|
35
35
|
"@wfcd/eslint-config": "^1.6.3",
|
|
36
36
|
"c8": "^10.1.3",
|
|
37
|
-
"chai": "^
|
|
37
|
+
"chai": "^6.0.1",
|
|
38
38
|
"chai-json-equal": "^0.0.1",
|
|
39
39
|
"coveralls": "^3.1.1",
|
|
40
40
|
"husky": "^9.1.7",
|
|
41
41
|
"install-peerdeps": "^3.0.7",
|
|
42
42
|
"lint-staged": "^16.1.2",
|
|
43
43
|
"mocha": "^11.7.1",
|
|
44
|
-
"tsdown": "^0.
|
|
44
|
+
"tsdown": "^0.14.2",
|
|
45
45
|
"tsx": "^4.20.3",
|
|
46
46
|
"typescript": "^5.8.3"
|
|
47
47
|
},
|
package/src/Ability.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export interface RawAbility {
|
|
3
|
-
type: string;
|
|
4
|
-
used: number
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Represents a players used ability
|
|
9
|
-
* @module
|
|
10
|
-
*/
|
|
11
|
-
export default class Ability {
|
|
12
|
-
uniqueName: string;
|
|
13
|
-
used: number;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @param ability The ability
|
|
17
|
-
*/
|
|
18
|
-
constructor(ability: RawAbility) {
|
|
19
|
-
/**
|
|
20
|
-
* The ability unique name
|
|
21
|
-
*/
|
|
22
|
-
this.uniqueName = ability.type;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* How many time the ability was used in the player's lifetime
|
|
26
|
-
*/
|
|
27
|
-
this.used = ability.used;
|
|
28
|
-
}
|
|
29
|
-
}
|
package/src/ArchonCrystal.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Locale } from 'warframe-worldstate-data';
|
|
2
|
-
import { archonShardColor, archonShardUpgradeType } from 'warframe-worldstate-data/utilities';
|
|
3
|
-
|
|
4
|
-
interface RawArchonCrystal {
|
|
5
|
-
Color: string;
|
|
6
|
-
UpgradeType: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Represents an Archon shard
|
|
11
|
-
* @module
|
|
12
|
-
*/
|
|
13
|
-
export default class ArchonCrystal {
|
|
14
|
-
color: string;
|
|
15
|
-
modifier: string;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @param crystal The archon crystal object
|
|
20
|
-
* @param locale The locale to get translations in
|
|
21
|
-
*/
|
|
22
|
-
constructor(crystal: RawArchonCrystal, locale: Locale = 'en') {
|
|
23
|
-
/**
|
|
24
|
-
* Archon shard color
|
|
25
|
-
*/
|
|
26
|
-
this.color = archonShardColor(crystal.Color, locale);
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Archon shard modifier
|
|
30
|
-
*/
|
|
31
|
-
this.modifier = archonShardUpgradeType(crystal.Color, crystal.UpgradeType, locale);
|
|
32
|
-
}
|
|
33
|
-
}
|
package/src/ChallengeProgress.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export interface RawChallengeProgress {
|
|
3
|
-
Name: string;
|
|
4
|
-
Progress: number;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Player completed or in progress challenges
|
|
9
|
-
* @module
|
|
10
|
-
*/
|
|
11
|
-
export default class ChallengeProgress {
|
|
12
|
-
name: string
|
|
13
|
-
progress: number;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* @param challenge The challenge object to parse
|
|
18
|
-
*/
|
|
19
|
-
constructor(challenge: RawChallengeProgress) {
|
|
20
|
-
/**
|
|
21
|
-
* Name of the challenge
|
|
22
|
-
*/
|
|
23
|
-
this.name = challenge.Name;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Progress towards completing this challenge
|
|
27
|
-
*/
|
|
28
|
-
this.progress = challenge.Progress;
|
|
29
|
-
}
|
|
30
|
-
}
|
package/src/ItemConfig.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { colors } from '@wfcd/items/utilities';
|
|
2
|
-
|
|
3
|
-
import Skin from './Skin';
|
|
4
|
-
import { mapToHex, type ProfileRawColors } from './Utils';
|
|
5
|
-
import type { ColorMap } from '@wfcd/items';
|
|
6
|
-
import { Locale } from 'warframe-worldstate-data';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export interface RawItemConfig {
|
|
11
|
-
Skins?: string[];
|
|
12
|
-
PvpUpgrades?: string[];
|
|
13
|
-
pricol?: ProfileRawColors;
|
|
14
|
-
sigcol?: ProfileRawColors;
|
|
15
|
-
attcol?: ProfileRawColors;
|
|
16
|
-
syancol?: ProfileRawColors;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Item customizations such as colors and applied skins
|
|
21
|
-
* @module
|
|
22
|
-
*/
|
|
23
|
-
export default class ItemConfig {
|
|
24
|
-
/**
|
|
25
|
-
* Array of unique names for the skins applied to item
|
|
26
|
-
*/
|
|
27
|
-
skins?: Skin[];
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Array of PVP unique name upgrades applied
|
|
31
|
-
*/
|
|
32
|
-
conclaveUpgrades?: string[];
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Primary colors applied to item if they exist
|
|
36
|
-
*/
|
|
37
|
-
primaryColor?: ColorMap;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Sigil colors applied to item if they exist
|
|
41
|
-
*/
|
|
42
|
-
sigilColor?: ColorMap;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Attachment colors applied to item if they exist
|
|
46
|
-
*/
|
|
47
|
-
attachmentsColor?: ColorMap;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Syandana colors applied to item if they exist
|
|
51
|
-
*/
|
|
52
|
-
syandanaColor?: ColorMap;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
* @param config The configuration
|
|
57
|
-
*/
|
|
58
|
-
constructor(config: RawItemConfig, locale: Locale = 'en') {
|
|
59
|
-
this.skins = config.Skins?.filter(Boolean).map((s: string) => new Skin({ ItemType: s }, locale));
|
|
60
|
-
|
|
61
|
-
if (config.PvpUpgrades) this.conclaveUpgrades = config.PvpUpgrades;
|
|
62
|
-
|
|
63
|
-
if (config.pricol) this.primaryColor = colors.mapColors(mapToHex(config.pricol));
|
|
64
|
-
|
|
65
|
-
if (config.sigcol) this.sigilColor = colors.mapColors(mapToHex(config.sigcol));
|
|
66
|
-
|
|
67
|
-
if (config.attcol) this.attachmentsColor = colors.mapColors(mapToHex(config.attcol));
|
|
68
|
-
|
|
69
|
-
if (config.syancol) this.syandanaColor = colors.mapColors(mapToHex(config.syancol));
|
|
70
|
-
}
|
|
71
|
-
}
|
package/src/LoadOutItem.ts
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import { colors } from '@wfcd/items/utilities';
|
|
2
|
-
import { parseDate, toTitleCase, WorldStateDate } from 'warframe-worldstate-data/utilities';
|
|
3
|
-
|
|
4
|
-
import ItemConfig, { type RawItemConfig } from './ItemConfig';
|
|
5
|
-
import Polarity, { type RawPolarity } from './Polarity';
|
|
6
|
-
import { find, RawDate } from './Utils';
|
|
7
|
-
import type { ColorMap, Item, RawColors } from '@wfcd/items';
|
|
8
|
-
import { Locale } from 'warframe-worldstate-data';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export interface RawLoadOutItem {
|
|
12
|
-
ItemId: { $oid: string };
|
|
13
|
-
ItemType: string;
|
|
14
|
-
ItemName?: string;
|
|
15
|
-
Configs: RawItemConfig[];
|
|
16
|
-
UpgradeType?: string;
|
|
17
|
-
UpgradeFingerprint?: unknown;
|
|
18
|
-
Features: number;
|
|
19
|
-
UpgradeVer: number;
|
|
20
|
-
XP?: number;
|
|
21
|
-
Polarized?: number;
|
|
22
|
-
Polarity?: RawPolarity[];
|
|
23
|
-
FocusLens?: string;
|
|
24
|
-
CustomizationSlotPurchases?: number;
|
|
25
|
-
pricol?: RawColors;
|
|
26
|
-
sigcol?: RawColors;
|
|
27
|
-
ugly?: boolean;
|
|
28
|
-
attcol?: RawColors;
|
|
29
|
-
syancol?: RawColors;
|
|
30
|
-
InfestationDate?: RawDate;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* An an item in LoadOutInventory
|
|
35
|
-
* @module
|
|
36
|
-
*/
|
|
37
|
-
export default class LoadOutItem {
|
|
38
|
-
/**
|
|
39
|
-
* Item ID
|
|
40
|
-
*/
|
|
41
|
-
itemId: string;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Item unique name
|
|
45
|
-
*/
|
|
46
|
-
uniqueName: string;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Item in-game name
|
|
50
|
-
*/
|
|
51
|
-
name?: string;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Complete item from @wfcd/items
|
|
55
|
-
*/
|
|
56
|
-
item?: Item;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* The name of the Lich, Sister, or Technocyte
|
|
60
|
-
*/
|
|
61
|
-
nemesis?: string;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Configuration for this weapon. Such as colors and skins applied by the player
|
|
65
|
-
*/
|
|
66
|
-
configs: ItemConfig[];
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* The upgrade that was applied to this weapon
|
|
70
|
-
*/
|
|
71
|
-
upgradeType?: string;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Information on the upgradeType that was applied
|
|
75
|
-
* TODO need model for for fingerprint
|
|
76
|
-
*/
|
|
77
|
-
upgradeFingerprint: unknown;
|
|
78
|
-
|
|
79
|
-
features: number;
|
|
80
|
-
|
|
81
|
-
// Not sure what this is for
|
|
82
|
-
upgradeVer: number;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* XP earned with this weapon
|
|
86
|
-
*/
|
|
87
|
-
xp?: number;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* How many mod slots are currently polarized.
|
|
91
|
-
*/
|
|
92
|
-
polarized?: number;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Which polarity types exist on the weapon
|
|
96
|
-
*/
|
|
97
|
-
polarity?: Polarity[];
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Focus lens applied
|
|
101
|
-
*/
|
|
102
|
-
focuseLens?: string;
|
|
103
|
-
|
|
104
|
-
// Not sure what this is for
|
|
105
|
-
customizationSlotPurchases: number;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Primary colors applied to item if they exist
|
|
109
|
-
*/
|
|
110
|
-
primaryColor?: ColorMap;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Sigil colors applied to item if they exist
|
|
114
|
-
*/
|
|
115
|
-
sigilColor?: ColorMap;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Whether prime details are enabled or not
|
|
119
|
-
*/
|
|
120
|
-
enablePrime: boolean;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Attachment colors applied to item if they exist
|
|
124
|
-
*/
|
|
125
|
-
attachmentsColor?: ColorMap;
|
|
126
|
-
/**
|
|
127
|
-
* Syandana colors applied to item if they exist
|
|
128
|
-
*/
|
|
129
|
-
syandanaColor?: ColorMap;
|
|
130
|
-
/**
|
|
131
|
-
* If set will show when the player's warframe was infested.
|
|
132
|
-
*/
|
|
133
|
-
infestationDate?: Date;
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
*
|
|
137
|
-
* @param {Object} loadOutItem The loadout item from LoadoutInventory
|
|
138
|
-
* @param {string} [locale='en'] The locale to return item in
|
|
139
|
-
*/
|
|
140
|
-
constructor(loadOutItem: RawLoadOutItem, locale: Locale = 'en') {
|
|
141
|
-
this.itemId = loadOutItem.ItemId.$oid;
|
|
142
|
-
|
|
143
|
-
this.uniqueName = loadOutItem.ItemType;
|
|
144
|
-
|
|
145
|
-
const item = find(loadOutItem.ItemType, locale);
|
|
146
|
-
if (item) {
|
|
147
|
-
this.name = item.name;
|
|
148
|
-
|
|
149
|
-
this.item = item;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (loadOutItem.ItemName) {
|
|
153
|
-
const [, nemesis] = loadOutItem.ItemName.split('|');
|
|
154
|
-
|
|
155
|
-
if (nemesis !== undefined) {
|
|
156
|
-
this.nemesis = toTitleCase(nemesis);
|
|
157
|
-
} else {
|
|
158
|
-
this.name = loadOutItem.ItemName;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
this.configs = loadOutItem.Configs.map((c) => new ItemConfig(c));
|
|
163
|
-
|
|
164
|
-
if (loadOutItem.UpgradeType) this.upgradeType = loadOutItem.UpgradeType;
|
|
165
|
-
|
|
166
|
-
this.upgradeFingerprint = loadOutItem.UpgradeFingerprint;
|
|
167
|
-
|
|
168
|
-
this.features = loadOutItem.Features;
|
|
169
|
-
|
|
170
|
-
this.upgradeVer = loadOutItem.UpgradeVer;
|
|
171
|
-
|
|
172
|
-
this.xp = loadOutItem.XP;
|
|
173
|
-
|
|
174
|
-
this.polarized = loadOutItem.Polarized;
|
|
175
|
-
|
|
176
|
-
this.polarity = loadOutItem.Polarity?.map((p) => new Polarity(p));
|
|
177
|
-
|
|
178
|
-
this.focuseLens = loadOutItem.FocusLens;
|
|
179
|
-
|
|
180
|
-
this.customizationSlotPurchases = loadOutItem.CustomizationSlotPurchases ?? 0;
|
|
181
|
-
|
|
182
|
-
if (loadOutItem.pricol) this.primaryColor = colors.mapColors(loadOutItem.pricol);
|
|
183
|
-
|
|
184
|
-
if (loadOutItem.sigcol) this.sigilColor = colors.mapColors(loadOutItem.sigcol);
|
|
185
|
-
|
|
186
|
-
this.enablePrime = loadOutItem.ugly ?? false;
|
|
187
|
-
|
|
188
|
-
if (loadOutItem.attcol) this.attachmentsColor = colors.mapColors(loadOutItem.attcol);
|
|
189
|
-
|
|
190
|
-
if (loadOutItem.syancol) this.syandanaColor = colors.mapColors(loadOutItem.syancol);
|
|
191
|
-
|
|
192
|
-
if (loadOutItem.InfestationDate) this.infestationDate = parseDate(loadOutItem.InfestationDate);
|
|
193
|
-
}
|
|
194
|
-
}
|
package/src/OperatorLoadOuts.ts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { colors } from '@wfcd/items/utilities';
|
|
2
|
-
|
|
3
|
-
import Skin from './Skin';
|
|
4
|
-
import { mapToHex, type ProfileRawColors } from './Utils';
|
|
5
|
-
import type { ColorMap } from '@wfcd/items';
|
|
6
|
-
import { Locale } from 'warframe-worldstate-data';
|
|
7
|
-
|
|
8
|
-
export interface RawOperatorLoadOuts {
|
|
9
|
-
Skins: string[];
|
|
10
|
-
OperatorAmp?: { $oid: string };
|
|
11
|
-
Upgrades: string[];
|
|
12
|
-
AbilityOverride: any;
|
|
13
|
-
pricol?: ProfileRawColors;
|
|
14
|
-
sigcol?: ProfileRawColors;
|
|
15
|
-
attcol?: ProfileRawColors;
|
|
16
|
-
syancol?: ProfileRawColors;
|
|
17
|
-
eyecol?: ProfileRawColors;
|
|
18
|
-
facial?: ProfileRawColors;
|
|
19
|
-
cloth?: ProfileRawColors;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Player's operator loadout
|
|
24
|
-
* @module
|
|
25
|
-
*/
|
|
26
|
-
export default class OperatorLoadOuts {
|
|
27
|
-
/**
|
|
28
|
-
* Skins that have been applied to the player's operator.
|
|
29
|
-
*/
|
|
30
|
-
skins: Skin[];
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Operator amp ID
|
|
34
|
-
*/
|
|
35
|
-
operatorAmp?: string;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Applied upgrade IDs
|
|
39
|
-
*/
|
|
40
|
-
upgrades: string[];
|
|
41
|
-
abilityOverride: any;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Operator primary colors
|
|
45
|
-
*/
|
|
46
|
-
primaryColor?: ColorMap;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Operator sigil colors
|
|
50
|
-
*/
|
|
51
|
-
sigilColor?: ColorMap;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Operator attachment colors
|
|
55
|
-
*/
|
|
56
|
-
attachmentsColor?: ColorMap;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Operator syandana colors
|
|
60
|
-
*/
|
|
61
|
-
syandanaColor?: ColorMap;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Operator eye colors
|
|
65
|
-
*/
|
|
66
|
-
eyeColor?: ColorMap;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Operator facial colors
|
|
70
|
-
*/
|
|
71
|
-
facial?: ColorMap;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Operator cloth colors
|
|
75
|
-
*/
|
|
76
|
-
cloth?: ColorMap;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
*
|
|
80
|
-
* @param {Object} loadout The operator loadout
|
|
81
|
-
*/
|
|
82
|
-
constructor(loadout: RawOperatorLoadOuts, locale: Locale = 'en') {
|
|
83
|
-
this.skins = loadout.Skins.filter(Boolean).map((s) => new Skin({ ItemType: s }, locale));
|
|
84
|
-
|
|
85
|
-
this.operatorAmp = loadout.OperatorAmp?.$oid;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Applied upgrade IDs
|
|
89
|
-
* @type {Array<String>}
|
|
90
|
-
*/
|
|
91
|
-
this.upgrades = loadout.Upgrades;
|
|
92
|
-
this.abilityOverride = loadout.AbilityOverride;
|
|
93
|
-
|
|
94
|
-
if (loadout.pricol) this.primaryColor = colors.mapColors(mapToHex(loadout.pricol));
|
|
95
|
-
|
|
96
|
-
if (loadout.sigcol) this.sigilColor = colors.mapColors(mapToHex(loadout.sigcol));
|
|
97
|
-
|
|
98
|
-
if (loadout.attcol) this.attachmentsColor = colors.mapColors(mapToHex(loadout.attcol));
|
|
99
|
-
|
|
100
|
-
if (loadout.syancol) this.syandanaColor = colors.mapColors(mapToHex(loadout.syancol));
|
|
101
|
-
|
|
102
|
-
if (loadout.eyecol) this.eyeColor = colors.mapColors(mapToHex(loadout.eyecol));
|
|
103
|
-
|
|
104
|
-
if (loadout.facial) this.facial = colors.mapColors(mapToHex(loadout.facial));
|
|
105
|
-
|
|
106
|
-
if (loadout.cloth) this.cloth = colors.mapColors(mapToHex(loadout.cloth));
|
|
107
|
-
}
|
|
108
|
-
}
|