feat(OAuth2): add integration_type param (#1643)

This commit is contained in:
Michael H
2026-05-24 00:06:47 +10:00
committed by GitHub
parent bd7f4b6df7
commit 22b7320285
4 changed files with 64 additions and 8 deletions

View File

@@ -1,5 +1,12 @@
import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIApplication, APIGuild, APIUser, APIWebhook, OAuth2Scopes } from '../../payloads/v10/mod.ts';
import type {
APIApplication,
APIGuild,
APIUser,
APIWebhook,
ApplicationIntegrationType,
OAuth2Scopes,
} from '../../payloads/v10/mod.ts';
/**
* @see {@link https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information}
@@ -139,7 +146,7 @@ export interface RESTOAuth2BotAuthorizationQuery {
/**
* Needs to include bot for the bot flow
*/
scope:
scope?:
| `${OAuth2Scopes.Bot} ${string}`
| `${OAuth2Scopes.Bot}`
| `${string} ${OAuth2Scopes.Bot} ${string}`
@@ -158,6 +165,12 @@ export interface RESTOAuth2BotAuthorizationQuery {
* `true` or `false`—disallows the user from changing the guild dropdown
*/
disable_guild_select?: boolean;
/**
* The installation context for the authorization
*
* @see {@link https://docs.discord.com/developers/resources/application#application-object-application-integration-types}
*/
integration_type?: ApplicationIntegrationType;
}
/**
@@ -181,6 +194,7 @@ export interface RESTOAuth2AdvancedBotAuthorizationQuery {
disable_guild_select?: boolean;
response_type: string;
redirect_uri?: string;
integration_type?: ApplicationIntegrationType;
}
export interface RESTOAuth2AdvancedBotAuthorizationQueryResult {

18
deno/rest/v9/oauth2.ts generated
View File

@@ -1,5 +1,12 @@
import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIApplication, APIGuild, APIUser, APIWebhook, OAuth2Scopes } from '../../payloads/v9/mod.ts';
import type {
APIApplication,
APIGuild,
APIUser,
APIWebhook,
ApplicationIntegrationType,
OAuth2Scopes,
} from '../../payloads/v9/mod.ts';
/**
* @see {@link https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information}
@@ -139,7 +146,7 @@ export interface RESTOAuth2BotAuthorizationQuery {
/**
* Needs to include bot for the bot flow
*/
scope:
scope?:
| `${OAuth2Scopes.Bot} ${string}`
| `${OAuth2Scopes.Bot}`
| `${string} ${OAuth2Scopes.Bot} ${string}`
@@ -158,6 +165,12 @@ export interface RESTOAuth2BotAuthorizationQuery {
* `true` or `false`—disallows the user from changing the guild dropdown
*/
disable_guild_select?: boolean;
/**
* The installation context for the authorization
*
* @see {@link https://docs.discord.com/developers/resources/application#application-object-application-integration-types}
*/
integration_type?: ApplicationIntegrationType;
}
/**
@@ -181,6 +194,7 @@ export interface RESTOAuth2AdvancedBotAuthorizationQuery {
disable_guild_select?: boolean;
response_type: string;
redirect_uri?: string;
integration_type?: ApplicationIntegrationType;
}
export interface RESTOAuth2AdvancedBotAuthorizationQueryResult {

View File

@@ -1,5 +1,12 @@
import type { Permissions, Snowflake } from '../../globals';
import type { APIApplication, APIGuild, APIUser, APIWebhook, OAuth2Scopes } from '../../payloads/v10/index';
import type {
APIApplication,
APIGuild,
APIUser,
APIWebhook,
ApplicationIntegrationType,
OAuth2Scopes,
} from '../../payloads/v10/index';
/**
* @see {@link https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information}
@@ -139,7 +146,7 @@ export interface RESTOAuth2BotAuthorizationQuery {
/**
* Needs to include bot for the bot flow
*/
scope:
scope?:
| `${OAuth2Scopes.Bot} ${string}`
| `${OAuth2Scopes.Bot}`
| `${string} ${OAuth2Scopes.Bot} ${string}`
@@ -158,6 +165,12 @@ export interface RESTOAuth2BotAuthorizationQuery {
* `true` or `false`—disallows the user from changing the guild dropdown
*/
disable_guild_select?: boolean;
/**
* The installation context for the authorization
*
* @see {@link https://docs.discord.com/developers/resources/application#application-object-application-integration-types}
*/
integration_type?: ApplicationIntegrationType;
}
/**
@@ -181,6 +194,7 @@ export interface RESTOAuth2AdvancedBotAuthorizationQuery {
disable_guild_select?: boolean;
response_type: string;
redirect_uri?: string;
integration_type?: ApplicationIntegrationType;
}
export interface RESTOAuth2AdvancedBotAuthorizationQueryResult {

View File

@@ -1,5 +1,12 @@
import type { Permissions, Snowflake } from '../../globals';
import type { APIApplication, APIGuild, APIUser, APIWebhook, OAuth2Scopes } from '../../payloads/v9/index';
import type {
APIApplication,
APIGuild,
APIUser,
APIWebhook,
ApplicationIntegrationType,
OAuth2Scopes,
} from '../../payloads/v9/index';
/**
* @see {@link https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information}
@@ -139,7 +146,7 @@ export interface RESTOAuth2BotAuthorizationQuery {
/**
* Needs to include bot for the bot flow
*/
scope:
scope?:
| `${OAuth2Scopes.Bot} ${string}`
| `${OAuth2Scopes.Bot}`
| `${string} ${OAuth2Scopes.Bot} ${string}`
@@ -158,6 +165,12 @@ export interface RESTOAuth2BotAuthorizationQuery {
* `true` or `false`—disallows the user from changing the guild dropdown
*/
disable_guild_select?: boolean;
/**
* The installation context for the authorization
*
* @see {@link https://docs.discord.com/developers/resources/application#application-object-application-integration-types}
*/
integration_type?: ApplicationIntegrationType;
}
/**
@@ -181,6 +194,7 @@ export interface RESTOAuth2AdvancedBotAuthorizationQuery {
disable_guild_select?: boolean;
response_type: string;
redirect_uri?: string;
integration_type?: ApplicationIntegrationType;
}
export interface RESTOAuth2AdvancedBotAuthorizationQueryResult {