poe-api-manager 0.2.2 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/Changelog.md +4 -0
  2. package/lib/NinjaAPI.js +26 -4
  3. package/lib/WatchAPI.js +44 -0
  4. package/lib/config/poeNinja/url.js +9 -0
  5. package/lib/config/poeWatch/url.js +9 -0
  6. package/lib/modules/mainfunctions/filter/propertyFilter.js +18 -0
  7. package/lib/modules/poe.ninja/currency/CurrencyWievModule.js +39 -2
  8. package/lib/modules/poe.ninja/currency/currencyFetch/fetchCurrency.js +11 -3
  9. package/lib/modules/poe.ninja/currency/currencyFetch/merge/mergeData.js +7 -0
  10. package/lib/modules/poe.ninja/currency/currencySubmodules/functions/getData.js +23 -0
  11. package/lib/modules/poe.ninja/currency/currencySubmodules/subModules/CurrencyModule.js +45 -2
  12. package/lib/modules/poe.ninja/currency/currencySubmodules/subModules/FragmentModule.js +45 -2
  13. package/lib/modules/poe.ninja/item/ItemWievModule.js +135 -2
  14. package/lib/modules/poe.ninja/item/itemFetch/fetchItem.js +23 -2
  15. package/lib/modules/poe.ninja/item/itemSubmodules/functions/getData.js +19 -0
  16. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BaseTypeModule.js +41 -2
  17. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BeastModule.js +41 -2
  18. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BlightRavagedMapModule.js +46 -2
  19. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/BlightedMapModule.js +43 -2
  20. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ClusterJewelModule.js +46 -2
  21. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/DeliriumOrbsModule.js +46 -2
  22. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/DivinationCardModule.js +46 -2
  23. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/EssenceModule.js +46 -2
  24. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/FossilModule.js +46 -2
  25. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/HelmetEnchantModule.js +46 -2
  26. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/IncubatorModule.js +46 -2
  27. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/InvitationModule.js +46 -2
  28. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/MapModule.js +46 -2
  29. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/MemoryModule.js +46 -2
  30. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/OilModule.js +46 -2
  31. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/OmenModule.js +46 -2
  32. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ResonatorModule.js +46 -2
  33. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/ScarabModule.js +46 -2
  34. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/SkillGemModule.js +46 -2
  35. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueAccessoryModule.js +46 -2
  36. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueArmourModule.js +46 -2
  37. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueFlaskModule.js +46 -2
  38. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueJewelModule.js +46 -2
  39. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueMapModule.js +46 -2
  40. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueRelicModule.js +46 -2
  41. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/UniqueWeaponModule.js +46 -2
  42. package/lib/modules/poe.ninja/item/itemSubmodules/subModules/VialsModule.js +46 -2
  43. package/lib/modules/poe.watch/WatchWievModule.js +106 -4
  44. package/lib/modules/poe.watch/allModules/fetch/fetch.js +11 -2
  45. package/lib/modules/poe.watch/allModules/functions/getData.js +20 -1
  46. package/lib/modules/poe.watch/allModules/submodules/AccessoryModule.js +47 -1
  47. package/lib/modules/poe.watch/allModules/submodules/ArmourModule.js +47 -1
  48. package/lib/modules/poe.watch/allModules/submodules/BaseModule.js +47 -1
  49. package/lib/modules/poe.watch/allModules/submodules/BeastModule.js +47 -1
  50. package/lib/modules/poe.watch/allModules/submodules/CurrencyModule.js +49 -2
  51. package/lib/modules/poe.watch/allModules/submodules/DeliriumOrbModule.js +47 -1
  52. package/lib/modules/poe.watch/allModules/submodules/DivsModule.js +47 -1
  53. package/lib/modules/poe.watch/allModules/submodules/EssenceModule.js +47 -1
  54. package/lib/modules/poe.watch/allModules/submodules/FlaskModule.js +47 -1
  55. package/lib/modules/poe.watch/allModules/submodules/FossilModule.js +47 -1
  56. package/lib/modules/poe.watch/allModules/submodules/FragmentModule.js +47 -1
  57. package/lib/modules/poe.watch/allModules/submodules/GemModule.js +47 -1
  58. package/lib/modules/poe.watch/allModules/submodules/InscribedModule.js +49 -1
  59. package/lib/modules/poe.watch/allModules/submodules/InvitationModule.js +47 -1
  60. package/lib/modules/poe.watch/allModules/submodules/JewelModule.js +47 -1
  61. package/lib/modules/poe.watch/allModules/submodules/MapModule.js +47 -1
  62. package/lib/modules/poe.watch/allModules/submodules/OilModule.js +47 -1
  63. package/lib/modules/poe.watch/allModules/submodules/ScarabModule.js +47 -1
  64. package/lib/modules/poe.watch/allModules/submodules/SextantModule.js +47 -1
  65. package/lib/modules/poe.watch/allModules/submodules/UniqueMapsModule.js +47 -1
  66. package/lib/modules/poe.watch/allModules/submodules/WeaponModule.js +47 -1
  67. package/package.json +1 -1
