Rehearsal notes
(Intermission. The stage manager is calling cues. Watch the lamps.)
- 1starrail-sdkv2.4.1GO
Fixed: • `LRUCache.has()` no longer promotes entries in LRU order (previously prevented eviction on subsequent `set()`). Added: • Tests for `LRUCache` operations and `getLevelMultiplier` interpolation. Changed: • Extracted request retry, backoff, and caching logic from `EnkaClient` and `StarRailResClient` into `HttpClientBase`.
- 2starrail-sdkv2.4.0GO
Fixed: • `resolveFullStats` no longer double-counts base HP/ATK/DEF/SPD/CritRate/CritDmg when the character was parsed via Enka's `_statsMap` path. • `applyProps()` no longer silently drops `BaseSpeed`, `HealRatioBase`, `HealTakenRatio`, and `ElationDamageAddedRatioBase` property types. Added: • `statsSource` field on `PlayerCharacter` (`'statsMap' | 'flatProps'`), indicates which Enka API path produced the character's stats. • `healBoost`, `healTakenBoost`, `elationDmgBoost` fields on `ComputedStats`. • `BaseSpeed`, `HealRatioBase`, `HealTakenRatio`, `ElationDamageAddedRatioBase` entries in `ENKA_PROPERTY_MAP`. • Tests for `statsSource` marker, double-count regression, `skillTreeList` parsing, and property map coverage. Changed: • `resolveFullStats` JSDoc now documents that it is mandatory for correct crit values on the `flatProps` path, and notes the eidolon data-source limitation.
- 3starrail-sdkv2.3.0GO
Added: • `resolveFullStats` now computes character base HP/ATK/DEF/SPD from `character_promotions.json`. • `StarRailResClient.getCharacterPromotions()`. • `headIcon` on `PlayerProfile`. • `characterPromotions` on `StatsResolverData` and `StarRailResCharacterPromotion` types. Changed: • Base CRIT (5% CR / 50% CD) moved from `EnkaClient` to `resolveFullStats` via promotion data.
- 4starrail-sdkv2.2.0GO
Added: • `resolveCharacter`, `resolveLightCone`, `resolveRelic` for mapping Enka IDs to StarRailRes game data. • `resolveFullStats` for aggregating trace, LC rank, and relic set stat bonuses. • `StarRailResClient.getSkillTrees()` and `StarRailResClient.getLightConeRanks()`. • `skillTreePoints` on `PlayerCharacter`, `subAffixes` on `PlayerRelic`. • Codename maps for element, path, and relic slot (`hsr_code_names.ts`). Fixed: • `EnkaClient` now computes character stats from equipment and relic `_flat.props` when `_statsMap` is omitted by Enka.
- 5starrail-sdkv2.1.0GO
Added: • `calculateTotalRollValueDetailed` for a per-substat roll value breakdown. Fixed: • `calculateRealHitRate` is now clamped to a maximum of 100%. • `StarRailResClient` now throws `HSRRateLimitError` on 429, consistent with `EnkaClient`. • `EnkaClient` now throws a clear error when a profile has no detail data (private/uncached). • Wrong JSDoc substat key example in `relic.ts`. Changed: • `calculateResMultiplier`/`calculateCritMultiplier` now use internal `clamp()` utility (no output change).
- 6starrail-sdkv2.0.3GO
Fixed: • Break Damage toughness multiplier was using the wrong divisor (120 instead of 40). • Level Multiplier table had incorrect values at levels 20/50/60. • Relic DEF% max roll was wrong (0.0432 instead of 0.054).
- 7starrail-sdkv2.0.2GO
Fixed: • Fixed CommonJS bundle emitting `.js` instead of `.cjs`, which caused `MODULE_NOT_FOUND` when using `require()`. • Fixed `canReachUltimate` parameter documentation in README (4th arg represents flat energy bonus). • Aligned CONTRIBUTING coverage target with Vitest config thresholds.
- 8starrail-sdkv2.0.1GO
Fixed: • `calculateResMultiplier` now clamps result to a minimum of 0, consistent with `calculateDefMultiplier`. Added: • JSDoc comments for all calculator functions and API client classes. • Request deduplication tests for `EnkaClient` and `StarRailResClient`. • `StarRailResClient` error handling example in README. • New example: `examples/discord_bot_damage.ts`.
- 9starrail-sdkv2.0.0GO
Added: • Initial release of `starrail-sdk`. • Calculations for Damage, Break/Super Break, Turn Timeline, Status EHR, Energy, and Relic Roll Values. • API integration for Enka.Network and StarRailRes. • Multi-provider fallback support for `StarRailResClient` with default CDN mirrors (`raw.githubusercontent.com` and `cdn.jsdelivr.net`). • Custom `resProviders` and `enkaProviders` option fields in `StarRailSDKOptions`. • Runnable `examples/` directory and full TypeScript definitions. Fixed: • Cache key scoping for `StarRailResClient` when multiple language instances are used.