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.
Files changed (133) hide show
  1. package/README.md +14 -2
  2. package/dist/cjs/auth.d.ts +12 -0
  3. package/dist/{auth.js → cjs/auth.js} +11 -11
  4. package/dist/cjs/chart/topArtists.d.ts +2 -0
  5. package/dist/cjs/chart/topArtists.js +13 -0
  6. package/dist/cjs/chart/topTags.d.ts +2 -0
  7. package/dist/cjs/chart/topTags.js +13 -0
  8. package/dist/cjs/chart/topTracks.d.ts +2 -0
  9. package/dist/cjs/chart/topTracks.js +13 -0
  10. package/dist/{config.d.ts → cjs/config.d.ts} +0 -1
  11. package/dist/{config.js → cjs/config.js} +0 -1
  12. package/dist/cjs/createOptions.d.ts +7 -0
  13. package/dist/{createOptions.js → cjs/createOptions.js} +2 -1
  14. package/dist/{getInfo.d.ts → cjs/getInfo.d.ts} +1 -2
  15. package/dist/{getInfo.js → cjs/getInfo.js} +2 -2
  16. package/dist/{getLovedTracks.d.ts → cjs/getLovedTracks.d.ts} +1 -2
  17. package/dist/{getLovedTracks.js → cjs/getLovedTracks.js} +2 -2
  18. package/dist/{getRecentTracks.d.ts → cjs/getRecentTracks.d.ts} +1 -2
  19. package/dist/{getRecentTracks.js → cjs/getRecentTracks.js} +2 -2
  20. package/dist/{getTopAlbums.d.ts → cjs/getTopAlbums.d.ts} +1 -2
  21. package/dist/{getTopAlbums.js → cjs/getTopAlbums.js} +2 -2
  22. package/dist/{getTopArtists.d.ts → cjs/getTopArtists.d.ts} +1 -2
  23. package/dist/{getTopArtists.js → cjs/getTopArtists.js} +2 -2
  24. package/dist/{getTopTracks.d.ts → cjs/getTopTracks.d.ts} +1 -2
  25. package/dist/{getTopTracks.js → cjs/getTopTracks.js} +2 -2
  26. package/dist/{getWeeklyAlbumChart.d.ts → cjs/getWeeklyAlbumChart.d.ts} +1 -2
  27. package/dist/{getWeeklyAlbumChart.js → cjs/getWeeklyAlbumChart.js} +2 -2
  28. package/dist/{getWeeklyArtistChart.d.ts → cjs/getWeeklyArtistChart.d.ts} +1 -2
  29. package/dist/{getWeeklyArtistChart.js → cjs/getWeeklyArtistChart.js} +2 -2
  30. package/dist/{getWeeklyChartList.d.ts → cjs/getWeeklyChartList.d.ts} +1 -2
  31. package/dist/{getWeeklyChartList.js → cjs/getWeeklyChartList.js} +2 -2
  32. package/dist/{getWeeklyTrackChart.d.ts → cjs/getWeeklyTrackChart.d.ts} +1 -2
  33. package/dist/{getWeeklyTrackChart.js → cjs/getWeeklyTrackChart.js} +2 -2
  34. package/dist/{index.d.ts → cjs/index.d.ts} +14 -3
  35. package/dist/cjs/index.js +41 -0
  36. package/dist/{method.d.ts → cjs/method.d.ts} +11 -1
  37. package/dist/{method.js → cjs/method.js} +5 -2
  38. package/dist/cjs/package.json +3 -0
  39. package/dist/{request.d.ts → cjs/request.d.ts} +0 -1
  40. package/dist/{request.js → cjs/request.js} +7 -15
  41. package/dist/mjs/auth.d.ts +12 -0
  42. package/dist/mjs/auth.js +16 -0
  43. package/dist/mjs/chart/topArtists.d.ts +2 -0
  44. package/dist/mjs/chart/topArtists.js +6 -0
  45. package/dist/mjs/chart/topTags.d.ts +2 -0
  46. package/dist/mjs/chart/topTags.js +6 -0
  47. package/dist/mjs/chart/topTracks.d.ts +2 -0
  48. package/dist/mjs/chart/topTracks.js +6 -0
  49. package/dist/mjs/config.d.ts +20 -0
  50. package/dist/mjs/config.js +22 -0
  51. package/dist/mjs/createOptions.d.ts +7 -0
  52. package/dist/mjs/createOptions.js +9 -0
  53. package/dist/mjs/getInfo.d.ts +8 -0
  54. package/dist/mjs/getInfo.js +12 -0
  55. package/dist/mjs/getLovedTracks.d.ts +8 -0
  56. package/dist/mjs/getLovedTracks.js +12 -0
  57. package/dist/mjs/getRecentTracks.d.ts +8 -0
  58. package/dist/mjs/getRecentTracks.js +12 -0
  59. package/dist/mjs/getTopAlbums.d.ts +8 -0
  60. package/dist/mjs/getTopAlbums.js +12 -0
  61. package/dist/mjs/getTopArtists.d.ts +8 -0
  62. package/dist/mjs/getTopArtists.js +12 -0
  63. package/dist/mjs/getTopTracks.d.ts +8 -0
  64. package/dist/mjs/getTopTracks.js +12 -0
  65. package/dist/mjs/getWeeklyAlbumChart.d.ts +8 -0
  66. package/dist/mjs/getWeeklyAlbumChart.js +12 -0
  67. package/dist/mjs/getWeeklyArtistChart.d.ts +8 -0
  68. package/dist/mjs/getWeeklyArtistChart.js +12 -0
  69. package/dist/mjs/getWeeklyChartList.d.ts +8 -0
  70. package/dist/mjs/getWeeklyChartList.js +12 -0
  71. package/dist/mjs/getWeeklyTrackChart.d.ts +8 -0
  72. package/dist/mjs/getWeeklyTrackChart.js +12 -0
  73. package/dist/mjs/index.d.ts +63 -0
  74. package/{src/index.ts → dist/mjs/index.js} +25 -18
  75. package/dist/mjs/method.d.ts +43 -0
  76. package/dist/mjs/method.js +20 -0
  77. package/dist/mjs/package.json +3 -0
  78. package/dist/mjs/request.d.ts +8 -0
  79. package/dist/mjs/request.js +119 -0
  80. package/lastfm-nodejs-client/package.json +7 -0
  81. package/package.json +41 -13
  82. package/.env.example +0 -6
  83. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
  84. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  85. package/.github/dependabot.yml +0 -11
  86. package/.github/workflows/codeql.yml +0 -74
  87. package/.github/workflows/playwright.yml +0 -36
  88. package/.nvmrc +0 -1
  89. package/.prettierrc.yaml +0 -6
  90. package/@types/index.d.ts +0 -392
  91. package/CHANGELOG.md +0 -104
  92. package/CODE_OF_CONDUCT.md +0 -128
  93. package/CONTRIBUTING.md +0 -9
  94. package/SECURITY.md +0 -13
  95. package/dist/@types/index.d.ts +0 -392
  96. package/dist/auth.d.ts +0 -13
  97. package/dist/auth.d.ts.map +0 -1
  98. package/dist/config.d.ts.map +0 -1
  99. package/dist/createOptions.d.ts +0 -7
  100. package/dist/createOptions.d.ts.map +0 -1
  101. package/dist/getInfo.d.ts.map +0 -1
  102. package/dist/getLovedTracks.d.ts.map +0 -1
  103. package/dist/getRecentTracks.d.ts.map +0 -1
  104. package/dist/getTopAlbums.d.ts.map +0 -1
  105. package/dist/getTopArtists.d.ts.map +0 -1
  106. package/dist/getTopTracks.d.ts.map +0 -1
  107. package/dist/getWeeklyAlbumChart.d.ts.map +0 -1
  108. package/dist/getWeeklyArtistChart.d.ts.map +0 -1
  109. package/dist/getWeeklyChartList.d.ts.map +0 -1
  110. package/dist/getWeeklyTrackChart.d.ts.map +0 -1
  111. package/dist/index.d.ts.map +0 -1
  112. package/dist/index.js +0 -31
  113. package/dist/method.d.ts.map +0 -1
  114. package/dist/request.d.ts.map +0 -1
  115. package/playwright.config.ts +0 -37
  116. package/src/auth.ts +0 -23
  117. package/src/config.ts +0 -34
  118. package/src/createOptions.ts +0 -12
  119. package/src/getInfo.ts +0 -17
  120. package/src/getLovedTracks.ts +0 -19
  121. package/src/getRecentTracks.ts +0 -19
  122. package/src/getTopAlbums.ts +0 -19
  123. package/src/getTopArtists.ts +0 -19
  124. package/src/getTopTracks.ts +0 -19
  125. package/src/getWeeklyAlbumChart.ts +0 -19
  126. package/src/getWeeklyArtistChart.ts +0 -19
  127. package/src/getWeeklyChartList.ts +0 -19
  128. package/src/getWeeklyTrackChart.ts +0 -20
  129. package/src/method.ts +0 -33
  130. package/src/request.ts +0 -133
  131. package/tests/env.spec.ts +0 -21
  132. package/tsconfig.dev.json +0 -7
  133. package/tsconfig.json +0 -104
