From af2b0cca2ef35b41face7d82247f648619cf6ef2 Mon Sep 17 00:00:00 2001 From: Link Date: Thu, 14 Aug 2025 15:12:16 -0400 Subject: [PATCH] fix(types)!: Rename CreateEntitlement to CreateTestEntitlement (#4346) --- packages/bot/src/helpers.ts | 7 +++++-- packages/rest/src/types.ts | 4 ++-- packages/types/src/discordeno/entitlement.ts | 3 +-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/bot/src/helpers.ts b/packages/bot/src/helpers.ts index 7abbf27b3..04b7ade9f 100644 --- a/packages/bot/src/helpers.ts +++ b/packages/bot/src/helpers.ts @@ -10,7 +10,6 @@ import type { CreateApplicationEmoji, CreateAutoModerationRuleOptions, CreateChannelInvite, - CreateEntitlement, CreateForumPostWithMessage, CreateGlobalApplicationCommandOptions, CreateGuildApplicationCommandOptions, @@ -26,6 +25,7 @@ import type { CreateScheduledEvent, CreateStageInstance, CreateTemplate, + CreateTestEntitlement, CreateWebhook, DeleteWebhookMessageOptions, DiscordAccessTokenResponse, @@ -1168,7 +1168,10 @@ export type BotHelpers Promise> listEntitlements: (applicationId: BigString, options?: GetEntitlements) => Promise[]> getEntitlement: (applicationId: BigString, entitlementId: BigString) => Promise> - createTestEntitlement: (applicationId: BigString, body: CreateEntitlement) => Promise>> + createTestEntitlement: ( + applicationId: BigString, + body: CreateTestEntitlement, + ) => Promise>> deleteTestEntitlement: (applicationId: BigString, entitlementId: BigString) => Promise listSkus: (applicationId: BigString) => Promise[]> listSubscriptions: (skuId: BigString, options?: ListSkuSubscriptionsOptions) => Promise[]> diff --git a/packages/rest/src/types.ts b/packages/rest/src/types.ts index 089ec9101..a14ce90c3 100644 --- a/packages/rest/src/types.ts +++ b/packages/rest/src/types.ts @@ -10,7 +10,6 @@ import type { CreateApplicationEmoji, CreateAutoModerationRuleOptions, CreateChannelInvite, - CreateEntitlement, CreateForumPostWithMessage, CreateGlobalApplicationCommandOptions, CreateGuildApplicationCommandOptions, @@ -26,6 +25,7 @@ import type { CreateScheduledEvent, CreateStageInstance, CreateTemplate, + CreateTestEntitlement, CreateWebhook, DeleteWebhookMessageOptions, DiscordAccessTokenResponse, @@ -2987,7 +2987,7 @@ export interface RestManager { * This endpoint returns a partial entitlement object. * It will not contain subscription_id, starts_at, or ends_at, as it's valid in perpetuity. */ - createTestEntitlement: (applicationId: BigString, body: CreateEntitlement) => Promise>> + createTestEntitlement: (applicationId: BigString, body: CreateTestEntitlement) => Promise>> /** * Deletes a currently-active test entitlement. Discord will act as though that user or guild no longer has entitlement to your premium offering. * diff --git a/packages/types/src/discordeno/entitlement.ts b/packages/types/src/discordeno/entitlement.ts index 15e0ca735..4d38ceb08 100644 --- a/packages/types/src/discordeno/entitlement.ts +++ b/packages/types/src/discordeno/entitlement.ts @@ -22,9 +22,8 @@ export interface GetEntitlements { excludeDeleted?: boolean } -// TODO: This should provably get renamed to CreateTestEntitlement /** https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement-json-params */ -export interface CreateEntitlement { +export interface CreateTestEntitlement { /** ID of the SKU to grant the entitlement to */ skuId: BigString /** ID of the guild or user to grant the entitlement to */