mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 20:00:02 +00:00
n8n-3867-progressively-apply-prettier-to-all (#3873)
* 🔨 formatting nodes with prettier
This commit is contained in:
@@ -1,22 +1,10 @@
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
} from 'n8n-core';
|
||||
import { IExecuteFunctions } from 'n8n-core';
|
||||
|
||||
import {
|
||||
IDataObject,
|
||||
INodeExecutionData,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
} from 'n8n-workflow';
|
||||
import { IDataObject, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
spotifyApiRequest,
|
||||
spotifyApiRequestAllItems,
|
||||
} from './GenericFunctions';
|
||||
import { spotifyApiRequest, spotifyApiRequestAllItems } from './GenericFunctions';
|
||||
|
||||
import {
|
||||
isoCountryCodes
|
||||
} from './IsoCountryCodes';
|
||||
import { isoCountryCodes } from './IsoCountryCodes';
|
||||
|
||||
export class Spotify implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
@@ -93,9 +81,7 @@ export class Spotify implements INodeType {
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'player',
|
||||
],
|
||||
resource: ['player'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -164,12 +150,8 @@ export class Spotify implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'player',
|
||||
],
|
||||
operation: [
|
||||
'startMusic',
|
||||
],
|
||||
resource: ['player'],
|
||||
operation: ['startMusic'],
|
||||
},
|
||||
},
|
||||
placeholder: 'spotify:album:1YZ3k65Mqw3G8FzYlW1mmp',
|
||||
@@ -183,12 +165,8 @@ export class Spotify implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'player',
|
||||
],
|
||||
operation: [
|
||||
'addSongToQueue',
|
||||
],
|
||||
resource: ['player'],
|
||||
operation: ['addSongToQueue'],
|
||||
},
|
||||
},
|
||||
placeholder: 'spotify:track:0xE4LEFzSNGsz1F6kvXsHU',
|
||||
@@ -206,9 +184,7 @@ export class Spotify implements INodeType {
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'album',
|
||||
],
|
||||
resource: ['album'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -227,8 +203,8 @@ export class Spotify implements INodeType {
|
||||
{
|
||||
name: `Get Tracks`,
|
||||
value: 'getTracks',
|
||||
description: 'Get an album\'s tracks by URI or ID',
|
||||
action: 'Get an album\'s tracks by URI or ID',
|
||||
description: "Get an album's tracks by URI or ID",
|
||||
action: "Get an album's tracks by URI or ID",
|
||||
},
|
||||
{
|
||||
name: `Search`,
|
||||
@@ -247,22 +223,15 @@ export class Spotify implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'album',
|
||||
],
|
||||
operation: [
|
||||
'get',
|
||||
'getTracks',
|
||||
],
|
||||
resource: ['album'],
|
||||
operation: ['get', 'getTracks'],
|
||||
},
|
||||
hide: {
|
||||
operation: [
|
||||
'search',
|
||||
],
|
||||
operation: ['search'],
|
||||
},
|
||||
},
|
||||
placeholder: 'spotify:album:1YZ3k65Mqw3G8FzYlW1mmp',
|
||||
description: 'The album\'s Spotify URI or ID',
|
||||
description: "The album's Spotify URI or ID",
|
||||
},
|
||||
{
|
||||
displayName: 'Search Keyword',
|
||||
@@ -273,12 +242,8 @@ export class Spotify implements INodeType {
|
||||
description: 'The keyword term to search for',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'album',
|
||||
],
|
||||
operation: [
|
||||
'search',
|
||||
],
|
||||
resource: ['album'],
|
||||
operation: ['search'],
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -294,9 +259,7 @@ export class Spotify implements INodeType {
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'artist',
|
||||
],
|
||||
resource: ['artist'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -309,20 +272,20 @@ export class Spotify implements INodeType {
|
||||
{
|
||||
name: `Get Albums`,
|
||||
value: 'getAlbums',
|
||||
description: 'Get an artist\'s albums by URI or ID',
|
||||
action: 'Get an artist\'s albums by URI or ID',
|
||||
description: "Get an artist's albums by URI or ID",
|
||||
action: "Get an artist's albums by URI or ID",
|
||||
},
|
||||
{
|
||||
name: `Get Related Artists`,
|
||||
value: 'getRelatedArtists',
|
||||
description: 'Get an artist\'s related artists by URI or ID',
|
||||
action: 'Get an artist\'s related artists by URI or ID',
|
||||
description: "Get an artist's related artists by URI or ID",
|
||||
action: "Get an artist's related artists by URI or ID",
|
||||
},
|
||||
{
|
||||
name: `Get Top Tracks`,
|
||||
value: 'getTopTracks',
|
||||
description: 'Get an artist\'s top tracks by URI or ID',
|
||||
action: 'Get an artist\'s top tracks by URI or ID',
|
||||
description: "Get an artist's top tracks by URI or ID",
|
||||
action: "Get an artist's top tracks by URI or ID",
|
||||
},
|
||||
{
|
||||
name: `Search`,
|
||||
@@ -341,18 +304,14 @@ export class Spotify implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'artist',
|
||||
],
|
||||
resource: ['artist'],
|
||||
},
|
||||
hide: {
|
||||
operation: [
|
||||
'search',
|
||||
],
|
||||
operation: ['search'],
|
||||
},
|
||||
},
|
||||
placeholder: 'spotify:artist:4LLpKhyESsyAXpc4laK94U',
|
||||
description: 'The artist\'s Spotify URI or ID',
|
||||
description: "The artist's Spotify URI or ID",
|
||||
},
|
||||
{
|
||||
displayName: 'Country',
|
||||
@@ -362,12 +321,8 @@ export class Spotify implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'artist',
|
||||
],
|
||||
operation: [
|
||||
'getTopTracks',
|
||||
],
|
||||
resource: ['artist'],
|
||||
operation: ['getTopTracks'],
|
||||
},
|
||||
},
|
||||
placeholder: 'US',
|
||||
@@ -383,12 +338,8 @@ export class Spotify implements INodeType {
|
||||
description: 'The keyword term to search for',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'artist',
|
||||
],
|
||||
operation: [
|
||||
'search',
|
||||
],
|
||||
resource: ['artist'],
|
||||
operation: ['search'],
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -404,9 +355,7 @@ export class Spotify implements INodeType {
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'playlist',
|
||||
],
|
||||
resource: ['playlist'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -431,14 +380,14 @@ export class Spotify implements INodeType {
|
||||
{
|
||||
name: 'Get Tracks',
|
||||
value: 'getTracks',
|
||||
description: 'Get a playlist\'s tracks by URI or ID',
|
||||
action: 'Get a playlist\'s tracks by URI or ID',
|
||||
description: "Get a playlist's tracks by URI or ID",
|
||||
action: "Get a playlist's tracks by URI or ID",
|
||||
},
|
||||
{
|
||||
name: `Get the User's Playlists`,
|
||||
value: 'getUserPlaylists',
|
||||
description: 'Get a user\'s playlists',
|
||||
action: 'Get a user\'s playlists',
|
||||
description: "Get a user's playlists",
|
||||
action: "Get a user's playlists",
|
||||
},
|
||||
{
|
||||
name: 'Remove an Item',
|
||||
@@ -463,19 +412,12 @@ export class Spotify implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'playlist',
|
||||
],
|
||||
operation: [
|
||||
'add',
|
||||
'delete',
|
||||
'get',
|
||||
'getTracks',
|
||||
],
|
||||
resource: ['playlist'],
|
||||
operation: ['add', 'delete', 'get', 'getTracks'],
|
||||
},
|
||||
},
|
||||
placeholder: 'spotify:playlist:37i9dQZF1DWUhI3iC1khPH',
|
||||
description: 'The playlist\'s Spotify URI or its ID',
|
||||
description: "The playlist's Spotify URI or its ID",
|
||||
},
|
||||
{
|
||||
displayName: 'Name',
|
||||
@@ -485,12 +427,8 @@ export class Spotify implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'playlist',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
resource: ['playlist'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
placeholder: 'Favorite Songs',
|
||||
@@ -504,12 +442,8 @@ export class Spotify implements INodeType {
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'playlist',
|
||||
],
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
resource: ['playlist'],
|
||||
operation: ['create'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -538,17 +472,13 @@ export class Spotify implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'playlist',
|
||||
],
|
||||
operation: [
|
||||
'add',
|
||||
'delete',
|
||||
],
|
||||
resource: ['playlist'],
|
||||
operation: ['add', 'delete'],
|
||||
},
|
||||
},
|
||||
placeholder: 'spotify:track:0xE4LEFzSNGsz1F6kvXsHU',
|
||||
description: 'The track\'s Spotify URI or its ID. The track to add/delete from the playlist.',
|
||||
description:
|
||||
"The track's Spotify URI or its ID. The track to add/delete from the playlist.",
|
||||
},
|
||||
{
|
||||
displayName: 'Additional Fields',
|
||||
@@ -558,12 +488,8 @@ export class Spotify implements INodeType {
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'playlist',
|
||||
],
|
||||
operation: [
|
||||
'add',
|
||||
],
|
||||
resource: ['playlist'],
|
||||
operation: ['add'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -576,7 +502,7 @@ export class Spotify implements INodeType {
|
||||
},
|
||||
default: 0,
|
||||
placeholder: '0',
|
||||
description: 'The new track\'s position in the playlist',
|
||||
description: "The new track's position in the playlist",
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -589,12 +515,8 @@ export class Spotify implements INodeType {
|
||||
description: 'The keyword term to search for',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'playlist',
|
||||
],
|
||||
operation: [
|
||||
'search',
|
||||
],
|
||||
resource: ['playlist'],
|
||||
operation: ['search'],
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -610,9 +532,7 @@ export class Spotify implements INodeType {
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'track',
|
||||
],
|
||||
resource: ['track'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -645,18 +565,14 @@ export class Spotify implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'track',
|
||||
],
|
||||
resource: ['track'],
|
||||
},
|
||||
hide: {
|
||||
operation: [
|
||||
'search',
|
||||
],
|
||||
operation: ['search'],
|
||||
},
|
||||
},
|
||||
placeholder: 'spotify:track:0xE4LEFzSNGsz1F6kvXsHU',
|
||||
description: 'The track\'s Spotify URI or ID',
|
||||
description: "The track's Spotify URI or ID",
|
||||
},
|
||||
{
|
||||
displayName: 'Search Keyword',
|
||||
@@ -667,12 +583,8 @@ export class Spotify implements INodeType {
|
||||
description: 'The keyword term to search for',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'track',
|
||||
],
|
||||
operation: [
|
||||
'search',
|
||||
],
|
||||
resource: ['track'],
|
||||
operation: ['search'],
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -688,16 +600,14 @@ export class Spotify implements INodeType {
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'library',
|
||||
],
|
||||
resource: ['library'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Get Liked Tracks',
|
||||
value: 'getLikedTracks',
|
||||
description: 'Get the user\'s liked tracks',
|
||||
description: "Get the user's liked tracks",
|
||||
action: 'Get liked tracks',
|
||||
},
|
||||
],
|
||||
@@ -715,9 +625,7 @@ export class Spotify implements INodeType {
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'myData',
|
||||
],
|
||||
resource: ['myData'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -738,15 +646,7 @@ export class Spotify implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'album',
|
||||
'artist',
|
||||
'library',
|
||||
'myData',
|
||||
'playlist',
|
||||
'track',
|
||||
'player',
|
||||
],
|
||||
resource: ['album', 'artist', 'library', 'myData', 'playlist', 'track', 'player'],
|
||||
operation: [
|
||||
'getTracks',
|
||||
'getAlbums',
|
||||
@@ -769,13 +669,7 @@ export class Spotify implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'album',
|
||||
'artist',
|
||||
'library',
|
||||
'playlist',
|
||||
'track',
|
||||
],
|
||||
resource: ['album', 'artist', 'library', 'playlist', 'track'],
|
||||
operation: [
|
||||
'getTracks',
|
||||
'getAlbums',
|
||||
@@ -784,9 +678,7 @@ export class Spotify implements INodeType {
|
||||
'getLikedTracks',
|
||||
'search',
|
||||
],
|
||||
returnAll: [
|
||||
false,
|
||||
],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
@@ -803,17 +695,9 @@ export class Spotify implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'myData',
|
||||
'player',
|
||||
],
|
||||
operation: [
|
||||
'getFollowingArtists',
|
||||
'recentlyPlayed',
|
||||
],
|
||||
returnAll: [
|
||||
false,
|
||||
],
|
||||
resource: ['myData', 'player'],
|
||||
operation: ['getFollowingArtists', 'recentlyPlayed'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
@@ -830,12 +714,8 @@ export class Spotify implements INodeType {
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'player',
|
||||
],
|
||||
operation: [
|
||||
'volume',
|
||||
],
|
||||
resource: ['player'],
|
||||
operation: ['volume'],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
@@ -852,12 +732,8 @@ export class Spotify implements INodeType {
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'album',
|
||||
],
|
||||
operation: [
|
||||
'getNewReleases',
|
||||
],
|
||||
resource: ['album'],
|
||||
operation: ['getNewReleases'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -879,15 +755,8 @@ export class Spotify implements INodeType {
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'playlist',
|
||||
'artist',
|
||||
'track',
|
||||
'album',
|
||||
],
|
||||
operation: [
|
||||
'search',
|
||||
],
|
||||
resource: ['playlist', 'artist', 'track', 'album'],
|
||||
operation: ['search'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
@@ -897,7 +766,8 @@ export class Spotify implements INodeType {
|
||||
type: 'options',
|
||||
options: isoCountryCodes.map(({ name, alpha2 }) => ({ name, value: alpha2 })),
|
||||
default: '',
|
||||
description: 'If a country code is specified, only content that is playable in that market is returned',
|
||||
description:
|
||||
'If a country code is specified, only content that is playable in that market is returned',
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -933,7 +803,6 @@ export class Spotify implements INodeType {
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
try {
|
||||
if (resource === 'player') {
|
||||
|
||||
// -----------------------------
|
||||
// Player Operations
|
||||
// -----------------------------
|
||||
@@ -943,11 +812,9 @@ export class Spotify implements INodeType {
|
||||
|
||||
endpoint = `/me/player/pause`;
|
||||
|
||||
|
||||
responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
responseData = { success: true };
|
||||
|
||||
} else if (operation === 'recentlyPlayed') {
|
||||
requestMethod = 'GET';
|
||||
|
||||
@@ -958,7 +825,6 @@ export class Spotify implements INodeType {
|
||||
propertyName = 'items';
|
||||
|
||||
if (!returnAll) {
|
||||
|
||||
const limit = this.getNodeParameter('limit', i) as number;
|
||||
|
||||
qs = {
|
||||
@@ -969,14 +835,12 @@ export class Spotify implements INodeType {
|
||||
|
||||
responseData = responseData.items;
|
||||
}
|
||||
|
||||
} else if (operation === 'currentlyPlaying') {
|
||||
requestMethod = 'GET';
|
||||
|
||||
endpoint = `/me/player/currently-playing`;
|
||||
|
||||
responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
} else if (operation === 'nextSong') {
|
||||
requestMethod = 'POST';
|
||||
|
||||
@@ -985,7 +849,6 @@ export class Spotify implements INodeType {
|
||||
responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
responseData = { success: true };
|
||||
|
||||
} else if (operation === 'previousSong') {
|
||||
requestMethod = 'POST';
|
||||
|
||||
@@ -994,7 +857,6 @@ export class Spotify implements INodeType {
|
||||
responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
responseData = { success: true };
|
||||
|
||||
} else if (operation === 'startMusic') {
|
||||
requestMethod = 'PUT';
|
||||
|
||||
@@ -1007,7 +869,6 @@ export class Spotify implements INodeType {
|
||||
responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
responseData = { success: true };
|
||||
|
||||
} else if (operation === 'addSongToQueue') {
|
||||
requestMethod = 'POST';
|
||||
|
||||
@@ -1045,9 +906,7 @@ export class Spotify implements INodeType {
|
||||
|
||||
responseData = { success: true };
|
||||
}
|
||||
|
||||
} else if (resource === 'album') {
|
||||
|
||||
// -----------------------------
|
||||
// Album Operations
|
||||
// -----------------------------
|
||||
@@ -1062,9 +921,7 @@ export class Spotify implements INodeType {
|
||||
endpoint = `/albums/${id}`;
|
||||
|
||||
responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
} else if (operation === 'getNewReleases') {
|
||||
|
||||
endpoint = '/browse/new-releases';
|
||||
requestMethod = 'GET';
|
||||
propertyName = 'albums.items';
|
||||
@@ -1082,7 +939,6 @@ export class Spotify implements INodeType {
|
||||
responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
responseData = responseData.albums.items;
|
||||
}
|
||||
|
||||
} else if (operation === 'getTracks') {
|
||||
const uri = this.getNodeParameter('id', i) as string;
|
||||
|
||||
@@ -1133,9 +989,7 @@ export class Spotify implements INodeType {
|
||||
responseData = responseData.albums.items;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (resource === 'artist') {
|
||||
|
||||
// -----------------------------
|
||||
// Artist Operations
|
||||
// -----------------------------
|
||||
@@ -1145,7 +999,6 @@ export class Spotify implements INodeType {
|
||||
const id = uri.replace('spotify:artist:', '');
|
||||
|
||||
if (operation === 'getAlbums') {
|
||||
|
||||
endpoint = `/artists/${id}/albums`;
|
||||
|
||||
returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
||||
@@ -1163,15 +1016,12 @@ export class Spotify implements INodeType {
|
||||
|
||||
responseData = responseData.items;
|
||||
}
|
||||
|
||||
} else if (operation === 'getRelatedArtists') {
|
||||
|
||||
endpoint = `/artists/${id}/related-artists`;
|
||||
|
||||
responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
responseData = responseData.artists;
|
||||
|
||||
} else if (operation === 'getTopTracks') {
|
||||
const country = this.getNodeParameter('country', i) as string;
|
||||
|
||||
@@ -1184,9 +1034,7 @@ export class Spotify implements INodeType {
|
||||
responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
responseData = responseData.tracks;
|
||||
|
||||
} else if (operation === 'get') {
|
||||
|
||||
requestMethod = 'GET';
|
||||
|
||||
endpoint = `/artists/${id}`;
|
||||
@@ -1217,9 +1065,7 @@ export class Spotify implements INodeType {
|
||||
responseData = responseData.artists.items;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (resource === 'playlist') {
|
||||
|
||||
// -----------------------------
|
||||
// Playlist Operations
|
||||
// -----------------------------
|
||||
@@ -1244,14 +1090,12 @@ export class Spotify implements INodeType {
|
||||
responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
responseData = { success: true };
|
||||
|
||||
} else if (operation === 'get') {
|
||||
requestMethod = 'GET';
|
||||
|
||||
endpoint = `/playlists/${id}`;
|
||||
|
||||
responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
|
||||
} else if (operation === 'getTracks') {
|
||||
requestMethod = 'GET';
|
||||
|
||||
@@ -1265,10 +1109,16 @@ export class Spotify implements INodeType {
|
||||
const limit = this.getNodeParameter('limit', i) as number;
|
||||
|
||||
qs = {
|
||||
'limit': limit,
|
||||
limit,
|
||||
};
|
||||
|
||||
responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs);
|
||||
responseData = await spotifyApiRequest.call(
|
||||
this,
|
||||
requestMethod,
|
||||
endpoint,
|
||||
body,
|
||||
qs,
|
||||
);
|
||||
|
||||
responseData = responseData.items;
|
||||
}
|
||||
@@ -1310,9 +1160,7 @@ export class Spotify implements INodeType {
|
||||
|
||||
responseData = responseData.items;
|
||||
}
|
||||
|
||||
} else if (operation === 'create') {
|
||||
|
||||
// https://developer.spotify.com/console/post-playlists/
|
||||
|
||||
body.name = this.getNodeParameter('name', i) as string;
|
||||
@@ -1349,9 +1197,7 @@ export class Spotify implements INodeType {
|
||||
responseData = responseData.playlists.items;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (resource === 'track') {
|
||||
|
||||
// -----------------------------
|
||||
// Track Operations
|
||||
// -----------------------------
|
||||
@@ -1393,9 +1239,7 @@ export class Spotify implements INodeType {
|
||||
responseData = responseData.tracks.items;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (resource === 'library') {
|
||||
|
||||
// -----------------------------
|
||||
// Library Operations
|
||||
// -----------------------------
|
||||
@@ -1422,7 +1266,6 @@ export class Spotify implements INodeType {
|
||||
}
|
||||
}
|
||||
} else if (resource === 'myData') {
|
||||
|
||||
if (operation === 'getFollowingArtists') {
|
||||
requestMethod = 'GET';
|
||||
|
||||
@@ -1449,7 +1292,14 @@ export class Spotify implements INodeType {
|
||||
}
|
||||
|
||||
if (returnAll) {
|
||||
responseData = await spotifyApiRequestAllItems.call(this, propertyName, requestMethod, endpoint, body, qs);
|
||||
responseData = await spotifyApiRequestAllItems.call(
|
||||
this,
|
||||
propertyName,
|
||||
requestMethod,
|
||||
endpoint,
|
||||
body,
|
||||
qs,
|
||||
);
|
||||
}
|
||||
|
||||
if (Array.isArray(responseData)) {
|
||||
@@ -1469,11 +1319,3 @@ export class Spotify implements INodeType {
|
||||
return [this.helpers.returnJsonArray(returnData)];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user