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.
Files changed (72) hide show
  1. package/Changelog.md +11 -2
  2. package/README.md +78 -17
  3. package/index.js +5 -1
  4. package/lib/NinjaAPI.js +27 -5
  5. package/lib/WatchAPI.js +56 -0
  6. package/lib/config/poeNinja/url.js +9 -0
  7. package/lib/config/poeWatch/url.js +12 -0
  8. package/lib/modules/mainfunctions/filter/propertyFilter.js +36 -0
  9. package/lib/modules/poe.ninja/currency/CurrencyWievModule.js +44 -5
  10. package/lib/modules/poe.ninja/currency/currencyFetch/fetchCurrency.js +11 -3
  11. package/lib/modules/poe.ninja/currency/currencyFetch/merge/mergeData.js +7 -0
  12. package/lib/modules/poe.ninja/currency/currencySubmodules/functions/getData.js +24 -1
  13. package/lib/modules/poe.ninja/currency/currencySubmodules/subModules/CurrencyModule.js +50 -4
  14. package/lib/modules/poe.ninja/currency/currencySubmodules/subModules/FragmentModule.js +50 -4
  15. package/lib/modules/poe.ninja/item/ItemWievModule.js +140 -5
  16. package/lib/modules/poe.ninja/item/itemFetch/fetchItem.js +23 -2
  17. package/lib/modules/poe.ninja/item/itemSubmodules/functions/getData.js +20 -1
  18. package/lib/modules/poe.ninja/item/itemSubmodules/itemSubModules.js +0 -2
  19. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BaseTypeModule.js +45 -4
  20. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BeastModule.js +45 -4
  21. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BlightRavagedMapModule.js +50 -4
  22. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BlightedMapModule.js +47 -4
  23. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ClusterJewelModule.js +50 -4
  24. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/DeliriumOrbsModule.js +50 -4
  25. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/DivinationCardModule.js +50 -4
  26. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/EssenceModule.js +50 -4
  27. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/FossilModule.js +50 -4
  28. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/HelmetEnchantModule.js +50 -4
  29. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/IncubatorModule.js +50 -4
  30. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/InvitationModule.js +50 -4
  31. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/MapModule.js +50 -4
  32. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/MemoryModule.js +50 -4
  33. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/OilModule.js +50 -4
  34. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/OmenModule.js +50 -4
  35. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ResonatorModule.js +50 -4
  36. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ScarabModule.js +50 -4
  37. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/SkillGemModule.js +50 -4
  38. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueAccessoryModule.js +50 -4
  39. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueArmourModule.js +50 -4
  40. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueFlaskModule.js +50 -4
  41. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueJewelModule.js +50 -4
  42. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueMapModule.js +50 -4
  43. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueRelicModule.js +50 -4
  44. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueWeaponModule.js +50 -4
  45. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/VialsModule.js +50 -4
  46. package/lib/modules/poe.watch/WatchWievModule.js +130 -0
  47. package/lib/modules/poe.watch/allModules/Modules.js +23 -0
  48. package/lib/modules/poe.watch/allModules/fetch/fetch.js +28 -0
  49. package/lib/modules/poe.watch/allModules/functions/getData.js +39 -0
  50. package/lib/modules/poe.watch/allModules/submodules/AccessoryModule.js +59 -0
  51. package/lib/modules/poe.watch/allModules/submodules/ArmourModule.js +59 -0
  52. package/lib/modules/poe.watch/allModules/submodules/BaseModule.js +59 -0
  53. package/lib/modules/poe.watch/allModules/submodules/BeastModule.js +59 -0
  54. package/lib/modules/poe.watch/allModules/submodules/CurrencyModule.js +60 -0
  55. package/lib/modules/poe.watch/allModules/submodules/DeliriumOrbModule.js +59 -0
  56. package/lib/modules/poe.watch/allModules/submodules/DivsModule.js +59 -0
  57. package/lib/modules/poe.watch/allModules/submodules/EssenceModule.js +59 -0
  58. package/lib/modules/poe.watch/allModules/submodules/FlaskModule.js +59 -0
  59. package/lib/modules/poe.watch/allModules/submodules/FossilModule.js +59 -0
  60. package/lib/modules/poe.watch/allModules/submodules/FragmentModule.js +59 -0
  61. package/lib/modules/poe.watch/allModules/submodules/GemModule.js +59 -0
  62. package/lib/modules/poe.watch/allModules/submodules/InscribedModule.js +61 -0
  63. package/lib/modules/poe.watch/allModules/submodules/InvitationModule.js +59 -0
  64. package/lib/modules/poe.watch/allModules/submodules/JewelModule.js +59 -0
  65. package/lib/modules/poe.watch/allModules/submodules/MapModule.js +59 -0
  66. package/lib/modules/poe.watch/allModules/submodules/OilModule.js +59 -0
  67. package/lib/modules/poe.watch/allModules/submodules/ScarabModule.js +59 -0
  68. package/lib/modules/poe.watch/allModules/submodules/SextantModule.js +59 -0
  69. package/lib/modules/poe.watch/allModules/submodules/UniqueMapsModule.js +59 -0
  70. package/lib/modules/poe.watch/allModules/submodules/WeaponModule.js +59 -0
  71. package/package.json +13 -5
  72. package/lib/modules/filter/propertyFilter.js +0 -18
