Skip to content

Commit

Permalink
feat(APIApplication): approx guild count and get self application end…
Browse files Browse the repository at this point in the history
…point (#728)

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
  • Loading branch information
almeidx and Jiralite committed Jul 17, 2023
1 parent 289c53a commit 874f135
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 8 deletions.
9 changes: 9 additions & 0 deletions deno/payloads/v10/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import type { Permissions, Snowflake } from '../../globals.ts';
import type { LocalizationMap } from '../common.ts';
import type { APIPartialGuild } from './guild.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APITeam } from './teams.ts';
import type { APIUser } from './user.ts';
Expand Down Expand Up @@ -111,6 +112,14 @@ export interface APIApplication {
* 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
*/
approximate_guild_count?: number;
/**
* A partial object of the associated guild
*/
guild?: APIPartialGuild;
}

export interface APIApplicationInstallParams {
Expand Down
10 changes: 10 additions & 0 deletions deno/payloads/v9/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import type { Permissions, Snowflake } from '../../globals.ts';
import type { LocalizationMap } from '../common.ts';
import type { APIPartialGuild } from './guild.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APITeam } from './teams.ts';
import type { APIUser } from './user.ts';
Expand Down Expand Up @@ -111,6 +112,15 @@ export interface APIApplication {
* 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
*/
approximate_guild_count?: number;
/**
* A partial object of the associated guild
*/
guild?: APIPartialGuild;
}

export interface APIApplicationInstallParams {
Expand Down
7 changes: 6 additions & 1 deletion deno/rest/v10/application.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { APIApplicationRoleConnectionMetadata } from '../../payloads/v10/application.ts';
import type { APIApplication, APIApplicationRoleConnectionMetadata } from '../../payloads/v10/application.ts';

/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
Expand All @@ -14,3 +14,8 @@ export type RESTPutAPIApplicationRoleConnectionMetadataJSONBody = APIApplication
* https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
*/
export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRoleConnectionMetadata[];

/**
* https://discord.com/developers/docs/resources/application#get-current-application
*/
export type RESTGetCurrentApplicationResult = APIApplication;
10 changes: 9 additions & 1 deletion deno/rest/v10/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ export const Routes = {

/**
* Route for:
* - GET `/channels/{channel.id}/users/@me/threads/archived/prviate`
* - GET `/channels/{channel.id}/users/@me/threads/archived/private`
*/
channelJoinedArchivedThreads(channelId: Snowflake) {
return `/channels/${channelId}/users/@me/threads/archived/private` as const;
Expand Down Expand Up @@ -887,6 +887,14 @@ export const Routes = {
guildOnboarding(guildId: Snowflake) {
return `/guilds/${guildId}/onboarding` as const;
},

/**
* Route for:
* - GET `/applications/@me`
*/
currentApplication() {
return '/applications/@me' as const;
},
};

export const StickerPackApplicationId = '710982414301790216';
Expand Down
7 changes: 6 additions & 1 deletion deno/rest/v9/application.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { APIApplicationRoleConnectionMetadata } from '../../payloads/v9/application.ts';
import type { APIApplication, APIApplicationRoleConnectionMetadata } from '../../payloads/v9/application.ts';

/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
Expand All @@ -14,3 +14,8 @@ export type RESTPutAPIApplicationRoleConnectionMetadataJSONBody = APIApplication
* https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
*/
export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRoleConnectionMetadata[];

/**
* https://discord.com/developers/docs/resources/application#get-current-application
*/
export type RESTGetCurrentApplicationResult = APIApplication;
10 changes: 9 additions & 1 deletion deno/rest/v9/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ export const Routes = {

/**
* Route for:
* - GET `/channels/{channel.id}/users/@me/threads/archived/prviate`
* - GET `/channels/{channel.id}/users/@me/threads/archived/private`
*/
channelJoinedArchivedThreads(channelId: Snowflake) {
return `/channels/${channelId}/users/@me/threads/archived/private` as const;
Expand Down Expand Up @@ -896,6 +896,14 @@ export const Routes = {
guildOnboarding(guildId: Snowflake) {
return `/guilds/${guildId}/onboarding` as const;
},

/**
* Route for:
* - GET `/applications/@me`
*/
currentApplication() {
return '/applications/@me' as const;
},
};

export const StickerPackApplicationId = '710982414301790216';
Expand Down
9 changes: 9 additions & 0 deletions payloads/v10/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import type { Permissions, Snowflake } from '../../globals';
import type { LocalizationMap } from '../common';
import type { APIPartialGuild } from './guild';
import type { OAuth2Scopes } from './oauth2';
import type { APITeam } from './teams';
import type { APIUser } from './user';
Expand Down Expand Up @@ -111,6 +112,14 @@ export interface APIApplication {
* 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
*/
approximate_guild_count?: number;
/**
* A partial object of the associated guild
*/
guild?: APIPartialGuild;
}

export interface APIApplicationInstallParams {
Expand Down
10 changes: 10 additions & 0 deletions payloads/v9/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import type { Permissions, Snowflake } from '../../globals';
import type { LocalizationMap } from '../common';
import type { APIPartialGuild } from './guild';
import type { OAuth2Scopes } from './oauth2';
import type { APITeam } from './teams';
import type { APIUser } from './user';
Expand Down Expand Up @@ -111,6 +112,15 @@ export interface APIApplication {
* 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
*/
approximate_guild_count?: number;
/**
* A partial object of the associated guild
*/
guild?: APIPartialGuild;
}

export interface APIApplicationInstallParams {
Expand Down
7 changes: 6 additions & 1 deletion rest/v10/application.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { APIApplicationRoleConnectionMetadata } from '../../payloads/v10/application';
import type { APIApplication, APIApplicationRoleConnectionMetadata } from '../../payloads/v10/application';

/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
Expand All @@ -14,3 +14,8 @@ export type RESTPutAPIApplicationRoleConnectionMetadataJSONBody = APIApplication
* https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
*/
export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRoleConnectionMetadata[];

/**
* https://discord.com/developers/docs/resources/application#get-current-application
*/
export type RESTGetCurrentApplicationResult = APIApplication;
10 changes: 9 additions & 1 deletion rest/v10/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ export const Routes = {

/**
* Route for:
* - GET `/channels/{channel.id}/users/@me/threads/archived/prviate`
* - GET `/channels/{channel.id}/users/@me/threads/archived/private`
*/
channelJoinedArchivedThreads(channelId: Snowflake) {
return `/channels/${channelId}/users/@me/threads/archived/private` as const;
Expand Down Expand Up @@ -887,6 +887,14 @@ export const Routes = {
guildOnboarding(guildId: Snowflake) {
return `/guilds/${guildId}/onboarding` as const;
},

/**
* Route for:
* - GET `/applications/@me`
*/
currentApplication() {
return '/applications/@me' as const;
},
};

export const StickerPackApplicationId = '710982414301790216';
Expand Down
7 changes: 6 additions & 1 deletion rest/v9/application.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { APIApplicationRoleConnectionMetadata } from '../../payloads/v9/application';
import type { APIApplication, APIApplicationRoleConnectionMetadata } from '../../payloads/v9/application';

/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
Expand All @@ -14,3 +14,8 @@ export type RESTPutAPIApplicationRoleConnectionMetadataJSONBody = APIApplication
* https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
*/
export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRoleConnectionMetadata[];

/**
* https://discord.com/developers/docs/resources/application#get-current-application
*/
export type RESTGetCurrentApplicationResult = APIApplication;
10 changes: 9 additions & 1 deletion rest/v9/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ export const Routes = {

/**
* Route for:
* - GET `/channels/{channel.id}/users/@me/threads/archived/prviate`
* - GET `/channels/{channel.id}/users/@me/threads/archived/private`
*/
channelJoinedArchivedThreads(channelId: Snowflake) {
return `/channels/${channelId}/users/@me/threads/archived/private` as const;
Expand Down Expand Up @@ -896,6 +896,14 @@ export const Routes = {
guildOnboarding(guildId: Snowflake) {
return `/guilds/${guildId}/onboarding` as const;
},

/**
* Route for:
* - GET `/applications/@me`
*/
currentApplication() {
return '/applications/@me' as const;
},
};

export const StickerPackApplicationId = '710982414301790216';
Expand Down

1 comment on commit 874f135

@vercel
Copy link

@vercel vercel bot commented on 874f135 Jul 17, 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.