Skip to content

Commit

Permalink
feat: Application patch and new properties (#810)
Browse files Browse the repository at this point in the history
* feat: application patch and properties

* docs(APIApplication): update tag documentation

* fix(RESTPatchCurrentApplicationJSONBody): add `flags`

* docs(APIApplication): update `approximate_guild_count`
  • Loading branch information
Jiralite authored Oct 3, 2023
1 parent 5515e29 commit 17f42e0
Show file tree
Hide file tree
Showing 12 changed files with 188 additions and 46 deletions.
34 changes: 23 additions & 11 deletions deno/payloads/v10/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export interface APIApplication {
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
*/
bot_require_code_grant: boolean;
/**
* Partial user object for the bot user associated with the application
*/
bot?: APIUser;
/**
* The url of the application's terms of service
*/
Expand All @@ -60,7 +64,7 @@ export interface APIApplication {
*
* @deprecated This field will be removed in v11
*/
summary: string;
summary: '';
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
Expand All @@ -77,6 +81,10 @@ export interface APIApplication {
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
*/
guild_id?: Snowflake;
/**
* A partial object of the associated guild
*/
guild?: APIPartialGuild;
/**
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
*/
Expand All @@ -96,30 +104,34 @@ export interface APIApplication {
*/
flags: ApplicationFlags;
/**
* Up to 5 tags describing the content and functionality of the application
* Approximate count of guilds the application has been added to
*/
tags?: [string, string?, string?, string?, string?];
approximate_guild_count?: number;
/**
* Settings for the application's default in-app authorization link, if enabled
* Array of redirect URIs for the application
*/
install_params?: APIApplicationInstallParams;
redirect_uris?: string[];
/**
* The application's default custom authorization link, if enabled
* The interactions endpoint URL for the application
*/
custom_install_url?: string;
interactions_endpoint_url?: string;
/**
* The application's role connection verification entry point,
* which when configured will render the app as a verification method in the guild role verification configuration
*/
role_connections_verification_url?: string;
/**
* An approximate count of the app's guild membership
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
*/
approximate_guild_count?: number;
tags?: [string, string?, string?, string?, string?];
/**
* A partial object of the associated guild
* Settings for the application's default in-app authorization link, if enabled
*/
guild?: APIPartialGuild;
install_params?: APIApplicationInstallParams;
/**
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
}

export interface APIApplicationInstallParams {
Expand Down
35 changes: 23 additions & 12 deletions deno/payloads/v9/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export interface APIApplication {
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
*/
bot_require_code_grant: boolean;
/**
* Partial user object for the bot user associated with the application
*/
bot?: APIUser;
/**
* The url of the application's terms of service
*/
Expand All @@ -60,7 +64,7 @@ export interface APIApplication {
*
* @deprecated This field will be removed in v11
*/
summary: string;
summary: '';
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
Expand All @@ -77,6 +81,10 @@ export interface APIApplication {
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
*/
guild_id?: Snowflake;
/**
* A partial object of the associated guild
*/
guild?: APIPartialGuild;
/**
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
*/
Expand All @@ -96,31 +104,34 @@ export interface APIApplication {
*/
flags: ApplicationFlags;
/**
* Up to 5 tags describing the content and functionality of the application
* Approximate count of guilds the application has been added to
*/
tags?: [string, string?, string?, string?, string?];
approximate_guild_count?: number;
/**
* Settings for the application's default in-app authorization link, if enabled
* Array of redirect URIs for the application
*/
install_params?: APIApplicationInstallParams;
redirect_uris?: string[];
/**
* The application's default custom authorization link, if enabled
* The interactions endpoint URL for the application
*/
custom_install_url?: string;
interactions_endpoint_url?: string;
/**
* The application's role connection verification entry point,
* which when configured will render the app as a verification method in the guild role verification configuration
*/
role_connections_verification_url?: string;
/**
* An approximate count of the app's guild membership
* s
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
*/
approximate_guild_count?: number;
tags?: [string, string?, string?, string?, string?];
/**
* A partial object of the associated guild
* Settings for the application's default in-app authorization link, if enabled
*/
guild?: APIPartialGuild;
install_params?: APIApplicationInstallParams;
/**
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
}

export interface APIApplicationInstallParams {
Expand Down
23 changes: 23 additions & 0 deletions deno/rest/v10/application.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { APIApplication, APIApplicationRoleConnectionMetadata } from '../../payloads/v10/application.ts';
import type { Nullable, StrictPartial } from '../../utils/internals.ts';

/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
Expand All @@ -19,3 +20,25 @@ export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRo
* https://discord.com/developers/docs/resources/application#get-current-application
*/
export type RESTGetCurrentApplicationResult = APIApplication;

/**
* https://discord.com/developers/docs/resources/application#edit-current-application
*/
export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
Pick<
APIApplication,
| 'custom_install_url'
| 'description'
| 'flags'
| 'role_connections_verification_url'
| 'install_params'
| 'interactions_endpoint_url'
| 'tags'
> &
Nullable<Pick<APIApplication, 'icon' | 'cover_image'>>
>;

/**
* https://discord.com/developers/docs/resources/application#edit-current-application
*/
export type RESTPatchCurrentApplicationResult = APIApplication;
1 change: 1 addition & 0 deletions deno/rest/v10/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ export const Routes = {
/**
* Route for:
* - GET `/applications/@me`
* - PATCH `/applications/@me`
*/
currentApplication() {
return '/applications/@me' as const;
Expand Down
23 changes: 23 additions & 0 deletions deno/rest/v9/application.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { APIApplication, APIApplicationRoleConnectionMetadata } from '../../payloads/v9/application.ts';
import type { StrictPartial, Nullable } from '../../utils/internals.ts';

/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
Expand All @@ -19,3 +20,25 @@ export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRo
* https://discord.com/developers/docs/resources/application#get-current-application
*/
export type RESTGetCurrentApplicationResult = APIApplication;

/**
* https://discord.com/developers/docs/resources/application#edit-current-application
*/
export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
Pick<
APIApplication,
| 'custom_install_url'
| 'description'
| 'flags'
| 'role_connections_verification_url'
| 'install_params'
| 'interactions_endpoint_url'
| 'tags'
> &
Nullable<Pick<APIApplication, 'icon' | 'cover_image'>>
>;

/**
* https://discord.com/developers/docs/resources/application#edit-current-application
*/
export type RESTPatchCurrentApplicationResult = APIApplication;
1 change: 1 addition & 0 deletions deno/rest/v9/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,7 @@ export const Routes = {
/**
* Route for:
* - GET `/applications/@me`
* - PATCH `/applications/@me`
*/
currentApplication() {
return '/applications/@me' as const;
Expand Down
34 changes: 23 additions & 11 deletions payloads/v10/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export interface APIApplication {
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
*/
bot_require_code_grant: boolean;
/**
* Partial user object for the bot user associated with the application
*/
bot?: APIUser;
/**
* The url of the application's terms of service
*/
Expand All @@ -60,7 +64,7 @@ export interface APIApplication {
*
* @deprecated This field will be removed in v11
*/
summary: string;
summary: '';
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
Expand All @@ -77,6 +81,10 @@ export interface APIApplication {
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
*/
guild_id?: Snowflake;
/**
* A partial object of the associated guild
*/
guild?: APIPartialGuild;
/**
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
*/
Expand All @@ -96,30 +104,34 @@ export interface APIApplication {
*/
flags: ApplicationFlags;
/**
* Up to 5 tags describing the content and functionality of the application
* Approximate count of guilds the application has been added to
*/
tags?: [string, string?, string?, string?, string?];
approximate_guild_count?: number;
/**
* Settings for the application's default in-app authorization link, if enabled
* Array of redirect URIs for the application
*/
install_params?: APIApplicationInstallParams;
redirect_uris?: string[];
/**
* The application's default custom authorization link, if enabled
* The interactions endpoint URL for the application
*/
custom_install_url?: string;
interactions_endpoint_url?: string;
/**
* The application's role connection verification entry point,
* which when configured will render the app as a verification method in the guild role verification configuration
*/
role_connections_verification_url?: string;
/**
* An approximate count of the app's guild membership
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
*/
approximate_guild_count?: number;
tags?: [string, string?, string?, string?, string?];
/**
* A partial object of the associated guild
* Settings for the application's default in-app authorization link, if enabled
*/
guild?: APIPartialGuild;
install_params?: APIApplicationInstallParams;
/**
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
}

export interface APIApplicationInstallParams {
Expand Down
35 changes: 23 additions & 12 deletions payloads/v9/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export interface APIApplication {
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
*/
bot_require_code_grant: boolean;
/**
* Partial user object for the bot user associated with the application
*/
bot?: APIUser;
/**
* The url of the application's terms of service
*/
Expand All @@ -60,7 +64,7 @@ export interface APIApplication {
*
* @deprecated This field will be removed in v11
*/
summary: string;
summary: '';
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
Expand All @@ -77,6 +81,10 @@ export interface APIApplication {
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
*/
guild_id?: Snowflake;
/**
* A partial object of the associated guild
*/
guild?: APIPartialGuild;
/**
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
*/
Expand All @@ -96,31 +104,34 @@ export interface APIApplication {
*/
flags: ApplicationFlags;
/**
* Up to 5 tags describing the content and functionality of the application
* Approximate count of guilds the application has been added to
*/
tags?: [string, string?, string?, string?, string?];
approximate_guild_count?: number;
/**
* Settings for the application's default in-app authorization link, if enabled
* Array of redirect URIs for the application
*/
install_params?: APIApplicationInstallParams;
redirect_uris?: string[];
/**
* The application's default custom authorization link, if enabled
* The interactions endpoint URL for the application
*/
custom_install_url?: string;
interactions_endpoint_url?: string;
/**
* The application's role connection verification entry point,
* which when configured will render the app as a verification method in the guild role verification configuration
*/
role_connections_verification_url?: string;
/**
* An approximate count of the app's guild membership
* s
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
*/
approximate_guild_count?: number;
tags?: [string, string?, string?, string?, string?];
/**
* A partial object of the associated guild
* Settings for the application's default in-app authorization link, if enabled
*/
guild?: APIPartialGuild;
install_params?: APIApplicationInstallParams;
/**
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
}

export interface APIApplicationInstallParams {
Expand Down
Loading

1 comment on commit 17f42e0

@vercel
Copy link

@vercel vercel bot commented on 17f42e0 Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.