@@ -1,15 +1,61 @@
1
1
  const getData = require("../functions/getData");
2
2
 
3
+ /**
4
+ * Represents a module for fetching data related to Resonators.
5
+ *
6
+ * @class
7
+ */
3
8
  class ResonatorModule {
9
+ /**
10
+ * The URL for fetching data.
11
+ *
12
+ * @private
13
+ * @type {string}
14
+ */
15
+ #url;
16
+
17
+ /**
18
+ * The type of data (Resonator in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
23
+ #type;
24
+
25
+ /**
26
+ * Creates an instance of ResonatorModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
4
30
  constructor(url) {
5
- this.url = url;
6
- this.type = "Resonator";
31
+ this.#url = url;
32
+ this.#type = "Resonator";
7
33
  }
8
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.
41
+ */
9
42
  async getData(requestedProperties) {
10
- return getData(this.url, this.type, requestedProperties);
43
+ try {
44
+ /**
45
+ * Calls the getData function to fetch Resonator 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 Resonator data.
53
+ *
54
+ * @throws {Error}
55
+ */
56
+ throw new Error(`Error fetching Resonator data: ${error.message}`);
57
+ }
11
58
  }
12
59
  }
13
60
 
14
- //export ResonatorModule;
15
61
  module.exports = ResonatorModule;
@@ -1,15 +1,61 @@
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 URL for fetching data.
11
+ *
12
+ * @private
13
+ * @type {string}
14
+ */
15
+ #url;
16
+
17
+ /**
18
+ * The type of data (Scarab in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
23
+ #type;
24
+
25
+ /**
26
+ * Creates an instance of ScarabModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
4
30
  constructor(url) {
5
- this.url = url;
6
- this.type = "Scarab";
31
+ this.#url = url;
32
+ this.#type = "Scarab";
7
33
  }
8
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.
41
+ */
9
42
  async getData(requestedProperties) {
10
- return getData(this.url, this.type, requestedProperties);
43
+ try {
44
+ /**
45
+ * Calls the getData function to fetch Scarab 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 Scarab data.
53
+ *
54
+ * @throws {Error}
55
+ */
56
+ throw new Error(`Error fetching Scarab data: ${error.message}`);
57
+ }
11
58
  }
12
59
  }
13
60
 
14
- //export ScarabModule;
15
61
  module.exports = ScarabModule;
@@ -1,15 +1,61 @@
1
1
  const getData = require("../functions/getData");
2
2
 
3
+ /**
4
+ * Represents a module for fetching data related to Skill Gems.
5
+ *
6
+ * @class
7
+ */
3
8
  class SkillGemModule {
9
+ /**
10
+ * The URL for fetching data.
11
+ *
12
+ * @private
13
+ * @type {string}
14
+ */
15
+ #url;
16
+
17
+ /**
18
+ * The type of data (SkillGem in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
23
+ #type;
24
+
25
+ /**
26
+ * Creates an instance of SkillGemModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
4
30
  constructor(url) {
5
- this.url = url;
6
- this.type = "SkillGem";
31
+ this.#url = url;
32
+ this.#type = "SkillGem";
7
33
  }
8
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.
41
+ */
9
42
  async getData(requestedProperties) {
10
- return getData(this.url, this.type, requestedProperties);
43
+ try {
44
+ /**
45
+ * Calls the getData function to fetch SkillGem 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 SkillGem data.
53
+ *
54
+ * @throws {Error}
55
+ */
56
+ throw new Error(`Error fetching SkillGem data: ${error.message}`);
57
+ }
11
58
  }
12
59
  }
13
60
 
14
- //export SkillGemModule;
15
61
  module.exports = SkillGemModule;
@@ -1,15 +1,61 @@
1
1
  const getData = require("../functions/getData");
2
2
 