package/CHANGELOG.md DELETED
@@ -1,104 +0,0 @@
1
- # Changelog
2
-
3
- ## 1.4.2
4
-
5
- - bug, release dist
6
-
7
- ## 1.4.1
8
-
9
- - export esm modules modern js only.
10
- - add all dts and dts map files to dist
11
- - adds lastfm types to dist
12
-
13
- ## 1.4.0
14
-
15
- - update all api functions from snake case to camel case.
16
-
17
- ## 1.3.0
18
-
19
- - Updates npm dependencies.
20
- - refactors request with new error handling and responses.
21
- - updates getInfo, removes hte un-required params.
22
-
23
- ## 1.2.4
24
-
25
- - Updates npm dependencies.
26
- - Refactors request methods options and updates all callsites.
27
- - Add nvmrc file for easy switching node version.
28
-
29
- ## 1.2.3
30
-
31
- - Adds tests, using Playwright.
32
- - Adds dotenv npm module as a new dependency.
33
-
34
- ## 1.2.2
35
-
36
- - 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.
37
-
38
- ## 1.2.1
39
-
40
- - Tidy up, removes console logs.
41
-
42
- ## 1.2.0
43
-
44
- - Swops `node-fetch` for `cross-fetch` for server and browser fetching support in one.
45
-
46
- ## 1.1.5
47
-
48
- - Fix incorrect type on request method.
49
-
50
- ## 1.1.4
51
-
52
- - Fix incorrect type on request method.
53
-
54
- ## 1.1.3
55
-
56
- - Fix incorrect type import.
57
-
58
- ## 1.1.2
59
-
60
- - Fix broken type, Track image type is an array of Images.
61
-
62
- ## 1.1.1
63
-
64
- - update function declaration.
65
- - re-add type declartion files for source code.
66
-
67
- ## 1.1.0
68
-
69
- - Downgrade node-fetch to v2.6.7.
70
- - Do not ship separate declaration files.
71
- - TS now exports to CommonJs modules for better support older consumers.
72
-
73
- ## 1.0.6
74
-
75
- - Forking repo README update.
76
-
77
- ## 1.0.5
78
-
79
- - Fix local types.
80
- - Update readme with current way of using the types.
81
- - adds screenshot of it in use.
82
-
83
- ## 1.0.4
84
-
85
- - Export types.
86
-
87
- ## 1.0.3
88
-
89
- - Adds types file to distribution.
90
- - Updates readme with types imports.
91
-
92
- ## 1.0.2
93
-
94
- - Refactors types.d.ts to types.ts so can ship them with package and consumers can import them in their projects.
95
-
96
- ## 1.0.1
97
-
98
- - Refactors config and methods to own modules.
99
- - tsconfig, generate types to allow shipping types in one package, no need to DefinitleyTyped right now.
100
- - update docs with new way of interacting with API.
101
-
102
- ## 1.0.0
103
-
104
- - 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 ✌️
@@ -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
- }
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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAcA;;;;;;;;GAQG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;CAUD,CAAC"}
@@ -1,7 +0,0 @@
1
- export declare function createOptions(method: string, user: string, period?: string, limit?: string): {
2
- method: string;
3
- user: string;
4
- period: string | undefined;
5
- limit: string | undefined;
6
- };
7
- //# sourceMappingURL=createOptions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createOptions.d.ts","sourceRoot":"","sources":["../src/createOptions.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM;;;;;EAOf"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getInfo.d.ts","sourceRoot":"","sources":["../src/getInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAIzC;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,YAAY,CAAC,CAGvB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getLovedTracks.d.ts","sourceRoot":"","sources":["../src/getLovedTracks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAIhD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,mBAAmB,CAAC,CAG9B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getRecentTracks.d.ts","sourceRoot":"","sources":["../src/getRecentTracks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAIjD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,oBAAoB,CAAC,CAG/B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getTopAlbums.d.ts","sourceRoot":"","sources":["../src/getTopAlbums.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAI9C;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,iBAAiB,CAAC,CAG5B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getTopArtists.d.ts","sourceRoot":"","sources":["../src/getTopArtists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAI/C;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,kBAAkB,CAAC,CAG7B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getTopTracks.d.ts","sourceRoot":"","sources":["../src/getTopTracks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAI7C;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,gBAAgB,CAAC,CAG3B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getWeeklyAlbumChart.d.ts","sourceRoot":"","sources":["../src/getWeeklyAlbumChart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAIrD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,wBAAwB,CAAC,CAGnC"}