@wfcd/profile-parser 2.0.11 → 2.0.13

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.
Files changed (84) hide show
  1. package/dist/Ability.d.mts +1 -1
  2. package/dist/Ability.mjs +24 -3
  3. package/dist/ArchonCrystal.mjs +1 -3
  4. package/dist/ChallengeProgress.d.mts +1 -1
  5. package/dist/ChallengeProgress.mjs +25 -3
  6. package/dist/Enemy.d.mts +1 -1
  7. package/dist/Enemy.mjs +43 -3
  8. package/dist/Intrinsics.d.mts +1 -1
  9. package/dist/Intrinsics.mjs +66 -3
  10. package/dist/{ItemConfig-DxhXby04.d.mts → ItemConfig-C81QdCpU.d.mts} +2 -2
  11. package/dist/ItemConfig.d.mts +1 -3
  12. package/dist/ItemConfig.mjs +48 -5
  13. package/dist/{LoadOutInventory-B84bUV2-.d.mts → LoadOutInventory-BrtoOtNr.d.mts} +3 -3
  14. package/dist/LoadOutInventory.d.mts +1 -6
  15. package/dist/LoadOutInventory.mjs +50 -9
  16. package/dist/{LoadOutItem-DWQ4aFI_.d.mts → LoadOutItem-Cd_qovNn.d.mts} +3 -3
  17. package/dist/LoadOutItem.d.mts +1 -4
  18. package/dist/LoadOutItem.mjs +125 -7
  19. package/dist/LoadOutPreset.d.mts +1 -1
  20. package/dist/LoadOutPreset.mjs +81 -4
  21. package/dist/Mission.d.mts +1 -1
  22. package/dist/Mission.mjs +53 -3
  23. package/dist/{OperatorLoadOuts-51DN5Rwo.d.mts → OperatorLoadOuts-DvlpRvD1.d.mts} +10 -4
  24. package/dist/OperatorLoadOuts.d.mts +1 -3
  25. package/dist/OperatorLoadOuts.mjs +74 -5
  26. package/dist/Polarity.d.mts +1 -1
  27. package/dist/Polarity.mjs +26 -3
  28. package/dist/Profile.d.mts +10 -14
  29. package/dist/Profile.mjs +8 -16
  30. package/dist/ProfileParser.d.mts +5 -11
  31. package/dist/ProfileParser.mjs +3 -16
  32. package/dist/Pvp.d.mts +1 -1
  33. package/dist/Pvp.mjs +35 -3
  34. package/dist/Race.d.mts +1 -1
  35. package/dist/Race.mjs +34 -3
  36. package/dist/Scan.d.mts +1 -1
  37. package/dist/Scan.mjs +26 -3
  38. package/dist/Skin.d.mts +1 -1
  39. package/dist/Skin.mjs +34 -4
  40. package/dist/Stats.d.mts +7 -7
  41. package/dist/Stats.mjs +8 -10
  42. package/dist/Syndicate.d.mts +1 -1
  43. package/dist/Syndicate.mjs +31 -3
  44. package/dist/{Utils-VTFhFHIp.d.mts → Utils-xGSP1zu-.d.mts} +4 -5
  45. package/dist/Utils.d.mts +1 -1
  46. package/dist/Utils.mjs +58 -3
  47. package/dist/Weapon.d.mts +1 -1
  48. package/dist/Weapon.mjs +63 -3
  49. package/dist/XpInfo.d.mts +1 -1
  50. package/dist/XpInfo.mjs +33 -4
  51. package/package.json +11 -12
  52. package/dist/Ability-DsyqxzjP.mjs +0 -25
  53. package/dist/ChallengeProgress-Cpks92At.mjs +0 -26
  54. package/dist/Enemy-B3JSksZZ.mjs +0 -44
  55. package/dist/Intrinsics-kYw_LPq1.mjs +0 -67
  56. package/dist/ItemConfig-DTIrA_P_.mjs +0 -50
  57. package/dist/LoadOutInventory-BbaIazHX.mjs +0 -52
  58. package/dist/LoadOutItem-p-f5RdTB.mjs +0 -127
  59. package/dist/LoadOutPreset-CwbK2VvR.mjs +0 -83
  60. package/dist/Mission-DfGQMV7B.mjs +0 -55
  61. package/dist/OperatorLoadOuts-LYGpTHuj.mjs +0 -76
  62. package/dist/Polarity-Q2JfovbR.mjs +0 -28
  63. package/dist/Pvp-DCfleh26.mjs +0 -36
  64. package/dist/Race-dyrF8Zs5.mjs +0 -35
  65. package/dist/Scan-D4p43-1c.mjs +0 -27
  66. package/dist/Skin-D_brWp2g.mjs +0 -36
  67. package/dist/Syndicate-CcRnzmZs.mjs +0 -33
  68. package/dist/Utils-Bqm2Gg1K.mjs +0 -59
  69. package/dist/Weapon-CsKff27X.mjs +0 -64
  70. package/dist/XpInfo-IT6LOTzI.mjs +0 -35
  71. /package/dist/{Ability-CmHyNfw4.d.mts → Ability-DcXcbtcE.d.mts} +0 -0
  72. /package/dist/{ChallengeProgress-BO8tPybG.d.mts → ChallengeProgress-BrxgSqf4.d.mts} +0 -0
  73. /package/dist/{Enemy-5RVVfZme.d.mts → Enemy-Das_tHF5.d.mts} +0 -0
  74. /package/dist/{Intrinsics-DwonOlUE.d.mts → Intrinsics-BhwKpPoY.d.mts} +0 -0
  75. /package/dist/{LoadOutPreset-m_1RVkf9.d.mts → LoadOutPreset-CUV29lLL.d.mts} +0 -0
  76. /package/dist/{Mission-CeX2BRp0.d.mts → Mission-C7zlZ4eq.d.mts} +0 -0
  77. /package/dist/{Polarity-KCoYUO6f.d.mts → Polarity-BWadoIXU.d.mts} +0 -0
  78. /package/dist/{Pvp-R4iYmiAT.d.mts → Pvp-D0lygyP6.d.mts} +0 -0
  79. /package/dist/{Race-DXOXL9VT.d.mts → Race-PxkzCRsy.d.mts} +0 -0
  80. /package/dist/{Scan-CJnYpzKb.d.mts → Scan-Cj6jCTNg.d.mts} +0 -0
  81. /package/dist/{Skin-DJMr6L-X.d.mts → Skin-CpQ4dzEs.d.mts} +0 -0
  82. /package/dist/{Syndicate-Dq5vLEB-.d.mts → Syndicate-BwHRq-Iw.d.mts} +0 -0
  83. /package/dist/{Weapon-DgQ4hNgE.d.mts → Weapon-DUlgoPHD.d.mts} +0 -0
  84. /package/dist/{XpInfo-qplT5008.d.mts → XpInfo-C1pzVAdK.d.mts} +0 -0
