lastfm-nodejs-client 1.6.0 → 1.7.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.
- package/README.md +140 -74
- package/dist/@types/album/addTags.d.ts +11 -0
- package/dist/@types/album/getInfo.d.ts +11 -0
- package/dist/@types/album/getTags.d.ts +11 -0
- package/dist/@types/album/getTopTags.d.ts +10 -0
- package/dist/@types/album/removeTag.d.ts +11 -0
- package/dist/@types/album/search.d.ts +10 -0
- package/dist/@types/artist/addTags.d.ts +10 -0
- package/dist/@types/artist/getCorrection.d.ts +9 -0
- package/dist/@types/artist/getInfo.d.ts +10 -0
- package/dist/@types/artist/getSimilar.d.ts +10 -0
- package/dist/@types/artist/getTags.d.ts +10 -0
- package/dist/@types/artist/getTopAlbums.d.ts +11 -0
- package/dist/@types/artist/getTopTags.d.ts +9 -0
- package/dist/@types/artist/getTopTracks.d.ts +11 -0
- package/dist/@types/artist/removeTag.d.ts +10 -0
- package/dist/@types/artist/search.d.ts +10 -0
- package/dist/@types/auth/getMobileSession.d.ts +11 -0
- package/dist/@types/auth/getSession.d.ts +10 -0
- package/dist/@types/auth.d.ts +9 -6
- package/dist/@types/chart/topArtists.d.ts +11 -0
- package/dist/@types/chart/topTags.d.ts +8 -0
- package/dist/@types/chart/topTracks.d.ts +8 -0
- package/dist/@types/config.d.ts +13 -11
- package/dist/@types/createOptions.d.ts +23 -0
- package/dist/@types/geo/getTopArtists.d.ts +10 -0
- package/dist/@types/geo/getTopTracks.d.ts +10 -0
- package/dist/@types/getFriends.d.ts +6 -3
- package/dist/@types/getInfo.d.ts +5 -3
- package/dist/@types/getLovedTracks.d.ts +7 -3
- package/dist/@types/getRecentTracks.d.ts +7 -3
- package/dist/@types/getTopAlbums.d.ts +7 -3
- package/dist/@types/getTopArtists.d.ts +7 -3
- package/dist/@types/getTopTracks.d.ts +7 -3
- package/dist/@types/getUserTopTags.d.ts +6 -3
- package/dist/@types/getWeeklyAlbumChart.d.ts +7 -3
- package/dist/@types/getWeeklyArtistChart.d.ts +7 -3
- package/dist/@types/getWeeklyChartList.d.ts +8 -3
- package/dist/@types/getWeeklyTrackChart.d.ts +7 -3
- package/dist/@types/index.d.ts +31 -89
- package/dist/@types/library/getArtists.d.ts +10 -0
- package/dist/@types/method.d.ts +25 -77
- package/dist/@types/request.d.ts +23 -0
- package/dist/@types/tag/getInfo.d.ts +9 -0
- package/dist/@types/tag/getSimilar.d.ts +8 -0
- package/dist/@types/tag/getTopAlbums.d.ts +10 -0
- package/dist/@types/tag/getTopArtists.d.ts +10 -0
- package/dist/@types/tag/getTopTags.d.ts +7 -0
- package/dist/@types/tag/getWeeklyChartList.d.ts +9 -0
- package/dist/@types/tag/topTracks.d.ts +6 -3
- package/dist/@types/track/addTags.d.ts +11 -0
- package/dist/@types/track/getCorrection.d.ts +10 -0
- package/dist/@types/track/getInfo.d.ts +11 -0
- package/dist/@types/track/getSimilar.d.ts +11 -0
- package/dist/@types/track/getTags.d.ts +11 -0
- package/dist/@types/track/getTopTags.d.ts +10 -0
- package/dist/@types/track/love.d.ts +10 -0
- package/dist/@types/track/removeTag.d.ts +11 -0
- package/dist/@types/track/scrobble.d.ts +12 -0
- package/dist/@types/track/search.d.ts +11 -0
- package/dist/@types/track/unlove.d.ts +10 -0
- package/dist/@types/track/updateNowPlaying.d.ts +11 -0
- package/dist/@types/user/getPersonalTags.d.ts +12 -0
- package/dist/album/addTags.js +11 -0
- package/dist/album/addTags.js.map +1 -1
- package/dist/album/getInfo.js +11 -0
- package/dist/album/getInfo.js.map +1 -1
- package/dist/album/getTags.js +11 -0
- package/dist/album/getTags.js.map +1 -1
- package/dist/album/getTopTags.js +10 -0
- package/dist/album/getTopTags.js.map +1 -1
- package/dist/album/removeTag.js +11 -0
- package/dist/album/removeTag.js.map +1 -1
- package/dist/album/search.js +10 -0
- package/dist/album/search.js.map +1 -1
- package/dist/artist/addTags.js +10 -0
- package/dist/artist/addTags.js.map +1 -1
- package/dist/artist/getCorrection.js +9 -0
- package/dist/artist/getCorrection.js.map +1 -1
- package/dist/artist/getInfo.js +10 -0
- package/dist/artist/getInfo.js.map +1 -1
- package/dist/artist/getSimilar.js +10 -0
- package/dist/artist/getSimilar.js.map +1 -1
- package/dist/artist/getTags.js +10 -0
- package/dist/artist/getTags.js.map +1 -1
- package/dist/artist/getTopAlbums.js +11 -0
- package/dist/artist/getTopAlbums.js.map +1 -1
- package/dist/artist/getTopTags.js +9 -0
- package/dist/artist/getTopTags.js.map +1 -1
- package/dist/artist/getTopTracks.js +11 -0
- package/dist/artist/getTopTracks.js.map +1 -1
- package/dist/artist/removeTag.js +10 -0
- package/dist/artist/removeTag.js.map +1 -1
- package/dist/artist/search.js +10 -0
- package/dist/artist/search.js.map +1 -1
- package/dist/auth/getMobileSession.js +11 -0
- package/dist/auth/getMobileSession.js.map +1 -1
- package/dist/auth/getSession.js +10 -0
- package/dist/auth/getSession.js.map +1 -1
- package/dist/auth.js +9 -6
- package/dist/auth.js.map +1 -1
- package/dist/chart/topArtists.js +11 -0
- package/dist/chart/topArtists.js.map +1 -1
- package/dist/chart/topTags.js +8 -0
- package/dist/chart/topTags.js.map +1 -1
- package/dist/chart/topTracks.js +8 -0
- package/dist/chart/topTracks.js.map +1 -1
- package/dist/cjs/album/addTags.js +11 -0
- package/dist/cjs/album/addTags.js.map +1 -1
- package/dist/cjs/album/getInfo.js +11 -0
- package/dist/cjs/album/getInfo.js.map +1 -1
- package/dist/cjs/album/getTags.js +11 -0
- package/dist/cjs/album/getTags.js.map +1 -1
- package/dist/cjs/album/getTopTags.js +10 -0
- package/dist/cjs/album/getTopTags.js.map +1 -1
- package/dist/cjs/album/removeTag.js +11 -0
- package/dist/cjs/album/removeTag.js.map +1 -1
- package/dist/cjs/album/search.js +10 -0
- package/dist/cjs/album/search.js.map +1 -1
- package/dist/cjs/artist/addTags.js +10 -0
- package/dist/cjs/artist/addTags.js.map +1 -1
- package/dist/cjs/artist/getCorrection.js +9 -0
- package/dist/cjs/artist/getCorrection.js.map +1 -1
- package/dist/cjs/artist/getInfo.js +10 -0
- package/dist/cjs/artist/getInfo.js.map +1 -1
- package/dist/cjs/artist/getSimilar.js +10 -0
- package/dist/cjs/artist/getSimilar.js.map +1 -1
- package/dist/cjs/artist/getTags.js +10 -0
- package/dist/cjs/artist/getTags.js.map +1 -1
- package/dist/cjs/artist/getTopAlbums.js +11 -0
- package/dist/cjs/artist/getTopAlbums.js.map +1 -1
- package/dist/cjs/artist/getTopTags.js +9 -0
- package/dist/cjs/artist/getTopTags.js.map +1 -1
- package/dist/cjs/artist/getTopTracks.js +11 -0
- package/dist/cjs/artist/getTopTracks.js.map +1 -1
- package/dist/cjs/artist/removeTag.js +10 -0
- package/dist/cjs/artist/removeTag.js.map +1 -1
- package/dist/cjs/artist/search.js +10 -0
- package/dist/cjs/artist/search.js.map +1 -1
- package/dist/cjs/auth/getMobileSession.js +11 -0
- package/dist/cjs/auth/getMobileSession.js.map +1 -1
- package/dist/cjs/auth/getSession.js +10 -0
- package/dist/cjs/auth/getSession.js.map +1 -1
- package/dist/cjs/auth.js +9 -6
- package/dist/cjs/auth.js.map +1 -1
- package/dist/cjs/chart/topArtists.js +11 -0
- package/dist/cjs/chart/topArtists.js.map +1 -1
- package/dist/cjs/chart/topTags.js +8 -0
- package/dist/cjs/chart/topTags.js.map +1 -1
- package/dist/cjs/chart/topTracks.js +8 -0
- package/dist/cjs/chart/topTracks.js.map +1 -1
- package/dist/cjs/config.js.map +1 -1
- package/dist/cjs/createOptions.js +23 -0
- package/dist/cjs/createOptions.js.map +1 -1
- package/dist/cjs/geo/getTopArtists.js +10 -0
- package/dist/cjs/geo/getTopArtists.js.map +1 -1
- package/dist/cjs/geo/getTopTracks.js +10 -0
- package/dist/cjs/geo/getTopTracks.js.map +1 -1
- package/dist/cjs/getFriends.js +6 -3
- package/dist/cjs/getFriends.js.map +1 -1
- package/dist/cjs/getInfo.js +5 -3
- package/dist/cjs/getInfo.js.map +1 -1
- package/dist/cjs/getLovedTracks.js +7 -3
- package/dist/cjs/getLovedTracks.js.map +1 -1
- package/dist/cjs/getRecentTracks.js +7 -3
- package/dist/cjs/getRecentTracks.js.map +1 -1
- package/dist/cjs/getTopAlbums.js +7 -3
- package/dist/cjs/getTopAlbums.js.map +1 -1
- package/dist/cjs/getTopArtists.js +7 -3
- package/dist/cjs/getTopArtists.js.map +1 -1
- package/dist/cjs/getTopTracks.js +7 -3
- package/dist/cjs/getTopTracks.js.map +1 -1
- package/dist/cjs/getUserTopTags.js +6 -3
- package/dist/cjs/getUserTopTags.js.map +1 -1
- package/dist/cjs/getWeeklyAlbumChart.js +7 -3
- package/dist/cjs/getWeeklyAlbumChart.js.map +1 -1
- package/dist/cjs/getWeeklyArtistChart.js +7 -3
- package/dist/cjs/getWeeklyArtistChart.js.map +1 -1
- package/dist/cjs/getWeeklyChartList.js +8 -3
- package/dist/cjs/getWeeklyChartList.js.map +1 -1
- package/dist/cjs/getWeeklyTrackChart.js +7 -3
- package/dist/cjs/getWeeklyTrackChart.js.map +1 -1
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/library/getArtists.js +10 -0
- package/dist/cjs/library/getArtists.js.map +1 -1
- package/dist/cjs/method.js +11 -0
- package/dist/cjs/method.js.map +1 -1
- package/dist/cjs/request.js +30 -0
- package/dist/cjs/request.js.map +1 -1
- package/dist/cjs/tag/getInfo.js +9 -0
- package/dist/cjs/tag/getInfo.js.map +1 -1
- package/dist/cjs/tag/getSimilar.js +8 -0
- package/dist/cjs/tag/getSimilar.js.map +1 -1
- package/dist/cjs/tag/getTopAlbums.js +10 -0
- package/dist/cjs/tag/getTopAlbums.js.map +1 -1
- package/dist/cjs/tag/getTopArtists.js +10 -0
- package/dist/cjs/tag/getTopArtists.js.map +1 -1
- package/dist/cjs/tag/getTopTags.js +7 -0
- package/dist/cjs/tag/getTopTags.js.map +1 -1
- package/dist/cjs/tag/getWeeklyChartList.js +9 -0
- package/dist/cjs/tag/getWeeklyChartList.js.map +1 -1
- package/dist/cjs/tag/topTracks.js +6 -3
- package/dist/cjs/tag/topTracks.js.map +1 -1
- package/dist/cjs/track/addTags.js +11 -0
- package/dist/cjs/track/addTags.js.map +1 -1
- package/dist/cjs/track/getCorrection.js +10 -0
- package/dist/cjs/track/getCorrection.js.map +1 -1
- package/dist/cjs/track/getInfo.js +11 -0
- package/dist/cjs/track/getInfo.js.map +1 -1
- package/dist/cjs/track/getSimilar.js +11 -0
- package/dist/cjs/track/getSimilar.js.map +1 -1
- package/dist/cjs/track/getTags.js +11 -0
- package/dist/cjs/track/getTags.js.map +1 -1
- package/dist/cjs/track/getTopTags.js +10 -0
- package/dist/cjs/track/getTopTags.js.map +1 -1
- package/dist/cjs/track/love.js +10 -0
- package/dist/cjs/track/love.js.map +1 -1
- package/dist/cjs/track/removeTag.js +11 -0
- package/dist/cjs/track/removeTag.js.map +1 -1
- package/dist/cjs/track/scrobble.js +12 -0
- package/dist/cjs/track/scrobble.js.map +1 -1
- package/dist/cjs/track/search.js +11 -0
- package/dist/cjs/track/search.js.map +1 -1
- package/dist/cjs/track/unlove.js +10 -0
- package/dist/cjs/track/unlove.js.map +1 -1
- package/dist/cjs/track/updateNowPlaying.js +11 -0
- package/dist/cjs/track/updateNowPlaying.js.map +1 -1
- package/dist/cjs/user/getPersonalTags.js +12 -0
- package/dist/cjs/user/getPersonalTags.js.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/createOptions.js +23 -0
- package/dist/createOptions.js.map +1 -1
- package/dist/geo/getTopArtists.js +10 -0
- package/dist/geo/getTopArtists.js.map +1 -1
- package/dist/geo/getTopTracks.js +10 -0
- package/dist/geo/getTopTracks.js.map +1 -1
- package/dist/getFriends.js +6 -3
- package/dist/getFriends.js.map +1 -1
- package/dist/getInfo.js +5 -3
- package/dist/getInfo.js.map +1 -1
- package/dist/getLovedTracks.js +7 -3
- package/dist/getLovedTracks.js.map +1 -1
- package/dist/getRecentTracks.js +7 -3
- package/dist/getRecentTracks.js.map +1 -1
- package/dist/getTopAlbums.js +7 -3
- package/dist/getTopAlbums.js.map +1 -1
- package/dist/getTopArtists.js +7 -3
- package/dist/getTopArtists.js.map +1 -1
- package/dist/getTopTracks.js +7 -3
- package/dist/getTopTracks.js.map +1 -1
- package/dist/getUserTopTags.js +6 -3
- package/dist/getUserTopTags.js.map +1 -1
- package/dist/getWeeklyAlbumChart.js +7 -3
- package/dist/getWeeklyAlbumChart.js.map +1 -1
- package/dist/getWeeklyArtistChart.js +7 -3
- package/dist/getWeeklyArtistChart.js.map +1 -1
- package/dist/getWeeklyChartList.js +8 -3
- package/dist/getWeeklyChartList.js.map +1 -1
- package/dist/getWeeklyTrackChart.js +7 -3
- package/dist/getWeeklyTrackChart.js.map +1 -1
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -1
- package/dist/library/getArtists.js +10 -0
- package/dist/library/getArtists.js.map +1 -1
- package/dist/method.js +11 -0
- package/dist/method.js.map +1 -1
- package/dist/request.js +30 -0
- package/dist/request.js.map +1 -1
- package/dist/tag/getInfo.js +9 -0
- package/dist/tag/getInfo.js.map +1 -1
- package/dist/tag/getSimilar.js +8 -0
- package/dist/tag/getSimilar.js.map +1 -1
- package/dist/tag/getTopAlbums.js +10 -0
- package/dist/tag/getTopAlbums.js.map +1 -1
- package/dist/tag/getTopArtists.js +10 -0
- package/dist/tag/getTopArtists.js.map +1 -1
- package/dist/tag/getTopTags.js +7 -0
- package/dist/tag/getTopTags.js.map +1 -1
- package/dist/tag/getWeeklyChartList.js +9 -0
- package/dist/tag/getWeeklyChartList.js.map +1 -1
- package/dist/tag/topTracks.js +6 -3
- package/dist/tag/topTracks.js.map +1 -1
- package/dist/track/addTags.js +11 -0
- package/dist/track/addTags.js.map +1 -1
- package/dist/track/getCorrection.js +10 -0
- package/dist/track/getCorrection.js.map +1 -1
- package/dist/track/getInfo.js +11 -0
- package/dist/track/getInfo.js.map +1 -1
- package/dist/track/getSimilar.js +11 -0
- package/dist/track/getSimilar.js.map +1 -1
- package/dist/track/getTags.js +11 -0
- package/dist/track/getTags.js.map +1 -1
- package/dist/track/getTopTags.js +10 -0
- package/dist/track/getTopTags.js.map +1 -1
- package/dist/track/love.js +10 -0
- package/dist/track/love.js.map +1 -1
- package/dist/track/removeTag.js +11 -0
- package/dist/track/removeTag.js.map +1 -1
- package/dist/track/scrobble.js +12 -0
- package/dist/track/scrobble.js.map +1 -1
- package/dist/track/search.js +11 -0
- package/dist/track/search.js.map +1 -1
- package/dist/track/unlove.js +10 -0
- package/dist/track/unlove.js.map +1 -1
- package/dist/track/updateNowPlaying.js +11 -0
- package/dist/track/updateNowPlaying.js.map +1 -1
- package/dist/user/getPersonalTags.js +12 -0
- package/dist/user/getPersonalTags.js.map +1 -1
- package/package.json +7 -10
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
import type { GeoTopArtistsResponse } from '../lastfm.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get the most popular artists on Last.fm by country.
|
|
4
|
+
*
|
|
5
|
+
* @see https://www.last.fm/api/show/geo.getTopArtists
|
|
6
|
+
* @param method - The Last.fm API method string (`method.geo.getTopArtists`)
|
|
7
|
+
* @param country - Country name as defined by the ISO 3166-1 standard
|
|
8
|
+
* @param limit - Number of results per page (default `'50'`)
|
|
9
|
+
* @param page - Page number to fetch (default `'1'`)
|
|
10
|
+
* @returns Paginated list of top artists for the given country
|
|
11
|
+
*/
|
|
2
12
|
export declare function geoGetTopArtists(method: string, country: string, limit?: string, page?: string): Promise<GeoTopArtistsResponse>;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
import type { GeoTopTracksResponse } from '../lastfm.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get the most popular tracks on Last.fm by country.
|
|
4
|
+
*
|
|
5
|
+
* @see https://www.last.fm/api/show/geo.getTopTracks
|
|
6
|
+
* @param method - The Last.fm API method string (`method.geo.getTopTracks`)
|
|
7
|
+
* @param country - Country name as defined by the ISO 3166-1 standard
|
|
8
|
+
* @param limit - Number of results per page (default `'50'`)
|
|
9
|
+
* @param page - Page number to fetch (default `'1'`)
|
|
10
|
+
* @returns Paginated list of top tracks for the given country
|
|
11
|
+
*/
|
|
2
12
|
export declare function geoGetTopTracks(method: string, country: string, limit?: string, page?: string): Promise<GeoTopTracksResponse>;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { FriendsResponse } from './lastfm.types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Get a list of the user's friends on Last.fm.
|
|
4
4
|
*
|
|
5
|
-
* https://www.last.fm/api/show/user.getFriends
|
|
6
|
-
* @
|
|
5
|
+
* @see https://www.last.fm/api/show/user.getFriends
|
|
6
|
+
* @param method - The Last.fm API method string (`method.user.getFriends`)
|
|
7
|
+
* @param user - The Last.fm username
|
|
8
|
+
* @param limit - Number of results per page
|
|
9
|
+
* @returns A list of the user's friends with their profile information
|
|
7
10
|
*/
|
|
8
11
|
export declare function getFriends(method: string, user: string, limit: string): Promise<FriendsResponse>;
|
package/dist/@types/getInfo.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type UserResponse } from './lastfm.types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Get information about a user profile on Last.fm.
|
|
4
4
|
*
|
|
5
|
-
* https://www.last.fm/api/show/user.getInfo
|
|
6
|
-
* @
|
|
5
|
+
* @see https://www.last.fm/api/show/user.getInfo
|
|
6
|
+
* @param method - The Last.fm API method string (`method.user.getInfo`)
|
|
7
|
+
* @param user - The Last.fm username
|
|
8
|
+
* @returns User profile information including name, playcount, and registration date
|
|
7
9
|
*/
|
|
8
10
|
export declare function getInfo(method: string, user: string): Promise<UserResponse>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { type LovedTracksResponse } from './lastfm.types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Get the last 50 tracks loved by a user on Last.fm.
|
|
4
4
|
*
|
|
5
|
-
* https://www.last.fm/api/show/user.getLovedTracks
|
|
6
|
-
* @
|
|
5
|
+
* @see https://www.last.fm/api/show/user.getLovedTracks
|
|
6
|
+
* @param method - The Last.fm API method string (`method.user.getLovedTracks`)
|
|
7
|
+
* @param user - The Last.fm username
|
|
8
|
+
* @param period - The time period to retrieve loved tracks for
|
|
9
|
+
* @param limit - Number of results per page
|
|
10
|
+
* @returns The user's loved tracks
|
|
7
11
|
*/
|
|
8
12
|
export declare function getLovedTracks(method: string, user: string, period: string, limit: string): Promise<LovedTracksResponse>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { type RecentTracksResponse } from './lastfm.types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Get a list of the recent tracks listened to by a user on Last.fm.
|
|
4
4
|
*
|
|
5
|
-
* https://www.last.fm/api/show/user.getRecentTracks
|
|
6
|
-
* @
|
|
5
|
+
* @see https://www.last.fm/api/show/user.getRecentTracks
|
|
6
|
+
* @param method - The Last.fm API method string (`method.user.getRecentTracks`)
|
|
7
|
+
* @param user - The Last.fm username
|
|
8
|
+
* @param limit - Number of results per page
|
|
9
|
+
* @param from - Unix timestamp; only return tracks scrobbled after this time
|
|
10
|
+
* @returns The user's recent tracks including any currently playing track
|
|
7
11
|
*/
|
|
8
12
|
export declare function getRecentTracks(method: string, user: string, limit: string, from?: string): Promise<RecentTracksResponse>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { type TopAlbumsResponse } from './lastfm.types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Get the top albums listened to by a user on Last.fm, over a given time period.
|
|
4
4
|
*
|
|
5
|
-
* https://www.last.fm/api/show/user.getTopAlbums
|
|
6
|
-
* @
|
|
5
|
+
* @see https://www.last.fm/api/show/user.getTopAlbums
|
|
6
|
+
* @param method - The Last.fm API method string (`method.user.getTopAlbums`)
|
|
7
|
+
* @param user - The Last.fm username
|
|
8
|
+
* @param period - Time period (`overall`, `7day`, `1month`, `3month`, `6month`, `12month`)
|
|
9
|
+
* @param limit - Number of results per page
|
|
10
|
+
* @returns The user's top albums for the given period
|
|
7
11
|
*/
|
|
8
12
|
export declare function getTopAlbums(method: string, user: string, period: string, limit: string): Promise<TopAlbumsResponse>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { type TopArtistsResponse } from './lastfm.types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Get the top artists listened to by a user on Last.fm, over a given time period.
|
|
4
4
|
*
|
|
5
|
-
* https://www.last.fm/api/show/user.getTopArtists
|
|
6
|
-
* @
|
|
5
|
+
* @see https://www.last.fm/api/show/user.getTopArtists
|
|
6
|
+
* @param method - The Last.fm API method string (`method.user.getTopArtists`)
|
|
7
|
+
* @param user - The Last.fm username
|
|
8
|
+
* @param period - Time period (`overall`, `7day`, `1month`, `3month`, `6month`, `12month`)
|
|
9
|
+
* @param limit - Number of results per page
|
|
10
|
+
* @returns The user's top artists for the given period
|
|
7
11
|
*/
|
|
8
12
|
export declare function getTopArtists(method: string, user: string, period: string, limit: string): Promise<TopArtistsResponse>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { type TopTrackResponse } from './lastfm.types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Get the top tracks listened to by a user on Last.fm, over a given time period.
|
|
4
4
|
*
|
|
5
|
-
* https://www.last.fm/api/show/user.getTopTracks
|
|
6
|
-
* @
|
|
5
|
+
* @see https://www.last.fm/api/show/user.getTopTracks
|
|
6
|
+
* @param method - The Last.fm API method string (`method.user.getTopTracks`)
|
|
7
|
+
* @param user - The Last.fm username
|
|
8
|
+
* @param period - Time period (`overall`, `7day`, `1month`, `3month`, `6month`, `12month`)
|
|
9
|
+
* @param limit - Number of results per page
|
|
10
|
+
* @returns The user's top tracks for the given period
|
|
7
11
|
*/
|
|
8
12
|
export declare function getTopTracks(method: string, user: string, period: string, limit: string): Promise<TopTrackResponse>;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { UserTopTagsResponse } from './lastfm.types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Get the top tags used by a user on Last.fm, ordered by tag count.
|
|
4
4
|
*
|
|
5
|
-
* https://www.last.fm/api/show/user.getTopTags
|
|
6
|
-
* @
|
|
5
|
+
* @see https://www.last.fm/api/show/user.getTopTags
|
|
6
|
+
* @param method - The Last.fm API method string (`method.user.getTopTags`)
|
|
7
|
+
* @param user - The Last.fm username
|
|
8
|
+
* @param limit - Maximum number of tags to return
|
|
9
|
+
* @returns The user's most-used tags ordered by count
|
|
7
10
|
*/
|
|
8
11
|
export declare function getUserTopTags(method: string, user: string, limit: string): Promise<UserTopTagsResponse>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { type WeeklyAlbumChartResponse } from './lastfm.types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Get a list of the albums in a user's weekly album chart on Last.fm.
|
|
4
4
|
*
|
|
5
|
-
* https://www.last.fm/api/show/user.getWeeklyAlbumChart
|
|
6
|
-
* @
|
|
5
|
+
* @see https://www.last.fm/api/show/user.getWeeklyAlbumChart
|
|
6
|
+
* @param method - The Last.fm API method string (`method.user.getWeeklyAlbumChart`)
|
|
7
|
+
* @param user - The Last.fm username
|
|
8
|
+
* @param period - The time period for the chart
|
|
9
|
+
* @param limit - Number of results per page
|
|
10
|
+
* @returns The user's weekly album chart
|
|
7
11
|
*/
|
|
8
12
|
export declare function getWeeklyAlbumChart(method: string, user: string, period: string, limit: string): Promise<WeeklyAlbumChartResponse>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { type WeeklyArtistChartResponse } from './lastfm.types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Get a list of the artists in a user's weekly artist chart on Last.fm.
|
|
4
4
|
*
|
|
5
|
-
* https://www.last.fm/api/show/user.getWeeklyArtistChart
|
|
6
|
-
* @
|
|
5
|
+
* @see https://www.last.fm/api/show/user.getWeeklyArtistChart
|
|
6
|
+
* @param method - The Last.fm API method string (`method.user.getWeeklyArtistChart`)
|
|
7
|
+
* @param user - The Last.fm username
|
|
8
|
+
* @param period - The time period for the chart
|
|
9
|
+
* @param limit - Number of results per page
|
|
10
|
+
* @returns The user's weekly artist chart
|
|
7
11
|
*/
|
|
8
12
|
export declare function getWeeklyArtistChart(method: string, user: string, period: string, limit: string): Promise<WeeklyArtistChartResponse>;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { type WeeklyChartListResponse } from './lastfm.types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Get a list of available charts for a user on Last.fm, expressed as date ranges
|
|
4
|
+
* which can be sent to the chart services.
|
|
4
5
|
*
|
|
5
|
-
* https://www.last.fm/api/show/user.getWeeklyChartList
|
|
6
|
-
* @
|
|
6
|
+
* @see https://www.last.fm/api/show/user.getWeeklyChartList
|
|
7
|
+
* @param method - The Last.fm API method string (`method.user.getWeeklyChartList`)
|
|
8
|
+
* @param user - The Last.fm username
|
|
9
|
+
* @param period - The time period for the chart list
|
|
10
|
+
* @param limit - Number of results per page
|
|
11
|
+
* @returns A list of date ranges representing available weekly charts for this user
|
|
7
12
|
*/
|
|
8
13
|
export declare function getWeeklyChartList(method: string, user: string, period: string, limit: string): Promise<WeeklyChartListResponse>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { type WeeklyTrackChartResponse } from './lastfm.types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Get a list of the tracks in a user's weekly track chart on Last.fm.
|
|
4
4
|
*
|
|
5
|
-
* https://www.last.fm/api/show/user.getWeeklyTrackChart
|
|
6
|
-
* @
|
|
5
|
+
* @see https://www.last.fm/api/show/user.getWeeklyTrackChart
|
|
6
|
+
* @param method - The Last.fm API method string (`method.user.getWeeklyTrackChart`)
|
|
7
|
+
* @param user - The Last.fm username
|
|
8
|
+
* @param period - The time period for the chart
|
|
9
|
+
* @param limit - Number of results per page
|
|
10
|
+
* @returns The user's weekly track chart
|
|
7
11
|
*/
|
|
8
12
|
export declare function getWeeklyTrackChart(method: string, user: string, period: string, limit: string): Promise<WeeklyTrackChartResponse>;
|
package/dist/@types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { auth } from './auth.js';
|
|
2
|
+
import { config } from './config.js';
|
|
2
3
|
import { getFriends } from './getFriends.js';
|
|
3
4
|
import { getInfo } from './getInfo.js';
|
|
4
5
|
import { getLovedTracks } from './getLovedTracks.js';
|
|
@@ -11,6 +12,7 @@ import { getWeeklyAlbumChart } from './getWeeklyAlbumChart.js';
|
|
|
11
12
|
import { getWeeklyArtistChart } from './getWeeklyArtistChart.js';
|
|
12
13
|
import { getWeeklyChartList } from './getWeeklyChartList.js';
|
|
13
14
|
import { getWeeklyTrackChart } from './getWeeklyTrackChart.js';
|
|
15
|
+
import { method } from './method.js';
|
|
14
16
|
import { chartTopTags } from './chart/topTags.js';
|
|
15
17
|
import { chartTopTracks } from './chart/topTracks.js';
|
|
16
18
|
import { chartTopArtists } from './chart/topArtists.js';
|
|
@@ -55,7 +57,11 @@ import { trackRemoveTag } from './track/removeTag.js';
|
|
|
55
57
|
import { trackScrobble } from './track/scrobble.js';
|
|
56
58
|
import { trackUpdateNowPlaying } from './track/updateNowPlaying.js';
|
|
57
59
|
import { userGetPersonalTags } from './user/getPersonalTags.js';
|
|
58
|
-
|
|
60
|
+
/**
|
|
61
|
+
* The return type of {@link LastFmApi}, containing all namespaced API methods
|
|
62
|
+
* and the {@link method} constant for method name strings.
|
|
63
|
+
*/
|
|
64
|
+
export type LastFmApiReturn = {
|
|
59
65
|
auth: typeof auth;
|
|
60
66
|
album: {
|
|
61
67
|
albumGetInfo: typeof albumGetInfo;
|
|
@@ -117,17 +123,7 @@ declare const LastFmApi: () => {
|
|
|
117
123
|
user: {
|
|
118
124
|
userGetPersonalTags: typeof userGetPersonalTags;
|
|
119
125
|
};
|
|
120
|
-
config:
|
|
121
|
-
api_key: string;
|
|
122
|
-
app_name: string;
|
|
123
|
-
base_url: string;
|
|
124
|
-
format: {
|
|
125
|
-
json: string;
|
|
126
|
-
xml: string;
|
|
127
|
-
};
|
|
128
|
-
share_secret: string;
|
|
129
|
-
username: string;
|
|
130
|
-
};
|
|
126
|
+
config: typeof config;
|
|
131
127
|
getFriends: typeof getFriends;
|
|
132
128
|
getInfo: typeof getInfo;
|
|
133
129
|
getLovedTracks: typeof getLovedTracks;
|
|
@@ -140,82 +136,28 @@ declare const LastFmApi: () => {
|
|
|
140
136
|
getWeeklyArtistChart: typeof getWeeklyArtistChart;
|
|
141
137
|
getWeeklyChartList: typeof getWeeklyChartList;
|
|
142
138
|
getWeeklyTrackChart: typeof getWeeklyTrackChart;
|
|
143
|
-
method:
|
|
144
|
-
album: {
|
|
145
|
-
addTags: string;
|
|
146
|
-
getInfo: string;
|
|
147
|
-
getTags: string;
|
|
148
|
-
getTopTags: string;
|
|
149
|
-
removeTag: string;
|
|
150
|
-
search: string;
|
|
151
|
-
};
|
|
152
|
-
artist: {
|
|
153
|
-
addTags: string;
|
|
154
|
-
getCorrection: string;
|
|
155
|
-
getInfo: string;
|
|
156
|
-
getSimilar: string;
|
|
157
|
-
getTags: string;
|
|
158
|
-
getTopAlbums: string;
|
|
159
|
-
getTopTags: string;
|
|
160
|
-
getTopTracks: string;
|
|
161
|
-
removeTag: string;
|
|
162
|
-
search: string;
|
|
163
|
-
};
|
|
164
|
-
auth: {
|
|
165
|
-
getMobileSession: string;
|
|
166
|
-
getSession: string;
|
|
167
|
-
getToken: string;
|
|
168
|
-
};
|
|
169
|
-
chart: {
|
|
170
|
-
getTopTracks: string;
|
|
171
|
-
getTopTags: string;
|
|
172
|
-
getTopArtists: string;
|
|
173
|
-
};
|
|
174
|
-
geo: {
|
|
175
|
-
getTopArtists: string;
|
|
176
|
-
getTopTracks: string;
|
|
177
|
-
};
|
|
178
|
-
library: {
|
|
179
|
-
getArtists: string;
|
|
180
|
-
};
|
|
181
|
-
tag: {
|
|
182
|
-
getInfo: string;
|
|
183
|
-
getSimilar: string;
|
|
184
|
-
getTopAlbums: string;
|
|
185
|
-
getTopArtists: string;
|
|
186
|
-
getTopTags: string;
|
|
187
|
-
getTopTracks: string;
|
|
188
|
-
getWeeklyChartList: string;
|
|
189
|
-
};
|
|
190
|
-
track: {
|
|
191
|
-
addTags: string;
|
|
192
|
-
getCorrection: string;
|
|
193
|
-
getInfo: string;
|
|
194
|
-
getSimilar: string;
|
|
195
|
-
getTags: string;
|
|
196
|
-
getTopTags: string;
|
|
197
|
-
love: string;
|
|
198
|
-
removeTag: string;
|
|
199
|
-
scrobble: string;
|
|
200
|
-
search: string;
|
|
201
|
-
unlove: string;
|
|
202
|
-
updateNowPlaying: string;
|
|
203
|
-
};
|
|
204
|
-
user: {
|
|
205
|
-
getFriends: string;
|
|
206
|
-
getInfo: string;
|
|
207
|
-
getLovedTracks: string;
|
|
208
|
-
getPersonalTags: string;
|
|
209
|
-
getRecentTracks: string;
|
|
210
|
-
getTopAlbums: string;
|
|
211
|
-
getTopArtists: string;
|
|
212
|
-
getTopTags: string;
|
|
213
|
-
getTopTracks: string;
|
|
214
|
-
getWeeklyAlbumChart: string;
|
|
215
|
-
getWeeklyArtistChart: string;
|
|
216
|
-
getWeeklyChartList: string;
|
|
217
|
-
getWeeklyTrackChart: string;
|
|
218
|
-
};
|
|
219
|
-
};
|
|
139
|
+
method: typeof method;
|
|
220
140
|
};
|
|
141
|
+
/**
|
|
142
|
+
* Creates a Last.fm API client with all supported methods organised by namespace.
|
|
143
|
+
*
|
|
144
|
+
* Use the {@link method} constant (exposed as `api.method`) to pass the correct
|
|
145
|
+
* method string to each API function.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts
|
|
149
|
+
* import LastFmApi from 'lastfm-nodejs-client';
|
|
150
|
+
*
|
|
151
|
+
* const api = LastFmApi();
|
|
152
|
+
*
|
|
153
|
+
* // Read-only: get a user's top artists
|
|
154
|
+
* const topArtists = await api.getTopArtists(api.method.user.getTopArtists, 'username', '7day', '10');
|
|
155
|
+
*
|
|
156
|
+
* // Write: scrobble a track (requires session key)
|
|
157
|
+
* await api.track.trackScrobble(api.method.track.scrobble, 'Artist', 'Track', String(Date.now() / 1000 | 0), 'Album', sk);
|
|
158
|
+
* ```
|
|
159
|
+
*
|
|
160
|
+
* @returns An object containing all Last.fm API methods organised by namespace.
|
|
161
|
+
*/
|
|
162
|
+
declare const LastFmApi: () => LastFmApiReturn;
|
|
221
163
|
export default LastFmApi;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
import type { LibraryArtistsResponse } from '../lastfm.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* A paginated list of all the artists in a user's library, with playcounts and tag counts.
|
|
4
|
+
*
|
|
5
|
+
* @see https://www.last.fm/api/show/library.getArtists
|
|
6
|
+
* @param method - The Last.fm API method string (`method.library.getArtists`)
|
|
7
|
+
* @param user - The Last.fm username whose library to fetch
|
|
8
|
+
* @param limit - Number of results per page (default `'50'`)
|
|
9
|
+
* @param page - Page number to fetch (default `'1'`)
|
|
10
|
+
* @returns Paginated list of artists from the user's library
|
|
11
|
+
*/
|
|
2
12
|
export declare function libraryGetArtists(method: string, user: string, limit?: string, page?: string): Promise<LibraryArtistsResponse>;
|
package/dist/@types/method.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** Last.fm `album.*` method name strings. */
|
|
1
2
|
interface AlbumMethod {
|
|
2
3
|
addTags: string;
|
|
3
4
|
getInfo: string;
|
|
@@ -6,6 +7,7 @@ interface AlbumMethod {
|
|
|
6
7
|
removeTag: string;
|
|
7
8
|
search: string;
|
|
8
9
|
}
|
|
10
|
+
/** Last.fm `artist.*` method name strings. */
|
|
9
11
|
interface ArtistMethod {
|
|
10
12
|
addTags: string;
|
|
11
13
|
getCorrection: string;
|
|
@@ -18,23 +20,28 @@ interface ArtistMethod {
|
|
|
18
20
|
removeTag: string;
|
|
19
21
|
search: string;
|
|
20
22
|
}
|
|
23
|
+
/** Last.fm `auth.*` method name strings. */
|
|
21
24
|
interface AuthMethod {
|
|
22
25
|
getMobileSession: string;
|
|
23
26
|
getSession: string;
|
|
24
27
|
getToken: string;
|
|
25
28
|
}
|
|
29
|
+
/** Last.fm `chart.*` method name strings. */
|
|
26
30
|
interface ChartMethod {
|
|
27
31
|
getTopArtists: string;
|
|
28
32
|
getTopTags: string;
|
|
29
33
|
getTopTracks: string;
|
|
30
34
|
}
|
|
35
|
+
/** Last.fm `geo.*` method name strings. */
|
|
31
36
|
interface GeoMethod {
|
|
32
37
|
getTopArtists: string;
|
|
33
38
|
getTopTracks: string;
|
|
34
39
|
}
|
|
40
|
+
/** Last.fm `library.*` method name strings. */
|
|
35
41
|
interface LibraryMethod {
|
|
36
42
|
getArtists: string;
|
|
37
43
|
}
|
|
44
|
+
/** Last.fm `tag.*` method name strings. */
|
|
38
45
|
interface TagMethod {
|
|
39
46
|
getInfo: string;
|
|
40
47
|
getSimilar: string;
|
|
@@ -44,6 +51,7 @@ interface TagMethod {
|
|
|
44
51
|
getTopTracks: string;
|
|
45
52
|
getWeeklyChartList: string;
|
|
46
53
|
}
|
|
54
|
+
/** Last.fm `track.*` method name strings. */
|
|
47
55
|
interface TrackMethod {
|
|
48
56
|
addTags: string;
|
|
49
57
|
getCorrection: string;
|
|
@@ -58,6 +66,7 @@ interface TrackMethod {
|
|
|
58
66
|
unlove: string;
|
|
59
67
|
updateNowPlaying: string;
|
|
60
68
|
}
|
|
69
|
+
/** Last.fm `user.*` method name strings. */
|
|
61
70
|
interface UserMethod {
|
|
62
71
|
getFriends: string;
|
|
63
72
|
getInfo: string;
|
|
@@ -73,6 +82,10 @@ interface UserMethod {
|
|
|
73
82
|
getWeeklyChartList: string;
|
|
74
83
|
getWeeklyTrackChart: string;
|
|
75
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Namespace map of all supported Last.fm API method name strings.
|
|
87
|
+
* @see {@link method} for the singleton constant of this type.
|
|
88
|
+
*/
|
|
76
89
|
export interface Method {
|
|
77
90
|
album: AlbumMethod;
|
|
78
91
|
artist: ArtistMethod;
|
|
@@ -84,81 +97,16 @@ export interface Method {
|
|
|
84
97
|
track: TrackMethod;
|
|
85
98
|
user: UserMethod;
|
|
86
99
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
getInfo: string;
|
|
100
|
-
getSimilar: string;
|
|
101
|
-
getTags: string;
|
|
102
|
-
getTopAlbums: string;
|
|
103
|
-
getTopTags: string;
|
|
104
|
-
getTopTracks: string;
|
|
105
|
-
removeTag: string;
|
|
106
|
-
search: string;
|
|
107
|
-
};
|
|
108
|
-
auth: {
|
|
109
|
-
getMobileSession: string;
|
|
110
|
-
getSession: string;
|
|
111
|
-
getToken: string;
|
|
112
|
-
};
|
|
113
|
-
chart: {
|
|
114
|
-
getTopTracks: string;
|
|
115
|
-
getTopTags: string;
|
|
116
|
-
getTopArtists: string;
|
|
117
|
-
};
|
|
118
|
-
geo: {
|
|
119
|
-
getTopArtists: string;
|
|
120
|
-
getTopTracks: string;
|
|
121
|
-
};
|
|
122
|
-
library: {
|
|
123
|
-
getArtists: string;
|
|
124
|
-
};
|
|
125
|
-
tag: {
|
|
126
|
-
getInfo: string;
|
|
127
|
-
getSimilar: string;
|
|
128
|
-
getTopAlbums: string;
|
|
129
|
-
getTopArtists: string;
|
|
130
|
-
getTopTags: string;
|
|
131
|
-
getTopTracks: string;
|
|
132
|
-
getWeeklyChartList: string;
|
|
133
|
-
};
|
|
134
|
-
track: {
|
|
135
|
-
addTags: string;
|
|
136
|
-
getCorrection: string;
|
|
137
|
-
getInfo: string;
|
|
138
|
-
getSimilar: string;
|
|
139
|
-
getTags: string;
|
|
140
|
-
getTopTags: string;
|
|
141
|
-
love: string;
|
|
142
|
-
removeTag: string;
|
|
143
|
-
scrobble: string;
|
|
144
|
-
search: string;
|
|
145
|
-
unlove: string;
|
|
146
|
-
updateNowPlaying: string;
|
|
147
|
-
};
|
|
148
|
-
user: {
|
|
149
|
-
getFriends: string;
|
|
150
|
-
getInfo: string;
|
|
151
|
-
getLovedTracks: string;
|
|
152
|
-
getPersonalTags: string;
|
|
153
|
-
getRecentTracks: string;
|
|
154
|
-
getTopAlbums: string;
|
|
155
|
-
getTopArtists: string;
|
|
156
|
-
getTopTags: string;
|
|
157
|
-
getTopTracks: string;
|
|
158
|
-
getWeeklyAlbumChart: string;
|
|
159
|
-
getWeeklyArtistChart: string;
|
|
160
|
-
getWeeklyChartList: string;
|
|
161
|
-
getWeeklyTrackChart: string;
|
|
162
|
-
};
|
|
163
|
-
};
|
|
100
|
+
/**
|
|
101
|
+
* Constant map of all Last.fm API method name strings, organised by namespace.
|
|
102
|
+
*
|
|
103
|
+
* Pass the appropriate value to API functions as the `method` parameter.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* const api = LastFmApi();
|
|
108
|
+
* const info = await api.getInfo(api.method.user.getInfo, 'username');
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export declare const method: Method;
|
|
164
112
|
export {};
|
package/dist/@types/request.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options passed to `request` and `signedRequest`.
|
|
3
|
+
* All fields correspond to Last.fm API query/body parameters.
|
|
4
|
+
*/
|
|
1
5
|
interface RequestOptions {
|
|
2
6
|
method: string;
|
|
3
7
|
user?: string;
|
|
@@ -20,6 +24,25 @@ interface RequestOptions {
|
|
|
20
24
|
username?: string;
|
|
21
25
|
password?: string;
|
|
22
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Performs a GET request to the Last.fm API.
|
|
29
|
+
*
|
|
30
|
+
* Throws an `Error` on HTTP failure or if the Last.fm response body contains an error code.
|
|
31
|
+
*
|
|
32
|
+
* @param options - Request options specifying the method and query parameters
|
|
33
|
+
* @returns The parsed JSON response typed as `Response`
|
|
34
|
+
*/
|
|
23
35
|
declare const request: <Response>(options: RequestOptions) => Promise<Response>;
|
|
36
|
+
/**
|
|
37
|
+
* Performs an MD5-signed POST request to the Last.fm API.
|
|
38
|
+
*
|
|
39
|
+
* Used for write operations (scrobble, love, addTags, auth sessions).
|
|
40
|
+
* Generates an `api_sig` by sorting all parameters alphabetically, concatenating
|
|
41
|
+
* `key+value` pairs, appending the shared secret, and MD5-hashing the result.
|
|
42
|
+
*
|
|
43
|
+
* @param options - Request options specifying the method and POST body parameters
|
|
44
|
+
* @param secret - The Last.fm shared secret used to generate the API signature
|
|
45
|
+
* @returns The parsed JSON response typed as `Response`
|
|
46
|
+
*/
|
|
24
47
|
export declare const signedRequest: <Response>(options: RequestOptions, secret: string) => Promise<Response>;
|
|
25
48
|
export default request;
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
import type { TagInfoResponse } from '../lastfm.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get the metadata for a tag on Last.fm. Includes a short wiki summary.
|
|
4
|
+
*
|
|
5
|
+
* @see https://www.last.fm/api/show/tag.getInfo
|
|
6
|
+
* @param method - The Last.fm API method string (`method.tag.getInfo`)
|
|
7
|
+
* @param tag - The tag name
|
|
8
|
+
* @param lang - ISO 639 alpha-2 language code for the wiki text (default `'en'`)
|
|
9
|
+
* @returns Tag metadata including wiki text and reach
|
|
10
|
+
*/
|
|
2
11
|
export declare function tagGetInfo(method: string, tag: string, lang?: string): Promise<TagInfoResponse>;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import type { TagSimilarResponse } from '../lastfm.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Search for tags similar to this one on Last.fm. Returns tags ranked by similarity.
|
|
4
|
+
*
|
|
5
|
+
* @see https://www.last.fm/api/show/tag.getSimilar
|
|
6
|
+
* @param method - The Last.fm API method string (`method.tag.getSimilar`)
|
|
7
|
+
* @param tag - The tag name to find similar tags for
|
|
8
|
+
* @returns A list of similar tags
|
|
9
|
+
*/
|
|
2
10
|
export declare function tagGetSimilar(method: string, tag: string): Promise<TagSimilarResponse>;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
import type { TagTopAlbumsResponse } from '../lastfm.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get the top albums tagged with a given tag on Last.fm, ordered by tag count.
|
|
4
|
+
*
|
|
5
|
+
* @see https://www.last.fm/api/show/tag.getTopAlbums
|
|
6
|
+
* @param method - The Last.fm API method string (`method.tag.getTopAlbums`)
|
|
7
|
+
* @param tag - The tag name
|
|
8
|
+
* @param limit - Number of results per page (default `'50'`)
|
|
9
|
+
* @param page - Page number to fetch (default `'1'`)
|
|
10
|
+
* @returns Paginated list of top albums for the given tag
|
|
11
|
+
*/
|
|
2
12
|
export declare function tagGetTopAlbums(method: string, tag: string, limit?: string, page?: string): Promise<TagTopAlbumsResponse>;
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
import type { TagTopArtistsResponse } from '../lastfm.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get the top artists tagged with a given tag on Last.fm, ordered by tag count.
|
|
4
|
+
*
|
|
5
|
+
* @see https://www.last.fm/api/show/tag.getTopArtists
|
|
6
|
+
* @param method - The Last.fm API method string (`method.tag.getTopArtists`)
|
|
7
|
+
* @param tag - The tag name
|
|
8
|
+
* @param limit - Number of results per page (default `'50'`)
|
|
9
|
+
* @param page - Page number to fetch (default `'1'`)
|
|
10
|
+
* @returns Paginated list of top artists for the given tag
|
|
11
|
+
*/
|
|
2
12
|
export declare function tagGetTopArtists(method: string, tag: string, limit?: string, page?: string): Promise<TagTopArtistsResponse>;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import type { TagTopTagsResponse } from '../lastfm.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Fetches the top global tags on Last.fm, sorted by popularity (number of times used).
|
|
4
|
+
*
|
|
5
|
+
* @see https://www.last.fm/api/show/tag.getTopTags
|
|
6
|
+
* @param method - The Last.fm API method string (`method.tag.getTopTags`)
|
|
7
|
+
* @returns The top tags on Last.fm ordered by usage count
|
|
8
|
+
*/
|
|
2
9
|
export declare function tagGetTopTags(method: string): Promise<TagTopTagsResponse>;
|