Simplify resource descriptions

This commit is contained in:
Iván Ovejero 2021-03-01 18:02:23 -03:00
parent a57dd55cd7
commit c12861791e
2 changed files with 59 additions and 95 deletions

View file

@ -35,7 +35,7 @@ export const mediaFields = [
type: 'options', type: 'options',
required: true, required: true,
default: 'userMedia', default: 'userMedia',
description: 'The type of media to be returned', description: 'Type of media to return.',
displayOptions: { displayOptions: {
show: { show: {
resource: [ resource: [
@ -48,19 +48,19 @@ export const mediaFields = [
}, },
options: [ options: [
{ {
name: 'User media', name: 'User Media',
value: 'userMedia', value: 'userMedia',
description: 'A list of images, videos, or albums on a user.', description: 'All images, videos or albums of a user.',
}, },
{ {
name: 'Album media', name: 'Album Media',
value: 'albumMedia', value: 'albumMedia',
description: 'A list of images and videos on an album.', description: 'All images and videos in an album.',
}, },
{ {
name: 'Media fields and edges', name: 'Fields & Edges',
value: 'mediaFieldsAndEdges', value: 'fieldsAndEdges',
description: 'Fields and edges on an image, video, or album.', description: 'All fields and edges of an image, video or album.',
}, },
], ],
}, },
@ -86,12 +86,12 @@ export const mediaFields = [
}, },
}, },
{ {
displayName: 'Media ID', displayName: 'Album ID',
name: 'mediaId', name: 'albumId',
type: 'string', type: 'string',
default: '', default: '',
placeholder: '17998581729291220', placeholder: '17998581729291220',
description: 'ID of media to return.', description: 'ID of album whose media to return.',
displayOptions: { displayOptions: {
show: { show: {
resource: [ resource: [
@ -102,55 +102,17 @@ export const mediaFields = [
], ],
type: [ type: [
'albumMedia', 'albumMedia',
'mediaFieldsAndEdges',
], ],
}, },
}, },
}, },
{ {
displayName: 'Fields', displayName: 'Media ID',
name: 'fields', name: 'mediaId',
type: 'multiOptions', type: 'string',
options: [
{
name: 'Caption',
value: 'caption',
},
{
name: 'Children',
value: 'children',
},
{
name: 'ID',
value: 'id',
},
{
name: 'Media type',
value: 'media_type',
},
{
name: 'Media URL',
value: 'media_url',
},
{
name: 'Permalink',
value: 'permalink',
},
{
name: 'Thumbnail URL',
value: 'thumbnail_url',
},
{
name: 'Timestamp',
value: 'timestamp',
},
{
name: 'Username',
value: 'username',
},
],
default: '', default: '',
description: 'Fields of the media to retrieve.', placeholder: '17998581729291220',
description: 'ID of media whose fields and edges to return.',
displayOptions: { displayOptions: {
show: { show: {
resource: [ resource: [
@ -160,8 +122,49 @@ export const mediaFields = [
'getAll', 'getAll',
], ],
type: [ type: [
'mediaFieldsAndEdges', 'fieldsAndEdges',
'userMedia', ],
},
},
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
default: false,
description: 'Return all results.',
displayOptions: {
show: {
resource: [
'media',
],
operation: [
'getAll',
],
},
},
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
default: 100,
description: 'The number of results to return.',
typeOptions: {
minValue: 1,
maxValue: 50,
},
displayOptions: {
show: {
resource: [
'media',
'fieldsAndEdges',
],
operation: [
'getAll',
],
returnAll: [
false,
], ],
}, },
}, },

View file

@ -67,43 +67,4 @@ export const userFields = [
}, },
}, },
}, },
{
displayName: 'Fields',
name: 'fields',
type: 'multiOptions',
options: [
{
name: 'Account type',
value: 'account_type',
},
{
name: 'ID',
value: 'id',
},
{
name: 'Media',
value: 'media',
},
{
name: 'Media Count',
value: 'media_count',
},
{
name: 'Username',
value: 'username',
},
],
default: '',
description: 'Fields of the user to retrieve.',
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'get',
],
},
},
},
] as INodeProperties[]; ] as INodeProperties[];