@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,5 +1,5 @@
1
- import { n as Skin } from "./Skin-DJMr6L-X.mjs";
2
- import { t as ProfileRawColors } from "./Utils-VTFhFHIp.mjs";
1
+ import { n as Skin } from "./Skin-CpQ4dzEs.mjs";
2
+ import { t as ProfileRawColors } from "./Utils-xGSP1zu-.mjs";
3
3
  import { ColorMap } from "@wfcd/items";
4
4
  import { Locale } from "warframe-worldstate-data";
5
5
 
@@ -10,7 +10,10 @@ interface RawOperatorLoadOuts {
10
10
  $oid: string;
11
11
  };
12
12
  Upgrades: string[];
13
- AbilityOverride: any;
13
+ AbilityOverride: {
14
+ Ability: string;
15
+ Index: number;
16
+ };
14
17
  pricol?: ProfileRawColors;
15
18
  sigcol?: ProfileRawColors;
16
19
  attcol?: ProfileRawColors;
@@ -36,7 +39,10 @@ declare class OperatorLoadOuts {
36
39
  * Applied upgrade IDs
37
40
  */
38
41
  upgrades: string[];
39
- abilityOverride: any;
42
+ abilityOverride: {
43
+ Ability: string;
44
+ Index: number;
45
+ };
40
46
  /**
41
47
  * Operator primary colors
42
48
  */
@@ -1,4 +1,2 @@
1
- import "./Skin-DJMr6L-X.mjs";
2
- import "./Utils-VTFhFHIp.mjs";
3
- import { n as RawOperatorLoadOuts, t as OperatorLoadOuts } from "./OperatorLoadOuts-51DN5Rwo.mjs";
1
+ import { n as RawOperatorLoadOuts, t as OperatorLoadOuts } from "./OperatorLoadOuts-DvlpRvD1.mjs";
4
2
  export { RawOperatorLoadOuts, OperatorLoadOuts as default };
@@ -1,5 +1,74 @@
1
- import "./Utils-Bqm2Gg1K.mjs";
2
- import "./Skin-D_brWp2g.mjs";
3
- import { t as OperatorLoadOuts } from "./OperatorLoadOuts-LYGpTHuj.mjs";
4
-
5
- export { OperatorLoadOuts as default };
1
+ import { mapToHex } from "./Utils.mjs";
2
+ import Skin from "./Skin.mjs";
3
+ import { colors } from "@wfcd/items/utilities";
4
+ //#region src/OperatorLoadOuts.ts
5
+ /**
6
+ * Player's operator loadout
7
+ * @module
8
+ */
9
+ var OperatorLoadOuts = class {
10
+ /**
11
+ * Skins that have been applied to the player's operator.
12
+ */
13
+ skins;
14
+ /**
15
+ * Operator amp ID
16
+ */
17
+ operatorAmp;
18
+ /**
19
+ * Applied upgrade IDs
20
+ */
21
+ upgrades;
22
+ abilityOverride;
23
+ /**
24
+ * Operator primary colors
25
+ */
26
+ primaryColor;
27
+ /**
28
+ * Operator sigil colors
29
+ */
30
+ sigilColor;
31
+ /**
32
+ * Operator attachment colors
33
+ */
34
+ attachmentsColor;
35
+ /**
36
+ * Operator syandana colors
37
+ */
38
+ syandanaColor;
39
+ /**
40
+ * Operator eye colors
41
+ */
42
+ eyeColor;
43
+ /**
44
+ * Operator facial colors
45
+ */
46
+ facial;
47
+ /**
48
+ * Operator cloth colors
49
+ */
50
+ cloth;
51
+ /**
52
+ *
53
+ * @param {Object} loadout The operator loadout
54
+ */
55
+ constructor(loadout, locale = "en") {
56
+ this.skins = loadout.Skins.filter(Boolean).map((s) => new Skin({ ItemType: s }, locale));
57
+ this.operatorAmp = loadout.OperatorAmp?.$oid;
58
+ /**
59
+ * Applied upgrade IDs
60
+ * @type {Array<String>}
61
+ */
62
+ this.upgrades = loadout.Upgrades;
63
+ this.abilityOverride = loadout.AbilityOverride;
64
+ if (loadout.pricol) this.primaryColor = colors.mapColors(mapToHex(loadout.pricol));
65
+ if (loadout.sigcol) this.sigilColor = colors.mapColors(mapToHex(loadout.sigcol));
66
+ if (loadout.attcol) this.attachmentsColor = colors.mapColors(mapToHex(loadout.attcol));
67
+ if (loadout.syancol) this.syandanaColor = colors.mapColors(mapToHex(loadout.syancol));
68
+ if (loadout.eyecol) this.eyeColor = colors.mapColors(mapToHex(loadout.eyecol));
69
+ if (loadout.facial) this.facial = colors.mapColors(mapToHex(loadout.facial));
70
+ if (loadout.cloth) this.cloth = colors.mapColors(mapToHex(loadout.cloth));
71
+ }
72
+ };
73
+ //#endregion
74
+ export { OperatorLoadOuts as default };
@@ -1,2 +1,2 @@
1
- import { n as RawPolarity, t as Polarity } from "./Polarity-KCoYUO6f.mjs";
1
+ import { n as RawPolarity, t as Polarity } from "./Polarity-BWadoIXU.mjs";
2
2
  export { RawPolarity, Polarity as default };
package/dist/Polarity.mjs CHANGED
@@ -1,3 +1,26 @@
1
- import { t as Polarity } from "./Polarity-Q2JfovbR.mjs";
2
-
3
- export { Polarity as default };
1
+ import { translatePolarity } from "warframe-worldstate-data/utilities";
2
+ //#region src/Polarity.ts
3
+ /**
4
+ * A polarity in a LoadOutItem
5
+ * @module
6
+ */
7
+ var Polarity = class {
8
+ /**
9
+ * Polarity name
10
+ */
11
+ polarity;
12
+ /**
13
+ * Polarized slot
14
+ */
15
+ slot;
16
+ /**
17
+ *
18
+ * @param {Object} raw The polarity to parse
19
+ */
20
+ constructor(raw) {
21
+ this.polarity = translatePolarity(raw.Value);
22
+ this.slot = raw.Slot;
23
+ }
24
+ };
25
+ //#endregion
26
+ export { Polarity as default };
@@ -1,15 +1,11 @@
1
- import { n as RawChallengeProgress, t as ChallengeProgress } from "./ChallengeProgress-BO8tPybG.mjs";
2
- import { n as RawIntrinsics, t as Intrinsics } from "./Intrinsics-DwonOlUE.mjs";
3
- import "./Skin-DJMr6L-X.mjs";
4
- import { n as RawDate, r as RawId } from "./Utils-VTFhFHIp.mjs";
5
- import "./ItemConfig-DxhXby04.mjs";
6
- import "./LoadOutItem-DWQ4aFI_.mjs";
7
- import "./XpInfo-qplT5008.mjs";
8
- import { n as RawLoadOut, t as LoadOutInventory } from "./LoadOutInventory-B84bUV2-.mjs";
9
- import { n as RawLoadOutPreset, t as LoadOutPreset } from "./LoadOutPreset-m_1RVkf9.mjs";
10
- import { n as RawMission, t as Mission } from "./Mission-CeX2BRp0.mjs";
11
- import { n as RawOperatorLoadOuts, t as OperatorLoadOuts } from "./OperatorLoadOuts-51DN5Rwo.mjs";
12
- import { n as Syndicate, t as RawAffiliation } from "./Syndicate-Dq5vLEB-.mjs";
1
+ import { n as RawChallengeProgress, t as ChallengeProgress } from "./ChallengeProgress-BrxgSqf4.mjs";
2
+ import { n as RawIntrinsics, t as Intrinsics } from "./Intrinsics-BhwKpPoY.mjs";
3
+ import { n as RawDate, r as RawId } from "./Utils-xGSP1zu-.mjs";
4
+ import { n as RawLoadOut, t as LoadOutInventory } from "./LoadOutInventory-BrtoOtNr.mjs";
5
+ import { n as RawLoadOutPreset, t as LoadOutPreset } from "./LoadOutPreset-CUV29lLL.mjs";
6
+ import { n as RawMission, t as Mission } from "./Mission-C7zlZ4eq.mjs";
7
+ import { n as RawOperatorLoadOuts, t as OperatorLoadOuts } from "./OperatorLoadOuts-DvlpRvD1.mjs";
8
+ import { n as Syndicate, t as RawAffiliation } from "./Syndicate-BwHRq-Iw.mjs";
13
9
  import { Locale } from "warframe-worldstate-data";
14
10
 
15
11
  //#region src/Profile.d.ts
@@ -53,7 +49,7 @@ interface RawProfile {
53
49
  DailyAffiliationCavia?: number;
54
50
  DailyAffiliationHex?: number;
55
51
  DailyFocus?: number;
56
- Wishlist?: any;
52
+ Wishlist?: string[];
57
53
  UnlockedOperator: boolean;
58
54
  UnlockedAlignment: boolean;
59
55
  OperatorLoadOuts: RawOperatorLoadOuts[];
@@ -184,7 +180,7 @@ declare class Profile {
184
180
  /**
185
181
  * Player wishlist for in-game market items
186
182
  */
187
- wishList: any;
183
+ wishList?: string[];
188
184
  /**
189
185
  * Whether the player has unlocked their operator or not
190
186
  */
package/dist/Profile.mjs CHANGED
@@ -1,18 +1,11 @@
1
- import { t as ChallengeProgress } from "./ChallengeProgress-Cpks92At.mjs";
2
- import { t as Intrinsics } from "./Intrinsics-kYw_LPq1.mjs";
3
- import "./Utils-Bqm2Gg1K.mjs";
4
- import "./Skin-D_brWp2g.mjs";
5
- import "./ItemConfig-DTIrA_P_.mjs";
6
- import "./Polarity-Q2JfovbR.mjs";
7
- import "./LoadOutItem-p-f5RdTB.mjs";
8
- import "./XpInfo-IT6LOTzI.mjs";
9
- import { t as LoadOutInventory } from "./LoadOutInventory-BbaIazHX.mjs";
10
- import { t as LoadOutPreset } from "./LoadOutPreset-CwbK2VvR.mjs";
11
- import { t as Mission } from "./Mission-DfGQMV7B.mjs";
12
- import { t as OperatorLoadOuts } from "./OperatorLoadOuts-LYGpTHuj.mjs";
13
- import { t as Syndicate } from "./Syndicate-CcRnzmZs.mjs";
1
+ import ChallengeProgress from "./ChallengeProgress.mjs";
2
+ import Intrinsics from "./Intrinsics.mjs";
3
+ import LoadOutInventory from "./LoadOutInventory.mjs";
4
+ import LoadOutPreset from "./LoadOutPreset.mjs";
5
+ import Mission from "./Mission.mjs";
6
+ import OperatorLoadOuts from "./OperatorLoadOuts.mjs";
7
+ import Syndicate from "./Syndicate.mjs";
14
8
  import { parseDate } from "warframe-worldstate-data/utilities";
15
-
16
9
  //#region src/Profile.ts
17
10
  /**
18
11
  * A player's profile
@@ -194,6 +187,5 @@ var Profile = class {
194
187
  };
195
188
  }
196
189
  };
197
-
198
190
  //#endregion
199
- export { Profile as default };
191
+ export { Profile as default };
@@ -1,10 +1,4 @@
1
- import "./Skin-DJMr6L-X.mjs";
2
- import { n as RawDate } from "./Utils-VTFhFHIp.mjs";
3
- import "./ItemConfig-DxhXby04.mjs";
4
- import "./LoadOutItem-DWQ4aFI_.mjs";
5
- import "./XpInfo-qplT5008.mjs";
6
- import "./LoadOutInventory-B84bUV2-.mjs";
7
- import "./OperatorLoadOuts-51DN5Rwo.mjs";
1
+ import { n as RawDate } from "./Utils-xGSP1zu-.mjs";
8
2
  import Profile, { RawProfile } from "./Profile.mjs";
9
3
  import Stats, { RawStats } from "./Stats.mjs";
10
4
  import { Locale } from "warframe-worldstate-data";
@@ -12,8 +6,8 @@ import { Locale } from "warframe-worldstate-data";
12
6
  //#region src/ProfileParser.d.ts
13
7
  interface ProfileData {
14
8
  Results: RawProfile[];
15
- TechProjects?: any;
16
- XpCompoents?: any;
9
+ TechProjects?: Array<object>;
10
+ XpComponents?: Array<object>;
17
11
  XpCacheExpiryDate?: RawDate;
18
12
  CeremonyResetDate?: RawDate;
19
13
  Stats: RawStats;
@@ -30,11 +24,11 @@ declare class ProfileParser {
30
24
  /**
31
25
  * N/A
32
26
  */
33
- techProjects: any;
27
+ techProjects: Array<object>;
34
28
  /**
35
29
  * N/A
36
30
  */
37
- xpComponents: any;
31
+ xpComponents: Array<object>;
38
32
  /**
39
33
  * N/A
40
34
  */
@@ -1,18 +1,6 @@
1
- import "./Utils-Bqm2Gg1K.mjs";
2
- import "./Skin-D_brWp2g.mjs";
3
- import "./ItemConfig-DTIrA_P_.mjs";
4
- import "./Polarity-Q2JfovbR.mjs";
5
- import "./LoadOutItem-p-f5RdTB.mjs";
6
- import "./XpInfo-IT6LOTzI.mjs";
7
- import "./LoadOutInventory-BbaIazHX.mjs";
8
- import "./LoadOutPreset-CwbK2VvR.mjs";
9
- import "./Mission-DfGQMV7B.mjs";
10
- import "./OperatorLoadOuts-LYGpTHuj.mjs";
11
- import "./Syndicate-CcRnzmZs.mjs";
12
1
  import Profile from "./Profile.mjs";
13
2
  import Stats from "./Stats.mjs";
14
3
  import { parseDate } from "warframe-worldstate-data/utilities";
15
-
16
4
  //#region src/ProfileParser.ts
17
5
  /**
18
6
  * Parser entry point
@@ -51,13 +39,12 @@ var ProfileParser = class {
51
39
  */
52
40
  constructor(data, locale = "en", withItem = false) {
53
41
  this.profile = new Profile(data.Results[0], locale, withItem);
54
- this.techProjects = data.TechProjects;
55
- this.xpComponents = data.XpCompoents;
42
+ this.techProjects = data.TechProjects ?? [];
43
+ this.xpComponents = data.XpComponents ?? [];
56
44
  this.xpCacheExpiryDate = parseDate(data.XpCacheExpiryDate);
57
45
  this.ceremonyResetDate = parseDate(data.CeremonyResetDate);
58
46
  this.stats = new Stats(data.Stats);
59
47
  }
60
48
  };
61
-
62
49
  //#endregion
63
- export { ProfileParser as default };
50
+ export { ProfileParser as default };
package/dist/Pvp.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as RawPvp, t as Pvp } from "./Pvp-R4iYmiAT.mjs";
1
+ import { n as RawPvp, t as Pvp } from "./Pvp-D0lygyP6.mjs";
2
2
  export { RawPvp, Pvp as default };
package/dist/Pvp.mjs CHANGED
@@ -1,3 +1,35 @@
1
- import { t as Pvp } from "./Pvp-DCfleh26.mjs";
2
-
3
- export { Pvp as default };
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
+ //#endregion
35
+ export { Pvp as default };
package/dist/Race.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as RawRace, t as Race } from "./Race-DXOXL9VT.mjs";
1
+ import { n as RawRace, t as Race } from "./Race-PxkzCRsy.mjs";
2
2
  export { RawRace, Race as default };
