@ansango/lastfm-api 3.3.0 → 3.5.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.
Files changed (504) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +189 -3
  3. package/dist/client.d.ts +9 -1
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/client.js +13 -1
  6. package/dist/client.js.map +1 -1
  7. package/dist/core/canonical-methods.d.ts +25 -0
  8. package/dist/core/canonical-methods.d.ts.map +1 -0
  9. package/dist/core/canonical-methods.js +88 -0
  10. package/dist/core/canonical-methods.js.map +1 -0
  11. package/dist/core/client.d.ts +33 -0
  12. package/dist/core/client.d.ts.map +1 -0
  13. package/dist/core/client.js +48 -0
  14. package/dist/core/client.js.map +1 -0
  15. package/dist/core/index.d.ts +6 -0
  16. package/dist/core/index.d.ts.map +1 -0
  17. package/dist/core/index.js +6 -0
  18. package/dist/core/index.js.map +1 -0
  19. package/dist/core/pagination.d.ts +59 -0
  20. package/dist/core/pagination.d.ts.map +1 -0
  21. package/dist/core/pagination.js +93 -0
  22. package/dist/core/pagination.js.map +1 -0
  23. package/dist/core/schemas/album.schemas.d.ts.map +1 -0
  24. package/dist/{services → core/schemas}/album.schemas.js +1 -1
  25. package/dist/core/schemas/album.schemas.js.map +1 -0
  26. package/dist/core/schemas/artist.schemas.d.ts.map +1 -0
  27. package/dist/{services → core/schemas}/artist.schemas.js +1 -1
  28. package/dist/core/schemas/artist.schemas.js.map +1 -0
  29. package/dist/core/schemas/auth.schemas.d.ts.map +1 -0
  30. package/dist/core/schemas/auth.schemas.js.map +1 -0
  31. package/dist/core/schemas/base/base.entities.schemas.d.ts.map +1 -0
  32. package/dist/core/schemas/base/base.entities.schemas.js.map +1 -0
  33. package/dist/core/schemas/base/base.entity-names.schemas.d.ts.map +1 -0
  34. package/dist/core/schemas/base/base.entity-names.schemas.js.map +1 -0
  35. package/dist/core/schemas/base/base.metadata.schemas.d.ts.map +1 -0
  36. package/dist/core/schemas/base/base.metadata.schemas.js.map +1 -0
  37. package/dist/core/schemas/base/base.pagination.schemas.d.ts.map +1 -0
  38. package/dist/core/schemas/base/base.pagination.schemas.js.map +1 -0
  39. package/dist/core/schemas/base/base.primitives.schemas.d.ts.map +1 -0
  40. package/dist/core/schemas/base/base.primitives.schemas.js.map +1 -0
  41. package/dist/core/schemas/base/index.d.ts.map +1 -0
  42. package/dist/core/schemas/base/index.js.map +1 -0
  43. package/dist/core/schemas/chart.schemas.d.ts.map +1 -0
  44. package/dist/{services → core/schemas}/chart.schemas.js +1 -1
  45. package/dist/core/schemas/chart.schemas.js.map +1 -0
  46. package/dist/core/schemas/geo.schemas.d.ts.map +1 -0
  47. package/dist/{services → core/schemas}/geo.schemas.js +1 -1
  48. package/dist/core/schemas/geo.schemas.js.map +1 -0
  49. package/dist/{services → core/schemas}/index.d.ts +1 -10
  50. package/dist/core/schemas/index.d.ts.map +1 -0
  51. package/dist/core/schemas/index.js +11 -0
  52. package/dist/core/schemas/index.js.map +1 -0
  53. package/dist/core/schemas/library.schemas.d.ts.map +1 -0
  54. package/dist/{services → core/schemas}/library.schemas.js +1 -1
  55. package/dist/core/schemas/library.schemas.js.map +1 -0
  56. package/dist/core/schemas/tag.schemas.d.ts.map +1 -0
  57. package/dist/{services → core/schemas}/tag.schemas.js +1 -1
  58. package/dist/core/schemas/tag.schemas.js.map +1 -0
  59. package/dist/core/schemas/track.schemas.d.ts.map +1 -0
  60. package/dist/{services → core/schemas}/track.schemas.js +1 -1
  61. package/dist/core/schemas/track.schemas.js.map +1 -0
  62. package/dist/core/schemas/user.schemas.d.ts.map +1 -0
  63. package/dist/{services → core/schemas}/user.schemas.js +1 -1
  64. package/dist/core/schemas/user.schemas.js.map +1 -0
  65. package/dist/{services → core/services}/album.d.ts +2 -2
  66. package/dist/core/services/album.d.ts.map +1 -0
  67. package/dist/{services → core/services}/album.js +1 -1
  68. package/dist/core/services/album.js.map +1 -0
  69. package/dist/{services → core/services}/artist.d.ts +2 -2
  70. package/dist/core/services/artist.d.ts.map +1 -0
  71. package/dist/{services → core/services}/artist.js +1 -1
  72. package/dist/core/services/artist.js.map +1 -0
  73. package/dist/{services → core/services}/auth.d.ts +2 -2
  74. package/dist/core/services/auth.d.ts.map +1 -0
  75. package/dist/{services → core/services}/auth.js +1 -1
  76. package/dist/core/services/auth.js.map +1 -0
  77. package/dist/{services → core/services}/chart.d.ts +2 -2
  78. package/dist/core/services/chart.d.ts.map +1 -0
  79. package/dist/{services → core/services}/chart.js +1 -1
  80. package/dist/core/services/chart.js.map +1 -0
  81. package/dist/{services → core/services}/geo.d.ts +2 -2
  82. package/dist/core/services/geo.d.ts.map +1 -0
  83. package/dist/{services → core/services}/geo.js +1 -1
  84. package/dist/core/services/geo.js.map +1 -0
  85. package/dist/core/services/index.d.ts +10 -0
  86. package/dist/core/services/index.d.ts.map +1 -0
  87. package/dist/core/services/index.js +10 -0
  88. package/dist/core/services/index.js.map +1 -0
  89. package/dist/{services → core/services}/library.d.ts +2 -2
  90. package/dist/core/services/library.d.ts.map +1 -0
  91. package/dist/{services → core/services}/library.js +1 -1
  92. package/dist/core/services/library.js.map +1 -0
  93. package/dist/{services → core/services}/tag.d.ts +2 -2
  94. package/dist/core/services/tag.d.ts.map +1 -0
  95. package/dist/{services → core/services}/tag.js +1 -1
  96. package/dist/core/services/tag.js.map +1 -0
  97. package/dist/{services → core/services}/track.d.ts +2 -2
  98. package/dist/core/services/track.d.ts.map +1 -0
  99. package/dist/{services → core/services}/track.js +1 -1
  100. package/dist/core/services/track.js.map +1 -0
  101. package/dist/{services → core/services}/track.utils.d.ts +2 -2
  102. package/dist/core/services/track.utils.d.ts.map +1 -0
  103. package/dist/core/services/track.utils.js.map +1 -0
  104. package/dist/{services → core/services}/user.d.ts +2 -2
  105. package/dist/core/services/user.d.ts.map +1 -0
  106. package/dist/{services → core/services}/user.js +1 -1
  107. package/dist/core/services/user.js.map +1 -0
  108. package/dist/entrypoints/album.d.ts +3 -3
  109. package/dist/entrypoints/album.d.ts.map +1 -1
  110. package/dist/entrypoints/album.js +2 -2
  111. package/dist/entrypoints/album.js.map +1 -1
  112. package/dist/entrypoints/album.schemas.d.ts +2 -1
  113. package/dist/entrypoints/album.schemas.d.ts.map +1 -1
  114. package/dist/entrypoints/album.schemas.js +1 -2
  115. package/dist/entrypoints/album.schemas.js.map +1 -1
  116. package/dist/entrypoints/artist.d.ts +3 -3
  117. package/dist/entrypoints/artist.d.ts.map +1 -1
  118. package/dist/entrypoints/artist.js +2 -2
  119. package/dist/entrypoints/artist.js.map +1 -1
  120. package/dist/entrypoints/artist.schemas.d.ts +2 -1
  121. package/dist/entrypoints/artist.schemas.d.ts.map +1 -1
  122. package/dist/entrypoints/artist.schemas.js +1 -2
  123. package/dist/entrypoints/artist.schemas.js.map +1 -1
  124. package/dist/entrypoints/auth.d.ts +3 -3
  125. package/dist/entrypoints/auth.d.ts.map +1 -1
  126. package/dist/entrypoints/auth.js +2 -2
  127. package/dist/entrypoints/auth.js.map +1 -1
  128. package/dist/entrypoints/auth.schemas.d.ts +2 -1
  129. package/dist/entrypoints/auth.schemas.d.ts.map +1 -1
  130. package/dist/entrypoints/auth.schemas.js +1 -2
  131. package/dist/entrypoints/auth.schemas.js.map +1 -1
  132. package/dist/entrypoints/base.schemas.d.ts +2 -1
  133. package/dist/entrypoints/base.schemas.d.ts.map +1 -1
  134. package/dist/entrypoints/base.schemas.js +1 -2
  135. package/dist/entrypoints/base.schemas.js.map +1 -1
  136. package/dist/entrypoints/chart.d.ts +3 -3
  137. package/dist/entrypoints/chart.d.ts.map +1 -1
  138. package/dist/entrypoints/chart.js +2 -2
  139. package/dist/entrypoints/chart.js.map +1 -1
  140. package/dist/entrypoints/chart.schemas.d.ts +2 -1
  141. package/dist/entrypoints/chart.schemas.d.ts.map +1 -1
  142. package/dist/entrypoints/chart.schemas.js +1 -2
  143. package/dist/entrypoints/chart.schemas.js.map +1 -1
  144. package/dist/entrypoints/core.d.ts +5 -0
  145. package/dist/entrypoints/core.d.ts.map +1 -0
  146. package/dist/entrypoints/core.js +5 -0
  147. package/dist/entrypoints/core.js.map +1 -0
  148. package/dist/entrypoints/core.schemas.d.ts +3 -0
  149. package/dist/entrypoints/core.schemas.d.ts.map +1 -0
  150. package/dist/entrypoints/core.schemas.js +2 -0
  151. package/dist/entrypoints/core.schemas.js.map +1 -0
  152. package/dist/entrypoints/exporter.d.ts +3 -0
  153. package/dist/entrypoints/exporter.d.ts.map +1 -0
  154. package/dist/entrypoints/exporter.js +3 -0
  155. package/dist/entrypoints/exporter.js.map +1 -0
  156. package/dist/entrypoints/exporter.schemas.d.ts +3 -0
  157. package/dist/entrypoints/exporter.schemas.d.ts.map +1 -0
  158. package/dist/entrypoints/exporter.schemas.js +2 -0
  159. package/dist/entrypoints/exporter.schemas.js.map +1 -0
  160. package/dist/entrypoints/geo.d.ts +3 -3
  161. package/dist/entrypoints/geo.d.ts.map +1 -1
  162. package/dist/entrypoints/geo.js +2 -2
  163. package/dist/entrypoints/geo.js.map +1 -1
  164. package/dist/entrypoints/geo.schemas.d.ts +2 -1
  165. package/dist/entrypoints/geo.schemas.d.ts.map +1 -1
  166. package/dist/entrypoints/geo.schemas.js +1 -2
  167. package/dist/entrypoints/geo.schemas.js.map +1 -1
  168. package/dist/entrypoints/insights.d.ts +4 -0
  169. package/dist/entrypoints/insights.d.ts.map +1 -0
  170. package/dist/entrypoints/insights.js +3 -0
  171. package/dist/entrypoints/insights.js.map +1 -0
  172. package/dist/entrypoints/insights.schemas.d.ts +3 -0
  173. package/dist/entrypoints/insights.schemas.d.ts.map +1 -0
  174. package/dist/entrypoints/insights.schemas.js +2 -0
  175. package/dist/entrypoints/insights.schemas.js.map +1 -0
  176. package/dist/entrypoints/library.d.ts +3 -3
  177. package/dist/entrypoints/library.d.ts.map +1 -1
  178. package/dist/entrypoints/library.js +2 -2
  179. package/dist/entrypoints/library.js.map +1 -1
  180. package/dist/entrypoints/library.schemas.d.ts +2 -1
  181. package/dist/entrypoints/library.schemas.d.ts.map +1 -1
  182. package/dist/entrypoints/library.schemas.js +1 -2
  183. package/dist/entrypoints/library.schemas.js.map +1 -1
  184. package/dist/entrypoints/playlists.d.ts +3 -0
  185. package/dist/entrypoints/playlists.d.ts.map +1 -0
  186. package/dist/entrypoints/playlists.js +3 -0
  187. package/dist/entrypoints/playlists.js.map +1 -0
  188. package/dist/entrypoints/playlists.schemas.d.ts +3 -0
  189. package/dist/entrypoints/playlists.schemas.d.ts.map +1 -0
  190. package/dist/entrypoints/playlists.schemas.js +2 -0
  191. package/dist/entrypoints/playlists.schemas.js.map +1 -0
  192. package/dist/entrypoints/reports.d.ts +4 -0
  193. package/dist/entrypoints/reports.d.ts.map +1 -0
  194. package/dist/entrypoints/reports.js +3 -0
  195. package/dist/entrypoints/reports.js.map +1 -0
  196. package/dist/entrypoints/reports.schemas.d.ts +3 -0
  197. package/dist/entrypoints/reports.schemas.d.ts.map +1 -0
  198. package/dist/entrypoints/reports.schemas.js +2 -0
  199. package/dist/entrypoints/reports.schemas.js.map +1 -0
  200. package/dist/entrypoints/tag.d.ts +3 -3
  201. package/dist/entrypoints/tag.d.ts.map +1 -1
  202. package/dist/entrypoints/tag.js +2 -2
  203. package/dist/entrypoints/tag.js.map +1 -1
  204. package/dist/entrypoints/tag.schemas.d.ts +2 -1
  205. package/dist/entrypoints/tag.schemas.d.ts.map +1 -1
  206. package/dist/entrypoints/tag.schemas.js +1 -2
  207. package/dist/entrypoints/tag.schemas.js.map +1 -1
  208. package/dist/entrypoints/track.d.ts +3 -3
  209. package/dist/entrypoints/track.d.ts.map +1 -1
  210. package/dist/entrypoints/track.js +2 -2
  211. package/dist/entrypoints/track.js.map +1 -1
  212. package/dist/entrypoints/track.schemas.d.ts +2 -1
  213. package/dist/entrypoints/track.schemas.d.ts.map +1 -1
  214. package/dist/entrypoints/track.schemas.js +1 -2
  215. package/dist/entrypoints/track.schemas.js.map +1 -1
  216. package/dist/entrypoints/user.d.ts +3 -3
  217. package/dist/entrypoints/user.d.ts.map +1 -1
  218. package/dist/entrypoints/user.js +2 -2
  219. package/dist/entrypoints/user.js.map +1 -1
  220. package/dist/entrypoints/user.schemas.d.ts +2 -1
  221. package/dist/entrypoints/user.schemas.d.ts.map +1 -1
  222. package/dist/entrypoints/user.schemas.js +1 -2
  223. package/dist/entrypoints/user.schemas.js.map +1 -1
  224. package/dist/exporter/engines/library.d.ts +4 -0
  225. package/dist/exporter/engines/library.d.ts.map +1 -0
  226. package/dist/exporter/engines/library.js +34 -0
  227. package/dist/exporter/engines/library.js.map +1 -0
  228. package/dist/exporter/engines/loved.d.ts +4 -0
  229. package/dist/exporter/engines/loved.d.ts.map +1 -0
  230. package/dist/exporter/engines/loved.js +35 -0
  231. package/dist/exporter/engines/loved.js.map +1 -0
  232. package/dist/exporter/engines/scrobbles.d.ts +4 -0
  233. package/dist/exporter/engines/scrobbles.d.ts.map +1 -0
  234. package/dist/exporter/engines/scrobbles.js +74 -0
  235. package/dist/exporter/engines/scrobbles.js.map +1 -0
  236. package/dist/exporter/formats/csv.d.ts +5 -0
  237. package/dist/exporter/formats/csv.d.ts.map +1 -0
  238. package/dist/exporter/formats/csv.js +35 -0
  239. package/dist/exporter/formats/csv.js.map +1 -0
  240. package/dist/exporter/formats/jsonl.d.ts +2 -0
  241. package/dist/exporter/formats/jsonl.d.ts.map +1 -0
  242. package/dist/exporter/formats/jsonl.js +4 -0
  243. package/dist/exporter/formats/jsonl.js.map +1 -0
  244. package/dist/exporter/formats/listenbrainz.d.ts +3 -0
  245. package/dist/exporter/formats/listenbrainz.d.ts.map +1 -0
  246. package/dist/exporter/formats/listenbrainz.js +19 -0
  247. package/dist/exporter/formats/listenbrainz.js.map +1 -0
  248. package/dist/exporter/index.d.ts +6 -0
  249. package/dist/exporter/index.d.ts.map +1 -0
  250. package/dist/exporter/index.js +6 -0
  251. package/dist/exporter/index.js.map +1 -0
  252. package/dist/exporter/schemas.d.ts +291 -0
  253. package/dist/exporter/schemas.d.ts.map +1 -0
  254. package/dist/exporter/schemas.js +81 -0
  255. package/dist/exporter/schemas.js.map +1 -0
  256. package/dist/exporter/service.d.ts +30 -0
  257. package/dist/exporter/service.d.ts.map +1 -0
  258. package/dist/exporter/service.js +11 -0
  259. package/dist/exporter/service.js.map +1 -0
  260. package/dist/index.d.ts +14 -22
  261. package/dist/index.d.ts.map +1 -1
  262. package/dist/index.js +17 -15
  263. package/dist/index.js.map +1 -1
  264. package/dist/insights/algorithms/album-habits.d.ts +7 -0
  265. package/dist/insights/algorithms/album-habits.d.ts.map +1 -0
  266. package/dist/insights/algorithms/album-habits.js +154 -0
  267. package/dist/insights/algorithms/album-habits.js.map +1 -0
  268. package/dist/insights/algorithms/binges.d.ts +8 -0
  269. package/dist/insights/algorithms/binges.d.ts.map +1 -0
  270. package/dist/insights/algorithms/binges.js +53 -0
  271. package/dist/insights/algorithms/binges.js.map +1 -0
  272. package/dist/insights/algorithms/compare.d.ts +8 -0
  273. package/dist/insights/algorithms/compare.d.ts.map +1 -0
  274. package/dist/insights/algorithms/compare.js +39 -0
  275. package/dist/insights/algorithms/compare.js.map +1 -0
  276. package/dist/insights/algorithms/decay.d.ts +11 -0
  277. package/dist/insights/algorithms/decay.d.ts.map +1 -0
  278. package/dist/insights/algorithms/decay.js +154 -0
  279. package/dist/insights/algorithms/decay.js.map +1 -0
  280. package/dist/insights/algorithms/discoveries.d.ts +8 -0
  281. package/dist/insights/algorithms/discoveries.d.ts.map +1 -0
  282. package/dist/insights/algorithms/discoveries.js +53 -0
  283. package/dist/insights/algorithms/discoveries.js.map +1 -0
  284. package/dist/insights/algorithms/genres.d.ts +11 -0
  285. package/dist/insights/algorithms/genres.d.ts.map +1 -0
  286. package/dist/insights/algorithms/genres.js +201 -0
  287. package/dist/insights/algorithms/genres.js.map +1 -0
  288. package/dist/insights/algorithms/group.d.ts +8 -0
  289. package/dist/insights/algorithms/group.d.ts.map +1 -0
  290. package/dist/insights/algorithms/group.js +127 -0
  291. package/dist/insights/algorithms/group.js.map +1 -0
  292. package/dist/insights/algorithms/hours.d.ts +8 -0
  293. package/dist/insights/algorithms/hours.d.ts.map +1 -0
  294. package/dist/insights/algorithms/hours.js +43 -0
  295. package/dist/insights/algorithms/hours.js.map +1 -0
  296. package/dist/insights/algorithms/mood.d.ts +8 -0
  297. package/dist/insights/algorithms/mood.d.ts.map +1 -0
  298. package/dist/insights/algorithms/mood.js +53 -0
  299. package/dist/insights/algorithms/mood.js.map +1 -0
  300. package/dist/insights/algorithms/now-playing.d.ts +20 -0
  301. package/dist/insights/algorithms/now-playing.d.ts.map +1 -0
  302. package/dist/insights/algorithms/now-playing.js +128 -0
  303. package/dist/insights/algorithms/now-playing.js.map +1 -0
  304. package/dist/insights/algorithms/obscurity.d.ts +27 -0
  305. package/dist/insights/algorithms/obscurity.d.ts.map +1 -0
  306. package/dist/insights/algorithms/obscurity.js +158 -0
  307. package/dist/insights/algorithms/obscurity.js.map +1 -0
  308. package/dist/insights/algorithms/personality.d.ts +8 -0
  309. package/dist/insights/algorithms/personality.d.ts.map +1 -0
  310. package/dist/insights/algorithms/personality.js +42 -0
  311. package/dist/insights/algorithms/personality.js.map +1 -0
  312. package/dist/insights/algorithms/recommendations.d.ts +11 -0
  313. package/dist/insights/algorithms/recommendations.d.ts.map +1 -0
  314. package/dist/insights/algorithms/recommendations.js +121 -0
  315. package/dist/insights/algorithms/recommendations.js.map +1 -0
  316. package/dist/insights/algorithms/streaks.d.ts +11 -0
  317. package/dist/insights/algorithms/streaks.d.ts.map +1 -0
  318. package/dist/insights/algorithms/streaks.js +178 -0
  319. package/dist/insights/algorithms/streaks.js.map +1 -0
  320. package/dist/insights/algorithms/summary.d.ts +8 -0
  321. package/dist/insights/algorithms/summary.d.ts.map +1 -0
  322. package/dist/insights/algorithms/summary.js +117 -0
  323. package/dist/insights/algorithms/summary.js.map +1 -0
  324. package/dist/insights/algorithms/trends.d.ts +8 -0
  325. package/dist/insights/algorithms/trends.d.ts.map +1 -0
  326. package/dist/insights/algorithms/trends.js +96 -0
  327. package/dist/insights/algorithms/trends.js.map +1 -0
  328. package/dist/insights/index.d.ts +3 -0
  329. package/dist/insights/index.d.ts.map +1 -0
  330. package/dist/insights/index.js +3 -0
  331. package/dist/insights/index.js.map +1 -0
  332. package/dist/insights/lib/binges.d.ts +31 -0
  333. package/dist/insights/lib/binges.d.ts.map +1 -0
  334. package/dist/insights/lib/binges.js +61 -0
  335. package/dist/insights/lib/binges.js.map +1 -0
  336. package/dist/insights/lib/compare.d.ts +31 -0
  337. package/dist/insights/lib/compare.d.ts.map +1 -0
  338. package/dist/insights/lib/compare.js +68 -0
  339. package/dist/insights/lib/compare.js.map +1 -0
  340. package/dist/insights/lib/discoveries.d.ts +17 -0
  341. package/dist/insights/lib/discoveries.d.ts.map +1 -0
  342. package/dist/insights/lib/discoveries.js +24 -0
  343. package/dist/insights/lib/discoveries.js.map +1 -0
  344. package/dist/insights/lib/diversity.d.ts +28 -0
  345. package/dist/insights/lib/diversity.d.ts.map +1 -0
  346. package/dist/insights/lib/diversity.js +39 -0
  347. package/dist/insights/lib/diversity.js.map +1 -0
  348. package/dist/insights/lib/hours.d.ts +39 -0
  349. package/dist/insights/lib/hours.d.ts.map +1 -0
  350. package/dist/insights/lib/hours.js +66 -0
  351. package/dist/insights/lib/hours.js.map +1 -0
  352. package/dist/insights/lib/mood.d.ts +22 -0
  353. package/dist/insights/lib/mood.d.ts.map +1 -0
  354. package/dist/insights/lib/mood.js +187 -0
  355. package/dist/insights/lib/mood.js.map +1 -0
  356. package/dist/insights/lib/periods.d.ts +17 -0
  357. package/dist/insights/lib/periods.d.ts.map +1 -0
  358. package/dist/insights/lib/periods.js +66 -0
  359. package/dist/insights/lib/periods.js.map +1 -0
  360. package/dist/insights/lib/personality.d.ts +30 -0
  361. package/dist/insights/lib/personality.d.ts.map +1 -0
  362. package/dist/insights/lib/personality.js +131 -0
  363. package/dist/insights/lib/personality.js.map +1 -0
  364. package/dist/insights/lib/trends.d.ts +30 -0
  365. package/dist/insights/lib/trends.d.ts.map +1 -0
  366. package/dist/insights/lib/trends.js +67 -0
  367. package/dist/insights/lib/trends.js.map +1 -0
  368. package/dist/insights/schemas.d.ts +1415 -0
  369. package/dist/insights/schemas.d.ts.map +1 -0
  370. package/dist/insights/schemas.js +596 -0
  371. package/dist/insights/schemas.js.map +1 -0
  372. package/dist/insights/service.d.ts +191 -0
  373. package/dist/insights/service.d.ts.map +1 -0
  374. package/dist/insights/service.js +44 -0
  375. package/dist/insights/service.js.map +1 -0
  376. package/dist/playlists/formatters/csv.d.ts +3 -0
  377. package/dist/playlists/formatters/csv.d.ts.map +1 -0
  378. package/dist/playlists/formatters/csv.js +18 -0
  379. package/dist/playlists/formatters/csv.js.map +1 -0
  380. package/dist/playlists/formatters/m3u.d.ts +3 -0
  381. package/dist/playlists/formatters/m3u.d.ts.map +1 -0
  382. package/dist/playlists/formatters/m3u.js +10 -0
  383. package/dist/playlists/formatters/m3u.js.map +1 -0
  384. package/dist/playlists/formatters/spotifymatch.d.ts +3 -0
  385. package/dist/playlists/formatters/spotifymatch.d.ts.map +1 -0
  386. package/dist/playlists/formatters/spotifymatch.js +4 -0
  387. package/dist/playlists/formatters/spotifymatch.js.map +1 -0
  388. package/dist/playlists/generators/generator.d.ts +4 -0
  389. package/dist/playlists/generators/generator.d.ts.map +1 -0
  390. package/dist/playlists/generators/generator.js +158 -0
  391. package/dist/playlists/generators/generator.js.map +1 -0
  392. package/dist/playlists/index.d.ts +6 -0
  393. package/dist/playlists/index.d.ts.map +1 -0
  394. package/dist/playlists/index.js +6 -0
  395. package/dist/playlists/index.js.map +1 -0
  396. package/dist/playlists/schemas.d.ts +150 -0
  397. package/dist/playlists/schemas.d.ts.map +1 -0
  398. package/dist/playlists/schemas.js +53 -0
  399. package/dist/playlists/schemas.js.map +1 -0
  400. package/dist/playlists/service.d.ts +28 -0
  401. package/dist/playlists/service.d.ts.map +1 -0
  402. package/dist/playlists/service.js +27 -0
  403. package/dist/playlists/service.js.map +1 -0
  404. package/dist/reports/generators/digest.d.ts +4 -0
  405. package/dist/reports/generators/digest.d.ts.map +1 -0
  406. package/dist/reports/generators/digest.js +95 -0
  407. package/dist/reports/generators/digest.js.map +1 -0
  408. package/dist/reports/generators/milestones.d.ts +4 -0
  409. package/dist/reports/generators/milestones.d.ts.map +1 -0
  410. package/dist/reports/generators/milestones.js +59 -0
  411. package/dist/reports/generators/milestones.js.map +1 -0
  412. package/dist/reports/generators/wrapped.d.ts +4 -0
  413. package/dist/reports/generators/wrapped.d.ts.map +1 -0
  414. package/dist/reports/generators/wrapped.js +179 -0
  415. package/dist/reports/generators/wrapped.js.map +1 -0
  416. package/dist/reports/index.d.ts +3 -0
  417. package/dist/reports/index.d.ts.map +1 -0
  418. package/dist/reports/index.js +3 -0
  419. package/dist/reports/index.js.map +1 -0
  420. package/dist/reports/schemas.d.ts +244 -0
  421. package/dist/reports/schemas.d.ts.map +1 -0
  422. package/dist/reports/schemas.js +92 -0
  423. package/dist/reports/schemas.js.map +1 -0
  424. package/dist/reports/service.d.ts +30 -0
  425. package/dist/reports/service.d.ts.map +1 -0
  426. package/dist/reports/service.js +11 -0
  427. package/dist/reports/service.js.map +1 -0
  428. package/package.json +44 -4
  429. package/dist/services/album.d.ts.map +0 -1
  430. package/dist/services/album.js.map +0 -1
  431. package/dist/services/album.schemas.d.ts.map +0 -1
  432. package/dist/services/album.schemas.js.map +0 -1
  433. package/dist/services/artist.d.ts.map +0 -1
  434. package/dist/services/artist.js.map +0 -1
  435. package/dist/services/artist.schemas.d.ts.map +0 -1
  436. package/dist/services/artist.schemas.js.map +0 -1
  437. package/dist/services/auth.d.ts.map +0 -1
  438. package/dist/services/auth.js.map +0 -1
  439. package/dist/services/auth.schemas.d.ts.map +0 -1
  440. package/dist/services/auth.schemas.js.map +0 -1
  441. package/dist/services/chart.d.ts.map +0 -1
  442. package/dist/services/chart.js.map +0 -1
  443. package/dist/services/chart.schemas.d.ts.map +0 -1
  444. package/dist/services/chart.schemas.js.map +0 -1
  445. package/dist/services/geo.d.ts.map +0 -1
  446. package/dist/services/geo.js.map +0 -1
  447. package/dist/services/geo.schemas.d.ts.map +0 -1
  448. package/dist/services/geo.schemas.js.map +0 -1
  449. package/dist/services/index.d.ts.map +0 -1
  450. package/dist/services/index.js +0 -21
  451. package/dist/services/index.js.map +0 -1
  452. package/dist/services/library.d.ts.map +0 -1
  453. package/dist/services/library.js.map +0 -1
  454. package/dist/services/library.schemas.d.ts.map +0 -1
  455. package/dist/services/library.schemas.js.map +0 -1
  456. package/dist/services/schemas/base.entities.schemas.d.ts.map +0 -1
  457. package/dist/services/schemas/base.entities.schemas.js.map +0 -1
  458. package/dist/services/schemas/base.entity-names.schemas.d.ts.map +0 -1
  459. package/dist/services/schemas/base.entity-names.schemas.js.map +0 -1
  460. package/dist/services/schemas/base.metadata.schemas.d.ts.map +0 -1
  461. package/dist/services/schemas/base.metadata.schemas.js.map +0 -1
  462. package/dist/services/schemas/base.pagination.schemas.d.ts.map +0 -1
  463. package/dist/services/schemas/base.pagination.schemas.js.map +0 -1
  464. package/dist/services/schemas/base.primitives.schemas.d.ts.map +0 -1
  465. package/dist/services/schemas/base.primitives.schemas.js.map +0 -1
  466. package/dist/services/schemas/index.d.ts.map +0 -1
  467. package/dist/services/schemas/index.js.map +0 -1
  468. package/dist/services/tag.d.ts.map +0 -1
  469. package/dist/services/tag.js.map +0 -1
  470. package/dist/services/tag.schemas.d.ts.map +0 -1
  471. package/dist/services/tag.schemas.js.map +0 -1
  472. package/dist/services/track.d.ts.map +0 -1
  473. package/dist/services/track.js.map +0 -1
  474. package/dist/services/track.schemas.d.ts.map +0 -1
  475. package/dist/services/track.schemas.js.map +0 -1
  476. package/dist/services/track.utils.d.ts.map +0 -1
  477. package/dist/services/track.utils.js.map +0 -1
  478. package/dist/services/user.d.ts.map +0 -1
  479. package/dist/services/user.js.map +0 -1
  480. package/dist/services/user.schemas.d.ts.map +0 -1
  481. package/dist/services/user.schemas.js.map +0 -1
  482. /package/dist/{services → core/schemas}/album.schemas.d.ts +0 -0
  483. /package/dist/{services → core/schemas}/artist.schemas.d.ts +0 -0
  484. /package/dist/{services → core/schemas}/auth.schemas.d.ts +0 -0
  485. /package/dist/{services → core/schemas}/auth.schemas.js +0 -0
  486. /package/dist/{services/schemas → core/schemas/base}/base.entities.schemas.d.ts +0 -0
  487. /package/dist/{services/schemas → core/schemas/base}/base.entities.schemas.js +0 -0
  488. /package/dist/{services/schemas → core/schemas/base}/base.entity-names.schemas.d.ts +0 -0
  489. /package/dist/{services/schemas → core/schemas/base}/base.entity-names.schemas.js +0 -0
  490. /package/dist/{services/schemas → core/schemas/base}/base.metadata.schemas.d.ts +0 -0
  491. /package/dist/{services/schemas → core/schemas/base}/base.metadata.schemas.js +0 -0
  492. /package/dist/{services/schemas → core/schemas/base}/base.pagination.schemas.d.ts +0 -0
  493. /package/dist/{services/schemas → core/schemas/base}/base.pagination.schemas.js +0 -0
  494. /package/dist/{services/schemas → core/schemas/base}/base.primitives.schemas.d.ts +0 -0
  495. /package/dist/{services/schemas → core/schemas/base}/base.primitives.schemas.js +0 -0
  496. /package/dist/{services/schemas → core/schemas/base}/index.d.ts +0 -0
  497. /package/dist/{services/schemas → core/schemas/base}/index.js +0 -0
  498. /package/dist/{services → core/schemas}/chart.schemas.d.ts +0 -0
  499. /package/dist/{services → core/schemas}/geo.schemas.d.ts +0 -0
  500. /package/dist/{services → core/schemas}/library.schemas.d.ts +0 -0
  501. /package/dist/{services → core/schemas}/tag.schemas.d.ts +0 -0
  502. /package/dist/{services → core/schemas}/track.schemas.d.ts +0 -0
  503. /package/dist/{services → core/schemas}/user.schemas.d.ts +0 -0
  504. /package/dist/{services → core/services}/track.utils.js +0 -0
