From 43392015a5f09b20a96cc166782da1ffcd4ba78f Mon Sep 17 00:00:00 2001 From: mkljczk Date: Fri, 20 Dec 2024 12:33:54 +0100 Subject: [PATCH] pl-api: update features definitions Signed-off-by: mkljczk --- packages/pl-api/lib/client.ts | 10 ++++++++++ packages/pl-api/lib/features.ts | 14 +++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/packages/pl-api/lib/client.ts b/packages/pl-api/lib/client.ts index 88e192d0a..503b355bc 100644 --- a/packages/pl-api/lib/client.ts +++ b/packages/pl-api/lib/client.ts @@ -580,6 +580,8 @@ class PlApiClient { /** * Get account’s featured tags * Tags featured by this account. + * + * Requires features{@link Features['featuredTags']}. * @see {@link https://docs.joinmastodon.org/methods/accounts/#featured_tags} */ getAccountFeaturedTags: async (accountId: string) => { @@ -867,6 +869,8 @@ class PlApiClient { /** * View your featured tags * List all hashtags featured on your profile. + * + * Requires features{@link Features['featuredTags']}. * @see {@link https://docs.joinmastodon.org/methods/featured_tags/#get} */ getFeaturedTags: async () => { @@ -878,6 +882,8 @@ class PlApiClient { /** * Feature a tag * Promote a hashtag on your profile. + * + * Requires features{@link Features['featuredTags']}. * @see {@link https://docs.joinmastodon.org/methods/featured_tags/#feature} */ featureTag: async (name: string) => { @@ -892,6 +898,8 @@ class PlApiClient { /** * Unfeature a tag * Stop promoting a hashtag on your profile. + * + * Requires features{@link Features['featuredTags']}. * @see {@link https://docs.joinmastodon.org/methods/featured_tags/#unfeature} */ unfeatureTag: async (name: string) => { @@ -906,6 +914,8 @@ class PlApiClient { /** * View suggested tags to feature * Shows up to 10 recently-used tags. + * + * Requires features{@link Features['featuredTags']}. * @see {@link https://docs.joinmastodon.org/methods/featured_tags/#suggestions} */ getFeaturedTagsSuggestions: async () => { diff --git a/packages/pl-api/lib/features.ts b/packages/pl-api/lib/features.ts index d261f3b18..11da8d880 100644 --- a/packages/pl-api/lib/features.ts +++ b/packages/pl-api/lib/features.ts @@ -402,7 +402,10 @@ const getFeatures = (instance: Instance) => { /** * @see POST /api/v1/statuses */ - createStatusLocalScope: v.software === PLEROMA, + createStatusLocalScope: any([ + v.software === ICESHRIMP_NET, + v.software === PLEROMA, + ]), /** * @see POST /api/v1/statuses @@ -553,6 +556,15 @@ const getFeatures = (instance: Instance) => { v.software === TAKAHE, ]), + /** + * @see GET /api/v1/accounts/:accountId/featured_tags + * @see GET /api/v1/featured_tags + * @see POST /api/v1/featured_tags + * @see DELETE /api/v1/featured_tags + * @see GET /api/v1/featured_tags/suggestions + */ + featuredTags: v.software === MASTODON, + /** Whether the instance federates. */ federating: federation,