From fc3db13dd07cd68c143b7d9dd5b3b15a0e3bb943 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 17 Jan 2020 22:36:07 -0600 Subject: [PATCH] :zap: Some cleanup --- .../nodes/Webflow/GenericFunctions.ts | 8 ++- .../nodes/Webflow/WebflowTrigger.node.ts | 10 ++-- packages/nodes-base/package.json | 58 +++++++++---------- 3 files changed, 39 insertions(+), 37 deletions(-) diff --git a/packages/nodes-base/nodes/Webflow/GenericFunctions.ts b/packages/nodes-base/nodes/Webflow/GenericFunctions.ts index 7531cd0334..030e47f903 100644 --- a/packages/nodes-base/nodes/Webflow/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Webflow/GenericFunctions.ts @@ -33,6 +33,12 @@ export async function webflowApiRequest(this: IHookFunctions | IExecuteFunctions try { return await this.helpers.request!(options); } catch (error) { - throw new Error('Webflow Error: ' + error.message); + + let errorMessage = error.message; + if (error.response.body && error.response.body.err) { + errorMessage = error.response.body.err; + } + + throw new Error('Webflow Error: ' + errorMessage); } } diff --git a/packages/nodes-base/nodes/Webflow/WebflowTrigger.node.ts b/packages/nodes-base/nodes/Webflow/WebflowTrigger.node.ts index 9952c256a7..53a0a75302 100644 --- a/packages/nodes-base/nodes/Webflow/WebflowTrigger.node.ts +++ b/packages/nodes-base/nodes/Webflow/WebflowTrigger.node.ts @@ -67,8 +67,8 @@ export class WebflowTrigger implements INodeType { value: 'form_submission', }, { - name: 'Site Publish', - value: 'site_publish', + name: 'Ecomm Inventory Changed', + value: 'ecomm_inventory_changed', }, { name: 'Ecomm New Order', @@ -79,8 +79,8 @@ export class WebflowTrigger implements INodeType { value: 'ecomm_order_changed', }, { - name: 'Ecomm Inventory Changed', - value: 'ecomm_inventory_changed', + name: 'Site Publish', + value: 'site_publish', }, ], default: 'form_submission', @@ -106,7 +106,7 @@ export class WebflowTrigger implements INodeType { return returnData; }, }, - } + }; // @ts-ignore webhookMethods = { diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 936492b043..4afb893073 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -55,14 +55,15 @@ "dist/credentials/MailgunApi.credentials.js", "dist/credentials/MandrillApi.credentials.js", "dist/credentials/MattermostApi.credentials.js", - "dist/credentials/MongoDb.credentials.js", - "dist/credentials/MySql.credentials.js", "dist/credentials/MauticApi.credentials.js", + "dist/credentials/MongoDb.credentials.js", + "dist/credentials/Msg91Api.credentials.js", + "dist/credentials/MySql.credentials.js", "dist/credentials/NextCloudApi.credentials.js", "dist/credentials/OpenWeatherMapApi.credentials.js", + "dist/credentials/PayPalApi.credentials.js", "dist/credentials/PipedriveApi.credentials.js", "dist/credentials/Postgres.credentials.js", - "dist/credentials/PayPalApi.credentials.js", "dist/credentials/Redis.credentials.js", "dist/credentials/RocketchatApi.credentials.js", "dist/credentials/ShopifyApi.credentials.js", @@ -73,15 +74,11 @@ "dist/credentials/TodoistApi.credentials.js", "dist/credentials/TrelloApi.credentials.js", "dist/credentials/TwilioApi.credentials.js", - "dist/credentials/Msg91Api.credentials.js", - "dist/credentials/TypeformApi.credentials.js", - "dist/credentials/MandrillApi.credentials.js", - "dist/credentials/TodoistApi.credentials.js", "dist/credentials/TypeformApi.credentials.js", "dist/credentials/TogglApi.credentials.js", "dist/credentials/VeroApi.credentials.js", - "dist/credentials/WordpressApi.credentials.js", "dist/credentials/WebflowApi.credentials.js", + "dist/credentials/WordpressApi.credentials.js", "dist/credentials/ZendeskApi.credentials.js" ], "nodes": [ @@ -97,17 +94,17 @@ "dist/nodes/Bitbucket/BitbucketTrigger.node.js", "dist/nodes/Chargebee/Chargebee.node.js", "dist/nodes/Chargebee/ChargebeeTrigger.node.js", - "dist/nodes/Cron.node.js", "dist/nodes/Coda/Coda.node.js", - "dist/nodes/Dropbox/Dropbox.node.js", + "dist/nodes/Cron.node.js", "dist/nodes/Discord/Discord.node.js", + "dist/nodes/Dropbox/Dropbox.node.js", "dist/nodes/EditImage.node.js", "dist/nodes/EmailReadImap.node.js", "dist/nodes/EmailSend.node.js", "dist/nodes/ErrorTrigger.node.js", + "dist/nodes/Eventbrite/EventbriteTrigger.node.js", "dist/nodes/ExecuteCommand.node.js", "dist/nodes/ExecuteWorkflow.node.js", - "dist/nodes/Eventbrite/EventbriteTrigger.node.js", "dist/nodes/FileMaker/FileMaker.node.js", "dist/nodes/Freshdesk/Freshdesk.node.js", "dist/nodes/Flow/Flow.node.js", @@ -126,8 +123,8 @@ "dist/nodes/HttpRequest.node.js", "dist/nodes/Hubspot/Hubspot.node.js", "dist/nodes/If.node.js", - "dist/nodes/Interval.node.js", "dist/nodes/Intercom/Intercom.node.js", + "dist/nodes/Interval.node.js", "dist/nodes/Jira/JiraSoftwareCloud.node.js", "dist/nodes/LinkFish/LinkFish.node.js", "dist/nodes/Mailchimp/Mailchimp.node.js", @@ -135,54 +132,53 @@ "dist/nodes/Mailgun/Mailgun.node.js", "dist/nodes/Mandrill/Mandrill.node.js", "dist/nodes/Mattermost/Mattermost.node.js", - "dist/nodes/Merge.node.js", - "dist/nodes/MoveBinaryData.node.js", - "dist/nodes/MongoDb/MongoDb.node.js", - "dist/nodes/MySql/MySql.node.js", - "dist/nodes/NextCloud/NextCloud.node.js", - "dist/nodes/Mandrill/Mandrill.node.js", "dist/nodes/Mautic/Mautic.node.js", "dist/nodes/Mautic/MauticTrigger.node.js", + "dist/nodes/Merge.node.js", + "dist/nodes/MongoDb/MongoDb.node.js", + "dist/nodes/MoveBinaryData.node.js", + "dist/nodes/Msg91/Msg91.node.js", + "dist/nodes/MySql/MySql.node.js", + "dist/nodes/NextCloud/NextCloud.node.js", "dist/nodes/NoOp.node.js", "dist/nodes/OpenWeatherMap.node.js", + "dist/nodes/PayPal/PayPal.node.js", + "dist/nodes/PayPal/PayPalTrigger.node.js", "dist/nodes/Pipedrive/Pipedrive.node.js", "dist/nodes/Pipedrive/PipedriveTrigger.node.js", "dist/nodes/Postgres/Postgres.node.js", - "dist/nodes/PayPal/PayPal.node.js", - "dist/nodes/PayPal/PayPalTrigger.node.js", - "dist/nodes/Rocketchat/Rocketchat.node.js", "dist/nodes/ReadBinaryFile.node.js", "dist/nodes/ReadBinaryFiles.node.js", - "dist/nodes/Redis/Redis.node.js", "dist/nodes/ReadPdf.node.js", + "dist/nodes/Redis/Redis.node.js", "dist/nodes/RenameKeys.node.js", + "dist/nodes/Rocketchat/Rocketchat.node.js", "dist/nodes/RssFeedRead.node.js", "dist/nodes/Set.node.js", - "dist/nodes/SseTrigger.node.js", - "dist/nodes/SplitInBatches.node.js", + "dist/nodes/Shopify/ShopifyTrigger.node.js", "dist/nodes/Slack/Slack.node.js", + "dist/nodes/SplitInBatches.node.js", "dist/nodes/SpreadsheetFile.node.js", + "dist/nodes/SseTrigger.node.js", "dist/nodes/Start.node.js", "dist/nodes/Stripe/StripeTrigger.node.js", - "dist/nodes/Shopify/ShopifyTrigger.node.js", "dist/nodes/Switch.node.js", "dist/nodes/Telegram/Telegram.node.js", "dist/nodes/Telegram/TelegramTrigger.node.js", "dist/nodes/Todoist/Todoist.node.js", + "dist/nodes/Toggl/TogglTrigger.node.js", "dist/nodes/Trello/Trello.node.js", "dist/nodes/Trello/TrelloTrigger.node.js", "dist/nodes/Twilio/Twilio.node.js", - "dist/nodes/Msg91/Msg91.node.js", "dist/nodes/Typeform/TypeformTrigger.node.js", - "dist/nodes/Toggl/TogglTrigger.node.js", "dist/nodes/Vero/Vero.node.js", - "dist/nodes/WriteBinaryFile.node.js", + "dist/nodes/Webflow/WebflowTrigger.node.js", "dist/nodes/Webhook.node.js", "dist/nodes/Wordpress/Wordpress.node.js", - "dist/nodes/Webflow/WebflowTrigger.node.js", + "dist/nodes/WriteBinaryFile.node.js", "dist/nodes/Xml.node.js", - "dist/nodes/Zendesk/ZendeskTrigger.node.js", - "dist/nodes/Zendesk/Zendesk.node.js" + "dist/nodes/Zendesk/Zendesk.node.js", + "dist/nodes/Zendesk/ZendeskTrigger.node.js" ] }, "devDependencies": {