mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
⚡ Minor improvements to Box Node
This commit is contained in:
parent
8370940713
commit
d726e11af4
|
@ -48,16 +48,16 @@ export class BoxTrigger implements INodeType {
|
|||
name: 'events',
|
||||
type: 'multiOptions',
|
||||
options: [
|
||||
{
|
||||
name: 'Collaboration Created',
|
||||
value: 'COLLABORATION.CREATED',
|
||||
description: 'A collaboration is created',
|
||||
},
|
||||
{
|
||||
name: 'Collaboration Accepted',
|
||||
value: 'COLLABORATION.ACCEPTED',
|
||||
description: 'A collaboration has been accepted',
|
||||
},
|
||||
{
|
||||
name: 'Collaboration Created',
|
||||
value: 'COLLABORATION.CREATED',
|
||||
description: 'A collaboration is created',
|
||||
},
|
||||
{
|
||||
name: 'Collaboration Rejected',
|
||||
value: 'COLLABORATION.REJECTED',
|
||||
|
@ -78,45 +78,15 @@ export class BoxTrigger implements INodeType {
|
|||
value: 'COMMENT.CREATED',
|
||||
description: 'A comment object is created',
|
||||
},
|
||||
{
|
||||
name: 'Comment Updated',
|
||||
value: 'COMMENT.UPDATED',
|
||||
description: 'A comment object is edited',
|
||||
},
|
||||
{
|
||||
name: 'Comment Deleted',
|
||||
value: 'COMMENT.DELETED',
|
||||
description: 'A comment object is removed',
|
||||
},
|
||||
{
|
||||
name: 'File Uploaded',
|
||||
value: 'FILE.UPLOADED',
|
||||
description: 'A file is uploaded to or moved to this folder',
|
||||
},
|
||||
{
|
||||
name: 'File Previewed',
|
||||
value: 'FILE.PREVIEWED',
|
||||
description: 'A file is previewed',
|
||||
},
|
||||
{
|
||||
name: 'File Downloaded',
|
||||
value: 'FILE.DOWNLOADED',
|
||||
description: 'A file is downloaded',
|
||||
},
|
||||
{
|
||||
name: 'File Trashed',
|
||||
value: 'FILE.TRASHED',
|
||||
description: 'A file is moved to the trash',
|
||||
},
|
||||
{
|
||||
name: 'File Deleted',
|
||||
value: 'FILE.DELETED',
|
||||
description: 'A file is moved to the trash',
|
||||
},
|
||||
{
|
||||
name: 'File Restored',
|
||||
value: 'FILE.RESTORED',
|
||||
description: 'A file is restored from the trash',
|
||||
name: 'Comment Updated',
|
||||
value: 'COMMENT.UPDATED',
|
||||
description: 'A comment object is edited',
|
||||
},
|
||||
{
|
||||
name: 'File Copied',
|
||||
|
@ -124,9 +94,14 @@ export class BoxTrigger implements INodeType {
|
|||
description: 'A file is copied',
|
||||
},
|
||||
{
|
||||
name: 'File Moved',
|
||||
value: 'FILE.MOVED',
|
||||
description: 'A file is moved from one folder to another',
|
||||
name: 'File Deleted',
|
||||
value: 'FILE.DELETED',
|
||||
description: 'A file is moved to the trash',
|
||||
},
|
||||
{
|
||||
name: 'File Downloaded',
|
||||
value: 'FILE.DOWNLOADED',
|
||||
description: 'A file is downloaded',
|
||||
},
|
||||
{
|
||||
name: 'File Locked',
|
||||
|
@ -134,9 +109,14 @@ export class BoxTrigger implements INodeType {
|
|||
description: 'A file is locked',
|
||||
},
|
||||
{
|
||||
name: 'File Unlocked',
|
||||
value: 'FILE.UNLOCKED',
|
||||
description: 'A file is unlocked',
|
||||
name: 'File Moved',
|
||||
value: 'FILE.MOVED',
|
||||
description: 'A file is moved from one folder to another',
|
||||
},
|
||||
{
|
||||
name: 'File Previewed',
|
||||
value: 'FILE.PREVIEWED',
|
||||
description: 'A file is previewed',
|
||||
},
|
||||
{
|
||||
name: 'File Renamed',
|
||||
|
@ -144,40 +124,60 @@ export class BoxTrigger implements INodeType {
|
|||
description: 'A file was renamed.',
|
||||
},
|
||||
{
|
||||
name: 'Folder Created',
|
||||
value: 'FOLDER.CREATED',
|
||||
description: 'A folder is created',
|
||||
name: 'File Restored',
|
||||
value: 'FILE.RESTORED',
|
||||
description: 'A file is restored from the trash',
|
||||
},
|
||||
{
|
||||
name: 'Folder Renamed',
|
||||
value: 'FOLDER.RENAMED',
|
||||
description: 'A folder was renamed.',
|
||||
name: 'File Trashed',
|
||||
value: 'FILE.TRASHED',
|
||||
description: 'A file is moved to the trash',
|
||||
},
|
||||
{
|
||||
name: 'Folder Downloaded',
|
||||
value: 'FOLDER.DOWNLOADED',
|
||||
description: 'A folder is downloaded',
|
||||
name: 'File Unlocked',
|
||||
value: 'FILE.UNLOCKED',
|
||||
description: 'A file is unlocked',
|
||||
},
|
||||
{
|
||||
name: 'Folder Restored',
|
||||
value: 'FOLDER.RESTORED',
|
||||
description: 'A folder is restored from the trash',
|
||||
},
|
||||
{
|
||||
name: 'Folder Deleted',
|
||||
value: 'FOLDER.DELETED',
|
||||
description: 'A folder is permanently removed',
|
||||
name: 'File Uploaded',
|
||||
value: 'FILE.UPLOADED',
|
||||
description: 'A file is uploaded to or moved to this folder',
|
||||
},
|
||||
{
|
||||
name: 'Folder Copied',
|
||||
value: 'FOLDER.COPIED',
|
||||
description: 'A copy of a folder is made',
|
||||
},
|
||||
{
|
||||
name: 'Folder Created',
|
||||
value: 'FOLDER.CREATED',
|
||||
description: 'A folder is created',
|
||||
},
|
||||
{
|
||||
name: 'Folder Deleted',
|
||||
value: 'FOLDER.DELETED',
|
||||
description: 'A folder is permanently removed',
|
||||
},
|
||||
{
|
||||
name: 'Folder Downloaded',
|
||||
value: 'FOLDER.DOWNLOADED',
|
||||
description: 'A folder is downloaded',
|
||||
},
|
||||
{
|
||||
name: 'Folder Moved',
|
||||
value: 'FOLDER.MOVED',
|
||||
description: 'A folder is moved to a different folder',
|
||||
},
|
||||
{
|
||||
name: 'Folder Renamed',
|
||||
value: 'FOLDER.RENAMED',
|
||||
description: 'A folder was renamed.',
|
||||
},
|
||||
{
|
||||
name: 'Folder Restored',
|
||||
value: 'FOLDER.RESTORED',
|
||||
description: 'A folder is restored from the trash',
|
||||
},
|
||||
{
|
||||
name: 'Folder Trashed',
|
||||
value: 'FOLDER.TRASHED',
|
||||
|
@ -188,20 +188,15 @@ export class BoxTrigger implements INodeType {
|
|||
value: 'METADATA_INSTANCE.CREATED',
|
||||
description: 'A new metadata template instance is associated with a file or folder',
|
||||
},
|
||||
{
|
||||
name: 'Metadata Instance Updated',
|
||||
value: 'METADATA_INSTANCE.UPDATED',
|
||||
description: 'An attribute (value) is updated/deleted for an existing metadata template instance associated with a file or folder',
|
||||
},
|
||||
{
|
||||
name: 'Metadata Instance Deleted',
|
||||
value: 'METADATA_INSTANCE.DELETED',
|
||||
description: 'An existing metadata template instance associated with a file or folder is deleted',
|
||||
},
|
||||
{
|
||||
name: 'Sharedlink Deleted',
|
||||
value: 'SHARED_LINK.DELETED',
|
||||
description: 'A shared link was deleted',
|
||||
name: 'Metadata Instance Updated',
|
||||
value: 'METADATA_INSTANCE.UPDATED',
|
||||
description: 'An attribute (value) is updated/deleted for an existing metadata template instance associated with a file or folder',
|
||||
},
|
||||
{
|
||||
name: 'Sharedlink Created',
|
||||
|
@ -209,7 +204,12 @@ export class BoxTrigger implements INodeType {
|
|||
description: 'A shared link was created',
|
||||
},
|
||||
{
|
||||
name: 'Sharedlink UPDATED',
|
||||
name: 'Sharedlink Deleted',
|
||||
value: 'SHARED_LINK.DELETED',
|
||||
description: 'A shared link was deleted',
|
||||
},
|
||||
{
|
||||
name: 'Sharedlink Updated',
|
||||
value: 'SHARED_LINK.UPDATED',
|
||||
description: 'A shared link was updated',
|
||||
},
|
||||
|
|
|
@ -131,6 +131,7 @@ export const fileFields = [
|
|||
},
|
||||
],
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* file:delete */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
@ -151,6 +152,7 @@ export const fileFields = [
|
|||
default: '',
|
||||
description: 'Field ID',
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* file:download */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
@ -189,6 +191,7 @@ export const fileFields = [
|
|||
},
|
||||
description: 'Name of the binary property to which to<br />write the data of the read file.',
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* file:get */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
@ -235,6 +238,7 @@ export const fileFields = [
|
|||
},
|
||||
],
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* file:search */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
@ -491,6 +495,7 @@ export const fileFields = [
|
|||
},
|
||||
],
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* file:upload */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
@ -550,7 +555,6 @@ export const fileFields = [
|
|||
},
|
||||
|
||||
},
|
||||
placeholder: '',
|
||||
description: 'The text content of the file.',
|
||||
},
|
||||
{
|
||||
|
@ -573,7 +577,6 @@ export const fileFields = [
|
|||
},
|
||||
|
||||
},
|
||||
placeholder: '',
|
||||
description: 'Name of the binary property which contains<br />the data for the file.',
|
||||
},
|
||||
{
|
||||
|
|
|
@ -121,6 +121,7 @@ export const folderFields = [
|
|||
},
|
||||
],
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* folder:delete */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
@ -158,6 +159,7 @@ export const folderFields = [
|
|||
default: false,
|
||||
description: 'Delete a folder that is not empty by recursively deleting the folder and all of its content.',
|
||||
},
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* file:search */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
|
|
@ -47,17 +47,11 @@ export async function boxApiRequest(this: IExecuteFunctions | IExecuteSingleFunc
|
|||
if (error.response && error.response.body) {
|
||||
|
||||
if (error.response.body.context_info && error.response.body.context_info.errors) {
|
||||
|
||||
const errors = error.response.body.context_info.errors;
|
||||
|
||||
errorMessage = errors.map((e: IDataObject) => e.message);
|
||||
|
||||
errorMessage = errorMessage.join('|');
|
||||
|
||||
} else if (error.response.body.message) {
|
||||
|
||||
errorMessage = error.response.body.message;
|
||||
|
||||
}
|
||||
|
||||
throw new Error(`Box error response [${error.statusCode}]: ${errorMessage}`);
|
||||
|
|
Loading…
Reference in a new issue