@@ -1,17 +1,61 @@
1
1
  const getData = require("../functions/getData");
2
2
 
3
+ /**
4
+ * Represents a module for fetching data related to Incubators.
5
+ *
6
+ * @class
7
+ */
3
8
  class IncubatorModule {
9
+ /**
10
+ * The URL for fetching data.
11
+ *
12
+ * @private
13
+ * @type {string}
14
+ */
4
15
  #url;
16
+
17
+ /**
18
+ * The type of data (Incubator in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
5
23
  #type;
24
+
25
+ /**
26
+ * Creates an instance of IncubatorModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
6
30
  constructor(url) {
7
31
  this.#url = url;
8
32
  this.#type = "Incubator";
9
33
  }
10
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
+ */
11
42
  async getData(requestedProperties) {
12
- return getData(this.#url, this.#type, 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
+ }
13
58
  }
14
59
  }
15
60
 
16
- //export IncubatorModule;
17
61
  module.exports = IncubatorModule;
@@ -1,17 +1,61 @@
1
1
  const getData = require("../functions/getData");
2
2
 
3
+ /**
4
+ * Represents a module for fetching data related to Invitations.
5
+ *
6
+ * @class
7
+ */
3
8
  class InvitationModule {
9
+ /**
10
+ * The URL for fetching data.
11
+ *
12
+ * @private
13
+ * @type {string}
14
+ */
4
15
  #url;
16
+
17
+ /**
18
+ * The type of data (Invitation in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
5
23
  #type;
24
+
25
+ /**
26
+ * Creates an instance of InvitationModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
6
30
  constructor(url) {
7
31
  this.#url = url;
8
32
  this.#type = "Invitation";
9
33
  }
10
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
+ */
11
42
  async getData(requestedProperties) {
12
- return getData(this.#url, this.#type, 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
+ }
13
58
  }
14
59
  }
15
60
 
16
- //export InvitationModule;
17
61
  module.exports = InvitationModule;
@@ -1,17 +1,61 @@
1
1
  const getData = require("../functions/getData");
2
2
 
3
+ /**
4
+ * Represents a module for fetching data related to Maps.
5
+ *
6
+ * @class
7
+ */
3
8
  class MapModule {
9
+ /**
10
+ * The URL for fetching data.
11
+ *
12
+ * @private
13
+ * @type {string}
14
+ */
4
15
  #url;
16
+
17
+ /**
18
+ * The type of data (Map in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
5
23
  #type;
24
+
25
+ /**
26
+ * Creates an instance of MapModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
6
30
  constructor(url) {
7
31
  this.#url = url;
8
32
  this.#type = "Map";
9
33
  }
10
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
+ */
11
42
  async getData(requestedProperties) {
12
- return getData(this.#url, this.#type, 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
+ }
13
58
  }
14
59
  }
15
60
 
16
- //export MapModule;
17
61
  module.exports = MapModule;
@@ -1,17 +1,61 @@
1
1
  const getData = require("../functions/getData");
2
2
 
3
+ /**
4
+ * Represents a module for fetching data related to Memories.
5
+ *
6
+ * @class
7
+ */
3
8
  class MemoryModule {
9
+ /**
10
+ * The URL for fetching data.
11
+ *
12
+ * @private
13
+ * @type {string}
14
+ */
4
15
  #url;
16
+
17
+ /**
18
+ * The type of data (Memory in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
5
23
  #type;
24
+
25
+ /**
26
+ * Creates an instance of MemoryModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
6
30
  constructor(url) {
7
31
  this.#url = url;
8
32
  this.#type = "Memory";
9
33
  }
10
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
+ */
11
42
  async getData(requestedProperties) {
12
- return getData(this.#url, this.#type, 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
+ }
13
58
  }
14
59
  }
15
60
 
16
- //export MemoryModule;
17
61
  module.exports = MemoryModule;
@@ -1,17 +1,61 @@
1
1
  const getData = require("../functions/getData");
2
2
 
