lastfm-nodejs-client 1.4.3 → 1.4.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.
Files changed (132) hide show
  1. package/README.md +14 -2
  2. package/{@types → dist/@types}/index.d.ts +41 -21
  3. package/dist/cjs/auth.d.ts +12 -0
  4. package/dist/{auth.js → cjs/auth.js} +11 -11
  5. package/dist/cjs/chart/topArtists.d.ts +2 -0
  6. package/dist/cjs/chart/topArtists.js +13 -0
  7. package/dist/cjs/chart/topTags.d.ts +2 -0
  8. package/dist/cjs/chart/topTags.js +13 -0
  9. package/dist/cjs/chart/topTracks.d.ts +2 -0
  10. package/dist/cjs/chart/topTracks.js +13 -0
  11. package/dist/{config.d.ts → cjs/config.d.ts} +0 -1
  12. package/dist/{config.js → cjs/config.js} +0 -1
  13. package/dist/cjs/createOptions.d.ts +7 -0
  14. package/dist/{createOptions.js → cjs/createOptions.js} +2 -1
  15. package/dist/{getInfo.d.ts → cjs/getInfo.d.ts} +1 -2
  16. package/dist/{getInfo.js → cjs/getInfo.js} +2 -2
  17. package/dist/{getLovedTracks.d.ts → cjs/getLovedTracks.d.ts} +1 -2
  18. package/dist/{getLovedTracks.js → cjs/getLovedTracks.js} +2 -2
  19. package/dist/{getRecentTracks.d.ts → cjs/getRecentTracks.d.ts} +1 -2
  20. package/dist/{getRecentTracks.js → cjs/getRecentTracks.js} +2 -2
  21. package/dist/{getTopAlbums.d.ts → cjs/getTopAlbums.d.ts} +1 -2
  22. package/dist/{getTopAlbums.js → cjs/getTopAlbums.js} +2 -2
  23. package/dist/{getTopArtists.d.ts → cjs/getTopArtists.d.ts} +1 -2
  24. package/dist/{getTopArtists.js → cjs/getTopArtists.js} +2 -2
  25. package/dist/{getTopTracks.d.ts → cjs/getTopTracks.d.ts} +1 -2
  26. package/dist/{getTopTracks.js → cjs/getTopTracks.js} +2 -2
  27. package/dist/{getWeeklyAlbumChart.d.ts → cjs/getWeeklyAlbumChart.d.ts} +1 -2
  28. package/dist/{getWeeklyAlbumChart.js → cjs/getWeeklyAlbumChart.js} +2 -2
  29. package/dist/{getWeeklyArtistChart.d.ts → cjs/getWeeklyArtistChart.d.ts} +1 -2
  30. package/dist/{getWeeklyArtistChart.js → cjs/getWeeklyArtistChart.js} +2 -2
  31. package/dist/{getWeeklyChartList.d.ts → cjs/getWeeklyChartList.d.ts} +1 -2
  32. package/dist/{getWeeklyChartList.js → cjs/getWeeklyChartList.js} +2 -2
  33. package/dist/{getWeeklyTrackChart.d.ts → cjs/getWeeklyTrackChart.d.ts} +1 -2
  34. package/dist/{getWeeklyTrackChart.js → cjs/getWeeklyTrackChart.js} +2 -2
  35. package/dist/{index.d.ts → cjs/index.d.ts} +14 -3
  36. package/dist/cjs/index.js +41 -0
  37. package/dist/{method.d.ts → cjs/method.d.ts} +11 -1
  38. package/dist/{method.js → cjs/method.js} +5 -2
  39. package/dist/cjs/package.json +3 -0
  40. package/dist/{request.d.ts → cjs/request.d.ts} +0 -1
  41. package/dist/{request.js → cjs/request.js} +7 -15
  42. package/dist/mjs/auth.d.ts +12 -0
  43. package/dist/mjs/auth.js +16 -0
  44. package/dist/mjs/chart/topArtists.d.ts +2 -0
  45. package/dist/mjs/chart/topArtists.js +6 -0
  46. package/dist/mjs/chart/topTags.d.ts +2 -0
  47. package/dist/mjs/chart/topTags.js +6 -0
  48. package/dist/mjs/chart/topTracks.d.ts +2 -0
  49. package/dist/mjs/chart/topTracks.js +6 -0
  50. package/dist/mjs/config.d.ts +20 -0
  51. package/dist/mjs/config.js +22 -0
  52. package/dist/mjs/createOptions.d.ts +7 -0
  53. package/dist/mjs/createOptions.js +9 -0
  54. package/dist/mjs/getInfo.d.ts +8 -0
  55. package/dist/mjs/getInfo.js +12 -0
  56. package/dist/mjs/getLovedTracks.d.ts +8 -0
  57. package/dist/mjs/getLovedTracks.js +12 -0
  58. package/dist/mjs/getRecentTracks.d.ts +8 -0
  59. package/dist/mjs/getRecentTracks.js +12 -0
  60. package/dist/mjs/getTopAlbums.d.ts +8 -0
  61. package/dist/mjs/getTopAlbums.js +12 -0
  62. package/dist/mjs/getTopArtists.d.ts +8 -0
  63. package/dist/mjs/getTopArtists.js +12 -0
  64. package/dist/mjs/getTopTracks.d.ts +8 -0
  65. package/dist/mjs/getTopTracks.js +12 -0
  66. package/dist/mjs/getWeeklyAlbumChart.d.ts +8 -0
  67. package/dist/mjs/getWeeklyAlbumChart.js +12 -0
  68. package/dist/mjs/getWeeklyArtistChart.d.ts +8 -0
  69. package/dist/mjs/getWeeklyArtistChart.js +12 -0
  70. package/dist/mjs/getWeeklyChartList.d.ts +8 -0
  71. package/dist/mjs/getWeeklyChartList.js +12 -0
  72. package/dist/mjs/getWeeklyTrackChart.d.ts +8 -0
  73. package/dist/mjs/getWeeklyTrackChart.js +12 -0
  74. package/dist/mjs/index.d.ts +63 -0
  75. package/{src/index.ts → dist/mjs/index.js} +25 -18
  76. package/dist/mjs/method.d.ts +43 -0
  77. package/dist/mjs/method.js +20 -0
  78. package/dist/mjs/package.json +3 -0
  79. package/dist/mjs/request.d.ts +8 -0
  80. package/dist/mjs/request.js +119 -0
  81. package/lastfm-nodejs-client/package.json +7 -0
  82. package/package.json +41 -13
  83. package/.env.example +0 -6
  84. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
  85. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  86. package/.github/dependabot.yml +0 -11
  87. package/.github/workflows/codeql.yml +0 -74
  88. package/.github/workflows/playwright.yml +0 -36
  89. package/.nvmrc +0 -1
  90. package/.prettierrc.yaml +0 -6
  91. package/CHANGELOG.md +0 -108
  92. package/CODE_OF_CONDUCT.md +0 -128
  93. package/CONTRIBUTING.md +0 -9
  94. package/SECURITY.md +0 -13
  95. package/dist/auth.d.ts +0 -13
  96. package/dist/auth.d.ts.map +0 -1
  97. package/dist/config.d.ts.map +0 -1
  98. package/dist/createOptions.d.ts +0 -7
  99. package/dist/createOptions.d.ts.map +0 -1
  100. package/dist/getInfo.d.ts.map +0 -1
  101. package/dist/getLovedTracks.d.ts.map +0 -1
  102. package/dist/getRecentTracks.d.ts.map +0 -1
  103. package/dist/getTopAlbums.d.ts.map +0 -1
  104. package/dist/getTopArtists.d.ts.map +0 -1
  105. package/dist/getTopTracks.d.ts.map +0 -1
  106. package/dist/getWeeklyAlbumChart.d.ts.map +0 -1
  107. package/dist/getWeeklyArtistChart.d.ts.map +0 -1
  108. package/dist/getWeeklyChartList.d.ts.map +0 -1
  109. package/dist/getWeeklyTrackChart.d.ts.map +0 -1
  110. package/dist/index.d.ts.map +0 -1
  111. package/dist/index.js +0 -31
  112. package/dist/method.d.ts.map +0 -1
  113. package/dist/request.d.ts.map +0 -1
  114. package/playwright.config.ts +0 -37
  115. package/src/auth.ts +0 -23
  116. package/src/config.ts +0 -34
  117. package/src/createOptions.ts +0 -12
  118. package/src/getInfo.ts +0 -17
  119. package/src/getLovedTracks.ts +0 -19
  120. package/src/getRecentTracks.ts +0 -19
  121. package/src/getTopAlbums.ts +0 -19
  122. package/src/getTopArtists.ts +0 -19
  123. package/src/getTopTracks.ts +0 -19
  124. package/src/getWeeklyAlbumChart.ts +0 -19
  125. package/src/getWeeklyArtistChart.ts +0 -19
  126. package/src/getWeeklyChartList.ts +0 -19
  127. package/src/getWeeklyTrackChart.ts +0 -20
  128. package/src/method.ts +0 -33
  129. package/src/request.ts +0 -133
  130. package/tests/env.spec.ts +0 -21
  131. package/tsconfig.dev.json +0 -7
  132. package/tsconfig.json +0 -104
