soundcloud-api-ts 1.13.1 → 1.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -353,14 +353,6 @@ var RawClient = class {
353
353
  }
354
354
  };
355
355
 
356
- // src/utils/base64.ts
357
- var toBase64 = (value) => {
358
- if (typeof Buffer !== "undefined") {
359
- return Buffer.from(value).toString("base64");
360
- }
361
- return btoa(value);
362
- };
363
-
364
356
  // src/client/SoundCloudClient.ts
365
357
  function resolveToken(tokenGetter, explicit) {
366
358
  const t = explicit ?? tokenGetter();
@@ -567,15 +559,13 @@ var SoundCloudClient = class _SoundCloudClient {
567
559
  * @see https://developers.soundcloud.com/docs/api/explorer/open-api#/oauth2/post_oauth2_token
568
560
  */
569
561
  async getClientToken() {
570
- const basicAuth = toBase64(`${this.config.clientId}:${this.config.clientSecret}`);
571
562
  return this.fetch({
572
563
  path: "/oauth/token",
573
564
  method: "POST",
574
- headers: {
575
- Authorization: `Basic ${basicAuth}`
576
- },
577
565
  body: new URLSearchParams({
578
- grant_type: "client_credentials"
566
+ grant_type: "client_credentials",
567
+ client_id: this.config.clientId,
568
+ client_secret: this.config.clientSecret
579
569
  })
580
570
  });
581
571
  }
@@ -626,15 +616,13 @@ var SoundCloudClient = class _SoundCloudClient {
626
616
  * @see https://developers.soundcloud.com/docs/api/explorer/open-api#/oauth2/post_oauth2_token
627
617
  */
628
618
  async refreshUserToken(refreshToken) {
629
- const basicAuth = toBase64(`${this.config.clientId}:${this.config.clientSecret}`);
630
619
  return this.fetch({
631
620
  path: "/oauth/token",
632
621
  method: "POST",
633
- headers: {
634
- Authorization: `Basic ${basicAuth}`
635
- },
636
622
  body: new URLSearchParams({
637
623
  grant_type: "refresh_token",
624
+ client_id: this.config.clientId,
625
+ client_secret: this.config.clientSecret,
638
626
  redirect_uri: this.config.redirectUri,
639
627
  refresh_token: refreshToken
640
628
  })
@@ -1741,15 +1729,13 @@ var IMPLEMENTED_OPERATIONS = [
1741
1729
 
1742
1730
  // src/auth/getClientToken.ts
1743
1731
  var getClientToken = (clientId, clientSecret) => {
1744
- const basicAuth = toBase64(`${clientId}:${clientSecret}`);
1745
1732
  return scFetch({
1746
1733
  path: "/oauth/token",
1747
1734
  method: "POST",
1748
- headers: {
1749
- Authorization: `Basic ${basicAuth}`
1750
- },
1751
1735
  body: new URLSearchParams({
1752
- grant_type: "client_credentials"
1736
+ grant_type: "client_credentials",
1737
+ client_id: clientId,
1738
+ client_secret: clientSecret
1753
1739
  })
1754
1740
  });
1755
1741
  };
@@ -1773,15 +1759,13 @@ var getUserToken = (clientId, clientSecret, redirectUri, code, codeVerifier) =>
1773
1759
 
1774
1760
  // src/auth/refreshUserToken.ts
1775
1761
  var refreshUserToken = (clientId, clientSecret, redirectUri, refreshToken) => {
1776
- const basicAuth = toBase64(`${clientId}:${clientSecret}`);
1777
1762
  return scFetch({
1778
1763
  path: "/oauth/token",
1779
1764
  method: "POST",
1780
- headers: {
1781
- Authorization: `Basic ${basicAuth}`
1782
- },
1783
1765
  body: new URLSearchParams({
1784
1766
  grant_type: "refresh_token",
1767
+ client_id: clientId,
1768
+ client_secret: clientSecret,
1785
1769
  redirect_uri: redirectUri,
1786
1770
  refresh_token: refreshToken
1787
1771
  })
@@ -2049,5 +2033,5 @@ var unrepostPlaylist = async (token, playlistId) => {
2049
2033
  var getSoundCloudWidgetUrl = (trackId) => `https%3A//api.soundcloud.com/tracks/${trackId}&show_teaser=false&color=%2300a99d&inverse=false&show_user=false&sharing=false&buying=false&liking=false&show_artwork=false&show_name=false`;
2050
2034
 
2051
2035
  export { IMPLEMENTED_OPERATIONS, InFlightDeduper, RawClient, SoundCloudClient, createPlaylist, createTrackComment, deletePlaylist, deleteTrack, fetchAll, followUser, generateCodeChallenge, generateCodeVerifier, getAuthorizationUrl, getClientToken, getFollowers, getFollowings, getMe, getMeActivities, getMeActivitiesOwn, getMeActivitiesTracks, getMeConnections, getMeFollowers, getMeFollowings, getMeFollowingsTracks, getMeLikesPlaylists, getMeLikesTracks, getMePlaylists, getMeTracks, getPlaylist, getPlaylistReposts, getPlaylistTracks, getRelatedTracks, getSoundCloudWidgetUrl, getTrack, getTrackComments, getTrackLikes, getTrackReposts, getTrackStreams, getTracks, getUser, getUserLikesPlaylists, getUserLikesTracks, getUserPlaylists, getUserToken, getUserTracks, getUserWebProfiles, likePlaylist, likeTrack, paginate, paginateItems, refreshUserToken, repostPlaylist, repostTrack, resolveUrl, scFetch, scFetchUrl, searchPlaylists, searchTracks, searchUsers, signOut, unfollowUser, unlikePlaylist, unlikeTrack, unrepostPlaylist, unrepostTrack, updatePlaylist, updateTrack };
2052
- //# sourceMappingURL=chunk-CCHK5S6S.mjs.map
2053
- //# sourceMappingURL=chunk-CCHK5S6S.mjs.map
2036
+ //# sourceMappingURL=chunk-DCZIPG5T.mjs.map
2037
+ //# sourceMappingURL=chunk-DCZIPG5T.mjs.map