2020-04-20 07:35:58 -07:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
2021-03-24 15:01:12 -07:00
|
|
|
} from 'n8n-workflow';
|
2020-04-20 07:35:58 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const folderOperations: INodeProperties[] = [
|
2020-04-20 07:35:58 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-04-20 07:35:58 -07:00
|
|
|
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',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-04-20 07:35:58 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const folderFields: INodeProperties[] = [
|
2020-04-20 07:35:58 -07:00
|
|
|
|
2021-03-24 15:01:12 -07:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* folder:create */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-04-20 07:35:58 -07:00
|
|
|
{
|
|
|
|
displayName: 'Team ID',
|
2020-04-20 21:57:39 -07:00
|
|
|
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',
|
2020-04-20 21:57:39 -07:00
|
|
|
name: 'space',
|
2020-04-20 07:35:58 -07:00
|
|
|
type: 'options',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'folder',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getSpaces',
|
|
|
|
loadOptionsDependsOn: [
|
2020-04-20 21:57:39 -07:00
|
|
|
'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,
|
|
|
|
},
|
2021-03-24 15:01:12 -07:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* folder:delete */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-04-20 07:35:58 -07:00
|
|
|
{
|
|
|
|
displayName: 'Team ID',
|
2020-04-20 21:57:39 -07:00
|
|
|
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',
|
2020-04-20 21:57:39 -07:00
|
|
|
name: 'space',
|
2020-04-20 07:35:58 -07:00
|
|
|
type: 'options',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'folder',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'delete',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getSpaces',
|
|
|
|
loadOptionsDependsOn: [
|
2020-04-20 21:57:39 -07:00
|
|
|
'team',
|
2020-10-22 06:46:03 -07:00
|
|
|
],
|
2020-04-20 07:35:58 -07:00
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Folder ID',
|
2020-04-20 21:57:39 -07:00
|
|
|
name: 'folder',
|
2020-04-20 07:35:58 -07:00
|
|
|
type: 'options',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'folder',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'delete',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getFolders',
|
|
|
|
loadOptionsDependsOn: [
|
2020-04-20 21:57:39 -07:00
|
|
|
'space',
|
2020-04-20 07:35:58 -07:00
|
|
|
],
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
2021-03-24 15:01:12 -07:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* folder:get */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-04-20 07:35:58 -07:00
|
|
|
{
|
|
|
|
displayName: 'Team ID',
|
2020-04-20 21:57:39 -07:00
|
|
|
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',
|
2020-04-20 21:57:39 -07:00
|
|
|
name: 'space',
|
2020-04-20 07:35:58 -07:00
|
|
|
type: 'options',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'folder',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getSpaces',
|
|
|
|
loadOptionsDependsOn: [
|
2020-04-20 21:57:39 -07:00
|
|
|
'team',
|
2020-10-22 06:46:03 -07:00
|
|
|
],
|
2020-04-20 07:35:58 -07:00
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Folder ID',
|
2020-04-20 21:57:39 -07:00
|
|
|
name: 'folder',
|
2020-04-20 07:35:58 -07:00
|
|
|
type: 'options',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'folder',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getFolders',
|
|
|
|
loadOptionsDependsOn: [
|
2020-04-20 21:57:39 -07:00
|
|
|
'space',
|
2020-04-20 07:35:58 -07:00
|
|
|
],
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
2021-03-24 15:01:12 -07:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* folder:getAll */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-04-20 07:35:58 -07:00
|
|
|
{
|
|
|
|
displayName: 'Team ID',
|
2020-04-20 21:57:39 -07:00
|
|
|
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',
|
2020-04-20 21:57:39 -07:00
|
|
|
name: 'space',
|
2020-04-20 07:35:58 -07:00
|
|
|
type: 'options',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'folder',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getSpaces',
|
|
|
|
loadOptionsDependsOn: [
|
2020-04-20 21:57:39 -07:00
|
|
|
'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,
|
2022-05-06 14:01:25 -07:00
|
|
|
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,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-03-24 15:01:12 -07:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* folder:update */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-04-20 07:35:58 -07:00
|
|
|
{
|
|
|
|
displayName: 'Team ID',
|
2020-04-20 21:57:39 -07:00
|
|
|
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',
|
2020-04-20 21:57:39 -07:00
|
|
|
name: 'space',
|
2020-04-20 07:35:58 -07:00
|
|
|
type: 'options',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'folder',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'update',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getSpaces',
|
|
|
|
loadOptionsDependsOn: [
|
2020-04-20 21:57:39 -07:00
|
|
|
'team',
|
2020-10-22 06:46:03 -07:00
|
|
|
],
|
2020-04-20 07:35:58 -07:00
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Folder ID',
|
2020-04-20 21:57:39 -07:00
|
|
|
name: 'folder',
|
2020-04-20 07:35:58 -07:00
|
|
|
type: 'options',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'folder',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'update',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getFolders',
|
|
|
|
loadOptionsDependsOn: [
|
2020-04-20 21:57:39 -07:00
|
|
|
'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: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|