Skip to content

Commit d3a80fe

Browse files
committed
Update API documentation for release readiness
1 parent a61c4fd commit d3a80fe

3 files changed

Lines changed: 49 additions & 6 deletions

File tree

README.md

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,55 @@ additional chronicles can be added without endpoint changes.
2525
engine rule.
2626
- **NPCs** — both a **cleaned** layer (one record per unique name,
2727
drops + spawns aggregated across merged ids) and a **raw**, source-faithful
28-
layer for callers who need engine-level fidelity.
29-
- **Monsters** — filtered view over the NPC dataset.
28+
layer for callers who need engine-level fidelity. Detail responses
29+
carry an optional `primaryRegion` derived from the NPC's spawns.
30+
- **Monsters** — filtered view over the NPC dataset; same cleaned/raw
31+
split, same `primaryRegion` enrichment.
3032
- **Drops** — enriched with item names, deduped on `(npcId, itemId, min,
3133
max, chance)`, and reverse-indexed: every item carries `dropped-by` and
3234
`spoiled-by` lookups.
33-
- **Spawns** — coordinates per NPC, deduped across merged ids.
35+
- **Spawns** — coordinates per NPC, deduped across merged ids. Cleaned
36+
spawn endpoints attach a resolved `region: RegionRefDto | null` per
37+
row (raw endpoints stay unenriched).
3438
- **Recipes** — exposed inline on item-detail responses (`crafting` for
3539
recipe scrolls, `craftedBy` for products).
40+
- **Skills** — full catalog with resolved descriptions, parsed `<for>`
41+
effects (literal + `<table>` references), and icon files; consumed
42+
inline by item / NPC / class detail.
3643
- **Armor sets** — full catalog endpoint plus embedded set context on
3744
every piece (`partOfSets[]`).
45+
- **Classes** — all 89 Interlude player classes (base + 1st/2nd/3rd
46+
profession), with full skill-learn tables, spellbook references, and
47+
parent/child cross-links. Spellbook items reverse-link to the skills
48+
they teach and the classes that learn them.
49+
- **Commerce** — merchant `buyLists` (Adena-for-item) and a curated set
50+
of multisell exchanges (Mammon, B-grade unseal, Luxury Shop, Apella).
51+
Surfaced both per-NPC at `/npcs/[id]/shop` and per-item via `soldBy`,
52+
`exchangeFrom`, and `exchangeFor` cross-links.
53+
- **Quests** — full catalog (329 on Interlude) plus per-quest detail
54+
with rewards, involved NPCs/monsters, quest items, and race/class
55+
gates extracted from aCis Java scripts. When the L2 client's
56+
`questname-e.dat` is present, also surfaces the `description` flavor
57+
prose and `clientJournalEntries` (the player's in-game quest log
58+
entries — short title + prose + completion NPC per step). Honestly
59+
framed as the client journal, not an editorial walkthrough.
60+
Cross-linked from item / NPC detail (`rewardOfQuests`, `questItemFor`,
61+
`startsQuests`, `involvedInQuests`).
62+
- **Regions** — full catalog of 19 named map regions (Talking Island
63+
Village, Town of Aden, …) sourced from upstream `mapRegions.xml`.
64+
These are engine "death-teleport" regions, not biome polygons —
65+
`primaryRegion` reads as "the in-game town this NPC is associated
66+
with" rather than "this NPC's biome label".
3867
- **Meta endpoints** — known npc types / item types / item grades, with
3968
counts, for filter dropdowns.
4069

4170
## Where things live
4271

