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.
Files changed (75) hide show
  1. package/.github/workflows/CI_CD.yml +53 -0
  2. package/Changelog.md +11 -0
  3. package/README.md +25 -12
  4. package/index.js +2 -0
  5. package/lib/Utils.js +15 -0
  6. package/lib/WatchAPI.js +1 -33
  7. package/lib/modules/poe.ninja/currency/CurrencyBaseClass.js +47 -0
  8. package/lib/modules/poe.ninja/currency/CurrencyWievModule.js +2 -27
  9. package/lib/modules/poe.ninja/currency/currencyFetch/fetchCurrency.js +5 -4
  10. package/lib/modules/poe.ninja/currency/currencySubmodules/subModules/CurrencyModule.js +33 -40
  11. package/lib/modules/poe.ninja/currency/currencySubmodules/subModules/FragmentModule.js +8 -52
  12. package/lib/modules/poe.ninja/currency/currencyUrlGenerator/CurrencyUrlGenerator.js +9 -0
  13. package/lib/modules/poe.ninja/currency/{currencySubmodules/functions → methods}/getData.js +4 -4
  14. package/lib/modules/poe.ninja/currency/methods/getQuickCurrency.js +28 -0
  15. package/lib/modules/poe.ninja/item/ItemBaseClass.js +40 -0
  16. package/lib/modules/poe.ninja/item/ItemWievModule.js +27 -52
  17. package/lib/modules/poe.ninja/item/itemFetch/fetchItem.js +5 -10
  18. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BaseTypeModule.js +8 -48
  19. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BeastModule.js +11 -46
  20. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BlightRavagedMapModule.js +9 -54
  21. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BlightedMapModule.js +7 -49
  22. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ClusterJewelModule.js +7 -52
  23. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/DeliriumOrbsModule.js +7 -52
  24. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/DivinationCardModule.js +7 -52
  25. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/EssenceModule.js +7 -52
  26. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/FossilModule.js +7 -52
  27. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/HelmetEnchantModule.js +7 -52
  28. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/IncubatorModule.js +7 -52
  29. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/InvitationModule.js +7 -52
  30. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/MapModule.js +7 -52
  31. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/MemoryModule.js +7 -52
  32. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/OilModule.js +7 -52
  33. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/OmenModule.js +7 -52
  34. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ResonatorModule.js +7 -52
  35. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ScarabModule.js +7 -52
  36. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/SkillGemModule.js +7 -52
  37. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueAccessoryModule.js +7 -52
  38. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueArmourModule.js +7 -52
  39. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueFlaskModule.js +7 -52
  40. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueJewelModule.js +7 -52
  41. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueMapModule.js +7 -52
  42. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueRelicModule.js +7 -52
  43. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueWeaponModule.js +7 -52
  44. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/VialsModule.js +7 -52
  45. package/lib/modules/poe.ninja/item/itemUrlGenerator/ItemUrlGenerator.js +9 -0
  46. package/lib/modules/poe.ninja/item/{itemSubmodules/functions → methods}/getData.js +5 -11
  47. package/lib/modules/poe.watch/allModules/WatchBaseClass.js +45 -0
  48. package/lib/modules/poe.watch/allModules/fetch/fetch.js +1 -4
  49. package/lib/modules/poe.watch/allModules/submodules/AccessoryModule.js +19 -62
  50. package/lib/modules/poe.watch/allModules/submodules/ArmourModule.js +19 -60
  51. package/lib/modules/poe.watch/allModules/submodules/BaseModule.js +19 -59
  52. package/lib/modules/poe.watch/allModules/submodules/BeastModule.js +13 -42
  53. package/lib/modules/poe.watch/allModules/submodules/CurrencyModule.js +13 -43
  54. package/lib/modules/poe.watch/allModules/submodules/DeliriumOrbModule.js +20 -42
  55. package/lib/modules/poe.watch/allModules/submodules/DivsModule.js +14 -43
  56. package/lib/modules/poe.watch/allModules/submodules/EssenceModule.js +13 -42
  57. package/lib/modules/poe.watch/allModules/submodules/FlaskModule.js +13 -42
  58. package/lib/modules/poe.watch/allModules/submodules/FossilModule.js +13 -42
  59. package/lib/modules/poe.watch/allModules/submodules/FragmentModule.js +13 -42
  60. package/lib/modules/poe.watch/allModules/submodules/GemModule.js +19 -61
  61. package/lib/modules/poe.watch/allModules/submodules/InscribedModule.js +13 -44
  62. package/lib/modules/poe.watch/allModules/submodules/InvitationModule.js +13 -42
  63. package/lib/modules/poe.watch/allModules/submodules/JewelModule.js +13 -42
  64. package/lib/modules/poe.watch/allModules/submodules/MapModule.js +13 -42
  65. package/lib/modules/poe.watch/allModules/submodules/OilModule.js +13 -42
  66. package/lib/modules/poe.watch/allModules/submodules/ScarabModule.js +13 -42
  67. package/lib/modules/poe.watch/allModules/submodules/SextantModule.js +13 -42
  68. package/lib/modules/poe.watch/allModules/submodules/UniqueMapsModule.js +13 -42
  69. package/lib/modules/poe.watch/allModules/submodules/WeaponModule.js +19 -59
  70. package/lib/modules/poe.watch/allModules/watchUrlGenerator/urlGenerator.js +9 -0
  71. package/package.json +4 -2
  72. package/lib/config/poeNinja/url.js +0 -12
  73. package/lib/config/poeWatch/url.js +0 -12
  74. /package/lib/modules/poe.watch/allModules/{functions → methods}/getCategory.js +0 -0
  75. /package/lib/modules/poe.watch/allModules/{functions → methods}/getData.js +0 -0
