@lgriffin/esi.ts 7.4.0 → 9.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 +27 -0
- package/README.md +100 -24
- package/dist/EsiClient.d.ts +3 -0
- package/dist/EsiClient.d.ts.map +1 -1
- package/dist/EsiClientBuilder.d.ts +1 -0
- package/dist/EsiClientBuilder.d.ts.map +1 -1
- package/dist/clients/AllianceClient.d.ts +3 -0
- package/dist/clients/AllianceClient.d.ts.map +1 -1
- package/dist/clients/BaseEsiClient.d.ts +1 -1
- package/dist/clients/BaseEsiClient.d.ts.map +1 -1
- package/dist/clients/CalendarClient.d.ts +3 -0
- package/dist/clients/CalendarClient.d.ts.map +1 -1
- package/dist/clients/CharacterClient.d.ts +10 -2
- package/dist/clients/CharacterClient.d.ts.map +1 -1
- package/dist/clients/ClonesClient.d.ts +2 -0
- package/dist/clients/ClonesClient.d.ts.map +1 -1
- package/dist/clients/ContactsClient.d.ts +7 -0
- package/dist/clients/ContactsClient.d.ts.map +1 -1
- package/dist/clients/CorporationsClient.d.ts +18 -0
- package/dist/clients/CorporationsClient.d.ts.map +1 -1
- package/dist/clients/FittingsClient.d.ts +2 -0
- package/dist/clients/FittingsClient.d.ts.map +1 -1
- package/dist/clients/FleetClient.d.ts +3 -0
- package/dist/clients/FleetClient.d.ts.map +1 -1
- package/dist/clients/IndustryClient.d.ts +9 -0
- package/dist/clients/IndustryClient.d.ts.map +1 -1
- package/dist/clients/LoyaltyClient.d.ts +3 -0
- package/dist/clients/LoyaltyClient.d.ts.map +1 -1
- package/dist/clients/MailClient.d.ts +6 -0
- package/dist/clients/MailClient.d.ts.map +1 -1
- package/dist/clients/MarketClient.d.ts +13 -22
- package/dist/clients/MarketClient.d.ts.map +1 -1
- package/dist/clients/PiClient.d.ts +3 -0
- package/dist/clients/PiClient.d.ts.map +1 -1
- package/dist/clients/SkillsClient.d.ts +2 -0
- package/dist/clients/SkillsClient.d.ts.map +1 -1
- package/dist/clients/WalletClient.d.ts +1 -0
- package/dist/clients/WalletClient.d.ts.map +1 -1
- package/dist/clients/WarsClient.d.ts +3 -0
- package/dist/clients/WarsClient.d.ts.map +1 -1
- package/dist/config/jest/globalSetup.d.ts.map +1 -1
- package/dist/config/jest/globalTeardown.d.ts.map +1 -1
- package/dist/core/ApiClient.d.ts +14 -6
- package/dist/core/ApiClient.d.ts.map +1 -1
- package/dist/core/ApiRequestHandler.d.ts +3 -11
- package/dist/core/ApiRequestHandler.d.ts.map +1 -1
- package/dist/core/IDeduplicator.d.ts +6 -0
- package/dist/core/IDeduplicator.d.ts.map +1 -0
- package/dist/core/IRetryStrategy.d.ts +5 -0
- package/dist/core/IRetryStrategy.d.ts.map +1 -0
- package/dist/core/RequestDeduplicator.d.ts +2 -1
- package/dist/core/RequestDeduplicator.d.ts.map +1 -1
- package/dist/core/RetryStrategy.d.ts +19 -0
- package/dist/core/RetryStrategy.d.ts.map +1 -0
- package/dist/core/circuitBreaker/CircuitBreaker.d.ts +11 -1
- package/dist/core/circuitBreaker/CircuitBreaker.d.ts.map +1 -1
- package/dist/core/circuitBreaker/ICircuitBreaker.d.ts +23 -0
- package/dist/core/circuitBreaker/ICircuitBreaker.d.ts.map +1 -0
- package/dist/core/configureApiClient.d.ts +18 -0
- package/dist/core/configureApiClient.d.ts.map +1 -0
- package/dist/core/endpoints/EndpointDefinition.d.ts +2 -0
- package/dist/core/endpoints/EndpointDefinition.d.ts.map +1 -1
- package/dist/core/endpoints/calendarEndpoints.d.ts +1 -1
- package/dist/core/endpoints/characterEndpoints.d.ts +3 -3
- package/dist/core/endpoints/contactEndpoints.d.ts +7 -3
- package/dist/core/endpoints/contactEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/corporationEndpoints.d.ts +4 -1
- package/dist/core/endpoints/corporationEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/createClient.d.ts +18 -1
- package/dist/core/endpoints/createClient.d.ts.map +1 -1
- package/dist/core/endpoints/dogmaEndpoints.d.ts +17 -0
- package/dist/core/endpoints/dogmaEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/esi-scopes.generated.d.ts +1 -1
- package/dist/core/endpoints/esi-scopes.generated.d.ts.map +1 -1
- package/dist/core/endpoints/fleetEndpoints.d.ts +5 -0
- package/dist/core/endpoints/fleetEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/mailEndpoints.d.ts +13 -0
- package/dist/core/endpoints/mailEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/marketEndpoints.d.ts +29 -48
- package/dist/core/endpoints/marketEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/piEndpoints.d.ts +3 -0
- package/dist/core/endpoints/piEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/universeEndpoints.d.ts +13 -2
- package/dist/core/endpoints/universeEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/walletEndpoints.d.ts +4 -0
- package/dist/core/endpoints/walletEndpoints.d.ts.map +1 -1
- package/dist/core/logger/logger.d.ts +2 -1
- package/dist/core/logger/logger.d.ts.map +1 -1
- package/dist/core/pagination/AsyncPaginationIterator.d.ts +4 -1
- package/dist/core/pagination/AsyncPaginationIterator.d.ts.map +1 -1
- package/dist/core/pagination/CursorPaginationHandler.d.ts +15 -6
- package/dist/core/pagination/CursorPaginationHandler.d.ts.map +1 -1
- package/dist/core/pagination/PaginationHandler.d.ts +7 -6
- package/dist/core/pagination/PaginationHandler.d.ts.map +1 -1
- package/dist/core/rateLimiter/RateLimiter.d.ts +8 -2
- package/dist/core/rateLimiter/RateLimiter.d.ts.map +1 -1
- package/dist/core/requestPipeline/cachePolicy.d.ts +31 -0
- package/dist/core/requestPipeline/cachePolicy.d.ts.map +1 -0
- package/dist/core/requestPipeline/dependencies.d.ts +10 -0
- package/dist/core/requestPipeline/dependencies.d.ts.map +1 -0
- package/dist/core/requestPipeline/fetchExecution.d.ts +28 -0
- package/dist/core/requestPipeline/fetchExecution.d.ts.map +1 -0
- package/dist/core/requestPipeline/headers.d.ts +11 -0
- package/dist/core/requestPipeline/headers.d.ts.map +1 -0
- package/dist/core/requestPipeline/index.d.ts +10 -0
- package/dist/core/requestPipeline/index.d.ts.map +1 -0
- package/dist/core/requestPipeline/middlewareBridge.d.ts +15 -0
- package/dist/core/requestPipeline/middlewareBridge.d.ts.map +1 -0
- package/dist/core/requestPipeline/paginationOrchestration.d.ts +15 -0
- package/dist/core/requestPipeline/paginationOrchestration.d.ts.map +1 -0
- package/dist/core/requestPipeline/statusHandling.d.ts +18 -0
- package/dist/core/requestPipeline/statusHandling.d.ts.map +1 -0
- package/dist/core/util/error.d.ts +6 -1
- package/dist/core/util/error.d.ts.map +1 -1
- package/dist/errors.d.ts +4 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +196 -0
- package/dist/errors.js.map +1 -0
- package/dist/errors.mjs +146 -0
- package/dist/errors.mjs.map +1 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9937 -176
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +9834 -0
- package/dist/index.mjs.map +1 -0
- package/dist/schemas/calendar.d.ts +1 -1
- package/dist/schemas/character.d.ts +1 -10
- package/dist/schemas/character.d.ts.map +1 -1
- package/dist/schemas/common.d.ts +9 -0
- package/dist/schemas/common.d.ts.map +1 -1
- package/dist/schemas/contacts.d.ts +2 -1
- package/dist/schemas/contacts.d.ts.map +1 -1
- package/dist/schemas/corporation.d.ts +4 -9
- package/dist/schemas/corporation.d.ts.map +1 -1
- package/dist/schemas/dogma.d.ts +17 -0
- package/dist/schemas/dogma.d.ts.map +1 -1
- package/dist/schemas/fleet.d.ts +1 -0
- package/dist/schemas/fleet.d.ts.map +1 -1
- package/dist/schemas/index.js +2085 -46
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/index.mjs +1914 -0
- package/dist/schemas/index.mjs.map +1 -0
- package/dist/schemas/market.d.ts +91 -4
- package/dist/schemas/market.d.ts.map +1 -1
- package/dist/schemas/pi.d.ts +3 -0
- package/dist/schemas/pi.d.ts.map +1 -1
- package/dist/schemas/sovereignty.d.ts +2 -0
- package/dist/schemas/sovereignty.d.ts.map +1 -1
- package/dist/schemas/universe.d.ts +11 -2
- package/dist/schemas/universe.d.ts.map +1 -1
- package/dist/schemas/wallet.d.ts +2 -0
- package/dist/schemas/wallet.d.ts.map +1 -1
- package/dist/testing/TestDataFactory.d.ts.map +1 -1
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +935 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/index.mjs +898 -0
- package/dist/testing/index.mjs.map +1 -0
- package/dist/types/character.d.ts +2 -1
- package/dist/types/character.d.ts.map +1 -1
- package/dist/types/generated/esi-spec.generated.d.ts +3 -3
- package/dist/types/generated/esi-spec.generated.d.ts.map +1 -1
- package/dist/types/generated/spec-alignment.check.d.ts +9 -0
- package/dist/types/generated/spec-alignment.check.d.ts.map +1 -1
- package/dist/types/market.d.ts +7 -1
- package/dist/types/market.d.ts.map +1 -1
- package/package.json +33 -6
- package/dist/EsiClient.js +0 -251
- package/dist/EsiClientBuilder.js +0 -217
- package/dist/clients/AccessListsClient.js +0 -20
- package/dist/clients/AllianceClient.js +0 -72
- package/dist/clients/AssetsClient.js +0 -81
- package/dist/clients/BaseEsiClient.js +0 -40
- package/dist/clients/CalendarClient.js +0 -54
- package/dist/clients/CharacterClient.js +0 -149
- package/dist/clients/ClonesClient.js +0 -31
- package/dist/clients/ContactsClient.js +0 -104
- package/dist/clients/ContractsClient.js +0 -111
- package/dist/clients/CorporationsClient.js +0 -227
- package/dist/clients/DogmaClient.js +0 -55
- package/dist/clients/FactionClient.js +0 -79
- package/dist/clients/FittingsClient.js +0 -42
- package/dist/clients/FleetClient.js +0 -162
- package/dist/clients/FreelanceJobsClient.js +0 -76
- package/dist/clients/IncursionsClient.js +0 -19
- package/dist/clients/IndustryClient.js +0 -88
- package/dist/clients/InsuranceClient.js +0 -19
- package/dist/clients/KillmailsClient.js +0 -47
- package/dist/clients/LocationClient.js +0 -41
- package/dist/clients/LoyaltyClient.js +0 -30
- package/dist/clients/MailClient.js +0 -108
- package/dist/clients/MarketClient.js +0 -131
- package/dist/clients/MercenaryClient.js +0 -27
- package/dist/clients/MetaClient.js +0 -56
- package/dist/clients/PiClient.js +0 -51
- package/dist/clients/RouteClient.js +0 -24
- package/dist/clients/SearchClient.js +0 -22
- package/dist/clients/SkillsClient.js +0 -41
- package/dist/clients/SkyhooksClient.js +0 -35
- package/dist/clients/SovereigntyClient.js +0 -27
- package/dist/clients/StatusClient.js +0 -19
- package/dist/clients/UiClient.js +0 -58
- package/dist/clients/UniverseClient.js +0 -277
- package/dist/clients/WalletClient.js +0 -82
- package/dist/clients/WarsClient.js +0 -37
- package/dist/config/configManager.js +0 -47
- package/dist/config/jest/globalSetup.js +0 -7
- package/dist/config/jest/globalTeardown.js +0 -7
- package/dist/config/jest/jest.setup.js +0 -29
- package/dist/core/ApiClient.js +0 -123
- package/dist/core/ApiClientBuilder.js +0 -54
- package/dist/core/ApiRequestHandler.js +0 -444
- package/dist/core/BatchRequestHandler.js +0 -66
- package/dist/core/ClientRegistry.js +0 -116
- package/dist/core/EsiDiagnostics.js +0 -47
- package/dist/core/RequestDeduplicator.js +0 -26
- package/dist/core/cache/ETagCacheManager.js +0 -184
- package/dist/core/cache/ICache.js +0 -2
- package/dist/core/circuitBreaker/CircuitBreaker.js +0 -156
- package/dist/core/constants.js +0 -7
- package/dist/core/endpoints/EndpointDefinition.js +0 -2
- package/dist/core/endpoints/accessListEndpoints.js +0 -13
- package/dist/core/endpoints/allianceEndpoints.js +0 -34
- package/dist/core/endpoints/assetEndpoints.js +0 -51
- package/dist/core/endpoints/buildEndpointPath.js +0 -44
- package/dist/core/endpoints/calendarEndpoints.js +0 -35
- package/dist/core/endpoints/characterEndpoints.js +0 -104
- package/dist/core/endpoints/cloneEndpoints.js +0 -21
- package/dist/core/endpoints/contactEndpoints.js +0 -72
- package/dist/core/endpoints/contractEndpoints.js +0 -70
- package/dist/core/endpoints/corporationEndpoints.js +0 -161
- package/dist/core/endpoints/createClient.js +0 -175
- package/dist/core/endpoints/dogmaEndpoints.js +0 -40
- package/dist/core/endpoints/esi-cache-ttls.generated.js +0 -133
- package/dist/core/endpoints/esi-rate-limit-groups.generated.js +0 -153
- package/dist/core/endpoints/esi-scopes.generated.js +0 -135
- package/dist/core/endpoints/factionEndpoints.js +0 -57
- package/dist/core/endpoints/fittingEndpoints.js +0 -27
- package/dist/core/endpoints/fleetEndpoints.js +0 -101
- package/dist/core/endpoints/freelanceJobsEndpoints.js +0 -51
- package/dist/core/endpoints/incursionEndpoints.js +0 -13
- package/dist/core/endpoints/industryEndpoints.js +0 -61
- package/dist/core/endpoints/insuranceEndpoints.js +0 -13
- package/dist/core/endpoints/killmailEndpoints.js +0 -28
- package/dist/core/endpoints/locationEndpoints.js +0 -27
- package/dist/core/endpoints/loyaltyEndpoints.js +0 -21
- package/dist/core/endpoints/mailEndpoints.js +0 -68
- package/dist/core/endpoints/marketEndpoints.js +0 -84
- package/dist/core/endpoints/mercenaryEndpoints.js +0 -19
- package/dist/core/endpoints/metaEndpoints.js +0 -12
- package/dist/core/endpoints/piEndpoints.js +0 -36
- package/dist/core/endpoints/routeEndpoints.js +0 -14
- package/dist/core/endpoints/searchEndpoints.js +0 -14
- package/dist/core/endpoints/skillEndpoints.js +0 -29
- package/dist/core/endpoints/skyhookEndpoints.js +0 -25
- package/dist/core/endpoints/sovereigntyEndpoints.js +0 -19
- package/dist/core/endpoints/statusEndpoints.js +0 -12
- package/dist/core/endpoints/uiEndpoints.js +0 -39
- package/dist/core/endpoints/universeEndpoints.js +0 -210
- package/dist/core/endpoints/walletEndpoints.js +0 -50
- package/dist/core/endpoints/warEndpoints.js +0 -28
- package/dist/core/logger/ILogger.js +0 -2
- package/dist/core/logger/logger.js +0 -16
- package/dist/core/logger/loggerUtil.js +0 -30
- package/dist/core/middleware/Middleware.js +0 -42
- package/dist/core/pagination/AsyncPaginationIterator.js +0 -27
- package/dist/core/pagination/CursorPaginationHandler.js +0 -148
- package/dist/core/pagination/PaginationHandler.js +0 -115
- package/dist/core/rateLimiter/IRateLimiter.js +0 -2
- package/dist/core/rateLimiter/RateLimiter.js +0 -307
- package/dist/core/util/error.js +0 -122
- package/dist/core/util/headersUtil.js +0 -37
- package/dist/core/util/retry.js +0 -9
- package/dist/core/util/sleep.js +0 -6
- package/dist/core/util/stringUtil.js +0 -6
- package/dist/core/util/testHelpers.js +0 -9
- package/dist/core/util/validation.js +0 -52
- package/dist/schemas/access-lists.js +0 -14
- package/dist/schemas/alliance.js +0 -28
- package/dist/schemas/assets.js +0 -26
- package/dist/schemas/calendar.js +0 -43
- package/dist/schemas/character.js +0 -122
- package/dist/schemas/clones.js +0 -21
- package/dist/schemas/common.js +0 -34
- package/dist/schemas/contacts.js +0 -15
- package/dist/schemas/contracts.js +0 -58
- package/dist/schemas/corporation.js +0 -192
- package/dist/schemas/dogma.js +0 -42
- package/dist/schemas/faction-warfare.js +0 -92
- package/dist/schemas/fittings.js +0 -15
- package/dist/schemas/fleet.js +0 -48
- package/dist/schemas/freelance-jobs.js +0 -99
- package/dist/schemas/incursions.js +0 -14
- package/dist/schemas/industry.js +0 -75
- package/dist/schemas/insurance.js +0 -12
- package/dist/schemas/killmails.js +0 -42
- package/dist/schemas/location.js +0 -20
- package/dist/schemas/loyalty.js +0 -20
- package/dist/schemas/mail.js +0 -38
- package/dist/schemas/market.js +0 -39
- package/dist/schemas/mercenary.js +0 -22
- package/dist/schemas/pi.js +0 -85
- package/dist/schemas/skills.js +0 -30
- package/dist/schemas/skyhooks.js +0 -30
- package/dist/schemas/sovereignty.js +0 -70
- package/dist/schemas/status.js +0 -10
- package/dist/schemas/universe.js +0 -245
- package/dist/schemas/wallet.js +0 -29
- package/dist/schemas/wars.js +0 -31
- package/dist/testing/TestDataFactory.js +0 -823
- package/dist/types/access-lists.js +0 -2
- package/dist/types/alliance.js +0 -2
- package/dist/types/api-responses.js +0 -73
- package/dist/types/assets.js +0 -2
- package/dist/types/branded.js +0 -6
- package/dist/types/calendar.js +0 -2
- package/dist/types/character.js +0 -2
- package/dist/types/clones.js +0 -2
- package/dist/types/common.js +0 -2
- package/dist/types/contacts.js +0 -2
- package/dist/types/contracts.js +0 -2
- package/dist/types/corporation.js +0 -2
- package/dist/types/dogma.js +0 -2
- package/dist/types/faction-warfare.js +0 -2
- package/dist/types/fittings.js +0 -2
- package/dist/types/fleet.js +0 -2
- package/dist/types/freelance-jobs.js +0 -2
- package/dist/types/generated/esi-spec.generated.js +0 -6
- package/dist/types/generated/spec-alignment.check.js +0 -14
- package/dist/types/incursions.js +0 -2
- package/dist/types/industry.js +0 -2
- package/dist/types/insurance.js +0 -2
- package/dist/types/killmails.js +0 -2
- package/dist/types/location.js +0 -2
- package/dist/types/loyalty.js +0 -2
- package/dist/types/mail.js +0 -2
- package/dist/types/market.js +0 -2
- package/dist/types/mercenary.js +0 -2
- package/dist/types/pi.js +0 -2
- package/dist/types/skills.js +0 -2
- package/dist/types/skyhooks.js +0 -2
- package/dist/types/sovereignty.js +0 -2
- package/dist/types/status.js +0 -2
- package/dist/types/universe.js +0 -2
- package/dist/types/wallet.js +0 -2
- package/dist/types/wars.js +0 -2
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lgriffin/esi.ts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "This is a TypeScript Implementation for the EVE Online API offered through ESI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
6
7
|
"types": "dist/index.d.ts",
|
|
7
8
|
"type": "commonjs",
|
|
8
9
|
"engines": {
|
|
@@ -14,8 +15,24 @@
|
|
|
14
15
|
"exports": {
|
|
15
16
|
".": {
|
|
16
17
|
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.mjs",
|
|
17
19
|
"require": "./dist/index.js"
|
|
18
20
|
},
|
|
21
|
+
"./schemas": {
|
|
22
|
+
"types": "./dist/schemas/index.d.ts",
|
|
23
|
+
"import": "./dist/schemas/index.mjs",
|
|
24
|
+
"require": "./dist/schemas/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./errors": {
|
|
27
|
+
"types": "./dist/errors.d.ts",
|
|
28
|
+
"import": "./dist/errors.mjs",
|
|
29
|
+
"require": "./dist/errors.js"
|
|
30
|
+
},
|
|
31
|
+
"./testing": {
|
|
32
|
+
"types": "./dist/testing/index.d.ts",
|
|
33
|
+
"import": "./dist/testing/index.mjs",
|
|
34
|
+
"require": "./dist/testing/index.js"
|
|
35
|
+
},
|
|
19
36
|
"./package.json": "./package.json"
|
|
20
37
|
},
|
|
21
38
|
"files": [
|
|
@@ -25,7 +42,8 @@
|
|
|
25
42
|
"CHANGELOG.md"
|
|
26
43
|
],
|
|
27
44
|
"scripts": {
|
|
28
|
-
"build": "tsc",
|
|
45
|
+
"build": "tsup && tsc --emitDeclarationOnly",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
29
47
|
"start": "ts-node examples/character-profile.ts",
|
|
30
48
|
"example": "ts-node examples/character-profile.ts",
|
|
31
49
|
"example:status": "ts-node examples/status.ts",
|
|
@@ -111,6 +129,7 @@
|
|
|
111
129
|
"bdd:mercenary": "jest --config jest.unit.config.cjs --testPathPatterns=step-definitions/core/mercenary",
|
|
112
130
|
"bdd:access-lists": "jest --config jest.unit.config.cjs --testPathPatterns=step-definitions/core/access-lists",
|
|
113
131
|
"bdd:status": "jest --config jest.unit.config.cjs --testPathPatterns=step-definitions/core/status",
|
|
132
|
+
"bdd:resilience": "jest --config jest.unit.config.cjs --testPathPatterns=step-definitions/core/resilience",
|
|
114
133
|
"bdd:ui": "jest --config jest.unit.config.cjs --testPathPatterns=step-definitions/core/ui",
|
|
115
134
|
"bdd:universe": "jest --config jest.unit.config.cjs --testPathPatterns=step-definitions/core/universe",
|
|
116
135
|
"bdd:wallet": "jest --config jest.unit.config.cjs --testPathPatterns=step-definitions/core/wallet",
|
|
@@ -132,8 +151,12 @@
|
|
|
132
151
|
"mock:esi": "prism mock https://esi.evetech.net/meta/openapi.json -p 4010",
|
|
133
152
|
"test:types": "tsd --files 'tests/typetests/*.test-d.ts'",
|
|
134
153
|
"generate:types": "ts-node scripts/generate-esi-types.ts",
|
|
154
|
+
"generate:okf": "ts-node scripts/generate-okf.ts",
|
|
155
|
+
"generate:endpoints": "ts-node scripts/generate-endpoint-scaffold.ts",
|
|
156
|
+
"generate:all": "npm run generate:types && npm run generate:okf && npm run contract:snapshot && npm run schema:drift && npm run validate:esi",
|
|
135
157
|
"knip": "knip",
|
|
136
158
|
"validate:esi": "ts-node scripts/validate-esi-endpoints.ts",
|
|
159
|
+
"validate:auth-scopes": "ts-node scripts/validate-auth-scopes.ts",
|
|
137
160
|
"validate:spec": "redocly lint",
|
|
138
161
|
"validate": "npm run lint && npm run format:check && npm run build && npm run coverage && knip --no-exit-code",
|
|
139
162
|
"validate:versions": "ts-node scripts/validate-versions.ts",
|
|
@@ -211,16 +234,20 @@
|
|
|
211
234
|
"ts-jest": "^29.4.11",
|
|
212
235
|
"ts-node": "^10.9.2",
|
|
213
236
|
"tsd": "^0.33.0",
|
|
237
|
+
"tsup": "^8.5.1",
|
|
214
238
|
"typedoc": "^0.28.18",
|
|
215
239
|
"typescript": "^6.0.3",
|
|
216
|
-
"typescript-eslint": "^8.64.0"
|
|
240
|
+
"typescript-eslint": "^8.64.0",
|
|
241
|
+
"zod": "^4.4.3"
|
|
217
242
|
},
|
|
218
243
|
"dependencies": {
|
|
219
|
-
"
|
|
220
|
-
"zod": "^4.
|
|
244
|
+
"pino": "^9.6.0",
|
|
245
|
+
"zod": "^4.0.0"
|
|
221
246
|
},
|
|
222
247
|
"overrides": {
|
|
223
248
|
"lodash": "4.18.1",
|
|
224
|
-
"fast-xml-parser": ">=5.7.0"
|
|
249
|
+
"fast-xml-parser": ">=5.7.0",
|
|
250
|
+
"qs": ">=6.15.2",
|
|
251
|
+
"brace-expansion": ">=5.0.8"
|
|
225
252
|
}
|
|
226
253
|
}
|
package/dist/EsiClient.js
DELETED
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.EsiClient = void 0;
|
|
7
|
-
exports.getDefaultClient = getDefaultClient;
|
|
8
|
-
const ApiClient_1 = require("./core/ApiClient");
|
|
9
|
-
const ClientRegistry_1 = require("./core/ClientRegistry");
|
|
10
|
-
const validation_1 = require("./core/util/validation");
|
|
11
|
-
const ETagCacheManager_1 = require("./core/cache/ETagCacheManager");
|
|
12
|
-
const CircuitBreaker_1 = require("./core/circuitBreaker/CircuitBreaker");
|
|
13
|
-
const RateLimiter_1 = require("./core/rateLimiter/RateLimiter");
|
|
14
|
-
const RequestDeduplicator_1 = require("./core/RequestDeduplicator");
|
|
15
|
-
const EsiDiagnostics_1 = require("./core/EsiDiagnostics");
|
|
16
|
-
const BatchRequestHandler_1 = require("./core/BatchRequestHandler");
|
|
17
|
-
const logger_1 = __importDefault(require("./core/logger/logger"));
|
|
18
|
-
class EsiClient {
|
|
19
|
-
apiClient;
|
|
20
|
-
clients = new Map();
|
|
21
|
-
etagCacheEnabled;
|
|
22
|
-
_diagnostics = null;
|
|
23
|
-
deduplicator = null;
|
|
24
|
-
constructor(config) {
|
|
25
|
-
const token = config?.accessToken || process.env.ESI_ACCESS_TOKEN;
|
|
26
|
-
const baseUrl = (0, validation_1.validateBaseUrl)(config?.baseUrl || process.env.ESI_BASE_URL || 'https://esi.evetech.net', config?.unsafeAllowCustomHost);
|
|
27
|
-
this.apiClient = new ApiClient_1.ApiClient(config?.clientId || process.env.ESI_CLIENT_ID || 'esi-client', baseUrl, token);
|
|
28
|
-
const datasource = config?.datasource ||
|
|
29
|
-
process.env.ESI_DATASOURCE;
|
|
30
|
-
if (datasource) {
|
|
31
|
-
this.apiClient.setDatasource(datasource);
|
|
32
|
-
}
|
|
33
|
-
if (config?.language) {
|
|
34
|
-
this.apiClient.setLanguage(config.language);
|
|
35
|
-
}
|
|
36
|
-
if (config?.timeout !== undefined) {
|
|
37
|
-
this.apiClient.setTimeout(config.timeout);
|
|
38
|
-
}
|
|
39
|
-
if (config?.onTokenRefresh) {
|
|
40
|
-
this.apiClient.setTokenProvider(config.onTokenRefresh);
|
|
41
|
-
}
|
|
42
|
-
this.apiClient.setRateLimiter(new RateLimiter_1.RateLimiter(config?.rateLimiterConfig));
|
|
43
|
-
if (config?.enableRequestDeduplication !== false) {
|
|
44
|
-
this.deduplicator = new RequestDeduplicator_1.RequestDeduplicator();
|
|
45
|
-
this.apiClient.setDeduplicator(this.deduplicator);
|
|
46
|
-
}
|
|
47
|
-
this.etagCacheEnabled = config?.enableETagCache !== false;
|
|
48
|
-
if (this.etagCacheEnabled) {
|
|
49
|
-
this.apiClient.setCache(new ETagCacheManager_1.ETagCacheManager(config?.etagCacheConfig));
|
|
50
|
-
}
|
|
51
|
-
if (config?.enableCircuitBreaker) {
|
|
52
|
-
this.apiClient.setCircuitBreaker(new CircuitBreaker_1.CircuitBreaker(config.circuitBreakerConfig));
|
|
53
|
-
}
|
|
54
|
-
if (config?.retryConfig) {
|
|
55
|
-
this.apiClient.setRetryConfig(config.retryConfig);
|
|
56
|
-
}
|
|
57
|
-
else if (config?.retryAttempts !== undefined) {
|
|
58
|
-
this.apiClient.setRetryConfig({ maxRetries: config.retryAttempts });
|
|
59
|
-
}
|
|
60
|
-
if (config?.requestInterceptors) {
|
|
61
|
-
for (const interceptor of config.requestInterceptors) {
|
|
62
|
-
this.apiClient.addRequestInterceptor(interceptor);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
if (config?.responseInterceptors) {
|
|
66
|
-
for (const interceptor of config.responseInterceptors) {
|
|
67
|
-
this.apiClient.addResponseInterceptor(interceptor);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (config?.validateResponse !== undefined) {
|
|
71
|
-
this.apiClient.setValidateResponse(config.validateResponse);
|
|
72
|
-
}
|
|
73
|
-
logger_1.default.info('EsiClient initialized successfully');
|
|
74
|
-
}
|
|
75
|
-
getClient(name) {
|
|
76
|
-
if (!this.clients.has(name)) {
|
|
77
|
-
this.clients.set(name, (0, ClientRegistry_1.createClientInstance)(name, this.apiClient));
|
|
78
|
-
}
|
|
79
|
-
return this.clients.get(name);
|
|
80
|
-
}
|
|
81
|
-
// Domain client accessors
|
|
82
|
-
get alliance() {
|
|
83
|
-
return this.getClient('alliance');
|
|
84
|
-
}
|
|
85
|
-
get assets() {
|
|
86
|
-
return this.getClient('assets');
|
|
87
|
-
}
|
|
88
|
-
get calendar() {
|
|
89
|
-
return this.getClient('calendar');
|
|
90
|
-
}
|
|
91
|
-
get characters() {
|
|
92
|
-
return this.getClient('characters');
|
|
93
|
-
}
|
|
94
|
-
get clones() {
|
|
95
|
-
return this.getClient('clones');
|
|
96
|
-
}
|
|
97
|
-
get contacts() {
|
|
98
|
-
return this.getClient('contacts');
|
|
99
|
-
}
|
|
100
|
-
get contracts() {
|
|
101
|
-
return this.getClient('contracts');
|
|
102
|
-
}
|
|
103
|
-
get corporations() {
|
|
104
|
-
return this.getClient('corporations');
|
|
105
|
-
}
|
|
106
|
-
get dogma() {
|
|
107
|
-
return this.getClient('dogma');
|
|
108
|
-
}
|
|
109
|
-
get factions() {
|
|
110
|
-
return this.getClient('factions');
|
|
111
|
-
}
|
|
112
|
-
get fittings() {
|
|
113
|
-
return this.getClient('fittings');
|
|
114
|
-
}
|
|
115
|
-
get fleets() {
|
|
116
|
-
return this.getClient('fleets');
|
|
117
|
-
}
|
|
118
|
-
get incursions() {
|
|
119
|
-
return this.getClient('incursions');
|
|
120
|
-
}
|
|
121
|
-
get industry() {
|
|
122
|
-
return this.getClient('industry');
|
|
123
|
-
}
|
|
124
|
-
get insurance() {
|
|
125
|
-
return this.getClient('insurance');
|
|
126
|
-
}
|
|
127
|
-
get killmails() {
|
|
128
|
-
return this.getClient('killmails');
|
|
129
|
-
}
|
|
130
|
-
get location() {
|
|
131
|
-
return this.getClient('location');
|
|
132
|
-
}
|
|
133
|
-
get loyalty() {
|
|
134
|
-
return this.getClient('loyalty');
|
|
135
|
-
}
|
|
136
|
-
get mail() {
|
|
137
|
-
return this.getClient('mail');
|
|
138
|
-
}
|
|
139
|
-
get market() {
|
|
140
|
-
return this.getClient('market');
|
|
141
|
-
}
|
|
142
|
-
get pi() {
|
|
143
|
-
return this.getClient('pi');
|
|
144
|
-
}
|
|
145
|
-
get route() {
|
|
146
|
-
return this.getClient('route');
|
|
147
|
-
}
|
|
148
|
-
get search() {
|
|
149
|
-
return this.getClient('search');
|
|
150
|
-
}
|
|
151
|
-
get skills() {
|
|
152
|
-
return this.getClient('skills');
|
|
153
|
-
}
|
|
154
|
-
get sovereignty() {
|
|
155
|
-
return this.getClient('sovereignty');
|
|
156
|
-
}
|
|
157
|
-
get status() {
|
|
158
|
-
return this.getClient('status');
|
|
159
|
-
}
|
|
160
|
-
get ui() {
|
|
161
|
-
return this.getClient('ui');
|
|
162
|
-
}
|
|
163
|
-
get universe() {
|
|
164
|
-
return this.getClient('universe');
|
|
165
|
-
}
|
|
166
|
-
get wallet() {
|
|
167
|
-
return this.getClient('wallet');
|
|
168
|
-
}
|
|
169
|
-
get wars() {
|
|
170
|
-
return this.getClient('wars');
|
|
171
|
-
}
|
|
172
|
-
get meta() {
|
|
173
|
-
return this.getClient('meta');
|
|
174
|
-
}
|
|
175
|
-
get freelanceJobs() {
|
|
176
|
-
return this.getClient('freelanceJobs');
|
|
177
|
-
}
|
|
178
|
-
get skyhooks() {
|
|
179
|
-
return this.getClient('skyhooks');
|
|
180
|
-
}
|
|
181
|
-
get mercenary() {
|
|
182
|
-
return this.getClient('mercenary');
|
|
183
|
-
}
|
|
184
|
-
get accessLists() {
|
|
185
|
-
return this.getClient('accessLists');
|
|
186
|
-
}
|
|
187
|
-
addRequestInterceptor(fn) {
|
|
188
|
-
return this.apiClient.addRequestInterceptor(fn);
|
|
189
|
-
}
|
|
190
|
-
addResponseInterceptor(fn) {
|
|
191
|
-
return this.apiClient.addResponseInterceptor(fn);
|
|
192
|
-
}
|
|
193
|
-
setAccessToken(token) {
|
|
194
|
-
this.apiClient.setAccessToken(token);
|
|
195
|
-
logger_1.default.info('Access token updated');
|
|
196
|
-
}
|
|
197
|
-
setTokenProvider(provider) {
|
|
198
|
-
this.apiClient.setTokenProvider(provider);
|
|
199
|
-
logger_1.default.info(provider ? 'Token provider configured' : 'Token provider removed');
|
|
200
|
-
}
|
|
201
|
-
get diagnostics() {
|
|
202
|
-
if (!this._diagnostics) {
|
|
203
|
-
this._diagnostics = new EsiDiagnostics_1.EsiDiagnostics(this.apiClient, this.etagCacheEnabled, this.deduplicator);
|
|
204
|
-
}
|
|
205
|
-
return this._diagnostics;
|
|
206
|
-
}
|
|
207
|
-
getCacheStats() {
|
|
208
|
-
return this.diagnostics.getCacheStats();
|
|
209
|
-
}
|
|
210
|
-
clearCache() {
|
|
211
|
-
this.diagnostics.clearCache();
|
|
212
|
-
}
|
|
213
|
-
updateCacheConfig(newConfig) {
|
|
214
|
-
this.diagnostics.updateCacheConfig(newConfig);
|
|
215
|
-
}
|
|
216
|
-
getCircuitBreakerStats() {
|
|
217
|
-
return this.diagnostics.getCircuitBreakerStats();
|
|
218
|
-
}
|
|
219
|
-
resetCircuitBreaker(endpoint) {
|
|
220
|
-
this.diagnostics.resetCircuitBreaker(endpoint);
|
|
221
|
-
}
|
|
222
|
-
async batch(keys, fetcher, options) {
|
|
223
|
-
return (0, BatchRequestHandler_1.batchFetch)(keys, fetcher, options);
|
|
224
|
-
}
|
|
225
|
-
async batchPost(ids, poster, chunkSize) {
|
|
226
|
-
return (0, BatchRequestHandler_1.batchPost)(ids, poster, chunkSize);
|
|
227
|
-
}
|
|
228
|
-
shutdown() {
|
|
229
|
-
const cache = this.apiClient.getCache();
|
|
230
|
-
if (cache) {
|
|
231
|
-
cache.shutdown();
|
|
232
|
-
}
|
|
233
|
-
const cb = this.apiClient.getCircuitBreaker();
|
|
234
|
-
if (cb) {
|
|
235
|
-
cb.shutdown();
|
|
236
|
-
}
|
|
237
|
-
if (this.deduplicator) {
|
|
238
|
-
this.deduplicator.clear();
|
|
239
|
-
}
|
|
240
|
-
this.clients.clear();
|
|
241
|
-
logger_1.default.info('EsiClient shutdown completed');
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
exports.EsiClient = EsiClient;
|
|
245
|
-
let _defaultClient = null;
|
|
246
|
-
function getDefaultClient() {
|
|
247
|
-
if (!_defaultClient) {
|
|
248
|
-
_defaultClient = new EsiClient();
|
|
249
|
-
}
|
|
250
|
-
return _defaultClient;
|
|
251
|
-
}
|
package/dist/EsiClientBuilder.js
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.EsiClientBuilder = exports.EsiApiFactory = exports.CustomEsiClient = void 0;
|
|
7
|
-
const ApiClient_1 = require("./core/ApiClient");
|
|
8
|
-
const RateLimiter_1 = require("./core/rateLimiter/RateLimiter");
|
|
9
|
-
const validation_1 = require("./core/util/validation");
|
|
10
|
-
const ClientRegistry_1 = require("./core/ClientRegistry");
|
|
11
|
-
const logger_1 = __importDefault(require("./core/logger/logger"));
|
|
12
|
-
class CustomEsiClient {
|
|
13
|
-
apiClient;
|
|
14
|
-
clients = new Map();
|
|
15
|
-
enabledClients;
|
|
16
|
-
constructor(config) {
|
|
17
|
-
this.enabledClients = new Set(config.clients);
|
|
18
|
-
const baseUrl = (0, validation_1.validateBaseUrl)(config.baseUrl || process.env.ESI_BASE_URL || 'https://esi.evetech.net', config.unsafeAllowCustomHost);
|
|
19
|
-
this.apiClient = new ApiClient_1.ApiClient(config.clientId || process.env.ESI_CLIENT_ID || 'esi-custom-client', baseUrl, config.accessToken || process.env.ESI_ACCESS_TOKEN);
|
|
20
|
-
this.apiClient.setRateLimiter(new RateLimiter_1.RateLimiter());
|
|
21
|
-
for (const name of this.enabledClients) {
|
|
22
|
-
this.clients.set(name, (0, ClientRegistry_1.createClientInstance)(name, this.apiClient));
|
|
23
|
-
}
|
|
24
|
-
logger_1.default.info(`CustomEsiClient initialized with clients: ${config.clients.join(', ')}`);
|
|
25
|
-
}
|
|
26
|
-
getClient(clientType) {
|
|
27
|
-
return this.clients.get(clientType);
|
|
28
|
-
}
|
|
29
|
-
hasClient(clientType) {
|
|
30
|
-
return this.clients.has(clientType);
|
|
31
|
-
}
|
|
32
|
-
getEnabledClients() {
|
|
33
|
-
return Array.from(this.enabledClients);
|
|
34
|
-
}
|
|
35
|
-
get alliance() {
|
|
36
|
-
return this.getClient('alliance');
|
|
37
|
-
}
|
|
38
|
-
get assets() {
|
|
39
|
-
return this.getClient('assets');
|
|
40
|
-
}
|
|
41
|
-
get calendar() {
|
|
42
|
-
return this.getClient('calendar');
|
|
43
|
-
}
|
|
44
|
-
get characters() {
|
|
45
|
-
return this.getClient('characters');
|
|
46
|
-
}
|
|
47
|
-
get clones() {
|
|
48
|
-
return this.getClient('clones');
|
|
49
|
-
}
|
|
50
|
-
get contacts() {
|
|
51
|
-
return this.getClient('contacts');
|
|
52
|
-
}
|
|
53
|
-
get contracts() {
|
|
54
|
-
return this.getClient('contracts');
|
|
55
|
-
}
|
|
56
|
-
get corporations() {
|
|
57
|
-
return this.getClient('corporations');
|
|
58
|
-
}
|
|
59
|
-
get dogma() {
|
|
60
|
-
return this.getClient('dogma');
|
|
61
|
-
}
|
|
62
|
-
get factions() {
|
|
63
|
-
return this.getClient('factions');
|
|
64
|
-
}
|
|
65
|
-
get fittings() {
|
|
66
|
-
return this.getClient('fittings');
|
|
67
|
-
}
|
|
68
|
-
get fleets() {
|
|
69
|
-
return this.getClient('fleets');
|
|
70
|
-
}
|
|
71
|
-
get incursions() {
|
|
72
|
-
return this.getClient('incursions');
|
|
73
|
-
}
|
|
74
|
-
get industry() {
|
|
75
|
-
return this.getClient('industry');
|
|
76
|
-
}
|
|
77
|
-
get insurance() {
|
|
78
|
-
return this.getClient('insurance');
|
|
79
|
-
}
|
|
80
|
-
get killmails() {
|
|
81
|
-
return this.getClient('killmails');
|
|
82
|
-
}
|
|
83
|
-
get location() {
|
|
84
|
-
return this.getClient('location');
|
|
85
|
-
}
|
|
86
|
-
get loyalty() {
|
|
87
|
-
return this.getClient('loyalty');
|
|
88
|
-
}
|
|
89
|
-
get mail() {
|
|
90
|
-
return this.getClient('mail');
|
|
91
|
-
}
|
|
92
|
-
get market() {
|
|
93
|
-
return this.getClient('market');
|
|
94
|
-
}
|
|
95
|
-
get pi() {
|
|
96
|
-
return this.getClient('pi');
|
|
97
|
-
}
|
|
98
|
-
get route() {
|
|
99
|
-
return this.getClient('route');
|
|
100
|
-
}
|
|
101
|
-
get search() {
|
|
102
|
-
return this.getClient('search');
|
|
103
|
-
}
|
|
104
|
-
get skills() {
|
|
105
|
-
return this.getClient('skills');
|
|
106
|
-
}
|
|
107
|
-
get sovereignty() {
|
|
108
|
-
return this.getClient('sovereignty');
|
|
109
|
-
}
|
|
110
|
-
get status() {
|
|
111
|
-
return this.getClient('status');
|
|
112
|
-
}
|
|
113
|
-
get ui() {
|
|
114
|
-
return this.getClient('ui');
|
|
115
|
-
}
|
|
116
|
-
get universe() {
|
|
117
|
-
return this.getClient('universe');
|
|
118
|
-
}
|
|
119
|
-
get wallet() {
|
|
120
|
-
return this.getClient('wallet');
|
|
121
|
-
}
|
|
122
|
-
get wars() {
|
|
123
|
-
return this.getClient('wars');
|
|
124
|
-
}
|
|
125
|
-
get meta() {
|
|
126
|
-
return this.getClient('meta');
|
|
127
|
-
}
|
|
128
|
-
get freelanceJobs() {
|
|
129
|
-
return this.getClient('freelanceJobs');
|
|
130
|
-
}
|
|
131
|
-
get skyhooks() {
|
|
132
|
-
return this.getClient('skyhooks');
|
|
133
|
-
}
|
|
134
|
-
get mercenary() {
|
|
135
|
-
return this.getClient('mercenary');
|
|
136
|
-
}
|
|
137
|
-
get accessLists() {
|
|
138
|
-
return this.getClient('accessLists');
|
|
139
|
-
}
|
|
140
|
-
shutdown() {
|
|
141
|
-
this.clients.clear();
|
|
142
|
-
logger_1.default.info('CustomEsiClient shutdown completed');
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
exports.CustomEsiClient = CustomEsiClient;
|
|
146
|
-
class EsiApiFactory {
|
|
147
|
-
static createAllianceClient(config) {
|
|
148
|
-
return (0, ClientRegistry_1.createClientInstance)('alliance', this.buildApiClient(config));
|
|
149
|
-
}
|
|
150
|
-
static createCharacterClient(config) {
|
|
151
|
-
return (0, ClientRegistry_1.createClientInstance)('characters', this.buildApiClient(config));
|
|
152
|
-
}
|
|
153
|
-
static createCorporationClient(config) {
|
|
154
|
-
return (0, ClientRegistry_1.createClientInstance)('corporations', this.buildApiClient(config));
|
|
155
|
-
}
|
|
156
|
-
static createMarketClient(config) {
|
|
157
|
-
return (0, ClientRegistry_1.createClientInstance)('market', this.buildApiClient(config));
|
|
158
|
-
}
|
|
159
|
-
static createUniverseClient(config) {
|
|
160
|
-
return (0, ClientRegistry_1.createClientInstance)('universe', this.buildApiClient(config));
|
|
161
|
-
}
|
|
162
|
-
static createFleetClient(config) {
|
|
163
|
-
return (0, ClientRegistry_1.createClientInstance)('fleets', this.buildApiClient(config));
|
|
164
|
-
}
|
|
165
|
-
static createAssetsClient(config) {
|
|
166
|
-
return (0, ClientRegistry_1.createClientInstance)('assets', this.buildApiClient(config));
|
|
167
|
-
}
|
|
168
|
-
static createWalletClient(config) {
|
|
169
|
-
return (0, ClientRegistry_1.createClientInstance)('wallet', this.buildApiClient(config));
|
|
170
|
-
}
|
|
171
|
-
static createMailClient(config) {
|
|
172
|
-
return (0, ClientRegistry_1.createClientInstance)('mail', this.buildApiClient(config));
|
|
173
|
-
}
|
|
174
|
-
static createClient(clientType, config) {
|
|
175
|
-
return (0, ClientRegistry_1.createClientInstance)(clientType, this.buildApiClient(config));
|
|
176
|
-
}
|
|
177
|
-
static buildApiClient(config) {
|
|
178
|
-
const baseUrl = (0, validation_1.validateBaseUrl)(config?.baseUrl || process.env.ESI_BASE_URL || 'https://esi.evetech.net', config?.unsafeAllowCustomHost);
|
|
179
|
-
const client = new ApiClient_1.ApiClient(config?.clientId || process.env.ESI_CLIENT_ID || 'esi-standalone-client', baseUrl, config?.accessToken || process.env.ESI_ACCESS_TOKEN);
|
|
180
|
-
client.setRateLimiter(new RateLimiter_1.RateLimiter());
|
|
181
|
-
return client;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
exports.EsiApiFactory = EsiApiFactory;
|
|
185
|
-
class EsiClientBuilder {
|
|
186
|
-
clients = [];
|
|
187
|
-
config = {};
|
|
188
|
-
addClient(clientType) {
|
|
189
|
-
if (!this.clients.includes(clientType)) {
|
|
190
|
-
this.clients.push(clientType);
|
|
191
|
-
}
|
|
192
|
-
return this;
|
|
193
|
-
}
|
|
194
|
-
addClients(clientTypes) {
|
|
195
|
-
clientTypes.forEach((type) => this.addClient(type));
|
|
196
|
-
return this;
|
|
197
|
-
}
|
|
198
|
-
withConfig(config) {
|
|
199
|
-
this.config = { ...this.config, ...config };
|
|
200
|
-
return this;
|
|
201
|
-
}
|
|
202
|
-
withClientId(clientId) {
|
|
203
|
-
this.config.clientId = clientId;
|
|
204
|
-
return this;
|
|
205
|
-
}
|
|
206
|
-
withAccessToken(accessToken) {
|
|
207
|
-
this.config.accessToken = accessToken;
|
|
208
|
-
return this;
|
|
209
|
-
}
|
|
210
|
-
build() {
|
|
211
|
-
if (this.clients.length === 0) {
|
|
212
|
-
throw new Error('At least one client type must be specified');
|
|
213
|
-
}
|
|
214
|
-
return new CustomEsiClient({ ...this.config, clients: this.clients });
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
exports.EsiClientBuilder = EsiClientBuilder;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AccessListsClient = void 0;
|
|
4
|
-
const BaseEsiClient_1 = require("./BaseEsiClient");
|
|
5
|
-
const accessListEndpoints_1 = require("../core/endpoints/accessListEndpoints");
|
|
6
|
-
class AccessListsClient extends BaseEsiClient_1.BaseEsiClient {
|
|
7
|
-
constructor(client) {
|
|
8
|
-
super(client, accessListEndpoints_1.accessListEndpoints);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Retrieves the contents of an access list (ACL) including all character, corporation, and alliance entries.
|
|
12
|
-
*
|
|
13
|
-
* @param accessListId - The ID of the access list to retrieve
|
|
14
|
-
* @returns The access list with its entries
|
|
15
|
-
*/
|
|
16
|
-
getAccessList(accessListId) {
|
|
17
|
-
return this.api.getAccessList(accessListId);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.AccessListsClient = AccessListsClient;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AllianceClient = void 0;
|
|
4
|
-
const BaseEsiClient_1 = require("./BaseEsiClient");
|
|
5
|
-
const createClient_1 = require("../core/endpoints/createClient");
|
|
6
|
-
const allianceEndpoints_1 = require("../core/endpoints/allianceEndpoints");
|
|
7
|
-
const contactEndpoints_1 = require("../core/endpoints/contactEndpoints");
|
|
8
|
-
class AllianceClient extends BaseEsiClient_1.BaseEsiClient {
|
|
9
|
-
contactApi;
|
|
10
|
-
constructor(client) {
|
|
11
|
-
super(client, allianceEndpoints_1.allianceEndpoints);
|
|
12
|
-
this.contactApi = (0, createClient_1.createClient)(client, contactEndpoints_1.contactEndpoints);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Retrieve public information about an alliance.
|
|
16
|
-
*
|
|
17
|
-
* @param allianceId - The ID of the alliance to look up
|
|
18
|
-
* @returns Public alliance information including name, ticker, and founding date
|
|
19
|
-
*/
|
|
20
|
-
getAllianceById(allianceId) {
|
|
21
|
-
return this.api.getAllianceById(allianceId);
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Retrieve contacts for an alliance.
|
|
25
|
-
*
|
|
26
|
-
* @deprecated Use ContactsClient.getAllianceContacts() instead
|
|
27
|
-
* @param allianceId - The ID of the alliance whose contacts to retrieve
|
|
28
|
-
* @returns A list of alliance contacts with standings and contact types
|
|
29
|
-
* @requires Authentication
|
|
30
|
-
*/
|
|
31
|
-
getContacts(allianceId) {
|
|
32
|
-
return this.contactApi.getAllianceContacts(allianceId);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Retrieve custom contact labels for an alliance.
|
|
36
|
-
*
|
|
37
|
-
* @deprecated Use ContactsClient.getAllianceContactLabels() instead
|
|
38
|
-
* @param allianceId - The ID of the alliance whose contact labels to retrieve
|
|
39
|
-
* @returns A list of custom labels used to categorize alliance contacts
|
|
40
|
-
* @requires Authentication
|
|
41
|
-
*/
|
|
42
|
-
getContactLabels(allianceId) {
|
|
43
|
-
return this.contactApi.getAllianceContactLabels(allianceId);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Retrieve the list of corporation IDs that are members of an alliance.
|
|
47
|
-
*
|
|
48
|
-
* @param allianceId - The ID of the alliance whose member corporations to retrieve
|
|
49
|
-
* @returns An array of corporation IDs belonging to the alliance
|
|
50
|
-
*/
|
|
51
|
-
getCorporations(allianceId) {
|
|
52
|
-
return this.api.getCorporations(allianceId);
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Retrieve icon URLs for an alliance.
|
|
56
|
-
*
|
|
57
|
-
* @param allianceId - The ID of the alliance whose icons to retrieve
|
|
58
|
-
* @returns Icon URLs at various resolutions for the alliance
|
|
59
|
-
*/
|
|
60
|
-
getIcons(allianceId) {
|
|
61
|
-
return this.api.getIcons(allianceId);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Retrieve a list of all active alliance IDs in EVE Online.
|
|
65
|
-
*
|
|
66
|
-
* @returns An array of all active alliance IDs
|
|
67
|
-
*/
|
|
68
|
-
getAlliances() {
|
|
69
|
-
return this.api.getAlliances();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
exports.AllianceClient = AllianceClient;
|