2022-08-17 08:50:24 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2022-02-19 02:18:43 -08:00
|
|
|
|
|
|
|
export const mediaOperations: INodeProperties[] = [
|
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
noDataExpression: true,
|
|
|
|
type: 'options',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['media'],
|
2022-02-19 02:18:43 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Download',
|
|
|
|
value: 'download',
|
|
|
|
description: 'Download media',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Download media',
|
2022-02-19 02:18:43 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'download',
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
export const mediaFields: INodeProperties[] = [
|
2022-02-19 02:18:43 -08:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* media:download */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Resource Name',
|
|
|
|
name: 'resourceName',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['media'],
|
|
|
|
operation: ['download'],
|
2022-02-19 02:18:43 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
description: 'Name of the media that is being downloaded',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Binary Property',
|
|
|
|
name: 'binaryPropertyName',
|
|
|
|
type: 'string',
|
|
|
|
default: 'data',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['media'],
|
|
|
|
operation: ['download'],
|
2022-02-19 02:18:43 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
description: 'Name of the binary property to which to write the data of the read file',
|
|
|
|
},
|
|
|
|
];
|