Initial commit

This commit is contained in:
Boki 2026-02-05 13:52:07 -05:00
commit 84d38c5173
46 changed files with 6819 additions and 0 deletions

View file

@ -0,0 +1,20 @@
{
"name": "@poe2data/shared",
"version": "1.0.0",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"scripts": {
"build": "tsc",
"dev": "tsc --watch"
},
"devDependencies": {
"typescript": "^5.3.0"
}
}

View file

@ -0,0 +1,85 @@
import type { CategoryConfig } from '../types/api.js';
export const POE2_CATEGORIES: CategoryConfig[] = [
{
title: 'Currency',
type: 'Currency',
url: 'currency',
icon: 'https://web.poecdn.com/gen/image/WzI1LDE0LHsiZiI6IjJESXRlbXMvQ3VycmVuY3kvQ3VycmVuY3lNb2RWYWx1ZXMiLCJzY2FsZSI6MSwicmVhbG0iOiJwb2UyIn1d/2986e220b3/CurrencyModValues.png',
},
{
title: 'Fragments',
type: 'Fragments',
url: 'fragments',
icon: 'https://web.poecdn.com/gen/image/WzI1LDE0LHsiZiI6IjJESXRlbXMvQ3VycmVuY3kvQnJlYWNoL0JyZWFjaHN0b25lIiwic2NhbGUiOjEsInJlYWxtIjoicG9lMiJ9XQ/d60587d724/Breachstone.png',
},
{
title: 'Abyssal Bones',
type: 'Abyss',
url: 'abyssal-bones',
icon: 'https://web.poecdn.com/gen/image/WzI1LDE0LHsiZiI6IjJESXRlbXMvQ3VycmVuY3kvQWJ5c3NhbEV5ZVNvY2tldGFibGVzL1RlY3JvZHNHYXplIiwic2NhbGUiOjEsInJlYWxtIjoicG9lMiJ9XQ/ef2a9355b4/TecrodsGaze.png',
},
{
title: 'Uncut Gems',
type: 'UncutGems',
url: 'uncut-gems',
icon: 'https://web.poecdn.com/gen/image/WzI1LDE0LHsiZiI6IjJESXRlbXMvR2Vtcy9VbmN1dFN1cHBvcnRHZW0iLCJzY2FsZSI6MSwicmVhbG0iOiJwb2UyIn1d/d1ffe1c951/UncutSupportGem.png',
},
{
title: 'Lineage Gems',
type: 'LineageSupportGems',
url: 'lineage-support-gems',
icon: 'https://web.poecdn.com/gen/image/WzI1LDE0LHsiZiI6IjJESXRlbXMvR2Vtcy9OZXcvTmV3U3VwcG9ydC9MaW5lYWdlL1dpbGRzaGFyZHMiLCJzY2FsZSI6MSwicmVhbG0iOiJwb2UyIn1d/6d700adf17/Wildshards.png',
},
{
title: 'Essences',
type: 'Essences',
url: 'essences',
icon: 'https://web.poecdn.com/gen/image/WzI1LDE0LHsiZiI6IjJESXRlbXMvQ3VycmVuY3kvRXNzZW5jZS9HcmVhdGVyQXR0cmlidXRlRXNzZW5jZSIsInNjYWxlIjoxLCJyZWFsbSI6InBvZTIifV0/8a8cb823af/GreaterAttributeEssence.png',
},
{
title: 'Soul Cores',
type: 'SoulCores',
url: 'soul-cores',
icon: 'https://web.poecdn.com/gen/image/WzI1LDE0LHsiZiI6IjJESXRlbXMvQ3VycmVuY3kvU291bENvcmVzL0dyZWF0ZXJTb3VsQ29yZU1hbmEiLCJzY2FsZSI6MSwicmVhbG0iOiJwb2UyIn1d/1437190de2/GreaterSoulCoreMana.png',
},
{
title: 'Idols',
type: 'Idols',
url: 'idols',
icon: 'https://web.poecdn.com/gen/image/WzI1LDE0LHsiZiI6IjJESXRlbXMvQ3VycmVuY3kvVG9ybWVudGVkU3Bpcml0U29ja2V0YWJsZXMvQXptZXJpU29ja2V0YWJsZU1vbmtleVNwZWNpYWwiLCJzY2FsZSI6MSwicmVhbG0iOiJwb2UyIn1d/8ffc9986a0/AzmeriSocketableMonkeySpecial.png',
},
{
title: 'Runes',
type: 'Runes',
url: 'runes',
icon: 'https://web.poecdn.com/gen/image/WzI1LDE0LHsiZiI6IjJESXRlbXMvQ3VycmVuY3kvUnVuZXMvTGlnaHRuaW5nUnVuZSIsInNjYWxlIjoxLCJyZWFsbSI6InBvZTIifV0/98319b3998/LightningRune.png',
},
{
title: 'Omens',
type: 'Ritual',
url: 'omens',
icon: 'https://web.poecdn.com/gen/image/WzI1LDE0LHsiZiI6IjJESXRlbXMvQ3VycmVuY3kvT21lbnMvVm9vZG9vT21lbnMzUmVkIiwic2NhbGUiOjEsInJlYWxtIjoicG9lMiJ9XQ/9cfdcc9e1a/VoodooOmens3Red.png',
},
{
title: 'Expedition',
type: 'Expedition',
url: 'expedition',
icon: 'https://web.poecdn.com/gen/image/WzI1LDE0LHsiZiI6IjJESXRlbXMvQ3VycmVuY3kvRXhwZWRpdGlvbi9CYXJ0ZXJSZWZyZXNoQ3VycmVuY3kiLCJzY2FsZSI6MSwicmVhbG0iOiJwb2UyIn1d/8a4fe1f468/BarterRefreshCurrency.png',
},
{
title: 'Liquid Emotions',
type: 'Delirium',
url: 'liquid-emotions',
icon: 'https://web.poecdn.com/gen/image/WzI1LDE0LHsiZiI6IjJESXRlbXMvQ3VycmVuY3kvRGlzdGlsbGVkRW1vdGlvbnMvRGlzdGlsbGVkUGFyYW5vaWEiLCJzY2FsZSI6MSwicmVhbG0iOiJwb2UyIn1d/279e807e8f/DistilledParanoia.png',
},
{
title: 'Catalysts',
type: 'Breach',
url: 'breach-catalyst',
icon: 'https://web.poecdn.com/gen/image/WzI1LDE0LHsiZiI6IjJESXRlbXMvQ3VycmVuY3kvQnJlYWNoL0JyZWFjaENhdGFseXN0TWFuYSIsInNjYWxlIjoxLCJyZWFsbSI6InBvZTIifV0/61d3a7a832/BreachCatalystMana.png',
},
];
export const CURRENT_LEAGUE = 'Fate of the Vaal';
export const LEAGUE_URL_ENCODED = 'Fate+of+the+Vaal';

