RATE_LIMIT=100

This commit is contained in:
Namrata Jha
2021-12-22 19:21:20 +00:00
committed by GitHub
parent 38d4003d57
commit 1a7a0291b8
3 changed files with 17 additions and 80 deletions
-33
View File
@@ -18,39 +18,6 @@ const mutation = `
}
}`
export interface RateLimitResponse {
viewer: {
login: string
}
ratelimit: {
limit: number
cost: number
remaining: number
resetAt: string
}
}
const ratelimitQuery = `
query {
viewer {
login
}
rateLimit {
limit
cost
remaining
resetAt
}
}`
export async function getRateLimit(token: string): Promise<RateLimitResponse> {
return graphql(token, ratelimitQuery, {
headers: {
Accept: 'application/vnd.github.package-deletes-preview+json'
}
}) as Promise<RateLimitResponse>
}
export function deletePackageVersion(
packageVersionId: string,
token: string