@lgriffin/esi.ts 9.1.0 → 9.6.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 (185) hide show
  1. package/CHANGELOG.md +388 -388
  2. package/LICENSE +26 -26
  3. package/README.md +1030 -988
  4. package/dist/EsiClient.d.ts +5 -0
  5. package/dist/EsiClient.d.ts.map +1 -1
  6. package/dist/EsiClientBuilder.d.ts.map +1 -1
  7. package/dist/clients/CosmeticsClient.d.ts +11 -0
  8. package/dist/clients/CosmeticsClient.d.ts.map +1 -0
  9. package/dist/clients/MercenaryClient.d.ts +19 -1
  10. package/dist/clients/MercenaryClient.d.ts.map +1 -1
  11. package/dist/clients/ParagonHubClient.d.ts +13 -0
  12. package/dist/clients/ParagonHubClient.d.ts.map +1 -0
  13. package/dist/clients/SkyhooksClient.d.ts +19 -1
  14. package/dist/clients/SkyhooksClient.d.ts.map +1 -1
  15. package/dist/core/ApiClient.d.ts +3 -0
  16. package/dist/core/ApiClient.d.ts.map +1 -1
  17. package/dist/core/ApiRequestHandler.d.ts.map +1 -1
  18. package/dist/core/ClientRegistry.d.ts +5 -3
  19. package/dist/core/ClientRegistry.d.ts.map +1 -1
  20. package/dist/core/cache/cacheKey.d.ts +3 -0
  21. package/dist/core/cache/cacheKey.d.ts.map +1 -0
  22. package/dist/core/constants.d.ts +2 -2
  23. package/dist/core/endpoints/accessListEndpoints.d.ts +4 -18
  24. package/dist/core/endpoints/accessListEndpoints.d.ts.map +1 -1
  25. package/dist/core/endpoints/assetEndpoints.d.ts +2 -12
  26. package/dist/core/endpoints/assetEndpoints.d.ts.map +1 -1
  27. package/dist/core/endpoints/calendarEndpoints.d.ts +3 -19
  28. package/dist/core/endpoints/calendarEndpoints.d.ts.map +1 -1
  29. package/dist/core/endpoints/characterEndpoints.d.ts +4 -20
  30. package/dist/core/endpoints/characterEndpoints.d.ts.map +1 -1
  31. package/dist/core/endpoints/cloneEndpoints.d.ts +2 -8
  32. package/dist/core/endpoints/cloneEndpoints.d.ts.map +1 -1
  33. package/dist/core/endpoints/contactEndpoints.d.ts +3 -18
  34. package/dist/core/endpoints/contactEndpoints.d.ts.map +1 -1
  35. package/dist/core/endpoints/contractEndpoints.d.ts +9 -75
  36. package/dist/core/endpoints/contractEndpoints.d.ts.map +1 -1
  37. package/dist/core/endpoints/corporationEndpoints.d.ts +7 -36
  38. package/dist/core/endpoints/corporationEndpoints.d.ts.map +1 -1
  39. package/dist/core/endpoints/cosmeticsEndpoints.d.ts +52 -0
  40. package/dist/core/endpoints/cosmeticsEndpoints.d.ts.map +1 -0
  41. package/dist/core/endpoints/factionEndpoints.d.ts +1 -6
  42. package/dist/core/endpoints/factionEndpoints.d.ts.map +1 -1
  43. package/dist/core/endpoints/fleetEndpoints.d.ts +2 -12
  44. package/dist/core/endpoints/fleetEndpoints.d.ts.map +1 -1
  45. package/dist/core/endpoints/incursionEndpoints.d.ts +1 -5
  46. package/dist/core/endpoints/incursionEndpoints.d.ts.map +1 -1
  47. package/dist/core/endpoints/industryEndpoints.d.ts +2 -16
  48. package/dist/core/endpoints/industryEndpoints.d.ts.map +1 -1
  49. package/dist/core/endpoints/mailEndpoints.d.ts +2 -12
  50. package/dist/core/endpoints/mailEndpoints.d.ts.map +1 -1
  51. package/dist/core/endpoints/marketEndpoints.d.ts +2 -8
  52. package/dist/core/endpoints/marketEndpoints.d.ts.map +1 -1
  53. package/dist/core/endpoints/mercenaryEndpoints.d.ts +46 -6
  54. package/dist/core/endpoints/mercenaryEndpoints.d.ts.map +1 -1
  55. package/dist/core/endpoints/paragonHubEndpoints.d.ts +163 -0
  56. package/dist/core/endpoints/paragonHubEndpoints.d.ts.map +1 -0
  57. package/dist/core/endpoints/piEndpoints.d.ts +1 -10
  58. package/dist/core/endpoints/piEndpoints.d.ts.map +1 -1
  59. package/dist/core/endpoints/skyhookEndpoints.d.ts +64 -0
  60. package/dist/core/endpoints/skyhookEndpoints.d.ts.map +1 -1
  61. package/dist/core/endpoints/sovereigntyEndpoints.d.ts +1 -6
  62. package/dist/core/endpoints/sovereigntyEndpoints.d.ts.map +1 -1
  63. package/dist/core/endpoints/universeEndpoints.d.ts +1 -11
  64. package/dist/core/endpoints/universeEndpoints.d.ts.map +1 -1
  65. package/dist/core/requestPipeline/cachePolicy.d.ts +3 -3
  66. package/dist/core/requestPipeline/cachePolicy.d.ts.map +1 -1
  67. package/dist/core/requestPipeline/headers.d.ts.map +1 -1
  68. package/dist/core/requestPipeline/statusHandling.d.ts +2 -2
  69. package/dist/core/requestPipeline/statusHandling.d.ts.map +1 -1
  70. package/dist/errors.js.map +1 -1
  71. package/dist/errors.mjs.map +1 -1
  72. package/dist/index.d.ts +2 -0
  73. package/dist/index.d.ts.map +1 -1
  74. package/dist/index.js +2167 -1676
  75. package/dist/index.js.map +1 -1
  76. package/dist/index.mjs +2165 -1676
  77. package/dist/index.mjs.map +1 -1
  78. package/dist/schemas/access-lists.d.ts +4 -18
  79. package/dist/schemas/access-lists.d.ts.map +1 -1
  80. package/dist/schemas/alliance.d.ts +1 -5
  81. package/dist/schemas/alliance.d.ts.map +1 -1
  82. package/dist/schemas/assets.d.ts +1 -6
  83. package/dist/schemas/assets.d.ts.map +1 -1
  84. package/dist/schemas/calendar.d.ts +3 -19
  85. package/dist/schemas/calendar.d.ts.map +1 -1
  86. package/dist/schemas/character.d.ts +3 -15
  87. package/dist/schemas/character.d.ts.map +1 -1
  88. package/dist/schemas/clones.d.ts +2 -8
  89. package/dist/schemas/clones.d.ts.map +1 -1
  90. package/dist/schemas/common.d.ts +1 -5
  91. package/dist/schemas/common.d.ts.map +1 -1
  92. package/dist/schemas/contacts.d.ts +1 -6
  93. package/dist/schemas/contacts.d.ts.map +1 -1
  94. package/dist/schemas/contracts.d.ts +3 -25
  95. package/dist/schemas/contracts.d.ts.map +1 -1
  96. package/dist/schemas/corporation.d.ts +6 -31
  97. package/dist/schemas/corporation.d.ts.map +1 -1
  98. package/dist/schemas/cosmetics.d.ts +58 -0
  99. package/dist/schemas/cosmetics.d.ts.map +1 -0
  100. package/dist/schemas/esiEnum.d.ts +3 -0
  101. package/dist/schemas/esiEnum.d.ts.map +1 -0
  102. package/dist/schemas/faction-warfare.d.ts +1 -6
  103. package/dist/schemas/faction-warfare.d.ts.map +1 -1
  104. package/dist/schemas/fleet.d.ts +2 -12
  105. package/dist/schemas/fleet.d.ts.map +1 -1
  106. package/dist/schemas/incursions.d.ts +1 -5
  107. package/dist/schemas/incursions.d.ts.map +1 -1
  108. package/dist/schemas/index.d.ts +3 -0
  109. package/dist/schemas/index.d.ts.map +1 -1
  110. package/dist/schemas/index.js +1784 -1486
  111. package/dist/schemas/index.js.map +1 -1
  112. package/dist/schemas/index.mjs +1749 -1486
  113. package/dist/schemas/index.mjs.map +1 -1
  114. package/dist/schemas/industry.d.ts +1 -8
  115. package/dist/schemas/industry.d.ts.map +1 -1
  116. package/dist/schemas/mail.d.ts +1 -6
  117. package/dist/schemas/mail.d.ts.map +1 -1
  118. package/dist/schemas/market.d.ts +2 -8
  119. package/dist/schemas/market.d.ts.map +1 -1
  120. package/dist/schemas/mercenary.d.ts +55 -6
  121. package/dist/schemas/mercenary.d.ts.map +1 -1
  122. package/dist/schemas/paragon-hub.d.ts +96 -0
  123. package/dist/schemas/paragon-hub.d.ts.map +1 -0
  124. package/dist/schemas/pi.d.ts +1 -10
  125. package/dist/schemas/pi.d.ts.map +1 -1
  126. package/dist/schemas/skyhooks.d.ts +101 -0
  127. package/dist/schemas/skyhooks.d.ts.map +1 -1
  128. package/dist/schemas/sovereignty.d.ts +1 -6
  129. package/dist/schemas/sovereignty.d.ts.map +1 -1
  130. package/dist/schemas/universe.d.ts +1 -11
  131. package/dist/schemas/universe.d.ts.map +1 -1
  132. package/dist/sde/IStaticDataProvider.d.ts +106 -0
  133. package/dist/sde/IStaticDataProvider.d.ts.map +1 -0
  134. package/dist/sde/MemorySdeProvider.d.ts +167 -0
  135. package/dist/sde/MemorySdeProvider.d.ts.map +1 -0
  136. package/dist/sde/SdeDataProvider.d.ts +119 -0
  137. package/dist/sde/SdeDataProvider.d.ts.map +1 -0
  138. package/dist/sde/SdeTestDataFactory.d.ts +33 -0
  139. package/dist/sde/SdeTestDataFactory.d.ts.map +1 -0
  140. package/dist/sde/errors.d.ts +23 -0
  141. package/dist/sde/errors.d.ts.map +1 -0
  142. package/dist/sde/index.d.ts +9 -0
  143. package/dist/sde/index.d.ts.map +1 -0
  144. package/dist/sde/index.js +2591 -0
  145. package/dist/sde/index.js.map +1 -0
  146. package/dist/sde/index.mjs +2544 -0
  147. package/dist/sde/index.mjs.map +1 -0
  148. package/dist/sde/ingestion/SdeDatabaseBuilder.d.ts +18 -0
  149. package/dist/sde/ingestion/SdeDatabaseBuilder.d.ts.map +1 -0
  150. package/dist/sde/ingestion/SdeDownloader.d.ts +14 -0
  151. package/dist/sde/ingestion/SdeDownloader.d.ts.map +1 -0
  152. package/dist/sde/ingestion/SdeExtractor.d.ts +18 -0
  153. package/dist/sde/ingestion/SdeExtractor.d.ts.map +1 -0
  154. package/dist/sde/ingestion/constants.d.ts +13 -0
  155. package/dist/sde/ingestion/constants.d.ts.map +1 -0
  156. package/dist/sde/ingestion/index.d.ts +10 -0
  157. package/dist/sde/ingestion/index.d.ts.map +1 -0
  158. package/dist/sde/ingestion/transforms.d.ts +13 -0
  159. package/dist/sde/ingestion/transforms.d.ts.map +1 -0
  160. package/dist/sde/memory.d.ts +8 -0
  161. package/dist/sde/memory.d.ts.map +1 -0
  162. package/dist/sde/memory.js +1100 -0
  163. package/dist/sde/memory.js.map +1 -0
  164. package/dist/sde/memory.mjs +1064 -0
  165. package/dist/sde/memory.mjs.map +1 -0
  166. package/dist/sde/schemas.d.ts +1121 -0
  167. package/dist/sde/schemas.d.ts.map +1 -0
  168. package/dist/sde/types.d.ts +1039 -0
  169. package/dist/sde/types.d.ts.map +1 -0
  170. package/dist/sde/version.d.ts +7 -0
  171. package/dist/sde/version.d.ts.map +1 -0
  172. package/dist/testing/TestDataFactory.d.ts +1 -1
  173. package/dist/testing/index.js.map +1 -1
  174. package/dist/testing/index.mjs.map +1 -1
  175. package/dist/types/api-responses.d.ts +2 -0
  176. package/dist/types/api-responses.d.ts.map +1 -1
  177. package/dist/types/cosmetics.d.ts +8 -0
  178. package/dist/types/cosmetics.d.ts.map +1 -0
  179. package/dist/types/mercenary.d.ts +3 -1
  180. package/dist/types/mercenary.d.ts.map +1 -1
  181. package/dist/types/paragon-hub.d.ts +8 -0
  182. package/dist/types/paragon-hub.d.ts.map +1 -0
  183. package/dist/types/skyhooks.d.ts +3 -1
  184. package/dist/types/skyhooks.d.ts.map +1 -1
  185. package/package.json +289 -257