package/dist/Race.mjs CHANGED
@@ -1,3 +1,34 @@
1
- import { t as Race } from "./Race-dyrF8Zs5.mjs";
2
-
3
- export { Race as default };
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
+ //#endregion
34
+ export { Race as default };
package/dist/Scan.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as Scan, t as RawScan } from "./Scan-CJnYpzKb.mjs";
1
+ import { n as Scan, t as RawScan } from "./Scan-Cj6jCTNg.mjs";
2
2
  export { RawScan, Scan as default };
package/dist/Scan.mjs CHANGED
@@ -1,3 +1,26 @@
1
- import { t as Scan } from "./Scan-D4p43-1c.mjs";
2
-
3
- export { Scan as default };
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
+ //#endregion
26
+ export { Scan as default };
package/dist/Skin.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as Skin, r as WeaponSkin, t as RawSkin } from "./Skin-DJMr6L-X.mjs";
1
+ import { n as Skin, r as WeaponSkin, t as RawSkin } from "./Skin-CpQ4dzEs.mjs";
2
2
  export { RawSkin, WeaponSkin, Skin as default };
package/dist/Skin.mjs CHANGED
@@ -1,4 +1,34 @@
1
- import "./Utils-Bqm2Gg1K.mjs";
2
- import { n as WeaponSkin, t as Skin } from "./Skin-D_brWp2g.mjs";
3
-
4
- export { WeaponSkin, Skin as default };
1
+ import { find } from "./Utils.mjs";
2
+ //#region src/Skin.ts
3
+ /**
4
+ * A skin class
5
+ * @module
6
+ */
7
+ var Skin = class {
8
+ uniqueName;
9
+ item;
10
+ /**
11
+ *
12
+ * @param skin The skin data to parse
13
+ * @param locale The locale to return skin item in
14
+ */
15
+ constructor(skin, locale = "en") {
16
+ /**
17
+ * Unique name
18
+ */
19
+ this.uniqueName = skin.ItemType;
20
+ const item = find(skin.ItemType, locale);
21
+ /**
22
+ * The Warframe item that matches the unique name
23
+ */
24
+ if (item) this.item = item;
25
+ }
26
+ };
27
+ /**
28
+ * @deprecated Move to Skin, this is just here to not break anything for early users
29
+ * @param {Object} skin Skin object
30
+ * @returns {Skin} Skin object with possible item
31
+ */
32
+ const WeaponSkin = (skin) => new Skin(skin);
33
+ //#endregion
34
+ export { WeaponSkin, Skin as default };
package/dist/Stats.d.mts CHANGED
@@ -1,10 +1,10 @@
1
- import { n as RawAbility, t as Ability } from "./Ability-CmHyNfw4.mjs";
2
- import { n as RawEnemy, t as Enemy } from "./Enemy-5RVVfZme.mjs";
3
- import { n as RawMission, t as Mission } from "./Mission-CeX2BRp0.mjs";
4
- import { n as RawPvp, t as Pvp } from "./Pvp-R4iYmiAT.mjs";
5
- import { n as RawRace, t as Race } from "./Race-DXOXL9VT.mjs";
6
- import { n as Scan, t as RawScan } from "./Scan-CJnYpzKb.mjs";
7
- import { n as Weapon, t as RawWeapon } from "./Weapon-DgQ4hNgE.mjs";
1
+ import { n as RawAbility, t as Ability } from "./Ability-DcXcbtcE.mjs";
2
+ import { n as RawEnemy, t as Enemy } from "./Enemy-Das_tHF5.mjs";
3
+ import { n as RawMission, t as Mission } from "./Mission-C7zlZ4eq.mjs";
4
+ import { n as RawPvp, t as Pvp } from "./Pvp-D0lygyP6.mjs";
5
+ import { n as RawRace, t as Race } from "./Race-PxkzCRsy.mjs";
6
+ import { n as Scan, t as RawScan } from "./Scan-Cj6jCTNg.mjs";
7
+ import { n as Weapon, t as RawWeapon } from "./Weapon-DUlgoPHD.mjs";
8
8
 
