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
@@ -0,0 +1,119 @@
1
+ import fetch from 'cross-fetch';
2
+ import { config } from './config';
3
+ var ErrorResponse;
4
+ (function (ErrorResponse) {
5
+ ErrorResponse[ErrorResponse["InvalidService"] = 2] = "InvalidService";
6
+ ErrorResponse[ErrorResponse["InvalidMethod"] = 3] = "InvalidMethod";
7
+ ErrorResponse[ErrorResponse["AuthenticationFailed"] = 4] = "AuthenticationFailed";
8
+ ErrorResponse[ErrorResponse["InvalidFormat"] = 5] = "InvalidFormat";
9
+ ErrorResponse[ErrorResponse["InvalidParameters"] = 6] = "InvalidParameters";
10
+ ErrorResponse[ErrorResponse["InvalidResource"] = 7] = "InvalidResource";
11
+ ErrorResponse[ErrorResponse["OperationFailed"] = 8] = "OperationFailed";
12
+ ErrorResponse[ErrorResponse["InvalidSessionKey"] = 9] = "InvalidSessionKey";
13
+ ErrorResponse[ErrorResponse["InvalidAPIKey"] = 10] = "InvalidAPIKey";
14
+ ErrorResponse[ErrorResponse["ServiceOffline"] = 11] = "ServiceOffline";
15
+ ErrorResponse[ErrorResponse["InvalidMethodSignature"] = 13] = "InvalidMethodSignature";
16
+ ErrorResponse[ErrorResponse["TemporaryError"] = 16] = "TemporaryError";
17
+ ErrorResponse[ErrorResponse["SuspendedAPIKey"] = 26] = "SuspendedAPIKey";
18
+ ErrorResponse[ErrorResponse["RateLimitExceeded"] = 29] = "RateLimitExceeded";
19
+ })(ErrorResponse || (ErrorResponse = {}));
20
+ const buildUrl = (options) => {
21
+ const params = new URLSearchParams();
22
+ params.append('method', options.method);
23
+ if (options.user)
24
+ params.append('user', options.user);
25
+ if (options.period)
26
+ params.append('period', options.period);
27
+ if (options.limit)
28
+ params.append('limit', options.limit);
29
+ params.append('api_key', config.api_key);
30
+ params.append('format', config.format.json);
31
+ return `${config.base_url}?${params.toString()}`;
32
+ };
33
+ const request = async (options) => {
34
+ const url = buildUrl(options);
35
+ return (await fetch(url, {
36
+ headers: {
37
+ 'Content-Type': 'application/json',
38
+ },
39
+ })
40
+ .then(async (res) => {
41
+ if (!res.ok) {
42
+ throw new Error(res.statusText);
43
+ }
44
+ switch (res.status) {
45
+ case 200: {
46
+ return await res.json();
47
+ }
48
+ case 400: {
49
+ throw new Error('Bad request');
50
+ }
51
+ case 401: {
52
+ throw new Error('Unauthorized');
53
+ }
54
+ case 403: {
55
+ throw new Error('Forbidden');
56
+ }
57
+ case 404: {
58
+ throw new Error('Not found');
59
+ }
60
+ case 500: {
61
+ throw new Error('Internal server error');
62
+ }
63
+ case 503: {
64
+ throw new Error('Service unavailable');
65
+ }
66
+ case ErrorResponse.InvalidAPIKey: {
67
+ throw new Error('Invalid API key');
68
+ }
69
+ case ErrorResponse.InvalidMethod: {
70
+ throw new Error('Invalid method');
71
+ }
72
+ case ErrorResponse.InvalidParameters: {
73
+ throw new Error('Invalid parameters');
74
+ }
75
+ case ErrorResponse.InvalidResource: {
76
+ throw new Error('Invalid resource');
77
+ }
78
+ case ErrorResponse.InvalidSessionKey: {
79
+ throw new Error('Invalid session key');
80
+ }
81
+ case ErrorResponse.InvalidService: {
82
+ throw new Error('Invalid service');
83
+ }
84
+ case ErrorResponse.OperationFailed: {
85
+ throw new Error('Operation failed');
86
+ }
87
+ case ErrorResponse.RateLimitExceeded: {
88
+ throw new Error('Rate limit exceeded');
89
+ }
90
+ case ErrorResponse.ServiceOffline: {
91
+ throw new Error('Service offline');
92
+ }
93
+ case ErrorResponse.SuspendedAPIKey: {
94
+ throw new Error('Suspended API key');
95
+ }
96
+ case ErrorResponse.TemporaryError: {
97
+ throw new Error('Temporary error');
98
+ }
99
+ case ErrorResponse.AuthenticationFailed: {
100
+ throw new Error('Authentication failed');
101
+ }
102
+ case ErrorResponse.InvalidFormat: {
103
+ throw new Error('Invalid format');
104
+ }
105
+ case ErrorResponse.InvalidMethodSignature: {
106
+ throw new Error('Invalid method signature');
107
+ }
108
+ default: {
109
+ throw new Error('Unknown error');
110
+ }
111
+ }
112
+ })
113
+ .then((json) => json)
114
+ .catch((error) => {
115
+ // eslint-disable-next-line no-console
116
+ console.error('🚨 error:', error);
117
+ }));
118
+ };
119
+ export default request;
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "lastfm-nodejs-client",
3
+ "description": "A client for interacting with the lastFm API",
4
+ "main": "../dist/cjs/index.js",
5
+ "module": "../dist/mjs/indext.js",
6
+ "types": "../dist/mjs/index.d.ts"
7
+ }
package/package.json CHANGED
@@ -1,8 +1,36 @@
1
1
  {
2
2
  "name": "lastfm-nodejs-client",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "A NodeJS wrapper client for LastFm API. Fetching public data by username using the LastFm public API",
5
- "main": "./dist",
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 && mkdir dist/@types && cp -a @types/* dist/@types",
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.1"
49
+ "rimraf": "^5.0.5"
22
50
  },
23
51
  "devDependencies": {
24
- "@playwright/test": "^1.38.0",
25
- "@types/node": "^20.6.2",
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
- "scripts": {
37
- "build": "rimraf dist && tsc",
38
- "clean": "rimraf dist",
39
- "dev": "npm run clean && tsc --watch --project tsconfig.dev.json",
40
- "test": "npx playwright test --reporter=list"
41
- }
42
- }
69
+ "homepage": "https://github.com/mannuelf/lastfm-nodejs-client#readme"
70
+ }
package/.env.example DELETED
@@ -1,6 +0,0 @@
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
@@ -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.
@@ -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
@@ -1,6 +0,0 @@
1
- semi: true
2
- trailingComma: all
3
- singleQuote: true
4
- jsxSingleQuote: true
5
- printWidth: 100
6
- tabWidth: 2
package/CHANGELOG.md DELETED
@@ -1,108 +0,0 @@
1
- # Changelog
2
-
3
- ## 1.4.3
4
-
5
- - fix missmatched types for Album and Track, added some optionals pity, but it works, that just how they give us the data.
6
-
7
- ## 1.4.2
8
-
9
- - bug, release dist
10
-
11
- ## 1.4.1
12
-
13
- - export esm modules modern js only.
14
- - add all dts and dts map files to dist
15
- - adds lastfm types to dist
16
-
17
- ## 1.4.0
18
-
19
- - update all api functions from snake case to camel case.
20
-
21
- ## 1.3.0
22
-
23
- - Updates npm dependencies.
24
- - refactors request with new error handling and responses.
25
- - updates getInfo, removes hte un-required params.
26
-
27
- ## 1.2.4
28
-
29
- - Updates npm dependencies.
30
- - Refactors request methods options and updates all callsites.
31
- - Add nvmrc file for easy switching node version.
32
-
33
- ## 1.2.3
34
-
35
- - Adds tests, using Playwright.
36
- - Adds dotenv npm module as a new dependency.
37
-
38
- ## 1.2.2
39
-
40
- - Put log back, some APIs do get Bad Request for MBIDs that don't exist, don't have solve for this yet, so not throwing any more as it grinds future request to a halt. This is a working version.
41
-
42
- ## 1.2.1
43
-
44
- - Tidy up, removes console logs.
45
-
46
- ## 1.2.0
47
-
48
- - Swops `node-fetch` for `cross-fetch` for server and browser fetching support in one.
49
-
50
- ## 1.1.5
51
-
52
- - Fix incorrect type on request method.
53
-
54
- ## 1.1.4
55
-
56
- - Fix incorrect type on request method.
57
-
58
- ## 1.1.3
59
-
60
- - Fix incorrect type import.
61
-
62
- ## 1.1.2
63
-
64
- - Fix broken type, Track image type is an array of Images.
65
-
66
- ## 1.1.1
67
-
68
- - update function declaration.
69
- - re-add type declartion files for source code.
70
-
71
- ## 1.1.0
72
-
73
- - Downgrade node-fetch to v2.6.7.
74
- - Do not ship separate declaration files.
75
- - TS now exports to CommonJs modules for better support older consumers.
76
-
77
- ## 1.0.6
78
-
79
- - Forking repo README update.
80
-
81
- ## 1.0.5
82
-
83
- - Fix local types.
84
- - Update readme with current way of using the types.
85
- - adds screenshot of it in use.
86
-
87
- ## 1.0.4
88
-
89
- - Export types.
90
-
91
- ## 1.0.3
92
-
93
- - Adds types file to distribution.
94
- - Updates readme with types imports.
95
-
96
- ## 1.0.2
97
-
98
- - Refactors types.d.ts to types.ts so can ship them with package and consumers can import them in their projects.
99
-
100
- ## 1.0.1
101
-
102
- - Refactors config and methods to own modules.
103
- - tsconfig, generate types to allow shipping types in one package, no need to DefinitleyTyped right now.
104
- - update docs with new way of interacting with API.
105
-
106
- ## 1.0.0
107
-
108
- - Initial project setup.
@@ -1,128 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our
6
- community a harassment-free experience for everyone, regardless of age, body
7
- size, visible or invisible disability, ethnicity, sex characteristics, gender
8
- identity and expression, level of experience, education, socio-economic status,
9
- nationality, personal appearance, race, religion, or sexual identity
10
- and orientation.
11
-
12
- We pledge to act and interact in ways that contribute to an open, welcoming,
13
- diverse, inclusive, and healthy community.
14
-
15
- ## Our Standards
16
-
17
- Examples of behavior that contributes to a positive environment for our
18
- community include:
19
-
20
- * Demonstrating empathy and kindness toward other people
21
- * Being respectful of differing opinions, viewpoints, and experiences
22
- * Giving and gracefully accepting constructive feedback
23
- * Accepting responsibility and apologizing to those affected by our mistakes,
24
- and learning from the experience
25
- * Focusing on what is best not just for us as individuals, but for the
26
- overall community
27
-
28
- Examples of unacceptable behavior include:
29
-
30
- * The use of sexualized language or imagery, and sexual attention or
31
- advances of any kind
32
- * Trolling, insulting or derogatory comments, and personal or political attacks
33
- * Public or private harassment
34
- * Publishing others' private information, such as a physical or email
35
- address, without their explicit permission
36
- * Other conduct which could reasonably be considered inappropriate in a
37
- professional setting
38
-
39
- ## Enforcement Responsibilities
40
-
41
- Community leaders are responsible for clarifying and enforcing our standards of
42
- acceptable behavior and will take appropriate and fair corrective action in
43
- response to any behavior that they deem inappropriate, threatening, offensive,
44
- or harmful.
45
-
46
- Community leaders have the right and responsibility to remove, edit, or reject
47
- comments, commits, code, wiki edits, issues, and other contributions that are
48
- not aligned to this Code of Conduct, and will communicate reasons for moderation
49
- decisions when appropriate.
50
-
51
- ## Scope
52
-
53
- This Code of Conduct applies within all community spaces, and also applies when
54
- an individual is officially representing the community in public spaces.
55
- Examples of representing our community include using an official e-mail address,
56
- posting via an official social media account, or acting as an appointed
57
- representative at an online or offline event.
58
-
59
- ## Enforcement
60
-
61
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
- reported to the community leaders responsible for enforcement at
63
- 9pd5r3wqq@mozmail.com.
64
- All complaints will be reviewed and investigated promptly and fairly.
65
-
66
- All community leaders are obligated to respect the privacy and security of the
67
- reporter of any incident.
68
-
69
- ## Enforcement Guidelines
70
-
71
- Community leaders will follow these Community Impact Guidelines in determining
72
- the consequences for any action they deem in violation of this Code of Conduct:
73
-
74
- ### 1. Correction
75
-
76
- **Community Impact**: Use of inappropriate language or other behavior deemed
77
- unprofessional or unwelcome in the community.
78
-
79
- **Consequence**: A private, written warning from community leaders, providing
80
- clarity around the nature of the violation and an explanation of why the
81
- behavior was inappropriate. A public apology may be requested.
82
-
83
- ### 2. Warning
84
-
85
- **Community Impact**: A violation through a single incident or series
86
- of actions.
87
-
88
- **Consequence**: A warning with consequences for continued behavior. No
89
- interaction with the people involved, including unsolicited interaction with
90
- those enforcing the Code of Conduct, for a specified period of time. This
91
- includes avoiding interactions in community spaces as well as external channels
92
- like social media. Violating these terms may lead to a temporary or
93
- permanent ban.
94
-
95
- ### 3. Temporary Ban
96
-
97
- **Community Impact**: A serious violation of community standards, including
98
- sustained inappropriate behavior.
99
-
100
- **Consequence**: A temporary ban from any sort of interaction or public
101
- communication with the community for a specified period of time. No public or
102
- private interaction with the people involved, including unsolicited interaction
103
- with those enforcing the Code of Conduct, is allowed during this period.
104
- Violating these terms may lead to a permanent ban.
105
-
106
- ### 4. Permanent Ban
107
-
108
- **Community Impact**: Demonstrating a pattern of violation of community
109
- standards, including sustained inappropriate behavior, harassment of an
110
- individual, or aggression toward or disparagement of classes of individuals.
111
-
112
- **Consequence**: A permanent ban from any sort of public interaction within
113
- the community.
114
-
115
- ## Attribution
116
-
117
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
- version 2.0, available at
119
- https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
-
121
- Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
- enforcement ladder](https://github.com/mozilla/diversity).
123
-
124
- [homepage]: https://www.contributor-covenant.org
125
-
126
- For answers to common questions about this code of conduct, see the FAQ at
127
- https://www.contributor-covenant.org/faq. Translations are available at
128
- https://www.contributor-covenant.org/translations.
package/CONTRIBUTING.md DELETED
@@ -1,9 +0,0 @@
1
- # Contributing
2
-
3
- Hi thanks for stopping by, so glad you decided to contribute 😎
4
-
5
- 1. make an issue or bug report
6
- 2. fork repo
7
- 3. do your magic
8
- 4. make pull request
9
- 5. we merge it
package/SECURITY.md DELETED
@@ -1,13 +0,0 @@
1
- # 🔐 Security Policy
2
-
3
- ## Supported Versions
4
-
5
- Dependabot alerts have been enabled and security patches to any dependencies will be brought to light and merged manually by maintainer.
6
-
7
- | Version | Supported |
8
- | ------- | ------------------ |
9
- | 1.0.x | :white_check_mark: |
10
-
11
- ## Reporting a Vulnerability
12
-
13
- If you find anything at all kindly report it as bug report here on github ✌️
package/dist/auth.d.ts DELETED
@@ -1,13 +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>;
13
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAIzC;;;;;;;;;EASE;AACF,wBAAgB,IAAI,CAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,YAAY,CAAC,CAGvB"}