4372
| | |
4473
|---|---|
45-
| `data/datapack/<chronicle>/` | placeholder for upstream XML (untracked) |
74+
| `data/datapack/<chronicle>/` | placeholder for upstream **L2 client DAT files** consumed at build time (e.g. `*grp.dat` for icons, `questname-e.dat` for quest journal entries) — untracked |
4675
| `data/manual-fixes/<chronicle>.json` | one file per chronicle, sectioned by entity |
47-
| `data/generated/<chronicle>/` | build output — `items`, `npcs`, `drops`, `spawns`, `recipes`, `skills`, `armor-sets` JSON |
76+
| `data/generated/<chronicle>/` | build output — `items`, `npcs`, `drops`, `spawns`, `recipes`, `skills`, `armor-sets`, `classes`, `spellbooks`, `multisells`, `buylists`, `quests`, `questname`, `regions` JSON |
4877
| `scripts/` | `parse-*.ts` per entity, plus `build-data.ts` orchestrator |
4978
| `src/lib/data/` | cached JSON loaders + in-memory indexes |
5079
| `src/lib/api/` | shared route helpers + DTO layer |
@@ -85,6 +114,10 @@ curl 'http://localhost:3000/api/interlude/monsters?npcType=GrandBoss&sort=-level
85114
curl http://localhost:3000/api/interlude/npcs/22001/drops
86115
curl http://localhost:3000/api/interlude/armor-sets
87116
curl http://localhost:3000/api/interlude/meta/item-grades
117+
curl http://localhost:3000/api/interlude/quests/1
118+
curl http://localhost:3000/api/interlude/regions
119+
curl http://localhost:3000/api/interlude/classes
120+
curl http://localhost:3000/api/interlude/npcs/30001/shop
88121
```
89122

90123
## Adding a new chronicle

docs/api-contract.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,13 @@ representative quests so any heuristic regression surfaces visibly.
346346

347347
### `QuestClientJournalEntryDto` — stable fields
348348

349+
These are **client quest log entries** sourced verbatim from the L2 client's
350+
`questname-e.dat` — the same text the in-game quest journal renders. They are
351+
**not** an editorial walkthrough and **not** a mechanically-derived action
352+
checklist. Consumers should render them as the player's journal (which is what
353+
they are), not as imperative steps. The numbered ordering reflects the DAT's
354+
`stepIndex` field, not a guaranteed canonical walk path.
355+
349356
| Field | Type | Notes |
350357
|---|---|---|
351358
| `stepIndex` | number | 1-based step index, matching the DAT record header. Entries are ordered ascending by this field. |

docs/api.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Requesting an unknown chronicle returns **404**.
5252
| GET | `/api/[chronicle]/npcs` | List cleaned NPCs (one record per unique name) |
5353
| GET | `/api/[chronicle]/npcs/[id]` | Single cleaned NPC; accepts canonical or any merged raw id |
5454
| GET | `/api/[chronicle]/npcs/[id]/drops` | Aggregated drops for the cleaned NPC |
55-
| GET | `/api/[chronicle]/npcs/[id]/spawns` | Aggregated spawn points for the cleaned NPC |
55+
| GET | `/api/[chronicle]/npcs/[id]/spawns` | Aggregated spawn points for the cleaned NPC. Each row is an `EnrichedSpawnDto` and includes a resolved `region: RegionRefDto \| null` (M4); the raw equivalent at `/api/[chronicle]/raw/monsters/[id]/spawns` does **not** carry the region field. |
5656
| GET | `/api/[chronicle]/npcs/[id]/shop` | Merchant's direct-buy products + curated multisell exchanges |
5757
| GET | `/api/[chronicle]/monsters` | List monsters (cleaned NPC subset) |
5858
| GET | `/api/[chronicle]/monsters/[id]` | Single monster by cleaned id |
@@ -562,6 +562,9 @@ GET /api/interlude/raw/npcs?levelMin=20&levelMax=25
562562
# Full armor-set catalog (rich, all 51 sets in one response)
563563
GET /api/interlude/armor-sets
564564
565+
# Full region catalog (19 named map regions on Interlude)
566+
GET /api/interlude/regions
567+
565568
# Full quest catalog (329 on Interlude)
566569
GET /api/interlude/quests
567570

0 commit comments

Comments
 (0)