lastfm-nodejs-client 1.0.4 → 1.0.5
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 +10 -0
- package/README.md +20 -7
- package/package.json +1 -1
- package/src/types.d.ts +390 -285
- package/dist/types.d.ts +0 -297
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -23,9 +23,16 @@ import { lastFm } from 'lastfm-nodejs-client';
|
|
|
23
23
|
Import types
|
|
24
24
|
|
|
25
25
|
```js
|
|
26
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
Artist,
|
|
28
|
+
Track,
|
|
29
|
+
User,
|
|
30
|
+
WeeklyAlbum,
|
|
31
|
+
} from 'lastfm-nodejs-client/dist/types';
|
|
27
32
|
```
|
|
28
33
|
|
|
34
|
+
_Working on getting these into [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped)_
|
|
35
|
+
|
|
29
36
|
### Use it
|
|
30
37
|
|
|
31
38
|
```js
|
|
@@ -43,26 +50,32 @@ const getUser = async () => {
|
|
|
43
50
|
return user;
|
|
44
51
|
};
|
|
45
52
|
|
|
46
|
-
const user
|
|
53
|
+
const user = getUser();
|
|
47
54
|
|
|
48
55
|
console.log(user.name);
|
|
49
56
|
```
|
|
50
57
|
|
|
58
|
+
🚀 Gives you
|
|
59
|
+
|
|
60
|
+

