@lgriffin/esi.ts 7.4.0 → 8.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/LICENSE +26 -26
- package/README.md +967 -910
- 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/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 +6 -2
- package/dist/core/pagination/CursorPaginationHandler.d.ts.map +1 -1
- package/dist/core/pagination/PaginationHandler.d.ts +1 -1
- 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 +30 -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 +4 -1
- package/dist/core/util/error.d.ts.map +1 -1
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9926 -176
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +9824 -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/generated/alliance.generated.d.ts +15 -0
- package/dist/schemas/generated/alliance.generated.d.ts.map +1 -0
- package/dist/schemas/generated/assets.generated.d.ts +272 -0
- package/dist/schemas/generated/assets.generated.d.ts.map +1 -0
- package/dist/schemas/generated/calendar.generated.d.ts +41 -0
- package/dist/schemas/generated/calendar.generated.d.ts.map +1 -0
- package/dist/schemas/generated/character.generated.d.ts +670 -0
- package/dist/schemas/generated/character.generated.d.ts.map +1 -0
- package/dist/schemas/generated/clones.generated.d.ts +23 -0
- package/dist/schemas/generated/clones.generated.d.ts.map +1 -0
- package/dist/schemas/generated/contacts.generated.d.ts +50 -0
- package/dist/schemas/generated/contacts.generated.d.ts.map +1 -0
- package/dist/schemas/generated/contracts.generated.d.ts +162 -0
- package/dist/schemas/generated/contracts.generated.d.ts.map +1 -0
- package/dist/schemas/generated/corporation-projects.generated.d.ts +89 -0
- package/dist/schemas/generated/corporation-projects.generated.d.ts.map +1 -0
- package/dist/schemas/generated/corporation.generated.d.ts +1515 -0
- package/dist/schemas/generated/corporation.generated.d.ts.map +1 -0
- package/dist/schemas/generated/dogma.generated.d.ts +57 -0
- package/dist/schemas/generated/dogma.generated.d.ts.map +1 -0
- package/dist/schemas/generated/faction-warfare.generated.d.ts +155 -0
- package/dist/schemas/generated/faction-warfare.generated.d.ts.map +1 -0
- package/dist/schemas/generated/fittings.generated.d.ts +57 -0
- package/dist/schemas/generated/fittings.generated.d.ts.map +1 -0
- package/dist/schemas/generated/fleets.generated.d.ts +45 -0
- package/dist/schemas/generated/fleets.generated.d.ts.map +1 -0
- package/dist/schemas/generated/freelance-jobs.generated.d.ts +173 -0
- package/dist/schemas/generated/freelance-jobs.generated.d.ts.map +1 -0
- package/dist/schemas/generated/incursions.generated.d.ts +16 -0
- package/dist/schemas/generated/incursions.generated.d.ts.map +1 -0
- package/dist/schemas/generated/index.d.ts +33 -0
- package/dist/schemas/generated/index.d.ts.map +1 -0
- package/dist/schemas/generated/industry.generated.d.ts +117 -0
- package/dist/schemas/generated/industry.generated.d.ts.map +1 -0
- package/dist/schemas/generated/insurance.generated.d.ts +10 -0
- package/dist/schemas/generated/insurance.generated.d.ts.map +1 -0
- package/dist/schemas/generated/killmails.generated.d.ts +55 -0
- package/dist/schemas/generated/killmails.generated.d.ts.map +1 -0
- package/dist/schemas/generated/location.generated.d.ts +18 -0
- package/dist/schemas/generated/location.generated.d.ts.map +1 -0
- package/dist/schemas/generated/loyalty.generated.d.ts +18 -0
- package/dist/schemas/generated/loyalty.generated.d.ts.map +1 -0
- package/dist/schemas/generated/mail.generated.d.ts +68 -0
- package/dist/schemas/generated/mail.generated.d.ts.map +1 -0
- package/dist/schemas/generated/market.generated.d.ts +201 -0
- package/dist/schemas/generated/market.generated.d.ts.map +1 -0
- package/dist/schemas/generated/meta.generated.d.ts +26 -0
- package/dist/schemas/generated/meta.generated.d.ts.map +1 -0
- package/dist/schemas/generated/planetary-interaction.generated.d.ts +90 -0
- package/dist/schemas/generated/planetary-interaction.generated.d.ts.map +1 -0
- package/dist/schemas/generated/routes.generated.d.ts +5 -0
- package/dist/schemas/generated/routes.generated.d.ts.map +1 -0
- package/dist/schemas/generated/search.generated.d.ts +15 -0
- package/dist/schemas/generated/search.generated.d.ts.map +1 -0
- package/dist/schemas/generated/skills.generated.d.ts +32 -0
- package/dist/schemas/generated/skills.generated.d.ts.map +1 -0
- package/dist/schemas/generated/sovereignty.generated.d.ts +37 -0
- package/dist/schemas/generated/sovereignty.generated.d.ts.map +1 -0
- package/dist/schemas/generated/status.generated.d.ts +8 -0
- package/dist/schemas/generated/status.generated.d.ts.map +1 -0
- package/dist/schemas/generated/universe.generated.d.ts +394 -0
- package/dist/schemas/generated/universe.generated.d.ts.map +1 -0
- package/dist/schemas/generated/wallet.generated.d.ts +411 -0
- package/dist/schemas/generated/wallet.generated.d.ts.map +1 -0
- package/dist/schemas/generated/wars.generated.d.ts +31 -0
- package/dist/schemas/generated/wars.generated.d.ts.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/types/character.d.ts +2 -1
- package/dist/types/character.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 +235 -226
- 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/index.js +0 -48
- 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
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UniverseClient = void 0;
|
|
4
|
-
const BaseEsiClient_1 = require("./BaseEsiClient");
|
|
5
|
-
const universeEndpoints_1 = require("../core/endpoints/universeEndpoints");
|
|
6
|
-
class UniverseClient extends BaseEsiClient_1.BaseEsiClient {
|
|
7
|
-
constructor(client) {
|
|
8
|
-
super(client, universeEndpoints_1.universeEndpoints);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Retrieves all available character ancestries for character creation.
|
|
12
|
-
*
|
|
13
|
-
* @returns A list of character ancestries
|
|
14
|
-
*/
|
|
15
|
-
getAncestries() {
|
|
16
|
-
return this.api.getAncestries();
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Retrieves information about an asteroid belt, including its position in space.
|
|
20
|
-
*
|
|
21
|
-
* @param asteroidBeltId - The ID of the asteroid belt
|
|
22
|
-
* @returns Details about the asteroid belt
|
|
23
|
-
*/
|
|
24
|
-
getAsteroidBeltInfo(asteroidBeltId) {
|
|
25
|
-
return this.api.getAsteroidBeltInfo(asteroidBeltId);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Retrieves all available character bloodlines for character creation.
|
|
29
|
-
*
|
|
30
|
-
* @returns A list of character bloodlines
|
|
31
|
-
*/
|
|
32
|
-
getBloodlines() {
|
|
33
|
-
return this.api.getBloodlines();
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Retrieves information about a constellation, including its systems and position.
|
|
37
|
-
*
|
|
38
|
-
* @param constellationId - The ID of the constellation
|
|
39
|
-
* @returns Detailed constellation information
|
|
40
|
-
*/
|
|
41
|
-
getConstellationById(constellationId) {
|
|
42
|
-
return this.api.getConstellationById(constellationId);
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Retrieves a list of all constellation IDs in the EVE universe.
|
|
46
|
-
*
|
|
47
|
-
* @returns A list of constellation IDs
|
|
48
|
-
*/
|
|
49
|
-
getConstellations() {
|
|
50
|
-
return this.api.getConstellations();
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Retrieves all NPC factions in the EVE universe.
|
|
54
|
-
*
|
|
55
|
-
* @returns A list of NPC factions
|
|
56
|
-
*/
|
|
57
|
-
getFactions() {
|
|
58
|
-
return this.api.getFactions();
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Retrieves information about a specific graphic asset used in the EVE client.
|
|
62
|
-
*
|
|
63
|
-
* @param graphicId - The ID of the graphic
|
|
64
|
-
* @returns Detailed graphic information
|
|
65
|
-
*/
|
|
66
|
-
getGraphicById(graphicId) {
|
|
67
|
-
return this.api.getGraphicById(graphicId);
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Retrieves a list of all graphic asset IDs.
|
|
71
|
-
*
|
|
72
|
-
* @returns A list of graphic IDs
|
|
73
|
-
*/
|
|
74
|
-
getGraphics() {
|
|
75
|
-
return this.api.getGraphics();
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Retrieves a list of all item category IDs in the EVE universe.
|
|
79
|
-
*
|
|
80
|
-
* @returns A list of item category IDs
|
|
81
|
-
*/
|
|
82
|
-
getItemCategories() {
|
|
83
|
-
return this.api.getCategories();
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Retrieves information about a specific item category, including its groups.
|
|
87
|
-
*
|
|
88
|
-
* @param categoryId - The ID of the item category
|
|
89
|
-
* @returns Detailed item category information
|
|
90
|
-
*/
|
|
91
|
-
getItemCategoryById(categoryId) {
|
|
92
|
-
return this.api.getCategoryById(categoryId);
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Retrieves information about a specific item group, including its types.
|
|
96
|
-
*
|
|
97
|
-
* @param groupId - The ID of the item group
|
|
98
|
-
* @returns Detailed item group information
|
|
99
|
-
*/
|
|
100
|
-
getItemGroupById(groupId) {
|
|
101
|
-
return this.api.getItemGroupById(groupId);
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Retrieves a list of all item group IDs in the EVE universe.
|
|
105
|
-
*
|
|
106
|
-
* @returns A list of item group IDs
|
|
107
|
-
*/
|
|
108
|
-
getItemGroups() {
|
|
109
|
-
return this.api.getItemGroups();
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Retrieves information about a moon, including its name and position.
|
|
113
|
-
*
|
|
114
|
-
* @param moonId - The ID of the moon
|
|
115
|
-
* @returns Detailed moon information
|
|
116
|
-
*/
|
|
117
|
-
getMoonById(moonId) {
|
|
118
|
-
return this.api.getMoonById(moonId);
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Retrieves information about a planet, including its name, type, and position.
|
|
122
|
-
*
|
|
123
|
-
* @param planetId - The ID of the planet
|
|
124
|
-
* @returns Detailed planet information
|
|
125
|
-
*/
|
|
126
|
-
getPlanetById(planetId) {
|
|
127
|
-
return this.api.getPlanetById(planetId);
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Retrieves all playable races in the EVE universe.
|
|
131
|
-
*
|
|
132
|
-
* @returns A list of playable races
|
|
133
|
-
*/
|
|
134
|
-
getRaces() {
|
|
135
|
-
return this.api.getRaces();
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Retrieves information about a region, including its constellations and name.
|
|
139
|
-
*
|
|
140
|
-
* @param regionId - The ID of the region
|
|
141
|
-
* @returns Detailed region information
|
|
142
|
-
*/
|
|
143
|
-
getRegionById(regionId) {
|
|
144
|
-
return this.api.getRegionById(regionId);
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Retrieves information about a star, including its spectral class and luminosity.
|
|
148
|
-
*
|
|
149
|
-
* @param starId - The ID of the star
|
|
150
|
-
* @returns Detailed star information
|
|
151
|
-
*/
|
|
152
|
-
getStarById(starId) {
|
|
153
|
-
return this.api.getStarById(starId);
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Retrieves information about a stargate, including its destination and position.
|
|
157
|
-
*
|
|
158
|
-
* @param stargateId - The ID of the stargate
|
|
159
|
-
* @returns Detailed stargate information
|
|
160
|
-
*/
|
|
161
|
-
getStargateById(stargateId) {
|
|
162
|
-
return this.api.getStargateById(stargateId);
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Retrieves public information about a station, including its services and location.
|
|
166
|
-
*
|
|
167
|
-
* @param stationId - The ID of the station
|
|
168
|
-
* @returns Detailed station information
|
|
169
|
-
*/
|
|
170
|
-
getStationById(stationId) {
|
|
171
|
-
return this.api.getStationById(stationId);
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Retrieves information about a player-owned structure by its ID.
|
|
175
|
-
*
|
|
176
|
-
* @param structureId - The ID of the structure
|
|
177
|
-
* @returns Detailed structure information
|
|
178
|
-
* @requires Authentication
|
|
179
|
-
*/
|
|
180
|
-
getStructureById(structureId) {
|
|
181
|
-
return this.api.getStructureById(structureId);
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Retrieves a list of all publicly visible player-owned structure IDs.
|
|
185
|
-
*
|
|
186
|
-
* @returns A list of structure IDs
|
|
187
|
-
*/
|
|
188
|
-
getStructures() {
|
|
189
|
-
return this.api.getStructures();
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Retrieves information about a solar system, including its planets, stargates, and security status.
|
|
193
|
-
*
|
|
194
|
-
* @param systemId - The ID of the solar system
|
|
195
|
-
* @returns Detailed solar system information
|
|
196
|
-
*/
|
|
197
|
-
getSystemById(systemId) {
|
|
198
|
-
return this.api.getSystemById(systemId);
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Retrieves the number of ship jumps per solar system within the last hour.
|
|
202
|
-
*
|
|
203
|
-
* @returns A list of solar systems with their jump counts
|
|
204
|
-
*/
|
|
205
|
-
getSystemJumps() {
|
|
206
|
-
return this.api.getSystemJumps();
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Retrieves the number of NPC and player ship kills per solar system within the last hour.
|
|
210
|
-
*
|
|
211
|
-
* @returns A list of solar systems with their kill counts
|
|
212
|
-
*/
|
|
213
|
-
getSystemKills() {
|
|
214
|
-
return this.api.getSystemKills();
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Retrieves a list of all solar system IDs in the EVE universe.
|
|
218
|
-
*
|
|
219
|
-
* @returns A list of solar system IDs
|
|
220
|
-
*/
|
|
221
|
-
getSystems() {
|
|
222
|
-
return this.api.getSystems();
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Retrieves information about a specific item type, including its description and attributes.
|
|
226
|
-
*
|
|
227
|
-
* @param typeId - The ID of the item type
|
|
228
|
-
* @returns Detailed item type information
|
|
229
|
-
*/
|
|
230
|
-
getTypeById(typeId) {
|
|
231
|
-
return this.api.getTypeById(typeId);
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Retrieves a list of all item type IDs in the EVE universe.
|
|
235
|
-
*
|
|
236
|
-
* @returns A list of item type IDs
|
|
237
|
-
*/
|
|
238
|
-
getTypes() {
|
|
239
|
-
return this.api.getTypes();
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Resolves a list of names to their corresponding IDs via a bulk POST operation.
|
|
243
|
-
*
|
|
244
|
-
* @param names - An array of names to resolve to IDs
|
|
245
|
-
* @returns The resolved IDs grouped by entity category
|
|
246
|
-
*/
|
|
247
|
-
postBulkNamesToIds(names) {
|
|
248
|
-
return this.api.postBulkNamesToIds(names);
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Resolves a list of IDs to their names and categories via a bulk POST operation.
|
|
252
|
-
*
|
|
253
|
-
* @param ids - An array of entity IDs to resolve
|
|
254
|
-
* @returns A list of names with their corresponding categories
|
|
255
|
-
*/
|
|
256
|
-
postNamesAndCategories(ids) {
|
|
257
|
-
return this.api.postNamesAndCategories(ids);
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Retrieves information about a planetary interaction schematic.
|
|
261
|
-
*
|
|
262
|
-
* @param schematicId - The ID of the PI schematic
|
|
263
|
-
* @returns Detailed schematic information including inputs and outputs
|
|
264
|
-
*/
|
|
265
|
-
getSchematicById(schematicId) {
|
|
266
|
-
return this.api.getSchematicById(schematicId);
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Retrieves a list of all region IDs in the EVE universe.
|
|
270
|
-
*
|
|
271
|
-
* @returns A list of region IDs
|
|
272
|
-
*/
|
|
273
|
-
getRegions() {
|
|
274
|
-
return this.api.getRegions();
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
exports.UniverseClient = UniverseClient;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WalletClient = void 0;
|
|
4
|
-
const BaseEsiClient_1 = require("./BaseEsiClient");
|
|
5
|
-
const walletEndpoints_1 = require("../core/endpoints/walletEndpoints");
|
|
6
|
-
class WalletClient extends BaseEsiClient_1.BaseEsiClient {
|
|
7
|
-
constructor(client) {
|
|
8
|
-
super(client, walletEndpoints_1.walletEndpoints);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Retrieves the current ISK balance of a character's wallet.
|
|
12
|
-
*
|
|
13
|
-
* @param characterId - The ID of the character
|
|
14
|
-
* @returns The character's wallet balance in ISK
|
|
15
|
-
* @requires Authentication
|
|
16
|
-
*/
|
|
17
|
-
getCharacterWallet(characterId) {
|
|
18
|
-
return this.api.getCharacterWallet(characterId);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Retrieves the wallet journal entries for a character, showing ISK transactions and their reasons.
|
|
22
|
-
*
|
|
23
|
-
* @param characterId - The ID of the character
|
|
24
|
-
* @returns A list of wallet journal entries
|
|
25
|
-
* @requires Authentication
|
|
26
|
-
*/
|
|
27
|
-
getCharacterWalletJournal(characterId) {
|
|
28
|
-
return this.api.getCharacterWalletJournal(characterId);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Retrieves the market transaction history for a character's wallet.
|
|
32
|
-
*
|
|
33
|
-
* @param characterId - The ID of the character
|
|
34
|
-
* @returns A list of market buy and sell transactions
|
|
35
|
-
* @requires Authentication
|
|
36
|
-
*/
|
|
37
|
-
getCharacterWalletTransactions(characterId) {
|
|
38
|
-
return this.api.getCharacterWalletTransactions(characterId);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Retrieves the balances for all wallet divisions of a corporation.
|
|
42
|
-
*
|
|
43
|
-
* @param corporationId - The ID of the corporation
|
|
44
|
-
* @returns A list of wallet divisions with their balances
|
|
45
|
-
* @requires Authentication
|
|
46
|
-
*/
|
|
47
|
-
getCorporationWallets(corporationId) {
|
|
48
|
-
return this.api.getCorporationWallets(corporationId);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Retrieves the wallet journal entries for a specific division of a corporation wallet.
|
|
52
|
-
*
|
|
53
|
-
* @param corporationId - The ID of the corporation
|
|
54
|
-
* @param division - The wallet division number (1-7)
|
|
55
|
-
* @returns A list of wallet journal entries for the specified division
|
|
56
|
-
* @requires Authentication
|
|
57
|
-
*/
|
|
58
|
-
getCorporationWalletJournal(corporationId, division) {
|
|
59
|
-
return this.api.getCorporationWalletJournal(corporationId, division);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Retrieves the market transaction history for a specific division of a corporation wallet.
|
|
63
|
-
*
|
|
64
|
-
* @param corporationId - The ID of the corporation
|
|
65
|
-
* @param division - The wallet division number (1-7)
|
|
66
|
-
* @returns A list of market buy and sell transactions for the specified division
|
|
67
|
-
* @requires Authentication
|
|
68
|
-
*/
|
|
69
|
-
getCorporationWalletTransactions(corporationId, division) {
|
|
70
|
-
return this.api.getCorporationWalletTransactions(corporationId, division);
|
|
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
|
-
}
|
|
81
|
-
}
|
|
82
|
-
exports.WalletClient = WalletClient;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WarsClient = void 0;
|
|
4
|
-
const BaseEsiClient_1 = require("./BaseEsiClient");
|
|
5
|
-
const warEndpoints_1 = require("../core/endpoints/warEndpoints");
|
|
6
|
-
class WarsClient extends BaseEsiClient_1.BaseEsiClient {
|
|
7
|
-
constructor(client) {
|
|
8
|
-
super(client, warEndpoints_1.warEndpoints);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Retrieves a list of all war IDs, ordered by war ID descending.
|
|
12
|
-
*
|
|
13
|
-
* @returns A list of war IDs
|
|
14
|
-
*/
|
|
15
|
-
getWars() {
|
|
16
|
-
return this.api.getWars();
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Retrieves detailed information about a specific war, including aggressors, defenders, and status.
|
|
20
|
-
*
|
|
21
|
-
* @param warId - The ID of the war
|
|
22
|
-
* @returns Detailed war information
|
|
23
|
-
*/
|
|
24
|
-
getWarById(warId) {
|
|
25
|
-
return this.api.getWarById(warId);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Retrieves the killmail summaries associated with a specific war.
|
|
29
|
-
*
|
|
30
|
-
* @param warId - The ID of the war
|
|
31
|
-
* @returns A list of killmail summaries for the war
|
|
32
|
-
*/
|
|
33
|
-
getWarKillmails(warId) {
|
|
34
|
-
return this.api.getWarKillmails(warId);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.WarsClient = WarsClient;
|
|
@@ -1,47 +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.getConfig = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
let config;
|
|
10
|
-
// Cross-platform way to get __dirname that works in both CommonJS and ES modules.
|
|
11
|
-
// In CommonJS (the default for this project), __dirname is always available.
|
|
12
|
-
// The fallback avoids process.cwd() which would point to the consuming project,
|
|
13
|
-
// not the ESI.ts package directory.
|
|
14
|
-
const getDirname = () => {
|
|
15
|
-
if (typeof __dirname !== 'undefined') {
|
|
16
|
-
return __dirname;
|
|
17
|
-
}
|
|
18
|
-
// Fallback: resolve this module's own location via require.resolve.
|
|
19
|
-
// This works when require() is available but __dirname is not (e.g. bundled CommonJS).
|
|
20
|
-
try {
|
|
21
|
-
return path_1.default.dirname(require.resolve('./configManager'));
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
throw new Error('Unable to determine config directory: __dirname is not available and ' +
|
|
25
|
-
'require.resolve failed. Ensure ESI.ts is used in a CommonJS environment.');
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const loadConfig = () => {
|
|
29
|
-
const __dirname = getDirname();
|
|
30
|
-
const configPath = path_1.default.join(__dirname, 'esi.json');
|
|
31
|
-
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
32
|
-
if (fs_1.default.existsSync(configPath)) {
|
|
33
|
-
// eslint-disable-next-line security/detect-non-literal-fs-filename
|
|
34
|
-
const configFile = fs_1.default.readFileSync(configPath, 'utf8');
|
|
35
|
-
config = JSON.parse(configFile);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
throw new Error('Configuration file not found');
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const getConfig = () => {
|
|
42
|
-
if (!config) {
|
|
43
|
-
loadConfig();
|
|
44
|
-
}
|
|
45
|
-
return config;
|
|
46
|
-
};
|
|
47
|
-
exports.getConfig = getConfig;
|
|
@@ -1,29 +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.getClient = void 0;
|
|
7
|
-
const ApiClientBuilder_1 = require("../../core/ApiClientBuilder");
|
|
8
|
-
const RateLimiter_1 = require("../../core/rateLimiter/RateLimiter");
|
|
9
|
-
const configManager_1 = require("../../config/configManager");
|
|
10
|
-
const jest_fetch_mock_1 = __importDefault(require("jest-fetch-mock"));
|
|
11
|
-
const testHelpers_1 = require("../../../src/core/util/testHelpers");
|
|
12
|
-
require("../../../types/global.d.ts");
|
|
13
|
-
jest_fetch_mock_1.default.enableMocks();
|
|
14
|
-
const config = (0, configManager_1.getConfig)();
|
|
15
|
-
const rateLimiter = new RateLimiter_1.RateLimiter();
|
|
16
|
-
rateLimiter.setTestMode(true);
|
|
17
|
-
const client = new ApiClientBuilder_1.ApiClientBuilder()
|
|
18
|
-
.setClientId(config.projectName)
|
|
19
|
-
.setLink(config.link)
|
|
20
|
-
.setAccessToken(process.env.ESI_ACCESS_TOKEN || 'test-token')
|
|
21
|
-
.setRateLimiter(rateLimiter)
|
|
22
|
-
.build();
|
|
23
|
-
const getClient = () => client;
|
|
24
|
-
exports.getClient = getClient;
|
|
25
|
-
beforeEach(() => {
|
|
26
|
-
jest_fetch_mock_1.default.resetMocks();
|
|
27
|
-
rateLimiter.reset();
|
|
28
|
-
});
|
|
29
|
-
global.getBody = testHelpers_1.getBody;
|
package/dist/core/ApiClient.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApiClient = void 0;
|
|
4
|
-
const Middleware_1 = require("./middleware/Middleware");
|
|
5
|
-
class ApiClient {
|
|
6
|
-
clientId;
|
|
7
|
-
link;
|
|
8
|
-
accessToken;
|
|
9
|
-
datasource;
|
|
10
|
-
tokenProvider;
|
|
11
|
-
refreshInFlight;
|
|
12
|
-
middleware = new Middleware_1.MiddlewareManager();
|
|
13
|
-
cache = null;
|
|
14
|
-
rateLimiter = null;
|
|
15
|
-
circuitBreaker = null;
|
|
16
|
-
timeout = 30_000;
|
|
17
|
-
deduplicator = null;
|
|
18
|
-
retryConfig = null;
|
|
19
|
-
validateResponse = true;
|
|
20
|
-
language;
|
|
21
|
-
constructor(clientId, link, accessToken) {
|
|
22
|
-
this.clientId = clientId;
|
|
23
|
-
this.link = link;
|
|
24
|
-
this.accessToken = accessToken;
|
|
25
|
-
this.link = this.link.replace(/\/$/, '');
|
|
26
|
-
}
|
|
27
|
-
getTimeout() {
|
|
28
|
-
return this.timeout;
|
|
29
|
-
}
|
|
30
|
-
setTimeout(timeout) {
|
|
31
|
-
this.timeout = timeout;
|
|
32
|
-
}
|
|
33
|
-
getCache() {
|
|
34
|
-
return this.cache;
|
|
35
|
-
}
|
|
36
|
-
setCache(cache) {
|
|
37
|
-
this.cache = cache;
|
|
38
|
-
}
|
|
39
|
-
getRateLimiter() {
|
|
40
|
-
return this.rateLimiter;
|
|
41
|
-
}
|
|
42
|
-
setRateLimiter(limiter) {
|
|
43
|
-
this.rateLimiter = limiter;
|
|
44
|
-
}
|
|
45
|
-
getCircuitBreaker() {
|
|
46
|
-
return this.circuitBreaker;
|
|
47
|
-
}
|
|
48
|
-
setCircuitBreaker(cb) {
|
|
49
|
-
this.circuitBreaker = cb;
|
|
50
|
-
}
|
|
51
|
-
getDeduplicator() {
|
|
52
|
-
return this.deduplicator;
|
|
53
|
-
}
|
|
54
|
-
setDeduplicator(dedup) {
|
|
55
|
-
this.deduplicator = dedup;
|
|
56
|
-
}
|
|
57
|
-
getRetryConfig() {
|
|
58
|
-
return this.retryConfig;
|
|
59
|
-
}
|
|
60
|
-
setRetryConfig(config) {
|
|
61
|
-
this.retryConfig = config;
|
|
62
|
-
}
|
|
63
|
-
getValidateResponse() {
|
|
64
|
-
return this.validateResponse;
|
|
65
|
-
}
|
|
66
|
-
setValidateResponse(validate) {
|
|
67
|
-
this.validateResponse = validate;
|
|
68
|
-
}
|
|
69
|
-
getMiddleware() {
|
|
70
|
-
return this.middleware;
|
|
71
|
-
}
|
|
72
|
-
addRequestInterceptor(fn) {
|
|
73
|
-
return this.middleware.addRequestInterceptor(fn);
|
|
74
|
-
}
|
|
75
|
-
addResponseInterceptor(fn) {
|
|
76
|
-
return this.middleware.addResponseInterceptor(fn);
|
|
77
|
-
}
|
|
78
|
-
getAuthorizationHeader() {
|
|
79
|
-
return this.accessToken ? `Bearer ${this.accessToken}` : undefined;
|
|
80
|
-
}
|
|
81
|
-
getLink() {
|
|
82
|
-
return this.link;
|
|
83
|
-
}
|
|
84
|
-
getDatasource() {
|
|
85
|
-
return this.datasource;
|
|
86
|
-
}
|
|
87
|
-
setDatasource(datasource) {
|
|
88
|
-
this.datasource = datasource;
|
|
89
|
-
}
|
|
90
|
-
getLanguage() {
|
|
91
|
-
return this.language;
|
|
92
|
-
}
|
|
93
|
-
setLanguage(language) {
|
|
94
|
-
this.language = language;
|
|
95
|
-
}
|
|
96
|
-
setAccessToken(token) {
|
|
97
|
-
this.accessToken = token;
|
|
98
|
-
}
|
|
99
|
-
setTokenProvider(provider) {
|
|
100
|
-
this.tokenProvider = provider;
|
|
101
|
-
}
|
|
102
|
-
hasTokenProvider() {
|
|
103
|
-
return this.tokenProvider !== undefined;
|
|
104
|
-
}
|
|
105
|
-
async refreshToken() {
|
|
106
|
-
if (!this.tokenProvider) {
|
|
107
|
-
throw new Error('No token provider configured');
|
|
108
|
-
}
|
|
109
|
-
if (this.refreshInFlight) {
|
|
110
|
-
return this.refreshInFlight;
|
|
111
|
-
}
|
|
112
|
-
this.refreshInFlight = this.tokenProvider().then((token) => {
|
|
113
|
-
this.accessToken = token;
|
|
114
|
-
this.refreshInFlight = undefined;
|
|
115
|
-
return token;
|
|
116
|
-
}, (err) => {
|
|
117
|
-
this.refreshInFlight = undefined;
|
|
118
|
-
throw err;
|
|
119
|
-
});
|
|
120
|
-
return this.refreshInFlight;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
exports.ApiClient = ApiClient;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApiClientBuilder = void 0;
|
|
4
|
-
const ApiClient_1 = require("./ApiClient");
|
|
5
|
-
const RateLimiter_1 = require("./rateLimiter/RateLimiter");
|
|
6
|
-
class ApiClientBuilder {
|
|
7
|
-
clientId;
|
|
8
|
-
link;
|
|
9
|
-
accessToken;
|
|
10
|
-
rateLimiter;
|
|
11
|
-
cache;
|
|
12
|
-
circuitBreaker;
|
|
13
|
-
_timeout;
|
|
14
|
-
setClientId(clientId) {
|
|
15
|
-
this.clientId = clientId;
|
|
16
|
-
return this;
|
|
17
|
-
}
|
|
18
|
-
setLink(link) {
|
|
19
|
-
this.link = link;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
setAccessToken(accessToken) {
|
|
23
|
-
this.accessToken = accessToken;
|
|
24
|
-
return this;
|
|
25
|
-
}
|
|
26
|
-
setRateLimiter(limiter) {
|
|
27
|
-
this.rateLimiter = limiter;
|
|
28
|
-
return this;
|
|
29
|
-
}
|
|
30
|
-
setCache(cache) {
|
|
31
|
-
this.cache = cache;
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
setCircuitBreaker(cb) {
|
|
35
|
-
this.circuitBreaker = cb;
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
setTimeout(timeout) {
|
|
39
|
-
this._timeout = timeout;
|
|
40
|
-
return this;
|
|
41
|
-
}
|
|
42
|
-
build() {
|
|
43
|
-
const client = new ApiClient_1.ApiClient(this.clientId, this.link, this.accessToken);
|
|
44
|
-
client.setRateLimiter(this.rateLimiter ?? new RateLimiter_1.RateLimiter());
|
|
45
|
-
if (this.cache)
|
|
46
|
-
client.setCache(this.cache);
|
|
47
|
-
if (this.circuitBreaker)
|
|
48
|
-
client.setCircuitBreaker(this.circuitBreaker);
|
|
49
|
-
if (this._timeout !== undefined)
|
|
50
|
-
client.setTimeout(this._timeout);
|
|
51
|
-
return client;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.ApiClientBuilder = ApiClientBuilder;
|