lastfm-nodejs-client 1.1.2 → 1.1.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.3
4
+
5
+ - Fix incorrect type import
6
+
3
7
  ## 1.1.2
4
8
 
5
9
  - Fix broken type, Track image type is an array of Images.
package/README.md CHANGED
@@ -14,13 +14,13 @@ Consider [PNPM](https://pnpm.io/) ▶️
14
14
 
15
15
  ### Import it
16
16
 
17
- Import module
17
+ Import the client module:
18
18
 
19
19
  ```js
20
20
  import { lastFm } from 'lastfm-nodejs-client';
21
21
  ```
22
22
 
23
- Import as types
23
+ Import the Types as type:
24
24
 
25
25
  ```js
26
26
  import type { Artist, Track, User, WeeklyAlbum } from 'lastfm-nodejs-client/@types';
@@ -34,20 +34,20 @@ _Working on getting these into [DefinitelyTyped](https://github.com/DefinitelyTy
34
34
  const lastFm = LastFmApi();
35
35
  const { config, method } = lastFm;
36
36
 
37
- const getUser = async () => {
38
- const data = await lastFm.getInfo(method.user.getInfo, config.username, 'overall', 12);
39
- const { user } = data;
40
- return user;
41
- };
37
+ const getTopArtists = async () => {
38
+ const data = await lastFm.getTopArtists(method.user.top_artists, config.username, 'overall', 200);
39
+
40
+ const { topartists } = data;
42
41
 
43
- const user = getUser();
42
+ topartists.artist.map((artist) => artist.mbid);
44
43
 
45
- console.log(user.name);
44
+ return topartists;
45
+ };
46
46
  ```
47
47
 
48
- 🚀 Gives you
48
+ 🚀 Gives you:
49
49
 
50
- ![user](https://res.cloudinary.com/mannuel/image/upload/v1667372693/images/typescript.png)
50
+ ![user](https://res.cloudinary.com/mannuel/image/upload/v1668059500/topartist.png)
51
51
 
52
52
  ## Developing client
53
53
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AuthResponse, LovedTracksResponse, RecentTracksResponse, TopAlbumsResponse, TopArtistsResponse, TopTrackResponse, UserResponse, WeeklyAlbumChartResponse, WeeklyArtistChartResponse, WeeklyChartListResponse, WeeklyTrackChartResponse } from './types';
1
+ import { AuthResponse, LovedTracksResponse, RecentTracksResponse, TopAlbumsResponse, TopArtistsResponse, TopTrackResponse, UserResponse, WeeklyAlbumChartResponse, WeeklyArtistChartResponse, WeeklyChartListResponse, WeeklyTrackChartResponse } from '../@types';
2
2
  declare function LastFmApi(): {
3
3
  auth: (method: string, user: string, period: string, limit: number) => Promise<AuthResponse>;
4
4
  config: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lastfm-nodejs-client",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "A NodeJS wrapper client for LastFm API. Fetching public data by username using the LastFm public API",
5
5
  "main": "./dist",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  WeeklyArtistChartResponse,
14
14
  WeeklyChartListResponse,
15
15
  WeeklyTrackChartResponse,
16
- } from './types';
16
+ } from '../@types';
17
17
 
18
18
  function LastFmApi() {
19
19
  /**