From 079fcd6c006759193ea0b4b97d0d5a34c0459041 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Tue, 26 Nov 2024 06:34:36 +0000 Subject: [PATCH] feat: New entitlement endpoint behaviour (#1145) * feat: new entitlement endpoint behaviour * fix: correct `RESTGetAPIEntitlementResult` * docs: update changes --- deno/rest/v10/mod.ts | 1 + deno/rest/v10/monetization.ts | 11 ++++++++++- deno/rest/v9/mod.ts | 1 + deno/rest/v9/monetization.ts | 11 ++++++++++- rest/v10/index.ts | 1 + rest/v10/monetization.ts | 11 ++++++++++- rest/v9/index.ts | 1 + rest/v9/monetization.ts | 11 ++++++++++- 8 files changed, 44 insertions(+), 4 deletions(-) diff --git a/deno/rest/v10/mod.ts b/deno/rest/v10/mod.ts index fab275b9c..c5ee1e680 100644 --- a/deno/rest/v10/mod.ts +++ b/deno/rest/v10/mod.ts @@ -952,6 +952,7 @@ export const Routes = { /** * Route for: + * - GET `/applications/{application.id}/entitlements/{entitlement.id}` * - DELETE `/applications/{application.id}/entitlements/{entitlement.id}` */ entitlement(applicationId: Snowflake, entitlementId: Snowflake) { diff --git a/deno/rest/v10/monetization.ts b/deno/rest/v10/monetization.ts index 7f8e0284e..7a66068c7 100644 --- a/deno/rest/v10/monetization.ts +++ b/deno/rest/v10/monetization.ts @@ -33,9 +33,13 @@ export interface RESTGetAPIEntitlementsQuery { */ guild_id?: Snowflake | undefined; /** - * Whether ended entitlements should be omitted + * Whether ended entitlements should be omitted. Defaults to `false`, ended entitlements are included by default */ exclude_ended?: boolean | undefined; + /** + * Whether deleted entitlements should be omitted. Defaults to `true`, deleted entitlements are not included by default + */ + exclude_deleted?: boolean | undefined; } /** @@ -43,6 +47,11 @@ export interface RESTGetAPIEntitlementsQuery { */ export type RESTGetAPIEntitlementsResult = APIEntitlement[]; +/** + * https://discord.com/developers/docs/resources/entitlement#get-entitlement + */ +export type RESTGetAPIEntitlementResult = APIEntitlement; + /** * https://discord.com/developers/docs/resources/entitlement#create-test-entitlement */ diff --git a/deno/rest/v9/mod.ts b/deno/rest/v9/mod.ts index 95d4e63c0..2fce5f3fc 100644 --- a/deno/rest/v9/mod.ts +++ b/deno/rest/v9/mod.ts @@ -961,6 +961,7 @@ export const Routes = { /** * Route for: + * - GET `/applications/{application.id}/entitlements/{entitlement.id}` * - DELETE `/applications/{application.id}/entitlements/{entitlement.id}` */ entitlement(applicationId: Snowflake, entitlementId: Snowflake) { diff --git a/deno/rest/v9/monetization.ts b/deno/rest/v9/monetization.ts index 0d08bee65..e13d115c3 100644 --- a/deno/rest/v9/monetization.ts +++ b/deno/rest/v9/monetization.ts @@ -33,9 +33,13 @@ export interface RESTGetAPIEntitlementsQuery { */ guild_id?: Snowflake | undefined; /** - * Whether ended entitlements should be omitted + * Whether ended entitlements should be omitted. Defaults to `false`, ended entitlements are included by default */ exclude_ended?: boolean | undefined; + /** + * Whether deleted entitlements should be omitted. Defaults to `true`, deleted entitlements are not included by default + */ + exclude_deleted?: boolean | undefined; } /** @@ -43,6 +47,11 @@ export interface RESTGetAPIEntitlementsQuery { */ export type RESTGetAPIEntitlementsResult = APIEntitlement[]; +/** + * https://discord.com/developers/docs/resources/entitlement#get-entitlement + */ +export type RESTGetAPIEntitlementResult = APIEntitlement; + /** * https://discord.com/developers/docs/resources/entitlement#create-test-entitlement */ diff --git a/rest/v10/index.ts b/rest/v10/index.ts index 5c7ce3670..9d5486389 100644 --- a/rest/v10/index.ts +++ b/rest/v10/index.ts @@ -952,6 +952,7 @@ export const Routes = { /** * Route for: + * - GET `/applications/{application.id}/entitlements/{entitlement.id}` * - DELETE `/applications/{application.id}/entitlements/{entitlement.id}` */ entitlement(applicationId: Snowflake, entitlementId: Snowflake) { diff --git a/rest/v10/monetization.ts b/rest/v10/monetization.ts index 67a87b9a2..784b907fb 100644 --- a/rest/v10/monetization.ts +++ b/rest/v10/monetization.ts @@ -33,9 +33,13 @@ export interface RESTGetAPIEntitlementsQuery { */ guild_id?: Snowflake | undefined; /** - * Whether ended entitlements should be omitted + * Whether ended entitlements should be omitted. Defaults to `false`, ended entitlements are included by default */ exclude_ended?: boolean | undefined; + /** + * Whether deleted entitlements should be omitted. Defaults to `true`, deleted entitlements are not included by default + */ + exclude_deleted?: boolean | undefined; } /** @@ -43,6 +47,11 @@ export interface RESTGetAPIEntitlementsQuery { */ export type RESTGetAPIEntitlementsResult = APIEntitlement[]; +/** + * https://discord.com/developers/docs/resources/entitlement#get-entitlement + */ +export type RESTGetAPIEntitlementResult = APIEntitlement; + /** * https://discord.com/developers/docs/resources/entitlement#create-test-entitlement */ diff --git a/rest/v9/index.ts b/rest/v9/index.ts index 93a0bc3ec..c85d93821 100644 --- a/rest/v9/index.ts +++ b/rest/v9/index.ts @@ -961,6 +961,7 @@ export const Routes = { /** * Route for: + * - GET `/applications/{application.id}/entitlements/{entitlement.id}` * - DELETE `/applications/{application.id}/entitlements/{entitlement.id}` */ entitlement(applicationId: Snowflake, entitlementId: Snowflake) { diff --git a/rest/v9/monetization.ts b/rest/v9/monetization.ts index aa88151d2..25899c78e 100644 --- a/rest/v9/monetization.ts +++ b/rest/v9/monetization.ts @@ -33,9 +33,13 @@ export interface RESTGetAPIEntitlementsQuery { */ guild_id?: Snowflake | undefined; /** - * Whether ended entitlements should be omitted + * Whether ended entitlements should be omitted. Defaults to `false`, ended entitlements are included by default */ exclude_ended?: boolean | undefined; + /** + * Whether deleted entitlements should be omitted. Defaults to `true`, deleted entitlements are not included by default + */ + exclude_deleted?: boolean | undefined; } /** @@ -43,6 +47,11 @@ export interface RESTGetAPIEntitlementsQuery { */ export type RESTGetAPIEntitlementsResult = APIEntitlement[]; +/** + * https://discord.com/developers/docs/resources/entitlement#get-entitlement + */ +export type RESTGetAPIEntitlementResult = APIEntitlement; + /** * https://discord.com/developers/docs/resources/entitlement#create-test-entitlement */