@wfcd/profile-parser 1.4.1 → 2.0.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.
Files changed (65) hide show
  1. package/package.json +33 -82
  2. package/src/{Ability.js → Ability.ts} +11 -4
  3. package/src/{ArchonCrystal.js → ArchonCrystal.ts} +12 -5
  4. package/src/{ChallengeProgress.js → ChallengeProgress.ts} +11 -4
  5. package/src/Enemy.ts +55 -0
  6. package/src/Intrinsics.ts +98 -0
  7. package/src/ItemConfig.ts +71 -0
  8. package/src/LoadOutInventory.ts +69 -0
  9. package/src/LoadOutItem.ts +194 -0
  10. package/src/LoadOutPreset.ts +122 -0
  11. package/src/Mission.ts +75 -0
  12. package/src/OperatorLoadOuts.ts +108 -0
  13. package/src/Polarity.ts +31 -0
  14. package/src/Profile.ts +308 -0
  15. package/src/ProfileParser.ts +66 -0
  16. package/src/Pvp.ts +43 -0
  17. package/src/Race.ts +36 -0
  18. package/src/Scan.ts +30 -0
  19. package/src/{Skin.js → Skin.ts} +14 -6
  20. package/src/Stats.ts +504 -0
  21. package/src/Syndicate.ts +39 -0
  22. package/src/Utils.ts +85 -0
  23. package/src/{Weapon.js → Weapon.ts} +23 -3
  24. package/src/XpInfo.ts +41 -0
  25. package/src/Enemy.js +0 -47
  26. package/src/Intrinsics.js +0 -77
  27. package/src/ItemConfig.js +0 -52
  28. package/src/LoadOutInventory.js +0 -53
  29. package/src/LoadOutItem.js +0 -155
  30. package/src/LoadOutPreset.js +0 -90
  31. package/src/Mission.js +0 -58
  32. package/src/OperatorLoadOuts.js +0 -77
  33. package/src/Polarity.js +0 -25
  34. package/src/Profile.js +0 -213
  35. package/src/ProfileParser.js +0 -50
  36. package/src/Pvp.js +0 -35
  37. package/src/Race.js +0 -33
  38. package/src/Scan.js +0 -22
  39. package/src/Stats.js +0 -340
  40. package/src/Syndicate.js +0 -34
  41. package/src/Utils.js +0 -66
  42. package/src/XpInfo.js +0 -35
  43. package/types/Ability.d.ts +0 -20
  44. package/types/ArchonCrystal.d.ts +0 -22
  45. package/types/ChallengeProgress.d.ts +0 -21
  46. package/types/Enemy.d.ts +0 -41
  47. package/types/Intrinsics.d.ts +0 -66
  48. package/types/ItemConfig.d.ts +0 -21
  49. package/types/LoadOutInventory.d.ts +0 -45
  50. package/types/LoadOutItem.d.ts +0 -92
  51. package/types/LoadOutPreset.d.ts +0 -45
  52. package/types/Mission.d.ts +0 -35
  53. package/types/OperatorLoadOuts.d.ts +0 -35
  54. package/types/Polarity.d.ts +0 -21
  55. package/types/Profile.d.ts +0 -154
  56. package/types/ProfileParser.d.ts +0 -41
  57. package/types/Pvp.d.ts +0 -31
  58. package/types/Race.d.ts +0 -28
  59. package/types/Scan.d.ts +0 -20
  60. package/types/Skin.d.ts +0 -19
  61. package/types/Stats.d.ts +0 -255
  62. package/types/Syndicate.d.ts +0 -26
  63. package/types/Utils.d.ts +0 -3
  64. package/types/Weapon.d.ts +0 -51
  65. package/types/XpInfo.d.ts +0 -28