@@ -1,60 +1,15 @@
1
- const getData = require("../functions/getData");
2
-
1
+ const ItemBaseClass = require("../../ItemBaseClass");
3
2
  /**
4
- * Represents a module for fetching data related to Divination Cards.
5
- *
6
- * @class
3
+ * Represents a module for handling divination cards.
4
+ * @extends ItemBaseClass
7
5
  */
8
- class DivinationCardModule {
9
- /**
10
- * The URL for fetching data.
11
- *
12
- * @private
13
- * @type {string}
14
- */
15
- #url;
16
-
17
- /**
18
- * The type of data (DivinationCard in this case).
19
- *
20
- * @private
21
- * @type {string}
22
- */
23
- #type;
24
-
6
+ class DivinationCardModule extends ItemBaseClass {
25
7
  /**
26
8
  * Creates an instance of DivinationCardModule.
27
- *
28
- * @param {string} url - The URL to fetch data from.
29
- */
30
- constructor(url) {
31
- this.#url = url;
32
- this.#type = "DivinationCard";
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
- async getData(requestedProperties) {
43
- try {
44
- /**
45
- * Calls the getData function to fetch DivinationCard 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 DivinationCard data.
53
- *
54
- * @throws {Error}
55
- */
56
- throw new Error(`Error fetching DivinationCard data: ${error.message}`);
57
- }
11
+ constructor(league) {
12
+ super(league, "DivinationCard");
58
13
  }
59
14
  }
60
15
 
@@ -1,60 +1,15 @@
1
- const getData = require("../functions/getData");
2
-
1
+ const ItemBaseClass = require("../../ItemBaseClass");
3
2
  /**
4
- * Represents a module for fetching data related to Essences.
5
- *
6
- * @class
3
+ * Represents a module for handling essences.
4
+ * @extends ItemBaseClass
7
5
  */
8
- class EssenceModule {
9
- /**
10
- * The URL for fetching data.
11
- *
12
- * @private
13
- * @type {string}
14
- */
15
- #url;
16
-
17
- /**
18
- * The type of data (Essence in this case).
19
- *
20
- * @private
21
- * @type {string}
22
- */
23
- #type;
24
-
6
+ class EssenceModule extends ItemBaseClass {
25
7
  /**
26
8
  * Creates an instance of EssenceModule.
27
- *
28
- * @param {string} url - The URL to fetch data from.
29
- */
30
- constructor(url) {
31
- this.#url = url;
32
- this.#type = "Essence";
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
- async getData(requestedProperties) {
43
- try {
44
- /**
45
- * Calls the getData function to fetch Essence 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 Essence data.
53
- *
54
- * @throws {Error}
55
- */
56
- throw new Error(`Error fetching Essence data: ${error.message}`);
57
- }
11
+ constructor(league) {
12
+ super(league, "Essence");
58
13
  }
59
14
  }
60
15
 
@@ -1,60 +1,15 @@
1
- const getData = require("../functions/getData");
2
-
1
+ const ItemBaseClass = require("../../ItemBaseClass");
3
2
  /**
4
- * Represents a module for fetching data related to Fossils.
5
- *
6
- * @class
3
+ * Represents a module for handling fossils.
4
+ * @extends ItemBaseClass
7
5
  */
8
- class FossilModule {
9
- /**
10
- * The URL for fetching data.
11
- *
12
- * @private
13
- * @type {string}
14
- */
15
- #url;
16
-
17
- /**
18
- * The type of data (Fossil in this case).
19
- *
20
- * @private
21
- * @type {string}
22
- */
23
- #type;
24
-
6
+ class FossilModule extends ItemBaseClass {
25
7
  /**
26
8
  * Creates an instance of FossilModule.
27
- *
28
- * @param {string} url - The URL to fetch data from.
29
- */
30
- constructor(url) {
31
- this.#url = url;
32
- this.#type = "Fossil";
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
- async getData(requestedProperties) {
43
- try {
44
- /**
45
- * Calls the getData function to fetch Fossil 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 Fossil data.
53
- *
54
- * @throws {Error}
55
- */
56
- throw new Error(`Error fetching Fossil data: ${error.message}`);
57
- }
11
+ constructor(league) {
12
+ super(league, "Fossil");
58
13
  }
59
14
  }
60
15
 
@@ -1,60 +1,15 @@
1
- const getData = require("../functions/getData");
2
-
1
+ const ItemBaseClass = require("../../ItemBaseClass");
3
2
  /**
4
- * Represents a module for fetching data related to Helmet Enchants.
5
- *
6
- * @class
3
+ * Represents a module for handling helmet enchants.
4
+ * @extends ItemBaseClass
7
5
  */
8
- class HelmetEnchantModule {
9
- /**
10
- * The URL for fetching data.
11
- *
12
- * @private
13
- * @type {string}
14
- */
15
- #url;
16
-
17
- /**
18
- * The type of data (HelmetEnchant in this case).
19
- *
20
- * @private
21
- * @type {string}
22
- */
23
- #type;
24
-
6
+ class HelmetEnchantModule extends ItemBaseClass {
25
7
  /**
26
8
  * Creates an instance of HelmetEnchantModule.
27
- *
28
- * @param {string} url - The URL to fetch data from.
29
- */
30
- constructor(url) {
31
- this.#url = url;
32
- this.#type = "HelmetEnchant";
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
- async getData(requestedProperties) {
43
- try {
44
- /**
45
- * Calls the getData function to fetch HelmetEnchant 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 HelmetEnchant data.
53
- *
54
- * @throws {Error}
55
- */
56
- throw new Error(`Error fetching HelmetEnchant data: ${error.message}`);
57
- }
11
+ constructor(league) {
12
+ super(league, "HelmetEnchant");
58
13
  }
59
14
  }
60
15
 
@@ -1,60 +1,15 @@
1
- const getData = require("../functions/getData");
2
-
1
+ const ItemBaseClass = require("../../ItemBaseClass");
3
2
  /**
4
- * Represents a module for fetching data related to Incubators.
5
- *
6
- * @class
3
+ * Represents a module for handling incubators.
4
+ * @extends ItemBaseClass
7
5
  */
8
- class IncubatorModule {
9
- /**
10
- * The URL for fetching data.
11
- *
12
- * @private
13
- * @type {string}
14
- */
15
- #url;
16
-
17
- /**
18
- * The type of data (Incubator in this case).
19
- *
20
- * @private
21
- * @type {string}
22
- */
23
- #type;
24
-
6
+ class IncubatorModule extends ItemBaseClass {
25
7
  /**
26
8
  * Creates an instance of IncubatorModule.
27
- *
28
- * @param {string} url - The URL to fetch data from.
29
- */
30
- constructor(url) {
31
- this.#url = url;
32
- this.#type = "Incubator";
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
- async getData(requestedProperties) {
43
- try {
44
- /**
45
- * Calls the getData function to fetch Incubator 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 Incubator data.
53
- *
54
- * @throws {Error}
55
- */
56
- throw new Error(`Error fetching Incubator data: ${error.message}`);
57
- }
11
+ constructor(league) {
12
+ super(league, "Incubator");
58
13
  }
59
14
  }
60
15
 
@@ -1,60 +1,15 @@
1
- const getData = require("../functions/getData");
2
-
1
+ const ItemBaseClass = require("../../ItemBaseClass");
3
2
  /**
4
- * Represents a module for fetching data related to Invitations.
5
- *
6
- * @class
3
+ * Represents a module for handling invitations.
4
+ * @extends ItemBaseClass
7
5
  */
8
- class InvitationModule {
9
- /**
10
- * The URL for fetching data.
11
- *
12
- * @private
13
- * @type {string}
14
- */
15
- #url;
16
-
17
- /**
18
- * The type of data (Invitation in this case).
19
- *
20
- * @private
21
- * @type {string}
22
- */
23
- #type;
24
-
6
+ class InvitationModule extends ItemBaseClass {
25
7
  /**
26
8
  * Creates an instance of InvitationModule.
27
- *
28
- * @param {string} url - The URL to fetch data from.
29
- */
30
- constructor(url) {
31
- this.#url = url;
32
- this.#type = "Invitation";
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
- async getData(requestedProperties) {
43
- try {
44
- /**
45
- * Calls the getData function to fetch Invitation 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 Invitation data.
53
- *
54
- * @throws {Error}
55
- */
56
- throw new Error(`Error fetching Invitation data: ${error.message}`);
57
- }
11
+ constructor(league) {
12
+ super(league, "Invitation");
58
13
  }
59
14
  }
60
15
 
@@ -1,60 +1,15 @@
1
- const getData = require("../functions/getData");
2
-
1
+ const ItemBaseClass = require("../../ItemBaseClass");
3
2
  /**
4
- * Represents a module for fetching data related to Maps.
5
- *
6
- * @class
3
+ * Represents a module for handling maps.
4
+ * @extends ItemBaseClass
7
5
  */
8
- class MapModule {
9
- /**
10
- * The URL for fetching data.
11
- *
12
- * @private
13
- * @type {string}
14
- */
15
- #url;
16
-
17
- /**
18
- * The type of data (Map in this case).
19
- *
20
- * @private
21
- * @type {string}
22
- */
23
- #type;
24
-
6
+ class MapModule extends ItemBaseClass {
25
7
  /**
26
8
  * Creates an instance of MapModule.
27
- *
28
- * @param {string} url - The URL to fetch data from.
29
- */
30
- constructor(url) {
31
- this.#url = url;
32
- this.#type = "Map";
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
- async getData(requestedProperties) {
43
- try {
44
- /**
45
- * Calls the getData function to fetch Map 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 Map data.
53
- *
54
- * @throws {Error}
55
- */
56
- throw new Error(`Error fetching Map data: ${error.message}`);
57
- }
11
+ constructor(league) {
12
+ super(league, "Map");
58
13
  }
59
14
  }
60
15
 
@@ -1,60 +1,15 @@
1
- const getData = require("../functions/getData");
2
-
1
+ const ItemBaseClass = require("../../ItemBaseClass");
3
2
  /**
4
- * Represents a module for fetching data related to Memories.
5
- *
6
- * @class
3
+ * Represents a module for handling memories.
4
+ * @extends ItemBaseClass
7
5
  */
8
- class MemoryModule {
9
- /**
10
- * The URL for fetching data.
11
- *
12
- * @private
13
- * @type {string}
14
- */
15
- #url;
16
-
17
- /**
18
- * The type of data (Memory in this case).
19
- *
20
- * @private
21
- * @type {string}
22
- */
23
- #type;
24
-
6
+ class MemoryModule extends ItemBaseClass {
25
7
  /**
26
8
  * Creates an instance of MemoryModule.
27
- *
28
- * @param {string} url - The URL to fetch data from.
29
- */
30
- constructor(url) {
31
- this.#url = url;
32
- this.#type = "Memory";
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
- async getData(requestedProperties) {
43
- try {
44
- /**
45
- * Calls the getData function to fetch Memory 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 Memory data.
53
- *
54
- * @throws {Error}
55
- */
56
- throw new Error(`Error fetching Memory data: ${error.message}`);
57
- }
11
+ constructor(league) {
12
+ super(league, "Memory");
58
13
  }
59
14
  }
60
15
 
@@ -1,60 +1,15 @@
1
- const getData = require("../functions/getData");
2
-
1
+ const ItemBaseClass = require("../../ItemBaseClass");
3
2
  /**
4
- * Represents a module for fetching data related to Oils.
5
- *
6
- * @class
3
+ * Represents a module for handling oils.
4
+ * @extends ItemBaseClass
7
5
  */
8
- class OilModule {
9
- /**
10
- * The URL for fetching data.
11
- *
12
- * @private
13
- * @type {string}
14
- */
15
- #url;
16
-
17
- /**
18
- * The type of data (Oil in this case).
19
- *
20
- * @private
21
- * @type {string}
22
- */
23
- #type;
24
-
6
+ class OilModule extends ItemBaseClass {
25
7
  /**
26
8
  * Creates an instance of OilModule.
27
- *
28
- * @param {string} url - The URL to fetch data from.
29
- */
30
- constructor(url) {
31
- this.#url = url;
32
- this.#type = "Oil";
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
- async getData(requestedProperties) {
43
- try {
44
- /**
45
- * Calls the getData function to fetch Oil 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 Oil data.
53
- *
54
- * @throws {Error}
55
- */
56
- throw new Error(`Error fetching Oil data: ${error.message}`);
57
- }
11
+ constructor(league) {
12
+ super(league, "Oil");
58
13
  }
59
14
  }
60
15
 
@@ -1,60 +1,15 @@
1
- const getData = require("../functions/getData");
2
-
1
+ const ItemBaseClass = require("../../ItemBaseClass");
3
2
  /**
4
- * Represents a module for fetching data related to Omens.
5
- *
6
- * @class
3
+ * Represents a module for handling omens.
4
+ * @extends ItemBaseClass
7
5
  */
8
- class OmenModule {
9
- /**
10
- * The URL for fetching data.
11
- *
12
- * @private
13
- * @type {string}
14
- */
15
- #url;
16
-
17
- /**
18
- * The type of data (Omen in this case).
19
- *
20
- * @private
21
- * @type {string}
22
- */
23
- #type;
24
-
6
+ class OmenModule extends ItemBaseClass {
25
7
  /**
26
8
  * Creates an instance of OmenModule.
27
- *
28
- * @param {string} url - The URL to fetch data from.
29
- */
30
- constructor(url) {
31
- this.#url = url;
32
- this.#type = "Omen";
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
- async getData(requestedProperties) {
43
- try {
44
- /**
45
- * Calls the getData function to fetch Omen 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 Omen data.
53
- *
54
- * @throws {Error}
55
- */
56
- throw new Error(`Error fetching Omen data: ${error.message}`);
57
- }
11
+ constructor(league) {
12
+ super(league, "Omen");
58
13
  }
59
14
  }
60
15