poe-api-manager 0.2.8 → 1.2.1
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 +12 -2
- package/README.md +31 -9
- package/index.js +4 -0
- package/lib/Utils.js +41 -0
- package/lib/WatchAPI.js +1 -33
- package/lib/modules/poe.ninja/currency/CurrencyBaseClass.js +37 -0
- package/lib/modules/poe.ninja/currency/CurrencyWievModule.js +2 -27
- package/lib/modules/poe.ninja/currency/currencySubmodules/subModules/CurrencyModule.js +8 -52
- package/lib/modules/poe.ninja/currency/currencySubmodules/subModules/FragmentModule.js +8 -52
- package/lib/modules/poe.ninja/currency/{currencySubmodules/functions → methods}/getData.js +2 -2
- package/lib/modules/poe.ninja/item/ItemBaseClass.js +64 -0
- package/lib/modules/poe.ninja/item/ItemWievModule.js +27 -52
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BaseTypeModule.js +8 -48
- package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BeastModule.js +8 -48
- 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/{itemSubmodules/functions → methods}/getData.js +2 -2
- 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/lib/modules/utils/functions/fetch/fetch.js +22 -0
- package/lib/modules/utils/getLeagues.js +24 -0
- package/package.json +1 -1
- 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
|
@@ -1,59 +1,30 @@
|
|
|
1
|
-
const
|
|
1
|
+
const WatchBaseClass = require("../WatchBaseClass");
|
|
2
|
+
const urlGenerator = require("../watchUrlGenerator/urlGenerator");
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @class
|
|
5
|
+
* Subclass of WatchBaseClass for accessing divination card data.
|
|
7
6
|
*/
|
|
8
|
-
class
|
|
7
|
+
class DivModule extends WatchBaseClass {
|
|
9
8
|
/**
|
|
10
|
-
* The query URL for
|
|
11
|
-
*
|
|
12
|
-
* @private
|
|
9
|
+
* The query URL for divination card data.
|
|
13
10
|
* @type {string}
|
|
11
|
+
* @private
|
|
14
12
|
*/
|
|
15
13
|
#queryUrl;
|
|
16
14
|
|
|
17
15
|
/**
|
|
18
|
-
* Creates
|
|
19
|
-
*
|
|
20
|
-
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
16
|
+
* Creates a new instance of DivModule.
|
|
17
|
+
* @param {string} league - The league from which the data will be fetched.
|
|
21
18
|
*/
|
|
22
|
-
constructor(
|
|
19
|
+
constructor(league) {
|
|
23
20
|
/**
|
|
24
|
-
* The
|
|
25
|
-
*
|
|
26
|
-
* @private
|
|
21
|
+
* The type of data being accessed (div).
|
|
27
22
|
* @type {string}
|
|
28
23
|
*/
|
|
29
|
-
|
|
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
|
-
}
|
|
24
|
+
const type = "div";
|
|
25
|
+
super(league, type);
|
|
26
|
+
this.#queryUrl = urlGenerator(league, type);
|
|
55
27
|
}
|
|
56
28
|
}
|
|
57
29
|
|
|
58
|
-
|
|
59
|
-
module.exports = DivsModule;
|
|
30
|
+
module.exports = DivModule;
|
|
@@ -1,59 +1,30 @@
|
|
|
1
|
-
const
|
|
1
|
+
const WatchBaseClass = require("../WatchBaseClass");
|
|
2
|
+
const urlGenerator = require("../watchUrlGenerator/urlGenerator");
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @class
|
|
5
|
+
* Subclass of WatchBaseClass for accessing essence data.
|
|
7
6
|
*/
|
|
8
|
-
class EssenceModule {
|
|
7
|
+
class EssenceModule extends WatchBaseClass {
|
|
9
8
|
/**
|
|
10
|
-
* The query URL for
|
|
11
|
-
*
|
|
12
|
-
* @private
|
|
9
|
+
* The query URL for essence data.
|
|
13
10
|
* @type {string}
|
|
11
|
+
* @private
|
|
14
12
|
*/
|
|
15
13
|
#queryUrl;
|
|
16
14
|
|
|
17
15
|
/**
|
|
18
|
-
* Creates
|
|
19
|
-
*
|
|
20
|
-
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
16
|
+
* Creates a new instance of EssenceModule.
|
|
17
|
+
* @param {string} league - The league from which the data will be fetched.
|
|
21
18
|
*/
|
|
22
|
-
constructor(
|
|
19
|
+
constructor(league) {
|
|
23
20
|
/**
|
|
24
|
-
* The
|
|
25
|
-
*
|
|
26
|
-
* @private
|
|
21
|
+
* The type of data being accessed (essence).
|
|
27
22
|
* @type {string}
|
|
28
23
|
*/
|
|
29
|
-
|
|
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
|
-
}
|
|
24
|
+
const type = "essence";
|
|
25
|
+
super(league, type);
|
|
26
|
+
this.#queryUrl = urlGenerator(league, type);
|
|
55
27
|
}
|
|
56
28
|
}
|
|
57
29
|
|
|
58
|
-
// Export the EssenceModule class
|
|
59
30
|
module.exports = EssenceModule;
|
|
@@ -1,59 +1,30 @@
|
|
|
1
|
-
const
|
|
1
|
+
const WatchBaseClass = require("../WatchBaseClass");
|
|
2
|
+
const urlGenerator = require("../watchUrlGenerator/urlGenerator");
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @class
|
|
5
|
+
* Subclass of WatchBaseClass for accessing flask data.
|
|
7
6
|
*/
|
|
8
|
-
class FlaskModule {
|
|
7
|
+
class FlaskModule extends WatchBaseClass {
|
|
9
8
|
/**
|
|
10
|
-
* The query URL for
|
|
11
|
-
*
|
|
12
|
-
* @private
|
|
9
|
+
* The query URL for flask data.
|
|
13
10
|
* @type {string}
|
|
11
|
+
* @private
|
|
14
12
|
*/
|
|
15
13
|
#queryUrl;
|
|
16
14
|
|
|
17
15
|
/**
|
|
18
|
-
* Creates
|
|
19
|
-
*
|
|
20
|
-
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
16
|
+
* Creates a new instance of FlaskModule.
|
|
17
|
+
* @param {string} league - The league from which the data will be fetched.
|
|
21
18
|
*/
|
|
22
|
-
constructor(
|
|
19
|
+
constructor(league) {
|
|
23
20
|
/**
|
|
24
|
-
* The
|
|
25
|
-
*
|
|
26
|
-
* @private
|
|
21
|
+
* The type of data being accessed (flask).
|
|
27
22
|
* @type {string}
|
|
28
23
|
*/
|
|
29
|
-
|
|
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
|
-
}
|
|
24
|
+
const type = "flask";
|
|
25
|
+
super(league, type);
|
|
26
|
+
this.#queryUrl = urlGenerator(league, type);
|
|
55
27
|
}
|
|
56
28
|
}
|
|
57
29
|
|
|
58
|
-
// Export the FlaskModule class
|
|
59
30
|
module.exports = FlaskModule;
|
|
@@ -1,59 +1,30 @@
|
|
|
1
|
-
const
|
|
1
|
+
const WatchBaseClass = require("../WatchBaseClass");
|
|
2
|
+
const urlGenerator = require("../watchUrlGenerator/urlGenerator");
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @class
|
|
5
|
+
* Subclass of WatchBaseClass for accessing fossil data.
|
|
7
6
|
*/
|
|
8
|
-
class FossilModule {
|
|
7
|
+
class FossilModule extends WatchBaseClass {
|
|
9
8
|
/**
|
|
10
|
-
* The query URL for
|
|
11
|
-
*
|
|
12
|
-
* @private
|
|
9
|
+
* The query URL for fossil data.
|
|
13
10
|
* @type {string}
|
|
11
|
+
* @private
|
|
14
12
|
*/
|
|
15
13
|
#queryUrl;
|
|
16
14
|
|
|
17
15
|
/**
|
|
18
|
-
* Creates
|
|
19
|
-
*
|
|
20
|
-
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
16
|
+
* Creates a new instance of FossilModule.
|
|
17
|
+
* @param {string} league - The league from which the data will be fetched.
|
|
21
18
|
*/
|
|
22
|
-
constructor(
|
|
19
|
+
constructor(league) {
|
|
23
20
|
/**
|
|
24
|
-
* The
|
|
25
|
-
*
|
|
26
|
-
* @private
|
|
21
|
+
* The type of data being accessed (fossil).
|
|
27
22
|
* @type {string}
|
|
28
23
|
*/
|
|
29
|
-
|
|
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
|
-
}
|
|
24
|
+
const type = "fossil";
|
|
25
|
+
super(league, type);
|
|
26
|
+
this.#queryUrl = urlGenerator(league, type);
|
|
55
27
|
}
|
|
56
28
|
}
|
|
57
29
|
|
|
58
|
-
// Export the FossilModule class
|
|
59
30
|
module.exports = FossilModule;
|
|
@@ -1,59 +1,30 @@
|
|
|
1
|
-
const
|
|
1
|
+
const WatchBaseClass = require("../WatchBaseClass");
|
|
2
|
+
const urlGenerator = require("../watchUrlGenerator/urlGenerator");
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @class
|
|
5
|
+
* Subclass of WatchBaseClass for accessing fragment data.
|
|
7
6
|
*/
|
|
8
|
-
class FragmentModule {
|
|
7
|
+
class FragmentModule extends WatchBaseClass {
|
|
9
8
|
/**
|
|
10
|
-
* The query URL for
|
|
11
|
-
*
|
|
12
|
-
* @private
|
|
9
|
+
* The query URL for fragment data.
|
|
13
10
|
* @type {string}
|
|
11
|
+
* @private
|
|
14
12
|
*/
|
|
15
13
|
#queryUrl;
|
|
16
14
|
|
|
17
15
|
/**
|
|
18
|
-
* Creates
|
|
19
|
-
*
|
|
20
|
-
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
16
|
+
* Creates a new instance of FragmentModule.
|
|
17
|
+
* @param {string} league - The league from which the data will be fetched.
|
|
21
18
|
*/
|
|
22
|
-
constructor(
|
|
19
|
+
constructor(league) {
|
|
23
20
|
/**
|
|
24
|
-
* The
|
|
25
|
-
*
|
|
26
|
-
* @private
|
|
21
|
+
* The type of data being accessed (fragment).
|
|
27
22
|
* @type {string}
|
|
28
23
|
*/
|
|
29
|
-
|
|
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
|
-
}
|
|
24
|
+
const type = "fragment";
|
|
25
|
+
super(league, type);
|
|
26
|
+
this.#queryUrl = urlGenerator(league, type);
|
|
55
27
|
}
|
|
56
28
|
}
|
|
57
29
|
|
|
58
|
-
// Export the FragmentModule class
|
|
59
30
|
module.exports = FragmentModule;
|
|
@@ -1,88 +1,46 @@
|
|
|
1
|
-
const
|
|
1
|
+
const WatchBaseClass = require("../WatchBaseClass");
|
|
2
|
+
const getCategory = require("../methods/getCategory");
|
|
3
|
+
const urlGenerator = require("../watchUrlGenerator/urlGenerator");
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @class
|
|
6
|
+
* Subclass of WatchBaseClass for accessing gem data.
|
|
7
7
|
*/
|
|
8
|
-
class GemModule {
|
|
8
|
+
class GemModule extends WatchBaseClass {
|
|
9
9
|
/**
|
|
10
|
-
* The query URL for
|
|
11
|
-
*
|
|
12
|
-
* @private
|
|
10
|
+
* The query URL for gem data.
|
|
13
11
|
* @type {string}
|
|
12
|
+
* @private
|
|
14
13
|
*/
|
|
15
14
|
#queryUrl;
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
|
-
* Creates
|
|
19
|
-
*
|
|
20
|
-
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
17
|
+
* Creates a new instance of GemModule.
|
|
18
|
+
* @param {string} league - The league from which the data will be fetched.
|
|
21
19
|
*/
|
|
22
|
-
constructor(
|
|
20
|
+
constructor(league) {
|
|
23
21
|
/**
|
|
24
|
-
* The
|
|
25
|
-
*
|
|
26
|
-
* @private
|
|
22
|
+
* The type of data being accessed (gem).
|
|
27
23
|
* @type {string}
|
|
28
24
|
*/
|
|
29
|
-
|
|
25
|
+
const type = "gem";
|
|
26
|
+
super(league, type);
|
|
27
|
+
this.#queryUrl = urlGenerator(league, type);
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
/**
|
|
33
|
-
*
|
|
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
|
-
* Asynchronously retrieves gems data based on the specified category name.
|
|
58
|
-
*
|
|
31
|
+
* Retrieves category data for gems.
|
|
59
32
|
* @async
|
|
60
33
|
* @param {string} categoryName - The name of the category to retrieve.
|
|
61
|
-
*
|
|
62
|
-
* @
|
|
63
|
-
* @throws {Error} - Throws an error if there is an issue fetching or processing the gems data for the specified category.
|
|
64
|
-
*
|
|
34
|
+
* @returns {Promise<Array<Object>>} - A Promise containing data for the specified category.
|
|
35
|
+
* @throws {Error} - Throws errors encountered while fetching data.
|
|
65
36
|
*/
|
|
66
37
|
async getCategory(categoryName) {
|
|
67
38
|
try {
|
|
68
|
-
|
|
69
|
-
* Calls the getCategory function to fetch gems data based on category name.
|
|
70
|
-
*
|
|
71
|
-
* @type {Promise<Array<Object>>}
|
|
72
|
-
*/
|
|
73
|
-
return getCategory(this.#queryUrl, categoryName);
|
|
39
|
+
return await getCategory(this.#queryUrl, categoryName);
|
|
74
40
|
} catch (error) {
|
|
75
|
-
|
|
76
|
-
* Throws an error if there's an issue fetching or processing the gems data for the specified category.
|
|
77
|
-
*
|
|
78
|
-
* @throws {Error}
|
|
79
|
-
*/
|
|
80
|
-
throw new Error(
|
|
81
|
-
`Error fetching data Skill Gem Category: ${error.message}`
|
|
82
|
-
);
|
|
41
|
+
throw new Error(`Error fetching Gem data: ${error.message}`);
|
|
83
42
|
}
|
|
84
43
|
}
|
|
85
44
|
}
|
|
86
45
|
|
|
87
|
-
// Export the GemModule class
|
|
88
46
|
module.exports = GemModule;
|
|
@@ -1,61 +1,30 @@
|
|
|
1
|
-
const
|
|
1
|
+
const WatchBaseClass = require("../WatchBaseClass");
|
|
2
|
+
const urlGenerator = require("../watchUrlGenerator/urlGenerator");
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @class
|
|
5
|
+
* Subclass of WatchBaseClass for accessing inscribed item data.
|
|
7
6
|
*/
|
|
8
|
-
class InscribedModule {
|
|
7
|
+
class InscribedModule extends WatchBaseClass {
|
|
9
8
|
/**
|
|
10
|
-
* The query URL for
|
|
11
|
-
*
|
|
12
|
-
* @private
|
|
9
|
+
* The query URL for inscribed item data.
|
|
13
10
|
* @type {string}
|
|
11
|
+
* @private
|
|
14
12
|
*/
|
|
15
13
|
#queryUrl;
|
|
16
14
|
|
|
17
15
|
/**
|
|
18
|
-
* Creates
|
|
19
|
-
*
|
|
20
|
-
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
16
|
+
* Creates a new instance of InscribedModule.
|
|
17
|
+
* @param {string} league - The league from which the data will be fetched.
|
|
21
18
|
*/
|
|
22
|
-
constructor(
|
|
19
|
+
constructor(league) {
|
|
23
20
|
/**
|
|
24
|
-
* The
|
|
25
|
-
*
|
|
26
|
-
* @private
|
|
21
|
+
* The type of data being accessed (inscribed).
|
|
27
22
|
* @type {string}
|
|
28
23
|
*/
|
|
29
|
-
|
|
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
|
-
}
|
|
24
|
+
const type = "inscribed";
|
|
25
|
+
super(league, type);
|
|
26
|
+
this.#queryUrl = urlGenerator(league, type);
|
|
57
27
|
}
|
|
58
28
|
}
|
|
59
29
|
|
|
60
|
-
// Export the InscribedModule class
|
|
61
30
|
module.exports = InscribedModule;
|
|
@@ -1,59 +1,30 @@
|
|
|
1
|
-
const
|
|
1
|
+
const WatchBaseClass = require("../WatchBaseClass");
|
|
2
|
+
const urlGenerator = require("../watchUrlGenerator/urlGenerator");
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @class
|
|
5
|
+
* Subclass of WatchBaseClass for accessing invitation data.
|
|
7
6
|
*/
|
|
8
|
-
class InvitationModule {
|
|
7
|
+
class InvitationModule extends WatchBaseClass {
|
|
9
8
|
/**
|
|
10
|
-
* The query URL for
|
|
11
|
-
*
|
|
12
|
-
* @private
|
|
9
|
+
* The query URL for invitation data.
|
|
13
10
|
* @type {string}
|
|
11
|
+
* @private
|
|
14
12
|
*/
|
|
15
13
|
#queryUrl;
|
|
16
14
|
|
|
17
15
|
/**
|
|
18
|
-
* Creates
|
|
19
|
-
*
|
|
20
|
-
* @param {string} leagueUrl - The league URL to fetch data from.
|
|
16
|
+
* Creates a new instance of InvitationModule.
|
|
17
|
+
* @param {string} league - The league from which the data will be fetched.
|
|
21
18
|
*/
|
|
22
|
-
constructor(
|
|
19
|
+
constructor(league) {
|
|
23
20
|
/**
|
|
24
|
-
* The
|
|
25
|
-
*
|
|
26
|
-
* @private
|
|
21
|
+
* The type of data being accessed (invitation).
|
|
27
22
|
* @type {string}
|
|
28
23
|
*/
|
|
29
|
-
|
|
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
|
-
}
|
|
24
|
+
const type = "invitation";
|
|
25
|
+
super(league, type);
|
|
26
|
+
this.#queryUrl = urlGenerator(league, type);
|
|
55
27
|
}
|
|
56
28
|
}
|
|
57
29
|
|
|
58
|
-
// Export the InvitationModule class
|
|
59
30
|
module.exports = InvitationModule;
|