lastfm-nodejs-client 1.3.0 → 1.4.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/.env.example +6 -5
- package/@types/index.d.ts +3 -3
- package/CHANGELOG.md +4 -0
- package/dist/config.js +11 -1
- package/dist/index.js +4 -7
- package/dist/method.js +11 -10
- package/dist/request.js +8 -5
- package/package.json +5 -5
- package/src/config.ts +10 -2
- package/src/index.ts +2 -2
- package/src/method.ts +19 -19
- package/src/request.ts +6 -2
- package/tsconfig.json +6 -6
- package/bun.lockb +0 -0
- package/dist/auth.d.ts +0 -12
- package/dist/config.d.ts +0 -12
- package/dist/createOptions.d.ts +0 -6
- package/dist/getInfo.d.ts +0 -8
- package/dist/getLovedTracks.d.ts +0 -8
- package/dist/getRecentTracks.d.ts +0 -8
- package/dist/getTopAlbums.d.ts +0 -8
- package/dist/getTopArtists.d.ts +0 -8
- package/dist/getTopTracks.d.ts +0 -8
- package/dist/getWeeklyAlbumChart.d.ts +0 -8
- package/dist/getWeeklyArtistChart.d.ts +0 -8
- package/dist/getWeeklyChartList.d.ts +0 -8
- package/dist/getWeeklyTrackChart.d.ts +0 -8
- package/dist/index.d.ts +0 -50
- package/dist/method.d.ts +0 -32
- package/dist/request.d.ts +0 -8
package/.env.example
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
LASTFM_API_BASE_URL=
|
|
2
|
-
LASTFM_API_KEY=
|
|
3
|
-
LASTFM_APPNAME=
|
|
4
|
-
LASTFM_SHARED_SECRET=
|
|
5
|
-
LASTFM_USER=
|
|
1
|
+
LASTFM_API_BASE_URL=https://ws.audioscrobbler.com/2.0/
|
|
2
|
+
LASTFM_API_KEY=f7177932c78b9723d54e617d0d5695ee
|
|
3
|
+
LASTFM_APPNAME=music-wall
|
|
4
|
+
LASTFM_SHARED_SECRET=bcffbbc0ba4af16fc00415c94b138c74
|
|
5
|
+
LASTFM_USER=mannuelf
|
|
6
|
+
LASTFM_REGISTERTO=mannuelf
|
package/@types/index.d.ts
CHANGED
|
@@ -108,7 +108,7 @@ export type Artist = {
|
|
|
108
108
|
rank: number;
|
|
109
109
|
};
|
|
110
110
|
cover: ArtistImage;
|
|
111
|
-
image?:
|
|
111
|
+
image?: Image[];
|
|
112
112
|
mbid: string;
|
|
113
113
|
name: string;
|
|
114
114
|
playcount: number;
|
|
@@ -278,7 +278,7 @@ export interface WeeklyTrackChartAttr2 {
|
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
export const LastFmApi: () => {
|
|
281
|
-
auth: (method: string, user: string
|
|
281
|
+
auth: (method: string, user: string) => Promise<AuthResponse>;
|
|
282
282
|
config: {
|
|
283
283
|
api_key: string;
|
|
284
284
|
app_name: string;
|
|
@@ -290,7 +290,7 @@ export const LastFmApi: () => {
|
|
|
290
290
|
share_secret: string;
|
|
291
291
|
username: string;
|
|
292
292
|
};
|
|
293
|
-
getInfo: (method: string, user: string
|
|
293
|
+
getInfo: (method: string, user: string) => Promise<UserResponse>;
|
|
294
294
|
getLovedTracks: (
|
|
295
295
|
method: string,
|
|
296
296
|
user: string,
|
package/CHANGELOG.md
CHANGED
package/dist/config.js
CHANGED
|
@@ -23,10 +23,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.config = void 0;
|
|
26
27
|
const dotenv = __importStar(require("dotenv"));
|
|
27
28
|
dotenv.config();
|
|
28
29
|
;
|
|
29
|
-
|
|
30
|
+
/**
|
|
31
|
+
* @description Stores the Last.fm API key, app name, base url, format, shared secret, and username.
|
|
32
|
+
* Simply add a .env file to the root of the project and add the following:
|
|
33
|
+
* LASTFM_API_KEY=your_api_key
|
|
34
|
+
* LASTFM_APPNAME=your_app_name
|
|
35
|
+
* LASTFM_API_BASE_URL=your_base_url
|
|
36
|
+
* LASTFM_SHARED_SECRET=your_shared_secret
|
|
37
|
+
* LASTFM_USER=your_username
|
|
38
|
+
*/
|
|
39
|
+
exports.config = {
|
|
30
40
|
api_key: `${process.env.LASTFM_API_KEY}`,
|
|
31
41
|
app_name: `${process.env.LASTFM_APPNAME}`,
|
|
32
42
|
base_url: `${process.env.LASTFM_API_BASE_URL}`,
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
const auth_1 = require("./auth");
|
|
7
|
-
const config_1 =
|
|
4
|
+
const config_1 = require("./config");
|
|
8
5
|
const getInfo_1 = require("./getInfo");
|
|
9
6
|
const getLovedTracks_1 = require("./getLovedTracks");
|
|
10
7
|
const getRecentTracks_1 = require("./getRecentTracks");
|
|
@@ -15,11 +12,11 @@ const getWeeklyAlbumChart_1 = require("./getWeeklyAlbumChart");
|
|
|
15
12
|
const getWeeklyArtistChart_1 = require("./getWeeklyArtistChart");
|
|
16
13
|
const getWeeklyChartList_1 = require("./getWeeklyChartList");
|
|
17
14
|
const getWeeklyTrackChart_1 = require("./getWeeklyTrackChart");
|
|
18
|
-
const method_1 =
|
|
15
|
+
const method_1 = require("./method");
|
|
19
16
|
function LastFmApi() {
|
|
20
17
|
return {
|
|
21
18
|
auth: auth_1.auth,
|
|
22
|
-
config: config_1.
|
|
19
|
+
config: config_1.config,
|
|
23
20
|
getInfo: getInfo_1.getInfo,
|
|
24
21
|
getLovedTracks: getLovedTracks_1.getLovedTracks,
|
|
25
22
|
getRecentTracks: getRecentTracks_1.getRecentTracks,
|
|
@@ -30,7 +27,7 @@ function LastFmApi() {
|
|
|
30
27
|
getWeeklyArtistChart: getWeeklyArtistChart_1.getWeeklyArtistChart,
|
|
31
28
|
getWeeklyChartList: getWeeklyChartList_1.getWeeklyChartList,
|
|
32
29
|
getWeeklyTrackChart: getWeeklyTrackChart_1.getWeeklyTrackChart,
|
|
33
|
-
method: method_1.
|
|
30
|
+
method: method_1.method,
|
|
34
31
|
};
|
|
35
32
|
}
|
|
36
33
|
exports.default = LastFmApi;
|
package/dist/method.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.method = void 0;
|
|
3
4
|
;
|
|
4
5
|
;
|
|
5
|
-
exports.
|
|
6
|
+
exports.method = {
|
|
6
7
|
auth: 'auth.getToken',
|
|
7
8
|
user: {
|
|
8
9
|
getInfo: 'user.getInfo',
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
getLovedTracks: 'user.getLovedTracks',
|
|
11
|
+
getRecentTracks: 'user.getRecentTracks',
|
|
12
|
+
getTopAlbums: 'user.getTopAlbums',
|
|
13
|
+
getTopArtists: 'user.getTopArtists',
|
|
14
|
+
getTopTracks: 'user.getTopTracks',
|
|
15
|
+
getWeeklyAlbumChart: 'user.getWeeklyAlbumChart',
|
|
16
|
+
getWeeklyArtistChart: 'user.getWeeklyArtistChart',
|
|
17
|
+
getWeeklyChartList: 'user.getWeeklyChartList',
|
|
18
|
+
getWeeklyTrackChart: 'user.getWeeklyTrackChart',
|
|
18
19
|
},
|
|
19
20
|
};
|
package/dist/request.js
CHANGED
|
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
|
16
|
-
const config_1 =
|
|
16
|
+
const config_1 = require("./config");
|
|
17
17
|
var ErrorResponse;
|
|
18
18
|
(function (ErrorResponse) {
|
|
19
19
|
ErrorResponse[ErrorResponse["InvalidService"] = 2] = "InvalidService";
|
|
@@ -40,9 +40,9 @@ const buildUrl = (options) => {
|
|
|
40
40
|
params.append('period', options.period);
|
|
41
41
|
if (options.limit)
|
|
42
42
|
params.append('limit', options.limit);
|
|
43
|
-
params.append('api_key', config_1.
|
|
44
|
-
params.append('format', config_1.
|
|
45
|
-
return `${config_1.
|
|
43
|
+
params.append('api_key', config_1.config.api_key);
|
|
44
|
+
params.append('format', config_1.config.format.json);
|
|
45
|
+
return `${config_1.config.base_url}?${params.toString()}`;
|
|
46
46
|
};
|
|
47
47
|
const request = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
48
|
const url = buildUrl(options);
|
|
@@ -52,6 +52,9 @@ const request = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
52
52
|
},
|
|
53
53
|
})
|
|
54
54
|
.then((res) => {
|
|
55
|
+
if (!res.ok) {
|
|
56
|
+
throw new Error(res.statusText);
|
|
57
|
+
}
|
|
55
58
|
switch (res.status) {
|
|
56
59
|
case 200: {
|
|
57
60
|
return res.json();
|
|
@@ -123,7 +126,7 @@ const request = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
123
126
|
})
|
|
124
127
|
.then((json) => json)
|
|
125
128
|
.catch((error) => {
|
|
126
|
-
console.log(error);
|
|
129
|
+
console.log('🚨 error:', error);
|
|
127
130
|
}));
|
|
128
131
|
});
|
|
129
132
|
exports.default = request;
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lastfm-nodejs-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
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
6
|
"scripts": {
|
|
7
7
|
"build": "rimraf dist && tsc",
|
|
8
8
|
"clean": "rimraf dist",
|
|
9
9
|
"dev": "npm run clean && tsc --watch --project tsconfig.dev.json",
|
|
10
|
+
"publish": "npm run build && npm publish --access public",
|
|
10
11
|
"test": "npx playwright test --reporter=list"
|
|
11
12
|
},
|
|
12
13
|
"keywords": [
|
|
@@ -27,10 +28,9 @@
|
|
|
27
28
|
"rimraf": "^5.0.1"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
|
-
"@playwright/test": "^1.
|
|
31
|
-
"@types/node": "^20.6.
|
|
32
|
-
"typescript": "^5.2.2"
|
|
33
|
-
"bun-types": "latest"
|
|
31
|
+
"@playwright/test": "^1.38.0",
|
|
32
|
+
"@types/node": "^20.6.2",
|
|
33
|
+
"typescript": "^5.2.2"
|
|
34
34
|
},
|
|
35
35
|
"repository": {
|
|
36
36
|
"type": "git",
|
package/src/config.ts
CHANGED
|
@@ -12,8 +12,16 @@ interface Config {
|
|
|
12
12
|
share_secret: string;
|
|
13
13
|
username: string;
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* @description Stores the Last.fm API key, app name, base url, format, shared secret, and username.
|
|
17
|
+
* Simply add a .env file to the root of the project and add the following:
|
|
18
|
+
* LASTFM_API_KEY=your_api_key
|
|
19
|
+
* LASTFM_APPNAME=your_app_name
|
|
20
|
+
* LASTFM_API_BASE_URL=your_base_url
|
|
21
|
+
* LASTFM_SHARED_SECRET=your_shared_secret
|
|
22
|
+
* LASTFM_USER=your_username
|
|
23
|
+
*/
|
|
24
|
+
export const config = {
|
|
17
25
|
api_key: `${process.env.LASTFM_API_KEY}`,
|
|
18
26
|
app_name: `${process.env.LASTFM_APPNAME}`,
|
|
19
27
|
base_url: `${process.env.LASTFM_API_BASE_URL}`,
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { auth } from './auth';
|
|
2
|
-
import config from './config';
|
|
2
|
+
import { config } from './config';
|
|
3
3
|
import { getInfo } from './getInfo';
|
|
4
4
|
import { getLovedTracks } from './getLovedTracks';
|
|
5
5
|
import { getRecentTracks } from './getRecentTracks';
|
|
@@ -10,7 +10,7 @@ import { getWeeklyAlbumChart } from './getWeeklyAlbumChart';
|
|
|
10
10
|
import { getWeeklyArtistChart } from './getWeeklyArtistChart';
|
|
11
11
|
import { getWeeklyChartList } from './getWeeklyChartList';
|
|
12
12
|
import { getWeeklyTrackChart } from './getWeeklyTrackChart';
|
|
13
|
-
import method from './method';
|
|
13
|
+
import { method } from './method';
|
|
14
14
|
|
|
15
15
|
export default function LastFmApi() {
|
|
16
16
|
return {
|
package/src/method.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
interface UserMethod {
|
|
2
2
|
getInfo: string;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
12
|
};
|
|
13
13
|
|
|
14
14
|
export interface Method {
|
|
@@ -16,18 +16,18 @@ export interface Method {
|
|
|
16
16
|
user: UserMethod;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
export
|
|
19
|
+
export const method = {
|
|
20
20
|
auth: 'auth.getToken',
|
|
21
21
|
user: {
|
|
22
22
|
getInfo: 'user.getInfo',
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
getLovedTracks: 'user.getLovedTracks',
|
|
24
|
+
getRecentTracks: 'user.getRecentTracks',
|
|
25
|
+
getTopAlbums: 'user.getTopAlbums',
|
|
26
|
+
getTopArtists: 'user.getTopArtists',
|
|
27
|
+
getTopTracks: 'user.getTopTracks',
|
|
28
|
+
getWeeklyAlbumChart: 'user.getWeeklyAlbumChart',
|
|
29
|
+
getWeeklyArtistChart: 'user.getWeeklyArtistChart',
|
|
30
|
+
getWeeklyChartList: 'user.getWeeklyChartList',
|
|
31
|
+
getWeeklyTrackChart: 'user.getWeeklyTrackChart',
|
|
32
32
|
},
|
|
33
33
|
} satisfies Method;
|
package/src/request.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fetch from 'cross-fetch';
|
|
2
|
-
import config from './config';
|
|
2
|
+
import { config } from './config';
|
|
3
3
|
|
|
4
4
|
interface RequestOptions {
|
|
5
5
|
method: string;
|
|
@@ -49,6 +49,10 @@ const request = async <Response>(options: RequestOptions): Promise<Response> =>
|
|
|
49
49
|
},
|
|
50
50
|
})
|
|
51
51
|
.then((res) => {
|
|
52
|
+
if(!res.ok) {
|
|
53
|
+
throw new Error(res.statusText);
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
switch (res.status) {
|
|
53
57
|
case 200: {
|
|
54
58
|
return res.json();
|
|
@@ -122,7 +126,7 @@ const request = async <Response>(options: RequestOptions): Promise<Response> =>
|
|
|
122
126
|
})
|
|
123
127
|
.then((json) => json)
|
|
124
128
|
.catch((error) => {
|
|
125
|
-
console.log(error);
|
|
129
|
+
console.log('🚨 error:', error);
|
|
126
130
|
})) as Response;
|
|
127
131
|
};
|
|
128
132
|
|
package/tsconfig.json
CHANGED
|
@@ -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": "
|
|
29
|
+
"module": "NodeNext" /* Specify what module code is generated. */,
|
|
30
30
|
"rootDir": "./src" /* Specify the root folder within your source files. */,
|
|
31
|
-
"moduleResolution": "
|
|
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,8 +45,8 @@
|
|
|
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":
|
|
49
|
-
|
|
48
|
+
"declaration": false /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
|
|
49
|
+
"declarationMap": false, /* 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. */
|
|
@@ -55,7 +55,7 @@
|
|
|
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
|
-
|
|
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. */
|
|
@@ -101,4 +101,4 @@
|
|
|
101
101
|
"skipDefaultLibCheck": true /* Skip type checking .d.ts files that are included with TypeScript. */,
|
|
102
102
|
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
103
103
|
}
|
|
104
|
-
}
|
|
104
|
+
}
|
package/bun.lockb
DELETED
|
Binary file
|
package/dist/auth.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
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/config.d.ts
DELETED
package/dist/createOptions.d.ts
DELETED
package/dist/getInfo.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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/getLovedTracks.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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>;
|
|
@@ -1,8 +0,0 @@
|
|
|
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>;
|
package/dist/getTopAlbums.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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>;
|
package/dist/getTopArtists.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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>;
|
package/dist/getTopTracks.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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>;
|
|
@@ -1,8 +0,0 @@
|
|
|
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>;
|
|
@@ -1,8 +0,0 @@
|
|
|
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>;
|
|
@@ -1,8 +0,0 @@
|
|
|
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>;
|
|
@@ -1,8 +0,0 @@
|
|
|
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>;
|
package/dist/index.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
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;
|
|
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
|
-
loved_tracks: string;
|
|
40
|
-
recent_tracks: string;
|
|
41
|
-
top_albums: string;
|
|
42
|
-
top_artists: string;
|
|
43
|
-
top_tracks: string;
|
|
44
|
-
weekly_album_chart: string;
|
|
45
|
-
weekly_artist_chart: string;
|
|
46
|
-
weekly_chart_list: string;
|
|
47
|
-
weekly_track_chart: string;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
};
|
package/dist/method.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
interface UserMethod {
|
|
2
|
-
getInfo: string;
|
|
3
|
-
loved_tracks: string;
|
|
4
|
-
recent_tracks: string;
|
|
5
|
-
top_albums: string;
|
|
6
|
-
top_artists: string;
|
|
7
|
-
top_tracks: string;
|
|
8
|
-
weekly_album_chart: string;
|
|
9
|
-
weekly_artist_chart: string;
|
|
10
|
-
weekly_chart_list: string;
|
|
11
|
-
weekly_track_chart: string;
|
|
12
|
-
}
|
|
13
|
-
export interface Method {
|
|
14
|
-
auth: string;
|
|
15
|
-
user: UserMethod;
|
|
16
|
-
}
|
|
17
|
-
declare const _default: {
|
|
18
|
-
auth: string;
|
|
19
|
-
user: {
|
|
20
|
-
getInfo: string;
|
|
21
|
-
loved_tracks: string;
|
|
22
|
-
recent_tracks: string;
|
|
23
|
-
top_albums: string;
|
|
24
|
-
top_artists: string;
|
|
25
|
-
top_tracks: string;
|
|
26
|
-
weekly_album_chart: string;
|
|
27
|
-
weekly_artist_chart: string;
|
|
28
|
-
weekly_chart_list: string;
|
|
29
|
-
weekly_track_chart: string;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
export default _default;
|