package/CHANGELOG.md CHANGED
@@ -9,6 +9,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
  > [ansango/lastfm-api](https://github.com/ansango/lastfm-api). Entries below preserve the
10
10
  > historical package and repository names used by their original releases.
11
11
 
12
+ ## [3.4.0] - 2026-08-28
13
+
14
+ ### ✨ Features
15
+
16
+ - **insights**: implement compareUsers with Jaccard affinity index (closes #125) ([95f39d6](https://github.com/ansango/lastfm-api/commit/95f39d6))
17
+ - **insights**: implement getMood psychometric classifier and getPersonality archetypes (closes #124) ([0aae0e8](https://github.com/ansango/lastfm-api/commit/0aae0e8))
18
+ - **insights**: implement getTrends ranking diff and getDiscoveries new-artist detector (closes #123) ([1a07234](https://github.com/ansango/lastfm-api/commit/1a07234))
19
+ - **insights**: implement getHoursHistogram and getBinges temporal analytics (closes #122) ([7615ba9](https://github.com/ansango/lastfm-api/commit/7615ba9))
20
+ - **insights**: implement getNowPlaying with artist bio and similarity enrichment (closes #121) ([9de9213](https://github.com/ansango/lastfm-api/commit/9de9213))
21
+ - **insights**: register getSummary route in method registry and Scalar OpenAPI docs ([875bafe](https://github.com/ansango/lastfm-api/commit/875bafe))
22
+ - **insights**: implement getSummary with Shannon diversity index (closes #120) ([28b03b0](https://github.com/ansango/lastfm-api/commit/28b03b0))
23
+ - **insights**: wire insights namespace in method registry ([2d1db4d](https://github.com/ansango/lastfm-api/commit/2d1db4d))
24
+ - **insights**: base architecture, Zod schemas infrastructure, and client wiring (closes #119) ([6ce9d4e](https://github.com/ansango/lastfm-api/commit/6ce9d4e))
25
+
26
+ ### 📚 Documentation
27
+
28
+ - **insights**: add dedicated OpenAPI descriptions in Scalar for all 9 insight methods ([1115785](https://github.com/ansango/lastfm-api/commit/1115785))
29
+ - **insights**: documentation, OpenAPI Scalar integration, and CLI migration guide (closes #126) ([f325696](https://github.com/ansango/lastfm-api/commit/f325696))
30
+
31
+ ### 🔧 Chores
32
+
33
+ - remove PROJECT_IDEAS.md ([a837c39](https://github.com/ansango/lastfm-api/commit/a837c39))
34
+ - update dependencies and configuration files - Bump @types/node to version 26.4.0 in package.json and bun.lock - Modify build script in package.json to use tsconfig.build.json - Update changelog script to handle undefined tags - Refactor recent tracks test for better readability - Adjust tsconfig files for improved build and development settings - Add tsconfig.build.json for build-specific configurations - Update .gitignore to exclude AGENTS.md ([2a1687f](https://github.com/ansango/lastfm-api/commit/2a1687f))
35
+
36
+
12
37
  ## [3.3.0] - 2026-08-28
13
38
 
14
39
  ### ✨ Features
package/README.md CHANGED
@@ -14,7 +14,8 @@ A universal Last.fm API client for Node.js and Browser, written in TypeScript.
14
14
  ## Features
15
15
 
16
16
  - ✅ **Universal**: Works in Node.js (≥20.0.0) and Browser
17
- - ✅ **Complete coverage**: All 57 canonical Last.fm API methods across 9 namespaces
17
+ - ✅ **Complete coverage**: All 56 canonical Last.fm API methods across 9 namespaces
18
+ - ✅ **Insights & Analytics Engine**: 9 high-level derived analytical views (Shannon diversity, enriched Now Playing, diurnal histograms, binge runs, ranking diffs, new discoveries, 2D mood classification, personality archetypes, and Jaccard user comparison)
18
19
  - ✅ **TypeScript**: Full type safety with comprehensive type definitions
19
20
  - ✅ **Zod Schemas**: Runtime validation schemas for all types
20
21
  - ✅ **ESM**: Modern ES modules with tree-shaking support
@@ -130,7 +131,14 @@ const libraryArtists = await client.library.getArtists({ user: 'ansango' });
130
131
  // Auth service (for scrobbling and authenticated methods)
131
132
  const session = await client.auth.getSession({ token: 'AUTH_TOKEN' });
132
133
  // Request an auth token (signed GET, no sk)
133
- const { token } = await client.auth.getToken();
134
+ const { token, authUrl } = await client.auth.getToken();
135
+
136
+ // Insights & analytics engine
137
+ const summary = await client.insights.getSummary({ user: 'ansango', period: '7day' });
138
+ const nowPlaying = await client.insights.getNowPlaying({ user: 'ansango' });
139
+ const mood = await client.insights.getMood({ user: 'ansango', period: '1month' });
140
+ const personality = await client.insights.getPersonality({ user: 'ansango' });
141
+ const comparison = await client.insights.compareUsers({ userA: 'ansango', userB: 'friend' });
134
142
 
135
143
  // Now-playing and tag/love mutations (all require an authenticated session)
136
144
  await client.track.updateNowPlaying({
@@ -214,6 +222,7 @@ const tracks = await trackService.search({ track: 'Come Together' });
214
222
  - `@ansango/lastfm-api/geo`
215
223
  - `@ansango/lastfm-api/library`
216
224
  - `@ansango/lastfm-api/auth`
225
+ - `@ansango/lastfm-api/insights`
217
226
 
218
227
  ## Zod Schema Validation
219
228
 
@@ -262,8 +271,183 @@ if (result.success) {
262
271
  - `@ansango/lastfm-api/geo/schemas`
263
272
  - `@ansango/lastfm-api/library/schemas`
264
273
  - `@ansango/lastfm-api/auth/schemas`
274
+ - `@ansango/lastfm-api/insights/schemas`
265
275
  - `@ansango/lastfm-api/schemas` (base types like `imageSchema`, `datePropSchema`, etc.)
266
276
 
277
+ ## Insights & Analytics Engine
278
+
279
+ The package includes a comprehensive, built-in analytics engine providing 20 high-level derived views and statistical metrics computed over Last.fm data:
280
+
281
+ ```typescript
282
+ import { createClient } from '@ansango/lastfm-api';
283
+
284
+ const client = createClient();
285
+
286
+ // 1. Summary & Shannon Diversity
287
+ const summary = await client.insights.getSummary({ user: 'ansango', period: '7day' });
288
+ console.log(`Total Scrobbles: ${summary.totalScrobbles}, Normalized Diversity: ${summary.diversity?.normalized}`);
289
+
290
+ // 2. Enriched Now Playing with Artist Biography and Similar Artists
291
+ const nowPlaying = await client.insights.getNowPlaying({ user: 'ansango', similarLimit: 3 });
292
+
293
+ // 3. Diurnal & Weekday Histogram
294
+ const histogram = await client.insights.getHoursHistogram({ user: 'ansango', sinceDays: 30 });
295
+ console.log(`Peak Hour: ${histogram.peakHour}:00, Night Share: ${(histogram.nightShare * 100).toFixed(0)}%`);
296
+
297
+ // 4. Binge Listening Streak Detection
298
+ const binges = await client.insights.getBinges({ user: 'ansango', minLength: 3, maxGapSeconds: 1800 });
299
+
300
+ // 5. Ranking Trends Differentials (Risers, Fallers, Newcomers, Departures)
301
+ const trends = await client.insights.getTrends({
302
+ user: 'ansango',
303
+ target: 'artists',
304
+ currentPeriod: '7day',
305
+ previousPeriod: '1month'
306
+ });
307
+
308
+ // 6. New Artist Discoveries
309
+ const discoveries = await client.insights.getDiscoveries({ user: 'ansango', windowDays: 7 });
310
+
311
+ // 7. 2D Mood Classification (Energy vs. Valence)
312
+ const mood = await client.insights.getMood({ user: 'ansango', period: '1month' });
313
+ console.log(`Mood: ${mood.label} (Energy: ${mood.axes.energy}, Valence: ${mood.axes.valence})`);
314
+
315
+ // 8. Listener Personality Archetype
316
+ const personality = await client.insights.getPersonality({ user: 'ansango' });
317
+ console.log(`Archetype: ${personality.archetype.emoji} ${personality.archetype.name} - ${personality.archetype.blurb}`);
318
+
319
+ // 9. User-to-User Taste Clash (Jaccard Similarity)
320
+ const comparison = await client.insights.compareUsers({ userA: 'ansango', userB: 'friend' });
321
+ console.log(`Taste Compatibility: ${comparison.compatibilityScore}% (Jaccard: ${comparison.jaccard})`);
322
+
323
+ // 10. Obscurity & Hipster Score (Hidden Gems & Mainstream Anchors)
324
+ const obscurity = await client.insights.getObscurityScore({ user: 'ansango', limit: 20 });
325
+ console.log(`Score: ${obscurity.obscurityScore}/100 (${obscurity.category})`);
326
+
327
+ // 11. Forgotten Favorites (Revival Candidates)
328
+ const forgotten = await client.insights.getForgottenFavorites({ user: 'ansango', historicPeriod: '12month', recentPeriod: '1month' });
329
+
330
+ // 12. Listening Obsession Episodes
331
+ const obsessions = await client.insights.getObsessions({ user: 'ansango', windowSize: 20, thresholdRatio: 0.35 });
332
+
333
+ // 13. Consecutive Daily Streaks & Dry Spells
334
+ const streaks = await client.insights.getListeningStreaks({ user: 'ansango' });
335
+ console.log(`Longest Streak: ${streaks.longestStreakDays} days`);
336
+
337
+ // 14. 365-Day Daily Heatmap
338
+ const heatmap = await client.insights.getListeningHeatmap({ user: 'ansango', days: 90 });
339
+
340
+ // 15. Album Habits & Cohesion Score (Album Purist vs Playlist Shuffler)
341
+ const habits = await client.insights.getAlbumHabits({ user: 'ansango', minSessionTracks: 3 });
342
+ console.log(`Cohesion: ${habits.cohesionScore}% (${habits.profile})`);
343
+
344
+ // 16. Genre Breakdown with HHI Concentration Index
345
+ const genres = await client.insights.getGenreBreakdown({ user: 'ansango', period: 'overall' });
346
+ console.log(`Specialization: ${genres.specializationLevel} (HHI: ${genres.hhiIndex})`);
347
+
348
+ // 17. Genre Evolution & Temporal Shifts (Rising, Fading, New)
349
+ const evolution = await client.insights.getGenreEvolution({ user: 'ansango', currentPeriod: '1month', previousPeriod: '12month' });
350
+
351
+ // 18. Smart Similarity Graph Recommendations
352
+ const recs = await client.insights.getSmartRecommendations({ user: 'ansango', seedLimit: 5, limit: 10 });
353
+
354
+ // 19. Bridge Artists Connecting Two Disparate Genres
355
+ const bridges = await client.insights.getBridgeArtists({ tagA: 'post-punk', tagB: 'electronic' });
356
+
357
+ // 20. Multi-User Taste Group Comparison (Consensus & Outlier Detection)
358
+ const group = await client.insights.compareTasteGroup({ users: ['alice', 'bob', 'carol'], period: 'overall' });
359
+ console.log(`Group Average Compatibility: ${group.groupAverageCompatibility}%`);
360
+ ```
361
+
362
+ ## Reports & Wrapped Engine
363
+
364
+ Generate shareable annual recaps, historical milestones, and monthly digests:
365
+
366
+ ```typescript
367
+ import { createClient } from '@ansango/lastfm-api';
368
+
369
+ const client = createClient();
370
+
371
+ // 1. Year in Review / Wrapped
372
+ const wrapped = await client.reports.getWrapped({ user: 'ansango', year: 2024 });
373
+ console.log(`Top Artist of the Year: ${wrapped.topArtists[0].name}`);
374
+ console.log(`Summer Anthem: ${wrapped.seasons.summer.topTrack} by ${wrapped.seasons.summer.topArtist}`);
375
+ console.log(`Busiest Day: ${wrapped.busiestDay.date} (${wrapped.busiestDay.scrobbles} plays)`);
376
+
377
+ // 2. Scrobble Milestones Tracker & Projection
378
+ const milestones = await client.reports.getMilestones({ user: 'ansango', targets: [1000, 5000, 10000, 50000] });
379
+ console.log(`Next milestone: ${milestones.nextMilestone.target} scrobbles (ETA: ${milestones.nextMilestone.projectedDate})`);
380
+
381
+ // 3. Monthly Comparative Digest
382
+ const digest = await client.reports.getMonthlyDigest({ user: 'ansango', year: 2024, month: 2 });
383
+ console.log(`Growth vs previous month: ${digest.growthPercentage}%`);
384
+ ```
385
+
386
+ ## Smart Playlists Generator
387
+
388
+ Algorithmic playlist creation with direct export to standard formats:
389
+
390
+ ```typescript
391
+ import { createClient } from '@ansango/lastfm-api';
392
+
393
+ const client = createClient();
394
+
395
+ // Generate smart playlist (time-capsule, deep-cuts, heavy-rotation, discovery-radar)
396
+ const playlist = await client.playlists.generate({
397
+ user: 'ansango',
398
+ mode: 'time-capsule',
399
+ limit: 25,
400
+ });
401
+
402
+ // Pre-rendered standard formats:
403
+ console.log(playlist.formats.m3u); // Standard #EXTM3U playlist file content
404
+ console.log(playlist.formats.csv); // CSV spreadsheet
405
+ console.log(playlist.formats.spotifyQueries); // Spotify search query list
406
+ ```
407
+
408
+ ## Bulk Data Exporter & Backup
409
+
410
+ Resilient scrobble history export with checkpointing and multiple output formats:
411
+
412
+ ```typescript
413
+ import { createClient } from '@ansango/lastfm-api';
414
+
415
+ const client = createClient();
416
+
417
+ // Export scrobbles with ListenBrainz / JSONL / CSV formatting & checkpointing
418
+ const exportData = await client.exporter.exportScrobbles({
419
+ user: 'ansango',
420
+ format: 'listenbrainz', // 'json' | 'jsonl' | 'csv' | 'listenbrainz'
421
+ limit: 1000,
422
+ });
423
+
424
+ // Resumable checkpoint timestamp
425
+ console.log(`Resume from: ${exportData.nextCheckpointUts}`);
426
+ ```
427
+
428
+ ## Async Pagination & Streaming Iterators
429
+
430
+ Stream large Last.fm datasets seamlessly using standard `for await` loops:
431
+
432
+ ```typescript
433
+ import { createClient, iterateItems } from '@ansango/lastfm-api';
434
+
435
+ const client = createClient();
436
+
437
+ for await (const track of iterateItems(
438
+ (params) => client.user.getRecentTracks(params),
439
+ (res) => ({
440
+ items: res.recenttracks?.track ?? [],
441
+ totalPages: Number(res.recenttracks?.['@attr']?.totalPages ?? 1),
442
+ currentPage: Number(res.recenttracks?.['@attr']?.page ?? 1),
443
+ }),
444
+ { user: 'ansango', limit: 200 },
445
+ { maxItems: 1000 }
446
+ )) {
447
+ console.log(`${track.name} - ${track.artist['#text']}`);
448
+ }
449
+ ```
450
+
267
451
  ## Environment Variables
268
452
 
269
453
  In Node.js environments, the client automatically loads configuration from environment variables:
@@ -425,6 +609,7 @@ class LastFmClient {
425
609
  geo: GeoService;
426
610
  library: LibraryService;
427
611
  auth: AuthService;
612
+ insights: InsightsService;
428
613
 
429
614
  constructor(config?: Partial<LastFmConfig>);
430
615
  getConfig(): Readonly<LastFmConfig>;
@@ -450,7 +635,7 @@ function resetGlobalConfig(): void;
450
635
 
451
636
  ### Services
452
637
 
453
- The package covers all 57 canonical Last.fm API methods across 9 namespaces. See [docs/api-coverage.md](docs/api-coverage.md) for the full table.
638
+ The package covers all 56 canonical Last.fm API methods across 9 namespaces, plus 9 derived analytical methods in the `InsightsService`. See [docs/api-coverage.md](docs/api-coverage.md) for the full table.
454
639
 
455
640
  - **UserService**: 13 methods — `getInfo`, `getFriends`, `getLovedTracks`, `getRecentTracks`, `getTopAlbums`, `getTopArtists`, `getTopTags`, `getTopTracks`, `getWeeklyAlbumChart`, `getWeeklyArtistChart`, `getWeeklyChartList`, `getWeeklyTrackChart`, `getPersonalTags`
456
641
  - **AlbumService**: 6 methods — `getInfo`, `getTags`, `getTopTags`, `search`, `addTags`¹, `removeTag`¹
@@ -461,6 +646,7 @@ The package covers all 57 canonical Last.fm API methods across 9 namespaces. See
461
646
  - **GeoService**: 2 methods — `getTopArtists`, `getTopTracks`
462
647
  - **LibraryService**: 1 method — `getArtists`
463
648
  - **AuthService**: 2 methods — `getSession`, `getToken` (removed `getMobileSession` in v4.0.0)
649
+ - **InsightsService**: 9 methods — `getSummary`, `getNowPlaying`, `getHoursHistogram`, `getBinges`, `getTrends`, `getDiscoveries`, `getMood`, `getPersonality`, `compareUsers`
464
650
 
465
651
  ¹ Requires an authenticated session.
466
652
 
package/dist/client.d.ts CHANGED
@@ -1,5 +1,9 @@
1
1
  import type { LastFmConfig } from './config.js';
2
- import { type AlbumService, type ArtistService, type AuthService, type ChartService, type GeoService, type LibraryService, type TagService, type TrackService, type UserService } from './services/index.js';
2
+ import { type AlbumService, type ArtistService, type AuthService, type ChartService, type GeoService, type LibraryService, type TagService, type TrackService, type UserService } from './core/services/index.js';
3
+ import { type ExporterService } from './exporter/index.js';
4
+ import { type InsightsService } from './insights/index.js';
5
+ import { type PlaylistsService } from './playlists/index.js';
6
+ import { type ReportsService } from './reports/index.js';
3
7
  /**
4
8
  * Last.fm API Client
5
9
  *
@@ -29,6 +33,10 @@ export declare class LastFmClient {
29
33
  readonly geo: GeoService;
30
34
  readonly library: LibraryService;
31
35
  readonly auth: AuthService;
36
+ readonly insights: InsightsService;
37
+ readonly reports: ReportsService;
38
+ readonly playlists: PlaylistsService;
39
+ readonly exporter: ExporterService;
32
40
  private readonly config;
33
41
  constructor(config?: Partial<LastFmConfig>);
34
42
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,EAUjB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,MAAM,qBAAqB,CAAA;AAE5B;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,YAAY;IACxB,SAAgB,IAAI,EAAE,WAAW,CAAA;IACjC,SAAgB,KAAK,EAAE,YAAY,CAAA;IACnC,SAAgB,MAAM,EAAE,aAAa,CAAA;IACrC,SAAgB,KAAK,EAAE,YAAY,CAAA;IACnC,SAAgB,GAAG,EAAE,UAAU,CAAA;IAC/B,SAAgB,KAAK,EAAE,YAAY,CAAA;IACnC,SAAgB,GAAG,EAAE,UAAU,CAAA;IAC/B,SAAgB,OAAO,EAAE,cAAc,CAAA;IACvC,SAAgB,IAAI,EAAE,WAAW,CAAA;IAEjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;gBAEzB,MAAM,CAAC,EA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gB,SAAS,EAAE,gBAAgB,CAAA;IAC3C,SAAgB,QAAQ,EAAE,eAAe,CAAA;IAEzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;gBAEzB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;IAmB1C;;OAEG;IACH,SAAS,IAAI,QAAQ,CAAC,YAAY,CAAC;CAGnC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,CAEzE"}
package/dist/client.js CHANGED
@@ -1,5 +1,9 @@
1
1
  import { createConfig, getGlobalConfig } from './config.js';
2
- import { createAlbumService, createArtistService, createAuthService, createChartService, createGeoService, createLibraryService, createTagService, createTrackService, createUserService, } from './services/index.js';
2
+ import { createAlbumService, createArtistService, createAuthService, createChartService, createGeoService, createLibraryService, createTagService, createTrackService, createUserService, } from './core/services/index.js';
3
+ import { createExporterService } from './exporter/index.js';
4
+ import { createInsightsService } from './insights/index.js';
5
+ import { createPlaylistsService } from './playlists/index.js';
6
+ import { createReportsService } from './reports/index.js';
3
7
  /**
4
8
  * Last.fm API Client
5
9
  *
@@ -29,6 +33,10 @@ export class LastFmClient {
29
33
  geo;
30
34
  library;
31
35
  auth;
36
+ insights;
37
+ reports;
38
+ playlists;
39
+ exporter;
32
40
  config;
33
41
  constructor(config) {
34
42
  this.config = config ? createConfig(config) : getGlobalConfig();
@@ -42,6 +50,10 @@ export class LastFmClient {
42
50
  this.geo = createGeoService(this.config);
43
51
  this.library = createLibraryService(this.config);
44
52
  this.auth = createAuthService(this.config);
53
+ this.insights = createInsightsService(this.config);
54
+ this.reports = createReportsService(this.config);
55
+ this.playlists = createPlaylistsService(this.config);
56
+ this.exporter = createExporterService(this.config);
45
57
  }
46
58
  /**
47
59
  * Get the current configuration (read-only)
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EA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 -0,0 +1,25 @@
1
+ /**
2
+ * Canonical Last.fm method inventory.
3
+ *
4
+ * Single source of truth for the "56/56" coverage of the Last.fm API.
5
+ * (was 57/57; `auth.getMobileSession` removed in v4.0.0 — see #117.)
6
+ * Consumed by:
7
+ * - `src/__tests__/inventory.test.ts` — verifies that each method exists on the client
8
+ * - `src/method-registry.ts` — wires the docs tool (Hono + Scalar)
9
+ *
10
+ * Rules:
11
+ * - Only canonical Last.fm `namespace.method` pairs go here.
12
+ * - Wrapper/alias methods (e.g. `scrobbleMany`, `postTrackScrobble`,
13
+ * `postBatchTrackScrobble`) are excluded because they all target the
14
+ * same canonical endpoint (`track.scrobble`) and must not be
15
+ * double-counted.
16
+ *
17
+ * The per-namespace breakdown:
18
+ * - artist (10), album (6), track (12), user (13), tag (7),
19
+ * chart (3), geo (2), library (1), auth (3) = 57
20
+ */
21
+ export declare const CANONICAL_METHODS: readonly ["artist.getInfo", "artist.getTags", "artist.getSimilar", "artist.getTopTags", "artist.getTopAlbums", "artist.getTopTracks", "artist.search", "artist.getCorrection", "artist.addTags", "artist.removeTag", "album.getInfo", "album.getTags", "album.getTopTags", "album.search", "album.addTags", "album.removeTag", "track.getInfo", "track.getSimilar", "track.getTags", "track.getTopTags", "track.search", "track.getCorrection", "track.addTags", "track.removeTag", "track.love", "track.unlove", "track.updateNowPlaying", "track.scrobble", "user.getInfo", "user.getFriends", "user.getLovedTracks", "user.getRecentTracks", "user.getTopAlbums", "user.getTopArtists", "user.getTopTags", "user.getTopTracks", "user.getWeeklyAlbumChart", "user.getWeeklyArtistChart", "user.getWeeklyChartList", "user.getWeeklyTrackChart", "user.getPersonalTags", "tag.getInfo", "tag.getSimilar", "tag.getTopAlbums", "tag.getTopArtists", "tag.getTopTags", "tag.getTopTracks", "tag.getWeeklyChartList", "chart.getTopArtists", "chart.getTopTags", "chart.getTopTracks", "geo.getTopArtists", "geo.getTopTracks", "library.getArtists", "auth.getSession", "auth.getToken"];
22
+ export type CanonicalMethodId = (typeof CANONICAL_METHODS)[number];
23
+ export type CanonicalMethod = CanonicalMethodId;
24
+ export type Namespace = CanonicalMethodId extends `${infer N}.${string}` ? N : never;
25
+ //# sourceMappingURL=canonical-methods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonical-methods.d.ts","sourceRoot":"","sources":["../../src/core/canonical-methods.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,iBAAiB,0nCAkEpB,CAAA;AAEV,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAA;AAClE,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAA;AAC/C,MAAM,MAAM,SAAS,GAAG,iBAAiB,SAAS,GAAG,MAAM,CAAC,IAAI,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK,CAAA"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Canonical Last.fm method inventory.
3
+ *
4
+ * Single source of truth for the "56/56" coverage of the Last.fm API.
5
+ * (was 57/57; `auth.getMobileSession` removed in v4.0.0 — see #117.)
6
+ * Consumed by:
7
+ * - `src/__tests__/inventory.test.ts` — verifies that each method exists on the client
8
+ * - `src/method-registry.ts` — wires the docs tool (Hono + Scalar)
9
+ *
10
+ * Rules:
11
+ * - Only canonical Last.fm `namespace.method` pairs go here.
12
+ * - Wrapper/alias methods (e.g. `scrobbleMany`, `postTrackScrobble`,
13
+ * `postBatchTrackScrobble`) are excluded because they all target the
14
+ * same canonical endpoint (`track.scrobble`) and must not be
15
+ * double-counted.
16
+ *
17
+ * The per-namespace breakdown:
18
+ * - artist (10), album (6), track (12), user (13), tag (7),
19
+ * chart (3), geo (2), library (1), auth (3) = 57
20
+ */
21
+ export const CANONICAL_METHODS = [
22
+ // artist (10)
23
+ 'artist.getInfo',
24
+ 'artist.getTags',
25
+ 'artist.getSimilar',
26
+ 'artist.getTopTags',
27
+ 'artist.getTopAlbums',
28
+ 'artist.getTopTracks',
29
+ 'artist.search',
30
+ 'artist.getCorrection',
31
+ 'artist.addTags',
32
+ 'artist.removeTag',
33
+ // album (6)
34
+ 'album.getInfo',
35
+ 'album.getTags',
36
+ 'album.getTopTags',
37
+ 'album.search',
38
+ 'album.addTags',
39
+ 'album.removeTag',
40
+ // track (12)
41
+ 'track.getInfo',
42
+ 'track.getSimilar',
43
+ 'track.getTags',
44
+ 'track.getTopTags',
45
+ 'track.search',
46
+ 'track.getCorrection',
47
+ 'track.addTags',
48
+ 'track.removeTag',
49
+ 'track.love',
50
+ 'track.unlove',
51
+ 'track.updateNowPlaying',
52
+ 'track.scrobble',
53
+ // user (13)
54
+ 'user.getInfo',
55
+ 'user.getFriends',
56
+ 'user.getLovedTracks',
57
+ 'user.getRecentTracks',
58
+ 'user.getTopAlbums',
59
+ 'user.getTopArtists',
60
+ 'user.getTopTags',
61
+ 'user.getTopTracks',
62
+ 'user.getWeeklyAlbumChart',
63
+ 'user.getWeeklyArtistChart',
64
+ 'user.getWeeklyChartList',
65
+ 'user.getWeeklyTrackChart',
66
+ 'user.getPersonalTags',
67
+ // tag (7)
68
+ 'tag.getInfo',
69
+ 'tag.getSimilar',
70
+ 'tag.getTopAlbums',
71
+ 'tag.getTopArtists',
72
+ 'tag.getTopTags',
73
+ 'tag.getTopTracks',
74
+ 'tag.getWeeklyChartList',
75
+ // chart (3)
76
+ 'chart.getTopArtists',
77
+ 'chart.getTopTags',
78
+ 'chart.getTopTracks',
79
+ // geo (2)
80
+ 'geo.getTopArtists',
81
+ 'geo.getTopTracks',
82
+ // library (1)
83
+ 'library.getArtists',
84
+ // auth (2)
85
+ 'auth.getSession',
86
+ 'auth.getToken',
87
+ ];
88
+ //# sourceMappingURL=canonical-methods.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonical-methods.js","sourceRoot":"","sources":["../../src/core/canonical-methods.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,mBAAmB;IACnB,mBAAmB;IACnB,qBAAqB;IACrB,qBAAqB;IACrB,eAAe;IACf,sBAAsB;IACtB,gBAAgB;IAChB,kBAAkB;IAClB,YAAY;IACZ,eAAe;IACf,eAAe;IACf,kBAAkB;IAClB,cAAc;IACd,eAAe;IACf,iBAAiB;IACjB,aAAa;IACb,eAAe;IACf,kBAAkB;IAClB,eAAe;IACf,kBAAkB;IAClB,cAAc;IACd,qBAAqB;IACrB,eAAe;IACf,iBAAiB;IACjB,YAAY;IACZ,cAAc;IACd,wBAAwB;IACxB,gBAAgB;IAChB,YAAY;IACZ,cAAc;IACd,iBAAiB;IACjB,qBAAqB;IACrB,sBAAsB;IACtB,mBAAmB;IACnB,oBAAoB;IACpB,iBAAiB;IACjB,mBAAmB;IACnB,0BAA0B;IAC1B,2BAA2B;IAC3B,yBAAyB;IACzB,0BAA0B;IAC1B,sBAAsB;IACtB,UAAU;IACV,aAAa;IACb,gBAAgB;IAChB,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,kBAAkB;IAClB,wBAAwB;IACxB,YAAY;IACZ,qBAAqB;IACrB,kBAAkB;IAClB,oBAAoB;IACpB,UAAU;IACV,mBAAmB;IACnB,kBAAkB;IAClB,cAAc;IACd,oBAAoB;IACpB,WAAW;IACX,iBAAiB;IACjB,eAAe;CACN,CAAA"}
@@ -0,0 +1,33 @@
1
+ import { type LastFmConfig } from '../config.js';
2
+ import { type AlbumService, type ArtistService, type AuthService, type ChartService, type GeoService, type LibraryService, type TagService, type TrackService, type UserService } from './services/index.js';
3
+ /**
4
+ * Lightweight Last.fm Core API client.
5
+ *
6
+ * Provides access strictly to the 56 canonical Last.fm REST API methods
7
+ * across the 9 official namespaces.
8
+ */
9
+ export declare class LastFmCoreClient {
10
+ readonly user: UserService;
11
+ readonly album: AlbumService;
12
+ readonly artist: ArtistService;
13
+ readonly track: TrackService;
14
+ readonly tag: TagService;
15
+ readonly chart: ChartService;
16
+ readonly geo: GeoService;
17
+ readonly library: LibraryService;
18
+ readonly auth: AuthService;
19
+ private readonly config;
20
+ constructor(config?: Partial<LastFmConfig>);
21
+ /**
22
+ * Get the current configuration (read-only)
23
+ */
24
+ getConfig(): Readonly<LastFmConfig>;
25
+ }
26
+ /**
27
+ * Helper function to create a Last.fm core client instance
28
+ *
29
+ * @param config - Optional configuration. If not provided, uses global config.
30
+ * @returns A new LastFmCoreClient instance
31
+ */
32
+ export declare function createCoreClient(config?: Partial<LastFmConfig>): LastFmCoreClient;
33
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,YAAY,EAAE,MAAM,cAAc,CAAA;AAC/E,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,EAUjB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,MAAM,qBAAqB,CAAA;AAE5B;;;;;GAKG;AACH,qBAAa,gBAAgB;IAC5B,SAAgB,IAAI,EAAE,WAAW,CAAA;IACjC,SAAgB,KAAK,EAAE,YAAY,CAAA;IACnC,SAAgB,MAAM,EAAE,aAAa,CAAA;IACrC,SAAgB,KAAK,EAAE,YAAY,CAAA;IACnC,SAAgB,GAAG,EAAE,UAAU,CAAA;IAC/B,SAAgB,KAAK,EAAE,YAAY,CAAA;IACnC,SAAgB,GAAG,EAAE,UAAU,CAAA;IAC/B,SAAgB,OAAO,EAAE,cAAc,CAAA;IACvC,SAAgB,IAAI,EAAE,WAAW,CAAA;IAEjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;gBAEzB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;IAc1C;;OAEG;IACH,SAAS,IAAI,QAAQ,CAAC,YAAY,CAAC;CAGnC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,gBAAgB,CAEjF"}
@@ -0,0 +1,48 @@
1
+ import { createConfig, getGlobalConfig } from '../config.js';
2
+ import { createAlbumService, createArtistService, createAuthService, createChartService, createGeoService, createLibraryService, createTagService, createTrackService, createUserService, } from './services/index.js';
3
+ /**
4
+ * Lightweight Last.fm Core API client.
5
+ *
6
+ * Provides access strictly to the 56 canonical Last.fm REST API methods
7
+ * across the 9 official namespaces.
8
+ */
9
+ export class LastFmCoreClient {
10
+ user;
11
+ album;
12
+ artist;
13
+ track;
14
+ tag;
15
+ chart;
16
+ geo;
17
+ library;
18
+ auth;
19
+ config;
20
+ constructor(config) {
21
+ this.config = config ? createConfig(config) : getGlobalConfig();
22
+ this.user = createUserService(this.config);
23
+ this.album = createAlbumService(this.config);
24
+ this.artist = createArtistService(this.config);
25
+ this.track = createTrackService(this.config);
26
+ this.tag = createTagService(this.config);
27
+ this.chart = createChartService(this.config);
28
+ this.geo = createGeoService(this.config);
29
+ this.library = createLibraryService(this.config);
30
+ this.auth = createAuthService(this.config);
31
+ }
32
+ /**
33
+ * Get the current configuration (read-only)
34
+ */
35
+ getConfig() {
36
+ return { ...this.config };
37
+ }
38
+ }
39
+ /**
40
+ * Helper function to create a Last.fm core client instance
41
+ *
42
+ * @param config - Optional configuration. If not provided, uses global config.
43
+ * @returns A new LastFmCoreClient instance
44
+ */
45
+ export function createCoreClient(config) {
46
+ return new LastFmCoreClient(config);
47
+ }
48
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAqB,MAAM,cAAc,CAAA;AAC/E,OAAO,EAKN,kBAAkB,EAClB,mBAAmB,EACnB,iBAA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AAE,CAAA;IAC1B,CAAC;CACD;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAA8B;IAC9D,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAA;AACpC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './canonical-methods.js';
2
+ export * from './client.js';
3
+ export * from './pagination.js';
4
+ export * from './schemas/index.js';
5
+ export * from './services/index.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA"}
@@ -0,0 +1,6 @@
1
+ export * from './canonical-methods.js';
2
+ export * from './client.js';
3
+ export * from './pagination.js';
4
+ export * from './schemas/index.js';
5
+ export * from './services/index.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Generic pagination and async iterator utilities for Last.fm API endpoints.
3
+ */
4
+ export interface PaginationOptions {
5
+ /** Starting page number (1-indexed). Defaults to 1. */
6
+ startPage?: number;
7
+ /** Maximum number of pages to fetch. Defaults to Infinity. */
8
+ maxPages?: number;
9
+ /** Maximum total items to yield or collect. Defaults to Infinity. */
10
+ maxItems?: number;
11
+ /** Optional delay in milliseconds between page requests (for gentle rate limiting). Defaults to 0. */
12
+ delayMs?: number;
13
+ }
14
+ export interface PageExtraction<TItem> {
15
+ items: TItem[];
16
+ totalPages: number;
17
+ currentPage: number;
18
+ }
19
+ /**
20
+ * Async generator yielding items across all paginated responses one by one.
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * for await (const track of iterateItems(
25
+ * (p) => client.user.getRecentTracks(p),
26
+ * (res) => ({
27
+ * items: res.recenttracks?.track ?? [],
28
+ * totalPages: Number(res.recenttracks?.['@attr']?.totalPages ?? 1),
29
+ * currentPage: Number(res.recenttracks?.['@attr']?.page ?? 1)
30
+ * }),
31
+ * { user: 'ansango', limit: 200 },
32
+ * { maxItems: 1000 }
33
+ * )) {
34
+ * console.log(track.name);
35
+ * }
36
+ * ```
37
+ */
38
+ export declare function iterateItems<TItem, TParams extends Record<string, unknown>, TResponse>(fetchPage: (params: TParams & {
39
+ page: number;
40
+ limit?: number;
41
+ }) => Promise<TResponse>, extract: (response: TResponse) => PageExtraction<TItem>, params: TParams, options?: PaginationOptions): AsyncGenerator<TItem, void, undefined>;
42
+ /**
43
+ * Collects all items from paginated requests into an in-memory array.
44
+ */
45
+ export declare function collectAll<TItem, TParams extends Record<string, unknown>, TResponse>(fetchPage: (params: TParams & {
46
+ page: number;
47
+ limit?: number;
48
+ }) => Promise<TResponse>, extract: (response: TResponse) => PageExtraction<TItem>, params: TParams, options?: PaginationOptions): Promise<TItem[]>;
49
+ /**
50
+ * Async generator yielding whole page responses one by one.
51
+ */
52
+ export declare function iteratePages<TParams extends Record<string, unknown>, TResponse>(fetchPage: (params: TParams & {
53
+ page: number;
54
+ limit?: number;
55
+ }) => Promise<TResponse>, extractPagination: (response: TResponse) => {
56
+ totalPages: number;
57
+ currentPage: number;
58
+ }, params: TParams, options?: PaginationOptions): AsyncGenerator<TResponse, void, undefined>;
59
+ //# sourceMappingURL=pagination.d.ts.map