diff --git a/packages/cli/package.json b/packages/cli/package.json index 2c25a68f3..7c35c4877 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 3607c23ed..1fb510fa1 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 3dde9c51c..339adbc46 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 48fb20785..af84c4773 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 b5151e4ff..0ed7cd533 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 d39596c48..51e3981ed 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 180530d6c..8ebeac607 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 393e91238..576e5b696 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 ce70145ae..a7b322c78 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 2f6cddd71..1f7955f19 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 c6efb9478..f383c9de1 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 915bf5ab7..a9f391630 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 28c02490f..83ec71a9c 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 b969fc06c..f55259feb 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 9e973dfd3..f29517a88 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 b01206ad9..29434c42a 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 e51b2435e..dafeb2e9c 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 8c998a2a6..e79f6e0c8 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 65d4f4192..7e56fdaf9 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 8553ddeb5..94743117c 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 891b0d736..cc3466793 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 e5d040031..0e5c6c1e1 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 43ef7fa10..8994b9496 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 3963bf030..75248a2b7 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 e63731eee..3704d2cd6 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 430cc6026..06355708c 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 273265707..01bd993bf 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 81e14f681..830798b79 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 6e95ff921..625d1125e 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 3ad09af3b..b4227f8da 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 1cf1d59eb..1f74ea5f9 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 20d209296..7a18aac2a 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 6d9fc9759..30e9ea8d8 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 b43e29fbf..8cdb2d950 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 bda8d0321..3b21e8f2f 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 a2e4eeb63..b09087f97 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 461c87978..8d4ebf0f2 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 7512c5886..ddaec221b 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 78582b702..733ce918f 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 5bf1fbdfb..7aa17fd22 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 d8bd63816..43abc3282 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 23d95c7cf..a784cb926 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 bd76980b4..874b3760d 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 fd57ae5e6..a88cf2e57 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 69e0c7468..02c2c79e0 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 4fe1fc103..0b7f8a9d5 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 7ddec2611..f2ce1127c 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 f67a3d5ac..9ba5a9716 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 c202e3e66..38543abec 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 1faf25792..001c2653e 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 b7185629e..4d1b26a8c 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 07d097800..c7a864ca0 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 e70220f84..d9e3256df 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 e4996c8b0..80b495784 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 ae0a9e6e7..65b24a17b 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 37b223d56..bfca19920 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 7a29b1dbd..862b823f9 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 4b5410362..e71a506d0 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 7685d0a8d..d2fcbdddc 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 fd09171e8..e8ed43c75 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 532f2f224..a22c9877e 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 6a1b9d137..7c1be1b21 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 8ee258e51..2124035ee 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 178cb19c4..f9c149c9c 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 6ccfeb24f..27576fcfd 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 35956d18f..ad2140340 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 8932a2f3c..224ee6ecb 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 58a6b8986..bfeaf71f4 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 e5cd6d3da..457fd4ba5 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 4ae114f05..04cfe5a9f 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 794f0b4c9..37dd62214 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 a2fdb5843..30e7428f4 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 0dfdbd160..43ccba7b8 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 bfe80350d..fb160e563 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 341d01d92..cd795dc1e 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 4629f6be7..afda2d62c 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 275d600fa..167603d91 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 791527798..8e1d9917f 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 5ca64a961..9c3a1d961 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 2cb96f44b..a8e1dbdf0 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 740898e07..ff0096cb3 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 b389f2860..a420c1533 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 dbd8bacc2..ba0c1d270 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 5f89e8878..49a41babd 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 646e96a25..b069ef0e1 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 37930fe6f..e1d9a3081 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 62933a86b..3762f1c4e 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 f0be4288f..b409621cf 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 8016d03c1..f6a0a4413 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 0455b0ed5..f276b5b5e 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 6aee380ca..7b4c69c19 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 79e7d6575..f6022a6c5 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 368690b58..4f3655c5e 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 0bf3a8390..4a859969b 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 839183313..3a2cb7ee7 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 8deb7b34d..63bd6d2a2 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 aaab6ee9d..d69eb2480 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 f73d20474..5a5a4ce3e 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 fe0de09a7..eee5103d0 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 e8012b06f..fb041bf81 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 2361e6ae7..64d338ea9 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 7ce44cf19..b29003d7e 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 94ffa5a0c..74befffa7 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 bea2157e3..1aacee400 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 9f9f28f46..553900e6b 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 3d540e4e0..fd679407d 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 2747b73eb..fcfad002d 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 caa0d75b0..88e02b73a 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 7e9692aa5..20d5909f5 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 02ca6f5dd..04d82d33e 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 4acf0a312..4597ccd37 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 e7413d7b0..ebfa42636 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 9952e7c00..ef8618b3e 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 f778cce51..5ba7b0dd2 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 709e81001..c7744d284 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 9d4133cd9..6c9cea0cc 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 9b0139920..394c4c9e9 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 ce30d3977..c22ca307a 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 9f2fbebf0..10f81f2fe 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 6fd51ae4b..20dd6800a 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 ba3711f20..64559d129 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 461c2536e..eed52bcb6 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 c975df2a7..334240c96 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 a8c7368c3..073bdaec2 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 2861d7e8a..a7f0d7626 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 0e2dc908d..2bf80d7b9 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 7a1a0b40c..baa63e27e 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 9ec38bd71..9b2037c4f 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 6fca05bd6..7c7735d71 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 0401ec3a8..9b9401bc3 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 767e36571..5afcac5e4 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",