n8n/packages/nodes-base/nodes/ClickUp/FolderDescription.ts

443 lines
7.1 KiB
TypeScript
Raw Normal View History

2020-04-20 07:35:58 -07:00
import {
INodeProperties,
} from 'n8n-workflow';
2020-04-20 07:35:58 -07:00
export const folderOperations: INodeProperties[] = [
2020-04-20 07:35:58 -07:00
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'folder',
],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a folder',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a folder',
},
{
name: 'Get',
value: 'get',
description: 'Get a folder',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get all folders',
},
{
name: 'Update',
value: 'update',
description: 'Update a folder',
},
],
default: 'create',
description: 'The operation to perform.',
},
];
2020-04-20 07:35:58 -07:00
export const folderFields: INodeProperties[] = [
2020-04-20 07:35:58 -07:00
/* -------------------------------------------------------------------------- */
/* folder:create */
/* -------------------------------------------------------------------------- */
2020-04-20 07:35:58 -07:00
{
displayName: 'Team ID',
name: 'team',
2020-04-20 07:35:58 -07:00
type: 'options',
default: '',
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'create',
],
},
},
typeOptions: {
loadOptionsMethod: 'getTeams',
},
required: true,
},
{
displayName: 'Space ID',
name: 'space',
2020-04-20 07:35:58 -07:00
type: 'options',
default: '',
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'create',
],
},
},
typeOptions: {
loadOptionsMethod: 'getSpaces',
loadOptionsDependsOn: [
'team',
2020-10-22 06:46:03 -07:00
],
2020-04-20 07:35:58 -07:00
},
required: true,
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'create',
],
},
},
required: true,
},
/* -------------------------------------------------------------------------- */
/* folder:delete */
/* -------------------------------------------------------------------------- */
2020-04-20 07:35:58 -07:00
{
displayName: 'Team ID',
name: 'team',
2020-04-20 07:35:58 -07:00
type: 'options',
default: '',
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'delete',
],
},
},
typeOptions: {
loadOptionsMethod: 'getTeams',
},
required: true,
},
{
displayName: 'Space ID',
name: 'space',
2020-04-20 07:35:58 -07:00
type: 'options',
default: '',
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'delete',
],
},
},
typeOptions: {
loadOptionsMethod: 'getSpaces',
loadOptionsDependsOn: [
'team',
2020-10-22 06:46:03 -07:00
],
2020-04-20 07:35:58 -07:00
},
required: true,
},
{
displayName: 'Folder ID',
name: 'folder',
2020-04-20 07:35:58 -07:00
type: 'options',
default: '',
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'delete',
],
},
},
typeOptions: {
loadOptionsMethod: 'getFolders',
loadOptionsDependsOn: [
'space',
2020-04-20 07:35:58 -07:00
],
},
required: true,
},
/* -------------------------------------------------------------------------- */
/* folder:get */
/* -------------------------------------------------------------------------- */
2020-04-20 07:35:58 -07:00
{
displayName: 'Team ID',
name: 'team',
2020-04-20 07:35:58 -07:00
type: 'options',
default: '',
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'get',
],
},
},
typeOptions: {
loadOptionsMethod: 'getTeams',
},
required: true,
},
{
displayName: 'Space ID',
name: 'space',
2020-04-20 07:35:58 -07:00
type: 'options',
default: '',
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'get',
],
},
},
typeOptions: {
loadOptionsMethod: 'getSpaces',
loadOptionsDependsOn: [
'team',
2020-10-22 06:46:03 -07:00
],
2020-04-20 07:35:58 -07:00
},
required: true,
},
{
displayName: 'Folder ID',
name: 'folder',
2020-04-20 07:35:58 -07:00
type: 'options',
default: '',
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'get',
],
},
},
typeOptions: {
loadOptionsMethod: 'getFolders',
loadOptionsDependsOn: [
'space',
2020-04-20 07:35:58 -07:00
],
},
required: true,
},
/* -------------------------------------------------------------------------- */
/* folder:getAll */
/* -------------------------------------------------------------------------- */
2020-04-20 07:35:58 -07:00
{
displayName: 'Team ID',
name: 'team',
2020-04-20 07:35:58 -07:00
type: 'options',
default: '',
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'getAll',
],
},
},
typeOptions: {
loadOptionsMethod: 'getTeams',
},
required: true,
},
{
displayName: 'Space ID',
name: 'space',
2020-04-20 07:35:58 -07:00
type: 'options',
default: '',
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'getAll',
],
},
},
typeOptions: {
loadOptionsMethod: 'getSpaces',
loadOptionsDependsOn: [
'team',
2020-10-22 06:46:03 -07:00
],
2020-04-20 07:35:58 -07:00
},
required: true,
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'getAll',
],
},
},
typeOptions: {
minValue: 1,
maxValue: 100,
},
default: 50,
description: 'Max number of results to return',
2020-04-20 07:35:58 -07:00
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'getAll',
],
},
},
options: [
{
displayName: 'Archived',
name: 'archived',
type: 'boolean',
default: false,
},
],
},
/* -------------------------------------------------------------------------- */
/* folder:update */
/* -------------------------------------------------------------------------- */
2020-04-20 07:35:58 -07:00
{
displayName: 'Team ID',
name: 'team',
2020-04-20 07:35:58 -07:00
type: 'options',
default: '',
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'update',
],
},
},
typeOptions: {
loadOptionsMethod: 'getTeams',
},
required: true,
},
{
displayName: 'Space ID',
name: 'space',
2020-04-20 07:35:58 -07:00
type: 'options',
default: '',
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'update',
],
},
},
typeOptions: {
loadOptionsMethod: 'getSpaces',
loadOptionsDependsOn: [
'team',
2020-10-22 06:46:03 -07:00
],
2020-04-20 07:35:58 -07:00
},
required: true,
},
{
displayName: 'Folder ID',
name: 'folder',
2020-04-20 07:35:58 -07:00
type: 'options',
default: '',
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'update',
],
},
},
typeOptions: {
loadOptionsMethod: 'getFolders',
loadOptionsDependsOn: [
'space',
2020-04-20 07:35:58 -07:00
],
},
required: true,
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: [
'folder',
],
operation: [
'update',
],
},
},
options: [
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
},
],
},
];