poe-api-manager 1.2.23 → 2.0.0

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 (48) hide show
  1. package/Changelog.md +23 -0
  2. package/README.md +33 -12
  3. package/dist/index.d.ts +3 -0
  4. package/dist/index.js +10 -0
  5. package/dist/index.min.js +1 -1
  6. package/dist/lib/AbstractClass/PoeNinja.js +1 -1
  7. package/dist/lib/AbstractClass/PoeWatch.js +1 -1
  8. package/dist/lib/Utils.js +2 -12
  9. package/dist/lib/errors/CustomError.js +4 -1
  10. package/dist/lib/mainfunctions/propertyFilter.js +4 -7
  11. package/dist/lib/modules/poe.ninja/currencyView/CurrencyViewModule.js +17 -7
  12. package/dist/lib/modules/poe.ninja/fetch/fetchData.js +17 -2
  13. package/dist/lib/modules/poe.ninja/fetch/merge/mergeData.js +7 -7
  14. package/dist/lib/modules/poe.ninja/fetch/merge/mergeExchangeData.d.ts +10 -0
  15. package/dist/lib/modules/poe.ninja/fetch/merge/mergeExchangeData.js +32 -0
  16. package/dist/lib/modules/poe.ninja/func/getData.js +7 -12
  17. package/dist/lib/modules/poe.ninja/func/getQuickCurrency.js +14 -14
  18. package/dist/lib/modules/poe.ninja/func/urlGenerator.js +18 -2
  19. package/dist/lib/modules/poe.ninja/itemView/ItemViewModule.d.ts +0 -4
  20. package/dist/lib/modules/poe.ninja/itemView/ItemViewModule.js +17 -12
  21. package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/itemSubModules.d.ts +0 -1
  22. package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/itemSubModules.js +0 -1
  23. package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/AllflameEmberModule.js +1 -1
  24. package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/DeliriumOrbsModule.js +1 -1
  25. package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/DivinationCardModule.js +1 -1
  26. package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/EssenceModule.js +1 -1
  27. package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/FossilModule.js +1 -1
  28. package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/OilModule.js +1 -1
  29. package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/OmenModule.js +1 -1
  30. package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/ResonatorModule.js +1 -1
  31. package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/ScarabModule.js +1 -1
  32. package/dist/lib/modules/poe.watch/WatchViewModule.js +17 -7
  33. package/dist/lib/modules/poe.watch/allModules/subModules/AccessoryModule.js +1 -6
  34. package/dist/lib/modules/poe.watch/allModules/subModules/ArmourModule.js +1 -6
  35. package/dist/lib/modules/poe.watch/allModules/subModules/BaseModule.js +1 -6
  36. package/dist/lib/modules/poe.watch/allModules/subModules/GemModule.js +1 -6
  37. package/dist/lib/modules/poe.watch/allModules/subModules/WeaponModule.js +1 -6
  38. package/dist/lib/modules/poe.watch/func/WatchUrlGenerator.js +2 -2
  39. package/dist/lib/modules/poe.watch/func/getCategory.js +6 -3
  40. package/dist/lib/modules/poe.watch/func/getData.js +8 -13
  41. package/dist/lib/modules/utils/fetchData/fetchData.js +6 -11
  42. package/package.json +14 -8
  43. package/CODE_OF_CONDUCT.md +0 -77
  44. package/CONTRIBUTING.md +0 -56
  45. package/SECURITY.md +0 -14
  46. package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/HelmetEnchantModule.d.ts +0 -12
  47. package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/HelmetEnchantModule.js +0 -22
  48. package/tsconfig.json +0 -12
package/Changelog.md CHANGED
@@ -1,4 +1,27 @@
1
1
  # CHANGELOG
2
+ ## 2.0.0
3
+ - 💥[Breaking] poe.ninja removed its old `/api/data/*` endpoints; the library now
4
+ targets the new `poe.ninja/poe1/api/economy/*` endpoints.
5
+ - 💥[Breaking] DeliriumOrb, DivinationCard, Essence, Fossil, Oil, Resonator,
6
+ Scarab, Omen and AllflameEmber are now served by the new exchange endpoint,
7
+ which adds/renames some value fields (e.g. `primaryValue`, conditional
8
+ `chaosValue`).
9
+ - 💥[Breaking] `itemView.helmetEnchant` removed; poe.ninja removed it upstream.
10
+ - 💥[Breaking] Errors thrown by the library are now typed `ApiError` /
11
+ `ValidationError` (with `statusCode` and `details`) instead of plain `Error`.
12
+ - 💥[Breaking] An unknown `type` on the exchange endpoint, and an invalid league
13
+ name on the exchange and item endpoints, now resolve to an empty array
14
+ instead of throwing — poe.ninja answers HTTP 200 with empty `lines` there.
15
+ The currency endpoint still throws `ApiError` if the response omits
16
+ `currencyDetails`.
17
+ - 💥[Breaking] Releases are now cut by pushing a `v*` git tag instead of
18
+ automatically on every push to `main`.
19
+ - 🛠️[Fix] Publishing now uses npm trusted publishing (OIDC) instead of an
20
+ `NPM_TOKEN` secret; npm permanently revoked classic tokens in February 2026.
21
+ - 🛠️[Fix] `mergeData` no longer silently drops currency lines it can't join.
22
+ - 🛠️[Fix] League/type values are now URL-encoded when building requests.
23
+ - 🚀[Added] `ApiError`, `ValidationError` and `CustomError` are now exported.
24
+
2
25
  ## 1.2.23
3
26
  - 🛠️[Fix] Refactor exports to use export * syntax
4
27
 
package/README.md CHANGED
@@ -3,9 +3,10 @@
3
3
  [![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)
4
4
  ![GitHub package.json version](https://img.shields.io/github/package-json/v/ayberkgezer/poe-api-manager)
5
5
  ![GitHub top language](https://img.shields.io/github/languages/top/ayberkgezer/poe-api-manager?logo=typescript)
6
- [![ISSUES](https://img.shields.io/github/issues/ayberkgezer/poe-api-manager-ts)](https://github.com/ayberkgezer/poe-api-manager/issues)
6
+ [![ISSUES](https://img.shields.io/github/issues/ayberkgezer/poe-api-manager)](https://github.com/ayberkgezer/poe-api-manager/issues)
7
+ [![npm](https://img.shields.io/npm/v/poe-api-manager?logo=npm)](https://www.npmjs.com/package/poe-api-manager)
7
8
  ![NPM Downloads](https://img.shields.io/npm/dt/poe-api-manager?logo=npm)
8
- ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/ayberkgezer/poe-api-manager/build.yml)
9
+ ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/ayberkgezer/poe-api-manager/ci.yml)
9
10
 
10
11
 
11
12
  - [Introduction](#introduction)
@@ -84,16 +85,15 @@ ninjaAPI.currencyView.currency.getQuickCurrency(currencyTypeName).then((data)=>
84
85
  What we can get here is as follows.
85
86
  - BaseType
86
87
  - Beast
87
- - Delirium Orbs
88
- - Divination Cards
89
- - Essences
90
- - Fossils
91
- - Helment Enchant
88
+ - Delirium Orbs *(exchange)*
89
+ - Divination Cards *(exchange)*
90
+ - Essences *(exchange)*
91
+ - Fossils *(exchange)*
92
92
  - Incubators
93
93
  - Maps
94
- - Oils
95
- - Resanators
96
- - Scarabs
94
+ - Oils *(exchange)*
95
+ - Resanators *(exchange)*
96
+ - Scarabs *(exchange)*
97
97
  - Skill Gems
98
98
  - Unique Accessories
99
99
  - Unique Armours
@@ -102,7 +102,7 @@ What we can get here is as follows.
102
102
  - Unique Maps
103
103
  - Unique Weapons
104
104
  - Vials
105
- - Omens
105
+ - Omens *(exchange)*
106
106
  - Unique Relics
107
107
  - Cluster Jewels
108
108
  - Blighted Maps
@@ -110,7 +110,11 @@ What we can get here is as follows.
110
110
  - Invitations
111
111
  - Memories
112
112
  - Coffins
113
- - Allflame Embers
113
+ - Allflame Embers *(exchange)*
114
+
115
+ > *(exchange)* means poe.ninja serves this type from its exchange endpoint instead
116
+ > of the stash endpoint. The data shape is normalized to the same `{id, name, icon}`
117
+ > contract as everything else, with an added `chaosValue` where applicable.
114
118
 
115
119
  - getData() => function returns data purely.
116
120
  ```javascript
@@ -203,6 +207,23 @@ utils.filterProperties(data, ["currencyTypeName", "chaosEquivalent"])
203
207
  .then((result) => console.log(result));
204
208
  ```
205
209
 
210
+ ## Error handling
211
+ Errors thrown by this library are `ApiError` / `ValidationError` (both extend
212
+ `CustomError`), carrying a `statusCode` and optional `details`.
213
+ ```javascript
214
+ const { NinjaAPI, ApiError } = require("poe-api-manager");
215
+
216
+ const ninjaAPI = new NinjaAPI("Standard");
217
+
218
+ try {
219
+ await ninjaAPI.currencyView.currency.getData();
220
+ } catch (err) {
221
+ if (err instanceof ApiError) {
222
+ console.error(err.statusCode, err.message, err.details);
223
+ }
224
+ }
225
+ ```
226
+
206
227
 
207
228
  ## Examples
208
229
  ```javascript
package/dist/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  export * from "./lib/NinjaAPI";
2
2
  export * from "./lib/WatchAPI";
3
3
  export * from "./lib/Utils";
4
+ export { default as ApiError } from "./lib/errors/ApiError";
5
+ export { default as ValidationError } from "./lib/errors/ValidationError";
6
+ export { default as CustomError } from "./lib/errors/CustomError";
package/dist/index.js CHANGED
@@ -18,7 +18,17 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
18
18
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
19
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
20
  };
21
+ var __importDefault = (this && this.__importDefault) || function (mod) {
22
+ return (mod && mod.__esModule) ? mod : { "default": mod };
23
+ };
21
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.CustomError = exports.ValidationError = exports.ApiError = void 0;
22
26
  __exportStar(require("./lib/NinjaAPI"), exports);
23
27
  __exportStar(require("./lib/WatchAPI"), exports);
24
28
  __exportStar(require("./lib/Utils"), exports);
29
+ var ApiError_1 = require("./lib/errors/ApiError");
30
+ Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return __importDefault(ApiError_1).default; } });
31
+ var ValidationError_1 = require("./lib/errors/ValidationError");
32
+ Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return __importDefault(ValidationError_1).default; } });
33
+ var CustomError_1 = require("./lib/errors/CustomError");
34
+ Object.defineProperty(exports, "CustomError", { enumerable: true, get: function () { return __importDefault(CustomError_1).default; } });
package/dist/index.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(o,m,k,k2){if(k2===undefined)k2=k;var desc=Object.getOwnPropertyDescriptor(m,k);if(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable)){desc={enumerable:true,get:function(){return m[k]}}}Object.defineProperty(o,k2,desc)}:function(o,m,k,k2){if(k2===undefined)k2=k;o[k2]=m[k]});var __exportStar=this&&this.__exportStar||function(m,exports){for(var p in m)if(p!=="default"&&!Object.prototype.hasOwnProperty.call(exports,p))__createBinding(exports,m,p)};Object.defineProperty(exports,"__esModule",{value:true});__exportStar(require("./lib/NinjaAPI"),exports);__exportStar(require("./lib/WatchAPI"),exports);__exportStar(require("./lib/Utils"),exports);
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(o,m,k,k2){if(k2===undefined)k2=k;var desc=Object.getOwnPropertyDescriptor(m,k);if(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable)){desc={enumerable:true,get:function(){return m[k]}}}Object.defineProperty(o,k2,desc)}:function(o,m,k,k2){if(k2===undefined)k2=k;o[k2]=m[k]});var __exportStar=this&&this.__exportStar||function(m,exports){for(var p in m)if(p!=="default"&&!Object.prototype.hasOwnProperty.call(exports,p))__createBinding(exports,m,p)};var __importDefault=this&&this.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:true});exports.CustomError=exports.ValidationError=exports.ApiError=void 0;__exportStar(require("./lib/NinjaAPI"),exports);__exportStar(require("./lib/WatchAPI"),exports);__exportStar(require("./lib/Utils"),exports);var ApiError_1=require("./lib/errors/ApiError");Object.defineProperty(exports,"ApiError",{enumerable:true,get:function(){return __importDefault(ApiError_1).default}});var ValidationError_1=require("./lib/errors/ValidationError");Object.defineProperty(exports,"ValidationError",{enumerable:true,get:function(){return __importDefault(ValidationError_1).default}});var CustomError_1=require("./lib/errors/CustomError");Object.defineProperty(exports,"CustomError",{enumerable:true,get:function(){return __importDefault(CustomError_1).default}});
@@ -36,7 +36,7 @@ class PoeNinja {
36
36
  */
37
37
  async getData(requestedProperties) {
38
38
  try {
39
- return (0, getData_1.default)(this.league, this.typeName, this.type, requestedProperties);
39
+ return await (0, getData_1.default)(this.league, this.typeName, this.type, requestedProperties);
40
40
  }
41
41
  catch (error) {
42
42
  // Pass through custom errors
@@ -32,7 +32,7 @@ class PoeWatch {
32
32
  */
33
33
  async getData(requestedProperties) {
34
34
  try {
35
- return (0, getData_1.default)(this.league, this.type, requestedProperties);
35
+ return await (0, getData_1.default)(this.league, this.type, requestedProperties);
36
36
  }
37
37
  catch (error) {
38
38
  // Pass through custom errors
package/dist/lib/Utils.js CHANGED
@@ -18,12 +18,7 @@ class Utils {
18
18
  * @throws {Error} If there's an error fetching the leagues.
19
19
  */
20
20
  async getLeagues() {
21
- try {
22
- return await (0, getLeagues_1.default)();
23
- }
24
- catch (error) {
25
- throw new Error(`Error fetching data Leagues: ${error.message}`);
26
- }
21
+ return await (0, getLeagues_1.default)();
27
22
  }
28
23
  /**
29
24
  * Filters properties of objects in an array based on the specified properties.
@@ -34,12 +29,7 @@ class Utils {
34
29
  * @throws {Error} If there's an error filtering the properties.
35
30
  */
36
31
  async filterProperties(data, properties) {
37
- try {
38
- return (0, propertyFilter_1.default)(data, properties);
39
- }
40
- catch (error) {
41
- throw new Error(`Error fetching data Leagues: ${error.message}`);
42
- }
32
+ return (0, propertyFilter_1.default)(data, properties);
43
33
  }
44
34
  }
45
35
  exports.Utils = Utils;
@@ -16,7 +16,10 @@ class CustomError extends Error {
16
16
  super(message);
17
17
  this.statusCode = statusCode;
18
18
  this.name = this.constructor.name;
19
- Error.captureStackTrace(this, this.constructor);
19
+ // Error.captureStackTrace is V8-only (missing on e.g. bun/JavaScriptCore)
20
+ if (typeof Error.captureStackTrace === "function") {
21
+ Error.captureStackTrace(this, this.constructor);
22
+ }
20
23
  }
21
24
  }
22
25
  exports.default = CustomError;
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const ValidationError_js_1 = __importDefault(require("../errors/ValidationError.js"));
6
+ exports.default = filterProperties;
7
+ const ValidationError_1 = __importDefault(require("../errors/ValidationError"));
7
8
  /**
8
9
  * Filters properties of objects in an array based on the specified properties.
9
10
  * @param {Record<string, any> []} data The array of objects to filter.
@@ -13,12 +14,12 @@ const ValidationError_js_1 = __importDefault(require("../errors/ValidationError.
13
14
  function filterProperties(data, requestedProperties) {
14
15
  // Validate input first
15
16
  if (!Array.isArray(data)) {
16
- throw new ValidationError_js_1.default("Input data must be an array", 400, {
17
+ throw new ValidationError_1.default("Input data must be an array", 400, {
17
18
  providedType: typeof data,
18
19
  });
19
20
  }
20
21
  if (!Array.isArray(requestedProperties)) {
21
- throw new ValidationError_js_1.default("requestedProperties must be an array", 400, {
22
+ throw new ValidationError_1.default("requestedProperties must be an array", 400, {
22
23
  providedType: typeof requestedProperties,
23
24
  });
24
25
  }
@@ -29,12 +30,8 @@ function filterProperties(data, requestedProperties) {
29
30
  if (Object.prototype.hasOwnProperty.call(item, prop)) {
30
31
  itemResult[prop] = item[prop];
31
32
  }
32
- else {
33
- console.warn(`Property not found: ${prop}`);
34
- }
35
33
  });
36
34
  result.push(itemResult);
37
35
  });
38
36
  return result;
39
37
  }
40
- exports.default = filterProperties;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  const Modules = __importStar(require("./currencySubModules/CurrencySubModules"));
27
37
  /**
@@ -5,8 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const axios_1 = __importDefault(require("axios"));
7
7
  const mergeData_1 = __importDefault(require("./merge/mergeData"));
8
+ const mergeExchangeData_1 = __importDefault(require("./merge/mergeExchangeData"));
8
9
  const urlGenerator_1 = __importDefault(require("../func/urlGenerator"));
9
10
  const ApiError_1 = __importDefault(require("../../../errors/ApiError"));
11
+ const CustomError_1 = __importDefault(require("../../../errors/CustomError"));
12
+ const { version: PACKAGE_VERSION } = require("../../../../../package.json");
10
13
  /**
11
14
  * Fetches data from a specified API endpoint, merges relevant data, and returns the result.
12
15
  * @param league The game league for which to fetch data.
@@ -23,6 +26,7 @@ async function fetchData(league, typeName, type) {
23
26
  const response = await axios_1.default.get(url, {
24
27
  headers: {
25
28
  "Accept-Encoding": "identity",
29
+ "User-Agent": `poe-api-manager/${PACKAGE_VERSION} (+https://github.com/ayberkgezer/poe-api-manager)`,
26
30
  },
27
31
  });
28
32
  //typwName is either currencyoverview or itemoverview
@@ -49,6 +53,17 @@ async function fetchData(league, typeName, type) {
49
53
  throw new ApiError_1.default(`Invalid response format from POE Ninja API ItemView Type:${type}`, 400, { league, typeName, type });
50
54
  }
51
55
  }
56
+ else if (typeName == "exchangeoverview") {
57
+ // CAVEAT: unlike the other two endpoints, the exchange endpoint returns
58
+ // HTTP 200 with an empty lines[] for an unknown type instead of a 404
59
+ // (verified live), so a bad type yields [] here rather than an error.
60
+ if (response.data && response.data.lines && response.data.items) {
61
+ return (0, mergeExchangeData_1.default)(response.data.lines, response.data.items, response.data.core);
62
+ }
63
+ else {
64
+ throw new ApiError_1.default(`Invalid response format from POE Ninja API ExchangeView Type:${type}`, 400, { league, typeName, type });
65
+ }
66
+ }
52
67
  else {
53
68
  throw new ApiError_1.default(`Invalid type: ${type}`, 400, {
54
69
  league,
@@ -58,8 +73,8 @@ async function fetchData(league, typeName, type) {
58
73
  }
59
74
  }
60
75
  catch (error) {
61
- // If it's already an ApiError, pass it through
62
- if (error instanceof ApiError_1.default) {
76
+ // If it's already a typed error (ApiError/ValidationError), pass it through
77
+ if (error instanceof CustomError_1.default) {
63
78
  throw error;
64
79
  }
65
80
  // Handle axios errors with more context
@@ -12,17 +12,17 @@ function mergeData(lines, currencyDetails) {
12
12
  const currencyType = line.currencyTypeName;
13
13
  // Find the corresponding currencyDetail based on currencyType
14
14
  const currencyDetail = currencyDetails.find((detail) => detail.name === currencyType);
15
- if (currencyDetail) {
16
- // Merge line and currencyDetail into a new object
17
- const mergedItem = {
15
+ // Merge line and currencyDetail into a new object. Keep unmatched lines
16
+ // as-is instead of dropping them.
17
+ const mergedItem = currencyDetail
18
+ ? {
18
19
  ...line,
19
20
  id: currencyDetail.id,
20
21
  icon: currencyDetail.icon,
21
22
  name: currencyDetail.name,
22
- };
23
- // Add the merged item to the result array
24
- mergedData.push(mergedItem);
25
- }
23
+ }
24
+ : { ...line };
25
+ mergedData.push(mergedItem);
26
26
  });
27
27
  return mergedData;
28
28
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Merges exchange endpoint lines with their join-table items, normalizing the
3
+ * result to the documented ["id","name","icon"] contract.
4
+ * @param lines The exchange lines to be merged.
5
+ * @param items The exchange join-table items (top-level `items[]`, not `core.items`).
6
+ * @param core The exchange `core` object; `core.primary` names the unit of `line.primaryValue`.
7
+ * @returns The merged data.
8
+ */
9
+ declare function mergeExchangeData(lines: any[], items: any[], core: any): any[];
10
+ export default mergeExchangeData;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Merges exchange endpoint lines with their join-table items, normalizing the
5
+ * result to the documented ["id","name","icon"] contract.
6
+ * @param lines The exchange lines to be merged.
7
+ * @param items The exchange join-table items (top-level `items[]`, not `core.items`).
8
+ * @param core The exchange `core` object; `core.primary` names the unit of `line.primaryValue`.
9
+ * @returns The merged data.
10
+ */
11
+ function mergeExchangeData(lines, items, core) {
12
+ const mergedData = [];
13
+ lines.forEach((line) => {
14
+ const item = items.find((candidate) => candidate.id === line.id);
15
+ const mergedItem = { ...line };
16
+ if (item) {
17
+ mergedItem.name = item.name;
18
+ mergedItem.icon = `https://web.poecdn.com${item.image}`;
19
+ mergedItem.detailsId = item.detailsId;
20
+ mergedItem.category = item.category;
21
+ }
22
+ if (core?.primary === "chaos") {
23
+ mergedItem.chaosValue = line.primaryValue;
24
+ }
25
+ else {
26
+ delete mergedItem.chaosValue;
27
+ }
28
+ mergedData.push(mergedItem);
29
+ });
30
+ return mergedData;
31
+ }
32
+ exports.default = mergeExchangeData;
@@ -16,19 +16,14 @@ const propertyFilter_1 = __importDefault(require("../../../mainfunctions/propert
16
16
  * @throws If there is an error fetching the data.
17
17
  */
18
18
  async function getData(league, typeName, type, requestedProperties) {
19
- try {
20
- const fetchedData = await (0, fetchData_1.default)(league, typeName, type);
21
- //if requestedProperties use filterProperties to filter fetchedData
22
- if (requestedProperties) {
23
- const result = (0, propertyFilter_1.default)(fetchedData, requestedProperties);
24
- return result;
25
- }
26
- else {
27
- return fetchedData;
28
- }
19
+ const fetchedData = await (0, fetchData_1.default)(league, typeName, type);
20
+ //if requestedProperties use filterProperties to filter fetchedData
21
+ if (requestedProperties) {
22
+ const result = (0, propertyFilter_1.default)(fetchedData, requestedProperties);
23
+ return result;
29
24
  }
30
- catch (error) {
31
- throw new Error(`Type:${type} Error fetching data: ${error.message}`);
25
+ else {
26
+ return fetchedData;
32
27
  }
33
28
  }
34
29
  exports.default = getData;
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const fetchData_1 = __importDefault(require("../fetch/fetchData"));
7
+ const ValidationError_1 = __importDefault(require("../../../errors/ValidationError"));
7
8
  /**
8
9
  * Retrieves quick currency data for a specific currency in a given league and type.
9
10
  * @param league - The league for which to fetch currency data.
@@ -14,21 +15,20 @@ const fetchData_1 = __importDefault(require("../fetch/fetchData"));
14
15
  * @throws Throws an error if the currency data cannot be fetched or if the currency is not found.
15
16
  */
16
17
  async function getQuickCurrency(league, typeName, type, currencyTypeName) {
17
- try {
18
- const fetchedData = await (0, fetchData_1.default)(league, typeName, type);
19
- //find the currencyTypeName in the fetchedData
20
- for (const data of fetchedData) {
21
- if (data.currencyTypeName === currencyTypeName) {
22
- return {
23
- currencyTypeName: data.currencyTypeName,
24
- chaosEquivalent: data.chaosEquivalent,
25
- };
26
- }
18
+ const fetchedData = await (0, fetchData_1.default)(league, typeName, type);
19
+ //find the currencyTypeName in the fetchedData
20
+ for (const data of fetchedData) {
21
+ if (data.currencyTypeName === currencyTypeName) {
22
+ return {
23
+ currencyTypeName: data.currencyTypeName,
24
+ chaosEquivalent: data.chaosEquivalent,
25
+ };
27
26
  }
28
- throw new Error("Currency not found");
29
- }
30
- catch (error) {
31
- throw new Error(`Error fetching currency data: ${error.message}`);
32
27
  }
28
+ throw new ValidationError_1.default(`Currency not found: ${currencyTypeName}`, 404, {
29
+ league,
30
+ type,
31
+ currencyTypeName,
32
+ });
33
33
  }
34
34
  exports.default = getQuickCurrency;
@@ -1,5 +1,18 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = urlGenerator;
7
+ const ValidationError_1 = __importDefault(require("../../../errors/ValidationError"));
8
+ /**
9
+ * Maps the internal typeName to its poe.ninja economy API path.
10
+ */
11
+ const PATHS = {
12
+ currencyoverview: "/poe1/api/economy/stash/current/currency/overview",
13
+ itemoverview: "/poe1/api/economy/stash/current/item/overview",
14
+ exchangeoverview: "/poe1/api/economy/exchange/current/overview",
15
+ };
3
16
  /**
4
17
  * Generates a URL based on league and type. poe.ninja (currencyView) API is used.
5
18
  * @param league The league for which the URL is generated.
@@ -8,6 +21,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
8
21
  * @returns The generated URL.
9
22
  */
10
23
  function urlGenerator(league, typeName, type) {
11
- return `https://poe.ninja/api/data/${typeName}?league=${league}&type=${type}`;
24
+ const path = PATHS[typeName];
25
+ if (!path) {
26
+ throw new ValidationError_1.default(`Invalid typeName: ${typeName}`, 400, { league, typeName, type });
27
+ }
28
+ return `https://poe.ninja${path}?league=${encodeURIComponent(league)}&type=${encodeURIComponent(type)}`;
12
29
  }
13
- exports.default = urlGenerator;
@@ -27,10 +27,6 @@ export default class ItemViewModule {
27
27
  * Represents a submodule for fossil item information.
28
28
  */
29
29
  fossil: Modules.FossilModule;
30
- /**
31
- * Represents a submodule for helmet enchant item information.
32
- */
33
- helmetEnchant: Modules.HelmetEnchantModule;
34
30
  /**
35
31
  * Represents a submodule for incubator item information.
36
32
  */
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  const Modules = __importStar(require("./itemSubmodules/itemSubModules"));
27
37
  /**
@@ -52,10 +62,6 @@ class ItemViewModule {
52
62
  * Represents a submodule for fossil item information.
53
63
  */
54
64
  fossil;
55
- /**
56
- * Represents a submodule for helmet enchant item information.
57
- */
58
- helmetEnchant;
59
65
  /**
60
66
  * Represents a submodule for incubator item information.
61
67
  */
@@ -156,7 +162,6 @@ class ItemViewModule {
156
162
  this.divinationCard = new Modules.DivinationCardModule(league, typeName);
157
163
  this.essence = new Modules.EssenceModule(league, typeName);
158
164
  this.fossil = new Modules.FossilModule(league, typeName);
159
- this.helmetEnchant = new Modules.HelmetEnchantModule(league, typeName);
160
165
  this.incubator = new Modules.IncubatorModule(league, typeName);
161
166
  this.map = new Modules.MapModule(league, typeName);
162
167
  this.oil = new Modules.OilModule(league, typeName);
@@ -4,7 +4,6 @@ export * from "./subModules/DeliriumOrbsModule";
4
4
  export * from "./subModules/DivinationCardModule";
5
5
  export * from "./subModules/EssenceModule";
6
6
  export * from "./subModules/FossilModule";
7
- export * from "./subModules/HelmetEnchantModule";
8
7
  export * from "./subModules/IncubatorModule";
9
8
  export * from "./subModules/MapModule";
10
9
  export * from "./subModules/OilModule";
@@ -20,7 +20,6 @@ __exportStar(require("./subModules/DeliriumOrbsModule"), exports);
20
20
  __exportStar(require("./subModules/DivinationCardModule"), exports);
21
21
  __exportStar(require("./subModules/EssenceModule"), exports);
22
22
  __exportStar(require("./subModules/FossilModule"), exports);
23
- __exportStar(require("./subModules/HelmetEnchantModule"), exports);
24
23
  __exportStar(require("./subModules/IncubatorModule"), exports);
25
24
  __exportStar(require("./subModules/MapModule"), exports);
26
25
  __exportStar(require("./subModules/OilModule"), exports);
@@ -17,7 +17,7 @@ class AllflameEmberModule extends PoeNinja_1.default {
17
17
  constructor(league, typeName) {
18
18
  // The type name.
19
19
  const type = "AllflameEmber";
20
- super(league, typeName, type);
20
+ super(league, "exchangeoverview", type);
21
21
  }
22
22
  }
23
23
  exports.AllflameEmberModule = AllflameEmberModule;
@@ -16,7 +16,7 @@ class DeliriumOrbsModule extends PoeNinja_1.default {
16
16
  */
17
17
  constructor(league, typeName) {
18
18
  const type = "DeliriumOrb";
19
- super(league, typeName, type);
19
+ super(league, "exchangeoverview", type);
20
20
  }
21
21
  }
22
22
  exports.DeliriumOrbsModule = DeliriumOrbsModule;
@@ -16,7 +16,7 @@ class DivinationCardModule extends PoeNinja_1.default {
16
16
  */
17
17
  constructor(league, typeName) {
18
18
  const type = "DivinationCard";
19
- super(league, typeName, type);
19
+ super(league, "exchangeoverview", type);
20
20
  }
21
21
  }
22
22
  exports.DivinationCardModule = DivinationCardModule;
@@ -16,7 +16,7 @@ class EssenceModule extends PoeNinja_1.default {
16
16
  */
17
17
  constructor(league, typeName) {
18
18
  const type = "Essence";
19
- super(league, typeName, type);
19
+ super(league, "exchangeoverview", type);
20
20
  }
21
21
  }
22
22
  exports.EssenceModule = EssenceModule;
@@ -16,7 +16,7 @@ class FossilModule extends PoeNinja_1.default {
16
16
  */
17
17
  constructor(league, typeName) {
18
18
  const type = "Fossil";
19
- super(league, typeName, type);
19
+ super(league, "exchangeoverview", type);
20
20
  }
21
21
  }
22
22
  exports.FossilModule = FossilModule;
@@ -16,7 +16,7 @@ class OilModule extends PoeNinja_1.default {
16
16
  */
17
17
  constructor(league, typeName) {
18
18
  const type = "Oil";
19
- super(league, typeName, type);
19
+ super(league, "exchangeoverview", type);
20
20
  }
21
21
  }
22
22
  exports.OilModule = OilModule;
@@ -16,7 +16,7 @@ class OmenModule extends PoeNinja_1.default {
16
16
  */
17
17
  constructor(league, typeName) {
18
18
  const type = "Omen";
19
- super(league, typeName, type);
19
+ super(league, "exchangeoverview", type);
20
20
  }
21
21
  }
22
22
  exports.OmenModule = OmenModule;
@@ -16,7 +16,7 @@ class ResonatorModule extends PoeNinja_1.default {
16
16
  */
17
17
  constructor(league, typeName) {
18
18
  const type = "Resonator";
19
- super(league, typeName, type);
19
+ super(league, "exchangeoverview", type);
20
20
  }
21
21
  }
22
22
  exports.ResonatorModule = ResonatorModule;
@@ -16,7 +16,7 @@ class ScarabModule extends PoeNinja_1.default {
16
16
  */
17
17
  constructor(league, typeName) {
18
18
  const type = "Scarab";
19
- super(league, typeName, type);
19
+ super(league, "exchangeoverview", type);
20
20
  }
21
21
  }
22
22
  exports.ScarabModule = ScarabModule;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  const Modules = __importStar(require("./allModules/Modules"));
27
37
  /**
@@ -27,12 +27,7 @@ class AccessoryModule extends PoeWatch_1.default {
27
27
  * @throws - Throws errors encountered while fetching data.
28
28
  */
29
29
  async getCategory(categoryName) {
30
- try {
31
- return await (0, getCategory_1.default)(this.league, this.type, categoryName);
32
- }
33
- catch (error) {
34
- throw new Error(`Error fetching Accessory data: ${error.message}`);
35
- }
30
+ return await (0, getCategory_1.default)(this.league, this.type, categoryName);
36
31
  }
37
32
  }
38
33
  exports.AccessoryModule = AccessoryModule;
@@ -27,12 +27,7 @@ class ArmourModule extends PoeWatch_1.default {
27
27
  * @throws - Throws errors encountered while fetching data.
28
28
  */
29
29
  async getCategory(categoryName) {
30
- try {
31
- return await (0, getCategory_1.default)(this.league, this.type, categoryName);
32
- }
33
- catch (error) {
34
- throw new Error(`Error fetching Accessory data: ${error.message}`);
35
- }
30
+ return await (0, getCategory_1.default)(this.league, this.type, categoryName);
36
31
  }
37
32
  }
38
33
  exports.ArmourModule = ArmourModule;
@@ -27,12 +27,7 @@ class BaseModule extends PoeWatch_1.default {
27
27
  * @throws - Throws errors encountered while fetching data.
28
28
  */
29
29
  async getCategory(categoryName) {
30
- try {
31
- return await (0, getCategory_1.default)(this.league, this.type, categoryName);
32
- }
33
- catch (error) {
34
- throw new Error(`Error fetching Accessory data: ${error.message}`);
35
- }
30
+ return await (0, getCategory_1.default)(this.league, this.type, categoryName);
36
31
  }
37
32
  }
38
33
  exports.BaseModule = BaseModule;
@@ -27,12 +27,7 @@ class GemModule extends PoeWatch_1.default {
27
27
  * @throws - Throws errors encountered while fetching data.
28
28
  */
29
29
  async getCategory(categoryName) {
30
- try {
31
- return await (0, getCategory_1.default)(this.league, this.type, categoryName);
32
- }
33
- catch (error) {
34
- throw new Error(`Error fetching Accessory data: ${error.message}`);
35
- }
30
+ return await (0, getCategory_1.default)(this.league, this.type, categoryName);
36
31
  }
37
32
  }
38
33
  exports.GemModule = GemModule;
@@ -27,12 +27,7 @@ class WeaponModule extends PoeWatch_1.default {
27
27
  * @throws - Throws errors encountered while fetching data.
28
28
  */
29
29
  async getCategory(categoryName) {
30
- try {
31
- return await (0, getCategory_1.default)(this.league, this.type, categoryName);
32
- }
33
- catch (error) {
34
- throw new Error(`Error fetching Accessory data: ${error.message}`);
35
- }
30
+ return await (0, getCategory_1.default)(this.league, this.type, categoryName);
36
31
  }
37
32
  }
38
33
  exports.WeaponModule = WeaponModule;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = urlGenerator;
3
4
  /**
4
5
  * Generates a URL based on league and type. poe.watch API is used.
5
6
  * @param {string} league - The league for which the URL is generated.
@@ -7,6 +8,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
8
  * @returns {string} - The generated URL.
8
9
  */
9
10
  function urlGenerator(league, type) {
10
- return `https://api.poe.watch/get?category=${type}&league=${league}`;
11
+ return `https://api.poe.watch/get?category=${encodeURIComponent(type)}&league=${encodeURIComponent(league)}`;
11
12
  }
12
- exports.default = urlGenerator;
@@ -5,6 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const watchFetch_1 = __importDefault(require("../fetch/watchFetch"));
7
7
  const ValidationError_1 = __importDefault(require("../../../errors/ValidationError"));
8
+ const ApiError_1 = __importDefault(require("../../../errors/ApiError"));
9
+ const CustomError_1 = __importDefault(require("../../../errors/CustomError"));
8
10
  /**
9
11
  * Fetches data based on the provided query URL and filters it by category name.
10
12
  * @param league - The league to fetch the data from.
@@ -36,11 +38,12 @@ async function getCategory(league, type, categoryName) {
36
38
  return filteredData;
37
39
  }
38
40
  catch (error) {
39
- // If it's already a custom error, pass it through
40
- if (error instanceof ValidationError_1.default) {
41
+ // If it's already a custom error (validation, api, ...), pass it through unchanged
42
+ if (error instanceof CustomError_1.default) {
41
43
  throw error;
42
44
  }
43
- throw new ValidationError_1.default(`Error fetching or filtering data for category: ${error.message}`, 400, { league, type, categoryName });
45
+ // Only genuinely unknown errors (network failures, etc.) get wrapped, as a 500
46
+ throw new ApiError_1.default(`Error fetching or filtering data for category: ${error.message}`, 500, { league, type, categoryName });
44
47
  }
45
48
  }
46
49
  exports.default = getCategory;
@@ -15,20 +15,15 @@ const propertyFilter_1 = __importDefault(require("../../../mainfunctions/propert
15
15
  * @throws - Throws an error if there is an issue fetching or filtering the data.
16
16
  */
17
17
  async function getData(league, type, requestedProperties) {
18
- try {
19
- const fetchedData = await (0, watchFetch_1.default)(league, type);
20
- // If requestedProperties are specified, filter the data based on those properties
21
- if (requestedProperties && requestedProperties.length > 0) {
22
- const result = (0, propertyFilter_1.default)(fetchedData, requestedProperties);
23
- return result;
24
- }
25
- else {
26
- // If no specific properties are requested, return the entire fetched data
27
- return fetchedData;
28
- }
18
+ const fetchedData = await (0, watchFetch_1.default)(league, type);
19
+ // If requestedProperties are specified, filter the data based on those properties
20
+ if (requestedProperties && requestedProperties.length > 0) {
21
+ const result = (0, propertyFilter_1.default)(fetchedData, requestedProperties);
22
+ return result;
29
23
  }
30
- catch (error) {
31
- throw new Error(`Error fetching data: ${error.message}`);
24
+ else {
25
+ // If no specific properties are requested, return the entire fetched data
26
+ return fetchedData;
32
27
  }
33
28
  }
34
29
  exports.default = getData;
@@ -11,16 +11,11 @@ const axios_1 = __importDefault(require("axios"));
11
11
  * @throws If an error occurs during the fetch process.
12
12
  */
13
13
  async function fetchData(url) {
14
- try {
15
- const response = await axios_1.default.get(url, {
16
- headers: {
17
- 'Accept-Encoding': 'identity',
18
- },
19
- });
20
- return response;
21
- }
22
- catch (error) {
23
- throw new Error(`Error fetching data: ${error.message}`);
24
- }
14
+ const response = await axios_1.default.get(url, {
15
+ headers: {
16
+ 'Accept-Encoding': 'identity',
17
+ },
18
+ });
19
+ return response;
25
20
  }
26
21
  exports.default = fetchData;
package/package.json CHANGED
@@ -1,14 +1,20 @@
1
1
  {
2
2
  "name": "poe-api-manager",
3
- "version": "1.2.23",
3
+ "version": "2.0.0",
4
4
  "description": "poe.ninja and poe.watch API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {
8
- "build": "tsc && terser dist/index.js -o dist/index.min.js",
9
- "dev": "tsc --watch --project ./tsconfig.json && node --watch ./dist/index.js",
10
- "test-1": "ts-node test/test1.ts",
11
- "test": "node test/test.js"
8
+ "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc && terser dist/index.js -o dist/index.min.js",
9
+ "dev": "tsc --watch --project ./tsconfig.json",
10
+ "test": "npm run build && node --test test/*.test.js"
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "Changelog.md"
15
+ ],
16
+ "engines": {
17
+ "node": ">=18"
12
18
  },
13
19
  "repository": {
14
20
  "type": "git",
@@ -39,11 +45,11 @@
39
45
  "author": "Ayberk Gezer",
40
46
  "license": "MIT",
41
47
  "devDependencies": {
42
- "terser": "^5.29.2",
48
+ "terser": "^5.51.2",
43
49
  "ts-node": "^10.9.2",
44
- "typescript": "^5.4.3"
50
+ "typescript": "^5.9.3"
45
51
  },
46
52
  "dependencies": {
47
- "axios": "^1.6.8"
53
+ "axios": "^1.20.0"
48
54
  }
49
55
  }
@@ -1,77 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment for our community include:
12
-
13
- - Demonstrating empathy and kindness toward other people
14
- - Being respectful of differing opinions, viewpoints, and experiences
15
- - Giving and gracefully accepting constructive feedback
16
- - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- - Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior include:
20
-
21
- - The use of sexualized language or imagery, and sexual attention or advances of any kind
22
- - Trolling, insulting or derogatory comments, and personal or political attacks
23
- - Public or private harassment
24
- - Publishing others’ private information, such as a physical or email address, without their explicit permission
25
- - Other conduct which could reasonably be considered inappropriate in a professional setting
26
-
27
- ## Enforcement Responsibilities
28
-
29
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30
-
31
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32
-
33
- ## Scope
34
-
35
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36
-
37
- ## Enforcement
38
-
39
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [email@example.com](mailto:email@example.com). All complaints will be reviewed and investigated promptly and fairly.
40
-
41
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42
-
43
- ## Enforcement Guidelines
44
-
45
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46
-
47
- ### 1. Correction
48
-
49
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50
-
51
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52
-
53
- ### 2. Warning
54
-
55
- **Community Impact**: A violation through a single incident or series of actions.
56
-
57
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58
-
59
- ### 3. Temporary Ban
60
-
61
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62
-
63
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64
-
65
- ### 4. Permanent Ban
66
-
67
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68
-
69
- **Consequence**: A permanent ban from any sort of public interaction within the community.
70
-
71
- ## Attribution
72
-
73
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
74
-
75
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
76
-
77
- For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are available at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations).
package/CONTRIBUTING.md DELETED
@@ -1,56 +0,0 @@
1
- ### CONTRIBUTING.md
2
-
3
- ```md
4
- # Contributing to poe-api-manager
5
-
6
- First off, thanks for taking the time to contribute! 🎉
7
-
8
- The following is a set of guidelines for contributing to poe-api-manager. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
9
-
10
- ## Code of Conduct
11
-
12
- This project and everyone participating in it is governed by the [poe-api-manager Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [ayberkgezer@outlook.com](mailto:ayberkgezer@outlook.com).
13
-
14
- ## How Can I Contribute?
15
-
16
- ### Reporting Bugs
17
-
18
- This section guides you through submitting a bug report for poe-api-manager. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports.
19
-
20
- - **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/ayberkgezer/poe-api-manager/issues).
21
- - If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/ayberkgezer/poe-api-manager/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.
22
-
23
- ### Suggesting Enhancements
24
-
25
- This section guides you through submitting an enhancement suggestion for poe-api-manager, including completely new features and minor improvements to existing functionality.
26
-
27
- - **Ensure the enhancement was not already suggested** by searching on GitHub under [Issues](https://github.com/ayberkgezer/poe-api-manager/issues).
28
- - If you find an enhancement that matches your suggestion, feel free to add additional comments or ideas.
29
- - If you cannot find an existing issue, [open a new one](https://github.com/ayberkgezer/poe-api-manager/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior.
30
-
31
- ### Pull Requests
32
-
33
- The process described here has several goals:
34
-
35
- - Maintain poe-api-manager's quality
36
- - Fix problems that are important to users
37
- - Engage the community in working toward the best possible poe-api-manager
38
- - Enable a sustainable system for poe-api-manager's maintainers to review contributions
39
-
40
- Please follow these steps to have your contribution considered by the maintainers:
41
-
42
- 1. Fork the repository and create your branch from `main`.
43
- 2. If you've added code that should be tested, add tests.
44
- 3. If you've changed APIs, update the documentation.
45
- 4. Ensure the test suite passes.
46
- 5. Make sure your code lints.
47
- 6. Issue that pull request!
48
-
49
- ### Coding Style
50
-
51
- - Please follow the coding style used throughout the project.
52
- - Ensure your code is properly formatted and linted.
53
-
54
- ## License
55
-
56
- By contributing to poe-api-manager, you agree that your contributions will be licensed under its MIT License.
package/SECURITY.md DELETED
@@ -1,14 +0,0 @@
1
- # Security Policy
2
-
3
- ## Supported Versions
4
-
5
- We release patches for security vulnerabilities. Which versions are eligible for receiving such patches depend on the CVSS v3.0 Rating:
6
-
7
- | Version | Supported |
8
- | ------- | ------------------ |
9
- | 1.2.x | :white_check_mark: |
10
- | < 1.2 | :x: |
11
-
12
- ## Reporting a Vulnerability
13
-
14
- If you discover a security vulnerability within this project, please send an email to Ayberk Gezer at [ayberkgezer@outlook.com](mailto:ayberkgezer@outlook.com) . All security vulnerabilities will be promptly addressed.
@@ -1,12 +0,0 @@
1
- import PoeNinja from "../../../../../AbstractClass/PoeNinja";
2
- /**
3
- * Represents a module for handling helmet enchants.
4
- */
5
- export declare class HelmetEnchantModule extends PoeNinja {
6
- /**
7
- * Creates an instance of HelmetEnchantModule.
8
- * @param league - The league name.
9
- * @param typeName - The type name.
10
- */
11
- constructor(league: string, typeName: string);
12
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.HelmetEnchantModule = void 0;
7
- const PoeNinja_1 = __importDefault(require("../../../../../AbstractClass/PoeNinja"));
8
- /**
9
- * Represents a module for handling helmet enchants.
10
- */
11
- class HelmetEnchantModule extends PoeNinja_1.default {
12
- /**
13
- * Creates an instance of HelmetEnchantModule.
14
- * @param league - The league name.
15
- * @param typeName - The type name.
16
- */
17
- constructor(league, typeName) {
18
- const type = "HelmetEnchant";
19
- super(league, typeName, type);
20
- }
21
- }
22
- exports.HelmetEnchantModule = HelmetEnchantModule;
package/tsconfig.json DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- "module": "CommonJS",
5
- "outDir": "dist",
6
- "declaration": true,
7
- "strict": true,
8
- "esModuleInterop": true
9
- },
10
- "include": ["src/**/*"],
11
- "exclude": ["node_modules", "dist"]
12
- }