Move the Mastodon API class out of the module and include as a dependency

Created on 19 August 2025, about 2 months ago

Problem/Motivation

Rather than bake the Mastodon API class into the module we should abstract it out and inject it via a composer install. This will allow the class to exist on its own and gives the potential for the integration to be used with other systems.
We can also look at integrating against V2 of the API without needing to push code to the module.

Proposed resolution

Create a new package, probably under the hashbangcode github account.
Move the MastodonApi class out of the Drupal module and into this package.
This will include the payload creator and the DTO classes created for the API.
The MastodonApi service class can remain as that can act as the integration point between the package and Drupal.

Remaining tasks

None.

User interface changes

None.

API changes

The underlying API won't change, but there will be substantially less code regarding the API baked into the module itself.

Data model changes

None.

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom philipnorton42 Cheshire

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024