feat: expose Retry-After and sublimit timeouts in RatelimitData (#9864)

* feat: expose Retry-After and sublimit timeouts in RatelimitData

* chore: better docs?

* Apply suggestions from code review

Co-authored-by: ckohen <chaikohen@gmail.com>

---------

Co-authored-by: ckohen <chaikohen@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Vlad Frangu
2023-11-12 16:36:12 +02:00
committed by GitHub
parent 62e6573296
commit 81e7866903
4 changed files with 54 additions and 14 deletions

View File

@@ -155,12 +155,23 @@ export interface RateLimitData {
* The HTTP method being performed
*/
method: string;
/**
* The time, in milliseconds, that will need to pass before this specific request can be retried
*/
retryAfter: number;
/**
* The route being hit in this request
*/
route: string;
/**
* The time, in milliseconds, until the request-lock is reset
* The time, in milliseconds, that will need to pass before the sublimit lock for the route resets, and requests that fall under a sublimit
* can be retried
*
* This is only present on certain sublimits, and `0` otherwise
*/
sublimitTimeout: number;
/**
* The time, in milliseconds, until the route's request-lock is reset
*/
timeToReset: number;
/**