lastfm-nodejs-client 1.4.2 → 1.4.4
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/README.md +14 -2
- package/dist/cjs/auth.d.ts +12 -0
- package/dist/{auth.js → cjs/auth.js} +11 -11
- package/dist/cjs/chart/topArtists.d.ts +2 -0
- package/dist/cjs/chart/topArtists.js +13 -0
- package/dist/cjs/chart/topTags.d.ts +2 -0
- package/dist/cjs/chart/topTags.js +13 -0
- package/dist/cjs/chart/topTracks.d.ts +2 -0
- package/dist/cjs/chart/topTracks.js +13 -0
- package/dist/{config.d.ts → cjs/config.d.ts} +0 -1
- package/dist/{config.js → cjs/config.js} +0 -1
- package/dist/cjs/createOptions.d.ts +7 -0
- package/dist/{createOptions.js → cjs/createOptions.js} +2 -1
- package/dist/{getInfo.d.ts → cjs/getInfo.d.ts} +1 -2
- package/dist/{getInfo.js → cjs/getInfo.js} +2 -2
- package/dist/{getLovedTracks.d.ts → cjs/getLovedTracks.d.ts} +1 -2
- package/dist/{getLovedTracks.js → cjs/getLovedTracks.js} +2 -2
- package/dist/{getRecentTracks.d.ts → cjs/getRecentTracks.d.ts} +1 -2
- package/dist/{getRecentTracks.js → cjs/getRecentTracks.js} +2 -2
- package/dist/{getTopAlbums.d.ts → cjs/getTopAlbums.d.ts} +1 -2
- package/dist/{getTopAlbums.js → cjs/getTopAlbums.js} +2 -2
- package/dist/{getTopArtists.d.ts → cjs/getTopArtists.d.ts} +1 -2
- package/dist/{getTopArtists.js → cjs/getTopArtists.js} +2 -2
- package/dist/{getTopTracks.d.ts → cjs/getTopTracks.d.ts} +1 -2
- package/dist/{getTopTracks.js → cjs/getTopTracks.js} +2 -2
- package/dist/{getWeeklyAlbumChart.d.ts → cjs/getWeeklyAlbumChart.d.ts} +1 -2
- package/dist/{getWeeklyAlbumChart.js → cjs/getWeeklyAlbumChart.js} +2 -2
- package/dist/{getWeeklyArtistChart.d.ts → cjs/getWeeklyArtistChart.d.ts} +1 -2
- package/dist/{getWeeklyArtistChart.js → cjs/getWeeklyArtistChart.js} +2 -2
- package/dist/{getWeeklyChartList.d.ts → cjs/getWeeklyChartList.d.ts} +1 -2
- package/dist/{getWeeklyChartList.js → cjs/getWeeklyChartList.js} +2 -2
- package/dist/{getWeeklyTrackChart.d.ts → cjs/getWeeklyTrackChart.d.ts} +1 -2
- package/dist/{getWeeklyTrackChart.js → cjs/getWeeklyTrackChart.js} +2 -2
- package/dist/{index.d.ts → cjs/index.d.ts} +14 -3
- package/dist/cjs/index.js +41 -0
- package/dist/{method.d.ts → cjs/method.d.ts} +11 -1
- package/dist/{method.js → cjs/method.js} +5 -2
- package/dist/cjs/package.json +3 -0
- package/dist/{request.d.ts → cjs/request.d.ts} +0 -1
- package/dist/{request.js → cjs/request.js} +7 -15
- package/dist/mjs/auth.d.ts +12 -0
- package/dist/mjs/auth.js +16 -0
- package/dist/mjs/chart/topArtists.d.ts +2 -0
- package/dist/mjs/chart/topArtists.js +6 -0
- package/dist/mjs/chart/topTags.d.ts +2 -0
- package/dist/mjs/chart/topTags.js +6 -0
- package/dist/mjs/chart/topTracks.d.ts +2 -0
- package/dist/mjs/chart/topTracks.js +6 -0
- package/dist/mjs/config.d.ts +20 -0
- package/dist/mjs/config.js +22 -0
- package/dist/mjs/createOptions.d.ts +7 -0
- package/dist/mjs/createOptions.js +9 -0
- package/dist/mjs/getInfo.d.ts +8 -0
- package/dist/mjs/getInfo.js +12 -0
- package/dist/mjs/getLovedTracks.d.ts +8 -0
- package/dist/mjs/getLovedTracks.js +12 -0
- package/dist/mjs/getRecentTracks.d.ts +8 -0
- package/dist/mjs/getRecentTracks.js +12 -0
- package/dist/mjs/getTopAlbums.d.ts +8 -0
- package/dist/mjs/getTopAlbums.js +12 -0
- package/dist/mjs/getTopArtists.d.ts +8 -0
- package/dist/mjs/getTopArtists.js +12 -0
- package/dist/mjs/getTopTracks.d.ts +8 -0
- package/dist/mjs/getTopTracks.js +12 -0
- package/dist/mjs/getWeeklyAlbumChart.d.ts +8 -0
- package/dist/mjs/getWeeklyAlbumChart.js +12 -0
- package/dist/mjs/getWeeklyArtistChart.d.ts +8 -0
- package/dist/mjs/getWeeklyArtistChart.js +12 -0
- package/dist/mjs/getWeeklyChartList.d.ts +8 -0
- package/dist/mjs/getWeeklyChartList.js +12 -0
- package/dist/mjs/getWeeklyTrackChart.d.ts +8 -0
- package/dist/mjs/getWeeklyTrackChart.js +12 -0
- package/dist/mjs/index.d.ts +63 -0
- package/{src/index.ts → dist/mjs/index.js} +25 -18
- package/dist/mjs/method.d.ts +43 -0
- package/dist/mjs/method.js +20 -0
- package/dist/mjs/package.json +3 -0
- package/dist/mjs/request.d.ts +8 -0
- package/dist/mjs/request.js +119 -0
- package/lastfm-nodejs-client/package.json +7 -0
- package/package.json +41 -13
- package/.env.example +0 -6
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/dependabot.yml +0 -11
- package/.github/workflows/codeql.yml +0 -74
- package/.github/workflows/playwright.yml +0 -36
- package/.nvmrc +0 -1
- package/.prettierrc.yaml +0 -6
- package/@types/index.d.ts +0 -392
- package/CHANGELOG.md +0 -104
- package/CODE_OF_CONDUCT.md +0 -128
- package/CONTRIBUTING.md +0 -9
- package/SECURITY.md +0 -13
- package/dist/@types/index.d.ts +0 -392
- package/dist/auth.d.ts +0 -13
- package/dist/auth.d.ts.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/createOptions.d.ts +0 -7
- package/dist/createOptions.d.ts.map +0 -1
- package/dist/getInfo.d.ts.map +0 -1
- package/dist/getLovedTracks.d.ts.map +0 -1
- package/dist/getRecentTracks.d.ts.map +0 -1
- package/dist/getTopAlbums.d.ts.map +0 -1
- package/dist/getTopArtists.d.ts.map +0 -1
- package/dist/getTopTracks.d.ts.map +0 -1
- package/dist/getWeeklyAlbumChart.d.ts.map +0 -1
- package/dist/getWeeklyArtistChart.d.ts.map +0 -1
- package/dist/getWeeklyChartList.d.ts.map +0 -1
- package/dist/getWeeklyTrackChart.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -31
- package/dist/method.d.ts.map +0 -1
- package/dist/request.d.ts.map +0 -1
- package/playwright.config.ts +0 -37
- package/src/auth.ts +0 -23
- package/src/config.ts +0 -34
- package/src/createOptions.ts +0 -12
- package/src/getInfo.ts +0 -17
- package/src/getLovedTracks.ts +0 -19
- package/src/getRecentTracks.ts +0 -19
- package/src/getTopAlbums.ts +0 -19
- package/src/getTopArtists.ts +0 -19
- package/src/getTopTracks.ts +0 -19
- package/src/getWeeklyAlbumChart.ts +0 -19
- package/src/getWeeklyArtistChart.ts +0 -19
- package/src/getWeeklyChartList.ts +0 -19
- package/src/getWeeklyTrackChart.ts +0 -20
- package/src/method.ts +0 -33
- package/src/request.ts +0 -133
- package/tests/env.spec.ts +0 -21
- package/tsconfig.dev.json +0 -7
- package/tsconfig.json +0 -104
package/package.json
CHANGED
|
@@ -1,8 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lastfm-nodejs-client",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.4",
|
|
4
4
|
"description": "A NodeJS wrapper client for LastFm API. Fetching public data by username using the LastFm public API",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "dist/cjs/index.js",
|
|
6
|
+
"module": "dist/mjs/index.js",
|
|
7
|
+
"types": "dist/mjs/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"lastfm-nodejs-client"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/mjs/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.js",
|
|
16
|
+
"types": "./dist/mjs/index.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./lastfm-nodejs-client": {
|
|
19
|
+
"import": "./dist/mjs/index.js",
|
|
20
|
+
"require": "./dist/cjs/index.js",
|
|
21
|
+
"types": "./dist/mjs/index.d.ts"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "rm -fr dist/* && tsc -p tsconfig.json && tsc -p tsconfig.cjs.json && bash ./generate-package-json-files.sh",
|
|
26
|
+
"lint": "eslint src",
|
|
27
|
+
"lint-fix": "eslint src --fix",
|
|
28
|
+
"prepare": "npm run build",
|
|
29
|
+
"_prepublishOnly": "npm test && npm run lint",
|
|
30
|
+
"clean": "rimraf dist",
|
|
31
|
+
"publish": "npm run build && npm publish --access public",
|
|
32
|
+
"test": "npx playwright test --reporter=list"
|
|
33
|
+
},
|
|
6
34
|
"keywords": [
|
|
7
35
|
"client",
|
|
8
36
|
"lastFm",
|
|
@@ -18,11 +46,17 @@
|
|
|
18
46
|
"dependencies": {
|
|
19
47
|
"cross-fetch": "^4.0.0",
|
|
20
48
|
"dotenv": "^16.3.1",
|
|
21
|
-
"rimraf": "^5.0.
|
|
49
|
+
"rimraf": "^5.0.5"
|
|
22
50
|
},
|
|
23
51
|
"devDependencies": {
|
|
24
|
-
"@playwright/test": "^1.38.
|
|
25
|
-
"@types/node": "^20.
|
|
52
|
+
"@playwright/test": "^1.38.1",
|
|
53
|
+
"@types/node": "^20.7.1",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "^6.4.0",
|
|
55
|
+
"eslint": "^8.0.1",
|
|
56
|
+
"eslint-config-standard-with-typescript": "^39.1.0",
|
|
57
|
+
"eslint-plugin-import": "^2.25.2",
|
|
58
|
+
"eslint-plugin-n": "^15.0.0 || ^16.0.0 ",
|
|
59
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
26
60
|
"typescript": "^5.2.2"
|
|
27
61
|
},
|
|
28
62
|
"repository": {
|
|
@@ -32,11 +66,5 @@
|
|
|
32
66
|
"bugs": {
|
|
33
67
|
"url": "https://github.com/mannuelf/lastfm-nodejs-client/issues"
|
|
34
68
|
},
|
|
35
|
-
"homepage": "https://github.com/mannuelf/lastfm-nodejs-client#readme"
|
|
36
|
-
|
|
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
|
-
}
|
|
42
|
-
}
|
|
69
|
+
"homepage": "https://github.com/mannuelf/lastfm-nodejs-client#readme"
|
|
70
|
+
}
|
package/.env.example
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Bug report
|
|
3
|
-
about: Create a report to help us improve
|
|
4
|
-
title: ''
|
|
5
|
-
labels: ''
|
|
6
|
-
assignees: ''
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
**Describe the bug**
|
|
11
|
-
A clear and concise description of what the bug is.
|
|
12
|
-
|
|
13
|
-
**To Reproduce**
|
|
14
|
-
Steps to reproduce the behavior:
|
|
15
|
-
1. Go to '...'
|
|
16
|
-
2. Click on '....'
|
|
17
|
-
3. Scroll down to '....'
|
|
18
|
-
4. See error
|
|
19
|
-
|
|
20
|
-
**Expected behavior**
|
|
21
|
-
A clear and concise description of what you expected to happen.
|
|
22
|
-
|
|
23
|
-
**Screenshots**
|
|
24
|
-
If applicable, add screenshots to help explain your problem.
|
|
25
|
-
|
|
26
|
-
**Desktop (please complete the following information):**
|
|
27
|
-
- OS: [e.g. iOS]
|
|
28
|
-
- Browser [e.g. chrome, safari]
|
|
29
|
-
- Version [e.g. 22]
|
|
30
|
-
|
|
31
|
-
**Smartphone (please complete the following information):**
|
|
32
|
-
- Device: [e.g. iPhone6]
|
|
33
|
-
- OS: [e.g. iOS8.1]
|
|
34
|
-
- Browser [e.g. stock browser, safari]
|
|
35
|
-
- Version [e.g. 22]
|
|
36
|
-
|
|
37
|
-
**Additional context**
|
|
38
|
-
Add any other context about the problem here.
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Feature request
|
|
3
|
-
about: Suggest an idea for this project
|
|
4
|
-
title: ''
|
|
5
|
-
labels: ''
|
|
6
|
-
assignees: ''
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
**Is your feature request related to a problem? Please describe.**
|
|
11
|
-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
-
|
|
13
|
-
**Describe the solution you'd like**
|
|
14
|
-
A clear and concise description of what you want to happen.
|
|
15
|
-
|
|
16
|
-
**Describe alternatives you've considered**
|
|
17
|
-
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
-
|
|
19
|
-
**Additional context**
|
|
20
|
-
Add any other context or screenshots about the feature request here.
|
package/.github/dependabot.yml
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
-
# package ecosystems to update and where the package manifests are located.
|
|
3
|
-
# Please see the documentation for all configuration options:
|
|
4
|
-
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
|
5
|
-
|
|
6
|
-
version: 2
|
|
7
|
-
updates:
|
|
8
|
-
- package-ecosystem: "npm"
|
|
9
|
-
directory: "/"
|
|
10
|
-
schedule:
|
|
11
|
-
interval: "weekly"
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# For most projects, this workflow file will not need changing; you simply need
|
|
2
|
-
# to commit it to your repository.
|
|
3
|
-
#
|
|
4
|
-
# You may wish to alter this file to override the set of languages analyzed,
|
|
5
|
-
# or to provide custom queries or build logic.
|
|
6
|
-
#
|
|
7
|
-
# ******** NOTE ********
|
|
8
|
-
# We have attempted to detect the languages in your repository. Please check
|
|
9
|
-
# the `language` matrix defined below to confirm you have the correct set of
|
|
10
|
-
# supported CodeQL languages.
|
|
11
|
-
#
|
|
12
|
-
name: "CodeQL"
|
|
13
|
-
|
|
14
|
-
on:
|
|
15
|
-
push:
|
|
16
|
-
branches: [ "main" ]
|
|
17
|
-
pull_request:
|
|
18
|
-
# The branches below must be a subset of the branches above
|
|
19
|
-
branches: [ "main" ]
|
|
20
|
-
schedule:
|
|
21
|
-
- cron: '29 13 * * 4'
|
|
22
|
-
|
|
23
|
-
jobs:
|
|
24
|
-
analyze:
|
|
25
|
-
name: Analyze
|
|
26
|
-
runs-on: ubuntu-latest
|
|
27
|
-
permissions:
|
|
28
|
-
actions: read
|
|
29
|
-
contents: read
|
|
30
|
-
security-events: write
|
|
31
|
-
|
|
32
|
-
strategy:
|
|
33
|
-
fail-fast: false
|
|
34
|
-
matrix:
|
|
35
|
-
language: [ 'javascript' ]
|
|
36
|
-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
|
37
|
-
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
|
38
|
-
|
|
39
|
-
steps:
|
|
40
|
-
- name: Checkout repository
|
|
41
|
-
uses: actions/checkout@v3
|
|
42
|
-
|
|
43
|
-
# Initializes the CodeQL tools for scanning.
|
|
44
|
-
- name: Initialize CodeQL
|
|
45
|
-
uses: github/codeql-action/init@v2
|
|
46
|
-
with:
|
|
47
|
-
languages: ${{ matrix.language }}
|
|
48
|
-
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
49
|
-
# By default, queries listed here will override any specified in a config file.
|
|
50
|
-
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
51
|
-
|
|
52
|
-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
|
53
|
-
# queries: security-extended,security-and-quality
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
|
|
57
|
-
# If this step fails, then you should remove it and run the build manually (see below)
|
|
58
|
-
- name: Autobuild
|
|
59
|
-
uses: github/codeql-action/autobuild@v2
|
|
60
|
-
|
|
61
|
-
# ℹ️ Command-line programs to run using the OS shell.
|
|
62
|
-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
|
63
|
-
|
|
64
|
-
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
|
65
|
-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
|
66
|
-
|
|
67
|
-
# - run: |
|
|
68
|
-
# echo "Run, Build Application using script"
|
|
69
|
-
# ./location_of_script_within_repo/buildscript.sh
|
|
70
|
-
|
|
71
|
-
- name: Perform CodeQL Analysis
|
|
72
|
-
uses: github/codeql-action/analyze@v2
|
|
73
|
-
with:
|
|
74
|
-
category: "/language:${{matrix.language}}"
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
name: Playwright Tests
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches: [main, master]
|
|
5
|
-
pull_request:
|
|
6
|
-
branches: [main, master]
|
|
7
|
-
jobs:
|
|
8
|
-
test:
|
|
9
|
-
timeout-minutes: 60
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
steps:
|
|
12
|
-
- uses: actions/checkout@v3
|
|
13
|
-
- uses: actions/setup-node@v3
|
|
14
|
-
with:
|
|
15
|
-
node-version: 16
|
|
16
|
-
- uses: pnpm/action-setup@v2
|
|
17
|
-
with:
|
|
18
|
-
version: 7.14.1
|
|
19
|
-
- name: Install dependencies
|
|
20
|
-
run: pnpm install
|
|
21
|
-
- name: Install Playwright Browsers
|
|
22
|
-
run: npx playwright install --with-deps
|
|
23
|
-
- name: Install @playwright/test package
|
|
24
|
-
run: pnpm add -D @playwright/test
|
|
25
|
-
- name: Creates environment variables
|
|
26
|
-
run: |
|
|
27
|
-
echo "LASTFM_API_BASE_URL: https://ws.audioscrobbler.com/2.0/"
|
|
28
|
-
echo "LASTFM_API_KEY: abcdefghijklmnopqrstuvxyz"
|
|
29
|
-
- name: Run Playwright tests
|
|
30
|
-
run: pnpm dlx playwright test
|
|
31
|
-
- uses: actions/upload-artifact@v2
|
|
32
|
-
if: always()
|
|
33
|
-
with:
|
|
34
|
-
name: playwright-report
|
|
35
|
-
path: playwright-report/
|
|
36
|
-
retention-days: 30
|
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
v20
|
package/.prettierrc.yaml
DELETED
package/@types/index.d.ts
DELETED
|
@@ -1,392 +0,0 @@
|
|
|
1
|
-
export interface AuthResponse {
|
|
2
|
-
token: string;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export interface LovedTracksResponse {
|
|
6
|
-
lovedtracks: LovedTracks;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface LovedTracks {
|
|
10
|
-
track: Track[];
|
|
11
|
-
'@attr': Attr;
|
|
12
|
-
}
|
|
13
|
-
export interface TopAlbumsResponse {
|
|
14
|
-
topalbums: TopAlbums;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface TopTrackResponse {
|
|
18
|
-
toptracks: TopTracks;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface TopTracks {
|
|
22
|
-
track: Track[];
|
|
23
|
-
'@attr': Attr2;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface UserResponse {
|
|
27
|
-
user: User;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface RecentTracksResponse {
|
|
31
|
-
recenttracks: RecentTracks;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface RecentTracks {
|
|
35
|
-
track: Track[];
|
|
36
|
-
'@attr': Attr2;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface LoveTracksResponse {
|
|
40
|
-
lovedtracks: LovedTracks;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface LovedTracks {
|
|
44
|
-
track: Track[];
|
|
45
|
-
'@attr': Attr;
|
|
46
|
-
}
|
|
47
|
-
export interface FriendsResponse {
|
|
48
|
-
friends: Friends;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface Friends {
|
|
52
|
-
'@attr': Attr;
|
|
53
|
-
user: User[];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface TopArtistsResponse {
|
|
57
|
-
topartists: TopArtists;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface TopArtists {
|
|
61
|
-
artist: Artist[];
|
|
62
|
-
'@attr': Attr2;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface WeeklyArtistChartResponse {
|
|
66
|
-
weeklyartistchart: WeeklyArtistChart;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface WeeklyArtistChart {
|
|
70
|
-
artist: Artist[];
|
|
71
|
-
'@attr': Attr2;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface WeeklyAlbumChartResponse {
|
|
75
|
-
weeklyalbumchart: WeeklyAlbumChart;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface WeeklyAlbumChart {
|
|
79
|
-
album: WeeklyAlbum[];
|
|
80
|
-
'@attr': WeeklyalbumChartAttr;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export type WeeklyAlbum = {
|
|
84
|
-
artist: {
|
|
85
|
-
mbid: string;
|
|
86
|
-
'#text': string;
|
|
87
|
-
};
|
|
88
|
-
mbid: string;
|
|
89
|
-
url: string;
|
|
90
|
-
name: string;
|
|
91
|
-
'@attr': { rank: string };
|
|
92
|
-
playcount: string;
|
|
93
|
-
image?: string;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export interface WeeklyalbumChartAttr {
|
|
97
|
-
from: string;
|
|
98
|
-
to: string;
|
|
99
|
-
user: string;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export interface AlbumAttr {
|
|
103
|
-
rank: string;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export type Artist = {
|
|
107
|
-
'@attr': {
|
|
108
|
-
rank: number;
|
|
109
|
-
};
|
|
110
|
-
cover: ArtistImage;
|
|
111
|
-
image?: 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
|
-
}
|