Cleanup and bulk fixes to Mastodon API (resolves #495, #509, #707, #714, #721, #804, #811, #865, and partially #492)
What does this MR do?
Sorry for the large PR! I normally keep things small and self-contained but that didn't work out this time. Anyway, this PR includes a massive cleanup to the Mastodon API that incidentally fixes a number of bugs. The full list of changes is as follows:
- Fix all TS and ESLint errors / warnings in the mastodon API
- Fix property typos that broke data conversion
- Fix multiple mastodon converters
- Add missing entity properties
- Normalize logging and remove duplicate try...catch blocks
- Validate required API parameters
- Support mastodon API when running on a non-standard public port (such as local debugging)
- Use type-safe error handling
- Fix quote-post logic (some quotes were being detected as reblogs / pure renotes)
- Fix account relation models and add missing properties (memo & instance blocks)
- Hide restricted note content from multiple endpoints
- Fix media attachment conversion and calculate
aspect/size - Fix empty responses from several endpoints caused by returning
Promise<Promise<T>> - Fix incorrect calculation of
sensitiveproperty - Packaging fixes to megalodon (fix module export, NodeJS engine, and TS build target)
- Export the logger service's
Datatypes for reference elsewhere
Note: I have only partially tested this change via unauthenticated API requests. I do not have access to a true Mastodon client for a full verification.
Contribution Guidelines
By submitting this merge request, you agree to follow our Contribution Guidelines
-
I agree to follow this project's Contribution Guidelines -
I have made sure to test this merge request
Edited by Hazelnoot