lastfm-nodejs-client 1.4.0 → 1.4.2

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,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.2
4
+
5
+ - bug, release dist
6
+
7
+ ## 1.4.1
8
+
9
+ - export esm modules modern js only.
10
+ - add all dts and dts map files to dist
11
+ - adds lastfm types to dist
12
+
3
13
  ## 1.4.0
4
14
 
5
15
  - update all api functions from snake case to camel case.
@@ -0,0 +1,392 @@
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?: Image[];
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) => 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) => 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 ErrorResponse {
378
+ InvalidService = 2,
379
+ InvalidMethod = 3,
380
+ AuthenticationFailed = 4,
381
+ InvalidFormat = 5,
382
+ InvalidParameters = 6,
383
+ InvalidResource = 7,
384
+ OperationFailed = 8,
385
+ InvalidSessionKey = 9,
386
+ InvalidAPIKey = 10,
387
+ ServiceOffline = 11,
388
+ InvalidMethodSignature = 13,
389
+ TemporaryError = 16,
390
+ SuspendedAPIKey = 26,
391
+ RateLimitExceeded = 29
392
+ }
package/dist/auth.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ import { AuthResponse } from '../@types';
2
+ /**
3
+ * POST: Auth - LastFM
4
+ *
5
+ * https://www.last.fm/api/show/auth.getToken
6
+ *
7
+ * Authentication tokens are API account specific.
8
+ * They are valid for 60 minutes from the moment they are granted.
9
+ * Can only used once (they are consumed when a session is created).
10
+ * @returns Auth token
11
+ */
12
+ export declare function auth(method: string, user: string, period: string, limit: string): Promise<AuthResponse>;
13
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAIzC;;;;;;;;;EASE;AACF,wBAAgB,IAAI,CAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,YAAY,CAAC,CAGvB"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @description Stores the Last.fm API key, app name, base url, format, shared secret, and username.
3
+ * Simply add a .env file to the root of the project and add the following:
4
+ * LASTFM_API_KEY=your_api_key
5
+ * LASTFM_APPNAME=your_app_name
6
+ * LASTFM_API_BASE_URL=your_base_url
7
+ * LASTFM_SHARED_SECRET=your_shared_secret
8
+ * LASTFM_USER=your_username
9
+ */
10
+ export declare const config: {
11
+ api_key: string;
12
+ app_name: string;
13
+ base_url: string;
14
+ format: {
15
+ json: string;
16
+ xml: string;
17
+ };
18
+ share_secret: string;
19
+ username: string;
20
+ };
21
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAcA;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;CAUD,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare function createOptions(method: string, user: string, period?: string, limit?: string): {
2
+ method: string;
3
+ user: string;
4
+ period: string | undefined;
5
+ limit: string | undefined;
6
+ };
7
+ //# sourceMappingURL=createOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createOptions.d.ts","sourceRoot":"","sources":["../src/createOptions.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM;;;;;EAOf"}
@@ -0,0 +1,9 @@
1
+ import { UserResponse } from '../@types';
2
+ /**
3
+ * GET: User profile information - LastFM
4
+ *
5
+ * https://www.last.fm/api/show/user.getInfo
6
+ * @returns User profile information
7
+ */
8
+ export declare function getInfo(method: string, user: string): Promise<UserResponse>;
9
+ //# sourceMappingURL=getInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getInfo.d.ts","sourceRoot":"","sources":["../src/getInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAIzC;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,YAAY,CAAC,CAGvB"}
@@ -0,0 +1,9 @@
1
+ import { LovedTracksResponse } from '../@types';
2
+ /**
3
+ * GET: Love Tracks - LastFM
4
+ *
5
+ * https://www.last.fm/api/show/user.getLovedTracks
6
+ * @returns Loved Tracks;
7
+ */
8
+ export declare function getLovedTracks(method: string, user: string, period: string, limit: string): Promise<LovedTracksResponse>;
9
+ //# sourceMappingURL=getLovedTracks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getLovedTracks.d.ts","sourceRoot":"","sources":["../src/getLovedTracks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAIhD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,mBAAmB,CAAC,CAG9B"}
@@ -0,0 +1,9 @@
1
+ import { RecentTracksResponse } from '../@types';
2
+ /**
3
+ * GET: Recent Tracks - LastFM
4
+ *
5
+ * https://www.last.fm/api/show/user.getRecentTracks
6
+ * @returns Recent Tracks
7
+ */
8
+ export declare function getRecentTracks(method: string, user: string, period: string, limit: string): Promise<RecentTracksResponse>;
9
+ //# sourceMappingURL=getRecentTracks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRecentTracks.d.ts","sourceRoot":"","sources":["../src/getRecentTracks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAIjD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,oBAAoB,CAAC,CAG/B"}
@@ -0,0 +1,9 @@
1
+ import { TopAlbumsResponse } from '../@types';
2
+ /**
3
+ * GET: Top Albums - LastFM
4
+ *
5
+ * https://www.last.fm/api/show/user.getTopAlbums
6
+ * @returns Top Albums
7
+ */
8
+ export declare function getTopAlbums(method: string, user: string, period: string, limit: string): Promise<TopAlbumsResponse>;
9
+ //# sourceMappingURL=getTopAlbums.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTopAlbums.d.ts","sourceRoot":"","sources":["../src/getTopAlbums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAI9C;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,iBAAiB,CAAC,CAG5B"}
@@ -0,0 +1,9 @@
1
+ import { TopArtistsResponse } from '../@types';
2
+ /**
3
+ * GET: Top Artist - LastFM
4
+ *
5
+ * https://www.last.fm/api/show/user.getTopArtists
6
+ * @returns Top Artists
7
+ */
8
+ export declare function getTopArtists(method: string, user: string, period: string, limit: string): Promise<TopArtistsResponse>;
9
+ //# sourceMappingURL=getTopArtists.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTopArtists.d.ts","sourceRoot":"","sources":["../src/getTopArtists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAI/C;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,kBAAkB,CAAC,CAG7B"}
@@ -0,0 +1,9 @@
1
+ import { TopTrackResponse } from '../@types';
2
+ /**
3
+ * GET: Top Tracks - LastFM
4
+ *
5
+ * https://www.last.fm/api/show/user.getTopTracks
6
+ * @returns Top Tracks
7
+ */
8
+ export declare function getTopTracks(method: string, user: string, period: string, limit: string): Promise<TopTrackResponse>;
9
+ //# sourceMappingURL=getTopTracks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTopTracks.d.ts","sourceRoot":"","sources":["../src/getTopTracks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAI7C;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,gBAAgB,CAAC,CAG3B"}
@@ -0,0 +1,9 @@
1
+ import { WeeklyAlbumChartResponse } from '../@types';
2
+ /**
3
+ * GET: Weekly album chart - LastFM
4
+ *
5
+ * https://www.last.fm/api/show/user.getWeeklyAlbumChart
6
+ * @returns Weekly album chart
7
+ */
8
+ export declare function getWeeklyAlbumChart(method: string, user: string, period: string, limit: string): Promise<WeeklyAlbumChartResponse>;
9
+ //# sourceMappingURL=getWeeklyAlbumChart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getWeeklyAlbumChart.d.ts","sourceRoot":"","sources":["../src/getWeeklyAlbumChart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAIrD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,wBAAwB,CAAC,CAGnC"}
@@ -0,0 +1,9 @@
1
+ import { WeeklyArtistChartResponse } from '../@types';
2
+ /**
3
+ * GET: Weekly artist chart - LastFM
4
+ *
5
+ * https://www.last.fm/api/show/user.getWeeklyArtistChart
6
+ * @returns Weekly artist chart
7
+ */
8
+ export declare function getWeeklyArtistChart(method: string, user: string, period: string, limit: string): Promise<WeeklyArtistChartResponse>;
9
+ //# sourceMappingURL=getWeeklyArtistChart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getWeeklyArtistChart.d.ts","sourceRoot":"","sources":["../src/getWeeklyArtistChart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAItD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,yBAAyB,CAAC,CAGpC"}
@@ -0,0 +1,9 @@
1
+ import { WeeklyChartListResponse } from '../@types';
2
+ /**
3
+ * GET: Weekly chart list - LastFM
4
+ *
5
+ * https://www.last.fm/api/show/user.getWeeklyChartList
6
+ * @returns Weekly chart list
7
+ */
8
+ export declare function getWeeklyChartList(method: string, user: string, period: string, limit: string): Promise<WeeklyChartListResponse>;
9
+ //# sourceMappingURL=getWeeklyChartList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getWeeklyChartList.d.ts","sourceRoot":"","sources":["../src/getWeeklyChartList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAIpD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,uBAAuB,CAAC,CAGlC"}
@@ -0,0 +1,9 @@
1
+ import { WeeklyTrackChartResponse } from '../@types';
2
+ /**
3
+ * GET: Weekly track chart - LastFM
4
+ *
5
+ * https://www.last.fm/api/show/user.getWeeklyTrackChart
6
+ * @returns Weekly track chart
7
+ */
8
+ export declare function getWeeklyTrackChart(method: string, user: string, period: string, limit: string): Promise<WeeklyTrackChartResponse>;
9
+ //# sourceMappingURL=getWeeklyTrackChart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getWeeklyTrackChart.d.ts","sourceRoot":"","sources":["../src/getWeeklyTrackChart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAKrD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,wBAAwB,CAAC,CAGnC"}
@@ -0,0 +1,52 @@
1
+ import { auth } from './auth';
2
+ import { getInfo } from './getInfo';
3
+ import { getLovedTracks } from './getLovedTracks';
4
+ import { getRecentTracks } from './getRecentTracks';
5
+ import { getTopAlbums } from './getTopAlbums';
6
+ import { getTopArtists } from './getTopArtists';
7
+ import { getTopTracks } from './getTopTracks';
8
+ import { getWeeklyAlbumChart } from './getWeeklyAlbumChart';
9
+ import { getWeeklyArtistChart } from './getWeeklyArtistChart';
10
+ import { getWeeklyChartList } from './getWeeklyChartList';
11
+ import { getWeeklyTrackChart } from './getWeeklyTrackChart';
12
+ declare const LastFmApi: () => {
13
+ auth: typeof auth;
14
+ config: {
15
+ api_key: string;
16
+ app_name: string;
17
+ base_url: string;
18
+ format: {
19
+ json: string;
20
+ xml: string;
21
+ };
22
+ share_secret: string;
23
+ username: string;
24
+ };
25
+ getInfo: typeof getInfo;
26
+ getLovedTracks: typeof getLovedTracks;
27
+ getRecentTracks: typeof getRecentTracks;
28
+ getTopAlbums: typeof getTopAlbums;
29
+ getTopArtists: typeof getTopArtists;
30
+ getTopTracks: typeof getTopTracks;
31
+ getWeeklyAlbumChart: typeof getWeeklyAlbumChart;
32
+ getWeeklyArtistChart: typeof getWeeklyArtistChart;
33
+ getWeeklyChartList: typeof getWeeklyChartList;
34
+ getWeeklyTrackChart: typeof getWeeklyTrackChart;
35
+ method: {
36
+ auth: string;
37
+ user: {
38
+ getInfo: string;
39
+ getLovedTracks: string;
40
+ getRecentTracks: string;
41
+ getTopAlbums: string;
42
+ getTopArtists: string;
43
+ getTopTracks: string;
44
+ getWeeklyAlbumChart: string;
45
+ getWeeklyArtistChart: string;
46
+ getWeeklyChartList: string;
47
+ getWeeklyTrackChart: string;
48
+ };
49
+ };
50
+ };
51
+ export default LastFmApi;
52
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcb,CAAA;AAEF,eAAe,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -13,21 +13,19 @@ const getWeeklyArtistChart_1 = require("./getWeeklyArtistChart");
13
13
  const getWeeklyChartList_1 = require("./getWeeklyChartList");
