lastfm-nodejs-client 1.2.4 → 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/@types/index.d.ts +16 -16
- package/CHANGELOG.md +30 -24
- package/README.md +4 -0
- 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 -181
- package/dist/method.d.ts +16 -0
- package/dist/method.js +2 -0
- package/dist/request.js +84 -3
- package/package.json +5 -4
- 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 -252
- package/src/method.ts +19 -1
- package/src/request.ts +90 -3
- package/tsconfig.json +1 -1
- package/src/types.d.ts +0 -392
package/@types/index.d.ts
CHANGED
|
@@ -374,19 +374,19 @@ export interface method {
|
|
|
374
374
|
};
|
|
375
375
|
}
|
|
376
376
|
|
|
377
|
-
export enum
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
}
|
|
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/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
- Updates npm dependencies.
|
|
6
|
+
- refactors request with new error handling and responses.
|
|
7
|
+
- updates getInfo, removes hte un-required params.
|
|
8
|
+
|
|
3
9
|
## 1.2.4
|
|
4
10
|
|
|
5
|
-
- Updates npm dependencies
|
|
11
|
+
- Updates npm dependencies.
|
|
6
12
|
- Refactors request methods options and updates all callsites.
|
|
7
13
|
- Add nvmrc file for easy switching node version.
|
|
8
14
|
|
|
9
15
|
## 1.2.3
|
|
10
16
|
|
|
11
|
-
- Adds tests, using Playwright
|
|
12
|
-
- Adds dotenv npm module as a new dependency
|
|
17
|
+
- Adds tests, using Playwright.
|
|
18
|
+
- Adds dotenv npm module as a new dependency.
|
|
13
19
|
|
|
14
20
|
## 1.2.2
|
|
15
21
|
|
|
@@ -17,7 +23,7 @@
|
|
|
17
23
|
|
|
18
24
|
## 1.2.1
|
|
19
25
|
|
|
20
|
-
- Tidy up, removes console logs
|
|
26
|
+
- Tidy up, removes console logs.
|
|
21
27
|
|
|
22
28
|
## 1.2.0
|
|
23
29
|
|
|
@@ -25,15 +31,15 @@
|
|
|
25
31
|
|
|
26
32
|
## 1.1.5
|
|
27
33
|
|
|
28
|
-
- Fix incorrect type on request method
|
|
34
|
+
- Fix incorrect type on request method.
|
|
29
35
|
|
|
30
36
|
## 1.1.4
|
|
31
37
|
|
|
32
|
-
- Fix incorrect type on request method
|
|
38
|
+
- Fix incorrect type on request method.
|
|
33
39
|
|
|
34
40
|
## 1.1.3
|
|
35
41
|
|
|
36
|
-
- Fix incorrect type import
|
|
42
|
+
- Fix incorrect type import.
|
|
37
43
|
|
|
38
44
|
## 1.1.2
|
|
39
45
|
|
|
@@ -41,44 +47,44 @@
|
|
|
41
47
|
|
|
42
48
|
## 1.1.1
|
|
43
49
|
|
|
44
|
-
- update function declaration
|
|
45
|
-
- re-add type declartion files for source code
|
|
50
|
+
- update function declaration.
|
|
51
|
+
- re-add type declartion files for source code.
|
|
46
52
|
|
|
47
53
|
## 1.1.0
|
|
48
54
|
|
|
49
|
-
- Downgrade node-fetch to v2.6.7
|
|
50
|
-
- Do not ship separate declaration files
|
|
51
|
-
- TS now exports to CommonJs modules for better support older consumers
|
|
55
|
+
- Downgrade node-fetch to v2.6.7.
|
|
56
|
+
- Do not ship separate declaration files.
|
|
57
|
+
- TS now exports to CommonJs modules for better support older consumers.
|
|
52
58
|
|
|
53
59
|
## 1.0.6
|
|
54
60
|
|
|
55
|
-
- Forking repo README update
|
|
61
|
+
- Forking repo README update.
|
|
56
62
|
|
|
57
63
|
## 1.0.5
|
|
58
64
|
|
|
59
|
-
- Fix local types
|
|
60
|
-
- Update readme with current way of using the types
|
|
61
|
-
- adds screenshot of it in use
|
|
65
|
+
- Fix local types.
|
|
66
|
+
- Update readme with current way of using the types.
|
|
67
|
+
- adds screenshot of it in use.
|
|
62
68
|
|
|
63
69
|
## 1.0.4
|
|
64
70
|
|
|
65
|
-
- Export types
|
|
71
|
+
- Export types.
|
|
66
72
|
|
|
67
73
|
## 1.0.3
|
|
68
74
|
|
|
69
|
-
- Adds types file to distribution
|
|
70
|
-
- Updates readme with types imports
|
|
75
|
+
- Adds types file to distribution.
|
|
76
|
+
- Updates readme with types imports.
|
|
71
77
|
|
|
72
78
|
## 1.0.2
|
|
73
79
|
|
|
74
|
-
- Refactors types.d.ts to types.ts so can ship them with package and consumers can import them in their projects
|
|
80
|
+
- Refactors types.d.ts to types.ts so can ship them with package and consumers can import them in their projects.
|
|
75
81
|
|
|
76
82
|
## 1.0.1
|
|
77
83
|
|
|
78
|
-
- Refactors config and methods to own modules
|
|
79
|
-
- tsconfig, generate types to allow shipping types in one package, no need to DefinitleyTyped right now
|
|
80
|
-
- update docs with new way of interacting with API
|
|
84
|
+
- Refactors config and methods to own modules.
|
|
85
|
+
- tsconfig, generate types to allow shipping types in one package, no need to DefinitleyTyped right now.
|
|
86
|
+
- update docs with new way of interacting with API.
|
|
81
87
|
|
|
82
88
|
## 1.0.0
|
|
83
89
|
|
|
84
|
-
- Initial project setup
|
|
90
|
+
- Initial project setup.
|
package/README.md
CHANGED
|
@@ -110,3 +110,7 @@ pnpm build
|
|
|
110
110
|
### Why I built this?
|
|
111
111
|
|
|
112
112
|
I was building a scrobbles page [https://mannuelferreira.com/scrobbles](https://mannuelferreira.com/scrobbles) and I thought others might want it to.
|
|
113
|
+
|
|
114
|
+
### TODO
|
|
115
|
+
|
|
116
|
+
- move types into [DefinitelyTyped](https://github.com/mannuelf/DefinitelyTyped)
|
package/bun.lockb
ADDED
|
Binary file
|
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
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>;
|
package/dist/auth.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
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.auth = void 0;
|
|
7
|
+
const createOptions_1 = require("./createOptions");
|
|
8
|
+
const request_1 = __importDefault(require("./request"));
|
|
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) {
|
|
20
|
+
const options = (0, createOptions_1.createOptions)(method, user, period, limit);
|
|
21
|
+
return (0, request_1.default)(options);
|
|
22
|
+
}
|
|
23
|
+
exports.auth = auth;
|
package/dist/config.js
CHANGED
|
@@ -25,6 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const dotenv = __importStar(require("dotenv"));
|
|
27
27
|
dotenv.config();
|
|
28
|
+
;
|
|
28
29
|
exports.default = {
|
|
29
30
|
api_key: `${process.env.LASTFM_API_KEY}`,
|
|
30
31
|
app_name: `${process.env.LASTFM_APPNAME}`,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createOptions = void 0;
|
|
4
|
+
function createOptions(method, user, period, limit) {
|
|
5
|
+
return {
|
|
6
|
+
method,
|
|
7
|
+
user,
|
|
8
|
+
period,
|
|
9
|
+
limit,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
exports.createOptions = createOptions;
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
package/dist/getInfo.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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.getInfo = void 0;
|
|
7
|
+
const createOptions_1 = require("./createOptions");
|
|
8
|
+
const request_1 = __importDefault(require("./request"));
|
|
9
|
+
/**
|
|
10
|
+
* GET: User profile information - LastFM
|
|
11
|
+
*
|
|
12
|
+
* https://www.last.fm/api/show/user.getInfo
|
|
13
|
+
* @returns User profile information
|
|
14
|
+
*/
|
|
15
|
+
function getInfo(method, user) {
|
|
16
|
+
const options = (0, createOptions_1.createOptions)(method, user);
|
|
17
|
+
return (0, request_1.default)(options);
|
|
18
|
+
}
|
|
19
|
+
exports.getInfo = getInfo;
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
@@ -0,0 +1,19 @@
|
|
|
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.getLovedTracks = void 0;
|
|
7
|
+
const createOptions_1 = require("./createOptions");
|
|
8
|
+
const request_1 = __importDefault(require("./request"));
|
|
9
|
+
/**
|
|
10
|
+
* GET: Love Tracks - LastFM
|
|
11
|
+
*
|
|
12
|
+
* https://www.last.fm/api/show/user.getLovedTracks
|
|
13
|
+
* @returns Loved Tracks;
|
|
14
|
+
*/
|
|
15
|
+
function getLovedTracks(method, user, period, limit) {
|
|
16
|
+
const options = (0, createOptions_1.createOptions)(method, user, period, limit);
|
|
17
|
+
return (0, request_1.default)(options);
|
|
18
|
+
}
|
|
19
|
+
exports.getLovedTracks = getLovedTracks;
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
@@ -0,0 +1,19 @@
|
|
|
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.getRecentTracks = void 0;
|
|
7
|
+
const createOptions_1 = require("./createOptions");
|
|
8
|
+
const request_1 = __importDefault(require("./request"));
|
|
9
|
+
/**
|
|
10
|
+
* GET: Recent Tracks - LastFM
|
|
11
|
+
*
|
|
12
|
+
* https://www.last.fm/api/show/user.getRecentTracks
|
|
13
|
+
* @returns Recent Tracks
|
|
14
|
+
*/
|
|
15
|
+
function getRecentTracks(method, user, period, limit) {
|
|
16
|
+
const options = (0, createOptions_1.createOptions)(method, user, period, limit);
|
|
17
|
+
return (0, request_1.default)(options);
|
|
18
|
+
}
|
|
19
|
+
exports.getRecentTracks = getRecentTracks;
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
@@ -0,0 +1,19 @@
|
|
|
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.getTopAlbums = void 0;
|
|
7
|
+
const createOptions_1 = require("./createOptions");
|
|
8
|
+
const request_1 = __importDefault(require("./request"));
|
|
9
|
+
/**
|
|
10
|
+
* GET: Top Albums - LastFM
|
|
11
|
+
*
|
|
12
|
+
* https://www.last.fm/api/show/user.getTopAlbums
|
|
13
|
+
* @returns Top Albums
|
|
14
|
+
*/
|
|
15
|
+
function getTopAlbums(method, user, period, limit) {
|
|
16
|
+
const options = (0, createOptions_1.createOptions)(method, user, period, limit);
|
|
17
|
+
return (0, request_1.default)(options);
|
|
18
|
+
}
|
|
19
|
+
exports.getTopAlbums = getTopAlbums;
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
@@ -0,0 +1,19 @@
|
|
|
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.getTopArtists = void 0;
|
|
7
|
+
const createOptions_1 = require("./createOptions");
|
|
8
|
+
const request_1 = __importDefault(require("./request"));
|
|
9
|
+
/**
|
|
10
|
+
* GET: Top Artist - LastFM
|
|
11
|
+
*
|
|
12
|
+
* https://www.last.fm/api/show/user.getTopArtists
|
|
13
|
+
* @returns Top Artists
|
|
14
|
+
*/
|
|
15
|
+
function getTopArtists(method, user, period, limit) {
|
|
16
|
+
const options = (0, createOptions_1.createOptions)(method, user, period, limit);
|
|
17
|
+
return (0, request_1.default)(options);
|
|
18
|
+
}
|
|
19
|
+
exports.getTopArtists = getTopArtists;
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
@@ -0,0 +1,19 @@
|
|
|
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.getTopTracks = void 0;
|
|
7
|
+
const createOptions_1 = require("./createOptions");
|
|
8
|
+
const request_1 = __importDefault(require("./request"));
|
|
9
|
+
/**
|
|
10
|
+
* GET: Top Tracks - LastFM
|
|
11
|
+
*
|
|
12
|
+
* https://www.last.fm/api/show/user.getTopTracks
|
|
13
|
+
* @returns Top Tracks
|
|
14
|
+
*/
|
|
15
|
+
function getTopTracks(method, user, period, limit) {
|
|
16
|
+
const options = (0, createOptions_1.createOptions)(method, user, period, limit);
|
|
17
|
+
return (0, request_1.default)(options);
|
|
18
|
+
}
|
|
19
|
+
exports.getTopTracks = getTopTracks;
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
@@ -0,0 +1,19 @@
|
|
|
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.getWeeklyAlbumChart = void 0;
|
|
7
|
+
const createOptions_1 = require("./createOptions");
|
|
8
|
+
const request_1 = __importDefault(require("./request"));
|
|
9
|
+
/**
|
|
10
|
+
* GET: Weekly album chart - LastFM
|
|
11
|
+
*
|
|
12
|
+
* https://www.last.fm/api/show/user.getWeeklyAlbumChart
|
|
13
|
+
* @returns Weekly album chart
|
|
14
|
+
*/
|
|
15
|
+
function getWeeklyAlbumChart(method, user, period, limit) {
|
|
16
|
+
const options = (0, createOptions_1.createOptions)(method, user, period, limit);
|
|
17
|
+
return (0, request_1.default)(options);
|
|
18
|
+
}
|
|
19
|
+
exports.getWeeklyAlbumChart = getWeeklyAlbumChart;
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
@@ -0,0 +1,19 @@
|
|
|
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.getWeeklyArtistChart = void 0;
|
|
7
|
+
const createOptions_1 = require("./createOptions");
|
|
8
|
+
const request_1 = __importDefault(require("./request"));
|
|
9
|
+
/**
|
|
10
|
+
* GET: Weekly artist chart - LastFM
|
|
11
|
+
*
|
|
12
|
+
* https://www.last.fm/api/show/user.getWeeklyArtistChart
|
|
13
|
+
* @returns Weekly artist chart
|
|
14
|
+
*/
|
|
15
|
+
function getWeeklyArtistChart(method, user, period, limit) {
|
|
16
|
+
const options = (0, createOptions_1.createOptions)(method, user, period, limit);
|
|
17
|
+
return (0, request_1.default)(options);
|
|
18
|
+
}
|
|
19
|
+
exports.getWeeklyArtistChart = getWeeklyArtistChart;
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
@@ -0,0 +1,19 @@
|
|
|
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.getWeeklyChartList = void 0;
|
|
7
|
+
const createOptions_1 = require("./createOptions");
|
|
8
|
+
const request_1 = __importDefault(require("./request"));
|
|
9
|
+
/**
|
|
10
|
+
* GET: Weekly chart list - LastFM
|
|
11
|
+
*
|
|
12
|
+
* https://www.last.fm/api/show/user.getWeeklyChartList
|
|
13
|
+
* @returns Weekly chart list
|
|
14
|
+
*/
|
|
15
|
+
function getWeeklyChartList(method, user, period, limit) {
|
|
16
|
+
const options = (0, createOptions_1.createOptions)(method, user, period, limit);
|
|
17
|
+
return (0, request_1.default)(options);
|
|
18
|
+
}
|
|
19
|
+
exports.getWeeklyChartList = getWeeklyChartList;
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
@@ -0,0 +1,19 @@
|
|
|
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.getWeeklyTrackChart = void 0;
|
|
7
|
+
const createOptions_1 = require("./createOptions");
|
|
8
|
+
const request_1 = __importDefault(require("./request"));
|
|
9
|
+
/**
|
|
10
|
+
* GET: Weekly track chart - LastFM
|
|
11
|
+
*
|
|
12
|
+
* https://www.last.fm/api/show/user.getWeeklyTrackChart
|
|
13
|
+
* @returns Weekly track chart
|
|
14
|
+
*/
|
|
15
|
+
function getWeeklyTrackChart(method, user, period, limit) {
|
|
16
|
+
const options = (0, createOptions_1.createOptions)(method, user, period, limit);
|
|
17
|
+
return (0, request_1.default)(options);
|
|
18
|
+
}
|
|
19
|
+
exports.getWeeklyTrackChart = getWeeklyTrackChart;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
+
export default function LastFmApi(): {
|
|
13
|
+
auth: typeof auth;
|
|
4
14
|
config: {
|
|
5
15
|
api_key: string;
|
|
6
16
|
app_name: string;
|
|
@@ -12,16 +22,16 @@ declare function LastFmApi(): {
|
|
|
12
22
|
share_secret: string;
|
|
13
23
|
username: string;
|
|
14
24
|
};
|
|
15
|
-
getInfo:
|
|
16
|
-
getLovedTracks:
|
|
17
|
-
getRecentTracks:
|
|
18
|
-
getTopAlbums:
|
|
19
|
-
getTopArtists:
|
|
20
|
-
getTopTracks:
|
|
21
|
-
getWeeklyAlbumChart:
|
|
22
|
-
getWeeklyArtistChart:
|
|
23
|
-
getWeeklyChartList:
|
|
24
|
-
getWeeklyTrackChart:
|
|
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;
|
|
25
35
|
method: {
|
|
26
36
|
auth: string;
|
|
27
37
|
user: {
|
|
@@ -38,4 +48,3 @@ declare function LastFmApi(): {
|
|
|
38
48
|
};
|
|
39
49
|
};
|
|
40
50
|
};
|
|
41
|
-
export default LastFmApi;
|