@lgriffin/esi.ts 6.1.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.
Files changed (426) hide show
  1. package/CHANGELOG.md +84 -1
  2. package/LICENSE +26 -26
  3. package/README.md +967 -896
  4. package/dist/EsiClient.d.ts +3 -0
  5. package/dist/EsiClient.d.ts.map +1 -1
  6. package/dist/EsiClientBuilder.d.ts +1 -0
  7. package/dist/EsiClientBuilder.d.ts.map +1 -1
  8. package/dist/clients/AllianceClient.d.ts +5 -0
  9. package/dist/clients/AllianceClient.d.ts.map +1 -1
  10. package/dist/clients/BaseEsiClient.d.ts +5 -3
  11. package/dist/clients/BaseEsiClient.d.ts.map +1 -1
  12. package/dist/clients/CalendarClient.d.ts +3 -0
  13. package/dist/clients/CalendarClient.d.ts.map +1 -1
  14. package/dist/clients/CharacterClient.d.ts +10 -2
  15. package/dist/clients/CharacterClient.d.ts.map +1 -1
  16. package/dist/clients/ClonesClient.d.ts +2 -0
  17. package/dist/clients/ClonesClient.d.ts.map +1 -1
  18. package/dist/clients/ContactsClient.d.ts +7 -0
  19. package/dist/clients/ContactsClient.d.ts.map +1 -1
  20. package/dist/clients/CorporationsClient.d.ts +18 -0
  21. package/dist/clients/CorporationsClient.d.ts.map +1 -1
  22. package/dist/clients/FittingsClient.d.ts +2 -0
  23. package/dist/clients/FittingsClient.d.ts.map +1 -1
  24. package/dist/clients/FleetClient.d.ts +3 -0
  25. package/dist/clients/FleetClient.d.ts.map +1 -1
  26. package/dist/clients/IndustryClient.d.ts +9 -0
  27. package/dist/clients/IndustryClient.d.ts.map +1 -1
  28. package/dist/clients/LoyaltyClient.d.ts +3 -0
  29. package/dist/clients/LoyaltyClient.d.ts.map +1 -1
  30. package/dist/clients/MailClient.d.ts +6 -0
  31. package/dist/clients/MailClient.d.ts.map +1 -1
  32. package/dist/clients/MarketClient.d.ts +13 -22
  33. package/dist/clients/MarketClient.d.ts.map +1 -1
  34. package/dist/clients/PiClient.d.ts +3 -0
  35. package/dist/clients/PiClient.d.ts.map +1 -1
  36. package/dist/clients/SkillsClient.d.ts +2 -0
  37. package/dist/clients/SkillsClient.d.ts.map +1 -1
  38. package/dist/clients/WalletClient.d.ts +1 -0
  39. package/dist/clients/WalletClient.d.ts.map +1 -1
  40. package/dist/clients/WarsClient.d.ts +3 -0
  41. package/dist/clients/WarsClient.d.ts.map +1 -1
  42. package/dist/core/ApiClient.d.ts +14 -6
  43. package/dist/core/ApiClient.d.ts.map +1 -1
  44. package/dist/core/ApiRequestHandler.d.ts +3 -11
  45. package/dist/core/ApiRequestHandler.d.ts.map +1 -1
  46. package/dist/core/IDeduplicator.d.ts +6 -0
  47. package/dist/core/IDeduplicator.d.ts.map +1 -0
  48. package/dist/core/IRetryStrategy.d.ts +5 -0
  49. package/dist/core/IRetryStrategy.d.ts.map +1 -0
  50. package/dist/core/RequestDeduplicator.d.ts +2 -1
  51. package/dist/core/RequestDeduplicator.d.ts.map +1 -1
  52. package/dist/core/RetryStrategy.d.ts +19 -0
  53. package/dist/core/RetryStrategy.d.ts.map +1 -0
  54. package/dist/core/circuitBreaker/CircuitBreaker.d.ts +11 -1
  55. package/dist/core/circuitBreaker/CircuitBreaker.d.ts.map +1 -1
  56. package/dist/core/circuitBreaker/ICircuitBreaker.d.ts +23 -0
  57. package/dist/core/circuitBreaker/ICircuitBreaker.d.ts.map +1 -0
  58. package/dist/core/configureApiClient.d.ts +18 -0
  59. package/dist/core/configureApiClient.d.ts.map +1 -0
  60. package/dist/core/constants.d.ts +2 -2
  61. package/dist/core/endpoints/EndpointDefinition.d.ts +2 -0
  62. package/dist/core/endpoints/EndpointDefinition.d.ts.map +1 -1
  63. package/dist/core/endpoints/allianceEndpoints.d.ts +17 -14
  64. package/dist/core/endpoints/allianceEndpoints.d.ts.map +1 -1
  65. package/dist/core/endpoints/assetEndpoints.d.ts +15 -0
  66. package/dist/core/endpoints/assetEndpoints.d.ts.map +1 -1
  67. package/dist/core/endpoints/calendarEndpoints.d.ts +1 -1
  68. package/dist/core/endpoints/characterEndpoints.d.ts +11 -3
  69. package/dist/core/endpoints/characterEndpoints.d.ts.map +1 -1
  70. package/dist/core/endpoints/cloneEndpoints.d.ts +17 -15
  71. package/dist/core/endpoints/cloneEndpoints.d.ts.map +1 -1
  72. package/dist/core/endpoints/contactEndpoints.d.ts +7 -3
  73. package/dist/core/endpoints/contactEndpoints.d.ts.map +1 -1
  74. package/dist/core/endpoints/corporationEndpoints.d.ts +30 -0
  75. package/dist/core/endpoints/corporationEndpoints.d.ts.map +1 -1
  76. package/dist/core/endpoints/createClient.d.ts +23 -2
  77. package/dist/core/endpoints/createClient.d.ts.map +1 -1
  78. package/dist/core/endpoints/dogmaEndpoints.d.ts +58 -38
  79. package/dist/core/endpoints/dogmaEndpoints.d.ts.map +1 -1
  80. package/dist/core/endpoints/esi-cache-ttls.generated.d.ts.map +1 -1
  81. package/dist/core/endpoints/esi-scopes.generated.d.ts +1 -1
  82. package/dist/core/endpoints/esi-scopes.generated.d.ts.map +1 -1
  83. package/dist/core/endpoints/fleetEndpoints.d.ts +5 -0
  84. package/dist/core/endpoints/fleetEndpoints.d.ts.map +1 -1
  85. package/dist/core/endpoints/mailEndpoints.d.ts +26 -0
  86. package/dist/core/endpoints/mailEndpoints.d.ts.map +1 -1
  87. package/dist/core/endpoints/marketEndpoints.d.ts +44 -43
  88. package/dist/core/endpoints/marketEndpoints.d.ts.map +1 -1
  89. package/dist/core/endpoints/metaEndpoints.d.ts +2 -0
  90. package/dist/core/endpoints/metaEndpoints.d.ts.map +1 -1
  91. package/dist/core/endpoints/piEndpoints.d.ts +7 -0
  92. package/dist/core/endpoints/piEndpoints.d.ts.map +1 -1
  93. package/dist/core/endpoints/routeEndpoints.d.ts +4 -0
  94. package/dist/core/endpoints/routeEndpoints.d.ts.map +1 -1
  95. package/dist/core/endpoints/searchEndpoints.d.ts +13 -0
  96. package/dist/core/endpoints/searchEndpoints.d.ts.map +1 -1
  97. package/dist/core/endpoints/skillEndpoints.d.ts +10 -0
  98. package/dist/core/endpoints/skillEndpoints.d.ts.map +1 -1
  99. package/dist/core/endpoints/universeEndpoints.d.ts +21 -2
  100. package/dist/core/endpoints/universeEndpoints.d.ts.map +1 -1
  101. package/dist/core/endpoints/walletEndpoints.d.ts +9 -0
  102. package/dist/core/endpoints/walletEndpoints.d.ts.map +1 -1
  103. package/dist/core/endpoints/warEndpoints.d.ts +1 -0
  104. package/dist/core/endpoints/warEndpoints.d.ts.map +1 -1
  105. package/dist/core/logger/logger.d.ts +2 -1
  106. package/dist/core/logger/logger.d.ts.map +1 -1
  107. package/dist/core/pagination/AsyncPaginationIterator.d.ts +4 -1
  108. package/dist/core/pagination/AsyncPaginationIterator.d.ts.map +1 -1
  109. package/dist/core/pagination/CursorPaginationHandler.d.ts +6 -2
  110. package/dist/core/pagination/CursorPaginationHandler.d.ts.map +1 -1
  111. package/dist/core/pagination/PaginationHandler.d.ts +1 -1
  112. package/dist/core/pagination/PaginationHandler.d.ts.map +1 -1
  113. package/dist/core/rateLimiter/RateLimiter.d.ts +8 -2
  114. package/dist/core/rateLimiter/RateLimiter.d.ts.map +1 -1
  115. package/dist/core/requestPipeline/cachePolicy.d.ts +30 -0
  116. package/dist/core/requestPipeline/cachePolicy.d.ts.map +1 -0
  117. package/dist/core/requestPipeline/dependencies.d.ts +10 -0
  118. package/dist/core/requestPipeline/dependencies.d.ts.map +1 -0
  119. package/dist/core/requestPipeline/fetchExecution.d.ts +28 -0
  120. package/dist/core/requestPipeline/fetchExecution.d.ts.map +1 -0
  121. package/dist/core/requestPipeline/headers.d.ts +11 -0
  122. package/dist/core/requestPipeline/headers.d.ts.map +1 -0
  123. package/dist/core/requestPipeline/index.d.ts +10 -0
  124. package/dist/core/requestPipeline/index.d.ts.map +1 -0
  125. package/dist/core/requestPipeline/middlewareBridge.d.ts +15 -0
  126. package/dist/core/requestPipeline/middlewareBridge.d.ts.map +1 -0
  127. package/dist/core/requestPipeline/paginationOrchestration.d.ts +15 -0
  128. package/dist/core/requestPipeline/paginationOrchestration.d.ts.map +1 -0
  129. package/dist/core/requestPipeline/statusHandling.d.ts +18 -0
  130. package/dist/core/requestPipeline/statusHandling.d.ts.map +1 -0
  131. package/dist/core/util/error.d.ts +4 -1
  132. package/dist/core/util/error.d.ts.map +1 -1
  133. package/dist/index.d.ts +9 -2
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +9926 -176
  136. package/dist/index.js.map +1 -0
  137. package/dist/index.mjs +9824 -0
  138. package/dist/index.mjs.map +1 -0
  139. package/dist/schemas/calendar.d.ts +1 -1
  140. package/dist/schemas/character.d.ts +9 -10
  141. package/dist/schemas/character.d.ts.map +1 -1
  142. package/dist/schemas/common.d.ts +9 -0
  143. package/dist/schemas/common.d.ts.map +1 -1
  144. package/dist/schemas/contacts.d.ts +2 -1
  145. package/dist/schemas/contacts.d.ts.map +1 -1
  146. package/dist/schemas/corporation.d.ts +13 -0
  147. package/dist/schemas/corporation.d.ts.map +1 -1
  148. package/dist/schemas/dogma.d.ts +17 -0
  149. package/dist/schemas/dogma.d.ts.map +1 -1
  150. package/dist/schemas/fleet.d.ts +1 -0
  151. package/dist/schemas/fleet.d.ts.map +1 -1
  152. package/dist/schemas/generated/alliance.generated.d.ts +15 -0
  153. package/dist/schemas/generated/alliance.generated.d.ts.map +1 -0
  154. package/dist/schemas/generated/assets.generated.d.ts +272 -0
  155. package/dist/schemas/generated/assets.generated.d.ts.map +1 -0
  156. package/dist/schemas/generated/calendar.generated.d.ts +41 -0
  157. package/dist/schemas/generated/calendar.generated.d.ts.map +1 -0
  158. package/dist/schemas/generated/character.generated.d.ts +670 -0
  159. package/dist/schemas/generated/character.generated.d.ts.map +1 -0
  160. package/dist/schemas/generated/clones.generated.d.ts +23 -0
  161. package/dist/schemas/generated/clones.generated.d.ts.map +1 -0
  162. package/dist/schemas/generated/contacts.generated.d.ts +50 -0
  163. package/dist/schemas/generated/contacts.generated.d.ts.map +1 -0
  164. package/dist/schemas/generated/contracts.generated.d.ts +162 -0
  165. package/dist/schemas/generated/contracts.generated.d.ts.map +1 -0
  166. package/dist/schemas/generated/corporation-projects.generated.d.ts +89 -0
  167. package/dist/schemas/generated/corporation-projects.generated.d.ts.map +1 -0
  168. package/dist/schemas/generated/corporation.generated.d.ts +1515 -0
  169. package/dist/schemas/generated/corporation.generated.d.ts.map +1 -0
  170. package/dist/schemas/generated/dogma.generated.d.ts +57 -0
  171. package/dist/schemas/generated/dogma.generated.d.ts.map +1 -0
  172. package/dist/schemas/generated/faction-warfare.generated.d.ts +155 -0
  173. package/dist/schemas/generated/faction-warfare.generated.d.ts.map +1 -0
  174. package/dist/schemas/generated/fittings.generated.d.ts +57 -0
  175. package/dist/schemas/generated/fittings.generated.d.ts.map +1 -0
  176. package/dist/schemas/generated/fleets.generated.d.ts +45 -0
  177. package/dist/schemas/generated/fleets.generated.d.ts.map +1 -0
  178. package/dist/schemas/generated/freelance-jobs.generated.d.ts +173 -0
  179. package/dist/schemas/generated/freelance-jobs.generated.d.ts.map +1 -0
  180. package/dist/schemas/generated/incursions.generated.d.ts +16 -0
  181. package/dist/schemas/generated/incursions.generated.d.ts.map +1 -0
  182. package/dist/schemas/generated/index.d.ts +33 -0
  183. package/dist/schemas/generated/index.d.ts.map +1 -0
  184. package/dist/schemas/generated/industry.generated.d.ts +117 -0
  185. package/dist/schemas/generated/industry.generated.d.ts.map +1 -0
  186. package/dist/schemas/generated/insurance.generated.d.ts +10 -0
  187. package/dist/schemas/generated/insurance.generated.d.ts.map +1 -0
  188. package/dist/schemas/generated/killmails.generated.d.ts +55 -0
  189. package/dist/schemas/generated/killmails.generated.d.ts.map +1 -0
  190. package/dist/schemas/generated/location.generated.d.ts +18 -0
  191. package/dist/schemas/generated/location.generated.d.ts.map +1 -0
  192. package/dist/schemas/generated/loyalty.generated.d.ts +18 -0
  193. package/dist/schemas/generated/loyalty.generated.d.ts.map +1 -0
  194. package/dist/schemas/generated/mail.generated.d.ts +68 -0
  195. package/dist/schemas/generated/mail.generated.d.ts.map +1 -0
  196. package/dist/schemas/generated/market.generated.d.ts +201 -0
  197. package/dist/schemas/generated/market.generated.d.ts.map +1 -0
  198. package/dist/schemas/generated/meta.generated.d.ts +26 -0
  199. package/dist/schemas/generated/meta.generated.d.ts.map +1 -0
  200. package/dist/schemas/generated/planetary-interaction.generated.d.ts +90 -0
  201. package/dist/schemas/generated/planetary-interaction.generated.d.ts.map +1 -0
  202. package/dist/schemas/generated/routes.generated.d.ts +5 -0
  203. package/dist/schemas/generated/routes.generated.d.ts.map +1 -0
  204. package/dist/schemas/generated/search.generated.d.ts +15 -0
  205. package/dist/schemas/generated/search.generated.d.ts.map +1 -0
  206. package/dist/schemas/generated/skills.generated.d.ts +32 -0
  207. package/dist/schemas/generated/skills.generated.d.ts.map +1 -0
  208. package/dist/schemas/generated/sovereignty.generated.d.ts +37 -0
  209. package/dist/schemas/generated/sovereignty.generated.d.ts.map +1 -0
  210. package/dist/schemas/generated/status.generated.d.ts +8 -0
  211. package/dist/schemas/generated/status.generated.d.ts.map +1 -0
  212. package/dist/schemas/generated/universe.generated.d.ts +394 -0
  213. package/dist/schemas/generated/universe.generated.d.ts.map +1 -0
  214. package/dist/schemas/generated/wallet.generated.d.ts +411 -0
  215. package/dist/schemas/generated/wallet.generated.d.ts.map +1 -0
  216. package/dist/schemas/generated/wars.generated.d.ts +31 -0
  217. package/dist/schemas/generated/wars.generated.d.ts.map +1 -0
  218. package/dist/schemas/mail.d.ts +13 -0
  219. package/dist/schemas/mail.d.ts.map +1 -1
  220. package/dist/schemas/market.d.ts +104 -4
  221. package/dist/schemas/market.d.ts.map +1 -1
  222. package/dist/schemas/pi.d.ts +3 -0
  223. package/dist/schemas/pi.d.ts.map +1 -1
  224. package/dist/schemas/skills.d.ts +10 -0
  225. package/dist/schemas/skills.d.ts.map +1 -1
  226. package/dist/schemas/sovereignty.d.ts +2 -0
  227. package/dist/schemas/sovereignty.d.ts.map +1 -1
  228. package/dist/schemas/universe.d.ts +11 -2
  229. package/dist/schemas/universe.d.ts.map +1 -1
  230. package/dist/schemas/wallet.d.ts +2 -0
  231. package/dist/schemas/wallet.d.ts.map +1 -1
  232. package/dist/testing/TestDataFactory.d.ts +1 -0
  233. package/dist/testing/TestDataFactory.d.ts.map +1 -1
  234. package/dist/types/api-responses.d.ts +1 -0
  235. package/dist/types/api-responses.d.ts.map +1 -1
  236. package/dist/types/branded.d.ts +23 -0
  237. package/dist/types/branded.d.ts.map +1 -0
  238. package/dist/types/character.d.ts +2 -1
  239. package/dist/types/character.d.ts.map +1 -1
  240. package/dist/types/common.d.ts +10 -0
  241. package/dist/types/common.d.ts.map +1 -1
  242. package/dist/types/generated/esi-spec.generated.d.ts +655 -430
  243. package/dist/types/generated/esi-spec.generated.d.ts.map +1 -1
  244. package/dist/types/generated/spec-alignment.check.d.ts +22 -0
  245. package/dist/types/generated/spec-alignment.check.d.ts.map +1 -0
  246. package/dist/types/market.d.ts +8 -1
  247. package/dist/types/market.d.ts.map +1 -1
  248. package/package.json +235 -200
  249. package/dist/EsiClient.js +0 -251
  250. package/dist/EsiClientBuilder.js +0 -217
  251. package/dist/clients/AccessListsClient.js +0 -20
  252. package/dist/clients/AllianceClient.js +0 -70
  253. package/dist/clients/AssetsClient.js +0 -81
  254. package/dist/clients/BaseEsiClient.js +0 -31
  255. package/dist/clients/CalendarClient.js +0 -54
  256. package/dist/clients/CharacterClient.js +0 -149
  257. package/dist/clients/ClonesClient.js +0 -31
  258. package/dist/clients/ContactsClient.js +0 -104
  259. package/dist/clients/ContractsClient.js +0 -111
  260. package/dist/clients/CorporationsClient.js +0 -227
  261. package/dist/clients/DogmaClient.js +0 -55
  262. package/dist/clients/FactionClient.js +0 -79
  263. package/dist/clients/FittingsClient.js +0 -42
  264. package/dist/clients/FleetClient.js +0 -162
  265. package/dist/clients/FreelanceJobsClient.js +0 -76
  266. package/dist/clients/IncursionsClient.js +0 -19
  267. package/dist/clients/IndustryClient.js +0 -88
  268. package/dist/clients/InsuranceClient.js +0 -19
  269. package/dist/clients/KillmailsClient.js +0 -47
  270. package/dist/clients/LocationClient.js +0 -41
  271. package/dist/clients/LoyaltyClient.js +0 -30
  272. package/dist/clients/MailClient.js +0 -108
  273. package/dist/clients/MarketClient.js +0 -131
  274. package/dist/clients/MercenaryClient.js +0 -27
  275. package/dist/clients/MetaClient.js +0 -56
  276. package/dist/clients/PiClient.js +0 -51
  277. package/dist/clients/RouteClient.js +0 -24
  278. package/dist/clients/SearchClient.js +0 -22
  279. package/dist/clients/SkillsClient.js +0 -41
  280. package/dist/clients/SkyhooksClient.js +0 -35
  281. package/dist/clients/SovereigntyClient.js +0 -27
  282. package/dist/clients/StatusClient.js +0 -19
  283. package/dist/clients/UiClient.js +0 -58
  284. package/dist/clients/UniverseClient.js +0 -277
  285. package/dist/clients/WalletClient.js +0 -82
  286. package/dist/clients/WarsClient.js +0 -37
  287. package/dist/config/configManager.js +0 -47
  288. package/dist/config/jest/globalSetup.js +0 -7
  289. package/dist/config/jest/globalTeardown.js +0 -7
  290. package/dist/config/jest/jest.setup.js +0 -29
  291. package/dist/core/ApiClient.js +0 -123
  292. package/dist/core/ApiClientBuilder.js +0 -54
  293. package/dist/core/ApiRequestHandler.js +0 -444
  294. package/dist/core/BatchRequestHandler.js +0 -66
  295. package/dist/core/ClientRegistry.js +0 -116
  296. package/dist/core/EsiDiagnostics.js +0 -47
  297. package/dist/core/RequestDeduplicator.js +0 -26
  298. package/dist/core/cache/ETagCacheManager.js +0 -184
  299. package/dist/core/cache/ICache.js +0 -2
  300. package/dist/core/circuitBreaker/CircuitBreaker.js +0 -156
  301. package/dist/core/constants.js +0 -7
  302. package/dist/core/endpoints/EndpointDefinition.js +0 -2
  303. package/dist/core/endpoints/accessListEndpoints.js +0 -13
  304. package/dist/core/endpoints/allianceEndpoints.js +0 -31
  305. package/dist/core/endpoints/assetEndpoints.js +0 -50
  306. package/dist/core/endpoints/buildEndpointPath.js +0 -44
  307. package/dist/core/endpoints/calendarEndpoints.js +0 -35
  308. package/dist/core/endpoints/characterEndpoints.js +0 -103
  309. package/dist/core/endpoints/cloneEndpoints.js +0 -19
  310. package/dist/core/endpoints/contactEndpoints.js +0 -72
  311. package/dist/core/endpoints/contractEndpoints.js +0 -70
  312. package/dist/core/endpoints/corporationEndpoints.js +0 -154
  313. package/dist/core/endpoints/createClient.js +0 -156
  314. package/dist/core/endpoints/dogmaEndpoints.js +0 -37
  315. package/dist/core/endpoints/esi-cache-ttls.generated.js +0 -126
  316. package/dist/core/endpoints/esi-rate-limit-groups.generated.js +0 -153
  317. package/dist/core/endpoints/esi-scopes.generated.js +0 -127
  318. package/dist/core/endpoints/factionEndpoints.js +0 -57
  319. package/dist/core/endpoints/fittingEndpoints.js +0 -27
  320. package/dist/core/endpoints/fleetEndpoints.js +0 -101
  321. package/dist/core/endpoints/freelanceJobsEndpoints.js +0 -51
  322. package/dist/core/endpoints/incursionEndpoints.js +0 -13
  323. package/dist/core/endpoints/industryEndpoints.js +0 -61
  324. package/dist/core/endpoints/insuranceEndpoints.js +0 -13
  325. package/dist/core/endpoints/killmailEndpoints.js +0 -28
  326. package/dist/core/endpoints/locationEndpoints.js +0 -27
  327. package/dist/core/endpoints/loyaltyEndpoints.js +0 -21
  328. package/dist/core/endpoints/mailEndpoints.js +0 -66
  329. package/dist/core/endpoints/marketEndpoints.js +0 -80
  330. package/dist/core/endpoints/mercenaryEndpoints.js +0 -19
  331. package/dist/core/endpoints/metaEndpoints.js +0 -10
  332. package/dist/core/endpoints/piEndpoints.js +0 -34
  333. package/dist/core/endpoints/routeEndpoints.js +0 -12
  334. package/dist/core/endpoints/searchEndpoints.js +0 -12
  335. package/dist/core/endpoints/skillEndpoints.js +0 -28
  336. package/dist/core/endpoints/skyhookEndpoints.js +0 -25
  337. package/dist/core/endpoints/sovereigntyEndpoints.js +0 -19
  338. package/dist/core/endpoints/statusEndpoints.js +0 -12
  339. package/dist/core/endpoints/uiEndpoints.js +0 -39
  340. package/dist/core/endpoints/universeEndpoints.js +0 -202
  341. package/dist/core/endpoints/walletEndpoints.js +0 -47
  342. package/dist/core/endpoints/warEndpoints.js +0 -27
  343. package/dist/core/logger/ILogger.js +0 -2
  344. package/dist/core/logger/logger.js +0 -16
  345. package/dist/core/logger/loggerUtil.js +0 -30
  346. package/dist/core/middleware/Middleware.js +0 -42
  347. package/dist/core/pagination/AsyncPaginationIterator.js +0 -27
  348. package/dist/core/pagination/CursorPaginationHandler.js +0 -148
  349. package/dist/core/pagination/PaginationHandler.js +0 -115
  350. package/dist/core/rateLimiter/IRateLimiter.js +0 -2
  351. package/dist/core/rateLimiter/RateLimiter.js +0 -307
  352. package/dist/core/util/error.js +0 -122
  353. package/dist/core/util/headersUtil.js +0 -37
  354. package/dist/core/util/retry.js +0 -9
  355. package/dist/core/util/sleep.js +0 -6
  356. package/dist/core/util/stringUtil.js +0 -6
  357. package/dist/core/util/testHelpers.js +0 -9
  358. package/dist/core/util/validation.js +0 -52
  359. package/dist/schemas/access-lists.js +0 -14
  360. package/dist/schemas/alliance.js +0 -28
  361. package/dist/schemas/assets.js +0 -26
  362. package/dist/schemas/calendar.js +0 -43
  363. package/dist/schemas/character.js +0 -114
  364. package/dist/schemas/clones.js +0 -21
  365. package/dist/schemas/common.js +0 -34
  366. package/dist/schemas/contacts.js +0 -15
  367. package/dist/schemas/contracts.js +0 -58
  368. package/dist/schemas/corporation.js +0 -178
  369. package/dist/schemas/dogma.js +0 -42
  370. package/dist/schemas/faction-warfare.js +0 -92
  371. package/dist/schemas/fittings.js +0 -15
  372. package/dist/schemas/fleet.js +0 -48
  373. package/dist/schemas/freelance-jobs.js +0 -99
  374. package/dist/schemas/incursions.js +0 -14
  375. package/dist/schemas/index.js +0 -48
  376. package/dist/schemas/industry.js +0 -75
  377. package/dist/schemas/insurance.js +0 -12
  378. package/dist/schemas/killmails.js +0 -42
  379. package/dist/schemas/location.js +0 -20
  380. package/dist/schemas/loyalty.js +0 -20
  381. package/dist/schemas/mail.js +0 -30
  382. package/dist/schemas/market.js +0 -26
  383. package/dist/schemas/mercenary.js +0 -22
  384. package/dist/schemas/pi.js +0 -85
  385. package/dist/schemas/skills.js +0 -20
  386. package/dist/schemas/skyhooks.js +0 -30
  387. package/dist/schemas/sovereignty.js +0 -70
  388. package/dist/schemas/status.js +0 -10
  389. package/dist/schemas/universe.js +0 -245
  390. package/dist/schemas/wallet.js +0 -29
  391. package/dist/schemas/wars.js +0 -31
  392. package/dist/testing/TestDataFactory.js +0 -820
  393. package/dist/types/access-lists.js +0 -2
  394. package/dist/types/alliance.js +0 -2
  395. package/dist/types/api-responses.js +0 -72
  396. package/dist/types/assets.js +0 -2
  397. package/dist/types/calendar.js +0 -2
  398. package/dist/types/character.js +0 -2
  399. package/dist/types/clones.js +0 -2
  400. package/dist/types/common.js +0 -2
  401. package/dist/types/contacts.js +0 -2
  402. package/dist/types/contracts.js +0 -2
  403. package/dist/types/corporation.js +0 -2
  404. package/dist/types/dogma.js +0 -2
  405. package/dist/types/faction-warfare.js +0 -2
  406. package/dist/types/fittings.js +0 -2
  407. package/dist/types/fleet.js +0 -2
  408. package/dist/types/freelance-jobs.js +0 -2
  409. package/dist/types/generated/esi-spec.generated.js +0 -6
  410. package/dist/types/incursions.js +0 -2
  411. package/dist/types/industry.js +0 -2
  412. package/dist/types/insurance.js +0 -2
  413. package/dist/types/killmails.js +0 -2
  414. package/dist/types/location.js +0 -2
  415. package/dist/types/loyalty.js +0 -2
  416. package/dist/types/mail.js +0 -2
  417. package/dist/types/market.js +0 -2
  418. package/dist/types/mercenary.js +0 -2
  419. package/dist/types/pi.js +0 -2
  420. package/dist/types/skills.js +0 -2
  421. package/dist/types/skyhooks.js +0 -2
  422. package/dist/types/sovereignty.js +0 -2
  423. package/dist/types/status.js +0 -2
  424. package/dist/types/universe.js +0 -2
  425. package/dist/types/wallet.js +0 -2
  426. 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,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = globalSetup;
4
- async function globalSetup() {
5
- // eslint-disable-next-line no-console
6
- console.log('Jest Unit Config Loaded');
7
- }
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = globalTeardown;
4
- async function globalTeardown() {
5
- // eslint-disable-next-line no-console
6
- console.log('Rate limiter reset after test completion');
7
- }
@@ -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;
@@ -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;