Skip to content

Releases: neet/masto.js

v5.0.5

26 Dec 00:05
Compare
Choose a tag to compare

5.0.5 (2022-12-26)

v5.0.4

25 Dec 06:33
Compare
Choose a tag to compare

5.0.4 (2022-12-25)

Bug Fixes

  • Node.js < 18 media uploading (987dac7)

v5.0.3

25 Dec 06:18
Compare
Choose a tag to compare

5.0.3 (2022-12-25)

Bug Fixes

  • Add default filename only when field value is a blob (fd6d3fb)
  • Clear timeout when request completed (f6b2f9c)

v5.0.2

25 Dec 00:05
Compare
Choose a tag to compare

5.0.2 (2022-12-25)

Bug Fixes

  • Add default filename for form-data (9a7489f)
  • Change return type of Paginator#next to Promise (3399892)
  • Fix MastoTimeoutError to be thrown instead of AbortError (8de20a4)
  • Update target to ES6 (3a3acec)

v5.0.1

24 Dec 00:05
Compare
Choose a tag to compare

5.0.1 (2022-12-24)

v5.0.0

23 Dec 20:34
Compare
Choose a tag to compare

5.0.0 (2022-12-23)

Migration Guide

  • We have changed the HTTP library to fetch API (node-fetch) from axios. You may have to update your code if you're using some features that are specific to Axios.

  • All methods now have an explicit version. Add v1 or v2 ─ the prefix depends on the endpoint─ before the name of a method. #722

// v4
masto.statuses.create({ status: "Hello" });
// v5
masto.v1.statuses.create({ status: "Hello" });
  • All response types are now exported under a namespace mastodon and also have explicit version numbers. #722
// v4
import { Status } from "masto";
// v5
import { mastodon } from "masto";
mastodon.v1.Status;
  • fetchAll, fetchMany, and iterate are now integrated into a method list which you can both await and for-await-of. #763
const favourites = await masto.v1.favourites.list();

for await (const statuses of masto.v1.favourites.list()) {
  // ...
}
  • If you're using Node.js 18, You'll need to use Blob interface for uploading a media attachment. Uploading an image with a Stream API is no longer supported since we moved to the web standard Fetch API.
// v4
masto.v2.mediaAttachments.create({ file: fs.createReadStream("./some_file.png") });
// v5
masto.v2.mediaAttachments.create({ file: new Blob([fs.readFileSync("./some_file.png")]) });

Bug Fixes

  • Fix instanceof operator for error classes (7893b4d)
  • Fix broken test for paginator (584d1dc)
  • Fix http-native-impl to use getContentType (875c371)
  • Fix setupFilesAfterEnv to include isomorphic-fetch (2fd41e3)
  • Fix tests (58ba2c7)
  • Fix tsc errors in domain blocks (4f8700e)
  • Fix v2 search path (b3d95f8)
  • Remove "DOM" from TypeScript lib dependency (61a9467)
  • Remove Array constraint from IRepository (ced6608)
  • Remove MimeType and change it to string (129a17a)
  • Rename methods that returns an array to start with list (68e8ff9)
  • Repository#delete -> Repository#remove (b4e06a5)
  • Update resource name to comply with the current Mastodon document (6a20ad9)
  • Use version check as error handling (d24ab9a)

Features

  • Add explicit API versions to methods (d4dd3fa)
  • Add logging interface (bedc623)
  • Drop Axios support (903c09d)
  • Move entities and repositories under the namespace (5da5773)
  • Remove deprecated class aliases (17582c1)
  • Remove next() argument (5370e0c)

BREAKING CHANGES

  • Outdated resource names are updated with the current Mastodon document. Including WebPushSubscription, CustomEmoji, AccountField, etc
  • You have to import mastodon to use any entity instead of importing single entity directly
  • Paginator#next no longer accepts an argument. Please recreate Paginator if you want to reset the internal state
  • fetchAll, fetchMany and other methods that returns an array is now prefixed with list*
  • Alias for iteration methods and error classes are now removed
  • All API calls now require masto.v1 or masto.v2 as a prefix.
  • headers option for login() now should be a WHATWG object. Proxy support is also dropped.

v4.11.1

22 Dec 09:54
Compare
Choose a tag to compare

4.11.1 (2022-12-22)

Bug Fixes

  • Change HTTP methods to uppercase (873a8e2)

v4.11.0

20 Dec 22:54
Compare
Choose a tag to compare

4.11.0 (2022-12-20)

Bug Fixes

  • Add backwards-compatible type declarations (#761) (e957388)
  • Add missing exclude_reblogs and tagged to fetching account statuses (#760) (59cd02a)

Features

v4.10.2

19 Dec 02:39
Compare
Choose a tag to compare

4.10.2 (2022-12-19)

Bug Fixes

  • Change Content-Type to undefined when body is a FormData (6edac35)

v4.10.1

18 Dec 00:06
Compare
Choose a tag to compare

4.10.1 (2022-12-18)