@lgriffin/esi.ts 4.0.0 → 5.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 +156 -0
- package/LICENSE +26 -26
- package/README.md +562 -557
- package/dist/EsiClient.d.ts +8 -2
- package/dist/EsiClient.d.ts.map +1 -1
- package/dist/EsiClient.js +9 -0
- package/dist/EsiClientBuilder.d.ts +4 -1
- package/dist/EsiClientBuilder.d.ts.map +1 -1
- package/dist/EsiClientBuilder.js +9 -0
- package/dist/clients/AccessListsClient.d.ts +15 -0
- package/dist/clients/AccessListsClient.d.ts.map +1 -0
- package/dist/clients/AccessListsClient.js +20 -0
- package/dist/clients/MercenaryClient.d.ts +20 -0
- package/dist/clients/MercenaryClient.d.ts.map +1 -0
- package/dist/clients/MercenaryClient.js +27 -0
- package/dist/clients/SkyhooksClient.d.ts +26 -0
- package/dist/clients/SkyhooksClient.d.ts.map +1 -0
- package/dist/clients/SkyhooksClient.js +35 -0
- package/dist/clients/SovereigntyClient.d.ts +4 -10
- package/dist/clients/SovereigntyClient.d.ts.map +1 -1
- package/dist/clients/SovereigntyClient.js +4 -12
- package/dist/clients/UniverseClient.d.ts +2 -2
- package/dist/clients/UniverseClient.d.ts.map +1 -1
- package/dist/clients/UniverseClient.js +3 -3
- package/dist/config/configManager.d.ts.map +1 -1
- package/dist/config/configManager.js +12 -6
- package/dist/config/jest/jest.setup.js +0 -1
- package/dist/core/ApiRequestHandler.d.ts.map +1 -1
- package/dist/core/ApiRequestHandler.js +6 -2
- package/dist/core/ClientRegistry.d.ts +6 -4
- package/dist/core/ClientRegistry.d.ts.map +1 -1
- package/dist/core/ClientRegistry.js +11 -2
- package/dist/core/circuitBreaker/CircuitBreaker.js +2 -2
- package/dist/core/constants.d.ts +3 -3
- package/dist/core/constants.js +2 -2
- package/dist/core/endpoints/accessListEndpoints.d.ts +9 -0
- package/dist/core/endpoints/accessListEndpoints.d.ts.map +1 -0
- package/dist/core/endpoints/accessListEndpoints.js +11 -0
- package/dist/core/endpoints/assetEndpoints.d.ts +4 -12
- package/dist/core/endpoints/assetEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/assetEndpoints.js +4 -4
- package/dist/core/endpoints/contactEndpoints.d.ts +1 -3
- package/dist/core/endpoints/contactEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/contactEndpoints.js +1 -1
- package/dist/core/endpoints/mercenaryEndpoints.d.ts +13 -0
- package/dist/core/endpoints/mercenaryEndpoints.d.ts.map +1 -0
- package/dist/core/endpoints/mercenaryEndpoints.js +15 -0
- package/dist/core/endpoints/skyhookEndpoints.d.ts +18 -0
- package/dist/core/endpoints/skyhookEndpoints.d.ts.map +1 -0
- package/dist/core/endpoints/skyhookEndpoints.js +20 -0
- package/dist/core/endpoints/sovereigntyEndpoints.d.ts +2 -7
- package/dist/core/endpoints/sovereigntyEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/sovereigntyEndpoints.js +2 -7
- package/dist/core/endpoints/universeEndpoints.d.ts +2 -6
- package/dist/core/endpoints/universeEndpoints.d.ts.map +1 -1
- package/dist/core/endpoints/universeEndpoints.js +2 -2
- package/dist/core/util/testHelpers.d.ts +0 -2
- package/dist/core/util/testHelpers.d.ts.map +1 -1
- package/dist/core/util/testHelpers.js +3 -19
- package/dist/core/util/validation.js +2 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/testing/TestDataFactory.d.ts +8 -2
- package/dist/testing/TestDataFactory.d.ts.map +1 -1
- package/dist/testing/TestDataFactory.js +86 -1
- package/dist/types/access-lists.d.ts +11 -0
- package/dist/types/access-lists.d.ts.map +1 -0
- package/dist/types/api-responses.d.ts +3 -0
- package/dist/types/api-responses.d.ts.map +1 -1
- package/dist/types/api-responses.js +3 -0
- package/dist/types/mercenary.d.ts +19 -0
- package/dist/types/mercenary.d.ts.map +1 -0
- package/dist/types/mercenary.js +2 -0
- package/dist/types/skyhooks.d.ts +27 -0
- package/dist/types/skyhooks.d.ts.map +1 -0
- package/dist/types/skyhooks.js +2 -0
- package/dist/types/sovereignty.d.ts +11 -9
- package/dist/types/sovereignty.d.ts.map +1 -1
- package/package.json +181 -156
- package/dist/api/alliances/getAllianceById.js +0 -17
- package/dist/api/alliances/getAllianceContactLabels.js +0 -13
- package/dist/api/alliances/getAllianceContacts.js +0 -13
- package/dist/api/alliances/getAllianceCorporations.js +0 -13
- package/dist/api/alliances/getAllianceIcons.js +0 -13
- package/dist/api/alliances/getAlliances.js +0 -13
- package/dist/api/assets/getCharacterAssets.js +0 -13
- package/dist/api/assets/getCorporationAssets.js +0 -13
- package/dist/api/assets/postCharacterAssetLocations.js +0 -13
- package/dist/api/assets/postCharacterAssetNames.js +0 -13
- package/dist/api/assets/postCorporationAssetLocations.js +0 -13
- package/dist/api/assets/postCorporationAssetNames.js +0 -13
- package/dist/api/bookmarks/getCharacterBookmarkFolders.js +0 -13
- package/dist/api/bookmarks/getCharacterBookmarks.js +0 -13
- package/dist/api/bookmarks/getCorporationBookmarkFolders.js +0 -13
- package/dist/api/bookmarks/getCorporationBookmarks.js +0 -13
- package/dist/api/calendar/getCalendarEventById.js +0 -13
- package/dist/api/calendar/getCalendarEvents.js +0 -13
- package/dist/api/calendar/getEventAttendees.js +0 -13
- package/dist/api/calendar/respondToCalendarEvent.js +0 -14
- package/dist/api/characters/getAgentsResearch.js +0 -13
- package/dist/api/characters/getBlueprints.js +0 -13
- package/dist/api/characters/getCharacterPublicInfo.js +0 -13
- package/dist/api/characters/getCharacterRoles.js +0 -13
- package/dist/api/characters/getCharacterStandings.js +0 -13
- package/dist/api/characters/getCharacterTitles.js +0 -13
- package/dist/api/characters/getContactNotifications.js +0 -13
- package/dist/api/characters/getCorporationHistory.js +0 -13
- package/dist/api/characters/getJumpFatigue.js +0 -13
- package/dist/api/characters/getMedals.js +0 -13
- package/dist/api/characters/getNotifications.js +0 -13
- package/dist/api/characters/getPortrait.js +0 -13
- package/dist/api/characters/postCSPAChargeCost.js +0 -13
- package/dist/api/characters/postCharacterAffiliations.js +0 -14
- package/dist/api/clones/getClones.js +0 -14
- package/dist/api/clones/getImplants.js +0 -14
- package/dist/api/clones/postJumpCloneActivation.js +0 -14
- package/dist/api/contacts/deleteCharacterContacts.js +0 -13
- package/dist/api/contacts/getAllianceContactLabels.js +0 -13
- package/dist/api/contacts/getAllianceContacts.js +0 -13
- package/dist/api/contacts/getCharacterContactLabels.js +0 -13
- package/dist/api/contacts/getCharacterContacts.js +0 -13
- package/dist/api/contacts/getCorporationContactLabels.js +0 -13
- package/dist/api/contacts/getCorporationContacts.js +0 -13
- package/dist/api/contacts/postCharacterContacts.js +0 -13
- package/dist/api/contacts/putCharacterContacts.js +0 -13
- package/dist/api/contracts/getCharacterContractBids.js +0 -13
- package/dist/api/contracts/getCharacterContractItems.js +0 -13
- package/dist/api/contracts/getCharacterContracts.js +0 -13
- package/dist/api/contracts/getCorporationContractBids.js +0 -13
- package/dist/api/contracts/getCorporationContractItems.js +0 -13
- package/dist/api/contracts/getCorporationContracts.js +0 -13
- package/dist/api/contracts/getPublicContractBids.js +0 -13
- package/dist/api/contracts/getPublicContractItems.js +0 -13
- package/dist/api/contracts/getPublicContracts.js +0 -13
- package/dist/api/corporations/getCorporationAllianceHistory.js +0 -13
- package/dist/api/corporations/getCorporationAlscLogs.js +0 -13
- package/dist/api/corporations/getCorporationBlueprints.js +0 -13
- package/dist/api/corporations/getCorporationDivisions.js +0 -13
- package/dist/api/corporations/getCorporationFacilities.js +0 -13
- package/dist/api/corporations/getCorporationIcon.js +0 -13
- package/dist/api/corporations/getCorporationInfo.js +0 -13
- package/dist/api/corporations/getCorporationIssuedMedals.js +0 -13
- package/dist/api/corporations/getCorporationMedals.js +0 -13
- package/dist/api/corporations/getCorporationMemberLimit.js +0 -13
- package/dist/api/corporations/getCorporationMemberRoles.js +0 -13
- package/dist/api/corporations/getCorporationMemberRolesHistory.js +0 -13
- package/dist/api/corporations/getCorporationMemberTracking.js +0 -13
- package/dist/api/corporations/getCorporationMembers.js +0 -13
- package/dist/api/corporations/getCorporationMembersTitles.js +0 -13
- package/dist/api/corporations/getCorporationProjects.js +0 -13
- package/dist/api/corporations/getCorporationShareholders.js +0 -13
- package/dist/api/corporations/getCorporationStandings.js +0 -13
- package/dist/api/corporations/getCorporationStarbaseDetail.js +0 -13
- package/dist/api/corporations/getCorporationStarbases.js +0 -13
- package/dist/api/corporations/getCorporationStructures.js +0 -13
- package/dist/api/corporations/getCorporationTitles.js +0 -13
- package/dist/api/corporations/getNpcCorporations.js +0 -13
- package/dist/api/dogma/getDogmaAttributeById.js +0 -13
- package/dist/api/dogma/getDogmaAttributes.js +0 -13
- package/dist/api/dogma/getDogmaDynamicItemAttributes.js +0 -13
- package/dist/api/dogma/getDogmaEffectById.js +0 -13
- package/dist/api/dogma/getDogmaEffects.js +0 -13
- package/dist/api/factions/getCharacterFactionWarfareStats.js +0 -13
- package/dist/api/factions/getCharacterLeaderboards.js +0 -13
- package/dist/api/factions/getCorporationFactionWarfareStats.js +0 -13
- package/dist/api/factions/getCorporationLeaderboards.js +0 -13
- package/dist/api/factions/getFactionLeaderboards.js +0 -13
- package/dist/api/factions/getFactionWarfareStats.js +0 -13
- package/dist/api/factions/getFactionWarfareSystems.js +0 -13
- package/dist/api/factions/getFactionWarfareWars.js +0 -13
- package/dist/api/fittings/deleteCharacterFitting.js +0 -13
- package/dist/api/fittings/getCharacterFittings.js +0 -13
- package/dist/api/fittings/postCharacterFittings.js +0 -13
- package/dist/api/fleets/deleteFleetMember.js +0 -13
- package/dist/api/fleets/deleteFleetSquad.js +0 -13
- package/dist/api/fleets/deleteFleetWing.js +0 -13
- package/dist/api/fleets/getCharacterFleetInfo.js +0 -13
- package/dist/api/fleets/getFleetInfo.js +0 -13
- package/dist/api/fleets/getFleetMembers.js +0 -13
- package/dist/api/fleets/getFleetWings.js +0 -13
- package/dist/api/fleets/postFleetInvitation.js +0 -13
- package/dist/api/fleets/postFleetSquad.js +0 -14
- package/dist/api/fleets/postFleetWing.js +0 -13
- package/dist/api/fleets/putFleetMember.js +0 -13
- package/dist/api/fleets/putFleetSquad.js +0 -13
- package/dist/api/fleets/putFleetWing.js +0 -14
- package/dist/api/fleets/updateFleet.js +0 -13
- package/dist/api/incursions/getIncursions.js +0 -13
- package/dist/api/industry/getCharacterIndustryJobs.js +0 -13
- package/dist/api/industry/getCharacterMiningLedger.js +0 -13
- package/dist/api/industry/getCorporationIndustryJobs.js +0 -13
- package/dist/api/industry/getCorporationMiningObserver.js +0 -13
- package/dist/api/industry/getCorporationMiningObservers.js +0 -13
- package/dist/api/industry/getIndustryFacilities.js +0 -13
- package/dist/api/industry/getIndustrySystems.js +0 -13
- package/dist/api/industry/getMoonExtractionTimers.js +0 -13
- package/dist/api/insurance/getInsurancePrices.js +0 -13
- package/dist/api/killmails/getCharacterRecentKillmails.js +0 -13
- package/dist/api/killmails/getCorporationRecentKillmails.js +0 -13
- package/dist/api/killmails/getKillmail.js +0 -13
- package/dist/api/location/getCharacterLocation.js +0 -13
- package/dist/api/location/getCharacterOnline.js +0 -13
- package/dist/api/location/getCharacterShip.js +0 -13
- package/dist/api/loyalty/getLoyaltyPoints.js +0 -13
- package/dist/api/loyalty/getLoyaltyStoreOffers.js +0 -13
- package/dist/api/mail/deleteCharacterMail.js +0 -13
- package/dist/api/mail/deleteCharacterMailLabel.js +0 -13
- package/dist/api/mail/deleteCharacterMailLabel.test.js +0 -21
- package/dist/api/mail/getCharacerMailingLists.test.js +0 -33
- package/dist/api/mail/getCharacterMail.js +0 -13
- package/dist/api/mail/getCharacterMailHeaders.js +0 -13
- package/dist/api/mail/getCharacterMailLabels.js +0 -13
- package/dist/api/mail/getCharacterMailingLists.js +0 -13
- package/dist/api/mail/postCharacterMail.js +0 -13
- package/dist/api/mail/postCharacterMailLabels.js +0 -13
- package/dist/api/mail/putCharacterMail.js +0 -13
- package/dist/api/market/getCharacterOrderHistory.js +0 -13
- package/dist/api/market/getCharacterOrders.js +0 -13
- package/dist/api/market/getCorporationOrderHistory.js +0 -13
- package/dist/api/market/getCorporationOrders.js +0 -13
- package/dist/api/market/getMarketGroupInformation.js +0 -13
- package/dist/api/market/getMarketGroups.js +0 -13
- package/dist/api/market/getMarketHistory.js +0 -13
- package/dist/api/market/getMarketOrders.js +0 -13
- package/dist/api/market/getMarketOrdersInStructure.js +0 -13
- package/dist/api/market/getMarketPrices.js +0 -13
- package/dist/api/market/getMarketTypes.js +0 -13
- package/dist/api/meta/getSwaggerJson.js +0 -13
- package/dist/api/meta/getSwaggerYaml.js +0 -37
- package/dist/api/opportunities/getCharacterOpportunities.js +0 -13
- package/dist/api/opportunities/getOpportunitiesGroupById.js +0 -13
- package/dist/api/opportunities/getOpportunitiesGroups.js +0 -13
- package/dist/api/opportunities/getOpportunitiesTaskById.js +0 -13
- package/dist/api/opportunities/getOpportunitiesTasks.js +0 -13
- package/dist/api/pi/getColonies.js +0 -13
- package/dist/api/pi/getColonyLayout.js +0 -13
- package/dist/api/pi/getCorporationCustomsOffices.js +0 -13
- package/dist/api/pi/getSchematicInformation.js +0 -13
- package/dist/api/route/getRoute.js +0 -13
- package/dist/api/search/getCharacterSearch.js +0 -13
- package/dist/api/skills/getCharacterAttributes.js +0 -13
- package/dist/api/skills/getCharacterSkillQueue.js +0 -13
- package/dist/api/skills/getCharacterSkills.js +0 -13
- package/dist/api/sovereignty/getSovereigntyCampaigns.js +0 -13
- package/dist/api/sovereignty/getSovereigntyMap.js +0 -13
- package/dist/api/sovereignty/getSovereigntyStructures.js +0 -13
- package/dist/api/status/getStatus.js +0 -13
- package/dist/api/ui/postAutopilotWaypoint.js +0 -13
- package/dist/api/ui/postOpenContractWindow.js +0 -13
- package/dist/api/ui/postOpenInformationWindow.js +0 -13
- package/dist/api/ui/postOpenMarketDetailsWindow.js +0 -13
- package/dist/api/ui/postOpenNewMailWindow.js +0 -13
- package/dist/api/universe/getAncestries.js +0 -13
- package/dist/api/universe/getAsteroidBeltInfo.js +0 -13
- package/dist/api/universe/getBloodlines.js +0 -13
- package/dist/api/universe/getConstellationById.js +0 -13
- package/dist/api/universe/getConstellations.js +0 -13
- package/dist/api/universe/getFactions.js +0 -13
- package/dist/api/universe/getGraphicById.js +0 -13
- package/dist/api/universe/getGraphics.js +0 -13
- package/dist/api/universe/getItemCategories.js +0 -13
- package/dist/api/universe/getItemCategoryById.js +0 -13
- package/dist/api/universe/getItemGroupById.js +0 -13
- package/dist/api/universe/getItemGroups.js +0 -13
- package/dist/api/universe/getMoonById.js +0 -13
- package/dist/api/universe/getPlanetById.js +0 -13
- package/dist/api/universe/getRaces.js +0 -13
- package/dist/api/universe/getRegionById.js +0 -13
- package/dist/api/universe/getRegions.js +0 -13
- package/dist/api/universe/getSchematicById.js +0 -13
- package/dist/api/universe/getStarById.js +0 -13
- package/dist/api/universe/getStargateById.js +0 -13
- package/dist/api/universe/getStationById.js +0 -13
- package/dist/api/universe/getStructureById.js +0 -13
- package/dist/api/universe/getStructures.js +0 -13
- package/dist/api/universe/getSystemById.js +0 -13
- package/dist/api/universe/getSystemJumps.js +0 -13
- package/dist/api/universe/getSystemKills.js +0 -13
- package/dist/api/universe/getSystems.js +0 -13
- package/dist/api/universe/getTypeById.js +0 -13
- package/dist/api/universe/getTypes.js +0 -13
- package/dist/api/universe/postBulkNamesToIds.js +0 -14
- package/dist/api/universe/postNamesAndCategories.js +0 -14
- package/dist/api/wallet/getCharacterWallet.js +0 -13
- package/dist/api/wallet/getCharacterWalletJournal.js +0 -13
- package/dist/api/wallet/getCharacterWalletTransactions.js +0 -13
- package/dist/api/wallet/getCorporationWalletJournal.js +0 -13
- package/dist/api/wallet/getCorporationWalletTransactions.js +0 -13
- package/dist/api/wallet/getCorporationWallets.js +0 -13
- package/dist/api/wars/getWarById.js +0 -13
- package/dist/api/wars/getWarKillmails.js +0 -13
- package/dist/api/wars/getWars.js +0 -13
- package/dist/builders/AllianceApiBuilder.js +0 -13
- package/dist/builders/AssetsApiBuilder.js +0 -13
- package/dist/builders/BookmarkApiBuilder.js +0 -13
- package/dist/builders/CalendarApiBuilder.js +0 -13
- package/dist/builders/CharacterApiBuilder.js +0 -13
- package/dist/builders/ClonesApiBuilder.js +0 -13
- package/dist/builders/ContactsApiBuilder.js +0 -13
- package/dist/builders/ContractsApiBuilder.js +0 -13
- package/dist/builders/CorporationsApiBuilder.js +0 -13
- package/dist/builders/DogmaApiBuilder.js +0 -13
- package/dist/builders/FactionApiBuilder.js +0 -13
- package/dist/builders/FittingsApiBuilder.js +0 -13
- package/dist/builders/FleetApiBuilder.js +0 -13
- package/dist/builders/IncursionsApiBuilder.js +0 -13
- package/dist/builders/IndustryApiBuilder.js +0 -13
- package/dist/builders/InsuranceApiBuilder.js +0 -13
- package/dist/builders/KillmailsBuilder.js +0 -13
- package/dist/builders/LocationApiBuilder.js +0 -13
- package/dist/builders/LoyaltyApiBuilder.js +0 -13
- package/dist/builders/MailApiBuilder.js +0 -13
- package/dist/builders/MarketApiBuilder.js +0 -13
- package/dist/builders/MetaApiBuilder.js +0 -13
- package/dist/builders/OpportunitiesApiBuilder.js +0 -13
- package/dist/builders/PiApiBuilder.js +0 -13
- package/dist/builders/RouteApiBuilder.js +0 -13
- package/dist/builders/SearchApiBuilder.js +0 -13
- package/dist/builders/SkillsApiBuilder.js +0 -13
- package/dist/builders/SovereigntyApiBuilder.js +0 -13
- package/dist/builders/StatusApiBuilder.js +0 -13
- package/dist/builders/UiApiBuilder.js +0 -13
- package/dist/builders/UniverseApiBuilder.js +0 -13
- package/dist/builders/WalletApiBuilder.js +0 -13
- package/dist/builders/WarsAPIBuilder.js +0 -13
- package/dist/clients/BookmarkClient.js +0 -28
- package/dist/clients/OpportunitiesClient.js +0 -33
- package/dist/config/constants.js +0 -11
- package/dist/core/ApiError.js +0 -11
- package/dist/core/container/Container.js +0 -145
- package/dist/core/errors/ApiError.js +0 -129
- package/dist/core/factory/ApiFactory.js +0 -170
- package/dist/core/logger/index.d.ts +0 -2
- package/dist/core/logger/index.d.ts.map +0 -1
- package/dist/core/logger/index.js +0 -8
- package/dist/core/util/file.js +0 -26
- package/dist/core/util/inputValidation.js +0 -9
- package/dist/core/util/network.js +0 -15
- package/dist/core/util/request.js +0 -21
- package/dist/testing/TestHelpers.js +0 -205
- package/dist/tsconfig.tsbuildinfo +0 -1
- /package/dist/{core/IAPIBuilder.js → types/access-lists.js} +0 -0
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IndustryApiBuilder = void 0;
|
|
4
|
-
const IndustryClient_1 = require("../clients/IndustryClient");
|
|
5
|
-
class IndustryApiBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new IndustryClient_1.IndustryClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.IndustryApiBuilder = IndustryApiBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InsuranceAPIBuilder = void 0;
|
|
4
|
-
const InsuranceClient_1 = require("../clients/InsuranceClient");
|
|
5
|
-
class InsuranceAPIBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new InsuranceClient_1.InsuranceClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.InsuranceAPIBuilder = InsuranceAPIBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KillmailsApiBuilder = void 0;
|
|
4
|
-
const KillmailsClient_1 = require("../clients/KillmailsClient");
|
|
5
|
-
class KillmailsApiBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new KillmailsClient_1.KillmailsClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.KillmailsApiBuilder = KillmailsApiBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LocationApiBuilder = void 0;
|
|
4
|
-
const LocationClient_1 = require("../clients/LocationClient");
|
|
5
|
-
class LocationApiBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new LocationClient_1.LocationClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.LocationApiBuilder = LocationApiBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LoyaltyApiBuilder = void 0;
|
|
4
|
-
const LoyaltyClient_1 = require("../clients/LoyaltyClient");
|
|
5
|
-
class LoyaltyApiBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new LoyaltyClient_1.LoyaltyClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.LoyaltyApiBuilder = LoyaltyApiBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MailApiBuilder = void 0;
|
|
4
|
-
const MailClient_1 = require("../clients/MailClient");
|
|
5
|
-
class MailApiBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new MailClient_1.MailClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.MailApiBuilder = MailApiBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MarketApiBuilder = void 0;
|
|
4
|
-
const MarketClient_1 = require("../clients/MarketClient");
|
|
5
|
-
class MarketApiBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new MarketClient_1.MarketClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.MarketApiBuilder = MarketApiBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MetaApiBuilder = void 0;
|
|
4
|
-
const MetaClient_1 = require("../clients/MetaClient");
|
|
5
|
-
class MetaApiBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new MetaClient_1.MetaClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.MetaApiBuilder = MetaApiBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OpportunitiesApiBuilder = void 0;
|
|
4
|
-
const OpportunitiesClient_1 = require("../clients/OpportunitiesClient");
|
|
5
|
-
class OpportunitiesApiBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new OpportunitiesClient_1.OpportunitiesClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.OpportunitiesApiBuilder = OpportunitiesApiBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PiApiBuilder = void 0;
|
|
4
|
-
const PiClient_1 = require("../clients/PiClient");
|
|
5
|
-
class PiApiBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new PiClient_1.PIClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.PiApiBuilder = PiApiBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RouteApiBuilder = void 0;
|
|
4
|
-
const RouteClient_1 = require("../clients/RouteClient");
|
|
5
|
-
class RouteApiBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new RouteClient_1.RouteClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.RouteApiBuilder = RouteApiBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SearchApiBuilder = void 0;
|
|
4
|
-
const SearchClient_1 = require("../clients/SearchClient");
|
|
5
|
-
class SearchApiBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new SearchClient_1.SearchClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.SearchApiBuilder = SearchApiBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SkillsApiBuilder = void 0;
|
|
4
|
-
const SkillsClient_1 = require("../clients/SkillsClient");
|
|
5
|
-
class SkillsApiBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new SkillsClient_1.CharacterSkillsClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.SkillsApiBuilder = SkillsApiBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SovereigntyApiBuilder = void 0;
|
|
4
|
-
const SovereigntyClient_1 = require("../clients/SovereigntyClient");
|
|
5
|
-
class SovereigntyApiBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new SovereigntyClient_1.SovereigntyClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.SovereigntyApiBuilder = SovereigntyApiBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StatusAPIBuilder = void 0;
|
|
4
|
-
const StatusClient_1 = require("../clients/StatusClient");
|
|
5
|
-
class StatusAPIBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new StatusClient_1.StatusClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.StatusAPIBuilder = StatusAPIBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UiApiBuilder = void 0;
|
|
4
|
-
const UiClient_1 = require("../clients/UiClient");
|
|
5
|
-
class UiApiBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new UiClient_1.UIClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.UiApiBuilder = UiApiBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UniverseAPIBuilder = void 0;
|
|
4
|
-
const UniverseClient_1 = require("../clients/UniverseClient");
|
|
5
|
-
class UniverseAPIBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new UniverseClient_1.UniverseClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.UniverseAPIBuilder = UniverseAPIBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WalletApiBuilder = void 0;
|
|
4
|
-
const WalletClient_1 = require("../clients/WalletClient");
|
|
5
|
-
class WalletApiBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new WalletClient_1.WalletClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.WalletApiBuilder = WalletApiBuilder;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WarsAPIBuilder = void 0;
|
|
4
|
-
const WarsClient_1 = require("../clients/WarsClient");
|
|
5
|
-
class WarsAPIBuilder {
|
|
6
|
-
constructor(client) {
|
|
7
|
-
this.client = client;
|
|
8
|
-
}
|
|
9
|
-
build() {
|
|
10
|
-
return new WarsClient_1.WarsClient(this.client);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.WarsAPIBuilder = WarsAPIBuilder;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BookmarkClient = void 0;
|
|
4
|
-
const getCharacterBookmarks_1 = require("../api/bookmarks/getCharacterBookmarks");
|
|
5
|
-
const getCharacterBookmarkFolders_1 = require("../api/bookmarks/getCharacterBookmarkFolders");
|
|
6
|
-
const getCorporationBookmarks_1 = require("../api/bookmarks/getCorporationBookmarks");
|
|
7
|
-
const getCorporationBookmarkFolders_1 = require("../api/bookmarks/getCorporationBookmarkFolders");
|
|
8
|
-
class BookmarkClient {
|
|
9
|
-
constructor(client) {
|
|
10
|
-
this.characterBookmarksApi = new getCharacterBookmarks_1.CharacterBookmarksApi(client);
|
|
11
|
-
this.characterBookmarkFoldersApi = new getCharacterBookmarkFolders_1.CharacterBookmarkFoldersApi(client);
|
|
12
|
-
this.corporationBookmarksApi = new getCorporationBookmarks_1.CorporationBookmarksApi(client);
|
|
13
|
-
this.corporationBookmarkFoldersApi = new getCorporationBookmarkFolders_1.CorporationBookmarkFoldersApi(client);
|
|
14
|
-
}
|
|
15
|
-
async getCharacterBookmarks(characterId) {
|
|
16
|
-
return this.characterBookmarksApi.getCharacterBookmarks(characterId);
|
|
17
|
-
}
|
|
18
|
-
async getCharacterBookmarkFolders(characterId) {
|
|
19
|
-
return this.characterBookmarkFoldersApi.getCharacterBookmarkFolders(characterId);
|
|
20
|
-
}
|
|
21
|
-
async getCorporationBookmarks(corporationId) {
|
|
22
|
-
return this.corporationBookmarksApi.getCorporationBookmarks(corporationId);
|
|
23
|
-
}
|
|
24
|
-
async getCorporationBookmarkFolders(corporationId) {
|
|
25
|
-
return this.corporationBookmarkFoldersApi.getCorporationBookmarkFolders(corporationId);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.BookmarkClient = BookmarkClient;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OpportunitiesClient = void 0;
|
|
4
|
-
const getCharacterOpportunities_1 = require("../api/opportunities/getCharacterOpportunities");
|
|
5
|
-
const getOpportunitiesGroups_1 = require("../api/opportunities/getOpportunitiesGroups");
|
|
6
|
-
const getOpportunitiesGroupById_1 = require("../api/opportunities/getOpportunitiesGroupById");
|
|
7
|
-
const getOpportunitiesTasks_1 = require("../api/opportunities/getOpportunitiesTasks");
|
|
8
|
-
const getOpportunitiesTaskById_1 = require("../api/opportunities/getOpportunitiesTaskById");
|
|
9
|
-
class OpportunitiesClient {
|
|
10
|
-
constructor(client) {
|
|
11
|
-
this.getCharacterOpportunitiesApi = new getCharacterOpportunities_1.GetCharacterOpportunitiesApi(client);
|
|
12
|
-
this.getOpportunitiesGroupsApi = new getOpportunitiesGroups_1.GetOpportunitiesGroupsApi(client);
|
|
13
|
-
this.getOpportunitiesGroupByIdApi = new getOpportunitiesGroupById_1.GetOpportunitiesGroupByIdApi(client);
|
|
14
|
-
this.getOpportunitiesTasksApi = new getOpportunitiesTasks_1.GetOpportunitiesTasksApi(client);
|
|
15
|
-
this.getOpportunitiesTaskByIdApi = new getOpportunitiesTaskById_1.GetOpportunitiesTaskByIdApi(client);
|
|
16
|
-
}
|
|
17
|
-
async getCharacterOpportunities(characterId) {
|
|
18
|
-
return await this.getCharacterOpportunitiesApi.getCharacterOpportunities(characterId);
|
|
19
|
-
}
|
|
20
|
-
async getOpportunitiesGroups() {
|
|
21
|
-
return await this.getOpportunitiesGroupsApi.getOpportunitiesGroups();
|
|
22
|
-
}
|
|
23
|
-
async getOpportunitiesGroupById(groupId) {
|
|
24
|
-
return await this.getOpportunitiesGroupByIdApi.getOpportunitiesGroupById(groupId);
|
|
25
|
-
}
|
|
26
|
-
async getOpportunitiesTasks() {
|
|
27
|
-
return await this.getOpportunitiesTasksApi.getOpportunitiesTasks();
|
|
28
|
-
}
|
|
29
|
-
async getOpportunitiesTaskById(taskId) {
|
|
30
|
-
return await this.getOpportunitiesTaskByIdApi.getOpportunitiesTaskById(taskId);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.OpportunitiesClient = OpportunitiesClient;
|
package/dist/config/constants.js
DELETED
|
@@ -1,11 +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.routes = exports.server = exports.localConfig = exports.projectConfig = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
exports.projectConfig = path_1.default.join(__dirname, 'esi.json');
|
|
9
|
-
exports.localConfig = path_1.default.join(__dirname, 'local.json');
|
|
10
|
-
exports.server = 'esi.evetech.net';
|
|
11
|
-
exports.routes = ['latest', 'v1', 'v2', 'v3'];
|
package/dist/core/ApiError.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApiError = void 0;
|
|
4
|
-
class ApiError extends Error {
|
|
5
|
-
constructor(statusCode, message) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.statusCode = statusCode;
|
|
8
|
-
this.name = 'ApiError';
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.ApiError = ApiError;
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.container = exports.Container = exports.CircularDependencyError = void 0;
|
|
4
|
-
exports.Injectable = Injectable;
|
|
5
|
-
exports.Inject = Inject;
|
|
6
|
-
class CircularDependencyError extends Error {
|
|
7
|
-
constructor(dependencyChain) {
|
|
8
|
-
super(`Circular dependency detected: ${dependencyChain.join(' -> ')}`);
|
|
9
|
-
this.name = 'CircularDependencyError';
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.CircularDependencyError = CircularDependencyError;
|
|
13
|
-
class Container {
|
|
14
|
-
constructor(config = {}) {
|
|
15
|
-
this.dependencies = new Map();
|
|
16
|
-
this.singletons = new Map();
|
|
17
|
-
this.resolutionStack = [];
|
|
18
|
-
this.config = Object.assign({ enableLogging: false, enableCircularDependencyDetection: true }, config);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Register a factory function for a dependency
|
|
22
|
-
*/
|
|
23
|
-
register(token, factory, singleton = false) {
|
|
24
|
-
if (this.config.enableLogging) {
|
|
25
|
-
console.log(`Registering dependency: ${token} (singleton: ${singleton})`);
|
|
26
|
-
}
|
|
27
|
-
this.dependencies.set(token, factory);
|
|
28
|
-
if (singleton) {
|
|
29
|
-
// Pre-resolve singleton to catch errors early
|
|
30
|
-
this.resolve(token);
|
|
31
|
-
}
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Register a singleton dependency
|
|
36
|
-
*/
|
|
37
|
-
registerSingleton(token, factory) {
|
|
38
|
-
return this.register(token, factory, true);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Register an instance directly as a singleton
|
|
42
|
-
*/
|
|
43
|
-
registerInstance(token, instance) {
|
|
44
|
-
this.singletons.set(token, instance);
|
|
45
|
-
return this;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Resolve a dependency by token
|
|
49
|
-
*/
|
|
50
|
-
resolve(token) {
|
|
51
|
-
// Check if it's already a singleton instance
|
|
52
|
-
if (this.singletons.has(token)) {
|
|
53
|
-
return this.singletons.get(token);
|
|
54
|
-
}
|
|
55
|
-
// Get the factory
|
|
56
|
-
const factory = this.dependencies.get(token);
|
|
57
|
-
if (!factory) {
|
|
58
|
-
throw new Error(`Dependency '${token}' not found. Available dependencies: ${Array.from(this.dependencies.keys()).join(', ')}`);
|
|
59
|
-
}
|
|
60
|
-
// Check for circular dependencies
|
|
61
|
-
if (this.config.enableCircularDependencyDetection && this.resolutionStack.includes(token)) {
|
|
62
|
-
throw new CircularDependencyError([...this.resolutionStack, token]);
|
|
63
|
-
}
|
|
64
|
-
// Add to resolution stack
|
|
65
|
-
this.resolutionStack.push(token);
|
|
66
|
-
try {
|
|
67
|
-
const instance = factory();
|
|
68
|
-
// Store as singleton if it was registered as one
|
|
69
|
-
if (this.isSingleton(token)) {
|
|
70
|
-
this.singletons.set(token, instance);
|
|
71
|
-
}
|
|
72
|
-
return instance;
|
|
73
|
-
}
|
|
74
|
-
finally {
|
|
75
|
-
// Remove from resolution stack
|
|
76
|
-
this.resolutionStack.pop();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Check if a dependency is registered
|
|
81
|
-
*/
|
|
82
|
-
has(token) {
|
|
83
|
-
return this.dependencies.has(token) || this.singletons.has(token);
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Remove a dependency
|
|
87
|
-
*/
|
|
88
|
-
remove(token) {
|
|
89
|
-
const hadDependency = this.dependencies.delete(token);
|
|
90
|
-
const hadSingleton = this.singletons.delete(token);
|
|
91
|
-
return hadDependency || hadSingleton;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Clear all dependencies
|
|
95
|
-
*/
|
|
96
|
-
clear() {
|
|
97
|
-
this.dependencies.clear();
|
|
98
|
-
this.singletons.clear();
|
|
99
|
-
this.resolutionStack = [];
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Get all registered dependency tokens
|
|
103
|
-
*/
|
|
104
|
-
getRegisteredTokens() {
|
|
105
|
-
const dependencyTokens = Array.from(this.dependencies.keys());
|
|
106
|
-
const singletonTokens = Array.from(this.singletons.keys());
|
|
107
|
-
return [...new Set([...dependencyTokens, ...singletonTokens])];
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Create a child container that inherits from this one
|
|
111
|
-
*/
|
|
112
|
-
createChild() {
|
|
113
|
-
const child = new Container(this.config);
|
|
114
|
-
// Copy dependencies (not instances)
|
|
115
|
-
for (const [token, factory] of this.dependencies) {
|
|
116
|
-
child.dependencies.set(token, factory);
|
|
117
|
-
}
|
|
118
|
-
return child;
|
|
119
|
-
}
|
|
120
|
-
isSingleton(token) {
|
|
121
|
-
// Check if the token was registered with singleton behavior
|
|
122
|
-
// This is determined by checking if resolve was called during registration
|
|
123
|
-
return false; // For now, we'll manage this manually
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
exports.Container = Container;
|
|
127
|
-
// Global container instance
|
|
128
|
-
exports.container = new Container({
|
|
129
|
-
enableLogging: process.env.NODE_ENV === 'development',
|
|
130
|
-
enableCircularDependencyDetection: true
|
|
131
|
-
});
|
|
132
|
-
// Dependency injection decorators (if using experimental decorators)
|
|
133
|
-
function Injectable(token) {
|
|
134
|
-
return function (constructor) {
|
|
135
|
-
const dependencyToken = token || constructor.name;
|
|
136
|
-
exports.container.register(dependencyToken, () => new constructor());
|
|
137
|
-
return constructor;
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
function Inject(token) {
|
|
141
|
-
return function (target, propertyKey, parameterIndex) {
|
|
142
|
-
// This would require reflect-metadata for full implementation
|
|
143
|
-
// For now, it's a placeholder for future enhancement
|
|
144
|
-
};
|
|
145
|
-
}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorHandler = exports.ApiError = exports.ApiErrorType = void 0;
|
|
4
|
-
var ApiErrorType;
|
|
5
|
-
(function (ApiErrorType) {
|
|
6
|
-
ApiErrorType["NETWORK_ERROR"] = "NETWORK_ERROR";
|
|
7
|
-
ApiErrorType["AUTHENTICATION_ERROR"] = "AUTHENTICATION_ERROR";
|
|
8
|
-
ApiErrorType["AUTHORIZATION_ERROR"] = "AUTHORIZATION_ERROR";
|
|
9
|
-
ApiErrorType["RATE_LIMIT_ERROR"] = "RATE_LIMIT_ERROR";
|
|
10
|
-
ApiErrorType["SERVER_ERROR"] = "SERVER_ERROR";
|
|
11
|
-
ApiErrorType["CLIENT_ERROR"] = "CLIENT_ERROR";
|
|
12
|
-
ApiErrorType["VALIDATION_ERROR"] = "VALIDATION_ERROR";
|
|
13
|
-
ApiErrorType["NOT_FOUND_ERROR"] = "NOT_FOUND_ERROR";
|
|
14
|
-
ApiErrorType["TIMEOUT_ERROR"] = "TIMEOUT_ERROR";
|
|
15
|
-
ApiErrorType["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
|
|
16
|
-
})(ApiErrorType || (exports.ApiErrorType = ApiErrorType = {}));
|
|
17
|
-
class ApiError extends Error {
|
|
18
|
-
constructor(message, type = ApiErrorType.UNKNOWN_ERROR, statusCode, details, requestId) {
|
|
19
|
-
super(message);
|
|
20
|
-
this.name = 'ApiError';
|
|
21
|
-
this.type = type;
|
|
22
|
-
this.statusCode = statusCode;
|
|
23
|
-
this.details = details;
|
|
24
|
-
this.timestamp = new Date();
|
|
25
|
-
this.requestId = requestId;
|
|
26
|
-
// Maintains proper stack trace for where our error was thrown (only available on V8)
|
|
27
|
-
if (Error.captureStackTrace) {
|
|
28
|
-
Error.captureStackTrace(this, ApiError);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
static fromHttpStatus(statusCode, message, details, requestId) {
|
|
32
|
-
let type;
|
|
33
|
-
switch (Math.floor(statusCode / 100)) {
|
|
34
|
-
case 4:
|
|
35
|
-
if (statusCode === 401) {
|
|
36
|
-
type = ApiErrorType.AUTHENTICATION_ERROR;
|
|
37
|
-
}
|
|
38
|
-
else if (statusCode === 403) {
|
|
39
|
-
type = ApiErrorType.AUTHORIZATION_ERROR;
|
|
40
|
-
}
|
|
41
|
-
else if (statusCode === 404) {
|
|
42
|
-
type = ApiErrorType.NOT_FOUND_ERROR;
|
|
43
|
-
}
|
|
44
|
-
else if (statusCode === 429) {
|
|
45
|
-
type = ApiErrorType.RATE_LIMIT_ERROR;
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
type = ApiErrorType.CLIENT_ERROR;
|
|
49
|
-
}
|
|
50
|
-
break;
|
|
51
|
-
case 5:
|
|
52
|
-
type = ApiErrorType.SERVER_ERROR;
|
|
53
|
-
break;
|
|
54
|
-
default:
|
|
55
|
-
type = ApiErrorType.UNKNOWN_ERROR;
|
|
56
|
-
}
|
|
57
|
-
return new ApiError(message, type, statusCode, details, requestId);
|
|
58
|
-
}
|
|
59
|
-
static networkError(message = 'Network connection failed', details) {
|
|
60
|
-
return new ApiError(message, ApiErrorType.NETWORK_ERROR, undefined, details);
|
|
61
|
-
}
|
|
62
|
-
static timeoutError(message = 'Request timeout', details) {
|
|
63
|
-
return new ApiError(message, ApiErrorType.TIMEOUT_ERROR, undefined, details);
|
|
64
|
-
}
|
|
65
|
-
static validationError(message, details) {
|
|
66
|
-
return new ApiError(message, ApiErrorType.VALIDATION_ERROR, 400, details);
|
|
67
|
-
}
|
|
68
|
-
toJSON() {
|
|
69
|
-
return {
|
|
70
|
-
name: this.name,
|
|
71
|
-
message: this.message,
|
|
72
|
-
type: this.type,
|
|
73
|
-
statusCode: this.statusCode,
|
|
74
|
-
details: this.details,
|
|
75
|
-
timestamp: this.timestamp.toISOString(),
|
|
76
|
-
requestId: this.requestId,
|
|
77
|
-
stack: this.stack
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
exports.ApiError = ApiError;
|
|
82
|
-
class ErrorHandler {
|
|
83
|
-
static handle(error, requestId) {
|
|
84
|
-
var _a, _b, _c;
|
|
85
|
-
if (error instanceof ApiError) {
|
|
86
|
-
throw error;
|
|
87
|
-
}
|
|
88
|
-
// Handle Axios/HTTP errors
|
|
89
|
-
if (error.response) {
|
|
90
|
-
const statusCode = error.response.status;
|
|
91
|
-
const message = ((_a = error.response.data) === null || _a === void 0 ? void 0 : _a.error) ||
|
|
92
|
-
((_b = error.response.data) === null || _b === void 0 ? void 0 : _b.message) ||
|
|
93
|
-
error.message ||
|
|
94
|
-
`HTTP ${statusCode} Error`;
|
|
95
|
-
throw ApiError.fromHttpStatus(statusCode, message, error.response.data, requestId);
|
|
96
|
-
}
|
|
97
|
-
// Handle network errors
|
|
98
|
-
if (error.code === 'ECONNREFUSED' || error.code === 'ENOTFOUND' || error.code === 'ECONNRESET') {
|
|
99
|
-
throw ApiError.networkError(`Network error: ${error.message}`, { code: error.code });
|
|
100
|
-
}
|
|
101
|
-
// Handle timeout errors
|
|
102
|
-
if (error.code === 'ECONNABORTED' || ((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('timeout'))) {
|
|
103
|
-
throw ApiError.timeoutError(`Request timeout: ${error.message}`);
|
|
104
|
-
}
|
|
105
|
-
// Default to unknown error
|
|
106
|
-
throw new ApiError(error.message || 'An unknown error occurred', ApiErrorType.UNKNOWN_ERROR, undefined, error, requestId);
|
|
107
|
-
}
|
|
108
|
-
static isRetryable(error) {
|
|
109
|
-
return [
|
|
110
|
-
ApiErrorType.NETWORK_ERROR,
|
|
111
|
-
ApiErrorType.TIMEOUT_ERROR,
|
|
112
|
-
ApiErrorType.SERVER_ERROR,
|
|
113
|
-
ApiErrorType.RATE_LIMIT_ERROR
|
|
114
|
-
].includes(error.type);
|
|
115
|
-
}
|
|
116
|
-
static getRetryDelay(error, attempt) {
|
|
117
|
-
var _a, _b;
|
|
118
|
-
if (error.type === ApiErrorType.RATE_LIMIT_ERROR) {
|
|
119
|
-
// Check for Retry-After header in details
|
|
120
|
-
const retryAfter = (_b = (_a = error.details) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b['retry-after'];
|
|
121
|
-
if (retryAfter) {
|
|
122
|
-
return parseInt(retryAfter) * 1000; // Convert to milliseconds
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
// Exponential backoff: 1s, 2s, 4s, 8s, etc.
|
|
126
|
-
return Math.min(1000 * Math.pow(2, attempt - 1), 30000); // Max 30 seconds
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
exports.ErrorHandler = ErrorHandler;
|