2020-12-28 23:23:01 -08:00
import {
INodeProperties ,
} from 'n8n-workflow' ;
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 : {
resource : [
'folder' ,
] ,
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
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 All' ,
value : 'getAll' ,
description : 'Get all folders under the root folder of the signed-in user' ,
2022-07-10 13:50:51 -07:00
action : 'Get all folders' ,
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
} ,
] ,
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 : {
resource : [
'folder' ,
] ,
operation : [
'delete' ,
'get' ,
'getChildren' ,
'update' ,
] ,
} ,
} ,
} ,
// folder:list, getChildren, listMessages
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
resource : [
'folder' ,
] ,
operation : [
'getAll' ,
'getChildren' ,
] ,
} ,
} ,
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 : {
resource : [
'folder' ,
] ,
operation : [
'getAll' ,
'getChildren' ,
] ,
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 : {
resource : [
'folder' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
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 : {
resource : [
'folder' ,
] ,
operation : [
'create' ,
] ,
} ,
} ,
} ,
{
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 : {
resource : [
'folder' ,
] ,
operation : [
'create' ,
] ,
folderType : [
'searchFolder' ,
] ,
} ,
} ,
} ,
{
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 : {
resource : [
'folder' ,
] ,
operation : [
'create' ,
] ,
folderType : [
'searchFolder' ,
] ,
} ,
} ,
} ,
{
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 : {
resource : [
'folder' ,
] ,
operation : [
'create' ,
] ,
folderType : [
'searchFolder' ,
] ,
} ,
} ,
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
resource : [
'folder' ,
] ,
operation : [
'get' ,
'getAll' ,
'getChildren' ,
] ,
} ,
} ,
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 : '' ,
2021-08-26 10:42:38 -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 : {
resource : [
'folder' ,
] ,
operation : [
'update' ,
] ,
} ,
} ,
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
] ;