poe-api-manager 1.2.23 → 2.1.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.
- package/Changelog.md +39 -0
- package/README.md +142 -21
- package/dist/index.d.ts +5 -0
- package/dist/index.js +12 -0
- package/dist/lib/AbstractClass/PoeNinja.js +1 -1
- package/dist/lib/AbstractClass/PoeNinjaLeaf.d.ts +8 -0
- package/dist/lib/AbstractClass/PoeNinjaLeaf.js +14 -0
- package/dist/lib/AbstractClass/PoeWatch.js +1 -1
- package/dist/lib/AbstractClass/PoeWatchLeaf.d.ts +8 -0
- package/dist/lib/AbstractClass/PoeWatchLeaf.js +14 -0
- package/dist/lib/NinjaAPI.js +2 -2
- package/dist/lib/Poe2NinjaAPI.d.ts +25 -0
- package/dist/lib/Poe2NinjaAPI.js +35 -0
- package/dist/lib/Poe2WatchAPI.d.ts +17 -0
- package/dist/lib/Poe2WatchAPI.js +26 -0
- package/dist/lib/Utils.d.ts +14 -0
- package/dist/lib/Utils.js +21 -12
- package/dist/lib/errors/CustomError.js +4 -1
- package/dist/lib/mainfunctions/propertyFilter.js +4 -7
- package/dist/lib/modules/poe.ninja/currencyView/{currencySubModules/submodules/CurrencyModule.d.ts → CurrencyModule.d.ts} +1 -1
- package/dist/lib/modules/poe.ninja/currencyView/{currencySubModules/submodules/CurrencyModule.js → CurrencyModule.js} +4 -4
- package/dist/lib/modules/poe.ninja/currencyView/CurrencyViewModule.d.ts +5 -5
- package/dist/lib/modules/poe.ninja/currencyView/CurrencyViewModule.js +8 -27
- package/dist/lib/modules/poe.ninja/fetch/fetchData.js +17 -8
- package/dist/lib/modules/poe.ninja/fetch/merge/mergeData.js +7 -7
- package/dist/lib/modules/poe.ninja/fetch/merge/mergeExchangeData.d.ts +10 -0
- package/dist/lib/modules/poe.ninja/fetch/merge/mergeExchangeData.js +32 -0
- package/dist/lib/modules/poe.ninja/func/getData.js +7 -12
- package/dist/lib/modules/poe.ninja/func/getQuickCurrency.js +14 -14
- package/dist/lib/modules/poe.ninja/func/urlGenerator.js +18 -2
- package/dist/lib/modules/poe.ninja/itemView/ItemViewModule.d.ts +58 -119
- package/dist/lib/modules/poe.ninja/itemView/ItemViewModule.js +71 -142
- package/dist/lib/modules/poe.ninja/poe2/Poe2ExchangeView.d.ts +26 -0
- package/dist/lib/modules/poe.ninja/poe2/Poe2ExchangeView.js +55 -0
- package/dist/lib/modules/poe.ninja/poe2/Poe2ItemView.d.ts +20 -0
- package/dist/lib/modules/poe.ninja/poe2/Poe2ItemView.js +45 -0
- package/dist/lib/modules/poe.ninja/poe2/PoeNinja2.d.ts +26 -0
- package/dist/lib/modules/poe.ninja/poe2/PoeNinja2.js +48 -0
- package/dist/lib/modules/poe.ninja/poe2/fetchData2.d.ts +12 -0
- package/dist/lib/modules/poe.ninja/poe2/fetchData2.js +57 -0
- package/dist/lib/modules/poe.ninja/poe2/getData2.d.ts +11 -0
- package/dist/lib/modules/poe.ninja/poe2/getData2.js +26 -0
- package/dist/lib/modules/poe.ninja/poe2/urlGenerator2.d.ts +9 -0
- package/dist/lib/modules/poe.ninja/poe2/urlGenerator2.js +21 -0
- package/dist/lib/modules/poe.watch/WatchViewModule.d.ts +46 -84
- package/dist/lib/modules/poe.watch/WatchViewModule.js +58 -108
- package/dist/lib/modules/poe.watch/allModules/subModules/AccessoryModule.js +1 -6
- package/dist/lib/modules/poe.watch/allModules/subModules/ArmourModule.js +1 -6
- package/dist/lib/modules/poe.watch/allModules/subModules/BaseModule.js +1 -6
- package/dist/lib/modules/poe.watch/allModules/subModules/GemModule.js +1 -6
- package/dist/lib/modules/poe.watch/allModules/subModules/WeaponModule.js +1 -6
- package/dist/lib/modules/poe.watch/fetch/watchFetch.js +2 -5
- package/dist/lib/modules/poe.watch/func/WatchUrlGenerator.js +2 -2
- package/dist/lib/modules/poe.watch/func/getCategory.js +6 -3
- package/dist/lib/modules/poe.watch/func/getData.js +8 -13
- package/dist/lib/modules/poe.watch/poe2/Poe2ExchangeModule.d.ts +30 -0
- package/dist/lib/modules/poe.watch/poe2/Poe2ExchangeModule.js +53 -0
- package/dist/lib/modules/poe.watch/poe2/filterByCategory.d.ts +9 -0
- package/dist/lib/modules/poe.watch/poe2/filterByCategory.js +14 -0
- package/dist/lib/modules/poe.watch/poe2/getCategory2.d.ts +9 -0
- package/dist/lib/modules/poe.watch/poe2/getCategory2.js +40 -0
- package/dist/lib/modules/poe.watch/poe2/getData2.d.ts +9 -0
- package/dist/lib/modules/poe.watch/poe2/getData2.js +24 -0
- package/dist/lib/modules/poe.watch/poe2/unwrapItems.d.ts +11 -0
- package/dist/lib/modules/poe.watch/poe2/unwrapItems.js +21 -0
- package/dist/lib/modules/poe.watch/poe2/watchFetch2.d.ts +8 -0
- package/dist/lib/modules/poe.watch/poe2/watchFetch2.js +43 -0
- package/dist/lib/modules/poe.watch/poe2/watchUrlGenerator2.d.ts +8 -0
- package/dist/lib/modules/poe.watch/poe2/watchUrlGenerator2.js +13 -0
- package/dist/lib/modules/utils/getLeagues.js +2 -2
- package/dist/lib/modules/utils/getNinjaLeagues.d.ts +8 -0
- package/dist/lib/modules/utils/getNinjaLeagues.js +36 -0
- package/dist/lib/modules/utils/httpGet.d.ts +9 -0
- package/dist/lib/modules/utils/httpGet.js +23 -0
- package/package.json +14 -9
- package/CODE_OF_CONDUCT.md +0 -77
- package/CONTRIBUTING.md +0 -56
- package/SECURITY.md +0 -14
- package/dist/index.min.js +0 -1
- package/dist/lib/modules/poe.ninja/currencyView/currencySubModules/CurrencySubModules.d.ts +0 -2
- package/dist/lib/modules/poe.ninja/currencyView/currencySubModules/CurrencySubModules.js +0 -18
- package/dist/lib/modules/poe.ninja/currencyView/currencySubModules/submodules/FragmentModule.d.ts +0 -14
- package/dist/lib/modules/poe.ninja/currencyView/currencySubModules/submodules/FragmentModule.js +0 -26
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/itemSubModules.d.ts +0 -29
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/itemSubModules.js +0 -45
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/AllflameEmberModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/AllflameEmberModule.js +0 -23
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/BaseTypeModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/BaseTypeModule.js +0 -23
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/BeastModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/BeastModule.js +0 -23
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/BlightRavagedMapModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/BlightRavagedMapModule.js +0 -23
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/BlightedMapModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/BlightedMapModule.js +0 -23
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/ClusterJewelModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/ClusterJewelModule.js +0 -23
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/CoffinModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/CoffinModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/DeliriumOrbsModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/DeliriumOrbsModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/DivinationCardModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/DivinationCardModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/EssenceModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/EssenceModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/FossilModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/FossilModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/HelmetEnchantModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/HelmetEnchantModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/IncubatorModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/IncubatorModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/InvitationModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/InvitationModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/MapModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/MapModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/MemoryModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/MemoryModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/OilModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/OilModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/OmenModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/OmenModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/ResonatorModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/ResonatorModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/ScarabModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/ScarabModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/SkillGemModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/SkillGemModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/UniqueAccessoryModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/UniqueAccessoryModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/UniqueArmourModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/UniqueArmourModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/UniqueFlaskModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/UniqueFlaskModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/UniqueJewelModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/UniqueJewelModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/UniqueMapModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/UniqueMapModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/UniqueRelicModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/UniqueRelicModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/UniqueWeaponModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/UniqueWeaponModule.js +0 -22
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/VialsModule.d.ts +0 -12
- package/dist/lib/modules/poe.ninja/itemView/itemSubmodules/subModules/VialsModule.js +0 -22
- package/dist/lib/modules/poe.watch/allModules/Modules.d.ts +0 -21
- package/dist/lib/modules/poe.watch/allModules/Modules.js +0 -37
- package/dist/lib/modules/poe.watch/allModules/subModules/BeastModule.d.ts +0 -11
- package/dist/lib/modules/poe.watch/allModules/subModules/BeastModule.js +0 -21
- package/dist/lib/modules/poe.watch/allModules/subModules/CurrencyModule.d.ts +0 -11
- package/dist/lib/modules/poe.watch/allModules/subModules/CurrencyModule.js +0 -21
- package/dist/lib/modules/poe.watch/allModules/subModules/DeliriumOrbModule.d.ts +0 -11
- package/dist/lib/modules/poe.watch/allModules/subModules/DeliriumOrbModule.js +0 -21
- package/dist/lib/modules/poe.watch/allModules/subModules/DivsModule.d.ts +0 -11
- package/dist/lib/modules/poe.watch/allModules/subModules/DivsModule.js +0 -21
- package/dist/lib/modules/poe.watch/allModules/subModules/EssenceModule.d.ts +0 -11
- package/dist/lib/modules/poe.watch/allModules/subModules/EssenceModule.js +0 -21
- package/dist/lib/modules/poe.watch/allModules/subModules/FlaskModule.d.ts +0 -11
- package/dist/lib/modules/poe.watch/allModules/subModules/FlaskModule.js +0 -21
- package/dist/lib/modules/poe.watch/allModules/subModules/FossilModule.d.ts +0 -11
- package/dist/lib/modules/poe.watch/allModules/subModules/FossilModule.js +0 -21
- package/dist/lib/modules/poe.watch/allModules/subModules/FragmentModule.d.ts +0 -11
- package/dist/lib/modules/poe.watch/allModules/subModules/FragmentModule.js +0 -21
- package/dist/lib/modules/poe.watch/allModules/subModules/InscribedModule.d.ts +0 -11
- package/dist/lib/modules/poe.watch/allModules/subModules/InscribedModule.js +0 -21
- package/dist/lib/modules/poe.watch/allModules/subModules/InvitationModule.d.ts +0 -11
- package/dist/lib/modules/poe.watch/allModules/subModules/InvitationModule.js +0 -21
- package/dist/lib/modules/poe.watch/allModules/subModules/JewelModule.d.ts +0 -11
- package/dist/lib/modules/poe.watch/allModules/subModules/JewelModule.js +0 -21
- package/dist/lib/modules/poe.watch/allModules/subModules/MapModule.d.ts +0 -11
- package/dist/lib/modules/poe.watch/allModules/subModules/MapModule.js +0 -21
- package/dist/lib/modules/poe.watch/allModules/subModules/OilModule.d.ts +0 -11
- package/dist/lib/modules/poe.watch/allModules/subModules/OilModule.js +0 -21
- package/dist/lib/modules/poe.watch/allModules/subModules/ScarabModule.d.ts +0 -11
- package/dist/lib/modules/poe.watch/allModules/subModules/ScarabModule.js +0 -21
- package/dist/lib/modules/poe.watch/allModules/subModules/SextantModule.d.ts +0 -11
- package/dist/lib/modules/poe.watch/allModules/subModules/SextantModule.js +0 -21
- package/dist/lib/modules/poe.watch/allModules/subModules/UniqueMapsModule.d.ts +0 -11
- package/dist/lib/modules/poe.watch/allModules/subModules/UniqueMapsModule.js +0 -21
- package/dist/lib/modules/utils/fetchData/fetchData.d.ts +0 -10
- package/dist/lib/modules/utils/fetchData/fetchData.js +0 -26
- package/tsconfig.json +0 -12
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
const watchFetch2_1 = __importDefault(require("./watchFetch2"));
|
|
7
|
+
const filterByCategory_1 = __importDefault(require("./filterByCategory"));
|
|
8
|
+
const ValidationError_1 = __importDefault(require("../../../errors/ValidationError"));
|
|
9
|
+
const ApiError_1 = __importDefault(require("../../../errors/ApiError"));
|
|
10
|
+
const CustomError_1 = __importDefault(require("../../../errors/CustomError"));
|
|
11
|
+
/**
|
|
12
|
+
* Fetches PoE2 exchange ratios and filters them by category.
|
|
13
|
+
* @param league - The league to fetch the data from.
|
|
14
|
+
* @param categoryName - The category to filter by (matches the `category` field).
|
|
15
|
+
* @returns A promise that resolves to an array of filtered items.
|
|
16
|
+
* @throws Throws a ValidationError if category name is missing or matches nothing.
|
|
17
|
+
*/
|
|
18
|
+
async function getCategory2(league, categoryName) {
|
|
19
|
+
try {
|
|
20
|
+
// Validate category name first
|
|
21
|
+
if (!categoryName && categoryName !== "0") {
|
|
22
|
+
throw new ValidationError_1.default("Category name is required.", 400, {
|
|
23
|
+
league,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const fetchedData = await (0, watchFetch2_1.default)(league);
|
|
27
|
+
const filteredData = (0, filterByCategory_1.default)(fetchedData, categoryName);
|
|
28
|
+
if (filteredData.length === 0) {
|
|
29
|
+
throw new ValidationError_1.default(`No data found for category: ${categoryName}`, 404, { league, categoryName });
|
|
30
|
+
}
|
|
31
|
+
return filteredData;
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
if (error instanceof CustomError_1.default) {
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
throw new ApiError_1.default(`Error fetching or filtering data for category: ${error.message}`, 500, { league, categoryName });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = getCategory2;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retrieves PoE2 exchange ratios data, optionally filtering based on requested properties.
|
|
3
|
+
* @param league - The league from which the data will be fetched.
|
|
4
|
+
* @param requestedProperties - An optional array of property names to filter the data.
|
|
5
|
+
* @returns - A promise that resolves to the fetched or filtered data.
|
|
6
|
+
* @throws - Throws an error if there is an issue fetching or filtering the data.
|
|
7
|
+
*/
|
|
8
|
+
declare function getData2(league: string, requestedProperties?: string[]): Promise<object[]>;
|
|
9
|
+
export default getData2;
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
const watchFetch2_1 = __importDefault(require("./watchFetch2"));
|
|
7
|
+
const propertyFilter_1 = __importDefault(require("../../../mainfunctions/propertyFilter"));
|
|
8
|
+
/**
|
|
9
|
+
* Retrieves PoE2 exchange ratios data, optionally filtering based on requested properties.
|
|
10
|
+
* @param league - The league from which the data will be fetched.
|
|
11
|
+
* @param requestedProperties - An optional array of property names to filter the data.
|
|
12
|
+
* @returns - A promise that resolves to the fetched or filtered data.
|
|
13
|
+
* @throws - Throws an error if there is an issue fetching or filtering the data.
|
|
14
|
+
*/
|
|
15
|
+
async function getData2(league, requestedProperties) {
|
|
16
|
+
const fetchedData = await (0, watchFetch2_1.default)(league);
|
|
17
|
+
if (requestedProperties && requestedProperties.length > 0) {
|
|
18
|
+
return (0, propertyFilter_1.default)(fetchedData, requestedProperties);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return fetchedData;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = getData2;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unwraps the `{items:[...]}` envelope returned by the poe.watch PoE2
|
|
3
|
+
* exchange ratios endpoint (unlike PoE1's /get, which returns a bare array).
|
|
4
|
+
* @param data The raw response body.
|
|
5
|
+
* @param context Extra context (league) attached to a thrown ApiError.
|
|
6
|
+
* @returns The `items` array.
|
|
7
|
+
* @throws {ApiError} If `data.items` is missing or not an array.
|
|
8
|
+
*/
|
|
9
|
+
export default function unwrapItems(data: any, context: {
|
|
10
|
+
league: string;
|
|
11
|
+
}): object[];
|
|
@@ -0,0 +1,21 @@
|
|
|
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.default = unwrapItems;
|
|
7
|
+
const ApiError_1 = __importDefault(require("../../../errors/ApiError"));
|
|
8
|
+
/**
|
|
9
|
+
* Unwraps the `{items:[...]}` envelope returned by the poe.watch PoE2
|
|
10
|
+
* exchange ratios endpoint (unlike PoE1's /get, which returns a bare array).
|
|
11
|
+
* @param data The raw response body.
|
|
12
|
+
* @param context Extra context (league) attached to a thrown ApiError.
|
|
13
|
+
* @returns The `items` array.
|
|
14
|
+
* @throws {ApiError} If `data.items` is missing or not an array.
|
|
15
|
+
*/
|
|
16
|
+
function unwrapItems(data, context) {
|
|
17
|
+
if (data && Array.isArray(data.items)) {
|
|
18
|
+
return data.items;
|
|
19
|
+
}
|
|
20
|
+
throw new ApiError_1.default("Invalid response format from POE Watch PoE2 exchange ratios API", 400, context);
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetches PoE2 exchange ratios from the poe.watch API.
|
|
3
|
+
* @param league - The game league for which to fetch data.
|
|
4
|
+
* @returns - A Promise that resolves to the fetched `items` array.
|
|
5
|
+
* @throws - Throws an error if there is an issue with the API response or fetching data.
|
|
6
|
+
*/
|
|
7
|
+
declare function watchFetch2(league: string): Promise<object[]>;
|
|
8
|
+
export default watchFetch2;
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
const axios_1 = __importDefault(require("axios"));
|
|
7
|
+
const ApiError_1 = __importDefault(require("../../../errors/ApiError"));
|
|
8
|
+
const CustomError_1 = __importDefault(require("../../../errors/CustomError"));
|
|
9
|
+
const watchUrlGenerator2_1 = __importDefault(require("./watchUrlGenerator2"));
|
|
10
|
+
const unwrapItems_1 = __importDefault(require("./unwrapItems"));
|
|
11
|
+
const httpGet_1 = __importDefault(require("../../utils/httpGet"));
|
|
12
|
+
/**
|
|
13
|
+
* Fetches PoE2 exchange ratios from the poe.watch API.
|
|
14
|
+
* @param league - The game league for which to fetch data.
|
|
15
|
+
* @returns - A Promise that resolves to the fetched `items` array.
|
|
16
|
+
* @throws - Throws an error if there is an issue with the API response or fetching data.
|
|
17
|
+
*/
|
|
18
|
+
async function watchFetch2(league) {
|
|
19
|
+
try {
|
|
20
|
+
const url = (0, watchUrlGenerator2_1.default)(league);
|
|
21
|
+
const response = await (0, httpGet_1.default)(url);
|
|
22
|
+
return (0, unwrapItems_1.default)(response.data, { league });
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
// If it's already a typed error, pass it through
|
|
26
|
+
if (error instanceof CustomError_1.default) {
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
// Handle axios errors
|
|
30
|
+
if (axios_1.default.isAxiosError(error)) {
|
|
31
|
+
const statusCode = error.response?.status || 500;
|
|
32
|
+
const errorDetails = error.response?.data || {};
|
|
33
|
+
throw new ApiError_1.default(`Error fetching data from poe.watch PoE2: ${errorDetails.error || error.message}`, statusCode, {
|
|
34
|
+
code: errorDetails.code,
|
|
35
|
+
league,
|
|
36
|
+
url: error.config?.url,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
// General error case
|
|
40
|
+
throw new ApiError_1.default(`Error fetching data from poe.watch PoE2: ${error}`, 500, { league });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.default = watchFetch2;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates the poe.watch PoE2 exchange ratios URL. This is the only PoE2
|
|
3
|
+
* endpoint poe.watch exposes (per their published OpenAPI spec); /get and
|
|
4
|
+
* /leagues are PoE1-only and have no `game` parameter.
|
|
5
|
+
* @param {string} league - The league for which the URL is generated.
|
|
6
|
+
* @returns {string} - The generated URL.
|
|
7
|
+
*/
|
|
8
|
+
export default function watchUrlGenerator2(league: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = watchUrlGenerator2;
|
|
4
|
+
/**
|
|
5
|
+
* Generates the poe.watch PoE2 exchange ratios URL. This is the only PoE2
|
|
6
|
+
* endpoint poe.watch exposes (per their published OpenAPI spec); /get and
|
|
7
|
+
* /leagues are PoE1-only and have no `game` parameter.
|
|
8
|
+
* @param {string} league - The league for which the URL is generated.
|
|
9
|
+
* @returns {string} - The generated URL.
|
|
10
|
+
*/
|
|
11
|
+
function watchUrlGenerator2(league) {
|
|
12
|
+
return `https://api.poe.watch/exchange/ratios?league=${encodeURIComponent(league)}&game=poe2`;
|
|
13
|
+
}
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const ApiError_1 = __importDefault(require("../../errors/ApiError"));
|
|
7
|
-
const
|
|
7
|
+
const httpGet_1 = __importDefault(require("./httpGet"));
|
|
8
8
|
/**
|
|
9
9
|
* Fetches league names from the provided URL.
|
|
10
10
|
*
|
|
@@ -18,7 +18,7 @@ const fetchData_1 = __importDefault(require("./fetchData/fetchData"));
|
|
|
18
18
|
async function getLeagues() {
|
|
19
19
|
const url = "https://api.poe.watch/leagues";
|
|
20
20
|
try {
|
|
21
|
-
const { data } = await (0,
|
|
21
|
+
const { data } = await (0, httpGet_1.default)(url);
|
|
22
22
|
if (!data || !Array.isArray(data)) {
|
|
23
23
|
throw new ApiError_1.default("Invalid response format from leagues API", 400, {
|
|
24
24
|
url,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetches league names from poe.ninja's economy leagues endpoint.
|
|
3
|
+
* @param version Which game's leagues to fetch.
|
|
4
|
+
* @returns A Promise that resolves with an array of league names.
|
|
5
|
+
* @throws If an error occurs during the fetch process or if the response data is empty.
|
|
6
|
+
*/
|
|
7
|
+
declare function getNinjaLeagues(version: "poe1" | "poe2"): Promise<string[]>;
|
|
8
|
+
export default getNinjaLeagues;
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
const httpGet_1 = __importDefault(require("./httpGet"));
|
|
7
|
+
const ApiError_1 = __importDefault(require("../../errors/ApiError"));
|
|
8
|
+
/**
|
|
9
|
+
* Fetches league names from poe.ninja's economy leagues endpoint.
|
|
10
|
+
* @param version Which game's leagues to fetch.
|
|
11
|
+
* @returns A Promise that resolves with an array of league names.
|
|
12
|
+
* @throws If an error occurs during the fetch process or if the response data is empty.
|
|
13
|
+
*/
|
|
14
|
+
async function getNinjaLeagues(version) {
|
|
15
|
+
const url = `https://poe.ninja/${version}/api/economy/leagues`;
|
|
16
|
+
try {
|
|
17
|
+
const { data } = await (0, httpGet_1.default)(url);
|
|
18
|
+
if (!data || !Array.isArray(data)) {
|
|
19
|
+
throw new ApiError_1.default(`Invalid response format from poe.ninja ${version} leagues API`, 400, { url });
|
|
20
|
+
}
|
|
21
|
+
const names = data.map((item) => item.name);
|
|
22
|
+
if (names.length === 0) {
|
|
23
|
+
throw new ApiError_1.default(`No ${version} leagues found in response`, 404, {
|
|
24
|
+
url,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return names;
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (error instanceof ApiError_1.default) {
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
throw new ApiError_1.default(`Error fetching ${version} League Names: ${error.message}`, 500, { url });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = getNinjaLeagues;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared axios GET helper. Every caller in this library needs the same
|
|
3
|
+
* Accept-Encoding/User-Agent headers; this is the one place that builds them.
|
|
4
|
+
* Callers keep their own error wrapping - this only shares the transport.
|
|
5
|
+
* @param url The URL to fetch.
|
|
6
|
+
* @returns The axios response.
|
|
7
|
+
*/
|
|
8
|
+
declare function httpGet(url: string): Promise<any>;
|
|
9
|
+
export default httpGet;
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
const axios_1 = __importDefault(require("axios"));
|
|
7
|
+
const { version: PACKAGE_VERSION } = require("../../../../package.json");
|
|
8
|
+
/**
|
|
9
|
+
* Shared axios GET helper. Every caller in this library needs the same
|
|
10
|
+
* Accept-Encoding/User-Agent headers; this is the one place that builds them.
|
|
11
|
+
* Callers keep their own error wrapping - this only shares the transport.
|
|
12
|
+
* @param url The URL to fetch.
|
|
13
|
+
* @returns The axios response.
|
|
14
|
+
*/
|
|
15
|
+
async function httpGet(url) {
|
|
16
|
+
return axios_1.default.get(url, {
|
|
17
|
+
headers: {
|
|
18
|
+
"Accept-Encoding": "identity",
|
|
19
|
+
"User-Agent": `poe-api-manager/${PACKAGE_VERSION} (+https://github.com/ayberkgezer/poe-api-manager)`,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
exports.default = httpGet;
|
package/package.json
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "poe-api-manager",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.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": "
|
|
9
|
-
"dev": "tsc --watch --project ./tsconfig.json
|
|
10
|
-
"test
|
|
11
|
-
|
|
8
|
+
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc",
|
|
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,10 @@
|
|
|
39
45
|
"author": "Ayberk Gezer",
|
|
40
46
|
"license": "MIT",
|
|
41
47
|
"devDependencies": {
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"typescript": "^5.4.3"
|
|
48
|
+
"@types/node": "^20.19.43",
|
|
49
|
+
"typescript": "^5.9.3"
|
|
45
50
|
},
|
|
46
51
|
"dependencies": {
|
|
47
|
-
"axios": "^1.
|
|
52
|
+
"axios": "^1.20.0"
|
|
48
53
|
}
|
|
49
54
|
}
|
package/CODE_OF_CONDUCT.md
DELETED
|
@@ -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.
|
package/dist/index.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./submodules/CurrencyModule"), exports);
|
|
18
|
-
__exportStar(require("./submodules/FragmentModule"), exports);
|
package/dist/lib/modules/poe.ninja/currencyView/currencySubModules/submodules/FragmentModule.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import PoeNinja from "../../../../../AbstractClass/PoeNinja";
|
|
2
|
-
/**
|
|
3
|
-
* Represents a module for handling fragments in the PoeNinja currency view.
|
|
4
|
-
*/
|
|
5
|
-
export declare class FragmentModule extends PoeNinja {
|
|
6
|
-
protected league: string;
|
|
7
|
-
protected typeName: string;
|
|
8
|
-
/**
|
|
9
|
-
* Creates an instance of FragmentModule.
|
|
10
|
-
* @param league The league for which the module is created.
|
|
11
|
-
* @param typeName The type name of the module.
|
|
12
|
-
*/
|
|
13
|
-
constructor(league: string, typeName: string);
|
|
14
|
-
}
|
package/dist/lib/modules/poe.ninja/currencyView/currencySubModules/submodules/FragmentModule.js
DELETED
|
@@ -1,26 +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.FragmentModule = void 0;
|
|
7
|
-
const PoeNinja_1 = __importDefault(require("../../../../../AbstractClass/PoeNinja"));
|
|
8
|
-
/**
|
|
9
|
-
* Represents a module for handling fragments in the PoeNinja currency view.
|
|
10
|
-
*/
|
|
11
|
-
class FragmentModule extends PoeNinja_1.default {
|
|
12
|
-
league;
|
|
13
|
-
typeName;
|
|
14
|
-
/**
|
|
15
|
-
* Creates an instance of FragmentModule.
|
|
16
|
-
* @param league The league for which the module is created.
|
|
17
|
-
* @param typeName The type name of the module.
|
|
18
|
-
*/
|
|
19
|
-
constructor(league, typeName) {
|
|
20
|
-
const type = "Fragment";
|
|
21
|
-
super(league, typeName, type);
|
|
22
|
-
this.league = league;
|
|
23
|
-
this.typeName = typeName;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.FragmentModule = FragmentModule;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export * from "./subModules/BaseTypeModule";
|
|
2
|
-
export * from "./subModules/BeastModule";
|
|
3
|
-
export * from "./subModules/DeliriumOrbsModule";
|
|
4
|
-
export * from "./subModules/DivinationCardModule";
|
|
5
|
-
export * from "./subModules/EssenceModule";
|
|
6
|
-
export * from "./subModules/FossilModule";
|
|
7
|
-
export * from "./subModules/HelmetEnchantModule";
|
|
8
|
-
export * from "./subModules/IncubatorModule";
|
|
9
|
-
export * from "./subModules/MapModule";
|
|
10
|
-
export * from "./subModules/OilModule";
|
|
11
|
-
export * from "./subModules/ResonatorModule";
|
|
12
|
-
export * from "./subModules/ScarabModule";
|
|
13
|
-
export * from "./subModules/SkillGemModule";
|
|
14
|
-
export * from "./subModules/UniqueAccessoryModule";
|
|
15
|
-
export * from "./subModules/UniqueArmourModule";
|
|
16
|
-
export * from "./subModules/UniqueFlaskModule";
|
|
17
|
-
export * from "./subModules/UniqueJewelModule";
|
|
18
|
-
export * from "./subModules/UniqueMapModule";
|
|
19
|
-
export * from "./subModules/UniqueWeaponModule";
|
|
20
|
-
export * from "./subModules/VialsModule";
|
|
21
|
-
export * from "./subModules/OmenModule";
|
|
22
|
-
export * from "./subModules/MemoryModule";
|
|
23
|
-
export * from "./subModules/InvitationModule";
|
|
24
|
-
export * from "./subModules/UniqueRelicModule";
|
|
25
|
-
export * from "./subModules/ClusterJewelModule";
|
|
26
|
-
export * from "./subModules/BlightedMapModule";
|
|
27
|
-
export * from "./subModules/BlightRavagedMapModule";
|
|
28
|
-
export * from "./subModules/CoffinModule";
|
|
29
|
-
export * from "./subModules/AllflameEmberModule";
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./subModules/BaseTypeModule"), exports);
|
|
18
|
-
__exportStar(require("./subModules/BeastModule"), exports);
|
|
19
|
-
__exportStar(require("./subModules/DeliriumOrbsModule"), exports);
|
|
20
|
-
__exportStar(require("./subModules/DivinationCardModule"), exports);
|
|
21
|
-
__exportStar(require("./subModules/EssenceModule"), exports);
|
|
22
|
-
__exportStar(require("./subModules/FossilModule"), exports);
|
|
23
|
-
__exportStar(require("./subModules/HelmetEnchantModule"), exports);
|
|
24
|
-
__exportStar(require("./subModules/IncubatorModule"), exports);
|
|
25
|
-
__exportStar(require("./subModules/MapModule"), exports);
|
|
26
|
-
__exportStar(require("./subModules/OilModule"), exports);
|
|
27
|
-
__exportStar(require("./subModules/ResonatorModule"), exports);
|
|
28
|
-
__exportStar(require("./subModules/ScarabModule"), exports);
|
|
29
|
-
__exportStar(require("./subModules/SkillGemModule"), exports);
|
|
30
|
-
__exportStar(require("./subModules/UniqueAccessoryModule"), exports);
|
|
31
|
-
__exportStar(require("./subModules/UniqueArmourModule"), exports);
|
|
32
|
-
__exportStar(require("./subModules/UniqueFlaskModule"), exports);
|
|
33
|
-
__exportStar(require("./subModules/UniqueJewelModule"), exports);
|
|
34
|
-
__exportStar(require("./subModules/UniqueMapModule"), exports);
|
|
35
|
-
__exportStar(require("./subModules/UniqueWeaponModule"), exports);
|
|
36
|
-
__exportStar(require("./subModules/VialsModule"), exports);
|
|
37
|
-
__exportStar(require("./subModules/OmenModule"), exports);
|
|
38
|
-
__exportStar(require("./subModules/MemoryModule"), exports);
|
|
39
|
-
__exportStar(require("./subModules/InvitationModule"), exports);
|
|
40
|
-
__exportStar(require("./subModules/UniqueRelicModule"), exports);
|
|
41
|
-
__exportStar(require("./subModules/ClusterJewelModule"), exports);
|
|
42
|
-
__exportStar(require("./subModules/BlightedMapModule"), exports);
|
|
43
|
-
__exportStar(require("./subModules/BlightRavagedMapModule"), exports);
|
|
44
|
-
__exportStar(require("./subModules/CoffinModule"), exports);
|
|
45
|
-
__exportStar(require("./subModules/AllflameEmberModule"), exports);
|