3
+ /**
4
+ * Represents a module for fetching data related to Unique Accessories.
5
+ *
6
+ * @class
7
+ */
3
8
  class UniqueAccessoryModule {
9
+ /**
10
+ * The URL for fetching data.
11
+ *
12
+ * @private
13
+ * @type {string}
14
+ */
15
+ #url;
16
+
17
+ /**
18
+ * The type of data (UniqueAccessory in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
23
+ #type;
24
+
25
+ /**
26
+ * Creates an instance of UniqueAccessoryModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
4
30
  constructor(url) {
5
- this.url = url;
6
- this.type = "UniqueAccessory";
31
+ this.#url = url;
32
+ this.#type = "UniqueAccessory";
7
33
  }
8
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.
41
+ */
9
42
  async getData(requestedProperties) {
10
- return getData(this.url, this.type, requestedProperties);
43
+ try {
44
+ /**
45
+ * Calls the getData function to fetch UniqueAccessory 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 UniqueAccessory data.
53
+ *
54
+ * @throws {Error}
55
+ */
56
+ throw new Error(`Error fetching UniqueAccessory data: ${error.message}`);
57
+ }
11
58
  }
12
59
  }
13
60
 
14
- //export UniqueAccessoryModule;
15
61
  module.exports = UniqueAccessoryModule;
@@ -1,15 +1,61 @@
1
1
  const getData = require("../functions/getData");
2
2
 
3
+ /**
4
+ * Represents a module for fetching data related to Unique Armours.
5
+ *
6
+ * @class
7
+ */
3
8
  class UniqueArmourModule {
9
+ /**
10
+ * The URL for fetching data.
11
+ *
12
+ * @private
13
+ * @type {string}
14
+ */
15
+ #url;
16
+
17
+ /**
18
+ * The type of data (UniqueArmour in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
23
+ #type;
24
+
25
+ /**
26
+ * Creates an instance of UniqueArmourModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
4
30
  constructor(url) {
5
- this.url = url;
6
- this.type = "UniqueArmour";
31
+ this.#url = url;
32
+ this.#type = "UniqueArmour";
7
33
  }
8
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.
41
+ */
9
42
  async getData(requestedProperties) {
10
- return getData(this.url, this.type, requestedProperties);
43
+ try {
44
+ /**
45
+ * Calls the getData function to fetch UniqueArmour 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 UniqueArmour data.
53
+ *
54
+ * @throws {Error}
55
+ */
56
+ throw new Error(`Error fetching UniqueArmour data: ${error.message}`);
57
+ }
11
58
  }
12
59
  }
13
60
 
14
- //export UniqueArmourModule;
15
61
  module.exports = UniqueArmourModule;
@@ -1,15 +1,61 @@
1
1
  const getData = require("../functions/getData");
2
2
 
3
+ /**
4
+ * Represents a module for fetching data related to Unique Flasks.
5
+ *
6
+ * @class
7
+ */
3
8
  class UniqueFlaskModule {
9
+ /**
10
+ * The URL for fetching data.
11
+ *
12
+ * @private
13
+ * @type {string}
14
+ */
15
+ #url;
16
+
17
+ /**
18
+ * The type of data (UniqueFlask in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
23
+ #type;
24
+
25
+ /**
26
+ * Creates an instance of UniqueFlaskModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
4
30
  constructor(url) {
5
- this.url = url;
6
- this.type = "UniqueFlask";
31
+ this.#url = url;
32
+ this.#type = "UniqueFlask";
7
33
  }
8
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.
41
+ */
9
42
  async getData(requestedProperties) {
10
- return getData(this.url, this.type, requestedProperties);
43
+ try {
44
+ /**
45
+ * Calls the getData function to fetch UniqueFlask 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 UniqueFlask data.
53
+ *
54
+ * @throws {Error}
55
+ */
56
+ throw new Error(`Error fetching UniqueFlask data: ${error.message}`);
57
+ }
11
58
  }
12
59
  }
13
60
 
14
- //export UniqueMapModule;
15
61
  module.exports = UniqueFlaskModule;
@@ -1,15 +1,61 @@
1
1
  const getData = require("../functions/getData");
2
2
 