14
14
  const getWeeklyTrackChart_1 = require("./getWeeklyTrackChart");
15
15
  const method_1 = require("./method");
16
- function LastFmApi() {
17
- return {
18
- auth: auth_1.auth,
19
- config: config_1.config,
20
- getInfo: getInfo_1.getInfo,
21
- getLovedTracks: getLovedTracks_1.getLovedTracks,
22
- getRecentTracks: getRecentTracks_1.getRecentTracks,
23
- getTopAlbums: getTopAlbums_1.getTopAlbums,
24
- getTopArtists: getTopArtists_1.getTopArtists,
25
- getTopTracks: getTopTracks_1.getTopTracks,
26
- getWeeklyAlbumChart: getWeeklyAlbumChart_1.getWeeklyAlbumChart,
27
- getWeeklyArtistChart: getWeeklyArtistChart_1.getWeeklyArtistChart,
28
- getWeeklyChartList: getWeeklyChartList_1.getWeeklyChartList,
29
- getWeeklyTrackChart: getWeeklyTrackChart_1.getWeeklyTrackChart,
30
- method: method_1.method,
31
- };
32
- }
16
+ const LastFmApi = () => ({
17
+ auth: auth_1.auth,
18
+ config: config_1.config,
19
+ getInfo: getInfo_1.getInfo,
20
+ getLovedTracks: getLovedTracks_1.getLovedTracks,
21
+ getRecentTracks: getRecentTracks_1.getRecentTracks,
22
+ getTopAlbums: getTopAlbums_1.getTopAlbums,
23
+ getTopArtists: getTopArtists_1.getTopArtists,
24
+ getTopTracks: getTopTracks_1.getTopTracks,
25
+ getWeeklyAlbumChart: getWeeklyAlbumChart_1.getWeeklyAlbumChart,
26
+ getWeeklyArtistChart: getWeeklyArtistChart_1.getWeeklyArtistChart,
27
+ getWeeklyChartList: getWeeklyChartList_1.getWeeklyChartList,
28
+ getWeeklyTrackChart: getWeeklyTrackChart_1.getWeeklyTrackChart,
29
+ method: method_1.method,
30
+ });
33
31
  exports.default = LastFmApi;