View file

@ -0,0 +1,5 @@
// Types
export * from './types/api.js';
// Constants
export * from './constants/categories.js';

View file

@ -0,0 +1,82 @@
// poe.ninja POE2 API Types
/**
* Search endpoint response - items grouped by category
* GET /search?league={league}
*/
export interface PoeNinjaSearchResponse {
items: Record<string, PoeNinjaSearchItem[]>;
}
export interface PoeNinjaSearchItem {
name: string;
icon?: string;
}
/**
* Overview endpoint response - category pricing data
* GET /overview?league={league}&type={type}
*/
export interface PoeNinjaOverviewResponse {
core: {
items: PoeNinjaCoreItem[];
rates: {
exalted: number;
chaos: number;
};
primary: string;
secondary: string;
};
lines: PoeNinjaLine[];
}
export interface PoeNinjaCoreItem {
id: string;
name: string;
image: string;
category: string;
detailsId: string;
}
export interface PoeNinjaLine {
id: string;
primaryValue: number;
volumePrimaryValue?: number;
maxVolumeCurrency?: string;
maxVolumeRate?: number;
sparkline?: {
totalChange: number;
data: number[];
};
}
/**
* Details endpoint response - individual item details
* GET /details?league={league}&type={type}&id={id}
*/
export interface PoeNinjaDetailsResponse {
id: string;
name: string;
type: string;
icon?: string;
tradeId?: string;
chaosValue?: number;
divineValue?: number;
exaltedValue?: number;
sparkline?: number[];
history?: PriceHistoryPoint[];
}
export interface PriceHistoryPoint {
date: string;
value: number;
volume?: number;
}
// Category configuration
export interface CategoryConfig {
title: string;
type: string;
url: string;
icon: string;
}

View file

@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src"
},
"include": ["src/**/*"]
}