9
9
  //#region src/Stats.d.ts
10
10
  interface RawStats {
package/dist/Stats.mjs CHANGED
@@ -1,11 +1,10 @@
1
- import { t as Ability } from "./Ability-DsyqxzjP.mjs";
2
- import { t as Enemy } from "./Enemy-B3JSksZZ.mjs";
3
- import { t as Mission } from "./Mission-DfGQMV7B.mjs";
4
- import { t as Pvp } from "./Pvp-DCfleh26.mjs";
5
- import { t as Race } from "./Race-dyrF8Zs5.mjs";
6
- import { t as Scan } from "./Scan-D4p43-1c.mjs";
7
- import { t as Weapon } from "./Weapon-CsKff27X.mjs";
8
-
1
+ import Ability from "./Ability.mjs";
2
+ import Enemy from "./Enemy.mjs";
3
+ import Mission from "./Mission.mjs";
4
+ import Pvp from "./Pvp.mjs";
5
+ import Race from "./Race.mjs";
6
+ import Scan from "./Scan.mjs";
7
+ import Weapon from "./Weapon.mjs";
9
8
  //#region src/Stats.ts
10
9
  /**
11
10
  * A player's overall career stats
@@ -300,6 +299,5 @@ var Stats = class {
300
299
  if (stats.InfestedEventScore) this.infestedEventScore = stats.InfestedEventScore;
301
300
  }
302
301
  };
303
-
304
302
  //#endregion
305
- export { Stats as default };
303
+ export { Stats as default };
@@ -1,2 +1,2 @@
1
- import { n as Syndicate, t as RawAffiliation } from "./Syndicate-Dq5vLEB-.mjs";
1
+ import { n as Syndicate, t as RawAffiliation } from "./Syndicate-BwHRq-Iw.mjs";
2
2
  export { RawAffiliation, Syndicate as default };
@@ -1,3 +1,31 @@
1
- import { t as Syndicate } from "./Syndicate-CcRnzmZs.mjs";
2
-
3
- export { Syndicate as default };
1
+ import { syndicate } from "warframe-worldstate-data/utilities";
2
+ //#region src/Syndicate.ts
3
+ /**
4
+ * Represents a syndicate
5
+ * @module
6
+ */
7
+ var Syndicate = class {
8
+ /**
9
+ * Name of the syndicate
10
+ */
11
+ name;
12
+ /**
13
+ * Current standing the player has with the syndicate
14
+ */
15
+ standing;
16
+ /**
17
+ * The player's current syndicate title
18
+ */
19
+ title;
20
+ /**
21
+ * @param affiliation The syndicate data
22
+ * @param locale locale code
23
+ */
24
+ constructor(affiliation, locale = "en") {
25
+ this.name = syndicate(affiliation.Tag, locale);
26
+ this.standing = affiliation.Standing;
27
+ this.title = affiliation.Title;
28
+ }
29
+ };
30
+ //#endregion
31
+ export { Syndicate as default };
@@ -1,8 +1,7 @@
1
1
  import { WorldStateDate } from "warframe-worldstate-data/utilities";
2
- import { RawColors } from "@wfcd/items";
2
+ import { Item, RawColors } from "@wfcd/items";
3
3
 
4
4
  //#region src/Utils.d.ts
5
-
6
5
  /**
7
6
  * interface for DE's ID data
8
7
  */
@@ -27,11 +26,11 @@ interface ProfileRawColors {
27
26
  declare const mapToHex: (colors: ProfileRawColors) => RawColors;
28
27
  /**
29
28
  * Find an item by Item#uniqueName
30
- * @param name string with which to query
31
- * @param locale locale to use for internationalization
29
+ * @param {string} name string with which to query
30
+ * @param {string} locale locale to use for internationalization
32
31
  * @returns {Item}
33
32
  */
34
- declare const find: (name: string, locale?: string) => any;
33
+ declare const find: (name: string, locale?: string) => Item;
35
34
  declare const numberToLetter: (num: number) => string;
36
35
  //#endregion
37
36
  export { mapToHex as a, find as i, RawDate as n, numberToLetter as o, RawId as r, ProfileRawColors as t };
package/dist/Utils.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as mapToHex, i as find, n as RawDate, o as numberToLetter, r as RawId, t as ProfileRawColors } from "./Utils-VTFhFHIp.mjs";
1
+ import { a as mapToHex, i as find, n as RawDate, o as numberToLetter, r as RawId, t as ProfileRawColors } from "./Utils-xGSP1zu-.mjs";
2
2
  export { ProfileRawColors, RawDate, RawId, find, mapToHex, numberToLetter };
package/dist/Utils.mjs CHANGED
@@ -1,3 +1,58 @@
1
- import { n as mapToHex, r as numberToLetter, t as find } from "./Utils-Bqm2Gg1K.mjs";
2
-
3
- export { find, mapToHex, numberToLetter };
1
+ import Items from "@wfcd/items";
2
+ //#region src/Utils.ts
3
+ /**
4
+ * Map base10 int colors to hex color strings
5
+ * @param colors color map
6
+ */
7
+ const mapToHex = (colors) => {
8
+ const hex = {};
9
+ Object.entries(colors).forEach(([key, value]) => {
10
+ if (value) hex[key] = Math.abs(value).toString(16).toUpperCase();
11
+ });
12
+ return hex;
13
+ };
14
+ const categories = [
15
+ "Skins",
16
+ "Primary",
17
+ "Secondary",
18
+ "Melee",
19
+ "Arch-Melee",
20
+ "Arch-Gun",
21
+ "Warframes",
22
+ "Archwing",
23
+ "Sentinels",
24
+ "Pets"
25
+ ];
26
+ /**
27
+ * Find an item by Item#uniqueName
28
+ * @param {string} name string with which to query
29
+ * @param {string} locale locale to use for internationalization
30
+ * @returns {Item}
31
+ */
32
+ const find = (name, locale = "en") => {
33
+ const item = new Items({
34
+ category: categories,
35
+ i18n: [locale],
36
+ i18nOnObject: true
37
+ }).find((i) => i.uniqueName === name);
38
+ let itemClone = { ...item };
39
+ if (locale !== "en" && itemClone.i18n?.[locale]) {
40
+ itemClone = {
41
+ ...itemClone,
42
+ ...itemClone.i18n[locale]
43
+ };
44
+ const warframe = itemClone;
45
+ if (warframe.abilities) warframe.abilities = warframe.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
+ //#endregion
58
+ export { find, mapToHex, numberToLetter };
package/dist/Weapon.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as Weapon, t as RawWeapon } from "./Weapon-DgQ4hNgE.mjs";
1
+ import { n as Weapon, t as RawWeapon } from "./Weapon-DUlgoPHD.mjs";
2
2
  export { RawWeapon, Weapon as default };