|
|
61
|
+
|
|
51
62
|
## Developing client
|
|
52
63
|
|
|
53
64
|
Written in TypeScript, compiles down to ES2015, provides the types for the lastFm entities.
|
|
54
65
|
|
|
66
|
+
## Fork repo
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
gh repo fork git@github.com:mannuelf/lastfm-nodejs-client.git
|
|
70
|
+
```
|
|
71
|
+
|
|
55
72
|
### Postman collections
|
|
56
73
|
|
|
57
74
|
A list of endpoints currently mapped to this client. Still under development, not feature complete.
|
|
58
75
|
|
|
59
76
|
[View collections](https://documenter.getpostman.com/view/4217/2s8YKJELqJ) ▶️
|
|
60
77
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
git clone git@github.com:mannuelf/lastfm-nodejs-client.git
|
|
65
|
-
```
|
|
78
|
+
### ENV
|
|
66
79
|
|
|
67
80
|
Create `.env` file in project root:
|
|
68
81
|
|
package/package.json
CHANGED
package/src/types.d.ts
CHANGED
|
@@ -1,297 +1,402 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface TopTrackResponse {
|
|
19
|
-
toptracks: TopTracks;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface TopTracks {
|
|
23
|
-
track: Track[];
|
|
24
|
-
'@attr': Attr2;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface UserResponse {
|
|
28
|
-
user: User;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface RecentTracksResponse {
|
|
32
|
-
recenttracks: RecentTracks;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface RecentTracks {
|
|
36
|
-
track: Track[];
|
|
37
|
-
'@attr': Attr2;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface LoveTracksResponse {
|
|
41
|
-
lovedtracks: LovedTracks;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface LovedTracks {
|
|
45
|
-
track: Track[];
|
|
46
|
-
'@attr': Attr;
|
|
47
|
-
}
|
|
48
|
-
export interface FriendsResponse {
|
|
49
|
-
friends: Friends;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface Friends {
|
|
53
|
-
'@attr': Attr;
|
|
54
|
-
user: User[];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface TopArtistsResponse {
|
|
58
|
-
topartists: TopArtists;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface TopArtists {
|
|
62
|
-
artist: Artist[];
|
|
63
|
-
'@attr': Attr2;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface WeeklyArtistChartResponse {
|
|
67
|
-
weeklyartistchart: WeeklyArtistChart;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface WeeklyArtistChart {
|
|
71
|
-
artist: Artist[];
|
|
72
|
-
'@attr': Attr2;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface WeeklyAlbumChartResponse {
|
|
76
|
-
weeklyalbumchart: WeeklyAlbumChart;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface WeeklyAlbumChart {
|
|
80
|
-
album: WeeklyAlbum[];
|
|
81
|
-
'@attr': WeeklyalbumChartAttr;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export type WeeklyAlbum = {
|
|
85
|
-
artist: {
|
|
86
|
-
mbid: string;
|
|
87
|
-
'#text': string;
|
|
88
|
-
};
|
|
89
|
-
mbid: string;
|
|
90
|
-
url: string;
|
|
91
|
-
name: string;
|
|
92
|
-
'@attr': { rank: string };
|
|
93
|
-
playcount: string;
|
|
94
|
-
image?: string;
|
|
95
|
-
};
|
|
1
|
+
export interface AuthResponse {
|
|
2
|
+
token: string;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export interface LovedTracksResponse {
|
|
6
|
+
lovedtracks: LovedTracks;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface LovedTracks {
|
|
10
|
+
track: Track[];
|
|
11
|
+
'@attr': Attr;
|
|
12
|
+
}
|
|
13
|
+
export interface TopAlbumsResponse {
|
|
14
|
+
topalbums: TopAlbums;
|
|
15
|
+
}
|
|
96
16
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
user: string;
|
|
101
|
-
}
|
|
17
|
+
export interface TopTrackResponse {
|
|
18
|
+
toptracks: TopTracks;
|
|
19
|
+
}
|
|
102
20
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
21
|
+
export interface TopTracks {
|
|
22
|
+
track: Track[];
|
|
23
|
+
'@attr': Attr2;
|
|
24
|
+
}
|
|
106
25
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
26
|
+
export interface UserResponse {
|
|
27
|
+
user: User;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface RecentTracksResponse {
|
|
31
|
+
recenttracks: RecentTracks;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface RecentTracks {
|
|
35
|
+
track: Track[];
|
|
36
|
+
'@attr': Attr2;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface LoveTracksResponse {
|
|
40
|
+
lovedtracks: LovedTracks;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface LovedTracks {
|
|
44
|
+
track: Track[];
|
|
45
|
+
'@attr': Attr;
|
|
46
|
+
}
|
|
47
|
+
export interface FriendsResponse {
|
|
48
|
+
friends: Friends;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface Friends {
|
|
52
|
+
'@attr': Attr;
|
|
53
|
+
user: User[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface TopArtistsResponse {
|
|
57
|
+
topartists: TopArtists;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface TopArtists {
|
|
61
|
+
artist: Artist[];
|
|
62
|
+
'@attr': Attr2;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface WeeklyArtistChartResponse {
|
|
66
|
+
weeklyartistchart: WeeklyArtistChart;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface WeeklyArtistChart {
|
|
70
|
+
artist: Artist[];
|
|
71
|
+
'@attr': Attr2;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface WeeklyAlbumChartResponse {
|
|
75
|
+
weeklyalbumchart: WeeklyAlbumChart;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface WeeklyAlbumChart {
|
|
79
|
+
album: WeeklyAlbum[];
|
|
80
|
+
'@attr': WeeklyalbumChartAttr;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export type WeeklyAlbum = {
|
|
84
|
+
artist: {
|
|
113
85
|
mbid: string;
|
|
114
|
-
name: string;
|
|
115
|
-
playcount: number;
|
|
116
|
-
streamable: number;
|
|
117
|
-
url: string;
|
|
118
86
|
'#text': string;
|
|
119
87
|
};
|
|
88
|
+
mbid: string;
|
|
89
|
+
url: string;
|
|
90
|
+
name: string;
|
|
91
|
+
'@attr': { rank: string };
|
|
92
|
+
playcount: string;
|
|
93
|
+
image?: string;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export interface WeeklyalbumChartAttr {
|
|
97
|
+
from: string;
|
|
98
|
+
to: string;
|
|
99
|
+
user: string;
|
|
100
|
+
}
|
|
120
101
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
user: string;
|
|
125
|
-
total: number;
|
|
126
|
-
totalPages: number;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export interface ArtistImage {
|
|
130
|
-
name: string;
|
|
131
|
-
photo: string;
|
|
132
|
-
attribution: string;
|
|
133
|
-
playcount: number;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export interface Album {
|
|
137
|
-
mbid: string;
|
|
138
|
-
'#text': string;
|
|
139
|
-
}
|
|
102
|
+
export interface AlbumAttr {
|
|
103
|
+
rank: string;
|
|
104
|
+
}
|
|
140
105
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
106
|
+
export type Artist = {
|
|
107
|
+
'@attr': {
|
|
108
|
+
rank: number;
|
|
109
|
+
};
|
|
110
|
+
cover: ArtistImage;
|
|
111
|
+
image?: string;
|
|
112
|
+
mbid: string;
|
|
113
|
+
name: string;
|
|
114
|
+
playcount: number;
|
|
115
|
+
streamable: number;
|
|
116
|
+
url: string;
|
|
117
|
+
'#text': string;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export interface Attribs {
|
|
121
|
+
page: number;
|
|
122
|
+
perPage: number;
|
|
123
|
+
user: string;
|
|
124
|
+
total: number;
|
|
125
|
+
totalPages: number;
|
|
126
|
+
}
|
|
144
127
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
128
|
+
export interface ArtistImage {
|
|
129
|
+
name: string;
|
|
130
|
+
photo: string;
|
|
131
|
+
attribution: string;
|
|
132
|
+
playcount: number;
|
|
133
|
+
}
|
|
149
134
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
mbid: string;
|
|
155
|
-
album: Album;
|
|
156
|
-
name: string;
|
|
157
|
-
'@attr': Attr;
|
|
158
|
-
url: string;
|
|
159
|
-
date: Date;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export interface Attr2 {
|
|
163
|
-
user: string;
|
|
164
|
-
totalPages: string;
|
|
165
|
-
page: string;
|
|
166
|
-
perPage: string;
|
|
167
|
-
total: string;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export interface RecentTracks {
|
|
171
|
-
track: Track[];
|
|
172
|
-
'@attr': Attr2;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export interface Image {
|
|
176
|
-
size: string;
|
|
177
|
-
'#text': string;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export interface Registered {
|
|
181
|
-
unixtime: string;
|
|
182
|
-
'#text': number;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
export interface User {
|
|
186
|
-
name: string;
|
|
187
|
-
age: string;
|
|
188
|
-
subscriber: string;
|
|
189
|
-
realname: string;
|
|
190
|
-
bootstrap: string;
|
|
191
|
-
playcount: string;
|
|
192
|
-
artist_count: string;
|
|
193
|
-
playlists: string;
|
|
194
|
-
track_count: string;
|
|
195
|
-
album_count: string;
|
|
196
|
-
image: Image[];
|
|
197
|
-
registered: Registered;
|
|
198
|
-
country: string;
|
|
199
|
-
gender: string;
|
|
200
|
-
url: string;
|
|
201
|
-
type: string;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export interface TopAlbums {
|
|
205
|
-
album: Album[];
|
|
206
|
-
'@attr': Attr2;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
export interface WeeklyArtistChartResponse {
|
|
210
|
-
weeklyartistchart: WeeklyArtistChart;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export interface WeeklyArtistChart {
|
|
214
|
-
artist: Artist[];
|
|
215
|
-
'@attr': Attr2;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export interface Attr1 {
|
|
219
|
-
rank: string;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
export interface Attr2 {
|
|
223
|
-
from: string;
|
|
224
|
-
user: string;
|
|
225
|
-
to: string;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
export interface WeeklyChartListResponse {
|
|
229
|
-
weeklychartlist: WeeklyChartList;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export interface WeeklyChartList {
|
|
233
|
-
chart: WeeklyChartListChart[];
|
|
234
|
-
'@attr': WeeklyChartListAttr;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
export interface WeeklyChartListChart {
|
|
238
|
-
'#text': string;
|
|
239
|
-
from: string;
|
|
240
|
-
to: string;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export interface WeeklyChartListAttr {
|
|
244
|
-
user: string;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export interface WeeklyTrackChartResponse {
|
|
248
|
-
weeklytrackchart: WeeklyTrackChart;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
export interface WeeklyTrackChart {
|
|
252
|
-
track: Track[];
|
|
253
|
-
'@attr': WeeklyTrackChartAttr2;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
export interface WeeklyTrackChartTrack {
|
|
257
|
-
artist: WeeklyTrackChartArtist;
|
|
258
|
-
image: Image[];
|
|
259
|
-
mbid: string;
|
|
260
|
-
url: string;
|
|
261
|
-
name: string;
|
|
262
|
-
'@attr': Attr;
|
|
263
|
-
playcount: string;
|
|
264
|
-
}
|
|
135
|
+
export interface Album {
|
|
136
|
+
mbid: string;
|
|
137
|
+
'#text': string;
|
|
138
|
+
}
|
|
265
139
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
140
|
+
export interface Attr {
|
|
141
|
+
nowplaying: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface Date {
|
|
145
|
+
uts: string;
|
|
146
|
+
'#text': string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface Track {
|
|
150
|
+
artist: Artist;
|
|
151
|
+
streamable: string;
|
|
152
|
+
image: '';
|
|
153
|
+
mbid: string;
|
|
154
|
+
album: Album;
|
|
155
|
+
name: string;
|
|
156
|
+
'@attr': Attr;
|
|
157
|
+
url: string;
|
|
158
|
+
date: Date;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface Attr2 {
|
|
162
|
+
user: string;
|
|
163
|
+
totalPages: string;
|
|
164
|
+
page: string;
|
|
165
|
+
perPage: string;
|
|
166
|
+
total: string;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface RecentTracks {
|
|
170
|
+
track: Track[];
|
|
171
|
+
'@attr': Attr2;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface Image {
|
|
175
|
+
size: string;
|
|
176
|
+
'#text': string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface Registered {
|
|
180
|
+
unixtime: string;
|
|
181
|
+
'#text': number;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface User {
|
|
185
|
+
name: string;
|
|
186
|
+
age: string;
|
|
187
|
+
subscriber: string;
|
|
188
|
+
realname: string;
|
|
189
|
+
bootstrap: string;
|
|
190
|
+
playcount: string;
|
|
191
|
+
artist_count: string;
|
|
192
|
+
playlists: string;
|
|
193
|
+
track_count: string;
|
|
194
|
+
album_count: string;
|
|
195
|
+
image: Image[];
|
|
196
|
+
registered: Registered;
|
|
197
|
+
country: string;
|
|
198
|
+
gender: string;
|
|
199
|
+
url: string;
|
|
200
|
+
type: string;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export interface TopAlbums {
|
|
204
|
+
album: Album[];
|
|
205
|
+
'@attr': Attr2;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export interface WeeklyArtistChartResponse {
|
|
209
|
+
weeklyartistchart: WeeklyArtistChart;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface WeeklyArtistChart {
|
|
213
|
+
artist: Artist[];
|
|
214
|
+
'@attr': Attr2;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export interface Attr1 {
|
|
218
|
+
rank: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface Attr2 {
|
|
222
|
+
from: string;
|
|
223
|
+
user: string;
|
|
224
|
+
to: string;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface WeeklyChartListResponse {
|
|
228
|
+
weeklychartlist: WeeklyChartList;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export interface WeeklyChartList {
|
|
232
|
+
chart: WeeklyChartListChart[];
|
|
233
|
+
'@attr': WeeklyChartListAttr;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface WeeklyChartListChart {
|
|
237
|
+
'#text': string;
|
|
238
|
+
from: string;
|
|
239
|
+
to: string;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface WeeklyChartListAttr {
|
|
243
|
+
user: string;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export interface WeeklyTrackChartResponse {
|
|
247
|
+
weeklytrackchart: WeeklyTrackChart;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface WeeklyTrackChart {
|
|
251
|
+
track: Track[];
|
|
252
|
+
'@attr': WeeklyTrackChartAttr2;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export interface WeeklyTrackChartTrack {
|
|
256
|
+
artist: WeeklyTrackChartArtist;
|
|
257
|
+
image: Image[];
|
|
258
|
+
mbid: string;
|
|
259
|
+
url: string;
|
|
260
|
+
name: string;
|
|
261
|
+
'@attr': Attr;
|
|
262
|
+
playcount: string;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export interface WeeklyTrackChartArtist {
|
|
266
|
+
mbid: string;
|
|
267
|
+
'#text': string;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export interface WeeklyTrackChartAttr {
|
|
271
|
+
rank: string;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface WeeklyTrackChartAttr2 {
|
|
275
|
+
from: string;
|
|
276
|
+
user: string;
|
|
277
|
+
to: string;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export const LastFmApi: () => {
|
|
281
|
+
auth: (
|
|
282
|
+
method: string,
|
|
283
|
+
user: string,
|
|
284
|
+
period: string,
|
|
285
|
+
limit: number
|
|
286
|
+
) => Promise<AuthResponse>;
|
|
287
|
+
config: {
|
|
288
|
+
api_key: string;
|
|
289
|
+
app_name: string;
|
|
290
|
+
base_url: string;
|
|
291
|
+
format: {
|
|
292
|
+
json: string;
|
|
293
|
+
xml: string;
|
|
294
|
+
};
|
|
295
|
+
share_secret: string;
|
|
296
|
+
username: string;
|
|
297
|
+
};
|
|
298
|
+
getInfo: (
|
|
299
|
+
method: string,
|
|
300
|
+
user: string,
|
|
301
|
+
period: string,
|
|
302
|
+
limit: number
|
|
303
|
+
) => Promise<UserResponse>;
|
|
304
|
+
getLovedTracks: (
|
|
305
|
+
method: string,
|
|
306
|
+
user: string,
|
|
307
|
+
period: string,
|
|
308
|
+
limit: number
|
|
309
|
+
) => Promise<LovedTracksResponse>;
|
|
310
|
+
getRecentTracks: (
|
|
311
|
+
method: string,
|
|
312
|
+
user: string,
|
|
313
|
+
period: string,
|
|
314
|
+
limit: number
|
|
315
|
+
) => Promise<RecentTracksResponse>;
|
|
316
|
+
getTopAlbums: (
|
|
317
|
+
method: string,
|
|
318
|
+
user: string,
|
|
319
|
+
period: string,
|
|
320
|
+
limit: number
|
|
321
|
+
) => Promise<TopAlbumsResponse>;
|
|
322
|
+
getTopArtists: (
|
|
323
|
+
method: string,
|
|
324
|
+
user: string,
|
|
325
|
+
period: string,
|
|
326
|
+
limit: number
|
|
327
|
+
) => Promise<TopArtistsResponse>;
|
|
328
|
+
getTopTracks: (
|
|
329
|
+
method: string,
|
|
330
|
+
user: string,
|
|
331
|
+
period: string,
|
|
332
|
+
limit: number
|
|
333
|
+
) => Promise<TopTrackResponse>;
|
|
334
|
+
getWeeklyAlbumChart: (
|
|
335
|
+
method: string,
|
|
336
|
+
user: string,
|
|
337
|
+
period: string,
|
|
338
|
+
limit: number
|
|
339
|
+
) => Promise<WeeklyAlbumChartResponse>;
|
|
340
|
+
getWeeklyArtistChart: (
|
|
341
|
+
method: string,
|
|
342
|
+
user: string,
|
|
343
|
+
period: string,
|
|
344
|
+
limit: number
|
|
345
|
+
) => Promise<WeeklyArtistChartResponse>;
|
|
346
|
+
getWeeklyChartList: (
|
|
347
|
+
method: string,
|
|
348
|
+
user: string,
|
|
349
|
+
period: string,
|
|
350
|
+
limit: number
|
|
351
|
+
) => Promise<WeeklyChartListResponse>;
|
|
352
|
+
getWeeklyTrackChart: (
|
|
353
|
+
method: string,
|
|
354
|
+
user: string,
|
|
355
|
+
period: string,
|
|
356
|
+
limit: number
|
|
357
|
+
) => Promise<WeeklyTrackChartResponse>;
|
|
358
|
+
};
|
|
359
|
+
export interface config {
|
|
360
|
+
api_key: string;
|
|
361
|
+
app_name: string;
|
|
362
|
+
base_url: string;
|
|
363
|
+
format: {
|
|
364
|
+
json: string;
|
|
365
|
+
xml: string;
|
|
366
|
+
};
|
|
367
|
+
share_secret: string;
|
|
368
|
+
username: string;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export interface method {
|
|
372
|
+
auth: string;
|
|
373
|
+
user: {
|
|
374
|
+
getInfo: string;
|
|
375
|
+
loved_tracks: string;
|
|
376
|
+
recent_tracks: string;
|
|
377
|
+
top_albums: string;
|
|
378
|
+
top_artists: string;
|
|
379
|
+
top_tracks: string;
|
|
380
|
+
weekly_album_chart: string;
|
|
381
|
+
weekly_artist_chart: string;
|
|
382
|
+
weekly_chart_list: string;
|
|
383
|
+
weekly_track_chart: string;
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export enum Errors {
|
|
388
|
+
'InvalidService' = 2,
|
|
389
|
+
'InvalidMethod' = 3,
|
|
390
|
+
'AuthenticationFailed' = 4,
|
|
391
|
+
'Invalid format' = 5,
|
|
392
|
+
'Invalid parameters' = 6,
|
|
393
|
+
'InvalidResourceSpecified' = 7,
|
|
394
|
+
'OperationFailed' = 8,
|
|
395
|
+
'Invalid session key' = 9,
|
|
396
|
+
'InvalidApiKey' = 10,
|
|
397
|
+
'ServiceOffline' = 11,
|
|
398
|
+
'InvalidMethodSignatureSupplied' = 13,
|
|
399
|
+
'TemporaryErrorRequest' = 16,
|
|
400
|
+
'SuspendedApiKey' = 26,
|
|
401
|
+
'RateLimitExceeded' = 29,
|
|
297
402
|
}
|
package/dist/types.d.ts
DELETED
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
declare module 'lastfm-nodejs-client' {
|
|
2
|
-
export interface AuthResponse {
|
|
3
|
-
token: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface LovedTracksResponse {
|
|
7
|
-
lovedtracks: LovedTracks;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface LovedTracks {
|
|
11
|
-
track: Track[];
|
|
12
|
-
'@attr': Attr;
|
|
13
|
-
}
|
|
14
|
-
export interface TopAlbumsResponse {
|
|
15
|
-
topalbums: TopAlbums;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface TopTrackResponse {
|
|
19
|
-
toptracks: TopTracks;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface TopTracks {
|
|
23
|
-
track: Track[];
|
|
24
|
-
'@attr': Attr2;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export interface UserResponse {
|
|
28
|
-
user: User;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface RecentTracksResponse {
|
|
32
|
-
recenttracks: RecentTracks;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface RecentTracks {
|
|
36
|
-
track: Track[];
|
|
37
|
-
'@attr': Attr2;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface LoveTracksResponse {
|
|
41
|
-
lovedtracks: LovedTracks;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface LovedTracks {
|
|
45
|
-
track: Track[];
|
|
46
|
-
'@attr': Attr;
|
|
47
|
-
}
|
|
48
|
-
export interface FriendsResponse {
|
|
49
|
-
friends: Friends;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface Friends {
|
|
53
|
-
'@attr': Attr;
|
|
54
|
-
user: User[];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface TopArtistsResponse {
|
|
58
|
-
topartists: TopArtists;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface TopArtists {
|
|
62
|
-
artist: Artist[];
|
|
63
|
-
'@attr': Attr2;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface WeeklyArtistChartResponse {
|
|
67
|
-
weeklyartistchart: WeeklyArtistChart;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface WeeklyArtistChart {
|
|
71
|
-
artist: Artist[];
|
|
72
|
-
'@attr': Attr2;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface WeeklyAlbumChartResponse {
|
|
76
|
-
weeklyalbumchart: WeeklyAlbumChart;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface WeeklyAlbumChart {
|
|
80
|
-
album: WeeklyAlbum[];
|
|
81
|
-
'@attr': WeeklyalbumChartAttr;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export type WeeklyAlbum = {
|
|
85
|
-
artist: {
|
|
86
|
-
mbid: string;
|
|
87
|
-
'#text': string;
|
|
88
|
-
};
|
|
89
|
-
mbid: string;
|
|
90
|
-
url: string;
|
|
91
|
-
name: string;
|
|
92
|
-
'@attr': { rank: string };
|
|
93
|
-
playcount: string;
|
|
94
|
-
image?: string;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export interface WeeklyalbumChartAttr {
|
|
98
|
-
from: string;
|
|
99
|
-
to: string;
|
|
100
|
-
user: string;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export interface AlbumAttr {
|
|
104
|
-
rank: string;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export type Artist = {
|
|
108
|
-
'@attr': {
|
|
109
|
-
rank: number;
|
|
110
|
-
};
|
|
111
|
-
cover: ArtistImage;
|
|
112
|
-
image?: string;
|
|
113
|
-
mbid: string;
|
|
114
|
-
name: string;
|
|
115
|
-
playcount: number;
|
|
116
|
-
streamable: number;
|
|
117
|
-
url: string;
|
|
118
|
-
'#text': string;
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export interface Attribs {
|
|
122
|
-
page: number;
|
|
123
|
-
perPage: number;
|
|
124
|
-
user: string;
|
|
125
|
-
total: number;
|
|
126
|
-
totalPages: number;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export interface ArtistImage {
|
|
130
|
-
name: string;
|
|
131
|
-
photo: string;
|
|
132
|
-
attribution: string;
|
|
133
|
-
playcount: number;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export interface Album {
|
|
137
|
-
mbid: string;
|
|
138
|
-
'#text': string;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export interface Attr {
|
|
142
|
-
nowplaying: string;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export interface Date {
|
|
146
|
-
uts: string;
|
|
147
|
-
'#text': string;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export interface Track {
|
|
151
|
-
artist: Artist;
|
|
152
|
-
streamable: string;
|
|
153
|
-
image: '';
|
|
154
|
-
mbid: string;
|
|
155
|
-
album: Album;
|
|
156
|
-
name: string;
|
|
157
|
-
'@attr': Attr;
|
|
158
|
-
url: string;
|
|
159
|
-
date: Date;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export interface Attr2 {
|
|
163
|
-
user: string;
|
|
164
|
-
totalPages: string;
|
|
165
|
-
page: string;
|
|
166
|
-
perPage: string;
|
|
167
|
-
total: string;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
export interface RecentTracks {
|
|
171
|
-
track: Track[];
|
|
172
|
-
'@attr': Attr2;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export interface Image {
|
|
176
|
-
size: string;
|
|
177
|
-
'#text': string;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export interface Registered {
|
|
181
|
-
unixtime: string;
|
|
182
|
-
'#text': number;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
export interface User {
|
|
186
|
-
name: string;
|
|
187
|
-
age: string;
|
|
188
|
-
subscriber: string;
|
|
189
|
-
realname: string;
|
|
190
|
-
bootstrap: string;
|
|
191
|
-
playcount: string;
|
|
192
|
-
artist_count: string;
|
|
193
|
-
playlists: string;
|
|
194
|
-
track_count: string;
|
|
195
|
-
album_count: string;
|
|
196
|
-
image: Image[];
|
|
197
|
-
registered: Registered;
|
|
198
|
-
country: string;
|
|
199
|
-
gender: string;
|
|
200
|
-
url: string;
|
|
201
|
-
type: string;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export interface TopAlbums {
|
|
205
|
-
album: Album[];
|
|
206
|
-
'@attr': Attr2;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
export interface WeeklyArtistChartResponse {
|
|
210
|
-
weeklyartistchart: WeeklyArtistChart;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export interface WeeklyArtistChart {
|
|
214
|
-
artist: Artist[];
|
|
215
|
-
'@attr': Attr2;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export interface Attr1 {
|
|
219
|
-
rank: string;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
export interface Attr2 {
|
|
223
|
-
from: string;
|
|
224
|
-
user: string;
|
|
225
|
-
to: string;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
export interface WeeklyChartListResponse {
|
|
229
|
-
weeklychartlist: WeeklyChartList;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export interface WeeklyChartList {
|
|
233
|
-
chart: WeeklyChartListChart[];
|
|
234
|
-
'@attr': WeeklyChartListAttr;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
export interface WeeklyChartListChart {
|
|
238
|
-
'#text': string;
|
|
239
|
-
from: string;
|
|
240
|
-
to: string;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export interface WeeklyChartListAttr {
|
|
244
|
-
user: string;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export interface WeeklyTrackChartResponse {
|
|
248
|
-
weeklytrackchart: WeeklyTrackChart;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
export interface WeeklyTrackChart {
|
|
252
|
-
track: Track[];
|
|
253
|
-
'@attr': WeeklyTrackChartAttr2;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
export interface WeeklyTrackChartTrack {
|
|
257
|
-
artist: WeeklyTrackChartArtist;
|
|
258
|
-
image: Image[];
|
|
259
|
-
mbid: string;
|
|
260
|
-
url: string;
|
|
261
|
-
name: string;
|
|
262
|
-
'@attr': Attr;
|
|
263
|
-
playcount: string;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
export interface WeeklyTrackChartArtist {
|
|
267
|
-
mbid: string;
|
|
268
|
-
'#text': string;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
export interface WeeklyTrackChartAttr {
|
|
272
|
-
rank: string;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
export interface WeeklyTrackChartAttr2 {
|
|
276
|
-
from: string;
|
|
277
|
-
user: string;
|
|
278
|
-
to: string;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
export enum Errors {
|
|
282
|
-
'InvalidService' = 2,
|
|
283
|
-
'InvalidMethod' = 3,
|
|
284
|
-
'AuthenticationFailed' = 4,
|
|
285
|
-
'Invalid format' = 5,
|
|
286
|
-
'Invalid parameters' = 6,
|
|
287
|
-
'InvalidResourceSpecified' = 7,
|
|
288
|
-
'OperationFailed' = 8,
|
|
289
|
-
'Invalid session key' = 9,
|
|
290
|
-
'InvalidApiKey' = 10,
|
|
291
|
-
'ServiceOffline' = 11,
|
|
292
|
-
'InvalidMethodSignatureSupplied' = 13,
|
|
293
|
-
'TemporaryErrorRequest' = 16,
|
|
294
|
-
'SuspendedApiKey' = 26,
|
|
295
|
-
'RateLimitExceeded' = 29,
|
|
296
|
-
}
|
|
297
|
-
}
|