refactor(rest): ensure types follow naming pattern (#1065)

Co-authored-by: Synbulat Biishev <signin@syjalo.dev>
This commit is contained in:
Almeida
2024-08-22 12:41:56 +01:00
committed by GitHub
parent b90fddc285
commit 86a9f965dd
30 changed files with 468 additions and 103 deletions

View File

@@ -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<Options, 'missingOptional'>({
@@ -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: [] }],
}),
},
};

View File

@@ -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"
]
}
]
}
}
]
}

View File

@@ -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<Pick<APIMessageReference, 'message_id'>>
> &
StrictPartial<APIMessageReference> & {
@@ -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

View File

@@ -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<APIChannel, APIDMChannel | APIGroupDMChannel>;
export type APIGuildCreatePartialChannel = StrictPartial<
/**
* @deprecated Use {@link RESTAPIGuildCreateOverwrite} instead
*/
export type APIGuildCreateOverwrite = RESTAPIGuildCreateOverwrite;
export type RESTAPIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
/**
* @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<APIGuildCreatePartialChannel, 'id'>;
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<RESTAPIGuildCreatePartialChannel, 'id'>;
/**
* 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<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
> &
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
/**
* 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<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
> &
Pick<APIGuildOnboardingPromptOption, 'title'> & {
@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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<APIPoll, 'allow_multiselect' | 'answers' | 'expiry' | 'layout_type' | 'results'>,
Partial<Pick<APIPoll, 'allow_multiselect' | 'layout_type'>> {
/**
@@ -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
*/

View File

@@ -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

View File

@@ -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;
}
/**

View File

@@ -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<Pick<APIMessageReference, 'message_id'>>
> &
StrictPartial<APIMessageReference> & {
@@ -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

View File

@@ -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<APIChannel, APIDMChannel | APIGroupDMChannel>;
export type APIGuildCreatePartialChannel = StrictPartial<
/**
* @deprecated Use {@link RESTAPIGuildCreateOverwrite} instead
*/
export type APIGuildCreateOverwrite = RESTAPIGuildCreateOverwrite;
export type RESTAPIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
/**
* @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<APIGuildCreatePartialChannel, 'id'>;
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<RESTAPIGuildCreatePartialChannel, 'id'>;
/**
* 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<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
> &
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
/**
* 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<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
> &
Pick<APIGuildOnboardingPromptOption, 'title'> & {
@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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<APIPoll, 'allow_multiselect' | 'answers' | 'expiry' | 'layout_type' | 'results'>,
Partial<Pick<APIPoll, 'allow_multiselect' | 'layout_type'>> {
/**
@@ -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
*/

View File

@@ -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

View File

@@ -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;
}
/**

View File

@@ -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<Pick<APIMessageReference, 'message_id'>>
> &
StrictPartial<APIMessageReference> & {
@@ -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

View File

@@ -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<APIChannel, APIDMChannel | APIGroupDMChannel>;
export type APIGuildCreatePartialChannel = StrictPartial<
/**
* @deprecated Use {@link RESTAPIGuildCreateOverwrite} instead
*/
export type APIGuildCreateOverwrite = RESTAPIGuildCreateOverwrite;
export type RESTAPIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
/**
* @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<APIGuildCreatePartialChannel, 'id'>;
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<RESTAPIGuildCreatePartialChannel, 'id'>;
/**
* 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<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
> &
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
/**
* 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<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
> &
Pick<APIGuildOnboardingPromptOption, 'title'> & {
@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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<APIPoll, 'allow_multiselect' | 'answers' | 'expiry' | 'layout_type' | 'results'>,
Partial<Pick<APIPoll, 'allow_multiselect' | 'layout_type'>> {
/**
@@ -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
*/

View File

@@ -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

View File

@@ -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;
}
/**

View File

@@ -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<Pick<APIMessageReference, 'message_id'>>
> &
StrictPartial<APIMessageReference> & {
@@ -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

View File

@@ -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<APIChannel, APIDMChannel | APIGroupDMChannel>;
export type APIGuildCreatePartialChannel = StrictPartial<
/**
* @deprecated Use {@link RESTAPIGuildCreateOverwrite} instead
*/
export type APIGuildCreateOverwrite = RESTAPIGuildCreateOverwrite;
export type RESTAPIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
/**
* @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<APIGuildCreatePartialChannel, 'id'>;
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<RESTAPIGuildCreatePartialChannel, 'id'>;
/**
* 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<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
> &
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
/**
* 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<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
> &
Pick<APIGuildOnboardingPromptOption, 'title'> & {
@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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<APIPoll, 'allow_multiselect' | 'answers' | 'expiry' | 'layout_type' | 'results'>,
Partial<Pick<APIPoll, 'allow_multiselect' | 'layout_type'>> {
/**
@@ -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
*/

View File

@@ -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

View File

@@ -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;
}
/**