2022-08-17 08:50:24 -07:00
import { INodeProperties } from 'n8n-workflow' ;
2020-12-28 23:23:01 -08:00
2021-12-03 00:44:16 -08:00
export const folderOperations : INodeProperties [ ] = [
2020-12-28 23:23:01 -08:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-12-28 23:23:01 -08:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'folder' ] ,
2020-12-28 23:23:01 -08:00
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
2022-09-07 07:51:14 -07:00
description : 'Create a new mail folder in the root folder of the user\'s mailbox' ,
2022-07-10 13:50:51 -07:00
action : 'Create a folder' ,
2020-12-28 23:23:01 -08:00
} ,
{
name : 'Delete' ,
value : 'delete' ,
description : 'Delete a folder' ,
2022-07-10 13:50:51 -07:00
action : 'Delete a folder' ,
2020-12-28 23:23:01 -08:00
} ,
{
name : 'Get' ,
value : 'get' ,
description : 'Get a single folder details' ,
2022-07-10 13:50:51 -07:00
action : 'Get a folder' ,
2020-12-28 23:23:01 -08:00
} ,
{
name : 'Get Children' ,
value : 'getChildren' ,
description : 'Lists all child folders under the folder' ,
2022-07-10 13:50:51 -07:00
action : 'Get items in a folder' ,
2020-12-28 23:23:01 -08:00
} ,
2022-09-07 07:51:14 -07:00
{
name : 'Get Many' ,
value : 'getAll' ,
description : 'Get all folders under the root folder of the signed-in user' ,
2022-09-08 08:10:13 -07:00
action : 'Get many folders' ,
2022-09-07 07:51:14 -07:00
} ,
2020-12-28 23:23:01 -08:00
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-12-28 23:23:01 -08:00
2021-12-03 00:44:16 -08:00
export const folderFields : INodeProperties [ ] = [
2020-12-28 23:23:01 -08:00
{
displayName : 'Folder ID' ,
name : 'folderId' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'folder' ] ,
operation : [ 'delete' , 'get' , 'getChildren' , 'update' ] ,
2020-12-28 23:23:01 -08:00
} ,
} ,
} ,
// folder:list, getChildren, listMessages
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'folder' ] ,
operation : [ 'getAll' , 'getChildren' ] ,
2020-12-28 23:23:01 -08:00
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-12-28 23:23:01 -08:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'folder' ] ,
operation : [ 'getAll' , 'getChildren' ] ,
2020-12-28 23:23:01 -08:00
returnAll : [ false ] ,
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 500 ,
} ,
default : 100 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-12-28 23:23:01 -08:00
} ,
// folder:create
{
displayName : 'Type' ,
name : 'folderType' ,
description : 'Folder Type' ,
type : 'options' ,
options : [
{
name : 'Folder' ,
value : 'folder' ,
} ,
{
name : 'Search Folder' ,
value : 'searchFolder' ,
} ,
] ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'folder' ] ,
operation : [ 'create' ] ,
2020-12-28 23:23:01 -08:00
} ,
} ,
default : 'folder' ,
} ,
{
displayName : 'Display Name' ,
name : 'displayName' ,
2022-05-06 14:01:25 -07:00
description : 'Name of the folder' ,
2020-12-28 23:23:01 -08:00
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'folder' ] ,
operation : [ 'create' ] ,
2020-12-28 23:23:01 -08:00
} ,
} ,
} ,
{
displayName : 'Include Nested Folders' ,
name : 'includeNestedFolders' ,
2022-06-20 07:54:01 -07:00
description : 'Whether to include child folders in the search' ,
2020-12-28 23:23:01 -08:00
type : 'boolean' ,
default : false ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'folder' ] ,
operation : [ 'create' ] ,
folderType : [ 'searchFolder' ] ,
2020-12-28 23:23:01 -08:00
} ,
} ,
} ,
{
displayName : 'Source Folder IDs' ,
name : 'sourceFolderIds' ,
2022-05-06 14:01:25 -07:00
description : 'The mailbox folders that should be mined' ,
2020-12-28 23:23:01 -08:00
type : 'string' ,
typeOptions : {
multipleValues : true ,
} ,
default : [ ] ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'folder' ] ,
operation : [ 'create' ] ,
folderType : [ 'searchFolder' ] ,
2020-12-28 23:23:01 -08:00
} ,
} ,
} ,
{
displayName : 'Filter Query' ,
name : 'filterQuery' ,
2022-05-06 14:01:25 -07:00
description : 'The OData query to filter the messages' ,
2020-12-28 23:23:01 -08:00
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'folder' ] ,
operation : [ 'create' ] ,
folderType : [ 'searchFolder' ] ,
2020-12-28 23:23:01 -08:00
} ,
} ,
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'folder' ] ,
operation : [ 'get' , 'getAll' , 'getChildren' ] ,
2020-12-28 23:23:01 -08:00
} ,
} ,
options : [
{
displayName : 'Fields' ,
name : 'fields' ,
type : 'string' ,
default : '' ,
description : 'Fields the response will contain. Multiple can be added separated by ,.' ,
} ,
{
displayName : 'Filter' ,
name : 'filter' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Microsoft Graph API OData $filter query. Information about the syntax can be found <a href="https://docs.microsoft.com/en-us/graph/query-parameters#filter-parameter">here</a>.' ,
2020-12-28 23:23:01 -08:00
} ,
] ,
} ,
// folder:update
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
2022-05-06 14:01:25 -07:00
description : 'Fields to update' ,
2020-12-28 23:23:01 -08:00
type : 'collection' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'folder' ] ,
operation : [ 'update' ] ,
2020-12-28 23:23:01 -08:00
} ,
} ,
options : [
{
displayName : 'Display Name' ,
name : 'displayName' ,
2022-05-06 14:01:25 -07:00
description : 'Name of the folder' ,
2020-12-28 23:23:01 -08:00
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Filter Query' ,
name : 'filterQuery' ,
description : 'The OData query to filter the messages. Only for search folders.' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Include Nested Folders' ,
name : 'includeNestedFolders' ,
2022-06-20 07:54:01 -07:00
description : 'Whether to include child folders in the search. Only for search folders.' ,
2020-12-28 23:23:01 -08:00
type : 'boolean' ,
default : false ,
} ,
{
displayName : 'Source Folder IDs' ,
name : 'sourceFolderIds' ,
description : 'The mailbox folders that should be mined. Only for search folders.' ,
type : 'string' ,
typeOptions : {
multipleValues : true ,
} ,
default : [ ] ,
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;