1
0

cleanup Mastodon API (resolves #804 and #865, partially resolves #492)

* Fix TS errors and warnings
* Fix ESLint errors and warnings
* Fix property typos in various places
* Fix property data conversion
* Add missing entity properties
* Normalize logging and reduce spam
* Check for missing request parameters
* Allow mastodon API to work with local debugging
* Safer error handling
* Fix quote-post detection
This commit is contained in:
Hazelnoot
2025-01-31 02:46:38 -05:00
parent 2c2fb8a692
commit 16f483d273
13 changed files with 1275 additions and 1147 deletions
@@ -8,6 +8,7 @@ import { FILE_TYPE_BROWSERSAFE } from '@/const.js';
import type { Config } from '@/config.js';
import type { MiMeta } from '@/models/Meta.js';
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
export async function getInstance(
response: Entity.Instance,
contact: Entity.Account,
@@ -17,11 +18,8 @@ export async function getInstance(
return {
uri: config.url,
title: meta.name || 'Sharkey',
short_description:
meta.description || 'This is a vanilla Sharkey Instance. It doesn\'t seem to have a description.',
description:
meta.description ||
'This is a vanilla Sharkey Instance. It doesn\'t seem to have a description.',
short_description: meta.description || 'This is a vanilla Sharkey Instance. It doesn\'t seem to have a description.',
description: meta.description || 'This is a vanilla Sharkey Instance. It doesn\'t seem to have a description.',
email: response.email || '',
version: `3.0.0 (compatible; Sharkey ${config.version})`,
urls: response.urls,