package/README.md CHANGED
@@ -98,7 +98,12 @@ Create them [here](https://www.last.fm/api/account/create).
98
98
  ### Develop
99
99
 
100
100
  ```bash
101
- pnpm dev
101
+ pnpm test
102
+ ```
103
+
104
+ ```bash
105
+ pnpm lint
106
+ pnpm lint-fix
102
107
  ```
103
108
 
104
109
  ### Build
@@ -107,10 +112,17 @@ pnpm dev
107
112
  pnpm build
108
113
  ```
109
114
 
115
+ ### Publish
116
+
117
+ ```bash
118
+ pnpm prepare
119
+ pnpm publish
120
+ ```
121
+
110
122
  ### Why I built this?
111
123
 
112
124
  I was building a scrobbles page [https://mannuelferreira.com/scrobbles](https://mannuelferreira.com/scrobbles) and I thought others might want it to.
113
125
 
114
126
  ### TODO
115
127
 
116
- - move types into [DefinitelyTyped](https://github.com/mannuelf/DefinitelyTyped)
128
+ - move types into [DefinitelyTyped](https://github.com/mannuelf/DefinitelyTyped)
@@ -36,6 +36,22 @@ export interface RecentTracks {
36
36
  '@attr': AttrLimit;
37
37
  }
38
38
 
39
+ export interface TagsResponse {
40
+ tag: Tag[];
41
+ '@attr': Attr;
42
+ }
43
+
44
+ export interface Tag {
45
+ name: string;
46
+ url: string;
47
+ reach: string;
48
+ taggings: string;
49
+ streamable: string;
50
+ wiki: Wiki;
51
+ }
52
+
53
+ export interface Wiki {}
54
+
39
55
  export interface LoveTracksResponse {
40
56
  lovedtracks: LovedTracks;
41
57
  }
@@ -53,6 +69,10 @@ export interface Friends {
53
69
  user: User[];
54
70
  }
55
71
 
72
+ export interface ChartTopArtistRepsonse {
73
+ artists: Artist[];
74
+ '@attr': AttributesPage;
75
+ }
56
76
  export interface TopArtistsResponse {
57
77
  topartists: TopArtists;
58
78
  }
@@ -91,7 +111,7 @@ export interface WeeklyAlbum {
91
111
  '@attr': { rank: string };
92
112
  playcount: string;
93
113
  image?: string;
94
- };
114
+ }
95
115
 
96
116
  export interface WeeklyalbumChartAttr {
97
117
  from: string;
@@ -117,7 +137,7 @@ export type Artist = {
117
137
  '#text': string;
118
138
  };
119
139
 
120
- export interface Attribs {
140
+ export interface AttributesPage {
121
141
  page: number;
122
142
  perPage: number;
123
143
  user: string;
@@ -136,8 +156,8 @@ export interface Album extends Track {
136
156
  album: Album;
137
157
  artist: Artist;
138
158
  name: string;
139
- url: string
140
- };
159
+ url: string;
160
+ }
141
161
 
142
162
  export interface AttrNowPlaying {
143
163
  nowplaying: string;
@@ -151,7 +171,7 @@ export interface Date {
151
171
  export interface Track {
152
172
  '@attr'?: AttrRank;
153
173
  album: Album;
154
- artist: Artist;
174
+ artist: Artist;
155
175
  date?: Date;
156
176
  duration?: string;
157
177
  image?: Image[];
@@ -163,7 +183,7 @@ export interface Track {
163
183
  }
164
184
 
165
185
  export interface AttrLimit {
166
- user: string;
186
+ user?: string;
167
187
  totalPages: string;
168
188
  page: string;
169
189
  perPage: string;
@@ -272,18 +292,18 @@ export interface WeeklyTrackChartArtist {
272
292
  }
273
293
 
274
294
  export enum ErrorResponse {
275
- InvalidService = 2,
276
- InvalidMethod = 3,
277
- AuthenticationFailed = 4,
278
- InvalidFormat = 5,
279
- InvalidParameters = 6,
280
- InvalidResource = 7,
281
- OperationFailed = 8,
282
- InvalidSessionKey = 9,
283
- InvalidAPIKey = 10,
284
- ServiceOffline = 11,
285
- InvalidMethodSignature = 13,
286
- TemporaryError = 16,
287
- SuspendedAPIKey = 26,
288
- RateLimitExceeded = 29
289
- }
295
+ InvalidService = 2,
296
+ InvalidMethod = 3,
297
+ AuthenticationFailed = 4,
298
+ InvalidFormat = 5,
299
+ InvalidParameters = 6,
300
+ InvalidResource = 7,
301
+ OperationFailed = 8,
302
+ InvalidSessionKey = 9,
303
+ InvalidAPIKey = 10,
304
+ ServiceOffline = 11,
305
+ InvalidMethodSignature = 13,
306
+ TemporaryError = 16,
307
+ SuspendedAPIKey = 26,
308
+ RateLimitExceeded = 29,
309
+ }
@@ -0,0 +1,12 @@
1
+ import { type 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>;
@@ -7,17 +7,17 @@ exports.auth = void 0;
7
7
  const createOptions_1 = require("./createOptions");
8
8
  const request_1 = __importDefault(require("./request"));
9
9
  /**
10
- * POST: Auth - LastFM
11
- *
12
- * https://www.last.fm/api/show/auth.getToken
13
- *
14
- * Authentication tokens are API account specific.
15
- * They are valid for 60 minutes from the moment they are granted.
16
- * Can only used once (they are consumed when a session is created).
17
- * @returns Auth token
18
- */
19
- function auth(method, user, period, limit) {
10
+ * POST: Auth - LastFM
11
+ *
12
+ * https://www.last.fm/api/show/auth.getToken
13
+ *
14
+ * Authentication tokens are API account specific.
15
+ * They are valid for 60 minutes from the moment they are granted.
16
+ * Can only used once (they are consumed when a session is created).
17
+ * @returns Auth token
18
+ */
19
+ async function auth(method, user, period, limit) {
20
20
  const options = (0, createOptions_1.createOptions)(method, user, period, limit);
21
- return (0, request_1.default)(options);
21
+ return await (0, request_1.default)(options);
22
22
  }
23
23
  exports.auth = auth;
@@ -0,0 +1,2 @@
1
+ import { ChartTopArtistRepsonse } from '../../@types';
2
+ export declare function chartTopArtists(method: string, user: string, period: string, page: string, limit: string): Promise<ChartTopArtistRepsonse>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.chartTopArtists = void 0;
7
+ const createOptions_1 = require("../createOptions");
8
+ const request_1 = __importDefault(require("../request"));
9
+ async function chartTopArtists(method, user, period, page, limit) {
10
+ const options = (0, createOptions_1.createOptions)(method, user, period, page, limit);
11
+ return await (0, request_1.default)(options);
12
+ }
13
+ exports.chartTopArtists = chartTopArtists;
@@ -0,0 +1,2 @@
1
+ import { TagsResponse } from '../../@types';
2
+ export declare function chartTopTags(method: string, page: string): Promise<TagsResponse>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.chartTopTags = void 0;
7
+ const createOptions_1 = require("../createOptions");
8
+ const request_1 = __importDefault(require("../request"));
9
+ async function chartTopTags(method, page) {
10
+ const options = (0, createOptions_1.createOptions)(method, page);
11
+ return await (0, request_1.default)(options);
12
+ }
13
+ exports.chartTopTags = chartTopTags;
@@ -0,0 +1,2 @@
1
+ import { TopTrackResponse } from '../../@types';
2
+ export declare function chartTopTracks(method: string, page: string): Promise<TopTrackResponse>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.chartTopTracks = void 0;
7
+ const createOptions_1 = require("../createOptions");
8
+ const request_1 = __importDefault(require("../request"));
9
+ async function chartTopTracks(method, page) {
10
+ const options = (0, createOptions_1.createOptions)(method, page);
11
+ return await (0, request_1.default)(options);
12
+ }
13
+ exports.chartTopTracks = chartTopTracks;
@@ -18,4 +18,3 @@ export declare const config: {
18
18
  share_secret: string;
19
19
  username: string;
20
20
  };
21
- //# sourceMappingURL=config.d.ts.map
@@ -26,7 +26,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.config = void 0;
27
27
  const dotenv = __importStar(require("dotenv"));
28
28
  dotenv.config();
29
- ;
30
29
  /**
31
30
  * @description Stores the Last.fm API key, app name, base url, format, shared secret, and username.
32
31
  * Simply add a .env file to the root of the project and add the following:
@@ -0,0 +1,7 @@
1
+ export declare function createOptions(method: string, user: string, period?: string, limit?: string, page?: string): {
2
+ method: string;
3
+ page: string;
4
+ user: string;
5
+ period: string;
6
+ limit: string;
7
+ };
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createOptions = void 0;
4
- function createOptions(method, user, period, limit) {
4
+ function createOptions(method, user, period, limit, page) {
5
5
  return {
6
6
  method,
7
+ page,
7
8
  user,
8
9
  period,
9
10
  limit,
@@ -1,4 +1,4 @@
1
- import { UserResponse } from '../@types';
1
+ import { type UserResponse } from "../@types";
2
2
  /**
3
3
  * GET: User profile information - LastFM
4
4
  *
@@ -6,4 +6,3 @@ import { UserResponse } from '../@types';
6
6
  * @returns User profile information
7
7
  */
8
8
  export declare function getInfo(method: string, user: string): Promise<UserResponse>;
9
- //# sourceMappingURL=getInfo.d.ts.map
@@ -12,8 +12,8 @@ const request_1 = __importDefault(require("./request"));
12
12
  * https://www.last.fm/api/show/user.getInfo
13
13
  * @returns User profile information
14
14
  */
15
- function getInfo(method, user) {
15
+ async function getInfo(method, user) {
16
16
  const options = (0, createOptions_1.createOptions)(method, user);
17
- return (0, request_1.default)(options);
17
+ return await (0, request_1.default)(options);
18
18
  }
19
19
  exports.getInfo = getInfo;
@@ -1,4 +1,4 @@
1
- import { LovedTracksResponse } from '../@types';
1
+ import { type LovedTracksResponse } from '../@types';
2
2
  /**
3
3
  * GET: Love Tracks - LastFM
4
4
  *
@@ -6,4 +6,3 @@ import { LovedTracksResponse } from '../@types';
6
6
  * @returns Loved Tracks;
7
7
  */
8
8
  export declare function getLovedTracks(method: string, user: string, period: string, limit: string): Promise<LovedTracksResponse>;
9
- //# sourceMappingURL=getLovedTracks.d.ts.map
@@ -12,8 +12,8 @@ const request_1 = __importDefault(require("./request"));
12
12
  * https://www.last.fm/api/show/user.getLovedTracks
13
13
  * @returns Loved Tracks;
14
14
  */
15
- function getLovedTracks(method, user, period, limit) {
15
+ async function getLovedTracks(method, user, period, limit) {
16
16
  const options = (0, createOptions_1.createOptions)(method, user, period, limit);
17
- return (0, request_1.default)(options);
17
+ return await (0, request_1.default)(options);
18
18
  }
19
19
  exports.getLovedTracks = getLovedTracks;
@@ -1,4 +1,4 @@
1
- import { RecentTracksResponse } from '../@types';
1
+ import { type RecentTracksResponse } from '../@types';
2
2
  /**
3
3
  * GET: Recent Tracks - LastFM
4
4
  *
@@ -6,4 +6,3 @@ import { RecentTracksResponse } from '../@types';
6
6
  * @returns Recent Tracks
7
7
  */
8
8
  export declare function getRecentTracks(method: string, user: string, period: string, limit: string): Promise<RecentTracksResponse>;
9
- //# sourceMappingURL=getRecentTracks.d.ts.map
@@ -12,8 +12,8 @@ const request_1 = __importDefault(require("./request"));
12
12
  * https://www.last.fm/api/show/user.getRecentTracks
13
13
  * @returns Recent Tracks
14
14
  */
15
- function getRecentTracks(method, user, period, limit) {
15
+ async function getRecentTracks(method, user, period, limit) {
16
16
  const options = (0, createOptions_1.createOptions)(method, user, period, limit);
17
- return (0, request_1.default)(options);
17
+ return await (0, request_1.default)(options);
18
18
  }
19
19
  exports.getRecentTracks = getRecentTracks;
@@ -1,4 +1,4 @@
1
- import { TopAlbumsResponse } from '../@types';
1
+ import { type TopAlbumsResponse } from '../@types';
2
2
  /**
3
3
  * GET: Top Albums - LastFM
4
4
  *
@@ -6,4 +6,3 @@ import { TopAlbumsResponse } from '../@types';
6
6
  * @returns Top Albums
7
7
  */
8
8
  export declare function getTopAlbums(method: string, user: string, period: string, limit: string): Promise<TopAlbumsResponse>;
9
- //# sourceMappingURL=getTopAlbums.d.ts.map
@@ -12,8 +12,8 @@ const request_1 = __importDefault(require("./request"));
12
12
  * https://www.last.fm/api/show/user.getTopAlbums
13
13
  * @returns Top Albums
14
14
  */
15
- function getTopAlbums(method, user, period, limit) {
15
+ async function getTopAlbums(method, user, period, limit) {
16
16
  const options = (0, createOptions_1.createOptions)(method, user, period, limit);
17
- return (0, request_1.default)(options);
17
+ return await (0, request_1.default)(options);
18
18
  }
19
19
  exports.getTopAlbums = getTopAlbums;
@@ -1,4 +1,4 @@
1
- import { TopArtistsResponse } from '../@types';
1
+ import { type TopArtistsResponse } from '../@types';
2
2
  /**
3
3
  * GET: Top Artist - LastFM
4
4
  *
@@ -6,4 +6,3 @@ import { TopArtistsResponse } from '../@types';
6
6
  * @returns Top Artists
7
7
  */
8
8
  export declare function getTopArtists(method: string, user: string, period: string, limit: string): Promise<TopArtistsResponse>;
9
- //# sourceMappingURL=getTopArtists.d.ts.map
@@ -12,8 +12,8 @@ const request_1 = __importDefault(require("./request"));
12
12
  * https://www.last.fm/api/show/user.getTopArtists
13
13
  * @returns Top Artists
14
14
  */
15
- function getTopArtists(method, user, period, limit) {
15
+ async function getTopArtists(method, user, period, limit) {
16
16
  const options = (0, createOptions_1.createOptions)(method, user, period, limit);
17
- return (0, request_1.default)(options);
17
+ return await (0, request_1.default)(options);
18
18
  }
19
19
  exports.getTopArtists = getTopArtists;
@@ -1,4 +1,4 @@
1
- import { TopTrackResponse } from '../@types';
1
+ import { type TopTrackResponse } from '../@types';
2
2
  /**
3
3
  * GET: Top Tracks - LastFM
4
4
  *
@@ -6,4 +6,3 @@ import { TopTrackResponse } from '../@types';
6
6
  * @returns Top Tracks
7
7
  */
8
8
  export declare function getTopTracks(method: string, user: string, period: string, limit: string): Promise<TopTrackResponse>;
9
- //# sourceMappingURL=getTopTracks.d.ts.map
@@ -12,8 +12,8 @@ const request_1 = __importDefault(require("./request"));
12
12
  * https://www.last.fm/api/show/user.getTopTracks
13
13
  * @returns Top Tracks
14
14
  */
15
- function getTopTracks(method, user, period, limit) {
15
+ async function getTopTracks(method, user, period, limit) {
16
16
  const options = (0, createOptions_1.createOptions)(method, user, period, limit);
17
- return (0, request_1.default)(options);
17
+ return await (0, request_1.default)(options);
18
18
  }
19
19
  exports.getTopTracks = getTopTracks;
@@ -1,4 +1,4 @@
1
- import { WeeklyAlbumChartResponse } from '../@types';
1
+ import { type WeeklyAlbumChartResponse } from '../@types';
2
2
  /**
3
3
  * GET: Weekly album chart - LastFM
4
4
  *
@@ -6,4 +6,3 @@ import { WeeklyAlbumChartResponse } from '../@types';
6
6
  * @returns Weekly album chart
7
7
  */
8
8
  export declare function getWeeklyAlbumChart(method: string, user: string, period: string, limit: string): Promise<WeeklyAlbumChartResponse>;
9
- //# sourceMappingURL=getWeeklyAlbumChart.d.ts.map
@@ -12,8 +12,8 @@ const request_1 = __importDefault(require("./request"));
12
12
  * https://www.last.fm/api/show/user.getWeeklyAlbumChart
13
13
  * @returns Weekly album chart
14
14
  */
15
- function getWeeklyAlbumChart(method, user, period, limit) {
15
+ async function getWeeklyAlbumChart(method, user, period, limit) {
16
16
  const options = (0, createOptions_1.createOptions)(method, user, period, limit);
17
- return (0, request_1.default)(options);
17
+ return await (0, request_1.default)(options);
18
18
  }
19
19
  exports.getWeeklyAlbumChart = getWeeklyAlbumChart;
@@ -1,4 +1,4 @@
1
- import { WeeklyArtistChartResponse } from '../@types';
1
+ import { type WeeklyArtistChartResponse } from '../@types';
2
2
  /**
3
3
  * GET: Weekly artist chart - LastFM
4
4
  *
@@ -6,4 +6,3 @@ import { WeeklyArtistChartResponse } from '../@types';
6
6
  * @returns Weekly artist chart
7
7
  */
8
8
  export declare function getWeeklyArtistChart(method: string, user: string, period: string, limit: string): Promise<WeeklyArtistChartResponse>;
9
- //# sourceMappingURL=getWeeklyArtistChart.d.ts.map
@@ -12,8 +12,8 @@ const request_1 = __importDefault(require("./request"));
12
12
  * https://www.last.fm/api/show/user.getWeeklyArtistChart
13
13
  * @returns Weekly artist chart
14
14
  */
15
- function getWeeklyArtistChart(method, user, period, limit) {
15
+ async function getWeeklyArtistChart(method, user, period, limit) {
16
16
  const options = (0, createOptions_1.createOptions)(method, user, period, limit);
17
- return (0, request_1.default)(options);
17
+ return await (0, request_1.default)(options);
18
18
  }
19
19
  exports.getWeeklyArtistChart = getWeeklyArtistChart;
@@ -1,4 +1,4 @@
1
- import { WeeklyChartListResponse } from '../@types';
1
+ import { type WeeklyChartListResponse } from '../@types';
2
2
  /**
3
3
  * GET: Weekly chart list - LastFM
4
4
  *
@@ -6,4 +6,3 @@ import { WeeklyChartListResponse } from '../@types';
6
6
  * @returns Weekly chart list
7
7
  */
8
8
  export declare function getWeeklyChartList(method: string, user: string, period: string, limit: string): Promise<WeeklyChartListResponse>;
9
- //# sourceMappingURL=getWeeklyChartList.d.ts.map
@@ -12,8 +12,8 @@ const request_1 = __importDefault(require("./request"));
12
12
  * https://www.last.fm/api/show/user.getWeeklyChartList
13
13
  * @returns Weekly chart list
14
14
  */
15
- function getWeeklyChartList(method, user, period, limit) {
15
+ async function getWeeklyChartList(method, user, period, limit) {
16
16
  const options = (0, createOptions_1.createOptions)(method, user, period, limit);
17
- return (0, request_1.default)(options);
17
+ return await (0, request_1.default)(options);
18
18
  }
19
19
  exports.getWeeklyChartList = getWeeklyChartList;
@@ -1,4 +1,4 @@
1
- import { WeeklyTrackChartResponse } from '../@types';
1
+ import { type WeeklyTrackChartResponse } from '../@types';
2
2
  /**
3
3
  * GET: Weekly track chart - LastFM
4
4
  *
@@ -6,4 +6,3 @@ import { WeeklyTrackChartResponse } from '../@types';
6
6
  * @returns Weekly track chart
7
7
  */
8
8
  export declare function getWeeklyTrackChart(method: string, user: string, period: string, limit: string): Promise<WeeklyTrackChartResponse>;
9
- //# sourceMappingURL=getWeeklyTrackChart.d.ts.map
@@ -12,8 +12,8 @@ const request_1 = __importDefault(require("./request"));
12
12
  * https://www.last.fm/api/show/user.getWeeklyTrackChart
13
13
  * @returns Weekly track chart
14
14
  */
15
- function getWeeklyTrackChart(method, user, period, limit) {
15
+ async function getWeeklyTrackChart(method, user, period, limit) {
16
16
  const options = (0, createOptions_1.createOptions)(method, user, period, limit);
17
- return (0, request_1.default)(options);
17
+ return await (0, request_1.default)(options);
18
18
  }
19
19
  exports.getWeeklyTrackChart = getWeeklyTrackChart;
@@ -9,8 +9,16 @@ import { getWeeklyAlbumChart } from './getWeeklyAlbumChart';
9
9
  import { getWeeklyArtistChart } from './getWeeklyArtistChart';
10
10
  import { getWeeklyChartList } from './getWeeklyChartList';
11
11
  import { getWeeklyTrackChart } from './getWeeklyTrackChart';
12
- declare const LastFmApi: () => {
12
+ import { chartTopTags } from './chart/topTags';
13
+ import { chartTopTracks } from './chart/topTracks';
14
+ import { chartTopArtists } from './chart/topArtists';
15
+ export default function LastFmApi(): {
13
16
  auth: typeof auth;
17
+ chart: {
18
+ chartTopArtists: typeof chartTopArtists;
19
+ chartTopTracks: typeof chartTopTracks;
20
+ chartTopTags: typeof chartTopTags;
21
+ };
14
22
  config: {
15
23
  api_key: string;
16
24
  app_name: string;
@@ -34,6 +42,11 @@ declare const LastFmApi: () => {
34
42
  getWeeklyTrackChart: typeof getWeeklyTrackChart;
35
43
  method: {
36
44
  auth: string;
45
+ chart: {
46
+ getTopTracks: string;
47
+ getTopTags: string;
48
+ getTopArtists: string;
49
+ };
37
50
  user: {
38
51
  getInfo: string;
39
52
  getLovedTracks: string;
@@ -48,5 +61,3 @@ declare const LastFmApi: () => {
48
61
  };
49
62
  };
50
63
  };
51
- export default LastFmApi;
52
- //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const auth_1 = require("./auth");
4
+ const config_1 = require("./config");
5
+ const getInfo_1 = require("./getInfo");
6
+ const getLovedTracks_1 = require("./getLovedTracks");
7
+ const getRecentTracks_1 = require("./getRecentTracks");
8
+ const getTopAlbums_1 = require("./getTopAlbums");
9
+ const getTopArtists_1 = require("./getTopArtists");
10
+ const getTopTracks_1 = require("./getTopTracks");
11
+ const getWeeklyAlbumChart_1 = require("./getWeeklyAlbumChart");
12
+ const getWeeklyArtistChart_1 = require("./getWeeklyArtistChart");
13
+ const getWeeklyChartList_1 = require("./getWeeklyChartList");
14
+ const getWeeklyTrackChart_1 = require("./getWeeklyTrackChart");
15
+ const method_1 = require("./method");
16
+ const topTags_1 = require("./chart/topTags");
17
+ const topTracks_1 = require("./chart/topTracks");
18
+ const topArtists_1 = require("./chart/topArtists");
19
+ function LastFmApi() {
20
+ return {
21
+ auth: auth_1.auth,
22
+ chart: {
23
+ chartTopArtists: topArtists_1.chartTopArtists,
24
+ chartTopTracks: topTracks_1.chartTopTracks,
25
+ chartTopTags: topTags_1.chartTopTags,
26
+ },
27
+ config: config_1.config,
28
+ getInfo: getInfo_1.getInfo,
29
+ getLovedTracks: getLovedTracks_1.getLovedTracks,
30
+ getRecentTracks: getRecentTracks_1.getRecentTracks,
31
+ getTopAlbums: getTopAlbums_1.getTopAlbums,
32
+ getTopArtists: getTopArtists_1.getTopArtists,
33
+ getTopTracks: getTopTracks_1.getTopTracks,
34
+ getWeeklyAlbumChart: getWeeklyAlbumChart_1.getWeeklyAlbumChart,
35
+ getWeeklyArtistChart: getWeeklyArtistChart_1.getWeeklyArtistChart,
36
+ getWeeklyChartList: getWeeklyChartList_1.getWeeklyChartList,
37
+ getWeeklyTrackChart: getWeeklyTrackChart_1.getWeeklyTrackChart,
38
+ method: method_1.method,
39
+ };
40
+ }
41
+ exports.default = LastFmApi;
@@ -1,3 +1,8 @@
1
+ interface ChartMethod {
2
+ getTopArtists: string;
3
+ getTopTags: string;
4
+ getTopTracks: string;
5
+ }
1
6
  interface UserMethod {
2
7
  getInfo: string;
3
8
  getLovedTracks: string;
@@ -12,10 +17,16 @@ interface UserMethod {
12
17
  }
13
18
  export interface Method {
14
19
  auth: string;
20
+ chart: ChartMethod;
15
21
  user: UserMethod;
16
22
  }
17
23
  export declare const method: {
18
24
  auth: string;
25
+ chart: {
26
+ getTopTracks: string;
27
+ getTopTags: string;
28
+ getTopArtists: string;
29
+ };
19
30
  user: {
20
31
  getInfo: string;
21
32
  getLovedTracks: string;
@@ -30,4 +41,3 @@ export declare const method: {
30
41
  };
31
42
  };
32
43
  export {};
33
- //# sourceMappingURL=method.d.ts.map
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.method = void 0;
4
- ;
5
- ;
6
4
  exports.method = {
7
5
  auth: 'auth.getToken',
6
+ chart: {
7
+ getTopTracks: 'chart.getTopTracks',
8
+ getTopTags: 'chart.getTopTags',
9
+ getTopArtists: 'chart.getTopArtists',
10
+ },
8
11
  user: {
9
12
  getInfo: 'user.getInfo',
10
13
  getLovedTracks: 'user.getLovedTracks',
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }