poe-api-manager 0.2.2 → 0.2.6
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/Changelog.md +4 -0
- package/lib/NinjaAPI.js +26 -4
- package/lib/WatchAPI.js +44 -0
- package/lib/config/poeNinja/url.js +9 -0
- package/lib/config/poeWatch/url.js +9 -0
- package/lib/modules/mainfunctions/filter/propertyFilter.js +18 -0
- package/lib/modules/poe.ninja/currency/CurrencyWievModule.js +39 -2
- package/lib/modules/poe.ninja/currency/currencyFetch/fetchCurrency.js +11 -3
- package/lib/modules/poe.ninja/currency/currencyFetch/merge/mergeData.js +7 -0
- package/lib/modules/poe.ninja/currency/currencySubmodules/functions/getData.js +23 -0
- package/lib/modules/poe.ninja/currency/currencySubmodules/subModules/CurrencyModule.js +45 -2
- package/lib/modules/poe.ninja/currency/currencySubmodules/subModules/FragmentModule.js +45 -2
- package/lib/modules/poe.ninja/item/ItemWievModule.js +135 -2
- package/lib/modules/poe.ninja/item/itemFetch/fetchItem.js +23 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/functions/getData.js +19 -0
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BaseTypeModule.js +41 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BeastModule.js +41 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BlightRavagedMapModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BlightedMapModule.js +43 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ClusterJewelModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/DeliriumOrbsModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/DivinationCardModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/EssenceModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/FossilModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/HelmetEnchantModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/IncubatorModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/InvitationModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/MapModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/MemoryModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/OilModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/OmenModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ResonatorModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ScarabModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/SkillGemModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueAccessoryModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueArmourModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueFlaskModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueJewelModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueMapModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueRelicModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueWeaponModule.js +46 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/VialsModule.js +46 -2
- package/lib/modules/poe.watch/WatchWievModule.js +106 -4
- package/lib/modules/poe.watch/allModules/fetch/fetch.js +11 -2
- package/lib/modules/poe.watch/allModules/functions/getData.js +20 -1
- package/lib/modules/poe.watch/allModules/submodules/AccessoryModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/ArmourModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/BaseModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/BeastModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/CurrencyModule.js +49 -2
- package/lib/modules/poe.watch/allModules/submodules/DeliriumOrbModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/DivsModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/EssenceModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/FlaskModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/FossilModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/FragmentModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/GemModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/InscribedModule.js +49 -1
- package/lib/modules/poe.watch/allModules/submodules/InvitationModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/JewelModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/MapModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/OilModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/ScarabModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/SextantModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/UniqueMapsModule.js +47 -1
- package/lib/modules/poe.watch/allModules/submodules/WeaponModule.js +47 -1
- package/package.json +1 -1
|
@@ -1,13 +1,61 @@
|
|
|
1
1
|
const getData = require("../functions/getData");
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Inscribed Ultimatums.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
3
8
|
class InscribedModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Inscribed Ultimatum data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
4
15
|
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of InscribedModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
5
22
|
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Inscribed Ultimatum data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
6
29
|
this.#queryUrl = `currency${leagueUrl}`;
|
|
7
30
|
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Asynchronously retrieves Inscribed Ultimatum data based on the specified properties.
|
|
34
|
+
*
|
|
35
|
+
* @async
|
|
36
|
+
* @param {Array<string>} requestedProperties - An array of properties to retrieve.
|
|
37
|
+
* @returns {Promise<Object>} A promise that resolves to the retrieved data.
|
|
38
|
+
*/
|
|
8
39
|
async getData(requestedProperties) {
|
|
9
|
-
|
|
40
|
+
try {
|
|
41
|
+
/**
|
|
42
|
+
* Calls the getData function to fetch Inscribed Ultimatum data.
|
|
43
|
+
*
|
|
44
|
+
* @type {Promise<Array<Object>>}
|
|
45
|
+
*/
|
|
46
|
+
return getData(this.#queryUrl, requestedProperties);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
/**
|
|
49
|
+
* Throws an error if there's an issue fetching or processing the Inscribed Ultimatum data.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error}
|
|
52
|
+
*/
|
|
53
|
+
throw new Error(
|
|
54
|
+
`Error fetching Inscribed Ultimatum data: ${error.message}`
|
|
55
|
+
);
|
|
56
|
+
}
|
|
10
57
|
}
|
|
11
58
|
}
|
|
12
59
|
|
|
60
|
+
// Export the InscribedModule class
|
|
13
61
|
module.exports = InscribedModule;
|
|
@@ -1,13 +1,59 @@
|
|
|
1
1
|
const getData = require("../functions/getData");
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Invitations.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
3
8
|
class InvitationModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Invitation data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
4
15
|
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of InvitationModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
5
22
|
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Invitation data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
6
29
|
this.#queryUrl = `invitation${leagueUrl}`;
|
|
7
30
|
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Asynchronously retrieves Invitation data based on the specified properties.
|
|
34
|
+
*
|
|
35
|
+
* @async
|
|
36
|
+
* @param {Array<string>} requestedProperties - An array of properties to retrieve.
|
|
37
|
+
* @returns {Promise<Object>} A promise that resolves to the retrieved data.
|
|
38
|
+
*/
|
|
8
39
|
async getData(requestedProperties) {
|
|
9
|
-
|
|
40
|
+
try {
|
|
41
|
+
/**
|
|
42
|
+
* Calls the getData function to fetch Invitation data.
|
|
43
|
+
*
|
|
44
|
+
* @type {Promise<Array<Object>>}
|
|
45
|
+
*/
|
|
46
|
+
return getData(this.#queryUrl, requestedProperties);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
/**
|
|
49
|
+
* Throws an error if there's an issue fetching or processing the Invitation data.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error}
|
|
52
|
+
*/
|
|
53
|
+
throw new Error(`Error fetching Invitation data: ${error.message}`);
|
|
54
|
+
}
|
|
10
55
|
}
|
|
11
56
|
}
|
|
12
57
|
|
|
58
|
+
// Export the InvitationModule class
|
|
13
59
|
module.exports = InvitationModule;
|
|
@@ -1,13 +1,59 @@
|
|
|
1
1
|
const getData = require("../functions/getData");
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Jewels.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
3
8
|
class JewelModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Jewel data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
4
15
|
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of JewelModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
5
22
|
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Jewel data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
6
29
|
this.#queryUrl = `jewel${leagueUrl}`;
|
|
7
30
|
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Asynchronously retrieves Jewel data based on the specified properties.
|
|
34
|
+
*
|
|
35
|
+
* @async
|
|
36
|
+
* @param {Array<string>} requestedProperties - An array of properties to retrieve.
|
|
37
|
+
* @returns {Promise<Object>} A promise that resolves to the retrieved data.
|
|
38
|
+
*/
|
|
8
39
|
async getData(requestedProperties) {
|
|
9
|
-
|
|
40
|
+
try {
|
|
41
|
+
/**
|
|
42
|
+
* Calls the getData function to fetch Jewel data.
|
|
43
|
+
*
|
|
44
|
+
* @type {Promise<Array<Object>>}
|
|
45
|
+
*/
|
|
46
|
+
return getData(this.#queryUrl, requestedProperties);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
/**
|
|
49
|
+
* Throws an error if there's an issue fetching or processing the Jewel data.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error}
|
|
52
|
+
*/
|
|
53
|
+
throw new Error(`Error fetching Jewel data: ${error.message}`);
|
|
54
|
+
}
|
|
10
55
|
}
|
|
11
56
|
}
|
|
12
57
|
|
|
58
|
+
// Export the JewelModule class
|
|
13
59
|
module.exports = JewelModule;
|
|
@@ -1,13 +1,59 @@
|
|
|
1
1
|
const getData = require("../functions/getData");
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Maps.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
3
8
|
class MapModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Map data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
4
15
|
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of MapModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
5
22
|
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Map data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
6
29
|
this.#queryUrl = `map${leagueUrl}`;
|
|
7
30
|
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Asynchronously retrieves Map data based on the specified properties.
|
|
34
|
+
*
|
|
35
|
+
* @async
|
|
36
|
+
* @param {Array<string>} requestedProperties - An array of properties to retrieve.
|
|
37
|
+
* @returns {Promise<Object>} A promise that resolves to the retrieved data.
|
|
38
|
+
*/
|
|
8
39
|
async getData(requestedProperties) {
|
|
9
|
-
|
|
40
|
+
try {
|
|
41
|
+
/**
|
|
42
|
+
* Calls the getData function to fetch Map data.
|
|
43
|
+
*
|
|
44
|
+
* @type {Promise<Array<Object>>}
|
|
45
|
+
*/
|
|
46
|
+
return getData(this.#queryUrl, requestedProperties);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
/**
|
|
49
|
+
* Throws an error if there's an issue fetching or processing the Map data.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error}
|
|
52
|
+
*/
|
|
53
|
+
throw new Error(`Error fetching Map data: ${error.message}`);
|
|
54
|
+
}
|
|
10
55
|
}
|
|
11
56
|
}
|
|
12
57
|
|
|
58
|
+
// Export the MapModule class
|
|
13
59
|
module.exports = MapModule;
|
|
@@ -1,13 +1,59 @@
|
|
|
1
1
|
const getData = require("../functions/getData");
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Oils.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
3
8
|
class OilModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Oil data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
4
15
|
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of OilModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
5
22
|
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Oil data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
6
29
|
this.#queryUrl = `oil${leagueUrl}`;
|
|
7
30
|
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Asynchronously retrieves Oil data based on the specified properties.
|
|
34
|
+
*
|
|
35
|
+
* @async
|
|
36
|
+
* @param {Array<string>} requestedProperties - An array of properties to retrieve.
|
|
37
|
+
* @returns {Promise<Object>} A promise that resolves to the retrieved data.
|
|
38
|
+
*/
|
|
8
39
|
async getData(requestedProperties) {
|
|
9
|
-
|
|
40
|
+
try {
|
|
41
|
+
/**
|
|
42
|
+
* Calls the getData function to fetch Oil data.
|
|
43
|
+
*
|
|
44
|
+
* @type {Promise<Array<Object>>}
|
|
45
|
+
*/
|
|
46
|
+
return getData(this.#queryUrl, requestedProperties);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
/**
|
|
49
|
+
* Throws an error if there's an issue fetching or processing the Oil data.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error}
|
|
52
|
+
*/
|
|
53
|
+
throw new Error(`Error fetching Oil data: ${error.message}`);
|
|
54
|
+
}
|
|
10
55
|
}
|
|
11
56
|
}
|
|
12
57
|
|
|
58
|
+
// Export the OilModule class
|
|
13
59
|
module.exports = OilModule;
|
|
@@ -1,13 +1,59 @@
|
|
|
1
1
|
const getData = require("../functions/getData");
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Scarabs.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
3
8
|
class ScarabModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Scarab data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
4
15
|
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of ScarabModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
5
22
|
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Scarab data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
6
29
|
this.#queryUrl = `scarab${leagueUrl}`;
|
|
7
30
|
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Asynchronously retrieves Scarab data based on the specified properties.
|
|
34
|
+
*
|
|
35
|
+
* @async
|
|
36
|
+
* @param {Array<string>} requestedProperties - An array of properties to retrieve.
|
|
37
|
+
* @returns {Promise<Object>} A promise that resolves to the retrieved data.
|
|
38
|
+
*/
|
|
8
39
|
async getData(requestedProperties) {
|
|
9
|
-
|
|
40
|
+
try {
|
|
41
|
+
/**
|
|
42
|
+
* Calls the getData function to fetch Scarab data.
|
|
43
|
+
*
|
|
44
|
+
* @type {Promise<Array<Object>>}
|
|
45
|
+
*/
|
|
46
|
+
return getData(this.#queryUrl, requestedProperties);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
/**
|
|
49
|
+
* Throws an error if there's an issue fetching or processing the Scarab data.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error}
|
|
52
|
+
*/
|
|
53
|
+
throw new Error(`Error fetching Scarab data: ${error.message}`);
|
|
54
|
+
}
|
|
10
55
|
}
|
|
11
56
|
}
|
|
12
57
|
|
|
58
|
+
// Export the ScarabModule class
|
|
13
59
|
module.exports = ScarabModule;
|
|
@@ -1,13 +1,59 @@
|
|
|
1
1
|
const getData = require("../functions/getData");
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Sextants.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
3
8
|
class SextantModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Sextant data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
4
15
|
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of SextantModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
5
22
|
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Sextant data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
6
29
|
this.#queryUrl = `sextants${leagueUrl}`;
|
|
7
30
|
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Asynchronously retrieves Sextant data based on the specified properties.
|
|
34
|
+
*
|
|
35
|
+
* @async
|
|
36
|
+
* @param {Array<string>} requestedProperties - An array of properties to retrieve.
|
|
37
|
+
* @returns {Promise<Object>} A promise that resolves to the retrieved data.
|
|
38
|
+
*/
|
|
8
39
|
async getData(requestedProperties) {
|
|
9
|
-
|
|
40
|
+
try {
|
|
41
|
+
/**
|
|
42
|
+
* Calls the getData function to fetch Sextant data.
|
|
43
|
+
*
|
|
44
|
+
* @type {Promise<Array<Object>>}
|
|
45
|
+
*/
|
|
46
|
+
return getData(this.#queryUrl, requestedProperties);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
/**
|
|
49
|
+
* Throws an error if there's an issue fetching or processing the Sextant data.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error}
|
|
52
|
+
*/
|
|
53
|
+
throw new Error(`Error fetching Sextant data: ${error.message}`);
|
|
54
|
+
}
|
|
10
55
|
}
|
|
11
56
|
}
|
|
12
57
|
|
|
58
|
+
// Export the SextantModule class
|
|
13
59
|
module.exports = SextantModule;
|
|
@@ -1,13 +1,59 @@
|
|
|
1
1
|
const getData = require("../functions/getData");
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Unique Maps.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
3
8
|
class UniqueMapsModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Unique Maps data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
4
15
|
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of UniqueMapsModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
5
22
|
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Unique Maps data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
6
29
|
this.#queryUrl = `currency${leagueUrl}`;
|
|
7
30
|
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Asynchronously retrieves Unique Maps data based on the specified properties.
|
|
34
|
+
*
|
|
35
|
+
* @async
|
|
36
|
+
* @param {Array<string>} requestedProperties - An array of properties to retrieve.
|
|
37
|
+
* @returns {Promise<Object>} A promise that resolves to the retrieved data.
|
|
38
|
+
*/
|
|
8
39
|
async getData(requestedProperties) {
|
|
9
|
-
|
|
40
|
+
try {
|
|
41
|
+
/**
|
|
42
|
+
* Calls the getData function to fetch Unique Maps data.
|
|
43
|
+
*
|
|
44
|
+
* @type {Promise<Array<Object>>}
|
|
45
|
+
*/
|
|
46
|
+
return getData(this.#queryUrl, requestedProperties);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
/**
|
|
49
|
+
* Throws an error if there's an issue fetching or processing the Unique Maps data.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error}
|
|
52
|
+
*/
|
|
53
|
+
throw new Error(`Error fetching Unique Maps data: ${error.message}`);
|
|
54
|
+
}
|
|
10
55
|
}
|
|
11
56
|
}
|
|
12
57
|
|
|
58
|
+
// Export the UniqueMapsModule class
|
|
13
59
|
module.exports = UniqueMapsModule;
|
|
@@ -1,13 +1,59 @@
|
|
|
1
1
|
const getData = require("../functions/getData");
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Weapons.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
3
8
|
class WeaponModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Weapon data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
4
15
|
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of WeaponModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
5
22
|
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Weapon data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
6
29
|
this.#queryUrl = `weapon${leagueUrl}`;
|
|
7
30
|
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Asynchronously retrieves Weapon data based on the specified properties.
|
|
34
|
+
*
|
|
35
|
+
* @async
|
|
36
|
+
* @param {Array<string>} requestedProperties - An array of properties to retrieve.
|
|
37
|
+
* @returns {Promise<Object>} A promise that resolves to the retrieved data.
|
|
38
|
+
*/
|
|
8
39
|
async getData(requestedProperties) {
|
|
9
|
-
|
|
40
|
+
try {
|
|
41
|
+
/**
|
|
42
|
+
* Calls the getData function to fetch Weapon data.
|
|
43
|
+
*
|
|
44
|
+
* @type {Promise<Array<Object>>}
|
|
45
|
+
*/
|
|
46
|
+
return getData(this.#queryUrl, requestedProperties);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
/**
|
|
49
|
+
* Throws an error if there's an issue fetching or processing the Weapon data.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error}
|
|
52
|
+
*/
|
|
53
|
+
throw new Error(`Error fetching Weapon data: ${error.message}`);
|
|
54
|
+
}
|
|
10
55
|
}
|
|
11
56
|
}
|
|
12
57
|
|
|
58
|
+
// Export the WeaponModule class
|
|
13
59
|
module.exports = WeaponModule;
|