diff --git a/.eslint-plugin-local/index.ts b/.eslint-plugin-local/index.ts index 0a4c6068..27b96092 100644 --- a/.eslint-plugin-local/index.ts +++ b/.eslint-plugin-local/index.ts @@ -37,6 +37,9 @@ const schema = [ }, ] as const; +const REST_TYPE_NAME_REGEX = + /^REST(?:Get|Patch|Post|Put|Delete)[a-zA-Z0-9]+(?:JSONBody|FormDataBody|URLEncodedData|Result|Query)$/; + export = { rules: { 'explicitly-optional-undefined-properties': ESLintUtils.RuleCreator.withoutDocs({ @@ -131,5 +134,54 @@ export = { }, defaultOptions: [{ interfaceEndings: [] }], }), + 'rest-type-naming-convention': ESLintUtils.RuleCreator.withoutDocs<[{ whitelist: string[] }], 'invalidName'>({ + create: (context) => { + const { whitelist } = context.options[0]; + const whitelistSet = new Set(whitelist); + + return { + 'TSTypeAliasDeclaration, TSInterfaceDeclaration': ( + node: TSESTree.TSTypeAliasDeclaration | TSESTree.TSInterfaceDeclaration, + ) => { + if (node.id.type !== AST_NODE_TYPES.Identifier) { + return; + } + + const { name } = node.id; + if (whitelistSet.has(name)) { + return; + } + + if (!REST_TYPE_NAME_REGEX.test(name)) { + context.report({ + node: node.id, + messageId: 'invalidName', + data: { name }, + }); + } + }, + }; + }, + meta: { + messages: { + invalidName: `{{ name }} does not match REST type naming convention. Must match ${REST_TYPE_NAME_REGEX.source}.`, + }, + type: 'problem', + schema: [ + { + type: 'object', + properties: { + whitelist: { + type: 'array', + items: { + type: 'string', + }, + }, + }, + }, + ] as const, + }, + defaultOptions: [{ whitelist: [] }], + }), }, }; diff --git a/.eslintrc.json b/.eslintrc.json index ab5a35e9..6c47cc3f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -17,5 +17,54 @@ "typescript-sort-keys/string-enum": "off", "unicorn/prefer-math-trunc": "off", "jsdoc/no-undefined-types": "off" - } + }, + "overrides": [ + { + "files": ["rest/v10/*.ts", "rest/v9/*.ts"], + "excludedFiles": ["rest/v10/index.ts", "rest/v9/index.ts"], + "rules": { + "local/rest-type-naming-convention": [ + "error", + { + "whitelist": [ + "RESTAPIAttachment", + "RESTAPIChannelPatchOverwrite", + "RESTAPIGuildChannelResolvable", + "RESTAPIGuildCreateOverwrite", + "RESTAPIGuildCreatePartialChannel", + "RESTAPIGuildCreateRole", + "RESTAPIGuildOnboardingPrompt", + "RESTAPIGuildOnboardingPromptOption", + "RESTAPIMessageReference", + "RESTAPIPartialCurrentUserGuild", + "RESTAPIPoll", + + "RESTOAuth2AdvancedBotAuthorizationQuery", + "RESTOAuth2AdvancedBotAuthorizationQueryResult", + "RESTOAuth2AuthorizationQuery", + "RESTOAuth2BotAuthorizationQuery", + "RESTOAuth2ImplicitAuthorizationQuery", + "RESTOAuth2ImplicitAuthorizationURLFragmentResult", + + // Deprecated types + "APIChannelPatchOverwrite", + "APIGuildChannelResolvable", + "APIGuildCreateOverwrite", + "APIGuildCreatePartialChannel", + "APIGuildCreateRole", + "APIMessageReferenceSend", + "GetAPIVoiceRegionsResult", + "RESTAPIModifyGuildOnboardingPromptData", + "RESTAPIModifyGuildOnboardingPromptOptionData", + "RESTAPIPollCreate", + "RESTDeleteAPIChannelMessageOwnReaction", + "RESTGetAPIStickerPack", + "RESTOAuth2AuthorizationQueryResult", + "RESTPostAPIEntitlementBody" + ] + } + ] + } + } + ] } diff --git a/deno/rest/v10/channel.ts b/deno/rest/v10/channel.ts index 424a1c58..6e087010 100644 --- a/deno/rest/v10/channel.ts +++ b/deno/rest/v10/channel.ts @@ -26,12 +26,17 @@ import type { ChannelFlags, } from '../../payloads/v10/mod.ts'; import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts'; -import type { RESTAPIPollCreate } from './poll.ts'; +import type { RESTAPIPoll } from './poll.ts'; -export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody { +export interface RESTAPIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody { id: Snowflake; } +/** + * @deprecated Use {@link RESTAPIChannelPatchOverwrite} instead + */ +export type APIChannelPatchOverwrite = RESTAPIChannelPatchOverwrite; + /** * https://discord.com/developers/docs/resources/channel#get-channel */ @@ -98,7 +103,7 @@ export interface RESTPatchAPIChannelJSONBody { * * Channel types: all excluding newsThread, publicThread, privateThread */ - permission_overwrites?: APIChannelPatchOverwrite[] | null | undefined; + permission_overwrites?: RESTAPIChannelPatchOverwrite[] | null | undefined; /** * ID of the new parent category for a channel * @@ -237,7 +242,7 @@ export type RESTGetAPIChannelMessageResult = APIMessage; /** * https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */ -export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< +export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< Required> > & StrictPartial & { @@ -249,6 +254,11 @@ export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesO fail_if_not_exists?: boolean | undefined; }; +/** + * @deprecated Use {@link RESTAPIMessageReference} instead + */ +export type APIMessageReferenceSend = RESTAPIMessageReference; + /** * https://discord.com/developers/docs/resources/channel#attachment-object */ @@ -300,7 +310,7 @@ export interface RESTPostAPIChannelMessageJSONBody { * * See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */ - message_reference?: APIMessageReferenceSend | undefined; + message_reference?: RESTAPIMessageReference | undefined; /** * The components to include with the message * @@ -329,7 +339,7 @@ export interface RESTPostAPIChannelMessageJSONBody { /** * A poll! */ - poll?: RESTAPIPollCreate | undefined; + poll?: RESTAPIPoll | undefined; } /** @@ -362,7 +372,12 @@ export type RESTPutAPIChannelMessageReactionResult = never; /** * https://discord.com/developers/docs/resources/channel#delete-own-reaction */ -export type RESTDeleteAPIChannelMessageOwnReaction = never; +export type RESTDeleteAPIChannelMessageOwnReactionResult = never; + +/** + * @deprecated Use {@link RESTDeleteAPIChannelMessageOwnReactionResult} instead + */ +export type RESTDeleteAPIChannelMessageOwnReaction = RESTDeleteAPIChannelMessageOwnReactionResult; /** * https://discord.com/developers/docs/resources/channel#delete-user-reaction diff --git a/deno/rest/v10/guild.ts b/deno/rest/v10/guild.ts index c1a807de..ccd7f13d 100644 --- a/deno/rest/v10/guild.ts +++ b/deno/rest/v10/guild.ts @@ -37,14 +37,25 @@ import type { } from '../../utils/internals.ts'; import type { RESTPutAPIChannelPermissionJSONBody } from './channel.ts'; -export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody { +export interface RESTAPIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody { id: number | string; } -export type APIGuildChannelResolvable = Exclude; -export type APIGuildCreatePartialChannel = StrictPartial< +/** + * @deprecated Use {@link RESTAPIGuildCreateOverwrite} instead + */ +export type APIGuildCreateOverwrite = RESTAPIGuildCreateOverwrite; + +export type RESTAPIGuildChannelResolvable = Exclude; + +/** + * @deprecated Use {@link RESTAPIGuildChannelResolvable} instead + */ +export type APIGuildChannelResolvable = RESTAPIGuildChannelResolvable; + +export type RESTAPIGuildCreatePartialChannel = StrictPartial< DistributivePick< - APIGuildChannelResolvable, + RESTAPIGuildChannelResolvable, | 'available_tags' | 'bitrate' | 'default_auto_archive_duration' @@ -66,13 +77,23 @@ export type APIGuildCreatePartialChannel = StrictPartial< name: string; id?: number | string | undefined; parent_id?: number | string | null | undefined; - permission_overwrites?: APIGuildCreateOverwrite[] | undefined; + permission_overwrites?: RESTAPIGuildCreateOverwrite[] | undefined; }; -export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody { +/** + * @deprecated Use {@link RESTAPIGuildCreatePartialChannel} instead + */ +export type APIGuildCreatePartialChannel = RESTAPIGuildCreatePartialChannel; + +export interface RESTAPIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody { id: number | string; } +/** + * @deprecated Use {@link RESTAPIGuildCreateRole} instead + */ +export type APIGuildCreateRole = RESTAPIGuildCreateRole; + /** * https://discord.com/developers/docs/resources/guild#create-guild */ @@ -124,7 +145,7 @@ export interface RESTPostAPIGuildsJSONBody { * * See https://discord.com/developers/docs/topics/permissions#role-object */ - roles?: APIGuildCreateRole[] | undefined; + roles?: RESTAPIGuildCreateRole[] | undefined; /** * New guild's channels * @@ -138,7 +159,7 @@ export interface RESTPostAPIGuildsJSONBody { * * See https://discord.com/developers/docs/resources/channel#channel-object */ - channels?: APIGuildCreatePartialChannel[] | undefined; + channels?: RESTAPIGuildCreatePartialChannel[] | undefined; /** * ID for afk channel */ @@ -333,7 +354,7 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[]; /** * https://discord.com/developers/docs/resources/guild#create-guild-channel */ -export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit; +export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit; /** * https://discord.com/developers/docs/resources/guild#create-guild-channel @@ -930,20 +951,25 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP /** * Prompts shown during onboarding and in customize community */ - prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined; + prompts?: RESTAPIGuildOnboardingPrompt[] | undefined; }; -export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< +export type RESTAPIGuildOnboardingPrompt = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< Partial> > & Pick & { /** * Options available within the prompt */ - options: RESTAPIModifyGuildOnboardingPromptOptionData[]; + options: RESTAPIGuildOnboardingPromptOption[]; }; -export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< +/** + * @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead. + */ +export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt; + +export type RESTAPIGuildOnboardingPromptOption = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< Partial> > & Pick & { @@ -961,6 +987,11 @@ export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossibl emoji_animated?: boolean | null | undefined; }; +/** + * @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead. + */ +export type RESTAPIModifyGuildOnboardingPromptOptionData = RESTAPIGuildOnboardingPromptOption; + /** * https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */ diff --git a/deno/rest/v10/monetization.ts b/deno/rest/v10/monetization.ts index 2139fec8..2a92f44f 100644 --- a/deno/rest/v10/monetization.ts +++ b/deno/rest/v10/monetization.ts @@ -46,7 +46,7 @@ export type RESTGetAPIEntitlementsResult = APIEntitlement[]; /** * https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */ -export interface RESTPostAPIEntitlementBody { +export interface RESTPostAPIEntitlementJSONBody { /** * ID of the SKU to grant the entitlement to */ @@ -61,6 +61,11 @@ export interface RESTPostAPIEntitlementBody { owner_type: EntitlementOwnerType; } +/** + * @deprecated Use {@link RESTPostAPIEntitlementJSONBody} instead + */ +export type RESTPostAPIEntitlementBody = RESTPostAPIEntitlementJSONBody; + /** * https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */ diff --git a/deno/rest/v10/oauth2.ts b/deno/rest/v10/oauth2.ts index d42021ac..67b18765 100644 --- a/deno/rest/v10/oauth2.ts +++ b/deno/rest/v10/oauth2.ts @@ -51,11 +51,16 @@ export interface RESTPostOAuth2TokenRevocationQuery { /** * https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example */ -export interface RESTOAuth2AuthorizationQueryResult { +export interface RESTPostOAuth2AuthorizationQueryResult { code: string; state?: string; } +/** + * @deprecated Use {@link RESTPostOAuth2AuthorizationQueryResult} instead + */ +export type RESTOAuth2AuthorizationQueryResult = RESTPostOAuth2AuthorizationQueryResult; + /** * https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example */ diff --git a/deno/rest/v10/poll.ts b/deno/rest/v10/poll.ts index ab1a6452..084ee2c5 100644 --- a/deno/rest/v10/poll.ts +++ b/deno/rest/v10/poll.ts @@ -20,7 +20,7 @@ export interface RESTGetAPIPollAnswerVotersQuery { /** * https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure */ -export interface RESTAPIPollCreate +export interface RESTAPIPoll extends Omit, Partial> { /** @@ -35,6 +35,11 @@ export interface RESTAPIPollCreate duration?: number; } +/** + * @deprecated Use {@link RESTAPIPoll} instead + */ +export type RESTAPIPollCreate = RESTAPIPoll; + /** * https://discord.com/developers/docs/resources/poll#get-answer-voters */ diff --git a/deno/rest/v10/sticker.ts b/deno/rest/v10/sticker.ts index 6069e265..86183a1c 100644 --- a/deno/rest/v10/sticker.ts +++ b/deno/rest/v10/sticker.ts @@ -15,7 +15,12 @@ export interface RESTGetStickerPacksResult { /** * https://discord.com/developers/docs/resources/sticker#get-sticker-pack */ -export type RESTGetAPIStickerPack = APIStickerPack; +export type RESTGetAPIStickerPackResult = APIStickerPack; + +/** + * @deprecated Use {@link RESTGetAPIStickerPackResult} instead + */ +export type RESTGetAPIStickerPack = RESTGetAPIStickerPackResult; /** * https://discord.com/developers/docs/resources/sticker#list-sticker-packs diff --git a/deno/rest/v10/webhook.ts b/deno/rest/v10/webhook.ts index 683b5cb4..0837d023 100644 --- a/deno/rest/v10/webhook.ts +++ b/deno/rest/v10/webhook.ts @@ -10,7 +10,7 @@ import type { } from '../../payloads/v10/mod.ts'; import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals.ts'; import type { RESTAPIAttachment } from './channel.ts'; -import type { RESTAPIPollCreate } from './poll.ts'; +import type { RESTAPIPoll } from './poll.ts'; /** * https://discord.com/developers/docs/resources/webhook#create-webhook */ @@ -158,7 +158,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody { /** * A poll! */ - poll?: RESTAPIPollCreate | undefined; + poll?: RESTAPIPoll | undefined; } /** diff --git a/deno/rest/v9/channel.ts b/deno/rest/v9/channel.ts index 9c2dca2d..724602ae 100644 --- a/deno/rest/v9/channel.ts +++ b/deno/rest/v9/channel.ts @@ -26,12 +26,17 @@ import type { ChannelFlags, } from '../../payloads/v9/mod.ts'; import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts'; -import type { RESTAPIPollCreate } from './poll.ts'; +import type { RESTAPIPoll } from './poll.ts'; -export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody { +export interface RESTAPIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody { id: Snowflake; } +/** + * @deprecated Use {@link RESTAPIChannelPatchOverwrite} instead + */ +export type APIChannelPatchOverwrite = RESTAPIChannelPatchOverwrite; + /** * https://discord.com/developers/docs/resources/channel#get-channel */ @@ -237,7 +242,7 @@ export type RESTGetAPIChannelMessageResult = APIMessage; /** * https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */ -export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< +export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< Required> > & StrictPartial & { @@ -249,6 +254,11 @@ export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesO fail_if_not_exists?: boolean | undefined; }; +/** + * @deprecated Use {@link RESTAPIMessageReference} instead + */ +export type APIMessageReferenceSend = RESTAPIMessageReference; + /** * https://discord.com/developers/docs/resources/channel#attachment-object */ @@ -308,7 +318,7 @@ export interface RESTPostAPIChannelMessageJSONBody { * * See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */ - message_reference?: APIMessageReferenceSend | undefined; + message_reference?: RESTAPIMessageReference | undefined; /** * The components to include with the message * @@ -337,7 +347,7 @@ export interface RESTPostAPIChannelMessageJSONBody { /** * A poll! */ - poll?: RESTAPIPollCreate | undefined; + poll?: RESTAPIPoll | undefined; } /** @@ -370,7 +380,12 @@ export type RESTPutAPIChannelMessageReactionResult = never; /** * https://discord.com/developers/docs/resources/channel#delete-own-reaction */ -export type RESTDeleteAPIChannelMessageOwnReaction = never; +export type RESTDeleteAPIChannelMessageOwnReactionResult = never; + +/** + * @deprecated Use {@link RESTDeleteAPIChannelMessageOwnReactionResult} instead + */ +export type RESTDeleteAPIChannelMessageOwnReaction = RESTDeleteAPIChannelMessageOwnReactionResult; /** * https://discord.com/developers/docs/resources/channel#delete-user-reaction diff --git a/deno/rest/v9/guild.ts b/deno/rest/v9/guild.ts index 6d65a86c..b8d9dd84 100644 --- a/deno/rest/v9/guild.ts +++ b/deno/rest/v9/guild.ts @@ -37,14 +37,25 @@ import type { } from '../../utils/internals.ts'; import type { RESTPutAPIChannelPermissionJSONBody } from './channel.ts'; -export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody { +export interface RESTAPIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody { id: number | string; } -export type APIGuildChannelResolvable = Exclude; -export type APIGuildCreatePartialChannel = StrictPartial< +/** + * @deprecated Use {@link RESTAPIGuildCreateOverwrite} instead + */ +export type APIGuildCreateOverwrite = RESTAPIGuildCreateOverwrite; + +export type RESTAPIGuildChannelResolvable = Exclude; + +/** + * @deprecated Use {@link RESTAPIGuildChannelResolvable} instead + */ +export type APIGuildChannelResolvable = RESTAPIGuildChannelResolvable; + +export type RESTAPIGuildCreatePartialChannel = StrictPartial< DistributivePick< - APIGuildChannelResolvable, + RESTAPIGuildChannelResolvable, | 'available_tags' | 'bitrate' | 'default_auto_archive_duration' @@ -66,13 +77,23 @@ export type APIGuildCreatePartialChannel = StrictPartial< name: string; id?: number | string | undefined; parent_id?: number | string | null | undefined; - permission_overwrites?: APIGuildCreateOverwrite[] | undefined; + permission_overwrites?: RESTAPIGuildCreateOverwrite[] | undefined; }; -export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody { +/** + * @deprecated Use {@link RESTAPIGuildCreatePartialChannel} instead + */ +export type APIGuildCreatePartialChannel = RESTAPIGuildCreatePartialChannel; + +export interface RESTAPIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody { id: number | string; } +/** + * @deprecated Use {@link RESTAPIGuildCreateRole} instead + */ +export type APIGuildCreateRole = RESTAPIGuildCreateRole; + /** * https://discord.com/developers/docs/resources/guild#create-guild */ @@ -124,7 +145,7 @@ export interface RESTPostAPIGuildsJSONBody { * * See https://discord.com/developers/docs/topics/permissions#role-object */ - roles?: APIGuildCreateRole[] | undefined; + roles?: RESTAPIGuildCreateRole[] | undefined; /** * New guild's channels * @@ -138,7 +159,7 @@ export interface RESTPostAPIGuildsJSONBody { * * See https://discord.com/developers/docs/resources/channel#channel-object */ - channels?: APIGuildCreatePartialChannel[] | undefined; + channels?: RESTAPIGuildCreatePartialChannel[] | undefined; /** * ID for afk channel */ @@ -333,7 +354,7 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[]; /** * https://discord.com/developers/docs/resources/guild#create-guild-channel */ -export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit; +export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit; /** * https://discord.com/developers/docs/resources/guild#create-guild-channel @@ -936,20 +957,25 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP /** * Prompts shown during onboarding and in customize community */ - prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined; + prompts?: RESTAPIGuildOnboardingPrompt[] | undefined; }; -export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< +export type RESTAPIGuildOnboardingPrompt = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< Partial> > & Pick & { /** * Options available within the prompt */ - options: RESTAPIModifyGuildOnboardingPromptOptionData[]; + options: RESTAPIGuildOnboardingPromptOption[]; }; -export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< +/** + * @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead. + */ +export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt; + +export type RESTAPIGuildOnboardingPromptOption = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< Partial> > & Pick & { @@ -967,6 +993,11 @@ export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossibl emoji_animated?: boolean | null | undefined; }; +/** + * @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead. + */ +export type RESTAPIModifyGuildOnboardingPromptOptionData = RESTAPIGuildOnboardingPromptOption; + /** * https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */ diff --git a/deno/rest/v9/monetization.ts b/deno/rest/v9/monetization.ts index 2139fec8..2a92f44f 100644 --- a/deno/rest/v9/monetization.ts +++ b/deno/rest/v9/monetization.ts @@ -46,7 +46,7 @@ export type RESTGetAPIEntitlementsResult = APIEntitlement[]; /** * https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */ -export interface RESTPostAPIEntitlementBody { +export interface RESTPostAPIEntitlementJSONBody { /** * ID of the SKU to grant the entitlement to */ @@ -61,6 +61,11 @@ export interface RESTPostAPIEntitlementBody { owner_type: EntitlementOwnerType; } +/** + * @deprecated Use {@link RESTPostAPIEntitlementJSONBody} instead + */ +export type RESTPostAPIEntitlementBody = RESTPostAPIEntitlementJSONBody; + /** * https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */ diff --git a/deno/rest/v9/oauth2.ts b/deno/rest/v9/oauth2.ts index 38bf227d..b5d9fe77 100644 --- a/deno/rest/v9/oauth2.ts +++ b/deno/rest/v9/oauth2.ts @@ -51,11 +51,16 @@ export interface RESTPostOAuth2TokenRevocationQuery { /** * https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example */ -export interface RESTOAuth2AuthorizationQueryResult { +export interface RESTPostOAuth2AuthorizationQueryResult { code: string; state?: string; } +/** + * @deprecated Use {@link RESTPostOAuth2AuthorizationQueryResult} instead + */ +export type RESTOAuth2AuthorizationQueryResult = RESTPostOAuth2AuthorizationQueryResult; + /** * https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example */ diff --git a/deno/rest/v9/poll.ts b/deno/rest/v9/poll.ts index 8a277907..9d619063 100644 --- a/deno/rest/v9/poll.ts +++ b/deno/rest/v9/poll.ts @@ -20,7 +20,7 @@ export interface RESTGetAPIPollAnswerVotersQuery { /** * https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure */ -export interface RESTAPIPollCreate +export interface RESTAPIPoll extends Omit, Partial> { /** @@ -35,6 +35,11 @@ export interface RESTAPIPollCreate duration?: number; } +/** + * @deprecated Use {@link RESTAPIPoll} instead + */ +export type RESTAPIPollCreate = RESTAPIPoll; + /** * https://discord.com/developers/docs/resources/poll#get-answer-voters */ diff --git a/deno/rest/v9/sticker.ts b/deno/rest/v9/sticker.ts index 606ea2e7..f055d231 100644 --- a/deno/rest/v9/sticker.ts +++ b/deno/rest/v9/sticker.ts @@ -15,7 +15,12 @@ export interface RESTGetStickerPacksResult { /** * https://discord.com/developers/docs/resources/sticker#get-sticker-pack */ -export type RESTGetAPIStickerPack = APIStickerPack; +export type RESTGetAPIStickerPackResult = APIStickerPack; + +/** + * @deprecated Use {@link RESTGetAPIStickerPackResult} instead + */ +export type RESTGetAPIStickerPack = RESTGetAPIStickerPackResult; /** * https://discord.com/developers/docs/resources/sticker#list-sticker-packs diff --git a/deno/rest/v9/webhook.ts b/deno/rest/v9/webhook.ts index 5d82b61c..48c82436 100644 --- a/deno/rest/v9/webhook.ts +++ b/deno/rest/v9/webhook.ts @@ -10,7 +10,7 @@ import type { } from '../../payloads/v9/mod.ts'; import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals.ts'; import type { RESTAPIAttachment } from './channel.ts'; -import type { RESTAPIPollCreate } from './poll.ts'; +import type { RESTAPIPoll } from './poll.ts'; /** * https://discord.com/developers/docs/resources/webhook#create-webhook */ @@ -158,7 +158,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody { /** * A poll! */ - poll?: RESTAPIPollCreate | undefined; + poll?: RESTAPIPoll | undefined; } /** diff --git a/rest/v10/channel.ts b/rest/v10/channel.ts index 716cf836..8a0c9603 100644 --- a/rest/v10/channel.ts +++ b/rest/v10/channel.ts @@ -26,12 +26,17 @@ import type { ChannelFlags, } from '../../payloads/v10/index'; import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals'; -import type { RESTAPIPollCreate } from './poll'; +import type { RESTAPIPoll } from './poll'; -export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody { +export interface RESTAPIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody { id: Snowflake; } +/** + * @deprecated Use {@link RESTAPIChannelPatchOverwrite} instead + */ +export type APIChannelPatchOverwrite = RESTAPIChannelPatchOverwrite; + /** * https://discord.com/developers/docs/resources/channel#get-channel */ @@ -98,7 +103,7 @@ export interface RESTPatchAPIChannelJSONBody { * * Channel types: all excluding newsThread, publicThread, privateThread */ - permission_overwrites?: APIChannelPatchOverwrite[] | null | undefined; + permission_overwrites?: RESTAPIChannelPatchOverwrite[] | null | undefined; /** * ID of the new parent category for a channel * @@ -237,7 +242,7 @@ export type RESTGetAPIChannelMessageResult = APIMessage; /** * https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */ -export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< +export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< Required> > & StrictPartial & { @@ -249,6 +254,11 @@ export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesO fail_if_not_exists?: boolean | undefined; }; +/** + * @deprecated Use {@link RESTAPIMessageReference} instead + */ +export type APIMessageReferenceSend = RESTAPIMessageReference; + /** * https://discord.com/developers/docs/resources/channel#attachment-object */ @@ -300,7 +310,7 @@ export interface RESTPostAPIChannelMessageJSONBody { * * See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */ - message_reference?: APIMessageReferenceSend | undefined; + message_reference?: RESTAPIMessageReference | undefined; /** * The components to include with the message * @@ -329,7 +339,7 @@ export interface RESTPostAPIChannelMessageJSONBody { /** * A poll! */ - poll?: RESTAPIPollCreate | undefined; + poll?: RESTAPIPoll | undefined; } /** @@ -362,7 +372,12 @@ export type RESTPutAPIChannelMessageReactionResult = never; /** * https://discord.com/developers/docs/resources/channel#delete-own-reaction */ -export type RESTDeleteAPIChannelMessageOwnReaction = never; +export type RESTDeleteAPIChannelMessageOwnReactionResult = never; + +/** + * @deprecated Use {@link RESTDeleteAPIChannelMessageOwnReactionResult} instead + */ +export type RESTDeleteAPIChannelMessageOwnReaction = RESTDeleteAPIChannelMessageOwnReactionResult; /** * https://discord.com/developers/docs/resources/channel#delete-user-reaction diff --git a/rest/v10/guild.ts b/rest/v10/guild.ts index 8ead979b..2003f6da 100644 --- a/rest/v10/guild.ts +++ b/rest/v10/guild.ts @@ -37,14 +37,25 @@ import type { } from '../../utils/internals'; import type { RESTPutAPIChannelPermissionJSONBody } from './channel'; -export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody { +export interface RESTAPIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody { id: number | string; } -export type APIGuildChannelResolvable = Exclude; -export type APIGuildCreatePartialChannel = StrictPartial< +/** + * @deprecated Use {@link RESTAPIGuildCreateOverwrite} instead + */ +export type APIGuildCreateOverwrite = RESTAPIGuildCreateOverwrite; + +export type RESTAPIGuildChannelResolvable = Exclude; + +/** + * @deprecated Use {@link RESTAPIGuildChannelResolvable} instead + */ +export type APIGuildChannelResolvable = RESTAPIGuildChannelResolvable; + +export type RESTAPIGuildCreatePartialChannel = StrictPartial< DistributivePick< - APIGuildChannelResolvable, + RESTAPIGuildChannelResolvable, | 'available_tags' | 'bitrate' | 'default_auto_archive_duration' @@ -66,13 +77,23 @@ export type APIGuildCreatePartialChannel = StrictPartial< name: string; id?: number | string | undefined; parent_id?: number | string | null | undefined; - permission_overwrites?: APIGuildCreateOverwrite[] | undefined; + permission_overwrites?: RESTAPIGuildCreateOverwrite[] | undefined; }; -export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody { +/** + * @deprecated Use {@link RESTAPIGuildCreatePartialChannel} instead + */ +export type APIGuildCreatePartialChannel = RESTAPIGuildCreatePartialChannel; + +export interface RESTAPIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody { id: number | string; } +/** + * @deprecated Use {@link RESTAPIGuildCreateRole} instead + */ +export type APIGuildCreateRole = RESTAPIGuildCreateRole; + /** * https://discord.com/developers/docs/resources/guild#create-guild */ @@ -124,7 +145,7 @@ export interface RESTPostAPIGuildsJSONBody { * * See https://discord.com/developers/docs/topics/permissions#role-object */ - roles?: APIGuildCreateRole[] | undefined; + roles?: RESTAPIGuildCreateRole[] | undefined; /** * New guild's channels * @@ -138,7 +159,7 @@ export interface RESTPostAPIGuildsJSONBody { * * See https://discord.com/developers/docs/resources/channel#channel-object */ - channels?: APIGuildCreatePartialChannel[] | undefined; + channels?: RESTAPIGuildCreatePartialChannel[] | undefined; /** * ID for afk channel */ @@ -333,7 +354,7 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[]; /** * https://discord.com/developers/docs/resources/guild#create-guild-channel */ -export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit; +export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit; /** * https://discord.com/developers/docs/resources/guild#create-guild-channel @@ -930,20 +951,25 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP /** * Prompts shown during onboarding and in customize community */ - prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined; + prompts?: RESTAPIGuildOnboardingPrompt[] | undefined; }; -export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< +export type RESTAPIGuildOnboardingPrompt = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< Partial> > & Pick & { /** * Options available within the prompt */ - options: RESTAPIModifyGuildOnboardingPromptOptionData[]; + options: RESTAPIGuildOnboardingPromptOption[]; }; -export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< +/** + * @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead. + */ +export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt; + +export type RESTAPIGuildOnboardingPromptOption = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< Partial> > & Pick & { @@ -961,6 +987,11 @@ export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossibl emoji_animated?: boolean | null | undefined; }; +/** + * @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead. + */ +export type RESTAPIModifyGuildOnboardingPromptOptionData = RESTAPIGuildOnboardingPromptOption; + /** * https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */ diff --git a/rest/v10/monetization.ts b/rest/v10/monetization.ts index b2849c37..2c65638e 100644 --- a/rest/v10/monetization.ts +++ b/rest/v10/monetization.ts @@ -46,7 +46,7 @@ export type RESTGetAPIEntitlementsResult = APIEntitlement[]; /** * https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */ -export interface RESTPostAPIEntitlementBody { +export interface RESTPostAPIEntitlementJSONBody { /** * ID of the SKU to grant the entitlement to */ @@ -61,6 +61,11 @@ export interface RESTPostAPIEntitlementBody { owner_type: EntitlementOwnerType; } +/** + * @deprecated Use {@link RESTPostAPIEntitlementJSONBody} instead + */ +export type RESTPostAPIEntitlementBody = RESTPostAPIEntitlementJSONBody; + /** * https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */ diff --git a/rest/v10/oauth2.ts b/rest/v10/oauth2.ts index 17da5ecd..2552cead 100644 --- a/rest/v10/oauth2.ts +++ b/rest/v10/oauth2.ts @@ -51,11 +51,16 @@ export interface RESTPostOAuth2TokenRevocationQuery { /** * https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example */ -export interface RESTOAuth2AuthorizationQueryResult { +export interface RESTPostOAuth2AuthorizationQueryResult { code: string; state?: string; } +/** + * @deprecated Use {@link RESTPostOAuth2AuthorizationQueryResult} instead + */ +export type RESTOAuth2AuthorizationQueryResult = RESTPostOAuth2AuthorizationQueryResult; + /** * https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example */ diff --git a/rest/v10/poll.ts b/rest/v10/poll.ts index 2925598d..944977cc 100644 --- a/rest/v10/poll.ts +++ b/rest/v10/poll.ts @@ -20,7 +20,7 @@ export interface RESTGetAPIPollAnswerVotersQuery { /** * https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure */ -export interface RESTAPIPollCreate +export interface RESTAPIPoll extends Omit, Partial> { /** @@ -35,6 +35,11 @@ export interface RESTAPIPollCreate duration?: number; } +/** + * @deprecated Use {@link RESTAPIPoll} instead + */ +export type RESTAPIPollCreate = RESTAPIPoll; + /** * https://discord.com/developers/docs/resources/poll#get-answer-voters */ diff --git a/rest/v10/sticker.ts b/rest/v10/sticker.ts index 2479bdba..ebcd851f 100644 --- a/rest/v10/sticker.ts +++ b/rest/v10/sticker.ts @@ -15,7 +15,12 @@ export interface RESTGetStickerPacksResult { /** * https://discord.com/developers/docs/resources/sticker#get-sticker-pack */ -export type RESTGetAPIStickerPack = APIStickerPack; +export type RESTGetAPIStickerPackResult = APIStickerPack; + +/** + * @deprecated Use {@link RESTGetAPIStickerPackResult} instead + */ +export type RESTGetAPIStickerPack = RESTGetAPIStickerPackResult; /** * https://discord.com/developers/docs/resources/sticker#list-sticker-packs diff --git a/rest/v10/webhook.ts b/rest/v10/webhook.ts index acb37d49..018c3ad2 100644 --- a/rest/v10/webhook.ts +++ b/rest/v10/webhook.ts @@ -10,7 +10,7 @@ import type { } from '../../payloads/v10/index'; import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals'; import type { RESTAPIAttachment } from './channel'; -import type { RESTAPIPollCreate } from './poll'; +import type { RESTAPIPoll } from './poll'; /** * https://discord.com/developers/docs/resources/webhook#create-webhook */ @@ -158,7 +158,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody { /** * A poll! */ - poll?: RESTAPIPollCreate | undefined; + poll?: RESTAPIPoll | undefined; } /** diff --git a/rest/v9/channel.ts b/rest/v9/channel.ts index d96c3cbc..8fcc5272 100644 --- a/rest/v9/channel.ts +++ b/rest/v9/channel.ts @@ -26,12 +26,17 @@ import type { ChannelFlags, } from '../../payloads/v9/index'; import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals'; -import type { RESTAPIPollCreate } from './poll'; +import type { RESTAPIPoll } from './poll'; -export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody { +export interface RESTAPIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody { id: Snowflake; } +/** + * @deprecated Use {@link RESTAPIChannelPatchOverwrite} instead + */ +export type APIChannelPatchOverwrite = RESTAPIChannelPatchOverwrite; + /** * https://discord.com/developers/docs/resources/channel#get-channel */ @@ -237,7 +242,7 @@ export type RESTGetAPIChannelMessageResult = APIMessage; /** * https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */ -export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< +export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< Required> > & StrictPartial & { @@ -249,6 +254,11 @@ export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesO fail_if_not_exists?: boolean | undefined; }; +/** + * @deprecated Use {@link RESTAPIMessageReference} instead + */ +export type APIMessageReferenceSend = RESTAPIMessageReference; + /** * https://discord.com/developers/docs/resources/channel#attachment-object */ @@ -308,7 +318,7 @@ export interface RESTPostAPIChannelMessageJSONBody { * * See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */ - message_reference?: APIMessageReferenceSend | undefined; + message_reference?: RESTAPIMessageReference | undefined; /** * The components to include with the message * @@ -337,7 +347,7 @@ export interface RESTPostAPIChannelMessageJSONBody { /** * A poll! */ - poll?: RESTAPIPollCreate | undefined; + poll?: RESTAPIPoll | undefined; } /** @@ -370,7 +380,12 @@ export type RESTPutAPIChannelMessageReactionResult = never; /** * https://discord.com/developers/docs/resources/channel#delete-own-reaction */ -export type RESTDeleteAPIChannelMessageOwnReaction = never; +export type RESTDeleteAPIChannelMessageOwnReactionResult = never; + +/** + * @deprecated Use {@link RESTDeleteAPIChannelMessageOwnReactionResult} instead + */ +export type RESTDeleteAPIChannelMessageOwnReaction = RESTDeleteAPIChannelMessageOwnReactionResult; /** * https://discord.com/developers/docs/resources/channel#delete-user-reaction diff --git a/rest/v9/guild.ts b/rest/v9/guild.ts index 5d4e485f..18a908f7 100644 --- a/rest/v9/guild.ts +++ b/rest/v9/guild.ts @@ -37,14 +37,25 @@ import type { } from '../../utils/internals'; import type { RESTPutAPIChannelPermissionJSONBody } from './channel'; -export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody { +export interface RESTAPIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody { id: number | string; } -export type APIGuildChannelResolvable = Exclude; -export type APIGuildCreatePartialChannel = StrictPartial< +/** + * @deprecated Use {@link RESTAPIGuildCreateOverwrite} instead + */ +export type APIGuildCreateOverwrite = RESTAPIGuildCreateOverwrite; + +export type RESTAPIGuildChannelResolvable = Exclude; + +/** + * @deprecated Use {@link RESTAPIGuildChannelResolvable} instead + */ +export type APIGuildChannelResolvable = RESTAPIGuildChannelResolvable; + +export type RESTAPIGuildCreatePartialChannel = StrictPartial< DistributivePick< - APIGuildChannelResolvable, + RESTAPIGuildChannelResolvable, | 'available_tags' | 'bitrate' | 'default_auto_archive_duration' @@ -66,13 +77,23 @@ export type APIGuildCreatePartialChannel = StrictPartial< name: string; id?: number | string | undefined; parent_id?: number | string | null | undefined; - permission_overwrites?: APIGuildCreateOverwrite[] | undefined; + permission_overwrites?: RESTAPIGuildCreateOverwrite[] | undefined; }; -export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody { +/** + * @deprecated Use {@link RESTAPIGuildCreatePartialChannel} instead + */ +export type APIGuildCreatePartialChannel = RESTAPIGuildCreatePartialChannel; + +export interface RESTAPIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody { id: number | string; } +/** + * @deprecated Use {@link RESTAPIGuildCreateRole} instead + */ +export type APIGuildCreateRole = RESTAPIGuildCreateRole; + /** * https://discord.com/developers/docs/resources/guild#create-guild */ @@ -124,7 +145,7 @@ export interface RESTPostAPIGuildsJSONBody { * * See https://discord.com/developers/docs/topics/permissions#role-object */ - roles?: APIGuildCreateRole[] | undefined; + roles?: RESTAPIGuildCreateRole[] | undefined; /** * New guild's channels * @@ -138,7 +159,7 @@ export interface RESTPostAPIGuildsJSONBody { * * See https://discord.com/developers/docs/resources/channel#channel-object */ - channels?: APIGuildCreatePartialChannel[] | undefined; + channels?: RESTAPIGuildCreatePartialChannel[] | undefined; /** * ID for afk channel */ @@ -333,7 +354,7 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[]; /** * https://discord.com/developers/docs/resources/guild#create-guild-channel */ -export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit; +export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit; /** * https://discord.com/developers/docs/resources/guild#create-guild-channel @@ -936,20 +957,25 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP /** * Prompts shown during onboarding and in customize community */ - prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined; + prompts?: RESTAPIGuildOnboardingPrompt[] | undefined; }; -export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< +export type RESTAPIGuildOnboardingPrompt = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< Partial> > & Pick & { /** * Options available within the prompt */ - options: RESTAPIModifyGuildOnboardingPromptOptionData[]; + options: RESTAPIGuildOnboardingPromptOption[]; }; -export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< +/** + * @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead. + */ +export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt; + +export type RESTAPIGuildOnboardingPromptOption = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< Partial> > & Pick & { @@ -967,6 +993,11 @@ export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossibl emoji_animated?: boolean | null | undefined; }; +/** + * @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead. + */ +export type RESTAPIModifyGuildOnboardingPromptOptionData = RESTAPIGuildOnboardingPromptOption; + /** * https://discord.com/developers/docs/resources/guild#modify-guild-onboarding */ diff --git a/rest/v9/monetization.ts b/rest/v9/monetization.ts index b2849c37..2c65638e 100644 --- a/rest/v9/monetization.ts +++ b/rest/v9/monetization.ts @@ -46,7 +46,7 @@ export type RESTGetAPIEntitlementsResult = APIEntitlement[]; /** * https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */ -export interface RESTPostAPIEntitlementBody { +export interface RESTPostAPIEntitlementJSONBody { /** * ID of the SKU to grant the entitlement to */ @@ -61,6 +61,11 @@ export interface RESTPostAPIEntitlementBody { owner_type: EntitlementOwnerType; } +/** + * @deprecated Use {@link RESTPostAPIEntitlementJSONBody} instead + */ +export type RESTPostAPIEntitlementBody = RESTPostAPIEntitlementJSONBody; + /** * https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */ diff --git a/rest/v9/oauth2.ts b/rest/v9/oauth2.ts index 4c00e085..059cf7e6 100644 --- a/rest/v9/oauth2.ts +++ b/rest/v9/oauth2.ts @@ -51,11 +51,16 @@ export interface RESTPostOAuth2TokenRevocationQuery { /** * https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example */ -export interface RESTOAuth2AuthorizationQueryResult { +export interface RESTPostOAuth2AuthorizationQueryResult { code: string; state?: string; } +/** + * @deprecated Use {@link RESTPostOAuth2AuthorizationQueryResult} instead + */ +export type RESTOAuth2AuthorizationQueryResult = RESTPostOAuth2AuthorizationQueryResult; + /** * https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example */ diff --git a/rest/v9/poll.ts b/rest/v9/poll.ts index 56ad9351..e40c2a25 100644 --- a/rest/v9/poll.ts +++ b/rest/v9/poll.ts @@ -20,7 +20,7 @@ export interface RESTGetAPIPollAnswerVotersQuery { /** * https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure */ -export interface RESTAPIPollCreate +export interface RESTAPIPoll extends Omit, Partial> { /** @@ -35,6 +35,11 @@ export interface RESTAPIPollCreate duration?: number; } +/** + * @deprecated Use {@link RESTAPIPoll} instead + */ +export type RESTAPIPollCreate = RESTAPIPoll; + /** * https://discord.com/developers/docs/resources/poll#get-answer-voters */ diff --git a/rest/v9/sticker.ts b/rest/v9/sticker.ts index 8b20500f..16aea2da 100644 --- a/rest/v9/sticker.ts +++ b/rest/v9/sticker.ts @@ -15,7 +15,12 @@ export interface RESTGetStickerPacksResult { /** * https://discord.com/developers/docs/resources/sticker#get-sticker-pack */ -export type RESTGetAPIStickerPack = APIStickerPack; +export type RESTGetAPIStickerPackResult = APIStickerPack; + +/** + * @deprecated Use {@link RESTGetAPIStickerPackResult} instead + */ +export type RESTGetAPIStickerPack = RESTGetAPIStickerPackResult; /** * https://discord.com/developers/docs/resources/sticker#list-sticker-packs diff --git a/rest/v9/webhook.ts b/rest/v9/webhook.ts index 4925f7b6..a11d6057 100644 --- a/rest/v9/webhook.ts +++ b/rest/v9/webhook.ts @@ -10,7 +10,7 @@ import type { } from '../../payloads/v9/index'; import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals'; import type { RESTAPIAttachment } from './channel'; -import type { RESTAPIPollCreate } from './poll'; +import type { RESTAPIPoll } from './poll'; /** * https://discord.com/developers/docs/resources/webhook#create-webhook */ @@ -158,7 +158,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody { /** * A poll! */ - poll?: RESTAPIPollCreate | undefined; + poll?: RESTAPIPoll | undefined; } /**