lastfm-nodejs-client 1.1.3 → 1.1.4

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.4
4
+
5
+ - Fix incorrect type on request method
6
+
3
7
  ## 1.1.3
4
8
 
5
9
  - Fix incorrect type import
package/README.md CHANGED
@@ -35,12 +35,13 @@ const lastFm = LastFmApi();
35
35
  const { config, method } = lastFm;
36
36
 
37
37
  const getTopArtists = async () => {
38
- const data = await lastFm.getTopArtists(method.user.top_artists, config.username, 'overall', 200);
39
-
38
+ const data = await lastFm.getTopArtists(
39
+ method.user.top_artists,
40
+ config.username,
41
+ 'overall',
42
+ '200',
43
+ );
40
44
  const { topartists } = data;
41
-
42
- topartists.artist.map((artist) => artist.mbid);
43
-
44
45
  return topartists;
45
46
  };
46
47
  ```
package/dist/request.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const request: <Parameters_1, Response_1>(method: string, user: string, period?: string, limit?: number) => Promise<Response_1>;
1
+ declare const request: <Parameters_1, Response_1>(method: string, user: string, period?: string, limit?: string) => Promise<Response_1>;
2
2
  export default request;
package/package.json CHANGED
@@ -1,13 +1,8 @@
1
1
  {
2
2
  "name": "lastfm-nodejs-client",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
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
- "scripts": {
7
- "build": "rimraf dist && tsc",
8
- "dev": "tsc --watch",
9
- "test": "echo \"Error: no test specified\" && exit 1"
10
- },
11
6
  "keywords": [
12
7
  "client",
13
8
  "lastFm",
@@ -35,5 +30,10 @@
35
30
  "bugs": {
36
31
  "url": "https://github.com/mannuelf/lastfm-nodejs-client/issues"
37
32
  },
38
- "homepage": "https://github.com/mannuelf/lastfm-nodejs-client#readme"
39
- }
33
+ "homepage": "https://github.com/mannuelf/lastfm-nodejs-client#readme",
34
+ "scripts": {
35
+ "build": "rimraf dist && tsc",
36
+ "dev": "tsc --watch",
37
+ "test": "echo \"Error: no test specified\" && exit 1"
38
+ }
39
+ }
package/src/index.ts CHANGED
@@ -30,7 +30,7 @@ function LastFmApi() {
30
30
  method: string,
31
31
  user: string,
32
32
  period: string,
33
- limit: number,
33
+ limit: string,
34
34
  ): Promise<AuthResponse> => {
35
35
  return request(method, user, period, limit);
36
36
  };
@@ -45,7 +45,7 @@ function LastFmApi() {
45
45
  method: string,
46
46
  user: string,
47
47
  period: string,
48
- limit: number,
48
+ limit: string,
49
49
  ): Promise<UserResponse> => {
50
50
  return request(method, user, period, limit);
51
51
  };
@@ -60,7 +60,7 @@ function LastFmApi() {
60
60
  method: string,
61
61
  user: string,
62
62
  period: string,
63
- limit: number,
63
+ limit: string,
64
64
  ): Promise<LovedTracksResponse> => {
65
65
  return request(method, user, period, limit);
66
66
  };
@@ -75,7 +75,7 @@ function LastFmApi() {
75
75
  method: string,
76
76
  user: string,
77
77
  period: string,
78
- limit: number,
78
+ limit: string,
79
79
  ): Promise<RecentTracksResponse> => {
80
80
  return request(method, user, period, limit);
81
81
  };
@@ -90,7 +90,7 @@ function LastFmApi() {
90
90
  method: string,
91
91
  user: string,
92
92
  period: string,
93
- limit: number,
93
+ limit: string,
94
94
  ): Promise<TopAlbumsResponse> => {
95
95
  return request(method, user, period, limit);
96
96
  };
@@ -105,7 +105,7 @@ function LastFmApi() {
105
105
  method: string,
106
106
  user: string,
107
107
  period: string,
108
- limit: number,
108
+ limit: string,
109
109
  ): Promise<TopArtistsResponse> => {
110
110
  return request(method, user, period, limit);
111
111
  };
@@ -120,7 +120,7 @@ function LastFmApi() {
120
120
  method: string,
121
121
  user: string,
122
122
  period: string,
123
- limit: number,
123
+ limit: string,
124
124
  ): Promise<TopTrackResponse> => {
125
125
  return request(method, user, period, limit);
126
126
  };
@@ -135,7 +135,7 @@ function LastFmApi() {
135
135
  method: string,
136
136
  user: string,
137
137
  period: string,
138
- limit: number,
138
+ limit: string,
139
139
  ): Promise<WeeklyAlbumChartResponse> => {
140
140
  return request(method, user, period, limit);
141
141
  };
@@ -150,7 +150,7 @@ function LastFmApi() {
150
150
  method: string,
151
151
  user: string,
152
152
  period: string,
153
- limit: number,
153
+ limit: string,
154
154
  ): Promise<WeeklyArtistChartResponse> => {
155
155
  return request(method, user, period, limit);
156
156
  };
@@ -165,7 +165,7 @@ function LastFmApi() {
165
165
  method: string,
166
166
  user: string,
167
167
  period: string,
168
- limit: number,
168
+ limit: string,
169
169
  ): Promise<WeeklyChartListResponse> => {
170
170
  return request(method, user, period, limit);
171
171
  };
@@ -180,7 +180,7 @@ function LastFmApi() {
180
180
  method: string,
181
181
  user: string,
182
182
  period: string,
183
- limit: number,
183
+ limit: string,
184
184
  ): Promise<WeeklyTrackChartResponse> => {
185
185
  return request(method, user, period, limit);
186
186
  };
package/src/request.ts CHANGED
@@ -4,7 +4,7 @@ const request = async <Parameters, Response>(
4
4
  method: string,
5
5
  user: string,
6
6
  period?: string,
7
- limit?: number,
7
+ limit?: string,
8
8
  ): Promise<Response> => {
9
9
  const url = `
10
10
  ${config.base_url}?method=${method}${user ? '&user=' : ''}${user}${