mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-23 11:44:06 -08:00
✨ Add Social Profiles to OneSimpleAPI (#2459)
* Added Instagram Profile and Spotify Artist Profile to OneSimpleAPI * Changed to tabs
This commit is contained in:
parent
d007d0c395
commit
b4469eee33
|
@ -43,6 +43,10 @@ export class OneSimpleApi implements INodeType {
|
|||
name: 'Information',
|
||||
value: 'information',
|
||||
},
|
||||
{
|
||||
name: 'Social Profile',
|
||||
value: 'socialProfile',
|
||||
},
|
||||
{
|
||||
name: 'Utility',
|
||||
value: 'utility',
|
||||
|
@ -55,7 +59,7 @@ export class OneSimpleApi implements INodeType {
|
|||
default: 'website',
|
||||
required: true,
|
||||
},
|
||||
// Generation
|
||||
// website
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
|
@ -86,6 +90,32 @@ export class OneSimpleApi implements INodeType {
|
|||
],
|
||||
default: 'pdf',
|
||||
},
|
||||
// socialProfile
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: [
|
||||
'socialProfile',
|
||||
],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Instagram',
|
||||
value: 'instagramProfile',
|
||||
description: 'Get details about an Instagram profile',
|
||||
},
|
||||
{
|
||||
name: 'Spotify',
|
||||
value: 'spotifyArtistProfile',
|
||||
description: 'Get details about a Spotify Artist',
|
||||
},
|
||||
],
|
||||
default: 'instagramProfile',
|
||||
},
|
||||
// Information
|
||||
{
|
||||
displayName: 'Operation',
|
||||
|
@ -113,7 +143,7 @@ export class OneSimpleApi implements INodeType {
|
|||
default: 'exchangeRate',
|
||||
description: 'The operation to perform.',
|
||||
},
|
||||
// Utiliy
|
||||
// Utility
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
|
@ -279,7 +309,7 @@ export class OneSimpleApi implements INodeType {
|
|||
type: 'boolean',
|
||||
default: false,
|
||||
description: `Normally the API will reuse a previously taken screenshot of the URL to give a faster response.
|
||||
This option allows you to retake the screenshot at that exact time, for those times when it's necessary`,
|
||||
This option allows you to retake the screenshot at that exact time, for those times when it's necessary`,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -508,7 +538,7 @@ export class OneSimpleApi implements INodeType {
|
|||
type: 'boolean',
|
||||
default: false,
|
||||
description: `Normally the API will reuse a previously taken screenshot of the URL to give a faster response.
|
||||
This option allows you to retake the screenshot at that exact time, for those times when it's necessary`,
|
||||
This option allows you to retake the screenshot at that exact time, for those times when it's necessary`,
|
||||
},
|
||||
{
|
||||
displayName: 'Full Page',
|
||||
|
@ -519,6 +549,44 @@ export class OneSimpleApi implements INodeType {
|
|||
},
|
||||
],
|
||||
},
|
||||
// socialProfile: instagramProfile
|
||||
{
|
||||
displayName: 'Profile Name',
|
||||
name: 'profileName',
|
||||
type: 'string',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'instagramProfile',
|
||||
],
|
||||
resource: [
|
||||
'socialProfile',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Profile name to get details of',
|
||||
},
|
||||
// socialProfile: spotifyArtistProfile
|
||||
{
|
||||
displayName: 'Artist Name',
|
||||
name: 'artistName',
|
||||
type: 'string',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'spotifyArtistProfile',
|
||||
],
|
||||
resource: [
|
||||
'socialProfile',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Artist name to get details for',
|
||||
},
|
||||
// information: exchangeRate
|
||||
{
|
||||
displayName: 'Value',
|
||||
|
@ -778,6 +846,20 @@ export class OneSimpleApi implements INodeType {
|
|||
}
|
||||
}
|
||||
|
||||
if (resource === 'socialProfile') {
|
||||
if (operation === 'instagramProfile') {
|
||||
const profileName = this.getNodeParameter('profileName', i) as string;
|
||||
qs.profile = profileName;
|
||||
responseData = await oneSimpleApiRequest.call(this, 'GET', '/instagram_profile', {}, qs);
|
||||
}
|
||||
|
||||
if (operation === 'spotifyArtistProfile') {
|
||||
const artistName = this.getNodeParameter('artistName', i) as string;
|
||||
qs.profile = artistName;
|
||||
responseData = await oneSimpleApiRequest.call(this, 'GET', '/spotify_profile', {}, qs);
|
||||
}
|
||||
}
|
||||
|
||||
if (resource === 'information') {
|
||||
if (operation === 'exchangeRate') {
|
||||
const value = this.getNodeParameter('value', i) as string;
|
||||
|
@ -865,3 +947,4 @@ export class OneSimpleApi implements INodeType {
|
|||
return [this.helpers.returnJsonArray(returnData)];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue