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.
@@ -355,14 +355,6 @@ var RawClient = class {
355
355
  }
356
356
  };
357
357
 
358
- // src/utils/base64.ts
359
- var toBase64 = (value) => {
360
- if (typeof Buffer !== "undefined") {
361
- return Buffer.from(value).toString("base64");
362
- }
363
- return btoa(value);
364
- };
365
-
366
358
  // src/client/SoundCloudClient.ts
367
359
  function resolveToken(tokenGetter, explicit) {
368
360
  const t = explicit ?? tokenGetter();
@@ -569,15 +561,13 @@ exports.SoundCloudClient = class _SoundCloudClient {
569
561
  * @see https://developers.soundcloud.com/docs/api/explorer/open-api#/oauth2/post_oauth2_token
570
562
  */
571
563
  async getClientToken() {
572
- const basicAuth = toBase64(`${this.config.clientId}:${this.config.clientSecret}`);
573
564
  return this.fetch({
574
565
  path: "/oauth/token",
575
566
  method: "POST",
576
- headers: {
577
- Authorization: `Basic ${basicAuth}`
578
- },
579
567
  body: new URLSearchParams({
580
- grant_type: "client_credentials"
568
+ grant_type: "client_credentials",
569
+ client_id: this.config.clientId,
570
+ client_secret: this.config.clientSecret
581
571
  })
582
572
  });
583
573
  }
@@ -628,15 +618,13 @@ exports.SoundCloudClient = class _SoundCloudClient {
628
618
  * @see https://developers.soundcloud.com/docs/api/explorer/open-api#/oauth2/post_oauth2_token
629
619
  */
630
620
  async refreshUserToken(refreshToken) {
631
- const basicAuth = toBase64(`${this.config.clientId}:${this.config.clientSecret}`);
632
621
  return this.fetch({
633
622
  path: "/oauth/token",
634
623
  method: "POST",
635
- headers: {
636
- Authorization: `Basic ${basicAuth}`
637
- },
638
624
  body: new URLSearchParams({
639
625
  grant_type: "refresh_token",
626
+ client_id: this.config.clientId,
627
+ client_secret: this.config.clientSecret,
640
628
  redirect_uri: this.config.redirectUri,
641
629
  refresh_token: refreshToken
642
630
  })
@@ -1743,15 +1731,13 @@ var IMPLEMENTED_OPERATIONS = [
1743
1731
 
1744
1732
  // src/auth/getClientToken.ts
1745
1733
  var getClientToken = (clientId, clientSecret) => {
1746
- const basicAuth = toBase64(`${clientId}:${clientSecret}`);
1747
1734
  return scFetch({
1748
1735
  path: "/oauth/token",
1749
1736
  method: "POST",
1750
- headers: {
1751
- Authorization: `Basic ${basicAuth}`
1752
- },
1753
1737
  body: new URLSearchParams({
1754
- grant_type: "client_credentials"
1738
+ grant_type: "client_credentials",
1739
+ client_id: clientId,
1740
+ client_secret: clientSecret
1755
1741
  })
1756
1742
  });
1757
1743
  };
@@ -1775,15 +1761,13 @@ var getUserToken = (clientId, clientSecret, redirectUri, code, codeVerifier) =>
1775
1761
 
1776
1762
  // src/auth/refreshUserToken.ts
1777
1763
  var refreshUserToken = (clientId, clientSecret, redirectUri, refreshToken) => {
1778
- const basicAuth = toBase64(`${clientId}:${clientSecret}`);
1779
1764
  return scFetch({
1780
1765
  path: "/oauth/token",
1781
1766
  method: "POST",
1782
- headers: {
1783
- Authorization: `Basic ${basicAuth}`
1784
- },
1785
1767
  body: new URLSearchParams({
1786
1768
  grant_type: "refresh_token",
1769
+ client_id: clientId,
1770
+ client_secret: clientSecret,
1787
1771
  redirect_uri: redirectUri,
1788
1772
  refresh_token: refreshToken
1789
1773
  })
@@ -2116,5 +2100,5 @@ exports.unrepostPlaylist = unrepostPlaylist;
2116
2100
  exports.unrepostTrack = unrepostTrack;
2117
2101
  exports.updatePlaylist = updatePlaylist;
2118
2102
  exports.updateTrack = updateTrack;
2119
- //# sourceMappingURL=chunk-RS2J5LTS.js.map
2120
- //# sourceMappingURL=chunk-RS2J5LTS.js.map
2103
+ //# sourceMappingURL=chunk-FYDWU4M3.js.map
2104
+ //# sourceMappingURL=chunk-FYDWU4M3.js.map