@@ -1,76 +0,0 @@
1
- import { n as mapToHex } from "./Utils-Bqm2Gg1K.mjs";
2
- import { t as Skin } from "./Skin-D_brWp2g.mjs";
3
- import { colors } from "@wfcd/items/utilities";
4
-
5
- //#region src/OperatorLoadOuts.ts
6
- /**
7
- * Player's operator loadout
8
- * @module
9
- */
10
- var OperatorLoadOuts = class {
11
- /**
12
- * Skins that have been applied to the player's operator.
13
- */
14
- skins;
15
- /**
16
- * Operator amp ID
17
- */
18
- operatorAmp;
19
- /**
20
- * Applied upgrade IDs
21
- */
22
- upgrades;
23
- abilityOverride;
24
- /**
25
- * Operator primary colors
26
- */
27
- primaryColor;
28
- /**
29
- * Operator sigil colors
30
- */
31
- sigilColor;
32
- /**
33
- * Operator attachment colors
34
- */
35
- attachmentsColor;
36
- /**
37
- * Operator syandana colors
38
- */
39
- syandanaColor;
40
- /**
41
- * Operator eye colors
42
- */
43
- eyeColor;
44
- /**
45
- * Operator facial colors
46
- */
47
- facial;
48
- /**
49
- * Operator cloth colors
50
- */
51
- cloth;
52
- /**
53
- *
54
- * @param {Object} loadout The operator loadout
55
- */
56
- constructor(loadout, locale = "en") {
57
- this.skins = loadout.Skins.filter(Boolean).map((s) => new Skin({ ItemType: s }, locale));
58
- this.operatorAmp = loadout.OperatorAmp?.$oid;
59
- /**
60
- * Applied upgrade IDs
61
- * @type {Array<String>}
62
- */
63
- this.upgrades = loadout.Upgrades;
64
- this.abilityOverride = loadout.AbilityOverride;
65
- if (loadout.pricol) this.primaryColor = colors.mapColors(mapToHex(loadout.pricol));
66
- if (loadout.sigcol) this.sigilColor = colors.mapColors(mapToHex(loadout.sigcol));
67
- if (loadout.attcol) this.attachmentsColor = colors.mapColors(mapToHex(loadout.attcol));
68
- if (loadout.syancol) this.syandanaColor = colors.mapColors(mapToHex(loadout.syancol));
69
- if (loadout.eyecol) this.eyeColor = colors.mapColors(mapToHex(loadout.eyecol));
70
- if (loadout.facial) this.facial = colors.mapColors(mapToHex(loadout.facial));
71
- if (loadout.cloth) this.cloth = colors.mapColors(mapToHex(loadout.cloth));
72
- }
73
- };
74
-
75
- //#endregion
76
- export { OperatorLoadOuts as t };
@@ -1,28 +0,0 @@
1
- import { translatePolarity } from "warframe-worldstate-data/utilities";
2
-
3
- //#region src/Polarity.ts
4
- /**
5
- * A polarity in a LoadOutItem
6
- * @module
7
- */
8
- var Polarity = class {
9
- /**
10
- * Polarity name
11
- */
12
- polarity;
13
- /**
14
- * Polarized slot
15
- */
16
- slot;
17
- /**
18
- *
19
- * @param {Object} raw The polarity to parse
20
- */
21
- constructor(raw) {
22
- this.polarity = translatePolarity(raw.Value);
23
- this.slot = raw.Slot;
24
- }
25
- };
26
-
27
- //#endregion
28
- export { Polarity as t };
@@ -1,36 +0,0 @@
1
- //#region src/Pvp.ts
2
- /**
3
- * Player's conclave stats
4
- * @module
5
- */
6
- var Pvp = class {
7
- /**
8
- * PVP match unique name
9
- */
10
- uniqueName;
11
- /**
12
- * Deaths for this match
13
- */
14
- warframeDeaths;
15
- /**
16
- * Warframe kills
17
- */
18
- warframeKills;
19
- /**
20
- * Weapon killes
21
- */
22
- weaponKills;
23
- /**
24
- *
25
- * @param {Object} pvp PVP data to parse
26
- */
27
- constructor(pvp) {
28
- this.uniqueName = pvp.type;
29
- this.warframeDeaths = pvp.suitDeaths;
30
- this.warframeKills = pvp.suitKills;
31
- this.weaponKills = pvp.weaponKills;
32
- }
33
- };
34
-
35
- //#endregion
36
- export { Pvp as t };
@@ -1,35 +0,0 @@
1
- //#region src/Race.ts
2
- /**
3
- * Represents a k-drive race
4
- * @module
5
- */
6
- var Race = class Race {
7
- /**
8
- * Race name
9
- */
10
- uniqueName;
11
- /**
12
- * Race High score
13
- */
14
- highScore;
15
- /**
16
- *
17
- * @param type Race name
18
- * @param highScore high score
19
- */
20
- constructor(type, highScore) {
21
- this.uniqueName = type;
22
- this.highScore = highScore;
23
- }
24
- /**
25
- * Created an array of Race objects from DE's Races array
26
- * @param races Array of races
27
- * @returns {Race[]} An array of races formatted in a more consumable way.
28
- */
29
- static fromRaceObject(races) {
30
- return Object.entries(races ?? {}).map(([type, { highScore }]) => new Race(type, highScore));
31
- }
32
- };
33
-
34
- //#endregion
35
- export { Race as t };
@@ -1,27 +0,0 @@
1
- //#region src/Scan.ts
2
- /**
3
- * Represents an enemy scanned to the codex
4
- * @module
5
- */
6
- var Scan = class {
7
- /**
8
- * Enemy unique name
9
- * @type {String}
10
- */
11
- uniqueName;
12
- /**
13
- * Number of scans done
14
- * @type {number}
15
- */
16
- scans;
17
- /**
18
- * @param {Object} scan The scanned Warframe object
19
- */
20
- constructor(scan) {
21
- this.uniqueName = scan.type;
22
- this.scans = scan.scans;
23
- }
24
- };
25
-
26
- //#endregion
27
- export { Scan as t };
@@ -1,36 +0,0 @@
1
- import { t as find } from "./Utils-Bqm2Gg1K.mjs";
2
-
3
- //#region src/Skin.ts
4
- /**
5
- * A skin class
6
- * @module
7
- */
8
- var Skin = class {
9
- uniqueName;
10
- item;
11
- /**
12
- *
13
- * @param skin The skin data to parse
14
- * @param locale The locale to return skin item in
15
- */
16
- constructor(skin, locale = "en") {
17
- /**
18
- * Unique name
19
- */
20
- this.uniqueName = skin.ItemType;
21
- const item = find(skin.ItemType, locale);
22
- /**
23
- * The Warframe item that matches the unique name
24
- */
25
- if (item) this.item = item;
26
- }
27
- };
28
- /**
29
- * @deprecated Move to Skin, this is just here to not break anything for early users
30
- * @param {Object} skin Skin object
31
- * @returns {Skin} Skin object with possible item
32
- */
33
- const WeaponSkin = (skin) => new Skin(skin);
34
-
35
- //#endregion
36
- export { WeaponSkin as n, Skin as t };
@@ -1,33 +0,0 @@
1
- import { syndicate } from "warframe-worldstate-data/utilities";
2
-
3
- //#region src/Syndicate.ts
4
- /**
5
- * Represents a syndicate
6
- * @module
7
- */
8
- var Syndicate = class {
9
- /**
10
- * Name of the syndicate
11
- */
12
- name;
13
- /**
14
- * Current standing the player has with the syndicate
15
- */
16
- standing;
17
- /**
18
- * The player's current syndicate title
19
- */
20
- title;
21
- /**
22
- * @param affiliation The syndicate data
23
- * @param locale locale code
24
- */
25
- constructor(affiliation, locale = "en") {
26
- this.name = syndicate(affiliation.Tag, locale);
27
- this.standing = affiliation.Standing;
28
- this.title = affiliation.Title;
29
- }
30
- };
31
-
32
- //#endregion
33
- export { Syndicate as t };
@@ -1,59 +0,0 @@
1
- import Items from "@wfcd/items";
2
-
3
- //#region src/Utils.ts
4
- /**
5
- * Map base10 int colors to hex color strings
6
- * @param colors color map
7
- */
8
- const mapToHex = (colors) => {
9
- const hex = {};
10
- Object.entries(colors).forEach(([key, value]) => {
11
- if (value) hex[key] = Math.abs(value).toString(16).toUpperCase();
12
- });
13
- return hex;
14
- };
15
- const categories = [
16
- "Skins",
17
- "Primary",
18
- "Secondary",
19
- "Melee",
20
- "Arch-Melee",
21
- "Arch-Gun",
22
- "Warframes",
23
- "Archwing",
24
- "Sentinels",
25
- "Pets"
26
- ];
27
- /**
28
- * Find an item by Item#uniqueName
29
- * @param name string with which to query
30
- * @param locale locale to use for internationalization
31
- * @returns {Item}
32
- */
33
- const find = (name, locale = "en") => {
34
- const item = new Items({
35
- category: categories,
36
- i18n: [locale],
37
- i18nOnObject: true
38
- }).find((i) => i.uniqueName === name);
39
- let itemClone = { ...item };
40
- if (locale !== "en" && itemClone.i18n[locale] && itemClone.i18n[locale]) {
41
- itemClone = {
42
- ...itemClone,
43
- ...itemClone.i18n[locale]
44
- };
45
- if (itemClone.abilities) itemClone.abilities = itemClone.abilities.map((ability) => ({
46
- uniqueName: ability.abilityUniqueName || ability.uniqueName || void 0,
47
- name: ability.abilityName || ability.name,
48
- description: ability.abilityDescription || ability.description,
49
- imageName: ability.imageName ?? void 0
50
- }));
51
- delete itemClone.i18n;
52
- return itemClone;
53
- }
54
- return item;
55
- };
56
- const numberToLetter = (num) => String.fromCharCode(64 + (num + 1));
57
-
58
- //#endregion
59
- export { mapToHex as n, numberToLetter as r, find as t };
@@ -1,64 +0,0 @@
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 as t };
@@ -1,35 +0,0 @@
1
- import { t as find } from "./Utils-Bqm2Gg1K.mjs";
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 as t };
File without changes