WarEraProjects/API has been released!π₯³π

The project's endpoints have been updated to match the latest Doc endpoints, and this includes some useful endpoints such as:
battleOrder.getByBattle
battleLootSummary.getByBattleAndUser
inventory.fetchCurrentEquipment
mercenaryContractAuction.getPaginatedAuctions
Ok, but that is not all. The community came together to identify undocumented endpoints, that works with the API key!
company.getProductionBonus
party.getManyPaginated
donation.getManyPaginated
donation.getTotalDonations
election.getElections
gameStat.getEquipmentAvgByCode
muMember.getByMu
tradingOrder.getPublicOrdersByOwner
work.getStatsByUserId
work.getStatsByCompany
work.getStatsByWorkerAndCompany
workOffer.getWageStats
And finally, the fallback functionality has finally been implemented.
This means that if there is an ERRCON error or a 500 error, the system will reattempt the calls 3 more times.
This can be changed in the createAPIClient props as well.
The project is written in TypeScript, and is intended to handle most of the communication issues between the client and the server.
Here are some things that it can do:
End-to-end TypeScript typing for inputs and responses.
Procedure discovery via IntelliSense (no manual endpoint hunting).
Automatic request batching to reduce network overhead and improve throughput.
Built-in rate limiting aligned to API requirements, so your app degrades gracefully under throttling.
Automatic retries for failed batches on dropped connections and transient HTTP failures.
Automatic URL length handling by splitting oversized requests and recombining results.
Automatic cursor-based pagination with type-safe async iterators. See Auto-Pagination Guide.
Less boilerplate, fewer edge cases, faster iteration.
You may be saying "This looks like a lot of stuff, and I have no idea what any of it means"
In simple language:
It provides you types. This includes what the endpoint is expecting from you, and what type of object it returns!
When using an IDE like VSCode, you can start typing "company." and VSCode will provide you all the functions that can be called for "Company"
Batching is hard to implement from scratch, but by using promises, you can send multiple calls to the server in the same network requests. This can for example reduce 10 separate Calls into 1 HTTP request.
When the network drops, or the server throws an error, the application will keep on sending the failed requests 3 more times to ensure that it wasn't just a fluke.
Cursors are a pain to deal with, but you know what, this project allows you to automatically paginate through the cursors, without you having to stress about it!
In the end, using this project will reduce your written code by a lot. You don't need to worry about efficiency and communication to the server, because it is all in this project!
All you have to do is run this:npm install @WarEraProjects/API@latest
This will install or upgrade your version to 0.3.0 and you will be ready to develop awesome applications in no time!
As always, this is a voluntary project.
It is not supported by WarEra and is not maintained by the developers of WarEra either.
If you have any questions, feel free to join the Official WarEra Discord and ask in the #API channel!