@lgriffin/esi.ts 5.2.0 → 6.0.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 +99 -4
- package/dist/EsiClient.d.ts +2 -0
- package/dist/EsiClient.d.ts.map +1 -1
- package/dist/EsiClient.js +6 -0
- package/dist/clients/AssetsClient.d.ts +3 -0
- package/dist/clients/AssetsClient.d.ts.map +1 -1
- package/dist/clients/AssetsClient.js +6 -0
- package/dist/clients/BaseEsiClient.d.ts +3 -1
- package/dist/clients/BaseEsiClient.d.ts.map +1 -1
- package/dist/clients/BaseEsiClient.js +7 -0
- package/dist/clients/ContractsClient.d.ts +4 -0
- package/dist/clients/ContractsClient.d.ts.map +1 -1
- package/dist/clients/ContractsClient.js +9 -0
- package/dist/clients/KillmailsClient.d.ts +3 -0
- package/dist/clients/KillmailsClient.d.ts.map +1 -1
- package/dist/clients/KillmailsClient.js +6 -0
- package/dist/clients/MarketClient.d.ts +7 -0
- package/dist/clients/MarketClient.d.ts.map +1 -1
- package/dist/clients/MarketClient.js +18 -0
- package/dist/clients/WalletClient.d.ts +4 -0
- package/dist/clients/WalletClient.d.ts.map +1 -1
- package/dist/clients/WalletClient.js +9 -0
- package/dist/core/ApiClient.d.ts +6 -0
- package/dist/core/ApiClient.d.ts.map +1 -1
- package/dist/core/ApiClient.js +14 -0
- package/dist/core/ApiRequestHandler.d.ts +1 -0
- package/dist/core/ApiRequestHandler.d.ts.map +1 -1
- package/dist/core/ApiRequestHandler.js +10 -1
- package/dist/core/constants.d.ts +2 -2
- package/dist/core/constants.js +1 -1
- package/dist/core/endpoints/EndpointDefinition.d.ts +3 -0
- package/dist/core/endpoints/EndpointDefinition.d.ts.map +1 -1
- package/dist/core/endpoints/accessListEndpoints.d.ts +16 -0
- package/dist/core/endpoints/accessListEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/accessListEndpoints.js +2 -0
- package/dist/core/endpoints/allianceEndpoints.d.ts +14 -0
- package/dist/core/endpoints/allianceEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/allianceEndpoints.js +3 -0
- package/dist/core/endpoints/assetEndpoints.d.ts +27 -0
- package/dist/core/endpoints/assetEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/assetEndpoints.js +5 -0
- package/dist/core/endpoints/buildEndpointPath.d.ts +7 -0
- package/dist/core/endpoints/buildEndpointPath.d.ts.map +1 -0
- package/dist/core/endpoints/buildEndpointPath.js +44 -0
- package/dist/core/endpoints/calendarEndpoints.d.ts +40 -0
- package/dist/core/endpoints/calendarEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/calendarEndpoints.js +5 -0
- package/dist/core/endpoints/characterEndpoints.d.ts +105 -0
- package/dist/core/endpoints/characterEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/characterEndpoints.js +13 -0
- package/dist/core/endpoints/cloneEndpoints.d.ts +21 -0
- package/dist/core/endpoints/cloneEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/cloneEndpoints.js +2 -0
- package/dist/core/endpoints/contactEndpoints.d.ts +49 -0
- package/dist/core/endpoints/contactEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/contactEndpoints.js +8 -0
- package/dist/core/endpoints/contractEndpoints.d.ts +184 -0
- package/dist/core/endpoints/contractEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/contractEndpoints.js +11 -0
- package/dist/core/endpoints/corporationEndpoints.d.ts +192 -0
- package/dist/core/endpoints/corporationEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/corporationEndpoints.js +18 -0
- package/dist/core/endpoints/createClient.d.ts.map +1 -1
- package/dist/core/endpoints/createClient.js +15 -41
- package/dist/core/endpoints/dogmaEndpoints.d.ts +38 -0
- package/dist/core/endpoints/dogmaEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/dogmaEndpoints.js +4 -0
- package/dist/core/endpoints/esi-scopes.generated.d.ts +3 -0
- package/dist/core/endpoints/esi-scopes.generated.d.ts.map +1 -0
- package/dist/core/endpoints/esi-scopes.generated.js +127 -0
- package/dist/core/endpoints/factionEndpoints.d.ts +154 -0
- package/dist/core/endpoints/factionEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/factionEndpoints.js +10 -0
- package/dist/core/endpoints/fittingEndpoints.d.ts +12 -0
- package/dist/core/endpoints/fittingEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/fittingEndpoints.js +3 -0
- package/dist/core/endpoints/fleetEndpoints.d.ts +45 -0
- package/dist/core/endpoints/fleetEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/fleetEndpoints.js +6 -0
- package/dist/core/endpoints/freelanceJobsEndpoints.d.ts +122 -0
- package/dist/core/endpoints/freelanceJobsEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/freelanceJobsEndpoints.js +8 -0
- package/dist/core/endpoints/incursionEndpoints.d.ts +15 -0
- package/dist/core/endpoints/incursionEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/incursionEndpoints.js +3 -0
- package/dist/core/endpoints/industryEndpoints.d.ts +103 -0
- package/dist/core/endpoints/industryEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/industryEndpoints.js +10 -0
- package/dist/core/endpoints/insuranceEndpoints.d.ts +9 -0
- package/dist/core/endpoints/insuranceEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/insuranceEndpoints.js +3 -0
- package/dist/core/endpoints/killmailEndpoints.d.ts +41 -0
- package/dist/core/endpoints/killmailEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/killmailEndpoints.js +5 -0
- package/dist/core/endpoints/locationEndpoints.d.ts +16 -0
- package/dist/core/endpoints/locationEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/locationEndpoints.js +4 -0
- package/dist/core/endpoints/loyaltyEndpoints.d.ts +17 -0
- package/dist/core/endpoints/loyaltyEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/loyaltyEndpoints.js +4 -0
- package/dist/core/endpoints/mailEndpoints.d.ts +35 -0
- package/dist/core/endpoints/mailEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/mailEndpoints.js +4 -0
- package/dist/core/endpoints/marketEndpoints.d.ts +123 -0
- package/dist/core/endpoints/marketEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/marketEndpoints.js +9 -0
- package/dist/core/endpoints/mercenaryEndpoints.d.ts +24 -0
- package/dist/core/endpoints/mercenaryEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/mercenaryEndpoints.js +4 -0
- package/dist/core/endpoints/piEndpoints.d.ts +76 -0
- package/dist/core/endpoints/piEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/piEndpoints.js +5 -0
- package/dist/core/endpoints/skillEndpoints.d.ts +21 -0
- package/dist/core/endpoints/skillEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/skillEndpoints.js +5 -0
- package/dist/core/endpoints/skyhookEndpoints.d.ts +27 -0
- package/dist/core/endpoints/skyhookEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/skyhookEndpoints.js +5 -0
- package/dist/core/endpoints/sovereigntyEndpoints.d.ts +37 -0
- package/dist/core/endpoints/sovereigntyEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/sovereigntyEndpoints.js +4 -0
- package/dist/core/endpoints/statusEndpoints.d.ts +6 -0
- package/dist/core/endpoints/statusEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/statusEndpoints.js +2 -0
- package/dist/core/endpoints/universeEndpoints.d.ts +272 -0
- package/dist/core/endpoints/universeEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/universeEndpoints.js +25 -0
- package/dist/core/endpoints/walletEndpoints.d.ts +51 -0
- package/dist/core/endpoints/walletEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/walletEndpoints.js +6 -0
- package/dist/core/endpoints/warEndpoints.d.ts +30 -0
- package/dist/core/endpoints/warEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/warEndpoints.js +5 -0
- package/dist/core/pagination/AsyncPaginationIterator.js +2 -2
- package/dist/core/util/error.d.ts +5 -0
- package/dist/core/util/error.d.ts.map +1 -1
- package/dist/core/util/error.js +14 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -2
- package/dist/schemas/access-lists.d.ts +30 -0
- package/dist/schemas/access-lists.d.ts.map +1 -0
- package/dist/schemas/access-lists.js +14 -0
- package/dist/schemas/alliance.d.ts +30 -0
- package/dist/schemas/alliance.d.ts.map +1 -0
- package/dist/schemas/alliance.js +28 -0
- package/dist/schemas/assets.d.ts +28 -0
- package/dist/schemas/assets.d.ts.map +1 -0
- package/dist/schemas/assets.js +26 -0
- package/dist/schemas/calendar.d.ts +41 -0
- package/dist/schemas/calendar.d.ts.map +1 -0
- package/dist/schemas/calendar.js +43 -0
- package/dist/schemas/character.d.ts +122 -0
- package/dist/schemas/character.d.ts.map +1 -0
- package/dist/schemas/character.js +114 -0
- package/dist/schemas/clones.d.ts +23 -0
- package/dist/schemas/clones.d.ts.map +1 -0
- package/dist/schemas/clones.js +21 -0
- package/dist/schemas/common.d.ts +59 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/common.js +34 -0
- package/dist/schemas/contacts.d.ts +18 -0
- package/dist/schemas/contacts.d.ts.map +1 -0
- package/dist/schemas/contacts.js +15 -0
- package/dist/schemas/contracts.d.ts +63 -0
- package/dist/schemas/contracts.d.ts.map +1 -0
- package/dist/schemas/contracts.js +58 -0
- package/dist/schemas/corporation.d.ts +193 -0
- package/dist/schemas/corporation.d.ts.map +1 -0
- package/dist/schemas/corporation.js +178 -0
- package/dist/schemas/dogma.d.ts +40 -0
- package/dist/schemas/dogma.d.ts.map +1 -0
- package/dist/schemas/dogma.js +42 -0
- package/dist/schemas/faction-warfare.d.ts +95 -0
- package/dist/schemas/faction-warfare.d.ts.map +1 -0
- package/dist/schemas/faction-warfare.js +92 -0
- package/dist/schemas/fittings.d.ts +13 -0
- package/dist/schemas/fittings.d.ts.map +1 -0
- package/dist/schemas/fittings.js +15 -0
- package/dist/schemas/fleet.d.ts +46 -0
- package/dist/schemas/fleet.d.ts.map +1 -0
- package/dist/schemas/fleet.js +48 -0
- package/dist/schemas/freelance-jobs.d.ts +141 -0
- package/dist/schemas/freelance-jobs.d.ts.map +1 -0
- package/dist/schemas/freelance-jobs.js +99 -0
- package/dist/schemas/incursions.d.ts +16 -0
- package/dist/schemas/incursions.d.ts.map +1 -0
- package/dist/schemas/incursions.js +14 -0
- package/dist/schemas/index.d.ts +33 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +48 -0
- package/dist/schemas/industry.d.ts +73 -0
- package/dist/schemas/industry.d.ts.map +1 -0
- package/dist/schemas/industry.js +75 -0
- package/dist/schemas/insurance.d.ts +10 -0
- package/dist/schemas/insurance.d.ts.map +1 -0
- package/dist/schemas/insurance.js +12 -0
- package/dist/schemas/killmails.d.ts +38 -0
- package/dist/schemas/killmails.d.ts.map +1 -0
- package/dist/schemas/killmails.js +42 -0
- package/dist/schemas/location.d.ts +18 -0
- package/dist/schemas/location.d.ts.map +1 -0
- package/dist/schemas/location.js +20 -0
- package/dist/schemas/loyalty.d.ts +18 -0
- package/dist/schemas/loyalty.d.ts.map +1 -0
- package/dist/schemas/loyalty.js +20 -0
- package/dist/schemas/mail.d.ts +25 -0
- package/dist/schemas/mail.d.ts.map +1 -0
- package/dist/schemas/mail.js +29 -0
- package/dist/schemas/market.d.ts +29 -0
- package/dist/schemas/market.d.ts.map +1 -0
- package/dist/schemas/market.js +26 -0
- package/dist/schemas/mercenary.d.ts +25 -0
- package/dist/schemas/mercenary.d.ts.map +1 -0
- package/dist/schemas/mercenary.js +22 -0
- package/dist/schemas/pi.d.ts +77 -0
- package/dist/schemas/pi.d.ts.map +1 -0
- package/dist/schemas/pi.js +85 -0
- package/dist/schemas/skills.d.ts +18 -0
- package/dist/schemas/skills.d.ts.map +1 -0
- package/dist/schemas/skills.js +20 -0
- package/dist/schemas/skyhooks.d.ts +28 -0
- package/dist/schemas/skyhooks.d.ts.map +1 -0
- package/dist/schemas/skyhooks.js +30 -0
- package/dist/schemas/sovereignty.d.ts +45 -0
- package/dist/schemas/sovereignty.d.ts.map +1 -0
- package/dist/schemas/sovereignty.js +43 -0
- package/dist/schemas/status.d.ts +8 -0
- package/dist/schemas/status.d.ts.map +1 -0
- package/dist/schemas/status.js +10 -0
- package/dist/schemas/universe.d.ts +286 -0
- package/dist/schemas/universe.d.ts.map +1 -0
- package/dist/schemas/universe.js +245 -0
- package/dist/schemas/wallet.d.ts +27 -0
- package/dist/schemas/wallet.d.ts.map +1 -0
- package/dist/schemas/wallet.js +29 -0
- package/dist/schemas/wars.d.ts +27 -0
- package/dist/schemas/wars.d.ts.map +1 -0
- package/dist/schemas/wars.js +31 -0
- package/dist/testing/TestDataFactory.d.ts +44 -3
- package/dist/testing/TestDataFactory.d.ts.map +1 -1
- package/dist/types/access-lists.d.ts +4 -10
- package/dist/types/access-lists.d.ts.map +1 -1
- package/dist/types/alliance.d.ts +6 -24
- package/dist/types/alliance.d.ts.map +1 -1
- package/dist/types/assets.d.ts +5 -22
- package/dist/types/assets.d.ts.map +1 -1
- package/dist/types/calendar.d.ts +5 -23
- package/dist/types/calendar.d.ts.map +1 -1
- package/dist/types/character.d.ts +15 -104
- package/dist/types/character.d.ts.map +1 -1
- package/dist/types/clones.d.ts +3 -15
- package/dist/types/clones.d.ts.map +1 -1
- package/dist/types/common.d.ts +4 -21
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/contacts.d.ts +4 -11
- package/dist/types/contacts.d.ts.map +1 -1
- package/dist/types/contracts.d.ts +5 -39
- package/dist/types/contracts.d.ts.map +1 -1
- package/dist/types/corporation.d.ts +18 -166
- package/dist/types/corporation.d.ts.map +1 -1
- package/dist/types/dogma.d.ts +5 -38
- package/dist/types/dogma.d.ts.map +1 -1
- package/dist/types/faction-warfare.d.ts +8 -88
- package/dist/types/faction-warfare.d.ts.map +1 -1
- package/dist/types/fittings.d.ts +3 -11
- package/dist/types/fittings.d.ts.map +1 -1
- package/dist/types/fleet.d.ts +6 -34
- package/dist/types/fleet.d.ts.map +1 -1
- package/dist/types/freelance-jobs.d.ts +10 -91
- package/dist/types/freelance-jobs.d.ts.map +1 -1
- package/dist/types/incursions.d.ts +3 -10
- package/dist/types/incursions.d.ts.map +1 -1
- package/dist/types/industry.d.ts +9 -64
- package/dist/types/industry.d.ts.map +1 -1
- package/dist/types/insurance.d.ts +3 -8
- package/dist/types/insurance.d.ts.map +1 -1
- package/dist/types/killmails.d.ts +4 -36
- package/dist/types/killmails.d.ts.map +1 -1
- package/dist/types/location.d.ts +5 -16
- package/dist/types/location.d.ts.map +1 -1
- package/dist/types/loyalty.d.ts +4 -16
- package/dist/types/loyalty.d.ts.map +1 -1
- package/dist/types/mail.d.ts +4 -18
- package/dist/types/mail.d.ts.map +1 -1
- package/dist/types/market.d.ts +4 -22
- package/dist/types/market.d.ts.map +1 -1
- package/dist/types/mercenary.d.ts +4 -18
- package/dist/types/mercenary.d.ts.map +1 -1
- package/dist/types/pi.d.ts +5 -66
- package/dist/types/pi.d.ts.map +1 -1
- package/dist/types/skills.d.ts +4 -16
- package/dist/types/skills.d.ts.map +1 -1
- package/dist/types/skyhooks.d.ts +5 -26
- package/dist/types/skyhooks.d.ts.map +1 -1
- package/dist/types/sovereignty.d.ts +5 -32
- package/dist/types/sovereignty.d.ts.map +1 -1
- package/dist/types/status.d.ts +3 -6
- package/dist/types/status.d.ts.map +1 -1
- package/dist/types/universe.d.ts +26 -274
- package/dist/types/universe.d.ts.map +1 -1
- package/dist/types/wallet.d.ts +4 -25
- package/dist/types/wallet.d.ts.map +1 -1
- package/dist/types/wars.d.ts +3 -25
- package/dist/types/wars.d.ts.map +1 -1
- package/package.json +48 -45
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,45 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [6.0.0] - 2026-07-03
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **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
|
|
15
|
+
- Zod schemas for all 31 domain modules (133 interfaces) in `src/schemas/`, exported under the `schemas` namespace
|
|
16
|
+
- `EsiValidationError` class (extends `EsiError`) thrown when response data doesn't match the expected schema
|
|
17
|
+
- `isValidationError()` type guard for catching validation errors
|
|
18
|
+
- `validateResponse` option on `EsiClientConfig` — on by default, can be disabled globally
|
|
19
|
+
- `responseSchema` field on `EndpointDefinition` — wires schemas into the request pipeline via `createClient()`
|
|
20
|
+
- New developer guide: `guides/RUNTIME-VALIDATION.md`
|
|
21
|
+
- Response Validation Pipeline diagram in `guides/ARCHITECTURE.md`
|
|
22
|
+
- Comprehensive TDD tests for schema parsing, validation integration, and common schemas (94 new tests)
|
|
23
|
+
- BDD feature and step definitions for 9 runtime validation scenarios
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- All TypeScript types in `src/types/` are now derived from Zod schemas via `z.infer<>` — schemas are the single source of truth
|
|
28
|
+
- Schemas use `.passthrough()` mode so extra fields from ESI are preserved, not rejected
|
|
29
|
+
- Test mock data across 25 test files updated to be spec-accurate (required by runtime validation)
|
|
30
|
+
- Path-parameter IDs (e.g., `character_id`, `alliance_id`) are now optional in schemas, matching ESI which omits them from response bodies
|
|
31
|
+
|
|
32
|
+
### Dependencies
|
|
33
|
+
|
|
34
|
+
- Added `zod` as a production dependency
|
|
35
|
+
|
|
36
|
+
## [5.3.0] - 2026-06-30
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- **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()`
|
|
41
|
+
- **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
|
|
42
|
+
- Exported `EsiScope` type and `esiEndpointScopes` map from package root
|
|
43
|
+
- **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
|
|
44
|
+
- Streaming methods added to `MarketClient` (6), `ContractsClient` (3), `WalletClient` (3), `AssetsClient` (2), `KillmailsClient` (2)
|
|
45
|
+
- `buildEndpointPath()` utility extracted from `createClient.ts` and exported from package root
|
|
46
|
+
- `streamEndpoint()` protected method on `BaseEsiClient` for building custom streaming domain clients
|
|
47
|
+
- Streaming pagination example (`npm run example:streaming`)
|
|
48
|
+
|
|
10
49
|
## [5.2.0] - 2026-06-29
|
|
11
50
|
|
|
12
51
|
### Added
|
package/README.md
CHANGED
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
A type-safe TypeScript client for the [EVE Online ESI API](https://esi.evetech.net/).
|
|
12
12
|
|
|
13
|
-
- Typed responses for all endpoints
|
|
13
|
+
- Typed responses for all endpoints with **runtime validation** via Zod schemas
|
|
14
14
|
- Spec-driven type generation from ESI swagger spec (147 interfaces)
|
|
15
15
|
- ETag caching with Cache-Control TTL, stale-on-error, and write invalidation
|
|
16
16
|
- Spec-aware cache TTLs — zero-request cache hits within ESI-specified windows
|
|
17
17
|
- Batch requests with bounded concurrency and auto-chunking
|
|
18
|
-
- Automatic offset-based pagination
|
|
18
|
+
- Automatic offset-based pagination, cursor-based pagination, and streaming pagination support
|
|
19
19
|
- Rate limiting with header-driven backoff
|
|
20
20
|
- Automatic token refresh with 401 retry and concurrent coalescing
|
|
21
21
|
- 35 domain clients covering the full ESI surface
|
|
@@ -77,6 +77,7 @@ const client = new EsiClient({
|
|
|
77
77
|
accessToken: 'your-token', // EVE SSO token for authenticated endpoints
|
|
78
78
|
baseUrl: 'https://esi.evetech.net', // ESI base URL (default)
|
|
79
79
|
onTokenRefresh: async () => newToken, // Auto-refresh on 401 (optional)
|
|
80
|
+
language: 'en', // Accept-Language header: en, de, fr, ja, ru, zh, ko, es (default: none)
|
|
80
81
|
timeout: 30000, // Request timeout in ms (default: 30000)
|
|
81
82
|
retryConfig: {
|
|
82
83
|
maxRetries: 3, // Max retry attempts for transient errors (default: 0)
|
|
@@ -90,6 +91,7 @@ const client = new EsiClient({
|
|
|
90
91
|
defaultTtl: 300000, // Fallback TTL in ms (default: 5 min)
|
|
91
92
|
cleanupInterval: 60000, // Expired entry cleanup interval (default: 1 min)
|
|
92
93
|
},
|
|
94
|
+
validateResponse: true, // Runtime Zod validation of ESI responses (default: true)
|
|
93
95
|
});
|
|
94
96
|
```
|
|
95
97
|
|
|
@@ -321,6 +323,37 @@ const allNames = await client.batchPost(
|
|
|
321
323
|
);
|
|
322
324
|
```
|
|
323
325
|
|
|
326
|
+
## Runtime Response Validation
|
|
327
|
+
|
|
328
|
+
ESI.ts validates every API response at runtime using [Zod](https://zod.dev/) schemas. If CCP changes the ESI API and the response no longer matches the expected shape, you get an immediate `EsiValidationError` instead of silent data corruption.
|
|
329
|
+
|
|
330
|
+
Validation is **on by default**. Extra fields from ESI are preserved (passthrough mode), so new fields added by CCP won't break your application.
|
|
331
|
+
|
|
332
|
+
```typescript
|
|
333
|
+
import {
|
|
334
|
+
EsiClient,
|
|
335
|
+
EsiValidationError,
|
|
336
|
+
isValidationError,
|
|
337
|
+
schemas,
|
|
338
|
+
} from '@lgriffin/esi.ts';
|
|
339
|
+
|
|
340
|
+
const client = new EsiClient();
|
|
341
|
+
|
|
342
|
+
// Validation happens automatically on every request
|
|
343
|
+
const character = await client.characters.getCharacterPublicInfo(12345);
|
|
344
|
+
|
|
345
|
+
// Disable validation globally if needed
|
|
346
|
+
const rawClient = new EsiClient({ validateResponse: false });
|
|
347
|
+
|
|
348
|
+
// Use schemas directly for your own validation
|
|
349
|
+
const result = schemas.CharacterInfoSchema.safeParse(someData);
|
|
350
|
+
if (result.success) {
|
|
351
|
+
console.log(result.data.name);
|
|
352
|
+
}
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
See [guides/RUNTIME-VALIDATION.md](guides/RUNTIME-VALIDATION.md) for the full guide on schemas, error handling, and extending schemas.
|
|
356
|
+
|
|
324
357
|
## Generated Types
|
|
325
358
|
|
|
326
359
|
The library includes TypeScript interfaces generated directly from the ESI swagger spec, available as the `EsiSpec` namespace. These are guaranteed to match the live spec and complement the hand-written types:
|
|
@@ -343,10 +376,66 @@ const order: EsiSpec.GetMarketsRegionIdOrders200Ok = {
|
|
|
343
376
|
To regenerate types from the latest ESI spec:
|
|
344
377
|
|
|
345
378
|
```bash
|
|
346
|
-
npm run generate:types # fetches spec, generates 147 interfaces + cache TTL map + rate limit groups
|
|
379
|
+
npm run generate:types # fetches spec, generates 147 interfaces + cache TTL map + rate limit groups + scope map
|
|
347
380
|
npm run validate:esi # reports type drift between hand-written and generated types
|
|
348
381
|
```
|
|
349
382
|
|
|
383
|
+
## ESI Scopes
|
|
384
|
+
|
|
385
|
+
The library includes a generated scope-to-endpoint mapping extracted from the ESI swagger spec. Use it to check which OAuth scopes an endpoint requires before making a request:
|
|
386
|
+
|
|
387
|
+
```typescript
|
|
388
|
+
import { esiEndpointScopes, EsiScope } from '@lgriffin/esi.ts';
|
|
389
|
+
|
|
390
|
+
// Look up scopes for a specific endpoint
|
|
391
|
+
const walletScopes = esiEndpointScopes['GET:characters/{character_id}/wallet'];
|
|
392
|
+
// → ['esi-wallet.read_character_wallet.v1']
|
|
393
|
+
|
|
394
|
+
// Check if an endpoint requires auth
|
|
395
|
+
const isPublic = !esiEndpointScopes['GET:universe/types/{type_id}'];
|
|
396
|
+
// → true (public endpoint, no scopes needed)
|
|
397
|
+
|
|
398
|
+
// Type-safe scope values
|
|
399
|
+
const scope: EsiScope = 'esi-assets.read_assets.v1';
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
## Streaming Pagination
|
|
403
|
+
|
|
404
|
+
For large paginated endpoints (market orders, contracts, assets), streaming yields one page at a time via `AsyncGenerator` instead of eagerly fetching all pages into memory:
|
|
405
|
+
|
|
406
|
+
```typescript
|
|
407
|
+
import { EsiClient } from '@lgriffin/esi.ts';
|
|
408
|
+
|
|
409
|
+
const client = new EsiClient();
|
|
410
|
+
|
|
411
|
+
// Stream all market orders in The Forge, page by page
|
|
412
|
+
for await (const page of client.market.streamMarketOrders(10000002)) {
|
|
413
|
+
console.log(
|
|
414
|
+
`Page ${page.page}/${page.totalPages}: ${page.data.length} orders`,
|
|
415
|
+
);
|
|
416
|
+
|
|
417
|
+
// Process each order as it arrives
|
|
418
|
+
for (const order of page.data) {
|
|
419
|
+
if (order.is_buy_order && order.price > 1_000_000) {
|
|
420
|
+
console.log(`High-value buy: ${order.type_id} @ ${order.price} ISK`);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// Early termination — stops fetching remaining pages
|
|
425
|
+
if (page.page >= 3) break;
|
|
426
|
+
}
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
Available streaming methods:
|
|
430
|
+
|
|
431
|
+
- **MarketClient** — `streamMarketOrders`, `streamMarketTypes`, `streamCharacterOrderHistory`, `streamCorporationOrders`, `streamCorporationOrderHistory`, `streamMarketOrdersInStructure`
|
|
432
|
+
- **ContractsClient** — `streamPublicContracts`, `streamCharacterContracts`, `streamCorporationContracts`
|
|
433
|
+
- **WalletClient** — `streamCharacterWalletJournal`, `streamCorporationWalletJournal`, `streamCharacterWalletTransactions`
|
|
434
|
+
- **AssetsClient** — `streamCharacterAssets`, `streamCorporationAssets`
|
|
435
|
+
- **KillmailsClient** — `streamCharacterRecentKillmails`, `streamCorporationRecentKillmails`
|
|
436
|
+
|
|
437
|
+
Try it: `npm run example:streaming`
|
|
438
|
+
|
|
350
439
|
## Cursor-based Pagination
|
|
351
440
|
|
|
352
441
|
Newer ESI routes (Freelance Jobs, and future routes) use cursor-based pagination with opaque `before`/`after` tokens in the response body. See the [ESI blog post](https://developers.eveonline.com/blog/changing-pagination-turning-a-new-page) for background.
|
|
@@ -414,15 +503,19 @@ API errors throw `EsiError` with `statusCode`, `message`, and `url` properties:
|
|
|
414
503
|
import {
|
|
415
504
|
EsiError,
|
|
416
505
|
TimeoutError,
|
|
506
|
+
EsiValidationError,
|
|
417
507
|
isTimeout,
|
|
418
508
|
isRetryable,
|
|
509
|
+
isValidationError,
|
|
419
510
|
} from '@lgriffin/esi.ts';
|
|
420
511
|
|
|
421
512
|
try {
|
|
422
513
|
const alliance = await client.alliance.getAllianceById(99999999);
|
|
423
514
|
console.log('Alliance:', alliance.name);
|
|
424
515
|
} catch (err) {
|
|
425
|
-
if (
|
|
516
|
+
if (isValidationError(err)) {
|
|
517
|
+
console.log('Response validation failed:', err.validationError);
|
|
518
|
+
} else if (isTimeout(err)) {
|
|
426
519
|
console.log(`Request timed out after ${err.timeoutMs}ms`);
|
|
427
520
|
} else if (err instanceof EsiError) {
|
|
428
521
|
console.log(`ESI error ${err.statusCode}: ${err.message}`);
|
|
@@ -437,6 +530,7 @@ try {
|
|
|
437
530
|
- **5xx with cache** — returns stale cached data instead of throwing
|
|
438
531
|
- **Timeout** — throws `TimeoutError` (extends `EsiError` with `statusCode: 0` and `timeoutMs`)
|
|
439
532
|
- **Retryable errors** — `EsiError.retryable` returns `true` for 502, 503, 504, 420, 429, and timeouts
|
|
533
|
+
- **Validation errors** — throws `EsiValidationError` (extends `EsiError`) when response data doesn't match the expected Zod schema
|
|
440
534
|
|
|
441
535
|
## Response Metadata
|
|
442
536
|
|
|
@@ -555,6 +649,7 @@ npm run example:dogma # Item type details + dogma attributes
|
|
|
555
649
|
npm run example:contracts # Public region contracts + auction bids/items
|
|
556
650
|
npm run example:rate-limiting # Rate limiter & pagination demonstration
|
|
557
651
|
npm run example:cursor-pagination # Freelance Jobs with cursor pagination
|
|
652
|
+
npm run example:streaming # Streaming pagination for large datasets
|
|
558
653
|
npm run example:token-refresh # Automatic token refresh on 401
|
|
559
654
|
```
|
|
560
655
|
|
package/dist/EsiClient.d.ts
CHANGED
|
@@ -57,9 +57,11 @@ export interface EsiClientConfig {
|
|
|
57
57
|
circuitBreakerConfig?: CircuitBreakerConfig;
|
|
58
58
|
unsafeAllowCustomHost?: boolean;
|
|
59
59
|
enableRequestDeduplication?: boolean;
|
|
60
|
+
language?: string;
|
|
60
61
|
rateLimiterConfig?: RateLimiterConfig;
|
|
61
62
|
requestInterceptors?: RequestInterceptor[];
|
|
62
63
|
responseInterceptors?: ResponseInterceptor[];
|
|
64
|
+
validateResponse?: boolean;
|
|
63
65
|
}
|
|
64
66
|
export declare class EsiClient {
|
|
65
67
|
private apiClient;
|
package/dist/EsiClient.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EsiClient.d.ts","sourceRoot":"","sources":["../src/EsiClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OA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,GAAG,IAAI;IAI5D,sBAAsB;IAItB,mBAAmB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IAItC,KAAK,CAAC,CAAC,EAAE,CAAC,EACd,IAAI,EAAE,CAAC,EAAE,EACT,OAAO,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,EAC/B,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAIvB,SAAS,CAAC,CAAC,EACf,GAAG,EAAE,MAAM,EAAE,EACb,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,EACzC,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,CAAC,EAAE,CAAC;IAIf,QAAQ,IAAI,IAAI;CAejB;AAGD,wBAAgB,gBAAgB,IAAI,SAAS,CAK5C"}
|
package/dist/EsiClient.js
CHANGED
|
@@ -30,6 +30,9 @@ class EsiClient {
|
|
|
30
30
|
if (datasource) {
|
|
31
31
|
this.apiClient.setDatasource(datasource);
|
|
32
32
|
}
|
|
33
|
+
if (config?.language) {
|
|
34
|
+
this.apiClient.setLanguage(config.language);
|
|
35
|
+
}
|
|
33
36
|
if (config?.timeout !== undefined) {
|
|
34
37
|
this.apiClient.setTimeout(config.timeout);
|
|
35
38
|
}
|
|
@@ -64,6 +67,9 @@ class EsiClient {
|
|
|
64
67
|
this.apiClient.addResponseInterceptor(interceptor);
|
|
65
68
|
}
|
|
66
69
|
}
|
|
70
|
+
if (config?.validateResponse !== undefined) {
|
|
71
|
+
this.apiClient.setValidateResponse(config.validateResponse);
|
|
72
|
+
}
|
|
67
73
|
logger_1.default.info('EsiClient initialized successfully');
|
|
68
74
|
}
|
|
69
75
|
getClient(name) {
|
|
@@ -2,6 +2,7 @@ import { ApiClient } from '../core/ApiClient';
|
|
|
2
2
|
import { BaseEsiClient } from './BaseEsiClient';
|
|
3
3
|
import { assetEndpoints } from '../core/endpoints/assetEndpoints';
|
|
4
4
|
import { CharacterAsset, AssetLocation, AssetName } from '../types/api-responses';
|
|
5
|
+
import { PageResult } from '../core/pagination/AsyncPaginationIterator';
|
|
5
6
|
export declare class AssetsClient extends BaseEsiClient<typeof assetEndpoints> {
|
|
6
7
|
constructor(client: ApiClient);
|
|
7
8
|
/**
|
|
@@ -56,5 +57,7 @@ export declare class AssetsClient extends BaseEsiClient<typeof assetEndpoints> {
|
|
|
56
57
|
* @requires Authentication
|
|
57
58
|
*/
|
|
58
59
|
postCorporationAssetNames(corporationId: number, itemIds: number[]): Promise<AssetName[]>;
|
|
60
|
+
streamCharacterAssets(characterId: number): AsyncGenerator<PageResult<CharacterAsset>, void, undefined>;
|
|
61
|
+
streamCorporationAssets(corporationId: number): AsyncGenerator<PageResult<CharacterAsset>, void, undefined>;
|
|
59
62
|
}
|
|
60
63
|
//# sourceMappingURL=AssetsClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetsClient.d.ts","sourceRoot":"","sources":["../../src/clients/AssetsClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EACL,cAAc,EACd,aAAa,EACb,SAAS,EACV,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"AssetsClient.d.ts","sourceRoot":"","sources":["../../src/clients/AssetsClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EACL,cAAc,EACd,aAAa,EACb,SAAS,EACV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAExE,qBAAa,YAAa,SAAQ,aAAa,CAAC,OAAO,cAAc,CAAC;gBACxD,MAAM,EAAE,SAAS;IAI7B;;;;;;OAMG;IACH,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAMlE;;;;;;;OAOG;IACH,2BAA2B,CACzB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,aAAa,EAAE,CAAC;IAO3B;;;;;;;OAOG;IACH,uBAAuB,CACrB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,SAAS,EAAE,CAAC;IAMvB;;;;;;OAMG;IACH,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAMtE;;;;;;;OAOG;IACH,6BAA6B,CAC3B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,aAAa,EAAE,CAAC;IAO3B;;;;;;;OAOG;IACH,yBAAyB,CACvB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,SAAS,EAAE,CAAC;IAOvB,qBAAqB,CACnB,WAAW,EAAE,MAAM,GAClB,cAAc,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC;IAO9D,uBAAuB,CACrB,aAAa,EAAE,MAAM,GACpB,cAAc,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC;CAM/D"}
|
|
@@ -71,5 +71,11 @@ class AssetsClient extends BaseEsiClient_1.BaseEsiClient {
|
|
|
71
71
|
postCorporationAssetNames(corporationId, itemIds) {
|
|
72
72
|
return this.api.postCorporationAssetNames(corporationId, itemIds);
|
|
73
73
|
}
|
|
74
|
+
streamCharacterAssets(characterId) {
|
|
75
|
+
return this.streamEndpoint('getCharacterAssets', characterId);
|
|
76
|
+
}
|
|
77
|
+
streamCorporationAssets(corporationId) {
|
|
78
|
+
return this.streamEndpoint('getCorporationAssets', corporationId);
|
|
79
|
+
}
|
|
74
80
|
}
|
|
75
81
|
exports.AssetsClient = AssetsClient;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { ApiClient } from '../core/ApiClient';
|
|
2
2
|
import { createClient, WithMetadata } from '../core/endpoints/createClient';
|
|
3
3
|
import { EndpointMap } from '../core/endpoints/EndpointDefinition';
|
|
4
|
+
import { PageResult } from '../core/pagination/AsyncPaginationIterator';
|
|
4
5
|
type ClientMethods<T extends EndpointMap> = ReturnType<typeof createClient<T>>;
|
|
5
6
|
export declare abstract class BaseEsiClient<T extends EndpointMap> {
|
|
6
7
|
protected api: ClientMethods<T>;
|
|
7
8
|
protected _client: ApiClient;
|
|
8
|
-
|
|
9
|
+
protected _endpoints: T;
|
|
9
10
|
private _metaApi?;
|
|
10
11
|
constructor(client: ApiClient, endpoints: T);
|
|
12
|
+
protected streamEndpoint<R>(endpointName: string & keyof T, ...args: unknown[]): AsyncGenerator<PageResult<R>, void, undefined>;
|
|
11
13
|
withMetadata(): WithMetadata<Omit<this, 'withMetadata'>>;
|
|
12
14
|
}
|
|
13
15
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseEsiClient.d.ts","sourceRoot":"","sources":["../../src/clients/BaseEsiClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,YAAY,EAEZ,YAAY,EACb,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEnE,KAAK,aAAa,CAAC,CAAC,SAAS,WAAW,IAAI,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/E,8BAAsB,aAAa,CAAC,CAAC,SAAS,WAAW;IACvD,SAAS,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAChC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC;IAC7B,
|
|
1
|
+
{"version":3,"file":"BaseEsiClient.d.ts","sourceRoot":"","sources":["../../src/clients/BaseEsiClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,YAAY,EAEZ,YAAY,EACb,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEnE,OAAO,EAEL,UAAU,EACX,MAAM,4CAA4C,CAAC;AAEpD,KAAK,aAAa,CAAC,CAAC,SAAS,WAAW,IAAI,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/E,8BAAsB,aAAa,CAAC,CAAC,SAAS,WAAW;IACvD,SAAS,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAChC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC;IAC7B,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;IACxB,OAAO,CAAC,QAAQ,CAAC,CAAmB;gBAExB,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;IAM3C,SAAS,CAAC,cAAc,CAAC,CAAC,EACxB,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,EAC9B,GAAG,IAAI,EAAE,OAAO,EAAE,GACjB,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC;IAgBjD,YAAY,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;CAQzD"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseEsiClient = void 0;
|
|
4
4
|
const createClient_1 = require("../core/endpoints/createClient");
|
|
5
|
+
const buildEndpointPath_1 = require("../core/endpoints/buildEndpointPath");
|
|
6
|
+
const AsyncPaginationIterator_1 = require("../core/pagination/AsyncPaginationIterator");
|
|
5
7
|
class BaseEsiClient {
|
|
6
8
|
api;
|
|
7
9
|
_client;
|
|
@@ -12,6 +14,11 @@ class BaseEsiClient {
|
|
|
12
14
|
this._endpoints = endpoints;
|
|
13
15
|
this.api = (0, createClient_1.createClient)(client, endpoints);
|
|
14
16
|
}
|
|
17
|
+
streamEndpoint(endpointName, ...args) {
|
|
18
|
+
const def = this._endpoints[endpointName];
|
|
19
|
+
const { path, body } = (0, buildEndpointPath_1.buildEndpointPath)(def, args, this._client.getDatasource());
|
|
20
|
+
return (0, AsyncPaginationIterator_1.fetchPages)(this._client, path, def.method, def.requiresAuth, body);
|
|
21
|
+
}
|
|
15
22
|
withMetadata() {
|
|
16
23
|
if (!this._metaApi) {
|
|
17
24
|
this._metaApi = (0, createClient_1.createClient)(this._client, this._endpoints, {
|
|
@@ -2,6 +2,7 @@ import { ApiClient } from '../core/ApiClient';
|
|
|
2
2
|
import { BaseEsiClient } from './BaseEsiClient';
|
|
3
3
|
import { contractEndpoints } from '../core/endpoints/contractEndpoints';
|
|
4
4
|
import { Contract, ContractBid, ContractItem } from '../types/api-responses';
|
|
5
|
+
import { PageResult } from '../core/pagination/AsyncPaginationIterator';
|
|
5
6
|
export declare class ContractsClient extends BaseEsiClient<typeof contractEndpoints> {
|
|
6
7
|
constructor(client: ApiClient);
|
|
7
8
|
/**
|
|
@@ -77,5 +78,8 @@ export declare class ContractsClient extends BaseEsiClient<typeof contractEndpoi
|
|
|
77
78
|
* @requires Authentication
|
|
78
79
|
*/
|
|
79
80
|
getCorporationContractItems(corporationId: number, contractId: number): Promise<ContractItem[]>;
|
|
81
|
+
streamPublicContracts(regionId: number): AsyncGenerator<PageResult<Contract>, void, undefined>;
|
|
82
|
+
streamCharacterContracts(characterId: number): AsyncGenerator<PageResult<Contract>, void, undefined>;
|
|
83
|
+
streamCorporationContracts(corporationId: number): AsyncGenerator<PageResult<Contract>, void, undefined>;
|
|
80
84
|
}
|
|
81
85
|
//# sourceMappingURL=ContractsClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContractsClient.d.ts","sourceRoot":"","sources":["../../src/clients/ContractsClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"ContractsClient.d.ts","sourceRoot":"","sources":["../../src/clients/ContractsClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAExE,qBAAa,eAAgB,SAAQ,aAAa,CAAC,OAAO,iBAAiB,CAAC;gBAC9D,MAAM,EAAE,SAAS;IAI7B;;;;;;OAMG;IACH,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAI/D;;;;;;;OAOG;IACH,wBAAwB,CACtB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,EAAE,CAAC;IAOzB;;;;;;;OAOG;IACH,yBAAyB,CACvB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,YAAY,EAAE,CAAC;IAO1B;;;;;OAKG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAIzD;;;;;OAKG;IACH,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAIjE;;;;;OAKG;IACH,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAMnE;;;;;;OAMG;IACH,uBAAuB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAMnE;;;;;;;OAOG;IACH,0BAA0B,CACxB,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,EAAE,CAAC;IAOzB;;;;;;;OAOG;IACH,2BAA2B,CACzB,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,YAAY,EAAE,CAAC;IAO1B,qBAAqB,CACnB,QAAQ,EAAE,MAAM,GACf,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC;IAIxD,wBAAwB,CACtB,WAAW,EAAE,MAAM,GAClB,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC;IAIxD,0BAA0B,CACxB,aAAa,EAAE,MAAM,GACpB,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC;CAMzD"}
|
|
@@ -98,5 +98,14 @@ class ContractsClient extends BaseEsiClient_1.BaseEsiClient {
|
|
|
98
98
|
getCorporationContractItems(corporationId, contractId) {
|
|
99
99
|
return this.api.getCorporationContractItems(corporationId, contractId);
|
|
100
100
|
}
|
|
101
|
+
streamPublicContracts(regionId) {
|
|
102
|
+
return this.streamEndpoint('getPublicContracts', regionId);
|
|
103
|
+
}
|
|
104
|
+
streamCharacterContracts(characterId) {
|
|
105
|
+
return this.streamEndpoint('getCharacterContracts', characterId);
|
|
106
|
+
}
|
|
107
|
+
streamCorporationContracts(corporationId) {
|
|
108
|
+
return this.streamEndpoint('getCorporationContracts', corporationId);
|
|
109
|
+
}
|
|
101
110
|
}
|
|
102
111
|
exports.ContractsClient = ContractsClient;
|
|
@@ -2,6 +2,7 @@ import { ApiClient } from '../core/ApiClient';
|
|
|
2
2
|
import { BaseEsiClient } from './BaseEsiClient';
|
|
3
3
|
import { killmailEndpoints } from '../core/endpoints/killmailEndpoints';
|
|
4
4
|
import { KillmailSummary, Killmail } from '../types/api-responses';
|
|
5
|
+
import { PageResult } from '../core/pagination/AsyncPaginationIterator';
|
|
5
6
|
export declare class KillmailsClient extends BaseEsiClient<typeof killmailEndpoints> {
|
|
6
7
|
constructor(client: ApiClient);
|
|
7
8
|
/**
|
|
@@ -28,5 +29,7 @@ export declare class KillmailsClient extends BaseEsiClient<typeof killmailEndpoi
|
|
|
28
29
|
* @returns The full killmail details including victim, attackers, and items
|
|
29
30
|
*/
|
|
30
31
|
getKillmail(killmailId: number, killmailHash: string): Promise<Killmail>;
|
|
32
|
+
streamCharacterRecentKillmails(characterId: number): AsyncGenerator<PageResult<KillmailSummary>, void, undefined>;
|
|
33
|
+
streamCorporationRecentKillmails(corporationId: number): AsyncGenerator<PageResult<KillmailSummary>, void, undefined>;
|
|
31
34
|
}
|
|
32
35
|
//# sourceMappingURL=KillmailsClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KillmailsClient.d.ts","sourceRoot":"","sources":["../../src/clients/KillmailsClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"KillmailsClient.d.ts","sourceRoot":"","sources":["../../src/clients/KillmailsClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAExE,qBAAa,eAAgB,SAAQ,aAAa,CAAC,OAAO,iBAAiB,CAAC;gBAC9D,MAAM,EAAE,SAAS;IAI7B;;;;;;OAMG;IACH,2BAA2B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAM5E;;;;;;OAMG;IACH,6BAA6B,CAC3B,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,eAAe,EAAE,CAAC;IAM7B;;;;;;OAMG;IACH,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIxE,8BAA8B,CAC5B,WAAW,EAAE,MAAM,GAClB,cAAc,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC;IAO/D,gCAAgC,CAC9B,aAAa,EAAE,MAAM,GACpB,cAAc,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC;CAMhE"}
|
|
@@ -37,5 +37,11 @@ class KillmailsClient extends BaseEsiClient_1.BaseEsiClient {
|
|
|
37
37
|
getKillmail(killmailId, killmailHash) {
|
|
38
38
|
return this.api.getKillmail(killmailId, killmailHash);
|
|
39
39
|
}
|
|
40
|
+
streamCharacterRecentKillmails(characterId) {
|
|
41
|
+
return this.streamEndpoint('getCharacterRecentKillmails', characterId);
|
|
42
|
+
}
|
|
43
|
+
streamCorporationRecentKillmails(corporationId) {
|
|
44
|
+
return this.streamEndpoint('getCorporationRecentKillmails', corporationId);
|
|
45
|
+
}
|
|
40
46
|
}
|
|
41
47
|
exports.KillmailsClient = KillmailsClient;
|
|
@@ -2,6 +2,7 @@ import { ApiClient } from '../core/ApiClient';
|
|
|
2
2
|
import { BaseEsiClient } from './BaseEsiClient';
|
|
3
3
|
import { marketEndpoints } from '../core/endpoints/marketEndpoints';
|
|
4
4
|
import { MarketOrder, MarketHistory } from '../types/api-responses';
|
|
5
|
+
import { PageResult } from '../core/pagination/AsyncPaginationIterator';
|
|
5
6
|
export declare class MarketClient extends BaseEsiClient<typeof marketEndpoints> {
|
|
6
7
|
constructor(client: ApiClient);
|
|
7
8
|
/**
|
|
@@ -94,5 +95,11 @@ export declare class MarketClient extends BaseEsiClient<typeof marketEndpoints>
|
|
|
94
95
|
* @returns A list of active market orders in the structure
|
|
95
96
|
*/
|
|
96
97
|
getMarketOrdersInStructure(structureId: number): Promise<MarketOrder[]>;
|
|
98
|
+
streamMarketOrders(regionId: number): AsyncGenerator<PageResult<MarketOrder>, void, undefined>;
|
|
99
|
+
streamMarketTypes(regionId: number): AsyncGenerator<PageResult<number>, void, undefined>;
|
|
100
|
+
streamCharacterOrderHistory(characterId: number): AsyncGenerator<PageResult<MarketOrder>, void, undefined>;
|
|
101
|
+
streamCorporationOrders(corporationId: number): AsyncGenerator<PageResult<MarketOrder>, void, undefined>;
|
|
102
|
+
streamCorporationOrderHistory(corporationId: number): AsyncGenerator<PageResult<MarketOrder>, void, undefined>;
|
|
103
|
+
streamMarketOrdersInStructure(structureId: number): AsyncGenerator<PageResult<MarketOrder>, void, undefined>;
|
|
97
104
|
}
|
|
98
105
|
//# sourceMappingURL=MarketClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarketClient.d.ts","sourceRoot":"","sources":["../../src/clients/MarketClient.ts"],"names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AA6B,CAC3B,WAAW,EAAE,MAAM,GAClB,cAAc,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC;CAM5D"}
|
|
@@ -109,5 +109,23 @@ class MarketClient extends BaseEsiClient_1.BaseEsiClient {
|
|
|
109
109
|
getMarketOrdersInStructure(structureId) {
|
|
110
110
|
return this.api.getMarketOrdersInStructure(structureId);
|
|
111
111
|
}
|
|
112
|
+
streamMarketOrders(regionId) {
|
|
113
|
+
return this.streamEndpoint('getMarketOrders', regionId, 'all');
|
|
114
|
+
}
|
|
115
|
+
streamMarketTypes(regionId) {
|
|
116
|
+
return this.streamEndpoint('getMarketTypes', regionId);
|
|
117
|
+
}
|
|
118
|
+
streamCharacterOrderHistory(characterId) {
|
|
119
|
+
return this.streamEndpoint('getCharacterOrderHistory', characterId);
|
|
120
|
+
}
|
|
121
|
+
streamCorporationOrders(corporationId) {
|
|
122
|
+
return this.streamEndpoint('getCorporationOrders', corporationId);
|
|
123
|
+
}
|
|
124
|
+
streamCorporationOrderHistory(corporationId) {
|
|
125
|
+
return this.streamEndpoint('getCorporationOrderHistory', corporationId);
|
|
126
|
+
}
|
|
127
|
+
streamMarketOrdersInStructure(structureId) {
|
|
128
|
+
return this.streamEndpoint('getMarketOrdersInStructure', structureId);
|
|
129
|
+
}
|
|
112
130
|
}
|
|
113
131
|
exports.MarketClient = MarketClient;
|
|
@@ -2,6 +2,7 @@ import { ApiClient } from '../core/ApiClient';
|
|
|
2
2
|
import { BaseEsiClient } from './BaseEsiClient';
|
|
3
3
|
import { walletEndpoints } from '../core/endpoints/walletEndpoints';
|
|
4
4
|
import { WalletJournal, WalletTransaction } from '../types/api-responses';
|
|
5
|
+
import { PageResult } from '../core/pagination/AsyncPaginationIterator';
|
|
5
6
|
export declare class WalletClient extends BaseEsiClient<typeof walletEndpoints> {
|
|
6
7
|
constructor(client: ApiClient);
|
|
7
8
|
/**
|
|
@@ -57,5 +58,8 @@ export declare class WalletClient extends BaseEsiClient<typeof walletEndpoints>
|
|
|
57
58
|
* @requires Authentication
|
|
58
59
|
*/
|
|
59
60
|
getCorporationWalletTransactions(corporationId: number, division: number): Promise<WalletTransaction[]>;
|
|
61
|
+
streamCharacterWalletJournal(characterId: number): AsyncGenerator<PageResult<WalletJournal>, void, undefined>;
|
|
62
|
+
streamCorporationWalletJournal(corporationId: number, division: number): AsyncGenerator<PageResult<WalletJournal>, void, undefined>;
|
|
63
|
+
streamCharacterWalletTransactions(characterId: number): AsyncGenerator<PageResult<WalletTransaction>, void, undefined>;
|
|
60
64
|
}
|
|
61
65
|
//# sourceMappingURL=WalletClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletClient.d.ts","sourceRoot":"","sources":["../../src/clients/WalletClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"WalletClient.d.ts","sourceRoot":"","sources":["../../src/clients/WalletClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAExE,qBAAa,YAAa,SAAQ,aAAa,CAAC,OAAO,eAAe,CAAC;gBACzD,MAAM,EAAE,SAAS;IAI7B;;;;;;OAMG;IACH,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIxD;;;;;;OAMG;IACH,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAMxE;;;;;;OAMG;IACH,8BAA8B,CAC5B,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAM/B;;;;;;OAMG;IACH,qBAAqB,CACnB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAMnD;;;;;;;OAOG;IACH,2BAA2B,CACzB,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,aAAa,EAAE,CAAC;IAO3B;;;;;;;OAOG;IACH,gCAAgC,CAC9B,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAO/B,4BAA4B,CAC1B,WAAW,EAAE,MAAM,GAClB,cAAc,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC;IAO7D,8BAA8B,CAC5B,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,GACf,cAAc,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC;IAQ7D,iCAAiC,CAC/B,WAAW,EAAE,MAAM,GAClB,cAAc,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC;CAMlE"}
|
|
@@ -69,5 +69,14 @@ class WalletClient extends BaseEsiClient_1.BaseEsiClient {
|
|
|
69
69
|
getCorporationWalletTransactions(corporationId, division) {
|
|
70
70
|
return this.api.getCorporationWalletTransactions(corporationId, division);
|
|
71
71
|
}
|
|
72
|
+
streamCharacterWalletJournal(characterId) {
|
|
73
|
+
return this.streamEndpoint('getCharacterWalletJournal', characterId);
|
|
74
|
+
}
|
|
75
|
+
streamCorporationWalletJournal(corporationId, division) {
|
|
76
|
+
return this.streamEndpoint('getCorporationWalletJournal', corporationId, division);
|
|
77
|
+
}
|
|
78
|
+
streamCharacterWalletTransactions(characterId) {
|
|
79
|
+
return this.streamEndpoint('getCharacterWalletTransactions', characterId);
|
|
80
|
+
}
|
|
72
81
|
}
|
|
73
82
|
exports.WalletClient = WalletClient;
|
package/dist/core/ApiClient.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export declare class ApiClient {
|
|
|
20
20
|
private timeout;
|
|
21
21
|
private deduplicator;
|
|
22
22
|
private retryConfig;
|
|
23
|
+
private validateResponse;
|
|
24
|
+
private language?;
|
|
23
25
|
constructor(clientId: string, link: string, accessToken?: string | undefined);
|
|
24
26
|
getTimeout(): number;
|
|
25
27
|
setTimeout(timeout: number): void;
|
|
@@ -33,6 +35,8 @@ export declare class ApiClient {
|
|
|
33
35
|
setDeduplicator(dedup: RequestDeduplicator | null): void;
|
|
34
36
|
getRetryConfig(): RetryConfig | null;
|
|
35
37
|
setRetryConfig(config: RetryConfig | null): void;
|
|
38
|
+
getValidateResponse(): boolean;
|
|
39
|
+
setValidateResponse(validate: boolean): void;
|
|
36
40
|
getMiddleware(): MiddlewareManager;
|
|
37
41
|
addRequestInterceptor(fn: RequestInterceptor): () => void;
|
|
38
42
|
addResponseInterceptor(fn: ResponseInterceptor): () => void;
|
|
@@ -40,6 +44,8 @@ export declare class ApiClient {
|
|
|
40
44
|
getLink(): string;
|
|
41
45
|
getDatasource(): EsiDatasource | undefined;
|
|
42
46
|
setDatasource(datasource: EsiDatasource | undefined): void;
|
|
47
|
+
getLanguage(): string | undefined;
|
|
48
|
+
setLanguage(language: string | undefined): void;
|
|
43
49
|
setAccessToken(token: string): void;
|
|
44
50
|
setTokenProvider(provider: TokenProvider | undefined): void;
|
|
45
51
|
hasTokenProvider(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiClient.d.ts","sourceRoot":"","sources":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,sBAAsB,IAAI,MAAM,GAAG,SAAS;IAI5C,OAAO,IAAI,MAAM;IAIjB,aAAa,IAAI,aAAa,GAAG,SAAS;IAI1C,aAAa,CAAC,UAAU,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI;IAI1D,WAAW,IAAI,MAAM,GAAG,SAAS;IAIjC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAI/C,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAInC,gBAAgB,CAAC,QAAQ,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI;IAI3D,gBAAgB,IAAI,OAAO;IAIrB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;CAuBtC"}
|
package/dist/core/ApiClient.js
CHANGED
|
@@ -16,6 +16,8 @@ class ApiClient {
|
|
|
16
16
|
timeout = 30_000;
|
|
17
17
|
deduplicator = null;
|
|
18
18
|
retryConfig = null;
|
|
19
|
+
validateResponse = true;
|
|
20
|
+
language;
|
|
19
21
|
constructor(clientId, link, accessToken) {
|
|
20
22
|
this.clientId = clientId;
|
|
21
23
|
this.link = link;
|
|
@@ -58,6 +60,12 @@ class ApiClient {
|
|
|
58
60
|
setRetryConfig(config) {
|
|
59
61
|
this.retryConfig = config;
|
|
60
62
|
}
|
|
63
|
+
getValidateResponse() {
|
|
64
|
+
return this.validateResponse;
|
|
65
|
+
}
|
|
66
|
+
setValidateResponse(validate) {
|
|
67
|
+
this.validateResponse = validate;
|
|
68
|
+
}
|
|
61
69
|
getMiddleware() {
|
|
62
70
|
return this.middleware;
|
|
63
71
|
}
|
|
@@ -79,6 +87,12 @@ class ApiClient {
|
|
|
79
87
|
setDatasource(datasource) {
|
|
80
88
|
this.datasource = datasource;
|
|
81
89
|
}
|
|
90
|
+
getLanguage() {
|
|
91
|
+
return this.language;
|
|
92
|
+
}
|
|
93
|
+
setLanguage(language) {
|
|
94
|
+
this.language = language;
|
|
95
|
+
}
|
|
82
96
|
setAccessToken(token) {
|
|
83
97
|
this.accessToken = token;
|
|
84
98
|
}
|
|
@@ -9,5 +9,6 @@ export interface EsiHandlerResponse {
|
|
|
9
9
|
responseTimeMs?: number;
|
|
10
10
|
cursors?: CursorTokens;
|
|
11
11
|
}
|
|
12
|
+
export declare const handleSinglePageRequest: (client: ApiClient, endpoint: string, method: string, body?: unknown, requiresAuth?: boolean) => Promise<EsiHandlerResponse>;
|
|
12
13
|
export declare const handleRequest: (client: ApiClient, endpoint: string, method: string, body?: unknown, requiresAuth?: boolean, useETag?: boolean, templatePath?: string, requestTimeout?: number) => Promise<EsiHandlerResponse>;
|
|
13
14
|
//# sourceMappingURL=ApiRequestHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiRequestHandler.d.ts","sourceRoot":"","sources":["../../src/core/ApiRequestHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAYxC,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AASpE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,gBAAgB,CAAC;IAC1D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;
|
|
1
|
+
{"version":3,"file":"ApiRequestHandler.d.ts","sourceRoot":"","sources":["../../src/core/ApiRequestHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAYxC,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AASpE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAA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