mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 16:30:08 +00:00
* fix: test local queue idea * I HATE STUPIDEST DENO FMT * try new error * fix: url * fix: with proper headers * fix: cleanup
32 lines
686 B
TypeScript
32 lines
686 B
TypeScript
export interface RestRequest {
|
|
url: string;
|
|
method: RequestMethod;
|
|
respond: (payload: RestRequestResponse) => unknown;
|
|
reject: (payload: RestRequestRejection) => unknown;
|
|
}
|
|
|
|
export interface RestRequestResponse {
|
|
ok: boolean;
|
|
status: number;
|
|
body?: string;
|
|
}
|
|
|
|
export interface RestRequestRejection extends RestRequestResponse {
|
|
error: string;
|
|
}
|
|
|
|
export interface RestPayload {
|
|
bucketId?: string;
|
|
body?: Record<string, unknown>;
|
|
retryCount: number;
|
|
headers?: Record<string, string>;
|
|
}
|
|
|
|
export interface RestRateLimitedPath {
|
|
url: string;
|
|
resetTimestamp: number;
|
|
bucketId?: string;
|
|
}
|
|
|
|
export type RequestMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|