poe-api-manager 0.1.0 → 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 +11 -2
- package/README.md +78 -17
- package/index.js +5 -1
- package/lib/NinjaAPI.js +27 -5
- package/lib/WatchAPI.js +56 -0
- package/lib/config/poeNinja/url.js +9 -0
- package/lib/config/poeWatch/url.js +12 -0
- package/lib/modules/mainfunctions/filter/propertyFilter.js +36 -0
- package/lib/modules/poe.ninja/currency/CurrencyWievModule.js +44 -5
- 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 +24 -1
- package/lib/modules/poe.ninja/currency/currencySubmodules/subModules/CurrencyModule.js +50 -4
- package/lib/modules/poe.ninja/currency/currencySubmodules/subModules/FragmentModule.js +50 -4
- package/lib/modules/poe.ninja/item/ItemWievModule.js +140 -5
- package/lib/modules/poe.ninja/item/itemFetch/fetchItem.js +23 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/functions/getData.js +20 -1
- package/lib/modules/poe.ninja/item/itemSubmodules/itemSubModules.js +0 -2
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BaseTypeModule.js +45 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BeastModule.js +45 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BlightRavagedMapModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BlightedMapModule.js +47 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ClusterJewelModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/DeliriumOrbsModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/DivinationCardModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/EssenceModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/FossilModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/HelmetEnchantModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/IncubatorModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/InvitationModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/MapModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/MemoryModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/OilModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/OmenModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ResonatorModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ScarabModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/SkillGemModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueAccessoryModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueArmourModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueFlaskModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueJewelModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueMapModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueRelicModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueWeaponModule.js +50 -4
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/VialsModule.js +50 -4
- package/lib/modules/poe.watch/WatchWievModule.js +130 -0
- package/lib/modules/poe.watch/allModules/Modules.js +23 -0
- package/lib/modules/poe.watch/allModules/fetch/fetch.js +28 -0
- package/lib/modules/poe.watch/allModules/functions/getData.js +39 -0
- package/lib/modules/poe.watch/allModules/submodules/AccessoryModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/ArmourModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/BaseModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/BeastModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/CurrencyModule.js +60 -0
- package/lib/modules/poe.watch/allModules/submodules/DeliriumOrbModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/DivsModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/EssenceModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/FlaskModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/FossilModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/FragmentModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/GemModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/InscribedModule.js +61 -0
- package/lib/modules/poe.watch/allModules/submodules/InvitationModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/JewelModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/MapModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/OilModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/ScarabModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/SextantModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/UniqueMapsModule.js +59 -0
- package/lib/modules/poe.watch/allModules/submodules/WeaponModule.js +59 -0
- package/package.json +13 -5
- package/lib/modules/filter/propertyFilter.js +0 -18
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const getData = require("../functions/getData");
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Divination Cards.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
8
|
+
class DivsModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Divination Card data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of DivsModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
22
|
+
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Divination Card data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
29
|
+
this.#queryUrl = `currency${leagueUrl}`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Asynchronously retrieves Divination Card 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
|
+
*/
|
|
39
|
+
async getData(requestedProperties) {
|
|
40
|
+
try {
|
|
41
|
+
/**
|
|
42
|
+
* Calls the getData function to fetch Divination Card 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 Divination Card data.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error}
|
|
52
|
+
*/
|
|
53
|
+
throw new Error(`Error fetching Divination Card data: ${error.message}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Export the DivsModule class
|
|
59
|
+
module.exports = DivsModule;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const getData = require("../functions/getData");
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Essences.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
8
|
+
class EssenceModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Essence data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of EssenceModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
22
|
+
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Essence data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
29
|
+
this.#queryUrl = `essence${leagueUrl}`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Asynchronously retrieves Essence 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
|
+
*/
|
|
39
|
+
async getData(requestedProperties) {
|
|
40
|
+
try {
|
|
41
|
+
/**
|
|
42
|
+
* Calls the getData function to fetch Essence 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 Essence data.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error}
|
|
52
|
+
*/
|
|
53
|
+
throw new Error(`Error fetching Essence data: ${error.message}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Export the EssenceModule class
|
|
59
|
+
module.exports = EssenceModule;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const getData = require("../functions/getData");
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Flasks.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
8
|
+
class FlaskModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Flask data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of FlaskModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
22
|
+
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Flask data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
29
|
+
this.#queryUrl = `flask${leagueUrl}`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Asynchronously retrieves Flask 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
|
+
*/
|
|
39
|
+
async getData(requestedProperties) {
|
|
40
|
+
try {
|
|
41
|
+
/**
|
|
42
|
+
* Calls the getData function to fetch Flask 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 Flask data.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error}
|
|
52
|
+
*/
|
|
53
|
+
throw new Error(`Error fetching Flask data: ${error.message}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Export the FlaskModule class
|
|
59
|
+
module.exports = FlaskModule;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const getData = require("../functions/getData");
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Fossils.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
8
|
+
class FossilModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Fossil data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of FossilModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
22
|
+
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Fossil data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
29
|
+
this.#queryUrl = `fossil${leagueUrl}`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Asynchronously retrieves Fossil 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
|
+
*/
|
|
39
|
+
async getData(requestedProperties) {
|
|
40
|
+
try {
|
|
41
|
+
/**
|
|
42
|
+
* Calls the getData function to fetch Fossil 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 Fossil data.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error}
|
|
52
|
+
*/
|
|
53
|
+
throw new Error(`Error fetching Fossil data: ${error.message}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Export the FossilModule class
|
|
59
|
+
module.exports = FossilModule;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const getData = require("../functions/getData");
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Fragments.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
8
|
+
class FragmentModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Fragment data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of FragmentModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
22
|
+
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Fragment data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
29
|
+
this.#queryUrl = `fragment${leagueUrl}`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Asynchronously retrieves Fragment 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
|
+
*/
|
|
39
|
+
async getData(requestedProperties) {
|
|
40
|
+
try {
|
|
41
|
+
/**
|
|
42
|
+
* Calls the getData function to fetch Fragment 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 Fragment data.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error}
|
|
52
|
+
*/
|
|
53
|
+
throw new Error(`Error fetching Fragment data: ${error.message}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Export the FragmentModule class
|
|
59
|
+
module.exports = FragmentModule;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const getData = require("../functions/getData");
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Skill Gems.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
8
|
+
class GemModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Skill Gem data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of GemModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
22
|
+
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Skill Gem data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
29
|
+
this.#queryUrl = `gem${leagueUrl}`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Asynchronously retrieves Skill Gem 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
|
+
*/
|
|
39
|
+
async getData(requestedProperties) {
|
|
40
|
+
try {
|
|
41
|
+
/**
|
|
42
|
+
* Calls the getData function to fetch Skill Gem 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 Skill Gem data.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error}
|
|
52
|
+
*/
|
|
53
|
+
throw new Error(`Error fetching Skill Gem data: ${error.message}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Export the GemModule class
|
|
59
|
+
module.exports = GemModule;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const getData = require("../functions/getData");
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Inscribed Ultimatums.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
8
|
+
class InscribedModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Inscribed Ultimatum data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of InscribedModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
22
|
+
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Inscribed Ultimatum data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
29
|
+
this.#queryUrl = `currency${leagueUrl}`;
|
|
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
|
+
*/
|
|
39
|
+
async getData(requestedProperties) {
|
|
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
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Export the InscribedModule class
|
|
61
|
+
module.exports = InscribedModule;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const getData = require("../functions/getData");
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Invitations.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
8
|
+
class InvitationModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Invitation data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of InvitationModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
22
|
+
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Invitation data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
29
|
+
this.#queryUrl = `invitation${leagueUrl}`;
|
|
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
|
+
*/
|
|
39
|
+
async getData(requestedProperties) {
|
|
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
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Export the InvitationModule class
|
|
59
|
+
module.exports = InvitationModule;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const getData = require("../functions/getData");
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Jewels.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
8
|
+
class JewelModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Jewel data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of JewelModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
22
|
+
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Jewel data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
29
|
+
this.#queryUrl = `jewel${leagueUrl}`;
|
|
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
|
+
*/
|
|
39
|
+
async getData(requestedProperties) {
|
|
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
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Export the JewelModule class
|
|
59
|
+
module.exports = JewelModule;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const getData = require("../functions/getData");
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Maps.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
8
|
+
class MapModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Map data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of MapModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
22
|
+
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Map data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
29
|
+
this.#queryUrl = `map${leagueUrl}`;
|
|
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
|
+
*/
|
|
39
|
+
async getData(requestedProperties) {
|
|
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
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Export the MapModule class
|
|
59
|
+
module.exports = MapModule;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const getData = require("../functions/getData");
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents a module for fetching data related to Oils.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
*/
|
|
8
|
+
class OilModule {
|
|
9
|
+
/**
|
|
10
|
+
* The query URL for fetching Oil data.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
#queryUrl;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of OilModule.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
21
|
+
*/
|
|
22
|
+
constructor(leagueUrl) {
|
|
23
|
+
/**
|
|
24
|
+
* The constructed query URL for fetching Oil data.
|
|
25
|
+
*
|
|
26
|
+
* @private
|
|
27
|
+
* @type {string}
|
|
28
|
+
*/
|
|
29
|
+
this.#queryUrl = `oil${leagueUrl}`;
|
|
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
|
+
*/
|
|
39
|
+
async getData(requestedProperties) {
|
|
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
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Export the OilModule class
|
|
59
|
+
module.exports = OilModule;
|