Skip to content

Add explicit API versions to the methods #722

@neet

Description

@neet

Currently, the API provided by masto.js is mixing of v1 and v2 Mastodon APIs. Some of the methods are implicitly using v2 while legacy APIs are also provided under a v1_ prefix. However, this implementation cause a major bump by updating endpoints to the latest version supported by Mastodon.

To resolve this, I'm planning to move all the v1 methods under masto.v1 and the v2 methods under masto.v2 and so on. As a result, Mastodon's API updates will not affect Masto.js’ major version anymore.

masto.v1.statuses.fetch("123123");
masto.v1.statuses.fetchMany();
masto.v1.statuses.create({ content: "Hello" });
masto.v2.search({ q: "#Mastodon" });

for await (const stauses of masto.v1.statuses.iterateUser("123123")) {
  //...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions