poe-api-manager 1.0.0 → 1.2.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/.github/workflows/CI_CD.yml +53 -0
- package/Changelog.md +11 -0
- package/README.md +25 -12
- package/index.js +2 -0
- package/lib/Utils.js +15 -0
- package/lib/WatchAPI.js +1 -33
- package/lib/modules/poe.ninja/currency/CurrencyBaseClass.js +47 -0
- package/lib/modules/poe.ninja/currency/CurrencyWievModule.js +2 -27
- package/lib/modules/poe.ninja/currency/currencyFetch/fetchCurrency.js +5 -4
- package/lib/modules/poe.ninja/currency/currencySubmodules/subModules/CurrencyModule.js +33 -40
- package/lib/modules/poe.ninja/currency/currencySubmodules/subModules/FragmentModule.js +8 -52
- package/lib/modules/poe.ninja/currency/currencyUrlGenerator/CurrencyUrlGenerator.js +9 -0
- package/lib/modules/poe.ninja/currency/{currencySubmodules/functions → methods}/getData.js +4 -4
- package/lib/modules/poe.ninja/currency/methods/getQuickCurrency.js +28 -0
- package/lib/modules/poe.ninja/item/ItemBaseClass.js +40 -0
- package/lib/modules/poe.ninja/item/ItemWievModule.js +27 -52
- package/lib/modules/poe.ninja/item/itemFetch/fetchItem.js +5 -10
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BaseTypeModule.js +8 -48
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BeastModule.js +11 -46
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BlightRavagedMapModule.js +9 -54
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BlightedMapModule.js +7 -49
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ClusterJewelModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/DeliriumOrbsModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/DivinationCardModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/EssenceModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/FossilModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/HelmetEnchantModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/IncubatorModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/InvitationModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/MapModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/MemoryModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/OilModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/OmenModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ResonatorModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ScarabModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/SkillGemModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueAccessoryModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueArmourModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueFlaskModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueJewelModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueMapModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueRelicModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueWeaponModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/VialsModule.js +7 -52
- package/lib/modules/poe.ninja/item/itemUrlGenerator/ItemUrlGenerator.js +9 -0
- package/lib/modules/poe.ninja/item/{itemSubmodules/functions → methods}/getData.js +5 -11
- package/lib/modules/poe.watch/allModules/WatchBaseClass.js +45 -0
- package/lib/modules/poe.watch/allModules/fetch/fetch.js +1 -4
- package/lib/modules/poe.watch/allModules/submodules/AccessoryModule.js +19 -62
- package/lib/modules/poe.watch/allModules/submodules/ArmourModule.js +19 -60
- package/lib/modules/poe.watch/allModules/submodules/BaseModule.js +19 -59
- package/lib/modules/poe.watch/allModules/submodules/BeastModule.js +13 -42
- package/lib/modules/poe.watch/allModules/submodules/CurrencyModule.js +13 -43
- package/lib/modules/poe.watch/allModules/submodules/DeliriumOrbModule.js +20 -42
- package/lib/modules/poe.watch/allModules/submodules/DivsModule.js +14 -43
- package/lib/modules/poe.watch/allModules/submodules/EssenceModule.js +13 -42
- package/lib/modules/poe.watch/allModules/submodules/FlaskModule.js +13 -42
- package/lib/modules/poe.watch/allModules/submodules/FossilModule.js +13 -42
- package/lib/modules/poe.watch/allModules/submodules/FragmentModule.js +13 -42
- package/lib/modules/poe.watch/allModules/submodules/GemModule.js +19 -61
- package/lib/modules/poe.watch/allModules/submodules/InscribedModule.js +13 -44
- package/lib/modules/poe.watch/allModules/submodules/InvitationModule.js +13 -42
- package/lib/modules/poe.watch/allModules/submodules/JewelModule.js +13 -42
- package/lib/modules/poe.watch/allModules/submodules/MapModule.js +13 -42
- package/lib/modules/poe.watch/allModules/submodules/OilModule.js +13 -42
- package/lib/modules/poe.watch/allModules/submodules/ScarabModule.js +13 -42
- package/lib/modules/poe.watch/allModules/submodules/SextantModule.js +13 -42
- package/lib/modules/poe.watch/allModules/submodules/UniqueMapsModule.js +13 -42
- package/lib/modules/poe.watch/allModules/submodules/WeaponModule.js +19 -59
- package/lib/modules/poe.watch/allModules/watchUrlGenerator/urlGenerator.js +9 -0
- package/package.json +4 -2
- package/lib/config/poeNinja/url.js +0 -12
- package/lib/config/poeWatch/url.js +0 -12
- /package/lib/modules/poe.watch/allModules/{functions → methods}/getCategory.js +0 -0
- /package/lib/modules/poe.watch/allModules/{functions → methods}/getData.js +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const getData = require("./methods/getData");
|
|
2
|
+
|
|
3
|
+
class ItemBaseClass {
|
|
4
|
+
/**
|
|
5
|
+
* @type {string} The type of item to retrieve data for.
|
|
6
|
+
* @private
|
|
7
|
+
*/
|
|
8
|
+
#type;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @type {string} The name of the current league.
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
14
|
+
#league;
|
|
15
|
+
/**
|
|
16
|
+
* Constructs an instance of ItemBaseClass.
|
|
17
|
+
* @param {string} league - The name of the league to retrieve data for.
|
|
18
|
+
* @param {string} typeName - The type of item to retrieve data for.
|
|
19
|
+
*/
|
|
20
|
+
constructor(league, typeName) {
|
|
21
|
+
this.#type = typeName;
|
|
22
|
+
this.#league = league;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Retrieves item data based on requested properties.
|
|
27
|
+
* @param {string[]} requestedProperties - An array of properties to retrieve for each item.
|
|
28
|
+
* @returns {Promise<Array<Object>>} A promise that resolves with the requested item data.
|
|
29
|
+
* @throws {Error} If there is an error fetching the data.
|
|
30
|
+
*/
|
|
31
|
+
async getData(requestedProperties) {
|
|
32
|
+
try {
|
|
33
|
+
return await getData(this.#league, this.#type, requestedProperties);
|
|
34
|
+
} catch (error) {
|
|
35
|
+
throw new Error(`Error fetching ItemOverView data: ${error.message}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = ItemBaseClass;
|
|
@@ -1,175 +1,150 @@
|
|
|
1
1
|
const itemSubmodules = require("./itemSubmodules/itemSubModules");
|
|
2
|
-
const baseurl = require("../../../config/poeNinja/url");
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Represents a module for viewing item-related information in a specific Path of Exile league.
|
|
6
5
|
* @class
|
|
7
6
|
*/
|
|
8
7
|
class ItemWievModule {
|
|
9
|
-
#league;
|
|
10
|
-
#baseurl;
|
|
11
|
-
|
|
12
8
|
/**
|
|
13
9
|
* Creates a new instance of ItemWievModule.
|
|
14
10
|
* @constructor
|
|
15
11
|
* @param {string} league - The Path of Exile league for which the item information is retrieved.
|
|
16
12
|
*/
|
|
17
13
|
constructor(league) {
|
|
18
|
-
/**
|
|
19
|
-
* The Path of Exile league for which the item information is retrieved.
|
|
20
|
-
* @private
|
|
21
|
-
* @type {string}
|
|
22
|
-
*/
|
|
23
|
-
this.#league = league;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* The base URL for the Path of Exile Ninja API.
|
|
27
|
-
* @private
|
|
28
|
-
* @type {string}
|
|
29
|
-
*/
|
|
30
|
-
this.#baseurl = baseurl.baseurl;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* The complete URL for retrieving item information for the specified league.
|
|
34
|
-
* @private
|
|
35
|
-
* @type {string}
|
|
36
|
-
*/
|
|
37
|
-
const url = `${this.#baseurl}itemoverview?league=${this.#league}&type=`;
|
|
38
|
-
|
|
39
14
|
/**
|
|
40
15
|
* Represents a submodule for base type item information.
|
|
41
16
|
*/
|
|
42
|
-
this.baseType = new itemSubmodules.BaseTypeModule(
|
|
17
|
+
this.baseType = new itemSubmodules.BaseTypeModule(league);
|
|
43
18
|
|
|
44
19
|
/**
|
|
45
20
|
* Represents a submodule for beast item information.
|
|
46
21
|
*/
|
|
47
|
-
this.beast = new itemSubmodules.BeastModule(
|
|
22
|
+
this.beast = new itemSubmodules.BeastModule(league);
|
|
48
23
|
|
|
49
24
|
/**
|
|
50
25
|
* Represents a submodule for delirium orbs item information.
|
|
51
26
|
*/
|
|
52
|
-
this.deliriumOrbs = new itemSubmodules.DeliriumOrbsModule(
|
|
27
|
+
this.deliriumOrbs = new itemSubmodules.DeliriumOrbsModule(league);
|
|
53
28
|
|
|
54
29
|
/**
|
|
55
30
|
* Represents a submodule for divination card item information.
|
|
56
31
|
*/
|
|
57
|
-
this.divinationCard = new itemSubmodules.DivinationCardModule(
|
|
32
|
+
this.divinationCard = new itemSubmodules.DivinationCardModule(league);
|
|
58
33
|
|
|
59
34
|
/**
|
|
60
35
|
* Represents a submodule for essence item information.
|
|
61
36
|
*/
|
|
62
|
-
this.essence = new itemSubmodules.EssenceModule(
|
|
37
|
+
this.essence = new itemSubmodules.EssenceModule(league);
|
|
63
38
|
|
|
64
39
|
/**
|
|
65
40
|
* Represents a submodule for fossil item information.
|
|
66
41
|
*/
|
|
67
|
-
this.fossil = new itemSubmodules.FossilModule(
|
|
42
|
+
this.fossil = new itemSubmodules.FossilModule(league);
|
|
68
43
|
|
|
69
44
|
/**
|
|
70
45
|
* Represents a submodule for helmet enchant item information.
|
|
71
46
|
*/
|
|
72
|
-
this.helmetEnchant = new itemSubmodules.HelmetEnchantModule(
|
|
47
|
+
this.helmetEnchant = new itemSubmodules.HelmetEnchantModule(league);
|
|
73
48
|
|
|
74
49
|
/**
|
|
75
50
|
* Represents a submodule for incubator item information.
|
|
76
51
|
*/
|
|
77
|
-
this.incubator = new itemSubmodules.IncubatorModule(
|
|
52
|
+
this.incubator = new itemSubmodules.IncubatorModule(league);
|
|
78
53
|
|
|
79
54
|
/**
|
|
80
55
|
* Represents a submodule for map item information.
|
|
81
56
|
*/
|
|
82
|
-
this.map = new itemSubmodules.MapModule(
|
|
57
|
+
this.map = new itemSubmodules.MapModule(league);
|
|
83
58
|
|
|
84
59
|
/**
|
|
85
60
|
* Represents a submodule for oil item information.
|
|
86
61
|
*/
|
|
87
|
-
this.oil = new itemSubmodules.OilModule(
|
|
62
|
+
this.oil = new itemSubmodules.OilModule(league);
|
|
88
63
|
|
|
89
64
|
/**
|
|
90
65
|
* Represents a submodule for resonator item information.
|
|
91
66
|
*/
|
|
92
|
-
this.resonator = new itemSubmodules.ResonatorModule(
|
|
67
|
+
this.resonator = new itemSubmodules.ResonatorModule(league);
|
|
93
68
|
|
|
94
69
|
/**
|
|
95
70
|
* Represents a submodule for scarab item information.
|
|
96
71
|
*/
|
|
97
|
-
this.scarab = new itemSubmodules.ScarabModule(
|
|
72
|
+
this.scarab = new itemSubmodules.ScarabModule(league);
|
|
98
73
|
|
|
99
74
|
/**
|
|
100
75
|
* Represents a submodule for skill gem item information.
|
|
101
76
|
*/
|
|
102
|
-
this.skillGem = new itemSubmodules.SkillGemModule(
|
|
77
|
+
this.skillGem = new itemSubmodules.SkillGemModule(league);
|
|
103
78
|
|
|
104
79
|
/**
|
|
105
80
|
* Represents a submodule for unique accessory item information.
|
|
106
81
|
*/
|
|
107
|
-
this.uniqueAccessory = new itemSubmodules.UniqueAccessoryModule(
|
|
82
|
+
this.uniqueAccessory = new itemSubmodules.UniqueAccessoryModule(league);
|
|
108
83
|
|
|
109
84
|
/**
|
|
110
85
|
* Represents a submodule for unique armour item information.
|
|
111
86
|
*/
|
|
112
|
-
this.uniqueArmour = new itemSubmodules.UniqueArmourModule(
|
|
87
|
+
this.uniqueArmour = new itemSubmodules.UniqueArmourModule(league);
|
|
113
88
|
|
|
114
89
|
/**
|
|
115
90
|
* Represents a submodule for unique flask item information.
|
|
116
91
|
*/
|
|
117
|
-
this.uniqueFlask = new itemSubmodules.UniqueFlaskModule(
|
|
92
|
+
this.uniqueFlask = new itemSubmodules.UniqueFlaskModule(league);
|
|
118
93
|
|
|
119
94
|
/**
|
|
120
95
|
* Represents a submodule for unique jewel item information.
|
|
121
96
|
*/
|
|
122
|
-
this.uniqueJewel = new itemSubmodules.UniqueJewelModule(
|
|
97
|
+
this.uniqueJewel = new itemSubmodules.UniqueJewelModule(league);
|
|
123
98
|
|
|
124
99
|
/**
|
|
125
100
|
* Represents a submodule for unique map item information.
|
|
126
101
|
*/
|
|
127
|
-
this.uniqueMap = new itemSubmodules.UniqueMapModule(
|
|
102
|
+
this.uniqueMap = new itemSubmodules.UniqueMapModule(league);
|
|
128
103
|
|
|
129
104
|
/**
|
|
130
105
|
* Represents a submodule for unique weapon item information.
|
|
131
106
|
*/
|
|
132
|
-
this.uniqueWeapon = new itemSubmodules.UniqueWeaponModule(
|
|
107
|
+
this.uniqueWeapon = new itemSubmodules.UniqueWeaponModule(league);
|
|
133
108
|
|
|
134
109
|
/**
|
|
135
110
|
* Represents a submodule for vials item information.
|
|
136
111
|
*/
|
|
137
|
-
this.vials = new itemSubmodules.VialsModule(
|
|
112
|
+
this.vials = new itemSubmodules.VialsModule(league);
|
|
138
113
|
|
|
139
114
|
/**
|
|
140
115
|
* Represents a submodule for omen item information.
|
|
141
116
|
*/
|
|
142
|
-
this.omen = new itemSubmodules.OmenModule(
|
|
117
|
+
this.omen = new itemSubmodules.OmenModule(league);
|
|
143
118
|
|
|
144
119
|
/**
|
|
145
120
|
* Represents a submodule for memory item information.
|
|
146
121
|
*/
|
|
147
|
-
this.memory = new itemSubmodules.MemoryModule(
|
|
122
|
+
this.memory = new itemSubmodules.MemoryModule(league);
|
|
148
123
|
|
|
149
124
|
/**
|
|
150
125
|
* Represents a submodule for invitation item information.
|
|
151
126
|
*/
|
|
152
|
-
this.invitation = new itemSubmodules.InvitationModule(
|
|
127
|
+
this.invitation = new itemSubmodules.InvitationModule(league);
|
|
153
128
|
|
|
154
129
|
/**
|
|
155
130
|
* Represents a submodule for unique relics item information.
|
|
156
131
|
*/
|
|
157
|
-
this.uniqueRelics = new itemSubmodules.UniqueRelicsModule(
|
|
132
|
+
this.uniqueRelics = new itemSubmodules.UniqueRelicsModule(league);
|
|
158
133
|
|
|
159
134
|
/**
|
|
160
135
|
* Represents a submodule for cluster jewel item information.
|
|
161
136
|
*/
|
|
162
|
-
this.clusterJewel = new itemSubmodules.ClusterJewelModule(
|
|
137
|
+
this.clusterJewel = new itemSubmodules.ClusterJewelModule(league);
|
|
163
138
|
|
|
164
139
|
/**
|
|
165
140
|
* Represents a submodule for blighted map item information.
|
|
166
141
|
*/
|
|
167
|
-
this.blightedMap = new itemSubmodules.BlightedMapModule(
|
|
142
|
+
this.blightedMap = new itemSubmodules.BlightedMapModule(league);
|
|
168
143
|
|
|
169
144
|
/**
|
|
170
145
|
* Represents a submodule for blight ravaged map item information.
|
|
171
146
|
*/
|
|
172
|
-
this.blightRavagedMap = new itemSubmodules.BlightRavagedMapModule(
|
|
147
|
+
this.blightRavagedMap = new itemSubmodules.BlightRavagedMapModule(league);
|
|
173
148
|
}
|
|
174
149
|
}
|
|
175
150
|
|
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
const axios = require("axios");
|
|
2
|
+
const urlGenerator = require("../itemUrlGenerator/ItemUrlGenerator");
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Asynchronously fetches data from a specified URL for item-related information.
|
|
5
6
|
*
|
|
6
|
-
* @param {string}
|
|
7
|
+
* @param {string} league - The league name for the data fetch operation.
|
|
7
8
|
* @param {string} type - The specific type of item data to fetch.
|
|
8
9
|
* @returns {Promise<Array<Object>>} - A promise that resolves to the fetched item data.
|
|
9
10
|
* @throws {Error} - Throws an error if there's an issue fetching or processing the data.
|
|
10
11
|
*/
|
|
11
|
-
async function fetchData(
|
|
12
|
+
async function fetchData(league, type) {
|
|
12
13
|
try {
|
|
13
14
|
/**
|
|
14
15
|
* @type {string} url - The complete URL for fetching item-related data.
|
|
15
16
|
*/
|
|
16
|
-
const url =
|
|
17
|
+
const url = urlGenerator(league, type);
|
|
17
18
|
|
|
18
|
-
/**
|
|
19
|
-
* @type {Object} response - The response object from the data fetch operation.
|
|
20
|
-
*/
|
|
21
19
|
const response = await axios.get(url);
|
|
22
20
|
|
|
23
21
|
if (response.data && response.data.lines) {
|
|
24
|
-
/**
|
|
25
|
-
* @type {Array<Object>} lines - The array of objects containing item-related data.
|
|
26
|
-
*/
|
|
27
22
|
return response.data.lines;
|
|
28
23
|
} else {
|
|
29
|
-
throw new Error("Invalid response format from POE Ninja API
|
|
24
|
+
throw new Error("Invalid response format from POE Ninja API ItemView");
|
|
30
25
|
}
|
|
31
26
|
} catch (error) {
|
|
32
27
|
/**
|
|
@@ -1,55 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const ItemBaseClass = require("../../ItemBaseClass");
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @
|
|
3
|
+
* Represents a module for handling base types.
|
|
4
|
+
* @extends ItemBaseClass
|
|
6
5
|
*/
|
|
7
|
-
class BaseTypeModule {
|
|
8
|
-
#url;
|
|
9
|
-
#type;
|
|
10
|
-
/**
|
|
11
|
-
* Creates a new instance of BaseTypeModule.
|
|
12
|
-
* @constructor
|
|
13
|
-
* @param {string} url - The URL for fetching base type item information.
|
|
14
|
-
*/
|
|
15
|
-
constructor(url) {
|
|
16
|
-
/**
|
|
17
|
-
* @type {string} #url - The URL for fetching base type item information.
|
|
18
|
-
* @private
|
|
19
|
-
*/
|
|
20
|
-
this.#url = url;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @type {string} #type - The type of item data (BaseType).
|
|
24
|
-
* @private
|
|
25
|
-
*/
|
|
26
|
-
this.#type = "BaseType";
|
|
27
|
-
}
|
|
28
|
-
|
|
6
|
+
class BaseTypeModule extends ItemBaseClass {
|
|
29
7
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @async
|
|
33
|
-
* @method
|
|
34
|
-
* @param {Array<string>} requestedProperties - An array of property names to include in the result.
|
|
35
|
-
* @returns {Promise<Array<Object>>} A promise that resolves to the fetched item data.
|
|
36
|
-
* @throws {Error} Throws an error if there's an issue with the data fetching process.
|
|
37
|
-
*
|
|
8
|
+
* Creates an instance of BaseTypeModule.
|
|
9
|
+
* @param {string} league - The league name.
|
|
38
10
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Calls the getData function to fetch Base Type data.
|
|
43
|
-
* @type {Promise<Array<Object>>}
|
|
44
|
-
*/
|
|
45
|
-
return getData(this.#url, this.#type, requestedProperties);
|
|
46
|
-
} catch (error) {
|
|
47
|
-
/**
|
|
48
|
-
* Throws an error if there's an issue fetching or processing the Base Type data.
|
|
49
|
-
* @throws {Error}
|
|
50
|
-
*/
|
|
51
|
-
throw new Error(`Error fetching Base Type data: ${error.message}`);
|
|
52
|
-
}
|
|
11
|
+
constructor(league) {
|
|
12
|
+
super(league, "BaseType");
|
|
53
13
|
}
|
|
54
14
|
}
|
|
55
15
|
|
|
@@ -1,55 +1,20 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const ItemBaseClass = require("../../ItemBaseClass");
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @
|
|
3
|
+
* Represents a module for handling beasts.
|
|
4
|
+
* @extends ItemBaseClass
|
|
6
5
|
*/
|
|
7
|
-
class BeastModule {
|
|
8
|
-
#url;
|
|
9
|
-
#type;
|
|
6
|
+
class BeastModule extends ItemBaseClass {
|
|
10
7
|
/**
|
|
11
|
-
* Creates
|
|
12
|
-
* @
|
|
13
|
-
* @param {string} url - The URL for fetching beast information.
|
|
8
|
+
* Creates an instance of BeastModule.
|
|
9
|
+
* @param {string} league - The league name.
|
|
14
10
|
*/
|
|
15
|
-
constructor(
|
|
16
|
-
/**
|
|
17
|
-
* @type {string} #url - The URL for fetching beast information.
|
|
18
|
-
* @private
|
|
19
|
-
*/
|
|
20
|
-
this.#url = url;
|
|
21
|
-
|
|
11
|
+
constructor(league) {
|
|
22
12
|
/**
|
|
23
|
-
*
|
|
24
|
-
* @
|
|
13
|
+
* The name of the beast type.
|
|
14
|
+
* @type {string}
|
|
25
15
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Asynchronously retrieves beast information.
|
|
31
|
-
*
|
|
32
|
-
* @async
|
|
33
|
-
* @method
|
|
34
|
-
* @param {Array<string>} requestedProperties - An array of property names to include in the result.
|
|
35
|
-
* @returns {Promise<Array<Object>>} A promise that resolves to the fetched beast data.
|
|
36
|
-
* @throws {Error} Throws an error if there's an issue with the data fetching process.
|
|
37
|
-
*
|
|
38
|
-
*/
|
|
39
|
-
async getData(requestedProperties) {
|
|
40
|
-
try {
|
|
41
|
-
/**
|
|
42
|
-
* Calls the getData function to fetch Beast data.
|
|
43
|
-
* @type {Promise<Array<Object>>}
|
|
44
|
-
*/
|
|
45
|
-
return getData(this.#url, this.#type, requestedProperties);
|
|
46
|
-
} catch (error) {
|
|
47
|
-
/**
|
|
48
|
-
* Throws an error if there's an issue fetching or processing the Beast data.
|
|
49
|
-
* @throws {Error}
|
|
50
|
-
*/
|
|
51
|
-
throw new Error(`Error fetching Beast data: ${error.message}`);
|
|
52
|
-
}
|
|
16
|
+
const typeName = "Beast";
|
|
17
|
+
super(league, typeName);
|
|
53
18
|
}
|
|
54
19
|
}
|
|
55
20
|
|
|
@@ -1,61 +1,16 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const ItemBaseClass = require("../../ItemBaseClass");
|
|
3
2
|
/**
|
|
4
|
-
* Represents a module for
|
|
5
|
-
*
|
|
6
|
-
* @class
|
|
3
|
+
* Represents a module for handling blighted ravaged maps.
|
|
4
|
+
* @extends ItemBaseClass
|
|
7
5
|
*/
|
|
8
|
-
class
|
|
9
|
-
/**
|
|
10
|
-
* The URL for fetching data.
|
|
11
|
-
*
|
|
12
|
-
* @private
|
|
13
|
-
* @type {string}
|
|
14
|
-
*/
|
|
15
|
-
#url;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* The type of data (BlightRavagedMap in this case).
|
|
19
|
-
*
|
|
20
|
-
* @private
|
|
21
|
-
* @type {string}
|
|
22
|
-
*/
|
|
23
|
-
#type;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Creates an instance of BlightRavagedMapModule.
|
|
27
|
-
*
|
|
28
|
-
* @param {string} url - The URL to fetch data from.
|
|
29
|
-
*/
|
|
30
|
-
constructor(url) {
|
|
31
|
-
this.#url = url;
|
|
32
|
-
this.#type = "BlightRavagedMap";
|
|
33
|
-
}
|
|
34
|
-
|
|
6
|
+
class BlightedRavagedMapModule extends ItemBaseClass {
|
|
35
7
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* @async
|
|
39
|
-
* @param {Array<string>} requestedProperties - An array of properties to retrieve.
|
|
40
|
-
* @returns {Promise<Object>} A promise that resolves to the retrieved data.
|
|
8
|
+
* Creates an instance of BlightedRavagedMapModule.
|
|
9
|
+
* @param {string} league - The league name.
|
|
41
10
|
*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Calls the getData function to fetch BlightRavagedMap data.
|
|
46
|
-
*
|
|
47
|
-
* @type {Promise<Array<Object>>}
|
|
48
|
-
*/
|
|
49
|
-
return getData(this.#url, this.#type, requestedProperties);
|
|
50
|
-
} catch (error) {
|
|
51
|
-
/**
|
|
52
|
-
* Throws an error if there's an issue fetching or processing the BlightRavagedMap data.
|
|
53
|
-
*
|
|
54
|
-
* @throws {Error}
|
|
55
|
-
*/
|
|
56
|
-
throw new Error(`Error fetching BlightRavagedMap data: ${error.message}`);
|
|
57
|
-
}
|
|
11
|
+
constructor(league) {
|
|
12
|
+
super(league, "BlightedRavagedMap");
|
|
58
13
|
}
|
|
59
14
|
}
|
|
60
15
|
|
|
61
|
-
module.exports =
|
|
16
|
+
module.exports = BlightedRavagedMapModule;
|
|
@@ -1,57 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const ItemBaseClass = require("../../ItemBaseClass");
|
|
3
2
|
/**
|
|
4
|
-
* Represents a module for
|
|
5
|
-
*
|
|
6
|
-
* @class
|
|
3
|
+
* Represents a module for handling blighted maps.
|
|
4
|
+
* @extends ItemBaseClass
|
|
7
5
|
*/
|
|
8
|
-
class BlightedMapModule {
|
|
9
|
-
/**
|
|
10
|
-
* The URL for fetching data.
|
|
11
|
-
*
|
|
12
|
-
* @private
|
|
13
|
-
* @type {string}
|
|
14
|
-
*/
|
|
15
|
-
#url;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* The type of data (BlightedMap in this case).
|
|
19
|
-
*
|
|
20
|
-
* @private
|
|
21
|
-
* @type {string}
|
|
22
|
-
*/
|
|
23
|
-
#type;
|
|
6
|
+
class BlightedMapModule extends ItemBaseClass {
|
|
24
7
|
/**
|
|
25
8
|
* Creates an instance of BlightedMapModule.
|
|
26
|
-
*
|
|
27
|
-
* @param {string} url - The URL to fetch data from.
|
|
28
|
-
*/
|
|
29
|
-
constructor(url) {
|
|
30
|
-
this.#url = url;
|
|
31
|
-
this.#type = "BlightedMap";
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Asynchronously retrieves data based on the specified properties.
|
|
36
|
-
*
|
|
37
|
-
* @async
|
|
38
|
-
* @param {Array<string>} requestedProperties - An array of properties to retrieve.
|
|
39
|
-
* @returns {Promise<Object>} A promise that resolves to the retrieved data.
|
|
9
|
+
* @param {string} league - The league name.
|
|
40
10
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Calls the getData function to fetch BlightedMap data.
|
|
45
|
-
* @type {Promise<Array<Object>>}
|
|
46
|
-
*/
|
|
47
|
-
return getData(this.#url, this.#type, requestedProperties);
|
|
48
|
-
} catch (error) {
|
|
49
|
-
/**
|
|
50
|
-
* Throws an error if there's an issue fetching or processing the BlightedMap data.
|
|
51
|
-
* @throws {Error}
|
|
52
|
-
*/
|
|
53
|
-
throw new Error(`Error fetching BlightedMap data: ${error.message}`);
|
|
54
|
-
}
|
|
11
|
+
constructor(league) {
|
|
12
|
+
super(league, "BlightedMap");
|
|
55
13
|
}
|
|
56
14
|
}
|
|
57
15
|
|
|
@@ -1,60 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const ItemBaseClass = require("../../ItemBaseClass");
|
|
3
2
|
/**
|
|
4
|
-
* Represents a module for
|
|
5
|
-
*
|
|
6
|
-
* @class
|
|
3
|
+
* Represents a module for handling cluster jewels.
|
|
4
|
+
* @extends ItemBaseClass
|
|
7
5
|
*/
|
|
8
|
-
class ClusterJewelModule {
|
|
9
|
-
/**
|
|
10
|
-
* The URL for fetching data.
|
|
11
|
-
*
|
|
12
|
-
* @private
|
|
13
|
-
* @type {string}
|
|
14
|
-
*/
|
|
15
|
-
#url;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* The type of data (ClusterJewel in this case).
|
|
19
|
-
*
|
|
20
|
-
* @private
|
|
21
|
-
* @type {string}
|
|
22
|
-
*/
|
|
23
|
-
#type;
|
|
24
|
-
|
|
6
|
+
class ClusterJewelModule extends ItemBaseClass {
|
|
25
7
|
/**
|
|
26
8
|
* Creates an instance of ClusterJewelModule.
|
|
27
|
-
*
|
|
28
|
-
* @param {string} url - The URL to fetch data from.
|
|
29
|
-
*/
|
|
30
|
-
constructor(url) {
|
|
31
|
-
this.#url = url;
|
|
32
|
-
this.#type = "ClusterJewel";
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Asynchronously retrieves data based on the specified properties.
|
|
37
|
-
*
|
|
38
|
-
* @async
|
|
39
|
-
* @param {Array<string>} requestedProperties - An array of properties to retrieve.
|
|
40
|
-
* @returns {Promise<Object>} A promise that resolves to the retrieved data.
|
|
9
|
+
* @param {string} league - The league name.
|
|
41
10
|
*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Calls the getData function to fetch ClusterJewel data.
|
|
46
|
-
*
|
|
47
|
-
* @type {Promise<Array<Object>>}
|
|
48
|
-
*/
|
|
49
|
-
return getData(this.#url, this.#type, requestedProperties);
|
|
50
|
-
} catch (error) {
|
|
51
|
-
/**
|
|
52
|
-
* Throws an error if there's an issue fetching or processing the ClusterJewel data.
|
|
53
|
-
*
|
|
54
|
-
* @throws {Error}
|
|
55
|
-
*/
|
|
56
|
-
throw new Error(`Error fetching ClusterJewel data: ${error.message}`);
|
|
57
|
-
}
|
|
11
|
+
constructor(league) {
|
|
12
|
+
super(league, "ClusterJewel");
|
|
58
13
|
}
|
|
59
14
|
}
|
|
60
15
|
|
|
@@ -1,60 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
1
|
+
const ItemBaseClass = require("../../ItemBaseClass");
|
|
3
2
|
/**
|
|
4
|
-
* Represents a module for
|
|
5
|
-
*
|
|
6
|
-
* @class
|
|
3
|
+
* Represents a module for handling delirium orbs.
|
|
4
|
+
* @extends ItemBaseClass
|
|
7
5
|
*/
|
|
8
|
-
class DeliriumOrbsModule {
|
|
9
|
-
/**
|
|
10
|
-
* The URL for fetching data.
|
|
11
|
-
*
|
|
12
|
-
* @private
|
|
13
|
-
* @type {string}
|
|
14
|
-
*/
|
|
15
|
-
#url;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* The type of data (DeliriumOrb in this case).
|
|
19
|
-
*
|
|
20
|
-
* @private
|
|
21
|
-
* @type {string}
|
|
22
|
-
*/
|
|
23
|
-
#type;
|
|
24
|
-
|
|
6
|
+
class DeliriumOrbsModule extends ItemBaseClass {
|
|
25
7
|
/**
|
|
26
8
|
* Creates an instance of DeliriumOrbsModule.
|
|
27
|
-
*
|
|
28
|
-
* @param {string} url - The URL to fetch data from.
|
|
29
|
-
*/
|
|
30
|
-
constructor(url) {
|
|
31
|
-
this.#url = url;
|
|
32
|
-
this.#type = "DeliriumOrb";
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Asynchronously retrieves data based on the specified properties.
|
|
37
|
-
*
|
|
38
|
-
* @async
|
|
39
|
-
* @param {Array<string>} requestedProperties - An array of properties to retrieve.
|
|
40
|
-
* @returns {Promise<Object>} A promise that resolves to the retrieved data.
|
|
9
|
+
* @param {string} league - The league name.
|
|
41
10
|
*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Calls the getData function to fetch DeliriumOrb data.
|
|
46
|
-
*
|
|
47
|
-
* @type {Promise<Array<Object>>}
|
|
48
|
-
*/
|
|
49
|
-
return getData(this.#url, this.#type, requestedProperties);
|
|
50
|
-
} catch (error) {
|
|
51
|
-
/**
|
|
52
|
-
* Throws an error if there's an issue fetching or processing the DeliriumOrb data.
|
|
53
|
-
*
|
|
54
|
-
* @throws {Error}
|
|
55
|
-
*/
|
|
56
|
-
throw new Error(`Error fetching DeliriumOrb data: ${error.message}`);
|
|
57
|
-
}
|
|
11
|
+
constructor(league) {
|
|
12
|
+
super(league, "DeliriumOrb");
|
|
58
13
|
}
|
|
59
14
|
}
|
|
60
15
|
|