package/src/Syndicate.js DELETED
@@ -1,34 +0,0 @@
1
- import { syndicate } from 'warframe-worldstate-data/utilities';
2
-
3
- /**
4
- * Represents a syndicate
5
- * @module
6
- */
7
- export default class Syndicate {
8
- /**
9
- * @param {Object} affiliation The syndicate data
10
- * @param {string} locale locale code
11
- */
12
- constructor(affiliation, locale = 'en') {
13
- // TODO: name is readable but still might want to clean them up
14
- // i.e "NewLokaSyndicate" can be "New Loka"" instead
15
-
16
- /**
17
- * Name of the syndicate
18
- * @type {String}
19
- */
20
- this.name = syndicate(affiliation.Tag, locale);
21
-
22
- /**
23
- * Current standing the player has with the syndicate
24
- * @type {number}
25
- */
26
- this.standing = affiliation.Standing;
27
-
28
- /**
29
- * The player's current syndicate title
30
- * @type {String}
31
- */
32
- this.title = affiliation.Title;
33
- }
34
- }
package/src/Utils.js DELETED
@@ -1,66 +0,0 @@
1
- import Items from 'warframe-items';
2
-
3
- /** @module */
4
-
5
- /**
6
- * Map base10 int colors to hex color strings
7
- * @param {Record<string, number | undefined>} colors color map
8
- * @returns {Record<string, string>}
9
- */
10
- export const mapToHex = (colors) => {
11
- const hex = {};
12
- Object.entries(colors).forEach(([key, /** @type {undefined | number} */ value]) => {
13
- hex[key] = Math.abs(value).toString(16).toUpperCase();
14
- });
15
- return hex;
16
- };
17
-
18
- const categories = [
19
- 'Skins',
20
- 'Primary',
21
- 'Secondary',
22
- 'Melee',
23
- 'Arch-Melee',
24
- 'Arch-Gun',
25
- 'Warframes',
26
- 'Archwing',
27
- 'Sentinels',
28
- 'Pets',
29
- ];
30
-
31
- /**
32
- * Find an item by Item#uniqueName
33
- * @param {string} name string with which to query
34
- * @param {string} [locale='en'] locale to use for internationalization
35
- * @returns {Item}
36
- */
37
- export const find = (name, locale = 'en') => {
38
- const items = new Items({
39
- category: categories,
40
- i18n: locale,
41
- i18nOnObject: true,
42
- });
43
-
44
- const item = items.find((i) => i.uniqueName === name);
45
-
46
- let itemClone = { ...item };
47
- if (locale !== 'en' && itemClone.i18n[locale] && itemClone.i18n[locale]) {
48
- itemClone = { ...itemClone, ...itemClone.i18n[locale] };
49
-
50
- if (itemClone.abilities) {
51
- itemClone.abilities = itemClone.abilities.map((ability) => ({
52
- uniqueName: ability.abilityUniqueName || ability.uniqueName || undefined,
53
- name: ability.abilityName || ability.name,
54
- description: ability.abilityDescription || ability.description,
55
- imageName: ability.imageName ?? undefined,
56
- }));
57
- }
58
-
59
- delete itemClone.i18n;
60
- return itemClone;
61
- }
62
-
63
- return item;
64
- };
65
-
66
- export const numberToLetter = (num) => String.fromCharCode(64 + (num + 1));
package/src/XpInfo.js DELETED
@@ -1,35 +0,0 @@
1
- import { find } from './Utils.js';
2
-
3
- /**
4
- * An item that has contributed to a player's mastery rank
5
- * @module
6
- */
7
- export default class XpInfo {
8
- /**
9
- *
10
- * @param {Object} info The info for a given ranked item
11
- * @param {string} locale langauge to return item in
12
- * @param {boolean} [withItem=false] Whether or not to include items
13
- */
14
- constructor(info, locale = 'en', withItem = false) {
15
- /**
16
- * Unique name
17
- * @type {String}
18
- */
19
- this.uniqueName = info.ItemType;
20
-
21
- /**
22
- * XP earned
23
- * @type {number}
24
- */
25
- this.xp = info.XP;
26
-
27
- if (withItem) {
28
- /**
29
- * The item corrosponding to the unique name.
30
- * @type {module:"warframe-items".Item | undefined}
31
- */
32
- this.item = find(info.ItemType, locale);
33
- }
34
- }
35
- }
@@ -1,20 +0,0 @@
1
- /**
2
- * Represents a players used ability
3
- * @module
4
- */
5
- export default class Ability {
6
- /**
7
- * @param {Object} ability The ability
8
- */
9
- constructor(ability: any);
10
- /**
11
- * The ability unique name
12
- * @type {String}
13
- */
14
- uniqueName: string;
15
- /**
16
- * How many time the ability was used in the player's lifetime
17
- * @type {number}
18
- */
19
- used: number;
20
- }
@@ -1,22 +0,0 @@
1
- /**
2
- * Represents an Archon shard
3
- * @module
4
- */
5
- export default class ArchonCrystal {
6
- /**
7
- *
8
- * @param {Object} crystal The archon crystal object
9
- * @param {string} locale The locale to get translations in
10
- */
11
- constructor(crystal: any, locale?: string);
12
- /**
13
- * Archon shard color
14
- * @type {String}
15
- */
16
- color: string;
17
- /**
18
- * Archon shard modifier
19
- * @type {String}
20
- */
21
- modifier: string;
22
- }
@@ -1,21 +0,0 @@
1
- /**
2
- * Player completed or in progress challenges
3
- * @module
4
- */
5
- export default class ChallengeProgress {
6
- /**
7
- *
8
- * @param {Object} challenge The challenge object to parse
9
- */
10
- constructor(challenge: any);
11
- /**
12
- * Name of the challenge
13
- * @type {String}
14
- */
15
- name: string;
16
- /**
17
- * Progress towards completing this challenge
18
- * @type {number}
19
- */
20
- progress: number;
21
- }
package/types/Enemy.d.ts DELETED
@@ -1,41 +0,0 @@
1
- /**
2
- * An enemy killed/executed by player
3
- * @module
4
- */
5
- export default class Enemy {
6
- /**
7
- *
8
- * @param {Object} enemy The enemy
9
- */
10
- constructor(enemy: any);
11
- /**
12
- * Enenmy's unique name
13
- * @type {String}
14
- */
15
- uniqueName: string;
16
- /**
17
- * How many times the player has killed this enemy type
18
- * @type {number}
19
- */
20
- kills: number;
21
- /**
22
- * The amount of kills that were headshots
23
- * @type {number}
24
- */
25
- headshots: number;
26
- /**
27
- * The amount of kills that were finishers
28
- * @type {number}
29
- */
30
- executions: number;
31
- /**
32
- * The amount of kills that were assits
33
- * @type {number}
34
- */
35
- assists: number;
36
- /**
37
- * How many times this enemy type has killed the player
38
- * @type {number}
39
- */
40
- deaths: number;
41
- }
@@ -1,66 +0,0 @@
1
- /**
2
- * Player's intrinsics ranks
3
- * @module
4
- */
5
- export default class Intrinsics {
6
- /**
7
- *
8
- * @param {Object} skills The intrinsics object
9
- */
10
- constructor(skills: any);
11
- /**
12
- * Intrinsic points for railjack
13
- * @type {number}
14
- */
15
- railjack: number;
16
- /**
17
- * Railjack engineering rank
18
- * @type {number}
19
- */
20
- engineering: number;
21
- /**
22
- * Railjack gunnery rank
23
- * @type {number}
24
- */
25
- gunnery: number;
26
- /**
27
- * Railjack piloting rank
28
- * @type {number}
29
- */
30
- piloting: number;
31
- /**
32
- * Railjack tactical rank
33
- * @type {number}
34
- */
35
- tactical: number;
36
- /**
37
- * Railjack command rank
38
- * @type {number}
39
- */
40
- command: number;
41
- /**
42
- * Intrinsic points for railjack
43
- * @type {number}
44
- */
45
- drifter: number;
46
- /**
47
- * Drifter riding rank
48
- * @type {number}
49
- */
50
- riding: number;
51
- /**
52
- * Drifter combat rank
53
- * @type {number}
54
- */
55
- combat: number;
56
- /**
57
- * Drifter opportunity rank
58
- * @type {number}
59
- */
60
- opportunity: number;
61
- /**
62
- * Drifter endurance rank
63
- * @type {number}
64
- */
65
- endurance: number;
66
- }
@@ -1,21 +0,0 @@
1
- /**
2
- * Item customizations such as colors and applied skins
3
- * @module
4
- */
5
- export default class ItemConfig {
6
- /**
7
- *
8
- * @param {Object} config The configuration
9
- */
10
- constructor(config: any);
11
- /**
12
- * Array of unique names for the skins applied to item
13
- * @type {Array<String> | undefined}
14
- */
15
- skins: Array<string> | undefined;
16
- conclaveUpgrades: any;
17
- primaryColor: any;
18
- sigilColor: any;
19
- attachmentsColor: any;
20
- syandanaColor: any;
21
- }
@@ -1,45 +0,0 @@
1
- /**
2
- * Player loudout
3
- * @module
4
- */
5
- export default class LoadOutInventory {
6
- /**
7
- *
8
- * @param {Object} item The loadout data
9
- * @param {string} [locale='en'] The locale to return loudout items in
10
- * @param {boolean} [withItem=false] Whether or not to include items
11
- */
12
- constructor(item: any, locale?: string, withItem?: boolean);
13
- /**
14
- * Skins applied to weapons
15
- * @type {WeaponSkin}
16
- */
17
- weaponSkins: WeaponSkin;
18
- /**
19
- * An array of the player's currently equiped Warframe (or powersuits)
20
- * @type {LoadOutItem}
21
- */
22
- suits: LoadOutItem;
23
- /**
24
- * An array of the player's currently equiped secondary weapon
25
- * @type {LoadOutItem | undefined}
26
- */
27
- secondary: LoadOutItem | undefined;
28
- /**
29
- * An array of the player's currently equiped primary weapon
30
- * @type {LoadOutItem | undefined}
31
- */
32
- primary: LoadOutItem | undefined;
33
- /**
34
- * An array of the player's currently equiped melee weapon
35
- * @type {LoadOutItem | undefined}
36
- */
37
- melee: LoadOutItem | undefined;
38
- /**
39
- * Items that have counted towards the players mastery rank
40
- * @type {XpInfo}
41
- */
42
- xpInfo: XpInfo;
43
- }
44
- import LoadOutItem from './LoadOutItem.js';
45
- import XpInfo from './XpInfo.js';
@@ -1,92 +0,0 @@
1
- /**
2
- * An an item in LoadOutInventory
3
- * @module
4
- */
5
- export default class LoadOutItem {
6
- /**
7
- *
8
- * @param {Object} weapon The loadout item from LoadoutInventory
9
- * @param {string} [locale='en'] The locale to return item in
10
- */
11
- constructor(weapon: any, locale?: string);
12
- /**
13
- * Item ID
14
- * @type {String}
15
- */
16
- itemId: string;
17
- /**
18
- * Item unique name
19
- * @type {String}
20
- */
21
- uniqueName: string;
22
- /**
23
- * Item in-game name
24
- * @type {String}
25
- */
26
- name: string;
27
- /**
28
- * Complete item from Warframe-items
29
- * @type {module:"warframe-items".Item}
30
- */
31
- item: any;
32
- /**
33
- * The name of the Lich, Sister, or Technocyte
34
- * @type {String}
35
- */
36
- nemesis: string;
37
- /**
38
- * Configuration for this weapon. Such as colors and skins applied by the player
39
- * @type {Array<ItemConfig>}
40
- */
41
- configs: Array<ItemConfig>;
42
- upgradeType: any;
43
- /**
44
- * Information on the upgradeType that was applied
45
- * TODO need model for for fingerprint
46
- */
47
- upgradeFingerprint: any;
48
- /**
49
- * @type {number}
50
- */
51
- features: number;
52
- /**
53
- * @type {number}
54
- */
55
- upgradeVer: number;
56
- /**
57
- * XP earned with this weapon
58
- * @type {number}
59
- */
60
- xp: number;
61
- /**
62
- * How many mod slots are currently polarized.
63
- * @type {number}
64
- */
65
- polarized: number;
66
- /**
67
- * Which polarity types exist on the weapon
68
- * @type {Array<Polarity> | undefined}
69
- */
70
- polarity: Array<Polarity> | undefined;
71
- /**
72
- * Focus lens applied
73
- * @type {String}
74
- */
75
- focuseLens: string;
76
- /**
77
- * @type {number}
78
- */
79
- customizationSlotPurchases: number;
80
- primaryColor: any;
81
- sigilColor: any;
82
- /**
83
- * Whether prime details are enabled or not
84
- * @type {boolean}
85
- */
86
- enablePrime: boolean;
87
- attachmentsColor: any;
88
- syandanaColor: any;
89
- infestationDate: any;
90
- }
91
- import ItemConfig from './ItemConfig.js';
92
- import Polarity from './Polarity.js';
@@ -1,45 +0,0 @@
1
- export default class LoadOutPreset {
2
- constructor(preset: any);
3
- /**
4
- * Focus School
5
- * @type {String}
6
- */
7
- focusSchool: string;
8
- /**
9
- * Preset icon
10
- *
11
- * Note:
12
- * Icon in-game seems to be an image of whatever Warframe is equipped on it
13
- * @type {String}
14
- */
15
- icon: string;
16
- /**
17
- * Whether this preset is a favorite
18
- * @type {boolean}
19
- */
20
- isFavorite: boolean;
21
- /**
22
- * Preset name
23
- * @type {String}
24
- */
25
- name: string;
26
- /**
27
- * Warframe equipped in preset
28
- * @type {SlotPreset}
29
- */
30
- warframe: SlotPreset;
31
- primary: SlotPreset;
32
- secondary: SlotPreset;
33
- heavy: SlotPreset;
34
- melee: SlotPreset;
35
- exalted: SlotPreset;
36
- exaltedB: SlotPreset;
37
- }
38
- declare class SlotPreset {
39
- constructor(slot: any);
40
- id: any;
41
- modPreset: string;
42
- appearancePreset: string;
43
- isHidden: any;
44
- }
45
- export {};
@@ -1,35 +0,0 @@
1
- /**
2
- * A mission completed by the player
3
- * @module
4
- */
5
- export default class Mission {
6
- /**
7
- *
8
- * @param {Object} mission The mission data
9
- * @param {string} locale The locale to return in
10
- */
11
- constructor(mission: any, locale?: string);
12
- /**
13
- * Node name
14
- * @type {String}
15
- */
16
- node: string;
17
- /**
18
- * Node unique name
19
- * @type {String}
20
- */
21
- nodeKey: string;
22
- /**
23
- * Node mission type
24
- * @type {String}
25
- */
26
- missionType: string;
27
- /**
28
- * Node faction
29
- * @type {String}
30
- */
31
- faction: string;
32
- highScore: any;
33
- completes: any;
34
- tier: any;
35
- }
@@ -1,35 +0,0 @@
1
- /**
2
- * Player's operator loadout
3
- * @module
4
- */
5
- export default class OperatorLoadOuts {
6
- /**
7
- *
8
- * @param {Object} loadout The operator loadout
9
- */
10
- constructor(loadout: any);
11
- /**
12
- * Skins that have been applied to the player's operator.
13
- * @type {Array<Skin>}
14
- */
15
- skins: Array<Skin>;
16
- /**
17
- * Operator amp ID
18
- * @type {String | undefined}
19
- */
20
- operatorAmp: string | undefined;
21
- /**
22
- * Applied upgrade IDs
23
- * @type {Array<String>}
24
- */
25
- upgrades: Array<string>;
26
- abilityOverride: any;
27
- primaryColor: any;
28
- sigilColor: any;
29
- attachmentsColor: any;
30
- syandanaColor: any;
31
- eyeColor: any;
32
- facial: any;
33
- cloth: any;
34
- }
35
- import Skin from './Skin.js';
@@ -1,21 +0,0 @@
1
- /**
2
- * A polarity in a LoadOutItem
3
- * @module
4
- */
5
- export default class Polarity {
6
- /**
7
- *
8
- * @param {Object} polarity The polarity to parse
9
- */
10
- constructor(polarity: any);
11
- /**
12
- * Polarity name
13
- * @type {String}
14
- */
15
- polarity: string;
16
- /**
17
- * Polarized slot
18
- * @type {number}
19
- */
20
- slot: number;
21
- }