-
-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(rest/oauth2): correct string literal types containing bot scope (#…
- Loading branch information
1 parent
5d95d97
commit 2ae2324
Showing
6 changed files
with
73 additions
and
32 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { expectAssignable, expectNotAssignable } from 'tsd'; | ||
import type { OAuth2Scopes, RESTOAuth2BotAuthorizationQuery, RESTOAuth2AdvancedBotAuthorizationQuery } from '../../v10'; | ||
|
||
declare const validBotScope: | ||
| OAuth2Scopes.Bot | ||
| 'bot' | ||
| 'bot identify' | ||
| 'applications.commands bot' | ||
| 'applications.commands bot identify'; | ||
declare const invalidBotScope: | ||
| OAuth2Scopes.ApplicationsCommands | ||
| 'applications.commands' | ||
| 'applications.commands identify' | ||
| 'bot%20identify' | ||
| ''; | ||
|
||
expectAssignable<RESTOAuth2BotAuthorizationQuery['scope']>(validBotScope); | ||
expectNotAssignable<RESTOAuth2BotAuthorizationQuery['scope']>(invalidBotScope); | ||
|
||
expectAssignable<RESTOAuth2AdvancedBotAuthorizationQuery['scope']>(validBotScope); | ||
expectNotAssignable<RESTOAuth2AdvancedBotAuthorizationQuery['scope']>(invalidBotScope); |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { expectAssignable, expectNotAssignable } from 'tsd'; | ||
import type { OAuth2Scopes, RESTOAuth2BotAuthorizationQuery, RESTOAuth2AdvancedBotAuthorizationQuery } from '../../v9'; | ||
|
||
declare const validBotScope: | ||
| OAuth2Scopes.Bot | ||
| 'bot' | ||
| 'bot identify' | ||
| 'applications.commands bot' | ||
| 'applications.commands bot identify'; | ||
declare const invalidBotScope: | ||
| OAuth2Scopes.ApplicationsCommands | ||
| 'applications.commands' | ||
| 'applications.commands identify' | ||
| ''; | ||
|
||
expectAssignable<RESTOAuth2BotAuthorizationQuery['scope']>(validBotScope); | ||
expectNotAssignable<RESTOAuth2BotAuthorizationQuery['scope']>(invalidBotScope); | ||
|
||
expectAssignable<RESTOAuth2AdvancedBotAuthorizationQuery['scope']>(validBotScope); | ||
expectNotAssignable<RESTOAuth2AdvancedBotAuthorizationQuery['scope']>(invalidBotScope); |