Skip to content

Commit

Permalink
feat: application patch and properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed Aug 22, 2023
1 parent d24e928 commit 97c8539
Show file tree
Hide file tree
Showing 12 changed files with 184 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
* An approximate count of the app's guild membership
*/
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 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
* An approximate count of the app's guild membership
*/
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 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
22 changes: 22 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,24 @@ 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'
| '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 @@ -892,6 +892,7 @@ export const Routes = {
/**
* Route for:
* - GET `/applications/@me`
* - PATCH `/applications/@me`
*/
currentApplication() {
return '/applications/@me' as const;
Expand Down
22 changes: 22 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,24 @@ 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'
| '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 @@ -901,6 +901,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
* An approximate count of the app's guild membership
*/
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 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
* An approximate count of the app's guild membership
*/
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 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

0 comments on commit 97c8539

Please sign in to comment.