-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(REST): remove double classing (#9722)
* refactor(REST): remove double classing BREAKING CHANGE: `REST` and `RequestManager` have been combined, most of the properties, methods, and events from both classes can now be found on `REST` BREAKING CHANGE: `REST#raw` has been removed in favor of `REST#queueRequest` BREAKING CHANGE: `REST#getAgent` has been removed in favor of `REST#agent` * chore: update for /rest changes
- Loading branch information
Showing
19 changed files
with
759 additions
and
817 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
import { Blob } from 'node:buffer'; | ||
import { shouldUseGlobalFetchAndWebSocket } from '@discordjs/util'; | ||
import { FormData } from 'undici'; | ||
import { setDefaultStrategy } from './environment.js'; | ||
import { makeRequest } from './strategies/undiciRequest.js'; | ||
|
||
// TODO(ckohen): remove once node engine req is bumped to > v18 | ||
(globalThis as any).FormData ??= FormData; | ||
globalThis.Blob ??= Blob; | ||
|
||
setDefaultStrategy(shouldUseGlobalFetchAndWebSocket() ? fetch : makeRequest); | ||
|
||
export * from './shared.js'; |
Oops, something went wrong.