soundcloud-api-ts 1.12.0 → 1.13.0

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.
@@ -874,6 +874,27 @@ exports.SoundCloudClient = class _SoundCloudClient {
874
874
  const t = resolveToken(this.getToken, options?.token);
875
875
  return this.fetch({ path: `/me/tracks?${limit ? `limit=${limit}&` : ""}linked_partitioning=true`, method: "GET", token: t });
876
876
  }
877
+ /**
878
+ * List the authenticated user's connected external social accounts.
879
+ *
880
+ * @param options - Optional token override
881
+ * @returns Array of connection objects for linked social services (Twitter, Facebook, etc.)
882
+ * @throws {SoundCloudError} When the API returns an error
883
+ *
884
+ * @remarks This endpoint may require elevated API access or app approval.
885
+ *
886
+ * @example
887
+ * ```ts
888
+ * const connections = await sc.me.getConnections();
889
+ * connections.forEach(c => console.log(c.service, c.display_name));
890
+ * ```
891
+ *
892
+ * @see https://developers.soundcloud.com/docs/api/explorer/open-api#/me/get_me_connections
893
+ */
894
+ async getConnections(options) {
895
+ const t = resolveToken(this.getToken, options?.token);
896
+ return this.fetch({ path: "/me/connections", method: "GET", token: t });
897
+ }
877
898
  }
878
899
  SoundCloudClient2.Me = Me;
879
900
  class Users {
@@ -1045,6 +1066,26 @@ exports.SoundCloudClient = class _SoundCloudClient {
1045
1066
  const t = resolveToken(this.getToken, options?.token);
1046
1067
  return this.fetch({ path: `/tracks/${trackId}`, method: "GET", token: t });
1047
1068
  }
1069
+ /**
1070
+ * Fetch multiple tracks by their IDs in a single request.
1071
+ *
1072
+ * @param ids - Array of track IDs (numeric or string URNs)
1073
+ * @param options - Optional token override
1074
+ * @returns Array of track objects (may be shorter than `ids` if some tracks are unavailable)
1075
+ * @throws {SoundCloudError} When the API returns an error
1076
+ *
1077
+ * @example
1078
+ * ```ts
1079
+ * const tracks = await sc.tracks.getTracks([123456, 234567, 345678]);
1080
+ * tracks.forEach(t => console.log(t.title));
1081
+ * ```
1082
+ *
1083
+ * @see https://developers.soundcloud.com/docs/api/explorer/open-api#/tracks/get_tracks
1084
+ */
1085
+ async getTracks(ids, options) {
1086
+ const t = resolveToken(this.getToken, options?.token);
1087
+ return this.fetch({ path: `/tracks?ids=${ids.join(",")}`, method: "GET", token: t });
1088
+ }
1048
1089
  /**
1049
1090
  * Get stream URLs for a track.
1050
1091
  *
@@ -1641,6 +1682,7 @@ var IMPLEMENTED_OPERATIONS = [
1641
1682
  "get_me_followers",
1642
1683
  "get_me_playlists",
1643
1684
  "get_me_tracks",
1685
+ "get_me_connections",
1644
1686
  // Users
1645
1687
  "get_users_user_id",
1646
1688
  "get_users_user_id_followers",
@@ -1802,6 +1844,13 @@ var getUserWebProfiles = (token, userId) => scFetch({ path: `/users/${userId}/we
1802
1844
  // src/tracks/getTrack.ts
1803
1845
  var getTrack = (token, trackId) => scFetch({ path: `/tracks/${trackId}`, method: "GET", token });
1804
1846
 
1847
+ // src/tracks/getTracks.ts
1848
+ var getTracks = (token, ids) => scFetch({
1849
+ path: `/tracks?ids=${ids.join(",")}`,
1850
+ method: "GET",
1851
+ token
1852
+ });
1853
+
1805
1854
  // src/tracks/getComments.ts
1806
1855
  var getTrackComments = (token, trackId, limit) => scFetch({ path: `/tracks/${trackId}/comments?threaded=1&filter_replies=0${limit ? `&limit=${limit}` : ""}&linked_partitioning=true`, method: "GET", token });
1807
1856
 
@@ -1920,6 +1969,9 @@ var getMePlaylists = (token, limit) => scFetch({ path: `/me/playlists?${limit ?
1920
1969
  // src/me/tracks.ts
1921
1970
  var getMeTracks = (token, limit) => scFetch({ path: `/me/tracks?${limit ? `limit=${limit}&` : ""}linked_partitioning=true`, method: "GET", token });
1922
1971
 
1972
+ // src/me/connections.ts
1973
+ var getMeConnections = (token) => scFetch({ path: "/me/connections", method: "GET", token });
1974
+
1923
1975
  // src/likes/index.ts
1924
1976
  var likePlaylist = async (token, playlistId) => {
1925
1977
  try {
@@ -1994,6 +2046,7 @@ exports.getMe = getMe;
1994
2046
  exports.getMeActivities = getMeActivities;
1995
2047
  exports.getMeActivitiesOwn = getMeActivitiesOwn;
1996
2048
  exports.getMeActivitiesTracks = getMeActivitiesTracks;
2049
+ exports.getMeConnections = getMeConnections;
1997
2050
  exports.getMeFollowers = getMeFollowers;
1998
2051
  exports.getMeFollowings = getMeFollowings;
1999
2052
  exports.getMeFollowingsTracks = getMeFollowingsTracks;
@@ -2011,6 +2064,7 @@ exports.getTrackComments = getTrackComments;
2011
2064
  exports.getTrackLikes = getTrackLikes;
2012
2065
  exports.getTrackReposts = getTrackReposts;
2013
2066
  exports.getTrackStreams = getTrackStreams;
2067
+ exports.getTracks = getTracks;
2014
2068
  exports.getUser = getUser;
2015
2069
  exports.getUserLikesPlaylists = getUserLikesPlaylists;
2016
2070
  exports.getUserLikesTracks = getUserLikesTracks;
@@ -2039,5 +2093,5 @@ exports.unrepostPlaylist = unrepostPlaylist;
2039
2093
  exports.unrepostTrack = unrepostTrack;
2040
2094
  exports.updatePlaylist = updatePlaylist;
2041
2095
  exports.updateTrack = updateTrack;
2042
- //# sourceMappingURL=chunk-D7AF372V.js.map
2043
- //# sourceMappingURL=chunk-D7AF372V.js.map
2096
+ //# sourceMappingURL=chunk-VBDIRSOG.js.map
2097
+ //# sourceMappingURL=chunk-VBDIRSOG.js.map