Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

spotified

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spotified - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

docs/endpoints/album.md

5

package.json
{
"name": "spotified",
"version": "1.0.5",
"version": "1.0.6",
"description": "A strongly typed Spotify Web API SDK for browser and Node.js",

@@ -35,3 +35,4 @@ "main": "dist/cjs/index.js",

"sdk",
"web api"
"web api",
"music"
],

@@ -38,0 +39,0 @@ "publishConfig": {

12

Readme.md
# Spotified
Spotified is a strongly typed Spotify Web API SDK for both browser and Node.js environments. It provides an easy-to-use interface for interacting with the Spotify API, supporting all authorization flows and API endpoints.
Spotified is a strongly typed Spotify Web API SDK designed for both the Browser and Node environments. It offers a user-friendly interface for interacting with the Spotify API, supporting all authorization flows and API endpoints.
Spotified requires Node.js 18.0.0 or higher and a modern browser as it uses `fetch` for making HTTP requests in the Browser and Node. The SDK includes both ESM and CommonJS builds, ensuring that it can be used in the Browser and Node.
## Table of Contents

@@ -270,3 +272,3 @@

// Get a user's top tracks
const topTracks = await spotified.user.getUsersTopItems('tracks', { time_range: 'medium_term', limit: 10 });
const topTracks = await spotified.user.getUserTopItems('tracks', { time_range: 'medium_term', limit: 10 });
console.log(topTracks);

@@ -277,4 +279,8 @@ ```

For a complete list of available methods and their parameters, please refer to the [API documentation](link-to-your-api-docs).
For a complete list of available methods and their parameters, please refer to the [API documentation](/docs/).
## Test Coverage
Spotified maintains a high level of test coverage, currently at 98%. This ensures the reliability and stability of the SDK.
## Contributing

@@ -281,0 +287,0 @@

@@ -60,3 +60,3 @@ import { ReadWriteBaseClient } from '../client/ReadWriteBaseClient.js';

*/
removeUsersSavedAlbum(ids: string[]) {
removeUserSavedAlbum(ids: string[]) {
return this.delete(`/me/albums`, { ids });

@@ -69,3 +69,3 @@ }

*/
checkUsersSavedAlbums(ids: string[]) {
checkUserSavedAlbums(ids: string[]) {
return this.get<Array<boolean>>(`/me/albums/contains`, { ids: joinIdsArrayToString(ids) });

@@ -72,0 +72,0 @@ }

@@ -31,3 +31,3 @@ import { ReadWriteBaseClient } from '../client/ReadWriteBaseClient.js';

*/
getUsersSavedEpisodes(optionalParams?: GetSavedEpisodeParams) {
getUserSavedEpisodes(optionalParams?: GetSavedEpisodeParams) {
return this.get<UserSavedEpisodes>(`/me/episodes`, optionalParams);

@@ -40,3 +40,3 @@ }

*/
saveEpisodesForUser(ids: string[]) {
saveEpisodesForCurrentUser(ids: string[]) {
return this.put(`/me/episodes`, { ids });

@@ -49,3 +49,3 @@ }

*/
removeUsersEpisodes(ids: string[]) {
removeUserSavedEpisodes(ids: string[]) {
return this.delete(`/me/episodes`, { ids });

@@ -58,3 +58,3 @@ }

*/
checkUsersSavedEpisodes(ids: string[]) {
checkUserSavedEpisodes(ids: string[]) {
return this.get<Array<boolean>>(`/me/episodes/contains`, { ids: joinIdsArrayToString(ids) });

@@ -61,0 +61,0 @@ }

@@ -53,3 +53,3 @@ import joinIdsArrayToString, { generateQueryParametersString } from '../utils.js';

*/
saveShowsForUser(ids: string[]) {
saveShowsForCurrentUser(ids: string[]) {
return this.put(`/me/shows${generateQueryParametersString({ ids: joinIdsArrayToString(ids) })}`);

@@ -62,3 +62,3 @@ }

*/
removeUsersShows(ids: string[], optionalParams: RemoveUsersShowsOptionalParams) {
removeUserSavedShows(ids: string[], optionalParams: RemoveUsersShowsOptionalParams) {
return this.delete(

@@ -73,3 +73,3 @@ `/me/shows${generateQueryParametersString({ ids: joinIdsArrayToString(ids), ...optionalParams })}`

*/
checkUsersSavedShows(ids: string[]) {
checkUserSavedShows(ids: string[]) {
return this.get<Array<boolean>>(`/me/shows/contains`, { ids: joinIdsArrayToString(ids) });

@@ -76,0 +76,0 @@ }

@@ -28,3 +28,3 @@ import { joinIdsArrayToString, generateQueryParametersString } from '../utils.js';

*/
getUsersTopItems(type: UsersTopItemsType, optionalParams?: TopItemsOptionalParams) {
getUserTopItems(type: UsersTopItemsType, optionalParams?: TopItemsOptionalParams) {
return this.get<UsersTopItems>(`/me/top/${type}`, optionalParams);

@@ -69,3 +69,3 @@ }

*/
followArtistsUsers(type: ArtistsUsersType, ids: string[]) {
followArtistsOrUsers(type: ArtistsUsersType, ids: string[]) {
return this.put(`/me/following${generateQueryParametersString({ type })}`, { ids });

@@ -86,3 +86,3 @@ }

*/
checkIfUserFollows(type: ArtistsUsersType, ids: string[]) {
checkIfUserFollowsArtistsOrUsers(type: ArtistsUsersType, ids: string[]) {
return this.get<Array<boolean>>('/me/following/contains', { type, ids: joinIdsArrayToString(ids) });

@@ -89,0 +89,0 @@ }

@@ -144,7 +144,7 @@ import { Album } from '../../src/endpoints/Album';

describe('removeUsersSavedAlbum', () => {
describe('removeUserSavedAlbum', () => {
it('should call delete method with correct params', async () => {
const mockIds = ['album123', 'album456'];
await album.removeUsersSavedAlbum(mockIds);
await album.removeUserSavedAlbum(mockIds);

@@ -155,3 +155,3 @@ expect(album['delete']).toHaveBeenCalledWith('/me/albums', { ids: mockIds });

describe('checkUsersSavedAlbums', () => {
describe('checkUserSavedAlbums', () => {
it('should call get method with correct params and return expected result', async () => {

@@ -163,3 +163,3 @@ const mockIds = ['album123', 'album456'];

const result = await album.checkUsersSavedAlbums(mockIds);
const result = await album.checkUserSavedAlbums(mockIds);

@@ -166,0 +166,0 @@ expect(joinIdsArrayToString).toHaveBeenCalledWith(mockIds);

@@ -79,3 +79,3 @@ import { Episode } from '../../src/endpoints/Episode';

describe('getUsersSavedEpisodes', () => {
describe('getUserSavedEpisodes', () => {
it('should call get method with correct params and return expected result', async () => {

@@ -94,3 +94,3 @@ const mockParams: GetSavedEpisodeParams = { limit: 20, offset: 0, market: 'US' };

const result = await episode.getUsersSavedEpisodes(mockParams);
const result = await episode.getUserSavedEpisodes(mockParams);

@@ -102,7 +102,7 @@ expect(episode['get']).toHaveBeenCalledWith('/me/episodes', mockParams);

describe('saveEpisodesForUser', () => {
describe('saveEpisodesForCurrentUser', () => {
it('should call put method with correct params', async () => {
const mockIds = ['episode123', 'episode456'];
await episode.saveEpisodesForUser(mockIds);
await episode.saveEpisodesForCurrentUser(mockIds);

@@ -113,7 +113,7 @@ expect(episode['put']).toHaveBeenCalledWith('/me/episodes', { ids: mockIds });

describe('removeUsersEpisodes', () => {
describe('removeUserSavedEpisodes', () => {
it('should call delete method with correct params', async () => {
const mockIds = ['episode123', 'episode456'];
await episode.removeUsersEpisodes(mockIds);
await episode.removeUserSavedEpisodes(mockIds);

@@ -124,3 +124,3 @@ expect(episode['delete']).toHaveBeenCalledWith('/me/episodes', { ids: mockIds });

describe('checkUsersSavedEpisodes', () => {
describe('checkUserSavedEpisodes', () => {
it('should call get method with correct params and return expected result', async () => {

@@ -132,3 +132,3 @@ const mockIds = ['episode123', 'episode456'];

const result = await episode.checkUsersSavedEpisodes(mockIds);
const result = await episode.checkUserSavedEpisodes(mockIds);

@@ -135,0 +135,0 @@ expect(joinIdsArrayToString).toHaveBeenCalledWith(mockIds);

@@ -167,3 +167,3 @@ import { Show } from '../../src/endpoints/Show';

describe('saveShowsForUser', () => {
describe('saveShowsForCurrentUser', () => {
it('should call put method with correct params', async () => {

@@ -174,3 +174,3 @@ const mockIds = ['show123', 'show456'];

await show.saveShowsForUser(mockIds);
await show.saveShowsForCurrentUser(mockIds);

@@ -183,3 +183,3 @@ expect(joinIdsArrayToString).toHaveBeenCalledWith(mockIds);

describe('removeUsersShows', () => {
describe('removeUserSavedShows', () => {
it('should call delete method with correct params', async () => {

@@ -191,3 +191,3 @@ const mockIds = ['show123', 'show456'];

await show.removeUsersShows(mockIds, mockParams);
await show.removeUserSavedShows(mockIds, mockParams);

@@ -200,3 +200,3 @@ expect(joinIdsArrayToString).toHaveBeenCalledWith(mockIds);

describe('checkUsersSavedShows', () => {
describe('checkUserSavedShows', () => {
it('should call get method with correct params and return expected result', async () => {

@@ -208,3 +208,3 @@ const mockIds = ['show123', 'show456'];

const result = await show.checkUsersSavedShows(mockIds);
const result = await show.checkUserSavedShows(mockIds);

@@ -211,0 +211,0 @@ expect(joinIdsArrayToString).toHaveBeenCalledWith(mockIds);

@@ -51,3 +51,3 @@ import { User } from '../../src/endpoints/User';

describe('getUsersTopItems', () => {
describe('getUserTopItems', () => {
it('should call get method with correct params and return expected result', async () => {

@@ -67,3 +67,3 @@ const mockType: UsersTopItemsType = 'tracks';

const result = await user.getUsersTopItems(mockType, mockParams);
const result = await user.getUserTopItems(mockType, mockParams);

@@ -141,3 +141,3 @@ expect(user['get']).toHaveBeenCalledWith(`/me/top/${mockType}`, mockParams);

describe('followArtistsUsers', () => {
describe('followArtistsOrUsers', () => {
it('should call put method with correct params', async () => {

@@ -148,3 +148,3 @@ const mockType: ArtistsUsersType = 'artist';

await user.followArtistsUsers(mockType, mockIds);
await user.followArtistsOrUsers(mockType, mockIds);

@@ -169,3 +169,3 @@ expect(generateQueryParametersString).toHaveBeenCalledWith({ type: mockType });

describe('checkIfUserFollows', () => {
describe('checkIfUserFollowsArtistsOrUsers', () => {
it('should call get method with correct params and return expected result', async () => {

@@ -178,3 +178,3 @@ const mockType: ArtistsUsersType = 'artist';

const result = await user.checkIfUserFollows(mockType, mockIds);
const result = await user.checkIfUserFollowsArtistsOrUsers(mockType, mockIds);

@@ -181,0 +181,0 @@ expect(joinIdsArrayToString).toHaveBeenCalledWith(mockIds);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc