cftools-sdk

An easy to use JavaScript implementation to talk with the CFTools Cloud API from your JavaScript project.

MIT License

Downloads
358
Stars
6
Committers
3

Bot releases are hidden (Show)

cftools-sdk - Support IPv4 addresses in ban management APIs

Published by FlorianSW over 2 years ago

The CFTools API provides two ways of identifying a specific ban in the ban management APIs (GET, PUT, DELETE). The CFTooldId way was already supported so far, but not the IPv4 way.

This release adds support to the ban management low-level API functions. The interfaces were adapted to seamlessly support the use of IPv4 addresses, instead of other GenericIds, with the new IPAddress type.

Community contributions

This release was mostly triggered by a pull request (#3) of @ManuShamil, who identified the lack of the SDK to handle IP addresses in the ban management API functions. Thanks for the contribution! ❤️

cftools-sdk - Cache rate-limited resolve of CFToolsId

Published by FlorianSW almost 3 years ago

Resolving the passed in player ID is a crucial command used by many
other commands as well. Most users do not pass in a CFToolsId directly,
resulting in numerous times that the passed ID needs to be resolved
before the requested action can be done.

However, the resolve endpoint is under heavy rate limit (20 requests per
minute), resolving the same and the same ID again every time a new
action with an already resolved ID is a waste of resources. After all,
the resolved IDs are static anyway, there is no known way of when the
result of requesting the same ID (Steam ID, BE GUID or BI UID) might
be diffrent.

This release brings resolving the IDs under the cache configuration
umbrella. The default caching time for this function, as they are
static, is very high, so that one ID usually does not need to be
resolved twice. It depends on the caching storage, if it can or will
hold the cached results in the cache, though. Also, enabling the cache
is crucial for this to work as well, which is opt-in by the user of this
sdk.

cftools-sdk - Fix not-available persona when Steam not available

Published by FlorianSW about 3 years ago

listGameSessions has information in the response, which might not be available at the time when the request was made. This commit ensures that the sdk adheres to this fact.
https://discord.com/channels/373098389174484992/841276327860502549/882240383206195220

cftools-sdk - Fix retrying with a fresh token

Published by FlorianSW about 3 years ago

In the previous release, the implementation to retry a request which was rejected because of an expired token, was wrong and did not actually retry the request with a fresh, but with the "old" token. This is fixed in this release.

cftools-sdk - Improve handling of expired tokens

Published by FlorianSW about 3 years ago

This release contains a bit more details for error handling (it will now include the URL where a specific error occurred (in the message of the error).

Additionally, this release contains new handling for an expired token. While a token is refreshed currently every 23 hours, there seems to be cases, where a token, which is newer than the creation date + 23h, the sdk will now handle the expired token responses. When such an API error occurs, the SDK retries the very same request to the CFTools Data API with a fresh token, instead of the cached one.

cftools-sdk - Fix GetPriorityQueue

Published by FlorianSW over 3 years ago

The API which supports getPriorityQueue does not support the used query parameter cftools_id (anymore?).

If this is a bug in the API or in the SDK is not clear, yet. You can follow this discord thread if you want to learn more.

cftools-sdk - Beta: GameLabs API support

Published by FlorianSW over 3 years ago

This release adds support to some new APIs released by the CFTools API:

  • getServerInfo - server information of a CFTools Server entry
  • listGameSessions - return a list of currently active game sessions
  • spawnItem - spawns an item class to the player of a game session
  • teleport - teleports the player of a game session to the new coordinates
cftools-sdk - Ban management

Published by FlorianSW over 3 years ago

  • Add support to manage ban lists
  • Some minor fixes and improvements
cftools-sdk - More distinct error handling

Published by FlorianSW over 3 years ago

  • #1 Throw meaningful error when upstream server errors while requesting game server details
  • Error with a different error code (not ResourceNotFound) when the resource basically exists but the bucket is not configured
cftools-sdk - Fix cache expiry time

Published by FlorianSW over 3 years ago

cftools-sdk - Fix overwriting default cache config

Published by FlorianSW over 3 years ago

cftools-sdk - Caching and Whitelist

Published by FlorianSW over 3 years ago

  • Added caching as a possibility to mitigate usages where the program would ran into rate limits of CFTools Cloud
  • Added managing whitelist entries
cftools-sdk - More player details

Published by FlorianSW over 3 years ago

Changes:

  • When requesting player details with the getPlayerDetails API, it will expose more detailed player statistics fields, like kills, deaths, total playtime and so on
cftools-sdk - More data for leaderboard

Published by FlorianSW over 3 years ago

kills and deaths are not available in the leaderboard response as well.

cftools-sdk - Fix error handling

Published by FlorianSW over 3 years ago

Errors are now correctly converted to the respective error types.

cftools-sdk - Error handling and compatibility

Published by FlorianSW over 3 years ago

  • Added error handling for common error cases
  • Build the library for es5 instead of esnext for better compatibility (e.g. nodejs)
cftools-sdk - Add Gameserver information

Published by FlorianSW over 3 years ago

It is now possible to get game server information using the [GET] /v1/gameserver/{server_id} endpoint of CFTools Cloud. This endpoint/method does not require authentication.

Also changed:

  • Made withCredentials and withServerApiId optional, as not all methods require these information anymore
  • Provide a way to override the server api ID per request for methods/endpoints that require one
cftools-sdk - README fixes

Published by FlorianSW over 3 years ago

cftools-sdk - 1.0.2

Published by FlorianSW over 3 years ago

Package Rankings
Top 10.12% on Npmjs.org
Badges
Extracted from project README
npm Discord
Related Projects