@@ -0,0 +1,33 @@
1
+ interface UserMethod {
2
+ getInfo: string;
3
+ getLovedTracks: string;
4
+ getRecentTracks: string;
5
+ getTopAlbums: string;
6
+ getTopArtists: string;
7
+ getTopTracks: string;
8
+ getWeeklyAlbumChart: string;
9
+ getWeeklyArtistChart: string;
10
+ getWeeklyChartList: string;
11
+ getWeeklyTrackChart: string;
12
+ }
13
+ export interface Method {
14
+ auth: string;
15
+ user: UserMethod;
16
+ }
17
+ export declare const method: {
18
+ auth: string;
19
+ user: {
20
+ getInfo: string;
21
+ getLovedTracks: string;
22
+ getRecentTracks: string;
23
+ getTopAlbums: string;
24
+ getTopArtists: string;
25
+ getTopTracks: string;
26
+ getWeeklyAlbumChart: string;
27
+ getWeeklyArtistChart: string;
28
+ getWeeklyChartList: string;
29
+ getWeeklyTrackChart: string;
30
+ };
31
+ };
32
+ export {};
33
+ //# sourceMappingURL=method.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../src/method.ts"],"names":[],"mappings":"AAAA,UAAU,UAAU;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,eAAO,MAAM,MAAM;;;;;;;;;;;;;;CAcD,CAAC"}
@@ -0,0 +1,9 @@
1
+ interface RequestOptions {
2
+ method: string;
3
+ user?: string;
4
+ period?: string;
5
+ limit?: string;
6
+ }
7
+ declare const request: <Response_1>(options: RequestOptions) => Promise<Response_1>;
8
+ export default request;
9
+ //# sourceMappingURL=request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":"AAGA,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkCD,QAAA,MAAM,OAAO,wBAA6B,cAAc,wBAwFvD,CAAC;AAEF,eAAe,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,15 +1,8 @@
1
1
  {
2
2
  "name": "lastfm-nodejs-client",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
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
- "clean": "rimraf dist",
9
- "dev": "npm run clean && tsc --watch --project tsconfig.dev.json",
10
- "publish": "npm run build && npm publish --access public",
11
- "test": "npx playwright test --reporter=list"
12
- },
13
6
  "keywords": [
14
7
  "client",
15
8
  "lastFm",
@@ -39,5 +32,11 @@
39
32
  "bugs": {
40
33
  "url": "https://github.com/mannuelf/lastfm-nodejs-client/issues"
41
34
  },
42
- "homepage": "https://github.com/mannuelf/lastfm-nodejs-client#readme"
35
+ "homepage": "https://github.com/mannuelf/lastfm-nodejs-client#readme",
36
+ "scripts": {
37
+ "build": "rimraf dist && tsc",
38
+ "clean": "rimraf dist",
39
+ "dev": "npm run clean && tsc --watch --project tsconfig.dev.json",
40
+ "test": "npx playwright test --reporter=list"
41
+ }
43
42
  }
