diff --git a/packages/pl-api/lib/entities/instance.ts b/packages/pl-api/lib/entities/instance.ts index 41cd0417b..d6993e22d 100644 --- a/packages/pl-api/lib/entities/instance.ts +++ b/packages/pl-api/lib/entities/instance.ts @@ -5,7 +5,7 @@ import { accountSchema } from './account'; import { ruleSchema } from './rule'; import { coerceObject, filteredArray, mimeSchema } from './utils'; -const getApiVersions = (instance: any) => ({ +const getApiVersions = (instance: any): Record => ({ ...Object.fromEntries(instance.pleroma?.metadata?.features?.map((feature: string) => { let string = `${feature}.pleroma.pl-api`; if (string.startsWith('pleroma:') || string.startsWith('pleroma_')) string = string.slice(8); @@ -306,7 +306,7 @@ const instanceSchema = v.pipe( if (data.domain) return { account_domain: data.domain, ...data, api_versions: apiVersions }; - return instanceV1ToV2({ ...data, api_versions: apiVersions }); + return { ...instanceV1ToV2(data), api_versions: apiVersions }; }), coerceObject({ account_domain: v.fallback(v.string(), ''), diff --git a/packages/pl-api/lib/features.ts b/packages/pl-api/lib/features.ts index f0a9b55db..3313e7d29 100644 --- a/packages/pl-api/lib/features.ts +++ b/packages/pl-api/lib/features.ts @@ -656,6 +656,8 @@ const getFeatures = (instance: Instance) => { */ groups: instance.api_versions['groups.pleroma.pl-api'] >= 1, + groupsSlugs: instance.api_versions['groups.pleroma.pl-api'] >= 1, + /** * Can hide follows/followers lists and counts. * @see PATCH /api/v1/accounts/update_credentials diff --git a/packages/pl-api/package.json b/packages/pl-api/package.json index 0e6fb0436..f3bda5520 100644 --- a/packages/pl-api/package.json +++ b/packages/pl-api/package.json @@ -1,6 +1,6 @@ { "name": "pl-api", - "version": "0.1.10", + "version": "0.1.11", "type": "module", "homepage": "https://github.com/mkljczk/pl-fe/tree/develop/packages/pl-api", "repository": { diff --git a/packages/pl-fe/package.json b/packages/pl-fe/package.json index 16852940c..03650debd 100644 --- a/packages/pl-fe/package.json +++ b/packages/pl-fe/package.json @@ -101,7 +101,7 @@ "multiselect-react-dropdown": "^2.0.25", "mutative": "^1.0.11", "path-browserify": "^1.0.1", - "pl-api": "^0.1.10", + "pl-api": "^0.1.11", "postcss": "^8.4.47", "process": "^0.11.10", "punycode": "^2.1.1", diff --git a/packages/pl-fe/yarn.lock b/packages/pl-fe/yarn.lock index 978b19925..cbfebe2cd 100644 --- a/packages/pl-fe/yarn.lock +++ b/packages/pl-fe/yarn.lock @@ -7614,10 +7614,10 @@ pkg-dir@^4.1.0: dependencies: find-up "^4.0.0" -pl-api@^0.1.10: - version "0.1.10" - resolved "https://registry.yarnpkg.com/pl-api/-/pl-api-0.1.10.tgz#f4abbc6b2b175a0acd2bc97fcf4019f094f386c8" - integrity sha512-KXUbCGLhlck5nBHFpbxUnNA1+b4WENO3+pq1YRK+4bi+L8sRRrF6OTN3A86v6ltBJxcZSOyMQUu34Nfp6CCFYw== +pl-api@^0.1.11: + version "0.1.11" + resolved "https://registry.yarnpkg.com/pl-api/-/pl-api-0.1.11.tgz#35044f703bd213a5a5d17d16824653588a64d29e" + integrity sha512-KASKZuAateAflNoG2jgAXK6yMVaImcZDsSWOAojFoLi/lDI7tJFwty9C1a7BsuFhWtIwwA9YtLidVxrBGBvGpw== dependencies: blurhash "^2.0.5" http-link-header "^1.1.3"