3
+ /**
4
+ * Represents a module for fetching data related to Unique Jewels.
5
+ *
6
+ * @class
7
+ */
3
8
  class UniqueJewelModule {
9
+ /**
10
+ * The URL for fetching data.
11
+ *
12
+ * @private
13
+ * @type {string}
14
+ */
15
+ #url;
16
+
17
+ /**
18
+ * The type of data (UniqueJewel in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
23
+ #type;
24
+
25
+ /**
26
+ * Creates an instance of UniqueJewelModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
4
30
  constructor(url) {
5
- this.url = url;
6
- this.type = "UniqueJewel";
31
+ this.#url = url;
32
+ this.#type = "UniqueJewel";
7
33
  }
8
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.
41
+ */
9
42
  async getData(requestedProperties) {
10
- return getData(this.url, this.type, requestedProperties);
43
+ try {
44
+ /**
45
+ * Calls the getData function to fetch UniqueJewel 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 UniqueJewel data.
53
+ *
54
+ * @throws {Error}
55
+ */
56
+ throw new Error(`Error fetching UniqueJewel data: ${error.message}`);
57
+ }
11
58
  }
12
59
  }
13
60
 
14
- //export UniqueJewelModule;
15
61
  module.exports = UniqueJewelModule;
@@ -1,15 +1,61 @@
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 UniqueMapModule {
9
+ /**
10
+ * The URL for fetching data.
11
+ *
12
+ * @private
13
+ * @type {string}
14
+ */
15
+ #url;
16
+
17
+ /**
18
+ * The type of data (UniqueMap in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
23
+ #type;
24
+
25
+ /**
26
+ * Creates an instance of UniqueMapModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
4
30
  constructor(url) {
5
- this.url = url;
6
- this.type = "UniqueMap";
31
+ this.#url = url;
32
+ this.#type = "UniqueMap";
7
33
  }
8
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.
41
+ */
9
42
  async getData(requestedProperties) {
10
- return getData(this.url, this.type, requestedProperties);
43
+ try {
44
+ /**
45
+ * Calls the getData function to fetch UniqueMap 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 UniqueMap data.
53
+ *
54
+ * @throws {Error}
55
+ */
56
+ throw new Error(`Error fetching UniqueMap data: ${error.message}`);
57
+ }
11
58
  }
12
59
  }
13
60
 
14
- //export UniqueMapModule;
15
61
  module.exports = UniqueMapModule;
@@ -1,15 +1,61 @@
1
1
  const getData = require("../functions/getData");
2
2
 
3
+ /**
4
+ * Represents a module for fetching data related to Unique Relics.
5
+ *
6
+ * @class
7
+ */
3
8
  class UniqueRelicModule {
9
+ /**
10
+ * The URL for fetching data.
11
+ *
12
+ * @private
13
+ * @type {string}
14
+ */
15
+ #url;
16
+
17
+ /**
18
+ * The type of data (UniqueRelic in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
23
+ #type;
24
+
25
+ /**
26
+ * Creates an instance of UniqueRelicModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
4
30
  constructor(url) {
5
- this.url = url;
6
- this.type = "UniqueRelic";
31
+ this.#url = url;
32
+ this.#type = "UniqueRelic";
7
33
  }
8
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.
41
+ */
9
42
  async getData(requestedProperties) {
10
- return getData(this.url, this.type, requestedProperties);
43
+ try {
44
+ /**
45
+ * Calls the getData function to fetch UniqueRelic 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 UniqueRelic data.
53
+ *
54
+ * @throws {Error}
55
+ */
56
+ throw new Error(`Error fetching UniqueRelic data: ${error.message}`);
57
+ }
11
58
  }
12
59
  }
13
60
 
14
- //export UniqueRelicModule;
15
61
  module.exports = UniqueRelicModule;
@@ -1,15 +1,61 @@
1
1
  const getData = require("../functions/getData");
2
2
 
3
+ /**
4
+ * Represents a module for fetching data related to Unique Weapons.
5
+ *
6
+ * @class
7
+ */
3
8
  class UniqueWeaponModule {
9
+ /**
10
+ * The URL for fetching data.
11
+ *
12
+ * @private
13
+ * @type {string}
14
+ */
15
+ #url;
16
+
17
+ /**
18
+ * The type of data (UniqueWeapon in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
23
+ #type;
24
+
25
+ /**
26
+ * Creates an instance of UniqueWeaponModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
4
30
  constructor(url) {
5
- this.url = url;
6
- this.type = "UniqueWeapon";
31
+ this.#url = url;
32
+ this.#type = "UniqueWeapon";
7
33
  }
8
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.
41
+ */
9
42
  async getData(requestedProperties) {
10
- return getData(this.url, this.type, requestedProperties);
43
+ try {
44
+ /**
45
+ * Calls the getData function to fetch UniqueWeapon 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 UniqueWeapon data.
53
+ *
54
+ * @throws {Error}
55
+ */
56
+ throw new Error(`Error fetching UniqueWeapon data: ${error.message}`);
57
+ }
11
58
  }
12
59
  }
13
60
 
14
- //export UniqueWeaponModule;
15
61
  module.exports = UniqueWeaponModule;