2023-01-27 03:22:44 -08:00
import type { INodeProperties } from 'n8n-workflow' ;
2021-07-29 05:11:04 -07:00
2021-12-03 00:44:16 -08:00
export const documentOperations : INodeProperties [ ] = [
2021-07-29 05:11:04 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2021-07-29 05:11:04 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'document' ] ,
2021-07-29 05:11:04 -07:00
} ,
} ,
options : [
{
name : 'Upload' ,
value : 'upload' ,
description : 'Upload a document' ,
2022-07-10 13:50:51 -07:00
action : 'Upload a document' ,
2021-07-29 05:11:04 -07:00
} ,
] ,
default : 'upload' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2021-07-29 05:11:04 -07:00
2021-12-03 00:44:16 -08:00
export const documentFields : INodeProperties [ ] = [
2021-07-29 05:11:04 -07:00
/* -------------------------------------------------------------------------- */
/* document:upload */
/* -------------------------------------------------------------------------- */
{
displayName : 'Title' ,
name : 'title' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'document' ] ,
operation : [ 'upload' ] ,
2021-07-29 05:11:04 -07:00
} ,
} ,
description : 'Name of the file' ,
} ,
{
displayName : 'Binary Property' ,
name : 'binaryPropertyName' ,
type : 'string' ,
default : 'data' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'document' ] ,
operation : [ 'upload' ] ,
2021-07-29 05:11:04 -07:00
} ,
} ,
placeholder : '' ,
2022-05-06 14:01:25 -07:00
description : 'Name of the binary property which contains the data for the file to be uploaded' ,
2021-07-29 05:11:04 -07:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'document' ] ,
operation : [ 'upload' ] ,
2021-07-29 05:11:04 -07:00
} ,
} ,
options : [
2021-09-05 05:27:47 -07:00
{
displayName : 'File Extension' ,
name : 'fileExtension' ,
type : 'string' ,
default : '' ,
placeholder : 'pdf' ,
2022-08-17 08:50:24 -07:00
description :
'File extension to use. If none is set, the value from the binary data will be used.' ,
2021-09-05 05:27:47 -07:00
} ,
2021-07-29 05:11:04 -07:00
{
displayName : 'Link To Object ID' ,
name : 'linkToObjectId' ,
type : 'string' ,
default : '' ,
description : 'ID of the object you want to link this document to' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Owner Name or ID' ,
2021-07-29 05:11:04 -07:00
name : 'ownerId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getUsers' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'ID of the owner of this document. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-07-29 05:11:04 -07:00
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;