lastfm-nodejs-client 1.2.3 → 1.3.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/.github/workflows/playwright.yml +3 -1
- package/.nvmrc +1 -0
- package/@types/index.d.ts +16 -16
- package/CHANGELOG.md +35 -23
- package/README.md +4 -0
- package/SECURITY.md +1 -2
- package/bun.lockb +0 -0
- package/dist/auth.d.ts +12 -0
- package/dist/auth.js +23 -0
- package/dist/config.js +1 -0
- package/dist/createOptions.d.ts +6 -0
- package/dist/createOptions.js +12 -0
- package/dist/getInfo.d.ts +8 -0
- package/dist/getInfo.js +19 -0
- package/dist/getLovedTracks.d.ts +8 -0
- package/dist/getLovedTracks.js +19 -0
- package/dist/getRecentTracks.d.ts +8 -0
- package/dist/getRecentTracks.js +19 -0
- package/dist/getTopAlbums.d.ts +8 -0
- package/dist/getTopAlbums.js +19 -0
- package/dist/getTopArtists.d.ts +8 -0
- package/dist/getTopArtists.js +19 -0
- package/dist/getTopTracks.d.ts +8 -0
- package/dist/getTopTracks.js +19 -0
- package/dist/getWeeklyAlbumChart.d.ts +8 -0
- package/dist/getWeeklyAlbumChart.js +19 -0
- package/dist/getWeeklyArtistChart.d.ts +8 -0
- package/dist/getWeeklyArtistChart.js +19 -0
- package/dist/getWeeklyChartList.d.ts +8 -0
- package/dist/getWeeklyChartList.js +19 -0
- package/dist/getWeeklyTrackChart.d.ts +8 -0
- package/dist/getWeeklyTrackChart.js +19 -0
- package/dist/index.d.ts +23 -14
- package/dist/index.js +22 -115
- package/dist/method.d.ts +16 -0
- package/dist/method.js +2 -0
- package/dist/request.d.ts +7 -1
- package/dist/request.js +99 -6
- package/package.json +15 -14
- package/src/auth.ts +23 -0
- package/src/config.ts +13 -1
- package/src/createOptions.ts +12 -0
- package/src/getInfo.ts +17 -0
- package/src/getLovedTracks.ts +19 -0
- package/src/getRecentTracks.ts +19 -0
- package/src/getTopAlbums.ts +19 -0
- package/src/getTopArtists.ts +19 -0
- package/src/getTopTracks.ts +19 -0
- package/src/getWeeklyAlbumChart.ts +19 -0
- package/src/getWeeklyArtistChart.ts +19 -0
- package/src/getWeeklyChartList.ts +19 -0
- package/src/getWeeklyTrackChart.ts +20 -0
- package/src/index.ts +12 -186
- package/src/method.ts +19 -1
- package/src/request.ts +110 -15
- package/tsconfig.json +1 -1
- package/src/types.d.ts +0 -392
package/src/types.d.ts
DELETED
|
@@ -1,392 +0,0 @@
|
|
|
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
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface TopTrackResponse {
|
|
18
|
-
toptracks: TopTracks;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface TopTracks {
|
|
22
|
-
track: Track[];
|
|
23
|
-
'@attr': Attr2;
|
|
24
|
-
}
|
|
25
|
-
|
|
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: {
|
|
85
|
-
mbid: string;
|
|
86
|
-
'#text': string;
|
|
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
|
-
}
|
|
101
|
-
|
|
102
|
-
export interface AlbumAttr {
|
|
103
|
-
rank: string;
|
|
104
|
-
}
|
|
105
|
-
|
|
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
|
-
}
|
|
127
|
-
|
|
128
|
-
export interface ArtistImage {
|
|
129
|
-
name: string;
|
|
130
|
-
photo: string;
|
|
131
|
-
attribution: string;
|
|
132
|
-
playcount: number;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export interface Album {
|
|
136
|
-
mbid: string;
|
|
137
|
-
'#text': string;
|
|
138
|
-
}
|
|
139
|
-
|
|
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: 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: (method: string, user: string, period: string, limit: number) => Promise<AuthResponse>;
|
|
282
|
-
config: {
|
|
283
|
-
api_key: string;
|
|
284
|
-
app_name: string;
|
|
285
|
-
base_url: string;
|
|
286
|
-
format: {
|
|
287
|
-
json: string;
|
|
288
|
-
xml: string;
|
|
289
|
-
};
|
|
290
|
-
share_secret: string;
|
|
291
|
-
username: string;
|
|
292
|
-
};
|
|
293
|
-
getInfo: (method: string, user: string, period: string, limit: number) => Promise<UserResponse>;
|
|
294
|
-
getLovedTracks: (
|
|
295
|
-
method: string,
|
|
296
|
-
user: string,
|
|
297
|
-
period: string,
|
|
298
|
-
limit: number,
|
|
299
|
-
) => Promise<LovedTracksResponse>;
|
|
300
|
-
getRecentTracks: (
|
|
301
|
-
method: string,
|
|
302
|
-
user: string,
|
|
303
|
-
period: string,
|
|
304
|
-
limit: number,
|
|
305
|
-
) => Promise<RecentTracksResponse>;
|
|
306
|
-
getTopAlbums: (
|
|
307
|
-
method: string,
|
|
308
|
-
user: string,
|
|
309
|
-
period: string,
|
|
310
|
-
limit: number,
|
|
311
|
-
) => Promise<TopAlbumsResponse>;
|
|
312
|
-
getTopArtists: (
|
|
313
|
-
method: string,
|
|
314
|
-
user: string,
|
|
315
|
-
period: string,
|
|
316
|
-
limit: number,
|
|
317
|
-
) => Promise<TopArtistsResponse>;
|
|
318
|
-
getTopTracks: (
|
|
319
|
-
method: string,
|
|
320
|
-
user: string,
|
|
321
|
-
period: string,
|
|
322
|
-
limit: number,
|
|
323
|
-
) => Promise<TopTrackResponse>;
|
|
324
|
-
getWeeklyAlbumChart: (
|
|
325
|
-
method: string,
|
|
326
|
-
user: string,
|
|
327
|
-
period: string,
|
|
328
|
-
limit: number,
|
|
329
|
-
) => Promise<WeeklyAlbumChartResponse>;
|
|
330
|
-
getWeeklyArtistChart: (
|
|
331
|
-
method: string,
|
|
332
|
-
user: string,
|
|
333
|
-
period: string,
|
|
334
|
-
limit: number,
|
|
335
|
-
) => Promise<WeeklyArtistChartResponse>;
|
|
336
|
-
getWeeklyChartList: (
|
|
337
|
-
method: string,
|
|
338
|
-
user: string,
|
|
339
|
-
period: string,
|
|
340
|
-
limit: number,
|
|
341
|
-
) => Promise<WeeklyChartListResponse>;
|
|
342
|
-
getWeeklyTrackChart: (
|
|
343
|
-
method: string,
|
|
344
|
-
user: string,
|
|
345
|
-
period: string,
|
|
346
|
-
limit: number,
|
|
347
|
-
) => Promise<WeeklyTrackChartResponse>;
|
|
348
|
-
};
|
|
349
|
-
export interface config {
|
|
350
|
-
api_key: string;
|
|
351
|
-
app_name: string;
|
|
352
|
-
base_url: string;
|
|
353
|
-
format: {
|
|
354
|
-
json: string;
|
|
355
|
-
xml: string;
|
|
356
|
-
};
|
|
357
|
-
share_secret: string;
|
|
358
|
-
username: string;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
export interface method {
|
|
362
|
-
auth: string;
|
|
363
|
-
user: {
|
|
364
|
-
getInfo: string;
|
|
365
|
-
loved_tracks: string;
|
|
366
|
-
recent_tracks: string;
|
|
367
|
-
top_albums: string;
|
|
368
|
-
top_artists: string;
|
|
369
|
-
top_tracks: string;
|
|
370
|
-
weekly_album_chart: string;
|
|
371
|
-
weekly_artist_chart: string;
|
|
372
|
-
weekly_chart_list: string;
|
|
373
|
-
weekly_track_chart: string;
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
export enum Errors {
|
|
378
|
-
'InvalidService' = 2,
|
|
379
|
-
'InvalidMethod' = 3,
|
|
380
|
-
'AuthenticationFailed' = 4,
|
|
381
|
-
'Invalid format' = 5,
|
|
382
|
-
'Invalid parameters' = 6,
|
|
383
|
-
'InvalidResourceSpecified' = 7,
|
|
384
|
-
'OperationFailed' = 8,
|
|
385
|
-
'Invalid session key' = 9,
|
|
386
|
-
'InvalidApiKey' = 10,
|
|
387
|
-
'ServiceOffline' = 11,
|
|
388
|
-
'InvalidMethodSignatureSupplied' = 13,
|
|
389
|
-
'TemporaryErrorRequest' = 16,
|
|
390
|
-
'SuspendedApiKey' = 26,
|
|
391
|
-
'RateLimitExceeded' = 29,
|
|
392
|
-
}
|