package/CHANGELOG.md CHANGED
@@ -1,388 +1,388 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [9.1.0] - 2026-08-14
9
-
10
- ### Added
11
-
12
- - **Schema rejection tests** — 104 new tests verifying Zod schemas correctly reject invalid input shapes
13
- - **Domain property fuzz tests** — property-based fuzz testing across domain clients using fast-check
14
- - **Schema validation benchmarks** — performance benchmarks for Zod schema validation paths
15
- - **Domain response type tests** — compile-time type tests for domain client response types via tsd
16
-
17
- ### Changed
18
-
19
- - **Expanded documentation** — updated examples, architecture guide, and testing guide with broader coverage
20
- - **README refreshed** — updated feature descriptions and endpoint counts
21
-
22
- ### Fixed
23
-
24
- - **Fuzz test date handling** — switched to integer-based date arbitrary to avoid invalid `Date` values in property-based tests
25
-
26
- ## [9.0.0] - 2026-08-12
27
-
28
- ### Breaking Changes
29
-
30
- - **Default retry count changed from 0 to 3** — transient failures (502, 503, 504, timeout, rate limit) now retry automatically with exponential backoff and jitter. Set `maxRetries: 0` in `retryConfig` to restore the previous behavior
31
- - **Generated Zod schemas removed** — the `src/schemas/generated/` directory has been removed; only hand-written schemas in `src/schemas/` remain
32
-
33
- ### Added
34
-
35
- - **Sub-path exports** — targeted imports for reduced bundle size:
36
- - `@lgriffin/esi.ts/schemas` — Zod schemas for runtime validation
37
- - `@lgriffin/esi.ts/errors` — error classes and type guards
38
- - `@lgriffin/esi.ts/testing` — `TestDataFactory` for test mock data
39
- - **`isCircuitOpen()` type guard** — checks whether an error is a `CircuitOpenError`, complementing the existing `isTimeout()`, `isRetryable()`, and `isValidationError()` guards
40
- - **`generate:all` script** — runs all generators (types, endpoints, OKF) in one command
41
- - **`generate:endpoints` script** — regenerates endpoint definitions from the ESI OpenAPI spec
42
-
43
- ### Changed
44
-
45
- - **Cursor pagination routed through full pipeline** — cursor-based pagination now goes through the same middleware pipeline (rate limiter, circuit breaker, retry, caching) as offset pagination
46
- - **Pagination retry unified with `IRetryStrategy`** — pagination requests now use the injectable retry strategy instead of a separate retry path
47
-
48
- ### Fixed
49
-
50
- - **Response interceptor status fix** — response interceptors previously received a hardcoded 200 status; they now receive the actual HTTP status code from the response
51
- - **CI consolidated** — `pr-validation.yml` merged into `ci.yml`; all PR validation now runs through the main CI pipeline
52
-
53
- ## [7.4.0] - 2026-07-17
54
-
55
- ### Added
56
-
57
- - **`withSafeMode()` on all domain clients** — mirrors existing `withMetadata()`, surfaces the `EsiResult<T>` discriminated union (`{ ok: true, data, meta } | { ok: false, error }`) without needing to call `createClient()` directly
58
- - **`responseSchema` on `routeEndpoints`** — was the only endpoint file without runtime response validation; now validated with `z.looseObject({ route: z.array(z.number()) })`
59
-
60
- ### Changed
61
-
62
- - **ESLint 8 → 10 flat config migration** — replaced `.eslintrc.cjs` with `eslint.config.mjs`, switched to unified `typescript-eslint` package, dropped `eslint-plugin-prettier` (redundant with lint-staged)
63
- - **jest-fetch-mock 3 → 4** — updated null-body status mocks (204/304) to use `new Response(null, ...)` per Fetch spec
64
- - Updated 11 minor/patch dependencies: @commitlint/cli, @microsoft/api-extractor, @redocly/cli, @types/node, @typescript-eslint/*, eslint-plugin-sonarjs, fast-check, knip, prettier, typedoc
65
-
66
- ### Fixed
67
-
68
- - CI: aligned `codeql.yml` branch targets to `[master, main, develop]`
69
- - CI: pinned `jest-coverage-comment@main` → `@v1.0.34` (supply-chain risk)
70
- - CI: added schema drift and generated types freshness checks to release pipeline
71
-
72
- ### Deprecated
73
-
74
- - `AllianceClient.getContacts()` — use `ContactsClient.getAllianceContacts()` instead
75
- - `AllianceClient.getContactLabels()` — use `ContactsClient.getAllianceContactLabels()` instead
76
-
77
- ## [7.3.0] - 2026-07-14
78
-
79
- ### Added
80
-
81
- - **`EsiResult<T>` discriminated union** and `safeMode` option for error-safe API calls
82
- - **Branded ID types** (16 types) for type-safe ESI entity references
83
- - **Expanded type-level tests** with tsd for error guards, endpoints, and domain types
84
- - **Compile-time spec-to-Zod type alignment checks**
85
- - **Schema drift detection** as a blocking CI check
86
- - **Comprehensive testing gap closure** (+1233 tests)
87
-
88
- ### Fixed
89
-
90
- - Resolved three CI jobs failing with continue-on-error
91
- - Normalized CRLF in API surface check
92
- - Fixed schemathesis report permissions and `--url` flag
93
- - Fixed API surface ordering issues
94
- - Added missing `system_id` to `MarketOrderSchema` test data
95
-
96
- ## [7.2.0] - 2026-07-08
97
-
98
- ### Added
99
-
100
- - **Contract testing infrastructure** — deep validation of all endpoint definitions against the live ESI OpenAPI spec (`npm run contract:live`). Checks path parameter alignment, required query params, request body consistency, auth requirements, response schema coverage, HTTP methods, pagination metadata, and deprecation sync. 8 contract validation categories with known-exception tracking.
101
- - **Property-based fuzz testing** with [fast-check](https://github.com/dubzzz/fast-check) — 601 tests fuzzing `validatePathParam()`, `validateQueryParam()`, `buildEndpointPath()`, and all Zod schemas with random/adversarial inputs (`npm run fuzz`)
102
- - **OpenAPI spec snapshot & diff** — `npm run contract:snapshot` saves a baseline; `npm run contract:diff` detects breaking changes via [oasdiff](https://github.com/Tufin/oasdiff) (Docker)
103
- - **Consumer type tests** with [tsd](https://github.com/tsdjs/tsd) — verifies public API type correctness (`npm run test:types`)
104
- - **Prism mock server** — `npm run mock:esi` starts a spec-conformant ESI mock on port 4010 via [@stoplight/prism-cli](https://stoplight.io/open-source/prism)
105
- - **Schemathesis fuzz runner** — `npm run fuzz:api` runs Schemathesis against the Prism mock (Docker, weekly CI)
106
- - Contract and fuzz test CI jobs added to `ci.yml` quality gate
107
- - Weekly spec drift detection job added to `maintenance.yml`
108
- - `jest.contract.config.cjs` and `jest.fuzz.config.cjs` test configurations
109
-
110
- ### Dependencies
111
-
112
- - Added `fast-check` (dev) — property-based testing framework
113
- - Added `@stoplight/prism-cli` (dev) — OpenAPI mock server
114
- - Added `tsd` (dev) — TypeScript type testing
115
-
116
- ## [7.1.0] - 2026-07-08
117
-
118
- ### Added
119
-
120
- - **Redocly CLI integration** — lints the live ESI OpenAPI spec for structural validity and best-practice compliance (`npm run validate:spec`). Catches spec breakage from CCP before it breaks generated types, cache TTLs, or scopes. Baseline: 0 errors, 328 warnings (all known CCP spec issues).
121
- - `redocly.yaml` config with tuned rulesets for ESI — structural rules as errors, CCP spec quirks as warnings
122
- - `validate:spec` npm script added to `check:all` pipeline
123
-
124
- ## [7.0.0] - 2026-07-08
125
-
126
- ### Breaking Changes
127
-
128
- - **Swagger 2.0 → OpenAPI 3.1 migration** — all generated types, cache TTLs, scopes, and rate limit groups are now sourced from the ESI OpenAPI 3.1 spec (`/meta/openapi.json`) instead of the deprecated Swagger 2.0 spec (`/latest/swagger.json`). See [esi-issues#1490](https://github.com/esi/esi-issues/issues/1490).
129
- - **Generated interface names changed** — `EsiSpec` namespace types now use OpenAPI schema names (e.g., `AllianceDetail` instead of `GetAlliancesAllianceIdOk`). These are generated types; hand-written consumer types are unchanged.
130
- - **Cache TTL metadata key** — internally changed from `x-cached-seconds` to `x-cache-age`. No consumer-facing impact (cache behavior is identical).
131
-
132
- ### Changed
133
-
134
- - Single OpenAPI spec fetch instead of dual Swagger + OpenAPI fetches
135
- - Updated all scripts, tests, and documentation to reference OpenAPI spec
136
- - Generated types now include 161 interfaces (up from 147), 126 cache TTLs, 70 scopes
137
-
138
- ## [6.1.0] - 2026-07-07
139
-
140
- ### Added
141
-
142
- - **Fleet wing/squad name validation** — `renameFleetWing()` and `renameFleetSquad()` now reject names exceeding ESI's 10-character limit before sending the request, with a clear error message
143
- - **43 runnable example scripts** covering all 210 ESI endpoints against live Tranquility (10 new example files: character-details, corporation-details, calendar-search, loyalty-pi, faction-details, industry-mining, market-orders, universe-encyclopedia, corp-contracts-wallet, dogma-meta-sov)
144
- - **3 write-operation example scripts** — `write-operations.ts` (contacts, fittings, mail, UI lifecycle), `universe-post-helpers.ts` (name resolution, affiliation), `freelance-jobs.ts` (cursor-paginated queries)
145
- - Live output captured for all example scripts in `examples/output/`
146
- - 3 new TDD test files and 1 new BDD feature file (81 TDD files, 40 BDD features total)
147
- - 2 new fleet validation unit tests
148
-
149
- ### Fixed
150
-
151
- - **Fleet test babel parse errors** — replaced TypeScript cast syntax `(result as any[]).forEach(...)` with direct index access in fleet tests (pre-existing bug unmasked by stricter transpilation)
152
- - **Fleet rename test names** — test mock names shortened to respect ESI's 10-character limit (`'New Squad Name'` → `'New Squad'`)
153
-
154
- ### Changed
155
-
156
- - README rewritten with "Why ESI.ts vs. OpenAPI-generated clients" comparison, full endpoint coverage table, and updated architecture/testing references
157
- - `guides/ARCHITECTURE.md`, `guides/TESTING.md`, and `TESTING.md` updated to current test counts (121 suites, 3,224 tests)
158
- - Autopilot example waypoint changed from Jita to Rens
159
-
160
- ### Schemas
161
-
162
- - Multiple Zod schema fixes discovered during live endpoint validation: added missing enum values, corrected optional fields, and adjusted types to match actual ESI responses
163
-
164
- ## [6.0.0] - 2026-07-03
165
-
166
- ### Added
167
-
168
- - **Runtime response validation** via [Zod](https://zod.dev/) schemas — every ESI endpoint response is validated at runtime, catching shape mismatches before they propagate to consumer code
169
- - Zod schemas for all 31 domain modules (133 interfaces) in `src/schemas/`, exported under the `schemas` namespace
170
- - `EsiValidationError` class (extends `EsiError`) thrown when response data doesn't match the expected schema
171
- - `isValidationError()` type guard for catching validation errors
172
- - `validateResponse` option on `EsiClientConfig` — on by default, can be disabled globally
173
- - `responseSchema` field on `EndpointDefinition` — wires schemas into the request pipeline via `createClient()`
174
- - New developer guide: `guides/RUNTIME-VALIDATION.md`
175
- - Response Validation Pipeline diagram in `guides/ARCHITECTURE.md`
176
- - Comprehensive TDD tests for schema parsing, validation integration, and common schemas (94 new tests)
177
- - BDD feature and step definitions for 9 runtime validation scenarios
178
-
179
- ### Changed
180
-
181
- - All TypeScript types in `src/types/` are now derived from Zod schemas via `z.infer<>` — schemas are the single source of truth
182
- - Schemas use `.passthrough()` mode so extra fields from ESI are preserved, not rejected
183
- - Test mock data across 25 test files updated to be spec-accurate (required by runtime validation)
184
- - Path-parameter IDs (e.g., `character_id`, `alliance_id`) are now optional in schemas, matching ESI which omits them from response bodies
185
-
186
- ### Dependencies
187
-
188
- - Added `zod` as a production dependency
189
-
190
- ## [5.3.0] - 2026-06-30
191
-
192
- ### Added
193
-
194
- - **Accept-Language configuration** — `language` option on `EsiClientConfig` injects the `Accept-Language` header for localized ESI responses (en, de, fr, ja, ru, zh, ko, es); changeable at runtime via `ApiClient.setLanguage()`
195
- - **ESI scope metadata** — generated `esi-scopes.generated.ts` with `EsiScope` union type (63 scopes) and `esiEndpointScopes` record mapping 119 authenticated endpoints to their required OAuth scopes
196
- - Exported `EsiScope` type and `esiEndpointScopes` map from package root
197
- - **Streaming pagination** — `stream*` methods on domain clients yield `PageResult<T>` one page at a time via `AsyncGenerator`, enabling backpressure and early termination for large paginated datasets
198
- - Streaming methods added to `MarketClient` (6), `ContractsClient` (3), `WalletClient` (3), `AssetsClient` (2), `KillmailsClient` (2)
199
- - `buildEndpointPath()` utility extracted from `createClient.ts` and exported from package root
200
- - `streamEndpoint()` protected method on `BaseEsiClient` for building custom streaming domain clients
201
- - Streaming pagination example (`npm run example:streaming`)
202
-
203
- ## [5.2.0] - 2026-06-29
204
-
205
- ### Added
206
-
207
- - **Spec-driven type generation** from ESI swagger spec (`npm run generate:types`) — 147 TypeScript interfaces + cache TTL map for 119 endpoints
208
- - **Spec-aware cache bypass** — GET requests within ESI-specified `x-cached-seconds` TTL return cached data with zero HTTP calls, layered on top of ETag caching
209
- - **`batch()` and `batchPost()` methods** on `EsiClient` — bounded concurrency for multi-ID fetches, auto-chunking for POST endpoints
210
- - **`EsiSpec` namespace export** with generated response types alongside hand-written types
211
- - **Type drift detection** in `npm run validate:esi` — compares hand-written types against generated spec types
212
- - CI step to verify generated types are up to date
213
- - **Retry with exponential backoff** — configurable retry for transient 5xx, timeout, and rate limit errors with jitter; respects circuit breaker state; GET-only by default with `retryMutations` opt-in
214
- - **`TimeoutError`** subclass of `EsiError` — typed timeout errors with `timeoutMs` property; per-request timeout override via `handleRequest()`
215
- - **Enhanced response metadata** via `withMetadata()` — rate limit info (`RateLimitMeta`), response timing (`responseTimeMs`), and cache hit type (`cacheHitType`: `'spec-ttl'` | `'etag-304'` | `'stale-on-error'`)
216
- - `RetryConfig` interface and `retryConfig` option on `EsiClientConfig`
217
- - `CircuitOpenError` passthrough in request handler (previously wrapped as generic Error)
218
- - **Per-group rate limiting** — 36 ESI rate limit groups extracted from the OpenAPI meta spec at build time; each group gets its own token bucket instead of a single global counter, preventing a burst of market requests from starving unrelated endpoints
219
- - **Optional per-user bucketing** — `userKeyExtractor` config option creates separate bucket sets per user key, supporting multi-character EVE applications
220
- - **Group-aware rate limit status** — `getGroupStatus(group)` and `getAllGroupStatuses()` methods for fine-grained rate limit monitoring; `isBlocked(group?)` accepts an optional group name
221
- - Generated `esi-rate-limit-groups.generated.ts` with 146 endpoint-to-group mappings
222
- - Exported `RateLimitGroupStatus` and `RateLimitGroupSpec` types
223
-
224
- ## [5.1.0] - 2026-06-26
225
-
226
- ### Added
227
-
228
- - **`noUncheckedIndexedAccess`** compiler flag — array/record indexing now returns `T | undefined`, catching unguarded index access at compile time
229
- - **`noImplicitReturns`** compiler flag — all function code paths must explicitly return a value
230
- - **`noImplicitOverride`** compiler flag — `override` keyword required when overriding base class methods
231
- - **`tsconfig.test.json`** — separate TypeScript config for tests, relaxing `noUncheckedIndexedAccess` for test utility patterns
232
-
233
- ### Changed
234
-
235
- - `RateLimiter` token cost lookup inlined (removed unnecessary `Record` indirection)
236
- - Jest configs (`jest.unit.config.cjs`, `jest.integration.config.cjs`) now use `tsconfig.test.json`
237
-
238
- ### Fixed
239
-
240
- - Unguarded indexed access in `ApiRequestHandler`, `CircuitBreaker`, `RateLimiter`, and `headersUtil`
241
-
242
- ## [5.0.0] - 2026-06-26
243
-
244
- ### Breaking Changes
245
-
246
- - **Removed `SovereigntyClient.getSovereigntyMap()`** — sunset ESI endpoint; use `getSovereigntySystems()` instead
247
- - **Removed `SovereigntyClient.getSovereigntyStructures()`** — sunset ESI endpoint; use `getSovereigntySystems()` instead
248
-
249
- ### Added
250
-
251
- - **Dependabot** — automated weekly dependency update PRs with grouped ESLint and testing ecosystems
252
- - **CodeQL Analysis** — GitHub-native security scanning workflow
253
- - **Commitlint** — conventional commit message validation via husky hook
254
- - **Version consistency script** — `npm run validate:versions` checks `package.json` matches `constants.ts`
255
- - **`npm run check:all`** — comprehensive validation including ESI endpoint and version checks
256
- - Coverage and npm download badges in README
257
- - `.editorconfig`, `.nvmrc`, `CONTRIBUTING.md`, `SECURITY.md`
258
- - ClientRegistry test coverage for all 35 client types
259
-
260
- ### Fixed
261
-
262
- - **POST body format** for asset and contact endpoints — request body was incorrectly structured
263
- - **POST body format** for `/universe/ids` and `/universe/names` — same issue
264
- - **Circuit breaker** now treats HTTP 420/429 rate-limit responses as failures
265
- - **configManager** uses `require.resolve` instead of `process.cwd()` fallback for reliable path resolution
266
- - **User-Agent version** — ESI requests were sending `esi.ts/3.4.0` instead of current version
267
- - **Compatibility date** — updated from `2025-12-16` to `2026-05-19` (Equinox)
268
- - TypeScript badge in README updated from 5.0+ to 6.0+
269
-
270
- ### Removed
271
-
272
- - `src/TODO` — fully completed roadmap
273
- - `jest.improved.config.cjs` — dead config matching zero test files
274
- - `docs/` — generated TypeDoc output removed from git tracking (CI builds as artifact)
275
- - Unused `getHeaders` test helper
276
-
277
- ### Changed
278
-
279
- - `package.json`: added `keywords`, `homepage`, `bugs` URLs, `files` includes README/LICENSE/CHANGELOG
280
- - Moved `docs/architecture.md` to `guides/ARCHITECTURE.md`
281
- - Updated `guides/TESTING.md` and `guides/DOCUMENTATION.md` to current state
282
- - Test coverage raised from 75% to 91%+
283
-
284
- ### Dependencies
285
-
286
- - `@typescript-eslint/eslint-plugin`: 7.18.0 → 8.x
287
- - `@typescript-eslint/parser`: 7.18.0 → 8.x
288
- - `@types/node`: 18.x → 26.x
289
- - `@commitlint/cli`: 19.x → 21.x
290
- - `eslint-config-prettier`: 9.x → 10.x
291
- - `lint-staged`: 16.x → 17.x
292
- - `jest-junit`: 16.x → 17.x
293
- - GitHub Actions: checkout v4→v7, setup-node v4→v6, upload-artifact v4→v7, codeql-action v3→v4, gh-pages v3→v4, action-gh-release v1→v3
294
-
295
- ## [4.1.1] - 2026-06-08
296
-
297
- ### Changed
298
-
299
- - **TypeScript 5.9 → 6.0** — upgraded to TypeScript 6.0.3, the last version before the Go-based TS7 compiler
300
- - `tsconfig.json`: added explicit `moduleResolution: "bundler"` (TS6 changed the default from `node` to `bundler`)
301
- - `tsconfig.json`: added explicit `rootDir: "./src"` (TS6 requires this when emitting)
302
- - `tsconfig.json`: removed `esModuleInterop: true` (always-on in TS6)
303
-
304
- ## [4.1.0] - 2026-06-08
305
-
306
- ### Added
307
-
308
- - **Equinox ESI compliance** — new endpoints and types for the [Equinox expansion](https://developers.eveonline.com/blog/equinox-on-esi-structures-sovereignty-and-access-lists) (compatibility date 2026-05-19)
309
- - **`SovereigntyClient.getSovereigntySystems()`** — combined sovereignty systems route with separate ADM indices (`military_index`, `industry_index`, `strategic_index`), occupancy data, and anchored structures in a single response
310
- - **`SkyhooksClient`** — new domain client with `getSovereigntyHubs()`, `getOrbitalSkyhooks()`, and `getRaidableSkyhooks()` endpoints for Upwell sovereignty structures
311
- - **`MercenaryClient`** — new domain client with `getMercenaryDens()` and `getMercenaryTacticalOperations()` endpoints for mercenary content
312
- - **`AccessListsClient`** — new domain client with `getAccessList(id)` for reading access list (ACL) contents including character, corporation, and alliance entries
313
- - `TestDataFactory` methods for all new Equinox types: `createSovereigntySystem()`, `createSovereigntyHub()`, `createOrbitalSkyhook()`, `createRaidableSkyhook()`, `createMercenaryDen()`, `createMercenaryTacticalOperation()`, `createAccessListEntry()`
314
- - TDD and BDD test coverage for all new endpoints
315
-
316
- ### Changed
317
-
318
- - `SovereigntyClient.getSovereigntyMap()` and `getSovereigntyStructures()` marked as deprecated — use `getSovereigntySystems()` instead
319
- - Domain client count increased from 32 to 35
320
-
321
- ### Dependencies
322
-
323
- - `ts-jest`: 29.4.9 → 29.4.11
324
- - `eslint-plugin-prettier`: 5.5.5 → 5.5.6
325
-
326
- ## [4.0.0] - 2026-05-15
327
-
328
- ### Breaking Changes
329
-
330
- - **Removed `RateLimiter.getInstance()` singleton** - Create instances with `new RateLimiter()` instead
331
- - **Removed global cache/circuit breaker functions** - `initializeETagCache()`, `getETagCache()`, `resetETagCache()`, `initializeCircuitBreaker()`, `getCircuitBreaker()`, `resetCircuitBreaker()` are no longer exported from `ApiRequestHandler`
332
- - Each `EsiClient` and `ApiClientBuilder` now creates its own `RateLimiter`, `ETagCacheManager`, and `CircuitBreaker` instances
333
-
334
- ### Added
335
-
336
- - **`BaseEsiClient` base class** — eliminates ~650 lines of repeated constructor/field/`withMetadata()` boilerplate across all 33 domain clients
337
- - **`RequestDeduplicator`** — coalesces concurrent identical GET requests into a single in-flight fetch, sharing the result across all callers (enabled by default; disable with `enableRequestDeduplication: false`)
338
- - **`EsiDiagnostics` API** — `client.diagnostics` accessor for cache/circuit-breaker stats, moved out of the main `EsiClient` API surface
339
- - **`fetchPages()` async generator** — memory-efficient page-by-page iteration over paginated ESI responses
340
- - **Request timeouts** — `config.timeout` now wired to `AbortController` (default 30s); previously the field existed but was never connected to `fetch()` calls
341
- - **`EsiError` retry helpers** — `isTimeout()`, `retryable` getter, and `isRetryable()` guard for smarter consumer retry logic
342
- - **`RateLimiterConfig`** — `minDelayMs` and `decelerationThreshold` exposed via `EsiClientConfig` for consumer-tunable rate limiting
343
- - TypeScript declaration files (`.d.ts`) now emitted with builds
344
- - `exports` field in `package.json` for modern Node.js module resolution
345
- - `engines` field specifying Node.js >= 18.0.0
346
- - `publishConfig` with public access for scoped package
347
- - `RateLimiter`, `ETagCacheManager`, and `CircuitBreaker` classes exported from main index
348
- - `ApiClientBuilder.setRateLimiter()`, `.setCache()`, `.setCircuitBreaker()` builder methods
349
- - `validateBaseUrl()` for SSRF protection — validates ESI host allowlist and HTTPS
350
- - `unsafeAllowCustomHost` config option to bypass base URL validation
351
- - URL sanitization in `EsiError` — sensitive query params (`token`, `access_token`, `api_key`) are redacted
352
- - Path parameters encoded with `encodeURIComponent()` for defense-in-depth
353
- - URL assertions in all client unit tests — every test now verifies the correct endpoint URL
354
- - Endpoint definition contract tests — 1800+ tests validating path templates, params, methods
355
- - Test coverage for `RequestDeduplicator`, `EsiDiagnostics`, `AsyncPaginationIterator`, and extended `EsiError` tests
356
- - `CHANGELOG.md` following Keep a Changelog format
357
- - Changelog validation step in release workflow
358
-
359
- ### Fixed
360
-
361
- - `.d.ts` files not generated during build (`declaration: true` added to `tsconfig.json`)
362
- - Release pipeline CNAME placeholder removed from GitHub Pages deployment
363
- - `ContractsClient.ts` test file renamed to `.test.ts` so Jest actually runs it
364
-
365
- ### Changed
366
-
367
- - `RateLimiter` constructor is now public
368
- - Cache, rate limiter, and circuit breaker are instance-based per client (no global shared state)
369
- - `ApiClientBuilder.build()` auto-creates a `RateLimiter` if none was explicitly set
370
- - `api-responses.ts` (1366 lines) split into 29 domain-specific type files with barrel re-export for backward compatibility
371
- - `RateLimiter` uses `logWarn` instead of `console.warn` for consistent observability
372
- - Reduced allocations and deduplicated fetch/sleep logic across core modules
373
-
374
- ## [3.4.0] - 2026-04-29
375
-
376
- ### Added
377
-
378
- - ESI response header best practices documentation
379
- - Dogma test coverage (10 TDD + 9 BDD tests)
380
- - Gated authenticated integration tests (32 tests across 14 endpoint groups)
381
- - EVE SSO token creator for local integration testing
382
- - Search endpoint `categories` query parameter
383
-
384
- ### Fixed
385
-
386
- - 3 industry endpoint paths (`corporation` -> `corporations`) for mining routes
387
- - Pagination middleware bypass: pages 2+ now route through request pipeline
388
- - Consolidated duplicate alliance contact endpoints
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [9.1.0] - 2026-08-14
9
+
10
+ ### Added
11
+
12
+ - **Schema rejection tests** — 104 new tests verifying Zod schemas correctly reject invalid input shapes
13
+ - **Domain property fuzz tests** — property-based fuzz testing across domain clients using fast-check
14
+ - **Schema validation benchmarks** — performance benchmarks for Zod schema validation paths
15
+ - **Domain response type tests** — compile-time type tests for domain client response types via tsd
16
+
17
+ ### Changed
18
+
19
+ - **Expanded documentation** — updated examples, architecture guide, and testing guide with broader coverage
20
+ - **README refreshed** — updated feature descriptions and endpoint counts
21
+
22
+ ### Fixed
23
+
24
+ - **Fuzz test date handling** — switched to integer-based date arbitrary to avoid invalid `Date` values in property-based tests
25
+
26
+ ## [9.0.0] - 2026-08-12
27
+
28
+ ### Breaking Changes
29
+
30
+ - **Default retry count changed from 0 to 3** — transient failures (502, 503, 504, timeout, rate limit) now retry automatically with exponential backoff and jitter. Set `maxRetries: 0` in `retryConfig` to restore the previous behavior
31
+ - **Generated Zod schemas removed** — the `src/schemas/generated/` directory has been removed; only hand-written schemas in `src/schemas/` remain
32
+
33
+ ### Added
34
+
35
+ - **Sub-path exports** — targeted imports for reduced bundle size:
36
+ - `@lgriffin/esi.ts/schemas` — Zod schemas for runtime validation
37
+ - `@lgriffin/esi.ts/errors` — error classes and type guards
38
+ - `@lgriffin/esi.ts/testing` — `TestDataFactory` for test mock data
39
+ - **`isCircuitOpen()` type guard** — checks whether an error is a `CircuitOpenError`, complementing the existing `isTimeout()`, `isRetryable()`, and `isValidationError()` guards
40
+ - **`generate:all` script** — runs all generators (types, endpoints, OKF) in one command
41
+ - **`generate:endpoints` script** — regenerates endpoint definitions from the ESI OpenAPI spec
42
+
43
+ ### Changed
44
+
45
+ - **Cursor pagination routed through full pipeline** — cursor-based pagination now goes through the same middleware pipeline (rate limiter, circuit breaker, retry, caching) as offset pagination
46
+ - **Pagination retry unified with `IRetryStrategy`** — pagination requests now use the injectable retry strategy instead of a separate retry path
47
+
48
+ ### Fixed
49
+
50
+ - **Response interceptor status fix** — response interceptors previously received a hardcoded 200 status; they now receive the actual HTTP status code from the response
51
+ - **CI consolidated** — `pr-validation.yml` merged into `ci.yml`; all PR validation now runs through the main CI pipeline
52
+
53
+ ## [7.4.0] - 2026-07-17
54
+
55
+ ### Added
56
+
57
+ - **`withSafeMode()` on all domain clients** — mirrors existing `withMetadata()`, surfaces the `EsiResult<T>` discriminated union (`{ ok: true, data, meta } | { ok: false, error }`) without needing to call `createClient()` directly
58
+ - **`responseSchema` on `routeEndpoints`** — was the only endpoint file without runtime response validation; now validated with `z.looseObject({ route: z.array(z.number()) })`
59
+
60
+ ### Changed
61
+
62
+ - **ESLint 8 → 10 flat config migration** — replaced `.eslintrc.cjs` with `eslint.config.mjs`, switched to unified `typescript-eslint` package, dropped `eslint-plugin-prettier` (redundant with lint-staged)
63
+ - **jest-fetch-mock 3 → 4** — updated null-body status mocks (204/304) to use `new Response(null, ...)` per Fetch spec
64
+ - Updated 11 minor/patch dependencies: @commitlint/cli, @microsoft/api-extractor, @redocly/cli, @types/node, @typescript-eslint/*, eslint-plugin-sonarjs, fast-check, knip, prettier, typedoc
65
+
66
+ ### Fixed
67
+
68
+ - CI: aligned `codeql.yml` branch targets to `[master, main, develop]`
69
+ - CI: pinned `jest-coverage-comment@main` → `@v1.0.34` (supply-chain risk)
70
+ - CI: added schema drift and generated types freshness checks to release pipeline
71
+
72
+ ### Deprecated
73
+
74
+ - `AllianceClient.getContacts()` — use `ContactsClient.getAllianceContacts()` instead
75
+ - `AllianceClient.getContactLabels()` — use `ContactsClient.getAllianceContactLabels()` instead
76
+
77
+ ## [7.3.0] - 2026-07-14
78
+
79
+ ### Added
80
+
81
+ - **`EsiResult<T>` discriminated union** and `safeMode` option for error-safe API calls
82
+ - **Branded ID types** (16 types) for type-safe ESI entity references
83
+ - **Expanded type-level tests** with tsd for error guards, endpoints, and domain types
84
+ - **Compile-time spec-to-Zod type alignment checks**
85
+ - **Schema drift detection** as a blocking CI check
86
+ - **Comprehensive testing gap closure** (+1233 tests)
87
+
88
+ ### Fixed
89
+
90
+ - Resolved three CI jobs failing with continue-on-error
91
+ - Normalized CRLF in API surface check
92
+ - Fixed schemathesis report permissions and `--url` flag
93
+ - Fixed API surface ordering issues
94
+ - Added missing `system_id` to `MarketOrderSchema` test data
95
+
96
+ ## [7.2.0] - 2026-07-08
97
+
98
+ ### Added
99
+
100
+ - **Contract testing infrastructure** — deep validation of all endpoint definitions against the live ESI OpenAPI spec (`npm run contract:live`). Checks path parameter alignment, required query params, request body consistency, auth requirements, response schema coverage, HTTP methods, pagination metadata, and deprecation sync. 8 contract validation categories with known-exception tracking.
101
+ - **Property-based fuzz testing** with [fast-check](https://github.com/dubzzz/fast-check) — 601 tests fuzzing `validatePathParam()`, `validateQueryParam()`, `buildEndpointPath()`, and all Zod schemas with random/adversarial inputs (`npm run fuzz`)
102
+ - **OpenAPI spec snapshot & diff** — `npm run contract:snapshot` saves a baseline; `npm run contract:diff` detects breaking changes via [oasdiff](https://github.com/Tufin/oasdiff) (Docker)
103
+ - **Consumer type tests** with [tsd](https://github.com/tsdjs/tsd) — verifies public API type correctness (`npm run test:types`)
104
+ - **Prism mock server** — `npm run mock:esi` starts a spec-conformant ESI mock on port 4010 via [@stoplight/prism-cli](https://stoplight.io/open-source/prism)
105
+ - **Schemathesis fuzz runner** — `npm run fuzz:api` runs Schemathesis against the Prism mock (Docker, weekly CI)
106
+ - Contract and fuzz test CI jobs added to `ci.yml` quality gate
107
+ - Weekly spec drift detection job added to `maintenance.yml`
108
+ - `jest.contract.config.cjs` and `jest.fuzz.config.cjs` test configurations
109
+
110
+ ### Dependencies
111
+
112
+ - Added `fast-check` (dev) — property-based testing framework
113
+ - Added `@stoplight/prism-cli` (dev) — OpenAPI mock server
114
+ - Added `tsd` (dev) — TypeScript type testing
115
+
116
+ ## [7.1.0] - 2026-07-08
117
+
118
+ ### Added
119
+
120
+ - **Redocly CLI integration** — lints the live ESI OpenAPI spec for structural validity and best-practice compliance (`npm run validate:spec`). Catches spec breakage from CCP before it breaks generated types, cache TTLs, or scopes. Baseline: 0 errors, 328 warnings (all known CCP spec issues).
121
+ - `redocly.yaml` config with tuned rulesets for ESI — structural rules as errors, CCP spec quirks as warnings
122
+ - `validate:spec` npm script added to `check:all` pipeline
123
+
124
+ ## [7.0.0] - 2026-07-08
125
+
126
+ ### Breaking Changes
127
+
128
+ - **Swagger 2.0 → OpenAPI 3.1 migration** — all generated types, cache TTLs, scopes, and rate limit groups are now sourced from the ESI OpenAPI 3.1 spec (`/meta/openapi.json`) instead of the deprecated Swagger 2.0 spec (`/latest/swagger.json`). See [esi-issues#1490](https://github.com/esi/esi-issues/issues/1490).
129
+ - **Generated interface names changed** — `EsiSpec` namespace types now use OpenAPI schema names (e.g., `AllianceDetail` instead of `GetAlliancesAllianceIdOk`). These are generated types; hand-written consumer types are unchanged.
130
+ - **Cache TTL metadata key** — internally changed from `x-cached-seconds` to `x-cache-age`. No consumer-facing impact (cache behavior is identical).
131
+
132
+ ### Changed
133
+
134
+ - Single OpenAPI spec fetch instead of dual Swagger + OpenAPI fetches
135
+ - Updated all scripts, tests, and documentation to reference OpenAPI spec
136
+ - Generated types now include 161 interfaces (up from 147), 126 cache TTLs, 70 scopes
137
+
138
+ ## [6.1.0] - 2026-07-07
139
+
140
+ ### Added
141
+
142
+ - **Fleet wing/squad name validation** — `renameFleetWing()` and `renameFleetSquad()` now reject names exceeding ESI's 10-character limit before sending the request, with a clear error message
143
+ - **43 runnable example scripts** covering all 210 ESI endpoints against live Tranquility (10 new example files: character-details, corporation-details, calendar-search, loyalty-pi, faction-details, industry-mining, market-orders, universe-encyclopedia, corp-contracts-wallet, dogma-meta-sov)
144
+ - **3 write-operation example scripts** — `write-operations.ts` (contacts, fittings, mail, UI lifecycle), `universe-post-helpers.ts` (name resolution, affiliation), `freelance-jobs.ts` (cursor-paginated queries)
145
+ - Live output captured for all example scripts in `examples/output/`
146
+ - 3 new TDD test files and 1 new BDD feature file (81 TDD files, 40 BDD features total)
147
+ - 2 new fleet validation unit tests
148
+
149
+ ### Fixed
150
+
151
+ - **Fleet test babel parse errors** — replaced TypeScript cast syntax `(result as any[]).forEach(...)` with direct index access in fleet tests (pre-existing bug unmasked by stricter transpilation)
152
+ - **Fleet rename test names** — test mock names shortened to respect ESI's 10-character limit (`'New Squad Name'` → `'New Squad'`)
153
+
154
+ ### Changed
155
+
156
+ - README rewritten with "Why ESI.ts vs. OpenAPI-generated clients" comparison, full endpoint coverage table, and updated architecture/testing references
157
+ - `guides/ARCHITECTURE.md`, `guides/TESTING.md`, and `TESTING.md` updated to current test counts (121 suites, 3,224 tests)
158
+ - Autopilot example waypoint changed from Jita to Rens
159
+
160
+ ### Schemas
161
+
162
+ - Multiple Zod schema fixes discovered during live endpoint validation: added missing enum values, corrected optional fields, and adjusted types to match actual ESI responses
163
+
164
+ ## [6.0.0] - 2026-07-03
165
+
166
+ ### Added
167
+
168
+ - **Runtime response validation** via [Zod](https://zod.dev/) schemas — every ESI endpoint response is validated at runtime, catching shape mismatches before they propagate to consumer code
169
+ - Zod schemas for all 31 domain modules (133 interfaces) in `src/schemas/`, exported under the `schemas` namespace
170
+ - `EsiValidationError` class (extends `EsiError`) thrown when response data doesn't match the expected schema
171
+ - `isValidationError()` type guard for catching validation errors
172
+ - `validateResponse` option on `EsiClientConfig` — on by default, can be disabled globally
173
+ - `responseSchema` field on `EndpointDefinition` — wires schemas into the request pipeline via `createClient()`
174
+ - New developer guide: `guides/RUNTIME-VALIDATION.md`
175
+ - Response Validation Pipeline diagram in `guides/ARCHITECTURE.md`
176
+ - Comprehensive TDD tests for schema parsing, validation integration, and common schemas (94 new tests)
177
+ - BDD feature and step definitions for 9 runtime validation scenarios
178
+
179
+ ### Changed
180
+
181
+ - All TypeScript types in `src/types/` are now derived from Zod schemas via `z.infer<>` — schemas are the single source of truth
182
+ - Schemas use `.passthrough()` mode so extra fields from ESI are preserved, not rejected
183
+ - Test mock data across 25 test files updated to be spec-accurate (required by runtime validation)
184
+ - Path-parameter IDs (e.g., `character_id`, `alliance_id`) are now optional in schemas, matching ESI which omits them from response bodies
185
+
186
+ ### Dependencies
187
+
188
+ - Added `zod` as a production dependency
189
+
190
+ ## [5.3.0] - 2026-06-30
191
+
192
+ ### Added
193
+
194
+ - **Accept-Language configuration** — `language` option on `EsiClientConfig` injects the `Accept-Language` header for localized ESI responses (en, de, fr, ja, ru, zh, ko, es); changeable at runtime via `ApiClient.setLanguage()`
195
+ - **ESI scope metadata** — generated `esi-scopes.generated.ts` with `EsiScope` union type (63 scopes) and `esiEndpointScopes` record mapping 119 authenticated endpoints to their required OAuth scopes
196
+ - Exported `EsiScope` type and `esiEndpointScopes` map from package root
197
+ - **Streaming pagination** — `stream*` methods on domain clients yield `PageResult<T>` one page at a time via `AsyncGenerator`, enabling backpressure and early termination for large paginated datasets
198
+ - Streaming methods added to `MarketClient` (6), `ContractsClient` (3), `WalletClient` (3), `AssetsClient` (2), `KillmailsClient` (2)
199
+ - `buildEndpointPath()` utility extracted from `createClient.ts` and exported from package root
200
+ - `streamEndpoint()` protected method on `BaseEsiClient` for building custom streaming domain clients
201
+ - Streaming pagination example (`npm run example:streaming`)
202
+
203
+ ## [5.2.0] - 2026-06-29
204
+
205
+ ### Added
206
+
207
+ - **Spec-driven type generation** from ESI swagger spec (`npm run generate:types`) — 147 TypeScript interfaces + cache TTL map for 119 endpoints
208
+ - **Spec-aware cache bypass** — GET requests within ESI-specified `x-cached-seconds` TTL return cached data with zero HTTP calls, layered on top of ETag caching
209
+ - **`batch()` and `batchPost()` methods** on `EsiClient` — bounded concurrency for multi-ID fetches, auto-chunking for POST endpoints
210
+ - **`EsiSpec` namespace export** with generated response types alongside hand-written types
211
+ - **Type drift detection** in `npm run validate:esi` — compares hand-written types against generated spec types
212
+ - CI step to verify generated types are up to date
213
+ - **Retry with exponential backoff** — configurable retry for transient 5xx, timeout, and rate limit errors with jitter; respects circuit breaker state; GET-only by default with `retryMutations` opt-in
214
+ - **`TimeoutError`** subclass of `EsiError` — typed timeout errors with `timeoutMs` property; per-request timeout override via `handleRequest()`
215
+ - **Enhanced response metadata** via `withMetadata()` — rate limit info (`RateLimitMeta`), response timing (`responseTimeMs`), and cache hit type (`cacheHitType`: `'spec-ttl'` | `'etag-304'` | `'stale-on-error'`)
216
+ - `RetryConfig` interface and `retryConfig` option on `EsiClientConfig`
217
+ - `CircuitOpenError` passthrough in request handler (previously wrapped as generic Error)
218
+ - **Per-group rate limiting** — 36 ESI rate limit groups extracted from the OpenAPI meta spec at build time; each group gets its own token bucket instead of a single global counter, preventing a burst of market requests from starving unrelated endpoints
219
+ - **Optional per-user bucketing** — `userKeyExtractor` config option creates separate bucket sets per user key, supporting multi-character EVE applications
220
+ - **Group-aware rate limit status** — `getGroupStatus(group)` and `getAllGroupStatuses()` methods for fine-grained rate limit monitoring; `isBlocked(group?)` accepts an optional group name
221
+ - Generated `esi-rate-limit-groups.generated.ts` with 146 endpoint-to-group mappings
222
+ - Exported `RateLimitGroupStatus` and `RateLimitGroupSpec` types
223
+
224
+ ## [5.1.0] - 2026-06-26
225
+
226
+ ### Added
227
+
228
+ - **`noUncheckedIndexedAccess`** compiler flag — array/record indexing now returns `T | undefined`, catching unguarded index access at compile time
229
+ - **`noImplicitReturns`** compiler flag — all function code paths must explicitly return a value
230
+ - **`noImplicitOverride`** compiler flag — `override` keyword required when overriding base class methods
231
+ - **`tsconfig.test.json`** — separate TypeScript config for tests, relaxing `noUncheckedIndexedAccess` for test utility patterns
232
+
233
+ ### Changed
234
+
235
+ - `RateLimiter` token cost lookup inlined (removed unnecessary `Record` indirection)
236
+ - Jest configs (`jest.unit.config.cjs`, `jest.integration.config.cjs`) now use `tsconfig.test.json`
237
+
238
+ ### Fixed
239
+
240
+ - Unguarded indexed access in `ApiRequestHandler`, `CircuitBreaker`, `RateLimiter`, and `headersUtil`
241
+
242
+ ## [5.0.0] - 2026-06-26
243
+
244
+ ### Breaking Changes
245
+
246
+ - **Removed `SovereigntyClient.getSovereigntyMap()`** — sunset ESI endpoint; use `getSovereigntySystems()` instead
247
+ - **Removed `SovereigntyClient.getSovereigntyStructures()`** — sunset ESI endpoint; use `getSovereigntySystems()` instead
248
+
249
+ ### Added
250
+
251
+ - **Dependabot** — automated weekly dependency update PRs with grouped ESLint and testing ecosystems
252
+ - **CodeQL Analysis** — GitHub-native security scanning workflow
253
+ - **Commitlint** — conventional commit message validation via husky hook
254
+ - **Version consistency script** — `npm run validate:versions` checks `package.json` matches `constants.ts`
255
+ - **`npm run check:all`** — comprehensive validation including ESI endpoint and version checks
256
+ - Coverage and npm download badges in README
257
+ - `.editorconfig`, `.nvmrc`, `CONTRIBUTING.md`, `SECURITY.md`
258
+ - ClientRegistry test coverage for all 35 client types
259
+
260
+ ### Fixed
261
+
262
+ - **POST body format** for asset and contact endpoints — request body was incorrectly structured
263
+ - **POST body format** for `/universe/ids` and `/universe/names` — same issue
264
+ - **Circuit breaker** now treats HTTP 420/429 rate-limit responses as failures
265
+ - **configManager** uses `require.resolve` instead of `process.cwd()` fallback for reliable path resolution
266
+ - **User-Agent version** — ESI requests were sending `esi.ts/3.4.0` instead of current version
267
+ - **Compatibility date** — updated from `2025-12-16` to `2026-05-19` (Equinox)
268
+ - TypeScript badge in README updated from 5.0+ to 6.0+
269
+
270
+ ### Removed
271
+
272
+ - `src/TODO` — fully completed roadmap
273
+ - `jest.improved.config.cjs` — dead config matching zero test files
274
+ - `docs/` — generated TypeDoc output removed from git tracking (CI builds as artifact)
275
+ - Unused `getHeaders` test helper
276
+
277
+ ### Changed
278
+
279
+ - `package.json`: added `keywords`, `homepage`, `bugs` URLs, `files` includes README/LICENSE/CHANGELOG
280
+ - Moved `docs/architecture.md` to `guides/ARCHITECTURE.md`
281
+ - Updated `guides/TESTING.md` and `guides/DOCUMENTATION.md` to current state
282
+ - Test coverage raised from 75% to 91%+
283
+
284
+ ### Dependencies
285
+
286
+ - `@typescript-eslint/eslint-plugin`: 7.18.0 → 8.x
287
+ - `@typescript-eslint/parser`: 7.18.0 → 8.x
288
+ - `@types/node`: 18.x → 26.x
289
+ - `@commitlint/cli`: 19.x → 21.x
290
+ - `eslint-config-prettier`: 9.x → 10.x
291
+ - `lint-staged`: 16.x → 17.x
292
+ - `jest-junit`: 16.x → 17.x
293
+ - GitHub Actions: checkout v4→v7, setup-node v4→v6, upload-artifact v4→v7, codeql-action v3→v4, gh-pages v3→v4, action-gh-release v1→v3
294
+
295
+ ## [4.1.1] - 2026-06-08
296
+
297
+ ### Changed
298
+
299
+ - **TypeScript 5.9 → 6.0** — upgraded to TypeScript 6.0.3, the last version before the Go-based TS7 compiler
300
+ - `tsconfig.json`: added explicit `moduleResolution: "bundler"` (TS6 changed the default from `node` to `bundler`)
301
+ - `tsconfig.json`: added explicit `rootDir: "./src"` (TS6 requires this when emitting)
302
+ - `tsconfig.json`: removed `esModuleInterop: true` (always-on in TS6)
303
+
304
+ ## [4.1.0] - 2026-06-08
305
+
306
+ ### Added
307
+
308
+ - **Equinox ESI compliance** — new endpoints and types for the [Equinox expansion](https://developers.eveonline.com/blog/equinox-on-esi-structures-sovereignty-and-access-lists) (compatibility date 2026-05-19)
309
+ - **`SovereigntyClient.getSovereigntySystems()`** — combined sovereignty systems route with separate ADM indices (`military_index`, `industry_index`, `strategic_index`), occupancy data, and anchored structures in a single response
310
+ - **`SkyhooksClient`** — new domain client with `getSovereigntyHubs()`, `getOrbitalSkyhooks()`, and `getRaidableSkyhooks()` endpoints for Upwell sovereignty structures
311
+ - **`MercenaryClient`** — new domain client with `getMercenaryDens()` and `getMercenaryTacticalOperations()` endpoints for mercenary content
312
+ - **`AccessListsClient`** — new domain client with `getAccessList(id)` for reading access list (ACL) contents including character, corporation, and alliance entries
313
+ - `TestDataFactory` methods for all new Equinox types: `createSovereigntySystem()`, `createSovereigntyHub()`, `createOrbitalSkyhook()`, `createRaidableSkyhook()`, `createMercenaryDen()`, `createMercenaryTacticalOperation()`, `createAccessListEntry()`
314
+ - TDD and BDD test coverage for all new endpoints
315
+
316
+ ### Changed
317
+
318
+ - `SovereigntyClient.getSovereigntyMap()` and `getSovereigntyStructures()` marked as deprecated — use `getSovereigntySystems()` instead
319
+ - Domain client count increased from 32 to 35
320
+
321
+ ### Dependencies
322
+
323
+ - `ts-jest`: 29.4.9 → 29.4.11
324
+ - `eslint-plugin-prettier`: 5.5.5 → 5.5.6
325
+
326
+ ## [4.0.0] - 2026-05-15
327
+
328
+ ### Breaking Changes
329
+
330
+ - **Removed `RateLimiter.getInstance()` singleton** - Create instances with `new RateLimiter()` instead
331
+ - **Removed global cache/circuit breaker functions** - `initializeETagCache()`, `getETagCache()`, `resetETagCache()`, `initializeCircuitBreaker()`, `getCircuitBreaker()`, `resetCircuitBreaker()` are no longer exported from `ApiRequestHandler`
332
+ - Each `EsiClient` and `ApiClientBuilder` now creates its own `RateLimiter`, `ETagCacheManager`, and `CircuitBreaker` instances
333
+
334
+ ### Added
335
+
336
+ - **`BaseEsiClient` base class** — eliminates ~650 lines of repeated constructor/field/`withMetadata()` boilerplate across all 33 domain clients
337
+ - **`RequestDeduplicator`** — coalesces concurrent identical GET requests into a single in-flight fetch, sharing the result across all callers (enabled by default; disable with `enableRequestDeduplication: false`)
338
+ - **`EsiDiagnostics` API** — `client.diagnostics` accessor for cache/circuit-breaker stats, moved out of the main `EsiClient` API surface
339
+ - **`fetchPages()` async generator** — memory-efficient page-by-page iteration over paginated ESI responses
340
+ - **Request timeouts** — `config.timeout` now wired to `AbortController` (default 30s); previously the field existed but was never connected to `fetch()` calls
341
+ - **`EsiError` retry helpers** — `isTimeout()`, `retryable` getter, and `isRetryable()` guard for smarter consumer retry logic
342
+ - **`RateLimiterConfig`** — `minDelayMs` and `decelerationThreshold` exposed via `EsiClientConfig` for consumer-tunable rate limiting
343
+ - TypeScript declaration files (`.d.ts`) now emitted with builds
344
+ - `exports` field in `package.json` for modern Node.js module resolution
345
+ - `engines` field specifying Node.js >= 18.0.0
346
+ - `publishConfig` with public access for scoped package
347
+ - `RateLimiter`, `ETagCacheManager`, and `CircuitBreaker` classes exported from main index
348
+ - `ApiClientBuilder.setRateLimiter()`, `.setCache()`, `.setCircuitBreaker()` builder methods
349
+ - `validateBaseUrl()` for SSRF protection — validates ESI host allowlist and HTTPS
350
+ - `unsafeAllowCustomHost` config option to bypass base URL validation
351
+ - URL sanitization in `EsiError` — sensitive query params (`token`, `access_token`, `api_key`) are redacted
352
+ - Path parameters encoded with `encodeURIComponent()` for defense-in-depth
353
+ - URL assertions in all client unit tests — every test now verifies the correct endpoint URL
354
+ - Endpoint definition contract tests — 1800+ tests validating path templates, params, methods
355
+ - Test coverage for `RequestDeduplicator`, `EsiDiagnostics`, `AsyncPaginationIterator`, and extended `EsiError` tests
356
+ - `CHANGELOG.md` following Keep a Changelog format
357
+ - Changelog validation step in release workflow
358
+
359
+ ### Fixed
360
+
361
+ - `.d.ts` files not generated during build (`declaration: true` added to `tsconfig.json`)
362
+ - Release pipeline CNAME placeholder removed from GitHub Pages deployment
363
+ - `ContractsClient.ts` test file renamed to `.test.ts` so Jest actually runs it
364
+
365
+ ### Changed
366
+
367
+ - `RateLimiter` constructor is now public
368
+ - Cache, rate limiter, and circuit breaker are instance-based per client (no global shared state)
369
+ - `ApiClientBuilder.build()` auto-creates a `RateLimiter` if none was explicitly set
370
+ - `api-responses.ts` (1366 lines) split into 29 domain-specific type files with barrel re-export for backward compatibility
371
+ - `RateLimiter` uses `logWarn` instead of `console.warn` for consistent observability
372
+ - Reduced allocations and deduplicated fetch/sleep logic across core modules
373
+
374
+ ## [3.4.0] - 2026-04-29
375
+
376
+ ### Added
377
+
378
+ - ESI response header best practices documentation
379
+ - Dogma test coverage (10 TDD + 9 BDD tests)
380
+ - Gated authenticated integration tests (32 tests across 14 endpoint groups)
381
+ - EVE SSO token creator for local integration testing
382
+ - Search endpoint `categories` query parameter
383
+
384
+ ### Fixed
385
+
386
+ - 3 industry endpoint paths (`corporation` -> `corporations`) for mining routes
387
+ - Pagination middleware bypass: pages 2+ now route through request pipeline
388
+ - Consolidated duplicate alliance contact endpoints