package/src/index.ts CHANGED
@@ -12,20 +12,20 @@ import { getWeeklyChartList } from './getWeeklyChartList';
12
12
  import { getWeeklyTrackChart } from './getWeeklyTrackChart';
13
13
  import { method } from './method';
14
14
 
15
- export default function LastFmApi() {
16
- return {
17
- auth,
18
- config,
19
- getInfo,
20
- getLovedTracks,
21
- getRecentTracks,
22
- getTopAlbums,
23
- getTopArtists,
24
- getTopTracks,
25
- getWeeklyAlbumChart,
26
- getWeeklyArtistChart,
27
- getWeeklyChartList,
28
- getWeeklyTrackChart,
29
- method,
30
- };
31
- }
15
+ const LastFmApi = () => ({
16
+ auth,
17
+ config,
18
+ getInfo,
19
+ getLovedTracks,
20
+ getRecentTracks,
21
+ getTopAlbums,
22
+ getTopArtists,
23
+ getTopTracks,
24
+ getWeeklyAlbumChart,
25
+ getWeeklyArtistChart,
26
+ getWeeklyChartList,
27
+ getWeeklyTrackChart,
28
+ method,
29
+ })
30
+
31
+ export default LastFmApi;
package/tsconfig.json CHANGED
@@ -12,8 +12,8 @@
12
12
  // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