3
+ /**
4
+ * Represents a module for fetching data related to Oils.
5
+ *
6
+ * @class
7
+ */
3
8
  class OilModule {
9
+ /**
10
+ * The URL for fetching data.
11
+ *
12
+ * @private
13
+ * @type {string}
14
+ */
4
15
  #url;
16
+
17
+ /**
18
+ * The type of data (Oil in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
5
23
  #type;
24
+
25
+ /**
26
+ * Creates an instance of OilModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
6
30
  constructor(url) {
7
31
  this.#url = url;
8
32
  this.#type = "Oil";
9
33
  }
10
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
+ */
11
42
  async getData(requestedProperties) {
12
- return getData(this.#url, this.#type, 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
+ }
13
58
  }
14
59
  }
15
60
 
16
- //export OilModule;
17
61
  module.exports = OilModule;
@@ -1,17 +1,61 @@
1
1
  const getData = require("../functions/getData");
2
2
 
3
+ /**
4
+ * Represents a module for fetching data related to Omens.
5
+ *
6
+ * @class
7
+ */
3
8
  class OmenModule {
9
+ /**
10
+ * The URL for fetching data.
11
+ *
12
+ * @private
13
+ * @type {string}
14
+ */
4
15
  #url;
16
+
17
+ /**
18
+ * The type of data (Omen in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
5
23
  #type;
24
+
25
+ /**
26
+ * Creates an instance of OmenModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
6
30
  constructor(url) {
7
31
  this.#url = url;
8
32
  this.#type = "Omen";
9
33
  }
10
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
+ */
11
42
  async getData(requestedProperties) {
12
- return getData(this.#url, this.#type, 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
+ }
13
58
  }
14
59
  }
15
60
 
16
- //export OmenModule;
17
61
  module.exports = OmenModule;
@@ -1,17 +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
+ */
4
15
  #url;
16
+
17
+ /**
18
+ * The type of data (Resonator in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
5
23
  #type;
24
+
25
+ /**
26
+ * Creates an instance of ResonatorModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
6
30
  constructor(url) {
7
31
  this.#url = url;
8
32
  this.#type = "Resonator";
9
33
  }
10
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
+ */
11
42
  async getData(requestedProperties) {
12
- 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
+ }
13
58
  }
14
59
  }
15
60
 
16
- //export ResonatorModule;
17
61
  module.exports = ResonatorModule;
@@ -1,17 +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
+ */
4
15
  #url;
16
+
17
+ /**
18
+ * The type of data (Scarab in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
5
23
  #type;
24
+
25
+ /**
26
+ * Creates an instance of ScarabModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
6
30
  constructor(url) {
7
31
  this.#url = url;
8
32
  this.#type = "Scarab";
9
33
  }
10
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
+ */
11
42
  async getData(requestedProperties) {
12
- 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
+ }
13
58
  }
14
59
  }
15
60
 
16
- //export ScarabModule;
17
61
  module.exports = ScarabModule;
@@ -1,17 +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
+ */
4
15
  #url;
16
+
17
+ /**
18
+ * The type of data (SkillGem in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
5
23
  #type;
24
+
25
+ /**
26
+ * Creates an instance of SkillGemModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
6
30
  constructor(url) {
7
31
  this.#url = url;
8
32
  this.#type = "SkillGem";
9
33
  }
10
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
+ */
11
42
  async getData(requestedProperties) {
12
- 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
+ }
13
58
  }
14
59
  }
15
60
 
16
- //export SkillGemModule;
17
61
  module.exports = SkillGemModule;
@@ -1,17 +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
+ */
4
15
  #url;
16
+
17
+ /**
18
+ * The type of data (UniqueAccessory in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
5
23
  #type;
24
+
25
+ /**
26
+ * Creates an instance of UniqueAccessoryModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
6
30
  constructor(url) {
7
31
  this.#url = url;
8
32
  this.#type = "UniqueAccessory";
9
33
  }
10
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
+ */
11
42
  async getData(requestedProperties) {
12
- 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
+ }
13
58
  }
14
59
  }
15
60
 
16
- //export UniqueAccessoryModule;
17
61
  module.exports = UniqueAccessoryModule;
@@ -1,17 +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
+ */
4
15
  #url;
16
+
17
+ /**
18
+ * The type of data (UniqueArmour in this case).
19
+ *
20
+ * @private
21
+ * @type {string}
22
+ */
5
23
  #type;
24
+
25
+ /**
26
+ * Creates an instance of UniqueArmourModule.
27
+ *
28
+ * @param {string} url - The URL to fetch data from.
29
+ */
6
30
  constructor(url) {
7
31
  this.#url = url;
8
32
  this.#type = "UniqueArmour";
9
33
  }
10
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
+ */
11
42
  async getData(requestedProperties) {
12
- 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
+ }
13
58
  }
14
59
  }
15
60
 
16
- //export UniqueArmourModule;
17
61
  module.exports = UniqueArmourModule;