feat: present x-ratelimit-scope for 429s hit (#9973)

* feat: present x-ratelimit-scope for 429s hit

* fix: get scope from headers for burst too
This commit is contained in:
Vlad Frangu
2023-11-16 12:49:05 +02:00
committed by GitHub
parent 0aa7dc1b86
commit 6df233de14
4 changed files with 19 additions and 1 deletions

View File

@@ -164,6 +164,13 @@ export interface RateLimitData {
* The route being hit in this request
*/
route: string;
/**
* The scope of the rate limit that was hit.
*
* This can be `user` for rate limits that are per client, `global` for rate limits that affect all clients or `shared` for rate limits that
* are shared per resource.
*/
scope: 'global' | 'shared' | 'user';
/**
* 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