13
13
 
14
14
  /* Language and Environment */
15
- "target": "ES2015" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
16
- // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
15
+ "target": "ES6" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
16
+ "lib": ["DOM", "ESNext"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
17
17
  // "jsx": "preserve", /* Specify what JSX code is generated. */
18
18
  // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
19
19
  // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
@@ -26,9 +26,9 @@
26
26
  // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
27
27
 
28
28
  /* Modules */
29
- "module": "NodeNext" /* Specify what module code is generated. */,
30
- "rootDir": "./src" /* Specify the root folder within your source files. */,
31
- "moduleResolution": "NodeNext" /* Specify how TypeScript looks up a file from a given module specifier. */,
29
+ "module": "NodeNext" /* Specify what module code is generated. */,
30
+ "rootDir": "./src" /* Specify the root folder within your source files. */,
31
+ "moduleResolution": "NodeNext" /* Specify how TypeScript looks up a file from a given module specifier. */,
32
32
  // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
33
33
  // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
34
34
  // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
@@ -45,17 +45,17 @@
45
45
  // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
46
46
 
47
47
  /* Emit */
48
- "declaration": false /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
49
- "declarationMap": false, /* Create sourcemaps for d.ts files. */
48
+ "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
49
+ "declarationMap": true, /* Create sourcemaps for d.ts files. */
50
50
  // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
51
51
  // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
52
52
  // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
53
- "outDir": "./dist" /* Specify an output folder for all emitted files. */,
54
- "removeComments": false, /* Disable emitting comments. */
53
+ "outDir": "./dist" /* Specify an output folder for all emitted files. */,
54
+ "removeComments": false, /* Disable emitting comments. */
55
55
  // "noEmit": true, /* Disable emitting files from a compilation. */
56
56
  // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
57
57
  // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
58
- "downlevelIteration": false, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
58
+ "downlevelIteration": false, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
59
59
  // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
60
60
  // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
61
61
  // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
@@ -70,11 +70,11 @@
70
70
  // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
71
71
 
72
72
  /* Interop Constraints */
73
- "isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
74
- // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
75
- "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
73
+ "isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
74
+ "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
75
+ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
76
76
  // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
77
- "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
77
+ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
78
78
 
79
79
  /* Type Checking */
80
80
  "strict": true /* Enable all strict type-checking options. */,