2020-11-25 04:08:59 -08:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const fileOperations: INodeProperties[] = [
|
2020-11-25 04:08:59 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-11-25 04:08:59 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'file',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
|
|
|
description: 'Delete a file',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Download',
|
|
|
|
value: 'download',
|
|
|
|
description: 'Download a file',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'download',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-11-25 04:08:59 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const fileFields: INodeProperties[] = [
|
2020-11-25 04:08:59 -08:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* file:download */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Table ID',
|
|
|
|
name: 'tableId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'file',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'download',
|
|
|
|
'delete',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The table identifier',
|
2020-11-25 04:08:59 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Record ID',
|
|
|
|
name: 'recordId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'file',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'download',
|
|
|
|
'delete',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The unique identifier of the record',
|
2020-11-25 04:08:59 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Field ID',
|
|
|
|
name: 'fieldId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'file',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'download',
|
|
|
|
'delete',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The unique identifier of the field',
|
2020-11-25 04:08:59 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Version Number',
|
|
|
|
name: 'versionNumber',
|
|
|
|
type: 'number',
|
|
|
|
default: 1,
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'file',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'download',
|
|
|
|
'delete',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The file attachment version number',
|
2020-11-25 04:08:59 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Binary Property',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'file',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'download',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
name: 'binaryPropertyName',
|
|
|
|
type: 'string',
|
|
|
|
default: 'data',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Object property name which holds binary data',
|
2020-11-25 04:08:59 -08:00
|
|
|
required: true,
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|