From a229788d4b21ce3e048f726668cbf1c0cb64567d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Fri, 23 Dec 2022 19:09:52 +0100 Subject: [PATCH] ci: Fix linting issues on master (no-changelog) (#5030) * make CI logs less noisy. suppress linting warning * fix linting issues --- packages/cli/package.json | 2 +- packages/core/package.json | 2 +- packages/design-system/package.json | 2 +- packages/editor-ui/package.json | 2 +- packages/node-dev/package.json | 2 +- .../nodes/AcuityScheduling/GenericFunctions.ts | 4 ++-- .../nodes-base/nodes/Affinity/GenericFunctions.ts | 2 +- .../nodes-base/nodes/AgileCrm/GenericFunctions.ts | 10 +++++----- .../nodes-base/nodes/Autopilot/GenericFunctions.ts | 2 +- .../nodes/Aws/Textract/GenericFunctions.ts | 2 +- .../nodes/Aws/Transcribe/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Bannerbear/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Baserow/GenericFunctions.ts | 4 ++-- .../nodes-base/nodes/Bitbucket/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Bitly/GenericFunctions.ts | 4 ++-- .../nodes-base/nodes/Bitwarden/GenericFunctions.ts | 4 ++-- .../nodes-base/nodes/Brandfetch/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Bubble/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Calendly/GenericFunctions.ts | 2 +- .../nodes-base/nodes/CircleCi/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Cisco/Webex/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Citrix/ADC/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Clearbit/GenericFunctions.ts | 2 +- .../nodes-base/nodes/ClickUp/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Cockpit/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Coda/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Contentful/GenericFunctions.ts | 2 +- .../nodes-base/nodes/ConvertKit/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Copper/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Demio/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Dhl/GenericFunctions.ts | 4 ++-- packages/nodes-base/nodes/Disqus/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Drift/GenericFunctions.ts | 4 ++-- .../nodes-base/nodes/ERPNext/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Egoi/GenericFunctions.ts | 2 +- .../Elastic/ElasticSecurity/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Emelia/GenericFunctions.ts | 4 ++-- .../nodes-base/nodes/Eventbrite/GenericFunctions.ts | 4 ++-- .../nodes-base/nodes/Facebook/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Figma/GenericFunctions.ts | 2 +- .../nodes-base/nodes/FileMaker/GenericFunctions.ts | 12 ++++++------ packages/nodes-base/nodes/Flow/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/FormIo/GenericFunctions.ts | 4 ++-- .../nodes-base/nodes/Formstack/GenericFunctions.ts | 4 ++-- .../nodes-base/nodes/Freshdesk/GenericFunctions.ts | 2 +- .../nodes/Freshservice/GenericFunctions.ts | 2 +- .../nodes-base/nodes/GoToWebinar/GenericFunctions.ts | 2 +- .../nodes/Google/BigQuery/GenericFunctions.ts | 4 ++-- .../nodes/Google/Books/GenericFunctions.ts | 2 +- .../nodes/Google/Calendar/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Google/Chat/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Google/Docs/GenericFunctions.ts | 4 ++-- .../nodes/Google/Drive/GenericFunctions.ts | 6 +++--- .../Firebase/RealtimeDatabase/GenericFunctions.ts | 2 +- .../nodes/Google/Gmail/GenericFunctions.ts | 2 +- .../nodes/Google/Sheet/v1/GenericFunctions.ts | 2 +- .../nodes/Google/Sheet/v2/transport/index.ts | 6 +++--- .../nodes/Google/Slides/GenericFunctions.ts | 6 +++--- .../nodes/Google/Translate/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Grist/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Gumroad/GenericFunctions.ts | 2 +- .../nodes-base/nodes/HackerNews/GenericFunctions.ts | 2 +- .../nodes-base/nodes/HaloPSA/GenericFunctions.ts | 6 +++--- .../nodes-base/nodes/Harvest/GenericFunctions.ts | 4 ++-- .../nodes-base/nodes/Hubspot/GenericFunctions.ts | 6 +++--- .../nodes-base/nodes/HumanticAI/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Hunter/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Intercom/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Jenkins/GenericFunctions.ts | 2 +- .../nodes-base/nodes/JotForm/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Kitemaker/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Linear/GenericFunctions.ts | 4 ++-- .../nodes-base/nodes/LingvaNex/GenericFunctions.ts | 2 +- .../nodes-base/nodes/LinkedIn/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Mailcheck/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Mailchimp/GenericFunctions.ts | 4 ++-- .../nodes-base/nodes/Mandrill/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Matrix/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Medium/GenericFunctions.ts | 4 ++-- .../nodes/Microsoft/ToDo/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Misp/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Mocean/Mocean.node.ts | 2 +- .../nodes-base/nodes/MondayCom/GenericFunctions.ts | 4 ++-- .../nodes-base/nodes/MonicaCrm/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/N8n/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Netlify/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Notion/GenericFunctions.ts | 4 ++-- packages/nodes-base/nodes/Odoo/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Odoo/Odoo.node.ts | 2 +- .../nodes-base/nodes/Onfleet/GenericFunctions.ts | 2 +- .../nodes/OpenThesaurus/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Orbit/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Oura/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Paddle/GenericFunctions.ts | 2 +- .../nodes-base/nodes/PagerDuty/GenericFunctions.ts | 4 ++-- packages/nodes-base/nodes/PayPal/GenericFunctions.ts | 4 ++-- packages/nodes-base/nodes/PayPal/PayPal.node.ts | 2 +- .../nodes-base/nodes/Peekalink/GenericFunctions.ts | 2 +- .../nodes-base/nodes/PostHog/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Postmark/GenericFunctions.ts | 2 +- .../nodes-base/nodes/ProfitWell/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Pushcut/GenericFunctions.ts | 2 +- .../nodes-base/nodes/QuickBooks/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Raindrop/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/S3/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Salesforce/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Salesmate/GenericFunctions.ts | 2 +- .../nodes-base/nodes/SeaTable/GenericFunctions.ts | 4 ++-- .../nodes/SecurityScorecard/GenericFunctions.ts | 2 +- .../nodes-base/nodes/SentryIo/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Splunk/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Stackby/GenericFunction.ts | 2 +- .../nodes-base/nodes/Storyblok/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Strapi/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Supabase/GenericFunctions.ts | 2 +- .../nodes/SurveyMonkey/GenericFunctions.ts | 4 ++-- packages/nodes-base/nodes/Taiga/GenericFunctions.ts | 4 ++-- .../nodes-base/nodes/Tapfiliate/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Telegram/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Toggl/GenericFunctions.ts | 2 +- .../nodes-base/nodes/TravisCi/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Typeform/GenericFunctions.ts | 2 +- .../nodes/UnleashedSoftware/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Uplead/GenericFunctions.ts | 2 +- .../nodes/Venafi/ProtectCloud/GenericFunctions.ts | 6 +++++- packages/nodes-base/nodes/Vero/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Workable/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Zammad/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Zulip/GenericFunctions.ts | 2 +- packages/nodes-base/package.json | 2 +- packages/workflow/package.json | 2 +- 131 files changed, 177 insertions(+), 173 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 2c25a68f37..7c35c48779 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -24,7 +24,7 @@ "build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && node scripts/build.mjs", "dev": "concurrently -k -n \"TypeScript,Node\" -c \"yellow.bold,cyan.bold\" \"npm run watch\" \"nodemon\"", "format": "prettier --write . --ignore-path ../../.prettierignore", - "lint": "eslint .", + "lint": "eslint --quiet .", "lintfix": "eslint . --fix", "postpack": "rm -f oclif.manifest.json", "prepack": "oclif-dev manifest", diff --git a/packages/core/package.json b/packages/core/package.json index 3607c23edb..1fb510fa1a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -24,7 +24,7 @@ "build": "tsc -p tsconfig.build.json", "dev": "pnpm watch", "format": "prettier --write . --ignore-path ../../.prettierignore", - "lint": "eslint .", + "lint": "eslint --quiet .", "lintfix": "eslint . --fix", "watch": "tsc -p tsconfig.build.json --watch", "test": "jest" diff --git a/packages/design-system/package.json b/packages/design-system/package.json index 3dde9c51c1..339adbc46d 100644 --- a/packages/design-system/package.json +++ b/packages/design-system/package.json @@ -22,7 +22,7 @@ "build:storybook": "build-storybook", "storybook": "start-storybook -p 6006", "format": "prettier --write . --ignore-path ../../.prettierignore", - "lint": "eslint --ext .js,.ts,.vue src", + "lint": "eslint --quiet --ext .js,.ts,.vue src", "lintfix": "eslint --ext .js,.ts,.vue src --fix" }, "peerDependencies": { diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index 48fb20785c..af84c4773b 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -18,7 +18,7 @@ "build": "cross-env VUE_APP_PUBLIC_PATH=\"/{{BASE_PATH}}/\" NODE_OPTIONS=\"--max-old-space-size=8192\" vite build", "typecheck": "vue-tsc --emitDeclarationOnly", "dev": "pnpm serve", - "lint": "eslint --ext .js,.ts,.vue src", + "lint": "eslint --quiet --ext .js,.ts,.vue src", "lintfix": "eslint --ext .js,.ts,.vue src --fix", "format": "prettier --write . --ignore-path ../../.prettierignore", "serve": "cross-env VUE_APP_URL_BASE_API=http://localhost:5678/ vite --host 0.0.0.0 --port 8080 dev", diff --git a/packages/node-dev/package.json b/packages/node-dev/package.json index b5151e4ff1..0ed7cd5334 100644 --- a/packages/node-dev/package.json +++ b/packages/node-dev/package.json @@ -24,7 +24,7 @@ "build": "tsc --noEmit", "build-node-dev": "tsc", "format": "prettier --write . --ignore-path ../../.prettierignore", - "lint": "eslint .", + "lint": "eslint --quiet .", "lintfix": "eslint . --fix", "postpack": "rm -f oclif.manifest.json", "prepack": "echo \"Building project...\" && rm -rf dist && tsc -b && oclif-dev manifest", diff --git a/packages/nodes-base/nodes/AcuityScheduling/GenericFunctions.ts b/packages/nodes-base/nodes/AcuityScheduling/GenericFunctions.ts index d39596c485..51e3981ed7 100644 --- a/packages/nodes-base/nodes/AcuityScheduling/GenericFunctions.ts +++ b/packages/nodes-base/nodes/AcuityScheduling/GenericFunctions.ts @@ -45,10 +45,10 @@ export async function acuitySchedulingApiRequest( password: credentials.apiKey as string, }; - return await this.helpers.request!(options); + return await this.helpers.request(options); } else { delete options.auth; - return await this.helpers.requestOAuth2!.call( + return await this.helpers.requestOAuth2.call( this, 'acuitySchedulingOAuth2Api', options, diff --git a/packages/nodes-base/nodes/Affinity/GenericFunctions.ts b/packages/nodes-base/nodes/Affinity/GenericFunctions.ts index 180530d6ce..8ebeac607b 100644 --- a/packages/nodes-base/nodes/Affinity/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Affinity/GenericFunctions.ts @@ -38,7 +38,7 @@ export async function affinityApiRequest( } options = Object.assign({}, options, option); try { - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts b/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts index 393e912385..576e5b6960 100644 --- a/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts +++ b/packages/nodes-base/nodes/AgileCrm/GenericFunctions.ts @@ -48,7 +48,7 @@ export async function agileCrmApiRequest( } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } @@ -126,7 +126,7 @@ export async function agileCrmApiRequestUpdate( if (payload.properties) { options.body.properties = payload.properties; options.uri = baseUri + 'api/contacts/edit-properties'; - lastSuccesfulUpdateReturn = await this.helpers.request!(options); + lastSuccesfulUpdateReturn = await this.helpers.request(options); // Iterate trough properties and show them as individial updates instead of only vague "properties" payload.properties?.map((property: any) => { @@ -138,7 +138,7 @@ export async function agileCrmApiRequestUpdate( if (payload.lead_score) { options.body.lead_score = payload.lead_score; options.uri = baseUri + 'api/contacts/edit/lead-score'; - lastSuccesfulUpdateReturn = await this.helpers.request!(options); + lastSuccesfulUpdateReturn = await this.helpers.request(options); successfulUpdates.push('lead_score'); @@ -147,7 +147,7 @@ export async function agileCrmApiRequestUpdate( if (body.tags) { options.body.tags = payload.tags; options.uri = baseUri + 'api/contacts/edit/tags'; - lastSuccesfulUpdateReturn = await this.helpers.request!(options); + lastSuccesfulUpdateReturn = await this.helpers.request(options); payload.tags?.map((tag: string) => { successfulUpdates.push(`(Tag) ${tag}`); @@ -158,7 +158,7 @@ export async function agileCrmApiRequestUpdate( if (body.star_value) { options.body.star_value = payload.star_value; options.uri = baseUri + 'api/contacts/edit/add-star'; - lastSuccesfulUpdateReturn = await this.helpers.request!(options); + lastSuccesfulUpdateReturn = await this.helpers.request(options); successfulUpdates.push('star_value'); diff --git a/packages/nodes-base/nodes/Autopilot/GenericFunctions.ts b/packages/nodes-base/nodes/Autopilot/GenericFunctions.ts index ce70145aea..a7b322c784 100644 --- a/packages/nodes-base/nodes/Autopilot/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Autopilot/GenericFunctions.ts @@ -39,7 +39,7 @@ export async function autopilotApiRequest( } try { - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Aws/Textract/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/Textract/GenericFunctions.ts index 2f6cddd71e..1f7955f19b 100644 --- a/packages/nodes-base/nodes/Aws/Textract/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/Textract/GenericFunctions.ts @@ -173,7 +173,7 @@ export async function validateCredentials( body: signOpts.body, }; - const response = await this.helpers.request!(options); + const response = await this.helpers.request(options); return new Promise((resolve, reject) => { parseString(response, { explicitArray: false }, (err, data) => { diff --git a/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts index c6efb94787..f383c9de14 100644 --- a/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts @@ -63,7 +63,7 @@ export async function awsApiRequest( }; try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); // no XML parsing needed } diff --git a/packages/nodes-base/nodes/Bannerbear/GenericFunctions.ts b/packages/nodes-base/nodes/Bannerbear/GenericFunctions.ts index 915bf5ab79..a9f3916305 100644 --- a/packages/nodes-base/nodes/Bannerbear/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bannerbear/GenericFunctions.ts @@ -37,7 +37,7 @@ export async function bannerbearApiRequest( } options.headers = Object.assign({}, options.headers, headers); try { - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Baserow/GenericFunctions.ts b/packages/nodes-base/nodes/Baserow/GenericFunctions.ts index 28c02490ff..83ec71a9cd 100644 --- a/packages/nodes-base/nodes/Baserow/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Baserow/GenericFunctions.ts @@ -39,7 +39,7 @@ export async function baserowApiRequest( } try { - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } @@ -97,7 +97,7 @@ export async function getJwtToken( }; try { - const { token } = (await this.helpers.request!(options)) as { token: string }; + const { token } = (await this.helpers.request(options)) as { token: string }; return token; } catch (error) { throw new NodeApiError(this.getNode(), error); diff --git a/packages/nodes-base/nodes/Bitbucket/GenericFunctions.ts b/packages/nodes-base/nodes/Bitbucket/GenericFunctions.ts index b969fc06c4..f55259febe 100644 --- a/packages/nodes-base/nodes/Bitbucket/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bitbucket/GenericFunctions.ts @@ -35,7 +35,7 @@ export async function bitbucketApiRequest( } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Bitly/GenericFunctions.ts b/packages/nodes-base/nodes/Bitly/GenericFunctions.ts index 9e973dfd31..f29517a88c 100644 --- a/packages/nodes-base/nodes/Bitly/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bitly/GenericFunctions.ts @@ -38,9 +38,9 @@ export async function bitlyApiRequest( const credentials = await this.getCredentials('bitlyApi'); options.headers = { Authorization: `Bearer ${credentials.accessToken}` }; - return await this.helpers.request!(options); + return await this.helpers.request(options); } else { - return await this.helpers.requestOAuth2!.call(this, 'bitlyOAuth2Api', options, { + return await this.helpers.requestOAuth2.call(this, 'bitlyOAuth2Api', options, { tokenType: 'Bearer', }); } diff --git a/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts b/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts index b01206ad95..29434c42aa 100644 --- a/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts @@ -43,7 +43,7 @@ export async function bitwardenApiRequest( } try { - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } @@ -76,7 +76,7 @@ export async function getAccessToken( }; try { - const { access_token } = await this.helpers.request!(options); + const { access_token } = await this.helpers.request(options); return access_token; } catch (error) { throw new NodeApiError(this.getNode(), error); diff --git a/packages/nodes-base/nodes/Brandfetch/GenericFunctions.ts b/packages/nodes-base/nodes/Brandfetch/GenericFunctions.ts index e51b2435e5..dafeb2e9cc 100644 --- a/packages/nodes-base/nodes/Brandfetch/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Brandfetch/GenericFunctions.ts @@ -45,7 +45,7 @@ export async function brandfetchApiRequest( delete options.qs; } - const response = await this.helpers.request!(options); + const response = await this.helpers.request(options); if (response.statusCode && response.statusCode !== 200) { throw new NodeApiError(this.getNode(), response); diff --git a/packages/nodes-base/nodes/Bubble/GenericFunctions.ts b/packages/nodes-base/nodes/Bubble/GenericFunctions.ts index 8c998a2a6c..e79f6e0c80 100644 --- a/packages/nodes-base/nodes/Bubble/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bubble/GenericFunctions.ts @@ -48,7 +48,7 @@ export async function bubbleApiRequest( } try { - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Calendly/GenericFunctions.ts b/packages/nodes-base/nodes/Calendly/GenericFunctions.ts index 65d4f41922..7e56fdaf9b 100644 --- a/packages/nodes-base/nodes/Calendly/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Calendly/GenericFunctions.ts @@ -89,5 +89,5 @@ export async function validateCredentials( uri: 'https://calendly.com/api/v1/users/me', }); } - return this.helpers.request!(options); + return this.helpers.request(options); } diff --git a/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts b/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts index 8553ddeb54..94743117ce 100644 --- a/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts @@ -36,7 +36,7 @@ export async function circleciApiRequest( delete options.body; } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts b/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts index 891b0d7369..cc3466793c 100644 --- a/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts @@ -42,7 +42,7 @@ export async function webexApiRequest( delete options.qs; } //@ts-ignore - return this.helpers.requestOAuth2.call(this, 'ciscoWebexOAuth2Api', options, { + return await this.helpers.requestOAuth2.call(this, 'ciscoWebexOAuth2Api', options, { tokenType: 'Bearer', }); } catch (error) { diff --git a/packages/nodes-base/nodes/Citrix/ADC/GenericFunctions.ts b/packages/nodes-base/nodes/Citrix/ADC/GenericFunctions.ts index e5d040031c..0e5c6c1e16 100644 --- a/packages/nodes-base/nodes/Citrix/ADC/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Citrix/ADC/GenericFunctions.ts @@ -35,7 +35,7 @@ export async function citrixADCApiRequest( options = Object.assign({}, options, option); try { - return this.helpers.requestWithAuthentication.call(this, 'citrixAdcApi', options); + return await this.helpers.requestWithAuthentication.call(this, 'citrixAdcApi', options); } catch (error) { throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/Clearbit/GenericFunctions.ts b/packages/nodes-base/nodes/Clearbit/GenericFunctions.ts index 43ef7fa10f..8994b94966 100644 --- a/packages/nodes-base/nodes/Clearbit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Clearbit/GenericFunctions.ts @@ -34,7 +34,7 @@ export async function clearbitApiRequest( delete options.body; } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts b/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts index 3963bf0304..75248a2b72 100644 --- a/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ClickUp/GenericFunctions.ts @@ -47,7 +47,7 @@ export async function clickupApiRequest( tokenType: 'Bearer', }; // @ts-ignore - return await this.helpers.requestOAuth2!.call( + return await this.helpers.requestOAuth2.call( this, 'clickUpOAuth2Api', options, diff --git a/packages/nodes-base/nodes/Cockpit/GenericFunctions.ts b/packages/nodes-base/nodes/Cockpit/GenericFunctions.ts index e63731eeee..3704d2cd6c 100644 --- a/packages/nodes-base/nodes/Cockpit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Cockpit/GenericFunctions.ts @@ -33,7 +33,7 @@ export async function cockpitApiRequest( } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Coda/GenericFunctions.ts b/packages/nodes-base/nodes/Coda/GenericFunctions.ts index 430cc6026e..06355708cf 100644 --- a/packages/nodes-base/nodes/Coda/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Coda/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function codaApiRequest( } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Contentful/GenericFunctions.ts b/packages/nodes-base/nodes/Contentful/GenericFunctions.ts index 2732657073..01bd993bf2 100644 --- a/packages/nodes-base/nodes/Contentful/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Contentful/GenericFunctions.ts @@ -33,7 +33,7 @@ export async function contentfulApiRequest( } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/ConvertKit/GenericFunctions.ts b/packages/nodes-base/nodes/ConvertKit/GenericFunctions.ts index 81e14f681f..830798b79d 100644 --- a/packages/nodes-base/nodes/ConvertKit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ConvertKit/GenericFunctions.ts @@ -45,7 +45,7 @@ export async function convertKitApiRequest( } try { - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Copper/GenericFunctions.ts b/packages/nodes-base/nodes/Copper/GenericFunctions.ts index 6e95ff921c..625d1125eb 100644 --- a/packages/nodes-base/nodes/Copper/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Copper/GenericFunctions.ts @@ -65,7 +65,7 @@ export async function copperApiRequest( } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Demio/GenericFunctions.ts b/packages/nodes-base/nodes/Demio/GenericFunctions.ts index 3ad09af3b3..b4227f8dab 100644 --- a/packages/nodes-base/nodes/Demio/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Demio/GenericFunctions.ts @@ -35,7 +35,7 @@ export async function demioApiRequest( options = Object.assign({}, options, option); - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Dhl/GenericFunctions.ts b/packages/nodes-base/nodes/Dhl/GenericFunctions.ts index 1cf1d59eb2..1f74ea5f9b 100644 --- a/packages/nodes-base/nodes/Dhl/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Dhl/GenericFunctions.ts @@ -42,7 +42,7 @@ export async function dhlApiRequest( } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } @@ -70,5 +70,5 @@ export async function validateCredentials( json: true, }; - return this.helpers.request!(options); + return this.helpers.request(options); } diff --git a/packages/nodes-base/nodes/Disqus/GenericFunctions.ts b/packages/nodes-base/nodes/Disqus/GenericFunctions.ts index 20d2092961..7a18aac2a8 100644 --- a/packages/nodes-base/nodes/Disqus/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Disqus/GenericFunctions.ts @@ -42,7 +42,7 @@ export async function disqusApiRequest( delete options.body; } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Drift/GenericFunctions.ts b/packages/nodes-base/nodes/Drift/GenericFunctions.ts index 6d9fc97599..30e9ea8d84 100644 --- a/packages/nodes-base/nodes/Drift/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Drift/GenericFunctions.ts @@ -39,9 +39,9 @@ export async function driftApiRequest( options.headers!.Authorization = `Bearer ${credentials.accessToken}`; - return this.helpers.request!(options); + return await this.helpers.request(options); } else { - return this.helpers.requestOAuth2!.call(this, 'driftOAuth2Api', options); + return await this.helpers.requestOAuth2.call(this, 'driftOAuth2Api', options); } } catch (error) { throw new NodeApiError(this.getNode(), error); diff --git a/packages/nodes-base/nodes/ERPNext/GenericFunctions.ts b/packages/nodes-base/nodes/ERPNext/GenericFunctions.ts index b43e29fbfb..8cdb2d9503 100644 --- a/packages/nodes-base/nodes/ERPNext/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ERPNext/GenericFunctions.ts @@ -39,7 +39,7 @@ export async function erpNextApiRequest( delete options.qs; } try { - return this.helpers.requestWithAuthentication.call(this, 'erpNextApi', options); + return await this.helpers.requestWithAuthentication.call(this, 'erpNextApi', options); } catch (error) { if (error.statusCode === 403) { throw new NodeApiError(this.getNode(), { message: 'DocType unavailable.' }); diff --git a/packages/nodes-base/nodes/Egoi/GenericFunctions.ts b/packages/nodes-base/nodes/Egoi/GenericFunctions.ts index bda8d0321c..3b21e8f2f8 100644 --- a/packages/nodes-base/nodes/Egoi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Egoi/GenericFunctions.ts @@ -55,7 +55,7 @@ export async function egoiApiRequest( } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts b/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts index a2e4eeb636..b09087f97e 100644 --- a/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts @@ -44,7 +44,7 @@ export async function elasticSecurityApiRequest( } try { - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { if (error?.error?.error === 'Not Acceptable' && error?.error?.message) { error.error.error = `${error.error.error}: ${error.error.message}`; diff --git a/packages/nodes-base/nodes/Emelia/GenericFunctions.ts b/packages/nodes-base/nodes/Emelia/GenericFunctions.ts index 461c879784..8d4ebf0f28 100644 --- a/packages/nodes-base/nodes/Emelia/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Emelia/GenericFunctions.ts @@ -50,7 +50,7 @@ export async function emeliaApiRequest( }; try { - return this.helpers.request!.call(this, options); + return await this.helpers.request.call(this, options); } catch (error) { throw new NodeApiError(this.getNode(), error as JsonObject); } @@ -129,7 +129,7 @@ export async function emeliaApiTest( }; try { - await this.helpers.request!(options); + await this.helpers.request(options); } catch (error) { return { status: 'Error', diff --git a/packages/nodes-base/nodes/Eventbrite/GenericFunctions.ts b/packages/nodes-base/nodes/Eventbrite/GenericFunctions.ts index 7512c5886e..ddaec221b0 100644 --- a/packages/nodes-base/nodes/Eventbrite/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Eventbrite/GenericFunctions.ts @@ -45,9 +45,9 @@ export async function eventbriteApiRequest( const credentials = await this.getCredentials('eventbriteApi'); options.headers!.Authorization = `Bearer ${credentials.apiKey}`; - return await this.helpers.request!(options); + return await this.helpers.request(options); } else { - return await this.helpers.requestOAuth2!.call(this, 'eventbriteOAuth2Api', options); + return await this.helpers.requestOAuth2.call(this, 'eventbriteOAuth2Api', options); } } catch (error) { throw new NodeApiError(this.getNode(), error as JsonObject); diff --git a/packages/nodes-base/nodes/Facebook/GenericFunctions.ts b/packages/nodes-base/nodes/Facebook/GenericFunctions.ts index 78582b7023..733ce918fe 100644 --- a/packages/nodes-base/nodes/Facebook/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Facebook/GenericFunctions.ts @@ -50,7 +50,7 @@ export async function facebookApiRequest( }; try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Figma/GenericFunctions.ts b/packages/nodes-base/nodes/Figma/GenericFunctions.ts index 5bf1fbdfb9..7aa17fd22f 100644 --- a/packages/nodes-base/nodes/Figma/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Figma/GenericFunctions.ts @@ -33,7 +33,7 @@ export async function figmaApiRequest( delete options.body; } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/FileMaker/GenericFunctions.ts b/packages/nodes-base/nodes/FileMaker/GenericFunctions.ts index d8bd638165..43abc3282e 100644 --- a/packages/nodes-base/nodes/FileMaker/GenericFunctions.ts +++ b/packages/nodes-base/nodes/FileMaker/GenericFunctions.ts @@ -48,7 +48,7 @@ export async function layoutsApiRequest( }; try { - const responseData = await this.helpers.request!(options); + const responseData = await this.helpers.request(options); const items = parseLayouts(responseData.response.layouts); items.sort((a, b) => (a.name > b.name ? 0 : 1)); return items; @@ -95,7 +95,7 @@ export async function getFields(this: ILoadOptionsFunctions): Promise { }; try { - const responseData = await this.helpers.request!(options); + const responseData = await this.helpers.request(options); return responseData.response.fieldMetaData; } catch (error) { // If that data does not exist for some reason return the actual error @@ -126,7 +126,7 @@ export async function getPortals(this: ILoadOptionsFunctions): Promise { }; try { - const responseData = await this.helpers.request!(options); + const responseData = await this.helpers.request(options); return responseData.response.portalMetaData; } catch (error) { // If that data does not exist for some reason return the actual error @@ -156,7 +156,7 @@ export async function getScripts(this: ILoadOptionsFunctions): Promise { }; try { - const responseData = await this.helpers.request!(options); + const responseData = await this.helpers.request(options); const items = parseScriptsList(responseData.response.scripts); items.sort((a, b) => (a.name > b.name ? 0 : 1)); return items; @@ -216,7 +216,7 @@ export async function getToken( }; try { - const response = await this.helpers.request!(requestOptions); + const response = await this.helpers.request(requestOptions); if (typeof response === 'string') { throw new NodeOperationError( @@ -252,7 +252,7 @@ export async function logout( }; try { - const response = await this.helpers.request!(requestOptions); + const response = await this.helpers.request(requestOptions); if (typeof response === 'string') { throw new NodeOperationError( diff --git a/packages/nodes-base/nodes/Flow/GenericFunctions.ts b/packages/nodes-base/nodes/Flow/GenericFunctions.ts index 23d95c7cf6..a784cb926b 100644 --- a/packages/nodes-base/nodes/Flow/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Flow/GenericFunctions.ts @@ -33,7 +33,7 @@ export async function flowApiRequest( } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/FormIo/GenericFunctions.ts b/packages/nodes-base/nodes/FormIo/GenericFunctions.ts index bd76980b4e..874b3760dd 100644 --- a/packages/nodes-base/nodes/FormIo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/FormIo/GenericFunctions.ts @@ -34,7 +34,7 @@ async function getToken( }; try { - const responseObject = await this.helpers.request!(options); + const responseObject = await this.helpers.request(options); return responseObject.headers['x-jwt-token']; } catch (error) { throw new Error( @@ -72,7 +72,7 @@ export async function formIoApiRequest( }; try { - return this.helpers.request!.call(this, options); + return await this.helpers.request.call(this, options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Formstack/GenericFunctions.ts b/packages/nodes-base/nodes/Formstack/GenericFunctions.ts index fd57ae5e62..a88cf2e57c 100644 --- a/packages/nodes-base/nodes/Formstack/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Formstack/GenericFunctions.ts @@ -74,9 +74,9 @@ export async function apiRequest( const credentials = (await this.getCredentials('formstackApi')) as IDataObject; options.headers!.Authorization = `Bearer ${credentials.accessToken}`; - return await this.helpers.request!(options); + return await this.helpers.request(options); } else { - return await this.helpers.requestOAuth2!.call(this, 'formstackOAuth2Api', options); + return await this.helpers.requestOAuth2.call(this, 'formstackOAuth2Api', options); } } catch (error) { throw new NodeApiError(this.getNode(), error); diff --git a/packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts b/packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts index 69e0c7468a..02c2c79e0c 100644 --- a/packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts @@ -39,7 +39,7 @@ export async function freshdeskApiRequest( } options = Object.assign({}, options, option); try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Freshservice/GenericFunctions.ts b/packages/nodes-base/nodes/Freshservice/GenericFunctions.ts index 4fe1fc1032..0b7f8a9d59 100644 --- a/packages/nodes-base/nodes/Freshservice/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Freshservice/GenericFunctions.ts @@ -45,7 +45,7 @@ export async function freshserviceApiRequest( } try { - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { if (error.error.description === 'Validation failed') { const numberOfErrors = error.error.errors.length; diff --git a/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts b/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts index 7ddec2611a..f2ce1127ce 100644 --- a/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts +++ b/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts @@ -57,7 +57,7 @@ export async function goToWebinarApiRequest( } try { - const response = await this.helpers.requestOAuth2!.call(this, 'goToWebinarOAuth2Api', options, { + const response = await this.helpers.requestOAuth2.call(this, 'goToWebinarOAuth2Api', options, { tokenExpiredStatusCode: 403, }); diff --git a/packages/nodes-base/nodes/Google/BigQuery/GenericFunctions.ts b/packages/nodes-base/nodes/Google/BigQuery/GenericFunctions.ts index f67a3d5ac2..9ba5a9716c 100644 --- a/packages/nodes-base/nodes/Google/BigQuery/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/BigQuery/GenericFunctions.ts @@ -52,7 +52,7 @@ export async function googleApiRequest( const { access_token } = await getAccessToken.call(this, credentials as IDataObject); options.headers!.Authorization = `Bearer ${access_token}`; - return await this.helpers.request!(options); + return await this.helpers.request(options); } else { //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'googleBigQueryOAuth2Api', options); @@ -134,7 +134,7 @@ async function getAccessToken( json: true, }; - return this.helpers.request!(options); + return this.helpers.request(options); } export function simplify(rows: IDataObject[], fields: string[]) { diff --git a/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts index c202e3e66b..38543abeca 100644 --- a/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Books/GenericFunctions.ts @@ -143,5 +143,5 @@ async function getAccessToken( json: true, }; - return this.helpers.request!(options); + return this.helpers.request(options); } diff --git a/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts index 1faf257922..001c2653e1 100644 --- a/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts @@ -40,7 +40,7 @@ export async function googleApiRequest( delete options.body; } //@ts-ignore - return this.helpers.requestOAuth2.call(this, 'googleCalendarOAuth2Api', options); + return await this.helpers.requestOAuth2.call(this, 'googleCalendarOAuth2Api', options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts index b7185629ed..4d1b26a8c6 100644 --- a/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Chat/GenericFunctions.ts @@ -154,7 +154,7 @@ export async function getAccessToken( json: true, }; - return this.helpers.request!(options); + return this.helpers.request(options); } export function validateJSON(json: string | undefined): any { diff --git a/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts index 07d0978007..c7a864ca0a 100644 --- a/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Docs/GenericFunctions.ts @@ -53,7 +53,7 @@ export async function googleApiRequest( ); options.headers!.Authorization = `Bearer ${access_token}`; - return await this.helpers.request!(options); + return await this.helpers.request(options); } else { //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'googleDocsOAuth2Api', options); @@ -138,7 +138,7 @@ async function getAccessToken( json: true, }; - return this.helpers.request!(options); + return this.helpers.request(options); } export const hasKeys = (obj = {}) => Object.keys(obj).length > 0; diff --git a/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts index e70220f84d..d9e3256df2 100644 --- a/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts @@ -58,10 +58,10 @@ export async function googleApiRequest( ); options.headers!.Authorization = `Bearer ${access_token}`; - return this.helpers.request!(options); + return await this.helpers.request(options); } else { //@ts-ignore - return this.helpers.requestOAuth2.call(this, 'googleDriveOAuth2Api', options); + return await this.helpers.requestOAuth2.call(this, 'googleDriveOAuth2Api', options); } } catch (error) { if (error.code === 'ERR_OSSL_PEM_NO_START_LINE') { @@ -145,7 +145,7 @@ async function getAccessToken( json: true, }; - return this.helpers.request!(options); + return this.helpers.request(options); } export function extractId(url: string): string { diff --git a/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts index e4996c8b06..80b4957843 100644 --- a/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Firebase/RealtimeDatabase/GenericFunctions.ts @@ -38,7 +38,7 @@ export async function googleApiRequest( delete options.body; } - return await this.helpers.requestOAuth2!.call( + return await this.helpers.requestOAuth2.call( this, 'googleFirebaseRealtimeDatabaseOAuth2Api', options, diff --git a/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts index ae0a9e6e7e..65b24a17be 100644 --- a/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Gmail/GenericFunctions.ts @@ -347,7 +347,7 @@ async function getAccessToken( json: true, }; - return this.helpers.request!(options); + return this.helpers.request(options); } export function prepareQuery( diff --git a/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts index 37b223d561..bfca199205 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v1/GenericFunctions.ts @@ -149,7 +149,7 @@ export async function getAccessToken( json: true, }; - return this.helpers.request!(options); + return this.helpers.request(options); } // Hex to RGB diff --git a/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts b/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts index 7a29b1dbdc..862b823f93 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v2/transport/index.ts @@ -53,9 +53,9 @@ export async function apiRequest( options.headers!.Authorization = `Bearer ${access_token}`; - return await this.helpers.request!(options); + return await this.helpers.request(options); } else { - return await this.helpers.requestOAuth2!.call(this, 'googleSheetsOAuth2Api', options); + return await this.helpers.requestOAuth2.call(this, 'googleSheetsOAuth2Api', options); } } catch (error) { if (error.code === 'ERR_OSSL_PEM_NO_START_LINE') { @@ -150,5 +150,5 @@ export async function getAccessToken( json: true, }; - return this.helpers.request!(options); + return this.helpers.request(options); } diff --git a/packages/nodes-base/nodes/Google/Slides/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Slides/GenericFunctions.ts index 4b54103628..e71a506d04 100644 --- a/packages/nodes-base/nodes/Google/Slides/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Slides/GenericFunctions.ts @@ -55,9 +55,9 @@ export async function googleApiRequest( credentials as unknown as IGoogleAuthCredentials, ); options.headers.Authorization = `Bearer ${access_token}`; - return await this.helpers.request!(options); + return await this.helpers.request(options); } else { - return await this.helpers.requestOAuth2!.call(this, 'googleSlidesOAuth2Api', options); + return await this.helpers.requestOAuth2.call(this, 'googleSlidesOAuth2Api', options); } } catch (error) { if (error.code === 'ERR_OSSL_PEM_NO_START_LINE') { @@ -117,5 +117,5 @@ async function getAccessToken( json: true, }; - return this.helpers.request!(options); + return this.helpers.request(options); } diff --git a/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts index 7685d0a8d7..d2fcbdddc5 100644 --- a/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Translate/GenericFunctions.ts @@ -140,5 +140,5 @@ async function getAccessToken( json: true, }; - return this.helpers.request!(options); + return this.helpers.request(options); } diff --git a/packages/nodes-base/nodes/Grist/GenericFunctions.ts b/packages/nodes-base/nodes/Grist/GenericFunctions.ts index fd09171e8d..e8ed43c756 100644 --- a/packages/nodes-base/nodes/Grist/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Grist/GenericFunctions.ts @@ -49,7 +49,7 @@ export async function gristApiRequest( } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Gumroad/GenericFunctions.ts b/packages/nodes-base/nodes/Gumroad/GenericFunctions.ts index 532f2f2245..a22c9877e7 100644 --- a/packages/nodes-base/nodes/Gumroad/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Gumroad/GenericFunctions.ts @@ -39,7 +39,7 @@ export async function gumroadApiRequest( } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts b/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts index 6a1b9d1372..7c1be1b216 100644 --- a/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts @@ -22,7 +22,7 @@ export async function hackerNewsApiRequest( }; try { - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/HaloPSA/GenericFunctions.ts b/packages/nodes-base/nodes/HaloPSA/GenericFunctions.ts index 8ee258e51d..2124035ee1 100644 --- a/packages/nodes-base/nodes/HaloPSA/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HaloPSA/GenericFunctions.ts @@ -46,7 +46,7 @@ export async function getAccessTokens( }; try { - const tokens = await this.helpers.request!(options); + const tokens = await this.helpers.request(options); return tokens; } catch (error) { throw new NodeApiError(this.getNode(), error as JsonObject); @@ -89,7 +89,7 @@ export async function haloPSAApiRequest( if (Object.keys(body).length === 0) { delete options.body; } - const result = await this.helpers.request!(options); + const result = await this.helpers.request(options); if (method === 'DELETE' && result.id) { return { success: true }; } @@ -246,5 +246,5 @@ export async function validateCredentials( json: true, }; - return (await this.helpers.request!(options)) as IHaloPSATokens; + return (await this.helpers.request(options)) as IHaloPSATokens; } diff --git a/packages/nodes-base/nodes/Harvest/GenericFunctions.ts b/packages/nodes-base/nodes/Harvest/GenericFunctions.ts index 178cb19c44..f9c149c9cd 100644 --- a/packages/nodes-base/nodes/Harvest/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Harvest/GenericFunctions.ts @@ -44,9 +44,9 @@ export async function harvestApiRequest( //@ts-ignore options.headers.Authorization = `Bearer ${credentials.accessToken}`; - return await this.helpers.request!(options); + return await this.helpers.request(options); } else { - return await this.helpers.requestOAuth2!.call(this, 'harvestOAuth2Api', options); + return await this.helpers.requestOAuth2.call(this, 'harvestOAuth2Api', options); } } catch (error) { throw new NodeApiError(this.getNode(), error); diff --git a/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts b/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts index 6ccfeb24fe..27576fcfd2 100644 --- a/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts @@ -50,15 +50,15 @@ export async function hubspotApiRequest( if (endpoint.includes('webhooks')) { const credentials = await this.getCredentials('hubspotDeveloperApi'); options.qs.hapikey = credentials.apiKey as string; - return await this.helpers.request!(options); + return await this.helpers.request(options); } else { - return await this.helpers.requestOAuth2!.call(this, 'hubspotDeveloperApi', options, { + return await this.helpers.requestOAuth2.call(this, 'hubspotDeveloperApi', options, { tokenType: 'Bearer', includeCredentialsOnRefreshOnBody: true, }); } } else { - return await this.helpers.requestOAuth2!.call(this, 'hubspotOAuth2Api', options, { + return await this.helpers.requestOAuth2.call(this, 'hubspotOAuth2Api', options, { tokenType: 'Bearer', includeCredentialsOnRefreshOnBody: true, }); diff --git a/packages/nodes-base/nodes/HumanticAI/GenericFunctions.ts b/packages/nodes-base/nodes/HumanticAI/GenericFunctions.ts index 35956d18f6..ad21403403 100644 --- a/packages/nodes-base/nodes/HumanticAI/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HumanticAI/GenericFunctions.ts @@ -38,7 +38,7 @@ export async function humanticAiApiRequest( delete options.body; } - const response = await this.helpers.request!(options); + const response = await this.helpers.request(options); if (response.data && response.data.status === 'error') { throw new NodeApiError(this.getNode(), response.data); diff --git a/packages/nodes-base/nodes/Hunter/GenericFunctions.ts b/packages/nodes-base/nodes/Hunter/GenericFunctions.ts index 8932a2f3cc..224ee6ecb3 100644 --- a/packages/nodes-base/nodes/Hunter/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Hunter/GenericFunctions.ts @@ -31,7 +31,7 @@ export async function hunterApiRequest( delete options.body; } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Intercom/GenericFunctions.ts b/packages/nodes-base/nodes/Intercom/GenericFunctions.ts index 58a6b89868..bfeaf71f46 100644 --- a/packages/nodes-base/nodes/Intercom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Intercom/GenericFunctions.ts @@ -35,7 +35,7 @@ export async function intercomApiRequest( }; try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Jenkins/GenericFunctions.ts b/packages/nodes-base/nodes/Jenkins/GenericFunctions.ts index e5cd6d3da9..457fd4ba5d 100644 --- a/packages/nodes-base/nodes/Jenkins/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Jenkins/GenericFunctions.ts @@ -35,7 +35,7 @@ export async function jenkinsApiRequest( }; options = Object.assign({}, options, option); try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/JotForm/GenericFunctions.ts b/packages/nodes-base/nodes/JotForm/GenericFunctions.ts index 4ae114f050..04cfe5a9f8 100644 --- a/packages/nodes-base/nodes/JotForm/GenericFunctions.ts +++ b/packages/nodes-base/nodes/JotForm/GenericFunctions.ts @@ -41,7 +41,7 @@ export async function jotformApiRequest( options = Object.assign({}, options, option); try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Kitemaker/GenericFunctions.ts b/packages/nodes-base/nodes/Kitemaker/GenericFunctions.ts index 794f0b4c90..37dd622146 100644 --- a/packages/nodes-base/nodes/Kitemaker/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Kitemaker/GenericFunctions.ts @@ -20,7 +20,7 @@ export async function kitemakerRequest( json: true, }; - const responseData = await this.helpers.request!.call(this, options); + const responseData = await this.helpers.request.call(this, options); if (responseData.errors) { throw new NodeApiError(this.getNode(), responseData); diff --git a/packages/nodes-base/nodes/Linear/GenericFunctions.ts b/packages/nodes-base/nodes/Linear/GenericFunctions.ts index a2fdb58434..30e7428f40 100644 --- a/packages/nodes-base/nodes/Linear/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Linear/GenericFunctions.ts @@ -38,7 +38,7 @@ export async function linearApiRequest( }; options = Object.assign({}, options, option); try { - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error as JsonObject); } @@ -90,7 +90,7 @@ export async function validateCredentials( json: true, }; - return this.helpers.request!(options); + return this.helpers.request(options); } //@ts-ignore diff --git a/packages/nodes-base/nodes/LingvaNex/GenericFunctions.ts b/packages/nodes-base/nodes/LingvaNex/GenericFunctions.ts index 0dfdbd1608..43ccba7b8a 100644 --- a/packages/nodes-base/nodes/LingvaNex/GenericFunctions.ts +++ b/packages/nodes-base/nodes/LingvaNex/GenericFunctions.ts @@ -34,7 +34,7 @@ export async function lingvaNexApiRequest( options = Object.assign({}, options, option); - const response = await this.helpers.request!(options); + const response = await this.helpers.request(options); if (response.err !== null) { throw new NodeApiError(this.getNode(), response); diff --git a/packages/nodes-base/nodes/LinkedIn/GenericFunctions.ts b/packages/nodes-base/nodes/LinkedIn/GenericFunctions.ts index bfe80350d5..fb160e563b 100644 --- a/packages/nodes-base/nodes/LinkedIn/GenericFunctions.ts +++ b/packages/nodes-base/nodes/LinkedIn/GenericFunctions.ts @@ -34,7 +34,7 @@ export async function linkedInApiRequest( } try { - return await this.helpers.requestOAuth2!.call(this, 'linkedInOAuth2Api', options, { + return await this.helpers.requestOAuth2.call(this, 'linkedInOAuth2Api', options, { tokenType: 'Bearer', }); } catch (error) { diff --git a/packages/nodes-base/nodes/Mailcheck/GenericFunctions.ts b/packages/nodes-base/nodes/Mailcheck/GenericFunctions.ts index 341d01d920..cd795dc1e1 100644 --- a/packages/nodes-base/nodes/Mailcheck/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mailcheck/GenericFunctions.ts @@ -41,7 +41,7 @@ export async function mailCheckApiRequest( if (Object.keys(body).length === 0) { delete options.body; } - return await this.helpers.request!.call(this, options); + return await this.helpers.request.call(this, options); } catch (error) { if (error.response?.body?.message) { // Try to return the error prettier diff --git a/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts b/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts index 4629f6be78..afda2d62cc 100644 --- a/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts @@ -56,7 +56,7 @@ export async function mailchimpApiRequest( options.url = `${api_endpoint}/3.0${endpoint}`; //@ts-ignore - return await this.helpers.requestOAuth2!.call(this, 'mailchimpOAuth2Api', options, { + return await this.helpers.requestOAuth2.call(this, 'mailchimpOAuth2Api', options, { tokenType: 'Bearer', }); } @@ -114,7 +114,7 @@ async function getMetadata( url: credentials.metadataUrl as string, json: true, }; - return this.helpers.request!(options); + return this.helpers.request(options); } export const campaignFieldsMetadata = [ diff --git a/packages/nodes-base/nodes/Mandrill/GenericFunctions.ts b/packages/nodes-base/nodes/Mandrill/GenericFunctions.ts index 275d600fa4..167603d913 100644 --- a/packages/nodes-base/nodes/Mandrill/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mandrill/GenericFunctions.ts @@ -29,7 +29,7 @@ export async function mandrillApiRequest( }; try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Matrix/GenericFunctions.ts b/packages/nodes-base/nodes/Matrix/GenericFunctions.ts index 791527798b..8e1d9917f7 100644 --- a/packages/nodes-base/nodes/Matrix/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Matrix/GenericFunctions.ts @@ -41,7 +41,7 @@ export async function matrixApiRequest( option.overridePrefix || 'client' }/r0${resource}`; options.headers!.Authorization = `Bearer ${credentials.accessToken}`; - const response = await this.helpers.request!(options); + const response = await this.helpers.request(options); // When working with images, the request cannot be JSON (it's raw binary data) // But the output is JSON so we have to parse it manually. diff --git a/packages/nodes-base/nodes/Medium/GenericFunctions.ts b/packages/nodes-base/nodes/Medium/GenericFunctions.ts index 5ca64a9611..9c3a1d9616 100644 --- a/packages/nodes-base/nodes/Medium/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Medium/GenericFunctions.ts @@ -39,9 +39,9 @@ export async function mediumApiRequest( options.headers!.Authorization = `Bearer ${credentials.accessToken}`; - return await this.helpers.request!(options); + return await this.helpers.request(options); } else { - return await this.helpers.requestOAuth2!.call(this, 'mediumOAuth2Api', options); + return await this.helpers.requestOAuth2.call(this, 'mediumOAuth2Api', options); } } catch (error) { throw new NodeApiError(this.getNode(), error); diff --git a/packages/nodes-base/nodes/Microsoft/ToDo/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/ToDo/GenericFunctions.ts index 2cb96f44b3..a8e1dbdf00 100644 --- a/packages/nodes-base/nodes/Microsoft/ToDo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/ToDo/GenericFunctions.ts @@ -32,7 +32,7 @@ export async function microsoftApiRequest( delete options.body; } //@ts-ignore - return this.helpers.requestOAuth2.call(this, 'microsoftToDoOAuth2Api', options); + return await this.helpers.requestOAuth2.call(this, 'microsoftToDoOAuth2Api', options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Misp/GenericFunctions.ts b/packages/nodes-base/nodes/Misp/GenericFunctions.ts index 740898e07e..ff0096cb33 100644 --- a/packages/nodes-base/nodes/Misp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Misp/GenericFunctions.ts @@ -40,7 +40,7 @@ export async function mispApiRequest( } try { - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { // MISP API wrongly returns 403 for malformed requests if (error.statusCode === 403) { diff --git a/packages/nodes-base/nodes/Mocean/Mocean.node.ts b/packages/nodes-base/nodes/Mocean/Mocean.node.ts index b389f28604..a420c1533f 100644 --- a/packages/nodes-base/nodes/Mocean/Mocean.node.ts +++ b/packages/nodes-base/nodes/Mocean/Mocean.node.ts @@ -200,7 +200,7 @@ export class Mocean implements INodeType { json: true, }; try { - await this.helpers.request!(options); + await this.helpers.request(options); } catch (error) { return { status: 'Error', diff --git a/packages/nodes-base/nodes/MondayCom/GenericFunctions.ts b/packages/nodes-base/nodes/MondayCom/GenericFunctions.ts index dbd8bacc26..ba0c1d2702 100644 --- a/packages/nodes-base/nodes/MondayCom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/MondayCom/GenericFunctions.ts @@ -32,9 +32,9 @@ export async function mondayComApiRequest( options.headers = { Authorization: `Bearer ${credentials.apiToken}` }; - return this.helpers.request!(options); + return await this.helpers.request(options); } else { - return this.helpers.requestOAuth2!.call(this, 'mondayComOAuth2Api', options); + return await this.helpers.requestOAuth2.call(this, 'mondayComOAuth2Api', options); } } catch (error) { throw new NodeApiError(this.getNode(), error); diff --git a/packages/nodes-base/nodes/MonicaCrm/GenericFunctions.ts b/packages/nodes-base/nodes/MonicaCrm/GenericFunctions.ts index 5f89e8878b..49a41babd5 100644 --- a/packages/nodes-base/nodes/MonicaCrm/GenericFunctions.ts +++ b/packages/nodes-base/nodes/MonicaCrm/GenericFunctions.ts @@ -49,7 +49,7 @@ export async function monicaCrmApiRequest( } try { - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/N8n/GenericFunctions.ts b/packages/nodes-base/nodes/N8n/GenericFunctions.ts index 646e96a258..b069ef0e15 100644 --- a/packages/nodes-base/nodes/N8n/GenericFunctions.ts +++ b/packages/nodes-base/nodes/N8n/GenericFunctions.ts @@ -44,7 +44,7 @@ export async function apiRequest( }; try { - return this.helpers.requestWithAuthentication.call(this, 'n8nApi', options); + return await this.helpers.requestWithAuthentication.call(this, 'n8nApi', options); } catch (error) { if (error instanceof NodeApiError) { throw error; diff --git a/packages/nodes-base/nodes/Netlify/GenericFunctions.ts b/packages/nodes-base/nodes/Netlify/GenericFunctions.ts index 37930fe6f7..e1d9a3081a 100644 --- a/packages/nodes-base/nodes/Netlify/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Netlify/GenericFunctions.ts @@ -43,7 +43,7 @@ export async function netlifyApiRequest( options.headers!.Authorization = `Bearer ${credentials.accessToken}`; - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Notion/GenericFunctions.ts b/packages/nodes-base/nodes/Notion/GenericFunctions.ts index 62933a86b3..3762f1c4e0 100644 --- a/packages/nodes-base/nodes/Notion/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Notion/GenericFunctions.ts @@ -61,9 +61,9 @@ export async function notionApiRequest( delete options.body; } if (!uri) { - return this.helpers.requestWithAuthentication.call(this, 'notionApi', options); + return await this.helpers.requestWithAuthentication.call(this, 'notionApi', options); } - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Odoo/GenericFunctions.ts b/packages/nodes-base/nodes/Odoo/GenericFunctions.ts index f0be4288ff..b409621cf6 100644 --- a/packages/nodes-base/nodes/Odoo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Odoo/GenericFunctions.ts @@ -122,7 +122,7 @@ export async function odooJSONRPCRequest( json: true, }; - const responce = await this.helpers.request!(options); + const responce = await this.helpers.request(options); if (responce.error) { throw new NodeApiError(this.getNode(), responce.error.data, { message: responce.error.data.message, diff --git a/packages/nodes-base/nodes/Odoo/Odoo.node.ts b/packages/nodes-base/nodes/Odoo/Odoo.node.ts index 8016d03c18..f6a0a44132 100644 --- a/packages/nodes-base/nodes/Odoo/Odoo.node.ts +++ b/packages/nodes-base/nodes/Odoo/Odoo.node.ts @@ -269,7 +269,7 @@ export class Odoo implements INodeType { uri: `${(credentials?.url as string).replace(/\/$/, '')}/jsonrpc`, json: true, }; - const result = await this.helpers.request!(options); + const result = await this.helpers.request(options); if (result.error || !result.result) { return { status: 'Error', diff --git a/packages/nodes-base/nodes/Onfleet/GenericFunctions.ts b/packages/nodes-base/nodes/Onfleet/GenericFunctions.ts index 0455b0ed5a..f276b5b5e0 100644 --- a/packages/nodes-base/nodes/Onfleet/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Onfleet/GenericFunctions.ts @@ -42,7 +42,7 @@ export async function onfleetApiRequest( }; try { //@ts-ignore - return this.helpers.request(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/OpenThesaurus/GenericFunctions.ts b/packages/nodes-base/nodes/OpenThesaurus/GenericFunctions.ts index 6aee380cad..7b4c69c193 100644 --- a/packages/nodes-base/nodes/OpenThesaurus/GenericFunctions.ts +++ b/packages/nodes-base/nodes/OpenThesaurus/GenericFunctions.ts @@ -34,7 +34,7 @@ export async function openThesaurusApiRequest( options = Object.assign({}, options, option); options.qs.format = 'application/json'; - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Orbit/GenericFunctions.ts b/packages/nodes-base/nodes/Orbit/GenericFunctions.ts index 79e7d6575e..f6022a6c59 100644 --- a/packages/nodes-base/nodes/Orbit/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Orbit/GenericFunctions.ts @@ -36,7 +36,7 @@ export async function orbitApiRequest( options = Object.assign({}, options, option); - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Oura/GenericFunctions.ts b/packages/nodes-base/nodes/Oura/GenericFunctions.ts index 368690b58d..4f3655c5e8 100644 --- a/packages/nodes-base/nodes/Oura/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Oura/GenericFunctions.ts @@ -41,7 +41,7 @@ export async function ouraApiRequest( options = Object.assign({}, options, option); try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Paddle/GenericFunctions.ts b/packages/nodes-base/nodes/Paddle/GenericFunctions.ts index 0bf3a8390e..4a859969b6 100644 --- a/packages/nodes-base/nodes/Paddle/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Paddle/GenericFunctions.ts @@ -43,7 +43,7 @@ export async function paddleApiRequest( body.vendor_id = credentials.vendorId; body.vendor_auth_code = credentials.vendorAuthCode; try { - const response = await this.helpers.request!(options); + const response = await this.helpers.request(options); if (!response.success) { throw new NodeApiError(this.getNode(), response); diff --git a/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts b/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts index 8391833133..3a2cb7ee73 100644 --- a/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts @@ -47,9 +47,9 @@ export async function pagerDutyApiRequest( options.headers.Authorization = `Token token=${credentials.apiToken}`; - return this.helpers.request!(options); + return await this.helpers.request(options); } else { - return this.helpers.requestOAuth2!.call(this, 'pagerDutyOAuth2Api', options); + return await this.helpers.requestOAuth2.call(this, 'pagerDutyOAuth2Api', options); } } catch (error) { throw new NodeApiError(this.getNode(), error); diff --git a/packages/nodes-base/nodes/PayPal/GenericFunctions.ts b/packages/nodes-base/nodes/PayPal/GenericFunctions.ts index 8deb7b34d1..63bd6d2a22 100644 --- a/packages/nodes-base/nodes/PayPal/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PayPal/GenericFunctions.ts @@ -41,7 +41,7 @@ export async function payPalApiRequest( json: true, }; try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } @@ -82,7 +82,7 @@ async function getAccessToken( json: true, }; try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeOperationError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/PayPal/PayPal.node.ts b/packages/nodes-base/nodes/PayPal/PayPal.node.ts index aaab6ee9db..d69eb24807 100644 --- a/packages/nodes-base/nodes/PayPal/PayPal.node.ts +++ b/packages/nodes-base/nodes/PayPal/PayPal.node.ts @@ -113,7 +113,7 @@ export class PayPal implements INodeType { }; try { - await this.helpers.request!(options); + await this.helpers.request(options); return { status: 'OK', message: 'Authentication successful!', diff --git a/packages/nodes-base/nodes/Peekalink/GenericFunctions.ts b/packages/nodes-base/nodes/Peekalink/GenericFunctions.ts index f73d204745..5a5a4ce3ee 100644 --- a/packages/nodes-base/nodes/Peekalink/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Peekalink/GenericFunctions.ts @@ -34,7 +34,7 @@ export async function peekalinkApiRequest( options = Object.assign({}, options, option); - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/PostHog/GenericFunctions.ts b/packages/nodes-base/nodes/PostHog/GenericFunctions.ts index fe0de09a77..eee5103d0e 100644 --- a/packages/nodes-base/nodes/PostHog/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PostHog/GenericFunctions.ts @@ -34,7 +34,7 @@ export async function posthogApiRequest( if (Object.keys(body).length === 0) { delete options.body; } - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Postmark/GenericFunctions.ts b/packages/nodes-base/nodes/Postmark/GenericFunctions.ts index e8012b06fe..fb041bf81a 100644 --- a/packages/nodes-base/nodes/Postmark/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Postmark/GenericFunctions.ts @@ -28,7 +28,7 @@ export async function postmarkApiRequest( options = Object.assign({}, options, option); try { - return this.helpers.requestWithAuthentication.call(this, 'postmarkApi', options); + return await this.helpers.requestWithAuthentication.call(this, 'postmarkApi', options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/ProfitWell/GenericFunctions.ts b/packages/nodes-base/nodes/ProfitWell/GenericFunctions.ts index 2361e6ae71..64d338ea9f 100644 --- a/packages/nodes-base/nodes/ProfitWell/GenericFunctions.ts +++ b/packages/nodes-base/nodes/ProfitWell/GenericFunctions.ts @@ -34,7 +34,7 @@ export async function profitWellApiRequest( options = Object.assign({}, options, option); - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Pushcut/GenericFunctions.ts b/packages/nodes-base/nodes/Pushcut/GenericFunctions.ts index 7ce44cf19e..b29003d7e7 100644 --- a/packages/nodes-base/nodes/Pushcut/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Pushcut/GenericFunctions.ts @@ -34,7 +34,7 @@ export async function pushcutApiRequest( Object.assign(options, option); } //@ts-ignore - return this.helpers.request.call(this, options); + return await this.helpers.request.call(this, options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts b/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts index 94ffa5a0c2..74befffa75 100644 --- a/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts +++ b/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts @@ -84,7 +84,7 @@ export async function quickBooksApiRequest( } try { - return this.helpers.requestOAuth2!.call(this, 'quickBooksOAuth2Api', options); + return await this.helpers.requestOAuth2.call(this, 'quickBooksOAuth2Api', options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Raindrop/GenericFunctions.ts b/packages/nodes-base/nodes/Raindrop/GenericFunctions.ts index bea2157e38..1aacee4006 100644 --- a/packages/nodes-base/nodes/Raindrop/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Raindrop/GenericFunctions.ts @@ -40,7 +40,7 @@ export async function raindropApiRequest( } try { - return this.helpers.requestOAuth2!.call(this, 'raindropOAuth2Api', options, { + return await this.helpers.requestOAuth2.call(this, 'raindropOAuth2Api', options, { includeCredentialsOnRefreshOnBody: true, }); } catch (error) { diff --git a/packages/nodes-base/nodes/S3/GenericFunctions.ts b/packages/nodes-base/nodes/S3/GenericFunctions.ts index 9f9f28f465..553900e6be 100644 --- a/packages/nodes-base/nodes/S3/GenericFunctions.ts +++ b/packages/nodes-base/nodes/S3/GenericFunctions.ts @@ -82,7 +82,7 @@ export async function s3ApiRequest( Object.assign(options, option); } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts b/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts index 3d540e4e06..fd679407dd 100644 --- a/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts @@ -178,7 +178,7 @@ async function getAccessToken( json: true, }; - return this.helpers.request!(options); + return this.helpers.request(options); } export function getConditions(options: IDataObject) { diff --git a/packages/nodes-base/nodes/Salesmate/GenericFunctions.ts b/packages/nodes-base/nodes/Salesmate/GenericFunctions.ts index 2747b73eb4..fcfad002d9 100644 --- a/packages/nodes-base/nodes/Salesmate/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Salesmate/GenericFunctions.ts @@ -41,7 +41,7 @@ export async function salesmateApiRequest( delete options.body; } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts b/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts index caa0d75b00..88e02b73ad 100644 --- a/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SeaTable/GenericFunctions.ts @@ -58,7 +58,7 @@ export async function seaTableApiRequest( try { //@ts-ignore - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } @@ -154,7 +154,7 @@ export async function getBaseAccessToken( json: true, }; - ctx.base = await this.helpers.request!(options); + ctx.base = await this.helpers.request(options); } export function resolveBaseUri(ctx: ICtx) { diff --git a/packages/nodes-base/nodes/SecurityScorecard/GenericFunctions.ts b/packages/nodes-base/nodes/SecurityScorecard/GenericFunctions.ts index 7e9692aa53..20d5909f59 100644 --- a/packages/nodes-base/nodes/SecurityScorecard/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SecurityScorecard/GenericFunctions.ts @@ -39,7 +39,7 @@ export async function scorecardApiRequest( delete options.qs; } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/SentryIo/GenericFunctions.ts b/packages/nodes-base/nodes/SentryIo/GenericFunctions.ts index 02ca6f5dd2..04d82d33e2 100644 --- a/packages/nodes-base/nodes/SentryIo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SentryIo/GenericFunctions.ts @@ -72,7 +72,7 @@ export async function sentryIoApiRequest( //@ts-ignore return await this.helpers.request(options); } else { - return await this.helpers.requestOAuth2!.call(this, 'sentryIoOAuth2Api', options); + return await this.helpers.requestOAuth2.call(this, 'sentryIoOAuth2Api', options); } } catch (error) { throw new NodeApiError(this.getNode(), error); diff --git a/packages/nodes-base/nodes/Splunk/GenericFunctions.ts b/packages/nodes-base/nodes/Splunk/GenericFunctions.ts index 4acf0a312e..4597ccd37a 100644 --- a/packages/nodes-base/nodes/Splunk/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Splunk/GenericFunctions.ts @@ -48,7 +48,7 @@ export async function splunkApiRequest( } try { - return this.helpers.request!(options).then(parseXml); + return await this.helpers.request(options).then(parseXml); } catch (error) { if (error?.cause?.code === 'ECONNREFUSED') { throw new NodeApiError(this.getNode(), { ...error, code: 401 }); diff --git a/packages/nodes-base/nodes/Stackby/GenericFunction.ts b/packages/nodes-base/nodes/Stackby/GenericFunction.ts index e7413d7b07..ebfa42636e 100644 --- a/packages/nodes-base/nodes/Stackby/GenericFunction.ts +++ b/packages/nodes-base/nodes/Stackby/GenericFunction.ts @@ -40,7 +40,7 @@ export async function apiRequest( } try { - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Storyblok/GenericFunctions.ts b/packages/nodes-base/nodes/Storyblok/GenericFunctions.ts index 9952e7c00b..ef8618b3e4 100644 --- a/packages/nodes-base/nodes/Storyblok/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Storyblok/GenericFunctions.ts @@ -54,7 +54,7 @@ export async function storyblokApiRequest( } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Strapi/GenericFunctions.ts b/packages/nodes-base/nodes/Strapi/GenericFunctions.ts index f778cce519..5ba7b0dd20 100644 --- a/packages/nodes-base/nodes/Strapi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Strapi/GenericFunctions.ts @@ -70,7 +70,7 @@ export async function getToken( : `${credentials.url}/auth/local`, json: true, }; - return this.helpers.request!(options); + return this.helpers.request(options); } export async function strapiApiRequestAllItems( diff --git a/packages/nodes-base/nodes/Supabase/GenericFunctions.ts b/packages/nodes-base/nodes/Supabase/GenericFunctions.ts index 709e810019..c7744d2843 100644 --- a/packages/nodes-base/nodes/Supabase/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Supabase/GenericFunctions.ts @@ -320,5 +320,5 @@ export async function validateCredentials( json: true, }; - return this.helpers.request!(options); + return this.helpers.request(options); } diff --git a/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts b/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts index 9d4133cd96..6c9cea0cc0 100644 --- a/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts @@ -43,9 +43,9 @@ export async function surveyMonkeyApiRequest( // @ts-ignore options.headers.Authorization = `bearer ${credentials.accessToken}`; - return this.helpers.request!(options); + return await this.helpers.request(options); } else { - return this.helpers.requestOAuth2?.call(this, 'surveyMonkeyOAuth2Api', options); + return await this.helpers.requestOAuth2?.call(this, 'surveyMonkeyOAuth2Api', options); } } catch (error) { throw new NodeApiError(this.getNode(), error); diff --git a/packages/nodes-base/nodes/Taiga/GenericFunctions.ts b/packages/nodes-base/nodes/Taiga/GenericFunctions.ts index 9b0139920e..394c4c9e97 100644 --- a/packages/nodes-base/nodes/Taiga/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Taiga/GenericFunctions.ts @@ -44,7 +44,7 @@ export async function getAuthorization( }; try { - const response = await this.helpers.request!(options); + const response = await this.helpers.request(options); return response.auth_token; } catch (error) { @@ -92,7 +92,7 @@ export async function taigaApiRequest( } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Tapfiliate/GenericFunctions.ts b/packages/nodes-base/nodes/Tapfiliate/GenericFunctions.ts index ce30d39776..c22ca307af 100644 --- a/packages/nodes-base/nodes/Tapfiliate/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Tapfiliate/GenericFunctions.ts @@ -40,7 +40,7 @@ export async function tapfiliateApiRequest( Object.assign(options, option); } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Telegram/GenericFunctions.ts b/packages/nodes-base/nodes/Telegram/GenericFunctions.ts index 9f2fbebf00..10f81f2fee 100644 --- a/packages/nodes-base/nodes/Telegram/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Telegram/GenericFunctions.ts @@ -173,7 +173,7 @@ export async function apiRequest( } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Toggl/GenericFunctions.ts b/packages/nodes-base/nodes/Toggl/GenericFunctions.ts index 6fd51ae4bb..20dd6800ab 100644 --- a/packages/nodes-base/nodes/Toggl/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Toggl/GenericFunctions.ts @@ -48,7 +48,7 @@ export async function togglApiRequest( delete options.body; } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/TravisCi/GenericFunctions.ts b/packages/nodes-base/nodes/TravisCi/GenericFunctions.ts index ba3711f201..64559d1293 100644 --- a/packages/nodes-base/nodes/TravisCi/GenericFunctions.ts +++ b/packages/nodes-base/nodes/TravisCi/GenericFunctions.ts @@ -40,7 +40,7 @@ export async function travisciApiRequest( delete options.body; } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Typeform/GenericFunctions.ts b/packages/nodes-base/nodes/Typeform/GenericFunctions.ts index 461c2536e7..eed52bcb68 100644 --- a/packages/nodes-base/nodes/Typeform/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Typeform/GenericFunctions.ts @@ -55,7 +55,7 @@ export async function apiRequest( if (authenticationMethod === 'accessToken') { return await this.helpers.requestWithAuthentication.call(this, 'typeformApi', options); } else { - return await this.helpers.requestOAuth2!.call(this, 'typeformOAuth2Api', options); + return await this.helpers.requestOAuth2.call(this, 'typeformOAuth2Api', options); } } catch (error) { throw new NodeApiError(this.getNode(), error); diff --git a/packages/nodes-base/nodes/UnleashedSoftware/GenericFunctions.ts b/packages/nodes-base/nodes/UnleashedSoftware/GenericFunctions.ts index c975df2a7f..334240c96d 100644 --- a/packages/nodes-base/nodes/UnleashedSoftware/GenericFunctions.ts +++ b/packages/nodes-base/nodes/UnleashedSoftware/GenericFunctions.ts @@ -53,7 +53,7 @@ export async function unleashedApiRequest( }); try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Uplead/GenericFunctions.ts b/packages/nodes-base/nodes/Uplead/GenericFunctions.ts index a8c7368c38..073bdaec2e 100644 --- a/packages/nodes-base/nodes/Uplead/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Uplead/GenericFunctions.ts @@ -31,7 +31,7 @@ export async function upleadApiRequest( delete options.body; } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts b/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts index 2861d7e8a2..a7f0d76265 100644 --- a/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts @@ -49,7 +49,11 @@ export async function venafiApiRequest( if (Object.keys(body).length === 0) { delete options.body; } - return this.helpers.requestWithAuthentication.call(this, 'venafiTlsProtectCloudApi', options); + return await this.helpers.requestWithAuthentication.call( + this, + 'venafiTlsProtectCloudApi', + options, + ); } catch (error) { throw new NodeApiError(this.getNode(), error as JsonObject); } diff --git a/packages/nodes-base/nodes/Vero/GenericFunctions.ts b/packages/nodes-base/nodes/Vero/GenericFunctions.ts index 0e2dc908dc..2bf80d7b93 100644 --- a/packages/nodes-base/nodes/Vero/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Vero/GenericFunctions.ts @@ -30,7 +30,7 @@ export async function veroApiRequest( delete options.body; } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Workable/GenericFunctions.ts b/packages/nodes-base/nodes/Workable/GenericFunctions.ts index 7a1a0b40c5..baa63e27eb 100644 --- a/packages/nodes-base/nodes/Workable/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Workable/GenericFunctions.ts @@ -37,7 +37,7 @@ export async function workableApiRequest( delete options.body; } try { - return await this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Zammad/GenericFunctions.ts b/packages/nodes-base/nodes/Zammad/GenericFunctions.ts index 9ec38bd715..9b2037c4f8 100644 --- a/packages/nodes-base/nodes/Zammad/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zammad/GenericFunctions.ts @@ -65,7 +65,7 @@ export async function zammadApiRequest( } try { - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { if (error.error.error === 'Object already exists!') { error.error.error = 'An entity with this name already exists.'; diff --git a/packages/nodes-base/nodes/Zulip/GenericFunctions.ts b/packages/nodes-base/nodes/Zulip/GenericFunctions.ts index 6fca05bd62..7c7735d716 100644 --- a/packages/nodes-base/nodes/Zulip/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zulip/GenericFunctions.ts @@ -40,7 +40,7 @@ export async function zulipApiRequest( } options = Object.assign({}, options, option); try { - return this.helpers.request!(options); + return await this.helpers.request(options); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 0401ec3a8f..9b9401bc33 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -19,7 +19,7 @@ "build:translations": "gulp build:translations", "build:metadata": "pnpm n8n-generate-known && pnpm n8n-generate-ui-types", "format": "prettier --write . --ignore-path ../../.prettierignore", - "lint": "eslint nodes credentials", + "lint": "eslint --quiet nodes credentials", "lintfix": "eslint nodes credentials --fix", "watch": "tsc-watch --onSuccess \"pnpm n8n-generate-ui-types\"", "test": "jest" diff --git a/packages/workflow/package.json b/packages/workflow/package.json index 767e365716..5afcac5e41 100644 --- a/packages/workflow/package.json +++ b/packages/workflow/package.json @@ -29,7 +29,7 @@ "typecheck": "tsc", "build": "tsc -p tsconfig.build.json", "format": "prettier --write . --ignore-path ../../.prettierignore", - "lint": "eslint .", + "lint": "eslint --quiet .", "lintfix": "eslint . --fix", "watch": "tsc -p tsconfig.build.json --watch", "test": "jest",