Skip to content

4.0.0

Latest

Choose a tag to compare

@StimulCross StimulCross released this 06 Mar 08:03
· 37 commits to main since this release

Breaking Changes

General

  • dropped support for Node.js versions below 20 (ee3c06e)

api-call

  • renamed the statusCode property to status in the HttpError class (9b73954)

auth

  • renamed the exchangeCode function to getAccessToken (612d5bf)

  • updated the addUser method in the RefreshingAuthProvider to return AccessTokenWithUserId (f2c9a0c)

  • changed the signature of addUser in the StaticAuthProvider from addUser(user: UserIdResolvable, token: Pick<AccessToken, 'accessToken' | 'scopes'>) to addUser(user: UserIdResolvable, accessToken: string, scopes?: string[]) (de00b2f)

    addUser method now accepts access token and scopes as parameters instead of partial AccessToken object.

  • removed null from expiresIn and refreshToken in the AccessToken interface (0f5d882)

  • throw InvalidTokenError from the getAccessTokenForUser method in the StaticAuthProvider for invalid access tokens (3354e7e)

Features

General

  • implemented the toJSON() method for all DataObject classes (84ee675).

    This makes all data instances serializable using the JSON.stringify() method.
    Additionally, all DataObject instances are now printable in console.log() in the Node.js environment through the inspect.custom mechanism.
    toJSON() method alson can be called manually to convert data instance to a plain JavaScript object.

api-call

  • replaced the cross-fetch package with the native fetch API (7bec48c)
  • updated the query field in DonationAlertsApiCallOptions to allow null values in addition to the existing types (fa2f851)

auth

  • enhanced the MissingScopeError with userId and scopes properties (747687d)
  • enhanced the InvalidTokenError with a userId property (731ff63)
  • enhanced the UnregisteredUserError with a userId property (33ce749)

api

  • added the createOrUpdateMerchandise method to the merchandise API (391544a)
  • added the DonationAlertsMerchandiseTitleData type export (7ae4d14)

Fixes

General

  • remove unused dependencies (710a148)

common

  • removed the unnecessary g flag from the NUMERIC_STRING_REGEX used in the extractUserId function (3571099)

api

  • fixed the URL in the merchandise sale API request (ba858cc)
  • fixed optional fields in the createMerchandise method (6f7fc85)
  • made logger options partial (6aa0834)
  • prevent logging undefined query parameters in ApiClient (5e7f431)

events

  • clean up listeners on unsubscribe (a19175e)